@nodetool-ai/runtime 0.7.0-rc.23 → 0.8.2

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 (713) hide show
  1. package/README.md +29 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/agent-memory.d.ts +118 -0
  4. package/dist/agent-memory.d.ts.map +1 -0
  5. package/dist/agent-memory.js +186 -0
  6. package/dist/agent-memory.js.map +1 -0
  7. package/dist/async-local-storage.d.ts +20 -0
  8. package/dist/async-local-storage.d.ts.map +1 -0
  9. package/dist/async-local-storage.js +28 -0
  10. package/dist/async-local-storage.js.map +1 -0
  11. package/dist/blender-executor.d.ts +93 -0
  12. package/dist/blender-executor.d.ts.map +1 -0
  13. package/dist/blender-executor.js +294 -0
  14. package/dist/blender-executor.js.map +1 -0
  15. package/dist/comfy-executor.d.ts +23 -1
  16. package/dist/comfy-executor.d.ts.map +1 -1
  17. package/dist/comfy-executor.js +234 -55
  18. package/dist/comfy-executor.js.map +1 -1
  19. package/dist/context-packer.d.ts +1 -1
  20. package/dist/context-packer.d.ts.map +1 -1
  21. package/dist/context-packer.js +23 -25
  22. package/dist/context-packer.js.map +1 -1
  23. package/dist/context.d.ts +982 -127
  24. package/dist/context.d.ts.map +1 -1
  25. package/dist/context.js +2649 -530
  26. package/dist/context.js.map +1 -1
  27. package/dist/cost-reconciler.d.ts +32 -0
  28. package/dist/cost-reconciler.d.ts.map +1 -0
  29. package/dist/cost-reconciler.js +21 -0
  30. package/dist/cost-reconciler.js.map +1 -0
  31. package/dist/entities.d.ts +33 -0
  32. package/dist/entities.d.ts.map +1 -0
  33. package/dist/entities.js +43 -0
  34. package/dist/entities.js.map +1 -0
  35. package/dist/external-media-fetch.d.ts +29 -0
  36. package/dist/external-media-fetch.d.ts.map +1 -0
  37. package/dist/external-media-fetch.js +38 -0
  38. package/dist/external-media-fetch.js.map +1 -0
  39. package/dist/generation-receipt.d.ts +86 -0
  40. package/dist/generation-receipt.d.ts.map +1 -0
  41. package/dist/generation-receipt.js +137 -0
  42. package/dist/generation-receipt.js.map +1 -0
  43. package/dist/generation-registry.d.ts +75 -0
  44. package/dist/generation-registry.d.ts.map +1 -0
  45. package/dist/generation-registry.js +144 -0
  46. package/dist/generation-registry.js.map +1 -0
  47. package/dist/google/client.d.ts +196 -0
  48. package/dist/google/client.d.ts.map +1 -0
  49. package/dist/google/client.js +396 -0
  50. package/dist/google/client.js.map +1 -0
  51. package/dist/google/index.d.ts +3 -0
  52. package/dist/google/index.d.ts.map +1 -0
  53. package/dist/google/index.js +3 -0
  54. package/dist/google/index.js.map +1 -0
  55. package/dist/google/token.d.ts +15 -0
  56. package/dist/google/token.d.ts.map +1 -0
  57. package/dist/google/token.js +24 -0
  58. package/dist/google/token.js.map +1 -0
  59. package/dist/host-binaries.d.ts +106 -0
  60. package/dist/host-binaries.d.ts.map +1 -0
  61. package/dist/host-binaries.js +352 -0
  62. package/dist/host-binaries.js.map +1 -0
  63. package/dist/image-codec.d.ts +76 -0
  64. package/dist/image-codec.d.ts.map +1 -0
  65. package/dist/image-codec.js +293 -0
  66. package/dist/image-codec.js.map +1 -0
  67. package/dist/image-model-tasks.d.ts +15 -0
  68. package/dist/image-model-tasks.d.ts.map +1 -0
  69. package/dist/image-model-tasks.js +24 -0
  70. package/dist/image-model-tasks.js.map +1 -0
  71. package/dist/index.d.ts +67 -6
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +51 -4
  74. package/dist/index.js.map +1 -1
  75. package/dist/invocation-account.d.ts +43 -0
  76. package/dist/invocation-account.d.ts.map +1 -0
  77. package/dist/invocation-account.js +60 -0
  78. package/dist/invocation-account.js.map +1 -0
  79. package/dist/media-ref-bytes.d.ts +35 -0
  80. package/dist/media-ref-bytes.d.ts.map +1 -0
  81. package/dist/media-ref-bytes.js +191 -0
  82. package/dist/media-ref-bytes.js.map +1 -0
  83. package/dist/node-executor.d.ts +119 -2
  84. package/dist/node-executor.d.ts.map +1 -1
  85. package/dist/permission-gate.d.ts +152 -0
  86. package/dist/permission-gate.d.ts.map +1 -0
  87. package/dist/permission-gate.js +87 -0
  88. package/dist/permission-gate.js.map +1 -0
  89. package/dist/prefixed-storage-adapter.d.ts +33 -0
  90. package/dist/prefixed-storage-adapter.d.ts.map +1 -0
  91. package/dist/prefixed-storage-adapter.js +70 -0
  92. package/dist/prefixed-storage-adapter.js.map +1 -0
  93. package/dist/prompt-asset-refs.d.ts +222 -0
  94. package/dist/prompt-asset-refs.d.ts.map +1 -0
  95. package/dist/prompt-asset-refs.js +751 -0
  96. package/dist/prompt-asset-refs.js.map +1 -0
  97. package/dist/provider-cache.d.ts +3 -0
  98. package/dist/provider-cache.d.ts.map +1 -0
  99. package/dist/provider-cache.js +8 -0
  100. package/dist/provider-cache.js.map +1 -0
  101. package/dist/providers/aki-provider.d.ts +35 -10
  102. package/dist/providers/aki-provider.d.ts.map +1 -1
  103. package/dist/providers/aki-provider.js +90 -77
  104. package/dist/providers/aki-provider.js.map +1 -1
  105. package/dist/providers/alibaba-provider.d.ts +39 -0
  106. package/dist/providers/alibaba-provider.d.ts.map +1 -0
  107. package/dist/providers/alibaba-provider.js +86 -0
  108. package/dist/providers/alibaba-provider.js.map +1 -0
  109. package/dist/providers/anthropic-provider.d.ts +52 -3
  110. package/dist/providers/anthropic-provider.d.ts.map +1 -1
  111. package/dist/providers/anthropic-provider.js +1020 -338
  112. package/dist/providers/anthropic-provider.js.map +1 -1
  113. package/dist/providers/atlascloud-provider.d.ts +103 -0
  114. package/dist/providers/atlascloud-provider.d.ts.map +1 -0
  115. package/dist/providers/atlascloud-provider.js +1031 -0
  116. package/dist/providers/atlascloud-provider.js.map +1 -0
  117. package/dist/providers/atlascloud-transport.d.ts +100 -0
  118. package/dist/providers/atlascloud-transport.d.ts.map +1 -0
  119. package/dist/providers/atlascloud-transport.js +364 -0
  120. package/dist/providers/atlascloud-transport.js.map +1 -0
  121. package/dist/providers/atlascloud-webhook-registry.d.ts +35 -0
  122. package/dist/providers/atlascloud-webhook-registry.d.ts.map +1 -0
  123. package/dist/providers/atlascloud-webhook-registry.js +104 -0
  124. package/dist/providers/atlascloud-webhook-registry.js.map +1 -0
  125. package/dist/providers/audio-mime.d.ts +11 -0
  126. package/dist/providers/audio-mime.d.ts.map +1 -0
  127. package/dist/providers/audio-mime.js +46 -0
  128. package/dist/providers/audio-mime.js.map +1 -0
  129. package/dist/providers/base-provider.d.ts +501 -32
  130. package/dist/providers/base-provider.d.ts.map +1 -1
  131. package/dist/providers/base-provider.js +1280 -87
  132. package/dist/providers/base-provider.js.map +1 -1
  133. package/dist/providers/cassette-provider.d.ts +217 -0
  134. package/dist/providers/cassette-provider.d.ts.map +1 -0
  135. package/dist/providers/cassette-provider.js +502 -0
  136. package/dist/providers/cassette-provider.js.map +1 -0
  137. package/dist/providers/cerebras-provider.d.ts +6 -12
  138. package/dist/providers/cerebras-provider.d.ts.map +1 -1
  139. package/dist/providers/cerebras-provider.js +8 -33
  140. package/dist/providers/cerebras-provider.js.map +1 -1
  141. package/dist/providers/claude-agent-provider.d.ts +107 -74
  142. package/dist/providers/claude-agent-provider.d.ts.map +1 -1
  143. package/dist/providers/claude-agent-provider.js +1279 -517
  144. package/dist/providers/claude-agent-provider.js.map +1 -1
  145. package/dist/providers/codex-provider.d.ts +84 -0
  146. package/dist/providers/codex-provider.d.ts.map +1 -0
  147. package/dist/providers/codex-provider.js +505 -0
  148. package/dist/providers/codex-provider.js.map +1 -0
  149. package/dist/providers/cohere-provider.d.ts +7 -3
  150. package/dist/providers/cohere-provider.d.ts.map +1 -1
  151. package/dist/providers/cohere-provider.js +14 -2
  152. package/dist/providers/cohere-provider.js.map +1 -1
  153. package/dist/providers/comfy-cloud-provider.d.ts +30 -0
  154. package/dist/providers/comfy-cloud-provider.d.ts.map +1 -0
  155. package/dist/providers/comfy-cloud-provider.js +42 -0
  156. package/dist/providers/comfy-cloud-provider.js.map +1 -0
  157. package/dist/providers/content-filter.d.ts +46 -0
  158. package/dist/providers/content-filter.d.ts.map +1 -0
  159. package/dist/providers/content-filter.js +92 -0
  160. package/dist/providers/content-filter.js.map +1 -0
  161. package/dist/providers/context-exceeded.d.ts +37 -0
  162. package/dist/providers/context-exceeded.d.ts.map +1 -0
  163. package/dist/providers/context-exceeded.js +114 -0
  164. package/dist/providers/context-exceeded.js.map +1 -0
  165. package/dist/providers/context-window.d.ts +44 -0
  166. package/dist/providers/context-window.d.ts.map +1 -0
  167. package/dist/providers/context-window.js +145 -0
  168. package/dist/providers/context-window.js.map +1 -0
  169. package/dist/providers/contract/index.d.ts +4 -0
  170. package/dist/providers/contract/index.d.ts.map +1 -0
  171. package/dist/providers/contract/index.js +4 -0
  172. package/dist/providers/contract/index.js.map +1 -0
  173. package/dist/providers/contract/probe-manifest.d.ts +75 -0
  174. package/dist/providers/contract/probe-manifest.d.ts.map +1 -0
  175. package/dist/providers/contract/probe-manifest.js +379 -0
  176. package/dist/providers/contract/probe-manifest.js.map +1 -0
  177. package/dist/providers/contract/probe-runner.d.ts +57 -0
  178. package/dist/providers/contract/probe-runner.d.ts.map +1 -0
  179. package/dist/providers/contract/probe-runner.js +180 -0
  180. package/dist/providers/contract/probe-runner.js.map +1 -0
  181. package/dist/providers/contract/redact.d.ts +29 -0
  182. package/dist/providers/contract/redact.d.ts.map +1 -0
  183. package/dist/providers/contract/redact.js +113 -0
  184. package/dist/providers/contract/redact.js.map +1 -0
  185. package/dist/providers/core-tools.d.ts +75 -0
  186. package/dist/providers/core-tools.d.ts.map +1 -0
  187. package/dist/providers/core-tools.js +128 -0
  188. package/dist/providers/core-tools.js.map +1 -0
  189. package/dist/providers/cost-calculator.d.ts +69 -50
  190. package/dist/providers/cost-calculator.d.ts.map +1 -1
  191. package/dist/providers/cost-calculator.js +207 -397
  192. package/dist/providers/cost-calculator.js.map +1 -1
  193. package/dist/providers/credential-check.d.ts +45 -0
  194. package/dist/providers/credential-check.d.ts.map +1 -0
  195. package/dist/providers/credential-check.js +164 -0
  196. package/dist/providers/credential-check.js.map +1 -0
  197. package/dist/providers/custom-model-kinds.d.ts +33 -0
  198. package/dist/providers/custom-model-kinds.d.ts.map +1 -0
  199. package/dist/providers/custom-model-kinds.js +96 -0
  200. package/dist/providers/custom-model-kinds.js.map +1 -0
  201. package/dist/providers/custom-openai-provider.d.ts +83 -0
  202. package/dist/providers/custom-openai-provider.d.ts.map +1 -0
  203. package/dist/providers/custom-openai-provider.js +190 -0
  204. package/dist/providers/custom-openai-provider.js.map +1 -0
  205. package/dist/providers/custom-provider-registry.d.ts +19 -0
  206. package/dist/providers/custom-provider-registry.d.ts.map +1 -0
  207. package/dist/providers/custom-provider-registry.js +52 -0
  208. package/dist/providers/custom-provider-registry.js.map +1 -0
  209. package/dist/providers/deepseek-provider.d.ts +8 -14
  210. package/dist/providers/deepseek-provider.d.ts.map +1 -1
  211. package/dist/providers/deepseek-provider.js +6 -35
  212. package/dist/providers/deepseek-provider.js.map +1 -1
  213. package/dist/providers/defaults.d.ts +12 -0
  214. package/dist/providers/defaults.d.ts.map +1 -0
  215. package/dist/providers/defaults.js +12 -0
  216. package/dist/providers/defaults.js.map +1 -0
  217. package/dist/providers/dreamina-models.d.ts +5 -0
  218. package/dist/providers/dreamina-models.d.ts.map +1 -0
  219. package/dist/providers/dreamina-models.js +57 -0
  220. package/dist/providers/dreamina-models.js.map +1 -0
  221. package/dist/providers/dreamina-music.d.ts +52 -0
  222. package/dist/providers/dreamina-music.d.ts.map +1 -0
  223. package/dist/providers/dreamina-music.js +115 -0
  224. package/dist/providers/dreamina-music.js.map +1 -0
  225. package/dist/providers/dreamina-provider.d.ts +62 -0
  226. package/dist/providers/dreamina-provider.d.ts.map +1 -0
  227. package/dist/providers/dreamina-provider.js +790 -0
  228. package/dist/providers/dreamina-provider.js.map +1 -0
  229. package/dist/providers/elevenlabs-provider.d.ts +50 -0
  230. package/dist/providers/elevenlabs-provider.d.ts.map +1 -0
  231. package/dist/providers/elevenlabs-provider.js +147 -0
  232. package/dist/providers/elevenlabs-provider.js.map +1 -0
  233. package/dist/providers/entity-references.d.ts +31 -0
  234. package/dist/providers/entity-references.d.ts.map +1 -0
  235. package/dist/providers/entity-references.js +113 -0
  236. package/dist/providers/entity-references.js.map +1 -0
  237. package/dist/providers/evolink-provider.d.ts +40 -0
  238. package/dist/providers/evolink-provider.d.ts.map +1 -0
  239. package/dist/providers/evolink-provider.js +312 -0
  240. package/dist/providers/evolink-provider.js.map +1 -0
  241. package/dist/providers/fake-provider.d.ts +74 -2
  242. package/dist/providers/fake-provider.d.ts.map +1 -1
  243. package/dist/providers/fake-provider.js +213 -1
  244. package/dist/providers/fake-provider.js.map +1 -1
  245. package/dist/providers/fal-generations.d.ts +106 -0
  246. package/dist/providers/fal-generations.d.ts.map +1 -0
  247. package/dist/providers/fal-generations.js +286 -0
  248. package/dist/providers/fal-generations.js.map +1 -0
  249. package/dist/providers/fal-provider.d.ts +173 -8
  250. package/dist/providers/fal-provider.d.ts.map +1 -1
  251. package/dist/providers/fal-provider.js +1396 -64
  252. package/dist/providers/fal-provider.js.map +1 -1
  253. package/dist/providers/fal-queue.d.ts +47 -0
  254. package/dist/providers/fal-queue.d.ts.map +1 -0
  255. package/dist/providers/fal-queue.js +231 -0
  256. package/dist/providers/fal-queue.js.map +1 -0
  257. package/dist/providers/gemini-provider.d.ts +150 -9
  258. package/dist/providers/gemini-provider.d.ts.map +1 -1
  259. package/dist/providers/gemini-provider.js +1515 -316
  260. package/dist/providers/gemini-provider.js.map +1 -1
  261. package/dist/providers/gmi-provider.d.ts +21 -0
  262. package/dist/providers/gmi-provider.d.ts.map +1 -0
  263. package/dist/providers/gmi-provider.js +34 -0
  264. package/dist/providers/gmi-provider.js.map +1 -0
  265. package/dist/providers/gpt-image-size.d.ts +3 -0
  266. package/dist/providers/gpt-image-size.d.ts.map +1 -0
  267. package/dist/providers/gpt-image-size.js +37 -0
  268. package/dist/providers/gpt-image-size.js.map +1 -0
  269. package/dist/providers/groq-provider.d.ts +9 -12
  270. package/dist/providers/groq-provider.d.ts.map +1 -1
  271. package/dist/providers/groq-provider.js +19 -33
  272. package/dist/providers/groq-provider.js.map +1 -1
  273. package/dist/providers/groq-request.d.ts +38 -0
  274. package/dist/providers/groq-request.d.ts.map +1 -0
  275. package/dist/providers/groq-request.js +138 -0
  276. package/dist/providers/groq-request.js.map +1 -0
  277. package/dist/providers/higgsfield-provider.d.ts +31 -0
  278. package/dist/providers/higgsfield-provider.d.ts.map +1 -0
  279. package/dist/providers/higgsfield-provider.js +143 -0
  280. package/dist/providers/higgsfield-provider.js.map +1 -0
  281. package/dist/providers/higgsfield-transport.d.ts +106 -0
  282. package/dist/providers/higgsfield-transport.d.ts.map +1 -0
  283. package/dist/providers/higgsfield-transport.js +182 -0
  284. package/dist/providers/higgsfield-transport.js.map +1 -0
  285. package/dist/providers/http-transport.d.ts +74 -0
  286. package/dist/providers/http-transport.d.ts.map +1 -0
  287. package/dist/providers/http-transport.js +152 -0
  288. package/dist/providers/http-transport.js.map +1 -0
  289. package/dist/providers/huggingface-provider.d.ts +73 -4
  290. package/dist/providers/huggingface-provider.d.ts.map +1 -1
  291. package/dist/providers/huggingface-provider.js +240 -34
  292. package/dist/providers/huggingface-provider.js.map +1 -1
  293. package/dist/providers/image-mime.d.ts +39 -0
  294. package/dist/providers/image-mime.d.ts.map +1 -0
  295. package/dist/providers/image-mime.js +111 -0
  296. package/dist/providers/image-mime.js.map +1 -0
  297. package/dist/providers/image-ref.d.ts +21 -0
  298. package/dist/providers/image-ref.d.ts.map +1 -0
  299. package/dist/providers/image-ref.js +44 -0
  300. package/dist/providers/image-ref.js.map +1 -0
  301. package/dist/providers/index.d.ts +87 -8
  302. package/dist/providers/index.d.ts.map +1 -1
  303. package/dist/providers/index.js +250 -56
  304. package/dist/providers/index.js.map +1 -1
  305. package/dist/providers/jina-provider.d.ts +12 -3
  306. package/dist/providers/jina-provider.d.ts.map +1 -1
  307. package/dist/providers/jina-provider.js +21 -7
  308. package/dist/providers/jina-provider.js.map +1 -1
  309. package/dist/providers/kie-provider.d.ts +172 -10
  310. package/dist/providers/kie-provider.d.ts.map +1 -1
  311. package/dist/providers/kie-provider.js +1190 -228
  312. package/dist/providers/kie-provider.js.map +1 -1
  313. package/dist/providers/kie-webhook-registry.d.ts +28 -0
  314. package/dist/providers/kie-webhook-registry.d.ts.map +1 -0
  315. package/dist/providers/kie-webhook-registry.js +91 -0
  316. package/dist/providers/kie-webhook-registry.js.map +1 -0
  317. package/dist/providers/llama-provider.d.ts +23 -36
  318. package/dist/providers/llama-provider.d.ts.map +1 -1
  319. package/dist/providers/llama-provider.js +50 -355
  320. package/dist/providers/llama-provider.js.map +1 -1
  321. package/dist/providers/lmstudio-provider.d.ts +4 -7
  322. package/dist/providers/lmstudio-provider.d.ts.map +1 -1
  323. package/dist/providers/lmstudio-provider.js +24 -15
  324. package/dist/providers/lmstudio-provider.js.map +1 -1
  325. package/dist/providers/loop-tracing.d.ts +17 -0
  326. package/dist/providers/loop-tracing.d.ts.map +1 -0
  327. package/dist/providers/loop-tracing.js +132 -0
  328. package/dist/providers/loop-tracing.js.map +1 -0
  329. package/dist/providers/manifest-models.d.ts +341 -1
  330. package/dist/providers/manifest-models.d.ts.map +1 -1
  331. package/dist/providers/manifest-models.js +1106 -22
  332. package/dist/providers/manifest-models.js.map +1 -1
  333. package/dist/providers/media-mime.d.ts +14 -0
  334. package/dist/providers/media-mime.d.ts.map +1 -0
  335. package/dist/providers/media-mime.js +35 -0
  336. package/dist/providers/media-mime.js.map +1 -0
  337. package/dist/providers/meshy-provider.d.ts +16 -2
  338. package/dist/providers/meshy-provider.d.ts.map +1 -1
  339. package/dist/providers/meshy-provider.js +82 -46
  340. package/dist/providers/meshy-provider.js.map +1 -1
  341. package/dist/providers/meta-provider.d.ts +22 -0
  342. package/dist/providers/meta-provider.d.ts.map +1 -0
  343. package/dist/providers/meta-provider.js +54 -0
  344. package/dist/providers/meta-provider.js.map +1 -0
  345. package/dist/providers/minimax-provider.d.ts +27 -18
  346. package/dist/providers/minimax-provider.d.ts.map +1 -1
  347. package/dist/providers/minimax-provider.js +222 -72
  348. package/dist/providers/minimax-provider.js.map +1 -1
  349. package/dist/providers/mistral-provider.d.ts +8 -12
  350. package/dist/providers/mistral-provider.d.ts.map +1 -1
  351. package/dist/providers/mistral-provider.js +15 -34
  352. package/dist/providers/mistral-provider.js.map +1 -1
  353. package/dist/providers/moonshot-provider.d.ts +11 -15
  354. package/dist/providers/moonshot-provider.d.ts.map +1 -1
  355. package/dist/providers/moonshot-provider.js +33 -23
  356. package/dist/providers/moonshot-provider.js.map +1 -1
  357. package/dist/providers/node-llama-cpp-provider.d.ts +99 -0
  358. package/dist/providers/node-llama-cpp-provider.d.ts.map +1 -0
  359. package/dist/providers/node-llama-cpp-provider.js +484 -0
  360. package/dist/providers/node-llama-cpp-provider.js.map +1 -0
  361. package/dist/providers/nodetool-provider.d.ts +49 -0
  362. package/dist/providers/nodetool-provider.d.ts.map +1 -0
  363. package/dist/providers/nodetool-provider.js +222 -0
  364. package/dist/providers/nodetool-provider.js.map +1 -0
  365. package/dist/providers/oauth/browser-launcher.d.ts +23 -0
  366. package/dist/providers/oauth/browser-launcher.d.ts.map +1 -0
  367. package/dist/providers/oauth/browser-launcher.js +45 -0
  368. package/dist/providers/oauth/browser-launcher.js.map +1 -0
  369. package/dist/providers/oauth/claude-code-credentials.d.ts +74 -0
  370. package/dist/providers/oauth/claude-code-credentials.d.ts.map +1 -0
  371. package/dist/providers/oauth/claude-code-credentials.js +133 -0
  372. package/dist/providers/oauth/claude-code-credentials.js.map +1 -0
  373. package/dist/providers/oauth/claude-code-login.d.ts +124 -0
  374. package/dist/providers/oauth/claude-code-login.d.ts.map +1 -0
  375. package/dist/providers/oauth/claude-code-login.js +230 -0
  376. package/dist/providers/oauth/claude-code-login.js.map +1 -0
  377. package/dist/providers/oauth/claude-code-oauth-client.d.ts +111 -0
  378. package/dist/providers/oauth/claude-code-oauth-client.d.ts.map +1 -0
  379. package/dist/providers/oauth/claude-code-oauth-client.js +207 -0
  380. package/dist/providers/oauth/claude-code-oauth-client.js.map +1 -0
  381. package/dist/providers/oauth/errors.d.ts +54 -0
  382. package/dist/providers/oauth/errors.d.ts.map +1 -0
  383. package/dist/providers/oauth/errors.js +79 -0
  384. package/dist/providers/oauth/errors.js.map +1 -0
  385. package/dist/providers/oauth/index.d.ts +105 -0
  386. package/dist/providers/oauth/index.d.ts.map +1 -0
  387. package/dist/providers/oauth/index.js +167 -0
  388. package/dist/providers/oauth/index.js.map +1 -0
  389. package/dist/providers/oauth/jwt-claims.d.ts +23 -0
  390. package/dist/providers/oauth/jwt-claims.d.ts.map +1 -0
  391. package/dist/providers/oauth/jwt-claims.js +67 -0
  392. package/dist/providers/oauth/jwt-claims.js.map +1 -0
  393. package/dist/providers/oauth/local-callback-server.d.ts +60 -0
  394. package/dist/providers/oauth/local-callback-server.d.ts.map +1 -0
  395. package/dist/providers/oauth/local-callback-server.js +148 -0
  396. package/dist/providers/oauth/local-callback-server.js.map +1 -0
  397. package/dist/providers/oauth/oauth-client.d.ts +55 -0
  398. package/dist/providers/oauth/oauth-client.d.ts.map +1 -0
  399. package/dist/providers/oauth/oauth-client.js +161 -0
  400. package/dist/providers/oauth/oauth-client.js.map +1 -0
  401. package/dist/providers/oauth/openai-oauth-provider.d.ts +129 -0
  402. package/dist/providers/oauth/openai-oauth-provider.d.ts.map +1 -0
  403. package/dist/providers/oauth/openai-oauth-provider.js +265 -0
  404. package/dist/providers/oauth/openai-oauth-provider.js.map +1 -0
  405. package/dist/providers/oauth/pkce-helper.d.ts +43 -0
  406. package/dist/providers/oauth/pkce-helper.d.ts.map +1 -0
  407. package/dist/providers/oauth/pkce-helper.js +57 -0
  408. package/dist/providers/oauth/pkce-helper.js.map +1 -0
  409. package/dist/providers/oauth/redaction.d.ts +22 -0
  410. package/dist/providers/oauth/redaction.d.ts.map +1 -0
  411. package/dist/providers/oauth/redaction.js +59 -0
  412. package/dist/providers/oauth/redaction.js.map +1 -0
  413. package/dist/providers/oauth/secure-credential-store.d.ts +67 -0
  414. package/dist/providers/oauth/secure-credential-store.d.ts.map +1 -0
  415. package/dist/providers/oauth/secure-credential-store.js +73 -0
  416. package/dist/providers/oauth/secure-credential-store.js.map +1 -0
  417. package/dist/providers/oauth/token-store.d.ts +53 -0
  418. package/dist/providers/oauth/token-store.d.ts.map +1 -0
  419. package/dist/providers/oauth/token-store.js +78 -0
  420. package/dist/providers/oauth/token-store.js.map +1 -0
  421. package/dist/providers/oauth/types.d.ts +64 -0
  422. package/dist/providers/oauth/types.d.ts.map +1 -0
  423. package/dist/providers/oauth/types.js +12 -0
  424. package/dist/providers/oauth/types.js.map +1 -0
  425. package/dist/providers/object-tracking.d.ts +47 -0
  426. package/dist/providers/object-tracking.d.ts.map +1 -0
  427. package/dist/providers/object-tracking.js +46 -0
  428. package/dist/providers/object-tracking.js.map +1 -0
  429. package/dist/providers/offline-model-index.d.ts +20 -0
  430. package/dist/providers/offline-model-index.d.ts.map +1 -0
  431. package/dist/providers/offline-model-index.js +112 -0
  432. package/dist/providers/offline-model-index.js.map +1 -0
  433. package/dist/providers/ollama-provider.d.ts +30 -2
  434. package/dist/providers/ollama-provider.d.ts.map +1 -1
  435. package/dist/providers/ollama-provider.js +198 -43
  436. package/dist/providers/ollama-provider.js.map +1 -1
  437. package/dist/providers/openai-compat/client.d.ts +57 -0
  438. package/dist/providers/openai-compat/client.d.ts.map +1 -0
  439. package/dist/providers/openai-compat/client.js +157 -0
  440. package/dist/providers/openai-compat/client.js.map +1 -0
  441. package/dist/providers/openai-compat/decode.d.ts +36 -0
  442. package/dist/providers/openai-compat/decode.d.ts.map +1 -0
  443. package/dist/providers/openai-compat/decode.js +55 -0
  444. package/dist/providers/openai-compat/decode.js.map +1 -0
  445. package/dist/providers/openai-compat/errors.d.ts +54 -0
  446. package/dist/providers/openai-compat/errors.d.ts.map +1 -0
  447. package/dist/providers/openai-compat/errors.js +144 -0
  448. package/dist/providers/openai-compat/errors.js.map +1 -0
  449. package/dist/providers/openai-compat/index.d.ts +8 -0
  450. package/dist/providers/openai-compat/index.d.ts.map +1 -0
  451. package/dist/providers/openai-compat/index.js +5 -0
  452. package/dist/providers/openai-compat/index.js.map +1 -0
  453. package/dist/providers/openai-compat/sse.d.ts +14 -0
  454. package/dist/providers/openai-compat/sse.d.ts.map +1 -0
  455. package/dist/providers/openai-compat/sse.js +69 -0
  456. package/dist/providers/openai-compat/sse.js.map +1 -0
  457. package/dist/providers/openai-compat/types.d.ts +75 -0
  458. package/dist/providers/openai-compat/types.d.ts.map +1 -0
  459. package/dist/providers/openai-compat/types.js +9 -0
  460. package/dist/providers/openai-compat/types.js.map +1 -0
  461. package/dist/providers/openai-compat-provider.d.ts +90 -0
  462. package/dist/providers/openai-compat-provider.d.ts.map +1 -0
  463. package/dist/providers/openai-compat-provider.js +282 -0
  464. package/dist/providers/openai-compat-provider.js.map +1 -0
  465. package/dist/providers/openai-provider.d.ts +98 -27
  466. package/dist/providers/openai-provider.d.ts.map +1 -1
  467. package/dist/providers/openai-provider.js +1037 -105
  468. package/dist/providers/openai-provider.js.map +1 -1
  469. package/dist/providers/openrouter-provider.d.ts +58 -13
  470. package/dist/providers/openrouter-provider.d.ts.map +1 -1
  471. package/dist/providers/openrouter-provider.js +383 -51
  472. package/dist/providers/openrouter-provider.js.map +1 -1
  473. package/dist/providers/provider-call-failure.d.ts +39 -0
  474. package/dist/providers/provider-call-failure.d.ts.map +1 -0
  475. package/dist/providers/provider-call-failure.js +132 -0
  476. package/dist/providers/provider-call-failure.js.map +1 -0
  477. package/dist/providers/provider-error.d.ts +59 -0
  478. package/dist/providers/provider-error.d.ts.map +1 -0
  479. package/dist/providers/provider-error.js +171 -0
  480. package/dist/providers/provider-error.js.map +1 -0
  481. package/dist/providers/provider-generations.d.ts +99 -0
  482. package/dist/providers/provider-generations.d.ts.map +1 -0
  483. package/dist/providers/provider-generations.js +71 -0
  484. package/dist/providers/provider-generations.js.map +1 -0
  485. package/dist/providers/provider-queue.d.ts +62 -0
  486. package/dist/providers/provider-queue.d.ts.map +1 -0
  487. package/dist/providers/provider-queue.js +28 -0
  488. package/dist/providers/provider-queue.js.map +1 -0
  489. package/dist/providers/provider-registry.d.ts +33 -14
  490. package/dist/providers/provider-registry.d.ts.map +1 -1
  491. package/dist/providers/provider-registry.js +85 -68
  492. package/dist/providers/provider-registry.js.map +1 -1
  493. package/dist/providers/provider-request-log.d.ts +53 -0
  494. package/dist/providers/provider-request-log.d.ts.map +1 -0
  495. package/dist/providers/provider-request-log.js +168 -0
  496. package/dist/providers/provider-request-log.js.map +1 -0
  497. package/dist/providers/provider-session.d.ts +3 -0
  498. package/dist/providers/provider-session.d.ts.map +1 -0
  499. package/dist/providers/provider-session.js +10 -0
  500. package/dist/providers/provider-session.js.map +1 -0
  501. package/dist/providers/provider-transport.d.ts +11 -0
  502. package/dist/providers/provider-transport.d.ts.map +1 -0
  503. package/dist/providers/provider-transport.js +11 -0
  504. package/dist/providers/provider-transport.js.map +1 -0
  505. package/dist/providers/python-provider.d.ts +26 -13
  506. package/dist/providers/python-provider.d.ts.map +1 -1
  507. package/dist/providers/python-provider.js +204 -25
  508. package/dist/providers/python-provider.js.map +1 -1
  509. package/dist/providers/replicate-provider.d.ts +91 -8
  510. package/dist/providers/replicate-provider.d.ts.map +1 -1
  511. package/dist/providers/replicate-provider.js +823 -65
  512. package/dist/providers/replicate-provider.js.map +1 -1
  513. package/dist/providers/replicate-retry.d.ts +30 -0
  514. package/dist/providers/replicate-retry.d.ts.map +1 -0
  515. package/dist/providers/replicate-retry.js +97 -0
  516. package/dist/providers/replicate-retry.js.map +1 -0
  517. package/dist/providers/requesty-provider.d.ts +30 -0
  518. package/dist/providers/requesty-provider.d.ts.map +1 -0
  519. package/dist/providers/requesty-provider.js +87 -0
  520. package/dist/providers/requesty-provider.js.map +1 -0
  521. package/dist/providers/responses-api.d.ts +27 -0
  522. package/dist/providers/responses-api.d.ts.map +1 -0
  523. package/dist/providers/responses-api.js +297 -0
  524. package/dist/providers/responses-api.js.map +1 -0
  525. package/dist/providers/reve-provider.d.ts +46 -0
  526. package/dist/providers/reve-provider.d.ts.map +1 -0
  527. package/dist/providers/reve-provider.js +165 -0
  528. package/dist/providers/reve-provider.js.map +1 -0
  529. package/dist/providers/rodin-provider.d.ts +25 -2
  530. package/dist/providers/rodin-provider.d.ts.map +1 -1
  531. package/dist/providers/rodin-provider.js +95 -51
  532. package/dist/providers/rodin-provider.js.map +1 -1
  533. package/dist/providers/safe-url.d.ts +70 -0
  534. package/dist/providers/safe-url.d.ts.map +1 -0
  535. package/dist/providers/safe-url.js +277 -0
  536. package/dist/providers/safe-url.js.map +1 -0
  537. package/dist/providers/scripted-provider.d.ts +9 -0
  538. package/dist/providers/scripted-provider.d.ts.map +1 -1
  539. package/dist/providers/scripted-provider.js +86 -10
  540. package/dist/providers/scripted-provider.js.map +1 -1
  541. package/dist/providers/structured-output.d.ts +42 -0
  542. package/dist/providers/structured-output.d.ts.map +1 -0
  543. package/dist/providers/structured-output.js +83 -0
  544. package/dist/providers/structured-output.js.map +1 -0
  545. package/dist/providers/together-operations.d.ts +27 -0
  546. package/dist/providers/together-operations.d.ts.map +1 -0
  547. package/dist/providers/together-operations.js +95 -0
  548. package/dist/providers/together-operations.js.map +1 -0
  549. package/dist/providers/together-provider.d.ts +18 -18
  550. package/dist/providers/together-provider.d.ts.map +1 -1
  551. package/dist/providers/together-provider.js +140 -367
  552. package/dist/providers/together-provider.js.map +1 -1
  553. package/dist/providers/topaz-provider.d.ts +45 -0
  554. package/dist/providers/topaz-provider.d.ts.map +1 -0
  555. package/dist/providers/topaz-provider.js +244 -0
  556. package/dist/providers/topaz-provider.js.map +1 -0
  557. package/dist/providers/types.d.ts +641 -4
  558. package/dist/providers/types.d.ts.map +1 -1
  559. package/dist/providers/types.js +81 -1
  560. package/dist/providers/types.js.map +1 -1
  561. package/dist/providers/useapi-provider.d.ts +28 -0
  562. package/dist/providers/useapi-provider.d.ts.map +1 -0
  563. package/dist/providers/useapi-provider.js +274 -0
  564. package/dist/providers/useapi-provider.js.map +1 -0
  565. package/dist/providers/video-duration.d.ts +6 -0
  566. package/dist/providers/video-duration.d.ts.map +1 -0
  567. package/dist/providers/video-duration.js +63 -0
  568. package/dist/providers/video-duration.js.map +1 -0
  569. package/dist/providers/video-frame-fallback.d.ts +39 -0
  570. package/dist/providers/video-frame-fallback.d.ts.map +1 -0
  571. package/dist/providers/video-frame-fallback.js +155 -0
  572. package/dist/providers/video-frame-fallback.js.map +1 -0
  573. package/dist/providers/video-frames.d.ts +61 -0
  574. package/dist/providers/video-frames.d.ts.map +1 -0
  575. package/dist/providers/video-frames.js +208 -0
  576. package/dist/providers/video-frames.js.map +1 -0
  577. package/dist/providers/video-mime.d.ts +14 -0
  578. package/dist/providers/video-mime.d.ts.map +1 -0
  579. package/dist/providers/video-mime.js +44 -0
  580. package/dist/providers/video-mime.js.map +1 -0
  581. package/dist/providers/video-to-audio.d.ts +34 -0
  582. package/dist/providers/video-to-audio.d.ts.map +1 -0
  583. package/dist/providers/video-to-audio.js +62 -0
  584. package/dist/providers/video-to-audio.js.map +1 -0
  585. package/dist/providers/vllm-provider.d.ts +20 -8
  586. package/dist/providers/vllm-provider.d.ts.map +1 -1
  587. package/dist/providers/vllm-provider.js +44 -23
  588. package/dist/providers/vllm-provider.js.map +1 -1
  589. package/dist/providers/voyage-provider.d.ts +12 -3
  590. package/dist/providers/voyage-provider.d.ts.map +1 -1
  591. package/dist/providers/voyage-provider.js +21 -7
  592. package/dist/providers/voyage-provider.js.map +1 -1
  593. package/dist/providers/xai-provider.d.ts +56 -13
  594. package/dist/providers/xai-provider.d.ts.map +1 -1
  595. package/dist/providers/xai-provider.js +307 -22
  596. package/dist/providers/xai-provider.js.map +1 -1
  597. package/dist/python-bridge-base.d.ts +358 -0
  598. package/dist/python-bridge-base.d.ts.map +1 -0
  599. package/dist/python-bridge-base.js +1557 -0
  600. package/dist/python-bridge-base.js.map +1 -0
  601. package/dist/python-bridge-codec.d.ts +28 -0
  602. package/dist/python-bridge-codec.d.ts.map +1 -0
  603. package/dist/python-bridge-codec.js +39 -0
  604. package/dist/python-bridge-codec.js.map +1 -0
  605. package/dist/python-bridge-factory.d.ts +52 -0
  606. package/dist/python-bridge-factory.d.ts.map +1 -0
  607. package/dist/python-bridge-factory.js +69 -0
  608. package/dist/python-bridge-factory.js.map +1 -0
  609. package/dist/python-bridge-framing.d.ts +68 -0
  610. package/dist/python-bridge-framing.d.ts.map +1 -0
  611. package/dist/python-bridge-framing.js +91 -0
  612. package/dist/python-bridge-framing.js.map +1 -0
  613. package/dist/python-bridge-types.d.ts +545 -2
  614. package/dist/python-bridge-types.d.ts.map +1 -1
  615. package/dist/python-bridge-types.js +49 -1
  616. package/dist/python-bridge-types.js.map +1 -1
  617. package/dist/python-graph-resolver.d.ts +57 -0
  618. package/dist/python-graph-resolver.d.ts.map +1 -0
  619. package/dist/python-graph-resolver.js +79 -0
  620. package/dist/python-graph-resolver.js.map +1 -0
  621. package/dist/python-node-executor.d.ts +36 -4
  622. package/dist/python-node-executor.d.ts.map +1 -1
  623. package/dist/python-node-executor.js +177 -86
  624. package/dist/python-node-executor.js.map +1 -1
  625. package/dist/python-stdio-bridge.d.ts +18 -37
  626. package/dist/python-stdio-bridge.d.ts.map +1 -1
  627. package/dist/python-stdio-bridge.js +148 -475
  628. package/dist/python-stdio-bridge.js.map +1 -1
  629. package/dist/python-websocket-bridge.d.ts +140 -0
  630. package/dist/python-websocket-bridge.d.ts.map +1 -0
  631. package/dist/python-websocket-bridge.js +561 -0
  632. package/dist/python-websocket-bridge.js.map +1 -0
  633. package/dist/python-worker-stderr.d.ts +4 -0
  634. package/dist/python-worker-stderr.d.ts.map +1 -0
  635. package/dist/python-worker-stderr.js +24 -0
  636. package/dist/python-worker-stderr.js.map +1 -0
  637. package/dist/recommended-models.d.ts +2 -2
  638. package/dist/recommended-models.d.ts.map +1 -1
  639. package/dist/recommended-models.js +44 -4
  640. package/dist/recommended-models.js.map +1 -1
  641. package/dist/recoverable-node-error.d.ts +31 -0
  642. package/dist/recoverable-node-error.d.ts.map +1 -0
  643. package/dist/recoverable-node-error.js +37 -0
  644. package/dist/recoverable-node-error.js.map +1 -0
  645. package/dist/redact-params.d.ts +13 -0
  646. package/dist/redact-params.d.ts.map +1 -0
  647. package/dist/redact-params.js +57 -0
  648. package/dist/redact-params.js.map +1 -0
  649. package/dist/run-context.d.ts +20 -0
  650. package/dist/run-context.d.ts.map +1 -0
  651. package/dist/run-context.js +18 -0
  652. package/dist/run-context.js.map +1 -0
  653. package/dist/run-trace-context.d.ts +30 -0
  654. package/dist/run-trace-context.d.ts.map +1 -0
  655. package/dist/run-trace-context.js +80 -0
  656. package/dist/run-trace-context.js.map +1 -0
  657. package/dist/run-trace-processor.d.ts +65 -0
  658. package/dist/run-trace-processor.d.ts.map +1 -0
  659. package/dist/run-trace-processor.js +417 -0
  660. package/dist/run-trace-processor.js.map +1 -0
  661. package/dist/run-trace-serialization.d.ts +5 -0
  662. package/dist/run-trace-serialization.d.ts.map +1 -0
  663. package/dist/run-trace-serialization.js +113 -0
  664. package/dist/run-trace-serialization.js.map +1 -0
  665. package/dist/sandbox-module-catalog.d.ts +43 -0
  666. package/dist/sandbox-module-catalog.d.ts.map +1 -0
  667. package/dist/sandbox-module-catalog.js +25 -0
  668. package/dist/sandbox-module-catalog.js.map +1 -0
  669. package/dist/storage-workspace.d.ts +62 -0
  670. package/dist/storage-workspace.d.ts.map +1 -0
  671. package/dist/storage-workspace.js +441 -0
  672. package/dist/storage-workspace.js.map +1 -0
  673. package/dist/swappable-python-bridge.d.ts +83 -0
  674. package/dist/swappable-python-bridge.d.ts.map +1 -0
  675. package/dist/swappable-python-bridge.js +246 -0
  676. package/dist/swappable-python-bridge.js.map +1 -0
  677. package/dist/telemetry.d.ts +16 -3
  678. package/dist/telemetry.d.ts.map +1 -1
  679. package/dist/telemetry.js +76 -20
  680. package/dist/telemetry.js.map +1 -1
  681. package/dist/testing.d.ts +81 -0
  682. package/dist/testing.d.ts.map +1 -0
  683. package/dist/testing.js +130 -0
  684. package/dist/testing.js.map +1 -0
  685. package/dist/token-counter.d.ts +30 -0
  686. package/dist/token-counter.d.ts.map +1 -0
  687. package/dist/token-counter.js +156 -0
  688. package/dist/token-counter.js.map +1 -0
  689. package/dist/trace-exporters.d.ts +11 -28
  690. package/dist/trace-exporters.d.ts.map +1 -1
  691. package/dist/trace-exporters.js +69 -22
  692. package/dist/trace-exporters.js.map +1 -1
  693. package/dist/tracing-helpers.d.ts +60 -26
  694. package/dist/tracing-helpers.d.ts.map +1 -1
  695. package/dist/tracing-helpers.js +100 -25
  696. package/dist/tracing-helpers.js.map +1 -1
  697. package/dist/trim-video-window.d.ts +8 -0
  698. package/dist/trim-video-window.d.ts.map +1 -0
  699. package/dist/trim-video-window.js +50 -0
  700. package/dist/trim-video-window.js.map +1 -0
  701. package/dist/turn-budget.d.ts +278 -0
  702. package/dist/turn-budget.d.ts.map +1 -0
  703. package/dist/turn-budget.js +365 -0
  704. package/dist/turn-budget.js.map +1 -0
  705. package/dist/variable-channel.d.ts +48 -0
  706. package/dist/variable-channel.d.ts.map +1 -0
  707. package/dist/variable-channel.js +110 -0
  708. package/dist/variable-channel.js.map +1 -0
  709. package/dist/workspace.d.ts +119 -0
  710. package/dist/workspace.d.ts.map +1 -0
  711. package/dist/workspace.js +112 -0
  712. package/dist/workspace.js.map +1 -0
  713. package/package.json +121 -19
