feat(opencode): native opencode addon — bottom-row project indicator + in-TUI switcher
Some checks failed
CI/CD / lint (pull_request) Successful in 1m10s
CI/CD / test (pull_request) Successful in 1m23s
CI/CD / typecheck (pull_request) Successful in 2m58s
CI/CD / smoke (pull_request) Failing after 1m55s
CI/CD / build (pull_request) Successful in 4m56s
CI/CD / publish (pull_request) Has been skipped
Some checks failed
CI/CD / lint (pull_request) Successful in 1m10s
CI/CD / test (pull_request) Successful in 1m23s
CI/CD / typecheck (pull_request) Successful in 2m58s
CI/CD / smoke (pull_request) Failing after 1m55s
CI/CD / build (pull_request) Successful in 4m56s
CI/CD / publish (pull_request) Has been skipped
Adds an opencode integration mirroring the existing pi and prime-agent addons.
The addon is a TUI plugin (`src/opencode-ext/open-mcpctl.tsx`) that:
- renders the active mcpctl project into opencode's `app_bottom` slot — the
status row that also carries the token counter / model info,
- registers a `mcpctl.switch_project` command bound to `<leader>m` that opens a
searchable `DialogSelect` project picker,
- switches live by re-pointing opencode's `mcpctl` MCP server at the new
project's mcplocal endpoint via the SDK client (native MCP, no JSON-RPC code),
- persists state in `~/.mcpctl/opencode-state.json` (+ `.mcpctl-project` marker).
Pure helpers (`filterProjects`, `toolChangeAnnouncement`) live in
`projects.ts` so they are unit-tested.
`mcpctl config opencode --project X` provisions it: writes the plugin into
`~/.config/opencode/plugin/`, registers the `.tsx` in opencode.json's plugin
array (auto-discovery only matches {ts,js}), best-effort installs the TUI peer
deps (`@opentui/*`), and syncs skills into `~/.config/opencode/skill`.
`mcpctl skills sync --agent opencode` is added as a fourth shared-tree target.
Closes typecheck gap with `typecheck:opencode-ext` against the real
`@opencode-ai/plugin` + `@opentui/solid` types.
Tests: embed freshness, opencode-settings, projects helpers, skills agent
root. Full `pnpm run typecheck` + cli tests pass; completions regenerated.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
"clean": "pnpm -r run clean && rimraf node_modules",
|
||||
"db:up": "docker compose -f deploy/docker-compose.yml up -d",
|
||||
"db:down": "docker compose -f deploy/docker-compose.yml down",
|
||||
"typecheck": "tsc --build && pnpm run typecheck:pi-ext",
|
||||
"typecheck": "tsc --build && pnpm run typecheck:pi-ext && pnpm run typecheck:opencode-ext",
|
||||
"completions:generate": "tsx scripts/generate-completions.ts --write",
|
||||
"completions:check": "tsx scripts/generate-completions.ts --check",
|
||||
"rpm:build": "bash scripts/build-rpm.sh",
|
||||
@@ -34,6 +34,7 @@
|
||||
"mcpd:deploy-dry": "bash deploy.sh --dry-run",
|
||||
"mcpd:logs": "bash logs.sh",
|
||||
"typecheck:pi-ext": "tsc -p src/pi-ext/tsconfig.json",
|
||||
"typecheck:opencode-ext": "tsc -p src/opencode-ext/tsconfig.json",
|
||||
"smoke:clean": "tsx scripts/clean-smoke-resources.ts"
|
||||
},
|
||||
"engines": {
|
||||
@@ -44,6 +45,11 @@
|
||||
"devDependencies": {
|
||||
"@earendil-works/pi-ai": "^0.84.1",
|
||||
"@earendil-works/pi-coding-agent": "0.84.1",
|
||||
"@opencode-ai/plugin": "1.18.15",
|
||||
"@opencode-ai/sdk": "1.18.15",
|
||||
"@opentui/core": "0.4.5",
|
||||
"@opentui/keymap": "0.4.5",
|
||||
"@opentui/solid": "0.4.5",
|
||||
"@types/node": "^25.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
||||
"@typescript-eslint/parser": "^8.56.0",
|
||||
@@ -51,6 +57,7 @@
|
||||
"eslint": "^10.0.1",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"rimraf": "^6.1.3",
|
||||
"solid-js": "^1.9.14",
|
||||
"tsx": "^4.21.0",
|
||||
"typebox": "1.3.11",
|
||||
"typescript": "^5.9.3",
|
||||
|
||||
Reference in New Issue
Block a user