@eddyskywalker/dsh-chatgpt-subscription 0.58.0 → 0.60.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/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/lib/client.js +1714 -255
- package/lib/client.js.map +1 -1
- package/lib/codemode.js +1952 -0
- package/lib/index.js +587 -243
- package/lib/llm-compat-u9mor0uu.js +110 -0
- package/lib/types/client/CodexImageToolView.d.ts.map +1 -1
- package/lib/types/client/codemode/CodeRunToolView.d.ts +68 -0
- package/lib/types/client/codemode/CodeRunToolView.d.ts.map +1 -0
- package/lib/types/client/codemode/highlight.d.ts +25 -0
- package/lib/types/client/codemode/highlight.d.ts.map +1 -0
- package/lib/types/client/codemode/styles.d.ts +11 -0
- package/lib/types/client/codemode/styles.d.ts.map +1 -0
- package/lib/types/client/codemode/tool-name.d.ts +10 -0
- package/lib/types/client/codemode/tool-name.d.ts.map +1 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locales-ru/hub.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +23 -1
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/progress-updates/progress-row.d.ts.map +1 -1
- package/lib/types/client/styles.d.ts.map +1 -1
- package/lib/types/compat.d.ts +10 -1
- package/lib/types/compat.d.ts.map +1 -1
- package/lib/types/entry-codemode.d.ts +37 -0
- package/lib/types/entry-codemode.d.ts.map +1 -0
- package/lib/types/host/agent-preset.d.ts +24 -2
- package/lib/types/host/agent-preset.d.ts.map +1 -1
- package/lib/types/host/antigravity/image-tool.d.ts +10 -2
- package/lib/types/host/antigravity/image-tool.d.ts.map +1 -1
- package/lib/types/host/cache-warmup/install.d.ts +10 -4
- package/lib/types/host/cache-warmup/install.d.ts.map +1 -1
- package/lib/types/host/cache-warmup/projection.d.ts +17 -0
- package/lib/types/host/cache-warmup/projection.d.ts.map +1 -1
- package/lib/types/host/codemode/discovery.d.ts +33 -0
- package/lib/types/host/codemode/discovery.d.ts.map +1 -0
- package/lib/types/host/codemode/executor.d.ts +140 -0
- package/lib/types/host/codemode/executor.d.ts.map +1 -0
- package/lib/types/host/codemode/retention.d.ts +34 -0
- package/lib/types/host/codemode/retention.d.ts.map +1 -0
- package/lib/types/host/codemode/rules.d.ts +193 -0
- package/lib/types/host/codemode/rules.d.ts.map +1 -0
- package/lib/types/host/codemode/scope.d.ts +59 -0
- package/lib/types/host/codemode/scope.d.ts.map +1 -0
- package/lib/types/host/codemode/transport.d.ts +299 -0
- package/lib/types/host/codemode/transport.d.ts.map +1 -0
- package/lib/types/host/codex-images.d.ts +12 -0
- package/lib/types/host/codex-images.d.ts.map +1 -1
- package/lib/types/host/command-code/model-catalog.d.ts +14 -14
- package/lib/types/host/command-code/model-catalog.d.ts.map +1 -1
- package/lib/types/host/command-code/routes.d.ts.map +1 -1
- package/lib/types/host/preset-sync.d.ts +19 -4
- package/lib/types/host/preset-sync.d.ts.map +1 -1
- package/package.json +6 -1
- package/presets/dispatch/README.md +13 -6
- package/presets/dispatch/agent.cordis.yml +19 -16
- package/presets/dispatch/preset.yml +1 -1
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Mode 的程序传输工具 `code_run`。
|
|
3
|
+
*
|
|
4
|
+
* 工具名不是 `run_code`:那个名字被内核保留(`tools.register()` 会抛错),所以本包
|
|
5
|
+
* 用自己的名字注册同一件事——把模型写的一段程序交给 `ctx.ptcRuntime` 执行,程序里的每次
|
|
6
|
+
* `tools.<name>(args)` 都是一次真实的工具调用。
|
|
7
|
+
*
|
|
8
|
+
* ## 与内核 PTC `run_code` 对齐的使用配置
|
|
9
|
+
*
|
|
10
|
+
* 1. **运行时感知 Schema**:按 `ptcRuntime` 的语言(TypeScript / Python)、程序形态
|
|
11
|
+
* (`function-body` / 常驻 REPL)、超时预算(`defaultMs` / `maxMs`)与沙箱支持动态投影
|
|
12
|
+
* 描述和参数(含单次提权的 `sandbox_permissions` + `justification`);同一部署下静态恒定,
|
|
13
|
+
* 不会扰动前缀缓存。
|
|
14
|
+
* 2. **完整子调用调度与上下文转发**:只读并发上限受 `maxParallelSubCalls` 约束,写类调用等待
|
|
15
|
+
* 在飞调用排空后独占执行;程序结算时中止悬空请求并等待已启动子调用落盘;子调用产生的图片块、
|
|
16
|
+
* `additionalContexts` 与 `concludesTurn` 原样转交给外层步骤。
|
|
17
|
+
* 3. **展示元数据与输出格式化**:声明 `presentCall` 与 `output.presentationMeta`(记录语言),
|
|
18
|
+
* 深层 JSON 结果控制缩进上限,失败时保留已捕获输出与沙箱诊断信息。
|
|
19
|
+
*
|
|
20
|
+
* @module @eddyskywalker/dsh-chatgpt-subscription/host/codemode/transport
|
|
21
|
+
*/
|
|
22
|
+
import type { CodemodeRules } from './rules.ts';
|
|
23
|
+
/**
|
|
24
|
+
* 读当前程序运行的清单快照。
|
|
25
|
+
*
|
|
26
|
+
* @returns 程序运行期间是这次运行的快照;程序之外为 `undefined`。
|
|
27
|
+
*/
|
|
28
|
+
export declare function currentCatalogSnapshot(): readonly CatalogEntry[] | undefined;
|
|
29
|
+
/** 传输工具名(与 {@link DEFAULT_RUN_TOOL_NAME} 一致,导出方便测试引用)。 */
|
|
30
|
+
export declare const TRANSPORT_TOOL_NAME = "code_run";
|
|
31
|
+
/** 允许单次提权的目标沙箱模式(对齐 `@deepseek-ai/dsh-sandbox` 的 `ESCALATION_TARGETS`)。 */
|
|
32
|
+
export declare const ESCALATION_TARGETS: readonly ["workspace-write", "danger-full-access"];
|
|
33
|
+
export type EscalationTargetMode = (typeof ESCALATION_TARGETS)[number];
|
|
34
|
+
/** 程序里可调用的一个工具(结构描述,只读需要的字段)。 */
|
|
35
|
+
export interface CatalogEntry {
|
|
36
|
+
/** 工具名。 */
|
|
37
|
+
readonly name: string;
|
|
38
|
+
/** 面向模型的描述。 */
|
|
39
|
+
readonly description: string;
|
|
40
|
+
/** 完整参数 JSON Schema。 */
|
|
41
|
+
readonly parameters: unknown;
|
|
42
|
+
/** 并发分类(内核约定:只有 true 表示可并发)。 */
|
|
43
|
+
readonly isConcurrencySafe?: (args: unknown) => boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 一次运行拿到的会话级授权。
|
|
47
|
+
*
|
|
48
|
+
* 两项都取自**会话**而不是部署默认值:文件策略决定程序拿到的沙盒模式与写根,目录决定程序
|
|
49
|
+
* 从哪里开始(`cd` 过的会话不会退回初始目录)。取不到就留空,交给内核兜底。
|
|
50
|
+
*/
|
|
51
|
+
export interface RunAuthority {
|
|
52
|
+
/** 会话当前工作目录。 */
|
|
53
|
+
readonly cwd?: string;
|
|
54
|
+
/** 会话级文件策略。 */
|
|
55
|
+
readonly sandboxPolicy?: unknown;
|
|
56
|
+
}
|
|
57
|
+
/** 单次程序沙箱提权的请求入参。 */
|
|
58
|
+
export interface SandboxEscalationInput {
|
|
59
|
+
/** 目标沙箱模式。 */
|
|
60
|
+
readonly requestedMode: EscalationTargetMode;
|
|
61
|
+
/** 模型给出的单句理由。 */
|
|
62
|
+
readonly justification: string;
|
|
63
|
+
/** 会话当前的生效策略对象。 */
|
|
64
|
+
readonly standingPolicy: unknown;
|
|
65
|
+
/** 调用方 agent。 */
|
|
66
|
+
readonly agent: unknown;
|
|
67
|
+
/** 本次外层调用 id。 */
|
|
68
|
+
readonly callId: string;
|
|
69
|
+
/** 传输工具名。 */
|
|
70
|
+
readonly toolName: string;
|
|
71
|
+
/** 取消信号。 */
|
|
72
|
+
readonly signal: AbortSignal;
|
|
73
|
+
}
|
|
74
|
+
/** 程序的运行环境句柄:由入口提供,传输层只调用。 */
|
|
75
|
+
export interface CodemodeHost {
|
|
76
|
+
/** 当前可调用的工具清单(含被遮蔽的)。 */
|
|
77
|
+
catalog(): readonly CatalogEntry[];
|
|
78
|
+
/** 执行一次子调用(内部走 `ctx.tools.execute()`)。 */
|
|
79
|
+
callTool(request: CallToolRequest): Promise<CallToolOutcome>;
|
|
80
|
+
/** 读 PTC 运行时(结构探测)。 */
|
|
81
|
+
runtime(): PtcRuntimeLike | undefined;
|
|
82
|
+
/** 常驻环境的 owner(缺省用调用方 agent 当 owner)。 */
|
|
83
|
+
stateOwner(agent: unknown): object;
|
|
84
|
+
/** 程序结束时释放 owner 的常驻环境。 */
|
|
85
|
+
releaseOwner(owner: object): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* 取这次运行的会话级授权(目录 + 文件策略)。
|
|
88
|
+
*
|
|
89
|
+
* 老代 harness 没有 `sandboxPolicy` / `workingDirectory` 服务,此时返回 `undefined`,
|
|
90
|
+
* 由 `runtime.resolve()` 或运行时自身兜底即可。
|
|
91
|
+
*/
|
|
92
|
+
runAuthority?(agent: unknown, signal: AbortSignal): Promise<RunAuthority | undefined> | RunAuthority | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* 审批并应用单次沙箱提权(返回替换了 `mode` 的新策略对象)。
|
|
95
|
+
*/
|
|
96
|
+
escalateSandbox?(input: SandboxEscalationInput): Promise<unknown>;
|
|
97
|
+
/**
|
|
98
|
+
* 将携带图片块的子调用内容包装成可投递给 `exec.deferContext` 的合法用户消息。
|
|
99
|
+
*/
|
|
100
|
+
createImageContext?(content: readonly unknown[]): unknown;
|
|
101
|
+
}
|
|
102
|
+
/** 一次子调用请求。 */
|
|
103
|
+
export interface CallToolRequest {
|
|
104
|
+
/** 工具名。 */
|
|
105
|
+
readonly name: string;
|
|
106
|
+
/** 已校验的参数对象。 */
|
|
107
|
+
readonly args: unknown;
|
|
108
|
+
/** 子调用 id(`<outer>:ptc:<n>`)。 */
|
|
109
|
+
readonly callId: string;
|
|
110
|
+
/** 取消信号(已带嵌套标记)。 */
|
|
111
|
+
readonly signal: AbortSignal;
|
|
112
|
+
/** 调用方 agent。 */
|
|
113
|
+
readonly agent: unknown;
|
|
114
|
+
/** 步骤准入集合。 */
|
|
115
|
+
readonly toolSet: unknown;
|
|
116
|
+
}
|
|
117
|
+
/** 一次子调用的结果。 */
|
|
118
|
+
export interface CallToolOutcome {
|
|
119
|
+
/** 失败时的错误文本。 */
|
|
120
|
+
readonly error?: string;
|
|
121
|
+
/** 成功时的值。 */
|
|
122
|
+
readonly value?: unknown;
|
|
123
|
+
/** 成功时的文本内容(没有 value 时用它)。 */
|
|
124
|
+
readonly text?: string;
|
|
125
|
+
/**
|
|
126
|
+
* 面向前模型的内容块,原样进回放事件。
|
|
127
|
+
*
|
|
128
|
+
* 程序拿的是 `value` / `text`,这两条是给**界面**与**图片附件传递**的。
|
|
129
|
+
*/
|
|
130
|
+
readonly content?: readonly unknown[];
|
|
131
|
+
/** 工具自带的展示元数据,原样进回放事件。 */
|
|
132
|
+
readonly meta?: unknown;
|
|
133
|
+
/** 失败身份(名称 / 业务码 / 原始细节),原样进回放事件。 */
|
|
134
|
+
readonly errorInfo?: {
|
|
135
|
+
readonly name: string;
|
|
136
|
+
readonly code: string;
|
|
137
|
+
readonly reason?: string;
|
|
138
|
+
};
|
|
139
|
+
/** 子调用产生的延迟上下文(如催促消息),转交给外层步骤。 */
|
|
140
|
+
readonly additionalContexts?: readonly unknown[];
|
|
141
|
+
/** 子调用是否要求结束当前回合(如用户撤回审批)。 */
|
|
142
|
+
readonly concluded?: boolean;
|
|
143
|
+
}
|
|
144
|
+
/** 一次运行请求(也覆盖 {@link PtcRuntimeLike.resolve} 的产物)。 */
|
|
145
|
+
export interface PtcRunRequestLike {
|
|
146
|
+
/** 程序源码。 */
|
|
147
|
+
readonly program: string;
|
|
148
|
+
/** 程序里可见的绑定命名空间。 */
|
|
149
|
+
readonly bindings: readonly unknown[];
|
|
150
|
+
/** 常驻环境的 owner。 */
|
|
151
|
+
readonly stateOwner?: object;
|
|
152
|
+
/** 程序起点目录。 */
|
|
153
|
+
readonly cwd?: string;
|
|
154
|
+
/** 已解析的文件策略(DSH 0.2.2 起 `run()` 只接受 resolve() 的产物)。 */
|
|
155
|
+
readonly sandboxPolicy?: unknown;
|
|
156
|
+
/** 超时预算;`null` 表示不限。 */
|
|
157
|
+
readonly timeoutMs?: number | null;
|
|
158
|
+
/** 取消信号。 */
|
|
159
|
+
readonly signal?: AbortSignal;
|
|
160
|
+
}
|
|
161
|
+
/** PTC 运行时里本模块会读到的那部分(结构契约)。 */
|
|
162
|
+
export interface PtcRuntimeLike {
|
|
163
|
+
/** 源码语言(`typescript` / `python`)。 */
|
|
164
|
+
readonly language?: string;
|
|
165
|
+
/** 程序形态(`function-body` / `repl`)。 */
|
|
166
|
+
readonly programFormat?: string;
|
|
167
|
+
/** 运行时附加的执行说明文本。 */
|
|
168
|
+
readonly executionInstructions?: string;
|
|
169
|
+
/** 运行时是否执行沙箱隔离(非 `undefined` 表示启用)。 */
|
|
170
|
+
readonly sandboxMode?: unknown;
|
|
171
|
+
/** 运行时是否保留跨次执行状态。 */
|
|
172
|
+
readonly retainsState?: boolean;
|
|
173
|
+
/** 超时预算。 */
|
|
174
|
+
readonly timeout?: {
|
|
175
|
+
readonly defaultMs: number;
|
|
176
|
+
readonly maxMs: number;
|
|
177
|
+
};
|
|
178
|
+
/** 常驻状态释放。 */
|
|
179
|
+
release?(owner: object): Promise<void>;
|
|
180
|
+
/**
|
|
181
|
+
* 解析目录、超时与文件策略。
|
|
182
|
+
*
|
|
183
|
+
* DSH 0.2.2 起内核把「解析」与「执行」拆开:`run()` 只接受这一步的产物,直接喂原始请求
|
|
184
|
+
* 会抛 `ptc-runtime-node: run requires a resolved sandbox policy`。老代运行时没有这个方法,
|
|
185
|
+
* 那时 `run()` 自己兜底。
|
|
186
|
+
*/
|
|
187
|
+
resolve?(request: PtcRunRequestLike): PtcRunRequestLike;
|
|
188
|
+
/** 执行一段程序。 */
|
|
189
|
+
run(request: PtcRunRequestLike): Promise<PtcRunResultLike>;
|
|
190
|
+
}
|
|
191
|
+
/** 沙箱执行状态摘要。 */
|
|
192
|
+
export interface PtcSandboxSummary {
|
|
193
|
+
readonly mode: string;
|
|
194
|
+
readonly denied: boolean;
|
|
195
|
+
readonly enforcement?: 'full' | 'partial';
|
|
196
|
+
}
|
|
197
|
+
/** 一次程序运行的结果。 */
|
|
198
|
+
export interface PtcRunResultLike {
|
|
199
|
+
/** 程序返回值。 */
|
|
200
|
+
readonly value?: unknown;
|
|
201
|
+
/** 捕获的输出。 */
|
|
202
|
+
readonly logs: readonly string[];
|
|
203
|
+
/** 失败信息。 */
|
|
204
|
+
readonly error?: {
|
|
205
|
+
readonly kind: string;
|
|
206
|
+
readonly message: string;
|
|
207
|
+
};
|
|
208
|
+
/** 文件策略与观察到的拒绝。 */
|
|
209
|
+
readonly sandbox?: PtcSandboxSummary;
|
|
210
|
+
}
|
|
211
|
+
/** 一次传输调用的规范化结果。 */
|
|
212
|
+
export interface TransportOutput {
|
|
213
|
+
/** 程序捕获的输出。 */
|
|
214
|
+
readonly logs: readonly string[];
|
|
215
|
+
/** 程序返回值。 */
|
|
216
|
+
readonly result?: unknown;
|
|
217
|
+
/** 文件沙箱观察。 */
|
|
218
|
+
readonly sandbox?: PtcSandboxSummary;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* 造 `code_run` 的工具定义。
|
|
222
|
+
*
|
|
223
|
+
* @param host - 运行环境句柄。
|
|
224
|
+
* @param rules - 已归一化的规则。
|
|
225
|
+
* @returns 可直接交给 `ctx.tools.register()` 的原始定义。
|
|
226
|
+
*/
|
|
227
|
+
export declare function createTransportDefinition(host: CodemodeHost, rules: CodemodeRules): {
|
|
228
|
+
name: string;
|
|
229
|
+
description: string;
|
|
230
|
+
parameters: Record<string, unknown>;
|
|
231
|
+
output: {
|
|
232
|
+
schema: {
|
|
233
|
+
type: string;
|
|
234
|
+
additionalProperties: boolean;
|
|
235
|
+
required: string[];
|
|
236
|
+
properties: {
|
|
237
|
+
logs: {
|
|
238
|
+
type: string;
|
|
239
|
+
items: {
|
|
240
|
+
type: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
result: {};
|
|
244
|
+
sandbox: {
|
|
245
|
+
type: string;
|
|
246
|
+
additionalProperties: boolean;
|
|
247
|
+
required: string[];
|
|
248
|
+
properties: {
|
|
249
|
+
mode: {
|
|
250
|
+
type: string;
|
|
251
|
+
};
|
|
252
|
+
denied: {
|
|
253
|
+
type: string;
|
|
254
|
+
};
|
|
255
|
+
enforcement: {
|
|
256
|
+
type: string;
|
|
257
|
+
enum: string[];
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
render: (_args: unknown, value: TransportOutput) => {
|
|
264
|
+
type: string;
|
|
265
|
+
text: string;
|
|
266
|
+
}[];
|
|
267
|
+
presentationMeta: () => {
|
|
268
|
+
language: string;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
presentCall(args: unknown): {
|
|
272
|
+
card: "generic";
|
|
273
|
+
title: string;
|
|
274
|
+
kind: "execute";
|
|
275
|
+
rawInput: string;
|
|
276
|
+
} | undefined;
|
|
277
|
+
execute(args: unknown, exec: TransportExecution): Promise<TransportOutput>;
|
|
278
|
+
};
|
|
279
|
+
/** 一次传输调用的执行上下文(结构描述)。 */
|
|
280
|
+
export interface TransportExecution {
|
|
281
|
+
/** 本次调用的 id。 */
|
|
282
|
+
readonly callId: string;
|
|
283
|
+
/** 取消信号。 */
|
|
284
|
+
readonly signal: AbortSignal;
|
|
285
|
+
/** 调用方 agent。 */
|
|
286
|
+
readonly agent?: unknown;
|
|
287
|
+
/** 步骤准入集合。 */
|
|
288
|
+
readonly toolSet?: unknown;
|
|
289
|
+
/** 附加延迟上下文(图片块、催促通知等)。 */
|
|
290
|
+
deferContext?(message: unknown): void;
|
|
291
|
+
/** 请求在当前批结算后结束回合。 */
|
|
292
|
+
concludeTurn?(): void;
|
|
293
|
+
}
|
|
294
|
+
/** 校验单次沙箱提权参数配对(对齐 `@deepseek-ai/dsh-sandbox` 的 `validateEscalationArgs`)。 */
|
|
295
|
+
export declare function validateEscalationArgs(sandboxPermissions: unknown, justification: unknown): {
|
|
296
|
+
sandboxPermissions?: EscalationTargetMode;
|
|
297
|
+
justification?: string;
|
|
298
|
+
};
|
|
299
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../src/host/codemode/transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAc/C;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,SAAS,YAAY,EAAE,GAAG,SAAS,CAE5E;AAED,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,aAAa,CAAA;AAE7C,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,oDAAoE,CAAA;AACnG,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAStE,iCAAiC;AACjC,MAAM,WAAW,YAAY;IAC3B,WAAW;IACX,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,eAAe;IACf,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,wBAAwB;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,gCAAgC;IAChC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAA;CACxD;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,gBAAgB;IAChB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,eAAe;IACf,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CACjC;AAED,qBAAqB;AACrB,MAAM,WAAW,sBAAsB;IACrC,cAAc;IACd,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAA;IAC5C,iBAAiB;IACjB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,mBAAmB;IACnB,QAAQ,CAAC,cAAc,EAA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B,aAAa,EAAE,OAAO,GACrB;IAAE,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,CAoBvE"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { AttachmentStore } from '@deepseek-ai/dsh-attachment';
|
|
2
2
|
import { OAuthService } from './oauth-service.ts';
|
|
3
3
|
type FetchLike = typeof fetch;
|
|
4
|
+
/**
|
|
5
|
+
* Output canvases the Codex image endpoint accepts in `size`.
|
|
6
|
+
*
|
|
7
|
+
* These are the official client's own three canvases plus the default `auto`,
|
|
8
|
+
* which lets the service pick. A size outside this set is not negotiated: the
|
|
9
|
+
* backend answers it with a 400, so the tool refuses it before the request.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CODEX_IMAGE_SIZES: readonly ["auto", "1024x1024", "1536x1024", "1024x1536"];
|
|
12
|
+
/** Render effort the endpoint accepts in `quality`; `auto` is the service's own default. */
|
|
13
|
+
export declare const CODEX_IMAGE_QUALITIES: readonly ["auto", "low", "medium", "high"];
|
|
14
|
+
/** Reference images one edit request may carry. */
|
|
15
|
+
export declare const MAX_CODEX_REFERENCE_IMAGES = 5;
|
|
4
16
|
export interface CodexImageToolOptions {
|
|
5
17
|
fetchFn?: FetchLike;
|
|
6
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-images.d.ts","sourceRoot":"","sources":["../../../src/host/codex-images.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex-images.d.ts","sourceRoot":"","sources":["../../../src/host/codex-images.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAsC,MAAM,6BAA6B,CAAA;AAWtG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIjD,KAAK,SAAS,GAAG,OAAO,KAAK,CAAA;AAE7B;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,0DAA2D,CAAA;AAEzF,4FAA4F;AAC5F,eAAO,MAAM,qBAAqB,4CAA6C,CAAA;AAE/E,mDAAmD;AACnD,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAc3C,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB;AAoED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,eAAe,EAC5B,OAAO,GAAE,qBAA0B,mDA+MpC"}
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
* `deepseek/deepseek-v4.1-flash` and `deepseek/deepseek-v4-flash-vision-exp` take
|
|
22
22
|
* images, and `z-ai/glm-5.3-flash` takes images while `zai-org/GLM-5.3` does not.
|
|
23
23
|
*
|
|
24
|
-
* THE TABLE BELOW is the registry `command-code@1.88.
|
|
25
|
-
* bundle (`dist/cli.mjs`), transcribed in full:
|
|
24
|
+
* THE TABLE BELOW is the registry `command-code@1.88.4` embeds in its CLI
|
|
25
|
+
* bundle (`dist/cli.mjs`), transcribed in full: 109 entries, in registry order.
|
|
26
26
|
* The redacted snapshot of that registry is checked in under
|
|
27
27
|
* `test/fixtures/command-code/official-model-catalog.json`, and
|
|
28
28
|
* `test/command-code-model-catalog.test.ts` compares this table against it
|
|
@@ -73,18 +73,18 @@ export declare const COMMAND_CODE_MODELS: readonly CommandCodeModelDef[];
|
|
|
73
73
|
/** Registry entry for one model id, or undefined when it describes no such model. */
|
|
74
74
|
export declare function commandCodeModelDef(modelId: string): CommandCodeModelDef | undefined;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
76
|
+
* One catalog refresh's changes to the shipped default selection, newest first.
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* from the previous release look edited, and the models this release adds
|
|
83
|
-
* would stay hidden behind a list nobody touched. These two lists carry that
|
|
84
|
-
* change: the retired ids are the ones the previous default had and this one
|
|
85
|
-
* does not, and the added ids are the ones it gained.
|
|
78
|
+
* Applying these in order reconstructs every earlier unedited selection: remove
|
|
79
|
+
* the ids that refresh added, then restore the ids it retired. Keeping each
|
|
80
|
+
* generation separate matters once two refreshes have shipped; folding their
|
|
81
|
+
* additions into one list would skip the intermediate default entirely.
|
|
86
82
|
*/
|
|
87
|
-
export
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
export interface ShippedDefaultMigration {
|
|
84
|
+
version: string;
|
|
85
|
+
added: readonly string[];
|
|
86
|
+
retired: readonly string[];
|
|
87
|
+
}
|
|
88
|
+
/** Default-selection deltas recognized by `resolveEnabledModelIds` in `./routes.ts`. */
|
|
89
|
+
export declare const SHIPPED_DEFAULT_MIGRATIONS: readonly ShippedDefaultMigration[];
|
|
90
90
|
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/command-code/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAE3D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,eAAe,EAAE,mBAAmB,EAAE,CAAA;IACtC,sEAAsE;IACtE,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,kEAAkE;IAClE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,2FAA2F;IAC3F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,EAAE,SAAS,mBAAmB,
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/command-code/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAE3D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,eAAe,EAAE,mBAAmB,EAAE,CAAA;IACtC,sEAAsE;IACtE,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,kEAAkE;IAClE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,2FAA2F;IAC3F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,EAAE,SAAS,mBAAmB,EAs9B7D,CAAA;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAEpF;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAC3B;AAED,wFAAwF;AACxF,eAAO,MAAM,0BAA0B,EAAE,SAAS,uBAAuB,EAmCxE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../src/host/command-code/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,EAAmB,WAAW,EAAE,aAAa,EAAqC,MAAM,YAAY,CAAA;AAG3G,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,KAA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uF;IACvF,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAA;IAChD;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAA;IACpC,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAMD,mFAAmF;AACnF,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,mBAAmB,EAC1B,aAAa,EAAE,sBAAsB,EACrC,WAAW,CAAC,EAAE,0BAA0B,EACxC,OAAO,GAAE,wBAA6B,EACtC,WAAW,GAAE,sBAAsB,GAAG,SAA+B,GACpE,OAAO,CAAC,oBAAoB,CAAC,CA+E/B;AAED,2EAA2E;AAC3E,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,mBAAmB,EAC1B,aAAa,EAAE,sBAAsB,EACrC,WAAW,CAAC,EAAE,0BAA0B,EACxC,OAAO,GAAE,wBAA6B,EACtC,WAAW,GAAE,sBAAsB,GAAG,SAA+B,GACpE,MAAM,IAAI,CAkPZ;AAED,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -45,13 +45,27 @@ export declare function candidatePackageRoots(entryScript?: string | undefined):
|
|
|
45
45
|
/**
|
|
46
46
|
* Whether a package or exported subpath is installed in any candidate node_modules tree.
|
|
47
47
|
* A subpath needs its own exact `exports` key; the package root alone is not enough.
|
|
48
|
+
*
|
|
49
|
+
* The nearest manifest on each Node resolution chain is authoritative. Looking
|
|
50
|
+
* farther out after that manifest rejects a subpath would let an unrelated old
|
|
51
|
+
* installation resurrect an export the running package deliberately removed.
|
|
48
52
|
*/
|
|
49
53
|
export declare function packageInstalled(specifier: string, roots?: readonly string[]): boolean;
|
|
54
|
+
/** One module-resolution attempt, injectable so stale-tree cases are testable. */
|
|
55
|
+
type ModuleResolver = (specifier: string) => unknown;
|
|
56
|
+
/**
|
|
57
|
+
* Resolve against the installation that will actually mount the preset.
|
|
58
|
+
*
|
|
59
|
+
* `import.meta.resolve` is based at this plugin, while the harness mounts
|
|
60
|
+
* runtime-declared preset rows from its own context. A successful plugin-side
|
|
61
|
+
* resolution is therefore not sufficient for a harness package: an old copy in
|
|
62
|
+
* the profile tree must not override the running harness's missing export.
|
|
63
|
+
* Plugin-owned rows and the plugin-borne native executor are the deliberate
|
|
64
|
+
* exceptions. With no harness entry, retain the legacy local probe behavior.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolvesFromInstallation(specifier: string, entryScript: string | undefined, resolveFromPlugin: ModuleResolver | undefined): boolean;
|
|
50
67
|
/**
|
|
51
|
-
* Whether a bare specifier resolves
|
|
52
|
-
* installation. A harness whose Node build exposes no `import.meta.resolve`
|
|
53
|
-
* or whose plugin is executed from outside the profile tree falls through to
|
|
54
|
-
* checking candidate `node_modules` trees across the running harness home.
|
|
68
|
+
* Whether a bare specifier resolves in the installation that mounts presets.
|
|
55
69
|
* @param specifier - bare package specifier.
|
|
56
70
|
* @returns whether the specifier resolves.
|
|
57
71
|
*/
|
|
@@ -143,4 +157,5 @@ export declare function syncPresetTrees(sourceRoot: string, targetRoot: string,
|
|
|
143
157
|
* @returns the effect body's disposer, for `ctx.effect`.
|
|
144
158
|
*/
|
|
145
159
|
export declare function installBundledPresets(host: PresetHost, install: PresetInstall): () => void;
|
|
160
|
+
export {};
|
|
146
161
|
//# sourceMappingURL=preset-sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-sync.d.ts","sourceRoot":"","sources":["../../../src/host/preset-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAElE,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAiB,CAAA;
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AA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,iBACY,CAAA;AAE5C,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,mDAAmD;IACnD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,iEAAiE;IACjE,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACvC,2EAA2E;IAC3E,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAQpC;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD;AA0FD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAa,GAChD,QAAQ,GAAG,SAAS,CA+CtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,GAAE,SAAS,MAAM,EAAO,EAC9B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,gBAAgB,CAiClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,IAAI,CAiB1F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eddyskywalker/dsh-chatgpt-subscription",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "DSH provider plugin for Codex access through a ChatGPT subscription.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"author": {
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
"./tool-result-pruner": {
|
|
62
62
|
"types": "./lib/types/entry-tool-result-pruner.d.ts",
|
|
63
63
|
"default": "./lib/tool-result-pruner.js"
|
|
64
|
+
},
|
|
65
|
+
"./codemode": {
|
|
66
|
+
"types": "./lib/types/entry-codemode.d.ts",
|
|
67
|
+
"default": "./lib/codemode.js"
|
|
64
68
|
}
|
|
65
69
|
},
|
|
66
70
|
"dsh": {
|
|
@@ -170,6 +174,7 @@
|
|
|
170
174
|
"typecheck": "tsc -b --pretty false && tsc -p test/tsconfig.json --pretty false && tsc -p scripts/tsconfig.json --pretty false"
|
|
171
175
|
},
|
|
172
176
|
"dependencies": {
|
|
177
|
+
"@deepseek-ai/dsh-tool-executor-native": "^0.2.2-rc.1",
|
|
173
178
|
"katex": "^0.18.7",
|
|
174
179
|
"mermaid": "^11.17.2",
|
|
175
180
|
"undici": "^8.10.0",
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
# 调度模式(dispatch)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
基于 **Code Mode** 的调度 Agent:本预设自己注册的工具保持原生可调(schema 不变),
|
|
4
|
+
预设清单以外的一切(MCP 服务端工具、profile 级插件工具、按 agent 注册的工具集)不进入模型
|
|
5
|
+
上下文,只能在 `code_run` 程序里用 `code_tools_search` 现查现调。改变的是**身份与流程纪律**。
|
|
6
|
+
|
|
7
|
+
> 内核的 `ptc` 呈现方式只把 `run_code` 交给模型、其余名字一律硬拒,`standard` 又完全没有程序
|
|
8
|
+
> 传输;「原生工具 + 程序」这个组合在内核里表达不出来,所以本预设自带一行 `code-mode`
|
|
9
|
+
> (`@eddyskywalker/dsh-chatgpt-subscription/codemode`)。代次上不可用原生 executor 时,
|
|
10
|
+
> `resolveDispatchPreset` 会自动退回 PTC 呈现(见 `src/host/agent-preset.ts`)。
|
|
11
|
+
|
|
12
|
+
> **缓存前提**:Code Mode 的说明段是**恒定文本**(不含任何遮蔽计数或 namespace 清单),
|
|
13
|
+
> 加上既有的 `ptc-sdk-cache-guard`,kimi-code / minimax-code 的前缀缓存不因 MCP 增删而失效。
|
|
5
14
|
|
|
6
15
|
## 运行骨架
|
|
7
16
|
|
|
@@ -24,7 +33,7 @@
|
|
|
24
33
|
| R0 | 先分诊,按复杂度决定是否展开重治理流程;绝不为 L0/L1 开启完整访谈或计划模式 |
|
|
25
34
|
| R0.5 | 兼容性闸门(每个新会话一次):判据**只有** `spawn_teammate` 是否在场——在场才说明跑的是旧代 team 运行时(它顶替协调工具),此时停下交用户决策;现行 team 只加共享任务板,与调度并行 |
|
|
26
35
|
| R-G | L2 规划前必须做澄清访谈:设计树 / 前沿 / 轮次,每题给推荐答案,事实自己查、决策交用户,前沿为空且用户确认后才进入规划 |
|
|
27
|
-
| R1 | L2 执行拓扑按「耦合度 × 并行收益」三选一:`Lead-Core`(紧耦合跨模块由主代理连续直执)、`Hybrid`(主代理先冻结公共契约再并行外包下游)、`Fan-out`(3+
|
|
36
|
+
| R1 | L2 执行拓扑按「耦合度 × 并行收益」三选一:`Lead-Core`(紧耦合跨模块由主代理连续直执)、`Hybrid`(主代理先冻结公共契约再并行外包下游)、`Fan-out`(3+ 正交子任务并行编排);单次生图、改提示词和重试由当前代理直接调用工具,只有独立多方案或更复杂创意任务才委派 |
|
|
28
37
|
| R2 | 允许清单唯一真源是 `list_subagent_models`(`{}` → `{ provider }`);派发必须显式给出拆开的 `provider` 与 `model`,直接采信工具返回值,无需去翻本地配置或代码核对 |
|
|
29
38
|
| R3 | 子代理对自己的模块拥有规划/执行/自检自治权 |
|
|
30
39
|
| R4 | 子代理使用 DSH 默认子代理角色;选模型的权力只在主代理 |
|
|
@@ -88,9 +97,7 @@ R6 验收与 R-W 等待;R0.5 只靠 `spawn_teammate` 判代,**不能**用 `w
|
|
|
88
97
|
claim/complete。任务 ready 不等于开工,也不许用 `reassign` 把任务挪走以绕开 R6 验收。R0.5 在缺席判据
|
|
89
98
|
下会先写一行 `Orchestration ready: subagent`,把当前模式打在第一行。
|
|
90
99
|
|
|
91
|
-
**缓存侧的两个注意点**:
|
|
92
|
-
(`ptc-sdk-cache-guard`),所以 `team_task_*` 在 SDK 里**常驻可见**、与开关无关——可见不等于可调用,
|
|
93
|
-
要以 `team_task_list` 能否调通为准。反过来,开关本身会让 `team:policy` 段从空串变成整段文本,
|
|
100
|
+
**缓存侧的两个注意点**:Code Mode 下 `team_task_*` 属于全局层工具,只存在于 `code_run` 程序清单里(旧代回退 PTC 时则在冻结的 `tools:sdk` 里常驻可见)——无论哪种呈现,在清单里存在都不等于开关已打开,要以在 `code_run` 内调用 `team_task_list` 能否调通为准。反过来,开关本身会让 `team:policy` 段从空串变成整段文本,
|
|
94
101
|
system prompt 因此改写一次;这与计划模式当初刻意用"尾部用户消息"规避的是同一类重建,只是这段文本
|
|
95
102
|
由 harness 拥有。建议在**首个回合之前**决定 team 开关:开会话时就是目标状态则零成本,中途切换付一次前缀重建。
|
|
96
103
|
插件默认开启的 `teamPolicyCacheGuard` 让这唯一一次重建也消失:守卫把 `team:policy` 段从装配里
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
# The `dispatch` (调度模式) agent preset:
|
|
1
|
+
# The `dispatch` (调度模式) agent preset: Code Mode presented for an ORCHESTRATOR.
|
|
2
2
|
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
3
|
+
# Built on Code Mode (`./codemode`): this preset's own tools stay natively
|
|
4
|
+
# callable while MCP and external plugin tools stay reachable inside `code_run`
|
|
5
|
+
# (falling back to PTC `run_code` on older harnesses). What this file changes is
|
|
6
|
+
# identity and planning discipline:
|
|
5
7
|
#
|
|
6
8
|
# 1. persona — the agent is a dispatcher. It triages task complexity first
|
|
7
9
|
# (L0/L1/L2), interviews the user to settle requirements before planning an
|
|
@@ -64,8 +66,8 @@
|
|
|
64
66
|
|
|
65
67
|
## R0.5 · Compatibility Gate (Once per New Session, Before R0)
|
|
66
68
|
A legacy Agent Teams runtime (pre-#7519) registers spawn_teammate and replaces send_message / list_agents / interrupt_agent with team-scoped variants, leaving spawned subagents unreachable. The current runtime only adds a shared task board (team_task_create and its list/get/update siblings) and reuses this mode's tools.
|
|
67
|
-
Criterion: whether spawn_teammate exists (
|
|
68
|
-
- Absent -> Write "Orchestration ready: subagent" and proceed to R0. The board tools stay
|
|
69
|
+
Criterion: whether spawn_teammate exists (check via code_run). Never gate on wait_agent, send_message, list_agents, or interrupt_agent: this mode mounts those itself.
|
|
70
|
+
- Absent -> Write "Orchestration ready: subagent" and proceed to R0. The board tools stay declared whether or not the board is on - frozen declaration, not availability - so confirm with team_task_list before relying on it. When the board is on it is bookkeeping, not a second dispatcher: the dispatch ledger stays the dispatch authority and R5 briefs stay the task contract; publish cross-agent dependencies (blocked_by) and write scopes on one team task per brief, claimed and completed by the child that owns it; never start work because a task is ready, and never reassign a task to skip R6.
|
|
69
71
|
- Present -> This session runs the legacy runtime and is **not orchestratable**. In order, and nothing else:
|
|
70
72
|
1. State in one sentence that the legacy runtime shadows the coordination tools and this mode has no degraded path.
|
|
71
73
|
2. Call ask_user_question once (see R-W) offering: disable the legacy runtime, restart Host, **start a new session**; switch preset; or execute this task directly.
|
|
@@ -92,9 +94,10 @@
|
|
|
92
94
|
- Lead-Core: tightly coupled cross-module/contract changes or sequential chains where splitting duplicates reads or causes hand_back loops. -> Implement directly in continuous steps (track in todo_write, no self-briefs) and run R6 verification.
|
|
93
95
|
- Hybrid: unsettled shared contracts/seams plus orthogonal downstream work. -> Implement & freeze core seams yourself first, then delegate orthogonal adapters/tests/noisy exploration per R2/R5 (or subagent_fork for warm-context isolation).
|
|
94
96
|
- Fan-out: >=3 orthogonal subtasks with disjoint files, settled interfaces, and clear parallel/routing gain. -> Coordinate (plan, R2/R5 dispatch, R6 review/acceptance, docs, non-delegable or disjoint parallel modules); never edit an active child's Boundary.
|
|
97
|
+
- [Media generation] Generate/revise/retry images directly; delegate complex creative work, never a bare call.
|
|
95
98
|
|
|
96
99
|
## R2 · Model Routing (Check Availability First, Then Decide How to Dispatch)
|
|
97
|
-
Check whether list_subagent_models exists
|
|
100
|
+
Check whether list_subagent_models exists. The tool row and provider/model/reasoning_effort parameters are mounted statically, so they are present even in a session that authorized no route at all. Read that fact instead of inferring it from the tool's output:
|
|
98
101
|
- If the output says neither—no authorized-routes block and no "No allowlist is in force" sentence—the annotation is absent and you cannot read the posture. Treat it as [State: Unlisted] for behaviour, but say "unconfirmed" rather than claiming either posture, and never report a route as authorized.
|
|
99
102
|
- [State: Listed] Output ends with "Authorized child routes for this Session": enforcement is active.
|
|
100
103
|
- The sole source of truth for the allowlist is list_subagent_models: call list_subagent_models({}) to list authorized providers, and call list_subagent_models({ provider }) to list authorized models under that provider; trust its output directly without cross-checking local config files or workspace code (even if upstream tool text says "Catalog membership is advisory", the runtime output is already filtered to this session's allowlist).
|
|
@@ -110,7 +113,7 @@
|
|
|
110
113
|
Every task brief covers six elements: Goal / Boundary (which files or modules may be touched) / Constraints / Limits (see below) / Acceptance Criteria / Required Evidence to Report.
|
|
111
114
|
- [Compact Delta Brief] Standing default limits and the report schema already live in [Role Identification], so use a Compact Delta Brief by default: state Goal, original file/line Source Pointers (do not paraphrase code into long prose), Module-Interface Boundary, Constraints, Acceptance Criteria, and Required Evidence, and omit repeating standing limits unless overriding them.
|
|
112
115
|
- [Limits] When overriding any standing limit, write one line per limit spelling out four things: **what it bounds, in what unit, the cap, and whether it accumulates**. Write explicit caps ("at most 3 attempts", "edits at most 5 files", "test runs: unlimited"), never ranges ("2–5 files"); where an override dimension is left unstated, silence is read as a limit of zero, and a quota that resets per cycle is lost, not banked.
|
|
113
|
-
- Do not ask the child to restate your rules back as a correctness check; if a limit is genuinely unclear, instruct the child to spend one minimal tool call to verify it. Dispatch independent tasks concurrently in one message (
|
|
116
|
+
- Do not ask the child to restate your rules back as a correctness check; if a limit is genuinely unclear, instruct the child to spend one minimal tool call to verify it. Dispatch independent tasks concurrently in one message (native calls; use code_run Promise.all for batch filter/MCP) only after the interview has converged.
|
|
114
117
|
|
|
115
118
|
## R6 · Review & Acceptance
|
|
116
119
|
Two layers: subagent self-check -> your independent review (reading diffs, running tests, checking each criterion). The completion notification is a post-hoc signal: it tells you a child stopped, not that the work passed.
|
|
@@ -421,15 +424,15 @@
|
|
|
421
424
|
|
|
422
425
|
# ── presentation ────────────────────────────────────────────────────────────
|
|
423
426
|
|
|
424
|
-
#
|
|
425
|
-
#
|
|
426
|
-
#
|
|
427
|
-
#
|
|
428
|
-
#
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
427
|
+
# Code Mode for this agent alone: the rows above stay natively callable, and
|
|
428
|
+
# everything this preset does not own (MCP servers, profile-level plugins,
|
|
429
|
+
# per-agent tool sets) is reachable only from inside `code_run`. The row brings
|
|
430
|
+
# its own executor, so no `tool-executor-ptc` row is mounted beside it — one
|
|
431
|
+
# executor per scope. resolveDispatchPreset swaps this row back to the PTC
|
|
432
|
+
# executor (or the deprecated presentation row) on generations without
|
|
433
|
+
# @deepseek-ai/dsh-tool-executor-native.
|
|
434
|
+
- id: code-mode
|
|
435
|
+
name: '@eddyskywalker/dsh-chatgpt-subscription/codemode'
|
|
433
436
|
|
|
434
437
|
# `present` ships from harness 0.1.5-alpha.2. On an earlier installation the
|
|
435
438
|
# sync disables this row rather than leave the whole preset unresolvable, and
|