@sema-agent/client-core 0.71.2 → 0.71.4
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 +25 -0
- package/README.md +3 -1
- package/dist/adapt/arms.js +4 -1
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +5 -0
- package/dist/adapter/downstream/eventToSdkMessage.js +12 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +19 -1
- package/dist/effectiveFacts.d.ts +62 -0
- package/dist/effectiveFacts.js +88 -0
- package/dist/engineErrorCodes.d.ts +16 -0
- package/dist/engineErrorCodes.js +21 -0
- package/dist/engineNoticeCodes.d.ts +1 -1
- package/dist/engineNoticeCodes.js +4 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/liveModelCatalog.d.ts +14 -0
- package/dist/liveModelCatalog.js +18 -0
- package/dist/resumeRefusalCopy.d.ts +19 -0
- package/dist/resumeRefusalCopy.js +35 -1
- package/dist/seam.d.ts +3 -1
- package/docs/INTEGRATION-CLIENTS.md +85 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -49,6 +49,31 @@
|
|
|
49
49
|
> 挡住 ⇒ 本批把它机械化——④a0 对 `pending` 行**要求段头已是日期形**(`(未发布)` 直接红),阶段一
|
|
50
50
|
> commit 漏转在发布前就红,不再靠人记。
|
|
51
51
|
|
|
52
|
+
## 0.71.4(2026-09-17)
|
|
53
|
+
|
|
54
|
+
> 主题:**core 7.20.1 提货**(提货单 [7415];本包 [7411] 认领)。**patch**:型面纯 additive(一个 `_sema_` 超集键 + 通告闭集 +1),公面 995 不变,peer 不动;devDep core `~7.20.1`。接入面 §46。
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- **`ENGINE_NOTICE_CODES` +1 = 六十五码**(顺序同源):`config.write_protection_target_view_absent`(index 13,紧跟 `config.task_root_not_canonical`;operator)—— 写保护判官只判拼写(`spelling-only`)、又挂了受保护写工具 ⇒ 每 run 一条(#853 C-R55 缺席响亮)。码册门 G8b 六十五 + G9 两格。
|
|
59
|
+
- **`wiring_manifest.writeProtection` 第七段进切片 ⇒ `_sema_writeProtection?: { targetView: 'spelling-only' | 'target' }`** + chrome `wiring_manifest.writeProtection?`:present-iff 这条腿编译出了写保护判官;🔴 缺席 = 没编译出判官(第三态),**不折 `spelling-only`**;`targetView` 不在二词 / 非对象 ⇒ 段缺席(其余段照投);多余成员不过境。type-superset 登记 +1;wiring 门 K 段。
|
|
60
|
+
|
|
61
|
+
## 0.71.3(2026-09-17)
|
|
62
|
+
|
|
63
|
+
> 主题:清账批 —— 接入方七轴审查 [7367] R4 / R5 / 顺手项(CC-24 export-liveness 门 + 退役预告 / CC-26 `as unknown as` 铸链棘轮 / CC-25 §NNz 机读门与已发版本落点)+ **CC-06 B-081 包侧半场**(终局回执未消费族四件)。**patch**:型面纯 additive(公面 986 → 995;两个 `_sema_` 超集键)、peer 不动;本版只**预告**退役,不删任何导出。接入面 §45。
|
|
64
|
+
|
|
65
|
+
### Deprecated
|
|
66
|
+
|
|
67
|
+
- 🔴 **39 个运行期导出预告退役(0.72.0 删,型面 BREAKING 随下一 minor)**:四端源码树(cli / web-client / desktop / web-admin 的 `src` / `ui` / `bff`)逐名扫描零消费、本仓门零引用、唯一命中是公面基线登记本身 —— `AUTHORITY_ENVELOPE_TAGS` `CANCEL_RELEASE_WAIT_MS` `CATALOG_CACHE_RELATIVE_PATH` `CATALOG_CACHE_STALE_MS` `DEFAULT_CATALOG_TIMEOUT_MS` `DEVICE_CODE_BACKOFF_STEP_MS` `DEVICE_CODE_HTTP_TIMEOUT_MS` `DEVICE_CODE_MAX_LIFETIME_MS` `DEVICE_CODE_MIN_INTERVAL_MS` `HITL_ASK_QUESTION_ID_PREFIX` `HITL_FRAME_CALL_KEY_PREFIX` `LIMITS_ERROR_CODE_PREFIX` `MAX_DENY_REASON_CHARS` `ONE_SHOT_ENV` `PROBE_MAX_TOKENS` `PROBE_PROMPT` `PROMPT_PROFILE_ENV` `TOOL_END_INTERRUPTED_CODES` `WORKFLOW_DEFER_ENV` `WORKFLOW_PARK_BINDING_BROKEN` `WORKFLOW_PARK_NOT_PENDING` `WORKFLOW_PARK_REQUIRES_RUN_STORE` `WORKFLOW_PARK_TRUTH_UNREADABLE` `clearArmedGateFor` `deriveAgentLabel` `notePlanReviewAnsweredIfDecisiveFor` `onGateArmedFor` `parseBackgroundReceipt` `parseFinalVerifyArgv` `providerApiShortName` `registerArmedGateFromQuestionIdFor` `wireCurrentTool` `wireEditedFiles` `wireParentToolCallId` `wireRetiredBy` `wireStartedCount` `wireStoppedBy` `wireToolUses` `wireTranscriptId`。仍需要其中任一个的端在 0.71.3 发车帖上认领即翻 `candidate`(带票号 + 窗),否则 0.72.0 起不再导出。登记与判据见 `scripts/export-liveness.json`。
|
|
68
|
+
- **34 个内部件被 `export *` 放大出公面**(登 `internal`,包内在用、端零消费;候下一 minor 收回不导出):`DEFAULT_DENY_REASON` `DENIAL_LIMIT_KINDS` `MAX_HOOK_NOTICE_TEXT_CHARS` `RULE_OFFERS_ABSENCE_REASONS` `STOP_NOT_LANDED` `STOP_NOT_LOCAL` `STOP_PARKED` `STOP_PARK_ARBITER_UNREACHABLE` `STOP_PARK_RESUME_WON` `clearBgTerminalFacts` `denyReasonForWire` `engineCapNestedTrue` `engineSessionParamFor` `engineWireDebugEnabled` `hostTimersFor` `isAskTool` `listNotifiedRuns` `listWorkflowCompletionCardsEnqueued` `noteBgOwnerAbsence` `notePlanReviewAnsweredFor` `planReviewArmedKeyFor` `projectDiagnosticsFrame` `registerSubagentContentAlias` `resolveOwnerContext` `shortTaskLabel` `surfaceEditNotForwarded` `surfaceRememberNotApplied` `surfaceRuleArmNotSent` `surfaceRuleArmRejected` `unrefTimer` `unregisterLocalQuestionResponder` `waitForGateArmedFor` `wireCycleSeq` `wireParentId`。
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
|
|
72
|
+
- **CC-06(B-081 包侧半场,cli L-211 对位)终局回执未消费族四件**:① `TaskResult.effectiveReasoning` ⇒ 终帧 `result._sema_effective_reasoning`(`EffectiveReasoningView`:requested / effective / graded / clamped / format / endpoint / `dropped?: true`)② `TaskResult.effectiveMemoryScopes` ⇒ `result._sema_effective_memory_scopes`(`EffectiveMemoryScopesView`:state ∈ {mounted, memoryless, none} / reason? / contract? / scopes[] / writeScope / materializedResidue?)—— 两键由 server 终帧键集 verbatim 转发而 sdk d.ts 未建模,本包窄读后按超集键铸(type-superset 登记 +2;成功臂与错误信封同带;坏形整键不铸不折默认;读器 `readEffectiveReasoning` / `readEffectiveMemoryScopes` 出公面)③ resume **reopen 族**:`RESUME_REOPEN_CODES` = `resume.env_failed` / `resume.tool_unavailable` / `resume.tool_contract_mismatch`(server resume-legs 同表:core 先 reopen 再返回 failed ⇒ 卡仍 pending、行重新 park、retriable)+ `resumeReopenFromError(err)` → `{ code, reason, retriable: true }`(只在拒体 `retriable === true` 时命中:server 只在 store 复核真重开后才铸它,同码无 retriable = 终局失败 ⇒ null)+ `resumeReopenContent` 三句(零内部车道词);与 `RESUME_REFUSAL_CODES` / `RESUME_RETRY_LATER_CODES` 两两不交 ④ `routePairingVerdict(v)`:sdk 已知七词判(四 ok / 两 broken),其余一律 unknown 不按前缀猜(`LiveModelInfo.routePairing?`)。新门 `run-terminal-facts-projection`(A/B/C/D 四段)+ manifest + README Guards;公面 986 → 995(+4 常量 +5 函数);typeshape unknown 出境 341 → 345(四只 wire 读器入参)、portability 内核闭包 11 → 12 / index 闭包 164 → 165(`effectiveFacts.ts` 零 import 纯叶),理由均在门内。B-081 另两件(`serverGates.durableApproval` 姿态 / `/health startedAt` 代际锚)本包既有站点(postureKnob / headlessPermissionModeWire / engineIdentity),登 consumed。
|
|
73
|
+
- **CC-26 `as unknown as` 铸链棘轮**(typeshape 门):AST 精算 `X as unknown as T` 铸链 56 处(整包)与铸出口 `as unknown as SDKMessage` 29 处,两条只降不升(零松量);自检语料加一条铸链正控;变异「基线 56→55」⇒ 红。此前 53–57 处零棘轮,铸出口只被超集台账间接看着。
|
|
74
|
+
- **CC-25 冻结账门 ⑧ 段**:⑧a 各 §NNz 处置表里「`src/x.ts` 的 `#symbol`」坐标逐组真在(文件在 ∧ 符号名词级在该文件,70+ 组);⑧b FROZEN 账上每个已发版本在接入档有落点(此前 0.30.1 / 0.30.2 / 0.30.5 / 0.30.6 / 0.30.7 / 0.33.0 / 0.38.1 / 0.59.1 / 0.59.2 / 0.64.1 十版零落点,补 §0c 已发版本索引);「declined 键真零命中」不机读(处置表写的是 wire 键不是源码符号,需先形式化,候第二刀)。
|
|
75
|
+
- **`run-export-liveness-test` 门(CC-24)**:公面基线里每个运行期导出必须「被某只门引用 ∨ 在 `scripts/export-liveness.json` 登记」;登记不是豁免 —— 门已引用的行过期必删、陈腐名红、`candidate` / `retire` 必带 `retireBy` 且 `package.json` ≥ `retireBy` 即到期红、行数棘轮只降(117);四端树在盘时逐名核端消费(`contract` 行的 consumer 自报必须等于实际集合,`retire` 名字不许被任何端消费);判别器自证。负控套 +1(17 只自动化)。
|
|
76
|
+
|
|
52
77
|
## 0.71.2(2026-09-17)
|
|
53
78
|
|
|
54
79
|
> 主题:接入方 1.0.117 黑盒验收两票归包(B-132 / B-133)。**patch**:零型面变化、公面 986 不变、peer 不动;运行期只改两句拒体人话 + 一条「说不出」守卫。接入面 §44。
|
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.71.
|
|
38
|
+
**Version:** 0.71.4
|
|
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
|
|
@@ -306,6 +306,8 @@ public-surface guard checks that last one).
|
|
|
306
306
|
| `scripts/run-gate-vocabulary-test.mjs` | The two gate vocabularies — who denied a call (`DeniedBy`, nine words) and who asked about it (`AskOrigin`, eleven) — together with the one place their sentences are minted, so the same denial does not read three different ways across three clients. The tables are copies, not opinions: the gate parses the members straight out of the installed SDK's declarations and reconciles them against the package's tables in both directions, so a word added upstream (nobody renders it, the user sees a bare code) and a word only the package believes in (a branch that can never fire) both fail. Every word must carry its own literal sentence and no two may collide, including the sibling pairs the upstream deliberately split apart — an organization store and a personal rule store being unreadable send you to different people, and the two tighten origins exist precisely to name which layer of engine logic asked. The two fallbacks are pinned distinct because the sets differ in kind: one is genuinely closed on the wire (an out-of-set record is withheld by the engine, so reading one means the record is damaged) while the other is genuinely open (the server only checks for a non-empty string, so an unknown word just means the client is older than the engine) Alongside them sits an **uplift anchor** rather than a third table: the reason a call was decided the way it was is a distinct semantic face from who denied it and who asked, one upstream has not mirrored into the SDK at all, and one whose newest member — a shell command allowed because it only reads — has no sentence anywhere yet. Minting the union here would create the second drifting source the day upstream publishes it, so the guard instead asserts the **absence** from both ends: the SDK declarations carry no such union near that word, and the installed engine’s own list does not carry the word either. The engine end fires first, on the batch that raises the dependency, which is exactly when the ownership question should be answered; the SDK end fires when the mirror lands. Either red is the work order to mint the sentence, never a reason to delete the anchor |
|
|
307
307
|
| `scripts/run-engine-identity-test.mjs` | The engine generation anchors on `/health` (`pid`, `instanceId`, `startedAt`; engine >=7.67.0). `/health` is the one unauthenticated door and its heartbeat is always green, so "another host restarted the shared engine" used to be discoverable only by having some authenticated request hit a 401 first — a path that misreads a restart as a network fault. The reader narrows each anchor independently (one malformed field never hides the other two) and always hands back a reading object rather than an absence, because the caller is asking which anchors answered, not whether there was a response. The comparison is a three-word verdict, not a boolean: `unknown` when the two readings share no comparable anchor at all — an empty intersection means nothing could be compared, never that nothing changed — and the boolean convenience is pinned so that only `true` is an assertion. Any comparable anchor differing decides `changed`, so a reading whose `startedAt` matches while its `instanceId` does not cannot be waved through as the same life; precedence only decides which anchor gets named in the diagnosis |
|
|
308
308
|
| `scripts/run-posture-knob-projection-test.mjs` | The three deployment knobs on the operator face (`serverGates.durableApproval` / `streamAskWindowMs` / `sessionAutoTitle`, engine >=7.67.0), each read as a value **plus who set it plus one operator-facing pointer** rather than a bare value — a bare boolean cannot answer why this particular machine is on this setting or how to pin it back, and a default that flips with the deployment shape is invisible without that. A worker too old to report readings still sends a bare boolean; the reader folds it into the same shell so consumers keep one branch, but raises a `legacy` bit, answers `undefined` from the machine-readable source accessor, and mints a sentence that contains no source word at all — claiming a source nobody reported is worse than admitting the worker cannot say. The other two knobs are honestly absent on such a worker rather than defaulted, a malformed side knob drops only itself while the anchor knob drops the whole reading, and the four sentences are pinned literally distinct so an operator can tell "not observed" from "not reported" from a real value. The last leg reads the installed SDK's `openapi.yaml` and `types.d.ts` directly, including a pin that exactly one knob on this face is numeric — the premise the millisecond-to-prose rendering rests on |
|
|
309
|
+
| `scripts/run-terminal-facts-projection-test.mjs` | The four unconsumed terminal-receipt facts: `TaskResult.effectiveReasoning` / `effectiveMemoryScopes` are narrowed into `_sema_effective_reasoning` / `_sema_effective_memory_scopes` on the CC-shaped `result` (success and error envelopes alike; a malformed value mints nothing, never a default tier), the resume **reopen** family (`resume.env_failed` / `tool_unavailable` / `tool_contract_mismatch`) is a frozen closed set with a reader and three-sentence copy that is disjoint from the refusal and retry-later sets, and `routePairingVerdict` reads `ModelInfo.routePairing` as ok / broken / unknown without policing the open set. |
|
|
310
|
+
| `scripts/run-export-liveness-test.mjs` | Every runtime export in the public baseline must be **alive**: referenced by some gate, or explicitly registered in `scripts/export-liveness.json` as `contract` (consumed by a client with no gate yet), `internal` (an internal helper amplified onto the public surface by `export *`), `candidate` (with ticket + retire-by) or `retire` (dead; retire-by version). Registration is accounting, not exemption: a row for a name a gate already references is stale and must go, a row for a name no longer exported is red, `retire`/`candidate` rows go red the moment `package.json` reaches their retire-by version, and the row count only ratchets down. When the sibling client trees are on disk the consumption evidence is checked by name — a `contract` row's claimed consumers must equal the real set, and a `retire` name must not be imported by any client. |
|
|
309
311
|
| `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). |
|
|
310
312
|
| `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") |
|
|
311
313
|
| `scripts/run-core-value-ports-test.mjs` | The port-injection seam for ten **engine value-level** facilities (autonomous-loop prompt assembly, permission-rule loosening, tool-policy composition, protocol/retired-name/grammar lookups, rule compilation, the discussion workflow name). This package cannot re-export them (the engine barrel drags Node built-ins into the browser bundle), so it declares the ports and honest-absence readers; a Node host installs the engine's own functions verbatim. The guard pins: every reader returns `undefined` when nothing is installed (never a fabricated empty array or default policy), arguments and results pass through by reference, engine errors propagate unchanged, partial installs read partially, restore functions unwind to the previous bag, and the module source has zero engine imports |
|
package/dist/adapt/arms.js
CHANGED
|
@@ -371,6 +371,8 @@ const wiringManifestArm = function* (m) {
|
|
|
371
371
|
const tools = m._sema_tools;
|
|
372
372
|
const hooks = m._sema_hooks;
|
|
373
373
|
const lsp = m._sema_lsp;
|
|
374
|
+
const writeProtection = m._sema_writeProtection;
|
|
375
|
+
const hasWriteProtection = typeof writeProtection === 'object' && writeProtection !== null;
|
|
374
376
|
const hasTools = typeof tools === 'object' && tools !== null;
|
|
375
377
|
const hasHooks = Array.isArray(hooks);
|
|
376
378
|
const hasLsp = typeof lsp === 'object' && lsp !== null;
|
|
@@ -379,7 +381,7 @@ const wiringManifestArm = function* (m) {
|
|
|
379
381
|
// S-124(0.59.0):🔴 `Array.isArray` 判在场,**不判 `.length`** —— `mcp: []` 是「这条腿一台都
|
|
380
382
|
// 没申报」这句正面事实,按长度判会把它和「老 mint 没报」折成同一件事(core 顶注点名的读法)。
|
|
381
383
|
const hasMcp = Array.isArray(mcp);
|
|
382
|
-
if (!hasGate && !hasAuto && !hasMcp && !hasTools && !hasHooks && !hasLsp)
|
|
384
|
+
if (!hasGate && !hasAuto && !hasMcp && !hasTools && !hasHooks && !hasLsp && !hasWriteProtection)
|
|
383
385
|
return;
|
|
384
386
|
yield chrome({
|
|
385
387
|
kind: 'wiring_manifest',
|
|
@@ -390,6 +392,7 @@ const wiringManifestArm = function* (m) {
|
|
|
390
392
|
...(hasTools ? { tools: tools } : {}),
|
|
391
393
|
...(hasHooks ? { hooks: hooks } : {}),
|
|
392
394
|
...(hasLsp ? { lsp: lsp } : {}),
|
|
395
|
+
...(hasWriteProtection ? { writeProtection: writeProtection } : {}),
|
|
393
396
|
...(typeof m.eventId === 'string' && m.eventId.length > 0 ? { eventId: m.eventId } : {}),
|
|
394
397
|
});
|
|
395
398
|
};
|
|
@@ -232,6 +232,11 @@ export interface WiringManifestMcpEntryView {
|
|
|
232
232
|
httpStatus?: number;
|
|
233
233
|
}
|
|
234
234
|
export declare function projectMcpSection(raw: unknown): WiringManifestMcpEntryView[] | undefined;
|
|
235
|
+
/** core 7.20.1(0.71.4):`wiring_manifest.writeProtection` 第七段 —— 写保护判官自报的目标视图(present-iff 这条腿编译出了判官)。 */
|
|
236
|
+
export interface WiringManifestWriteProtectionView {
|
|
237
|
+
/** `spelling-only` = 只判拼写(别名写不拦;同 run 另发 `config.write_protection_target_view_absent`);`target` = 判真实目标。 */
|
|
238
|
+
targetView: 'spelling-only' | 'target';
|
|
239
|
+
}
|
|
235
240
|
/**
|
|
236
241
|
* CC-08(0.71.0):`wiring_manifest.hooks[]` 一行(sdk 9.6.0 `WiringManifestHookEntry`)—— 这条腿挂了哪些 hook 族、
|
|
237
242
|
* 由 spec 还是 deps 拥有、是否只是观察性的。开集透传 `family` / `owner`;`observational` never-false。
|
|
@@ -1220,7 +1220,8 @@ function wiringManifestSupersetBody(ev) {
|
|
|
1220
1220
|
const tools = projectToolRoster(ev);
|
|
1221
1221
|
const hooks = projectHooksSection(ev.hooks);
|
|
1222
1222
|
const lsp = projectLspSection(ev.lsp);
|
|
1223
|
-
|
|
1223
|
+
const writeProtection = projectWriteProtectionSection(ev.writeProtection);
|
|
1224
|
+
if (modelGate === undefined && autoMode === undefined && mcp === undefined && tools === undefined && hooks === undefined && lsp === undefined && writeProtection === undefined)
|
|
1224
1225
|
return undefined;
|
|
1225
1226
|
return {
|
|
1226
1227
|
...(modelGate !== undefined ? { _sema_modelGate: modelGate } : {}),
|
|
@@ -1229,8 +1230,18 @@ function wiringManifestSupersetBody(ev) {
|
|
|
1229
1230
|
...(tools !== undefined ? { _sema_tools: tools } : {}),
|
|
1230
1231
|
...(hooks !== undefined ? { _sema_hooks: hooks } : {}),
|
|
1231
1232
|
...(lsp !== undefined ? { _sema_lsp: lsp } : {}),
|
|
1233
|
+
...(writeProtection !== undefined ? { _sema_writeProtection: writeProtection } : {}),
|
|
1232
1234
|
};
|
|
1233
1235
|
}
|
|
1236
|
+
/** 🔴 缺席 = 没编译出判官(第三态),**不折 `spelling-only`**;`targetView` 不在二词 / 非对象 ⇒ 段缺席;多余成员不过境。 */
|
|
1237
|
+
function projectWriteProtectionSection(raw) {
|
|
1238
|
+
if (typeof raw !== 'object' || raw === null || Array.isArray(raw))
|
|
1239
|
+
return undefined;
|
|
1240
|
+
const v = raw.targetView;
|
|
1241
|
+
if (v !== 'spelling-only' && v !== 'target')
|
|
1242
|
+
return undefined;
|
|
1243
|
+
return { targetView: v };
|
|
1244
|
+
}
|
|
1234
1245
|
function projectHooksSection(raw) {
|
|
1235
1246
|
if (!Array.isArray(raw))
|
|
1236
1247
|
return undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { stamp } from '../types.js';
|
|
2
2
|
import { putOwnKey } from '../../ownKey.js';
|
|
3
|
+
import { readEffectiveReasoning, readEffectiveMemoryScopes } from '../../effectiveFacts.js';
|
|
3
4
|
// 0.60.0(engine ≥7.64.0 / sdk 8.4.0):终局读数的**单一读器**(两代字节 → 一个带标因由)。
|
|
4
5
|
import { isReviewPark, readRunTerminal, runTerminalCode, runTerminalGateToolName, } from '../../runTerminal.js';
|
|
5
6
|
import { toCcModelUsage } from './turnUsageToModelUsage.js';
|
|
@@ -274,6 +275,19 @@ export function readRunCostFacts(stats, observed) {
|
|
|
274
275
|
reconcile,
|
|
275
276
|
};
|
|
276
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* CC-06 / B-081:`TaskResult.effectiveReasoning` / `effectiveMemoryScopes` 由 server 终帧键集 verbatim 转发,
|
|
280
|
+
* sdk d.ts 未建模 ⇒ 从裸终帧记录窄读后按 `_sema_` 超集键铸到 CC 形 `result` 上;坏形 / 缺席 ⇒ 键不铸。
|
|
281
|
+
* 🔴 CC 同名键零改:这两位是 additive,`result` 上既有的任何键字节不动。
|
|
282
|
+
*/
|
|
283
|
+
function effectiveFactParts(rec) {
|
|
284
|
+
const reasoning = readEffectiveReasoning(rec.effectiveReasoning);
|
|
285
|
+
const scopes = readEffectiveMemoryScopes(rec.effectiveMemoryScopes);
|
|
286
|
+
return {
|
|
287
|
+
...(reasoning !== undefined ? { _sema_effective_reasoning: reasoning } : {}),
|
|
288
|
+
...(scopes !== undefined ? { _sema_effective_memory_scopes: scopes } : {}),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
277
291
|
/**
|
|
278
292
|
* D-3 —— 终帧上的两个成本超集键(成功臂与错误信封共用的**唯一** mint 点)。
|
|
279
293
|
* 🔴 CC 同名键 `total_cost_usd` **语义零改**:它仍然只是 own 花费,`nested` **不折进去**
|
|
@@ -714,6 +728,8 @@ function errorResult(ctx, parts) {
|
|
|
714
728
|
...permissionDenialParts(parts.stats),
|
|
715
729
|
// D-3 / B-068:失败/到限/park 的 run 一样花过钱,账不因结局不好就不报。
|
|
716
730
|
...costFactParts(parts.stats, parts.observed),
|
|
731
|
+
// CC-06:引擎生效面两键(失败臂同带)。
|
|
732
|
+
...(parts.facts ?? {}),
|
|
717
733
|
// L-228(0.67.0):流内 per-subagent 分表的收口快照(判据本体在 `nestedUsageByTaskParts`)。
|
|
718
734
|
// 🔴 与成本三段同理 —— 失败的 run 一样委派过,账不因结局不好就不报。
|
|
719
735
|
...nestedUsageByTaskParts(parts.stats, parts.observed?.nestedUsageByTask),
|
|
@@ -784,7 +800,7 @@ observed) {
|
|
|
784
800
|
// failed + limits.max_{tokens,walltime}_exceeded 两族共用)。
|
|
785
801
|
const degraded = degradedOf(r);
|
|
786
802
|
/** 四个 error 臂共享的固定位(信封其余 13 位见 `errorResult`)。 */
|
|
787
|
-
const errorBase = { durationMs, stats, model: r.model, errorCode, degraded, observed };
|
|
803
|
+
const errorBase = { durationMs, stats, model: r.model, errorCode, degraded, observed, facts: effectiveFactParts(rec) };
|
|
788
804
|
if (terminal?.kind === 'failed') {
|
|
789
805
|
// [909]B1 — failed 臂 subtype 语义化(见文件头对表);core 5.8.0([2489])起到限码全部改名,
|
|
790
806
|
// 映射本身已收进单点 `subtypeForErrorCode`(退役批后只认新码)。
|
|
@@ -916,6 +932,8 @@ observed) {
|
|
|
916
932
|
...permissionDenialParts(stats),
|
|
917
933
|
// D-3 / B-068:成本明细与子代那本账(micro-USD 原值);`total_cost_usd` 语义一字不动。
|
|
918
934
|
...costFactParts(stats, observed),
|
|
935
|
+
// CC-06(0.71.3):`_sema_effective_reasoning` / `_sema_effective_memory_scopes`。
|
|
936
|
+
...effectiveFactParts(rec),
|
|
919
937
|
// L-228(0.67.0):流内 per-subagent 分表的收口快照;与 `_sema_nested_usage`(引擎报的合计)
|
|
920
938
|
// 是**两份独立的账**,不相加、不互证(见 `nestedUsageByTaskParts` 顶注)。
|
|
921
939
|
...nestedUsageByTaskParts(stats, observed?.nestedUsageByTask),
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* effectiveFacts.ts — 终局回执上两件「引擎生效面」事实的**窄读器**(CC-06 / B-081 包侧半场,0.71.3)。
|
|
3
|
+
*
|
|
4
|
+
* core `TaskResult.effectiveReasoning`(`brain/reasoning.d.ts` `ResolvedReasoning`)与
|
|
5
|
+
* `TaskResult.effectiveMemoryScopes`(`core/task-result.d.ts` 四臂联合)由 server 终帧键集 **verbatim 转发**
|
|
6
|
+
* (`trace/core-keyset-guard.ts` 终帧表 + `observability/run-terminal-log.ts` 两行 `"verbatim"`),但 sdk 的
|
|
7
|
+
* `AgentEvent` d.ts **没建模**这两键 ⇒ 本包按 `_sema_` 超集键投到 CC 形 `result` 上(登记见 `docs/type-superset.json`),
|
|
8
|
+
* 端渲「/effort 有效档」与「记忆面板 memoryless 面」时读它们,不必自己从裸终帧里挖。
|
|
9
|
+
*
|
|
10
|
+
* 🔴 读器纪律(与本包所有 wire 读器同律):坏形 ⇒ **整键不铸**(`undefined`),不折默认档、不折空表;
|
|
11
|
+
* 多余成员不过境(新铸形);`dropped` 只认严格 `true`(core:「Present (true) only when …」never-false)。
|
|
12
|
+
* 纯叶模块:零 import,零 Node 内建(内核闭包不涨)。
|
|
13
|
+
*/
|
|
14
|
+
/** core `ResolvedReasoning` 的窄读视图:请求档 / 生效档 / 分级 / 夹取 / wire 形 / 端点 + 整只被丢的判别位。 */
|
|
15
|
+
export interface EffectiveReasoningView {
|
|
16
|
+
/** 调用方要的档(core `ThinkingLevel`,开集串)。 */
|
|
17
|
+
requested: string;
|
|
18
|
+
/** 映射到端点真实能力后**生效**的档;与 `requested` 不同即 `clamped`。 */
|
|
19
|
+
effective: string;
|
|
20
|
+
/** 端点按分级(而非精确档)接受请求。 */
|
|
21
|
+
graded: boolean;
|
|
22
|
+
/** `effective !== requested`(请求没被精确满足)。 */
|
|
23
|
+
clamped: boolean;
|
|
24
|
+
/** 请求最终走的 wire 形(如 `anthropic-budget` / `openai-effort`)。 */
|
|
25
|
+
format: string;
|
|
26
|
+
/** 端点粗标签(如 `anthropic-messages`)。 */
|
|
27
|
+
endpoint: string;
|
|
28
|
+
/**
|
|
29
|
+
* 在场 = 请求**根本没带**推理参数(模型不声明推理能力 / 档不在契约里 / budget 路径 cap-wins 跳过)——
|
|
30
|
+
* 请求的档被**整只丢掉**,不是被夹取。缺席 = 带了(可能夹取)。
|
|
31
|
+
*/
|
|
32
|
+
dropped?: true;
|
|
33
|
+
}
|
|
34
|
+
/** core `EffectiveMemoryScopes` 四臂联合的窄读视图(端只按 `state` 分臂渲)。 */
|
|
35
|
+
export interface EffectiveMemoryScopesView {
|
|
36
|
+
/** `mounted` = 记忆挂上了;`memoryless` = 该挂没挂上(看 `reason`);`none` = 本就不挂(`no-spec` / `disabled`)。 */
|
|
37
|
+
state: 'mounted' | 'memoryless' | 'none';
|
|
38
|
+
/** `memoryless`:`mount-failed` / `no-backend`;`none`:`no-spec` / `disabled`;`mounted` 缺席。开集透传。 */
|
|
39
|
+
reason?: string;
|
|
40
|
+
/** 记忆契约代际;`none` 臂缺席。 */
|
|
41
|
+
contract?: 'v2' | 'legacy';
|
|
42
|
+
/** 生效的作用域(`mounted` 才非空);坏行逐条丢。 */
|
|
43
|
+
scopes: readonly {
|
|
44
|
+
scope: string;
|
|
45
|
+
origin: 'deployment' | 'request';
|
|
46
|
+
}[];
|
|
47
|
+
/** 写入作用域;`null` = 没有可写的。 */
|
|
48
|
+
writeScope: string | null;
|
|
49
|
+
/** `memoryless` + `mount-failed` 时可能带:已物化的残留路径(非串滤)。 */
|
|
50
|
+
materializedResidue?: readonly string[];
|
|
51
|
+
}
|
|
52
|
+
/** `TaskResult.effectiveReasoning` 的窄读:六键形对得上才铸;坏形 ⇒ `undefined`。 */
|
|
53
|
+
export declare function readEffectiveReasoning(v: unknown): EffectiveReasoningView | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* `TaskResult.effectiveMemoryScopes` 的窄读 —— **按臂**验必需成员、按臂构造允许成员(core `task-result.d.ts` 四臂):
|
|
56
|
+
* · `mounted`:`contract` 必在(v2 | legacy);`scopes` 数组(坏行逐条丢);`writeScope` 串或 null;不带 reason / residue;
|
|
57
|
+
* · `memoryless`:`reason` ∈ {mount-failed, no-backend} 必在;`scopes` 必为空数组;`writeScope` 必为 null;`contract` 可选;
|
|
58
|
+
* `materializedResidue` 只在 mount-failed 臂过境(非串滤);
|
|
59
|
+
* · `none`:`reason` ∈ {no-spec, disabled} 必在;`scopes` 空、`writeScope` null;不带 contract / residue。
|
|
60
|
+
* 结构不成立 ⇒ `undefined`(整键不铸);臂外成员不过境。
|
|
61
|
+
*/
|
|
62
|
+
export declare function readEffectiveMemoryScopes(v: unknown): EffectiveMemoryScopesView | undefined;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* effectiveFacts.ts — 终局回执上两件「引擎生效面」事实的**窄读器**(CC-06 / B-081 包侧半场,0.71.3)。
|
|
3
|
+
*
|
|
4
|
+
* core `TaskResult.effectiveReasoning`(`brain/reasoning.d.ts` `ResolvedReasoning`)与
|
|
5
|
+
* `TaskResult.effectiveMemoryScopes`(`core/task-result.d.ts` 四臂联合)由 server 终帧键集 **verbatim 转发**
|
|
6
|
+
* (`trace/core-keyset-guard.ts` 终帧表 + `observability/run-terminal-log.ts` 两行 `"verbatim"`),但 sdk 的
|
|
7
|
+
* `AgentEvent` d.ts **没建模**这两键 ⇒ 本包按 `_sema_` 超集键投到 CC 形 `result` 上(登记见 `docs/type-superset.json`),
|
|
8
|
+
* 端渲「/effort 有效档」与「记忆面板 memoryless 面」时读它们,不必自己从裸终帧里挖。
|
|
9
|
+
*
|
|
10
|
+
* 🔴 读器纪律(与本包所有 wire 读器同律):坏形 ⇒ **整键不铸**(`undefined`),不折默认档、不折空表;
|
|
11
|
+
* 多余成员不过境(新铸形);`dropped` 只认严格 `true`(core:「Present (true) only when …」never-false)。
|
|
12
|
+
* 纯叶模块:零 import,零 Node 内建(内核闭包不涨)。
|
|
13
|
+
*/
|
|
14
|
+
const nonEmpty = (v) => typeof v === 'string' && v.length > 0;
|
|
15
|
+
/** `TaskResult.effectiveReasoning` 的窄读:六键形对得上才铸;坏形 ⇒ `undefined`。 */
|
|
16
|
+
export function readEffectiveReasoning(v) {
|
|
17
|
+
if (typeof v !== 'object' || v === null)
|
|
18
|
+
return undefined;
|
|
19
|
+
const o = v;
|
|
20
|
+
if (!nonEmpty(o.requested) || !nonEmpty(o.effective) || !nonEmpty(o.format) || !nonEmpty(o.endpoint))
|
|
21
|
+
return undefined;
|
|
22
|
+
if (typeof o.graded !== 'boolean' || typeof o.clamped !== 'boolean')
|
|
23
|
+
return undefined;
|
|
24
|
+
return {
|
|
25
|
+
requested: o.requested,
|
|
26
|
+
effective: o.effective,
|
|
27
|
+
graded: o.graded,
|
|
28
|
+
clamped: o.clamped,
|
|
29
|
+
format: o.format,
|
|
30
|
+
endpoint: o.endpoint,
|
|
31
|
+
...(o.dropped === true ? { dropped: true } : {}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const STATES = new Set(['mounted', 'memoryless', 'none']);
|
|
35
|
+
const ORIGINS = new Set(['deployment', 'request']);
|
|
36
|
+
/**
|
|
37
|
+
* `TaskResult.effectiveMemoryScopes` 的窄读 —— **按臂**验必需成员、按臂构造允许成员(core `task-result.d.ts` 四臂):
|
|
38
|
+
* · `mounted`:`contract` 必在(v2 | legacy);`scopes` 数组(坏行逐条丢);`writeScope` 串或 null;不带 reason / residue;
|
|
39
|
+
* · `memoryless`:`reason` ∈ {mount-failed, no-backend} 必在;`scopes` 必为空数组;`writeScope` 必为 null;`contract` 可选;
|
|
40
|
+
* `materializedResidue` 只在 mount-failed 臂过境(非串滤);
|
|
41
|
+
* · `none`:`reason` ∈ {no-spec, disabled} 必在;`scopes` 空、`writeScope` null;不带 contract / residue。
|
|
42
|
+
* 结构不成立 ⇒ `undefined`(整键不铸);臂外成员不过境。
|
|
43
|
+
*/
|
|
44
|
+
export function readEffectiveMemoryScopes(v) {
|
|
45
|
+
if (typeof v !== 'object' || v === null)
|
|
46
|
+
return undefined;
|
|
47
|
+
const o = v;
|
|
48
|
+
if (typeof o.state !== 'string' || !STATES.has(o.state))
|
|
49
|
+
return undefined;
|
|
50
|
+
if (!Array.isArray(o.scopes))
|
|
51
|
+
return undefined;
|
|
52
|
+
if (o.writeScope !== null && typeof o.writeScope !== 'string')
|
|
53
|
+
return undefined;
|
|
54
|
+
const contract = o.contract === 'v2' || o.contract === 'legacy' ? o.contract : undefined;
|
|
55
|
+
const reason = nonEmpty(o.reason) ? o.reason : undefined;
|
|
56
|
+
if (o.state === 'mounted') {
|
|
57
|
+
if (contract === undefined)
|
|
58
|
+
return undefined;
|
|
59
|
+
const scopes = [];
|
|
60
|
+
for (const row of o.scopes) {
|
|
61
|
+
if (typeof row !== 'object' || row === null)
|
|
62
|
+
continue;
|
|
63
|
+
const r = row;
|
|
64
|
+
if (!nonEmpty(r.scope) || typeof r.origin !== 'string' || !ORIGINS.has(r.origin))
|
|
65
|
+
continue;
|
|
66
|
+
scopes.push({ scope: r.scope, origin: r.origin });
|
|
67
|
+
}
|
|
68
|
+
return { state: 'mounted', contract, scopes, writeScope: o.writeScope };
|
|
69
|
+
}
|
|
70
|
+
if (o.scopes.length !== 0 || o.writeScope !== null)
|
|
71
|
+
return undefined;
|
|
72
|
+
if (o.state === 'memoryless') {
|
|
73
|
+
if (reason !== 'mount-failed' && reason !== 'no-backend')
|
|
74
|
+
return undefined;
|
|
75
|
+
const residue = reason === 'mount-failed' && Array.isArray(o.materializedResidue) ? o.materializedResidue.filter(nonEmpty) : undefined;
|
|
76
|
+
return {
|
|
77
|
+
state: 'memoryless',
|
|
78
|
+
reason,
|
|
79
|
+
...(contract !== undefined ? { contract } : {}),
|
|
80
|
+
scopes: [],
|
|
81
|
+
writeScope: null,
|
|
82
|
+
...(residue !== undefined ? { materializedResidue: residue } : {}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (reason !== 'no-spec' && reason !== 'disabled')
|
|
86
|
+
return undefined;
|
|
87
|
+
return { state: 'none', reason, scopes: [], writeScope: null };
|
|
88
|
+
}
|
|
@@ -251,6 +251,22 @@ export declare const RESUME_PLACEMENT_MISMATCH = "resume.placement_mismatch";
|
|
|
251
251
|
* 不属内容批射程;本条按现状登记,换形另立一批。本位是**新铸**的,所以在出生那天就用对形。
|
|
252
252
|
*/
|
|
253
253
|
export declare const RESUME_RETRY_LATER_CODES: readonly string[];
|
|
254
|
+
/**
|
|
255
|
+
* core runtask 在返回这三码的 failed 之前已经 `store.reopen` 了那张 checkpoint ⇒ **卡仍 pending、行重新 park、
|
|
256
|
+
* `/decide` 报 retriable:true**:它们是「再 park」不是终局。下游处置三码逐字同款(重取待批列表、在原工具在场的
|
|
257
|
+
* 部署上重决);族的判别力只在 `errorCode`,server 刻意不给它们各自的 HTTP 状态。
|
|
258
|
+
* · `resume.env_failed` —— 执行环境没起来;
|
|
259
|
+
* · `resume.tool_unavailable` —— 批过的那只工具在这条腿上**不在**;
|
|
260
|
+
* · `resume.tool_contract_mismatch`(core 7.8.0 F2)—— 工具还在,但 contractId / shapeDigest / implementationRevision
|
|
261
|
+
* 任一不同 = 顶着同名的替身。
|
|
262
|
+
* 🔴 sdk d.ts 未建模这三码(只在 core `checkpoint-store.d.ts` / `tool-roster.d.ts` 注释里点名),字面以 server
|
|
263
|
+
* resume-legs.ts 实装为锚;与 {@link RESUME_RETRY_LATER_CODES}(能不能等)/ `RESUME_REFUSAL_CODES`(该对人说什么)
|
|
264
|
+
* **两两不交** —— 三种处置三张表。`checkpoint.reopen_failed`(reopen 本身失败 = 终局)刻意不在本族。
|
|
265
|
+
*/
|
|
266
|
+
export declare const RESUME_ENV_FAILED = "resume.env_failed";
|
|
267
|
+
export declare const RESUME_TOOL_UNAVAILABLE = "resume.tool_unavailable";
|
|
268
|
+
export declare const RESUME_TOOL_CONTRACT_MISMATCH = "resume.tool_contract_mismatch";
|
|
269
|
+
export declare const RESUME_REOPEN_CODES: readonly string[];
|
|
254
270
|
/**
|
|
255
271
|
* `decide.workflow_host_unknown`(409;sdk README §9.0.0 逐字:「run 上没有发起会话锚 ⇒ 无处投递,
|
|
256
272
|
* **无重试价值**」)。
|
package/dist/engineErrorCodes.js
CHANGED
|
@@ -338,6 +338,27 @@ export const RESUME_RETRY_LATER_CODES = Object.freeze([
|
|
|
338
338
|
RESUME_USAGE_WINDOW_EXHAUSTED,
|
|
339
339
|
RESUME_PREFLIGHT_REJECTED,
|
|
340
340
|
]);
|
|
341
|
+
// ── resume **reopen 族**(CC-06 / B-081,0.71.3;server `http/resume-legs.ts` isCheckpointReopenedFailure 同表)──
|
|
342
|
+
/**
|
|
343
|
+
* core runtask 在返回这三码的 failed 之前已经 `store.reopen` 了那张 checkpoint ⇒ **卡仍 pending、行重新 park、
|
|
344
|
+
* `/decide` 报 retriable:true**:它们是「再 park」不是终局。下游处置三码逐字同款(重取待批列表、在原工具在场的
|
|
345
|
+
* 部署上重决);族的判别力只在 `errorCode`,server 刻意不给它们各自的 HTTP 状态。
|
|
346
|
+
* · `resume.env_failed` —— 执行环境没起来;
|
|
347
|
+
* · `resume.tool_unavailable` —— 批过的那只工具在这条腿上**不在**;
|
|
348
|
+
* · `resume.tool_contract_mismatch`(core 7.8.0 F2)—— 工具还在,但 contractId / shapeDigest / implementationRevision
|
|
349
|
+
* 任一不同 = 顶着同名的替身。
|
|
350
|
+
* 🔴 sdk d.ts 未建模这三码(只在 core `checkpoint-store.d.ts` / `tool-roster.d.ts` 注释里点名),字面以 server
|
|
351
|
+
* resume-legs.ts 实装为锚;与 {@link RESUME_RETRY_LATER_CODES}(能不能等)/ `RESUME_REFUSAL_CODES`(该对人说什么)
|
|
352
|
+
* **两两不交** —— 三种处置三张表。`checkpoint.reopen_failed`(reopen 本身失败 = 终局)刻意不在本族。
|
|
353
|
+
*/
|
|
354
|
+
export const RESUME_ENV_FAILED = 'resume.env_failed';
|
|
355
|
+
export const RESUME_TOOL_UNAVAILABLE = 'resume.tool_unavailable';
|
|
356
|
+
export const RESUME_TOOL_CONTRACT_MISMATCH = 'resume.tool_contract_mismatch';
|
|
357
|
+
export const RESUME_REOPEN_CODES = Object.freeze([
|
|
358
|
+
RESUME_ENV_FAILED,
|
|
359
|
+
RESUME_TOOL_UNAVAILABLE,
|
|
360
|
+
RESUME_TOOL_CONTRACT_MISMATCH,
|
|
361
|
+
]);
|
|
341
362
|
// ── `/decide` workflow 车道拒绝族(B-070 / L-200;sdk README §9.0.0,server ≥7.69.0)──────────
|
|
342
363
|
//
|
|
343
364
|
// 背景一句话:`/decide` 7.69.0 起长出**第三条车道** —— 停在耐久审批门上的那一只 checkpoint 属于一个
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
/** 一条通告是**说给谁听**的。两值,刻意不设第三值(见模块顶注)。 */
|
|
55
55
|
export type NoticeAudience = 'user' | 'operator';
|
|
56
56
|
/**
|
|
57
|
-
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.20.
|
|
57
|
+
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.20.1 = 六十五码**(7.20.0 六十四 + 7.20.1 一枚 `config.write_protection_target_view_absent`;7.19.0 五十九 + 7.20.0 五枚:`config.task_root_not_canonical` / `config.execution_env_capability_invalid` / `config.forward_sink_failed` / `memory.restore_withheld` / `agents.listing_truncated`,均 operator);顺序同源)。
|
|
58
58
|
* 🔴 这是一份**抄件**,不是本包的意见 —— 改它必须同 commit 附 core 坐标,且门会先红。
|
|
59
59
|
* ⚠️ `EngineNotice.code` 的型面在上游**故意留 `string`**(宿主把自己的通告转发进同一个水槽是
|
|
60
60
|
* 被支持的形),所以本表是**判据**不是型 —— 别拿它去窄化那个字段。
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
* 出现在本包源码或产物里 => 当场红。
|
|
53
53
|
*/
|
|
54
54
|
/**
|
|
55
|
-
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.20.
|
|
55
|
+
* 引擎**成文码册**的逐字镜像(core `ENGINE_NOTICE_CODES`,**7.20.1 = 六十五码**(7.20.0 六十四 + 7.20.1 一枚 `config.write_protection_target_view_absent`;7.19.0 五十九 + 7.20.0 五枚:`config.task_root_not_canonical` / `config.execution_env_capability_invalid` / `config.forward_sink_failed` / `memory.restore_withheld` / `agents.listing_truncated`,均 operator);顺序同源)。
|
|
56
56
|
* 🔴 这是一份**抄件**,不是本包的意见 —— 改它必须同 commit 附 core 坐标,且门会先红。
|
|
57
57
|
* ⚠️ `EngineNotice.code` 的型面在上游**故意留 `string`**(宿主把自己的通告转发进同一个水槽是
|
|
58
58
|
* 被支持的形),所以本表是**判据**不是型 —— 别拿它去窄化那个字段。
|
|
@@ -78,6 +78,8 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
|
|
|
78
78
|
'config.artifact_host_invalid',
|
|
79
79
|
// core 7.20.0(0.71.0 提货):任务根非规范路径 / 远端执行环境能力声明坏值,两枚部署面通告;顺序同源(紧跟 artifact_host_invalid)。
|
|
80
80
|
'config.task_root_not_canonical',
|
|
81
|
+
// core 7.20.1(0.71.4 提货,#853 C-R55):写保护判官只判拼写(spelling-only)又挂了受保护写工具 ⇒ 每 run 一条;顺序同源(紧跟 task_root_not_canonical)。
|
|
82
|
+
'config.write_protection_target_view_absent',
|
|
81
83
|
'config.execution_env_capability_invalid',
|
|
82
84
|
'config.tool_card_undeclared',
|
|
83
85
|
'config.tool_face_undeclared',
|
|
@@ -167,6 +169,7 @@ export const ENGINE_NOTICE_AUDIENCE = Object.freeze({
|
|
|
167
169
|
// 0.68.0 提货批:`NOTICE_AUDIENCE_TABLE:181` 真字节 —— 一条「宿主把 artifact 席接坏了」的部署事实。
|
|
168
170
|
'config.artifact_host_invalid': 'operator',
|
|
169
171
|
'config.task_root_not_canonical': 'operator',
|
|
172
|
+
'config.write_protection_target_view_absent': 'operator',
|
|
170
173
|
'config.execution_env_capability_invalid': 'operator',
|
|
171
174
|
'config.tool_card_undeclared': 'operator',
|
|
172
175
|
'config.tool_face_undeclared': 'operator',
|
package/dist/index.d.ts
CHANGED
|
@@ -157,6 +157,7 @@ export * from './writeProtectionCapability.js';
|
|
|
157
157
|
export * from './runTerminal.js';
|
|
158
158
|
export * from './readFacePosture.js';
|
|
159
159
|
export * from './mcpPanel.js';
|
|
160
|
+
export * from './effectiveFacts.js';
|
|
160
161
|
export * from './gateOutcome.js';
|
|
161
162
|
export * from './postureKnob.js';
|
|
162
163
|
export * from './engineIdentity.js';
|
package/dist/index.js
CHANGED
|
@@ -193,6 +193,7 @@ export * from './runTerminal.js';
|
|
|
193
193
|
export * from './readFacePosture.js';
|
|
194
194
|
// CC-03(0.68.2):`GET /v1/sessions/:id/mcp` 面板体的防御读视图 + lastLegMcp 一行措辞铸点(三端共用)。
|
|
195
195
|
export * from './mcpPanel.js';
|
|
196
|
+
export * from './effectiveFacts.js';
|
|
196
197
|
export * from './gateOutcome.js';
|
|
197
198
|
// 0.63.0(sdk 8.8.0 / engine ≥7.67.0 / S-178):`serverGates` 三根 posture 旋钮的读数窄读器
|
|
198
199
|
// (值 + 谁定的 + 指路句)。四词来源表在本包只有这一份,`readFacePosture` 与它共用。
|
|
@@ -31,6 +31,8 @@ export interface LiveModelInfo {
|
|
|
31
31
|
provider?: string;
|
|
32
32
|
reasoning?: boolean;
|
|
33
33
|
vision?: boolean;
|
|
34
|
+
/** sdk `ModelInfo.routePairing`(#345,server ≥7.45 恒在场;真开集):这一行的 key↔URL 配对姿态;读法用 {@link routePairingVerdict}。 */
|
|
35
|
+
routePairing?: string;
|
|
34
36
|
[k: string]: unknown;
|
|
35
37
|
}
|
|
36
38
|
/** The `GET /v1/models` envelope: the catalog rows + the deployment default model id (display-only). */
|
|
@@ -60,3 +62,15 @@ export declare function normalizeLiveModelRef(ref: string): string;
|
|
|
60
62
|
/** 件4(S2 回显):目录 default 的用户名 —— name(池 entry id)优先,id 兜底;null=无目录
|
|
61
63
|
* (mock 路径,调用方回落 CC 字面护 parity)。 */
|
|
62
64
|
export declare function liveDefaultModelName(): string | null;
|
|
65
|
+
/** {@link routePairingVerdict} 的读数:`ok` / `broken` / `unknown` 三态 + 原样姿态词(缺席 / 非串时无 posture)。 */
|
|
66
|
+
export interface RoutePairingVerdict {
|
|
67
|
+
verdict: 'ok' | 'broken' | 'unknown';
|
|
68
|
+
posture?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* CC-06 / B-081(0.71.3):`ModelInfo.routePairing` 的读口 —— 只对 sdk 头注列出的**七词**给 verdict:四个 `ok:*` ⇒ ok
|
|
72
|
+
* (凭据路说得通)/ 两个 `broken:*` ⇒ broken(真请求会被引擎拒:标红,给这只模型配 per-model 凭据或挪到部署根上)/
|
|
73
|
+
* 其余一律 unknown(`unknown` 本身、未知词、缺席、非串、空串)—— 真开集下按前缀猜好坏 = 给一个契约没支持的词发正常 /
|
|
74
|
+
* 故障提示(异源复审实抓);`posture` 原样带给端渲「未知(<词>)」。
|
|
75
|
+
*/
|
|
76
|
+
export declare function routePairingVerdict(v: unknown): RoutePairingVerdict;
|
package/dist/liveModelCatalog.js
CHANGED
|
@@ -77,3 +77,21 @@ export function liveDefaultModelName() {
|
|
|
77
77
|
return null;
|
|
78
78
|
return normalizeLiveModelRef(catalog.default);
|
|
79
79
|
}
|
|
80
|
+
/** sdk `RoutePairingStatus` 已知七词(9.6.0 `types.d.ts`);头注逐字「switch 认上面七词,再留一条 default 臂当未知」。 */
|
|
81
|
+
const ROUTE_PAIRING_OK = new Set(['ok:per-model', 'ok:paired', 'ok:unpinned', 'ok:keyless']);
|
|
82
|
+
const ROUTE_PAIRING_BROKEN = new Set(['broken:credential_mismatch', 'broken:credential_missing']);
|
|
83
|
+
/**
|
|
84
|
+
* CC-06 / B-081(0.71.3):`ModelInfo.routePairing` 的读口 —— 只对 sdk 头注列出的**七词**给 verdict:四个 `ok:*` ⇒ ok
|
|
85
|
+
* (凭据路说得通)/ 两个 `broken:*` ⇒ broken(真请求会被引擎拒:标红,给这只模型配 per-model 凭据或挪到部署根上)/
|
|
86
|
+
* 其余一律 unknown(`unknown` 本身、未知词、缺席、非串、空串)—— 真开集下按前缀猜好坏 = 给一个契约没支持的词发正常 /
|
|
87
|
+
* 故障提示(异源复审实抓);`posture` 原样带给端渲「未知(<词>)」。
|
|
88
|
+
*/
|
|
89
|
+
export function routePairingVerdict(v) {
|
|
90
|
+
if (typeof v !== 'string' || v.length === 0)
|
|
91
|
+
return { verdict: 'unknown' };
|
|
92
|
+
if (ROUTE_PAIRING_OK.has(v))
|
|
93
|
+
return { verdict: 'ok', posture: v };
|
|
94
|
+
if (ROUTE_PAIRING_BROKEN.has(v))
|
|
95
|
+
return { verdict: 'broken', posture: v };
|
|
96
|
+
return { verdict: 'unknown', posture: v };
|
|
97
|
+
}
|
|
@@ -64,3 +64,22 @@ export declare function resumeRefusalFromError(err: unknown): ResumeRefusalDetai
|
|
|
64
64
|
* ([honest-absence-not-fabricated-zero])。
|
|
65
65
|
*/
|
|
66
66
|
export declare function resumeRefusalContent(detail: ResumeRefusalDetail): string;
|
|
67
|
+
/** reopen 族的结构化读数:`reason` = 码去掉 `resume.` 前缀(端按它分臂渲原因);`retriable` 恒 true(族的定义)。 */
|
|
68
|
+
export interface ResumeReopenDetail {
|
|
69
|
+
code: string;
|
|
70
|
+
reason: 'env_failed' | 'tool_unavailable' | 'tool_contract_mismatch';
|
|
71
|
+
retriable: true;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 只认 `errorCode`(退役 `code` 槽不做兼容,[2055] 死键纪律);同族别码 / 非对象 ⇒ null。
|
|
75
|
+
* 🔴 **还必须 `retriable === true`**(异源复审实抓):server 只在 store **复核**过 checkpoint 真重开之后才铸
|
|
76
|
+
* `retriable: true`(resume-legs.ts `checkpointReopened`,头注逐字「never inferred from the code alone」);同一个码也可能
|
|
77
|
+
* 出现在 reopen 本身失败、checkpoint 已 resolved 的终局失败上(那时没有 `retriable`)。凭码就说「卡仍 pending、决定没被消费」
|
|
78
|
+
* = 替 server 编一句安全声明。⇒ 缺席 / false ⇒ null(端走通用拒绝面,不渲再 park 文案)。
|
|
79
|
+
*/
|
|
80
|
+
export declare function resumeReopenFromError(err: unknown): ResumeReopenDetail | null;
|
|
81
|
+
/**
|
|
82
|
+
* 三句 ` · ` 分段(与 quota / scenario / refusal 三个兄弟同形):原因 / 安全声明 / 出路。
|
|
83
|
+
* 🔴 零内部车道词(DS-04):只说用户能做的事;不复述 server 的 message(那一行已在屏上)。
|
|
84
|
+
*/
|
|
85
|
+
export declare function resumeReopenContent(detail: ResumeReopenDetail): string;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
* 🔴 文案里**不铸等待的秒数**:那一行由端用 {@link ResumeRefusalDetail.retryAfterSec} 单独渲
|
|
39
39
|
* (cli 的 `retryAfterHint` 是那一位的唯一取值口),在这里再说一遍就是同一个数字上屏两遍。
|
|
40
40
|
*/
|
|
41
|
-
import { RESUME_PLACEMENT_MISMATCH, RESUME_PREFLIGHT_REJECTED, } from './engineErrorCodes.js';
|
|
41
|
+
import { RESUME_PLACEMENT_MISMATCH, RESUME_PREFLIGHT_REJECTED, RESUME_REOPEN_CODES, RESUME_ENV_FAILED, RESUME_TOOL_UNAVAILABLE, } from './engineErrorCodes.js';
|
|
42
42
|
import { resumeRetryLaterFromError } from './wireErrorTriage.js';
|
|
43
43
|
/**
|
|
44
44
|
* 本模块认识的 resume 拒绝码(**闭集**)—— 「有人话可补」的那两个。
|
|
@@ -123,3 +123,37 @@ export function resumeRefusalContent(detail) {
|
|
|
123
123
|
'The engine supplied no wait, so this refusal does not say whether the token stays redeemable');
|
|
124
124
|
return parts.join(' · ');
|
|
125
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* 只认 `errorCode`(退役 `code` 槽不做兼容,[2055] 死键纪律);同族别码 / 非对象 ⇒ null。
|
|
128
|
+
* 🔴 **还必须 `retriable === true`**(异源复审实抓):server 只在 store **复核**过 checkpoint 真重开之后才铸
|
|
129
|
+
* `retriable: true`(resume-legs.ts `checkpointReopened`,头注逐字「never inferred from the code alone」);同一个码也可能
|
|
130
|
+
* 出现在 reopen 本身失败、checkpoint 已 resolved 的终局失败上(那时没有 `retriable`)。凭码就说「卡仍 pending、决定没被消费」
|
|
131
|
+
* = 替 server 编一句安全声明。⇒ 缺席 / false ⇒ null(端走通用拒绝面,不渲再 park 文案)。
|
|
132
|
+
*/
|
|
133
|
+
export function resumeReopenFromError(err) {
|
|
134
|
+
if (typeof err !== 'object' || err === null)
|
|
135
|
+
return null;
|
|
136
|
+
const code = err.errorCode;
|
|
137
|
+
if (typeof code !== 'string' || !RESUME_REOPEN_CODES.includes(code))
|
|
138
|
+
return null;
|
|
139
|
+
if (err.retriable !== true)
|
|
140
|
+
return null;
|
|
141
|
+
const reason = code.slice('resume.'.length);
|
|
142
|
+
return { code, reason, retriable: true };
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 三句 ` · ` 分段(与 quota / scenario / refusal 三个兄弟同形):原因 / 安全声明 / 出路。
|
|
146
|
+
* 🔴 零内部车道词(DS-04):只说用户能做的事;不复述 server 的 message(那一行已在屏上)。
|
|
147
|
+
*/
|
|
148
|
+
export function resumeReopenContent(detail) {
|
|
149
|
+
const first = detail.code === RESUME_ENV_FAILED
|
|
150
|
+
? 'The execution environment for this parked work could not be brought back'
|
|
151
|
+
: detail.code === RESUME_TOOL_UNAVAILABLE
|
|
152
|
+
? 'The tool this approval was granted for is not available on this engine'
|
|
153
|
+
: 'The tool this approval was granted for has changed since the approval was recorded';
|
|
154
|
+
return [
|
|
155
|
+
first,
|
|
156
|
+
'The engine re-parked the work before consuming anything — the approval is still pending and your decision was not consumed',
|
|
157
|
+
'Re-fetch the pending approvals and decide again on an engine where the same tool is available',
|
|
158
|
+
].join(' · ');
|
|
159
|
+
}
|
package/dist/seam.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { ModelUsage, SDKMessage } from '@sema-agent/agent-types';
|
|
10
10
|
import type { EngineTurnUsage } from './adapter/downstream/turnUsageToModelUsage.js';
|
|
11
11
|
import type { RunCostReconcile } from './adapter/downstream/terminalToSdkResult.js';
|
|
12
|
-
import type { WiringManifestAutoMode, WiringManifestModelGate, WiringManifestMcpEntryView, WiringManifestHookEntryView, WiringManifestLspSeamView, ContextUsageSectionView } from './adapter/downstream/eventToSdkMessage.js';
|
|
12
|
+
import type { WiringManifestAutoMode, WiringManifestModelGate, WiringManifestMcpEntryView, WiringManifestHookEntryView, WiringManifestLspSeamView, WiringManifestWriteProtectionView, ContextUsageSectionView } from './adapter/downstream/eventToSdkMessage.js';
|
|
13
13
|
import type { ToolRosterView, ToolRosterDeltaView } from './toolRoster.js';
|
|
14
14
|
/**
|
|
15
15
|
* `AbortSignal` 的结构型(B3 扩容,SEAM-GAP-4)。
|
|
@@ -593,6 +593,8 @@ export interface WiringManifestChromeEvent {
|
|
|
593
593
|
hooks?: readonly WiringManifestHookEntryView[];
|
|
594
594
|
/** CC-08 ①:第六段 —— LSP 接缝(在场 iff 解析出了 manager 席;`mounted` 与 `lane` 禁合读)。 */
|
|
595
595
|
lsp?: WiringManifestLspSeamView;
|
|
596
|
+
/** core 7.20.1(0.71.4):第七段 —— 写保护判官自报 targetView(present-iff 编译出判官;🔴 缺席 = 第三态,不折 spelling-only)。 */
|
|
597
|
+
writeProtection?: WiringManifestWriteProtectionView;
|
|
596
598
|
/** core 铸的事件身份(uuidv7 形);wire 未必带 ⇒ 缺席时本键不在场。 */
|
|
597
599
|
eventId?: string;
|
|
598
600
|
}
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
|
|
20
20
|
| 项 | 值 | 真源 |
|
|
21
21
|
|---|---|---|
|
|
22
|
-
| 本包 | `@sema-agent/client-core` **0.71.
|
|
22
|
+
| 本包 | `@sema-agent/client-core` **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
|
+
| 公开导出面 | **995** 个运行期符号(+ 44 个测试钩;= 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`/`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`/`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.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
|
|
|
@@ -69,6 +69,16 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
69
69
|
|
|
70
70
|
---
|
|
71
71
|
|
|
72
|
+
### 0c. 已发版本索引(无独立 § 段的补丁版;冻结账门 ⑧b 要求每个已发版本在本档有落点)
|
|
73
|
+
|
|
74
|
+
| 版本 | 性质 | 读哪里 |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| 0.30.1 / 0.30.2 / 0.30.5 / 0.30.6 / 0.30.7 | 0.30.x 补丁串(2026-08-15 前后;零新公面) | CHANGELOG 各段;接入面随 §17–§19 |
|
|
77
|
+
| 0.33.0 | 2026-08-17 小版本(接入面并入当期 § 段) | CHANGELOG `## 0.33.0` |
|
|
78
|
+
| 0.38.1 | 2026-08-21 补丁 | CHANGELOG `## 0.38.1` |
|
|
79
|
+
| 0.59.1 / 0.59.2 | 2026-09-06 补丁(B-005 修根;零新公面、零型面变更) | CHANGELOG `## 0.59.1` / `## 0.59.2` |
|
|
80
|
+
| 0.64.1 | 2026-09-09 补丁 | CHANGELOG `## 0.64.1` |
|
|
81
|
+
|
|
72
82
|
## §1 消费拓扑
|
|
73
83
|
|
|
74
84
|
```
|
|
@@ -111,7 +121,7 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
111
121
|
|
|
112
122
|
## §2 公共导出面地图(按域)
|
|
113
123
|
|
|
114
|
-
> 全集真源 = `scripts/public-export-baseline.json` 的 `names`(**
|
|
124
|
+
> 全集真源 = `scripts/public-export-baseline.json` 的 `names`(**995** 项)。
|
|
115
125
|
> 本节**不逐名抄**,只给「域 → 承重导出 → 用途 → 实现锚」。承重导出 = 一个端为了让这个域干活
|
|
116
126
|
> **必须**直接调到的那几个符号;其余是它们的类型、变体与辅助位。
|
|
117
127
|
> 单一入口:`import { … } from '@sema-agent/client-core'`(`exports` 只有 `.` 一个;
|
|
@@ -135,7 +145,7 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
135
145
|
`WorkflowsGateUnknownDenial` 四形**不在**基线里,`src/selfOrchestrationDenial.ts` 对基线贡献
|
|
136
146
|
**4** 项运行期导出(三个函数 + `SELF_ORCHESTRATION_RETRY_WITHOUT`)。
|
|
137
147
|
|
|
138
|
-
|
|
148
|
+
995 项的内部构成(帮助端估读表大小;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):**301** 项是 `SCREAMING_SNAKE` 常量数据表/词汇表
|
|
139
149
|
(矩阵、键集、env 名、锚串)而非可调用物;**6** 项是 PascalCase 运行期值
|
|
140
150
|
(`ControlRouter` / `ControlSafetyError` / `HitlBridge` / `HitlSafetyError` / `DecideTransportRetryExhaustedError`);
|
|
141
151
|
**41** 项是 `*For(sessionKey, …)` 的 per-session 变体(§6;其中 `engineNamespaceKeyFor` 是命名巧合 —— 参数是 baseUrl 不是 sessionKey,见域 14)。
|
|
@@ -144,7 +154,7 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
144
154
|
|
|
145
155
|
| # | 域 | 名数 | 承重导出 | 用途 | 实现锚 |
|
|
146
156
|
|---|---|---|---|---|---|
|
|
147
|
-
| 1 | **适配内核(下行主链)** |
|
|
157
|
+
| 1 | **适配内核(下行主链)** | 57 | `readEffectiveReasoning` · `readEffectiveMemoryScopes`(0.71.3 CC-06:终帧 `_sema_effective_reasoning` / `_sema_effective_memory_scopes` 的窄读器,§45)· `isSubFlowSegmentEnd` · `SEGMENT_END_IDENTITY_KEYS` · `droppedWhySentence`(0.69.2 CC-13:三件出公面,§38)· `adapt` · `createWireToCcAdapter` · `runStream` · `eventToSdkMessage` · `terminalToSdkResult` · `SEMA_SEGMENT_ID_KEY`(0.68.2 CC-01:committed assistant 文本行顶层段身份键的唯一字面量出处,壳只读)· `projectMcpSection`(0.68.2 CC-03:`wiring_manifest.mcp[]` 与 `/mcp` 面板 `lastLegMcp.mcp[]` 共用的同一只条目读器)· `readRunCostFacts`(0.66.0:终局成本事实的**唯一读器** —— `TaskStats.costBreakdown` / `nested` 逐键窄读 + 对账三段(own/nested/compaction)与两个「没定价」判别位;终帧的两个超集键与 chrome 臂 `run_cost_reconciled` **共用它**,两面不会各算各的,详见 §31c)· `TERMINAL_CAUSE_KINDS`/`isTerminalCauseKind`(0.68.0 / L-247:**core 终局因由**闭集,四词 `completed|failed|blocked|paused`)· `RUN_TERMINAL_NOT_SUCCESS_STATUSES`/`isTerminalNotSuccess`/`RUN_TERMINAL_STATUSES`/`isTerminalStatus`(L-215② 终局词汇的**单铸谓词**,0.68.0 随 L-247 **两表分源**更名 —— `killed` 属 server run 行状态面、`paused` 属 core 因由面,合成一张会让两边加词时都读不出该改哪儿;`blocked` 是 agent 自报终态,`suspended`/`needs_review` 刻意不在表里,详见 §33b / §30j)· `SEMA_SUBAGENT_USAGE_PARTIAL_KEY`/`subagentUsageIsPartial`(0.68.0 / L-244:子代用量下界位的**自有名**与唯一判据,与终帧 `_sema_usage_lower_bound` 分名,详见 §33g) · `turnUsageToModelUsage` · `isRunStreamActive` · `ADAPTER_DIVERGENCES` · `readRunTerminal` / `runTerminalCode` / `runTerminalGateKind` / `runTerminalGateToolName` / `isReviewPark` / `REVIEW_PARK_GATE_KINDS`(0.60.0 / engine ≥7.64.0:一次 run **怎么结束的**唯一读器 —— 终局从八个平面键换成一条带标因由 `terminal`,四臂 + `unknown` 防御臂 + `plane` 两代字节标;🔴 不认识的终态词绝不折成成功、本包不提供「因由→五词 status」的兼容投影,详见 §24b)| 引擎 SSE `AgentEvent` → 端要渲的**双面输出**:transcript(`SDKMessage`)+ chrome(瞬态 `ChromeEvent`)。**本包存在的理由** | `src/adapt.ts`、`src/adapt/{arms,wireShapes,panelTasks}.ts`(经 `adapt.ts` 再导出)、`src/adapter/runStream.ts`、`src/adapter/downstream/*`、`src/adapter/types.ts`、`src/runTerminal.ts` |
|
|
148
158
|
| 2 | **seam 公共契约** | 2(其余为 type-only) | `CHROME_ARMS` · `deriveTranscriptId` | 公共词汇 + **id 确定性不变量**(同一条流重放 ⇒ 同一串 id)。`CHROME_ARMS` = 端「我要消费哪些 chrome 臂」的对照清单 | `src/seam.ts` |
|
|
149
159
|
| 3 | **HITL 决断卡链**(§4/§5 主战场) | 167 | `makeHitlCanUseTool` · `HitlBridge` · `findPendingForTask` · `readDecideReceipt`/`decideAcceptedNotResolved`/`decideRefusalFromError`(B-070:`/decide` 200 = **投递受理**不是「门已解决」;`executionOutcome` 缺席 = 未知,详见 §30h) · `HitlSafetyError` · `bridgeAskUserQuestionGates` · `surfaceToolApprovalFrameAndRespond` / `surfaceFsApprovalAndDecide` · `readToolApprovalRespondAck` · `installApprovalCardPort(For)` · `installHitlHostSurface(For)` · `armPlanReviewApproval` · `reopenPlanReviewCard` · `decidePlanReview` · `startApprovalsFeed` · `pendingRowIsOwnedByThisSession` · `approvalCallKey`/`liveFrameCallKey`/`planReviewQuestionId` · `registerArmedGateFor`/`wasGateArmedFor`/`clearArmedGateFor` · `waitForGateArmed(For)`/`onGateArmed(For)`/`gateArmedWaitMs`(#244 F1 呈现回执事件源) · `planReviewArmedKey(For)`/`notePlanReviewAnswered(For)`/`notePlanReviewAnsweredIfDecisive(For)`(A-024.4 plan 呈现分代) · `toolEndOutputText` · `isAskTool` · `waitForParkRowBirth` · `classifyAskParkRows` / `askParkRowArm` / `classifyAskParkChainFailure` · `readDecisionNoteAudit` / `decisionNoteAuditLine` · `resumeRunningOptions` / `resumeChoiceFromLabels` · `persistedRulesLaneAvailable`/`persistedRulesGovernanceAvailable` · `classifyRulesFailure` · `listAllPersistedRules` · `classifySkippedReason` · `readRulePersistOutcome`(#244 F2:persist-ack 读口与 `readToolApprovalRespondAck` 合成一处) · `parseLocalAllowRule`(durable 腿本地落规则窄化骨架,谓词经 `LocalAllowRuleDeps` 注入) · `readToolApprovalRespondRefusal`(#225 件5,0.42.0:respond 抛错的结构化原文读口 —— 三位各自防御读、各自缺席不铸、**三位皆缺席时整只返 `undefined`**;原样交还零加工,UNTRUSTED-for-display)· `installEditedRuleTextPrechecker` / `hasEditedRuleTextPrechecker` / `precheckEditedRuleText`([5076] 转出口,0.42.0:core 5.57.0 `precheckEditedRuleText` 的**端口注入形** —— 类型面 + 注入口 + 诚实缺席读口。🔴 **不是** value 级 re-export,理由见 §7 缺口 **P-34**;未装 ⇒ 返 `undefined`,绝不编一个 `{ok:true}`)· `surfaceRuleArmNotSent` / `RULE_NOT_SENT_WARN_TEXT` + `surfaceRuleArmRejected` / `RULE_NOT_SENT_REJECTED_WARN_TEXT`(#334,0.43.0:人在卡上按下的「不再询问」被整条丢弃时的诚实告知——**两条刻意分开**:前者=**引擎能力位未确认**(换台引擎/等探测就好),后者=**这次选择没过包内表核/互斥核**(表外文本/坏下标/两臂同场,换引擎也不会变) —— 编辑臂 `respondFreeFormRules` 与批臂 `respondBatchRuleOffers` 两条同形存量共用一条,与 `surfaceRememberNotApplied` 同族纪律:决断照送、只是规则没存,静默丢掉用户明确意图 = 让人以为功能坏了)· `projectCrashConverged`(L-38,0.49.0:`/v1/approvals` additive 键 `crashConverged` 的分桶投影 —— 崩溃收敛的孤儿审批读面,**缺席 ≠ 空数组**、分桶恰一个合取、坏行丢弃并计数,详见 §12;同批把 `ApprovalsResourceLike.list()` 的返回位 additive 放宽成 `ApprovalsListEnvelope`,老形 `{pending}` 仍可赋值)· `readRuleOffers` / `readRuleOfferSupply`(L-103/[C228],0.57.0 additive 导出:「不再询问」候选两代 wire 键的窄读器**公面化** —— 此前只经卡端口出包,不走卡端口架构的宿主只能自己重铸一把,而它承载的是兑付安全判据(原始下标不前移/逐条丢坏/闭集 kind/两代取舍序),详见 §20)· `RULE_OFFERS_ABSENCE_REASONS` / `DENIAL_LIMIT_KINDS`(0.59.0 / sdk 8.3.0 提货:`ruleOffersAbsence` 三词与 `denialLimitFallback.limit` 二词的**运行期**闭词表再导出 —— 与 0.58.0 那三张同一条纪律:端拿它做判定别再手抄字面量。⚠️ **本包自己不拿这两张表做窄读判定**(两处都按开集透传,词表属主是 core、server 已按闭集拒过),再导出只是给端的 `switch` 一份可数的表,端仍必须带 `default` 臂,详见 §23a)· `DecideTransportRetryExhaustedError`(Inkglow-1085 P0a:decide 出站瞬断重试耗尽的 typed 判别 —— HitlBridge 内建单次退避重试,耗尽走重呈臂不判死 turn;端一般只消费行为,不需要 instanceof) · `gateOutcomeOf` / `isDeniedGate` / `gateDeniedBy` / `gateApprover` / `isApprovalWindowExpiredGate` / `isDenialLimitAutoDeniedGate` / `isParkSlaExpiredGate` / `isHumanSettledGate`(0.60.0 / engine ≥7.64.0:`tool_end.gate` 整条门记录的窄读器 + 判定谓词 —— 取代退役的四个正交词 `settledBy`/`resolution`/`autoDenied`/`approver`。🔴 **判定归包**:「是不是审批窗自己走完的拒绝」旧形上是端各自拼的两键合取,而三条窗词现在分得开、合并读回去等于把刚修好的判别力扔掉;⚠️ 公面型一律带 `View` 后缀 —— 本文件的 `GateOutcome`(决断腿结局)与 sdk 的 `GateOutcome`(引擎门记录)**同名不同义**,详见 §24c)· `isGateParkedToolEnd`(「这次调用没在这里结算」的**第二形**谓词:gate 缺席 + `errorCode:"gate.parked"`;端判这件事必须与 `isApprovalWindowExpiredGate` **两形合读**) · `readWireErrorCode`(B-037 候包件②:decide/取件失败上引擎 wire 机器码的单源读口,结构视图读不 `instanceof`;与本包铸的 `code` 是两个命名空间,详见 §24g)| suspended→decide→resume 环。🔴 **D-1 两元组 verbatim 回显**是字节级断言的安全不变量,端**不许重实现它的任何一段**。🔴 键空间边界(web [C1] d3 拦截):`gateIdentity` 四常量两函数只覆盖 HITL questionId/callKey 空间;seat 的 `TOOL_PERMISSION_REQUEST_ID_DOMAINS`(`plan:` 等)是另一键空间,**两者绝不合并**(合并=座位校验器静默拒全部 plan-review 卡) | `src/hitl/hitlBridge.ts`、`toolApprovalWire.ts`、`askGateWire.ts`、`planReviewWire.ts`、`hitlHostSurface.ts`、`gateIdentity.ts`、`armedGateRegistry.ts`、`parkOwnership.ts`、`parkResolver.ts`、`approvalsFeed.ts`、`frameRouter.ts`(**只挑名导出** `toolEndOutputText`/`ENGINE_ABORT_TOOL_RESULT`/`isAskTool`/`HITL_REJECT_MESSAGE`/`HITL_INTERRUPT_MESSAGE_FOR_TOOL_USE`)、`parkRowBirthWait.ts`、`approvalDecisionNoteAudit.ts`、`askParkRowRouting.ts`、`resumeRunningCard.ts`(#265 上收的判定层)、`persistedRulesWire.ts`、`localAllowRule.ts`(#244 F2 规则侧)、`crashConverged.ts`(L-38 崩溃收敛读面)、`src/gateOutcome.ts` |
|
|
150
160
|
| 4 | **子代 wire + 面板侧信道台账** | 87 | `tailEngineSubagent` · `installSubagentActivitySink` · `installSubagentTailMetaSink`(#280 件2:tail meta 帧发布口,`contentFrames` 判别位载体)· `stopEngineTask` + `classifyTaskStopConflict` · `fetchEngineSubagentReport` · `steerEngineSubagent`(0.32.0 未发布 #280 件A:additive 第三参 `childTaskId` —— 端有行上下文时**应当**传,传了就走「台账优先 / 缺席即诚实缺席 + `noteBgOwnerAbsence` 留痕」的 Q3 口径,与 tail·taskOutput·subagentOutput 三腿同姿势、与孪生 resume 腿共用同一个 `resolveOwnerRunId` 判据;**不传**则逐字维持旧行为=回落在飞 run)· `resumeSettledSubagent` + `resolveSubagentResumeContext` + `resolveOwnerRunId` + `classifySubagentResumeFailure` + `subagentResumeAvailable`(#242 批 2 A-028.7:resume 判定半场上收,与 steer 孪生同居;取址三态 = 台账有行用行值 / 指名了行但台账缺席则**诚实缺席绝不回落在飞 run** / 没指名行才回落。出路文案归端)· `recordSubagentOwnerFromProgress` + `getBgParentRunOwner`(A-028.6:「子代 → 宿主 run」**单表**,宿主 run 必须由持 stream-local 值的调用方显式传入,包内绝不从 `activeEngineRunId()` 推断)· `noteBgOwnerAbsence`(#242 批 3 [4000] Q3=B:tail/taskOutput·taskStop/subagentOutput 三腿台账缺席即诚实缺席**绝不回落在飞 run**,缺席 warn 留痕每 (腿,taskId) 一条)· `clearBgTerminalFacts`(#242 批 3 扫码修:复活=新周期,旧周期终态事实作废——fleetLedger 复活两腿按尾段清账,factsAccepted 方向核不再拿上周期终态当先例)· `auditRetainWithoutWake`([4000] Q5:引擎宣示 `subagentResume` + 本端在付 `retainSubagentSessions` + 端未实现 `wakeSubagent` ⇒ 响亮一条;`CLIENT_VERBS.wakeSubagent` 维持 fail-soft)· `subscribeSubagentContent` · `subscribeEngineAgentPanel` · `publishQuestionFrame` / `respondToQuestion` · `configureSubagentContentStore` / `subagentContentStoreConfig` / `SUBAGENT_CONTENT_STORE_DEFAULTS`(0.62.0:子代内容账本的**字节预算** —— 此前只有条数帽而单条无上限,一条 base64 工具结果就能让一个子代槽吃到十几 MB;越限从最早的内容开始丢并留一条可渲染的 `truncated` 记录,总帽淘汰整条最久未用的账本。配置面 fail-loud,详见 §26②)| 驱动与观测委派子代;经 module 级台账喂活体 agent/task 面板。全部**能力位 gate**(§5b) | `src/subagent/*.ts`、`src/subagentContentStore.ts`、`src/engineAgentPanelStore.ts`、`src/engineInlineTaskStats.ts`、`src/engineToolLabelStore.ts`、`src/liveQuestionStore.ts` |
|
|
@@ -154,12 +164,12 @@ SDK 核对「本包 import 的每个值级符号仍然导出」「`TaskStats.cos
|
|
|
154
164
|
| 8 | **工具结果卡** | 25 | `structuredToToolUseResult` · `readAsyncLaunchedAgentReceipt` · `wireOutputToBody` · `parseModelFacingBash` · `getPatchFromContents` · `toolEndResultToUserFrame` · `flattenToolOutput` | 铸端要渲的 `tool_result` 卡体,含客户端 diff hunk(唯一 runtime dep 的用处) | `src/toolResult.ts`、`src/printToolResultFrame.ts`、`src/diff/patch.ts` |
|
|
155
165
|
| 9 | **能力/旋钮 wire 门族** | 96 | `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 拒绝判定层) |
|
|
156
166
|
| 10 | **headless / 部署旋钮 wire** | 61 | `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` |
|
|
157
|
-
| 11 | **模型目录与预算** |
|
|
167
|
+
| 11 | **模型目录与预算** | 77 | `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` |
|
|
158
168
|
| 12 | **workflow 与后台工作视图** | 21 | `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`) |
|
|
159
169
|
| 13 | **座位 IPC 契约** | 34 | `LOCAL_SESSIONS_SPEC` · `SEAT_METHOD_NAMES` · `SEAT_EVENT_TYPES` · `isLocalSessionEvent` · `isToolPermissionRequest` · `toolPermissionRequestId` · `SEAT_VALIDATOR_KEY_COVERAGE` · `SEAT_SEND_MESSAGE_KEY_ORIGINS`(0.62.0:座位载荷**逐键出身**登记 —— 每个位要么写明转投哪个引擎请求位、要么写明为什么不上 wire;常驻门对**装在盘上的** sdk 型面逐名核,详见 §26③)| desktop↔web 座位 IPC 契约的**单一真源**(此前两边各一份、名字零重合 ⇒ 编译器永远不会告诉你它们漂了)。🔴 加 verb 忘了加 `LOCAL_SESSIONS_SPEC` **不报错**:preload 不注册 channel、渲染端读到 `undefined` | `src/seatContract.ts`(**零 import**,纯类型 + 常量 + 纯谓词)。🔴 **证据等级标注(0.42.0,test [5087] 的「语料**种类**缺口」/ cli [5088] 认领件)**:该文件里所有以「CC 如何如何」为形的断言(`212 methods` / `854-channel census` / 方法名逐字保留 / `fQe` 逐字段对照 / 一切 `.vite/build/index.chunk-*.js` 坐标)**证据等级 = 桌面 unpack,本地语料库不可复验** —— 本仓手边可复验的参照语料**只覆盖终端 CLI 形态**的静态产物,拿它去 grep 桌面壳里的符号只会零命中,而零命中在这里**既不证真也不证伪**。复核这些断言**不得**拿本仓语料当反证 |
|
|
160
170
|
| 14 | **宿主端口与会话槽** | 41 | `installHost` · `installHostFor` · `installCoreValuePorts` + 十读口 + 三存在性口(0.69.0 CC-07:core 值级面端口注入,Node 宿主装配根装、浏览器 lane 恒缺席)· `hostPortMisses(For)` · `DEFAULT_SESSION_KEY` · `hostEnv` · `unrefTimer` · `parseLocaleTag` / `pickUiLanguage`(#244 F4 族D A-028.20:locale tag 手术单源 + UI 语言判定;与 `resolveRegionHint` 双出口成文 —— 语言偏好域 en/zh ≠ 地址可达域 cn/intl/unknown,`zh-Hant` 前者 zh 后者 intl 是设计)· `engineNamespaceKeyFor` / `mergeSessionMapRecord` / `mergeEngineEntry`(A-028.12:会话 id 映射单一键形 + merge 判定;存储经 `SessionMapStorePort` 归端 —— cli 文件锁/原子写,web localStorage)| 进程/端级装配层(settings/fs/queue/timers/session/log/probe),与 per-turn 的 `AdapterContext` **分层**。头注的判定规则:**这个能力每 turn 都会变吗?** 会 ⇒ `ctx`;不会 ⇒ `installHost` | `src/host.ts`、`src/hostEnv.ts`、`src/sessionSlot.ts`、`src/unrefTimer.ts`、`src/env/{localeGeo,localeTag,uiLanguage}.ts`、`src/sessionMap.ts` |
|
|
161
171
|
| 15 | **控制面与传输** | 123 | `mcpEngineLegPresence`(0.71.0 CC-19:引擎侧 MCP 在场三值,只从面板视图求;§42)· `ControlRouter`(+ `ControlSafetyError`)· `fetchMcpPanel`(0.69.0:经 sdk `sessions.mcp` 取体 + 投视图,不裸 fetch)· `projectMcpPanel` + `mcpPanelLastLegDetail`(0.68.2 CC-03:`GET /v1/sessions/:id/mcp` 面板体防御读视图 + `lastLegMcp` 一行措辞铸点;缺席 = 键不铸、读不懂 = `lastLegMcpUnreadable`、禁与 `servers[]` 对账)· `makeEngineWireClient` + `resolveWireAuth` · `installEngineWireTarget` · `diagnoseSseIdleTear` / `isSseIdleError` · `attemptActiveRunSelfHeal` + `activeRunBusySignal` + `activeRunSelfHealRow` / `activeRunBusyHeadlessRow` · `kickEngineCapsProbe` / `engineCapTrue` / `invalidateEngineCaps(baseUrl, probe?)`(#307 S25:引擎温切后的 caps 生产失效口 —— kick 自带幂等闸,同 baseUrl 重启后不显式失效就永远读到旧引擎那一版能力位;调用方 = 壳的 respawn/restartEngine。🔴 **推荐两参形**:第二参给替代探测则「推进代际 + 注册新探测」在同一同步块内完成,失效与下一次 kick 之间那个「等待者读到未判」的窗按构造不存在;单参形保留给「只丢缓存、这一刻没有替代探测」的调用方,那种情形下读到未判是诚实结局) · `engineCapValue`(S-131,0.59.0:能力位的**四态**通用读口 `unobserved`/`not_reported`/`null`/`value` —— 既有三口把四种「读不出」全折成 fail-closed 一档,对**放行**问题是对的、对**读面/诊断**问题是错的:`null`(引擎明确说没有,正面事实)会与「老引擎不报」「还没探到」在屏上同形。`value` 位刻意不做形校验,形归各能力位自己的窄读器,详见 §23b)· `projectSqlEngineCapability` / `observedSqlEngine` / `noteEngineCapsForSqlEngine` / `forgetSqlEngineReading` / `sqlEngineDoctorDetail`(S-131,0.59.0:`Capabilities.sql`(server ≥7.60.0)的四态读面**从壳侧上收** —— 归层债,0.58.0 时它长在壳里正是因为包侧没有嵌套对象读口。🔴 **导出名与壳侧那份逐字同名 = drift-lock**;`txnMode: null` 是铸点域内的合法值不是畸形;换代失效口清成未观测而不是留旧值,详见 §23b)· `mapBrainStatusToRetry` · `waitForClaimRelease` + `CLAIM_RELEASED_STATES` / `CLAIM_HELD_STATES` · `atMostOnceFailureClass` / `readSteerDelivery` · `clearRunningChoiceOffer`(Inkglow-1085 P0b①:「Do nothing」登记的清口 —— 端的「重新打开操作菜单」入口;登记在场时 attemptActiveRunSelfHeal 不整卡重弹,not-parked 结局带 `alreadyOffered: true` 判别位,端据此降级渲一行)· `INTERACTIVE_WAY_OUT`(默认出路串单源)· `engineSessionParamFor`(design/285 批 0:`?session=` 派生的 **per-key** 形 —— `hostSessionFor(sessionKey)?.currentSessionId()` + [1501] 空串归一;零参 `engineSessionParam()` = 默认槽兼容层,取值链逐字等价)· `normalizeWirePrincipal`(A-028.10:principal 在场性 trim 原语 —— 全空白=缺席不发头,engineWireTarget 两臂/makeEngineWireClient/壳 livePrincipal 同尺)· `readSessionMemoryStatus` / `classifyMemoryStatusFailure` / `readCaptureOptOut` / `readLastCapture`(S-53 会话记忆姿态读面,0.48.0:失败分诊**码优先**——两个 404 分道 `not_found.session` / `not_found.route`,无码 404 不猜落 failed;五键逐键缺席语义两个合读器,`lastCapture` 三态的判别材料是 `committedCount` 不是本键;IO 归宿主注入 `MemoryStatusClientLike`,详见 §11) · `classifyTurnWireError` / `isWireTransportError` / `isPreStreamDrainingReject` / `isResumeAtRejection` / `drainingRetryDelayMs` / `scenarioDenyFromError` + `WIRE_NETWORK_ERROR_PATTERN`(A-028.11/.13:turn 错误分型判定半场,人话文案与渲染归端)· `resumeRetryLaterFromError`(L-102,0.57.0:resume 族**时间性拒绝**二码的判型半场 —— 这一族里唯一**带得出「等多久」**(`retryAfterSec`)的两个码。🔴 闭集**不是**「哪些码可以等」的名单:同族 `resume.row_recycling` 同样可等(窗口自清)只是没有秒数 ⇒ 本读口返回 `null` 只意味着没命中这两码,详见 §21) · `projectWriteProtectionCapability` / `observedWriteProtection` / `noteEngineCapsForWriteProtection` / `forgetWriteProtectionReading` / `writeProtectionDoctorDetail` / `projectWriteProtectionPosture` / `writeProtectionPostureDetail`(S-138,0.60.0:`Capabilities.writeProtection` (engine ≥7.63.0)的**四态**读面 + operator 面行表 —— 与上面 S-131 那一格**同构同纪律**。🔴 三位刻意不合成一个布尔;`not_reported` **不是**「这台部署没有写保护表」(座位缺席恰是缺省表在岗);逐行 name/kind 走**最小披露**只上 operator 面,详见 §24e)· `projectReadFacePosture` / `readFacePostureDetail` / `readFaceDisagreement`(S-167,0.61.0:operator 面 `diagnostics.wiring.readFace`(engine ≥7.65.0)的窄读器 —— 与上面S-138 那一格**同构同纪律**。🔴 三句「答不出来」逐字互异且没有一句等于「没有 READ 档」;`source` 按开集读;与租户面 `capabilities.readFace` 刻意不合流,只带一个纯比较函数,详见 §25)| 上行通道的**监管**半场(submit / steer / kill / 队列命令定序)+ 传输构造、caps 探测、SSE 断流分诊、**409 active-run 自愈** | `src/controlRouter.ts`、`steering.ts`、`sseIdleTriage.ts`、`retryStatus.ts`、`diagnostics.ts`、`engineWireSdk.ts`、`engineWireTarget.ts`、`src/principalWire.ts`、`src/wireErrorTriage.ts`、`engineSessionParam.ts`、`engineCapsCache.ts`、`liveInitToolFace.ts`、`adapter/activeRunSelfHeal.ts`、`src/sessionMemoryStatus.ts`、`src/writeProtectionCapability.ts`、`src/readFacePosture.ts` |
|
|
162
|
-
| 16 | **引擎词汇表与包自检** |
|
|
172
|
+
| 16 | **引擎词汇表与包自检** | 96 | `RESUME_REOPEN_CODES` / `RESUME_ENV_FAILED` / `RESUME_TOOL_UNAVAILABLE` / `RESUME_TOOL_CONTRACT_MISMATCH` · `resumeReopenFromError` / `resumeReopenContent`(0.71.3 CC-06:resume reopen 族三码闭集 + 读口 + 三句,§45)· `readSkillsListingTruncated`(0.70.0 CC-04:`skills.listing_truncated` 事实读器,§39)· `CONFIG_REFUSAL_CODES` / `isConfigRefusalCode` · `DECIDE_WORKFLOW_LANE_CODES`(+ 三个具名码;`/decide` workflow 车道,三条出路刻意不合并,详见 §30h)· `STOP_CONFLICT_CODES` · `isInterruptedToolEndCode` · `isRewindFamilyCode` · `CLIENT_VERBS` · `compensationSplitViolations` · `DELEGATION_CAP_CODES` / `isDelegationCapCode` / `DELEGATION_CONCURRENCY_CAP` / `DELEGATION_SESSION_CAP`(0.38.0 #318 件④:core 5.48.0 design/323 委派席位到限**两码,处置不对称禁合并** —— 并发帽=**可等**(兄弟结束即有位)/ 会话累计帽=**等也没用**(这条会话的配额用尽))· `CONFIG_DELEGATION_ENTRY_CAPS`(同批入 `CONFIG_REFUSAL_CODES` 识别表)· `delegationCapDispositionOf` / `MCP_SERVER_REVOKED`(0.39.0 载体到货消费件:core 5.50.0 补 `{ error: code, code }` 孪生拼法后两码真上 `tool_end.errorCode`,0.38.0「先立词不落消费分支」的已知局限自此解除;处置轴 `wait-for-slot` / `reuse-existing-or-await-reap` 机器可读(累计帽=retained-window 帐,行回收配额即回,处置=SendMessage 复用,**非**「换会话/永久耗尽」——0.38.0 段该句系勘误),未知 `delegation.*` 码 ⇒ `undefined`;`mcp.server_revoked` = 操作员 mid-session 吊销 server 后的工具面本地闸(被吊销的 server **名**今天不过 wire 境:detail.server 是进程内位,抬升腿只 lift code——归因渲染候 core 补 typed detail,已点名);载体门 = engine-vocab G3 腿锚 core dist 铸点)· `CAPABILITY_SELF_ORCHESTRATION_REQUIRED`(S-81,server 7.57.0:提交面的 selfOrchestration 准入拒绝码。🔴 **复用码** —— 与其它 `capability.*` 501 同体形而处置不同,消费点必须按**恰等**判、绝不放宽成前缀判;判型与「去键重发一次」归 `src/selfOrchestrationDenial.ts`,详见 §13) · `GATE_PARKED_ERROR_CODE`(0.60.0:「门把这次调用 park 了」的机读码单源 —— `frameRouter` 的连坐/中断判据与 `gateOutcome.isGateParkedToolEnd` 读同一个常量;真机黑盒直证 park 短路帧上**没有 `gate`**,这个码是那一形唯一的信号,详见 §24c)| 三端分臂共用的**去字面化** `errorCode` 词表(病根正是三端各抄一份字面);编译期 verb 闭合门;搬迁补偿登记表 | `src/engineErrorCodes.ts`(计数以 `scripts/public-export-baseline.json` 为准,别手抄;A-028.11/.13 补 `DRAINING_ERROR_CODE`/`SCENARIO_NOT_ALLOWED_ERROR_CODE`/`RESUME_AT_ERROR_CODE_PREFIX`;#318 件④ 补 `delegation.*` 族四位 + `config.delegation_entry_caps`;0.39.0 补三新码消费件三位);S-81 补 `capability.self_orchestration_required` 一位;L-102 补 `resume.*` 时间性拒绝二码 + 闭集 `RESUME_RETRY_LATER_CODES` 三位)、`src/classifierVerdictWire.ts`、`src/compensations.ts`、`src/clientSlice.ts`;**0.67.0 补锚**(这三件的导出一直计在本域,而本表此前没有它们的锚行 —— 如实补上,不是搬家):`src/gateVocabulary.ts`(`GATE_DENIED_BY_WORDS`/`gateDeniedByDetail`/`ASK_ORIGIN_WORDS`/`askOriginDetail` + 🆕 `RULE_STORE_UNREADABLE_KINDS`/`isRuleStoreUnreadableKind`/`ruleStoreUnreadableDetail`,详见 §32d)、`src/autoModeUnavailable.ts`(`AUTO_MODE_UNAVAILABLE_CAUSES` + 🆕 `CLASSIFIER_DENY_CAUSES`/`isClassifierDenyCause`/`classifierDenyCauseOf`/`classifierDenyCauseDetail`;🔴 同批**删**`classifierUnavailableOf`/`classifierUnavailableDetail`,详见 §32b)、`src/classifierStatus.ts`(`CLASSIFIER_STATUS_STATES`/`classifierStatusOf`/`classifierStatusDetail`)|
|
|
163
173
|
|
|
164
174
|
🔴 **`engineErrorCodes` 的开集纪律**(该文件头注逐字):这些 `ReadonlySet` / 前缀谓词一律是**识别表**,
|
|
165
175
|
回答的是「我认不认得这个码」,**绝不是**「合法码只有这些」。消费点 `switch` **必须留 `default`**,
|
|
@@ -4621,7 +4631,7 @@ an argument」。audience 答另一问:这条事实**说给谁听**。
|
|
|
4621
4631
|
**签名**
|
|
4622
4632
|
|
|
4623
4633
|
```ts
|
|
4624
|
-
ENGINE_NOTICE_CODES: readonly string[] //
|
|
4634
|
+
ENGINE_NOTICE_CODES: readonly string[] // 65 码,顺序同源(core 7.20.1 +1;0.71.4)
|
|
4625
4635
|
ENGINE_NOTICE_AUDIENCE: Readonly<Record<string, 'user' | 'operator'>>
|
|
4626
4636
|
noticeAudienceOf(code: unknown): 'user' | 'operator'
|
|
4627
4637
|
engineNoticeInCatalog(code: unknown): boolean
|
|
@@ -8190,3 +8200,70 @@ installCoreValuePorts({ resolveAutonomousLoopPrompt, loosenReasons, combinePolic
|
|
|
8190
8200
|
3. 零 BREAKING:型面、公面、peer 均不动。
|
|
8191
8201
|
|
|
8192
8202
|
**包侧缺口:** ① CC-06 B-081 包侧半场(窗 09-22);② CC-24 export-liveness 门(窗 09-20);③ CC-25 §NNz 机读门 + 三已发版本落点 + FROZEN 腿判据(窗 09-22);④ CC-26 `as unknown as` 铸出口棘轮(窗 09-22);⑤ `agents.listing_truncated` detail 读器候消费场景(by-design);⑥ `ClassifierSeat.defaulted?` 候 sdk 出键(by-design)。
|
|
8203
|
+
|
|
8204
|
+
## §45 🆕 0.71.3 清账批(export-liveness 门 + 退役预告 / `as unknown as` 棘轮 / §NNz 机读门 / CC-06 B-081 包侧半场)
|
|
8205
|
+
|
|
8206
|
+
> **patch**:型面纯 additive(公面 986 → 995;两个 `_sema_` 超集键;peer 不动);本版只**预告**退役,不删导出。前三件是接入方七轴审查 [7367] R4 / R5 / 顺手项归包(CC-24 / CC-25 / CC-26),第四件是 B-081 包侧半场(CC-06,cli L-211 对位)。
|
|
8207
|
+
|
|
8208
|
+
### 45a. 处置表
|
|
8209
|
+
|
|
8210
|
+
| # | 面 | 本包做了什么 | 端要做什么 |
|
|
8211
|
+
|---|---|---|---|
|
|
8212
|
+
| S-1 🔴 **退役预告** | 39 个运行期导出(四端 `src`/`ui`/`bff` 逐名零消费、本仓门零引用):`AUTHORITY_ENVELOPE_TAGS` `CANCEL_RELEASE_WAIT_MS` `CATALOG_CACHE_RELATIVE_PATH` `CATALOG_CACHE_STALE_MS` `DEFAULT_CATALOG_TIMEOUT_MS` `DEVICE_CODE_BACKOFF_STEP_MS` `DEVICE_CODE_HTTP_TIMEOUT_MS` `DEVICE_CODE_MAX_LIFETIME_MS` `DEVICE_CODE_MIN_INTERVAL_MS` `HITL_ASK_QUESTION_ID_PREFIX` `HITL_FRAME_CALL_KEY_PREFIX` `LIMITS_ERROR_CODE_PREFIX` `MAX_DENY_REASON_CHARS` `ONE_SHOT_ENV` `PROBE_MAX_TOKENS` `PROBE_PROMPT` `PROMPT_PROFILE_ENV` `TOOL_END_INTERRUPTED_CODES` `WORKFLOW_DEFER_ENV` `WORKFLOW_PARK_BINDING_BROKEN` `WORKFLOW_PARK_NOT_PENDING` `WORKFLOW_PARK_REQUIRES_RUN_STORE` `WORKFLOW_PARK_TRUTH_UNREADABLE` `clearArmedGateFor` `deriveAgentLabel` `notePlanReviewAnsweredIfDecisiveFor` `onGateArmedFor` `parseBackgroundReceipt` `parseFinalVerifyArgv` `providerApiShortName` `registerArmedGateFromQuestionIdFor` `wireCurrentTool` `wireEditedFiles` `wireParentToolCallId` `wireRetiredBy` `wireStartedCount` `wireStoppedBy` `wireToolUses` `wireTranscriptId` | 登 `scripts/export-liveness.json` `retire`(`retireBy: 0.72.0`),门在 0.72.0 到期红;`internal` 34 个另列(包内在用、端零消费,候收回) | **表态制**:仍需要其中任一个的端在发车帖回帖认领(名字 + 用途),本包翻 `candidate`(票号 + 窗)并保留;沉默 = 0.72.0 起不再导出 |
|
|
8213
|
+
| S-3 | **`as unknown as` 铸链棘轮**(CC-26,typeshape 门:整包 56 / 铸出口 SDKMessage 29,只降) | 门内两条棘轮 + 自检语料 | 零动作 |
|
|
8214
|
+
| S-4 | **冻结账门 ⑧ 段**(CC-25):§NNz 坐标「文件 的 #符号」逐组真在 / FROZEN 每版在本档有落点(§0c 索引补十版) | 门 + §0c | 零动作;端按档找符号扑空即打回 |
|
|
8215
|
+
| S-5 🔴 **终局回执生效面** | 终帧 `result` 新带 `_sema_effective_reasoning?: EffectiveReasoningView`(requested / effective / graded / clamped / format / endpoint / dropped?)与 `_sema_effective_memory_scopes?: EffectiveMemoryScopesView`(state / reason? / contract? / scopes[] / writeScope / materializedResidue?);读器 `readEffectiveReasoning` / `readEffectiveMemoryScopes` 出公面;成功臂与错误信封同带;坏形整键不铸 | `/effort` 面渲有效档:`effective ≠ requested` 标「被夹取」,`dropped` 在场标「未带推理参数」;记忆面板按 `state` 分臂,`memoryless` 按 `reason` 说话;🔴 缺席 = 引擎没报,不渲成精确档 / 已挂 |
|
|
8216
|
+
| S-6 | **resume reopen 族** | `RESUME_REOPEN_CODES` 三码闭集(`resume.env_failed` / `resume.tool_unavailable` / `resume.tool_contract_mismatch`;server resume-legs 同表)+ `resumeReopenFromError(err)` → `{ code, reason, retriable: true }`(🔴 只在拒体 **`retriable === true`** 时命中 —— server 只在 store 复核 checkpoint 真重开后才铸它;同码无 `retriable` = 终局失败,读口返 null)+ `resumeReopenContent` 三句;与 `RESUME_REFUSAL_CODES` / `RESUME_RETRY_LATER_CODES` 两两不交 | 拿到这三码:**卡仍 pending、行重新 park**,渲三句文案后重取待批列表,不当终局;不自铸第二句 |
|
|
8217
|
+
| S-7 | **`routePairingVerdict(v)`** | sdk 已知七词:四个 `ok:*` ⇒ ok / 两个 `broken:*` ⇒ broken / 其余(含未知 `ok:`·`broken:` 前缀词)⇒ unknown(posture 原样;不按前缀猜好坏);`LiveModelInfo.routePairing?: string` | `/model` 面板 `broken` 标红并提示「配 per-model 凭据或挪到部署根」;`unknown` 渲「未知」不渲好坏 |
|
|
8218
|
+
| S-2 | **export-liveness 门** | 每个导出「门引用 ∨ 登记」;`contract` 行(44 个端消费但无门)的 consumer 自报在四端树在盘时逐名核 | 零动作;端若新增消费一个 `internal` / `retire` 名字,发车帖回帖点名,本包改登 |
|
|
8219
|
+
|
|
8220
|
+
### 45z. 逐键处置表
|
|
8221
|
+
|
|
8222
|
+
| # | 键 / 面 | 处置 | 坐标 / 理由 |
|
|
8223
|
+
|---|---|---|---|
|
|
8224
|
+
| 1 | 39 个零消费导出 | **deprecated(0.72.0 删)** | `scripts/export-liveness.json` `retire` 行;门 export-liveness C 段到期红 |
|
|
8225
|
+
| 2 | 34 个 `export *` 放大件 | **internal(登记,候收回)** | 同上 `internal` 行 |
|
|
8226
|
+
| 3 | 44 个端消费无门导出 | **contract(登记,候补门)** | 同上 `contract` 行;E 段核自报 |
|
|
8227
|
+
| 4 | `as unknown as` 铸链 / 铸出口 | **consumed(棘轮)** | `scripts/run-client-core-typeshape-test.mjs` 的 `RATCHET.unknownCast` / `RATCHET.sdkMessageCast` |
|
|
8228
|
+
| 5 | §NNz 坐标真在 / 已发版本落点 | **consumed(⑧a / ⑧b)** | `scripts/run-integration-doc-freshness-test.mjs` ⑧ 段;§0c |
|
|
8229
|
+
| 6 | declined 键真零命中 | **pending(第二刀)** | 需先把处置表 declined 行的 wire 键与源码探针形式化 |
|
|
8230
|
+
| 7 | `TaskResult.effectiveReasoning` / `effectiveMemoryScopes` | **consumed(超集键 + 读器)** | `src/effectiveFacts.ts` 的 `#readEffectiveReasoning` / `#readEffectiveMemoryScopes`;`src/adapter/downstream/terminalToSdkResult.ts` 的 `#effectiveFactParts`;type-superset 登记 +2;门 terminal-facts A/B |
|
|
8231
|
+
| 8 | `resume.tool_contract_mismatch`(+ 同族两码) | **consumed(闭集 + 读口 + 文案)** | `src/engineErrorCodes.ts` 的 `#RESUME_REOPEN_CODES`;`src/resumeRefusalCopy.ts` 的 `#resumeReopenFromError`;门 terminal-facts C |
|
|
8232
|
+
| 9 | `ModelInfo.routePairing` | **consumed(读口)** | `src/liveModelCatalog.ts` 的 `#routePairingVerdict`;门 terminal-facts D |
|
|
8233
|
+
| 10 | `serverGates.durableApproval` 姿态读数 / `/health startedAt` 代际锚 | **consumed(既有站点)** | `postureKnob` / `headlessPermissionModeWire` / `engineIdentity` 三站点已在(B-081 六件中这两件本包早有读口,端侧 L-211 消费) |
|
|
8234
|
+
|
|
8235
|
+
### 45y. 🔴 三端升级必读(固定段式,[C295])
|
|
8236
|
+
|
|
8237
|
+
1. 🔴 **退役预告表态**:对照 S-1 名单,仍在用的名字回帖认领;0.72.0 删。
|
|
8238
|
+
2. 零 BREAKING:本版型面、公面、peer 均不动。
|
|
8239
|
+
3. 端新增消费本包导出时先看 `export-liveness.json`:`retire` 名不要再接。
|
|
8240
|
+
4. **B-081 四件到货**:终帧读 `_sema_effective_reasoning` / `_sema_effective_memory_scopes`(缺席不渲成精确档 / 已挂);resume 三码走 `resumeReopenFromError`(再 park 不当终局);`/model` 用 `routePairingVerdict`。
|
|
8241
|
+
|
|
8242
|
+
**包侧缺口:** ① `agents.listing_truncated` detail 读器候消费场景(by-design);② `ClassifierSeat.defaulted?` 候 sdk 出键(by-design);③ §NNz「declined 键真零命中」机读第二刀(候形式化,无到期日 = by-design 直到有人要)。
|
|
8243
|
+
|
|
8244
|
+
## §46 🆕 0.71.4 core 7.20.1 提货(通告码 65 / `wiring_manifest.writeProtection` 第七段)
|
|
8245
|
+
|
|
8246
|
+
> **patch**:型面纯 additive(`_sema_writeProtection` 超集键 + 通告闭集 +1),公面 995 不变,peer 不动;devDep core `~7.20.1`。提货单 [7415] @client-core 三条:① 通知码镜像 +1 ② manifest 镜像加可选段 ③ 导出 +3 纯增(`WRITE_PROTECTION_TARGET_VIEWS` / `WriteProtectionMount` / `WriteProtectionTargetView`,本包不 import core 值级面,n/a)。
|
|
8247
|
+
|
|
8248
|
+
### 46a. 处置表
|
|
8249
|
+
|
|
8250
|
+
| # | 面 | 本包做了什么 | 端要做什么 |
|
|
8251
|
+
|---|---|---|---|
|
|
8252
|
+
| S-1 | **`config.write_protection_target_view_absent`**(operator) | `ENGINE_NOTICE_CODES` index 13 镜像 + audience operator;`engineNoticeInCatalog` / `noticeAudienceOf` 照常 | 运维通知面按 operator 渲一条(每 run 一条):写保护判官只判拼写、受保护写工具已挂 —— 别名写不会被拦;用户面零动作 |
|
|
8253
|
+
| S-2 | **`wiring_manifest.writeProtection?: { targetView }`** | 切片 `_sema_writeProtection` + chrome `wiring_manifest.writeProtection?`;present-iff 编译出判官;`targetView` ∈ {spelling-only, target} 否则段缺席 | 诊断面(/doctor · wiring 面板)单独一格原样回显 `targetView`;🔴 缺席渲「未编译判官」(第三态),**不渲成 spelling-only** |
|
|
8254
|
+
|
|
8255
|
+
### 46z. 逐键处置表
|
|
8256
|
+
|
|
8257
|
+
| # | 键 / 面 | 处置 | 坐标 / 理由 |
|
|
8258
|
+
|---|---|---|---|
|
|
8259
|
+
| 1 | `config.write_protection_target_view_absent` | **consumed(镜像 +1)** | `src/engineNoticeCodes.ts` 的 `#ENGINE_NOTICE_CODES` / `#NOTICE_AUDIENCE`;码册门 G9 |
|
|
8260
|
+
| 2 | `wiring_manifest.writeProtection` | **consumed(切片第七段)** | `src/adapter/downstream/eventToSdkMessage.ts` 的 `#projectWriteProtectionSection`;`src/adapt/arms.ts` 的 `#wiringManifestArm`;type-superset `_sema_writeProtection`;wiring 门 K |
|
|
8261
|
+
| 3 | core 导出 +3(`WRITE_PROTECTION_TARGET_VIEWS` 等) | **n/a** | 本包零 core 值级 import(端口注入);二词闭集在本包读器内以字面判 |
|
|
8262
|
+
|
|
8263
|
+
### 46y. 🔴 三端升级必读(固定段式,[C295])
|
|
8264
|
+
|
|
8265
|
+
1. 诊断面读 `wiring_manifest.writeProtection?.targetView`:缺席 = 第三态「未编译判官」,不渲成 `spelling-only`。
|
|
8266
|
+
2. operator 通知面多一码(`config.write_protection_target_view_absent`),按 `noticeAudienceOf` 走 operator 臂。
|
|
8267
|
+
3. 零 BREAKING:型面 / 公面 / peer 不动。
|
|
8268
|
+
|
|
8269
|
+
**包侧缺口:** ① CC-30 MCP 会话内重连消费口(候 core / server 座位,[7418] ①);② CC-31 WebSearch 后端名读口(候 server 并进非 operator 面,[7418] ②);③ `agents.listing_truncated` detail 读器候消费场景(by-design);④ `ClassifierSeat.defaulted?` 候 sdk 出键(by-design);⑤ §NNz「declined 键真零命中」机读第二刀(候形式化)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/client-core",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.4",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@sema-agent/agent-types": "^0.3.0",
|
|
38
|
-
"@sema-agent/core": "~7.20.
|
|
38
|
+
"@sema-agent/core": "~7.20.1",
|
|
39
39
|
"@sema-agent/sdk": "^9.6.0",
|
|
40
40
|
"@sema-agent/settings-schema": "^2.0.0",
|
|
41
41
|
"esbuild": "^0.27.4",
|