@sema-agent/core 7.59.0 → 7.61.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 (643) hide show
  1. package/CHANGELOG.md +1169 -0
  2. package/README.md +2 -2
  3. package/dist/agents/agent-definition.d.ts +7 -0
  4. package/dist/agents/agent-definition.js +12 -0
  5. package/dist/agents/agent-transcript-tool.d.ts +4 -3
  6. package/dist/agents/agent-transcript-tool.js +4 -2
  7. package/dist/agents/cascade.d.ts +61 -10
  8. package/dist/agents/cascade.js +60 -20
  9. package/dist/agents/child-model-seat.js +6 -3
  10. package/dist/agents/composition-allowance.d.ts +53 -0
  11. package/dist/agents/composition-allowance.js +49 -0
  12. package/dist/agents/composition-placement.d.ts +29 -0
  13. package/dist/agents/composition-placement.js +24 -0
  14. package/dist/agents/cumulative-stats.d.ts +4 -0
  15. package/dist/agents/cumulative-stats.js +3 -1
  16. package/dist/agents/inherited-tool-pool.d.ts +28 -1
  17. package/dist/agents/inherited-tool-pool.js +22 -0
  18. package/dist/agents/list-agents-tool.d.ts +1 -1
  19. package/dist/agents/peer-notice-route.d.ts +1 -1
  20. package/dist/agents/peer-notice-route.js +4 -3
  21. package/dist/agents/peer-notices.d.ts +4 -4
  22. package/dist/agents/peer-notices.js +8 -4
  23. package/dist/agents/peer-session-drain.d.ts +8 -1
  24. package/dist/agents/peer-session-drain.js +36 -7
  25. package/dist/agents/repair-loop.js +16 -6
  26. package/dist/agents/retain-ledger.d.ts +11 -1
  27. package/dist/agents/retain-ledger.js +16 -3
  28. package/dist/agents/roster-store.d.ts +2 -2
  29. package/dist/agents/roster-store.js +8 -3
  30. package/dist/agents/send-message-tool.d.ts +14 -27
  31. package/dist/agents/send-message-tool.js +47 -54
  32. package/dist/agents/subagent-completion-gate.d.ts +35 -0
  33. package/dist/agents/subagent-completion-gate.js +62 -0
  34. package/dist/agents/subagent-steps.d.ts +7 -6
  35. package/dist/agents/subagent.d.ts +52 -28
  36. package/dist/agents/subagent.js +276 -246
  37. package/dist/agents/suspend-guard.d.ts +9 -0
  38. package/dist/agents/suspend-guard.js +4 -0
  39. package/dist/agents/tool-filter.d.ts +1 -3
  40. package/dist/agents/tool-filter.js +4 -12
  41. package/dist/agents/verify.d.ts +41 -14
  42. package/dist/agents/verify.js +37 -27
  43. package/dist/bench/metrics.d.ts +3 -5
  44. package/dist/bench/metrics.js +0 -1
  45. package/dist/brain/anthropic.js +1 -0
  46. package/dist/brain/degrading.js +3 -1
  47. package/dist/brain/errors.d.ts +7 -1
  48. package/dist/brain/errors.js +6 -0
  49. package/dist/brain/failover.js +2 -1
  50. package/dist/brain/open-responses.js +1 -0
  51. package/dist/brain/openai.js +1 -0
  52. package/dist/brain/provider-dialect.d.ts +10 -0
  53. package/dist/brain/provider-dialect.js +13 -2
  54. package/dist/brain/route-adjudicator.js +3 -1
  55. package/dist/brain/status-sink.d.ts +7 -1
  56. package/dist/brain/status-sink.js +6 -0
  57. package/dist/brain/stream-engine.d.ts +3 -0
  58. package/dist/brain/stream-engine.js +4 -0
  59. package/dist/brain/timeout.d.ts +3 -1
  60. package/dist/brain/timeout.js +18 -5
  61. package/dist/core/a2a.d.ts +15 -5
  62. package/dist/core/a2a.js +34 -19
  63. package/dist/core/agent-definition.d.ts +20 -0
  64. package/dist/core/agent-state.d.ts +1 -1
  65. package/dist/core/allow-entry.d.ts +61 -23
  66. package/dist/core/allow-entry.js +134 -39
  67. package/dist/core/artifact-host.d.ts +0 -2
  68. package/dist/core/artifact-host.js +0 -1
  69. package/dist/core/ask-origin.d.ts +79 -0
  70. package/dist/core/ask-origin.js +76 -0
  71. package/dist/core/ask-question.d.ts +19 -13
  72. package/dist/core/ask-question.js +8 -2
  73. package/dist/core/auto-compaction.d.ts +2 -0
  74. package/dist/core/auto-compaction.js +2 -1
  75. package/dist/core/auto-mode-defaults.d.ts +8 -0
  76. package/dist/core/auto-mode-defaults.js +1 -0
  77. package/dist/core/auto-mode-rebuild.d.ts +2 -1
  78. package/dist/core/auto-mode.d.ts +39 -4
  79. package/dist/core/auto-mode.js +66 -17
  80. package/dist/core/background-agent-store.d.ts +17 -6
  81. package/dist/core/background-agent-store.js +15 -13
  82. package/dist/core/background-shell.d.ts +12 -1
  83. package/dist/core/background-shell.js +12 -0
  84. package/dist/core/checkpoint-requirements.d.ts +24 -3
  85. package/dist/core/checkpoint-requirements.js +9 -1
  86. package/dist/core/checkpoint-store.d.ts +86 -32
  87. package/dist/core/checkpoint-store.js +10 -5
  88. package/dist/core/child-clamp-seats.d.ts +3 -2
  89. package/dist/core/child-clamp-seats.js +4 -3
  90. package/dist/core/closest-name.d.ts +13 -0
  91. package/dist/core/closest-name.js +35 -0
  92. package/dist/core/compliance.d.ts +1 -1
  93. package/dist/core/context-settings.js +3 -5
  94. package/dist/core/credential-echo.d.ts +52 -0
  95. package/dist/core/credential-echo.js +65 -0
  96. package/dist/core/credential-vocabulary.d.ts +13 -3
  97. package/dist/core/credential-vocabulary.js +12 -4
  98. package/dist/core/cross-boundary-taint.d.ts +5 -6
  99. package/dist/core/decision-receipt.d.ts +14 -1
  100. package/dist/core/decision-receipt.js +6 -3
  101. package/dist/core/delegation-frames.d.ts +13 -9
  102. package/dist/core/effective-path-target.js +2 -3
  103. package/dist/core/engine-attestation.d.ts +11 -1
  104. package/dist/core/engine-attestation.js +2 -0
  105. package/dist/core/engine-notice.d.ts +106 -32
  106. package/dist/core/file-history-retention.d.ts +8 -0
  107. package/dist/core/file-history-retention.js +14 -11
  108. package/dist/core/file-history-store.d.ts +31 -1
  109. package/dist/core/file-history-store.js +31 -2
  110. package/dist/core/frame-settlement.d.ts +15 -0
  111. package/dist/core/frame-settlement.js +10 -1
  112. package/dist/core/fs-write-gate-policy.d.ts +3 -3
  113. package/dist/core/fs-write-gate-policy.js +8 -7
  114. package/dist/core/gate-fold.js +9 -6
  115. package/dist/core/gate-lanes.js +46 -12
  116. package/dist/core/gate-outcome.d.ts +40 -1
  117. package/dist/core/gate-outcome.js +10 -0
  118. package/dist/core/git-worktree-env.d.ts +7 -3
  119. package/dist/core/git-worktree-env.js +16 -13
  120. package/dist/core/governance-codes.d.ts +19 -3
  121. package/dist/core/governance-codes.js +27 -3
  122. package/dist/core/hands-band-screen.js +0 -1
  123. package/dist/core/hands-band.d.ts +0 -3
  124. package/dist/core/hooks.d.ts +51 -60
  125. package/dist/core/hooks.js +131 -78
  126. package/dist/core/host-floor.js +3 -5
  127. package/dist/core/image-admission.d.ts +145 -52
  128. package/dist/core/image-admission.js +202 -47
  129. package/dist/core/image-downsample.d.ts +36 -69
  130. package/dist/core/image-downsample.js +111 -73
  131. package/dist/core/input-author.d.ts +36 -0
  132. package/dist/core/input-author.js +39 -0
  133. package/dist/core/integer-option.d.ts +21 -0
  134. package/dist/core/integer-option.js +13 -0
  135. package/dist/core/leg-identity.d.ts +62 -0
  136. package/dist/core/leg-identity.js +18 -0
  137. package/dist/core/locked-config.d.ts +55 -3
  138. package/dist/core/locked-config.js +84 -51
  139. package/dist/core/lsp.d.ts +5 -3
  140. package/dist/core/lsp.js +3 -2
  141. package/dist/core/mailbox-store.d.ts +85 -10
  142. package/dist/core/mailbox-store.js +31 -10
  143. package/dist/core/mcp-call-meta.d.ts +2 -2
  144. package/dist/core/mcp-call-meta.js +9 -10
  145. package/dist/core/mcp-connection-pool.d.ts +6 -20
  146. package/dist/core/mcp-connection-pool.js +10 -28
  147. package/dist/core/mcp-failure.d.ts +83 -16
  148. package/dist/core/mcp-failure.js +67 -30
  149. package/dist/core/mcp-host-seat.d.ts +131 -0
  150. package/dist/core/mcp-host-seat.js +305 -0
  151. package/dist/core/mcp-probe.d.ts +7 -2
  152. package/dist/core/mcp-probe.js +9 -4
  153. package/dist/core/mcp-server-link.d.ts +18 -6
  154. package/dist/core/mcp-server-link.js +19 -4
  155. package/dist/core/mcp-server-spec.d.ts +39 -9
  156. package/dist/core/mcp-server-spec.js +55 -21
  157. package/dist/core/mcp-session-end.d.ts +1 -2
  158. package/dist/core/mcp-session-end.js +1 -1
  159. package/dist/core/mcp.d.ts +23 -55
  160. package/dist/core/mcp.js +172 -156
  161. package/dist/core/media-byte-cap.d.ts +21 -46
  162. package/dist/core/media-byte-cap.js +55 -55
  163. package/dist/core/member-group.d.ts +7 -0
  164. package/dist/core/member-group.js +35 -0
  165. package/dist/core/memory-admission.d.ts +23 -6
  166. package/dist/core/memory-admission.js +19 -9
  167. package/dist/core/memory-engine/consolidation.d.ts +1 -1
  168. package/dist/core/memory-engine/consolidation.js +7 -1
  169. package/dist/core/memory-engine/content-origin.d.ts +13 -0
  170. package/dist/core/memory-engine/content-origin.js +21 -3
  171. package/dist/core/memory-engine/dual-root.d.ts +31 -0
  172. package/dist/core/memory-engine/dual-root.js +59 -11
  173. package/dist/core/memory-engine/engine.js +27 -24
  174. package/dist/core/memory-engine/file-backend.d.ts +13 -0
  175. package/dist/core/memory-engine/file-backend.js +35 -15
  176. package/dist/core/memory-engine/index.d.ts +2 -1
  177. package/dist/core/memory-engine/index.js +2 -1
  178. package/dist/core/memory-engine/layout.d.ts +3 -0
  179. package/dist/core/memory-engine/layout.js +13 -3
  180. package/dist/core/memory-engine/memory-deployment.d.ts +110 -0
  181. package/dist/core/memory-engine/memory-deployment.js +182 -0
  182. package/dist/core/memory-engine/scope-contract.d.ts +13 -3
  183. package/dist/core/memory-engine/scope-contract.js +2 -2
  184. package/dist/core/memory-engine/sync-client.d.ts +68 -13
  185. package/dist/core/memory-engine/sync-client.js +147 -18
  186. package/dist/core/memory-engine/sync-report.d.ts +106 -0
  187. package/dist/core/memory-engine/sync-report.js +119 -0
  188. package/dist/core/memory-engine/sync.d.ts +13 -3
  189. package/dist/core/mode-policy.d.ts +15 -7
  190. package/dist/core/mode-policy.js +18 -6
  191. package/dist/core/model-receipt.d.ts +39 -0
  192. package/dist/core/model-receipt.js +139 -0
  193. package/dist/core/mods/agent-stations.d.ts +100 -0
  194. package/dist/core/mods/agent-stations.js +154 -0
  195. package/dist/core/mods/dollar.d.ts +62 -0
  196. package/dist/core/mods/extension-call.d.ts +15 -1
  197. package/dist/core/mods/extension-call.js +7 -2
  198. package/dist/core/mods/kernel/dispatch.d.ts +9 -4
  199. package/dist/core/mods/kernel/dispatch.js +8 -8
  200. package/dist/core/mods/kernel/events.d.ts +13 -4
  201. package/dist/core/mods/kernel/events.js +14 -10
  202. package/dist/core/mods/kernel/receive.d.ts +5 -0
  203. package/dist/core/mods/kernel/receive.js +10 -0
  204. package/dist/core/mods/kernel/registration.d.ts +3 -0
  205. package/dist/core/mods/kernel/registration.js +5 -0
  206. package/dist/core/mods/kernel/site-rules.d.ts +6 -3
  207. package/dist/core/mods/kernel/site-rules.js +10 -2
  208. package/dist/core/mods/lifecycle-stations.d.ts +41 -0
  209. package/dist/core/mods/lifecycle-stations.js +35 -0
  210. package/dist/core/mods/session-append.d.ts +115 -0
  211. package/dist/core/mods/session-append.js +311 -0
  212. package/dist/core/mods/session-compact.d.ts +48 -0
  213. package/dist/core/mods/session-compact.js +194 -0
  214. package/dist/core/mods/session-receive.d.ts +93 -0
  215. package/dist/core/mods/session-receive.js +141 -0
  216. package/dist/core/mods/session-send.d.ts +72 -0
  217. package/dist/core/mods/session-send.js +88 -0
  218. package/dist/core/mods/stations.d.ts +89 -75
  219. package/dist/core/mods/stations.js +57 -53
  220. package/dist/core/mods/tool-call.d.ts +12 -4
  221. package/dist/core/mods/tool-call.js +32 -16
  222. package/dist/core/mounted-mcp.d.ts +5 -0
  223. package/dist/core/mounted-mcp.js +2 -2
  224. package/dist/core/namespaced-rule-name.d.ts +7 -1
  225. package/dist/core/namespaced-rule-name.js +13 -2
  226. package/dist/core/oracle-isolation.js +1 -1
  227. package/dist/core/output-style.js +3 -4
  228. package/dist/core/own-property-receipt.d.ts +62 -0
  229. package/dist/core/own-property-receipt.js +43 -0
  230. package/dist/core/park-selfcheck.js +12 -10
  231. package/dist/core/path-identity.d.ts +11 -0
  232. package/dist/core/path-identity.js +4 -0
  233. package/dist/core/path-rule-binding.d.ts +3 -1
  234. package/dist/core/path-rule-binding.js +3 -1
  235. package/dist/core/peer-seat.d.ts +66 -11
  236. package/dist/core/peer-seat.js +199 -42
  237. package/dist/core/permission-rule-consent.d.ts +21 -26
  238. package/dist/core/permission-rule-consent.js +22 -3
  239. package/dist/core/permission-rule-model.d.ts +38 -13
  240. package/dist/core/permission-rule-model.js +54 -16
  241. package/dist/core/permission-rule-org.d.ts +1 -1
  242. package/dist/core/permission-rule-provider.js +4 -1
  243. package/dist/core/permission-rules.d.ts +4 -0
  244. package/dist/core/permission-rules.js +11 -16
  245. package/dist/core/protocol-http-auth.d.ts +14 -2
  246. package/dist/core/protocol-http-auth.js +16 -7
  247. package/dist/core/read-face-seats.d.ts +7 -5
  248. package/dist/core/read-face-seats.js +4 -1
  249. package/dist/core/redaction-marks.d.ts +4 -3
  250. package/dist/core/redaction-marks.js +2 -2
  251. package/dist/core/remote-env.d.ts +218 -122
  252. package/dist/core/remote-env.js +133 -14
  253. package/dist/core/retention-policy.d.ts +24 -23
  254. package/dist/core/retention-policy.js +36 -2
  255. package/dist/core/retention.d.ts +4 -1
  256. package/dist/core/retention.js +37 -12
  257. package/dist/core/retired-keys.d.ts +8 -3
  258. package/dist/core/retired-keys.js +4 -1
  259. package/dist/core/rewrite-rejudge.d.ts +12 -5
  260. package/dist/core/rewrite-rejudge.js +9 -5
  261. package/dist/core/roles.d.ts +37 -3
  262. package/dist/core/roles.js +126 -78
  263. package/dist/core/row-admission.d.ts +10 -0
  264. package/dist/core/row-admission.js +5 -0
  265. package/dist/core/rule-owner.d.ts +3 -0
  266. package/dist/core/runner/advisor-instructions.d.ts +2 -1
  267. package/dist/core/runner/advisor-instructions.js +2 -1
  268. package/dist/core/runner/announce-once-ledger.d.ts +4 -4
  269. package/dist/core/runner/assemble-result.d.ts +13 -8
  270. package/dist/core/runner/assemble-result.js +12 -8
  271. package/dist/core/runner/call-hook-stations.d.ts +17 -10
  272. package/dist/core/runner/call-hook-stations.js +21 -10
  273. package/dist/core/runner/caller-roster.d.ts +12 -9
  274. package/dist/core/runner/caller-roster.js +5 -2
  275. package/dist/core/runner/checkpoint-scope.d.ts +16 -1
  276. package/dist/core/runner/checkpoint-scope.js +21 -0
  277. package/dist/core/runner/child-tree.d.ts +7 -8
  278. package/dist/core/runner/child-tree.js +6 -6
  279. package/dist/core/runner/classifier-ladder.d.ts +10 -2
  280. package/dist/core/runner/classifier-ladder.js +39 -8
  281. package/dist/core/runner/compact-session.js +14 -2
  282. package/dist/core/runner/compaction-call-options.d.ts +1 -1
  283. package/dist/core/runner/compaction-restate.d.ts +2 -2
  284. package/dist/core/runner/compaction-restate.js +4 -3
  285. package/dist/core/runner/construction-doors.d.ts +2 -2
  286. package/dist/core/runner/construction-doors.js +7 -2
  287. package/dist/core/runner/contracts.d.ts +158 -65
  288. package/dist/core/runner/cross-boundary-lane.d.ts +4 -6
  289. package/dist/core/runner/cross-boundary-lane.js +11 -2
  290. package/dist/core/runner/decide-continuation.d.ts +4 -2
  291. package/dist/core/runner/decide-continuation.js +7 -4
  292. package/dist/core/runner/denial-limit-arms.d.ts +15 -21
  293. package/dist/core/runner/denial-limit-arms.js +17 -10
  294. package/dist/core/runner/env-capability-census.d.ts +15 -20
  295. package/dist/core/runner/env-capability-census.js +25 -34
  296. package/dist/core/runner/expire-settle.d.ts +44 -0
  297. package/dist/core/runner/expire-settle.js +55 -0
  298. package/dist/core/runner/file-history-request.d.ts +2 -2
  299. package/dist/core/runner/file-history-request.js +0 -8
  300. package/dist/core/runner/gate-exit.d.ts +75 -7
  301. package/dist/core/runner/gate-exit.js +20 -1
  302. package/dist/core/runner/git-status-frame.d.ts +5 -2
  303. package/dist/core/runner/git-status-frame.js +4 -4
  304. package/dist/core/runner/halt-attribution.d.ts +2 -1
  305. package/dist/core/runner/halt-attribution.js +2 -1
  306. package/dist/core/runner/image.d.ts +7 -2
  307. package/dist/core/runner/image.js +14 -8
  308. package/dist/core/runner/inline-image.d.ts +10 -8
  309. package/dist/core/runner/inline-image.js +11 -9
  310. package/dist/core/runner/local-claims.d.ts +17 -0
  311. package/dist/core/runner/local-claims.js +18 -0
  312. package/dist/core/runner/media-removed-seat.d.ts +46 -0
  313. package/dist/core/runner/media-removed-seat.js +88 -0
  314. package/dist/core/runner/memory-consolidation-driver.js +4 -4
  315. package/dist/core/runner/park-commit.d.ts +2 -2
  316. package/dist/core/runner/permission-rule-lanes.d.ts +5 -1
  317. package/dist/core/runner/permission-rule-lanes.js +29 -10
  318. package/dist/core/runner/person-path-rows.js +1 -1
  319. package/dist/core/runner/placement-fence.d.ts +26 -0
  320. package/dist/core/runner/placement-fence.js +38 -0
  321. package/dist/core/runner/prepare-ask-lane.d.ts +6 -12
  322. package/dist/core/runner/prepare-ask-lane.js +4 -4
  323. package/dist/core/runner/prepare-boundary-parks.d.ts +6 -3
  324. package/dist/core/runner/prepare-boundary-parks.js +4 -4
  325. package/dist/core/runner/prepare-caps-and-workflow.d.ts +6 -0
  326. package/dist/core/runner/prepare-caps-and-workflow.js +5 -3
  327. package/dist/core/runner/prepare-config-doors.d.ts +6 -1
  328. package/dist/core/runner/prepare-config-doors.js +30 -26
  329. package/dist/core/runner/prepare-context-lane.d.ts +6 -2
  330. package/dist/core/runner/prepare-context-lane.js +13 -13
  331. package/dist/core/runner/prepare-delegation-surface.d.ts +13 -11
  332. package/dist/core/runner/prepare-delegation-surface.js +7 -8
  333. package/dist/core/runner/prepare-execution-env.d.ts +5 -2
  334. package/dist/core/runner/prepare-execution-env.js +7 -4
  335. package/dist/core/runner/prepare-file-history.d.ts +10 -12
  336. package/dist/core/runner/prepare-file-history.js +3 -12
  337. package/dist/core/runner/prepare-gate-stations.d.ts +23 -17
  338. package/dist/core/runner/prepare-gate-stations.js +10 -7
  339. package/dist/core/runner/prepare-hands-readface.d.ts +8 -6
  340. package/dist/core/runner/prepare-hands-readface.js +19 -11
  341. package/dist/core/runner/prepare-inherited-gate.d.ts +11 -4
  342. package/dist/core/runner/prepare-inherited-gate.js +12 -5
  343. package/dist/core/runner/prepare-lsp.d.ts +3 -0
  344. package/dist/core/runner/prepare-lsp.js +2 -2
  345. package/dist/core/runner/prepare-memory-engine-session.js +1 -1
  346. package/dist/core/runner/prepare-memory.d.ts +2 -2
  347. package/dist/core/runner/prepare-memory.js +2 -2
  348. package/dist/core/runner/prepare-park-ask.d.ts +8 -7
  349. package/dist/core/runner/prepare-park-ask.js +6 -12
  350. package/dist/core/runner/prepare-policy-chain.d.ts +15 -25
  351. package/dist/core/runner/prepare-policy-chain.js +131 -128
  352. package/dist/core/runner/prepare-project-context.d.ts +2 -2
  353. package/dist/core/runner/prepare-project-context.js +8 -5
  354. package/dist/core/runner/prepare-prompt-inputs.d.ts +4 -0
  355. package/dist/core/runner/prepare-prompt-inputs.js +4 -2
  356. package/dist/core/runner/prepare-protocol-tools.d.ts +5 -3
  357. package/dist/core/runner/prepare-protocol-tools.js +9 -2
  358. package/dist/core/runner/prepare-question-face.d.ts +6 -4
  359. package/dist/core/runner/prepare-question-face.js +2 -2
  360. package/dist/core/runner/prepare-run-refs.d.ts +3 -0
  361. package/dist/core/runner/prepare-run-refs.js +2 -2
  362. package/dist/core/runner/prepare-suspend-saga.d.ts +11 -9
  363. package/dist/core/runner/prepare-suspend-saga.js +21 -13
  364. package/dist/core/runner/prepare-task.d.ts +1 -1
  365. package/dist/core/runner/prepare-task.js +84 -42
  366. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +6 -0
  367. package/dist/core/runner/prepare-tool-disclosure-mount.js +3 -1
  368. package/dist/core/runner/prepare-turn-wiring.d.ts +2 -0
  369. package/dist/core/runner/prepare-turn-wiring.js +7 -2
  370. package/dist/core/runner/prepare-wiring-manifest.d.ts +7 -3
  371. package/dist/core/runner/prepare-wiring-manifest.js +34 -19
  372. package/dist/core/runner/prepare-workspace-restore.d.ts +5 -0
  373. package/dist/core/runner/prepare-workspace-restore.js +12 -8
  374. package/dist/core/runner/read-root-grant.d.ts +1 -1
  375. package/dist/core/runner/read-root-grant.js +2 -1
  376. package/dist/core/runner/resume-admission.d.ts +5 -3
  377. package/dist/core/runner/resume-admission.js +17 -3
  378. package/dist/core/runner/resume-apply.js +3 -1
  379. package/dist/core/runner/resume-checkpoint-screen.js +4 -4
  380. package/dist/core/runner/resume-claim.d.ts +8 -3
  381. package/dist/core/runner/resume-claim.js +28 -12
  382. package/dist/core/runner/resume-internals-and-config.d.ts +2 -2
  383. package/dist/core/runner/resume-internals-and-config.js +10 -1
  384. package/dist/core/runner/resume-preflight.d.ts +3 -2
  385. package/dist/core/runner/resume-preflight.js +13 -26
  386. package/dist/core/runner/retired-runner-deps.js +6 -1
  387. package/dist/core/runner/run-attachment-seats.js +3 -3
  388. package/dist/core/runner/run-brain-sinks.js +1 -0
  389. package/dist/core/runner/run-git-lane.d.ts +3 -1
  390. package/dist/core/runner/run-git-lane.js +3 -2
  391. package/dist/core/runner/run-harness-handlers.d.ts +3 -1
  392. package/dist/core/runner/run-harness-handlers.js +5 -3
  393. package/dist/core/runner/run-identity-wiring.d.ts +2 -2
  394. package/dist/core/runner/run-identity-wiring.js +15 -6
  395. package/dist/core/runner/run-leg.d.ts +3 -3
  396. package/dist/core/runner/run-leg.js +65 -56
  397. package/dist/core/runner/run-notification-lane.d.ts +3 -1
  398. package/dist/core/runner/run-notification-lane.js +36 -12
  399. package/dist/core/runner/run-recovery-lanes.js +3 -2
  400. package/dist/core/runner/run-settle-and-teardown.js +14 -8
  401. package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
  402. package/dist/core/runner/run-stop-and-final-verify.js +12 -4
  403. package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +1 -1
  404. package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
  405. package/dist/core/runner/run-terminal-adoption.js +26 -17
  406. package/dist/core/runner/run-turn-boundary.js +37 -19
  407. package/dist/core/runner/runtask.d.ts +25 -7
  408. package/dist/core/runner/runtask.js +46 -22
  409. package/dist/core/runner/session-rule-policy.d.ts +1 -1
  410. package/dist/core/runner/session-rule-policy.js +6 -1
  411. package/dist/core/runner/shell-env-withheld.d.ts +1 -1
  412. package/dist/core/runner/skills-seat.js +2 -2
  413. package/dist/core/runner/stream-halt-verbs.d.ts +1 -14
  414. package/dist/core/runner/stream-halt-verbs.js +4 -3
  415. package/dist/core/runner/stream-reap.d.ts +7 -6
  416. package/dist/core/runner/stream-reap.js +13 -16
  417. package/dist/core/runner/stream-settle-backstop.d.ts +3 -2
  418. package/dist/core/runner/stream-settle-backstop.js +5 -3
  419. package/dist/core/runner/stream-steer-verb.d.ts +5 -2
  420. package/dist/core/runner/stream-steer-verb.js +8 -7
  421. package/dist/core/runner/sub-agent-deny-lists.js +10 -7
  422. package/dist/core/runner/synthetic-tools.js +2 -2
  423. package/dist/core/runner/terminal-account.d.ts +11 -1
  424. package/dist/core/runner/terminal-account.js +20 -0
  425. package/dist/core/runner/terminal-projection.d.ts +8 -2
  426. package/dist/core/runner/terminal-projection.js +2 -2
  427. package/dist/core/runner/tool-disclosure.d.ts +3 -0
  428. package/dist/core/runner/tool-disclosure.js +5 -4
  429. package/dist/core/runner/tool-end-body.d.ts +3 -3
  430. package/dist/core/runner/tool-end-body.js +1 -1
  431. package/dist/core/runner/tool-face-overlay.d.ts +1 -1
  432. package/dist/core/runner/tool-face-overlay.js +26 -19
  433. package/dist/core/runner/tool-output-projection.d.ts +3 -3
  434. package/dist/core/runner/tool-output-projection.js +7 -6
  435. package/dist/core/runner/tool-result-media-seat.d.ts +9 -1
  436. package/dist/core/runner/tool-result-media-seat.js +17 -1
  437. package/dist/core/runner/tool-table-view.d.ts +56 -0
  438. package/dist/core/runner/tool-table-view.js +51 -0
  439. package/dist/core/runner/turn-attachments.d.ts +6 -7
  440. package/dist/core/runner/turn-attachments.js +4 -17
  441. package/dist/core/runner/void-verifier-pause.d.ts +33 -0
  442. package/dist/core/runner/void-verifier-pause.js +41 -0
  443. package/dist/core/runner-deps.d.ts +55 -43
  444. package/dist/core/secret-env.d.ts +14 -13
  445. package/dist/core/secret-env.js +8 -9
  446. package/dist/core/session-log-transfer.js +9 -10
  447. package/dist/core/session-policy-store.d.ts +10 -3
  448. package/dist/core/session-policy-store.js +21 -3
  449. package/dist/core/session-reconcile.d.ts +3 -2
  450. package/dist/core/session-reconcile.js +7 -4
  451. package/dist/core/session-store.d.ts +5 -2
  452. package/dist/core/session-store.js +53 -16
  453. package/dist/core/session.d.ts +2 -1
  454. package/dist/core/shell-confinement.d.ts +37 -0
  455. package/dist/core/shell-confinement.js +56 -0
  456. package/dist/core/skill-grant.d.ts +9 -0
  457. package/dist/core/skill-grant.js +18 -0
  458. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +2 -2
  459. package/dist/core/store-contracts/checkpoint-store-contract.js +15 -2
  460. package/dist/core/store-contracts/file-history-store-contract.d.ts +5 -2
  461. package/dist/core/store-contracts/file-history-store-contract.js +25 -1
  462. package/dist/core/store-contracts/mailbox-store-contract.d.ts +12 -5
  463. package/dist/core/store-contracts/mailbox-store-contract.js +156 -9
  464. package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
  465. package/dist/core/store-contracts/tool-result-store-contract.js +67 -0
  466. package/dist/core/stub-env.d.ts +5 -5
  467. package/dist/core/stub-env.js +11 -1
  468. package/dist/core/swappable-deps.d.ts +17 -43
  469. package/dist/core/swappable-deps.js +15 -5
  470. package/dist/core/synthetic-read-verdict.d.ts +1 -1
  471. package/dist/core/task-event.d.ts +35 -10
  472. package/dist/core/task-limits.d.ts +5 -0
  473. package/dist/core/task-notification.d.ts +172 -12
  474. package/dist/core/task-notification.js +209 -12
  475. package/dist/core/task-registry-agent.d.ts +23 -55
  476. package/dist/core/task-registry-agent.js +41 -56
  477. package/dist/core/task-registry-monitor.d.ts +8 -1
  478. package/dist/core/task-registry-monitor.js +43 -61
  479. package/dist/core/task-registry-shared.d.ts +52 -114
  480. package/dist/core/task-registry-shared.js +24 -48
  481. package/dist/core/task-registry-workflow.js +5 -22
  482. package/dist/core/task-registry.d.ts +64 -90
  483. package/dist/core/task-registry.js +73 -119
  484. package/dist/core/task-result.d.ts +27 -19
  485. package/dist/core/task-spec-members.d.ts +39 -0
  486. package/dist/core/task-spec-members.js +92 -0
  487. package/dist/core/task-spec.d.ts +13 -16
  488. package/dist/core/task-stream.d.ts +1 -1
  489. package/dist/core/task-tool-shape.d.ts +7 -57
  490. package/dist/core/task-tool-shape.js +7 -66
  491. package/dist/core/terminal-cause.d.ts +30 -0
  492. package/dist/core/terminal-cause.js +1 -0
  493. package/dist/core/tool-catalog-entries.js +3 -6
  494. package/dist/core/tool-check-reading.js +16 -10
  495. package/dist/core/tool-conformance.js +1 -2
  496. package/dist/core/tool-errors.d.ts +6 -3
  497. package/dist/core/tool-errors.js +2 -0
  498. package/dist/core/tool-face-reader.d.ts +7 -6
  499. package/dist/core/tool-face-reader.js +6 -4
  500. package/dist/core/tool-face.d.ts +2 -3
  501. package/dist/core/tool-name-aliases.d.ts +23 -28
  502. package/dist/core/tool-name-aliases.js +63 -7
  503. package/dist/core/tool-name-readings.d.ts +14 -3
  504. package/dist/core/tool-name-readings.js +2 -0
  505. package/dist/core/tool-policy.d.ts +113 -22
  506. package/dist/core/tool-policy.js +85 -15
  507. package/dist/core/tool-registry.d.ts +5 -5
  508. package/dist/core/tool-registry.js +2 -2
  509. package/dist/core/tool-result-store.d.ts +111 -5
  510. package/dist/core/tool-result-store.js +52 -12
  511. package/dist/core/tool-spec.d.ts +39 -10
  512. package/dist/core/trace.d.ts +18 -2
  513. package/dist/core/types.d.ts +3 -3
  514. package/dist/core/types.js +1 -1
  515. package/dist/core/untrusted-text.js +1 -1
  516. package/dist/core/user-attachment.d.ts +10 -5
  517. package/dist/core/user-attachment.js +40 -27
  518. package/dist/core/workflow-journal-store.d.ts +1 -1
  519. package/dist/core/workflow-run-store.d.ts +2 -0
  520. package/dist/core/workflow-run-store.js +6 -5
  521. package/dist/core/workflow-settled-run.d.ts +5 -0
  522. package/dist/core/workflow-settled-run.js +7 -0
  523. package/dist/engine/execution-env/node-execution-env.d.ts +37 -7
  524. package/dist/engine/execution-env/node-execution-env.js +224 -21
  525. package/dist/engine/harness/agent-harness.d.ts +66 -19
  526. package/dist/engine/harness/agent-harness.js +98 -27
  527. package/dist/engine/harness/messages.d.ts +4 -3
  528. package/dist/engine/harness/messages.js +2 -2
  529. package/dist/engine/harness/types.d.ts +151 -34
  530. package/dist/engine/llm/media-removed.d.ts +14 -0
  531. package/dist/engine/llm/media-removed.js +9 -0
  532. package/dist/engine/llm/rejected-images.d.ts +35 -25
  533. package/dist/engine/llm/rejected-images.js +59 -10
  534. package/dist/engine/llm/types.d.ts +24 -3
  535. package/dist/engine/llm/types.js +7 -3
  536. package/dist/engine/loop/agent-loop.d.ts +18 -13
  537. package/dist/engine/loop/agent-loop.js +173 -32
  538. package/dist/engine/loop/types.d.ts +21 -5
  539. package/dist/engine/lsp/node-lsp-manager.d.ts +3 -3
  540. package/dist/engine/lsp/node-lsp-manager.js +32 -13
  541. package/dist/engine/session/import-validate.js +7 -0
  542. package/dist/fixtures/index.d.ts +7 -5
  543. package/dist/fixtures/index.js +5 -3
  544. package/dist/index.d.ts +41 -23
  545. package/dist/index.js +29 -16
  546. package/dist/internal/harness-types.d.ts +3 -1
  547. package/dist/internal/llm.d.ts +2 -1
  548. package/dist/internal/llm.js +1 -0
  549. package/dist/orchestration/goal.d.ts +6 -2
  550. package/dist/orchestration/goal.js +6 -3
  551. package/dist/orchestration/run-workflow-tool.d.ts +20 -20
  552. package/dist/orchestration/run-workflow-tool.js +63 -56
  553. package/dist/orchestration/workflow-governance.d.ts +1 -1
  554. package/dist/orchestration/workflow-governance.js +2 -1
  555. package/dist/orchestration/workflow-types.d.ts +2 -2
  556. package/dist/orchestration/workflow.d.ts +8 -0
  557. package/dist/orchestration/workflow.js +33 -9
  558. package/dist/prompts/default.d.ts +1 -10
  559. package/dist/prompts/default.js +0 -2
  560. package/dist/stores/file/background-agent-store.d.ts +1 -1
  561. package/dist/stores/file/background-agent-store.js +19 -14
  562. package/dist/stores/file/checkpoint-store.d.ts +127 -2
  563. package/dist/stores/file/checkpoint-store.js +24 -16
  564. package/dist/stores/file/file-history-store.d.ts +1 -1
  565. package/dist/stores/file/file-history-store.js +4 -1
  566. package/dist/stores/file/index.d.ts +9 -6
  567. package/dist/stores/file/index.js +33 -9
  568. package/dist/stores/file/ledger-tuning.d.ts +23 -0
  569. package/dist/stores/file/ledger-tuning.js +21 -0
  570. package/dist/stores/file/mailbox-store.d.ts +1 -1
  571. package/dist/stores/file/mailbox-store.js +43 -21
  572. package/dist/stores/file/memory-store.d.ts +1 -1
  573. package/dist/stores/file/memory-store.js +4 -1
  574. package/dist/stores/file/permission-rule-adopt.js +24 -21
  575. package/dist/stores/file/permission-rule-store.js +6 -3
  576. package/dist/stores/file/session-policy-store.d.ts +1 -1
  577. package/dist/stores/file/session-policy-store.js +4 -1
  578. package/dist/stores/file/session-store.d.ts +17 -4
  579. package/dist/stores/file/session-store.js +22 -19
  580. package/dist/stores/file/shared-ledger.d.ts +26 -0
  581. package/dist/stores/file/shared-ledger.js +38 -9
  582. package/dist/stores/file/tool-result-store.d.ts +31 -2
  583. package/dist/stores/file/tool-result-store.js +129 -7
  584. package/dist/stores/file/usage-window-store.d.ts +1 -1
  585. package/dist/stores/file/usage-window-store.js +4 -1
  586. package/dist/stores/file/workflow-journal-store.d.ts +1 -13
  587. package/dist/stores/file/workflow-journal-store.js +4 -18
  588. package/dist/stores/file/workflow-run-store.d.ts +1 -1
  589. package/dist/stores/file/workflow-run-store.js +15 -10
  590. package/dist/tools/fs/containment-face.d.ts +5 -0
  591. package/dist/tools/fs/dead-cwd.d.ts +5 -5
  592. package/dist/tools/fs/dead-cwd.js +4 -11
  593. package/dist/tools/fs/encoding.d.ts +13 -4
  594. package/dist/tools/fs/encoding.js +17 -2
  595. package/dist/tools/fs/fs-bash-background-text.d.ts +13 -0
  596. package/dist/tools/fs/fs-bash-background-text.js +7 -0
  597. package/dist/tools/fs/fs-bash.d.ts +11 -22
  598. package/dist/tools/fs/fs-bash.js +58 -154
  599. package/dist/tools/fs/fs-pdf.d.ts +2 -2
  600. package/dist/tools/fs/fs-pdf.js +34 -27
  601. package/dist/tools/fs/fs-read.d.ts +5 -4
  602. package/dist/tools/fs/fs-read.js +35 -18
  603. package/dist/tools/fs/fs-search-tools.js +4 -1
  604. package/dist/tools/fs/fs-shared.d.ts +39 -16
  605. package/dist/tools/fs/fs-shared.js +25 -6
  606. package/dist/tools/fs/fs-write.js +5 -5
  607. package/dist/tools/fs/index.d.ts +15 -9
  608. package/dist/tools/fs/index.js +12 -18
  609. package/dist/tools/fs/pdf.d.ts +4 -4
  610. package/dist/tools/fs/pdf.js +6 -6
  611. package/dist/tools/fs/read-deny-home.js +8 -1
  612. package/dist/tools/fs/read-deny.d.ts +26 -2
  613. package/dist/tools/fs/read-deny.js +9 -2
  614. package/dist/tools/fs/read-floor.d.ts +57 -6
  615. package/dist/tools/fs/read-floor.js +241 -2
  616. package/dist/tools/fs/removal-targets.d.ts +9 -4
  617. package/dist/tools/fs/removal-targets.js +17 -9
  618. package/dist/tools/fs/search.d.ts +6 -5
  619. package/dist/tools/fs/search.js +10 -10
  620. package/dist/tools/fs/shell-read-establish.js +3 -1
  621. package/dist/tools/fs/shell-read-identity.d.ts +3 -1
  622. package/dist/tools/fs/shell-read-identity.js +4 -2
  623. package/dist/tools/fs/shell-read-judge.d.ts +7 -1
  624. package/dist/tools/fs/shell-read-judge.js +1 -1
  625. package/dist/tools/monitor.d.ts +12 -10
  626. package/dist/tools/monitor.js +22 -13
  627. package/dist/tools/scheduler-tools.js +42 -4
  628. package/dist/tools/web.d.ts +0 -10
  629. package/dist/tools/web.js +1 -4
  630. package/dist/tools/worktree.d.ts +5 -1
  631. package/dist/tools/worktree.js +20 -17
  632. package/package.json +8 -3
  633. package/test/export-surface.snapshot.json +166 -30
  634. package/wire-changes/core-stores-sql@7.60.0.json +30 -0
  635. package/wire-changes/core-stores-sql@7.61.0.json +480 -0
  636. package/wire-changes/core@7.60.0.json +3274 -0
  637. package/wire-changes/core@7.61.0.json +4405 -0
  638. package/wire-changes/mods-kernel@7.60.0.json +62 -0
  639. package/wire-changes/mods-kernel@7.61.0.json +65 -0
  640. package/wire-changes/primitives@7.60.0.json +30 -0
  641. package/wire-changes/primitives@7.61.0.json +30 -0
  642. package/dist/core/runner/image-removed-seat.d.ts +0 -12
  643. package/dist/core/runner/image-removed-seat.js +0 -19
