MacilyDots/dsh-prompt-inject ↗★ 0
dsh-prompt-inject
DSH plugin: register a configurable prompt variable so agent presets that use complete:true personas (which drop every other system-prompt section) can still receive an injected text block. 适合使用特定Agent预设,且需要绕过人设限制强制注入自定义文本块的提示词工程任务。
같은 패키지 이름의 다른 저장소
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:MacilyDots/dsh-prompt-inject配置
在 profile 的 cordis.patch.yml 里覆盖插件配置:
- id: prompt-inject
config:
variable: inject
textFile: ''
| 字段 | 默认 | 说明 |
|---|---|---|
variable | inject | 注册的变量名;预设前缀里写 {{}}。必须匹配 [a-z][a-z0-9_]* |
textFile | '' | 文本文件路径(UTF-8)。改动后按 mtime 自动重载,不必重启 DSH |
text | '' | 内联文本。textFile 优先;两者都空则不注入任何内容 |
presets | [] | agent 预设 id 白名单(对应会话创建记录里的 agentPreset)。空 = 不限制 |
sessions | [] | 会话 id 白名单。空 = 不限制 |
cwds | [] | 工作目录白名单(会话 header.cwd)。空 = 不限制 |
enabled | true | 总开关 |
stateFile | '' | 外部开关文件(JSON)。用于跟随别的插件的开关状态 |
stateKey | enabled | 在上面那个 JSON 里读哪个键;该键必须严格等于 true 才注入 |
debug | false | 往 %DSH_HOME%/prompt-inject.log 记每次求值的结果 |
variable 和 presets 是两道独立的闸门:引用决定「谁能拿到」(没写引用的预设
根本不会展开这个变量),provider 决定「什么时候返回空」(白名单、开关、外部状态)。