@sema-agent/sdk 43.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 +164 -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 +14 -8
- 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 +22 -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/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 +135 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +27 -4
- package/dist/types.js.map +1 -1
- package/openapi.yaml +169 -38
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -66,11 +66,15 @@ import type { ASK_ORIGINS, AllowRuleShadow, ApprovalFrameFamily, ApprovalRequest
|
|
|
66
66
|
* Send visible characters only — a proxy that writes raw UTF-8 bytes into the principal header is read as latin1 there (a CJK name or `Martín` becomes a refused string): encode the
|
|
67
67
|
* identity as ASCII / a user id / percent-encoding on the proxy. Convention: `user:` / `org:` / `ai:` / `anon:`. */
|
|
68
68
|
export type Principal = string;
|
|
69
|
-
/** Builtin scenarios of a stock `@sema-agent/server` that this SDK offers as known names — **
|
|
70
|
-
*
|
|
69
|
+
/** Builtin scenarios of a stock `@sema-agent/server` that this SDK offers as known names — **seven**, all in the server's builtin table
|
|
70
|
+
* (`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
|
|
71
71
|
* domain-neutral assistant face; `scan` is the neutral read-only repo lane; `code-review` is the multi-lens review lane;
|
|
72
72
|
* `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;
|
|
73
73
|
* 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.
|
|
74
|
+
* `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;
|
|
75
|
+
* 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 —
|
|
76
|
+
* 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
|
|
77
|
+
* 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`.
|
|
74
78
|
* ⚠️ 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
|
|
75
79
|
* 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.)
|
|
76
80
|
* 🔴 CHECKED AGAINST THE SERVER, not hand-kept (K-20): `test/scenario-capabilities.test.ts` ① reads the builtin table out of
|
|
@@ -86,7 +90,7 @@ export type Principal = string;
|
|
|
86
90
|
* answers it 400 today. Removed here in K-20.
|
|
87
91
|
* Sending a retired name to a ≥5.1.0 server is a LOUD typed 400 `scenario_unknown` (the response carries the
|
|
88
92
|
* deployment's live vocabulary), not a silent fold to `default`. */
|
|
89
|
-
export declare const KNOWN_SCENARIOS: readonly ["code", "default", "code-review", "scan", "cowork"];
|
|
93
|
+
export declare const KNOWN_SCENARIOS: readonly ["code", "default", "code-review", "scan", "cowork", "chat", "chat-folders"];
|
|
90
94
|
/** 会话**种类**词(server ≥7.151.0;server 同名常量 `SESSION_KINDS`):今天一词 `sidechain` = 客户端自己放的子对话(默认不在 `GET /v1/sessions` 里列,要 `?sessionKind=sidechain` 视图)。写一次、不变。 */
|
|
91
95
|
export declare const SESSION_KINDS: readonly ["sidechain"];
|
|
92
96
|
export type SessionKind = (typeof SESSION_KINDS)[number];
|
|
@@ -911,7 +915,10 @@ export interface TaskRequest {
|
|
|
911
915
|
* 🔴 **server ≥7.132.0(引擎 7.52.0)写错的名字开跑前拒**:近似名与**有后继的退役名**(`Task` ⇒ `Agent`、`bash` ⇒ `Bash`)⇒ 根 `allowTools` 答 **400 `config.tool_face_control`**、子代 `allowTools` 答
|
|
912
916
|
* **400 `config.agent.unknown_tool`**(同步腿;子代那一形此前是 200 + failed;异步 / 活流腿 2xx、同码落终态),句子点名该条与现名。内容形与没有后继的退役名(`MultiEdit`)照跑。
|
|
913
917
|
* 坏形(非字符串数组)⇒ 400 `request.field_invalid`,与 `excludeTools` / `deferTools` 同一只门。引擎不认该座(装着的引擎 < 7.49.0)⇒ 响亮拒 400 `request.field_invalid` 点名 `allowTools`(不静默丢:丢一只收窄键就是放宽)。
|
|
914
|
-
* 🔴 **探测靠键闭集,没有能力位**:≤7.125.x 对它答 `400 request.body_shape` 并在 `unknownKeys` 里列名。⚠️ 辖域:A2A 入站面(`message/send`)不承载本键。
|
|
918
|
+
* 🔴 **探测靠键闭集,没有能力位**:≤7.125.x 对它答 `400 request.body_shape` 并在 `unknownKeys` 里列名。⚠️ 辖域:A2A 入站面(`message/send`)不承载本键。
|
|
919
|
+
* 🔴 **server ≥7.155.0:工具面定死的场景上不收本键** —— 场景卡带 {@link ScenarioDetail.allowTools} 的场景(内建 `chat` / `chat-folders`)的 run 工具面由场景铸定,本键与它同带 ⇒
|
|
920
|
+
* **400 `request.field_conflict`**(`reason: "scenario_tool_face"`,`fields` = `["allowTools"]`,体里点名了 `scenario` 时再加 `"scenario"`;句子指路 `excludeTools`),拒在任何副作用之前。
|
|
921
|
+
* 在这类场景上收窄用 {@link excludeTools}(只会卸),零工具用 {@link excludeAllTools}。 */
|
|
915
922
|
allowTools?: string[];
|
|
916
923
|
/** server ≥7.90.0 (core 7.8.0 design/388 的**请求面**;契约 G.9b / 判据 G-40): **整只工具面卸载** ——
|
|
917
924
|
* 这一 run 里调用方工具、脚手架、手(Bash/Edit/Write…)、MCP、A2A、skills 一个都不挂,模型没有任何
|
|
@@ -3397,7 +3404,7 @@ export type GateRecordDeniedBy = DeniedBy | GateRecordRetiredWord<"deniedBy">;
|
|
|
3397
3404
|
export type GateRecordModeReleaseReason = "target_unresolved" | GateRecordRetiredWord<"modeReleaseReason">;
|
|
3398
3405
|
/** 门记录上的强制词 = {@link PersistedRuleMandate}(今天的全集)∪ 档案词(7.49.0 前的旧拼法)。 */
|
|
3399
3406
|
export type GateRecordPersistedRuleMandate = PersistedRuleMandate | GateRecordRetiredWord<"persistedRuleMandate">;
|
|
3400
|
-
/** 门记录上的出身词 = core `ASK_ORIGINS`(
|
|
3407
|
+
/** 门记录上的出身词 = core `ASK_ORIGINS`(今天的词表,见 {@link ASK_ORIGINS})∪ 档案词(`unresolvable`,core 7.14.0 改名 `ancestor_marked`)。🔴 门记录这一面引擎判成员,所以是**闭集**
|
|
3401
3408
|
* —— 与卡面上开集读的 {@link AskOrigin} 不同面(卡面 server 只判非空串)。 */
|
|
3402
3409
|
export type GateRecordAskOrigin = (typeof ASK_ORIGINS)[number] | GateRecordRetiredWord<"askOrigin">;
|
|
3403
3410
|
/**
|
|
@@ -3618,7 +3625,7 @@ export interface GateOutcome {
|
|
|
3618
3625
|
disposition: GateDisposition;
|
|
3619
3626
|
/** 只在**这次通过真的结算了一只 ask** 时在场。与 {@link origin} 同在同缺(I1)。 */
|
|
3620
3627
|
settlement?: Settlement;
|
|
3621
|
-
/** 谁**问**的。与 {@link settlement} 同在同缺(I1)。门记录按档案读(见 {@link GateRecordAskOrigin}
|
|
3628
|
+
/** 谁**问**的。与 {@link settlement} 同在同缺(I1)。门记录按档案读(见 {@link GateRecordAskOrigin}:今天的 {@link ASK_ORIGINS} ∪ 7.14.0 前的 `unresolvable`),是**闭集**。 */
|
|
3622
3629
|
origin?: GateRecordAskOrigin;
|
|
3623
3630
|
}
|
|
3624
3631
|
/**
|
|
@@ -3636,7 +3643,7 @@ export interface GateOutcome {
|
|
|
3636
3643
|
*/
|
|
3637
3644
|
export type McpDelivered = "yes" | "no" | "unknown";
|
|
3638
3645
|
/**
|
|
3639
|
-
* MCP 失败的**类**(core `MCP_FAILURE_KINDS`:7.6.0 闭十词;core 7.58.0 起 `credential_unavailable`、core 7.59.0 起 `unauthorized` ⇒ 十二词,server ≥7.138.0;core 7.60.0 起 `host_refused` ⇒ 十三词,server ≥7.139.0)—— `tool_end.errorCode` 与
|
|
3646
|
+
* MCP 失败的**类**(core `MCP_FAILURE_KINDS`:7.6.0 闭十词;core 7.58.0 起 `credential_unavailable`、core 7.59.0 起 `unauthorized` ⇒ 十二词,server ≥7.138.0;core 7.60.0 起 `host_refused` ⇒ 十三词,server ≥7.139.0;core 7.67.0 起 `revoked` ⇒ 十四词,随装该引擎的 server ≥7.153.0)—— `tool_end.errorCode` 与
|
|
3640
3647
|
* `wiring_manifest.mcp[].errorCode` 上 MCP 那一族的取值。
|
|
3641
3648
|
* `connect_refused`(连接相 errno:请求**可证**从未离开)/ `connection_failed`(其他 errno:可能跑过了)/
|
|
3642
3649
|
* `connection_closed`(SDK 报传输已关:在飞时命运不可知,对已知死掉的服务器则从未尝试——两者靠
|
|
@@ -3645,12 +3652,14 @@ export type McpDelivered = "yes" | "no" | "unknown";
|
|
|
3645
3652
|
* `not_mcp_response` / `spawn_failed`(stdio 子进程起不来)/ `timeout` / `protocol`(服务器**答**了一个
|
|
3646
3653
|
* MCP/JSON-RPC 错:交换发生过)/ `invalid_config`(声明本身拨不出去 —— 要改 spec,不是等它恢复)/ `credential_unavailable`(server ≥7.138.0:
|
|
3647
3654
|
* 部署的凭据席没给出这次请求 —— 席抛了、没按时答,或答了引擎带不了的东西;这次请求**没发出**,是部署要修的故障,不是服务器挂了)/ `host_refused`(server ≥7.139.0 / core 7.60.0:
|
|
3648
|
-
* 宿主提供的传输〔core `McpServerSpec` 的 `transport.kind: "host"`〕的**宿主席**没有把这次请求交给对端 —— 请求**没发出**〔`delivered: "no"`〕;server 7.139.0 发布字节里没有任何宿主传输席的装配点,所以部署上读不到它,词表以引擎为准,故收进已知词)/ `
|
|
3655
|
+
* 宿主提供的传输〔core `McpServerSpec` 的 `transport.kind: "host"`〕的**宿主席**没有把这次请求交给对端 —— 请求**没发出**〔`delivered: "no"`〕;server 7.139.0 发布字节里没有任何宿主传输席的装配点,所以部署上读不到它,词表以引擎为准,故收进已知词)/ `revoked`(core 7.67.0:部署的撤销账本答「这台服务器或对端已被撤回」;这个词读在**接线清单**上 —— `wiring_manifest.mcp[].errorCode`,装配期的拨号被撤:`status: "failed"`、`delivered: "no"`。
|
|
3656
|
+
* 🔴 **被撤销账本在请求离开之前拒掉的调用**,在 `tool_end.errorCode` 上读的是引擎码 `mcp.server_revoked`(core 5.50.0 起,开集里的引擎码,server 零铸点、逐字过境;**不是**本词;撤销若落在 401 / 丢会话的**重发**之前,调用答它第一次尝试的失败码,也不是本词),
|
|
3657
|
+
* `delivered` 与它合读:一跳都没发 = `"no"`;首跳已发、后续重定向跳被撤 = `"unknown"`〔引擎 7.68.2 里铸后一形的只有 A2A 对端的重定向循环,码 `a2a.peer_revoked`;MCP 一侧的铸点只铸前一形〕。本词不说对端能不能连上)/ `unknown`。
|
|
3649
3658
|
* 🔴 core 7.6.0 起**退役** `MCP_FAILURE_CODES` 那张十词表,`network` 与 `http_<status>` **两种拼法一并作废**
|
|
3650
3659
|
* (HTTP 状态从此走结构位 `httpStatus`,不再编进码里)。
|
|
3651
3660
|
* 🔴 `tool_end.errorCode` 整体仍是**开集**(词表属主是工具);本类型只描述其中 MCP 这一族,按开集读。
|
|
3652
3661
|
*/
|
|
3653
|
-
export type McpFailureKind = "connect_refused" | "connection_failed" | "connection_closed" | "unauthorized" | "http_status" | "not_mcp_response" | "spawn_failed" | "timeout" | "protocol" | "invalid_config" | "credential_unavailable" | "host_refused" | "unknown" | (string & {});
|
|
3662
|
+
export type McpFailureKind = "connect_refused" | "connection_failed" | "connection_closed" | "unauthorized" | "http_status" | "not_mcp_response" | "spawn_failed" | "timeout" | "protocol" | "invalid_config" | "credential_unavailable" | "host_refused" | "revoked" | "unknown" | (string & {});
|
|
3654
3663
|
/**
|
|
3655
3664
|
* 一条腿的 **MCP 装配名册**里的**一行**(core ≥7.5.0 #562 / ≥7.6.0 S6-B,server ≥7.60;**租户可见**):
|
|
3656
3665
|
* 这条腿申报的那台服务器连上了没有、没连上是哪一类、挂上来几只工具。
|
|
@@ -3712,11 +3721,12 @@ export type WiringManifestMcpEntry = {
|
|
|
3712
3721
|
*/
|
|
3713
3722
|
export type McpAuthorizationReason = "rejected" | "scope" | "none";
|
|
3714
3723
|
/**
|
|
3715
|
-
* MCP 授权事实(core 7.59.0 `McpAuthorization`;server ≥7.138.0):**一只 MCP 服务器要用户先授权**才肯服务 —— 在 MCP
|
|
3716
|
-
* (`wiring_manifest.mcp[]`
|
|
3724
|
+
* MCP 授权事实(core 7.59.0 `McpAuthorization`;server ≥7.138.0):**一只 MCP 服务器要用户先授权**才肯服务 —— 在 MCP 状态面上与 `errorCode: "unauthorized"` 同行,经**三只行型**落在**六张面**上:
|
|
3725
|
+
* 状态行 {@link WiringManifestMcpEntry}(`wiring_manifest.mcp[]` · `GET /v1/sessions/:id/mcp` 的 `lastLegMcp.mcp[]` · 能力面 `GET /v1/capabilities/mcp` 与 `POST /v1/capabilities/mcp/probe` 的 `servers[]`〔{@link McpProbeFaceRow} = 这只行型加两键〕共四张)、
|
|
3726
|
+
* 重拨回执的 `status`〔{@link McpReconnectServerStatus}〕、`GET /v1/sessions/:id/mcp` 面板的 `servers[]`〔{@link McpServerStatus};面板行不带 `errorCode`,在场律读作「这台服务器未授权」〕。
|
|
3717
3727
|
* 🔴 **只有闭集词 `reason`**:引擎记录里的两只地址(`authorizeUrl` / `resourceMetadataUrl`)**不出门**(前者只来自部署的授权座,本服务今天没有授权座;后者是远端在挑战头里自报的、不可信)——
|
|
3718
3728
|
* 用户面的「去授权」由会话通告 `mcp.authorization_required`({@link import("./events.js").McpAuthorizationRequiredDetail})承载。server 对词出闭集 / 非对象的记录**整格缺席**(最弱断言,不铸词)。
|
|
3719
|
-
* 🔴 **server ≥7.150.0:授权记录的每一个投影面同读这一张处置表** ——
|
|
3729
|
+
* 🔴 **server ≥7.150.0:授权记录的每一个投影面同读这一张处置表**(server 自铸登记表 `mcpAuthorizationKey` 一共九张面;本包的落点账在 `test/server-k188-wire.test.ts` A5 – A7)—— 除上面六张面外,还有**会话历史**(`GET /v1/sessions/:id` 的 `messages[].details.authorization`,`details.code` 为 `"unauthorized"` 的工具结果卡)与
|
|
3720
3730
|
* **`tool_end.structured.authorization`**(`GET /v1/runs/:id/events` 与 SSE `tool_end` 帧,`structured.code` 为 `"unauthorized"` 的自注册卡):两处都**只剩 `{ reason }`**(词出闭集 ⇒ 这一位缺席)。
|
|
3721
3731
|
* ≤7.149.x 上会话历史还带远端自报的 `resourceMetadataUrl`、`tool_end.structured.authorization` 还带过文本消毒的任意卡成员(含 `resourceMetadataUrl`)—— 本包对这两面**没有具名成员**
|
|
3722
3732
|
* (`details` / `structured` 都是开口袋,`structured?: unknown`),所以没有可删的型;**读这两个口袋里 `authorization.resourceMetadataUrl` 的代码在 ≥7.150.0 上读到 `undefined`**,不再有「远端选的地址」到人面前。没有旋钮。
|
|
@@ -5872,7 +5882,8 @@ export interface ReadFacePosture {
|
|
|
5872
5882
|
}
|
|
5873
5883
|
/** One scenario's detail card (`GET /v1/capabilities/scenarios/:name` — server handler = the
|
|
5874
5884
|
* `url.startsWith("/v1/capabilities/scenarios/")` branch in `src/http/routes/capabilities.ts`,
|
|
5875
|
-
* shape = capabilities/scenarios.d.ts `ScenarioDetail` verbatim
|
|
5885
|
+
* shape = capabilities/scenarios.d.ts `ScenarioDetail` verbatim — server ≥7.155.0: `ScenarioCard` = that row plus the two machine bits `allowTools` / `handsReadOnly`, minted only
|
|
5886
|
+
* by `scenarioCardOf`; the LIST of names rides `capabilities.scenarios`).
|
|
5876
5887
|
* `source`/`builtin` = builtin vs center-config overlay; `toolset` names the tool bundle, `tools` the resolved
|
|
5877
5888
|
* tool names; `promptSummary` is a human-readable prompt digest (NOT the full prompt); `enabled` = a center
|
|
5878
5889
|
* scenario can be declared-but-disabled.
|
|
@@ -5895,6 +5906,14 @@ export interface EffectiveScenario {
|
|
|
5895
5906
|
scenario: string;
|
|
5896
5907
|
source: ScenarioSource;
|
|
5897
5908
|
}
|
|
5909
|
+
/** 场景不可用的机读原因词(server 的闭集 `ScenarioUnavailableReason`,自铸词表 `scenarioUnavailableReason`,逐词同序):场景卡 {@link ScenarioDetail.unavailableReason} 与
|
|
5910
|
+
* 提交这个场景答的 501 `capability.unavailable` 体根(server ≥7.155.0)同一只词。
|
|
5911
|
+
* · `git_client_unconfigured` —— 仓库型场景(scan / code-review / 中心声明的仓库只读工具集)要部署配好 git 后端(`GIT_API_BASEURL`);
|
|
5912
|
+
* · `caller_paths_unhonored`(server ≥7.155.0)—— 场景要读调用方按宿主路径交来的文件夹(`chat-folders`),而这台部署不兑现调用方的宿主路径。
|
|
5913
|
+
* 读侧开集(未知词 = 「不可用、原因未知」);对本表穷举的 `switch` 留 default 臂。 */
|
|
5914
|
+
export declare const SCENARIO_UNAVAILABLE_REASONS: readonly ["git_client_unconfigured", "caller_paths_unhonored"];
|
|
5915
|
+
/** {@link SCENARIO_UNAVAILABLE_REASONS} 的成员型。 */
|
|
5916
|
+
export type ScenarioUnavailableReason = (typeof SCENARIO_UNAVAILABLE_REASONS)[number];
|
|
5898
5917
|
export interface ScenarioDetail {
|
|
5899
5918
|
name: string;
|
|
5900
5919
|
source: "builtin" | "center";
|
|
@@ -5913,10 +5932,22 @@ export interface ScenarioDetail {
|
|
|
5913
5932
|
* 无手场景(`toolset: "none"` / 纯对话面)去掉 `path`(带 `path` 条目的提交被引擎以 `config.user_attachment_invalid` 拒)。恒在场;**缺席 = 老 server(≤7.132.x)**,按
|
|
5914
5933
|
* `Capabilities.userAttachments.supplies` + 既有 400 处置(发送前预判用本位,别试探)。 */
|
|
5915
5934
|
attachmentSupplies?: Array<"path" | "content_text" | "content_image">;
|
|
5916
|
-
/** 机读原因;仅 `available:false` 时在场(缺席=没有理由)
|
|
5917
|
-
* `
|
|
5918
|
-
*
|
|
5919
|
-
|
|
5935
|
+
/** 机读原因;仅 `available:false` 时在场(缺席=没有理由)。词见 {@link SCENARIO_UNAVAILABLE_REASONS}(server 的闭集,今天两词:`git_client_unconfigured` = scan / code-review 这类仓库型场景缺 `GIT_API_BASEURL`;
|
|
5936
|
+
* `caller_paths_unhonored`〔server ≥7.155.0〕= `chat-folders` 要读调用方按宿主路径交来的文件夹,而这台部署不兑现调用方的宿主路径 —— 多租户、沙箱车道、设备车道、无手车道)。按键分支,
|
|
5937
|
+
* 禁匹配英文文案。**读开集**:server 扩词表 = additive,未知词按「不可用但原因未知」处置。server ≥7.155.0 起提交这个场景答的 501 `capability.unavailable` 体根带**同一只**词
|
|
5938
|
+
* (见 {@link import("./errors.js").ScenarioUnavailableExtra})。 */
|
|
5939
|
+
unavailableReason?: ScenarioUnavailableReason | (string & {});
|
|
5940
|
+
/** server ≥7.155.0:**这个场景的 run 工具面定死成哪一份选择** —— **只在**场景的生效定义定死工具面时在场(内建 `chat` / `chat-folders`;其余内建卡与配置中心声明的场景不带,
|
|
5941
|
+
* 中心同名覆盖内建时卡上读 `source: "center"`、没有本键)。值 = **这台部署对这个场景声明的选择范围**:场景交给引擎的宿主工具名 ∪ 带技能时的技能工具 ∪ 手留下的工具 ∪ 部署按标签落到这个场景的
|
|
5942
|
+
* 每台连接器 / A2A 对端一条整台选择器(`mcp__<名>__*` / `a2a__<名>__*`);不含请求自带的对端 / 搜索后端 / 技能,不减调用方的 `excludeTools`。
|
|
5943
|
+
* 三态:键缺席 = 这个场景面不定死(或老 server:看 `capabilities.scenarios` 里有没有这个名);`[]` = 这台部署给这个场景的工具是零;非空 = 有子集。
|
|
5944
|
+
* 与 {@link tools} 答的是两问:`tools` = 「这个场景的定义带来哪些宿主工具」(每张卡都有)。一条 run 真挂了什么看它的 `wiring_manifest`。
|
|
5945
|
+
* 在场时提交体再带 `allowTools` ⇒ 400 `request.field_conflict`(`reason: "scenario_tool_face"`,见 {@link TaskRequest.allowTools})。 */
|
|
5946
|
+
allowTools?: string[];
|
|
5947
|
+
/** server ≥7.155.0:**手是只读文件手** —— 这个场景的 run 带引擎的只读挂载(写工具不挂、手带里作用不是文件读的工具不挂、这次的**读根**之外的读拒而不问,任何权限模式都放不掉)。
|
|
5948
|
+
* 读根不只是挂的文件夹:= 请求的只读附加目录 ∪ 调用方给的 `cwd`(没给 ⇒ 这条腿的临时工作目录)∪ 本人此前长期放行过的读目录(引擎把它们并进只读挂载的读根)—— 对用户说「可以读这些文件夹」,别说「只读这几只」。
|
|
5949
|
+
* 值恒 `true`,**只在**场景这样声明时在场(今天内建 `chat-folders`);缺席 = 不是(不是「只读与否未知」)。 */
|
|
5950
|
+
handsReadOnly?: true;
|
|
5920
5951
|
/** server ≥7.135.0:**这个场景的 run 装着的部署技能**清单(本部署技能目录 ∪ 配置源交来的,按场景过滤;请求体自带的 `skills` 不在内)—— 与交进 `TaskSpec` 的那一份是同一只过滤、同组同序。
|
|
5921
5952
|
* 壳的 `/技能名` 补全读它,点名走 `userInvokedSkills`。条目不带正文,也不带技能上的两只工具清单。恒在场(无技能 ⇒ `[]`);**键缺席 = 老 server:读不到清单,不是「这个场景没有技能」**。
|
|
5922
5953
|
* 卡上有、run 里没有的两种:`disableSkills: true` 的那一发;正文超引擎加载上限的技能(点它的名答 `config.user_invoked_skill_unknown`)。位见 {@link Capabilities.scenarioSkills}。 */
|
|
@@ -6231,8 +6262,12 @@ export declare const CHECKPOINT_ROW_VERDICT_KINDS: readonly ["ok", "lacking", "d
|
|
|
6231
6262
|
* `/v1/approvals/stream` 的 `pending` 帧与助手收件箱行 {@link InboxRow.rowVerdict} **同型同一答**。🔴 **一个判官两张脸**:续跑 / 决断的第一级拒(409,体带 `reason`)出自同一只判官,
|
|
6232
6263
|
* 所以列表上读到非 `ok` 的行,决断它会被同一个原因拒 —— **呈不可批**,出路是取消 run(`runs.cancel(taskId, { session })`)或交给能续它的副本 / 版本(混版车队里那一行留给它)。
|
|
6233
6264
|
* · `kind: "ok"` —— 臂里只有 `kind`;
|
|
6234
|
-
* · `kind: "lacking" | "damaged"` —— `code`(引擎的检查点错误码)· `reason?`(同码多臂时哪一臂)· `
|
|
6235
|
-
* `
|
|
6265
|
+
* · `kind: "lacking" | "damaged"` —— `code`(引擎的检查点错误码)· `reason?`(同码多臂时哪一臂)· `field?` / `blockedBy?`(**server ≥7.153.0**〔随装 core 7.67.3〕起:行记着的词这台引擎读不了 ——
|
|
6266
|
+
* 权限模式 / 运行来源 / 冻结的工具名拼写 —— 那几行答 `code: "checkpoint.config_refused"`;三臂里只有冻结的工具名拼写那一臂(`blockedBy: "config.tool_face_control"`)带 `reason`
|
|
6267
|
+
* 〔引擎 7.68.2 的判官在这一臂铸 `not_a_list` · `not_a_string` · `unsupported_pattern`〕,权限模式(`config.permission_mode_invalid`)、运行来源(`config.run_origin_invalid`)两臂不带 `reason`;
|
|
6268
|
+
* `field` = 该拒的 `detail.field`,`blockedBy` = 同一份坏值在新跑上报的准入码;续跑拒体带这两键时与它们同名同词 —— 但 server 7.154.0 上,决断口对停驻行自己的拒从这份判决重建拒体、还不带这两键,
|
|
6269
|
+
* 只有列表行与收件箱行带;其余臂两键都缺席)· `requires?`(这一行要、本引擎没有的能力名)·
|
|
6270
|
+
* `sentence`(引擎的人话行,展示用,**不是匹配键**)。`code` / `reason` / `field` / `blockedBy` 按开集串读(词表属主在 core,随 core 加员)。
|
|
6236
6271
|
* · 两张脸怎么对:🔴 **server ≥7.147.0 起按 `code` 等值就对得上** —— 任何决断类续跑入口(`/decide` · `/plan_review` · `/resume` · `/wake`)对「这一行自己的拒」都答**引擎原码**,与本判决的 `code` 是同一只判官的同一个码
|
|
6237
6272
|
* (`checkpoint.invalid_outcome`〔例:`requirements_damaged`〕落 {@link import("./errors.js").CheckpointInvalidOutcomeError};`checkpoint.unsupported_version` 同样原码过境),`error` 以本判决的 `sentence` 开头,拒体的 `reason` 与本判决的 `reason` 是同一个词。
|
|
6238
6273
|
* 成因码只给**真有成因**的拒(`approval_binding_mismatch`:绑定席;`resume_outcome_invalid`:决定体里那一格 / 内容拒),那不是这一行自己的拒。
|
|
@@ -6248,6 +6283,8 @@ export type CheckpointRowVerdict = {
|
|
|
6248
6283
|
kind: "lacking" | "damaged";
|
|
6249
6284
|
code: string;
|
|
6250
6285
|
reason?: string;
|
|
6286
|
+
field?: string;
|
|
6287
|
+
blockedBy?: string;
|
|
6251
6288
|
requires?: string[];
|
|
6252
6289
|
sentence: string;
|
|
6253
6290
|
};
|
|
@@ -8766,6 +8803,62 @@ export interface MemoryOriginClearReceipt {
|
|
|
8766
8803
|
landedSlug: string;
|
|
8767
8804
|
[k: string]: unknown;
|
|
8768
8805
|
}
|
|
8806
|
+
/**
|
|
8807
|
+
* **工作流成员停驻卡**上「决定行写成了」的那一类 200 的两个词(闭集,server ≥7.155.0;按 `status` 判别,两臂见 {@link WorkflowParkDecisionReceipt})。
|
|
8808
|
+
* 两扇决断口同一张体:`POST /v1/approvals/{sessionId}/decide`,与按问决断口的停驻形(那一口把体里的 `taskId` 改放 `carrierTaskId`,见
|
|
8809
|
+
* {@link import("./resources/tool-approvals.js").AskDecisionParkedRedeemed})。
|
|
8810
|
+
* · `recorded` —— 这只决定已作为这张卡的决定记在部署的决定店里、寄给 `runId`(持有这张卡的那条 workflow run);**没有**一条在跑的宿主那一跑带着它
|
|
8811
|
+
* (持有它的 run 还在跑、由它自己的进程交付;或带着它的那一跑在受理之前就停了 —— 宿主会话的下一跑会带上它);
|
|
8812
|
+
* · `delivered` —— 记下了,**并且**宿主会话上一条在跑的那一跑(`taskId`,run 店里那一跑,`GET /v1/runs/:taskId` 读得到)已带着它起跑 / 续上。
|
|
8813
|
+
* 词只说**答话那一刻**服务端这边成立的事:引擎之后怎么处置这只决定(续上了 / 没用上)不在回执上,回执的词也从不随它改写 —— 两个词都**不是**「门已解决」,
|
|
8814
|
+
* 那张卡在 200 之后仍可能列在 `/v1/approvals` 上。老服务端(< 7.155.0)在这类卡上答 `resuming`,形见 {@link import("./resources/approvals.js").ParkedDecideAccepted}。
|
|
8815
|
+
* 冻结(`Object.freeze`):开集读者对它 `satisfies Record<WorkflowParkDecisionReceiptStatus, …>` 做两向穷举。
|
|
8816
|
+
*/
|
|
8817
|
+
export declare const WORKFLOW_PARK_DECISION_RECEIPT_STATUSES: readonly ["recorded", "delivered"];
|
|
8818
|
+
/** {@link WORKFLOW_PARK_DECISION_RECEIPT_STATUSES} 的成员型(= {@link WorkflowParkDecisionReceipt} 的 `status`)。 */
|
|
8819
|
+
export type WorkflowParkDecisionReceiptStatus = (typeof WORKFLOW_PARK_DECISION_RECEIPT_STATUSES)[number];
|
|
8820
|
+
/** 工作流成员停驻卡回执的 `recorded` 臂(server ≥7.155.0):回执键恒为这五只,全必填;**没有** `taskId` / `sessionId`(这一词的键集里没有,不是读不出)。
|
|
8821
|
+
* 唯一的可选键是**随请求**的规则位一对(`rulePersisted` / `ruleRefusal`):请求带了 `persistRule` 时服务端在 200 体上挂它们,没带就不在 —— 调用方自己知道带没带,
|
|
8822
|
+
* 它们不是判别位,也不随腿变。这条车道答话时证不出引擎已提交,规则恒**没存上**;**裁决不因此改判**(批了就是批了)。与信封
|
|
8823
|
+
* {@link ApprovalDecisionResult.rulePersisted} / {@link ApprovalDecisionResult.ruleRefusal} 是同一对键,这里写的是这条车道上它们只取的那一对值。 */
|
|
8824
|
+
export interface WorkflowParkDecisionRecorded {
|
|
8825
|
+
status: "recorded";
|
|
8826
|
+
/** 这只决定寄给的那条 workflow run(持有这张卡的那一条;读 `GET /v1/workflows/:runId`,它不在 run 店里)。 */
|
|
8827
|
+
runId: string;
|
|
8828
|
+
/** 这只决定的 id(不透明;同一只决定的重投回放同值,人每决一次换新值)—— 与引擎通告 `workflow.parked_decision_unused` 的 `detail.decisionIds` 同一枚。 */
|
|
8829
|
+
decisionId: string;
|
|
8830
|
+
decision: "approve" | "deny";
|
|
8831
|
+
bindingEnforced: true;
|
|
8832
|
+
/** 随请求的规则位:只在请求带了 `persistRule` 时在场,恒 `false`(这条车道证不出提交,规则没存上;裁决照旧)。 */
|
|
8833
|
+
rulePersisted?: false;
|
|
8834
|
+
/** 随 {@link rulePersisted} 同在同缺:恒 `rule_lane_unavailable`。 */
|
|
8835
|
+
ruleRefusal?: "rule_lane_unavailable";
|
|
8836
|
+
}
|
|
8837
|
+
/** 工作流成员停驻卡回执的 `delivered` 臂(server ≥7.155.0):`recorded` 的五键再加 `taskId` 与 `sessionId`,七键恒在、全必填;唯一的可选键同样是随请求的规则位一对
|
|
8838
|
+
* (读法同 {@link WorkflowParkDecisionRecorded})。 */
|
|
8839
|
+
export interface WorkflowParkDecisionDelivered {
|
|
8840
|
+
status: "delivered";
|
|
8841
|
+
/** 宿主会话上带着这只决定、此刻在跑的那一跑 —— 恒是 run 店里的一跑(`GET /v1/runs/:taskId` / `/events` 读得到),恒在场。 */
|
|
8842
|
+
taskId: string;
|
|
8843
|
+
/** 那一跑所在的会话(宿主会话)。 */
|
|
8844
|
+
sessionId: string;
|
|
8845
|
+
/** 这只决定寄给的那条 workflow run(同 {@link WorkflowParkDecisionRecorded.runId})。 */
|
|
8846
|
+
runId: string;
|
|
8847
|
+
/** 同 {@link WorkflowParkDecisionRecorded.decisionId}。 */
|
|
8848
|
+
decisionId: string;
|
|
8849
|
+
decision: "approve" | "deny";
|
|
8850
|
+
bindingEnforced: true;
|
|
8851
|
+
/** 随请求的规则位,同 {@link WorkflowParkDecisionRecorded.rulePersisted}。 */
|
|
8852
|
+
rulePersisted?: false;
|
|
8853
|
+
/** 同 {@link WorkflowParkDecisionRecorded.ruleRefusal}。 */
|
|
8854
|
+
ruleRefusal?: "rule_lane_unavailable";
|
|
8855
|
+
}
|
|
8856
|
+
/**
|
|
8857
|
+
* 工作流成员停驻卡上 `/decide` 的回执(server ≥7.155.0;闭集两臂,按 `status` 判别;词表 {@link WORKFLOW_PARK_DECISION_RECEIPT_STATUSES})。
|
|
8858
|
+
* 它是 {@link import("./resources/approvals.js").ParkedDecideAccepted} 的两臂 —— 读 `/decide` 的 200 时按那只四臂联合的 `status` 窄化即可,不必先知道卡的出身。
|
|
8859
|
+
* 落行之前那一跑就被取消的 200(`{ status: "failed", errorCode: "cancelled", … }`,什么都没记下)与卡结清之后的幂等回放体(`idempotent: true`)不是本联合的臂,读法见 {@link ApprovalDecisionResult}。
|
|
8860
|
+
*/
|
|
8861
|
+
export type WorkflowParkDecisionReceipt = WorkflowParkDecisionRecorded | WorkflowParkDecisionDelivered;
|
|
8769
8862
|
/** `POST /v1/approvals/{sessionId}/decide` 的 200 体(spec `ApprovalDecisionResult` 的型面镜像;此前 SDK 只给 `unknown`)。
|
|
8770
8863
|
* 🔴 **server ≥7.136.0:parked 回执有两臂,看 `status`**(类型 {@link import("./resources/approvals.js").ParkedDecideAccepted} 是它们的联合):`"resuming"` = 受理回执(复活在飞);
|
|
8771
8864
|
* **`"failed"` = 作废回执** `{ taskId, status: "failed", decision: "deny" }` —— 复活不了的停驻行(后台子代省略 `name` 的无名行 / 行上没有根会话锚)上 deny = 作废这张卡
|
|
@@ -8775,11 +8868,17 @@ export interface MemoryOriginClearReceipt {
|
|
|
8775
8868
|
* status:"resuming", bindingEnforced:true}` —— `errorCode`/`errorMessage`/`retriable` **从不**上这形,失败落 run 行与
|
|
8776
8869
|
* `GET /v1/runs/:id/events` 的 `suspended` 事件(`reopened: <errorCode>`);**终局形**(无 durable run 行 / `verify:true`
|
|
8777
8870
|
* 的同步长调用)`{taskId?, sessionId, status, errorCode?, errorMessage?, retriable?}`;**parked 回执**(server ≥7.136.0 两臂)
|
|
8778
|
-
* `{taskId, status:"resuming", decision}` 或作废臂 `{taskId, status:"failed", decision:"deny"}
|
|
8779
|
-
*
|
|
8780
|
-
* `
|
|
8871
|
+
* `{taskId, status:"resuming", decision}` 或作废臂 `{taskId, status:"failed", decision:"deny"}`;🔴 **server ≥7.155.0 工作流成员停驻卡另有两臂**
|
|
8872
|
+
* `recorded` / `delivered`({@link WorkflowParkDecisionReceipt},两张固定键集,带 `runId` / `decisionId`);**幂等回放形**(#368)`{sessionId, idempotent:true, decision, bindingEnforced:true,
|
|
8873
|
+
* executionOutcome?}`。**没有任何键四形都保证**(回放形无 `status`/`taskId`);判别:`idempotent` → 回放;否则 `decision` 在场 → parked 回执
|
|
8874
|
+
* ({@link import("./resources/approvals.js").ParkedDecideAccepted},四臂,**按 `status` 分臂**:`resuming` / `failed` / `recorded` / `delivered`);其余 → 受理/终局。
|
|
8875
|
+
* (server ≥7.155.0 的 `delivered` 臂带 `sessionId`:旧读法「`decision` 且无 `sessionId` → parked」在它上面不成立,判 parked 只看 `decision` 在不在。)
|
|
8876
|
+
*
|
|
8877
|
+
* 🔴 **server ≥7.155.0:工作流成员停驻卡的 200 答自己的两词**(上一句)。下面两段说的是 **< 7.155.0** 的服务端在这条车道上答什么 ——
|
|
8878
|
+
* 本包对这一版本区间仍成立:那一段服务端在工作流成员卡上答 `resuming`(持有它的 run 还在跑 ⇒ `{taskId: <workflow run id>, status:"resuming", decision}`,
|
|
8879
|
+
* server [7.148.0, 7.155.0),与后台子代的受理臂同键集;记录已终局 ⇒ 下段的任务级受理形,server [7.69.0, 7.155.0))。
|
|
8781
8880
|
*
|
|
8782
|
-
* 🔴 **200 的语义在 7.69.0 起分叉,消费端必须分开读**(server 7.69.0 / S-185,workflow 子代 park
|
|
8881
|
+
* 🔴 **200 的语义在 7.69.0 起分叉,消费端必须分开读**(server 7.69.0 / S-185,workflow 子代 park 车道;**到 7.155.0 为止**):
|
|
8783
8882
|
* bg 赎回腿与任务级腿的 200 = **引擎已提交这次决定**;而当这条 pending 属于一个 **workflow 子代**时,
|
|
8784
8883
|
* 同一个受理形只表示「决定已投递给宿主会话的下一跑」—— **不是**门已解决。子代的 checkpoint 在 200 之后
|
|
8785
8884
|
* **仍可能 pending**,`/v1/approvals` 上那张卡可能还在 ⇒ **禁**据 200 立刻把卡从 UI 抹掉;看进度去 poll
|
|
@@ -8810,14 +8909,23 @@ export interface ApprovalDecisionResult {
|
|
|
8810
8909
|
checkpointId?: string;
|
|
8811
8910
|
/** server ≥7.154.0 · **门身份读不出的开关**(与 `checkpointId` **恒只出其一**;好行逐字节不变):`checkpointId` 读不出可信值时缺席、同位带本键 —— `absent` = 没有可读的身份,`untrusted` = 有但没过判官。按本键判「这一行没有可信的门身份」,别拿缺席的 `checkpointId` 猜。 */
|
|
8812
8911
|
checkpointIdMissing?: CheckpointIdMissingWord;
|
|
8813
|
-
/** 受理 / 终局 / parked 三形恒有;**回放形没有**(这次没有受理任何续跑,铸一个 status 是假话)
|
|
8912
|
+
/** 受理 / 终局 / parked 三形恒有;**回放形没有**(这次没有受理任何续跑,铸一个 status 是假话)。开串;parked 回执上的词是闭集,见 {@link import("./resources/approvals.js").ParkedDecideAccepted}
|
|
8913
|
+
* (`resuming` / `failed` / server ≥7.155.0 的 `recorded` / `delivered`,后两词的表 {@link WORKFLOW_PARK_DECISION_RECEIPT_STATUSES})。 */
|
|
8814
8914
|
status?: string;
|
|
8815
|
-
/** 🔴 **谁的 run id 取决于这次 decide
|
|
8915
|
+
/** 🔴 **谁的 run id 取决于这次 decide 落在哪条车道上**:
|
|
8816
8916
|
* · 任务级腿 —— 本会话被续跑的那条 run;
|
|
8817
8917
|
* · bg 赎回腿 —— 后台子代句柄(`a*`);
|
|
8818
|
-
* ·
|
|
8819
|
-
*
|
|
8918
|
+
* · **工作流成员停驻卡(server ≥7.155.0)—— 只在 `delivered` 上**:宿主会话上带着这只决定、此刻在跑的那一跑(run 店里;`GET /v1/runs/:id`);
|
|
8919
|
+
* `recorded` 上**没有** `taskId`(这只决定寄给的 workflow run 在 {@link runId})。
|
|
8920
|
+
* · 同一条车道在 **< 7.155.0** 的服务端上:记录已终局 ⇒ 宿主会话新铸 / 续上的那一跑(server [7.69.0, 7.155.0));持有它的 run 还在跑 ⇒
|
|
8921
|
+
* **那条 workflow run 的 id**(server [7.148.0, 7.155.0);它不在 run 店里,读 `GET /v1/workflows/:id`)。 */
|
|
8820
8922
|
taskId?: string;
|
|
8923
|
+
/** server ≥7.155.0 · 工作流成员停驻卡回执的键({@link WorkflowParkDecisionReceipt} 两臂恒带):这只决定寄给的那条 workflow run。**只在停驻回执上出现**;
|
|
8924
|
+
* 要窄化请走 {@link import("./resources/approvals.js").ParkedDecideAccepted} 的 `status` 判别,不靠这一键在不在场(老服务端从不带它,在场与否不是判别位)。 */
|
|
8925
|
+
runId?: string;
|
|
8926
|
+
/** server ≥7.155.0 · 工作流成员停驻卡回执的键:这只决定的 id(不透明;与引擎通告 `detail.decisionIds` 同一枚)。**只在停驻回执上出现**;
|
|
8927
|
+
* 要窄化请走 {@link import("./resources/approvals.js").ParkedDecideAccepted} 的 `status` 判别,不靠这一键在不在场。 */
|
|
8928
|
+
decisionId?: string;
|
|
8821
8929
|
sessionId?: string;
|
|
8822
8930
|
bindingEnforced?: boolean;
|
|
8823
8931
|
decision?: string;
|