feat(opencode): add OpenCode plugin support#31
Open
growwithsmc wants to merge 1 commit into
Open
Conversation
…num (src/cli/mod.rs)\n- Patch hook extractors: session_id, cwd, tool_name, file_path, shell command (src/cli/hooks.rs)\n- Patch format_deny, format_stop_block, format_system_message for OpenCode JSON shape\n- Add OpenCode to InstallHost enum (src/main.rs)\n- Add run_install_opencode: installs plugin to ~/.config/opencode/plugin/ (src/cli/install.rs)\n- Add plugins/catenary-opencode/catenary.mjs: LSP integration with catenary-grep, catenary-glob, catenary-sed, catenary-diagnostics, catenary-doctor tools\n- OpenCode plugin uses --format=claude for hook IPC (compatible with pre-built binary)\n- On Windows without WSL: grep/glob/sed/diagnostics fall back gracefully; catenary-doctor always works\n- On Unix or with CATENARY_WSL=true: full daemon-powered LSP features\n\nTested:\n- cargo build --release succeeds on Linux (WSL)\n- Plugin syntax validated with node --check\n- catenary doctor works on Windows (pre-built binary)\n
|
I have read the CLA Document and I hereby sign the CLA patch seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Catenary LSP integration for OpenCode via a JavaScript plugin.
Changes
Rust source patches:
HostFormat::Opencodeenum variant insrc/cli/mod.rs— maps to--format=opencodeCLI flagsrc/cli/hooks.rs— readstool_name,tool_input,cwd,session_idfrom OpenCode's hook context shapeformat_deny/format_stop_block/format_system_messagefor OpenCode JSON response shapeInstallHost::Opencode+run_install_opencodeinsrc/main.rsandsrc/cli/install.rs— installs plugin to~/.config/opencode/plugin/catenary.mjsPlugin (
plugins/catenary-opencode/catenary.mjs):tool.execute.before, triggers diagnostics viatool.execute.aftercatenary-grep— LSP-powered semantic searchcatenary-glob— filesystem browse with LSP symbol outlinescatenary-sed— LSP-aware find-and-replace with previewcatenary-diagnostics— pull diagnostics for all session-tracked filescatenary-doctor— LSP server health check (works on all platforms including Windows without daemon)Platform notes
catenary grep/glob/sed/diagnosticscatenary-doctoralways works; other tools show helpful fallback messages. SetCATENARY_WSL=trueto route through WSL for full features.--format=claudefor hook IPCTesting
cargo build --releasesucceeds on Linux (WSL)node --check)catenary doctorworks on Windows (pre-built binary)cargo test extract_shell_command_opencode*, etc.)