@sema-agent/core 7.52.0 → 7.54.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 (357) hide show
  1. package/CHANGELOG.md +470 -0
  2. package/LICENSE +3 -1
  3. package/README.md +3 -1
  4. package/dist/agents/cross-session-envelope.d.ts +8 -0
  5. package/dist/agents/cross-session-envelope.js +6 -0
  6. package/dist/agents/cross-session-judge.d.ts +21 -1
  7. package/dist/agents/cross-session-judge.js +8 -0
  8. package/dist/agents/cross-session-ref.d.ts +5 -0
  9. package/dist/agents/cross-session-ref.js +1 -0
  10. package/dist/agents/org-delivery-gate.d.ts +122 -0
  11. package/dist/agents/org-delivery-gate.js +69 -0
  12. package/dist/agents/peer-held-queue.d.ts +9 -4
  13. package/dist/agents/peer-held-queue.js +6 -5
  14. package/dist/agents/peer-session-drain.d.ts +35 -6
  15. package/dist/agents/peer-session-drain.js +271 -182
  16. package/dist/agents/read-inbox-tool.d.ts +7 -0
  17. package/dist/agents/read-inbox-tool.js +5 -1
  18. package/dist/agents/send-message-tool.js +3 -4
  19. package/dist/agents/subagent.d.ts +6 -5
  20. package/dist/agents/subagent.js +117 -83
  21. package/dist/agents/tool-filter.d.ts +25 -4
  22. package/dist/agents/tool-filter.js +13 -3
  23. package/dist/brain/anthropic.d.ts +6 -1
  24. package/dist/brain/anthropic.js +4 -4
  25. package/dist/brain/model-presets.js +2 -1
  26. package/dist/brain/route-adjudicator.d.ts +6 -0
  27. package/dist/brain/routing.d.ts +24 -1
  28. package/dist/brain/routing.js +54 -19
  29. package/dist/brain/timeout.js +5 -4
  30. package/dist/core/a2a.d.ts +5 -2
  31. package/dist/core/a2a.js +33 -14
  32. package/dist/core/allow-entry.d.ts +3 -1
  33. package/dist/core/allow-entry.js +3 -2
  34. package/dist/core/approval-object.d.ts +87 -0
  35. package/dist/core/approval-object.js +85 -0
  36. package/dist/core/arg-summary.d.ts +3 -2
  37. package/dist/core/arg-summary.js +17 -11
  38. package/dist/core/ask-origin.d.ts +43 -27
  39. package/dist/core/ask-origin.js +20 -11
  40. package/dist/core/ask-question.d.ts +0 -1
  41. package/dist/core/ask-question.js +4 -67
  42. package/dist/core/ask-unresolvable-notice.d.ts +3 -2
  43. package/dist/core/auto-compaction.d.ts +106 -50
  44. package/dist/core/auto-compaction.js +69 -53
  45. package/dist/core/auto-mode-prompt.d.ts +4 -2
  46. package/dist/core/auto-mode-prompt.js +4 -3
  47. package/dist/core/canonical-json.d.ts +69 -0
  48. package/dist/core/canonical-json.js +130 -8
  49. package/dist/core/checkpoint-requirements.d.ts +13 -7
  50. package/dist/core/checkpoint-requirements.js +4 -1
  51. package/dist/core/checkpoint-store.d.ts +60 -36
  52. package/dist/core/checkpoint-store.js +7 -6
  53. package/dist/core/child-clamp-seats.d.ts +45 -6
  54. package/dist/core/child-clamp-seats.js +56 -4
  55. package/dist/core/compliance.js +3 -1
  56. package/dist/core/consolidate-scope.d.ts +1 -1
  57. package/dist/core/cross-boundary-taint.d.ts +213 -0
  58. package/dist/core/cross-boundary-taint.js +196 -0
  59. package/dist/core/decision-receipt.d.ts +44 -1
  60. package/dist/core/decision-receipt.js +16 -0
  61. package/dist/core/effective-path-target.d.ts +28 -6
  62. package/dist/core/effective-path-target.js +28 -2
  63. package/dist/core/engine-notice.d.ts +47 -4
  64. package/dist/core/engine-notice.js +17 -1
  65. package/dist/core/engine-storage-backend.d.ts +73 -0
  66. package/dist/core/engine-storage-backend.js +1 -0
  67. package/dist/core/file-history-store.d.ts +6 -2
  68. package/dist/core/file-history-store.js +1 -0
  69. package/dist/core/gate-fold.js +13 -4
  70. package/dist/core/gate-lanes.js +41 -34
  71. package/dist/core/gate-outcome.d.ts +18 -9
  72. package/dist/core/governance-codes.d.ts +9 -2
  73. package/dist/core/governance-codes.js +9 -0
  74. package/dist/core/hands-band-screen.d.ts +7 -0
  75. package/dist/core/hands-band-screen.js +32 -0
  76. package/dist/core/hooks.d.ts +21 -19
  77. package/dist/core/hooks.js +6 -5
  78. package/dist/core/locked-config.d.ts +110 -31
  79. package/dist/core/locked-config.js +155 -42
  80. package/dist/core/lsp.d.ts +1 -1
  81. package/dist/core/mcp-probe.js +1 -1
  82. package/dist/core/mcp-server-spec.d.ts +152 -17
  83. package/dist/core/mcp-server-spec.js +223 -40
  84. package/dist/core/mcp.d.ts +21 -14
  85. package/dist/core/mcp.js +59 -54
  86. package/dist/core/memory-engine/engine.d.ts +14 -19
  87. package/dist/core/memory-engine/engine.js +9 -6
  88. package/dist/core/memory-engine/export-bundle.d.ts +1 -1
  89. package/dist/core/memory-engine/export-bundle.js +1 -1
  90. package/dist/core/memory-engine/file-backend.d.ts +2 -6
  91. package/dist/core/memory-engine/file-backend.js +1 -12
  92. package/dist/core/memory.d.ts +3 -3
  93. package/dist/core/mode-policy.d.ts +16 -26
  94. package/dist/core/mode-policy.js +5 -18
  95. package/dist/core/mods/kernel/dispatch.js +13 -15
  96. package/dist/core/mods/kernel/events.d.ts +9 -6
  97. package/dist/core/mods/kernel/events.js +2 -2
  98. package/dist/core/mods/kernel/receive.d.ts +41 -11
  99. package/dist/core/mods/kernel/receive.js +124 -54
  100. package/dist/core/mods/kernel/site-rules.d.ts +80 -15
  101. package/dist/core/mods/kernel/site-rules.js +232 -40
  102. package/dist/core/mods/stations.d.ts +0 -6
  103. package/dist/core/mods/stations.js +0 -7
  104. package/dist/core/mounted-mcp.d.ts +57 -0
  105. package/dist/core/mounted-mcp.js +71 -2
  106. package/dist/core/own-property-receipt.d.ts +13 -0
  107. package/dist/core/own-property-receipt.js +3 -1
  108. package/dist/core/parent-spec-seat.d.ts +12 -15
  109. package/dist/core/parent-spec-seat.js +14 -6
  110. package/dist/core/pause-registry.d.ts +35 -1
  111. package/dist/core/pause-registry.js +10 -0
  112. package/dist/core/permission-rule-consent.d.ts +18 -5
  113. package/dist/core/permission-rule-consent.js +13 -8
  114. package/dist/core/permission-rule-model.d.ts +87 -15
  115. package/dist/core/permission-rule-model.js +87 -8
  116. package/dist/core/permission-rule-org.d.ts +200 -33
  117. package/dist/core/permission-rule-org.js +217 -91
  118. package/dist/core/permission-rule-session.js +2 -2
  119. package/dist/core/permission-rule-store.d.ts +8 -0
  120. package/dist/core/permission-rule-store.js +1 -0
  121. package/dist/core/permission-rule-sync.js +3 -2
  122. package/dist/core/permission-rules.d.ts +7 -1
  123. package/dist/core/permission-rules.js +37 -8
  124. package/dist/core/read-only-shell.d.ts +1 -1
  125. package/dist/core/read-only-shell.js +30 -9
  126. package/dist/core/remote-env.d.ts +41 -1
  127. package/dist/core/remote-env.js +18 -0
  128. package/dist/core/resume-startup-cause.d.ts +18 -0
  129. package/dist/core/resume-startup-cause.js +12 -0
  130. package/dist/core/retention.js +7 -2
  131. package/dist/core/retired-keys.d.ts +8 -2
  132. package/dist/core/retired-keys.js +12 -1
  133. package/dist/core/roles.js +60 -10
  134. package/dist/core/rule-lane-reads.js +1 -1
  135. package/dist/core/runner/approval-feedback.d.ts +46 -0
  136. package/dist/core/runner/approval-feedback.js +41 -0
  137. package/dist/core/runner/compaction-call-options.d.ts +3 -3
  138. package/dist/core/runner/compaction-call-options.js +2 -2
  139. package/dist/core/runner/contracts.d.ts +34 -41
  140. package/dist/core/runner/cross-boundary-lane.d.ts +87 -0
  141. package/dist/core/runner/cross-boundary-lane.js +190 -0
  142. package/dist/core/runner/decide-continuation.d.ts +4 -4
  143. package/dist/core/runner/decide-continuation.js +3 -1
  144. package/dist/core/runner/gate-exit.d.ts +32 -12
  145. package/dist/core/runner/gate-exit.js +77 -34
  146. package/dist/core/runner/inherited-ask-grants.js +2 -2
  147. package/dist/core/runner/mcp-redial.d.ts +52 -10
  148. package/dist/core/runner/mcp-redial.js +38 -9
  149. package/dist/core/runner/permission-rule-lanes.d.ts +5 -2
  150. package/dist/core/runner/permission-rule-lanes.js +22 -10
  151. package/dist/core/runner/person-path-rows.d.ts +5 -3
  152. package/dist/core/runner/person-path-rows.js +2 -2
  153. package/dist/core/runner/prepare-acquire-reconcile.d.ts +3 -4
  154. package/dist/core/runner/prepare-acquire-reconcile.js +3 -3
  155. package/dist/core/runner/prepare-ask-lane.js +3 -3
  156. package/dist/core/runner/prepare-caps-and-workflow.d.ts +6 -5
  157. package/dist/core/runner/prepare-caps-and-workflow.js +3 -3
  158. package/dist/core/runner/prepare-config-doors.d.ts +58 -15
  159. package/dist/core/runner/prepare-config-doors.js +167 -146
  160. package/dist/core/runner/prepare-context-lane.js +6 -3
  161. package/dist/core/runner/prepare-defer-classify.js +4 -7
  162. package/dist/core/runner/prepare-delegation-surface.d.ts +5 -4
  163. package/dist/core/runner/prepare-delegation-surface.js +8 -7
  164. package/dist/core/runner/prepare-execution-env.d.ts +1 -2
  165. package/dist/core/runner/prepare-execution-env.js +2 -1
  166. package/dist/core/runner/prepare-gate-stations.d.ts +2 -0
  167. package/dist/core/runner/prepare-gate-stations.js +4 -3
  168. package/dist/core/runner/prepare-hands-readface.d.ts +3 -3
  169. package/dist/core/runner/prepare-hands-readface.js +3 -2
  170. package/dist/core/runner/prepare-inherited-gate.d.ts +2 -0
  171. package/dist/core/runner/prepare-inherited-gate.js +3 -2
  172. package/dist/core/runner/prepare-listings.d.ts +1 -1
  173. package/dist/core/runner/prepare-listings.js +4 -2
  174. package/dist/core/runner/prepare-memory-engine-session.d.ts +0 -6
  175. package/dist/core/runner/prepare-memory-engine-session.js +19 -6
  176. package/dist/core/runner/prepare-memory.d.ts +3 -2
  177. package/dist/core/runner/prepare-memory.js +6 -2
  178. package/dist/core/runner/prepare-offload-wrappers.d.ts +4 -4
  179. package/dist/core/runner/prepare-offload-wrappers.js +2 -1
  180. package/dist/core/runner/prepare-park-ask.d.ts +1 -1
  181. package/dist/core/runner/prepare-park-ask.js +9 -3
  182. package/dist/core/runner/prepare-policy-chain.d.ts +1 -1
  183. package/dist/core/runner/prepare-policy-chain.js +14 -19
  184. package/dist/core/runner/prepare-project-context.d.ts +1 -1
  185. package/dist/core/runner/prepare-project-context.js +6 -4
  186. package/dist/core/runner/prepare-prompt-assembly.d.ts +1 -1
  187. package/dist/core/runner/prepare-prompt-assembly.js +20 -16
  188. package/dist/core/runner/prepare-prompt-inputs.d.ts +12 -6
  189. package/dist/core/runner/prepare-prompt-inputs.js +6 -3
  190. package/dist/core/runner/prepare-protocol-tools.d.ts +7 -5
  191. package/dist/core/runner/prepare-protocol-tools.js +19 -12
  192. package/dist/core/runner/prepare-question-face.d.ts +4 -2
  193. package/dist/core/runner/prepare-question-face.js +4 -3
  194. package/dist/core/runner/prepare-safety-scan.d.ts +7 -2
  195. package/dist/core/runner/prepare-safety-scan.js +34 -27
  196. package/dist/core/runner/prepare-suspend-saga.d.ts +2 -2
  197. package/dist/core/runner/prepare-suspend-saga.js +6 -2
  198. package/dist/core/runner/prepare-task.js +22 -19
  199. package/dist/core/runner/prepare-turn-wiring.d.ts +10 -5
  200. package/dist/core/runner/prepare-turn-wiring.js +14 -49
  201. package/dist/core/runner/prepare-wiring-manifest.d.ts +10 -5
  202. package/dist/core/runner/prepare-wiring-manifest.js +9 -6
  203. package/dist/core/runner/prepare-workspace-restore.js +2 -2
  204. package/dist/core/runner/resume-admission.d.ts +4 -1
  205. package/dist/core/runner/resume-admission.js +16 -14
  206. package/dist/core/runner/resume-apply.js +4 -4
  207. package/dist/core/runner/resume-internals-and-config.d.ts +3 -3
  208. package/dist/core/runner/resume-internals-and-config.js +3 -8
  209. package/dist/core/runner/resume-policy-outcome.d.ts +2 -2
  210. package/dist/core/runner/resume-policy-outcome.js +18 -15
  211. package/dist/core/runner/resume-preflight.js +2 -2
  212. package/dist/core/runner/resume-review-outcome.js +3 -3
  213. package/dist/core/runner/retired-runner-deps.d.ts +5 -6
  214. package/dist/core/runner/retired-runner-deps.js +1 -4
  215. package/dist/core/runner/run-leg.js +97 -43
  216. package/dist/core/runner/run-recovery-lanes.js +5 -3
  217. package/dist/core/runner/run-settle-and-teardown.js +2 -0
  218. package/dist/core/runner/run-terminal-adoption.js +21 -9
  219. package/dist/core/runner/run-turn-boundary.js +9 -3
  220. package/dist/core/runner/runtask.js +1 -1
  221. package/dist/core/runner/session-file-state-replay.d.ts +5 -2
  222. package/dist/core/runner/session-file-state-replay.js +3 -2
  223. package/dist/core/runner/skills-seat.d.ts +15 -0
  224. package/dist/core/runner/skills-seat.js +57 -0
  225. package/dist/core/runner/stream-steer-verb.js +2 -2
  226. package/dist/core/runner/sub-agent-deny-lists.d.ts +13 -11
  227. package/dist/core/runner/sub-agent-deny-lists.js +7 -5
  228. package/dist/core/runner/synthetic-tools.d.ts +5 -2
  229. package/dist/core/runner/synthetic-tools.js +2 -12
  230. package/dist/core/runner/tool-face-overlay.d.ts +24 -6
  231. package/dist/core/runner/tool-face-overlay.js +24 -15
  232. package/dist/core/runner-deps.d.ts +37 -22
  233. package/dist/core/session-policy-store.d.ts +19 -0
  234. package/dist/core/session-policy-store.js +22 -2
  235. package/dist/core/session-store.d.ts +35 -16
  236. package/dist/core/session-store.js +20 -12
  237. package/dist/core/{shell-lexer.d.ts → shell-run-candidates.d.ts} +36 -12
  238. package/dist/core/{shell-lexer.js → shell-run-candidates.js} +145 -225
  239. package/dist/core/shell-wrapper-table.d.ts +5 -3
  240. package/dist/core/shell-wrapper-table.js +1 -1
  241. package/dist/core/store-contracts/checkpoint-store-contract.js +2 -2
  242. package/dist/core/store-contracts/mailbox-store-contract.js +13 -0
  243. package/dist/core/store-contracts/session-store-contract.d.ts +49 -0
  244. package/dist/core/store-contracts/session-store-contract.js +639 -0
  245. package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +12 -0
  246. package/dist/core/store-contracts/session-store-incarnation-contract.js +5 -2
  247. package/dist/core/task-event.d.ts +44 -6
  248. package/dist/core/task-notification.js +2 -2
  249. package/dist/core/task-registry-agent.js +1 -0
  250. package/dist/core/task-registry-shared.d.ts +5 -0
  251. package/dist/core/task-registry.d.ts +7 -0
  252. package/dist/core/task-registry.js +17 -0
  253. package/dist/core/task-result.d.ts +1 -1
  254. package/dist/core/task-spec.d.ts +7 -7
  255. package/dist/core/tighten-task-spec.d.ts +6 -4
  256. package/dist/core/tighten-task-spec.js +2 -2
  257. package/dist/core/tool-catalog-entries.d.ts +1 -1
  258. package/dist/core/tool-catalog-entries.js +52 -52
  259. package/dist/core/tool-face-reader.d.ts +49 -0
  260. package/dist/core/tool-face-reader.js +94 -0
  261. package/dist/core/tool-face.d.ts +17 -8
  262. package/dist/core/tool-face.js +1 -0
  263. package/dist/core/tool-policy.d.ts +67 -23
  264. package/dist/core/tool-policy.js +72 -60
  265. package/dist/core/tool-roster.d.ts +46 -28
  266. package/dist/core/tool-roster.js +91 -14
  267. package/dist/core/tool-spec-members.js +2 -2
  268. package/dist/core/tool-spec.d.ts +20 -4
  269. package/dist/core/tools.js +2 -0
  270. package/dist/core/trace.d.ts +24 -2
  271. package/dist/core/types.d.ts +3 -3
  272. package/dist/core/types.js +1 -1
  273. package/dist/core/untrusted-text.d.ts +23 -0
  274. package/dist/core/untrusted-text.js +10 -10
  275. package/dist/core/user-attachment.d.ts +56 -2
  276. package/dist/core/user-attachment.js +139 -56
  277. package/dist/core/wiring-manifest.d.ts +4 -2
  278. package/dist/engine/compaction/compaction.d.ts +2 -2
  279. package/dist/engine/compaction/utils.d.ts +2 -2
  280. package/dist/engine/harness/agent-harness.js +2 -1
  281. package/dist/engine/harness/types.d.ts +10 -4
  282. package/dist/engine/llm/types.d.ts +7 -2
  283. package/dist/engine/llm/types.js +2 -1
  284. package/dist/engine/loop/agent-loop.d.ts +12 -1
  285. package/dist/engine/loop/agent-loop.js +17 -5
  286. package/dist/engine/loop/types.d.ts +7 -1
  287. package/dist/engine/session/repo-utils.d.ts +5 -0
  288. package/dist/engine/session/repo-utils.js +9 -0
  289. package/dist/engine/session/storage-base.js +2 -2
  290. package/dist/index.d.ts +37 -17
  291. package/dist/index.js +31 -14
  292. package/dist/internal/harness.d.ts +1 -0
  293. package/dist/internal/harness.js +1 -0
  294. package/dist/internal/llm.d.ts +1 -1
  295. package/dist/internal/llm.js +1 -1
  296. package/dist/orchestration/goal.d.ts +24 -1
  297. package/dist/orchestration/goal.js +3 -2
  298. package/dist/orchestration/run-workflow-tool.d.ts +3 -0
  299. package/dist/orchestration/run-workflow-tool.js +1 -0
  300. package/dist/orchestration/workflow-governance.d.ts +1 -1
  301. package/dist/orchestration/workflow.d.ts +3 -0
  302. package/dist/orchestration/workflow.js +2 -1
  303. package/dist/prompt-assembly/artifact-store.d.ts +44 -9
  304. package/dist/prompt-assembly/artifact-store.js +38 -12
  305. package/dist/prompt-assembly/artifact.d.ts +12 -11
  306. package/dist/prompt-assembly/artifact.js +52 -21
  307. package/dist/prompt-assembly/assemble.d.ts +2 -0
  308. package/dist/prompt-assembly/assemble.js +2 -1
  309. package/dist/prompt-assembly/catalog/index.js +2 -1
  310. package/dist/prompt-assembly/catalog/memory.d.ts +13 -0
  311. package/dist/prompt-assembly/catalog/memory.js +6 -0
  312. package/dist/prompt-assembly/catalog/schema.d.ts +19 -2
  313. package/dist/prompt-assembly/catalog/schema.js +3 -0
  314. package/dist/prompt-assembly/composer.d.ts +2 -0
  315. package/dist/prompt-assembly/composer.js +1 -1
  316. package/dist/prompt-assembly/overlay.d.ts +21 -11
  317. package/dist/prompt-assembly/overlay.js +57 -19
  318. package/dist/prompt-assembly/select.d.ts +21 -6
  319. package/dist/prompt-assembly/select.js +41 -4
  320. package/dist/prompts/default.d.ts +1 -12
  321. package/dist/prompts/default.js +0 -3
  322. package/dist/shell/lex.d.ts +87 -8
  323. package/dist/shell/lex.js +283 -49
  324. package/dist/stores/file/index.d.ts +8 -6
  325. package/dist/stores/file/permission-rule-store.d.ts +1 -1
  326. package/dist/stores/file/permission-rule-store.js +2 -1
  327. package/dist/tools/artifact/artifact-tool.js +14 -3
  328. package/dist/tools/fs/bash-program-position.d.ts +3 -15
  329. package/dist/tools/fs/bash-program-position.js +3 -10
  330. package/dist/tools/fs/bash-readonly-classifier.js +2 -0
  331. package/dist/tools/fs/fs-bash.d.ts +3 -3
  332. package/dist/tools/fs/fs-bash.js +72 -101
  333. package/dist/tools/fs/fs-read.d.ts +12 -0
  334. package/dist/tools/fs/fs-read.js +10 -9
  335. package/dist/tools/fs/fs-shared.d.ts +27 -31
  336. package/dist/tools/fs/fs-shared.js +12 -15
  337. package/dist/tools/fs/fs-write.js +1 -1
  338. package/dist/tools/fs/index.js +2 -2
  339. package/dist/tools/fs/read-deny-home.d.ts +1 -1
  340. package/dist/tools/fs/read-deny-home.js +5 -4
  341. package/dist/tools/fs/read-deny.d.ts +16 -3
  342. package/dist/tools/fs/read-deny.js +12 -9
  343. package/dist/tools/fs/safety.d.ts +7 -6
  344. package/dist/tools/fs/shell-read-bindings.d.ts +5 -3
  345. package/dist/tools/fs/shell-read-bindings.js +15 -16
  346. package/dist/tools/fs/shell-read-device.js +1 -1
  347. package/dist/tools/fs/shell-read-plan.js +36 -47
  348. package/dist/tools/fs/shell-read-word.d.ts +1 -6
  349. package/dist/tools/fs/shell-read-word.js +2 -20
  350. package/dist/tools/fs/shell-reentry-text.js +1 -1
  351. package/dist/tools/web.d.ts +2 -2
  352. package/package.json +4 -1
  353. package/test/export-surface.snapshot.json +5651 -5457
  354. package/wire-changes/core@7.53.0.json +1968 -0
  355. package/wire-changes/core@7.54.0.json +2870 -0
  356. package/dist/core/shell-scan.d.ts +0 -60
  357. package/dist/core/shell-scan.js +0 -183
