Skip to content

dsh-panel

Verified

@emb-agent/dsh-panel · v0.9.0 · MIT · Web UI

emb-agent 的 DSH 面板:在有 .emb-agent/ 的项目里显示嵌入式任务看板、进度与配置页。

Install

dsh plugin add @emb-agent/dsh-panel

Confirm the layer applied with dsh --profile default --dump-config — see the install guide.

Source

Published to npm without a public repository. Inspect the package contents before installing.

Creators

Readme

@emb-agent/dsh-panel

DSH 的 emb-agent 面板插件:在有 .emb-agent/ 的项目里显示嵌入式任务看板、知识库、技能商店、硬件(芯片图 / 原理图查看 / 网络分析)与配置页。

  • Host 半(lib/host.js):注册 webServer 路由 /emb/*(status / config / action / skills / skill / hardware / schematic / schematic-file)。仅对已注册工作区路径返回数据。
  • Client 半(dist/client.js):条件注册 conversation.view 标签页(任务 / 知识库 / 技能 / 硬件)与 settings.section(配置页)。无 .emb-agent/ 的项目不出现任何入口。

安装

前置:已装好 DSH(dsh web 能正常运行),Node.js ≥ 20。

① 从 npm 包拿安装脚本(推荐,私有仓库也适用):

npm i -g @emb-agent/dsh-panel        # 或项目级 npm i @emb-agent/dsh-panel
bash node_modules/@emb-agent/dsh-panel/scripts/install.sh        # macOS / Linux
# Windows: powershell -File node_modules\@emb-agent\dsh-panel\scripts\install.ps1

② 或直接装(跳过本地脚本):

cd ~/.dsh/profiles/web
npx -y --package @deepseek-ai/dsh dsh plugin --profile web add @emb-agent/dsh-panel

③ 仓库公开时可用 GitHub 一键脚本:

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/Welkon/dsh-emb-panel/main/scripts/install.sh | bash
# Windows
irm https://raw.githubusercontent.com/Welkon/dsh-emb-panel/main/scripts/install.ps1 | iex

装完硬刷新浏览器(Cmd/Ctrl+Shift+R)即可看到面板(DSH 对 client 改动热加载;仅 host 半更新需重启 DSH)。

指定版本 / 装完自动重启(可选)
# macOS / Linux
bash node_modules/@emb-agent/dsh-panel/scripts/install.sh 0.1.2 --restart

# Windows PowerShell
& node_modules/@emb-agent/dsh-panel/scripts/install.ps1 -Version 0.1.2 -Restart

不确定可先加 --dry-run(PowerShell 用 -DryRun)预览步骤。

手动安装(逐步命令)
cd ~/.dsh/profiles/web

# ① 放行新版本(发布 <24h 时 pnpm 会拒绝;一次性)
cat >> pnpm-workspace.yaml <<'EOF'
minimumReleaseAgeExclude:
  - @emb-agent/dsh-panel
EOF

# ② 安装并自动挂载
npx -y --package @deepseek-ai/dsh dsh plugin --profile web add @emb-agent/dsh-panel

回滚:dsh plugin --profile web remove @emb-agent/dsh-panel。

emb-agent init --dsh 也会自动执行上述安装(一次性、每用户)。

构建

npm install --no-save --legacy-peer-deps [email protected]   # 只需 esbuild(peer 由 DSH 运行时提供)
node build.mjs                                            # 产出 dist/client.js + lib/host.js

发布

# 改 package.json version → 构建 → 提交推送 → 发布
node build.mjs
npm publish --access public
  • 包名为 scoped @emb-agent/dsh-panel,需拥有 npm @emb-agent 组织权限。
  • prepublishOnly 会自动构建。

结构

src/host/     Host 半(路由 + 状态/硬件/技能/原理图读取)
src/client/   Client 半(api / store / theme / 各标签页组件 + altium.js 原理图渲染)
scripts/      一键安装脚本(install.sh / install.ps1)

src/host/guard.mjs(包内 ./guard 导出,随 panel 单包发布) — 按项目划分 OpenViking 面

个人 OpenViking 上下文与工具面的项目级开关(@emb-agent/emb-ov-guard,纯 ESM, 零依赖,npm 公开发布):

  • emb 项目(cwd 有 .emb-agent/):会话内个人 OpenViking 上下文服务 (initialize / profileMessage / recallMessage / capture / maybeCommit / flush)不参与,mcp__openviking__* 工具组不暴露——检索走项目自己的 facade。首个 skip 写 plugin log(skip predicate FIRED)供 smoke 验证。
  • 其他项目:行为与从前完全一致。

实现:经 user patch 层 insert 进 openviking-memory group(共享 isolate realm,name guard 选择器防上游插件升级漂移);tools.restrict deny 列表 按 agent scope 应用并在 tools/change 重放(覆盖 MCP 惰性注册窗口)+ 单调 tools.guard 兜底(带指引消息)。工具隐藏经 ticket #7/#8 实测矩阵验证。

  • 安装:无需单独安装——guard 已并入本包(@emb-agent/dsh-panel ≥ 0.6.0 的 ./guard 导出),只需在 ~/.dsh/profiles/web/cordis.patch.yml 的 openviking-memory group insert 行写 name: "@emb-agent/dsh-panel/guard"。
  • 测试:node --test test/(guard 6 项)。

emb-agent 2.0.0 适配

面板按 2.0.0 的对外契约工作(见 src/host/config-plane.ts / src/host/state-dir.ts):

  • 配置平面搬到用户级:~/.emb-agent/config.toml($EMB_AGENT_CONFIG 可覆盖,进程环境变量优先)。项目 .emb-agent/.env 不再是配置来源。 面板读写这些键,采用行级 upsert(保留你自己的注释与顺序):

    config.toml 说明
    [team] sag_endpoint / sag_api_key SAG 服务地址与凭据
    [team] ov_endpoint / ov_api_key OpenViking 服务地址与凭据(身份随 key,无 account/user 字段)
    [parser] api_key / profile MinerU 云端解析凭据
    [proxy] http/https/all/no_proxy 出网代理
    [search] zg / zg_route 本地 zg 搜索

    1.x 项目里残留的 .emb-agent/.env:配置页会提示并支持一键迁移 (已有配置项保留原值,secret 不落回显、不出本机)。

  • 变体选区(variants):状态类数据跟随 .emb-agent/active-variant → .emb-agent/variants/<name>/,未选择时用 .emb-agent/ 根。 看板/硬件/配置页采用「变体优先、根回退」的只读展示,并在看板标题与 配置页显示当前变体名。安装与缓存路径(bin/、cache/schematics) 固定在根,与 rust 侧 cache_root 一致。

  • CLI 面未变:knowledge ask/index/diagnose、knowledge graph refresh、 ingest doc --file … --provider auto 均照旧调用项目内 .emb-agent/bin/emb-agent-rs。