@sema-agent/core 7.70.0 → 7.71.1

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 (439) hide show
  1. package/CHANGELOG.md +740 -0
  2. package/dist/agents/agent-transcript-tool.js +43 -19
  3. package/dist/agents/inherited-tool-pool.d.ts +5 -1
  4. package/dist/agents/inherited-tool-pool.js +6 -0
  5. package/dist/agents/retain-ledger.js +2 -0
  6. package/dist/agents/send-message-tool.d.ts +12 -1
  7. package/dist/agents/send-message-tool.js +47 -9
  8. package/dist/agents/subagent.js +31 -10
  9. package/dist/agents/tool-filter.js +1 -2
  10. package/dist/agents/verify.js +13 -2
  11. package/dist/agents/yield-adoption.js +11 -1
  12. package/dist/brain/claude-model-id.d.ts +11 -0
  13. package/dist/brain/claude-model-id.js +3 -1
  14. package/dist/config/catalog.js +10 -1
  15. package/dist/config/defaults.d.ts +3 -0
  16. package/dist/config/defaults.js +1 -0
  17. package/dist/core/allow-entry.js +1 -2
  18. package/dist/core/ask-origin.d.ts +55 -21
  19. package/dist/core/ask-origin.js +19 -11
  20. package/dist/core/ask-question.d.ts +4 -7
  21. package/dist/core/ask-question.js +2 -4
  22. package/dist/core/ask-unresolvable-notice.d.ts +17 -3
  23. package/dist/core/ask-unresolvable-notice.js +18 -4
  24. package/dist/core/attachment-source.d.ts +1 -1
  25. package/dist/core/attachment-source.js +2 -0
  26. package/dist/core/auto-compaction.d.ts +14 -4
  27. package/dist/core/auto-compaction.js +3 -2
  28. package/dist/core/auto-strip.js +2 -0
  29. package/dist/core/caller-text.d.ts +2 -33
  30. package/dist/core/caller-text.js +2 -23
  31. package/dist/core/caller-tool-name.js +1 -2
  32. package/dist/core/canonical-json.d.ts +9 -0
  33. package/dist/core/canonical-json.js +6 -0
  34. package/dist/core/checkpoint-features.d.ts +43 -80
  35. package/dist/core/checkpoint-features.js +10 -20
  36. package/dist/core/checkpoint-generation.d.ts +89 -19
  37. package/dist/core/checkpoint-generation.js +89 -14
  38. package/dist/core/checkpoint-queries.d.ts +95 -15
  39. package/dist/core/checkpoint-queries.js +108 -7
  40. package/dist/core/checkpoint-rekey.d.ts +2 -1
  41. package/dist/core/checkpoint-rekey.js +2 -2
  42. package/dist/core/checkpoint-requirements.d.ts +21 -7
  43. package/dist/core/checkpoint-requirements.js +2 -5
  44. package/dist/core/checkpoint-row-verdict.d.ts +3 -4
  45. package/dist/core/checkpoint-row-verdict.js +20 -41
  46. package/dist/core/checkpoint-store.d.ts +69 -41
  47. package/dist/core/checkpoint-store.js +28 -14
  48. package/dist/core/command-sandbox.d.ts +5 -3
  49. package/dist/core/command-sandbox.js +17 -9
  50. package/dist/core/config-refusal-codes.d.ts +1 -1
  51. package/dist/core/config-refusal-codes.js +1 -0
  52. package/dist/core/declaration-words.d.ts +2 -1
  53. package/dist/core/declaration-words.js +13 -2
  54. package/dist/core/effective-path-target.d.ts +23 -0
  55. package/dist/core/effective-path-target.js +15 -1
  56. package/dist/core/engine-attestation.d.ts +5 -1
  57. package/dist/core/engine-attestation.js +1 -0
  58. package/dist/core/engine-capabilities.d.ts +14 -9
  59. package/dist/core/engine-capabilities.js +1 -1
  60. package/dist/core/engine-notice.d.ts +62 -32
  61. package/dist/core/engine-version.js +1 -1
  62. package/dist/core/entries-not-applied.d.ts +1 -1
  63. package/dist/core/entries-not-applied.js +1 -0
  64. package/dist/core/file-history-store.d.ts +95 -11
  65. package/dist/core/file-history-store.js +117 -19
  66. package/dist/core/gate-fold.js +13 -7
  67. package/dist/core/gate-lanes.js +9 -9
  68. package/dist/core/governance-codes.d.ts +56 -7
  69. package/dist/core/governance-codes.js +105 -7
  70. package/dist/core/grant-holder.d.ts +53 -0
  71. package/dist/core/grant-holder.js +80 -0
  72. package/dist/core/hooks.d.ts +7 -3
  73. package/dist/core/hooks.js +2 -2
  74. package/dist/core/locked-config.d.ts +7 -1
  75. package/dist/core/locked-config.js +9 -2
  76. package/dist/core/mcp-call-meta.d.ts +52 -7
  77. package/dist/core/mcp-call-meta.js +21 -2
  78. package/dist/core/mcp-host-read.d.ts +1 -1
  79. package/dist/core/mcp-server-spec.d.ts +18 -0
  80. package/dist/core/mcp-server-spec.js +1 -0
  81. package/dist/core/mcp.js +2 -2
  82. package/dist/core/member-outcome.d.ts +22 -1
  83. package/dist/core/member-outcome.js +18 -6
  84. package/dist/core/memory-engine/delegation-settlement.js +5 -5
  85. package/dist/core/memory-engine/engine.js +19 -19
  86. package/dist/core/memory-engine/file-backend.d.ts +7 -2
  87. package/dist/core/memory-engine/file-backend.js +14 -12
  88. package/dist/core/memory-engine/frontmatter.js +1 -1
  89. package/dist/core/memory-engine/index.d.ts +1 -0
  90. package/dist/core/memory-engine/index.js +1 -0
  91. package/dist/core/memory-engine/layout.d.ts +34 -9
  92. package/dist/core/memory-engine/layout.js +36 -19
  93. package/dist/core/memory-engine/memory-deployment.js +8 -8
  94. package/dist/core/memory-engine/mount-failed-notice.d.ts +8 -5
  95. package/dist/core/memory-engine/mount-failed-notice.js +5 -2
  96. package/dist/core/mode-policy.d.ts +5 -0
  97. package/dist/core/mode-policy.js +6 -0
  98. package/dist/core/mods/host.d.ts +2 -1
  99. package/dist/core/mods/host.js +7 -6
  100. package/dist/core/mods/kernel/index.d.ts +1 -1
  101. package/dist/core/mods/kernel/index.js +1 -1
  102. package/dist/core/mods/kernel/registration.d.ts +5 -2
  103. package/dist/core/mods/kernel/registration.js +19 -3
  104. package/dist/core/mods/package.d.ts +12 -1
  105. package/dist/core/mods/package.js +36 -9
  106. package/dist/core/mods/stations.d.ts +7 -1
  107. package/dist/core/mods/stations.js +17 -3
  108. package/dist/core/mods/teammate-stations.d.ts +4 -1
  109. package/dist/core/mods/teammate-stations.js +1 -1
  110. package/dist/core/native-signal.d.ts +13 -0
  111. package/dist/core/native-signal.js +18 -0
  112. package/dist/core/park-resumability.d.ts +16 -14
  113. package/dist/core/park-resumability.js +9 -4
  114. package/dist/core/path-rule-binding.js +1 -1
  115. package/dist/core/permission-rule-model.d.ts +11 -5
  116. package/dist/core/permission-rule-model.js +5 -3
  117. package/dist/core/permission-rule-org.js +1 -1
  118. package/dist/core/permission-rule-provider.d.ts +5 -1
  119. package/dist/core/permission-rule-provider.js +6 -1
  120. package/dist/core/permission-rule-session.d.ts +35 -5
  121. package/dist/core/permission-rule-session.js +32 -1
  122. package/dist/core/permission-rule-store.d.ts +5 -1
  123. package/dist/core/permission-rule-store.js +28 -5
  124. package/dist/core/permission-rules.d.ts +2 -2
  125. package/dist/core/permission-rules.js +2 -3
  126. package/dist/core/principal-name.d.ts +12 -0
  127. package/dist/core/principal-name.js +6 -2
  128. package/dist/core/read-root-grant-screen.d.ts +7 -6
  129. package/dist/core/read-root-grant-screen.js +7 -8
  130. package/dist/core/remote-env.d.ts +42 -8
  131. package/dist/core/resume-config-judge.js +1 -1
  132. package/dist/core/resume-startup-cause.d.ts +19 -4
  133. package/dist/core/resume-startup-cause.js +25 -6
  134. package/dist/core/rewind-conversation.d.ts +4 -0
  135. package/dist/core/rewrite-rejudge.d.ts +9 -1
  136. package/dist/core/rewrite-rejudge.js +11 -1
  137. package/dist/core/rule-offer-read.js +3 -2
  138. package/dist/core/runner/assemble-result.d.ts +21 -11
  139. package/dist/core/runner/assemble-result.js +24 -4
  140. package/dist/core/runner/boundary-reminders.d.ts +104 -0
  141. package/dist/core/runner/boundary-reminders.js +108 -0
  142. package/dist/core/runner/branch-writeback.d.ts +21 -7
  143. package/dist/core/runner/branch-writeback.js +44 -6
  144. package/dist/core/runner/command-sandbox-frame.js +2 -1
  145. package/dist/core/runner/compact-session.js +11 -4
  146. package/dist/core/runner/constraint-layers.d.ts +24 -5
  147. package/dist/core/runner/constraint-layers.js +21 -2
  148. package/dist/core/runner/continuation-gate.js +3 -1
  149. package/dist/core/runner/contracts.d.ts +83 -13
  150. package/dist/core/runner/cross-boundary-lane.js +2 -1
  151. package/dist/core/runner/delegation-owner.d.ts +246 -45
  152. package/dist/core/runner/delegation-owner.js +237 -63
  153. package/dist/core/runner/expire-settle.d.ts +17 -0
  154. package/dist/core/runner/expire-settle.js +8 -2
  155. package/dist/core/runner/file-history-request.d.ts +4 -3
  156. package/dist/core/runner/file-history-request.js +4 -1
  157. package/dist/core/runner/file-history-restore.d.ts +11 -3
  158. package/dist/core/runner/file-history-restore.js +11 -3
  159. package/dist/core/runner/gate-exit.d.ts +22 -1
  160. package/dist/core/runner/gate-exit.js +12 -14
  161. package/dist/core/runner/nested-memory-content.js +1 -1
  162. package/dist/core/runner/nested-memory-lane.d.ts +10 -2
  163. package/dist/core/runner/nested-memory-lane.js +29 -8
  164. package/dist/core/runner/own-model-money-door.d.ts +13 -0
  165. package/dist/core/runner/own-model-money-door.js +17 -0
  166. package/dist/core/runner/park-commit.d.ts +4 -2
  167. package/dist/core/runner/park-commit.js +2 -1
  168. package/dist/core/runner/permission-rule-lanes.d.ts +4 -0
  169. package/dist/core/runner/permission-rule-lanes.js +7 -0
  170. package/dist/core/runner/person-path-rows.js +1 -1
  171. package/dist/core/runner/placement-fence.d.ts +8 -2
  172. package/dist/core/runner/placement-fence.js +8 -3
  173. package/dist/core/runner/policy-throw.d.ts +3 -2
  174. package/dist/core/runner/policy-throw.js +2 -2
  175. package/dist/core/runner/prepare-acquire-reconcile.d.ts +23 -14
  176. package/dist/core/runner/prepare-acquire-reconcile.js +33 -15
  177. package/dist/core/runner/prepare-artifact.d.ts +14 -1
  178. package/dist/core/runner/prepare-artifact.js +7 -2
  179. package/dist/core/runner/prepare-ask-lane.d.ts +8 -0
  180. package/dist/core/runner/prepare-ask-lane.js +14 -5
  181. package/dist/core/runner/prepare-boundary-parks.js +5 -4
  182. package/dist/core/runner/prepare-config-doors.d.ts +9 -4
  183. package/dist/core/runner/prepare-config-doors.js +25 -8
  184. package/dist/core/runner/prepare-defer-classify.d.ts +8 -4
  185. package/dist/core/runner/prepare-defer-classify.js +6 -6
  186. package/dist/core/runner/prepare-execution-env.d.ts +4 -1
  187. package/dist/core/runner/prepare-execution-env.js +8 -3
  188. package/dist/core/runner/prepare-file-history.d.ts +26 -0
  189. package/dist/core/runner/prepare-file-history.js +15 -1
  190. package/dist/core/runner/prepare-inherited-gate.d.ts +8 -3
  191. package/dist/core/runner/prepare-inherited-gate.js +9 -2
  192. package/dist/core/runner/prepare-leg-adoption.d.ts +2 -2
  193. package/dist/core/runner/prepare-park-ask.js +8 -5
  194. package/dist/core/runner/prepare-policy-chain.d.ts +5 -0
  195. package/dist/core/runner/prepare-policy-chain.js +18 -7
  196. package/dist/core/runner/prepare-prompt-assembly.d.ts +3 -0
  197. package/dist/core/runner/prepare-prompt-assembly.js +4 -3
  198. package/dist/core/runner/prepare-suspend-saga.d.ts +4 -1
  199. package/dist/core/runner/prepare-suspend-saga.js +19 -5
  200. package/dist/core/runner/prepare-task.d.ts +2 -5
  201. package/dist/core/runner/prepare-task.js +71 -26
  202. package/dist/core/runner/prepare-turn-wiring.js +7 -5
  203. package/dist/core/runner/prepare-workspace-restore.js +59 -28
  204. package/dist/core/runner/read-root-grant.d.ts +1 -0
  205. package/dist/core/runner/read-root-grant.js +1 -2
  206. package/dist/core/runner/resume-admission.d.ts +3 -0
  207. package/dist/core/runner/resume-admission.js +6 -4
  208. package/dist/core/runner/resume-apply.js +7 -5
  209. package/dist/core/runner/resume-claim.d.ts +2 -2
  210. package/dist/core/runner/resume-claim.js +4 -4
  211. package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
  212. package/dist/core/runner/resume-policy-outcome.js +6 -4
  213. package/dist/core/runner/resume-preflight.d.ts +3 -0
  214. package/dist/core/runner/resume-preflight.js +10 -3
  215. package/dist/core/runner/rewind-conversation.js +11 -4
  216. package/dist/core/runner/rewind-files.js +29 -14
  217. package/dist/core/runner/rewind-outcome.d.ts +27 -0
  218. package/dist/core/runner/rewind-outcome.js +14 -0
  219. package/dist/core/runner/run-attachment-seats.js +2 -1
  220. package/dist/core/runner/run-clock-and-content.js +2 -0
  221. package/dist/core/runner/run-identity-wiring.js +2 -0
  222. package/dist/core/runner/run-leg.js +11 -1
  223. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  224. package/dist/core/runner/run-notification-lane.js +2 -2
  225. package/dist/core/runner/run-settle-and-teardown.d.ts +4 -2
  226. package/dist/core/runner/run-settle-and-teardown.js +52 -40
  227. package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
  228. package/dist/core/runner/run-stop-and-final-verify.js +5 -4
  229. package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
  230. package/dist/core/runner/run-terminal-adoption.js +3 -3
  231. package/dist/core/runner/run-turn-boundary.js +7 -0
  232. package/dist/core/runner/runtask.d.ts +7 -4
  233. package/dist/core/runner/runtask.js +18 -9
  234. package/dist/core/runner/session-call-grant-station.d.ts +64 -0
  235. package/dist/core/runner/session-call-grant-station.js +119 -0
  236. package/dist/core/runner/session-file-state-replay.js +2 -2
  237. package/dist/core/runner/session-prompt-seats.d.ts +95 -0
  238. package/dist/core/runner/session-prompt-seats.js +62 -0
  239. package/dist/core/runner/session-rule-policy.js +1 -1
  240. package/dist/core/runner/session-write-ledger.d.ts +8 -0
  241. package/dist/core/runner/session-write-ledger.js +16 -0
  242. package/dist/core/runner/side-call-account.js +5 -1
  243. package/dist/core/runner/stop-tail-notice.d.ts +7 -0
  244. package/dist/core/runner/stop-tail-notice.js +23 -8
  245. package/dist/core/runner/stream-reap.js +4 -2
  246. package/dist/core/runner/stream-settle-backstop.d.ts +1 -1
  247. package/dist/core/runner/stream-settle-backstop.js +17 -18
  248. package/dist/core/runner/terminal-account.js +17 -8
  249. package/dist/core/runner/terminal-projection.d.ts +3 -2
  250. package/dist/core/runner/terminal-projection.js +1 -1
  251. package/dist/core/runner/tool-turn-repair-seat.d.ts +2 -2
  252. package/dist/core/runner/tool-turn-repair-seat.js +12 -7
  253. package/dist/core/runner/turn-attachments.d.ts +22 -1
  254. package/dist/core/runner/turn-attachments.js +20 -3
  255. package/dist/core/runner-deps.d.ts +6 -2
  256. package/dist/core/secret-env.d.ts +26 -6
  257. package/dist/core/secret-env.js +6 -6
  258. package/dist/core/session-call-grant-screen.d.ts +58 -0
  259. package/dist/core/session-call-grant-screen.js +18 -0
  260. package/dist/core/session-call-grant.d.ts +93 -0
  261. package/dist/core/session-call-grant.js +524 -0
  262. package/dist/core/session-checkout.d.ts +3 -0
  263. package/dist/core/session-checkout.js +8 -3
  264. package/dist/core/session-policy-store.d.ts +14 -0
  265. package/dist/core/session-policy-store.js +16 -2
  266. package/dist/core/session-store.d.ts +18 -1
  267. package/dist/core/session-store.js +20 -4
  268. package/dist/core/session.d.ts +36 -4
  269. package/dist/core/shared-artifact-reads.d.ts +93 -0
  270. package/dist/core/shared-artifact-reads.js +94 -0
  271. package/dist/core/skill-grant.js +1 -1
  272. package/dist/core/skills-directory.d.ts +9 -45
  273. package/dist/core/skills-directory.js +9 -722
  274. package/dist/core/spend-account.js +3 -0
  275. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +22 -4
  276. package/dist/core/store-contracts/checkpoint-store-contract.js +363 -29
  277. package/dist/core/store-contracts/file-history-store-contract.d.ts +11 -3
  278. package/dist/core/store-contracts/file-history-store-contract.js +62 -2
  279. package/dist/core/store-contracts/grant-fixture.d.ts +52 -0
  280. package/dist/core/store-contracts/grant-fixture.js +84 -0
  281. package/dist/core/store-contracts/session-repo-contract.js +18 -0
  282. package/dist/core/store-contracts/session-store-contract.d.ts +15 -1
  283. package/dist/core/store-contracts/session-store-contract.js +211 -2
  284. package/dist/core/store-contracts/workflow-journal-store-contract.js +47 -8
  285. package/dist/core/suspend-lane-reasons.d.ts +13 -0
  286. package/dist/core/suspend-lane-reasons.js +5 -0
  287. package/dist/core/synthetic-read-verdict.d.ts +5 -3
  288. package/dist/core/synthetic-read-verdict.js +1 -1
  289. package/dist/core/task-limits.d.ts +15 -0
  290. package/dist/core/task-notification.d.ts +33 -7
  291. package/dist/core/task-notification.js +34 -9
  292. package/dist/core/task-registry-agent.d.ts +1 -1
  293. package/dist/core/task-registry-agent.js +18 -7
  294. package/dist/core/task-registry-shared.d.ts +29 -4
  295. package/dist/core/task-registry-shared.js +7 -0
  296. package/dist/core/task-registry.d.ts +21 -1
  297. package/dist/core/task-registry.js +36 -9
  298. package/dist/core/task-result.d.ts +55 -1
  299. package/dist/core/task-spec.d.ts +17 -3
  300. package/dist/core/terminal-cause.d.ts +68 -5
  301. package/dist/core/tool-catalog-entries.js +1 -1
  302. package/dist/core/tool-check-reading.js +2 -1
  303. package/dist/core/tool-errors.js +1 -0
  304. package/dist/core/tool-list-grammar.d.ts +0 -47
  305. package/dist/core/tool-list-grammar.js +1 -75
  306. package/dist/core/tool-model-gate.d.ts +7 -11
  307. package/dist/core/tool-model-gate.js +5 -8
  308. package/dist/core/tool-name-aliases.js +2 -3
  309. package/dist/core/tool-name-readings.d.ts +4 -0
  310. package/dist/core/tool-name-readings.js +1 -0
  311. package/dist/core/tool-policy.d.ts +46 -4
  312. package/dist/core/tool-policy.js +47 -18
  313. package/dist/core/tool-result-store.d.ts +0 -24
  314. package/dist/core/tool-result-store.js +1 -36
  315. package/dist/core/tool-spec.d.ts +8 -4
  316. package/dist/core/untrusted-egress.js +2 -2
  317. package/dist/core/untrusted-text.d.ts +8 -0
  318. package/dist/core/untrusted-text.js +14 -0
  319. package/dist/core/user-attachment.d.ts +16 -1
  320. package/dist/core/user-attachment.js +42 -18
  321. package/dist/core/wiring-manifest.d.ts +4 -9
  322. package/dist/core/wiring-manifest.js +1 -1
  323. package/dist/core/workflow-journal-store.d.ts +55 -8
  324. package/dist/core/workflow-journal-store.js +34 -10
  325. package/dist/core/workflow-run-store-contract.js +56 -1
  326. package/dist/core/workflow-run-store.d.ts +43 -19
  327. package/dist/core/workflow-run-store.js +17 -2
  328. package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
  329. package/dist/engine/execution-env/node-execution-env.js +4 -0
  330. package/dist/engine/harness/agent-harness.d.ts +10 -5
  331. package/dist/engine/harness/agent-harness.js +12 -4
  332. package/dist/engine/harness/types.d.ts +18 -0
  333. package/dist/engine/llm/tool-turns.d.ts +1 -1
  334. package/dist/engine/llm/types.d.ts +5 -4
  335. package/dist/engine/session/memory-repo.d.ts +15 -3
  336. package/dist/engine/session/memory-repo.js +21 -3
  337. package/dist/engine/session/memory-storage.d.ts +5 -0
  338. package/dist/engine/session/memory-storage.js +8 -3
  339. package/dist/engine/session/repo-utils.d.ts +9 -0
  340. package/dist/engine/session/repo-utils.js +14 -0
  341. package/dist/engine/session/storage-base.d.ts +20 -7
  342. package/dist/engine/session/storage-base.js +13 -1
  343. package/dist/index.d.ts +39 -21
  344. package/dist/index.js +32 -17
  345. package/dist/internal/harness.d.ts +1 -1
  346. package/dist/internal/harness.js +1 -1
  347. package/dist/orchestration/run-workflow-tool.d.ts +13 -1
  348. package/dist/orchestration/run-workflow-tool.js +101 -32
  349. package/dist/orchestration/workflow-park-adoption.d.ts +309 -92
  350. package/dist/orchestration/workflow-park-adoption.js +588 -323
  351. package/dist/orchestration/workflow-tree-id.d.ts +66 -0
  352. package/dist/orchestration/workflow-tree-id.js +66 -0
  353. package/dist/orchestration/workflow-types.d.ts +90 -11
  354. package/dist/orchestration/workflow-types.js +10 -1
  355. package/dist/orchestration/workflow.d.ts +30 -4
  356. package/dist/orchestration/workflow.js +424 -114
  357. package/dist/prompt-assembly/catalog/constitution.js +5 -1
  358. package/dist/prompt-assembly/catalog/core-behavior.d.ts +3 -4
  359. package/dist/prompt-assembly/catalog/core-behavior.js +61 -22
  360. package/dist/prompt-assembly/catalog/environment.js +2 -2
  361. package/dist/prompt-assembly/catalog/events.d.ts +16 -0
  362. package/dist/prompt-assembly/catalog/events.js +2 -0
  363. package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.js +72 -44
  364. package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.js +2 -2
  365. package/dist/prompt-assembly/catalog/locales/zh-Hans/events.js +2 -0
  366. package/dist/prompt-assembly/catalog/schema.d.ts +5 -1
  367. package/dist/prompt-assembly/catalog/schema.js +2 -0
  368. package/dist/prompt-assembly/catalog/sections.js +3 -14
  369. package/dist/prompt-assembly/event-registry.js +2 -0
  370. package/dist/prompt-assembly/select.js +1 -0
  371. package/dist/prompt-assembly/tool-catalog.d.ts +10 -7
  372. package/dist/prompt-assembly/tool-catalog.js +21 -7
  373. package/dist/prompt-assembly/types.d.ts +3 -0
  374. package/dist/prompts/default.d.ts +4 -1
  375. package/dist/prompts/default.js +6 -0
  376. package/dist/stores/file/checkpoint-store.d.ts +11 -10
  377. package/dist/stores/file/checkpoint-store.js +36 -10
  378. package/dist/stores/file/file-history-store.d.ts +6 -0
  379. package/dist/stores/file/file-history-store.js +21 -4
  380. package/dist/stores/file/fs-atomic.d.ts +1 -1
  381. package/dist/stores/file/index.d.ts +14 -4
  382. package/dist/stores/file/index.js +21 -5
  383. package/dist/stores/file/process-anchor.d.ts +9 -1
  384. package/dist/stores/file/session-policy-store.js +2 -17
  385. package/dist/stores/file/session-store.d.ts +27 -0
  386. package/dist/stores/file/session-store.js +81 -9
  387. package/dist/stores/file/workflow-journal-store.d.ts +14 -4
  388. package/dist/stores/file/workflow-journal-store.js +32 -24
  389. package/dist/stores/file/workflow-run-store.d.ts +15 -4
  390. package/dist/stores/file/workflow-run-store.js +76 -0
  391. package/dist/tools/artifact/artifact-tool.d.ts +10 -3
  392. package/dist/tools/artifact/artifact-tool.js +16 -1
  393. package/dist/tools/fs/bash-program-position.d.ts +10 -4
  394. package/dist/tools/fs/bash-program-position.js +11 -8
  395. package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -1
  396. package/dist/tools/fs/bash-readonly-classifier.js +9 -2
  397. package/dist/tools/fs/find-actions.d.ts +30 -16
  398. package/dist/tools/fs/find-actions.js +272 -19
  399. package/dist/tools/fs/fs-bash.js +8 -5
  400. package/dist/tools/fs/fs-shared.d.ts +0 -29
  401. package/dist/tools/fs/fs-shared.js +0 -5
  402. package/dist/tools/fs/fs-write.js +2 -1
  403. package/dist/tools/fs/read-deny.d.ts +6 -1
  404. package/dist/tools/fs/read-deny.js +6 -1
  405. package/dist/tools/fs/read-floor.d.ts +6 -0
  406. package/dist/tools/fs/read-floor.js +5 -1
  407. package/dist/tools/fs/removal-actions.d.ts +43 -0
  408. package/dist/tools/fs/removal-actions.js +25 -0
  409. package/dist/tools/fs/removal-targets.d.ts +2 -21
  410. package/dist/tools/fs/removal-targets.js +2 -3
  411. package/dist/tools/fs/safety.d.ts +37 -1
  412. package/dist/tools/fs/safety.js +52 -0
  413. package/dist/tools/fs/shell-climb.d.ts +46 -0
  414. package/dist/tools/fs/shell-climb.js +79 -0
  415. package/dist/tools/fs/shell-read-check.js +47 -19
  416. package/dist/tools/fs/shell-read-establish.js +36 -22
  417. package/dist/tools/fs/shell-read-judge.d.ts +10 -2
  418. package/dist/tools/fs/shell-read-judge.js +4 -4
  419. package/dist/tools/fs/shell-read-plan.d.ts +3 -0
  420. package/dist/tools/fs/shell-read-plan.js +1 -1
  421. package/dist/tools/fs/shell-read-workdir.js +3 -2
  422. package/dist/tools/fs/shell-read-write-targets.d.ts +4 -3
  423. package/dist/tools/fs/shell-read-write-targets.js +3 -0
  424. package/package.json +2 -2
  425. package/test/export-surface.snapshot.json +173 -15
  426. package/wire-changes/core-stores-sql@7.71.0.json +40 -0
  427. package/wire-changes/core-stores-sql@7.71.1.json +40 -0
  428. package/wire-changes/core@7.71.0.json +5827 -0
  429. package/wire-changes/core@7.71.1.json +118 -0
  430. package/wire-changes/mods-kernel@7.71.0.json +52 -0
  431. package/wire-changes/mods-kernel@7.71.1.json +40 -0
  432. package/wire-changes/primitives@7.71.0.json +473 -0
  433. package/wire-changes/primitives@7.71.1.json +40 -0
  434. package/wire-changes/wiki-gate@7.71.0.json +40 -0
  435. package/wire-changes/wiki-gate@7.71.1.json +40 -0
  436. package/dist/core/frontmatter-fence.d.ts +0 -10
  437. package/dist/core/frontmatter-fence.js +0 -6
  438. package/dist/core/permission-rule-syntax.d.ts +0 -46
  439. package/dist/core/permission-rule-syntax.js +0 -52
