@sema-agent/sdk 26.1.0 → 28.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 +151 -1
- package/dist/abort.d.ts +25 -0
- package/dist/abort.d.ts.map +1 -0
- package/dist/abort.js +42 -0
- package/dist/abort.js.map +1 -0
- package/dist/client.d.ts +8 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -4
- package/dist/client.js.map +1 -1
- package/dist/control-client.d.ts +4 -2
- package/dist/control-client.d.ts.map +1 -1
- package/dist/control-client.js +3 -3
- package/dist/control-client.js.map +1 -1
- package/dist/device/index.d.ts +2 -1
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/index.js +4 -2
- package/dist/device/index.js.map +1 -1
- package/dist/errors.d.ts +80 -15
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +44 -11
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +80 -5
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/model-route-env/index.d.ts +11 -4
- package/dist/model-route-env/index.d.ts.map +1 -1
- package/dist/model-route-env/index.js +52 -3
- package/dist/model-route-env/index.js.map +1 -1
- package/dist/registry/auth.d.ts.map +1 -1
- package/dist/registry/auth.js +23 -13
- package/dist/registry/auth.js.map +1 -1
- package/dist/registry/client.d.ts +9 -1
- package/dist/registry/client.d.ts.map +1 -1
- package/dist/registry/client.js +17 -2
- package/dist/registry/client.js.map +1 -1
- package/dist/registry/read-body.d.ts +2 -0
- package/dist/registry/read-body.d.ts.map +1 -0
- package/dist/registry/read-body.js +24 -0
- package/dist/registry/read-body.js.map +1 -0
- package/dist/registry/scopes-effective.d.ts.map +1 -1
- package/dist/registry/scopes-effective.js +4 -2
- package/dist/registry/scopes-effective.js.map +1 -1
- package/dist/resources/approvals.d.ts +23 -8
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js +4 -3
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/assistant.d.ts +1 -1
- package/dist/resources/assistant.js +1 -1
- package/dist/resources/attachments.d.ts +2 -1
- package/dist/resources/attachments.d.ts.map +1 -1
- package/dist/resources/attachments.js +3 -9
- package/dist/resources/attachments.js.map +1 -1
- package/dist/resources/fleet.d.ts +0 -36
- package/dist/resources/fleet.d.ts.map +1 -1
- package/dist/resources/fleet.js +40 -1
- package/dist/resources/fleet.js.map +1 -1
- package/dist/resources/ops.d.ts +2 -1
- package/dist/resources/ops.d.ts.map +1 -1
- package/dist/resources/ops.js +4 -6
- package/dist/resources/ops.js.map +1 -1
- package/dist/resources/runs.d.ts +1 -1
- package/dist/resources/runs.js +1 -1
- package/dist/resources/session-sync.d.ts +11 -3
- package/dist/resources/session-sync.d.ts.map +1 -1
- package/dist/resources/session-sync.js +7 -8
- package/dist/resources/session-sync.js.map +1 -1
- package/dist/resources/sessions.d.ts +9 -3
- package/dist/resources/sessions.d.ts.map +1 -1
- package/dist/resources/sessions.js +10 -12
- package/dist/resources/sessions.js.map +1 -1
- package/dist/resources/tasks.d.ts +3 -3
- package/dist/resources/tasks.d.ts.map +1 -1
- package/dist/resources/tasks.js +3 -3
- package/dist/resources/tasks.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +14 -5
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js +14 -6
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/settings.d.ts +1 -1
- package/dist/sse.d.ts.map +1 -1
- package/dist/sse.js +4 -4
- package/dist/sse.js.map +1 -1
- package/dist/transport.d.ts +63 -21
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +126 -25
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +132 -28
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +17 -2
- package/dist/types.js.map +1 -1
- package/openapi.yaml +287 -44
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -60,7 +60,10 @@ import type { SemaSettings } from "./settings.js";
|
|
|
60
60
|
import type { ApprovalDecidedBy } from "./resources/approvals.js";
|
|
61
61
|
import type { ASK_ORIGINS, AllowRuleShadow, ApprovalFrameFamily, ApprovalRequestFrame, AskOrigin, AutoModeFallbackCause, BoundGrantAbsence, BoundSkillGrants, ClassifierUnavailable, DenialLimitFallback, PersistedRuleMandate, RuleOffer, RuleOffersAbsence, ToolApprovalCardWord, ToolApprovalFrame } from "./resources/tool-approvals.js";
|
|
62
62
|
/** Authenticated end-user identity. Opaque to the service (used as memory scope + session owner). The SDK
|
|
63
|
-
* normalizes; the service does
|
|
63
|
+
* normalizes; the service does not interpret the value but does refuse one that is not a principal name: empty or whitespace-only, control / line-separator /
|
|
64
|
+
* invisible format characters (`400 principal_not_a_name`, server ≥7.137.0), a reserved sentinel (`400 principal_reserved`) and more than 190 characters (`400 principal_too_long`).
|
|
65
|
+
* 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
|
|
66
|
+
* identity as ASCII / a user id / percent-encoding on the proxy. Convention: `user:` / `org:` / `ai:` / `anon:`. */
|
|
64
67
|
export type Principal = string;
|
|
65
68
|
/** Builtin scenarios of a stock `@sema-agent/server` that this SDK offers as known names — **five**, all in the table its
|
|
66
69
|
* `buildScenarios()` returns (`src/capabilities/scenarios.ts`). `code` is the factory default ([891]); `default` is the
|
|
@@ -413,16 +416,23 @@ export interface TaskRequest {
|
|
|
413
416
|
* 🔴 声明一个 peer = 声明一条**出站写通道**:它广告的每条技能都以 `egress:true` + `effect:"write"`
|
|
414
417
|
* 挂载(core 裁定),`toolAxes` 是调用方作为信任根的**显式**下调面。
|
|
415
418
|
* 🔴 **坏形 ⇒ 整条 peer 丢弃**(不是丢那个键留这条 peer):`allowSkills` 是收窄字段而缺席被读成
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
+
* 「不限制」,半应用会把收窄意图变成放行。
|
|
420
|
+
* 🔴 **server ≥7.136.0:新提交(fresh)上写坏的声明 ⇒ `400`,不再换回一个「生效了」的 200**。读发布字节的真拒体(逐形):
|
|
421
|
+
* · 列表不是数组 / 条目不是对象 / 键值判不出形(`url` 不是 http(s) 串、`headers` 值不是串、`allowSkills` 不是串数组 …)⇒ `400 request.field_invalid`,**只有句子**(`a2aPeers[i].<键路径> (peer "<名>") is not a usable declaration — …`),**不带 `field` / `reason`**;
|
|
422
|
+
* · 词表外的键(拼错的 `allowSkill` 等)⇒ `400 request.body_shape` + `unknownKeys`(全坐标,如 `a2aPeers[0].allowSkill`);
|
|
423
|
+
* · `url` / `cardUrl` 带凭据 ⇒ `400 request.field_invalid` **带** `field` / `reason`(`url_userinfo` / `url_credential_param`);**超 32 条 ⇒ 同码带 `field: "a2aPeers"` + `reason: "over_cap"` + `count` / `cap`**。
|
|
424
|
+
* 按 `errorCode` / `unknownKeys` / `field` 分支,不按句子。**续跑重放腿(耐久 resume 重放存量体)不拒**:仍走读器的降级 —— 坏条目不挂、具名进运维 warn、请求本身不 400;≤7.135.x 的 fresh 腿也是这一读法
|
|
425
|
+
* (坏形整条丢并具名、超 32 条的条目同样被丢并具名,请求 200 —— 7.135.0 起超 32 条已是 400,见 {@link import("./errors.js").RequestFieldRefusalExtra})。
|
|
426
|
+
* 基线冲突时 center/config **赢**(peer 名就是工具命名空间段)。 */
|
|
419
427
|
a2aPeers?: A2aServerSpec[];
|
|
420
428
|
/** 图文输入:`{ data, mimeType }`(内联 base64)或 `{ url }`。
|
|
421
429
|
* 🔴 **内联臂的准入(server ≥7.117.0 / core 7.42.0)**:`mimeType` 必须是 `image/png` / `image/jpeg` / `image/gif` / `image/webp` 之一(发 API 自己的类型词,不发扩展名),解码后的字节必须带**声明类型**的文件签名,
|
|
422
430
|
* 解码后不得超 5 MiB —— 过不了 ⇒ 引擎在**第一次模型调用之前**拒(UserPromptSubmit hook 之后,一个模型 token 没烧),**400 `config.image_invalid`**,`error` 以 `TaskSpec.images: ` 起
|
|
423
431
|
* (`config.` 不是前缀族 ⇒ 带码的 `APIError`,按 `errorCode` 分支;400 不自动重试)。≤7.116.x 没有这道门:这种图原样送到模型供应方,整只首请求在供应方那边失败(没有本包可依的码)。
|
|
424
432
|
* **「base64 太长」不走本码**:一张内联图的 base64 串超过 5 242 880 字符(模型 API 的 5 MB 图片界;server 读引擎导出的同一只常量)⇒ 受理口先拒 **413 `request.payload_too_large`**(零模型调用、不跑提交钩子、不建 run 行)。
|
|
425
|
-
* 出路:发文件的原样字节与 API 的类型词;超 5 MB 的图先缩。
|
|
433
|
+
* 出路:发文件的原样字节与 API 的类型词;超 5 MB 的图先缩。
|
|
434
|
+
* 🔴 **URL 臂(`{ url }`)server ≥7.136.0**:带凭据的 URL(`user:pass@host`,或 query / fragment 里有凭据名参数)在**新提交**上 ⇒ `400 request.field_invalid` + `field: "images[i].url"` + `reason` `url_userinfo` / `url_credential_param`
|
|
435
|
+
* (「URL 里的凭据」判官的第六座;句子不回显 url 值;出路 = 图片字节改走内联 `{ data, mimeType }`,内联图有自己的字节帽、不落 URL);耐久 resume 重放存量体不判。其余不变(server 早已按签名认类型)。模型要支持图片输入(见 {@link ModelInfo.vision};缺席 ⇒ 照发)。 */
|
|
426
436
|
images?: Array<{
|
|
427
437
|
data: string;
|
|
428
438
|
mimeType: string;
|
|
@@ -687,7 +697,7 @@ export interface TaskRequest {
|
|
|
687
697
|
* is HONORED as a gate-shape choice that adds NO mode-derived ask gate — it is **not** a loosen: the
|
|
688
698
|
* deployment/operator baseline (deny/ask rules) still folds in deny-wins on top (`tightenTaskSpec`), so bypass
|
|
689
699
|
* can never subtract from what the deployment already requires. A fresh submit with an unknown string is
|
|
690
|
-
* fail-loud 400 (server.ts,
|
|
700
|
+
* fail-loud 400 (server.ts, same posture as `promptLean`) — it is NOT silently coerced to `default` (that
|
|
691
701
|
* pre-[816] behavior is stale; a lenient fold survives only for RESUME replay of a pre-gate persisted body).
|
|
692
702
|
* Carrying the INTENT (not the client's pre-interpreted core fields) keeps one interpretation across TUI+web
|
|
693
703
|
* frontends and lets the service govern per deployment axis (single-user vs multi-tenant). 🔴 TWO carriers, ONE
|
|
@@ -832,9 +842,12 @@ export interface TaskRequest {
|
|
|
832
842
|
* Malformed (non-array / empty-string items) → 400 fail-loud at submit.
|
|
833
843
|
* 🔴 **server ≥7.126.0(core 7.49.0 #1623;契约 G.9e)—— 与 {@link allowTools} 读同一文法**:条目 = wire 名或别名、`Tool(content)`(整只工具)、`mcp__srv` / `mcp__srv__*` / 工具段通配;
|
|
834
844
|
* 名单里有一个这一 run **没有任何工具答应**的名字:**server 7.126.0–7.128.x** 引擎开跑前拒 `config.tool_face_control`(同步腿 400,一个 token 没烧;流式 / 后台腿是 `failed` 终局带同码);
|
|
835
|
-
* **server ≥7.129.0 照跑**:条目原样保留(现在什么都不拒,之后挂上同名工具即生效),运维行 `runner_config_advisory` 每条告知一次并带该写的拼法。`config.tool_face_control`
|
|
845
|
+
* **server ≥7.129.0 照跑**:条目原样保留(现在什么都不拒,之后挂上同名工具即生效),运维行 `runner_config_advisory` 每条告知一次并带该写的拼法。`config.tool_face_control` 不再因「没人答应的名字」而出;它仍在两处出现:受理口前置拒的写错拼法(下一段),和这一 run 依赖的协议工具被名单卸掉(拒因 `protocol_denied`,见下面 `*` 的那一段)。
|
|
836
846
|
* 🔴 **server ≥7.131.0 写错的名字受理口前置拒**:大小写孪生(`BASH`)、退役拼法(`bash` · `Task`)、文法读不出的拼法与 `*`(放行方向的静默:以为禁了、其实没禁)⇒ 400 `config.tool_face_control`,句子点名现名。
|
|
837
|
-
* `"*"` 在这张名单上也被拒(此前它是一只叫 `*` 的工具;「卸全部」的拼法仍只有 {@link excludeAllTools})。
|
|
847
|
+
* `"*"` 在这张名单上也被拒(此前它是一只叫 `*` 的工具;「卸全部」的拼法仍只有 {@link excludeAllTools})。
|
|
848
|
+
* 🔁 **server ≥7.137.0(引擎 7.56.0 会话规则文法 5)限制侧的 `*` 是整名 glob**:`"*"` = 每一只工具、`mcp__git*` / `Bas*` 同读;server 不再因 `*` 本身 400 `config.tool_face_control`(上面那一段是 ≤7.136.x 的读法)。deny 赢:可用工具 = 这一 run 挂的一切 ∩ {@link allowTools} − 本名单。
|
|
849
|
+
* 🔴 **受理不等于一定全卸 —— 协议工具是例外**:这一 run 依赖的协议工具被本名单卸掉时,引擎仍拒 `config.tool_face_control`(拒因 `protocol_denied`):带 `outputSchema` 的 run 依赖 `StructuredOutput`,委派腿依赖 `ReportBlocked`;够着它的是腿自己的名单,或它继承的上层名单(例如派它的 run 的 `excludeTools`;队友腿的 `SendMessage` 等只看腿自己的名单),读同一判。`*` 也够得着它们 ⇒ `excludeTools:["*"]` 配 `outputSchema` 照拒;没有协议腿的 run(不带 `outputSchema`,也不是引擎自己起的委派 / 队友 / 目标 / 观察腿,后三腿的协议工具各是 `SendMessage` 等 · `DeclareDone` · `ObserverReport`)才是受理 + 卸光。要「零工具 + 结构化输出」写 `allowTools: []`(腿的协议工具不需要点名),别写 `*`。
|
|
850
|
+
* ⚠️ **受理的一边也有后果**:父 run 没有协议腿,写 `excludeTools:["Re*"]`(`Re*` 够得着 `ReportBlocked`)自己受理、照跑,而它派出的每一只委派子代都在开跑前被拒 —— 这张名单是子代的继承名单。子代**定义**里的 `denyTools` 则是子代那一腿自己的名单,同判(见 {@link TaskAgentDefinition.denyTools})。 */
|
|
838
851
|
excludeTools?: string[];
|
|
839
852
|
/** server ≥7.126.0(core 7.49.0 #1623;契约 G.9e):这一 run 的**可用性选择器**,原样进引擎的 `TaskSpec.allowTools` —— server 零读法:不算补集、不过滤条目、`[]` 不折成缺席、不与 `settings.permissions.allow`
|
|
840
853
|
* (allow 层,免问)混词。可用工具 = 这一 run 挂的一切(调用方工具、手、引擎自己的工具、MCP / A2A、场景与腿工具)∩ 本名单 − {@link excludeTools}(deny 赢),由引擎在开跑前一次算出。
|
|
@@ -854,7 +867,8 @@ export interface TaskRequest {
|
|
|
854
867
|
*
|
|
855
868
|
* 🔴 **与 {@link excludeTools} 是两种语义,刻意不折叠**:「卸全部」不写成 `excludeTools:["*"]` —— server ≥7.126.0(引擎 7.49.0)起那张名单里的 `*` 本身就被引擎拒
|
|
856
869
|
* (`config.tool_face_control`,同步腿 400;此前它是一只叫 `*` 的调用方工具名,「卸全部」与「卸一只叫 `*` 的工具」曾因此不能塌成一件事)。
|
|
857
|
-
*
|
|
870
|
+
* 🔁 **server ≥7.137.0:`excludeTools:["*"]` 不再因 `*` 本身 400,读成整名 glob = 每一只工具**(在没有协议腿的 run 上与 `excludeAllTools` 的效果相同,但仍是两个键、两条读路;有协议腿的 run 上它连协议工具也卸了,引擎拒 `config.tool_face_control`〔拒因 `protocol_denied`〕,条件见 {@link excludeTools}:受理的是没有协议腿的 run(不带 `outputSchema`,也不是引擎自己起的委派 / 队友 / 目标 / 观察腿);`excludeAllTools: true` 单独写不触这一拒)。
|
|
871
|
+
* 两键**同带各自生效**,不冲突:没有协议腿时叠加不拒(全卸之后名单里那几只本来也不在);有协议腿时 `excludeTools:["*"]` 那一键照上面的例外拒,同带 `excludeAllTools: true` 也一样。
|
|
858
872
|
* 🔴 **类型只收字面 `true`**:server 只把 literal `true` 写上 `TaskSpec` —— 挂一个 `false` 上去等于
|
|
859
873
|
* 替引擎重申一次它自己的缺省,而那个缺省的属主是引擎。要动态开关就写
|
|
860
874
|
* `...(off ? { excludeAllTools: true } : {})`,别送 `false`。
|
|
@@ -921,11 +935,12 @@ export interface TaskRequest {
|
|
|
921
935
|
* on demand. The carrier for the shell's "Workflow on by default but not exposed" posture. Same
|
|
922
936
|
* validation/inheritance posture as {@link excludeTools}. */
|
|
923
937
|
deferTools?: string[];
|
|
924
|
-
/** server ≥
|
|
925
|
-
*
|
|
926
|
-
*
|
|
927
|
-
*
|
|
928
|
-
|
|
938
|
+
/** server ≥7.137.0 (core 7.56.0 `TaskSpec.promptLean`): the prompt's SHAPE — `true` = the lean short form, `false` = the long classic form, omitted = the model catalog
|
|
939
|
+
* entry's own declaration. Pure presentation axis (no policy change); inherits through the whole delegation tree.
|
|
940
|
+
* 🔴 **A boolean, not a word**: it replaces the retired two-word profile key (sdk 28.0.0, BREAKING, zero alias): the old `"classic"` is `promptLean: false`, the old `"simple"` is
|
|
941
|
+
* "send no key" (or `true`). A non-boolean value → `400 request.field_invalid`; a server older than 7.137.0 answers `400 request.body_shape` (`unknownKeys: ["promptLean"]`) because its
|
|
942
|
+
* request-key closure does not know the key — and 7.137.0 refuses the retired key the same way, so there is no spelling both sides accept: a submit that carries this key works only against server ≥7.137.0 — leave it out against an older server. */
|
|
943
|
+
promptLean?: boolean;
|
|
929
944
|
/** server ≥7.3.0 (core 5.14.0 `TaskSpec.toolMaterializeStrategy`, board [2856]②): how a DEFERRED tool
|
|
930
945
|
* (see {@link deferTools}) supplies its schema AFTER ToolSearch activates it.
|
|
931
946
|
* `"static"` — the placeholder shape stays (activation only flips callability; the advertised schema
|
|
@@ -941,7 +956,7 @@ export interface TaskRequest {
|
|
|
941
956
|
* to. 🔴 The chain-tail default is **`"swap"`**: it was `"static"` for exactly one core release window and
|
|
942
957
|
* core 5.15.0 (BREAKING) put it back to `"swap"`; server's floor is core ≥5.16.0, so every supported
|
|
943
958
|
* deployment defaults to `"swap"` today (this line used to say `"static"`). Any other value → 400 fail-loud
|
|
944
|
-
* at submit (
|
|
959
|
+
* at submit (same fail-loud posture as {@link promptLean}). */
|
|
945
960
|
toolMaterializeStrategy?: "static" | "swap";
|
|
946
961
|
/** server ≥1.254 — context attachments family (core design/133):literal-true opt-ins
|
|
947
962
|
* (todoReminder/budgetUsd/backgroundTasks/toolsDelta/mcpInstructions;false=省键),
|
|
@@ -965,6 +980,9 @@ export interface TaskRequest {
|
|
|
965
980
|
agentListing?: boolean;
|
|
966
981
|
skillsListing?: boolean;
|
|
967
982
|
mcpInstructions?: true;
|
|
983
|
+
/** server ≥7.137.0(引擎 7.56.0):「这一回合有 MCP 服务器挂不上」附件帧的开关 —— **缺省 = 开**;要关掉它发 `false`。布尔原样进引擎;非布尔 ⇒ `400 request.field_invalid`(`attachments.mcpUnavailable must be a boolean`)。
|
|
984
|
+
* 老 server(≤7.136.x)把这个键**静默丢**(压回缺省开),所以对老 server 发它是无害的无效动作 —— 别按版本号嗅探。 */
|
|
985
|
+
mcpUnavailable?: boolean;
|
|
968
986
|
};
|
|
969
987
|
/** server ≥6.0.0(core 5.8.0 时限重构)— per-task pacing:`maxWalltimeMs`(毫秒,opt-in 墙钟)/
|
|
970
988
|
* `maxOutputTokens`/`maxTurns` 均正整数。退役键(`timeoutSec` 秒键 + deadline 族三 opt-out
|
|
@@ -1028,8 +1046,9 @@ export interface TaskAgentDefinition {
|
|
|
1028
1046
|
allowTools?: string[];
|
|
1029
1047
|
/** Denylist of tool names (subtractive; applied after `allowTools`). 同上:server ≥7.126.0 起读同一只选择器(`Tool(content)` ⇒ 整只工具;`denyTools:["Monitor"]` ⇒ 子代没有 `Monitor`)。
|
|
1030
1048
|
* 🔴 **server ≥7.131.0 引擎读成空的条目受理口前置拒**(限制侧读成空 = 放行,以为禁了的工具照用):近似名(`BASH`)、退役名(`bash` · `Task`)、任何工具名都不可能有的拼法、`*` ⇒
|
|
1031
|
-
* **400 `config.agent.unknown_tool`**(同步 / 流式 / 后台三条腿都是提交时 400),`error` = `agents[<i>].denyTools entry "<条目>" reads as nothing (<原因词>): <怎么写> — …`;清单超 1000 条 ⇒
|
|
1032
|
-
* `request.field_invalid`(撞帽机读位见 {@link import("./errors.js").RequestFieldRefusalExtra})。续跑重放存量体带这类条目 ⇒ 认领之前 409 `resume_blocked_by_policy`(`blockedBy: "config.agent.unknown_tool"`)。
|
|
1049
|
+
* **400 `config.agent.unknown_tool`**(同步 / 流式 / 后台三条腿都是提交时 400;🔁 **server ≥7.137.0 起限制侧名里的 `*` 是整名 glob,`Bas*` 受理,`denyTools:["*"]` 受理口也收 —— 但见下面的协议工具一段**,下面这一句里的 `*` 属 ≤7.136.x 的读法),`error` = `agents[<i>].denyTools entry "<条目>" reads as nothing (<原因词>): <怎么写> — …`;清单超 1000 条 ⇒
|
|
1050
|
+
* `request.field_invalid`(撞帽机读位见 {@link import("./errors.js").RequestFieldRefusalExtra})。续跑重放存量体带这类条目 ⇒ 认领之前 409 `resume_blocked_by_policy`(`blockedBy: "config.agent.unknown_tool"`)。
|
|
1051
|
+
* 🔴 **协议工具 —— `denyTools:["*"]` 受理口收,但这只子代每次被派出都起不来**:子代的 `denyTools` 是子代这一腿**自己的名单**,委派腿依赖协议工具 `ReportBlocked`;`*`(或 `Re*` 这类够得着 `ReportBlocked` 的 glob)把它也卸了 ⇒ 引擎在子代开跑前拒 `config.tool_face_control`(拒因 `protocol_denied`),与根 run 的 {@link TaskRequest.excludeTools} 同一判。要「不挂任何工具的子代」写 `allowTools: []`(腿的协议工具不需要点名),别写 `denyTools: ["*"]`。 */
|
|
1033
1052
|
denyTools?: string[];
|
|
1034
1053
|
/** Skills preloaded into the agent: `{ name, description, content }` (+ optional allowedTools / disallowedTools / files).
|
|
1035
1054
|
* server ≥7.116.0:子代技能受理两只清单(`allowedTools` / `disallowedTools`,读法见 {@link SkillSpec.allowedTools};≤7.115.x 是未知键整条拒)。
|
|
@@ -1443,6 +1462,9 @@ export interface TaskResult {
|
|
|
1443
1462
|
* 缺席分支,而真正的判别位是对端版本,不是这个键。 */
|
|
1444
1463
|
terminal: TerminalCause;
|
|
1445
1464
|
result?: string;
|
|
1465
|
+
/** server ≥7.137.0(引擎 7.56.0 `TaskResult`;属主 = 引擎,本服务逐字过境四张结果脸):`result` 读自的那几条**已提交**消息的会话条目 id(会话序;与 `message_committed` 帧上的 id 同一批)——
|
|
1466
|
+
* 消费方据它把会话里那几条消息换成 `result`,而不是猜是哪几行。🔴 **空表 = 这一跑的 `result` 没读自任何已提交消息;缺席 = 出处不明**(更早的引擎写下的记录、只凭停驻行重建的结果等)—— 两者不同读。 */
|
|
1467
|
+
resultEntryIds?: string[];
|
|
1446
1468
|
/** [2255]① 拒绝形材料(server ≥3.21:SSE 车道 409 conflict.session_active_run 的 done 帧 result 携带;
|
|
1447
1469
|
* 普通终态帧不带)。activeTaskId 其实自 [1833] G10 起就在 wire 上,此前 SDK 侧漏登记——一并补。
|
|
1448
1470
|
* ADDITIVE / tolerate-absent。pendingGate.decidePath = parked run 的那一个正确 resume 入口。 */
|
|
@@ -4012,6 +4034,8 @@ export interface SkillSpec {
|
|
|
4012
4034
|
allowedTools?: string[];
|
|
4013
4035
|
/** server ≥7.116.0:这只技能的 **deny 规则来源**(同 {@link allowedTools} 的文法 / 两道受理门 / 探测位):技能被激活之后,本 run 内这些工具**拒**(不执行、零卡,
|
|
4014
4036
|
* `tool_end.gate.disposition` 为 `{ kind: "denied", deniedBy: "policy" }`);写路径形(`Write(/tmp/**)`)与命令规则照编 deny 行。
|
|
4037
|
+
* 🔁 **server ≥7.137.0:限制侧名里的 `*` 是整名 glob(引擎会话规则文法 5)—— `disallowedTools:["*"]` 受理(200)而且真的全拒,不再 400**;`mcp__*` / `mcp__git*` / `mcp__srv__get_*` / 域名形 `WebFetch(domain:…)` 同受理(对 7.137.0 发布字节的受理口逐条核过)。
|
|
4038
|
+
* 下面这一段列的 `*` / 域名形 / 协议名带通配三类是 ≤7.136.x 的读法;**7.137.0 上仍被拒 = 引擎读成空的条目,原因词恰四个**:`near_miss`(只差大小写:`BASH` · `agent`)· `tool_name`(退役名与没有前缀的短名:`bash` · `Task` · `figma__x`;工具段铸不出的协议名:`mcp__srv__`)· `content_unsupported`(该工具不收内容形:`WebSearch(foo)`)· `grammar`(首尾空白 · 括号不平衡 · 含不可见字符 · 空串 · 域名通配 `WebFetch(domain:*)`)。
|
|
4015
4039
|
* 🔴 **server ≥7.117.0:引擎读成空的条目提交即 400**(顶层 `skills[]` 与子代 `agents[].skills[]` 两处受理口同判)—— `*`、域名形(`WebFetch(domain:…)`)、协议名带通配、带空白 / 畸形的名字:
|
|
4016
4040
|
* `400 request.field_invalid`,`error` = `skill.disallowedTools entry "<条目>" reads as nothing (<原因词>): <怎么写>`(子代那一层前缀 `agents[<i>]: skills[<j>]: `)。
|
|
4017
4041
|
* 为什么拒:一条以为拒了、其实什么也不拒的条目,比没有更坏(≤7.116.x 受理这种条目,只发一条 operator 受众、不上会话流的通告;**那个旧码已改名**为 `permission.allowed_tool_not_granted`,user 受众、上会话流 —— 见 `engine_notice` 臂)。
|
|
@@ -4209,17 +4233,20 @@ export type PermissionModeAutoCapability =
|
|
|
4209
4233
|
});
|
|
4210
4234
|
/**
|
|
4211
4235
|
* **引擎能力词**(core `ENGINE_CAPABILITIES`,core 7.51.1 起;**逐词同序**)—— 「这台引擎做不做 X」的唯一住处:壳按**词**判断,不按版本号。
|
|
4212
|
-
* server ≥7.129.0 把它也接线了的词原样投到 `GET /v1/capabilities` 的**顶层**,**键就是词本身**(
|
|
4236
|
+
* server ≥7.129.0 把它也接线了的词原样投到 `GET /v1/capabilities` 的**顶层**,**键就是词本身**(带点号;没接的词不投 ⇒ 缺席;值是事实不是承诺:第二词、第三词可以是 `false`)。
|
|
4213
4237
|
* · `inherit_env.own_credentials_withheld` —— 这台部署上起的子进程**从不继承**部署声明为自家凭据的名字(`inheritEnv` 的每种策略,含 `"all"`,都先减去那张名单;
|
|
4214
4238
|
* 点名其中一个名字的白名单被拒)。只说**继承**:引擎进程自己的环境对同机同用户进程仍可读,所以「凭据根本不进环境」仍是根治。值恒 `true`(没接的部署不投)。
|
|
4215
4239
|
* · `inherit_env.own_credential_values_withheld`(core 7.52.0 起第二词;server ≥7.132.0 投)—— 宿主上起的子进程**不继承值等于本部署凭据值的变量**(值整串相等,不论变量叫什么名):
|
|
4216
4240
|
* 部署把同一把钥匙抄进别的变量名,`inheritEnv: "all"` 下也扣得下。🔴 **这一位是事实不是能力声明,可以是 `false`**:位真 ⇔ 当前生效配置的每一个凭据变量(只要 env 里有值)都进了引擎的值臂;
|
|
4217
4241
|
* 引擎判某个值「不是凭据」(空白 / 占位词 / 一个字符重复 / 不足 8 字符)或「是每个子进程都会拿到的变量的值」时不收它 ⇒ `false`(名臂照扣)。一次请求才解析出来的凭据不在值臂里。
|
|
4218
4242
|
* 缺席 = 老 server(≤7.131.x:只按名扣,同值换名的副本在 `"all"` 下照进子进程)。壳要「连副本也扣」时按 `=== true` 闸。同样只说**继承**。
|
|
4243
|
+
* · `mods.skill_seat`(core 7.56.0 起第三词;server ≥7.137.0 投)—— 这台服务**把技能自带的 hooks(frontmatter 的 `hooks:`)编成技能座的注册**(`SkillSpec.mods`)吗。🔴 **本服务今天不编,这一位恒投 `false`**
|
|
4244
|
+
* (不是缺席):请求技能(`skills[]` / `agents[].skills[]`)带 `mods` 一律 `400 request.field_invalid`(注册是部署挂的代码,不是请求数据);壳在这一位为 `true` 之前**不要**把技能 frontmatter 的 hooks 投进请求。
|
|
4245
|
+
* 缺席 = 老 server(≤7.136.x):同样不编。
|
|
4219
4246
|
* 一处派生:{@link EngineCapabilityBits} 与 {@link Capabilities} 的能力词键都由本数组生成 —— 引擎加词时这里加一项、其余零手写;
|
|
4220
4247
|
* 缺席 = 老 server(≤7.128.x)或这一词没接线 ⇒ **读作「不保证」**,不是「不具备」。
|
|
4221
4248
|
*/
|
|
4222
|
-
export declare const ENGINE_CAPABILITY_WORDS: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld"];
|
|
4249
|
+
export declare const ENGINE_CAPABILITY_WORDS: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat"];
|
|
4223
4250
|
export type EngineCapabilityWord = (typeof ENGINE_CAPABILITY_WORDS)[number];
|
|
4224
4251
|
/** 能力词 ⇒ 可选布尔(键名原样带点号);{@link Capabilities} 继承它。 */
|
|
4225
4252
|
export type EngineCapabilityBits = {
|
|
@@ -4424,7 +4451,7 @@ export interface Capabilities extends EngineCapabilityBits {
|
|
|
4424
4451
|
sessionSyncFileHistory?: boolean;
|
|
4425
4452
|
/** server ≥7.135.0(契约附录 B.1,谓词类「恒真」):**会话规则记录认协议命名空间的覆盖形**。为 `true` ⇒ 会话规则(`PUT /v1/sessions/:id/policy` 与 `POST /v1/sessions/:id/sync/import` 的 `policy` 面)
|
|
4426
4453
|
* 的 `toolAllow` / `toolDeny` 里,引擎协议表上**每一个**命名空间(今天 `mcp__` 与 `a2a__`)的三种覆盖形 —— 整对端 `mcp__srv`、工具段通配 `mcp__srv__*`、工具段 glob `mcp__srv__get_*` —— 引擎的匹配器认成**一组工具**,写口收。
|
|
4427
|
-
* 壳据位放开自己对这三形的无损判定,不按版本猜。🔴
|
|
4454
|
+
* 壳据位放开自己对这三形的无损判定,不按版本猜。🔴 位**只说命名空间的覆盖形**:授予侧(`toolAllow`)的 `*`、对端段的部分通配(`mcp__git*`)、尾分隔 `mcp__srv__` 由写口拒(`400 rules.inert_entry`);限制侧(`toolDeny`)的 `*` / `mcp__git*` / `Bas*` 自 server ≥7.137.0 起读成整名 glob 而受理;整协议名 `mcp__*` 只在 `toolDeny` 收(拒这一协议的每一只工具)。
|
|
4428
4455
|
* 与 {@link sessionPolicy} 正交(那一位答有没有会话规则写面):壳读法 = `sessionPolicy` ∧ 本位。**键缺席 = 老 server(≤7.134.x)与位为 `false`:一律按「不放宽」读**。 */
|
|
4429
4456
|
sessionRulesNamespaceForms?: boolean;
|
|
4430
4457
|
/** server ≥7.135.0(附录 B.1,恒真版本事实位):顶层请求键 {@link TaskRequest.projectMemory} 受理(唯一的词 `"disabled"`)。读面不挂设施:没接项目上下文座的部署照样受理(清单上答 `"absent"`)。
|
|
@@ -4757,9 +4784,9 @@ export interface Capabilities extends EngineCapabilityBits {
|
|
|
4757
4784
|
* 在场,而那正是 `GET /v1/device/ws` 的 upgrade 处理器挂没挂的**同一个**判据(`server.ts` 的
|
|
4758
4785
|
* `deps.deviceHub?.attach(server)`)⇒「说 yes ⟺ 设备连得上」是结构性的,executor 不必
|
|
4759
4786
|
* trial-by-upgrade-404。三个字段各答一件 executor 在**首连之前**就必须知道的事:
|
|
4760
|
-
* · `protocolVersion` —— 本 server 说的协议**修订号**(§5.6:不满足最低版 = 响亮 helloReject,**不静默降级**)。**server ≥7.
|
|
4787
|
+
* · `protocolVersion` —— 本 server 说的协议**修订号**(§5.6:不满足最低版 = 响亮 helloReject,**不静默降级**)。**server ≥7.137.0 起读 `3`**(7.133.x–7.136.x 读 `2`、≤7.132.x 读 `1`;`challenge` 帧带同值;受理窗 `[1, 3]`,
|
|
4761
4788
|
* 窗内的老 executor 照连)。executor 声明的号 = 「自己实现的最高修订号」与「本位 / challenge 所带号」的**较小者**,并按声明的号取结局码集
|
|
4762
|
-
* (`@sema-agent/sdk/device` 的 `deviceOutcomeErrorCodesAt`;修订号 2 起结局码含 `liveness_no_output`);
|
|
4789
|
+
* (`@sema-agent/sdk/device` 的 `deviceOutcomeErrorCodesAt`;修订号 2 起结局码含 `liveness_no_output`、修订号 3 起含 `name_too_long`);
|
|
4763
4790
|
* · `maxInflightPerDevice` —— per-device 在途上限(§5.5 背压;超额在云侧排队,到期 `device.busy`);
|
|
4764
4791
|
* · `wsPath` —— upgrade 路径。**刻意上 wire** 而不让客户端硬编码:路径是 server 铸的 wire 契约的
|
|
4765
4792
|
* 一部分,硬编码在别的仓里 = 把「改路径」变成一次跨仓破坏性变更。
|
|
@@ -4781,8 +4808,17 @@ export interface Capabilities extends EngineCapabilityBits {
|
|
|
4781
4808
|
* ⚠️ 与上面三位**不同轴**:那三位是**设备侧**接入面(executor 连 WS 要知道的);本位是**壳/管理侧**
|
|
4782
4809
|
* (谁能列设备、换绑、签发、注册、吊销)。一位为真不蕴含另一位为真。 */
|
|
4783
4810
|
management?: boolean;
|
|
4811
|
+
/** server ≥7.137.0 · **present-iff 运维声明了 `DEVICE_RELAY_URL`**:设备的直达入口 —— 绝对 ws(s) URL(无 userinfo / query / fragment),逐字。🔴 **设备拨号方**:在场就拨它、不再自己拼「引擎地址 + `wsPath`」;
|
|
4812
|
+
* 缺席照旧拼(老 server / 运维没声明)。 */
|
|
4813
|
+
relayUrl?: string;
|
|
4784
4814
|
[k: string]: unknown;
|
|
4785
4815
|
};
|
|
4816
|
+
/** server ≥7.137.0 · **恒真的版本位**:`POST /v1/assistant/tasks/:id/plan_review` 的决断体受理门身份键 {@link PlanReviewRequest.checkpointId}(「门换了」⇒ `409 approval_stale`)。刻意不挂任何设施 ——
|
|
4817
|
+
* 本位答「这个二进制的那道门受理这只键」,不答「这台部署上 plan_review 可用」(那是 `asyncRuns` / `approvals`)。🔴 **先读本位再带键**:缺席 = 老 server(7.86.0–7.136.x 对这个键 400,更老的静默丢)⇒ 别带。 */
|
|
4818
|
+
planReviewCheckpointId?: boolean;
|
|
4819
|
+
/** server ≥7.137.0 · **成员 git 凭据平面**的唯一读数(config 依赖,对象恒在场):成员 `sandboxGit` 见 {@link CredentialPlaneCapability}。🔴 **7.137.0 恒 `off`**(取值口的 worker 凭据与有效配置都还没接线 ——
|
|
4820
|
+
* 读数停在 `no_caller_credential` 或更前的词);老 server(缺席)⇒ 按「平面关、原因未知」渲,**别承诺**「沙箱里的 git 会带上你的身份」。 */
|
|
4821
|
+
credentialPlane?: CredentialPlaneCapability;
|
|
4786
4822
|
/** 记忆**引擎**位(server `routes/capabilities.ts:210` = `projectMemoryEngineCapability(deps.memoryPosture)`,
|
|
4787
4823
|
* 实现在 `src/memory-posture.ts:143`)—— 对象 = 本部署的记忆面**真点亮**,`false` = 暗。判据**逐字**是
|
|
4788
4824
|
* boot 的 `memoryPosture`(`boot/stores.ts` 的单一推导点)的窄投影,与 operator 诊断面
|
|
@@ -5349,6 +5385,46 @@ export interface ScenarioDetail {
|
|
|
5349
5385
|
skills?: ScenarioSkill[];
|
|
5350
5386
|
[k: string]: unknown;
|
|
5351
5387
|
}
|
|
5388
|
+
/**
|
|
5389
|
+
* `credentialPlane.sandboxGit` 平面关闭的原因(server ≥7.137.0,自铸词表 `credentialPlaneSandboxGitOffReason`,九词闭集)—— **取第一个不成立的前提,判序固定 = 数组序**:
|
|
5390
|
+
* `single_user`(不是多租户部署)→ `lane_without_boundary`(执行车道不是 k8s 沙箱 pod)→ `no_caller_credential`(本 worker 没有控制台凭据库认的取值凭据)→ `center_not_https`(中心地址不是 https)→
|
|
5391
|
+
* `secret_seat_unverified`(起服没能确认沙箱命名空间里租约 Secret 那一座的 secrets 动词)→ `secret_seat_denied`(沙箱 Role 不许)→ `pod_patch_reaches_broker`(部署的 pod 补丁可能碰到凭据代理容器)→
|
|
5392
|
+
* `broker_image_unset`(代理镜像未设)→ `no_origins`(有效配置里没有要代理的 git origin)。只出词与 origin:镜像、命名空间、凭据一字不上 wire。**读开集**(新词按「关,原因未知」处置)。
|
|
5393
|
+
*/
|
|
5394
|
+
export declare const CREDENTIAL_PLANE_OFF_REASONS: readonly ["single_user", "lane_without_boundary", "no_caller_credential", "center_not_https", "secret_seat_unverified", "secret_seat_denied", "pod_patch_reaches_broker", "broker_image_unset", "no_origins"];
|
|
5395
|
+
/** {@link CREDENTIAL_PLANE_OFF_REASONS} 的成员型。 */
|
|
5396
|
+
export type CredentialPlaneOffReason = (typeof CREDENTIAL_PLANE_OFF_REASONS)[number];
|
|
5397
|
+
/** `credentialPlane.sandboxGit.origins[]` 的一行:https ⇒ `delivers: true`;非 https ⇒ `delivers: false` + `reason: "insecure_transport"`(仍经代理转发,**永不带凭据**)。 */
|
|
5398
|
+
export type CredentialPlaneOrigin = {
|
|
5399
|
+
origin: string;
|
|
5400
|
+
delivers: true;
|
|
5401
|
+
} | {
|
|
5402
|
+
origin: string;
|
|
5403
|
+
delivers: false;
|
|
5404
|
+
reason: "insecure_transport" | (string & {});
|
|
5405
|
+
};
|
|
5406
|
+
/** `Capabilities.credentialPlane`(server ≥7.137.0):对象恒在场,成员 `sandboxGit` 是判别联合 —— `on` 带逐 origin 一行,`off` 带 {@link CredentialPlaneOffReason}(读开集)。 */
|
|
5407
|
+
export interface CredentialPlaneCapability {
|
|
5408
|
+
sandboxGit: {
|
|
5409
|
+
state: "on";
|
|
5410
|
+
origins: CredentialPlaneOrigin[];
|
|
5411
|
+
} | {
|
|
5412
|
+
state: "off";
|
|
5413
|
+
reason: CredentialPlaneOffReason | (string & {});
|
|
5414
|
+
};
|
|
5415
|
+
[k: string]: unknown;
|
|
5416
|
+
}
|
|
5417
|
+
/** {@link WiringManifestSkill.source} 的闭集(server ≥7.137.0,自铸词表 `wiringSkillSource`):`factory` = 本部署自带;`center` = 本部署配置源交来的;`request` = 本请求体 `skills`(与场景同名的被场景盖掉、不在册)。
|
|
5418
|
+
* 与场景卡的 {@link SCENARIO_SKILL_SOURCES} 是**两张表**(多一词 `request`)。 */
|
|
5419
|
+
export declare const WIRING_SKILL_SOURCES: readonly ["factory", "center", "request"];
|
|
5420
|
+
/** {@link WIRING_SKILL_SOURCES} 的成员型。 */
|
|
5421
|
+
export type WiringSkillSource = (typeof WIRING_SKILL_SOURCES)[number];
|
|
5422
|
+
/** `wiring_manifest.skills[]` 的一行(server ≥7.137.0):`{ name, description, source }`,不带正文;条目形与场景卡 {@link ScenarioSkill} 同一张,只是来处多一词。 */
|
|
5423
|
+
export interface WiringManifestSkill {
|
|
5424
|
+
name: string;
|
|
5425
|
+
description: string;
|
|
5426
|
+
source: WiringSkillSource;
|
|
5427
|
+
}
|
|
5352
5428
|
/** {@link ScenarioSkill.source} 的闭集(server ≥7.135.0,自铸词表 `scenarioSkillSource`):`factory` = 本部署的技能目录(`SKILLS_DIR`);`center` = 配置源交来的(中心 / 本地 `config.d` 的技能清单,或配置声明的插件;
|
|
5353
5429
|
* 按名盖掉出厂同名的那只也是 `center`)。 */
|
|
5354
5430
|
export declare const SCENARIO_SKILL_SOURCES: readonly ["factory", "center"];
|
|
@@ -5586,8 +5662,17 @@ export interface PendingCheckpoint {
|
|
|
5586
5662
|
ruleOffersAbsence?: RuleOffersAbsence;
|
|
5587
5663
|
/** server ≥7.129.0(core 7.51.0 #1688;park 行事实第八位)—— 这张停驻卡**为什么没有**授予绑定摘要(park 行孪生座 `PendingAction.tool_approval.boundGrantAbsence`,
|
|
5588
5664
|
* 与活卡帧 / inbox 行同一只窄读、同名同值)。读法见 {@link import("./resources/tool-approvals.js").BoundGrantAbsence}。
|
|
5589
|
-
* 🔴 本面缺席 = 技能卡(
|
|
5665
|
+
* 🔴 本面缺席 = 技能卡(带摘要)/ 7.51.0 之前停驻的行(两者都不说 —— inbox 面对同一张行投 `unreadable`)/ 集外词 / 老 server —— **不是** `not_bindable`。 */
|
|
5590
5666
|
boundGrantAbsence?: BoundGrantAbsence;
|
|
5667
|
+
/** server ≥7.136.0 —— 引擎 `Skill` 工具的停驻卡上的授予绑定摘要,与 inbox 行 / 活卡帧同名位同值({@link InboxRow.boundGrantDigest}):运维从队列决这张卡时看得到批准它放行了什么。
|
|
5668
|
+
* 三位({@link boundGrantDigest} / {@link boundGrants} / {@link classifierNoRuling})由**一只投影**投队列行、`/v1/approvals/stream` 的 `pending` 帧与 inbox 行 —— 同一张停驻行三面逐字相等;值是引擎对这一行投的检查点摘要,server 不重算哈希。
|
|
5669
|
+
* 在场才带(普通卡三位三面都缺席;缺席不是断言);`card_json` 仍不带。≤7.135.x 的队列行与流帧没有这三位。 */
|
|
5670
|
+
boundGrantDigest?: string;
|
|
5671
|
+
/** server ≥7.136.0 —— 上一位哈希的那一份值(技能名 + `allowedTools` / `disallowedTools`);**只在它确实哈希成 {@link boundGrantDigest} 时**出现(对不上 ⇒ 只有摘要、没有清单;没有摘要 ⇒ 清单也不发)。
|
|
5672
|
+
* 🔴 部署文本(技能名、清单条目由部署者写):server 不脱敏不转义,渲染按上下文转义。 */
|
|
5673
|
+
boundGrants?: BoundSkillGrants;
|
|
5674
|
+
/** server ≥7.136.0 —— 只在类 `classifier_no_ruling` 的停驻卡上:分类器为什么没判({@link AutoModeFallbackCause};值闭集成员才回显)。想知道为什么分类器的卡交给了人的壳读它。 */
|
|
5675
|
+
classifierNoRuling?: AutoModeFallbackCause;
|
|
5591
5676
|
/** K-37 扩项(server ≥7.109.0 / S-934 ② / core 7.37.0 #1214)—— 这一问的**类**(park 行孪生座 `PendingAction.tool_approval.askClass`,经 server
|
|
5592
5677
|
* `readAskClassPair` —— 与活卡帧 / 卡面**同一只**窄读)。与 {@link classes} 同在同缺,`classes[0] === askClass`;durable 审批席按类答的依据。
|
|
5593
5678
|
* 缺席 = 老行(core 7.37.0 之前 park 的,续跑不补)/ 读不出(server 计 S-249 tag),**不是**「无类」。语义全文见
|
|
@@ -6677,7 +6762,9 @@ export interface InboxRow {
|
|
|
6677
6762
|
* 🔴 **为什么本面还留着这一位**:本行的随包 spec 是**闭形**(`additionalProperties: false`)—— 支持面内 [7.72.0, 7.106.0) 的 server 仍会发它,
|
|
6678
6763
|
* 删了就让那些 server 的合法行对 spec 违约。 */
|
|
6679
6764
|
ruleStoreUnreadable?: "store" | "call";
|
|
6680
|
-
/** 任务目标(
|
|
6765
|
+
/** 任务目标(契约明确 "`null` if unavailable" —— 真回 null 的字段,非 OMIT)。
|
|
6766
|
+
* 🔴 **值在 server 7.136.0 起变**(键名与可空性不变):此前是停驻上下文里存着的任务目标**原文**(不截断、不脱敏);**≥7.136.0 起是门所属 run 行的 `objectivePreview`**
|
|
6767
|
+
* (写入时已脱敏、约 120 字符,与 `GET /v1/assistant/tasks` 行同一列;查找规则 = server `gateObjectivePreview`:门所属会话的活跃 run → 最近一条 run;**委派子代的会话没有自己的 run 时,经停驻子代行的 `parentTaskId` 回退读派生它的那条 run**(逐跳,至多 8 跳));**`null` = 读不到预览**(没有 run 账本是原因之一;读那一行失败、委派链断了或超 8 跳、run 行没有预览也回 `null` —— 本键不分辨是哪一种,别读出单一原因)。把本键当完整目标用的消费方(全文展示、按全文匹配)要知道:**7.136.0 服务端没有全量目标读口**(`GET /v1/runs/:id` 不带 `objective` / `objectivePreview`)—— 本键就是预览;全量读口随 server 后续版本,届时本包锁步,本包不编造替代路径。 */
|
|
6681
6768
|
objective: string | null;
|
|
6682
6769
|
/** 挂起工具调用 args 的**脱敏预览**(server 侧 redactDeep+限长;仅 tool_approval 门有,其余 `null`)。 */
|
|
6683
6770
|
input: unknown;
|
|
@@ -6761,6 +6848,15 @@ export interface PlanReviewRequest {
|
|
|
6761
6848
|
/** operator 改写后的 plan; REQUIRED iff decision==="edit", 否则禁带。 */
|
|
6762
6849
|
editedPlan?: string;
|
|
6763
6850
|
reason?: string;
|
|
6851
|
+
/**
|
|
6852
|
+
* 🔴 **你决断时看到的那道计划门的身份**(server ≥7.137.0;**先读 {@link Capabilities.planReviewCheckpointId} 再带键**)—— 门换了(另一端答了、run 重做计划后停上一道**新的** plan 门)而你还在批旧计划 ⇒
|
|
6853
|
+
* `409 approval_stale`(与 `/decide` 逐字同码同句),**任何状态都不动**(计划未批、卡仍待决),拒体带当前门的身份 `currentPending: { checkpointId }`({@link ApprovalStaleError.currentPlanGate})。**不带键 ⇒ 照旧受理**(没有陈旧保护)。
|
|
6854
|
+
* 值源:park 结果的 `terminal.checkpointId`(`GET /v1/runs/:id` 的 `result`、同步提交体、流的 `done.result`)· 运维队列 `GET /v1/approvals` / 收件 `GET /v1/assistant/inbox` 行的 `checkpointId` ·
|
|
6855
|
+
* `GET /v1/runs/:id/events` 的 `needs_review` 账本行 `data.checkpointId`(同一个值)。非空串、≤128 字符,否则 `400 request.field_invalid`(存在性无关)。
|
|
6856
|
+
* 🔴 **位缺席 = 老 server,别带**:7.86.0–7.136.x 对这个键答 `400 request.body_shape`(`unknownKeys`,那一次决断整个失败),更老的静默丢。直连门(HMAC 证明)上带它就要把它签进信封第 6 位扩展对象,带了不签 ⇒ `401 approval_mac_invalid`。
|
|
6857
|
+
* 收到 409 后:读 `currentPlanGate.checkpointId`,重取**那道门**的计划给人看,人认可后带新身份再决 —— **别拿它盲重发**(那是在批一份没人看过的计划);体里没有 `currentPending` ⇒ 重拉队列或 run 再决。
|
|
6858
|
+
*/
|
|
6859
|
+
checkpointId?: string;
|
|
6764
6860
|
/**
|
|
6765
6861
|
* 🔴 **批准计划之后这条 task 继续跑在哪一档权限模式**(server ≥7.86.0)—— 把计划带出 plan 的决定把这一位写回这条任务的存储体,
|
|
6766
6862
|
* 此后每一次挂起→续跑都沿用它,不回 plan。
|
|
@@ -6781,8 +6877,8 @@ export interface PlanReviewRequest {
|
|
|
6781
6877
|
* plan 起步 = 请求选的,或运维 `AUTONOMY=plan` 在提交入口盖下的 —— 后者的存储词就是 plan,这一位照收。
|
|
6782
6878
|
* 🔴 三条 400 一律**按码匹配**(`request.field_invalid` / `request.field_conflict`),不按句子 —— 两句 `request.field_conflict` 的文案在 7.122.0 改过(码不变)。
|
|
6783
6879
|
* ⚠️ 它**不是**一个能顺带关掉征询面的旋钮 —— 两个词之外没有第三档。
|
|
6784
|
-
* ⚠️ **直连门部署**:本键进 HMAC 信封的**尾位扩展对象**(server 7.87.0 起 `{answer?, permissionModeAfter?}`,
|
|
6785
|
-
*
|
|
6880
|
+
* ⚠️ **直连门部署**:本键进 HMAC 信封的**尾位扩展对象**(server 7.87.0 起 `{answer?, permissionModeAfter?}`;server ≥7.137.0 闭集字典序 `answer` / `checkpointId` / `permissionModeAfter`,
|
|
6881
|
+
* 在场键按字典序,缺席时字节逐字不变;7.86.0 的裸尾位形已删、零双读)⇒ 签名器必须按新形签,混版两向皆 401。
|
|
6786
6882
|
* ⚠️ 键名定谳 `permissionModeAfter`(任务书曾写 `nextPermissionMode`,从未上过发布版,**零别名**)。
|
|
6787
6883
|
*/
|
|
6788
6884
|
permissionModeAfter?: "default" | "acceptEdits";
|
|
@@ -6889,6 +6985,10 @@ export interface WiringManifest {
|
|
|
6889
6985
|
/** server ≥7.135.0(引擎 7.55.0;effective 半场恒在):**这条腿调没调部署的项目上下文座** —— `"on"` = 调了(座答了什么是部署的事);`"disabled"` = 座接着、请求 {@link TaskRequest.projectMemory} 关掉了;
|
|
6890
6986
|
* `"absent"` = 部署没接座(不论请求说了什么)。后两词的腿上,本服务自铸的 `instructions` 段**缺席**(loader 没被调,就没有陈述)。词表属主是引擎,**读开集**(新词原样过境);缺席 = 老引擎。 */
|
|
6891
6987
|
projectMemory?: "on" | "disabled" | "absent" | (string & {});
|
|
6988
|
+
/** server ≥7.137.0(本服务自铸段;条件在场:**非子代帧**,租户帧与 operator 帧同投):**这条 run 交给引擎的技能**,同一组、同一个序 —— 壳在 init 帧 / 上下文用量 / 技能列表三处读同一个源。
|
|
6989
|
+
* 零技能(含 `disableSkills: true`)= `[]`;委派子代的帧不带。🔴 语义只有一个:**交给引擎的**,不是「引擎装上的」—— 引擎对单只技能有加载门(展开 `${SKILL_ROOT}` 之后超过 1 048 576 个字符的整只不装),超过的那一只名册里有、引擎不装。
|
|
6990
|
+
* 续跑腿报续跑那一次装配的名册。缺席 = 老 server 或子代帧。 */
|
|
6991
|
+
skills?: WiringManifestSkill[];
|
|
6892
6992
|
/** fleet 面:`backgroundAgentStore` / `hostChildEventSink` 是在场位;🔴 `subagentTranscripts`(**server ≥7.115.0 / S-744**,core 7.32.0 的档位上 wire)= 这台部署的**子代转录档位**,
|
|
6893
6993
|
* 壳按它如实渲「durable record」文案:`"none"`(没有 agent 行店:子代记录不留)/ `"rows"`(行与终态快照活过重启、**对话不活**:仅本进程 / 会话店 TTL 内可续)/ `"full"`(已结束的子代**跨重启可续**)。
|
|
6894
6994
|
* 🔴 **开集读**:三词是 core 今天的词,**不要穷举**(core 的第四个词会被吞成缺席);**未知词 ⇒ 按「未知档位」处置,不要当 `full`**。缺席(老 server / 老引擎)= 不知道,**绝不读成 `"none"`**;租户帧与 operator 帧同投。 */
|
|
@@ -7508,11 +7608,15 @@ export interface MemoryOriginClearReceipt {
|
|
|
7508
7608
|
[k: string]: unknown;
|
|
7509
7609
|
}
|
|
7510
7610
|
/** `POST /v1/approvals/{sessionId}/decide` 的 200 体(spec `ApprovalDecisionResult` 的型面镜像;此前 SDK 只给 `unknown`)。
|
|
7611
|
+
* 🔴 **server ≥7.136.0:parked 回执有两臂,看 `status`**(类型 {@link import("./resources/approvals.js").ParkedDecideAccepted} 是它们的联合):`"resuming"` = 受理回执(复活在飞);
|
|
7612
|
+
* **`"failed"` = 作废回执** `{ taskId, status: "failed", decision: "deny" }` —— 复活不了的停驻行(后台子代省略 `name` 的无名行 / 行上没有根会话锚)上 deny = 作废这张卡
|
|
7613
|
+
* (卡离开待决队列与 `/v1/approvals/stream` 快照;子代由引擎的对账翻成终局 `failed`;复活腿一步都不走,被门的工具零执行;拒绝理由无处可送,不落)—— **没有续跑在飞**,别读成「续跑开始了」。
|
|
7614
|
+
* 这两形的 **approve 仍是 `409 decide.row_unrevivable`**(子代复活不了,放行做不到)。
|
|
7511
7615
|
* 三种真实形共用这只信封(spec 长注有全文):**受理形**(server ≥7.37 durable 部署默认)`{taskId, sessionId,
|
|
7512
7616
|
* status:"resuming", bindingEnforced:true}` —— `errorCode`/`errorMessage`/`retriable` **从不**上这形,失败落 run 行与
|
|
7513
7617
|
* `GET /v1/runs/:id/events` 的 `suspended` 事件(`reopened: <errorCode>`);**终局形**(无 durable run 行 / `verify:true`
|
|
7514
|
-
* 的同步长调用)`{taskId?, sessionId, status, errorCode?, errorMessage?, retriable?}`;**parked 回执**
|
|
7515
|
-
* `{taskId, status:"resuming", decision}`;**幂等回放形**(#368)`{sessionId, idempotent:true, decision, bindingEnforced:true,
|
|
7618
|
+
* 的同步长调用)`{taskId?, sessionId, status, errorCode?, errorMessage?, retriable?}`;**parked 回执**(server ≥7.136.0 两臂)
|
|
7619
|
+
* `{taskId, status:"resuming", decision}` 或作废臂 `{taskId, status:"failed", decision:"deny"}`;**幂等回放形**(#368)`{sessionId, idempotent:true, decision, bindingEnforced:true,
|
|
7516
7620
|
* executionOutcome?}`。**没有任何键四形都保证**(回放形无 `status`/`taskId`);判别:`idempotent` → 回放,`decision` 且无 `sessionId` → parked,
|
|
7517
7621
|
* `sessionId`+`bindingEnforced` → 受理/终局。
|
|
7518
7622
|
*
|