NingZhenPeng/dsh-plugin-preflight ↗★ 0
dsh-plugin-preflight
插件安装预检闸门:在 pluginManager.installBundle 之前跑预检,判定为拒绝时中止安装,并把每次检查写入审计日志;侧栏面板可切换拦截/只记录、调整规则与阈值。
Other repositories with this package name
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-plugin-preflightREADME
Read the full README ↗配置
cordis.patch.yml 里的 config(整块替换,改一个键要重述其它键):
| 键 | 默认 | 说明 |
|---|---|---|
mode | enforce | 启动默认模式;运行期以 runtime.json 为准 |
dataDir | 空 | 数据目录。空时回退 workspaceRoot/docs/audit,再回退 ~/.dsh/plugin-guard/audit |
workspaceRoot | 空 | 旧配置兼容用,建议新装时改用 dataDir |
timeoutMs | 20000 | 单次预检超时 |
runtime.json 里可热改的项(面板「高级设置」写的就是它):
| 键 | 默认 | 说明 |
|---|---|---|
mode | enforce | enforce 拦截 / warn 只记录 |
onUnverified | block | 预检跑不成时:block 拦截 / allow 放行 |
timeoutMs | 20000 | 预检超时(毫秒) |
auditMaxBytes | 1048576 | 审计文件上限,超过轮转,保留 3 份旧日志 |
disabledRules / allowlist / thresholds / customRules | 空 | 见上文 |
它放在数据目录,不在安装目录(0.15.0 起):dataDir → workspaceRoot/docs → ~/.dsh/plugin-guard,与审计同一处。
写在安装目录会导致升级插件时设置被 pnpm 重装覆盖、只读安装则根本写不进去。旧版本留下的 runtime.json 会被自动读取,改一次设置后即迁到新位置。