@@ -1,5 +1,5 @@
1
1
  import type { CheckpointStore, CheckpointToken, ResumeOutcome } from "../core/checkpoint-store.js";
2
- import type { WorkflowRunStore } from "../core/workflow-run-store.js";
2
+ import { type WorkflowRunStore } from "../core/workflow-run-store.js";
3
3
  import type { WorkflowJournalStore, WorkflowLaunchRecord } from "../core/workflow-journal-store.js";
4
4
  import type { InheritedGate } from "../core/runner/contracts.js";
5
5
  import type { ToolExecuteContext } from "../core/types.js";
@@ -15,49 +15,151 @@ export interface WorkflowParkDecision {
15
15
  readonly inheritedGate?: InheritedGate;
16
16
  }
17
17
  /** Why a decision did not continue its run — the closed set `workflow.parked_decision_unused` carries as `detail.reason`. */
18
- export declare const WORKFLOW_PARK_UNUSED_REASONS: readonly ["workflow_not_mounted", "entry_unreadable", "record_unreadable", "not_holder", "not_pending", "decision_spent", "launch_unrecorded", "launch_unreadable", "host_changed", "denied", "ask_unanswerable", "launch_refused", "continuing_elsewhere", "card_unresumable", "waiting_elsewhere", "run_not_ended"];
18
+ export declare const WORKFLOW_PARK_UNUSED_REASONS: readonly ["workflow_not_mounted", "entry_unreadable", "record_unreadable", "not_holder", "not_pending", "decision_spent", "launch_unrecorded", "launch_unreadable", "host_changed", "denied", "ask_unanswerable", "call_changed", "launch_refused", "continuing_elsewhere", "card_unresumable", "waiting_elsewhere", "run_not_ended"];
19
19
  export type WorkflowParkUnusedReason = (typeof WORKFLOW_PARK_UNUSED_REASONS)[number];
