Skip to main content
T

dsh-auto-wise

trulypv/dsh-auto-wise

Adds four collaboration principles (proactive, humble, communicative, innovative), a once-per-turn push_decide tool that schedules a delayed wake-up while work remains, and a confirmation gate for high-risk shell actions.

Install

dsh plugin --profile web add github:trulypv/dsh-auto-wise

README

dsh-auto-wise

把「怎么协作」和「怎么收尾」合成一个 dsh profile 插件:

  1. 协作原则:向系统提示词注入主动、谦虚、善于沟通、创新四条原则。
  2. 本轮决策工具:注册 push_decide,让模型在每轮结束前显式决定是否登记一次延迟唤醒,而不是只在正文里写「接下来……」。
  3. 高风险确认:对少量破坏性 shell 操作(force-push、删除系统/家目录、清盘、删库、关机等)先征求确认。

工作方式

协作原则

插件在系统提示词中注入四条原则(order: 650):

  • 主动:在授权范围内推进下一步,不空转。
  • 谦虚:区分事实/假设,用工具结果核对,需要拍板时一次问清。
  • 善于沟通:只在进展、阻塞、风险、完成时更新,完成要有证据。
  • 创新:优先新方法/新工具/新技术,说明常规做法与创新做法的取舍,先小范围验证,不绕过安全边界。

push_decide

每轮结束前必须调用一次。若回答里还有下一步、待办、计划或跟进,needed 必须为 true,task 写明要恢复的工作;只有确实无事可做时才用 needed=false。

无后续:

{ "needed": false }

登记延迟唤醒:

{
  "needed": true,
  "task": "check PR #80 review and continue the fix",
  "after_seconds": 600,
  "title": "PR 80 check"
}
  • needed 必填。
  • needed=true 时 task 必填。
  • after_seconds 默认 defaultAfterSeconds,并夹在 [minAfterSeconds, maxAfterSeconds] 内。
  • title 可选,缺省时从 task 派生(最多 120 字符)。
  • 每轮只记一次决策;turn/start 重置,turn/end 消费。没调用只记 warning,不会静默猜测。

高风险确认

tools/pre-execute 命中规则时返回 ask,而不是直接执行。规则集中在 highRiskReason(),便于审查和单测。

只有 shell 工具(bash / pwsh / shell)会被分类;写文件时正文里引用危险命令(文档、测试、评审记录)不会被误拦。插件只覆盖少量明显不可逆的动作,不是完整安全策略。

配置

- insert:
    - id: auto-wise
      name: dsh-auto-wise
      config:
        enabled: true
        principles: true
        push: true
        injectPrompt: true
        highRiskGuard: true
        defaultAfterSeconds: 600
        minAfterSeconds: 60
        maxAfterSeconds: 86400
  • principles 控制四条原则。
  • push 控制 push_decide 与对应提示词。
  • highRiskGuard 控制高风险确认。
  • injectPrompt 只控制 push_decide 的提示词段落。

没有 Host Schedule 的 profile(例如部分 headless 组合)仍会加载四条原则和高风险确认,只跳过 push_decide。

安装

从 GitHub 安装:

dsh plugin --profile web add github:TrulyPV/dsh-auto-wise
dsh plugin --profile headless add github:TrulyPV/dsh-auto-wise

或使用预构建的 Release 包:

dsh plugin --profile web add https://github.com/TrulyPV/dsh-auto-wise/releases/download/v1.0.0/dsh-auto-wise-1.0.0.tgz

开发时可以直接链接本地目录:

dsh plugin --profile web add <path-to-dsh-auto-wise>

package.json 声明了 dsh.bundle.patch,dsh plugin add 会安装包并把 dsh-auto-wise 加入 profile 的 dsh.profile.bundles。

测试

cd dsh-auto-wise
node --test test.mjs

覆盖:四条原则(含创新)、push_decide 注册、needed=false/true、缺少 task、每轮一次决策与重置、延迟夹取、标题截断、无 Schedule 降级、高风险确认、文件写入不误拦、关闭开关。

限制

  • 插件不能保证模型一定遵守原则,只提供约束和提醒。
  • push_decide 依赖 Host Schedule;没有该服务时不注册工具。
  • 延迟默认上限一天;更长或日历规则用 schedule_create。
  • 高风险规则基于工具名与参数文本匹配,可能有误报/漏报,不替代权限沙箱。
  • 唤醒只在 dsh 主进程运行时触发。

Related plugins