@sema-agent/core 7.54.1 → 7.56.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 (621) hide show
  1. package/CHANGELOG.md +950 -0
  2. package/dist/agents/agent-transcript-tool.js +2 -1
  3. package/dist/agents/builtin-agents.d.ts +12 -14
  4. package/dist/agents/cascade.js +1 -1
  5. package/dist/agents/cc-peer-directory.d.ts +36 -0
  6. package/dist/agents/cc-peer-directory.js +139 -0
  7. package/dist/agents/cc-peer-wire.d.ts +105 -0
  8. package/dist/agents/cc-peer-wire.js +98 -0
  9. package/dist/agents/cc-uds-peer-channel.d.ts +40 -0
  10. package/dist/agents/cc-uds-peer-channel.js +457 -0
  11. package/dist/agents/child-model-seat.d.ts +0 -11
  12. package/dist/agents/child-model-seat.js +0 -3
  13. package/dist/agents/cross-session-envelope.d.ts +4 -1
  14. package/dist/agents/cross-session-envelope.js +8 -1
  15. package/dist/agents/cross-session-judge.d.ts +2 -2
  16. package/dist/agents/list-agents-tool.d.ts +3 -1
  17. package/dist/agents/list-agents-tool.js +9 -8
  18. package/dist/agents/observer.d.ts +4 -5
  19. package/dist/agents/observer.js +2 -1
  20. package/dist/agents/peer-admission.d.ts +6 -0
  21. package/dist/agents/peer-admission.js +4 -1
  22. package/dist/agents/peer-directory.d.ts +65 -13
  23. package/dist/agents/peer-directory.js +90 -25
  24. package/dist/agents/peer-notices.d.ts +1 -1
  25. package/dist/agents/peer-session-drain.d.ts +3 -1
  26. package/dist/agents/peer-session-drain.js +3 -2
  27. package/dist/agents/read-inbox-tool.js +2 -1
  28. package/dist/agents/repair-loop.js +2 -2
  29. package/dist/agents/retain-ledger.d.ts +1 -1
  30. package/dist/agents/roster-store.d.ts +1 -1
  31. package/dist/agents/send-message-tool.d.ts +10 -0
  32. package/dist/agents/send-message-tool.js +37 -8
  33. package/dist/agents/subagent.d.ts +39 -82
  34. package/dist/agents/subagent.js +109 -106
  35. package/dist/agents/tool-filter.d.ts +31 -46
  36. package/dist/agents/tool-filter.js +13 -33
  37. package/dist/agents/verify.d.ts +6 -5
  38. package/dist/agents/verify.js +3 -3
  39. package/dist/brain/anthropic.js +43 -81
  40. package/dist/brain/errors.d.ts +15 -0
  41. package/dist/brain/errors.js +10 -0
  42. package/dist/brain/media-degrade.d.ts +18 -7
  43. package/dist/brain/media-degrade.js +13 -2
  44. package/dist/brain/model-capability.d.ts +37 -0
  45. package/dist/brain/model-capability.js +34 -0
  46. package/dist/brain/model-presets.d.ts +6 -12
  47. package/dist/brain/model-presets.js +1 -6
  48. package/dist/brain/open-responses.js +27 -35
  49. package/dist/brain/openai.js +30 -98
  50. package/dist/brain/provider-dialect.d.ts +39 -3
  51. package/dist/brain/provider-dialect.js +28 -0
  52. package/dist/brain/reasoning-request.d.ts +96 -0
  53. package/dist/brain/reasoning-request.js +174 -0
  54. package/dist/brain/reasoning.d.ts +12 -12
  55. package/dist/brain/reasoning.js +4 -3
  56. package/dist/brain/request-params.d.ts +62 -9
  57. package/dist/brain/request-params.js +42 -7
  58. package/dist/brain/retry.d.ts +1 -1
  59. package/dist/brain/route-adjudicator.d.ts +15 -0
  60. package/dist/brain/route-adjudicator.js +15 -0
  61. package/dist/brain/status-sink.d.ts +20 -0
  62. package/dist/brain/status-sink.js +7 -0
  63. package/dist/brain/stream-engine.js +6 -5
  64. package/dist/brain/stream-shared.d.ts +1 -1
  65. package/dist/core/a2a.d.ts +2 -1
  66. package/dist/core/a2a.js +19 -13
  67. package/dist/core/advisor-verdict.d.ts +120 -0
  68. package/dist/core/advisor-verdict.js +92 -0
  69. package/dist/core/agent-definition.d.ts +17 -8
  70. package/dist/core/allow-entry.d.ts +69 -36
  71. package/dist/core/allow-entry.js +81 -52
  72. package/dist/core/allow-rule-shadow.d.ts +10 -3
  73. package/dist/core/approval-object.d.ts +2 -1
  74. package/dist/core/approval-object.js +6 -6
  75. package/dist/core/ask-origin.d.ts +127 -29
  76. package/dist/core/ask-origin.js +87 -25
  77. package/dist/core/ask-question.d.ts +51 -8
  78. package/dist/core/ask-question.js +12 -7
  79. package/dist/core/ask-unresolvable-notice.d.ts +8 -3
  80. package/dist/core/ask-unresolvable-notice.js +16 -2
  81. package/dist/core/auto-compaction.d.ts +11 -8
  82. package/dist/core/auto-compaction.js +4 -2
  83. package/dist/core/auto-mode-arming.d.ts +2 -2
  84. package/dist/core/auto-mode-defaults.d.ts +8 -8
  85. package/dist/core/auto-mode-prompt-assets.d.ts +3 -3
  86. package/dist/core/auto-mode-prompt.d.ts +1 -1
  87. package/dist/core/auto-mode.d.ts +17 -9
  88. package/dist/core/auto-mode.js +9 -6
  89. package/dist/core/background-agent-store.d.ts +3 -3
  90. package/dist/core/canonical-json.d.ts +1 -1
  91. package/dist/core/canonical-json.js +2 -2
  92. package/dist/core/checkpoint-generation.d.ts +53 -0
  93. package/dist/core/checkpoint-generation.js +35 -0
  94. package/dist/core/checkpoint-queries.d.ts +180 -0
  95. package/dist/core/checkpoint-queries.js +272 -0
  96. package/dist/core/checkpoint-requirements.d.ts +19 -4
  97. package/dist/core/checkpoint-requirements.js +8 -14
  98. package/dist/core/checkpoint-store.d.ts +165 -72
  99. package/dist/core/checkpoint-store.js +79 -82
  100. package/dist/core/child-clamp-seats.d.ts +6 -0
  101. package/dist/core/child-clamp-seats.js +3 -16
  102. package/dist/core/compliance.d.ts +2 -2
  103. package/dist/core/context-edit.d.ts +6 -7
  104. package/dist/core/cross-boundary-taint.d.ts +11 -4
  105. package/dist/core/cross-boundary-taint.js +3 -3
  106. package/dist/core/decision-receipt.d.ts +37 -3
  107. package/dist/core/decision-receipt.js +19 -19
  108. package/dist/core/delegation-not-started.d.ts +6 -0
  109. package/dist/core/delegation-not-started.js +17 -0
  110. package/dist/core/effective-path-target.d.ts +1 -1
  111. package/dist/core/engine-attestation.d.ts +93 -0
  112. package/dist/core/engine-attestation.js +70 -0
  113. package/dist/core/engine-capabilities.d.ts +4 -1
  114. package/dist/core/engine-capabilities.js +1 -1
  115. package/dist/core/engine-notice.d.ts +45 -12
  116. package/dist/core/exec-output-tail.d.ts +1 -1
  117. package/dist/core/file-history-retention.d.ts +1 -1
  118. package/dist/core/file-history-store.d.ts +147 -21
  119. package/dist/core/file-history-store.js +58 -32
  120. package/dist/core/gate-fold.d.ts +1 -1
  121. package/dist/core/gate-fold.js +24 -11
  122. package/dist/core/gate-lanes.js +81 -68
  123. package/dist/core/gate-outcome.d.ts +40 -6
  124. package/dist/core/gate-outcome.js +56 -0
  125. package/dist/core/governance-codes.d.ts +17 -3
  126. package/dist/core/governance-codes.js +16 -0
  127. package/dist/core/hands-band.d.ts +1 -1
  128. package/dist/core/hooks.d.ts +21 -20
  129. package/dist/core/hooks.js +3 -1
  130. package/dist/core/host-floor.d.ts +128 -0
  131. package/dist/core/host-floor.js +206 -0
  132. package/dist/core/host-target.d.ts +84 -0
  133. package/dist/core/host-target.js +92 -0
  134. package/dist/core/image-downsample.d.ts +1 -1
  135. package/dist/core/lsp-diagnostics.d.ts +4 -4
  136. package/dist/core/lsp.d.ts +3 -3
  137. package/dist/core/mailbox-store.d.ts +4 -0
  138. package/dist/core/mcp-connection-pool.d.ts +18 -2
  139. package/dist/core/mcp-connection-pool.js +53 -6
  140. package/dist/core/mcp-failure.d.ts +23 -4
  141. package/dist/core/mcp-failure.js +26 -11
  142. package/dist/core/mcp-listing-drift.d.ts +10 -0
  143. package/dist/core/mcp-listing-drift.js +6 -0
  144. package/dist/core/mcp-server-link.d.ts +173 -0
  145. package/dist/core/mcp-server-link.js +127 -0
  146. package/dist/core/mcp-server-spec.d.ts +4 -2
  147. package/dist/core/mcp-session-end.d.ts +26 -0
  148. package/dist/core/mcp-session-end.js +29 -0
  149. package/dist/core/mcp-startup-request.d.ts +17 -0
  150. package/dist/core/mcp-startup-request.js +17 -0
  151. package/dist/core/mcp.d.ts +17 -13
  152. package/dist/core/mcp.js +240 -189
  153. package/dist/core/media-byte-cap.d.ts +1 -1
  154. package/dist/core/memory-engine/delegation-settlement.js +15 -24
  155. package/dist/core/memory-engine/engine.d.ts +9 -9
  156. package/dist/core/memory-engine/engine.js +4 -4
  157. package/dist/core/memory-engine/layout.d.ts +60 -8
  158. package/dist/core/memory-engine/layout.js +65 -6
  159. package/dist/core/memory-engine/provenance-wording.d.ts +1 -1
  160. package/dist/core/memory-engine/tools.js +4 -1
  161. package/dist/core/mode-policy.d.ts +1 -1
  162. package/dist/core/model-seat.d.ts +10 -3
  163. package/dist/core/mods/classic-events.d.ts +67 -0
  164. package/dist/core/mods/classic-events.js +1 -0
  165. package/dist/core/mods/dollar.d.ts +13 -0
  166. package/dist/core/mods/extension-call.d.ts +31 -0
  167. package/dist/core/mods/extension-call.js +43 -0
  168. package/dist/core/mods/kernel/dispatch.d.ts +20 -3
  169. package/dist/core/mods/kernel/dispatch.js +140 -69
  170. package/dist/core/mods/kernel/events.d.ts +47 -11
  171. package/dist/core/mods/kernel/events.js +66 -42
  172. package/dist/core/mods/kernel/index.d.ts +4 -4
  173. package/dist/core/mods/kernel/index.js +2 -2
  174. package/dist/core/mods/kernel/receive.d.ts +39 -5
  175. package/dist/core/mods/kernel/receive.js +290 -17
  176. package/dist/core/mods/kernel/registration.d.ts +33 -2
  177. package/dist/core/mods/kernel/registration.js +6 -7
  178. package/dist/core/mods/kernel/site-rules.d.ts +44 -16
  179. package/dist/core/mods/kernel/site-rules.js +24 -42
  180. package/dist/core/mods/spec-seats.d.ts +69 -0
  181. package/dist/core/mods/spec-seats.js +114 -0
  182. package/dist/core/mods/stations.d.ts +28 -8
  183. package/dist/core/mods/stations.js +29 -13
  184. package/dist/core/mods/tool-call.d.ts +79 -0
  185. package/dist/core/mods/tool-call.js +152 -0
  186. package/dist/core/namespaced-rule-name.d.ts +44 -24
  187. package/dist/core/namespaced-rule-name.js +50 -43
  188. package/dist/core/output-style.d.ts +1 -1
  189. package/dist/core/param-rule-reach.d.ts +15 -0
  190. package/dist/core/param-rule-reach.js +30 -0
  191. package/dist/core/parent-spec-seat.d.ts +13 -1
  192. package/dist/core/parent-spec-seat.js +6 -0
  193. package/dist/core/park-selfcheck.js +1 -0
  194. package/dist/core/pause-registry.d.ts +16 -5
  195. package/dist/core/pause-registry.js +6 -2
  196. package/dist/core/peer-channel.d.ts +70 -0
  197. package/dist/core/peer-channel.js +1 -0
  198. package/dist/core/permission-rule-consent.d.ts +30 -5
  199. package/dist/core/permission-rule-consent.js +147 -50
  200. package/dist/core/permission-rule-model.d.ts +245 -65
  201. package/dist/core/permission-rule-model.js +421 -107
  202. package/dist/core/permission-rule-org.d.ts +6 -2
  203. package/dist/core/permission-rule-org.js +7 -3
  204. package/dist/core/permission-rule-provider.d.ts +6 -2
  205. package/dist/core/permission-rule-provider.js +41 -11
  206. package/dist/core/permission-rule-store.d.ts +22 -26
  207. package/dist/core/permission-rule-store.js +12 -6
  208. package/dist/core/permission-rule-sync.d.ts +11 -2
  209. package/dist/core/permission-rule-sync.js +11 -3
  210. package/dist/core/permission-rule-syntax.d.ts +5 -4
  211. package/dist/core/permission-rule-syntax.js +2 -2
  212. package/dist/core/permission-rules.d.ts +53 -15
  213. package/dist/core/permission-rules.js +125 -100
  214. package/dist/core/persisted-rule-arms.d.ts +6 -4
  215. package/dist/core/persisted-rule-arms.js +10 -12
  216. package/dist/core/present-plan-tool.js +3 -1
  217. package/dist/core/principal-name.d.ts +20 -0
  218. package/dist/core/principal-name.js +22 -0
  219. package/dist/core/prompt-section-seat.js +4 -6
  220. package/dist/core/protocol-http-auth.d.ts +26 -5
  221. package/dist/core/protocol-http-auth.js +137 -4
  222. package/dist/core/protocol-naming.d.ts +2 -2
  223. package/dist/core/read-only-shell-table.d.ts +1 -1
  224. package/dist/core/read-only-shell.d.ts +1 -1
  225. package/dist/core/retired-keys.d.ts +16 -0
  226. package/dist/core/retired-keys.js +16 -4
  227. package/dist/core/rewrite-rejudge.d.ts +60 -0
  228. package/dist/core/rewrite-rejudge.js +36 -0
  229. package/dist/core/roles.d.ts +34 -3
  230. package/dist/core/roles.js +66 -53
  231. package/dist/core/rule-lane-reads.d.ts +20 -15
  232. package/dist/core/rule-lane-reads.js +45 -17
  233. package/dist/core/rule-offer-read.d.ts +53 -0
  234. package/dist/core/rule-offer-read.js +146 -0
  235. package/dist/core/rule-owner.d.ts +46 -0
  236. package/dist/core/rule-owner.js +29 -0
  237. package/dist/core/runner/advisor-instructions.d.ts +70 -0
  238. package/dist/core/runner/advisor-instructions.js +61 -0
  239. package/dist/core/runner/advisor-tool.d.ts +33 -0
  240. package/dist/core/runner/advisor-tool.js +112 -0
  241. package/dist/core/runner/announce-once-ledger.d.ts +18 -26
  242. package/dist/core/runner/announce-once-ledger.js +19 -46
  243. package/dist/core/runner/approval-feedback.js +6 -3
  244. package/dist/core/runner/assemble-result.d.ts +2 -1
  245. package/dist/core/runner/assemble-result.js +1 -1
  246. package/dist/core/runner/call-hook-stations.d.ts +3 -2
  247. package/dist/core/runner/caller-roster.d.ts +21 -2
  248. package/dist/core/runner/caller-roster.js +38 -0
  249. package/dist/core/runner/capability-withheld-seat.d.ts +5 -0
  250. package/dist/core/runner/capability-withheld-seat.js +24 -0
  251. package/dist/core/runner/classifier-ladder.d.ts +33 -13
  252. package/dist/core/runner/classifier-ladder.js +15 -14
  253. package/dist/core/runner/compaction-restate.d.ts +10 -6
  254. package/dist/core/runner/compaction-restate.js +9 -3
  255. package/dist/core/runner/construction-doors.js +3 -0
  256. package/dist/core/runner/contracts.d.ts +40 -33
  257. package/dist/core/runner/conversation-segment.d.ts +28 -0
  258. package/dist/core/runner/conversation-segment.js +42 -0
  259. package/dist/core/runner/cross-boundary-lane.d.ts +21 -16
  260. package/dist/core/runner/cross-boundary-lane.js +58 -34
  261. package/dist/core/runner/decide-continuation.d.ts +7 -4
  262. package/dist/core/runner/decide-continuation.js +2 -2
  263. package/dist/core/runner/denial-limit-arms.d.ts +4 -4
  264. package/dist/core/runner/denial-limit-arms.js +1 -1
  265. package/dist/core/runner/derived-route-fallback.d.ts +24 -24
  266. package/dist/core/runner/derived-route-fallback.js +9 -7
  267. package/dist/core/runner/file-history-request.d.ts +18 -0
  268. package/dist/core/runner/file-history-request.js +21 -13
  269. package/dist/core/runner/file-history-restore.d.ts +45 -0
  270. package/dist/core/runner/file-history-restore.js +46 -0
  271. package/dist/core/runner/gate-exit.d.ts +9 -3
  272. package/dist/core/runner/gate-exit.js +11 -5
  273. package/dist/core/runner/image.d.ts +7 -17
  274. package/dist/core/runner/image.js +9 -60
  275. package/dist/core/runner/initial-run-state.js +1 -1
  276. package/dist/core/runner/permission-rule-lanes.d.ts +6 -6
  277. package/dist/core/runner/permission-rule-lanes.js +38 -15
  278. package/dist/core/runner/person-path-rows.d.ts +12 -9
  279. package/dist/core/runner/person-path-rows.js +19 -8
  280. package/dist/core/runner/prepare-advisor.d.ts +63 -0
  281. package/dist/core/runner/prepare-advisor.js +77 -0
  282. package/dist/core/runner/prepare-ask-lane.d.ts +2 -2
  283. package/dist/core/runner/prepare-ask-lane.js +5 -2
  284. package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -6
  285. package/dist/core/runner/prepare-caps-and-workflow.js +5 -4
  286. package/dist/core/runner/prepare-config-doors.d.ts +31 -38
  287. package/dist/core/runner/prepare-config-doors.js +57 -34
  288. package/dist/core/runner/prepare-defer-classify.d.ts +4 -3
  289. package/dist/core/runner/prepare-defer-classify.js +7 -8
  290. package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
  291. package/dist/core/runner/prepare-delegation-surface.js +1 -1
  292. package/dist/core/runner/prepare-file-history.d.ts +48 -8
  293. package/dist/core/runner/prepare-file-history.js +41 -73
  294. package/dist/core/runner/prepare-gate-stations.d.ts +2 -5
  295. package/dist/core/runner/prepare-gate-stations.js +12 -8
  296. package/dist/core/runner/prepare-hands-readface.d.ts +2 -8
  297. package/dist/core/runner/prepare-hands-readface.js +15 -14
  298. package/dist/core/runner/prepare-inherited-gate.d.ts +11 -7
  299. package/dist/core/runner/prepare-inherited-gate.js +8 -6
  300. package/dist/core/runner/prepare-memory-engine-session.js +1 -1
  301. package/dist/core/runner/prepare-park-ask.js +12 -12
  302. package/dist/core/runner/prepare-policy-chain.d.ts +7 -4
  303. package/dist/core/runner/prepare-policy-chain.js +68 -81
  304. package/dist/core/runner/prepare-project-context.d.ts +5 -2
  305. package/dist/core/runner/prepare-project-context.js +6 -3
  306. package/dist/core/runner/prepare-prompt-assembly.d.ts +5 -7
  307. package/dist/core/runner/prepare-prompt-assembly.js +10 -8
  308. package/dist/core/runner/prepare-prompt-inputs.d.ts +11 -9
  309. package/dist/core/runner/prepare-prompt-inputs.js +4 -6
  310. package/dist/core/runner/prepare-protocol-tools.d.ts +4 -2
  311. package/dist/core/runner/prepare-protocol-tools.js +5 -4
  312. package/dist/core/runner/prepare-safety-scan.d.ts +9 -12
  313. package/dist/core/runner/prepare-safety-scan.js +8 -23
  314. package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
  315. package/dist/core/runner/prepare-suspend-saga.js +5 -6
  316. package/dist/core/runner/prepare-task.d.ts +1 -1
  317. package/dist/core/runner/prepare-task.js +41 -35
  318. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +7 -4
  319. package/dist/core/runner/prepare-tool-disclosure-mount.js +24 -18
  320. package/dist/core/runner/prepare-turn-wiring.d.ts +0 -4
  321. package/dist/core/runner/prepare-turn-wiring.js +2 -7
  322. package/dist/core/runner/prepare-wiring-manifest.d.ts +11 -4
  323. package/dist/core/runner/prepare-wiring-manifest.js +3 -3
  324. package/dist/core/runner/resume-admission.js +1 -1
  325. package/dist/core/runner/resume-apply.js +11 -12
  326. package/dist/core/runner/resume-checkpoint-screen.js +3 -0
  327. package/dist/core/runner/resume-claim.d.ts +4 -2
  328. package/dist/core/runner/resume-claim.js +15 -8
  329. package/dist/core/runner/resume-policy-outcome.js +1 -1
  330. package/dist/core/runner/retired-runner-deps.js +2 -1
  331. package/dist/core/runner/rewind-files.d.ts +15 -0
  332. package/dist/core/runner/rewind-files.js +132 -0
  333. package/dist/core/runner/run-attachment-seats.js +2 -2
  334. package/dist/core/runner/run-brain-sinks.d.ts +4 -1
  335. package/dist/core/runner/run-brain-sinks.js +4 -2
  336. package/dist/core/runner/run-compaction-machinery.d.ts +1 -1
  337. package/dist/core/runner/run-compaction-machinery.js +2 -12
  338. package/dist/core/runner/run-git-lane.d.ts +1 -0
  339. package/dist/core/runner/run-harness-handlers.js +14 -7
  340. package/dist/core/runner/run-leg.d.ts +1 -1
  341. package/dist/core/runner/run-leg.js +43 -18
  342. package/dist/core/runner/run-settle-and-teardown.js +3 -2
  343. package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
  344. package/dist/core/runner/run-turn-boundary.d.ts +1 -0
  345. package/dist/core/runner/run-turn-boundary.js +15 -22
  346. package/dist/core/runner/runtask.d.ts +3 -0
  347. package/dist/core/runner/runtask.js +8 -9
  348. package/dist/core/runner/session-read-file-states.d.ts +15 -0
  349. package/dist/core/runner/session-read-file-states.js +28 -0
  350. package/dist/core/runner/session-rule-policy.d.ts +22 -21
  351. package/dist/core/runner/session-rule-policy.js +17 -31
  352. package/dist/core/runner/shell-env-withheld.d.ts +33 -0
  353. package/dist/core/runner/shell-env-withheld.js +51 -0
  354. package/dist/core/runner/side-call-account.d.ts +32 -8
  355. package/dist/core/runner/side-call-account.js +23 -1
  356. package/dist/core/runner/skills-seat.js +6 -2
  357. package/dist/core/runner/stream-settle-backstop.js +1 -1
  358. package/dist/core/runner/strict-output-schema.d.ts +1 -1
  359. package/dist/core/runner/sub-agent-deny-lists.js +4 -6
  360. package/dist/core/runner/synthetic-tools.d.ts +16 -13
  361. package/dist/core/runner/synthetic-tools.js +8 -3
  362. package/dist/core/runner/tool-disclosure.d.ts +10 -12
  363. package/dist/core/runner/tool-disclosure.js +3 -4
  364. package/dist/core/runner/tool-end-body.d.ts +1 -1
  365. package/dist/core/runner/tool-end-body.js +10 -9
  366. package/dist/core/runner/tool-face-overlay.d.ts +2 -1
  367. package/dist/core/runner/tool-face-overlay.js +17 -1
  368. package/dist/core/runner/tool-not-executed.d.ts +5 -0
  369. package/dist/core/runner/tool-not-executed.js +11 -0
  370. package/dist/core/runner/tool-occurrence.d.ts +8 -0
  371. package/dist/core/runner/tool-occurrence.js +7 -0
  372. package/dist/core/runner/tool-progress-lane.d.ts +2 -2
  373. package/dist/core/runner/tool-turn-repair-seat.d.ts +3 -2
  374. package/dist/core/runner/turn-attachments.d.ts +91 -80
  375. package/dist/core/runner/turn-attachments.js +62 -37
  376. package/dist/core/runner-deps.d.ts +42 -42
  377. package/dist/core/runtime-caps.d.ts +4 -4
  378. package/dist/core/safety-axis-vocab.d.ts +6 -4
  379. package/dist/core/safety-axis-vocab.js +6 -5
  380. package/dist/core/safety-merge-corpus.js +26 -2
  381. package/dist/core/same-plain-value.d.ts +40 -0
  382. package/dist/core/same-plain-value.js +49 -0
  383. package/dist/core/scheduler.d.ts +1 -1
  384. package/dist/core/secret-env.d.ts +26 -3
  385. package/dist/core/secret-env.js +44 -8
  386. package/dist/core/select-model.js +3 -3
  387. package/dist/core/sensitive-path-policy.d.ts +1 -1
  388. package/dist/core/sensitive-path-policy.js +1 -1
  389. package/dist/core/session-policy-store.d.ts +102 -35
  390. package/dist/core/session-policy-store.js +210 -48
  391. package/dist/core/session-reconcile.d.ts +2 -2
  392. package/dist/core/session-store.d.ts +106 -37
  393. package/dist/core/session-store.js +165 -91
  394. package/dist/core/session.d.ts +101 -57
  395. package/dist/core/session.js +53 -0
  396. package/dist/core/shared-memory/tools.js +3 -1
  397. package/dist/core/shared-memory/types.d.ts +1 -1
  398. package/dist/core/shell-read-silence.d.ts +11 -12
  399. package/dist/core/shell-read-silence.js +9 -5
  400. package/dist/core/shell-run-candidates.js +3 -1
  401. package/dist/core/shell-wrapper-projection.js +1 -1
  402. package/dist/core/shell-wrapper-table.d.ts +14 -7
  403. package/dist/core/shell-wrapper-table.js +5 -4
  404. package/dist/core/side-query.d.ts +10 -0
  405. package/dist/core/side-query.js +15 -1
  406. package/dist/core/skill-grant.d.ts +7 -2
  407. package/dist/core/skill-grant.js +5 -0
  408. package/dist/core/skills-directory.js +6 -2
  409. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +11 -1
  410. package/dist/core/store-contracts/checkpoint-store-contract.js +168 -3
  411. package/dist/core/store-contracts/file-history-store-contract.js +74 -4
  412. package/dist/core/store-contracts/peer-directory-contract.d.ts +7 -2
  413. package/dist/core/store-contracts/peer-directory-contract.js +14 -2
  414. package/dist/core/store-contracts/session-policy-store-contract.d.ts +7 -0
  415. package/dist/core/store-contracts/session-policy-store-contract.js +130 -0
  416. package/dist/core/store-contracts/session-repo-contract.js +176 -0
  417. package/dist/core/store-contracts/session-store-contract.d.ts +6 -8
  418. package/dist/core/store-contracts/session-store-contract.js +361 -51
  419. package/dist/core/store-contracts/workflow-journal-store-contract.js +26 -1
  420. package/dist/core/stub-env.d.ts +2 -0
  421. package/dist/core/stub-env.js +1 -0
  422. package/dist/core/surrogate-safe-slice.d.ts +3 -3
  423. package/dist/core/synthetic-read-verdict.js +3 -3
  424. package/dist/core/task-event.d.ts +42 -8
  425. package/dist/core/task-notification.d.ts +19 -15
  426. package/dist/core/task-registry-agent.d.ts +4 -4
  427. package/dist/core/task-registry-shared.d.ts +4 -4
  428. package/dist/core/task-registry-shared.js +1 -0
  429. package/dist/core/task-registry.d.ts +13 -4
  430. package/dist/core/task-registry.js +14 -2
  431. package/dist/core/task-result.d.ts +21 -3
  432. package/dist/core/task-spec.d.ts +69 -64
  433. package/dist/core/task-stream.d.ts +6 -6
  434. package/dist/core/task-tool-shape.d.ts +4 -4
  435. package/dist/core/tighten-task-spec.d.ts +1 -1
  436. package/dist/core/tighten-task-spec.js +2 -1
  437. package/dist/core/tool-catalog-entries.d.ts +36 -2
  438. package/dist/core/tool-catalog-entries.js +69 -43
  439. package/dist/core/tool-check-reading.d.ts +11 -0
  440. package/dist/core/tool-check-reading.js +11 -6
  441. package/dist/core/tool-conformance.js +1 -0
  442. package/dist/core/tool-errors.d.ts +2 -2
  443. package/dist/core/tool-face-reader.js +5 -3
  444. package/dist/core/tool-face.d.ts +21 -2
  445. package/dist/core/tool-face.js +1 -1
  446. package/dist/core/tool-model-gate.d.ts +5 -5
  447. package/dist/core/tool-name-aliases.d.ts +29 -8
  448. package/dist/core/tool-name-aliases.js +22 -4
  449. package/dist/core/tool-name-readings.d.ts +10 -43
  450. package/dist/core/tool-name-readings.js +2 -11
  451. package/dist/core/tool-policy.d.ts +85 -196
  452. package/dist/core/tool-policy.js +150 -175
  453. package/dist/core/tool-registry.d.ts +14 -7
  454. package/dist/core/tool-registry.js +17 -7
  455. package/dist/core/tool-result-store.js +5 -1
  456. package/dist/core/tool-roster.d.ts +57 -33
  457. package/dist/core/tool-roster.js +56 -68
  458. package/dist/core/tool-spec-members.js +8 -3
  459. package/dist/core/tool-spec.d.ts +53 -31
  460. package/dist/core/tools.js +51 -10
  461. package/dist/core/trace.d.ts +6 -2
  462. package/dist/core/types.d.ts +1 -1
  463. package/dist/core/untrusted-egress.d.ts +1 -1
  464. package/dist/core/untrusted-text.d.ts +1 -1
  465. package/dist/core/user-attachment.d.ts +8 -1
  466. package/dist/core/user-attachment.js +64 -4
  467. package/dist/core/warm-resume.d.ts +1 -1
  468. package/dist/core/wiring-manifest.d.ts +58 -0
  469. package/dist/core/wiring-manifest.js +14 -5
  470. package/dist/core/workflow-journal-store.d.ts +62 -0
  471. package/dist/core/workflow-journal-store.js +78 -2
  472. package/dist/core/workflow-run-store.d.ts +6 -0
  473. package/dist/core/workflow-run-store.js +2 -0
  474. package/dist/engine/compaction/compaction.d.ts +9 -9
  475. package/dist/engine/compaction/compaction.js +3 -2
  476. package/dist/engine/execution-env/node-execution-env.d.ts +26 -8
  477. package/dist/engine/execution-env/node-execution-env.js +54 -24
  478. package/dist/engine/harness/agent-harness.d.ts +39 -9
  479. package/dist/engine/harness/agent-harness.js +87 -33
  480. package/dist/engine/harness/types.d.ts +58 -9
  481. package/dist/engine/harness/types.js +12 -1
  482. package/dist/engine/llm/types.d.ts +36 -19
  483. package/dist/engine/llm/validation.d.ts +4 -1
  484. package/dist/engine/llm/validation.js +13 -1
  485. package/dist/engine/loop/agent-loop.d.ts +23 -1
  486. package/dist/engine/loop/agent-loop.js +26 -34
  487. package/dist/engine/loop/types.d.ts +31 -19
  488. package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
  489. package/dist/engine/session/memory-repo.d.ts +18 -12
  490. package/dist/engine/session/memory-repo.js +24 -9
  491. package/dist/engine/session/parent-chain-guard.d.ts +3 -2
  492. package/dist/engine/session/parent-chain-guard.js +1 -1
  493. package/dist/engine/session/repo-utils.d.ts +32 -3
  494. package/dist/engine/session/repo-utils.js +50 -5
  495. package/dist/index.d.ts +47 -23
  496. package/dist/index.js +35 -17
  497. package/dist/internal/harness-types.d.ts +1 -1
  498. package/dist/internal/harness.d.ts +3 -3
  499. package/dist/internal/harness.js +2 -2
  500. package/dist/internal/llm.d.ts +2 -2
  501. package/dist/internal/llm.js +1 -1
  502. package/dist/orchestration/goal.js +2 -2
  503. package/dist/orchestration/run-workflow-tool.d.ts +8 -6
  504. package/dist/orchestration/run-workflow-tool.js +10 -6
  505. package/dist/orchestration/workflow-size-guideline.d.ts +4 -4
  506. package/dist/orchestration/workflow-types.d.ts +18 -0
  507. package/dist/orchestration/workflow-types.js +6 -0
  508. package/dist/orchestration/workflow.d.ts +5 -13
  509. package/dist/orchestration/workflow.js +57 -49
  510. package/dist/prompt-assembly/artifact.d.ts +2 -2
  511. package/dist/prompt-assembly/artifact.js +5 -3
  512. package/dist/prompt-assembly/assemble.d.ts +3 -2
  513. package/dist/prompt-assembly/assemble.js +1 -1
  514. package/dist/prompt-assembly/catalog/schema.d.ts +43 -12
  515. package/dist/prompt-assembly/catalog/schema.js +34 -2
  516. package/dist/prompt-assembly/catalog/sections.js +0 -1
  517. package/dist/prompt-assembly/composer.d.ts +3 -1
  518. package/dist/prompt-assembly/composer.js +1 -1
  519. package/dist/prompt-assembly/event-registry.js +2 -0
  520. package/dist/prompt-assembly/overlay.js +3 -3
  521. package/dist/prompt-assembly/renderers.d.ts +1 -1
  522. package/dist/prompt-assembly/renderers.js +0 -3
  523. package/dist/prompt-assembly/role-base.d.ts +15 -0
  524. package/dist/prompt-assembly/role-base.js +9 -0
  525. package/dist/prompt-assembly/select.d.ts +39 -14
  526. package/dist/prompt-assembly/select.js +47 -16
  527. package/dist/prompt-assembly/sugar.d.ts +17 -11
  528. package/dist/prompt-assembly/sugar.js +8 -3
  529. package/dist/prompt-assembly/tool-catalog.d.ts +39 -2
  530. package/dist/prompt-assembly/tool-catalog.js +117 -4
  531. package/dist/prompt-assembly/turn-snapshot.d.ts +4 -10
  532. package/dist/prompt-assembly/turn-snapshot.js +0 -3
  533. package/dist/prompt-assembly/types.d.ts +0 -7
  534. package/dist/prompts/default.d.ts +14 -14
  535. package/dist/scenarios/full-body.d.ts +15 -15
  536. package/dist/scenarios/full-body.js +4 -3
  537. package/dist/shell/lex.js +10 -1
  538. package/dist/stores/file/adoption/adopt.d.ts +4 -3
  539. package/dist/stores/file/adoption/adopt.js +27 -33
  540. package/dist/stores/file/adoption/marker.d.ts +6 -13
  541. package/dist/stores/file/adoption/marker.js +9 -17
  542. package/dist/stores/file/checkpoint-store.d.ts +24 -0
  543. package/dist/stores/file/checkpoint-store.js +45 -7
  544. package/dist/stores/file/file-history-store.d.ts +20 -19
  545. package/dist/stores/file/file-history-store.js +157 -141
  546. package/dist/stores/file/fs-atomic.d.ts +15 -0
  547. package/dist/stores/file/fs-atomic.js +89 -14
  548. package/dist/stores/file/index.d.ts +1 -1
  549. package/dist/stores/file/index.js +2 -1
  550. package/dist/stores/file/mailbox-store.d.ts +3 -0
  551. package/dist/stores/file/mailbox-store.js +3 -1
  552. package/dist/stores/file/permission-rule-adopt.d.ts +1 -1
  553. package/dist/stores/file/permission-rule-adopt.js +18 -18
  554. package/dist/stores/file/permission-rule-store.d.ts +18 -2
  555. package/dist/stores/file/permission-rule-store.js +31 -18
  556. package/dist/stores/file/session-policy-store.d.ts +3 -3
  557. package/dist/stores/file/session-store.d.ts +54 -16
  558. package/dist/stores/file/session-store.js +114 -85
  559. package/dist/stores/file/workflow-journal-store.d.ts +10 -4
  560. package/dist/stores/file/workflow-journal-store.js +28 -13
  561. package/dist/tools/artifact/artifact-text.d.ts +1 -1
  562. package/dist/tools/artifact/artifact-tool.js +5 -3
  563. package/dist/tools/fs/bash-program-position.d.ts +19 -2
  564. package/dist/tools/fs/bash-program-position.js +56 -9
  565. package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -3
  566. package/dist/tools/fs/fs-bash.d.ts +2 -2
  567. package/dist/tools/fs/fs-bash.js +8 -6
  568. package/dist/tools/fs/fs-glob.d.ts +86 -0
  569. package/dist/tools/fs/fs-glob.js +226 -0
  570. package/dist/tools/fs/fs-read.js +14 -14
  571. package/dist/tools/fs/fs-search-tools.js +7 -7
  572. package/dist/tools/fs/fs-shared.d.ts +8 -8
  573. package/dist/tools/fs/gh-rate-limit.d.ts +1 -1
  574. package/dist/tools/fs/notebook.d.ts +2 -2
  575. package/dist/tools/fs/pattern-kill-guard.d.ts +22 -0
  576. package/dist/tools/fs/pattern-kill-guard.js +397 -0
  577. package/dist/tools/fs/pdf.d.ts +9 -6
  578. package/dist/tools/fs/pdf.js +3 -3
  579. package/dist/tools/fs/program-read-model.d.ts +57 -7
  580. package/dist/tools/fs/program-read-model.js +11 -1
  581. package/dist/tools/fs/program-read-model.rows.js +78 -21
  582. package/dist/tools/fs/read-deny-home.js +3 -2
  583. package/dist/tools/fs/read-deny.d.ts +29 -7
  584. package/dist/tools/fs/read-deny.js +63 -22
  585. package/dist/tools/fs/removal-targets.d.ts +18 -8
  586. package/dist/tools/fs/removal-targets.js +47 -20
  587. package/dist/tools/fs/safety.d.ts +9 -9
  588. package/dist/tools/fs/search.d.ts +16 -6
  589. package/dist/tools/fs/search.js +20 -26
  590. package/dist/tools/fs/shell-read-argv.js +89 -12
  591. package/dist/tools/fs/shell-read-bindings.d.ts +31 -0
  592. package/dist/tools/fs/shell-read-bindings.js +41 -0
  593. package/dist/tools/fs/shell-read-check.js +12 -20
  594. package/dist/tools/fs/shell-read-environment.d.ts +5 -1
  595. package/dist/tools/fs/shell-read-environment.js +3 -2
  596. package/dist/tools/fs/shell-read-establish.d.ts +15 -0
  597. package/dist/tools/fs/shell-read-establish.js +19 -20
  598. package/dist/tools/fs/shell-read-judge.d.ts +4 -0
  599. package/dist/tools/fs/shell-read-judge.js +5 -2
  600. package/dist/tools/fs/shell-read-plan.js +24 -16
  601. package/dist/tools/fs/shell-read-start.d.ts +6 -1
  602. package/dist/tools/fs/shell-read-write-targets.d.ts +5 -1
  603. package/dist/tools/fs/shell-read-write-targets.js +2 -3
  604. package/dist/tools/fs/shell-reentry-text.d.ts +9 -0
  605. package/dist/tools/fs/shell-reentry-text.js +40 -2
  606. package/dist/tools/loop-tick.d.ts +2 -2
  607. package/dist/tools/scheduler-tools.js +5 -1
  608. package/dist/tools/task-list.d.ts +7 -7
  609. package/dist/tools/task-list.js +5 -1
  610. package/dist/tools/todo.js +65 -64
  611. package/dist/tools/web.d.ts +20 -15
  612. package/dist/tools/web.js +55 -69
  613. package/dist/tools/worktree.d.ts +3 -3
  614. package/dist/tools/worktree.js +3 -1
  615. package/package.json +1 -1
  616. package/test/export-surface.snapshot.json +5894 -5638
  617. package/wire-changes/core@7.55.0.json +3318 -0
  618. package/wire-changes/core@7.56.0.json +3891 -0
  619. package/wire-changes/mods-kernel@7.56.0.json +303 -0
  620. package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +0 -39
  621. package/dist/core/store-contracts/session-store-incarnation-contract.js +0 -95