20
+ /** What is left to do with a decision a reason answers (#5208): `deliverable` — the same decision stays usable, and a later hand-over of
21
+ * it is judged again; `decide_again` — only a person's new decision for the card continues the run (this one is spent, or — kept —
22
+ * the hand-over that carried it does not read, so handing the same entry over again answers the same);
23
+ * `start_over` — the run cannot be continued from this card, start the workflow again; `withdraw` — the card no longer waits, nothing
24
+ * is left to do. */
25
+ export type WorkflowParkUnusedClass = "deliverable" | "decide_again" | "start_over" | "withdraw";
26
+ /** One reason's row of {@link WORKFLOW_PARK_UNUSED_REASON_CLASS}: the class when the answer leaves the decision kept (`kept` — a later
27
+ * hand-over is judged again), the class when it spends the decision for good (`spent`), and, for a reason that does either, the member
28
+ * of the answer that spends it (`spentWhen`). */
29
+ export type WorkflowParkUnusedClassRow = {
30
+ readonly kept: WorkflowParkUnusedClass;
31
+ readonly spent?: never;
32
+ readonly spentWhen?: never;
33
+ } | {
34
+ readonly spent: WorkflowParkSpentClass;
35
+ readonly kept?: never;
36
+ readonly spentWhen?: never;
37
+ } | {
38
+ readonly kept: WorkflowParkUnusedClass;
39
+ readonly spent: WorkflowParkSpentClass;
40
+ readonly spentWhen: "terminal" | "explicit";
41
+ };
42
+ /** The classes a spent decision can have: a decision spent for good is never still deliverable, and its card still waits. */
43
+ type WorkflowParkSpentClass = Extract<WorkflowParkUnusedClass, "decide_again" | "start_over">;
20
44
  /**
21
- * The reasons that settle a decision for good — no later hand-over of it continues the run; a person decides the card again (a new
22
- * decision) or starts the workflow again, as each reason's sentence says: the decision was used once and its drive refused
23
- * (`decision_spent`); the card is one no engine release resumes (`card_unresumable` with `terminal` — only then: a card another
24
- * release reads stays deliverable to a worker of that release); the run's launch record does not read back (`launch_unreadable`);
25
- * a person, asked whether to run the Workflow call that continues it, answered no (`denied` with `explicit` — only then: a deny rule
26
- * of any layer, the deployment's policy or its approval seat, a hook, a classifier, the session's mode, a wait that ran out or was
27
- * cancelled, an approver or a policy that failed leave it deliverable). Every other reason leaves
28
- * the decision deliverable — `host_changed` among them: once what the run's agents run under is back to what it ran under, the
29
- * same decision continues the run (and a worker still on those settings can use it meanwhile). The `reason` of a `spent`
30
- * {@link workflowParkDecisionOf} reading.
45
+ * THE classification of {@link WORKFLOW_PARK_UNUSED_REASONS} (#5208): one row per word, every word filled (a word added to the set with
46
+ * no row does not compile). A reason whose row has a `spent` class spends the decision for good — no later hand-over of it continues the
47
+ * run — always (no `kept` class), or when the answer carries `spentWhen`: the card is one no engine release resumes (`card_unresumable`
48
+ * with `terminal`; a card another release reads stays deliverable to a worker of that release); a person, asked whether to run the
49
+ * Workflow call that continues it, answered no (`denied` with `explicit`; a deny rule of any layer, the deployment's policy or its
50
+ * approval seat, a hook, a classifier, the session's mode, a wait that ran out or was cancelled, an approver or a policy that failed
51
+ * leave it deliverable). Every other answer keeps the decision — `host_changed` among them: once what the run's agents run under is
52
+ * back to what it ran under, the same decision continues the run. The engine's own readings read it: whether an answer spends its
53
+ * decisions (the final mark, the frame's wording) and which words a final mark may carry. Read it with {@link workflowParkUnusedClassOf}:
54
+ * a `workflow.parked_decision_unused` notice by its `detail.reason` and `detail.spent`, a {@link workflowParkDecisionOf} reading by its
55
+ * `reason` and whether it is `spent` (a `blocked` reading is kept). A frozen literal of plain data: a reader may copy it at build time.
31
56
  */
