dsh-plugin-prompt-tool 0.3.0 → 0.4.0
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 +77 -85
- package/lib/client.js +96 -5
- package/lib/client.js.map +1 -1
- package/lib/index.d.mts +7 -3
- package/lib/index.mjs +58 -61
- package/lib/preset-core.d.mts +7 -3
- package/lib/preset-core.mjs +133 -29
- package/package.json +20 -20
- package/plan.md +22 -2
- package/preset/agent.cordis.yml +443 -0
- package/preset/compaction-epoch.mjs +81 -0
- package/preset/context-gate.mjs +165 -0
- package/preset/custom-bash.mjs +243 -0
- package/preset/instruction-hint.mjs +217 -0
- package/preset/near-anchor.mjs +6 -19
- package/preset/prompt-injector.mjs +111 -126
- package/preset/router-first-turn.mjs +73 -70
- package/preset/router-guide.mjs +14 -20
- package/preset/shared.mjs +83 -0
- package/preset/skill-search.mjs +142 -0
- package/preset/tool-bootstrap.mjs +282 -0
- package/upstream/dsh-anchored-standard/REVISION +1 -1
- package/upstream/dsh-anchored-standard/preset/agent.cordis.yml +22 -11
- package/upstream/dsh-anchored-standard/preset/custom-bash.mjs +98 -5
package/lib/preset-core.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { parse } from "yaml";
|
|
|
6
6
|
* prompt-tool preset 生成核心:与 dsh 插件上下文无关的纯函数,
|
|
7
7
|
* 独立成文件以便单元测试与复用。失败一律抛出(fail loud)。
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const CORDIS_TEMPLATE = fileURLToPath(new URL("../preset/agent.cordis.yml", import.meta.url));
|
|
10
10
|
const ROUTER_FIRST_TURN_BLOCK = `# prompt-tool 本地附加件(最优组合):首轮只保留计划段 + 训练原句,
|
|
11
11
|
# 并清空自动注入 contexts;子代理直接放行。注册在 tool-bootstrap 之后,
|
|
12
12
|
# 不参与首轮工具目录裁剪——tools 仍由原版 tool-bootstrap 负责。
|
|
@@ -69,28 +69,16 @@ const ROUTER_FLASH_PERSONA = [
|
|
|
69
69
|
"Before acting, briefly review what you have already done in this session and continue from where you left off; do not repeat completed steps. Do not run environment checks (echo, whoami, uname, node --version, date) or exhaustive grep/glob scans.",
|
|
70
70
|
"Think deeply first, then produce."
|
|
71
71
|
].join("\n");
|
|
72
|
-
/**
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
config:
|
|
83
|
-
promoteOn: either
|
|
84
|
-
includeSubagents: false
|
|
85
|
-
allowKinds: [skill-invocation, near-anchor, router-guide]`;
|
|
86
|
-
if (!source.includes(block)) throw new Error("vendor agent.cordis.yml missing context-gate row");
|
|
87
|
-
return source.replace(block, replaced);
|
|
88
|
-
}
|
|
89
|
-
/** 上游可能携带作者机器固定路径;生成时统一改写为可配置 bashPath。 */
|
|
90
|
-
function normalizeBashPath(source, bashPath) {
|
|
91
|
-
const marker = /bashPath:\s*'[^']*'/.exec(source);
|
|
92
|
-
if (marker === null) throw new Error("vendor agent.cordis.yml missing bashPath row");
|
|
93
|
-
return source.replace(marker[0], `bashPath: '${bashPath}'`);
|
|
72
|
+
/** 按开关向本地 tool-bootstrap 行注入 usePtcMode / bootstrapMaxTokens。 */
|
|
73
|
+
function applyToolBootstrapOptions(source, usePtcMode, bootstrapMaxTokens) {
|
|
74
|
+
const rowStart = source.indexOf("- id: tool-bootstrap\n name: ./tool-bootstrap.mjs\n config:\n");
|
|
75
|
+
if (rowStart < 0) throw new Error("preset/agent.cordis.yml missing tool-bootstrap config block");
|
|
76
|
+
const include = source.indexOf(" includeSubagents: true\n", rowStart);
|
|
77
|
+
if (include < 0) throw new Error("preset/agent.cordis.yml tool-bootstrap row missing includeSubagents");
|
|
78
|
+
const at = include + 26 + 1;
|
|
79
|
+
const lines = [` usePtcMode: ${usePtcMode}`];
|
|
80
|
+
if (bootstrapMaxTokens !== void 0 && Number.isSafeInteger(bootstrapMaxTokens) && bootstrapMaxTokens > 0) lines.push(` bootstrapMaxTokens: ${bootstrapMaxTokens}`);
|
|
81
|
+
return source.slice(0, at) + lines.join("\n") + "\n" + source.slice(at);
|
|
94
82
|
}
|
|
95
83
|
/** 给 subagent/subagent_fork 行加 dsh-router-standard 的 Flash 子代理方案;关闭时保持继承主会话路由。 */
|
|
96
84
|
function applySubagentFlash(source, enabled, provider, model) {
|
|
@@ -120,24 +108,140 @@ function applySubagentFlash(source, enabled, provider, model) {
|
|
|
120
108
|
${agentOptions}
|
|
121
109
|
persona: |-
|
|
122
110
|
${persona}`;
|
|
123
|
-
if (!out.includes(block)) throw new Error(`
|
|
111
|
+
if (!out.includes(block)) throw new Error(`preset/agent.cordis.yml missing ${target.id} row`);
|
|
124
112
|
out = out.replace(block, replaced);
|
|
125
113
|
}
|
|
126
114
|
return out;
|
|
127
115
|
}
|
|
116
|
+
/** 给生成的 tool-bootstrap.mjs 打补丁:子代理全量放行 + 可选的 PTC 呈现切换。 */
|
|
117
|
+
function patchToolBootstrap(source) {
|
|
118
|
+
source = source.replace(/\r\n/g, "\n");
|
|
119
|
+
const original = [
|
|
120
|
+
" const assembled = await next()",
|
|
121
|
+
" try {",
|
|
122
|
+
" const status = promotion.status(context.agent)"
|
|
123
|
+
].join("\n");
|
|
124
|
+
const replacement = [
|
|
125
|
+
" const assembled = await next()",
|
|
126
|
+
" try {",
|
|
127
|
+
" const agent = context.agent",
|
|
128
|
+
" if (agent === undefined) return assembled",
|
|
129
|
+
" // prompt-tool patch: subagents skip catalog narrowing and use assembled tools directly.",
|
|
130
|
+
" // Callers (such as dsh-mnemon) already filter assembled.tools through their own whitelists.",
|
|
131
|
+
" // New plugin tools with any prefix therefore appear in the subagent first session automatically.",
|
|
132
|
+
" agentBySession.set(agent.session, agent)",
|
|
133
|
+
" if ((agent.session?.header?.delegationDepth ?? 0) > 0) {",
|
|
134
|
+
" if (usePtcMode) applyCodePresentation(agent)",
|
|
135
|
+
" return assembled",
|
|
136
|
+
" }",
|
|
137
|
+
" const status = promotion.status(agent)"
|
|
138
|
+
].join("\n");
|
|
139
|
+
if (!source.includes(original)) throw new Error("tool-bootstrap.mjs assembled marker missing");
|
|
140
|
+
source = source.replace(original, replacement);
|
|
141
|
+
const allowedOriginal = "const ALLOWED_KEYS = new Set(['bootstrapTools', 'promoteOn', 'bootstrapMaxTokens', 'compactionTools', 'includeSubagents'])";
|
|
142
|
+
const allowedReplacement = "const ALLOWED_KEYS = new Set(['bootstrapTools', 'promoteOn', 'bootstrapMaxTokens', 'compactionTools', 'includeSubagents', 'usePtcMode'])";
|
|
143
|
+
if (!source.includes(allowedOriginal)) throw new Error("tool-bootstrap.mjs ALLOWED_KEYS marker missing");
|
|
144
|
+
source = source.replace(allowedOriginal, allowedReplacement);
|
|
145
|
+
const parseOriginal = " const includeSubagents = booleanOption(source.includeSubagents, 'includeSubagents', false)";
|
|
146
|
+
const parseReplacement = " const includeSubagents = booleanOption(source.includeSubagents, 'includeSubagents', false)\n const usePtcMode = booleanOption(source.usePtcMode, 'usePtcMode', true)";
|
|
147
|
+
if (!source.includes(parseOriginal)) throw new Error("tool-bootstrap.mjs includeSubagents parse marker missing");
|
|
148
|
+
source = source.replace(parseOriginal, parseReplacement);
|
|
149
|
+
const trackerOriginal = [" const promotion = createEpochPromotion(promoteEvents, { includeSubagents })", " ctx.on('session/event', (session, event) => promotion.observe(session, event))"].join("\n");
|
|
150
|
+
const trackerReplacement = [
|
|
151
|
+
" const promotion = createEpochPromotion(promoteEvents, { includeSubagents })",
|
|
152
|
+
"",
|
|
153
|
+
" // prompt-tool patch: optional Code Mode (PTC) wire presentation after promotion.",
|
|
154
|
+
" const presentationBySession = new WeakMap()",
|
|
155
|
+
" const agentBySession = new WeakMap()",
|
|
156
|
+
" const presentationState = (session) => {",
|
|
157
|
+
" let state = presentationBySession.get(session)",
|
|
158
|
+
" if (state === undefined) {",
|
|
159
|
+
" state = { applied: false, disposer: undefined }",
|
|
160
|
+
" presentationBySession.set(session, state)",
|
|
161
|
+
" }",
|
|
162
|
+
" return state",
|
|
163
|
+
" }",
|
|
164
|
+
" const applyCodePresentation = (agent) => {",
|
|
165
|
+
" const session = agent?.session",
|
|
166
|
+
" if (session === undefined) return",
|
|
167
|
+
" const state = presentationState(session)",
|
|
168
|
+
" if (state.applied) return",
|
|
169
|
+
" const tools = agent.ctx?.tools",
|
|
170
|
+
" if (tools === undefined || typeof tools.presentAs !== 'function') return",
|
|
171
|
+
" state.disposer = tools.presentAs('code')",
|
|
172
|
+
" state.applied = true",
|
|
173
|
+
" }",
|
|
174
|
+
" const releaseCodePresentation = (session) => {",
|
|
175
|
+
" const state = presentationBySession.get(session)",
|
|
176
|
+
" if (state === undefined) return",
|
|
177
|
+
" if (typeof state.disposer === 'function') {",
|
|
178
|
+
" try { state.disposer() } catch { /* never brick the session */ }",
|
|
179
|
+
" }",
|
|
180
|
+
" state.disposer = undefined",
|
|
181
|
+
" state.applied = false",
|
|
182
|
+
" }",
|
|
183
|
+
" ctx.on('session/event', (session, event) => promotion.observe(session, event))",
|
|
184
|
+
"",
|
|
185
|
+
" ctx.on('session/event', (session, event) => {",
|
|
186
|
+
" if (!usePtcMode) return",
|
|
187
|
+
" if (event.type === 'compaction/end') {",
|
|
188
|
+
" releaseCodePresentation(session)",
|
|
189
|
+
" return",
|
|
190
|
+
" }",
|
|
191
|
+
" if (event.type !== 'step/end' && event.type !== 'turn/end') return",
|
|
192
|
+
" const agent = agentBySession.get(session)",
|
|
193
|
+
" if (agent !== undefined && promotion.status(agent).promoted) applyCodePresentation(agent)",
|
|
194
|
+
" })"
|
|
195
|
+
].join("\n");
|
|
196
|
+
if (!source.includes(trackerOriginal)) throw new Error("tool-bootstrap.mjs promotion tracker marker missing");
|
|
197
|
+
source = source.replace(trackerOriginal, trackerReplacement);
|
|
198
|
+
const promotedStart = source.indexOf(" if (status.promoted) {\n // PROMOTED:");
|
|
199
|
+
const promotedEnd = source.indexOf(" // Controlled phase:", promotedStart);
|
|
200
|
+
if (promotedStart < 0 || promotedEnd < 0) throw new Error("tool-bootstrap.mjs promoted/controlled marker missing");
|
|
201
|
+
const promotedReplacement = [
|
|
202
|
+
" if (status.promoted) {",
|
|
203
|
+
" // prompt-tool patch: both modes keep the assembled catalog after promotion.",
|
|
204
|
+
" // usePtcMode switches the wire presentation instead of narrowing resident tools.",
|
|
205
|
+
" if (usePtcMode) applyCodePresentation(agent)",
|
|
206
|
+
" return assembled",
|
|
207
|
+
" }",
|
|
208
|
+
""
|
|
209
|
+
].join("\n");
|
|
210
|
+
source = source.slice(0, promotedStart) + promotedReplacement + source.slice(promotedEnd);
|
|
211
|
+
const residentOriginal = "const RESIDENT_DISCOVERY_TOOLS = ['dev_tool_search', 'skill_search', 'skill_load']\n\n";
|
|
212
|
+
if (source.includes(residentOriginal)) source = source.replace(residentOriginal, "");
|
|
213
|
+
const unlockedStart = source.indexOf("/**\n * Tool names the model explicitly unlocked via `dev_tool_search`");
|
|
214
|
+
const unlockedEnd = source.indexOf(" /** Narrow the assembled catalog", unlockedStart);
|
|
215
|
+
if (unlockedStart >= 0 && unlockedEnd > unlockedStart) source = source.slice(0, unlockedStart) + source.slice(unlockedEnd);
|
|
216
|
+
const headerStart = source.indexOf(" * POST-PROMOTION RESIDENT SET");
|
|
217
|
+
const headerEnd = source.indexOf(" * COMPACTION (local addition)", headerStart);
|
|
218
|
+
if (headerStart >= 0 && headerEnd > headerStart) {
|
|
219
|
+
const headerReplacement = [
|
|
220
|
+
" * POST-PROMOTION CATALOG (prompt-tool patch): after promotion both modes",
|
|
221
|
+
" * keep the assembled catalog. `usePtcMode` switches the wire presentation",
|
|
222
|
+
" * to Code Mode (PTC, single run_code) instead of narrowing the resident set.",
|
|
223
|
+
" * The controlled phase below still narrows the catalog before promotion and",
|
|
224
|
+
" * after compaction.",
|
|
225
|
+
""
|
|
226
|
+
].join(String.fromCharCode(10));
|
|
227
|
+
source = source.slice(0, headerStart) + headerReplacement + source.slice(headerEnd);
|
|
228
|
+
}
|
|
229
|
+
return source;
|
|
230
|
+
}
|
|
128
231
|
function buildCordis(prompt, options = {}) {
|
|
129
232
|
const anchorFirstTurn = options.anchorFirstTurn === true;
|
|
130
233
|
const anchorCustom = options.anchorCustom === true;
|
|
131
234
|
const guideCustom = options.guideCustom === true;
|
|
132
235
|
const guideText = typeof options.guideText === "string" && options.guideText.length > 0 ? options.guideText : "";
|
|
133
236
|
const injectPrompt = options.injectPrompt !== false;
|
|
237
|
+
const usePtcMode = options.usePtcMode !== false;
|
|
134
238
|
const anchorText = typeof options.anchorText === "string" && options.anchorText.length > 0 ? options.anchorText : "";
|
|
135
239
|
const indent = (s) => s.split(/\r?\n/).map((l) => l.length === 0 ? "" : " " + l).join("\n");
|
|
136
|
-
const up =
|
|
240
|
+
const up = applyToolBootstrapOptions(applySubagentFlash(readFileSync(CORDIS_TEMPLATE, "utf8").replace(/\r\n/g, "\n"), options.subagentFlash === true, typeof options.subagentFlashProvider === "string" && options.subagentFlashProvider.length > 0 ? options.subagentFlashProvider : "deepseek-official", typeof options.subagentFlashModel === "string" && options.subagentFlashModel.length > 0 ? options.subagentFlashModel : "deepseek-v4-flash"), usePtcMode, options.bootstrapMaxTokens);
|
|
137
241
|
const bootstrap = /^-\s+id:\s+tool-bootstrap\s*$/m.exec(up);
|
|
138
|
-
if (!bootstrap) throw new Error("
|
|
242
|
+
if (!bootstrap) throw new Error("preset/agent.cordis.yml missing tool-bootstrap row");
|
|
139
243
|
let cursor = up.indexOf("\n", bootstrap.index);
|
|
140
|
-
if (cursor < 0) throw new Error("
|
|
244
|
+
if (cursor < 0) throw new Error("preset/agent.cordis.yml has no top-level row after tool-bootstrap");
|
|
141
245
|
cursor += 1;
|
|
142
246
|
let insertAt = -1;
|
|
143
247
|
while (cursor <= up.length) {
|
|
@@ -150,7 +254,7 @@ function buildCordis(prompt, options = {}) {
|
|
|
150
254
|
if (lineEnd < 0) break;
|
|
151
255
|
cursor = lineEnd + 1;
|
|
152
256
|
}
|
|
153
|
-
if (insertAt < 0) throw new Error("
|
|
257
|
+
if (insertAt < 0) throw new Error("preset/agent.cordis.yml has no top-level row after tool-bootstrap");
|
|
154
258
|
const head = up.slice(0, insertAt);
|
|
155
259
|
const tail = up.slice(insertAt);
|
|
156
260
|
const separator = head.endsWith("\n\n") ? "" : head.endsWith("\n") ? "\n" : "\n\n";
|
|
@@ -186,4 +290,4 @@ function buildCordis(prompt, options = {}) {
|
|
|
186
290
|
return out;
|
|
187
291
|
}
|
|
188
292
|
//#endregion
|
|
189
|
-
export { buildCordis, parseFrontmatter };
|
|
293
|
+
export { buildCordis, parseFrontmatter, patchToolBootstrap };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-prompt-tool",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "DSH 插件:提示词工具,规范模型的思维链与回答内容,提供 Web UI 编辑 preset.md 与 AGENTS.md,并按 skills 目录注册可开关技能。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,30 +36,30 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
39
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.
|
|
40
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.0-rc.
|
|
41
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.
|
|
42
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.
|
|
43
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.
|
|
44
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.
|
|
45
|
-
"@deepseek-ai/dsh-settings": "^0.1.0-rc.
|
|
46
|
-
"@deepseek-ai/dsh-skill": "^0.1.0-rc.
|
|
47
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.
|
|
39
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.7",
|
|
40
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.0-rc.7",
|
|
41
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
42
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
43
|
+
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.7",
|
|
44
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
45
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
46
|
+
"@deepseek-ai/dsh-skill": "^0.1.0-rc.7",
|
|
47
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.7",
|
|
48
48
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
49
49
|
"react": "^18.2.0",
|
|
50
|
-
"@deepseek-ai/dsh-commands": "^0.1.0-rc.
|
|
50
|
+
"@deepseek-ai/dsh-commands": "^0.1.0-rc.7"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
54
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.
|
|
55
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.
|
|
59
|
-
"@deepseek-ai/dsh-commands": "0.1.0-rc.
|
|
60
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.
|
|
61
|
-
"@deepseek-ai/dsh-settings": "^0.1.0-rc.
|
|
62
|
-
"@deepseek-ai/dsh-skill": "^0.1.0-rc.
|
|
54
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.0-rc.7",
|
|
55
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.7",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.7",
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.7",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.7",
|
|
59
|
+
"@deepseek-ai/dsh-commands": "^0.1.0-rc.7",
|
|
60
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.7",
|
|
61
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.7",
|
|
62
|
+
"@deepseek-ai/dsh-skill": "^0.1.0-rc.7",
|
|
63
63
|
"@types/node": "^26.2.0",
|
|
64
64
|
"@types/react": "~18.3.1",
|
|
65
65
|
"clsx": "^2.1.1",
|
package/plan.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
# dsh-plugin-prompt-tool 重新设计计划(v2)
|
|
2
|
+
> **v2.19 preset 脚本审查清理(当前实现)**:抽取 `shared.mjs` 公共工具;
|
|
3
|
+
> router-first-turn 不再重复清 contexts(交给 context-gate);router-first-turn /
|
|
4
|
+
> router-guide / prompt-injector 统一使用 epoch-aware 晋升状态;修正 stale 注释与未用变量。
|
|
5
|
+
|
|
6
|
+
> **v2.18 全部预设脚本自有化**:`preset/` 新增 shared / context-gate /
|
|
7
|
+
> compaction-epoch / custom-bash / instruction-hint / skill-search / tool-bootstrap 最终快照;
|
|
8
|
+
> 公共配置校验、晋升解析、消息工具合并进 `shared.mjs`;运行时不再直读 `upstream/` 任何文件,
|
|
9
|
+
> `upstream/` 仅作溯源与 sync 对照。
|
|
10
|
+
|
|
11
|
+
> **v2.17 agent.cordis.yml 脱离上游**:新增自有模板 `preset/agent.cordis.yml`;
|
|
12
|
+
> 运行时不再直读 `upstream/.../agent.cordis.yml`,动态项仅由 `buildCordis` 注入。
|
|
13
|
+
|
|
14
|
+
> **v2.16 使用 PTC 模式开关**:新增 `usePtcMode`(默认开启)。
|
|
15
|
+
> 开启=晋升后把 wire 切换为 Code Mode(PTC,单一 run_code),完整插件工具经生成 SDK 调用;
|
|
16
|
+
> 关闭=晋升后恢复原生完整工具目录;两种模式都不再依赖 `dev_tool_search`,生成 preset 时直接移除该行且不复制 `dev-tool-search.mjs`。
|
|
17
|
+
|
|
18
|
+
> **v2.15 上游同步**:同步上游到 `25f21ae`;移除
|
|
19
|
+
> `customBashPath` 生成时改写,直接沿用上游 custom-bash 运行时探测。
|
|
20
|
+
> 新增 `bootstrapMaxTokens` 开关(0=关闭;正整数写入上游 tool-bootstrap)。
|
|
21
|
+
|
|
2
22
|
> **v2.14 上游同步与路径校对(当前实现)**:已从上游 main 同步到
|
|
3
23
|
> `ba7a27c`;新增 context-gate.mjs;custom-bash 的固定路径在生成时归一化为
|
|
4
24
|
> `customBashPath`(默认 bash.exe,PATH 查找)。
|
|
@@ -57,8 +77,8 @@ artifacts/(本地调试残留)。
|
|
|
57
77
|
| 首轮输出预算 | `bootstrapMaxTokens: 1024` 固定 | **opt-in,默认无 cap**(adapter 默认 256000 流过) | 实测(issue #11):Minimal schema 在 256000 下锚定 5/5(`We need` 首行、`we` 1.4、`let me` 0.0),而 pwsh/read 等标准家族 schema 在 256000 下 11/11 全失败——**工具 schema 是决定性变量,不是 cap** |
|
|
58
78
|
| agent.cordis.yml 结构 | 无 Minimal 组 | 新增 `persistent-shell` 组(dsh-terminal + dsh-terminal-bash + dsh-tool-bash-persistent)与 `bootstrap-filesystem` 组(dsh-fs-local + dsh-tool-str-replace-editor),与官方 minimal 字节一致;`tool-bash` 行全平台禁用(避免 `bash` 名重复注册) | 完全复制;prompt-injector 仍插在 tool-bootstrap 行后 |
|
|
59
79
|
| tool-bootstrap 参数 | `shellTools`+`commonTools` | `bootstrapTools: [bash, str_replace_editor]`;cap 监听器仅在显式设置 cap 时注册 | prompt-injector 逻辑不变(we 检测 + promoted 检测与参数无关) |
|
|
60
|
-
| 验证工具 | 无 | `verify/run-verify.mjs` + `verify-runner.mjs`:preset-roster compose + CLI driver,`--stop-after-first-assistant` 只测首请求(秒级) | 本地 harness 源码未构建(`apps/cli/lib/bin.js` 不存在),暂继续用 prebuilt rc.
|
|
61
|
-
| cap 行为差异 | — | rc.5 源码 checkout 上 cap 能到达首请求;rc.6 prebuilt 包会覆盖为 adapterDefaults |
|
|
80
|
+
| 验证工具 | 无 | `verify/run-verify.mjs` + `verify-runner.mjs`:preset-roster compose + CLI driver,`--stop-after-first-assistant` 只测首请求(秒级) | 本地 harness 源码未构建(`apps/cli/lib/bin.js` 不存在),暂继续用 prebuilt rc.7 的 dsh web HTTP API;将来构建 harness 后可切换 |
|
|
81
|
+
| cap 行为差异 | — | rc.5 源码 checkout 上 cap 能到达首请求;rc.6 prebuilt 包会覆盖为 adapterDefaults;rc.7 修复 max-tokens 截断后的 replay 续跑 | 默认不设 cap;开启 bootstrapMaxTokens 时 rc.7 更稳 |
|
|
62
82
|
|
|
63
83
|
结论:**设计骨架不变**(完全复制原版 + prompt-injector 附加件),只是复制源更新为
|
|
64
84
|
新版文件,测试断言从 `pwsh/read + 1024` 改为 `bash/str_replace_editor + 无 cap`。
|