@sema-agent/server 7.150.0 → 7.152.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 (514) hide show
  1. package/MIGRATION.md +451 -0
  2. package/README.md +15 -3
  3. package/README.zh-CN.md +10 -2
  4. package/USAGE.md +144 -87
  5. package/deploy/sema-up/README.md +11 -4
  6. package/deploy/sema-up/chart/Chart.yaml +1 -1
  7. package/deploy/sema-up/chart/templates/NOTES.txt +5 -0
  8. package/deploy/sema-up/chart/templates/_helpers.tpl +15 -16
  9. package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -3
  10. package/deploy/sema-up/chart/templates/server.yaml +5 -3
  11. package/deploy/sema-up/chart/values-full-single.yaml +3 -1
  12. package/deploy/sema-up/chart/values.yaml +8 -1
  13. package/deploy/sema-up/cluster-up.sh +7 -6
  14. package/deploy/sema-up/kube-up.sh +6 -6
  15. package/deploy/sema-up/lib/flagshape.sh +36 -8
  16. package/deploy/sema-up/lib/helm-values-cluster.py +2 -0
  17. package/deploy/sema-up/lib/helm-values-kube.py +2 -0
  18. package/deploy/sema-up/machines.example.yaml +3 -1
  19. package/deploy/sema-up/sema-up.sh +22 -16
  20. package/dist/adoption/import.js +3 -3
  21. package/dist/approval-ask-audit-store.d.ts +1 -1
  22. package/dist/approval-ask-machine.d.ts +4 -10
  23. package/dist/approval-ask-retention.d.ts +1 -1
  24. package/dist/approval-card.d.ts +12 -14
  25. package/dist/approval-gate-currency.d.ts +9 -9
  26. package/dist/approval-gate-currency.js +3 -4
  27. package/dist/approval-hmac.d.ts +17 -1
  28. package/dist/approval-hmac.js +7 -1
  29. package/dist/approval-queue-kind.d.ts +1 -1
  30. package/dist/approval.d.ts +2 -2
  31. package/dist/approval.js +2 -2
  32. package/dist/auth-bridge.d.ts +20 -0
  33. package/dist/auth-bridge.js +9 -0
  34. package/dist/background-session-reap.d.ts +1 -1
  35. package/dist/bake-runner/main.d.ts +4 -2
  36. package/dist/bind-host.d.ts +3 -6
  37. package/dist/bind-host.js +4 -7
  38. package/dist/boot/budget-tracing.js +1 -1
  39. package/dist/boot/coordinators.d.ts +1 -1
  40. package/dist/boot/coordinators.js +9 -10
  41. package/dist/boot/device-lane.js +2 -0
  42. package/dist/boot/engine-lease.d.ts +5 -0
  43. package/dist/boot/engine-lease.js +1 -0
  44. package/dist/boot/execution-env.d.ts +9 -14
  45. package/dist/boot/execution-env.js +85 -22
  46. package/dist/boot/execution-lane.js +32 -5
  47. package/dist/boot/late-binds.d.ts +8 -4
  48. package/dist/boot/late-binds.js +7 -1
  49. package/dist/boot/leader.d.ts +31 -30
  50. package/dist/boot/leader.js +38 -28
  51. package/dist/boot/leg-path-adjudication.d.ts +40 -0
  52. package/dist/boot/leg-path-adjudication.js +18 -0
  53. package/dist/boot/memory-consolidation.d.ts +3 -2
  54. package/dist/boot/memory-consolidation.js +6 -6
  55. package/dist/boot/parked-revive-gate.js +3 -15
  56. package/dist/boot/reapers.d.ts +6 -1
  57. package/dist/boot/reapers.js +13 -2
  58. package/dist/boot/resolve-spec.d.ts +3 -3
  59. package/dist/boot/resolve-spec.js +43 -48
  60. package/dist/boot/runner-deps.d.ts +46 -35
  61. package/dist/boot/runner-deps.js +94 -91
  62. package/dist/boot/session-age-out.d.ts +36 -0
  63. package/dist/boot/session-age-out.js +101 -0
  64. package/dist/boot/session-faces.d.ts +5 -14
  65. package/dist/boot/session-faces.js +9 -5
  66. package/dist/boot/shutdown.d.ts +6 -0
  67. package/dist/boot/shutdown.js +10 -4
  68. package/dist/boot/stage-01-config.js +2 -0
  69. package/dist/boot/stage-02-web-admin-pull.js +4 -5
  70. package/dist/boot/stage-05-execution-env.d.ts +5 -3
  71. package/dist/boot/stage-05-execution-env.js +3 -2
  72. package/dist/boot/stage-06-runners.d.ts +9 -4
  73. package/dist/boot/stage-06-runners.js +24 -9
  74. package/dist/boot/stage-07-capability-layer.d.ts +8 -4
  75. package/dist/boot/stage-07-capability-layer.js +3 -2
  76. package/dist/boot/stage-08-reapers.d.ts +8 -4
  77. package/dist/boot/stage-08-reapers.js +4 -2
  78. package/dist/boot/stage-09-leader.d.ts +12 -5
  79. package/dist/boot/stage-09-leader.js +14 -5
  80. package/dist/boot/stage-10-http-server.d.ts +19 -5
  81. package/dist/boot/stage-10-http-server.js +14 -21
  82. package/dist/boot/stores.js +7 -4
  83. package/dist/boot/web-admin.js +5 -8
  84. package/dist/boot/workflow-orchestration.d.ts +7 -2
  85. package/dist/boot/workflow-orchestration.js +24 -7
  86. package/dist/bounded-rotation.d.ts +29 -0
  87. package/dist/bounded-rotation.js +24 -0
  88. package/dist/capabilities/approvals-push.d.ts +3 -3
  89. package/dist/capabilities/scenarios.d.ts +28 -13
  90. package/dist/capabilities/scenarios.js +2 -2
  91. package/dist/capability-facts.d.ts +43 -32
  92. package/dist/capability-facts.js +45 -51
  93. package/dist/card-rule-offers.d.ts +32 -0
  94. package/dist/card-rule-offers.js +130 -0
  95. package/dist/center-credential.d.ts +25 -6
  96. package/dist/center-credential.js +25 -5
  97. package/dist/config-catalog.d.ts +26 -7
  98. package/dist/config-catalog.js +26 -22
  99. package/dist/config-dir-trust.js +4 -2
  100. package/dist/config-invariants.d.ts +20 -8
  101. package/dist/config-invariants.js +55 -12
  102. package/dist/config-lkg.d.ts +5 -19
  103. package/dist/config-lkg.js +8 -62
  104. package/dist/config-provider.d.ts +1 -1
  105. package/dist/config-root-migration.d.ts +2 -2
  106. package/dist/config-types.d.ts +38 -42
  107. package/dist/config.d.ts +58 -7
  108. package/dist/config.js +90 -40
  109. package/dist/control-socket.d.ts +51 -0
  110. package/dist/control-socket.js +115 -0
  111. package/dist/deployment-governance.d.ts +2 -1
  112. package/dist/deployment-shape.d.ts +9 -1
  113. package/dist/deployment-shape.js +2 -1
  114. package/dist/device-protocol.d.ts +5 -4
  115. package/dist/device-protocol.js +1 -1
  116. package/dist/device-ws-hub.d.ts +7 -0
  117. package/dist/device-ws-hub.js +10 -3
  118. package/dist/device-ws-protocol.d.ts +63 -10
  119. package/dist/device-ws-protocol.js +56 -25
  120. package/dist/elicitation.js +2 -2
  121. package/dist/engine-identity.d.ts +19 -7
  122. package/dist/engine-identity.js +10 -2
  123. package/dist/entry-mode-clamp-notice.d.ts +2 -1
  124. package/dist/entry-problems.d.ts +40 -3
  125. package/dist/entry-problems.js +3 -1
  126. package/dist/execution-env-refusal.d.ts +29 -0
  127. package/dist/execution-env-refusal.js +8 -0
  128. package/dist/execution-lane-caps.d.ts +3 -1
  129. package/dist/field-conflict.d.ts +1 -1
  130. package/dist/file-history-capture.d.ts +11 -4
  131. package/dist/file-history-capture.js +9 -6
  132. package/dist/file-history-disclosure.d.ts +7 -5
  133. package/dist/file-history-disclosure.js +7 -5
  134. package/dist/fleet/drain-entry.d.ts +4 -0
  135. package/dist/fleet/engine-signal.d.ts +12 -29
  136. package/dist/fleet/engine-signal.js +1 -7
  137. package/dist/fleet-client.js +2 -5
  138. package/dist/gate-settlement.d.ts +1 -8
  139. package/dist/gate-settlement.js +0 -4
  140. package/dist/history-anchor.js +1 -1
  141. package/dist/hitl-delivery.d.ts +2 -3
  142. package/dist/hitl-delivery.js +0 -2
  143. package/dist/hooks/hook-llm.js +4 -2
  144. package/dist/hooks/hook-runner.d.ts +3 -2
  145. package/dist/hooks/hook-runner.js +18 -3
  146. package/dist/host-decision.d.ts +11 -11
  147. package/dist/host-lsp-manager.d.ts +2 -2
  148. package/dist/http/active-run-conflict.d.ts +35 -2
  149. package/dist/http/active-run-conflict.js +48 -19
  150. package/dist/http/admission.js +17 -2
  151. package/dist/http/approval-sweeps.d.ts +1 -1
  152. package/dist/http/approval-sweeps.js +10 -7
  153. package/dist/http/checkpoint-ctx.d.ts +4 -0
  154. package/dist/http/checkpoint-ctx.js +2 -0
  155. package/dist/http/dispatch.d.ts +8 -3
  156. package/dist/http/dispatch.js +59 -32
  157. package/dist/http/durable-run-leg.js +16 -17
  158. package/dist/http/health-reader.d.ts +16 -9
  159. package/dist/http/health-reader.js +2 -1
  160. package/dist/http/health-self-report.d.ts +9 -1
  161. package/dist/http/health-self-report.js +3 -1
  162. package/dist/http/owner-access.d.ts +33 -14
  163. package/dist/http/owner-access.js +40 -10
  164. package/dist/http/principal-gate.d.ts +49 -21
  165. package/dist/http/principal-gate.js +61 -11
  166. package/dist/http/request-channel.d.ts +23 -0
  167. package/dist/http/request-channel.js +9 -0
  168. package/dist/http/request-guards.js +17 -2
  169. package/dist/http/resume-ctx-read.js +42 -3
  170. package/dist/http/resume-legs.d.ts +4 -3
  171. package/dist/http/resume-legs.js +367 -117
  172. package/dist/http/route-ctx.d.ts +91 -15
  173. package/dist/http/route-ctx.js +17 -0
  174. package/dist/http/route-table.d.ts +5 -1
  175. package/dist/http/route-table.js +4 -0
  176. package/dist/http/routes/admin-config-refresh.js +3 -3
  177. package/dist/http/routes/admin-drain.d.ts +3 -0
  178. package/dist/http/routes/admin-drain.js +7 -7
  179. package/dist/http/routes/admin-memory-optout.d.ts +1 -1
  180. package/dist/http/routes/admin-memory-optout.js +3 -3
  181. package/dist/http/routes/adoption.js +3 -5
  182. package/dist/http/routes/agents-roster.js +2 -3
  183. package/dist/http/routes/approvals-assistant.d.ts +2 -1
  184. package/dist/http/routes/approvals-assistant.js +99 -51
  185. package/dist/http/routes/background.d.ts +3 -3
  186. package/dist/http/routes/capabilities.d.ts +4 -0
  187. package/dist/http/routes/capabilities.js +38 -10
  188. package/dist/http/routes/config-catalog.js +2 -2
  189. package/dist/http/routes/devices.js +1 -1
  190. package/dist/http/routes/diagnostics.d.ts +3 -3
  191. package/dist/http/routes/diagnostics.js +19 -7
  192. package/dist/http/routes/fleet.js +10 -8
  193. package/dist/http/routes/images.js +10 -10
  194. package/dist/http/routes/memory-bundle.js +3 -3
  195. package/dist/http/routes/memory-compliance.js +3 -3
  196. package/dist/http/routes/memory-consolidation.js +2 -2
  197. package/dist/http/routes/memory-origin.js +3 -3
  198. package/dist/http/routes/memory-policy.js +2 -2
  199. package/dist/http/routes/observability.js +3 -3
  200. package/dist/http/routes/projects.d.ts +3 -2
  201. package/dist/http/routes/projects.js +4 -5
  202. package/dist/http/routes/retention-ops.js +3 -3
  203. package/dist/http/routes/rules.js +5 -5
  204. package/dist/http/routes/run-permission-mode.d.ts +2 -1
  205. package/dist/http/routes/run-permission-mode.js +2 -2
  206. package/dist/http/routes/runs.d.ts +4 -9
  207. package/dist/http/routes/runs.js +171 -65
  208. package/dist/http/routes/session-sync.d.ts +22 -9
  209. package/dist/http/routes/session-sync.js +204 -107
  210. package/dist/http/routes/sessions-list.js +13 -7
  211. package/dist/http/routes/sessions.js +30 -15
  212. package/dist/http/routes/tasks.js +46 -41
  213. package/dist/http/routes/trace-usage.js +2 -2
  214. package/dist/http/routes/workflows.js +1 -1
  215. package/dist/http/server.d.ts +30 -30
  216. package/dist/http/server.js +16 -4
  217. package/dist/http/submit-ctx.d.ts +1 -1
  218. package/dist/http/submit-ctx.js +7 -4
  219. package/dist/http/wire-types.d.ts +14 -4
  220. package/dist/human-facing-args.d.ts +33 -0
  221. package/dist/human-facing-args.js +33 -0
  222. package/dist/identity-source.d.ts +20 -3
  223. package/dist/identity-source.js +14 -0
  224. package/dist/index.d.ts +5 -1
  225. package/dist/k8s-api-credentials.d.ts +29 -0
  226. package/dist/k8s-api-credentials.js +25 -0
  227. package/dist/lane-home-probe.d.ts +3 -7
  228. package/dist/lane-home-probe.js +2 -2
  229. package/dist/leader/diffup.d.ts +19 -0
  230. package/dist/leader/diffup.js +7 -0
  231. package/dist/leader/leader.d.ts +116 -11
  232. package/dist/leader/leader.js +69 -5
  233. package/dist/leader/repair-wire.js +2 -2
  234. package/dist/leader/run-entry.d.ts +2 -1
  235. package/dist/leader/run-entry.js +1 -1
  236. package/dist/leader/wire.d.ts +42 -132
  237. package/dist/leader/wire.js +81 -67
  238. package/dist/leg-facts.d.ts +13 -5
  239. package/dist/leg-facts.js +2 -1
  240. package/dist/memory-scope.d.ts +23 -11
  241. package/dist/memory-scope.js +18 -6
  242. package/dist/memory-sync-client.d.ts +30 -2
  243. package/dist/memory-sync-client.js +16 -9
  244. package/dist/model-entry-headers.d.ts +9 -10
  245. package/dist/model-entry-headers.js +0 -4
  246. package/dist/model-entry-refusal.d.ts +7 -4
  247. package/dist/model-entry-refusal.js +11 -5
  248. package/dist/model-plane-face.d.ts +1 -1
  249. package/dist/model-plane-face.js +3 -1
  250. package/dist/model-route-endpoint.d.ts +13 -7
  251. package/dist/model-route-endpoint.js +14 -11
  252. package/dist/model-select.d.ts +22 -0
  253. package/dist/model-select.js +9 -0
  254. package/dist/model-unreachable-notice.d.ts +11 -0
  255. package/dist/model-unreachable-notice.js +4 -4
  256. package/dist/object-store-buckets.d.ts +640 -6
  257. package/dist/object-store-buckets.js +166 -0
  258. package/dist/observability/err-text.d.ts +7 -0
  259. package/dist/observability/err-text.js +5 -0
  260. package/dist/observability/fail-open.d.ts +25 -17
  261. package/dist/observability/fail-open.js +25 -17
  262. package/dist/observability/logger.js +3 -1
  263. package/dist/observability/metrics.js +1 -0
  264. package/dist/operator-roster.d.ts +68 -0
  265. package/dist/operator-roster.js +32 -0
  266. package/dist/orchestration/workflow-notify-journal.d.ts +18 -1
  267. package/dist/orchestration/workflow-notify-journal.js +12 -1
  268. package/dist/orchestration/workflow-park-decision.d.ts +70 -18
  269. package/dist/orchestration/workflow-park-decision.js +49 -10
  270. package/dist/orchestration/workflow-park-holder.d.ts +65 -0
  271. package/dist/orchestration/workflow-park-holder.js +98 -0
  272. package/dist/orchestration/workflow-record-fence.d.ts +36 -0
  273. package/dist/orchestration/workflow-record-fence.js +42 -0
  274. package/dist/outbound-dispatcher.d.ts +71 -8
  275. package/dist/outbound-dispatcher.js +48 -7
  276. package/dist/owner-faces.d.ts +2 -2
  277. package/dist/parked-decide.d.ts +106 -55
  278. package/dist/parked-decide.js +153 -117
  279. package/dist/peer-directory.d.ts +2 -2
  280. package/dist/peer-inbound-face.d.ts +2 -6
  281. package/dist/peer-inbound-face.js +0 -3
  282. package/dist/permission-mode-admission.d.ts +74 -5
  283. package/dist/permission-mode-admission.js +56 -3
  284. package/dist/plugins/adoption-log-sql.d.ts +3 -1
  285. package/dist/plugins/adoption-log-sql.js +7 -1
  286. package/dist/plugins/approval-ask-store-file.d.ts +14 -2
  287. package/dist/plugins/approval-ask-store-file.js +11 -0
  288. package/dist/plugins/approval-ask-store-memory.d.ts +10 -1
  289. package/dist/plugins/approval-ask-store-memory.js +35 -10
  290. package/dist/plugins/approval-ask-store-sql.d.ts +69 -4
  291. package/dist/plugins/approval-ask-store-sql.js +45 -5
  292. package/dist/plugins/approval-exemption-store.js +3 -0
  293. package/dist/plugins/approval-nonce-store.js +2 -0
  294. package/dist/plugins/blob-backend.d.ts +83 -7
  295. package/dist/plugins/blob-backend.js +57 -6
  296. package/dist/plugins/breaker-state-sql.js +2 -0
  297. package/dist/plugins/caching-session-store.d.ts +9 -15
  298. package/dist/plugins/caching-session-store.js +6 -0
  299. package/dist/plugins/checkpoint-index-columns.d.ts +20 -16
  300. package/dist/plugins/checkpoint-index-columns.js +3 -6
  301. package/dist/plugins/checkpoint-store-face.d.ts +119 -61
  302. package/dist/plugins/checkpoint-store-face.js +134 -55
  303. package/dist/plugins/device-store-sql.js +6 -0
  304. package/dist/plugins/error-origin.d.ts +18 -0
  305. package/dist/plugins/error-origin.js +10 -0
  306. package/dist/plugins/execution-placement-sql.js +6 -6
  307. package/dist/plugins/image-bake-store-sql.js +6 -0
  308. package/dist/plugins/image-index-sql.js +4 -0
  309. package/dist/plugins/landed-attendants.d.ts +212 -0
  310. package/dist/plugins/landed-attendants.js +161 -0
  311. package/dist/plugins/leader-run-store-sql.js +4 -0
  312. package/dist/plugins/local-checkpoint-store.d.ts +13 -3
  313. package/dist/plugins/local-checkpoint-store.js +38 -49
  314. package/dist/plugins/local-session-live-reference.d.ts +40 -0
  315. package/dist/plugins/local-session-live-reference.js +39 -0
  316. package/dist/plugins/local-session-store.d.ts +71 -33
  317. package/dist/plugins/local-session-store.js +129 -27
  318. package/dist/plugins/memory-engine-pg.js +4 -0
  319. package/dist/plugins/memory-engine-sql-apply.js +5 -2
  320. package/dist/plugins/memory-engine-tidb.js +4 -0
  321. package/dist/plugins/memory-optout-grant-store-sql.js +4 -0
  322. package/dist/plugins/memory-sync-store-pg.js +5 -0
  323. package/dist/plugins/memory-sync-store-tidb.js +5 -0
  324. package/dist/plugins/one-time-migrations.d.ts +104 -80
  325. package/dist/plugins/one-time-migrations.js +226 -132
  326. package/dist/plugins/org-delivery-quota-store.js +4 -1
  327. package/dist/plugins/outcome-ledger-sql.js +2 -0
  328. package/dist/plugins/permission-rule-store-sql.js +11 -4
  329. package/dist/plugins/pg-cost-quota.js +4 -0
  330. package/dist/plugins/pg-pool.js +35 -10
  331. package/dist/plugins/pg-rate-limiter.js +2 -0
  332. package/dist/plugins/posix-shell-fs.d.ts +6 -1
  333. package/dist/plugins/posix-shell-fs.js +4 -1
  334. package/dist/plugins/remote-env-adb.d.ts +19 -15
  335. package/dist/plugins/remote-env-adb.js +41 -15
  336. package/dist/plugins/remote-env-connect-seat.d.ts +105 -0
  337. package/dist/plugins/remote-env-connect-seat.js +72 -0
  338. package/dist/plugins/remote-env-device.d.ts +22 -5
  339. package/dist/plugins/remote-env-device.js +106 -8
  340. package/dist/plugins/remote-env-e2b.d.ts +15 -6
  341. package/dist/plugins/remote-env-e2b.js +42 -32
  342. package/dist/plugins/remote-env-file-error.js +6 -2
  343. package/dist/plugins/remote-env-host.d.ts +46 -10
  344. package/dist/plugins/remote-env-host.js +124 -52
  345. package/dist/plugins/remote-env-k8s.d.ts +109 -41
  346. package/dist/plugins/remote-env-k8s.js +160 -54
  347. package/dist/plugins/remote-env-local-docker.d.ts +13 -8
  348. package/dist/plugins/remote-env-local-docker.js +34 -41
  349. package/dist/plugins/remote-env-ssh.d.ts +18 -12
  350. package/dist/plugins/remote-env-ssh.js +60 -59
  351. package/dist/plugins/remote-shell.d.ts +98 -1
  352. package/dist/plugins/remote-shell.js +218 -0
  353. package/dist/plugins/replica-registration.d.ts +1 -1
  354. package/dist/plugins/replica-registration.js +1 -1
  355. package/dist/plugins/resume-anchor-store-sql.d.ts +11 -2
  356. package/dist/plugins/resume-anchor-store-sql.js +12 -5
  357. package/dist/plugins/retention-lane-store-sql.js +4 -0
  358. package/dist/plugins/retention-sql.d.ts +20 -2
  359. package/dist/plugins/retention-sql.js +11 -0
  360. package/dist/plugins/run-store-sql.d.ts +21 -2
  361. package/dist/plugins/run-store-sql.js +31 -7
  362. package/dist/plugins/s3-presign.d.ts +23 -0
  363. package/dist/plugins/s3-presign.js +37 -3
  364. package/dist/plugins/scenario-prefix-switch-m42.d.ts +1 -1
  365. package/dist/plugins/scenario-prefix-switch-m42.js +2 -2
  366. package/dist/plugins/scheduler-support.d.ts +2 -2
  367. package/dist/plugins/scheduler-support.js +0 -3
  368. package/dist/plugins/schema-consistency.d.ts +4 -2
  369. package/dist/plugins/schema-consistency.js +19 -2
  370. package/dist/plugins/schema-indexes.js +2 -0
  371. package/dist/plugins/send-file-ledger.d.ts +2 -2
  372. package/dist/plugins/send-file-ledger.js +5 -2
  373. package/dist/plugins/send-user-file.d.ts +3 -4
  374. package/dist/plugins/send-user-file.js +56 -52
  375. package/dist/plugins/serving-requirement.d.ts +26 -7
  376. package/dist/plugins/serving-requirement.js +11 -4
  377. package/dist/plugins/session-birth.d.ts +6 -2
  378. package/dist/plugins/session-blob-claim-token.d.ts +15 -0
  379. package/dist/plugins/session-blob-claim-token.js +20 -0
  380. package/dist/plugins/session-blob-namespace.d.ts +46 -0
  381. package/dist/plugins/session-blob-namespace.js +116 -0
  382. package/dist/plugins/session-capture-record-store-sql.js +2 -0
  383. package/dist/plugins/session-ext-table.d.ts +14 -1
  384. package/dist/plugins/session-ext-table.js +5 -1
  385. package/dist/plugins/session-row-sql.d.ts +49 -2
  386. package/dist/plugins/session-row-sql.js +56 -13
  387. package/dist/plugins/session-store-sql.d.ts +34 -18
  388. package/dist/plugins/session-store-sql.js +98 -17
  389. package/dist/plugins/shared-memory-store-sql.d.ts +1 -0
  390. package/dist/plugins/shared-memory-store-sql.js +6 -2
  391. package/dist/plugins/snapshot-bucket-presence.d.ts +25 -2
  392. package/dist/plugins/snapshot-bucket-presence.js +8 -2
  393. package/dist/plugins/sql-driver.d.ts +2 -1
  394. package/dist/plugins/sql-driver.js +18 -3
  395. package/dist/plugins/sql-errors.d.ts +11 -6
  396. package/dist/plugins/sql-errors.js +5 -6
  397. package/dist/plugins/sql-json-column.d.ts +1 -1
  398. package/dist/plugins/stop-then-start-sentence.d.ts +10 -4
  399. package/dist/plugins/stop-then-start-sentence.js +14 -10
  400. package/dist/plugins/stop-then-start.d.ts +109 -0
  401. package/dist/plugins/stop-then-start.js +104 -0
  402. package/dist/plugins/store-backend.d.ts +84 -15
  403. package/dist/plugins/store-backend.js +236 -72
  404. package/dist/plugins/store-boundary.d.ts +57 -0
  405. package/dist/plugins/store-boundary.js +139 -0
  406. package/dist/plugins/store-contracts.d.ts +17 -0
  407. package/dist/plugins/store-fault-sentence-m53.d.ts +7 -0
  408. package/dist/plugins/store-fault-sentence-m53.js +25 -0
  409. package/dist/plugins/store-fault.d.ts +26 -7
  410. package/dist/plugins/store-fault.js +18 -2
  411. package/dist/plugins/task-attachment-store.d.ts +2 -1
  412. package/dist/plugins/task-attachment-store.js +14 -1
  413. package/dist/plugins/task-list-store-sql.d.ts +2 -2
  414. package/dist/plugins/task-list-store-sql.js +10 -8
  415. package/dist/plugins/tidb-cost-quota.js +4 -0
  416. package/dist/plugins/tidb-pool.js +21 -25
  417. package/dist/plugins/tidb-rate-limiter.js +4 -0
  418. package/dist/plugins/user-input-ledger-sql.js +4 -0
  419. package/dist/plugins/workflow-run-store-sql.d.ts +28 -10
  420. package/dist/plugins/workflow-run-store-sql.js +64 -4
  421. package/dist/plugins/workspace-custody.d.ts +4 -3
  422. package/dist/plugins/workspace-fill.d.ts +4 -7
  423. package/dist/plugins/workspace-fill.js +2 -1
  424. package/dist/plugins/write-behind-counter.js +5 -0
  425. package/dist/project-context.d.ts +0 -2
  426. package/dist/project-context.js +4 -8
  427. package/dist/project-registry.d.ts +46 -0
  428. package/dist/project-registry.js +44 -0
  429. package/dist/question.d.ts +2 -1
  430. package/dist/question.js +5 -13
  431. package/dist/request-form.d.ts +6 -1
  432. package/dist/request-form.js +4 -1
  433. package/dist/request-key-closure.js +1 -1
  434. package/dist/request-value-closure.d.ts +4 -0
  435. package/dist/request-value-closure.js +10 -0
  436. package/dist/rule-issue-reading.d.ts +1 -1
  437. package/dist/rules-consent.d.ts +1 -1
  438. package/dist/run-acceptance.d.ts +3 -2
  439. package/dist/run-acceptance.js +4 -6
  440. package/dist/run-local.js +9 -9
  441. package/dist/runs.d.ts +54 -16
  442. package/dist/runs.js +67 -13
  443. package/dist/runtime-governance.d.ts +5 -4
  444. package/dist/security.d.ts +30 -32
  445. package/dist/security.js +41 -7
  446. package/dist/sema-config-dir.d.ts +2 -1
  447. package/dist/server-secret-env.d.ts +12 -10
  448. package/dist/server-secret-env.js +24 -15
  449. package/dist/session-bindings.d.ts +82 -0
  450. package/dist/session-bindings.js +18 -0
  451. package/dist/session-children-retire.d.ts +2 -2
  452. package/dist/session-children-retire.js +2 -6
  453. package/dist/session-deletion.d.ts +16 -1
  454. package/dist/session-error-wire.d.ts +3 -3
  455. package/dist/session-error-wire.js +3 -3
  456. package/dist/session-incarnation.d.ts +10 -0
  457. package/dist/session-incarnation.js +10 -1
  458. package/dist/session-kind.d.ts +57 -0
  459. package/dist/session-kind.js +22 -0
  460. package/dist/session-row.d.ts +21 -1
  461. package/dist/session-row.js +7 -1
  462. package/dist/session-sync-kernel.d.ts +24 -14
  463. package/dist/session-sync-kernel.js +3 -6
  464. package/dist/session-sync.d.ts +25 -103
  465. package/dist/session-sync.js +14 -76
  466. package/dist/session-titler.d.ts +10 -3
  467. package/dist/session-titler.js +19 -6
  468. package/dist/ssh-host-key.d.ts +5 -0
  469. package/dist/ssh-host-key.js +3 -0
  470. package/dist/stores-sql/blob-index-sql.d.ts +30 -9
  471. package/dist/stores-sql/blob-index-sql.js +40 -21
  472. package/dist/stores-sql/checkpoint-store-sql.d.ts +54 -27
  473. package/dist/stores-sql/checkpoint-store-sql.js +70 -146
  474. package/dist/stores-sql/file-history-store-sql.d.ts +113 -15
  475. package/dist/stores-sql/file-history-store-sql.js +205 -95
  476. package/dist/stores-sql/pg-session-storage.d.ts +34 -7
  477. package/dist/stores-sql/pg-session-storage.js +37 -13
  478. package/dist/stores-sql/retention-store-sql.d.ts +1 -9
  479. package/dist/stores-sql/retention-store-sql.js +5 -19
  480. package/dist/stores-sql/session-policy-store-sql.d.ts +30 -7
  481. package/dist/stores-sql/session-policy-store-sql.js +61 -44
  482. package/dist/stores-sql/session-write-hooks.d.ts +11 -0
  483. package/dist/stores-sql/tidb-session-store.d.ts +58 -7
  484. package/dist/stores-sql/tidb-session-store.js +37 -13
  485. package/dist/submission-exit.d.ts +3 -2
  486. package/dist/submission-exit.js +9 -1
  487. package/dist/task-cwd.d.ts +2 -2
  488. package/dist/task-settings.d.ts +7 -5
  489. package/dist/task-settings.js +3 -3
  490. package/dist/terminal.d.ts +33 -2
  491. package/dist/terminal.js +139 -9
  492. package/dist/tool-approval.d.ts +465 -507
  493. package/dist/tool-approval.js +606 -1222
  494. package/dist/trace/core-keyset-guard.d.ts +1 -1
  495. package/dist/trace/ledger-events.d.ts +3 -3
  496. package/dist/trace/project.d.ts +2 -3
  497. package/dist/trace/redact.js +3 -2
  498. package/dist/trace/self-minted-wire.d.ts +571 -178
  499. package/dist/trace/self-minted-wire.js +189 -56
  500. package/dist/web-admin-client/apply-effective.js +2 -2
  501. package/dist/web-admin-client/read-warnings.d.ts +2 -2
  502. package/dist/web-admin-client/read-warnings.js +1 -1
  503. package/dist/web-admin-client/types.d.ts +1 -1
  504. package/dist/workspace-space.d.ts +10 -4
  505. package/dist/workspace-space.js +4 -1
  506. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +79 -28
  507. package/package.json +7 -3
  508. package/scripts/embed-minimal.mjs +3 -3
  509. package/wire-changes/server@7.151.0.json +762 -0
  510. package/wire-changes/server@7.152.0.json +900 -0
  511. package/dist/config-d-migration.d.ts +0 -37
  512. package/dist/config-d-migration.js +0 -60
  513. package/dist/http/session-inherit-env.d.ts +0 -36
  514. package/dist/http/session-inherit-env.js +0 -6
