DeepSeek Harness plugin

doco-dsh

Doco knowledge-base native plugin for DeepSeek Harness (dsh) — search, read, outline and save-draft your Doco KB with block-level addressing.

Jump to install

Source facts

Repository
songofhawk/doco-dsh
Latest update
Aug 20, 2026
Category
Docs & Rendering
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/songofhawk/doco-dsh
Plugin: doco-dsh
Author: songofhawk

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

doco-dsh

Doco 知识库的 DeepSeek Harness(dsh)原生插件。用 6 个工具把 Agent 接到你的 Doco 知识库上:块级寻址、按 token 预算精读、乐观并发写入草稿、来源引用,全部复用 doco-agent-cliDocoClient(HTTP / ETag / Token 逻辑不复制)。

默认只读;写入走 dsh 原生审批 + scope 门禁,绝不静默提交。

能力

工具读/写说明
doco_status连接自检:当前用户、scope、API 地址、读写能力
doco_list_knowledge_bases列出可见知识库(选 knowledge_base_id
doco_searchSearch v2 全文搜索,带完整性证明(projection.complete / freshness
doco_outline文档结构大纲(稳定 block_id + heading path),先规划再精读
doco_read按 token 预算局部读取正文(around / cursor 续读)
doco_save_draft把 Agent 产出存成新草稿preview → 确认 → commit

回答里的事实命中有来源引用(document_uri / web_url);doco_search 返回 complete=falsefreshness=stale 时,插件会显式标注「结果不完整」,禁止 Agent 据此断言「知识库里没有」。

安装

doco-dsh 依赖:

  • doco-agent-cli@^0.1.3(npm 运行时依赖);
  • @deepseek-ai/dsh-tools / @deepseek-ai/cordispeer dep,由宿主 dsh 提供,本插件不捆绑)。

装包并自动挂载(推荐)——本包声明了 dsh.bundle.patchdsh plugin add 装完即自动挂进 profile 层栈:

dsh plugin --profile <name> add doco-dsh

手动挂载(备选)两步:

pnpm add doco-dsh   # 或 npm i doco-dsh,装到 dsh 项目里供 composition 解析

再在 dsh 的 Composition YAML(如 agent.cordis.yml)里追加一条——name 既可用 npm 包名,也可用本地相对路径:

# 挂到你的 composition(追加一条)
- id: doco
  name: 'doco-dsh'

(最简形式也可只写 - name: 'doco-dsh'。挂载语法细节见 dsh 教程《07 · Into the Harness》。)

挂载完成后,apply 会: 1. 解析配置(见下); 2. 注册 6 个工具(命名带 doco_ 前缀,可配 DOCO_DSH_TOOL_PREFIX 覆盖); 3. 注入系统提示词分段(仅规则,不注入内容/Token); 4. 注册 /doco 命令。

> 配置走环境变量与 doco-agent-cliloadConfig()(见下方「配置」),不通过 YAML config: 块。

@deepseek-ai/dsh-tools 缺失或版本不兼容,插件会在加载期抛稳定错误码 doco_dsh_incompatible(不静默降级)。

授权(设备登录流)

/doco connect                     # 默认 read_only
/doco connect --access read_write # 需要写入时选 read_write

命令会打开系统浏览器完成设备授权,Token 写入 ~/.config/doco/config.json0600),并自动重载插件状态。

/doco status / disconnect / set-kb <kb_id>

Token 只走 POST 请求体与浏览器;绝不进入工具结果、日志、错误栈或提交

配置

优先级(高 → 低):dsh 启动参数 > doco-agent-cliloadConfig()~/.config/doco/config.json + DOCO_BASE_URL/DOCO_TOKEN)> 插件级环境变量 > 内置默认。

环境变量默认说明
DOCO_API_BASE_URLhttps://api.doco.page/api/v1API 地址(仅 http/https)
DOCO_API_TOKEN令牌(也可用 doco-agent-cli 登录)
DOCO_DEFAULT_KB默认知识库 id
DOCO_WEB_ORIGINhttps://doco.page引用链接的 Web 源
DOCO_READ_MAX_TOKENS4000doco_read 默认预算(64–50000)
DOCO_READ_CONTEXT_BEFORE / AFTER2 / 4上下文块默认(0–100)
DOCO_DSH_TOOL_PREFIXdoco工具名前缀
DOCO_DSH_ALLOW_WRITESfalse写入总开关(仍受 scope + 用户确认双重门禁)

写入安全(三层)

1. 同步 guardDOCO_DSH_ALLOW_WRITES 未开启时,任何 commit 被单调拒绝(doco_write_not_confirmed)。 2. pre-execute 审批:commit 前校验 documents:write scope,随后 ask 用户确认(dsh 原生审批)。 3. execute 防御:即使被直接顶层调用,doco_save_draft 也再校验 scope 并返回稳定错误码。

doco_save_draft创建新草稿:不删除、不移动、不整篇覆盖;用唯一 Idempotency-Key,冲突即返回 doco_version_conflict,从不强覆盖。

与 Doco MCP 的关系

doco-agent-cli 自带一套 29 工具的 MCP server。本插件复用同一 DocoClient,并在读/搜索工具上采用同名前缀:若二者被同时加载,registerTools 检测到重名会跳过而非覆盖,避免同一个知识库以两套名字重复注册、重复消耗上下文。推荐二选一(原生插件更省一跳 RPC 且能用上 dsh 原生写入审批;MCP 更通用)。详见 [docs/adr-001-native-vs-mcp.md](docs/adr-001-native-vs-mcp.md)。

错误契约

工具失败「返回而非抛出」结构化错误值 { kind:'doco_error', code, message, next_step },让模型能读到 next_step 自行纠偏。稳定错误码见 src/errors.js(如 doco_auth_requireddoco_insufficient_scopedoco_rate_limiteddoco_version_conflictdoco_read_cursor_stale)。

开发

pnpm install
pnpm test          # 68 个测试:单测 + 真实 dsh-tools/cordis 冒烟 + 装配集成