@pentoshi/clai 4.11.7 → 4.11.8

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 (1999) hide show
  1. package/dist/agent/compaction/summary-execution.d.ts +32 -0
  2. package/dist/agent/compaction/summary-execution.js +407 -0
  3. package/dist/agent/compaction/summary-execution.js.map +1 -0
  4. package/dist/agent/compaction-attempt.d.ts +5 -1
  5. package/dist/agent/compaction-attempt.js +22 -12
  6. package/dist/agent/compaction-attempt.js.map +1 -1
  7. package/dist/agent/compaction-executor.d.ts +5 -53
  8. package/dist/agent/compaction-executor.js +4 -447
  9. package/dist/agent/compaction-executor.js.map +1 -1
  10. package/dist/agent/compaction-summary.d.ts +0 -25
  11. package/dist/agent/compaction-summary.js +0 -20
  12. package/dist/agent/compaction-summary.js.map +1 -1
  13. package/dist/agent/confirm-port.d.ts +0 -6
  14. package/dist/agent/confirm-port.js +0 -11
  15. package/dist/agent/confirm-port.js.map +1 -1
  16. package/dist/agent/context/compact-with-summary.d.ts +34 -0
  17. package/dist/agent/context/compact-with-summary.js +381 -0
  18. package/dist/agent/context/compact-with-summary.js.map +1 -0
  19. package/dist/agent/context-breakdown.d.ts +0 -12
  20. package/dist/agent/context-breakdown.js +0 -16
  21. package/dist/agent/context-breakdown.js.map +1 -1
  22. package/dist/agent/context-manager.d.ts +4 -90
  23. package/dist/agent/context-manager.js +4 -458
  24. package/dist/agent/context-manager.js.map +1 -1
  25. package/dist/agent/continue-orient.d.ts +0 -19
  26. package/dist/agent/continue-orient.js +0 -24
  27. package/dist/agent/continue-orient.js.map +1 -1
  28. package/dist/agent/durable-blocks.d.ts +5 -0
  29. package/dist/agent/durable-blocks.js +16 -0
  30. package/dist/agent/durable-blocks.js.map +1 -0
  31. package/dist/agent/durable-envelope.d.ts +0 -2
  32. package/dist/agent/durable-envelope.js +0 -16
  33. package/dist/agent/durable-envelope.js.map +1 -1
  34. package/dist/agent/events.d.ts +6 -17
  35. package/dist/agent/evidence/task-classification.d.ts +25 -0
  36. package/dist/agent/evidence/task-classification.js +124 -0
  37. package/dist/agent/evidence/task-classification.js.map +1 -0
  38. package/dist/agent/evidence/task-selection.d.ts +29 -0
  39. package/dist/agent/evidence/task-selection.js +148 -0
  40. package/dist/agent/evidence/task-selection.js.map +1 -0
  41. package/dist/agent/evidence/tool-budgets.d.ts +12 -0
  42. package/dist/agent/evidence/tool-budgets.js +82 -0
  43. package/dist/agent/evidence/tool-budgets.js.map +1 -0
  44. package/dist/agent/evidence-governor.d.ts +0 -3
  45. package/dist/agent/evidence-governor.js.map +1 -1
  46. package/dist/agent/injected-blocks.d.ts +1 -0
  47. package/dist/agent/injected-blocks.js +14 -4
  48. package/dist/agent/injected-blocks.js.map +1 -1
  49. package/dist/agent/message-slim.js +0 -2
  50. package/dist/agent/message-slim.js.map +1 -1
  51. package/dist/agent/outcomes.d.ts +0 -1
  52. package/dist/agent/outcomes.js +0 -11
  53. package/dist/agent/outcomes.js.map +1 -1
  54. package/dist/agent/parser/arg-formatting.d.ts +3 -0
  55. package/dist/agent/parser/arg-formatting.js +99 -0
  56. package/dist/agent/parser/arg-formatting.js.map +1 -0
  57. package/dist/agent/parser/bare-recognition.d.ts +6 -0
  58. package/dist/agent/parser/bare-recognition.js +106 -0
  59. package/dist/agent/parser/bare-recognition.js.map +1 -0
  60. package/dist/agent/parser/parse-entry.d.ts +9 -0
  61. package/dist/agent/parser/parse-entry.js +198 -0
  62. package/dist/agent/parser/parse-entry.js.map +1 -0
  63. package/dist/agent/parser/repetition.d.ts +1 -0
  64. package/dist/agent/parser/repetition.js +72 -0
  65. package/dist/agent/parser/repetition.js.map +1 -0
  66. package/dist/agent/parser/salvage.d.ts +8 -0
  67. package/dist/agent/parser/salvage.js +100 -0
  68. package/dist/agent/parser/salvage.js.map +1 -0
  69. package/dist/agent/parser/vendor-protocols.d.ts +21 -0
  70. package/dist/agent/parser/vendor-protocols.js +265 -0
  71. package/dist/agent/parser/vendor-protocols.js.map +1 -0
  72. package/dist/agent/parser/xml-protocol.d.ts +7 -0
  73. package/dist/agent/parser/xml-protocol.js +455 -0
  74. package/dist/agent/parser/xml-protocol.js.map +1 -0
  75. package/dist/agent/plan/actions/plan-clear.d.ts +4 -0
  76. package/dist/agent/plan/actions/plan-clear.js +46 -0
  77. package/dist/agent/plan/actions/plan-clear.js.map +1 -0
  78. package/dist/agent/plan/actions/plan-create.d.ts +4 -0
  79. package/dist/agent/plan/actions/plan-create.js +371 -0
  80. package/dist/agent/plan/actions/plan-create.js.map +1 -0
  81. package/dist/agent/plan/actions/task-add.d.ts +5 -0
  82. package/dist/agent/plan/actions/task-add.js +131 -0
  83. package/dist/agent/plan/actions/task-add.js.map +1 -0
  84. package/dist/agent/plan/actions/task-move.d.ts +5 -0
  85. package/dist/agent/plan/actions/task-move.js +72 -0
  86. package/dist/agent/plan/actions/task-move.js.map +1 -0
  87. package/dist/agent/plan/context-message.d.ts +2 -0
  88. package/dist/agent/plan/context-message.js +91 -0
  89. package/dist/agent/plan/context-message.js.map +1 -0
  90. package/dist/agent/plan/handle-plan-tool.d.ts +24 -0
  91. package/dist/agent/plan/handle-plan-tool.js +310 -0
  92. package/dist/agent/plan/handle-plan-tool.js.map +1 -0
  93. package/dist/agent/plan/normalization.d.ts +19 -0
  94. package/dist/agent/plan/normalization.js +175 -0
  95. package/dist/agent/plan/normalization.js.map +1 -0
  96. package/dist/agent/plan-implement-compact.d.ts +0 -20
  97. package/dist/agent/plan-implement-compact.js +0 -21
  98. package/dist/agent/plan-implement-compact.js.map +1 -1
  99. package/dist/agent/plan-mode-reminders.d.ts +0 -24
  100. package/dist/agent/plan-mode-reminders.js +0 -21
  101. package/dist/agent/plan-mode-reminders.js.map +1 -1
  102. package/dist/agent/plan-tool.d.ts +5 -60
  103. package/dist/agent/plan-tool.js +7 -1235
  104. package/dist/agent/plan-tool.js.map +1 -1
  105. package/dist/agent/progress-pause-policy.d.ts +0 -1
  106. package/dist/agent/progress-pause-policy.js +1 -5
  107. package/dist/agent/progress-pause-policy.js.map +1 -1
  108. package/dist/agent/progress.d.ts +0 -5
  109. package/dist/agent/progress.js +0 -14
  110. package/dist/agent/progress.js.map +1 -1
  111. package/dist/agent/project-root.d.ts +0 -21
  112. package/dist/agent/project-root.js +0 -36
  113. package/dist/agent/project-root.js.map +1 -1
  114. package/dist/agent/prompt-composer.d.ts +0 -1
  115. package/dist/agent/prompt-composer.js +0 -2
  116. package/dist/agent/prompt-composer.js.map +1 -1
  117. package/dist/agent/reliability-policy.d.ts +0 -38
  118. package/dist/agent/reliability-policy.js +0 -39
  119. package/dist/agent/reliability-policy.js.map +1 -1
  120. package/dist/agent/request-accounting.d.ts +0 -30
  121. package/dist/agent/request-accounting.js +1 -25
  122. package/dist/agent/request-accounting.js.map +1 -1
  123. package/dist/agent/request-budget.d.ts +0 -2
  124. package/dist/agent/request-budget.js +0 -13
  125. package/dist/agent/request-budget.js.map +1 -1
  126. package/dist/agent/responder-context.js +14 -3
  127. package/dist/agent/responder-context.js.map +1 -1
  128. package/dist/agent/responder-parent.d.ts +0 -10
  129. package/dist/agent/responder-parent.js +0 -12
  130. package/dist/agent/responder-parent.js.map +1 -1
  131. package/dist/agent/runner.d.ts +0 -30
  132. package/dist/agent/runner.js +403 -5087
  133. package/dist/agent/runner.js.map +1 -1
  134. package/dist/agent/scope-context.d.ts +0 -1
  135. package/dist/agent/scope-context.js +0 -1
  136. package/dist/agent/scope-context.js.map +1 -1
  137. package/dist/agent/scratch-write.d.ts +0 -1
  138. package/dist/agent/scratch-write.js +0 -1
  139. package/dist/agent/scratch-write.js.map +1 -1
  140. package/dist/agent/session-policy.d.ts +0 -28
  141. package/dist/agent/session-policy.js +0 -34
  142. package/dist/agent/session-policy.js.map +1 -1
  143. package/dist/agent/session-state.d.ts +0 -38
  144. package/dist/agent/session-state.js +4 -41
  145. package/dist/agent/session-state.js.map +1 -1
  146. package/dist/agent/step-budget.d.ts +0 -4
  147. package/dist/agent/step-budget.js +0 -4
  148. package/dist/agent/step-budget.js.map +1 -1
  149. package/dist/agent/stop-summary.d.ts +0 -5
  150. package/dist/agent/stop-summary.js +0 -8
  151. package/dist/agent/stop-summary.js.map +1 -1
  152. package/dist/agent/stream-recovery.d.ts +1 -54
  153. package/dist/agent/stream-recovery.js +4 -53
  154. package/dist/agent/stream-recovery.js.map +1 -1
  155. package/dist/agent/task-evidence.d.ts +10 -159
  156. package/dist/agent/task-evidence.js +10 -477
  157. package/dist/agent/task-evidence.js.map +1 -1
  158. package/dist/agent/task-plan.d.ts +0 -8
  159. package/dist/agent/task-plan.js +0 -6
  160. package/dist/agent/task-plan.js.map +1 -1
  161. package/dist/agent/task-sync.d.ts +0 -25
  162. package/dist/agent/task-sync.js +0 -31
  163. package/dist/agent/task-sync.js.map +1 -1
  164. package/dist/agent/tool-call-parser.d.ts +10 -205
  165. package/dist/agent/tool-call-parser.js +11 -1715
  166. package/dist/agent/tool-call-parser.js.map +1 -1
  167. package/dist/agent/tool-history.d.ts +1 -57
  168. package/dist/agent/tool-history.js +1 -68
  169. package/dist/agent/tool-history.js.map +1 -1
  170. package/dist/agent/tool-output-formatting.d.ts +0 -18
  171. package/dist/agent/tool-output-formatting.js +0 -28
  172. package/dist/agent/tool-output-formatting.js.map +1 -1
  173. package/dist/agent/turn/automatic-compaction-execution.d.ts +14 -0
  174. package/dist/agent/turn/automatic-compaction-execution.js +19 -0
  175. package/dist/agent/turn/automatic-compaction-execution.js.map +1 -0
  176. package/dist/agent/turn/compaction-admission.d.ts +25 -0
  177. package/dist/agent/turn/compaction-admission.js +40 -0
  178. package/dist/agent/turn/compaction-admission.js.map +1 -0
  179. package/dist/agent/turn/compaction-candidate.d.ts +10 -0
  180. package/dist/agent/turn/compaction-candidate.js +12 -0
  181. package/dist/agent/turn/compaction-candidate.js.map +1 -0
  182. package/dist/agent/turn/compaction-coordinator.d.ts +42 -0
  183. package/dist/agent/turn/compaction-coordinator.js +169 -0
  184. package/dist/agent/turn/compaction-coordinator.js.map +1 -0
  185. package/dist/agent/turn/compaction-durable-envelope.d.ts +24 -0
  186. package/dist/agent/turn/compaction-durable-envelope.js +54 -0
  187. package/dist/agent/turn/compaction-durable-envelope.js.map +1 -0
  188. package/dist/agent/turn/compaction-final-fit.d.ts +10 -0
  189. package/dist/agent/turn/compaction-final-fit.js +14 -0
  190. package/dist/agent/turn/compaction-final-fit.js.map +1 -0
  191. package/dist/agent/turn/compaction-messages.d.ts +6 -0
  192. package/dist/agent/turn/compaction-messages.js +15 -0
  193. package/dist/agent/turn/compaction-messages.js.map +1 -0
  194. package/dist/agent/turn/compaction-replay-selection.d.ts +10 -0
  195. package/dist/agent/turn/compaction-replay-selection.js +27 -0
  196. package/dist/agent/turn/compaction-replay-selection.js.map +1 -0
  197. package/dist/agent/turn/compaction-request-estimator.d.ts +7 -0
  198. package/dist/agent/turn/compaction-request-estimator.js +13 -0
  199. package/dist/agent/turn/compaction-request-estimator.js.map +1 -0
  200. package/dist/agent/turn/compaction-summarizer.d.ts +21 -0
  201. package/dist/agent/turn/compaction-summarizer.js +41 -0
  202. package/dist/agent/turn/compaction-summarizer.js.map +1 -0
  203. package/dist/agent/turn/continuation-overlap.d.ts +1 -0
  204. package/dist/agent/turn/continuation-overlap.js +35 -0
  205. package/dist/agent/turn/continuation-overlap.js.map +1 -0
  206. package/dist/agent/turn/contracts.d.ts +25 -0
  207. package/dist/agent/turn/contracts.js +2 -0
  208. package/dist/agent/turn/contracts.js.map +1 -0
  209. package/dist/agent/turn/event-emitter.d.ts +21 -0
  210. package/dist/agent/turn/event-emitter.js +116 -0
  211. package/dist/agent/turn/event-emitter.js.map +1 -0
  212. package/dist/agent/turn/evidence-flags.d.ts +16 -0
  213. package/dist/agent/turn/evidence-flags.js +44 -0
  214. package/dist/agent/turn/evidence-flags.js.map +1 -0
  215. package/dist/agent/turn/finalizer.d.ts +28 -0
  216. package/dist/agent/turn/finalizer.js +44 -0
  217. package/dist/agent/turn/finalizer.js.map +1 -0
  218. package/dist/agent/turn/history-writer.d.ts +17 -0
  219. package/dist/agent/turn/history-writer.js +72 -0
  220. package/dist/agent/turn/history-writer.js.map +1 -0
  221. package/dist/agent/turn/inserted-text.d.ts +1 -0
  222. package/dist/agent/turn/inserted-text.js +2 -0
  223. package/dist/agent/turn/inserted-text.js.map +1 -0
  224. package/dist/agent/turn/loop/answer-assessment.d.ts +22 -0
  225. package/dist/agent/turn/loop/answer-assessment.js +30 -0
  226. package/dist/agent/turn/loop/answer-assessment.js.map +1 -0
  227. package/dist/agent/turn/loop/answer-path.d.ts +20 -0
  228. package/dist/agent/turn/loop/answer-path.js +92 -0
  229. package/dist/agent/turn/loop/answer-path.js.map +1 -0
  230. package/dist/agent/turn/loop/call-binding.d.ts +17 -0
  231. package/dist/agent/turn/loop/call-binding.js +42 -0
  232. package/dist/agent/turn/loop/call-binding.js.map +1 -0
  233. package/dist/agent/turn/loop/canonicalize-turn-call.d.ts +5 -0
  234. package/dist/agent/turn/loop/canonicalize-turn-call.js +12 -0
  235. package/dist/agent/turn/loop/canonicalize-turn-call.js.map +1 -0
  236. package/dist/agent/turn/loop/completion-interpretation.d.ts +34 -0
  237. package/dist/agent/turn/loop/completion-interpretation.js +71 -0
  238. package/dist/agent/turn/loop/completion-interpretation.js.map +1 -0
  239. package/dist/agent/turn/loop/deps.d.ts +98 -0
  240. package/dist/agent/turn/loop/deps.js +2 -0
  241. package/dist/agent/turn/loop/deps.js.map +1 -0
  242. package/dist/agent/turn/loop/empty-response.d.ts +22 -0
  243. package/dist/agent/turn/loop/empty-response.js +51 -0
  244. package/dist/agent/turn/loop/empty-response.js.map +1 -0
  245. package/dist/agent/turn/loop/final-outcome.d.ts +15 -0
  246. package/dist/agent/turn/loop/final-outcome.js +49 -0
  247. package/dist/agent/turn/loop/final-outcome.js.map +1 -0
  248. package/dist/agent/turn/loop/group-execution.d.ts +14 -0
  249. package/dist/agent/turn/loop/group-execution.js +44 -0
  250. package/dist/agent/turn/loop/group-execution.js.map +1 -0
  251. package/dist/agent/turn/loop/model-only-rounds.d.ts +31 -0
  252. package/dist/agent/turn/loop/model-only-rounds.js +49 -0
  253. package/dist/agent/turn/loop/model-only-rounds.js.map +1 -0
  254. package/dist/agent/turn/loop/native-tool-calls.d.ts +12 -0
  255. package/dist/agent/turn/loop/native-tool-calls.js +57 -0
  256. package/dist/agent/turn/loop/native-tool-calls.js.map +1 -0
  257. package/dist/agent/turn/loop/native-write-salvage.d.ts +18 -0
  258. package/dist/agent/turn/loop/native-write-salvage.js +92 -0
  259. package/dist/agent/turn/loop/native-write-salvage.js.map +1 -0
  260. package/dist/agent/turn/loop/output-budget.d.ts +40 -0
  261. package/dist/agent/turn/loop/output-budget.js +76 -0
  262. package/dist/agent/turn/loop/output-budget.js.map +1 -0
  263. package/dist/agent/turn/loop/plan-call-deferral.d.ts +12 -0
  264. package/dist/agent/turn/loop/plan-call-deferral.js +32 -0
  265. package/dist/agent/turn/loop/plan-call-deferral.js.map +1 -0
  266. package/dist/agent/turn/loop/request-assembly.d.ts +32 -0
  267. package/dist/agent/turn/loop/request-assembly.js +97 -0
  268. package/dist/agent/turn/loop/request-assembly.js.map +1 -0
  269. package/dist/agent/turn/loop/round-closeout.d.ts +56 -0
  270. package/dist/agent/turn/loop/round-closeout.js +77 -0
  271. package/dist/agent/turn/loop/round-closeout.js.map +1 -0
  272. package/dist/agent/turn/loop/round-recorder.d.ts +38 -0
  273. package/dist/agent/turn/loop/round-recorder.js +71 -0
  274. package/dist/agent/turn/loop/round-recorder.js.map +1 -0
  275. package/dist/agent/turn/loop/round-request.d.ts +19 -0
  276. package/dist/agent/turn/loop/round-request.js +169 -0
  277. package/dist/agent/turn/loop/round-request.js.map +1 -0
  278. package/dist/agent/turn/loop/round-state.d.ts +11 -0
  279. package/dist/agent/turn/loop/round-state.js +11 -0
  280. package/dist/agent/turn/loop/round-state.js.map +1 -0
  281. package/dist/agent/turn/loop/run-rounds.d.ts +5 -0
  282. package/dist/agent/turn/loop/run-rounds.js +664 -0
  283. package/dist/agent/turn/loop/run-rounds.js.map +1 -0
  284. package/dist/agent/turn/loop/sequence-suppression.d.ts +54 -0
  285. package/dist/agent/turn/loop/sequence-suppression.js +112 -0
  286. package/dist/agent/turn/loop/sequence-suppression.js.map +1 -0
  287. package/dist/agent/turn/loop/state.d.ts +38 -0
  288. package/dist/agent/turn/loop/state.js +29 -0
  289. package/dist/agent/turn/loop/state.js.map +1 -0
  290. package/dist/agent/turn/loop/stream-failure.d.ts +55 -0
  291. package/dist/agent/turn/loop/stream-failure.js +149 -0
  292. package/dist/agent/turn/loop/stream-failure.js.map +1 -0
  293. package/dist/agent/turn/loop/stream-request.d.ts +16 -0
  294. package/dist/agent/turn/loop/stream-request.js +21 -0
  295. package/dist/agent/turn/loop/stream-request.js.map +1 -0
  296. package/dist/agent/turn/loop/stream-session.d.ts +41 -0
  297. package/dist/agent/turn/loop/stream-session.js +136 -0
  298. package/dist/agent/turn/loop/stream-session.js.map +1 -0
  299. package/dist/agent/turn/loop/tool-call-recovery.d.ts +25 -0
  300. package/dist/agent/turn/loop/tool-call-recovery.js +162 -0
  301. package/dist/agent/turn/loop/tool-call-recovery.js.map +1 -0
  302. package/dist/agent/turn/loop/unrun-calls.d.ts +12 -0
  303. package/dist/agent/turn/loop/unrun-calls.js +27 -0
  304. package/dist/agent/turn/loop/unrun-calls.js.map +1 -0
  305. package/dist/agent/turn/loop/wire-occurrences.d.ts +31 -0
  306. package/dist/agent/turn/loop/wire-occurrences.js +45 -0
  307. package/dist/agent/turn/loop/wire-occurrences.js.map +1 -0
  308. package/dist/agent/turn/mcp-agent-tools.d.ts +17 -0
  309. package/dist/agent/turn/mcp-agent-tools.js +69 -0
  310. package/dist/agent/turn/mcp-agent-tools.js.map +1 -0
  311. package/dist/agent/turn/message-assembly.d.ts +14 -0
  312. package/dist/agent/turn/message-assembly.js +22 -0
  313. package/dist/agent/turn/message-assembly.js.map +1 -0
  314. package/dist/agent/turn/outcome-accounting.d.ts +27 -0
  315. package/dist/agent/turn/outcome-accounting.js +91 -0
  316. package/dist/agent/turn/outcome-accounting.js.map +1 -0
  317. package/dist/agent/turn/plan-mode-gate.d.ts +16 -0
  318. package/dist/agent/turn/plan-mode-gate.js +36 -0
  319. package/dist/agent/turn/plan-mode-gate.js.map +1 -0
  320. package/dist/agent/turn/plan-persistence.d.ts +28 -0
  321. package/dist/agent/turn/plan-persistence.js +56 -0
  322. package/dist/agent/turn/plan-persistence.js.map +1 -0
  323. package/dist/agent/turn/prompt-sections.d.ts +9 -0
  324. package/dist/agent/turn/prompt-sections.js +67 -0
  325. package/dist/agent/turn/prompt-sections.js.map +1 -0
  326. package/dist/agent/turn/responder-claims.d.ts +16 -0
  327. package/dist/agent/turn/responder-claims.js +37 -0
  328. package/dist/agent/turn/responder-claims.js.map +1 -0
  329. package/dist/agent/turn/responder-dependency.d.ts +3 -0
  330. package/dist/agent/turn/responder-dependency.js +36 -0
  331. package/dist/agent/turn/responder-dependency.js.map +1 -0
  332. package/dist/agent/turn/responder-inbox.d.ts +28 -0
  333. package/dist/agent/turn/responder-inbox.js +57 -0
  334. package/dist/agent/turn/responder-inbox.js.map +1 -0
  335. package/dist/agent/turn/responder-job-linkage.d.ts +30 -0
  336. package/dist/agent/turn/responder-job-linkage.js +124 -0
  337. package/dist/agent/turn/responder-job-linkage.js.map +1 -0
  338. package/dist/agent/turn/responder-read-tool.d.ts +26 -0
  339. package/dist/agent/turn/responder-read-tool.js +83 -0
  340. package/dist/agent/turn/responder-read-tool.js.map +1 -0
  341. package/dist/agent/turn/scaffold-outcome.d.ts +7 -0
  342. package/dist/agent/turn/scaffold-outcome.js +93 -0
  343. package/dist/agent/turn/scaffold-outcome.js.map +1 -0
  344. package/dist/agent/turn/scaffold-preflight.d.ts +8 -0
  345. package/dist/agent/turn/scaffold-preflight.js +31 -0
  346. package/dist/agent/turn/scaffold-preflight.js.map +1 -0
  347. package/dist/agent/turn/session-state-projection.d.ts +18 -0
  348. package/dist/agent/turn/session-state-projection.js +46 -0
  349. package/dist/agent/turn/session-state-projection.js.map +1 -0
  350. package/dist/agent/turn/setup/compaction-services.d.ts +55 -0
  351. package/dist/agent/turn/setup/compaction-services.js +69 -0
  352. package/dist/agent/turn/setup/compaction-services.js.map +1 -0
  353. package/dist/agent/turn/setup/evidence-rehydration.d.ts +3 -0
  354. package/dist/agent/turn/setup/evidence-rehydration.js +22 -0
  355. package/dist/agent/turn/setup/evidence-rehydration.js.map +1 -0
  356. package/dist/agent/turn/setup/mcp-agent-ports.d.ts +29 -0
  357. package/dist/agent/turn/setup/mcp-agent-ports.js +26 -0
  358. package/dist/agent/turn/setup/mcp-agent-ports.js.map +1 -0
  359. package/dist/agent/turn/setup/prompt-classification.d.ts +10 -0
  360. package/dist/agent/turn/setup/prompt-classification.js +18 -0
  361. package/dist/agent/turn/setup/prompt-classification.js.map +1 -0
  362. package/dist/agent/turn/setup/responder-wake.d.ts +16 -0
  363. package/dist/agent/turn/setup/responder-wake.js +18 -0
  364. package/dist/agent/turn/setup/responder-wake.js.map +1 -0
  365. package/dist/agent/turn/setup/session-state.d.ts +20 -0
  366. package/dist/agent/turn/setup/session-state.js +23 -0
  367. package/dist/agent/turn/setup/session-state.js.map +1 -0
  368. package/dist/agent/turn/setup/task-gate-setup.d.ts +19 -0
  369. package/dist/agent/turn/setup/task-gate-setup.js +21 -0
  370. package/dist/agent/turn/setup/task-gate-setup.js.map +1 -0
  371. package/dist/agent/turn/setup/turn-budget.d.ts +19 -0
  372. package/dist/agent/turn/setup/turn-budget.js +34 -0
  373. package/dist/agent/turn/setup/turn-budget.js.map +1 -0
  374. package/dist/agent/turn/setup/turn-messages.d.ts +25 -0
  375. package/dist/agent/turn/setup/turn-messages.js +38 -0
  376. package/dist/agent/turn/setup/turn-messages.js.map +1 -0
  377. package/dist/agent/turn/setup/turn-state-machine.d.ts +13 -0
  378. package/dist/agent/turn/setup/turn-state-machine.js +52 -0
  379. package/dist/agent/turn/setup/turn-state-machine.js.map +1 -0
  380. package/dist/agent/turn/system-sections.d.ts +36 -0
  381. package/dist/agent/turn/system-sections.js +157 -0
  382. package/dist/agent/turn/system-sections.js.map +1 -0
  383. package/dist/agent/turn/task-autostart.d.ts +12 -0
  384. package/dist/agent/turn/task-autostart.js +35 -0
  385. package/dist/agent/turn/task-autostart.js.map +1 -0
  386. package/dist/agent/turn/task-batch-guard.d.ts +18 -0
  387. package/dist/agent/turn/task-batch-guard.js +83 -0
  388. package/dist/agent/turn/task-batch-guard.js.map +1 -0
  389. package/dist/agent/turn/task-credit.d.ts +15 -0
  390. package/dist/agent/turn/task-credit.js +49 -0
  391. package/dist/agent/turn/task-credit.js.map +1 -0
  392. package/dist/agent/turn/task-gate.d.ts +13 -0
  393. package/dist/agent/turn/task-gate.js +34 -0
  394. package/dist/agent/turn/task-gate.js.map +1 -0
  395. package/dist/agent/turn/task-update-gate.d.ts +13 -0
  396. package/dist/agent/turn/task-update-gate.js +40 -0
  397. package/dist/agent/turn/task-update-gate.js.map +1 -0
  398. package/dist/agent/turn/task-work-signals.d.ts +3 -0
  399. package/dist/agent/turn/task-work-signals.js +44 -0
  400. package/dist/agent/turn/task-work-signals.js.map +1 -0
  401. package/dist/agent/turn/tool-call-preparation.d.ts +20 -0
  402. package/dist/agent/turn/tool-call-preparation.js +67 -0
  403. package/dist/agent/turn/tool-call-preparation.js.map +1 -0
  404. package/dist/agent/turn/tool-evidence-signals.d.ts +22 -0
  405. package/dist/agent/turn/tool-evidence-signals.js +101 -0
  406. package/dist/agent/turn/tool-evidence-signals.js.map +1 -0
  407. package/dist/agent/turn/tool-execution/authorization.d.ts +32 -0
  408. package/dist/agent/turn/tool-execution/authorization.js +100 -0
  409. package/dist/agent/turn/tool-execution/authorization.js.map +1 -0
  410. package/dist/agent/turn/tool-execution/deps.d.ts +74 -0
  411. package/dist/agent/turn/tool-execution/deps.js +2 -0
  412. package/dist/agent/turn/tool-execution/deps.js.map +1 -0
  413. package/dist/agent/turn/tool-execution/dispatch.d.ts +27 -0
  414. package/dist/agent/turn/tool-execution/dispatch.js +76 -0
  415. package/dist/agent/turn/tool-execution/dispatch.js.map +1 -0
  416. package/dist/agent/turn/tool-execution/engagement-checkpoint.d.ts +7 -0
  417. package/dist/agent/turn/tool-execution/engagement-checkpoint.js +32 -0
  418. package/dist/agent/turn/tool-execution/engagement-checkpoint.js.map +1 -0
  419. package/dist/agent/turn/tool-execution/engagement-gate.d.ts +16 -0
  420. package/dist/agent/turn/tool-execution/engagement-gate.js +55 -0
  421. package/dist/agent/turn/tool-execution/engagement-gate.js.map +1 -0
  422. package/dist/agent/turn/tool-execution/gates.d.ts +21 -0
  423. package/dist/agent/turn/tool-execution/gates.js +45 -0
  424. package/dist/agent/turn/tool-execution/gates.js.map +1 -0
  425. package/dist/agent/turn/tool-execution/guards.d.ts +42 -0
  426. package/dist/agent/turn/tool-execution/guards.js +62 -0
  427. package/dist/agent/turn/tool-execution/guards.js.map +1 -0
  428. package/dist/agent/turn/tool-execution/meta-tools.d.ts +50 -0
  429. package/dist/agent/turn/tool-execution/meta-tools.js +114 -0
  430. package/dist/agent/turn/tool-execution/meta-tools.js.map +1 -0
  431. package/dist/agent/turn/tool-execution/plan-tool-ledger.d.ts +10 -0
  432. package/dist/agent/turn/tool-execution/plan-tool-ledger.js +50 -0
  433. package/dist/agent/turn/tool-execution/plan-tool-ledger.js.map +1 -0
  434. package/dist/agent/turn/tool-execution/result-framing.d.ts +36 -0
  435. package/dist/agent/turn/tool-execution/result-framing.js +54 -0
  436. package/dist/agent/turn/tool-execution/result-framing.js.map +1 -0
  437. package/dist/agent/turn/tool-execution/run-setup.d.ts +29 -0
  438. package/dist/agent/turn/tool-execution/run-setup.js +64 -0
  439. package/dist/agent/turn/tool-execution/run-setup.js.map +1 -0
  440. package/dist/agent/turn/tool-execution/single-tool.d.ts +4 -0
  441. package/dist/agent/turn/tool-execution/single-tool.js +613 -0
  442. package/dist/agent/turn/tool-execution/single-tool.js.map +1 -0
  443. package/dist/agent/turn/tool-execution/state.d.ts +19 -0
  444. package/dist/agent/turn/tool-execution/state.js +13 -0
  445. package/dist/agent/turn/tool-execution/state.js.map +1 -0
  446. package/dist/agent/turn/tool-execution/supervision.d.ts +20 -0
  447. package/dist/agent/turn/tool-execution/supervision.js +44 -0
  448. package/dist/agent/turn/tool-execution/supervision.js.map +1 -0
  449. package/dist/agent/turn/tool-result-recorder.d.ts +26 -0
  450. package/dist/agent/turn/tool-result-recorder.js +54 -0
  451. package/dist/agent/turn/tool-result-recorder.js.map +1 -0
  452. package/dist/agent/turn/tool-routing.d.ts +23 -0
  453. package/dist/agent/turn/tool-routing.js +58 -0
  454. package/dist/agent/turn/tool-routing.js.map +1 -0
  455. package/dist/agent/turn/tool-watchdog.d.ts +22 -0
  456. package/dist/agent/turn/tool-watchdog.js +135 -0
  457. package/dist/agent/turn/tool-watchdog.js.map +1 -0
  458. package/dist/agent/turn/turn-counters.d.ts +9 -0
  459. package/dist/agent/turn/turn-counters.js +13 -0
  460. package/dist/agent/turn/turn-counters.js.map +1 -0
  461. package/dist/agent/turn/workspace-setup.d.ts +29 -0
  462. package/dist/agent/turn/workspace-setup.js +74 -0
  463. package/dist/agent/turn/workspace-setup.js.map +1 -0
  464. package/dist/agent/workspace-orient.d.ts +0 -45
  465. package/dist/agent/workspace-orient.js +3 -69
  466. package/dist/agent/workspace-orient.js.map +1 -1
  467. package/dist/app/adapters/agent-event-adapter.d.ts +0 -1
  468. package/dist/app/adapters/agent-event-adapter.js +1 -4
  469. package/dist/app/adapters/agent-event-adapter.js.map +1 -1
  470. package/dist/app/adapters/current-interactive-sessions-adapter.d.ts +0 -1
  471. package/dist/app/adapters/current-interactive-sessions-adapter.js +0 -1
  472. package/dist/app/adapters/current-interactive-sessions-adapter.js.map +1 -1
  473. package/dist/app/adapters/current-jobs-adapter.d.ts +0 -1
  474. package/dist/app/adapters/current-jobs-adapter.js +0 -1
  475. package/dist/app/adapters/current-jobs-adapter.js.map +1 -1
  476. package/dist/app/adapters/current-store-adapter.d.ts +0 -1
  477. package/dist/app/adapters/current-store-adapter.js +0 -1
  478. package/dist/app/adapters/current-store-adapter.js.map +1 -1
  479. package/dist/app/adapters/quiet-meta-tools.d.ts +0 -11
  480. package/dist/app/adapters/quiet-meta-tools.js +0 -11
  481. package/dist/app/adapters/quiet-meta-tools.js.map +1 -1
  482. package/dist/app/commands/catalog.d.ts +0 -8
  483. package/dist/app/commands/catalog.js +10 -32
  484. package/dist/app/commands/catalog.js.map +1 -1
  485. package/dist/app/commands/command.d.ts +0 -4
  486. package/dist/app/commands/command.js.map +1 -1
  487. package/dist/app/commands/registry.d.ts +0 -3
  488. package/dist/app/commands/registry.js +1 -7
  489. package/dist/app/commands/registry.js.map +1 -1
  490. package/dist/app/confirm-prompt-text.d.ts +0 -6
  491. package/dist/app/confirm-prompt-text.js +0 -6
  492. package/dist/app/confirm-prompt-text.js.map +1 -1
  493. package/dist/app/controllers/cancel-all-result.d.ts +0 -5
  494. package/dist/app/controllers/cancel-all-result.js +0 -5
  495. package/dist/app/controllers/cancel-all-result.js.map +1 -1
  496. package/dist/app/controllers/plan-controller.d.ts +0 -6
  497. package/dist/app/controllers/plan-controller.js +0 -11
  498. package/dist/app/controllers/plan-controller.js.map +1 -1
  499. package/dist/app/controllers/session-compact-helper.d.ts +0 -9
  500. package/dist/app/controllers/session-compact-helper.js +0 -14
  501. package/dist/app/controllers/session-compact-helper.js.map +1 -1
  502. package/dist/app/controllers/session-context-usage.d.ts +0 -11
  503. package/dist/app/controllers/session-context-usage.js +22 -30
  504. package/dist/app/controllers/session-context-usage.js.map +1 -1
  505. package/dist/app/controllers/session-controller.d.ts +1 -38
  506. package/dist/app/controllers/session-controller.js +8 -47
  507. package/dist/app/controllers/session-controller.js.map +1 -1
  508. package/dist/app/controllers/session-naming.d.ts +0 -4
  509. package/dist/app/controllers/session-naming.js +0 -4
  510. package/dist/app/controllers/session-naming.js.map +1 -1
  511. package/dist/app/controllers/session-persistence.d.ts +0 -6
  512. package/dist/app/controllers/session-persistence.js +0 -10
  513. package/dist/app/controllers/session-persistence.js.map +1 -1
  514. package/dist/app/controllers/session-responder.js +0 -4
  515. package/dist/app/controllers/session-responder.js.map +1 -1
  516. package/dist/app/controllers/session-turn-request.d.ts +0 -1
  517. package/dist/app/controllers/session-turn-request.js +0 -1
  518. package/dist/app/controllers/session-turn-request.js.map +1 -1
  519. package/dist/app/controllers/session-usage-ledger.d.ts +6 -1
  520. package/dist/app/controllers/session-usage-ledger.js +43 -3
  521. package/dist/app/controllers/session-usage-ledger.js.map +1 -1
  522. package/dist/app/controllers/turn-controller.js +2 -6
  523. package/dist/app/controllers/turn-controller.js.map +1 -1
  524. package/dist/app/events/app-event.d.ts +1 -11
  525. package/dist/app/events/app-event.js +0 -1
  526. package/dist/app/events/app-event.js.map +1 -1
  527. package/dist/app/events/event-buffer.d.ts +0 -6
  528. package/dist/app/events/event-buffer.js +0 -6
  529. package/dist/app/events/event-buffer.js.map +1 -1
  530. package/dist/app/events/sequencer.d.ts +0 -2
  531. package/dist/app/events/sequencer.js +0 -1
  532. package/dist/app/events/sequencer.js.map +1 -1
  533. package/dist/app/ports/agent-port.d.ts +0 -19
  534. package/dist/app/ports/interactive-sessions-port.d.ts +0 -13
  535. package/dist/app/ports/interactive-sessions-port.js +0 -7
  536. package/dist/app/ports/interactive-sessions-port.js.map +1 -1
  537. package/dist/app/ports/persistence-port.d.ts +0 -14
  538. package/dist/app/ports/updates-port.d.ts +0 -5
  539. package/dist/classic/app/ClassicApp.js +0 -2
  540. package/dist/classic/app/ClassicApp.js.map +1 -1
  541. package/dist/classic/app/action-handlers.js +0 -4
  542. package/dist/classic/app/action-handlers.js.map +1 -1
  543. package/dist/classic/app/git-branch.js +0 -1
  544. package/dist/classic/app/git-branch.js.map +1 -1
  545. package/dist/classic/app/use-feed.d.ts +0 -7
  546. package/dist/classic/app/use-feed.js +0 -5
  547. package/dist/classic/app/use-feed.js.map +1 -1
  548. package/dist/classic/app/wiring-interactions.js +0 -2
  549. package/dist/classic/app/wiring-interactions.js.map +1 -1
  550. package/dist/classic/blocks/assistant-lines.d.ts +0 -1
  551. package/dist/classic/blocks/assistant-lines.js +0 -1
  552. package/dist/classic/blocks/assistant-lines.js.map +1 -1
  553. package/dist/classic/blocks/batch-lines.d.ts +0 -1
  554. package/dist/classic/blocks/batch-lines.js +0 -1
  555. package/dist/classic/blocks/batch-lines.js.map +1 -1
  556. package/dist/classic/blocks/block-context.d.ts +0 -7
  557. package/dist/classic/blocks/block-context.js +0 -1
  558. package/dist/classic/blocks/block-context.js.map +1 -1
  559. package/dist/classic/blocks/compacted-lines.d.ts +0 -1
  560. package/dist/classic/blocks/compacted-lines.js +0 -1
  561. package/dist/classic/blocks/compacted-lines.js.map +1 -1
  562. package/dist/classic/blocks/diff-lines.d.ts +0 -3
  563. package/dist/classic/blocks/diff-lines.js +0 -4
  564. package/dist/classic/blocks/diff-lines.js.map +1 -1
  565. package/dist/classic/blocks/intro-lines.d.ts +0 -5
  566. package/dist/classic/blocks/intro-lines.js +0 -5
  567. package/dist/classic/blocks/intro-lines.js.map +1 -1
  568. package/dist/classic/blocks/notice-lines.d.ts +0 -4
  569. package/dist/classic/blocks/notice-lines.js +0 -6
  570. package/dist/classic/blocks/notice-lines.js.map +1 -1
  571. package/dist/classic/blocks/thinking-lines.d.ts +0 -1
  572. package/dist/classic/blocks/thinking-lines.js +0 -1
  573. package/dist/classic/blocks/thinking-lines.js.map +1 -1
  574. package/dist/classic/blocks/tool-lines.d.ts +0 -7
  575. package/dist/classic/blocks/tool-lines.js +0 -10
  576. package/dist/classic/blocks/tool-lines.js.map +1 -1
  577. package/dist/classic/blocks/user-lines.d.ts +0 -1
  578. package/dist/classic/blocks/user-lines.js +0 -1
  579. package/dist/classic/blocks/user-lines.js.map +1 -1
  580. package/dist/classic/bootstrap/osc52-renderer.js +0 -1
  581. package/dist/classic/bootstrap/osc52-renderer.js.map +1 -1
  582. package/dist/classic/chrome/Chrome.d.ts +0 -1
  583. package/dist/classic/chrome/Chrome.js.map +1 -1
  584. package/dist/classic/chrome/Composer.d.ts +0 -5
  585. package/dist/classic/chrome/Composer.js +0 -5
  586. package/dist/classic/chrome/Composer.js.map +1 -1
  587. package/dist/classic/chrome/composer-controller.js +0 -4
  588. package/dist/classic/chrome/composer-controller.js.map +1 -1
  589. package/dist/classic/chrome/composer-frame.d.ts +0 -3
  590. package/dist/classic/chrome/composer-frame.js +0 -3
  591. package/dist/classic/chrome/composer-frame.js.map +1 -1
  592. package/dist/classic/chrome/directory-row.d.ts +0 -7
  593. package/dist/classic/chrome/directory-row.js +0 -7
  594. package/dist/classic/chrome/directory-row.js.map +1 -1
  595. package/dist/classic/chrome/row-budget.d.ts +0 -2
  596. package/dist/classic/chrome/row-budget.js +0 -8
  597. package/dist/classic/chrome/row-budget.js.map +1 -1
  598. package/dist/classic/chrome/status-rows.d.ts +0 -12
  599. package/dist/classic/chrome/status-rows.js +0 -16
  600. package/dist/classic/chrome/status-rows.js.map +1 -1
  601. package/dist/classic/chrome/toast-rows.d.ts +0 -4
  602. package/dist/classic/chrome/toast-rows.js +0 -9
  603. package/dist/classic/chrome/toast-rows.js.map +1 -1
  604. package/dist/classic/feed/Feed.d.ts +0 -5
  605. package/dist/classic/feed/Feed.js +0 -4
  606. package/dist/classic/feed/Feed.js.map +1 -1
  607. package/dist/classic/feed/FeedStatic.d.ts +0 -8
  608. package/dist/classic/feed/FeedStatic.js +0 -8
  609. package/dist/classic/feed/FeedStatic.js.map +1 -1
  610. package/dist/classic/feed/ScrollbarGutter.js +0 -1
  611. package/dist/classic/feed/ScrollbarGutter.js.map +1 -1
  612. package/dist/classic/feed/block-height.d.ts +0 -7
  613. package/dist/classic/feed/block-height.js +0 -7
  614. package/dist/classic/feed/block-height.js.map +1 -1
  615. package/dist/classic/feed/commit-ledger.d.ts +0 -12
  616. package/dist/classic/feed/commit-ledger.js +0 -10
  617. package/dist/classic/feed/commit-ledger.js.map +1 -1
  618. package/dist/classic/feed/feed-blocks.d.ts +0 -8
  619. package/dist/classic/feed/feed-blocks.js +0 -6
  620. package/dist/classic/feed/feed-blocks.js.map +1 -1
  621. package/dist/classic/feed/live-tail-policy.d.ts +0 -13
  622. package/dist/classic/feed/live-tail-policy.js +0 -11
  623. package/dist/classic/feed/live-tail-policy.js.map +1 -1
  624. package/dist/classic/feed/scrollbar-rows.d.ts +0 -1
  625. package/dist/classic/feed/scrollbar-rows.js +0 -1
  626. package/dist/classic/feed/scrollbar-rows.js.map +1 -1
  627. package/dist/classic/feed/transcript-window.d.ts +0 -10
  628. package/dist/classic/feed/transcript-window.js +0 -6
  629. package/dist/classic/feed/transcript-window.js.map +1 -1
  630. package/dist/classic/input/input-router.js +0 -2
  631. package/dist/classic/input/input-router.js.map +1 -1
  632. package/dist/classic/panels/completion-rows.js +2 -1
  633. package/dist/classic/panels/completion-rows.js.map +1 -1
  634. package/dist/classic/panels/keys-panel.d.ts +0 -1
  635. package/dist/classic/panels/keys-panel.js +0 -1
  636. package/dist/classic/panels/keys-panel.js.map +1 -1
  637. package/dist/classic/panels/pager-panel.d.ts +0 -5
  638. package/dist/classic/panels/pager-panel.js +0 -11
  639. package/dist/classic/panels/pager-panel.js.map +1 -1
  640. package/dist/classic/panels/panel-controller.d.ts +0 -2
  641. package/dist/classic/panels/panel-controller.js +0 -2
  642. package/dist/classic/panels/panel-controller.js.map +1 -1
  643. package/dist/classic/panels/panel-frame.js +0 -2
  644. package/dist/classic/panels/panel-frame.js.map +1 -1
  645. package/dist/classic/panels/panel-wheel.d.ts +0 -5
  646. package/dist/classic/panels/panel-wheel.js +0 -5
  647. package/dist/classic/panels/panel-wheel.js.map +1 -1
  648. package/dist/classic/panels/secret-panel.d.ts +0 -1
  649. package/dist/classic/panels/secret-panel.js +0 -1
  650. package/dist/classic/panels/secret-panel.js.map +1 -1
  651. package/dist/classic/panels/text-editor-panel.d.ts +0 -1
  652. package/dist/classic/panels/text-editor-panel.js +0 -1
  653. package/dist/classic/panels/text-editor-panel.js.map +1 -1
  654. package/dist/classic/render/ansi-text.d.ts +0 -19
  655. package/dist/classic/render/ansi-text.js +0 -19
  656. package/dist/classic/render/ansi-text.js.map +1 -1
  657. package/dist/classic/render/glyphs.d.ts +0 -4
  658. package/dist/classic/render/glyphs.js +0 -4
  659. package/dist/classic/render/glyphs.js.map +1 -1
  660. package/dist/classic/render/ink-theme.d.ts +0 -10
  661. package/dist/classic/render/ink-theme.js +0 -6
  662. package/dist/classic/render/ink-theme.js.map +1 -1
  663. package/dist/classic/render/measure.d.ts +0 -12
  664. package/dist/classic/render/measure.js +0 -12
  665. package/dist/classic/render/measure.js.map +1 -1
  666. package/dist/classic/render/shell-width.d.ts +0 -8
  667. package/dist/classic/render/shell-width.js +0 -8
  668. package/dist/classic/render/shell-width.js.map +1 -1
  669. package/dist/classic/render/wrap.d.ts +0 -11
  670. package/dist/classic/render/wrap.js +0 -8
  671. package/dist/classic/render/wrap.js.map +1 -1
  672. package/dist/commands/doctor.js +0 -2
  673. package/dist/commands/doctor.js.map +1 -1
  674. package/dist/commands/providers.d.ts +0 -1
  675. package/dist/commands/providers.js +0 -22
  676. package/dist/commands/providers.js.map +1 -1
  677. package/dist/commands/search-providers.d.ts +0 -1
  678. package/dist/commands/search-providers.js +0 -4
  679. package/dist/commands/search-providers.js.map +1 -1
  680. package/dist/commands/update/installers.d.ts +61 -0
  681. package/dist/commands/update/installers.js +505 -0
  682. package/dist/commands/update/installers.js.map +1 -0
  683. package/dist/commands/update-install.d.ts +4 -65
  684. package/dist/commands/update-install.js +6 -506
  685. package/dist/commands/update-install.js.map +1 -1
  686. package/dist/commands/update.d.ts +0 -6
  687. package/dist/commands/update.js +1 -11
  688. package/dist/commands/update.js.map +1 -1
  689. package/dist/index.js +3 -10
  690. package/dist/index.js.map +1 -1
  691. package/dist/interactive-session/artifact-writer.d.ts +0 -1
  692. package/dist/interactive-session/artifact-writer.js +0 -1
  693. package/dist/interactive-session/artifact-writer.js.map +1 -1
  694. package/dist/interactive-session/cleanup.d.ts +0 -10
  695. package/dist/interactive-session/cleanup.js +0 -13
  696. package/dist/interactive-session/cleanup.js.map +1 -1
  697. package/dist/interactive-session/config.d.ts +0 -16
  698. package/dist/interactive-session/config.js +0 -13
  699. package/dist/interactive-session/config.js.map +1 -1
  700. package/dist/interactive-session/manager.d.ts +0 -27
  701. package/dist/interactive-session/manager.js +0 -42
  702. package/dist/interactive-session/manager.js.map +1 -1
  703. package/dist/interactive-session/output-store.d.ts +0 -6
  704. package/dist/interactive-session/output-store.js +0 -5
  705. package/dist/interactive-session/output-store.js.map +1 -1
  706. package/dist/interactive-session/output-view.d.ts +0 -4
  707. package/dist/interactive-session/output-view.js +0 -12
  708. package/dist/interactive-session/output-view.js.map +1 -1
  709. package/dist/interactive-session/recovery-journal.d.ts +0 -7
  710. package/dist/interactive-session/recovery-journal.js +0 -7
  711. package/dist/interactive-session/recovery-journal.js.map +1 -1
  712. package/dist/interactive-session/registry.d.ts +0 -25
  713. package/dist/interactive-session/registry.js +0 -27
  714. package/dist/interactive-session/registry.js.map +1 -1
  715. package/dist/interactive-session/runtime.d.ts +0 -30
  716. package/dist/interactive-session/runtime.js +0 -23
  717. package/dist/interactive-session/runtime.js.map +1 -1
  718. package/dist/interactive-session/session-runtime.d.ts +0 -9
  719. package/dist/interactive-session/session-runtime.js +0 -10
  720. package/dist/interactive-session/session-runtime.js.map +1 -1
  721. package/dist/interactive-session/streaming-redactor.d.ts +0 -14
  722. package/dist/interactive-session/streaming-redactor.js +0 -18
  723. package/dist/interactive-session/streaming-redactor.js.map +1 -1
  724. package/dist/interactive-session/telemetry.d.ts +0 -8
  725. package/dist/interactive-session/telemetry.js +0 -7
  726. package/dist/interactive-session/telemetry.js.map +1 -1
  727. package/dist/interactive-session/transport-factory.d.ts +0 -5
  728. package/dist/interactive-session/transport-factory.js +0 -5
  729. package/dist/interactive-session/transport-factory.js.map +1 -1
  730. package/dist/interactive-session/transport-pipe.d.ts +0 -7
  731. package/dist/interactive-session/transport-pipe.js +0 -14
  732. package/dist/interactive-session/transport-pipe.js.map +1 -1
  733. package/dist/interactive-session/transport.d.ts +0 -26
  734. package/dist/interactive-session/transport.js +0 -20
  735. package/dist/interactive-session/transport.js.map +1 -1
  736. package/dist/interactive-session/types.d.ts +0 -19
  737. package/dist/interactive-session/types.js +0 -22
  738. package/dist/interactive-session/types.js.map +1 -1
  739. package/dist/llm/adapters/anthropic-stream-events.d.ts +38 -0
  740. package/dist/llm/adapters/anthropic-stream-events.js +144 -0
  741. package/dist/llm/adapters/anthropic-stream-events.js.map +1 -0
  742. package/dist/llm/adapters/anthropic-tools.d.ts +5 -55
  743. package/dist/llm/adapters/anthropic-tools.js +6 -208
  744. package/dist/llm/adapters/anthropic-tools.js.map +1 -1
  745. package/dist/llm/adapters/anthropic-wire-blocks.d.ts +9 -0
  746. package/dist/llm/adapters/anthropic-wire-blocks.js +59 -0
  747. package/dist/llm/adapters/anthropic-wire-blocks.js.map +1 -0
  748. package/dist/llm/adapters/gemini-tools.d.ts +0 -6
  749. package/dist/llm/adapters/gemini-tools.js +0 -24
  750. package/dist/llm/adapters/gemini-tools.js.map +1 -1
  751. package/dist/llm/adapters/ollama-tools.js +0 -5
  752. package/dist/llm/adapters/ollama-tools.js.map +1 -1
  753. package/dist/llm/adapters/openai-tools.d.ts +0 -4
  754. package/dist/llm/adapters/openai-tools.js +2 -11
  755. package/dist/llm/adapters/openai-tools.js.map +1 -1
  756. package/dist/llm/agentrouter.d.ts +0 -9
  757. package/dist/llm/agentrouter.js +10 -60
  758. package/dist/llm/agentrouter.js.map +1 -1
  759. package/dist/llm/anthropic.d.ts +0 -7
  760. package/dist/llm/anthropic.js +2 -30
  761. package/dist/llm/anthropic.js.map +1 -1
  762. package/dist/llm/artifacts/legacy-blocks.d.ts +3 -0
  763. package/dist/llm/artifacts/legacy-blocks.js +109 -0
  764. package/dist/llm/artifacts/legacy-blocks.js.map +1 -0
  765. package/dist/llm/artifacts/replay-selection.d.ts +9 -0
  766. package/dist/llm/artifacts/replay-selection.js +48 -0
  767. package/dist/llm/artifacts/replay-selection.js.map +1 -0
  768. package/dist/llm/aws-mantle.js +2 -4
  769. package/dist/llm/aws-mantle.js.map +1 -1
  770. package/dist/llm/bynara.js +2 -0
  771. package/dist/llm/bynara.js.map +1 -1
  772. package/dist/llm/cache-affinity.d.ts +1 -0
  773. package/dist/llm/cache-affinity.js +6 -0
  774. package/dist/llm/cache-affinity.js.map +1 -1
  775. package/dist/llm/capabilities.d.ts +7 -36
  776. package/dist/llm/capabilities.js +11 -502
  777. package/dist/llm/capabilities.js.map +1 -1
  778. package/dist/llm/capability/state.d.ts +25 -0
  779. package/dist/llm/capability/state.js +125 -0
  780. package/dist/llm/capability/state.js.map +1 -0
  781. package/dist/llm/capability/tool-dialect.d.ts +3 -0
  782. package/dist/llm/capability/tool-dialect.js +78 -0
  783. package/dist/llm/capability/tool-dialect.js.map +1 -0
  784. package/dist/llm/capability/vision-patterns.d.ts +4 -0
  785. package/dist/llm/capability/vision-patterns.js +188 -0
  786. package/dist/llm/capability/vision-patterns.js.map +1 -0
  787. package/dist/llm/capability/vision-registry.d.ts +20 -0
  788. package/dist/llm/capability/vision-registry.js +112 -0
  789. package/dist/llm/capability/vision-registry.js.map +1 -0
  790. package/dist/llm/context-snapshot.d.ts +0 -18
  791. package/dist/llm/context-snapshot.js +1 -8
  792. package/dist/llm/context-snapshot.js.map +1 -1
  793. package/dist/llm/context-windows.d.ts +0 -6
  794. package/dist/llm/context-windows.js +0 -30
  795. package/dist/llm/context-windows.js.map +1 -1
  796. package/dist/llm/custom-provider-profile.d.ts +4 -23
  797. package/dist/llm/custom-provider-profile.js +4 -515
  798. package/dist/llm/custom-provider-profile.js.map +1 -1
  799. package/dist/llm/custom-providers.d.ts +0 -23
  800. package/dist/llm/custom-providers.js +2 -27
  801. package/dist/llm/custom-providers.js.map +1 -1
  802. package/dist/llm/effort-fallback.d.ts +0 -38
  803. package/dist/llm/effort-fallback.js +0 -38
  804. package/dist/llm/effort-fallback.js.map +1 -1
  805. package/dist/llm/fireworks.js +2 -0
  806. package/dist/llm/fireworks.js.map +1 -1
  807. package/dist/llm/free.js +7 -2
  808. package/dist/llm/free.js.map +1 -1
  809. package/dist/llm/gemini.d.ts +0 -1
  810. package/dist/llm/gemini.js +2 -19
  811. package/dist/llm/gemini.js.map +1 -1
  812. package/dist/llm/hetzner.js +2 -0
  813. package/dist/llm/hetzner.js.map +1 -1
  814. package/dist/llm/http.d.ts +24 -251
  815. package/dist/llm/http.js +19 -2021
  816. package/dist/llm/http.js.map +1 -1
  817. package/dist/llm/key-rotation.d.ts +0 -32
  818. package/dist/llm/key-rotation.js +6 -37
  819. package/dist/llm/key-rotation.js.map +1 -1
  820. package/dist/llm/lightning.d.ts +0 -8
  821. package/dist/llm/lightning.js +3 -18
  822. package/dist/llm/lightning.js.map +1 -1
  823. package/dist/llm/merge-gateway.d.ts +0 -9
  824. package/dist/llm/merge-gateway.js +2 -44
  825. package/dist/llm/merge-gateway.js.map +1 -1
  826. package/dist/llm/modal.js +3 -15
  827. package/dist/llm/modal.js.map +1 -1
  828. package/dist/llm/model-families.d.ts +0 -5
  829. package/dist/llm/model-families.js +0 -5
  830. package/dist/llm/model-families.js.map +1 -1
  831. package/dist/llm/model-layers/model-patterns.d.ts +7 -0
  832. package/dist/llm/model-layers/model-patterns.js +30 -0
  833. package/dist/llm/model-layers/model-patterns.js.map +1 -0
  834. package/dist/llm/model-layers/model-rules.d.ts +8 -0
  835. package/dist/llm/model-layers/model-rules.js +221 -0
  836. package/dist/llm/model-layers/model-rules.js.map +1 -0
  837. package/dist/llm/model-layers/nvidia-layer.d.ts +2 -0
  838. package/dist/llm/model-layers/nvidia-layer.js +135 -0
  839. package/dist/llm/model-layers/nvidia-layer.js.map +1 -0
  840. package/dist/llm/nvidia.js +3 -11
  841. package/dist/llm/nvidia.js.map +1 -1
  842. package/dist/llm/ollama.js +2 -11
  843. package/dist/llm/ollama.js.map +1 -1
  844. package/dist/llm/openai.js +2 -0
  845. package/dist/llm/openai.js.map +1 -1
  846. package/dist/llm/openrouter.js +3 -1
  847. package/dist/llm/openrouter.js.map +1 -1
  848. package/dist/llm/operation-ledger.d.ts +0 -6
  849. package/dist/llm/operation-ledger.js +0 -6
  850. package/dist/llm/operation-ledger.js.map +1 -1
  851. package/dist/llm/operation-usage.d.ts +2 -0
  852. package/dist/llm/operation-usage.js +27 -0
  853. package/dist/llm/operation-usage.js.map +1 -1
  854. package/dist/llm/orcarouter.d.ts +0 -4
  855. package/dist/llm/orcarouter.js +3 -26
  856. package/dist/llm/orcarouter.js.map +1 -1
  857. package/dist/llm/profile/control-rejections.d.ts +14 -0
  858. package/dist/llm/profile/control-rejections.js +75 -0
  859. package/dist/llm/profile/control-rejections.js.map +1 -0
  860. package/dist/llm/profile/custom-layer.d.ts +3 -0
  861. package/dist/llm/profile/custom-layer.js +83 -0
  862. package/dist/llm/profile/custom-layer.js.map +1 -0
  863. package/dist/llm/profile/layer-merge.d.ts +3 -0
  864. package/dist/llm/profile/layer-merge.js +185 -0
  865. package/dist/llm/profile/layer-merge.js.map +1 -0
  866. package/dist/llm/profile/spec-validation.d.ts +5 -0
  867. package/dist/llm/profile/spec-validation.js +289 -0
  868. package/dist/llm/profile/spec-validation.js.map +1 -0
  869. package/dist/llm/profile/spec-vocabulary.d.ts +21 -0
  870. package/dist/llm/profile/spec-vocabulary.js +142 -0
  871. package/dist/llm/profile/spec-vocabulary.js.map +1 -0
  872. package/dist/llm/provider-identity.d.ts +5 -0
  873. package/dist/llm/provider-identity.js +130 -0
  874. package/dist/llm/provider-identity.js.map +1 -0
  875. package/dist/llm/provider-info-text.d.ts +1 -0
  876. package/dist/llm/provider-info-text.js +587 -0
  877. package/dist/llm/provider-info-text.js.map +1 -0
  878. package/dist/llm/provider-model-layers.d.ts +2 -0
  879. package/dist/llm/provider-model-layers.js +6 -380
  880. package/dist/llm/provider-model-layers.js.map +1 -1
  881. package/dist/llm/provider-profile-layers.js +0 -2
  882. package/dist/llm/provider-profile-layers.js.map +1 -1
  883. package/dist/llm/provider-profile.d.ts +10 -12
  884. package/dist/llm/provider-profile.js +6 -265
  885. package/dist/llm/provider-profile.js.map +1 -1
  886. package/dist/llm/provider.d.ts +4 -16
  887. package/dist/llm/provider.js +6 -760
  888. package/dist/llm/provider.js.map +1 -1
  889. package/dist/llm/qwen-cloud.js +2 -4
  890. package/dist/llm/qwen-cloud.js.map +1 -1
  891. package/dist/llm/reasoning-artifacts.d.ts +5 -50
  892. package/dist/llm/reasoning-artifacts.js +11 -198
  893. package/dist/llm/reasoning-artifacts.js.map +1 -1
  894. package/dist/llm/reasoning-capability.js +0 -16
  895. package/dist/llm/reasoning-capability.js.map +1 -1
  896. package/dist/llm/request-fingerprint.d.ts +0 -4
  897. package/dist/llm/request-fingerprint.js +0 -4
  898. package/dist/llm/request-fingerprint.js.map +1 -1
  899. package/dist/llm/request-plan.d.ts +0 -14
  900. package/dist/llm/request-plan.js +0 -23
  901. package/dist/llm/request-plan.js.map +1 -1
  902. package/dist/llm/responses/item-events.d.ts +3 -0
  903. package/dist/llm/responses/item-events.js +93 -0
  904. package/dist/llm/responses/item-events.js.map +1 -0
  905. package/dist/llm/responses-complete.d.ts +1 -1
  906. package/dist/llm/responses-complete.js +2 -1
  907. package/dist/llm/responses-complete.js.map +1 -1
  908. package/dist/llm/responses-config.js.map +1 -1
  909. package/dist/llm/responses-http.d.ts +1 -0
  910. package/dist/llm/responses-http.js +3 -1
  911. package/dist/llm/responses-http.js.map +1 -1
  912. package/dist/llm/responses-parse.d.ts +3 -0
  913. package/dist/llm/responses-parse.js +19 -6
  914. package/dist/llm/responses-parse.js.map +1 -1
  915. package/dist/llm/responses-request.d.ts +2 -1
  916. package/dist/llm/responses-request.js +7 -2
  917. package/dist/llm/responses-request.js.map +1 -1
  918. package/dist/llm/responses-shape.d.ts +5 -0
  919. package/dist/llm/responses-shape.js +16 -0
  920. package/dist/llm/responses-shape.js.map +1 -0
  921. package/dist/llm/responses-stream-accumulator.d.ts +1 -1
  922. package/dist/llm/responses-stream-accumulator.js +8 -9
  923. package/dist/llm/responses-stream-accumulator.js.map +1 -1
  924. package/dist/llm/responses-stream-events.d.ts +2 -0
  925. package/dist/llm/responses-stream-events.js +34 -102
  926. package/dist/llm/responses-stream-events.js.map +1 -1
  927. package/dist/llm/responses-stream-watchdog.js.map +1 -1
  928. package/dist/llm/responses-stream.js +9 -4
  929. package/dist/llm/responses-stream.js.map +1 -1
  930. package/dist/llm/router.d.ts +7 -44
  931. package/dist/llm/router.js +24 -1145
  932. package/dist/llm/router.js.map +1 -1
  933. package/dist/llm/routing/attempt-complete.d.ts +3 -0
  934. package/dist/llm/routing/attempt-complete.js +120 -0
  935. package/dist/llm/routing/attempt-complete.js.map +1 -0
  936. package/dist/llm/routing/attempt-request.d.ts +21 -0
  937. package/dist/llm/routing/attempt-request.js +99 -0
  938. package/dist/llm/routing/attempt-request.js.map +1 -0
  939. package/dist/llm/routing/attempt-stream.d.ts +3 -0
  940. package/dist/llm/routing/attempt-stream.js +256 -0
  941. package/dist/llm/routing/attempt-stream.js.map +1 -0
  942. package/dist/llm/routing/error-classification.d.ts +15 -0
  943. package/dist/llm/routing/error-classification.js +151 -0
  944. package/dist/llm/routing/error-classification.js.map +1 -0
  945. package/dist/llm/routing/failure-report.d.ts +22 -0
  946. package/dist/llm/routing/failure-report.js +128 -0
  947. package/dist/llm/routing/failure-report.js.map +1 -0
  948. package/dist/llm/routing/key-rotation.d.ts +21 -0
  949. package/dist/llm/routing/key-rotation.js +207 -0
  950. package/dist/llm/routing/key-rotation.js.map +1 -0
  951. package/dist/llm/routing/provider-selection.d.ts +8 -0
  952. package/dist/llm/routing/provider-selection.js +119 -0
  953. package/dist/llm/routing/provider-selection.js.map +1 -0
  954. package/dist/llm/sampling.d.ts +0 -15
  955. package/dist/llm/sampling.js +0 -9
  956. package/dist/llm/sampling.js.map +1 -1
  957. package/dist/llm/session-affinity.d.ts +2 -0
  958. package/dist/llm/session-affinity.js +9 -0
  959. package/dist/llm/session-affinity.js.map +1 -0
  960. package/dist/llm/stream-progress.d.ts +0 -1
  961. package/dist/llm/stream-progress.js +0 -15
  962. package/dist/llm/stream-progress.js.map +1 -1
  963. package/dist/llm/system-messages.d.ts +0 -22
  964. package/dist/llm/system-messages.js +6 -22
  965. package/dist/llm/system-messages.js.map +1 -1
  966. package/dist/llm/token-estimate-calibration.d.ts +0 -6
  967. package/dist/llm/token-estimate-calibration.js +0 -26
  968. package/dist/llm/token-estimate-calibration.js.map +1 -1
  969. package/dist/llm/token-usage.d.ts +8 -69
  970. package/dist/llm/token-usage.js +10 -257
  971. package/dist/llm/token-usage.js.map +1 -1
  972. package/dist/llm/tokenrouter.d.ts +0 -12
  973. package/dist/llm/tokenrouter.js +3 -14
  974. package/dist/llm/tokenrouter.js.map +1 -1
  975. package/dist/llm/tool-protocol.d.ts +3 -22
  976. package/dist/llm/tool-protocol.js +20 -155
  977. package/dist/llm/tool-protocol.js.map +1 -1
  978. package/dist/llm/tool-wire/argument-repair.d.ts +4 -0
  979. package/dist/llm/tool-wire/argument-repair.js +174 -0
  980. package/dist/llm/tool-wire/argument-repair.js.map +1 -0
  981. package/dist/llm/transport-events.d.ts +12 -0
  982. package/dist/llm/transport-events.js +29 -0
  983. package/dist/llm/transport-events.js.map +1 -0
  984. package/dist/llm/usage/provider-parsers.d.ts +11 -0
  985. package/dist/llm/usage/provider-parsers.js +220 -0
  986. package/dist/llm/usage/provider-parsers.js.map +1 -0
  987. package/dist/llm/wire/abort-race.d.ts +1 -0
  988. package/dist/llm/wire/abort-race.js +34 -0
  989. package/dist/llm/wire/abort-race.js.map +1 -0
  990. package/dist/llm/wire/capability-errors.d.ts +11 -0
  991. package/dist/llm/wire/capability-errors.js +92 -0
  992. package/dist/llm/wire/capability-errors.js.map +1 -0
  993. package/dist/llm/wire/chat-body.d.ts +40 -0
  994. package/dist/llm/wire/chat-body.js +172 -0
  995. package/dist/llm/wire/chat-body.js.map +1 -0
  996. package/dist/llm/wire/model-catalog.d.ts +4 -0
  997. package/dist/llm/wire/model-catalog.js +34 -0
  998. package/dist/llm/wire/model-catalog.js.map +1 -0
  999. package/dist/llm/wire/openai-complete.d.ts +27 -0
  1000. package/dist/llm/wire/openai-complete.js +138 -0
  1001. package/dist/llm/wire/openai-complete.js.map +1 -0
  1002. package/dist/llm/wire/openai-stream.d.ts +36 -0
  1003. package/dist/llm/wire/openai-stream.js +665 -0
  1004. package/dist/llm/wire/openai-stream.js.map +1 -0
  1005. package/dist/llm/wire/reasoning-artifacts.d.ts +45 -0
  1006. package/dist/llm/wire/reasoning-artifacts.js +140 -0
  1007. package/dist/llm/wire/reasoning-artifacts.js.map +1 -0
  1008. package/dist/llm/wire/reasoning-payload.d.ts +9 -0
  1009. package/dist/llm/wire/reasoning-payload.js +212 -0
  1010. package/dist/llm/wire/reasoning-payload.js.map +1 -0
  1011. package/dist/llm/wire/response-errors.d.ts +5 -0
  1012. package/dist/llm/wire/response-errors.js +182 -0
  1013. package/dist/llm/wire/response-errors.js.map +1 -0
  1014. package/dist/llm/wire/responses-first.d.ts +30 -0
  1015. package/dist/llm/wire/responses-first.js +335 -0
  1016. package/dist/llm/wire/responses-first.js.map +1 -0
  1017. package/dist/llm/wire/stream-framing.d.ts +38 -0
  1018. package/dist/llm/wire/stream-framing.js +217 -0
  1019. package/dist/llm/wire/stream-framing.js.map +1 -0
  1020. package/dist/mcp/runtime.d.ts +0 -15
  1021. package/dist/mcp/runtime.js +0 -8
  1022. package/dist/mcp/runtime.js.map +1 -1
  1023. package/dist/modes/ask.d.ts +0 -3
  1024. package/dist/modes/ask.js +0 -22
  1025. package/dist/modes/ask.js.map +1 -1
  1026. package/dist/noninteractive/blocks/tool-blocks.d.ts +35 -0
  1027. package/dist/noninteractive/blocks/tool-blocks.js +206 -0
  1028. package/dist/noninteractive/blocks/tool-blocks.js.map +1 -0
  1029. package/dist/noninteractive/readline-prompts.d.ts +0 -21
  1030. package/dist/noninteractive/readline-prompts.js +0 -31
  1031. package/dist/noninteractive/readline-prompts.js.map +1 -1
  1032. package/dist/noninteractive/stdio-confirm-port.d.ts +0 -9
  1033. package/dist/noninteractive/stdio-confirm-port.js +0 -9
  1034. package/dist/noninteractive/stdio-confirm-port.js.map +1 -1
  1035. package/dist/noninteractive/stream-blocks.d.ts +3 -49
  1036. package/dist/noninteractive/stream-blocks.js +14 -234
  1037. package/dist/noninteractive/stream-blocks.js.map +1 -1
  1038. package/dist/noninteractive/stream-renderer.d.ts +0 -10
  1039. package/dist/noninteractive/stream-renderer.js +0 -10
  1040. package/dist/noninteractive/stream-renderer.js.map +1 -1
  1041. package/dist/noninteractive/stream-spinner.d.ts +0 -8
  1042. package/dist/noninteractive/stream-spinner.js +0 -8
  1043. package/dist/noninteractive/stream-spinner.js.map +1 -1
  1044. package/dist/os/bun-runtime.d.ts +0 -15
  1045. package/dist/os/bun-runtime.js +0 -33
  1046. package/dist/os/bun-runtime.js.map +1 -1
  1047. package/dist/os/command.d.ts +0 -6
  1048. package/dist/os/command.js +0 -13
  1049. package/dist/os/command.js.map +1 -1
  1050. package/dist/os/cwd.d.ts +0 -5
  1051. package/dist/os/cwd.js +0 -6
  1052. package/dist/os/cwd.js.map +1 -1
  1053. package/dist/os/permissions.d.ts +0 -11
  1054. package/dist/os/permissions.js +0 -13
  1055. package/dist/os/permissions.js.map +1 -1
  1056. package/dist/os/process-identity.d.ts +0 -22
  1057. package/dist/os/process-identity.js +0 -23
  1058. package/dist/os/process-identity.js.map +1 -1
  1059. package/dist/os/process-tree.d.ts +0 -7
  1060. package/dist/os/process-tree.js +0 -8
  1061. package/dist/os/process-tree.js.map +1 -1
  1062. package/dist/prompts/index.d.ts +0 -36
  1063. package/dist/prompts/index.js +0 -46
  1064. package/dist/prompts/index.js.map +1 -1
  1065. package/dist/safety/classifier.d.ts +5 -26
  1066. package/dist/safety/classifier.js +5 -573
  1067. package/dist/safety/classifier.js.map +1 -1
  1068. package/dist/safety/engagement-policy.d.ts +0 -13
  1069. package/dist/safety/engagement-policy.js +0 -32
  1070. package/dist/safety/engagement-policy.js.map +1 -1
  1071. package/dist/safety/patterns.d.ts +0 -108
  1072. package/dist/safety/patterns.js +0 -159
  1073. package/dist/safety/patterns.js.map +1 -1
  1074. package/dist/safety/shell-classification.d.ts +19 -0
  1075. package/dist/safety/shell-classification.js +215 -0
  1076. package/dist/safety/shell-classification.js.map +1 -0
  1077. package/dist/safety/tool-classification.d.ts +4 -0
  1078. package/dist/safety/tool-classification.js +260 -0
  1079. package/dist/safety/tool-classification.js.map +1 -0
  1080. package/dist/store/config/endpoints.d.ts +85 -0
  1081. package/dist/store/config/endpoints.js +298 -0
  1082. package/dist/store/config/endpoints.js.map +1 -0
  1083. package/dist/store/config/settings.d.ts +11 -0
  1084. package/dist/store/config/settings.js +52 -0
  1085. package/dist/store/config/settings.js.map +1 -0
  1086. package/dist/store/config.d.ts +6 -169
  1087. package/dist/store/config.js +4 -411
  1088. package/dist/store/config.js.map +1 -1
  1089. package/dist/store/engagement.d.ts +0 -1
  1090. package/dist/store/engagement.js +0 -3
  1091. package/dist/store/engagement.js.map +1 -1
  1092. package/dist/store/history/jsonl-backend.d.ts +7 -0
  1093. package/dist/store/history/jsonl-backend.js +151 -0
  1094. package/dist/store/history/jsonl-backend.js.map +1 -0
  1095. package/dist/store/history/jsonl-lock.d.ts +2 -0
  1096. package/dist/store/history/jsonl-lock.js +100 -0
  1097. package/dist/store/history/jsonl-lock.js.map +1 -0
  1098. package/dist/store/history/lifecycle.d.ts +14 -0
  1099. package/dist/store/history/lifecycle.js +316 -0
  1100. package/dist/store/history/lifecycle.js.map +1 -0
  1101. package/dist/store/history/recovery.d.ts +62 -0
  1102. package/dist/store/history/recovery.js +253 -0
  1103. package/dist/store/history/recovery.js.map +1 -0
  1104. package/dist/store/history/session-queries.d.ts +9 -0
  1105. package/dist/store/history/session-queries.js +142 -0
  1106. package/dist/store/history/session-queries.js.map +1 -0
  1107. package/dist/store/history/sqlite-backend.d.ts +25 -0
  1108. package/dist/store/history/sqlite-backend.js +209 -0
  1109. package/dist/store/history/sqlite-backend.js.map +1 -0
  1110. package/dist/store/history-index.d.ts +0 -5
  1111. package/dist/store/history-index.js +0 -10
  1112. package/dist/store/history-index.js.map +1 -1
  1113. package/dist/store/history.d.ts +12 -97
  1114. package/dist/store/history.js +12 -1214
  1115. package/dist/store/history.js.map +1 -1
  1116. package/dist/store/keys/search-providers.d.ts +33 -0
  1117. package/dist/store/keys/search-providers.js +211 -0
  1118. package/dist/store/keys/search-providers.js.map +1 -0
  1119. package/dist/store/keys/secret-store.d.ts +40 -0
  1120. package/dist/store/keys/secret-store.js +249 -0
  1121. package/dist/store/keys/secret-store.js.map +1 -0
  1122. package/dist/store/keys.d.ts +8 -95
  1123. package/dist/store/keys.js +7 -537
  1124. package/dist/store/keys.js.map +1 -1
  1125. package/dist/store/logs.d.ts +0 -1
  1126. package/dist/store/logs.js +1 -7
  1127. package/dist/store/logs.js.map +1 -1
  1128. package/dist/store/paths.d.ts +0 -12
  1129. package/dist/store/paths.js +0 -12
  1130. package/dist/store/paths.js.map +1 -1
  1131. package/dist/store/plan/jsonl-backend.d.ts +7 -0
  1132. package/dist/store/plan/jsonl-backend.js +115 -0
  1133. package/dist/store/plan/jsonl-backend.js.map +1 -0
  1134. package/dist/store/plan/mutation.d.ts +25 -0
  1135. package/dist/store/plan/mutation.js +270 -0
  1136. package/dist/store/plan/mutation.js.map +1 -0
  1137. package/dist/store/plan/sqlite-backend.d.ts +66 -0
  1138. package/dist/store/plan/sqlite-backend.js +66 -0
  1139. package/dist/store/plan/sqlite-backend.js.map +1 -0
  1140. package/dist/store/plan/task-normalization.d.ts +8 -0
  1141. package/dist/store/plan/task-normalization.js +165 -0
  1142. package/dist/store/plan/task-normalization.js.map +1 -0
  1143. package/dist/store/plan.d.ts +9 -176
  1144. package/dist/store/plan.js +11 -742
  1145. package/dist/store/plan.js.map +1 -1
  1146. package/dist/store/project.js +0 -5
  1147. package/dist/store/project.js.map +1 -1
  1148. package/dist/store/responder-settlement.d.ts +0 -1
  1149. package/dist/store/responder-settlement.js +0 -3
  1150. package/dist/store/responder-settlement.js.map +1 -1
  1151. package/dist/store/scope.d.ts +0 -16
  1152. package/dist/store/scope.js +0 -22
  1153. package/dist/store/scope.js.map +1 -1
  1154. package/dist/store/session-workspace.d.ts +0 -51
  1155. package/dist/store/session-workspace.js +0 -57
  1156. package/dist/store/session-workspace.js.map +1 -1
  1157. package/dist/store/task-transitions.d.ts +0 -7
  1158. package/dist/store/task-transitions.js +0 -6
  1159. package/dist/store/task-transitions.js.map +1 -1
  1160. package/dist/tools/batch/batch-parsing.d.ts +11 -0
  1161. package/dist/tools/batch/batch-parsing.js +78 -0
  1162. package/dist/tools/batch/batch-parsing.js.map +1 -0
  1163. package/dist/tools/batch/limits.d.ts +6 -0
  1164. package/dist/tools/batch/limits.js +17 -0
  1165. package/dist/tools/batch/limits.js.map +1 -0
  1166. package/dist/tools/batch/run-batch.d.ts +3 -0
  1167. package/dist/tools/batch/run-batch.js +402 -0
  1168. package/dist/tools/batch/run-batch.js.map +1 -0
  1169. package/dist/tools/batch-fail-policy.d.ts +0 -29
  1170. package/dist/tools/batch-fail-policy.js +0 -31
  1171. package/dist/tools/batch-fail-policy.js.map +1 -1
  1172. package/dist/tools/call-normalization.d.ts +2 -0
  1173. package/dist/tools/call-normalization.js +165 -0
  1174. package/dist/tools/call-normalization.js.map +1 -0
  1175. package/dist/tools/capabilities.d.ts +0 -1
  1176. package/dist/tools/capabilities.js +0 -28
  1177. package/dist/tools/capabilities.js.map +1 -1
  1178. package/dist/tools/command-intent.d.ts +0 -19
  1179. package/dist/tools/command-intent.js +0 -65
  1180. package/dist/tools/command-intent.js.map +1 -1
  1181. package/dist/tools/definitions/aggregate.d.ts +2 -0
  1182. package/dist/tools/definitions/aggregate.js +263 -0
  1183. package/dist/tools/definitions/aggregate.js.map +1 -0
  1184. package/dist/tools/definitions/context-1.d.ts +2 -0
  1185. package/dist/tools/definitions/context-1.js +8 -0
  1186. package/dist/tools/definitions/context-1.js.map +1 -0
  1187. package/dist/tools/definitions/context-2.d.ts +2 -0
  1188. package/dist/tools/definitions/context-2.js +90 -0
  1189. package/dist/tools/definitions/context-2.js.map +1 -0
  1190. package/dist/tools/definitions/define.d.ts +7 -0
  1191. package/dist/tools/definitions/define.js +53 -0
  1192. package/dist/tools/definitions/define.js.map +1 -0
  1193. package/dist/tools/definitions/files.d.ts +2 -0
  1194. package/dist/tools/definitions/files.js +193 -0
  1195. package/dist/tools/definitions/files.js.map +1 -0
  1196. package/dist/tools/definitions/network-1.d.ts +2 -0
  1197. package/dist/tools/definitions/network-1.js +72 -0
  1198. package/dist/tools/definitions/network-1.js.map +1 -0
  1199. package/dist/tools/definitions/network-2.d.ts +2 -0
  1200. package/dist/tools/definitions/network-2.js +22 -0
  1201. package/dist/tools/definitions/network-2.js.map +1 -0
  1202. package/dist/tools/definitions/orchestration.d.ts +2 -0
  1203. package/dist/tools/definitions/orchestration.js +122 -0
  1204. package/dist/tools/definitions/orchestration.js.map +1 -0
  1205. package/dist/tools/definitions/pentest.d.ts +2 -0
  1206. package/dist/tools/definitions/pentest.js +91 -0
  1207. package/dist/tools/definitions/pentest.js.map +1 -0
  1208. package/dist/tools/definitions/selection.d.ts +9 -0
  1209. package/dist/tools/definitions/selection.js +84 -0
  1210. package/dist/tools/definitions/selection.js.map +1 -0
  1211. package/dist/tools/definitions/shell.d.ts +2 -0
  1212. package/dist/tools/definitions/shell.js +83 -0
  1213. package/dist/tools/definitions/shell.js.map +1 -0
  1214. package/dist/tools/definitions/terminal.d.ts +2 -0
  1215. package/dist/tools/definitions/terminal.js +91 -0
  1216. package/dist/tools/definitions/terminal.js.map +1 -0
  1217. package/dist/tools/definitions/web-1.d.ts +2 -0
  1218. package/dist/tools/definitions/web-1.js +68 -0
  1219. package/dist/tools/definitions/web-1.js.map +1 -0
  1220. package/dist/tools/definitions/web-2.d.ts +2 -0
  1221. package/dist/tools/definitions/web-2.js +59 -0
  1222. package/dist/tools/definitions/web-2.js.map +1 -0
  1223. package/dist/tools/definitions.d.ts +3 -16
  1224. package/dist/tools/definitions.js +8 -1238
  1225. package/dist/tools/definitions.js.map +1 -1
  1226. package/dist/tools/diff/line-ops.d.ts +34 -0
  1227. package/dist/tools/diff/line-ops.js +218 -0
  1228. package/dist/tools/diff/line-ops.js.map +1 -0
  1229. package/dist/tools/dns-native.d.ts +0 -5
  1230. package/dist/tools/dns-native.js +0 -16
  1231. package/dist/tools/dns-native.js.map +1 -1
  1232. package/dist/tools/external-tools.d.ts +0 -8
  1233. package/dist/tools/external-tools.js.map +1 -1
  1234. package/dist/tools/file-diff.d.ts +3 -78
  1235. package/dist/tools/file-diff.js +2 -271
  1236. package/dist/tools/file-diff.js.map +1 -1
  1237. package/dist/tools/fs/internals-2.d.ts +1 -0
  1238. package/dist/tools/fs/internals-2.js +6 -0
  1239. package/dist/tools/fs/internals-2.js.map +1 -0
  1240. package/dist/tools/fs/internals.d.ts +4 -0
  1241. package/dist/tools/fs/internals.js +23 -0
  1242. package/dist/tools/fs/internals.js.map +1 -0
  1243. package/dist/tools/fs/mutations.d.ts +17 -0
  1244. package/dist/tools/fs/mutations.js +396 -0
  1245. package/dist/tools/fs/mutations.js.map +1 -0
  1246. package/dist/tools/fs/read-window.d.ts +14 -0
  1247. package/dist/tools/fs/read-window.js +288 -0
  1248. package/dist/tools/fs/read-window.js.map +1 -0
  1249. package/dist/tools/fs/read.d.ts +7 -0
  1250. package/dist/tools/fs/read.js +164 -0
  1251. package/dist/tools/fs/read.js.map +1 -0
  1252. package/dist/tools/fs/search.d.ts +13 -0
  1253. package/dist/tools/fs/search.js +125 -0
  1254. package/dist/tools/fs/search.js.map +1 -0
  1255. package/dist/tools/fs.d.ts +4 -79
  1256. package/dist/tools/fs.js +26 -1115
  1257. package/dist/tools/fs.js.map +1 -1
  1258. package/dist/tools/handlers/args.d.ts +8 -0
  1259. package/dist/tools/handlers/args.js +50 -0
  1260. package/dist/tools/handlers/args.js.map +1 -0
  1261. package/dist/tools/handlers/context-1.d.ts +2 -0
  1262. package/dist/tools/handlers/context-1.js +7 -0
  1263. package/dist/tools/handlers/context-1.js.map +1 -0
  1264. package/dist/tools/handlers/context-2.d.ts +2 -0
  1265. package/dist/tools/handlers/context-2.js +14 -0
  1266. package/dist/tools/handlers/context-2.js.map +1 -0
  1267. package/dist/tools/handlers/files-1.d.ts +2 -0
  1268. package/dist/tools/handlers/files-1.js +51 -0
  1269. package/dist/tools/handlers/files-1.js.map +1 -0
  1270. package/dist/tools/handlers/files-2.d.ts +2 -0
  1271. package/dist/tools/handlers/files-2.js +31 -0
  1272. package/dist/tools/handlers/files-2.js.map +1 -0
  1273. package/dist/tools/handlers/network-1.d.ts +2 -0
  1274. package/dist/tools/handlers/network-1.js +52 -0
  1275. package/dist/tools/handlers/network-1.js.map +1 -0
  1276. package/dist/tools/handlers/network-2.d.ts +2 -0
  1277. package/dist/tools/handlers/network-2.js +32 -0
  1278. package/dist/tools/handlers/network-2.js.map +1 -0
  1279. package/dist/tools/handlers/network-3.d.ts +2 -0
  1280. package/dist/tools/handlers/network-3.js +17 -0
  1281. package/dist/tools/handlers/network-3.js.map +1 -0
  1282. package/dist/tools/handlers/nmap-preparation.d.ts +13 -0
  1283. package/dist/tools/handlers/nmap-preparation.js +66 -0
  1284. package/dist/tools/handlers/nmap-preparation.js.map +1 -0
  1285. package/dist/tools/handlers/orchestration-1.d.ts +2 -0
  1286. package/dist/tools/handlers/orchestration-1.js +7 -0
  1287. package/dist/tools/handlers/orchestration-1.js.map +1 -0
  1288. package/dist/tools/handlers/orchestration-2.d.ts +2 -0
  1289. package/dist/tools/handlers/orchestration-2.js +16 -0
  1290. package/dist/tools/handlers/orchestration-2.js.map +1 -0
  1291. package/dist/tools/handlers/pentest.d.ts +2 -0
  1292. package/dist/tools/handlers/pentest.js +208 -0
  1293. package/dist/tools/handlers/pentest.js.map +1 -0
  1294. package/dist/tools/handlers/responder-job-options.d.ts +3 -0
  1295. package/dist/tools/handlers/responder-job-options.js +16 -0
  1296. package/dist/tools/handlers/responder-job-options.js.map +1 -0
  1297. package/dist/tools/handlers/shell-1.d.ts +2 -0
  1298. package/dist/tools/handlers/shell-1.js +94 -0
  1299. package/dist/tools/handlers/shell-1.js.map +1 -0
  1300. package/dist/tools/handlers/shell-2.d.ts +2 -0
  1301. package/dist/tools/handlers/shell-2.js +49 -0
  1302. package/dist/tools/handlers/shell-2.js.map +1 -0
  1303. package/dist/tools/handlers/shell-3.d.ts +2 -0
  1304. package/dist/tools/handlers/shell-3.js +47 -0
  1305. package/dist/tools/handlers/shell-3.js.map +1 -0
  1306. package/dist/tools/handlers/web.d.ts +2 -0
  1307. package/dist/tools/handlers/web.js +168 -0
  1308. package/dist/tools/handlers/web.js.map +1 -0
  1309. package/dist/tools/http/agents.d.ts +10 -0
  1310. package/dist/tools/http/agents.js +63 -0
  1311. package/dist/tools/http/agents.js.map +1 -0
  1312. package/dist/tools/http/evidence-format.d.ts +37 -0
  1313. package/dist/tools/http/evidence-format.js +181 -0
  1314. package/dist/tools/http/evidence-format.js.map +1 -0
  1315. package/dist/tools/http/fetch.d.ts +31 -0
  1316. package/dist/tools/http/fetch.js +480 -0
  1317. package/dist/tools/http/fetch.js.map +1 -0
  1318. package/dist/tools/http/retry-policy.d.ts +14 -0
  1319. package/dist/tools/http/retry-policy.js +144 -0
  1320. package/dist/tools/http/retry-policy.js.map +1 -0
  1321. package/dist/tools/http.d.ts +1 -45
  1322. package/dist/tools/http.js +1 -920
  1323. package/dist/tools/http.js.map +1 -1
  1324. package/dist/tools/image.d.ts +0 -15
  1325. package/dist/tools/image.js +0 -21
  1326. package/dist/tools/image.js.map +1 -1
  1327. package/dist/tools/interactive-session-tools.d.ts +0 -7
  1328. package/dist/tools/interactive-session-tools.js +0 -13
  1329. package/dist/tools/interactive-session-tools.js.map +1 -1
  1330. package/dist/tools/jobs/helpers.d.ts +6 -0
  1331. package/dist/tools/jobs/helpers.js +63 -0
  1332. package/dist/tools/jobs/helpers.js.map +1 -0
  1333. package/dist/tools/jobs/limits.d.ts +20 -0
  1334. package/dist/tools/jobs/limits.js +21 -0
  1335. package/dist/tools/jobs/limits.js.map +1 -0
  1336. package/dist/tools/jobs/polling-policy.d.ts +11 -0
  1337. package/dist/tools/jobs/polling-policy.js +33 -0
  1338. package/dist/tools/jobs/polling-policy.js.map +1 -0
  1339. package/dist/tools/jobs/process-identity.d.ts +5 -0
  1340. package/dist/tools/jobs/process-identity.js +80 -0
  1341. package/dist/tools/jobs/process-identity.js.map +1 -0
  1342. package/dist/tools/jobs/redacted-writer.d.ts +25 -0
  1343. package/dist/tools/jobs/redacted-writer.js +134 -0
  1344. package/dist/tools/jobs/redacted-writer.js.map +1 -0
  1345. package/dist/tools/jobs/types.d.ts +152 -0
  1346. package/dist/tools/jobs/types.js +2 -0
  1347. package/dist/tools/jobs/types.js.map +1 -0
  1348. package/dist/tools/jobs.d.ts +8 -210
  1349. package/dist/tools/jobs.js +13 -453
  1350. package/dist/tools/jobs.js.map +1 -1
  1351. package/dist/tools/net-ping-sweep.d.ts +0 -8
  1352. package/dist/tools/net-ping-sweep.js +0 -22
  1353. package/dist/tools/net-ping-sweep.js.map +1 -1
  1354. package/dist/tools/network-context.d.ts +0 -4
  1355. package/dist/tools/network-context.js +0 -8
  1356. package/dist/tools/network-context.js.map +1 -1
  1357. package/dist/tools/nmap-runner.d.ts +0 -21
  1358. package/dist/tools/nmap-runner.js +0 -43
  1359. package/dist/tools/nmap-runner.js.map +1 -1
  1360. package/dist/tools/output-selection.d.ts +0 -1
  1361. package/dist/tools/output-selection.js +0 -3
  1362. package/dist/tools/output-selection.js.map +1 -1
  1363. package/dist/tools/package-binary.js +0 -7
  1364. package/dist/tools/package-binary.js.map +1 -1
  1365. package/dist/tools/pdf/read.d.ts +6 -0
  1366. package/dist/tools/pdf/read.js +529 -0
  1367. package/dist/tools/pdf/read.js.map +1 -0
  1368. package/dist/tools/pdf.d.ts +2 -6
  1369. package/dist/tools/pdf.js +1 -528
  1370. package/dist/tools/pdf.js.map +1 -1
  1371. package/dist/tools/pentest-workflows.js +0 -12
  1372. package/dist/tools/pentest-workflows.js.map +1 -1
  1373. package/dist/tools/policies/output-policy.d.ts +0 -17
  1374. package/dist/tools/policies/output-policy.js +0 -18
  1375. package/dist/tools/policies/output-policy.js.map +1 -1
  1376. package/dist/tools/reducers/ffuf.d.ts +0 -5
  1377. package/dist/tools/reducers/ffuf.js +0 -8
  1378. package/dist/tools/reducers/ffuf.js.map +1 -1
  1379. package/dist/tools/reducers/gobuster.js +0 -1
  1380. package/dist/tools/reducers/gobuster.js.map +1 -1
  1381. package/dist/tools/reducers/httpx.js +0 -1
  1382. package/dist/tools/reducers/httpx.js.map +1 -1
  1383. package/dist/tools/reducers/nmap.d.ts +0 -5
  1384. package/dist/tools/reducers/nmap.js +0 -5
  1385. package/dist/tools/reducers/nmap.js.map +1 -1
  1386. package/dist/tools/reducers/nuclei.js +0 -1
  1387. package/dist/tools/reducers/nuclei.js.map +1 -1
  1388. package/dist/tools/reducers/subdomains.d.ts +0 -4
  1389. package/dist/tools/reducers/subdomains.js +0 -4
  1390. package/dist/tools/reducers/subdomains.js.map +1 -1
  1391. package/dist/tools/reducers/types.d.ts +0 -5
  1392. package/dist/tools/registry.d.ts +4 -20
  1393. package/dist/tools/registry.js +36 -1634
  1394. package/dist/tools/registry.js.map +1 -1
  1395. package/dist/tools/shell/artifact-name.d.ts +1 -0
  1396. package/dist/tools/shell/artifact-name.js +6 -0
  1397. package/dist/tools/shell/artifact-name.js.map +1 -0
  1398. package/dist/tools/shell/capture.d.ts +31 -0
  1399. package/dist/tools/shell/capture.js +135 -0
  1400. package/dist/tools/shell/capture.js.map +1 -0
  1401. package/dist/tools/shell/exec-attempt.d.ts +10 -0
  1402. package/dist/tools/shell/exec-attempt.js +288 -0
  1403. package/dist/tools/shell/exec-attempt.js.map +1 -0
  1404. package/dist/tools/shell/internals-2.d.ts +16 -0
  1405. package/dist/tools/shell/internals-2.js +48 -0
  1406. package/dist/tools/shell/internals-2.js.map +1 -0
  1407. package/dist/tools/shell/internals.d.ts +10 -0
  1408. package/dist/tools/shell/internals.js +51 -0
  1409. package/dist/tools/shell/internals.js.map +1 -0
  1410. package/dist/tools/shell/spawn-argv.d.ts +17 -0
  1411. package/dist/tools/shell/spawn-argv.js +248 -0
  1412. package/dist/tools/shell/spawn-argv.js.map +1 -0
  1413. package/dist/tools/shell-quoting.d.ts +1 -0
  1414. package/dist/tools/shell-quoting.js +7 -0
  1415. package/dist/tools/shell-quoting.js.map +1 -0
  1416. package/dist/tools/shell.d.ts +4 -82
  1417. package/dist/tools/shell.js +7 -845
  1418. package/dist/tools/shell.js.map +1 -1
  1419. package/dist/tools/sudo-session.d.ts +0 -41
  1420. package/dist/tools/sudo-session.js +0 -44
  1421. package/dist/tools/sudo-session.js.map +1 -1
  1422. package/dist/tools/tool-types.d.ts +0 -7
  1423. package/dist/tools/validate.d.ts +0 -35
  1424. package/dist/tools/validate.js +2 -67
  1425. package/dist/tools/validate.js.map +1 -1
  1426. package/dist/tools/web/audit.d.ts +0 -74
  1427. package/dist/tools/web/audit.js +0 -39
  1428. package/dist/tools/web/audit.js.map +1 -1
  1429. package/dist/tools/web/budget.d.ts +0 -35
  1430. package/dist/tools/web/budget.js +0 -75
  1431. package/dist/tools/web/budget.js.map +1 -1
  1432. package/dist/tools/web/capture.d.ts +0 -106
  1433. package/dist/tools/web/capture.js +0 -148
  1434. package/dist/tools/web/capture.js.map +1 -1
  1435. package/dist/tools/web/decode.d.ts +0 -8
  1436. package/dist/tools/web/decode.js +0 -9
  1437. package/dist/tools/web/decode.js.map +1 -1
  1438. package/dist/tools/web/fetch-core.d.ts +2 -32
  1439. package/dist/tools/web/fetch-core.js +4 -1058
  1440. package/dist/tools/web/fetch-core.js.map +1 -1
  1441. package/dist/tools/web/fetch.d.ts +0 -29
  1442. package/dist/tools/web/fetch.js +0 -46
  1443. package/dist/tools/web/fetch.js.map +1 -1
  1444. package/dist/tools/web/issue-hop.d.ts +57 -0
  1445. package/dist/tools/web/issue-hop.js +396 -0
  1446. package/dist/tools/web/issue-hop.js.map +1 -0
  1447. package/dist/tools/web/providers/brave.d.ts +0 -40
  1448. package/dist/tools/web/providers/brave.js +1 -100
  1449. package/dist/tools/web/providers/brave.js.map +1 -1
  1450. package/dist/tools/web/providers/duckduckgo.d.ts +0 -41
  1451. package/dist/tools/web/providers/duckduckgo.js +0 -104
  1452. package/dist/tools/web/providers/duckduckgo.js.map +1 -1
  1453. package/dist/tools/web/providers/exa.d.ts +0 -43
  1454. package/dist/tools/web/providers/exa.js +1 -102
  1455. package/dist/tools/web/providers/exa.js.map +1 -1
  1456. package/dist/tools/web/providers/provider.d.ts +0 -69
  1457. package/dist/tools/web/providers/provider.js +0 -28
  1458. package/dist/tools/web/providers/provider.js.map +1 -1
  1459. package/dist/tools/web/providers/tavily.d.ts +0 -46
  1460. package/dist/tools/web/providers/tavily.js +1 -111
  1461. package/dist/tools/web/providers/tavily.js.map +1 -1
  1462. package/dist/tools/web/readable.d.ts +0 -62
  1463. package/dist/tools/web/readable.js +1 -132
  1464. package/dist/tools/web/readable.js.map +1 -1
  1465. package/dist/tools/web/redact.d.ts +0 -26
  1466. package/dist/tools/web/redact.js +0 -2
  1467. package/dist/tools/web/redact.js.map +1 -1
  1468. package/dist/tools/web/request-loop.d.ts +38 -0
  1469. package/dist/tools/web/request-loop.js +172 -0
  1470. package/dist/tools/web/request-loop.js.map +1 -0
  1471. package/dist/tools/web/response-body.d.ts +41 -0
  1472. package/dist/tools/web/response-body.js +174 -0
  1473. package/dist/tools/web/response-body.js.map +1 -0
  1474. package/dist/tools/web/search-attempts.d.ts +20 -0
  1475. package/dist/tools/web/search-attempts.js +303 -0
  1476. package/dist/tools/web/search-attempts.js.map +1 -0
  1477. package/dist/tools/web/search.d.ts +0 -33
  1478. package/dist/tools/web/search.js +3 -396
  1479. package/dist/tools/web/search.js.map +1 -1
  1480. package/dist/tools/web/ssrf-guard.d.ts +0 -42
  1481. package/dist/tools/web/ssrf-guard.js +0 -57
  1482. package/dist/tools/web/ssrf-guard.js.map +1 -1
  1483. package/dist/tools/web/types.d.ts +0 -197
  1484. package/dist/tools/web/types.js +0 -41
  1485. package/dist/tools/web/types.js.map +1 -1
  1486. package/dist/tools/web/validate-args.d.ts +11 -0
  1487. package/dist/tools/web/validate-args.js +107 -0
  1488. package/dist/tools/web/validate-args.js.map +1 -0
  1489. package/dist/tools/whois-native.d.ts +0 -4
  1490. package/dist/tools/whois-native.js +0 -6
  1491. package/dist/tools/whois-native.js.map +1 -1
  1492. package/dist/tools/wordlists.js +0 -32
  1493. package/dist/tools/wordlists.js.map +1 -1
  1494. package/dist/tui-v2/app/App.d.ts +0 -10
  1495. package/dist/tui-v2/app/App.js +67 -112
  1496. package/dist/tui-v2/app/App.js.map +1 -1
  1497. package/dist/tui-v2/bootstrap/pager-export.d.ts +0 -8
  1498. package/dist/tui-v2/bootstrap/pager-export.js +0 -11
  1499. package/dist/tui-v2/bootstrap/pager-export.js.map +1 -1
  1500. package/dist/tui-v2/bootstrap/patch-opentui-text.d.ts +0 -5
  1501. package/dist/tui-v2/bootstrap/patch-opentui-text.js +0 -5
  1502. package/dist/tui-v2/bootstrap/patch-opentui-text.js.map +1 -1
  1503. package/dist/tui-v2/bootstrap/resize-repaint.d.ts +16 -20
  1504. package/dist/tui-v2/bootstrap/resize-repaint.js +31 -16
  1505. package/dist/tui-v2/bootstrap/resize-repaint.js.map +1 -1
  1506. package/dist/tui-v2/bootstrap/start-tui-v2.d.ts +0 -7
  1507. package/dist/tui-v2/bootstrap/start-tui-v2.js +10 -27
  1508. package/dist/tui-v2/bootstrap/start-tui-v2.js.map +1 -1
  1509. package/dist/tui-v2/components/completion/completion-menu.d.ts +0 -4
  1510. package/dist/tui-v2/components/completion/completion-menu.js +2 -6
  1511. package/dist/tui-v2/components/completion/completion-menu.js.map +1 -1
  1512. package/dist/tui-v2/components/composer/composer-input-box.d.ts +0 -4
  1513. package/dist/tui-v2/components/composer/composer-input-box.js +1 -10
  1514. package/dist/tui-v2/components/composer/composer-input-box.js.map +1 -1
  1515. package/dist/tui-v2/components/composer/paste-chip.d.ts +0 -7
  1516. package/dist/tui-v2/components/composer/paste-chip.js +0 -7
  1517. package/dist/tui-v2/components/composer/paste-chip.js.map +1 -1
  1518. package/dist/tui-v2/components/jobs/jobs-panel.d.ts +0 -12
  1519. package/dist/tui-v2/components/jobs/jobs-panel.js +0 -34
  1520. package/dist/tui-v2/components/jobs/jobs-panel.js.map +1 -1
  1521. package/dist/tui-v2/components/modal/confirm-modal.d.ts +0 -8
  1522. package/dist/tui-v2/components/modal/confirm-modal.js +0 -4
  1523. package/dist/tui-v2/components/modal/confirm-modal.js.map +1 -1
  1524. package/dist/tui-v2/components/modal/keys-modal.d.ts +0 -11
  1525. package/dist/tui-v2/components/modal/keys-modal.js +0 -24
  1526. package/dist/tui-v2/components/modal/keys-modal.js.map +1 -1
  1527. package/dist/tui-v2/components/modal/prompt-actions-modal.d.ts +0 -6
  1528. package/dist/tui-v2/components/modal/prompt-actions-modal.js +4 -13
  1529. package/dist/tui-v2/components/modal/prompt-actions-modal.js.map +1 -1
  1530. package/dist/tui-v2/components/modal/scope-modal.d.ts +0 -5
  1531. package/dist/tui-v2/components/modal/scope-modal.js +0 -12
  1532. package/dist/tui-v2/components/modal/scope-modal.js.map +1 -1
  1533. package/dist/tui-v2/components/modal/secret-modal.d.ts +0 -8
  1534. package/dist/tui-v2/components/modal/secret-modal.js +0 -17
  1535. package/dist/tui-v2/components/modal/secret-modal.js.map +1 -1
  1536. package/dist/tui-v2/components/modal/text-editor-modal.d.ts +0 -6
  1537. package/dist/tui-v2/components/modal/text-editor-modal.js +0 -6
  1538. package/dist/tui-v2/components/modal/text-editor-modal.js.map +1 -1
  1539. package/dist/tui-v2/components/overlay/overlay-host.d.ts +0 -14
  1540. package/dist/tui-v2/components/overlay/overlay-host.js +0 -2
  1541. package/dist/tui-v2/components/overlay/overlay-host.js.map +1 -1
  1542. package/dist/tui-v2/components/pager/pager-line.d.ts +0 -5
  1543. package/dist/tui-v2/components/pager/pager-line.js +0 -10
  1544. package/dist/tui-v2/components/pager/pager-line.js.map +1 -1
  1545. package/dist/tui-v2/components/pager/pager.d.ts +0 -14
  1546. package/dist/tui-v2/components/pager/pager.js +3 -58
  1547. package/dist/tui-v2/components/pager/pager.js.map +1 -1
  1548. package/dist/tui-v2/components/picker/picker.d.ts +0 -6
  1549. package/dist/tui-v2/components/picker/picker.js +3 -12
  1550. package/dist/tui-v2/components/picker/picker.js.map +1 -1
  1551. package/dist/tui-v2/components/plan/plan-pane-anim.d.ts +0 -25
  1552. package/dist/tui-v2/components/plan/plan-pane-anim.js +0 -23
  1553. package/dist/tui-v2/components/plan/plan-pane-anim.js.map +1 -1
  1554. package/dist/tui-v2/components/plan/plan-view.d.ts +0 -7
  1555. package/dist/tui-v2/components/plan/plan-view.js +0 -20
  1556. package/dist/tui-v2/components/plan/plan-view.js.map +1 -1
  1557. package/dist/tui-v2/components/plan/use-pane-presence.d.ts +0 -9
  1558. package/dist/tui-v2/components/plan/use-pane-presence.js +0 -9
  1559. package/dist/tui-v2/components/plan/use-pane-presence.js.map +1 -1
  1560. package/dist/tui-v2/components/queue/queue-panel.d.ts +0 -12
  1561. package/dist/tui-v2/components/queue/queue-panel.js +2 -4
  1562. package/dist/tui-v2/components/queue/queue-panel.js.map +1 -1
  1563. package/dist/tui-v2/components/status/status-line.d.ts +0 -17
  1564. package/dist/tui-v2/components/status/status-line.js +0 -10
  1565. package/dist/tui-v2/components/status/status-line.js.map +1 -1
  1566. package/dist/tui-v2/components/toast/toast-anim.d.ts +0 -20
  1567. package/dist/tui-v2/components/toast/toast-anim.js +0 -15
  1568. package/dist/tui-v2/components/toast/toast-anim.js.map +1 -1
  1569. package/dist/tui-v2/components/toast/toast-host.d.ts +0 -12
  1570. package/dist/tui-v2/components/toast/toast-host.js +1 -29
  1571. package/dist/tui-v2/components/toast/toast-host.js.map +1 -1
  1572. package/dist/tui-v2/components/transcript/assistant-message.d.ts +0 -11
  1573. package/dist/tui-v2/components/transcript/assistant-message.js +3 -24
  1574. package/dist/tui-v2/components/transcript/assistant-message.js.map +1 -1
  1575. package/dist/tui-v2/components/transcript/compacted-row.d.ts +0 -6
  1576. package/dist/tui-v2/components/transcript/compacted-row.js +2 -6
  1577. package/dist/tui-v2/components/transcript/compacted-row.js.map +1 -1
  1578. package/dist/tui-v2/components/transcript/file-diff-card.d.ts +0 -9
  1579. package/dist/tui-v2/components/transcript/file-diff-card.js +0 -16
  1580. package/dist/tui-v2/components/transcript/file-diff-card.js.map +1 -1
  1581. package/dist/tui-v2/components/transcript/intro-card.d.ts +0 -9
  1582. package/dist/tui-v2/components/transcript/intro-card.js +2 -13
  1583. package/dist/tui-v2/components/transcript/intro-card.js.map +1 -1
  1584. package/dist/tui-v2/components/transcript/linkable-text.d.ts +0 -16
  1585. package/dist/tui-v2/components/transcript/linkable-text.js +0 -11
  1586. package/dist/tui-v2/components/transcript/linkable-text.js.map +1 -1
  1587. package/dist/tui-v2/components/transcript/notice-row.d.ts +0 -7
  1588. package/dist/tui-v2/components/transcript/notice-row.js +2 -18
  1589. package/dist/tui-v2/components/transcript/notice-row.js.map +1 -1
  1590. package/dist/tui-v2/components/transcript/search-bar.d.ts +0 -10
  1591. package/dist/tui-v2/components/transcript/search-bar.js +0 -3
  1592. package/dist/tui-v2/components/transcript/search-bar.js.map +1 -1
  1593. package/dist/tui-v2/components/transcript/selectable-line.d.ts +0 -16
  1594. package/dist/tui-v2/components/transcript/selectable-line.js +0 -9
  1595. package/dist/tui-v2/components/transcript/selectable-line.js.map +1 -1
  1596. package/dist/tui-v2/components/transcript/thinking-block.d.ts +0 -18
  1597. package/dist/tui-v2/components/transcript/thinking-block.js +2 -40
  1598. package/dist/tui-v2/components/transcript/thinking-block.js.map +1 -1
  1599. package/dist/tui-v2/components/transcript/tool-card.d.ts +0 -19
  1600. package/dist/tui-v2/components/transcript/tool-card.js +2 -42
  1601. package/dist/tui-v2/components/transcript/tool-card.js.map +1 -1
  1602. package/dist/tui-v2/components/transcript/transcript-row.d.ts +0 -14
  1603. package/dist/tui-v2/components/transcript/transcript-row.js +0 -13
  1604. package/dist/tui-v2/components/transcript/transcript-row.js.map +1 -1
  1605. package/dist/tui-v2/components/transcript/transcript-scroll-port.d.ts +0 -32
  1606. package/dist/tui-v2/components/transcript/transcript-scroll-port.js +0 -22
  1607. package/dist/tui-v2/components/transcript/transcript-scroll-port.js.map +1 -1
  1608. package/dist/tui-v2/components/transcript/transcript-view.d.ts +0 -9
  1609. package/dist/tui-v2/components/transcript/transcript-view.js +4 -67
  1610. package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -1
  1611. package/dist/tui-v2/components/transcript/use-click-without-drag.d.ts +0 -7
  1612. package/dist/tui-v2/components/transcript/use-click-without-drag.js +1 -11
  1613. package/dist/tui-v2/components/transcript/use-click-without-drag.js.map +1 -1
  1614. package/dist/tui-v2/components/transcript/use-native-selection-copy.d.ts +0 -7
  1615. package/dist/tui-v2/components/transcript/use-native-selection-copy.js +0 -9
  1616. package/dist/tui-v2/components/transcript/use-native-selection-copy.js.map +1 -1
  1617. package/dist/tui-v2/components/transcript/use-transcript-selection.d.ts +0 -1
  1618. package/dist/tui-v2/components/transcript/use-transcript-selection.js +0 -14
  1619. package/dist/tui-v2/components/transcript/use-transcript-selection.js.map +1 -1
  1620. package/dist/tui-v2/components/transcript/user-message.d.ts +0 -2
  1621. package/dist/tui-v2/components/transcript/user-message.js +2 -7
  1622. package/dist/tui-v2/components/transcript/user-message.js.map +1 -1
  1623. package/dist/tui-v2/composer/composer-editor.d.ts +0 -20
  1624. package/dist/tui-v2/composer/composer-editor.js +0 -61
  1625. package/dist/tui-v2/composer/composer-editor.js.map +1 -1
  1626. package/dist/tui-v2/composer/composer-wheel.d.ts +0 -17
  1627. package/dist/tui-v2/composer/composer-wheel.js +0 -17
  1628. package/dist/tui-v2/composer/composer-wheel.js.map +1 -1
  1629. package/dist/tui-v2/composer/disable-native-textarea-scroll.d.ts +0 -12
  1630. package/dist/tui-v2/composer/disable-native-textarea-scroll.js +0 -13
  1631. package/dist/tui-v2/composer/disable-native-textarea-scroll.js.map +1 -1
  1632. package/dist/tui-v2/composer/textarea-keybindings.d.ts +0 -19
  1633. package/dist/tui-v2/composer/textarea-keybindings.js +0 -34
  1634. package/dist/tui-v2/composer/textarea-keybindings.js.map +1 -1
  1635. package/dist/tui-v2/composer/use-draft-actions.d.ts +0 -10
  1636. package/dist/tui-v2/composer/use-draft-actions.js +0 -5
  1637. package/dist/tui-v2/composer/use-draft-actions.js.map +1 -1
  1638. package/dist/tui-v2/hooks/terminal-dimensions.d.ts +6 -0
  1639. package/dist/tui-v2/hooks/terminal-dimensions.js +14 -0
  1640. package/dist/tui-v2/hooks/terminal-dimensions.js.map +1 -0
  1641. package/dist/tui-v2/input/chord-from-opentui-key.d.ts +0 -17
  1642. package/dist/tui-v2/input/chord-from-opentui-key.js +0 -17
  1643. package/dist/tui-v2/input/chord-from-opentui-key.js.map +1 -1
  1644. package/dist/tui-v2/rendering/ansi-to-styled.d.ts +0 -12
  1645. package/dist/tui-v2/rendering/ansi-to-styled.js +0 -10
  1646. package/dist/tui-v2/rendering/ansi-to-styled.js.map +1 -1
  1647. package/dist/tui-v2/rendering/pager-markdown.d.ts +0 -18
  1648. package/dist/tui-v2/rendering/pager-markdown.js +0 -14
  1649. package/dist/tui-v2/rendering/pager-markdown.js.map +1 -1
  1650. package/dist/types.d.ts +2 -135
  1651. package/dist/types.js +0 -3
  1652. package/dist/types.js.map +1 -1
  1653. package/dist/ui/mentions/expand.d.ts +26 -0
  1654. package/dist/ui/mentions/expand.js +308 -0
  1655. package/dist/ui/mentions/expand.js.map +1 -0
  1656. package/dist/ui/mentions/file-suggestions.d.ts +7 -0
  1657. package/dist/ui/mentions/file-suggestions.js +106 -0
  1658. package/dist/ui/mentions/file-suggestions.js.map +1 -0
  1659. package/dist/ui/mentions.d.ts +6 -70
  1660. package/dist/ui/mentions.js +8 -482
  1661. package/dist/ui/mentions.js.map +1 -1
  1662. package/dist/ui/plan-pane.d.ts +0 -15
  1663. package/dist/ui/plan-pane.js +1 -16
  1664. package/dist/ui/plan-pane.js.map +1 -1
  1665. package/dist/ui/thinking.d.ts +0 -8
  1666. package/dist/ui/thinking.js +0 -13
  1667. package/dist/ui/thinking.js.map +1 -1
  1668. package/dist/ui-core/actions/action-id.d.ts +0 -8
  1669. package/dist/ui-core/actions/action-id.js +0 -25
  1670. package/dist/ui-core/actions/action-id.js.map +1 -1
  1671. package/dist/ui-core/actions/action-router.d.ts +0 -10
  1672. package/dist/ui-core/actions/action-router.js +0 -16
  1673. package/dist/ui-core/actions/action-router.js.map +1 -1
  1674. package/dist/ui-core/actions/cancel-timing.d.ts +0 -3
  1675. package/dist/ui-core/actions/cancel-timing.js +0 -3
  1676. package/dist/ui-core/actions/cancel-timing.js.map +1 -1
  1677. package/dist/ui-core/actions/format-shortcuts.d.ts +0 -9
  1678. package/dist/ui-core/actions/format-shortcuts.js +0 -9
  1679. package/dist/ui-core/actions/format-shortcuts.js.map +1 -1
  1680. package/dist/ui-core/actions/keymap.d.ts +0 -9
  1681. package/dist/ui-core/actions/keymap.js +0 -39
  1682. package/dist/ui-core/actions/keymap.js.map +1 -1
  1683. package/dist/ui-core/actions/mode-cycle.d.ts +0 -2
  1684. package/dist/ui-core/actions/mode-cycle.js +0 -4
  1685. package/dist/ui-core/actions/mode-cycle.js.map +1 -1
  1686. package/dist/ui-core/bootstrap/can-use-tui.d.ts +0 -6
  1687. package/dist/ui-core/bootstrap/can-use-tui.js +0 -9
  1688. package/dist/ui-core/bootstrap/can-use-tui.js.map +1 -1
  1689. package/dist/ui-core/bootstrap/capabilities.d.ts +0 -8
  1690. package/dist/ui-core/bootstrap/capabilities.js +1 -8
  1691. package/dist/ui-core/bootstrap/capabilities.js.map +1 -1
  1692. package/dist/ui-core/bootstrap/composition-root.d.ts +0 -17
  1693. package/dist/ui-core/bootstrap/composition-root.js +30 -19
  1694. package/dist/ui-core/bootstrap/composition-root.js.map +1 -1
  1695. package/dist/ui-core/bootstrap/console-guard.d.ts +0 -15
  1696. package/dist/ui-core/bootstrap/console-guard.js +32 -0
  1697. package/dist/ui-core/bootstrap/console-guard.js.map +1 -1
  1698. package/dist/ui-core/bootstrap/console-suppress.js +2 -7
  1699. package/dist/ui-core/bootstrap/console-suppress.js.map +1 -1
  1700. package/dist/ui-core/bootstrap/exit-epilogue.d.ts +0 -6
  1701. package/dist/ui-core/bootstrap/exit-epilogue.js +0 -5
  1702. package/dist/ui-core/bootstrap/exit-epilogue.js.map +1 -1
  1703. package/dist/ui-core/bootstrap/lifecycle.d.ts +0 -42
  1704. package/dist/ui-core/bootstrap/lifecycle.js +0 -31
  1705. package/dist/ui-core/bootstrap/lifecycle.js.map +1 -1
  1706. package/dist/ui-core/bootstrap/overlay-ports.d.ts +0 -11
  1707. package/dist/ui-core/bootstrap/overlay-ports.js +0 -13
  1708. package/dist/ui-core/bootstrap/overlay-ports.js.map +1 -1
  1709. package/dist/ui-core/bootstrap/theme-mode-cache.js +0 -5
  1710. package/dist/ui-core/bootstrap/theme-mode-cache.js.map +1 -1
  1711. package/dist/ui-core/commands/command-handlers.d.ts +0 -6
  1712. package/dist/ui-core/commands/command-handlers.js +0 -6
  1713. package/dist/ui-core/commands/command-handlers.js.map +1 -1
  1714. package/dist/ui-core/commands/config-commands.d.ts +0 -3
  1715. package/dist/ui-core/commands/config-commands.js +0 -7
  1716. package/dist/ui-core/commands/config-commands.js.map +1 -1
  1717. package/dist/ui-core/commands/key-commands.d.ts +2 -0
  1718. package/dist/ui-core/commands/key-commands.js +79 -213
  1719. package/dist/ui-core/commands/key-commands.js.map +1 -1
  1720. package/dist/ui-core/commands/keys/editors.d.ts +15 -0
  1721. package/dist/ui-core/commands/keys/editors.js +127 -0
  1722. package/dist/ui-core/commands/keys/editors.js.map +1 -0
  1723. package/dist/ui-core/commands/mcp-commands.js +0 -6
  1724. package/dist/ui-core/commands/mcp-commands.js.map +1 -1
  1725. package/dist/ui-core/commands/picker-commands.d.ts +3 -14
  1726. package/dist/ui-core/commands/picker-commands.js +6 -694
  1727. package/dist/ui-core/commands/picker-commands.js.map +1 -1
  1728. package/dist/ui-core/commands/pickers/custom-provider.d.ts +3 -0
  1729. package/dist/ui-core/commands/pickers/custom-provider.js +170 -0
  1730. package/dist/ui-core/commands/pickers/custom-provider.js.map +1 -0
  1731. package/dist/ui-core/commands/pickers/history.d.ts +3 -0
  1732. package/dist/ui-core/commands/pickers/history.js +185 -0
  1733. package/dist/ui-core/commands/pickers/history.js.map +1 -0
  1734. package/dist/ui-core/commands/pickers/output-pager.d.ts +5 -0
  1735. package/dist/ui-core/commands/pickers/output-pager.js +90 -0
  1736. package/dist/ui-core/commands/pickers/output-pager.js.map +1 -0
  1737. package/dist/ui-core/commands/pickers/search-reasoning.d.ts +4 -0
  1738. package/dist/ui-core/commands/pickers/search-reasoning.js +184 -0
  1739. package/dist/ui-core/commands/pickers/search-reasoning.js.map +1 -0
  1740. package/dist/ui-core/commands/session-commands.d.ts +0 -4
  1741. package/dist/ui-core/commands/session-commands.js +23 -17
  1742. package/dist/ui-core/commands/session-commands.js.map +1 -1
  1743. package/dist/ui-core/commands/startup-update.d.ts +0 -6
  1744. package/dist/ui-core/commands/startup-update.js +0 -6
  1745. package/dist/ui-core/commands/startup-update.js.map +1 -1
  1746. package/dist/ui-core/composer/arrow-intent.d.ts +0 -10
  1747. package/dist/ui-core/composer/arrow-intent.js +0 -14
  1748. package/dist/ui-core/composer/arrow-intent.js.map +1 -1
  1749. package/dist/ui-core/composer/completion.d.ts +0 -9
  1750. package/dist/ui-core/composer/completion.js +1 -13
  1751. package/dist/ui-core/composer/completion.js.map +1 -1
  1752. package/dist/ui-core/composer/composer-action-port.d.ts +0 -10
  1753. package/dist/ui-core/composer/composer-action-port.js +0 -10
  1754. package/dist/ui-core/composer/composer-action-port.js.map +1 -1
  1755. package/dist/ui-core/composer/composer-height.d.ts +0 -12
  1756. package/dist/ui-core/composer/composer-height.js +0 -12
  1757. package/dist/ui-core/composer/composer-height.js.map +1 -1
  1758. package/dist/ui-core/composer/composer-wheel.d.ts +0 -17
  1759. package/dist/ui-core/composer/composer-wheel.js +0 -17
  1760. package/dist/ui-core/composer/composer-wheel.js.map +1 -1
  1761. package/dist/ui-core/composer/draft-actions.d.ts +0 -14
  1762. package/dist/ui-core/composer/draft-actions.js +0 -13
  1763. package/dist/ui-core/composer/draft-actions.js.map +1 -1
  1764. package/dist/ui-core/composer/history-nav.d.ts +0 -9
  1765. package/dist/ui-core/composer/history-nav.js +0 -9
  1766. package/dist/ui-core/composer/history-nav.js.map +1 -1
  1767. package/dist/ui-core/composer/input-history.d.ts +0 -1
  1768. package/dist/ui-core/composer/input-history.js +0 -1
  1769. package/dist/ui-core/composer/input-history.js.map +1 -1
  1770. package/dist/ui-core/composer/newline-hint.d.ts +0 -7
  1771. package/dist/ui-core/composer/newline-hint.js +0 -9
  1772. package/dist/ui-core/composer/newline-hint.js.map +1 -1
  1773. package/dist/ui-core/composer/paste-placeholder.d.ts +0 -23
  1774. package/dist/ui-core/composer/paste-placeholder.js +0 -21
  1775. package/dist/ui-core/composer/paste-placeholder.js.map +1 -1
  1776. package/dist/ui-core/composer/prompt-history.d.ts +0 -11
  1777. package/dist/ui-core/composer/prompt-history.js +0 -11
  1778. package/dist/ui-core/composer/prompt-history.js.map +1 -1
  1779. package/dist/ui-core/composer/secret-buffer.d.ts +0 -8
  1780. package/dist/ui-core/composer/secret-buffer.js +0 -8
  1781. package/dist/ui-core/composer/secret-buffer.js.map +1 -1
  1782. package/dist/ui-core/composer/textarea-keybindings.d.ts +0 -15
  1783. package/dist/ui-core/composer/textarea-keybindings.js +0 -30
  1784. package/dist/ui-core/composer/textarea-keybindings.js.map +1 -1
  1785. package/dist/ui-core/controllers/focus-controller.d.ts +0 -11
  1786. package/dist/ui-core/controllers/focus-controller.js +0 -11
  1787. package/dist/ui-core/controllers/focus-controller.js.map +1 -1
  1788. package/dist/ui-core/controllers/interruptible-controller.d.ts +0 -6
  1789. package/dist/ui-core/controllers/interruptible-controller.js +0 -6
  1790. package/dist/ui-core/controllers/interruptible-controller.js.map +1 -1
  1791. package/dist/ui-core/controllers/overlay-controller.d.ts +1 -81
  1792. package/dist/ui-core/controllers/overlay-controller.js +1 -48
  1793. package/dist/ui-core/controllers/overlay-controller.js.map +1 -1
  1794. package/dist/ui-core/controllers/selection-controller.d.ts +0 -9
  1795. package/dist/ui-core/controllers/selection-controller.js +0 -7
  1796. package/dist/ui-core/controllers/selection-controller.js.map +1 -1
  1797. package/dist/ui-core/controllers/toast-controller.d.ts +0 -24
  1798. package/dist/ui-core/controllers/toast-controller.js +0 -15
  1799. package/dist/ui-core/controllers/toast-controller.js.map +1 -1
  1800. package/dist/ui-core/layout/compute-layout.d.ts +0 -19
  1801. package/dist/ui-core/layout/compute-layout.js +0 -32
  1802. package/dist/ui-core/layout/compute-layout.js.map +1 -1
  1803. package/dist/ui-core/motion/ease.d.ts +0 -6
  1804. package/dist/ui-core/motion/ease.js +0 -6
  1805. package/dist/ui-core/motion/ease.js.map +1 -1
  1806. package/dist/ui-core/notify.d.ts +0 -8
  1807. package/dist/ui-core/notify.js +0 -8
  1808. package/dist/ui-core/notify.js.map +1 -1
  1809. package/dist/ui-core/plan/plan-lifecycle.d.ts +0 -27
  1810. package/dist/ui-core/plan/plan-lifecycle.js +0 -45
  1811. package/dist/ui-core/plan/plan-lifecycle.js.map +1 -1
  1812. package/dist/ui-core/ports/clipboard-osc52.d.ts +0 -8
  1813. package/dist/ui-core/ports/clipboard-osc52.js +0 -7
  1814. package/dist/ui-core/ports/clipboard-osc52.js.map +1 -1
  1815. package/dist/ui-core/ports/pager-export-port.js +0 -2
  1816. package/dist/ui-core/ports/pager-export-port.js.map +1 -1
  1817. package/dist/ui-core/ports/renderer-port.d.ts +0 -6
  1818. package/dist/ui-core/react/providers.d.ts +0 -7
  1819. package/dist/ui-core/react/providers.js +0 -7
  1820. package/dist/ui-core/react/providers.js.map +1 -1
  1821. package/dist/ui-core/react/use-has-draft.d.ts +0 -5
  1822. package/dist/ui-core/react/use-has-draft.js +0 -5
  1823. package/dist/ui-core/react/use-has-draft.js.map +1 -1
  1824. package/dist/ui-core/react/use-overlay.d.ts +0 -1
  1825. package/dist/ui-core/react/use-overlay.js +0 -1
  1826. package/dist/ui-core/react/use-overlay.js.map +1 -1
  1827. package/dist/ui-core/react/use-plan.d.ts +0 -1
  1828. package/dist/ui-core/react/use-plan.js +0 -1
  1829. package/dist/ui-core/react/use-plan.js.map +1 -1
  1830. package/dist/ui-core/react/use-toast.d.ts +0 -1
  1831. package/dist/ui-core/react/use-toast.js +0 -3
  1832. package/dist/ui-core/react/use-toast.js.map +1 -1
  1833. package/dist/ui-core/react/use-transcript-store.d.ts +0 -7
  1834. package/dist/ui-core/react/use-transcript-store.js +0 -7
  1835. package/dist/ui-core/react/use-transcript-store.js.map +1 -1
  1836. package/dist/ui-core/rendering/artifact-pager-source.d.ts +0 -7
  1837. package/dist/ui-core/rendering/artifact-pager-source.js +0 -3
  1838. package/dist/ui-core/rendering/artifact-pager-source.js.map +1 -1
  1839. package/dist/ui-core/rendering/batch-sections.d.ts +0 -38
  1840. package/dist/ui-core/rendering/batch-sections.js +1 -47
  1841. package/dist/ui-core/rendering/batch-sections.js.map +1 -1
  1842. package/dist/ui-core/rendering/code-block.d.ts +0 -25
  1843. package/dist/ui-core/rendering/code-block.js +0 -47
  1844. package/dist/ui-core/rendering/code-block.js.map +1 -1
  1845. package/dist/ui-core/rendering/context-limit.js +0 -2
  1846. package/dist/ui-core/rendering/context-limit.js.map +1 -1
  1847. package/dist/ui-core/rendering/duration.js +0 -3
  1848. package/dist/ui-core/rendering/duration.js.map +1 -1
  1849. package/dist/ui-core/rendering/exit-summary/table.d.ts +23 -0
  1850. package/dist/ui-core/rendering/exit-summary/table.js +194 -0
  1851. package/dist/ui-core/rendering/exit-summary/table.js.map +1 -0
  1852. package/dist/ui-core/rendering/exit-summary.js +1 -210
  1853. package/dist/ui-core/rendering/exit-summary.js.map +1 -1
  1854. package/dist/ui-core/rendering/file-diff-view.d.ts +0 -27
  1855. package/dist/ui-core/rendering/file-diff-view.js +0 -29
  1856. package/dist/ui-core/rendering/file-diff-view.js.map +1 -1
  1857. package/dist/ui-core/rendering/format-help.d.ts +0 -13
  1858. package/dist/ui-core/rendering/format-help.js +0 -18
  1859. package/dist/ui-core/rendering/format-help.js.map +1 -1
  1860. package/dist/ui-core/rendering/format-keys.js +0 -2
  1861. package/dist/ui-core/rendering/format-keys.js.map +1 -1
  1862. package/dist/ui-core/rendering/format-usage.js +18 -5
  1863. package/dist/ui-core/rendering/format-usage.js.map +1 -1
  1864. package/dist/ui-core/rendering/incremental-strip.js +0 -13
  1865. package/dist/ui-core/rendering/incremental-strip.js.map +1 -1
  1866. package/dist/ui-core/rendering/intro-header.js +0 -1
  1867. package/dist/ui-core/rendering/intro-header.js.map +1 -1
  1868. package/dist/ui-core/rendering/job-tail-source.d.ts +0 -9
  1869. package/dist/ui-core/rendering/job-tail-source.js +0 -9
  1870. package/dist/ui-core/rendering/job-tail-source.js.map +1 -1
  1871. package/dist/ui-core/rendering/link-detector.d.ts +0 -8
  1872. package/dist/ui-core/rendering/link-detector.js +0 -10
  1873. package/dist/ui-core/rendering/link-detector.js.map +1 -1
  1874. package/dist/ui-core/rendering/markdown/tables.d.ts +8 -0
  1875. package/dist/ui-core/rendering/markdown/tables.js +276 -0
  1876. package/dist/ui-core/rendering/markdown/tables.js.map +1 -0
  1877. package/dist/ui-core/rendering/markdown.d.ts +4 -9
  1878. package/dist/ui-core/rendering/markdown.js +224 -593
  1879. package/dist/ui-core/rendering/markdown.js.map +1 -1
  1880. package/dist/ui-core/rendering/open-tool-output.d.ts +0 -30
  1881. package/dist/ui-core/rendering/open-tool-output.js +0 -39
  1882. package/dist/ui-core/rendering/open-tool-output.js.map +1 -1
  1883. package/dist/ui-core/rendering/pager-chrome.d.ts +0 -20
  1884. package/dist/ui-core/rendering/pager-chrome.js +0 -24
  1885. package/dist/ui-core/rendering/pager-chrome.js.map +1 -1
  1886. package/dist/ui-core/rendering/pager-source.d.ts +0 -17
  1887. package/dist/ui-core/rendering/pager-source.js +0 -27
  1888. package/dist/ui-core/rendering/pager-source.js.map +1 -1
  1889. package/dist/ui-core/rendering/pager-text.d.ts +0 -21
  1890. package/dist/ui-core/rendering/pager-text.js +0 -31
  1891. package/dist/ui-core/rendering/pager-text.js.map +1 -1
  1892. package/dist/ui-core/rendering/pager-view-policy.d.ts +0 -24
  1893. package/dist/ui-core/rendering/pager-view-policy.js +0 -31
  1894. package/dist/ui-core/rendering/pager-view-policy.js.map +1 -1
  1895. package/dist/ui-core/rendering/picker-filter.d.ts +0 -11
  1896. package/dist/ui-core/rendering/picker-filter.js +0 -11
  1897. package/dist/ui-core/rendering/picker-filter.js.map +1 -1
  1898. package/dist/ui-core/rendering/plan-view.d.ts +0 -39
  1899. package/dist/ui-core/rendering/plan-view.js +0 -37
  1900. package/dist/ui-core/rendering/plan-view.js.map +1 -1
  1901. package/dist/ui-core/rendering/prompt-preview.d.ts +0 -5
  1902. package/dist/ui-core/rendering/prompt-preview.js +0 -5
  1903. package/dist/ui-core/rendering/prompt-preview.js.map +1 -1
  1904. package/dist/ui-core/rendering/sanitize-display.d.ts +0 -10
  1905. package/dist/ui-core/rendering/sanitize-display.js +0 -14
  1906. package/dist/ui-core/rendering/sanitize-display.js.map +1 -1
  1907. package/dist/ui-core/rendering/status-segments.js +3 -3
  1908. package/dist/ui-core/rendering/status-segments.js.map +1 -1
  1909. package/dist/ui-core/rendering/streaming-markdown.js +0 -11
  1910. package/dist/ui-core/rendering/streaming-markdown.js.map +1 -1
  1911. package/dist/ui-core/rendering/syntax/clike.d.ts +22 -0
  1912. package/dist/ui-core/rendering/syntax/clike.js +168 -0
  1913. package/dist/ui-core/rendering/syntax/clike.js.map +1 -0
  1914. package/dist/ui-core/rendering/syntax/keywords.d.ts +24 -0
  1915. package/dist/ui-core/rendering/syntax/keywords.js +169 -0
  1916. package/dist/ui-core/rendering/syntax/keywords.js.map +1 -0
  1917. package/dist/ui-core/rendering/syntax/language-highlighters.d.ts +18 -0
  1918. package/dist/ui-core/rendering/syntax/language-highlighters.js +538 -0
  1919. package/dist/ui-core/rendering/syntax/language-highlighters.js.map +1 -0
  1920. package/dist/ui-core/rendering/syntax/language-table.d.ts +3 -0
  1921. package/dist/ui-core/rendering/syntax/language-table.js +244 -0
  1922. package/dist/ui-core/rendering/syntax/language-table.js.map +1 -0
  1923. package/dist/ui-core/rendering/syntax-highlight.d.ts +6 -28
  1924. package/dist/ui-core/rendering/syntax-highlight.js +5 -1177
  1925. package/dist/ui-core/rendering/syntax-highlight.js.map +1 -1
  1926. package/dist/ui-core/rendering/text-format.d.ts +0 -3
  1927. package/dist/ui-core/rendering/text-format.js +0 -3
  1928. package/dist/ui-core/rendering/text-format.js.map +1 -1
  1929. package/dist/ui-core/rendering/text-width.d.ts +0 -26
  1930. package/dist/ui-core/rendering/text-width.js +0 -26
  1931. package/dist/ui-core/rendering/text-width.js.map +1 -1
  1932. package/dist/ui-core/rendering/theme.d.ts +0 -65
  1933. package/dist/ui-core/rendering/theme.js +0 -24
  1934. package/dist/ui-core/rendering/theme.js.map +1 -1
  1935. package/dist/ui-core/rendering/thinking-tail.js +0 -3
  1936. package/dist/ui-core/rendering/thinking-tail.js.map +1 -1
  1937. package/dist/ui-core/rendering/tool-presenter.d.ts +0 -41
  1938. package/dist/ui-core/rendering/tool-presenter.js +1 -67
  1939. package/dist/ui-core/rendering/tool-presenter.js.map +1 -1
  1940. package/dist/ui-core/rendering/transcript-semantic.d.ts +0 -8
  1941. package/dist/ui-core/rendering/transcript-semantic.js +0 -13
  1942. package/dist/ui-core/rendering/transcript-semantic.js.map +1 -1
  1943. package/dist/ui-core/rendering/user-message-wrap.d.ts +0 -16
  1944. package/dist/ui-core/rendering/user-message-wrap.js +0 -16
  1945. package/dist/ui-core/rendering/user-message-wrap.js.map +1 -1
  1946. package/dist/ui-core/rendering/wordmark.d.ts +0 -8
  1947. package/dist/ui-core/rendering/wordmark.js +0 -21
  1948. package/dist/ui-core/rendering/wordmark.js.map +1 -1
  1949. package/dist/ui-core/state/hydrate/classic-transcript.d.ts +8 -0
  1950. package/dist/ui-core/state/hydrate/classic-transcript.js +168 -0
  1951. package/dist/ui-core/state/hydrate/classic-transcript.js.map +1 -0
  1952. package/dist/ui-core/state/hydrate/from-messages.d.ts +6 -0
  1953. package/dist/ui-core/state/hydrate/from-messages.js +237 -0
  1954. package/dist/ui-core/state/hydrate/from-messages.js.map +1 -0
  1955. package/dist/ui-core/state/pager-search.d.ts +0 -9
  1956. package/dist/ui-core/state/pager-search.js +1 -8
  1957. package/dist/ui-core/state/pager-search.js.map +1 -1
  1958. package/dist/ui-core/state/semantic-document.d.ts +0 -8
  1959. package/dist/ui-core/state/semantic-document.js +0 -8
  1960. package/dist/ui-core/state/semantic-document.js.map +1 -1
  1961. package/dist/ui-core/state/thinking-copy.d.ts +0 -8
  1962. package/dist/ui-core/state/thinking-copy.js +0 -8
  1963. package/dist/ui-core/state/thinking-copy.js.map +1 -1
  1964. package/dist/ui-core/state/transcript/apply-app-event.d.ts +8 -0
  1965. package/dist/ui-core/state/transcript/apply-app-event.js +406 -0
  1966. package/dist/ui-core/state/transcript/apply-app-event.js.map +1 -0
  1967. package/dist/ui-core/state/transcript/message-lifecycle.d.ts +7 -0
  1968. package/dist/ui-core/state/transcript/message-lifecycle.js +285 -0
  1969. package/dist/ui-core/state/transcript/message-lifecycle.js.map +1 -0
  1970. package/dist/ui-core/state/transcript-compaction.d.ts +0 -19
  1971. package/dist/ui-core/state/transcript-compaction.js +0 -21
  1972. package/dist/ui-core/state/transcript-compaction.js.map +1 -1
  1973. package/dist/ui-core/state/transcript-hydrate.d.ts +6 -52
  1974. package/dist/ui-core/state/transcript-hydrate.js +5 -470
  1975. package/dist/ui-core/state/transcript-hydrate.js.map +1 -1
  1976. package/dist/ui-core/state/transcript-reducer.d.ts +1 -15
  1977. package/dist/ui-core/state/transcript-reducer.js +1 -708
  1978. package/dist/ui-core/state/transcript-reducer.js.map +1 -1
  1979. package/dist/ui-core/state/transcript-search.d.ts +0 -8
  1980. package/dist/ui-core/state/transcript-search.js +0 -8
  1981. package/dist/ui-core/state/transcript-search.js.map +1 -1
  1982. package/dist/ui-core/state/transcript-store.d.ts +0 -26
  1983. package/dist/ui-core/state/transcript-store.js +0 -28
  1984. package/dist/ui-core/state/transcript-store.js.map +1 -1
  1985. package/dist/ui-core/state/transcript-types.d.ts +0 -33
  1986. package/dist/ui-core/state/transcript-types.js +0 -17
  1987. package/dist/ui-core/state/transcript-types.js.map +1 -1
  1988. package/dist/ui-core/state/transcript-window.d.ts +0 -8
  1989. package/dist/ui-core/state/transcript-window.js +0 -8
  1990. package/dist/ui-core/state/transcript-window.js.map +1 -1
  1991. package/dist/version.generated.d.ts +2 -2
  1992. package/dist/version.generated.js +2 -2
  1993. package/package.json +19 -2
  1994. package/dist/agent/finalize-gate.d.ts +0 -54
  1995. package/dist/agent/finalize-gate.js +0 -97
  1996. package/dist/agent/finalize-gate.js.map +0 -1
  1997. package/dist/agent/must-continue.d.ts +0 -36
  1998. package/dist/agent/must-continue.js +0 -172
  1999. package/dist/agent/must-continue.js.map +0 -1
