@fuxi-ailabs/dsh-insight
v1.1.0
Published
DSH integration for Insight: Session import, scoring commands, and a floating Session launcher
Readme
@fuxi-ailabs/dsh-insight
dsh-insight 是 DSH 的 Insight 宿主插件。
当前提供以下能力:
/insight:导出当前 DSH 会话,通过 Insight API 导入,并可打开会话页。/score:读取、重算或语义评审会话评分卡,并做导入覆盖度对账。- 会话右下角浮动入口:点击后刷新导入当前会话,并打开 Insight 会话页。
- 状态接口:
GET /api/dsh-insight/status?sessionId=<sid>。 - 打开接口:
POST /api/dsh-insight/open。 - 浮窗打分接口:
POST /api/dsh-insight/score(默认/score同一条链路,不调用 LLM)。 - 评分卡数据口:
GET /api/dsh-score/scorecard,供后续评分卡 UX 接入。
安装
pnpm --filter @fuxi-ailabs/dsh-insight pack
dsh plugin --profile <profile> add \
./fuxi-ailabs-dsh-runtime-bundle-1.1.0.tgz \
./fuxi-ailabs-dsh-insight-bundle-1.1.0.tgzdsh-insight 依赖 environmentHealth 服务。它把 Insight 安装请求交给
@fuxi-ailabs/dsh-env-health 的 Runtime Provisioner,由共享服务对同一版本的并发请求做单飞和跨进程锁。
首次准备通过 npm 下载 [email protected] 到 ~/.dsh-insight/runtime/;下载不阻塞
DSH 启动,也只会执行一次。首次点击浮窗或执行 /insight、/score 时才启动 Insight 服务。
运行时需要本机可找到 npm。找不到时共享 Runtime Provisioner 会返回错误,不影响 DSH 启动。
/insight
/insight 当前会话(含子代理)
/insight <sid> [<sid> ...] 指定会话
/insight --out <dir> 覆盖本次导出目录
/insight --no-subagents 本次不带子代理
/insight --no-open 导入后不开浏览器
/insight --base <url> 指定 Insight 基址
/insight --force Insight 未运行时仍导出
/insight --status 只探活流程:
探活 Insight
→ 导出 canonical DSH JSONL
→ POST /api/ingest/import-file
→ 打开 {base}/session/<sid>?framework=dsh/score
/score 读卡;没有缓存则现算确定性层
/score --sid <sid> 指定会话
/score --recalc 强制重算确定性层
/score --semantic 语义评审(唯一 LLM 入口)
/score --probe-provider 探测语义评审 provider
/score --confirm D2.destructive=fine 人工确认疑似项
/score --bench <0-100> 填 CANN-Bench 总分
/score --open 打开 Insight 页面
/score --json 保存整卡 JSON
/score --no-cover 跳过覆盖度对账
/score --base <url> 指定 Insight 基址
/score --status 只探活/score 的确定性读卡与重算不调用 LLM;只有显式使用 --semantic 才会请求
Insight 的语义评审接口。
配置
- id: dsh-insight
name: '@fuxi-ailabs/dsh-insight'
config:
# /insight
outputRoot: "~/.dsh-insight/dsh-export"
insightBin: context-insight
autoInstall: true
autoStart: true
runtime:
packageName: context-insight
version: 0.2.41
installRoot: "~/.dsh-insight/runtime"
npmBin: npm
registry: "https://registry.npmjs.org/"
installTimeoutMs: 1200000
startTimeoutMs: 180000
insightBase: "http://127.0.0.1:21025"
portFile: null
includeDescendants: true
openBrowser: true
requireInsightUp: true
source: dsh-native
probeTimeoutMs: 1500
importTimeoutMs: 120000
# /score(独立命名空间,避免 outputRoot 冲突)
score:
outputRoot: "~/.dsh-insight/dsh-score"
framework: dsh
includeDescendants: true
coverToleranceMs: 2000
requestTimeoutMs: 60000
semanticTimeoutMs: 300000
openBrowser: false
openTarget: scoring
provider: null
borrowDshProvider: true
dshProvider:
apiKeyRef: DEEPSEEK_API_KEY
baseUrl: "https://api.deepseek.com"
model: "deepseek-flash"浮窗交互
会话页右上角显示可拖拽的 Insight 浮标,默认位置和拖动结果保存在浏览器本地。
- Insight 未启动:显示
⊘ Insight,点击提示“Insight 实例没有启动”。 - Insight 已启动、会话未导入:显示普通
Insight按钮,点击刷新导入并打开会话页。 - 会话已导入:Insight 收缩为图标,右侧出现「打分」按钮。
- 点击「打分」:执行默认
/score链路,不调用 LLM,并在浮标下方显示总分、覆盖度、维度分和评审来源;再次点击「打分」可收起/展开评分结果。 - 评分结果下方提供「语义评审」按钮:执行
/score --semantic,先探测大模型 provider,成功后更新评分卡。 - 浮标默认贴着右上角;直接拖动任意 Insight 或打分图标即可更换位置。
打开流程:
POST /api/dsh-insight/open { sessionId }
→ 发现运行中的 Insight
→ 增量导出/导入当前 DSH 会话
→ 浏览器打开 /session/<sid>?framework=dsh如果 Insight 尚未准备好,浮窗和命令会等待同一个 Host 级任务,并显示
“检查 / 下载 / 启动”阶段。切换 Session 不会中断下载。启动 Insight 时设置了
CONTEXT_NO_BROWSER=1,因此不会先打开 Insight 首页;导入完成后只打开当前会话页。
如果下载失败,浮窗会显示 npm 错误,完整输出位于:
~/.dsh-insight/runtime/install.log
~/.dsh-insight/runtime/start.log评分卡右侧边栏暂未注册;后续 UI 可以直接消费:
GET /api/dsh-score/scorecard?taskId=<sid>&cover=1