@sema-agent/core 7.67.2 → 7.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) hide show
  1. package/CHANGELOG.md +1533 -0
  2. package/README.md +18 -9
  3. package/README.zh-CN.md +16 -8
  4. package/dist/agents/agent-definition.d.ts +1 -1
  5. package/dist/agents/agent-definition.js +4 -1
  6. package/dist/agents/cascade.d.ts +2 -2
  7. package/dist/agents/cascade.js +3 -1
  8. package/dist/agents/cumulative-stats.d.ts +2 -1
  9. package/dist/agents/cumulative-stats.js +4 -1
  10. package/dist/agents/list-agents-tool.d.ts +30 -0
  11. package/dist/agents/list-agents-tool.js +45 -3
  12. package/dist/agents/peer-admission.d.ts +2 -2
  13. package/dist/agents/peer-session-drain.d.ts +2 -0
  14. package/dist/agents/peer-session-drain.js +1 -0
  15. package/dist/agents/repair-loop.js +3 -1
  16. package/dist/agents/retain-ledger.d.ts +61 -8
  17. package/dist/agents/retain-ledger.js +25 -3
  18. package/dist/agents/roster-store.d.ts +4 -2
  19. package/dist/agents/send-message-tool.d.ts +1 -1
  20. package/dist/agents/send-message-tool.js +20 -15
  21. package/dist/agents/subagent-steps.js +2 -10
  22. package/dist/agents/subagent.d.ts +3 -0
  23. package/dist/agents/subagent.js +106 -76
  24. package/dist/agents/tool-filter.d.ts +20 -11
  25. package/dist/agents/tool-filter.js +8 -4
  26. package/dist/agents/verify.d.ts +3 -1
  27. package/dist/agents/verify.js +2 -0
  28. package/dist/brain/anthropic.js +4 -4
  29. package/dist/brain/errors.d.ts +20 -0
  30. package/dist/brain/errors.js +114 -0
  31. package/dist/brain/open-responses.js +3 -1
  32. package/dist/brain/openai.js +3 -1
  33. package/dist/brain/provider-message.d.ts +5 -3
  34. package/dist/brain/provider-message.js +35 -8
  35. package/dist/brain/reasoning-request.d.ts +73 -19
  36. package/dist/brain/reasoning-request.js +164 -72
  37. package/dist/brain/reasoning-stamp.d.ts +26 -0
  38. package/dist/brain/reasoning-stamp.js +10 -0
  39. package/dist/brain/reasoning.d.ts +95 -162
  40. package/dist/brain/reasoning.js +31 -86
  41. package/dist/brain/route-adjudicator.d.ts +9 -7
  42. package/dist/brain/route-adjudicator.js +12 -10
  43. package/dist/brain/status-sink.d.ts +19 -64
  44. package/dist/brain/status-sink.js +5 -21
  45. package/dist/brain/stream-engine.d.ts +11 -2
  46. package/dist/brain/stream-engine.js +10 -0
  47. package/dist/core/a2a.d.ts +17 -5
  48. package/dist/core/a2a.js +11 -3
  49. package/dist/core/allow-entry.d.ts +35 -15
  50. package/dist/core/allow-entry.js +47 -60
  51. package/dist/core/ask-headline.d.ts +68 -0
  52. package/dist/core/ask-headline.js +23 -0
  53. package/dist/core/ask-origin.d.ts +36 -8
  54. package/dist/core/ask-origin.js +17 -10
  55. package/dist/core/ask-question.d.ts +34 -7
  56. package/dist/core/ask-question.js +10 -1
  57. package/dist/core/ask-unresolvable-notice.d.ts +7 -0
  58. package/dist/core/ask-unresolvable-notice.js +9 -3
  59. package/dist/core/auto-strip.d.ts +53 -0
  60. package/dist/core/auto-strip.js +76 -0
  61. package/dist/core/background-agent-store.d.ts +45 -5
  62. package/dist/core/background-agent-store.js +69 -15
  63. package/dist/core/background-shell.d.ts +2 -2
  64. package/dist/core/caller-text.js +2 -2
  65. package/dist/core/canonical-json.d.ts +13 -0
  66. package/dist/core/canonical-json.js +7 -0
  67. package/dist/core/checkpoint-features.d.ts +66 -20
  68. package/dist/core/checkpoint-features.js +12 -1
  69. package/dist/core/checkpoint-generation.d.ts +1 -1
  70. package/dist/core/checkpoint-queries.d.ts +1 -1
  71. package/dist/core/checkpoint-queries.js +4 -1
  72. package/dist/core/checkpoint-requirements.d.ts +25 -1
  73. package/dist/core/checkpoint-requirements.js +5 -1
  74. package/dist/core/checkpoint-row-verdict.d.ts +1 -0
  75. package/dist/core/checkpoint-row-verdict.js +4 -0
  76. package/dist/core/checkpoint-store.d.ts +66 -38
  77. package/dist/core/checkpoint-store.js +15 -6
  78. package/dist/core/child-clamp-seats.d.ts +6 -0
  79. package/dist/core/child-clamp-seats.js +1 -0
  80. package/dist/core/config-refusal-codes.d.ts +1 -1
  81. package/dist/core/config-refusal-codes.js +1 -0
  82. package/dist/core/delegation-frames.d.ts +9 -12
  83. package/dist/core/delegation-frames.js +9 -8
  84. package/dist/core/engine-capabilities.d.ts +21 -8
  85. package/dist/core/engine-capabilities.js +1 -1
  86. package/dist/core/engine-notice.d.ts +147 -34
  87. package/dist/core/engine-notice.js +27 -16
  88. package/dist/core/engine-storage-backend.d.ts +2 -1
  89. package/dist/core/env-budget.js +3 -3
  90. package/dist/core/env-knob-announce.d.ts +10 -10
  91. package/dist/core/env-knob-announce.js +3 -6
  92. package/dist/core/file-history-store.d.ts +29 -4
  93. package/dist/core/file-history-store.js +13 -0
  94. package/dist/core/frame-settlement.d.ts +2 -1
  95. package/dist/core/gate-fold.js +1 -1
  96. package/dist/core/gate-lanes.js +56 -49
  97. package/dist/core/governance-codes.d.ts +39 -3
  98. package/dist/core/governance-codes.js +61 -3
  99. package/dist/core/hooks.d.ts +29 -11
  100. package/dist/core/hooks.js +5 -2
  101. package/dist/core/human-input-projection.js +3 -3
  102. package/dist/core/input-author.d.ts +17 -3
  103. package/dist/core/input-author.js +15 -3
  104. package/dist/core/leg-identity.d.ts +10 -28
  105. package/dist/core/leg-identity.js +1 -21
  106. package/dist/core/lsp.d.ts +18 -13
  107. package/dist/core/lsp.js +30 -22
  108. package/dist/core/mailbox-store.d.ts +1 -1
  109. package/dist/core/mailbox-store.js +4 -4
  110. package/dist/core/mcp-connection-pool.d.ts +93 -4
  111. package/dist/core/mcp-connection-pool.js +104 -1
  112. package/dist/core/mcp-failure.d.ts +38 -12
  113. package/dist/core/mcp-failure.js +9 -13
  114. package/dist/core/mcp-probe.d.ts +4 -3
  115. package/dist/core/mcp-server-link.d.ts +4 -2
  116. package/dist/core/mcp-server-link.js +4 -5
  117. package/dist/core/mcp-server-spec.d.ts +3 -3
  118. package/dist/core/mcp-server-unavailable-notice.d.ts +22 -8
  119. package/dist/core/mcp-server-unavailable-notice.js +18 -4
  120. package/dist/core/mcp.d.ts +40 -6
  121. package/dist/core/mcp.js +39 -13
  122. package/dist/core/memory-engine/content-origin.js +2 -2
  123. package/dist/core/memory-engine/control-objects.d.ts +2 -4
  124. package/dist/core/memory-engine/control-objects.js +2 -10
  125. package/dist/core/memory-engine/delegation-settlement.js +6 -1
  126. package/dist/core/memory-engine/dual-root.js +3 -0
  127. package/dist/core/memory-engine/engine.d.ts +6 -4
  128. package/dist/core/memory-engine/engine.js +32 -29
  129. package/dist/core/memory-engine/file-backend.d.ts +20 -5
  130. package/dist/core/memory-engine/file-backend.js +21 -31
  131. package/dist/core/memory-engine/frontmatter.d.ts +2 -0
  132. package/dist/core/memory-engine/frontmatter.js +4 -0
  133. package/dist/core/memory-engine/layout.d.ts +114 -20
  134. package/dist/core/memory-engine/layout.js +340 -22
  135. package/dist/core/memory-engine/memory-deployment.d.ts +7 -5
  136. package/dist/core/memory-engine/mount-failed-notice.d.ts +19 -7
  137. package/dist/core/memory-engine/mount-failed-notice.js +43 -10
  138. package/dist/core/memory-engine/sync-client.js +4 -5
  139. package/dist/core/model-fallbacks.d.ts +5 -1
  140. package/dist/core/model-fallbacks.js +3 -3
  141. package/dist/core/model-receipt.d.ts +2 -1
  142. package/dist/core/model-receipt.js +12 -1
  143. package/dist/core/mods/kernel/dispatch.d.ts +2 -2
  144. package/dist/core/mods/kernel/dispatch.js +14 -6
  145. package/dist/core/mods/kernel/events.d.ts +8 -5
  146. package/dist/core/mods/kernel/events.js +2 -2
  147. package/dist/core/mods/kernel/index.d.ts +1 -1
  148. package/dist/core/mods/kernel/registration.d.ts +9 -0
  149. package/dist/core/mods/package.js +1 -1
  150. package/dist/core/mods/session-append.d.ts +4 -2
  151. package/dist/core/mods/session-append.js +3 -0
  152. package/dist/core/mods/stations.d.ts +7 -11
  153. package/dist/core/mods/stations.js +4 -7
  154. package/dist/core/mods/tool-call.d.ts +10 -8
  155. package/dist/core/mods/tool-call.js +15 -18
  156. package/dist/core/mounted-mcp.d.ts +0 -4
  157. package/dist/core/mounted-mcp.js +1 -1
  158. package/dist/core/park-noun.d.ts +24 -0
  159. package/dist/core/park-noun.js +21 -0
  160. package/dist/core/park-resumability.d.ts +60 -0
  161. package/dist/core/park-resumability.js +30 -0
  162. package/dist/core/permission-rule-provider.d.ts +24 -2
  163. package/dist/core/permission-rule-provider.js +11 -8
  164. package/dist/core/permission-rule-store.d.ts +8 -1
  165. package/dist/core/permission-rule-store.js +2 -3
  166. package/dist/core/permission-rules.d.ts +2 -1
  167. package/dist/core/permission-rules.js +8 -4
  168. package/dist/core/persisted-rule-arms.d.ts +3 -0
  169. package/dist/core/persisted-rule-arms.js +2 -1
  170. package/dist/core/present-plan-tool.d.ts +47 -3
  171. package/dist/core/present-plan-tool.js +62 -4
  172. package/dist/core/principal-name.d.ts +1 -1
  173. package/dist/core/principal-name.js +5 -5
  174. package/dist/core/process-identity.js +10 -5
  175. package/dist/core/protocol-http-auth.d.ts +30 -9
  176. package/dist/core/protocol-http-auth.js +113 -59
  177. package/dist/core/read-only-shell.js +9 -5
  178. package/dist/core/redaction-marks.d.ts +4 -26
  179. package/dist/core/redaction-marks.js +9 -21
  180. package/dist/core/remote-env.d.ts +43 -16
  181. package/dist/core/remote-env.js +1 -1
  182. package/dist/core/request-copy-projection.d.ts +1 -1
  183. package/dist/core/request-copy-projection.js +40 -50
  184. package/dist/core/resume-config-judge.js +1 -1
  185. package/dist/core/resume-startup-cause.d.ts +35 -18
  186. package/dist/core/resume-startup-cause.js +13 -10
  187. package/dist/core/retention.d.ts +167 -25
  188. package/dist/core/retention.js +100 -20
  189. package/dist/core/roles.d.ts +6 -0
  190. package/dist/core/roles.js +11 -5
  191. package/dist/core/rule-lane-reads.d.ts +3 -0
  192. package/dist/core/rule-lane-reads.js +5 -1
  193. package/dist/core/rule-store-fault.d.ts +70 -0
  194. package/dist/core/rule-store-fault.js +102 -0
  195. package/dist/core/runner/advertised-writable-dirs.js +16 -31
  196. package/dist/core/runner/announce-once-ledger.d.ts +19 -2
  197. package/dist/core/runner/announce-once-ledger.js +24 -2
  198. package/dist/core/runner/assemble-result.d.ts +6 -0
  199. package/dist/core/runner/assemble-result.js +1 -1
  200. package/dist/core/runner/auto-strip-notice.d.ts +36 -0
  201. package/dist/core/runner/auto-strip-notice.js +59 -0
  202. package/dist/core/runner/branch-window.d.ts +3 -0
  203. package/dist/core/runner/branch-window.js +37 -0
  204. package/dist/core/runner/caller-roster.d.ts +8 -3
  205. package/dist/core/runner/capability-withheld-seat.js +3 -9
  206. package/dist/core/runner/clock-and-limits.d.ts +22 -1
  207. package/dist/core/runner/clock-and-limits.js +30 -0
  208. package/dist/core/runner/contracts.d.ts +58 -35
  209. package/dist/core/runner/credential-refusal-seat.d.ts +2 -0
  210. package/dist/core/runner/credential-refusal-seat.js +47 -0
  211. package/dist/core/runner/cross-boundary-lane.js +6 -4
  212. package/dist/core/runner/decide-continuation.js +1 -1
  213. package/dist/core/runner/file-history-restore.d.ts +53 -2
  214. package/dist/core/runner/file-history-restore.js +29 -10
  215. package/dist/core/runner/forward-sink.d.ts +14 -1
  216. package/dist/core/runner/forward-sink.js +14 -12
  217. package/dist/core/runner/gate-exit.d.ts +8 -7
  218. package/dist/core/runner/gate-exit.js +13 -13
  219. package/dist/core/runner/git-status-frame.js +2 -4
  220. package/dist/core/runner/initial-run-state.js +1 -1
  221. package/dist/core/runner/main-call-account.d.ts +3 -1
  222. package/dist/core/runner/main-call-account.js +5 -3
  223. package/dist/core/runner/mcp-redial.d.ts +2 -5
  224. package/dist/core/runner/mcp-redial.js +2 -2
  225. package/dist/core/runner/nested-memory-content.d.ts +7 -1
  226. package/dist/core/runner/nested-memory-content.js +73 -13
  227. package/dist/core/runner/nested-memory-lane.d.ts +44 -19
  228. package/dist/core/runner/nested-memory-lane.js +152 -76
  229. package/dist/core/runner/park-commit.js +3 -1
  230. package/dist/core/runner/permission-rule-lanes.d.ts +8 -2
  231. package/dist/core/runner/permission-rule-lanes.js +29 -3
  232. package/dist/core/runner/person-path-rows.d.ts +3 -11
  233. package/dist/core/runner/person-path-rows.js +21 -24
  234. package/dist/core/runner/prepare-acquire-reconcile.js +3 -1
  235. package/dist/core/runner/prepare-artifact.d.ts +1 -1
  236. package/dist/core/runner/prepare-artifact.js +20 -14
  237. package/dist/core/runner/prepare-ask-lane.d.ts +9 -6
  238. package/dist/core/runner/prepare-ask-lane.js +6 -5
  239. package/dist/core/runner/prepare-boundary-parks.d.ts +7 -1
  240. package/dist/core/runner/prepare-boundary-parks.js +27 -24
  241. package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -2
  242. package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
  243. package/dist/core/runner/prepare-config-doors.d.ts +9 -24
  244. package/dist/core/runner/prepare-config-doors.js +58 -41
  245. package/dist/core/runner/prepare-context-lane.d.ts +2 -2
  246. package/dist/core/runner/prepare-context-lane.js +3 -5
  247. package/dist/core/runner/prepare-defer-classify.d.ts +1 -1
  248. package/dist/core/runner/prepare-defer-classify.js +1 -1
  249. package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
  250. package/dist/core/runner/prepare-delegation-surface.js +3 -2
  251. package/dist/core/runner/prepare-file-history.d.ts +62 -26
  252. package/dist/core/runner/prepare-file-history.js +117 -46
  253. package/dist/core/runner/prepare-gate-stations.d.ts +4 -0
  254. package/dist/core/runner/prepare-gate-stations.js +6 -5
  255. package/dist/core/runner/prepare-hands-readface.d.ts +9 -4
  256. package/dist/core/runner/prepare-hands-readface.js +8 -4
  257. package/dist/core/runner/prepare-inherited-gate.d.ts +11 -4
  258. package/dist/core/runner/prepare-inherited-gate.js +6 -6
  259. package/dist/core/runner/prepare-listings.d.ts +1 -1
  260. package/dist/core/runner/prepare-listings.js +1 -1
  261. package/dist/core/runner/prepare-memory.js +2 -2
  262. package/dist/core/runner/prepare-offload-wrappers.d.ts +1 -1
  263. package/dist/core/runner/prepare-offload-wrappers.js +1 -1
  264. package/dist/core/runner/prepare-park-ask.d.ts +10 -3
  265. package/dist/core/runner/prepare-park-ask.js +7 -9
  266. package/dist/core/runner/prepare-policy-chain.d.ts +18 -9
  267. package/dist/core/runner/prepare-policy-chain.js +18 -13
  268. package/dist/core/runner/prepare-project-context.d.ts +1 -1
  269. package/dist/core/runner/prepare-project-context.js +5 -3
  270. package/dist/core/runner/prepare-prompt-assembly.js +2 -1
  271. package/dist/core/runner/prepare-prompt-inputs.d.ts +2 -2
  272. package/dist/core/runner/prepare-prompt-inputs.js +1 -1
  273. package/dist/core/runner/prepare-protocol-tools.d.ts +4 -5
  274. package/dist/core/runner/prepare-protocol-tools.js +7 -7
  275. package/dist/core/runner/prepare-question-face.d.ts +4 -2
  276. package/dist/core/runner/prepare-run-refs.d.ts +7 -2
  277. package/dist/core/runner/prepare-run-refs.js +8 -7
  278. package/dist/core/runner/prepare-safety-scan.d.ts +4 -3
  279. package/dist/core/runner/prepare-suspend-saga.d.ts +3 -7
  280. package/dist/core/runner/prepare-suspend-saga.js +4 -3
  281. package/dist/core/runner/prepare-task.js +66 -53
  282. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +3 -2
  283. package/dist/core/runner/prepare-tool-disclosure-mount.js +2 -1
  284. package/dist/core/runner/prepare-turn-wiring.d.ts +3 -1
  285. package/dist/core/runner/prepare-turn-wiring.js +1 -1
  286. package/dist/core/runner/prepare-wiring-manifest.d.ts +9 -4
  287. package/dist/core/runner/prepare-wiring-manifest.js +14 -6
  288. package/dist/core/runner/prepare-workspace-restore.d.ts +4 -4
  289. package/dist/core/runner/prepare-workspace-restore.js +15 -6
  290. package/dist/core/runner/remote-env-retry.d.ts +3 -3
  291. package/dist/core/runner/restore-seat.d.ts +41 -0
  292. package/dist/core/runner/restore-seat.js +38 -0
  293. package/dist/core/runner/resume-admission.js +1 -1
  294. package/dist/core/runner/resume-apply.js +4 -3
  295. package/dist/core/runner/resume-checkpoint-screen.js +2 -1
  296. package/dist/core/runner/resume-internals-and-config.js +2 -1
  297. package/dist/core/runner/resume-preflight.js +2 -1
  298. package/dist/core/runner/rewind-files.js +22 -6
  299. package/dist/core/runner/rule-store-unreadable-notice.d.ts +8 -0
  300. package/dist/core/runner/rule-store-unreadable-notice.js +11 -0
  301. package/dist/core/runner/run-brain-sinks.d.ts +3 -6
  302. package/dist/core/runner/run-brain-sinks.js +6 -6
  303. package/dist/core/runner/run-compaction-machinery.d.ts +2 -2
  304. package/dist/core/runner/run-git-lane.d.ts +2 -0
  305. package/dist/core/runner/run-git-lane.js +2 -1
  306. package/dist/core/runner/run-harness-handlers.js +5 -4
  307. package/dist/core/runner/run-identity-wiring.js +20 -12
  308. package/dist/core/runner/run-leg.js +31 -72
  309. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  310. package/dist/core/runner/run-notification-lane.js +2 -4
  311. package/dist/core/runner/run-reasoning-seat.d.ts +5 -6
  312. package/dist/core/runner/run-reasoning-seat.js +13 -18
  313. package/dist/core/runner/run-settle-and-teardown.js +13 -9
  314. package/dist/core/runner/run-terminal-adoption.js +4 -8
  315. package/dist/core/runner/run-turn-boundary.js +6 -3
  316. package/dist/core/runner/runtask.d.ts +9 -4
  317. package/dist/core/runner/runtask.js +29 -22
  318. package/dist/core/runner/session-rule-policy.d.ts +11 -1
  319. package/dist/core/runner/shell-env-withheld.js +2 -7
  320. package/dist/core/runner/side-call-account.d.ts +5 -6
  321. package/dist/core/runner/side-call-account.js +2 -2
  322. package/dist/core/runner/stream-lifecycle-verbs.d.ts +3 -0
  323. package/dist/core/runner/stream-lifecycle-verbs.js +5 -3
  324. package/dist/core/runner/stream-settle-backstop.js +4 -6
  325. package/dist/core/runner/stream-steer-verb.d.ts +1 -1
  326. package/dist/core/runner/stream-steer-verb.js +4 -4
  327. package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -3
  328. package/dist/core/runner/sub-agent-deny-lists.js +7 -4
  329. package/dist/core/runner/teardown-bounded.d.ts +7 -0
  330. package/dist/core/runner/teardown-bounded.js +7 -0
  331. package/dist/core/runner/terminal-account.js +41 -13
  332. package/dist/core/runner/terminal-projection.d.ts +1 -5
  333. package/dist/core/runner/tool-end-body.d.ts +9 -3
  334. package/dist/core/runner/tool-end-body.js +6 -3
  335. package/dist/core/runner/tool-output-projection.d.ts +13 -4
  336. package/dist/core/runner/tool-output-projection.js +10 -14
  337. package/dist/core/runner/turn-attachments.d.ts +3 -2
  338. package/dist/core/runner/turn-attachments.js +12 -5
  339. package/dist/core/runner-deps.d.ts +6 -6
  340. package/dist/core/runtime-caps.d.ts +2 -1
  341. package/dist/core/secret-env.d.ts +20 -3
  342. package/dist/core/secret-env.js +13 -15
  343. package/dist/core/session-checkout.d.ts +115 -15
  344. package/dist/core/session-checkout.js +435 -136
  345. package/dist/core/session-policy-store.js +21 -3
  346. package/dist/core/session-reconcile.js +1 -0
  347. package/dist/core/session-store.js +2 -0
  348. package/dist/core/session.d.ts +11 -1
  349. package/dist/core/shell-run-candidates.d.ts +1 -0
  350. package/dist/core/shell-run-candidates.js +1 -1
  351. package/dist/core/shutdown-debug.d.ts +6 -5
  352. package/dist/core/shutdown-debug.js +5 -1
  353. package/dist/core/skill-grant.js +4 -1
  354. package/dist/core/skills-directory.js +5 -3
  355. package/dist/core/spec-contract.d.ts +1 -1
  356. package/dist/core/store-contracts/checkpoint-store-contract.js +2 -7
  357. package/dist/core/store-contracts/file-history-store-contract.js +26 -2
  358. package/dist/core/store-contracts/session-deletion-cascade-contract.js +130 -14
  359. package/dist/core/store-contracts/task-list-store-contract.d.ts +2 -1
  360. package/dist/core/store-contracts/task-list-store-contract.js +28 -1
  361. package/dist/core/task-event.d.ts +48 -27
  362. package/dist/core/task-notification.d.ts +15 -9
  363. package/dist/core/task-notification.js +12 -0
  364. package/dist/core/task-registry-agent.d.ts +24 -22
  365. package/dist/core/task-registry-agent.js +65 -46
  366. package/dist/core/task-registry-shared.d.ts +17 -5
  367. package/dist/core/task-registry.d.ts +17 -6
  368. package/dist/core/task-registry.js +6 -1
  369. package/dist/core/task-result.d.ts +71 -25
  370. package/dist/core/task-spec-members.d.ts +0 -1
  371. package/dist/core/task-spec-members.js +1 -1
  372. package/dist/core/task-spec.d.ts +60 -52
  373. package/dist/core/task-stream.d.ts +45 -12
  374. package/dist/core/terminal-cause.d.ts +45 -8
  375. package/dist/core/terminal-cause.js +5 -0
  376. package/dist/core/tool-card-bound.d.ts +32 -0
  377. package/dist/core/tool-card-bound.js +33 -0
  378. package/dist/core/tool-catalog-entries.d.ts +9 -0
  379. package/dist/core/tool-catalog-entries.js +48 -0
  380. package/dist/core/tool-errors.d.ts +4 -3
  381. package/dist/core/tool-face.d.ts +3 -3
  382. package/dist/core/tool-mount-facts.d.ts +3 -2
  383. package/dist/core/tool-mount-facts.js +1 -1
  384. package/dist/core/tool-mount-static.js +7 -5
  385. package/dist/core/tool-policy.d.ts +21 -19
  386. package/dist/core/tool-policy.js +5 -6
  387. package/dist/core/tool-registry.d.ts +3 -1
  388. package/dist/core/tool-registry.js +15 -1
  389. package/dist/core/tool-result-store.d.ts +9 -3
  390. package/dist/core/tool-result-store.js +14 -1
  391. package/dist/core/tool-roster.d.ts +6 -0
  392. package/dist/core/tool-roster.js +18 -0
  393. package/dist/core/tool-spec.d.ts +17 -8
  394. package/dist/core/trace.d.ts +35 -31
  395. package/dist/core/types.d.ts +2 -2
  396. package/dist/core/untrusted-egress.d.ts +19 -7
  397. package/dist/core/untrusted-egress.js +26 -7
  398. package/dist/core/untrusted-text.d.ts +6 -18
  399. package/dist/core/untrusted-text.js +11 -4
  400. package/dist/core/user-attachment.d.ts +9 -6
  401. package/dist/core/user-attachment.js +12 -10
  402. package/dist/core/user-row-origin.d.ts +44 -25
  403. package/dist/core/user-row-origin.js +30 -20
  404. package/dist/core/wiring-manifest.d.ts +26 -7
  405. package/dist/core/wiring-manifest.js +14 -11
  406. package/dist/core/workspace-snapshot.d.ts +3 -1
  407. package/dist/core/workspace-snapshot.js +1 -0
  408. package/dist/engine/execution-env/node-execution-env.d.ts +23 -16
  409. package/dist/engine/execution-env/node-execution-env.js +127 -67
  410. package/dist/engine/harness/agent-harness.d.ts +4 -5
  411. package/dist/engine/harness/agent-harness.js +2 -7
  412. package/dist/engine/harness/types.d.ts +51 -19
  413. package/dist/engine/harness/types.js +28 -1
  414. package/dist/engine/llm/types.d.ts +26 -14
  415. package/dist/engine/llm/types.js +2 -2
  416. package/dist/engine/loop/agent-loop.d.ts +2 -2
  417. package/dist/engine/loop/agent-loop.js +51 -275
  418. package/dist/engine/loop/types.d.ts +0 -18
  419. package/dist/engine/session/import-validate.d.ts +3 -0
  420. package/dist/engine/session/import-validate.js +34 -2
  421. package/dist/engine/session/repo-utils.d.ts +42 -4
  422. package/dist/engine/session/repo-utils.js +33 -5
  423. package/dist/engine/session/session.d.ts +41 -14
  424. package/dist/engine/session/session.js +96 -25
  425. package/dist/index.d.ts +21 -16
  426. package/dist/index.js +16 -10
  427. package/dist/orchestration/run-spec.d.ts +1 -1
  428. package/dist/orchestration/run-workflow-tool.d.ts +12 -9
  429. package/dist/orchestration/run-workflow-tool.js +15 -19
  430. package/dist/orchestration/workflow-governance.js +13 -21
  431. package/dist/orchestration/workflow-observe.d.ts +4 -3
  432. package/dist/orchestration/workflow-primitives.d.ts +1 -1
  433. package/dist/orchestration/workflow-record-artifact.d.ts +14 -0
  434. package/dist/orchestration/workflow-record-artifact.js +32 -0
  435. package/dist/orchestration/workflow-script-store.d.ts +9 -0
  436. package/dist/orchestration/workflow-script-store.js +20 -1
  437. package/dist/orchestration/workflow-types.d.ts +33 -3
  438. package/dist/orchestration/workflow.d.ts +24 -14
  439. package/dist/orchestration/workflow.js +52 -23
  440. package/dist/prompt-assembly/artifact.js +4 -8
  441. package/dist/prompt-assembly/catalog/engine.d.ts +263 -0
  442. package/dist/prompt-assembly/catalog/engine.js +30 -0
  443. package/dist/prompt-assembly/catalog/index.d.ts +1 -1
  444. package/dist/prompt-assembly/catalog/index.js +2 -2
  445. package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.d.ts +1 -1
  446. package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.js +29 -0
  447. package/dist/prompt-assembly/epoch.js +6 -8
  448. package/dist/prompt-assembly/turn-snapshot.js +8 -9
  449. package/dist/stores/file/background-agent-store.js +5 -6
  450. package/dist/stores/file/checkpoint-store.d.ts +0 -4
  451. package/dist/stores/file/checkpoint-store.js +7 -3
  452. package/dist/stores/file/file-history-store.d.ts +8 -0
  453. package/dist/stores/file/file-history-store.js +72 -0
  454. package/dist/stores/file/fs-atomic.js +17 -12
  455. package/dist/stores/file/index.js +11 -5
  456. package/dist/stores/file/mailbox-store.js +13 -4
  457. package/dist/stores/file/permission-rule-store.js +14 -13
  458. package/dist/stores/file/shared-ledger.d.ts +4 -0
  459. package/dist/stores/file/shared-ledger.js +4 -0
  460. package/dist/stores/file/task-list-store.js +12 -3
  461. package/dist/stores/file/workflow-run-store.js +1 -0
  462. package/dist/tools/fs/bash-program-position.d.ts +4 -2
  463. package/dist/tools/fs/bash-program-position.js +1 -1
  464. package/dist/tools/fs/bash-readonly-classifier.js +1 -1
  465. package/dist/tools/fs/bound-open.d.ts +97 -0
  466. package/dist/tools/fs/bound-open.js +103 -0
  467. package/dist/tools/fs/containment-face.d.ts +2 -2
  468. package/dist/tools/fs/fs-pdf.d.ts +7 -1
  469. package/dist/tools/fs/fs-pdf.js +31 -23
  470. package/dist/tools/fs/fs-read.d.ts +24 -17
  471. package/dist/tools/fs/fs-read.js +84 -53
  472. package/dist/tools/fs/fs-shared.d.ts +14 -12
  473. package/dist/tools/fs/fs-shared.js +5 -4
  474. package/dist/tools/fs/fs-write.d.ts +2 -2
  475. package/dist/tools/fs/fs-write.js +20 -12
  476. package/dist/tools/fs/index.d.ts +4 -4
  477. package/dist/tools/fs/index.js +2 -2
  478. package/dist/tools/fs/notebook.d.ts +1 -1
  479. package/dist/tools/fs/pdf.d.ts +12 -3
  480. package/dist/tools/fs/pdf.js +22 -9
  481. package/dist/tools/fs/read-deny-home.d.ts +3 -2
  482. package/dist/tools/fs/read-deny-home.js +8 -11
  483. package/dist/tools/fs/safety.d.ts +3 -2
  484. package/dist/tools/fs/shell-read-check.js +10 -9
  485. package/dist/tools/monitor.d.ts +6 -5
  486. package/dist/tools/task-list.d.ts +16 -6
  487. package/dist/tools/task-list.js +4 -0
  488. package/dist/tools/web.d.ts +9 -1
  489. package/dist/tools/web.js +8 -3
  490. package/dist/tools/worktree.d.ts +7 -5
  491. package/dist/tools/worktree.js +4 -3
  492. package/package.json +4 -3
  493. package/test/export-surface.snapshot.json +93 -7
  494. package/wire-changes/core-stores-sql@7.67.3.json +39 -0
  495. package/wire-changes/core-stores-sql@7.68.0.json +39 -0
  496. package/wire-changes/core@7.67.3.json +65 -0
  497. package/wire-changes/core@7.68.0.json +4257 -0
  498. package/wire-changes/mods-kernel@7.67.3.json +39 -0
  499. package/wire-changes/mods-kernel@7.68.0.json +129 -0
  500. package/wire-changes/primitives@7.67.3.json +39 -0
  501. package/wire-changes/primitives@7.68.0.json +253 -0
  502. package/wire-changes/wiki-gate@7.67.3.json +39 -0
  503. package/wire-changes/wiki-gate@7.68.0.json +39 -0
  504. package/dist/core/runner/credential-origin-seat.d.ts +0 -2
  505. package/dist/core/runner/credential-origin-seat.js +0 -20
