@tbox.cn/tboxcode-dsh-presets 0.1.0-rc.1 → 0.1.0-rc.15

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,16 @@
1
+ import { Context } from "@deepseek-ai/cordis";
2
+
3
+ //#region src/headless-preset.d.ts
4
+
5
+ declare module '@deepseek-ai/dsh-session' {
6
+ interface PluginRecordMap {
7
+ 'plugin:tboxcode/agent-preset': {
8
+ agentPreset: string;
9
+ };
10
+ }
11
+ }
12
+ declare const name = "tboxcode-headless-preset";
13
+ declare const inject: readonly ["agentPresets"];
14
+ declare function apply(ctx: Context): void;
15
+ //#endregion
16
+ export { apply, inject, name };
@@ -0,0 +1 @@
1
+ import{appendPluginRecord as e,pluginRecordOf as t}from"@deepseek-ai/dsh-session";async function n(e,t){let n=t.defaultId;if((await t.list()).some(e=>e.id===n&&e.broken===void 0))return n;let r=t.config.default;return n!==r&&e.logger.warn(`[tboxcode-preset] selectedDefault="${n}" 不在当前 profile roster,回退 ${r}`),r}const r=`tboxcode-headless-preset`,i=[`agentPresets`],a=`plugin:tboxcode/agent-preset`;function o(e){let n;for(let r=0;r<e.seq;r++){let i=e.eventAt(r);if(i?.type!==a)continue;let o=t(i);if(o===void 0)continue;let s=o.data;typeof s?.agentPreset==`string`&&s.agentPreset.length>0&&(n=s.agentPreset)}return n}function s(e){for(let t=0;t<e.seq;t++)if(e.eventAt(t)?.type===`turn/start`)return!0;return!1}function c(t,n,r,i){if(o(r)!==i)try{e(r,a,{agentPreset:i})}catch(e){t.logger.warn(`[tboxcode-preset] headless ${n}: preset 标记写入失败(不影响本次运行):${e instanceof Error?e.message:String(e)}`)}}function l(e){let t=e.get(`agentPresets`);if(t===void 0)return;let r=Date.now(),i=e.on;i(`agent/created`,async i=>{if(e.get(`headlessStartup`)===void 0)return;let a=i.agent,l=a.session.header;if(l.origin===`subagent`||l.parentSession!==void 0||l.isSeeded===!0||t.composedPreset?.(a.ctx)!==void 0)return;let u=o(a.session),d=l.createdAt!==void 0&&l.createdAt<r,f=l.agentPreset??u??(s(a.session)||d?`standard`:await n(e,t));await t.mount(a.ctx,f),c(e,a.id,a.session,f),e.logger.info(`[tboxcode-preset] headless ${a.id}: ${f}`)})}export{l as apply,i as inject,r as name};
package/lib/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
1
  //#region src/index.d.ts
2
2
  /**
3
- * tboxcode-dsh-presets:server/web 链 preset 组合包(骨架)。
4
- * 仅挂 tboxcode-server / tboxcode-web 两链;acp / headless 链不含(presets 声明插件
5
- * 硬 inject registry,acp 形态无 registry——web-native-launch Alternatives 定案)。
3
+ * tboxcode-dsh-presets:acp / headless 薄 preset 轴。
4
+ *
5
+ * registry default = standard;preset-ptc = tool-executor-ptc + ptc-filter;
6
+ * preset-standard = 空树(host plane 即 standard)。
6
7
  */
7
8
  declare const PACKAGE_NAME = "@tbox.cn/tboxcode-dsh-presets";
9
+ declare const PRESET_IDS: readonly ["ptc", "standard"];
10
+ type PresetId = (typeof PRESET_IDS)[number];
8
11
  //#endregion
