@wenaixi/cfbridge 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -3,13 +3,29 @@
3
3
  > Cloudflare 官方 Code Mode MCP 在 DeepSeek Harness(DSH)中的**全局 Bundle 桥接**。
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@wenaixi/cfbridge?color=cb3837)](https://www.npmjs.com/package/@wenaixi/cfbridge)
6
- [![版本](https://img.shields.io/badge/version-0.1.0-2563eb)](#版本与维护)
6
+ [![CI](https://github.com/Wenaixi/dsh-cfbridge/actions/workflows/ci.yml/badge.svg)](https://github.com/Wenaixi/dsh-cfbridge/actions/workflows/ci.yml)
7
+ [![版本](https://img.shields.io/badge/version-0.1.2-2563eb)](#版本与维护)
7
8
  [![许可](https://img.shields.io/badge/license-MIT-16a34a)](./LICENSE)
8
9
 
9
- cfbridge 是一个 **DSH Bundle(组合包)**,通过 `dsh plugin --profile <name> add` 安装到任意 DSH profile 后,**所有会话全局可见** Cloudflare 官方 Code Mode MCP 三工具(docs / search / execute)与配套 Skill,配合项目本地 Wrangler CLI 透传。
10
+ cfbridge 是一个 **DSH Bundle(组合包)**,通过 `dsh plugin --profile web add` 装到 **web** profile 后,**所有会话全局可见** Cloudflare 官方 Code Mode MCP 三工具(docs / search / execute)与配套 Skill,配合项目本地 Wrangler CLI 透传。走 `dsh.bundle` 原生分发,无需 `prepare` 构建。
10
11
 
11
12
  > 仓库:**[Wenaixi/dsh-cfbridge](https://github.com/Wenaixi/dsh-cfbridge)** · npm 包:**[@wenaixi/cfbridge](https://www.npmjs.com/package/@wenaixi/cfbridge)**
12
13
 
14
+ ## 一键安装(装到 web)
15
+
16
+ ```powershell
17
+ # 方式 A — npm(推荐)
18
+ dsh plugin --profile web add @wenaixi/cfbridge
19
+
20
+ # 方式 B — GitHub 直装(免构建)
21
+ dsh plugin --profile web add github:Wenaixi/dsh-cfbridge#v0.1.2
22
+
23
+ # 验证
24
+ dsh --profile web --dump-config | Select-String "cfbridge"
25
+ ```
26
+
27
+ 装完重启 `dsh --profile web`,任意新会话即可看到 `mcp__cloudflare__*` 与 `cfbridge` Skill。其他 profile 把 `web` 换成对应名字即可。
28
+
13
29
  ## 它是什么
14
30
 
15
31
  ```text
@@ -63,7 +79,7 @@ dsh plugin --profile web add @wenaixi/cfbridge
63
79
  ```powershell
64
80
  dsh plugin --profile web add github:Wenaixi/dsh-cfbridge
65
81
  # 锁定版本更稳妥:
66
- dsh plugin --profile web add github:Wenaixi/dsh-cfbridge#v0.1.0
82
+ dsh plugin --profile web add github:Wenaixi/dsh-cfbridge#v0.1.2
67
83
  ```
68
84
 
69
85
  > 直装前提:仓库含 `dsh.bundle` 声明且无 TypeScript 编译步骤(本仓库满足 —— 纯 JS + YAML + Markdown,GitHub 拉到的就是可运行形态,无需 `prepare`/`allowBuilds`)。
@@ -120,7 +136,7 @@ npm run dump:config
120
136
  dsh plugin --profile web add @wenaixi/cfbridge
121
137
 
122
138
  # 启用(GitHub 直装)
123
- dsh plugin --profile web add github:Wenaixi/dsh-cfbridge#v0.1.0
139
+ dsh plugin --profile web add github:Wenaixi/dsh-cfbridge#v0.1.2
124
140
 
125
141
  # 停用
126
142
  dsh plugin --profile web remove @wenaixi/cfbridge
@@ -177,8 +193,8 @@ dsh plugin --profile web remove @wenaixi/cfbridge
177
193
 
178
194
  ## 版本与维护
179
195
 
180
- - 当前版本:**v0.1.0**(首个公开发布;Bundle 形态,运行时 Skill,全局可见)。
196
+ - 当前版本:**v0.1.2**(首个公开发布;Bundle 形态,运行时 Skill,全局可见)。
181
197
  - 作者:**Wenaixi**
182
198
  - 许可证:MIT
183
199
  - 决策与历史记录见 [`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)
200
+ - 相关链接:[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 CHANGED
@@ -1,4 +1,4 @@
1
- # @wenaixi/cfbridge — DSH Bundle Patch (host composition, v0.1.0)
1
+ # @wenaixi/cfbridge — DSH Bundle Patch (host composition, v0.1.2)
2
2
  #
3
3
  # 安装后作为 web profile 的一个 bundle 层全局生效;所有会话均自动看到
4
4
  # Cloudflare Code Mode MCP 三工具(docs / search / execute)与 cfbridge Skill。
@@ -35,4 +35,4 @@
35
35
  maxAttempts: 10
36
36
 
37
37
  - id: cfbridge-skill
38
- name: '@wenaixi/cfbridge/src/cfbridge-skill.js'
38
+ name: '@wenaixi/cfbridge/src/cfbridge-skill.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenaixi/cfbridge",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Cloudflare Code Mode MCP 全局 Bundle,安装后所有 DSH 会话自动获得 docs/search/execute 三工具与 cfbridge Skill,配合项目本地 Wrangler CLI 透传。",
5
5
  "author": "Wenaixi <wenxiloveyou@gmail.com>",
6
6
  "license": "MIT",
@@ -71,4 +71,4 @@
71
71
  "engines": {
72
72
  "node": ">=22"
73
73
  }
74
- }
74
+ }
package/scripts/check.js CHANGED
@@ -42,7 +42,7 @@ function hasTokenLeak(text) {
42
42
  const pkg = readJson(path.join(ROOT, 'package.json'))
43
43
  if (pkg) {
44
44
  check('package name is @wenaixi/cfbridge', pkg.name === '@wenaixi/cfbridge', `got: ${pkg.name}`)
45
- check('package version is 0.1.0', pkg.version === '0.1.0', `got: ${pkg.version}`)
45
+ check('package version is 0.1.2', pkg.version === '0.1.2', `got: ${pkg.version}`)
46
46
  check('package is not private', pkg.private !== true, pkg.private ? 'package.json must not be private for npm publish' : '')
47
47
  check('package publishConfig.access is public', pkg.publishConfig?.access === 'public', `got: ${pkg.publishConfig?.access}`)
48
48
  check('package repository points to Wenaixi/dsh-cfbridge', /github\.com\/Wenaixi\/dsh-cfbridge(\.git)?$/i.test(pkg.repository?.url || ''), `got: ${pkg.repository?.url}`)
@@ -252,4 +252,4 @@ for (const c of checks) {
252
252
  else console.log(`FAIL ${c.name}${c.detail ? ` — ${c.detail}` : ''}`)
253
253
  }
254
254
  console.log(`\n${pass === checks.length ? 'PASS' : 'FAIL'}: ${pass}/${checks.length} checks`)
255
- process.exit(pass === checks.length ? 0 : 1)
255
+ process.exit(pass === checks.length ? 0 : 1)
@@ -57,8 +57,8 @@ function main() {
57
57
 
58
58
  if (pkg.name === '@wenaixi/cfbridge') pass('package name is @wenaixi/cfbridge')
59
59
  else fail('package name is @wenaixi/cfbridge', pkg.name)
60
- if (pkg.version === '0.1.0') pass('package version is 0.1.0')
61
- else fail('package version is 0.1.0', pkg.version)
60
+ if (pkg.version === '0.1.2') pass('package version is 0.1.2')
61
+ else fail('package version is 0.1.2', pkg.version)
62
62
  if (pkg.private !== true) pass('package is not private (npm publishable)')
63
63
  else fail('package is not private (npm publishable)', 'private must be absent/false')
64
64
  if (pkg.publishConfig && pkg.publishConfig.access === 'public') pass('publishConfig.access is public')
@@ -229,4 +229,4 @@ try {
229
229
  } catch (e) {
230
230
  console.error(`[ERR ] ${e.stack || e.message}`)
231
231
  process.exit(1)
232
- }
232
+ }
@@ -3,6 +3,8 @@
3
3
  // 作为 host 组合的一行,随 bundle 安装后所有会话自动可见。
4
4
  // 形态遵循 dsh-vision-toolkit 实践:inject: ['skills'] + ctx.skills.register()。
5
5
  // 资源基座指向 bundle 内的 skills/cfbridge/ 目录,内容为 SKILL.md 全文。
6
+ // 读取放在 apply 内,以贴合 Fiber 生命周期语义:失败走 Fiber FAILED 响亮失败,
7
+ // 且更易被 HMR 热替捕获(与模块作用域副作用区分)。
6
8
 
7
9
  const fs = require('fs')
8
10
  const path = require('path')
@@ -12,35 +14,31 @@ const path = require('path')
12
14
  const SKILL_DIR = path.resolve(__dirname, '..', 'skills', 'cfbridge')
13
15
  const SKILL_MD = path.join(SKILL_DIR, 'SKILL.md')
14
16
 
15
- let SKILL_CONTENT = ''
16
- try {
17
- SKILL_CONTENT = fs.readFileSync(SKILL_MD, 'utf8')
18
- } catch (e) {
19
- // 缺少 SKILL.md 时让 apply 抛异常,触发 loader 的响亮失败
20
- throw new Error(`cfbridge-skill: cannot read SKILL.md at ${SKILL_MD}: ${e.message}`)
21
- }
22
-
23
- // 从首段提取 description,避免与文件内容重复维护。
24
- // SKILL.md 首行是标题,第三段是全局可见声明,取其精简版作 catalog 描述。
25
- const SKILL_DEFINITION = {
26
- name: 'cfbridge',
27
- description:
28
- 'Cloudflare Code Mode MCP 全局 Bridge:装后所有会话自动获得 mcp__cloudflare__docs/search/execute 三工具与本操作指南;含 search-then-execute 工作流、写操作审批规范、Token 权限边界与 Wrangler 透传指引。',
29
- whenToUse:
30
- '任何涉及 Cloudflare API 的请求(Workers/KV/D1/Pages/Zones/DNS/R2/Analytics 等)都应先加载本 Skill;执行前用 mcp__cloudflare__docs 或 mcp__cloudflare__search 确认端点,再用 mcp__cloudflare__execute 执行。',
31
- source: 'runtime',
32
- resourceBase: {
33
- kind: 'directory',
34
- path: SKILL_DIR,
35
- },
36
- content: SKILL_CONTENT,
37
- }
38
-
39
17
  const name = 'cfbridge-skill'
40
18
  const inject = ['skills']
41
19
 
42
20
  function apply(ctx) {
43
- ctx.skills.register(SKILL_DEFINITION)
21
+ let content
22
+ try {
23
+ content = fs.readFileSync(SKILL_MD, 'utf8')
24
+ } catch (e) {
25
+ // 缺少 SKILL.md 时让 apply 抛异常,触发 Fiber 响亮失败(进程终止/重载报错)
26
+ throw new Error(`cfbridge-skill: cannot read SKILL.md at ${SKILL_MD}: ${e.message}`)
27
+ }
28
+
29
+ ctx.skills.register({
30
+ name: 'cfbridge',
31
+ description:
32
+ 'Cloudflare Code Mode MCP 全局 Bridge:装后所有会话自动获得 mcp__cloudflare__docs/search/execute 三工具与本操作指南;含 search-then-execute 工作流、写操作审批规范、Token 权限边界与 Wrangler 透传指引。',
33
+ whenToUse:
34
+ '任何涉及 Cloudflare API 的请求(Workers/KV/D1/Pages/Zones/DNS/R2/Analytics 等)都应先加载本 Skill;执行前用 mcp__cloudflare__docs 或 mcp__cloudflare__search 确认端点,再用 mcp__cloudflare__execute 执行。',
35
+ source: 'runtime',
36
+ resourceBase: {
37
+ kind: 'directory',
38
+ path: SKILL_DIR,
39
+ },
40
+ content,
41
+ })
44
42
  }
45
43
 
46
44
  module.exports = { name, inject, apply }