dsh-agent-team-playbook 1.35.0 → 1.35.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@
4
4
 
5
5
  ## 插件包
6
6
 
7
+ ### 1.35.1
8
+
9
+ - 修 dsh-go 插件:所有按钮**点了没反应** —— 桥接把 `command` 校验成「命令名 + 独立参数」
10
+ (`name` 必须匹配 `^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$`),我们写成了整串 `'atp install'`,
11
+ 效果被静默丢弃。改为 `{ command: { name: 'atp', args: 'install' } }`
12
+ - 新增 `scripts/check-dshgo.mjs`(`npm run check:dshgo`):调用桥接自己的校验器,
13
+ 跑遍每个 handler 与面板按钮,任何 violation 即失败——防止再次出现"点了没反应"
14
+
7
15
  ### 1.35.0
8
16
 
9
17
  - 新增 `dsh-go/`:给 **dsh-go 手机 App 原生界面**的插件(App 插件桥,不是 Cordis bundle)
@@ -58,19 +58,19 @@ export function apply(ctx) {
58
58
  actions: {
59
59
  // 执行斜杠命令:在当前对话里跑 /atp 的安装流程,冲突时会列出清单
60
60
  install: (scope, event) => ({
61
- command: 'atp install',
61
+ command: { name: 'atp', args: 'install' },
62
62
  toast: zh(event) ? '已发起安装,冲突会在对话里列出' : 'Install started; conflicts will be listed',
63
63
  }),
64
64
  force: (scope, event) => ({
65
- command: 'atp install force',
65
+ command: { name: 'atp', args: 'install force' },
66
66
  toast: zh(event) ? '已发起覆盖式安装(原件会暂存,可回滚)' : 'Overwrite install started (originals are stashed)',
67
67
  }),
68
68
  core: (scope, event) => ({
69
- command: 'atp core',
69
+ command: { name: 'atp', args: 'core' },
70
70
  toast: zh(event) ? '已输出核心全文' : 'Core text printed',
71
71
  }),
72
72
  paths: (scope, event) => ({
73
- command: 'atp paths',
73
+ command: { name: 'atp', args: 'paths' },
74
74
  toast: zh(event) ? '已列出分册路径' : 'Volume paths listed',
75
75
  }),
76
76
  copy: (scope, event) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agent-team-playbook",
3
- "version": "1.35.0",
3
+ "version": "1.35.1",
4
4
  "description": "DeepSeek Harness plugin that brings an executable multi-agent collaboration workflow (charter, triage tiers, six-stage pipeline, audit gates, experience library): a read-only /agent-team command plus a collision-aware installer for the documents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -57,7 +57,8 @@
57
57
  "smoke": "node scripts/smoke-install.mjs",
58
58
  "smoke:pack": "node scripts/smoke-install.mjs --pack",
59
59
  "prepack": "node scripts/sync-playbook.mjs",
60
- "prepublishOnly": "node scripts/smoke-install.mjs --pack"
60
+ "prepublishOnly": "node scripts/smoke-install.mjs --pack",
61
+ "check:dshgo": "node scripts/check-dshgo.mjs"
61
62
  },
62
63
  "exports": {
63
64
  ".": "./lib/index.js",
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * 校验 dsh-go 原生插件的「效果」是否合法。
4
+ *
5
+ * 为什么需要:App 的桥接层会丢弃不合法的效果,**表现是"点了没反应"**,没有任何提示。
6
+ * 我们踩过:`{ command: 'atp install' }` 因为命令名含空格被拒(桥接要求
7
+ * name 匹配 ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$,参数走独立的 args)。
8
+ *
9
+ * 这个脚本调用**桥接自己的校验器**(/opt/dsh-go/dsh-go-bridge/lib/native/effects.js),
10
+ * 把插件注册的每个 handler / 面板按钮都跑一遍,任何 violation 都算失败。
11
+ *
12
+ * 不在手机上(没有 /opt/dsh-go)时跳过,退出码 0。
13
+ */
14
+ import { existsSync } from 'node:fs'
15
+ import path from 'node:path'
16
+ import { fileURLToPath, pathToFileURL } from 'node:url'
17
+
18
+ const BRIDGE = '/opt/dsh-go/dsh-go-bridge/lib/native/effects.js'
19
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
20
+ const PLUGIN = path.join(ROOT, 'dsh-go', 'local-atp')
21
+
22
+ if (!existsSync(BRIDGE)) {
23
+ console.log('跳过:找不到 dsh-go 桥接(不在手机主机上)')
24
+ process.exit(0)
25
+ }
26
+
27
+ const { normalize } = await import(pathToFileURL(BRIDGE).href)
28
+ const mod = await import(pathToFileURL(path.join(PLUGIN, 'lib/index.js')).href)
29
+
30
+ const handlers = new Map()
31
+ const panels = new Map()
32
+ mod.apply({
33
+ inject: (_services, cb) =>
34
+ cb({ dshGo: { on: (id, fn) => handlers.set(id, fn), panel: (id, def) => panels.set(id, def) } }),
35
+ })
36
+
37
+ const opts = { panels: new Set(panels.keys()) }
38
+ const results = []
39
+ const check = (label, result, extra = {}) => {
40
+ const out = normalize(result, { ...opts, ...extra })
41
+ const violations = (out.issues ?? []).filter((i) => i.violation)
42
+ results.push({ label, ok: violations.length === 0, detail: violations.map((v) => v.message).join('; ') || JSON.stringify(out.effects) })
43
+ }
44
+
45
+ for (const [id, fn] of handlers) check(`handler ${id}`, fn({}, { id, locale: 'zh-CN' }))
46
+ for (const [panelId, def] of panels) {
47
+ for (const [actionId, fn] of Object.entries(def.actions ?? {})) {
48
+ check(`panel ${panelId} · ${actionId}`, fn({}, { surface: 'panel', id: actionId, locale: 'zh-CN' }), { source: panelId })
49
+ }
50
+ }
51
+
52
+ const failed = results.filter((r) => !r.ok)
53
+ for (const r of results) console.log(`${r.ok ? '✓' : '✗'} ${r.label}${r.ok ? '' : ` — ${r.detail}`}`)
54
+ console.log(`\n通过 ${results.length - failed.length} / ${results.length}`)
55
+ if (failed.length > 0) {
56
+ console.log('\n有关键效果被桥接拒绝——App 里会表现为"点了没反应"。')
57
+ process.exit(1)
58
+ }