dsh-ops-agents
Ops agent presets for DeepSeek Harness: two additional entries in the agent-preset picker, next to the shipped 标准模式 / PTC 模式 / 极简模式 / 创造模式.
- 故障诊断 (
ops-diagnosis) — a read-only fault-diagnosis agent. An SRE persona drives a fixed workflow (triage → evidence → hypotheses → root cause → remediation advice) over five demo tools —query_metrics,query_logs,list_alerts,get_service_topology,run_diagnostic_check— that return deterministic mock data telling one coherent incident story. No shell or write tools are mounted; the agent is read-only by construction. - 知识库 (
ops-kb) — a knowledge-base Q&A agent over a local document directory.kb_searchranks Markdown/text chunks by query-term hits with file and line citations,kb_listenumerates the corpus. Ships with sample ops docs; pointOPS_KB_DIRat your own directory to use a real corpus.
No dsh framework code is modified: the package composes through the documented bundle patch-layer extension point, and each preset is a plain agent-preset directory (agent.cordis.yml + preset.yml) with zero-dependency preset-local tool plugins.
Requirements
- A
dshprofile with the preset roster composed (the shippedwebprofile, i.e.@deepseek-ai/dsh-base+@deepseek-ai/dsh-web-app). - Node.js 20+.
Install
Install into a profile (creates the profile if needed):
dsh plugin --profile web add dsh-ops-agents
Or from a local checkout / tarball:
dsh plugin --profile web add ./dsh-ops-agents
dsh plugin --profile web add ./dsh-ops-agents-0.1.0.tgz # pnpm pack first
Verify the layer, then boot:
dsh --profile web --dump-config # shows a "# == dsh-ops-agents" layer
dsh --profile web # the preset picker gains 故障诊断 and 知识库
To remove: dsh plugin --profile web remove dsh-ops-agents (the two synced preset directories under $DSH_HOME/.agent-presets/ are left behind; delete ops-diagnosis/ and ops-kb/ there to remove them from the picker).
How it works
One package, three parts:
- Bundle layer (
cordis.patch.yml): inserts a single glue row into the profile composition, discovered through the manifest'sdsh.bundle.patchdeclaration. - Glue plugin (
src/index.ts): on boot, copies the bundledpresets/*directories into$DSH_HOME/.agent-presets/, the user preset root thatdsh-agent-presetsalways scans. A bundle patch cannot add a discovery root itself — the CLI's profile assembly force-setsrootson theagent-presetsrow after every bundle layer — and discovery skips symlinked directories, so real copies it is. The sync overwrites only the two preset ids this package ships (ops-diagnosis,ops-kb); anything else in the user root is untouched. Discovery re-reads the root on every roster read, so new sessions see the presets without a restart. - Preset directories (
presets/ops-diagnosis/,presets/ops-kb/): each carriespreset.yml(picker display text),agent.cordis.yml(adsh-personacomplete-prompt row plus the preset-local tool plugin), and aplugins/*.mjszero-dependency tool plugin loaded by plain Node straight from the preset directory. Hand-rolled tool definitions, no dsh imports —ctx.tools.register()enforces only the output schema.
Do not hand-edit the synced copies under $DSH_HOME/.agent-presets/ops-* — every boot overwrites them from the installed package. Edit the package (or copy the preset to a new id in the picker) instead.
Development
pnpm install
pnpm run build # tsc → lib/
pnpm run test # vitest: tool registrations and retrieval behavior
Preset edits need no build — the glue sync copies them verbatim on the next boot. The glue plugin does.
License
MIT