@@ -8,7 +8,8 @@
8
8
  * answers to ({@link heldBy}); a set-valued table is read as the union of its entries ({@link heldValues}).
9
9
  * · `seat` — a multi-key seat keyed on engine names: ONE name is chosen ({@link seatOf}) and every key of the seat is
10
10
  * read under it. `tier` = the name whose irreversibility tier is strictest (`never < maybe < always`, an
11
- * absent tier lowest, ties to the earlier name of the call); `member` = the first name the table holds.
11
+ * absent tier lowest; a tie goes to the call's wire name — the tool that runs judges its own call with its
12
+ * own probe — then to the earlier name of the call); `member` = the first name the table holds.
12
13
  * · `wire` — a GRANT or a ROUTING keyed on an engine name: the call's wire name only ({@link wireOf}).
13
14
  * · `spelling` — a record of what the model said (stream frames, transcripts, counters): the harness event's own name;
14
15
  * no port — listed so the table is complete.
@@ -78,10 +79,6 @@ export declare const NAME_READINGS: {
78
79
  readonly rank: "member";
79
80
  readonly file: string;
80
81
  };
81
- readonly "lanes.contentQuestionClass": {
82
- readonly kind: "any";
83
- readonly file: string;
84
- };
85
82
  readonly "lanes.readOnlyShellAllow": {
86
83
  readonly kind: "wire";
87
84
  readonly file: string;
@@ -90,30 +87,10 @@ export declare const NAME_READINGS: {
90
87
  readonly kind: "wire";
91
88
  readonly file: string;
92
89
  };
93
- readonly "lanes.contentAskRoute": {
94
- readonly kind: "wire";
95
- readonly file: string;
96
- };
97
90
  readonly "lanes.orgContentAskExemption": {
98
91
  readonly kind: "wire";
99
92
  readonly file: string;
100
93
  };
101
- readonly "lanes.persistedEditSkip": {
102
- readonly kind: "wire";
103
- readonly file: string;
104
- };
105
- readonly "lanes.persistedLaneSkip": {
106
- readonly kind: "wire";
107
- readonly file: string;
108
- };
109
- readonly "lanes.allowLayerQuestionSkip": {
110
- readonly kind: "wire";
111
- readonly file: string;
112
- };
113
- readonly "lanes.sandboxQuestionSkip": {
114
- readonly kind: "wire";
115
- readonly file: string;
116
- };
117
94
  readonly "policy.nameLists": {
118
95
  readonly kind: "any";
119
96
  readonly file: string;
@@ -150,10 +127,6 @@ export declare const NAME_READINGS: {
150
127
  readonly kind: "any";
151
128
  readonly file: string;
152
129
  };
153
- readonly "policy.durableQuestion": {
154
- readonly kind: "any";
155
- readonly file: string;
156
- };
157
130
  readonly "policy.sensitivePathGuardedByName": {
158
131
  readonly kind: "any";
159
132
  readonly file: string;
@@ -163,6 +136,11 @@ export declare const NAME_READINGS: {
163
136
  readonly rank: "member";
164
137
  readonly file: string;
165
138
  };
139
+ readonly "floor.protectiveHostTarget": {
140
+ readonly kind: "seat";
141
+ readonly rank: "member";
142
+ readonly file: string;
143
+ };
166
144
  readonly "mode.planRosterRow": {
167
145
  readonly kind: "wire";
168
146
  readonly file: string;
@@ -243,10 +221,6 @@ export declare const NAME_READINGS: {
243
221
  readonly kind: "spelling";
244
222
  readonly file: string;
245
223
  };
246
- readonly "inherited.questionFloat": {
247
- readonly kind: "wire";
248
- readonly file: string;
249
- };
250
224
  readonly "inherited.askFace": {
251
225
  readonly kind: "wire";
252
226
  readonly file: string;
@@ -255,14 +229,6 @@ export declare const NAME_READINGS: {
255
229
  readonly kind: "wire";
256
230
  readonly file: string;
257
231
  };
258
- readonly "resume.editRecheckQuestionSkip": {
259
- readonly kind: "wire";
260
- readonly file: string;
261
- };
262
- readonly "resume.questionArgsShown": {
263
- readonly kind: "wire";
264
- readonly file: string;
265
- };
266
232
  readonly "budget.exemptResult": {
267
233
  readonly kind: "wire";
268
234
  readonly file: string;
@@ -350,8 +316,9 @@ export interface TierSeat extends Seat<IrreversibilityTierWord> {
350
316
  }): boolean;
351
317
  }
352
318
  /**
353
- * A `seat` site's read. A `tier` seat takes the irreversibility tier table and picks the name whose tier is strictest;
354
- * a `member` seat takes a table (a map, or a set whose value reads `true`) and picks the first name it holds.
319
+ * A `seat` site's read. A `tier` seat takes the irreversibility tier table and picks the name whose tier is strictest, a tie
320
+ * going to the call's wire name, then to its earlier name; a `member` seat takes a table (a map, or a set whose value reads
321
+ * `true`) and picks the first name it holds.
355
322
  */
356
323
  export declare function seatOf(site: TierSeatSite, tiers: {
357
324
  get(name: string): IrreversibilityTierWord | undefined;
@@ -21,15 +21,9 @@ export const NAME_READINGS = {
21
21
  "gate.preToolUse": wire("src/core/hooks.ts"),
22
22
  "gate.askFace": wire("src/core/runner/gate-exit.ts"),
23
23
  "fold.readStation": seat("member", "src/tools/fs/shell-read-check.ts"),
24
- "lanes.contentQuestionClass": any(LANES),
25
24
  "lanes.readOnlyShellAllow": wire(LANES),
26
25
  "lanes.modeFileCommand": wire(LANES),
27
- "lanes.contentAskRoute": wire(LANES),
28
26
  "lanes.orgContentAskExemption": wire(LANES),
29
- "lanes.persistedEditSkip": wire(LANES),
30
- "lanes.persistedLaneSkip": wire(LANES),
31
- "lanes.allowLayerQuestionSkip": wire(LANES),
32
- "lanes.sandboxQuestionSkip": wire(LANES),
33
27
  "policy.nameLists": any(POLICY),
34
28
  "policy.shellToolsList": any(POLICY),
35
29
  "policy.projectionReplay": any(POLICY),
@@ -39,9 +33,9 @@ export const NAME_READINGS = {
39
33
  "gate.skillActivationSeat": wire(GATE),
40
34
  "policy.permissionRules": any("src/core/permission-rules.ts"),
41
35
  "policy.persistedGrammar": any("src/core/permission-rule-model.ts"),
42
- "policy.durableQuestion": any("src/core/ask-question.ts"),
43
36
  "policy.sensitivePathGuardedByName": any("src/core/sensitive-path-policy.ts"),
44
37
  "floor.protectivePathTarget": seat("member", "src/core/tool-registry.ts"),
38
+ "floor.protectiveHostTarget": seat("member", "src/core/host-target.ts"),
45
39
  "mode.planRosterRow": wire("src/core/mode-policy.ts"),
46
40
  "offer.laneTool": wire(OFFER),
47
41
  "offer.orgQuestionExemption": wire(OFFER),
@@ -61,11 +55,8 @@ export const NAME_READINGS = {
61
55
  "stats.subagentToolCounter": spelling("src/agents/subagent.ts"),
62
56
  "activity.sink": spelling(HANDLERS),
63
57
  "reconcile.orphanEffect": spelling("src/core/session-reconcile.ts"),
64
- "inherited.questionFloat": wire(CHAIN),
65
58
  "inherited.askFace": wire(CHAIN),
66
59
  "card.reserved": wire("src/core/tool-roster.ts"),
67
- "resume.editRecheckQuestionSkip": wire("src/core/runner/resume-apply.ts"),
68
- "resume.questionArgsShown": wire("src/core/runner/run-leg.ts"),
69
60
  "budget.exemptResult": wire("src/core/tool-result-budget.ts"),
70
61
  "compaction.compactableResult": wire("src/core/context-edit.ts"),
71
62
  };
@@ -113,7 +104,7 @@ export function seatOf(site, table, call) {
113
104
  const valueAt = (n) => (typeof table.get === "function" ? table.get(n) : table.has(n) ? true : undefined);
114
105
  if (r.kind === "seat" && r.rank === "tier") {
115
106
  let best;
116
- for (const n of names) {
107
+ for (const n of [call.toolName, ...names.filter((name) => name !== call.toolName)]) {
117
108
  const v = valueAt(n);
118
109
  if (v === undefined)
119
110
  continue;
@@ -1,10 +1,12 @@
1
1
  import { type AskOrigin, type AssertAllKeysHandled } from "./ask-origin.js";
2
+ import { type EngineAttestation } from "./engine-attestation.js";
2
3
  import { type ReadRootGrantScreen } from "./read-root-grant-screen.js";
3
4
  import { type Settlement } from "./gate-outcome.js";
4
5
  export { policyCannotAnswer, rowDemandsAPerson } from "./real-approval.js";
5
6
  import { type BindingFault } from "./canonical-json.js";
6
7
  import { type DecisionReason } from "./decision-receipt.js";
7
8
  export { isEngineRefusal } from "./decision-receipt.js";
9
+ import { type RuleBehavior } from "./permission-rule-model.js";
8
10
  import { type RemovalGuardSeat } from "../tools/fs/removal-targets.js";
9
11
  /** A tool call presented to a policy before it executes. */
10
12
  /** design/388 B6 — the per-call face (see {@link ToolCallRequest.face}). */
@@ -16,6 +18,14 @@ export interface ToolCallFace {
16
18
  names?: readonly string[];
17
19
  family: import("./tool-face.js").ToolFamily;
18
20
  pathTarget?: import("./tool-face.js").ToolRosterPathTarget;
21
+ /** The URL slot a host rule of the tool's name is read on (`callHostTargetOf`), as the tool declared it — absent when it
22
+ * declares none, so no allow by host reaches the call (a deny or an ask still reads the catalog's slot for the name). */
23
+ hostTarget?: import("./tool-face.js").ToolHostTarget;
24
+ /** The values the mounted tool takes for the argument its name rules are read against (`ToolRuleFace.nameValues`, off the
25
+ * roster row — the delegation tool's offered agent types): a name rule of such a tool resolves its value and the call's against
26
+ * them (`nameRuleReach`). Absent where the tool declares none, and on a face rebuilt from a park row: a rule that needs them
27
+ * then cannot be read against the call (a deny refuses, an ask asks a person, an allow grants nothing). */
28
+ nameValues?: readonly string[];
19
29
  capabilityId: string;
20
30
  contractId: string;
21
31
  shapeDigest: string;
@@ -25,6 +35,11 @@ export interface ToolCallFace {
25
35
  * ask, the parked gate and the pending row, so no reader recovers the card from a name. Absent on a face rebuilt
26
36
  * from a park row (a re-judgment reads no card). */
27
37
  approvalCard?: import("./tool-face.js").ToolApprovalCard;
38
+ /** Present (`true`) iff one of the ENGINE's own mount sites mounted the tool the call dispatches to — a built-in or synthetic tool
39
+ * the engine minted for the leg, never a caller's `TaskSpec.tools` entry or a protocol peer's tool (`engineMountedRow`). The one
40
+ * identity a caller cannot wear: a name and a contract id can be declared. A face rebuilt from a park row carries it when the row does
41
+ * (the member the park wrote off the roster entry); absent on a row minted before the member. */
42
+ engineMounted?: true;
28
43
  }
29
44
  export interface ToolCallRequest {
30
45
  /** The tool's wire name — the Runner's gate resolves a call made under an alias to the wire name of the tool it
@@ -214,81 +229,7 @@ export declare function exemptRootsSeat(exemptRoots: readonly string[]): {
214
229
  /** Declared beside the receipt's list (decision-receipt.ts) — a new member added to either side is a compile error rather
215
230
  * than a silent drift between the type and the screen; re-exported here, the module every consumer of the decision reads. */
216
231
  export type { DecisionReason };
217
- /**
218
- * The engine's ATTESTATION record — the one carrier of what an engine station knows about a decision and a policy cannot
219
- * state: WHO settled the call's wait and WHICH question that answered (the settlement, the ask's origin word and class set,
220
- * the digest of the arguments the answer licenses), and the facts the classifier stations, the in-fold unresolvable arms
221
- * and the policy fold record. It rides the decision as its `attestation` member and is read through {@link attestationOf}
222
- * alone; the decision object's identity carries nothing.
223
- *
224
- * Minted only by {@link mintAttestation} and combined only by {@link mergeAttestation}: both freeze the record and enter it
225
- * in a module-private brand set, so a value a caller composed — a literal, a copy, a structured clone — is not a record, and
226
- * the receipt refuses a decision carrying one. A record is bound to the call it was minted for (`toolCallId` + `toolName`):
227
- * handed back for another call it reads as absent. A spread of a decision keeps its record, and the record still says only
228
- * what the engine minted — a refusal record on an allow is a contradiction the gate's exit refuses, and a resolution's
229
- * answer binds the arguments it licensed (`inputDigest`).
230
- */
231
- export interface EngineAttestation {
232
- readonly toolCallId: string;
233
- readonly toolName: string;
234
- /** What ended the call's wait. The answer group — `settlement`, `origin`, `classes`, `inputDigest` — travels as one. */
235
- readonly settlement?: Settlement;
236
- /** The settled ask's origin word. */
237
- readonly origin?: AskOrigin;
238
- /** The settled ask's class set (`ASK_CLASSES` order), when the minting station held one. */
239
- readonly classes?: readonly import("./ask-origin.js").AskClass[];
240
- /** `exactBoundInputHashOf` of the arguments the settlement licenses (an approver's edit, the snapshot shown, or the asked
241
- * args); absent when they have none (outside the bindable domain) — such a record licenses no bytes. */
242
- readonly inputDigest?: string;
243
- /** The FORM of a classifier round that did not rule (a classifier deny's cause). */
244
- readonly classifierCause?: import("./gate-outcome.js").ClassifierDenyCause;
245
- /** WHICH model answered a classification, on either arm. */
246
- readonly classifierRound?: import("./auto-mode.js").AutoModeClassifierRound;
247
- /** Why an in-fold deny refused an ask nobody could resolve. */
248
- readonly unresolvableCause?: import("./ask-unresolvable-notice.js").AskUnresolvableCause;
249
- /** The classes of the asks a policy fold collapsed — the proof behind a decision's `foldedAskClasses`. */
250
- readonly foldedClasses?: readonly import("./ask-origin.js").AskClass[];
251
- /** Where a path deny row refused the call — the row, the view of the target it met, the face the call is on. The gate's
252
- * exit mints the refusal's card from it; the judge that found the row is its only writer. */
253
- readonly pathDenial?: import("../tools/fs/safety.js").PathDenialEvidence;
254
- /** A seat refused the call's arguments because no approval can be bound to them ({@link bindableArgsOf}): the refusal's
255
- * sentence, carried by the refusal itself — the gate's deny exit reads it (the remedy it gives) instead of judging again. */
256
- readonly bindingRefusal?: string;
257
- }
258
- /** The members a station attests — everything but the call binding. */
259
- export type AttestationMembers = Omit<EngineAttestation, "toolCallId" | "toolName">;
260
- /** Mint a record for `call`. Engine stations only: not re-exported from `src/index.ts`. The values are DETACHED snapshots, so a
261
- * caller that later mutates the settlement object it was handed cannot rewrite what the engine attests. */
262
- export declare function mintAttestation(call: {
263
- toolCallId: string;
264
- toolName: string;
265
- }, members: AttestationMembers): EngineAttestation;
266
- /** Is `v` a record the engine minted (the brand alone — no binding)? The receipt's test. */
267
- export declare function isEngineAttestation(v: unknown): v is EngineAttestation;
268
- /** THE read: the record `d` carries FOR `call` — a branded record bound to that call, else `undefined` (a record bound to
269
- * another call is a replayed one and reads as absent). Read off the own data member, never through an accessor. */
270
- export declare function attestationOf(d: unknown, call: {
271
- toolCallId: string;
272
- toolName: string;
273
- }): EngineAttestation | undefined;
274
- /**
275
- * Combine two records for `call`, member GROUP by group: the later record's group stands where it has one, the earlier's
276
- * fills a group the later lacks. A record not bound to `call` contributes nothing. `answer` scope is the veto's merge: the
277
- * earlier record contributes ONLY its answer, and only when the later carries none — a person's yes rides a later layer's
278
- * deny (invariant I3) while the refusing station's own facts stay its own.
279
- */
280
- export declare function mergeAttestation(call: {
281
- toolCallId: string;
282
- toolName: string;
283
- }, earlier: EngineAttestation | undefined, later: EngineAttestation | undefined, scope?: "all" | "answer"): EngineAttestation | undefined;
284
- /** `d` with `members` attested for `call`, merged over the record it already carries for that call (the new members' groups
285
- * win). Always a fresh object — the receipt hands out frozen ones. */
286
- export declare function attest<T extends object>(d: T, call: {
287
- toolCallId: string;
288
- toolName: string;
289
- }, members: AttestationMembers): T;
290
- /** `d` carrying `record` (a fresh object), or `d` itself when there is no record to put on it. */
291
- export declare function withAttestation<T extends object>(d: T, record: EngineAttestation | undefined): T;
232
+ export { attest, attestationOf, isEngineAttestation, mergeAttestation, mintAttestation, withAttestation, type AttestationMembers, type EngineAttestation } from "./engine-attestation.js";
292
233
  /** The `no_approver`-attested deny an engine policy answers on a request that states nobody can be asked about it
293
234
  * ({@link ToolCallRequest.approvalReach}) instead of reaching a seat — read by a probe as "would ask an approver". */
294
235
  export declare function noApproverSeatDeny(req: {
@@ -336,7 +277,7 @@ export declare function screenApproverAttribution(v: unknown): {
336
277
  approver?: string;
337
278
  defect?: string;
338
279
  };
339
- /** An integrity guard an ask stands on ({@link PermissionResult}'s `guards`). */
280
+ /** An integrity guard an ask stands on — an engine finding, carried on the ask's record ({@link EngineAttestation.guards}). */
340
281
  export type AskGuard = "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "artifact_shared_read";
341
282
  /**
342
283
  * A three-state permission decision for a tool call (design/37). Upgrades the old two-state
@@ -384,7 +325,7 @@ export type PermissionResult = {
384
325
  decisionReason?: DecisionReason;
385
326
  requiresRealApproval?: boolean;
386
327
  /** This ask is the classifier DENIAL-LIMIT fallback — the block that reached a
387
- * bound (CC 2.1.250 `FO`, count-then-judge) handed to a person instead of being denied.
328
+ * bound (count-then-judge) handed to a person instead of being denied.
388
329
  * ENGINE-STAMPED beside `requiresRealApproval: true` and `decisionReason: "classifier"` at the
389
330
  * classifier block sites (the gate's own and the inherited-lane arms); carries the COUNTS ONLY —
390
331
  * the auto-deny window is a fact of the ask's ROUTE, so this type has no member to hold one
@@ -403,17 +344,24 @@ export type PermissionResult = {
403
344
  classifierNoRuling?: import("./auto-mode.js").AutoModeFallbackCause;
404
345
  /** The allow layer's DISCLOSURE: the members that MATCHED this call and could not clear the ask (it is a class
405
346
  * no allow rule clears — a mandated, governance, hook, ask-rule or mode question — or the call reached the layer
406
- * marked), one record per member ({@link AllowRuleShadow}). ENGINE-STAMPED by the allow layer, overwriting a
407
- * policy's own value; a DISPLAY member: the approval card and the park row render it, nothing reads it to
408
- * decide, and the classifier never sees it (it is not part of `message`). Absent ⇒ no member matched. */
347
+ * marked), one record per member ({@link AllowRuleShadow}). Written by the allow layer alone (a STAMP member: a
348
+ * decision that states it is refused at the receipt); a DISPLAY member: the approval card and the park row render it,
349
+ * nothing reads it to decide, and the classifier never sees it (it is not part of `message`). Absent ⇒ no member matched. */
409
350
  allowRuleShadowed?: readonly import("./allow-rule-shadow.js").AllowRuleShadow[];
410
351
  /** backlog #239 disclosure (additive): WHY the reversibility probe did not clear this call, in the
411
352
  * probe's own words. ENGINE-STAMPED at the irreversibility tighten (which constructs this decision
412
353
  * wholesale), already neutralized + capped there; a `"maybe"` tier whose probe supplied no cause,
413
- * and the `"always"` tier (which runs no probe), leave it absent. Same DISPLAY-ONLY posture as
354
+ * and the `"always"` tier (which runs no probe), leave it absent. Also stamped beside a mandate merged onto an
355
+ * ask another layer raised (the read station's account of its finding): it is the one sentence that says why
356
+ * a matching allow rule did not clear a `probe_mandate` ask, on the card and in the parked row alike. Same DISPLAY-ONLY posture as
414
357
  * {@link allowRuleShadowed}: a policy that self-declares it can only put its own prose on its
415
358
  * own card — nothing reads this member to decide anything, so it is not an authority channel. */
416
359
  probeReason?: string;
360
+ /** This ask puts a person's edit back to the person: the restriction chain would not run it as written and accepts it
361
+ * only as {@link import("./rewrite-rejudge.js").EditRewritten.acceptableForm}, the bytes this ask presents. ENGINE-MINTED by
362
+ * the approved-edit pass (a policy's self-declared value is a display claim about its own card); carried onto the
363
+ * approval request as {@link AskRequest.editRewritten}. */
364
+ editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
417
365
  /** backlog #239 disclosure (additive): the STRUCTURED cause, for a probe whose verdict this engine
418
366
  * understands (see {@link import("./checkpoint-store.js").ProbeCause}). Engine-stamped and
419
367
  * validated at the irreversibility tighten; same display-only posture as the prose sibling. */
@@ -442,8 +390,8 @@ export type PermissionResult = {
442
390
  * set, and a policy self-declaring it only opts its own ask OUT of automatic answering. Carried
443
391
  * onto the approval request as {@link AskRequest.mandated}. */
444
392
  mandated?: true;
445
- /** The TABLE WORD the {@link mandated} bit stands on — see {@link AskRequest.mandate}. ENGINE-STAMPED at
446
- * the same origin stamp as the bit; a policy's self-declared value is dropped there. */
393
+ /** The TABLE WORD the {@link mandated} bit stands on — see {@link AskRequest.mandate}. A STAMP member, written at the
394
+ * same origin stamp as the bit. */
447
395
  mandate?: import("./ask-origin.js").PersistedRuleMandate;
448
396
  /** The probe named a directory that would clear this ask
449
397
  * ({@link import("./types.js").ReversibilityVerdict.readRootCandidate}). Display metadata like the two
@@ -464,47 +412,33 @@ export type PermissionResult = {
464
412
  * list) that leaves it unset gets `policy` there, indistinguishable from hesitation. */
465
413
  matchedAskRule?: string;
466
414
  /** design/252 G-2 (additive): the RULE-PROVENANCE evidence behind this ask — see
467
- * {@link AskRuleEvidence}. ENGINE-STAMPED inside the gate, once, after the org layer and the
468
- * persisted-rule lane have both spoken; a policy that self-declares it is overwritten there
469
- * (the member is a record of what the ENGINE's own governance layers did, so a layer's claim
470
- * about itself is not evidence). Carried onto the approval request by the gate's own ask mint
471
- * site. Display/reconciliation metadata, never adjudication input. */
415
+ * {@link AskRuleEvidence}. A STAMP member, written inside the gate once, after the org layer and the
416
+ * persisted-rule lane have both spoken (the member is a record of what the ENGINE's own governance layers
417
+ * did, so a layer's claim about itself is not evidence). Carried onto the approval request by the gate's own
418
+ * ask mint site. Display/reconciliation metadata, never adjudication input. */
472
419
  ruleEvidence?: AskRuleEvidence;
473
420
  /** design/375 §5.2②: the per-segment coverage table behind this surviving ask — which segments
474
421
  * of a compound an eligible persisted rule already admits, read off the SAME store read that
475
- * adjudicated the call (snapshot = adjudication snapshot). ENGINE-STAMPED at the gate's one
476
- * stamp point whenever the persisted-rule lane reported one (overwriting a policy's claim);
477
- * consumed only by the offer factory, which puts on the batch offer exactly the segments this
478
- * table calls uncovered. Absent ⇒ all segments read as uncovered (over-offer, the safe way).
479
- * Same display-only posture as {@link allowRuleShadowed}: never adjudication input, and a
480
- * value nobody stamps over can only shrink or annotate the card's ADVISORY offers — every
481
- * offered rule still passes the validator at redemption. */
422
+ * adjudicated the call (snapshot = adjudication snapshot). A STAMP member, written at the gate's one
423
+ * stamp point when the persisted-rule lane reported one; consumed only by the offer factory, which puts on
424
+ * the batch offer exactly the segments this table calls uncovered. Absent ⇒ all segments read as uncovered
425
+ * (over-offer, the safe way). */
482
426
  segmentCoverage?: readonly import("./permission-rule-model.js").SegmentCoverage[];
483
427
  /** WHICH AUTHORITY raised this ask — one word from the closed {@link import("./ask-origin.js").AskOrigin}
484
428
  * set (org rule / org unavailable / hook / explicit ask rule / the classifier's denial-limit
485
- * fallback / the reserved question tool / a marked call / plain policy). ENGINE-STAMPED inside the
429
+ * fallback / the reserved question tool / a marked call / plain policy). A STAMP member, written inside the
486
430
  * gate at the same single stamp point as `ruleEvidence`, derived from what the gate's own layers
487
- * did ({@link import("./ask-origin.js").askOriginOf}) — a policy that self-declares it is overwritten
488
- * there, so the member is never a channel a policy can loosen through. A DISCLOSURE word: the lanes
489
- * read the ask's class set ({@link import("./ask-origin.js").classifyAsk}), an approval surface may
490
- * render the card by it. Optional on the TYPE only because a decision is caller-composable; every ask
491
- * the gate hands to its resolver carries it. */
431
+ * did ({@link import("./ask-origin.js").askOriginOf}). A DISCLOSURE word: the lanes read the ask's class set
432
+ * ({@link import("./ask-origin.js").classifyAsk}), an approval surface may render the card by it. Optional on the
433
+ * TYPE only because the gate writes it after a policy answers; every ask the gate hands to its resolver carries it. */
492
434
  origin?: import("./ask-origin.js").AskOrigin;
493
- /** The ask's CLASS — the first member of {@link classes} (see {@link AskRequest.askClass}). ENGINE-STAMPED at the
494
- * same single stamp as {@link origin}, from the class set the gate's lanes read; a policy that self-declares it is
495
- * overwritten there, and no lane reads it back (they read the classification itself). */
435
+ /** The ask's CLASS — the first member of {@link classes} (see {@link AskRequest.askClass}). A STAMP member, written at
436
+ * the same single stamp as {@link origin}, from the class set the gate's lanes read; no lane reads it back (they read
437
+ * the classification itself). */
496
438
  askClass?: import("./ask-origin.js").AskClass;
497
439
  /** The ask's whole class set, in {@link import("./ask-origin.js").ASK_CLASSES} order (see
498
440
  * {@link AskRequest.classes}). Stamped beside {@link askClass}, under the same rule. */
499
441
  classes?: readonly import("./ask-origin.js").AskClass[];
500
- /** WHICH integrity guards stand behind this ask — a removal of a protected location, an unverifiable recursive delete,
501
- * shell text the engine cannot read (or an environment that did not answer the read station), the session-transcript
502
- * write. A set: one ask may stand on several, and each keeps its class. ENGINE-STAMPED by the guard policies and the
503
- * gate fold; a fold-internal fact the class derivation reads ({@link import("./ask-origin.js").classifyAsk}) so the
504
- * guards, which mint the same `requiresRealApproval` ask, are told apart by a fact and not by their prose. Never
505
- * copied onto the approval request or the park row. Replaces the one-word `guard`, which a decision no longer carries:
506
- * a decision that still does is refused by name ({@link RETIRED_DECISION_MEMBERS}). */
507
- guards?: readonly AskGuard[];
508
442
  /** The call could not be READ against a rule that may reach it — a content-form deny row, a content-form
509
443
  * ask row, a persisted-rule row (the lexer's word), or rows the shell read station's boundary stands on that
510
444
  * could not be read (`persisted_rows`). ENGINE-STAMPED at the four unreadable mint sites;
@@ -518,13 +452,6 @@ export type PermissionResult = {
518
452
  * every ask). Public: a host composing such a policy sets it; {@link combinePolicies} carries it onto the
519
453
  * surviving ask (tighten-only). Not on the approval request — the card shows `origin` / `mandate`. */
520
454
  authoredBy?: "deployment";
521
- /** The classes of the OTHER asks a policy fold collapsed into this one
522
- * ({@link import("./ask-origin.js").decisionAskClassesOf} per contributing ask, unioned), so a member the
523
- * fold does not copy — a guard mark, an unreadable-rule fact, a bare real-approval bit — is not lost behind
524
- * the ask that won the slot. ENGINE-WRITTEN by {@link combinePolicies}, which attests the list it wrote
525
- * ({@link EngineAttestation.foldedClasses}); the receipt refuses the member unless the decision's record carries that very
526
- * list (a policy's own, an edited list are refused). Fold-internal, never on the request. */
527
- foldedAskClasses?: readonly import("./ask-origin.js").AskClass[];
528
455
  attestation?: EngineAttestation;
529
456
  } | {
530
457
  action: "deny";
@@ -766,36 +693,24 @@ export interface ToolPolicyProjection {
766
693
  readonly requiresLiveRemainder: boolean;
767
694
  }
768
695
  /**
769
- * The entries of a tool-NAME list whose reach is a set of names rather than one name — the covering
770
- * spellings (`<ns>__<peer>`, `<ns>__<peer>__<glob>`) of ANY protocol namespace, which CC's rule
771
- * matcher resolves and an exact-membership test silently cannot. Every name-keyed lane in this file
772
- * consults these ALONGSIDE its exact set: a covering spelling can never equal a minted tool name (`*`
773
- * is outside the minted charset and a minted name always carries a tool segment), so leaving it in the
774
- * exact set too costs nothing and keeps the projection/audit faces reporting the operator's own spelling.
696
+ * The entries of a tool-NAME list whose reach is a set of names rather than one name — the covering spellings
697
+ * ({@link isCoveringRuleName}): a `*` anywhere in the name on a list that restricts (`Re*d`, `mcp__*`, the lone `*` — every tool),
698
+ * only in the tool segment after a literal `<ns>__<peer>__` on one that grants, and a protocol peer (`<ns>__<peer>`) on either —
699
+ * which CC's rule matcher resolves and an exact-membership test silently cannot. Every name-keyed lane in this file consults these
700
+ * ALONGSIDE its exact set: a covering spelling can never equal a mounted tool name (no mounted name holds a `*`, and a minted name
701
+ * always carries a tool segment), so leaving it in the exact set too costs nothing and keeps the projection/audit faces reporting
702
+ * the operator's own spelling. The list is usually empty, which is why every call site tests it before scanning.
775
703
  *
776
- * Namespace-generic on purpose: the covering grammar is a property of the shared `<prefix><peer>__<tool>`
777
- * name shape, not of MCP, and keying it to one prefix made every sibling-namespace covering rule
778
- * (`a2a__<peer>__*`) compile clean and match nothing — inert in the deny half, and in an ALLOW list the
779
- * removal of that peer's whole tool set.
780
- *
781
- * The list is usually empty, which is why every call site tests it before scanning.
782
- *
783
- * Exported for the OTHER name-keyed lane in this engine — the persisted session/ancestor rules in
784
- * `session-rule-policy.ts`. Not part of the public API (`src/index.ts` re-exports by name and does not
785
- * list these two): every publisher of {@link ToolPolicyNameSets} must resolve a covering entry the same
786
- * way, because the prepare-time audit's exemption for these spellings speaks for ALL published name sets
787
- * at once — the four in-engine lanes do so by sharing this module's matcher. That premise is NOT
788
- * structural for an OUT-OF-ENGINE publisher (a host compiling its own settings into an exact-match ask
789
- * closure is fail-open on these spellings while the audit stays silent) — which is why the underlying
790
- * judgment predicates (`isNamespacedCoveringRuleName` / `namespacedRuleNameCovers`) ARE exported from
791
- * the package index: an external lane either compiles through `createPermissionRulePolicy` or
792
- * self-checks with those.
704
+ * `behavior` = what the list does with a call it reaches. Exported for the in-engine name-keyed lanes; an OUT-OF-ENGINE publisher
705
+ * of {@link ToolPolicyNameSets} compiles through `createPermissionRulePolicy` or self-checks with the root-exported predicates
706
+ * (`isCoveringRuleName` / `ruleNameCovers`) — the prepare-time audit's exemption for these spellings speaks for every published
707
+ * name set at once, so a lane keying them exactly is fail-open in the "tool runs unasked" direction while the audit stays silent.
793
708
  */
794
- export declare function namespacedCoveringEntries(entries: readonly string[] | undefined): readonly string[];
709
+ export declare function coveringRuleEntries(entries: readonly string[] | undefined, behavior: RuleBehavior): readonly string[];
795
710
  /** Does any covering entry reach the call — under ANY name it answers to, the same reading the exact lists take through
796
711
  * `nameListHolds` (a covering entry and an exact entry in one list are one rule: it reaches the call iff its name is on the
797
- * list)? See {@link namespacedCoveringEntries}. */
798
- export declare function namespacedCoveringHit(covering: readonly string[], call: Pick<ToolCallRequest, "toolName" | "face">): boolean;
712
+ * list)? See {@link coveringRuleEntries}. */
713
+ export declare function coveringRuleHit(covering: readonly string[], call: Pick<ToolCallRequest, "toolName" | "face">): boolean;
799
714
  /**
800
715
  * The tool names a projection component is keyed on, and the member that holds them: a `tool_deny` / `tool_allowlist`'s
801
716
  * `names`, a `shell_command`'s `tools` (its `deny` / `allow` are command names, not tool names). A frozen chain holds them only
@@ -925,53 +840,12 @@ export declare function constraintChainDigest(chain: readonly ConstraintChainEnt
925
840
  * present one must sit on an arm its row holds. Not re-exported from `src/index.ts`. */
926
841
  export type DecisionMember = PermissionResult extends infer U ? (U extends unknown ? keyof U : never) : never;
927
842
  export declare const DECISION_MEMBERS: readonly DecisionMember[];
928
- /**
929
- * The RECEIPT of a permission decision — the one point at which the engine takes a decision in from whoever composed it,
930
- * on every lane: each layer of {@link combinePolicies}' fold, the gate's adjudication entry and its approved-edit re-check,
931
- * the inherited lane's receipts of an ancestor policy's decision, the final-form re-check, the direct `check()` rechecks
932
- * (the resume edit, the park re-projection, the changed-files probe), and the PreToolUse hook's result seam (its own
933
- * reach, below). NOT re-exported from `src/index.ts`: an internal screen on inputs the engine receives.
934
- *
935
- * WHAT COMES BACK is the engine's own frozen copy, never the caller's object. A decision is caller-supplied data: a
936
- * stateful accessor, a Proxy, or a policy that keeps and mutates an object it returned could otherwise answer two
937
- * consumers with two values, and which consumer read which value would decide the call. So the caller's object is read
938
- * ONCE, here, and every station after the receipt (the fold's ranking, the origin stamp, the classifier's eligibility, the
939
- * mode arbitration, the approval request, the rewrite that executes) reads the copy; a copy handed to the screen again
940
- * comes back as it is, unread (so does the engine's own refusal, {@link isEngineRefusal}). In order: (1) the CARRIER's type — a decision that is not an object (a string, a function
941
- * holding the members) has no `action`; (2) the ONE READ — ONE function ({@link receiveContract}) for the decision and for the
942
- * records it nests (`receiveNestedRecords`, decision-receipt.ts), on an ORDINARY object (a Proxy, as the carrier or anywhere on its prototype
943
- * chain, is refused before a trap of its could run): each contract member absent or an own enumerable DATA property, its value
944
- * taken off the carrier's own descriptor (a member outside the contract is neither read nor carried — a policy's self-declared
945
- * record on another name finds no reader); any other spelling refused by name — an accessor (never invoked), a member the
946
- * prototype or a non-enumerable property supplies unless that descriptor spells absence (an `undefined` data value) — judged by
947
- * descriptor, never read; (3) a retired member ({@link RETIRED_DECISION_MEMBERS}: `reason`, `guard`) carried by the same presence law as a contract
948
- * member — own, held by an accessor, or supplied by the prototype — judged without a read (ignoring it silently dropped the policy's text or the ask's guard); (4) the VALUES, off the engine's
949
- * one-read record, never a second read of the caller's object — the retired window absent, `action` in
950
- * its closed set (`screenContractValues`, decision-receipt.ts — every closed-set member is held to its set there; a consumer ranks a decision by testing two of its words, so any other value used to rank as an
951
- * allow; a `canUseTool` result outside its set is a failure in CC) and `decisionReason` in {@link DECISION_REASONS} when
952
- * present (absence stays legal); (5) the DETACH —
953
- * the contract members' values structured-cloned ({@link tryCloneArgs}; one that cannot be, a function inside a rewrite,
954
- * is refused), the engine's `attestation` record re-attached by reference after its brand check, the copy frozen and
955
- * marked as this module's. A refusal is a deny in the screen's words, one code for every arm (`decisionReason: "rule"`),
956
- * carrying no `updatedInput` from the refused object (a rewrite from an EARLIER, contract-shaped layer still rides out of
957
- * {@link combinePolicies}' deny path). `null` / `undefined` carry nothing and take the carrier's refusal (the caller's own
958
- * read of `.action` would throw instead, and that throw was being reported as an aborted check).
959
- *
960
- * SCOPE: the receipt runs NONE of the carrier's code — a Proxy (its traps are the caller's code) is refused unread, and on an
961
- * ordinary object descriptor looks and `Object.getPrototypeOf` invoke nothing. What the receipt does not reach: code inside a
962
- * member's VALUE, run by the detach itself (an accessor inside a rewrite is invoked by the structured clone, and what it answers
963
- * there is what is cloned and what runs — one read, consistent) and by a refusal's rendering of a foreign word (`String(v)` on an
964
- * out-of-set `action`, after the deny is decided). Same-process JavaScript has no trust boundary a function can enforce.
965
- *
966
- * `reasonIsNonInput` (the HOOK seam): the same receipt, with the two differences the seam's consumers imply — a hook's
967
- * `decisionReason` is DISCARDED there (every mint point downstream re-stamps `"hook"`) and so is not held to its set, and a
968
- * hook result may leave `action` out (no opinion; the policy still adjudicates). `undefined`, `null` and `false` are no
969
- * opinion (what a hook body yields when it has nothing to say). A refusal the receipt mints at this seam is the ENGINE's
970
- * decision ({@link isEngineRefusal}) and exits through the engine's fail-closed arm (the deny observer), never as the hook's
971
- * own deny.
972
- */
973
843
  export declare function refuseOutOfContractDecision(d: PermissionResult, opts?: {
974
844
  reasonIsNonInput?: boolean;
845
+ call?: {
846
+ readonly toolCallId: string;
847
+ readonly toolName: string;
848
+ };
975
849
  }): PermissionResult;
976
850
  /** The raw tool-name lists a name-keyed policy was built from (audit feed, see block note above). */
977
851
  export interface ToolPolicyNameSets {
@@ -996,9 +870,9 @@ export declare function toolPolicyNameSets(p: ToolPolicy | undefined): readonly
996
870
  * mode's unstated question; consent is an allow entry (`RunnerDeps.allowedTools` / `TaskSpec.allowedTools`). Without
997
871
  * `allow`, everything not in `deny` gets no objection. Each entry is read by the rule
998
872
  * syntax (`ruleSpellingOf`): a name, or `Tool()` / `Tool(*)` — the bare `Tool`, as every list reader reads them, once however
999
- * many spellings write it; any other spelling is not a tool name (`onInvalidName`), and neither is the wildcard `*` (`*`,
1000
- * `*()`, `*(*)`) in `deny`: it names no tool, and the entry would be kept and never match. In `allow` it is one entry no tool
1001
- * carries — the list admits what else it names, and nothing for it.
873
+ * many spellings write it; any other spelling is not a tool name (`onInvalidName`). A `*` in a name is a glob over the whole
874
+ * name in `deny` (`Re*d`, `mcp__*`; the lone `*` denies every tool), and in `allow` only in the tool segment after a literal
875
+ * `<ns>__<peer>__` (`mcp__srv__get_*`) — any other `*` in `allow` names no scope it widens and is not a tool name either.
1002
876
  * Carries {@link NamedToolPolicy.nameSets} (the names as read) so the host can audit the lists against the mounted
1003
877
  * pool ([c209-E] advisory); enforcement semantics are unchanged.
1004
878
  */
@@ -1007,7 +881,7 @@ export declare function createAllowDenyPolicy(opts: {
1007
881
  deny?: string[];
1008
882
  /**
1009
883
  * What to do with an entry that is not a tool NAME: a rule CONTENT form (`Bash(ps:*)`, `Edit(src/**)`), a spelling
1010
- * the rule syntax reads no tool name in (`" Bash"`, `Bash\t(*)`, `-deploy`), or the wildcard `*` in the deny list.
884
+ * the rule syntax reads no tool name in (`" Bash"`, `Bash\t(*)`, `-deploy`), or a `*` the allow list does not read (`*`, `Re*d`, `mcp__*`).
1011
885
  * `"throw"` (default, matching {@link createPermissionRulePolicy}'s posture toward a rule it cannot
1012
886
  * compile) refuses at construction; `"skip"` drops the entry and reports it. Under BOTH, the entry never
1013
887
  * silently narrows the allowlist.
@@ -1094,6 +968,13 @@ export declare function createApprovalPolicy(opts: {
1094
968
  * no longer covers what runs. For a tool whose permission seat is `passthrough` the gate puts the mode's question to a
1095
969
  * combined allow unless an answer covers the bytes that run ({@link answeredFor}) — the allow layer answers it there.
1096
970
  *
971
+ * **A rewrite is judged by every layer that judged earlier bytes.** A layer's `updatedInput` cascades into the layers after
972
+ * it; the layers BEFORE the latest rewrite judged other bytes, so each is asked once more about the bytes that run, and that
973
+ * answer is its verdict (a deny there refuses the call; a different form handed back there refuses it too — a rewrite is
974
+ * judged once, never chased). The latest rewriter is not asked again: its verdict is bound to its own output. An `updatedInput`
975
+ * that reads as the bytes it was handed is no rewrite; and a layer's rewrite that is a person's edit (its own approver's,
976
+ * licensed by that person's yes) is not replaced by a later layer — that layer's rewrite refuses the call.
977
+ *
1097
978
  * **Idempotency requirement:** because the fold continues past an `ask` to look for a later `deny`, a
1098
979
  * policy's `check()` can be invoked even after an earlier policy returned `ask`. `check()` MUST be
1099
980
  * idempotent — repeated calls with the same {@link ToolCallRequest} return the same decision and
@@ -1162,7 +1043,7 @@ export declare function createCoarseCommandNamePolicy(opts: {
1162
1043
  tools?: string[];
1163
1044
  }): ToolPolicy;
1164
1045
  /**
1165
- * CC 220 "Unverifiable Deletion Target" parity (auto-mode rule; its text is in 220–245, gone from 2.1.250 on): ASK on a recursive+forced delete whose
1046
+ * "Unverifiable Deletion Target" (auto-mode rule; since dropped upstream): ASK on a recursive+forced delete whose
1166
1047
  * target is a variable / substitution that cannot be resolved from the command itself — fail-closed in the
1167
1048
  * sense that with no live classifier/approver the ask degrades to deny (see {@link PermissionResult}'s
1168
1049
  * `ask` doc), never to allow. The guard reads ONE plan, the read station's (`removalReadingOf`,
@@ -1176,7 +1057,7 @@ export declare function createCoarseCommandNamePolicy(opts: {
1176
1057
  * RB-341 (2026-07-29) re-checked that citation against the 220 corpus and corrected it in BOTH directions.
1177
1058
  * The RB-203 note claimed the phrase "traces to the 206 bundle; it does not appear anywhere in the 220
1178
1059
  * corpus for THIS rule" — that sentence was wrong and is retracted. The phrase has 8 hits in 220, and two
1179
- * of them are this exact rule's own message text: `pretty220` 461365 (the `rm -rf $UNSET/*`
1060
+ * of them are this exact rule's own message text: (the `rm -rf $UNSET/*`
1180
1061
  * variable-expansion arm, verbatim «e.g. `rm -rf $UNSET/*` becomes `rm -rf /*`. This requires explicit
1181
1062
  * approval and cannot be auto-allowed by permission rules.») and 461444 (its command-substitution twin).
1182
1063
  * Five more are the sibling deterministic `rm`/`rmdir` arms (457337/457364/457379/457387/457402) and one is
@@ -1293,6 +1174,10 @@ export interface AskRequest {
1293
1174
  * `RiskDescriptor.probeReason`. Neutralized + length-capped by the gate. UNTRUSTED-for-display,
1294
1175
  * never adjudication input. */
1295
1176
  readonly probeReason?: string;
1177
+ /** Present ⇔ this card puts a person's edit back to them: the restriction chain would not run the edit as written and
1178
+ * accepts it only as `acceptableForm` — the `args` this card presents. Approving as it stands runs exactly those bytes;
1179
+ * editing again starts a new pass; a no refuses. Engine-minted; display and outlet only, never adjudication input. */
1180
+ readonly editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
1296
1181
  /** The STRUCTURED cause behind the tighten — a machine-readable code plus the operand
1297
1182
  * families as arrays with honest totals, so this surface renders its OWN sentence rather than one the
1298
1183
  * engine had to write before the check's edge cases were known. See
@@ -1319,6 +1204,10 @@ export interface AskRequest {
1319
1204
  * RECONCILIATION metadata, never adjudication input. */
1320
1205
  readonly ruleEvidence?: AskRuleEvidence;
1321
1206
  toolCallId: string;
1207
+ /** An extension's own call (`$.tool.call`): who asked for it, for the card's line of origin ("extension X wants to run …").
1208
+ * A display fact — the ask is the run's, put to the run's approver and judged exactly as a model's call is; absent for a
1209
+ * call a model message carried. Minted by the engine at the ask's mint; never adjudication input. */
1210
+ readonly requestedBy?: import("./task-event.js").ExtensionRequester;
1322
1211
  /** The (post-rewrite) args the tool would run with. */
1323
1212
  args: unknown;
1324
1213
  /** the tool's approval display projection of {@link args} (AgentTool.approvalPreview),