@sema-agent/sdk 38.0.0 → 38.1.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/openapi.yaml CHANGED
@@ -6449,7 +6449,14 @@ paths:
6449
6449
  '404': { description: '`org_delivery.not_member` — one byte-identical body for six causes (see the description); the gate is not an existence probe.' }
6450
6450
  '409': { description: '`org_delivery.inbox_full` — the recipient''s box holds 50 unconfirmed envelopes.' }
6451
6451
  '410': { description: '`org_delivery.recipient_tombstoned` — the recipient''s mailbox is in its pre-delete state.' }
6452
- '429': { description: '`org_delivery.rate_limited` — one sentence for the sender-attempt bound, the pair bound and the recipient aggregate bound.' }
6452
+ '429':
6453
+ description: >-
6454
+ `org_delivery.rate_limited` — one sentence for the sender-attempt bound, the pair bound and the recipient aggregate bound. server >= 7.149.0: the body adds `retryAfterSec`
6455
+ (integer seconds to the end of the current clock-hour bucket, rounded up, >= 1) and the response carries the same value as `Retry-After`, one number for all three bounds;
6456
+ server <= 7.148.x: neither (no window given — not "retry at once").
6457
+ headers:
6458
+ Retry-After: { schema: { type: integer }, description: 'server >= 7.149.0: seconds to the end of the current clock-hour bucket (same value as the body `retryAfterSec`).' }
6459
+ '500': { description: '`internal.org_delivery_quota_unreadable` (server >= 7.149.0; code family deterministic) — `DB_BACKEND=local` only: the delivery-quota state file cannot be read, so EVERY delivery is refused until an operator repairs or moves the file and restarts the service (the store reads it only at boot). No `Retry-After`; retrying will not change the answer (the SDK''s `NON_RETRYABLE_CODES` carries it). Before 7.149.0 this state answered `500 internal.error`.' }
6453
6460
  '501': { description: 'No delivery gate mounted (`PRINCIPAL_INBOX_ASSISTANT` off) — `capability.unavailable`.' }
6454
6461
 
6455
6462
  /v1/diagnostics/wiring:
@@ -9291,6 +9298,15 @@ components:
9291
9298
  cancel scene to look at", NOT "nothing was wrong at cancel time"). Landings: `GET /v1/runs/{taskId}` -> `result.cancelContext`
9292
9299
  (and the same object rides the other cancelled-terminal landings listed on `abortCause`). Shape and per-key reading
9293
9300
  rules: `CancelContext`.
9301
+ readDenyFloor:
9302
+ allOf: [{ $ref: '#/components/schemas/ReadDenyFloorSummary' }]
9303
+ description: >
9304
+ server >= 7.149.0, PRESENT-IFF the run WENT AHEAD while its read-deny rules are not byte-enforced: the read-deny table has rows, the execution
9305
+ environment (lane) does not keep the byte floor, and the deployment did not set `READ_DENY_FLOOR_REQUIRED=true` (when it did, the synchronous
9306
+ `POST /v1/tasks` answers 409 `config.read_deny_floor_unkept` and the asynchronous legs land the same code on the terminal row - the run does not go).
9307
+ ABSENT = no such disclosure: the run did not start (entry budget gate / refused submit), the table is empty, the lane keeps the byte floor, or an older
9308
+ server - absence does NOT prove the read-deny rules were kept. Landings, one value: `GET /v1/runs/{taskId}` -> `result.readDenyFloor` ·
9309
+ `POST /v1/tasks/stream` -> `done.result.readDenyFloor` · the `POST /v1/tasks` 200 body at its top level · the ledger `done` row's `result`. Shape: `ReadDenyFloorSummary`.
9294
9310
 
9295
9311
  abortCause:
9296
9312
  allOf: [{ $ref: '#/components/schemas/AbortCause' }]
@@ -9342,6 +9358,18 @@ components:
9342
9358
  CLOSED set, additive-only by the server's rule (a new word is a new server version in `wire-changes` AND a new SDK
9343
9359
  minor, in this enum in the same batch): read an unknown word as "the server aborted this run, cause not recognised".
9344
9360
 
9361
+ ReadDenyFloorSummary:
9362
+ type: object
9363
+ additionalProperties: false
9364
+ required: [code, message]
9365
+ description: >
9366
+ `TaskResult.readDenyFloor` (server >= 7.149.0): the run-level disclosure that a run WENT AHEAD while its read-deny rules are not byte-enforced.
9367
+ `{ code, message }` is the same pair as that run's `engine_notice` frame `config.read_deny_floor_unkept`; `message` is the server's lane-specific
9368
+ sentence (display text, never a match key). Two keys, no others.
9369
+ properties:
9370
+ code: { type: string, enum: [config.read_deny_floor_unkept] }
9371
+ message: { type: string }
9372
+
9345
9373
  CancelContext:
9346
9374
  type: object
9347
9375
  # 封闭(K-43,sdk 16.0.0):铸点 `run-cancel-context.js` `buildCancelContext` 是逐键条件 spread 的字面量(lastEventKind / lastEventAgeMs / lastBrainStatus / elapsedMs),
@@ -13162,6 +13190,7 @@ components:
13162
13190
  supportsThinkingOff: { type: boolean, description: "Whether this model's reasoning can be turned off — the engine's one reading `thinkingOffSpelled` (derived from the row's API family, `compat`, `thinkingLevelMap.off` and `reasoning` declaration; the catalog carries no key for it). ALWAYS PRESENT on a server >= 7.138.0 (a plain boolean, not three-state); ABSENT = an older server (unknown, not `false`)." }
