Files
backnotprop__plannotator/apps/opencode-plugin/package.json
T

52 lines
1.8 KiB
JSON
Raw Normal View History

{
"name": "@plannotator/opencode",
2026-08-10 17:00:33 -07:00
"version": "0.26.8",
"type": "module",
"description": "Plannotator plugin for OpenCode - interactive plan review with visual annotation",
"author": "backnotprop",
"license": "MIT OR Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/backnotprop/plannotator.git",
"directory": "apps/opencode-plugin"
},
"homepage": "https://github.com/backnotprop/plannotator",
"bugs": {
"url": "https://github.com/backnotprop/plannotator/issues"
},
"keywords": [
"opencode",
"opencode-plugin",
"plannotator",
"plan-review",
"ai-agent",
"coding-agent"
],
"//": "OpenCode 1 loads main, while OpenCode 2 loads exports[.]. Do not add ./server: OpenCode 1 checks it before main and would load the V2 adapter.",
Fix/devcontainer & plan auto switching (opencode) (#31) * Refactor: shared server package with PLANNOTATOR_REMOTE env var - Create packages/server/ with shared server implementation - Add PLANNOTATOR_REMOTE=1 env var for devcontainer/SSH mode - Deprecate SSH_CONNECTION detection (still works with warning) - Both Claude Code and OpenCode now use identical server logic - OpenCode gains Obsidian/Bear integrations and remote detection - Update documentation with environment variables section Fixes #27 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove PLANNOTATOR_ORIGIN env var, fix onReady callback timing - Remove PLANNOTATOR_ORIGIN hack from Claude Code hook (hardcode "claude-code") - Fix onReady callback to pass port directly (was referencing undefined server) - Create tests/manual/test-server.ts for testing either origin - Update test-hook-2.sh to use new test server with opencode origin 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add devcontainer test setup, reduce logging verbosity - Add tests/devcontainer/ with devcontainer.json for testing remote mode - Add tests/opencode-local/ for local OpenCode testing - Update package.json build script for proper bundling - Remove verbose multi-line error messages, keep useful errors - Clean up unused deprecationWarned variable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add devcontainer support and documentation - Add PLANNOTATOR_REMOTE env var for container/remote detection - Remove console logging (silent operation) - Add devcontainer.md with full setup instructions - Add devcontainer section to OpenCode plugin README - Add port-only test setup to reproduce common misconfiguration - Update test devcontainers to forward port 4096 for opencode web - Bump version to 0.4.1 Fixes #27 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update CLAUDE.md: legacy SSH detection, not deprecated Removed incorrect mention of deprecation warning - SSH_TTY/SSH_CONNECTION detection is silent by design. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix OpenCode agent switching after plan approval After approving a plan, the conversation context stayed in "plan" mode even though the TUI showed "build". This caused edits to fail because the plan agent has edit permissions denied. The fix uses session.prompt() to inject a message with agent: "build", which triggers a new agentic loop with proper build agent permissions. Fixes #29 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:25:19 -08:00
"main": "dist/index.js",
"exports": {
".": "./dist/server.js"
},
"files": [
Fix/devcontainer & plan auto switching (opencode) (#31) * Refactor: shared server package with PLANNOTATOR_REMOTE env var - Create packages/server/ with shared server implementation - Add PLANNOTATOR_REMOTE=1 env var for devcontainer/SSH mode - Deprecate SSH_CONNECTION detection (still works with warning) - Both Claude Code and OpenCode now use identical server logic - OpenCode gains Obsidian/Bear integrations and remote detection - Update documentation with environment variables section Fixes #27 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove PLANNOTATOR_ORIGIN env var, fix onReady callback timing - Remove PLANNOTATOR_ORIGIN hack from Claude Code hook (hardcode "claude-code") - Fix onReady callback to pass port directly (was referencing undefined server) - Create tests/manual/test-server.ts for testing either origin - Update test-hook-2.sh to use new test server with opencode origin 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add devcontainer test setup, reduce logging verbosity - Add tests/devcontainer/ with devcontainer.json for testing remote mode - Add tests/opencode-local/ for local OpenCode testing - Update package.json build script for proper bundling - Remove verbose multi-line error messages, keep useful errors - Clean up unused deprecationWarned variable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add devcontainer support and documentation - Add PLANNOTATOR_REMOTE env var for container/remote detection - Remove console logging (silent operation) - Add devcontainer.md with full setup instructions - Add devcontainer section to OpenCode plugin README - Add port-only test setup to reproduce common misconfiguration - Update test devcontainers to forward port 4096 for opencode web - Bump version to 0.4.1 Fixes #27 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update CLAUDE.md: legacy SSH detection, not deprecated Removed incorrect mention of deprecation warning - SSH_TTY/SSH_CONNECTION detection is silent by design. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix OpenCode agent switching after plan approval After approving a plan, the conversation context stayed in "plan" mode even though the TUI showed "build". This caused edits to fail because the plan agent has edit permissions denied. The fix uses session.prompt() to inject a message with agent: "build", which triggers a new agentic loop with proper build agent permissions. Fixes #29 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:25:19 -08:00
"dist",
"commands",
"README.md",
"plannotator.html",
"review-editor.html"
],
"scripts": {
"build": "mkdir -p dist && cp ../hook/dist/index.html ./plannotator.html && cp ../review/dist/index.html ./review-editor.html && bun build embedded.ts --outfile dist/embedded.js --target bun --external @opencode-ai/plugin && bun build index.ts --outfile dist/index.js --target node && bun build server.ts --outfile dist/server.js --target node --external @opencode-ai/plugin",
"smoke:v2": "bun fixtures/v2-installed-smoke.ts",
"postinstall": "mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/commands && cp ./commands/*.md ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/commands/ 2>/dev/null || true",
"prepublishOnly": "bun run build"
},
"devDependencies": {
fix(opencode): drop runtime dependency on prerelease plugin nightly (#1199) * fix(opencode): drop runtime dependency on prerelease plugin nightly `@opencode-ai/plugin` was a runtime dependency pinned to the exact nightly 0.0.0-next-16775, so every `npm install @plannotator/opencode` resolved a prerelease snapshot sitting inside npm's 72h unpublish window and pulled 95MB across 101 packages (effect@4.0.0-beta.101 alone is 47MB). None of it is executed by OpenCode 1 users. The only runtime use was `Plugin.define`, which is an identity function (`export function define(plugin) { return plugin; }`, verified identical across 0.0.0-next-16775, next-16600, next-16797 and stable 1.18.13). The import is now type-only and the plugin is a plain object literal checked with `satisfies Plugin.Plugin`. OpenCode 2's loader validation is purely structural (`Schema.Struct({ id: String, setup: function })` in its supervisor), so an object literal satisfies it. The package moves to devDependencies. Built `dist/index.js` and `dist/embedded.js` are byte-identical to the pre-change build; `dist/server.js` differs only by the dropped import and the two `Plugin.define(...)` wrapper lines. * docs(opencode): explain why the V2 logReady callback is empty The old one-liner read as an unfinished TODO. The empty function is correct: OpenCode 2's server-plugin Context exposes no `log` or `tui` domain, `@opencode-ai/client` has no `tui` namespace and zero `/tui/*` routes (checked on 0.0.0-next-16775 and next-16797), and `createV2Client`'s `app.log` bottoms out in `console.error`, the same stderr stream `handleServerReady` already writes to. Wiring it would print the session URL twice in remote mode and add a stray line locally. V1 targets `client.app.log` and `client.tui.showToast`, which are HTTP surfaces distinct from stderr, so V1 never repeats itself. `tui.toast.show` exists in V2 only as a subscribe-only event and on the separate `@opencode-ai/plugin/tui` context, a different plugin kind in a different process, so a real toast needs an upstream OpenCode API. Comment only, no behavior change.
2026-08-04 20:38:28 -07:00
"@opencode-ai/plugin": "0.0.0-next-16775",
refactor: shared feedback templates + preserve plan title on deny (#296) (#298) * refactor: shared feedback templates across all integrations The deny/feedback prompts sent to LLM agents were duplicated as inline string templates in hook, opencode-plugin, and pi-extension — each with different tone and framing. The hook's directive style (from #224) was the most effective at getting agents to address feedback. This extracts all feedback text into @plannotator/shared/feedback-templates and has every integration import from the single source of truth. Closes #215 follow-up (propagates fix to OpenCode and Pi). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: rewrite feedback template tests around contracts not implementation Tests now verify: cross-integration consistency, verbatim feedback preservation, empty input handling, and that approved messages don't contain directive language. Wording can change freely without breaking tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: instruct agent to preserve plan title on resubmission (#296) Version history slugs are derived from the plan's first # heading. When the agent renames the heading after a deny, the version chain breaks and the user loses diffs. The deny template now tells the agent not to change the title unless explicitly asked. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: improve plan deny preamble readability Break the dense single-paragraph preamble into structured sections: verdict, directive, and rules list. Easier for agents to parse. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add missing @plannotator/shared workspace dependency Hook and OpenCode plugin imported from @plannotator/shared/feedback-templates without declaring it as a dependency. Worked locally but failed in CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * revert: remove code review and annotate from shared templates Scope-crept into code review/annotate feedback which introduced a double heading regression and dropped integration-specific strings. Reverts those paths to their original inline strings; shared module now only covers plan deny feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: restore Pi plan file hint and vendor template for source installs Add optional planFilePath to planDenyFeedback so Pi can tell the agent to read the plan file before editing. Check in a vendored copy of the template so Pi source installs work without running build:pi first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 19:38:22 -07:00
"@plannotator/server": "workspace:*",
"@plannotator/shared": "workspace:*"
},
"engines": {
"bun": ">=1.0.0"
}
}