@sema-agent/core 7.67.2 → 7.68.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 (505) hide show
  1. package/CHANGELOG.md +1533 -0
  2. package/README.md +18 -9
  3. package/README.zh-CN.md +16 -8
  4. package/dist/agents/agent-definition.d.ts +1 -1
  5. package/dist/agents/agent-definition.js +4 -1
  6. package/dist/agents/cascade.d.ts +2 -2
  7. package/dist/agents/cascade.js +3 -1
  8. package/dist/agents/cumulative-stats.d.ts +2 -1
  9. package/dist/agents/cumulative-stats.js +4 -1
  10. package/dist/agents/list-agents-tool.d.ts +30 -0
  11. package/dist/agents/list-agents-tool.js +45 -3
  12. package/dist/agents/peer-admission.d.ts +2 -2
  13. package/dist/agents/peer-session-drain.d.ts +2 -0
  14. package/dist/agents/peer-session-drain.js +1 -0
  15. package/dist/agents/repair-loop.js +3 -1
  16. package/dist/agents/retain-ledger.d.ts +61 -8
  17. package/dist/agents/retain-ledger.js +25 -3
  18. package/dist/agents/roster-store.d.ts +4 -2
  19. package/dist/agents/send-message-tool.d.ts +1 -1
  20. package/dist/agents/send-message-tool.js +20 -15
  21. package/dist/agents/subagent-steps.js +2 -10
  22. package/dist/agents/subagent.d.ts +3 -0
  23. package/dist/agents/subagent.js +106 -76
  24. package/dist/agents/tool-filter.d.ts +20 -11
  25. package/dist/agents/tool-filter.js +8 -4
  26. package/dist/agents/verify.d.ts +3 -1
  27. package/dist/agents/verify.js +2 -0
  28. package/dist/brain/anthropic.js +4 -4
  29. package/dist/brain/errors.d.ts +20 -0
  30. package/dist/brain/errors.js +114 -0
  31. package/dist/brain/open-responses.js +3 -1
  32. package/dist/brain/openai.js +3 -1
  33. package/dist/brain/provider-message.d.ts +5 -3
  34. package/dist/brain/provider-message.js +35 -8
  35. package/dist/brain/reasoning-request.d.ts +73 -19
  36. package/dist/brain/reasoning-request.js +164 -72
  37. package/dist/brain/reasoning-stamp.d.ts +26 -0
  38. package/dist/brain/reasoning-stamp.js +10 -0
  39. package/dist/brain/reasoning.d.ts +95 -162
  40. package/dist/brain/reasoning.js +31 -86
  41. package/dist/brain/route-adjudicator.d.ts +9 -7
  42. package/dist/brain/route-adjudicator.js +12 -10
  43. package/dist/brain/status-sink.d.ts +19 -64
  44. package/dist/brain/status-sink.js +5 -21
  45. package/dist/brain/stream-engine.d.ts +11 -2
  46. package/dist/brain/stream-engine.js +10 -0
  47. package/dist/core/a2a.d.ts +17 -5
  48. package/dist/core/a2a.js +11 -3
  49. package/dist/core/allow-entry.d.ts +35 -15
  50. package/dist/core/allow-entry.js +47 -60
  51. package/dist/core/ask-headline.d.ts +68 -0
  52. package/dist/core/ask-headline.js +23 -0
  53. package/dist/core/ask-origin.d.ts +36 -8
  54. package/dist/core/ask-origin.js +17 -10
  55. package/dist/core/ask-question.d.ts +34 -7
  56. package/dist/core/ask-question.js +10 -1
  57. package/dist/core/ask-unresolvable-notice.d.ts +7 -0
  58. package/dist/core/ask-unresolvable-notice.js +9 -3
  59. package/dist/core/auto-strip.d.ts +53 -0
  60. package/dist/core/auto-strip.js +76 -0
  61. package/dist/core/background-agent-store.d.ts +45 -5
  62. package/dist/core/background-agent-store.js +69 -15
  63. package/dist/core/background-shell.d.ts +2 -2
  64. package/dist/core/caller-text.js +2 -2
  65. package/dist/core/canonical-json.d.ts +13 -0
  66. package/dist/core/canonical-json.js +7 -0
  67. package/dist/core/checkpoint-features.d.ts +66 -20
  68. package/dist/core/checkpoint-features.js +12 -1
  69. package/dist/core/checkpoint-generation.d.ts +1 -1
  70. package/dist/core/checkpoint-queries.d.ts +1 -1
  71. package/dist/core/checkpoint-queries.js +4 -1
  72. package/dist/core/checkpoint-requirements.d.ts +25 -1
  73. package/dist/core/checkpoint-requirements.js +5 -1
  74. package/dist/core/checkpoint-row-verdict.d.ts +1 -0
  75. package/dist/core/checkpoint-row-verdict.js +4 -0
  76. package/dist/core/checkpoint-store.d.ts +66 -38
  77. package/dist/core/checkpoint-store.js +15 -6
  78. package/dist/core/child-clamp-seats.d.ts +6 -0
  79. package/dist/core/child-clamp-seats.js +1 -0
  80. package/dist/core/config-refusal-codes.d.ts +1 -1
  81. package/dist/core/config-refusal-codes.js +1 -0
  82. package/dist/core/delegation-frames.d.ts +9 -12
  83. package/dist/core/delegation-frames.js +9 -8
  84. package/dist/core/engine-capabilities.d.ts +21 -8
  85. package/dist/core/engine-capabilities.js +1 -1
  86. package/dist/core/engine-notice.d.ts +147 -34
  87. package/dist/core/engine-notice.js +27 -16
  88. package/dist/core/engine-storage-backend.d.ts +2 -1
  89. package/dist/core/env-budget.js +3 -3
  90. package/dist/core/env-knob-announce.d.ts +10 -10
  91. package/dist/core/env-knob-announce.js +3 -6
  92. package/dist/core/file-history-store.d.ts +29 -4
  93. package/dist/core/file-history-store.js +13 -0
  94. package/dist/core/frame-settlement.d.ts +2 -1
  95. package/dist/core/gate-fold.js +1 -1
  96. package/dist/core/gate-lanes.js +56 -49
  97. package/dist/core/governance-codes.d.ts +39 -3
  98. package/dist/core/governance-codes.js +61 -3
  99. package/dist/core/hooks.d.ts +29 -11
  100. package/dist/core/hooks.js +5 -2
  101. package/dist/core/human-input-projection.js +3 -3
  102. package/dist/core/input-author.d.ts +17 -3
  103. package/dist/core/input-author.js +15 -3
  104. package/dist/core/leg-identity.d.ts +10 -28
  105. package/dist/core/leg-identity.js +1 -21
  106. package/dist/core/lsp.d.ts +18 -13
  107. package/dist/core/lsp.js +30 -22
  108. package/dist/core/mailbox-store.d.ts +1 -1
  109. package/dist/core/mailbox-store.js +4 -4
  110. package/dist/core/mcp-connection-pool.d.ts +93 -4
  111. package/dist/core/mcp-connection-pool.js +104 -1
  112. package/dist/core/mcp-failure.d.ts +38 -12
  113. package/dist/core/mcp-failure.js +9 -13
  114. package/dist/core/mcp-probe.d.ts +4 -3
  115. package/dist/core/mcp-server-link.d.ts +4 -2
  116. package/dist/core/mcp-server-link.js +4 -5
  117. package/dist/core/mcp-server-spec.d.ts +3 -3
  118. package/dist/core/mcp-server-unavailable-notice.d.ts +22 -8
  119. package/dist/core/mcp-server-unavailable-notice.js +18 -4
  120. package/dist/core/mcp.d.ts +40 -6
  121. package/dist/core/mcp.js +39 -13
  122. package/dist/core/memory-engine/content-origin.js +2 -2
  123. package/dist/core/memory-engine/control-objects.d.ts +2 -4
  124. package/dist/core/memory-engine/control-objects.js +2 -10
  125. package/dist/core/memory-engine/delegation-settlement.js +6 -1
  126. package/dist/core/memory-engine/dual-root.js +3 -0
  127. package/dist/core/memory-engine/engine.d.ts +6 -4
  128. package/dist/core/memory-engine/engine.js +32 -29
  129. package/dist/core/memory-engine/file-backend.d.ts +20 -5
  130. package/dist/core/memory-engine/file-backend.js +21 -31
  131. package/dist/core/memory-engine/frontmatter.d.ts +2 -0
  132. package/dist/core/memory-engine/frontmatter.js +4 -0
  133. package/dist/core/memory-engine/layout.d.ts +114 -20
  134. package/dist/core/memory-engine/layout.js +340 -22
  135. package/dist/core/memory-engine/memory-deployment.d.ts +7 -5
  136. package/dist/core/memory-engine/mount-failed-notice.d.ts +19 -7
  137. package/dist/core/memory-engine/mount-failed-notice.js +43 -10
  138. package/dist/core/memory-engine/sync-client.js +4 -5
  139. package/dist/core/model-fallbacks.d.ts +5 -1
  140. package/dist/core/model-fallbacks.js +3 -3
  141. package/dist/core/model-receipt.d.ts +2 -1
  142. package/dist/core/model-receipt.js +12 -1
  143. package/dist/core/mods/kernel/dispatch.d.ts +2 -2
  144. package/dist/core/mods/kernel/dispatch.js +14 -6
  145. package/dist/core/mods/kernel/events.d.ts +8 -5
  146. package/dist/core/mods/kernel/events.js +2 -2
  147. package/dist/core/mods/kernel/index.d.ts +1 -1
  148. package/dist/core/mods/kernel/registration.d.ts +9 -0
  149. package/dist/core/mods/package.js +1 -1
  150. package/dist/core/mods/session-append.d.ts +4 -2
  151. package/dist/core/mods/session-append.js +3 -0
  152. package/dist/core/mods/stations.d.ts +7 -11
  153. package/dist/core/mods/stations.js +4 -7
  154. package/dist/core/mods/tool-call.d.ts +10 -8
  155. package/dist/core/mods/tool-call.js +15 -18
  156. package/dist/core/mounted-mcp.d.ts +0 -4
  157. package/dist/core/mounted-mcp.js +1 -1
  158. package/dist/core/park-noun.d.ts +24 -0
  159. package/dist/core/park-noun.js +21 -0
  160. package/dist/core/park-resumability.d.ts +60 -0
  161. package/dist/core/park-resumability.js +30 -0
  162. package/dist/core/permission-rule-provider.d.ts +24 -2
  163. package/dist/core/permission-rule-provider.js +11 -8
  164. package/dist/core/permission-rule-store.d.ts +8 -1
  165. package/dist/core/permission-rule-store.js +2 -3
  166. package/dist/core/permission-rules.d.ts +2 -1
  167. package/dist/core/permission-rules.js +8 -4
  168. package/dist/core/persisted-rule-arms.d.ts +3 -0
  169. package/dist/core/persisted-rule-arms.js +2 -1
  170. package/dist/core/present-plan-tool.d.ts +47 -3
  171. package/dist/core/present-plan-tool.js +62 -4
  172. package/dist/core/principal-name.d.ts +1 -1
  173. package/dist/core/principal-name.js +5 -5
  174. package/dist/core/process-identity.js +10 -5
  175. package/dist/core/protocol-http-auth.d.ts +30 -9
  176. package/dist/core/protocol-http-auth.js +113 -59
  177. package/dist/core/read-only-shell.js +9 -5
  178. package/dist/core/redaction-marks.d.ts +4 -26
  179. package/dist/core/redaction-marks.js +9 -21
  180. package/dist/core/remote-env.d.ts +43 -16
  181. package/dist/core/remote-env.js +1 -1
  182. package/dist/core/request-copy-projection.d.ts +1 -1
  183. package/dist/core/request-copy-projection.js +40 -50
  184. package/dist/core/resume-config-judge.js +1 -1
  185. package/dist/core/resume-startup-cause.d.ts +35 -18
  186. package/dist/core/resume-startup-cause.js +13 -10
  187. package/dist/core/retention.d.ts +167 -25
  188. package/dist/core/retention.js +100 -20
  189. package/dist/core/roles.d.ts +6 -0
  190. package/dist/core/roles.js +11 -5
  191. package/dist/core/rule-lane-reads.d.ts +3 -0
  192. package/dist/core/rule-lane-reads.js +5 -1
  193. package/dist/core/rule-store-fault.d.ts +70 -0
  194. package/dist/core/rule-store-fault.js +102 -0
  195. package/dist/core/runner/advertised-writable-dirs.js +16 -31
  196. package/dist/core/runner/announce-once-ledger.d.ts +19 -2
  197. package/dist/core/runner/announce-once-ledger.js +24 -2
  198. package/dist/core/runner/assemble-result.d.ts +6 -0
  199. package/dist/core/runner/assemble-result.js +1 -1
  200. package/dist/core/runner/auto-strip-notice.d.ts +36 -0
  201. package/dist/core/runner/auto-strip-notice.js +59 -0
  202. package/dist/core/runner/branch-window.d.ts +3 -0
  203. package/dist/core/runner/branch-window.js +37 -0
  204. package/dist/core/runner/caller-roster.d.ts +8 -3
  205. package/dist/core/runner/capability-withheld-seat.js +3 -9
  206. package/dist/core/runner/clock-and-limits.d.ts +22 -1
  207. package/dist/core/runner/clock-and-limits.js +30 -0
  208. package/dist/core/runner/contracts.d.ts +58 -35
  209. package/dist/core/runner/credential-refusal-seat.d.ts +2 -0
  210. package/dist/core/runner/credential-refusal-seat.js +47 -0
  211. package/dist/core/runner/cross-boundary-lane.js +6 -4
  212. package/dist/core/runner/decide-continuation.js +1 -1
  213. package/dist/core/runner/file-history-restore.d.ts +53 -2
  214. package/dist/core/runner/file-history-restore.js +29 -10
  215. package/dist/core/runner/forward-sink.d.ts +14 -1
  216. package/dist/core/runner/forward-sink.js +14 -12
  217. package/dist/core/runner/gate-exit.d.ts +8 -7
  218. package/dist/core/runner/gate-exit.js +13 -13
  219. package/dist/core/runner/git-status-frame.js +2 -4
  220. package/dist/core/runner/initial-run-state.js +1 -1
  221. package/dist/core/runner/main-call-account.d.ts +3 -1
  222. package/dist/core/runner/main-call-account.js +5 -3
  223. package/dist/core/runner/mcp-redial.d.ts +2 -5
  224. package/dist/core/runner/mcp-redial.js +2 -2
  225. package/dist/core/runner/nested-memory-content.d.ts +7 -1
  226. package/dist/core/runner/nested-memory-content.js +73 -13
  227. package/dist/core/runner/nested-memory-lane.d.ts +44 -19
  228. package/dist/core/runner/nested-memory-lane.js +152 -76
  229. package/dist/core/runner/park-commit.js +3 -1
  230. package/dist/core/runner/permission-rule-lanes.d.ts +8 -2
  231. package/dist/core/runner/permission-rule-lanes.js +29 -3
  232. package/dist/core/runner/person-path-rows.d.ts +3 -11
  233. package/dist/core/runner/person-path-rows.js +21 -24
  234. package/dist/core/runner/prepare-acquire-reconcile.js +3 -1
  235. package/dist/core/runner/prepare-artifact.d.ts +1 -1
  236. package/dist/core/runner/prepare-artifact.js +20 -14
  237. package/dist/core/runner/prepare-ask-lane.d.ts +9 -6
  238. package/dist/core/runner/prepare-ask-lane.js +6 -5
  239. package/dist/core/runner/prepare-boundary-parks.d.ts +7 -1
  240. package/dist/core/runner/prepare-boundary-parks.js +27 -24
  241. package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -2
  242. package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
  243. package/dist/core/runner/prepare-config-doors.d.ts +9 -24
  244. package/dist/core/runner/prepare-config-doors.js +58 -41
  245. package/dist/core/runner/prepare-context-lane.d.ts +2 -2
  246. package/dist/core/runner/prepare-context-lane.js +3 -5
  247. package/dist/core/runner/prepare-defer-classify.d.ts +1 -1
  248. package/dist/core/runner/prepare-defer-classify.js +1 -1
  249. package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
  250. package/dist/core/runner/prepare-delegation-surface.js +3 -2
  251. package/dist/core/runner/prepare-file-history.d.ts +62 -26
  252. package/dist/core/runner/prepare-file-history.js +117 -46
  253. package/dist/core/runner/prepare-gate-stations.d.ts +4 -0
  254. package/dist/core/runner/prepare-gate-stations.js +6 -5
  255. package/dist/core/runner/prepare-hands-readface.d.ts +9 -4
  256. package/dist/core/runner/prepare-hands-readface.js +8 -4
  257. package/dist/core/runner/prepare-inherited-gate.d.ts +11 -4
  258. package/dist/core/runner/prepare-inherited-gate.js +6 -6
  259. package/dist/core/runner/prepare-listings.d.ts +1 -1
  260. package/dist/core/runner/prepare-listings.js +1 -1
  261. package/dist/core/runner/prepare-memory.js +2 -2
  262. package/dist/core/runner/prepare-offload-wrappers.d.ts +1 -1
  263. package/dist/core/runner/prepare-offload-wrappers.js +1 -1
  264. package/dist/core/runner/prepare-park-ask.d.ts +10 -3
  265. package/dist/core/runner/prepare-park-ask.js +7 -9
  266. package/dist/core/runner/prepare-policy-chain.d.ts +18 -9
  267. package/dist/core/runner/prepare-policy-chain.js +18 -13
  268. package/dist/core/runner/prepare-project-context.d.ts +1 -1
  269. package/dist/core/runner/prepare-project-context.js +5 -3
  270. package/dist/core/runner/prepare-prompt-assembly.js +2 -1
  271. package/dist/core/runner/prepare-prompt-inputs.d.ts +2 -2
  272. package/dist/core/runner/prepare-prompt-inputs.js +1 -1
  273. package/dist/core/runner/prepare-protocol-tools.d.ts +4 -5
  274. package/dist/core/runner/prepare-protocol-tools.js +7 -7
  275. package/dist/core/runner/prepare-question-face.d.ts +4 -2
  276. package/dist/core/runner/prepare-run-refs.d.ts +7 -2
  277. package/dist/core/runner/prepare-run-refs.js +8 -7
  278. package/dist/core/runner/prepare-safety-scan.d.ts +4 -3
  279. package/dist/core/runner/prepare-suspend-saga.d.ts +3 -7
  280. package/dist/core/runner/prepare-suspend-saga.js +4 -3
  281. package/dist/core/runner/prepare-task.js +66 -53
  282. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +3 -2
  283. package/dist/core/runner/prepare-tool-disclosure-mount.js +2 -1
  284. package/dist/core/runner/prepare-turn-wiring.d.ts +3 -1
  285. package/dist/core/runner/prepare-turn-wiring.js +1 -1
  286. package/dist/core/runner/prepare-wiring-manifest.d.ts +9 -4
  287. package/dist/core/runner/prepare-wiring-manifest.js +14 -6
  288. package/dist/core/runner/prepare-workspace-restore.d.ts +4 -4
  289. package/dist/core/runner/prepare-workspace-restore.js +15 -6
  290. package/dist/core/runner/remote-env-retry.d.ts +3 -3
  291. package/dist/core/runner/restore-seat.d.ts +41 -0
  292. package/dist/core/runner/restore-seat.js +38 -0
  293. package/dist/core/runner/resume-admission.js +1 -1
  294. package/dist/core/runner/resume-apply.js +4 -3
  295. package/dist/core/runner/resume-checkpoint-screen.js +2 -1
  296. package/dist/core/runner/resume-internals-and-config.js +2 -1
  297. package/dist/core/runner/resume-preflight.js +2 -1
  298. package/dist/core/runner/rewind-files.js +22 -6
  299. package/dist/core/runner/rule-store-unreadable-notice.d.ts +8 -0
  300. package/dist/core/runner/rule-store-unreadable-notice.js +11 -0
  301. package/dist/core/runner/run-brain-sinks.d.ts +3 -6
  302. package/dist/core/runner/run-brain-sinks.js +6 -6
  303. package/dist/core/runner/run-compaction-machinery.d.ts +2 -2
  304. package/dist/core/runner/run-git-lane.d.ts +2 -0
  305. package/dist/core/runner/run-git-lane.js +2 -1
  306. package/dist/core/runner/run-harness-handlers.js +5 -4
  307. package/dist/core/runner/run-identity-wiring.js +20 -12
  308. package/dist/core/runner/run-leg.js +31 -72
  309. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  310. package/dist/core/runner/run-notification-lane.js +2 -4
  311. package/dist/core/runner/run-reasoning-seat.d.ts +5 -6
  312. package/dist/core/runner/run-reasoning-seat.js +13 -18
  313. package/dist/core/runner/run-settle-and-teardown.js +13 -9
  314. package/dist/core/runner/run-terminal-adoption.js +4 -8
  315. package/dist/core/runner/run-turn-boundary.js +6 -3
  316. package/dist/core/runner/runtask.d.ts +9 -4
  317. package/dist/core/runner/runtask.js +29 -22
  318. package/dist/core/runner/session-rule-policy.d.ts +11 -1
  319. package/dist/core/runner/shell-env-withheld.js +2 -7
  320. package/dist/core/runner/side-call-account.d.ts +5 -6
  321. package/dist/core/runner/side-call-account.js +2 -2
  322. package/dist/core/runner/stream-lifecycle-verbs.d.ts +3 -0
  323. package/dist/core/runner/stream-lifecycle-verbs.js +5 -3
  324. package/dist/core/runner/stream-settle-backstop.js +4 -6
  325. package/dist/core/runner/stream-steer-verb.d.ts +1 -1
  326. package/dist/core/runner/stream-steer-verb.js +4 -4
  327. package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -3
  328. package/dist/core/runner/sub-agent-deny-lists.js +7 -4
  329. package/dist/core/runner/teardown-bounded.d.ts +7 -0
  330. package/dist/core/runner/teardown-bounded.js +7 -0
  331. package/dist/core/runner/terminal-account.js +41 -13
  332. package/dist/core/runner/terminal-projection.d.ts +1 -5
  333. package/dist/core/runner/tool-end-body.d.ts +9 -3
  334. package/dist/core/runner/tool-end-body.js +6 -3
  335. package/dist/core/runner/tool-output-projection.d.ts +13 -4
  336. package/dist/core/runner/tool-output-projection.js +10 -14
  337. package/dist/core/runner/turn-attachments.d.ts +3 -2
  338. package/dist/core/runner/turn-attachments.js +12 -5
  339. package/dist/core/runner-deps.d.ts +6 -6
  340. package/dist/core/runtime-caps.d.ts +2 -1
  341. package/dist/core/secret-env.d.ts +20 -3
  342. package/dist/core/secret-env.js +13 -15
  343. package/dist/core/session-checkout.d.ts +115 -15
  344. package/dist/core/session-checkout.js +435 -136
  345. package/dist/core/session-policy-store.js +21 -3
  346. package/dist/core/session-reconcile.js +1 -0
  347. package/dist/core/session-store.js +2 -0
  348. package/dist/core/session.d.ts +11 -1
  349. package/dist/core/shell-run-candidates.d.ts +1 -0
  350. package/dist/core/shell-run-candidates.js +1 -1
  351. package/dist/core/shutdown-debug.d.ts +6 -5
  352. package/dist/core/shutdown-debug.js +5 -1
  353. package/dist/core/skill-grant.js +4 -1
  354. package/dist/core/skills-directory.js +5 -3
  355. package/dist/core/spec-contract.d.ts +1 -1
  356. package/dist/core/store-contracts/checkpoint-store-contract.js +2 -7
  357. package/dist/core/store-contracts/file-history-store-contract.js +26 -2
  358. package/dist/core/store-contracts/session-deletion-cascade-contract.js +130 -14
  359. package/dist/core/store-contracts/task-list-store-contract.d.ts +2 -1
  360. package/dist/core/store-contracts/task-list-store-contract.js +28 -1
  361. package/dist/core/task-event.d.ts +48 -27
  362. package/dist/core/task-notification.d.ts +15 -9
  363. package/dist/core/task-notification.js +12 -0
  364. package/dist/core/task-registry-agent.d.ts +24 -22
  365. package/dist/core/task-registry-agent.js +65 -46
  366. package/dist/core/task-registry-shared.d.ts +17 -5
  367. package/dist/core/task-registry.d.ts +17 -6
  368. package/dist/core/task-registry.js +6 -1
  369. package/dist/core/task-result.d.ts +71 -25
  370. package/dist/core/task-spec-members.d.ts +0 -1
  371. package/dist/core/task-spec-members.js +1 -1
  372. package/dist/core/task-spec.d.ts +60 -52
  373. package/dist/core/task-stream.d.ts +45 -12
  374. package/dist/core/terminal-cause.d.ts +45 -8
  375. package/dist/core/terminal-cause.js +5 -0
  376. package/dist/core/tool-card-bound.d.ts +32 -0
  377. package/dist/core/tool-card-bound.js +33 -0
  378. package/dist/core/tool-catalog-entries.d.ts +9 -0
  379. package/dist/core/tool-catalog-entries.js +48 -0
  380. package/dist/core/tool-errors.d.ts +4 -3
  381. package/dist/core/tool-face.d.ts +3 -3
  382. package/dist/core/tool-mount-facts.d.ts +3 -2
  383. package/dist/core/tool-mount-facts.js +1 -1
  384. package/dist/core/tool-mount-static.js +7 -5
  385. package/dist/core/tool-policy.d.ts +21 -19
  386. package/dist/core/tool-policy.js +5 -6
  387. package/dist/core/tool-registry.d.ts +3 -1
  388. package/dist/core/tool-registry.js +15 -1
  389. package/dist/core/tool-result-store.d.ts +9 -3
  390. package/dist/core/tool-result-store.js +14 -1
  391. package/dist/core/tool-roster.d.ts +6 -0
  392. package/dist/core/tool-roster.js +18 -0
  393. package/dist/core/tool-spec.d.ts +17 -8
  394. package/dist/core/trace.d.ts +35 -31
  395. package/dist/core/types.d.ts +2 -2
  396. package/dist/core/untrusted-egress.d.ts +19 -7
  397. package/dist/core/untrusted-egress.js +26 -7
  398. package/dist/core/untrusted-text.d.ts +6 -18
  399. package/dist/core/untrusted-text.js +11 -4
  400. package/dist/core/user-attachment.d.ts +9 -6
  401. package/dist/core/user-attachment.js +12 -10
  402. package/dist/core/user-row-origin.d.ts +44 -25
  403. package/dist/core/user-row-origin.js +30 -20
  404. package/dist/core/wiring-manifest.d.ts +26 -7
  405. package/dist/core/wiring-manifest.js +14 -11
  406. package/dist/core/workspace-snapshot.d.ts +3 -1
  407. package/dist/core/workspace-snapshot.js +1 -0
  408. package/dist/engine/execution-env/node-execution-env.d.ts +23 -16
  409. package/dist/engine/execution-env/node-execution-env.js +127 -67
  410. package/dist/engine/harness/agent-harness.d.ts +4 -5
  411. package/dist/engine/harness/agent-harness.js +2 -7
  412. package/dist/engine/harness/types.d.ts +51 -19
  413. package/dist/engine/harness/types.js +28 -1
  414. package/dist/engine/llm/types.d.ts +26 -14
  415. package/dist/engine/llm/types.js +2 -2
  416. package/dist/engine/loop/agent-loop.d.ts +2 -2
  417. package/dist/engine/loop/agent-loop.js +51 -275
  418. package/dist/engine/loop/types.d.ts +0 -18
  419. package/dist/engine/session/import-validate.d.ts +3 -0
  420. package/dist/engine/session/import-validate.js +34 -2
  421. package/dist/engine/session/repo-utils.d.ts +42 -4
  422. package/dist/engine/session/repo-utils.js +33 -5
  423. package/dist/engine/session/session.d.ts +41 -14
  424. package/dist/engine/session/session.js +96 -25
  425. package/dist/index.d.ts +21 -16
  426. package/dist/index.js +16 -10
  427. package/dist/orchestration/run-spec.d.ts +1 -1
  428. package/dist/orchestration/run-workflow-tool.d.ts +12 -9
  429. package/dist/orchestration/run-workflow-tool.js +15 -19
  430. package/dist/orchestration/workflow-governance.js +13 -21
  431. package/dist/orchestration/workflow-observe.d.ts +4 -3
  432. package/dist/orchestration/workflow-primitives.d.ts +1 -1
  433. package/dist/orchestration/workflow-record-artifact.d.ts +14 -0
  434. package/dist/orchestration/workflow-record-artifact.js +32 -0
  435. package/dist/orchestration/workflow-script-store.d.ts +9 -0
  436. package/dist/orchestration/workflow-script-store.js +20 -1
  437. package/dist/orchestration/workflow-types.d.ts +33 -3
  438. package/dist/orchestration/workflow.d.ts +24 -14
  439. package/dist/orchestration/workflow.js +52 -23
  440. package/dist/prompt-assembly/artifact.js +4 -8
  441. package/dist/prompt-assembly/catalog/engine.d.ts +263 -0
  442. package/dist/prompt-assembly/catalog/engine.js +30 -0
  443. package/dist/prompt-assembly/catalog/index.d.ts +1 -1
  444. package/dist/prompt-assembly/catalog/index.js +2 -2
  445. package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.d.ts +1 -1
  446. package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.js +29 -0
  447. package/dist/prompt-assembly/epoch.js +6 -8
  448. package/dist/prompt-assembly/turn-snapshot.js +8 -9
  449. package/dist/stores/file/background-agent-store.js +5 -6
  450. package/dist/stores/file/checkpoint-store.d.ts +0 -4
  451. package/dist/stores/file/checkpoint-store.js +7 -3
  452. package/dist/stores/file/file-history-store.d.ts +8 -0
  453. package/dist/stores/file/file-history-store.js +72 -0
  454. package/dist/stores/file/fs-atomic.js +17 -12
  455. package/dist/stores/file/index.js +11 -5
  456. package/dist/stores/file/mailbox-store.js +13 -4
  457. package/dist/stores/file/permission-rule-store.js +14 -13
  458. package/dist/stores/file/shared-ledger.d.ts +4 -0
  459. package/dist/stores/file/shared-ledger.js +4 -0
  460. package/dist/stores/file/task-list-store.js +12 -3
  461. package/dist/stores/file/workflow-run-store.js +1 -0
  462. package/dist/tools/fs/bash-program-position.d.ts +4 -2
  463. package/dist/tools/fs/bash-program-position.js +1 -1
  464. package/dist/tools/fs/bash-readonly-classifier.js +1 -1
  465. package/dist/tools/fs/bound-open.d.ts +97 -0
  466. package/dist/tools/fs/bound-open.js +103 -0
  467. package/dist/tools/fs/containment-face.d.ts +2 -2
  468. package/dist/tools/fs/fs-pdf.d.ts +7 -1
  469. package/dist/tools/fs/fs-pdf.js +31 -23
  470. package/dist/tools/fs/fs-read.d.ts +24 -17
  471. package/dist/tools/fs/fs-read.js +84 -53
  472. package/dist/tools/fs/fs-shared.d.ts +14 -12
  473. package/dist/tools/fs/fs-shared.js +5 -4
  474. package/dist/tools/fs/fs-write.d.ts +2 -2
  475. package/dist/tools/fs/fs-write.js +20 -12
  476. package/dist/tools/fs/index.d.ts +4 -4
  477. package/dist/tools/fs/index.js +2 -2
  478. package/dist/tools/fs/notebook.d.ts +1 -1
  479. package/dist/tools/fs/pdf.d.ts +12 -3
  480. package/dist/tools/fs/pdf.js +22 -9
  481. package/dist/tools/fs/read-deny-home.d.ts +3 -2
  482. package/dist/tools/fs/read-deny-home.js +8 -11
  483. package/dist/tools/fs/safety.d.ts +3 -2
  484. package/dist/tools/fs/shell-read-check.js +10 -9
  485. package/dist/tools/monitor.d.ts +6 -5
  486. package/dist/tools/task-list.d.ts +16 -6
  487. package/dist/tools/task-list.js +4 -0
  488. package/dist/tools/web.d.ts +9 -1
  489. package/dist/tools/web.js +8 -3
  490. package/dist/tools/worktree.d.ts +7 -5
  491. package/dist/tools/worktree.js +4 -3
  492. package/package.json +4 -3
  493. package/test/export-surface.snapshot.json +93 -7
  494. package/wire-changes/core-stores-sql@7.67.3.json +39 -0
  495. package/wire-changes/core-stores-sql@7.68.0.json +39 -0
  496. package/wire-changes/core@7.67.3.json +65 -0
  497. package/wire-changes/core@7.68.0.json +4257 -0
  498. package/wire-changes/mods-kernel@7.67.3.json +39 -0
  499. package/wire-changes/mods-kernel@7.68.0.json +129 -0
  500. package/wire-changes/primitives@7.67.3.json +39 -0
  501. package/wire-changes/primitives@7.68.0.json +253 -0
  502. package/wire-changes/wiki-gate@7.67.3.json +39 -0
  503. package/wire-changes/wiki-gate@7.68.0.json +39 -0
  504. package/dist/core/runner/credential-origin-seat.d.ts +0 -2
  505. package/dist/core/runner/credential-origin-seat.js +0 -20
