@sema-agent/sdk 9.1.0 → 9.2.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 +27 -1
- package/dist/errors.d.ts +23 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +25 -9
- package/dist/errors.js.map +1 -1
- package/dist/resources/approvals.d.ts +10 -6
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js +10 -6
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +29 -8
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js +9 -3
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/types.d.ts +42 -8
- package/dist/types.d.ts.map +1 -1
- package/openapi.yaml +77 -18
- package/package.json +1 -1
package/openapi.yaml
CHANGED
|
@@ -2652,16 +2652,20 @@ paths:
|
|
|
2652
2652
|
`POST /v1/assistant/tasks/{taskId}/resume`. Retrying the same body never succeeds.
|
|
2653
2653
|
SEVENTH group (server >= 7.69.0 / S-185, the PARKED WORKFLOW-CHILD lane): `decide.workflow_host_unknown`
|
|
2654
2654
|
and `decide.workflow_host_not_parked`. The pending belongs to a workflow child that parked on an
|
|
2655
|
-
approval gate, and the deployment could not hand the decision to that workflow's HOST session
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2655
|
+
approval gate, and the deployment could not hand the decision to that workflow's HOST session. Both
|
|
2656
|
+
bodies carry `runId` (the WORKFLOW run) and NO `taskId`. NOTHING was consumed: the child's checkpoint
|
|
2657
|
+
stays PENDING and the card is still listable and re-decidable. SDK → DecideWorkflowHostError (`.runId`
|
|
2658
|
+
is the handle). `_host_unknown` = the run carries no originating session at all (a directly started
|
|
2659
|
+
`runWorkflow`, not a Workflow tool call) → NO retry value, a person resumes that `runId`.
|
|
2660
|
+
`_host_not_parked` = the host is not currently parked awaiting this run. ⚰️ RETIRED at server 7.72.0,
|
|
2661
|
+
no alias, but this SDK still maps it: `SUPPORTED_SERVER_FLOOR` is 3.0.0 and this code was introduced
|
|
2662
|
+
at 7.69.0, so a still-supported server in the [7.69.0, 7.72.0) window can genuinely send it, and for
|
|
2663
|
+
that window the old contract holds — retry once it parks again, or resume that `runId` yourself. A
|
|
2664
|
+
server >= 7.72.0 will never send this code again: that version replaced the dead end with a SECOND
|
|
2665
|
+
leg that instead mints a fresh run on the same host session, so against a current server the SAME
|
|
2666
|
+
decide either resumes the parked host or starts that new run (both land on the byte-identical
|
|
2667
|
+
acceptance shape) — a host session already busy with another run instead answers the ordinary 409
|
|
2668
|
+
`conflict.session_active_run`.
|
|
2665
2669
|
SIXTH group (A-075.10, TIME-BASED retry-later pair): `resume.usage_window_exhausted` (#449 G1,
|
|
2666
2670
|
core 5.60.1 — the deployment governance window on this run's ledger key is full; NOTHING was
|
|
2667
2671
|
consumed or unpinned, the SAME token with the SAME decision redeems once the window slides) and
|
|
@@ -8812,9 +8816,16 @@ components:
|
|
|
8812
8816
|
lane's 200 DO mean the engine committed the decision — one sentence ("approved and in effect") cannot be
|
|
8813
8817
|
used for both lanes.
|
|
8814
8818
|
(2) delivery can still be LOST: if the host run is interrupted before it re-invokes `Workflow`, the
|
|
8815
|
-
decision goes with that invocation (it is not persisted anywhere)
|
|
8816
|
-
|
|
8817
|
-
|
|
8819
|
+
decision goes with that invocation (it is not persisted anywhere); because the card was pending
|
|
8820
|
+
throughout, nothing is forged. Against a server >= 7.72.0 a retry of the SAME decide succeeds — that
|
|
8821
|
+
version gave this lane a second leg that mints a fresh run on the same host session when the host is not
|
|
8822
|
+
currently parked, so the retry either resumes the parked host or starts that new run (byte-identical
|
|
8823
|
+
acceptance shape either way; a host session already busy with another run instead answers the existing
|
|
8824
|
+
`conflict.session_active_run` 409). Against a still-supported server in the [7.69.0, 7.72.0) window
|
|
8825
|
+
(`SUPPORTED_SERVER_FLOOR` is 3.0.0) the retry instead answers 409 `decide.workflow_host_not_parked` —
|
|
8826
|
+
retry once the host parks again, or resume that `runId` yourself. ⚰️ That code is RETIRED at 7.72.0, no
|
|
8827
|
+
alias, and a current server will not send it again — but it remains a live, supported response from an
|
|
8828
|
+
older server in that window, so the SDK still maps it (see `DecideWorkflowHostError`).
|
|
8818
8829
|
The durable approval-queue projection is UNCHANGED — no key marks the workflow origin on any read face.
|
|
8819
8830
|
required: []
|
|
8820
8831
|
additionalProperties: false
|
|
@@ -9155,6 +9166,21 @@ components:
|
|
|
9155
9166
|
one-off question. The value comes WHOLE from core (`summarizeCheckpoint` echoes it only when the
|
|
9156
9167
|
cause is a member of the engine's set), so the server neither recomputes nor re-screens it. See
|
|
9157
9168
|
ClassifierUnavailable for the open-`cause` rule and the three shapes absence covers.
|
|
9169
|
+
RETIRED: server >= 7.72.0 (core 7.14.0 #688) never mints this key on any of the three faces; its
|
|
9170
|
+
successor is `disposition.cause` on the gate record (`unavailable` / `parse_error` — a different
|
|
9171
|
+
question, so an old switch does not port). Kept for servers in [7.69.0, 7.72.0) only (sdk 9.2.0).
|
|
9172
|
+
ruleStoreUnreadable:
|
|
9173
|
+
type: string
|
|
9174
|
+
enum: [store, call]
|
|
9175
|
+
description: >-
|
|
9176
|
+
server >= 7.72.0 (core 7.14.0 #688 C3), ADDITIVE — WHICH HALF of the rule lane could not be read.
|
|
9177
|
+
Present iff `origin === "rule_store_unavailable"`: `store` = the wired rule store could not be read
|
|
9178
|
+
(look at the store / network); `call` = the store was read but THIS command could not be read against
|
|
9179
|
+
the person's deny/ask rows (look at the command spelling). One `origin` word covers both facts, and
|
|
9180
|
+
their recovery verbs live in different places (ops vs prompt). Carried on the live `tool_approval`
|
|
9181
|
+
frame and the inbox row; the `card_json` card deliberately does NOT carry it (it travels with `origin`,
|
|
9182
|
+
which is not on the card). Absence = `origin` is not that word — NOT an assertion that the rule store
|
|
9183
|
+
is healthy.
|
|
9158
9184
|
|
|
9159
9185
|
InboxList:
|
|
9160
9186
|
type: object
|
|
@@ -10227,6 +10253,18 @@ components:
|
|
|
10227
10253
|
properties:
|
|
10228
10254
|
kind: { const: denied }
|
|
10229
10255
|
deniedBy: { $ref: '#/components/schemas/DeniedBy' }
|
|
10256
|
+
cause:
|
|
10257
|
+
type: string
|
|
10258
|
+
description: >-
|
|
10259
|
+
server >= 7.72.0 (core 7.14.0 #688 C-a) — the SHAPE of this deny when the auto-mode classifier was
|
|
10260
|
+
the refusing layer: `unavailable` (that classifier round could not run: threw / refused / over cap)
|
|
10261
|
+
or `parse_error` (it ran but answered outside the verdict contract, so the call was stopped to be
|
|
10262
|
+
safe). Successor seat of the retired `classifierUnavailable` key (minted once by the engine, carried
|
|
10263
|
+
on both `tool_end.gate` and `permissionDenied.gate`) — but NOT the same question as the old `cause`
|
|
10264
|
+
(`error` / `timeout` answered WHY it was unavailable), so an old switch does not port. The
|
|
10265
|
+
vocabulary's owner is the engine (`CLASSIFIER_DENY_CAUSES`); the server passes it through verbatim
|
|
10266
|
+
— branch the two known words and keep a default arm. Absent = this deny was not a classifier-fault
|
|
10267
|
+
shape (policy / person / rule refused); never read absence as "classifier healthy".
|
|
10230
10268
|
|
|
10231
10269
|
GateOutcome:
|
|
10232
10270
|
type: object
|
|
@@ -10265,7 +10303,7 @@ components:
|
|
|
10265
10303
|
# 服务对缺陷记录是整条不上帧 ⇒ 词表外的值在这条 wire 上到不了消费端。审批帧那一面不判成员,
|
|
10266
10304
|
# 所以 `AskOrigin` 本体保持真开(见该 schema 的长注)。这张 enum 是本 spec 里该词表的**唯一**
|
|
10267
10305
|
# 执法点;core 加词时改这一处。
|
|
10268
|
-
- enum: [content_question,
|
|
10306
|
+
- enum: [content_question, ancestor_marked, org_unavailable, org_rule, rule_store_unavailable, hook, ask_rule, denial_limit_fallback, shell_gate_tighten, safety_tighten, policy]
|
|
10269
10307
|
description: >
|
|
10270
10308
|
WHO ASKED. Same-present/same-absent as `settlement` (I1). CLOSED here (and only here) — see the
|
|
10271
10309
|
enum note above.
|
|
@@ -10833,16 +10871,19 @@ components:
|
|
|
10833
10871
|
Event_tool_roster_delta:
|
|
10834
10872
|
type: object
|
|
10835
10873
|
description: >
|
|
10836
|
-
|
|
10874
|
+
A RUN-TIME roster change (server >= 7.70.0, core 7.8.0; live-only until 7.71.0, see below).
|
|
10837
10875
|
`wiring_manifest.tools` is the snapshot taken when this leg started; this frame is the increment after
|
|
10838
10876
|
it: one refresh that actually changed the roster emits EXACTLY one frame (ordered after the manifest and
|
|
10839
10877
|
before that refresh's own `tool_end`).
|
|
10840
10878
|
🔴 A `delta.fromDigest` that does not match what the consumer holds is NOT a rejection: `delta.roster`
|
|
10841
10879
|
is the new state regardless — record a skew and re-sync from the whole roster (only `delta.summary`
|
|
10842
10880
|
becomes unusable). 🔴 Half a roster never reaches the wire: the service drops the WHOLE frame when
|
|
10843
|
-
core's own typebox check rejects the payload. 🔴
|
|
10844
|
-
GET /v1/runs/{id}/events
|
|
10845
|
-
|
|
10881
|
+
core's own typebox check rejects the payload. 🔴 Durable legs (server >= 7.71.0, S-212): BOTH durable legs
|
|
10882
|
+
append it too (the three legs share one mint point), so the raw replay `GET /v1/runs/{id}/events`
|
|
10883
|
+
(`runs.events()`, `AgentEvent`) DOES carry it after a reconnect. What still never carries it is the
|
|
10884
|
+
projected trace stream `GET /v1/tasks/{id}/stream` (`trace.stream()`, `TraceStreamEvent`, `mapTraceEvent`
|
|
10885
|
+
drops it with `wiring_manifest` / `human_input`) — consumers on THAT leg keep re-syncing from the
|
|
10886
|
+
`wiring_manifest.tools` snapshot. (Before 7.71.0 the frame was live-only.)
|
|
10846
10887
|
allOf: [{ $ref: '#/components/schemas/EventIdentity' }]
|
|
10847
10888
|
additionalProperties: false # 封闭 + identity 本地镜像:见 Event_reasoning 处的长注
|
|
10848
10889
|
required: [type, delta]
|
|
@@ -11701,6 +11742,21 @@ components:
|
|
|
11701
11742
|
server >= 7.69.0 (core 7.10.0 #616), ADDITIVE, present only when the classifier was consulted and
|
|
11702
11743
|
could not run — WHY this ask reached a human. See ClassifierUnavailable for the open-`cause` rule and
|
|
11703
11744
|
the three shapes absence covers.
|
|
11745
|
+
RETIRED: server >= 7.72.0 (core 7.14.0 #688) never mints this key on any of the three faces; its
|
|
11746
|
+
successor is `disposition.cause` on the gate record (`unavailable` / `parse_error` — a different
|
|
11747
|
+
question, so an old switch does not port). Kept for servers in [7.69.0, 7.72.0) only (sdk 9.2.0).
|
|
11748
|
+
ruleStoreUnreadable:
|
|
11749
|
+
type: string
|
|
11750
|
+
enum: [store, call]
|
|
11751
|
+
description: >-
|
|
11752
|
+
server >= 7.72.0 (core 7.14.0 #688 C3), ADDITIVE — WHICH HALF of the rule lane could not be read.
|
|
11753
|
+
Present iff `origin === "rule_store_unavailable"`: `store` = the wired rule store could not be read
|
|
11754
|
+
(look at the store / network); `call` = the store was read but THIS command could not be read against
|
|
11755
|
+
the person's deny/ask rows (look at the command spelling). One `origin` word covers both facts, and
|
|
11756
|
+
their recovery verbs live in different places (ops vs prompt). Carried on the live `tool_approval`
|
|
11757
|
+
frame and the inbox row; the `card_json` card deliberately does NOT carry it (it travels with `origin`,
|
|
11758
|
+
which is not on the card). Absence = `origin` is not that word — NOT an assertion that the rule store
|
|
11759
|
+
is healthy.
|
|
11704
11760
|
ApprovalRequestFrame:
|
|
11705
11761
|
type: object
|
|
11706
11762
|
description: >
|
|
@@ -11839,6 +11895,9 @@ components:
|
|
|
11839
11895
|
server >= 7.69.0 (core 7.10.0 #616), ADDITIVE — WHY this ask reached a human. Frame and card carry
|
|
11840
11896
|
the SAME value (one narrow-read function server-side). See ClassifierUnavailable for the open-`cause`
|
|
11841
11897
|
rule and the three shapes absence covers.
|
|
11898
|
+
RETIRED: server >= 7.72.0 (core 7.14.0 #688) never mints this key on any of the three faces; its
|
|
11899
|
+
successor is `disposition.cause` on the gate record (`unavailable` / `parse_error` — a different
|
|
11900
|
+
question, so an old switch does not port). Kept for servers in [7.69.0, 7.72.0) only (sdk 9.2.0).
|
|
11842
11901
|
|
|
11843
11902
|
RuleSuggestion:
|
|
11844
11903
|
type: object
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/sdk",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.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",
|