@sema-agent/sdk 44.0.0 → 45.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 +121 -0
- package/dist/errors.d.ts +22 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +13 -3
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +2 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/resources/approvals.d.ts +27 -9
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js +12 -2
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +11 -0
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/transport.d.ts +9 -1
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +11 -1
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +120 -20
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +27 -4
- package/dist/types.js.map +1 -1
- package/openapi.yaml +139 -23
- package/package.json +1 -1
package/dist/types.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
/** Builtin scenarios of a stock `@sema-agent/server` that this SDK offers as known names — **
|
|
2
|
-
*
|
|
1
|
+
/** Builtin scenarios of a stock `@sema-agent/server` that this SDK offers as known names — **seven**, all in the server's builtin table
|
|
2
|
+
* (`BUILTIN_SCENARIO_NAMES` in `src/capabilities/scenarios.ts`; the table `createScenarios()` returns, called `buildScenarios()` on servers ≤7.154.x). `code` is the factory default ([891]); `default` is the
|
|
3
3
|
* domain-neutral assistant face; `scan` is the neutral read-only repo lane; `code-review` is the multi-lens review lane;
|
|
4
4
|
* `cowork` (server ≥7.133.0) is the office-oriented face (`default`'s tool surface without the coding tools — file read / browsing / connector mounts — on the engine's Cowork role base;
|
|
5
5
|
* its detail card reads `toolset: "office"`). A server ≤7.132.x answers `cowork` 400 `scenario_unknown` — gate on `capabilities.scenarios` (the live vocabulary), not on this list.
|
|
6
|
+
* `chat` (server ≥7.155.0) is chat: no hands, a FIXED tool face (web fetch / web search, the skill tool when skills ride, the connectors and A2A peers that reach `chat`), the engine's minimal prompt form;
|
|
7
|
+
* its card reads `toolset: "chat"` and carries {@link ScenarioDetail.allowTools}. `chat-folders` (server ≥7.155.0) is the same fixed face plus a read-only file hand (`Read` / `Grep` / `Glob` over this run's read roots —
|
|
8
|
+
* the folders the request attaches, the caller's `cwd` or the leg's temporary working directory, and read directories the same person allowed long-term before; a read outside them is refused without asking); its card reads `toolset: "folder-read"`, carries `allowTools` and `handsReadOnly: true`, and is runnable only on a deployment that
|
|
9
|
+
* honors caller host paths (otherwise `available: false` + `unavailableReason: "caller_paths_unhonored"`, and submitting answers 501). A server ≤7.154.x answers either name 400 `scenario_unknown`.
|
|
6
10
|
* ⚠️ Servers ≤7.125.x list ONE more name, `discuss` (the multi-agent discussion round-table); **server 7.126.0 retired it with the whole team-orchestration
|
|
7
11
|
* surface (no alias)** — a 7.126.0+ server answers it 400 `scenario_unknown`. It was never listed here. (`Scenario` is open, so `scenario: "discuss"` still compiles; the 400 is the notice.)
|
|
8
12
|
* 🔴 CHECKED AGAINST THE SERVER, not hand-kept (K-20): `test/scenario-capabilities.test.ts` ① reads the builtin table out of
|
|
@@ -18,7 +22,7 @@
|
|
|
18
22
|
* answers it 400 today. Removed here in K-20.
|
|
19
23
|
* Sending a retired name to a ≥5.1.0 server is a LOUD typed 400 `scenario_unknown` (the response carries the
|
|
20
24
|
* deployment's live vocabulary), not a silent fold to `default`. */
|
|
21
|
-
export const KNOWN_SCENARIOS = ["code", "default", "code-review", "scan", "cowork"];
|
|
25
|
+
export const KNOWN_SCENARIOS = ["code", "default", "code-review", "scan", "cowork", "chat", "chat-folders"];
|
|
22
26
|
/** 会话**种类**词(server ≥7.151.0;server 同名常量 `SESSION_KINDS`):今天一词 `sidechain` = 客户端自己放的子对话(默认不在 `GET /v1/sessions` 里列,要 `?sessionKind=sidechain` 视图)。写一次、不变。 */
|
|
23
27
|
export const SESSION_KINDS = Object.freeze(["sidechain"]);
|
|
24
28
|
/**
|
|
@@ -149,7 +153,8 @@ export const ENGINE_CAPABILITY_WORDS = Object.freeze(["inherit_env.own_credentia
|
|
|
149
153
|
export const STORE_DURABILITIES = Object.freeze(["durable", "ephemeral", "unknown"]);
|
|
150
154
|
/** One scenario's detail card (`GET /v1/capabilities/scenarios/:name` — server handler = the
|
|
151
155
|
* `url.startsWith("/v1/capabilities/scenarios/")` branch in `src/http/routes/capabilities.ts`,
|
|
152
|
-
* shape = capabilities/scenarios.d.ts `ScenarioDetail` verbatim
|
|
156
|
+
* shape = capabilities/scenarios.d.ts `ScenarioDetail` verbatim — server ≥7.155.0: `ScenarioCard` = that row plus the two machine bits `allowTools` / `handsReadOnly`, minted only
|
|
157
|
+
* by `scenarioCardOf`; the LIST of names rides `capabilities.scenarios`).
|
|
153
158
|
* `source`/`builtin` = builtin vs center-config overlay; `toolset` names the tool bundle, `tools` the resolved
|
|
154
159
|
* tool names; `promptSummary` is a human-readable prompt digest (NOT the full prompt); `enabled` = a center
|
|
155
160
|
* scenario can be declared-but-disabled.
|
|
@@ -165,6 +170,12 @@ export const STORE_DURABILITIES = Object.freeze(["durable", "ephemeral", "unknow
|
|
|
165
170
|
* · `deployment` —— 这台部署的缺省场景(`DEFAULT_SCENARIO`)。
|
|
166
171
|
* 新词随 server 加 ⇒ 按它分支的 `switch` 留 default 臂。 */
|
|
167
172
|
export const SCENARIO_SOURCES = Object.freeze(["request", "ruling", "deployment"]);
|
|
173
|
+
/** 场景不可用的机读原因词(server 的闭集 `ScenarioUnavailableReason`,自铸词表 `scenarioUnavailableReason`,逐词同序):场景卡 {@link ScenarioDetail.unavailableReason} 与
|
|
174
|
+
* 提交这个场景答的 501 `capability.unavailable` 体根(server ≥7.155.0)同一只词。
|
|
175
|
+
* · `git_client_unconfigured` —— 仓库型场景(scan / code-review / 中心声明的仓库只读工具集)要部署配好 git 后端(`GIT_API_BASEURL`);
|
|
176
|
+
* · `caller_paths_unhonored`(server ≥7.155.0)—— 场景要读调用方按宿主路径交来的文件夹(`chat-folders`),而这台部署不兑现调用方的宿主路径。
|
|
177
|
+
* 读侧开集(未知词 = 「不可用、原因未知」);对本表穷举的 `switch` 留 default 臂。 */
|
|
178
|
+
export const SCENARIO_UNAVAILABLE_REASONS = Object.freeze(["git_client_unconfigured", "caller_paths_unhonored"]);
|
|
168
179
|
/**
|
|
169
180
|
* `credentialPlane.sandboxGit` 平面关闭的原因(server ≥7.137.0,自铸词表 `credentialPlaneSandboxGitOffReason`,九词闭集)—— **取第一个不成立的前提,判序固定 = 数组序**:
|
|
170
181
|
* `single_user`(不是多租户部署)→ `lane_without_boundary`(执行车道不是 k8s 沙箱 pod)→ `no_caller_credential`(本 worker 没有控制台凭据库认的取值凭据)→ `center_not_https`(中心地址不是 https)→
|
|
@@ -264,6 +275,18 @@ export const CROSS_BOUNDARY_TAINT_BITS = Object.freeze(["targetExecutionArmed",
|
|
|
264
275
|
* · `clearanceCustody`(server ≥7.148.0 / 引擎 7.66.0,插在 `quarantineCopy` 之后,引擎序)—— 来源清标留在托管里的那份条目正文(抹除时一并抹掉,清标行带 `custodyErased: true`)。
|
|
265
276
|
*/
|
|
266
277
|
export const MEMORY_ERASURE_CARRIER_CLASSES = Object.freeze(["projection", "shadow", "indexLine", "quarantineCopy", "clearanceCustody", "planArchive", "planWorkbook", "evidenceBinding", "backendDerived"]);
|
|
278
|
+
/**
|
|
279
|
+
* **工作流成员停驻卡**上「决定行写成了」的那一类 200 的两个词(闭集,server ≥7.155.0;按 `status` 判别,两臂见 {@link WorkflowParkDecisionReceipt})。
|
|
280
|
+
* 两扇决断口同一张体:`POST /v1/approvals/{sessionId}/decide`,与按问决断口的停驻形(那一口把体里的 `taskId` 改放 `carrierTaskId`,见
|
|
281
|
+
* {@link import("./resources/tool-approvals.js").AskDecisionParkedRedeemed})。
|
|
282
|
+
* · `recorded` —— 这只决定已作为这张卡的决定记在部署的决定店里、寄给 `runId`(持有这张卡的那条 workflow run);**没有**一条在跑的宿主那一跑带着它
|
|
283
|
+
* (持有它的 run 还在跑、由它自己的进程交付;或带着它的那一跑在受理之前就停了 —— 宿主会话的下一跑会带上它);
|
|
284
|
+
* · `delivered` —— 记下了,**并且**宿主会话上一条在跑的那一跑(`taskId`,run 店里那一跑,`GET /v1/runs/:taskId` 读得到)已带着它起跑 / 续上。
|
|
285
|
+
* 词只说**答话那一刻**服务端这边成立的事:引擎之后怎么处置这只决定(续上了 / 没用上)不在回执上,回执的词也从不随它改写 —— 两个词都**不是**「门已解决」,
|
|
286
|
+
* 那张卡在 200 之后仍可能列在 `/v1/approvals` 上。老服务端(< 7.155.0)在这类卡上答 `resuming`,形见 {@link import("./resources/approvals.js").ParkedDecideAccepted}。
|
|
287
|
+
* 冻结(`Object.freeze`):开集读者对它 `satisfies Record<WorkflowParkDecisionReceiptStatus, …>` 做两向穷举。
|
|
288
|
+
*/
|
|
289
|
+
export const WORKFLOW_PARK_DECISION_RECEIPT_STATUSES = Object.freeze(["recorded", "delivered"]);
|
|
267
290
|
// ═══════════════════════════════════════════════════════════════════════════════════════════════
|
|
268
291
|
// server ≥7.147.0 · 项目登记簿读面({@link import("./resources/projects.js").ProjectsResource})
|
|
269
292
|
// ═══════════════════════════════════════════════════════════════════════════════════════════════
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyEA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyEA;;;;;;;;;;;;;;;;;;;;;;;qEAuBqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa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,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC,CAAC"}
|
package/openapi.yaml
CHANGED
|
@@ -3765,7 +3765,8 @@ paths:
|
|
|
3765
3765
|
description: >-
|
|
3766
3766
|
Decision accepted. Usually the run (or the parked background agent) resumes; on the two parked-agent forms that can never revive,
|
|
3767
3767
|
a DENY (server >= 7.136.0) is answered `{ taskId, status: "failed", decision: "deny" }` instead — the card is voided and nothing resumes
|
|
3768
|
-
(see `ParkedDecideAccepted`, `ApprovalDecisionResult`).
|
|
3768
|
+
(see `ParkedDecideAccepted`, `ApprovalDecisionResult`). On a parked workflow-member card (server >= 7.155.0) the receipt is
|
|
3769
|
+
`recorded` or `delivered` (`WorkflowParkDecisionReceipt`): the decision is recorded; neither word means the gate is resolved.
|
|
3769
3770
|
content:
|
|
3770
3771
|
application/json:
|
|
3771
3772
|
schema:
|
|
@@ -7730,14 +7731,15 @@ components:
|
|
|
7730
7731
|
type: string
|
|
7731
7732
|
description: >
|
|
7732
7733
|
Primary routing axis (one image serves many). Selects model/tools/skills/prompt. OPEN: a stock server's builtin
|
|
7733
|
-
table is `code` (factory default) / `default` / `code-review` / `scan` / `cowork` (SDK `KNOWN_SCENARIOS`, checked against the
|
|
7734
|
-
published server's `
|
|
7734
|
+
table is `code` (factory default) / `default` / `code-review` / `scan` / `cowork` / `chat` / `chat-folders` (SDK `KNOWN_SCENARIOS`, checked against the
|
|
7735
|
+
published server's builtin table — `createScenarios()` on server >= 7.155.0, `buildScenarios()` before; `chat` and `chat-folders` are server >= 7.155.0,
|
|
7736
|
+
an older server answers them 400 `scenario_unknown`; servers <= 7.125.x also listed `discuss`, retired with the whole team-orchestration surface at
|
|
7735
7737
|
7.126.0, no alias) — and a deployment may register more through the registry. A name
|
|
7736
7738
|
the caller SENDS that the deployment does not serve is a loud 400 `scenario_unknown` (server >= 5.1.0, the body
|
|
7737
7739
|
carries the live vocabulary) — the silent fold to `default` exists only on the server-side ASSIGNMENT chain.
|
|
7738
7740
|
Retired, no alias: `oa` (5.0.0), `autonomous` ([2400] CAPS-OPS-11), `team` (renamed `discuss`, server #273 / C-R14;
|
|
7739
7741
|
alias withdrawn at #342).
|
|
7740
|
-
examples: ['code', 'default', 'code-review', 'scan', 'cowork']
|
|
7742
|
+
examples: ['code', 'default', 'code-review', 'scan', 'cowork', 'chat', 'chat-folders']
|
|
7741
7743
|
|
|
7742
7744
|
ScenarioSource:
|
|
7743
7745
|
type: string
|
|
@@ -7766,6 +7768,7 @@ components:
|
|
|
7766
7768
|
# server 7.7.0([C132]/[3235]):+available/unavailableReason 两键——运行面可用性投影,与请求该
|
|
7767
7769
|
# 场景时的 501 拒绝臂同一谓词(server `scenarioAvailability()` 单一属主);`enabled`=声明面、
|
|
7768
7770
|
# `available`=运行面,两轴独立。封闭集从 8 键升 9 必填+1 条件键。
|
|
7771
|
+
# server 7.155.0:200 体 = server `ScenarioCard`(详情行 + `scenarioCardOf` 多铸的两只条件键 `allowTools` / `handsReadOnly`;自铸登记表 `scenarioCardKey`)。
|
|
7769
7772
|
required: [name, source, builtin, summary, toolset, tools, promptSummary, enabled, available]
|
|
7770
7773
|
additionalProperties: false
|
|
7771
7774
|
properties:
|
|
@@ -7787,7 +7790,25 @@ components:
|
|
|
7787
7790
|
included) — the same single filter that feeds `TaskSpec`, same group, same order. A client's `/skill-name` completion reads it; naming one goes through `userInvokedSkills`. Entries carry no body and none of a skill's tool lists. On the card
|
|
7788
7791
|
but not in the run: `disableSkills: true` (nothing mounted) and a skill whose body exceeds the engine's load cap (naming it answers `config.user_invoked_skill_unknown`). ABSENT = an older server: the list cannot be read —
|
|
7789
7792
|
NOT "no skills" (that is `[]`). Bit: `capabilities.scenarioSkills`.
|
|
7790
|
-
unavailableReason: { type: string, description: 'machine-readable reason, present ONLY when available:false (absent = no reason).
|
|
7793
|
+
unavailableReason: { type: string, description: 'machine-readable reason, present ONLY when available:false (absent = no reason). The server''s closed set (SDK `SCENARIO_UNAVAILABLE_REASONS`): `git_client_unconfigured` (a repo-type scenario without `GIT_API_BASEURL`) / `caller_paths_unhonored` (server >= 7.155.0: `chat-folders` reads folders the caller names by host path, and this deployment does not honor caller host paths — multi-tenant, sandbox lanes, device lane, no hands); branch on the key, never match the English prose. Additive-open: treat an unknown word as "unavailable, reason unknown". Server >= 7.155.0: submitting that scenario answers 501 `capability.unavailable` with the SAME word at the body root (`unavailableReason`).' }
|
|
7794
|
+
allowTools:
|
|
7795
|
+
type: array
|
|
7796
|
+
items: { type: string }
|
|
7797
|
+
description: >-
|
|
7798
|
+
server >= 7.155.0: present ONLY when the scenario's effective definition fixes the run's tool face (built-in `chat` / `chat-folders`; other built-in cards and
|
|
7799
|
+
center-declared scenarios never carry it — a center scenario shadowing a built-in name reads `source: "center"` without it). Value = the selection THIS deployment declares for the
|
|
7800
|
+
scenario: its host tool names, the skill tool when skills ride, the hand's tools, one whole-peer selector per connector / A2A peer the deployment tags into it (`mcp__<name>__*` /
|
|
7801
|
+
`a2a__<name>__*`); nothing request-supplied, and the caller's `excludeTools` is not subtracted. Three states: absent = the face is not fixed (or an older server — check
|
|
7802
|
+
`capabilities.scenarios`); `[]` = this deployment gives the scenario no tools; non-empty = a subset. `tools` answers a different question (the host tools the definition brings).
|
|
7803
|
+
What a run actually mounted is its `wiring_manifest`. While present, a submit body that also carries `allowTools` is 400 `request.field_conflict` (`reason: "scenario_tool_face"`).
|
|
7804
|
+
handsReadOnly:
|
|
7805
|
+
type: boolean
|
|
7806
|
+
enum: [true]
|
|
7807
|
+
description: >-
|
|
7808
|
+
server >= 7.155.0: the scenario's runs get the engine's read-only file hand (no write tools, no hand tools whose effect is not a file read, a read outside the run's read
|
|
7809
|
+
roots refused without asking under every permission mode). The read roots are not only the attached folders: the request's read-only additional directories, the caller's `cwd`
|
|
7810
|
+
(else the leg's temporary working directory), and read directories the same person allowed long-term before. Always `true` when present, present ONLY when the scenario
|
|
7811
|
+
declares it (built-in `chat-folders` today); absent = it does not.
|
|
7791
7812
|
|
|
7792
7813
|
ScenarioSkill:
|
|
7793
7814
|
type: object
|
|
@@ -8708,7 +8729,9 @@ components:
|
|
|
8708
8729
|
decide tool availability are `excludeTools`, `allowTools` and `excludeAllTools`. Wrong shape (not a string array) =>
|
|
8709
8730
|
400 `request.field_invalid`, the same gate as `excludeTools` / `deferTools`. An engine older than 7.49.0 rejects loudly (400 `request.field_invalid` naming `allowTools`) —
|
|
8710
8731
|
never silently dropped (dropping a narrowing key widens). No capability bit: probe by key closure (<= 7.125.x answers `400 request.body_shape` with the name in
|
|
8711
|
-
`unknownKeys`). The A2A inbound face (`message/send`) does not carry this key.
|
|
8732
|
+
`unknownKeys`). The A2A inbound face (`message/send`) does not carry this key. Server >= 7.155.0: NOT accepted on a scenario whose tool face is fixed (the scenario
|
|
8733
|
+
card carries `allowTools`: built-in `chat` / `chat-folders`) => 400 `request.field_conflict` (`reason: "scenario_tool_face"`, `fields: ["allowTools"]`, plus `"scenario"` when the
|
|
8734
|
+
body named it), refused before any side effect; narrow such a face with `excludeTools` (it only removes), or send `excludeAllTools: true` for no tools.
|
|
8712
8735
|
excludeAllTools:
|
|
8713
8736
|
type: boolean
|
|
8714
8737
|
enum: [true]
|
|
@@ -15337,13 +15360,25 @@ components:
|
|
|
15337
15360
|
decision}`, an ACCEPTED (not completed) receipt; the revive drives asynchronously. Since server >= 7.136.0 this
|
|
15338
15361
|
shape has a SECOND ARM, the VOIDED receipt `{taskId, status:"failed", decision:"deny"}` — a DENY on a parked row that can
|
|
15339
15362
|
never revive (no agent name / no root-session anchor) voids the card; nothing resumes (see `ParkedDecideAccepted`).
|
|
15363
|
+
🔴 Server >= 7.155.0: a decide on a PARKED WORKFLOW-MEMBER card whose decision row was written answers its own two
|
|
15364
|
+
closed words, two more arms of `ParkedDecideAccepted` (schema `WorkflowParkDecisionReceipt`): `recorded`
|
|
15365
|
+
`{status, runId, decisionId, decision, bindingEnforced}` (the decision is recorded and addressed to `runId`, the workflow run
|
|
15366
|
+
holding the card; no running host turn carries it) and `delivered` `{status, taskId, sessionId, runId, decisionId, decision,
|
|
15367
|
+
bindingEnforced}` (a running host-session turn, `taskId`, in the run store, carries it). Each word has a FIXED key set.
|
|
15368
|
+
Both say only what held when the answer was given; neither means the gate is resolved.
|
|
15340
15369
|
A FOURTH shape, the #368 IDEMPOTENT REPLAY (server >= 7.4x; declared 2026-09-08 — it shipped without
|
|
15341
15370
|
ever reaching this schema): `{sessionId, idempotent:true, decision, bindingEnforced:true,
|
|
15342
15371
|
executionOutcome?}` — it carries NO `status` and NO `taskId` (nothing was accepted this time). So no key
|
|
15343
|
-
is guaranteed by all four shapes; discriminate: `idempotent` -> replay; `decision`
|
|
15344
|
-
parked receipt
|
|
15372
|
+
is guaranteed by all four shapes; discriminate: `idempotent` -> replay; otherwise `decision` present ->
|
|
15373
|
+
parked receipt (`ParkedDecideAccepted`, four arms, read `status`: `resuming` / `failed` / `recorded` / `delivered`);
|
|
15374
|
+
no `decision` -> task-level acceptance / terminal. (The older reading "`decision` without `sessionId`" fails on
|
|
15375
|
+
the server >= 7.155.0 `delivered` arm, which carries `sessionId`.)
|
|
15345
15376
|
`taskId` rides `getActiveTaskId` on the terminal leg (omitted when there is no active row).
|
|
15346
|
-
|
|
15377
|
+
The next two paragraphs describe what a server OLDER THAN 7.155.0 answers on the workflow-member lane (this package
|
|
15378
|
+
still holds against them): `status:"resuming"` — the host acceptance shape below once the holding run had ended
|
|
15379
|
+
(server [7.69.0, 7.155.0)), or `{taskId: <workflow run id>, status:"resuming", decision}` while it was still running
|
|
15380
|
+
(server [7.148.0, 7.155.0); that `taskId` is not in the run store).
|
|
15381
|
+
🔴 A FIFTH PROVENANCE, not a fifth key set (server >= 7.69.0 / S-185, until 7.155.0 — the PARKED WORKFLOW-CHILD lane):
|
|
15347
15382
|
when the pending belongs to a workflow child, the success body is byte-identically the TASK-LEVEL
|
|
15348
15383
|
ACCEPTANCE shape, but it is a wake of the workflow's **HOST session** — `taskId` is the host's FRESHLY
|
|
15349
15384
|
MINTED run id, not the child's. Two readings a consumer MUST get right:
|
|
@@ -15389,9 +15424,12 @@ components:
|
|
|
15389
15424
|
[2400] HITL-12 (server >=5.4.0, clay ruling: no legacy tolerance): generation-probe bit — this
|
|
15390
15425
|
server REQUIRES the decision-action binding (a decide without `checkpointToken` and without
|
|
15391
15426
|
`boundCallId` is refused 400 `decide_requires_binding`; the silent current-pending fallback is gone).
|
|
15392
|
-
Always true on the resumed-leg 200; the parked receipt does not carry it
|
|
15393
|
-
|
|
15394
|
-
|
|
15427
|
+
Always true on the resumed-leg 200; the parked background-agent receipt does not carry it; the two workflow-member arms
|
|
15428
|
+
(server >= 7.155.0, `recorded` / `delivered`) always carry it.
|
|
15429
|
+
taskId: { type: string, description: 'Resumed leg: the active run id (OMITTED when no active row). Parked background-agent leg: the agent handle (`a*`), always present. Workflow-member card, server >= 7.155.0: ONLY on `delivered` — the running host-session turn that carries the decision (in the run store); `recorded` has no `taskId`. Older servers on that lane: the host turn (record ended, [7.69.0, 7.155.0)) or the workflow run id (holding run still running, [7.148.0, 7.155.0); not in the run store).' }
|
|
15430
|
+
sessionId: { type: string, description: 'Resumed leg, and the workflow-member `delivered` arm (server >= 7.155.0: the host session of `taskId`) — absent from the parked background-agent receipt and from `recorded`.' }
|
|
15431
|
+
runId: { type: string, description: 'server >= 7.155.0 - workflow-member parked-card receipt only (both arms, `recorded` / `delivered`): the workflow run the decision is addressed to (the run holding the card; read it with GET /v1/workflows/{runId}). It appears ONLY on that parked receipt; narrow by `status` (`ParkedDecideAccepted`), never by whether this key is present.' }
|
|
15432
|
+
decisionId: { type: string, description: 'server >= 7.155.0 - workflow-member parked-card receipt only (both arms): the opaque id of this decision (a replay of the same decision carries the same value; every new human decision gets a new one), the same id as the engine notice `workflow.parked_decision_unused` `detail.decisionIds`. It appears ONLY on that parked receipt; narrow by `status`, never by whether this key is present.' }
|
|
15395
15433
|
decisionCommitted: { type: boolean, enum: [true], description: 'server >= 7.138.0 - SETTLEMENT EVIDENCE: `true` = the gate this request named was durably settled with THIS request''s decision (historical evidence, not the card''s current state). Always the literal `true`, never `false`. Absent = unprovable or deliberately omitted => read as "not committed" (fail-closed); do not infer it from the absence of `errorCode`. It coexists with `errorCode: cancelled` / `retriable: true`; `retriable: true` only says the run re-parked.' }
|
|
15396
15434
|
checkpointId: { type: string, description: 'server >= 7.138.0 - only alongside `decisionCommitted`: the gate identity of the row selected before execution (same name and value as the operator queue / inbox row / park ledger row). Absent when the identity is unreadable or not applicable (an idempotent replay carries none); absence infers nothing.' }
|
|
15397
15435
|
checkpointIdMissing: { $ref: '#/components/schemas/CheckpointIdMissingWord' }
|
|
@@ -15400,11 +15438,12 @@ components:
|
|
|
15400
15438
|
description: >
|
|
15401
15439
|
OPEN string — do NOT narrow. Task-level acceptance (server >= 7.37): the literal `resuming` (= accepted,
|
|
15402
15440
|
resume in flight — follow the run stream). Terminal leg: the run's resulting status (`completed`/`failed`/
|
|
15403
|
-
`suspended`/`needs_review`). Parked leg: the literal `resuming` (= accepted, revive in flight) — or, server >= 7.136.0, the literal `failed` on the VOIDED receipt (a deny that closed a card which could never revive; nothing resumes)
|
|
15441
|
+
`suspended`/`needs_review`). Parked leg: the literal `resuming` (= accepted, revive in flight) — or, server >= 7.136.0, the literal `failed` on the VOIDED receipt (a deny that closed a card which could never revive; nothing resumes) —
|
|
15442
|
+
or, server >= 7.155.0 on a workflow-member card, `recorded` / `delivered` (closed; see `WorkflowParkDecisionReceipt`). The parked receipt's words are a closed set of four (`ParkedDecideAccepted`).
|
|
15404
15443
|
decision:
|
|
15405
15444
|
type: string
|
|
15406
15445
|
enum: [approve, deny]
|
|
15407
|
-
description: 'Parked leg ONLY — echo of the decision that was accepted
|
|
15446
|
+
description: 'Parked leg ONLY (all four `ParkedDecideAccepted` arms) — echo of the decision that was accepted; the replay shape carries it too, beside `idempotent: true`.'
|
|
15408
15447
|
errorCode: { type: string, description: 'Resumed leg — failure code (e.g. `cancelled`, `checkpoint.reopen_failed`). Always emitted alongside a failure since server 1.309 (errorCode is single-track).' }
|
|
15409
15448
|
errorMessage: { type: string, description: 'Resumed leg — human-readable failure detail (server-side secret-redacted).' }
|
|
15410
15449
|
retriable: { type: boolean, description: 'Resumed leg — `true` = the park is STILL pending (the server re-parked it); refetch and decide again. Emitted only when the store CONFIRMED the reopen.' }
|
|
@@ -17420,6 +17459,14 @@ components:
|
|
|
17420
17459
|
`approvals.read_corrupt` (500, server >= 7.134.0 on `GET /v1/approvals` — a queue row's stored body cannot be read; an operator has to repair or
|
|
17421
17460
|
delete the row; server >= 7.135.0 the same judge answers `GET /v1/assistant/inbox` and `GET /v1/assistant/tasks` too) and `workflow.journal_incompatible`
|
|
17422
17461
|
(500, server >= 7.135.0 on `GET /v1/workflows/{id}/journal` — a journal row the engine's judge rejects; the body carries `ordinal`; repair the row from the retained copy, never by deleting it).
|
|
17462
|
+
Two more are exempt the same way: `internal.org_delivery_quota_unreadable` (500, server >= 7.149.0 — the cross-principal delivery door cannot read the server's quota state file, so every delivery is refused
|
|
17463
|
+
until an operator repairs it; the same door's 429 `org_delivery.rate_limited` is a different thing: not in this table, yet the SDK never resends it — `principalInbox.send` is a non-submit POST, so whether to send again after the fixed hourly window is the caller's call) and `rewind.restore_failed` (503, server >= 7.153.0 — the file-history store failed the restore;
|
|
17464
|
+
from 7.154.0 the synchronous submit leg does not occupy the idempotency key on this refusal, so an automatic resend would run the restore again; exempt by code, whatever `permanence` says).
|
|
17465
|
+
Two further 503 codes, whose server code family is also `deterministic`: `auth.service_token_required` (the credential gate: the request carried no credential the gate admits — a service token or an auth-bridge-verified sign-in token —
|
|
17466
|
+
and the deployment has anonymous writes off; task submissions and the rewrite doors always answered it, and server >= 7.154.3 also answers an operator's read of the all-tenants / another-owner view with it;
|
|
17467
|
+
the same request sent again gets the same sentence, only the request (send the credential) or the deployment (configure one) changes it) and `state.no_sandbox_base` (`POST /v1/images/bakes` has no usable
|
|
17468
|
+
`sandbox-base` to build FROM; only an operator pinning `SANDBOX_BASE_REF` or publishing one changes it; a non-submit POST, so the SDK's own retry arm never resends it either way — what changes is
|
|
17469
|
+
the answer of the exported `resendIsMeaningless`).
|
|
17423
17470
|
`invalid_session` (500 on servers 7.137.0–7.143.x for the structurally broken form) is RETIRED at server 7.144.0 and no longer exempt: against those older servers the SDK retries it by status.
|
|
17424
17471
|
Every other 5xx code keeps the status-based retry.
|
|
17425
17472
|
🔴 server >= 7.135.0 read-failure and store-fault codes (all additive; branch on the code, never the sentence): `503 approvals.read_unavailable` on `GET /v1/approvals`, `/v1/assistant/inbox` and
|
|
@@ -22089,18 +22136,25 @@ components:
|
|
|
22089
22136
|
server >= 7.152.0 — the 200 of the decision door on a PARKED ask (the card's window ended and it moved to background standby): the answer goes through the durable redemption leg (the same CAS as
|
|
22090
22137
|
POST /v1/approvals/{sessionId}/decide) and the body is that leg's receipt (ApprovalDecisionResult keys, e.g. `status` / `taskId` / `sessionId`) plus this door's keys. Discriminant: `accepted: "parked_redeemed"`.
|
|
22091
22138
|
`idempotent: true` only on a replay (the same redeemed card answered again).
|
|
22139
|
+
Server >= 7.155.0: this door's `taskId` stays the path's turn, and the receipt's own `taskId` (the run / handle carrying the decision:
|
|
22140
|
+
the task-level run resumed / the revived background-agent handle / the running host turn carrying a workflow-member decision) moves to
|
|
22141
|
+
`carrierTaskId` (absent when the receipt has none — the workflow-member `recorded` word). It is not evidence that anything resumed. On a workflow-member card `status` is
|
|
22142
|
+
`recorded` / `delivered` with `runId` / `decisionId` (the same receipt as /decide; `WorkflowParkDecisionReceipt`).
|
|
22092
22143
|
required: [askId, taskId, decision, decidedAtMs, actor, accepted]
|
|
22093
22144
|
additionalProperties: false # closed like its sibling arm: the key set is ApprovalDecisionResult's own keys (by $ref) plus this door's keys
|
|
22094
22145
|
properties:
|
|
22095
22146
|
askId: { type: string }
|
|
22096
|
-
taskId: { type: string }
|
|
22147
|
+
taskId: { type: string, description: 'This door''s echo key: the turn the ask (the path) belongs to — on every server version. The run / handle carrying the decision is `carrierTaskId`.' }
|
|
22148
|
+
carrierTaskId: { type: string, description: 'server >= 7.155.0 - the redemption receipt''s own `taskId`, i.e. the run / handle carrying this decision: the task-level run resumed / the revived background-agent handle (`a*`) / on a workflow-member `delivered`, the running host turn carrying it (in the run store). It can appear on all three redemption lanes. It is NOT evidence that anything resumed: it only names where the decision was handed. Absent when the receipt has no `taskId` (workflow-member `recorded`); older servers never send it (this door''s `taskId` overwrote it).' }
|
|
22149
|
+
runId: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/runId' }
|
|
22150
|
+
decisionId: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/decisionId' }
|
|
22097
22151
|
decision: { $ref: '#/components/schemas/ApprovalAskDecision' }
|
|
22098
22152
|
decidedAtMs: { type: integer }
|
|
22099
22153
|
actor: { $ref: '#/components/schemas/ActorAssertion' }
|
|
22100
22154
|
accepted: { type: string, enum: [parked_redeemed] }
|
|
22101
22155
|
decisionNote: { type: string }
|
|
22102
22156
|
noteRecorded: { type: boolean }
|
|
22103
|
-
rememberApplied: { type: boolean, description: 'server >= 7.152.0: only when the request carried `remember` and this was the FIRST redemption.' }
|
|
22157
|
+
rememberApplied: { type: boolean, description: 'server >= 7.152.0: only when the request carried `remember` and this was the FIRST redemption. Always `false` on a workflow-member card (the `recorded` / `delivered` receipts of server >= 7.155.0): that lane cannot record the grant, so this door takes the decision and allows this once; no exemption is stored. (The same request on POST /v1/approvals/{sessionId}/decide is answered 400 `decide.workflow_remember_unsupported` on a workflow-member card, so the /decide workflow-member arms never carry this key.)' }
|
|
22104
22158
|
rulePersisted: { type: boolean }
|
|
22105
22159
|
ruleRefusal: { $ref: '#/components/schemas/RuleRefusalReason' }
|
|
22106
22160
|
persistedRule: { type: string }
|
|
@@ -22915,9 +22969,10 @@ components:
|
|
|
22915
22969
|
ParkedDecideAccepted:
|
|
22916
22970
|
description: >
|
|
22917
22971
|
The 200 body of POST /v1/approvals/{sessionId}/decide when the pending checkpoint belongs to a
|
|
22918
|
-
PARKED background agent (server 1.267, ASSISTANT-WIRE-CONTRACT §4a parked variant; server
|
|
22919
|
-
parked-decide.ts — exact literal shapes).
|
|
22920
|
-
(1)
|
|
22972
|
+
PARKED child: a background agent (server 1.267, ASSISTANT-WIRE-CONTRACT §4a parked variant; server
|
|
22973
|
+
parked-decide.ts — exact literal shapes) or, server >= 7.155.0, a workflow member. FOUR ARMS, read by `status` (the SDK type
|
|
22974
|
+
`ParkedDecideAccepted` is their union; arms (1) / (2) are the background agent's, arms (3) / (4) the workflow member's):
|
|
22975
|
+
(1) `status: "resuming"` — the background agent's ACCEPTANCE receipt. The revive drives ASYNCHRONOUSLY — 200 means accepted,
|
|
22921
22976
|
not completed; a failed drive honestly re-parks the row and the pending re-appears on the list.
|
|
22922
22977
|
(2) `status: "failed"` (server >= 7.136.0; `decision` is always `deny`) — the VOIDED receipt: on the two forms that can
|
|
22923
22978
|
never revive (a parked child whose row carries no agent name — an unnamed `Agent` call — or no root-session anchor)
|
|
@@ -22925,8 +22980,15 @@ components:
|
|
|
22925
22980
|
the child ends `failed` (the engine's reconcile), the gated tool never runs, no `remember` is granted — and NOTHING is
|
|
22926
22981
|
resuming. Do not wait for a revive that never comes. APPROVE on those forms stays `409 decide.row_unrevivable`; a lost
|
|
22927
22982
|
void CAS is the existing `409 decide.gate_moved`.
|
|
22928
|
-
|
|
22929
|
-
|
|
22983
|
+
(3) / (4) server >= 7.155.0, a PARKED WORKFLOW-MEMBER card: `status: "recorded"` / `"delivered"` — the two arms of
|
|
22984
|
+
`WorkflowParkDecisionReceipt` (fixed key sets; `recorded` has no `taskId` / `sessionId`). Both cards look the same on the queue
|
|
22985
|
+
(no origin mark), so this is one union over four words. SERVER-VERSION RANGES: servers [7.148.0, 7.155.0) answered a
|
|
22986
|
+
workflow-member card whose holding run was still running with arm (1)'s exact key set, `taskId` then being the workflow run id
|
|
22987
|
+
(not in the run store); servers [7.69.0, 7.155.0) answered one whose run had ended with the task-level acceptance shape
|
|
22988
|
+
(no `decision`; not an arm of this union — read it on `ApprovalDecisionResult`). From 7.155.0 arm (1) is background agents only.
|
|
22989
|
+
Task-level suspends answer their own shapes (see `ApprovalDecisionResult`): outside the replay shape, a parked receipt is
|
|
22990
|
+
the one with `decision` present; then read `status`. (The older reading "`decision` present and `sessionId` absent" fails
|
|
22991
|
+
on the `delivered` arm, which carries `sessionId`.)
|
|
22930
22992
|
oneOf:
|
|
22931
22993
|
- type: object
|
|
22932
22994
|
required: [taskId, status, decision]
|
|
@@ -22948,6 +23010,59 @@ components:
|
|
|
22948
23010
|
decisionCommitted: { type: boolean, enum: [true], description: 'server >= 7.138.0 - SETTLEMENT EVIDENCE: `true` = the gate this request named was durably settled with THIS request''s decision (historical evidence, not the card''s current state). Always the literal `true`, never `false`. Absent = unprovable or deliberately omitted => read as "not committed" (fail-closed); do not infer it from the absence of `errorCode`. It coexists with `errorCode: cancelled` / `retriable: true`; `retriable: true` only says the run re-parked.' }
|
|
22949
23011
|
checkpointId: { type: string, description: 'server >= 7.138.0 - only alongside `decisionCommitted`: the gate identity of the row selected before execution (same name and value as the operator queue / inbox row / park ledger row). Absent when the identity is unreadable or not applicable (an idempotent replay carries none); absence infers nothing.' }
|
|
22950
23012
|
checkpointIdMissing: { $ref: '#/components/schemas/CheckpointIdMissingWord' }
|
|
23013
|
+
- $ref: '#/components/schemas/WorkflowParkDecisionRecorded'
|
|
23014
|
+
- $ref: '#/components/schemas/WorkflowParkDecisionDelivered'
|
|
23015
|
+
|
|
23016
|
+
WorkflowParkDecisionReceipt:
|
|
23017
|
+
description: >
|
|
23018
|
+
server >= 7.155.0 — the 200 of POST /v1/approvals/{sessionId}/decide on a PARKED WORKFLOW-MEMBER card whose decision row was
|
|
23019
|
+
written (the per-ask decision door answers the same receipt on its parked form, with its own `taskId` and the receipt's
|
|
23020
|
+
`taskId` moved to `carrierTaskId`). TWO ARMS, closed, read by `status` (words: the SDK constant
|
|
23021
|
+
`WORKFLOW_PARK_DECISION_RECEIPT_STATUSES`); each arm has a FIXED key set. The words say only what held on the server when it
|
|
23022
|
+
answered: `recorded` = the decision is recorded as this card's decision and addressed to `runId`, and no running host turn
|
|
23023
|
+
carries it; `delivered` = recorded, AND a running host-session turn (`taskId`, in the run store) carries it. Neither means the
|
|
23024
|
+
gate is resolved: the card can still be listed after the 200. Whether the engine used the decision is not on the receipt —
|
|
23025
|
+
match `decisionId` against the engine notice `workflow.parked_decision_unused` `detail.decisionIds`. A 200 where nothing was
|
|
23026
|
+
recorded (the carrying turn was cancelled before the row landed: `{status:"failed", errorCode:"cancelled", …}`) and the replay
|
|
23027
|
+
shape after the card settled (`idempotent: true`) are not arms of this union. Also arms (3) / (4) of `ParkedDecideAccepted`.
|
|
23028
|
+
oneOf:
|
|
23029
|
+
- $ref: '#/components/schemas/WorkflowParkDecisionRecorded'
|
|
23030
|
+
- $ref: '#/components/schemas/WorkflowParkDecisionDelivered'
|
|
23031
|
+
|
|
23032
|
+
WorkflowParkDecisionReceiptStatus:
|
|
23033
|
+
type: string
|
|
23034
|
+
enum: [recorded, delivered]
|
|
23035
|
+
description: 'server >= 7.155.0 — the closed word set of `WorkflowParkDecisionReceipt.status` (SDK constant `WORKFLOW_PARK_DECISION_RECEIPT_STATUSES`, in this order).'
|
|
23036
|
+
|
|
23037
|
+
WorkflowParkDecisionRecorded:
|
|
23038
|
+
type: object
|
|
23039
|
+
description: 'server >= 7.155.0 — the `recorded` arm of `WorkflowParkDecisionReceipt`: exactly five receipt keys, all required; NO `taskId` / `sessionId` (not "unreadable": this word''s key set has none). The only optional keys are the request-conditioned rule slot (`rulePersisted` / `ruleRefusal`, present only when the request carried `persistRule`).'
|
|
23040
|
+
required: [status, runId, decisionId, decision, bindingEnforced]
|
|
23041
|
+
additionalProperties: false
|
|
23042
|
+
properties:
|
|
23043
|
+
status: { type: string, enum: [recorded] }
|
|
23044
|
+
runId: { type: string, description: 'The workflow run the decision is addressed to (the run holding the card; GET /v1/workflows/{runId} — it is not in the run store).' }
|
|
23045
|
+
decisionId: { type: string, description: 'Opaque id of this decision (same value on a replay of the same decision; a new one for every new human decision) — the same id as the engine notice `workflow.parked_decision_unused` `detail.decisionIds`.' }
|
|
23046
|
+
decision: { type: string, enum: [approve, deny] }
|
|
23047
|
+
bindingEnforced: { type: boolean, enum: [true] }
|
|
23048
|
+
rulePersisted: { type: boolean, enum: [false], description: 'Request-conditioned rule slot: present only when the request carried `persistRule`; always `false` on this lane (the server cannot prove the engine committed the decision when it answers, so the rule is not stored). The verdict itself stands. Not a discriminant.' }
|
|
23049
|
+
ruleRefusal: { type: string, enum: [rule_lane_unavailable], description: 'Present with `rulePersisted` (and only then): always `rule_lane_unavailable` on this lane.' }
|
|
23050
|
+
|
|
23051
|
+
WorkflowParkDecisionDelivered:
|
|
23052
|
+
type: object
|
|
23053
|
+
description: 'server >= 7.155.0 — the `delivered` arm of `WorkflowParkDecisionReceipt`: the five `recorded` receipt keys plus `taskId` and `sessionId`, exactly seven receipt keys, all required; the only optional keys are the same request-conditioned rule slot as on `recorded`.'
|
|
23054
|
+
required: [status, taskId, sessionId, runId, decisionId, decision, bindingEnforced]
|
|
23055
|
+
additionalProperties: false
|
|
23056
|
+
properties:
|
|
23057
|
+
status: { type: string, enum: [delivered] }
|
|
23058
|
+
taskId: { type: string, description: 'The running host-session turn that carries the decision — always a run in the run store (GET /v1/runs/{taskId} / events).' }
|
|
23059
|
+
sessionId: { type: string, description: 'The session of `taskId` (the host session).' }
|
|
23060
|
+
runId: { type: string, description: 'The workflow run the decision is addressed to (as on `recorded`).' }
|
|
23061
|
+
decisionId: { type: string, description: 'As on `recorded`.' }
|
|
23062
|
+
decision: { type: string, enum: [approve, deny] }
|
|
23063
|
+
bindingEnforced: { type: boolean, enum: [true] }
|
|
23064
|
+
rulePersisted: { type: boolean, enum: [false], description: 'As on `recorded`: request-conditioned, always `false` on this lane.' }
|
|
23065
|
+
ruleRefusal: { type: string, enum: [rule_lane_unavailable], description: 'As on `recorded`.' }
|
|
22951
23066
|
|
|
22952
23067
|
FleetMeta:
|
|
22953
23068
|
type: object
|
|
@@ -23944,11 +24059,12 @@ components:
|
|
|
23944
24059
|
additionalProperties: false
|
|
23945
24060
|
required: [reason]
|
|
23946
24061
|
description: >
|
|
23947
|
-
server >= 7.138.0 (core 7.59.0 `McpAuthorization`) — an MCP server the principal must authorize first. Rides WITH `errorCode: "unauthorized"` on three
|
|
24062
|
+
server >= 7.138.0 (core 7.59.0 `McpAuthorization`) — an MCP server the principal must authorize first. Rides WITH `errorCode: "unauthorized"` on six faces over three row schemas: the `WiringManifestMcpEntry` row (`wiring_manifest.mcp[]`, the `lastLegMcp.mcp[]` of the session MCP panel, and the `servers[]` of `GET /v1/capabilities/mcp` and
|
|
24063
|
+
`POST /v1/capabilities/mcp/probe` through `McpProbeFaceRow`), the reconnect receipt's `status`
|
|
23948
24064
|
and the `GET /v1/sessions/{sessionId}/mcp` panel's `servers[]` (the panel row carries no `errorCode`, so presence there reads "this server is unauthorized"). ONLY the closed word `reason` leaves the server: the engine record's two
|
|
23949
24065
|
addresses (`authorizeUrl` — only ever from the deployment's authorization seat, which this deployment does not have — and `resourceMetadataUrl`, which the remote self-reports in its challenge header and is untrusted) never go on the wire.
|
|
23950
24066
|
A record whose word is outside the set, or that is not an object, is absent as a whole (the weakest claim, no minted word). The user-facing "go authorize" is the session notice `mcp.authorization_required`.
|
|
23951
|
-
server >= 7.150.0: every projection face of the record reads this one disposition table — the
|
|
24067
|
+
server >= 7.150.0: every projection face of the record reads this one disposition table (the server's self-minted registry lists nine faces in all) — the six faces above, plus the session history (`GET /v1/sessions/{sessionId}` `messages[].details.authorization`, a tool-result card whose `details.code` is
|
|
23952
24068
|
`unauthorized`) and `tool_end.structured.authorization` (`GET /v1/runs/{runId}/events` and SSE `tool_end`, a self-registered card whose `structured.code` is `unauthorized`): both carry ONLY `{ reason }`. On <= 7.149.x the history also carried the remote's
|
|
23953
24069
|
self-reported `resourceMetadataUrl` and `tool_end.structured.authorization` carried any card member that passed the text redactor; neither member is declared by this contract (`details` / `structured` are open bags), so a reader of
|
|
23954
24070
|
`authorization.resourceMetadataUrl` there reads `undefined` on >= 7.150.0. No knob.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.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",
|