@sema-agent/server 5.4.0 → 5.5.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/config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { homedir } from "node:os";
2
2
  import { join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
- import { CODE_AGENT_PROMPT, formatUserScope, isThinkingLevel, protocolOf, RECOMMENDED_SENSITIVE_PATTERNS, RETIRED_TOOL_NAMES } from "@sema-agent/core";
4
+ import { CODE_AGENT_PROMPT, formatUserScope, isThinkingLevel, PROTOCOL_TABLE, protocolOf, RECOMMENDED_SENSITIVE_PATTERNS, RETIRED_TOOL_NAMES } from "@sema-agent/core";
5
5
  import { ROSTER_PRIMARY_ROLES, ROSTER_CHEAP_ROLES } from "@sema-agent/registry-core";
6
6
  import { parseApprovalHmacKeys, parsePrincipalJwks } from "./auth-keys.js"; // design/158 A4: the parser leaf — NOT security.js (base config layer must not value-import the 55KiB auth module)
7
7
  import { DEFAULT_ELICITATION_THROTTLE } from "./elicitation.js";
@@ -820,8 +820,10 @@ export function findUnmatchableToolNames(names) {
820
820
  }
821
821
  const ns = protocolOf(name);
822
822
  if (ns === undefined) {
823
+ // 5.3.0 协议表两行起,短名归属不再唯一(figma__x 可能是 mcp 短形或 a2a 短形)——指引枚举全表
824
+ // 前缀(与 core 5.3.0 自侧同族修同口径),不再手写死 mcp__。
823
825
  if (name.includes("__"))
824
- out.push({ name, guidance: `pre-prefix MCP short form — the live name is mcp__${name}` });
826
+ out.push({ name, guidance: `pre-prefix short form — the live name carries a protocol prefix: ${PROTOCOL_TABLE.map((e) => `${e.prefix}${name}`).join(" or ")}` });
825
827
  continue;
826
828
  }
827
829
  if (ns.parse(name) === undefined) {
@@ -1925,6 +1925,10 @@ export function createHttpServer(rawDeps) {
1925
1925
  errorCode: e.code === "checkpoint.invalid_outcome"
1926
1926
  ? (outcome.gate === "policy_ask" ? "approval_binding_mismatch" : "resume_outcome_invalid")
1927
1927
  : e.code,
1928
+ // [2422] HITL-2 裁 (a),core 5.3.0:invalid_outcome 同码两义(动作被换 vs 输入被换)——
1929
+ // detail.field 是唯一机读判别式,透传给 UI 路由恢复动作(boundCallId=重取 pending 列表,
1930
+ // boundInputHash=重审同动作的新输入)。缺席=core 未铸(非绑定类 invalid_outcome),不造键。
1931
+ ...(e.detail?.field ? { field: e.detail.field } : {}),
1928
1932
  ...(retriable ? { retriable: true } : {}),
1929
1933
  },
1930
1934
  };
@@ -66,13 +66,21 @@ function rowToSummary(r) {
66
66
  : {}),
67
67
  };
68
68
  }
69
- /** core reap 的 staleRunning 翻转形(逐字段照抄 InMemory:summary 只在缺席时补默认句)。 */
69
+ /** core 的共享归因句(`STALE_RUNNING_REAP_ATTRIBUTION`,dist/core/background-agent-store.js:44)——
70
+ * **值拷贝**:core 5.3.0 未把它放上包根(exports 只有 ./bench 与 ./fixtures 两条子路,deep import 会被
71
+ * exports 图拒绝),已在提货回执里请 core 上包根,到货后换 import。漂移钉=backgroundAgentStoreContract
72
+ * 的 stale-running 条目逐字断言这句(store-contract-kit-db-integration §4.5,真双库)——core 改句必红。 */
73
+ const STALE_RUNNING_REAP_ATTRIBUTION = "the host process was interrupted while this agent was running — its in-process state was lost. Check its worktree / output file for partial work before assuming the task landed (stale running row reaped).";
74
+ /** core reap 的 staleRunning 翻转形(逐字段照抄 InMemory,background-agent-store.js:266-272):
75
+ * summary **和 error** 都只在缺席时补共享归因句——error 半边 5.2.0 起就该有,双生此前只写 summary
76
+ * 且是手写旧句(core 5.3.0 新试剂盒首跑两方言一致揪红,[2425] bg-agent B 族同源),真失败文本永不覆写。 */
70
77
  function flippedForm(live, now) {
71
78
  return {
72
79
  ...live,
73
80
  status: "failed",
74
81
  stoppedBy: "system",
75
- summary: live.summary ?? "host process interrupted (stale running row reaped)",
82
+ summary: live.summary ?? STALE_RUNNING_REAP_ATTRIBUTION,
83
+ error: live.error ?? STALE_RUNNING_REAP_ATTRIBUTION,
76
84
  settledAt: now,
77
85
  updatedAt: now,
78
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/server",
3
- "version": "5.4.0",
3
+ "version": "5.5.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",
@@ -54,7 +54,7 @@
54
54
  "build:binary:run-local:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 src/run-local.ts --outfile dist/run-local-darwin-arm64"
55
55
  },
56
56
  "dependencies": {
57
- "@sema-agent/core": "^5.2.0",
57
+ "@sema-agent/core": "^5.3.0",
58
58
  "@sema-agent/registry-core": "^0.13.0",
59
59
  "e2b": "^2.28.0",
60
60
  "libsodium-wrappers": "^0.8.4",