@@ -1,13 +1,647 @@
1
1
  /**
2
- * The two object-store buckets this server reads from and never creates (`docs/DEPLOY-PREREQS.md` "对象存储桶"), and the name each takes when its
3
- * knob is unset — ONE spelling of each default. The config loader (`config.ts`), the config catalog's default notes, the boot presence check's role
4
- * table (`plugins/snapshot-bucket-presence.ts`) and the k8s adapter's refusal sentence all read these constants; a literal copied into any of them is
5
- * a second source that drifts the day a default changes (the refusal would then name a bucket the loader no longer defaults to).
2
+ * Every object-store request this server signs or hands out — ONE closed table ({@link OBJECT_STORE_ACTIONS}), the one source of what the engine
3
+ * does to S3 / MinIO: which bucket (by the knob that names it), which key form, which S3 action, who sends the request, how long the signed URL
4
+ * lives, and for which feature. The server uses no S3 SDK: every request is a SigV4 presigned URL from one signing seat
5
+ * (`plugins/s3-presign.ts`), and that seat refuses to sign a request whose call does not name a row of this table (the row's id, {@link ObjectStoreOp},
6
+ * is a required argument and the row's action must be the verb signed). A row no code signs, or a request no row names, is red at the gates
7
+ * (the source gate and the recorded-wire gate). The names the rows use — bucket defaults, key prefixes — have their one spelling here too, and the
8
+ * config loader, the boot bucket check and the call sites read them from here.
6
9
  *
7
- * Pure leaf: no imports.
10
+ * Who reads it outside this process: a deployment tool that issues least-privilege object-store credentials per engine
11
+ * (`@sema-agent/server/object-store-buckets`) — the S3 permissions of a row are {@link OBJECT_STORE_ACTION_PERMISSIONS}, its resource is
12
+ * {@link objectKeyGlob} of its key form. Every row except the anonymous read is signed with the engine's one key (`MINIO_ACCESS_KEY`), so
13
+ * the engine's policy is the union of those rows; the anonymous row is the public bucket's own GetObject-only policy.
14
+ *
15
+ * Key forms: `{slot}` = a deployment value (a knob, {@link OBJECT_KEY_KNOB_SLOTS}: its value, or what an unset knob reads as); `<segment>` = a
16
+ * value minted per request ({@link OBJECT_KEY_SEGMENTS}); everything else is literal. A LIST row's key form is the listed prefix.
17
+ *
18
+ * Pure leaf: no imports (so the config loader, the boot check, the adapters and an outside deployment tool can all import it).
8
19
  */
