Windsander/Mebular--packages-dsh-plugin ↗★ 17

@mebular/dsh-plugin

Mebular memory, task graph, and shared Console for DeepSeek Harness 适合需要Mebular全局面板、记忆库与MCP工具集成的用户。

パッケージ
@mebular/dsh-plugin
互換性
未検証
Harness ピア範囲
>=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0-0
バージョン
0.1.0
ライセンス
MIT
最終更新
2026/10/24

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Windsander/Mebular#512bbbb2fd450a4951e5e5137307729b700c0bdc&path:packages/dsh-plugin

ドキュメント

README 全文を読む ↗

配置与 daemon 发现

cordis.patch.yml 只插入一行 mebular(本插件 host,lifecycle: attach, panel: true)。它不写死 daemonUrl,也不插入静态的 MCP client row。MCP 桥由 host 在 apply 时动态 import 官方 @deepseek-ai/dsh-mcp-client,并用同一个解析后的 daemon origin 挂载。因此面板、/mebular/embed-info 与 MCP 工具始终指向同一个端口。

host 按以下顺序确定 daemon origin:

  1. 显式 daemonUrl(含凭据的 URL 会被拒绝);
  2. MEBULAR_HTTP_PORT(有效端口 1–65535);
  3. /runtime.json(daemon 在 HTTP listen 成功后原子写入;pid 已不存在则视为 stale 并跳过);
  4. http://127.0.0.1:7331。

`` 与 Mebular CLI 一致:MEBULAR_HOME 覆盖,缺省 ~/.mebular。host 只读取 runtime 文件里的 version、pid、http.host、http.port、consolePath、mcpPath、 embedProtocol,不读取 config.json、身份、token 或 store。

配置字段

字段默认说明
daemonUrlhttp://127.0.0.1:7331Mebular daemon origin;只接受 http: / https:,尾部斜杠会被去掉
lifecycleattachattach 只探测已有 daemon,绝不启动/停止;managed 在 daemon 不存在时启动一个由插件托管的 mebular serve 子进程
paneltruefalse 时不注册 DSH sidebar/main 面板;host 仍挂载官方 MCP client,工具照常可用
cliPath未设置仅 managed 使用;可执行的 Mebular CLI 路径。也接受 MEBULAR_CLI,最后回退到 PATH 上的 mebular

非法 lifecycle / panel / cliPath 会回退到安全默认值并写一条 warn 日志,不会让 DSH 启动失败。

不提供 Mebular 系统设置(身份、网络、邀请、域、审计等)。这些设置只属于 Mebular Console。

生命周期策略

模式已有健康 daemondaemon 不存在插件 dispose
attach(默认)复用,只探测不启动,状态 down,面板显示启动引导不停止任何进程
managed复用,不启动(managed: false)解析 CLI 后启动 `mebular serve --port
,有界等待 /healthz`;失败时清理自己的 child只对自己启动的 child 发 SIGTERM,2s 后仍未退出则 SIGKILL

managed 是子进程兜底,不是服务安装:

  • 不 import @mebular/service,不调用系统服务管理器;
  • 不覆盖 MEBULAR_HOME,让 Mebular CLI 自己解析 home;
  • 插件本身不写 Mebular 配置、不读密钥/token/store;daemon 自己负责 runtime.json 与它的 home;
  • 启动前先探测 /healthz;已有健康 daemon(包括服务托管或桌面 App 启动的实例)只复用, 绝不抢占或停止;
  • 等待 /healthz 有界(默认 20s),期间状态为 starting;超时、spawn error 或 child 提前 退出时,只停止自己启动的 child,状态 down、reason: managed_start_failed,不会自动 无限重试;
  • 停止顺序固定为 SIGTERM → 2s grace → SIGKILL;外部 daemon(桌面 App、服务托管、 手动 mebular serve)永远不会被 host 停止;
  • Windows 上 CLI 为 .cmd / .bat 时使用 shell: true 启动(args 固定,不接受用户拼接 命令);其他平台直接 exec;
  • CLI 无法解析时降级为 attach,状态 down、reason: managed_cli_missing,不会启动任何 进程;
  • managed child 的 stdout/stderr 先脱敏再写 DSH 日志:token / secret / password / api_key 等值替换为 ,`Authorization: Bearer …` 保留协议名,CLI 路径与 替换为 /;单行上限 500 字符。

只关闭面板,保留 MCP

- id: mebular
  name: '@mebular/dsh-plugin'
  config:
    panel: false

panel: false 时 sidebar 入口与 main 面板都不注册;/mebular/embed-info 仍可访问,官方 MCP client 仍在 apply 时挂载。host 通过 DSH webServer.tapIndex 注入 window.__MEBULAR_DSH__={"panel":false},client 在 apply 时读取。

端口与环境变量

变量作用
MEBULAR_HTTP_PORT覆盖 daemon 端口(默认 7331);host、面板、MCP 桥一起跟随
MEBULAR_HOMEMebular home,用于定位 runtime.json;缺省 ~/.mebular
MEBULAR_CLImanaged 模式下 Mebular CLI 路径的候选(cliPath 优先)
DSH_HOMEDSH 自己的 profile 根;与 Mebular home 无关

端口覆盖示例:

MEBULAR_HTTP_PORT=7332 dsh --profile web

managed 启动的 --port 取自最终解析出的 daemonUrl 端口。MCP client 不自己读端口、 不自己重连:连接、重连与工具注册全部归官方 peer;daemon 未启动时它按 failOnStartupError: false 等待并重试。

配置字段

字段默认说明
daemonUrlhttp://127.0.0.1:7331Mebular daemon origin;只接受 http: / https:,尾部斜杠会被去掉
lifecycleattachattach 只探测已有 daemon,绝不启动/停止;managed 在 daemon 不存在时启动一个由插件托管的 mebular serve 子进程
paneltruefalse 时不注册 DSH sidebar/main 面板;host 仍挂载官方 MCP client,工具照常可用
cliPath未设置仅 managed 使用;可执行的 Mebular CLI 路径。也接受 MEBULAR_CLI,最后回退到 PATH 上的 mebular

非法 lifecycle / panel / cliPath 会回退到安全默认值并写一条 warn 日志,不会让 DSH 启动失败。

不提供 Mebular 系统设置(身份、网络、邀请、域、审计等)。这些设置只属于 Mebular Console。