dsh-cohub 0.13.11 → 0.13.12

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
@@ -1,6 +1,6 @@
1
1
  # dsh-cohub
2
2
 
3
- > 本文对应 **v0.13.11**;完整变更历史见 [CHANGELOG.md](./CHANGELOG.md)。
3
+ > 本文对应 **v0.13.12**;完整变更历史见 [CHANGELOG.md](./CHANGELOG.md)。
4
4
 
5
5
  DeepSeek Harness 版(对照 [OpenCode 版](../oh-my-opencode-cohub/)):中文智能体编排插件。
6
6
  把「纯调度模式 + 内置技能(代理编排体系 + co-cordis 组合创作 + 写作组)+ 多模型共识 + 运行期调度韧性」移植到 DSH 原生能力之上。
package/lib/index.js CHANGED
@@ -10432,26 +10432,7 @@ function readPackageVersion() {
10432
10432
  }
10433
10433
  }
10434
10434
  function installAgentPresets(logger) {
10435
- const r = installShippedPresets(SHIPPED_PRESETS_DIR, dshHomePath5(".agent-presets"), readPackageVersion(), logger);
10436
- try {
10437
- const patchPath = resolveProfilePatchPath(dshHomePath5());
10438
- if (patchPath === null) {
10439
- logger?.info?.("cohub: 无法判定活动 profile($DSH_PROFILE 未设置且 profiles 下不止一个),跳过 preset 声明写入");
10440
- } else {
10441
- const p = applyPresetPatchDeclarations(SHIPPED_PRESETS_DIR, patchPath, logger);
10442
- if (p.appended.length > 0) {
10443
- logger?.info?.(`cohub: 已向 ${patchPath} 追加 ${p.appended.length} 条 preset 声明(${p.appended.join(", ")})${p.backup ? `,原文件已备份为 ${p.backup}` : ""}`);
10444
- }
10445
- if (p.conflicts.length > 0) {
10446
- logger?.info?.(`cohub: ${p.conflicts.length} 条 preset 声明保留你的版本:${p.conflicts.join(", ")}`);
10447
- }
10448
- if (p.degraded !== undefined)
10449
- logger?.info?.(`cohub: preset 声明写入已跳过(${p.degraded})`);
10450
- }
10451
- } catch (error) {
10452
- logger?.warn?.("cohub: 写入 profile patch 的 preset 声明失败(不影响插件启动)", error);
10453
- }
10454
- return r;
10435
+ return installShippedPresets(SHIPPED_PRESETS_DIR, dshHomePath5(".agent-presets"), readPackageVersion(), logger);
10455
10436
  }