@@ -1,36 +1,256 @@
1
- import type { ASRModel, EmbeddingModel, ImageModel, ImageTo3DParams, ImageToImageParams, ImageToVideoParams, LanguageModel, Message, Model3D, ProviderId, ProviderStreamItem, ProviderTool, EncodedAudioResult, StreamingAudioChunk, TextTo3DParams, TextToImageParams, TextToVideoParams, ToolCall, TTSModel, VideoModel } from "./types.js";
1
+ import type { ASRModel, EmbeddingModel, ImageModel, ImageTo3DParams, ImageToImageParams, InpaintingParams, ImageToVideoParams, ReferenceToVideoInputs, ReferenceToVideoParams, LanguageModel, LipSyncParams, InterpolateVideoParams, Message, MessageContent, Model3D, MusicModel, AudioToAudioModel, AudioToAudioParams, ProviderId, ProviderSession, ProviderStop, ProviderStreamItem, ProviderThinkingConfig, ProviderEffort, ProviderTool, ProviderSkill, ProviderToolResult, EncodedAudioResult, TextToMusicParams, TextToSpeechParams, RelightImageParams, RemoveBackgroundParams, EstimateDepthParams, RerankModel, RerankParams, RerankResult, SegmentImageParams, ImageSegmentationMask, StreamingAudioChunk, TextTo3DParams, TextToImageParams, TextToVideoParams, ToolCall, TTSModel, OutpaintImageParams, OutpaintVideoParams, UpscaleImageParams, UpscaleVideoParams, VectorizeImageParams, VideoModel, VideoToVideoParams, ExtendVideoParams } from "./types.js";
2
+ import type { ProviderGeneration, ProviderGenerationLookup, ProviderGenerationPage, ProviderGenerationQuery } from "./provider-generations.js";
3
+ import type { VideoToAudioParams } from "./video-to-audio.js";
4
+ import type { ObjectTrackingParams, ObjectTrackingResult } from "./object-tracking.js";
2
5
  import type { UsageInfo } from "./cost-calculator.js";