@@ -0,0 +1,49 @@
1
+ /**
2
+ * The READER of an MCP server's `toolFaces` declaration ({@link McpServerSpec.toolFaces}, the per-tool FACE overlay): `readToolFaces(declared)`,
3
+ * the face-side sibling of `readToolAxes` (`mcp-server-spec.ts`). The engine's preparation door and its MCP materialization entrance ask it
4
+ * (`locked-config.ts`), and a host that assembles the field from JSON (a console's write door, a deployment intake) asks it at its own door:
5
+ * one reading of the declaration, whoever asks and whenever. The mount ({@link applyMcpToolFaces}) then consumes the reader's copy and never
6
+ * the raw object, and judges each face against the materialized schema with the very judge this reader ends in.
7
+ *
8
+ * It sits beside `mcp-server-spec.ts` rather than in the runner directory the mount lives in: it is the declaration's door, not a station of
9
+ * the prepare path, and the public surface is tiered by where a symbol is declared (`readToolAxes` is `advanced` for the same reason).
10
+ */
11
+ import { type McpServerSpec } from "./mcp-server-spec.js";
12
+ /**
13
+ * {@link readToolFaces}'s answer. `ok: true` hands back a copy of the faces that the reader itself built, plain data and none of the caller's own
14
+ * objects; `faces` is absent when nothing is declared (no key at all, or an empty record). `ok: false` carries one sentence (its detail cut at
15
+ * 240 characters) naming the tool and the member that did not fit. What it may quote of the declaration is its structure and nothing of its content:
16
+ * a tool or member name (quoted, a tool name cut at 80 characters), the word a closed table refuses, a key or a list entry over its bound (its
17
+ * first 40 characters), a key a pattern parameter names, a count and its bound. It never quotes display text (`userFacingName`, `activity`) or
18
+ * the entries of a list that fits. These are the mount's judge's own sentences, the ones it announces at the listing, so the reader and the mount
19
+ * tell one operator one thing; `readToolAxes` refuses in the same sentence shape and names no word because an axis word is never a name the
20
+ * operator needs echoed to find the fault.
21
+ */
22
+ export type ToolFacesRead = {
23
+ ok: true;
24
+ faces?: NonNullable<McpServerSpec["toolFaces"]>;
25
+ } | {
26
+ ok: false;
27
+ problem: string;
28
+ };
29
+ /**
30
+ * The one reader of a raw `toolFaces` declaration — {@link McpServerSpec.toolFaces}, the per-tool FACE overlay — and the face-side sibling of
31
+ * `readToolAxes` (the safety axes `effect` / `egress` / `irreversibility` are that declaration's, read once, there). The preparation door asks it
32
+ * for every MCP server of a task (`config.tool_face_invalid` refuses the whole prepare — the code a caller tool's bad face has at the caller door;
33
+ * a declaration the entry's own plain-data receipt refuses first keeps `config.invalid_argument`), `materializeMcpTools` asks it per server (that
34
+ * server's dial fails, the same code), and a host that assembles the field from JSON asks it at its own door and hands the engine what it answered.
35
+ *
36
+ * It judges the declaration alone, which is everything the declaration can say without the tool's schema: the receipt of a plain-data
37
+ * declaration (`receiveDeclaration`: a Proxy, a map, a class instance, a getter that throws, a cycle, a nesting past the engine's one
38
+ * depth, a tool named `__proto__` are refusals that say where they sit), the shape of each face (the members the types have, each of its
39
+ * kind), then the very judge the mount runs (`toolFaceProblem`) minus the checks that need the schema — the five closed words
40
+ * (`family`, `pathTarget.access` / `base` / `absent`, `renderHints.approvalCard`), the bounds, and the cross-member rules (a write path
41
+ * target's `base: "root"` / `absent: "base"`, an inert `patternParam`). The checks that read the schema (a `param` that is a top-level
42
+ * property, the keys an approval card needs, the names a summary or a rule face lists) and the one that reads the minted tool (a result card
43
+ * lives under the tool's own namespace) stay with the listing, where the schema and the tool are known.
44
+ *
45
+ * Any one face that does not fit refuses the WHOLE declaration (`ok: false`): a face is an overlay applied whole or not at all, and a
46
+ * dropped face is a tool mounted without the protection its operator declared. Absent ⇒ `{ ok: true }`. An empty record is no declaration
47
+ * either; an empty face `{}` under a tool name is kept as written. An empty tool name is refused (no tool answers to it).
48
+ */
49
+ export declare function readToolFaces(declared: unknown): ToolFacesRead;
@@ -0,0 +1,94 @@
1
+ import { dataKind, perToolEmptyName, perToolEntryRefusal, quotedName, receivePerToolDeclaration } from "./mcp-server-spec.js";
2
+ import { isPlainRecord } from "./mods/kernel/receive.js";
3
+ import { faceProblem } from "./runner/tool-face-overlay.js";
4
+ import { inlineUntrusted } from "./untrusted-text.js";
5
+ const TOOL_FACE_MEMBERS = { family: true, pathTarget: true, renderHints: true, ruleFace: true };
6
+ const PATH_TARGET_KINDS = { param: "string", aliases: "list", access: "string", skillScopeEligible: "boolean", base: "string", absent: "string", patternParam: "string" };
7
+ const PATH_TARGET_REQUIRED = ["param", "access"];
8
+ const RENDER_HINT_KINDS = { userFacingName: "string", activity: "string", summaryParams: "list", resultCards: "list", approvalCard: "string" };
9
+ const RULE_FACE_KINDS = { primaryParams: "list", params: "list" };
10
+ function kindProblem(label, value, kind) {
11
+ if (value === undefined)
12
+ return undefined;
13
+ if (kind === "list")
14
+ return Array.isArray(value) && value.every((name) => typeof name === "string") ? undefined : `${label} is ${dataKind(value)}, not a list of strings`;
15
+ return typeof value === kind ? undefined : `${label} is ${dataKind(value)}, not a ${kind}`;
16
+ }
17
+ function membersOf(raw, label, names) {
18
+ if (!isPlainRecord(raw))
19
+ return `${label} is ${dataKind(raw)}, not an object`;
20
+ const unknown = Object.keys(raw).find((member) => !names.includes(member));
21
+ return unknown === undefined ? raw : `${label} has the unknown member ${quotedName(unknown)} (the members are ${names.join(", ")})`;
22
+ }
23
+ function ownMember(record, name) {
24
+ return Object.hasOwn(record, name) ? record[name] : undefined;
25
+ }
26
+ function readMembers(raw, label, kinds, required = []) {
27
+ const record = membersOf(raw, label, Object.keys(kinds));
28
+ if (typeof record === "string")
29
+ return record;
30
+ for (const member of required)
31
+ if (ownMember(record, member) === undefined)
32
+ return `${label}.${member} is missing`;
33
+ const entries = [];
34
+ for (const member of Object.keys(record)) {
35
+ const kind = kinds[member];
36
+ const value = record[member];
37
+ const problem = kindProblem(`${label}.${member}`, value, kind);
38
+ if (problem !== undefined)
39
+ return problem;
40
+ if (value === undefined || (kind === "boolean" && value === false))
41
+ continue;
42
+ entries.push([member, kind === "list" ? [...value] : value]);
43
+ }
44
+ return Object.fromEntries(entries);
45
+ }
46
+ function readOneToolFace(raw) {
47
+ const face = membersOf(raw, "the face", Object.keys(TOOL_FACE_MEMBERS));
48
+ if (typeof face === "string")
49
+ return face;
50
+ const records = { pathTarget: [PATH_TARGET_KINDS, PATH_TARGET_REQUIRED], renderHints: [RENDER_HINT_KINDS, []], ruleFace: [RULE_FACE_KINDS, []] };
51
+ const entries = [];
52
+ for (const member of Object.keys(face)) {
53
+ const value = face[member];
54
+ if (value === undefined)
55
+ continue;
56
+ if (member === "family") {
57
+ const problem = kindProblem("family", value, "string");
58
+ if (problem !== undefined)
59
+ return problem;
60
+ entries.push([member, value]);
61
+ continue;
62
+ }
63
+ const [kinds, required] = records[member];
64
+ const record = readMembers(value, member, kinds, required);
65
+ if (typeof record === "string")
66
+ return record;
67
+ entries.push([member, record]);
68
+ }
69
+ const typed = Object.fromEntries(entries);
70
+ return faceProblem(typed, undefined) ?? typed;
71
+ }
72
+ export function readToolFaces(declared) {
73
+ if (declared === undefined)
74
+ return { ok: true };
75
+ const received = receivePerToolDeclaration(declared, "toolFaces", "tool");
76
+ if (!received.ok)
77
+ return { ok: false, problem: received.problem };
78
+ const entries = [];
79
+ for (const [tool, raw] of Object.entries(received.perTool)) {
80
+ if (tool.length === 0)
81
+ return { ok: false, problem: perToolEmptyName("toolFaces", "tool") };
82
+ let face;
83
+ try {
84
+ face = readOneToolFace(raw);
85
+ }
86
+ catch {
87
+ face = "a member threw while it was read";
88
+ }
89
+ if (typeof face === "string")
90
+ return { ok: false, problem: perToolEntryRefusal("toolFaces", "tool", tool, inlineUntrusted(face, 240)) };
91
+ entries.push([tool, face]);
92
+ }
93
+ return entries.length > 0 ? { ok: true, faces: Object.fromEntries(entries) } : { ok: true };
94
+ }
@@ -198,6 +198,9 @@ export interface ToolRenderHints {
198
198
  */
199
199
  export interface ToolFaceDeclaration {
200
200
  family: ToolFamily;
201
+ /** The legs every call of the definition travels, or `"per_call"` when the code that dispatches it gives them per call. REQUIRED:
202
+ * a definition that states none does not compile — no default, and no fail-closed reading as outside. */
203
+ boundaryLegs: import("./cross-boundary-taint.js").BoundaryLegsDeclaration;
201
204
  effect?: import("./tool-spec.js").ToolEffect;
202
205
  egress?: true;
203
206
  irreversibility?: "never" | "maybe" | "always";
@@ -232,6 +235,12 @@ export interface ToolFaceDeclaration {
232
235
  */
233
236
  export declare const TOOL_LEG_KINDS: readonly ["delegated", "teammate", "goal", "observer", "structured"];
234
237
  export type ToolLegKind = (typeof TOOL_LEG_KINDS)[number];
238
+ /**
239
+ * The leg kinds that share their spawner's tool surface: a teammate is handed tools its spawner holds in its own right (the team's mailbox,
240
+ * scheduler and task list), so the layers above the leg decide its protocol rows and the leg's own lists do not. A protocol row that no kind
241
+ * of this table names is the leg's own channel — a finishing or hand-back tool its spawner never held — and no layer decides it.
242
+ */
243
+ export declare const SPAWNER_SURFACE_LEG_KINDS: readonly ToolLegKind[];
235
244
  /**
236
245
  * One layer of a tool selector, as data: an allowed-tools list (absent = no allowlist on this layer) and a denied-tools list,
237
246
  * each a frozen copy of the entries a list was written with. A run's own layer is its `allowTools` and `excludeTools`; the
@@ -244,8 +253,9 @@ export interface ToolSelectorLayer {
244
253
  /**
245
254
  * The compiled tool selector of one run — the one answer to "is this tool available on this run", read at the roster valve
246
255
  * and on every later roster change (an MCP refresh or re-dial, the deferred-search lane), and handed down as the ceiling of
247
- * every run this one spawns (`layers`). A tool is admitted when it is a protocol tool of this run's leg kind, or when every
248
- * layer admits it: the layer's allowlist (if any) reaches it and its denylist does not.
256
+ * every run this one spawns (`layers`). A tool is admitted when it is the leg's own protocol channel, or when every layer
257
+ * admits it — the layer's allowlist (if any) reaches it and its denylist does not — or, for a protocol tool of a leg that shares
258
+ * its spawner's tool surface ({@link SPAWNER_SURFACE_LEG_KINDS}), when every layer ABOVE the leg's own admits it.
249
259
  */
250
260
  export interface ToolSelector {
251
261
  readonly layers: readonly ToolSelectorLayer[];
@@ -280,13 +290,12 @@ export interface ToolCatalogEntry {
280
290
  face: ToolFaceDeclaration;
281
291
  /** A `modelGate` class the default-bundle assembler stamps on this definition's default arm. */
282
292
  modelGate?: string;
283
- /** The leg kinds whose legs rely on this tool as part of their protocol: on such a leg the tool's availability is not a
284
- * selector's to decide (an allowlist need not name it), and a denylist that reaches it there is a contradiction the run
285
- * refuses at prepare. */
293
+ /** The leg kinds whose legs rely on this tool as part of their protocol: the leg's OWN lists do not decide it (an allowlist need not
294
+ * name it), and a denylist of the leg's own that reaches it is a contradiction the run refuses at prepare. Whether the layers ABOVE
295
+ * the leg decide it follows the row's kinds ({@link SPAWNER_SURFACE_LEG_KINDS}): a row some kind of which shares its spawner's tool
296
+ * surface is held exactly when the spawner may hold it; any other row is the leg's own channel, which no layer decides — an inherited
297
+ * deny that reaches it is the same contradiction. */
286
298
  protocol?: readonly ToolLegKind[];
287
- /** A protocol row the leg shares with the run that spawned it (the team task-list family a teammate shares with its leader): on its
288
- * leg the leg's OWN lists do not decide it, but the ceiling still does — the leg holds it exactly when its spawner may. */
289
- protocolUnderCeiling?: true;
290
299
  }
291
300
  /**
292
301
  * The band-membership table over the mount tags: a host derives its hand band as the definitions listed under a
@@ -25,6 +25,7 @@ export const RENDER_HINT_MAX_CHARS = 64;
25
25
  export const RENDER_HINT_ACTIVITY_MAX_CHARS = 32;
26
26
  export const RENDER_HINT_MAX_LIST = 16;
27
27
  export const TOOL_LEG_KINDS = Object.freeze(["delegated", "teammate", "goal", "observer", "structured"]);
28
+ export const SPAWNER_SURFACE_LEG_KINDS = Object.freeze(["teammate"]);
28
29
  export const MOUNT_TAG_IN_HANDS_BAND = {
29
30
  hands: true,
30
31
  backgroundTasks: true,
@@ -2,6 +2,7 @@ import { type AskOrigin, type AssertAllKeysHandled } from "./ask-origin.js";
2
2
  import { type ReadRootGrantScreen } from "./read-root-grant-screen.js";
3
3
  import { type Settlement } from "./gate-outcome.js";
4
4
  export { policyCannotAnswer, rowDemandsAPerson } from "./real-approval.js";
5
+ import { type BindingFault } from "./canonical-json.js";
5
6
  import { type DecisionReason } from "./decision-receipt.js";
6
7
  export { isEngineRefusal } from "./decision-receipt.js";
7
8
  import { type RemovalGuardSeat } from "../tools/fs/removal-targets.js";
@@ -236,7 +237,8 @@ export interface EngineAttestation {
236
237
  readonly origin?: AskOrigin;
237
238
  /** The settled ask's class set (`ASK_CLASSES` order), when the minting station held one. */
238
239
  readonly classes?: readonly import("./ask-origin.js").AskClass[];
239
- /** `boundInputHashOf` of the arguments the settlement licenses: an approver's edit, the snapshot shown, or the asked args. */
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. */
240
242
  readonly inputDigest?: string;
241
243
  /** The FORM of a classifier round that did not rule (a classifier deny's cause). */
242
244
  readonly classifierCause?: import("./gate-outcome.js").ClassifierDenyCause;
@@ -249,6 +251,9 @@ export interface EngineAttestation {
249
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
250
252
  * exit mints the refusal's card from it; the judge that found the row is its only writer. */
251
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;
252
257
  }
253
258
  /** The members a station attests — everything but the call binding. */
254
259
  export type AttestationMembers = Omit<EngineAttestation, "toolCallId" | "toolName">;
@@ -422,6 +427,11 @@ export type PermissionResult = {
422
427
  * in the one direction the stamp cannot reach (a caller composing its own ask) the claim is
423
428
  * tightening-only: it can make an ask outlive a rule, never turn one into an allow. */
424
429
  probeMandated?: true;
430
+ /** This ask stands on the call's CROSS-BOUNDARY obligation — a person's confirmation
431
+ * ({@link import("./cross-boundary-taint.js").crossBoundaryObligation}); the station mints it beside `requiresRealApproval`, the
432
+ * decision receipt adds that bit to a policy's or hook's own. Its one carrier: the class (`cross_boundary`), the rule-silence word (`cross_boundary_taint`) and the
433
+ * real-approval bit are all read off this member. Tightening-only: a policy self-declaring it opts its own ask out of automatic answering. */
434
+ crossBoundaryMandated?: true;
425
435
  /** This ask is MANDATED — no persisted allow rule and no STANDING ANSWER (a release remembered from an
426
436
  * earlier call, at any scope, a session included) may retire it; only an answer produced for THIS call
427
437
  * clears it — a person, a hook, a deployment's blanket `onAsk: "allow"` seat, or the live deciders the
@@ -592,6 +602,37 @@ export interface AskRuleEvidence {
592
602
  }
593
603
  /** The human/model-readable text of a decision. */
594
604
  export declare function decisionText(d: PermissionResult): string | undefined;
605
+ /** Does a license (a record's `inputDigest`) cover the bytes that `runs`? The ONE judge — the gate's ledger keeps a settlement for
606
+ * the bytes it licensed by it, and the unstated question asks whether an answer was given for these bytes by it. A license for
607
+ * bytes covers what the tool reads them as ({@link argsReadFrom}: the one recorded step a reading took to `runs`). Compared by
608
+ * the EXACT digest only: bytes outside the bindable domain have none and are covered by no license. */
609
+ export declare function licenseCovers(licensed: string | undefined, runs: unknown): boolean;
610
+ /**
611
+ * THE judge of whether an approval can be bound to arguments, and the arguments it binds — asked wherever an approval is about to
612
+ * be asked or adopted, and nowhere else: the ask resolver (its no-approver arm too) and the approval policy before anyone is asked,
613
+ * the resolver where it adopts a person's edit, the gate's approved-edit loop (an edit any resolver hands back), and — through the
614
+ * same judge and sentence — the durable decide's capture of one before the claim ({@link capturedJsonOf}). Bindable = a record of
615
+ * plain JSON data nested at most 256 levels deep ({@link bindableValueOf}, exactly the values with an exact digest — the SAME reading every
616
+ * license and mint takes), judged on the value as given with nothing of the caller's run (a getter is never called: a value read
617
+ * through one has no fixed bytes). Ok ⇒ the judge's frozen copy, engine-owned (`args` itself when owned already); else the ONE
618
+ * sentence ({@link bindingRefusalOf}).
619
+ */
620
+ export declare function bindableArgsOf<T>(toolName: string, args: T): {
621
+ ok: true;
622
+ value: T;
623
+ } | {
624
+ ok: false;
625
+ refusal: string;
626
+ };
627
+ /** THE sentence refusing arguments no approval can be bound to, naming what the judge met and where (`args` is what it was given). */
628
+ export declare function bindingRefusalOf(toolName: string, args: unknown, fault: BindingFault): string;
629
+ /** Was the call ANSWERED for the bytes that run — does `d` carry an engine record ({@link attestationOf}) of a settled wait
630
+ * whose license covers `runs`? A person's or the deployment approver's yes over these arguments is; a layer's allow is not,
631
+ * whatever it says about itself, and neither is a yes given for other bytes (a later layer that rewrote them voids it here). */
632
+ export declare function answeredFor(d: PermissionResult, call: {
633
+ toolCallId: string;
634
+ toolName: string;
635
+ }, runs: unknown): boolean;
595
636
  /**
596
637
  * Gates tool calls before they execute (the production safety layer for "processing/changing data").
597
638
  *
@@ -878,9 +919,10 @@ export declare function constraintChainEntryOfSuppliedLayer(layer: ConstraintCha
878
919
  * different frozen deny data now digest differently.
879
920
  */
880
921
  export declare function constraintChainDigest(chain: readonly ConstraintChainEntry[]): string;
881
- /** Every member of the decision union — a member the union gains and this list lacks is a type error at `satisfies`.
882
- * The receipt walks it: a contract member not held as an own enumerable data property is refused if a descriptor on the
883
- * prototype chain holds one (an `undefined` data value spells absence). Not re-exported from `src/index.ts`. */
922
+ /** Every member of the decision union, read off the member × arm table ({@link DECISION_MEMBER_ARMS}: a member the union gains
923
+ * and the table lacks is a type error there). The receipt walks it: a contract member not held as an own enumerable data
924
+ * property is refused if a descriptor on the prototype chain holds one (an `undefined` data value spells absence), and a
925
+ * present one must sit on an arm its row holds. Not re-exported from `src/index.ts`. */
884
926
  export type DecisionMember = PermissionResult extends infer U ? (U extends unknown ? keyof U : never) : never;
885
927
  export declare const DECISION_MEMBERS: readonly DecisionMember[];
886
928
  /**
@@ -949,8 +991,10 @@ export type NamedToolPolicy = ToolPolicy & {
949
991
  * which simply opts out of the audit). */
950
992
  export declare function toolPolicyNameSets(p: ToolPolicy | undefined): readonly ToolPolicyNameSets[];
951
993
  /**
952
- * Name-based allow/deny. `deny` always wins. If `allow` is provided, only those tools are permitted
953
- * (everything else denied). Without `allow`, everything not in `deny` is permitted. Each entry is read by the rule
994
+ * Name-based allow/deny. `deny` always wins. If `allow` is provided, only those tools may run (everything else denied) — a
995
+ * NARROWING: a tool the list names gets no objection, never consent, so a `passthrough`-seat tool it names still meets the
996
+ * mode's unstated question; consent is an allow entry (`RunnerDeps.allowedTools` / `TaskSpec.allowedTools`). Without
997
+ * `allow`, everything not in `deny` gets no objection. Each entry is read by the rule
954
998
  * syntax (`ruleSpellingOf`): a name, or `Tool()` / `Tool(*)` — the bare `Tool`, as every list reader reads them, once however
955
999
  * many spellings write it; any other spelling is not a tool name (`onInvalidName`), and neither is the wildcard `*` (`*`,
956
1000
  * `*()`, `*(*)`) in `deny`: it names no tool, and the entry would be kept and never match. In `allow` it is one entry no tool
@@ -975,13 +1019,6 @@ export declare function createAllowDenyPolicy(opts: {
975
1019
  list: "allow" | "deny";
976
1020
  message: string;
977
1021
  }) => void;
978
- /**
979
- * What an `allow` list HIT means. `"grant"` (default): the deployment named this tool as permitted — a statement
980
- * (`decisionReason: "rule"`) that satisfies the fold's unstated rule for a passthrough-seat tool. `"narrowing"`: the
981
- * list only bounds WHICH tools a lane may see (an agent definition's `allowTools`); a hit is scope, not consent, and
982
- * answers a bare allow — the mode's unstated question still goes to a person. The deny list is unaffected.
983
- */
984
- scope?: "grant" | "narrowing";
985
1022
  }): NamedToolPolicy;
986
1023
  /**
987
1024
  * What `createApprovalPolicy`'s `approve` may resolve to: a boolean, or the `AskOutcome` OBJECT minus the
@@ -1030,7 +1067,8 @@ export declare function createApprovalPolicy(opts: {
1030
1067
  approve: (req: ToolCallRequest, signal?: AbortSignal) => ApprovalSeatOutcome | Promise<ApprovalSeatOutcome>;
1031
1068
  /** Always-denied tools. */
1032
1069
  deny?: string[];
1033
- /** Always-allowed tools (only meaningful with `denyByDefault`). */
1070
+ /** The exceptions to `denyByDefault` (only meaningful with it): tools that get no objection without an approval. A narrowing,
1071
+ * not consent — a `passthrough`-seat tool named here still meets the mode's unstated question; consent is an allow entry. */
1034
1072
  autoAllow?: string[];
1035
1073
  /** When true, deny anything not in `requireApproval` or `autoAllow`. Default false. */
1036
1074
  denyByDefault?: boolean;
@@ -1050,12 +1088,11 @@ export declare function createApprovalPolicy(opts: {
1050
1088
  * short-circuit — scanning continues, because a later policy may still `deny` (which outranks ask).
1051
1089
  * With no deny, the first `ask` wins; with neither, `allow`.
1052
1090
  *
1053
- * **An allow is STATED or not.** A layer that names the call (an allow rule, a list entry, an approver's yes, a mode's
1054
- * release) says WHY on its allow (`decisionReason`); a bare allow is "no objection" — an empty table, a list the call is
1055
- * not on, a layer that does not know the tool. The combined allow carries the FIRST stated reason in layer order, and a
1056
- * statement binds the arguments its layer judged: a layer that rewrites the arguments voids every statement before it (its
1057
- * own allow, if it states one, speaks for the new arguments). For a tool whose permission seat is `passthrough` an
1058
- * unstated allow is not a permission — the gate puts the mode's question to it; for every other tool the two forms run alike.
1091
+ * **A layer's allow is no objection, never consent.** What a combined allow carries beyond that is the engine RECORDS its
1092
+ * layers' stations minted (an approver's yes inside a layer, an ancestor classifier's attribution), accumulated per member
1093
+ * group; a yes binds the bytes it was given (its license), so a layer that rewrites the arguments afterwards leaves a yes that
1094
+ * no longer covers what runs. For a tool whose permission seat is `passthrough` the gate puts the mode's question to a
1095
+ * combined allow unless an answer covers the bytes that run ({@link answeredFor}) — the allow layer answers it there.
1059
1096
  *
1060
1097
  * **Idempotency requirement:** because the fold continues past an `ask` to look for a later `deny`, a
1061
1098
  * policy's `check()` can be invoked even after an earlier policy returned `ask`. `check()` MUST be
@@ -1847,8 +1884,8 @@ export declare function refusalOf<D extends PermissionResult>(deny: D, judged: u
1847
1884
  /**
1848
1885
  * A PreToolUse hook's `ask` folded over a verdict by `deny > ask > allow` — the ONE law for the gate's first screening and for
1849
1886
  * an approved edit's re-screen. A deny stands. Over an allow, the hook's own ask, RECONSTRUCTED rather than spread (its message,
1850
- * its real-approval demand, its rewrite) under the hook provenance the engine stamps. Over an ask, that ask keeps every member,
1851
- * takes the hook provenance and the hook's real-approval demand, and its message carries the hook's beside its own — a person
1887
+ * its real-approval demand and cross-boundary member, its rewrite) under the hook provenance the engine stamps. Over an ask, that ask keeps every member,
1888
+ * takes the hook provenance and the hook's real-approval demand and cross-boundary member, and its message carries the hook's beside its own — a person
1852
1889
  * clearing one ask that stands for two gates sees both reasons.
1853
1890
  */
1854
1891
  export declare function foldHookAsk(verdict: Exclude<PermissionResult, {
@@ -1879,6 +1916,9 @@ export declare function ownArgs<T>(v: T, root?: string): {
1879
1916
  reason: string;
1880
1917
  cause?: unknown;
1881
1918
  };
1919
+ /** A call's argument reading (the loop's: the tool's preparation, the schema's coercions) whose every value is engine-owned
1920
+ * like a pass's args ({@link ownArgs}) — the gate's face seat and the resumed call's belt seat read through this one. */
1921
+ export declare function ownedReading(read: (args: unknown) => unknown): (args: unknown) => unknown;
1882
1922
  /**
1883
1923
  * A label for a value that was THROWN at us, safe to put in a fail-closed refusal. Never coerces: `String(x)`
1884
1924
  * throws on a null-prototype object or a untrusted `toString`/`Symbol.toPrimitive`, and the thrower here is
@@ -1983,10 +2023,14 @@ export type ResolverArmResult = (Extract<ResolvedAsk, {
1983
2023
  action: "allow";
1984
2024
  }> & {
1985
2025
  settlement?: Settlement;
1986
- }) | (Extract<ResolvedAsk, {
2026
+ bindingRefusal?: undefined;
2027
+ })
2028
+ /** `bindingRefusal`: the arm refused arguments no approval can be bound to — the record carries the sentence. */
2029
+ | (Extract<ResolvedAsk, {
1987
2030
  action: "deny";
1988
2031
  }> & {
1989
2032
  settlement: Settlement;
2033
+ bindingRefusal?: string;
1990
2034
  });
1991
2035
  /**
1992
2036
  * The DIRECTIONAL format controls, as a closed set (see {@link AskRequest.hasBidiControls}):