Skip to content

feat(plugins): add language-agnostic JSON-RPC plugins - #380

Merged
fcoury-oai merged 20 commits into
mainfrom
fcoury/json-rpc-plugins
Oct 14, 2026
Merged

fcoury-oai merged 20 commits into
mainfrom
fcoury/json-rpc-plugins

Conversation

@fcoury-oai

@fcoury-oai fcoury-oai commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Plugins currently need a Husk entrypoint to participate directly in the editor. This adds a standalone [rpc] modality so plugins in any language can run as supervised JSON-RPC 2.0 processes over stdio while existing Husk, companion, and language-only packages retain their current behavior.

Protocol v1 provides bounded transport and lifecycle handling, declared commands and editor events, stable document snapshots and transactions, owner-scoped configuration and storage, connection-owned text panels, cached statusline contributions, and native pickers. Commands and lifecycle work remain responsive while plugins run, and connection-owned UI is released on disconnect, quarantine, deactivation, or hot reload. RPC packages can use target-specific local commands or SHA-256-verified release artifacts, and child processes receive a filtered environment with explicit per-plugin grants for additional variables.

The host API advances to 0.21.0 while retaining older Husk and RPC contracts. The protocol document and Python example cover every method, including interleaved notifications while the plugin waits for a host response.

How to Test

  1. Run cargo test --test rpc_connection and PYTHONDONTWRITEBYTECODE=1 python3 -m unittest tests.test_rpc_example; the transport, editor integration, package validation, and example protocol tests should pass.
  2. Install the example with cargo run -- plugin install --path examples/rpc-hello-plugin, launch Red, then run :RpcHello Ada, :RpcDocument, :RpcPanel, and :RpcStatusline. Expect a Python greeting, current-document metadata, a rendered panel, and Python RPC ready in the statusline.
  3. Run :RpcPicker, type gam, and select Gamma; :RpcLastEvent should report picker:selected. Run :RpcPicker again and press Escape; :RpcLastEvent should report picker:cancelled.
  4. Run :RpcApply followed by :RpcUndo; the example line should be inserted through a revision-checked transaction and then removed through Red's undo path.

@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T23:19:11.914587Z 28f2306 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28f2306e29

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/editor.rs Resolved
Comment thread src/plugin/registry.rs Resolved
@fcoury-oai
fcoury-oai merged commit 14f7e4c into main Oct 14, 2026
15 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/json-rpc-plugins branch October 14, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant