@sema-agent/sdk 28.1.0 → 29.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +66 -1
  2. package/dist/errors.d.ts +9 -4
  3. package/dist/errors.d.ts.map +1 -1
  4. package/dist/errors.js +9 -4
  5. package/dist/errors.js.map +1 -1
  6. package/dist/events.d.ts +3 -9
  7. package/dist/events.d.ts.map +1 -1
  8. package/dist/index.d.ts +3 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +2 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/model-route-env/index.d.ts +9 -5
  13. package/dist/model-route-env/index.d.ts.map +1 -1
  14. package/dist/model-route-env/index.js +16 -7
  15. package/dist/model-route-env/index.js.map +1 -1
  16. package/dist/resources/approvals.d.ts +2 -0
  17. package/dist/resources/approvals.d.ts.map +1 -1
  18. package/dist/resources/approvals.js.map +1 -1
  19. package/dist/resources/memory.d.ts +2 -2
  20. package/dist/resources/memory.js +2 -2
  21. package/dist/resources/rules.d.ts +3 -2
  22. package/dist/resources/rules.d.ts.map +1 -1
  23. package/dist/resources/rules.js.map +1 -1
  24. package/dist/resources/runs.d.ts +2 -1
  25. package/dist/resources/runs.d.ts.map +1 -1
  26. package/dist/resources/runs.js +2 -1
  27. package/dist/resources/runs.js.map +1 -1
  28. package/dist/resources/sessions.d.ts +1 -1
  29. package/dist/resources/sessions.js +1 -1
  30. package/dist/resources/tool-approvals.d.ts +22 -15
  31. package/dist/resources/tool-approvals.d.ts.map +1 -1
  32. package/dist/resources/tool-approvals.js +28 -13
  33. package/dist/resources/tool-approvals.js.map +1 -1
  34. package/dist/types.d.ts +76 -31
  35. package/dist/types.d.ts.map +1 -1
  36. package/dist/types.js +7 -0
  37. package/dist/types.js.map +1 -1
  38. package/openapi.yaml +156 -50
  39. package/package.json +2 -2
package/openapi.yaml CHANGED
@@ -3591,6 +3591,9 @@ paths:
3591
3591
  by pointing at deny), but DENY answers `200 { taskId, status: "failed", decision: "deny" }`: the card is voided under its own scope CAS and leaves the pending queue and the
3592
3592
  `/v1/approvals/stream` snapshot, the child ends `failed`, the gated tool never runs, no `remember` is granted; a lost void CAS is the existing 409 `decide.gate_moved`. Branch on
3593
3593
  `status` / `errorCode`, not on the sentence.
3594
+ server >= 7.138.0 — only the no-root-session-anchor form remains: the engine names every new row (an unnamed call gets `agent-<12 hex>`) and reads an older unnamed row
3595
+ under the same derived name, so an unnamed child's card revives (approve runs the action, deny reaches the child as a refusal); the void receipt also carries
3596
+ `decisionCommitted: true` (plus `checkpointId` when the selected gate has one).
3594
3597
  content:
3595
3598
  application/json:
3596
3599
  schema: { $ref: '#/components/schemas/ResumeLegConflictError' }
@@ -7523,7 +7526,8 @@ components:
7523
7526
  `acceptEdits` (in-workspace writes do not ask) or `bypassPermissions` (422 `request.host_posture_refused` on hosted
7524
7527
  deployments) for the old no-ask posture. `auto` arms iff `permissionMode === "auto"` ∧ a classifier seat is mounted ∧
7525
7528
  `caps.autoMode !== false` (one polarity); when the requested mode does not take effect the stream gets `engine_notice`
