Skip to content

feat(plugin): JSON-RPC over stdio as the language-plugin path - #64

Draft
lyingbug wants to merge 6 commits into
mainfrom
cursor/plugin-architecture-89b0
Draft

feat(plugin): JSON-RPC over stdio as the language-plugin path#64
lyingbug wants to merge 6 commits into
mainfrom
cursor/plugin-architecture-89b0

Conversation

@lyingbug

@lyingbug lyingbug commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Description

上一轮把「任意语言插件」做成了 HTTP sidecar。这不优雅:作者要自己选端口、开服务、处理健康检查,Host 还得猜谁先起来。

对照业界之后,主路径改成 一份 ABI、多种绑定

  • ABI:JSON-RPC 2.0,一行一条(和 MCP stdio / LSP 同一类 framing)
  • runtime: stdio(推荐):Host exec 子进程,只谈 stdin/stdout。作者实现 websearch.search,不要 listen
  • runtime: js:goja 进程内,轻脚本
  • runtime: http:只留给已经在跑的远程服务,不再是写新插件的方式

业界对照写在 docs/dev/plugin-architecture.md §3.1。结论:MCP、LSP、Dify 本地 runtime 都是 stdio;HashiCorp/Terraform/Grafana 是子进程 + 握手后再 gRPC(对「一个 search」过重);HTTP sidecar 正是 MCP 已经弃用 HTTP+SSE 的那个方向。

TS 表面变成 serve({ search })plugins/sdk-ts/websearch)。样板:plugins.d/websearch-stdio-echo(Python)、plugins.d/websearch-node-echo(Node),默认 auto_enable: false

Type of Change

  • ✨ New feature
  • 📚 Documentation update
  • 🧪 Test

Related Issue

Fixes #

Testing

已跑通:

go test ./internal/plugin/protocol/ ./internal/plugin/ ./internal/plugin/runtime/ \
       ./internal/plugin/boot/ ./internal/plugin/websearch/ ./plugins/websearch-echo/ -count=1

含 Python / Node 仓库样板、超时杀进程后重启、Host.Unload 回收子进程。
git diff --check origin/main...HEAD 通过。

Checklist

  • git diff --check origin/main...HEAD passes
  • Changed source files are formatted
  • Targeted tests for the changed packages/components pass
  • Added/updated tests covering the change
  • Updated related documentation
  • Breaking changes are clearly called out: runtime: http 仍可用,但不再是推荐路径;新插件请用 runtime: stdio

Screenshots / Recordings

N/A(非 UI)

Open in Web Open in Cursor 

lyingbug and others added 5 commits August 16, 2026 07:58
Introduce a process-level plugin host with shared services, reversible
effects, and emit/waterfall/parallel/serial events so capabilities can
be mounted from profile/bundle/patch instead of patched into a core.

Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
Move in-tree search engines into the base bundle, add reversible
Registry.Unregister, and ship plugins/websearch-echo as the out-of-tree
template enabled by WEKNORA_PLUGINS instead of container.go.

Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
Document the Cordis mapping, the strangler plan for the nine extension
seams, and update search-engine / roadmap / official docs to the new
registration point.

Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
Close the TS flexibility gap: scan WEKNORA_PLUGIN_DIR for plugin.yaml,
run search.js in-process (goja) or call a TypeScript sidecar over JSON,
and publish the new type into the web-search provider catalog. No blank
import and no WeKnora rebuild.

Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
Language plugins now use the MCP/LSP/Dify local path: the host execs a
process and talks newline-delimited JSON-RPC 2.0 on stdin/stdout.
runtime: http stays only as a fallback for an already-running service.

Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
@cursor cursor Bot changed the title feat: 引入 Everything is a Plugin 组合核,联网搜索不再写进 container.go feat(plugin): JSON-RPC over stdio as the language-plugin path Aug 16, 2026
Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
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