@sema-agent/core 7.55.0 → 7.57.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 (502) hide show
  1. package/CHANGELOG.md +1054 -0
  2. package/LICENSE +1 -1
  3. package/dist/agents/cascade.js +1 -1
  4. package/dist/agents/cc-peer-directory.js +1 -0
  5. package/dist/agents/child-model-seat.d.ts +0 -11
  6. package/dist/agents/child-model-seat.js +0 -3
  7. package/dist/agents/list-agents-tool.d.ts +3 -1
  8. package/dist/agents/list-agents-tool.js +7 -7
  9. package/dist/agents/org-delivery-gate.js +3 -4
  10. package/dist/agents/peer-directory.d.ts +22 -4
  11. package/dist/agents/peer-directory.js +24 -2
  12. package/dist/agents/peer-held-queue.d.ts +69 -49
  13. package/dist/agents/peer-held-queue.js +255 -106
  14. package/dist/agents/peer-session-drain.js +65 -45
  15. package/dist/agents/repair-loop.js +2 -2
  16. package/dist/agents/send-message-tool.js +7 -6
  17. package/dist/agents/subagent.d.ts +6 -4
  18. package/dist/agents/subagent.js +72 -68
  19. package/dist/agents/tool-filter.d.ts +7 -5
  20. package/dist/agents/tool-filter.js +12 -9
  21. package/dist/agents/verify.d.ts +3 -2
  22. package/dist/agents/verify.js +3 -3
  23. package/dist/brain/anthropic.js +45 -80
  24. package/dist/brain/media-degrade.d.ts +18 -7
  25. package/dist/brain/media-degrade.js +13 -2
  26. package/dist/brain/model-capability.d.ts +37 -0
  27. package/dist/brain/model-capability.js +34 -0
  28. package/dist/brain/model-presets.d.ts +2 -8
  29. package/dist/brain/model-presets.js +1 -6
  30. package/dist/brain/open-responses.js +23 -34
  31. package/dist/brain/openai.js +25 -96
  32. package/dist/brain/provider-dialect.d.ts +3 -2
  33. package/dist/brain/provider-dialect.js +2 -2
  34. package/dist/brain/reasoning-request.d.ts +96 -0
  35. package/dist/brain/reasoning-request.js +174 -0
  36. package/dist/brain/reasoning.d.ts +11 -11
  37. package/dist/brain/reasoning.js +4 -3
  38. package/dist/brain/request-params.d.ts +13 -4
  39. package/dist/brain/request-params.js +21 -5
  40. package/dist/brain/status-sink.d.ts +20 -0
  41. package/dist/brain/status-sink.js +7 -0
  42. package/dist/brain/stream-engine.d.ts +9 -0
  43. package/dist/brain/stream-engine.js +24 -10
  44. package/dist/brain/stream-shared.d.ts +5 -4
  45. package/dist/brain/stream-shared.js +4 -4
  46. package/dist/core/a2a.d.ts +2 -1
  47. package/dist/core/a2a.js +19 -13
  48. package/dist/core/agent-definition.d.ts +10 -0
  49. package/dist/core/allow-entry.d.ts +23 -23
  50. package/dist/core/allow-entry.js +42 -46
  51. package/dist/core/allow-rule-shadow.d.ts +3 -3
  52. package/dist/core/approval-object.d.ts +21 -5
  53. package/dist/core/approval-object.js +44 -17
  54. package/dist/core/ask-origin.d.ts +66 -20
  55. package/dist/core/ask-origin.js +63 -23
  56. package/dist/core/ask-question.d.ts +51 -8
  57. package/dist/core/ask-question.js +3 -4
  58. package/dist/core/ask-unresolvable-notice.d.ts +8 -3
  59. package/dist/core/ask-unresolvable-notice.js +16 -2
  60. package/dist/core/auto-compaction.d.ts +71 -6
  61. package/dist/core/auto-compaction.js +42 -26
  62. package/dist/core/background-agent-store.d.ts +6 -2
  63. package/dist/core/background-agent-store.js +1 -1
  64. package/dist/core/checkpoint-generation.d.ts +53 -0
  65. package/dist/core/checkpoint-generation.js +35 -0
  66. package/dist/core/checkpoint-queries.d.ts +180 -0
  67. package/dist/core/checkpoint-queries.js +272 -0
  68. package/dist/core/checkpoint-requirements.d.ts +19 -1
  69. package/dist/core/checkpoint-requirements.js +6 -0
  70. package/dist/core/checkpoint-store.d.ts +105 -53
  71. package/dist/core/checkpoint-store.js +43 -20
  72. package/dist/core/cross-boundary-taint.d.ts +6 -5
  73. package/dist/core/cross-boundary-taint.js +5 -5
  74. package/dist/core/decision-receipt.d.ts +37 -3
  75. package/dist/core/decision-receipt.js +17 -17
  76. package/dist/core/delegation-not-started.d.ts +6 -0
  77. package/dist/core/delegation-not-started.js +17 -0
  78. package/dist/core/engine-attestation.d.ts +93 -0
  79. package/dist/core/engine-attestation.js +70 -0
  80. package/dist/core/engine-capabilities.d.ts +4 -1
  81. package/dist/core/engine-capabilities.js +1 -1
  82. package/dist/core/engine-notice.d.ts +32 -12
  83. package/dist/core/engine-notice.js +6 -0
  84. package/dist/core/file-history-store.d.ts +104 -22
  85. package/dist/core/file-history-store.js +37 -19
  86. package/dist/core/gate-fold.d.ts +1 -1
  87. package/dist/core/gate-fold.js +22 -10
  88. package/dist/core/gate-lanes.js +73 -65
  89. package/dist/core/gate-outcome.d.ts +26 -5
  90. package/dist/core/gate-outcome.js +26 -0
  91. package/dist/core/governance-codes.d.ts +5 -1
  92. package/dist/core/governance-codes.js +6 -0
  93. package/dist/core/hooks.d.ts +19 -18
  94. package/dist/core/hooks.js +3 -1
  95. package/dist/core/host-floor.d.ts +128 -0
  96. package/dist/core/host-floor.js +206 -0
  97. package/dist/core/host-target.d.ts +38 -3
  98. package/dist/core/host-target.js +38 -5
  99. package/dist/core/mailbox-store.d.ts +62 -1
  100. package/dist/core/mailbox-store.js +59 -0
  101. package/dist/core/mcp-name-judge.d.ts +46 -0
  102. package/dist/core/mcp-name-judge.js +61 -0
  103. package/dist/core/mcp-probe.d.ts +1 -1
  104. package/dist/core/mcp-probe.js +2 -5
  105. package/dist/core/mcp.d.ts +5 -1
  106. package/dist/core/mcp.js +70 -64
  107. package/dist/core/memory-engine/consolidation-driver.js +4 -3
  108. package/dist/core/memory-engine/delegation-settlement.js +15 -24
  109. package/dist/core/memory-engine/distiller.js +26 -17
  110. package/dist/core/memory-engine/engine.js +4 -4
  111. package/dist/core/memory-engine/layout.d.ts +60 -8
  112. package/dist/core/memory-engine/layout.js +70 -8
  113. package/dist/core/model-seat.d.ts +10 -3
  114. package/dist/core/mods/classic-events.d.ts +67 -0
  115. package/dist/core/mods/classic-events.js +1 -0
  116. package/dist/core/mods/dollar.d.ts +13 -0
  117. package/dist/core/mods/extension-call.d.ts +31 -0
  118. package/dist/core/mods/extension-call.js +43 -0
  119. package/dist/core/mods/kernel/dispatch.d.ts +20 -3
  120. package/dist/core/mods/kernel/dispatch.js +140 -69
  121. package/dist/core/mods/kernel/events.d.ts +47 -11
  122. package/dist/core/mods/kernel/events.js +66 -42
  123. package/dist/core/mods/kernel/index.d.ts +4 -4
  124. package/dist/core/mods/kernel/index.js +2 -2
  125. package/dist/core/mods/kernel/receive.d.ts +39 -5
  126. package/dist/core/mods/kernel/receive.js +290 -17
  127. package/dist/core/mods/kernel/registration.d.ts +33 -2
  128. package/dist/core/mods/kernel/registration.js +6 -7
  129. package/dist/core/mods/kernel/site-rules.d.ts +44 -16
  130. package/dist/core/mods/kernel/site-rules.js +24 -42
  131. package/dist/core/mods/spec-seats.d.ts +69 -0
  132. package/dist/core/mods/spec-seats.js +114 -0
  133. package/dist/core/mods/stations.d.ts +28 -8
  134. package/dist/core/mods/stations.js +29 -13
  135. package/dist/core/mods/tool-call.d.ts +79 -0
  136. package/dist/core/mods/tool-call.js +152 -0
  137. package/dist/core/namespaced-rule-name.d.ts +32 -38
  138. package/dist/core/namespaced-rule-name.js +29 -36
  139. package/dist/core/parent-spec-seat.d.ts +6 -1
  140. package/dist/core/parent-spec-seat.js +2 -0
  141. package/dist/core/park-selfcheck.js +3 -0
  142. package/dist/core/permission-rule-consent.d.ts +24 -3
  143. package/dist/core/permission-rule-consent.js +136 -41
  144. package/dist/core/permission-rule-model.d.ts +57 -5
  145. package/dist/core/permission-rule-model.js +90 -31
  146. package/dist/core/permission-rule-org.d.ts +6 -2
  147. package/dist/core/permission-rule-org.js +8 -4
  148. package/dist/core/permission-rule-provider.d.ts +5 -2
  149. package/dist/core/permission-rule-provider.js +41 -11
  150. package/dist/core/permission-rule-store.d.ts +3 -2
  151. package/dist/core/permission-rule-store.js +11 -2
  152. package/dist/core/permission-rule-sync.js +3 -2
  153. package/dist/core/permission-rule-syntax.d.ts +5 -4
  154. package/dist/core/permission-rule-syntax.js +2 -2
  155. package/dist/core/permission-rules.d.ts +4 -4
  156. package/dist/core/permission-rules.js +11 -20
  157. package/dist/core/persisted-rule-arms.d.ts +2 -2
  158. package/dist/core/persisted-rule-arms.js +10 -12
  159. package/dist/core/principal-name.d.ts +20 -0
  160. package/dist/core/principal-name.js +22 -0
  161. package/dist/core/prompt-section-seat.js +4 -6
  162. package/dist/core/protocol-http-auth.d.ts +40 -5
  163. package/dist/core/protocol-http-auth.js +168 -4
  164. package/dist/core/protocol-naming.d.ts +20 -0
  165. package/dist/core/protocol-naming.js +20 -3
  166. package/dist/core/read-only-shell.d.ts +20 -5
  167. package/dist/core/read-only-shell.js +29 -14
  168. package/dist/core/remote-env.d.ts +37 -1
  169. package/dist/core/remote-env.js +11 -0
  170. package/dist/core/resume-startup-cause.d.ts +24 -2
  171. package/dist/core/resume-startup-cause.js +20 -1
  172. package/dist/core/retired-keys.d.ts +16 -0
  173. package/dist/core/retired-keys.js +16 -4
  174. package/dist/core/rewrite-rejudge.d.ts +60 -0
  175. package/dist/core/rewrite-rejudge.js +36 -0
  176. package/dist/core/roles.d.ts +28 -1
  177. package/dist/core/roles.js +81 -26
  178. package/dist/core/rule-lane-reads.d.ts +20 -15
  179. package/dist/core/rule-lane-reads.js +45 -17
  180. package/dist/core/rule-owner.d.ts +3 -3
  181. package/dist/core/rule-owner.js +3 -2
  182. package/dist/core/runner/announce-once-ledger.d.ts +14 -0
  183. package/dist/core/runner/announce-once-ledger.js +5 -0
  184. package/dist/core/runner/assemble-result.d.ts +1 -0
  185. package/dist/core/runner/assemble-result.js +1 -1
  186. package/dist/core/runner/call-hook-stations.d.ts +3 -2
  187. package/dist/core/runner/caller-roster.d.ts +16 -4
  188. package/dist/core/runner/caller-roster.js +33 -6
  189. package/dist/core/runner/capability-withheld-seat.d.ts +5 -0
  190. package/dist/core/runner/capability-withheld-seat.js +24 -0
  191. package/dist/core/runner/classifier-ladder.d.ts +7 -9
  192. package/dist/core/runner/classifier-ladder.js +3 -3
  193. package/dist/core/runner/compact-session.d.ts +10 -0
  194. package/dist/core/runner/compact-session.js +202 -0
  195. package/dist/core/runner/compaction-call-options.d.ts +2 -2
  196. package/dist/core/runner/compaction-seams.d.ts +21 -1
  197. package/dist/core/runner/compaction-seams.js +11 -8
  198. package/dist/core/runner/construction-doors.js +3 -0
  199. package/dist/core/runner/contracts.d.ts +50 -40
  200. package/dist/core/runner/cross-boundary-lane.d.ts +17 -13
  201. package/dist/core/runner/cross-boundary-lane.js +40 -27
  202. package/dist/core/runner/denial-limit-arms.d.ts +2 -2
  203. package/dist/core/runner/denial-limit-arms.js +1 -1
  204. package/dist/core/runner/derived-route-fallback.d.ts +13 -0
  205. package/dist/core/runner/derived-route-fallback.js +6 -0
  206. package/dist/core/runner/env-capability-census.d.ts +3 -2
  207. package/dist/core/runner/env-capability-census.js +9 -3
  208. package/dist/core/runner/file-history-request.d.ts +18 -0
  209. package/dist/core/runner/file-history-request.js +21 -13
  210. package/dist/core/runner/file-history-restore.d.ts +45 -0
  211. package/dist/core/runner/file-history-restore.js +46 -0
  212. package/dist/core/runner/gate-exit.d.ts +3 -3
  213. package/dist/core/runner/gate-exit.js +4 -3
  214. package/dist/core/runner/image.d.ts +7 -17
  215. package/dist/core/runner/image.js +9 -60
  216. package/dist/core/runner/permission-rule-lanes.d.ts +11 -11
  217. package/dist/core/runner/permission-rule-lanes.js +39 -17
  218. package/dist/core/runner/person-path-rows.d.ts +12 -9
  219. package/dist/core/runner/person-path-rows.js +18 -7
  220. package/dist/core/runner/prepare-acquire-reconcile.d.ts +3 -0
  221. package/dist/core/runner/prepare-acquire-reconcile.js +2 -1
  222. package/dist/core/runner/prepare-ask-lane.d.ts +2 -2
  223. package/dist/core/runner/prepare-ask-lane.js +5 -2
  224. package/dist/core/runner/prepare-caps-and-workflow.d.ts +4 -6
  225. package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
  226. package/dist/core/runner/prepare-config-doors.d.ts +35 -38
  227. package/dist/core/runner/prepare-config-doors.js +46 -28
  228. package/dist/core/runner/prepare-defer-classify.d.ts +4 -3
  229. package/dist/core/runner/prepare-defer-classify.js +7 -8
  230. package/dist/core/runner/prepare-file-history.d.ts +48 -8
  231. package/dist/core/runner/prepare-file-history.js +7 -39
  232. package/dist/core/runner/prepare-gate-stations.d.ts +1 -1
  233. package/dist/core/runner/prepare-gate-stations.js +10 -1
  234. package/dist/core/runner/prepare-hands-readface.d.ts +5 -9
  235. package/dist/core/runner/prepare-hands-readface.js +17 -14
  236. package/dist/core/runner/prepare-inherited-gate.d.ts +6 -3
  237. package/dist/core/runner/prepare-inherited-gate.js +5 -3
  238. package/dist/core/runner/prepare-memory-engine-session.js +1 -1
  239. package/dist/core/runner/prepare-park-ask.d.ts +2 -0
  240. package/dist/core/runner/prepare-park-ask.js +7 -7
  241. package/dist/core/runner/prepare-policy-chain.d.ts +6 -3
  242. package/dist/core/runner/prepare-policy-chain.js +67 -76
  243. package/dist/core/runner/prepare-prompt-assembly.d.ts +5 -7
  244. package/dist/core/runner/prepare-prompt-assembly.js +10 -8
  245. package/dist/core/runner/prepare-prompt-inputs.d.ts +11 -9
  246. package/dist/core/runner/prepare-prompt-inputs.js +3 -5
  247. package/dist/core/runner/prepare-protocol-tools.d.ts +2 -0
  248. package/dist/core/runner/prepare-protocol-tools.js +3 -3
  249. package/dist/core/runner/prepare-safety-scan.d.ts +1 -1
  250. package/dist/core/runner/prepare-safety-scan.js +0 -17
  251. package/dist/core/runner/prepare-suspend-saga.d.ts +2 -0
  252. package/dist/core/runner/prepare-suspend-saga.js +5 -6
  253. package/dist/core/runner/prepare-task.d.ts +5 -2
  254. package/dist/core/runner/prepare-task.js +48 -43
  255. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +20 -4
  256. package/dist/core/runner/prepare-tool-disclosure-mount.js +33 -23
  257. package/dist/core/runner/prepare-turn-wiring.d.ts +0 -4
  258. package/dist/core/runner/prepare-turn-wiring.js +2 -7
  259. package/dist/core/runner/prepare-wiring-manifest.d.ts +6 -2
  260. package/dist/core/runner/prepare-wiring-manifest.js +3 -3
  261. package/dist/core/runner/resume-admission.js +1 -1
  262. package/dist/core/runner/resume-apply.js +11 -12
  263. package/dist/core/runner/resume-checkpoint-screen.js +3 -0
  264. package/dist/core/runner/resume-claim.d.ts +4 -2
  265. package/dist/core/runner/resume-claim.js +15 -8
  266. package/dist/core/runner/retired-runner-deps.js +1 -0
  267. package/dist/core/runner/rewind-files.d.ts +12 -0
  268. package/dist/core/runner/rewind-files.js +90 -0
  269. package/dist/core/runner/run-attachment-seats.js +2 -1
  270. package/dist/core/runner/run-brain-sinks.d.ts +4 -1
  271. package/dist/core/runner/run-brain-sinks.js +4 -2
  272. package/dist/core/runner/run-harness-handlers.js +12 -4
  273. package/dist/core/runner/run-leg.d.ts +1 -1
  274. package/dist/core/runner/run-leg.js +40 -39
  275. package/dist/core/runner/run-notification-lane.d.ts +2 -0
  276. package/dist/core/runner/run-notification-lane.js +2 -2
  277. package/dist/core/runner/run-recovery-lanes.js +3 -4
  278. package/dist/core/runner/run-settle-and-teardown.js +7 -12
  279. package/dist/core/runner/run-terminal-adoption.js +3 -4
  280. package/dist/core/runner/run-turn-boundary.js +4 -15
  281. package/dist/core/runner/runtask.d.ts +10 -0
  282. package/dist/core/runner/runtask.js +35 -42
  283. package/dist/core/runner/send-message-continuation.js +1 -1
  284. package/dist/core/runner/session-read-file-states.d.ts +15 -0
  285. package/dist/core/runner/session-read-file-states.js +28 -0
  286. package/dist/core/runner/session-rule-policy.js +4 -3
  287. package/dist/core/runner/session-verb-doors.d.ts +28 -0
  288. package/dist/core/runner/session-verb-doors.js +48 -0
  289. package/dist/core/runner/session-write-ledger.d.ts +30 -0
  290. package/dist/core/runner/session-write-ledger.js +101 -0
  291. package/dist/core/runner/shell-env-withheld.d.ts +33 -0
  292. package/dist/core/runner/shell-env-withheld.js +51 -0
  293. package/dist/core/runner/skills-seat.js +6 -2
  294. package/dist/core/runner/stream-settle-backstop.js +12 -15
  295. package/dist/core/runner/sub-agent-deny-lists.d.ts +25 -3
  296. package/dist/core/runner/sub-agent-deny-lists.js +25 -17
  297. package/dist/core/runner/synthetic-tools.d.ts +6 -0
  298. package/dist/core/runner/synthetic-tools.js +4 -1
  299. package/dist/core/runner/teardown-bounded.d.ts +1 -0
  300. package/dist/core/runner/teardown-bounded.js +1 -0
  301. package/dist/core/runner/tool-disclosure.d.ts +10 -12
  302. package/dist/core/runner/tool-disclosure.js +1 -3
  303. package/dist/core/runner/tool-end-body.d.ts +1 -1
  304. package/dist/core/runner/tool-end-body.js +10 -9
  305. package/dist/core/runner/tool-not-executed.d.ts +5 -0
  306. package/dist/core/runner/tool-not-executed.js +11 -0
  307. package/dist/core/runner/tool-occurrence.d.ts +8 -0
  308. package/dist/core/runner/tool-occurrence.js +7 -0
  309. package/dist/core/runner/turn-attachments.d.ts +33 -15
  310. package/dist/core/runner/turn-attachments.js +62 -37
  311. package/dist/core/runner-deps.d.ts +7 -7
  312. package/dist/core/safety-axis-vocab.d.ts +6 -4
  313. package/dist/core/safety-axis-vocab.js +6 -5
  314. package/dist/core/safety-merge-corpus.js +11 -3
  315. package/dist/core/secret-env.d.ts +30 -3
  316. package/dist/core/secret-env.js +47 -8
  317. package/dist/core/select-model.js +3 -3
  318. package/dist/core/session-policy-store.d.ts +32 -15
  319. package/dist/core/session-policy-store.js +156 -36
  320. package/dist/core/session-store.d.ts +29 -10
  321. package/dist/core/session-store.js +51 -19
  322. package/dist/core/session.d.ts +82 -16
  323. package/dist/core/session.js +53 -0
  324. package/dist/core/shell-read-silence.d.ts +11 -12
  325. package/dist/core/shell-read-silence.js +9 -5
  326. package/dist/core/shell-run-candidates.js +3 -1
  327. package/dist/core/shell-wrapper-projection.d.ts +1 -1
  328. package/dist/core/shell-wrapper-projection.js +1 -1
  329. package/dist/core/shell-wrapper-table.d.ts +14 -7
  330. package/dist/core/shell-wrapper-table.js +5 -4
  331. package/dist/core/side-query.js +10 -1
  332. package/dist/core/skill-grant.d.ts +7 -2
  333. package/dist/core/skill-grant.js +5 -0
  334. package/dist/core/skills-directory.js +6 -2
  335. package/dist/core/store-contracts/background-agent-store-contract.js +1 -0
  336. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +11 -1
  337. package/dist/core/store-contracts/checkpoint-store-contract.js +141 -2
  338. package/dist/core/store-contracts/file-history-store-contract.js +40 -1
  339. package/dist/core/store-contracts/mailbox-store-contract.js +49 -1
  340. package/dist/core/store-contracts/peer-directory-contract.d.ts +7 -2
  341. package/dist/core/store-contracts/peer-directory-contract.js +14 -2
  342. package/dist/core/store-contracts/session-repo-contract.js +51 -0
  343. package/dist/core/store-contracts/session-store-contract.d.ts +2 -1
  344. package/dist/core/store-contracts/session-store-contract.js +150 -14
  345. package/dist/core/stub-env.d.ts +2 -0
  346. package/dist/core/stub-env.js +1 -0
  347. package/dist/core/synthetic-read-verdict.js +3 -3
  348. package/dist/core/task-event.d.ts +32 -4
  349. package/dist/core/task-notification.d.ts +16 -12
  350. package/dist/core/task-registry-agent.d.ts +8 -4
  351. package/dist/core/task-registry-agent.js +14 -8
  352. package/dist/core/task-registry-shared.d.ts +35 -6
  353. package/dist/core/task-registry-shared.js +11 -0
  354. package/dist/core/task-registry.d.ts +10 -1
  355. package/dist/core/task-registry.js +12 -2
  356. package/dist/core/task-result.d.ts +18 -0
  357. package/dist/core/task-spec.d.ts +18 -13
  358. package/dist/core/tighten-task-spec.js +2 -1
  359. package/dist/core/tool-catalog-entries.d.ts +23 -0
  360. package/dist/core/tool-catalog-entries.js +14 -2
  361. package/dist/core/tool-check-reading.d.ts +11 -0
  362. package/dist/core/tool-check-reading.js +11 -6
  363. package/dist/core/tool-model-gate.d.ts +2 -2
  364. package/dist/core/tool-name-aliases.d.ts +48 -18
  365. package/dist/core/tool-name-aliases.js +36 -19
  366. package/dist/core/tool-name-readings.d.ts +6 -32
  367. package/dist/core/tool-name-readings.js +2 -9
  368. package/dist/core/tool-policy.d.ts +78 -204
  369. package/dist/core/tool-policy.js +152 -204
  370. package/dist/core/tool-result-store.js +3 -0
  371. package/dist/core/tool-roster.d.ts +14 -19
  372. package/dist/core/tool-roster.js +11 -44
  373. package/dist/core/tool-spec-members.js +7 -2
  374. package/dist/core/tool-spec.d.ts +19 -11
  375. package/dist/core/tools.js +49 -9
  376. package/dist/core/trace.d.ts +6 -3
  377. package/dist/core/trace.js +2 -1
  378. package/dist/core/types.d.ts +1 -1
  379. package/dist/core/untrusted-egress.d.ts +20 -0
  380. package/dist/core/untrusted-egress.js +77 -3
  381. package/dist/core/user-attachment.d.ts +8 -1
  382. package/dist/core/user-attachment.js +64 -4
  383. package/dist/core/wiring-manifest.d.ts +9 -0
  384. package/dist/core/wiring-manifest.js +1 -0
  385. package/dist/core/workflow-journal-store.js +1 -1
  386. package/dist/engine/compaction/compaction.js +3 -2
  387. package/dist/engine/execution-env/node-execution-env.d.ts +7 -3
  388. package/dist/engine/execution-env/node-execution-env.js +11 -2
  389. package/dist/engine/harness/agent-harness.d.ts +32 -6
  390. package/dist/engine/harness/agent-harness.js +65 -9
  391. package/dist/engine/harness/types.d.ts +29 -2
  392. package/dist/engine/llm/types.d.ts +28 -11
  393. package/dist/engine/loop/agent-loop.d.ts +23 -4
  394. package/dist/engine/loop/agent-loop.js +42 -30
  395. package/dist/engine/loop/types.d.ts +16 -6
  396. package/dist/engine/session/memory-repo.d.ts +9 -2
  397. package/dist/engine/session/memory-repo.js +11 -1
  398. package/dist/engine/session/repo-utils.d.ts +6 -5
  399. package/dist/engine/session/repo-utils.js +14 -6
  400. package/dist/index.d.ts +34 -17
  401. package/dist/index.js +22 -11
  402. package/dist/internal/harness-types.d.ts +1 -1
  403. package/dist/internal/harness.d.ts +2 -1
  404. package/dist/internal/harness.js +1 -0
  405. package/dist/internal/llm.d.ts +1 -1
  406. package/dist/orchestration/run-workflow-tool.d.ts +6 -4
  407. package/dist/orchestration/run-workflow-tool.js +5 -3
  408. package/dist/orchestration/workflow.d.ts +3 -0
  409. package/dist/orchestration/workflow.js +36 -18
  410. package/dist/primitives/credential-ref.d.ts +89 -0
  411. package/dist/primitives/credential-ref.js +125 -0
  412. package/dist/primitives/index.d.ts +2 -0
  413. package/dist/primitives/index.js +1 -0
  414. package/dist/prompt-assembly/artifact.d.ts +2 -2
  415. package/dist/prompt-assembly/artifact.js +5 -3
  416. package/dist/prompt-assembly/assemble.d.ts +3 -2
  417. package/dist/prompt-assembly/assemble.js +1 -1
  418. package/dist/prompt-assembly/catalog/schema.d.ts +43 -12
  419. package/dist/prompt-assembly/catalog/schema.js +34 -2
  420. package/dist/prompt-assembly/catalog/sections.js +0 -1
  421. package/dist/prompt-assembly/composer.d.ts +3 -1
  422. package/dist/prompt-assembly/composer.js +1 -1
  423. package/dist/prompt-assembly/event-registry.js +1 -0
  424. package/dist/prompt-assembly/overlay.js +3 -3
  425. package/dist/prompt-assembly/renderers.d.ts +1 -1
  426. package/dist/prompt-assembly/renderers.js +0 -3
  427. package/dist/prompt-assembly/role-base.d.ts +15 -0
  428. package/dist/prompt-assembly/role-base.js +9 -0
  429. package/dist/prompt-assembly/select.d.ts +39 -14
  430. package/dist/prompt-assembly/select.js +47 -16
  431. package/dist/prompt-assembly/sugar.d.ts +17 -11
  432. package/dist/prompt-assembly/sugar.js +8 -3
  433. package/dist/prompt-assembly/tool-catalog.d.ts +37 -3
  434. package/dist/prompt-assembly/tool-catalog.js +114 -4
  435. package/dist/prompt-assembly/turn-snapshot.d.ts +4 -10
  436. package/dist/prompt-assembly/turn-snapshot.js +0 -3
  437. package/dist/prompt-assembly/types.d.ts +0 -7
  438. package/dist/scenarios/full-body.d.ts +11 -11
  439. package/dist/scenarios/full-body.js +4 -3
  440. package/dist/shell/lex.js +10 -1
  441. package/dist/stores/file/adoption/adopt.js +4 -3
  442. package/dist/stores/file/adoption/marker.js +3 -2
  443. package/dist/stores/file/checkpoint-store.d.ts +21 -4
  444. package/dist/stores/file/checkpoint-store.js +38 -7
  445. package/dist/stores/file/file-history-store.js +18 -11
  446. package/dist/stores/file/index.js +2 -1
  447. package/dist/stores/file/mailbox-store.d.ts +2 -1
  448. package/dist/stores/file/mailbox-store.js +26 -1
  449. package/dist/stores/file/permission-rule-adopt.js +4 -3
  450. package/dist/stores/file/permission-rule-store.js +11 -5
  451. package/dist/stores/file/session-store.d.ts +29 -6
  452. package/dist/stores/file/session-store.js +42 -50
  453. package/dist/tools/artifact/artifact-tool.js +3 -2
  454. package/dist/tools/fs/bash-program-position.d.ts +19 -2
  455. package/dist/tools/fs/bash-program-position.js +56 -9
  456. package/dist/tools/fs/bash-readonly-classifier.d.ts +15 -19
  457. package/dist/tools/fs/bash-readonly-classifier.js +5 -10
  458. package/dist/tools/fs/fs-bash.js +15 -8
  459. package/dist/tools/fs/fs-glob.d.ts +86 -0
  460. package/dist/tools/fs/fs-glob.js +226 -0
  461. package/dist/tools/fs/fs-read.js +14 -14
  462. package/dist/tools/fs/fs-search-tools.js +7 -7
  463. package/dist/tools/fs/pattern-kill-guard.d.ts +23 -0
  464. package/dist/tools/fs/pattern-kill-guard.js +429 -0
  465. package/dist/tools/fs/pdf.d.ts +9 -6
  466. package/dist/tools/fs/pdf.js +3 -3
  467. package/dist/tools/fs/program-read-model.d.ts +57 -7
  468. package/dist/tools/fs/program-read-model.js +11 -1
  469. package/dist/tools/fs/program-read-model.rows.js +78 -21
  470. package/dist/tools/fs/read-deny-home.js +3 -2
  471. package/dist/tools/fs/removal-targets.d.ts +17 -7
  472. package/dist/tools/fs/removal-targets.js +47 -20
  473. package/dist/tools/fs/search.d.ts +10 -0
  474. package/dist/tools/fs/search.js +20 -26
  475. package/dist/tools/fs/shell-read-argv.js +89 -12
  476. package/dist/tools/fs/shell-read-bindings.d.ts +31 -0
  477. package/dist/tools/fs/shell-read-bindings.js +41 -0
  478. package/dist/tools/fs/shell-read-check.d.ts +10 -0
  479. package/dist/tools/fs/shell-read-check.js +13 -20
  480. package/dist/tools/fs/shell-read-environment.d.ts +5 -1
  481. package/dist/tools/fs/shell-read-environment.js +3 -2
  482. package/dist/tools/fs/shell-read-establish.d.ts +15 -0
  483. package/dist/tools/fs/shell-read-establish.js +19 -20
  484. package/dist/tools/fs/shell-read-identity.d.ts +12 -9
  485. package/dist/tools/fs/shell-read-identity.js +9 -4
  486. package/dist/tools/fs/shell-read-plan.js +24 -16
  487. package/dist/tools/fs/shell-read-start.d.ts +6 -1
  488. package/dist/tools/fs/shell-read-write-targets.d.ts +5 -1
  489. package/dist/tools/fs/shell-read-write-targets.js +2 -3
  490. package/dist/tools/fs/shell-reentry-text.d.ts +9 -0
  491. package/dist/tools/fs/shell-reentry-text.js +40 -2
  492. package/dist/tools/todo.js +63 -63
  493. package/dist/tools/web.d.ts +19 -14
  494. package/dist/tools/web.js +46 -61
  495. package/package.json +1 -1
  496. package/test/export-surface.snapshot.json +221 -7
  497. package/wire-changes/core-stores-sql@7.57.0.json +29 -0
  498. package/wire-changes/core@7.56.0.json +3891 -0
  499. package/wire-changes/core@7.57.0.json +1487 -0
  500. package/wire-changes/mods-kernel@7.56.0.json +303 -0
  501. package/wire-changes/mods-kernel@7.57.0.json +29 -0
  502. package/wire-changes/primitives@7.57.0.json +245 -0
