Repository navigation
feat(plugins): add JSON Workbench RPC example - #381
Merged
Merged
Conversation
This was referenced Oct 14, 2026
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.
This adds a realistic, distributable JSON-RPC plugin that exercises the host contract introduced by #380. The existing hello example proves transport and command dispatch, but it does not expose the document identity, responsiveness, presentation, persistence, and action-discovery requirements that appear in an interactive editor workflow.
JSON Workbench is a standalone Python plugin that runs
jqagainst a pinned source document. It provides editable query documents, live previews with cancellation, selection-scoped queries, a native result explorer, saved query history, exact raw-result copying, frozen result documents, and revision-checked apply/undo. Its panel keeps the primary Run, Apply, and Close actions visible while F1 and panel-local keys expose the full action set.The supporting pending
0.19.0RPC contract gains the surfaces this workflow requires: stable document targeting, document creation/show/watch, selection snapshots, inactive document transactions, text-panel code blocks and actions, clipboard writes, foreground messages, and owner-scoped cleanup. Husk and JSON-RPC plugins continue to coexist, with resources isolated per owner and existing Husk command precedence preserved.This PR depends on #380. Until that foundation merges, GitHub will include its commits in this PR's diff.
How to Test
examples/rpc-json-workbenchwithred plugin install --path ./examples/rpc-json-workbench, and open a JSON file containing{"users":[{"name":"Ada","active":true},{"name":"Lin","active":false}]}.:JsonQuery .users | map(select(.active)). Expect a syntax-highlighted JSON panel containing only Ada and a durableJSON: readystatus.Ctrl-w l, pressc, and confirm✓ JSON result copiedappears transiently while the ready status remains. Press F1 and confirm the complete action list is discoverable.:JsonWorkbench, edit the ordinary query document, enable:JsonLive, and edit the source. Expect the preview to coalesce changes without blocking editor input; verify Cancel remains responsive.python3 tests/test_json_workbench.py,cargo test --test rpc_connection --all-features, andcargo clippy --all-targets --all-features -- -D warnings.