package/dist/index.d.ts CHANGED
@@ -36,7 +36,7 @@ export { ARTIFACT_ACTIONS, ARTIFACT_PLANES, ARTIFACT_COMMIT_CERTAINTIES, ARTIFAC
36
36
  export { createArtifactTool, artifactAttemptId, normalizePublishedPath, mediaTypeOf, type ArtifactToolOptions, type ArtifactLocalRead } from "./tools/artifact/artifact-tool.js";
37
37
  export { localArtifactStub, LocalArtifactStub, EVAL_STUB_URL_PREFIX, LOCAL_STUB_MAX_FILE_BYTES, LOCAL_STUB_MAX_TOTAL_BYTES, type LocalArtifactStubOptions } from "./tools/artifact/local-stub.js";
38
38
  export { ARTIFACT_CONFORMANCE_VECTORS, artifactConformanceVectors, runArtifactConformance, type ArtifactConformanceHooks, type ArtifactConformanceOptions, type ArtifactConformanceStatus, type ArtifactConformanceVector, type ArtifactConformanceResult, type ArtifactConformanceReport, } from "./tools/artifact/conformance.js";
39
- export { createTaskListTools, createMemoryTaskListStore, assertJsonMetadata, type TaskListItem, type TaskListStore } from "./tools/task-list.js";
39
+ export { createTaskListTools, createMemoryTaskListStore, assertJsonMetadata, compareTaskIds, type TaskListItem, type TaskListStore } from "./tools/task-list.js";
40
40
  export { TASK_LIST_ITEM_ROW_SHAPE, TASK_LIST_ROW_MALFORMED_CODE, TASK_LIST_STATUSES, TaskListStoreError, readStoredTaskListItem, listStoredTaskListEntry, admitTaskListItem, type TaskListEntry, type DamagedTaskListItem, } from "./tools/task-list.js";
41
41
  export { taskListStoreContract, type TaskListStoreContractHooks } from "./core/store-contracts/task-list-store-contract.js";
42
42
  export { ROW_EXITS, type RowExit, type RowAnswer, type RowContext, type RowCorrupt, type RowVerdict, type DamagedRowVerdict, type RowShapeReader } from "./core/row-shape.js";
@@ -76,13 +76,13 @@ export { materializeMcpTools, MCP_PREFIX, type MaterializedMcp, type McpServerSt
76
76
  export { renderMcpPromptForModel, type McpHostRead, type McpPromptEntry, type McpPromptAnswer, type McpResourceEntry, type McpResourceTemplateEntry, type McpResourceContents, type McpContentBlock } from "./core/mcp-host-read.js";
77
77
  export { mcpStartupTimeoutMs } from "./core/mcp.js";
78
78
  export { judgeSessionMetaKey, MCP_SESSION_META_KEY_MAX_CHARS, type SessionMetaKeyReading } from "./core/mcp-call-meta.js";
79
- export { McpConnectionPool } from "./core/mcp-connection-pool.js";
79
+ export { McpConnectionPool, type ForgetMcpFailureRequest, type ForgetMcpFailureResult } from "./core/mcp-connection-pool.js";
80
80
  export { probeMcpServers, type McpProbeResult } from "./core/mcp-probe.js";
81
81
  export { judgeMcpNames, describeMcpNameConflict, type McpNameConflict, type McpNameSetServer, type McpNameVerdict } from "./core/mcp-name-judge.js";
82
82
  export { MCP_FAILURE_KINDS, MCP_DELIVERY_VERDICTS, MCP_LIVENESS_STATES, MCP_AUTHORIZATION_REASONS, classifyMcpFailure, type McpFailure, type McpFailureFields, type McpFailureKind, type McpDelivered, type McpLivenessState, type McpServerLiveness, type McpAuthorization, type McpAuthorizationReason } from "./core/mcp-failure.js";
83
83
  export { MCP_INJECTION_DROP_REASONS, MCP_INJECTION_DROP_TEXT, mcpInjectionDroppedNotice, type McpInjectionDropReason, type McpInjectionDropFacts } from "./core/mcp-injection-drop.js";
84
84
  export { askUnresolvableNotice, type AskUnresolvableFacts } from "./core/ask-unresolvable-notice.js";
85
- export { ASK_UNRESOLVABLE_CAUSES } from "./core/ask-unresolvable-notice.js";
85
+ export { ASK_UNRESOLVABLE_CAUSES, type AskUnresolvableCause } from "./core/ask-unresolvable-notice.js";
86
86
  export { APPROVAL_REMEDY_KINDS, type ApprovalRemedy, type ApprovalRemedyKind } from "./core/ask-origin.js";
87
87
  export { USER_INPUT_UNDRAINED_CAUSES, type UserInputUndrainedCause, USER_INPUT_UNDRAINED_FAMILIES } from "./core/engine-notice.js";
88
88
  export { setDefaultEngineNoticeSeat } from "./core/engine-notice.js";
@@ -222,7 +222,8 @@ export { type RuleFaceView, catalogRuleFaceView } from "./core/permission-rules.
222
222
  export { DURABLE_HISTORY_NAMES } from "./engine/compaction/utils.js";
223
223
  export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, type SubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, type AutoModeArmReason, type AutoModeArmFact, type WiringManifest, type WiringManifestMcpEntry, LSP_LANES, type LspLane, type WiringFacts, type WiringLegKind, type AskSeamForm, APPROVAL_REACH, type ApprovalReach, isApprovalReach, type AskEffective, type QuestionChannelState, type SeamProvenance, type ParkLaneReason, type SuspendLaneReason, type ManifestDurability, type StaticWiringDeps, type StaticWiringSpec, } from "./core/wiring-manifest.js";
224
224
  export { RUN_ORIGINS, type RunOrigin, isRunOrigin } from "./core/run-origin.js";
225
- export { INPUT_AUTHORS, type InputAuthor, isInputAuthor } from "./core/input-author.js";
225
+ export { INPUT_AUTHORS, type InputAuthor, isInputAuthor, type InputWindow } from "./core/input-author.js";
226
+ export { USER_ROW_ORIGINS, type UserRowOrigin, type UserRowSource, isUserRowOrigin, userRowSourceOf } from "./core/user-row-origin.js";
226
227
  export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, type ParkSelfCheckResult, type ParkProbeFinding, type ParkProbeFindingCode, } from "./core/park-selfcheck.js";