@@ -10,8 +10,8 @@ import type { ThinkingLevel } from "../internal/harness-types.js";
10
10
  * "xhigh"/"max" on an endpoint whose `reasoning_effort` only accepts up to "high") is observable rather than
11
11
  * silently swallowed or 422'd (design/96 §E honesty red-line; design/46 anti-drift).
12
12
  *
13
- * The brain (openai.ts / anthropic.ts) consumes this. Surfacing the effective intensity to a task result is a
14
- * later config-domain slice (design/96 S6); here it is a pure, tested mapping.
13
+ * The wire applier (reasoning-request.ts) consumes these tables; what a request's keys SAY about the tier is said there,
14
+ * where the keys are written, and the reported resolution is derived from that one answer.
15
15
  */
16
16
  export type ReasoningIntensity = ThinkingLevel;
17
17
  /** The seven tiers in rank order, read off the one rank table — for a sentence that names the closed set. */
@@ -25,21 +25,23 @@ export declare function isThinkingLevel(v: unknown): v is ThinkingLevel;
25
25
  * {@link ThinkingLevel} (an out-of-contract value — a typo'd tier, a caller's own enum — reads as
26
26
  * ABSENCE, never as a declared tier), and it is not the explicit `"off"`.
27
27
  *
28
- * ENTRY gate, deliberately NOT an emitted-a-key guarantee: past this gate the per-FORMAT arms still
29
- * decide what (if anything) lands on the wire — `supportsReasoningEffort:false` on a format whose
30
- * only carrier is the effort key, a `null` levelmap entry, the binary enable keys. Those arms have
31
- * their own reporting shape (the `graded:false` intent-echo family, each pinned with its rationale
32
- * where it lives); this predicate only closes the gate the three appliers used to re-spell.
33
- *
34
- * Single-sourced here because every wire applier (the completions, Messages and Responses arms of
35
- * `applyReasoningToRequest`, in reasoning-request.ts) would otherwise re-spell the same three
36
- * conjuncts while the REPORTING resolver ({@link resolveReasoning}) mirrored one of them, so a
37
- * garbage tier puts ZERO parameters on the wire while the resolution claims a clamped-to-minimal
38
- * gradient. A predicate the appliers and the reporter both call cannot drift.
28
+ * ENTRY gate, deliberately NOT an emitted-a-key guarantee: past this gate the per-lane arms of the wire applier
29
+ * (`applyReasoningToRequest`, reasoning-request.ts) still decide what (if anything) lands on the wire —
30
+ * `supportsReasoningEffort:false` on a lane whose only carrier is the effort key, a `null` levelmap entry, the binary
31
+ * enable keys — and each says, where it writes, what its keys say about the tier.
39
32
  */
