@deepseek-ai/dsh-tool-regex
DSH regex tool: test/find/replace over text plus static pattern explanation, zero-dependency with ReDoS guards
AI 分析
为模型提供安全的正则表达式测试与文本处理能力,并能静态解释正则含义。适合需要高频处理文本匹配、数据清洗且关注执行安全的用户。
インストール
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:omdsh-dev/dsh-tool-regexドキュメント
README 全文を読む ↗一次性任务(headless)profile —— dsh run 默认使用 headless
dsh plugin --profile headless add "C:/path/to/dsh-tool-regex"
包内 `dsh.bundle.patch` 会在安装后自动把插件加入 profile 的 layer stack(row id:`tool-regex`)。插件缺失的 peer 依赖(`cordis`、`@deepseek-ai/dsh-tools`)由 profile 的 healed `profiles/node_modules` 回退安装提供。
> ⚠️ web 与 headless 是**不同 profile**:web 安装不会自动覆盖 headless;`dsh run` 默认使用 headless profile。Windows 路径使用正斜杠(`C:/...`)。
### 验证安装
```sh
dsh --profile web --dump-config | grep tool-regex
运行验证
dsh run "使用 regex 工具测试 d+ 是否匹配 abc123"
手动安装与旧版本兼容
仅适用于不支持 Profile Bundle 的旧快照或插件开发调试环境(本地 junction/symlink、手动编辑 profile 层)。
测试
node /node_modules/vitest/vitest.mjs run tests
engine.spec.ts:test/find/replace 全分支 + flags/pattern 错误 + 64KB 上限 + ReDoS worker 用例(病理 pattern 在 3s 预算内被取消,不挂死测试进程)explain.spec.ts:字面量/字符类/分组/量词/转义/锚点/交替 + 未闭合报错register.spec.ts:注册契约(AUDIT-CROSS-02 风格)
许可
MIT