@sema-agent/server 7.148.0 → 7.150.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.
Files changed (360) hide show
  1. package/MIGRATION.md +551 -9
  2. package/README.md +17 -2
  3. package/README.zh-CN.md +5 -1
  4. package/USAGE.md +126 -68
  5. package/dist/adoption/wire.d.ts +3 -3
  6. package/dist/approval-card.d.ts +33 -33
  7. package/dist/approval-gate-currency.d.ts +1 -1
  8. package/dist/approval-leg-origin.d.ts +33 -0
  9. package/dist/approval-leg-origin.js +4 -0
  10. package/dist/audit.d.ts +1 -1
  11. package/dist/audit.js +2 -2
  12. package/dist/auth-bridge.d.ts +9 -1
  13. package/dist/auth-bridge.js +4 -4
  14. package/dist/auth-keys.d.ts +10 -1
  15. package/dist/auth-keys.js +8 -0
  16. package/dist/background-session-reap.d.ts +1 -1
  17. package/dist/boot/deferred-sandbox-path-env.d.ts +5 -3
  18. package/dist/boot/deferred-sandbox-path-env.js +1 -2
  19. package/dist/boot/execution-env.js +10 -11
  20. package/dist/boot/execution-lane.d.ts +6 -4
  21. package/dist/boot/execution-lane.js +3 -1
  22. package/dist/boot/org-delivery.d.ts +3 -2
  23. package/dist/boot/parked-revive-gate.d.ts +5 -5
  24. package/dist/boot/parked-revive-gate.js +2 -3
  25. package/dist/boot/resolve-spec.d.ts +4 -5
  26. package/dist/boot/resolve-spec.js +66 -28
  27. package/dist/boot/retention-lane.d.ts +1 -1
  28. package/dist/boot/runner-deps.js +3 -1
  29. package/dist/boot/session-faces.js +21 -21
  30. package/dist/boot/stage-01-config.d.ts +1 -0
  31. package/dist/boot/stage-01-config.js +4 -3
  32. package/dist/boot/stage-02-web-admin-pull.d.ts +1 -0
  33. package/dist/boot/stage-02-web-admin-pull.js +10 -2
  34. package/dist/boot/stage-03-store-backend.d.ts +1 -0
  35. package/dist/boot/stage-03-store-backend.js +4 -4
  36. package/dist/boot/stage-04-stores.d.ts +1 -0
  37. package/dist/boot/stage-05-execution-env.d.ts +1 -0
  38. package/dist/boot/stage-06-runners.d.ts +2 -1
  39. package/dist/boot/stage-06-runners.js +1 -2
  40. package/dist/boot/stage-07-capability-layer.d.ts +2 -1
  41. package/dist/boot/stage-07-capability-layer.js +1 -1
  42. package/dist/boot/stage-08-reapers.d.ts +2 -1
  43. package/dist/boot/stage-09-leader.d.ts +2 -1
  44. package/dist/boot/stage-10-http-server.d.ts +35 -2
  45. package/dist/boot/stage-10-http-server.js +9 -4
  46. package/dist/boot/stores.d.ts +3 -0
  47. package/dist/boot/stores.js +22 -19
  48. package/dist/boot/web-admin.d.ts +1 -1
  49. package/dist/capabilities/tool-defer.d.ts +1 -1
  50. package/dist/capability-facts.d.ts +70 -60
  51. package/dist/capability-facts.js +45 -49
  52. package/dist/card-settle-stored-scope.d.ts +56 -0
  53. package/dist/card-settle-stored-scope.js +27 -0
  54. package/dist/card-void.d.ts +7 -12
  55. package/dist/card-void.js +2 -7
  56. package/dist/config-catalog.d.ts +12 -0
  57. package/dist/config-catalog.js +37 -33
  58. package/dist/config-invariants.d.ts +5 -4
  59. package/dist/config-invariants.js +4 -4
  60. package/dist/config-types.d.ts +49 -16
  61. package/dist/config.d.ts +6 -5
  62. package/dist/config.js +35 -24
  63. package/dist/context-window-notice.d.ts +31 -0
  64. package/dist/context-window-notice.js +28 -0
  65. package/dist/deployment-governance.d.ts +7 -28
  66. package/dist/deployment-governance.js +1 -14
  67. package/dist/deployment-shape.d.ts +20 -11
  68. package/dist/deployment-shape.js +1 -0
  69. package/dist/device-ws-hub.d.ts +1 -0
  70. package/dist/device-ws-hub.js +64 -28
  71. package/dist/device-ws-protocol.d.ts +20 -6
  72. package/dist/device-ws-protocol.js +9 -2
  73. package/dist/engine-identity.d.ts +7 -1
  74. package/dist/engine-identity.js +5 -0
  75. package/dist/env-name-allowlist-knobs.d.ts +6 -5
  76. package/dist/env-name-allowlist-knobs.js +5 -0
  77. package/dist/execution-lane-caps.d.ts +20 -5
  78. package/dist/execution-lane-caps.js +18 -4
  79. package/dist/field-conflict.d.ts +2 -2
  80. package/dist/fleet/engine-signal.d.ts +14 -1
  81. package/dist/fleet/engine-signal.js +5 -1
  82. package/dist/fleet/fleet-reconciler.d.ts +1 -1
  83. package/dist/fleet/serving-lease.d.ts +18 -3
  84. package/dist/fleet/serving-lease.js +81 -35
  85. package/dist/fleet-client.d.ts +13 -11
  86. package/dist/fleet-client.js +53 -33
  87. package/dist/history-anchor.js +1 -1
  88. package/dist/hitl-delivery.d.ts +1 -3
  89. package/dist/hitl-delivery.js +1 -1
  90. package/dist/hooks/command-spawn.d.ts +7 -2
  91. package/dist/hooks/command-spawn.js +13 -6
  92. package/dist/hooks/hook-runner.d.ts +5 -0
  93. package/dist/hooks/hook-runner.js +11 -7
  94. package/dist/http/active-run-conflict.d.ts +3 -7
  95. package/dist/http/active-run-conflict.js +2 -2
  96. package/dist/http/admission.js +5 -5
  97. package/dist/http/approval-sweeps.js +5 -3
  98. package/dist/http/caller-trust.d.ts +2 -2
  99. package/dist/http/caller-trust.js +3 -3
  100. package/dist/http/checkpoint-ctx.d.ts +18 -63
  101. package/dist/http/checkpoint-ctx.js +1 -24
  102. package/dist/http/claim-heartbeat.d.ts +6 -6
  103. package/dist/http/claim-heartbeat.js +6 -6
  104. package/dist/http/claimed-run.d.ts +16 -9
  105. package/dist/http/claimed-run.js +8 -0
  106. package/dist/http/dispatch.js +7 -5
  107. package/dist/http/durable-run-leg.d.ts +8 -1
  108. package/dist/http/durable-run-leg.js +34 -15
  109. package/dist/http/execution-context.d.ts +115 -14
  110. package/dist/http/execution-context.js +130 -40
  111. package/dist/http/owner-access.d.ts +246 -21
  112. package/dist/http/owner-access.js +186 -8
  113. package/dist/http/principal-gate.d.ts +18 -11
  114. package/dist/http/principal-gate.js +3 -1
  115. package/dist/http/readiness.d.ts +4 -2
  116. package/dist/http/resume-ctx-read.d.ts +14 -3
  117. package/dist/http/resume-ctx-read.js +24 -3
  118. package/dist/http/resume-legs.d.ts +35 -3
  119. package/dist/http/resume-legs.js +262 -106
  120. package/dist/http/route-ctx.d.ts +29 -11
  121. package/dist/http/routes/a2a-serve.js +17 -14
  122. package/dist/http/routes/approvals-assistant.d.ts +3 -2
  123. package/dist/http/routes/approvals-assistant.js +11 -11
  124. package/dist/http/routes/capabilities.js +5 -4
  125. package/dist/http/routes/config-catalog.d.ts +1 -1
  126. package/dist/http/routes/diagnostics.d.ts +3 -1
  127. package/dist/http/routes/diagnostics.js +30 -5
  128. package/dist/http/routes/mcp-reconnect.js +2 -2
  129. package/dist/http/routes/memory-origin.d.ts +1 -1
  130. package/dist/http/routes/notify-wake.js +2 -3
  131. package/dist/http/routes/principal-inbox.d.ts +3 -1
  132. package/dist/http/routes/principal-inbox.js +3 -2
  133. package/dist/http/routes/projects.d.ts +1 -0
  134. package/dist/http/routes/projects.js +5 -3
  135. package/dist/http/routes/retention-ops.d.ts +1 -1
  136. package/dist/http/routes/run-permission-mode.d.ts +1 -1
  137. package/dist/http/routes/run-permission-mode.js +2 -2
  138. package/dist/http/routes/runs.d.ts +1 -1
  139. package/dist/http/routes/runs.js +33 -37
  140. package/dist/http/routes/session-memory-sync.js +4 -5
  141. package/dist/http/routes/session-sync.d.ts +24 -5
  142. package/dist/http/routes/session-sync.js +45 -37
  143. package/dist/http/routes/sessions-list.d.ts +1 -1
  144. package/dist/http/routes/sessions.d.ts +1 -1
  145. package/dist/http/routes/sessions.js +18 -44
  146. package/dist/http/routes/tasks.js +136 -101
  147. package/dist/http/routes/trace-usage.js +14 -14
  148. package/dist/http/routes/workflows.d.ts +1 -0
  149. package/dist/http/routes/workflows.js +20 -38
  150. package/dist/http/server.d.ts +12 -9
  151. package/dist/http/server.js +35 -6
  152. package/dist/http/stored-body-replay.d.ts +3 -24
  153. package/dist/http/stored-body-replay.js +2 -12
  154. package/dist/http/submit-ctx.d.ts +2 -2
  155. package/dist/http/submit-ctx.js +5 -5
  156. package/dist/http/submit-replay.d.ts +15 -2
  157. package/dist/http/submit-replay.js +10 -4
  158. package/dist/http/wire-types.d.ts +6 -3
  159. package/dist/index.d.ts +3 -1
  160. package/dist/index.js +1 -0
  161. package/dist/leader/endpoint.js +9 -8
  162. package/dist/leg-facts.d.ts +13 -2
  163. package/dist/leg-facts.js +2 -0
  164. package/dist/local-store-declaration.d.ts +54 -0
  165. package/dist/local-store-declaration.js +59 -0
  166. package/dist/mcp-assertion-header.d.ts +1 -1
  167. package/dist/mcp-assertion-header.js +1 -1
  168. package/dist/mcp-authorization-face.d.ts +18 -14
  169. package/dist/mcp-authorization-face.js +3 -2
  170. package/dist/memory-project-layer.js +1 -1
  171. package/dist/memory-scope.d.ts +4 -4
  172. package/dist/memory-scope.js +4 -4
  173. package/dist/memory-store-refusal.d.ts +1 -1
  174. package/dist/memory-sync-client.js +2 -2
  175. package/dist/model-context-window.d.ts +50 -11
  176. package/dist/model-context-window.js +20 -1
  177. package/dist/model-entry-refusal.d.ts +5 -4
  178. package/dist/model-entry-refusal.js +17 -3
  179. package/dist/model-reach-scope.d.ts +2 -1
  180. package/dist/observability/corrupt-read-seat.d.ts +1 -1
  181. package/dist/observability/fail-open.d.ts +19 -7
  182. package/dist/observability/fail-open.js +19 -7
  183. package/dist/observability/logger.d.ts +7 -0
  184. package/dist/observability/logger.js +3 -1
  185. package/dist/observability/metrics.js +1 -1
  186. package/dist/observability/run-terminal.d.ts +1 -1
  187. package/dist/observability/run-terminal.js +1 -0
  188. package/dist/observability/secret-env-scrub.d.ts +1 -1
  189. package/dist/observability/secret-env-scrub.js +1 -1
  190. package/dist/org-delivery-gate.d.ts +31 -6
  191. package/dist/org-delivery-gate.js +7 -4
  192. package/dist/owner-faces.d.ts +30 -5
  193. package/dist/owner-faces.js +2 -0
  194. package/dist/park-row-commit.d.ts +67 -0
  195. package/dist/park-row-commit.js +76 -0
  196. package/dist/parked-decide.d.ts +9 -7
  197. package/dist/parked-decide.js +25 -6
  198. package/dist/peer-directory.d.ts +1 -1
  199. package/dist/peer-seat.d.ts +1 -1
  200. package/dist/peer-seat.js +52 -59
  201. package/dist/plugins/adoption-log-sql.d.ts +3 -3
  202. package/dist/plugins/adoption-log-sql.js +19 -19
  203. package/dist/plugins/approval-ask-store-sql.d.ts +1 -1
  204. package/dist/plugins/approval-ask-store-sql.js +3 -5
  205. package/dist/plugins/approval-exemption-skill-cutoff.d.ts +64 -0
  206. package/dist/plugins/approval-exemption-skill-cutoff.js +122 -0
  207. package/dist/plugins/approval-exemption-skill-m46.d.ts +0 -6
  208. package/dist/plugins/approval-exemption-skill-m46.js +6 -10
  209. package/dist/plugins/approval-exemption-store.d.ts +26 -1
  210. package/dist/plugins/approval-exemption-store.js +28 -19
  211. package/dist/plugins/ensure-schema-lock-policy.d.ts +36 -3
  212. package/dist/plugins/ensure-schema-lock-policy.js +75 -9
  213. package/dist/plugins/exec-path-law.d.ts +34 -0
  214. package/dist/plugins/exec-path-law.js +13 -0
  215. package/dist/plugins/file-run-store.d.ts +22 -9
  216. package/dist/plugins/file-run-store.js +51 -23
  217. package/dist/plugins/local-checkpoint-store.d.ts +8 -1
  218. package/dist/plugins/local-checkpoint-store.js +5 -1
  219. package/dist/plugins/local-data-root-admission.d.ts +52 -0
  220. package/dist/plugins/local-data-root-admission.js +100 -0
  221. package/dist/plugins/local-engine-high-water.d.ts +28 -7
  222. package/dist/plugins/local-engine-high-water.js +27 -22
  223. package/dist/plugins/local-session-store.d.ts +134 -49
  224. package/dist/plugins/local-session-store.js +149 -108
  225. package/dist/plugins/memory-run-store.d.ts +14 -9
  226. package/dist/plugins/memory-run-store.js +48 -22
  227. package/dist/plugins/one-time-migration-marker.d.ts +19 -3
  228. package/dist/plugins/one-time-migration-marker.js +7 -1
  229. package/dist/plugins/one-time-migrations.d.ts +110 -59
  230. package/dist/plugins/one-time-migrations.js +224 -136
  231. package/dist/plugins/org-delivery-quota-store.d.ts +34 -11
  232. package/dist/plugins/org-delivery-quota-store.js +29 -14
  233. package/dist/plugins/permission-rule-store-sql.d.ts +1 -1
  234. package/dist/plugins/permission-rule-store-sql.js +5 -9
  235. package/dist/plugins/pg-pool.d.ts +1 -1
  236. package/dist/plugins/pg-pool.js +14 -12
  237. package/dist/plugins/posix-shell-fs.js +4 -2
  238. package/dist/plugins/remote-env-adb.js +3 -2
  239. package/dist/plugins/remote-env-device.d.ts +3 -2
  240. package/dist/plugins/remote-env-device.js +8 -6
  241. package/dist/plugins/remote-env-e2b.d.ts +4 -8
  242. package/dist/plugins/remote-env-e2b.js +21 -15
  243. package/dist/plugins/remote-env-host.d.ts +51 -10
  244. package/dist/plugins/remote-env-host.js +97 -31
  245. package/dist/plugins/remote-env-k8s.js +7 -4
  246. package/dist/plugins/remote-env-local-docker.d.ts +6 -3
  247. package/dist/plugins/remote-env-local-docker.js +11 -25
  248. package/dist/plugins/remote-env-ssh.js +4 -3
  249. package/dist/plugins/remote-shell.d.ts +3 -1
  250. package/dist/plugins/remote-shell.js +3 -3
  251. package/dist/plugins/replica-registration.d.ts +35 -0
  252. package/dist/plugins/replica-registration.js +48 -0
  253. package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
  254. package/dist/plugins/run-store-sql.d.ts +27 -8
  255. package/dist/plugins/run-store-sql.js +46 -18
  256. package/dist/plugins/scenario-prefix-switch-m42.d.ts +8 -12
  257. package/dist/plugins/scenario-prefix-switch-m42.js +9 -6
  258. package/dist/plugins/schema-consistency.d.ts +91 -5
  259. package/dist/plugins/schema-consistency.js +189 -7
  260. package/dist/plugins/schema-drift-sentence.d.ts +6 -5
  261. package/dist/plugins/schema-drift-sentence.js +13 -5
  262. package/dist/plugins/serving-requirement.d.ts +49 -0
  263. package/dist/plugins/serving-requirement.js +53 -0
  264. package/dist/plugins/session-placement.d.ts +5 -4
  265. package/dist/plugins/shell-sentinel-owner-m48.d.ts +22 -0
  266. package/dist/plugins/shell-sentinel-owner-m48.js +6 -0
  267. package/dist/plugins/stop-then-start-sentence.d.ts +55 -0
  268. package/dist/plugins/stop-then-start-sentence.js +51 -0
  269. package/dist/plugins/store-backend.d.ts +23 -9
  270. package/dist/plugins/store-backend.js +58 -24
  271. package/dist/plugins/store-contracts.d.ts +45 -5
  272. package/dist/plugins/store-contracts.js +19 -0
  273. package/dist/plugins/tidb-pool.d.ts +11 -6
  274. package/dist/plugins/tidb-pool.js +22 -12
  275. package/dist/plugins/workspace-custody.d.ts +44 -0
  276. package/dist/plugins/workspace-custody.js +47 -0
  277. package/dist/process-instance.d.ts +3 -0
  278. package/dist/process-instance.js +7 -0
  279. package/dist/project-context.d.ts +66 -0
  280. package/dist/project-context.js +70 -0
  281. package/dist/project-identity.d.ts +8 -7
  282. package/dist/project-identity.js +40 -17
  283. package/dist/project-layer-key.d.ts +13 -2
  284. package/dist/project-layer-key.js +9 -1
  285. package/dist/question.d.ts +9 -21
  286. package/dist/question.js +28 -19
  287. package/dist/read-deny-floor-notice.d.ts +36 -0
  288. package/dist/read-deny-floor-notice.js +40 -0
  289. package/dist/{plain-string-record.d.ts → request-declaration-disposition.d.ts} +9 -23
  290. package/dist/request-declaration-disposition.js +39 -0
  291. package/dist/run-cancel-card.d.ts +28 -0
  292. package/dist/run-cancel-card.js +20 -0
  293. package/dist/run-cancel-context.d.ts +10 -0
  294. package/dist/run-cancel-context.js +1 -0
  295. package/dist/run-local.js +28 -13
  296. package/dist/runs.d.ts +31 -7
  297. package/dist/runs.js +34 -16
  298. package/dist/security.d.ts +3 -3
  299. package/dist/server-secret-env.d.ts +34 -20
  300. package/dist/server-secret-env.js +61 -18
  301. package/dist/session-agent.d.ts +4 -12
  302. package/dist/session-agent.js +0 -6
  303. package/dist/session-children-retire.d.ts +6 -3
  304. package/dist/session-children-retire.js +2 -5
  305. package/dist/session-incarnation.d.ts +18 -4
  306. package/dist/session-incarnation.js +4 -1
  307. package/dist/session-notify-door.d.ts +4 -4
  308. package/dist/session-notify-door.js +5 -6
  309. package/dist/session-rules-seat.d.ts +4 -3
  310. package/dist/session-rules-seat.js +3 -11
  311. package/dist/session-sync.js +3 -3
  312. package/dist/session-workspace.d.ts +3 -3
  313. package/dist/store-admission.d.ts +33 -0
  314. package/dist/store-admission.js +49 -0
  315. package/dist/store-posture.d.ts +5 -0
  316. package/dist/store-posture.js +18 -1
  317. package/dist/stores-sql/checkpoint-store-sql.d.ts +22 -3
  318. package/dist/stores-sql/checkpoint-store-sql.js +109 -23
  319. package/dist/stores-sql/file-history-store-sql.d.ts +1 -1
  320. package/dist/stores-sql/file-history-store-sql.js +3 -5
  321. package/dist/stores-sql/retention-store-sql.d.ts +1 -1
  322. package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
  323. package/dist/stores-sql/tool-result-store-sql.js +4 -6
  324. package/dist/task-a2a.d.ts +3 -8
  325. package/dist/task-a2a.js +25 -27
  326. package/dist/task-cwd.d.ts +27 -10
  327. package/dist/task-cwd.js +3 -0
  328. package/dist/task-mcp.d.ts +3 -3
  329. package/dist/task-mcp.js +1 -1
  330. package/dist/task-settings.d.ts +13 -0
  331. package/dist/task-settings.js +14 -7
  332. package/dist/terminal.d.ts +2 -0
  333. package/dist/terminal.js +21 -6
  334. package/dist/tool-approval.d.ts +50 -41
  335. package/dist/tool-approval.js +96 -73
  336. package/dist/trace/engine-notice-wire.d.ts +38 -21
  337. package/dist/trace/engine-notice-wire.js +25 -4
  338. package/dist/trace/ledger-sink.d.ts +3 -1
  339. package/dist/trace/project.d.ts +8 -5
  340. package/dist/trace/project.js +11 -9
  341. package/dist/trace/projection-table.d.ts +33 -2
  342. package/dist/trace/redact.d.ts +12 -0
  343. package/dist/trace/redact.js +5 -1
  344. package/dist/trace/self-minted-wire.d.ts +268 -56
  345. package/dist/trace/self-minted-wire.js +110 -40
  346. package/dist/trace/tool-card.d.ts +3 -0
  347. package/dist/trace/tool-card.js +24 -0
  348. package/dist/trace/tool-output-media.d.ts +2 -1
  349. package/dist/unattended-permission-mode.d.ts +1 -1
  350. package/dist/web-admin-client/apply-effective.d.ts +1 -1
  351. package/dist/web-admin-client/apply-effective.js +22 -9
  352. package/dist/web-admin-client/effective-keys.d.ts +1 -1
  353. package/dist/web-admin-client/skills-mcp.d.ts +1 -1
  354. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +57 -29
  355. package/docs/error-text-lexicon.json +317 -0
  356. package/package.json +4 -2
  357. package/scripts/embed-minimal.mjs +183 -0
  358. package/wire-changes/server@7.149.0.json +372 -0
  359. package/wire-changes/server@7.150.0.json +335 -0
  360. package/dist/plain-string-record.js +0 -70