40
33
  export declare function reasoningRequestCarried(model: {
41
34
  reasoning?: boolean;
42
35
  }, reasoning: unknown): reasoning is ThinkingLevel;
36
+ /**
37
+ * THE judge of a thinking tier a caller STATES: absent (`undefined`) is the one unset reading and answers itself; one of the seven
38
+ * {@link ThinkingLevel} tiers answers itself; anything else — a typo'd tier, another casing, `null`, a number — is refused by name
39
+ * (`config.invalid_argument`, `detail.field` = `seat`), never read as "no tier". A request that names a tier the engine cannot
40
+ * honor must not run on the provider's own default (a default-on gateway would be thinking on every turn) with nothing said.
41
+ * Asked at every seat where a tier is stated — a task's own `thinking`, a role record's `thinking`, an agent definition's `thinking`, the
42
+ * resolver's `requested` — so one vocabulary has one sentence.
43
+ */
44
+ export declare function judgeThinkingLevel(value: unknown, seat: string): ThinkingLevel | undefined;
43
45
  /** Ordinal rank of a level (`off`=0 … `max`=6). */
44
46
  export declare function rankOf(level: ThinkingLevel): number;
45
47
  /**
@@ -52,7 +54,7 @@ export declare const DEFAULT_EFFORT_LEVELS: readonly ThinkingLevel[];
52
54
  /**
53
55
  * The per-provider thinking wire format (mirrors `compat.thinkingFormat`). `"budget"` is the synthetic tag for
54
56
  * Anthropic's extended-thinking budget path (no `thinkingFormat` — the anthropic brain doesn't read one), kept
55
- * here so {@link resolveReasoning} can report ONE endpoint discriminant across both brain families.
57
+ * here so a request's carriage names ONE dialect-or-lane discriminant across every wire family.
56
58
  */