@@ -94,11 +94,21 @@ export interface CredentialVocabulary {
94
94
  readonly policy: VocabularyPolicy;
95
95
  }
96
96
  /**
97
- * The URI scheme, bounded so it cannot backtrack: RFC 3986's scheme production plus `_`, at most 64 characters. An
98
- * unbounded `\w+` made every `://` pattern quadratic in the longest unbroken word run (one long base64 paste cost
99
- * seconds of synchronous CPU); the bound makes it linear and redacts no less on any URL.
97
+ * The URI scheme: RFC 3986's scheme production plus `_`, of any length, read from the START of its run of scheme characters
98
+ * (a run's leading digits and marks are taken into it, so the match keeps them). An unanchored unbounded `\w+` made every
99
+ * `://` pattern quadratic in the longest unbroken word run (one long base64 paste cost seconds of synchronous CPU), and a
100
+ * 64-character cap that replaced it missed a longer scheme; anchored at the run's start, each run is tried once — linear, and
101
+ * no scheme is too long to be read.
100
102
  */
101
103
  export declare const URI_SCHEME_SOURCE: string;
104
+ /**
105
+ * A URL's userinfo with the `@` that ends it, up to the LAST `@` before the host (a password may hold `@`): runs of characters
106
+ * that are no `/`, white space, `"` or `@`, each closed by an `@`. The class holds all of RFC 3986's userinfo (unreserved,
107
+ * pct-encoded, sub-delims — `'` among them — and `:`) and the characters a password written unencoded carries (`#`, `?`, …);
108
+ * `"` ends it, the quote of a string around the URL. The one userinfo grammar: every reader that removes a userinfo matches
109
+ * this, and each renders the match its own way.
110
+ */
111
+ export declare const URL_USERINFO_SOURCE: string;
102
112
  /** The fewest characters a string can have and still be read as a credential: the floor of a vendor-prefixed token's body
103
113
  * and of a bearer / authorization credential run in this table, and of the value rules of the env scrub. A shorter
104
114
  * string names no secret, whoever holds it. */
