dsh-std README

项目的 README,来自 github.com/T-Auto/dsh-std。合并为一个 markdown 文件:README.md。

DSH Standard

English | 中文

In plain terms, DSH Standard is a set of universal interoperability protocols. Its goal is simple: let DSH plugins, background runtimes, and various user interfaces (TUI terminals, Web UIs, desktop apps, headless daemons) decouple cleanly and work together smoothly.

@dsh-std/core is a "meta-protocol" (the protocol about protocols). Domain-specific protocols—like Command, Tool, Model, and Presentation—sit on top of this meta-protocol substrate for discovery and negotiation, each versioned independently. Different hosts and applications only implement the parts they actually need.

Reference packages provide types, validators, and pure-function negotiators. Conforming implementations are not required to depend on these npm packages, nor do they need to run inside DeepSeek Harness.

What is a "Meta-protocol" (The Protocol About Protocols)?

Most protocols you deal with handle specific domain tasks:

In contrast, @dsh-std/core knows zero domain business fields (it doesn't even know what a command or a model is). It is purely the "protocol about protocols":

Why is this powerful?
Monolithic frameworks hardcode every capability (commands, storage, events) into a central SDK; whenever a new domain arises, the entire framework requires a release or a breaking change. Under a meta-protocol architecture, the protocols themselves are pluggable plugins: public standards, community extensions, and private protocols alike register as standalone protocol definitions. The core never changes, letting the ecosystem evolve boundlessly on its own.

Why Decouple via Adapters?

The upstream DSH core and downstream ecosystem plugins have inherently different engineering priorities:

Adapter functions and implementation An adapter maps internal product services to the standard protocols the product adopts. Reusable adapters can reduce repeated product API integration work for third-party plugins. Each project can design its own adapter or use an existing implementation.

Third-party plugins target the protocol contracts they adopt; adapter internals and package names are not a shared entrypoint. @dsh-std/adapter-dsh provides a set of mappings for DeepSeek Harness. TUIs, Web frontends, remote runners, and other integrators can provide their own implementations. Compatibility depends on protocol versions, live capabilities, and product mappings.

What else is great about this (Beyond stable dependencies)?

Separating protocol contracts from product implementations supports the following development patterns:

Vision: Layered, Optional, Non-coercive

Meta-protocol (core)   only defines how protocols are declared and negotiated; no domain concepts, no fixed roles
        |
Domain protocols       connection / command / tool / session / presentation / agent ...
        |              independently versioned, implementable and replaceable; future protocols may supersede them
        |
Profiles               admission and interoperability specifications for concrete product shapes,
                       carried by ecosystem projects (e.g. dsh-ecosystem-spec provides the TUI Profile)

Start here

Status

The code and proposals are early drafts.

Each package records changes in its own CHANGELOG.md. Public contract modifications must update the corresponding changelog.

Development

Node.js ^22.19 || >=24 and pnpm are required.

pnpm install
pnpm check

Releasing

Published package versions are maintained directly in each packages/*/package.json; the release workflow does not rewrite them. A push to main compares those versions with the pre-push commit, then packs, OIDC-publishes, tags, and creates a GitHub Release for every increase. Prerelease versions use their prerelease identifier as the npm dist-tag (rc, alpha, or beta); stable versions use latest.

The release job is restricted to this repository's GitHub ID, so ownership transfers do not disable it and forks do not publish packages. GitHub Releases target the repository running the workflow through GH_REPO.

For the transfer to T-Auto/dsh-std, each published npm package's trusted publisher must use owner T-Auto, repository dsh-std, and workflow release.yml (with no environment). Configure this in the package's npm settings before publishing from the transferred repository; GitHub ownership transfer does not update the npm configuration. See npm trusted publishing.

License

MIT

dsh-std (T-Auto/dsh-std)

正在搜索数据库…

这是什么?DSH Standard 是一套通用互操作协议,让 DSH 插件、后台运行时和不同的用户界面(TUI、Web UI、桌面应用、无头守护进程)彼此解耦并协同工作。
这是一个运行时,还是只是带参考包的协议规范?它是一份元协议规范,外加一组可供实现方选择性使用的 npm 参考包(类型、校验器、纯函数协商器);符合规范的代码不必依赖这些包,也不必运行在 DeepSeek Harness 内。
我怎么在插件或宿主中开始使用它?用包索引挑选你需要的最小已实现包接口,然后用 pnpm 构建 monorepo(例如 `pnpm -r build`)。
构建它需要安装什么?使用该仓库需要 Node.js ^22.19 或 >=24 版本,以及 pnpm。
这个标准已经完成并稳定了吗?没有,代码和提案都被明确标注为早期草稿,接口仍可能变化;每个包在自己的 CHANGELOG.md 中记录变更。
它面向谁——插件作者还是宿主开发者?两者都是:希望自己的代码能在 TUI、Web、远程 SSH 和无头宿主上不经修改就运行的插件作者,以及需要在不执行插件代码的情况下检查插件兼容性的宿主/工具构建者。
Adapter 层是做什么用的?适配器(如 @dsh-std/adapter-dsh)会吸收快速变动的上游 DSH 运行时带来的破坏性变更,让下游插件和其他宿主保持稳定的契约。
Facet 模型是什么?单个插件包可以捆绑多个 facet(例如 UI 和后端逻辑),宿主只激活它实际需要的 facet,因此无头服务器永远不会加载前端代码,未使用的资源也不会被泄露。
工具能在安装插件之前检查兼容性吗?可以,因为插件附带静态清单(dsh-plugin.json),市场和 CI 工具可以在毫秒级内算出兼容性,而无需运行任何插件代码。
构建 DSH 插件必须遵循这个标准吗?不必,采用是自愿的;项目可以自由使用自己的架构,但如果声称符合某个协议版本,就必须通过该协议的一致性测试套件。
作者
T-Auto
大小
0.8 MB
星标
164
更新
提交Oct 10
时长
3个月
提交 · 90 天