7526
- `config.permission_mode_unavailable`. `bypassPermissions` RELEASES the releasable ask classes (nine on every face from server >= 7.127.0; ten on
7529
+ `config.permission_mode_unavailable`. `bypassPermissions` RELEASES the releasable ask classes (ten on every face from server >= 7.138.0, the tenth being `write_protection_on_disk`; nine on every face on
7530
+ server 7.127.0–7.137.x; ten on
7527
7531
  server 7.115.0–7.126.x, where the extra one is `rule_unreadable`; `unstated`, a server-tool call nobody stated, is releasable from server >= 7.115.0)
7528
7532
  and DISCLOSES each (`tool_end.gate.disposition.released` + one `engine_notice` `permission.ask_released_by_mode` per (mode, class) per run);
7529
7533
  immune classes (deployment-authored, ask / org rules, hooks, ancestors, questions …) still ask; a write whose protection
@@ -11491,38 +11495,70 @@ components:
11491
11495
  description: "Opt-in to the evidence-capability-ABSENT degradation lane — a human signature; never injected. Non-boolean ⇒ 400 `request.field_invalid`."
11492
11496
 
11493
11497
  MemoryErasedBinding:
11494
- description: "core `ErasedBinding` — one erased row's coordinates (the snapshot's tagged binding law, without the account-trace extras)."
11498
+ description: "core `ErasedBinding` — one erased row's coordinates: the scope it was bound in, NEVER its file name (a model-chosen name can restate the content being erased; attestation v2)."
11495
11499
  oneOf:
11496
11500
  - type: object
11497
- required: [state, scope, slug]
11501
+ required: [state, scope]
11498
11502
  additionalProperties: true
11499
11503
  properties:
11500
11504
  state: { type: string, enum: [bound] }
11501
11505
  scope: { type: string }
11502
- slug: { type: string }
11503
11506
  - type: object
11504
11507
  required: [state]
11505
11508
  additionalProperties: true
11506
11509
  properties:
11507
11510
  state: { type: string, enum: [unbound] }
11508
11511
 
11512
+ MemoryErasureCarrierAnswer:
11513
+ description: >
11514
+ core `ErasureCarrierAnswer` — one carrier class's answer: what this call removed and what is known to remain, or
11515
+ `unverified` when the answering lane cannot read that class (which never reads as clean).
11516
+ oneOf:
11517
+ - type: object
11518
+ required: [removed, remaining]
11519
+ additionalProperties: true
11520
+ properties:
11521
+ removed: { type: integer, minimum: 0 }
11522
+ remaining: { type: integer, minimum: 0 }
11523
+ - type: object
11524
+ required: [unverified]
11525
+ additionalProperties: true
11526
+ properties:
11527
+ unverified: { type: boolean, enum: [true] }
11528
+
11529
+ MemoryErasureCountAnswer:
11530
+ description: "core `ErasureCountAnswer` — a store-level count that does not decide `status`; `unverified` when the lane cannot count."
11531
+ oneOf:
11532
+ - type: object
11533
+ required: [count]
11534
+ additionalProperties: true
11535
+ properties:
11536
+ count: { type: integer, minimum: 0 }
11537
+ - type: object
11538
+ required: [unverified]
11539
+ additionalProperties: true
11540
+ properties:
11541
+ unverified: { type: boolean, enum: [true] }
11542
+
11509
11543
  MemoryErasureAttestation:
11510
11544
  type: object
11511
11545
  description: >
11512
11546
  200 body of POST /v1/memory/erase — core `MemoryErasureAttestation` ITSELF, the deliverable a compliance
11513
- caller archives. Every claim is black-box re-checkable.
11547
+ caller archives; this schema describes version 2 ONLY (server >= 7.138.0). Every claim is black-box re-checkable,
11548
+ and it names ids, scopes, revs, sessions and counts — never a file name or entry text. A server <= 7.137.x answers
11549
+ the previous generation (`v: 1`), which this schema does not describe: read `v` and refuse anything but 2.
11514
11550
  🔴 READ `evidenceCapability` BEFORE DECIDING WHETHER A RETRY IS SAFE — the two legs have different
11515
- contracts (see the endpoint description). OPEN for the same reason as `EntryProvenanceAccount`.
11551
+ contracts (see the endpoint description; `residuals.replay` says the same). OPEN for the same reason as `EntryProvenanceAccount`.
11516
11552
  required: [v, requestId, at, status, evidenceCapability, custodyState, select, selectHash, resolvedIds, erased, notFound, conflicts, residuals]
11517
11553
  additionalProperties: true
11518
11554
  properties:
11519
- v: { type: integer, enum: [1], description: 'Version envelope — a consumer reading `v > 1` must refuse, never reinterpret.' }
11555
+ v: { type: integer, enum: [2], description: 'Version envelope — this schema describes `v: 2` only; a consumer reading any other value must refuse, never reinterpret.' }
11520
11556
  requestId: { type: string }
11521
11557
  at: { type: integer }
11522
11558
  status:
11523
11559
  type: string
11524
11560
  enum: [complete, partial]
11525
- description: '`complete` ⇔ conflicts empty ∧ every pinned id ∈ erased ∪ erasedPreviously ∪ (notFound with `custodyState === "complete"`). Everything else is `partial` (a replay converges it).'
11561
+ description: '`complete` ⇔ conflicts empty ∧ every pinned id ∈ erased ∪ erasedPreviously ∪ (notFound with `custodyState === "complete"`) ∧ every `residuals.carriers` class answers `remaining: 0` (one predicate for both lanes). Its reach is THIS store and the selected ids (an entry restating an erased one is counted on `residuals.derivedEntries` and does not decide it). Everything else is `partial`; a replay converges the classes the lane can clear and says when it cannot (`unverified`, or `evidenceBinding.remaining`).'
11526
11562
  evidenceCapability:
11527
11563
  type: string
11528
11564
  enum: [journal, none]
@@ -11562,7 +11598,7 @@ components:
11562
11598
  historyUnknown: { type: boolean, enum: [true] }
11563
11599
  erasedPreviously:
11564
11600
  type: array
11565
- description: 'Chain-read rows: an origin-ABSENT delete row carrying THIS requestId. Present only when non-empty; never produced in `none` mode or over a damaged chain.'
11601
+ description: 'Chain-read rows: an origin-ABSENT delete row carrying THIS requestId (another request''s delete of the id answers notFound, never a claim). Present only when non-empty; never produced in `none` mode or over a damaged chain. Version 2 carries no `from` — locate erased entries by your own requestId.'
11566
11602
  items:
11567
11603
  type: object
11568
11604
  required: [id, ev, at]
@@ -11571,13 +11607,6 @@ components:
11571
11607
  id: { type: string }
11572
11608
  ev: { type: string }
11573
11609
  at: { type: integer }
11574
- from:
11575
- type: object
11576
- required: [scope, slug]
11577
- additionalProperties: true
11578
- properties:
11579
- scope: { type: string }
11580
- slug: { type: string }
11581
11610
  conflicts:
11582
11611
  type: array
11583
11612
  description: 'Per-id PLANNING-stage faults (io/plan errors under the lock — there is no CAS loser inside a single lock span). Non-fatal; a replay converges them.'
@@ -11590,12 +11619,39 @@ components:
11590
11619
  reason: { type: string }
11591
11620
  residuals:
11592
11621
  type: object
11593
- required: [quarantineHits, quarantineOpaque, propagation]
11622
+ required: [carriers, quarantineUnattributed, derivedEntries, replay, propagation]
11594
11623
  additionalProperties: true
11595
11624
  properties:
11596
- quarantineHits: { type: array, items: { type: string }, description: 'Quarantine files whose frontmatter id is in the pinned set (PRESERVE-NOT-DELETE: the attestation enumerates, an explicit second action clears).' }
11597
- quarantineOpaque: { type: integer, description: 'Quarantine files that could not be attributed (fragments / non-entry shapes) — the honest BOUND of the enumeration.' }
11598
- indexUncleared: { type: array, items: { type: string }, description: 'Derived MEMORY.md index files that may STILL carry a line naming an erased entry (the erase-time sweep could not read or rewrite them). Present only when non-empty.' }
11625
+ carriers:
11626
+ type: object
11627
+ description: >
11628
+ Every carrier class of core `ERASURE_CARRIER_CLASSES`, each answered (`projection` — the entry's files under its scope home;
11629
+ `shadow` — the control plane's committed copy; `indexLine` — MEMORY.md lines naming a deleted projection path, answered by the
11630
+ engine's sweep; `quarantineCopy` — quarantine files whose frontmatter id is the erased id; `planArchive` / `planWorkbook` — the
11631
+ consolidation plane's mint archive and plan workbook; `evidenceBinding` — evidence-chain rows that still spell the entry's file
11632
+ name, which the append-only chain keeps, so they keep the request `partial` and a replay cannot clear them; `backendDerived` —
11633
+ anything a backend derives privately).
11634
+ required: [projection, shadow, indexLine, quarantineCopy, planArchive, planWorkbook, evidenceBinding, backendDerived]
11635
+ additionalProperties: true
11636
+ properties:
11637
+ projection: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11638
+ shadow: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11639
+ indexLine: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11640
+ quarantineCopy: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11641
+ planArchive: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11642
+ planWorkbook: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11643
+ evidenceBinding: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11644
+ backendDerived: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
11645
+ quarantineUnattributed:
11646
+ allOf: [{ $ref: '#/components/schemas/MemoryErasureCountAnswer' }]
11647
+ description: 'Quarantine files no id could be read from (fragments / non-entry shapes) — the honest bound of the quarantine read; does not decide `status`.'
11648
+ derivedEntries:
11649
+ allOf: [{ $ref: '#/components/schemas/MemoryErasureCountAnswer' }]
11650
+ description: "Committed entries outside the selection whose consolidation lineage names an erased id (they may restate it) — counted, not erased; their closure is the caller's to compute."
11651
+ replay:
11652
+ type: string
11653
+ enum: [converges, unsupported]
11654
+ description: '`converges` = the evidence lane (a replay of the same requestId converges); `unsupported` = the degraded lane (a re-send is a new request).'
11599
11655
  propagation:
11600
11656
  type: string
11601
11657
  enum: [local-store-only]
@@ -14716,14 +14772,14 @@ components:
14716
14772
  face adds `errorCode` / `httpStatus` / `delivered` / `transportClosed`. Folding them would make the
14717
14773
  panel's consumers wait for four keys that never come.
14718
14774
  🔴 BRANCH ON THE MACHINE FIELDS, NEVER PARSE `reason`: `errorCode` is core's `McpFailureKind` word
14719
- (owner is the engine — switch with a default arm, do not narrow), `httpStatus` 401 is a re-authorize
14720
- door, `spawn_failed` is a missing binary.
14775
+ (owner is the engine — switch with a default arm, do not narrow), `unauthorized` is a re-authorize
14776
+ door (server >= 7.138.0; on older servers `http_status` with `httpStatus` 401), `spawn_failed` is a missing binary.
14721
14777
  required: [name, status]
14722
14778
  properties:
14723
14779
  name: { type: string }
14724
14780
  status: { type: string, description: 'connected | failed (open set — the word table owner is the engine).' }
14725
14781
  errorCode: { type: string, description: 'core `McpFailureKind`. Open set; switch with a default arm.' }
14726
- httpStatus: { type: integer, description: 'Only alongside errorCode `http_status` (401/403 = re-authorize; 5xx = that end is down). ABSENT rather than 0.' }
14782
+ httpStatus: { type: integer, description: 'Only alongside errorCode `http_status` (5xx = that end is down; from server >= 7.138.0 a 401, and a 403 with an `insufficient_scope` challenge, are errorCode `unauthorized` without this key). ABSENT rather than 0.' }
14727
14783
  delivered: { type: string, enum: [yes, no, unknown], description: 'Did the request reach that server — read together with errorCode.' }
14728
14784
  serverInfo:
14729
14785
  type: object
@@ -15835,7 +15891,9 @@ components:
15835
15891
  type: { const: tool_start }
15836
15892
  toolCallId: { type: string }
15837
15893
  toolName: { type: string }
15838
- requestedBy: { type: object, additionalProperties: false, required: [kind, name], properties: { kind: { type: string, enum: [extension] }, name: { type: string } }, description: 'server >= 7.138.0 (core 7.56.0 `ExtensionRequester`): this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages); `name` = that registration (registrant text, UNTRUSTED-for-display). Absent = model-initiated.' }
15894
+ requestedBy:
15895
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
15896
+ description: 'server >= 7.138.0: this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages). Absent = model-initiated.'
15839
15897
  # 🔴 census 轴一(2026-07-30)回填:server 白名单 builder `toolStartEventData`(trace/project.ts)
15840
15898
  # 真发 `label`(core 展示名,与 tool_end 同待遇),spec 此前漏声明 —— 封闭前必须先补,否则真帧变假红。
15841
15899
  label: { type: string, description: 'core 展示名(缺席 ⇒ 用 toolName 渲染)。' }
@@ -15886,10 +15944,10 @@ components:
15886
15944
  # 每只闭集 = 引擎今天的词 ∪ 引擎退役词表里那一集。这五张 enum 与引擎 `RETIRED_MEMBERS` 逐集逐词同(由 `server-7129-wire` 对拍);卡面 / 队列行 / 请求面的同名闭集只取今天的词。
15887
15945
  GateRecordAskClass:
15888
15946
  type: string
15889
- enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary, write_protection_unresolved, governance_unavailable]
15947
+ enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection_on_disk, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary, write_protection_unresolved, governance_unavailable]
15890
15948
  description: >-
