@sema-agent/core 7.72.0 → 7.74.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 (375) hide show
  1. package/CHANGELOG.md +565 -0
  2. package/dist/agents/inherited-tool-pool.d.ts +26 -1
  3. package/dist/agents/inherited-tool-pool.js +46 -2
  4. package/dist/agents/list-agents-tool.js +1 -1
  5. package/dist/agents/parked-resume-drive.d.ts +10 -0
  6. package/dist/agents/parked-resume-drive.js +9 -0
  7. package/dist/agents/retain-ledger.d.ts +3 -0
  8. package/dist/agents/retain-ledger.js +3 -3
  9. package/dist/agents/send-message-tool.js +5 -4
  10. package/dist/agents/send-user-message-tool.d.ts +12 -0
  11. package/dist/agents/send-user-message-tool.js +67 -0
  12. package/dist/agents/subagent-steps.d.ts +9 -0
  13. package/dist/agents/subagent-steps.js +38 -0
  14. package/dist/agents/subagent.d.ts +2 -0
  15. package/dist/agents/subagent.js +43 -12
  16. package/dist/agents/verify.js +23 -8
  17. package/dist/agents/yield-adoption.js +3 -1
  18. package/dist/brain/anthropic.d.ts +42 -1
  19. package/dist/brain/anthropic.js +68 -13
  20. package/dist/brain/failover.d.ts +5 -0
  21. package/dist/brain/failover.js +51 -22
  22. package/dist/brain/model-lane.d.ts +12 -3
  23. package/dist/brain/model-lane.js +5 -5
  24. package/dist/brain/open-responses.js +7 -8
  25. package/dist/brain/openai.js +31 -24
  26. package/dist/brain/route-adjudicator.d.ts +33 -4
  27. package/dist/brain/route-adjudicator.js +49 -12
  28. package/dist/brain/stream-engine.js +166 -156
  29. package/dist/brain/stream-shared.d.ts +4 -3
  30. package/dist/brain/stream-shared.js +2 -2
  31. package/dist/core/actions-digest.d.ts +43 -0
  32. package/dist/core/actions-digest.js +22 -0
  33. package/dist/core/allow-entry.js +4 -4
  34. package/dist/core/ask-class.d.ts +2 -2
  35. package/dist/core/ask-headline.d.ts +1 -1
  36. package/dist/core/ask-origin.d.ts +44 -4
  37. package/dist/core/ask-origin.js +29 -10
  38. package/dist/core/auto-mode.d.ts +7 -9
  39. package/dist/core/auto-mode.js +114 -8
  40. package/dist/core/background-agent-store.d.ts +1 -0
  41. package/dist/core/background-agent-store.js +49 -8
  42. package/dist/core/checkpoint-features.d.ts +3 -2
  43. package/dist/core/checkpoint-features.js +1 -1
  44. package/dist/core/checkpoint-rekey.d.ts +1 -1
  45. package/dist/core/checkpoint-rekey.js +6 -1
  46. package/dist/core/checkpoint-requirements.d.ts +23 -3
  47. package/dist/core/checkpoint-requirements.js +5 -1
  48. package/dist/core/checkpoint-row-verdict.d.ts +1 -1
  49. package/dist/core/checkpoint-row-verdict.js +9 -3
  50. package/dist/core/checkpoint-store.d.ts +26 -2
  51. package/dist/core/checkpoint-store.js +9 -2
  52. package/dist/core/child-clamp-seats.d.ts +15 -0
  53. package/dist/core/child-clamp-seats.js +15 -0
  54. package/dist/core/config-refusal-codes.d.ts +1 -1
  55. package/dist/core/config-refusal-codes.js +1 -0
  56. package/dist/core/cron.js +9 -1
  57. package/dist/core/delegation-frames.d.ts +1 -0
  58. package/dist/core/delegation-frames.js +1 -1
  59. package/dist/core/deployment-shape.d.ts +7 -0
  60. package/dist/core/deployment-shape.js +19 -0
  61. package/dist/core/engine-capabilities.d.ts +13 -1
  62. package/dist/core/engine-capabilities.js +1 -1
  63. package/dist/core/engine-notice.d.ts +41 -28
  64. package/dist/core/engine-version.js +1 -1
  65. package/dist/core/entries-not-applied.d.ts +19 -7
  66. package/dist/core/entries-not-applied.js +33 -1
  67. package/dist/core/gate-fold.js +5 -4
  68. package/dist/core/gate-lanes.js +8 -12
  69. package/dist/core/gate-outcome.d.ts +8 -2
  70. package/dist/core/gate-outcome.js +10 -3
  71. package/dist/core/governance-codes.d.ts +14 -2
  72. package/dist/core/governance-codes.js +22 -6
  73. package/dist/core/hook-condition.d.ts +37 -0
  74. package/dist/core/hook-condition.js +567 -0
  75. package/dist/core/hooks.d.ts +5 -0
  76. package/dist/core/hooks.js +1 -0
  77. package/dist/core/host-instance.d.ts +23 -0
  78. package/dist/core/host-instance.js +69 -0
  79. package/dist/core/instruction-preview.d.ts +63 -0
  80. package/dist/core/instruction-preview.js +406 -0
  81. package/dist/core/leg-budget.d.ts +26 -0
  82. package/dist/core/leg-budget.js +9 -0
  83. package/dist/core/leg-identity.d.ts +51 -1
  84. package/dist/core/leg-identity.js +45 -2
  85. package/dist/core/manager-launch-check.d.ts +48 -0
  86. package/dist/core/manager-launch-check.js +64 -0
  87. package/dist/core/mcp-call-meta.d.ts +2 -2
  88. package/dist/core/mcp-injection-drop.d.ts +20 -10
  89. package/dist/core/mcp-injection-drop.js +9 -3
  90. package/dist/core/mcp-server-spec.d.ts +2 -1
  91. package/dist/core/member-outcome.d.ts +3 -2
  92. package/dist/core/member-outcome.js +1 -1
  93. package/dist/core/memory-engine/deletion-record.d.ts +46 -0
  94. package/dist/core/memory-engine/deletion-record.js +96 -0
  95. package/dist/core/memory-engine/engine.js +24 -16
  96. package/dist/core/memory-engine/file-backend.js +7 -5
  97. package/dist/core/memory-engine/projection-ledger.d.ts +1 -1
  98. package/dist/core/memory-engine/projection-ledger.js +1 -1
  99. package/dist/core/memory-engine/scope-contract.d.ts +18 -13
  100. package/dist/core/memory-engine/scope-contract.js +18 -18
  101. package/dist/core/memory-engine/sync-client.js +26 -6
  102. package/dist/core/memory-engine/sync.d.ts +20 -2
  103. package/dist/core/memory-engine/sync.js +18 -17
  104. package/dist/core/mode-policy.d.ts +25 -6
  105. package/dist/core/mode-policy.js +33 -8
  106. package/dist/core/model-seat.d.ts +8 -5
  107. package/dist/core/model-shell.d.ts +129 -0
  108. package/dist/core/model-shell.js +249 -0
  109. package/dist/core/mods/kernel/digest.d.ts +4 -0
  110. package/dist/core/mods/kernel/digest.js +5 -0
  111. package/dist/core/mods/kernel/dispatch.d.ts +3 -0
  112. package/dist/core/mods/kernel/dispatch.js +15 -6
  113. package/dist/core/mods/kernel/events.d.ts +21 -5
  114. package/dist/core/mods/kernel/events.js +19 -10
  115. package/dist/core/mods/kernel/hash-mirror.d.ts +1 -0
  116. package/dist/core/mods/kernel/hash-mirror.js +55 -0
  117. package/dist/core/mods/kernel/index.d.ts +1 -0
  118. package/dist/core/mods/kernel/index.js +1 -0
  119. package/dist/core/mods/kernel/package-reader.d.ts +48 -0
  120. package/dist/core/mods/kernel/package-reader.js +149 -0
  121. package/dist/core/mods/kernel/site-rules.d.ts +4 -0
  122. package/dist/core/mods/kernel/site-rules.js +13 -0
  123. package/dist/core/mods/package.d.ts +7 -3
  124. package/dist/core/mods/package.js +47 -80
  125. package/dist/core/own-property-receipt.js +11 -4
  126. package/dist/core/parent-spec-seat.d.ts +13 -11
  127. package/dist/core/parent-spec-seat.js +13 -9
  128. package/dist/core/peer-seat.js +3 -3
  129. package/dist/core/peer-task-store.d.ts +365 -0
  130. package/dist/core/peer-task-store.js +682 -0
  131. package/dist/core/permission-rule-consent.js +6 -11
  132. package/dist/core/permission-rule-model.d.ts +27 -0
  133. package/dist/core/permission-rule-model.js +33 -5
  134. package/dist/core/permission-rule-org.js +13 -3
  135. package/dist/core/permission-rule-provider.d.ts +35 -33
  136. package/dist/core/permission-rule-provider.js +38 -295
  137. package/dist/core/permission-rule-store.d.ts +181 -8
  138. package/dist/core/permission-rule-store.js +420 -17
  139. package/dist/core/permission-rule-sync.js +15 -1
  140. package/dist/core/permission-rules.js +4 -1
  141. package/dist/core/project-seat.d.ts +55 -0
  142. package/dist/core/project-seat.js +96 -0
  143. package/dist/core/protocol-http-auth.d.ts +3 -2
  144. package/dist/core/protocol-http-auth.js +26 -18
  145. package/dist/core/remote-env.d.ts +4 -4
  146. package/dist/core/retain-seat.d.ts +42 -0
  147. package/dist/core/retain-seat.js +76 -0
  148. package/dist/core/retired-keys.js +1 -0
  149. package/dist/core/rewind-refusal-codes.d.ts +8 -0
  150. package/dist/core/rewind-refusal-codes.js +12 -0
  151. package/dist/core/roles.d.ts +2 -2
  152. package/dist/core/roles.js +15 -1
  153. package/dist/core/rule-offer-read.d.ts +1 -1
  154. package/dist/core/rule-offer-read.js +32 -4
  155. package/dist/core/rule-store-fault.d.ts +9 -7
  156. package/dist/core/rule-store-fault.js +8 -3
  157. package/dist/core/run-ledger-seat.d.ts +66 -0
  158. package/dist/core/run-ledger-seat.js +70 -0
  159. package/dist/core/run-ledger.d.ts +332 -0
  160. package/dist/core/run-ledger.js +550 -0
  161. package/dist/core/runner/checkpoint-scope.d.ts +14 -3
  162. package/dist/core/runner/checkpoint-scope.js +16 -6
  163. package/dist/core/runner/compact-session.js +1 -1
  164. package/dist/core/runner/construction-doors.js +8 -0
  165. package/dist/core/runner/contracts.d.ts +21 -5
  166. package/dist/core/runner/cross-boundary-lane.d.ts +8 -1
  167. package/dist/core/runner/cross-boundary-lane.js +4 -0
  168. package/dist/core/runner/delegation-owner.d.ts +30 -0
  169. package/dist/core/runner/delegation-owner.js +20 -4
  170. package/dist/core/runner/finish-reason-seat.js +4 -2
  171. package/dist/core/runner/gate-exit.d.ts +7 -0
  172. package/dist/core/runner/gate-exit.js +2 -1
  173. package/dist/core/runner/leg-frame.js +3 -0
  174. package/dist/core/runner/model-lane-seat.d.ts +3 -0
  175. package/dist/core/runner/model-lane-seat.js +4 -0
  176. package/dist/core/runner/nested-memory-lane.d.ts +22 -5
  177. package/dist/core/runner/nested-memory-lane.js +91 -30
  178. package/dist/core/runner/person-path-rows.d.ts +27 -16
  179. package/dist/core/runner/person-path-rows.js +93 -15
  180. package/dist/core/runner/prepare-caps-and-workflow.js +98 -88
  181. package/dist/core/runner/prepare-config-doors.d.ts +1 -0
  182. package/dist/core/runner/prepare-config-doors.js +13 -7
  183. package/dist/core/runner/prepare-context-lane.js +1 -0
  184. package/dist/core/runner/prepare-delegation-surface.d.ts +3 -0
  185. package/dist/core/runner/prepare-delegation-surface.js +6 -0
  186. package/dist/core/runner/prepare-execution-env.d.ts +3 -3
  187. package/dist/core/runner/prepare-gate-stations.d.ts +6 -0
  188. package/dist/core/runner/prepare-gate-stations.js +3 -1
  189. package/dist/core/runner/prepare-hands-readface.d.ts +5 -2
  190. package/dist/core/runner/prepare-hands-readface.js +15 -3
  191. package/dist/core/runner/prepare-inherited-gate.d.ts +6 -3
  192. package/dist/core/runner/prepare-inherited-gate.js +13 -5
  193. package/dist/core/runner/prepare-offload-wrappers.js +1 -1
  194. package/dist/core/runner/prepare-run-refs.d.ts +1 -1
  195. package/dist/core/runner/prepare-run-refs.js +3 -2
  196. package/dist/core/runner/prepare-suspend-saga.d.ts +6 -2
  197. package/dist/core/runner/prepare-suspend-saga.js +4 -2
  198. package/dist/core/runner/prepare-task.js +42 -30
  199. package/dist/core/runner/prepare-turn-wiring.d.ts +4 -3
  200. package/dist/core/runner/prepare-turn-wiring.js +2 -1
  201. package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -1
  202. package/dist/core/runner/prepare-wiring-manifest.js +8 -6
  203. package/dist/core/runner/resume-apply.js +11 -5
  204. package/dist/core/runner/resume-policy-outcome.js +5 -2
  205. package/dist/core/runner/resume-review-outcome.d.ts +3 -0
  206. package/dist/core/runner/resume-review-outcome.js +24 -1
  207. package/dist/core/runner/role-seat-defaulted.d.ts +3 -3
  208. package/dist/core/runner/role-seat-defaulted.js +1 -1
  209. package/dist/core/runner/rule-store-unreadable-notice.d.ts +1 -1
  210. package/dist/core/runner/rule-store-unreadable-notice.js +3 -3
  211. package/dist/core/runner/run-harness-handlers.js +4 -1
  212. package/dist/core/runner/run-identity-wiring.js +3 -2
  213. package/dist/core/runner/run-leg.js +5 -2
  214. package/dist/core/runner/run-notification-lane.js +20 -1
  215. package/dist/core/runner/run-settle-and-teardown.js +21 -12
  216. package/dist/core/runner/run-stop-and-final-verify.js +6 -0
  217. package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
  218. package/dist/core/runner/runtask.d.ts +6 -2
  219. package/dist/core/runner/runtask.js +21 -9
  220. package/dist/core/runner/shell-env-withheld.d.ts +6 -4
  221. package/dist/core/runner/shell-env-withheld.js +25 -3
  222. package/dist/core/runner/stop-tail-notice.d.ts +10 -2
  223. package/dist/core/runner/stop-tail-notice.js +9 -2
  224. package/dist/core/runner/stream-settle-backstop.d.ts +1 -0
  225. package/dist/core/runner/stream-settle-backstop.js +1 -0
  226. package/dist/core/runner/sub-agent-deny-lists.js +9 -5
  227. package/dist/core/runner/task-start-doors.js +6 -3
  228. package/dist/core/runner/terminal-account.d.ts +6 -1
  229. package/dist/core/runner/terminal-account.js +16 -1
  230. package/dist/core/runner/tool-end-body.d.ts +1 -1
  231. package/dist/core/runner/tool-not-executed.d.ts +27 -8
  232. package/dist/core/runner/tool-not-executed.js +22 -11
  233. package/dist/core/runner/unreadable-person-rows.d.ts +2 -1
  234. package/dist/core/runner/write-protection-station.d.ts +1 -1
  235. package/dist/core/runner/write-protection-station.js +1 -1
  236. package/dist/core/runner-deps.d.ts +17 -10
  237. package/dist/core/secret-env.d.ts +61 -37
  238. package/dist/core/secret-env.js +49 -49
  239. package/dist/core/session-checkout.d.ts +3 -0
  240. package/dist/core/session-checkout.js +1 -0
  241. package/dist/core/session-store.d.ts +12 -6
  242. package/dist/core/session-store.js +26 -6
  243. package/dist/core/session.d.ts +31 -8
  244. package/dist/core/shell-read-silence.d.ts +40 -2
  245. package/dist/core/shell-read-silence.js +23 -4
  246. package/dist/core/store-contracts/checkpoint-store-contract.js +10 -0
  247. package/dist/core/store-contracts/peer-task-store-contract.d.ts +21 -0
  248. package/dist/core/store-contracts/peer-task-store-contract.js +516 -0
  249. package/dist/core/store-contracts/session-store-contract.d.ts +15 -2
  250. package/dist/core/store-contracts/session-store-contract.js +87 -3
  251. package/dist/core/store-contracts/workflow-journal-store-contract.d.ts +19 -1
  252. package/dist/core/store-contracts/workflow-journal-store-contract.js +89 -1
  253. package/dist/core/task-event.d.ts +14 -7
  254. package/dist/core/task-notification.d.ts +96 -10
  255. package/dist/core/task-notification.js +135 -6
  256. package/dist/core/task-registry-agent.d.ts +1 -0
  257. package/dist/core/task-registry-agent.js +1 -1
  258. package/dist/core/task-registry-shared.d.ts +12 -1
  259. package/dist/core/task-registry-shared.js +3 -1
  260. package/dist/core/task-registry-workflow.d.ts +1 -1
  261. package/dist/core/task-registry-workflow.js +9 -1
  262. package/dist/core/task-registry.d.ts +40 -2
  263. package/dist/core/task-registry.js +80 -15
  264. package/dist/core/task-result.d.ts +18 -3
  265. package/dist/core/task-spec-members.d.ts +3 -1
  266. package/dist/core/task-spec-members.js +19 -3
  267. package/dist/core/task-spec.d.ts +48 -22
  268. package/dist/core/tool-catalog-entries.js +2 -0
  269. package/dist/core/tool-gate-phase.d.ts +6 -3
  270. package/dist/core/tool-gate-phase.js +1 -0
  271. package/dist/core/tool-mount-facts.d.ts +8 -4
  272. package/dist/core/tool-mount-facts.js +7 -2
  273. package/dist/core/tool-mount-plan.d.ts +3 -1
  274. package/dist/core/tool-mount-plan.js +10 -3
  275. package/dist/core/tool-mount-static.d.ts +1 -1
  276. package/dist/core/tool-mount-static.js +4 -2
  277. package/dist/core/tool-result-store.d.ts +56 -3
  278. package/dist/core/tool-result-store.js +219 -25
  279. package/dist/core/tool-spec.d.ts +9 -2
  280. package/dist/core/trace.d.ts +3 -3
  281. package/dist/core/user-attachment.d.ts +5 -1
  282. package/dist/core/user-attachment.js +14 -7
  283. package/dist/core/wiring-manifest.d.ts +26 -20
  284. package/dist/core/wiring-manifest.js +7 -3
  285. package/dist/core/workflow-journal-store.d.ts +53 -10
  286. package/dist/core/workflow-journal-store.js +27 -4
  287. package/dist/core/workflow-run-store-contract.js +16 -0
  288. package/dist/core/workflow-run-store.d.ts +9 -7
  289. package/dist/core/workflow-run-store.js +4 -1
  290. package/dist/engine/execution-env/node-execution-env.d.ts +75 -1
  291. package/dist/engine/execution-env/node-execution-env.js +227 -13
  292. package/dist/engine/harness/types.d.ts +49 -1
  293. package/dist/engine/harness/types.js +10 -0
  294. package/dist/engine/llm/types.d.ts +13 -7
  295. package/dist/engine/llm/validation.d.ts +8 -1
  296. package/dist/engine/llm/validation.js +31 -2
  297. package/dist/engine/lsp/node-lsp-manager.js +2 -1
  298. package/dist/engine/session/import-validate.js +6 -1
  299. package/dist/engine/session/session.d.ts +15 -2
  300. package/dist/engine/session/session.js +34 -4
  301. package/dist/host-env.d.ts +10 -0
  302. package/dist/host-env.js +1 -0
  303. package/dist/index.d.ts +28 -9
  304. package/dist/index.js +22 -6
  305. package/dist/internal/harness-types.d.ts +1 -1
  306. package/dist/orchestration/goal.js +1 -1
  307. package/dist/orchestration/run-workflow-tool.js +40 -32
  308. package/dist/orchestration/workflow-park-adoption.d.ts +51 -12
  309. package/dist/orchestration/workflow-park-adoption.js +47 -12
  310. package/dist/orchestration/workflow-primitives.js +10 -1
  311. package/dist/orchestration/workflow-script-runner.d.ts +2 -2
  312. package/dist/orchestration/workflow-stop.d.ts +128 -0
  313. package/dist/orchestration/workflow-stop.js +156 -0
  314. package/dist/orchestration/workflow.d.ts +31 -7
  315. package/dist/orchestration/workflow.js +119 -57
  316. package/dist/prompts/manager-recipe.d.ts +18 -0
  317. package/dist/prompts/manager-recipe.js +24 -0
  318. package/dist/shell/lex.d.ts +2 -2
  319. package/dist/shell/lex.js +1 -1
  320. package/dist/stores/file/permission-rule-store.d.ts +3 -1
  321. package/dist/stores/file/permission-rule-store.js +0 -1
  322. package/dist/stores/file/workflow-journal-store.d.ts +16 -3
  323. package/dist/stores/file/workflow-journal-store.js +93 -5
  324. package/dist/stores/file/workflow-run-store.d.ts +1 -1
  325. package/dist/tools/fs/bash-model-shell.d.ts +23 -0
  326. package/dist/tools/fs/bash-model-shell.js +25 -0
  327. package/dist/tools/fs/bash-readonly-classifier.d.ts +6 -0
  328. package/dist/tools/fs/bash-readonly-classifier.js +3 -0
  329. package/dist/tools/fs/file-write-check.js +9 -3
  330. package/dist/tools/fs/fs-bash.js +13 -11
  331. package/dist/tools/fs/index.d.ts +8 -7
  332. package/dist/tools/fs/index.js +4 -4
  333. package/dist/tools/fs/read-deny-home.d.ts +1 -1
  334. package/dist/tools/fs/read-deny-home.js +5 -5
  335. package/dist/tools/fs/read-deny.d.ts +33 -8
  336. package/dist/tools/fs/read-deny.js +114 -25
  337. package/dist/tools/fs/safety.d.ts +4 -1
  338. package/dist/tools/fs/safety.js +4 -2
  339. package/dist/tools/fs/shell-read-argv.js +1 -0
  340. package/dist/tools/fs/shell-read-check.d.ts +9 -2
  341. package/dist/tools/fs/shell-read-check.js +134 -22
  342. package/dist/tools/fs/shell-read-establish.d.ts +9 -0
  343. package/dist/tools/fs/shell-read-establish.js +21 -11
  344. package/dist/tools/fs/shell-read-judge.d.ts +13 -1
  345. package/dist/tools/fs/shell-read-judge.js +26 -7
  346. package/dist/tools/fs/shell-read-plan.d.ts +7 -3
  347. package/dist/tools/fs/shell-read-plan.js +8 -5
  348. package/dist/tools/fs/shell-read-word.d.ts +8 -0
  349. package/dist/tools/fs/shell-read-word.js +13 -4
  350. package/dist/tools/fs/shell-read-write-targets.js +17 -9
  351. package/dist/tools/monitor.js +12 -8
  352. package/dist/tools/scheduler-tools.d.ts +1 -0
  353. package/dist/tools/scheduler-tools.js +5 -2
  354. package/package.json +3 -2
  355. package/test/export-surface.snapshot.json +192 -3
  356. package/wire-changes/answers/core-stores-sql@7.73.0.json +28 -0
  357. package/wire-changes/answers/core-stores-sql@7.74.0.json +7 -0
  358. package/wire-changes/answers/core@7.73.0.json +216 -0
  359. package/wire-changes/answers/core@7.74.0.json +68 -0
  360. package/wire-changes/answers/mods-kernel@7.73.0.json +7 -0
  361. package/wire-changes/answers/mods-kernel@7.74.0.json +21 -0
  362. package/wire-changes/answers/primitives@7.73.0.json +12 -0
  363. package/wire-changes/answers/primitives@7.74.0.json +7 -0
  364. package/wire-changes/answers/wiki-gate@7.73.0.json +7 -0
  365. package/wire-changes/answers/wiki-gate@7.74.0.json +8 -0
  366. package/wire-changes/core-stores-sql@7.73.0.json +326 -0
  367. package/wire-changes/core-stores-sql@7.74.0.json +143 -0
  368. package/wire-changes/core@7.73.0.json +6480 -0
  369. package/wire-changes/core@7.74.0.json +2210 -0
  370. package/wire-changes/mods-kernel@7.73.0.json +147 -0
  371. package/wire-changes/mods-kernel@7.74.0.json +421 -0
  372. package/wire-changes/primitives@7.73.0.json +227 -0
  373. package/wire-changes/primitives@7.74.0.json +174 -0
  374. package/wire-changes/wiki-gate@7.73.0.json +145 -0
  375. package/wire-changes/wiki-gate@7.74.0.json +145 -0
