@wenaixi/cfbridge 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +3 -0
- package/LICENSE +21 -0
- package/README.md +184 -0
- package/cordis.patch.yml +38 -0
- package/deprecated/preset/README.md +30 -0
- package/deprecated/preset/agent.cordis.yml +126 -0
- package/deprecated/preset/preset.yml +10 -0
- package/package.json +74 -0
- package/scripts/check.js +255 -0
- package/scripts/dump-config.js +71 -0
- package/scripts/install-bundle.js +160 -0
- package/scripts/install-preset.js +19 -0
- package/scripts/migrate-from-preset.js +110 -0
- package/scripts/test-wrangler.js +58 -0
- package/scripts/test.js +50 -0
- package/scripts/uninstall-bundle.js +131 -0
- package/scripts/uninstall-preset.js +11 -0
- package/scripts/validate-bundle.js +232 -0
- package/scripts/validate-preset.js +9 -0
- package/scripts/wrangler.js +37 -0
- package/skills/cfbridge/SKILL.md +177 -0
- package/src/cfbridge-skill.js +46 -0
package/.env.example
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wenaixi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# cfbridge
|
|
2
|
+
|
|
3
|
+
> Cloudflare 官方 Code Mode MCP 在 DeepSeek Harness(DSH)中的**全局 Bundle 桥接**。
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@wenaixi/cfbridge)
|
|
6
|
+
[](#版本与维护)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
|
|
9
|
+
cfbridge 是一个 **DSH Bundle(组合包)**,通过 `dsh plugin --profile <name> add` 安装到任意 DSH profile 后,**所有会话全局可见** Cloudflare 官方 Code Mode MCP 三工具(docs / search / execute)与配套 Skill,配合项目本地 Wrangler CLI 透传。
|
|
10
|
+
|
|
11
|
+
> 仓库:**[Wenaixi/dsh-cfbridge](https://github.com/Wenaixi/dsh-cfbridge)** · npm 包:**[@wenaixi/cfbridge](https://www.npmjs.com/package/@wenaixi/cfbridge)**
|
|
12
|
+
|
|
13
|
+
## 它是什么
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
DSH Bundle(全局常驻,按需开关)
|
|
17
|
+
└─ 安装到 web profile(默认)后所有会话自动挂载
|
|
18
|
+
├─ mcp__cloudflare__docs ← Cloudflare 文档语义搜索
|
|
19
|
+
├─ mcp__cloudflare__search ← OpenAPI 端点检索
|
|
20
|
+
├─ mcp__cloudflare__execute ← 官方隔离 sandbox 内执行
|
|
21
|
+
├─ cfbridge Skill ← MCP 最佳实践、写操作审批规范
|
|
22
|
+
└─ npm run wrangler ... ← 项目本地 Wrangler CLI 透传
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 它不是什么
|
|
26
|
+
|
|
27
|
+
- **不是按 preset 选择** —— 安装后**所有会话**都自动可见,不需要选「Cloudflare 模式」。
|
|
28
|
+
- **不是动态 Cordis 插件** —— 走 DSH 原生 `dsh.bundle` 分发路径,不依赖 `cordis_define` 运行时传输。
|
|
29
|
+
- **不复制 Cloudflare API 端点列表** —— 直接使用官方 Code Mode MCP,永远是最新的。
|
|
30
|
+
- **不污染用户 patch 层** —— bundle 作为独立层追加在 `dsh.profile.bundles`;用户 `cordis.patch.yml` 只在不想用时被覆盖(见停用 B)。
|
|
31
|
+
|
|
32
|
+
## 安装
|
|
33
|
+
|
|
34
|
+
### 前提
|
|
35
|
+
|
|
36
|
+
- DSH 已安装并可启动(`dsh --profile web`),版本 ≥ 0.1.1-rc.2。
|
|
37
|
+
- 已安装 pnpm(DSH 的 `dsh plugin` 子命令透传给 pnpm)。
|
|
38
|
+
- 已生成 Cloudflare API token。
|
|
39
|
+
- 推荐 account token(`cfat_`),需带 `Account Resources: Read`。
|
|
40
|
+
- DNS 操作使用 Zone 范围的用户 token(`cfut_`)。
|
|
41
|
+
|
|
42
|
+
### 1. 安装 token
|
|
43
|
+
|
|
44
|
+
把 token 写入 DSH 的私有环境文件(默认 `%USERPROFILE%\.dsh\.env`,可由 `DSH_HOME` 覆盖):
|
|
45
|
+
|
|
46
|
+
```dotenv
|
|
47
|
+
# C:\Users\Administrator\.dsh\.env(私有,git 忽略)
|
|
48
|
+
CLOUDFLARE_API_TOKEN=请替换为你的token
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> 仅把 token 放在被忽略的私有文件里;不要写进 `cordis.patch.yml`、commit 或 issue。
|
|
52
|
+
|
|
53
|
+
### 2. 安装 Bundle
|
|
54
|
+
|
|
55
|
+
**方式 A — npm 直装(推荐,免 clone)**
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
dsh plugin --profile web add @wenaixi/cfbridge
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**方式 B — GitHub 直装(免构建,零本地依赖)**
|
|
62
|
+
|
|
63
|
+
```powershell
|
|
64
|
+
dsh plugin --profile web add github:Wenaixi/dsh-cfbridge
|
|
65
|
+
# 锁定版本更稳妥:
|
|
66
|
+
dsh plugin --profile web add github:Wenaixi/dsh-cfbridge#v0.1.0
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> 直装前提:仓库含 `dsh.bundle` 声明且无 TypeScript 编译步骤(本仓库满足 —— 纯 JS + YAML + Markdown,GitHub 拉到的就是可运行形态,无需 `prepare`/`allowBuilds`)。
|
|
70
|
+
|
|
71
|
+
**方式 C — clone 后本地安装**
|
|
72
|
+
|
|
73
|
+
```powershell
|
|
74
|
+
git clone https://github.com/Wenaixi/dsh-cfbridge.git
|
|
75
|
+
cd dsh-cfbridge
|
|
76
|
+
npm install
|
|
77
|
+
npm run install:bundle # 默认装到 web profile
|
|
78
|
+
# 其他 profile:npm run install:bundle -- --profile tui
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`install:bundle` 内部做了两件事:
|
|
82
|
+
|
|
83
|
+
1. 调 `dsh plugin --profile <name> add .`,让 DSH 自动把 `@wenaixi/cfbridge` 加进 `dsh.profile.bundles`。
|
|
84
|
+
2. 调 `dsh --profile <name> --dump-config` 验证 `cfbridge` 层及两行(`mcp-cloudflare` / `cfbridge-skill`)出现。
|
|
85
|
+
|
|
86
|
+
### 3. 重启 DSH
|
|
87
|
+
|
|
88
|
+
```powershell
|
|
89
|
+
dsh --profile web
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
打开任意新会话,模型工具列表应包含 `mcp__cloudflare__docs / search / execute`,可用 skill 列表应包含 `cfbridge`。
|
|
93
|
+
|
|
94
|
+
## 验证
|
|
95
|
+
|
|
96
|
+
```powershell
|
|
97
|
+
# 仓库配置 + 安全检查(bundle 入口 + 反转 web patch 校验 + deprecated shim)
|
|
98
|
+
npm run check
|
|
99
|
+
|
|
100
|
+
# Bundle manifest + 结构校验(cordis.patch.yml / SKILL.md / token 痕迹)
|
|
101
|
+
npm run validate:bundle
|
|
102
|
+
|
|
103
|
+
# Wrangler CLI 只读验证
|
|
104
|
+
npm run test:wrangler
|
|
105
|
+
|
|
106
|
+
# 跑全部
|
|
107
|
+
npm run test
|
|
108
|
+
|
|
109
|
+
# 快速只查看当前 profile 中 cfbridge 这一层
|
|
110
|
+
npm run dump:config
|
|
111
|
+
# 等价:npm run dump:config -- --raw # 不过滤,输出完整 dump
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 启停控制
|
|
115
|
+
|
|
116
|
+
### A. 官方 CLI 启用/停用(推荐)
|
|
117
|
+
|
|
118
|
+
```powershell
|
|
119
|
+
# 启用(npm 包)
|
|
120
|
+
dsh plugin --profile web add @wenaixi/cfbridge
|
|
121
|
+
|
|
122
|
+
# 启用(GitHub 直装)
|
|
123
|
+
dsh plugin --profile web add github:Wenaixi/dsh-cfbridge#v0.1.0
|
|
124
|
+
|
|
125
|
+
# 停用
|
|
126
|
+
dsh plugin --profile web remove @wenaixi/cfbridge
|
|
127
|
+
# 或:npm run uninstall:bundle -- --profile web
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`uninstall:bundle` 会清理:DSH profile 中的 dependency、`dsh.profile.bundles` 层及旧版残留的 skill 软链(如有)。
|
|
131
|
+
|
|
132
|
+
### B. disabled 覆写(热切换,不卸载)
|
|
133
|
+
|
|
134
|
+
在 `%USERPROFILE%\.dsh\profiles\web\cordis.patch.yml` 末尾追加一段**完整重写** `mcp-cloudflare` 的块(DSH 后层按行胜出,必须重述整行 config):
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
# 临时禁用 cfbridge 的 Cloudflare MCP 三工具(不卸载 Skill)
|
|
138
|
+
- insert:
|
|
139
|
+
- id: mcp-cloudflare
|
|
140
|
+
name: '@deepseek-ai/dsh-mcp-client'
|
|
141
|
+
disabled: true
|
|
142
|
+
config:
|
|
143
|
+
serverName: cloudflare
|
|
144
|
+
transport: streamable-http
|
|
145
|
+
url: https://mcp.cloudflare.com/mcp
|
|
146
|
+
headers:
|
|
147
|
+
Authorization: !!js '`Bearer ${process.env.CLOUDFLARE_API_TOKEN}`'
|
|
148
|
+
toolCallTimeoutMs: 120000
|
|
149
|
+
failOnStartupError: false
|
|
150
|
+
reconnect:
|
|
151
|
+
enabled: true
|
|
152
|
+
initialDelayMs: 500
|
|
153
|
+
maxDelayMs: 30000
|
|
154
|
+
maxAttempts: 10
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
重启 DSH 后 `mcp__cloudflare__*` 消失;删除这段并重启即可恢复。
|
|
158
|
+
|
|
159
|
+
> 若 DSH 后续提供 `dsh plugin --profile <name> disable <bundle>` 原生命令,本节会迁移过去。
|
|
160
|
+
|
|
161
|
+
## 安全规则
|
|
162
|
+
|
|
163
|
+
1. **Token 仅在 `$DSH_HOME/.env`**(默认 `%USERPROFILE%\.dsh\.env`),由 `.gitignore` 忽略;`cordis.patch.yml` 用 `!!js process.env...` 动态引用。
|
|
164
|
+
2. 不写入 `cordis.patch.yml`、scripts、commit 或 issue;不打印到日志。
|
|
165
|
+
3. 使用最小权限 token;DNS 单独用 Zone 范围的用户 token。
|
|
166
|
+
4. 不再使用或泄漏时立即在 Cloudflare Dashboard 撤销。
|
|
167
|
+
5. **不要把 bundle 与旧 v0.2.0 preset 同时启用** —— 同一 `serverName: cloudflare` 会导致 `mcp__cloudflare__*` 被注册两次,行为未定义。若发现旧的 `~/.dsh/.agent-presets/cfbridge/`,运行 `npm run migrate:from-preset -- --yes` 清理。
|
|
168
|
+
|
|
169
|
+
## 已验证能力
|
|
170
|
+
|
|
171
|
+
| 层级 | 内容 |
|
|
172
|
+
| --- | --- |
|
|
173
|
+
| DSH MCP | docs / search / execute 三工具,账号 / Zone / Workers / KV / D1 / Pages / GraphQL 只读调用 |
|
|
174
|
+
| Skill | `cfbridge` Skill 在所有会话的可用 skill 列表里可见(`source: runtime`) |
|
|
175
|
+
| 本地 Wrangler | 版本、whoami、D1 列表、Worker 部署列表、Pages 项目列表 |
|
|
176
|
+
| 安全 | 追踪文件与历史均无 token;无 remote 泄露风险;`.env` 与证书被忽略 |
|
|
177
|
+
|
|
178
|
+
## 版本与维护
|
|
179
|
+
|
|
180
|
+
- 当前版本:**v0.1.0**(首个公开发布;Bundle 形态,运行时 Skill,全局可见)。
|
|
181
|
+
- 作者:**Wenaixi**
|
|
182
|
+
- 许可证:MIT
|
|
183
|
+
- 决策与历史记录见 [`CLAUDE.md`](./CLAUDE.md) 与 [`docs/plan-v0.3.0-global-bundle.md`](./docs/plan-v0.3.0-global-bundle.md)
|
|
184
|
+
- 相关链接:[Cloudflare MCP](https://github.com/cloudflare/mcp) · [Wrangler 文档](https://developers.cloudflare.com/workers/wrangler/) · [DSH Bundle 文档](https://github.com/deepseek-ai/deepseek-harness)
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @wenaixi/cfbridge — DSH Bundle Patch (host composition, v0.1.0)
|
|
2
|
+
#
|
|
3
|
+
# 安装后作为 web profile 的一个 bundle 层全局生效;所有会话均自动看到
|
|
4
|
+
# Cloudflare Code Mode MCP 三工具(docs / search / execute)与 cfbridge Skill。
|
|
5
|
+
#
|
|
6
|
+
# 设计要点:
|
|
7
|
+
# 1. mcp-cloudflare:走 dsh-mcp-client,把 `mcp__cloudflare__*` 工具注册到
|
|
8
|
+
# host 的 tools registry,所有 agent 直接可见。
|
|
9
|
+
# 2. cfbridge-skill:运行时注册 Skill(ctx.skills.register),随 bundle 全局
|
|
10
|
+
# 挂载。资源基座指向 bundle 内的 skills/cfbridge/,跟随 vision-toolkit 的
|
|
11
|
+
# 运行时 Skill 实践,不再依赖 install 阶段对 $DSH_HOME/skills 的软链。
|
|
12
|
+
# 3. 不在 patch 中再声明 persona / agent-instructions / tool-fs /
|
|
13
|
+
# skill-filesystem / tool-skill / planning 等 agent 栈行——它们由
|
|
14
|
+
# dsh-base / dsh-web-app 在 host 层提供,重复声明会触发层冲突。
|
|
15
|
+
# 4. Authorization 必须用 `!!js` 模板动态引用 process.env.CLOUDFLARE_API_TOKEN;
|
|
16
|
+
# token 仍仅放在被忽略的 %USERPROFILE%\.dsh\.env。
|
|
17
|
+
# 5. failOnStartupError 保持 false:无 token 时不阻断 DSH 启动,工具调用时
|
|
18
|
+
# 才报错并提示用户配置 token。
|
|
19
|
+
|
|
20
|
+
- insert:
|
|
21
|
+
- id: mcp-cloudflare
|
|
22
|
+
name: '@deepseek-ai/dsh-mcp-client'
|
|
23
|
+
config:
|
|
24
|
+
serverName: cloudflare
|
|
25
|
+
transport: streamable-http
|
|
26
|
+
url: https://mcp.cloudflare.com/mcp
|
|
27
|
+
headers:
|
|
28
|
+
Authorization: !!js '`Bearer ${process.env.CLOUDFLARE_API_TOKEN}`'
|
|
29
|
+
toolCallTimeoutMs: 120000
|
|
30
|
+
failOnStartupError: false
|
|
31
|
+
reconnect:
|
|
32
|
+
enabled: true
|
|
33
|
+
initialDelayMs: 500
|
|
34
|
+
maxDelayMs: 30000
|
|
35
|
+
maxAttempts: 10
|
|
36
|
+
|
|
37
|
+
- id: cfbridge-skill
|
|
38
|
+
name: '@wenaixi/cfbridge/src/cfbridge-skill.js'
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# deprecated/preset/
|
|
2
|
+
|
|
3
|
+
> 归档原因:cfbridge 自 v0.3.0 起改用 DSH Bundle 形态分发,所有会话全局可见 Cloudflare 三工具与 Skill,无需再选择「Cloudflare 模式」。
|
|
4
|
+
> 旧文件保留是为了让仍在使用 v0.2.x 的用户能够 `git checkout v0.2.0` 直接回滚到旧形态。
|
|
5
|
+
|
|
6
|
+
## 包含的文件
|
|
7
|
+
|
|
8
|
+
- `preset.yml` — DSH Agent Preset 元数据(旧模式选择器显示用)。
|
|
9
|
+
- `agent.cordis.yml` — Agent Preset 的完整 cordis 组合(persona、工具、Skill、MCP)。
|
|
10
|
+
|
|
11
|
+
## 与 v0.3.0 的差异
|
|
12
|
+
|
|
13
|
+
| 维度 | v0.2.0(本目录) | v0.3.0 |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| 分发形态 | Agent Preset | DSH Bundle |
|
|
16
|
+
| 可见性 | 仅「Cloudflare 模式」会话 | 所有会话全局 |
|
|
17
|
+
| 安装位置 | `~/.dsh/.agent-presets/cfbridge/` | `~/.dsh/profiles/<name>/node_modules/@wenaixi/cfbridge/` |
|
|
18
|
+
| 加载入口 | `dsh-agent-presets` picker | `dsh.profile.bundles` 层 |
|
|
19
|
+
| Skill 发现 | preset 层 `skill-filesystem` | 软链到 `$DSH_HOME/skills/cfbridge/` |
|
|
20
|
+
| 启停方式 | 切换 preset | `dsh plugin add/remove` 或 disabled 覆写 |
|
|
21
|
+
|
|
22
|
+
## 回滚路径
|
|
23
|
+
|
|
24
|
+
需要临时回到旧形态:
|
|
25
|
+
|
|
26
|
+
1. 回到 git v0.2.0 标签:`git checkout v0.2.0`。
|
|
27
|
+
2. 按该版本的 README 操作:`npm install && npm run install:preset`。
|
|
28
|
+
3. 重启 DSH,在新会话选择器中选「Cloudflare 模式」。
|
|
29
|
+
|
|
30
|
+
> 不建议在 v0.3.0 之后继续维护本目录;如需保留更长时间,请开一个 issue 说明用例。
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# DEPRECATED since v0.3.0 — cfbridge 现在以 DSH Bundle (cordis.patch.yml) 形态分发。
|
|
2
|
+
# 本文件仅作为 v0.2.x 的历史快照保留;DSH 不会加载它。
|
|
3
|
+
# 详见 docs/plan-v0.3.0-global-bundle.md 与 README.md。
|
|
4
|
+
|
|
5
|
+
# cfbridge Agent Preset — Cloudflare 资源管理专用 Agent
|
|
6
|
+
#
|
|
7
|
+
# 这是一个 AGENT-PLANE 组合(Agent Preset),不是 host 组合。
|
|
8
|
+
# 它会被 mount 到选择「Cloudflare 模式」的那个 DSH 会话中。
|
|
9
|
+
#
|
|
10
|
+
# 设计目标:
|
|
11
|
+
# 1. 提供 Cloudflare Code Mode MCP(docs/search/execute 三工具)
|
|
12
|
+
# 2. 提供 Wrangler CLI 相关的本地工具(通过 npm 脚本)
|
|
13
|
+
# 3. 提供 Cloudflare 操作专属的 Skill
|
|
14
|
+
# 4. 在 cloudflare 任务的系统提示中追加专属指导
|
|
15
|
+
#
|
|
16
|
+
# 安全规则:
|
|
17
|
+
# - token 仅从 %USERPROFILE%\.dsh\.env 的 CLOUDFLARE_API_TOKEN 读取
|
|
18
|
+
# - 任何写操作(deploy/secret put/dns/kv/d1 execute)都必须先获得用户明确确认
|
|
19
|
+
#
|
|
20
|
+
# 部署位置:
|
|
21
|
+
# 安装后位于 %USERPROFILE%\.dsh\.agent-presets\cfbridge\
|
|
22
|
+
#
|
|
23
|
+
# 结构对齐:完全复用 standard preset 的框架,只在 persona 和 mcp-cloudflare
|
|
24
|
+
# 两处有差异;其它行保持一致以避免引入 isolate/服务注册的差异。
|
|
25
|
+
|
|
26
|
+
# ── 身份 / 人设 ────────────────────────────────────────────────────────
|
|
27
|
+
# 覆盖标准模式的 persona,注入 Cloudflare 场景专属定位。
|
|
28
|
+
- id: persona
|
|
29
|
+
name: '@deepseek-ai/dsh-persona'
|
|
30
|
+
config:
|
|
31
|
+
text: >-
|
|
32
|
+
You are a coding agent powered by the {{model}} model, working in {{cwd}}.
|
|
33
|
+
|
|
34
|
+
You have been equipped with the **Cloudflare 模式** (cfbridge v0.2.0). When the user
|
|
35
|
+
asks for Cloudflare work — Workers, KV, D1, R2, Pages, DNS, Zones, accounts,
|
|
36
|
+
analytics — treat the three MCP tools (`mcp__cloudflare__docs`,
|
|
37
|
+
`mcp__cloudflare__search`, `mcp__cloudflare__execute`) as the primary interface.
|
|
38
|
+
Fall back to the bundled Wrangler CLI only for workflows the MCP does not
|
|
39
|
+
cover (offline scaffolding, dev server, CI commands). Read the `cfbridge`
|
|
40
|
+
Skill before any mutating call, confirm the target account/zone, and never
|
|
41
|
+
run a write operation without explicit user approval.
|
|
42
|
+
|
|
43
|
+
- id: agent-instructions
|
|
44
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
45
|
+
config:
|
|
46
|
+
maxBytes: 65536
|
|
47
|
+
|
|
48
|
+
# ── shell ──────────────────────────────────────────────────────────────
|
|
49
|
+
# 与 standard preset 一致;`shell-env` 留在 host composition,tool-bash /
|
|
50
|
+
# tool-pwsh 只注册到 host tools registry,不发布 service,因此不需要 realm。
|
|
51
|
+
- id: tool-bash
|
|
52
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
53
|
+
disabled: !!js process.platform === 'win32'
|
|
54
|
+
|
|
55
|
+
- id: tool-pwsh
|
|
56
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
57
|
+
disabled: !!js process.platform !== 'win32'
|
|
58
|
+
|
|
59
|
+
# ── filesystem ──────────────────────────────────────────────────────────
|
|
60
|
+
- id: tool-fs
|
|
61
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
62
|
+
|
|
63
|
+
- id: tool-fs-search
|
|
64
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
65
|
+
config:
|
|
66
|
+
sampleOverCapGlobResults: false
|
|
67
|
+
|
|
68
|
+
# ── background jobs ─────────────────────────────────────────────────────
|
|
69
|
+
- id: tool-jobs
|
|
70
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
71
|
+
|
|
72
|
+
# ── skills ─────────────────────────────────────────────────────────────
|
|
73
|
+
# 与 standard preset 一致:skill 注册器在 host,但本 preset 在自己的层
|
|
74
|
+
# 注册 contribution,所以不需要 realm。
|
|
75
|
+
- id: skill-filesystem
|
|
76
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
77
|
+
|
|
78
|
+
- id: tool-skill
|
|
79
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
80
|
+
|
|
81
|
+
# ── goals ──────────────────────────────────────────────────────────────
|
|
82
|
+
- id: tool-goal
|
|
83
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
84
|
+
|
|
85
|
+
# ── Cloudflare MCP 客户端 ──────────────────────────────────────────────
|
|
86
|
+
# dsh-mcp-client 只把 mcp__cloudflare__* 工具注册到 host tools registry,
|
|
87
|
+
# 不发布 service;与 mcp-memory 示例一致,直接放在顶层即可。
|
|
88
|
+
- id: mcp-cloudflare
|
|
89
|
+
name: '@deepseek-ai/dsh-mcp-client'
|
|
90
|
+
config:
|
|
91
|
+
serverName: cloudflare
|
|
92
|
+
transport: streamable-http
|
|
93
|
+
url: https://mcp.cloudflare.com/mcp
|
|
94
|
+
headers:
|
|
95
|
+
Authorization: !!js '`Bearer ${process.env.CLOUDFLARE_API_TOKEN}`'
|
|
96
|
+
toolCallTimeoutMs: 120000
|
|
97
|
+
failOnStartupError: false
|
|
98
|
+
reconnect:
|
|
99
|
+
enabled: true
|
|
100
|
+
initialDelayMs: 500
|
|
101
|
+
maxDelayMs: 30000
|
|
102
|
+
maxAttempts: 10
|
|
103
|
+
|
|
104
|
+
# ── plan mode ──────────────────────────────────────────────────────────
|
|
105
|
+
# 与 standard preset 一致;plan 状态本来就是 per-agent。
|
|
106
|
+
- id: planning
|
|
107
|
+
name: cordis:group
|
|
108
|
+
group: true
|
|
109
|
+
isolate:
|
|
110
|
+
planMode: true
|
|
111
|
+
config:
|
|
112
|
+
- id: plan-mode
|
|
113
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
114
|
+
config:
|
|
115
|
+
section: |
|
|
116
|
+
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
117
|
+
|
|
118
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
119
|
+
|
|
120
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
121
|
+
|
|
122
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
|
|
123
|
+
|
|
124
|
+
Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
|
|
125
|
+
|
|
126
|
+
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# DEPRECATED since v0.3.0 — cfbridge 现在以 DSH Bundle 形态分发,
|
|
2
|
+
# 通过 `npm run install:bundle` 装到 web profile 后所有会话全局可见。
|
|
3
|
+
# 本文件仅作为 v0.2.x 的历史快照保留,DSH 不会再加载它。
|
|
4
|
+
# 详见 docs/plan-v0.3.0-global-bundle.md 与 README.md。
|
|
5
|
+
|
|
6
|
+
# cfbridge Agent Preset 元数据
|
|
7
|
+
# 显示在 DSH 模式选择器中
|
|
8
|
+
name: Cloudflare 模式 (DEPRECATED — v0.3.0+)
|
|
9
|
+
description: 集成 Cloudflare 官方 Code Mode MCP(docs/search/execute 三工具 ≈ 2500 API),附带 Wrangler CLI 封装和 Cloudflare 操作技能。专为按需管理 Cloudflare 资源设计。
|
|
10
|
+
order: 10
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wenaixi/cfbridge",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Cloudflare Code Mode MCP 全局 Bundle,安装后所有 DSH 会话自动获得 docs/search/execute 三工具与 cfbridge Skill,配合项目本地 Wrangler CLI 透传。",
|
|
5
|
+
"author": "Wenaixi <wenxiloveyou@gmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Wenaixi/dsh-cfbridge.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/Wenaixi/dsh-cfbridge#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Wenaixi/dsh-cfbridge/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"cloudflare",
|
|
18
|
+
"mcp",
|
|
19
|
+
"deepseek-harness",
|
|
20
|
+
"dsh",
|
|
21
|
+
"cordis",
|
|
22
|
+
"bundle",
|
|
23
|
+
"dsh-bundle",
|
|
24
|
+
"skill"
|
|
25
|
+
],
|
|
26
|
+
"main": "cordis.patch.yml",
|
|
27
|
+
"files": [
|
|
28
|
+
"cordis.patch.yml",
|
|
29
|
+
"src/",
|
|
30
|
+
"skills/",
|
|
31
|
+
"scripts/",
|
|
32
|
+
"README.md",
|
|
33
|
+
"LICENSE",
|
|
34
|
+
".env.example",
|
|
35
|
+
"deprecated/"
|
|
36
|
+
],
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"registry": "https://registry.npmjs.org/"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"check": "node scripts/check.js",
|
|
43
|
+
"install:bundle": "node scripts/install-bundle.js",
|
|
44
|
+
"uninstall:bundle": "node scripts/uninstall-bundle.js",
|
|
45
|
+
"validate:bundle": "node scripts/validate-bundle.js",
|
|
46
|
+
"migrate:from-preset": "node scripts/migrate-from-preset.js",
|
|
47
|
+
"dump:config": "node scripts/dump-config.js",
|
|
48
|
+
"test": "node scripts/test.js",
|
|
49
|
+
"test:bundle": "node scripts/validate-bundle.js",
|
|
50
|
+
"test:wrangler": "node scripts/test-wrangler.js",
|
|
51
|
+
"wrangler": "node scripts/wrangler.js",
|
|
52
|
+
"wrangler:version": "node scripts/wrangler.js --version",
|
|
53
|
+
"wrangler:whoami": "node scripts/wrangler.js whoami",
|
|
54
|
+
"wrangler:d1:list": "node scripts/wrangler.js d1 list --json",
|
|
55
|
+
"wrangler:workers:list": "node scripts/wrangler.js deployments list --name vmail --json",
|
|
56
|
+
"wrangler:pages:list": "node scripts/wrangler.js pages project list --json"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@deepseek-ai/dsh-mcp-client": "*",
|
|
60
|
+
"@deepseek-ai/dsh-skill-filesystem": "*",
|
|
61
|
+
"@deepseek-ai/dsh-tool-skill": "*"
|
|
62
|
+
},
|
|
63
|
+
"dsh": {
|
|
64
|
+
"bundle": {
|
|
65
|
+
"patch": "./cordis.patch.yml"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"wrangler": "^4.123.0"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=22"
|
|
73
|
+
}
|
|
74
|
+
}
|