6
+ import type { RunBudget, TurnBudget, TurnReservationHandle } from "../turn-budget.js";
7
+ import { type ProviderCallFailureInput } from "./provider-call-failure.js";
8
+ /**
9
+ * Split the `turnBudget` argument into the run-level bounds (when the caller
10
+ * passed a {@link RunBudget}) and the per-turn admission object every loop
11
+ * reserves against. One argument serves both, so callers holding only a bare
12
+ * {@link TurnBudget} — the supervisor — keep working unchanged.
13
+ *
14
+ * A free function rather than a method: `generateLoop` is called unbound on
15
+ * duck-typed test providers (`BaseProvider.prototype.generateLoop.call(mock)`),
16
+ * where `this` has no class methods.
17
+ */
18
+ export declare function resolveTurnBudget(budget: TurnBudget | RunBudget | undefined): {
19
+ runBudget: RunBudget | null;
20
+ turnBudget: TurnBudget | undefined;
21
+ };
22
+ /**
23
+ * The stop item for a refused turn. A {@link RunBudget} says which ceiling
24
+ * refused it; a bare {@link TurnBudget} only knows that one did.
25
+ */
26
+ export declare function budgetStopItem(runBudget: RunBudget | null): ProviderStop;
27
+ /**
28
+ * Collapse a tool result to plain text. Used by string-only tool channels (the
29
+ * legacy inline callback, the Claude Agent SDK's MCP tools) when a tool returns
30
+ * {@link MessageContent} blocks they can't render — keep the text, drop images.
31
+ */
32
+ export declare function toolResultToText(result: string | MessageContent[]): string;
33
+ /**
34
+ * Split a tool result into the text that belongs in the `role:"tool"` message
35
+ * and, when the result carries images, a follow-up `role:"user"` message that
36
+ * actually carries the pixels.
37
+ *
38
+ * Most providers cannot render an image inside a tool-result message — OpenAI
39
+ * stringifies it to a base64 *text* blob (massive token blowup, and the model
40
+ * never sees an image). An image content block is only honored on a user (or
41
+ * assistant) message, so image-bearing tool results must ride a user message.
42
+ * Returns `imageMessage: null` for plain (text/no-image) results.
43
+ */
44
+ export type ToolResultSplit = {
45
+ toolContent: string | MessageContent[];
46
+ imageMessage: Message | null;
47
+ };
48
+ export declare function splitToolResultImages(result: string | MessageContent[]): ToolResultSplit;
3
49
  /**
4
50
  * Capability names a provider can expose. These correspond to the `capability`
5
51
  * strings consumed by client-side filters like `useImageModelProviders`,
6
52
  * `useTTSProviders`, etc.
7
53
  */