@@ -1,1147 +1,26 @@
1
- import { getActiveProviderEndpoint, getCustomProviders, getProviderEndpoints, getConfig, providerUsesEndpoints, resolveProviderCategory, setActiveProviderEndpoint, setDefaultProvider, setProviderModel, } from "../store/config.js";
2
- import { getProviderKeys, getProviderSecret, markProviderKeySuccess, } from "../store/keys.js";
3
- import { anthropicProvider } from "./anthropic.js";
4
- import { geminiProvider } from "./gemini.js";
5
- import { ProviderError, bodyAddsInformation, buildReasoningPayload, collapseWhitespace, isImageInputUnsupportedError, isReasoningUnsupportedError, reasoningRejectionAdvice, stripImagesFromMessages, MAX_ERROR_BODY_IN_MESSAGE_CHARS, STREAM_STALL_MARKER, } from "./http.js";
6
- import { isReasoningUnsupported, learnModelVisionCapability, markModelUnavailable, learnedRouteEfforts, markReasoningMandatory, markReasoningUnsupported, registerWireRejectionEfforts, modelAcceptsImages, modelSupportsVision, visionSubstitutionOrigin, } from "./capabilities.js";
7
- import { applyImageViewAvailability } from "../prompts/index.js";
8
- import { fallbackEffortsFor } from "./effort-fallback.js";
9
- import { isMissingReasoningContentError, isUnattributableRequestBodyError, mentionsReasoning, } from "./reasoning-errors.js";
10
- import { EFFORT_SCALE, nearestAcceptedEffort } from "./reasoning-controls.js";
11
- import { resolveBuiltInProfile } from "./provider-profiles.js";
12
- import { markStreamEmittedBytes, streamAlreadyEmitted, streamEmittedBytes, } from "./stream-progress.js";
13
- import { createStreamEventGuard, isSemanticStreamOutputEvent, } from "./stream-events.js";
14
- import { attemptsPerKey, buildKeyAttemptPlan, formatKeyEventStatus, isImmediateKeySwitchError, isKeyCircleStopError, isKeyRotatableError, isQuotaKeyError, } from "./key-rotation.js";
15
- import { freeProvider } from "./free.js";
16
- import { nvidiaProvider } from "./nvidia.js";
17
- import { agentrouterProvider } from "./agentrouter.js";
18
- import { bynaraProvider } from "./bynara.js";
19
- import { mantleProvider } from "./aws-mantle.js";
20
- import { ollamaProvider } from "./ollama.js";
21
- import { openaiProvider } from "./openai.js";
22
- import { openrouterProvider } from "./openrouter.js";
23
- import { qwenCloudProvider } from "./qwen-cloud.js";
24
- import { modalProvider } from "./modal.js";
25
- import { lightningProvider } from "./lightning.js";
26
- import { tokenrouterProvider } from "./tokenrouter.js";
27
- import { metaProvider } from "./meta.js";
28
- import { fireworksProvider } from "./fireworks.js";
29
- import { hetznerProvider } from "./hetzner.js";
30
- import { orcarouterProvider } from "./orcarouter.js";
31
- import { mergeGatewayProvider } from "./merge-gateway.js";
32
- import { OperationUsageRecorder, runGenerationAttempt, } from "./operation-usage.js";
1
+ import { getConfig, providerUsesEndpoints, setDefaultProvider, setProviderModel, } from "../store/config.js";
2
+ import { getProviderKeys } from "../store/keys.js";
3
+ import { streamAlreadyEmitted, streamEmittedBytes } from "./stream-progress.js";
4
+ import { isSemanticStreamOutputEvent, } from "./stream-events.js";
5
+ import { isKeyCircleStopError } from "./key-rotation.js";
6
+ import { OperationUsageRecorder, } from "./operation-usage.js";
33
7
  import { isOperationPolicyError, OperationLedger, operationTerminalOutcome, turnOperationPolicy, } from "./operation-ledger.js";