15891
15949
  The class word on a GATE RECORD (`tool_end.gate.disposition.askClass` / `.classes` on the mode-refusal arm, `ModeRelease.askClass` / `.classes`) — server >= 7.129.0 reads the record as an ARCHIVE:
15892
- today's `AskClass` set (twenty-six words; `cross_boundary` from server >= 7.134.0) PLUS the words the engine retired (`write_protection_unresolved`, retired in core 7.49.0 — renamed `target_unresolved`; `governance_unavailable`,
15950
+ today's `AskClass` set (twenty-seven words; `write_protection_on_disk` from server >= 7.138.0, `cross_boundary` from server >= 7.134.0) PLUS the words the engine retired (`write_protection_unresolved`, retired in core 7.49.0 — renamed `target_unresolved`; `governance_unavailable`,
15893
15951
  retired in core 7.51.0 — merged into `rule_unreadable`). A record the previous engine generation legally wrote is replayed byte for byte (a 7.50.x mode refusal can carry `governance_unavailable`);
15894
15952
  a word NO engine generation ever minted (a case variant, the empty string, a future word) withholds the whole `gate` and counts `server.trace.gate-outcome-defective`.
15895
15953
  Render a known archive word normally and an unknown one generically; never drop the record because the word is not in today's set.
@@ -16146,9 +16204,10 @@ components:
16146
16204
  `UNATTENDED_PERMISSION_MODE=dontAsk`).
