@sema-agent/client-core 0.76.1 → 0.76.2

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 CHANGED
@@ -49,6 +49,10 @@
49
49
  > 挡住 ⇒ 本批把它机械化——④a0 对 `pending` 行**要求段头已是日期形**(`(未发布)` 直接红),阶段一
50
50
  > commit 漏转在发布前就红,不再靠人记。
51
51
 
52
+ ## 0.76.2(2026-09-20)
53
+
54
+ > 主题:**制品卫生**(patch;零源码改动、零型面改动、零行为改动)—— 0.76.1 的 tarball 里带着两只已撤出源码的编译产物 `dist/mcpProbeCapability.js` / `.d.ts`(编译器只写不删,源码撤出后上一次 build 的产物随 `files` 白名单出门;不在 barrel 导出面,只有深路径 import 才碰得到)。本版清 `dist/` 重 build,并加门 `run-dist-orphan-test.mjs`(dist 里每只 `.js` / `.d.ts` 必须有 `src/` 同名源,反向也对账;在 0.76.1 的 dist 上实跑见红)。除此之外与 0.76.1 逐字节同源(同一 gitHead 的源码);排了 0.76.1 的下游不必为本版重跑功能面,只需核 tarball 里那两只文件不在。
55
+
52
56
  ## 0.76.1(2026-09-20)
53
57
 
54
58
  > 主题:**能力位读器工厂 + 五只新读口 + 一处别名收口**(patch;零型面 BREAKING;公面值导出 1081 → **1120**)—— 读器工厂(CC-75)· MCP 活性观察读口(CC-36)· `capabilities.peerLane` / `capabilities.permissionRulesWrite` 四态读口(CC-102)· 记忆治理面两只四态读口 + 三只条目面回体读口(CC-97 a)· 主车道证明逐次新建(CC-99)。🔴 **已从本版撤出**:`capabilities.mcpProbe` 读口(CC-74)—— 上游三仓源码里尚无这一格与它的 501 码,上游那张票仍是设计稿;公面一旦发出就是承诺,无一字可验的键名不上公面,候上游真码落地后按字节重做。
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.76.1
38
+ **Version:** 0.76.2
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
@@ -398,6 +398,7 @@ public-surface guard checks that last one).
398
398
  | `scripts/run-peer-lane-rules-write-capability-test.mjs` | Two more engine self-descriptions read the same four-state way as their seven sibling capability readers (`capabilities.peerLane`, `capabilities.permissionRulesWrite`): an absent key is not reported (an older engine that predates the position, never folded into `false`), `true` is present, `false` is a positive absent (the cross-session lane not being mounted on this deployment, or this particular call not being able to reach the tightening-direction write entry), and anything else is unreadable and drops the cell. Each carries its own single-source verdict (`peerLaneAvailable` returns `yes`/`no`/`unknown`; `permissionRulesWriteAvailable` collapses to a plain boolean, present being the only `true`). The write-entry position pairs with a boolean convenience port in the persisted-rules module, and this guard pins that port to derive from nothing but this one reader's own reading — never a conjunction with the lane-reachable position, and never a second read of the deployment-level existence signal the revoke surface uses (the two are documented as reading differently on purpose): a deployment where the lane answers true but the write entry's key is simply absent (an older binary) must still come back `false`, a deployment where the write entry answers true while the lane key is entirely unseen must still come back `true` (proving no silent conjunction crept in), seeding only the general capabilities cache — never this reader's own feed — must still come back `false` (proving the convenience port cannot be satisfied by the wrong table), and passing an explicit `undefined` base URL must still come back `false` even while a different, already-installed engine target answers `true` for the same position (an adversarial pass found the naive forward of that parameter falls through to the reader's own convenience default, silently answering for whichever engine happens to be installed rather than the caller's absent target — the fix routes an explicit absence through the same empty-string path the reader treats as unobserved). |
399
399
  | `scripts/run-lane-proof-identity-test.mjs` | The **instance identity of a lane proof**: the main-lane proof is minted fresh on every emission. Previously a single module-level constant object was handed both to `laneOf(an unregistered task id)` and to some fifty main-lane emission points, so two unrelated consumers — across adapter instances, across streams, across turns — held the same object: writing a card id onto one of them was readable on the other, and the four opening main-lane events changed together. Nothing in this package writes to a lane proof and the known consumers only read it, so this is an **aliasing hazard on a published output surface** rather than an observed corruption — a consumer that uses the proof as an identity key, for dedup, or as a view-layer identity would conflate two unrelated rows without writing a single byte, which is precisely the half that freezing the object would not solve. The gate therefore anchors on instance identity: two independent adapter instances, two rows inside one instance, the same id read twice, and two arms in one beat are each distinct references; mutating one leaves the others byte-identical; and the subagent lane, which already minted fresh, is the control that proves the criterion discriminates. The main-lane **value** is unchanged — an unregistered id still answers `{lane:"main"}` with exactly one own key and still emits its events, so absence is not turned into a second kind of absence — with ordering pinned three ways (registered-then-read, read-then-registered with no retroactive edit of an already delivered proof, the same id twice) and the id failure classes pinned four ways (unregistered, empty string, absent, non-string, the last two emitting no panel event at all rather than an ownerless proof). Where one row emits **two** events — the terminal-tick and card-close legs, which each yield a lifecycle stop and a panel end — the attribution is decided once (a consumer binding a card between the two yields must not split one row across two lanes) while each event still gets its own proof, so a host consuming them one at a time cannot poison the second before it is even yielded. The run stream leg is covered as the same shape, and a syntax-tree check forbids reintroducing a module-level lane-proof object literal or a module-level `LaneProof`-annotated binding (judged on the type node, not on text, so a compile-time pin tuple that merely mentions the type is not miscaught), backed by a type-checker pass that also catches an un-annotated module-level cache such as `const x = mainLane()` while letting the callable factory itself through, while the module-private three-state sentinels of the untrusted read are frozen instead — only `Object.freeze` counts, never `Object.seal`, which still permits writes to existing keys — their exposure being confined to one module |