227
228
  export { type StoreDurability } from "./core/checkpoint-store.js";
228
229
  export { type StoreFidelity } from "./core/checkpoint-store.js";
@@ -251,6 +252,7 @@ export { createAllowDenyPolicy, createApprovalPolicy,
251
252
  * policy verdict cannot get re-adjudicated). Exported so a host can NAME it instead of deriving it through
252
253
  * `Parameters<typeof createApprovalPolicy>[0]["approve"]`. */
253
254
  type ApprovalSeatOutcome, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, combinePolicies, abortedSeatDeny, noApproverSeatDeny, wrapToolPolicy, decisionText, resolveAsk, toolPolicyNameSets, toolPolicyPathRules, type ToolPolicyNameSets, type NamedToolPolicy, type ToolPolicyProjection, type ToolPolicyProjectionComponent, type ConstraintChainEntry, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, type ToolPolicy, type ToolCallRequest, type PermissionResult, type DecisionReason, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, BIDI_CONTROL_CHARS, carriesBidiControls, type OnAsk, asPolicyApprover, isPolicyApprover, declareClassAnswers, type AskOutcome, type ResolvedAsk, type EngineAttestation, type AskRequest, type AskDelegationProvenance, type AskRuleEvidence, type AskEvidenceAbsence, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
255
+ export { writtenFeedback, unfitFeedbackOf, type UnfitFeedback } from "./core/approval-words.js";
254
256
  export { type ExistingTarget, type ExistingTargetKind, type ExistingTargetWithheldReason, EXISTING_TARGET_KINDS, EXISTING_TARGET_WITHHELD_REASONS, EXISTING_TARGET_READ_CAP, } from "./core/existing-target.js";
255
257
  export { type ReadRootGrantScreen } from "./core/read-root-grant-screen.js";
256
258
  export { type AskOrigin, ASK_ORIGINS, isAskOrigin, ORIGIN_IMPLIES_REAL_APPROVAL, PERSISTED_RULE_MANDATES, type PersistedRuleMandate, isPersistedRuleMandate, screenAskClassMembers } from "./core/ask-origin.js";
@@ -262,7 +264,8 @@ export type { PermissionSeatInputs, PermissionSeatReading } from "./core/mode-po
262
264
  export type { SkillGateSeats, SkillGrantHit, SkillGrantLane, SkillGrantOrigin, SkillGrantRecord } from "./core/skill-grant.js";
263
265
  export { SKILL_GRANT_ORIGINS } from "./core/skill-grant.js";
264
266
  export type { BoundSkillGrants } from "./core/skill-grant-binding.js";
265
- export { ALLOW_ENTRY_INERT_REASONS, readRuleEntry, compileAllowList, renderListEntry, screenAllowedToolsValue, type RuleEntryReading, type AllowEntryInertReason, type AllowEntryInertDetail, type CompiledAllowEntry, type AllowEntryGateSeats, type AllowEntryLane, type AllowEntryHit, type AllowListEntry } from "./core/allow-entry.js";
267
+ export { AUTO_STRIP_REASONS, type AutoStripReason, type AutoStripRowReason } from "./core/auto-strip.js";
268
+ export { ALLOW_ENTRY_INERT_REASONS, allowEntryAutoStrip, readRuleEntry, compileAllowList, renderListEntry, screenAllowedToolsValue, type RuleEntryReading, type AllowEntryInertReason, type AllowEntryInertDetail, type CompiledAllowEntry, type AllowEntryGateSeats, type AllowEntryLane, type AllowEntryHit, type AllowListEntry } from "./core/allow-entry.js";
266
269
  export { ALLOW_RULE_MEMBERS, type AllowRuleMember, type AllowRuleShadow } from "./core/allow-rule-shadow.js";
267
270
  export { mintNamespacePrefix } from "./core/protocol-naming.js";
268
271
  export { readDenyClassifierRules, renderClassifierDenyRules, type DerivedDenyRule } from "./core/auto-mode-prompt.js";