8
- export type ProviderCapability = "generate_message" | "generate_messages" | "text_to_image" | "image_to_image" | "text_to_video" | "image_to_video" | "text_to_speech" | "automatic_speech_recognition" | "generate_embedding" | "text_to_3d" | "image_to_3d";
54
+ export type ProviderCapability = "generate_message" | "generate_messages" | "text_to_image" | "image_to_image" | "inpainting" | "outpaint_image" | "upscale_image" | "remove_background" | "relight_image" | "segment_image" | "vectorize_image" | "estimate_depth" | "text_to_video" | "image_to_video" | "reference_to_video" | "video_to_video" | "extend_video" | "upscale_video" | "interpolate_video" | "outpaint_video" | "lip_sync" | "text_to_speech" | "text_to_music" | "audio_to_audio" | "video_to_audio" | "automatic_speech_recognition" | "generate_embedding" | "rerank" | "text_to_3d" | "image_to_3d" | "list_generations" | "get_generation" | "track_object";
9
55
  /**
10
- * Derive a provider's capability set by checking which optional `getAvailable*`
11
- * methods it overrides on its prototype. Every provider can always generate
12
- * messages; image/video/TTS/ASR/embedding are advertised only when the concrete
13
- * class overrides the matching base method.
56
+ * Prompt tokens a turn will send, for reservation purposes. Deliberately a
57
+ * rough count: a reservation is a worst case, and a per-provider exact count
58
+ * would cost a tokenizer round-trip per turn to refine a number that only has
59
+ * to be an upper-ish bound.
14
60
  *
15
- * Shared by `packages/websocket/src/models-api.ts` (REST leftover) and the
16
- * `models` tRPC router so both report identical capabilities for the same
17
- * provider instance.
61
+ * Text is tokenized. Media blocks get a fixed per-modality figure, so an
62
+ * inlined `data:` uri is never fed to the tokenizer.
63
+ */
64
+ export declare function estimatePromptTokens(messages: readonly Message[]): number;
65
+ /**
66
+ * Running token counts for one provider instance, alongside its running
67
+ * `cost`. A caller that owns a stretch of work — a workflow node driving
68
+ * `generateLoop` — takes a before/after snapshot and reports the difference as
69
+ * that node's spend. Monotonic until {@link BaseProvider.resetCost}.
18
70
  */