13163
13191
  defaultThinking: { type: string, enum: [minimal, low, medium, high, xhigh, max, 'off'], description: 'server >= 7.148.0, present iff declared: the model''s default thinking rung (the engine''s `Model.defaultThinking`, seven rungs incl. `off` — a request that names no rung then carries an explicit off). ABSENT = no model-level default (the provider''s own default applies), or an older server. Whether thinking CAN be turned off is `supportsThinkingOff`.' }
13164
13192
  contextWindow: { type: integer, description: 'E4 (SHIPPED) — context-window token DENOMINATOR for the %-used gauge; omitted when unknown.' }
13193
+ contextWindowSource: { type: string, enum: [declared, assumed], description: 'server >= 7.149.0, PRESENT-IFF `contextWindow` is present: where the window came from. `declared` = someone along the model''s inheritance chain wrote a number (the catalog entry''s `contextWindow`, the deployment''s `MODEL_CONTEXT_WINDOW` which an entry that writes none inherits, or `MODEL_CHEAP_CONTEXT_WINDOW` for the cheap slot); `assumed` = nobody wrote one and the server filled a conservative guess (131072 since 7.149.0; 7.148.x and before assumed 262144 and did not say so) - an estimate, not a measurement: the engine sizes its compaction trigger and tool-schema deferral on it, so a model whose real window is smaller reaches its limit before compaction starts and a larger one compacts earlier than it needs to. CLOSED two words. ABSENT = a server <= 7.148.x (source unknown, NOT `declared`) or a row with no `contextWindow`.' }
13165
13194
  maxOutputTokens: { type: integer, description: 'E4 (SHIPPED) — single-call max output tokens; omitted when unknown.' }
13166
13195
  supportedEffortLevels:
13167
13196
  type: array
@@ -17185,6 +17214,18 @@ components:
17185
17214
  - $ref: '#/components/schemas/ErrorResponse'
17186
17215
  - type: object
17187
17216
  properties:
17217
+ wayOut:
17218
+ type: string
17219
+ enum: [cancel_run, newer_worker]
17220
+ description: >-
17221
+ server >= 7.149.0, PRESENT-IFF the server can say the client's way out of a refused card (the engine judged the card not resumable on this engine;
17222
+ the three decision doors `POST /v1/approvals/{sessionId}/decide` · `.../plan_review` · `.../resume` refuse alike). CLOSED two words, decided by the verdict and the card alone
17223
+ (not by which door, not by the decision word): `cancel_run` - the card takes NO decision on this engine (approve / deny / reject / edit all refused), the way out is
17224
+ `POST /v1/runs/{taskId}/cancel`, which expires the card, drives the run to the cancelled terminal and frees the session (then start a new task) - render no approve / deny;
17225
+ `newer_worker` - a row parked by a newer engine: a worker at or above the version that parked it can resume it and the same decision lands there; the card stays pending
17226
+ (cancel is giving it up). ABSENT = the server cannot say a client way out (the card sits on a plain park of an already-terminal run, the run is running, the row's owner is
17227
+ unreadable, or no durable run store) - ask the operator; do NOT render "decide again" from `retriable`. Not carried: a refusal of the decision body's own cell (fix that
17228
+ cell and decide again), a deployment-fact refusal, `POST /v1/sessions/{sessionId}/wake`. SDK: `err.extra.wayOut` (`ResumeRefusalExtra.wayOut`).
17188
17229
  retriable:
17189
17230
  type: boolean
17190
17231
  enum: [true]
@@ -19379,6 +19420,11 @@ components:
19379
19420
  with a finish reason the engine does not understand, so the text above may be cut short (`finishReason` = the provider's own word, an OPEN string, passed through verbatim; once per run per word); and
19380
19421
  `route.stream_end_ignored` `{statement, word, frames, sessionId, runId}` — the provider had already ended the turn and its stream sent more (`statement` in {`ending`, `error`, `content`}, `word` = the late first
19381
19422
  frame's ending reason / error word / content kind, `frames` = how many frames came after the end; the first ending counts, anything later never entered the turn; once per run per (statement, word)).
19423
+ server 7.149.0 (the user-visible whitelist grows 51 -> 52 codes; contract appendix D.3): `config.read_deny_floor_unkept` (the engine's code, passed through; the code book lists audience `operator`
19424
+ but this server puts it on the run event stream) - this run WENT AHEAD while its read-deny rules are not byte-enforced (the read-deny table has rows, the execution environment does not
19425
+ keep the byte floor, `READ_DENY_FLOOR_REQUIRED` is not set; when it is set the run does not go: the synchronous `POST /v1/tasks` answers 409 with the same code). `detail` =
19426
+ `{ rowCount, sessionId, runId }` - the table's row count and the run it speaks of (a ladder level / verifier / subagent leg is its own run id); `message` is rewritten by the server per lane.
19427
+ The same `{ code, message }` pair lands once more on the terminal result as `readDenyFloor` (`TaskResult.readDenyFloor`).
19382
19428
  A notice whose `detail.sessionId` is absent is HONESTLY NOT DELIVERED (the server never guesses a session),
19383
19429
  so the frame's absence does NOT mean "did not happen" — the operator-facing structured log always has the
19384
19430
  full family. `detail` is already redacted + size-bounded by the server; still treat it as external text.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/sdk",
3
- "version": "38.0.0",
3
+ "version": "38.1.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",