10456
10437
  function readVolatile(value) {
10457
10438
  const holder = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cohub",
3
- "version": "0.13.11",
3
+ "version": "0.13.12",
4
4
  "description": "DeepSeek Harness 版 CoHub:中文智能体编排——用户可选 2 种工作模式(co-orchestrator 纯调度 / cohub-cordis 创造模式)+ 13 个专职代理技能 + 多模型共识;另由 cohub-subagent-readonly / cohub-subagent-write 两个支撑 preset 实现子代理读写硬隔离(共 4 个 preset)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -1,179 +1,17 @@
1
- # cohub 子代理 preset 的 **profile patch 声明片段**(供 profile 的 cordis.patch.yml 使用)
1
+ # ⚠️ 已废弃(deprecated)——本文件不再被任何代码读取,仅作为迁移说明保留。
2
2
  #
3
- # 为什么需要这个文件:新版宿主(0.2.1-rc.5 实测)对 profile 里的 agent preset 采用
4
- # `@deepseek-ai/dsh-agent-preset` **声明行**注册,而不是扫描 ~/.dsh/.agent-presets/ 目录。
5
- # 因此只把 presets/<id>/ 复制进用户目录不够 —— 还必须在 profile 的 cordis.patch.yml
6
- # 里以 `- insert: { id: preset-<id>, ... }` 的形式声明,否则 delegate 传
7
- # agentPreset: '<id>' 时 presets.mount 找不到,cohub 会 fail-soft 降级为继承父 preset。
3
+ # 历史:0.13.6 之前,cohub 生成 profile patch 声明(`- insert: { id: preset-<id>, name:
4
+ # '@deepseek-ai/dsh-agent-preset', ... }`)追加到 profile 的 cordis.patch.yml,靠宿主启动时
5
+ # 加载声明来注册 agent preset。本文件是那段声明的模板/片段留存。
8
6
  #
9
- # 用法:把下面的 `- insert:` 段原样追加到目标 profile 的 cordis.patch.yml 顶层
10
- # (与既有的 preset-co-orchestrator / preset-cohub-cordis /
11
- # preset-cohub-subagent-readonly / preset-cohub-subagent-write 同级)。
12
- # 本文件本身不被 installShippedPresets 安装(它只复制 presets/ 下的**目录**)。
7
+ # 现在(0.13.6 起 → 0.13.12 彻底停用):preset 的唯一正源是**运行时注册**
8
+ # `ctx.agentPresets.register()`(见 packages/dsh-cohub/src/index.ts 的 ②c / ②d)。
9
+ # 声明写入已从 installAgentPresets() 中移除,原因:
10
+ # · profile patch 声明先于插件 apply 被宿主加载 → 旧的 preset id/内容胜出;
11
+ # · 运行时注册随后覆盖不掉已由声明挂载的 preset,实例里一度残留 6 条旧名声明。
13
12
  #
14
- # 源文件(plugins 段与之一一对应,改一处必须同时改另一处):
15
- # packages/dsh-cohub/presets/cohub-subagent-readonly-net/agent.cordis.yml
16
- # packages/dsh-cohub/presets/cohub-subagent-write-shell/agent.cordis.yml
17
- # 与既有两条声明的差异仅在 tool-web 的 fetch 开关,其余工具行逐行照抄。
18
- - insert:
19
- - id: preset-cohub-subagent-readonly-net
20
- name: '@deepseek-ai/dsh-agent-preset'
21
- config:
22
- id: cohub-subagent-readonly-net
23
- name: "CoHub 子代理·只读+联网(cohub-subagent-readonly-net)"
24
- description: "cohub 编排体系的联网只读子代理专用 preset:co-librarian / co-observer
25
- / co-planner / co-council 使用;在 readonly 基础上接通外网抓取(web 检索类工具可用),
26
- 仍无写盘、无 Shell、无委派类工具。"
27
- order: 12
28
- plugins:
29
- # ── 身份(精简:子代理不需要调度纪律,技能指令已由任务书 brief 注入)──
30
- - id: persona
31
- name: '@deepseek-ai/dsh-persona'
32
- config:
33
- # 字段名必须是 prefix(required)/ suffix;旧版 text 字段会让整行挂载失败。
34
- prefix: |-
35
- 你是 cohub 编排体系的专职子代理——只负责完成当前这一件具体任务。
36
- 不要试图调度、委派或拆分给其他代理;你的技能指令已由任务书注入,不要调用 skill 工具加载 co-orchestrator。
37
- 事实与证据优先:结论前置,证据用 path:line 形式。
38
-
39
- # ── 技能 ────────────────────────────────────────────────────────────
40
- - id: tool-skill
41
- name: '@deepseek-ai/dsh-tool-skill'
42
-
43
- # ── 任务面板 ────────────────────────────────────────────────────────
44
- - id: tool-todo
45
- name: '@deepseek-ai/dsh-tool-todo'
46
- config:
47
- allowParallelInProgress: true
48
-
49
- # ── 文件(只读)/ 搜索 / 外网(联网)────────────────────────────────
50
- # write / edit 显式关掉 —— 与 readonly 版一致,只读保证的硬边界。
51
- - id: tool-fs
52
- name: '@deepseek-ai/dsh-tool-fs'
53
- config:
54
- write: false
55
- edit: false
56
-
57
- - id: tool-fs-search
58
- name: '@deepseek-ai/dsh-tool-fs-search'
59
- config:
60
- sampleOverCapGlobResults: false
61
-
62
- # ★ 与 readonly 的唯一差异:fetch 打开(readonly 为 false)。
63
- - id: tool-web
64
- name: '@deepseek-ai/dsh-tool-web'
65
- config:
66
- fetch: true
67
-
68
- - id: skill-filesystem
69
- name: '@deepseek-ai/dsh-skill-filesystem'
70
-
71
- # 不挂:delegation / delegation-subagents / tool-subagent* / tool-workflow /
72
- # tool-goal / tool-ask-user / tool-jobs / tool-cordis / mcp-github。
73
- # 不挂 shell:联网代理不需要执行命令(真正的只读保证)。
74
-
75
- # ── 上下文压缩(参数照 co-orchestrator 现有值)─────────────────────
76
- - id: compaction
77
- name: cordis:group
78
- group: true
79
- isolate:
80
- compaction: true
81
- toolResultPruner: true
82
- config:
83
- - id: compaction-basic
84
- name: '@deepseek-ai/dsh-compaction-basic'
85
- config:
86
- thresholdRatio: 0.5
87
-
88
- - id: command-compact
89
- name: '@deepseek-ai/dsh-command-compact'
90
-
91
- - id: tool-result-pruner
92
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
93
- config:
94
- thresholdChars: 8192
95
- headChars: 4096
96
- tailChars: 1024
97
-
98
- - insert:
99
- - id: preset-cohub-subagent-write-shell
100
- name: '@deepseek-ai/dsh-agent-preset'
101
- config:
102
- id: cohub-subagent-write-shell
103
- name: "CoHub 子代理·读写+Shell(cohub-subagent-write-shell)"
104
- description: "cohub 编排体系的全能实施类子代理专用 preset:co-fixer / co-designer
105
- / co-cordis 使用;文件读写 + Shell + 外网抓取,但不含任何委派类工具。"
106
- order: 13
107
- plugins:
108
- # ── 身份(精简)─────────────────────────────────────────────────────
109
- - id: persona
110
- name: '@deepseek-ai/dsh-persona'
111
- config:
112
- # 字段名必须是 prefix(required)/ suffix;旧版 text 字段会让整行挂载失败。
113
- prefix: |-
114
- 你是 cohub 编排体系的专职子代理——只负责完成当前这一件具体任务。
115
- 不要试图调度、委派或拆分给其他代理;你的技能指令已由任务书注入,不要调用 skill 工具加载 co-orchestrator。
116
- 事实与证据优先:结论前置,证据用 path:line 形式。
117
-
118
- # ── 技能 ────────────────────────────────────────────────────────────
119
- - id: tool-skill
120
- name: '@deepseek-ai/dsh-tool-skill'
121
-
122
- # ── 任务面板 ────────────────────────────────────────────────────────
123
- - id: tool-todo
124
- name: '@deepseek-ai/dsh-tool-todo'
125
- config:
126
- allowParallelInProgress: true
127
-
128
- # ── 文件(读写)/ 搜索 / 外网(联网)────────────────────────────────
129
- - id: tool-fs
130
- name: '@deepseek-ai/dsh-tool-fs'
131
-
132
- - id: tool-fs-search
133
- name: '@deepseek-ai/dsh-tool-fs-search'
134
- config:
135
- sampleOverCapGlobResults: false
136
-
137
- # ★ 相对 cohub-subagent-write 的唯一差异:fetch 打开(write 为 false)。
138
- - id: tool-web
139
- name: '@deepseek-ai/dsh-tool-web'
140
- config:
141
- fetch: true
142
-
143
- - id: skill-filesystem
144
- name: '@deepseek-ai/dsh-skill-filesystem'
145
-
146
- # ── Shell(平台互斥,写法照 co-orchestrator)────────────────────────
147
- - id: tool-bash
148
- name: '@deepseek-ai/dsh-tool-bash'
149
- disabled: !!js process.platform === 'win32'
150
-
151
- - id: tool-pwsh
152
- name: '@deepseek-ai/dsh-tool-pwsh'
153
- disabled: !!js process.platform !== 'win32'
154
-
155
- # 不挂(见文件头):delegation / delegation-subagents / tool-subagent* /
156
- # tool-workflow / tool-goal / tool-ask-user / tool-jobs / tool-cordis / mcp-github。
157
-
158
- # ── 上下文压缩(参数照 co-orchestrator 现有值)─────────────────────
159
- - id: compaction
160
- name: cordis:group
161
- group: true
162
- isolate:
163
- compaction: true
164
- toolResultPruner: true
165
- config:
166
- - id: compaction-basic
167
- name: '@deepseek-ai/dsh-compaction-basic'
168
- config:
169
- thresholdRatio: 0.5
170
-
171
- - id: command-compact
172
- name: '@deepseek-ai/dsh-command-compact'
173
-
174
- - id: tool-result-pruner
175
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
176
- config:
177
- thresholdChars: 8192
178
- headChars: 4096
179
- tailChars: 1024
13
+ # 迁移:若某个 profile 的 cordis.patch.yml 里仍残留 `- insert:` 的
14
+ # `@deepseek-ai/dsh-agent-preset` 声明块,请直接删除这些块(保留
15
+ # `@deepseek-ai/dsh-agent-preset-registry` 那一行,它是 registry 配置而非 preset 声明)。
16
+ # 声明写入的实现(applyPresetPatchDeclarations / buildPresetPatchDeclarations)仍保留在
17
+ # packages/dsh-cohub/src/preset-install.ts 中,供外部脚本显式调用,插件启动路径不再触发。