19
- export declare function providerCapabilities(instance: BaseProvider): ProviderCapability[];
71
+ export interface ProviderUsageTotals {
72
+ inputTokens: number;
73
+ outputTokens: number;
74
+ cachedTokens: number;
75
+ }
20
76
  export declare abstract class BaseProvider {
21
77
  readonly provider: ProviderId;
22
78
  private _cost;
79
+ private _usageTotals;
80
+ private _unpricedReason;
81
+ private _lastCallTokens;
23
82
  private _emitMessage;
83
+ /**
84
+ * Whether this provider has a built-in, server-side web search it runs
85
+ * itself (e.g. Anthropic's `web_search_20250305` server tool, the Claude
86
+ * Agent SDK's `WebSearch`). When `true`, a tool named
87
+ * {@link WEB_SEARCH_TOOL_NAME} is fulfilled by the provider natively rather
88
+ * than the SerpAPI-backed `WebSearchTool`. Default `false` (use the fallback).
89
+ */
90
+ get supportsNativeWebSearch(): boolean;
91
+ /**
92
+ * Whether this provider has a built-in, server-side image generator (e.g.
93
+ * the OpenAI Responses `image_generation` tool). When `true`, a tool named
94
+ * {@link IMAGE_GENERATION_TOOL_NAME} is rendered as the provider's native
95
+ * tool — its result arrives as image content on the assistant message, not
96
+ * as a function-call round-trip. Default `false` (use the fallback function
97
+ * tool).
98
+ */
99
+ get supportsNativeImageGeneration(): boolean;
100
+ /**
101
+ * Whether this provider's chat API accepts a `video` content part. Only
102
+ * providers that read a whole clip natively answer `true` — an
103
+ * OpenAI-compatible endpoint re-hosting a video-capable model (AtlasCloud
104
+ * serving `google/gemini-2.5-flash`, say) does not, because the wire format
105
+ * has nowhere to put the bytes. Default `false`.
106
+ */
107
+ get supportsVideoInput(): boolean;
24
108
  setMessageEmitter(fn: (msg: unknown) => void): void;
25
109
  protected emitMessage(msg: unknown): void;
110
+ /**
111
+ * Report one non-chat provider call (image, video, speech, ASR, embedding…)
112
+ * as an `llm_call` so the trace shows every provider call, not only chat.
113
+ * Carries no token counts: those modalities bill per unit, not per token.
114
+ * @internal
115
+ */
116
+ recordModalityCall(input: {
117
+ operation: string;
118
+ args: unknown[];
119
+ startedAt: number;
120
+ error?: unknown;
121
+ }): void;
122
+ /**
123
+ * Record a failed provider call: a server-side log with the exact request,
124
+ * and a `provider_call_failed` message so the surface showing the failure
125
+ * can report it without the user copying a status code out of a toast.
126
+ *
127
+ * One call, so the log and the report can never disagree about what failed.
128
+ * Public because the modality generator wrapper below is a free function.
129
+ * @internal
130
+ */
131
+ recordCallFailure(input: Omit<ProviderCallFailureInput, "provider">): void;
132
+ /**
133
+ * Record the exact payload this provider is about to send to the upstream
134
+ * API. Call this right before the network request in `generateMessage` /
135
+ * `generateMessages`. On failure, the traced wrappers log precisely what was
136
+ * sent (secrets redacted, large fields truncated). Safe to call even outside
137
+ * a traced call — it is a no-op when no capture slot is active.
138
+ */
139
+ protected recordRequestPayload(payload: unknown): void;
26
140
  protected constructor(provider: ProviderId);
141
+ /**
142
+ * Chat already records what it sent and logs it on failure through
143
+ * {@link generateMessageTraced} / {@link generateMessagesTraced}. The
144
+ * non-chat modalities (image/video/audio/3D/embedding) are called directly,
145
+ * so wrap every one a concrete provider actually overrides with the same
146
+ * central failure logging.
147
+ *
148
+ * We replace methods on the instance (not the prototype), and only the ones
149
+ * that differ from the base — so an unsupported modality keeps its base
150
+ * "does not support" throw and never logs a spurious failure. Providers may
151
+ * additionally call {@link recordRequestPayload} to log the exact wire body;
152
+ * otherwise the call arguments are logged (binary buffers reduced to size
153
+ * markers, secrets redacted).
154
+ */
155
+ private installModalityFailureLogging;
156
+ /**
157
+ * Make a `video` content part readable by a provider whose chat API has no
158
+ * place to put one: sample the clip into stills and send those instead.
159
+ *
160
+ * Wrapping the instance's own methods (the pattern
161
+ * {@link installModalityFailureLogging} uses) is what makes it transparent.
162
+ * Not every caller goes through the traced wrappers — `packages/llm-nodes`
163
+ * and the jtbd optimizer call `generateMessages` straight — and a seam only
164
+ * some callers pass through is not a fallback, it is a coin flip.
165
+ *
166
+ * A provider that reads video natively is left alone, and so is one whose
167
+ * `generateMessage` delegates to its own `generateMessages`: by then the
168
+ * video parts are already frames, and the second pass is a no-op.
169
+ */
170
+ private installVideoFrameFallback;
171
+ /**
172
+ * The messages to actually send: unchanged unless this provider cannot take
173
+ * video and the conversation carries some.
174
+ */
175
+ private sampleVideoAsFrames;
27
176
  static requiredSecrets(): string[];
177
+ /**
178
+ * Why this provider cannot serve a call right now, or `null` when it can.
179
+ *
180
+ * The credential check (`isProviderConfigured`) runs before a provider is
181
+ * ever constructed, so a provider that reaches this point has its keys. This
182
+ * answers what a key cannot: an optional SDK nobody installed, a local
183
+ * runtime the host lacks. `find_model` and `list_models` read it, so a model
184
+ * nothing here can run is not offered as the best match — the failure lands
185
+ * on the discovery call instead of on the paid generation call.
186
+ */
187
+ unavailableReason(): Promise<string | null>;
188
+ /**
189
+ * The operations beyond chat that this provider implements. Each concrete
190
+ * provider lists its own; the base implements none. A capability belongs
191
+ * here only when the matching method has a working implementation.
192
+ */
193
+ protected declaredCapabilities(): readonly ProviderCapability[];
194
+ /**
195
+ * The capabilities this provider exposes: chat generation, which every
196
+ * provider has, plus its {@link declaredCapabilities}.
197
+ */
198
+ getCapabilities(): ProviderCapability[];
199
+ /**
200
+ * The provider's own record of the generations this account ran, newest
201
+ * first. Only providers with a request-history API override this; the base
202
+ * throws {@link ProviderGenerationsUnsupportedError} so a caller can tell
203
+ * "this provider cannot answer" from "this provider ran nothing".
204
+ *
205
+ * This is the provider's truth, not NodeTool's: it covers generations made
206
+ * outside this installation and carries the billed cost rather than the
207
+ * estimate the local row holds until reconciliation.
208
+ */
209
+ listGenerations(_query?: ProviderGenerationQuery): Promise<ProviderGenerationPage>;
210
+ /**
211
+ * One generation at the provider, by the provider's own request id — the id
212
+ * the local row keeps as `provider_request_id`. Returns null when the
213
+ * provider answers that it has no such request. Throws
214
+ * {@link ProviderGenerationsUnsupportedError} when the provider has no
215
+ * lookup API at all.
216
+ */
217
+ getGeneration(_requestId: string, _options?: ProviderGenerationLookup): Promise<ProviderGeneration | null>;
28
218
  getContainerEnv(): Record<string, string>;
219
+ /**
220
+ * Release any resources held by this provider (HTTP connection pools, cached
221
+ * model metadata, child processes, etc.). Default is a no-op; providers that
222
+ * hold long-lived resources should override it. Safe to call more than once.
223
+ * Callers that own a provider instance should invoke this on shutdown.
224
+ */
225
+ close(): Promise<void>;
29
226
  hasToolSupport(_model: string): Promise<boolean>;
227
+ /**
228
+ * The input window, in tokens, this provider's own API reports for `model`,
229
+ * or null when it has no such endpoint. Callers go through
230
+ * `resolveContextWindow`, which falls back to models.dev.
231
+ */
232
+ getContextWindow(_model: string): Promise<number | null>;
30
233
  trackUsage(model: string, usage: UsageInfo): number;
234
+ /**
235
+ * Why this provider's cost total is missing spend, when a price lookup
236
+ * failed. Null when every tracked call was priced. A host writing a ledger
237
+ * row reads it to record the row as unpriced (`cost: null`) instead of
238
+ * booking an unpriced call as free.
239
+ */
240
+ get unpricedReason(): string | null;
31
241
  /** Alias for getTotalCost() — mirrors Python's BaseProvider.cost property. */
32
242
  get cost(): number;
33
243
  getTotalCost(): number;
244
+ /**
245
+ * Input (cache reads and writes included) plus output tokens of the most
246
+ * recent tracked call, as the provider reported them. The prompt of the next
247
+ * call on the same transcript is at least this large, and unlike a local
248
+ * estimate it counts the tool definitions and system prompt too. Null until
249
+ * a call reports usage.
250
+ */
251
+ get lastCallTokens(): number | null;
252
+ /** Running token counts across every call tracked on this instance. */
253
+ get usageTotals(): ProviderUsageTotals;
34
254
  /**
35
255
  * Log a provider call for cost tracking.
36
256
  * Base implementation logs to debug; subclasses or callers may persist to a Prediction model.
@@ -48,7 +268,23 @@ export declare abstract class BaseProvider {
48
268
  getAvailableVideoModels(): Promise<VideoModel[]>;
49
269
  getAvailableTTSModels(): Promise<TTSModel[]>;
50
270
  getAvailableASRModels(): Promise<ASRModel[]>;
271
+ /**
272
+ * Music **generation** models exposed by this provider (e.g. MusicGen,
273
+ * Stable Audio, Suno, MiniMax Music). Override on providers that can
274
+ * synthesize music from a text prompt; the base returns none so the
275
+ * `text_to_music` capability is advertised only when overridden.
276
+ */
277
+ getAvailableMusicModels(): Promise<MusicModel[]>;
278
+ /**
279
+ * Audio **transform** models exposed by this provider (voice changers, stem
280
+ * separators, denoisers, audio super-resolution). Override on providers that
281
+ * can rewrite a recording; the base returns none so the `audio_to_audio`
282
+ * capability is advertised only when overridden.
283
+ */
284
+ getAvailableAudioToAudioModels(): Promise<AudioToAudioModel[]>;
51
285
  getAvailableEmbeddingModels(): Promise<EmbeddingModel[]>;
286
+ /** Reranking models exposed by this provider. */
287
+ getAvailableRerankModels(): Promise<RerankModel[]>;
52
288
  /**
53
289
  * 3D **generation** models exposed by this provider (e.g. Meshy's `meshy-4`,
54
290
  * Rodin's `rodin-regular`). Override on providers that can synthesize 3D
@@ -66,8 +302,16 @@ export declare abstract class BaseProvider {
66
302
  topP?: number;
67
303
  presencePenalty?: number;
68
304
  frequencyPenalty?: number;
305
+ thinking?: ProviderThinkingConfig;
306
+ effort?: ProviderEffort;
69
307
  /** Optional thread/conversation identifier for session-based providers. */
70
308
  threadId?: string | null;
309
+ /**
310
+ * Opaque continuation token from a prior turn (read off the last assistant
311
+ * message). Providers that support server/SDK-side sessions resume from it
312
+ * and send only the delta; stateless providers ignore it.
313
+ */
314
+ providerSession?: ProviderSession | null;
71
315
  /** Optional callback for native tool execution (used by providers with in-process MCP). */
72
316
  onToolCall?: (name: string, args: Record<string, unknown>) => Promise<string>;
73
317
  /** Optional signal to abort the request. */
@@ -82,7 +326,7 @@ export declare abstract class BaseProvider {
82
326
  maxTokens?: number;
83
327
  /**
84
328
  * Upper bound on internal agentic turns for providers that handle
85
- * multi-turn tool execution within a single call (e.g. claude_agent).
329
+ * multi-turn tool execution within a single call.
86
330
  * Ignored by providers that delegate the loop to the caller.
87
331
  */
88
332
  maxTurns?: number;
@@ -90,9 +334,25 @@ export declare abstract class BaseProvider {
90
334
  topP?: number;
91
335
  presencePenalty?: number;
92
336
  frequencyPenalty?: number;
337
+ thinking?: ProviderThinkingConfig;
338
+ effort?: ProviderEffort;
93
339
  audio?: Record<string, unknown>;
94
340
  /** Optional thread/conversation identifier for session-based providers. */
95
341
  threadId?: string | null;
342
+ /**
343
+ * Opaque continuation token from a prior turn (read off the last assistant
344
+ * message). Providers that support server/SDK-side sessions resume from it
345
+ * and send only the delta; stateless providers ignore it.
346
+ */
347
+ providerSession?: ProviderSession | null;
348
+ /**
349
+ * Lazily fetch the full conversation. When a session-based provider is
350
+ * handed only the new delta in `messages` (to avoid reloading the whole
351
+ * thread), it calls this to recover the complete history if it must prime
352
+ * context — i.e. when a resume fails or the system prompt changed. Absent
353
+ * when `messages` already holds the full history.
354
+ */
355
+ loadFullHistory?: () => Promise<Message[]>;
96
356
  /** Optional callback for native tool execution (used by providers with in-process MCP). */
97
357
  onToolCall?: (name: string, args: Record<string, unknown>) => Promise<string>;
98
358
  /** Optional signal to abort the request. */
@@ -103,6 +363,125 @@ export declare abstract class BaseProvider {
103
363
  private applyLlmRequestAttributes;
104
364
  /** Traced wrapper around generateMessages. Use this instead of calling generateMessages directly. */
105
365
  generateMessagesTraced(args: Parameters<this["generateMessages"]>[0]): AsyncGenerator<ProviderStreamItem>;
366
+ /**
367
+ * Run the agentic tool-calling loop and stream its events. This is the entry
368
+ * point an agent harness calls; the harness no longer implements the loop
369
+ * itself. The default implementation drives the standard external loop:
370
+ * stream one {@link generateMessages} turn, collect any tool calls, run them
371
+ * via the harness-supplied {@link executeTool}, append the results, and repeat
372
+ * until the model stops calling tools (or `maxIterations` is hit).
373
+ *
374
+ * It yields the same {@link Chunk}/{@link ToolCall}/{@link ProviderSessionUpdate}
375
+ * items a single turn does — for live display — plus a
376
+ * {@link ProviderMessageEvent} for every finalized message (assistant turns
377
+ * and tool results) so the harness can persist/collect them without
378
+ * reassembling them from chunks.
379
+ *
380
+ * Providers whose backend runs its own agent loop (e.g. the Claude Agent SDK)
381
+ * override this to drive that loop instead, while still emitting the same
382
+ * stream items. `generateMessages` remains the single-turn primitive.
383
+ */
384
+ /**
385
+ * Ask a {@link TurnBudget} to admit the turn that is about to be made.
386
+ * Exposed to subclasses because a provider driving a backend's own agent
387
+ * loop has to make the same call at the same point.
388
+ *
389
+ * Answers the reservation to hand back to `commit` after the turn, or `null`
390
+ * when the budget refused. The handle belongs to this turn alone: another
391
+ * loop sharing the budget settles its own.
392
+ */
393
+ protected _admitTurn(budget: TurnBudget, model: string, messages: readonly Message[]): TurnReservationHandle | null;
394
+ generateLoop(args: Parameters<this["generateMessages"]>[0] & {
395
+ /**
396
+ * Execute one tool call and return the result to feed back to the model
397
+ * (and to store in the tool message). Usually result text; a tool may
398
+ * instead return {@link MessageContent} blocks (e.g. an image) for
399
+ * vision-capable providers. The harness owns tool resolution, gating, and
400
+ * side effects; the provider only orchestrates.
401
+ */
402
+ executeTool?: (toolCall: ToolCall) => Promise<ProviderToolResult>;
403
+ /** Cap on tool-calling rounds before stopping. Defaults to 25. */
404
+ maxIterations?: number;
405
+ /**
406
+ * Run a turn's tool calls one at a time (in array order) instead of in
407
+ * parallel. Required by consumers whose tools mutate shared state per call
408
+ * and read it back before the next (e.g. the planner's plan builder), and
409
+ * by consumers that abort the loop from inside a terminal tool. Defaults to
410
+ * false (parallel) to keep chat's concurrent tool execution fast.
411
+ */
412
+ sequentialTools?: boolean;
413
+ /**
414
+ * Restrict this loop to the supplied tools. Defaults to false, retaining
415
+ * provider-specific tool defaults. Overrides must not add implicit native
416
+ * tools or skill tools outside the supplied set when true.
417
+ */
418
+ providedToolsOnly?: boolean;
419
+ /**
420
+ * Spend admission, consulted before every model turn. A refusal ends the
421
+ * loop without making the call.
422
+ *
423
+ * **Contract for overrides.** A provider that overrides `generateLoop`
424
+ * to drive a backend's own agent loop must call {@link _admitTurn}
425
+ * before each model turn and `commit` after it — a ceiling only holds
426
+ * where the turns are, and an override that ignores this makes the cap
427
+ * advisory for every model it serves. Both current overrides honor it
428
+ * (the Claude Agent SDK loop and OpenAI's Responses loop). TypeScript
429
+ * cannot enforce this, so a new override that owns its turns owns this
430
+ * too — including yielding one {@link ProviderStop} as its final item
431
+ * when a refusal, rather than the model, ended the loop. Returning
432
+ * silently reads to every consumer as a finished answer.
433
+ *
434
+ * Accepts a {@link RunBudget} as well, and then also honors that run's
435
+ * deadline and cumulative turn count; the stop item names which ceiling
436
+ * refused the turn.
437
+ *
438
+ * Reserve against the *evolving* transcript, not the opening prompt: a
439
+ * backend that keeps the conversation server-side still bills for it,
440
+ * and reserving against the delta prices a turn as if the conversation
441
+ * had restarted.
442
+ *
443
+ * Reconciliation reads this provider instance's running cost, so a
444
+ * budget must not be threaded through an instance two callers are
445
+ * driving concurrently; the supervisor owns its provider for exactly
446
+ * this reason.
447
+ */
448
+ turnBudget?: TurnBudget | RunBudget;
449
+ /**
450
+ * The run's workspace directory. Only providers that drive their own
451
+ * agent loop over host tools read it — the Claude Agent SDK uses it as
452
+ * the session `cwd` so its path-scoped built-ins resolve where the
453
+ * NodeTool tools they replace would have. Ignored here.
454
+ */
455
+ workspaceDir?: string;
456
+ /**
457
+ * User-defined skills to expose to a provider that drives its own agent
458
+ * loop with a native skill mechanism (the Claude Agent SDK). That
459
+ * override materializes them as an isolated local plugin so its `Skill`
460
+ * tool can load them on demand. Ignored by this base loop and every
461
+ * provider that doesn't own its loop — those receive skills baked into
462
+ * the system prompt by the caller instead.
463
+ */
464
+ skills?: ProviderSkill[];
465
+ /**
466
+ * Dereference the media references a message carries, just before the
467
+ * request that needs the bytes. Usually
468
+ * `ProcessingContext.resolveMessageMediaUris`.
469
+ *
470
+ * Tool results are appended inside this loop, so a host cannot resolve
471
+ * them the way it resolves the opening history. Doing it here rather than
472
+ * at the tool keeps pixels out of the conversation entirely: `view_image`
473
+ * answers with an `asset://` reference, the transcript and the budget
474
+ * estimate carry that reference, and the base64 exists only in the one
475
+ * request body it is needed for. A ~200KB screenshot inlined into the
476
+ * transcript instead estimates at ~190k tokens and is re-sent every
477
+ * round.
478
+ *
479
+ * Only messages appended since the last turn are resolved, so a loop that
480
+ * looks at three images reads three assets, not three per round.
481
+ */
482
+ resolveMedia?: (messages: Message[]) => Promise<Message[]>;
483
+ }): AsyncGenerator<ProviderStreamItem>;
484
+ private generateBaseLoop;
106
485
  /** Internal: wrap generateMessages with OTel span */
107
486
  private _tracedStream;
108
487
  textToImage(_params: TextToImageParams): Promise<Uint8Array>;
@@ -114,25 +493,63 @@ export declare abstract class BaseProvider {
114
493
  * should override this for efficiency.
115
494
  */
116
495
  textToImages(params: TextToImageParams, numImages: number): Promise<Uint8Array[]>;
117
- imageToImage(_image: Uint8Array, _params: ImageToImageParams): Promise<Uint8Array>;
496
+ /**
497
+ * Transform one or more source images into a single output image.
498
+ *
499
+ * The first image is the primary subject; providers that accept multiple
500
+ * reference images (e.g. multi-image editing / composition) use the rest,
501
+ * while single-image providers operate on `images[0]`.
502
+ */
503
+ imageToImage(_images: Uint8Array[], _params: ImageToImageParams): Promise<Uint8Array>;
118
504
  /**
119
505
  * Generate multiple image-to-image results in one logical call.
120
506
  *
121
507
  * Default implementation calls imageToImage() sequentially as a fallback.
122
508
  * Providers that support native batch generation should override this.
123
509
  */
124
- imageToImages(image: Uint8Array, params: ImageToImageParams, numImages: number): Promise<Uint8Array[]>;
125
- textToSpeech(_args: {
126
- text: string;
127
- model: string;
128
- voice?: string;
129
- speed?: number;
130
- /**
131
- * Requested output container. Providers that stream raw PCM may ignore
132
- * this hint; the caller is responsible for wrapping/encoding the result.
133
- */
134
- audioFormat?: string;
135
- }): AsyncGenerator<StreamingAudioChunk>;
510
+ imageToImages(images: Uint8Array[], params: ImageToImageParams, numImages: number): Promise<Uint8Array[]>;
511
+ /**
512
+ * Inpaint: regenerate the masked region of one or more source images
513
+ * according to a prompt. Like {@link imageToImage} but mask-guided — the mask
514
+ * is routed to whatever mask input the target endpoint declares.
515
+ *
516
+ * The first image is the primary subject; the mask in `params.mask` marks the
517
+ * region to regenerate (white = regenerate).
518
+ */
519
+ inpaint(_images: Uint8Array[], _params: InpaintingParams): Promise<Uint8Array>;
520
+ /**
521
+ * Generate multiple inpaint results in one logical call.
522
+ *
523
+ * Default implementation calls inpaint() sequentially as a fallback.
524
+ * Providers that support native batch generation should override this.
525
+ */
526
+ inpaintImages(images: Uint8Array[], params: InpaintingParams, numImages: number): Promise<Uint8Array[]>;
527
+ /**
528
+ * Outpaint (uncrop): extend an image past its frame, filling the added area
529
+ * with content that continues the scene. The first image is the subject;
530
+ * providers that take reference images use the rest.
531
+ */
532
+ outpaintImage(_images: Uint8Array[], _params: OutpaintImageParams): Promise<Uint8Array>;
533
+ /** Increase the resolution / detail of an image. */
534
+ upscaleImage(_image: Uint8Array, _params: UpscaleImageParams): Promise<Uint8Array>;
535
+ /** Remove the background from an image, returning an image with alpha. */
536
+ removeBackground(_image: Uint8Array, _params: RemoveBackgroundParams): Promise<Uint8Array>;
537
+ /**
538
+ * Estimate per-pixel depth. Returns a grayscale PNG at the input's size,
539
+ * where brighter pixels are nearer to the camera.
540
+ */
541
+ estimateDepth(_image: Uint8Array, _params: EstimateDepthParams): Promise<Uint8Array>;
542
+ /**
543
+ * Segment an image into object masks. Returns one entry per object the model
544
+ * found, in the model's own order; an empty array means it found nothing,
545
+ * which is an answer rather than a failure.
546
+ */
547
+ segmentImage(_image: Uint8Array, _params: SegmentImageParams): Promise<ImageSegmentationMask[]>;
548
+ /** Re-light a subject according to a prompt / background reference. */
549
+ relightImage(_image: Uint8Array, _params: RelightImageParams): Promise<Uint8Array>;
550
+ /** Convert a raster image into a vector (SVG) representation. */
551
+ vectorizeImage(_image: Uint8Array, _params: VectorizeImageParams): Promise<Uint8Array>;
552
+ textToSpeech(_args: TextToSpeechParams): AsyncGenerator<StreamingAudioChunk>;
136
553
  /**
137
554
  * Override this for providers that return fully-encoded audio (FLAC, WAV,
138
555
  * MP3) instead of raw PCM samples. Returns null by default, meaning the
@@ -142,13 +559,33 @@ export declare abstract class BaseProvider {
142
559
  * when possible and fall back to their default when the format is not
143
560
  * supported. The returned `mimeType` reflects the actual bytes produced.
144
561
  */
145
- textToSpeechEncoded(_args: {
146
- text: string;
147
- model: string;
148
- voice?: string;
149
- speed?: number;
150
- audioFormat?: string;
151
- }): Promise<EncodedAudioResult | null>;
562
+ textToSpeechEncoded(_args: TextToSpeechParams): Promise<EncodedAudioResult | null>;
563
+ /**
564
+ * True when this provider streams raw PCM via {@link textToSpeech}. Providers
565
+ * that only return encoded audio files (e.g. FAL/KIE) leave the base method in
566
+ * place and are consumed via {@link textToSpeechEncoded} instead.
567
+ */
568
+ supportsStreamingTextToSpeech(): boolean;
569
+ /**
570
+ * Generate music / instrumental audio from a text prompt. Music providers
571
+ * return a fully-encoded audio file (mp3/wav/flac), so this resolves to an
572
+ * {@link EncodedAudioResult} rather than streaming raw PCM. Providers that
573
+ * expose music models via {@link getAvailableMusicModels} must override this.
574
+ */
575
+ textToMusic(_params: TextToMusicParams): Promise<EncodedAudioResult>;
576
+ /**
577
+ * Optional video-conditioned sound task. Call through requestVideoToAudio
578
+ * for input and capability validation before dispatch.
579
+ */
580
+ videoToAudio(_video: Uint8Array, _params: VideoToAudioParams): Promise<EncodedAudioResult>;
581
+ /**
582
+ * Rewrite a recording: convert the voice, isolate or denoise it, separate a
583
+ * stem, raise its sample rate. The source bytes are passed positionally, the
584
+ * direction rides in the params. Like {@link textToMusic} this resolves to an
585
+ * {@link EncodedAudioResult} — every provider that offers these endpoints
586
+ * hands back a file, not PCM.
587
+ */
588
+ audioToAudio(_audio: Uint8Array, _params: AudioToAudioParams): Promise<EncodedAudioResult>;
152
589
  automaticSpeechRecognition(_args: {
153
590
  audio: Uint8Array;
154
591
  model: string;
@@ -158,7 +595,29 @@ export declare abstract class BaseProvider {
158
595
  word_timestamps?: boolean;
159
596
  }): Promise<import("./types.js").ASRResult>;
160
597
  textToVideo(_params: TextToVideoParams): Promise<Uint8Array>;
598
+ /**
599
+ * Animate a single source image into a video. Reference media uses
600
+ * {@link referenceToVideo} so the input role remains explicit.
601
+ */
161
602
  imageToVideo(_image: Uint8Array, _params: ImageToVideoParams): Promise<Uint8Array>;
603
+ referenceToVideo(_inputs: ReferenceToVideoInputs, _params: ReferenceToVideoParams): Promise<Uint8Array>;
604
+ /** Track a source-frame box and return samples in absolute source milliseconds. */
605
+ trackObject(_video: Uint8Array, _params: ObjectTrackingParams): Promise<ObjectTrackingResult>;
606
+ /** Restyle / edit an existing video, guided by a prompt. */
607
+ videoToVideo(_video: Uint8Array, _params: VideoToVideoParams): Promise<Uint8Array>;
608
+ /** Add source time before or after an existing video window. */
609
+ extendVideo(_video: Uint8Array, _params: ExtendVideoParams): Promise<Uint8Array>;
610
+ /** Increase the resolution / detail of a video. */
611
+ upscaleVideo(_video: Uint8Array, _params: UpscaleVideoParams): Promise<Uint8Array>;
612
+ /**
613
+ * Synthesize intermediate frames so a clip plays at a higher frame rate (or
614
+ * in slow motion at the same one).
615
+ */
616
+ interpolateVideo(_video: Uint8Array, _params: InterpolateVideoParams): Promise<Uint8Array>;
617
+ /** Extend a video past its frame, consistently across its frames. */
618
+ outpaintVideo(_video: Uint8Array, _params: OutpaintVideoParams): Promise<Uint8Array>;
619
+ /** Drive a face in a video/image to match the speech in an audio track. */
620
+ lipSync(_video: Uint8Array, _params: LipSyncParams): Promise<Uint8Array>;
162
621
  /**
163
622
  * Generate a 3D asset from a text prompt. Returns the encoded asset bytes
164
623
  * (typically GLB). Providers that support 3D generation should override.
@@ -175,6 +634,16 @@ export declare abstract class BaseProvider {
175
634
  model: string;
176
635
  dimensions?: number;
177
636
  }): Promise<number[][]>;
637
+ /** Score each document against the query, most relevant first. */
638
+ rerank(_params: RerankParams): Promise<RerankResult[]>;
639
+ /**
640
+ * Whether `error` is this provider refusing the request because it exceeds
641
+ * the model's context window. Default `false`: a provider whose signal has
642
+ * not been established must not have one guessed for it, because a false
643
+ * positive rewrites a transcript over an unrelated failure. Overridden by the
644
+ * providers in `context-exceeded.ts`.
645
+ */
646
+ isContextExceededError(_error: unknown): boolean;
178
647
  isContextLengthError(error: unknown): boolean;
179
648
  /**
180
649
  * Check if an error is a rate limit error (HTTP 429).
@@ -191,7 +660,7 @@ export declare abstract class BaseProvider {
191
660
  /**
192
661
  * Resolve a URI to a `data:` URI that providers can consume directly.
193
662
  *
194
- * - `file://...` → read from disk, return `data:<mime>;base64,…`
663
+ * - `file://...` → read an asset file, return `data:<mime>;base64,…`
195
664
  * - `/api/storage/<k>` → read from getDefaultAssetsPath()/<k> (legacy fallback)
196
665
  * - Everything else → returned unchanged (http/https/data: pass through)
197
666
  */