@sema-agent/sdk 15.1.1 → 15.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -0
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +31 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/runs.d.ts +9 -1
- package/dist/resources/runs.d.ts.map +1 -1
- package/dist/resources/runs.js +5 -1
- package/dist/resources/runs.js.map +1 -1
- package/dist/types.d.ts +49 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/openapi.yaml +116 -3
- package/package.json +1 -1
package/openapi.yaml
CHANGED
|
@@ -881,6 +881,17 @@ paths:
|
|
|
881
881
|
content:
|
|
882
882
|
application/json:
|
|
883
883
|
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
884
|
+
'503':
|
|
885
|
+
description: >-
|
|
886
|
+
errorCode "steering.ledger_unavailable" (server >=7.110.0, S-928) — the live-run path writes this
|
|
887
|
+
acceptance into the user-input ledger BEFORE answering 200 `applied` (so a process crash before the
|
|
888
|
+
run consumes it can be announced on the session's next run); the ledger could not be written (local
|
|
889
|
+
data root not writable / SQL unreachable). NOTHING reached the engine. Client action: retry the SAME
|
|
890
|
+
text later (same Idempotency-Key is fine — nothing was accepted); unlike every other `steering.*`
|
|
891
|
+
code this is not a content / key / resume problem. SDK: `SteeringLedgerUnavailableError`.
|
|
892
|
+
content:
|
|
893
|
+
application/json:
|
|
894
|
+
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
884
895
|
|
|
885
896
|
/v1/runs/{taskId}/interrupt:
|
|
886
897
|
parameters:
|
|
@@ -1002,6 +1013,16 @@ paths:
|
|
|
1002
1013
|
content:
|
|
1003
1014
|
application/json:
|
|
1004
1015
|
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
1016
|
+
'503':
|
|
1017
|
+
description: >-
|
|
1018
|
+
errorCode "steering.ledger_unavailable" (server >=7.110.0, S-928) — the text form rides the same
|
|
1019
|
+
engine verb as a live steer, so the same ledger write happens BEFORE the 202 `queued-immediate`; when
|
|
1020
|
+
the ledger cannot be written the interrupt is refused and NOTHING reached the engine (the bare halt
|
|
1021
|
+
carries no input and never takes this arm). Client action: retry the same text later. SDK:
|
|
1022
|
+
`SteeringLedgerUnavailableError`.
|
|
1023
|
+
content:
|
|
1024
|
+
application/json:
|
|
1025
|
+
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
1005
1026
|
|
|
1006
1027
|
/v1/runs/{taskId}/subagents/{target}/steer:
|
|
1007
1028
|
parameters:
|
|
@@ -1036,7 +1057,8 @@ paths:
|
|
|
1036
1057
|
responses:
|
|
1037
1058
|
'200':
|
|
1038
1059
|
description: >
|
|
1039
|
-
Queued/applied. Body `{ taskId, target, status, delivery, marker, note }`
|
|
1060
|
+
Queued/applied. Body `{ taskId, target, status, delivery, marker, note }` (+ `messageId` from server >= 7.111.0,
|
|
1061
|
+
see `SubagentSteerReceipt`) — `note` carries the
|
|
1040
1062
|
CC-verbatim "Message queued for delivery to <name> at its next tool round." receipt copy.
|
|
1041
1063
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
1042
1064
|
'404': { $ref: '#/components/responses/NotFound' }
|
|
@@ -1053,6 +1075,18 @@ paths:
|
|
|
1053
1075
|
description: 'errorCode "steer.content_too_large" — content over the per-steer cap; shorten and resend (retrying verbatim never succeeds).'
|
|
1054
1076
|
'429': { $ref: '#/components/responses/RateLimited' } # (declared 2026-07-31) rateLimited||quotaExceeded||leaseDenied all gate this verb (routes/runs.ts)
|
|
1055
1077
|
'501': { $ref: '#/components/responses/NotImplemented' }
|
|
1078
|
+
'503':
|
|
1079
|
+
description: >-
|
|
1080
|
+
errorCode "steering.ledger_unavailable" (server >=7.111.0, S-966) — a subagent steer enters the same
|
|
1081
|
+
user-input ledger as a run steer (ONE rule: the ledger covers an input whose receipt promised delivery and
|
|
1082
|
+
whose carrying engine stream lives in a run leg of this server), written BEFORE the 200; the ledger could not
|
|
1083
|
+
be written (local data root not writable / SQL unreachable). The subagent received NOTHING. Client action:
|
|
1084
|
+
retry the SAME content later. SDK: `SteeringLedgerUnavailableError`. The sibling `…/resume` verb never
|
|
1085
|
+
takes this arm (a resume starts a new child leg; it does not feed an in-flight queue). Before 7.111.0 this
|
|
1086
|
+
verb wrote no ledger row and never answered 503 for it.
|
|
1087
|
+
content:
|
|
1088
|
+
application/json:
|
|
1089
|
+
schema: { $ref: '#/components/schemas/ErrorResponse' }
|
|
1056
1090
|
|
|
1057
1091
|
/v1/runs/{taskId}/compact:
|
|
1058
1092
|
parameters:
|
|
@@ -7530,7 +7564,8 @@ components:
|
|
|
7530
7564
|
`wiring_manifest` frame — test with `'wiringManifest' in result`, never `=== undefined`). The run's
|
|
7531
7565
|
boot-time wiring receipt: the `wiring_manifest` frame (minted after wiring, before the first turn)
|
|
7532
7566
|
projected by the SAME projector as the streaming leg (tenant face strips operator-only sections; an
|
|
7533
|
-
explicit operator gets the full face
|
|
7567
|
+
explicit operator gets the full face; server >=7.111.0 carries the self-minted `instructions` section here
|
|
7568
|
+
too, same present-iff reading as `Event_wiring_manifest.instructions`). NOT current state — runtime roster changes ride
|
|
7534
7569
|
`tool_roster_delta` frames. Shells judge a zero-tool run by `tools.count === 0`.
|
|
7535
7570
|
terminal:
|
|
7536
7571
|
allOf: [{ $ref: '#/components/schemas/TerminalCause' }]
|
|
@@ -12195,6 +12230,35 @@ components:
|
|
|
12195
12230
|
$ref: '#/components/schemas/SessionWindow'
|
|
12196
12231
|
promptEpoch:
|
|
12197
12232
|
$ref: '#/components/schemas/PromptEpoch'
|
|
12233
|
+
userInputUndrained:
|
|
12234
|
+
type: array
|
|
12235
|
+
description: >-
|
|
12236
|
+
server >=7.110.0 (S-928 user-input acceptance ledger): user inputs this session LOST to a crash —
|
|
12237
|
+
the server had answered 200 `applied` (interrupt{text}: 202) but the process carrying that run died
|
|
12238
|
+
before the run settled; whether the run consumed them is NOT known (see `engine_notice`
|
|
12239
|
+
`task.user_steer_undrained{cause:"crashed"}`). Converged rows only, one row per (taskId, messageId),
|
|
12240
|
+
newest 500. From server >=7.111.0 (S-966) the rows include SUBAGENT steers (recorded under the run on the
|
|
12241
|
+
receipt; same row shape, `kind` is still only `steer`; `messageId` = the subagent steer receipt's).
|
|
12242
|
+
ABSENT = this read has nothing to report (zero rows, or the ledger could not be read —
|
|
12243
|
+
the authoritative notice is the frame on the run stream); the `?message=` single-entry form never
|
|
12244
|
+
carries it.
|
|
12245
|
+
items:
|
|
12246
|
+
type: object
|
|
12247
|
+
required: [messageId, kind, taskId, acceptedAt, cause]
|
|
12248
|
+
additionalProperties: false
|
|
12249
|
+
properties:
|
|
12250
|
+
messageId: { type: string }
|
|
12251
|
+
kind: { type: string, enum: [steer] }
|
|
12252
|
+
taskId: { type: string, description: The run the input was accepted for (its 200/202 receipt). }
|
|
12253
|
+
acceptedAt: { type: string, description: ISO timestamp. }
|
|
12254
|
+
cause: { type: string, enum: [crashed] }
|
|
12255
|
+
announced:
|
|
12256
|
+
type: object
|
|
12257
|
+
required: [at, taskId]
|
|
12258
|
+
additionalProperties: false
|
|
12259
|
+
properties:
|
|
12260
|
+
at: { type: string, description: ISO timestamp. }
|
|
12261
|
+
taskId: { type: string, description: The later run on whose first beat the notice was emitted. }
|
|
12198
12262
|
messages:
|
|
12199
12263
|
type: array
|
|
12200
12264
|
items: {}
|
|
@@ -14300,6 +14364,23 @@ components:
|
|
|
14300
14364
|
(`capabilities.rewindFiles`); only a run the REQUEST word turned off cannot restore itself.
|
|
14301
14365
|
OPEN on read: the server does not enumerate the word (a present non-string is dropped), a third word passes
|
|
14302
14366
|
through — treat it as unknown. ABSENT = an older engine / external derivation, never "capturing".
|
|
14367
|
+
instructions:
|
|
14368
|
+
allOf: [{ $ref: '#/components/schemas/WiringManifestInstructions' }]
|
|
14369
|
+
description: >
|
|
14370
|
+
server >= 7.111.0 (S-961; cli L-910; contract appendix G.21b) — SELF-MINTED by the server (core's
|
|
14371
|
+
`WiringManifest` has no such section; the server adds it beside core's own, and a core section of the
|
|
14372
|
+
same name would be a compile error server-side). TENANT and OPERATOR faces alike; rides the live frame, the
|
|
14373
|
+
durable ledger row and the sync receipt's `wiringManifest`. Which PROJECT-INSTRUCTION FILE the project-memory
|
|
14374
|
+
loader selected on THIS leg's own prepare: the chain `CLAUDE.md` > `.claude/CLAUDE.md` > `AGENTS.md` >
|
|
14375
|
+
`.claude/AGENTS.md` (first hit wins; a present-but-EMPTY `CLAUDE.md` is still the selected one and shadows
|
|
14376
|
+
`AGENTS.md`), each member spelled as the chain spells it, relative to the cwd.
|
|
14377
|
+
🔴 TWO MEANINGS, never fold them: the key ABSENT = this leg makes NO statement about instruction files
|
|
14378
|
+
(no loader wired — `PROJECT_MEMORY_ENABLED=false`, or the multi-user `REQUIRE_PRINCIPAL=true` form —, a
|
|
14379
|
+
hand-less leg, a cwd that is not a local absolute directory, a delegated subagent leg, or a server older
|
|
14380
|
+
than 7.111.0) — it does NOT mean "there is no instruction file". PRESENT with `selected: []` = the leg
|
|
14381
|
+
walked the chain and selected nothing. Today at most one member is sent (first hit wins); read it as a list.
|
|
14382
|
+
The segment reports what the model read at this leg's prepare, not the disk now (a resume leg reports the
|
|
14383
|
+
session snapshot). Not on `GET /v1/diagnostics/wiring` (a per-leg fact; the static half never mints it).
|
|
14303
14384
|
eventId: { type: string }
|
|
14304
14385
|
parentToolCallId: { type: string }
|
|
14305
14386
|
sourceTaskId: { type: string }
|
|
@@ -17422,7 +17503,7 @@ components:
|
|
|
17422
17503
|
🔴 ONE RULE FOR EVERY "EFFECTIVE HALF ONLY" KEY (sdk 9.7.0, after a codex adversarial-review [high]):
|
|
17423
17504
|
this schema's only consumer today is `GET /v1/diagnostics/wiring`'s `static` half, and every key marked
|
|
17424
17505
|
"effective half only" (`leg`, `ask.effective`, `configFingerprint`, `tools`, `hooks`, `lsp`,
|
|
17425
|
-
`modelGate`, `autoMode`, `writeProtection`, `readDeny`, `autoConsolidation`, `fileHistory`) is ALWAYS ABSENT on that
|
|
17506
|
+
`modelGate`, `autoMode`, `writeProtection`, `readDeny`, `autoConsolidation`, `fileHistory`, `instructions`) is ALWAYS ABSENT on that
|
|
17426
17507
|
wire ⇒ THEIR ABSENCE HERE CARRIES NO INFORMATION. The per-key absence readings ("absent = not armed",
|
|
17427
17508
|
"absent = a third state", …) hold for the LIVE FRAME (`Event_wiring_manifest`) and must not be carried
|
|
17428
17509
|
over to this response. For the facts behind those keys: a tenant reads
|
|
@@ -17603,6 +17684,13 @@ components:
|
|
|
17603
17684
|
K-24 (server >= 7.104.0 / S-724) — does this leg capture file history (`on` / `disabled`, OPEN word). EFFECTIVE
|
|
17604
17685
|
HALF ONLY ⇒ ALWAYS ABSENT ON THIS ENDPOINT; the deployment-level reading is `capabilities.fileHistoryCapture`.
|
|
17605
17686
|
Full per-key contract: see Event_wiring_manifest.fileHistory.
|
|
17687
|
+
instructions:
|
|
17688
|
+
allOf: [{ $ref: '#/components/schemas/WiringManifestInstructions' }]
|
|
17689
|
+
description: >
|
|
17690
|
+
server >= 7.111.0 (S-961) — SELF-MINTED by the server, PER-LEG: the instruction file the loader selected on one leg's
|
|
17691
|
+
own prepare. EFFECTIVE HALF ONLY ⇒ ALWAYS ABSENT ON THIS ENDPOINT (a deployment has no per-leg selection to report).
|
|
17692
|
+
🔴 DO NOT read absence here as "no instruction file" — it carries no information on this wire. Full per-key
|
|
17693
|
+
contract: see Event_wiring_manifest.instructions.
|
|
17606
17694
|
WiringManifestWriteProtection:
|
|
17607
17695
|
# sdk 9.7.0:与 `WiringManifestMcpEntry` / `WiringManifestLspSeam` 同一条裁定 —— 同一段形被 live 帧与
|
|
17608
17696
|
# 静态诊断面两处引用,内联就是两份会各自漂的镜像,所以具名单源。
|
|
@@ -17650,6 +17738,23 @@ components:
|
|
|
17650
17738
|
enum: [true]
|
|
17651
17739
|
description: "core's ONLY present shape — the construct gate refuses an armed-but-unrunnable state, so this is a SHAPE, not a value."
|
|
17652
17740
|
|
|
17741
|
+
WiringManifestInstructions:
|
|
17742
|
+
# S-961(server 7.111.0):与 `WiringManifestReadDeny` / `WiringManifestAutoConsolidation` 同一条裁定 —— 同一段形被 live 帧与静态诊断面两处引用,
|
|
17743
|
+
# 内联就是两份会各自漂的镜像,所以具名单源(`spec-field-drift-gate` 也按「导出的 interface 必有同名 schema」逼出它)。
|
|
17744
|
+
type: object
|
|
17745
|
+
additionalProperties: false
|
|
17746
|
+
description: >
|
|
17747
|
+
The `wiring_manifest.instructions` section (server >= 7.111.0 / S-961) — SELF-MINTED by the server, not a core
|
|
17748
|
+
section: which project-instruction file the project-memory loader selected on this leg's own prepare.
|
|
17749
|
+
`selected` members are a CLOSED four-word set — the server's instruction-file chain (`INSTRUCTION_FILE_CHAIN`,
|
|
17750
|
+
registered in its self-minted wire table `wiringInstructionsSelected`); a fifth chain member would be a new SDK minor,
|
|
17751
|
+
in this enum in the same batch. The present-iff / two-meanings reading is on `Event_wiring_manifest.instructions`.
|
|
17752
|
+
required: [selected]
|
|
17753
|
+
properties:
|
|
17754
|
+
selected:
|
|
17755
|
+
type: array
|
|
17756
|
+
description: 'The selected chain member(s), spelled as the chain spells them (relative to the cwd); `[]` = the chain was walked, nothing was selected.'
|
|
17757
|
+
items: { type: string, enum: ['CLAUDE.md', '.claude/CLAUDE.md', 'AGENTS.md', '.claude/AGENTS.md'] }
|
|
17653
17758
|
WiringManifestHookEntry:
|
|
17654
17759
|
# sdk 9.5.0:与 `WiringManifestMcpEntry` 同一条裁定 —— 同一份行形被 live 帧与静态诊断面两处引用,
|
|
17655
17760
|
# 内联就是两份会各自漂的镜像,所以一开始就具名。
|
|
@@ -17963,6 +18068,14 @@ components:
|
|
|
17963
18068
|
delivery: { type: string, description: 'Literal "applied" on today''s server.' }
|
|
17964
18069
|
note: { type: string, description: 'The CC-verbatim queued copy ("Message queued for delivery to <name>…").' }
|
|
17965
18070
|
marker: { type: string, description: 'Engine-minted delivery marker (present on both steer and resume 200s, server 1.214+).' }
|
|
18071
|
+
messageId:
|
|
18072
|
+
type: string
|
|
18073
|
+
description: >
|
|
18074
|
+
server >= 7.111.0 (S-966) — the STEER 200 only (absent on the `…/resume` 200 and on an older server): the id of
|
|
18075
|
+
this acceptance in the server's user-input ledger (uuidv7) — the SAME value a later
|
|
18076
|
+
`GET /v1/sessions/{id}` `userInputUndrained[].messageId` carries should the carrying server process die
|
|
18077
|
+
before the run settles. The same ledger write that guards a run steer guards a subagent steer: when it
|
|
18078
|
+
cannot be written the verb answers 503 `steering.ledger_unavailable` and the subagent got nothing.
|
|
17966
18079
|
|
|
17967
18080
|
SubagentOutputResult:
|
|
17968
18081
|
type: object
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/sdk",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.3.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",
|