@sema-agent/sdk 43.0.0 → 44.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 +43 -0
- package/dist/events.d.ts +13 -8
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +11 -6
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js +3 -2
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/types.d.ts +15 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/openapi.yaml +30 -15
- package/package.json +1 -1
package/openapi.yaml
CHANGED
|
@@ -15502,8 +15502,11 @@ components:
|
|
|
15502
15502
|
(`judgeCheckpointRow`) on the row's stored bytes. The same type on the operator queue row (`PendingCheckpoint.rowVerdict`), the `/v1/approvals/stream` `pending` frame and the
|
|
15503
15503
|
assistant inbox row (`InboxRow.rowVerdict`). ONE JUDGE, TWO FACES: the first-stage resume / decide refusal (409, body carries `reason`) comes from the same judge, so a row
|
|
15504
15504
|
listed with a non-`ok` verdict is refused for the same reason when decided — present it as NOT APPROVABLE; the way out is cancelling the run or leaving the row to a
|
|
15505
|
-
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), `
|
|
15506
|
-
|
|
15505
|
+
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), `field` and `blockedBy` (server >= 7.153.0, core 7.67.0: only on a row whose recorded
|
|
15506
|
+
permission mode, run origin or frozen tool names this engine does not read, which answers `code: checkpoint.config_refused`; of those three arms only the frozen-tool-names one (`blockedBy: config.tool_face_control`) carries a `reason` (engine 7.68.2 mints `not_a_list`, `not_a_string` or `unsupported_pattern` there),
|
|
15507
|
+
the permission-mode (`config.permission_mode_invalid`) and run-origin (`config.run_origin_invalid`) arms carry none — `field` is the refusal's own `detail.field`, `blockedBy` the admission code a fresh run of the same bad value reports,
|
|
15508
|
+
the same two words, under the same names, when a resume refusal body carries them (on server 7.154.0 the refusal body a decision door builds for the parked row's own refusal is rebuilt from this verdict and does not carry them yet: only the queue row and the inbox row do); every other arm omits both), `requires` (capabilities the row needs and this engine lacks) and `sentence` (the engine's human line —
|
|
15509
|
+
display only, never a match key); `code` / `reason` / `field` / `blockedBy` are open strings (owned by core). server >= 7.147.0: the two faces match on `code` EQUALITY — every decision-class resume door (`/decide`, `/plan_review`, `/resume`, `/wake`)
|
|
15507
15510
|
answers the row's OWN refusal with the engine's original code (`checkpoint.invalid_outcome`, e.g. `requirements_damaged`; `checkpoint.unsupported_version` likewise), the same judge's same code as this verdict's `code`, and the refusal's
|
|
15508
15511
|
`error` starts with this verdict's `sentence`; a cause code (`approval_binding_mismatch` for a binding seat, `resume_outcome_invalid` for a body cell / content reject) is given only to a refusal that really has a cause, and that is not the row's own refusal.
|
|
15509
15512
|
Servers <= 7.146.x translate by gate instead (`checkpoint.invalid_outcome` becomes `approval_binding_mismatch` on a `policy_ask` gate and `resume_outcome_invalid` on other gates, with no `blockedBy`): against those, match the two faces on `reason`, not on `code`.
|
|
@@ -15525,6 +15528,8 @@ components:
|
|
|
15525
15528
|
kind: { type: string, enum: [lacking, damaged] }
|
|
15526
15529
|
code: { type: string }
|
|
15527
15530
|
reason: { type: string }
|
|
15531
|
+
field: { type: string }
|
|
15532
|
+
blockedBy: { type: string }
|
|
15528
15533
|
requires: { type: array, items: { type: string } }
|
|
15529
15534
|
sentence: { type: string }
|
|
15530
15535
|
|
|
@@ -18077,9 +18082,9 @@ components:
|
|
|
18077
18082
|
`released.mandate` on a GATE RECORD (archive read, server >= 7.129.0): today's seven `PersistedRuleMandate` words (`cross_boundary_taint` from server >= 7.134.0) PLUS the retired `write_protection_unresolved` (core 7.49.0 rename). Same reading as `GateRecordAskClass`.
|
|
18078
18083
|
GateRecordAskOrigin:
|
|
18079
18084
|
type: string
|
|
18080
|
-
enum: [content_question, plan_review, ancestor_marked, org_unavailable, org_rule, rule_store_unavailable, hook, ask_rule, denial_limit_fallback, shell_gate_tighten, safety_tighten, policy, unresolvable]
|
|
18085
|
+
enum: [content_question, plan_review, ancestor_marked, org_unavailable, org_rule, rule_store_unavailable, hook, ask_rule, denial_limit_fallback, integrity_guard, shell_gate_tighten, safety_tighten, policy, unresolvable]
|
|
18081
18086
|
description: >-
|
|
18082
|
-
`origin` on a GATE RECORD (`GateOutcome.origin`, `ModeRelease.origin`; archive read, server >= 7.129.0): core's
|
|
18087
|
+
`origin` on a GATE RECORD (`GateOutcome.origin`, `ModeRelease.origin`; archive read, server >= 7.129.0): core's `ASK_ORIGINS` (today's list, `integrity_guard` from server >= 7.153.0) PLUS the retired `unresolvable` (core 7.14.0 renamed it `ancestor_marked`).
|
|
18083
18088
|
🔴 CLOSED on this face — the engine judges membership here — unlike the OPEN `AskOrigin` of the approval-card faces (the server only checks a non-empty string there). Same reading as `GateRecordAskClass`.
|
|
18084
18089
|
|
|
18085
18090
|
Settlement:
|
|
@@ -18492,7 +18497,7 @@ components:
|
|
|
18492
18497
|
description: 'Present only when THIS pass settled an ask. Same-present/same-absent as `origin` (I1).'
|
|
18493
18498
|
origin:
|
|
18494
18499
|
allOf: [{ $ref: '#/components/schemas/GateRecordAskOrigin' }]
|
|
18495
|
-
# 🔴 闭集**执法**只在门记录这一面:引擎的 `screenGateOutcome` 对 `origin` 判成员(server >= 7.129.0
|
|
18500
|
+
# 🔴 闭集**执法**只在门记录这一面:引擎的 `screenGateOutcome` 对 `origin` 判成员(server >= 7.129.0 按**档案**读:今天的 `ASK_ORIGINS` ∪ 退役词 `unresolvable`),
|
|
18496
18501
|
# 任何一代引擎都没铸过的词即记录缺陷,服务对缺陷记录是整条不上帧。审批帧那一面不判成员,所以 `AskOrigin` 本体保持真开(见该 schema 的长注)。
|
|
18497
18502
|
# 闭集执法点 = `GateRecordAskOrigin` 这一张 enum(门记录的两个引用点 `GateOutcome.origin` / `ModeRelease.origin` 共用);core 加词时改这一处。
|
|
18498
18503
|
description: >
|
|
@@ -18774,8 +18779,8 @@ components:
|
|
|
18774
18779
|
stays `readonly_out_of_root`).
|
|
18775
18780
|
🔴 core >= 7.6.0 — the MCP family within this open set is now the CLOSED `McpFailureKind` word list
|
|
18776
18781
|
(`connect_refused` / `connection_failed` / `connection_closed` / `unauthorized` / `http_status` / `not_mcp_response` /
|
|
18777
|
-
`spawn_failed` / `timeout` / `protocol` / `invalid_config` / `credential_unavailable` / `host_refused` / `unknown` — `credential_unavailable` from core 7.58.0 and
|
|
18778
|
-
`unauthorized` from core 7.59.0, server >= 7.138.0; `host_refused` from core 7.60.0, server >= 7.139.0); the retired
|
|
18782
|
+
`spawn_failed` / `timeout` / `protocol` / `invalid_config` / `credential_unavailable` / `host_refused` / `revoked` / `unknown` — `credential_unavailable` from core 7.58.0 and
|
|
18783
|
+
`unauthorized` from core 7.59.0, server >= 7.138.0; `host_refused` from core 7.60.0, server >= 7.139.0; `revoked` from core 7.67.0, i.e. servers embedding that engine, >= 7.153.0 - read on `wiring_manifest.mcp[].errorCode`, not on a call: see below); the retired
|
|
18779
18784
|
`MCP_FAILURE_CODES` spellings — including `network` and the `http_<status>` encoding — are gone,
|
|
18780
18785
|
and an HTTP status now rides the structured `httpStatus` seat on `wiring_manifest.mcp[]` instead of
|
|
18781
18786
|
being baked into the code. The set as a WHOLE stays open (a tool owns its own codes).
|
|
@@ -18783,6 +18788,9 @@ components:
|
|
|
18783
18788
|
server that LOST its session, `mcp.tool_declaration_changed` (the server now declares the tool differently — safety axis / read-only reading / the "a person must answer" mark / task support — or no longer lists it) and
|
|
18784
18789
|
`mcp.tool_listing_unreached` (the post-redial listing walk stopped before reaching the tool, so its new declaration cannot be proved). Every later call to that tool is refused the same way until a listing of the connection
|
|
18785
18790
|
reaches it — the way out is `POST /v1/sessions/{id}/mcp/reconnect` (or the engine's refresh); do not resend as-is. The lost-session failure itself stays `http_status` + `httpStatus: 404` + `delivered: "unknown"`.
|
|
18791
|
+
🔴 A CALL that the revocation ledger refuses before its request leaves reads `mcp.server_revoked`, not the word `revoked` (an engine code since core 5.50.0, passed through verbatim - the server has no mint point): the deployment's
|
|
18792
|
+
revocation ledger answered that the server is withdrawn. (When the revocation lands before a 401 or lost-session RE-SEND, the call answers its first attempt's failure code instead.) `revoked` is the failure class of a revoked DIAL and rides `wiring_manifest.mcp[].errorCode`. Read `delivered` together with the code: `no` = no hop was sent;
|
|
18793
|
+
`unknown` = a first hop was sent and a later redirect hop was revoked (in engine 7.68.2 only the A2A peer's redirect loop mints that form, with `a2a.peer_revoked`).
|
|
18786
18794
|
Consumers MUST branch with a `default` arm and MUST NOT exhaustively switch on known values.
|
|
18787
18795
|
The service enforces only a length bound (>128 chars = malformed, the whole key is DROPPED rather
|
|
18788
18796
|
than truncated — truncating would mint a code core never sent). NOTE: this is a DIFFERENT
|
|
@@ -19880,8 +19888,9 @@ components:
|
|
|
19880
19888
|
`insufficient_scope`) / `none` (the authorization seat holds no authorization for this user), the engine's closed set, echoed by the server (read OPEN); `authorizeUrl` only ever comes from the deployment's authorization seat (this deployment
|
|
19881
19889
|
has none, so it is always absent and the sentence points at connector settings); `principal` is the run's principal when it has one. Once per leg per server (a resume is a new leg and may announce again). The same fact on the status faces is
|
|
19882
19890
|
`errorCode: "unauthorized"` + `authorization`. server >= 7.150.0: `reason` / `authorizeUrl` are members of the MCP authorization record and leave through the same disposition table as the status faces (structural slots: they do not pass the
|
|
19883
|
-
detail's free-text redaction and truncation); a `reason` word outside the closed set drops the pair as a whole, so `reason` is PRESENT IFF its word is in the closed set (read `reason` as optional; servers before 7.150.0 always carry it), and `authorizeUrl` is not let through today (always absent). `server` / `principal` / `sessionId` / `runId` stay as they were. NOT on the user whitelist, though core
|
|
19884
|
-
|
|
19891
|
+
detail's free-text redaction and truncation); a `reason` word outside the closed set drops the pair as a whole, so `reason` is PRESENT IFF its word is in the closed set (read `reason` as optional; servers before 7.150.0 always carry it), and `authorizeUrl` is not let through today (always absent). `server` / `principal` / `sessionId` / `runId` stay as they were. NOT on the user whitelist, though core's register holds it: `route.credential_rebound` (the HOST moved a per-model credential's binding, outside any run) is audience `operator` (core 7.59.0 through 7.68.2) — it never reaches this stream.
|
|
19892
|
+
`model.role_defaulted` (a role seat names a model word the catalog does not hold, so the role reads as unset and the run goes on) was audience `operator` in core 7.59.0 - 7.66.x and is `user` since core 7.67.0:
|
|
19893
|
+
server >= 7.153.0 puts it on the stream, `{ seat, role, model, reason, fallback, sessionId, runId? }` (`reason` is `unknown_model_ref` today; read it OPEN).
|
|
19885
19894
|
Value change: `permission.rule_row_dropped`'s `detail.rows[].rule` is, since core 7.53.0, the rule's original text (the same reading as
|
|
19886
19895
|
`allowed_tool_not_granted`'s `entries[].entry`: at most 1 024 code points, longer cut to 1 024 + a truncation mark, CONTROL CHARACTERS RIDE AS DATA —
|
|
19887
19896
|
neutralize at render); before it was the engine-neutralized single-line form (at most 201 code points). Same keys.
|
|
@@ -19961,8 +19970,8 @@ components:
|
|
|
19961
19970
|
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
|
|
19962
19971
|
`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
|
|
19963
19972
|
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)).
|
|
19964
|
-
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;
|
|
19965
|
-
|
|
19973
|
+
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; core's code book listed audience `operator`
|
|
19974
|
+
through core 7.66.x - this server put it on the run event stream anyway - and lists `user` since core 7.67.0, which server >= 7.153.0 carries) - this run WENT AHEAD while its read-deny rules are not byte-enforced (the read-deny table has rows, the execution environment does not
|
|
19966
19975
|
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` =
|
|
19967
19976
|
`{ 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.
|
|
19968
19977
|
The same `{ code, message }` pair lands once more on the terminal result as `readDenyFloor` (`TaskResult.readDenyFloor`).
|
|
@@ -20983,7 +20992,7 @@ components:
|
|
|
20983
20992
|
# 当天,一个**合法**的审批卡就会被严格消费端拒收。`x-open-enum` 只是意图标记,不解除 enum 的执法 ——
|
|
20984
20993
|
# 这正是本车刚从 `CheckpointGate` 拆掉的那个假开集,不在这里换个地方重犯。
|
|
20985
20994
|
# 闭集**执法**只属于**筛过的**那一面(`GateOutcome.origin`:引擎的 `screenGateOutcome` 判成员,
|
|
20986
|
-
# 出集即整条不上帧),所以那张 enum
|
|
20995
|
+
# 出集即整条不上帧),所以那张 enum 落在**那个引用点**,恰一处。已知词见下面的描述。
|
|
20987
20996
|
description: >
|
|
20988
20997
|
WHO raised an ask (`ApprovalRequestLiveFacts.origin`; server >= 7.57.0 / core 7.5.0) — core's
|
|
20989
20998
|
`ASK_ORIGINS`, ENGINE-STAMPED at the gate (core's words: "engine-stamped at the gate, never a policy's
|
|
@@ -21016,13 +21025,19 @@ components:
|
|
|
21016
21025
|
and it never reaches an approver as an `AskRequest`); only the plan pause's decide lane stamps it, so the decided row's record
|
|
21017
21026
|
names the ask it settled.
|
|
21018
21027
|
|
|
21028
|
+
🔴 core 7.67.0 ADDS A THIRTEENTH WORD (server >= 7.153.0), between `denial_limit_fallback` and `shell_gate_tighten`: `integrity_guard` = an
|
|
21029
|
+
always-on engine integrity guard put the question in its own words — a removal of a protected location, an unverifiable recursive delete,
|
|
21030
|
+
shell text the engine cannot read, a write to the session transcript. The same ask carries one `askReasons` entry `{ by: "integrity_guard", words }`
|
|
21031
|
+
with the card's sentence. The engine pins the real-approval bit on these asks at the guard's two mint sites; this word is a transcription,
|
|
21032
|
+
not a permission rule.
|
|
21033
|
+
|
|
21019
21034
|
The SAME type is the `origin` member of `GateOutcome` on `tool_end` — one vocabulary, two faces.
|
|
21020
21035
|
|
|
21021
21036
|
server >= 7.102.0 (S-755 / cli L-695 / C-R111): the word now also rides the `livePending` row top level
|
|
21022
21037
|
(read once with the frame's) and the operator queue row (`GET /v1/approvals` `pending[]` + the `/stream`
|
|
21023
21038
|
`pending` frame — the park-row twin seat, screened by core's `isAskOrigin`), besides the frame and the inbox
|
|
21024
21039
|
row — five faces, one word. `card_json` / the `approval_request` frame still do not carry it (the card is
|
|
21025
|
-
`.strict()`). The known words (
|
|
21040
|
+
`.strict()`). The known words (thirteen from core 7.67.0) are exported at runtime as the SDK's `ASK_ORIGINS` (core
|
|
21026
21041
|
`ASK_ORIGINS`, verbatim and in order) — known words, NOT an enforcement table.
|
|
21027
21042
|
|
|
21028
21043
|
AllowRuleMember:
|
|
@@ -21926,7 +21941,7 @@ components:
|
|
|
21926
21941
|
additionalProperties: false
|
|
21927
21942
|
required: [by, words]
|
|
21928
21943
|
properties:
|
|
21929
|
-
by: { type: string, enum: [content_question, plan_review, ancestor_marked, org_unavailable, org_rule, rule_store_unavailable, ask_rule, denial_limit_fallback, shell_gate_tighten, safety_tighten, policy], description: 'AskOrigin words minus `hook` (the server card schema''s table; an entry outside it withholds the whole seat).' }
|
|
21944
|
+
by: { type: string, enum: [content_question, plan_review, ancestor_marked, org_unavailable, org_rule, rule_store_unavailable, ask_rule, denial_limit_fallback, integrity_guard, shell_gate_tighten, safety_tighten, policy], description: 'AskOrigin words minus `hook` (the server card schema''s table; an entry outside it withholds the whole seat).' }
|
|
21930
21945
|
words: { type: string }
|
|
21931
21946
|
|
|
21932
21947
|
HookQuestionCause:
|
|
@@ -23962,7 +23977,7 @@ components:
|
|
|
23962
23977
|
description: >
|
|
23963
23978
|
core >= 7.6.0 — the `McpFailureKind` word (`connect_refused` / `connection_failed` /
|
|
23964
23979
|
`connection_closed` / `unauthorized` / `http_status` / `not_mcp_response` / `spawn_failed` / `timeout` /
|
|
23965
|
-
`protocol` / `invalid_config` / `credential_unavailable` / `host_refused` / `unknown`; server >= 7.139.0 (core 7.60.0): `host_refused` = the host seat of a host-supplied transport did not hand the request to the remote (nothing was
|
|
23980
|
+
`protocol` / `invalid_config` / `credential_unavailable` / `host_refused` / `revoked` / `unknown`; `revoked` (core 7.67.0, servers embedding it, >= 7.153.0) = the deployment's revocation ledger answered that the server or peer is withdrawn when the engine went to dial it, so the dial was refused and nothing was sent (`delivered: "no"`; a CALL the ledger refuses before its request leaves is `mcp.server_revoked` on `tool_end.errorCode`, not this word); server >= 7.139.0 (core 7.60.0): `host_refused` = the host seat of a host-supplied transport did not hand the request to the remote (nothing was
|
|
23966
23981
|
sent; no deployment of this server mounts one today, the word is the engine's); server >= 7.138.0: `unauthorized` = the principal must authorize this server
|
|
23967
23982
|
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
|
|
23968
23983
|
seat answered that the principal is not authorized here; earlier servers sent the first two as `http_status`; `credential_unavailable` = the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "44.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",
|