57
59
  export type ReasoningFormat = "openai" | "openrouter" | "deepseek" | "together" | "zai" | "qwen" | "qwen-chat-template" | "budget"
58
60
  /** Anthropic `output_config.effort` (Fable-5 class, design/119): the tier is a named
@@ -67,39 +69,64 @@ export type ReasoningFormat = "openai" | "openrouter" | "deepseek" | "together"
67
69
  | "responses";
68
70
  /** The chat-completions dialect names — `compat.thinkingFormat` on a completions-family model. */
69
71
  export type CompletionsThinkingFormat = Exclude<ReasoningFormat, "budget" | "effort" | "responses">;
72
+ /** The chat-completions dialect names, in the closed set's order — for a sentence that names the set. */
73
+ export declare const COMPLETIONS_THINKING_FORMATS: readonly CompletionsThinkingFormat[];
74
+ /** Whether `v` is one of the chat-completions dialect names ({@link COMPLETIONS_THINKING_FORMATS}). */
75
+ export declare function isCompletionsThinkingFormat(v: unknown): v is CompletionsThinkingFormat;
70
76
  /**
71
- * The dialect a completions-family model's `compat` names: the declared `thinkingFormat` when it is a string in the closed set
72
- * of {@link COMPLETIONS_OFF_SPELLING}, `"openai"` when none is declared, and `undefined` when what is declared names no dialect
73
- * (a string outside the set, or a value that is not a string — an array or an object is not read as its string form). A model
74
- * with no dialect carries no thinking key of either kind on the wire.
77
+ * THE judge of a completions dialect name — the one read of `compat.thinkingFormat`: absent (or `null`) is no declaration
78
+ * (`undefined`), a name in the closed set of {@link COMPLETIONS_OFF_SPELLING} is itself, and anything else — a string outside the
79
+ * set, an array, a number — is refused by name (`config.invalid_argument`, `detail.field` = `compat.thinkingFormat`), never read
80
+ * as "no dialect". Every reader of the name asks it (through {@link completionsFormatOf} where absence means `"openai"`): the wire
81
+ * applier, {@link offSpelling} (so {@link thinkingOffSpelled} and the answer-only seat), and the model gate's receipt, which
82
+ * refuses the entry before any request is built.
75
83
  */