34
- import { maskSecretTail } from "./provider.js";
35
- import { getCustomProviderSync } from "./custom-providers.js";
36
- import { isToolsUnsupportedError, markTextOnlyModel, } from "./tool-protocol.js";
37
- const MAX_RETRIES = 6;
38
- // Wait at most this long overall per attempt (up to 2 minutes total wait budget).
39
- const MAX_RETRY_WAIT_MS = 120_000;
40
- /** Toast replace-key so key rotation never stacks notifications. */
8
+ import { effortCandidatesFor } from "./routing/error-classification.js";
9
+ import { aggregateProviderError, failureMessageFor, formatFailures, shouldStopProviderFallback, } from "./routing/failure-report.js";
10
+ import { buildFallbackChain, getProvider, providerAuth, requestedRealKeyCount, } from "./routing/provider-selection.js";
11
+ import { requestForRoute } from "./routing/attempt-request.js";
12
+ import { makeKeyEmitter, runWithKeyRotation } from "./routing/key-rotation.js";
13
+ export { providers } from "./routing/provider-selection.js";
14
+ export { buildFallbackChain, getProvider, providerAuth };
15
+ export { AggregateProviderError, formatProviderFailureForUser, } from "./routing/failure-report.js";
16
+ export { isEmptyCompletionError } from "./routing/error-classification.js";
17
+ export { effortCandidatesFor };
41
18
  export const API_KEY_TOAST_KEY = "api-key-rotation";
