omdsh-dev/dsh-tool-schema
DSH JSON Schema validation tool plugin: validate/paths/explain/normalize, zero network, zero dynamic execution.
Project Overview项目介绍
This is a DSH-native plugin that adds JSON Schema validation functionality to DeepSeek Harness. It can be installed via the official DSH plugin command: run dsh plugin --profile <web or headless> add github:omdsh-dev/dsh-tool-schema to add it to your DSH profile. It is compatible with DSH version 0.1.5-rc.1 and newer, and has passed full end-to-end validation on isolated local DSH instances. It provides four core actions for different use cases: validate, paths, explain, and normalize, each returning structured output matching RFC 6901 standards for error paths. It runs entirely offline with no dynamic code execution, making it secure for local use.
This tool is designed for both DSH plugin developers and regular end users. Developers can use it to validate plugin manifests, configuration files, and API response structures, while end users can leverage it to verify any JSON data exchanged during DSH agent sessions. To run a quick validation after installation, you can execute dsh run "Use the schema tool to validate {name: 'x', age: 3} against the given JSON Schema" to confirm it works correctly. All errors are sorted stably by instance path, schema path, and keyword to ensure consistent output across multiple runs. It cuts down on manual validation errors that often happen with complex nested schemas, letting agents rely on consistent structural checks.
This plugin is released under the open source MIT license, with no associated costs for commercial or non-commercial use. It has several built-in safety limits to prevent resource abuse: data and schema are capped at 256 KiB each, maximum nesting depth is 64 levels, and all pattern checks have a 1000ms hard timeout. Users are warned not to pass sensitive data to the tool, as all tool parameters are logged in the DSH session log. It requires no extra external dependencies beyond the base DSH installation, as missing peer dependencies are handled automatically by DSH. To build locally you need TypeScript and Vitest for testing, with 125 test cases covering all core functionality.
这是一个原生 DSH 插件,为 DSH 提供纯函数式的 JSON Schema 验证能力,支持验证数据、列出校验失败路径、解释 schema 约束、安全应用默认值。它全程不联网、不执行动态代码,内置多层安全防护,包括原型污染防护、正则执行超时限制、本地引用循环检测和大小深度预算控制,满足 DSH Agent 对 JSON 数据结构校验的需求。
插件面向 DSH 插件开发者和普通用户,可用于校验 API 响应、插件 manifest、配置文件、会话事件等任意 JSON 数据。使用时可选择对应操作:validate 输出完整验证结果,paths 仅返回失败路径,explain 静态解释 schema 约束,normalize 应用默认值后再验证,能根据不同使用场景灵活选择操作类型。
本插件遵循 MIT 许可证,已兼容 DSH 0.1.5-rc.1 版本,可通过 DSH 内置的插件命令从 GitHub 仓库一键安装,也可本地构建后通过 tarball 安装。它对输入数据有大小深度限制:数据和 schema 各不超过 256 KiB,嵌套深度不超过 64 层,使用时不要传入敏感数据。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-tool-schema(omdsh-dev/dsh-tool-schema)
仓库:https://github.com/omdsh-dev/dsh-tool-schema
本站详情页:https://www.yhbd.top/plugins/omdsh-dev-dsh-tool-schema/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-09-10 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:omdsh-dev/dsh-tool-schema
把 omdsh-dev/dsh-tool-schema 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-tool-schema
DSH JSON Schema 验证工具插件 —— 验证数据、列出失败路径、解释 schema 约束、安全应用 default。零网络、零动态代码执行。
动机
Agent 需要验证任意 JSON 数据是否符合 schema(API 响应结构、插件 manifest、配置文件、会话事件),并定位失败路径。现有路径没有这个能力:
defineTool参数 DSL 是作者 DSL——面向插件作者声明工具参数,不是面向任意用户 schema 的通用验证服务dsh-tool-json只提供查询——能取路径、能筛选,但不验证结构、不给 RFC 6901 失败定位- 模型"目测"验证不可靠——复杂嵌套 schema(allOf/oneOf/
$ref/pattern)组合下,手算通过/失败极易出错,且无法展示可验证的过程
本插件提供独立的纯函数 JSON Schema 验证内核:一次函数调用返回 verdict、路径化错误与 schema 问题。不执行任何代码、不访问网络,绝不静默忽略不支持的 schema 关键字。
安全模型
- 零动态执行:验证内核是纯数据遍历,不构造
RegExp(pattern 在独立 worker 内执行)、不eval、不访问网络、不读文件 - 不支持关键字绝不静默忽略:报告
unsupported-keywordschema issue;strictSchema=true(默认)直接失败(valid:false/complete:false),strictSchema=false验证已支持子集(valid:null/complete:false/supportedSubsetValid) - ReDoS 防线:所有
pattern校验在可终止的 worker 线程内共享 1,000ms 硬预算,超时terminate()并报错——灾难性回溯不能阻塞宿主进程;pattern ≤ 16 KiB、每 schema ≤ 100 个 - 原型污染防护:所有对象访问用
Object.hasOwn,__proto__/constructor/prototype只作为普通 JSON 键处理 $ref安全性:仅支持本地引用(#与#/$defs/<token>,RFC 6901 转义);目标必须存在;环检测(schema-check 静态报告ref-cycle+ 验证期(schemaNode, instance)栈动态兜底)- 预算:
- data / schema 各 ≤ 256 KiB(超限直接报错)
- 嵌套深度 ≤ 64、schema 节点 ≤ 10,000、遍历节点 ≤ 100,000
- 错误 100(默认)/ 1,000(上限);
$ref链 ≤ 64 - canonical 输出 ≤ 1 MiB(超限截断 errors/schemaIssues 等并置
truncated)
- 工具参数会记入会话日志,不要传入敏感数据
工具声明
注册 schema 工具(@deepseek-ai/dsh-tool-schema,row id tool-schema),统一输出 JSON 文本字符串。
| action | 作用 | 输出 |
|---|---|---|
validate |
验证 instance 是否符合 schema | verdict + RFC 6901 instancePath/schemaPath 错误(稳定排序)+ schemaIssues + checkedNodes + truncated |
paths |
只返回失败路径 | paths(path + 关键字摘要)+ errorCount + truncated |
explain |
静态解释 schema 约束 | 约束树节点序列(nodes,有限列表非自然语言长文)+ schemaIssues + truncated |
normalize |
深拷贝 + 应用显式 default 后验证 |
appliedDefaults(path + value)+ warnings(default-invalid / normalize-skip-branch)+ 完整 validate 结果 |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
action |
string | ✅ | validate / paths / explain / normalize |
data |
json | 待验证实例(validate/paths/normalize 必需;null 是合法数据) |
|
schema |
json | ✅ | JSON Schema(boolean 或 object;draft 2020-12 子集) |
strictSchema |
boolean | 不支持关键字时失败。默认 true |
|
maxErrors |
integer | 最大错误报告数。默认 100,范围 1..1,000 |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
SepineTam/mcp-for-stata
xohmai/dsh-cpa-status
nocobase/nocobase
TencentCloudBase/CloudBase-AI-Toolkit
WYH66666666/DSH-Transparent-UI-Plugin
Nagi-ovo/dsh-visualize
omdsh-dev/dsh-data-agent
morluto/jacobian