@sema-agent/sdk 34.0.0 → 36.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.
- package/README.md +112 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/normalize.d.ts +9 -3
- package/dist/normalize.d.ts.map +1 -1
- package/dist/normalize.js +2 -0
- package/dist/normalize.js.map +1 -1
- package/dist/resources/approvals.d.ts +4 -1
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/rules.d.ts +48 -48
- package/dist/resources/rules.d.ts.map +1 -1
- package/dist/resources/rules.js +8 -4
- package/dist/resources/rules.js.map +1 -1
- package/dist/resources/session-sync.d.ts +5 -0
- package/dist/resources/session-sync.d.ts.map +1 -1
- package/dist/resources/session-sync.js +5 -0
- package/dist/resources/session-sync.js.map +1 -1
- package/dist/resources/sessions.d.ts +1 -1
- package/dist/types.d.ts +38 -20
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/openapi.yaml +113 -74
- package/package.json +2 -2
package/openapi.yaml
CHANGED
|
@@ -3517,7 +3517,10 @@ paths:
|
|
|
3517
3517
|
description: >
|
|
3518
3518
|
409 `conflict` — a `fork`/`stale` PUSH without `resolution:"overwrite-dst"` (carries `relation`; the SDK
|
|
3519
3519
|
surfaces SyncConflictError), OR an active run (`session_active`, `activeTaskId`) / an in-flight import
|
|
3520
|
-
(`import_in_flight`) on the session (ConflictError).
|
|
3520
|
+
(`import_in_flight`) on the session (ConflictError). `conflict.session_archive_stamped` (server >= 7.145.0, `DB_BACKEND=local` only):
|
|
3521
|
+
the same two shapes (`fork` / `stale` without consent) onto a stored archive that still carries an earlier version's owner stamp — body
|
|
3522
|
+
`{ error, errorCode }` only (no `relation`), no staging, no lease, nothing written; consent cannot help, the only way out is to delete that
|
|
3523
|
+
session and push it again. A plain ConflictError. Servers 7.144.x answered these two shapes here with the `relation`-carrying `conflict`.
|
|
3521
3524
|
content:
|
|
3522
3525
|
application/json:
|
|
3523
3526
|
schema: { $ref: '#/components/schemas/SyncConflict' }
|
|
@@ -6533,8 +6536,8 @@ paths:
|
|
|
6533
6536
|
x-status: gated # server routes/rules.ts;PERMISSION_RULES_ENABLED + 规则店装配,缺一 ⇒ 501 capability.rule_store_required。SDK rules.ccImportPrepare() 消费。
|
|
6534
6537
|
summary: Preview a CC-settings rule import and mint a one-shot redemption ticket.
|
|
6535
6538
|
description: >
|
|
6536
|
-
Read the
|
|
6537
|
-
what the import WOULD do plus a ticket.
|
|
6539
|
+
Read the permission lists (allow / deny / ask) of 1–3 user-editable CC settings layers the caller submits, and
|
|
6540
|
+
answer with what the import WOULD do plus a ticket.
|
|
6538
6541
|
|
|
6539
6542
|
🔴 NO PERMISSION RULE is persisted by this call — only POST /v1/rules/cc-import/redeem reaches the
|
|
6540
6543
|
writer. But the call is NOT free of durable state and NOT idempotent: every successful prepare writes
|
|
@@ -6543,8 +6546,8 @@ paths:
|
|
|
6543
6546
|
rejection tries to discard the record it just created, best-effort — a leftover orphan pending record
|
|
6544
6547
|
affects no adjudication, but it is not a promise of zero residue either.)
|
|
6545
6548
|
|
|
6546
|
-
|
|
6547
|
-
|
|
6549
|
+
All three lists are read (server >= 7.67.0 / engine 7.9.0; earlier servers read the allow list only): every candidate and every
|
|
6550
|
+
receipt row carries its `behavior`.
|
|
6548
6551
|
|
|
6549
6552
|
The ticket is principal-bound, expiring (10 min), single-use (atomically consumed) and payload-bound
|
|
6550
6553
|
(it pins a digest of the candidate set at mint time). It is NOT a cacheable credential and must never
|
|
@@ -6609,6 +6612,15 @@ paths:
|
|
|
6609
6612
|
the ticket is STILL USABLE — retry as-is after `retryAfterSec` (echoed in `Retry-After`). Folding
|
|
6610
6613
|
that into the 404 would tell a caller their confirmation is lost when it is not; the two call for
|
|
6611
6614
|
opposite handling.
|
|
6615
|
+
|
|
6616
|
+
🔴 SETTLE RULE (server >= 7.145.0, one rule for both redeem doors — cc-import and local-import answer the SAME receipt from ONE mint point):
|
|
6617
|
+
when the redemption walk completes with the engine's COMPLETE member table, the redemption settles — `200` + the receipt
|
|
6618
|
+
`RuleImportReceipt` `{ members, rev }`, one row per member in the engine's walk order. A member the engine refused is a row with
|
|
6619
|
+
outcome `indeterminate` + reason `store_refused` + `detail` (the engine's sentence verbatim: its refusal carries free text only, so the
|
|
6620
|
+
server does not guess whether it is a verdict or a transient, and neither claims it landed nor guarantees it did not); the ticket is
|
|
6621
|
+
USED (the same ticket again ⇒ 404). Reconcile against `GET /v1/rules` by `key` (the identity triple of a listing row); to fill a gap,
|
|
6622
|
+
run a fresh import (idempotent — landed members read `no-op`). `refused` is a RESERVED outcome word, not minted by this server.
|
|
6623
|
+
<= 7.144.x answered such a member with 503 `state.rule_import_retry` until the ticket expired, with the old body `{ result: { members, rev } }` (retired, no alias).
|
|
6612
6624
|
requestBody:
|
|
6613
6625
|
required: true
|
|
6614
6626
|
content:
|
|
@@ -6624,17 +6636,19 @@ paths:
|
|
|
6624
6636
|
description: What the import ACTUALLY did (a different moment and contract from the preview).
|
|
6625
6637
|
content:
|
|
6626
6638
|
application/json:
|
|
6627
|
-
schema: { $ref: '#/components/schemas/
|
|
6639
|
+
schema: { $ref: '#/components/schemas/RuleImportReceipt' }
|
|
6628
6640
|
'400': { $ref: '#/components/responses/BadRequest' } # request.body_shape — body is not {ticket}
|
|
6629
6641
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
6630
6642
|
'404': { $ref: '#/components/responses/NotFound' } # not_found.rule_ticket — the UNIFORM arm (forged / another principal's / expired / already used). Never branch on the cause.
|
|
6631
6643
|
'429': { $ref: '#/components/responses/RateLimited' }
|
|
6632
6644
|
'503':
|
|
6633
6645
|
description: >
|
|
6634
|
-
errorCode `state.rule_import_retry` — the
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6646
|
+
errorCode `state.rule_import_retry` — the redemption ended WITHOUT a complete member table (server >= 7.145.0: the engine refused the
|
|
6647
|
+
whole batch before walking it, the member loop threw midway, the confirmation lost to a concurrent writer, or the store threw before the
|
|
6648
|
+
walk), the claim was released and THE TICKET IS STILL USABLE. Body carries `retryAfterSec` and the same value rides `Retry-After`.
|
|
6649
|
+
Retry the SAME ticket: it walks again and hands back the complete table (members landed by the interrupted walk read `no-op`). A refused
|
|
6650
|
+
MEMBER is not this arm — that redemption settles with a 200 receipt row `indeterminate`. This is the only error arm on this endpoint a
|
|
6651
|
+
caller may distinguish from the uniform 404, and the distinction is load-bearing.
|
|
6638
6652
|
headers:
|
|
6639
6653
|
Retry-After:
|
|
6640
6654
|
schema: { type: integer }
|
|
@@ -7416,7 +7430,8 @@ components:
|
|
|
7416
7430
|
SEVERAL producers share this status, so `errorCode` — not the status — is the branch key. Known today:
|
|
7417
7431
|
(a) session-ownership — reusing a `sessionId` that belongs to another principal; mapped to AuthError.
|
|
7418
7432
|
(b) `execution_lane_not_allowed` — this worker's execution lane is outside the principal's policy
|
|
7419
|
-
allowlist; the body carries `allowedLanes` + `lane
|
|
7433
|
+
allowlist; the body carries `allowedLanes` + `lane` (lane words of `Capabilities.executionLane.provider`: `none` from server
|
|
7434
|
+
7.147.0, `in-process` on servers <= 7.146.x). Mapped to plain APIError (no typed class yet);
|
|
7420
7435
|
raised while PREPARING a task, so it can appear on any submit endpoint, not only this one.
|
|
7421
7436
|
(c) `memory.admission_denied` (server >=7.0.0, synchronous `POST /v1/tasks`) — the principal holds no
|
|
7422
7437
|
grant on the requested org-memory tenant plane, or the verdict tried to widen the request, or the
|
|
@@ -8508,7 +8523,7 @@ components:
|
|
|
8508
8523
|
environment (`{ ...process.env }` verbatim, CC interactive shape); `scrub` = the default scrub (credential-shaped variables
|
|
8509
8524
|
stripped), accepted on EVERY lane and deployment. ABSENT = the default scrub AND clears the session's previous
|
|
8510
8525
|
declaration (not sticky). Verdicts (all three submit doors): out-of-vocabulary ⇒ 400 `request.field_invalid` (the sentence
|
|
8511
|
-
names both words); `all` on a non-host lane (e2b / k8s / local-docker / ssh / adb / device / in-process) ⇒ 400
|
|
8526
|
+
names both words); `all` on a non-host lane (e2b / k8s / local-docker / ssh / adb / device / `none`; the no-execution-environment lane was `in-process` on servers <= 7.146.x) ⇒ 400
|
|
8512
8527
|
`request.field_invalid` "applies to the host lane only" (`scrub` still accepted); `all` with no authorizer (no session) ⇒
|
|
8513
8528
|
400 `request.field_invalid`; hosted deployment (`REQUIRE_PRINCIPAL=true`) × `all` ⇒ 422 `request.host_posture_refused`
|
|
8514
8529
|
(same code / status as the write-containment leg; reach = `hostPostureDeclarationsHonored`, NOT
|
|
@@ -10021,7 +10036,7 @@ components:
|
|
|
10021
10036
|
scenario: { type: string }
|
|
10022
10037
|
jobId: { type: string }
|
|
10023
10038
|
source: { type: string, description: 'Credential-derived system attribution (service-pinned).' }
|
|
10024
|
-
objectivePreview: { type: string, maxLength: 120, description: 'Objective, secret-redacted then truncated (service-pinned
|
|
10039
|
+
objectivePreview: { type: string, maxLength: 120, description: 'Objective, secret-redacted then truncated (service-pinned). ABSENT when the run row has no preview: older rows, and from server >= 7.145.0 any run on a leg that declares a prompt screen (`prompt.submit` / `classic.UserPromptSubmit`, wildcards included) until the engine delivers the objective verbatim — absent for good when the screen rewrote / dropped it or the leg returns results only (`verify` / `cascade`). The same column feeds the inbox `objective`, the assistant-task `name`, the session-list `objectivePreview` and the fleet row `name`: read absence / `null` as "no preview", never as an empty string.' }
|
|
10025
10040
|
owner: { type: string, description: 'Run owner principal (service-pinned; operator view).' }
|
|
10026
10041
|
startedAt: { type: string, format: date-time }
|
|
10027
10042
|
endedAt: { type: string, format: date-time }
|
|
@@ -11347,15 +11362,21 @@ components:
|
|
|
11347
11362
|
conjunction (shell spawned it AND no remote URL AND `REMOTE_EXEC` in {unset, host}) — none of which
|
|
11348
11363
|
the engine said, and which drifts the moment the shell talks to a remote engine (it reads ITS OWN
|
|
11349
11364
|
box's env).
|
|
11350
|
-
`provider` is the server's EIGHT-word `ExecutionLane` (
|
|
11351
|
-
bytes `dist/execution-lane-caps.js` `
|
|
11352
|
-
|
|
11353
|
-
env, `toolsOnThisHost:false`)
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
`
|
|
11365
|
+
`provider` is the server's EIGHT-word `ExecutionLane` (the word table is settings-schema `EXECUTION_LANE_WORDS`; release
|
|
11366
|
+
bytes `dist/execution-lane-caps.js` `ALL_EXECUTION_LANES` is that table itself from server 7.147.0 on). 🔴 `none` (server
|
|
11367
|
+
>= 7.147.0) = this deployment DECLARED no execution environment for the agent's tools (`REMOTE_EXEC=none`: no hands — core
|
|
11368
|
+
mounts its stub env, `toolsOnThisHost:false`, `isolated` absent). Every deployment names its lane from 7.147.0 on — the
|
|
11369
|
+
declaration is env `REMOTE_EXEC` (under `CONFIG_PROVIDER=local`, `config.d/remote-exec.json` also declares it), and a
|
|
11370
|
+
deployment whose final lane has no declaration refuses to start — so there is no default word and no "unset" state. Servers <= 7.146.x differed:
|
|
11371
|
+
`REMOTE_EXEC` UNSET answered the word `in-process` at this position (7.97.0–7.146.x; 7.86.0–7.96.x folded that shape into
|
|
11372
|
+
`host` / `true`), and the single-machine default `CONFIG_PROVIDER=local` with `REMOTE_EXEC` unset got the implicit tail arm
|
|
11373
|
+
`host`; this contract no longer carries `in-process` (zero alias — a <= 7.146.x body with that word fails validation).
|
|
11374
|
+
`none ⇒ no hands` always holds; the converse does not (a run can shed its hands on `host`). Read the eight words
|
|
11375
|
+
exhaustively — an open-string reader silently drops `none` into its default arm. The same lane words ride three more
|
|
11376
|
+
places: `ExecutionPlacement.lane`, the top-level `boundLane` of the 409 `execution_lane.not_served` /
|
|
11377
|
+
`execution_lane.tree_bound` bodies, and the `lane` of the 403 `execution_lane_not_allowed` body.
|
|
11357
11378
|
`isolated` (server >= 7.106.0 / S-281) — are the hands inside an OS-level isolation boundary; PRESENT-IFF this lane
|
|
11358
|
-
has hands (`
|
|
11379
|
+
has hands (`none` ⇒ absent, not `false`); absent on an older server too — read absence as UNKNOWN, never as
|
|
11359
11380
|
`false`. `isolated === false ∧ toolsOnThisHost` is the "no sandbox" reading a shell renders.
|
|
11360
11381
|
`toolsOnThisHost` is owned by `task-cwd.ts`'s `toolsRunOnThisHost` — the SAME FUNCTION that decides
|
|
11361
11382
|
whether a self-scanned skill gets a `baseDir`.
|
|
@@ -11367,9 +11388,9 @@ components:
|
|
|
11367
11388
|
An ABSENT key must NOT be read as either side — that is exactly the state this bit was minted to end.
|
|
11368
11389
|
required: [provider, toolsOnThisHost]
|
|
11369
11390
|
properties:
|
|
11370
|
-
provider: { type: string, enum: [
|
|
11391
|
+
provider: { type: string, enum: [none, host, e2b, k8s, ssh, adb, local-docker, device], description: 'Eight words, the server''s `ExecutionLane`. `none` = the deployment declared no execution environment (no hands; server >= 7.147.0, `REMOTE_EXEC=none`); servers 7.97.0–7.146.x answered `in-process` at this position, which this contract no longer accepts.' }
|
|
11371
11392
|
toolsOnThisHost: { type: boolean, description: 'The tools run on the process that answered this request (server-absolute paths mean something to the model''s tools).' }
|
|
11372
|
-
isolated: { type: boolean, description: 'server >= 7.106.0 (S-281): the hands run inside an OS-level isolation boundary (value = the lane table''s `isolation` bit via the single boolean door `laneIsolated`). PRESENT-IFF this lane has hands — `
|
|
11393
|
+
isolated: { type: boolean, description: 'server >= 7.106.0 (S-281): the hands run inside an OS-level isolation boundary (value = the lane table''s `isolation` bit via the single boolean door `laneIsolated`). PRESENT-IFF this lane has hands — `none` ⇒ absent, not false.' }
|
|
11373
11394
|
taskWriteFaceOpen:
|
|
11374
11395
|
type: boolean
|
|
11375
11396
|
description: >
|
|
@@ -14482,8 +14503,11 @@ components:
|
|
|
14482
14503
|
replica / version that can resume it. `ok` carries only `kind`; `lacking` / `damaged` carry `code` (the engine's checkpoint error code), `reason` (which arm of a multi-arm code), `requires` (capabilities the row needs and this engine lacks) and `sentence` (the engine's human line —
|
|
14483
14504
|
display only, never a match key); `code` / `reason` are open strings (owned by core). Match the two faces on `reason`, not on `code`: the refusal
|
|
14484
14505
|
face translates `checkpoint.invalid_outcome` (e.g. `requirements_damaged`) to `approval_binding_mismatch` on a `policy_ask` gate and to `resume_outcome_invalid` on other gates, and that
|
|
14485
|
-
engine refusal carries no `detail.code` (so no `blockedBy`); `checkpoint.unsupported_version` passes through unchanged. The refusal body's `reason` is the verdict's `reason`. ABSENT IS NOT `ok`: the listing did not judge the row (
|
|
14486
|
-
|
|
14506
|
+
engine refusal carries no `detail.code` (so no `blockedBy`); `checkpoint.unsupported_version` passes through unchanged. The refusal body's `reason` is the verdict's `reason`. ABSENT IS NOT `ok`: the listing did not judge the row (it left
|
|
14507
|
+
pending or its bytes changed between two reads, or an older server). server >= 7.145.0: on SQL backends a row whose stored body cannot be read as a checkpoint
|
|
14508
|
+
carries the verdict too (the judge answers on the raw bytes — always `damaged`) and is listed on both the operator queue and the assistant inbox (7.144.x
|
|
14509
|
+
listed it without this key and refused the whole inbox). An `ok` does not guarantee the decide succeeds: the judge does not inspect `pendingAction`, so a
|
|
14510
|
+
row missing only that is judged `ok` and its decide still fails (a known engine gap).
|
|
14487
14511
|
oneOf:
|
|
14488
14512
|
- type: object
|
|
14489
14513
|
additionalProperties: false
|
|
@@ -14525,7 +14549,16 @@ components:
|
|
|
14525
14549
|
checkpointId: { type: string, minLength: 1, maxLength: 128, description: 'server >= 7.133.0: the NON-SECRET stable identity of the pause this row parks on — the join key where the token cannot go; the SAME value as `PausedCause.checkpointId`. Carried on three durable read surfaces (GET /v1/approvals `pending[]` rows, the /v1/approvals/stream `pending` frame, GET /v1/assistant/inbox rows). A row whose value is unreadable or untrusted (non-string / empty / over 128 / contains the token / an old row / an older server) is STILL LISTED with the key ABSENT — read absence as "this row has no joinable identity", never as a required key.' }
|
|
14526
14550
|
rowVerdict:
|
|
14527
14551
|
allOf: [{ $ref: '#/components/schemas/CheckpointRowVerdict' }]
|
|
14528
|
-
description: 'server >= 7.144.0: the engine row judge''s verdict on this row (ABSENT IS NOT `ok`). A non-`ok` row is refused for the same reason when decided (409). SQL backends read each pending row''s stored body once on the first listing after boot (then memoized by body digest); a row whose body cannot be
|
|
14552
|
+
description: 'server >= 7.144.0: the engine row judge''s verdict on this row (ABSENT IS NOT `ok`). A non-`ok` row is refused for the same reason when decided (409). SQL backends read each pending row''s stored body once on the first listing after boot (then memoized by body digest); server >= 7.145.0 a row whose body cannot be read as a checkpoint carries it too (always `damaged`; 7.144.x listed that row without it).'
|
|
14553
|
+
agent:
|
|
14554
|
+
allOf: [{ $ref: '#/components/schemas/SessionAgent' }]
|
|
14555
|
+
description: >-
|
|
14556
|
+
server >= 7.145.0: where this row's session sits in the delegation tree — the SAME read port, type and value as the top-level `agent` of
|
|
14557
|
+
`GET /v1/sessions/{sessionId}` (the row's identity is its session). A background delegated child's parked row has an empty `taskId` and its own
|
|
14558
|
+
`sessionId`; an ownership judge reads `parentSessionId` / `rootSessionId` to link it back to the delegating session. ABSENT means this server did not
|
|
14559
|
+
say, NOT "not a child": a host session's own row, a synchronously delegated child, a `subagent_type: "fork"` background child (an ordinary fork of the
|
|
14560
|
+
parent session, still unlinkable), a store keeping no delegation tuple (`DB_BACKEND=memory`), local-backend child transcripts copied into the host store by
|
|
14561
|
+
7.140.x and earlier, a read that failed (only that row lacks the key), or an older server.
|
|
14529
14562
|
sessionId: { type: string, description: 'The decide handle: POST /v1/approvals/:sessionId/decide.' }
|
|
14530
14563
|
scope: { type: string, description: 'Principal; "_" = submitted without one.' }
|
|
14531
14564
|
taskId: { type: ['string', 'null'], description: 'Suspended run holding the session claim (service-pinned) — join key to trace tool-call blocks + context link.' }
|
|
@@ -14739,7 +14772,7 @@ components:
|
|
|
14739
14772
|
checkpointId: { type: string, minLength: 1, maxLength: 128, description: 'server >= 7.133.0: the NON-SECRET stable identity of the pause this row parks on — the join key where the token cannot go; the SAME value as `PausedCause.checkpointId`. Carried on three durable read surfaces (GET /v1/approvals `pending[]` rows, the /v1/approvals/stream `pending` frame, GET /v1/assistant/inbox rows). A row whose value is unreadable or untrusted (non-string / empty / over 128 / contains the token / an old row / an older server) is STILL LISTED with the key ABSENT — read absence as "this row has no joinable identity", never as a required key.' }
|
|
14740
14773
|
rowVerdict:
|
|
14741
14774
|
allOf: [{ $ref: '#/components/schemas/CheckpointRowVerdict' }]
|
|
14742
|
-
description: 'server >= 7.144.0: the same verdict as `PendingCheckpoint.rowVerdict` (ABSENT IS NOT `ok`; both backends).'
|
|
14775
|
+
description: 'server >= 7.144.0: the same verdict as `PendingCheckpoint.rowVerdict` (ABSENT IS NOT `ok`; both backends). server >= 7.145.0 on SQL backends: a row whose stored body cannot be read for its summary is LISTED (previously the whole inbox answered 500 / 503) with its column facts (`sessionId` / `scope` / `createdAt` / `gateKind` / `deadline` / `checkpointId`) plus this key; summary-derived keys are absent and `input` is `null`, while `objective` is still filled from the run row preview independently of the summary. A row whose gate kind column cannot be read is not listed. The verdict is usually non-`ok` (`damaged` …); exception: a row missing only `pendingAction` is judged `ok` and its decide still fails (a known engine gap). On `DB_BACKEND=local` that shape still answers the whole listing with 503 `approvals.read_unavailable`.'
|
|
14743
14776
|
scope: { type: string, description: 'Multi-tenant owner scope.' }
|
|
14744
14777
|
createdAt: { type: number, description: 'Ask creation time (epoch ms).' }
|
|
14745
14778
|
gateKind:
|
|
@@ -15348,7 +15381,7 @@ components:
|
|
|
15348
15381
|
ExecutionPlacement:
|
|
15349
15382
|
description: >
|
|
15350
15383
|
`GET /v1/sessions/{sessionId}/execution-placement` 200 body (server >= 7.139.0, contract section 23.1) — the execution placement of one ROOT session's current occupant on THIS deployment, discriminated by `role`:
|
|
15351
|
-
`absent` (not yet executed here) · `writer` (this deployment is the writer; `lane` = the execution lane word, the `REMOTE_EXEC` value, `in-process` when unset; `device` only on the device lane once bound — `writer`
|
|
15384
|
+
`absent` (not yet executed here) · `writer` (this deployment is the writer; `lane` = the execution lane word, one of the eight words of `Capabilities.executionLane.provider` — the `REMOTE_EXEC` value, `none` for a deployment that declared no execution environment (servers <= 7.146.x answered `in-process` when it was unset); `device` only on the device lane once bound — `writer`
|
|
15352
15385
|
without `device` there = a pre-upgrade session whose device is unknown) · `mirror` (a read-only copy imported from elsewhere; execution / rename / pin answer `409 conflict.session_mirror` with `forkPath`) ·
|
|
15353
15386
|
`forking` (a keyed fork has not finished copying — `DB_BACKEND=local` crash middle state only). No `writer` ⇄ `mirror` and no `writer(L)` → `writer(L')` transition: to change, fork a new session. Closed set; the SDK reads it exhaustively.
|
|
15354
15387
|
oneOf:
|
|
@@ -16216,7 +16249,8 @@ components:
|
|
|
16216
16249
|
Both families, and both status codes, first reached the wire with server 7.3.0's in-stream approval
|
|
16217
16250
|
decision endpoint.) 🔴 server >= 7.139.0 also mints two 409 codes under a prefix that is NOT one of the fourteen:
|
|
16218
16251
|
`execution_lane.not_served` / `execution_lane.tree_bound` (the session is placed on an execution lane this deployment no
|
|
16219
|
-
longer runs / another lane of this deployment; top-level `boundLane
|
|
16252
|
+
longer runs / another lane of this deployment; top-level `boundLane`, a lane word of `Capabilities.executionLane.provider`:
|
|
16253
|
+
`none` from server 7.147.0, `in-process` on servers <= 7.146.x) — they fall through to the STATUS tail (409 ⇒
|
|
16220
16254
|
`ConflictError`), so branch on the code, never on a prefix family. The SDK maps each family to a typed class, so a code this SDK has
|
|
16221
16255
|
never seen still degrades INFORMATIVELY (e.g. a future `capability.xyz_required` already lands on
|
|
16222
16256
|
CapabilityUnavailableError). Family examples not named elsewhere in this document:
|
|
@@ -21682,6 +21716,9 @@ components:
|
|
|
21682
21716
|
rowVerdict:
|
|
21683
21717
|
allOf: [{ $ref: '#/components/schemas/CheckpointRowVerdict' }]
|
|
21684
21718
|
description: '`pending` frames only (server >= 7.144.0): the spread PendingCheckpoint row''s `rowVerdict` (ABSENT IS NOT `ok`).'
|
|
21719
|
+
agent:
|
|
21720
|
+
allOf: [{ $ref: '#/components/schemas/SessionAgent' }]
|
|
21721
|
+
description: '`pending` frames of the checkpoint family only (server >= 7.145.0): the spread PendingCheckpoint row''s `agent` (same read port; `resolved` frames do not carry it; absent = this server did not say, not "not a child").'
|
|
21685
21722
|
checkpointId: { type: string, description: '`pending` frames only (server >= 7.133.0): the spread PendingCheckpoint row''s `checkpointId` (key absent when the row has no trusted value — read as "no joinable identity").' }
|
|
21686
21723
|
consumerState: { type: string, enum: [absent], description: '`live_pending` frames only (server >= 7.133.0): the spread LivePendingRow''s true-only `consumerState` (no engine leg on this replica is waiting for the ask).' }
|
|
21687
21724
|
errorCode: { type: string, description: '`error` frames: the machine code (`STREAM_MAX_DURATION` / `draining` / server >= 7.133.0 `approvals.read_unavailable` — the stream STAYS open, do NOT reconnect on it — / `approvals.read_corrupt` — a corrupt row was read, the server closes the stream after the frame).' }
|
|
@@ -22622,7 +22659,7 @@ components:
|
|
|
22622
22659
|
`false`), while `lane` arms on the manager / the hands / the opt-out and NOT on the mount — so
|
|
22623
22660
|
`{mounted: false, lane: "diagnostics"}` is a REAL, REACHABLE state, not bad data. LANE REACH (server >= 7.127.0 / core 7.50.0):
|
|
22624
22661
|
LSP mounts only on a lane that binds reads to the object it judged — today the host lane; on e2b / k8s (and ssh / adb / device /
|
|
22625
|
-
local-docker / in-process) this section is always absent and the roster has no LSP tool (the server logs `lsp_not_mounted` at boot).
|
|
22662
|
+
local-docker / `none` — `in-process` on servers <= 7.146.x) this section is always absent and the roster has no LSP tool (the server logs `lsp_not_mounted` at boot).
|
|
22626
22663
|
additionalProperties: false
|
|
22627
22664
|
required: [mounted]
|
|
22628
22665
|
properties:
|
|
@@ -23895,7 +23932,7 @@ components:
|
|
|
23895
23932
|
|
|
23896
23933
|
⚠️ ON THIS HTTP ROUTE `found` IS ALWAYS TRUE. Upstream only writes false when its injected file reader
|
|
23897
23934
|
returns undefined or throws, and the server adapter hands back the request's own REQUIRED `content`
|
|
23898
|
-
field — so it can never be absent. Empty text, `{}`, and a file with no
|
|
23935
|
+
field — so it can never be absent. Empty text, `{}`, and a file with no permission lists all still report
|
|
23899
23936
|
`found: true` (they simply yield no candidates). Do NOT use `found` as "did this layer contribute
|
|
23900
23937
|
rules" — read `candidates` for that. The field is kept because it is part of core's preview shape
|
|
23901
23938
|
(it only discriminates for a host whose reader touches a real filesystem).
|
|
@@ -23911,7 +23948,7 @@ components:
|
|
|
23911
23948
|
description: >
|
|
23912
23949
|
One settings layer submitted to rulesCcImportPrepare. The CONTENT is submitted by the caller because a
|
|
23913
23950
|
cloud deployment has no access to the user's filesystem — that is the deployment shape, not a bypass:
|
|
23914
|
-
|
|
23951
|
+
the server reads exactly the permission lists of that submitted content.
|
|
23915
23952
|
|
|
23916
23953
|
🔴 TWO ARMS BY `layer` (server >= 7.143.0 / engine 7.61.0, BREAKING, no alias): a `userSettings` layer is `{ layer, path, content }` and carries
|
|
23917
23954
|
NO `root` (a body sending one ⇒ 400 `request.body_shape`; its `/`-rooted path rules stay in the settings file, reported as
|
|
@@ -23998,58 +24035,60 @@ components:
|
|
|
23998
24035
|
never hand it to another user.
|
|
23999
24036
|
expiresAtMs: { type: integer, description: 'Absolute server-clock expiry (the window is 10 minutes — one interaction, not a session).' }
|
|
24000
24037
|
|
|
24001
|
-
|
|
24038
|
+
RuleImportKey:
|
|
24002
24039
|
type: object
|
|
24003
|
-
description: >
|
|
24004
|
-
One member of the redeem 200 (core `RedeemedBatchMember`, the 200-REACHABLE arm verbatim — core d.ts
|
|
24005
|
-
permission-rule-consent.d.ts). The union's third arm `{status:"refused", reason}` is STRUCTURALLY
|
|
24006
|
-
UNREACHABLE on this route's 200: any refused member makes the server treat the whole redeem as
|
|
24007
|
-
indeterminate, release the claim and answer 503 `state.rule_import_retry` (server rules-consent.ts) —
|
|
24008
|
-
so this schema honestly describes the two-value `status` only.
|
|
24009
24040
|
additionalProperties: false
|
|
24010
|
-
|
|
24041
|
+
description: >
|
|
24042
|
+
server >= 7.145.0 — a rule's identity in a rule-import redemption receipt: the SAME identity triple as a `GET /v1/rules` listing row
|
|
24043
|
+
(`behavior` + canonical `rule` text + the discriminated `scope` string `global` / `project:<root>`, NOT the preview's `RuleScope` object).
|
|
24044
|
+
Reconcile a receipt row against the listing by comparing these three fields; pass them verbatim to `DELETE /v1/rules`.
|
|
24045
|
+
required: [behavior, rule, scope]
|
|
24011
24046
|
properties:
|
|
24012
|
-
|
|
24013
|
-
|
|
24014
|
-
|
|
24015
|
-
|
|
24016
|
-
|
|
24017
|
-
|
|
24018
|
-
|
|
24019
|
-
|
|
24020
|
-
|
|
24021
|
-
|
|
24022
|
-
|
|
24023
|
-
|
|
24047
|
+
behavior: { $ref: '#/components/schemas/RuleBehavior' }
|
|
24048
|
+
rule: { type: string, minLength: 1 }
|
|
24049
|
+
scope: { type: string, minLength: 1 }
|
|
24050
|
+
|
|
24051
|
+
RuleImportMember:
|
|
24052
|
+
description: >
|
|
24053
|
+
server >= 7.145.0 — one row of the redemption receipt (server `ImportOutcomeMember`), two arms on `outcome`:
|
|
24054
|
+
`persisted` = written by this redemption; `no-op` = an equal rule was already in the store (the engine's `deduped`);
|
|
24055
|
+
`refused` = RESERVED (known refused, known not written) — NOT minted by this server version: the engine's member refusal carries free
|
|
24056
|
+
text only; the word appears once the engine gives the refusal arm a machine-readable verdict bit (that version adds its fields to this arm);
|
|
24057
|
+
`indeterminate` = the engine refused this member and the cause is free text only — it is NOT KNOWN whether it landed: exactly then the row
|
|
24058
|
+
carries `reason: store_refused` and `detail` (the engine's sentence verbatim). The four words are a closed set (the server's persisted
|
|
24059
|
+
receipt schema reads the same table).
|
|
24060
|
+
oneOf:
|
|
24061
|
+
- type: object
|
|
24062
|
+
additionalProperties: false
|
|
24063
|
+
required: [key, outcome]
|
|
24064
|
+
properties:
|
|
24065
|
+
key: { $ref: '#/components/schemas/RuleImportKey' }
|
|
24066
|
+
outcome: { type: string, enum: [persisted, no-op, refused] }
|
|
24067
|
+
- type: object
|
|
24068
|
+
additionalProperties: false
|
|
24069
|
+
required: [key, outcome, reason, detail]
|
|
24070
|
+
properties:
|
|
24071
|
+
key: { $ref: '#/components/schemas/RuleImportKey' }
|
|
24072
|
+
outcome: { const: indeterminate }
|
|
24073
|
+
reason: { const: store_refused }
|
|
24074
|
+
detail: { type: string }
|
|
24024
24075
|
|
|
24025
|
-
|
|
24076
|
+
RuleImportReceipt:
|
|
24026
24077
|
type: object
|
|
24027
|
-
description: >
|
|
24028
|
-
What the import ACTUALLY did (server >= 7.46.0, BREAKING #2 there / core 5.58.0 redeemRuleBatch
|
|
24029
|
-
members passthrough) — a different moment and a different contract from the preview, because dedup,
|
|
24030
|
-
concurrency and redemption-time validation can each move an entry between the two.
|
|
24031
|
-
|
|
24032
|
-
🔴 SHAPE CHANGE (A-075.13): the old three-bucket form `{persisted[], deduped[], skippedAtRedeem[],
|
|
24033
|
-
rev}` left the wire in server 7.46.0 — a consumer reading `result.persisted.length` gets undefined.
|
|
24034
|
-
This schema describes the real wire since then; the SDK type changed with it (a staleness fix, not a
|
|
24035
|
-
behavior change).
|
|
24036
24078
|
additionalProperties: false
|
|
24079
|
+
description: >
|
|
24080
|
+
server >= 7.145.0 — the 200 body of rulesCcImportRedeem: the rule-import REDEMPTION RECEIPT, the same receipt (one mint point) as
|
|
24081
|
+
`POST /v1/rules/local-import/redeem` (a door this SDK does not wrap). Replaces the <= 7.144.x cc-import body
|
|
24082
|
+
`{ result: { members: <engine RedeemedBatchMember rows: candidateIndex / behavior / rule / scope object / status / alreadyRedeemed / dot>, rev } }`,
|
|
24083
|
+
which left the wire (the SDK's `CcImportRedeemResult` / `CcImportResult` / `CcImportRedeemedMember` are deleted, no alias). See the
|
|
24084
|
+
endpoint description for the settle rule.
|
|
24037
24085
|
required: [members, rev]
|
|
24038
24086
|
properties:
|
|
24039
24087
|
members:
|
|
24040
24088
|
type: array
|
|
24041
|
-
items: { $ref: '#/components/schemas/
|
|
24042
|
-
description: '
|
|
24043
|
-
rev: { type: integer, description: 'The
|
|
24044
|
-
|
|
24045
|
-
CcImportRedeemResult:
|
|
24046
|
-
type: object
|
|
24047
|
-
description: 'The 200 body of rulesCcImportRedeem.'
|
|
24048
|
-
additionalProperties: false
|
|
24049
|
-
required: [result]
|
|
24050
|
-
properties:
|
|
24051
|
-
result: { $ref: '#/components/schemas/CcImportResult' }
|
|
24052
|
-
|
|
24089
|
+
items: { $ref: '#/components/schemas/RuleImportMember' }
|
|
24090
|
+
description: 'One row per member, in the engine''s walk order.'
|
|
24091
|
+
rev: { type: integer, minimum: 0, description: 'The bucket''s OCC revision when the redemption finished (bucket-local; not comparable across principals).' }
|
|
24053
24092
|
# ── design/203 §2 撤销面(server 7.12.0)—— 列举行 + 两口的 200 体 ────────────────────────────────
|
|
24054
24093
|
# 行形逐字段照 server `src/rules-consent.ts` 的 `PersistedRuleWireRow`(它自己逐字段照 core 的
|
|
24055
24094
|
# `PersistedAllowRule`,只把 `scope` 换成判别式串)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "36.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": "^
|
|
58
|
+
"@sema-agent/settings-schema": "^17.0.0"
|
|
59
59
|
}
|
|
60
60
|
}
|