@@ -1,4 +1,5 @@
1
- export const URI_SCHEME_SOURCE = String.raw `[A-Za-z][A-Za-z0-9+.\-_]{0,63}`;
1
+ export const URI_SCHEME_SOURCE = String.raw `(?<![A-Za-z0-9+.\-_])[0-9+.\-_]*[A-Za-z][A-Za-z0-9+.\-_]*`;
2
+ export const URL_USERINFO_SOURCE = String.raw `(?:[^/\s"@]*@)+`;
2
3
  export const CREDENTIAL_MIN_CHARS = 8;
3
4
  const VENDOR_BODY = `[A-Za-z0-9_-]{${CREDENTIAL_MIN_CHARS},}`;
4
5
  const VALUE_END = String.raw `\s"';|&`;
@@ -23,6 +24,13 @@ const BEARER_TAIL = `(?:(?!${QUOTE})\\S${GLUED_RUN}|(?<==)(?:${QUOTED_VALUE}))`;
23
24
  const HEADER_PARAM = String.raw `=[ \t]*(\\{0,${ESCAPE_DEPTH}})(["'])(?:(?!(?<!\\)\2\3)[^\r\n])*(?:(?<!\\)\2\3(?=[\s,;]|\\{0,${ESCAPE_DEPTH}}["']|$)|(?=[\r\n]|$))`;
