@sema-agent/server 7.16.0-rc.2 → 7.16.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/dist/http/server.js +14 -11
- package/package.json +1 -1
package/dist/http/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
2
|
import { once } from "node:events";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import { uuidv7, isThinkingLevel, expandTiers, resumeWithVerification, CheckpointError,
|
|
4
|
+
import { uuidv7, isThinkingLevel, expandTiers, resumeWithVerification, CheckpointError, defaultTaskRegistry, validatePendingSteer, subscribeWorkflow, GLOBAL_USAGE_KEY, usageRetryAfterMs } from "@sema-agent/core";
|
|
5
5
|
import { decideParkedAgent, findParkedAgentForCheckpoint } from "../parked-decide.js";
|
|
6
6
|
import { isModelAllowlisted, matchCatalogModel } from "../model-select.js";
|
|
7
7
|
import {} from "../config-center/facade.js";
|
|
@@ -16,6 +16,7 @@ import { runInBackground, evictIfConflict, stripCheckpointToken, TurnAnchorCaptu
|
|
|
16
16
|
import { looksLikeJwt } from "@sema-agent/registry-core/api/auth-bridge";
|
|
17
17
|
import {} from "../orchestration/workflow-agent-steer.js";
|
|
18
18
|
import { emitPendingWorkflowCompletions, taskNotificationInboxEntry, taskNotificationStreamKey, NotifiedKeys } from "../orchestration/workflow-completion-inbox.js";
|
|
19
|
+
import { HANDS_BAND_TOOL_NAMES } from "../capabilities/hands-lane.js";
|
|
19
20
|
import { fleetRunPublisher, fleetRunLabels, fleetRunResiduals, isFleetAgentTerminalNotification } from "../fleet/fleet-bus.js";
|
|
20
21
|
import { defaultSubagentTailBus, projectTailFrame } from "../fleet/subagent-tail-bus.js";
|
|
21
22
|
import { createApprovalCardEmitter, isApprovalGateKind, resolveApprovalLeg, resolveStreamApprovalGate } from "../tool-approval.js";
|
|
@@ -110,13 +111,14 @@ const MAX_IMAGES_PER_REQUEST = 20;
|
|
|
110
111
|
const MAX_IMAGE_BASE64_BYTES = 6 * 1024 * 1024; // a single inline image's base64 ≤ 6 MiB (< MAX_BODY, so REACHABLE — one image can't hog the whole 8 MiB budget); ~4.5 MiB decoded, generous for a screenshot/photo
|
|
111
112
|
// Task Trace API (S1): GET /v1/tasks (list) | /v1/tasks/:id/turns | /v1/tasks/:id/stream. The `:id` group +
|
|
112
113
|
// sub-route are both-or-neither, so a GET /v1/tasks/stream (no :id) does NOT match — the POST sync stream is unshadowed.
|
|
113
|
-
// Hand (executionEnv) tool names core mounts at the runner when an executionEnvFactory is configured
|
|
114
|
-
//
|
|
115
|
-
// the
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
|
|
114
|
+
// Hand (executionEnv) tool names core mounts at the runner when an executionEnvFactory is configured. These are
|
|
115
|
+
// NEVER in spec.tools, so the durable-resume satisfiability pre-check must union them when remote exec is on.
|
|
116
|
+
// #244([3751]): the authoritative set is the FULL band `HANDS_BAND_TOOL_NAMES` (capabilities/hands-lane.ts —
|
|
117
|
+
// effects table + the mounted complement Monitor/EnterWorktree/ExitWorktree/SendMessage/AgentTranscript, retired
|
|
118
|
+
// names filtered at the single owner). The old effects-only derivation left the complement out, so approving a
|
|
119
|
+
// parked complement-tool ask (the disconnect force-park population, e.g. Monitor on the cli host lane) was a
|
|
120
|
+
// permanent 422 conflict.pending_action_unsatisfiable — the re-presented card's answer could never propagate.
|
|
121
|
+
const HAND_TOOL_NAMES = HANDS_BAND_TOOL_NAMES;
|
|
120
122
|
/** #233 / A-002.8 —— 未知模型 400 里 `available` 列表的**名单过滤**:不给用户广告他点不了的模型。
|
|
121
123
|
* 名单缺席/空 ⇒ 与本件之前逐字同集(全目录去 `default` 别名);名单在场 ⇒ 只留名单准的那些。
|
|
122
124
|
* 判定单源 `isModelAllowlisted`(与三个执法点同一只),所以"列出来的"与"点了不被拒的"恒为同一批。 */
|
|
@@ -1527,12 +1529,13 @@ export function createHttpServer(rawDeps) {
|
|
|
1527
1529
|
// Typed pre-check: the pending tool must still exist in the rebuilt config; a scenario
|
|
1528
1530
|
// redeploy that removed it means the approval can no longer be applied — fail clearly, never a 500/silent.
|
|
1529
1531
|
// The "hand" tools are NOT in spec.tools — core mounts them at the runner from the executionEnvFactory
|
|
1530
|
-
// (`HAND_TOOL_NAMES` above
|
|
1532
|
+
// (`HAND_TOOL_NAMES` above = hands-lane.ts `HANDS_BAND_TOOL_NAMES`, the single owner; nothing is mirrored here).
|
|
1531
1533
|
// When this deployment has remote exec configured the rebuilt task WILL expose them, so union them in; else
|
|
1532
1534
|
// gating a hand tool (the common code-agent case) would always 422 on resume.
|
|
1533
1535
|
// #196 旁注:本 union 只看部署有没有 remoteExec,不看本任务的 hands lane —— 对 hands=none 的任务这是
|
|
1534
|
-
// **过近似**(那些工具根本没 mount,也就不可能有它们的 park 行),只影响 422 的 UX
|
|
1535
|
-
// band
|
|
1536
|
+
// **过近似**(那些工具根本没 mount,也就不可能有它们的 park 行),只影响 422 的 UX 宽严,不放大任何权限。
|
|
1537
|
+
// #244:union 必须是 band **全**名单——effects 表外的挂载补集(Monitor/EnterWorktree/…)当年漏了,
|
|
1538
|
+
// 断连 force-park 人群第一个踩中(approve 恒 422,重呈卡回答永不传导;test legB1-durable 实测指纹)。
|
|
1536
1539
|
// [2380] RB-476(5.0.0):Q6 折叠预检退役——满足性匹配按 RAW 名。pre-floor 旧名 checkpoint
|
|
1537
1540
|
// (`bash`/`run_workflow` 等)在此 422 诚实拒,与 core 自己的 resume.tool_unavailable 同方向
|
|
1538
1541
|
// ([2364] 令:耐久面响亮牺牲 + P-7 重开,不静默兜)。现役名恒自映射。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/server",
|
|
3
|
-
"version": "7.16.0
|
|
3
|
+
"version": "7.16.0",
|
|
4
4
|
"description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|