9
- /** `SESSION_SNAPSHOT_BUCKET` unset ⇒ this bucket: snapshot-BLOB offload, and the SendUserFile private presigned track / sandbox staging. */
20
+ /** `SESSION_SNAPSHOT_BUCKET` unset ⇒ this bucket: the session blob domains (file history, attachments, the retired snapshot epoch), and the SendUserFile private track / sandbox staging. */
10
21
  export declare const SESSION_SNAPSHOT_BUCKET_DEFAULT = "session-snapshots";
11
22
  /** `WORKSPACE_SNAPSHOT_BUCKET` unset ⇒ this bucket: the k8s lane's workspace snapshots (cross-run space snapshots and parked-run archives). */
12
23
  export declare const WORKSPACE_SNAPSHOT_BUCKET_DEFAULT = "workspaces";
24
+ /** `S3_PUBLIC_BUCKET` unset ⇒ this bucket: the SendUserFile permanent track (anonymous GetObject-only policy, set by the operator). */
25
+ export declare const S3_PUBLIC_BUCKET_DEFAULT = "sema-public";
26
+ /** `WORKSPACE_SNAPSHOT_PREFIX` unset ⇒ this prefix (the first segment of every snapshot object key of both k8s lanes). */
27
+ export declare const WORKSPACE_SNAPSHOT_PREFIX_DEFAULT = "kata";
28
+ /** `SESSION_SNAPSHOT_PREFIX` unset ⇒ the retired snapshot epoch's blob root (its objects were written under it; the file-history and attachment domains read an unset prefix as empty). */
29
+ export declare const LEGACY_BLOB_ROOT_DEFAULT = "blobs/";
30
+ /** The file-history blob domain's segment under `SESSION_SNAPSHOT_PREFIX` (domain isolation: its sweep never sees another domain's objects). */
31
+ export declare const FILE_HISTORY_BLOB_SEGMENT = "file-history/";
32
+ /** The attachment blob domain's segment under `SESSION_SNAPSHOT_PREFIX` (same sha256 keys as file history, a different lifetime — never one namespace). */
33
+ export declare const ATTACHMENT_BLOB_SEGMENT = "attachments/";
34
+ /** The session blob namespace's claim object under `SESSION_SNAPSHOT_PREFIX` (the bucket × prefix the three blob domains share): its body names the one
35
+ * database the namespace belongs to. Every key in those domains is a content address and every delete is judged by one database's references, so the
36
+ * namespace is one database's; the first database to write the claim holds it (a create-only write), and a store whose database is not the one named
37
+ * refuses to open. */
38
+ export declare const SESSION_BLOB_CLAIM_KEY = "blob-namespace-claim";
39
+ /** Why a `SESSION_SNAPSHOT_PREFIX` value is refused when the configuration loads (`undefined` = accepted). The retired epoch's root is the prefix itself, so a
40
+ * prefix that ends in a live domain's segment (`…file-history/`, `…attachments/`) makes the domain of another engine — the one whose prefix is the rest of
41
+ * the value — this engine's retired root, and this engine's retired-epoch sweep would delete that engine's live bytes (two namespaces whose keys meet). */
42
+ export declare function sessionSnapshotPrefixProblem(prefix: string): string | undefined;
43
+ /** The SendUserFile private track's prefix in the session snapshot bucket (keeps its objects apart from the blob domains). */
44
+ export declare const SENDFILE_PRIVATE_PREFIX = "sendfile/";
45
+ /** The SendUserFile staging segment under {@link SENDFILE_PRIVATE_PREFIX}: the only key a sandbox ever gets a write URL for. */
46
+ export declare const SENDFILE_STAGING_SEGMENT = "staging/";
47
+ /** The leader's diff-out key prefix in the `MINIO_BUCKET` bucket. */
48
+ export declare const LEADER_DIFF_PREFIX = "leader-diff";
49
+ /** The bucket knobs (closed set) → the bucket name when the knob is unset. `MINIO_BUCKET` shares the workspace bucket's default NAME (not its explicit value: the two knobs are independent). */
50
+ export declare const OBJECT_STORE_BUCKET_KNOBS: {
51
+ readonly SESSION_SNAPSHOT_BUCKET: "session-snapshots";
52
+ readonly WORKSPACE_SNAPSHOT_BUCKET: "workspaces";
53
+ readonly MINIO_BUCKET: "workspaces";
54
+ readonly S3_PUBLIC_BUCKET: "sema-public";
55
+ };
56
+ export type ObjectStoreBucketKnob = keyof typeof OBJECT_STORE_BUCKET_KNOBS;
57
+ /** The `{slot}`s of a key form (closed set): the knob each one is read from and what it reads as when the knob is unset. One knob can feed two slots that read its absence differently. */
58
+ export declare const OBJECT_KEY_KNOB_SLOTS: {
59
+ readonly workspacePrefix: {
60
+ readonly knob: "WORKSPACE_SNAPSHOT_PREFIX";
61
+ readonly unset: "kata";
62
+ };
63
+ readonly sessionPrefix: {
64
+ readonly knob: "SESSION_SNAPSHOT_PREFIX";
65
+ readonly unset: "";
66
+ };
67
+ readonly legacyBlobRoot: {
68
+ readonly knob: "SESSION_SNAPSHOT_PREFIX";
69
+ readonly unset: "blobs/";
70
+ };
71
+ };
72
+ export type ObjectKeyKnobSlot = keyof typeof OBJECT_KEY_KNOB_SLOTS;
73
+ /** The `<segment>`s of a key form (closed set) → what each one holds. Each is one key segment (no `/`). */
74
+ export declare const OBJECT_KEY_SEGMENTS: {
75
+ readonly sessionId: "the parked run's session id (an env without one cannot park: its `_` placeholder is outside the key segment shape, so nothing is signed)";
76
+ readonly incarnation: "the space occupant's incarnation (the session occupant's minted id)";
77
+ readonly snapshotId: "a snapshot id minted for one upload (carries the writer's ownership mark)";
78
+ readonly object: "an object name read from the partition's listing";
79
+ readonly sha256: "the blob's content address (hex sha256)";
80
+ readonly scope: "the hashed tenant segment (`_` for a single-user deployment)";
81
+ readonly uuid: "a uuidv7 minted per file (the capability part of a link)";
82
+ readonly name: "the sanitized file name";
83
+ readonly run: "the leader run's object tag (time + random)";
84
+ readonly workerId: "the leader sub-worker id";
85
+ };
86
+ export type ObjectKeySegment = keyof typeof OBJECT_KEY_SEGMENTS;
87
+ /** The S3 actions (closed set). `LIST` = ListObjectsV2 under the row's prefix; `COPY` = a server-side CopyObject into the row's key from its `from`. */
88
+ export declare const OBJECT_STORE_ACTION_VERBS: readonly ["GET", "PUT", "HEAD", "DELETE", "LIST", "COPY"];
89
+ export type ObjectStoreActionVerb = (typeof OBJECT_STORE_ACTION_VERBS)[number];
90
+ /** The S3 permissions each action needs on its row's resource (`COPY` also needs `s3:GetObject` on its `from`). */
91
+ export declare const OBJECT_STORE_ACTION_PERMISSIONS: {
92
+ readonly GET: readonly ["s3:GetObject"];
93
+ readonly PUT: readonly ["s3:PutObject"];
94
+ readonly HEAD: readonly ["s3:GetObject"];
95
+ readonly DELETE: readonly ["s3:DeleteObject"];
96
+ readonly LIST: readonly ["s3:ListBucket"];
97
+ readonly COPY: readonly ["s3:PutObject"];
98
+ };
99
+ /** Who sends the request on the wire (closed set). Every signed URL is signed by the server with the engine's key; the executor is who holds it. */
100
+ export declare const OBJECT_STORE_EXECUTORS: {
101
+ readonly server: "the server process sends it itself (from its replica's network)";
102
+ readonly sandbox: "the execution sandbox sends it (a k8s pod, an e2b / ssh sandbox, a leader worker env): it holds the presigned URL only, never the key";
103
+ readonly client: "the end user's client fetches the link the server handed out";
104
+ };
105
+ export type ObjectStoreExecutor = keyof typeof OBJECT_STORE_EXECUTORS;
106
+ /** The feature each row belongs to (closed set). */
107
+ export declare const OBJECT_STORE_DOMAINS: {
108
+ readonly "k8s-park": "k8s lane: a parked run's workspace archive (suspend / resume) and its reclaim";
109
+ readonly "k8s-space": "k8s lane: the workspace space (run-end snapshot, `latest` pointer, restore, prune) and its reclaim";
110
+ readonly "boot-probe": "boot: the one bucket-presence check per bucket";
111
+ readonly "file-history": "file-history blob bytes";
112
+ readonly attachments: "task attachment bytes and their orphan sweep";
113
+ readonly "blob-claim": "the session blob namespace's claim: one database per bucket × SESSION_SNAPSHOT_PREFIX (checked when the store opens)";
114
+ readonly "legacy-blobs": "the retired snapshot epoch's blob bytes (sweep only)";
115
+ readonly sendfile: "SendUserFile: the permanent and presigned tracks and the sandbox staging two-phase";
116
+ readonly "leader-diff": "the leader's diff-out: a worker uploads its patch, the leader fetches it";
117
+ };
118
+ export type ObjectStoreDomain = keyof typeof OBJECT_STORE_DOMAINS;
119
+ /** The longest a SigV4 presigned URL may live (`X-Amz-Expires` ≤ 604800 s = 7 days) — the ONE ceiling of every signed row. The signing seat refuses a
120
+ * requested lifetime over it for any row (judged before anything else, never clamped), and every knob a row's lifetime is read from is refused above it
121
+ * when the configuration loads (the knob and this number named). A row's own `maxSec` is a lower per-row policy cap (the k8s lane's 3600 s) that the seat
122
+ * clamps a within-ceiling request to — a different thing. */
123
+ export declare const SIGV4_PRESIGN_MAX_SEC = 604800;
124
+ /**
125
+ * How long a row's URL lives — the signing seat reads this column (`plugins/s3-presign.ts` `rowTtlSec`), so it is the number, not a description of one:
126
+ * no `knob` = a fixed TTL, `defaultSec` exactly (a call never brings its own); a `knob` = the configured value the call brings (the knob, or the call's
127
+ * own argument), `defaultSec` when it brings none (absent = it must bring one), clamped to `maxSec` (a row's policy cap, below the ceiling). Whatever the
128
+ * row says, a lifetime over {@link SIGV4_PRESIGN_MAX_SEC} is refused. `"unsigned"` = an anonymous read: no signature, no expiry.
129
+ */
130
+ export type ObjectStoreTtl = {
131
+ readonly defaultSec?: number;
132
+ readonly knob?: string;
133
+ readonly maxSec?: number;
134
+ } | "unsigned";
135
+ interface ObjectStoreActionRowBase {
136
+ readonly domain: ObjectStoreDomain;
137
+ /** What the row's key names inside its domain (the id is `<domain>/<subject>:<action>`). */
138
+ readonly subject: string;
139
+ readonly bucketKnob: ObjectStoreBucketKnob;
140
+ /** The key form (see the module head); a LIST row's is the listed prefix. */
141
+ readonly key: string;
142
+ readonly executor: ObjectStoreExecutor;
143
+ readonly ttl: ObjectStoreTtl;
144
+ }
145
+ /** One row of {@link OBJECT_STORE_ACTIONS}. A `COPY` row names its source object (`from`); no other row has one. */
146
+ export type ObjectStoreActionRow = (ObjectStoreActionRowBase & {
147
+ readonly action: Exclude<ObjectStoreActionVerb, "COPY">;
148
+ readonly from?: never;
149
+ }) | (ObjectStoreActionRowBase & {
150
+ readonly action: "COPY";
151
+ readonly from: {
152
+ readonly bucketKnob: ObjectStoreBucketKnob;
153
+ readonly key: string;
154
+ };
155
+ });
156
+ /** The table. Each row is one request the code makes; its id ({@link ObjectStoreOp}) is what a signing call names. */
157
+ export declare const OBJECT_STORE_ACTIONS: readonly [{
158
+ readonly domain: "k8s-park";
159
+ readonly subject: "archive";
160
+ readonly action: "PUT";
161
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
162
+ readonly key: "{workspacePrefix}/<sessionId>/<snapshotId>.tar.gz";
163
+ readonly executor: "sandbox";
164
+ readonly ttl: {
165
+ readonly defaultSec: 600;
166
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
167
+ readonly maxSec: 3600;
168
+ };
169
+ }, {
170
+ readonly domain: "k8s-park";
171
+ readonly subject: "archive";
172
+ readonly action: "HEAD";
173
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
174
+ readonly key: "{workspacePrefix}/<sessionId>/<snapshotId>.tar.gz";
175
+ readonly executor: "server";
176
+ readonly ttl: {
177
+ readonly defaultSec: 600;
178
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
179
+ readonly maxSec: 3600;
180
+ };
181
+ }, {
182
+ readonly domain: "k8s-park";
183
+ readonly subject: "archive";
184
+ readonly action: "GET";
185
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
186
+ readonly key: "{workspacePrefix}/<sessionId>/<snapshotId>.tar.gz";
187
+ readonly executor: "sandbox";
188
+ readonly ttl: {
189
+ readonly defaultSec: 600;
190
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
191
+ readonly maxSec: 3600;
192
+ };
193
+ }, {
194
+ readonly domain: "k8s-park";
195
+ readonly subject: "prefix";
196
+ readonly action: "LIST";
197
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
198
+ readonly key: "{workspacePrefix}/<sessionId>/";
199
+ readonly executor: "server";
200
+ readonly ttl: {
201
+ readonly defaultSec: 600;
202
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
203
+ readonly maxSec: 3600;
204
+ };
205
+ }, {
206
+ readonly domain: "k8s-park";
207
+ readonly subject: "object";
208
+ readonly action: "DELETE";
209
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
210
+ readonly key: "{workspacePrefix}/<sessionId>/<object>";
211
+ readonly executor: "server";
212
+ readonly ttl: {
213
+ readonly defaultSec: 600;
214
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
215
+ readonly maxSec: 3600;
216
+ };
217
+ }, {
218
+ readonly domain: "k8s-space";
219
+ readonly subject: "archive";
220
+ readonly action: "PUT";
221
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
222
+ readonly key: "{workspacePrefix}/<incarnation>/space/<snapshotId>.tar.gz";
223
+ readonly executor: "sandbox";
224
+ readonly ttl: {
225
+ readonly defaultSec: 600;
226
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
227
+ readonly maxSec: 3600;
228
+ };
229
+ }, {
230
+ readonly domain: "k8s-space";
231
+ readonly subject: "archive";
232
+ readonly action: "HEAD";
233
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
234
+ readonly key: "{workspacePrefix}/<incarnation>/space/<snapshotId>.tar.gz";
235
+ readonly executor: "server";
236
+ readonly ttl: {
237
+ readonly defaultSec: 600;
238
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
239
+ readonly maxSec: 3600;
240
+ };
241
+ }, {
242
+ readonly domain: "k8s-space";
243
+ readonly subject: "archive";
244
+ readonly action: "GET";
245
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
246
+ readonly key: "{workspacePrefix}/<incarnation>/space/<snapshotId>.tar.gz";
247
+ readonly executor: "sandbox";
248
+ readonly ttl: {
249
+ readonly defaultSec: 600;
250
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
251
+ readonly maxSec: 3600;
252
+ };
253
+ }, {
254
+ readonly domain: "k8s-space";
255
+ readonly subject: "archive";
256
+ readonly action: "DELETE";
257
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
258
+ readonly key: "{workspacePrefix}/<incarnation>/space/<snapshotId>.tar.gz";
259
+ readonly executor: "server";
260
+ readonly ttl: {
261
+ readonly defaultSec: 600;
262
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
263
+ readonly maxSec: 3600;
264
+ };
265
+ }, {
266
+ readonly domain: "k8s-space";
267
+ readonly subject: "latest";
268
+ readonly action: "GET";
269
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
270
+ readonly key: "{workspacePrefix}/<incarnation>/space/latest";
271
+ readonly executor: "server";
272
+ readonly ttl: {
273
+ readonly defaultSec: 600;
274
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
275
+ readonly maxSec: 3600;
276
+ };
277
+ }, {
278
+ readonly domain: "k8s-space";
279
+ readonly subject: "latest";
280
+ readonly action: "PUT";
281
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
282
+ readonly key: "{workspacePrefix}/<incarnation>/space/latest";
283
+ readonly executor: "server";
284
+ readonly ttl: {
285
+ readonly defaultSec: 600;
286
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
287
+ readonly maxSec: 3600;
288
+ };
289
+ }, {
290
+ readonly domain: "k8s-space";
291
+ readonly subject: "latest";
292
+ readonly action: "DELETE";
293
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
294
+ readonly key: "{workspacePrefix}/<incarnation>/space/latest";
295
+ readonly executor: "server";
296
+ readonly ttl: {
297
+ readonly defaultSec: 600;
298
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
299
+ readonly maxSec: 3600;
300
+ };
301
+ }, {
302
+ readonly domain: "k8s-space";
303
+ readonly subject: "prefix";
304
+ readonly action: "LIST";
305
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
306
+ readonly key: "{workspacePrefix}/<incarnation>/space/";
307
+ readonly executor: "server";
308
+ readonly ttl: {
309
+ readonly defaultSec: 600;
310
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
311
+ readonly maxSec: 3600;
312
+ };
313
+ }, {
314
+ readonly domain: "k8s-space";
315
+ readonly subject: "object";
316
+ readonly action: "DELETE";
317
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
318
+ readonly key: "{workspacePrefix}/<incarnation>/space/<object>";
319
+ readonly executor: "server";
320
+ readonly ttl: {
321
+ readonly defaultSec: 600;
322
+ readonly knob: "WORKSPACE_SNAPSHOT_TTL_SEC";
323
+ readonly maxSec: 3600;
324
+ };
325
+ }, {
326
+ readonly domain: "boot-probe";
327
+ readonly subject: "session";
328
+ readonly action: "LIST";
329
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
330
+ readonly key: "{legacyBlobRoot}";
331
+ readonly executor: "server";
332
+ readonly ttl: {
333
+ readonly defaultSec: 3600;
334
+ };
335
+ }, {
336
+ readonly domain: "boot-probe";
337
+ readonly subject: "workspace";
338
+ readonly action: "LIST";
339
+ readonly bucketKnob: "WORKSPACE_SNAPSHOT_BUCKET";
340
+ readonly key: "{workspacePrefix}/";
341
+ readonly executor: "server";
342
+ readonly ttl: {
343
+ readonly defaultSec: 3600;
344
+ };
345
+ }, {
346
+ readonly domain: "file-history";
347
+ readonly subject: "blob";
348
+ readonly action: "PUT";
349
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
350
+ readonly key: "{sessionPrefix}file-history/<sha256>";
351
+ readonly executor: "server";
352
+ readonly ttl: {
353
+ readonly defaultSec: 3600;
354
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
355
+ };
356
+ }, {
357
+ readonly domain: "file-history";
358
+ readonly subject: "blob";
359
+ readonly action: "GET";
360
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
361
+ readonly key: "{sessionPrefix}file-history/<sha256>";
362
+ readonly executor: "server";
363
+ readonly ttl: {
364
+ readonly defaultSec: 3600;
365
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
366
+ };
367
+ }, {
368
+ readonly domain: "file-history";
369
+ readonly subject: "blob";
370
+ readonly action: "DELETE";
371
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
372
+ readonly key: "{sessionPrefix}file-history/<sha256>";
373
+ readonly executor: "server";
374
+ readonly ttl: {
375
+ readonly defaultSec: 3600;
376
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
377
+ };
378
+ }, {
379
+ readonly domain: "attachments";
380
+ readonly subject: "blob";
381
+ readonly action: "PUT";
382
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
383
+ readonly key: "{sessionPrefix}attachments/<sha256>";
384
+ readonly executor: "server";
385
+ readonly ttl: {
386
+ readonly defaultSec: 3600;
387
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
388
+ };
389
+ }, {
390
+ readonly domain: "attachments";
391
+ readonly subject: "blob";
392
+ readonly action: "GET";
393
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
394
+ readonly key: "{sessionPrefix}attachments/<sha256>";
395
+ readonly executor: "server";
396
+ readonly ttl: {
397
+ readonly defaultSec: 3600;
398
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
399
+ };
400
+ }, {
401
+ readonly domain: "attachments";
402
+ readonly subject: "blob";
403
+ readonly action: "HEAD";
404
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
405
+ readonly key: "{sessionPrefix}attachments/<sha256>";
406
+ readonly executor: "server";
407
+ readonly ttl: {
408
+ readonly defaultSec: 3600;
409
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
410
+ };
411
+ }, {
412
+ readonly domain: "attachments";
413
+ readonly subject: "blob";
414
+ readonly action: "DELETE";
415
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
416
+ readonly key: "{sessionPrefix}attachments/<sha256>";
417
+ readonly executor: "server";
418
+ readonly ttl: {
419
+ readonly defaultSec: 3600;
420
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
421
+ };
422
+ }, {
423
+ readonly domain: "attachments";
424
+ readonly subject: "prefix";
425
+ readonly action: "LIST";
426
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
427
+ readonly key: "{sessionPrefix}attachments/";
428
+ readonly executor: "server";
429
+ readonly ttl: {
430
+ readonly defaultSec: 3600;
431
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
432
+ };
433
+ }, {
434
+ readonly domain: "legacy-blobs";
435
+ readonly subject: "blob";
436
+ readonly action: "DELETE";
437
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
438
+ readonly key: "{legacyBlobRoot}<sha256>";
439
+ readonly executor: "server";
440
+ readonly ttl: {
441
+ readonly defaultSec: 3600;
442
+ readonly knob: "SESSION_SNAPSHOT_TTL_SEC";
443
+ };
444
+ }, {
445
+ readonly domain: "blob-claim";
446
+ readonly subject: "claim";
447
+ readonly action: "GET";
448
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
449
+ readonly key: "{sessionPrefix}blob-namespace-claim";
450
+ readonly executor: "server";
451
+ readonly ttl: {
452
+ readonly defaultSec: 60;
453
+ };
454
+ }, {
455
+ readonly domain: "blob-claim";
456
+ readonly subject: "claim";
457
+ readonly action: "PUT";
458
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
459
+ readonly key: "{sessionPrefix}blob-namespace-claim";
460
+ readonly executor: "server";
461
+ readonly ttl: {
462
+ readonly defaultSec: 60;
463
+ };
464
+ }, {
465
+ readonly domain: "sendfile";
466
+ readonly subject: "public";
467
+ readonly action: "PUT";
468
+ readonly bucketKnob: "S3_PUBLIC_BUCKET";
469
+ readonly key: "<scope>/<uuid>/<name>";
470
+ readonly executor: "server";
471
+ readonly ttl: {
472
+ readonly defaultSec: 600;
473
+ };
474
+ }, {
475
+ readonly domain: "sendfile";
476
+ readonly subject: "public";
477
+ readonly action: "COPY";
478
+ readonly bucketKnob: "S3_PUBLIC_BUCKET";
479
+ readonly key: "<scope>/<uuid>/<name>";
480
+ readonly executor: "server";
481
+ readonly ttl: {
482
+ readonly defaultSec: 60;
483
+ };
484
+ readonly from: {
485
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
486
+ readonly key: "sendfile/staging/<scope>/<uuid>";
487
+ };
488
+ }, {
489
+ readonly domain: "sendfile";
490
+ readonly subject: "public";
491
+ readonly action: "HEAD";
492
+ readonly bucketKnob: "S3_PUBLIC_BUCKET";
493
+ readonly key: "<scope>/<uuid>/<name>";
494
+ readonly executor: "server";
495
+ readonly ttl: {
496
+ readonly defaultSec: 60;
497
+ };
498
+ }, {
499
+ readonly domain: "sendfile";
500
+ readonly subject: "public";
501
+ readonly action: "DELETE";
502
+ readonly bucketKnob: "S3_PUBLIC_BUCKET";
503
+ readonly key: "<scope>/<uuid>/<name>";
504
+ readonly executor: "server";
505
+ readonly ttl: {
506
+ readonly defaultSec: 60;
507
+ };
508
+ }, {
509
+ readonly domain: "sendfile";
510
+ readonly subject: "public";
511
+ readonly action: "GET";
512
+ readonly bucketKnob: "S3_PUBLIC_BUCKET";
513
+ readonly key: "<scope>/<uuid>/<name>";
514
+ readonly executor: "client";
515
+ readonly ttl: "unsigned";
516
+ }, {
517
+ readonly domain: "sendfile";
518
+ readonly subject: "private";
519
+ readonly action: "PUT";
520
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
521
+ readonly key: "sendfile/<scope>/<uuid>/<name>";
522
+ readonly executor: "server";
523
+ readonly ttl: {
524
+ readonly defaultSec: 600;
525
+ };
526
+ }, {
527
+ readonly domain: "sendfile";
528
+ readonly subject: "private";
529
+ readonly action: "COPY";
530
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
531
+ readonly key: "sendfile/<scope>/<uuid>/<name>";
532
+ readonly executor: "server";
533
+ readonly ttl: {
534
+ readonly defaultSec: 60;
535
+ };
536
+ readonly from: {
537
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
538
+ readonly key: "sendfile/staging/<scope>/<uuid>";
539
+ };
540
+ }, {
541
+ readonly domain: "sendfile";
542
+ readonly subject: "private";
543
+ readonly action: "HEAD";
544
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
545
+ readonly key: "sendfile/<scope>/<uuid>/<name>";
546
+ readonly executor: "server";
547
+ readonly ttl: {
548
+ readonly defaultSec: 60;
549
+ };
550
+ }, {
551
+ readonly domain: "sendfile";
552
+ readonly subject: "private";
553
+ readonly action: "DELETE";
554
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
555
+ readonly key: "sendfile/<scope>/<uuid>/<name>";
556
+ readonly executor: "server";
557
+ readonly ttl: {
558
+ readonly defaultSec: 60;
559
+ };
560
+ }, {
561
+ readonly domain: "sendfile";
562
+ readonly subject: "private";
563
+ readonly action: "GET";
564
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
565
+ readonly key: "sendfile/<scope>/<uuid>/<name>";
566
+ readonly executor: "client";
567
+ readonly ttl: {
568
+ readonly knob: "SEND_USER_FILE_URL_TTL";
569
+ };
570
+ }, {
571
+ readonly domain: "sendfile";
572
+ readonly subject: "staging";
573
+ readonly action: "PUT";
574
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
575
+ readonly key: "sendfile/staging/<scope>/<uuid>";
576
+ readonly executor: "sandbox";
577
+ readonly ttl: {
578
+ readonly defaultSec: 120;
579
+ };
580
+ }, {
581
+ readonly domain: "sendfile";
582
+ readonly subject: "staging";
583
+ readonly action: "HEAD";
584
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
585
+ readonly key: "sendfile/staging/<scope>/<uuid>";
586
+ readonly executor: "server";
587
+ readonly ttl: {
588
+ readonly defaultSec: 60;
589
+ };
590
+ }, {
591
+ readonly domain: "sendfile";
592
+ readonly subject: "staging";
593
+ readonly action: "DELETE";
594
+ readonly bucketKnob: "SESSION_SNAPSHOT_BUCKET";
595
+ readonly key: "sendfile/staging/<scope>/<uuid>";
596
+ readonly executor: "server";
597
+ readonly ttl: {
598
+ readonly defaultSec: 60;
599
+ };
600
+ }, {
601
+ readonly domain: "leader-diff";
602
+ readonly subject: "patch";
603
+ readonly action: "PUT";
604
+ readonly bucketKnob: "MINIO_BUCKET";
605
+ readonly key: "leader-diff/<run>/<workerId>.patch";
606
+ readonly executor: "sandbox";
607
+ readonly ttl: {
608
+ readonly knob: "LEADER_TIMEOUT_MS";
609
+ };
610
+ }, {
611
+ readonly domain: "leader-diff";
612
+ readonly subject: "patch";
613
+ readonly action: "GET";
614
+ readonly bucketKnob: "MINIO_BUCKET";
615
+ readonly key: "leader-diff/<run>/<workerId>.patch";
616
+ readonly executor: "server";
617
+ readonly ttl: {
618
+ readonly knob: "LEADER_TIMEOUT_MS";
619
+ };
620
+ }];
621
+ type OpOf<R> = R extends {
622
+ readonly domain: infer D extends string;
623
+ readonly subject: infer S extends string;
624
+ readonly action: infer A extends string;
625
+ } ? `${D}/${S}:${A}` : never;
626
+ /** A row's id — `<domain>/<subject>:<action>`, the closed set of the table's rows. A signing call names one. */
627
+ export type ObjectStoreOp = OpOf<(typeof OBJECT_STORE_ACTIONS)[number]>;
628
+ /** The id of a row (the one way it is spelled). */
629
+ export declare function objectStoreOpOf(row: ObjectStoreActionRow): string;
630
+ /** The row an id names. An id outside the table throws (a caller that is not typed against {@link ObjectStoreOp}, e.g. an outside tool reading a string). */
631
+ export declare function objectStoreActionOf(op: ObjectStoreOp): ObjectStoreActionRow;
632
+ /**
633
+ * The knob slot that confines a row to one engine, or `undefined` when nothing does — the table's "can this row be fenced per engine" reading, read off
634
+ * the key form (not a second hand-kept column): a row is confined per engine when its key form, and a COPY row's source too, starts with a `{slot}` each
635
+ * engine can be given its own value for (`WORKSPACE_SNAPSHOT_PREFIX` / `SESSION_SNAPSHOT_PREFIX`). A key form that starts with a literal (`sendfile/…`,
636
+ * `leader-diff/…`) or with a segment minted per request (the public bucket's `<scope>/…`) names the same objects for every engine on the bucket: a
637
+ * per-engine policy cannot fence those rows apart, and engines that share the bucket share them.
638
+ */
639
+ export declare function objectStoreRowEngineSlot(row: ObjectStoreActionRow): ObjectKeyKnobSlot | undefined;
640
+ /**
641
+ * A key form as a policy resource pattern: each `{slot}` replaced by the deployment's value (`slots`; absent ⇒ what the unset knob reads as), each
642
+ * `<segment>` by `*` (`{sessionPrefix}attachments/<sha256>` with the knob unset ⇒ `attachments/*`). The bucket is the row's `bucketKnob` value;
643
+ * a LIST row's pattern is the `s3:prefix` its listing asks for.
644
+ */
645
+ export declare function objectKeyGlob(key: string, slots?: Partial<Record<ObjectKeyKnobSlot, string>>): string;
646
+ export {};
13
647
  //# sourceMappingURL=object-store-buckets.d.ts.map