@@ -0,0 +1,128 @@
1
+ /**
2
+ * #5156 / #5291 — stopping a whole workflow: the one rule is that whether a workflow's tree can start another step is answered by the
3
+ * tree's row on the journal store's claim table alone, and a stop writes that row as a tombstone ({@link
4
+ * import("../core/workflow-journal-store.js").WorkflowJournalStore.stopResumeClaim}). A run of the tree takes its claim under the same
5
+ * keys ({@link workflowClaimKeysOf}) before it starts a step, so a tombstone refuses it whichever process it is in; whether a row still
6
+ * binds is the store's one judgment (its expiry, or a holder process the store proved gone).
7
+ *
8
+ * The stop ({@link stopWorkflowTree}) answers only by what it read under its own tombstones: it writes them (root first, then the tree
9
+ * id, then every other run of the tree it read — a run that later reads as a root of its own, the runs above it removed, is stopped
10
+ * too), cancels this process's runs of the tree and waits for them to settle (bounded), reads the tree again, withdraws every card still
11
+ * waiting on it, and reports what that second read found — the runs that appeared between the two reads (`continuedBefore`: a decision
12
+ * that took the tree before the tombstone did), the records that still read `running` with no claim binding them (`unclaimedRunning`:
13
+ * a process that died). A journal store without the verb stops nothing durably: the runs of this process are cancelled and the cards
14
+ * withdrawn all the same, and the receipt says `durable: false`.
15
+ *
16
+ * The process-local tables here are what a stop reads of this process: the runs it runs ({@link holdLocalWorkflowRun}), each reached by
17
+ * the record the stop read for it — the same id and the same creation — and never by its id alone (a run id names a run within one set
18
+ * of stores), and the holders of the resume claims it took ({@link noteLocalClaimHolder}). A stop reaches the run whose handle stops it
19
+ * by that handle. A run of the tree in this process that holds the claim — whatever it carries — has its claim turned into the
20
+ * tombstone in place and is cancelled (a stop stops what runs); a claim of this process that carries a person's decision and has no
21
+ * run yet (a continuation between taking its claim and starting) has won the card (`park_resume_won`); a claim of this process that
22
+ * carries no decision and has no run behind it is turned in place too. A run of this process outside the tree that holds a key the
23
+ * tree names (another workflow under a reused id) is never turned or cancelled: that key is not stopped.
24
+ */
25
+ import type { CheckpointStore } from "../core/checkpoint-store.js";
26
+ import type { WorkflowJournalStore } from "../core/workflow-journal-store.js";
27
+ import { type WorkflowRunStore } from "../core/workflow-run-store.js";
28
+ import { type WorkflowRun } from "./workflow-types.js";
29
+ /**
30
+ * How a stop of a whole workflow answers ({@link WorkflowRunStopReceipt}) — its own closed set, not the member stop's (an ended tree is
31
+ * stopped all the same, so there is no `already_terminal`; a card the checkpoint store does not withdraw is counted in `cardsLeft`, so
32
+ * there is no `park_arbiter_unreachable`):
33
+ * - `stopped` — the workflow's tree was stopped: no run of it starts another step (`durable: false` — the journal store keeps no stop:
34
+ * this process's runs were cancelled and the cards withdrawn, and a later continuation is not refused);
35
+ * - `not_found` — no run the caller can see (through the task registry);
36
+ * - `not_local` — a run that is not one of this process's runs of the tree holds the tree's claim (another process's, or one this
37
+ * process has not yet read into the tree): nothing was written (`holder`, when the store named a run);
38
+ * - `park_resume_won` — a continuation of this process carrying a person's decision took the tree's claim and has not started its run
39
+ * yet: the decision won the card, nothing was written;
40
+ * - `partial` — the first key's tombstone was written and a later key is held by another run (`heldBy`) or its write failed: the part
41
+ * under the written keys (`stoppedKeys`) starts no step; the keys from that one on (`notStoppedKeys`) were not written.
42
+ */
43
+ export declare const WORKFLOW_RUN_STOP_ANSWERS: readonly ["stopped", "not_found", "not_local", "park_resume_won", "partial"];
44
+ export type WorkflowRunStopAnswer = (typeof WORKFLOW_RUN_STOP_ANSWERS)[number];
45
+ /** A whole-workflow stop's answer ({@link WORKFLOW_RUN_STOP_ANSWERS}) and what it says beside its word. */
46
+ export type WorkflowRunStopReceipt = {
47
+ readonly answer: "stopped";
48
+ /** Who stopped it, read as a member stop reads it (`WorkflowAgentStopReceipt`'s `stoppedBy`, workflow-types.ts). */
49
+ readonly stoppedBy: string;
50
+ /** How many of the tree's approval cards still wait after the stop withdrew them (a card the checkpoint store did not withdraw,
51
+ * or every card when no checkpoint store was given): a decision for one is refused, `workflow_stopped`. */
52
+ readonly cardsLeft: number;
53
+ /** How many pending cards the tree's records name that the park does not bind (the card belongs to another session, or the
54
+ * record names no session for it — the binding a resume checks): not touched, not counted in `cardsLeft`. */
55
+ readonly cardsUnbound?: number;
56
+ /** The runs of the tree the second read found and the first did not: a decision that continued it before the tombstone stood —
57
+ * that run has run (and is ended, or was cancelled with the rest). */
58
+ readonly continuedBefore?: readonly string[];
59
+ /** The tree has no tree id (its root names a source that is gone, and an older engine wrote it): only this part was stopped. */
60
+ readonly fragment?: true;
61
+ /** Runs whose records still read `running` while no claim binds them — a process that stopped without ending them. They start
62
+ * no further step. */
63
+ readonly unclaimedRunning?: readonly string[];
64
+ /** The journal store keeps no stop (it has no `stopResumeClaim`): what runs here was cancelled and the cards withdrawn, but a
65
+ * later continuation of the workflow is not refused. */
66
+ readonly durable?: false;
67
+ } | {
68
+ readonly answer: "partial";
69
+ readonly stoppedKeys: readonly string[];
70
+ readonly notStoppedKeys: readonly string[];
71
+ readonly heldBy?: string;
72
+ } | {
73
+ readonly answer: "not_local";
74
+ readonly holder?: string;
75
+ } | {
76
+ readonly answer: "park_resume_won";
77
+ readonly holder?: string;
78
+ } | {
79
+ readonly answer: "not_found";
80
+ };
81
+ /** The longest stopper word a stop takes (it is written on the journal: the member's stopped arm, the tree's tombstone). */
82
+ export declare const MAX_WORKFLOW_STOPPER_CHARS = 256;
83
+ /** The one reading of a stop's `stoppedBy` (a member's stop and a whole workflow's): absent ⇒ `parent`; anything but a non-blank string
84
+ * of at most {@link MAX_WORKFLOW_STOPPER_CHARS} characters is refused loudly (`TypeError`, naming `door`). */
85
+ export declare function readWorkflowStopper(by: unknown, door: string): string;
86
+ /**
87
+ * A run this process runs, as a stop reaches it. A run id names a run within one set of stores only (another set of stores may hold a
88
+ * run of the same id), so a stop reaches a run of this process by its record: the record the stop read under that id must be the run's
89
+ * own — the same creation ({@link workflowRunCreationIdOf}) — and never by the id alone; the run whose handle stops is reached by that
90
+ * handle.
91
+ */
92
+ export interface LocalWorkflowRun {
93
+ readonly runId: string;
94
+ /** The creation of the run's own record (`undefined` while it has none). */
95
+ readonly creationId: () => string | undefined;
96
+ readonly cancel: (reason: string) => void;
97
+ readonly done: Promise<unknown>;
98
+ /** The handle the run's caller holds (a stop marks it: {@link workflowStopOf}). */
99
+ readonly handle: object;
100
+ }
101
+ /** Hold `run` as a run of this process until its `done` settles (a stop of its tree cancels it there). */
102
+ export declare function holdLocalWorkflowRun(run: LocalWorkflowRun): void;
103
+ /** A resume claim this process was granted for `holder` (and whether it carries a person's decision) — until {@link dropLocalClaimHolder}. */
104
+ export declare function noteLocalClaimHolder(holder: string, carriesDecision: boolean): void;
105
+ export declare function dropLocalClaimHolder(holder: string): void;
106
+ /** The stopper of a durable stop that ended the run behind `handle` (its tree is stopped: no continuation of it is offered), if any. */
107
+ export declare function workflowStopOf(handle: object): string | undefined;
108
+ /** What a stop reads and writes through. */
109
+ export interface WorkflowStopSeats {
110
+ readonly runStore?: WorkflowRunStore;
111
+ readonly journalStore?: WorkflowJournalStore;
112
+ readonly checkpointStore?: CheckpointStore;
113
+ }
114
+ /** A stop's reading of the tree: `self` — the stopped run's own live record (read in place of the store's copy); `own` — the run whose
115
+ * handle stops it (reached by that identity, whatever its id names elsewhere); `keysWithoutTree` — the keys when no run store is given
116
+ * (the run's own claim keys). */
117
+ export interface WorkflowStopFrame {
118
+ readonly self?: WorkflowRun;
119
+ readonly own?: LocalWorkflowRun;
120
+ readonly keysWithoutTree?: readonly string[];
121
+ }
122
+ /**
123
+ * Stop the workflow `runId` belongs to, in `scope`, as `stoppedBy` (already read: {@link readWorkflowStopper}). The caller judged the
124
+ * caller's access before calling (no tree is read and nothing is written for a caller who may not see the run). A run store read that
125
+ * fails rejects before anything is written; once a tombstone is written, every later read that fails is reported in the receipt, never
126
+ * thrown.
127
+ */
128
+ export declare function stopWorkflowTree(runId: string, scope: string, stoppedBy: string, seats: WorkflowStopSeats, frame?: WorkflowStopFrame): Promise<WorkflowRunStopReceipt>;
@@ -0,0 +1,156 @@
1
+ import { workflowRunCreationIdOf } from "../core/workflow-run-store.js";
2
+ import { WORKFLOW_STORE_WAIT_BOUND_MS } from "./workflow-types.js";
3
+ import { boundedStoreRead, isAnswerRecordClaimHolder, parkBindingFault, readWorkflowRunTreeWithin, workflowClaimKeysOf, WORKFLOW_TREE_OVER_BOUND_REASON } from "./workflow-park-adoption.js";
4
+ export const WORKFLOW_RUN_STOP_ANSWERS = Object.freeze(["stopped", "not_found", "not_local", "park_resume_won", "partial"]);
5
+ export const MAX_WORKFLOW_STOPPER_CHARS = 256;
6
+ export function readWorkflowStopper(by, door) {
7
+ if (by === undefined)
8
+ return "parent";
9
+ if (typeof by !== "string" || by.trim() === "" || by.length > MAX_WORKFLOW_STOPPER_CHARS)
10
+ throw new TypeError(`${door}: stoppedBy must be a non-empty string of at most ${MAX_WORKFLOW_STOPPER_CHARS} characters`);
11
+ return by;
12
+ }
13
+ const localRuns = new Set();
14
+ const localClaimHolders = new Map();
15
+ const stoppedHandles = new WeakMap();
16
+ export function holdLocalWorkflowRun(run) {
17
+ localRuns.add(run);
18
+ const drop = () => void localRuns.delete(run);
19
+ void run.done.then(drop, drop);
20
+ }
21
+ function localRunOf(record) {
22
+ const creation = workflowRunCreationIdOf(record);
23
+ return creation === null ? undefined : [...localRuns].find((r) => r.runId === record.id && r.creationId() === creation);
24
+ }
25
+ export function noteLocalClaimHolder(holder, carriesDecision) {
26
+ localClaimHolders.set(holder, carriesDecision || localClaimHolders.get(holder) === true);
27
+ }
28
+ export function dropLocalClaimHolder(holder) {
29
+ localClaimHolders.delete(holder);
30
+ }
31
+ export function workflowStopOf(handle) {
32
+ return stoppedHandles.get(handle);
33
+ }
34
+ export async function stopWorkflowTree(runId, scope, stoppedBy, seats, frame = {}) {
35
+ const within = boundedStoreRead(WORKFLOW_STORE_WAIT_BOUND_MS);
36
+ const readTree = async () => seats.runStore === undefined ? undefined : readWorkflowRunTreeWithin(seats.runStore, runId, scope, within, frame.self);
37
+ const first = await readTree();
38
+ if (first === "over_bound")
39
+ throw new Error(`stopWorkflowRun: workflow run "${runId}" cannot be stopped — ${WORKFLOW_TREE_OVER_BOUND_REASON}`);
40
+ if (first === "unreadable")
41
+ throw new Error(`stopWorkflowRun: the records of workflow run "${runId}"'s workflow could not be read (the run store did not answer, or holds no record of it under this scope) — nothing was stopped`);
42
+ const claimKeys = first === undefined ? { keys: frame.keysWithoutTree ?? [runId], fragment: false } : workflowClaimKeysOf(first);
43
+ const fragment = claimKeys.fragment;
44
+ const keys = [...new Set([...claimKeys.keys, ...(first === undefined ? [] : first.records.map((r) => r.id))])];
45
+ const firstIds = new Set(first === undefined ? [runId] : first.records.map((r) => r.id));
46
+ const journal = seats.journalStore;
47
+ const durable = typeof journal?.stopResumeClaim === "function";
48
+ const live = (r) => (r !== undefined && localRuns.has(r) ? r : undefined);
49
+ const runHere = (holder) => {
50
+ if (frame.own?.runId === holder)
51
+ return live(frame.own);
52
+ const record = first === undefined ? undefined : first.records.find((r) => r.id === holder);
53
+ return record === undefined ? undefined : localRunOf(record);
54
+ };
55
+ const turned = new Set();
56
+ if (durable) {
57
+ const written = [];
58
+ for (const [i, key] of keys.entries()) {
59
+ let answer;
60
+ try {
61
+ answer = await journal.stopResumeClaim({ sourceRunId: key, scope, stoppedBy });
62
+ const heldBy = answer.stopped ? undefined : answer.holder;
63
+ const holding = heldBy !== undefined ? runHere(heldBy) : undefined;
64
+ const claimOnly = heldBy !== undefined && localClaimHolders.get(heldBy) === false && ![...localRuns].some((r) => r.runId === heldBy);
65
+ if (heldBy !== undefined && (holding !== undefined || claimOnly)) {
66
+ const holder = heldBy;
67
+ answer = await journal.stopResumeClaim({ sourceRunId: key, scope, stoppedBy, holder });
68
+ if (answer.stopped && holding !== undefined)
69
+ turned.add(holding);
70
+ }
71
+ }
72
+ catch (err) {
73
+ if (i === 0)
74
+ throw err;
75
+ return { answer: "partial", stoppedKeys: written, notStoppedKeys: keys.slice(i) };
76
+ }
77
+ if (!answer.stopped) {
78
+ const holder = answer.holder !== undefined && !isAnswerRecordClaimHolder(answer.holder) ? { holder: answer.holder } : {};
79
+ if (i > 0)
80
+ return { answer: "partial", stoppedKeys: written, notStoppedKeys: keys.slice(i), ...(holder.holder !== undefined ? { heldBy: holder.holder } : {}) };
81
+ return answer.holder !== undefined && localClaimHolders.get(answer.holder) === true ? { answer: "park_resume_won", ...holder } : { answer: "not_local", ...holder };
82
+ }
83
+ written.push(key);
84
+ }
85
+ }
86
+ const byRecord = first === undefined ? [] : first.records.map(localRunOf);
87
+ const ours = [...new Set([live(frame.own), ...byRecord, ...turned].filter((r) => r !== undefined))];
88
+ for (const run of ours) {
89
+ if (durable)
90
+ stoppedHandles.set(run.handle, stoppedBy);
91
+ run.cancel(`workflow stopped by ${stoppedBy}`);
92
+ }
93
+ await within(Promise.allSettled(ours.map((r) => r.done)));
94
+ const second = first === undefined ? undefined : await readTree();
95
+ const tree = typeof second === "object" ? second : typeof first === "object" ? first : undefined;
96
+ const continuedBefore = typeof second === "object" ? second.records.map((r) => r.id).filter((id) => !firstIds.has(id)) : [];
97
+ const { left: cardsLeft, unbound: cardsUnbound } = await withdrawCards(tree, seats.checkpointStore, within);
98
+ const unclaimedRunning = durable && tree !== undefined ? tree.records.filter((r) => r.status === "running" && localRunOf(r) === undefined).map((r) => r.id) : [];
99
+ return {
100
+ answer: "stopped",
101
+ stoppedBy,
102
+ cardsLeft,
103
+ ...(cardsUnbound > 0 ? { cardsUnbound } : {}),
104
+ ...(continuedBefore.length > 0 ? { continuedBefore } : {}),
105
+ ...(fragment ? { fragment: true } : {}),
106
+ ...(unclaimedRunning.length > 0 ? { unclaimedRunning } : {}),
107
+ ...(durable ? {} : { durable: false }),
108
+ };
109
+ }
110
+ async function withdrawCards(tree, cp, within) {
111
+ if (tree === undefined)
112
+ return { left: 0, unbound: 0 };
113
+ const sessions = new Map();
114
+ const name = (token, sessionId) => {
115
+ if (typeof token !== "string" || token === "")
116
+ return;
117
+ const s = sessions.get(token) ?? new Set();
118
+ s.add(typeof sessionId === "string" ? sessionId : "");
119
+ sessions.set(token, s);
120
+ };
121
+ for (const r of tree.records) {
122
+ if (Array.isArray(r.parks))
123
+ for (const p of r.parks)
124
+ name(p.token, p.sessionId);
125
+ else
126
+ for (const a of r.agents)
127
+ if (a.status === "parked")
128
+ name(a.parkedCheckpointToken, a.sessionId);
129
+ }
130
+ if (cp === undefined)
131
+ return { left: sessions.size, unbound: 0 };
132
+ let left = 0;
133
+ let unbound = 0;
134
+ for (const [raw, named] of sessions) {
135
+ const token = raw;
136
+ const row = await within(Promise.resolve().then(() => cp.get(token)));
137
+ if (!row.ok) {
138
+ left += 1;
139
+ continue;
140
+ }
141
+ if (row.value === null || row.value.status !== "pending")
142
+ continue;
143
+ const value = row.value;
144
+ if ([...named].some((sessionId) => parkBindingFault({ token: raw, sessionId }, value) !== undefined)) {
145
+ unbound += 1;
146
+ continue;
147
+ }
148
+ const expired = await within(Promise.resolve().then(() => cp.expire(token, value.scope)));
149
+ if (expired.ok && expired.value)
150
+ continue;
151
+ const after = await within(Promise.resolve().then(() => cp.get(token)));
152
+ if (!after.ok || (after.value !== null && after.value.status === "pending"))
153
+ left += 1;
154
+ }
155
+ return { left, unbound };
156
+ }
@@ -8,6 +8,7 @@ import { type WorkflowRunStore } from "../core/workflow-run-store.js";
8
8
  import type { WorkflowJournalStore, WorkflowLaunchRecord, ResumeClaimArgs } from "../core/workflow-journal-store.js";
