dsh-pth-interface
v0.5.1
Published
dsh (DeepSeek Harness) interface-mode plugin for PTH: exposes only pth_* management tools + a usage manual — the agent becomes a pure frontend of a PTH task-pool system
Maintainers
Readme
dsh-pth-interface
dsh(DeepSeek Harness) 的 interface 模式插件:让 agent 只持有 pth_* 管理工具 + 内置使用手册——无 shell、无文件系统、无网络、无子代理——纯充当 PTH 任务池管理系统的前端操作员。
功能
- 注册 10 个模型面工具(走 PTH HTTP API):
pth_submit/pth_status/pth_tasks/pth_cancel/pth_transcript/pth_kernel_status/pth_worker_activity/pth_worker_context/pth_roles - systemPrompt 注入精简版「PTH 使用手册」(世界观 / 标签路由 / 结果契约 / 排查配方)。
- 附带现成 profile 模板,逐行禁用其他全部模型面工具(
tool-bash、tool-fs、tool-subagent等),组合出的 agent 严格只有 interface 能力。
前置条件
- dsh CLI(
npx dsh或已安装的 dsh) - 可达的 PTH kernel API(默认
http://localhost:3000)与 bearer token
安装
npm install -g dsh-pth-interface
# headless 形态(一次性自动化)→ ~/.dsh/profiles/pth
dsh-pth-interface install --variant headless --name pth
# web UI 形态(交互式)→ ~/.dsh/profiles/pth-web
dsh-pth-interface install --variant web --name pth-web形态三:agent preset(web UI 模式选择器)
除独立 profile 外,本包还附带两个 dsh agent preset——装好后直接出现在 web UI 的模式选择器里,与 极简/标准/创造 同级:
- PTH Interface——任务与观测面(9 个 pth_* HTTP 工具,无本机能力,不阻塞交互)
- PTH Ops(运维)——生命周期面(pth_ops 白名单:容器栈/更新/构建/日志/体检/工具容器 + 只读观测)。需要在
~/.dsh/.agent-presets/pth-ops/agent.cordis.yml配置repoDir(pth 仓库路径)。
dsh-pth-interface install --variant preset它把一个零外部依赖的自包含 preset 拷入 ~/.dsh/.agent-presets/pth-interface/。发现是实时的(每次调用重扫根目录),无需重启——打开 web UI 新建会话时选择「PTH Interface」即可。
使用
export PTH_TOKEN=<你的 pth token>
# headless 一次性执行
dsh --profile pth "给 developer 发个任务计算 21*2,把 taskId 给我"
# web UI
dsh --profile pth-web验证组合树(所有非 pth 工具行应为 disabled: true):
dsh --dump-config --profile pth配置
编辑 ~/.dsh/profiles/<name>/cordis.patch.yml 的 pth-interface 行:
| 键 | 默认 | 含义 |
|---|---|---|
| baseUrl | http://localhost:3000 | PTH kernel API 地址 |
| tokenEnv | PTH_TOKEN | 存放 token 的环境变量名 |
| token | "" | 配置里直接写 token(明文落盘,优先级低于环境变量——仅本地单用户场景;web UI 形态下 dsh 进程不继承你的 shell 环境变量,用它最方便) |
| requestTimeoutMs | 15000 | 单次 HTTP 请求超时 |
设计决策
- 为什么是插件而不是 skill:skill 只有指令没有工具面——既不能注册工具也不能禁用内建工具;interface 模式两者都要,所以是 cordis 插件 + profile 补丁层。
- 无阻塞等待:刻意不提供 wait 工具——interface 模式绝不在运行中的任务上阻塞交互。提交即返回;之后操作员询问时再用
pth_status/pth_tasks按需查询。 - 失败降级:所有工具失败返回
{ ok:false, error:{...} }而不抛错,模型可据此自行修复调用。 - 保留 user-questions:操作员与 agent 的对话通道(patch 文件注释里有关闭方法)。
License
MIT