9
- export { PACKAGE_NAME };
12
+ export { PACKAGE_NAME, PRESET_IDS, PresetId };
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- const e=`@tbox.cn/tboxcode-dsh-presets`;export{e as PACKAGE_NAME};
1
+ const e=`@tbox.cn/tboxcode-dsh-presets`,t=[`ptc`,`standard`];export{e as PACKAGE_NAME,t as PRESET_IDS};
@@ -0,0 +1,9 @@
1
+ import { Context } from "@deepseek-ai/cordis";
2
+
3
+ //#region src/ptc-filter.d.ts
4
+
5
+ declare const name = "tboxcode-ptc-filter";
6
+ declare const inject: readonly ["tools"];
7
+ declare function apply(ctx: Context): void;
8
+ //#endregion
9
+ export { apply, inject, name };
@@ -0,0 +1 @@
1
+ const e=`tboxcode-ptc-filter`,t=[`tools`],n=[`workflow`,`subagent_fork`];function r(e){let t=e.tools,r,i=[],a=!1,o=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),s=(t,n)=>{if(t!==void 0)try{return Promise.resolve(t()).then(()=>void 0,t=>{e.logger.warn(`tboxcode-ptc-filter: ${n}:${t instanceof Error?t.message:String(t)}`)})}catch(t){e.logger.warn(`tboxcode-ptc-filter: ${n}:${t instanceof Error?t.message:String(t)}`)}},c=()=>{if(!a){a=!0;try{let a=n.filter(e=>t.get(e)!==void 0);if(o(a,i))return;if(a.length===0){let e=r;r=void 0,i=[],s(e,`解除限制失败`);return}try{let e=t.restrict({deny:[...a]});if(typeof e!=`function`)throw Error(`tools.restrict() 未返回 disposer`);let n=r;r=e,i=[...a],s(n,`旧限制解除失败(新限制已生效)`)}catch(t){e.logger.debug(`tboxcode-ptc-filter: restrict 暂不可用(等待 tools/change):${t instanceof Error?t.message:String(t)}`)}}finally{a=!1}}};c();let l=e.on;e.effect(()=>{let e=l(`tools/change`,c);return()=>{e();let t=r;return r=void 0,i=[],s(t,`解除限制失败`)}},`tboxcode-ptc-filter`)}export{r as apply,t as inject,e as name};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tbox.cn/tboxcode-dsh-presets",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.15",
4
4
  "type": "module",
5
- "description": "server/web 链组合包:同 id 禁用 bundle 的 agent host 行 + build / plan / general / explore 四 preset 树 + registry default 覆盖行——双 patch 文件(禁用在前)",
5
+ "description": "acp/headless 薄 preset 轴:ptc executor + standard host plane",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
8
  "exports": {
@@ -10,22 +10,36 @@
10
10
  "types": "./lib/index.d.ts",
11
11
  "default": "./lib/index.js"
12
12
  },
13
- "./cordis.patch.yml": "./cordis.patch.yml",
14
- "./presets.patch.yml": "./presets.patch.yml"
13
+ "./ptc-filter": {
14
+ "types": "./lib/ptc-filter.d.ts",
15
+ "default": "./lib/ptc-filter.js"
16
+ },
17
+ "./presets.patch.yml": "./presets.patch.yml",
18
+ "./headless-preset": {
19
+ "types": "./lib/headless-preset.d.ts",
20
+ "default": "./lib/headless-preset.js"
21
+ }
15
22
  },
16
23
  "files": [
17
24
  "lib",
18
- "cordis.patch.yml",
19
25
  "presets.patch.yml"
20
26
  ],
21
27
  "dsh": {
22
28
  "bundle": {
23
29
  "patch": [
24
- "./cordis.patch.yml",
25
30
  "./presets.patch.yml"
26
31
  ]
27
32
  }
28
33
  },