42
- /**
43
- * A budget/policy error raised while recovering from a real failure describes
44
- * the guard, not the cause. Surface the failure the caller actually needs.
45
- */
46
- function successfulRequestSnapshot(provider, model, request) {
47
- return structuredClone({
48
- provider,
49
- model,
50
- messages: request.messages,
51
- ...(request.temperature !== undefined
52
- ? { temperature: request.temperature }
53
- : {}),
54
- ...(request.thinking ? { thinking: request.thinking } : {}),
55
- ...(request.tools ? { tools: request.tools } : {}),
56
- ...(request.toolChoice !== undefined
57
- ? { toolChoice: request.toolChoice }
58
- : {}),
59
- ...(request.parallelToolCalls !== undefined
60
- ? { parallelToolCalls: request.parallelToolCalls }
61
- : {}),
62
- });
63
- }
64
- function preservedFailure(recoveryError, originalError) {
65
- return isOperationPolicyError(recoveryError) ? originalError : recoveryError;
66
- }
67
19
  function resolveOperationLedger(options) {
68
20
  if (options.operation)
69
21
  return options.operation;
70
22
  return new OperationLedger(turnOperationPolicy(), options.attemptUsage ?? new OperationUsageRecorder());
71
23
  }
72
- async function sleep(ms, signal) {
73
- if (signal?.aborted)
74
- throw signal.reason ?? new Error("Aborted");
75
- return new Promise((resolve, reject) => {
76
- let timer;
77
- let cleanup = () => { };
78
- const abort = () => {
79
- clearTimeout(timer);
80
- cleanup();
81
- reject(signal?.reason ?? new Error("Aborted"));
82
- };
83
- cleanup = () => {
84
- signal?.removeEventListener("abort", abort);
85
- };
86
- timer = setTimeout(() => {
87
- cleanup();
88
- resolve();
89
- }, ms);
90
- signal?.addEventListener("abort", abort, { once: true });
91
- });
92
- }
93
- function isRateLimited(error) {
94
- return error instanceof ProviderError && error.status === 429;
95
- }
96
- function isServerUnavailable(error) {
97
- if (!(error instanceof ProviderError))
98
- return false;
99
- const status = error.status ?? 0;
100
- return status === 502 || status === 503 || status === 504;
101
- }
102
- function isServerError(error) {
103
- if (!(error instanceof ProviderError))
104
- return false;
105
- const status = error.status ?? 0;
106
- return status >= 500 && status <= 504;
107
- }
108
- function isReasoningRelatedServerError(error) {
109
- if (!isServerError(error))
110
- return false;
111
- return mentionsReasoning(error);
112
- }
113
- function shouldContinueEffortLadder(error) {
114
- return isReasoningUnsupportedError(error) || isReasoningRelatedServerError(error);
115
- }
116
- export function effortCandidatesFor(providerId, model, requested) {
117
- const learned = learnedRouteEfforts(providerId, model);
118
- if (learned?.length) {
119
- const usable = learned.filter((effort) => effort !== requested && effort !== "none");
120
- const corrected = nearestAcceptedEffort(requested, usable);
121
- const scaledLearned = EFFORT_SCALE.find((effort) => effort === corrected);
122
- return scaledLearned ? [scaledLearned] : [];
123
- }
124
- const declared = resolveBuiltInProfile({ provider: providerId, model }).reasoning
125
- .acceptedEfforts;
126
- if (declared.length === 0)
127
- return fallbackEffortsFor(requested);
128
- const nearest = nearestAcceptedEffort(requested, declared);
129
- if (nearest === undefined || nearest === requested)
130
- return [];
131
- const scaled = EFFORT_SCALE.find((effort) => effort === nearest);
132
- return scaled ? [scaled] : [];
133
- }
134
- function shouldEnterEffortLadder(error, thinking, providerId, model, singleDispatch) {
135
- if (isReasoningUnsupportedError(error))
136
- return true;
137
- if (singleDispatch)
138
- return false;
139
- if (!thinking?.enabled)
140
- return false;
141
- if (isReasoningUnsupported(providerId, model))
142
- return false;
143
- return isReasoningRelatedServerError(error);
144
- }
145
- function isCacheOnlyColdError(error) {
146
- const message = error instanceof Error ? error.message : String(error);
147
- const body = error instanceof ProviderError ? (error.body ?? "") : "";
148
- return /cache_only_cold|cache-only admission/i.test(`${message} ${body}`);
149
- }
150
- function isTransientNetworkError(error) {
151
- const message = error instanceof Error ? error.message : String(error);
152
- const msg = message.toLowerCase();
153
- return (msg.includes("socket connection was closed unexpectedly") ||
154
- msg.includes("econnreset") ||
155
- msg.includes("etimedout") ||
156
- msg.includes("econnrefused") ||
157
- msg.includes("enotfound") ||
158
- msg.includes("fetch failed") ||
159
- msg.includes("network error") ||
160
- msg.includes("timeout") ||
161
- msg.includes("unexpected end of file") ||
162
- msg.includes("premature close"));
163
- }
164
- function isRetriableError(error) {
165
- if (streamAlreadyEmitted(error))
166
- return false;
167
- const message = error instanceof Error ? error.message : String(error);
168
- if (new RegExp(STREAM_STALL_MARKER, "i").test(message)) {
169
- if (/for \d+s after it had already started/i.test(message))
170
- return false;
171
- }
172
- if (/stream stalled|request timed out before any response|stream transport timeout/i.test(message)) {
173
- return true;
174
- }
175
- if (isRateLimited(error))
176
- return true;
177
- if (error instanceof ProviderError) {
178
- const status = error.status ?? 0;
179
- if (status >= 500 && status <= 504) {
180
- return true;
181
- }
182
- }
183
- return isTransientNetworkError(error);
184
- }
185
- function retryWaitMs(error, attempt) {
186
- if (error instanceof ProviderError && error.retryAfterSeconds !== undefined) {
187
- return Math.ceil(error.retryAfterSeconds * 1000);
188
- }
189
- // Exponential backoff: 2s, 6s, 18s, 54s, etc.
190
- return Math.pow(3, attempt) * 2_000;
191
- }
192
- function networkRetryWaitMs(attempt) {
193
- return Math.pow(2, attempt) * 1_000;
194
- }
195
- function failureReason(error) {
196
- if (isRateLimited(error))
197
- return "rate limited";
198
- if (isQuotaKeyError(error)) {
199
- const status = error instanceof ProviderError && error.status ? ` (${error.status})` : "";
200
- return `insufficient credits${status}`;
201
- }
202
- if (error instanceof ProviderError && error.status) {
203
- if (error.status === 401 || error.status === 403) {
204
- return `auth failed (${error.status})`;
205
- }
206
- return `server error (${error.status})`;
207
- }
208
- return "connection glitch";
209
- }
210
- /**
211
- * Append the raw response body a provider returned when it is not already part
212
- * of `text`. Several paths (SSE error frames, non-OpenAI providers) keep the
213
- * body on the error without embedding it in the message, and users need the
214
- * full error received from the request to diagnose failures.
215
- */
216
- function appendFullProviderBody(text, error) {
217
- if (!(error instanceof ProviderError))
218
- return text;
219
- const body = (error.body ?? "").trim();
220
- if (!body || !bodyAddsInformation(body, text))
221
- return text;
222
- const shown = collapseWhitespace(body);
223
- const capped = shown.length > MAX_ERROR_BODY_IN_MESSAGE_CHARS
224
- ? `${shown.slice(0, MAX_ERROR_BODY_IN_MESSAGE_CHARS)}…`
225
- : shown;
226
- return `${text}\nFull response from provider: ${capped}`;
227
- }
228
- /**
229
- * User-facing classification of provider failures (auth, capacity, disconnect,
230
- * empty admission, context limit). Used by the fallback table and tests.
231
- */
232
- export function formatProviderFailureForUser(error) {
233
- if (error instanceof ProviderError) {
234
- // Keep the provider's own message in the transcript. The classification
235
- // below is useful guidance, but hiding an upstream 429/body detail makes
236
- // it needlessly hard to tell OpenAI and Gemini failures apart.
237
- const exactError = error.message.replace(/\s+/g, " ").trim();
238
- const withExactError = (guidance) => exactError ? `${guidance}\nExact provider error: ${exactError}` : guidance;
239
- const withFullBody = (text) => appendFullProviderBody(text, error);
240
- const status = error.status ?? 0;
241
- if (status === 429) {
242
- return withFullBody(withExactError("Model is rate limited (429). Try another provider/model or switch to a paid plan."));
243
- }
244
- if (status === 401 || status === 403) {
245
- return withFullBody(withExactError(`Authentication/authorization failed (${status}). Check the API key with \`clai providers\` or set the provider env var.`));
246
- }
247
- if (status === 402) {
248
- return withFullBody(withExactError("Insufficient credits / payment required (402). Try another API key for this provider, top up the account, or switch provider."));
249
- }
250
- if (status === 404) {
251
- return withFullBody(withExactError("Model or endpoint not found (404). Run `/model list` or pick another model."));
252
- }
253
- if (status === 413) {
254
- return withFullBody(withExactError("Request exceeded the provider input limit (413). Wait for auto-compact, run `/compact`, or continue with a smaller turn."));
255
- }
256
- if (status === 422) {
257
- return withFullBody(withExactError("Provider rejected the request body (422). Model name or parameters may be incompatible — try another model."));
258
- }
259
- if (status === 503 || status === 502 || status === 504) {
260
- if (isCacheOnlyColdError(error)) {
261
- return withFullBody(withExactError(`Gateway cache admission rejected (${status}; cache_only_cold): the route is cold or overloaded and retried automatically with backoff. If it persists, retry shortly or switch provider/model.`));
262
- }
263
- return withFullBody(withExactError(`Upstream provider unavailable (${status}). Retry shortly or switch provider/model; free-tier models are often capacity-constrained.`));
264
- }
265
- if (status >= 500 && status < 600) {
266
- return withFullBody(withExactError(`Upstream provider error (${status}). Retry or switch with \`/provider\` / \`/model\`.`));
267
- }
268
- }
269
- const message = (error instanceof Error ? error.message : String(error))
270
- .replace(/\s+/g, " ")
271
- .trim();
272
- const generic = (() => {
273
- if (!message) {
274
- return "Provider returned an empty failure (no tokens billed). Model may be unavailable, overloaded, or rejected before admission — try another model.";
275
- }
276
- if (/socket connection was closed|econnreset|premature close|unexpected end of file/i.test(message)) {
277
- return `${message} — connection dropped mid-request (common on free/unstable routes). Retry or switch model; long contexts increase disconnect risk.`;
278
- }
279
- if (new RegExp(STREAM_STALL_MARKER, "i").test(message)) {
280
- return `${message}`;
281
- }
282
- if (/stream stalled|request timed out before any response/i.test(message)) {
283
- return `${message} — no tokens arrived in time. Free models and large contexts fail more often; retry or use a more reliable model.`;
284
- }
285
- if (/no completion text|response was empty|empty response|returned no text/i.test(message)) {
286
- return `${message} — provider accepted the request but returned no content. Retry once; if it persists, switch model.`;
287
- }
288
- if (/fetch failed|network error|etimedout|enotfound|econnrefused/i.test(message)) {
289
- return `${message} — network/DNS failure reaching the provider. Check connectivity and provider base URL.`;
290
- }
291
- return message;
292
- })();
293
- // Statuses without a dedicated branch above (e.g. 400, or stream errors
294
- // with no HTTP status) still deserve the full response body.
295
- return appendFullProviderBody(generic, error);
296
- }
297
- function summarizeProviderError(error) {
298
- return formatProviderFailureForUser(error);
299
- }
300
- const FREE_PROVIDER_HINT = "the free tier (opencode zen / kilo gateway) is keyless and best-effort, so it is often rate limited or unavailable — set an API key for another provider (clai set <provider> <key>, then clai use <provider>) for reliable access";
301
- function failureMessageFor(providerId, error) {
302
- const base = summarizeProviderError(error);
303
- return providerId === "free" ? `${base} — ${FREE_PROVIDER_HINT}` : base;
304
- }
305
- /**
306
- * Aggregate failure that keeps the most actionable `status` /
307
- * `retryAfterSeconds` instead of forcing every consumer to regex the message
308
- * (Phase 2.2). `classifyStreamFailure` already prefers `errorStatus(error)`.
309
- */
310
- export class AggregateProviderError extends ProviderError {
311
- failures;
312
- constructor(message, failures, status, retryAfterSeconds) {
313
- super(message, status, undefined, retryAfterSeconds);
314
- this.failures = failures;
315
- this.name = "AggregateProviderError";
316
- }
317
- }
318
- /** 413 (context) > 429 (rate limit) > 5xx > any other status. */
319
- function mostActionableFailure(failures) {
320
- const candidates = failures
321
- .map((failure) => failure.error)
322
- .filter((error) => error instanceof ProviderError && typeof error.status === "number");
323
- if (candidates.length === 0)
324
- return undefined;
325
- const rank = (status) => status === 413 ? 0 : status === 429 ? 1 : status >= 500 ? 2 : 3;
326
- return candidates.reduce((best, current) => rank(current.status) < rank(best.status) ? current : best);
327
- }
328
- function aggregateProviderError(message, failures, emittedBytes = 0) {
329
- const actionable = mostActionableFailure(failures);
330
- const aggregate = new AggregateProviderError(message, failures.map(({ provider, message: text }) => ({ provider, message: text })), actionable?.status, actionable?.retryAfterSeconds);
331
- return markStreamEmittedBytes(aggregate, emittedBytes);
332
- }
333
- function escapeTableCell(value) {
334
- return value.replace(/\|/g, "\\|").replace(/\s+/g, " ").trim();
335
- }
336
- function formatFailures(failures) {
337
- if (failures.length === 0)
338
- return "";
339
- // Keep the first visible error self-contained. Some terminal renderers
340
- // truncate multiline notices, which previously left users with only
341
- // “No provider could stream the request.” and hid the useful provider body.
342
- return ` — ${failures
343
- .map((failure) => `${failure.provider}: ${escapeTableCell(failure.message)}`)
344
- .join("; ")}`;
345
- }
346
- /**
347
- * After all keys for a provider are exhausted, decide whether to try the next
348
- * *provider* in the fallback chain. Auth/rate-limit stop cross-provider when
349
- * only one key existed historically; with multi-key we already rotated keys.
350
- */
351
- function shouldStopProviderFallback(error) {
352
- if (error instanceof ProviderError) {
353
- return [401, 403, 404, 422, 429].includes(error.status ?? 0);
354
- }
355
- const message = error instanceof Error ? error.message : String(error);
356
- return /no completion text|response was empty|empty response|returned no text/i.test(message);
357
- }
358
- /**
359
- * True when a stream/complete failure was a fully empty model completion — no
360
- * visible text and no tool calls. Safe to retry with a nudge (common right
361
- * after auto-compaction when the tail ends on re-injected system context).
362
- */
363
- export function isEmptyCompletionError(error) {
364
- const message = error instanceof Error ? error.message : String(error);
365
- return /completed without a visible answer|no visible answer|returned no content|no completion text|response was empty|empty response|returned no text/i.test(message);
366
- }
367
- export const providers = {
368
- free: freeProvider,
369
- gemini: geminiProvider,
370
- openrouter: openrouterProvider,
371
- openai: openaiProvider,
372
- anthropic: anthropicProvider,
373
- nvidia: nvidiaProvider,
374
- agentrouter: agentrouterProvider,
375
- "aws-mantle": mantleProvider,
376
- ollama: ollamaProvider,
377
- bynara: bynaraProvider,
378
- "qwen-cloud": qwenCloudProvider,
379
- modal: modalProvider,
380
- lightning: lightningProvider,
381
- tokenrouter: tokenrouterProvider,
382
- meta: metaProvider,
383
- fireworks: fireworksProvider,
384
- hetzner: hetznerProvider,
385
- orcarouter: orcarouterProvider,
386
- "merge-gateway": mergeGatewayProvider,
387
- };
388
- const fallbackOrder = [
389
- "free",
390
- "nvidia",
391
- "gemini",
392
- "openrouter",
393
- "agentrouter",
394
- "bynara",
395
- "openai",
396
- "anthropic",
397
- "aws-mantle",
398
- "ollama",
399
- "qwen-cloud",
400
- "modal",
401
- "lightning",
402
- "tokenrouter",
403
- "meta",
404
- "fireworks",
405
- "hetzner",
406
- "orcarouter",
407
- "merge-gateway",
408
- ];
409
- /**
410
- * Built-in provider ids in fallback preference order. Custom (user-defined)
411
- * provider ids are appended after the built-ins so they participate in the
412
- * cross-provider fallback chain when enabled, in config declaration order.
413
- */
414
- function allFallbackIds() {
415
- const custom = getCustomProviders().map((d) => d.id);
416
- return [...fallbackOrder, ...custom];
417
- }
418
- async function requestedRealKeyCount(provider) {
419
- // Ollama's "key" is a local host URL, and `free` has no credential at all —
420
- // both are keyless/local slots, not a single real API key. Counting them
421
- // here would disable fallback for the two providers that most need it when
422
- // the local server or free tier is unavailable.
423
- if (provider === "ollama" || provider === "free")
424
- return 0;
425
- const multi = await getProviderKeys(provider);
426
- return multi.keys.filter((key) => key.value && !key.disabled).length;
427
- }
428
- export function buildFallbackChain(requested, freeOnly, enabled = false, preferAlternates = false) {
429
- if (!enabled)
430
- return [requested];
431
- const order = allFallbackIds();
432
- const filtered = freeOnly
433
- ? order.filter((provider) => provider === requested || resolveProviderCategory(provider) !== "paid-cloud")
434
- : order;
435
- const alternates = filtered.filter((provider) => provider !== requested);
436
- // A live-connection stall has already spent one full generation on the
437
- // selected route. Retrying it first creates the duplicate partial bubbles in
438
- // the reported failure. Try configured alternates first for that recovery
439
- // attempt, but retain the user's selected provider as the final fallback.
440
- return preferAlternates
441
- ? [...alternates, requested]
442
- : [requested, ...alternates];
443
- }
444
- export function getProvider(provider) {
445
- const builtin = providers[provider];
446
- if (builtin)
447
- return builtin;
448
- // Custom (user-defined) providers are not in the static map; resolve them
449
- // from the runtime registry. Returns undefined for an unknown id.
450
- const custom = getCustomProviderSync(provider);
451
- if (custom)
452
- return custom;
453
- // Unknown id: return the first built-in so callers that don't pre-validate
454
- // get a usable object rather than `undefined`. Callers that need to assert
455
- // existence use `assertProvider` (which now accepts custom ids too).
456
- return providers.nvidia;
457
- }
458
- export async function providerAuth(provider) {
459
- const secret = await getProviderSecret(provider);
460
- if (provider === "ollama") {
461
- return { baseUrl: secret.value };
462
- }
463
- // Endpoint providers carry both: the stored secret plus the active endpoint
464
- // URL from config (Modal requires one; Lightning treats it as an override).
465
- if (providerUsesEndpoints(provider)) {
466
- const baseUrl = getActiveProviderEndpoint(provider);
467
- return { apiKey: secret.value, ...(baseUrl ? { baseUrl } : {}) };
468
- }
469
- return { apiKey: secret.value };
470
- }
471
- function authForSlot(providerId, value) {
472
- if (providerId === "ollama") {
473
- return { baseUrl: value };
474
- }
475
- if (providerUsesEndpoints(providerId)) {
476
- const baseUrl = getActiveProviderEndpoint(providerId);
477
- return { apiKey: value, ...(baseUrl ? { baseUrl } : {}) };
478
- }
479
- return { apiKey: value };
480
- }
481
- function withoutReasoning(request) {
482
- return { ...request, thinking: undefined };
483
- }
484
- function reasoningWireKey(thinking, style, model, providerId) {
485
- return JSON.stringify(buildReasoningPayload(thinking, style, model, providerId));
486
- }
487
- function makeKeyEmitter(onStatus, onKeyEvent) {
488
- return (event) => {
489
- onKeyEvent?.(event);
490
- // Quiet sticky start: never status-spam "using …" on every model step.
491
- // Surface only retries (composer countdown), switches (toast + status), exhausted.
492
- if (event.type === "using")
493
- return;
494
- const line = formatKeyEventStatus(event);
495
- if (event.type === "retry" || event.type === "switch" || event.type === "exhausted") {
496
- onStatus?.(line);
497
- }
498
- };
499
- }
500
- const SELF_RECORDED_PROVIDERS = new Set([
501
- "agentrouter",
502
- "bynara",
503
- "meta",
504
- ]);
505
- async function runRecordedProviderAttempt(input) {
506
- if (SELF_RECORDED_PROVIDERS.has(input.providerId))
507
- return input.run();
508
- return runGenerationAttempt(input.request, {
509
- provider: input.providerId,
510
- model: input.model,
511
- mode: input.mode,
512
- reason: input.reason,
513
- }, input.run);
514
- }
515
- async function tryCompleteOnce(provider, providerId, request, model, auth, reason, onStatus, singleDispatch = false) {
516
- const activeRequest = { ...request, provider: providerId, model };
517
- const runAttempt = (candidate, attemptReason) => {
518
- const attemptRequest = { ...candidate, attemptReason };
519
- return runRecordedProviderAttempt({
520
- providerId,
521
- model: attemptRequest.model ?? model,
522
- mode: "complete",
523
- reason: attemptReason,
524
- request: attemptRequest,
525
- run: () => provider.complete(attemptRequest, auth),
526
- });
527
- };
528
- try {
529
- const result = await runAttempt(activeRequest, reason);
530
- if (hasImageInput(activeRequest)) {
531
- learnModelVisionCapability(providerId, model, true);
532
- }
533
- return result;
534
- }
535
- catch (error) {
536
- // A pinned single-dispatch operation records the capability verdict for the
537
- // next operation but never spends a second physical request on it.
538
- if (activeRequest.tools?.length && isToolsUnsupportedError(error)) {
539
- markTextOnlyModel(providerId, model);
540
- if (singleDispatch)
541
- throw error;
542
- const textRequest = {
543
- ...activeRequest,
544
- tools: undefined,
545
- toolChoice: undefined,
546
- parallelToolCalls: undefined,
547
- };
548
- return await runAttempt(textRequest, "adaptation");
549
- }
550
- if (isMissingReasoningContentError(error) && !activeRequest.forceReasoningReplay) {
551
- if (singleDispatch)
552
- throw error;
553
- onStatus?.(`ℹ ${providerId}/${model} needs its reasoning replayed — retrying with it attached`);
554
- try {
555
- return await runAttempt({ ...activeRequest, forceReasoningReplay: true }, "adaptation");
556
- }
557
- catch (retryError) {
558
- if (!isMissingReasoningContentError(retryError))
559
- throw retryError;
560
- return await runAttempt(withoutReasoning(activeRequest), "adaptation");
561
- }
562
- }
563
- if (shouldEnterEffortLadder(error, activeRequest.thinking, providerId, model, singleDispatch)) {
564
- const advice = reasoningRejectionAdvice(error);
565
- if (advice?.acceptedEfforts.length) {
566
- registerWireRejectionEfforts(providerId, model, advice.acceptedEfforts);
567
- }
568
- if (advice?.mandatory)
569
- markReasoningMandatory(providerId, model);
570
- if (singleDispatch) {
571
- if (!advice?.mandatory)
572
- markReasoningUnsupported(providerId, model);
573
- throw error;
574
- }
575
- const thinking = activeRequest.thinking;
576
- if (thinking?.enabled) {
577
- const style = provider.reasoningStyle ?? "none";
578
- const seen = new Set([
579
- reasoningWireKey(thinking, style, model, providerId),
580
- ]);
581
- for (const effort of effortCandidatesFor(providerId, model, thinking.effort)) {
582
- const candidate = { ...thinking, effort };
583
- const key = reasoningWireKey(candidate, style, model, providerId);
584
- if (seen.has(key))
585
- continue;
586
- seen.add(key);
587
- onStatus?.(`ℹ ${providerId}/${model} rejected reasoning effort — retrying with ${effort}`);
588
- const retryRequest = {
589
- ...activeRequest,
590
- thinking: candidate,
591
- };
592
- try {
593
- return await runAttempt(retryRequest, "adaptation");
594
- }
595
- catch (retryError) {
596
- if (!shouldContinueEffortLadder(retryError))
597
- throw retryError;
598
- }
599
- }
600
- }
601
- if (!advice?.mandatory)
602
- markReasoningUnsupported(providerId, model);
603
- onStatus?.(advice?.mandatory
604
- ? `ℹ ${providerId}/${model} requires reasoning — retrying at its lowest accepted effort`
605
- : `ℹ ${providerId}/${model} rejected reasoning options — retrying without them`);
606
- return await runAttempt(withoutReasoning(activeRequest), "adaptation");
607
- }
608
- if (!singleDispatch &&
609
- activeRequest.thinking?.enabled &&
610
- isUnattributableRequestBodyError(error)) {
611
- onStatus?.(`ℹ ${providerId}/${model} rejected the request body — retrying without reasoning options`);
612
- return await runAttempt(withoutReasoning(activeRequest), "adaptation");
613
- }
614
- if (hasImageInput(activeRequest) && isImageInputUnsupportedError(error)) {
615
- learnModelVisionCapability(providerId, model, false);
616
- if (singleDispatch)
617
- throw error;
618
- return await runAttempt(withoutImages(activeRequest), "adaptation");
619
- }
620
- if (!singleDispatch) {
621
- const restored = revertVisionSubstitution(providerId, model, activeRequest, error);
622
- if (restored) {
623
- return await runAttempt(restored.request, "adaptation");
624
- }
625
- }
626
- throw error;
627
- }
628
- }
629
- function requestForRoute(request, provider, model) {
630
- if (modelSupportsVision(provider, model))
631
- return request;
632
- const tools = request.tools?.filter((tool) => tool.name !== "image.view");
633
- const forcedImageView = typeof request.toolChoice === "object" &&
634
- request.toolChoice.name === "image.view";
635
- const messages = request.messages.map((message) => message.role === "system" && message.content.includes("image.view")
636
- ? {
637
- ...message,
638
- content: applyImageViewAvailability(message.content, false),
639
- }
640
- : message);
641
- return {
642
- ...request,
643
- messages,
644
- ...(request.tools ? { tools } : {}),
645
- ...(forcedImageView
646
- ? { toolChoice: tools?.length ? "auto" : undefined }
647
- : {}),
648
- ...(!tools?.length && request.tools
649
- ? { parallelToolCalls: undefined }
650
- : {}),
651
- };
652
- }
653
- function hasImageInput(request) {
654
- return request.messages.some((message) => message.images?.length);
655
- }
656
- function withoutImages(request) {
657
- return { ...request, messages: stripImagesFromMessages(request.messages) };
658
- }
659
- function isModelNotFoundError(error) {
660
- const status = error && typeof error === "object" && "status" in error
661
- ? Number(error.status)
662
- : undefined;
663
- if (status !== 404 && status !== 400)
664
- return false;
665
- const body = error && typeof error === "object" && "body" in error
666
- ? String(error.body ?? "")
667
- : "";
668
- const message = error instanceof Error ? error.message : String(error);
669
- const hay = `${message}\n${body}`.toLowerCase();
670
- if (status === 404)
671
- return true;
672
- return /model[_ ]?not[_ ]?found|no such model|unknown model|model does not exist|invalid model|unavailable[- ]model/.test(hay);
673
- }
674
- function revertVisionSubstitution(providerId, model, request, error) {
675
- if (!isModelNotFoundError(error))
676
- return undefined;
677
- const original = visionSubstitutionOrigin(providerId, model);
678
- if (!original)
679
- return undefined;
680
- markModelUnavailable(providerId, model);
681
- const keepImages = modelAcceptsImages(providerId, original);
682
- const restoredRequest = {
683
- ...request,
684
- model: original,
685
- messages: keepImages
686
- ? request.messages
687
- : stripImagesFromMessages(request.messages),
688
- };
689
- return {
690
- original,
691
- request: requestForRoute(restoredRequest, providerId, original),
692
- };
693
- }
694
- async function tryStreamOnce(provider, providerId, request, model, auth, onToken, onStatus, reason, singleDispatch = false, onSuccessfulRequest) {
695
- let emittedBytes = 0;
696
- let emittedToolArgumentBytes = 0;
697
- const onToolCallDelta = request.onToolCallDelta;
698
- const downstreamEvents = request.onStreamEvent;
699
- let guard = createStreamEventGuard();
700
- const startedToolCallIndexes = new Set();
701
- const emitEvent = (event) => {
702
- guard.accept(event);
703
- if (event.type === "reasoning_delta" || event.type === "commentary_delta") {
704
- emittedBytes += event.text.length;
705
- }
706
- downstreamEvents?.(event);
707
- };
708
- const activeRequest = {
709
- ...request,
710
- provider: providerId,
711
- model,
712
- ...(onToolCallDelta || downstreamEvents
713
- ? {
714
- onToolCallDelta: (delta) => {
715
- const argumentBytes = delta.argumentsBytes ?? 0;
716
- emittedBytes += Math.max(delta.name?.length ?? 0, argumentBytes - emittedToolArgumentBytes, 1);
717
- emittedToolArgumentBytes = Math.max(emittedToolArgumentBytes, argumentBytes);
718
- if (delta.name !== undefined &&
719
- !startedToolCallIndexes.has(delta.index)) {
720
- startedToolCallIndexes.add(delta.index);
721
- emitEvent({
722
- type: "tool_call_started",
723
- index: delta.index,
724
- ...(delta.id ? { id: delta.id } : {}),
725
- name: delta.name,
726
- });
727
- }
728
- emitEvent({
729
- type: "tool_arguments_delta",
730
- index: delta.index,
731
- ...(delta.id ? { id: delta.id } : {}),
732
- argumentsBytes: argumentBytes,
733
- });
734
- onToolCallDelta?.(delta);
735
- },
736
- }
737
- : {}),
738
- ...(downstreamEvents ? { onStreamEvent: emitEvent } : {}),
739
- };
740
- const emit = (token) => {
741
- if (!token)
742
- return;
743
- emittedBytes += token.length;
744
- emitEvent({ type: "answer_delta", text: token });
745
- onToken(token);
746
- };
747
- const learnVisionOnSuccess = () => {
748
- if (hasImageInput(activeRequest)) {
749
- learnModelVisionCapability(providerId, model, true);
750
- }
751
- };
752
- const runAttempt = async (candidate, attemptReason) => {
753
- guard = createStreamEventGuard();
754
- startedToolCallIndexes.clear();
755
- const attemptRequest = { ...candidate, attemptReason };
756
- const result = await runRecordedProviderAttempt({
757
- providerId,
758
- model: attemptRequest.model ?? model,
759
- mode: "stream",
760
- reason: attemptReason,
761
- request: attemptRequest,
762
- run: async () => {
763
- let result;
764
- if (provider.stream) {
765
- result = await provider.stream(attemptRequest, auth, emit);
766
- }
767
- else {
768
- result = await provider.complete(attemptRequest, auth);
769
- emit(result.text);
770
- }
771
- for (const [index, call] of (result.toolCalls ?? []).entries()) {
772
- if (!startedToolCallIndexes.has(index)) {
773
- startedToolCallIndexes.add(index);
774
- emitEvent({
775
- type: "tool_call_started",
776
- index,
777
- ...(call.id ? { id: call.id } : {}),
778
- name: call.name,
779
- });
780
- }
781
- emitEvent({
782
- type: "tool_call_completed",
783
- index,
784
- ...(call.id ? { id: call.id } : {}),
785
- name: call.name,
786
- });
787
- }
788
- if (result.usage) {
789
- emitEvent({ type: "usage_observed", usage: result.usage });
790
- }
791
- emitEvent({
792
- type: "provider_terminal",
793
- ...(result.finishReason
794
- ? { finishReason: result.finishReason }
795
- : {}),
796
- });
797
- return result;
798
- },
799
- });
800
- try {
801
- onSuccessfulRequest?.(successfulRequestSnapshot(result.provider || providerId, result.model || attemptRequest.model || model, attemptRequest));
802
- }
803
- catch { }
804
- return result;
805
- };
806
- try {
807
- const result = await runAttempt(activeRequest, reason);
808
- learnVisionOnSuccess();
809
- return result;
810
- }
811
- catch (error) {
812
- if (emittedBytes === 0 &&
813
- activeRequest.tools?.length &&
814
- isToolsUnsupportedError(error)) {
815
- markTextOnlyModel(providerId, model);
816
- if (singleDispatch)
817
- throw markStreamEmittedBytes(error, emittedBytes);
818
- onStatus?.(`ℹ ${providerId}/${model} does not support native tools — falling back to text protocol`);
819
- const textRequest = {
820
- ...activeRequest,
821
- tools: undefined,
822
- toolChoice: undefined,
823
- parallelToolCalls: undefined,
824
- };
825
- try {
826
- return await runAttempt(textRequest, "adaptation");
827
- }
828
- catch (retryError) {
829
- throw markStreamEmittedBytes(preservedFailure(retryError, error), emittedBytes);
830
- }
831
- }
832
- // Model rejected a reasoning/thinking knob (e.g. chat_template_kwargs on a
833
- // NIM chat template that does not accept it). A parameter rejection is a
834
- // request-time 4xx, so no tokens have streamed yet — retries are clean.
835
- // Walk down the effort ladder first (max → xhigh → high → medium → low) so
836
- // a model that merely rejects the highest requested depth keeps reasoning;
837
- // only strip reasoning entirely once every candidate has been rejected.
838
- if (emittedBytes === 0 &&
839
- isMissingReasoningContentError(error) &&
840
- !activeRequest.forceReasoningReplay) {
841
- if (singleDispatch)
842
- throw markStreamEmittedBytes(error, emittedBytes);
843
- onStatus?.(`ℹ ${providerId}/${model} needs its reasoning replayed — retrying with it attached`);
844
- try {
845
- return await runAttempt({ ...activeRequest, forceReasoningReplay: true }, "adaptation");
846
- }
847
- catch (retryError) {
848
- if (!isMissingReasoningContentError(retryError)) {
849
- throw markStreamEmittedBytes(preservedFailure(retryError, error), emittedBytes);
850
- }
851
- return await runAttempt(withoutReasoning(activeRequest), "adaptation");
852
- }
853
- }
854
- if (emittedBytes === 0 && shouldEnterEffortLadder(error, activeRequest.thinking, providerId, model, singleDispatch)) {
855
- const advice = reasoningRejectionAdvice(error);
856
- if (advice?.acceptedEfforts.length) {
857
- registerWireRejectionEfforts(providerId, model, advice.acceptedEfforts);
858
- }
859
- if (advice?.mandatory)
860
- markReasoningMandatory(providerId, model);
861
- if (singleDispatch) {
862
- if (!advice?.mandatory)
863
- markReasoningUnsupported(providerId, model);
864
- throw markStreamEmittedBytes(error, emittedBytes);
865
- }
866
- const thinking = activeRequest.thinking;
867
- if (thinking?.enabled) {
868
- const style = provider.reasoningStyle ?? "none";
869
- const seen = new Set([
870
- reasoningWireKey(thinking, style, model, providerId),
871
- ]);
872
- for (const effort of effortCandidatesFor(providerId, model, thinking.effort)) {
873
- const candidate = { ...thinking, effort };
874
- const key = reasoningWireKey(candidate, style, model, providerId);
875
- if (seen.has(key))
876
- continue;
877
- seen.add(key);
878
- onStatus?.(`ℹ ${providerId}/${model} rejected reasoning effort — retrying with ${effort}`);
879
- const retryRequest = {
880
- ...activeRequest,
881
- thinking: candidate,
882
- };
883
- try {
884
- return await runAttempt(retryRequest, "adaptation");
885
- }
886
- catch (retryError) {
887
- if (!shouldContinueEffortLadder(retryError)) {
888
- throw markStreamEmittedBytes(preservedFailure(retryError, error), emittedBytes);
889
- }
890
- }
891
- }
892
- }
893
- if (!advice?.mandatory)
894
- markReasoningUnsupported(providerId, model);
895
- onStatus?.(advice?.mandatory
896
- ? `ℹ ${providerId}/${model} requires reasoning — retrying at its lowest accepted effort`
897
- : `ℹ ${providerId}/${model} rejected reasoning options — retrying without them`);
898
- const retryRequest = withoutReasoning(activeRequest);
899
- try {
900
- return await runAttempt(retryRequest, "adaptation");
901
- }
902
- catch (retryError) {
903
- throw markStreamEmittedBytes(preservedFailure(retryError, error), emittedBytes);
904
- }
905
- }
906
- if (emittedBytes === 0 &&
907
- !singleDispatch &&
908
- activeRequest.thinking?.enabled &&
909
- isUnattributableRequestBodyError(error)) {
910
- onStatus?.(`ℹ ${providerId}/${model} rejected the request body — retrying without reasoning options`);
911
- try {
912
- return await runAttempt(withoutReasoning(activeRequest), "adaptation");
913
- }
914
- catch (retryError) {
915
- throw markStreamEmittedBytes(preservedFailure(retryError, error), emittedBytes);
916
- }
917
- }
918
- if (emittedBytes === 0 &&
919
- hasImageInput(activeRequest) &&
920
- isImageInputUnsupportedError(error)) {
921
- learnModelVisionCapability(providerId, model, false);
922
- if (singleDispatch)
923
- throw markStreamEmittedBytes(error, emittedBytes);
924
- onStatus?.(`ℹ ${providerId}/${model} rejected image input — retrying without the attached image(s)`);
925
- const textOnlyRequest = withoutImages(activeRequest);
926
- try {
927
- return await runAttempt(textOnlyRequest, "adaptation");
928
- }
929
- catch (retryError) {
930
- throw markStreamEmittedBytes(preservedFailure(retryError, error), emittedBytes);
931
- }
932
- }
933
- if (emittedBytes === 0 && !singleDispatch) {
934
- const restored = revertVisionSubstitution(providerId, model, activeRequest, error);
935
- if (restored) {
936
- onStatus?.(`ℹ ${providerId}/${model} is not available on this account — falling back to ${restored.original}`);
937
- try {
938
- return await runAttempt(restored.request, "adaptation");
939
- }
940
- catch (retryError) {
941
- throw markStreamEmittedBytes(preservedFailure(retryError, error), emittedBytes);
942
- }
943
- }
944
- }
945
- throw markStreamEmittedBytes(error, emittedBytes);
946
- }
947
- }
948
- /**
949
- * Run complete/stream against all keys for one provider with circular rotation.
950
- * Returns result on success; throws ProviderError-like aggregate on hard stop;
951
- * returns `{ exhausted: true, lastError }` when the key circle is done.
952
- */
953
- async function runWithKeyRotation(opts) {
954
- const { providerId, provider, request, model, emitKey } = opts;
955
- const singleDispatch = opts.singleDispatch === true;
956
- const multi = await getProviderKeys(providerId);
957
- const slots = multi.keys;
958
- if (slots.length === 0) {
959
- throw new Error("no API key configured");
960
- }
961
- const fullPlan = buildKeyAttemptPlan(slots.length, multi.activeIndex).filter((index) => !slots[index].disabled);
962
- // A pinned operation uses the sticky key only: rotating would send the same
963
- // large prompt again under a different credential.
964
- const plan = singleDispatch ? fullPlan.slice(0, 1) : fullPlan;
965
- if (plan.length === 0) {
966
- throw new Error(`all ${slots.length} API key${slots.length === 1 ? "" : "s"} for ${providerId} are disabled — re-enable one to use this provider`);
967
- }
968
- const enabledCount = plan.length;
969
- const multiKey = enabledCount > 1;
970
- // Single key: time-increasing retries (MAX_RETRIES+1 attempts).
971
- // Multi key: 2 attempts per key (initial + one retry), then next key.
972
- const maxPerKey = singleDispatch
973
- ? 1
974
- : attemptsPerKey(enabledCount, (opts.maxRetries ?? MAX_RETRIES) + 1);
975
- let lastError;
976
- // Endpoint failover: a provider can carry several base URLs (e.g. Modal
977
- // workspaces). On an auth/quota error the active endpoint may simply be the
978
- // wrong workspace for the key, so rotate the endpoint too before giving up.
979
- const storedEndpoints = providerUsesEndpoints(providerId) && !singleDispatch
980
- ? getProviderEndpoints(providerId)
981
- : undefined;
982
- const endpointUrls = (storedEndpoints?.urls ?? []).filter((url) => !(storedEndpoints?.disabledUrls ?? []).includes(url));
983
- const activeEndpointUrl = storedEndpoints?.urls[storedEndpoints.activeIndex];
984
- const activeEndpointPos = activeEndpointUrl
985
- ? endpointUrls.indexOf(activeEndpointUrl)
986
- : -1;
987
- const endpointStart = activeEndpointPos >= 0 ? activeEndpointPos : 0;
988
- let endpointOffset = 0;
989
- const endpointCount = endpointUrls.length;
990
- const authForAttempt = (value) => {
991
- if (endpointCount === 0)
992
- return authForSlot(providerId, value);
993
- const url = endpointUrls[(endpointStart + endpointOffset) % endpointCount];
994
- return { apiKey: value, baseUrl: url };
995
- };
996
- for (let planIdx = 0; planIdx < plan.length; planIdx++) {
997
- const keyIndex = plan[planIdx];
998
- const slot = slots[keyIndex];
999
- const auth = authForAttempt(slot.value);
1000
- const tail = maskSecretTail(slot.value);
1001
- // Announce only when rotating after a failure — never re-toast the sticky
1002
- // key on every agent step ("using [2/4]" spam).
1003
- if (planIdx > 0) {
1004
- emitKey({
1005
- type: "switch",
1006
- provider: providerId,
1007
- maskedTail: tail,
1008
- keyIndex,
1009
- keyCount: slots.length,
1010
- ...(lastError ? { reason: failureReason(lastError) } : {}),
1011
- });
1012
- }
1013
- for (let attempt = 0; attempt < maxPerKey; attempt++) {
1014
- request.signal?.throwIfAborted();
1015
- const attemptReason = planIdx === 0 && attempt === 0 ? opts.initialAttemptReason : "retry";
1016
- try {
1017
- let result;
1018
- if (opts.mode === "stream") {
1019
- result = await tryStreamOnce(provider, providerId, request, model, auth, opts.onToken ?? (() => { }), opts.onStatus, attemptReason, singleDispatch, opts.onSuccessfulRequest);
1020
- }
1021
- else {
1022
- result = await tryCompleteOnce(provider, providerId, request, model, auth, attemptReason, opts.onStatus, singleDispatch);
1023
- }
1024
- // Sticky success only for stored multi-key (not env-only synthetic).
1025
- if (multi.source !== "env" && multi.source !== "local") {
1026
- void markProviderKeySuccess(providerId, keyIndex).catch(() => { });
1027
- }
1028
- if (storedEndpoints && endpointCount > 0) {
1029
- const winningUrl = endpointUrls[(endpointStart + endpointOffset) % endpointCount];
1030
- const storedIndex = storedEndpoints.urls.indexOf(winningUrl);
1031
- const authoritative = getActiveProviderEndpoint(providerId);
1032
- if (storedIndex >= 0 &&
1033
- storedIndex !== storedEndpoints.activeIndex &&
1034
- (authoritative === "" || storedEndpoints.urls.includes(authoritative))) {
1035
- try {
1036
- setActiveProviderEndpoint(providerId, storedIndex);
1037
- }
1038
- catch { }
1039
- }
1040
- }
1041
- return result;
1042
- }
1043
- catch (error) {
1044
- const previousError = lastError;
1045
- lastError = error;
1046
- // An admission guard that fires while recovering from a real failure
1047
- // hides that failure. Report the cause the user can act on.
1048
- if (isOperationPolicyError(error) && previousError !== undefined) {
1049
- throw previousError;
1050
- }
1051
- // 404/422: other keys for the same model will not help.
1052
- if (isKeyCircleStopError(error)) {
1053
- throw error;
1054
- }
1055
- // Auth / quota (402 credits): never sleep on the same key — switch now.
1056
- if (isImmediateKeySwitchError(error)) {
1057
- // A workspace-mismatched endpoint (e.g. Modal "different workspace")
1058
- // will fail for every key, so rotate the endpoint before the key.
1059
- if (endpointCount > 1 && endpointOffset + 1 < endpointCount) {
1060
- endpointOffset += 1;
1061
- emitKey({
1062
- type: "endpoint",
1063
- provider: providerId,
1064
- maskedTail: tail,
1065
- reason: failureReason(error),
1066
- });
1067
- planIdx = -1;
1068
- break;
1069
- }
1070
- if (multiKey) {
1071
- // Always advance (or exit plan after last key) so every key is tried.
1072
- break;
1073
- }
1074
- // Single key — surface immediately (no pointless multi-second backoff).
1075
- throw error;
1076
- }
1077
- const rotatable = isKeyRotatableError(error, isRetriableError);
1078
- if (!rotatable) {
1079
- // e.g. 413 — bubble so outer provider fallback can try another provider.
1080
- throw error;
1081
- }
1082
- const canRetrySame = attempt + 1 < maxPerKey;
1083
- if (canRetrySame) {
1084
- const wait = isRateLimited(error) || isServerUnavailable(error)
1085
- ? retryWaitMs(error, attempt)
1086
- : networkRetryWaitMs(attempt);
1087
- if (wait > MAX_RETRY_WAIT_MS) {
1088
- // Don't burn the whole multi-key circle on one impossible wait —
1089
- // move to the next key when multi; single-key still exhausts.
1090
- if (multiKey)
1091
- break;
1092
- throw error;
1093
- }
1094
- emitKey({
1095
- type: "retry",
1096
- provider: providerId,
1097
- maskedTail: tail,
1098
- reason: failureReason(error),
1099
- waitMs: wait,
1100
- keyIndex,
1101
- keyCount: slots.length,
1102
- });
1103
- await sleep(wait, request.signal);
1104
- continue;
1105
- }
1106
- // Exhausted attempts for this key → next in circle (if any).
1107
- break;
1108
- }
1109
- }
1110
- // Endpoint providers pair each key with a workspace URL (a Modal token
1111
- // only works on its own workspace's endpoint). Advancing the key without
1112
- // advancing the endpoint guarantees a workspace-mismatch 401, so move to
1113
- // the next endpoint first and let the next key pair with it. Auth/quota
1114
- // errors keep their dedicated endpoint-rotation path above.
1115
- if (planIdx >= 0 &&
1116
- endpointCount > 1 &&
1117
- planIdx + 1 < plan.length &&
1118
- lastError &&
1119
- !isImmediateKeySwitchError(lastError)) {
1120
- endpointOffset += 1;
1121
- emitKey({
1122
- type: "endpoint",
1123
- provider: providerId,
1124
- maskedTail: tail,
1125
- reason: failureReason(lastError),
1126
- });
1127
- }
1128
- }
1129
- // Single-key rate-limit exhaustion: preserve historical UX string.
1130
- if (!multiKey && lastError && isRateLimited(lastError)) {
1131
- opts.onStatus?.(`⏳ ${providerId} rate limited; staying on selected provider.`);
1132
- }
1133
- else if (multiKey) {
1134
- emitKey({
1135
- type: "exhausted",
1136
- provider: providerId,
1137
- maskedTail: maskSecretTail(slots[plan[0]].value),
1138
- keyCount: slots.length,
1139
- reason: lastError ? failureReason(lastError) : undefined,
1140
- });
1141
- }
1142
- const err = lastError ?? new Error("all API keys failed");
1143
- throw err;
1144
- }
1145
24
  async function completeWithProviderOperation(request, options, ledger) {
1146
25
  const config = getConfig();
1147
26
  const singleDispatch = options.singleDispatch === true;
@@ -1183,7 +62,9 @@ async function completeWithProviderOperation(request, options, ledger) {
1183
62
  mode: "complete",
1184
63
  initialAttemptReason: providerId === requested ? "initial" : "fallback",
1185
64
  ...(options?.onStatus ? { onStatus: options.onStatus } : {}),
1186
- ...(options?.maxRetries !== undefined ? { maxRetries: options.maxRetries } : {}),
65
+ ...(options?.maxRetries !== undefined
66
+ ? { maxRetries: options.maxRetries }
67
+ : {}),
1187
68
  ...(singleDispatch ? { singleDispatch: true } : {}),
1188
69
  });