400
400
  | `scripts/run-memory-entries-wire-test.mjs` | The two memory-governance capability bits and the three memory-entry response readers. Each bit (`capabilities.memoryCompliance`, for the entry-provenance and erasure endpoints; `capabilities.memoryOrigin`, for the external-origin listing and clearance endpoints) is read the same four-state way as its sibling capability readers: an absent key is reported as not reported (never folded into `false` — an older engine simply does not answer, and the right next step is to try the endpoint and read its 501), `true` is the face being mounted, `false` is a positive "not on this deployment" (the wire does not distinguish a backend without control-plane ownership from an empty operator roster, so the wording never guesses which), any non-boolean value is unreadable and drops the cell instead of being folded into "absent", and a capabilities body that is not an object at all is unreadable rather than "not reported". The two bits deliberately stay **two** readers with two separate per-engine tables, because the engine deliberately keeps them two separate product faces even while they happen to carry the same value today: feeding one an unreadable body, or invalidating one, leaves the other's reading untouched, and a body where one is on and the other off is answered one bit at a time. The entry-export reader narrows each row on its own (an empty array really is zero rows, a non-empty array with nothing readable in it is reported as unreadable rather than as "no rows", and partly bad rows are kept with a dropped count), reads the external-origin marker as three states rather than a boolean (the two structural carriers mark a row; a row whose frontmatter cannot be read, or which carries the third, suspended-form carrier, is undecidable, because the judge for that carrier lives in the engine and this package refuses to mint a second copy of it), and treats an unreadable "is this the whole scope" flag as "not the whole scope". Its verdict port implements — in code, not in a comment — the rule that an empty answer is never a clean store: the caller must state whether the request declared origin-awareness, because this endpoint withholds marked entries by default and the two bodies are shaped identically, so without that statement an empty answer is only ever "unknown"; the affirmative answer is scoped to the one named scope and carries that scope with it, and the type has no store-wide arm at all. The erasure receipt reader keeps three things apart that are easy to collapse: "this call erased nothing" (a real receipt whose erased list is empty and whose not-found list explains why, per id), "a 200 with an empty body", and "a body that could not be read" — at the reading, the counting and the verdict layer alike; it refuses a version envelope it does not recognise instead of reinterpreting it, treats the three closed vocabularies as closed (an unknown word is unreadable, never folded into a known arm), keeps an unreadable binding as unknown instead of claiming "unbound", passes the "history cannot be judged" flag through as four states (set, explicitly unset, absent, and present-but-unreadable — an unreadable flag is kept distinct from an absent one, and the history verdict then answers "unknown" rather than the stronger claim), and answers the replay question as three states so that the degraded lane is never retried automatically. The clearance receipt reader carries the cleared marker through verbatim and says separately whether it was reported at all. Every array in every response is snapshotted once — the length is read exactly once and each index exactly once, rather than iterating the caller's own iterator — because an array that reports one length while being walked and another afterwards could otherwise have a marked row quietly dropped while the "was anything unreadable" check saw nothing, which ends in calling the scope clean; an array that reports an absurd length is reported as unreadable rather than silently truncated to its first rows. All three readers never throw. |
401
+ | `scripts/run-dist-orphan-test.mjs` | Every `.js` / `.d.ts` under `dist/` must have a same-named source under `src/`, and every source must have its build output — because the compiler only writes and never deletes, so a module removed from the sources keeps shipping from the previous build (the whole `dist/` directory is on the publish whitelist) while the public-surface gate only looks at what the barrel exports and the hygiene gate only looks at forbidden words. Orphans are named one by one; the pre-publish posture is a clean rebuild, and this gate is the check that the posture was actually followed. |
401
402
 
402
403
  Each suite carries a floor that only moves up — a refactor that stops executing a group of
403
404
  assertions is a failure, not a quieter pass. Guards anchor on the **installed artefact's content**
@@ -19,7 +19,7 @@
19
19
 