16147
16205
  AskClass:
16148
16206
  type: string
16149
- enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary]
16207
+ enum: [content_question, hook, ancestor, dangerous_delete, unverifiable_delete, unverifiable_shell_text, transcript_write, org_rule, rule_unreadable, ask_rule, denial_limit_fallback, classifier_no_ruling, requires_user_interaction, cross_boundary, operator_forced, shell_floor, target_unresolved, probe, write_protection_on_disk, write_protection, tool_marks_mcp, tool_marks_a2a, policy_rra, artifact_shared_read, mode, unstated, ordinary]
16150
16208
  description: >
16151
- core `ASK_CLASSES` (TWENTY-SIX words as of core 7.54.0 / server >= 7.134.0: `cross_boundary` joined after `requires_user_interaction` — the device lane's
16209
+ core `ASK_CLASSES` (TWENTY-SEVEN words as of core 7.58.0 / server >= 7.138.0: `write_protection_on_disk` joined after `probe`, before `write_protection` — see below;
16210
+ TWENTY-SIX as of core 7.54.0 / server >= 7.134.0: `cross_boundary` joined after `requires_user_interaction` — the device lane's
16152
16211
  cross-boundary confirmation, see below; TWENTY-FIVE as of core 7.51.0 / server >= 7.129.0: `governance_unavailable` was merged into `rule_unreadable`, no alias — sdk 23.0.0; a stored card / parked row written by server <= 7.128.x is rewritten once by the server at boot. The gate record reads the ARCHIVE form, see `GateRecordAskClass`. History: twenty-two words as of core 7.40.0, twenty-three as of core 7.41.0, twenty-four as of core 7.43.0, twenty-five as of core 7.45.0, twenty-six as of core 7.49.0 — 7.34.0 minted twenty; `unverifiable_shell_text` joined in 7.49.0 #1505 and rides server >= 7.126.0, where the
16153
16212
  unresolved-write-target class was also RENAMED to `target_unresolved` (#955; zero alias — the previous spelling is in the SDK README's 22.0.0 migration table); `shell_floor` joined in 7.39.0 #1260 and rides
16154
16213
  server >= 7.113.0; `unstated` joined in 7.40.0 and rides server >= 7.115.0; `requires_user_interaction` joined in 7.41.0 and rides
@@ -16186,11 +16245,19 @@ components:
16186
16245
  but it has not been granted yet.`), and with no approval surface the call is refused. It is clearable (a RELEASABLE
16187
16246
  class: an allow rule — `settings.permissions.allow` / operator `APPROVAL_GRANT` — an explicit hook `permissionDecision: "allow"`, the auto-mode
16188
16247
  classifier or `bypassPermissions` clears it); under `plan` only READ-ONLY server tools raise it.
16248
+ `write_protection_on_disk` (core 7.58.0, server >= 7.138.0) = a write whose target reaches the write-protection table only where its path RESOLVES ON DISK — the path as
16249
+ written names no row, its real target or a link on the way does (an innocent spelling the disk carries onto a guarded path). It and `write_protection` (the path as written
16250
+ names a row) are the two readings of one table hit, judged per written target and never both for one target; a command writing several targets may carry both. Its
16251
+ arbitration row is `write_protection`'s save the classifier column: the auto-mode classifier does NOT answer it (a person does); `bypassPermissions` releases it (a
16252
+ RELEASABLE class), `dontAsk` refuses it, and no standing allow rule clears it — confirming this call does.
16189
16253
  `shell_floor` = the operator's `shellGate: "always"` floor on a shell-running seat (the question the `operator_always` mandate
16190
16254
  word discloses), a class of its own so a set that holds another forced question still holds it; like `operator_forced` it is
16191
16255
  bypass-IMMUNE (not releasable).
16192
- CLOSED: the card / queue-row / request faces carry exactly today's twenty-five words; the GATE RECORD (`tool_end.gate` and the replay faces) carries today's words PLUS the engine's retired words (`GateRecordAskClass`). `bypassPermissions` releases only the RELEASABLE classes (core
16193
- `releasableAskClassesFor(face)`). Server >= 7.127.0 (core 7.50.0): nine on every face (`transcript_write` / `probe` / `write_protection` /
16256
+ CLOSED: the card / queue-row / request faces carry exactly today's twenty-seven words; the GATE RECORD (`tool_end.gate` and the replay faces) carries today's words PLUS the engine's retired words (`GateRecordAskClass`). `bypassPermissions` releases only the RELEASABLE classes (core
16257
+ `releasableAskClassesFor(face)`). Server >= 7.138.0 (core 7.58.0): ten on every face (`transcript_write` / `probe` / `write_protection_on_disk` / `write_protection` /
16258
+ `tool_marks_mcp` / `tool_marks_a2a` / `artifact_shared_read` / `mode` / `unstated` / `ordinary` — one more than the generation before, `write_protection_on_disk`) plus an
16259
+ eleventh on the SHELL face only, `target_unresolved` (shell 11, other faces 10 again, with a different tenth class than 7.122.0–7.126.x).
16260
+ Server 7.127.0–7.137.x (core 7.50.0–7.56.x): nine on every face (`transcript_write` / `probe` / `write_protection` /
16194
16261
  `tool_marks_mcp` / `tool_marks_a2a` / `artifact_shared_read` / `mode` / `unstated` / `ordinary`) plus a tenth on the SHELL face only,
16195
16262
  `target_unresolved` (shell 10, other faces 9; on the file tools that class is refused, `deniedBy: mode`); `rule_unreadable` is no longer released
16196
16263
  by any mode (bypass asks too, and the run gets one `permission.rule_store_unavailable` notice). Server 7.122.0–7.126.x (core 7.47.0–7.49.x) also
@@ -16454,7 +16521,9 @@ components:
16454
16521
  type: { const: tool_end }
16455
16522
  toolCallId: { type: string }
16456
16523
  toolName: { type: string }
16457
- requestedBy: { type: object, additionalProperties: false, required: [kind, name], properties: { kind: { type: string, enum: [extension] }, name: { type: string } }, description: 'server >= 7.138.0 (core 7.56.0 `ExtensionRequester`): this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages); `name` = that registration (registrant text, UNTRUSTED-for-display). Absent = model-initiated.' }
16524
+ requestedBy:
16525
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
16526
+ description: 'server >= 7.138.0: this call was initiated by an extension registration through `$.tool.call` (appears only when the deployment seat mounted operator-declared packages). Absent = model-initiated.'
16458
16527
  answeredBy: { type: string, description: 'server >= 7.138.0 (core 7.56.0): the registration that stood in for the tool body at the `tool.call` station with its own result or refusal (always beside `notExecuted: true`). Absent = no extension answered for the call.' }
16459
16528
  # 🔴 census 轴一(2026-07-30)回填:`toolEndEventData`(trace/project.ts)真发 `label` 与
16460
16529
  # `structured`,spec 此前两者都漏 —— SDK 的 events.ts 早已声明,漂移只在 spec 这一侧。
@@ -16549,8 +16618,9 @@ components:
16549
16618
  `errorCode` and `structured.type`. It is an IN-ROOT question, not an out-of-root read (a read certainly outside the roots
16550
16619
  stays `readonly_out_of_root`).
16551
16620
  🔴 core >= 7.6.0 — the MCP family within this open set is now the CLOSED `McpFailureKind` word list
16552
- (`connect_refused` / `connection_failed` / `connection_closed` / `http_status` / `not_mcp_response` /
16553
- `spawn_failed` / `timeout` / `protocol` / `invalid_config` / `unknown`); the retired
16621
+ (`connect_refused` / `connection_failed` / `connection_closed` / `unauthorized` / `http_status` / `not_mcp_response` /
16622
+ `spawn_failed` / `timeout` / `protocol` / `invalid_config` / `credential_unavailable` / `unknown` — `credential_unavailable` from core 7.58.0 and
16623
+ `unauthorized` from core 7.59.0, server >= 7.138.0); the retired
16554
16624
  `MCP_FAILURE_CODES` spellings — including `network` and the `http_<status>` encoding — are gone,
16555
16625
  and an HTTP status now rides the structured `httpStatus` seat on `wiring_manifest.mcp[]` instead of
16556
16626
  being baked into the code. The set as a WHOLE stays open (a tool owns its own codes).
@@ -16837,9 +16907,10 @@ components:
16837
16907
  description: >
16838
16908
  Stable per-input id (also the durable steering queue idempotency key). server >= 7.113.0 (wire VALUE change): for a LIVE steer
16839
16909
  it is the receipt's `messageId` verbatim — keyless steers included (<= 7.112.0: an engine-minted uuid whenever no
16840
- `Idempotency-Key` was sent); with a key it is `idem-<sha256[:32]>` on both the live and the parked leg. 🚧 A keyless PARKED
16841
- steer is the exception (contract §19): the server passes no `inputId` with the parked entry, so this id does not join the
16842
- receipt's `messageId`.
16910
+ `Idempotency-Key` was sent); with a key it is `idem-<sha256[:32]>` on both the live and the parked leg. A keyless PARKED steer
16911
+ carries the receipt's `messageId` too from server >= 7.138.0 (the parked entry's `inputId` is that fresh uuidv7). 🚧 On server
16912
+ 7.113.0–7.137.x a keyless parked steer is the exception (contract §19): the server passes no `inputId` with the parked entry, so
16913
+ this id does not join the receipt's `messageId`.
16843
16914
  sessionSeq: { type: integer, description: 'Leg-scoped monotone sequence of human inputs.' }
16844
16915
  carrier: { type: string, description: 'Which carrier delivered it (steer / objective / a source word). Open on read.' }
16845
16916
  source: { type: string, description: 'objective | steer | next_turn | wake | external | system. Open on read.' }
@@ -18067,6 +18138,21 @@ components:
18067
18138
  source: { type: string }
18068
18139
  isNew: { type: boolean }
18069
18140
 
18141
+ ExtensionRequester:
18142
+ type: object
18143
+ additionalProperties: false
18144
+ required: [kind, name]
18145
+ description: >
18146
+ core `ExtensionRequester` (server >= 7.138.0) — who asked for a tool call no model message carried: an extension registration's own call
18147
+ (`$.tool.call`), by its registration name. A display and audit fact only: the call runs under the run's principal, rules, mode and approver,
18148
+ and the name decides nothing. One reading on every face that carries it (`tool_start` / `tool_end`, the live `tool_approval` frame and the
18149
+ presented `approval_request` frame's top level): the server passes the registration name through the registrant-text egress discipline, so the
18150
+ faces carry the same bytes; a malformed value is dropped, never repaired. `kind` is `extension` today (a new requester class is an engine
18151
+ release plus a new member here).
18152
+ properties:
18153
+ kind: { type: string, enum: [extension] }
18154
+ name: { type: string, minLength: 1, description: 'The registration name (registrant text, UNTRUSTED-for-display).' }
18155
+
18070
18156
  ToolApprovalFrame:
18071
18157
  type: object
18072
18158
  description: >
@@ -18215,6 +18301,14 @@ components:
18215
18301
  (absent != "no reason"). PRESENT ONLY WHEN IT HAS A VALUE (never an empty string) and ONLY ON THE LIVE card frame —
18216
18302
  the presented frame (`approval_request`) and the durable card (`card_json`) do NOT carry it (the durable twin is
18217
18303
  `gate.riskDescriptor.probeReason` on the parked row). Display / triage metadata, never an adjudication input; never in `message`.
18304
+ requestedBy:
18305
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
18306
+ description: >
18307
+ server >= 7.138.0, ADDITIVE, "tool_approval" only: the call this ask is about was initiated by an extension registration itself
18308
+ (`$.tool.call`; core `AskRequest.requestedBy`) — the provenance of the card's "extension X wants to run …" line. Same reading as the
18309
+ key of the same name on `tool_start` / `tool_end`. Absent on calls a model message carried; reachable once the deployment seat mounts
18310
+ operator-declared packages. Display fact, never an adjudication input. The presented frame (`approval_request`) carries it on its top
18311
+ level with the same value (one of its off-card live facts); the durable card (`card_json`) does not, and a disconnect-replay frame never does.
18218
18312
  ruleEvidence:
18219
18313
  type: object
18220
18314
  description: >
@@ -18565,7 +18659,7 @@ components:
18565
18659
  The id of POST /v1/tool-approvals/{id}/respond and GET /v1/tool-approvals/{id}. server >= 7.133.0: ALWAYS EQUAL TO `askId` (the row's key is the ask's one wire
18566
18660
  identity; a 64-character lowercase hexadecimal string — treat it as an OPAQUE string, never parse it as a uuid); the matching close frame `approval_complete` carries it too.
18567
18661
  On server <= 7.132.x it is the legacy bridge / dedupe key (a uuid, the same value as the parallel tool_approval frame).
18568
- # ── server >= 7.133.0: the TEN off-card LIVE facts on the opening frame's top level (one frame family per leg) ──────────────────────────
18662
+ # ── server >= 7.133.0: the off-card LIVE facts on the opening frame's top level (ELEVEN from server >= 7.138.0 — `requestedBy` joined; ten on 7.133.0–7.137.x) (one frame family per leg) ──────────────────────────
18569
18663
  # Same keys, same shapes, same values as on the legacy `tool_approval` frame (each is a `$ref` into ToolApprovalFrame's own property — one
18570
18664
  # source per shape). Only the frame minted LIVE carries them (and what the durable ledger recorded of that frame): a disconnect-replay frame
18571
18665
  # (rebuilt from `card_json`) never does. Absence means "this frame does not carry it", not "there is none". See APPROVAL_REQUEST_LIVE_FACT_KEYS (sdk) / the server's twin.
@@ -18579,6 +18673,7 @@ components:
18579
18673
  approvalCard: { $ref: '#/components/schemas/ToolApprovalFrame/properties/approvalCard' }
18580
18674
  readRootCandidate: { $ref: '#/components/schemas/ToolApprovalFrame/properties/readRootCandidate' }
18581
18675
  probeReason: { $ref: '#/components/schemas/ToolApprovalFrame/properties/probeReason' }
18676
+ requestedBy: { $ref: '#/components/schemas/ToolApprovalFrame/properties/requestedBy' }
18582
18677
 
18583
18678
  ApprovalCard:
18584
18679
  type: object
@@ -18910,13 +19005,16 @@ components:
18910
19005
  `subdomain` (server >= 7.126.0 / core 7.49.0 #1365) = the `WebFetch` domain grammar: `WebFetch(domain:<host>)` one exact
18911
19006
  host, `WebFetch(domain:*.<domain>)` every host under that domain — ALLOW rows only; the server's `Bash` card edit face
18912
19007
  always refuses these two words (no network grant is minted through a card). A replica rolled back to 7.125.x reads such a
18913
- row as a damaged row.
19008
+ row as a damaged row. `tool` (server >= 7.138.0 / core 7.57.0) = the WHOLE-TOOL form: a rule with no content (`SendUserFile`,
19009
+ `Bash`, `mcp__srv__get_issue`), `command` is the empty string, and it reaches every call that answers to the name it spells. A card
19010
+ offers it as `{ kind: single, rule: <tool name>, match: tool, command: "" }` on a tool no rule grammar speaks for (the service's own
19011
+ host tools, MCP tools) — render it as "don't ask again for this tool"; the card's edit face never mints a whole-tool rule.
18914
19012
 
18915
- 🔴 TEN MEMBERS, closed (server >= 7.135.0 / core 7.55.0 added `pattern`, between `wildcard` and `subpath` — the engine's order): the server validates the member on both faces. A consumer type narrower than the
19013
+ 🔴 ELEVEN MEMBERS, closed (server >= 7.135.0 / core 7.55.0 added `pattern`, between `wildcard` and `subpath`; server >= 7.138.0 added `tool`, last — the engine's order): the server validates the member on both faces. A consumer type narrower than the
18916
19014
  mint point is a lie — it lets a `switch` claim exhaustiveness the wire does not honour (SDK <= 16 declared
18917
19015
  four here, so a `path` offer and every 7.118.0 skill-card offer were dropped as malformed; SDK <= 21 declared
18918
- seven, so every domain grant row on `GET /v1/rules` was dropped the same way).
18919
- enum: [exact, prefix, wildcard, pattern, subpath, path, name, name_prefix, host, subdomain]
19016
+ seven, so every domain grant row on `GET /v1/rules` was dropped the same way; SDK <= 28 declared ten, so every 7.138.0 whole-tool offer was).
19017
+ enum: [exact, prefix, wildcard, pattern, subpath, path, name, name_prefix, host, subdomain, tool]
18920
19018
 
18921
19019
  RuleOfferUncoveredReason:
18922
19020
  type: string
@@ -19644,9 +19742,10 @@ components:
19644
19742
 
19645
19743
  SteerReplayFacet:
19646
19744
  type: string
19647
- enum: [text, trusted, priority, actor]
19745
+ enum: [text, trusted, priority, actor, runOrigin]
19648
19746
  description: >
19649
- core 7.44.0 #1374 `STEER_REPLAY_FACETS`, verbatim and in order — the facets on which a replayed steering input id differs from the
19747
+ core 7.44.0 #1374 `STEER_REPLAY_FACETS` (`runOrigin` joined in core 7.58.0 — the run origin the caller declared for the input; server 7.138.0 hands the engine
19748
+ no run origin, so that facet does not arrive from it), verbatim and in order — the facets on which a replayed steering input id differs from the
19650
19749
  accepted one. Carried as `detail.differs` (a non-empty subset, the engine's order) on 409 `steering.duplicate_input_id` (server >= 7.118.0):
19651
19750
  contains `text` ⇒ a different instruction, reissue with a fresh key; no `text` ⇒ the SAME instruction — do NOT change the key (it
19652
19751
  would queue twice), replay with the original values.
@@ -21375,8 +21474,12 @@ components:
21375
21474
  type: string
21376
21475
  description: >
21377
21476
  core >= 7.6.0 — the `McpFailureKind` word (`connect_refused` / `connection_failed` /
21378
- `connection_closed` / `http_status` / `not_mcp_response` / `spawn_failed` / `timeout` /
21379
- `protocol` / `invalid_config` / `unknown`). The retired 7.5.0 spellings — `network` and the
21477
+ `connection_closed` / `unauthorized` / `http_status` / `not_mcp_response` / `spawn_failed` / `timeout` /
21478
+ `protocol` / `invalid_config` / `credential_unavailable` / `unknown`; server >= 7.138.0: `unauthorized` = the principal must authorize this server
21479
+ first — the endpoint answered 401 (after the deployment's peer seat was asked once more) or a 403 with an `insufficient_scope` challenge, or the peer
21480
+ seat answered that the principal is not authorized here; earlier servers sent the first two as `http_status`; `credential_unavailable` = the
21481
+ deployment's peer seat did not furnish the request (it threw, did not answer in time, or answered something the engine cannot carry), so the
21482
+ request was not sent — a deployment fault, not a server outage). The retired 7.5.0 spellings — `network` and the
21380
21483
  `http_<status>` encoding — are GONE; an HTTP status now rides `httpStatus`.
21381
21484
  Deliberately NOT enumerated here: the vocabulary's single owner is the engine, and mirroring
21382
21485
  it would swallow a newly minted word as a violation. Switch with a `default` arm.
@@ -21387,8 +21490,9 @@ components:
21387
21490
  type: integer
21388
21491
  description: >
21389
21492
  core >= 7.6.0 (S6-B) — the status the endpoint answered with; rides ONLY with
21390
- `errorCode === "http_status"` (401/403 = re-authorize, 5xx = that end is down). ABSENT rather
21391
- than 0.
21493
+ `errorCode === "http_status"` (5xx = that end is down). ABSENT rather than 0. From server >= 7.138.0 (core 7.59.0) a 401, and a 403
21494
+ with an `insufficient_scope` challenge, are `errorCode: "unauthorized"` without this key — a reader that branched on `http_status` + 401
21495
+ to re-authorize reads `unauthorized` instead.
21392
21496
  liveness:
21393
21497
  allOf: [{ $ref: '#/components/schemas/McpServerLiveness' }]
21394
21498
  description: >
@@ -21596,7 +21700,8 @@ components:
21596
21700
  so a keyless live steer's `human_input.inputId` was an engine-minted uuid that never joined this receipt). So the
21597
21701
  `human_input` frame of that steer (`delivery: "applied"` / `"queued"`) carries `inputId === messageId`, and the user-input
21598
21702
  acceptance ledger (`userInputUndrained[].messageId`) is keyed by the same value. The PARKED legs: with a key,
21599
- `inputId === messageId` as before; 🚧 a KEYLESS parked steer (`delivery: "queued"` / `"parked_for_wake"`) is the documented
21703
+ `inputId === messageId` as before; a KEYLESS parked steer (`delivery: "queued"` / `"parked_for_wake"`) joins too from server
21704
+ >= 7.138.0 (the parked entry's `inputId` is this `messageId`). 🚧 On server 7.113.0–7.137.x the keyless parked steer is the documented
21600
21705
  exception (contract §19) — the server passes no `inputId` with the parked queue entry, so this `messageId` is never that entry's
21601
21706
  `inputId` and the later `human_input` frame does NOT join it.
21602
21707
  priority: { $ref: '#/components/schemas/SteerPriority' }
@@ -22779,9 +22884,10 @@ components:
22779
22884
  match:
22780
22885
  allOf: [{ $ref: '#/components/schemas/RuleOfferMatch' }]
22781
22886
  description: >
22782
- The match form — the same ten-member vocabulary as a card's rule offer (`RuleOfferMatch`, the server's
22887
+ The match form — the same eleven-member vocabulary as a card's rule offer (`RuleOfferMatch`, the server's
22783
22888
  `PERSISTED_RULE_MATCHES`): `exact` / `prefix` / `wildcard` / `pattern` (server >= 7.135.0: the mid-star command form) / `subpath` / `path`, and from server >= 7.118.0
22784
- `name` / `name_prefix` (a `Skill(<name>)` / `Skill(<prefix>:*)` rule).
22889
+ `name` / `name_prefix` (a `Skill(<name>)` / `Skill(<prefix>:*)` rule), from server >= 7.126.0 `host` / `subdomain` (a `WebFetch(domain:…)` allow row),
22890
+ from server >= 7.138.0 `tool` (a whole-tool row: no content, empty `command`, every call of that tool).
22785
22891
  command: { type: string, description: 'What the matcher actually compares against, parsed out of `rule` at mint time and stored so no consumer re-parses. Trust this + `match`, not your own parse of `rule`.' }
22786
22892
  adds:
22787
22893
  type: array
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/sdk",
3
- "version": "28.1.0",
3
+ "version": "29.0.0",
4
4
  "description": "Typed, zero-runtime-dependency SDK for the Sema agent fleet usage plane. The shared substrate for all doors (CC/Codex MCP façade + web). Server-side only — tokens never enter the browser.",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -55,6 +55,6 @@
55
55
  "prepublishOnly": "rm -f tsconfig.tsbuildinfo && npm run build && npm run typecheck --workspaces=false --prefix ../.. && npm test --workspaces=false --prefix ../.. && npm run prepack"
56
56
  },
57
57
  "devDependencies": {
58
- "@sema-agent/settings-schema": "^14.5.0"
58
+ "@sema-agent/settings-schema": "^14.7.0"
59
59
  }
60
60
  }