76
- export declare function completionsFormatOf(compat: {
84
+ export declare function declaredCompletionsFormat(compat: {
77
85
  thinkingFormat?: unknown;
78
86
  }): CompletionsThinkingFormat | undefined;
87
+ /** The completions dialect a request is written in: the judged declaration, `"openai"` when none is declared. */
88
+ export declare function completionsFormatOf(compat: {
89
+ thinkingFormat?: unknown;
90
+ }): CompletionsThinkingFormat;
79
91
  /**
80
92
  * The Open Responses API family — every `Api` value `createOpenResponsesBrain` serves (design/163).
81
- * The SINGLE family discriminant: request-params.ts (reserved-key set selection) and
82
- * {@link resolveReasoning} (format dispatch, #325 review r4) both key off THIS set, so a new
93
+ * The SINGLE family discriminant: request-params.ts (reserved-key set selection) and the wire applier's lane
94
+ * selection (reasoning-request.ts) both key off THIS set, so a new
83
95
  * Responses api value added here reaches every family-scoped behavior instead of one of two twins.
84
96
  */
85
97
  export declare const RESPONSES_APIS: ReadonlySet<string>;
86
- /** How a requested intensity resolved against one endpoint's real capability. */
87
- export interface ReasoningResolution {
98
+ /** The keys every resolution of a requested intensity carries, whatever vocabulary its `effective` speaks. */
99
+ export interface ReasoningResolutionKeys {
88
100
  /** The level the caller asked for. */
89
101
  requested: ThinkingLevel;
90
- /** The level actually in effect after mapping to what the endpoint accepts. */
91
- effective: ThinkingLevel;
92
102
  /**
93
- * True when the endpoint varies behavior by intensity (effort tiers / token budget). False = binary
94
- * enable-only (qwen / zai / qwen-chat-template, an effort endpoint that declares
95
- * `supportsReasoningEffort:false`, or a tier `Model.thinkingLevelMap` maps to `null` — the wire then
96
- * carries NO effort value for it): thinking is on or off and the tier is NOT honored — read this
97
- * alongside {@link effective}, which then echoes the request as intent only.
103
+ * True exactly when `effective` is one of the six enabled tiers — the wire names an intensity. False for `off`, for `on`
104
+ * (thinking is on and no tier rides: a binary enable key, adaptive thinking, a knob-fixed budget, a `null` levelmap entry
105
+ * behind an enable key) and for `provider_default`.
98
106
  */
99
107
  graded: boolean;
100
- /** True when {@link effective} differs from {@link requested} (the request couldn't be honored exactly). */
108
+ /** True exactly when `effective` differs from {@link requested} (the request did not carry the tier as asked). */
101
109
  clamped: boolean;
102
110
  }
111
+ /** How a requested intensity resolved against one endpoint's real capability — the brains' hot-path form: `effective` is one of the
112
+ * seven tiers. The reported face ({@link ResolvedReasoning}) widens `effective` by the one word of {@link ReasoningEffective}. */
113
+ export interface ReasoningResolution extends ReasoningResolutionKeys {
114
+ /** The level actually in effect after mapping to what the endpoint accepts. */
115
+ effective: ThinkingLevel;
116
+ }
117
+ /**
118
+ * The words {@link ResolvedReasoning.effective} can say — what a request's thinking keys SAY, read where they are written
119
+ * (`ReasoningCarriage.said`, in reasoning-request.ts):
120
+ * · one of the seven tiers — the keys name it: `off` is a disable key (or a deployment-declared off value), an enabled tier is
121
+ * the lane's tier key (an effort value, after the clamp; on the Messages budget form with no budget knob, the budget the
122
+ * tier's share sized);
123
+ * · `"on"` — the keys turn thinking on and name no tier (a binary enable key, `thinking:{type:"adaptive"}`, a budget a knob
124
+ * fixed, openrouter's `reasoning` object with no effort in it);
125
+ * · `"provider_default"` — the request put NO thinking key on the wire (the {@link ResolvedReasoning.dropped} arm), so whether
126
+ * the model thinks, and at which tier, is the provider's own default. Never `"off"` for that case: a request that carried
127
+ * nothing says nothing, and a default-on gateway reasons on it.
128
+ */
129
+ export type ReasoningEffective = ThinkingLevel | "on" | "provider_default";
103
130
  /** Anthropic's hard floor for an extended-thinking budget. Lives HERE (not the anthropic brain) so
104
131
  * the cap-wins predicate below and the brain's budget-window math read ONE constant. */
105
132
  export declare const MIN_THINKING_TOKENS = 1024;
@@ -108,12 +135,9 @@ export declare const MIN_THINKING_TOKENS = 1024;
108
135
  * a HARD per-request output cap (an engine-imposed override or the caller's explicit
109
136
  * `options.maxTokens` — the two lanes the brain refuses to raise) too small to host a legal thinking
110
137
  * budget (≥ {@link MIN_THINKING_TOKENS}) plus answer room means the CAP WINS and thinking is skipped
111
- * for the request. Shared by the wire arm (anthropic.ts, which acts on it) and
112
- * {@link resolveReasoning}'s budget arm (which mirrors it when the caller supplies the request
113
- * facts), so the skip decision and its report are one predicate — the reporter's budget arm used to
114
- * claim an unconditional `graded:true` gradient while this arm deleted the thinking block from the
115
- * very request it described. A soft (model/config-sourced) cap never skips: the brain raises it to
116
- * host the budget instead (`hardCap === false`).
138
+ * for the request. Read by the Messages lane of the wire applier, which acts on it and then says what the request
139
+ * carries (nothing, when the skip took the only thinking key). A soft (model/config-sourced) cap never skips: the lane
140
+ * raises it to host the budget instead (`hardCap === false`).
117
141
  */
118
142
  export declare function budgetCapSkipsThinking(outputCapTokens: number, hardCap: boolean): boolean;
119
143
  /** The model slice the off-capability reads: the API family, the reasoning bit, the compat declaration and the levelmap. */
@@ -135,8 +159,7 @@ export interface OffCapabilityModel {
135
159
  export declare function declaredOffSpelling(model: OffCapabilityModel): string | undefined;
136
160
  /**
137
161
  * The model-entry input a wire still needs before it can spell the explicit `"off"` tier — what an operator would add:
138
- * `compat.thinkingFormat` (a completions model that names no dialect the engine can read: none declared on a model that does
139
- * not hold reasoning, or a name outside the closed set), `thinkingLevelMap.off` (an effort-only wire — stock openai completions,
162
+ * `compat.thinkingFormat` (a completions model that does not hold reasoning and declares no dialect), `thinkingLevelMap.off` (an effort-only wire — stock openai completions,
140
163
  * the Responses lane — with no declared off value), or `none` (no declaration spells it: the anthropic adaptive form, an
141
164
  * effort-only endpoint that takes no effort value, a Messages or Responses model that does not hold reasoning).
142
165
  */
@@ -160,8 +183,8 @@ export type OffSpelling = {
160
183
  * - Chat completions: the dialect is the operator's EXPLICIT `compat.thinkingFormat`, whatever the model's `reasoning`
161
184
  * declaration says — a declared dialect is how its disable key is spelled, and sending it never asks the model to think. With
162
185
  * no format declared, a model that holds reasoning is on the default (`openai`) dialect, and one that does not is left to its
163
- * provider's default: the engine does not guess a dialect for it (`compat.thinkingFormat`). A name outside the closed set
164
- * ({@link completionsFormatOf}) is no dialect (`compat.thinkingFormat`). On the dialect: deepseek `{type:"disabled"}`, the
186
+ * provider's default: the engine does not guess a dialect for it (`compat.thinkingFormat`). A name outside the closed set is
187
+ * refused by the one judge ({@link completionsFormatOf}). On the dialect: deepseek `{type:"disabled"}`, the
165
188
  * binary enable keys at `false` and openrouter / together `reasoning:{enabled:false}` always spell it; stock openai is
166
189
  * effort-only (`thinkingLevelMap.off`, or `none`).
167
190
  *
@@ -186,25 +209,16 @@ export declare function offSpelling(model: OffCapabilityModel, api?: string | un
186
209
  * listing (the Claude Code catalog row calls it `supportsThinkingOff`; a host wraps this answer under that name, beside `reasoning`
187
210
  * — `reasoning: true` with this `false` is a model that cannot be turned off). It is DERIVED from the wire table — the API
188
211
  * family, `compat` and `thinkingLevelMap.off` of the entry, and its `reasoning` declaration — so the catalog row grows no key for
189
- * it, the way {@link reasoningEffortLevelsOf} derives the supported tiers: a second, declared copy could only disagree with the
190
- * wire.
212
+ * it, the way `reasoningEffortLevelsOf` (reasoning-request.ts) derives the supported tiers: a second, declared copy could only
213
+ * disagree with the wire.
191
214
  */
192
215
  export declare function thinkingOffSpelled(model: OffCapabilityModel): boolean;
193
216
  /**
194
- * OPTIONAL per-request facts for {@link resolveReasoning} — what the wire's budget arm knows at
195
- * request build that a per-leg eager resolution cannot: the resolved output cap and whether it is a
196
- * HARD bound. Supplied ⇒ the anthropic budget arm mirrors the wire's cap-wins skip
197
- * ({@link budgetCapSkipsThinking}); absent ⇒ the budget arm reports the cap-blind gradient it always
198
- * did (an eager mint that has not yet seen a request has no facts).
199
- *
200
- * Who supplies them, and why it is never the reporting caller's own arithmetic: the adapter
201
- * that BUILT the request reports the pair it judged, through the runner's reasoning-wire-facts sink
202
- * (`status-sink.ts`), from its `onCommitted` hook so a speculatively-built request the overflow
203
- * recovery declined can never be reported as sent. A consumer re-deriving the cap would have to
204
- * re-implement the adapter's precedence chain (engine override > caller `options.maxTokens` >
205
- * `model.maxTokens` > brain-construction default) — a second source of truth for a number only the
206
- * minter can state. The runner then re-resolves with them: the skip and its report stay ONE predicate
207
- * reading ONE set of facts.
217
+ * OPTIONAL output-cap facts for `resolveReasoning` (reasoning-request.ts): the cap the request will carry and whether
218
+ * it is a HARD bound. The resolver hands them to the wire applier as the request body's `max_tokens` and the budget's
219
+ * `capIsHard`, so a Messages budget-form answer weighs the same cap-wins skip ({@link budgetCapSkipsThinking}) the wire
220
+ * does; absent, the applier sees a soft cap that never skips. A Runner leg does not pass them: its first request's own
221
+ * answer reaches the leg's seat on the request's terminal message, which already weighed the cap that request carried.
208
222
  */
209
223
  export interface ReasoningWireFacts {
210
224
  /** The request's resolved output cap (the wire `max_tokens` at the moment the thinking arm judges). */
@@ -214,27 +228,19 @@ export interface ReasoningWireFacts {
214
228
  hardOutputCap: boolean;
215
229
  }
216
230
  /**
217
- * The anthropic-`effortLevels` PRESENCE/SHAPE gate, shared by the wire arm (anthropic.ts) and the
218
- * reporting dispatch below so the two cannot disagree about which family a request rides (#335): the
219
- * old twin predicates were `x && x.length > 0` on both sides, so a truthy NON-ARRAY (a string —
220
- * `.length > 0` holds) entered the wire arm and threw a bare TypeError from its `.filter` pre-clean
221
- * BEFORE {@link resolveEffort}'s centralized non-array fallback could read it as undeclared — while
222
- * the reporter happily described an effort resolution for the same config. Only the container shape
223
- * is judged here; MEMBER validity stays {@link resolveEffort}'s job (its element-level sanitization
224
- * is the single bad-value seat, which is also why the returned array is not member-checked — the cast
225
- * is checked at runtime by every consumer's `resolveEffort` call).
231
+ * The anthropic-`effortLevels` PRESENCE/SHAPE gate the Messages lane of the wire applier reads — whether the request
232
+ * carries its tier as `output_config.effort` (and is reported in the `effort` format) or on the budget form. A truthy
233
+ * NON-ARRAY (a string — `.length > 0` holds) reads as undeclared rather than reaching a `.filter`. Only the container shape
234
+ * is judged here; MEMBER validity is {@link sanitizeEffortLevels}' job (the single bad-value seat).
226
235
  */
227
236
  export declare function declaredEffortLevels(v: unknown): readonly ThinkingLevel[] | undefined;
228
237
  /**
229
238
  * The effort-lane WIRE-VALUE mint — clamp ({@link resolveEffort}) + the `Model.thinkingLevelMap`
230
239
  * translation in ONE place, consumed by both effort-lane arms of `applyReasoningToRequest` (completions,
231
- * Responses) AND the reporting dispatch ({@link resolveReasoning}'s
232
- * arms), so the value that reaches the wire and the resolution a trace/result face claims are two
233
- * reads of one computation, never parallel re-derivations. Map semantics (the field's contract): a
234
- * MISSING key ⇒ provider default (the clamped tier name as-is); a STRING ⇒ that provider-specific
235
- * spelling (same tier, still honored); `null` ⇒ the tier is UNSUPPORTED on this model —
236
- * `wireValue: undefined`, no effort value on the wire (thinking still enables via a format's own
237
- * enable key where one exists), which is exactly the tier-not-honored shape the reporter must echo.
240
+ * Responses): the clamped tier is what the lane's `said` names when the value is written. Map semantics (the field's
241
+ * contract): a MISSING key ⇒ provider default (the clamped tier name as-is); a STRING ⇒ that provider-specific spelling
242
+ * (same tier, still honored); `null` ⇒ the tier is UNSUPPORTED on this model — `wireValue: undefined`, no effort value on
243
+ * the wire (thinking still turns on through a dialect's own enable key where one exists, and the request then says `on`).
238
244
  */
239
245
  export declare function mintEffortWireValue(requested: ThinkingLevel, model: {
240
246
  thinkingLevelMap?: Readonly<Partial<Record<ThinkingLevel, string | null>>>;
@@ -243,74 +249,30 @@ export declare function mintEffortWireValue(requested: ThinkingLevel, model: {
243
249
  wireValue: string | undefined;
244
250
  };
245
251
  /**
246
- * A {@link ReasoningResolution} enriched with the endpoint discriminant, for observability (design/96 S6).
247
- * The brain consumes only the {@link ReasoningResolution} fields to shape the request; `format`/`endpoint`
248
- * are reported (e.g. a `reasoning.resolved` trace event) so a deployment can see WHY a tier was downgraded
249
- * (binary provider) or clamped (effort-set cap) rather than the resolution being silently swallowed (§E honesty).
252
+ * How a requested tier resolved on one request — a pure function of the request (`resolutionOf`, reasoning-request.ts):
253
+ * `effective` is what the request's thinking keys say, and the three booleans are projections of it. The `reasoning.resolved`
254
+ * trace frame and `TaskResult.effectiveReasoning` carry it.
250
255
  */
251
- export interface ResolvedReasoning extends ReasoningResolution {
252
- /** The wire format the request will use (the load-bearing reason for `graded`/`clamped`). */
256
+ export interface ResolvedReasoning extends ReasoningResolutionKeys {
257
+ /** What the request's thinking keys say ({@link ReasoningEffective}): a tier, `"on"`, or `"provider_default"` when the request
258
+ * carried no thinking key at all (the {@link dropped} arm). */
259
+ effective: ReasoningEffective;
260
+ /** The dialect or lane the keys are spelled in — always a member of {@link ReasoningFormat}. */
253
261
  format: ReasoningFormat;
254
262
  /** A coarse endpoint label for the trace (`model.api` — e.g. `openai-completions`, `anthropic-messages`). */
255
263
  endpoint: string;
256
264
  /**
257
- * Present (true) only when the request never CARRIES at all: {@link reasoningRequestCarried} false
258
- * on a non-"off" request — the model does not hold reasoning (`capabilityHeld`: declared false or undeclared),
259
- * OR the requested value is not a valid {@link ThinkingLevel} (an out-of-contract tier every wire
260
- * applier reads as ABSENCE — the same three-conjunct gate all of them share) — or, with
261
- * {@link ReasoningWireFacts} supplied, the anthropic budget path's cap-wins skip
262
- * ({@link budgetCapSkipsThinking}), so NO thinking
263
- * parameter reaches the wire at all — the requested tier is DROPPED entirely, not clamped or
264
- * downgraded-to-binary. `effective:"off"` here states the ENGINE side of that fact (nothing was
265
- * requested), NOT a measured gateway state: on the binary enable-only formats (qwen / zai /
266
- * qwen-chat-template) parameter ABSENCE is provider-default, and a default-on gateway may still
267
- * reason at its own tier — the brains deliberately send no disable key for a model declared
268
- * non-reasoning, so the engine cannot claim a measured off there; `format` tells a consumer which
269
- * family applies (on every other format, absence is the closest the wire has to off — see
270
- * the completions arm's own contract). `format`/`endpoint` report the family that WOULD have carried the
271
- * tier (the why-shape a consumer diagnoses with, not a claim about the request). Absent on every
272
- * reasoning-capable resolution, so existing consumers see byte-identical objects. Loud-bad-values
273
- * rule: the one arm where the request evaporates must not be the one arm with no report.
265
+ * Present (true) exactly when `effective` is `"provider_default"`: the request carried no thinking key at all — the model does
266
+ * not hold reasoning, the wire cannot spell the requested `off`, the lane's only carrier is withheld (`supportsReasoningEffort:
267
+ * false`, a `null` levelmap entry on an effort-only wire), or a hard output cap too small for a legal budget skipped thinking
268
+ * ({@link budgetCapSkipsThinking}). What the provider then does is its own default. `format` / `endpoint` name the family that
269
+ * would have carried the tier. Absent otherwise.
274
270
  */
275
271
  dropped?: true;
276
272
  }
277
- /**
278
- * Resolve a requested intensity against a model END-TO-END, dispatching on its wire format the SAME way the
279
- * brains do — so a trace event and the actual provider request can never drift (design/96 S6). This is the
280
- * single observability-side resolver: the runner calls it at task start to emit `reasoning.resolved`; the
281
- * brains keep calling {@link resolveEffort}/{@link resolveBinary}/{@link reasoningBudgetShare} on the hot path.
282
- *
283
- * - Anthropic (`api === "anthropic-messages"`) → budget-based: the tier sets a budget share, so it's a real
284
- * gradient (`graded:true`) and never tier-clamped (`clamped:false`); reported as `format:"budget"`. With
285
- * the optional {@link ReasoningWireFacts} the arm additionally mirrors the wire's cap-wins skip
286
- * ({@link budgetCapSkipsThinking}: a hard per-request output cap < 2·{@link MIN_THINKING_TOKENS} deletes
287
- * the thinking block) as the drop shape — facts absent keeps the historic cap-blind gradient.
288
- * - Binary enable-only formats (qwen / zai / qwen-chat-template) → `graded:false` (tier not honored).
289
- * - An effort endpoint with `supportsReasoningEffort:false` → `graded:false` (enable key only, no effort tier).
290
- * - Otherwise effort-based → clamp DOWN to the endpoint's `reasoningEffortLevels` (default minimal|low|medium|high).
291
- * - A CLAMPED tier that `model.thinkingLevelMap` maps to `null` (declared unsupported on this model) →
292
- * `graded:false`: both effort-wire appliers key the map by the post-clamp tier and then carry NO effort
293
- * value (thinking still enables via the format's own enable key where one exists), so the tier is not
294
- * honored. A resolver blind to the map reports such a request as exactly honored while the wire
295
- * drops the value — trace/result-face drift.
296
- *
297
- * - A request that never CARRIES ({@link reasoningRequestCarried} false on a non-"off" value: the model's
298
- * `reasoning` capability is not held, or the requested value is not a valid tier — no brain emits any
299
- * thinking parameter for either, whatever the format) → `effective:"off"`, `graded:false`, `clamped:true`,
300
- * `dropped:true` — the loud-drop arm. Describing the capability dispatch instead would report a
301
- * resolution the request never carried, leaving the one arm where the request evaporates as the one
302
- * arm with no disclosure (and an out-of-contract tier reported as a clamped gradient, or echoed as
303
- * `effective` on the binary formats, while the wire carried nothing).
304
- *
305
- * `off`/falsy never enables thinking, so it resolves trivially (no clamp, graded:true) — the caller decides
306
- * whether to emit at all.
307
- */
308
- export declare function resolveReasoning(requested: ThinkingLevel, model: {
309
- api?: string;
310
- reasoning?: boolean;
311
- compat?: unknown;
312
- thinkingLevelMap?: Readonly<Partial<Record<ThinkingLevel, string | null>>>;
313
- }, facts?: ReasoningWireFacts): ResolvedReasoning;
273
+ /** The ONE sanitizer behind every effort clamp set: invalid members dropped ("hgih", a sparse hole, `"off"`), a non-array /
274
+ * empty / no-valid-member declaration reads as undeclared → the conservative default. */
275
+ export declare function sanitizeEffortLevels(allowed: unknown): readonly ThinkingLevel[];
314
276
  /**
315
277
  * Resolve a requested intensity for an effort-based endpoint (`reasoning_effort` / `reasoning.effort`). Picks
316
278
  * the requested tier when supported; otherwise the highest supported tier ≤ requested (clamp DOWN, never
@@ -320,36 +282,7 @@ export declare function resolveReasoning(requested: ThinkingLevel, model: {
320
282
  * valid member); individually invalid MEMBERS (garbage strings, sparse holes, `"off"` — not a legal
321
283
  * member of the 6-tier compat effort sets) are dropped, so they can never become a clamp target.
322
284
  */
323
- /**
324
- * #692 C-c — the effort tiers that actually REACH THE WIRE for this model: the table {@link resolveEffort} clamps
325
- * against, keyed by the model's API family exactly as {@link resolveReasoning} dispatches, gated by the request
326
- * entry predicate (a `reasoning: false` model accepts no tier) and minus the tiers the model's `thinkingLevelMap`
327
- * suppresses (`null` = no effort value on the wire) — the same arms, so a host reading this and the trace's
328
- * `effective` can never disagree:
329
- * - `anthropic-messages` with declared `compat.effortLevels` → that set (the `output_config.effort` lane);
330
- * without it → `undefined` (the BUDGET lane is a token gradient, there is no tier set to clamp to);
331
- * - the Responses family and the completions family → `compat.reasoningEffortLevels` sanitized
332
- * (invalid members dropped, an empty/garbage declaration reads as undeclared) or the conservative
333
- * {@link DEFAULT_EFFORT_LEVELS}; `supportsReasoningEffort: false` (openrouter excepted, whose unified
334
- * knob ignores it) and the binary formats (`qwen` / `zai` / `qwen-chat-template`) → `undefined` (the tier
335
- * is not honored as a gradient on that wire).
336
- * `undefined` therefore means "this wire clamps no tier set", never "unknown": a host that offers a person the
337
- * supported tiers reads THIS, per model, instead of a global default it cannot vouch for. Per API, not per
338
- * model id: the acceptance set is a property of the endpoint's request schema; `Model` grows no key for it.
339
- */
340
- export declare function reasoningEffortLevelsOf(model: {
341
- api?: string;
342
- reasoning?: boolean;
343
- compat?: unknown;
344
- thinkingLevelMap?: Readonly<Partial<Record<ThinkingLevel, string | null>>>;
345
- }): readonly ThinkingLevel[] | undefined;
346
285
  export declare function resolveEffort(requested: ThinkingLevel, allowed?: readonly ThinkingLevel[]): ReasoningResolution;
347
- /**
348
- * Resolve a requested intensity for a binary enable-only endpoint (qwen / zai / qwen-chat-template): the
349
- * provider only takes an on/off switch, so the intensity tier is NOT honored as a gradient. `graded: false`
350
- * is the load-bearing honesty signal.
351
- */
352
- export declare function resolveBinary(requested: ThinkingLevel): ReasoningResolution;
353
286
  /**
354
287
  * Extended-thinking budget as a FRACTION of `max_tokens` per intensity tier, for budget-based endpoints
355
288
  * (Anthropic). Lets a higher intensity actually buy a larger thinking budget — before this, the budget was a
@@ -1,4 +1,5 @@
1
1
  import { capabilityHeld } from "./model-capability.js";
2
+ import { describeRejectedValue } from "../core/tool-search-setting.js";
2
3
  const RANK = {
3
4
  off: 0,
4
5
  minimal: 1,
@@ -15,11 +16,20 @@ export function isThinkingLevel(v) {
15
16
  export function reasoningRequestCarried(model, reasoning) {
16
17
  return capabilityHeld(model, "reasoning") && isThinkingLevel(reasoning) && reasoning !== "off";
17
18
  }
19
+ export function judgeThinkingLevel(value, seat) {
20
+ if (value === undefined)
21
+ return undefined;
22
+ if (isThinkingLevel(value))
23
+ return value;
24
+ const e = new Error(`${seat} must be one of ${THINKING_LEVELS.map((l) => `"${l}"`).join(", ")} when present (got ${describeRejectedValue(value)}) — omit it for no tier ("off" spells thinking off); a value outside the seven tiers is refused, never read as the provider's own default`);
25
+ e.code = "config.invalid_argument";
26
+ e.detail = { field: seat };
27
+ throw e;
28
+ }
18
29
  export function rankOf(level) {
19
30
  return RANK[level];
20
31
  }
21
32
  export const DEFAULT_EFFORT_LEVELS = ["minimal", "low", "medium", "high"];
22
- const BINARY_FORMATS = new Set(["qwen", "zai", "qwen-chat-template"]);
23
33
  const COMPLETIONS_OFF_SPELLING = {
24
34
  openai: "declared",
25
35
  openrouter: "always",
@@ -29,9 +39,23 @@ const COMPLETIONS_OFF_SPELLING = {
29
39
  qwen: "always",
30
40
  "qwen-chat-template": "always",
31
41
  };
42
+ export const COMPLETIONS_THINKING_FORMATS = Object.freeze(Object.keys(COMPLETIONS_OFF_SPELLING));
43
+ export function isCompletionsThinkingFormat(v) {
44
+ return typeof v === "string" && Object.prototype.hasOwnProperty.call(COMPLETIONS_OFF_SPELLING, v);
45
+ }
46
+ export function declaredCompletionsFormat(compat) {
47
+ const declared = compat.thinkingFormat;
48
+ if (declared === undefined || declared === null)
49
+ return undefined;
50
+ if (isCompletionsThinkingFormat(declared))
51
+ return declared;
52
+ const e = new Error(`compat.thinkingFormat must be one of ${COMPLETIONS_THINKING_FORMATS.map((n) => `"${n}"`).join(", ")} when present (got ${describeRejectedValue(declared)}) — omit it for "openai"; a name outside the set is refused, never read as a model with no dialect`);
53
+ e.code = "config.invalid_argument";
54
+ e.detail = { field: "compat.thinkingFormat" };
55
+ throw e;
56
+ }
32
57
  export function completionsFormatOf(compat) {
33
- const declared = compat.thinkingFormat ?? "openai";
34
- return typeof declared === "string" && Object.prototype.hasOwnProperty.call(COMPLETIONS_OFF_SPELLING, declared) ? declared : undefined;
58
+ return declaredCompletionsFormat(compat) ?? "openai";
35
59
  }
36
60
  export const RESPONSES_APIS = new Set(["openai-responses", "azure-openai-responses", "openai-chatgpt-responses"]);
37
61
  export const MIN_THINKING_TOKENS = 1024;
@@ -59,11 +83,10 @@ export function offSpelling(model, api = model.api) {
59
83
  return held && compat.thinkingMode !== "adaptive" ? OFF_SPELLED : offMissing("none");
60
84
  if (api !== undefined && RESPONSES_APIS.has(api))
61
85
  return held ? effortWireOff(model) : offMissing("none");
62
- const declaredFormat = (compat.thinkingFormat ?? undefined) !== undefined;
63
- const format = declaredFormat || held ? completionsFormatOf(compat) : undefined;
64
- if (format === undefined)
86
+ const declared = declaredCompletionsFormat(compat);
87
+ if (declared === undefined && !held)
65
88
  return offMissing("compat.thinkingFormat");
66
- return COMPLETIONS_OFF_SPELLING[format] === "declared" ? effortWireOff(model) : OFF_SPELLED;
89
+ return COMPLETIONS_OFF_SPELLING[declared ?? "openai"] === "declared" ? effortWireOff(model) : OFF_SPELLED;
67
90
  }
68
91
  export function thinkingOffSpelled(model) {
69
92
  return offSpelling(model).spelled;
@@ -81,82 +104,7 @@ export function mintEffortWireValue(requested, model, allowed) {
81
104
  wireValue = mapped;
82
105
  return { resolution, wireValue };
83
106
  }
84
- export function resolveReasoning(requested, model, facts) {
85
- const resolved = dispatchReasoning(requested, model, facts);
86
- if (requested !== "off" && !reasoningRequestCarried(model, requested)) {
87
- return { requested, effective: "off", graded: false, clamped: true, format: resolved.format, endpoint: resolved.endpoint, dropped: true };
88
- }
89
- return resolved;
90
- }
91
- function dispatchReasoning(requested, model, facts) {
92
- const endpoint = model.api ?? "unknown";
93
- const compat = (model.compat ?? {});
94
- if (model.api === "anthropic-messages") {
95
- const declaredAnthropic = declaredEffortLevels(compat.effortLevels);
96
- if (declaredAnthropic !== undefined) {
97
- return { ...resolveEffort(requested, declaredAnthropic), format: "effort", endpoint };
98
- }
99
- if (requested !== "off" &&
100
- compat.thinkingMode !== "adaptive" &&
101
- facts !== undefined &&
102
- budgetCapSkipsThinking(facts.outputCapTokens, facts.hardOutputCap)) {
103
- return { requested, effective: "off", graded: false, clamped: true, format: "budget", endpoint, dropped: true };
104
- }
105
- return { requested, effective: requested, graded: true, clamped: false, format: "budget", endpoint };
106
- }
107
- if (model.api !== undefined && RESPONSES_APIS.has(model.api)) {
108
- if (compat.supportsReasoningEffort === false) {
109
- return { requested, effective: requested, graded: false, clamped: false, format: "responses", endpoint };
110
- }
111
- const responsesMint = mintEffortWireValue(requested, model, compat.reasoningEffortLevels);
112
- if (requested !== "off" && responsesMint.wireValue === undefined) {
113
- return { requested, effective: requested, graded: false, clamped: false, format: "responses", endpoint };
114
- }
115
- return { ...responsesMint.resolution, format: "responses", endpoint };
116
- }
117
- const format = compat.thinkingFormat ?? "openai";
118
- if (BINARY_FORMATS.has(format)) {
119
- return { ...resolveBinary(requested), format, endpoint };
120
- }
121
- if (!completionsEffortHonored(compat, format)) {
122
- return { requested, effective: requested, graded: false, clamped: false, format, endpoint };
123
- }
124
- const mint = mintEffortWireValue(requested, model, compat.reasoningEffortLevels);
125
- if (requested !== "off" && mint.wireValue === undefined) {
126
- return { requested, effective: requested, graded: false, clamped: false, format, endpoint };
127
- }
128
- return { ...mint.resolution, format, endpoint };
129
- }
130
- export function reasoningEffortLevelsOf(model) {
131
- if (!capabilityHeld(model, "reasoning"))
132
- return undefined;
133
- const compat = (model.compat ?? {});
134
- if (model.api === "anthropic-messages") {
135
- const declared = declaredEffortLevels(compat.effortLevels);
136
- return declared === undefined ? undefined : sanitizeEffortLevels(declared);
137
- }
138
- let clampSet;
139
- if (model.api !== undefined && RESPONSES_APIS.has(model.api)) {
140
- if (compat.supportsReasoningEffort === false)
141
- return undefined;
142
- clampSet = sanitizeEffortLevels(compat.reasoningEffortLevels);
143
- }
144
- else {
145
- const format = compat.thinkingFormat ?? "openai";
146
- if (BINARY_FORMATS.has(format))
147
- return undefined;
148
- if (!completionsEffortHonored(compat, format))
149
- return undefined;
150
- clampSet = sanitizeEffortLevels(compat.reasoningEffortLevels);
151
- }
152
- const honored = clampSet.filter((lvl) => model.thinkingLevelMap?.[lvl] !== null);
153
- return honored.length > 0 ? honored : undefined;
154
- }
155
- function completionsEffortHonored(compat, format) {
156
- const supportsEffort = compat.supportsReasoningEffort ?? true;
157
- return !!supportsEffort || format === "openrouter";
158
- }
159
- function sanitizeEffortLevels(allowed) {
107
+ export function sanitizeEffortLevels(allowed) {
160
108
  const declared = Array.isArray(allowed) ? allowed.filter((lvl) => isThinkingLevel(lvl) && lvl !== "off") : [];
161
109
  return declared.length > 0 ? declared : DEFAULT_EFFORT_LEVELS;
162
110
  }
@@ -177,9 +125,6 @@ export function resolveEffort(requested, allowed = DEFAULT_EFFORT_LEVELS) {
177
125
  const effective = below ?? lowest ?? requested;
178
126
  return { requested, effective, graded: true, clamped: effective !== requested };
179
127
  }
180
- export function resolveBinary(requested) {
181
- return { requested, effective: requested, graded: false, clamped: false };
182
- }
183
128
  export const REASONING_BUDGET_SHARE = {
184
129
  off: 0,
185
130
  minimal: 0.1,
@@ -127,7 +127,8 @@ export declare function assertServableRequestRoot(url: string | undefined, seat:
127
127
  */
128
128
  export declare function joinRequestUrl(root: string | undefined, suffix: string): string;
129
129
  /** Remove the userinfo from every authority in free text, WHOLE — the general redactor keeps a short or
130
- * unprefixed username, and `TOKEN@host` / `TOKEN:x-oauth-basic@host` are the canonical PAT spellings. */
130
+ * unprefixed username, and `TOKEN@host` / `TOKEN:x-oauth-basic@host` are the canonical PAT spellings. A userinfo that
131
+ * is, exactly, a mark another layer wrote stands as written (a mark is atomic). */
131
132
  export declare function stripUrlCredentials(text: string): string;
132
133
  /** The request ROOT a brain targets — `Model.baseUrl` else `config.baseUrl` else the lane's default,
133
134
  * in its canonical spelling ({@link canonicalRootSpelling}: trailing PATH slashes folded, query
@@ -226,9 +227,10 @@ export declare function routeRefusalText(verdict: Extract<RouteAdjudication, {
226
227
  ok: false;
227
228
  }>): string;
228
229
  /** The request gate's refusal — the ONE error a first-party brain throws when the pairing law refuses the request it is
229
- * building ({@link admitRouteRequest}). A credential-origin refusal is also reported to the run it happens in (the run
230
- * announces `route.credential_origin_mismatch`): here, at the request that is refused, and not in the law, whose other
231
- * callers only advise (a pre-flight, the read face) and leave the outcome to the seat that asked. */
230
+ * building ({@link admitRouteRequest}). The two refusals that keep a credential from a root it does not belong to — the
231
+ * deployment credential paired with another root, a per-model credential bound to another origin — are also reported to the
232
+ * run they happen in (the run announces the refusal's own code): here, at the request that is refused, and not in the law,
233
+ * whose other callers only advise (a pre-flight, the read face) and leave the outcome to the seat that asked. */
232
234
  export declare function routeRefusalError(verdict: Extract<RouteAdjudication, {
233
235
  ok: false;
234
236
  }>): BrainError;
@@ -282,9 +284,9 @@ export interface CredentialRebind {
282
284
  * Hand the entry as it is in force now and the hook's answer the request will get: the target is that entry's origin
283
285
  * today, so a call made from a stale copy rebinds to a stale host. A hook that answers a new value on every call has
284
286
  * nothing to rebind (each value binds where it is first sent). A call that changed the table announces
285
- * `route.credential_rebound` (operator) once, to `onNotice` (else the notice throat's `console.warn` arm), naming the
286
- * entry, the new origin and the previous ones — announced just before the write, so a console that throws there leaves the
287
- * table as it was; a call that found every secret already there writes and announces nothing. What the call did is also
287
+ * `route.credential_rebound` (operator) once, to `onNotice` (else the process's default notice seat, else one process
288
+ * line), naming the entry, the new origin and the previous ones — announced just before the write; the announcement never
289
+ * throws, so the write always follows it. A call that found every secret already there writes and announces nothing. What the call did is also
288
290
  * its return value — the notice is the engine's account of its table, the record of
289
291
  * who asked is the host's. Refused, with nothing written (`config.invalid_argument`), two arms: no secret of the entry's
290
292
  * own to bind (no per-model credential — the deployment credential's one root is its brain's declared root, so it has no