前言¶
DSH 的理念是「一切皆插件」。但实际扩展运行时时,工具、技能、命令、提示段、事件监听、LLM 适配器、子代理提供者、Web 路由、设置命名空间、投影、蓝图、服务等仍然分属不同接缝。dsh-fabric 面向这个场景,把这些扩展点收敛成一套声明式 DSL、一个 fabric Service 和两个模型工具。
这是什么¶
- GitHub 仓库:
https://github.com/hellosky983/dsh-fabric - 许可证:
MIT - 定位:
Fabric — the everything-is-a-plugin primitive for DeepSeek Harness (dsh)。
它提供统一的 fabric Service 与模型工具 fabric_extend / fabric_inspect,用于注册、查询和管理 DSH 运行时扩展。
核心能力¶
Service API¶
fabric Service 提供以下方法:
register
list
get
remove
graph
schema
插件代码通过 ctx.get('fabric') 获取该 Service,并调用 register 注册扩展。
模型工具¶
fabric_extend 用于在对话中注册纯声明式扩展,例如 promptVariable 或 promptSection。
fabric_inspect 用于查看 census 或 schema:
fabric_inspect({ detail: 'census' })
fabric_inspect({ detail: 'schema' })
支持的扩展接缝¶
支持以下 kind:
tool
skill
command
promptSection
promptContext
promptVariable
eventListener
llmAdapter
subagentProvider
webRoute
settingsNamespace
projection
blueprint
service
其中,带可执行代码的 kind 必须由插件代码通过 ctx.get('fabric').register(...) 注册,不能通过 JSON 的 fabric_extend 注册。
只读 census 路由¶
该插件在 DSH 自带 web server 上注册只读路由:
GET /fabric/census
census 只含计数与扩展元数据,不包含会话内容。
安装与启用¶
下面是 README 给出的本机 web profile link 方式安装命令。安装时不要用 dsh plugin --profile web add ./dir;README 建议用 link: 手动写入 profile package.json,然后执行安装。
1、在目标 profile 的 package.json 中按 link: 方式加入 dsh-fabric。
2、执行:
export PATH=/home/kevin/.local/lib/nodejs/node-v24.19.0-linux-x64/bin:$PATH
cd /home/kevin/.dsh/profiles/web && pnpm install
该插件声明的 peerDependency 为:
@deepseek-ai/dsh-tools@0.1.0-rc.6
文中给出的验证 DSH 主包版本为:
@deepseek-ai/dsh@0.1.0-rc.6
典型用法¶
插件代码注册 tool¶
以下示例表示在插件 apply(ctx) 中注册一个带代码的 tool:
const fabric = ctx.get('fabric')
if (!fabric) return
fabric.register({
kind: 'tool',
name: 'hello_fabric',
description: 'A tool born from another plugin via the Fabric DSL.',
parameters: { who: { type: 'string' } },
execute: async (args) => ({ hello: (args && args.who) || 'world' }),
})
对话中注册 promptVariable 或 promptSection¶
以下示例通过 fabric_extend 注册纯声明式扩展:
fabric_extend({ definitions: [
{ kind: 'promptVariable', name: 'myvar', value: 'hello' },
{ kind: 'promptSection', name: 'my-rules', order: 800, text: 'Always be concise.' },
]})
查看 census 与 schema¶
fabric_inspect({ detail: 'census' })
fabric_inspect({ detail: 'schema' })
本地检查¶
做语法检查:
node --check index.js && node --check client.js
做冒烟测试:
node smoke-test.mjs
适用场景与注意¶
适合:
- DSH 插件开发者:通过一个插件注册其他扩展,并使用
fabricService 查询、获取、移除和查看 graph。 - 模型或用户:在对话中使用
fabric_extend注册promptVariable、promptSection等纯声明式扩展。 - 运行时观察者:通过
fabric_inspect或GET /fabric/census查看当前扩展的计数与元数据。
注意:
- 插件以当前 dsh 进程权限运行;安装前应检查源码与许可证。
- 尚未在真实 DSH 进程中做端到端运行实测;已通过静态语法检查与 mock 上下文冒烟测试。
- 零配置:无配置项、无环境变量、无敏感项。
- 不读写任何文件;不读取会话内容;不读取、不存储任何凭据。
- 无持久化状态;所有运行时扩展在插件停止时自动 dispose。
- 如果发现安全问题,应通过 GitHub private vulnerability reporting 报告。
相关链接¶
- GitHub:
https://github.com/hellosky983/dsh-fabric - 社区目录页:
https://www.skillhub.cn/plugins/hellosky983/dsh-fabric(独立站点,非官方应用商店)