34
+ "dependencies": {
35
+ "@deepseek-ai/dsh-agent-preset": "0.2.2-rc.1",
36
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.1",
37
+ "@deepseek-ai/dsh-session": "0.2.2-rc.1"
38
+ },
39
+ "devDependencies": {
40
+ "@deepseek-ai/cordis": "4.1.0",
41
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.1"
42
+ },
29
43
  "scripts": {
30
44
  "build": "tsdown",
31
45
  "typecheck": "tsc --noEmit -p tsconfig.json"
package/presets.patch.yml CHANGED
@@ -1,294 +1,43 @@
1
- # tboxcode-presets 树文件(build / plan / general / explore 四 preset;树自持参照官方 standard 模板
2
- # ——dsh packages/bundle/web-app/presets/standard.patch.yml;本文件必须在 cordis.patch.yml 之后)。
1
+ # tboxcode-presets:acp / headless 薄 preset 轴。
3
2
  #
4
- # 树内容全量(llm-stack C5 落位;对照官方 standard 的增删):
5
- # - persona 行删除(identity 单点化——bundle system-prompt 覆盖行承载品牌串,
6
- # reminders-plugin-dissolution:泄漏现状连根消除)
7
- # - tool-todo 重建行(web 基座 host 层禁用 :552-553,树内重建 = 官方 standard 同构;
8
- # config 对齐官方 allowParallelInProgress: true)
9
- # - 委派组(build / plan / general 原生单实例 tool-subagent——官方 standard 同构:
10
- # control + list-agents 控制面 + 单 subagent 工具;继承范式 = 子组合 ≡ 父
11
- # 〔构造性安全,approval 恒 never,显式沙箱经 source:delegation 捕获〕;
12
- # maxDepth: 1 深度封锁显式钉住〔Host 缺省同值但 Volatile——行 config 是唯一
13
- # 确定性表达〕;explore 零委派——聚焦模式,继承范式下子自动只读非安全栅栏;
14
- # subagent-native-adoption 取代 subagent-composition-mapping〔0.2.1 删三键,
15
- # 类型面弃用〕;fork / codex / claude-code / workflow / ralph / schedule 不重建——
16
- # tboxcode 基线无此能力面,bundle 禁用保持)
17
- # - 剔除 plan-mode 插件与 planning 组(guidance 单源 = 权限说明 section——plan-mode-mount-exclusion)
18
- # - 剔除 tool-web(tboxcode 层唯一 web 工具 = 本仓 webfetch 移植版——web-tools-layered-disable)
19
- # - tool-ask-user 挂载行 config mode: legacy 定死(question-native-no-port 挂载点唯一化:
20
- # 四 preset 树行 = server/web 链挂载点;timed 为 web 专用增强不启用)
21
- # - 三维一致性断言(四树工具集 + section 集相等〔explore 子集〕· host 行集 ≡ 禁用集 ≡ 树集)
22
- # 随本片测试交付
23
- # 用户领地注记:web 编辑器保存会按 id 覆盖本树 config.plugins(官方 standard 同语义)。
3
+ # 口径(决策:默认 preset 改为 standard;架构沿用 preset-axis-thin):
4
+ # - acp / headless 的 host plane 即 standard;
5
+ # - ptc 直挂 tool-executor-ptc(0.2.2 presentation 选择器退役)与最小工具 deny;
6
+ # - standard 是空树(零插件),是默认树,也用于旧会话 resume 与显式回退;
7
+ # - default = standard,config.jsonc 的 agent_preset 可覆盖(启动期生效)。
8
+ #
9
+ # 本文件不挂 server / web 链——两形态继续使用官方 preset 轴
10
+ # (standard / ptc / minimal / cordis)。
24
11
  - insert:
25
- - id: tboxcode-preset-build
26
- name: '@deepseek-ai/dsh-agent-preset'
12
+ - id: agent-preset-registry
13
+ name: '@deepseek-ai/dsh-agent-preset-registry'
27
14
  config:
28
- id: build
29
- order: 1
30
- plugins:
31
- - id: agent-instructions
32
- name: '@deepseek-ai/dsh-agent-instructions'
33
- config:
34
- maxBytes: 65536
35
- - id: tool-bash
36
- name: '@deepseek-ai/dsh-tool-bash'
37
- disabled: !!js process.platform === 'win32'
38
- - id: tool-pwsh
39
- name: '@deepseek-ai/dsh-tool-pwsh'
40
- disabled: !!js process.platform !== 'win32'
41
- - id: tool-fs
42
- name: '@deepseek-ai/dsh-tool-fs'
43
- - id: tool-fs-search
44
- name: '@deepseek-ai/dsh-tool-fs-search'
45
- config:
46
- sampleOverCapGlobResults: false
47
- - id: tool-jobs
48
- name: '@deepseek-ai/dsh-tool-jobs'
49
- - id: skill-filesystem
50
- name: '@deepseek-ai/dsh-skill-filesystem'
51
- - id: tool-skill
52
- name: '@deepseek-ai/dsh-tool-skill'
53
- - id: command-goal
54
- name: '@deepseek-ai/dsh-command-goal'
55
- - id: tool-goal
56
- name: '@deepseek-ai/dsh-tool-goal'
57
- - id: compaction
58
- name: cordis:group
59
- group: true
60
- isolate:
61
- compaction: true
62
- toolResultPruner: true
63
- config:
64
- - id: compaction-basic
65
- name: '@deepseek-ai/dsh-compaction-basic'
66
- - id: command-compact
67
- name: '@deepseek-ai/dsh-command-compact'
68
- - id: tool-result-pruner
69
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
70
- config:
71
- thresholdChars: 8192
72
- headChars: 4096
73
- tailChars: 1024
74
- - id: delegation
75
- name: cordis:group
76
- group: true
77
- isolate:
78
- workflowEngine: true
79
- config:
80
- - id: tool-subagent-control
81
- name: '@deepseek-ai/dsh-tool-subagent-control'
82
- - id: tool-subagent-list-agents
83
- name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
84
- - id: tool-subagent
85
- name: '@deepseek-ai/dsh-tool-subagent'
86
- config:
87
- provider: spawn
88
- toolName: subagent
89
- modelSelectionSettings: true
90
- maxDepth: 1
91
- - id: tool-ask-user
92
- name: '@deepseek-ai/dsh-tool-ask-user'
93
- config:
94
- mode: legacy
95
- - id: tool-todo
96
- name: '@deepseek-ai/dsh-tool-todo'
97
- config:
98
- allowParallelInProgress: true
99
- - insert:
100
- - id: tboxcode-preset-plan
15
+ default: standard
16
+
17
+ - id: preset-ptc
101
18
  name: '@deepseek-ai/dsh-agent-preset'
102
19
  config:
103
- id: plan
20
+ id: ptc
21
+ name: PTC
22
+ description: PTC execution over the host tool plane
104
23
  order: 2
105
24
  plugins:
106
- - id: agent-instructions
107
- name: '@deepseek-ai/dsh-agent-instructions'
108
- config:
109
- maxBytes: 65536
110
- - id: tool-bash
111
- name: '@deepseek-ai/dsh-tool-bash'
112
- disabled: !!js process.platform === 'win32'
113
- - id: tool-pwsh
114
- name: '@deepseek-ai/dsh-tool-pwsh'
115
- disabled: !!js process.platform !== 'win32'
116
- - id: tool-fs
117
- name: '@deepseek-ai/dsh-tool-fs'
118
- - id: tool-fs-search
119
- name: '@deepseek-ai/dsh-tool-fs-search'
120
- config:
121
- sampleOverCapGlobResults: false
122
- - id: tool-jobs
123
- name: '@deepseek-ai/dsh-tool-jobs'
124
- - id: skill-filesystem
125
- name: '@deepseek-ai/dsh-skill-filesystem'
126
- - id: tool-skill
127
- name: '@deepseek-ai/dsh-tool-skill'
128
- - id: command-goal
129
- name: '@deepseek-ai/dsh-command-goal'
130
- - id: tool-goal
131
- name: '@deepseek-ai/dsh-tool-goal'
132
- - id: compaction
133
- name: cordis:group
134
- group: true
135
- isolate:
136
- compaction: true
137
- toolResultPruner: true
138
- config:
139
- - id: compaction-basic
140
- name: '@deepseek-ai/dsh-compaction-basic'
141
- - id: command-compact
142
- name: '@deepseek-ai/dsh-command-compact'
143
- - id: tool-result-pruner
144
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
145
- config:
146
- thresholdChars: 8192
147
- headChars: 4096
148
- tailChars: 1024
149
- - id: delegation
150
- name: cordis:group
151
- group: true
152
- isolate:
153
- workflowEngine: true
154
- config:
155
- - id: tool-subagent-control
156
- name: '@deepseek-ai/dsh-tool-subagent-control'
157
- - id: tool-subagent-list-agents
158
- name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
159
- - id: tool-subagent
160
- name: '@deepseek-ai/dsh-tool-subagent'
161
- config:
162
- provider: spawn
163
- toolName: subagent
164
- modelSelectionSettings: true
165
- maxDepth: 1
166
- - id: tool-ask-user
167
- name: '@deepseek-ai/dsh-tool-ask-user'
168
- config:
169
- mode: legacy
170
- - id: tool-todo
171
- name: '@deepseek-ai/dsh-tool-todo'
172
- config:
173
- allowParallelInProgress: true
174
- - insert:
175
- - id: tboxcode-preset-general
176
- name: '@deepseek-ai/dsh-agent-preset'
177
- config:
178
- id: general
179
- order: 3
180
- plugins:
181
- - id: agent-instructions
182
- name: '@deepseek-ai/dsh-agent-instructions'
183
- config:
184
- maxBytes: 65536
185
- - id: tool-bash
186
- name: '@deepseek-ai/dsh-tool-bash'
187
- disabled: !!js process.platform === 'win32'
188
- - id: tool-pwsh
189
- name: '@deepseek-ai/dsh-tool-pwsh'
190
- disabled: !!js process.platform !== 'win32'
191
- - id: tool-fs
192
- name: '@deepseek-ai/dsh-tool-fs'
193
- - id: tool-fs-search
194
- name: '@deepseek-ai/dsh-tool-fs-search'
195
- config:
196
- sampleOverCapGlobResults: false
197
- - id: tool-jobs
198
- name: '@deepseek-ai/dsh-tool-jobs'
199
- - id: skill-filesystem
200
- name: '@deepseek-ai/dsh-skill-filesystem'
201
- - id: tool-skill
202
- name: '@deepseek-ai/dsh-tool-skill'
203
- - id: command-goal
204
- name: '@deepseek-ai/dsh-command-goal'
205
- - id: tool-goal
206
- name: '@deepseek-ai/dsh-tool-goal'
207
- - id: compaction
208
- name: cordis:group
209
- group: true
210
- isolate:
211
- compaction: true
212
- toolResultPruner: true
213
- config:
214
- - id: compaction-basic
215
- name: '@deepseek-ai/dsh-compaction-basic'
216
- - id: command-compact
217
- name: '@deepseek-ai/dsh-command-compact'
218
- - id: tool-result-pruner
219
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
220
- config:
221
- thresholdChars: 8192
222
- headChars: 4096
223
- tailChars: 1024
224
- - id: delegation
225
- name: cordis:group
226
- group: true
227
- isolate:
228
- workflowEngine: true
229
- config:
230
- - id: tool-subagent-control
231
- name: '@deepseek-ai/dsh-tool-subagent-control'
232
- - id: tool-subagent-list-agents
233
- name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
234
- - id: tool-subagent
235
- name: '@deepseek-ai/dsh-tool-subagent'
236
- config:
237
- provider: spawn
238
- toolName: subagent
239
- modelSelectionSettings: true
240
- maxDepth: 1
241
- - id: tool-ask-user
242
- name: '@deepseek-ai/dsh-tool-ask-user'
243
- config:
244
- mode: legacy
245
- - id: tool-todo
246
- name: '@deepseek-ai/dsh-tool-todo'
247
- config:
248
- allowParallelInProgress: true
249
- - insert:
250
- - id: tboxcode-preset-explore
25
+ - id: tool-executor-ptc
26
+ name: '@deepseek-ai/dsh-tool-executor-ptc'
27
+ - id: tboxcode-ptc-filter
28
+ name: '@tbox.cn/tboxcode-dsh-presets/ptc-filter'
29
+
30
+ - id: preset-standard
251
31
  name: '@deepseek-ai/dsh-agent-preset'
252
32
  config:
253
- id: explore
254
- order: 4
255
- plugins:
256
- - id: agent-instructions
257
- name: '@deepseek-ai/dsh-agent-instructions'
258
- config:
259
- maxBytes: 65536
260
- - id: tool-fs
261
- name: '@deepseek-ai/dsh-tool-fs'
262
- - id: tool-fs-search
263
- name: '@deepseek-ai/dsh-tool-fs-search'
264
- config:
265
- sampleOverCapGlobResults: false
266
- - id: skill-filesystem
267
- name: '@deepseek-ai/dsh-skill-filesystem'
268
- - id: tool-skill
269
- name: '@deepseek-ai/dsh-tool-skill'
270
- - id: command-goal
271
- name: '@deepseek-ai/dsh-command-goal'
272
- - id: tool-goal
273
- name: '@deepseek-ai/dsh-tool-goal'
274
- - id: compaction
275
- name: cordis:group
276
- group: true
277
- isolate:
278
- compaction: true
279
- toolResultPruner: true
280
- config:
281
- - id: compaction-basic
282
- name: '@deepseek-ai/dsh-compaction-basic'
283
- - id: command-compact
284
- name: '@deepseek-ai/dsh-command-compact'
285
- - id: tool-result-pruner
286
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
287
- config:
288
- thresholdChars: 8192
289
- headChars: 4096
290
- tailChars: 1024
291
- - id: tool-ask-user
292
- name: '@deepseek-ai/dsh-tool-ask-user'
293
- config:
294
- mode: legacy
33
+ id: standard
34
+ name: Standard
35
+ description: Host-plane standard composition
36
+ order: 1
37
+ plugins: []
38
+
39
+ # headless 专用桥(acp 链上 headlessStartup 缺席 → 插件 no-op)。
40
+ # 上游 dsh-headless 支持 preset 后可删除本行与 src/headless-preset.ts。
41
+ - id: tboxcode-headless-preset
42
+ name: '@tbox.cn/tboxcode-dsh-presets/headless-preset'
43
+ inject: [agentPresets]
package/cordis.patch.yml DELETED
@@ -1,11 +0,0 @@
1
- # tboxcode-presets 禁用 / 覆盖文件(server/web 链;数组序 = 应用序,本文件必须在 presets.patch.yml
2
- # 树文件之前——同 id 覆盖消解层内行序地雷;官方先例两文件形态:dsh packages/bundle/web-app/cordis.patch.yml
3
- # 同 id 禁用 + presets/standard.patch.yml 树内重建)。
4
- #
5
- # registry default 覆盖行(web-native-launch:default 覆盖进 presets 包层,bundle 层用户优先——
6
- # 压死用户 make-default 的 overlay 方案已否决):同 id 覆盖 web-app 的 agent-preset-registry 行,
7
- # blank 会话 default 组合走 tboxcode-general。
8
- - id: agent-preset-registry
9
- name: '@deepseek-ai/dsh-agent-preset-registry'
10
- config:
11
- default: general