Observability and git tooling: a persistent cross-session event audit log with a query API, a resource watchdog sidebar panel, structured Conventional Commits and pre-commit incremental diff review (npm: `dsh-my-observability`).
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-my-observability
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:baosfeng/my-dsh-plugins#path:/plugins/dsh-my-observability
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.
dsh-my-observability:DSH 可观测性 + Git 工程工具插件——事件审计记录 agent 的每一次行为(状态变化 / 模型流 / 工具调用与结果)并跨会话持久化、经 API 查询;资源监控面板展示审计文件写入速率与本进程资源(资源看门狗的可视面);结构化 Git 工具提供 Conventional Commits 类型化提交;增量 diff 审查在提交前用规则引擎(可选 AI 增强)检查调试残留、密钥泄露等问题。
功能
- 事件审计:只读观察并记录
agent/status(状态变化 + 顶层/子代理标记)、llm/stream(流开始/结束/错误 + chunk 与耗时统计,透传全部 chunk)、tools/pre-execute(工具名 + 参数摘要)、tools/execute(成功/失败 + 耗时);waterfall 事件一律透传next(),绝不改变工具/模型流程。 - 持久化与上限:按会话分桶增量追加到
$DSH_HOME/observability/audit.jsonl(防抖批量 flush + 周期原子 compact),重启后完整恢复;每会话上限 2000 条、全局 20000 条,超出淘汰最旧事件。 - 审计查询 API:
GET /observability/api/sessions(会话列表 + 可读标题 + 事件数)、GET /observability/api/events?sessionId=&type=&limit=(时间轴正序;sessionId=*为跨会话)、GET /observability/api/status、GET /observability/api/errors、GET /observability/api/plugin-status。 - 资源监控面板:侧边栏「资源监控」页签展示审计文件大小、写入速率、本进程 CPU/内存与告警列表(可见时 15s 采样,隐藏暂停)。写放大或连续超限时看门狗自动暂停落盘(事件仍入内存,有界不丢),回落自动恢复,附日志告警与 API
degraded标记。 - 结构化 Git 工具:侧边栏「Git 工具」页签,输入仓库路径查看分支与暂存/未暂存计数、工作区/暂存区差异,按
<type>(<scope>): <description>生成类型化提交(feat/fix/docs/style/refactor/test/chore);服务端execFile执行 git,不经 shell。 - 增量 diff 审查:「提交前审查」对增量 diff 跑确定性规则引擎——error:密钥/凭据硬编码、合并冲突标记;warning:调试残留(console/debugger/print)、单文件变更 > 300 行、二进制文件变更;info:TODO/FIXME/HACK 标记、行尾空格、有源码变更但无测试变更。
从 0.3.x 升级:轨迹回放面板已移除
「轨迹回放」侧边栏面板(时间轴 + 会话选择 + 类型过滤 + 搜索/导出/统计)与官方 UI 插件 @deepseek-ai/dsh-client-ui-trajectory 重叠——官方自 DSH 0.1.7-rc.2 起默认装载它,提供按轮次的事件记录表、交互式时间概览与记录检查器(token 用量 / 耗时 / 输入输出)。因此本插件删除了该面板,跨会话持久化的审计数据与查询 API 全部保留:
| 原来 | 现在 |
|---|---|
| 侧边栏「轨迹回放」时间轴(agent 状态 / 模型流 / 工具调用) | 对话视图环里的官方 Trajectory 页签(默认装载,无需安装) |
| 「轨迹回放」页签顶部的资源区块 | 侧边栏「资源监控」页签(同一位置,order 40) |
| 面板内的搜索 / 时间范围 / 导出 JSON·CSV / 工具失败率统计 | 无界面替代:改用 /observability/api/events 查询后自行处理(跨会话用 sessionId=*) |
同时删除:lib/audit-view.js(面板的过滤/导出/统计纯函数)及其单测、assets/replay-panel.png、面板专属 i18n 文案与样式。
安装
💡 npm 安装(普通用户推荐):
dsh plugin --profile web add dsh-my-observability --trust-lockfile——无需克隆本仓库;link 方式供本仓库开发者使用。
git clone https://github.com/baosfeng/my-dsh-plugins.git
dsh plugin --profile web add link:<仓库路径>/plugins/dsh-my-observability
server 端改动需重启 dsh web;client 端改动硬刷新浏览器(Cmd/Ctrl+Shift+R)即可。
配置
插件行 config 字段,均可选:
| 配置键 | 作用 |
|---|---|
aiReview |
增量 diff 审查启用 AI 增强(默认 true;agents 服务不可用时自动降级) |
aiTimeoutMs |
AI 审查超时(毫秒,默认 60000) |
aiReview 与 aiTimeoutMs 可在 设置 → 插件 → 可观测性 里可视化编辑:保存即写回 profile 层 cordis.patch.yml 的插件行(行 id observability,其余手写键原样保留),DSH 热重载后立即生效,无需重启。其余字段(aiProvider / aiModel / aiCwd / resourceIntervalMs 等)仍按上表在 cordis.patch.yml 手写;非法值不会写坏配置(aiReview 非布尔忽略,aiTimeoutMs 非正/非有限回退 60000)。
限制与说明
- Git 工具作用于本机仓库:仓库路径由你在面板输入(localStorage 记住),仅本机可访问(loopback 围栏)。
- AI 审查是增强不是门禁:agents 服务不可用或超时/解析失败时自动降级为纯规则引擎结果。
- 审计有上限:每会话 2000 条 / 全局 20000 条,超出自动淘汰最旧事件。
相关文档
Links
More in this category
yjh051108/dsh-routing-suite★ 7027
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★ 3950
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.
first-fluke/oh-my-agent#dsh★ 1494
Runs project OMA checks before and after tool execution and when a turn tries to finish. Installs its OMA CLI dependency and initializes unconfigured projects on first use. Requires Node.js 22+; initial setup needs network access and project write access.
MichengAI/dsh-skills-manager★ 631
Manages local DeepSeek Harness skills in Settings and shows shared Agent skills as read-only.
hust-open-atom-club/oh-dsh★ 326
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
Fishquito7/dsh-skill-mcp-panel★ 291
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.