@sema-agent/client-core 0.73.1 → 0.73.3
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 +34 -0
- package/README.md +3 -1
- package/dist/approvalsStreamLiveCapability.d.ts +42 -0
- package/dist/approvalsStreamLiveCapability.js +84 -0
- package/dist/hitl/approvalsFeed.js +2 -1
- package/dist/hitl/livePendingAsk.d.ts +12 -0
- package/dist/hitl/livePendingAsk.js +23 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/notifications.js +4 -1
- package/dist/steering.d.ts +2 -1
- package/dist/steering.js +2 -0
- package/dist/subagent/engineTaskHandleWire.d.ts +3 -1
- package/dist/subagent/engineTaskHandleWire.js +11 -2
- package/dist/toolResult.d.ts +4 -0
- package/dist/toolResult.js +16 -4
- package/docs/INTEGRATION-CLIENTS.md +75 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -49,6 +49,40 @@
|
|
|
49
49
|
> 挡住 ⇒ 本批把它机械化——④a0 对 `pending` 行**要求段头已是日期形**(`(未发布)` 直接红),阶段一
|
|
50
50
|
> commit 漏转在发布前就红,不再靠人记。
|
|
51
51
|
|
|
52
|
+
## 0.73.3(2026-09-19)
|
|
53
|
+
|
|
54
|
+
> 主题:**CC-61 sdk 9.7.1 提货 + `capabilities.approvalsStreamLive` 四态读口**(server 7.87.1)与 **CC-60 五条模型面文案锚的包侧半场**(下游锚登记表 A-D3 / A-D4 / A-D5 / A-D11 / A-D13,自 1.0.116 起挂在本包名下)。**patch**:型面纯 additive(+6 函数,公面 1026 → 1032;测试钩 48 → 49;`EngineTaskStatusAttachment.status` 联合 +`parked`;`parseModelFacingBash` 返回形 +可选 `note`;`mergeTaskOutput` +可选第三参;devDep sdk ^9.7.1,**peer 地板 >=9.6.0 不动**;零 wire 新键)。接入面 §65。
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- **`src/approvalsStreamLiveCapability.ts`(CC-61;server ≥7.87.1 S-455 / sdk 9.7.1)**:`capabilities.approvalsStreamLive`(= checkpointStore ∧ toolApproval)的四态读面,与 sql / writeProtection / webSearch.backend / executionLane 四只兄弟同构六导出 —— `projectApprovalsStreamLiveCapability` / `noteEngineCapsForApprovalsStreamLive` / `observedApprovalsStreamLive` / `approvalsStreamLiveDoctorDetail` / `forgetApprovalsStreamLiveReading` + 测试钩。🔴 **键缺席 = 判不出**(老 server),绝不折 false;严格布尔,畸形删格。**feed 消费方的判据归包**:`livePendingNeedsReconcile(reading)` —— 只有引擎明说会推(present ∧ true)才 `false`(对账节拍降为兜底);位为 false / 判不出 / 从没观测 ⇒ `true`,悬挂的子代 ask 只能靠 `ApprovalsFeedOptions.reconcile` 拉,**别等** `live_pending`。🔴 它是 doctor / 提示面的判据,**不是**关掉对账节拍的开关:推面可靠时对账退避到 `maxIntervalMs` 当兜底 —— push 腿一次瞬时 `list()` 失败今天不重试(复审查出,记 CC-62),对账节拍是唯一补偿。
|
|
59
|
+
- **五条模型面文案锚(CC-60)**:
|
|
60
|
+
- **A-D3** `mergeTaskOutput(prev, fresh, cursorSemantics?)` 优先读机读位(server ≥7.77.0 `taskOutput` 面的 `cursorSemantics`:`"full"` = 全量重读安全 ⇒ 替换;`"cursor"` = 读了就消费 ⇒ 追加);缺席 / 认不出 ⇒ 现行 spool 标记文案臂兜底(**缺席不当 full**)。`fetchEngineTaskOutput` 真把回体**顶层** `cursorSemantics`(sdk `SubagentOutputResult` 上与 `output` 并列;发车前复审抓的:首版读成 `output.cursorSemantics`,正常回体恒回落文案臂)喂进去(门有源码钉 + 上游锚)。
|
|
61
|
+
- **A-D4** `PROTOCOL_MARKERS.taskOutputResultLine` 认可选括号注记 `--- result (partial) ---`(core 被 stop 打断的子代任务此前正文整段切不出)。
|
|
62
|
+
- **A-D5** `PROTOCOL_MARKERS.bashHead` 认 core 两个发货变体:exit1 注记形 `exit code: 1 (<note>)` 与图片形(首行后无 `--- stdout ---`,紧跟 `[Image data detected …]`);注记反解进 `parseModelFacingBash` 的新可选位 `note`,并在 structured 缺席(core `boundedCard` 超 64 KiB 整只丢)时喂给**同一个**良性退出槽 —— 只放宽正则会把「正文丢失」换成「红色错误卡」。structured 在场仍以它为准。
|
|
63
|
+
- **A-D11** 通知去重的 seed 扫描按**两个生产者的并集**判终局:core task-notification(带 `cancelled`)∪ 本包 `enqueueBgChildNotification`(run 行状态面,带 `blocked`)= {completed, failed, killed, blocked, cancelled};`event` 是唯一非终局。两张冻结元组各自不动(动任一张 = 丢掉另一个生产者的词)。此前只借 run 级表 ⇒ `cancelled` 通知在 crash 窗重放时二次喂模型。
|
|
64
|
+
- **A-D13** `PHRASE_TO_STATUS` 认 core 第四个 vbl 臂 `parked awaiting an out-of-band approval — do NOT re-issue the gated call` ⇒ `parked`(排在 raw-status 兜底组之前;裸 `parked` 不猜)。此前这一形恒不命中 ⇒ compaction 后停在待批检查点的后台任务整行消失。
|
|
65
|
+
- 新门 `scripts/run-approvals-stream-live-capability-test.mjs`(24 格)+ `scripts/run-model-facing-anchors-test.mjs`(20 格);变异反证八枚逐格见红。
|
|
66
|
+
|
|
67
|
+
### Changed(记账)
|
|
68
|
+
|
|
69
|
+
- devDep `@sema-agent/sdk` ^9.6.0 → ^9.7.1(peer 地板不动)。sdk 9.7.0 / 9.7.1 追平的六处型面与包内镜像逐一对表:`Capabilities.executionLane` / `.approvalsStreamLive`(本包结构读,与声明同形)、`LivePendingRow.frame?` / `contentKind?`(本包三道闸结构读,`contentKind` 本版不消费)、`ApprovalStreamEvent.type` +`live_pending` / `live_resolved`(feed 一贯不解析载荷,零动作)、`WiringManifest*` 三具名 schema(包内镜像编译期钉未红,零动作)、`stats.humanReview.gates[].toolCallId`(0.72.11 起已消费)。`queuedCount` 幻影键 sdk 保留到下一个 major ⇒ 本包 wire 键元组暂不动。
|
|
70
|
+
- gate-vocabulary 门 D2c 措辞:`DecisionReason` 的 `read_only` 归属由「候 sdk 镜像」改为「sdk 不铸型面(9.7.0 G31 登记门)」—— 本包零措辞铸点不变。
|
|
71
|
+
|
|
72
|
+
## 0.73.2(2026-09-18)
|
|
73
|
+
|
|
74
|
+
> 主题:**悬挂的子代 ask 从盲卡到全卡**(CC-59;server ≥7.87.0 在 `GET /v1/approvals` 的 `livePending[]` 行上补了 `frame` = 本来会 emit 的那只 `tool_approval` 帧)+ **CC-34 收口**(`permission_denials` 自动升级腿的引擎半场随 server 7.87.0 到货,验证判据交黑盒)。**patch**:型面纯 additive(公面导出名零增减 1026;`LivePendingAskView` +1 可选位 `frame`;零 wire 新键 —— 键由 server 铸;peer 不动)。接入面 §64。
|
|
75
|
+
|
|
76
|
+
### Added
|
|
77
|
+
|
|
78
|
+
- **`LivePendingAskView.frame?: ToolApprovalFrame`**:`readLivePendingRows` 只在三道闸都过时落这一位 —— 帧判别器过 **且** `type === 'tool_approval'`(判别器也放行 `tool_approval_complete`,完成帧会以空入参出一张可编辑的卡 —— 发车前复审抓的)**且** `frame.approvalId === row.approvalId`;否则 **丢该位不丢行**(行仍按四必填位成立,走盲卡)。整只原样带出,不复制帧腿的逐键窄读。
|
|
79
|
+
- **`surfaceSuspendedAskAndRespond` 在 `frame` 在场时出全卡**:直接把那只帧送进流内帧腿(`surfaceToolApprovalFrameAndRespond(frame, respond, undefined, signal, lane)`),与宿主流活着时收到同一只帧**逐字同一条路** —— 入参可见、改写可转发、规则报价 / 风险位照常、子代徽章来自帧上的 `fromSubagent` / `sourceTaskId`;身份键仍是行的 `approvalId`(读器已钉相等)。`frame` 缺席(老 server)⇒ 0.72.14 的盲卡形不变(`argsUnavailable` + 拒发带改写的批准)。
|
|
80
|
+
- **feed 变化摘要含 `frame` 在场性 + tracker delta 加 `upgraded`**:同一行先盲后全(server 滚动升级到 ≥7.87.0 的中途形)是内容变了,发新快照;`ingest` 对此前出过盲卡、这张快照上 `frame` 到了的行返回 `upgraded`(恰一次)。🔴 **包不替换已出的盲卡**:帧腿撤卡的唯一方式是给一个决断,那会把 ask 结算掉;端若有按 callKey 原地更新卡的能力就刷新入参,否则让用户在盲卡上决定。常态(7.87.0 起帧从第一张快照就在)不会走到这里。
|
|
81
|
+
|
|
82
|
+
### Fixed(记账)
|
|
83
|
+
|
|
84
|
+
- **CC-34 `permission_denials` 自动升级**:包侧升级腿 0.72.11 已通电(`_sema_permission_denials[].tool_use_id` 自 `stats.humanReview.gates[].toolCallId` 自动带值),引擎半场随 server 7.87.0 到货(逐字透传,缺席 = 不可 join)。本版只补接入档一行;真字节回归需真引擎,判据在发车帖交黑盒(headless 终帧 `tool_use_id` 带值 ∧ `_absent` 不落;负控 7.86.0 上 `_absent` 落)。
|
|
85
|
+
|
|
52
86
|
## 0.73.1(2026-09-18)
|
|
53
87
|
|
|
54
88
|
> 主题:两张清账票 —— **CC-57** `decidePlanReview` 的 outcome 尾句按「决断有没有生效」选(黑盒验收抓出的产品关切;pre-existing)+ **CC-56** 两条 wire 拒绝的人话面(cancel 的 409 按机器码分家;提交面 429 用量窗)。**patch**:型面纯 additive(+2 常量 +5 函数,公面 1019 → 1026;测试钩 47 → 48;`ControlSafetyCode` 闭集 +1 `cancel_run_not_running`;零 wire 新键;peer 不动)。接入面 §63。
|
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Renamed from **`@sema-agent/wire-cc-adapter`** (0.1.x, deprecated — see *Migra
|
|
|
35
35
|
|
|
36
36
|
## Scope
|
|
37
37
|
|
|
38
|
-
**Version:** 0.73.
|
|
38
|
+
**Version:** 0.73.3
|
|
39
39
|
|
|
40
40
|
- **Today** — the adapter seam, the whole `adapt()` pipeline (all 14 A-layer arms plus the
|
|
41
41
|
B/D/E tool-card layers), the notification/caps/model families, the adapter kernel (stream driver
|
|
@@ -313,6 +313,8 @@ public-surface guard checks that last one).
|
|
|
313
313
|
| `scripts/run-tool-disclosure-progress-projection-test.mjs` | The two wire arms sdk 9.6.0 adds — `tool_disclosure` (name-only tool census: open-set `policy`, `thresholdPercent` absent ≠ default, `deferred`/`activated` full snapshots) and `tool_progress` (one frame, two beats: Bash ticks carry an output tail with `totalLines`/`totalBytes` that come and go together; other tools carry only `elapsedSeconds`) — project to neutral internal arms plus chrome arms. Required keys missing ⇒ `malformed`; bad optional keys drop only themselves; the sub-flow three-key gate keeps child frames off the leader lane; both arms are `required: false` in the arm table with duties stated (the output tail is untrusted raw and must never be fed back to the model). |
|
|
314
314
|
| `scripts/run-mcp-panel-projection-test.mjs` | The `GET /v1/sessions/:id/mcp` panel reader (`projectMcpPanel`; server >=7.77.0 adds the optional `lastLegMcp` key) and the single wording mint for its "last leg" line. Absence of `lastLegMcp` is one literal sentence that never blames the engine version (a new session, a leg outside the retention window, a leg without a manifest and an older engine all look the same on the wire); a key that is present but unreadable is a different sentence plus a `lastLegMcpUnreadable: true` mark, never folded into absence. The `mcp[]` roster goes through the same reader as the live `wiring_manifest` third section, so a replayed roster and a live one have one shape. The two faces of the panel (`servers[]` and the last-leg roster) may legitimately differ, so the view carries no agreement flag and none of the five sentences mentions `servers`. Required keys are pinned to the SDK `openapi.yaml` component bytes **0.69.0:** `fetchMcpPanel` fetches the panel through the SDK client's own `sessions.mcp` call (same transport and auth as every other read) and projects it; transport failure, an unreadable body and an empty session id all come back as `undefined`, never as a fabricated empty panel 0.71.0 adds section K: `mcpEngineLegPresence(view)` — the engine-side MCP presence tri-state read only off the panel view (`unknown` when the view could not be read, never rendered as "no MCP configured") |
|
|
315
315
|
| `scripts/run-absence-fold-census-test.mjs` | A package-wide census of the "absence folded into a positive outcome" defect shape, so that fixing the six sites this release does not merely move the shape somewhere else. The defect is defined by position, not syntax: a fallback position (the unconditional tail return, the `default:` arm, the literal minted when there is nothing to pass on, the value returned from an error path) may only say `unknown` or stay absent, never a positive word. Detection walks the syntax tree of every source file, so comments, strings and multi-line spellings cannot hide or fake a hit, and covers five forms: the right arm of `??` / `||`, the else arm of a ternary, the first return of an explicit `default:`, a `catch` block or `.catch(() => …)` arrow returning a healthy value, and a function whose last statement returns a positive word after other returns. Every remaining hit must be registered with a written reason, an unregistered hit fails the gate naming the file and line, the registered count must equal the real count so a cleared site cannot leave a spare allowance behind, and the gate proves its own teeth behind a fence (a failed self-proof refuses to report any count): each form injected into an in-memory copy must add exactly one hit, two correct spellings are pinned as non-hits, and samples inside comments or strings do not count. It also pins the headline site: the fleet panel projection no longer mints an `end` with `isError: false` on absence |
|
|
316
|
+
| `scripts/run-approvals-stream-live-capability-test.mjs` | The engine's live-approval-push self-description (`capabilities.approvalsStreamLive`, engine ≥7.87.1), read the same four-state way as its four sibling capability readers: an absent key is reported as not reported (never folded into `false`), the value must be a strict boolean, and the one decision the feed consumer needs — whether it must keep pulling suspended asks itself — is answered by `livePendingNeedsReconcile`, which only says no when the engine explicitly says it pushes. |
|
|
317
|
+
| `scripts/run-model-facing-anchors-test.mjs` | Five places where model-facing engine text is parsed back into card slots: the task-output cursor semantics machine-readable key wins over the spool marker text (and its absence is never read as `full`), the `--- result (…) ---` line accepts a parenthesised note, the bash header accepts the engine's exit-note and image variants and carries the note into the same benign-exit slot the structured path uses, the notification seed scan treats both producers' terminal words as terminal, and the parked background-task phrase is recognised. |
|
|
316
318
|
| `scripts/run-execution-lane-capability-test.mjs` | The deployment execution-lane self-description (`capabilities.executionLane`, engine ≥7.86.0), read the same four-state way as its three sibling capability readers. An absent key is reported as "not reported" and never as "tools do not run on this host": on an older engine the client keeps inferring the lane the way it did before, because reading absence as `false` would silently stop every host deployment from sending skill `baseDir`. The implication is one-way (`toolsOnThisHost: false` means `baseDir` is never sent; `true` is only a necessary condition), `provider` is read as an open non-empty string rather than a hand-copied closed set and is sanitised and bounded before display, `toolsOnThisHost` must be a strict boolean, extra members never cross, the tee never throws, stale generations are dropped whole, and the single "do tools run here" predicate uses the bit when it is present and the caller's own inference, unchanged, when it is not |
|
|
317
319
|
| `scripts/run-live-pending-ask-test.mjs` | Suspended in-stream asks (the `livePending` section of `GET /v1/approvals`): an absent key reads as not reported (never an empty list or a zero count), an unreadable section leaves the previous snapshot in place, rows are narrow-read (malformed rows dropped and counted, optional flags only-if-true, extra members never cross), the feed digest covers the section so an ask appearing or settling produces a snapshot, the host-gated reconcile cadence re-lists while the push leg is connected and backs off when nothing changes, the tracker surfaces each `approvalId` once and reports it gone once, and the decision runs through the same respond chain as the in-stream frame leg — with the card stating that the tool arguments are not visible and edits on that card never forwarded. |
|
|
318
320
|
| `scripts/run-leader-conflict-test.mjs` | The leader-run terminal `needs_human` + `result.conflict` (engine ≥7.83.0), read once for all three shells. A `result` without a `conflict` key is reported as `none` and worded as "no conflict details" rather than "no conflict": on the wire it is indistinguishable from an older engine that never reports one, and the reader does not pick a side. A `conflict` that is present but unreadable is a third word, never folded into `none`, because a tree that carries conflict markers must not be rendered as clean. `filesTruncated` is honoured only as `true` (absent means the list is complete; any other value makes the section unreadable), `workers[].applied` is passed through as the boolean fact it is, `salvaged[].patch` is handed to the save path byte-for-byte (an artifact, not screen text; a malformed row is dropped alone, and a salvage list that is present but cannot be fully read is flagged rather than rendered as "no patches"), and `rejHead` — the one on-screen diagnostic — is escaped and bounded before display. The record never throws on hostile input, extra members do not cross, arrays are fresh copies, and the single sentence minted here names the base, the files, which branches landed and which did not, and how many patches can be saved, without ever suggesting a retry: `needs_human` is a run waiting for a person, and the no-details sentence says plainly that it is not proof of a merge |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* approvalsStreamLiveCapability — `GET /v1/capabilities.approvalsStreamLive`(server ≥7.87.1;sdk 9.7.1 `Capabilities.approvalsStreamLive?: boolean`)
|
|
3
|
+
* 的三端共用读面(0.73.3;与 sql / writeProtection / webSearch.backend / executionLane 四只兄弟同一套四态词汇)。
|
|
4
|
+
*
|
|
5
|
+
* ── 这一位答的是哪一个问题 ────────────────────────────────────────────────────────────────
|
|
6
|
+
* 「这台引擎会不会在 `approvals.stream` 上推流内 ask 的进出(`live_pending` / `live_resolved`)」= checkpointStore ∧ toolApproval。
|
|
7
|
+
* 它决定 feed 消费方要不要**靠**推面:位为 true ⇒ 推面可靠,对账节拍(`ApprovalsFeedOptions.reconcile`)只是兜底;
|
|
8
|
+
* 位为 false / 键缺席 / 从没观测 ⇒ 推面**不可靠或判不出**,对账节拍是悬挂 ask 的唯一拉面 —— **别等** `live_pending`。
|
|
9
|
+
*
|
|
10
|
+
* ── 🔴 读法 ─────────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
* ① **键缺席 ≠ false**:老 server(<7.87.1)不报这一位 ⇒ `not_reported`(判不出),按「要拉」处理;折成 false 是替引擎断言「不推」。
|
|
12
|
+
* ② 严格布尔;`null` / 串 / 数 / 数组 / 对象 ⇒ 畸形(删格 ⇒ `unobserved`)。
|
|
13
|
+
* ③ 「要不要对账」的判据归包:{@link livePendingNeedsReconcile} —— 只有 present 且 true 才 false;其余一律 true(少查一次 = 一只等人的 ask 迟迟不出现)。
|
|
14
|
+
*/
|
|
15
|
+
/** 四态读数。`unobserved` 由读口在这一格空缺时铸,不由投影铸。 */
|
|
16
|
+
export type ApprovalsStreamLiveReading = {
|
|
17
|
+
kind: 'unobserved';
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'not_reported';
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'present';
|
|
22
|
+
live: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** caps 回体 → 本格读数;畸形一律 `undefined`(= 这一格不写 ⇒ 读口答 `unobserved`)。 */
|
|
25
|
+
export declare function projectApprovalsStreamLiveCapability(caps: unknown): ApprovalsStreamLiveReading | undefined;
|
|
26
|
+
/** 宿主 caps probe 的读面 tee 落点(与四只兄弟并列)。绝不 throw;畸形 ⇒ 删格;`opts.generation` 关掉旧探测覆盖新读数的竞态。 */
|
|
27
|
+
export declare function noteEngineCapsForApprovalsStreamLive(baseUrl: string, caps: unknown, opts?: {
|
|
28
|
+
generation?: number;
|
|
29
|
+
}): void;
|
|
30
|
+
/** 本进程观测到的读数;这一格空缺 ⇒ `{kind:'unobserved'}`。 */
|
|
31
|
+
export declare function observedApprovalsStreamLive(baseUrl?: string | undefined): ApprovalsStreamLiveReading;
|
|
32
|
+
/**
|
|
33
|
+
* feed 消费方「要不要靠对账节拍拉悬挂 ask」的判据单源:只有引擎明说会推(present ∧ true)才 `false`;
|
|
34
|
+
* 位为 false / 老 server 判不出 / 从没观测 ⇒ `true`。fail-safe 方向定在「查」(与 `shouldPoll` 同一条理由)。
|
|
35
|
+
*/
|
|
36
|
+
export declare function livePendingNeedsReconcile(reading: ApprovalsStreamLiveReading): boolean;
|
|
37
|
+
/** doctor 那一行的 detail 串,唯一措辞真源。🔴 `not_reported` 句不许暗示「不推」。 */
|
|
38
|
+
export declare function approvalsStreamLiveDoctorDetail(reading: ApprovalsStreamLiveReading): string;
|
|
39
|
+
/** 换代失效口(引擎温切成功后调):清成未观测。空串 ⇒ no-op;绝不 throw。 */
|
|
40
|
+
export declare function forgetApprovalsStreamLiveReading(baseUrl: string | undefined): void;
|
|
41
|
+
/** 测试钩子。 */
|
|
42
|
+
export declare function __resetApprovalsStreamLiveReadingsForTests(): void;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* approvalsStreamLiveCapability — `GET /v1/capabilities.approvalsStreamLive`(server ≥7.87.1;sdk 9.7.1 `Capabilities.approvalsStreamLive?: boolean`)
|
|
3
|
+
* 的三端共用读面(0.73.3;与 sql / writeProtection / webSearch.backend / executionLane 四只兄弟同一套四态词汇)。
|
|
4
|
+
*
|
|
5
|
+
* ── 这一位答的是哪一个问题 ────────────────────────────────────────────────────────────────
|
|
6
|
+
* 「这台引擎会不会在 `approvals.stream` 上推流内 ask 的进出(`live_pending` / `live_resolved`)」= checkpointStore ∧ toolApproval。
|
|
7
|
+
* 它决定 feed 消费方要不要**靠**推面:位为 true ⇒ 推面可靠,对账节拍(`ApprovalsFeedOptions.reconcile`)只是兜底;
|
|
8
|
+
* 位为 false / 键缺席 / 从没观测 ⇒ 推面**不可靠或判不出**,对账节拍是悬挂 ask 的唯一拉面 —— **别等** `live_pending`。
|
|
9
|
+
*
|
|
10
|
+
* ── 🔴 读法 ─────────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
* ① **键缺席 ≠ false**:老 server(<7.87.1)不报这一位 ⇒ `not_reported`(判不出),按「要拉」处理;折成 false 是替引擎断言「不推」。
|
|
12
|
+
* ② 严格布尔;`null` / 串 / 数 / 数组 / 对象 ⇒ 畸形(删格 ⇒ `unobserved`)。
|
|
13
|
+
* ③ 「要不要对账」的判据归包:{@link livePendingNeedsReconcile} —— 只有 present 且 true 才 false;其余一律 true(少查一次 = 一只等人的 ask 迟迟不出现)。
|
|
14
|
+
*/
|
|
15
|
+
import { engineWireTarget } from './engineWireTarget.js';
|
|
16
|
+
import { engineCapsGeneration } from './engineCapsCache.js';
|
|
17
|
+
/** caps 回体 → 本格读数;畸形一律 `undefined`(= 这一格不写 ⇒ 读口答 `unobserved`)。 */
|
|
18
|
+
export function projectApprovalsStreamLiveCapability(caps) {
|
|
19
|
+
if (caps === null || typeof caps !== 'object')
|
|
20
|
+
return undefined;
|
|
21
|
+
if (!('approvalsStreamLive' in caps))
|
|
22
|
+
return { kind: 'not_reported' };
|
|
23
|
+
const v = caps.approvalsStreamLive;
|
|
24
|
+
if (v === undefined)
|
|
25
|
+
return { kind: 'not_reported' };
|
|
26
|
+
if (typeof v !== 'boolean')
|
|
27
|
+
return undefined;
|
|
28
|
+
return { kind: 'present', live: v };
|
|
29
|
+
}
|
|
30
|
+
const readingByBase = new Map();
|
|
31
|
+
/** 宿主 caps probe 的读面 tee 落点(与四只兄弟并列)。绝不 throw;畸形 ⇒ 删格;`opts.generation` 关掉旧探测覆盖新读数的竞态。 */
|
|
32
|
+
export function noteEngineCapsForApprovalsStreamLive(baseUrl, caps, opts) {
|
|
33
|
+
try {
|
|
34
|
+
if (typeof baseUrl !== 'string' || baseUrl === '')
|
|
35
|
+
return;
|
|
36
|
+
if (opts?.generation !== undefined && opts.generation !== engineCapsGeneration(baseUrl))
|
|
37
|
+
return;
|
|
38
|
+
const reading = projectApprovalsStreamLiveCapability(caps);
|
|
39
|
+
if (reading === undefined) {
|
|
40
|
+
readingByBase.delete(baseUrl);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
readingByBase.set(baseUrl, reading);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
/* fail-soft:本 tee 任何分支都不许打断 caps 探测链 */
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** 本进程观测到的读数;这一格空缺 ⇒ `{kind:'unobserved'}`。 */
|
|
50
|
+
export function observedApprovalsStreamLive(baseUrl = engineWireTarget()?.baseUrl) {
|
|
51
|
+
if (typeof baseUrl !== 'string' || baseUrl === '')
|
|
52
|
+
return { kind: 'unobserved' };
|
|
53
|
+
return readingByBase.get(baseUrl) ?? { kind: 'unobserved' };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* feed 消费方「要不要靠对账节拍拉悬挂 ask」的判据单源:只有引擎明说会推(present ∧ true)才 `false`;
|
|
57
|
+
* 位为 false / 老 server 判不出 / 从没观测 ⇒ `true`。fail-safe 方向定在「查」(与 `shouldPoll` 同一条理由)。
|
|
58
|
+
*/
|
|
59
|
+
export function livePendingNeedsReconcile(reading) {
|
|
60
|
+
return !(reading.kind === 'present' && reading.live === true);
|
|
61
|
+
}
|
|
62
|
+
/** doctor 那一行的 detail 串,唯一措辞真源。🔴 `not_reported` 句不许暗示「不推」。 */
|
|
63
|
+
export function approvalsStreamLiveDoctorDetail(reading) {
|
|
64
|
+
switch (reading.kind) {
|
|
65
|
+
case 'unobserved':
|
|
66
|
+
return 'live approval push not observed — the engine reports it on /v1/capabilities; this process has not received a capabilities response yet, so suspended asks are pulled by the reconcile cadence';
|
|
67
|
+
case 'not_reported':
|
|
68
|
+
return 'live approval push not reported by this engine — only newer engines advertise it; this does not say whether it pushes, so suspended asks are pulled by the reconcile cadence';
|
|
69
|
+
case 'present':
|
|
70
|
+
return reading.live
|
|
71
|
+
? 'live approval push on — the engine announces suspended asks on the approvals stream; the reconcile cadence is only a fallback'
|
|
72
|
+
: 'live approval push off on this deployment (no checkpoint store or tool approvals disabled) — suspended asks are only visible through the reconcile cadence, so the client polls for them';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** 换代失效口(引擎温切成功后调):清成未观测。空串 ⇒ no-op;绝不 throw。 */
|
|
76
|
+
export function forgetApprovalsStreamLiveReading(baseUrl) {
|
|
77
|
+
if (typeof baseUrl !== 'string' || baseUrl === '')
|
|
78
|
+
return;
|
|
79
|
+
readingByBase.delete(baseUrl);
|
|
80
|
+
}
|
|
81
|
+
/** 测试钩子。 */
|
|
82
|
+
export function __resetApprovalsStreamLiveReadingsForTests() {
|
|
83
|
+
readingByBase.clear();
|
|
84
|
+
}
|
|
@@ -28,7 +28,8 @@ function digestOf(rows, live) {
|
|
|
28
28
|
const liveDigest = live === undefined
|
|
29
29
|
? 'absent'
|
|
30
30
|
: live
|
|
31
|
-
|
|
31
|
+
// 0.73.2:`frame` 在场性进摘要 —— 同一行先盲后全(server 补帧)是内容变了,端要换全卡。
|
|
32
|
+
.map(r => [r.approvalId, r.toolName, String(r.expiresAtMs), r.sessionId ?? '', r.originTaskId ?? '', r.frame !== undefined ? 'f' : ''].join(LIVE_FIELD_SEP))
|
|
32
33
|
.sort()
|
|
33
34
|
.join(LIVE_ROW_SEP);
|
|
34
35
|
return `${durableDigestOf(rows)}${LIVE_SECTION_SEP}${liveDigest}`;
|
|
@@ -34,6 +34,12 @@ export interface LivePendingAskView {
|
|
|
34
34
|
fromSubagent?: true;
|
|
35
35
|
/** 子代 taskId(与 `fromSubagent` 同生同缺)。 */
|
|
36
36
|
originTaskId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* 0.73.2(server ≥7.87.0):本来会 emit 的那只 `tool_approval` 帧(含入参 / 窗三键 / 规则报价 …)。在场 ⇒ 出**全卡**;
|
|
39
|
+
* 缺席(老 server)⇒ 盲卡(`argsUnavailable`)。只在帧判别器过 **且** `type === 'tool_approval'` **且** `frame.approvalId === approvalId` 时在场(否则坏形丢该位不丢行);
|
|
40
|
+
* 整只原样带出,帧腿自己逐键窄读。
|
|
41
|
+
*/
|
|
42
|
+
frame?: ToolApprovalFrame;
|
|
37
43
|
}
|
|
38
44
|
/** `livePending` 段的三态读数。`malformed` = 键在场但读不懂(**不**折成 `not_reported`,也不折成空)。 */
|
|
39
45
|
export type LivePendingReading = {
|
|
@@ -81,6 +87,12 @@ export interface SuspendedAskDelta {
|
|
|
81
87
|
appeared: LivePendingAskView[];
|
|
82
88
|
/** 此前 appeared 过、现在不在列表里的 approvalId(已被别处决断 / 过期 / 引擎换代)⇒ 撤卡。 */
|
|
83
89
|
gone: string[];
|
|
90
|
+
/**
|
|
91
|
+
* 0.73.2:此前 appeared 过(当时无 `frame`,出的是盲卡)、这一张快照上 `frame` 到了的行(server 滚动升级到 ≥7.87.0 的中途形)。
|
|
92
|
+
* 🔴 包**不会**替换已出的盲卡(帧腿撤卡的唯一方式是给一个决断,那会把 ask 结算掉);端若有按 callKey 原地更新卡的能力就用它刷新
|
|
93
|
+
* 入参,否则让用户在盲卡上决定 —— 常态(7.87.0 起帧从第一张快照就在)不会走到这里。
|
|
94
|
+
*/
|
|
95
|
+
upgraded: LivePendingAskView[];
|
|
84
96
|
}
|
|
85
97
|
export interface SuspendedAskTracker {
|
|
86
98
|
ingest(snapshot: ApprovalsFeedSnapshot | null | undefined): SuspendedAskDelta;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* sdk 的 barrel 没有导出这一行的类型 ⇒ 按**结构**窄读(与 `capabilities.executionLane` 同一姿势),多余成员不过境。
|
|
18
18
|
*/
|
|
19
|
-
import { surfaceToolApprovalFrameAndRespond, } from './toolApprovalWire.js';
|
|
19
|
+
import { isToolApprovalFrame, surfaceToolApprovalFrameAndRespond, } from './toolApprovalWire.js';
|
|
20
20
|
function nonEmptyString(v) {
|
|
21
21
|
return typeof v === 'string' && v !== '';
|
|
22
22
|
}
|
|
@@ -62,6 +62,8 @@ export function readLivePendingRows(body) {
|
|
|
62
62
|
...(o.governanceForced === true ? { governanceForced: true } : {}),
|
|
63
63
|
...(o.fromSubagent === true ? { fromSubagent: true } : {}),
|
|
64
64
|
...(nonEmptyString(o.originTaskId) ? { originTaskId: o.originTaskId } : {}),
|
|
65
|
+
// 三道闸:审批帧判别器 ∧ **type 恰是 tool_approval**(判别器也放行 tool_approval_complete —— 完成帧会以空入参出一张可编辑的卡)∧ approvalId 相等
|
|
66
|
+
...(isToolApprovalFrame(o.frame) && o.frame.type === 'tool_approval' && o.frame.approvalId === o.approvalId ? { frame: o.frame } : {}),
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
return { kind: 'present', rows, dropped };
|
|
@@ -105,6 +107,11 @@ export function livePendingRowToApprovalFrame(row) {
|
|
|
105
107
|
* 批准了人没看到的原始入参)。
|
|
106
108
|
*/
|
|
107
109
|
export function surfaceSuspendedAskAndRespond(row, respond, signal, lane) {
|
|
110
|
+
// 0.73.2:行上带 `frame`(server ≥7.87.0)⇒ 全卡,与流内帧腿收到同一只帧时**逐字同一条路**(入参可见、改写可转发、窗三键由 lane 决定);
|
|
111
|
+
// 缺席 ⇒ 盲卡形不变。两形的身份键都是行的 `approvalId`(读器已钉 frame.approvalId 与之相等)。
|
|
112
|
+
if (row.frame !== undefined) {
|
|
113
|
+
return surfaceToolApprovalFrameAndRespond(row.frame, respond, undefined, signal, lane);
|
|
114
|
+
}
|
|
108
115
|
return surfaceToolApprovalFrameAndRespond(livePendingRowToApprovalFrame(row), respond, undefined, signal, {
|
|
109
116
|
...lane,
|
|
110
117
|
argsUnavailable: true,
|
|
@@ -124,6 +131,8 @@ const TRACKER_UNSEEN_CLAIMS_MAX = 512;
|
|
|
124
131
|
*/
|
|
125
132
|
export function createSuspendedAskTracker(filter) {
|
|
126
133
|
const shown = new Set();
|
|
134
|
+
/** 已出卡的行当时有没有 `frame`(先盲后全 ⇒ upgraded)。 */
|
|
135
|
+
const shownWithFrame = new Set();
|
|
127
136
|
const claimed = new Map();
|
|
128
137
|
const claim = (id) => {
|
|
129
138
|
if (claimed.has(id))
|
|
@@ -147,14 +156,22 @@ export function createSuspendedAskTracker(filter) {
|
|
|
147
156
|
const rows = suspendedSubagentAsks(snapshot, filter);
|
|
148
157
|
const present = new Set(rows.map(r => r.approvalId));
|
|
149
158
|
const appeared = [];
|
|
159
|
+
const upgraded = [];
|
|
150
160
|
for (const r of rows) {
|
|
151
161
|
if (claimed.has(r.approvalId)) {
|
|
152
162
|
claimed.set(r.approvalId, true);
|
|
153
163
|
continue;
|
|
154
164
|
}
|
|
155
|
-
if (shown.has(r.approvalId))
|
|
165
|
+
if (shown.has(r.approvalId)) {
|
|
166
|
+
if (r.frame !== undefined && !shownWithFrame.has(r.approvalId)) {
|
|
167
|
+
shownWithFrame.add(r.approvalId);
|
|
168
|
+
upgraded.push(r);
|
|
169
|
+
}
|
|
156
170
|
continue;
|
|
171
|
+
}
|
|
157
172
|
shown.add(r.approvalId);
|
|
173
|
+
if (r.frame !== undefined)
|
|
174
|
+
shownWithFrame.add(r.approvalId);
|
|
158
175
|
appeared.push(r);
|
|
159
176
|
}
|
|
160
177
|
const gone = [];
|
|
@@ -162,13 +179,14 @@ export function createSuspendedAskTracker(filter) {
|
|
|
162
179
|
if (present.has(id))
|
|
163
180
|
continue;
|
|
164
181
|
shown.delete(id);
|
|
182
|
+
shownWithFrame.delete(id);
|
|
165
183
|
gone.push(id);
|
|
166
184
|
}
|
|
167
185
|
// 见过、现在不在列表里的认领 = 这只 ask 已结算 ⇒ 离账
|
|
168
186
|
for (const [id, seen] of [...claimed])
|
|
169
187
|
if (seen && !present.has(id))
|
|
170
188
|
claimed.delete(id);
|
|
171
|
-
return { appeared, gone };
|
|
189
|
+
return { appeared, gone, upgraded };
|
|
172
190
|
},
|
|
173
191
|
noteSurfacedByStream(approvalId) {
|
|
174
192
|
if (typeof approvalId !== 'string' || approvalId === '')
|
|
@@ -182,6 +200,7 @@ export function createSuspendedAskTracker(filter) {
|
|
|
182
200
|
if (typeof approvalId !== 'string' || approvalId === '')
|
|
183
201
|
return;
|
|
184
202
|
// 从快照出过卡的 ask 已在列表里见过 ⇒ 认领直接记「见过」,结算后随列表消失离账
|
|
203
|
+
shownWithFrame.delete(approvalId);
|
|
185
204
|
const wasShown = shown.delete(approvalId);
|
|
186
205
|
if (wasShown)
|
|
187
206
|
claimed.set(approvalId, true);
|
|
@@ -192,6 +211,7 @@ export function createSuspendedAskTracker(filter) {
|
|
|
192
211
|
if (typeof approvalId !== 'string' || approvalId === '')
|
|
193
212
|
return;
|
|
194
213
|
shown.delete(approvalId);
|
|
214
|
+
shownWithFrame.delete(approvalId);
|
|
195
215
|
claimed.delete(approvalId);
|
|
196
216
|
},
|
|
197
217
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -156,6 +156,7 @@ export * from './sqlEngineCapability.js';
|
|
|
156
156
|
export * from './writeProtectionCapability.js';
|
|
157
157
|
export * from './webSearchBackendCapability.js';
|
|
158
158
|
export * from './executionLaneCapability.js';
|
|
159
|
+
export * from './approvalsStreamLiveCapability.js';
|
|
159
160
|
export * from './mcpReconnect.js';
|
|
160
161
|
export * from './leaderConflict.js';
|
|
161
162
|
export * from './runTerminal.js';
|
package/dist/index.js
CHANGED
|
@@ -190,6 +190,8 @@ export * from './webSearchBackendCapability.js';
|
|
|
190
190
|
// 0.72.13 CC-54:`capabilities.executionLane`(server ≥7.86.0 S-426)四态读面 —— 键缺席 = 老 server 判不了(≠ 不是本机车道);
|
|
191
191
|
// 「工具是否跑在本机」判据归包(读到位用位,读不到原样用调用方旁证)。
|
|
192
192
|
export * from './executionLaneCapability.js';
|
|
193
|
+
// · approvalsStreamLiveCapability(0.73.3 CC-61):capabilities.approvalsStreamLive 四态读面 + feed 消费方「要不要靠对账拉」的判据单源。
|
|
194
|
+
export * from './approvalsStreamLiveCapability.js';
|
|
193
195
|
// S-381 / core 7.22.0 #857(0.72.9 CC-30;server ≥7.85.0,sdk 尚未声明):会话内 MCP re-dial 的消费口 —— 200 三态按 outcome 分形读、
|
|
194
196
|
// unsupported 恒五键、名册按 toolNames 在场性、失败按 errorCode 分诊、「重连 = 一次交易」措辞单源;能力位 mcpReconnect 三态读。
|
|
195
197
|
export * from './mcpReconnect.js';
|
package/dist/notifications.js
CHANGED
|
@@ -174,7 +174,10 @@ export function parseTranscriptNotificationSeeds(messages) {
|
|
|
174
174
|
renderedKeys.push(`${external ? 'external:' : ''}${taskId}:${status}`);
|
|
175
175
|
// L-215② 族扫(0.65.0):终局判据走单铸谓词 —— 修前这里手抄三词,core [6908] 的 `blocked`
|
|
176
176
|
// 漏在外面 ⇒ 一条已经渲过的 `blocked` 通知不进 `notifiedKeys`,重开会话后**再投一次**。
|
|
177
|
-
|
|
177
|
+
// 0.73.3(CC-60 A-D11):这条 XML 有**两个生产者**、两张终局词表 —— core task-notification(带 cancelled)与本包
|
|
178
|
+
// enqueueBgChildNotification(status 来自 run 行状态面,带 blocked)⇒ 按**并集**判终局;`event` 是唯一非终局。
|
|
179
|
+
// 两张冻结元组各自不动(动任一张 = 把另一个生产者的词丢掉)。
|
|
180
|
+
if (!external && (isTerminalStatus(status) || isTaskNotificationTerminalStatus(status))) {
|
|
178
181
|
notifiedKeys.push(taskId);
|
|
179
182
|
}
|
|
180
183
|
seeded++;
|
package/dist/steering.d.ts
CHANGED
|
@@ -45,7 +45,8 @@ export interface EngineTaskStatusAttachment {
|
|
|
45
45
|
type: 'task_status';
|
|
46
46
|
taskId: string;
|
|
47
47
|
taskType: 'local_bash';
|
|
48
|
-
|
|
48
|
+
/** 0.73.3(CC-60 A-D13):+`parked`(core 第四个 vbl 臂:停在待批检查点 —— 恰是最需要用户看见的状态)。 */
|
|
49
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'killed' | 'parked';
|
|
49
50
|
description: string;
|
|
50
51
|
deltaSummary: null;
|
|
51
52
|
}
|
package/dist/steering.js
CHANGED
|
@@ -62,6 +62,8 @@ const PHRASE_TO_STATUS = [
|
|
|
62
62
|
['completed in background', 'completed'],
|
|
63
63
|
['still running in background', 'running'],
|
|
64
64
|
['stopped', 'killed'],
|
|
65
|
+
// 0.73.3(A-D13):core 第四个 vbl 臂,排在 raw-status 兜底组之前(此前恒不命中 ⇒ compaction 后停在待批检查点的行整行消失)。
|
|
66
|
+
['parked awaiting an out-of-band approval — do NOT re-issue the gated call', 'parked'],
|
|
65
67
|
// core's raw-status fallback arm for the non-vbl states (announce snapshots pending/running, but
|
|
66
68
|
// parse defensively — a settle can race the boundary).
|
|
67
69
|
['pending', 'pending'],
|
|
@@ -23,7 +23,9 @@ export declare function fetchEngineTaskOutput(handle: string, opts?: {
|
|
|
23
23
|
* 曾经各写一份 `.includes()` 判读,同一个协议标记有两处互不知情的判读点——现在两处判读结果
|
|
24
24
|
* 对同一输入恒一致,因为已经是同一个函数)。
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
/** 0.73.3(CC-60 A-D3):`cursorSemantics` 机读位(server ≥7.77.0 `taskOutput` 面):"cursor" = 读了就消费 ⇒ append;"full" = 全量重读安全 ⇒ 替换。
|
|
27
|
+
* **缺席 / 认不出 ⇒ 现行文案标记臂兜底**(老 server 不发这个键;sdk 头注逐字「别把缺席当 full」)。 */
|
|
28
|
+
export declare function mergeTaskOutput(prev: string, fresh: string, cursorSemantics?: string): string;
|
|
27
29
|
export type EngineTaskStopOutcome =
|
|
28
30
|
/** 200:停止动作完成(status = wire 终态照实;重复 stop 幂等)。 */
|
|
29
31
|
{
|
|
@@ -121,7 +121,10 @@ export async function fetchEngineTaskOutput(handle, opts) {
|
|
|
121
121
|
});
|
|
122
122
|
const fresh = typeof r?.content === 'string' ? r.content : '';
|
|
123
123
|
const prev = accumulated.get(handle) ?? '';
|
|
124
|
-
|
|
124
|
+
// A-D3:机读位优先 —— sdk 9.7.1 `SubagentOutputResult.cursorSemantics` 是**回体顶层**键(与 `output` 并列;generic taskOutput 面才铸,
|
|
125
|
+
// 窄面 subagentOutput 不带 ⇒ 缺席走文案臂)。异源对抗复审:首版读成 `output.cursorSemantics`,正常回体恒回落文案臂。
|
|
126
|
+
const cursorSemantics = r?.cursorSemantics;
|
|
127
|
+
const merged = mergeTaskOutput(prev, fresh, typeof cursorSemantics === 'string' ? cursorSemantics : undefined);
|
|
125
128
|
accumulated.set(handle, merged);
|
|
126
129
|
const out = r?.output ?? {};
|
|
127
130
|
if (engineWireDebugEnabled()) {
|
|
@@ -148,9 +151,15 @@ export async function fetchEngineTaskOutput(handle, opts) {
|
|
|
148
151
|
* 曾经各写一份 `.includes()` 判读,同一个协议标记有两处互不知情的判读点——现在两处判读结果
|
|
149
152
|
* 对同一输入恒一致,因为已经是同一个函数)。
|
|
150
153
|
*/
|
|
151
|
-
|
|
154
|
+
/** 0.73.3(CC-60 A-D3):`cursorSemantics` 机读位(server ≥7.77.0 `taskOutput` 面):"cursor" = 读了就消费 ⇒ append;"full" = 全量重读安全 ⇒ 替换。
|
|
155
|
+
* **缺席 / 认不出 ⇒ 现行文案标记臂兜底**(老 server 不发这个键;sdk 头注逐字「别把缺席当 full」)。 */
|
|
156
|
+
export function mergeTaskOutput(prev, fresh, cursorSemantics) {
|
|
152
157
|
if (fresh.length === 0)
|
|
153
158
|
return prev;
|
|
159
|
+
if (cursorSemantics === 'full')
|
|
160
|
+
return fresh;
|
|
161
|
+
if (cursorSemantics === 'cursor')
|
|
162
|
+
return prev + fresh;
|
|
154
163
|
const marker = spoolMarkerOf(fresh);
|
|
155
164
|
if (marker === 'full')
|
|
156
165
|
return fresh;
|
package/dist/toolResult.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export declare const STRUCTURED_DETAIL_TYPES: ReadonlySet<string>;
|
|
|
22
22
|
export declare function structuredDetailType(structured: unknown): string | undefined;
|
|
23
23
|
export declare const PROTOCOL_MARKERS: {
|
|
24
24
|
/** T11 bash 框架:退出码行头(core tools/fs/index.ts runShell)。 */
|
|
25
|
+
/** 0.73.3(CC-60 A-D5):认 core 两个发货变体 —— exit1 注记形 `exit code: 1 (<note>)` 与图片形(首行后**没有** `--- stdout ---` 行,
|
|
26
|
+
* 紧跟 `[Image data detected …]`)。第 2 组 = 括号注记(缺席 = undefined),第 3 组 = 老形的 stdout 分隔行(图片形缺席)。 */
|
|
25
27
|
readonly bashHead: RegExp;
|
|
26
28
|
/** T11 bash 框架:stderr 分隔行。 */
|
|
27
29
|
readonly bashStderrSep: "\n--- stderr ---\n";
|
|
@@ -42,6 +44,7 @@ export declare const PROTOCOL_MARKERS: {
|
|
|
42
44
|
/** T13 TaskOutput:stderr 分隔行。 */
|
|
43
45
|
readonly taskOutputStderrLine: RegExp;
|
|
44
46
|
/** T13 TaskOutput:agent 结果分隔行。 */
|
|
47
|
+
/** 0.73.3(CC-60 A-D4):认可选括号注记 `--- result (partial) ---`(core 被 stop 打断的子代任务此前正文整段切不出)。 */
|
|
45
48
|
readonly taskOutputResultLine: RegExp;
|
|
46
49
|
/** [1505] spool 协议:全量可重读形(`engineTaskHandleWire.ts` mergeTaskOutput 单源消费点)。 */
|
|
47
50
|
readonly spoolStdoutFull: "--- stdout (full, re-readable) ---";
|
|
@@ -65,6 +68,7 @@ export declare function parseModelFacingBash(text: string): {
|
|
|
65
68
|
stdout: string;
|
|
66
69
|
stderr: string;
|
|
67
70
|
exitCode: number | null;
|
|
71
|
+
note?: string;
|
|
68
72
|
} | null;
|
|
69
73
|
/**
|
|
70
74
|
* T12 —— 剥引擎的 `delimitUntrusted` 围栏(core untrusted-text.ts:118)**仅供渲染**。
|
package/dist/toolResult.js
CHANGED
|
@@ -171,7 +171,9 @@ const WF_TERMINAL_STATUSES = new Set([
|
|
|
171
171
|
// 这里只是把「谁在判读」收敛到具名常量 + 单一函数,每域一个 pattern home。
|
|
172
172
|
export const PROTOCOL_MARKERS = {
|
|
173
173
|
/** T11 bash 框架:退出码行头(core tools/fs/index.ts runShell)。 */
|
|
174
|
-
|
|
174
|
+
/** 0.73.3(CC-60 A-D5):认 core 两个发货变体 —— exit1 注记形 `exit code: 1 (<note>)` 与图片形(首行后**没有** `--- stdout ---` 行,
|
|
175
|
+
* 紧跟 `[Image data detected …]`)。第 2 组 = 括号注记(缺席 = undefined),第 3 组 = 老形的 stdout 分隔行(图片形缺席)。 */
|
|
176
|
+
bashHead: /^exit code: (-?\d+)(?: \(([^)\n]*)\))?\n(--- stdout ---\n)?/,
|
|
175
177
|
/** T11 bash 框架:stderr 分隔行。 */
|
|
176
178
|
bashStderrSep: '\n--- stderr ---\n',
|
|
177
179
|
/** T11 bash 框架:空 stdout 哨兵。 */
|
|
@@ -191,7 +193,8 @@ export const PROTOCOL_MARKERS = {
|
|
|
191
193
|
/** T13 TaskOutput:stderr 分隔行。 */
|
|
192
194
|
taskOutputStderrLine: /^--- (?:new )?stderr[^\n]*---\n?/m,
|
|
193
195
|
/** T13 TaskOutput:agent 结果分隔行。 */
|
|
194
|
-
|
|
196
|
+
/** 0.73.3(CC-60 A-D4):认可选括号注记 `--- result (partial) ---`(core 被 stop 打断的子代任务此前正文整段切不出)。 */
|
|
197
|
+
taskOutputResultLine: /^--- result(?: \([^)\n]*\))? ---\n?/m,
|
|
195
198
|
/** [1505] spool 协议:全量可重读形(`engineTaskHandleWire.ts` mergeTaskOutput 单源消费点)。 */
|
|
196
199
|
spoolStdoutFull: '--- stdout (full, re-readable) ---',
|
|
197
200
|
/** [1505] spool 协议:增量新字节形。 */
|
|
@@ -238,7 +241,12 @@ export function parseModelFacingBash(text) {
|
|
|
238
241
|
const head = PROTOCOL_MARKERS.bashHead.exec(text);
|
|
239
242
|
if (!head)
|
|
240
243
|
return null;
|
|
244
|
+
// 图片形(无 stdout 分隔行)只在首行后紧跟图片提示时才算命中;别的「首行后不是分隔行」的文本不是 bash 框架
|
|
245
|
+
if (head[3] === undefined && !text.slice(head[0].length).startsWith('[Image data detected'))
|
|
246
|
+
return null;
|
|
241
247
|
const exitCode = Number(head[1]);
|
|
248
|
+
// 0.73.3(A-D5):首行括号注记 = 引擎对这次退出码的解释(良性非零退出);structured 缺席时它是唯一能喂给同一个良性槽的来源
|
|
249
|
+
const note = typeof head[2] === 'string' && head[2] !== '' ? head[2] : undefined;
|
|
242
250
|
let rest = text.slice(head[0].length);
|
|
243
251
|
let stderr = '';
|
|
244
252
|
// 直写 `PROTOCOL_MARKERS.bashStderrSep`(不再中转 `const sep`):⑬ 段的角色普查按**用法形**
|
|
@@ -250,7 +258,7 @@ export function parseModelFacingBash(text) {
|
|
|
250
258
|
rest = rest.slice(0, si);
|
|
251
259
|
}
|
|
252
260
|
const stdout = rest === PROTOCOL_MARKERS.bashEmptySentinel ? '' : rest;
|
|
253
|
-
return { stdout, stderr, exitCode: Number.isFinite(exitCode) ? exitCode : null };
|
|
261
|
+
return { stdout, stderr, exitCode: Number.isFinite(exitCode) ? exitCode : null, ...(note !== undefined ? { note } : {}) };
|
|
254
262
|
}
|
|
255
263
|
/**
|
|
256
264
|
* T12 —— 剥引擎的 `delimitUntrusted` 围栏(core untrusted-text.ts:118)**仅供渲染**。
|
|
@@ -406,9 +414,13 @@ export function wireOutputToBody(toolName, output, isError, truncated, flatten,
|
|
|
406
414
|
// isError:false + structured.returnCodeInterpretation('No matches found')。注记在场 ⇒
|
|
407
415
|
// 非零退出不再翻 failed(CC 同款:interpretation 形走 data 路径非 error 路径,
|
|
408
416
|
// pretty223:394251/815147 直证)。[1948] 裁定不动:无注记的非零退出照旧按退出码补位。
|
|
417
|
+
// 0.73.3(A-D5):structured 缺席(core boundedCard 超 64 KiB 整只丢)时,首行括号注记是同一件事 ⇒ 喂同一个良性槽;
|
|
418
|
+
// 只放宽正则不接这一位,会把「正文丢失」换成「红色错误卡」。structured 在场仍以它为准。
|
|
409
419
|
const benignInterp = typeof s?.returnCodeInterpretation === 'string' && s.returnCodeInterpretation.length > 0
|
|
410
420
|
? s.returnCodeInterpretation
|
|
411
|
-
:
|
|
421
|
+
: 'note' in slots && typeof slots.note === 'string' && slots.note.length > 0
|
|
422
|
+
? slots.note
|
|
423
|
+
: undefined;
|
|
412
424
|
const failed = isError || (slots.exitCode != null && slots.exitCode !== 0 && benignInterp === undefined);
|
|
413
425
|
if (failed) {
|
|
414
426
|
// 失败卡走 UserToolErrorMessage,它读 BLOCK content 且非字符串会被吞成
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
|
|
20
20
|
| 项 | 值 | 真源 |
|
|
21
21
|
|---|---|---|
|
|
22
|
-
| 本包 | `@sema-agent/client-core` **0.73.
|
|
22
|
+
| 本包 | `@sema-agent/client-core` **0.73.3**(本批发布版 = **patch**:CC-61 sdk 9.7.1 提货 + `capabilities.approvalsStreamLive` 四态读口(缺席 = 判不出;`livePendingNeedsReconcile` 只在引擎明说会推时才让对账节拍降兜底)+ CC-60 五条模型面文案锚包侧半场(cursorSemantics 机读位 / result 行注记 / bash 首行两变体与良性槽 / 通知 seed 并集 / parked 臂);型面纯 additive、公面 1032、peer 不动;§65。上一版 0.73.2 = **patch**:CC-59 悬挂 ask 全卡 —— `livePending[].frame`(server ≥7.87.0)两道闸窄读进视图,在场即走流内帧腿同一条路(入参可见、改写可转发),缺席保持盲卡;CC-34 收口(引擎半场随 7.87.0 到货,判据交黑盒);型面纯 additive、公面 1026、peer 不动;§64。上一版 0.73.1 = **patch**:CC-57 `decidePlanReview` outcome 尾句按「决断有没有生效」四态选(单铸点 `planReviewOutcomeTail`;此前本地拒发仍让模型汇报已拒绝)+ CC-56 cancel 的 409 按机器码分家(`cancelConflictFromError` 三形 / 新安全码 `cancel_run_not_running`)与提交面 429 用量窗读口 + 人话;型面纯 additive、公面 1026、peer 不动;§63。上一版 0.73.0 = **minor,型面 BREAKING**:fleet 视图八个数值键改可选 —— CC-52 `FleetTaskView.elapsedMs` / `tokens` / `queuedCount` 与 `FleetWorkflowView.doneCount` / `totalCount` / `failedCount` / `tokens` / `elapsedMs` 不再 `?? 0`(有键 = 真值含真 0,缺键 = 不知道;逐键缺席语义见 §62b)+ 台账补偿链无基数不铸;公面导出名零增减 1019、零 wire 变化、peer 不动;§62。上一版 0.72.14 = **patch**:悬挂的流内 ask 拉半场 —— CC-55 `startApprovalsFeed` 快照加 `livePending` 段并进变化摘要(键缺席 = 未报,不铸空)+ 视图 / 去重账 / 与流内帧腿同链的决断口(入参不可见上卡明说、改写不转发)+ 宿主闸对账节拍 + 待决计数读口(不知道 = null);型面纯 additive、公面 1019、peer 不动;§61。上一版 0.72.13 = **patch**:server 7.86.0 提货 —— CC-46 plan_review `permissionModeAfter` 发口(三选卡双闸:宿主声明只读起步 ∧ 引擎 ≥7.86.0;400 field_conflict 两种处置)+ CC-54 `capabilities.executionLane` 四态读面(键缺席 ≠ 不是本机车道;`toolsRunHere` 判据归包)+ CC-53 detach 版本闸三态;型面 additive(另撤回 0.72.12 的主通道 `absent` 臂,改独立缺席订阅口)、公面 1011、peer 不动;§60;**预告 0.73.0 BREAKING**:fleet 视图数值键改可选。上一版 0.72.12 = **patch**:「缺席被折成正向终态」按类清剿 —— CC-50 M1 头条(fleet 行缺席改发 `absent` 不再铸 `end{isError:false}`)+ 六站一次改齐(缺席 ⇒ `unknown`)+ 结果边界 fail-closed 取舍 + `_sema_outcome` + `Outcome unknown:` 行 + CC-51 M6(default 臂不再谎报 running)+ 普查门 + DS-06;型面 additive、公面 993、peer 不动;行为面三处真变化见 CHANGELOG 取舍段;§59。上一版 0.72.11 = **patch**:core 7.23.0 提货 —— CC-49 通告码 66 → 67 `config.write_protection_unresolved`(operator;兄弟码 `target_view_absent` = 没有视图,这枚 = 有视图解析不出)+ `permission_denials` 自动升级腿通电(`gates[].toolCallId` ⇒ `tool_use_id`;CC-34 引擎半场);型面零变化、公面 989、peer 不动、devDep core ~7.23.0;§58。上一版 0.72.10 = **patch**:CC-41 leader run 终局 `needs_human` + `result.conflict` 三形读面(none 缺席不可分 / unreadable 在场读不懂 / conflict;`salvaged[]` 原样给落盘口;措辞单源不提重试);型面纯 additive、公面 989、peer 不动;§57。上一版 0.72.9 = **patch**:server 7.85.0 提货 —— CC-30 会话内 MCP re-dial 消费口(`reconnectMcpServer` 三态 / unsupported 恒五键 / 交易文案单源)+ CC-39② memory-status `autoConsolidationArmed` 三态 + CC-45 resume 补充句渲保留秒数;型面纯 additive、公面 985、peer 不动;§56。上一版 0.72.8 = **patch**:清账三票 —— `memory:"off"` 请求键(CC-39③,server 7.84.0 S-405)+ `runStream` 第二条中性臂 `Model output error:`(CC-43)+ 注入件撞活 run 自动 steer 零卡(CC-44);型面纯 additive、公面 977、peer 不动;§55。上一版 0.72.7 = **patch**:core 7.22.0 提货 —— 通告码 66 `mcp.server_redialed` + 读器 `readMcpServerRedialed` + `wiring_manifest.readDeny` 第九段 `_sema_readDeny`(缺席 = 没有内置行判这条腿);型面纯 additive、公面 971、peer 不动、devDep core ~7.22.0;§54。上一版 0.72.6 = **patch**:cli L-379 包侧半场 —— `steerFollowIntent` steer 后续听意图三态(tail / after-decision / after-wake)+ `activeRunSelfHealRow` 续听声明第五参;型面纯 additive、公面 969、peer 不动;§53。上一版 0.72.5 = **patch**:server 7.82.1 提货 —— `capabilities.webSearch.backend` 部署默认 WebSearch 后端四态读面(键缺席 = 老引擎判不了 ≠ `none`);型面纯 additive、公面 968、peer 不动;§52。上一版 0.72.4 = **patch**:core 7.21.x 三件经 server 7.82.0 提货 —— `wiring_manifest.autoConsolidation` 第八段 `_sema_autoConsolidation`(缺席 = indeterminate 不折 false);型面纯 additive、公面 962、peer 不动;§51。上一版 0.72.3 = **patch**:core #863 记忆单系统半场 ① —— `projectAgentsForWire` 投影 `agents[].memory`(user|project|local 三词同映射引擎平面 agent:<type>);型面纯 additive、公面 962、零 wire 新键、peer 不动;§50。上一版 0.72.2 = **patch**:workflow 视图两票 —— `LiveWorkflowController.resolution()` 六态(snapshot() 的 null 三义拆开)+ `noteOwnWorkflowRun` own 台账同拍登记;型面纯 additive、公面 961、零 wire 键、peer 不动;§49。上一版 0.72.1 = **patch**:server 7.80.1 提货 —— 409 `conflict.resume_context_unavailable` 结构读数(`staleAfterSec` / `runId`;sdk 9.6.0 尚未带键,经 sdk 今天恒缺席)+ `SkillSpec.baseDir`(只在本机车道带);型面纯 additive、公面 960、peer 不动;§48。上一版 0.72.0 = **minor**:型面 BREAKING —— 39 个零消费导出退出公面(CC-32 退役批,[7419] §45 预告 / cli [7422] 同意 / web-client·desktop 过节拍沉默 = 同意;名单见 §47a S-1);运行期零 BREAKING、公面 956、peer 不动、devDep core ~7.20.1;随批:已退役名账 `removed` + export-liveness 门 G 段 + 冻结账门 ⑧c;§47。上一版 0.71.4 = **patch**:core 7.20.1 提货 —— `ENGINE_NOTICE_CODES` 65 + `wiring_manifest.writeProtection` 第七段 `_sema_writeProtection`;型面纯 additive、公面 995、peer 不动、devDep core `~7.20.1`;§46。上一版 0.71.3 = **patch**:门体系清账批 —— CC-24 export-liveness 门 + 39 个导出退役预告(0.72.0 删,表态制)/ CC-26 `as unknown as` 铸链棘轮 / CC-25 冻结账门 ⑧ 段 / CC-06 B-081 包侧半场(终帧 `_sema_effective_reasoning` / `_sema_effective_memory_scopes` + resume reopen 族 + `routePairingVerdict`);型面纯 additive、公面 986 → 995、peer 不动;§45。上一版 0.71.2 = **patch**:接入方验收两票归包 —— CC-28 B-132 decide 拒体三句去内部车道词 / CC-29 B-133 committedUuids 唯一性(重复 ⇒ 形 f);零型面变化、公面 986、peer 不动;§44。上一版 0.71.1 = **patch**:接入档打回修正 —— CC-27 `ApprovalCardRequest.readRootCandidate?` 帧→卡透传位 + 新导出型 `ReadRootCandidateView`;型面纯 additive、公面 986 不变、peer 不动;§43。上一版 0.71.0 = **minor**:型面 BREAKING 六件 —— peer sdk 地板 >=9.6.0 + agent-types >=0.3.0 / `SkillsListingTruncatedFactsView` 删 `requestedBudgetBytes?`·`laneClamped?` / `WiringManifestMcpEntry` → `WiringManifestMcpEntryView` / `MAX_AGENT_SKILLS` 删 / `decide.workflow_host_not_parked` 退役;运行期零 BREAKING。内容:core 7.20.0 提货(闭集 +5 六十四码)/ 🔴 CC-16 `text_segment_end.committedUuids[]` / CC-08 全五件(tool_disclosure / tool_progress 两 chrome 臂、wiring_manifest tools·hooks·lsp 进切片、tool_roster_delta 接上、context_usage 进切片、`readRootCandidate` 镜像)/ CC-19 `mcpEngineLegPresence` 归包 / CC-20 not_parked clean-cut;公面 986;§42 / 42y 八条)|
|
|
23
23
|
| peer:wire 契约 | `@sema-agent/sdk` **>=9.6.0**(value-level,非 type-only;**0.71.0 抬版**:`tool_disclosure` / `tool_progress` 两帧型与 `ToolApprovalFrame.readRootCandidate` 自 9.6.0 起;0.69.0 曾抬到 >=9.4.0(`reasoning_end` / `lastLegMcp`),0.60.0 抬到 >=8.4.0;地板由 `scripts/run-sdk-floor-test.mjs` 的 `FLOOR` 与 public-surface 门 C-CC-3「不低于见证到的最低实装版」双钉)| `package.json` `peerDependencies` |
|
|
24
24
|
| peer:会话词汇表 | `@sema-agent/agent-types` **>=0.3.0**(type-only,零运行时;0.71.0 抬版:devDep 与 peer 同步,type-superset 门 ④ 撞名预警对着 0.3.0 的 .d.ts 求值) | 同上 |
|
|
25
25
|
| runtime dep | `diff` ^9.0.0(**唯一**一条;portability 门按**等值**钉死) | `package.json` `dependencies` |
|
|
26
|
-
| 公开导出面 | **
|
|
26
|
+
| 公开导出面 | **1032** 个运行期符号(+ 49 个测试钩;= 0.73.3 的值:相对 0.73.2 +6 —— CC-61 六件,名单见 §2b 域 9;1026 = 0.73.2 的值(导出名零增减);= 0.73.1 的值:相对 0.73.0 +7 —— CC-56 六件 / CC-57 一件,名单见 §2b 域 3 / 15;1019 = 0.73.0 的值(导出名零增减,BREAKING 在类型面);= 0.72.14 的值:相对 0.72.13 +8 —— CC-55 八件,名单见 §2b 域 3;1011 = 0.72.13 的值:相对 0.72.12 +18 —— CC-46 八件 / CC-54 六件 / CC-53 两件 / CC-50 缺席口两件,名单见 §2b 域 3 / 4 / 9 / 10;993 = 0.72.12 的值(测试钩 45):相对 0.72.11 +4 —— CC-50 `OUTCOME_UNKNOWN_ROW_PREFIX` / `isOutcomeUnknownRowText` / `TASK_NOTIFICATION_TERMINAL_STATUSES` / `isTaskNotificationTerminalStatus`;989 = 0.72.10 的值:相对 0.72.9 +4 —— CC-41 `LEADER_RUN_STATUSES` / `LEADER_REJ_HEAD_DISPLAY_MAX` / `projectLeaderConflict` / `leaderConflictDetail`;985 = 0.72.9 的值:相对 0.72.8 +8 —— CC-30 `MCP_RECONNECT_OUTCOMES` / `MCP_RECONNECT_TRANSACTION_NOTICE` / `projectMcpReconnectResult` / `classifyMcpReconnectFailure` / `reconnectMcpServer` / `projectMcpReconnectCapability` / `mcpReconnectOutcomeDetail`、CC-39② `readAutoConsolidationArmed`;977 = 0.72.8 的值:相对 0.72.7 +6 —— CC-39③ `MEMORY_OFF` / `memoryOffDeclarationField` / `memoryOffDeclared`、CC-43 `MODEL_OUTPUT_ERROR_PREFIX` / `isModelOutputErrorText` / `isModelOutputErrorRowText`;971 = 0.72.7 的值:相对 0.72.6 +2 —— CC-42 core 7.22.0 提货 `MCP_REDIAL_OUTCOMES` / `readMcpServerRedialed`;969 = 0.72.6 的值:相对 0.72.5 +1 —— CC-40 `steerFollowIntent`;968 = 0.72.5 的值:相对 0.72.4 +6 —— CC-31 server 7.82.1 提货 `capabilities.webSearch.backend` 四态读面:`WEB_SEARCH_BACKEND_NONE` / `projectWebSearchBackendCapability` / `observedWebSearchBackend` / `noteEngineCapsForWebSearchBackend` / `forgetWebSearchBackendReading` / `webSearchBackendDoctorDetail`;962 = 0.72.3 的值:相对 0.72.2 +1 —— CC-39① `AGENT_MEMORY_WORDS`;0.72.2 相对 0.72.1 +1 —— CC-37 `noteOwnWorkflowRun`;0.72.1 相对 0.72.0 +4 —— CC-33 server 7.80.1 提货:`RESUME_CONTEXT_UNAVAILABLE` / `resumeContextUnavailableFromError` / `resumeContextUnavailableContent` / `skillBaseDirOf`;0.72.0 相对 0.71.4 −39 —— CC-32 退役批删 export-liveness 登记 retire 的 39 个零消费导出(23 常量 + 16 函数,名单见 §47);995 = 0.71.3 的值:相对 0.71.2 +9 —— CC-06 `readEffectiveReasoning` / `readEffectiveMemoryScopes` / `resumeReopenFromError` / `resumeReopenContent` / `routePairingVerdict` 五函数 + `RESUME_REOPEN_CODES` / `RESUME_ENV_FAILED` / `RESUME_TOOL_UNAVAILABLE` / `RESUME_TOOL_CONTRACT_MISMATCH` 四常量;986 = 0.71.0 的值:相对 0.70.2 −`MAX_AGENT_SKILLS` −`DECIDE_WORKFLOW_HOST_NOT_PARKED` +`projectToolRosterDelta` +`mcpEngineLegPresence`;986 = 0.70.0 的值:相对 0.69.2 **一件 additive(`readSkillsListingTruncated`,§39)、零删除**;985 = 0.69.2 的值:相对 0.69.1 **三件 additive、零删除**(CC-13 `isSubFlowSegmentEnd` / `SEGMENT_END_IDENTITY_KEYS` / `droppedWhySentence`,§38);982 = 0.69.0 未发布版的值(原排 0.68.3,因 peer 地板抬升改 minor)= 相对 0.68.2 **十七件 additive、零删除**:`fetchMcpPanel`(CC-03 补件,§36e)+ `readWorkflowResumeAdmissionIncomplete`(CC-05 core 7.18.0 #755)+ `installCoreValuePorts`/`hasCoreValuePorts`/`hasCoreValuePort`/`coreValuePortMisses`/`CORE_VALUE_PORT_NAMES` + 十读口(CC-07 core 值级端口,§36d);0.68.2 相对 0.68.1 十三件 additive:`SEMA_SEGMENT_ID_KEY`(CC-01 段身份键,§35f)/ `projectMcpPanel`+`mcpPanelLastLegDetail`+`projectMcpSection`(CC-03 `/mcp` 面板读视图,§35g)/ `resolveTextSegmentAuthority`/`createTextSegmentLedger`(L-318 `text_end` 权威段替换的判决单源 + print 形段账,详见 §35b/§35c)/ `memoryCaptureDeclarationField`/`MEMORY_CAPTURE_OFF`(L-316 会话级隐私声明的字面唯一铸点,§35d)/ `engineUrl`/`probeHealth`(L-61 件④ SDK 纯工具面原样转口,§35d)/ `AgentClient`/`isApprovalRequestFrameV1`/`isApprovalRevokeFrameV1`(L-61 存量清零:SDK **wire 面**原样转口,§35e)。`0.68.1`/`0.68.0` 是 **952**,那批是相对 0.67.2 **二十件 additive、🔴 两件删除(BREAKING)**:additive = `TERMINAL_CAUSE_KINDS`/`isTerminalCauseKind`/`RUN_TERMINAL_NOT_SUCCESS_STATUSES`/`RUN_TERMINAL_STATUSES`(L-247 终态词两表分源,详见 §33b)/ `SEMA_SUBAGENT_USAGE_PARTIAL_KEY`/`subagentUsageIsPartial`(L-244 子代下界位自有名,§33g)/ `ASK_UNRESOLVABLE_CAUSES`/`readAskUnresolvable`/`DURABLE_MANDATE_SOURCES`/`readDurableGateUnavailable`(core 7.17.0 #709 ①② 两只通告事实窄读器,§33c)/ `WORKFLOW_PARK_TRUTH_UNREADABLE`/`WORKFLOW_PARK_NOT_PENDING`/`WORKFLOW_PARK_BINDING_BROKEN`/`WORKFLOW_PARK_REQUIRES_RUN_STORE`(四个单码常量 🔧 0.72.0 退役)/`WORKFLOW_PARK_REFUSAL_CODES`/`isWorkflowParkRefusalCode`/`readWorkflowParks`(core 7.17.0 #652 park 真相四码 + parks 三键读器,§33d)/ `ENGINE_STOP_REASONS`/`engineStopReasonToCc`(L-246 A13 停止原词映射下沉,§33g)/ `readCancelRequested`(L-230 读面,§33f);🔴 **删除两件** `TERMINAL_NOT_SUCCESS_STATUSES`/`TERMINAL_STATUSES`(随 L-247 两表分源更名成 `RUN_TERMINAL_*`,clean-cut **不留别名** —— 留一个别名等于让端可以继续按合起来的那张表读,分源就白做了,详见 §33b)。`0.67.0` 是 **934**,那批是相对 0.66.0 **七件 additive、🔴 两件删除**:additive = `CLASSIFIER_DENY_CAUSES`/`isClassifierDenyCause`/`classifierDenyCauseOf`/`classifierDenyCauseDetail`(core 7.14.0 退役 `classifierUnavailable` 之后的**拒绝面**继任读器与措辞,详见 §32b)/ `RULE_STORE_UNREADABLE_KINDS`/`isRuleStoreUnreadableKind`/`ruleStoreUnreadableDetail`(core 7.14.0 #688 C3 的规则店机制位三件,详见 §32d);🔴 **删除两件** `classifierUnavailableOf`/`classifierUnavailableDetail`(随 core 7.14.0 的 Retired keys 表整族退役,clean-cut 不留别名,详见 §32b;同批删的还有**型** `ClassifierUnavailableView`、卡位与帧位 `classifierUnavailable`、以及一条恒真的型面钉 `_askOriginWordsPin`)。`0.66.0` 是 **929**,那批是一件 additive、零删除:`readRunCostFacts`(终局成本事实的唯一读器:`costBreakdown` / `nested` 窄读 + 对账三段与两个判别位,终帧超集键与 chrome 对账臂共用它;详见 §31c);已发的 **0.65.x 十一件 additive、两件删除**:additive = `DECIDE_WORKFLOW_HOST_UNKNOWN`/`DECIDE_WORKFLOW_HOST_NOT_PARKED`/`DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED`/`DECIDE_WORKFLOW_LANE_CODES`/`readDecideReceipt`/`decideAcceptedNotResolved`/`decideRefusalFromError`(B-070 `/decide` 回执读面与三码人话,详见 §30h)/ `TERMINAL_NOT_SUCCESS_STATUSES`/`isTerminalNotSuccess`/`TERMINAL_STATUSES`/`isTerminalStatus`(L-215② 终局词汇单铸谓词,详见 §30j);🔴 **删除两件** `AUTO_MODE_BREAKER_CAUSES`/`classifierBreakerOf`(熔断族随 core 7.12.0 的 Removed(BREAKING) 整只退役,clean-cut 不留别名,详见 §30k②;同批删的还有**型** `ClassifierBreakerView` 与 `ClassifierStatusView.breaker` 一位)。`0.64.2` 是 **919**,那批是一件 additive、零删除:`readDenialLimitFallback`(限额回落卡的窄读器上公面,壳侧同判据副本退役,详见 §29③);`0.64.0` 是 **918**,那批是件①+件② 十三件 additive、零删除:`CLASSIFIER_STATUS_STATES`/`classifierBreakerOf`/`classifierStatusOf`/`classifierStatusDetail`(分类器状态面,详见 §28②)/ `THINKING_FORMATS`/`THINKING_FORMAT_WIRE_TWINS`/`THINKING_DISABLE_PROBE_ORDER`/`MODEL_PROBE_VERDICTS`/`PROBE_PROMPT`/`PROBE_MAX_TOKENS`(两个探针常量 🔧 0.72.0 退役)/`probeRequestBody`/`probeModelCapability`/`applyProbeToEntry`(模型思考能力探测,详见 §28①);`0.63.0` 是 **905**,那批是八件 additive、零删除:`projectServerGateKnobs`/`postureKnobSourceOf`/`postureSourceIsOperatorPinned`/`postureKnobDetail`/`POSTURE_SOURCE_WORDS`(S-178 三根 posture 旋钮读数,详见 §27b)/ `PERSISTED_RULE_BEHAVIORS`/`PERSISTED_RULE_BEHAVIOR_UNKNOWN`/`persistedRuleBehaviorOf`/`persistedRuleBehaviorLabel`/`revokeTargetFromPersistedRule`(三态规则身份,§27c)/ `engineIdentityOf`/`engineIdentityVerdict`/`engineIdentityChanged`/`engineIdentityChangedBy`/`ENGINE_IDENTITY_ANCHORS`(S-179 代际锚,§27d)/ `GATE_DENIED_BY_WORDS`/`gateDeniedByDetail`/`ASK_ORIGIN_WORDS`/`askOriginDetail`(门词汇 +2,§27e)/ `PERMISSION_RULE_ISSUE_CODES`/`RETIRED_PERMISSION_RULE_ISSUE_CODES`/`permissionRuleIssueDetail`(规则 lint 码表,§27f)/ `projectToolRoster`/`toolRosterNames`/`toolShimFromRoster`/`applyToolRosterDelta`(L-161 工具名册,§27g)/ `ENGINE_NOTICE_CODES`/`ENGINE_NOTICE_AUDIENCE`/`noticeAudienceOf`/`engineNoticeInCatalog`/`MCP_INJECTION_DROP_REASONS`/`readMcpInjectionDrop`(L-167 通告码册,§27h)/ `AUTO_MODE_UNAVAILABLE_CAUSES`/`AUTO_MODE_BREAKER_CAUSES`/`classifierUnavailableOf`/`classifierUnavailableDetail`(件⑧ 分类器不可用事实,§27h2);`0.62.0` 是 **869**,那批是五件 additive、**零删除**:`capForDisplay`(呈前消毒 + 封长的共用铸点,详见 §26⑦)/ `SEAT_SEND_MESSAGE_KEY_ORIGINS`(座位载荷逐键出身表,详见 §26③)/ `configureSubagentContentStore`+`subagentContentStoreConfig`+`SUBAGENT_CONTENT_STORE_DEFAULTS`(子代内容账本字节预算,测试钩 `__resetSubagentContentStoreConfigForTests` +1,详见 §26②);`0.61.0` 是 **864**,那批是三件 additive、**零删除**:`projectReadFacePosture`/`readFacePostureDetail`/`readFaceDisagreement`(S-167 READ 容纳面 operator 读器,详见 §25);`0.60.0` 是 **861**,那批是二十五件 additive、**零删除**:`readRunTerminal`/`runTerminalCode`/`runTerminalGateKind`/`runTerminalGateToolName`/`isReviewPark`/`REVIEW_PARK_GATE_KINDS` 六件终局因由读器 + `gateOutcomeOf`/`isDeniedGate`/`gateDeniedBy`/`gateApprover`/`isApprovalWindowExpiredGate`/`isDenialLimitAutoDeniedGate`/`isParkSlaExpiredGate`/`isHumanSettledGate` 八件门记录读器 + `projectWriteProtectionCapability`/`noteEngineCapsForWriteProtection`/`observedWriteProtection`/`forgetWriteProtectionReading`/`writeProtectionDoctorDetail`/`projectWriteProtectionPosture`/`writeProtectionPostureDetail` 七件写保护读面(测试钩 `__resetWriteProtectionReadingsForTests` +1)+ `readWireErrorCode` + 真机边界①的两件 `isGateParkedToolEnd`/`GATE_PARKED_ERROR_CODE` + 异源复审逼出的 `engineCapsGeneration`;`0.59.0` 是 **836**,那批是八件 additive:`RULE_OFFERS_ABSENCE_REASONS`/`DENIAL_LIMIT_KINDS` 两张闭词表再导出 + `engineCapValue` 能力位四态通用读口 + `projectSqlEngineCapability`/`observedSqlEngine`/`noteEngineCapsForSqlEngine`/`forgetSqlEngineReading`/`sqlEngineDoctorDetail` 五件 SQL 姿态读面(测试钩 `__resetSqlEngineReadingsForTests` +1);`0.58.0` 是 **828**,那批是三件 additive:`RULE_OFFER_MATCHES`/`RULE_OFFER_BATCH_MEMBER_KINDS`/`RULE_OFFER_UNCOVERED_REASONS` 三张闭词表再导出 + `RESUME_REFUSAL_CODES`/`RESUME_PLACEMENT_MISMATCH`/`resumeRefusalFromError`/`resumeRefusalContent` 四件文案铸点;`0.57.0` 是 **821**;`0.56.0`/`0.55.0` 是 **815**;已发 `0.54.0`(design/385 十件 additive 含 `AUTHORITY_ENVELOPE_TAGS` 🔧 0.72.0 退役);`0.52.0` 是 **805**(L-69⑨ 两件);`0.51.0` 是 **803**;`0.50.0` 是 **800**(S-81 五件);`0.49.0` 是 **795**;`0.48.0` 是 **794**;npm `0.47.0` 是 **790**,`0.46.0` 是 **787**,`0.44.0` 是 **783**,`0.43.1`/`0.43.0` 是 **776**,`0.42.0` 是 **771**,`0.41.0` 是 **767**,`0.39.0` 是 **766**,`0.38.0` 是 **764**;`0.37.0` 是 **753**,见 `CHANGELOG.md`) | `scripts/public-export-baseline.json` 的 `count` / `testHookCount` —— **别手抄进别处,以该文件为准** |
|
|
27
27
|
| 常驻门 | 以 `scripts/gates-manifest.json` 的 `suites` 长度为准(**本档不抄这个数**) | `scripts/gates-manifest.json`;`npm test` 的名单等值门与它逐名对账 |
|
|
28
28
|
| 沿革档 | 0.29.0 起建 `CHANGELOG.md`;更早批次记账在 `src/index.ts` 文件头 + `docs/REFACTOR-LEDGER.md` | — |
|
|
29
29
|
|
|
@@ -123,7 +123,7 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
123
123
|
|
|
124
124
|
> 📦 **随包 / 不随包**:npm 包只带 `dist` / `README` / `CHANGELOG` / 本档 / `LICENSE`。本档各处提到的 `docs/type-superset.json`、`scripts/*.json`、`scripts/run-*-test.mjs` 都是**仓内登记物与门,不随包发出** —— 装包的消费者找不到它们是预期;`_sema_` 超集键的**随包契约**就是本档各 §NNz 逐键处置表(键名 / 值域 / 缺席语义逐条在表里)。
|
|
125
125
|
>
|
|
126
|
-
> 全集真源 = `scripts/public-export-baseline.json` 的 `names`(**
|
|
126
|
+
> 全集真源 = `scripts/public-export-baseline.json` 的 `names`(**1032** 项)。
|
|
127
127
|
> 本节**不逐名抄**,只给「域 → 承重导出 → 用途 → 实现锚」。承重导出 = 一个端为了让这个域干活
|
|
128
128
|
> **必须**直接调到的那几个符号;其余是它们的类型、变体与辅助位。
|
|
129
129
|
> 单一入口:`import { … } from '@sema-agent/client-core'`(`exports` 只有 `.` 一个;
|
|
@@ -147,12 +147,12 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
147
147
|
`WorkflowsGateUnknownDenial` 四形**不在**基线里,`src/selfOrchestrationDenial.ts` 对基线贡献
|
|
148
148
|
**4** 项运行期导出(三个函数 + `SELF_ORCHESTRATION_RETRY_WITHOUT`)。
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
1032 项的内部构成(帮助端估读表大小;0.73.3 +6 函数(CC-61;测试钩 +1);0.73.1 +2 常量 +5 函数(CC-56 / CC-57;测试钩 +1);0.72.14 +1 常量 +7 函数(CC-55);0.72.13 +4 常量 +14 函数(CC-46 / CC-54 / CC-53 / CC-50 缺席口);0.72.12 +2 常量 +2 函数(CC-50);0.72.10 +2 常量 +2 函数(CC-41);0.72.9 +2 常量 +6 函数(CC-30 / CC-39②);0.72.8 +2 常量 +4 函数(CC-39③ / CC-43);0.72.7 +1 常量 +1 函数(CC-42);0.72.6 +1 函数(CC-40);0.72.5 +1 常量 +5 函数(CC-31);0.72.3 +1 常量(CC-39①);0.72.2 +1 函数(CC-37);0.72.1 +1 常量 +3 函数(CC-33);0.72.0 −23 常量 −16 函数(CC-32 退役批);0.71.3 +4 常量 +5 函数(CC-06);0.71.0 −2 常量 `MAX_AGENT_SKILLS` / `DECIDE_WORKFLOW_HOST_NOT_PARKED` +2 函数 `projectToolRosterDelta` / `mcpEngineLegPresence`;0.70.0 起 +1 函数;0.69.2 起 +3:常量 1 / 函数 2):**297** 项是 `SCREAMING_SNAKE` 常量数据表/词汇表
|
|
151
151
|
(矩阵、键集、env 名、锚串)而非可调用物;**6** 项是 PascalCase 运行期值
|
|
152
152
|
(`ControlRouter` / `ControlSafetyError` / `HitlBridge` / `HitlSafetyError` / `DecideTransportRetryExhaustedError`);
|
|
153
153
|
**37** 项是 `*For(sessionKey, …)` 的 per-session 变体(0.72.0 −4:`clearArmedGateFor` / `onGateArmedFor` / `registerArmedGateFromQuestionIdFor` / `notePlanReviewAnsweredIfDecisiveFor` 退出公面)(§6;其中 `engineNamespaceKeyFor` 是命名巧合 —— 参数是 baseUrl 不是 sessionKey,见域 14)。
|
|
154
154
|
|
|
155
|
-
### 2b. 域图(16 域,逐域计数之和 =
|
|
155
|
+
### 2b. 域图(16 域,逐域计数之和 = 1032)
|
|
156
156
|
|
|
157
157
|
| # | 域 | 名数 | 承重导出 | 用途 | 实现锚 |
|
|
158
158
|
|---|---|---|---|---|---|
|
|
@@ -164,7 +164,7 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
164
164
|
| 6 | **请求装配(上行唯一构造口)** | 13 | `MEMORY_OFF` / `memoryOffDeclarationField` / `memoryOffDeclared`(0.72.8 CC-39③:`memory:"off"` 请求级整面关的意图位片段;§55)· `buildTaskRequest` · `REQUEST_FIELD_MATRIX` · `unregisteredRequestKeys` · `applyLiveRequestDefaults` · `taskNotificationToPrintFrame` | 两条车道(`interactive`/`print`)出站请求的**唯一**构造器;`unregisteredRequestKeys` 是可执行门 —— 端偷带一个未登记键上 wire 就红 | `src/request/taskRequest.ts`、`src/request/printNotification.ts` |
|
|
165
165
|
| 7 | **通知与 outstanding 台账** | 52 | `noteOwnWorkflowRun`(0.72.2 CC-37:own 台账显式登记口,adapter workflow lane 门在 own-run 正向证明下同拍调;§49)· `installNotificationQueuePort` · `normalizeTaskNotification` · `taskNotificationDedupKeyFromWire` · `registerOutstandingBgTask` / `registerOutstandingWorkflowRun` · `notificationQueuePortMisses` · `subscribeOutstandingWorkflows` · `outstandingDeliverableWorkflowCount` | `task_notification` 归一 + 去重 + 投递进宿主命令队列的**一把闸**;`outstandingDeliverableWorkflowCount()` 是 headless `-p` 的**退出门** · `classifyPeerNotification` / `renderPeerFrameTranscriptText` / `parsePeerFrameText` / `peerFrameDisplayName` + 三张闭集表(design/385,0.54.0:同一条 `task_notification` 车道上三条**引擎注入帧**的类型化投影 —— 判别位=载体在场而非 summary 文本,详见 §17) | `src/notifications.ts`(11 个 module 台账) |
|
|
166
166
|
| 8 | **工具结果卡** | 24 | `structuredToToolUseResult` · `readAsyncLaunchedAgentReceipt` · `wireOutputToBody` · `parseModelFacingBash` · `getPatchFromContents` · `toolEndResultToUserFrame` · `flattenToolOutput` | 铸端要渲的 `tool_result` 卡体,含客户端 diff hunk(唯一 runtime dep 的用处) | `src/toolResult.ts`、`src/printToolResultFrame.ts`、`src/diff/patch.ts` |
|
|
167
|
-
| 9 | **能力/旋钮 wire 门族** |
|
|
167
|
+
| 9 | **能力/旋钮 wire 门族** | 109 | `projectApprovalsStreamLiveCapability` / `noteEngineCapsForApprovalsStreamLive` / `observedApprovalsStreamLive` / `forgetApprovalsStreamLiveReading` / `approvalsStreamLiveDoctorDetail` / `livePendingNeedsReconcile`(0.73.3 CC-61;§65)· `projectExecutionLaneCapability` / `noteEngineCapsForExecutionLane` / `observedExecutionLane` / `forgetExecutionLaneReading` / `executionLaneDoctorDetail` / `toolsRunHereFromExecutionLane`(0.72.13 CC-54:`capabilities.executionLane` 四态读面,键缺席 ≠ 不是本机车道;§60)· `AGENT_MEMORY_WORDS`(0.72.3 CC-39①:`memory: user|project|local` 三词;`projectAgentsForWire` 把它们同映射为 `agents[].memory = { scopes:[agent:<type>], writeScope }`;§50)· `skillBaseDirOf`(0.72.1 CC-33:`SkillSpec.baseDir` 窄读 = server 顶层门同一只结构判据;`skillCommandsToSpecs` 第三参 `{ toolsRunHere }` 只在本机车道带;§48)· `projectAgentsForWire` / `awaitTaskAgentsWire` · `hooksForWire` · `mcpConfigsToSpecs` · `ultracodeForRequest` · `resolveWebSearch` + `buildWebSearchEnv` · `attachmentsForRequest` · `projectEffectiveBody` · `classifySelfOrchestrationRefusal` / `stripSelfOrchestrationIntent` / `projectWorkflowsGate` / `SELF_ORCHESTRATION_RETRY_WITHOUT`(S-81,server 7.57.0:上面两条 stamp 腿的**背面** —— 半配置多租户形态下 server 把带 `selfOrchestration` / `settings.ultracode` 的提交 501 拒掉,判型/去键/caps 闸三处都是判定不是文案,详见 §13) · `engineCapsGeneration`(0.60.0,异源对抗复审 [medium] 逼出:caps 探测的**当代号**读口 —— 代际闸在 probe **返回之后**才跑,而宿主的读面 tee 是在 probe **内部**落地的 ⇒ 一次慢的旧探测能把上一台引擎的读数写回来。宿主在**起探测那一刻**抓号、tee 时交回 `{generation}`,陈旧那一发整只丢掉;不传 = 逐字节同行为,详见 §24e)| 逐功能的「引擎有没有这个能力 + 这个字段怎么上 wire」投影器,由 `buildTaskRequest` 组装。🔴 `hooksForWire()` 是 **fail-closed**:无 `SettingsPort` ⇒ 返回 `undefined`(信任门,不是取值) | 17 个 `src/*WireCaps.ts` + `src/scratchpadWireCaps.ts`、`src/hooksWireCaps.ts`、`src/goalStopHook.ts`、`src/websearch/searchProviderPresets.ts`、`src/selfOrchestrationDenial.ts`(S-81 拒绝判定层) |
|
|
168
168
|
| 10 | **headless / 部署旋钮 wire** | 60 | `probeEngineDetachSupport` / `detachSupportDisclosure`(0.72.13 CC-53:detach 版本闸三态读口 + 披露句;§60)· `parseSandboxArgv` / `sandboxRequestFields` · `parseLimitsArgv` / `limitsForPrint` · `resolveHeadlessFinalVerify` · `resolveHeadlessPermissionMode` · `resolveHeadlessInteractiveTools` · `armDetachCancel` + `detachCancelArm` + `isDetachArmed` · `withHeadlessR1Reconnect` | `-p`/headless 车道的 env+argv 旋钮。🔴 `detachWire` 是**拆**的补偿:判定与 cancel-arm 台账在库,信号路径的裸 fetch 留宿主(`detachCancelArm()` 是取件口) | `src/sandboxWire.ts`、`scenarioWire.ts`、`finalVerifyWire.ts`、`limitsWire.ts`、`interactiveToolsWire.ts`、`headlessPermissionModeWire.ts`、`headlessReconnectWire.ts`、`detachWire.ts` |
|
|
169
169
|
| 11 | **模型目录与预算** | 67 | `routePairingVerdict`(0.71.3 CC-06:`ModelInfo.routePairing` ok / broken / unknown 三态读口,§45)· `resolveModelCatalog` · `loadCatalogWithSources` · `PROVIDER_PRESETS` / `MODEL_FAMILIES` · `defaultMaxTokensFor` · `getLiveModelCatalog` / `setLiveModelCatalogRefresher` · `providerAuthMethods` / `beginDeviceCodeAuth` · `providerCatalogRows` / `providerCatalogRowDetail` / `providerPresetById`(#244 F4 族D A-028.17:46 家表的规范折表层 —— 全表不重排、诚实缺席「model id typed in」,cli 目录/web 向导同一份折表)· `TIER_ORDER` / `CC_TIER_ALIASES` / `isTier` / `resolveTierBinding`(A-028.18:档位词表+校验+fail-open 降档派生单源;settings 存储归宿主)· `resolveEntryVision` / `computeDeleteBlockers` / `computeDeleteWarnings`(0.38.0 #318 件③ 上收:Model Hub 供给面的三端公共判定 —— vision 生效值+来源三态、删除断链核(拒删+指路)、删除降级后果(照删但必说)。**零 IO**,读盘那半场留各端;`doc === null` 的两义在调用方分流) | 三层 provider 目录解析(线上 URL → 包内预设 → 用户覆盖)+ per-model `maxTokens` 封顶。线上腿需注入 `CatalogFetchJson`,缺席 ⇒ 整条不启用(`online.reason='no-fetch-port'`);缓存落盘经 `CatalogCachePort` | `src/model/{catalog,catalogLoader,providerAuth,providerPresets,providerCatalog,tierVocabulary}.ts`、`src/liveModelCatalog.ts`、`src/modelBudgetRule.ts`、`src/sessionModelLatch.ts`、`src/effortWire.ts` |
|
|
170
170
|
| 12 | **workflow 与后台工作视图** | 25 | `projectLeaderConflict` / `leaderConflictDetail` + `LEADER_RUN_STATUSES` / `LEADER_REJ_HEAD_DISPLAY_MAX`(0.72.10 CC-41:leader run 终局 `needs_human` + `result.conflict` 三形读面 none / unreadable / conflict,缺席不可分、filesTruncated 只认 true、salvaged 原样给落盘口;§57)· `projectWorkflowRun` · `readWorkflowResumeAdmissionIncomplete`(0.68.3 CC-05:core 7.18.0 `resumeAdmissionIncomplete` 在场 = 不是 resume 基,与 `readWorkflowParks` 同一条投影义务)· `createLiveWorkflowSource` · `ensureWorkflowActivityLedger` · `readWorkflowActivityLedger` · `stopWorkflowActivityLedger` · `resetWorkflowActivityLedgers` · `createBackgroundView` · `projectBackgroundView` · `recordWorkflowAgentTaskId` · `agentDisplayStatus` | 活过一个 turn 的长任务读面:workflow run + 跨 session 后台任务归一表(`assistant.tasks` 与 fleet SSE **两源独立降级**) | `src/workflow.ts`、`src/workflowClient.ts`、`src/workflowMonitor.ts`、`src/agentSession/backgroundView.ts`(+ 纯类型 `src/agentSession/contract.ts`) |
|
|
@@ -8761,7 +8761,7 @@ installCoreValuePorts({ resolveAutonomousLoopPrompt, loosenReasons, combinePolic
|
|
|
8761
8761
|
| `FleetWorkflowView.doneCount` / `totalCount` / `failedCount` | 较老的引擎 / 乱序的部分增量 / 坏形 | 整段「—」;🔴 **不互相推导**(`failedCount` 缺席不读作 0;`totalCount` 缺席不拿 `doneCount` 顶) |
|
|
8762
8762
|
| `FleetWorkflowView.tokens` / `elapsedMs` | 同上 | 「—」 |
|
|
8763
8763
|
| `WorkflowRunState.totalTokens` | 没有完整总数:引擎聚合缺席或残缺,且腿上有未报 / 非法的用量(或零条腿) | 「—」;不拿已报的腿求个小计冒充总数 |
|
|
8764
|
-
| `fleet-row` 事件的 `totalTokens` | 本周期内引擎还没为这一行报过合法用量(同周期内已知值粘住;新周期不继承;同周期内每条 `fleet-row` 都带已知的 `startedAt`,未订阅期间的缓冲据此不跨周期合并) | 不渲 token 段。🔴 **消费端义务**:该事件是部分帧,省略的键 = 沿用你行上的旧值;所以**`startedAt` 变了(同 id 新周期)时由你清掉行上的用量 / 工具计数**,包只保证不把旧数发给你 |
|
|
8764
|
+
| `fleet-row` 事件的 `totalTokens` | 本周期内引擎还没为这一行报过合法用量(同周期内已知值粘住;新周期不继承;同周期内每条 `fleet-row` 都带已知的 `startedAt`,未订阅期间的缓冲据此不跨周期合并)。🔴 **「换周期」的定义**:两条都带 `startedAt` 且不相等;`undefined → 首锚` **不算**换周期(那是这一帧第一次告诉本包锚),此前的粘性值随首锚帧一起发出,回放与在线同果 | 不渲 token 段。🔴 **消费端义务**:该事件是部分帧,省略的键 = 沿用你行上的旧值;所以**`startedAt` 变了(同 id 新周期)时由你清掉行上的用量 / 工具计数**,包只保证不把旧数发给你 |
|
|
8765
8765
|
|
|
8766
8766
|
### 62z. 逐键处置表
|
|
8767
8767
|
|
|
@@ -8817,3 +8817,71 @@ installCoreValuePorts({ resolveAutonomousLoopPrompt, loosenReasons, combinePolic
|
|
|
8817
8817
|
3. peer sdk >=9.6.0 / agent-types >=0.3.0 不动;引擎版本无要求。
|
|
8818
8818
|
|
|
8819
8819
|
**包侧缺口:** ⓪ CC-58 workflow 规模告警判定上收进包(cli [7570] 同意;窗 09-25,0.73.x);① 悬挂 ask 卡上的工具入参摘要(候 server 出键);② S-454 到货后对账节拍降为兜底(候 server);③ CC-34 `permission_denials` 自动升级验证(候 server 7.87.0 透传半场);④ CC-36 托管 MCP 活性三态读口(候 core 7.23.x #874);⑤ `staleAfterSec` / `runId` 经 sdk 到端(候 sdk 出键);⑥ 九件 wire 面经 sdk 声明(候 sdk);⑦ `agents.listing_truncated` detail 读器候消费场景(by-design);⑧ `ClassifierSeat.defaulted?` 候 sdk 出键(by-design);⑨ §NNz「declined 键真零命中」机读第二刀(候形式化);⑩ 缺席上报附 `removeReason`(候 server S-449 + 壳透传);⑪ 三选卡宿主声明闸候 server 投影判别键;⑫ fleet task 行 `queuedCount` 候 server S-459(删键或接生产者);⑬ 三选卡 acceptEdits 支「第二次 approve → 404」现象候 cli 定归属。
|
|
8820
|
+
|
|
8821
|
+
## §64 🆕 0.73.2 CC-59 悬挂 ask 全卡(`livePending[].frame`)+ CC-34 收口;patch
|
|
8822
|
+
|
|
8823
|
+
> **patch**:型面纯 additive(公面导出名零增减 1026;`LivePendingAskView` +1 可选位;零 wire 新键;peer 不动)。票来源:server 7.87.0 [7571] @client-core(S-454 ①)/ CC-34(core #897 → server S-394)。
|
|
8824
|
+
|
|
8825
|
+
### 64a. 处置表
|
|
8826
|
+
|
|
8827
|
+
| # | 面 | 本包做了什么 | 端要做什么 |
|
|
8828
|
+
|---|---|---|---|
|
|
8829
|
+
| S-1 | **`livePending[].frame?`**(server ≥7.87.0;= 本来会 emit 的那只 `tool_approval` 帧;`row.frame.approvalId === row.approvalId` 恒成立) | **consumed**:视图 +`frame?`(三道闸:帧判别器 ∧ `type === 'tool_approval'` ∧ approvalId 相等;坏形丢该位不丢行);`surfaceSuspendedAskAndRespond` 在场即走流内帧腿全卡;摘要含在场性;tracker delta +`upgraded`(此前出过盲卡、这张快照上 `frame` 到了的行) | 常态零接线(server ≥7.87.0 帧从第一张快照就在,`appeared` 那一步直接出全卡)。🔴 **滚动升级中途形**(先盲后全):`ingest` 返回 `upgraded`;**包不替换已出的盲卡**(帧腿撤卡的唯一方式是给决断);你若有按 callKey 原地更新卡的能力,用 `upgraded[].frame.args` 刷新入参,否则让用户在盲卡上决定 |
|
|
8830
|
+
| S-2 | `permission_denials` 自动升级(CC-34) | **收口**:引擎半场到货,包侧零改动;判据交黑盒 | 零接线;headless 消费面读 `_sema_permission_denials[].tool_use_id`,缺席仍按 `_absent` 读 |
|
|
8831
|
+
|
|
8832
|
+
### 64z. 逐键处置表
|
|
8833
|
+
|
|
8834
|
+
| # | 键 / 面 | 处置 | 坐标 / 理由 |
|
|
8835
|
+
|---|---|---|---|
|
|
8836
|
+
| 1 | `livePending[].frame` | **consumed(三道闸)** | `src/hitl/livePendingAsk.ts` `#readLivePendingRows`;新门 S6a / S6b / S6b′ |
|
|
8837
|
+
| 1b | `frame.type === 'tool_approval_complete'`(完成帧) | **consumed(坏形:丢该位,仍盲卡)** | 判别器放行完成帧,全卡路径不看 type ⇒ 会以空入参出可编辑卡;S6b′ / S6b″ |
|
|
8838
|
+
| 1c | 同一 `approvalId` 先无 `frame` 后有 | **consumed(`upgraded`;不替换已出的卡)** | `#createSuspendedAskTracker`;S4n / S4o / S4p |
|
|
8839
|
+
| 2 | `frame` 内各键(toolArg / risk / suggestions / ruleOffers / 窗三键 …) | **consumed(经流内帧腿同一把窄读)** | `#surfaceSuspendedAskAndRespond` → `surfaceToolApprovalFrameAndRespond`;S6c / S6d / S6f |
|
|
8840
|
+
| 3 | `frame.approvalId ≠ row.approvalId` | **consumed(坏形:丢该位)** | S6b |
|
|
8841
|
+
| 4 | `capabilities.approvalsStreamLive`(server 7.87.1 预告;= checkpointStore ∧ toolApproval,缺席 = 判不出) | **pending(候 7.87.1 出键)** | 到货即加四态兄弟读口;对账节拍的推荐谓词可读它 |
|
|
8842
|
+
| 5 | `stats.humanReview.gates[].toolCallId` | **consumed(0.72.11 起自动升级腿;本版收口)** | `src/adapter/downstream/terminalToSdkResult.ts`;permission-denial 门 E 段 |
|
|
8843
|
+
|
|
8844
|
+
### 64y. 🔴 三端升级必读(固定段式,[C295])
|
|
8845
|
+
|
|
8846
|
+
1. 换钉 `^0.73.2`:常态零接线(悬挂 ask 的卡在 server ≥7.87.0 上自动变成全卡;老 server 上仍是盲卡)。滚动升级中途的先盲后全:读 `ingest().upgraded`,能原地更新卡就刷新入参,否则不动。
|
|
8847
|
+
2. 不接线的端零变化:视图多一个可选键;`frame` 缺席路径逐字同 0.72.14。
|
|
8848
|
+
3. peer sdk >=9.6.0 / agent-types >=0.3.0 不动;server <7.87.0 ⇒ `frame` 恒缺席。
|
|
8849
|
+
|
|
8850
|
+
**包侧缺口:** ⓪ CC-60 cli 五锚包侧半场(窗 09-23,0.73.3);① CC-58 workflow 规模告警判定上收(窗 09-25);② CC-36 托管 MCP 活性三态读口(候 core 7.23.2 #874);③ `capabilities.approvalsStreamLive` 四态读口(候 server 7.87.1 出键);④ `staleAfterSec` / `runId` 经 sdk 到端(候 sdk 出键);⑤ 九件 wire 面经 sdk 声明(候 sdk);⑥ `agents.listing_truncated` detail 读器候消费场景(by-design);⑦ `ClassifierSeat.defaulted?` 候 sdk 出键(by-design);⑧ §NNz「declined 键真零命中」机读第二刀(候形式化);⑨ 缺席上报附 `removeReason`(候壳透传;server S-449 已出附录 H);⑩ 三选卡宿主声明闸候 server 投影判别键;⑪ fleet task 行 `queuedCount` 候 server S-459;⑫ 终态 run 记录上的 `usage.window_exhausted` 读面(另立);⑬ acceptEdits 双 approve 归属候 cli 复跑。
|
|
8851
|
+
|
|
8852
|
+
## §65 🆕 0.73.3 CC-61 sdk 9.7.1 提货 + `approvalsStreamLive` 四态读口;CC-60 五条模型面文案锚包侧半场;patch
|
|
8853
|
+
|
|
8854
|
+
> **patch**:型面纯 additive(+6 函数,公面 1026 → 1032;测试钩 48 → 49;三个既有型面各加一可选位 / 联合成员;devDep sdk ^9.7.1,peer 地板 >=9.6.0 不动;零 wire 新键)。票来源:server 7.87.1 [7590] / [7591] G4 消费半、sdk [7592] / [7600](CC-61);cli 锚登记表 A-D3 / A-D4 / A-D5 / A-D11 / A-D13(CC-60;test T-05 候)。
|
|
8855
|
+
|
|
8856
|
+
### 65a. 处置表
|
|
8857
|
+
|
|
8858
|
+
| # | 面 | 本包做了什么 | 端要做什么 |
|
|
8859
|
+
|---|---|---|---|
|
|
8860
|
+
| S-1 | **`capabilities.approvalsStreamLive`**(server ≥7.87.1;= checkpointStore ∧ toolApproval;缺席 = 老 server) | **consumed**:四态读面六导出 + `livePendingNeedsReconcile` | caps probe 落点旁多调一只 `noteEngineCapsForApprovalsStreamLive`(与四只兄弟同处);`startApprovalsFeed` 的 `reconcile` **照传不关**(推面可靠时它退避到 `maxIntervalMs` 当兜底 —— push 腿一次瞬时 `list()` 失败今天不重试,对账节拍是唯一补偿,见 CC-62);`livePendingNeedsReconcile` 用于 doctor 措辞与 UI 提示(为 true 时明说「悬挂 ask 靠拉,别等推送」),🔴 **不要拿它做 `shouldReconcile` 的合取把对账关掉**;温切后调 `forgetApprovalsStreamLiveReading` |
|
|
8861
|
+
| S-2 | A-D3 `taskOutput` 回体顶层 `cursorSemantics` | **consumed(机读位优先;缺席走文案臂)** | 零接线(包内 `fetchEngineTaskOutput` 已喂);壳侧按标题裸 `includes` 的判读退役 |
|
|
8862
|
+
| S-3 | A-D4 `--- result (<note>) ---` | **consumed** | 零接线 |
|
|
8863
|
+
| S-4 | A-D5 bash 首行两变体 + 注记进良性槽 | **consumed** | 零接线;壳侧若有自己的 bash 首行正则,退役换本包 `parseModelFacingBash`(新可选位 `note`) |
|
|
8864
|
+
| S-5 | A-D11 通知 seed 扫描并集 | **consumed** | 零接线 |
|
|
8865
|
+
| S-6 | A-D13 `parked` 臂 | **consumed** | `EngineTaskStatusAttachment.status` 联合 +`parked`:渲染 switch 加一臂(CC 同形三态文案里 parked 渲「待批」而不是落 default) |
|
|
8866
|
+
|
|
8867
|
+
### 65z. 逐键处置表
|
|
8868
|
+
|
|
8869
|
+
| # | 键 / 面 | 处置 | 坐标 / 理由 |
|
|
8870
|
+
|---|---|---|---|
|
|
8871
|
+
| 1 | `capabilities.approvalsStreamLive` | **consumed(四态)** | `src/approvalsStreamLiveCapability.ts`;新门 24 格 |
|
|
8872
|
+
| 2 | sdk `Capabilities.executionLane` / `LivePendingRow.frame?` / `.contentKind?` / `ApprovalStreamEvent.type` `live_*` / `WiringManifest*` 三具名 schema | **consumed(对表:结构读与声明同形;`contentKind` 本版不消费;`live_*` 载荷不解析)** | 编译期钉未红;§64 / §61 |
|
|
8873
|
+
| 3 | sdk `queuedCount` 幻影键(生产侧 7.87.1 已删,spec 留到 major) | **n/a(登记)** | `FLEET_TASK_ROW_WIRE_KEY_TUPLE` 暂不动;0.73.0 起不编 0 |
|
|
8874
|
+
| 4 | `taskOutput` 回体顶层 `cursorSemantics`(与 `output` 并列) | **consumed** | `src/subagent/engineTaskHandleWire.ts` `#mergeTaskOutput` / `#fetchEngineTaskOutput`;锚门 A-D3 |
|
|
8875
|
+
| 5 | bash 首行括号注记 / 图片形 | **consumed(注记进 `note` 与良性槽)** | `src/toolResult.ts` `#PROTOCOL_MARKERS.bashHead` / `#parseModelFacingBash`;锚门 A-D5 |
|
|
8876
|
+
| 6 | `--- result (…) ---` | **consumed** | `#PROTOCOL_MARKERS.taskOutputResultLine`;锚门 A-D4 |
|
|
8877
|
+
| 7 | 通知 XML 两生产者终局词 | **consumed(并集)** | `src/notifications.ts` `#parseTranscriptNotificationSeeds`;锚门 A-D11 |
|
|
8878
|
+
| 8 | steering `background_tasks` 第四 vbl 臂 | **consumed** | `src/steering.ts` `#PHRASE_TO_STATUS`;锚门 A-D13 |
|
|
8879
|
+
| 9 | sdk L-178 `read_only`(不铸型面) | **n/a(登记门读法)** | gate-vocabulary D2c 措辞改 |
|
|
8880
|
+
|
|
8881
|
+
### 65y. 🔴 三端升级必读(固定段式,[C295])
|
|
8882
|
+
|
|
8883
|
+
1. 换钉 `^0.73.3`:caps tee 加 `noteEngineCapsForApprovalsStreamLive`;feed 的 `reconcile` 照传不关,`livePendingNeedsReconcile` 只进 doctor / 提示;`EngineTaskStatusAttachment.status` 的 switch 加 `parked` 臂;壳里自己的 bash 首行 / result 行 / 标题 `includes` 判读退役换包口。
|
|
8884
|
+
2. 不接线的端零变化:新读口无人 tee ⇒ 恒 `unobserved` ⇒ `livePendingNeedsReconcile` 恒 true(= 0.72.14 起的行为);五锚改的是包内反解,老输入形逐字同旧。
|
|
8885
|
+
3. peer sdk >=9.6.0 / agent-types >=0.3.0 不动;server <7.87.1 ⇒ `approvalsStreamLive` 键缺席 ⇒ `not_reported`。
|
|
8886
|
+
|
|
8887
|
+
**包侧缺口:** ⓪ CC-58 workflow 规模告警判定上收(窗 09-25);① CC-36 托管 MCP 活性三态读口(候 core 7.23.2 #874);② `LivePendingRow.contentKind` 消费(候消费场景);③ `staleAfterSec` / `runId` 经 sdk 到端(候 sdk 出键);④ 九件 wire 面经 sdk 声明(sdk 9.7.x 已追平六处;余候 sdk);⑤ `agents.listing_truncated` detail 读器候消费场景(by-design);⑥ `ClassifierSeat.defaulted?` 候 sdk 出键(by-design);⑦ §NNz「declined 键真零命中」机读第二刀(候形式化);⑧ 缺席上报附 `removeReason`(候壳透传);⑨ 三选卡宿主声明闸候 server 投影判别键;⑩ fleet task 行 `queuedCount` 候 sdk major 删 spec;⑪ 终态 run 记录上的 `usage.window_exhausted` 读面(另立);⑫ acceptEdits 双 approve 归属候 cli 复跑。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.73.
|
|
3
|
+
"version": "0.73.3",
|
|
4
4
|
"description": "Client-side session runtime shared by every sema human client (TUI / web / desktop): sema wire frames (AgentEvent) -> CC session vocabulary (SDKMessage) with dual-plane output (transcript/chrome), deterministic transcript ids, lane discipline as a type, and the notification/dedup ledgers. Every CC-skin shape is collected here so the wire itself stays neutral. Renamed from @sema-agent/wire-cc-adapter (0.1.x).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@sema-agent/agent-types": "^0.3.0",
|
|
38
38
|
"@sema-agent/core": "~7.23.0",
|
|
39
|
-
"@sema-agent/sdk": "^9.
|
|
39
|
+
"@sema-agent/sdk": "^9.7.1",
|
|
40
40
|
"@sema-agent/settings-schema": "^2.0.0",
|
|
41
41
|
"esbuild": "^0.27.4",
|
|
42
42
|
"typescript": "^6.0.2"
|