feat(plugin): JSON-RPC over stdio as the language-plugin path - #64
Draft
lyingbug wants to merge 6 commits into
Draft
feat(plugin): JSON-RPC over stdio as the language-plugin path#64lyingbug wants to merge 6 commits into
lyingbug wants to merge 6 commits into
Conversation
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>
Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
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.
Description
上一轮把「任意语言插件」做成了 HTTP sidecar。这不优雅:作者要自己选端口、开服务、处理健康检查,Host 还得猜谁先起来。
对照业界之后,主路径改成 一份 ABI、多种绑定:
runtime: stdio(推荐):Hostexec子进程,只谈 stdin/stdout。作者实现websearch.search,不要 listenruntime: 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
Related Issue
Fixes #
Testing
已跑通:
含 Python / Node 仓库样板、超时杀进程后重启、Host.Unload 回收子进程。
git diff --check origin/main...HEAD通过。Checklist
git diff --check origin/main...HEADpassesruntime: http仍可用,但不再是推荐路径;新插件请用runtime: stdioScreenshots / Recordings
N/A(非 UI)