9
9
  import { type WorkflowAgentResult } from "./workflow-types.js";
10
10
  import { type WorkflowClaimLapse } from "./workflow-park-adoption.js";
11
+ import { type WorkflowRunStopReceipt } from "./workflow-stop.js";
11
12
  import type { WorkflowRun, WorkflowEvent, WorkflowAgentStopReceipt } from "./workflow-types.js";
12
13
  import { type TaskArtifactSeat } from "../core/tool-result-store.js";
13
14
  export * from "./workflow-types.js";
@@ -32,6 +33,10 @@ export interface WorkflowAgentTypeLaunch {
32
33
  * (`RunInternals.spawnAgentType`). Absent for the default workflow subagent, however the script asked for it (no type, or
33
34
  * `"general-purpose"`, its alias in this lane): one subagent, one identity. */
34
35
  readonly agentType?: string;
36
+ /** Definition MCP entries shadowed by servers already on the child spec (`name_already_mounted`). */
37
+ readonly droppedMcp?: ReadonlyArray<{
38
+ readonly name: string;
39
+ }>;
35
40
  }
36
41
  /**
37
42
  * F4 agentType: resolve `opts.agentType` against the registry
@@ -115,7 +120,7 @@ export interface WorkflowFanOutOptions {
115
120
  errors?: WorkflowFanOutSlotError[];
116
121
  }
117
122
  /** design/98 §D.6 hard cap: thrown when the script's returned result exceeds `maxResultChars` (a runaway
118
- * script must not return an unbounded payload to the originator). */
123
+ * script must not return an unbounded payload to the originator). `size` is the serialized length, `Infinity` when the result cannot be serialized. */
119
124
  export declare class WorkflowResultTooLargeError extends Error {
120
125
  readonly size: number;
121
126
  readonly max: number;
@@ -159,9 +164,10 @@ export interface WorkflowInternals {
159
164
  * definitions' servers, its registry's servers, what the tools it hands its agents carry — from this call until it can start no agent (it has ended and none
160
165
  * of its calls is in flight). Looked up by identity: an object the engine did not mint carries nothing. */
161
166
  launchingTool?: object;
162
- /** The workflow's resume claim the launching Workflow tool already holds for this run (the root of its tree, as the tool walked to
163
- * it before the run existed): the run's admission takes the claim under this same key, and refuses the resume when its own walk
164
- * reaches another root — a resume holds one claim key. */
167
+ /** The workflow's resume claim the launching Workflow tool already holds for this run: the first of its keys (the root of its tree,
168
+ * as the tool walked to it before the run existed). The run's admission takes the claim under this same key, re-takes the tree's
169
+ * other key once it reads the tree under it, and refuses the resume when that tree reaches another root — a resume holds one set
170
+ * of keys, the tree's. */
165
171
  resumeClaimKey?: string;
166
172
  /** The run the model named, when the launching Workflow tool continues the last run of that run's line instead (`resume.asked`). */
167
173
  resumeAsked?: string;
@@ -736,11 +742,19 @@ export interface WorkflowHandle<T> {
736
742
  * stop ended it, and a resume runs it again as for every member a run's cancel ended; a member that outlived the run, stopped
737
743
  * after the run's journal was sealed (once `done` has settled), answers `already_terminal` — not stopped, and a resume runs it
738
744
  * again. The answers: {@link WORKFLOW_AGENT_STOP_ANSWERS}. Stopping the whole run — one that waits on an approval included — is
739
- * not this method's.
745
+ * {@link stop}.
740
746
  * Optional, like {@link parked}: a handle a host assembles itself need not answer. */
741
747
  stopAgent?(callKey: string, opts?: {
742
748
  stoppedBy?: string;
743
749
  }): Promise<WorkflowAgentStopReceipt>;
750
+ /** #5291 — stop the WORKFLOW this run belongs to, for good (`stoppedBy` defaults to `parent`): a tombstone is written on its tree's
751
+ * claim (on the run's journal store), its runs in this process are cancelled, and every approval card of it still waiting is
752
+ * withdrawn — no run of it starts another step, whichever process continues it (a continuation is refused, `workflow_stopped`).
753
+ * `cancel()` (and TaskStop) only cancels this run: it can be continued. The answers: {@link WorkflowRunStopReceipt}. Optional,
754
+ * like {@link parked}. */
755
+ stop?(opts?: {
756
+ stoppedBy?: string;
757
+ }): Promise<WorkflowRunStopReceipt>;
744
758
  /** #4851 — whether the run's record landed in its run store: `true` once the store took the create (or when no run store is
745
759
  * wired: there is no record to land), `false` when it refused it or did not answer within the store wait. What is kept by the
746
760
  * run's id and found through its record — the launch record, a copy of the script — is written only after `true`. Optional: a
@@ -842,6 +856,10 @@ export interface WorkflowResumeClaimVerdict {
842
856
  /** On a refusal by the store: the remaining time it answered, read once as the refusal arrived ({@link claimRemainingOf}) — what
843
857
  * every refusal sentence names of when the claim lapses. */
844
858
  readonly lapse?: WorkflowClaimLapse;
859
+ /** On a refusal because the workflow was stopped (the store's `ResumeClaimAnswer.stopped`): who stopped it. */
860
+ readonly stopped?: {
861
+ readonly by: string;
862
+ };
845
863
  readonly fallback: boolean;
846
864
  }
847
865
  /**
@@ -849,9 +867,15 @@ export interface WorkflowResumeClaimVerdict {
849
867
  * authoritative and the only gate that sees another process), else {@link workflowResumeClaimFallback}. The one taking of the
850
868
  * claim: a resume's admission takes it here, and the engine's continuation of a parked run takes it here BEFORE it starts the
851
869
  * run (a claim it loses starts nothing); the run's own admission then re-takes it, which the contract grants to the same holder.
852
- * A store that throws rejects (a store failure is not a refusal).
870
+ * A store that throws rejects (a store failure is not a refusal). A grant is noted as this process's (`carriesDecision`: taken for a
871
+ * continuation carrying a person's decision) until its release — what a stop of the workflow reads of this process.
853
872
  */
854
- export declare function takeWorkflowResumeClaim(store: WorkflowJournalStore, input: ResumeClaimArgs): Promise<WorkflowResumeClaimVerdict>;
873
+ export declare function takeWorkflowResumeClaim(store: WorkflowJournalStore, input: ResumeClaimArgs, carriesDecision?: boolean): Promise<WorkflowResumeClaimVerdict>;
874
+ /** Take the claim under every key of `keys` in order (the root first: {@link workflowClaimKeysOf}) for `newRunId`: granted only when
875
+ * every key is; the first key refused (or a store that throws) gives back the keys already taken and answers that refusal. */
876
+ export declare function takeWorkflowResumeClaims(store: WorkflowJournalStore, keys: readonly string[], newRunId: string, scope: string, carriesDecision?: boolean): Promise<WorkflowResumeClaimVerdict>;
877
+ /** Release every key {@link takeWorkflowResumeClaims} granted (never throws). */
878
+ export declare function releaseWorkflowResumeClaims(store: WorkflowJournalStore, keys: readonly string[], newRunId: string, scope: string, fallback: boolean): Promise<void>;
855
879
  /** Release a claim {@link takeWorkflowResumeClaim} granted, through the gate that granted it. Never throws; the store's own TTL is
856
880
  * the backstop for a release that fails (a fallback release is a synchronous in-process write). */
857
881
  export declare function releaseWorkflowResumeClaim(store: WorkflowJournalStore, input: ResumeClaimArgs, fallback: boolean): Promise<void>;