@@ -303,9 +306,11 @@ export { createPermissionRulePolicy, validatePermissionRules, parsePermissionRul
303
306
  export { RULE_BEHAVIORS, RULE_BEHAVIOR_PRECEDENCE, RULE_BEHAVIORS_BY_PRECEDENCE, isRuleBehavior, readRowBehavior, adjudicatePersistedRules, adjudicatePersistedPathRules, adjudicatePersistedToolRules, ruleReachesProgramRun, programRunReachOf, PROGRAM_RUN_REACHES, type ProgramRunReachOutcome, pathRuleReachOf, ruleBasesNeeded, PATH_RULE_BASES, PATH_RULE_BASE_LABEL, ruleToolGrammarOf, COMMAND_RULE_TOOL, READ_RULE_TOOL, type PathRuleBase, type PathRuleBases, type RuleBehavior, type PersistedRuleVerdict, parseRuleText, formatRuleText, ruleAdmitsCommand, findAdmittingRule, suggestRulesForCommand, scopeCoversCwd, pathWithinRoot, isRuleLive, renderUntrustedCommandText, stripFormatCharacters, UNCOVERED_SEGMENT_REASON_BASELINE, RULE_OFFERS_ABSENCE_BASELINE, type UncoveredSegmentDetail, PERSISTED_RULE_MATCHES, RULE_OFFER_KINDS, RULE_OFFER_BATCH_MEMBER_KINDS, UNCOVERED_SEGMENT_REASONS, EDITED_RULE_BREADTH_WARNING_CODES, RULE_ADD_ORIGINS, type EditedRuleBreadthWarning, directoryRuleAdmits, BARE_INTERPRETER_NAMES, MAX_RULE_TEXT_CHARS, type PersistedRule, type RuleTombstone, type RuleScope, type RuleDot, type RuleAdd, type RuleAddOrigin, type RuleOffer, type RuleOfferBatchMember, type SegmentRuleSuggestion, type SegmentCoverage, type RuleReject, type RuleRejectCode, type ParsedRule, type PersistedRuleTool, type PersistedRuleMatch, } from "./core/permission-rule-model.js";
304
307
  export { removePersistedRule, addPersistedRule, applyTombstones, sameScope, sameRuleIdentity, isValidConsentScope, isValidDurableScope, InMemoryDurableRulePartition, EMPTY_DURABLE_RULE_PARTITION, type DurableRulePartition, type DurableRulePartitionProvider, type RuleWriteOutcome, type StoredRules, type RemoveResult, type AddResult, type PutResult, joinRuleStates, applySyncJoin, type RuleSyncJoinBase, screenRuleSyncState, collectBelowFrontier, ruleSyncVector, joinFrontiers, dotAtOrBelowFrontier, type RuleSyncState, type RuleSyncFrontier, type RuleSyncDrop, type RuleSyncLandingReport, type QuarantinedRuleAdd, PERMISSION_RULE_WRITER, writerOf, foldDelta, addDotsOf, assertDeleteDeltaCarriesNoAdd, assertRedemptionNotQuarantined, assertWriteDeltaScopeDurable, PERMISSION_RULES_LATER_GRAMMAR_CODE, PERMISSION_RULES_DAMAGED_BUCKET_CODE, PERMISSION_RULES_UNREADABLE_BUCKET_CODE, type PermissionRuleWriter, type WritableDurableRulePartition, type RuleWriteDelta, type RuleAddDelta, type RuleTightenAddDelta, type RuleDeleteDelta, type RuleSyncJoinDelta, type RawRuleSyncState, type RedemptionAuthorization, } from "./core/permission-rule-store.js";
305
308
  export { readRuleOwner, sameRuleOwner, type RuleOwner, RULE_OWNER_KINDS, } from "./core/rule-owner.js";
306
- export { principalNameOf } from "./core/principal-name.js";
309
+ export { principalNameOf, PRINCIPAL_NAME_MAX_CHARS } from "./core/principal-name.js";
310
+ export { isolationScopeOf, callScopeOf } from "./core/isolation-scope.js";
307
311
  export { syncPermissionRules, parseRuleSyncResponse, PERMISSION_RULE_SYNC_PATH, LOCAL_OWNER_UNSYNCABLE_CODE, type PermissionRuleSyncTransport, type PermissionRuleSyncResult, type RuleSyncRequestBody, type RuleSyncResponseBody, } from "./core/permission-rule-sync.js";
308
312
  export { createPermissionRuleStoreProvider, effectivePermissionRules, effectiveOrThrow, ruleSourceOf, type PermissionRuleStore, type PermissionRuleStoreProvider, type PermissionRuleStoreConfig, type EffectivePermissionRules, type EffectivePermissionRule, type RemovedPermissionRule, type RuleSource, } from "./core/permission-rule-provider.js";
313
+ export { RULE_STORE_FAULT_REASONS, type RuleStoreFault, type RuleStoreFaultReason, type RuleStoreSource } from "./core/rule-store-fault.js";
309
314
  export { InMemorySessionRulePartition, type SessionRulePartition, type SessionRuleAdd, type SessionRuleApplyResult, } from "./core/permission-rule-session.js";
310
315
  export { readShellCommand, isFullyReadable, MAX_SHELL_READ_CHARS, SHELL_WRAPPER_TABLE, type ShellCommandShape, type ShellSegment, type ShellWord, type ShellRedirection, type ShellWrapperName, } from "./core/shell-run-candidates.js";
311
316
  export { readOnlyShellVerdict, type ReadOnlyShellVerdict, type ReadOnlyShellOptions } from "./core/read-only-shell.js";
@@ -319,7 +324,7 @@ export { AdoptionError, assertAdoptionBootGate, readRootAdoptionFile, writeRootA
319
324
  export { adoptLocalDataRoot, ackAdoptionConfig, witnessAdoptionConfig, listAdoptionQuarantine, readAdoptionStatus, type AdoptionStatus, type AdoptLocalDataRootOptions, type AdoptLocalDataRootResult, type AdoptionCarriageLeg, type AdoptionCarriageLegContext, type AdoptionConfigWitnessReceipt, } from "./stores/file/adoption/adopt.js";
320
325
  export { formatHookFeedback, runToolGate, createHookEnvCapabilities, type PersistedRuleHit, type PersistedRuleHitRule, type PersistedRuleUnreadable, type PersistedRuleCoverage, type PersistedRuleAnswer, normalizePersistedRuleHit, type HookInvocationIdentity, type ClassicEventBase, type PreToolUseEvent, type PostToolUseEvent, type PostToolUseFailureEvent, type PostToolBatchEvent, type UserPromptSubmitEvent, type SubagentStartEvent, type StopEvent, type StopFailureEvent, type SessionStartEvent, type SessionEndEvent, type PreCompactEvent, type PostCompactEvent, type MessageDisplayEvent, type MessageDisplayResult, type StopHookResult, type HookEnvCapabilities, type HookToolOutput, type PreToolUseResult, type PostToolUseResult, type UserPromptSubmitResult, type SubagentStartResult, type HookToolFailure, type PostToolUseFailureResult, type PostToolBatchCall, type PostToolBatchResult, type PreCompactContext, type PreCompactResult, type PostCompactContext, type PermissionDeniedPayload, } from "./core/hooks.js";
321
326
  export type { ClassicEventMap, ClassicEventName, ObservedAnswer, EngineModRegistration } from "./core/mods/classic-events.js";
322
- export { KERNEL_CONTRACT_VERSION, MOD_TIERS, MOD_SEATS, MOD_EVENT_SIDES, MOD_EVENT_TABLE, MODS_INVALID_CODE, MODS_REGISTRATION_REFUSED_CODE, type ModTier, type ModRegistrationTier, type ModSeat, type ModEventSide, type ModEventName, type ModEventRow, type ModStation, type ModRegistration, type ModUses, type On, type ModHandler, type ModHandlerOptions, type ModNext, type ModOrigin, type ModTraceEntry, type ModCaughtError, type ModDollarBase, type ModEventPayload, type ModMatcher, type ModAdmissionRecord, type ModTimer, } from "./core/mods/kernel/index.js";
327
+ export { KERNEL_CONTRACT_VERSION, MOD_TIERS, MOD_SEATS, MOD_EVENT_SIDES, MOD_EVENT_TABLE, MODS_INVALID_CODE, MODS_REGISTRATION_REFUSED_CODE, type ModTier, type ModRegistrationTier, type ModSeat, type ModEventSide, type ModEventName, type ModEventRow, type ModStation, type ModRegistration, type ModUses, type On, type ModHandler, type ModHandlerOptions, type ModNext, type ModParticipant, type ModOrigin, type ModTraceEntry, type ModCaughtError, type ModDollarBase, type ModEventPayload, type ModMatcher, type ModAdmissionRecord, type ModTimer, } from "./core/mods/kernel/index.js";
323
328
  export type { AgentSpawnAnswer, EngineDollar, ModelCompleteBlock, PromptSubmitAnswer, SessionAppendAnswer, SessionCompactAnswer, SessionSendAnswer, SessionUsage, SessionVersion, ToolCallAnswer } from "./core/mods/dollar.js";
324
329
  export type { ContextOccupancy } from "./core/mods/lifecycle-stations.js";
325
330
  export { admitModChain, promptScreenDeclaredBy } from "./core/mods/stations.js";
@@ -332,7 +337,7 @@ export { CREDENTIAL_REF_KINDS, CREDENTIAL_REF_TRUST, CREDENTIAL_REF_TEXT_MAX, CR
332
337
  export { composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, type NormalizedMemorySpec, type MemorySpecInput, firstSentence, detectSecret, MEMORY_PROJECT_KEY_ABSENT_REASONS, type MemoryProjectKeyAbsentReason, type MemoryProjectKey, } from "./core/memory.js";
333
338
  export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, type MemoryBackendContractHooks, memoryGovernanceStoreContract, type MemoryGovernanceStoreContractHooks, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, type OriginClearanceRow, type OriginClearanceEvent, type OriginClearanceShadow, committedDistilledOf, distilledEquals, type MemoryEntryDistilled, type MemoryEntryDistilledInput, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, type MemoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, type ConsolidationGateRead, type ConsolidationGateRow, type ConsolidationIntent, type ConsolidationIntentCredentialRow, type ConsolidationLeaseSeat, type ConsolidationProductProposal, type ConsolidationProposal, type ConsolidationWriteGate, type MemoryConsolidationOptions, type ConsolidationCommitReceipt, type ConsolidationReconcileReport, type ConsolidationResolveReceipt, type ConsolidationPlanSummary, type ConsolidationPlanFoldEvidence, type SessionMemoryStatus, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, type CleanArmLeakFinding, type CleanArmLeakVerdict, type MemoryDistillerPurityContract, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, type ConsolidationDistillFn, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationDriveResult, type ConsolidationFoldState, type DistillerCandidate, type DistillerChatAnswer, type DistillerChatFn, type DistillerChatRequest, type FuseSchedule, type LlmConsolidationPlan, type LlmConsolidationPlanArm, type LlmConsolidationPlanProduct, type LlmDistillerContract, type MintLlmConsolidationPlanResult, type PlanParseRepairs, type SanitizedLlmGroups, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, type ConsolidationDriverEngine, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type ConsolidationRunStopReason, type ConsolidationWriteJudge, type ConsolidationWriteTarget, type RunMemoryConsolidationOptions, isInstructionEntry, type MemoryEntryOrigin, type MemoryOriginCause, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, fileSessionCaptureRecordStore, type SessionCaptureOptOutRecord, type SessionCaptureOptOutMarkOutcome, type SessionCaptureRecordStore, readV2HeaderHints, type V2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, type ControlPlaneRebuildReceipt, type StrictControlPlaneLedger, type ChallengeAssignment, type ChallengeEvent, type ChallengedHistoryRow, type LineagePendingTxn, type LineagePromotion, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, type MemorySearchDetails, type MemorySearchHit, type CleanMemorySearchHit, type ExposedMemorySearchHit, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, type MemoryGetDetails, type MemoryIndexDetails, type MemoryIndexRow, type CleanMemoryIndexRow, type ExposedMemoryIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, type MemoryAnnouncement, type ScanFinding, type MemoryEngineOptions, type MemoryInjection, type EntryProvenanceAccount, type TransferEvidence, type CommittedBinding, type CommittedEntrySnapshot, type CommittedScopeSnapshots, type EntryCustodyReport, erasureSelectHash, type EraseMemoryEntriesInput, type ErasureCarrierAnswer, type ErasureCarrierClass, type ErasureCountAnswer, type ErasureSelect, type ErasedBinding, type MemoryErasureAttestation, computeMemoryBundleHash, type MemoryExportBundle, type MemoryImportReport, type MemoryExportSnapshot, type MemoryBundleImportPlan, type BundleChallengeRow, type BundleLineageRow, type BundlePollutedSession, type MemoryBackend, type MemoryGovernanceStore, MEMORY_GOVERNANCE_DOC_NAMES, type MemoryGovernanceDocName, MEMORY_CONTROL_OBJECT_KINDS, type MemoryControlObjectKind, adoptReplicaControlPlane, replicaControlPlaneStrays, type ControlPlaneAdoptionReport, type ReplicaControlPlaneStrays, type MemoryGovernanceDocs, type ConsolidationTx, type MemoryEntry, type MemoryEntryFrontmatter, type MemoryEntryHeader, type MemoryScopeEnumeration, type ScoredMemoryEntry, type NotePatch, type PatchReport, type MaterializedFile, type MemorySessionHandle, type HarvestReport, type HarvestRejection, type HarvestRejectionCode, type ParsedEntryFile, type ScannedEntryFile, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, type ParsedScopeKey, migrateScope, type MigrateScopeReport, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, type RemoteMemoryFile, type RemoteMemoryBaseline, type RemoteMaterialization, type RemoteHarvestResult, type InboundEntryFinding, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, type MemorySyncCursor, type MemorySyncConflict, type MemorySyncPlan, type RecallSource, syncMemoryScope, memorySyncStoreOf, carriesCredential, type MemorySyncTransport, type MemorySyncRequestBody, type MemorySyncResponseBody, type MemorySyncClientConflict, type SyncMemoryScopeOptions, type MemorySyncClientResult, memorySyncReportOf, memoryTravelGapOf, type MemorySyncLayerReport, type MemorySyncRoundReport, } from "./core/memory-engine/index.js";
334
339
  export { createConsolidationWriteJudge, deliverWriteRefusal, type ConsolidationWriteJudgeInput } from "./core/runner/memory-consolidation-write-judge.js";
335
- export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, CONTROL_PLANE_LINKS_UNSUPPORTED, SCOPE_HOME_FORMS, type StoreFormRefusalCode, type StoreFormRefusalDetail, type StoreFormRefusal, type ScopeHomeForm } from "./core/memory-engine/layout.js";
340
+ export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, TARGET_OUTSIDE_STORE_REASONS, SCOPE_HOME_NOT_DIRECTORY, CONTROL_PLANE_LINKS_UNSUPPORTED, SCOPE_HOME_FORMS, type StoreFormRefusalCode, type StoreFormRefusalDetail, type StoreFormRefusal, type ScopeHomeForm, type TargetOutsideStoreReason } from "./core/memory-engine/layout.js";
336
341
  export { resolveMemoryScopeStore, type MemoryScopeStore, type MemoryScopeStoreInput } from "./core/memory-engine/dual-root.js";
337
342
  export { classifyScopePlanes, memoryScopePlaneOf, scopePlanesOf, type ScopePlanes } from "./core/memory-engine/dual-root.js";
338
343
  export { createMemoryDeployment, type MemoryDeployment, type MemoryDeploymentInput, type MemoryDeploymentStore, type DeploymentSessionMemoryStatus, } from "./core/memory-engine/memory-deployment.js";
