Unified LLM request/response inspector: reasoning-effort tuning, external-think export, traffic & bundle analysis.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:cdxiaodong/dsh-llm-inspector
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
统一 LLM 请求/响应检查器 —— DeepSeek Harness 插件
一个插件收编四类能力,全部通过配置开关:reasoning 控制、外部思考(think)导出、流量/包分析、会话落盘审计。
功能
| 功能 | 实现机制 | 配置项 |
|---|---|---|
| reasoning 控制 | 挂 agent/request waterfall,改写 LlmCallConfig.reasoningEffort(关推理 / 调 budget) |
reasoningEffort |
| 外部思考导出 | 注册 think 工具(schema 自动流入请求体)+ systemPrompt 注入"先调 think"指令,再从 llm/stream 抓回 thoughts 参数 |
externalThinking |
| 流量/包分析 | 挂 llm/stream waterfall 拦截每个 chunk,按类型统计 token/字符、捕获 reasoning 与 tool-call 块 |
trafficAnalysis |
| 会话落盘审计 | 订阅 session/event + 命中的流式块,写入 audit.jsonl |
persistSession |
外部思考(external thinking)说明
对明文返回 reasoning 的模型(DeepSeek 等开源模型),本插件直接从 llm/stream 抓 reasoning 块,零侵入。
对加密推理的模型(OpenAI / Anthropic / Gemini),原生推理被厂商加密藏起。本插件复刻 oh-my-pi 的 externalThinking 思路:
reasoningEffort: 'none'关掉原生隐藏推理;- 注册一个
think工具(description 为 "private scratchpad; not shown to user"),其 schema 经ctx.tools.register()自动进入发往 LLM 的请求体; - 通过
systemPrompt.section()注入"回答任何问题前必须先调用 think"的指令; - 模型把推理写进
think的thoughts参数,本插件在llm/stream拦截该 tool-call 块并抓回、落盘。
⚠️ 与 omp 的差异:DSH 核心
LlmCallConfig刻意裁剪了tool_choice,因此本插件用 system prompt 强制 替代 omp 的 API 层tool_choice强制。这意味着 think 触发是"软强制",触发率取决于模型遵循度,不保证 100%。这是上架前需实测验证的已知边界。
安装
dsh plugin --profile <你的profile> add github:cdxiaodong/dsh-llm-inspector
配置
plugins:
dsh-llm-inspector:
reasoningEffort: 'none' # 可选:'none' 关推理,或 adapter 支持的 'low'/'medium'/'high'
externalThinking: true # 是否启用 think 导出
trafficAnalysis: true # 是否做流量/包分析
persistSession: true # 是否落盘审计
logDir: '.dsh-inspector' # 落盘目录
# thinkPrompt: '...' # 可选,覆盖默认强制提示
服务
插件对外提供两个 Service(可被其他插件 inject):
inspectorTraffic—— 流量统计:snapshot()返回{ calls, chunks, reasoningChars, thinkCalls, thinkChars, byKind }inspectorAudit—— 审计:log(tag, payload)/flush()
开发
npm install
npm run build # tsc 产出 lib/(已提交进 git,DSH 可直接从 Git 安装)
npm test # node --test,7 个零依赖测试
安全与信任声明
按 DSH 社区约定:GitHub topics 不是安全审核,也不是官方背书。本插件会拦截并(在开启 persistSession 时)落盘你的模型请求/响应内容,其中可能包含推理过程、代码、甚至凭证。请:
- 仅在可信环境开启
persistSession; - 注意
audit.jsonl的存储位置与访问权限; - 安装前自审源码(
src/index.ts,约 200 行)。
License
MIT
Links
More in this category
yjh051108/dsh-routing-suite★ 6995
One repository, three parts: a runtime injector for DSH plugin packages (inject, hot-reload, unload, promote a dev staging tool to the front, route self-heal, plus a settings-page plugin manager that lists, unloads and drags folders in to internalize), a task-aware reasoning-mode router agent preset (router-standard / router-spec / router-react), and a graded two-level task protocol whose six tools (commit_star, lock_stage, revise_do, edit_plan, mark_task, redteam_verdict) pin task state to disk. The injector implementation ships in-tree, so the install carries its own behaviour rather than a dependency list.
strukto-ai/mirage#dsh★ 3667
Swaps the filesystem and bash providers for a mirage virtual workspace: file tools and shell commands run over mounted resources (RAM, S3, Redis, Slack, Gmail, Notion, Postgres) instead of the host disk, with per-mount read/write/exec modes, per-command sandbox routing (monty, pyodide, quickjs in process; docker, e2b, daytona remote), and installed CLIs (git, gh, slack, linear, ntn, gws, or one you register) as head words in the virtual terminal.
hust-open-atom-club/oh-dsh★ 325
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
weijiafu14/pi2dsh★ 208
Pi Host ABI compatibility engine: after one install, unmodified Pi extensions from npm mount as native DSH plugins with `dsh plugin add <pi-package>`. Verified end to end on stock DSH with pi-mcp-adapter (full MCP manager: OAuth, resources, prompts, MCP Apps, elicitation, sampling), @tintinweb/pi-subagents, pi-code, pi-hermes-memory and pi-background-tasks; `pi2dsh inspect` reports a package's compatibility before installing.
lire1131/dsh-undo-savepoint★ 167
Undo/redo & rollback system for DSH: every config change is auto-snapshotted; undo/redo/restore to any version from the WebUI or the offline CLI/GUI tools (works even when DSH fails to boot).
Fishquito7/dsh-skill-mcp-panel★ 158
Manages DSH skills and MCP servers from the web settings: skill cards with hot enable/disable, workspace scopes, groups, batch migration and drag-and-drop import, plus stdio/HTTP MCP CRUD with connection tests, secret redaction and the unified dsh-panel CLI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.