@xia-sc/dsh-cc-studio 0.3.4 → 0.3.6

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.
@@ -0,0 +1,328 @@
1
+ # @xia-sc/dsh-cc-studio — 「CC 模式」预设声明层(dsh >= 0.1.7-alpha.1)
2
+ #
3
+ # 为什么单独一层:dsh 0.1.7-alpha.1 起,预设不再是「<DSH_HOME>/.agent-presets/<id>/ 目录」,
4
+ # 而是**组合里的一个声明行** —— 内置的 standard/ptc/minimal/cordis 就是这么发的(见
5
+ # @deepseek-ai/dsh-web-app 的 presets/*.patch.yml)。目录形态在 0.1.7 已经没有任何代码读取,
6
+ # 所以必须随包带一层补丁:插件装进哪个 profile,「CC 模式」就出现在哪个 profile 的 roster 里。
7
+ #
8
+ # package.json 的 dsh.bundle.patch 列两层:cordis.patch.yml(宿主插件行)+ 本文件(预设声明)。
9
+ #
10
+ # ⚠️ 本文件的 plugins 必须与 presets/cc/agent.cordis.yml **同名同序**:
11
+ # · 本文件(声明行) → dsh >= 0.1.7-alpha.1
12
+ # · agent.cordis.yml(目录形态,插件挂载时安装到 <DSH_HOME>/.agent-presets/cc)→ 更老的 dsh
13
+ # tests/preset-install.test.mjs 第 11/12 节把「两份清单不许漂移」钉死了:改一边必须改另一边。
14
+ # 两份清单的行逐字一致,只有上面那两处解释「健康检查」的历史注释按 0.1.7 的事实改写过。
15
+ #
16
+ # 想关掉 CC 模式(>=0.1.7):不必卸载插件,在自己 profile 的补丁层里按 id 关掉这一行即可 ——
17
+ # - id: preset-cc
18
+ # name: '@deepseek-ai/dsh-agent-preset'
19
+ # disabled: true
20
+ # profile 补丁 = <profile>/cordis.patch.yml;$DSH_HOME/cordis.patch.yml 对全部 profile 生效。
21
+ - insert:
22
+ - id: preset-cc
23
+ name: '@deepseek-ai/dsh-agent-preset'
24
+ config:
25
+ # 预设 id 是硬契约:lib/agent.js 只在 CC 预设下挂载,浏览器 lib/client.js 的
26
+ # CC_PRESET_ID 与宿主 isCcPreset() 都按 'cc' 精确比较,改名会让两边同时失联。
27
+ id: cc
28
+ name: CC 模式
29
+ description: CCv3 角色卡工坊 — LLM 通过 6 个 Tool 引导填表(cc_get_card / cc_patch_character / cc_patch_world / cc_add_lorebook_entries / cc_patch_greetings / cc_validate),胶囊实时同步,工坊全屏编辑,导出 chara_card_v3。
30
+ # 排序只在 roster 里可见:内置四个是 1..4,CC 模式排在它们后面。
31
+ order: 50
32
+ plugins:
33
+ # The `standard` agent preset: the full coding agent, mounted once per process.
34
+ #
35
+ # This file is an AGENT-PLANE composition. The roster mounts it ONCE under a
36
+ # standing scope; every session naming it joins by scope parentage, so the
37
+ # tools and prompt sections registered here cover each joined agent while a
38
+ # session's own state stays keyed per Session/Agent inside the plugins. The
39
+ # host composition (`base.cordis.yml` + `web.cordis.yml`) keeps everything a
40
+ # preset must not own: the registries themselves, the sandbox and approval
41
+ # stack, persistence, and the model route.
42
+ #
43
+ # A service row here MUST sit inside a group carrying an `isolate` realm.
44
+ # Without one it publishes into the root realm, where it is process-global —
45
+ # another preset publishing the same name collides, and a host reader would
46
+ # resolve one preset's instance for every session; `dsh-agent-presets` rejects
47
+ # that at mount. `true` means an entry-local realm: this standing mount's own
48
+ # private instance, apart from every other preset's. (A shared label does NOT
49
+ # pool instances — `provide()` throws on the second registration under the
50
+ # same realm symbol; labels join REALMS, and are not what this file needs.)
51
+
52
+ # ── identity ────────────────────────────────────────────────────────────────
53
+
54
+ # The preset's own persona, shadowing the deployment default for this agent.
55
+ # dsh >= 0.1.5-rc.1: the persona row takes `prefix` (required) + optional `suffix`
56
+ # — the old `text` key was replaced and now fails the config schema.
57
+ # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
58
+ - id: persona
59
+ name: '@deepseek-ai/dsh-persona'
60
+ config:
61
+ prefix: |
62
+ 你是 CC 角色卡工坊的专属引导员(CC 模式),模型 {{model}},工作目录 {{cwd}}。
63
+ 你的唯一任务是把用户的一句话点子变成可导入 SillyTavern / Risu 的完整 CCv3 卡(spec: chara_card_v3)。
64
+ 必须走完强制工作流,不可偷懒跳过 5 维世界观和世界书:
65
+ 1) cc_get_card — 先看草稿,告诉用户还缺什么
66
+ 2) cc_patch_character — 补 name/nickname/description/personality/scenario/tags(至少 description/personality/scenario 非空,tags 同步胶囊风格标签)
67
+ 3) cc_patch_world — 补五维 timeline/factions/geo/power/daily,至少填 3 项,autoLorebook=true 自动生成带 @@decorator 的基础条目
68
+ 4) cc_add_lorebook_entries — 再补到至少 5 条,覆盖年表/势力/地理/力量/日常各 1,至少 1 条 constant,content 头部写 @@position/@@depth/@@activate 等,支持 CBS 占位符(双花括号的 char / random / roll 形式)
69
+ 5) cc_patch_greetings — 补 first_mes、alternate_greetings(≥2)、group_only_greetings(≥1 必填)、mes_example
70
+ 6) cc_validate — 必须调且 valid=true 才算完成,否则按返回的 errors/warnings 继续补;通过后提醒用户在工坊点“导出 JSON”或“★ 保存到侧边栏”(落盘 ~/.dsh/cc-library)
71
+
72
+ 规则:每次对话只追问 1-2 个薄弱点,问完立刻调工具写入;用户说“随便/跳过”也要你合理推断补全,不能留空;严禁跳过 3/4 步直接做问候语;每调一次工具要简要总结“已写入 X,下一步 Y”,并让胶囊实时同步;结束前必须 cc_validate。
73
+
74
+ - id: agent-instructions
75
+ name: '@deepseek-ai/dsh-agent-instructions'
76
+ config:
77
+ maxBytes: 65536
78
+
79
+ # ── shell ───────────────────────────────────────────────────────────────────
80
+
81
+ # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
82
+ # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
83
+ # the criterion for host-plane ownership — injection resolves before any session
84
+ # exists, so there is no agent to key by. Behind a preset realm those variables
85
+ # never reached the model's shell at all. Both shell tools consume the host
86
+ # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
87
+ # host-plane too.
88
+ - id: tool-bash
89
+ name: '@deepseek-ai/dsh-tool-bash'
90
+ disabled: !!js process.platform === 'win32'
91
+
92
+ - id: tool-pwsh
93
+ name: '@deepseek-ai/dsh-tool-pwsh'
94
+ disabled: !!js process.platform !== 'win32'
95
+
96
+ # ── filesystem ──────────────────────────────────────────────────────────────
97
+
98
+ # Both register into the host `tools` registry and provide nothing, so
99
+ # they need no realm. The `fs` service and its policy stay in the host.
100
+ - id: tool-fs
101
+ name: '@deepseek-ai/dsh-tool-fs'
102
+
103
+ - id: tool-fs-search
104
+ name: '@deepseek-ai/dsh-tool-fs-search'
105
+ config:
106
+ sampleOverCapGlobResults: false
107
+
108
+ # ── background jobs ────────────────────────────────────────────────────────
109
+
110
+ # Only the model-facing controls. The task REGISTRY stays on the host plane:
111
+ # its producers sit outside any realm this file could put it in — `tool-bash`
112
+ # above resolves it with `ctx.get`, and an entry-local realm here is invisible
113
+ # to every sibling row, so `run_in_background` would answer "background jobs
114
+ # unavailable" while these controls sat in the catalog. The registry is keyed by
115
+ # owning agent anyway, so one host instance serves every session. What a preset
116
+ # chooses is whether its agent can collect and stop background work at all.
117
+ - id: tool-jobs
118
+ name: '@deepseek-ai/dsh-tool-jobs'
119
+
120
+ # ── skills ──────────────────────────────────────────────────────────────────
121
+
122
+ # The skill REGISTRY lives in the host composition and is layered per scope:
123
+ # these rows register into THIS preset's layer of it, so they need no realm.
124
+ # `skill-filesystem` contributes local-root discovery for agents on this preset, and
125
+ # `tool-skill` gives them the catalog and loader; the merged catalog also
126
+ # carries whatever the deployment registered globally (repository plugins).
127
+ - id: skill-filesystem
128
+ name: '@deepseek-ai/dsh-skill-filesystem'
129
+ disabled: true
130
+
131
+ - id: tool-skill
132
+ name: '@deepseek-ai/dsh-tool-skill'
133
+ disabled: true
134
+
135
+ # ── goals ───────────────────────────────────────────────────────────────────
136
+
137
+ # Only the model-facing tool. The goal SERVICE, its session driver, and the
138
+ # `/goal` command stay on the host plane: the Gateway serves the goal domain as
139
+ # Remote endpoints whose receiver comes from a generated descriptor, so it
140
+ # resolves `goals` on the host and an entry-local realm here would hide it. The
141
+ # registry is keyed by session anyway, so one host instance serves every
142
+ # session. What a preset chooses is whether its agent can call the goal tool.
143
+ - id: tool-goal
144
+ name: '@deepseek-ai/dsh-tool-goal'
145
+
146
+ # ── plan mode ───────────────────────────────────────────────────────────────
147
+
148
+ # Plan state is per-agent by nature, so an entry-local realm is not a
149
+ # workaround here — it is the correct lifetime.
150
+ - id: planning
151
+ name: cordis:group
152
+ group: true
153
+ isolate:
154
+ planMode: true
155
+ config:
156
+ - id: plan-mode
157
+ name: '@deepseek-ai/dsh-plan-mode'
158
+ config:
159
+ section: |
160
+ 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.
161
+
162
+ 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.
163
+
164
+ 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.
165
+
166
+ 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.
167
+
168
+ 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.
169
+
170
+ 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.
171
+
172
+ # ── compaction ──────────────────────────────────────────────────────────────
173
+
174
+ # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
175
+ # share this realm rather than sit outside it.
176
+ #
177
+ # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
178
+ # plane, and the rows here resolve that one instance. It takes no configuration,
179
+ # keys every fold by Session, and owns the context-meter projection units the
180
+ # browser reads for every session — behind a realm those units would come and go
181
+ # with whichever presets happen to be mounted. What a preset chooses is whether
182
+ # its agent compacts at all, which is `compaction-basic` below.
183
+ - id: compaction
184
+ name: cordis:group
185
+ group: true
186
+ isolate:
187
+ compaction: true
188
+ toolResultPruner: true
189
+ config:
190
+ - id: compaction-basic
191
+ name: '@deepseek-ai/dsh-compaction-basic'
192
+
193
+ - id: command-compact
194
+ name: '@deepseek-ai/dsh-command-compact'
195
+
196
+ - id: tool-result-pruner
197
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
198
+ config:
199
+ thresholdChars: 8192
200
+ headChars: 4096
201
+ tailChars: 1024
202
+
203
+ # ── delegation and workflows ────────────────────────────────────────────────
204
+
205
+ # The `subagents` registry and its spawn/fork backends live in the HOST
206
+ # composition: the registry is a process singleton whose cross-session queries
207
+ # the api-proxy serves to the browser, and a provider name may only be
208
+ # registered once. This preset contributes the delegation TOOLS, which resolve
209
+ # that host registry.
210
+ #
211
+ # `workflows` is different — nothing outside an agent reads it — so every row
212
+ # that reaches it shares one entry-local realm here, and a consumer left
213
+ # outside would resolve a host registry this preset does not populate.
214
+ #
215
+ # `tool-subagent-report` is host-plane for the same reason as the registry,
216
+ # not because a preset may not want it: it registers a CONTINUABLE SETUP on
217
+ # that singleton rather than a tool this agent calls, and the setup list is
218
+ # not scope-aware — one copy per mounted preset means every child gets
219
+ # `report` registered once per live session, which throws on the second.
220
+ - id: delegation
221
+ name: cordis:group
222
+ group: true
223
+ isolate:
224
+ workflowEngine: true
225
+ config:
226
+ - id: tool-subagent-control
227
+ name: '@deepseek-ai/dsh-tool-subagent-control'
228
+
229
+ - id: tool-subagent-list-agents
230
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
231
+
232
+ # 0.3.4 对齐 dsh 0.1.6-alpha.2 内置 standard:spawn 行此前漏抄 modelSelectionSettings。
233
+ # 该键在 dsh-tool-subagent 里是 `z.boolean().default(false)`,漏掉既不报错也不改 schema,
234
+ # 只是子代理的「指定模型」入口被静默关掉 —— 最难发现的那类漂移。
235
+ # fork 行故意不加:provider/model 必须等于父代理,继承的历史才能继续命中 KV cache。
236
+ - id: tool-subagent
237
+ name: '@deepseek-ai/dsh-tool-subagent'
238
+ config:
239
+ provider: spawn
240
+ toolName: subagent
241
+ modelSelectionSettings: true
242
+ backgroundMode: continuable
243
+
244
+ - id: tool-subagent-fork
245
+ name: '@deepseek-ai/dsh-tool-subagent'
246
+ config:
247
+ provider: fork
248
+ toolName: subagent_fork
249
+ backgroundMode: continuable
250
+
251
+ # Production dsh does not install these optional providers. Install the
252
+ # matching Bundle in this Profile and restart the Host, then copy this
253
+ # preset and remove `disabled` from the matching tool row. Host availability
254
+ # alone grants no tool.
255
+ - id: tool-subagent-codex
256
+ name: '@deepseek-ai/dsh-tool-subagent'
257
+ disabled: true
258
+ config:
259
+ provider: codex
260
+ toolName: subagent_codex
261
+ backgroundMode: one-shot
262
+ maxDepth: provider-managed
263
+
264
+ - id: tool-subagent-claude-code
265
+ name: '@deepseek-ai/dsh-tool-subagent'
266
+ disabled: true
267
+ config:
268
+ provider: claude-code
269
+ toolName: subagent_claude_code
270
+ backgroundMode: one-shot
271
+ maxDepth: provider-managed
272
+
273
+ # dsh 0.1.6-alpha.1: `dsh-workflow-worker-thread` is gone from the release;
274
+ # the workflow engine is now `dsh-workflow-ptc` (sandboxed Node PTC runtime,
275
+ # host row `ptc-runtime` → `dsh-ptc-runtime-node`).
276
+ # dsh 0.1.7-alpha.1: 包名取不到的行由 `dsh-agent-preset-registry` 的 mountPreset →
277
+ # auditRows 判死,落在 record.broken 上 —— roster 里仍看得到「CC 模式」,但带着
278
+ # 诊断且组不出会话。失败形态变了,结论没变:包名必须与内置 standard 逐行对得上。
279
+ - id: workflow-ptc
280
+ name: '@deepseek-ai/dsh-workflow-ptc'
281
+ config:
282
+ provider: spawn
283
+
284
+ - id: tool-workflow
285
+ name: '@deepseek-ai/dsh-tool-workflow'
286
+
287
+ - id: tool-ralph
288
+ name: '@deepseek-ai/dsh-tool-ralph'
289
+ config:
290
+ subagentProvider: spawn
291
+ maxRounds: 64
292
+
293
+ # ── remaining model-facing rows ─────────────────────────────────────────────
294
+
295
+ - id: tool-ask-user
296
+ name: '@deepseek-ai/dsh-tool-ask-user'
297
+
298
+ - id: tool-todo
299
+ name: '@deepseek-ai/dsh-tool-todo'
300
+ config:
301
+ allowParallelInProgress: true
302
+
303
+ # The `web` service and its search provider stay in the host composition; only
304
+ # the model-facing tool is per-session.
305
+ - id: tool-web
306
+ name: '@deepseek-ai/dsh-tool-web'
307
+ config:
308
+ fetch: false
309
+ searchTimeoutMs: 60000
310
+
311
+ # 0.3.4 补回:`present` 是 standard 一直有的行,本预设此前整行漏抄。
312
+ # 症状很隐蔽 —— CC 模式下模型没有「把成品登记为交付物」的工具,不报任何错,只是少了能力。
313
+ # 它和下面那行都必须与 dsh 内置 standard 逐行对得上(升级清单见 AGENTS.md §4)。
314
+ - id: present
315
+ name: '@deepseek-ai/dsh-tool-present'
316
+
317
+ # dsh 0.1.6-alpha.2 新增行:standard 里就是 disabled(默认关,需要的人自己放开)。
318
+ # 抄过来是为了让「本预设 vs 内置 standard」的行差以后只剩有意为之的那几处,
319
+ # 下次升级 diff 时不必再逐个判断「这行是新加的、还是我们漏抄了」。
320
+ # 保留 disabled 也安全:0.1.7 的注册表对 disabled 行既不 import 也不参与
321
+ # auditRows 行审计(dsh-agent-preset-registry lib/index.js:199)。
322
+ - id: tool-plugin-manager
323
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
324
+ disabled: true
325
+
326
+ # ── CC 角色卡工坊(CC 模式专用) ───────────────────────────────────
327
+ - id: cc-agent
328
+ name: '@xia-sc/dsh-cc-studio/agent'