24
25
  const HEADER_VALUE = String.raw `(?:[A-Za-z][A-Za-z0-9!#$%&*+.^_|~-]*[ \t]+)?(?:${HEADER_PARAM}|[^\s"',]|[ \t]*,[ \t]*(?=[^\s"',])|[ \t]+(?==)|(?<==)[ \t]+(?=[^\s"',]))+${VALUE_RUN_END}`;
25
26
  const headed = (body, flags = "g") => new RegExp(`${WORD_START}${body}`, flags);
27
+ const HUMP_BEFORE = "[a-z0-9]";
28
+ const KEYWORD_VALUE_WORDS = ["token", "secret", "key", "password", "passwd", "credential"];
29
+ const anyCase = (word) => [...word].map((c) => `[${c.toUpperCase()}${c.toLowerCase()}]`).join("");
30
+ const VALUE_ROW_FIELDS = [["Account", "Key"]];
31
+ const leftToItsRow = (keyword) => VALUE_ROW_FIELDS.filter(([, k]) => k.toLowerCase() === keyword).map(([front]) => `(?<!(?<![A-Za-z0-9])${front})`).join("");
32
+ const KEYWORD_HEAD = `(?:${WORD_START}(?:${KEYWORD_VALUE_WORDS.map(anyCase).join("|")})|(?<=${HUMP_BEFORE})(?:${KEYWORD_VALUE_WORDS.map((w) => leftToItsRow(w) + w[0].toUpperCase() + anyCase(w.slice(1))).join("|")})|(?<=[A-Z])(?:${KEYWORD_VALUE_WORDS.map((w) => w[0].toUpperCase() + w[1] + anyCase(w.slice(2))).join("|")}))`;
33
+ const KEY_QUOTE = `(?:\\\\{0,${ESCAPE_DEPTH}}["'])?`;
26
34
  export const CREDENTIAL_VOCABULARY = {
27
35
  values: [
28
36
  { id: "github-token", kind: "prefixed-token", source: "arg-summary", confidence: "high", pass: "vendor-prefixed", match: headed(`gh[opsur][-_]${VENDOR_BODY}`), strict: /\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{36,}\b/ },
@@ -42,8 +50,8 @@ export const CREDENTIAL_VOCABULARY = {
42
50
  { id: "bearer-token", kind: "bearer-token", source: "arg-summary", confidence: "high", match: headed(String.raw `()[Bb][Ee][Aa][Rr][Ee][Rr]\s+[A-Za-z0-9._~+/-]{${CREDENTIAL_MIN_CHARS},}=*(?:${BEARER_TAIL})?`), strict: /\bAuthorization:\s*Bearer\s+(?=[A-Za-z0-9._~+/-]*[0-9])[A-Za-z0-9._~+/-]{20,}=*/ },
43
51
  { id: "authorization-header", kind: "authorization-header", source: "arg-summary", confidence: "high", match: headed(String.raw `(authorization(?:\\{0,${ESCAPE_DEPTH}}["'])?[ \t]*[=:][ \t]*(?:\\{0,${ESCAPE_DEPTH}}["'])?)${HEADER_VALUE}`, "gi") },
44
52
  { id: "azure-storage-account-key", kind: "prefixed-token", source: "arg-summary", confidence: "high", match: /(AccountKey=)[A-Za-z0-9+/]{40,}={0,2}/g, strict: /AccountKey=[A-Za-z0-9+/]{40,}={0,2}/ },
45
- { id: "keyword-value", kind: "keyword-value", source: "arg-summary", confidence: "medium", match: headed(String.raw `((?:token|secret|key|password|passwd|credential)["']?\s*[=:]\s*["']?)${VALUE_CHAR}{4,}${VALUE_RUN_END}`, "gi") },
46
- { id: "url-userinfo", kind: "url-credentials", source: "untrusted-egress", confidence: "medium", match: new RegExp(String.raw `(${URI_SCHEME_SOURCE}:\/\/)((?:[^/\s"'@]*@)+)`, "gi") },
53
+ { id: "keyword-value", kind: "keyword-value", source: "arg-summary", confidence: "medium", match: new RegExp(String.raw `(${KEYWORD_HEAD}${KEY_QUOTE}\s*[=:]\s*${KEY_QUOTE})${VALUE_CHAR}{4,}${VALUE_RUN_END}`, "g") },
54
+ { id: "url-userinfo", kind: "url-credentials", source: "untrusted-egress", confidence: "medium", match: new RegExp(String.raw `(${URI_SCHEME_SOURCE}:\/\/)(${URL_USERINFO_SOURCE})`, "gi") },
47
55
  { id: "signed-url-param", kind: "signed-url-param", source: "untrusted-egress", confidence: "high", match: /([?&#](?:sig|signature|sas|code)=)[^&\s"'#]+/gi },
48
56
  ],
49
57
  words: [
@@ -137,7 +145,7 @@ export function envNameView(vocabulary) {
137
145
  export function splitCamelCase(name) {
138
146
  return ["OAuth", "NextAuth"]
139
147
  .reduce((text, word) => text.replaceAll(word, word[0] + word.slice(1).toLowerCase()), name)
140
- .replace(/([a-z0-9])([A-Z])/g, "$1_$2")
148
+ .replace(new RegExp(`(${HUMP_BEFORE})([A-Z])`, "g"), "$1_$2")
141
149
  .replace(/([A-Z])([A-Z][a-z])/g, "$1_$2");
142
150
  }
143
151
  export function recordKeyView(vocabulary) {
@@ -12,6 +12,7 @@
12
12
  */
13
13
  import type { AssertAllKeysHandled } from "./ask-origin.js";
14
14
  import type { EngineNotice } from "./engine-notice.js";
15
+ import type { ExecutionEnv } from "../internal/harness-types.js";
15
16
  import type { HostDecider } from "./gate-outcome.js";
16
17
  /** The run tree's two TAINT bits: the tree executes on a target device (`targetExecutionArmed`), and an off-target read
17
18
  * was allowed into it since (`offTargetReadObserved`). Presence-coded on every carrier: `true` or absent, never `false`. */
@@ -50,15 +51,13 @@ export interface CrossBoundaryObligation {
50
51
  readonly record: boolean;
51
52
  }
52
53
  /** What a `"per_call"` definition's dispatch gives for one call: the legs it travels and, when its `env` leg reaches an
53
- * environment other than the calling leg's own (a background shell's), that environment — its declaration is read as the call
54
- * is judged. */
54
+ * environment other than the calling leg's own (a background shell's), that environment — its declaration
55
+ * (`capabilities.externalContentTarget`) is read as the call is judged. */
55
56
  export interface BoundaryLegsGiven {
56
57
  readonly legs: readonly BoundaryLeg[];
57
- readonly env?: {
58
- readonly externalContentTarget?: boolean;
59
- };
58
+ readonly env?: Pick<ExecutionEnv, "capabilities">;
60
59
  }
61
- /** What a leg's session is still owed when the leg ends: the legs each unfinished background task its access (the TaskOutput reach) delivers
60
+ /** What a leg's session is still owed when the leg ends: the legs each unfinished background task its access (the registry task access) delivers
62
61
  * along, read as the poll the session's next leg — another tree — would make of it (`TaskRegistry.owedDeliveries`). */
63
62
  export type OwedDeliveries = () => readonly BoundaryLegsGiven[];
64
63
  declare const CROSS_BOUNDARY_TREE_TOKEN: unique symbol;
@@ -1,4 +1,4 @@
1
- import type { AssertAllKeysHandled } from "./ask-origin.js";
1
+ import { type AssertAllKeysHandled } from "./ask-origin.js";
2
2
  import type { DecisionMember, PermissionResult } from "./tool-policy.js";
3
3
  export declare const refusedOutOfContract: (message: string) => PermissionResult;
4
4
  /** Is `d` a refusal the engine itself minted (by object identity — a look-alike `deny` a caller built is not one)? The receipt's
@@ -47,6 +47,7 @@ export declare const DECISION_MEMBER_ARMS: Readonly<{
47
47
  readonly origin: readonly ["ask"];
48
48
  readonly askClass: readonly ["ask"];
49
49
  readonly classes: readonly ["ask"];
50
+ readonly askReasons: readonly ["ask"];
50
51
  readonly ruleUnreadable: readonly ["ask"];
51
52
  readonly authoredBy: readonly ["ask"];
52
53
  readonly editRewritten: readonly ["ask"];
@@ -54,6 +55,17 @@ export declare const DECISION_MEMBER_ARMS: Readonly<{
54
55
  export type DecisionMemberArmsCoverTheUnion = AssertAllKeysHandled<{
55
56
  [M in DecisionMember]: Exclude<ArmOf<M>, (typeof DECISION_MEMBER_ARMS)[M][number]>;
56
57
  }[DecisionMember]>;
58
+ /**
59
+ * The members a PreToolUse hook's answer carries beyond the decision's, with their arms — the hook seat's half of the member ×
60
+ * arm table, read by the same screen: `additionalContext` (the text appended for the model, any arm) and `questionCause` (WHY
61
+ * the hook asked, {@link import("./ask-origin.js").HookQuestionCause} — the ask arm only). The hook seat's member list is the
62
+ * decision's plus these.
63
+ */
64
+ export declare const HOOK_SEAT_MEMBER_ARMS: Readonly<{
65
+ readonly additionalContext: readonly ["allow", "ask", "deny"];
66
+ readonly questionCause: readonly ["ask"];
67
+ }>;
68
+ export type HookSeatMember = keyof typeof HOOK_SEAT_MEMBER_ARMS;
57
69
  /**
58
70
  * WHO writes each member of the decision union — one writer per fact, one table (fenced to the union like
59
71
  * {@link DECISION_MEMBER_ARMS}: a member the union gains without a row is a type error):
@@ -85,6 +97,7 @@ export declare const DECISION_MEMBER_WRITERS: Readonly<{
85
97
  readonly origin: "stamp";
86
98
  readonly askClass: "stamp";
87
99
  readonly classes: "stamp";
100
+ readonly askReasons: "stamp";
88
101
  readonly ruleUnreadable: "composer";
89
102
  readonly authoredBy: "composer";
90
103
  readonly editRewritten: "composer";
@@ -1,4 +1,5 @@
1
1
  import { types } from "node:util";
2
+ import { HOOK_QUESTION_CAUSES, isHookQuestionCause } from "./ask-origin.js";
2
3
  import { AUTO_MODE_FALLBACK_CAUSES, isAutoModeFallbackCause, isDenialLimitBound } from "./auto-mode.js";
3
4
  import { thrownText } from "./thrown-value.js";
4
5
  const ENGINE_REFUSALS = new WeakSet();
@@ -26,6 +27,7 @@ const CLOSED_MEMBERS = [
26
27
  { member: "probeMandated", words: [true], has: (v) => v === true },
27
28
  { member: "crossBoundaryMandated", words: [true], has: (v) => v === true },
28
29
  { member: "mandated", words: [true], has: (v) => v === true },
30
+ { member: "questionCause", words: HOOK_QUESTION_CAUSES, has: isHookQuestionCause },
29
31
  ];
30
32
  const EVERY_ARM = ["allow", "ask", "deny"];
31
33
  const ASK = ["ask"];
@@ -33,15 +35,16 @@ export const DECISION_MEMBER_ARMS = Object.freeze({
33
35
  action: EVERY_ARM, updatedInput: EVERY_ARM, message: EVERY_ARM, decisionReason: EVERY_ARM, attestation: EVERY_ARM,
34
36
  requiresRealApproval: ASK, denialLimitFallback: ASK, classifierNoRuling: ASK, allowRuleShadowed: ASK, probeReason: ASK, probeCause: ASK,
35
37
  probeMandated: ASK, crossBoundaryMandated: ASK, mandated: ASK, mandate: ASK, probeReadRootCandidate: ASK, matchedAskRule: ASK, ruleEvidence: ASK,
36
- segmentCoverage: ASK, origin: ASK, askClass: ASK, classes: ASK, ruleUnreadable: ASK, authoredBy: ASK,
38
+ segmentCoverage: ASK, origin: ASK, askClass: ASK, classes: ASK, askReasons: ASK, ruleUnreadable: ASK, authoredBy: ASK,
37
39
  editRewritten: ASK,
38
40
  });
41
+ export const HOOK_SEAT_MEMBER_ARMS = Object.freeze({ additionalContext: EVERY_ARM, questionCause: ASK });
39
42
  export const DECISION_MEMBER_WRITERS = Object.freeze({
40
43
  action: "composer", updatedInput: "composer", message: "composer", decisionReason: "composer", attestation: "record",
41
44
  requiresRealApproval: "composer", denialLimitFallback: "composer", classifierNoRuling: "composer", allowRuleShadowed: "stamp", probeReason: "composer",
42
45
  probeCause: "composer", probeMandated: "composer", crossBoundaryMandated: "composer", mandated: "composer", mandate: "stamp",
43
46
  probeReadRootCandidate: "composer", matchedAskRule: "composer", ruleEvidence: "stamp", segmentCoverage: "stamp", origin: "stamp", askClass: "stamp",
44
- classes: "stamp", ruleUnreadable: "composer", authoredBy: "composer", editRewritten: "composer",
47
+ classes: "stamp", askReasons: "stamp", ruleUnreadable: "composer", authoredBy: "composer", editRewritten: "composer",
45
48
  });
46
49
  const STAMP_MEMBERS = Object.keys(DECISION_MEMBER_WRITERS).filter((m) => DECISION_MEMBER_WRITERS[m] === "stamp");
47
50
  const RETIRED_WINDOW_MEMBER = "autoDenyAfterMs";
@@ -101,7 +104,7 @@ export function screenContractValues(contract, opts) {
101
104
  return unrecognized(member, v, words);
102
105
  }
103
106
  const arm = contract.action;
104
- for (const [member, arms] of Object.entries(DECISION_MEMBER_ARMS)) {
107
+ for (const [member, arms] of Object.entries({ ...DECISION_MEMBER_ARMS, ...HOOK_SEAT_MEMBER_ARMS })) {
105
108
  if (contract[member] === undefined || (arm === undefined ? EVERY_ARM.every((a) => arms.includes(a)) : arms.includes(arm)))
106
109
  continue;
107
110
  return refusedOutOfContract(`a permission decision carries "${member}" on ${arm === undefined ? "a result with no action (no opinion)" : `its "${arm}" arm`} — the member belongs to ` +
@@ -11,8 +11,10 @@ import type { TaskEvent } from "./task-event.js";
11
11
  /**
12
12
  * design/129-B — one lifecycle event of a BACKGROUND delegation child, delivered to the
13
13
  * process-level {@link RunnerDeps.onBackgroundChildEvent} observer. Keys: `taskId` is the registry handle
14
- * (`a*` domain — the TaskOutput/TaskStop key); `progressTaskId`/`sessionId` are the child RUN's id (uuid
15
- * domain — the same key `task_progress` frames carry).
14
+ * (`a*` domain — the TaskStop / host-poll key), which is also the child run's own task id, so the child's
15
+ * own `task_progress` frames carry it; `sessionId` is the child run's session (uuid domain);
16
+ * `progressTaskId` is the task id of the leg whose frame a tick forwards (the child's own, or a nested
17
+ * descendant's).
16
18
  *
17
19
  * `kind: "spawn"` announces a fleet ROW's birth, which is a different fact from a child RUN's start
18
20
  * (`TaskEvent` `task_started`): an `a*` row is born when its lane registers it, before the child run
@@ -24,9 +26,9 @@ export interface BackgroundChildEvent {
24
26
  kind: "spawn" | "tick" | "terminal";
25
27
  /** Row key, stable across all three kinds. The prefix is the DOMAIN DISCRIMINATOR (load-bearing,
26
28
  * not opaque — design/149): `a*` = registry handle (background subagent —
27
- * TaskOutput/TaskStop addressable, fleet-footer display lane); `wa*` = synthetic workflow-agent
28
- * row (NOT a registry row — per-agent read face is the workflow's `TaskOutput(w*)` agent_runs
29
- * projection + journal API). Display contract (CC anchor): CC's footer renders ONLY the
29
+ * TaskStop addressable, fleet-footer display lane); `wa*` = synthetic workflow-agent
30
+ * row (NOT a registry row — per-agent read face is the workflow run's agent rows in its completion
31
+ * record + journal API). Display contract (CC anchor): CC's footer renders ONLY the
30
32
  * workflow AGGREGATE row — `wa*` rows are read-face/observability rows and SHOULD NOT be
31
33
  * rendered in the footer fleet tree; shells filter on the prefix. */
32
34
  taskId: string;
@@ -79,9 +81,10 @@ export interface BackgroundChildEvent {
79
81
  * authority; this field is the row-level convenience beside it.
80
82
  */
81
83
  model?: string;
82
- /** spawn: the HOST task's DECLARED task id (parent attribution). Omitted when the host
83
- * run declared no task id (the `spec.taskId ?? sessionId` fallback would launder a session id into
84
- * a task-id field — the orphan-pointer shape); {@link parentSessionId} is the always-on linkage. */
84
+ /** spawn: the HOST leg's task id (parent attribution) — a host declared id, or the parent row's id
85
+ * when the host is itself a background sub-agent. Omitted when the host's task id is just its
86
+ * session id (a host that declared none, or a foreground child): writing it would launder a session
87
+ * id into a task-id field — the orphan-pointer shape; {@link parentSessionId} is the always-on linkage. */
85
88
  parentTaskId?: string;
86
89
  /** spawn: the HOST run's session id (uuid domain) — the always-on parent
87
90
  * linkage, present whether or not a task id was declared. */
@@ -113,7 +116,8 @@ export interface BackgroundChildEvent {
113
116
  * field (their own `taskId` is the per-child key). ABSENT, never invented, on a workflow started with no
114
117
  * launching tool call. */
115
118
  parentToolCallId?: string;
116
- /** tick: the forwarded `task_progress` frame's own taskId (uuid domain; nested children carry theirs). */
119
+ /** tick: the forwarded `task_progress` frame's own taskId (the child's row id on its own ticks; a nested
120
+ * descendant's frame carries that descendant's task id). */
117
121
  progressTaskId?: string;
118
122
  /** tick: the forwarded frame's parentTaskId (nested attribution) · terminal: absent. */
119
123
  progressParentTaskId?: string;
@@ -1,6 +1,6 @@
1
1
  import { anchorSpelling, canonicalizeTarget, familyFor, hasWin32AliasedComponent, isAbsoluteForFamily, normalizeAbsPathLexically, pathFamilyOf, pathIdentityOf, spellingOfIdentity, win32NamespaceScreen } from "../tools/fs/safety.js";
2
2
  import { declaredPathTargetOf, pathTargetValue, protectivePathTargetOf } from "./tool-registry.js";
3
- import { symlinkChainHops } from "./path-identity.js";
3
+ import { leafChainMayHold, symlinkChainHops } from "./path-identity.js";
4
4
  import { DEFAULT_GATE_AWAIT_TIMEOUT_MS, withGateTimeout } from "./gate-bounded-await.js";
5
5
  import { thrownText } from "./thrown-value.js";
6
6
  import { canonicalize } from "./canonical-json.js";
@@ -106,8 +106,7 @@ export async function readPath(env, spelled, base, bases, contract, signal) {
106
106
  if (contract.views === "lexical" || env === undefined || family === undefined || lexical?.kind === "unreadable")
107
107
  return { lexical, hops: [] };
108
108
  const canonical = await canonicalizeTarget(env, spelled, signal, family, base);
109
- const climbs = (s) => s !== undefined && (family === "win" ? /(^|[\\/])\.\.([\\/]|$)/ : /(^|\/)\.\.(\/|$)/).test(s);
110
- const followsALink = canonical.ok && (climbs(spelled) || climbs(base) || lexical?.kind !== "path" || absoluteTargetIdentityOf(canonical.key, bases) !== lexical.identity);
109
+ const followsALink = canonical.ok && leafChainMayHold([spelled, base], lexical?.kind !== "path" || absoluteTargetIdentityOf(canonical.key, bases) !== lexical.identity, family);
111
110
  const chain = contract.views === "chain" && followsALink
112
111
  ? await withGateTimeout(symlinkChainHops(env, spelled, signal, family, base), DEFAULT_GATE_AWAIT_TIMEOUT_MS, signal, "canonicalChain").catch((err) => ({ ok: false, cause: thrownText(err), asked: true }))
113
112
  : { ok: true, hops: [] };
@@ -15,7 +15,7 @@
15
15
  * A leaf (type-only imports): the decision module that receives a record and the class derivation that reads one for its call
16
16
  * both depend on it, and neither depends on the other through it.
17
17
  */
18
- import type { AskClass, AskOrigin } from "./ask-origin.js";
18
+ import type { AskClass, AskOrigin, AskReason } from "./ask-origin.js";
19
19
  import type { ClassifierDenyCause, Settlement } from "./gate-outcome.js";
20
20
  import type { AutoModeClassifierRound } from "./auto-mode.js";
21
21
  import type { AskUnresolvableCause } from "./ask-unresolvable-notice.js";
@@ -56,6 +56,16 @@ export interface EngineAttestation {
56
56
  /** A seat refused the call's arguments because no approval can be bound to them: the refusal's sentence, carried by the
57
57
  * refusal itself — the gate's deny exit reads it (the remedy it gives) instead of judging again. */
58
58
  readonly bindingRefusal?: string;
59
+ /** The engine's own generic question the ask was composed with (the write gate's default "approve write to" sentence, the
60
+ * permission mode's own question) — not anyone's reason. The chain's entry mint ({@link
61
+ * import("./ask-origin.js").chainAskReasonsOf}) writes no entry while the ask's `message` IS this sentence; a later layer
62
+ * that spread the ask and put its own words in `message` keeps them. Written only by the station that composed that
63
+ * sentence, for that sentence; a composer cannot state it (an unbranded record is refused). */
64
+ readonly genericQuestion?: string;
65
+ /** The askers a station read off this ask where it first received it, before it narrated the sentence (an inherited station
66
+ * floating an ancestor's ask back into this leg's fold: its mark frames, its denial-limit fallback's sentence). The chain's
67
+ * entry mint takes these instead of the sentence; empty = the station read no asker. Written only by that float. */
68
+ readonly receivedAskReasons?: readonly AskReason[];
59
69
  }
60
70
  /** The members a station attests — everything but the call binding. */
61
71
  export type AttestationMembers = Omit<EngineAttestation, "toolCallId" | "toolName">;
@@ -10,6 +10,8 @@ const ATTESTATION_GROUP_OF = {
10
10
  guards: "guards",
11
11
  pathDenial: "pathDenial",
12
12
  bindingRefusal: "bindingRefusal",
13
+ genericQuestion: "genericQuestion",
14
+ receivedAskReasons: "receivedAskReasons",
13
15
  };
14
16
  const ATTESTATION_MEMBERS = Object.keys(ATTESTATION_GROUP_OF);
15
17
  const groupLead = (g) => ATTESTATION_MEMBERS.find((k) => ATTESTATION_GROUP_OF[k] === g);
@@ -97,11 +97,26 @@ export interface EngineNotice {
97
97
  * losses of one ref apart. Dedup key: (code, occurrenceId).
98
98
  * - `"tool_result.media_refused"` — an executed call's result carried media blocks (an image or a document, from
99
99
  * an MCP server, a host tool, an engine tool or a `tool_result` hook's replacement) whose bytes the tool-result
100
- * seat's admission refused: not a base64 payload, a media type outside the closed set, over the cap, or bytes
101
- * without the claimed type's signature. Each such block already stands in the result as a text placeholder naming
100
+ * seat's admission refused: not a base64 payload, a media type outside the closed set, over the cap, bytes
101
+ * without the claimed type's signature, or bytes no processor could bring within the reject edge (or whose header
102
+ * states no size). Each such block already stands in the result as a text placeholder naming
102
103
  * the tool and the refusal (never the bytes), so the model, `tool_end.output` and the transcript read that; this is
103
104
  * the operator's account. ONCE PER CALL. `detail: { toolName, toolCallId, refused: [{ type, reason, bytes, limit?,
104
- * mimeType? }], sessionId, runId }` — closed-set words, counts and a media type only when it can be one.
105
+ * width?, height?, mimeType? }], sessionId, runId }` — closed-set words, counts and a media type only when it can be one.
106
+ * - `"config.image_processor_unavailable"` — an image went to the model as it was, over the image admission's soft
107
+ * target (`IMAGE_ADMISSION.soft.targetBytes`), because the run has no image processor (`RunnerDeps.imageProcessor`
108
+ * is `false`, or sharp did not resolve). ONCE PER RUN, at the first such image wherever it entered (a tool's result,
109
+ * the task's images, an attachment). `detail: { bytes, targetBytes, sessionId, runId }`.
110
+ * - `"fs.staging_file_left"` — a whole-file replace (`NodeExecutionEnv.writeFile`) whose write itself SUCCEEDED could not
111
+ * remove the staged sibling it had written (the in-place rewrite after a refused rename, or after a refused staging open):
112
+ * the file is still on disk, up to the whole content. Audience `operator`. `detail: { path }`, the staged path. Seat-only:
113
+ * an environment with no `onNotice` seat says nothing (a failed write carries the same sentence in its error instead).
114
+ * ONCE PER LEFT FILE.
115
+ * - `"fs.staging_file_swept"` — a whole-file replace (`NodeExecutionEnv.writeFile`) removed the staged siblings of its target
116
+ * that a process which no longer runs had left behind (a process killed mid-write runs no cleanup): exactly the names the
117
+ * replace itself would mint for this target, under a pid that is gone, plain files with one name. A running writer's staged
118
+ * file is never touched. Audience `operator`. `detail: { count }` — how many, no names. Seat-only (an environment with no
119
+ * `onNotice` seat says nothing). ONCE PER WRITE THAT REMOVED ANY.
105
120
  * - `"workflow.governance_key_stripped"` (#235) — the fields of an LLM-authored workflow `agent(spec)`
106
121
  * that did NOT cross the governed default-deny whitelist: an unrecognized/control-plane field, or a
107
122
  * `readFace` value that is not the containment-tightening one. The spawn PROCEEDS on the deployment
@@ -178,6 +193,17 @@ export interface EngineNotice {
178
193
  * authorize; `sessionId` REQUIRED at the mint. Dedup unit: once per (leg, server) — a resume is a new
179
194
  * leg and may announce again. A deployment that waits for the authorization keys on this notice; the
180
195
  * leg itself does not park on it.
196
+ * - `"mcp.credential_echoed"` — a protocol peer (an MCP server, an A2A peer) echoed a credential its
197
+ * connection's requests carried into what it said about itself: an MCP server's `serverInfo`, its
198
+ * instructions or its tool listing, an A2A peer's agent card. The engine reads that account through
199
+ * one eraser whose needle is the connection's credentials (`PeerCarrier.credentials`): free text
200
+ * holding one is erased in place (the redaction mark), a NAME holding one is refused, never
201
+ * rewritten (a tool or skill is not mounted, the server's info or the card's name is not
202
+ * projected). `detail: { protocol, server, where, sessionId, runId }` — `protocol` is `mcp` / `a2a`,
203
+ * `server` the declared entry's name, `where` the closed set `CREDENTIAL_ECHO_SITES`
204
+ * (`server_info` / `instructions` / `tool_listing` / `agent_card`); never a value. `"operator"`
205
+ * audience: the endpoint repeats what it is sent, which only whoever wired it can act on. Dedup unit:
206
+ * once per (materialization, server, site) for MCP and per (materialization, peer) for A2A.
181
207
  * - `"mcp.injection_dropped"` (L-167) — an entry of the user's own request-lane MCP injection
182
208
  * was NOT mounted for the leg. The HOST owns the drop sites and supplies the facts; CORE composes
183
209
  * the notice ({@link import("./mcp-injection-drop.js").mcpInjectionDroppedNotice}, the one mint).
@@ -188,12 +214,16 @@ export interface EngineNotice {
188
214
  * routes nowhere — refused, never fabricated). Dedup unit: per leg per server name, the host's.
189
215
  * - `"config.models_swapped"` — `Runner.swapDeps` replaced the model catalog generation
190
216
  * (zero-restart model switching; the `models` / `tiers` seats of the swappable set). `detail:
191
- * { models, tiers, occurrenceId }` — key COUNTS only, never the catalog itself. In-flight tasks
217
+ * { models, tiers, generation, occurrenceId }` — key COUNTS and the `generation` the swap leaves in force (a digest of
218
+ * its key material: the model names the candidate declares and the tier bindings in force over them,
219
+ * `catalogGenerationOf`), never the catalog itself. Every Runner a driver swaps to the SAME model names under the
220
+ * SAME tier bindings announces the SAME `generation` (and its own `occurrenceId`), so a consumer folds one swap
221
+ * announced by N Runners by (code, generation); equal key material is one generation. In-flight tasks
192
222
  * finish on the models they resolved at prepare (natural snapshot); every later prepare resolves
193
223
  * against the new generation. A failed swap (illegal tier binding, a refused candidate) throws
194
224
  * atomically and mints nothing. The verb carries no run and no session and the payload is a pair
195
- * of counts, so the uuidv7 `occurrenceId` minted at the announcement is what tells two swaps of the
196
- * same shape apart. Dedup key: (code, occurrenceId).
225
+ * of counts, so the uuidv7 `occurrenceId` minted at the announcement is what tells two deliveries of the
226
+ * same shape apart. Dedup key of one delivery: (code, occurrenceId); of one swap announced by several Runners: (code, generation).
197
227
  * - `"config.read_face_swapped"` — `Runner.swapDeps` replaced the deployment's read-face
198
228
  * declaration (`RunnerDeps.readFace`, the `readFace` seat of the swappable set) without a
199
229
  * restart. `detail: { from, to, occurrenceId }` — the seat's previous and new value, each
@@ -207,10 +237,10 @@ export interface EngineNotice {
207
237
  * same payload, same laws. A SEPARATE code rather than a face field on the line above: the audience
208
238
  * table and every consumer table are keyed by code.
209
239
  * - `"config.read_deny_swapped"` — `Runner.swapDeps` replaced the deployment's read-deny declaration
210
- * (any of `readDenyPatterns` / `readDenyBuiltinTiers` / `readDenyBuiltinExclude`) without a restart;
211
- * ONE line per swap. `detail: { seats, patterns, tiers, exclude, occurrenceId }` — the seats the swap
212
- * named, then the declaration in force after it (additions and removals as counts, the tier selection
213
- * by name; `null` = no declaration). In-flight legs keep the deny face they prepared under; every later
240
+ * (any of `readDenyPatterns` / `readDenyBuiltinTiers` / `readDenyBuiltinExclude` / `readDenyFloorRequired`) without a
241
+ * restart; ONE line per swap. `detail: { seats, patterns, tiers, exclude, floorRequired, occurrenceId }` — the seats the
242
+ * swap named, then the declaration in force after it (additions and removals as counts, the tier selection
243
+ * by name, the floor requirement as its boolean; `null` = no declaration). In-flight legs keep the deny face they prepared under; every later
214
244
  * prepare compiles against the new declaration. A candidate outside the seats' gates throws atomically
215
245
  * and mints nothing. Dedup key: (code, occurrenceId).
216
246
  * - `"config.context_settings_swapped"` — `Runner.swapDeps` replaced the deployment's per-model
@@ -259,6 +289,17 @@ export interface EngineNotice {
259
289
  * `detail: { from, to, cause, sessionId?, runId? }` — `cause` is the `AutoModeFallbackCause` word, the
260
290
  * two ids are the rungs. Dedup key: (code, from, cause) PER RUN; a second CAUSE on the same rung is
261
291
  * its own line.
292
+ * - `"classifier.seat_rate_limited"` (same file, the per-decision observer; the decider's retirement,
293
+ * `src/core/auto-mode.ts`) — the classifier seat's dispatch ended on the provider's rate limit (an HTTP 429 that
294
+ * outlived the brain's backoff ladder) on `RunnerDeps.autoMode.rateLimitBreakAfter` CONSECUTIVE classifications, so
295
+ * for the rest of this run the seat is NOT ASKED again: every gated call is judged on the model behind it, without
296
+ * first waiting out the seat's backoff. Different fact from `classifier.fallback` (a call re-asked behind the
297
+ * seat; its throttle is the rung's cause) — this is the seat leaving the walk. `detail: { model, to, rung,
298
+ * consecutive, sessionId?, runId? }` — `model` the retired rung's id, `to` the model the walk now starts at,
299
+ * `rung` its ladder position, `consecutive` the count that tripped it (the configured bound). Once per retired
300
+ * rung per run (the retirement is the dedup); only a rung with a rung behind it can retire, so a one-rung ladder
301
+ * (`classifierFallback: "none"`) never mints it. Audience `user`: the rest of the user's run is judged by another
302
+ * model, the same consequence `classifier.unavailable` tells the user.
262
303
  * - `"classifier.role_defaulted"` (`src/core/runner/classifier-ladder.ts`, the seat resolver) — no
263
304
  * `classifier` role names a model, so another model STANDS IN for the seat. `detail: { model, reason,
264
305
  * thinkingOffSpelled, sessionId?, runId? }` — `reason` ∈ `tier_below_main` (the nearest directly-bound
@@ -375,13 +416,26 @@ export interface EngineNotice {
375
416
  * the run proceeds on the repaired request. Audience `operator`; `detail: { repairs: [{ form, toolCallIds }],
376
417
  * sessionId, runId }`. ONCE PER RUN PER (form, calls) — the same broken turn is repaired on every request of
377
418
  * the run and announced on the first. Absent ⇒ every request of the run already had the structure.
378
- * - `"context.image_removed"` (#2874) — the provider refused a request because an image in it could not be processed
379
- * (the failed turn's `errorKind: "image_unprocessable"`), so the request view removed the images of the newest
380
- * message still carrying any, each replaced by `[image N removed: rejected by provider: image_unprocessable]`
381
- * (`engine/llm/rejected-images.ts`); the turn was re-sent without them and every later request of the session
382
- * reads the same removal. The transcript keeps the images. Audience `user`; `detail: { images, sessionId, runId }`
383
- * — `images` how many were removed from that message. ONCE PER RUN PER REFUSAL; a refusal recorded before the run
384
- * began is not announced again.
419
+ * - `"context.media_removed"` (#2874, #2988) — media left the model's view of a request while the transcript keeps it;
420
+ * each block's slot holds `[<image|document> N removed: <why>]` (`engine/llm/media-removed.ts`, N its ordinal among
421
+ * its message's blocks of that type). Audience `user`; `detail: { reason, images, documents, sessionId, runId }`,
422
+ * `reason` closed (`MEDIA_REMOVED_REASONS`):
423
+ * · `rejected_by_provider` — the provider refused a request because an image in it could not be processed (the
424
+ * failed turn's `errorKind: "image_unprocessable"`), so the request view removed the images of the newest message
425
+ * still carrying any (`engine/llm/rejected-images.ts`); the turn was re-sent without them and every later request
426
+ * of the session reads the same removal. `images` how many were removed from that message, `documents` 0. ONCE PER
427
+ * RUN PER REFUSAL; a refusal recorded before the run began is not announced again.
428
+ * · `media_budget` — the request's media no longer fit its limits (`IMAGE_ADMISSION.request`: the media-block count,
429
+ * the deployment's base64 budget `RunnerDeps.mediaBudgetBase64Chars`), so the oldest blocks were left out
430
+ * (`media-byte-cap.ts`). `images` / `documents` count the blocks this notice is the first to tell of: ONCE PER
431
+ * SESSION PER BLOCK, by the digest of its bytes (the session's announced record — bounded and best effort, so a
432
+ * block may be told again by a later run, never left untold); a request that was not sent tells of none.
433
+ * - `"context.tool_schema_removed"` (#2681) — the provider refused a request because of one tool's input schema and
434
+ * located the tool (the failed turn's `errorKind: "tool_schema_refused"`, `refusedTool`), so the turn was re-sent with
435
+ * that tool's parameters replaced by an empty object schema, and every later request built from a transcript the
436
+ * refusal's record stands in sends it so (`engine/llm/rejected-images.ts`; MCP and A2A tools only, at most 8 per such
437
+ * transcript; a compaction that summarizes the record away returns the schema until the provider refuses it again).
438
+ * The model can still call the tool. Audience `user`; `detail: { tool, sessionId, runId }`. ONCE PER REFUSAL.
385
439
  * - `"task.tool_turn_incomplete"` (#1230) — the person's line for a tool turn the model was handed incomplete, beside
386
440
  * the note the model itself reads. `detail.cause` (closed `TOOL_TURN_INCOMPLETE_CAUSES`): `truncated` — calls whose
387
441
  * arguments were cut before they parsed, dropped (they did not run); `unnamed` — calls that arrived with no tool
@@ -436,23 +490,37 @@ export interface EngineNotice {
436
490
  * threw: the `Artifact` tool is not mounted for the task and this is the loud half (an absent seat
437
491
  * is silent; a broken one must not look the same). Once per prepared leg;
438
492
  * `detail: { problem, sessionId, runId }`.
439
- * - `"config.execution_env_capability_invalid"` — a remote env DECLARES a boolean capability key
440
- * (`isolation`, `suspendable`, `canonicalPathAuthoritative`, `sharesProcessTable`) with a non-boolean value; ABSENCE is a
441
- * supported reading of the first three and stays silent, and is announced for `sharesProcessTable`, which has no
442
- * absent reading (`valueType: "undefined"`). Once per key per run; `detail: { key, valueType }`. Also minted for
493
+ * - `"config.execution_env_capability_invalid"` — an env (any env, local or remote) does not declare a key of its
494
+ * REQUIRED capability block (`ExecutionEnvCapabilities`: `isolation`, `suspendable`, `sharesProcessTable`,
495
+ * `canonicalPathAuthoritative`, `hostLocalPaths`, `externalContentTarget`, `io`, `keepsReadFloor`) as a boolean — absent
496
+ * (`valueType: "undefined"`), another type, or unreadable — and each reader takes that key's safe side, which the
497
+ * sentence names; or the block itself is not an object or cannot be read (`key: "capabilities"`), or an optional
498
+ * seam method is present but not a function (`key` = the method). Once per key per run, at admission;
499
+ * `detail: { key, valueType }`. Also minted for
443
500
  * `withheldEnv` (key `"withheldEnv"`) when it is neither a list of findings nor `"unknown"`, read at a shell call of
444
501
  * a root leg (once per run).
502
+ * - `"config.read_deny_floor_unkept"` (#2936) — the run's read-deny table holds rows and its execution environment does
503
+ * not declare it keeps the byte floor (`capabilities.keepsReadFloor`): the engine refuses what a command names, but a
504
+ * recursive read under a root reads the files below it there, deny rows included. The notice dialect of the refusal
505
+ * `RunnerDeps.readDenyFloorRequired` turns it into (the prepare then fails with the same code); never minted for an
506
+ * empty table or an environment that keeps the floor (the Stub of a run without hands keeps it by refusing every
507
+ * start). Once per run — each delegated child on its own environment — and once per construction of a library-direct
508
+ * band that compiles its own table; `detail: { rowCount, sessionId?, runId? }` (the two ids on a run's notice).
509
+ * - `"config.read_floor_confinement_unavailable"` — a Node environment was asked to confine its starts to the floor
510
+ * (`readFloorConfinement: "os"`) and this host cannot (not macOS, or the seatbelt base does not apply here): the
511
+ * environment declares it does not keep the floor, and the run's own judgment (`config.read_deny_floor_unkept`)
512
+ * follows. Once per construction, at construction; `detail: { reason }`.
445
513
  * - `"config.secret_env_scrubbed"` (#1081) — the D1 fail-closed `scrub` policy, or the deployment's
446
514
  * own credentials (`declareWithheldEnv`: a declared name, or a value equal to a declared or engine-held
447
515
  * credential value), withheld one or more keys from a spawned child's environment (a tool's shell, an
448
516
  * oracle gate, or a language server).
449
517
  * Once per PROCESS, shared by every scrub site ({@link import("./secret-env.js").announceSecretEnvScrub});
450
518
  * `detail: { names, ownCredentials? }` — every withheld key's name, never a value; `ownCredentials`, present
451
- * only when one was withheld, the subset that is the deployment's own credential, by name or by value, whichever
519
+ * only when one was withheld, the subset that is the engine's own credentials, by name or by value, whichever
452
520
  * rule withheld it (withheld under any policy, `"all"` included).
453
521
  * - `"inherit_env.names_withheld"` (#1963) — the same fact for the person whose run drives a tool shell: the variables
454
522
  * of the engine's environment that shell does not receive (`ExecutionEnv.withheldEnv`), the scrub's half (the run's
455
- * `inheritEnv` hands them on) and the deployment's own credentials (no policy does). Audience `user`. Read as each
523
+ * `inheritEnv` hands them on) and the engine's own credentials (no policy does). Audience `user`. Read as each
456
524
  * call to the engine's own shell tool starts on a root leg (the answer can grow during a run: a credential the engine
457
525
  * takes in when it first routes a model is withheld from the next child); once per SESSION per name set (the
458
526
  * session's announced record). `detail: { state, names?, ownCredentials?, sessionId, runId? }` — `state` `"withheld"`
@@ -599,13 +667,13 @@ export interface EngineNotice {
599
667
  * them apart reads that key; one that only cares "a turn was cut" reads neither):
600
668
  * · the STEER-NOW lane (design/373) — a caller-provenance steer with `priority: "now"` cut
601
669
  * the turn and the run CONTINUES with the steer at the queue head.
602
- * `detail: { inputId, sessionId, runId, actorId?, taskId? }`, NO `cause` key — `inputId` is
670
+ * `detail: { inputId, sessionId, runId, actorId?, taskId }`, NO `cause` key — `inputId` is
603
671
  * the steer's own correlation key (the `human_input` frame's id) and `actorId` the caller's
604
672
  * asserted identity when one rode the steer.
605
673
  * · the BARE-HALT lane (#504, {@link TaskStream.halt}) — the person's Esc-form stop cut the
606
674
  * turn and the run does NOT continue: it collects to a clean, resumable
607
675
  * `status:"completed"` ending carrying {@link TaskResult.haltedByUser}.
608
- * `detail: { cause: "user_halt", sessionId, runId, taskId? }` — no `inputId` and no
676
+ * `detail: { cause: "user_halt", sessionId, runId, taskId }` — no `inputId` and no
609
677
  * `actorId`, because no text entered the model and the verb carries no caller identity. A
610
678
  * consumer keying `detail.inputId` off this row must treat it as ABSENT on this lane.
611
679
  * Fence tension: this notice asserts THE CUT only — when the cut
@@ -637,7 +705,7 @@ export interface EngineNotice {
637
705
  * for it (a brain minting its own `aborted` final beside a late halt, a natural completion the halt
638
706
  * arrived too late to prevent, an approval park whose commit won the race and whose abort owned the
639
707
  * ending); once per such run, at the result's settlement. Either way the notice is the halt's trace
640
- * beside the verb receipt. `detail: { sessionId, runId, taskId? }` — `runId` is the run whose ending
708
+ * beside the verb receipt. `detail: { sessionId, runId, taskId }` — `runId` is the run whose ending
641
709
  * the halt failed to claim. Audience `"user"`. A REFUSED halt (typed `steering.not_running` throw)
642
710
  * mints nothing: the refusal itself is the loud answer.
643
711
  *
@@ -651,7 +719,7 @@ export interface EngineNotice {
651
719
  * Minted only for a value that reads as an APPROVAL — an unconsumed
652
720
  * deny/refusal is an ordinary release and leaves no trace, and an unconsumed REJECTION goes to
653
721
  * `onError(phase:"hook")` instead (a failing callback, not an answer). One notice per
654
- * unconsumed approval; `detail: { toolName, toolCallId, sessionId, runId, taskId? }`. Audience `"user"`
722
+ * unconsumed approval; `detail: { toolName, toolCallId, sessionId, runId, taskId }`. Audience `"user"`
655
723
  * (whoever answered the card is the one entitled to hear the answer ran nothing); a host may
656
724
  * forward it on its own wire.
657
725
  *
@@ -666,7 +734,7 @@ export interface EngineNotice {
666
734
  * the stop's only trace. Minted once per such run, after the terminal arbitration (so it never
667
735
  * claims a completed ending the terminal did not give — a budget ceiling crossed by the last
668
736
  * turn's own spend still fails the run and mints nothing here); `detail: { sessionId, runId,
669
- * taskId?, origin }` with `origin` ∈ `"interrupt"` (the verb) | `"walltime"` | `"turns"` |
737
+ * taskId, origin }` with `origin` ∈ `"interrupt"` (the verb) | `"walltime"` | `"turns"` |
670
738
  * `"signal"` (every other run-level abort: the task's own `signal`, a parent's cancel, a
671
739
  * `destroy()`, a refused preempt — the leg names the three it can tell apart and files the rest
672
740
  * here). Audience `"user"`. A stop that arrives AFTER the loop's end but before `done` aborted no
@@ -678,7 +746,7 @@ export interface EngineNotice {
678
746
  * - `"approval.read_root_granted"` / `"approval.read_root_grant_rejected"` — an approver's `readRootGrant`
679
747
  * (`AskOutcome`). GRANTED: it equalled the card's `readRootCandidate.dir` beside `allow: true`; this run's READ
680
748
  * directories now include it (never the write roots; this run only); `detail: { dir, covers?, root, toolName,
681
- * toolCallId, sessionId, runId, taskId? }`, `root` = the canonical spelling held. REJECTED: nothing changed,
749
+ * toolCallId, sessionId, runId, taskId }`, `root` = the canonical spelling held. REJECTED: nothing changed,
682
750
  * the verdict stands; `detail: { reason, offered?, requested?, …same ids }`, `reason` ∈ `on_refusal` |
683
751
  * `not_a_string` | `no_candidate` | `mismatch` | `unresolvable` | `resolves_elsewhere` | `admits_artifact_store`
684
752
  * (the directory contains the wired local artifact store, lies inside it or is it) | `no_read_roots`. Once per
@@ -724,7 +792,7 @@ export interface EngineNotice {
724
792
  * same fact is the entry's own `human_input` account with `delivery: "blocked"` — the two share
725
793
  * the inputId, so "accepted at park, screened at redelivery" is auditable end to end. Audience
726
794
  * `"user"` (the person whose instruction was withheld is the one entitled to re-issue it);
727
- * `detail: { inputId?, sessionId, runId, taskId? }` — `inputId` is the parked entry's stored
795
+ * `detail: { inputId?, sessionId, runId, taskId }` — `inputId` is the parked entry's stored
728
796
  * correlation key (OPTIONAL: a row parked without one exists), and `runId` names the resume leg
729
797
  * that withheld it, so a session resumed twice does not report two withholdings as one.
730
798
  *
@@ -948,7 +1016,10 @@ export interface EngineNotice {
948
1016
  *
949
1017
  * - `"delegation.transcript_integrity"` (subagent transcript persistence) — a durable agent row
950
1018
  * with a BOUND transcript sessionId met a session store that attests `not_found` for it: the
951
- * deployment's declared transcript durability is being contradicted by reality. Announced at
1019
+ * deployment's declared transcript durability is being contradicted by reality. Minted only where
1020
+ * durability IS declared — a deployment whose `fleet.subagentTranscripts` tier is `full`; under `rows`
1021
+ * (transcripts follow a process-local store's fate) a gone transcript is the declared fate and nothing
1022
+ * is announced (the per-call refusals still answer), and under `none` no row binds one. Announced at
952
1023
  * most once per (scope, handle, process) — `detail: { handle, scope? }`, scope = the resolved
953
1024
  * access scope of the read that found the gap — from the continuation read faces (SendMessage preflight /
954
1025
  * AgentTranscript's durable leg); the per-call honest refusals are unchanged, and the declared
@@ -1033,7 +1104,10 @@ export interface EngineNotice {
1033
1104
  code: string;
1034
1105
  /** The exact human-readable line the unwired build prints via `console.warn` — same words, one text. */
1035
1106
  message: string;
1036
- /** Machine-readable facts of the notice (knob names, arriving values, values in force). */
1107
+ /** Machine-readable facts of the notice (knob names, arriving values, values in force). On a notice a leg raises about
1108
+ * itself, `detail.taskId` is that leg's own task id — the one value its prepare minted (`Prepared.taskId`: a background
1109
+ * sub-agent's registry task id, else the host's declared `TaskSpec.taskId`, else the leg's session id) — read the same way by
1110
+ * every such code; the per-code shapes below list it where a code carries it. */
1037
1111
  detail?: Record<string, unknown>;
1038
1112
  /** The owning session, when the notice HAS one — an ATTRIBUTION/correlation key, never a
1039
1113
  * projection permission: whether a notice may be surfaced onto that session's user-facing
@@ -51,6 +51,14 @@ export interface FileHistoryRetentionPolicy {
51
51
  */
52
52
  keep?: number | "unbounded";
53
53
  }
54
+ /**
55
+ * The retention door's reading of a policy: received by the receipt law with this door's one knob as the member it takes
56
+ * (a plain object read once off its own descriptors; a misspelled knob refused by name, `config.retention_policy_invalid`),
57
+ * its knob judged as {@link resolveFileHistoryRetention} judges it, and handed back as the frozen copy a store then
58
+ * holds — so a composition that receives the policy ahead of the store it configures hands that store the copy, and the
59
+ * caller's object is read once. Absent ⇒ `undefined` (the engine default applies).
60
+ */
61
+ export declare function receiveFileHistoryRetention(label: string, policy: FileHistoryRetentionPolicy | undefined): Readonly<FileHistoryRetentionPolicy> | undefined;
54
62
  /**
55
63
  * The retention door: resolve a deployment's policy to a boundary cap, or REFUSE loudly.
56
64
  *