20
20
  | 项 | 值 | 真源 |
21
21
  |---|---|---|
22
- | 本包 | `@sema-agent/client-core` **0.76.1**(本批发布版 = **patch**:能力位读器工厂(CC-75)/ MCP 活性观察读口(CC-36)/ `capabilities.peerLane` · `permissionRulesWrite` 四态读口(CC-102)/ 记忆治理面两只读口 + 三只条目面回体读口(CC-97 a)/ 主车道证明逐次新建(CC-99)+ 修 0.76.0 的 F1 / F2(身份四键一次性快照只修了投影口一侧);公面 1122;§77。上一版 0.76.0 = **minor**:六票一批 —— `prompt_assembled` 投影臂 / 审批 feed 三态(**型面 BREAKING**)/ `ApprovalResolution` 单源联合 / 记忆 spec 读口 / 终态词表上游钉 / `tasks_expand` 退役(**型面 BREAKING**),外加身份四键一次性快照(跨全部内部臂);公面 1081;§76。上一版 0.75.1 = **patch**:面板短命子代反序缓行放不出的残洞(外部复验 D1)+ 同代 running 帧三向定形(B4)+ #969 提货 `spawnName` 透传与 `agentType` 改读诚实来源(CC-95);§75。上一版 0.75.0 = **minor**:压缩的非 compacted 结局上 chrome 面 `compaction_outcome`(新内部臂 —— 自建 print 出口的端先表态)+ peer sdk 地板 `>=9.8.1`;型面 additive(ChromeEvent +1 臂)、公面 1065、零 wire 新键;§74。上一版 0.74.5 = **patch**:core 7.24.0 提货 `_sema_freed_tokens?` + 首见即终态的行零事件(幽灵完成行)+ `isNewEngineAgentPanelCycle` / `approvalOutcomeNoteOf` 上公面;型面 additive、公面 1065、peer 不动;§73。上一版 0.74.4 = **patch**:面板键「先发布的键为准」(tick 归不了一的三序不再两行)+ 前代 UUID 迟到 tick 丢弃 + `readRunCancelContext` 下钻收紧;型面 additive、公面 1061、peer 不动;§72。上一版 0.74.3 = **patch**:面板子代身份归一(tick / end 的 UUID 归到 fleet 尾段,宿主零改)+ run 记录 `cancelContext` 读口与成因四词 + workflow 行 `errorCode` + reopen 第二臂两件;型面纯 additive、公面 1061、peer 不动;§71。上一版 0.74.2 = **patch**:`capabilities.deviceExecutor.management` 四态读口(缺席 ≠ false;`deviceExecutor: false` = 车道缺席;管理动词可用性三态归包);公面 1052;§70。上一版 0.74.1 = **patch**:审批卡无决断收口 + 结局回交;§69。上一版 0.74.0 = **minor**:peer sdk 地板 >=9.7.1 + covers 过境 + 面板周期身份 + 离场读口;§68。上一版 0.73.5 = **patch**:workflow 规模告警判定上收进包(`evaluateWorkflowSize` 三态:未知的规模不当作规模正常;分母口径与帽优先级单源;env 读口纯函数);型面纯 additive、公面 1044、peer 不动;§67。上一版 0.73.4 = **patch**:终帧 `permission_denials` 第三键 ⇐ 同一条流 `tool_start` 入参按 `toolCallId` join(三道闸;join 不上留 sema 载体;🔴 更正 0.73.2「自动升级收口」一句)+ 审批 feed push 侧取件失败的欠账退避重试;型面纯 additive、公面 1033、peer 不动;§66。上一版 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 八条)|
22
+ | 本包 | `@sema-agent/client-core` **0.76.2**(本批发布版 = **patch**:制品卫生 —— 清 dist 重 build 去掉两只已撤出源码的编译产物 + dist ⇄ src 对账门;零源码 / 零型面 / 零行为改动;公面 1122;§78。上一版 0.76.1 = **patch**:能力位读器工厂(CC-75)/ MCP 活性观察读口(CC-36)/ `capabilities.peerLane` · `permissionRulesWrite` 四态读口(CC-102)/ 记忆治理面两只读口 + 三只条目面回体读口(CC-97 a)/ 主车道证明逐次新建(CC-99)+ 修 0.76.0 的 F1 / F2(身份四键一次性快照只修了投影口一侧);公面 1122;§77。上一版 0.76.0 = **minor**:六票一批 —— `prompt_assembled` 投影臂 / 审批 feed 三态(**型面 BREAKING**)/ `ApprovalResolution` 单源联合 / 记忆 spec 读口 / 终态词表上游钉 / `tasks_expand` 退役(**型面 BREAKING**),外加身份四键一次性快照(跨全部内部臂);公面 1081;§76。上一版 0.75.1 = **patch**:面板短命子代反序缓行放不出的残洞(外部复验 D1)+ 同代 running 帧三向定形(B4)+ #969 提货 `spawnName` 透传与 `agentType` 改读诚实来源(CC-95);§75。上一版 0.75.0 = **minor**:压缩的非 compacted 结局上 chrome 面 `compaction_outcome`(新内部臂 —— 自建 print 出口的端先表态)+ peer sdk 地板 `>=9.8.1`;型面 additive(ChromeEvent +1 臂)、公面 1065、零 wire 新键;§74。上一版 0.74.5 = **patch**:core 7.24.0 提货 `_sema_freed_tokens?` + 首见即终态的行零事件(幽灵完成行)+ `isNewEngineAgentPanelCycle` / `approvalOutcomeNoteOf` 上公面;型面 additive、公面 1065、peer 不动;§73。上一版 0.74.4 = **patch**:面板键「先发布的键为准」(tick 归不了一的三序不再两行)+ 前代 UUID 迟到 tick 丢弃 + `readRunCancelContext` 下钻收紧;型面 additive、公面 1061、peer 不动;§72。上一版 0.74.3 = **patch**:面板子代身份归一(tick / end 的 UUID 归到 fleet 尾段,宿主零改)+ run 记录 `cancelContext` 读口与成因四词 + workflow 行 `errorCode` + reopen 第二臂两件;型面纯 additive、公面 1061、peer 不动;§71。上一版 0.74.2 = **patch**:`capabilities.deviceExecutor.management` 四态读口(缺席 ≠ false;`deviceExecutor: false` = 车道缺席;管理动词可用性三态归包);公面 1052;§70。上一版 0.74.1 = **patch**:审批卡无决断收口 + 结局回交;§69。上一版 0.74.0 = **minor**:peer sdk 地板 >=9.7.1 + covers 过境 + 面板周期身份 + 离场读口;§68。上一版 0.73.5 = **patch**:workflow 规模告警判定上收进包(`evaluateWorkflowSize` 三态:未知的规模不当作规模正常;分母口径与帽优先级单源;env 读口纯函数);型面纯 additive、公面 1044、peer 不动;§67。上一版 0.73.4 = **patch**:终帧 `permission_denials` 第三键 ⇐ 同一条流 `tool_start` 入参按 `toolCallId` join(三道闸;join 不上留 sema 载体;🔴 更正 0.73.2「自动升级收口」一句)+ 审批 feed push 侧取件失败的欠账退避重试;型面纯 additive、公面 1033、peer 不动;§66。上一版 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.8.1**(value-level,非 type-only;**0.75.0 抬版**:9.8.x 声明 `Capabilities.deviceExecutor.management?`,9.7.1 失去物料见证;**0.74.0 曾抬到 >=9.7.1**:9.7.x 追平的六处型面是本包 0.73.3 起的编译基线,且 9.6.0 失去物料见证;**0.71.0 曾抬到 >=9.6.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` |
@@ -9487,3 +9487,21 @@ installCoreValuePorts({ resolveAutonomousLoopPrompt, loosenReasons, combinePolic
9487
9487
  5. **记忆条目面三条硬话**:两只能力位读器不许在端侧合并成一只;拿导出面判「有没有外源条目」必须走判词口并如实填 `originAware`(填错 = 把「看不见」渲成「没有」);抹除收执读不出(含 200 空体)一律「不知道」,`notFound` 行不授权任何界面说「这条从来不存在」。
9488
9488
 
9489
9489
  **包侧缺口:** ① `McpServerStatus.liveness`:`/mcp` 面板 `servers[]` 那一面上游投影白名单不带这一格 ⇒ 部署面那一屏今天没有活性可读,本包不铸位(要不要带,发车帖问 server 一次;带了本包同批补一格读数 + 判据)· ② 服务端自 7.91.2 起把 `liveness` 过境,更老的服务端上这一格恒缺席 = `indeterminate` · ③ `liveness` 的新鲜度没有上界可判(引擎不轮询),本包不铸「过期了没」· ④ `peerLane` 的第二道挂载判据(mailbox 的跨进程安全声明)在本位辖域之外,本位不复判,端仍可能遇到「本位说 present 但那道门拒挂」的窗口 · ⑤ 两枚具名键的编译期钉要等下次抬 sdk 地板 · ⑥ `capabilities.mcpProbe`(CC-74)候上游真码 · ⑦ 能力位里按调用方算的位(`permissionRules` / `permissionRulesWrite`)与本包按 baseUrl 键的进程级缓存之间的张力:同进程同 baseUrl 多 principal 时第二个调用方会读到第一个的读数(登 KNOWN-LIMITS,单 principal 进程不受影响)· ⑧ 第三种外源标记载体(`frontmatter.extra` 的悬置形)本包判不了 —— 归一化判官在引擎侧,自铸一份 = 第二个判官;今天过近似为 `undecidable`,升级判据 = 走既有端口注入姿势让宿主把引擎那只判官交进来 · ⑨ 抹除证明的审计归档位本版不读(`select` / `selectHash` / `residuals` / `erased[].evidenceEv` / `projectionsRemoved` / `sessions`),要读的端今天直接读原回体 · ⑩ 记忆条目面五个动词候抬 sdk 地板,三只读口刻意只吃 `unknown` 回体,动词到货那天读口不改 · ⑪ `GET /v1/memory/origin/external` / `…/clearances` 两个回体本版没有读口(前者缺省围栏下全部被扣留,读口必须与 `originAware` 一起设计)· ⑫ 更早的五只能力位读器对「caps 回体是数组」答 `not_reported`,本版两只答畸形(登 KNOWN-LIMITS,不立票)。
9490
+
9491
+ ## §78 🆕 0.76.2 制品卫生;patch(零源码 / 零型面 / 零行为改动)
9492
+
9493
+ > **patch**:只做一件事 —— 0.76.1 的 tarball 里带着两只已撤出源码的编译产物 `dist/mcpProbeCapability.js` / `.d.ts`(不在 barrel 导出面,公面 1122 不含,`index.d.ts` 无引用;只有深路径 import 才碰得到)。本版清 `dist/` 重 build 并加 dist ⇄ src 逐名对账门。源码与 0.76.1 同一 gitHead 的内容逐字节同源。
9494
+
9495
+ ### 78a. 处置表
9496
+
9497
+ | # | 面 | 本包做了什么 | 端要做什么 |
9498
+ |---|---|---|---|
9499
+ | S-1 | tarball 里的两只死文件 | **removed**:清 `dist/` 重 build;新门 `run-dist-orphan-test.mjs` 两向对账 | 零改;排了 0.76.1 的端不必为本版重跑功能面,换钉即可 |
9500
+
9501
+ ### 78y. 🔴 三端升级必读(固定段式,[C295])
9502
+
9503
+ 1. 零必须动作;零型面 BREAKING;零行为改动。
9504
+ 2. 若有端深路径 import 过 `dist/mcpProbeCapability.js`(本包从未支持深路径,三端存量普查为零),本版起该文件不在。
9505
+ 3. §77 的全部内容原样适用。
9506
+
9507
+ **包侧缺口:** 同 §77。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/client-core",
3
- "version": "0.76.1",
3
+ "version": "0.76.2",
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",
@@ -1,84 +0,0 @@
1
- /**
2
- * mcpProbeCapability — `GET /v1/capabilities.mcpProbe` 的三端共用读面(0.76.1 CC-74;能力位读器第七只,
3
- * 与 sql / writeProtection / webSearch.backend / executionLane / approvalsStreamLive / deviceExecutor.management
4
- * 六只兄弟同一套词汇、同一份四口实现 {@link import("./engineCapReader.js").createEngineCapReader})。
5
- * sdk 9.8.1 对该位**无型** ⇒ 按契约结构读(与 device 那一位 0.74.2 同路);sdk 出键当天由能力位台账门逼一次显式处置。
6
- *
7
- * ── 这一位答的是哪一个问题 ────────────────────────────────────────────────────────────────
8
- * 「这台引擎上**能不能发 MCP 探测请求**」(`POST /v1/capabilities/mcp/probe`)。位为 `true` ⇔ 引擎认这次注入
9
- * (**单用户姿态 ∧ MCP 车道 wired**,两条合取,与探测口 200 / 501 的谓词同一个表达式);位为 `false` ⇔ 两条里
10
- * 缺任一条(多租户部署,**或**单用户但车道没 wired)⇒ 探测口回 `501 {@link MCP_INJECTION_REQUIRED_CODE}`。
11
- * 🔴 **`false` 不许读成「多租户」**:「单用户但车道未 wired」是同样合法的一种部署,wire 上两者不可分 ⇒
12
- * 措辞与判据都只说「探测口在这台引擎上不可用」,不替引擎推因由。
13
- * ⚠️ 本位只说**探测口在不在**。`GET /v1/capabilities/mcp` 详情卡的实际响应由调用那一刻决定,不从本位推 ——
14
- * 本仓没有任何证据支持「本位缺席 ⇒ 详情卡 404」这类蕴含,编一条出来就是替 server 许一个它没许的诺。
15
- *
16
- * ── 🔴 读法(四态,不是两态)─────────────────────────────────────────────────────────────────
17
- * ① `unobserved` —— 这一格**没有可用读数**:本进程一次 caps 响应都没观测到(一次性诊断命令就是这一档)、
18
- * 或最后一次回体**读不懂**被删格、或引擎温切后 {@link forgetMcpProbeReading} 清过。三条路同落这一档,
19
- * 它们的共同点正是这句话本身 —— 不是「探测口不在」。
20
- * ② `not_reported` —— caps 观测到了,而回体上**没有** `mcpProbe` 这个键 ⇒ 老 server。🔴 **不折 `false`**:
21
- * 折了就是替一台没说话的引擎断言「探测口不在」,而正确的下一步是**按 501 试探**。
22
- * ③ `absent` —— 引擎**明确说** `false`。这是一个**正面事实**(明确的否),不是缺席。
23
- * ④ `present` —— 引擎**明确说** `true`:探测口可用。
24
- * 严格布尔:`null` / 串 / 数(含 `0` / `1`)/ 数组 / 对象 ⇒ 畸形(删格 ⇒ `unobserved`),🔴 **绝不折 `absent`** ——
25
- * 一份读不懂的回体和一句「不可用」是两件事。判在场用 `hasOwn`(与 device 那一位同形):原型链上的同名键
26
- * 不是这台引擎说的话。
27
- * 「探测口能不能用」的判据归包:{@link mcpProbeAvailable} —— 只有 `present` 才 `'yes'`;`absent` ⇒ `'no'`;
28
- * 其余 ⇒ `'unknown'`(端按 501 试探,不预判)。
29
- */
30
- /**
31
- * 探测口在这台引擎上不可用时的 501 错误码(逐字)。
32
- *
33
- * 🔴 它与本位的 `absent` 是**同一件事的两面**(同一个谓词):端读到 `absent` 就不必发那一发请求,
34
- * 读到 `unknown` 就发出去、按这个码兜。消费点按**恰等**判,绝不放宽成 `capability.` 前缀
35
- * (`capability.*` 是开集,别的成员处置不同)。
36
- */
37
- export declare const MCP_INJECTION_REQUIRED_CODE = "capability.mcp_injection_required";
38
- /** 四态读数(见文件头)。`unobserved` 由**读口**在这一格空缺时铸,不由投影铸。 */
39
- export type McpProbeReading = {
40
- kind: 'unobserved';
41
- } | {
42
- kind: 'not_reported';
43
- } | {
44
- kind: 'absent';
45
- } | {
46
- kind: 'present';
47
- };
48
- /**
49
- * caps 回体 → 本格读数;**畸形一律 `undefined`**(= 这一格不写 ⇒ 读口答 `unobserved`)。
50
- *
51
- * 🔴 键缺席(`hasOwn` 为假,或显式 `undefined`)⇒ `not_reported`;`false` ⇒ `absent`;`true` ⇒ `present`;
52
- * 其余一切值 ⇒ `undefined`。三条路互不折叠。
53
- * 🔴 值**只读一次**(校验与分臂同一次读):变化的 getter 会让校验读到布尔、分臂读到别的东西。
54
- */
55
- export declare function projectMcpProbeCapability(caps: unknown): McpProbeReading | undefined;
56
- /**
57
- * 宿主 caps probe 的**读面 tee** 落点(与六只兄弟并列)。绝不 throw —— 读面腿不许反噬 caps 探测链。
58
- * 投影 `undefined`(畸形)或投影抛出 ⇒ 这一格**被删**,不留上一台引擎的旧读数;`opts.generation` 关掉
59
- * 「旧探测覆盖新读数」那条竞态(宿主在起探测那一刻 `engineCapsGeneration(baseUrl)` 抓号、在这里原样交回;
60
- * 不传 ⇒ 与本位到货之前逐字节同行为)。
61
- */
62
- export declare function noteEngineCapsForMcpProbe(baseUrl: string, caps: unknown, opts?: {
63
- generation?: number;
64
- }): void;
65
- /** 本进程观测到的探测口姿态;这一格空缺 ⇒ `{kind:'unobserved'}`(**绝不**折成 `absent`)。 */
66
- export declare function observedMcpProbe(baseUrl?: string | undefined): McpProbeReading;
67
- /**
68
- * 「MCP 探测口能不能用」的判据单源(三态):只有引擎明说在场(`present`)才 `'yes'`;明说不在(`absent`)⇒ `'no'`;
69
- * 老 server / 从没观测 ⇒ `'unknown'`(端**按 501 试探,不预判** —— 把 unknown 当 no 会藏掉一台真能探测的引擎)。
70
- */
71
- export declare function mcpProbeAvailable(reading: McpProbeReading): 'yes' | 'no' | 'unknown';
72
- /**
73
- * 四态 → doctor 那一行的 detail 串。**唯一措辞真源**(三端共用一句话;端只拼接不另写)。
74
- * 🔴 四句话刻意**互不相同、也互不蕴含**:「未观测」「老引擎不报」两种「读不出」都**不等于**「探测口不在」;
75
- * `absent` 那一句既要说不可用、又**不许**推因由(多租户 / 车道未 wired wire 上不可分)。
76
- */
77
- export declare function mcpProbeDoctorDetail(reading: McpProbeReading): string;
78
- /**
79
- * **换代失效口**(与六只兄弟的同名口并列,由宿主在引擎温切成功后调):清成未观测,不是留旧值也不是铸一个
80
- * `absent`。空串 / `undefined` ⇒ no-op;绝不 throw(它跑在引擎温切路径上)。
81
- */
82
- export declare function forgetMcpProbeReading(baseUrl: string | undefined): void;
83
- /** 测试钩子(只清本只读器的读账:不动装好的 wire 读锚、不动 caps 缓存的代际号、不动别只读器的表)。 */
84
- export declare function __resetMcpProbeReadingsForTests(): void;
@@ -1,124 +0,0 @@
1
- /**
2
- * mcpProbeCapability — `GET /v1/capabilities.mcpProbe` 的三端共用读面(0.76.1 CC-74;能力位读器第七只,
3
- * 与 sql / writeProtection / webSearch.backend / executionLane / approvalsStreamLive / deviceExecutor.management
4
- * 六只兄弟同一套词汇、同一份四口实现 {@link import("./engineCapReader.js").createEngineCapReader})。
5
- * sdk 9.8.1 对该位**无型** ⇒ 按契约结构读(与 device 那一位 0.74.2 同路);sdk 出键当天由能力位台账门逼一次显式处置。
6
- *
7
- * ── 这一位答的是哪一个问题 ────────────────────────────────────────────────────────────────
8
- * 「这台引擎上**能不能发 MCP 探测请求**」(`POST /v1/capabilities/mcp/probe`)。位为 `true` ⇔ 引擎认这次注入
9
- * (**单用户姿态 ∧ MCP 车道 wired**,两条合取,与探测口 200 / 501 的谓词同一个表达式);位为 `false` ⇔ 两条里
10
- * 缺任一条(多租户部署,**或**单用户但车道没 wired)⇒ 探测口回 `501 {@link MCP_INJECTION_REQUIRED_CODE}`。
11
- * 🔴 **`false` 不许读成「多租户」**:「单用户但车道未 wired」是同样合法的一种部署,wire 上两者不可分 ⇒
12
- * 措辞与判据都只说「探测口在这台引擎上不可用」,不替引擎推因由。
13
- * ⚠️ 本位只说**探测口在不在**。`GET /v1/capabilities/mcp` 详情卡的实际响应由调用那一刻决定,不从本位推 ——
14
- * 本仓没有任何证据支持「本位缺席 ⇒ 详情卡 404」这类蕴含,编一条出来就是替 server 许一个它没许的诺。
15
- *
16
- * ── 🔴 读法(四态,不是两态)─────────────────────────────────────────────────────────────────
17
- * ① `unobserved` —— 这一格**没有可用读数**:本进程一次 caps 响应都没观测到(一次性诊断命令就是这一档)、
18
- * 或最后一次回体**读不懂**被删格、或引擎温切后 {@link forgetMcpProbeReading} 清过。三条路同落这一档,
19
- * 它们的共同点正是这句话本身 —— 不是「探测口不在」。
20
- * ② `not_reported` —— caps 观测到了,而回体上**没有** `mcpProbe` 这个键 ⇒ 老 server。🔴 **不折 `false`**:
21
- * 折了就是替一台没说话的引擎断言「探测口不在」,而正确的下一步是**按 501 试探**。
22
- * ③ `absent` —— 引擎**明确说** `false`。这是一个**正面事实**(明确的否),不是缺席。
23
- * ④ `present` —— 引擎**明确说** `true`:探测口可用。
24
- * 严格布尔:`null` / 串 / 数(含 `0` / `1`)/ 数组 / 对象 ⇒ 畸形(删格 ⇒ `unobserved`),🔴 **绝不折 `absent`** ——
25
- * 一份读不懂的回体和一句「不可用」是两件事。判在场用 `hasOwn`(与 device 那一位同形):原型链上的同名键
26
- * 不是这台引擎说的话。
27
- * 「探测口能不能用」的判据归包:{@link mcpProbeAvailable} —— 只有 `present` 才 `'yes'`;`absent` ⇒ `'no'`;
28
- * 其余 ⇒ `'unknown'`(端按 501 试探,不预判)。
29
- */
30
- import { engineWireTarget } from './engineWireTarget.js';
31
- import { createEngineCapReader } from './engineCapReader.js';
32
- /**
33
- * 探测口在这台引擎上不可用时的 501 错误码(逐字)。
34
- *
35
- * 🔴 它与本位的 `absent` 是**同一件事的两面**(同一个谓词):端读到 `absent` 就不必发那一发请求,
36
- * 读到 `unknown` 就发出去、按这个码兜。消费点按**恰等**判,绝不放宽成 `capability.` 前缀
37
- * (`capability.*` 是开集,别的成员处置不同)。
38
- */
39
- export const MCP_INJECTION_REQUIRED_CODE = 'capability.mcp_injection_required';
40
- /**
41
- * caps 回体 → 本格读数;**畸形一律 `undefined`**(= 这一格不写 ⇒ 读口答 `unobserved`)。
42
- *
43
- * 🔴 键缺席(`hasOwn` 为假,或显式 `undefined`)⇒ `not_reported`;`false` ⇒ `absent`;`true` ⇒ `present`;
44
- * 其余一切值 ⇒ `undefined`。三条路互不折叠。
45
- * 🔴 值**只读一次**(校验与分臂同一次读):变化的 getter 会让校验读到布尔、分臂读到别的东西。
46
- */
47
- export function projectMcpProbeCapability(caps) {
48
- if (caps === null || typeof caps !== 'object')
49
- return undefined;
50
- const c = caps;
51
- if (!Object.hasOwn(c, 'mcpProbe'))
52
- return { kind: 'not_reported' };
53
- const v = c.mcpProbe;
54
- if (v === undefined)
55
- return { kind: 'not_reported' };
56
- if (typeof v !== 'boolean')
57
- return undefined;
58
- return v ? { kind: 'present' } : { kind: 'absent' };
59
- }
60
- /**
61
- * 本格的 per-baseUrl 读账 + tee / 读口 / 失效口 / 测试钩四口 —— 七只能力位读器**共用同一份实现**
62
- * ({@link createEngineCapReader});本文件只留这一格真正不同的部分:投影函数 {@link projectMcpProbeCapability}、doctor 措辞表,以及本位自己的判据助手(如有)。
63
- * 🔴 Map 在工厂闭包里,**一只读器一张**:收到读不懂的回体只删自己这一格,绝不连坐别的能力面。
64
- */
65
- const reader = createEngineCapReader({
66
- name: 'mcpProbe',
67
- project: projectMcpProbeCapability,
68
- makeUnobserved: () => ({ kind: 'unobserved' }),
69
- });
70
- /**
71
- * 宿主 caps probe 的**读面 tee** 落点(与六只兄弟并列)。绝不 throw —— 读面腿不许反噬 caps 探测链。
72
- * 投影 `undefined`(畸形)或投影抛出 ⇒ 这一格**被删**,不留上一台引擎的旧读数;`opts.generation` 关掉
73
- * 「旧探测覆盖新读数」那条竞态(宿主在起探测那一刻 `engineCapsGeneration(baseUrl)` 抓号、在这里原样交回;
74
- * 不传 ⇒ 与本位到货之前逐字节同行为)。
75
- */
76
- export function noteEngineCapsForMcpProbe(baseUrl, caps, opts) {
77
- reader.note(baseUrl, caps, opts);
78
- }
79
- /** 本进程观测到的探测口姿态;这一格空缺 ⇒ `{kind:'unobserved'}`(**绝不**折成 `absent`)。 */
80
- export function observedMcpProbe(baseUrl = engineWireTarget()?.baseUrl) {
81
- return reader.observed(baseUrl);
82
- }
83
- /**
84
- * 「MCP 探测口能不能用」的判据单源(三态):只有引擎明说在场(`present`)才 `'yes'`;明说不在(`absent`)⇒ `'no'`;
85
- * 老 server / 从没观测 ⇒ `'unknown'`(端**按 501 试探,不预判** —— 把 unknown 当 no 会藏掉一台真能探测的引擎)。
86
- */
87
- export function mcpProbeAvailable(reading) {
88
- if (reading.kind === 'present')
89
- return 'yes';
90
- if (reading.kind === 'absent')
91
- return 'no';
92
- return 'unknown';
93
- }
94
- /**
95
- * 四态 → doctor 那一行的 detail 串。**唯一措辞真源**(三端共用一句话;端只拼接不另写)。
96
- * 🔴 四句话刻意**互不相同、也互不蕴含**:「未观测」「老引擎不报」两种「读不出」都**不等于**「探测口不在」;
97
- * `absent` 那一句既要说不可用、又**不许**推因由(多租户 / 车道未 wired wire 上不可分)。
98
- */
99
- export function mcpProbeDoctorDetail(reading) {
100
- switch (reading.kind) {
101
- case 'unobserved':
102
- return ('MCP probe face not observed — the engine reports it on /v1/capabilities (mcpProbe); ' +
103
- 'this process has no usable capabilities reading cached for it (none received, or the last one was unreadable)');
104
- case 'not_reported':
105
- return ('MCP probe face not reported by this engine — only newer engines advertise it; ' +
106
- 'this does not say whether the probe endpoint exists, so probe it directly');
107
- case 'absent':
108
- return ('MCP probe face off on this deployment — the engine refuses injected MCP servers on this lane ' +
109
- `(either a multi-tenant posture or an unwired MCP lane; the wire does not say which), so the probe endpoint is unavailable and answers 501 ${MCP_INJECTION_REQUIRED_CODE}`);
110
- case 'present':
111
- return 'MCP probe face on — the MCP probe endpoint is available on this engine';
112
- }
113
- }
114
- /**
115
- * **换代失效口**(与六只兄弟的同名口并列,由宿主在引擎温切成功后调):清成未观测,不是留旧值也不是铸一个
116
- * `absent`。空串 / `undefined` ⇒ no-op;绝不 throw(它跑在引擎温切路径上)。
117
- */
118
- export function forgetMcpProbeReading(baseUrl) {
119
- reader.forget(baseUrl);
120
- }
121
- /** 测试钩子(只清本只读器的读账:不动装好的 wire 读锚、不动 caps 缓存的代际号、不动别只读器的表)。 */
122
- export function __resetMcpProbeReadingsForTests() {
123
- reader.__resetForTests();
124
- }