32
- export declare const WORKFLOW_PARK_SETTLING_REASONS: readonly ["decision_spent", "card_unresumable", "launch_unreadable", "denied"];
33
- export type WorkflowParkSettlingReason = (typeof WORKFLOW_PARK_SETTLING_REASONS)[number];
34
- /** What came of one host decision for one park, as the run records of the park's chain say ({@link workflowParkDecisionOf}):
57
+ export declare const WORKFLOW_PARK_UNUSED_REASON_CLASS: {
58
+ readonly workflow_not_mounted: {
59
+ readonly kept: "deliverable";
60
+ };
61
+ readonly entry_unreadable: {
62
+ readonly kept: "decide_again";
63
+ };
64
+ readonly record_unreadable: {
65
+ readonly kept: "deliverable";
66
+ };
67
+ readonly not_holder: {
68
+ readonly kept: "deliverable";
69
+ };
70
+ readonly not_pending: {
71
+ readonly kept: "withdraw";
72
+ };
73
+ readonly decision_spent: {
74
+ readonly spent: "decide_again";
75
+ };
76
+ readonly launch_unrecorded: {
77
+ readonly kept: "deliverable";
78
+ };
79
+ readonly launch_unreadable: {
80
+ readonly spent: "start_over";
81
+ };
82
+ readonly host_changed: {
83
+ readonly kept: "deliverable";
84
+ };
85
+ readonly denied: {
86
+ readonly kept: "deliverable";
87
+ readonly spent: "decide_again";
88
+ readonly spentWhen: "explicit";
89
+ };
90
+ readonly ask_unanswerable: {
91
+ readonly kept: "deliverable";
92
+ };
93
+ readonly call_changed: {
94
+ readonly kept: "deliverable";
95
+ };
96
+ readonly launch_refused: {
97
+ readonly kept: "deliverable";
98
+ };
99
+ readonly continuing_elsewhere: {
100
+ readonly kept: "deliverable";
101
+ };
102
+ readonly card_unresumable: {
103
+ readonly kept: "deliverable";
104
+ readonly spent: "start_over";
105
+ readonly spentWhen: "terminal";
106
+ };
107
+ readonly waiting_elsewhere: {
108
+ readonly kept: "deliverable";
109
+ };
110
+ readonly run_not_ended: {
111
+ readonly kept: "deliverable";
112
+ };
113
+ };
114
+ /** The class of an answer `reason` gave, as {@link WORKFLOW_PARK_UNUSED_REASON_CLASS} reads it — a lookup and nothing else: the row's
115
+ * `spent` class when `spent` is `true`, its `kept` class when it is `false`. Undefined — no guess, never the other arm — for a word
116
+ * outside the set (an answer of a later engine) or a `reason` that is not a string (judged before it is used as a key, so a value a
117
+ * custom store hands back is never converted), for an arm the word's row does not have (`not_pending` spent, `decision_spent` kept),
118
+ * and for a `spent` that is not a boolean (a notice of an engine older than the member). */
119
+ export declare function workflowParkUnusedClassOf(reason: string, spent: unknown): WorkflowParkUnusedClass | undefined;
120
+ /** The words that can spend a decision — the rows of {@link WORKFLOW_PARK_UNUSED_REASON_CLASS} with a `spent` class: the `reason` of a
121
+ * `spent` {@link workflowParkDecisionOf} reading, and the only words a final mark carries. */
122
+ export type WorkflowParkSettlingReason = {
123
+ [R in WorkflowParkUnusedReason]: (typeof WORKFLOW_PARK_UNUSED_REASON_CLASS)[R] extends {
124
+ readonly spent: WorkflowParkUnusedClass;
125
+ } ? R : never;
126
+ }[WorkflowParkUnusedReason];
127
+ /** What came of one host decision for one park, as the run records of the park's tree say ({@link workflowParkDecisionOf}):
35
128
  * - `open` — no record says anything of it: a hand-over may continue the run (the card's own state and the holder law aside);
36
129
  * - `carried` — a continuation (`runId`) carried it and ended before its script reached the parked step (`not_reached`): it is not
37
130
  * spent, and handed over again on its own it only reaches the same wait — hand it over with a decision for what stopped that run;
38
131
  * - `driven` — a continuation (`runId`) drove the parked step with it: the card was consumed;
39
- * - `spent` — no later hand-over of it continues the run (`reason`, a word of {@link WORKFLOW_PARK_SETTLING_REASONS}, and its
40
- * `code`): the drive of a run (`runId`) refused it, or the engine's continuation judged it on the record of the run that
41
- * held the park (`runId`) and said so;
42
- * - `blocked` (#4833) — the engine's continuation judged it on the record of the run that held the park (`runId`) and did not use it
132
+ * - `spent` — no later hand-over of it continues the run (`reason`, a {@link WorkflowParkSettlingReason}, and its
133
+ * `code`), and `by` says who has said so: `mark` — the engine's continuation judged it, told it, and recorded a final mark, read on
134
+ * any entry of the park's token in the tree (`runId`, the run whose entry carries it); `drive` — the drive of a run of the tree
135
+ * (`runId`) refused it, and no continuation has told it yet;
136
+ * - `blocked` (#4833) — the engine's continuation judged it on the record of the run that holds the park (`runId`) and did not use it
43
137
  * in the state `condition` names (`reason`, its `code`, and the fold `inputs` a `host_changed` named — what the person was told):
44
138
  * handed over again in that same state it is told nothing and not used; once the state changes it is judged again. `condition` is
45
139
  * an opaque, fixed-length string — compare it, never parse it. A host that does not hand a blocked decision over again loses
46
140
  * nothing: the decision stays unused, and a person's new decision for the card is judged on its own.
47
- * Precedence: `driven`, then `spent` (a mark, then a refused drive), then `carried`, then `blocked`. */
141
+ * Precedence: `driven`, then `spent` (a mark, then a refused drive), then `carried`, then `blocked`. A `spent` or `blocked` reading
142
+ * carries `class` (#5208): what is left to do with the decision, as {@link WORKFLOW_PARK_UNUSED_REASON_CLASS} answers it in the engine
143
+ * that reads the state — absent only where the lookup answers nothing. Read with the card's state (#5246, {@link workflowParkDecisionOf}'s
144
+ * `card`): a card no longer pending gives every state `class: "withdraw"`, a card not read gives none. */
48
145
  export type WorkflowParkDecisionState = {
49
146
  readonly kind: "open";
147
+ readonly class?: WorkflowParkUnusedClass;
50
148
  } | {
51
149
  readonly kind: "carried";
52
150
  readonly runId: string;
151
+ readonly class?: WorkflowParkUnusedClass;
53
152
  } | {
54
153
  readonly kind: "driven";
55
154
  readonly runId: string;
155
+ readonly class?: WorkflowParkUnusedClass;
56
156
  } | {
57
157
  readonly kind: "spent";
58
158
  readonly runId: string;
59
159
  readonly reason: WorkflowParkSettlingReason;
60
160
  readonly code?: string;
161
+ readonly by: "mark" | "drive";
162
+ readonly class?: WorkflowParkUnusedClass;
61
163
  } | {
62
164
  readonly kind: "blocked";
63
165
  readonly runId: string;
@@ -65,24 +167,33 @@ export type WorkflowParkDecisionState = {
65
167
  readonly code?: string;
66
168
  readonly inputs?: readonly HostFoldInput[];
67
169
  readonly condition: string;
170
+ readonly class?: WorkflowParkUnusedClass;
68
171
  };
69
- type RecordsOfPark = ReadonlyArray<Pick<WorkflowRun, "id" | "parks" | "decisions"> | null | undefined>;
70
172
  /**
71
- * What came of the host decision `decisionId` for the park on `token`, read off the run records given — hand it the park's chain, the
72
- * records the holder law reads ({@link workflowParkHolderOf}: the run that parked it and its successors): a run that comes to hold a
73
- * park carries its holder's marks onto its own entry, but a mark another leg wrote on an earlier holder while the park was moving on
74
- * lives on that earlier record alone, and the holder's record by itself reads such a decision `open`. The one reading a host's "hand it
75
- * over again?" judge and the engine's continuation share. Pure over the records; whether the card is still pending is the checkpoint
76
- * store's word, and which run to hand it to the holder law's, never this. A `driven` row wins, then a `spent` one, then `carried`,
77
- * then `blocked`. The one place a decision's outcome on a card is written is these records (#4833): a run's decision account
78
- * (`WorkflowRun.decisions`, every drive of the decision, whichever door it came through) and the marks on the park's entries.
173
+ * What came of the host decision `decisionId` for the park on `token`, read off the park's tree as {@link readWorkflowRunTree} read
174
+ * it (from the run any of the host's coordinates for the card names): every run's decision account (`WorkflowRun.decisions`, every
175
+ * drive of the decision whichever door it came through — an earlier run's included) and the marks on the park's entries: a final
176
+ * mark belongs to the decision (the token) — on any entry of this token in the tree it counts; a recoverable mark belongs to the
177
+ * holder — it counts on the entry of the run the holder law ({@link workflowParkHolderOf}) names alone. The engine writes every mark
178
+ * on the holder's entry (a run that comes to hold a park carries its holder's marks onto its own entry). The one reading a host's "hand it over again?" judge and the engine's continuation share: the
179
+ * engine judges the same tree. Pure over the tree; whether the card is still pending is the checkpoint store's word, and which run to
180
+ * hand it to the holder law's, never this. A `driven` row wins, then a `spent` one (a mark, then a refused drive), then `carried`,
181
+ * then `blocked`. The decision account and the marks are keyed by `decisionId` and the park's call: a host gives every card its own
182
+ * `decisionId` (two cards of the same call in one tree that share one would read each other's outcome).
79
183
  *
80
184
  * @contract workflow.park_decision.same_state — handed over again in the state its `blocked` answer's `condition` names, a decision
81
185
  * is told nothing, the model is not asked (no continuation starts, the first request's frame does not name the run) and no mark is
82
186
  * written; handed over in another state, it is told once and its mark replaced. A host cannot compute the state (`condition` is
83
187
  * opaque) and keeps no account of its own: handing the decision over again in the same state costs nothing.
188
+ *
189
+ * `card` (#5246, optional) — the card's state as the checkpoint store answers it ({@link WorkflowParkCardState}, the word
190
+ * {@link workflowParkWaitOf} takes; the engine's continuation hands the card it read): the one input that, with the tree, says what is
191
+ * left to do with the decision, as a hand-over's notice says it. A card no longer pending (`resolved` / `expired` / `absent`) leaves
192
+ * nothing to decide: every state carries `class: "withdraw"`. A card not read (`unread`) carries no `class` on any state: the card
193
+ * pending, the tree's class would hold; gone, withdraw — not known. `pending`, or no `card` at all, answers the tree's reading as it is.
194
+ * A value outside the word's set is refused (`TypeError`).
84
195
  */
85
- export declare function workflowParkDecisionOf(token: string, decisionId: string, records: RecordsOfPark): WorkflowParkDecisionState;
196
+ export declare function workflowParkDecisionOf(token: string, decisionId: string, tree: WorkflowRunTree, card?: WorkflowParkCardState): WorkflowParkDecisionState;
86
197
  /** What came of the decisions naming one run. */
87
198
  export type WorkflowParkAdoption = {
88
199
  readonly kind: "started";
@@ -100,9 +211,13 @@ export type WorkflowParkAdoption = {
100
211
  * resume claim is held for — no more than that: the run may carry another decision, or may never have started. (For
101
212
  * `waiting_elsewhere` the notice's detail carries `holder` read off {@link waiting}.) */
102
213
  readonly holder?: string | readonly string[];
103
- /** `continuing_elsewhere`: when the store's expiry frees the claim (epoch ms), when the store said so — the latest instant
104
- * the claim holds the workflow, for a holder whose process stopped without giving it back. */
214
+ /** `continuing_elsewhere`: the latest instant the claim holds the workflow (epoch ms, this machine's clock), for a holder whose
215
+ * process stopped without giving it back — this machine's clock when the refusal arrived plus the remaining time the store
216
+ * answered ({@link claimRemainingOf}); absent when the store said none, or said one that does not read. */
105
217
  readonly claimExpiresAt?: number;
218
+ /** `continuing_elsewhere`: the store answered a remaining time for the claim that does not read — no instant is named, and
219
+ * the sentence says so. Absent otherwise. */
220
+ readonly claimLapseUnreadable?: true;
106
221
  /** `waiting_elsewhere`: the lines of the workflow that wait and hold this run off — each line's head run and what it waits
107
222
  * on ({@link WorkflowWaitingLine}). The notice's detail carries their runs as `holder` (the run, or every run when more
108
223
  * than one line waits, as for a fork); a host finds each card by the holder law. */
@@ -119,6 +234,19 @@ export type WorkflowParkAdoption = {
119
234
  /** `denied`: the refusal is a person's own answer to the call's question (it settles the decision; every other refusal leaves
120
235
  * it deliverable). Not on the notice; the sentence reads it. */
121
236
  readonly explicit?: true;
237
+ /** `card_unresumable`: the card the row judge refused is another card of the run, not this decision's own (#5208: the
238
+ * decisions it stops are told its facts without `terminal`). Not on the notice; the sentence reads it. */
239
+ readonly otherCard?: true;
240
+ /** `record_unreadable`: what did not read is the decision's own card (#5246), so the sentence does not say it is still waiting.
241
+ * Not on the notice; the sentence reads it. */
242
+ readonly cardUnread?: true;
243
+ /** `record_unreadable` / `continuing_elsewhere` (#5229): a person answered no to the continuation's question and that answer
244
+ * was not recorded — its record did not read back under the workflow's resume claim, or the claim was held by another leg (which
245
+ * may be continuing the run with the same decision) — so it is not told as settled. Not on the notice; the sentence reads it. */
246
+ readonly answerUnrecorded?: true;
247
+ /** `continuing_elsewhere` (#5229): the claim is held by another leg only to record a person's answer to continuing the workflow
248
+ * (no run holds it, and `holder` is absent: the claim's holder id is no run's). Not on the notice; the sentence reads it. */
249
+ readonly heldForAnswer?: true;
122
250
  /** `not_pending`: the run that continued the run from this card (its record holds a `driven` row for the card's call). */
123
251
  readonly continuedAs?: string;
124
252
  /** `host_changed`: which half moved — `identity`: the settings every agent of the run is folded under (the deployment's
@@ -135,14 +263,40 @@ export type WorkflowParkAdoption = {
135
263
  * store said — the members `continuing_elsewhere` carries. */
136
264
  export type WorkflowClaimHeld = Pick<Extract<WorkflowParkAdoption, {
137
265
  kind: "unused";
138
- }>, "claimExpiresAt"> & {
266
+ }>, "claimExpiresAt" | "claimLapseUnreadable" | "heldForAnswer"> & {
139
267
  readonly holder?: string;
140
268
  };
141
- /** The hold a refused claim's verdict tells ({@link WorkflowClaimHeld}). */
269
+ /** What the remaining time a refused resume claim's answer carries tells ({@link claimRemainingOf}): `unsaid` — the store
270
+ * answered none; `at` — the latest instant the refusal stands, epoch ms by this machine's clock; `unreadable` — the store
271
+ * answered one that does not read. */
272
+ export type WorkflowClaimLapse = {
273
+ readonly kind: "unsaid";
274
+ } | {
275
+ readonly kind: "at";
276
+ readonly at: number;
277
+ } | {
278
+ readonly kind: "unreadable";
279
+ };
280
+ /**
281
+ * THE one reader of a refused resume claim's remaining time (`ResumeClaimAnswer.remainingMs`), read once, as the refusal arrives
282
+ * (`now`: this machine's clock then). None answered ⇒ `unsaid`. A safe integer from 1 to `RESUME_CLAIM_REMAINING_MS_MAX` ⇒ `at`,
283
+ * `now` plus it — an upper bound (the answer's time on its way only makes it later than the store's own expiry), named in words
284
+ * as "at the latest" and never compared with anything. Anything else — 0 or less (refused while expired: a contradiction), not
285
+ * a number, not an integer, over the bound, or a sum no date holds ⇒ `unreadable`: no instant is named.
286
+ */
287
+ export declare function claimRemainingOf(answer: {
288
+ readonly remainingMs?: unknown;
289
+ }, now: number): WorkflowClaimLapse;
290
+ export declare function answerRecordClaimHolder(): string;
291
+ export declare function isAnswerRecordClaimHolder(holder: string | undefined): boolean;
292
+ /** The hold a refused claim's verdict tells ({@link WorkflowClaimHeld}), its remaining time as {@link claimRemainingOf} read it; a
293
+ * holder that records a person's answer is no run, and is told as that ({@link isAnswerRecordClaimHolder}: `heldForAnswer`). */
142
294
  export declare function claimHeldOf(verdict: {
143
295
  readonly holder?: string;
144
- readonly expiresAt?: number;
296
+ readonly lapse?: WorkflowClaimLapse;
145
297
  }): WorkflowClaimHeld;
298
+ /** The words a refusal says, in brackets, of a claim whose store answered a remaining time that does not read. */
299
+ export declare const CLAIM_REMAINING_UNREADABLE_NOTE = "the journal store answered a remaining time for the claim that does not read, so no time is named";
146
300
  /** A claim's expiry (epoch ms, store-supplied) as the refusals name it — an ISO-8601 UTC instant — or `undefined` for anything
147
301
  * that names no instant (absent, not a finite number, outside the range a date can hold): never a guessed time. */
148
302
  export declare function claimLapseInstant(expiresAt: unknown): string | undefined;
@@ -180,6 +334,8 @@ export interface WorkflowContinuationGate {
180
334
  readonly explicit: boolean;
181
335
  } | {
182
336
  readonly kind: "ask_unanswerable";
337
+ } | {
338
+ readonly kind: "call_changed";
183
339
  }>;
184
340
  }
185
341
  /** What a continuation starts from: the run it continues, that run's launch record, the decisions it carries. */
@@ -227,6 +383,16 @@ export interface WorkflowParkAdopterSeats {
227
383
  } | {
228
384
  readonly superseded: true;
229
385
  }>;
386
+ /** Hold the workflow's resume claim — keyed by `claimKey` (its tree's root) in `scope`, taken as the launch takes it, no run
387
+ * started under it — while `body` runs, and give it back once `body` has settled: `value`, what `body` answered; `claimHeld`,
388
+ * the claim another run holds (as the store told it); `refused`, a store that threw or did not answer in time (`body` not run). */
389
+ readonly underClaim: <T>(claimKey: string, scope: string, body: () => Promise<T>) => Promise<{
390
+ readonly value: T;
391
+ } | {
392
+ readonly claimHeld: WorkflowClaimHeld;
393
+ } | {
394
+ readonly refused: string;
395
+ }>;
230
396
  /** Every store wait here is bounded by it. */
231
397
  readonly waitBoundMs: number;
232
398
  /** Tell the deployment's account what failed (`what`) and what the store threw — a store failure the adopter's answers name by
@@ -297,31 +463,82 @@ export type BoundedStoreRead = <T>(p: Promise<T>) => Promise<{
297
463
  export declare function boundedStoreRead(ms: number): BoundedStoreRead;
298
464
  /** One run record of `scope`, or `null` when the store holds none there. */
299
465
  export declare function readWorkflowRunIn(store: Pick<WorkflowRunStore, "get">, id: string, scope: string, within: BoundedStoreRead): Promise<WorkflowRun | null | "unreadable">;
300
- /** The runs that resumed `rootId`, and theirs, as far as {@link WORKFLOW_TREE_RUNS_MAX} goes — the only runs a park of that run
301
- * can have moved to. One walk for every reader of the chain: the adopter's holder judge and a suspended continuation's takeover.
302
- * A listing row is a successor of `id` only when it names `id` (its `resumedFrom`: a list row is the stored record's projection,
303
- * `summarizeWorkflowRun`, so a resume's row carries it), and that run's record is read to confirm it — a store that does not
304
- * filter costs one listing of the scope per run walked, never a read of every row. `"over_bound"` when `rootId` and its
305
- * successors are more runs than that. */
306
- export declare function workflowRunSuccessors(store: Pick<WorkflowRunStore, "get" | "listByScope">, rootId: string, scope: string, within: BoundedStoreRead): Promise<WorkflowRun[] | "unreadable" | "over_bound">;
307
- /** The chain of run `rootId` as the holder law reads it for a park of that run: its record and its successors
308
- * ({@link workflowRunSuccessors}). `"unreadable"` when the root has no record in `scope` or a read fails. */
309
- export declare function readWorkflowRunChain(store: Pick<WorkflowRunStore, "get" | "listByScope">, rootId: string, scope: string, within: BoundedStoreRead): Promise<{
310
- root: WorkflowRun;
311
- successors: WorkflowRun[];
312
- } | "unreadable" | "over_bound">;
466
+ /** Whether `b` continues `a`: `b`'s `resume.fromRunId` is `a`'s id and, when `b` recorded which creation of that id it read
467
+ * (`resume.fromCreationId`), `a` is that same creation — a record created again under a reused id (or one an older engine created,
468
+ * carrying no creation id) is not the run `b` continued, the same answer as a source that is gone. The one edge every walk of a
469
+ * workflow's tree reads: the tree reader's walks up and down ({@link readWorkflowRunTree}) and the tree id's walk. */
470
+ export declare function isContinuationOf(a: WorkflowRun, b: WorkflowRun): boolean;
471
+ /** The mark only {@link readWorkflowRunTree} sets on what it answers (never exported: a value carrying it was read by the reader). */
472
+ declare const WORKFLOW_RUN_TREE: unique symbol;
473
+ /**
474
+ * One workflow's tree as {@link readWorkflowRunTree} read it, at one pass of the store: its `root` (the run with no source above it
475
+ * in the scope — the run the tree started from, or the topmost run whose edge up does not hold), and `records`, the root and every
476
+ * run below it, each once (the root first, then each layer as the walk read it). Every edge between them is {@link isContinuationOf}.
477
+ * Two things make one: the reader ({@link readWorkflowRunTree}: the whole tree) and {@link workflowRunTreeOfOne} (which says it holds
478
+ * one record alone). The judges that read a tree ({@link workflowParkDecisionOf}, {@link workflowParkWaitOf}, `workflowParkHolderOf`)
479
+ * take nothing else, so a collection a host gathers on its own does not compile there.
480
+ */
481
+ export interface WorkflowRunTree {
482
+ readonly root: WorkflowRun;
483
+ readonly records: readonly WorkflowRun[];
484
+ readonly [WORKFLOW_RUN_TREE]: true;
485
+ }
486
+ /**
487
+ * A tree of one run alone: what a run with no run store to read reads of itself (it has nothing to walk). From the package root, for a
488
+ * host that holds one record and cannot read the store (a check made synchronously, under a row's lock; an index built per record).
489
+ * What a judge answers over it is what that record says of itself and nothing more: `workflowParkHolderOf(token, treeOfOne)` reads
490
+ * whether this record claims to hold the park on `token` (and at which generation), not who holds it on the line now — a later run that
491
+ * took the park over is not in it, and `workflowParkWaitOf` over it can never answer `moved_on`. Routing a person's decision, or
492
+ * judging whether a card is still waited on, reads the whole tree: {@link readWorkflowRunTree}.
493
+ */
494
+ export declare function workflowRunTreeOfOne(run: WorkflowRun): WorkflowRunTree;
495
+ /** The record of `id` in `tree`, if it is one of its runs. */
496
+ export declare function workflowRunInTree(tree: WorkflowRunTree, id: string): WorkflowRun | undefined;
497
+ /** The runs of `tree` below `id` (its successors, theirs, …), in the order the tree holds them. */
498
+ export declare function workflowRunsBelow(tree: WorkflowRunTree, id: string): WorkflowRun[];
499
+ /** The runs of `tree` that continue `id` directly. */
500
+ export declare function workflowRunChildrenIn(tree: WorkflowRunTree, id: string): WorkflowRun[];
501
+ /** `id` and every run above it in `tree`, `id` first (up to the root). */
502
+ export declare function workflowRunLineIn(tree: WorkflowRunTree, id: string): string[];
503
+ /** Where a resume that carries no decision continues when it names `runId` ({@link workflowLineTailOf}). */
504
+ export type WorkflowLineTail = {
505
+ readonly kind: "tail";
506
+ readonly runId: string;
507
+ } | {
508
+ readonly kind: "fork";
509
+ readonly leaves: readonly string[];
510
+ };
313
511
  /**
314
- * The tree `runId` belongs to: its root — the run reached by following `resume.fromRunId` up from `runId` until a record names no
315
- * run it resumed, or the run it names has no record in `scope` any more (reaped: the walk stops below it) — and the line, `runId`
316
- * and every run above it. `runId` without a record is its own root and line (nothing to walk). `"unreadable"` when a read fails or
317
- * the walk meets a run twice; `"over_bound"` when the line is more runs than {@link WORKFLOW_TREE_RUNS_MAX}. The one walk the
318
- * resume claim's key, the one-waiting-line judge ({@link otherWaitingLine}) and the continuation's read of its run under the claim read.
512
+ * The run a resume that carries no decision continues when it names `runId` of `tree` (#5159): `runId` itself when nothing continued
513
+ * it; the last run of the line below it when the runs that continued it make one line (the workflow is one run that went on — the same
514
+ * run the reference's resume continues); `fork` when they split anywhere below it, with every line's last run (`leaves`), so which one
515
+ * is meant is not one answer. A resume that carries a decision is not moved: a decision belongs to the run that holds its card.
319
516
  */
320
- export declare function workflowTreeOf(store: Pick<WorkflowRunStore, "get">, runId: string, scope: string, within: BoundedStoreRead): Promise<{
321
- root: string;
322
- line: readonly string[];
323
- recorded: boolean;
324
- } | "unreadable" | "over_bound">;
517
+ export declare function workflowLineTailOf(tree: WorkflowRunTree, runId: string): WorkflowLineTail;
518
+ /** Why a resume naming a run whose line split is not continued, and the way out — one wording for the model's own call and the
519
+ * run's admission (`leaves` already bounded by the caller's echo). */
520
+ export declare function workflowLineForkReason(leaves: readonly string[]): string;
521
+ /**
522
+ * THE one reader of a workflow run's tree (#5156): from `runId`, up its edges ({@link isContinuationOf}) to the root — a record that
523
+ * names no source, or whose source has no record in `scope` or is not the run it continued (gone, created again) — then from the root
524
+ * down through every run that continues one of the tree's runs. Every read is bounded on its own (`WORKFLOW_STORE_WAIT_BOUND_MS`). Any
525
+ * run of the tree read this way reads the same tree. Answers:
526
+ * - the tree ({@link WorkflowRunTree}) — what the judges take;
527
+ * - `"unreadable"` — a read failed or did not answer; `runId` has no record in `scope` (the same answer as a record that does not
528
+ * read: a scope gives no word of what another scope holds); the walk met a run twice; a run read on the way up is not, with the same
529
+ * creation, among the runs read on the way down (the store's two answers disagree: a listing that left it out, or a record that
530
+ * came or was created again between the two reads) — never a union of the two; or a listing on the way down held a row that does not
531
+ * read (a damaged record: it may be a later run of the tree, and a tree without it could name an earlier holder of a park);
532
+ * - `"over_bound"` — the tree is more runs than {@link WORKFLOW_TREE_RUNS_MAX}.
533
+ * A tree of N runs whose named run is L runs below the root costs at most N listings (`listByScope` with `resumedFrom`, no limit) and
534
+ * L + N − 1 reads by id. A store that does not filter by `resumedFrom` answers its whole scope to every listing, and any damaged row in
535
+ * the scope then leaves every tree of it unread.
536
+ */
537
+ export declare function readWorkflowRunTree(store: Pick<WorkflowRunStore, "get" | "listByScope">, runId: string, scope: string): Promise<WorkflowRunTree | "unreadable" | "over_bound">;
538
+ /** {@link readWorkflowRunTree} with the caller's bound on each read (the engine's own waits run on the run's timers). `self`: the
539
+ * reading run's own record as it holds it — read in place of the store's copy of it (a live run's own record is newer than what the
540
+ * store holds), and a member of the tree whether or not the store has its row yet. */
541
+ export declare function readWorkflowRunTreeWithin(store: Pick<WorkflowRunStore, "get" | "listByScope">, runId: string, scope: string, within: BoundedStoreRead, self?: WorkflowRun): Promise<WorkflowRunTree | "unreadable" | "over_bound">;
325
542
  /** One line of a workflow that waits: its head run, and what that run waits on — the parked agent's label and the card's
326
543
  * checkpoint id (each when it reads), and `yielded` when it is a scheduler's yield (nobody decides it; continuing the run moves
327
544
  * it). */
@@ -331,9 +548,9 @@ export interface WorkflowWaitingLine {
331
548
  readonly checkpointId?: string;
332
549
  readonly yielded?: true;
333
550
  }
334
- /** What {@link otherWaitingLine} reads for a continuation of a run: nothing it would add a line to (`root` keys the workflow's
335
- * resume claim), lines that wait and hold it off (each line's head, and what it waits on), the tree or a card did not read, or the
336
- * tree is more runs than {@link WORKFLOW_TREE_RUNS_MAX}. */
551
+ /** What {@link otherWaitingLine} reads for a continuation of a run: nothing it would add a line to (`root` — the tree's root —
552
+ * keys the workflow's resume claim), lines that wait and hold it off (each line's head, and what it waits on), or a card did not
553
+ * read. */
337
554
  export type WorkflowLineVerdict = {
338
555
  readonly kind: "none";
339
556
  readonly root: string;
@@ -343,8 +560,6 @@ export type WorkflowLineVerdict = {
343
560
  readonly lines: readonly [WorkflowWaitingLine, ...WorkflowWaitingLine[]];
344
561
  } | {
345
562
  readonly kind: "unreadable";
346
- } | {
347
- readonly kind: "over_bound";
348
563
  };
349
564
  /**
350
565
  * One workflow runs or waits on one line at a time: a continuation that would add a waiting line starts nothing. Before
@@ -357,33 +572,30 @@ export type WorkflowLineVerdict = {
357
572
  * whose record still says `running` has not ended on a park, so it is not one (a live run is held off by the resume claim; a run
358
573
  * that died there must not lock the tree), nor one that ended any other way; a card a fork stands on is the line's own when one
359
574
  * of the fork's runs is on the line. A yield (a scheduler's `resource_limit` checkpoint) is a wait too — nobody decides it;
360
- * continuing that run moves it. A read that fails starts nothing either (`unreadable`), nor does a tree of more runs than
361
- * {@link WORKFLOW_TREE_RUNS_MAX} (`over_bound`). Only this tree's records and its own cards are read: never the host's pending
362
- * listing.
575
+ * continuing that run moves it. A card that does not read starts nothing either (`unreadable`). Only `fromRunId`'s tree (as the
576
+ * caller read it, {@link readWorkflowRunTree}) and its own cards are read: never the host's pending listing.
363
577
  */
364
- export declare function otherWaitingLine(store: Pick<WorkflowRunStore, "get" | "listByScope">, parkStore: CheckpointStore | undefined, fromRunId: string, scope: string, within: BoundedStoreRead,
365
- /** `fromRunId`'s tree as {@link workflowTreeOf} read it just now, when the caller did (the walk is not made twice). */
366
- walked?: Awaited<ReturnType<typeof workflowTreeOf>>): Promise<WorkflowLineVerdict>;
367
- /** The run among `records` whose record accounts a `driven` decision for `callKey` — the run that took a decided card's
368
- * approval. One reading for the adopter's `continuedAs` and for the sentence a resume settles that step with. */
369
- export declare function runThatDrove(records: readonly WorkflowRun[], callKey: string): WorkflowRun | undefined;
578
+ export declare function otherWaitingLine(tree: WorkflowRunTree, parkStore: CheckpointStore | undefined, fromRunId: string, within: BoundedStoreRead): Promise<WorkflowLineVerdict>;
579
+ /** The run among `records` that took the approval of the card on `token` at `callKey`: its record carries the card's entry (a run
580
+ * that reaches a card carries its entry, inherited or its own) and accounts a `driven` decision for the call. A run that drove the
581
+ * same call on another card (a sibling's card in the same tree, or a card the call re-parked on since) carries that card's entry, not
582
+ * this one, and is not it. One reading for the adopter's `continuedAs`, the wait judge and the sentence a resume settles that step with. */
583
+ export declare function runThatDrove(records: readonly WorkflowRun[], token: string, callKey: string): WorkflowRun | undefined;
370
584
  /**
371
585
  * #5146 — whether the row of run `runId` still waits on the park it made on `token`: the one answer to "is this line still waiting for
372
- * an approval" ({@link WorkflowParkWait}). Hand it the records of the tree the row's run belongs to — at least the run's own and every
373
- * later run of its chain (as {@link readWorkflowRunChain} reads them; in any order) — and the card's state as the checkpoint store
374
- * answers it. More records of the tree (its ancestors, its other branches) change no answer: the judge reads `parkedBy`, generations
375
- * and the card's own entry, never a run's place in the list. Fewer do: `records` missing a later run reads a row that has moved on as
376
- * still waiting — handed the run's own record alone while a successor continued it without a decision and parked again on the same
377
- * card, it answers `waiting` (with the chain, `moved_on`), and nothing in the records it is handed says one is missing. A host reads
378
- * them with {@link readWorkflowParkWaits}, which reads the whole chain.
586
+ * an approval" ({@link WorkflowParkWait}). Hand it the tree the row's run belongs to, as {@link readWorkflowRunTree} read it, and the
587
+ * card's state as the checkpoint store answers it; a host reads both with {@link readWorkflowParkWaits}.
379
588
  * Pure over what it is handed; the records are never written (the source record keeps what it ended with). In order: a later run of
380
- * the chain that drove the parked step on this card answers `moved_on`; the holder law naming other runs answers `moved_on`; a card not
381
- * read answers `unknown`; the holder law naming this run with the card pending answers `waiting`; a card no longer pending answers
382
- * `lapsed`; records with no holder of the park (or without `runId`'s record) answer `unknown`. Which later run drove it is read off the
383
- * runs' decision accounts, so a drive whose decision named no `decisionId`, or one still running the approved step (its row is written
384
- * when the step returns), answers `lapsed` (the card is no longer pending) rather than `moved_on` — the row reads `interrupted` either way.
589
+ * the tree that drove the parked step on this card answers `moved_on`; the holder law naming other runs answers `moved_on`; a card not
590
+ * read answers `unknown`; a card no longer pending answers `lapsed`; the holder law naming this run with the card pending answers
591
+ * `waiting` — unless a run below this one parked the same call on another card of its own, which answers `moved_on` naming it (the
592
+ * line asked that step again, #5183); a tree with no holder of the park (or without `runId`'s own entry for it) answers `unknown`. Which later run drove it is read
593
+ * off the runs' decision accounts, so a drive whose decision named no `decisionId`, or one still running the approved step (its row is
594
+ * written when the step returns), answers `lapsed` (the card is no longer pending) rather than `moved_on` — the row reads `interrupted`
595
+ * either way. Whether a pending card still has a line waiting on it at all is this judge asked of the card's holder (the holder law's
596
+ * run, or each run of a fork): `waiting` for any of them, the card is alive.
385
597
  */
386
- export declare function workflowParkWaitOf(token: string, runId: string, records: ReadonlyArray<WorkflowRun | null | undefined>, card: WorkflowParkCardState): WorkflowParkWait;
598
+ export declare function workflowParkWaitOf(token: string, runId: string, tree: WorkflowRunTree, card: WorkflowParkCardState): WorkflowParkWait;
387
599
  /** The host's two stores {@link readWorkflowParkWaits} reads, injected (it opens nothing of its own). An object, so a later member
388
600
  * (a batch of runs) is additive. */
389
601
  export interface WorkflowParkWaitSeats {
@@ -392,11 +604,10 @@ export interface WorkflowParkWaitSeats {
392
604
  }
393
605
  /**
394
606
  * #5146 — {@link workflowParkWaitOf} for every park run `runId` made (its record's park entries naming it), read from the host's two
395
- * stores: the run's chain (its record and its successors) from the run store, the cards from the checkpoint store (together) — every
607
+ * stores: the run's tree from the run store ({@link readWorkflowRunTree}), the cards from the checkpoint store (together) — every
396
608
  * read bounded by {@link WORKFLOW_STORE_WAIT_BOUND_MS}. A card that does not read — the store threw or did not answer, its row is not
397
609
  * this token's, or its status is not one of `pending` / `resolved` / `expired` — answers `unknown` / `card_unread`; no row is `absent`.
398
- * Answers `"unreadable"` when the run's record or its chain does not read, `"over_bound"` when the chain is longer than the engine's
399
- * walks read.
610
+ * Answers `"unreadable"` / `"over_bound"` as the tree reader does.
400
611
  */
401
612
  export declare function readWorkflowParkWaits(seats: WorkflowParkWaitSeats, runId: string, scope: string): Promise<ReadonlyMap<string, WorkflowParkWait> | "unreadable" | "over_bound">;
402
613
  /**
@@ -429,7 +640,7 @@ export declare function workflowParkUnusedSentence(o: Extract<WorkflowParkAdopti
429
640
  * engine's continuation tells the person the same one), with the decision half only when the call carried decisions. */
430
641
  export declare function notContinuedRefusalOf(runId: string, reason: "launch_unreadable" | "waiting_elsewhere" | "continuing_elsewhere", more?: Pick<Extract<WorkflowParkAdoption, {
431
642
  kind: "unused";
432
- }>, "code" | "holder" | "waiting" | "claimExpiresAt"> & {
643
+ }>, "code" | "holder" | "waiting" | "claimExpiresAt" | "claimLapseUnreadable" | "heldForAnswer"> & {
433
644
  readonly decisionIds?: readonly string[];
434
645
  }): string;
435
646
  /** Why a run of a tree past {@link WORKFLOW_TREE_RUNS_MAX} is not continued, and the way out — one wording for the model's own
@@ -444,12 +655,18 @@ export declare function workflowTreeOverBoundSentence(runId: string): string;
444
655
  * told with the decision it carried). Undefined for every other answer (the call then runs as it is).
445
656
  */
446
657
  export declare function resumedCallRefusalOf(o: WorkflowParkAdoption): string | undefined;
658
+ /** The two codes a leg's adoption step tells what came of the decisions it carried by (#5208): not used, and used. */
659
+ export type WorkflowParkDecisionNoticeCode = "workflow.parked_decision_unused" | "workflow.parked_decision_used";
447
660
  /**
448
661
  * A leg's workflow-park contributor to its adoption step: the decisions it carries are continued by the mounted Workflow tool's
449
662
  * adopter (or, with no tool mounted, answered `workflow_not_mounted`); every decision that did not continue its run is told to
450
663
  * the person once per run (`workflow.parked_decision_unused`, through `deliver`) — except one the engine already recorded as settled
451
- * for good, or as not used in the very state it would be told in now (#4833), which is answered with nothing — and the returned text — the first request's `workflow_continuation` frame — tells the
452
- * model what came of each. Undefined when the leg carries no decision.
664
+ * for good, or as not used in the very state it would be told in now (#4833), which is answered with nothing — and every continuation
665
+ * started is told once with the decisions it carries (`workflow.parked_decision_used`, #5208: off the screen, a record); all of them
666
+ * before the leg's first request to its model. The returned text — the first request's `workflow_continuation` frame — tells the model
667
+ * what came of each. On a leg that resumed to run the model's own `Workflow({ resumeFromRunId })` call for a run, the mounted tool's
668
+ * adopter tells neither code for the readable decisions handed for that run, whichever way the call's card was decided (the call answers
669
+ * for the run). Undefined when the leg carries no decision.
453
670
  */
454
671
  export declare function workflowParksContributor(input: {
455
672
  readonly decisions: ReadonlyArray<unknown> | undefined;
@@ -462,7 +679,7 @@ export declare function workflowParksContributor(input: {
462
679
  /** The leg's resumed card, when it holds a model's `Workflow({ resumeFromRunId })` call ({@link resumedWorkflowCallOf}). */
463
680
  readonly resumedCall?: ResumedWorkflowCall;
464
681
  readonly deliver: (notice: {
465
- code: "workflow.parked_decision_unused";
682
+ code: WorkflowParkDecisionNoticeCode;
466
683
  message: string;
467
684
  detail: Record<string, unknown>;
468
685
  }) => void;