@@ -370,10 +375,11 @@ export { EVENT_PROMPT_REGISTRY, eventDefaultOn, type CompiledEventPrompt, type E
370
375
  export { OUTPUT_STYLE_NAME_MAX } from "./core/output-style.js";
371
376
  export { contextUsageSections, type ContextUsageSection } from "./prompt-assembly/section-usage.js";
372
377
  export type { CompiledSection, ComposedPrompt, PromptCarrier, PromptRuntimeFacts, PromptTrust, SectionRenderInputs, } from "./prompt-assembly/types.js";
373
- export { type ReasoningIntensity, type ReasoningResolution, type ResolvedReasoning, type ReasoningFormat, DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, reasoningEffortLevelsOf, resolveBinary, reasoningBudgetShare, resolveReasoning, thinkingOffSpelled, declaredOffSpelling, mintEffortWireValue, type OffCapabilityModel, resolveReasoningProfile, type ReasoningTier, type ReasoningProfileFlags, } from "./brain/reasoning.js";
374
- export { applyReasoningToRequest, mergeReasoningHeaders, lowestReasoningSeat, type ApplyReasoningInput, type AppliedReasoning, type ReasoningBudgetKnobs, type ReasoningRequestModel, type ReasoningSeat, } from "./brain/reasoning-request.js";
378
+ export { type ReasoningIntensity, type ReasoningResolution, type ResolvedReasoning, type ReasoningFormat, DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, reasoningBudgetShare, thinkingOffSpelled, declaredOffSpelling, mintEffortWireValue, type OffCapabilityModel, resolveReasoningProfile, type ReasoningTier, type ReasoningProfileFlags, } from "./brain/reasoning.js";
379
+ export { applyReasoningToRequest, mergeReasoningHeaders, lowestReasoningSeat, resolveReasoning, reasoningEffortLevelsOf, type ApplyReasoningInput, type AppliedReasoning, type ReasoningCarriage, type ReasoningBudgetKnobs, type ReasoningRequestModel, type ReasoningSeat, } from "./brain/reasoning-request.js";
375
380
  export { runWorkflow, startWorkflow, workflowAgentCallKey, WorkflowBudgetExceededError, WorkflowNestingError, WorkflowAgentSchemaError, WorkflowAgentStalledError, WorkflowAgentBlockedError, WORKFLOW_SPAWN_BLOCKED_ERROR_CODE, WorkflowAgentParkedError, WORKFLOW_AGENT_PARKED_ERROR_CODE, parkedAgentsOf, runParkedOf, type WorkflowParkedResume, type WorkflowParkDelivery, type WorkflowParkDeliveryResult, type WorkflowFanOutSlotError, type WorkflowFanOutOptions, WORKFLOW_SUBAGENT_PROMPT, WORKFLOW_SUBAGENT_PROMPT_SCHEMA, WORKFLOW_SUBAGENT_APPEND, WORKFLOW_SUBAGENT_APPEND_SCHEMA, type WorkflowHandle, MAX_WORKFLOW_ITEMS, type WorkflowRun, type WorkflowRunStatus, type WorkflowItemStatus, type WorkflowPhase, type WorkflowGroup, type WorkflowAgentRun, type WorkflowAgentHandle, type WorkflowRunStats, type WorkflowEvent, type WorkflowBudget, type WorkflowAgentOptions, type WorkflowRunContext, type WorkflowInternals, type RunWorkflowOptions, type RunWorkflowResult, type WorkflowTimers, } from "./orchestration/workflow.js";
376
381
  export { listWorkflowRuns, getWorkflowRun, subscribeWorkflow, redeemWorkflowParks, deriveAgentDisplayStatus, type AgentDisplayStatus } from "./orchestration/workflow-observe.js";
382
+ export { workflowRecordPickupOf } from "./orchestration/workflow-record-artifact.js";
377
383
  export { runGoal, DECLARE_DONE_TOOL_NAME, type GoalSpec, type GoalResult, type GoalStatus, type GoalBudgetCause, type GoalVerdict, type GoalTurnState, type GoalVerificationKind, } from "./orchestration/goal.js";
378
384
  export { emitTaskOutcome, type TaskOutcome } from "./core/task-outcome.js";
379
385
  export { runOracle, captureBaseline, resolveFrozenPaths, snapshotFrozenPaths, restoreFrozenPaths, specError, type SpecContract, type OracleGateSpec, type OracleGreenSpec, type OracleVerdict, type OracleGateResult, type OracleRunReport, type OracleBaseline, } from "./core/spec-contract.js";
@@ -410,7 +416,7 @@ export { permissionRuleWriteContract, type PermissionRuleWriteContractHooks } fr
410
416
  export { MAILBOX_CONTRACT_SCOPE, mailboxStoreContract, mailboxAckOwnershipContract, mailboxBundledOnlyContract, mailboxTombstonedRecipientContract, type MailboxTombstonedRecipientContractHooks, mailboxCrossProcessContract, type MailboxCrossProcessContractHooks, type MailboxStoreContractHooks, } from "./core/store-contracts/mailbox-store-contract.js";
411
417
  export { BACKGROUND_AGENT_CONTRACT_SCOPE, backgroundAgentStoreContract, backgroundAgentStoreScopesContract, type BackgroundAgentStoreContractHooks, } from "./core/store-contracts/background-agent-store-contract.js";
412
418
  export { PEER_DIRECTORY_CONTRACT_SCOPE, peerDirectoryContract, type PeerDirectoryContractHooks } from "./core/store-contracts/peer-directory-contract.js";
413
- export { type BackgroundAgentStore, type BackgroundAgentRecord, type BackgroundAgentRowSummary, type BackgroundAgentUsage, canAccessAgentRecord, STALE_RUNNING_REAP_ATTRIBUTION, BackgroundAgentStoreError, InMemoryBackgroundAgentStore, reconcileParkedAgents, queryBackgroundAgents, type BackgroundAgentQuery, BACKGROUND_AGENT_ROW_SHAPE, BACKGROUND_AGENT_ROW_MALFORMED_CODE, BACKGROUND_AGENT_STATUSES, type BackgroundAgentStatus, type ReadableBackgroundAgentRowSummary, type DamagedBackgroundAgentRowSummary, readStoredBackgroundAgent, admitBackgroundAgent, summarizeStoredBackgroundAgent, nextBackgroundAgentOnUpdate, assertDelegationRoot, } from "./core/background-agent-store.js";
419
+ export { type BackgroundAgentStore, type BackgroundAgentRecord, type BackgroundAgentRowSummary, type BackgroundAgentUsage, canAccessAgentRecord, STALE_RUNNING_REAP_ATTRIBUTION, staleRunningFlip, staleRunningFlipOf, BackgroundAgentStoreError, InMemoryBackgroundAgentStore, reconcileParkedAgents, queryBackgroundAgents, type BackgroundAgentQuery, BACKGROUND_AGENT_ROW_SHAPE, BACKGROUND_AGENT_ROW_MALFORMED_CODE, BACKGROUND_AGENT_STATUSES, type BackgroundAgentStatus, type ReadableBackgroundAgentRowSummary, type DamagedBackgroundAgentRowSummary, readStoredBackgroundAgent, admitBackgroundAgent, summarizeStoredBackgroundAgent, nextBackgroundAgentOnUpdate, assertDelegationRoot, } from "./core/background-agent-store.js";
414
420
  export { serveDurableAgentRowLane, buildAgentPollDetails, type AgentPollDetailsInput, } from "./core/task-registry-agent.js";
415
421
  export { readAgentState, agentStateSourceOfRecord, agentStateSummary, type AgentState, type AgentPark, type AgentParkGate, type AgentParkState, type AgentStateRow, type AgentStateSource, } from "./core/agent-state.js";
416
422
  export type { TranscriptStep } from "./agents/subagent-steps.js";
@@ -422,8 +428,7 @@ export { FileBackgroundAgentStore, type FileBackgroundAgentStoreOptions } from "
422
428
  export { A2A_TASK_STATES, type A2ATaskState, type A2ATaskStateReversal, type A2ATaskStateReversalFaithful, type A2ATaskStateReversalLossy, toA2ATaskState, fromA2ATaskState, } from "./core/a2a-task-state.js";
423
429
  export { type WorkflowJournalStore, type WorkflowJournalEntry, InMemoryWorkflowJournalStore, callKeyOrdinal, JOURNAL_OVERSIZE_ERROR_CODE, WorkflowJournalOversizeError, assertJournalEntryFits, readWorkflowJournalEntry, type WorkflowJournalEntryReading, WorkflowJournalIncompatibleError, JOURNAL_INCOMPATIBLE_ERROR_CODE, } from "./core/workflow-journal-store.js";
424
430
  export { untrustedEgressForHuman, redactHostLeaks, redactSecrets, boundedRedactedSummary } from "./core/untrusted-egress.js";
425
- export { REDACTION_MARK } from "./core/redaction-marks.js";
426
- export { REDACTION_MARKS } from "./core/redaction-marks.js";
431
+ export { REDACTION_MARKS, isRedactionMark, eachRedactionMarkerSpan, redactionMarkerSpans, type RedactionMark, type RedactionMarkName, } from "@sema-agent/primitives";
427
432
  export type { Egress, EgressTier } from "./core/untrusted-egress.js";
428
433
  export type { RedactionFinding, RedactionReport, RedactionConfidence, RedactionSource, SummarizableFinding, } from "./core/untrusted-egress.js";
429
434
  export { summarizeRedactions } from "./core/untrusted-egress.js";
@@ -479,7 +484,7 @@ export { repairTextToolCalls } from "./brain/tool-call-repair.js";
479
484
  export { createCircuitBreakerBrain, type CircuitBreakerOptions, type BreakerState, type BreakerSnapshot, type BreakerPhase, CIRCUIT_OPEN_MARKER, } from "./brain/circuit-breaker.js";
480
485
  export { readDegradation, DEGRADED_DIAGNOSTIC_TYPE, type DegradeReason, type DegradationInfo, type SkippedHop } from "./brain/model-lane.js";
481
486
  export { readFallbackUnsent, FALLBACK_UNSENT_DIAGNOSTIC_TYPE, type FallbackUnsent } from "./brain/model-lane.js";
482
- export type { ModelFallbackPolicy } from "./core/model-fallbacks.js";
487
+ export { DEGRADE_REASONS, MODEL_FALLBACK_GATE_WORDS, DEFAULT_FALLBACK_GATE, type ModelFallbackPolicy } from "./core/model-fallbacks.js";
483
488
  export { retryBackoffMs, parseRetryAfter } from "./brain/retry.js";
484
489
  export { WAITING_FIRST_TOKEN_AFTER_MS, WAITING_FIRST_TOKEN_EVERY_MS } from "./brain/stream-engine.js";
485
490
  export { adjudicateModelRoute, resolveRouteCredential, admitRouteRequest, rebindCredentialOrigin, type CredentialRebind, routeRefusalText, routePairingStatus, routeKeyOf, displayUrlOf, resolveRequestRoot, resolveRequestRootOf, joinRequestUrl, hasAuthCarrier, __resetCredentialOriginBindings, type RoutePairingStatus, } from "./brain/route-adjudicator.js";
@@ -489,7 +494,7 @@ export { ROUTE_ADJUDICATION_CONFORMANCE_CORPUS, type RouteAdjudicationVector } f
489
494
  export { type BrainTimeoutConfig } from "./brain/timeout.js";
490
495
  export { createAssistantMessageEventStream } from "./internal/llm.js";
491
496
  export type { AssistantMessage, AssistantMessageEvent, CompleteSimpleFn, Context, DocumentContent, ImageContent, Message, StopReason, StreamFn, TextContent, ThinkingContent, ToolCall, ToolDescriptionVariant, ToolResultMessage, Usage, UserMessage, UserMessageAttachment, UserAttachmentKind, UserAttachmentObservation, UserAttachmentOutcome, UserAttachmentSupply, ChangedFilesNotice, RowRewrittenBy, } from "./internal/llm.js";
492
- export type { AgentDefinition, BeforeWriteHook, BeforeWriteRequest, BeforeWriteResult, TrackFileEditHook, TrackEditRequest, TrackEditResult, FileEditedHook, FileEditedNotice, HandsBandOptions, Brain, BrainStatus, BrainStatusPhase, BrainRetryErrClass, ImageInput, UserAttachment, McpElicitRequest, McpElicitResponse, McpServerSpec, A2aServerSpec, OnElicit, Model, ModelRef, RunnerDeps, ResumePreflightInfo, ResumePreflightVerdict, EngineNotice, RuntimeCaps, BackgroundChildEvent, DelegationLifecycleEvent, SkillSpec, TaskEvent, ExtensionRequester, RewriteAuthor, ToolInputRewrite, TaskEventIdentity, ToolActivity, TaskLimits, StaleToolResultOffloadOptions, TaskResult, TerminalCause, PausedCause, EffectiveMemoryScopes, RemoteEnvFailureNote, TaskSpec, InstructionFamilyDeclaration, ShellGateDoctrine, TaskStatus, TaskStream, CompactOutcome, ThinkingLevel, ToolExecuteContext, ToolReturn, ToolSpec, ToolInputVerdict, ToolInputValidationContext, ReversibilityVerdict, ReadRootGrantCandidate, ToolEffect, ToolContentOrigin, WorkflowGovernanceBaseline, DelegationTaskType, } from "./core/types.js";
497
+ export type { AgentDefinition, BeforeWriteHook, BeforeWriteRequest, BeforeWriteResult, TrackFileEditHook, TrackEditRequest, TrackEditResult, FileEditedHook, FileEditedNotice, HandsBandOptions, Brain, BrainStatus, BrainStatusPhase, BrainRetryErrClass, ImageInput, UserAttachment, McpElicitRequest, McpElicitResponse, McpServerSpec, A2aServerSpec, OnElicit, Model, ModelRef, RunnerDeps, ResumePreflightInfo, ResumePreflightVerdict, EngineNotice, RuntimeCaps, BackgroundChildEvent, DelegationLifecycleEvent, SkillSpec, TaskEvent, ExtensionRequester, RewriteAuthor, ToolInputRewrite, TaskEventIdentity, ToolActivity, TaskLimits, StaleToolResultOffloadOptions, TaskResult, TerminalCause, PausedCause, EffectiveMemoryScopes, RemoteEnvFailureNote, RefusedAsk, TaskSpec, DurableApprovalOptIn, InstructionFamilyDeclaration, ShellGateDoctrine, TaskStatus, TaskStream, CompactOutcome, ThinkingLevel, ToolExecuteContext, ToolReturn, ToolSpec, ToolInputVerdict, ToolInputValidationContext, ReversibilityVerdict, ReadRootGrantCandidate, ToolEffect, ToolContentOrigin, WorkflowGovernanceBaseline, DelegationTaskType, } from "./core/types.js";
493
498
  export { Type } from "typebox";
494
499
  export type { TSchema, Static } from "typebox";
495
500
  export { explainPromptAssembly, describeCatalog, type CatalogDescription, type ExplainInput } from "./prompt-assembly/explain.js";
@@ -515,7 +520,7 @@ export { sessionStoreContract, type SessionStoreContractHooks } from "./core/sto
515
520
  export { canonicalJsonStringify } from "./core/canonical-json.js";
516
521
  export { parkedApprovalCardOf, type ParkedApprovalCardReading } from "./core/pause-registry.js";
517
522
  export { admitSessionPlacement, settledForkOptions } from "./core/session-store.js";
518
- export { incarnationCell, forkRowCells, assertForkTarget, readIncarnationCell } from "./engine/session/repo-utils.js";
523
+ export { incarnationCell, forkRowCells, assertForkTarget, readIncarnationCell, fileHistoryScopeOf, readFileHistoryScope, sessionIdHasScopeTail, type FileHistoryScopeParts } from "./engine/session/repo-utils.js";
519
524
  export { selectForkRows, type ForkPoint, type ForkRowShape } from "./engine/session/path-to-root.js";
520
525
  export { checkpointIndexFacts, type CheckpointIndexFacts } from "./core/checkpoint-store.js";
521
526
  export { checkpointRevOf, checkpointOccMatches, checkpointHolderMatches, type HolderJudge } from "./core/checkpoint-generation.js";
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ export { ARTIFACT_ACTIONS, ARTIFACT_PLANES, ARTIFACT_COMMIT_CERTAINTIES, ARTIFAC
20
20
  export { createArtifactTool, artifactAttemptId, normalizePublishedPath, mediaTypeOf } from "./tools/artifact/artifact-tool.js";
21
21
  export { localArtifactStub, LocalArtifactStub, EVAL_STUB_URL_PREFIX, LOCAL_STUB_MAX_FILE_BYTES, LOCAL_STUB_MAX_TOTAL_BYTES } from "./tools/artifact/local-stub.js";
22
22
  export { ARTIFACT_CONFORMANCE_VECTORS, artifactConformanceVectors, runArtifactConformance, } from "./tools/artifact/conformance.js";
23
- export { createTaskListTools, createMemoryTaskListStore, assertJsonMetadata } from "./tools/task-list.js";
23
+ export { createTaskListTools, createMemoryTaskListStore, assertJsonMetadata, compareTaskIds } from "./tools/task-list.js";
24
24
  export { TASK_LIST_ITEM_ROW_SHAPE, TASK_LIST_ROW_MALFORMED_CODE, TASK_LIST_STATUSES, TaskListStoreError, readStoredTaskListItem, listStoredTaskListEntry, admitTaskListItem, } from "./tools/task-list.js";
25
25
  export { taskListStoreContract } from "./core/store-contracts/task-list-store-contract.js";
26
26
  export { ROW_EXITS } from "./core/row-shape.js";
@@ -179,6 +179,7 @@ export { DURABLE_HISTORY_NAMES } from "./engine/compaction/utils.js";
179
179
  export { describeStaticWiring, deriveWiringManifest, deriveAskEffective, resolveDeclaredDurability, resolveSubagentTranscriptTier, resolveAskSeamForm, resolveQuestionSeam, countElicitOptIns, AUTO_MODE_ARM_REASONS, LSP_LANES, APPROVAL_REACH, isApprovalReach, } from "./core/wiring-manifest.js";
180
180
  export { RUN_ORIGINS, isRunOrigin } from "./core/run-origin.js";
181
181
  export { INPUT_AUTHORS, isInputAuthor } from "./core/input-author.js";
182
+ export { USER_ROW_ORIGINS, isUserRowOrigin, userRowSourceOf } from "./core/user-row-origin.js";
182
183
  export { probeParkRoundTrip, durableParkGapOf, durableParkGapFor, PARK_SELFCHECK_SCOPE_PREFIX, } from "./core/park-selfcheck.js";
183
184
  export {} from "./core/checkpoint-store.js";
184
185
  export {} from "./core/checkpoint-store.js";
@@ -199,6 +200,7 @@ export { createSchedulerTools, SCHEDULE_WAKEUP_TOOL_NAME, AUTONOMOUS_LOOP_SENTIN
199
200
  export { resolveAutonomousLoopPrompt, AUTONOMOUS_LOOP_PREAMBLE, AUTONOMOUS_LOOP_PREAMBLE_PERSISTENT, } from "./tools/loop-tick.js";
200
201
  export { tightenTaskSpec, TaskSpecTightenError } from "./core/tighten-task-spec.js";
201
202
  export { createAllowDenyPolicy, createApprovalPolicy, COARSE_SHELL_TOOLS, createCoarseCommandNamePolicy, createTranscriptIntegrityPolicy, createUnverifiableDeletePolicy, combinePolicies, abortedSeatDeny, noApproverSeatDeny, wrapToolPolicy, decisionText, resolveAsk, toolPolicyNameSets, toolPolicyPathRules, checkToolPolicyProjection, constraintChainEntryOf, constraintChainDigest, screenApproverAttribution, APPROVER_ATTRIBUTION_MAX_CHARS, BIDI_CONTROL_CHARS, carriesBidiControls, asPolicyApprover, isPolicyApprover, declareClassAnswers, ASK_EVIDENCE_ABSENCE_VALUES, } from "./core/tool-policy.js";
203
+ export { writtenFeedback, unfitFeedbackOf } from "./core/approval-words.js";
202
204
  export { EXISTING_TARGET_KINDS, EXISTING_TARGET_WITHHELD_REASONS, EXISTING_TARGET_READ_CAP, } from "./core/existing-target.js";
203
205
  export {} from "./core/read-root-grant-screen.js";
204
206
  export { ASK_ORIGINS, isAskOrigin, ORIGIN_IMPLIES_REAL_APPROVAL, PERSISTED_RULE_MANDATES, isPersistedRuleMandate, screenAskClassMembers } from "./core/ask-origin.js";
@@ -207,7 +209,8 @@ export { PERMISSION_MODES, isPermissionMode, PERMISSION_MODE_RANK, clampPermissi
207
209
  export { CROSS_BOUNDARY_TAINT_BITS, CROSS_BOUNDARY_POSTURES, BOUNDARY_LEGS, crossBoundaryObligation, CROSS_BOUNDARY_RECORD_TYPE, readCrossBoundaryRecord } from "./core/cross-boundary-taint.js";
208
210
  export { modePolicyOf, PERMISSION_MODE_FOLD_REASONS, ACCEPT_EDITS_FILE_COMMANDS, modeAcceptsFileCommand } from "./core/mode-policy.js";
209
211
  export { SKILL_GRANT_ORIGINS } from "./core/skill-grant.js";
210
- export { ALLOW_ENTRY_INERT_REASONS, readRuleEntry, compileAllowList, renderListEntry, screenAllowedToolsValue } from "./core/allow-entry.js";
212
+ export { AUTO_STRIP_REASONS } from "./core/auto-strip.js";
213
+ export { ALLOW_ENTRY_INERT_REASONS, allowEntryAutoStrip, readRuleEntry, compileAllowList, renderListEntry, screenAllowedToolsValue } from "./core/allow-entry.js";
211
214
  export { ALLOW_RULE_MEMBERS } from "./core/allow-rule-shadow.js";
212
215
  export { mintNamespacePrefix } from "./core/protocol-naming.js";
213
216
  export { readDenyClassifierRules, renderClassifierDenyRules } from "./core/auto-mode-prompt.js";
@@ -230,9 +233,11 @@ export { createPermissionRulePolicy, validatePermissionRules, parsePermissionRul
230
233
  export { RULE_BEHAVIORS, RULE_BEHAVIOR_PRECEDENCE, RULE_BEHAVIORS_BY_PRECEDENCE, isRuleBehavior, readRowBehavior, adjudicatePersistedRules, adjudicatePersistedPathRules, adjudicatePersistedToolRules, ruleReachesProgramRun, programRunReachOf, PROGRAM_RUN_REACHES, pathRuleReachOf, ruleBasesNeeded, PATH_RULE_BASES, PATH_RULE_BASE_LABEL, ruleToolGrammarOf, COMMAND_RULE_TOOL, READ_RULE_TOOL, parseRuleText, formatRuleText, ruleAdmitsCommand, findAdmittingRule, suggestRulesForCommand, scopeCoversCwd, pathWithinRoot, isRuleLive, renderUntrustedCommandText, stripFormatCharacters, UNCOVERED_SEGMENT_REASON_BASELINE, RULE_OFFERS_ABSENCE_BASELINE, PERSISTED_RULE_MATCHES, RULE_OFFER_KINDS, RULE_OFFER_BATCH_MEMBER_KINDS, UNCOVERED_SEGMENT_REASONS, EDITED_RULE_BREADTH_WARNING_CODES, RULE_ADD_ORIGINS, directoryRuleAdmits, BARE_INTERPRETER_NAMES, MAX_RULE_TEXT_CHARS, } from "./core/permission-rule-model.js";
231
234
  export { removePersistedRule, addPersistedRule, applyTombstones, sameScope, sameRuleIdentity, isValidConsentScope, isValidDurableScope, InMemoryDurableRulePartition, EMPTY_DURABLE_RULE_PARTITION, joinRuleStates, applySyncJoin, screenRuleSyncState, collectBelowFrontier, ruleSyncVector, joinFrontiers, dotAtOrBelowFrontier, PERMISSION_RULE_WRITER, writerOf, foldDelta, addDotsOf, assertDeleteDeltaCarriesNoAdd, assertRedemptionNotQuarantined, assertWriteDeltaScopeDurable, PERMISSION_RULES_LATER_GRAMMAR_CODE, PERMISSION_RULES_DAMAGED_BUCKET_CODE, PERMISSION_RULES_UNREADABLE_BUCKET_CODE, } from "./core/permission-rule-store.js";
232
235
  export { readRuleOwner, sameRuleOwner, RULE_OWNER_KINDS, } from "./core/rule-owner.js";
233
- export { principalNameOf } from "./core/principal-name.js";
236
+ export { principalNameOf, PRINCIPAL_NAME_MAX_CHARS } from "./core/principal-name.js";
237
+ export { isolationScopeOf, callScopeOf } from "./core/isolation-scope.js";
234
238
  export { syncPermissionRules, parseRuleSyncResponse, PERMISSION_RULE_SYNC_PATH, LOCAL_OWNER_UNSYNCABLE_CODE, } from "./core/permission-rule-sync.js";
235
239
  export { createPermissionRuleStoreProvider, effectivePermissionRules, effectiveOrThrow, ruleSourceOf, } from "./core/permission-rule-provider.js";
240
+ export { RULE_STORE_FAULT_REASONS } from "./core/rule-store-fault.js";
236
241
  export { InMemorySessionRulePartition, } from "./core/permission-rule-session.js";
237
242
  export { readShellCommand, isFullyReadable, MAX_SHELL_READ_CHARS, SHELL_WRAPPER_TABLE, } from "./core/shell-run-candidates.js";
238
243
  export { readOnlyShellVerdict } from "./core/read-only-shell.js";
@@ -256,7 +261,7 @@ export { CREDENTIAL_REF_KINDS, CREDENTIAL_REF_TRUST, CREDENTIAL_REF_TEXT_MAX, CR
256
261
  export { composeMemoryBlock, composeLayeredMemoryBlock, normalizeMemorySpec, firstSentence, detectSecret, MEMORY_PROJECT_KEY_ABSENT_REASONS, } from "./core/memory.js";
257
262
  export { MemoryEngine, FileMemoryEngineBackend, readMemoryLedgerForm, memoryBackendContract, assertMemoryBackendSearchEquivalence, memoryGovernanceStoreContract, buildMemoryInstruction, writableRootOf, truncateIndex, scanEntryFiles, deriveRepoKey, deriveRepoMemoryDir, deriveControlPlaneDir, deriveRepoControlPlaneDir, resolveMemoryEngineRoot, scopeDirName, ControlPlaneCorruptError, parseEntryFile, serializeEntryFile, computeEntryRev, entryFromFile, MEMORY_ORIGIN_CAUSES, committedOriginOf, originEquals, consolidationExposedFrontmatter, ambiguousOriginRepresentation, committedDistilledOf, distilledEquals, CONSOLIDATION_DEFAULTS, ConsolidationRefusedError, MEMORY_SEARCH_SUPERSEDED_TAG, consolidationTypeEligible, deriveSupersededSet, memorySupersededNote, supersessionFuseCeiling, DELETION_FUSE_FLOOR, fileGovernanceStore, memoryGovernanceDurability, deriveShadowedSet, memoryConsolidationRecommendedNotice, memoryConsolidationCommittedNotice, memoryConsolidationConflictNotice, memoryConsolidationIncompleteNotice, memoryConsolidationRefusedNotice, memoryConsolidationWithheldNotice, DISTILLER_DEFAULT_MAX_INPUTS_PER_PRODUCT, LLM_DISTILLER_CONTRACT, LLM_DISTILLER_CONTRACT_DL2, LLM_DISTILLER_CONTRACT_DL3, LLM_DISTILLER_CONTRACTS, MEMORY_DISTILLER_CONTRACT_V1, contractGroupingDiff, driveConsolidationToFixpoint, isAliasModelId, llmPlanDistiller, mintExposurePartitionedPlan, mintLlmConsolidationPlan, MEMORY_DISTILLER_PURITY_CONTRACT_V1, detectCleanArmVerbatimLeak, openAiCompatChatSeat, parseJsonAnswer, planParseRepairs, sanitizeLlmGroups, scheduleUnderFuse, CONSOLIDATION_RUN_STOP_REASONS, CONSOLIDATION_WRITE_REFUSED_CODE, runMemoryConsolidationDriver, isInstructionEntry, MEMORY_INSTRUCTION_TEMPLATE, MEMORY_RECALL_DISCIPLINE, MEMORY_PREFERENCE_DISCIPLINE, MEMORY_READONLY_NOTICE, MEMORY_CAPTURE_OPTOUT_NOTICE, memoryCaptureOptedOutNotice, memoryCaptureOptOutUnpersistedNotice, SESSION_CAPTURE_OPTOUT_DIR, fileSessionCaptureRecordStore, readV2HeaderHints, LINEAGE_FILE, CHALLENGES_FILE, CHALLENGED_HISTORY_FILE, CHALLENGE_LEDGER_MAX_EVENTS, rebuildStrictControlPlaneLedger, MEMORY_INDEX_FILENAME, MEMORY_INDEX_MAX_LINES, MEMORY_INDEX_MAX_BYTES, MEMORY_SEARCH_TOOL_NAME, MEMORY_GET_TOOL_NAME, MEMORY_INDEX_TOOL_NAME, MEMORY_ENGINE_TOOL_NAMES, MEMORY_EXPOSURE_BANNER, MEMORY_EXPOSURE_HANDLE_TAG, memoryExposureIndexRow, STUB_ARCHIVED_LINE, DEFAULT_MAX_MEMORY_FILES, DEFAULT_MAX_ENTRY_DEPTH, DEFAULT_HARVEST_DEADLINE_MS, DEFAULT_HARVEST_FILE_BUDGET, MASS_DELETION_FUSE_RATIO, scanMemoryWrite, scanMemoryFileName, scanRemediation, MEMORY_FILENAME_SEGMENT_RE, renderAnnouncements, enqueueMemoryAnnouncement, drainMemoryAnnouncements, peekMemoryAnnouncements, bumpScanFuse, scanFuseCount, clearScanFuse, ANNOUNCEMENTS_FILE, MEMORY_ANNOUNCEMENTS_MAX, SCAN_FUSE_FILE, SCAN_FUSE_THRESHOLD, erasureSelectHash, computeMemoryBundleHash, MEMORY_GOVERNANCE_DOC_NAMES, MEMORY_CONTROL_OBJECT_KINDS, adoptReplicaControlPlane, replicaControlPlaneStrays, SCOPE_SEGMENT_MAX_ENCODED, PROJECT_MARKER_PATH, encodeScopeSegment, decodeScopeSegment, parseScopeKey, formatUserScope, formatUserLocalScope, formatOrgScope, formatProjScope, formatUserProjScope, isPersonalScope, isReplicableScope, isOrgScopeKey, assertScopeContractPlacement, formatProjectMarker, parseProjectMarker, resolveProjectId, PROJECT_ID_REGEX, migrateScope, materializeEntriesToFiles, harvestFilesToPatches, projectionsToWriteBack, screenInboundEntries, REMOTE_HARVEST_PER_FILE_BYTES, REMOTE_MASS_DELETION_FUSE_RATIO, deriveProjectMemoryDir, deriveProjectControlDir, recordProjectIdHint, lookupProjectIdHint, PROJECT_ID_HINTS_FILE, reconcileMemoryEntries, nextSyncBaseline, mergeRecallHits, syncMemoryScope, memorySyncStoreOf, carriesCredential, memorySyncReportOf, memoryTravelGapOf, } from "./core/memory-engine/index.js";
258
263
  export { createConsolidationWriteJudge, deliverWriteRefusal } from "./core/runner/memory-consolidation-write-judge.js";
259
- export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, SCOPE_HOME_NOT_DIRECTORY, CONTROL_PLANE_LINKS_UNSUPPORTED, SCOPE_HOME_FORMS } from "./core/memory-engine/layout.js";
264
+ export { STORE_FORM_REFUSAL_CODES, TARGET_OUTSIDE_STORE, TARGET_OUTSIDE_STORE_REASONS, SCOPE_HOME_NOT_DIRECTORY, CONTROL_PLANE_LINKS_UNSUPPORTED, SCOPE_HOME_FORMS } from "./core/memory-engine/layout.js";
260
265
  export { resolveMemoryScopeStore } from "./core/memory-engine/dual-root.js";
261
266
  export { classifyScopePlanes, memoryScopePlaneOf, scopePlanesOf } from "./core/memory-engine/dual-root.js";
262
267
  export { createMemoryDeployment, } from "./core/memory-engine/memory-deployment.js";
@@ -290,10 +295,11 @@ export { stripEngineMetadata } from "./internal/llm.js";
290
295
  export { EVENT_PROMPT_REGISTRY, eventDefaultOn } from "./prompt-assembly/event-registry.js";
291
296
  export { OUTPUT_STYLE_NAME_MAX } from "./core/output-style.js";
292
297
  export { contextUsageSections } from "./prompt-assembly/section-usage.js";
293
- export { DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, reasoningEffortLevelsOf, resolveBinary, reasoningBudgetShare, resolveReasoning, thinkingOffSpelled, declaredOffSpelling, mintEffortWireValue, resolveReasoningProfile, } from "./brain/reasoning.js";
294
- export { applyReasoningToRequest, mergeReasoningHeaders, lowestReasoningSeat, } from "./brain/reasoning-request.js";
298
+ export { DEFAULT_EFFORT_LEVELS, REASONING_BUDGET_SHARE, isThinkingLevel, rankOf, resolveEffort, reasoningBudgetShare, thinkingOffSpelled, declaredOffSpelling, mintEffortWireValue, resolveReasoningProfile, } from "./brain/reasoning.js";
299
+ export { applyReasoningToRequest, mergeReasoningHeaders, lowestReasoningSeat, resolveReasoning, reasoningEffortLevelsOf, } from "./brain/reasoning-request.js";
295
300
  export { runWorkflow, startWorkflow, workflowAgentCallKey, WorkflowBudgetExceededError, WorkflowNestingError, WorkflowAgentSchemaError, WorkflowAgentStalledError, WorkflowAgentBlockedError, WORKFLOW_SPAWN_BLOCKED_ERROR_CODE, WorkflowAgentParkedError, WORKFLOW_AGENT_PARKED_ERROR_CODE, parkedAgentsOf, runParkedOf, WORKFLOW_SUBAGENT_PROMPT, WORKFLOW_SUBAGENT_PROMPT_SCHEMA, WORKFLOW_SUBAGENT_APPEND, WORKFLOW_SUBAGENT_APPEND_SCHEMA, MAX_WORKFLOW_ITEMS, } from "./orchestration/workflow.js";
296
301
  export { listWorkflowRuns, getWorkflowRun, subscribeWorkflow, redeemWorkflowParks, deriveAgentDisplayStatus } from "./orchestration/workflow-observe.js";
302
+ export { workflowRecordPickupOf } from "./orchestration/workflow-record-artifact.js";
297
303
  export { runGoal, DECLARE_DONE_TOOL_NAME, } from "./orchestration/goal.js";
298
304
  export { emitTaskOutcome } from "./core/task-outcome.js";
299
305
  export { runOracle, captureBaseline, resolveFrozenPaths, snapshotFrozenPaths, restoreFrozenPaths, specError, } from "./core/spec-contract.js";
@@ -330,7 +336,7 @@ export { permissionRuleWriteContract } from "./core/store-contracts/permission-r
330
336
  export { MAILBOX_CONTRACT_SCOPE, mailboxStoreContract, mailboxAckOwnershipContract, mailboxBundledOnlyContract, mailboxTombstonedRecipientContract, mailboxCrossProcessContract, } from "./core/store-contracts/mailbox-store-contract.js";
331
337
  export { BACKGROUND_AGENT_CONTRACT_SCOPE, backgroundAgentStoreContract, backgroundAgentStoreScopesContract, } from "./core/store-contracts/background-agent-store-contract.js";
332
338
  export { PEER_DIRECTORY_CONTRACT_SCOPE, peerDirectoryContract } from "./core/store-contracts/peer-directory-contract.js";
333
- export { canAccessAgentRecord, STALE_RUNNING_REAP_ATTRIBUTION, BackgroundAgentStoreError, InMemoryBackgroundAgentStore, reconcileParkedAgents, queryBackgroundAgents, BACKGROUND_AGENT_ROW_SHAPE, BACKGROUND_AGENT_ROW_MALFORMED_CODE, BACKGROUND_AGENT_STATUSES, readStoredBackgroundAgent, admitBackgroundAgent, summarizeStoredBackgroundAgent, nextBackgroundAgentOnUpdate, assertDelegationRoot, } from "./core/background-agent-store.js";
339
+ export { canAccessAgentRecord, STALE_RUNNING_REAP_ATTRIBUTION, staleRunningFlip, staleRunningFlipOf, BackgroundAgentStoreError, InMemoryBackgroundAgentStore, reconcileParkedAgents, queryBackgroundAgents, BACKGROUND_AGENT_ROW_SHAPE, BACKGROUND_AGENT_ROW_MALFORMED_CODE, BACKGROUND_AGENT_STATUSES, readStoredBackgroundAgent, admitBackgroundAgent, summarizeStoredBackgroundAgent, nextBackgroundAgentOnUpdate, assertDelegationRoot, } from "./core/background-agent-store.js";
334
340
  export { serveDurableAgentRowLane, buildAgentPollDetails, } from "./core/task-registry-agent.js";
335
341
  export { readAgentState, agentStateSourceOfRecord, agentStateSummary, } from "./core/agent-state.js";
336
342
  export { TASK_OUTPUT_REPLAY_KINDS } from "./core/task-registry-shared.js";
@@ -340,8 +346,7 @@ export { FileBackgroundAgentStore } from "./stores/file/background-agent-store.j
340
346
  export { A2A_TASK_STATES, toA2ATaskState, fromA2ATaskState, } from "./core/a2a-task-state.js";
341
347
  export { InMemoryWorkflowJournalStore, callKeyOrdinal, JOURNAL_OVERSIZE_ERROR_CODE, WorkflowJournalOversizeError, assertJournalEntryFits, readWorkflowJournalEntry, WorkflowJournalIncompatibleError, JOURNAL_INCOMPATIBLE_ERROR_CODE, } from "./core/workflow-journal-store.js";
342
348
  export { untrustedEgressForHuman, redactHostLeaks, redactSecrets, boundedRedactedSummary } from "./core/untrusted-egress.js";
343
- export { REDACTION_MARK } from "./core/redaction-marks.js";
344
- export { REDACTION_MARKS } from "./core/redaction-marks.js";
349
+ export { REDACTION_MARKS, isRedactionMark, eachRedactionMarkerSpan, redactionMarkerSpans, } from "@sema-agent/primitives";
345
350
  export { summarizeRedactions } from "./core/untrusted-egress.js";
346
351
  export { headerOwnershipCollision, MCP_ASSERTION_HEADER } from "./core/protocol-http-auth.js";
347
352
  export { crossesNetworkInClear } from "./core/protocol-http-auth.js";
@@ -393,6 +398,7 @@ export { repairTextToolCalls } from "./brain/tool-call-repair.js";
393
398
  export { createCircuitBreakerBrain, CIRCUIT_OPEN_MARKER, } from "./brain/circuit-breaker.js";
394
399
  export { readDegradation, DEGRADED_DIAGNOSTIC_TYPE } from "./brain/model-lane.js";
395
400
  export { readFallbackUnsent, FALLBACK_UNSENT_DIAGNOSTIC_TYPE } from "./brain/model-lane.js";
401
+ export { DEGRADE_REASONS, MODEL_FALLBACK_GATE_WORDS, DEFAULT_FALLBACK_GATE } from "./core/model-fallbacks.js";
396
402
  export { retryBackoffMs, parseRetryAfter } from "./brain/retry.js";
397
403
  export { WAITING_FIRST_TOKEN_AFTER_MS, WAITING_FIRST_TOKEN_EVERY_MS } from "./brain/stream-engine.js";
398
404
  export { adjudicateModelRoute, resolveRouteCredential, admitRouteRequest, rebindCredentialOrigin, routeRefusalText, routePairingStatus, routeKeyOf, displayUrlOf, resolveRequestRoot, resolveRequestRootOf, joinRequestUrl, hasAuthCarrier, __resetCredentialOriginBindings, } from "./brain/route-adjudicator.js";
@@ -417,7 +423,7 @@ export { sessionStoreContract } from "./core/store-contracts/session-store-contr
417
423
  export { canonicalJsonStringify } from "./core/canonical-json.js";
418
424
  export { parkedApprovalCardOf } from "./core/pause-registry.js";
419
425
  export { admitSessionPlacement, settledForkOptions } from "./core/session-store.js";
420
- export { incarnationCell, forkRowCells, assertForkTarget, readIncarnationCell } from "./engine/session/repo-utils.js";
426
+ export { incarnationCell, forkRowCells, assertForkTarget, readIncarnationCell, fileHistoryScopeOf, readFileHistoryScope, sessionIdHasScopeTail } from "./engine/session/repo-utils.js";
421
427
  export { selectForkRows } from "./engine/session/path-to-root.js";
422
428
  export { checkpointIndexFacts } from "./core/checkpoint-store.js";
423
429
  export { checkpointRevOf, checkpointOccMatches, checkpointHolderMatches } from "./core/checkpoint-generation.js";
@@ -36,7 +36,7 @@ export interface RunSpecOptions {
36
36
  * spec framing); `toolPolicy` and `mods` are COMPOSED with runSpec's, never replaced. */
37
37
  taskSpec: Omit<TaskSpec, "objective">;
38
38
  /** Receives the oracle gates' once-per-process `config.secret_env_scrubbed` notice (`runOracle`'s `onNotice`);
39
- * absent ⇒ the console line. */
39
+ * absent ⇒ the process's default seat, else the process line. */
40
40
  onNotice?: (notice: EngineNotice) => void;
41
41
  }
42
42
  export interface RunSpecOracleReport {
@@ -124,6 +124,9 @@ export interface RunWorkflowToolDeps {
124
124
  /** (tool-face round 5): the HOST task's tool selector layers (prepare-time) — what the host may use bounds every agent this
125
125
  * workflow spawns, exactly like the Agent path: threaded into each spawned agent's trusted internals as its ceiling. */
126
126
  parentToolCeiling?: readonly import("../core/tool-face.js").ToolSelectorLayer[];
127
+ /** The HOST run's MCP connection pool (its session's, `ToolExecuteContext.mcpPool`) for the auto-mounted tool, whose execute ctx carries
128
+ * none: every agent the workflow spawns leases from it and reads what it remembers of a failed attempt. A rich ctx's own pool wins. */
129
+ parentMcpPool?: import("../core/mcp-connection-pool.js").McpConnectionPool;
127
130
  /** The HOST task's deferred-disclosure list (prepare-time snapshot), merged (union) into the baseline base for every child spec. */
128
131
  parentDeferTools?: readonly string[];
129
132
  /** DD-3 (RB-422): the defer face's subtract valve rides the same snapshot — a pin the operator
@@ -203,9 +206,10 @@ export interface RunWorkflowToolDeps {
203
206
  taskNotification?: (notification: TaskNotificationPayload, opts?: {
204
207
  priority?: "now" | "next" | "later";
205
208
  }) => void;
206
- /** Where a finished run's full record (its result and every agent's row) is stored for `ReadToolResult` — the completion
207
- * notification carries a bounded result and only the rows that did not complete. Absent ⇒ the notification says the
208
- * record is not readable from this session. */
209
+ /** Where a finished run's full record (its result and every agent's row) is stored for `ReadToolResult` — handed to the
210
+ * run (`RunWorkflowOptions.taskArtifacts`), whose terminal writes it and records the outcome on `WorkflowRun.recordArtifact`;
211
+ * the completion notification carries a bounded result and only the rows that did not complete. Absent ⇒ the record
212
+ * reads `no_store` and the notification says it is not readable from this session. */
209
213
  taskArtifacts?: import("../core/tool-result-store.js").TaskArtifactSeat;
210
214
  /** Runner-owned owner fallback for registry access when the execute context is unavailable. */
211
215
  taskOwner?: string;
@@ -318,11 +322,10 @@ export interface RunWorkflowToolDeps {
318
322
  * durable home; without it the child keeps the pre-#642 lifecycle: its unavailable ask denies fail-closed
319
323
  * and the `delegation.ask_unresolvable` notice says so). `ctx.durableApprovalForChildren` wins when a
320
324
  * wrapping path provides it; this dep covers the auto-mounted tool's minimal execute ctx, like `parentOnAsk`.
321
- * Absent on both seats ⇒ byte-identical: a workflow child's ask keeps the host-seat resolution alone. */
322
- parentDurableApproval?: {
323
- scope: string;
324
- ttlMs?: number;
325
- };
325
+ * Absent on both seats ⇒ byte-identical: a workflow child's ask keeps the host-seat resolution alone. Named after the
326
+ * context seat it twins: `parentDurableApproval` is the clamp table's retired per-seat name (the host's `false` rides
327
+ * `parentClamps`), refused at the mount. */
328
+ parentDurableApprovalForChildren?: import("../core/task-spec.js").DurableApprovalOptIn;
326
329
  /** #642 — the decisions a host holds for PARKED wa* rows of a prior run, read at execute when the model
327
330
  * re-invokes with `resumeFromRunId` (a call-time getter over the run id: the decisions arrive on the host's
328
331
  * trusted run channel, `RunInternals.workflowParkedResume`, and only the ones naming THIS resume's source run
@@ -371,7 +374,7 @@ export interface RunWorkflowToolDeps {
371
374
  * vanishing (`workflow.governance_key_stripped`). #505 ① — the same seat now also carries the OPTIONS
372
375
  * membrane's twin announcement (`workflow.agent_option_ignored`: keys of `agent(spec, opts)`'s second
373
376
  * argument that did not apply). A dep for the same reason as the seats above: this auto-mount's execute
374
- * ctx is minimal. Absent ⇒ the historic `console.warn` loudness. */
377
+ * ctx is minimal. Absent ⇒ the process's default notice seat, else one process line. */
375
378
  onNotice?: (n: import("../core/types.js").EngineNotice) => void;
376
379
  /** Twin of the above for design/148 S1's center-artifact inheritance (see the `ctx.centerArtifactDigest`/
377
380
  * `ctx.centerSourceRevision` reads at the `startWorkflow` options site) — `centerAdoption` resolves
@@ -1,8 +1,7 @@
1
1
  import { Type } from "typebox";
2
2
  import { defineTool, errorResult } from "../core/tools.js";
3
3
  import { governanceBaselineError, governanceBaselineProblem } from "./governance-baseline-validity.js";
4
- import { formatWorkflowRun, WORKFLOW_RECORD_WHOLE } from "../core/task-registry-shared.js";
5
- import { persistTaskArtifact } from "../core/tool-result-store.js";
4
+ import { workflowRecordPickupOf } from "./workflow-record-artifact.js";
6
5
  import { admitsBackgroundLaunch, oweTerminalDelivery, resolveCompletionSink } from "../core/task-notification.js";
7
6
  import { egressText, egressThrownText, boundedRedactedSummary } from "../core/untrusted-egress.js";
8
7
  import { withDelegationProvenance } from "../core/tool-policy.js";
@@ -26,6 +25,7 @@ const RETIRED_RUN_WORKFLOW_TOOL_DEPS_KEYS = {
26
25
  `parent${seat.charAt(0).toUpperCase()}${seat.slice(1)}`,
27
26
  `the host's tighten-only clamps ride ONE getter, \`RunWorkflowToolDeps.parentClamps\` (every clamp row, present keys) — return \`${seat}\` from it`,
28
27
  ])),
28
+ parentDurableApproval: "the host run's durable-approval opt-in object is `RunWorkflowToolDeps.parentDurableApprovalForChildren` (the same value, renamed after its context twin `durableApprovalForChildren`); the host's `durableApproval: false` rides `RunWorkflowToolDeps.parentClamps`",
29
29
  };
30
30
  import { parseWorkflowMeta, splitWorkflowMeta, workflowScriptReadsClockOrRandom } from "./workflow-meta.js";
31
31
  import { mergeWorkflowArgs, normalizeStringArg } from "./workflow-script-store.js";
@@ -70,7 +70,7 @@ function rootOccupantSeat(rootId, ctx, d) {
70
70
  return { ...(occupant !== undefined ? { rootSessionIncarnation: occupant } : {}), ...(scope !== undefined ? { rootSessionScope: scope } : {}) };
71
71
  }
72
72
  const WORKFLOW_NOTIFY_ROWS_MAX = 5;
73
- function workflowRecordTeach(run, artifact) {
73
+ function workflowRecordTeach(run, recordLine) {
74
74
  const notDone = run.agents.filter((a) => a.status !== "completed");
75
75
  const rows = notDone
76
76
  .slice(0, WORKFLOW_NOTIFY_ROWS_MAX)
@@ -78,12 +78,7 @@ function workflowRecordTeach(run, artifact) {
78
78
  const rowsTeach = notDone.length === 0
79
79
  ? ""
80
80
  : `Agents that did not complete (${notDone.length} of ${run.agents.length}${notDone.length > rows.length ? `, first ${rows.length} shown` : ""}): ${rows.join("; ")}. `;
81
- const recordTeach = artifact.kind === "stored"
82
- ? `Full record (the result and every agent's row): read it with ReadToolResult (ref "${artifact.ref}") before assuming an empty or unexpected result.`
83
- : artifact.kind === "unconfirmed"
84
- ? "The full record (the result and every agent's row) could not be stored (the write failed or went unconfirmed), so no ref can read it back — it is not readable in this session."
85
- : "The full record (the result and every agent's row) is not stored behind a ref (no offload store) — it is not readable in this session.";
86
- return `${rowsTeach}${recordTeach}`;
81
+ return `${rowsTeach}${recordLine}`;
87
82
  }
88
83
  function workflowUsageBlock(run) {
89
84
  const agents = run.agents;
@@ -486,7 +481,7 @@ async function mountRunWorkflowTool(d) {
486
481
  return structuredError(`workflow script failed to compile: ${thrownText(err)}`);
487
482
  }
488
483
  const hostOnAsk = ctx.onAsk ?? d.parentOnAsk;
489
- const hostDurableApproval = ctx.durableApprovalForChildren ?? d.parentDurableApproval;
484
+ const hostDurableApproval = ctx.durableApprovalForChildren ?? d.parentDurableApprovalForChildren;
490
485
  const runGovernance = hostOnAsk !== undefined && governance.baseline.base.onAsk === undefined
491
486
  ? {
492
487
  ...governance,
@@ -523,6 +518,7 @@ async function mountRunWorkflowTool(d) {
523
518
  try {
524
519
  handle = startWorkflow(d.runner, scriptFn, {
525
520
  store: d.store,
521
+ ...(d.taskArtifacts !== undefined ? { taskArtifacts: d.taskArtifacts } : {}),
526
522
  ...(parkStore !== undefined ? { checkpointStore: parkStore } : {}),
527
523
  ...(d.agents !== undefined ? { agents: d.agents } : {}),
528
524
  ...(d.builtinAgents !== undefined ? { builtinAgents: d.builtinAgents } : {}),
@@ -588,7 +584,7 @@ async function mountRunWorkflowTool(d) {
588
584
  : {}),
589
585
  ...(autoModeReview !== undefined ? { autoModeReview } : {}),
590
586
  ...(agentStations !== undefined ? { agentStations } : {}),
591
- }, { workflowDepth: d.workflowDepth, ...((ctx.toolSelector?.layers ?? d.parentToolCeiling) !== undefined ? { toolCeiling: (ctx.toolSelector?.layers ?? d.parentToolCeiling) } : {}) });
587
+ }, { workflowDepth: d.workflowDepth, ...((ctx.toolSelector?.layers ?? d.parentToolCeiling) !== undefined ? { toolCeiling: (ctx.toolSelector?.layers ?? d.parentToolCeiling) } : {}), ...((ctx.mcpPool ?? d.parentMcpPool) !== undefined ? { mcpPool: (ctx.mcpPool ?? d.parentMcpPool) } : {}) });
592
588
  }
593
589
  catch (err) {
594
590
  return structuredError(thrownText(err));
@@ -648,11 +644,11 @@ async function mountRunWorkflowTool(d) {
648
644
  }))
649
645
  .catch(() => { });
650
646
  };
651
- const recordOf = async (run) => {
652
- const artifact = await persistTaskArtifact(d.taskArtifacts, runId, formatWorkflowRun(run, WORKFLOW_RECORD_WHOLE).content);
653
- if (artifact.kind === "stored")
654
- d.taskRegistry?.recordArtifactRef(runId, artifact.ref, run.completionId);
655
- return workflowRecordTeach(run, artifact);
647
+ const recordOf = (run) => {
648
+ const pickup = workflowRecordPickupOf(run.recordArtifact);
649
+ if (pickup.ref !== undefined)
650
+ d.taskRegistry?.recordArtifactRef(runId, pickup.ref, run.completionId);
651
+ return workflowRecordTeach(run, pickup.line);
656
652
  };
657
653
  handle.done
658
654
  .then(async (res) => fire({
@@ -663,16 +659,16 @@ async function mountRunWorkflowTool(d) {
663
659
  summary: completionSummary(meta.name, res.run),
664
660
  result: boundedRedactedSummary(res.result, 4000),
665
661
  usage: workflowUsageBlock(res.run),
666
- diagnostics: workflowDiagnostics(runId, d.journalStore?.locator?.(runId, res.run.scope), res.run.resume?.journalEntries === 0, await recordOf(res.run).catch(() => "This run's record could not be read.")),
662
+ diagnostics: workflowDiagnostics(runId, d.journalStore?.locator?.(runId, res.run.scope), res.run.resume?.journalEntries === 0, recordOf(res.run)),
667
663
  completionId: res.run.completionId,
668
664
  }), async (err) => {
669
665
  let parts = {
670
666
  summary: failureSummary(undefined, runId),
671
- diagnostics: workflowDiagnostics(runId, undefined, undefined, "This run's record could not be read."),
667
+ diagnostics: workflowDiagnostics(runId, undefined, undefined, workflowRecordPickupOf(undefined).line),
672
668
  };
673
669
  try {
674
670
  const failedRun = settledRunOf(handle.done);
675
- const record = (failedRun !== undefined ? await recordOf(failedRun).catch(() => undefined) : undefined) ?? "This run's record could not be read.";
671
+ const record = failedRun !== undefined ? recordOf(failedRun) : workflowRecordPickupOf(undefined).line;
676
672
  const summary = failureSummary(err, runId);
677
673
  const settleId = failedRun?.completionId;
678
674
  parts = {
@@ -2,6 +2,7 @@ import { deliverEngineNotice } from "../core/types.js";
2
2
  import { tightenTaskSpec } from "../core/tighten-task-spec.js";
3
3
  import { sanitizeUntrustedText } from "../core/untrusted-text.js";
4
4
  import { CLAMP_SET, SCRIPT_SEATS } from "../core/child-clamp-seats.js";
5
+ import { THINKING_LEVELS, isThinkingLevel } from "../brain/reasoning.js";
5
6
  import { WorkflowScriptError } from "./workflow-meta.js";
6
7
  import { uuidv7 } from "../engine/session/uuid.js";
7
8
  import { retiredCheckpointStoreNull } from "../core/checkpoint-store.js";
@@ -48,15 +49,11 @@ function emitStrippedKeysNotice(survey, onNotice) {
48
49
  `A governed workflow script may set only: ${WHITELIST_KEYS.join(", ")} — and each tighten-only seat only in its ` +
49
50
  `tightening direction (${RESTRICTING_SCRIPT_VALUES}; the list seats only add entries). Every other field ` +
50
51
  `of the child comes from the deployment baseline.`;
51
- try {
52
- deliverEngineNotice(onNotice, {
53
- code: STRIPPED_KEYS_NOTICE_CODE,
54
- message,
55
- detail: { total: survey.total, stripped: shown, ...(omitted > 0 ? { omitted } : {}), occurrenceId: uuidv7() },
56
- });
57
- }
58
- catch {
59
- }
52
+ deliverEngineNotice(onNotice, {
53
+ code: STRIPPED_KEYS_NOTICE_CODE,
54
+ message,
55
+ detail: { total: survey.total, stripped: shown, ...(omitted > 0 ? { omitted } : {}), occurrenceId: uuidv7() },
56
+ });
60
57
  }
61
58
  export const IGNORED_AGENT_OPTIONS_NOTICE_CODE = "workflow.agent_option_ignored";
62
59
  export const MAX_ANNOUNCED_KEYS = MAX_STRIPPED_KEYS_ANNOUNCED;
@@ -68,17 +65,12 @@ export function emitIgnoredAgentOptionsNotice(total, sample, accepted, onNotice)
68
65
  `The options object accepts only: ${accepted.join(", ")} — an unrecognized key, or a known one carrying a value its ` +
69
66
  `option does not accept, is ignored and the agent runs without it. Everything about the CHILD's behavior belongs on ` +
70
67
  `the spec (the first argument).`;
71
- try {
72
- deliverEngineNotice(onNotice, {
73
- code: IGNORED_AGENT_OPTIONS_NOTICE_CODE,
74
- message,
75
- detail: { total, ignored: shown, ...(omitted > 0 ? { omitted } : {}), occurrenceId: uuidv7() },
76
- });
77
- }
78
- catch {
79
- }
68
+ deliverEngineNotice(onNotice, {
69
+ code: IGNORED_AGENT_OPTIONS_NOTICE_CODE,
70
+ message,
71
+ detail: { total, ignored: shown, ...(omitted > 0 ? { omitted } : {}), occurrenceId: uuidv7() },
72
+ });
80
73
  }
81
- const VALID_THINKING = new Set(["off", "minimal", "low", "medium", "high", "xhigh", "max"]);
82
74
  export function overlayWorktreeBaseline(base, worktreeBase) {
83
75
  let overlay = worktreeBase;
84
76
  for (const key of Object.keys(worktreeBase)) {
@@ -216,8 +208,8 @@ function pickWhitelist(scriptSpec) {
216
208
  }
217
209
  const safe = { objective };
218
210
  if (thinking !== undefined) {
219
- if (typeof thinking !== "string" || !VALID_THINKING.has(thinking)) {
220
- throw new WorkflowScriptError(`agent(spec): invalid \`thinking\` (must be one of ${[...VALID_THINKING].join(", ")})`);
211
+ if (!isThinkingLevel(thinking)) {
212
+ throw new WorkflowScriptError(`agent(spec): invalid \`thinking\` (must be one of ${THINKING_LEVELS.join(", ")})`);
221
213
  }
222
214
  safe.thinking = thinking;
223
215
  }
@@ -16,9 +16,10 @@ export declare function registerWorkflowParkDelivery(runId: string, deliver: (de
16
16
  * decision whose token names a park it is waiting on and drives the parked child on the same record — the call the
17
17
  * script is awaiting continues with the child's result, nothing is replayed, no second run is started (the fork guard
18
18
  * on `resumeFromRunId` of an active run stays). Every other case answers what the host does instead: `not_active`
19
- * (no run of that id and scope is running here — the run has ended, or runs in another process: resume it with the
20
- * decisions once it has ended, `RunWorkflowOptions.parkedResume` + `resumeFromRunId`), `suspending` (the run has
21
- * suspended on its parks and is ending; `ended` settles at its end — resume it then), `not_armed` (the run holds no
19
+ * (this process has no run of that id and scope — it ended and is gone, or runs in another process: resume it with the
20
+ * decisions once it has ended, `RunWorkflowOptions.parkedResume` + `resumeFromRunId`), `suspending` (the run is ending
21
+ * here — suspended on its parks, or finishing; `ended` settles once its terminal row's write has settled, written or
22
+ * refused by the store — read the record then; resume it with the decisions if it suspended), `not_armed` (the run holds no
22
23
  * checkpoint store to prove a park against). SCOPED like {@link subscribeWorkflow}: a run under another scope answers
23
24
  * `not_active`. TRUSTED: decisions are the host's (a person's approval), never a script's or a model's. Each entry is
24
25
  * read once; an entry whose `token` is not a non-empty string is refused loudly (`config.invalid_argument`).
@@ -27,7 +27,7 @@ export interface WorkflowGovernance {
27
27
  /** The deployment's structured notice sink (`RunnerDeps.onNotice`), threaded here because the governed
28
28
  * build is the only place that can report which spec fields did NOT reach the child (see
29
29
  * `buildGovernedChildSpec`'s `onNotice` param). Only meaningful in governed mode — the trusted-dev lane
30
- * strips nothing. Absent ⇒ the notice falls back to `console.warn`. */
30
+ * strips nothing. Absent ⇒ the notice goes to the process's default notice seat, else one process line. */
31
31
  onNotice?: (n: import("../core/types.js").EngineNotice) => void;
32
32
  }
33
33
  /**
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Decode a run record's `recordArtifact` member — the raw value as read (from a run record in hand, or off a read face; it is not
3
+ * trusted) — and render the sentence that names it to a model.
4
+ *
5
+ * `ref` is present iff the member is the `stored` shape with a ref of the shape the result store mints for a task's result: the
6
+ * key `ReadToolResult` reads the full record back with. `line` is always present: the `stored` sentence naming that ref, the `unconfirmed` or `no_store` sentence saying why there
7
+ * is none, or — for an absent or malformed member, or no record at all (`undefined`) — the sentence that the record could not be
8
+ * read. A reader that synthesizes a completion notice for a model hands over `line` (and `ref` to whatever keeps a read handle);
9
+ * it does not word its own.
10
+ */
11
+ export declare function workflowRecordPickupOf(raw: unknown): {
12
+ ref?: string;
13
+ line: string;
14
+ };