Commit Graph

257 Commits

Author SHA1 Message Date
Michael Ramos 2d7f7bf977 chore: bump version to 0.7.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 12:43:26 -08:00
Michael Ramos fe293217e8 chore: bump version to 0.6.8
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:44:01 -08:00
cognitive b46c855a5d fix(opencode-plugin): exclude sub-agents and build agent from prompt injection (#98)
Add agent filtering to experimental.chat.system.transform hook to prevent
injecting plan submission prompts into agents that shouldn't receive them:

- Hardcoded exclusion for "build" agent
- Dynamic exclusion for agents with mode "subagent" (e.g., general, explore)
- Skip injection if agent detection fails (safer behavior)

The plan agent and other primary agents will continue to receive the prompt.

Co-authored-by: cognitive <152830360+METAeuPHORIC@users.noreply.github.com>
2026-01-20 08:39:37 -08:00
Michael Ramos f01036949b chore: bump version to 0.6.7
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 12:10:23 -08:00
Michael Ramos c24e775292 fix: smart detection for agent switching in OpenCode (#96)
Closes #94
2026-01-19 11:07:22 -08:00
Michael Ramos c4f8f58c50 fix: use primary_tools config for sub-agent blocking (#95)
Addresses community feedback on v0.6.6 sub-agent fix:

1. Add `config` hook to register `submit_plan` in `primary_tools`
   - OpenCode natively hides these tools from ALL sub-agents
   - Works for custom sub-agents too, not just general/explore

2. Replace buggy `chat.message` hook with `experimental.chat.system.transform`
   - chat.message was persisting the reminder to ALL user messages
   - system.transform injects once into system prompt

3. Remove hardcoded runtime sub-agent check
   - No longer needed with primary_tools handling it

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 09:18:35 -08:00
Michael Ramos 2832d70bd9 chore: bump version to 0.6.6
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 09:14:35 -08:00
Michael Ramos 8fc6b80476 fix: OpenCode plugin updates (CVE + sub-agent fix) (#90)
## Summary

- Bump `@opencode-ai/plugin` to >=1.1.10 for CVE-2026-22812
- Prevent sub-agents from triggering plannotator

## Changes

1. **CVE Fix**: Updated dependency to address critical RCE vulnerability in OpenCode < v1.1.10

2. **Sub-agent Fix**: 
   - Replace `experimental.chat.system.transform` with `chat.message` hook (only injects for "plan" agent)
   - Add runtime block for sub-agents ("general", "explore") in `execute()`

Fixes #89, fixes #15, fixes #86
2026-01-18 09:11:54 -08:00
Michael Ramos f1087efc7c chore: bump version to 0.6.5
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:42:02 -08:00
Michael Ramos 4ed4d15171 chore: bump version to 0.6.4 2026-01-15 20:55:54 -08:00
Michael Ramos b1883d38e8 fix(opencode): include HTML files in npm package
The `files` array in package.json was missing plannotator.html and
review-editor.html, causing them to be omitted from npm publishes.
This explains why users were stuck on old versions.

Also fixes incorrect cache path in docs and install script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 10:04:26 -08:00
Michael Ramos dcc1ad108a chore: bump version to 0.6.2
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:54:14 -08:00
Michael Ramos 4f6af14f02 Merge pull request #78 from stranger2904/fix/skip-title-generation-prompt
fix(opencode): skip Plan Submission prompt for title generation
2026-01-15 07:52:16 -08:00
Michael Ramos 4dd67c1157 chore: bump version to 0.6.1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 07:45:14 -08:00
Aleksey Bragin 7cd2484461 fix(opencode): skip Plan Submission prompt for title generation
The Plan Submission system prompt was being injected into ALL requests,
including title generation. This caused the title generator to see the
wrong system prompt and attempt to call submit_plan instead of generating
a title.

This fix detects title generation requests by checking for "title generator"
or "generate a title" in the existing system prompt and skips injecting
the Plan Submission instructions for those requests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 10:44:45 -05:00
Michael Ramos 78a30eab49 fix: OpenCode config read and lazy evaluation
- Fix config access: use response.data.share instead of response.share
- Make config read lazy to avoid blocking plugin init
- Add --disable-sharing and --keep flags to sandbox script
- Add sharingEnabled to test-server.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 13:48:05 -08:00
Michael Ramos 131d1b9d0e feat: add config to disable URL sharing (#69)
Add deployment-level configuration to disable URL sharing for
security/privacy concerns.

Configuration methods:
- Claude Code: PLANNOTATOR_SHARE=disabled env var
- OpenCode: "share": "disabled" in opencode.json (primary), env var fallback

When disabled:
- Quick Share button hidden in annotation panel
- Share tab hidden in export modal (shows only Raw Diff)

Closes #69

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 13:12:37 -08:00
Michael Ramos 128417600d chore: bump version to 0.6.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:36:38 -08:00
stranger2904 482a0d361e fix: respect XDG_CONFIG_HOME in postinstall script (#72)
The postinstall script previously hardcoded ~/.config/opencode/command
as the destination for slash command files. This causes issues for users
running OpenCode in portable/XDG-compliant environments where
XDG_CONFIG_HOME is set to a custom location.

This change uses ${XDG_CONFIG_HOME:-$HOME/.config} which:
- Uses XDG_CONFIG_HOME when set (for portable installations)
- Falls back to ~/.config for standard installations (no behavior change)

This follows the XDG Base Directory Specification and ensures the plugin
works correctly in containerized, portable, or multi-user environments.

Co-authored-by: Aleksey Bragin <ab@alfabox.net>
2026-01-13 20:29:13 -08:00
Michael Ramos 461437a1d6 fix: make agent automatically respond to code review feedback
Removed noReply flag so agent addresses feedback immediately

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 05:30:02 -08:00
Michael Ramos bcc84fd11e fix: remove agent_cycle from review to prevent wrong agent switch
session.prompt with agent parameter handles the switch correctly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 05:26:52 -08:00
Michael Ramos 4d2481e812 fix: rebuild with correct version embedded in bundle
0.5.4 was published with stale build containing 0.5.2 version string

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 04:57:14 -08:00
Michael Ramos 806e5536d6 feat: unified install script for all platforms
- Add Windows PowerShell install script (install.ps1)
- Install slash commands for both Claude Code and OpenCode
- Update OpenCode README with install script instructions
- Simplify UpdateBanner to use same install command for both platforms

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 04:45:51 -08:00
Michael Ramos 1ee40ef144 fix: always open review UI, allow switching diff types
Remove early exit when no uncommitted changes - user can switch to
"Last commit" or other diff types via dropdown.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 20:16:07 -08:00
Michael Ramos e1153ebeac fix: add update banner to code review screen
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 20:10:52 -08:00
Michael Ramos a427405201 fix: code review UI improvements for v0.5.1
- Show correct origin badge (Claude Code orange, OpenCode gray)
- Always show file tree sidebar when diff options available
- Update README with v0.5.0 label

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 20:06:00 -08:00
Michael Ramos 41eecc4480 chore: bump version to 0.5.0 for release
- Update version in root, opencode-plugin, and server packages
- Add code review feature to README
- Build artifacts for release

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:41:42 -08:00
Michael Ramos 8019f73a44 Feat/code review system (#57)
## Summary
Complete code review system for reviewing git diffs with annotations.

### Features
- Interactive diff viewer with split/unified views
- Line-level annotation system
- Diff type selector (uncommitted, last commit, vs main branch)
- Dynamic default branch detection
- Empty state handling
- Simplified UX with streamlined feedback flow

Closes #51
Closes #56
2026-01-12 19:36:09 -08:00
Michael Ramos 459a089a96 Bump version to 0.4.16
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 09:39:33 -08:00
Michael Ramos c9a42af86a Bump version to 0.4.15
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 10:34:55 -08:00
Michael Ramos cee2c7ff4c feat: add PLANNOTATOR_BROWSER for browser selection (#48)
Allow users to specify which browser opens plan files via environment variable.
Default behavior unchanged - only activates when env var is set.

- macOS: Set to app name ("Google Chrome") or path
- Linux/Windows: Set to executable path

Closes #42
2026-01-09 10:18:54 -08:00
Michael Ramos 963332ca13 Bump version to 0.4.11
Fix stale build artifacts in npm package - version was showing 0.4.9 due to
pre-built HTML being copied before version bump.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:33:21 -08:00
Michael Ramos f4dcdbffd6 Bump version to 0.4.10
- Update CLAUDE.md with new APIs and file structure
- Remove unused helper functions (isAgentSwitchEnabled, isPlanSaveEnabled)
- Sync all package versions to 0.4.10

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 14:24:59 -08:00
Michael Ramos 710e18daff Add configurable agent switching for OpenCode (#40)
* Add configurable agent switching for OpenCode

Add a Settings UI option to configure agent switching behavior after plan
approval. Users can now choose to switch to the "build" agent (default) or
disable agent switching entirely. This is particularly useful for oh-my-opencode
users who have their own agent switching logic.

Changes:
- Add agentSwitch.ts utility for storing agent switch preference
- Add "Agent Switching" dropdown in Settings UI
- Pass agentSwitch setting through /api/approve to OpenCode plugin
- Conditionally perform agent switch based on user preference

Closes #37

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: TheOutdoorProgrammer <13936290+TheOutdoorProgrammer@users.noreply.github.com>

* Hide Agent Switching setting when not in OpenCode mode

* Add configurable plan saving settings

Users can now:
- Disable plan saving entirely via Settings toggle
- Set a custom save path (supports ~ for home directory)

Closes #36

* Widen Settings dialog to accommodate new options

* Move Save Plans setting below Identity section

* Make Obsidian Vault and Folder inputs side by side

* Move Agent Switching below Save Plans in Settings

---------

Co-authored-by: TheOutdoorProgrammer <13936290+TheOutdoorProgrammer@users.noreply.github.com>
2026-01-07 14:17:56 -08:00
Michael Ramos 5055537fa9 Bump version to 0.4.9 2026-01-06 19:49:30 -08:00
Michael Ramos 4de46b5984 Add plan saving to ~/.plannotator/plans/
- New storage.ts module with cross-platform support (Windows/macOS/Linux)
- Save plan.md on server start
- Save plan.diff.md and plan-{approved,denied}.md on decision
- OpenCode plugin shows saved path in tool result
2026-01-06 19:46:28 -08:00
Michael Ramos e0261349ee Bump version to 0.4.8
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 19:11:15 -08:00
Michael Ramos 0ac49c24e4 Add "approve with notes" for OpenCode + Claude Code warning dialog
Features:
- OpenCode: annotations are sent on approval as implementation notes
- Claude Code: confirmation dialog warns annotations won't be sent
- Dialog includes links to upvote Claude Code issues #16001 #15755

Refactor:
- New reusable ConfirmDialog component

Closes #30

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 18:26:11 -08:00
Michael Ramos a3a0f8e64e Fix OpenCode agent switching race condition + adjust UI width
Agent switching:
- Use noReply: true with await to ensure user message is created
  before returning from tool
- Fixes race condition where message was created after loop exited

UI:
- Adjust plan viewer width to 832px (between 3xl and 4xl)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:55:07 -08:00
Michael Ramos 3f0a65e535 Widen plan viewer to max-w-4xl (896px)
Increases default width from 768px to 896px for better readability
while still fitting comfortably on laptop screens.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:30:32 -08:00
Michael Ramos 34b373aaa4 Docs: update cache clearing to include bun cache
Users need to clear both ~/.cache/opencode and ~/.bun/install/cache
for a complete reset when stuck on old versions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:16:58 -08:00
Michael Ramos 14e5ca08d2 Fix: only widen layout on 2xl screens (1536px+)
Removes xl breakpoint to keep narrow layout on all laptops.
Only widens on truly large external monitors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:10:00 -08:00
Michael Ramos b546bf9b9d Fix agent switching: fire-and-forget session.prompt
Don't await session.prompt to avoid queuing issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:07:19 -08:00
Michael Ramos e8dd0b469c Fix responsive width for laptop screens
Restore max-w-3xl as default width, only widen on larger screens:
- Default: max-w-3xl (768px) for laptops
- xl (1280px+): max-w-5xl for external monitors
- 2xl (1536px+): max-w-6xl for large desktops

Bumps version to 0.4.3.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:47:13 -08:00
Michael Ramos 93dcbe55a8 Bump version to 0.4.2
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 14:28:57 -08:00
Michael Ramos 14e9aea0ec 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
Michael Ramos 5da7ffa944 Bump version to 0.4.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 18:12:07 -08:00
Michael Ramos 1820142d28 Feat: Add origin tracking badge (Claude Code vs OpenCode)
- Server returns origin field in /api/plan response
- UI displays badge next to version in header
- Claude Code: orange badge
- OpenCode: neutral zinc/gray badge
- Supports PLANNOTATOR_ORIGIN env var for testing

Closes #22

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 14:16:35 -08:00
Michael Ramos c981f6ff0e Bump version to 0.3.1 2026-01-04 10:22:07 -08:00
Michael Ramos 137ed35df0 Add cache clear instructions for existing OpenCode users
Users may be stuck on old plugin versions due to OpenCode's caching.
Added note to both READMEs with the rm command to clear the cache.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 13:34:17 -08:00