fix: sync with upstream OpenCode V2 and restore a buildable dev
Issue for this PR
Closes #417
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
dev has not installed, typechecked, tested, or built since September. The -X ours upstream merge in #415 mixed retired V1 files with upstream V2 files, half renamed the workspace packages (@opencode/* imports with no matching workspace), and dropped catalog entries, so bun install fails before anything else runs.
This PR merges anomalyco/opencode dev (296074aab2, 919 commits ahead of our last sync) and rebuilds the tree on it:
- Every upstream path now matches upstream. Workspace packages keep their upstream
@opencode/*names, which is what makes futuregit merge upstream/devapply cleanly. - The Bolt overlay stays: the
boltcommand, README, AGPL-3.0LICENSEandCREDITS,SECURITY.md, the release installer, the Bolt deploy gate, issue and PR automation, and Bolt infra names. The full list is inlegacy/README.md. - Bolt V1 code that cannot build on V2 (
packages/opencode,packages/memory, the unregistered V1 command handlers, extra core tools, TUI features, V1 docs) moved unchanged tolegacy/<original path>. It is outside the workspaces and ignored by oxlint, so it no longer breaks the build, and it is kept for porting. - Stale files that upstream deleted or renamed are removed.
The bolt command delegates to the same launcher as opencode2:
#!/usr/bin/env node
require("./opencode.cjs")
As requested, every change is its own commit touching one file (7,202 commits after the merge commit). The merge commit itself changes no files: it records upstream as a parent so later syncs start from 296074aab2. Merge this PR with a merge commit; a squash would drop that parent.
How did you verify your code works?
git diffbetween this branch and a scratch tree built as upstreamdevplus the overlay is empty.- Every commit after the merge touches exactly one path.
- Dependency install, lint, typecheck, unit tests, and the CLI build run in CI on this PR (
check,check-test). They could not run in the agent sandbox.
Screenshots / recordings
Not a UI change.
Checklist
- I have tested my changes locally (CI runs the checks; the sandbox cannot)
- I have not included unrelated changes in this PR