1189
70
  if (providerId !== requested) {
@@ -1209,7 +90,6 @@ async function completeWithProviderOperation(request, options, ledger) {
1209
90
  if (isKeyCircleStopError(error) || shouldStopProviderFallback(error)) {
1210
91
  throw aggregateProviderError(`No provider could complete the request.${formatFailures(failures)}`, failures);
1211
92
  }
1212
- // Continue to next provider in chain when fallback is enabled (e.g. 413).
1213
93
  }
1214
94
  }
1215
95
  throw aggregateProviderError(`No provider could complete the request.${formatFailures(failures)}`, failures);
@@ -1257,7 +137,7 @@ export async function completeWithProvider(request, options = {}) {
1257
137
  async function streamWithProviderOperation(request, onToken, onStatusOrOptions, ledger) {
1258
138
  const options = typeof onStatusOrOptions === "function"
1259
139
  ? { onStatus: onStatusOrOptions }
1260
- : onStatusOrOptions ?? {};
140
+ : (onStatusOrOptions ?? {});
1261
141
  const operation = ledger ?? resolveOperationLedger(options);
1262
142
  const relayToken = (token) => {
1263
143
  operation.noteSemanticOutput();
@@ -1323,7 +203,9 @@ async function streamWithProviderOperation(request, onToken, onStatusOrOptions,
1323
203
  initialAttemptReason: providerId === requested ? "initial" : "fallback",
1324
204
  onToken: relayToken,
1325
205
  onStatus: emitStatus,
1326
- ...(options.maxRetries !== undefined ? { maxRetries: options.maxRetries } : {}),
206
+ ...(options.maxRetries !== undefined
207
+ ? { maxRetries: options.maxRetries }
208
+ : {}),
1327
209
  ...(singleDispatch ? { singleDispatch: true } : {}),
1328
210
  ...(options.onSuccessfulRequest
1329
211
  ? { onSuccessfulRequest: options.onSuccessfulRequest }
@@ -1351,12 +233,9 @@ async function streamWithProviderOperation(request, onToken, onStatusOrOptions,
1351
233
  });
1352
234
  if (isKeyCircleStopError(error) ||
1353
235
  shouldStopProviderFallback(error) ||
1354
- // Partial output already reached the transcript; another
1355
- // provider would duplicate it.
1356
236
  streamAlreadyEmitted(error)) {
1357
237
  throw aggregateProviderError(`No provider could stream the request.${formatFailures(failures)}`, failures, streamEmittedBytes(error));
1358
238
  }
1359
- // Continue to next provider when fallback is enabled (e.g. 413).
1360
239
  }
1361
240
  }
1362
241
  throw aggregateProviderError(`No provider could stream the request.${formatFailures(failures)}`, failures);
@@ -1364,7 +243,7 @@ async function streamWithProviderOperation(request, onToken, onStatusOrOptions,
1364
243
  export async function streamWithProvider(request, onToken, onStatusOrOptions) {
1365
244
  const options = typeof onStatusOrOptions === "function"
1366
245
  ? { onStatus: onStatusOrOptions }
1367
- : onStatusOrOptions ?? {};
246
+ : (onStatusOrOptions ?? {});
1368
247
  const ledger = resolveOperationLedger(options);
1369
248
  try {
1370
249
  const result = await streamWithProviderOperation(request, onToken, options, ledger);