anomalyco / anomalyco/opencode

chore: adopt opencode-drive and terminal catalog as packages/drive and packages/lab/catalog

Open
#42,126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

What

Adopt the anomalyco/opencode-drive repo into this monorepo as two packages, and deploy the terminal catalog to dev.opencode.ai/lab/catalog.

  • packages/drive — the opencode-drive npm package (~24k lines TS): TUI driver, deterministic LLM, frame capture, recording, script runner, CLI.
  • packages/lab/catalog — the terminal-state catalog app (~8k lines TS/TSX/CSS + 2.7 MB capture frames), currently deployed at catalog.kitlangton.dev. packages/lab/* becomes the umbrella for internal design/dev tooling (precedent: nested workspaces already exist via packages/console/*).

Why

  • Drive's whole purpose is testing OpenCode at HEAD, but from an external repo it chases published @opencode-ai/client next-channel snapshots (0.0.0-next-17010 today). In-repo it becomes workspace:* and tests/captures run against the working tree.
  • Catalog captures of "current HEAD" stop requiring detached-worktree preparation of this repo.
  • Opens the door to TUI regression gates in CI using drive.
  • One less repo to maintain; the catalog gets first-party hosting instead of a personal domain.

Preconditions

  • The in-flight theme-matrix work in opencode-drive lands first (full 63-state recapture at current HEAD for themes opencode/tokyonight/everforest, Notifications toast family). Do not start before that merges.

Plan

1. Flat import (no history)
  • Copy packages/drive and apps/catalogpackages/drive and packages/lab/catalog. Clean import; history stays in the archived source repo.
  • Add packages/lab/* to root package.json workspaces.
  • Drop Changesets entirely (config, scripts, CHANGELOG workflow). If/when opencode-drive needs publishing from here, follow the @opencode-ai/http-recorder precedent.
  • Dependency alignment: @opencode-ai/clientworkspace:*; effect/@effect/*/shared dev deps → catalog: entries (versions already match: bun 1.3.14, effect 4.0.0-beta.101). Keep @opentui/core pinned as drive requires.
  • Wire typecheck into turbo, keep package-local bun run test (repo rule: tests never run from root).
2. Capture pipeline simplification
  • Current-HEAD captures run directly against the working tree (no worktree prep). Keep --revision worktree mode for capturing historical/pinned commits.
3. Base path support
  • The app assumes root serving. Add /lab/catalog base: bun build --public-path, base constant in deep-link.ts URL builders, and prefixed fetches for catalog.json / drive-captures.json / capture frames.
4. Deploy
  • packages/lab/catalog/wrangler.jsonc: worker opencode-lab-catalog, assets binding, route dev.opencode.ai/lab/catalog* (zone opencode.ai). No production route on purpose — this is internal tooling; promoting it later is a two-line change.
  • .github/workflows/deploy-lab-catalog.yml cloned from deploy-www.yml: push to dev with paths: packages/lab/catalog/** (+ packages/drive/** since captures embed drive behavior), build, wrangler deploy with existing CLOUDFLARE_API_TOKEN.
5. Decommission
  • Point catalog.kitlangton.dev at the new worker temporarily or delete the old opencode-terminal-catalog worker after verifying the new URL.
  • Archive anomalyco/opencode-drive (read-only) with a README pointer. Move the catalog/design-feedback issue labels + prefilled-feedback URL target to anomalyco/opencode (update src/feedback.ts).
  • Migrate the repo skills/AGENTS notes that reference opencode-drive paths.

Verification

  • bun run lint, bun typecheck, bun run test from both package dirs; catalog bun run build.
  • One full capture run against working-tree HEAD producing all states across the three themes.
  • Browser-verify dev.opencode.ai/lab/catalog: deep links, filters, viewer, feedback links target the new repo.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking the theme-matrix precondition and then inspect root package.json, packages/drive, packages/lab/catalog, and the deploy-www.yml workflow. Run the listed package-local checks and catalog build while tracing the capture pipeline and deep-link.ts base-path handling. Done means both packages are integrated, deployed at the specified route, and browser verification passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, github-actions, typescript
Domain
build-system, ci-cd, cloud, devops, testing-qa, tooling, web-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.