@sema-agent/sdk 42.0.0 → 44.0.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 +118 -2
- package/dist/bitless-surfaces.d.ts +6 -1
- package/dist/bitless-surfaces.d.ts.map +1 -1
- package/dist/bitless-surfaces.js +13 -4
- package/dist/bitless-surfaces.js.map +1 -1
- package/dist/errors.d.ts +12 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -2
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +63 -25
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +2 -2
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model-route-env/index.d.ts +2 -2
- package/dist/model-route-env/index.js +1 -1
- package/dist/model-route-env/index.js.map +1 -1
- package/dist/resources/approvals.d.ts +8 -0
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/runs.d.ts +4 -3
- package/dist/resources/runs.d.ts.map +1 -1
- package/dist/resources/runs.js +4 -3
- package/dist/resources/runs.js.map +1 -1
- package/dist/resources/sessions.d.ts +3 -3
- package/dist/resources/sessions.js +2 -2
- package/dist/resources/tasks.d.ts +5 -2
- package/dist/resources/tasks.d.ts.map +1 -1
- package/dist/resources/tasks.js +5 -2
- package/dist/resources/tasks.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +11 -6
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js +3 -2
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/settings.d.ts +8 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/transport.d.ts +3 -0
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +4 -0
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +189 -20
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +26 -3
- package/dist/types.js.map +1 -1
- package/openapi.yaml +246 -33
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1162,10 +1162,17 @@ export interface TaskAgentDefinition {
|
|
|
1162
1162
|
* 后一半在**应答时刻**读,而行是更早铸的 ⇒ 运维热改治理旋钮会让老行的归因两个方向都可能漂。
|
|
1163
1163
|
* 它不参与任何门/决策路径,只供展示。
|
|
1164
1164
|
*/
|
|
1165
|
+
/** `checkpointIdMissing` 的闭集两词(server ≥7.154.0;server 自铸登记 `checkpointIdMissingWord`,逐位同序):`absent` = 这一行没有可读的门身份,`untrusted` = 有但没过身份判官(形不对 / 含能力键)。 */
|
|
1166
|
+
export declare const CHECKPOINT_ID_MISSING_WORDS: readonly ["absent", "untrusted"];
|
|
1167
|
+
export type CheckpointIdMissingWord = (typeof CHECKPOINT_ID_MISSING_WORDS)[number];
|
|
1165
1168
|
export interface PendingGateMaterial {
|
|
1166
1169
|
kind: string;
|
|
1167
1170
|
decidePath: string;
|
|
1168
1171
|
governanceForced?: true;
|
|
1172
|
+
/** server ≥7.137.0 起读自同一只门身份判官(见 {@link PausedCause.checkpointId}):这一刻挡住提交的那扇门的**非密稳定身份**;读不出可信值 ⇒ 缺席、同位带 {@link checkpointIdMissing}。 */
|
|
1173
|
+
checkpointId?: string;
|
|
1174
|
+
/** server ≥7.154.0 · 门身份读不出的开关(与 {@link checkpointId} 恒只出其一)。 */
|
|
1175
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
1169
1176
|
}
|
|
1170
1177
|
/**
|
|
1171
1178
|
* 🔴 **BREAKING(server ≥ 7.64.0,core 7.6.0 design/390 D-8)—— 终局是一条带标因由,不再是八个平面键。**
|
|
@@ -1272,7 +1279,7 @@ export interface TerminalProviderRejectedDetail {
|
|
|
1272
1279
|
/** `coded` 臂(server ≥7.126.0):run 抛了一个**带码**的错,而抛点同时写了结构化 `detail`(如检查点错误的 `{ reason }`);`terminal.code` 是同一只错误的码。只在那条错误链上带着至少一个可投成员时在场。 */
|
|
1273
1280
|
export interface TerminalCodedDetail {
|
|
1274
1281
|
kind: "coded";
|
|
1275
|
-
/** 抛点写的 `detail`,JSON 纯值快照(字符串、有限数、布尔、null、及其数组 / 纯对象;有界;其它种类的成员被略去)。凭据名下的成员是 `"[redacted]"
|
|
1282
|
+
/** 抛点写的 `detail`,JSON 纯值快照(字符串、有限数、布尔、null、及其数组 / 纯对象;有界;其它种类的成员被略去)。凭据名下的成员是 `"[redacted]"`(≥7.154.0 是 `"«redacted»"`,遮蔽记号一张表);每个字符串叶过一遍错误句脱敏(凭据形换成记号,路径保留)。 */
|
|
1276
1283
|
detail: {
|
|
1277
1284
|
[key: string]: TerminalCodedDetailValue;
|
|
1278
1285
|
};
|
|
@@ -1321,6 +1328,42 @@ export interface TerminalRequestRoute {
|
|
|
1321
1328
|
* `stripResumeToken` 在**两条**够得着的路径上摘它:本臂与 `failed.nestedPause`)。要动这次暂停:走
|
|
1322
1329
|
* `POST /v1/approvals/{sessionId}/decide`,凭 `checkpointId` 对账。
|
|
1323
1330
|
*/
|
|
1331
|
+
/** {@link TaskResult.refusedAsks} 的一条(server ≥7.154.0;引擎 `RefusedAsk`)。 */
|
|
1332
|
+
export interface RefusedAsk {
|
|
1333
|
+
toolName: string;
|
|
1334
|
+
/** 被拒调用的 id(与 `tool_start` / `tool_end` 的 `toolCallId` 同键)。 */
|
|
1335
|
+
toolCallId: string;
|
|
1336
|
+
/** 没人能答的成因,引擎闭集三词(`approver_unavailable` / `no_approver_wired` / `mandate_unreconstructible`);开集读(引擎加词不让读口崩)。 */
|
|
1337
|
+
cause: "approver_unavailable" | "no_approver_wired" | "mandate_unreconstructible" | (string & {});
|
|
1338
|
+
/** 那次拒绝点名的出路(无头的补救句 / 绑定自己的 / 一条续不了的腿的出路);没点名 ⇒ 缺席。 */
|
|
1339
|
+
remedy?: string;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* {@link TaskResult.effectiveReasoning}:这一跑的**推理档位记录** —— 请求的档位在这条线路上**实际说了什么**(引擎 `ResolvedReasoning`,逐字过境;`endpoint` 经结果文本叶表,逐字)。
|
|
1343
|
+
* 键缺席 = 引擎没说(与「说了、没降级」在 wire 上分得开)。server ≥7.154.0 起 `effective` 另有两词 `on` / `provider_default`,`off` 只说线上带了关思考的键(见 {@link ResolvedReasoning.effective})。
|
|
1344
|
+
*/
|
|
1345
|
+
export interface ResolvedReasoning {
|
|
1346
|
+
/** 调用方请求的档位(七档)。 */
|
|
1347
|
+
requested: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
1348
|
+
/**
|
|
1349
|
+
* 请求的**思考键在线上说了什么**(读写键的地方判出来的,不是请求的回声):
|
|
1350
|
+
* · 七档之一 —— 键点名了这一档(`off` = 线上带了关思考的键或部署声明的 off 值;被端点收窄过的档按收窄后的档);
|
|
1351
|
+
* · `"on"` —— 键打开了思考但没点名档位(二元开关键 / 自适应思考 / 旋钮定死的预算 / 档位表里 `null` 的档靠开关键打开);server ≥7.154.0 起这样的线路说 `on`(此前照抄请求的档);
|
|
1352
|
+
* · `"provider_default"` —— 请求**一个思考键都没带上线**(与 `dropped: true` 同在:模型条目没声明推理能力 / 端点拼不出关思考 / 思考档的承载键被扣下 / 硬输出上限小到放不下合法预算):思不思、思到哪一档是服务商自己的默认;server ≥7.154.0 起说这个词(此前说 `off` 或照抄请求的档)。
|
|
1353
|
+
* 🔴 **别把 `effective === "off"` 读成「思考确定关了」**:`off` 只说这一跑的请求带了关思考的键;「确定关了」只认 `requested: "off"` 且 `effective: "off"`。按值分支的消费方对着七档以外的两词补臂。
|
|
1354
|
+
*/
|
|
1355
|
+
effective: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "on" | "provider_default";
|
|
1356
|
+
/** 恒当且仅当 `effective` 是六个启用档之一(线上点名了一个强度);`off` / `on` / `provider_default` 都是 `false`。 */
|
|
1357
|
+
graded: boolean;
|
|
1358
|
+
/** 恒当且仅当 `effective` 与 `requested` 不同(请求的档位没有按原样上线;`provider_default` 与 `on` 因此恒 `true`)。 */
|
|
1359
|
+
clamped: boolean;
|
|
1360
|
+
/** 思考键所用的方言 / 车道的引擎标签(引擎 `ReasoningFormat`,闭十词:五种补全方言 `openai` / `openrouter` / `deepseek` / `together` / `zai`、两种 `qwen` 写法、`budget`〔预算形〕、`effort`〔Messages 的 `output_config.effort`〕、`responses`〔Responses 的嵌套 `reasoning.effort`〕)。 */
|
|
1361
|
+
format: "openai" | "openrouter" | "deepseek" | "together" | "zai" | "qwen" | "qwen-chat-template" | "budget" | "effort" | "responses";
|
|
1362
|
+
/** 端点的粗标签(`model.api`,例如 `openai-completions` / `anthropic-messages`)。 */
|
|
1363
|
+
endpoint: string;
|
|
1364
|
+
/** 在场(恒 `true`)当且仅当 `effective` 是 `"provider_default"`:请求没有任何思考键上线 —— 见 {@link effective}。其余情形缺席。 */
|
|
1365
|
+
dropped?: true;
|
|
1366
|
+
}
|
|
1324
1367
|
export interface PausedCause {
|
|
1325
1368
|
kind: "paused";
|
|
1326
1369
|
/** **哪一道**暂停 —— 谁/什么必须来恢复它。与 park 行的 `gate.kind` 是同一个词。 */
|
|
@@ -1328,6 +1371,8 @@ export interface PausedCause {
|
|
|
1328
1371
|
/** 这次暂停的**非密**稳定身份 —— token 不能去的地方可以记/可以渲的那个对账键。
|
|
1329
1372
|
* pre-identity 的老 checkpoint 上缺席。 */
|
|
1330
1373
|
checkpointId?: string;
|
|
1374
|
+
/** server ≥7.154.0 · **门身份读不出的开关**(与 `checkpointId` **恒只出其一**;好行逐字节不变):`checkpointId` 读不出可信值时缺席、同位带本键 —— `absent` = 没有可读的身份,`untrusted` = 有但没过判官。按本键判「这一行没有可信的门身份」,别拿缺席的 `checkpointId` 猜。 */
|
|
1375
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
1331
1376
|
/** 被暂停任务的远端工作区**怎么回来**,只要这次暂停捕获了远端工作区就在场。两种模式计费与行为差得远:
|
|
1332
1377
|
* · `"snapshot"` —— VM 被挂起成快照(供应商侧计费通常停,进程内存态被捕获,resume 复原);
|
|
1333
1378
|
* · `"park_only"` —— 环境自陈不可挂起(SSH 主机 / ADB 设备),于是**什么都没被暂停**:机器继续跑、
|
|
@@ -1335,6 +1380,10 @@ export interface PausedCause {
|
|
|
1335
1380
|
* **缺席** = 进程内暂停(静态的、调用方自有的环境:没有远端工作区被捕获)。
|
|
1336
1381
|
* 🔴 把「paused ⇒ 空闲且免费」当成不变量的调度器必须看得见这一位。 */
|
|
1337
1382
|
restoreMode?: "snapshot" | "park_only";
|
|
1383
|
+
/** server ≥7.154.0(引擎 7.68.x;计划审阅门,`gate.kind === "plan_review"`):这次暂停时**给人看的那份计划**的摘要 —— 回答一个问题:读者手里的计划文本是不是暂停时展示给人的那份。
|
|
1384
|
+
* = 申请这次暂停的调用的 `tool_end` 所带的 `exit-plan-mode` 卡上 `structured.plan` 串的 `textContentHashOf` 值(读者对**收到的那串**取摘要、不做显示规整、再比对)。写一次、从不改写;**不是**门身份(同文本同值、`checkpointId` 不同),续跑从不读它。
|
|
1385
|
+
* 缺席 = 那一帧没带计划卡(出错 / 结果被扣下 / 卡因体量被略)、宿主自铸的行、更早引擎写下的行:「没有可比」,不是「空计划」。不加盐;从不进 trace / 指标 / 日志。 */
|
|
1386
|
+
planContentHash?: string;
|
|
1338
1387
|
}
|
|
1339
1388
|
/**
|
|
1340
1389
|
* `GET /v1/capabilities` 的 `sealedKey` 段(K-24;server ≥7.104.0 / S-737)—— **恰三键**,与 server `src/sealed-key.ts` 的同名接口
|
|
@@ -1519,6 +1568,44 @@ export interface TaskResult {
|
|
|
1519
1568
|
/** server ≥7.137.0(引擎 7.56.0 `TaskResult`;属主 = 引擎,本服务逐字过境四张结果脸):`result` 读自的那几条**已提交**消息的会话条目 id(会话序;与 `message_committed` 帧上的 id 同一批)——
|
|
1520
1569
|
* 消费方据它把会话里那几条消息换成 `result`,而不是猜是哪几行。🔴 **空表 = 这一跑的 `result` 没读自任何已提交消息;缺席 = 出处不明**(更早的引擎写下的记录、只凭停驻行重建的结果等)—— 两者不同读。 */
|
|
1521
1570
|
resultEntryIds?: string[];
|
|
1571
|
+
/** server ≥7.153.0(引擎 7.67.0;逐字过境,键与 {@link TaskResult} 的其余引擎成员同属引擎):这一跑**接受不接受**它的输入(提示消息)—— 回答「这次调用的提示进了会话没有」:
|
|
1572
|
+
* · `{ committed: true, sessionId, entryId }` —— 提示消息已提交,`entryId` 是它的会话条目 id(与 `message_committed.entryId` 同一批),`sessionId` 是它落进的会话(梯子的每一级各在自己的会话里);
|
|
1573
|
+
* · `{ committed: false }` —— 这次调用没把输入收进去:在提示消息提交之前就结束了(入口拒 / 被筛掉 / 取消 / 准备期失败),为什么由 `terminal` 说;
|
|
1574
|
+
* · **缺席 = 不知道**(更老的引擎写下的记录、只凭行重建的结果、宿主自己装配的结果,或会话店没把条目 id 作为非空串交回)—— 不是 `committed: false`。
|
|
1575
|
+
* 组合(验证门 / 梯子 / 修复环)按派发序折各腿:第一条收了输入的腿答;没有腿收 ⇒ 每条都说 `committed: false` 才是 `committed: false`,任一条说不出就缺席。
|
|
1576
|
+
* 🔴 它**不是** `stats.turns`:第一次模型调用失败仍记一轮,而输入在那之前就已提交。 */
|
|
1577
|
+
intake?: {
|
|
1578
|
+
committed: true;
|
|
1579
|
+
sessionId: string;
|
|
1580
|
+
entryId: string;
|
|
1581
|
+
} | {
|
|
1582
|
+
committed: false;
|
|
1583
|
+
};
|
|
1584
|
+
/** server ≥7.153.0(引擎 7.67.0):**改写过答案显示窗的扩展注册名**(`classic.MessageDisplay` 处理器,按它们首次改写的先后序)—— 在场 ⇒ {@link result} 是**流上显示出来的文本**而不是那几条消息的存储文本
|
|
1585
|
+
* (消费方拿 `result` 换掉流上已渲的行时,不会把显示扣下的东西又显示出来)。注册名是注册方的串(显示用,不可信)。处理器失败的窗什么都没改、不点名(`mods.display_withheld` 通告会说)。
|
|
1586
|
+
* 缺席 = 没有处理器改过答案的显示 / 其中一条消息的显示没走到头(调用方叫停)/ 这一腿不产生显示 ⇒ `result` 就是存储文本。 */
|
|
1587
|
+
resultDisplayedBy?: readonly string[];
|
|
1588
|
+
/** server ≥7.153.0(引擎 7.67.0):**结束这一跑最后一个模型轮的扩展注册名**(`$.turn.abort`)—— 在场 ⇔ 那一刀被循环当作最后一轮的结局消费了(与 `haltedByUser` 同一条律:签名 ⇔ 消费)。
|
|
1589
|
+
* 扩展的一刀不停整个 run:排着的后续输入会开下一轮、`classic.Stop` 拦停会要一轮,二者都清掉本位 —— 所以只有「被切的那一轮就是最后一轮」时才在场。此时 `status` 读 `completed`,`result` 是被切那一轮产出的(可能是空串)。
|
|
1590
|
+
* 值是注册方的串(显示用,不可信)。每一次被受理的切都随一条 `task.turn_interrupted` 通告(`detail.cause: "extension_abort"`)。 */
|
|
1591
|
+
turnAbortedBy?: string;
|
|
1592
|
+
/** server ≥7.153.0(引擎 7.67.x;逐字过境):**这一跑的 `placement root` 不动点** —— 它的准备期解出的那一个放置根(调用方显式给的 / 委派根 / 该腿自己的会话;续跑上 = 停驻行记下的根),与它的环境工厂、它的停驻记录同一个值;
|
|
1593
|
+
* 组合入口把后面每一腿都放在第一腿的 `placementRoot` 上。present-iff 这一跑的准备期解出了它;宿主自己的桩结果、组合的合成终局上缺席。 */
|
|
1594
|
+
placementRoot?: string;
|
|
1595
|
+
/** server ≥7.154.0(引擎 7.68.x;逐字过境):**这一跑在调用方声明的上限之上完成** —— 最后一轮作了答、不再欠请求,所以没有东西被切,判词是 `completed`,本位说「上限在路上被越过了」。在场 ⇔ 严格越过。
|
|
1596
|
+
* `axis` ∈ `budget_tokens` / `budget_cost` / `walltime`(没有 `turns`:按上限允许的那一轮作答的 run 用的是它的额度);`limit` 是引擎比较的那条上限(token 数 / 微美元 / 毫秒),`observed` 是这一跑的读数(同单位、严格更大)。
|
|
1597
|
+
* 多条同时越过时点名 tokens → cost → walltime 里第一条。缺席 = 别的终局(欠请求的 run 照旧在越过的轴上失败或停驻)/ 上限只是「到了」/ 没越过。同一事实也随一条 `operator` 通告 `task.completed_past_limit`:按本位分支,别按通告的句子。 */
|
|
1598
|
+
limitCrossed?: {
|
|
1599
|
+
axis: "budget_tokens" | "budget_cost" | "walltime";
|
|
1600
|
+
limit: number;
|
|
1601
|
+
observed: number;
|
|
1602
|
+
};
|
|
1603
|
+
/** server ≥7.154.0(引擎 7.68.0;逐字过境,`toolName` / `remedy` 过出口座):这一跑里**没人能答而被拒掉的询问**,每个被拒的调用一条,按拒绝序(与 `delegation.ask_unresolvable` 通告同一批事实)。
|
|
1604
|
+
* 终局不变(被拒的询问是 run 照着往下走的一条工具结果);本位说的是这条腿**没做成什么**。present-iff 至少有一条被拒 —— 从不是空表。 */
|
|
1605
|
+
refusedAsks?: RefusedAsk[];
|
|
1606
|
+
/** 这一跑的**推理档位记录**(引擎 `ResolvedReasoning`,逐字过境;`POST /v1/tasks` 同步终态体与 run 行的 `result` 上):请求的思考档在线上实际说了什么 —— 见 {@link ResolvedReasoning}。
|
|
1607
|
+
* server ≥7.154.0 起 `effective` 多 `on` / `provider_default` 两词;缺席 = 引擎没说。 */
|
|
1608
|
+
effectiveReasoning?: ResolvedReasoning;
|
|
1522
1609
|
/** [2255]① 拒绝形材料(server ≥3.21:SSE 车道 409 conflict.session_active_run 的 done 帧 result 携带;
|
|
1523
1610
|
* 普通终态帧不带)。activeTaskId 其实自 [1833] G10 起就在 wire 上,此前 SDK 侧漏登记——一并补。
|
|
1524
1611
|
* ADDITIVE / tolerate-absent。pendingGate.decidePath = parked run 的那一个正确 resume 入口。 */
|
|
@@ -1581,6 +1668,15 @@ export interface TaskResult {
|
|
|
1581
1668
|
to: string;
|
|
1582
1669
|
reason: "breaker_open" | "rate_limit" | "budget" | "server_error" | "last_resort" | (string & {});
|
|
1583
1670
|
chain?: string[];
|
|
1671
|
+
/** server ≥7.153.0(引擎 7.67.0):部署的 Brain 路由判断**在发出之前就拒掉**的降级链跳 —— 每跳一条 `{ model, code? }`(拒绝码,判断没说就缺席),按链序;没有被拒的 / 预算路径 ⇒ 缺席。 */
|
|
1672
|
+
skipped?: Array<{
|
|
1673
|
+
model: string;
|
|
1674
|
+
code?: string;
|
|
1675
|
+
}>;
|
|
1676
|
+
/** server ≥7.153.0:这一遍走链怎么收的 —— `served`(一个降级跳作了答 = `to`)/ `exhausted`(没有跳能答,这一轮的答案是被请求模型自己的失败,`to` 是最后试的那一跳、不是作答的模型)。预算路径缺席。 */
|
|
1677
|
+
outcome?: "served" | "exhausted";
|
|
1678
|
+
/** server ≥7.153.0:被走链那一轮的答案是**谁**的消息 —— 一个跳作了答 ⇒ `to`,链用尽 ⇒ `from`。预算路径缺席。 */
|
|
1679
|
+
answeredBy?: string;
|
|
1584
1680
|
atTurn: number;
|
|
1585
1681
|
};
|
|
1586
1682
|
structuredOutput?: unknown;
|
|
@@ -2727,7 +2823,7 @@ export interface RunRecord {
|
|
|
2727
2823
|
heldBy?: string | null;
|
|
2728
2824
|
/** 🔴 K-43(同上,server ≥7.73.0 / S-230 P-45 起恒在场,契约 §5.5 (c))—— **耐久取消旗**(跨副本;持有副本的心跳拍 poll 它)。
|
|
2729
2825
|
* ⚠️ 它是**待生效**的取消:已经取消掉的 run 由 `status` + `errorCode:"cancelled"` 说(park 臂的取消**根本不经这面旗**,直接把行终局化);
|
|
2730
|
-
* 续跑认领会把旗清零(
|
|
2826
|
+
* 续跑认领会把旗清零(括号里曾写的「撞上 suspend 的取消不许在恢复之后再杀一遍」只描述 ≤7.148.x 的存量行:server ≥7.149.0 起取消与停驻落盘撞在同一拍时,停驻写那一拍就以取消收场,不会留到恢复之后)。⇒ **别**把 `cancelRequested` 翻回 `false` 读成「取消完成」—— 以 `GET /v1/runs/:id` 读到**终局词**为准(终局是吸收态),取消落地的主判据是 `errorCode:"cancelled"`;终局不是它时见 {@link CancelAck}。
|
|
2731
2827
|
* `POST /v1/runs/:id/cancel` 的受理体带同一个键({@link CancelAck.cancelRequested},同一个谓词)。< 7.73.0 缺席。 */
|
|
2732
2828
|
cancelRequested?: boolean;
|
|
2733
2829
|
}
|
|
@@ -3301,7 +3397,7 @@ export type GateRecordDeniedBy = DeniedBy | GateRecordRetiredWord<"deniedBy">;
|
|
|
3301
3397
|
export type GateRecordModeReleaseReason = "target_unresolved" | GateRecordRetiredWord<"modeReleaseReason">;
|
|
3302
3398
|
/** 门记录上的强制词 = {@link PersistedRuleMandate}(今天的全集)∪ 档案词(7.49.0 前的旧拼法)。 */
|
|
3303
3399
|
export type GateRecordPersistedRuleMandate = PersistedRuleMandate | GateRecordRetiredWord<"persistedRuleMandate">;
|
|
3304
|
-
/** 门记录上的出身词 = core `ASK_ORIGINS`(
|
|
3400
|
+
/** 门记录上的出身词 = core `ASK_ORIGINS`(今天的词表,见 {@link ASK_ORIGINS})∪ 档案词(`unresolvable`,core 7.14.0 改名 `ancestor_marked`)。🔴 门记录这一面引擎判成员,所以是**闭集**
|
|
3305
3401
|
* —— 与卡面上开集读的 {@link AskOrigin} 不同面(卡面 server 只判非空串)。 */
|
|
3306
3402
|
export type GateRecordAskOrigin = (typeof ASK_ORIGINS)[number] | GateRecordRetiredWord<"askOrigin">;
|
|
3307
3403
|
/**
|
|
@@ -3522,7 +3618,7 @@ export interface GateOutcome {
|
|
|
3522
3618
|
disposition: GateDisposition;
|
|
3523
3619
|
/** 只在**这次通过真的结算了一只 ask** 时在场。与 {@link origin} 同在同缺(I1)。 */
|
|
3524
3620
|
settlement?: Settlement;
|
|
3525
|
-
/** 谁**问**的。与 {@link settlement} 同在同缺(I1)。门记录按档案读(见 {@link GateRecordAskOrigin}
|
|
3621
|
+
/** 谁**问**的。与 {@link settlement} 同在同缺(I1)。门记录按档案读(见 {@link GateRecordAskOrigin}:今天的 {@link ASK_ORIGINS} ∪ 7.14.0 前的 `unresolvable`),是**闭集**。 */
|
|
3526
3622
|
origin?: GateRecordAskOrigin;
|
|
3527
3623
|
}
|
|
3528
3624
|
/**
|
|
@@ -3540,7 +3636,7 @@ export interface GateOutcome {
|
|
|
3540
3636
|
*/
|
|
3541
3637
|
export type McpDelivered = "yes" | "no" | "unknown";
|
|
3542
3638
|
/**
|
|
3543
|
-
* MCP 失败的**类**(core `MCP_FAILURE_KINDS`:7.6.0 闭十词;core 7.58.0 起 `credential_unavailable`、core 7.59.0 起 `unauthorized` ⇒ 十二词,server ≥7.138.0;core 7.60.0 起 `host_refused` ⇒ 十三词,server ≥7.139.0)—— `tool_end.errorCode` 与
|
|
3639
|
+
* MCP 失败的**类**(core `MCP_FAILURE_KINDS`:7.6.0 闭十词;core 7.58.0 起 `credential_unavailable`、core 7.59.0 起 `unauthorized` ⇒ 十二词,server ≥7.138.0;core 7.60.0 起 `host_refused` ⇒ 十三词,server ≥7.139.0;core 7.67.0 起 `revoked` ⇒ 十四词,随装该引擎的 server ≥7.153.0)—— `tool_end.errorCode` 与
|
|
3544
3640
|
* `wiring_manifest.mcp[].errorCode` 上 MCP 那一族的取值。
|
|
3545
3641
|
* `connect_refused`(连接相 errno:请求**可证**从未离开)/ `connection_failed`(其他 errno:可能跑过了)/
|
|
3546
3642
|
* `connection_closed`(SDK 报传输已关:在飞时命运不可知,对已知死掉的服务器则从未尝试——两者靠
|
|
@@ -3549,12 +3645,14 @@ export type McpDelivered = "yes" | "no" | "unknown";
|
|
|
3549
3645
|
* `not_mcp_response` / `spawn_failed`(stdio 子进程起不来)/ `timeout` / `protocol`(服务器**答**了一个
|
|
3550
3646
|
* MCP/JSON-RPC 错:交换发生过)/ `invalid_config`(声明本身拨不出去 —— 要改 spec,不是等它恢复)/ `credential_unavailable`(server ≥7.138.0:
|
|
3551
3647
|
* 部署的凭据席没给出这次请求 —— 席抛了、没按时答,或答了引擎带不了的东西;这次请求**没发出**,是部署要修的故障,不是服务器挂了)/ `host_refused`(server ≥7.139.0 / core 7.60.0:
|
|
3552
|
-
* 宿主提供的传输〔core `McpServerSpec` 的 `transport.kind: "host"`〕的**宿主席**没有把这次请求交给对端 —— 请求**没发出**〔`delivered: "no"`〕;server 7.139.0 发布字节里没有任何宿主传输席的装配点,所以部署上读不到它,词表以引擎为准,故收进已知词)/ `
|
|
3648
|
+
* 宿主提供的传输〔core `McpServerSpec` 的 `transport.kind: "host"`〕的**宿主席**没有把这次请求交给对端 —— 请求**没发出**〔`delivered: "no"`〕;server 7.139.0 发布字节里没有任何宿主传输席的装配点,所以部署上读不到它,词表以引擎为准,故收进已知词)/ `revoked`(core 7.67.0:部署的撤销账本答「这台服务器或对端已被撤回」;这个词读在**接线清单**上 —— `wiring_manifest.mcp[].errorCode`,装配期的拨号被撤:`status: "failed"`、`delivered: "no"`。
|
|
3649
|
+
* 🔴 **被撤销账本在请求离开之前拒掉的调用**,在 `tool_end.errorCode` 上读的是引擎码 `mcp.server_revoked`(core 5.50.0 起,开集里的引擎码,server 零铸点、逐字过境;**不是**本词;撤销若落在 401 / 丢会话的**重发**之前,调用答它第一次尝试的失败码,也不是本词),
|
|
3650
|
+
* `delivered` 与它合读:一跳都没发 = `"no"`;首跳已发、后续重定向跳被撤 = `"unknown"`〔引擎 7.68.2 里铸后一形的只有 A2A 对端的重定向循环,码 `a2a.peer_revoked`;MCP 一侧的铸点只铸前一形〕。本词不说对端能不能连上)/ `unknown`。
|
|
3553
3651
|
* 🔴 core 7.6.0 起**退役** `MCP_FAILURE_CODES` 那张十词表,`network` 与 `http_<status>` **两种拼法一并作废**
|
|
3554
3652
|
* (HTTP 状态从此走结构位 `httpStatus`,不再编进码里)。
|
|
3555
3653
|
* 🔴 `tool_end.errorCode` 整体仍是**开集**(词表属主是工具);本类型只描述其中 MCP 这一族,按开集读。
|
|
3556
3654
|
*/
|
|
3557
|
-
export type McpFailureKind = "connect_refused" | "connection_failed" | "connection_closed" | "unauthorized" | "http_status" | "not_mcp_response" | "spawn_failed" | "timeout" | "protocol" | "invalid_config" | "credential_unavailable" | "host_refused" | "unknown" | (string & {});
|
|
3655
|
+
export type McpFailureKind = "connect_refused" | "connection_failed" | "connection_closed" | "unauthorized" | "http_status" | "not_mcp_response" | "spawn_failed" | "timeout" | "protocol" | "invalid_config" | "credential_unavailable" | "host_refused" | "revoked" | "unknown" | (string & {});
|
|
3558
3656
|
/**
|
|
3559
3657
|
* 一条腿的 **MCP 装配名册**里的**一行**(core ≥7.5.0 #562 / ≥7.6.0 S6-B,server ≥7.60;**租户可见**):
|
|
3560
3658
|
* 这条腿申报的那台服务器连上了没有、没连上是哪一类、挂上来几只工具。
|
|
@@ -3890,6 +3988,8 @@ export type TraceBlock = {
|
|
|
3890
3988
|
name: string;
|
|
3891
3989
|
label?: string;
|
|
3892
3990
|
input?: unknown;
|
|
3991
|
+
resumesCheckpoint?: string;
|
|
3992
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
3893
3993
|
eventId?: string;
|
|
3894
3994
|
parentToolCallId?: string;
|
|
3895
3995
|
}
|
|
@@ -3926,6 +4026,10 @@ export type TraceBlock = {
|
|
|
3926
4026
|
truncated?: boolean;
|
|
3927
4027
|
totalChars?: number;
|
|
3928
4028
|
structured?: unknown;
|
|
4029
|
+
structuredSkeleton?: {
|
|
4030
|
+
type: string;
|
|
4031
|
+
[k: string]: unknown;
|
|
4032
|
+
};
|
|
3929
4033
|
gate?: GateOutcome;
|
|
3930
4034
|
delivered?: McpDelivered;
|
|
3931
4035
|
gatedCallId?: string;
|
|
@@ -4016,6 +4120,8 @@ export type TraceStreamEvent = {
|
|
|
4016
4120
|
name: string;
|
|
4017
4121
|
label?: string;
|
|
4018
4122
|
input: unknown;
|
|
4123
|
+
resumesCheckpoint?: string;
|
|
4124
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
4019
4125
|
eventId?: string;
|
|
4020
4126
|
parentToolCallId?: string;
|
|
4021
4127
|
};
|
|
@@ -4032,6 +4138,10 @@ export type TraceStreamEvent = {
|
|
|
4032
4138
|
truncated?: boolean;
|
|
4033
4139
|
totalChars?: number;
|
|
4034
4140
|
structured?: unknown;
|
|
4141
|
+
structuredSkeleton?: {
|
|
4142
|
+
type: string;
|
|
4143
|
+
[k: string]: unknown;
|
|
4144
|
+
};
|
|
4035
4145
|
gate?: GateOutcome;
|
|
4036
4146
|
delivered?: McpDelivered;
|
|
4037
4147
|
gatedCallId?: string;
|
|
@@ -4366,7 +4476,7 @@ export interface McpServerSpec {
|
|
|
4366
4476
|
* 让连接器按 (principal, session) 存状态。缺席 ⇒ 什么都不发(会话 id 出进程是一次关联,由部署选择)。**委派子代是另一个会话**:它的调用带它自己的 id,引擎不替你猜根;principal 也不是树键。没有会话的拨号(库入口、无 run 的探测)不带。
|
|
4367
4477
|
* 键判官只有引擎一只(`judgeSessionMetaKey`):非空串、≤128 个字符、合 MCP `_meta` 的键名格式(可选的「点分标签 + `/`」前缀 + 名字),且不撞别人的 `_meta` 成员 —— 不是 SDK 自己的 `progressToken`、不在引擎的 `sema/` 命名空间下、
|
|
4368
4478
|
* 不在 MCP 保留的前缀下(前缀 = 第一个 `/` 之前的文本,标签是 DNS 标签,第二个标签大小写折叠后比)。坏形 ⇒ 新提交(`POST /v1/tasks*` · `/v1/runs`)与探测口(`probeMcp`)一律 `400 request.field_invalid`,点名 `mcpServers[i].sessionMetaKey`;
|
|
4369
|
-
* 🔴 **server ≥7.139.0 的拒句不回显你写的键**(
|
|
4479
|
+
* 🔴 **server ≥7.139.0 的拒句不回显你写的键**(句子要说到它时写成遮蔽记号加码位数:≤7.153.x `[redacted] (N characters)`,**≥7.154.0 `«redacted» (N characters)`**(遮蔽记号归引擎的一张表,拼写只有一种),N = 码位数;超长 / 空串 / 非串的拒因只说长度或类型、根本不提键)—— 按码与点名的键路径读,别匹配句子。部署腿(中心下发 / `config.d`)从 server ≥7.139.0 起也承运这把键(此前读配置时被剥并报未知键),同一只判官,坏形整条 server 不挂。
|
|
4370
4480
|
* 老 server(<7.138.0)的受理键表里没有它 ⇒ 当词表外的键答 `400 request.body_shape`(`unknownKeys` 点名;按键律推,未对老字节实测)。 */
|
|
4371
4481
|
sessionMetaKey?: string;
|
|
4372
4482
|
}
|
|
@@ -4519,10 +4629,14 @@ export type AutoModeRefusedBy = (typeof AUTO_MODE_REFUSED_BY)[number];
|
|
|
4519
4629
|
* 缺席 = 老 server(≤7.136.x):同样不编。
|
|
4520
4630
|
* · `user_attachments.read_state`(core 7.67.0 起第四词;server ≥7.153.0 投,值恒 `true`)—— 这台引擎**读得出请求层附件(`TaskRequest.userAttachments`)的读状态**:壳在本机把 `@` 引用的文件换成路径形附件之前先看这一位,
|
|
4521
4631
|
* 缺席 = 老 server / 老引擎 ⇒ 读作「不保证」,不是「不具备」。(词表由 core `ENGINE_CAPABILITIES` 逐词同序镜像,本词是第四员。)
|
|
4632
|
+
* · `task.wake`(core 第五词;server ≥7.154.0 投,值 = 这个构建认不认提交体顶层键 {@link TaskRequest.wake} 的版本事实,今天恒 `true`)—— **键本身带点号,按整串取**:`caps["task.wake"]`,不是 `caps.task` 下的 `wake`。
|
|
4633
|
+
* 与旧的顶层位 {@link Capabilities.wake} **读同一只事实**(7.154.0 两位同投同值);旧位在 server 下一版起退役,新代码读本词。缺席 = 老 server(≤7.153.x 只有旧位)⇒ 读旧位。
|
|
4634
|
+
* · `file_history.recorded_place`(core 第六词;server ≥7.154.0 投,**本版恒 `false`**)—— 这台服务**受理不受理**回退时「写明没有记下目录的历史版本录在哪个目录」的那只入参(引擎的 `unplacedHistoryRecordedUnder`):本版请求面不受理它,位为假只是叫壳别发那只入参;
|
|
4635
|
+
* 逐只拒(`recorded_elsewhere` / `place_unrecorded`)**不看这一位**、照样发生,位也不是「回退可不可用」的判据(那是 {@link Capabilities.sessionRewindFiles})。缺席 = 老 server ⇒ 同样不受理。
|
|
4522
4636
|
* 一处派生:{@link EngineCapabilityBits} 与 {@link Capabilities} 的能力词键都由本数组生成 —— 引擎加词时这里加一项、其余零手写;
|
|
4523
4637
|
* 缺席 = 老 server(≤7.128.x)或这一词没接线 ⇒ **读作「不保证」**,不是「不具备」。
|
|
4524
4638
|
*/
|
|
4525
|
-
export declare const ENGINE_CAPABILITY_WORDS: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state"];
|
|
4639
|
+
export declare const ENGINE_CAPABILITY_WORDS: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state", "task.wake", "file_history.recorded_place"];
|
|
4526
4640
|
export type EngineCapabilityWord = (typeof ENGINE_CAPABILITY_WORDS)[number];
|
|
4527
4641
|
/** 能力词 ⇒ 可选布尔(键名原样带点号);{@link Capabilities} 继承它。 */
|
|
4528
4642
|
export type EngineCapabilityBits = {
|
|
@@ -4822,6 +4936,8 @@ export interface Capabilities extends EngineCapabilityBits {
|
|
|
4822
4936
|
hooks?: boolean;
|
|
4823
4937
|
/** server ≥7.146.0 · **恒真的版本位**:请求 `settings.autoCompactEnabled`({@link import("./settings.js").SemaSettings.autoCompactEnabled})这一面受理(不挂任何设施、不随部署形变)。**见位才发**:位缺席 = 老 server(键闭集门对该键 400 `request.body_shape`)。 */
|
|
4824
4938
|
autoCompactEnabled?: boolean;
|
|
4939
|
+
/** server ≥7.154.0 · 请求 `settings.runStreamHookFrames`({@link import("./settings.js").SemaSettings.runStreamHookFrames})这一面受理(与 {@link hooks} **同一谓词**:单用户真、多租假)。**见位才发**:位缺席 = 老 server(键闭集门对该键 400 `request.body_shape`)。 */
|
|
4940
|
+
runStreamHookFrames?: boolean;
|
|
4825
4941
|
/** server ≥7.133.0:请求 `settings.hooks[]` 的**插件上下文**键(命令条目的 `plugin { name, root, dataDir?, options? }` 与 exec 形 `args`)这台部署受不受理——与 {@link hooks} **同一谓词**(单用户真、多租假)。
|
|
4826
4942
|
* **见位才发**:位缺席 = 老 server,静默剥掉这些键(不报错);位为 `false` 同——发了也是剥。 */
|
|
4827
4943
|
pluginHooks?: boolean;
|
|
@@ -4906,8 +5022,9 @@ export interface Capabilities extends EngineCapabilityBits {
|
|
|
4906
5022
|
*/
|
|
4907
5023
|
sessionRewindFiles?: boolean;
|
|
4908
5024
|
/**
|
|
4909
|
-
* server ≥7.147.0 ·
|
|
4910
|
-
*
|
|
5025
|
+
* server ≥7.147.0 · 预览(`dryRun: true`)有没有统计。**server ≥7.154.0 起与 {@link sessionRewindFiles}、{@link sessionRewindFilesCwd} 读同一只事实**(三位同值 = 口解得出就有预览:预览是引擎在「不执行写的视图」上把真回退的计划跑一遍,不再看文件历史店有没有 `diffStats`);
|
|
5026
|
+
* ≤7.153.x 是「上一位 ∧ 文件历史店实现了 `diffStats`」(`DB_BACKEND=local` 为真,SQL 双生为假,为假时 `preview: null`)—— 读老 server 的调用方仍按那一读法。
|
|
5027
|
+
* 🔴 位为假**不是**口不收 `dryRun`:照收、答 `preview: null`(「这台给不出统计」≠「什么都不会变」)。位缺席 = 老 server。
|
|
4911
5028
|
*/
|
|
4912
5029
|
sessionRewindFilesPreview?: boolean;
|
|
4913
5030
|
/**
|
|
@@ -5171,7 +5288,10 @@ export interface Capabilities extends EngineCapabilityBits {
|
|
|
5171
5288
|
/** server ≥7.137.0 · **恒真的版本位**:`POST /v1/assistant/tasks/:id/plan_review` 的决断体受理门身份键 {@link PlanReviewRequest.checkpointId}(「门换了」⇒ `409 approval_stale`)。刻意不挂任何设施 ——
|
|
5172
5289
|
* 本位答「这个二进制的那道门受理这只键」,不答「这台部署上 plan_review 可用」(那是 `asyncRuns` / `approvals`)。🔴 **先读本位再带键**:缺席 = 老 server(7.86.0–7.136.x 对这个键 400,更老的静默丢)⇒ 别带。 */
|
|
5173
5290
|
planReviewCheckpointId?: boolean;
|
|
5174
|
-
/** server ≥7.
|
|
5291
|
+
/** server ≥7.154.0 · **恒真的版本位**:门身份的各张面答 `checkpointId` **或** {@link CheckpointIdMissingWord} 的 `checkpointIdMissing`(恒只出其一)—— 门身份读不出时 id 键缺席、同位带词。缺席 = 老 server(它没有这只键;那里 `checkpointId` 缺席只说明是一行老行)。 */
|
|
5292
|
+
checkpointIdMissing?: boolean;
|
|
5293
|
+
/** server ≥7.153.0 · **恒真的版本位**:这个构建认提交体顶层键 {@link TaskRequest.wake}(**唤醒腿**:开在会话住客闲着时停驻下来的任务通知上,不带自己的输入)。**先读本位再带键**:缺席 = 更早的 server(带 `wake` 答 `400 request.body_shape`)。
|
|
5294
|
+
* @deprecated server ≥7.154.0 起这一位与引擎能力词 `caps["task.wake"]`({@link EngineCapabilityBits})**读同一只事实**,两位同投同值;本位在 server 下一版起退役 —— 新代码读 `caps["task.wake"]`,缺席时(≤7.153.x)再读本位。 */
|
|
5175
5295
|
wake?: boolean;
|
|
5176
5296
|
/** server ≥7.153.0 · **恒真的版本位**(单用户与多租同答 —— 这是请求者给自己这条腿的偏好,不放宽任何门):这个构建认提交体顶层键 {@link TaskRequest.language}(回复语言,原样交引擎)。**先读本位再带键**:缺席 = 更早的 server。 */
|
|
5177
5297
|
language?: boolean;
|
|
@@ -6113,8 +6233,12 @@ export declare const CHECKPOINT_ROW_VERDICT_KINDS: readonly ["ok", "lacking", "d
|
|
|
6113
6233
|
* `/v1/approvals/stream` 的 `pending` 帧与助手收件箱行 {@link InboxRow.rowVerdict} **同型同一答**。🔴 **一个判官两张脸**:续跑 / 决断的第一级拒(409,体带 `reason`)出自同一只判官,
|
|
6114
6234
|
* 所以列表上读到非 `ok` 的行,决断它会被同一个原因拒 —— **呈不可批**,出路是取消 run(`runs.cancel(taskId, { session })`)或交给能续它的副本 / 版本(混版车队里那一行留给它)。
|
|
6115
6235
|
* · `kind: "ok"` —— 臂里只有 `kind`;
|
|
6116
|
-
* · `kind: "lacking" | "damaged"` —— `code`(引擎的检查点错误码)· `reason?`(同码多臂时哪一臂)· `
|
|
6117
|
-
* `
|
|
6236
|
+
* · `kind: "lacking" | "damaged"` —— `code`(引擎的检查点错误码)· `reason?`(同码多臂时哪一臂)· `field?` / `blockedBy?`(**server ≥7.153.0**〔随装 core 7.67.3〕起:行记着的词这台引擎读不了 ——
|
|
6237
|
+
* 权限模式 / 运行来源 / 冻结的工具名拼写 —— 那几行答 `code: "checkpoint.config_refused"`;三臂里只有冻结的工具名拼写那一臂(`blockedBy: "config.tool_face_control"`)带 `reason`
|
|
6238
|
+
* 〔引擎 7.68.2 的判官在这一臂铸 `not_a_list` · `not_a_string` · `unsupported_pattern`〕,权限模式(`config.permission_mode_invalid`)、运行来源(`config.run_origin_invalid`)两臂不带 `reason`;
|
|
6239
|
+
* `field` = 该拒的 `detail.field`,`blockedBy` = 同一份坏值在新跑上报的准入码;续跑拒体带这两键时与它们同名同词 —— 但 server 7.154.0 上,决断口对停驻行自己的拒从这份判决重建拒体、还不带这两键,
|
|
6240
|
+
* 只有列表行与收件箱行带;其余臂两键都缺席)· `requires?`(这一行要、本引擎没有的能力名)·
|
|
6241
|
+
* `sentence`(引擎的人话行,展示用,**不是匹配键**)。`code` / `reason` / `field` / `blockedBy` 按开集串读(词表属主在 core,随 core 加员)。
|
|
6118
6242
|
* · 两张脸怎么对:🔴 **server ≥7.147.0 起按 `code` 等值就对得上** —— 任何决断类续跑入口(`/decide` · `/plan_review` · `/resume` · `/wake`)对「这一行自己的拒」都答**引擎原码**,与本判决的 `code` 是同一只判官的同一个码
|
|
6119
6243
|
* (`checkpoint.invalid_outcome`〔例:`requirements_damaged`〕落 {@link import("./errors.js").CheckpointInvalidOutcomeError};`checkpoint.unsupported_version` 同样原码过境),`error` 以本判决的 `sentence` 开头,拒体的 `reason` 与本判决的 `reason` 是同一个词。
|
|
6120
6244
|
* 成因码只给**真有成因**的拒(`approval_binding_mismatch`:绑定席;`resume_outcome_invalid`:决定体里那一格 / 内容拒),那不是这一行自己的拒。
|
|
@@ -6130,12 +6254,17 @@ export type CheckpointRowVerdict = {
|
|
|
6130
6254
|
kind: "lacking" | "damaged";
|
|
6131
6255
|
code: string;
|
|
6132
6256
|
reason?: string;
|
|
6257
|
+
field?: string;
|
|
6258
|
+
blockedBy?: string;
|
|
6133
6259
|
requires?: string[];
|
|
6134
6260
|
sentence: string;
|
|
6135
6261
|
};
|
|
6136
6262
|
export interface PendingCheckpoint {
|
|
6137
6263
|
/** 行族名(server ≥7.143.0 恒 `"checkpoint"`;≤7.142.x 缺席 —— 那一代只有这一族)。见 {@link PendingList.pending}。 */
|
|
6138
6264
|
kind?: "checkpoint";
|
|
6265
|
+
/** server ≥7.154.0 · **宿主会话**(只在它不是 `sessionId` 时带):一张停在别的会话里的卡指回**起它的那只会话** —— 梯子(`cascade:true`)一级的卡指回提交的会话,workflow 一条腿的卡指回起那条 workflow 的会话;
|
|
6266
|
+
* = 决断这张卡时续跑的是哪一只会话的 run。读得出唯一一个值、且读者看得见那只会话(过得了会话视图的属主门)时才带;缺席 = 这张卡就在本会话,或读不出 / 看不见。壳据它判「这张卡是不是本会话的」。后台委派子代的卡不带它。 */
|
|
6267
|
+
hostSessionId?: string;
|
|
6139
6268
|
/** server ≥7.144.0 —— 引擎判官对这一行的判决({@link CheckpointRowVerdict};**缺席不是 `ok`**)。非 `ok` 的行呈不可批:决断它会被同一个原因拒(409)。
|
|
6140
6269
|
* SQL 后端起服后第一次列队列时把待决行的存储体各读一次(之后按存储体摘要记忆);server ≥7.145.0 起存储体读不成检查点的行也带(恒 `damaged`;7.144.x 上那一形不带本键)。
|
|
6141
6270
|
* 🔴 **server ≥7.152.0:`GET /v1/approvals` 的待决行 / `/v1/approvals/stream` `pending` 帧的 `rowVerdict` 恒在场**(两后端同一只整行解码;7.144.0–7.151.x 上 SQL 行可缺席)—— 型仍是可选键(老 server),缺席仍不是 `ok`。
|
|
@@ -6159,6 +6288,8 @@ export interface PendingCheckpoint {
|
|
|
6159
6288
|
* (老行 / 没过信任边界〔非串 / 空串 / 超长 / 含 token〕/ 老 server;server 计一次 `server.approvals.durable-row-checkpoint-id-missing`):**缺席读作「这一行没有可 join 的身份」**,
|
|
6160
6289
|
* 别把它当必在键拿去写 join 码。 */
|
|
6161
6290
|
checkpointId?: string;
|
|
6291
|
+
/** server ≥7.154.0 · **门身份读不出的开关**(与 `checkpointId` **恒只出其一**;好行逐字节不变):`checkpointId` 读不出可信值时缺席、同位带本键 —— `absent` = 没有可读的身份,`untrusted` = 有但没过判官。按本键判「这一行没有可信的门身份」,别拿缺席的 `checkpointId` 猜。 */
|
|
6292
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
6162
6293
|
/** The suspended run holding the session claim — the JOIN KEY to the task's trace
|
|
6163
6294
|
* tool-call block (block.id == toolCallId → input = full args/question payload) and the context link. */
|
|
6164
6295
|
taskId?: string | null;
|
|
@@ -7242,8 +7373,12 @@ export interface ImportCommitted {
|
|
|
7242
7373
|
relation: SyncRelation["relation"];
|
|
7243
7374
|
}
|
|
7244
7375
|
/** Synchronous ack for `POST /v1/runs/:id/cancel` (LIVE, service ced3d88). `status` is
|
|
7245
|
-
* "cancelling" (accepted) or a terminal status (idempotent no-op). NOT a RunStatus member. The run
|
|
7246
|
-
*
|
|
7376
|
+
* "cancelling" (accepted) or a terminal status (idempotent no-op). NOT a RunStatus member. The run normally settles to `failed` +
|
|
7377
|
+
* `errorCode:"cancelled"` (the main criterion of "this cancel landed") — but accepted does NOT promise that terminal word. Three other ends exist:
|
|
7378
|
+
* (1) the leg finishes by itself before the cancel takes effect (its own terminal; `cancelRequested:true` on the row only says a cancel was accepted);
|
|
7379
|
+
* (2) a cancelled RESUME leg whose approved step never started keeps the engine's code `resume.reopened_unstarted` (with `cancelRequested:true` that is the cancel landing under the engine's code);
|
|
7380
|
+
* (3) the holder is lost after the accept — `failed` + `run.stalled` / `run.orphaned`; from server 7.154.0 every face that carries a holder-death verdict also carries `cancelRequested:true` when the flag stood.
|
|
7381
|
+
* Settle the books on the TERMINAL WORD that `GET /v1/runs/:id` reads (a terminal is absorbing); do NOT wait for the event stream's last frame (a cancel on a PARKED run writes no ledger frame — the stream closed at the park). */
|
|
7247
7382
|
export interface CancelAck {
|
|
7248
7383
|
taskId: string;
|
|
7249
7384
|
status: string;
|
|
@@ -7546,6 +7681,8 @@ export interface InboxRow {
|
|
|
7546
7681
|
* (老行 / 没过信任边界〔非串 / 空串 / 超长 / 含 token〕/ 老 server;server 计一次 `server.approvals.durable-row-checkpoint-id-missing`):**缺席读作「这一行没有可 join 的身份」**,
|
|
7547
7682
|
* 别把它当必在键拿去写 join 码。 */
|
|
7548
7683
|
checkpointId?: string;
|
|
7684
|
+
/** server ≥7.154.0 · **门身份读不出的开关**(与 `checkpointId` **恒只出其一**;好行逐字节不变):`checkpointId` 读不出可信值时缺席、同位带本键 —— `absent` = 没有可读的身份,`untrusted` = 有但没过判官。按本键判「这一行没有可信的门身份」,别拿缺席的 `checkpointId` 猜。 */
|
|
7685
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
7549
7686
|
/** server ≥7.153.0:这一行停驻的**工具审批卡的问句**,与 {@link PendingCheckpoint.cardMessage} 同一只处理、同读法(脱敏 + 截 8192 字符;缺席 ⇒ 回落通用门理由;读引擎的摘要回显)。 */
|
|
7550
7687
|
cardMessage?: string;
|
|
7551
7688
|
/** server ≥7.153.0:**谁问的、为什么问**(引擎的摘要回显,与活卡 {@link import("./resources/tool-approvals.js").ApprovalCard.askReasons} / 运维队列行 {@link PendingCheckpoint.askReasons} **四面同一只投影**;此前只在活卡与队列行上带,收件箱行不带)。缺席 = 引擎 7.61.0 之前停驻的行 / 没有问因。 */
|
|
@@ -7800,6 +7937,8 @@ export interface AssistantTaskStatus {
|
|
|
7800
7937
|
/** server ≥7.138.0 · 只随 {@link decisionCommitted} 出现:执行之前选中的那一行的**门身份**(与运维队列 / 收件行 / park 账本行同名同值)。身份读不出(老行 / 值没过信任边界)
|
|
7801
7938
|
* 或不适用(幂等回放不带门身份)⇒ 缺席;缺席不推断任何事,尤其不是「新一跑」。 */
|
|
7802
7939
|
checkpointId?: string;
|
|
7940
|
+
/** server ≥7.154.0 · **门身份读不出的开关**(与 `checkpointId` **恒只出其一**;好行逐字节不变):`checkpointId` 读不出可信值时缺席、同位带本键 —— `absent` = 没有可读的身份,`untrusted` = 有但没过判官。按本键判「这一行没有可信的门身份」,别拿缺席的 `checkpointId` 猜。 */
|
|
7941
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
7803
7942
|
/** 续跑所在那一跑的 id(resume / plan_review:持着本会话认领的那条 run 行;preempt:被让位的那条)。**受理形**(`status: "resuming"`,durable 部署默认)**恒带**,`preempt` 202 也恒带。
|
|
7804
7943
|
* 🔴 **resume / plan_review 的同步终局体在「认领缺席」时不带 `taskId`**:会话上没有 run 行持着认领(成因 server 自己说不穷举:单活索引起动时读空 / 停驻簿记失败后作废 /
|
|
7805
7944
|
* 失联收割先赢 / 升级前留下的行 / 刻意无行的工作者)时,server 仍照常驱动续跑(不写账本、不翻行),答体是 `{ sessionId, status, … }`。缺席 = 没有 run 行可跟,
|
|
@@ -8047,9 +8186,9 @@ export type WiringManifestFileHistory = "on" | "disabled" | (string & {});
|
|
|
8047
8186
|
export interface WiringManifestInstructions {
|
|
8048
8187
|
selected: string[];
|
|
8049
8188
|
}
|
|
8050
|
-
/** `wiring_manifest.suspendLane.reasons[]` 的词(server ≥7.153.0;引擎 `SuspendLaneReason`):这条腿**不能耐久停驻**的缺件 —— 无检查点店 · 工具结果下沉进易失店 · 每任务执行环境不在两种停驻目标里
|
|
8189
|
+
/** `wiring_manifest.suspendLane.reasons[]` 的词(server ≥7.153.0;引擎 `SuspendLaneReason`,**≥7.154.0 多 `leg_not_resumable`**):这条腿**不能耐久停驻**的缺件 —— 无检查点店 · `leg_not_resumable`(这条腿所在的车道不持有停驻:续不了的腿,如被中心强制耐久门而本车道不能续跑)· 工具结果下沉进易失店 · 每任务执行环境不在两种停驻目标里
|
|
8051
8190
|
* (不是远端环境 / 没有 `capabilities.suspendable` 声明 / 声明的快照而适配器缺恢复面)。闭集声明、开集读。 */
|
|
8052
|
-
export declare const SUSPEND_LANE_REASONS: readonly ["no_checkpoint_store", "volatile_tool_results", "env_not_remote", "env_suspend_undeclared", "env_restore_incomplete"];
|
|
8191
|
+
export declare const SUSPEND_LANE_REASONS: readonly ["no_checkpoint_store", "leg_not_resumable", "volatile_tool_results", "env_not_remote", "env_suspend_undeclared", "env_restore_incomplete"];
|
|
8053
8192
|
export type SuspendLaneReason = (typeof SUSPEND_LANE_REASONS)[number];
|
|
8054
8193
|
/** `wiring_manifest.suspendLane`(**OPERATOR 面**;server ≥7.153.0,引擎 7.67.0):这条腿**能不能耐久停驻** —— 外部成因(调度器的让出、用量窗、环境寿命)与选了耐久轴的任务轴都停驻在这套基础设施上。
|
|
8055
8194
|
* 只说**就绪度**,不说某一次请求的结局(就绪的腿运行时仍可能有一次停驻被拒,那一次请求自己的披露点名它)。
|
|
@@ -8677,6 +8816,8 @@ export interface ApprovalDecisionResult {
|
|
|
8677
8816
|
/** server ≥7.138.0 · 只随 {@link decisionCommitted} 出现:执行之前选中的那一行的**门身份**(与运维队列 / 收件行 / park 账本行同名同值)。身份读不出(老行 / 值没过信任边界)
|
|
8678
8817
|
* 或不适用(幂等回放不带门身份)⇒ 缺席;缺席不推断任何事,尤其不是「新一跑」。 */
|
|
8679
8818
|
checkpointId?: string;
|
|
8819
|
+
/** server ≥7.154.0 · **门身份读不出的开关**(与 `checkpointId` **恒只出其一**;好行逐字节不变):`checkpointId` 读不出可信值时缺席、同位带本键 —— `absent` = 没有可读的身份,`untrusted` = 有但没过判官。按本键判「这一行没有可信的门身份」,别拿缺席的 `checkpointId` 猜。 */
|
|
8820
|
+
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
8680
8821
|
/** 受理 / 终局 / parked 三形恒有;**回放形没有**(这次没有受理任何续跑,铸一个 status 是假话)。 */
|
|
8681
8822
|
status?: string;
|
|
8682
8823
|
/** 🔴 **谁的 run id 取决于这次 decide 落在哪条车道上**(server ≥7.69.0 起三条):
|
|
@@ -8893,9 +9034,32 @@ export interface SessionRewindFilesDiffStats {
|
|
|
8893
9034
|
filesChanged: string[];
|
|
8894
9035
|
insertions: number;
|
|
8895
9036
|
deletions: number;
|
|
9037
|
+
/** server ≥7.154.0 · **逐只文件行**(引擎 `FileHistoryRewindFile`,{@link SessionRewindFileRow}):这一次回退会写 / 删的文件与被拒的文件各一行;预览体只有这四键(`filesChanged` / `insertions` / `deletions` / `files`),**没有 `refused` / `failed` 列** ——
|
|
9038
|
+
* 被拒的文件只以 `files` 里的拒行出现,全被拒的预览答空 `filesChanged`、零计数、`files` 里一行行拒行。预览就是真回退那次**计划**的投影(落点判与链接安全判都在里面跑)。缺席 = 老 server(≤7.153.x)或不答逐只事实的引擎,**不是**「没有文件被拒」。 */
|
|
9039
|
+
files?: SessionRewindFileRow[];
|
|
9040
|
+
}
|
|
9041
|
+
/** 台账 / 预览里的**一只文件行**(server ≥7.154.0;引擎 `FileHistoryRewindFile` 的 wire 形,路径叶与原因叶过出口座)。
|
|
9042
|
+
* `path` = 历史记这只文件用的键(相对录它那一轮的根的名字,或该相对名已是另一处文件的键时的绝对路径);`targetPath` = **这一次**回退要写 / 删的绝对路径(拒行上 = 本会落在哪,与 `refused.recordedUnder` 合起来才是「为什么拒」的全貌)。
|
|
9043
|
+
* `filesChanged` / `refused` / `failed` 照留,`files` 是同一次回退按文件的另一种读法。判为相同(`identicalSkipped`)的文件**不进** `files`;落盘之前就失败的只在台账的 `failed[]` 里,**写 / 删已落盘之后才失败**的有一行并带 `failed`。 */
|
|
9044
|
+
export interface SessionRewindFileRow {
|
|
9045
|
+
path: string;
|
|
9046
|
+
targetPath: string;
|
|
9047
|
+
/** 回退在 `targetPath` 上做什么;拒行上 = 本会做什么。缺席 = 店没说。 */
|
|
9048
|
+
action?: "write" | "delete";
|
|
9049
|
+
/** 被拒的文件才有:`class` 与台账 `refused[]` 同词(开集读),`reason` 一句人话(一行,500 码元为界),`recordedUnder` 在 `recorded_elsewhere` 行上 = 当初录下这一版的目录(回到那里回退即可)。 */
|
|
9050
|
+
refused?: {
|
|
9051
|
+
class: SessionRewindRefusalClass;
|
|
9052
|
+
reason: string;
|
|
9053
|
+
recordedUnder?: string;
|
|
9054
|
+
};
|
|
9055
|
+
/** 写 / 删落了盘之后店又答失败的文件才有。 */
|
|
9056
|
+
failed?: {
|
|
9057
|
+
reason: string;
|
|
9058
|
+
};
|
|
8896
9059
|
}
|
|
8897
|
-
/** 台账上被拒文件的拒因类(引擎 `FileHistoryRefusalClass`):`link_safety`(符号链接 / 父链)· `base_unavailable`(基线版本缺失)· `key_unresolvable`(跟踪键解不出路径)
|
|
8898
|
-
|
|
9060
|
+
/** 台账上被拒文件的拒因类(引擎 `FileHistoryRefusalClass`):`link_safety`(符号链接 / 父链)· `base_unavailable`(基线版本缺失)· `key_unresolvable`(跟踪键解不出路径)·
|
|
9061
|
+
* `recorded_elsewhere`(server ≥7.154.0:这一版录在**另一个目录**下,不是这次回退要写 / 删的那个;拒行带 `recordedUnder`)· `place_unrecorded`(server ≥7.154.0:这一版没记下录在哪 —— 升级前录的、会话同步导入的;逐只拒,不看能力词 `file_history.recorded_place`)。开集读(引擎加类不让读口崩)。 */
|
|
9062
|
+
export type SessionRewindRefusalClass = "link_safety" | "base_unavailable" | "key_unresolvable" | "recorded_elsewhere" | "place_unrecorded" | (string & {});
|
|
8899
9063
|
/** 台账上的店故障(引擎 `FileHistoryError` 在 wire 上的形):引擎的 `code` 成员在 wire 上叫 **`errorCode`**(值逐字;本服务 wire 上没有叫 `code` 的错误键);`permanence` 逐字(缺席 = 店没判)。 */
|
|
8900
9064
|
export interface SessionRewindLedgerError {
|
|
8901
9065
|
errorCode: string;
|
|
@@ -8913,10 +9077,13 @@ export interface SessionRewindLedger {
|
|
|
8913
9077
|
outcome: "complete" | "partial";
|
|
8914
9078
|
filesChanged: string[];
|
|
8915
9079
|
identicalSkipped: string[];
|
|
9080
|
+
/** `recordedUnder`(server ≥7.154.0,`recorded_elsewhere` 行上)= 当初录下这一版的目录的绝对真实路径;`action` = 回退在这只文件上本会做什么(`write` / `delete`)。 */
|
|
8916
9081
|
refused: Array<{
|
|
8917
9082
|
path: string;
|
|
8918
9083
|
reason: string;
|
|
8919
9084
|
class: SessionRewindRefusalClass;
|
|
9085
|
+
recordedUnder?: string;
|
|
9086
|
+
action?: "write" | "delete";
|
|
8920
9087
|
}>;
|
|
8921
9088
|
failed: Array<{
|
|
8922
9089
|
path: string;
|
|
@@ -8924,6 +9091,8 @@ export interface SessionRewindLedger {
|
|
|
8924
9091
|
}>;
|
|
8925
9092
|
modeNotPreserved?: number;
|
|
8926
9093
|
error?: SessionRewindLedgerError;
|
|
9094
|
+
/** server ≥7.154.0 · 逐只文件行({@link SessionRewindFileRow}):改动的文件与被拒的文件各一行,写 / 删落盘后才失败的也一行;逐只的**失败原因仍读 `failed[]`**。缺席 = 老 server(≤7.153.x)或不答逐只事实的引擎。 */
|
|
9095
|
+
files?: SessionRewindFileRow[];
|
|
8927
9096
|
}
|
|
8928
9097
|
/** `dryRun: true` 的 200 体:`preview` 是统计,或 **`null`**(这台给不出统计:店没有 `diffStats` 预览座,或它没答)。🔴 **`null` ≠ 空** —— 别渲成「什么都不会变」;`filesChanged: []` + 零计数才是真的什么都不会变。
|
|
8929
9098
|
* 看 {@link Capabilities.sessionRewindFilesPreview}:位为假的部署照收 `dryRun`、答 `preview: null`。 */
|