@@ -7,8 +7,8 @@ import { centerEntitlementSourceWired } from "./runtime-caps-resolver.js";
7
7
  import { WEB_ADMIN_ENV } from "@sema-agent/settings-schema";
8
8
  import { blobExchangeOf, overwriteWipeIncapable } from "./session-sync.js";
9
9
  import { WORKSPACE_PERSIST_DEFAULT, WORKSPACE_SNAPSHOT_KEEP_DEFAULT, workspaceSnapshotTimeoutOf } from "./workspace-space.js";
10
- import { deletionHeadReadOf, headReadOf } from "./session-incarnation.js";
11
- import { executionLaneCaps, laneWiresExecutionEnv } from "./execution-lane-caps.js";
10
+ import { headReadPresent } from "./session-incarnation.js";
11
+ import { laneWiresExecutionEnv } from "./execution-lane-caps.js";
12
12
  export const CAPABILITY_FACT_WHY = {
13
13
  run_store_absent: "no durable run store is wired (DB_BACKEND=mysql|pg|local)",
14
14
  subagent_registry_absent: "the sub-agent steer registry is not wired",
@@ -95,25 +95,28 @@ export function subagentSteer(d) {
95
95
  const runs = durableRuns(d);
96
96
  if (!runs.available)
97
97
  return runs;
98
- return d.subagentSteerRegistry !== undefined ? yes({ runStore: runs.runStore, registry: d.subagentSteerRegistry }) : no("subagent_registry_absent");
98
+ const registry = d.subagentSteerRegistry;
99
+ return registry !== undefined ? yes({ runStore: runs.runStore, registry }) : no("subagent_registry_absent");
99
100
  }
100
101
  export function subagentOutput(d) {
101
102
  const runs = durableRuns(d);
102
103
  if (!runs.available)
103
104
  return runs;
104
- return d.subagentTaskOutput !== undefined ? yes({ runStore: runs.runStore, output: d.subagentTaskOutput }) : no("subagent_output_face_absent");
105
+ const output = d.subagentTaskOutput;
106
+ return output !== undefined ? yes({ runStore: runs.runStore, output }) : no("subagent_output_face_absent");
105
107
  }
106
108
  export function taskHandles(d) {
107
109
  const runs = durableRuns(d);
108
110
  if (!runs.available)
109
111
  return runs;
110
- return d.taskHandleOutput !== undefined && d.taskHandleStop !== undefined
111
- ? yes({ runStore: runs.runStore, output: d.taskHandleOutput, stop: d.taskHandleStop })
112
+ const { taskHandleOutput: output, taskHandleStop: stop } = d;
113
+ return output !== undefined && stop !== undefined
114
+ ? yes({ runStore: runs.runStore, output, stop })
112
115
  : no("task_handle_faces_absent");
113
116
  }
114
117
  export function sessionOwnership(d) {
115
118
  const s = d.sessionStorage;
116
- return headReadOf(s) !== undefined ? yes({ sessionStorage: s }) : no("session_head_face_absent");
119
+ return headReadPresent(s) ? yes({ sessionStorage: s }) : no("session_head_face_absent");
117
120
  }
118
121
  export function executionPlacementRead(d) {
119
122
  const seat = d.sessionStorage?.executionPlacement;
@@ -141,12 +144,13 @@ export function sessionAuditView(d) {
141
144
  return d.sessionAudit !== undefined ? yes({ sessionAudit: d.sessionAudit }) : no("session_audit_absent");
142
145
  }
143
146
  export function sessionEventStream(d) {
144
- if (d.sessionWatch === undefined)
147
+ const watch = d.sessionWatch;
148
+ if (watch === undefined)
145
149
  return no("session_watch_absent");
146
150
  const owned = sessionOwnership(d);
147
151
  if (!owned.available)
148
152
  return owned;
149
- return yes({ watch: d.sessionWatch, sessionStorage: owned.sessionStorage });
153
+ return yes({ watch, sessionStorage: owned.sessionStorage });
150
154
  }
151
155
  export function sessionList(d) {
152
156
  const lister = d.sessionStorage?.listSessions?.bind(d.sessionStorage);
@@ -156,52 +160,51 @@ export function sessionFork(d) {
156
160
  const s = d.sessionStorage;
157
161
  if (s?.fork === undefined)
158
162
  return no("session_fork_face_absent");
159
- if (headReadOf(s) === undefined)
163
+ if (!headReadPresent(s))
160
164
  return no("session_head_face_absent");
161
165
  return yes({ sessionStorage: s });
162
166
  }
163
167
  export function sessionPatch(d) {
164
168
  const s = d.sessionStorage;
165
- if (headReadOf(s) === undefined || s?.writeSessionRowCells === undefined)
169
+ if (!headReadPresent(s) || s?.writeSessionRowCells === undefined)
166
170
  return no("session_row_faces_absent");
167
171
  return yes({ sessionStorage: s });
168
172
  }
169
173
  export function sessionDelete(d) {
170
- if (d.purgeSession === undefined)
174
+ const purge = d.purgeSession;
175
+ if (purge === undefined)
171
176
  return no("session_purge_absent");
172
177
  const owned = sessionOwnership(d);
173
178
  if (!owned.available)
174
179
  return owned;
175
- const store = owned.sessionStorage;
176
- const headOf = deletionHeadReadOf(store);
177
- if (headOf === undefined)
178
- return no("session_head_face_absent");
179
- const placementOf = store.placementOf?.bind(store);
180
- return yes({ purge: d.purgeSession, gateStore: { headOf, ...(placementOf !== undefined ? { placementOf } : {}) } });
180
+ return yes({ purge, sessionStorage: owned.sessionStorage });
181
181
  }
182
182
  export function sessionPolicy(d) {
183
- if (d.sessionPolicyStore === undefined)
183
+ const policyStore = d.sessionPolicyStore;
184
+ if (policyStore === undefined)
184
185
  return no("session_policy_store_absent");
185
186
  const owned = sessionOwnership(d);
186
187
  if (!owned.available)
187
188
  return owned;
188
- return yes({ policyStore: d.sessionPolicyStore, sessionStorage: owned.sessionStorage });
189
+ return yes({ policyStore, sessionStorage: owned.sessionStorage });
189
190
  }
190
191
  export function sessionSync(d) {
191
- if (d.backend === undefined)
192
+ const { fileHistoryStore: historyStore, sessionPolicyStore } = d;
193
+ const backend = d.backend;
194
+ if (backend === undefined)
192
195
  return no("store_backend_absent");
193
- if (d.fileHistoryStore === undefined)
196
+ if (historyStore === undefined)
194
197
  return no("file_history_store_absent");
195
198
  const s = d.sessionStorage;
196
199
  if (s?.exportEntries === undefined || s.exportEntriesStream === undefined)
197
200
  return no("session_export_absent");
198
201
  if (s.beginImportStaging === undefined)
199
202
  return no("session_import_staging_absent");
200
- if (headReadOf(s) === undefined || s.sessionSummaryOf === undefined || s.writeSessionRowCells === undefined)
203
+ if (!headReadPresent(s) || s.sessionSummaryOf === undefined || s.writeSessionRowCells === undefined)
201
204
  return no("session_row_faces_absent");
202
- if (overwriteWipeIncapable(d.sessionPolicyStore))
205
+ if (overwriteWipeIncapable(sessionPolicyStore))
203
206
  return no("policy_purge_absent");
204
- return yes({ backend: d.backend, sessionStorage: s, historyStore: d.fileHistoryStore });
207
+ return yes({ backend, sessionStorage: s, historyStore });
205
208
  }
206
209
  export function sessionSyncFileHistory(d) {
207
210
  const sync = sessionSync(d);
@@ -211,20 +214,22 @@ export function sessionSyncFileHistory(d) {
211
214
  return blobExchange !== undefined ? yes({ historyStore: sync.historyStore, blobExchange }) : no("blob_exchange_absent");
212
215
  }
213
216
  export function sessionRewindFiles(d) {
214
- if (d.fileHistoryStore === undefined)
217
+ const { fileHistoryStore: historyStore, resumeAnchorStore: anchors, config, backend } = d;
218
+ if (historyStore === undefined)
215
219
  return no("file_history_store_absent");
216
220
  const owned = sessionOwnership(d);
217
221
  if (!owned.available)
218
222
  return owned;
219
- if (d.resumeAnchorStore === undefined || d.runStore === undefined)
223
+ const runs = durableRuns(d);
224
+ if (anchors === undefined || !runs.available)
220
225
  return no("resume_anchor_store_absent");
221
- if (!laneWiresExecutionEnv(d.config.remoteExec.provider))
226
+ if (!laneWiresExecutionEnv(config.remoteExec.provider))
222
227
  return no("execution_lane_handless");
223
- if (!DEPLOYMENT_SHAPE_PREDICATES.rewindableWorkspace.holds(d.config))
228
+ if (!DEPLOYMENT_SHAPE_PREDICATES.rewindableWorkspace.holds(config))
224
229
  return no("workspace_rebuilt_per_task");
225
- if (d.backend?.kind !== "local")
230
+ if (backend?.kind !== "local")
226
231
  return no("session_store_shared");
227
- return yes({ historyStore: d.fileHistoryStore, anchors: { anchors: d.resumeAnchorStore, runs: d.runStore }, sessionStorage: owned.sessionStorage });
232
+ return yes({ historyStore, anchors: { anchors, runs: runs.runStore }, sessionStorage: owned.sessionStorage });
228
233
  }
229
234
  export function sessionRewindFilesPreview(d) {
230
235
  const rewind = sessionRewindFiles(d);
@@ -294,14 +299,15 @@ export function deviceManagement(d) {
294
299
  const lane = deviceLane(d);
295
300
  if (!lane.available)
296
301
  return lane;
297
- if (d.deviceStore === undefined)
302
+ const { deviceStore: store, deviceEnrollment: enrollment } = d;
303
+ if (store === undefined)
298
304
  return no("device_store_absent");
299
- if (d.deviceEnrollment === undefined)
305
+ if (enrollment === undefined)
300
306
  return no("device_enrollment_absent");
301
307
  const runs = durableRuns(d);
302
308
  if (!runs.available)
303
309
  return runs;
304
- return yes({ hub: lane.hub, store: d.deviceStore, enrollment: d.deviceEnrollment, runStore: runs.runStore });
310
+ return yes({ hub: lane.hub, store, enrollment, runStore: runs.runStore });
305
311
  }
306
312
  export function fleetStream(d) {
307
313
  return d.fleetBus !== undefined ? yes({ fleetBus: d.fleetBus }) : no("fleet_bus_absent");
@@ -341,7 +347,8 @@ export function memorySyncServe(d) {
341
347
  return identity !== undefined ? yes({ perform: d.memorySync, identity }) : no("memory_sync_identity_undeclared");
342
348
  }
343
349
  export function sessionMemorySync(d) {
344
- if (d.memorySyncLeg === undefined)
350
+ const leg = d.memorySyncLeg;
351
+ if (leg === undefined)
345
352
  return no("memory_sync_leg_absent");
346
353
  const runs = durableRuns(d);
347
354
  if (!runs.available)
@@ -349,7 +356,7 @@ export function sessionMemorySync(d) {
349
356
  const owned = sessionOwnership(d);
350
357
  if (!owned.available)
351
358
  return owned;
352
- return yes({ leg: d.memorySyncLeg, runStore: runs.runStore, sessionStorage: owned.sessionStorage });
359
+ return yes({ leg, runStore: runs.runStore, sessionStorage: owned.sessionStorage });
353
360
  }
354
361
  export function principalInboxDelivery(d) {
355
362
  return d.orgDeliveryGate !== undefined ? yes({ gate: d.orgDeliveryGate }) : no("org_delivery_gate_absent");
@@ -503,19 +510,8 @@ export function hostScheduler(c) {
503
510
  export function autoBackgroundOnTimeout(c, hostBackgroundShellOn) {
504
511
  if (c.autoBackgroundOnTimeout !== true)
505
512
  return no("auto_background_off");
506
- const cap = executionLaneCaps(c.remoteExec.provider).backgroundShell;
507
- switch (cap) {
508
- case "unsupported":
509
- return no("lane_cannot_adopt_running_command");
510
- case "supported":
511
- return YES;
512
- case "single-user-only":
513
- return c.requirePrincipal !== true && hostBackgroundShellOn ? YES : no("lane_cannot_adopt_running_command");
514
- default: {
515
- const unknownCap = cap;
516
- throw new Error(`auto-background fact: unknown lane capability ${String(unknownCap)}`);
517
- }
518
- }
513
+ const laneCanAdopt = DEPLOYMENT_SHAPE_PREDICATES.backgroundShell.holds(c) && (c.remoteExec.provider !== "host" || hostBackgroundShellOn);
514
+ return laneCanAdopt ? YES : no("lane_cannot_adopt_running_command");
519
515
  }
520
516
  export const AUTO_BACKGROUND_ON_TIMEOUT_WORDS = ["armed", "off", "unsupported"];
521
517
  export function autoBackgroundOnTimeoutWord(f) {
@@ -0,0 +1,56 @@
1
+ /**
2
+ * **按令牌把一张 pending 卡 CAS expire —— 全仓唯一的读法**(状态读 `get` 交出的行状态,属主格读店的列,CAS 吃那一格)。六个读者同读这一只,没有第二份:
3
+ * · `POST /v1/runs/:id/cancel` 的停驻取消腿(`routes/runs.ts` 的 `cancelSuspended`);
4
+ * · 一条续跑腿被取消之后结算它续的那张卡(`resume-legs.ts` 的 `settleCardForCancel`);
5
+ * · 审批 SLA 拒扫腿对「准入策略挡住」的续跑当场过期该卡(`http/approval-sweeps.ts` 的 `expirePolicyBlockedCard`);
6
+ * · 会话删除 / 显式结清口带走停驻子代时作废它的卡(`session-children-retire.ts` 的 `expireParkedCard`);
7
+ * · 停驻写没落定就以失败收场时作废手里那张卡(`card-void.ts` 的 `voidPendingCard`);
8
+ * · 复活不了的停驻子代被 deny 时作废它的卡(`parked-decide.ts` 的 `voidUnrevivableCard`)。
9
+ *
10
+ * ## 规则一条:顺序恒为「先读状态、(要求归属就)再核归属、最后按存储列 expire」,不读行体里的属主格
11
+ * 一张停驻卡的事实在店里有两份:列(令牌、归属 run 的会话、门型、属主格 `scope` —— 引擎停驻时盖下,身份迁移时与行体里那一份一起迁)与行体(`checkpoint` 里的 JSON 快照)。
12
+ * `expire` 的 CAS 谓词吃的是列;拿行体里自带的那一份去配,行体与列不一致(手改 / 外来写者 / 迁移两腿之间)时只会把「列好体坏」说成「被并发决议了」,行体读不成检查点时更是读行体就抛。
13
+ * 1. **状态**:卡已不在待决面(已结 / 已不在)⇒ 不写 —— 已结的卡上 CAS 恒输,写一次只是多一次店写(店写口故障时那一次还会抛,把「本来什么都不用做」的收场变成失败)。
14
+ * 状态读 `get` 交出的行状态(状态列权威,不是行体快照里那一份);**读不成检查点的行体**({@link UnreadableCheckpointRowError})读不出状态 ⇒ 不替 CAS 判(「不知道」不当作「已结」),
15
+ * 下一步吃列的 CAS 自己判;其余读故障(连库 / 超时 / 程序错)原样上抛,店的故障不是答案。
16
+ * 2. **归属**(调用方要求时):卡的归属会话(`hostSessionOfCard`,列)必须就是调用方说的那只 —— 只作废**这一张**;读不出 / 对不上 ⇒ `host_mismatch`,不写。状态在归属之前:已结的卡不因归属对不上而报警。
17
+ * 3. **属主格**:`peekScopeByToken`(SQL = `scope` 列,local = 账本行),`null` 是店契约里的匿名值,按契约换成公共哨兵(两只真店的属主列非空,到不了这一臂)。
18
+ * 找「取消动词会结算哪一张卡」是取消口自己的事(`run-cancel-card.ts`);本模块只管拿到令牌之后怎么结算。
19
+ */
20
+ import type { CheckpointToken } from "@sema-agent/core";
21
+ import type { CheckpointStoreFull } from "./plugins/store-backend.js";
22
+ /** 「这张卡此刻的状态」那一问要的店口(只读 `get` 交出的行状态;结构型 —— 真店的 `get` 直接对上)。 */
23
+ export interface CardStatusPort {
24
+ get(token: CheckpointToken): Promise<{
25
+ readonly status?: string;
26
+ } | null>;
27
+ }
28
+ /** 结算一张卡要的店口:状态 + 属主格(店的列)+ CAS expire。六个读者的依赖型都从这一份取,不各自另写一份 `Pick`。 */
29
+ export type CardSettlePort = CardStatusPort & Pick<CheckpointStoreFull, "peekScopeByToken" | "expire">;
30
+ /** 要求归属时多要的一口:卡归在哪只会话上(归属列)。 */
31
+ export type CardHostPort = Pick<CheckpointStoreFull, "hostSessionOfCard">;
32
+ /**
33
+ * 结算的结局(店的事实,不嗅文案):
34
+ * · `expired` —— 本调用亲手把一张 pending 的卡 expire 了;
35
+ * · `not_pending` —— 卡已不在待决面(已结 / 已不在),没写;
36
+ * · `lost` —— 读状态时还 pending、CAS 输给了并发的结算(决定 / 收割 / 别的作废者);
37
+ * · `host_mismatch` —— 调用方要求的归属对不上(或说不出),没写。
38
+ */
39
+ export declare const CARD_EXPIRE_OUTCOME: {
40
+ readonly expired: "expired";
41
+ readonly notPending: "not_pending";
42
+ readonly lost: "lost";
43
+ readonly hostMismatch: "host_mismatch";
44
+ };
45
+ export type CardExpireOutcome = (typeof CARD_EXPIRE_OUTCOME)[keyof typeof CARD_EXPIRE_OUTCOME];
46
+ /** 调用方要求:这张卡必须归在 `hostSession` 这只会话上(`undefined` = 调用方说不出自己的会话 ⇒ 恒对不上)。 */
47
+ export interface CardHostGuard {
48
+ readonly hostSession: string | undefined;
49
+ }
50
+ /**
51
+ * 按店里的属主格把 `token` 那张卡 CAS expire(≈ deny 的 reaper 终局;不是 resolve —— 取消意味着 run 死掉,deny-RESUME 会把拒绝喂回模型烧 token),次序见模块头注。
52
+ * 要求归属就给 `guard`(店口多带 {@link CardHostPort});不给 ⇒ 不核归属(令牌是调用方按列找来的,如取消口的 `runCancelCardOf`)。
53
+ */
54
+ export declare function expireCardUnderStoredScope(cs: CardSettlePort, token: CheckpointToken): Promise<CardExpireOutcome>;
55
+ export declare function expireCardUnderStoredScope(cs: CardSettlePort & CardHostPort, token: CheckpointToken, guard: CardHostGuard): Promise<CardExpireOutcome>;
56
+ //# sourceMappingURL=card-settle-stored-scope.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { UnreadableCheckpointRowError } from "./plugins/checkpoint-store-face.js";
2
+ import { CHECKPOINT_PUBLIC_SCOPE } from "./security.js";
3
+ export const CARD_EXPIRE_OUTCOME = { expired: "expired", notPending: "not_pending", lost: "lost", hostMismatch: "host_mismatch" };
4
+ async function cardLeftPending(cs, token) {
5
+ try {
6
+ const live = await cs.get(token);
7
+ return live === null || live.status !== "pending";
8
+ }
9
+ catch (e) {
10
+ if (e instanceof UnreadableCheckpointRowError)
11
+ return false;
12
+ throw e;
13
+ }
14
+ }
15
+ export async function expireCardUnderStoredScope(cs, token, guard) {
16
+ if (await cardLeftPending(cs, token))
17
+ return CARD_EXPIRE_OUTCOME.notPending;
18
+ if (guard !== undefined) {
19
+ if (guard.hostSession === undefined || cs.hostSessionOfCard === undefined || (await cs.hostSessionOfCard(token)) !== guard.hostSession)
20
+ return CARD_EXPIRE_OUTCOME.hostMismatch;
21
+ }
22
+ const scope = await cs.peekScopeByToken(token);
23
+ if (scope === undefined)
24
+ return CARD_EXPIRE_OUTCOME.notPending;
25
+ return (await cs.expire(token, scope ?? CHECKPOINT_PUBLIC_SCOPE)) ? CARD_EXPIRE_OUTCOME.expired : CARD_EXPIRE_OUTCOME.lost;
26
+ }
27
+ //# sourceMappingURL=card-settle-stored-scope.js.map
@@ -1,6 +1,7 @@
1
1
  /**
2
- * **结算时作废一张归本 run 会话的、本服务兑现不了的卡** —— 读卡 → 卡仍 pending ∧ 卡归调用方说的那只会话(归属列,`hostSessionOf`)⇒
3
- * 按卡**自己的** scope 走 checkpoint 店的 `expire`(与引擎的本进程仲裁器、续跑的 resolve 同一只 CAS,恰一个赢家)。不新增任何持久态。
2
+ * **结算时作废一张归本 run 会话的、本服务兑现不了的卡** —— 卡仍 pending ∧ 卡归调用方说的那只会话(归属列,`hostSessionOfCard`)⇒
3
+ * 按店里该卡的属主格走 checkpoint 店的 `expire`(全仓唯一的读法 {@link expireCardUnderStoredScope}:先读状态、再核归属、最后按属主列 CAS;与引擎的本进程仲裁器、续跑的 resolve 同一只 CAS,恰一个赢家)。
4
+ * 不新增任何持久态。
4
5
  *
5
6
  * 规则只有一条:**本服务兑现不了的卡不留在待决面上**。产地 = 停驻没落定就以失败收场的腿(`runs.ts` 的 `voidHeldParkCard`:后台腿与
6
7
  * 续跑腿):卡在本 run 的会话上,但兑现它的那条 run 已经 `failed`、认领已放 —— 卡的命运先于认领释放(调用方先调本动词、再放认领)。
@@ -8,20 +9,14 @@
8
9
  * `verifier-pause-card.ts`);那只动词只收验证器的卡,本 run 自己会话上的卡按引擎的读法仍走店级 `expire`。
9
10
  *
10
11
  * 不抛:作废没做成(店读 / 作废抛错、卡的会话对不上、没接店)⇒ 卡回到「留在待决面上、由审批兜底收割收走」的形,按产地登记的 tag
11
- * 响亮留痕(计数 + 探针行 + 一次 warn),结算照常往下走。卡已不 pending / 已不在 ⇒ 什么都不做(CAS 输给了别的结算者,结局相同)。
12
+ * 响亮留痕(计数 + 探针行 + 一次 warn),结算照常往下走。卡已不 pending / 已不在 ⇒ 什么都不做(别的结算者先收走了,结局相同;先于归属判,已结的卡不因归属对不上而报警)。
12
13
  * 店级 `expire` 只作废卡,不动引擎在停驻时给这只会话打的钉(钉在续跑终局 / 续跑失败臂放)。
13
14
  */
14
15
  import type { CheckpointToken } from "@sema-agent/core";
15
16
  import { type FailOpenTag } from "./observability/fail-open.js";
16
- /** 结算点手里那只 checkpoint 店的三个动词:读卡(取它自己的 scope / 状态)、读它归在哪只会话上 → 按卡自己的 scope CAS 作废。 */
17
- export interface CardVoidPort {
18
- get(token: CheckpointToken): Promise<{
19
- readonly scope?: string;
20
- readonly status?: string;
21
- } | null>;
22
- hostSessionOfCard(token: CheckpointToken): Promise<string | null | undefined>;
23
- expire(token: CheckpointToken, scope: string): Promise<boolean>;
24
- }
17
+ import { type CardHostPort, type CardSettlePort } from "./card-settle-stored-scope.js";
18
+ /** 结算点手里那只 checkpoint 店的动词:读卡的状态、读它归在哪只会话上(归属列)、读它的属主格(属主列)→ 按那一格 CAS 作废。 */
19
+ export type CardVoidPort = CardSettlePort & CardHostPort;
25
20
  /** 要作废的那一张:停驻带回的凭据 + 它应归的会话(本 run 的会话;对不上就不动它 —— 只作废**这一张**)。 */
26
21
  export interface CardRef {
27
22
  readonly token: CheckpointToken;
package/dist/card-void.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { errorText } from "./observability/err-text.js";
2
2
  import { recordFailOpen } from "./observability/fail-open.js";
3
+ import { CARD_EXPIRE_OUTCOME, expireCardUnderStoredScope } from "./card-settle-stored-scope.js";
3
4
  export async function voidPendingCard(card, cards, tag, at) {
4
5
  const miss = (reason, err) => recordFailOpen(tag, `reason=${reason}${at === undefined ? "" : ` ${at}`}${err === undefined ? "" : ` err=${err}`}`);
5
6
  if (cards === undefined) {
@@ -7,14 +8,8 @@ export async function voidPendingCard(card, cards, tag, at) {
7
8
  return;
8
9
  }
9
10
  try {
10
- const live = await cards.get(card.token);
11
- if (live === null || live.status !== "pending")
12
- return;
13
- if (card.sessionId === undefined || (await cards.hostSessionOfCard(card.token)) !== card.sessionId || typeof live.scope !== "string") {
11
+ if ((await expireCardUnderStoredScope(cards, card.token, { hostSession: card.sessionId })) === CARD_EXPIRE_OUTCOME.hostMismatch)
14
12
  miss("card_mismatch");
15
- return;
16
- }
17
- await cards.expire(card.token, live.scope);
18
13
  }
19
14
  catch (e) {
20
15
  miss("store_error", errorText(e));
@@ -18,6 +18,16 @@ export type CatalogDangerAxis = (typeof CATALOG_DANGER_AXES)[number];
18
18
  */
19
19
  export declare const URL_CREDENTIAL_POLICIES: readonly ["refuse", "mask"];
20
20
  export type UrlCredentialPolicy = (typeof URL_CREDENTIAL_POLICIES)[number];
21
+ /**
22
+ * secret 行的值**装着几枚凭据、按什么读出来**(闭集;只在 `type: "secret"` 的行上,其余行恒缺席)—— 本服务凭据的颗粒按本服务读这只变量的那一只解析器定:
23
+ * · `whole` —— 整值是一枚(令牌 / 口令 / 私钥 / 一只模型密钥;名单型旋钮的原文也按凭据类整值对待);
24
+ * · `token-table` —— `tok=system` 逗号表,每个 `tok` 是一枚(`SERVICE_AUTH_TOKENS`;读法 = `auth-keys.ts` `parseServiceAuthTokens`,`loadConfig` 同读);
25
+ * · `key-set` —— `{kid,key,status}` JSON 数组,每个 `key` 是一枚(`APPROVAL_HMAC_KEYS`;读法 = `auth-keys.ts` `parseApprovalHmacKeys`,`loadConfig` 同读)。
26
+ * 读者只有一个:自有凭据声明的值臂(`server-secret-env.ts`)—— 整值总在内,列表形另把每一枚交给引擎 ⇒ 一枚令牌换了个变量名放着,与原变量同扣。
27
+ * 词加一个而读者不补 ⇒ 编译红(读者是穷举 switch);secret 行不写 ⇒ 编译红(`r()` 的 secret 重载要它)。不上 wire。
28
+ */
29
+ export declare const SECRET_CREDENTIAL_FORMS: readonly ["whole", "token-table", "key-set"];
30
+ export type SecretCredentialForm = (typeof SECRET_CREDENTIAL_FORMS)[number];
21
31
  /** 域 = 配置九组(类型锁步:组集变了这里跟着红)。 */
22
32
  export type CatalogDomain = keyof ServiceConfigGroups;
23
33
  export declare const CATALOG_RESTART_SLICES: readonly RestartSlice[];
@@ -93,6 +103,8 @@ export interface ConfigCatalogSpec {
93
103
  readonly scope?: "bootstrap-only";
94
104
  /** url 行的凭据处置披露({@link UrlCredentialPolicy});url 行必填(`r()` 的 url 重载要它,缺 ⇒ 编译红),其余行写不进来。 */
95
105
  readonly credentialPolicy?: UrlCredentialPolicy;
106
+ /** secret 行的凭据颗粒({@link SecretCredentialForm});secret 行必填(`r()` 的 secret 重载要它,缺 ⇒ 编译红),其余行写不进来。 */
107
+ readonly credentialForm?: SecretCredentialForm;
96
108
  }
97
109
  export interface ConfigCatalogRowCenter {
98
110
  readonly domain: string;