@@ -1,4 +1,5 @@
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";
@@ -36,7 +37,8 @@ export interface ToolCallFace {
36
37
  approvalCard?: import("./tool-face.js").ToolApprovalCard;
37
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
38
39
  * the engine minted for the leg, never a caller's `TaskSpec.tools` entry or a protocol peer's tool (`engineMountedRow`). The one
39
- * identity a caller cannot wear: a name and a contract id can be declared. Absent on a face rebuilt from a park row. */
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. */
40
42
  engineMounted?: true;
41
43
  }
42
44
  export interface ToolCallRequest {
@@ -227,81 +229,7 @@ export declare function exemptRootsSeat(exemptRoots: readonly string[]): {
227
229
  /** Declared beside the receipt's list (decision-receipt.ts) — a new member added to either side is a compile error rather
228
230
  * than a silent drift between the type and the screen; re-exported here, the module every consumer of the decision reads. */
229
231
  export type { DecisionReason };
230
- /**
231
- * The engine's ATTESTATION record — the one carrier of what an engine station knows about a decision and a policy cannot
232
- * state: WHO settled the call's wait and WHICH question that answered (the settlement, the ask's origin word and class set,
233
- * the digest of the arguments the answer licenses), and the facts the classifier stations, the in-fold unresolvable arms
234
- * and the policy fold record. It rides the decision as its `attestation` member and is read through {@link attestationOf}
235
- * alone; the decision object's identity carries nothing.
236
- *
237
- * Minted only by {@link mintAttestation} and combined only by {@link mergeAttestation}: both freeze the record and enter it
238
- * in a module-private brand set, so a value a caller composed — a literal, a copy, a structured clone — is not a record, and
239
- * the receipt refuses a decision carrying one. A record is bound to the call it was minted for (`toolCallId` + `toolName`):
240
- * handed back for another call it reads as absent. A spread of a decision keeps its record, and the record still says only
241
- * what the engine minted — a refusal record on an allow is a contradiction the gate's exit refuses, and a resolution's
242
- * answer binds the arguments it licensed (`inputDigest`).
243
- */
244
- export interface EngineAttestation {
245
- readonly toolCallId: string;
246
- readonly toolName: string;
247
- /** What ended the call's wait. The answer group — `settlement`, `origin`, `classes`, `inputDigest` — travels as one. */
248
- readonly settlement?: Settlement;
249
- /** The settled ask's origin word. */
250
- readonly origin?: AskOrigin;
251
- /** The settled ask's class set (`ASK_CLASSES` order), when the minting station held one. */
252
- readonly classes?: readonly import("./ask-origin.js").AskClass[];
253
- /** `exactBoundInputHashOf` of the arguments the settlement licenses (an approver's edit, the snapshot shown, or the asked
254
- * args); absent when they have none (outside the bindable domain) — such a record licenses no bytes. */
255
- readonly inputDigest?: string;
256
- /** The FORM of a classifier round that did not rule (a classifier deny's cause). */
257
- readonly classifierCause?: import("./gate-outcome.js").ClassifierDenyCause;
258
- /** WHICH model answered a classification, on either arm. */
259
- readonly classifierRound?: import("./auto-mode.js").AutoModeClassifierRound;
260
- /** Why an in-fold deny refused an ask nobody could resolve. */
261
- readonly unresolvableCause?: import("./ask-unresolvable-notice.js").AskUnresolvableCause;
262
- /** The classes of the asks a policy fold collapsed — the proof behind a decision's `foldedAskClasses`. */
263
- readonly foldedClasses?: readonly import("./ask-origin.js").AskClass[];
264
- /** 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
265
- * exit mints the refusal's card from it; the judge that found the row is its only writer. */
266
- readonly pathDenial?: import("../tools/fs/safety.js").PathDenialEvidence;
267
- /** A seat refused the call's arguments because no approval can be bound to them ({@link bindableArgsOf}): the refusal's
268
- * sentence, carried by the refusal itself — the gate's deny exit reads it (the remedy it gives) instead of judging again. */
269
- readonly bindingRefusal?: string;
270
- }
271
- /** The members a station attests — everything but the call binding. */
272
- export type AttestationMembers = Omit<EngineAttestation, "toolCallId" | "toolName">;
273
- /** Mint a record for `call`. Engine stations only: not re-exported from `src/index.ts`. The values are DETACHED snapshots, so a
274
- * caller that later mutates the settlement object it was handed cannot rewrite what the engine attests. */
275
- export declare function mintAttestation(call: {
276
- toolCallId: string;
277
- toolName: string;
278
- }, members: AttestationMembers): EngineAttestation;
279
- /** Is `v` a record the engine minted (the brand alone — no binding)? The receipt's test. */
280
- export declare function isEngineAttestation(v: unknown): v is EngineAttestation;
281
- /** THE read: the record `d` carries FOR `call` — a branded record bound to that call, else `undefined` (a record bound to
282
- * another call is a replayed one and reads as absent). Read off the own data member, never through an accessor. */
283
- export declare function attestationOf(d: unknown, call: {
284
- toolCallId: string;
285
- toolName: string;
286
- }): EngineAttestation | undefined;
287
- /**
288
- * Combine two records for `call`, member GROUP by group: the later record's group stands where it has one, the earlier's
289
- * fills a group the later lacks. A record not bound to `call` contributes nothing. `answer` scope is the veto's merge: the
290
- * earlier record contributes ONLY its answer, and only when the later carries none — a person's yes rides a later layer's
291
- * deny (invariant I3) while the refusing station's own facts stay its own.
292
- */
293
- export declare function mergeAttestation(call: {
294
- toolCallId: string;
295
- toolName: string;
296
- }, earlier: EngineAttestation | undefined, later: EngineAttestation | undefined, scope?: "all" | "answer"): EngineAttestation | undefined;
297
- /** `d` with `members` attested for `call`, merged over the record it already carries for that call (the new members' groups
298
- * win). Always a fresh object — the receipt hands out frozen ones. */
299
- export declare function attest<T extends object>(d: T, call: {
300
- toolCallId: string;
301
- toolName: string;
302
- }, members: AttestationMembers): T;
303
- /** `d` carrying `record` (a fresh object), or `d` itself when there is no record to put on it. */
304
- 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";
305
233
  /** The `no_approver`-attested deny an engine policy answers on a request that states nobody can be asked about it
306
234
  * ({@link ToolCallRequest.approvalReach}) instead of reaching a seat — read by a probe as "would ask an approver". */
307
235
  export declare function noApproverSeatDeny(req: {
@@ -349,7 +277,7 @@ export declare function screenApproverAttribution(v: unknown): {
349
277
  approver?: string;
350
278
  defect?: string;
351
279
  };
352
- /** 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}). */
353
281
  export type AskGuard = "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "artifact_shared_read";
354
282
  /**
355
283
  * A three-state permission decision for a tool call (design/37). Upgrades the old two-state
@@ -416,9 +344,9 @@ export type PermissionResult = {
416
344
  classifierNoRuling?: import("./auto-mode.js").AutoModeFallbackCause;
417
345
  /** The allow layer's DISCLOSURE: the members that MATCHED this call and could not clear the ask (it is a class
418
346
  * no allow rule clears — a mandated, governance, hook, ask-rule or mode question — or the call reached the layer
419
- * marked), one record per member ({@link AllowRuleShadow}). ENGINE-STAMPED by the allow layer, overwriting a
420
- * policy's own value; a DISPLAY member: the approval card and the park row render it, nothing reads it to
421
- * 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. */
422
350
  allowRuleShadowed?: readonly import("./allow-rule-shadow.js").AllowRuleShadow[];
423
351
  /** backlog #239 disclosure (additive): WHY the reversibility probe did not clear this call, in the
424
352
  * probe's own words. ENGINE-STAMPED at the irreversibility tighten (which constructs this decision
@@ -429,6 +357,11 @@ export type PermissionResult = {
429
357
  * {@link allowRuleShadowed}: a policy that self-declares it can only put its own prose on its
430
358
  * own card — nothing reads this member to decide anything, so it is not an authority channel. */
431
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;
432
365
  /** backlog #239 disclosure (additive): the STRUCTURED cause, for a probe whose verdict this engine
433
366
  * understands (see {@link import("./checkpoint-store.js").ProbeCause}). Engine-stamped and
434
367
  * validated at the irreversibility tighten; same display-only posture as the prose sibling. */
@@ -457,8 +390,8 @@ export type PermissionResult = {
457
390
  * set, and a policy self-declaring it only opts its own ask OUT of automatic answering. Carried
458
391
  * onto the approval request as {@link AskRequest.mandated}. */
459
392
  mandated?: true;
460
- /** The TABLE WORD the {@link mandated} bit stands on — see {@link AskRequest.mandate}. ENGINE-STAMPED at
461
- * 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. */
462
395
  mandate?: import("./ask-origin.js").PersistedRuleMandate;
463
396
  /** The probe named a directory that would clear this ask
464
397
  * ({@link import("./types.js").ReversibilityVerdict.readRootCandidate}). Display metadata like the two
@@ -479,47 +412,33 @@ export type PermissionResult = {
479
412
  * list) that leaves it unset gets `policy` there, indistinguishable from hesitation. */
480
413
  matchedAskRule?: string;
481
414
  /** design/252 G-2 (additive): the RULE-PROVENANCE evidence behind this ask — see
482
- * {@link AskRuleEvidence}. ENGINE-STAMPED inside the gate, once, after the org layer and the
483
- * persisted-rule lane have both spoken; a policy that self-declares it is overwritten there
484
- * (the member is a record of what the ENGINE's own governance layers did, so a layer's claim
485
- * about itself is not evidence). Carried onto the approval request by the gate's own ask mint
486
- * 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. */
487
419
  ruleEvidence?: AskRuleEvidence;
488
420
  /** design/375 §5.2②: the per-segment coverage table behind this surviving ask — which segments
489
421
  * of a compound an eligible persisted rule already admits, read off the SAME store read that
490
- * adjudicated the call (snapshot = adjudication snapshot). ENGINE-STAMPED at the gate's one
491
- * stamp point whenever the persisted-rule lane reported one (overwriting a policy's claim);
492
- * consumed only by the offer factory, which puts on the batch offer exactly the segments this
493
- * table calls uncovered. Absent ⇒ all segments read as uncovered (over-offer, the safe way).
494
- * Same display-only posture as {@link allowRuleShadowed}: never adjudication input, and a
495
- * value nobody stamps over can only shrink or annotate the card's ADVISORY offers — every
496
- * 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). */
497
426
  segmentCoverage?: readonly import("./permission-rule-model.js").SegmentCoverage[];
498
427
  /** WHICH AUTHORITY raised this ask — one word from the closed {@link import("./ask-origin.js").AskOrigin}
499
428
  * set (org rule / org unavailable / hook / explicit ask rule / the classifier's denial-limit
500
- * 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
501
430
  * gate at the same single stamp point as `ruleEvidence`, derived from what the gate's own layers
502
- * did ({@link import("./ask-origin.js").askOriginOf}) — a policy that self-declares it is overwritten
503
- * there, so the member is never a channel a policy can loosen through. A DISCLOSURE word: the lanes
504
- * read the ask's class set ({@link import("./ask-origin.js").classifyAsk}), an approval surface may
505
- * render the card by it. Optional on the TYPE only because a decision is caller-composable; every ask
506
- * 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. */
507
434
  origin?: import("./ask-origin.js").AskOrigin;
508
- /** The ask's CLASS — the first member of {@link classes} (see {@link AskRequest.askClass}). ENGINE-STAMPED at the
509
- * same single stamp as {@link origin}, from the class set the gate's lanes read; a policy that self-declares it is
510
- * 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). */
511
438
  askClass?: import("./ask-origin.js").AskClass;
512
439
  /** The ask's whole class set, in {@link import("./ask-origin.js").ASK_CLASSES} order (see
513
440
  * {@link AskRequest.classes}). Stamped beside {@link askClass}, under the same rule. */
514
441
  classes?: readonly import("./ask-origin.js").AskClass[];
515
- /** WHICH integrity guards stand behind this ask — a removal of a protected location, an unverifiable recursive delete,
516
- * shell text the engine cannot read (or an environment that did not answer the read station), the session-transcript
517
- * write. A set: one ask may stand on several, and each keeps its class. ENGINE-STAMPED by the guard policies and the
518
- * gate fold; a fold-internal fact the class derivation reads ({@link import("./ask-origin.js").classifyAsk}) so the
519
- * guards, which mint the same `requiresRealApproval` ask, are told apart by a fact and not by their prose. Never
520
- * copied onto the approval request or the park row. Replaces the one-word `guard`, which a decision no longer carries:
521
- * a decision that still does is refused by name ({@link RETIRED_DECISION_MEMBERS}). */
522
- guards?: readonly AskGuard[];
523
442
  /** The call could not be READ against a rule that may reach it — a content-form deny row, a content-form
524
443
  * ask row, a persisted-rule row (the lexer's word), or rows the shell read station's boundary stands on that
525
444
  * could not be read (`persisted_rows`). ENGINE-STAMPED at the four unreadable mint sites;
@@ -533,13 +452,6 @@ export type PermissionResult = {
533
452
  * every ask). Public: a host composing such a policy sets it; {@link combinePolicies} carries it onto the
534
453
  * surviving ask (tighten-only). Not on the approval request — the card shows `origin` / `mandate`. */
535
454
  authoredBy?: "deployment";
536
- /** The classes of the OTHER asks a policy fold collapsed into this one
537
- * ({@link import("./ask-origin.js").decisionAskClassesOf} per contributing ask, unioned), so a member the
538
- * fold does not copy — a guard mark, an unreadable-rule fact, a bare real-approval bit — is not lost behind
539
- * the ask that won the slot. ENGINE-WRITTEN by {@link combinePolicies}, which attests the list it wrote
540
- * ({@link EngineAttestation.foldedClasses}); the receipt refuses the member unless the decision's record carries that very
541
- * list (a policy's own, an edited list are refused). Fold-internal, never on the request. */
542
- foldedAskClasses?: readonly import("./ask-origin.js").AskClass[];
543
455
  attestation?: EngineAttestation;
544
456
  } | {
545
457
  action: "deny";
@@ -781,40 +693,24 @@ export interface ToolPolicyProjection {
781
693
  readonly requiresLiveRemainder: boolean;
782
694
  }
783
695
  /**
784
- * The entries of a tool-NAME list whose reach is a set of names rather than one name — the covering
785
- * spellings (`<ns>__<peer>`, `<ns>__<peer>__<glob>`) of ANY protocol namespace, which CC's rule
786
- * matcher resolves and an exact-membership test silently cannot. Every name-keyed lane in this file
787
- * consults these ALONGSIDE its exact set: a covering spelling can never equal a minted tool name (`*`
788
- * is outside the minted charset and a minted name always carries a tool segment), so leaving it in the
789
- * exact set too costs nothing and keeps the projection/audit faces reporting the operator's own spelling.
790
- *
791
- * Namespace-generic on purpose: the covering grammar is a property of the shared `<prefix><peer>__<tool>`
792
- * name shape, not of MCP, and keying it to one prefix made every sibling-namespace covering rule
793
- * (`a2a__<peer>__*`) compile clean and match nothing — inert in the deny half, and in an ALLOW list the
794
- * removal of that peer's whole tool set.
795
- *
796
- * The list is usually empty, which is why every call site tests it before scanning.
797
- *
798
- * `behavior` = what the list does with a call it reaches: `deny` / `ask` (restricting) lists also read the whole-protocol
799
- * spelling (`mcp__*`, `mcp__*__*`) as a covering entry — every tool of the namespace — and an `allow` list does not (the
800
- * spelling names no peer there; the constructors and the prepare-time audit refuse it, and a stored allowlist reads it as nothing).
801
- *
802
- * Exported for the OTHER name-keyed lane in this engine — the persisted session/ancestor rules in
803
- * `session-rule-policy.ts`. Not part of the public API (`src/index.ts` re-exports by name and does not
804
- * list these two): every publisher of {@link ToolPolicyNameSets} must resolve a covering entry the same
805
- * way, because the prepare-time audit's exemption for these spellings speaks for ALL published name sets
806
- * at once — the four in-engine lanes do so by sharing this module's matcher. That premise is NOT
807
- * structural for an OUT-OF-ENGINE publisher (a host compiling its own settings into an exact-match ask
808
- * closure is fail-open on these spellings while the audit stays silent) — which is why the underlying
809
- * judgment predicates (`isNamespacedCoveringRuleName` / `namespacedRuleNameCovers`) ARE exported from
810
- * the package index: an external lane either compiles through `createPermissionRulePolicy` or
811
- * self-checks with those.
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.
703
+ *
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.
812
708
  */
813
- export declare function namespacedCoveringEntries(entries: readonly string[] | undefined, behavior: RuleBehavior): readonly string[];
709
+ export declare function coveringRuleEntries(entries: readonly string[] | undefined, behavior: RuleBehavior): readonly string[];
814
710
  /** Does any covering entry reach the call — under ANY name it answers to, the same reading the exact lists take through
815
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
816
- * list)? See {@link namespacedCoveringEntries}. */
817
- 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;
818
714
  /**
819
715
  * The tool names a projection component is keyed on, and the member that holds them: a `tool_deny` / `tool_allowlist`'s
820
716
  * `names`, a `shell_command`'s `tools` (its `deny` / `allow` are command names, not tool names). A frozen chain holds them only
@@ -944,53 +840,12 @@ export declare function constraintChainDigest(chain: readonly ConstraintChainEnt
944
840
  * present one must sit on an arm its row holds. Not re-exported from `src/index.ts`. */
945
841
  export type DecisionMember = PermissionResult extends infer U ? (U extends unknown ? keyof U : never) : never;
946
842
  export declare const DECISION_MEMBERS: readonly DecisionMember[];
947
- /**
948
- * The RECEIPT of a permission decision — the one point at which the engine takes a decision in from whoever composed it,
949
- * on every lane: each layer of {@link combinePolicies}' fold, the gate's adjudication entry and its approved-edit re-check,
950
- * the inherited lane's receipts of an ancestor policy's decision, the final-form re-check, the direct `check()` rechecks
951
- * (the resume edit, the park re-projection, the changed-files probe), and the PreToolUse hook's result seam (its own
952
- * reach, below). NOT re-exported from `src/index.ts`: an internal screen on inputs the engine receives.
953
- *
954
- * WHAT COMES BACK is the engine's own frozen copy, never the caller's object. A decision is caller-supplied data: a
955
- * stateful accessor, a Proxy, or a policy that keeps and mutates an object it returned could otherwise answer two
956
- * consumers with two values, and which consumer read which value would decide the call. So the caller's object is read
957
- * ONCE, here, and every station after the receipt (the fold's ranking, the origin stamp, the classifier's eligibility, the
958
- * mode arbitration, the approval request, the rewrite that executes) reads the copy; a copy handed to the screen again
959
- * 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
960
- * holding the members) has no `action`; (2) the ONE READ — ONE function ({@link receiveContract}) for the decision and for the
961
- * records it nests (`receiveNestedRecords`, decision-receipt.ts), on an ORDINARY object (a Proxy, as the carrier or anywhere on its prototype
962
- * chain, is refused before a trap of its could run): each contract member absent or an own enumerable DATA property, its value
963
- * taken off the carrier's own descriptor (a member outside the contract is neither read nor carried — a policy's self-declared
964
- * record on another name finds no reader); any other spelling refused by name — an accessor (never invoked), a member the
965
- * prototype or a non-enumerable property supplies unless that descriptor spells absence (an `undefined` data value) — judged by
966
- * descriptor, never read; (3) a retired member ({@link RETIRED_DECISION_MEMBERS}: `reason`, `guard`) carried by the same presence law as a contract
967
- * 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
968
- * one-read record, never a second read of the caller's object — the retired window absent, `action` in
969
- * 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
970
- * allow; a `canUseTool` result outside its set is a failure in CC) and `decisionReason` in {@link DECISION_REASONS} when
971
- * present (absence stays legal); (5) the DETACH —
972
- * the contract members' values structured-cloned ({@link tryCloneArgs}; one that cannot be, a function inside a rewrite,
973
- * is refused), the engine's `attestation` record re-attached by reference after its brand check, the copy frozen and
974
- * marked as this module's. A refusal is a deny in the screen's words, one code for every arm (`decisionReason: "rule"`),
975
- * carrying no `updatedInput` from the refused object (a rewrite from an EARLIER, contract-shaped layer still rides out of
976
- * {@link combinePolicies}' deny path). `null` / `undefined` carry nothing and take the carrier's refusal (the caller's own
977
- * read of `.action` would throw instead, and that throw was being reported as an aborted check).
978
- *
979
- * 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
980
- * ordinary object descriptor looks and `Object.getPrototypeOf` invoke nothing. What the receipt does not reach: code inside a
981
- * member's VALUE, run by the detach itself (an accessor inside a rewrite is invoked by the structured clone, and what it answers
982
- * 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
983
- * out-of-set `action`, after the deny is decided). Same-process JavaScript has no trust boundary a function can enforce.
984
- *
985
- * `reasonIsNonInput` (the HOOK seam): the same receipt, with the two differences the seam's consumers imply — a hook's
986
- * `decisionReason` is DISCARDED there (every mint point downstream re-stamps `"hook"`) and so is not held to its set, and a
987
- * hook result may leave `action` out (no opinion; the policy still adjudicates). `undefined`, `null` and `false` are no
988
- * opinion (what a hook body yields when it has nothing to say). A refusal the receipt mints at this seam is the ENGINE's
989
- * decision ({@link isEngineRefusal}) and exits through the engine's fail-closed arm (the deny observer), never as the hook's
990
- * own deny.
991
- */
992
843
  export declare function refuseOutOfContractDecision(d: PermissionResult, opts?: {
993
844
  reasonIsNonInput?: boolean;
845
+ call?: {
846
+ readonly toolCallId: string;
847
+ readonly toolName: string;
848
+ };
994
849
  }): PermissionResult;
995
850
  /** The raw tool-name lists a name-keyed policy was built from (audit feed, see block note above). */
996
851
  export interface ToolPolicyNameSets {
@@ -1015,9 +870,9 @@ export declare function toolPolicyNameSets(p: ToolPolicy | undefined): readonly
1015
870
  * mode's unstated question; consent is an allow entry (`RunnerDeps.allowedTools` / `TaskSpec.allowedTools`). Without
1016
871
  * `allow`, everything not in `deny` gets no objection. Each entry is read by the rule
1017
872
  * syntax (`ruleSpellingOf`): a name, or `Tool()` / `Tool(*)` — the bare `Tool`, as every list reader reads them, once however
1018
- * many spellings write it; any other spelling is not a tool name (`onInvalidName`), and neither is the wildcard `*` (`*`,
1019
- * `*()`, `*(*)`) in `deny`: it names no tool, and the entry would be kept and never match. In `allow` it is one entry no tool
1020
- * 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.
1021
876
  * Carries {@link NamedToolPolicy.nameSets} (the names as read) so the host can audit the lists against the mounted
1022
877
  * pool ([c209-E] advisory); enforcement semantics are unchanged.
1023
878
  */
@@ -1026,7 +881,7 @@ export declare function createAllowDenyPolicy(opts: {
1026
881
  deny?: string[];
1027
882
  /**
1028
883
  * What to do with an entry that is not a tool NAME: a rule CONTENT form (`Bash(ps:*)`, `Edit(src/**)`), a spelling
1029
- * 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__*`).
1030
885
  * `"throw"` (default, matching {@link createPermissionRulePolicy}'s posture toward a rule it cannot
1031
886
  * compile) refuses at construction; `"skip"` drops the entry and reports it. Under BOTH, the entry never
1032
887
  * silently narrows the allowlist.
@@ -1113,6 +968,13 @@ export declare function createApprovalPolicy(opts: {
1113
968
  * no longer covers what runs. For a tool whose permission seat is `passthrough` the gate puts the mode's question to a
1114
969
  * combined allow unless an answer covers the bytes that run ({@link answeredFor}) — the allow layer answers it there.
1115
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
+ *
1116
978
  * **Idempotency requirement:** because the fold continues past an `ask` to look for a later `deny`, a
1117
979
  * policy's `check()` can be invoked even after an earlier policy returned `ask`. `check()` MUST be
1118
980
  * idempotent — repeated calls with the same {@link ToolCallRequest} return the same decision and
@@ -1263,7 +1125,8 @@ export declare function createUnverifiableDeletePolicy(opts?: {
1263
1125
  export declare function createTranscriptIntegrityPolicy(opts?: {
1264
1126
  /** Transcript directories to protect. Default: `($AGENT_DATA_DIR ?? ~/.ai-agent)/sessions`. */
1265
1127
  sessionsDirs?: readonly string[];
1266
- /** argv[0] allowlist for read-only access to the transcript dir (default {@link BASH_READONLY_DEFAULT_ALLOW}). */
1128
+ /** The programs a read-only command over the transcript dir may run (default {@link BASH_READONLY_DEFAULT_ALLOW}); it only
1129
+ * narrows the read-only reader — a listed program whose call writes still asks. */
1267
1130
  readAllow?: readonly string[];
1268
1131
  /** Override the shell tool names this gate parses (default {@link COARSE_SHELL_TOOLS}, the shell face). */
1269
1132
  tools?: string[];
@@ -1312,6 +1175,10 @@ export interface AskRequest {
1312
1175
  * `RiskDescriptor.probeReason`. Neutralized + length-capped by the gate. UNTRUSTED-for-display,
1313
1176
  * never adjudication input. */
1314
1177
  readonly probeReason?: string;
1178
+ /** Present ⇔ this card puts a person's edit back to them: the restriction chain would not run the edit as written and
1179
+ * accepts it only as `acceptableForm` — the `args` this card presents. Approving as it stands runs exactly those bytes;
1180
+ * editing again starts a new pass; a no refuses. Engine-minted; display and outlet only, never adjudication input. */
1181
+ readonly editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
1315
1182
  /** The STRUCTURED cause behind the tighten — a machine-readable code plus the operand
1316
1183
  * families as arrays with honest totals, so this surface renders its OWN sentence rather than one the
1317
1184
  * engine had to write before the check's edge cases were known. See
@@ -1338,6 +1205,10 @@ export interface AskRequest {
1338
1205
  * RECONCILIATION metadata, never adjudication input. */
1339
1206
  readonly ruleEvidence?: AskRuleEvidence;
1340
1207
  toolCallId: string;
1208
+ /** An extension's own call (`$.tool.call`): who asked for it, for the card's line of origin ("extension X wants to run …").
1209
+ * 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
1210
+ * call a model message carried. Minted by the engine at the ask's mint; never adjudication input. */
1211
+ readonly requestedBy?: import("./task-event.js").ExtensionRequester;
1341
1212
  /** The (post-rewrite) args the tool would run with. */
1342
1213
  args: unknown;
1343
1214
  /** the tool's approval display projection of {@link args} (AgentTool.approvalPreview),
@@ -1458,13 +1329,16 @@ export interface AskRequest {
1458
1329
  * command whose exact form the validator refuses offers nothing rather than promoting a lone
1459
1330
  * prefix to index 0 — see `suggestRulesForCommand`). The seat says "this card has no rule to
1460
1331
  * offer you", which is true of both; it does not claim the grammar is empty, and a surface must
1461
- * not word it as though no rule could ever be written for the command.
1332
+ * not word it as though no rule could ever be written for the command. It is also the word of a
1333
+ * card whose tool's form mints no offer: a path tool's, a shell-face sibling's, and a tool that
1334
+ * answers to one of those under an alias.
1462
1335
  *
1463
1336
  * ABSENT is not a claim, exactly as {@link previewWithheld}'s absence is not: it also covers the
1464
- * ordinary "there are offers" case and the three STRUCTURAL doors that answer with silence on
1465
- * purpose (no rule lane wired, a tool the lane does not speak for, a task that cannot hold a rule at
1466
- * all) — a reason line on every ask of a deployment that never had the feature would be noise about
1467
- * a lane that does not exist. Read presence, never absence.
1337
+ * ordinary "there are offers" case and the STRUCTURAL door that answers with silence on purpose — no
1338
+ * rule speaks for this call: no rule lane wired, a task that cannot hold a rule at all, or a call the
1339
+ * lane does not judge (a content-routing tool the engine mounts) — a reason line on every ask of a
1340
+ * deployment that never had the feature would be noise about a lane that does not exist. Read
1341
+ * presence, never absence.
1468
1342
  *
1469
1343
  * ADVISORY disclosure metadata, never adjudication input: it changes nothing about what is allowed,
1470
1344
  * and a surface that ignores it renders exactly the card it rendered before. The durable park row