@bastani/pi-ai 0.9.19 → 0.9.20-alpha.10

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 (445) hide show
  1. package/CHANGELOG.md +83 -1
  2. package/NOTICE.md +1 -1
  3. package/README.md +203 -30
  4. package/dist/api/anthropic-messages.d.ts.map +1 -1
  5. package/dist/api/anthropic-messages.js +255 -97
  6. package/dist/api/anthropic-messages.js.map +1 -1
  7. package/dist/api/azure-openai-responses.d.ts.map +1 -1
  8. package/dist/api/azure-openai-responses.js +21 -6
  9. package/dist/api/azure-openai-responses.js.map +1 -1
  10. package/dist/api/bedrock-converse-stream.d.ts.map +1 -1
  11. package/dist/api/bedrock-converse-stream.js +20 -15
  12. package/dist/api/bedrock-converse-stream.js.map +1 -1
  13. package/dist/api/cloudflare-workers-ai-system-one.d.ts +4 -0
  14. package/dist/api/cloudflare-workers-ai-system-one.d.ts.map +1 -0
  15. package/dist/api/cloudflare-workers-ai-system-one.js +43 -0
  16. package/dist/api/cloudflare-workers-ai-system-one.js.map +1 -0
  17. package/dist/api/cloudflare-workers-ai-system-one.lazy.d.ts +3 -0
  18. package/dist/api/cloudflare-workers-ai-system-one.lazy.d.ts.map +1 -0
  19. package/dist/api/cloudflare-workers-ai-system-one.lazy.js +4 -0
  20. package/dist/api/cloudflare-workers-ai-system-one.lazy.js.map +1 -0
  21. package/dist/api/cloudflare.d.ts +2 -0
  22. package/dist/api/cloudflare.d.ts.map +1 -1
  23. package/dist/api/cloudflare.js +2 -0
  24. package/dist/api/cloudflare.js.map +1 -1
  25. package/dist/api/constrained-sampling.d.ts +8 -3
  26. package/dist/api/constrained-sampling.d.ts.map +1 -1
  27. package/dist/api/constrained-sampling.js +29 -11
  28. package/dist/api/constrained-sampling.js.map +1 -1
  29. package/dist/api/google-generative-ai.d.ts.map +1 -1
  30. package/dist/api/google-generative-ai.js +23 -80
  31. package/dist/api/google-generative-ai.js.map +1 -1
  32. package/dist/api/google-shared.d.ts +13 -4
  33. package/dist/api/google-shared.d.ts.map +1 -1
  34. package/dist/api/google-shared.js +54 -4
  35. package/dist/api/google-shared.js.map +1 -1
  36. package/dist/api/google-vertex.d.ts.map +1 -1
  37. package/dist/api/google-vertex.js +26 -65
  38. package/dist/api/google-vertex.js.map +1 -1
  39. package/dist/api/mistral-conversations.d.ts.map +1 -1
  40. package/dist/api/mistral-conversations.js +18 -13
  41. package/dist/api/mistral-conversations.js.map +1 -1
  42. package/dist/api/openai-codex-responses.d.ts.map +1 -1
  43. package/dist/api/openai-codex-responses.js +40 -26
  44. package/dist/api/openai-codex-responses.js.map +1 -1
  45. package/dist/api/openai-completions.d.ts +6 -4
  46. package/dist/api/openai-completions.d.ts.map +1 -1
  47. package/dist/api/openai-completions.js +44 -58
  48. package/dist/api/openai-completions.js.map +1 -1
  49. package/dist/api/openai-responses-shared.d.ts +11 -5
  50. package/dist/api/openai-responses-shared.d.ts.map +1 -1
  51. package/dist/api/openai-responses-shared.js +65 -58
  52. package/dist/api/openai-responses-shared.js.map +1 -1
  53. package/dist/api/openai-responses.d.ts.map +1 -1
  54. package/dist/api/openai-responses.js +15 -19
  55. package/dist/api/openai-responses.js.map +1 -1
  56. package/dist/api/openrouter-images.d.ts +2 -1
  57. package/dist/api/openrouter-images.d.ts.map +1 -1
  58. package/dist/api/openrouter-images.js +1 -0
  59. package/dist/api/openrouter-images.js.map +1 -1
  60. package/dist/api/openrouter-images.lazy.d.ts.map +1 -1
  61. package/dist/api/openrouter-images.lazy.js.map +1 -1
  62. package/dist/api/pi-messages.d.ts +3 -3
  63. package/dist/api/pi-messages.d.ts.map +1 -1
  64. package/dist/api/pi-messages.js +3 -2
  65. package/dist/api/pi-messages.js.map +1 -1
  66. package/dist/api/simple-options.d.ts +3 -3
  67. package/dist/api/simple-options.d.ts.map +1 -1
  68. package/dist/api/simple-options.js +1 -0
  69. package/dist/api/simple-options.js.map +1 -1
  70. package/dist/api/system-one-shared.d.ts +23 -0
  71. package/dist/api/system-one-shared.d.ts.map +1 -0
  72. package/dist/api/system-one-shared.js +170 -0
  73. package/dist/api/system-one-shared.js.map +1 -0
  74. package/dist/api/transform-messages.d.ts.map +1 -1
  75. package/dist/api/transform-messages.js +21 -7
  76. package/dist/api/transform-messages.js.map +1 -1
  77. package/dist/api/typesafe-system-one.d.ts +4 -0
  78. package/dist/api/typesafe-system-one.d.ts.map +1 -0
  79. package/dist/api/typesafe-system-one.js +19 -0
  80. package/dist/api/typesafe-system-one.js.map +1 -0
  81. package/dist/api/typesafe-system-one.lazy.d.ts +3 -0
  82. package/dist/api/typesafe-system-one.lazy.d.ts.map +1 -0
  83. package/dist/api/typesafe-system-one.lazy.js +4 -0
  84. package/dist/api/typesafe-system-one.lazy.js.map +1 -0
  85. package/dist/auth/credential-store.d.ts.map +1 -1
  86. package/dist/auth/credential-store.js +3 -2
  87. package/dist/auth/credential-store.js.map +1 -1
  88. package/dist/auth/oauth/load.d.ts +2 -0
  89. package/dist/auth/oauth/load.d.ts.map +1 -1
  90. package/dist/auth/oauth/load.js +5 -0
  91. package/dist/auth/oauth/load.js.map +1 -1
  92. package/dist/auth/oauth/meta.d.ts +17 -0
  93. package/dist/auth/oauth/meta.d.ts.map +1 -0
  94. package/dist/auth/oauth/meta.js +190 -0
  95. package/dist/auth/oauth/meta.js.map +1 -0
  96. package/dist/auth/resolve.d.ts +6 -8
  97. package/dist/auth/resolve.d.ts.map +1 -1
  98. package/dist/auth/resolve.js +29 -26
  99. package/dist/auth/resolve.js.map +1 -1
  100. package/dist/bun-oauth.d.ts.map +1 -1
  101. package/dist/bun-oauth.js +2 -0
  102. package/dist/bun-oauth.js.map +1 -1
  103. package/dist/compat.d.ts +3 -3
  104. package/dist/compat.d.ts.map +1 -1
  105. package/dist/compat.js +9 -6
  106. package/dist/compat.js.map +1 -1
  107. package/dist/decision-models.d.ts +21 -0
  108. package/dist/decision-models.d.ts.map +1 -0
  109. package/dist/decision-models.generated.d.ts +3 -0
  110. package/dist/decision-models.generated.d.ts.map +1 -0
  111. package/dist/decision-models.generated.js +47 -0
  112. package/dist/decision-models.generated.js.map +1 -0
  113. package/dist/decision-models.js +8 -0
  114. package/dist/decision-models.js.map +1 -0
  115. package/dist/env-api-keys.d.ts +2 -0
  116. package/dist/env-api-keys.d.ts.map +1 -1
  117. package/dist/env-api-keys.js +61 -43
  118. package/dist/env-api-keys.js.map +1 -1
  119. package/dist/image-models.d.ts +19 -8
  120. package/dist/image-models.d.ts.map +1 -1
  121. package/dist/image-models.js +14 -13
  122. package/dist/image-models.js.map +1 -1
  123. package/dist/images-api-registry.d.ts +7 -7
  124. package/dist/images-api-registry.d.ts.map +1 -1
  125. package/dist/images-api-registry.js.map +1 -1
  126. package/dist/images.d.ts +7 -2
  127. package/dist/images.d.ts.map +1 -1
  128. package/dist/images.js +5 -0
  129. package/dist/images.js.map +1 -1
  130. package/dist/index.d.ts +4 -2
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +4 -2
  133. package/dist/index.js.map +1 -1
  134. package/dist/model-catalog.d.ts +25 -9
  135. package/dist/model-catalog.d.ts.map +1 -1
  136. package/dist/model-catalog.js +14 -2
  137. package/dist/model-catalog.js.map +1 -1
  138. package/dist/models-store.d.ts +3 -2
  139. package/dist/models-store.d.ts.map +1 -1
  140. package/dist/models-store.js.map +1 -1
  141. package/dist/models.d.ts +99 -31
  142. package/dist/models.d.ts.map +1 -1
  143. package/dist/models.generated.d.ts +133 -39
  144. package/dist/models.generated.d.ts.map +1 -1
  145. package/dist/models.generated.js +133 -39
  146. package/dist/models.generated.js.map +1 -1
  147. package/dist/models.js +161 -31
  148. package/dist/models.js.map +1 -1
  149. package/dist/providers/all.d.ts +19 -13
  150. package/dist/providers/all.d.ts.map +1 -1
  151. package/dist/providers/all.js +27 -21
  152. package/dist/providers/all.js.map +1 -1
  153. package/dist/providers/amazon-bedrock.models.d.ts +4 -3
  154. package/dist/providers/amazon-bedrock.models.d.ts.map +1 -1
  155. package/dist/providers/amazon-bedrock.models.js +4 -2
  156. package/dist/providers/amazon-bedrock.models.js.map +1 -1
  157. package/dist/providers/ant-ling.models.d.ts +4 -3
  158. package/dist/providers/ant-ling.models.d.ts.map +1 -1
  159. package/dist/providers/ant-ling.models.js +4 -2
  160. package/dist/providers/ant-ling.models.js.map +1 -1
  161. package/dist/providers/anthropic.models.d.ts +4 -3
  162. package/dist/providers/anthropic.models.d.ts.map +1 -1
  163. package/dist/providers/anthropic.models.js +4 -2
  164. package/dist/providers/anthropic.models.js.map +1 -1
  165. package/dist/providers/azure-openai-responses.models.d.ts +4 -3
  166. package/dist/providers/azure-openai-responses.models.d.ts.map +1 -1
  167. package/dist/providers/azure-openai-responses.models.js +4 -2
  168. package/dist/providers/azure-openai-responses.models.js.map +1 -1
  169. package/dist/providers/baseten.models.d.ts +4 -3
  170. package/dist/providers/baseten.models.d.ts.map +1 -1
  171. package/dist/providers/baseten.models.js +4 -2
  172. package/dist/providers/baseten.models.js.map +1 -1
  173. package/dist/providers/cerebras.models.d.ts +4 -3
  174. package/dist/providers/cerebras.models.d.ts.map +1 -1
  175. package/dist/providers/cerebras.models.js +4 -2
  176. package/dist/providers/cerebras.models.js.map +1 -1
  177. package/dist/providers/cloudflare-ai-gateway.models.d.ts +4 -3
  178. package/dist/providers/cloudflare-ai-gateway.models.d.ts.map +1 -1
  179. package/dist/providers/cloudflare-ai-gateway.models.js +4 -2
  180. package/dist/providers/cloudflare-ai-gateway.models.js.map +1 -1
  181. package/dist/providers/cloudflare-stream.d.ts +6 -2
  182. package/dist/providers/cloudflare-stream.d.ts.map +1 -1
  183. package/dist/providers/cloudflare-stream.js +6 -0
  184. package/dist/providers/cloudflare-stream.js.map +1 -1
  185. package/dist/providers/cloudflare-workers-ai.d.ts.map +1 -1
  186. package/dist/providers/cloudflare-workers-ai.js +10 -3
  187. package/dist/providers/cloudflare-workers-ai.js.map +1 -1
  188. package/dist/providers/cloudflare-workers-ai.models.d.ts +4 -3
  189. package/dist/providers/cloudflare-workers-ai.models.d.ts.map +1 -1
  190. package/dist/providers/cloudflare-workers-ai.models.js +4 -2
  191. package/dist/providers/cloudflare-workers-ai.models.js.map +1 -1
  192. package/dist/providers/data/.manifest.json +1 -1
  193. package/dist/providers/data/amazon-bedrock.json +1 -1
  194. package/dist/providers/data/ant-ling.json +1 -1
  195. package/dist/providers/data/anthropic.json +1 -1
  196. package/dist/providers/data/azure-openai-responses.json +1 -1
  197. package/dist/providers/data/baseten.json +1 -1
  198. package/dist/providers/data/cerebras.json +1 -1
  199. package/dist/providers/data/cloudflare-ai-gateway.json +1 -1
  200. package/dist/providers/data/cloudflare-workers-ai.json +1 -1
  201. package/dist/providers/data/deepseek.json +1 -1
  202. package/dist/providers/data/fireworks.json +1 -1
  203. package/dist/providers/data/github-copilot.json +1 -1
  204. package/dist/providers/data/google-vertex.json +1 -1
  205. package/dist/providers/data/google.json +1 -1
  206. package/dist/providers/data/groq.json +1 -1
  207. package/dist/providers/data/huggingface.json +1 -1
  208. package/dist/providers/data/kimi-coding.json +1 -1
  209. package/dist/providers/data/meta.json +1 -0
  210. package/dist/providers/data/minimax-cn.json +1 -1
  211. package/dist/providers/data/minimax.json +1 -1
  212. package/dist/providers/data/mistral.json +1 -1
  213. package/dist/providers/data/moonshotai-cn.json +1 -1
  214. package/dist/providers/data/moonshotai.json +1 -1
  215. package/dist/providers/data/nvidia.json +1 -1
  216. package/dist/providers/data/openai-codex.json +1 -1
  217. package/dist/providers/data/openai.json +1 -1
  218. package/dist/providers/data/opencode-go.json +1 -1
  219. package/dist/providers/data/opencode.json +1 -1
  220. package/dist/providers/data/openrouter.json +1 -1
  221. package/dist/providers/data/qwen-token-plan-cn.json +1 -1
  222. package/dist/providers/data/qwen-token-plan-individual.json +1 -1
  223. package/dist/providers/data/qwen-token-plan.json +1 -1
  224. package/dist/providers/data/radius.json +1 -0
  225. package/dist/providers/data/together.json +1 -1
  226. package/dist/providers/data/typesafe.json +1 -0
  227. package/dist/providers/data/vercel-ai-gateway.json +1 -1
  228. package/dist/providers/data/xai.json +1 -1
  229. package/dist/providers/data/xiaomi-token-plan-ams.json +1 -1
  230. package/dist/providers/data/xiaomi-token-plan-cn.json +1 -1
  231. package/dist/providers/data/xiaomi-token-plan-sgp.json +1 -1
  232. package/dist/providers/data/xiaomi.json +1 -1
  233. package/dist/providers/data/zai-coding-cn.json +1 -1
  234. package/dist/providers/data/zai.json +1 -1
  235. package/dist/providers/deepseek.models.d.ts +4 -3
  236. package/dist/providers/deepseek.models.d.ts.map +1 -1
  237. package/dist/providers/deepseek.models.js +4 -2
  238. package/dist/providers/deepseek.models.js.map +1 -1
  239. package/dist/providers/faux.d.ts +3 -2
  240. package/dist/providers/faux.d.ts.map +1 -1
  241. package/dist/providers/faux.js +12 -11
  242. package/dist/providers/faux.js.map +1 -1
  243. package/dist/providers/fireworks.models.d.ts +4 -3
  244. package/dist/providers/fireworks.models.d.ts.map +1 -1
  245. package/dist/providers/fireworks.models.js +4 -2
  246. package/dist/providers/fireworks.models.js.map +1 -1
  247. package/dist/providers/github-copilot.models.d.ts +4 -3
  248. package/dist/providers/github-copilot.models.d.ts.map +1 -1
  249. package/dist/providers/github-copilot.models.js +4 -2
  250. package/dist/providers/github-copilot.models.js.map +1 -1
  251. package/dist/providers/google-vertex.models.d.ts +4 -3
  252. package/dist/providers/google-vertex.models.d.ts.map +1 -1
  253. package/dist/providers/google-vertex.models.js +4 -2
  254. package/dist/providers/google-vertex.models.js.map +1 -1
  255. package/dist/providers/google.models.d.ts +4 -3
  256. package/dist/providers/google.models.d.ts.map +1 -1
  257. package/dist/providers/google.models.js +4 -2
  258. package/dist/providers/google.models.js.map +1 -1
  259. package/dist/providers/groq.models.d.ts +4 -3
  260. package/dist/providers/groq.models.d.ts.map +1 -1
  261. package/dist/providers/groq.models.js +4 -2
  262. package/dist/providers/groq.models.js.map +1 -1
  263. package/dist/providers/huggingface.models.d.ts +4 -3
  264. package/dist/providers/huggingface.models.d.ts.map +1 -1
  265. package/dist/providers/huggingface.models.js +4 -2
  266. package/dist/providers/huggingface.models.js.map +1 -1
  267. package/dist/providers/images/register-builtins.d.ts +1 -1
  268. package/dist/providers/images/register-builtins.d.ts.map +1 -1
  269. package/dist/providers/images/register-builtins.js.map +1 -1
  270. package/dist/providers/kimi-coding.models.d.ts +4 -3
  271. package/dist/providers/kimi-coding.models.d.ts.map +1 -1
  272. package/dist/providers/kimi-coding.models.js +4 -2
  273. package/dist/providers/kimi-coding.models.js.map +1 -1
  274. package/dist/providers/meta.d.ts +3 -0
  275. package/dist/providers/meta.d.ts.map +1 -0
  276. package/dist/providers/meta.js +24 -0
  277. package/dist/providers/meta.js.map +1 -0
  278. package/dist/providers/meta.models.d.ts +5 -0
  279. package/dist/providers/meta.models.d.ts.map +1 -0
  280. package/dist/providers/meta.models.js +8 -0
  281. package/dist/providers/meta.models.js.map +1 -0
  282. package/dist/providers/minimax-cn.models.d.ts +4 -3
  283. package/dist/providers/minimax-cn.models.d.ts.map +1 -1
  284. package/dist/providers/minimax-cn.models.js +4 -2
  285. package/dist/providers/minimax-cn.models.js.map +1 -1
  286. package/dist/providers/minimax.models.d.ts +4 -3
  287. package/dist/providers/minimax.models.d.ts.map +1 -1
  288. package/dist/providers/minimax.models.js +4 -2
  289. package/dist/providers/minimax.models.js.map +1 -1
  290. package/dist/providers/mistral.models.d.ts +4 -3
  291. package/dist/providers/mistral.models.d.ts.map +1 -1
  292. package/dist/providers/mistral.models.js +4 -2
  293. package/dist/providers/mistral.models.js.map +1 -1
  294. package/dist/providers/moonshotai-cn.models.d.ts +4 -3
  295. package/dist/providers/moonshotai-cn.models.d.ts.map +1 -1
  296. package/dist/providers/moonshotai-cn.models.js +4 -2
  297. package/dist/providers/moonshotai-cn.models.js.map +1 -1
  298. package/dist/providers/moonshotai.models.d.ts +4 -3
  299. package/dist/providers/moonshotai.models.d.ts.map +1 -1
  300. package/dist/providers/moonshotai.models.js +4 -2
  301. package/dist/providers/moonshotai.models.js.map +1 -1
  302. package/dist/providers/nvidia.models.d.ts +4 -3
  303. package/dist/providers/nvidia.models.d.ts.map +1 -1
  304. package/dist/providers/nvidia.models.js +4 -2
  305. package/dist/providers/nvidia.models.js.map +1 -1
  306. package/dist/providers/openai-codex.models.d.ts +4 -3
  307. package/dist/providers/openai-codex.models.d.ts.map +1 -1
  308. package/dist/providers/openai-codex.models.js +4 -2
  309. package/dist/providers/openai-codex.models.js.map +1 -1
  310. package/dist/providers/openai.models.d.ts +4 -3
  311. package/dist/providers/openai.models.d.ts.map +1 -1
  312. package/dist/providers/openai.models.js +4 -2
  313. package/dist/providers/openai.models.js.map +1 -1
  314. package/dist/providers/opencode-go.models.d.ts +4 -3
  315. package/dist/providers/opencode-go.models.d.ts.map +1 -1
  316. package/dist/providers/opencode-go.models.js +4 -2
  317. package/dist/providers/opencode-go.models.js.map +1 -1
  318. package/dist/providers/opencode.models.d.ts +4 -3
  319. package/dist/providers/opencode.models.d.ts.map +1 -1
  320. package/dist/providers/opencode.models.js +4 -2
  321. package/dist/providers/opencode.models.js.map +1 -1
  322. package/dist/providers/openrouter.d.ts.map +1 -1
  323. package/dist/providers/openrouter.js +11 -2
  324. package/dist/providers/openrouter.js.map +1 -1
  325. package/dist/providers/openrouter.models.d.ts +4 -3
  326. package/dist/providers/openrouter.models.d.ts.map +1 -1
  327. package/dist/providers/openrouter.models.js +4 -2
  328. package/dist/providers/openrouter.models.js.map +1 -1
  329. package/dist/providers/qwen-token-plan-cn.models.d.ts +4 -3
  330. package/dist/providers/qwen-token-plan-cn.models.d.ts.map +1 -1
  331. package/dist/providers/qwen-token-plan-cn.models.js +4 -2
  332. package/dist/providers/qwen-token-plan-cn.models.js.map +1 -1
  333. package/dist/providers/qwen-token-plan-individual.models.d.ts +4 -3
  334. package/dist/providers/qwen-token-plan-individual.models.d.ts.map +1 -1
  335. package/dist/providers/qwen-token-plan-individual.models.js +4 -2
  336. package/dist/providers/qwen-token-plan-individual.models.js.map +1 -1
  337. package/dist/providers/qwen-token-plan.models.d.ts +4 -3
  338. package/dist/providers/qwen-token-plan.models.d.ts.map +1 -1
  339. package/dist/providers/qwen-token-plan.models.js +4 -2
  340. package/dist/providers/qwen-token-plan.models.js.map +1 -1
  341. package/dist/providers/radius.d.ts.map +1 -1
  342. package/dist/providers/radius.js +19 -5
  343. package/dist/providers/radius.js.map +1 -1
  344. package/dist/providers/radius.models.d.ts +5 -0
  345. package/dist/providers/radius.models.d.ts.map +1 -0
  346. package/dist/providers/radius.models.js +8 -0
  347. package/dist/providers/radius.models.js.map +1 -0
  348. package/dist/providers/together.models.d.ts +4 -3
  349. package/dist/providers/together.models.d.ts.map +1 -1
  350. package/dist/providers/together.models.js +4 -2
  351. package/dist/providers/together.models.js.map +1 -1
  352. package/dist/providers/typesafe.d.ts +3 -0
  353. package/dist/providers/typesafe.d.ts.map +1 -0
  354. package/dist/providers/typesafe.js +18 -0
  355. package/dist/providers/typesafe.js.map +1 -0
  356. package/dist/providers/typesafe.models.d.ts +5 -0
  357. package/dist/providers/typesafe.models.d.ts.map +1 -0
  358. package/dist/providers/typesafe.models.js +8 -0
  359. package/dist/providers/typesafe.models.js.map +1 -0
  360. package/dist/providers/vercel-ai-gateway.models.d.ts +4 -3
  361. package/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
  362. package/dist/providers/vercel-ai-gateway.models.js +4 -2
  363. package/dist/providers/vercel-ai-gateway.models.js.map +1 -1
  364. package/dist/providers/xai.models.d.ts +4 -3
  365. package/dist/providers/xai.models.d.ts.map +1 -1
  366. package/dist/providers/xai.models.js +4 -2
  367. package/dist/providers/xai.models.js.map +1 -1
  368. package/dist/providers/xiaomi-token-plan-ams.models.d.ts +4 -3
  369. package/dist/providers/xiaomi-token-plan-ams.models.d.ts.map +1 -1
  370. package/dist/providers/xiaomi-token-plan-ams.models.js +4 -2
  371. package/dist/providers/xiaomi-token-plan-ams.models.js.map +1 -1
  372. package/dist/providers/xiaomi-token-plan-cn.models.d.ts +4 -3
  373. package/dist/providers/xiaomi-token-plan-cn.models.d.ts.map +1 -1
  374. package/dist/providers/xiaomi-token-plan-cn.models.js +4 -2
  375. package/dist/providers/xiaomi-token-plan-cn.models.js.map +1 -1
  376. package/dist/providers/xiaomi-token-plan-sgp.models.d.ts +4 -3
  377. package/dist/providers/xiaomi-token-plan-sgp.models.d.ts.map +1 -1
  378. package/dist/providers/xiaomi-token-plan-sgp.models.js +4 -2
  379. package/dist/providers/xiaomi-token-plan-sgp.models.js.map +1 -1
  380. package/dist/providers/xiaomi.models.d.ts +4 -3
  381. package/dist/providers/xiaomi.models.d.ts.map +1 -1
  382. package/dist/providers/xiaomi.models.js +4 -2
  383. package/dist/providers/xiaomi.models.js.map +1 -1
  384. package/dist/providers/zai-coding-cn.models.d.ts +4 -3
  385. package/dist/providers/zai-coding-cn.models.d.ts.map +1 -1
  386. package/dist/providers/zai-coding-cn.models.js +4 -2
  387. package/dist/providers/zai-coding-cn.models.js.map +1 -1
  388. package/dist/providers/zai.models.d.ts +4 -3
  389. package/dist/providers/zai.models.d.ts.map +1 -1
  390. package/dist/providers/zai.models.js +4 -2
  391. package/dist/providers/zai.models.js.map +1 -1
  392. package/dist/types.d.ts +227 -51
  393. package/dist/types.d.ts.map +1 -1
  394. package/dist/types.js.map +1 -1
  395. package/dist/utils/diagnostics.d.ts +3 -2
  396. package/dist/utils/diagnostics.d.ts.map +1 -1
  397. package/dist/utils/diagnostics.js.map +1 -1
  398. package/dist/utils/estimate.d.ts +2 -2
  399. package/dist/utils/estimate.d.ts.map +1 -1
  400. package/dist/utils/estimate.js +8 -29
  401. package/dist/utils/estimate.js.map +1 -1
  402. package/dist/utils/headers.d.ts +1 -1
  403. package/dist/utils/headers.d.ts.map +1 -1
  404. package/dist/utils/headers.js +10 -8
  405. package/dist/utils/headers.js.map +1 -1
  406. package/dist/utils/model-operations.d.ts +11 -0
  407. package/dist/utils/model-operations.d.ts.map +1 -0
  408. package/dist/utils/model-operations.js +47 -0
  409. package/dist/utils/model-operations.js.map +1 -0
  410. package/dist/utils/models-error.d.ts +8 -0
  411. package/dist/utils/models-error.d.ts.map +1 -0
  412. package/dist/utils/models-error.js +19 -0
  413. package/dist/utils/models-error.js.map +1 -0
  414. package/dist/utils/overflow.d.ts +1 -0
  415. package/dist/utils/overflow.d.ts.map +1 -1
  416. package/dist/utils/overflow.js +17 -5
  417. package/dist/utils/overflow.js.map +1 -1
  418. package/dist/utils/retry.d.ts.map +1 -1
  419. package/dist/utils/retry.js +2 -0
  420. package/dist/utils/retry.js.map +1 -1
  421. package/dist/utils/text.d.ts +9 -1
  422. package/dist/utils/text.d.ts.map +1 -1
  423. package/dist/utils/text.js +26 -0
  424. package/dist/utils/text.js.map +1 -1
  425. package/dist/utils/transcript.d.ts +84 -0
  426. package/dist/utils/transcript.d.ts.map +1 -0
  427. package/dist/utils/transcript.js +204 -0
  428. package/dist/utils/transcript.js.map +1 -0
  429. package/package.json +4 -4
  430. package/dist/image-models.generated.d.ts +0 -785
  431. package/dist/image-models.generated.d.ts.map +0 -1
  432. package/dist/image-models.generated.js +0 -787
  433. package/dist/image-models.generated.js.map +0 -1
  434. package/dist/images-models.d.ts +0 -95
  435. package/dist/images-models.d.ts.map +0 -1
  436. package/dist/images-models.js +0 -143
  437. package/dist/images-models.js.map +0 -1
  438. package/dist/providers/openrouter-images.d.ts +0 -3
  439. package/dist/providers/openrouter-images.d.ts.map +0 -1
  440. package/dist/providers/openrouter-images.js +0 -22
  441. package/dist/providers/openrouter-images.js.map +0 -1
  442. package/dist/utils/deferred-tools.d.ts +0 -9
  443. package/dist/utils/deferred-tools.d.ts.map +0 -1
  444. package/dist/utils/deferred-tools.js +0 -36
  445. package/dist/utils/deferred-tools.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"faux.js","sourceRoot":"","sources":["../../src/providers/faux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAqB7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,WAAW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istantMessage,\n\tAssistantMessageEventStream,\n\tContext,\n\tDeferredCancelOptions,\n\tDeferredFetchOptions,\n\tDeferredHandle,\n\tDocumentContent,\n\tImageContent,\n\tMessage,\n\tModel,\n\tSimpleStreamOptions,\n\tStreamFunction,\n\tStreamOptions,\n\tTextContent,\n\tThinkingContent,\n\tToolCall,\n\tToolResultMessage,\n\tUsage,\n} from \"../types.ts\";\nimport { createAssistantMessageEventStream } from \"../utils/event-stream.ts\";\n\nconst DEFAULT_API = \"faux\";\nconst DEFAULT_PROVIDER = \"faux\";\nconst DEFAULT_MODEL_ID = \"faux-1\";\nconst DEFAULT_MODEL_NAME = \"Faux Model\";\nconst DEFAULT_BASE_URL = \"http://localhost:0\";\nconst DEFAULT_MIN_TOKEN_SIZE = 3;\nconst DEFAULT_MAX_TOKEN_SIZE = 5;\n\nconst DEFAULT_USAGE: Usage = {\n\tinput: 0,\n\toutput: 0,\n\tcacheRead: 0,\n\tcacheWrite: 0,\n\ttotalTokens: 0,\n\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n};\n\nexport interface FauxModelDefinition {\n\tid: string;\n\tname?: string;\n\treasoning?: boolean;\n\tinput?: (\"text\" | \"image\")[];\n\tcost?: { input: number; output: number; cacheRead: number; cacheWrite: number };\n\tcontextWindow?: number;\n\tmaxTokens?: number;\n}\n\nexport type FauxContentBlock = TextContent | ThinkingContent | ToolCall;\n\nexport function fauxText(text: string): TextContent {\n\treturn { type: \"text\", text };\n}\n\nexport function fauxThinking(thinking: string): ThinkingContent {\n\treturn { type: \"thinking\", thinking };\n}\n\nexport function fauxToolCall(name: string, arguments_: ToolCall[\"arguments\"], options: { id?: string } = {}): ToolCall {\n\treturn {\n\t\ttype: \"toolCall\",\n\t\tid: options.id ?? randomId(\"tool\"),\n\t\tname,\n\t\targuments: arguments_,\n\t};\n}\n\nfunction normalizeFauxAssistantContent(content: string | FauxContentBlock | FauxContentBlock[]): FauxContentBlock[] {\n\tif (typeof content === \"string\") {\n\t\treturn [fauxText(content)];\n\t}\n\treturn Array.isArray(content) ? content : [content];\n}\n\nexport function fauxAssistantMessage(\n\tcontent: string | FauxContentBlock | FauxContentBlock[],\n\toptions: {\n\t\tstopReason?: AssistantMessage[\"stopReason\"];\n\t\tdeferred?: DeferredHandle;\n\t\terrorMessage?: string;\n\t\tresponseId?: string;\n\t\ttimestamp?: number;\n\t} = {},\n): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: normalizeFauxAssistantContent(content),\n\t\tapi: DEFAULT_API,\n\t\tprovider: DEFAULT_PROVIDER,\n\t\tmodel: DEFAULT_MODEL_ID,\n\t\tusage: DEFAULT_USAGE,\n\t\tstopReason: options.stopReason ?? \"stop\",\n\t\tdeferred: options.deferred,\n\t\terrorMessage: options.errorMessage,\n\t\tresponseId: options.responseId,\n\t\ttimestamp: options.timestamp ?? Date.now(),\n\t};\n}\n\nexport interface FauxProviderState {\n\tcallCount: number;\n\tdeferredFetchCount: number;\n\tcancelledDeferred: DeferredHandle[];\n}\n\nexport type FauxResponseFactory = (\n\tcontext: Context,\n\toptions: SimpleStreamOptions | undefined,\n\tstate: FauxProviderState,\n\tmodel: Model<string>,\n) => AssistantMessage | Promise<AssistantMessage>;\n\nexport type FauxResponseStep = AssistantMessage | FauxResponseFactory;\n\nexport interface RegisterFauxProviderOptions {\n\tapi?: string;\n\tprovider?: string;\n\tmodels?: FauxModelDefinition[];\n\tdeferred?: {\n\t\t/** Number of fetches that return the original handle before the scripted response becomes ready. */\n\t\tpendingFetches?: number;\n\t\tpollAfterMs?: number;\n\t};\n\ttokensPerSecond?: number;\n\ttokenSize?: {\n\t\tmin?: number;\n\t\tmax?: number;\n\t};\n}\n\nexport interface FauxProviderRegistration {\n\tapi: string;\n\tmodels: [Model<string>, ...Model<string>[]];\n\tgetModel(): Model<string>;\n\tgetModel(modelId: string): Model<string> | undefined;\n\tstate: FauxProviderState;\n\tsetResponses: (responses: FauxResponseStep[]) => void;\n\tappendResponses: (responses: FauxResponseStep[]) => void;\n\tgetPendingResponseCount: () => number;\n\tunregister: () => void;\n}\n\nexport interface FauxProviderHandle {\n\tprovider: Provider;\n\tapi: string;\n\tmodels: [Model<string>, ...Model<string>[]];\n\tgetModel(): Model<string>;\n\tgetModel(modelId: string): Model<string> | undefined;\n\tstate: FauxProviderState;\n\tsetResponses: (responses: FauxResponseStep[]) => void;\n\tappendResponses: (responses: FauxResponseStep[]) => void;\n\tgetPendingResponseCount: () => number;\n}\n\nfunction estimateTokens(text: string): number {\n\treturn Math.ceil(text.length / 4);\n}\n\nfunction randomId(prefix: string): string {\n\treturn `${prefix}:${Date.now()}:${Math.random().toString(36).slice(2)}`;\n}\n\nfunction contentToText(content: string | Array<TextContent | ImageContent | DocumentContent>): string {\n\tif (typeof content === \"string\") {\n\t\treturn content;\n\t}\n\treturn content\n\t\t.map((block) => {\n\t\t\tif (block.type === \"text\") {\n\t\t\t\treturn block.text;\n\t\t\t}\n\t\t\tif (block.type === \"document\") {\n\t\t\t\treturn `[document:${block.mimeType}:${block.data.length}]`;\n\t\t\t}\n\t\t\treturn `[image:${block.mimeType}:${block.data.length}]`;\n\t\t})\n\t\t.join(\"\\n\");\n}\n\nfunction assistantContentToText(content: AssistantMessage[\"content\"]): string {\n\treturn content\n\t\t.map((block) => {\n\t\t\tif (block.type === \"text\") {\n\t\t\t\treturn block.text;\n\t\t\t}\n\t\t\tif (block.type === \"thinking\") {\n\t\t\t\treturn block.thinking;\n\t\t\t}\n\t\t\t// Fallback boundary markers carry no text.\n\t\t\tif (block.type !== \"toolCall\") {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\treturn `${block.name}:${JSON.stringify(block.arguments)}`;\n\t\t})\n\t\t.join(\"\\n\");\n}\n\nfunction toolResultToText(message: ToolResultMessage): string {\n\treturn [message.toolName, ...message.content.map((block) => contentToText([block]))].join(\"\\n\");\n}\n\nfunction messageToText(message: Message): string {\n\tif (message.role === \"user\") {\n\t\treturn contentToText(message.content);\n\t}\n\tif (message.role === \"assistant\") {\n\t\treturn assistantContentToText(message.content);\n\t}\n\treturn toolResultToText(message);\n}\n\nfunction serializeContext(context: Context): string {\n\tconst parts: string[] = [];\n\tif (context.systemPrompt) {\n\t\tparts.push(`system:${context.systemPrompt}`);\n\t}\n\tfor (const message of context.messages) {\n\t\tparts.push(`${message.role}:${messageToText(message)}`);\n\t}\n\tif (context.tools?.length) {\n\t\tparts.push(`tools:${JSON.stringify(context.tools)}`);\n\t}\n\treturn parts.join(\"\\n\\n\");\n}\n\nfunction commonPrefixLength(a: string, b: string): number {\n\tconst length = Math.min(a.length, b.length);\n\tlet index = 0;\n\twhile (index < length && a[index] === b[index]) {\n\t\tindex++;\n\t}\n\treturn index;\n}\n\nfunction withUsageEstimate(\n\tmessage: AssistantMessage,\n\tcontext: Context,\n\toptions: StreamOptions | undefined,\n\tpromptCache: Map<string, string>,\n): AssistantMessage {\n\tconst promptText = serializeContext(context);\n\tconst promptTokens = estimateTokens(promptText);\n\tconst outputTokens = estimateTokens(assistantContentToText(message.content));\n\tlet input = promptTokens;\n\tlet cacheRead = 0;\n\tlet cacheWrite = 0;\n\tconst sessionId = options?.sessionId;\n\n\tif (sessionId && options?.cacheRetention !== \"none\") {\n\t\tconst previousPrompt = promptCache.get(sessionId);\n\t\tif (previousPrompt) {\n\t\t\tconst cachedChars = commonPrefixLength(previousPrompt, promptText);\n\t\t\tcacheRead = estimateTokens(previousPrompt.slice(0, cachedChars));\n\t\t\tcacheWrite = estimateTokens(promptText.slice(cachedChars));\n\t\t\tinput = Math.max(0, promptTokens - cacheRead);\n\t\t} else {\n\t\t\tcacheWrite = promptTokens;\n\t\t}\n\t\tpromptCache.set(sessionId, promptText);\n\t}\n\n\treturn {\n\t\t...message,\n\t\tusage: {\n\t\t\tinput,\n\t\t\toutput: outputTokens,\n\t\t\tcacheRead,\n\t\t\tcacheWrite,\n\t\t\ttotalTokens: input + outputTokens + cacheRead + cacheWrite,\n\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n\t\t},\n\t};\n}\n\nfunction splitStringByTokenSize(text: string, minTokenSize: number, maxTokenSize: number): string[] {\n\tconst chunks: string[] = [];\n\tlet index = 0;\n\twhile (index < text.length) {\n\t\tconst tokenSize = minTokenSize + Math.floor(Math.random() * (maxTokenSize - minTokenSize + 1));\n\t\tconst charSize = Math.max(1, tokenSize * 4);\n\t\tchunks.push(text.slice(index, index + charSize));\n\t\tindex += charSize;\n\t}\n\treturn chunks.length > 0 ? chunks : [\"\"];\n}\n\nfunction cloneMessage(message: AssistantMessage, api: string, provider: string, modelId: string): AssistantMessage {\n\tconst cloned = structuredClone(message);\n\treturn {\n\t\t...cloned,\n\t\tapi,\n\t\tprovider,\n\t\tmodel: modelId,\n\t\ttimestamp: cloned.timestamp ?? Date.now(),\n\t\tusage: cloned.usage ?? DEFAULT_USAGE,\n\t};\n}\n\nfunction createDeferredMessage(model: Model<string>, handle: DeferredHandle): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: [],\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\tusage: DEFAULT_USAGE,\n\t\tstopReason: \"deferred\",\n\t\tdeferred: handle,\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction createErrorMessage(error: unknown, api: string, provider: string, modelId: string): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: [],\n\t\tapi,\n\t\tprovider,\n\t\tmodel: modelId,\n\t\tusage: DEFAULT_USAGE,\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction createAbortedMessage(partial: AssistantMessage): AssistantMessage {\n\treturn {\n\t\t...partial,\n\t\tstopReason: \"aborted\",\n\t\terrorMessage: \"Request was aborted\",\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction scheduleChunk(chunk: string, tokensPerSecond: number | undefined): Promise<void> {\n\tif (!tokensPerSecond || tokensPerSecond <= 0) {\n\t\treturn new Promise((resolve) => queueMicrotask(resolve));\n\t}\n\tconst delayMs = (estimateTokens(chunk) / tokensPerSecond) * 1000;\n\treturn new Promise((resolve) => setTimeout(resolve, delayMs));\n}\n\nasync function streamWithDeltas(\n\tstream: AssistantMessageEventStream,\n\tmessage: AssistantMessage,\n\tminTokenSize: number,\n\tmaxTokenSize: number,\n\ttokensPerSecond: number | undefined,\n\tsignal: AbortSignal | undefined,\n): Promise<void> {\n\tconst partial: AssistantMessage = { ...message, content: [], stopReason: \"pending\" };\n\tif (signal?.aborted) {\n\t\tconst aborted = createAbortedMessage(partial);\n\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\tstream.end(aborted);\n\t\treturn;\n\t}\n\n\tstream.push({ type: \"start\", partial: { ...partial } });\n\n\tfor (let index = 0; index < message.content.length; index++) {\n\t\tif (signal?.aborted) {\n\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\tstream.end(aborted);\n\t\t\treturn;\n\t\t}\n\n\t\tconst block = message.content[index];\n\n\t\tif (block.type === \"thinking\") {\n\t\t\tpartial.content = [...partial.content, { type: \"thinking\", thinking: \"\" }];\n\t\t\tstream.push({ type: \"thinking_start\", contentIndex: index, partial: { ...partial } });\n\t\t\tfor (const chunk of splitStringByTokenSize(block.thinking, minTokenSize, maxTokenSize)) {\n\t\t\t\tawait scheduleChunk(chunk, tokensPerSecond);\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\t\t\tstream.end(aborted);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t(partial.content[index] as ThinkingContent).thinking += chunk;\n\t\t\t\tstream.push({ type: \"thinking_delta\", contentIndex: index, delta: chunk, partial: { ...partial } });\n\t\t\t}\n\t\t\tstream.push({\n\t\t\t\ttype: \"thinking_end\",\n\t\t\t\tcontentIndex: index,\n\t\t\t\tcontent: block.thinking,\n\t\t\t\tpartial: { ...partial },\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (block.type === \"text\") {\n\t\t\tpartial.content = [...partial.content, { type: \"text\", text: \"\" }];\n\t\t\tstream.push({ type: \"text_start\", contentIndex: index, partial: { ...partial } });\n\t\t\tfor (const chunk of splitStringByTokenSize(block.text, minTokenSize, maxTokenSize)) {\n\t\t\t\tawait scheduleChunk(chunk, tokensPerSecond);\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\t\t\tstream.end(aborted);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t(partial.content[index] as TextContent).text += chunk;\n\t\t\t\tstream.push({ type: \"text_delta\", contentIndex: index, delta: chunk, partial: { ...partial } });\n\t\t\t}\n\t\t\tstream.push({ type: \"text_end\", contentIndex: index, content: block.text, partial: { ...partial } });\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Fallback boundary markers are replay metadata with nothing to stream, but they still\n\t\t// occupy a slot in `partial.content` so later blocks keep their source `contentIndex`.\n\t\t// This matches the real Anthropic provider, which pushes the wire `fallback` block into\n\t\t// `output.content` and emits no event for it; every `contentIndex` consumer indexes\n\t\t// `partial.content` directly, so skipping the slot would shift every later block by one.\n\t\tif (block.type !== \"toolCall\") {\n\t\t\tpartial.content = [...partial.content, block];\n\t\t\tcontinue;\n\t\t}\n\n\t\tpartial.content = [...partial.content, { type: \"toolCall\", id: block.id, name: block.name, arguments: {} }];\n\t\tstream.push({ type: \"toolcall_start\", contentIndex: index, partial: { ...partial } });\n\t\tfor (const chunk of splitStringByTokenSize(JSON.stringify(block.arguments), minTokenSize, maxTokenSize)) {\n\t\t\tawait scheduleChunk(chunk, tokensPerSecond);\n\t\t\tif (signal?.aborted) {\n\t\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\t\tstream.end(aborted);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstream.push({ type: \"toolcall_delta\", contentIndex: index, delta: chunk, partial: { ...partial } });\n\t\t}\n\t\t(partial.content[index] as ToolCall).arguments = block.arguments;\n\t\tstream.push({ type: \"toolcall_end\", contentIndex: index, toolCall: block, partial: { ...partial } });\n\t}\n\n\tif (message.stopReason === \"pending\") {\n\t\tthrow new Error(\"Faux response ended without a stop reason\");\n\t}\n\tif (message.stopReason === \"error\" || message.stopReason === \"aborted\") {\n\t\tstream.push({ type: \"error\", reason: message.stopReason, error: message });\n\t\tstream.end(message);\n\t\treturn;\n\t}\n\n\tstream.push({ type: \"done\", reason: message.stopReason, message });\n\tstream.end(message);\n}\n\nexport function createFauxCore(options: RegisterFauxProviderOptions) {\n\tconst api = options.api ?? randomId(DEFAULT_API);\n\tconst provider = options.provider ?? DEFAULT_PROVIDER;\n\tconst minTokenSize = Math.max(\n\t\t1,\n\t\tMath.min(options.tokenSize?.min ?? DEFAULT_MIN_TOKEN_SIZE, options.tokenSize?.max ?? DEFAULT_MAX_TOKEN_SIZE),\n\t);\n\tconst maxTokenSize = Math.max(minTokenSize, options.tokenSize?.max ?? DEFAULT_MAX_TOKEN_SIZE);\n\tlet pendingResponses: FauxResponseStep[] = [];\n\tconst tokensPerSecond = options.tokensPerSecond;\n\tconst state: FauxProviderState = { callCount: 0, deferredFetchCount: 0, cancelledDeferred: [] };\n\tconst promptCache = new Map<string, string>();\n\tconst deferredResponses = new Map<\n\t\tstring,\n\t\t{\n\t\t\thandle: DeferredHandle;\n\t\t\tstep: FauxResponseStep;\n\t\t\tcontext: Context;\n\t\t\toptions: SimpleStreamOptions | undefined;\n\t\t\tmodel: Model<string>;\n\t\t\tpendingFetches: number;\n\t\t\tcancelled: boolean;\n\t\t\tfinal?: AssistantMessage;\n\t\t}\n\t>();\n\n\tconst modelDefinitions = options.models?.length\n\t\t? options.models\n\t\t: [\n\t\t\t\t{\n\t\t\t\t\tid: DEFAULT_MODEL_ID,\n\t\t\t\t\tname: DEFAULT_MODEL_NAME,\n\t\t\t\t\treasoning: false,\n\t\t\t\t\tinput: [\"text\", \"image\"] as (\"text\" | \"image\")[],\n\t\t\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\t\t\t\tcontextWindow: 128000,\n\t\t\t\t\tmaxTokens: 16384,\n\t\t\t\t},\n\t\t\t];\n\tconst models = modelDefinitions.map((definition) => ({\n\t\tid: definition.id,\n\t\tname: definition.name ?? definition.id,\n\t\tapi,\n\t\tprovider,\n\t\tbaseUrl: DEFAULT_BASE_URL,\n\t\treasoning: definition.reasoning ?? false,\n\t\tinput: definition.input ?? [\"text\", \"image\"],\n\t\tcost: definition.cost ?? { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\tcontextWindow: definition.contextWindow ?? 128000,\n\t\tmaxTokens: definition.maxTokens ?? 16384,\n\t})) as [Model<string>, ...Model<string>[]];\n\n\tconst resolveResponse = async (\n\t\tstep: FauxResponseStep,\n\t\tcontext: Context,\n\t\tstreamOptions: SimpleStreamOptions | undefined,\n\t\trequestModel: Model<string>,\n\t): Promise<AssistantMessage> => {\n\t\tconst resolved = typeof step === \"function\" ? await step(context, streamOptions, state, requestModel) : step;\n\t\treturn withUsageEstimate(\n\t\t\tcloneMessage(resolved, api, provider, requestModel.id),\n\t\t\tcontext,\n\t\t\tstreamOptions,\n\t\t\tpromptCache,\n\t\t);\n\t};\n\n\tconst stream: StreamFunction<string, SimpleStreamOptions> = (requestModel, context, streamOptions) => {\n\t\tconst outer = createAssistantMessageEventStream();\n\t\tconst step = pendingResponses.shift();\n\t\tstate.callCount++;\n\n\t\tqueueMicrotask(async () => {\n\t\t\ttry {\n\t\t\t\tawait streamOptions?.onResponse?.({ status: 200, headers: {} }, requestModel);\n\t\t\t\tif (!step) {\n\t\t\t\t\tlet message = createErrorMessage(\n\t\t\t\t\t\tnew Error(\"No more faux responses queued\"),\n\t\t\t\t\t\tapi,\n\t\t\t\t\t\tprovider,\n\t\t\t\t\t\trequestModel.id,\n\t\t\t\t\t);\n\t\t\t\t\tmessage = withUsageEstimate(message, context, streamOptions, promptCache);\n\t\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\t\touter.end(message);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (streamOptions?.deferred) {\n\t\t\t\t\tconst handle: DeferredHandle = {\n\t\t\t\t\t\tprovider: requestModel.provider,\n\t\t\t\t\t\tmodelId: requestModel.id,\n\t\t\t\t\t\tapi: requestModel.api,\n\t\t\t\t\t\tid: randomId(\"deferred\"),\n\t\t\t\t\t\t...(options.deferred?.pollAfterMs !== undefined ? { pollAfterMs: options.deferred.pollAfterMs } : {}),\n\t\t\t\t\t};\n\t\t\t\t\tdeferredResponses.set(handle.id, {\n\t\t\t\t\t\thandle,\n\t\t\t\t\t\tstep,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\toptions: streamOptions,\n\t\t\t\t\t\tmodel: requestModel,\n\t\t\t\t\t\tpendingFetches: Math.max(0, Math.floor(options.deferred?.pendingFetches ?? 0)),\n\t\t\t\t\t\tcancelled: false,\n\t\t\t\t\t});\n\t\t\t\t\tawait streamWithDeltas(\n\t\t\t\t\t\touter,\n\t\t\t\t\t\tcreateDeferredMessage(requestModel, handle),\n\t\t\t\t\t\tminTokenSize,\n\t\t\t\t\t\tmaxTokenSize,\n\t\t\t\t\t\ttokensPerSecond,\n\t\t\t\t\t\tstreamOptions.signal,\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst message = await resolveResponse(step, context, streamOptions, requestModel);\n\t\t\t\tawait streamWithDeltas(outer, message, minTokenSize, maxTokenSize, tokensPerSecond, streamOptions?.signal);\n\t\t\t} catch (error) {\n\t\t\t\tconst message = createErrorMessage(error, api, provider, requestModel.id);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t}\n\t\t});\n\n\t\treturn outer;\n\t};\n\n\tconst streamSimple: StreamFunction<string, SimpleStreamOptions> = (streamModel, context, streamOptions) =>\n\t\tstream(streamModel, context, streamOptions);\n\n\tconst fetchDeferred = (\n\t\trequestModel: Model<string>,\n\t\thandle: DeferredHandle,\n\t\tfetchOptions?: DeferredFetchOptions,\n\t): AssistantMessageEventStream => {\n\t\tconst outer = createAssistantMessageEventStream();\n\t\tstate.deferredFetchCount++;\n\n\t\tqueueMicrotask(async () => {\n\t\t\ttry {\n\t\t\t\tawait fetchOptions?.onResponse?.({ status: 200, headers: {} }, requestModel);\n\t\t\t\tconst entry = deferredResponses.get(handle.id);\n\t\t\t\tif (\n\t\t\t\t\t!entry ||\n\t\t\t\t\tentry.handle.provider !== handle.provider ||\n\t\t\t\t\tentry.handle.modelId !== handle.modelId ||\n\t\t\t\t\tentry.handle.api !== handle.api\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(`Unknown faux deferred response: ${handle.id}`);\n\t\t\t\t}\n\t\t\t\tif (entry.cancelled) throw new Error(`Faux deferred response was cancelled: ${handle.id}`);\n\n\t\t\t\tif (entry.pendingFetches > 0) {\n\t\t\t\t\tentry.pendingFetches--;\n\t\t\t\t\tawait streamWithDeltas(\n\t\t\t\t\t\touter,\n\t\t\t\t\t\tcreateDeferredMessage(requestModel, entry.handle),\n\t\t\t\t\t\tminTokenSize,\n\t\t\t\t\t\tmaxTokenSize,\n\t\t\t\t\t\ttokensPerSecond,\n\t\t\t\t\t\tfetchOptions?.signal,\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!entry.final) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tdeferred: _deferred,\n\t\t\t\t\t\tsignal: _submissionSignal,\n\t\t\t\t\t\tonResponse: _submissionOnResponse,\n\t\t\t\t\t\t...submissionOptions\n\t\t\t\t\t} = entry.options ?? {};\n\t\t\t\t\ttry {\n\t\t\t\t\t\tentry.final = await resolveResponse(entry.step, entry.context, submissionOptions, entry.model);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tentry.final = createErrorMessage(error, api, provider, entry.model.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait streamWithDeltas(\n\t\t\t\t\touter,\n\t\t\t\t\tentry.final,\n\t\t\t\t\tminTokenSize,\n\t\t\t\t\tmaxTokenSize,\n\t\t\t\t\ttokensPerSecond,\n\t\t\t\t\tfetchOptions?.signal,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tconst message = createErrorMessage(error, api, provider, requestModel.id);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t}\n\t\t});\n\n\t\treturn outer;\n\t};\n\n\tconst cancelDeferred = async (\n\t\trequestModel: Model<string>,\n\t\thandle: DeferredHandle,\n\t\tcancelOptions?: DeferredCancelOptions,\n\t): Promise<void> => {\n\t\tstate.cancelledDeferred.push(structuredClone(handle));\n\t\tconst entry = deferredResponses.get(handle.id);\n\t\tif (entry) entry.cancelled = true;\n\t\tawait cancelOptions?.onResponse?.({ status: 200, headers: {} }, requestModel);\n\t};\n\n\tfunction getModel(): Model<string>;\n\tfunction getModel(requestedModelId: string): Model<string> | undefined;\n\tfunction getModel(requestedModelId?: string): Model<string> | undefined {\n\t\tif (!requestedModelId) {\n\t\t\treturn models[0];\n\t\t}\n\t\treturn models.find((candidate) => candidate.id === requestedModelId);\n\t}\n\n\treturn {\n\t\tapi,\n\t\tprovider,\n\t\tmodels,\n\t\tstream,\n\t\tstreamSimple,\n\t\tfetchDeferred,\n\t\tcancelDeferred,\n\t\tgetModel,\n\t\tstate,\n\t\tsetResponses(responses: FauxResponseStep[]) {\n\t\t\tpendingResponses = [...responses];\n\t\t},\n\t\tappendResponses(responses: FauxResponseStep[]) {\n\t\t\tpendingResponses.push(...responses);\n\t\t},\n\t\tgetPendingResponseCount() {\n\t\t\treturn pendingResponses.length;\n\t\t},\n\t};\n}\n\n/**\n * Faux provider for tests built on explicit `Models` collections:\n *\n * ```ts\n * const faux = fauxProvider();\n * const models = createModels();\n * models.setProvider(faux.provider);\n * faux.setResponses([fauxAssistantMessage(\"hi\")]);\n * ```\n */\nexport function fauxProvider(options: RegisterFauxProviderOptions = {}): FauxProviderHandle {\n\tconst core = createFauxCore(options);\n\tconst provider = createProvider({\n\t\tid: core.provider,\n\t\tauth: { apiKey: { name: \"Faux\", resolve: async () => ({ auth: {} }) } },\n\t\tmodels: core.models,\n\t\tapi: {\n\t\t\tstream: core.stream,\n\t\t\tstreamSimple: core.streamSimple,\n\t\t\tfetchDeferred: core.fetchDeferred,\n\t\t\tcancelDeferred: core.cancelDeferred,\n\t\t},\n\t});\n\treturn {\n\t\tprovider,\n\t\tapi: core.api,\n\t\tmodels: core.models,\n\t\tgetModel: core.getModel,\n\t\tstate: core.state,\n\t\tsetResponses: core.setResponses,\n\t\tappendResponses: core.appendResponses,\n\t\tgetPendingResponseCount: core.getPendingResponseCount,\n\t};\n}\n"]}
1
+ {"version":3,"file":"faux.js","sourceRoot":"","sources":["../../src/providers/faux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,cAAc,CAAC;AAqB7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAClC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AACxC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAC9C,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,sBAAsB,GAAG,CAAC,C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,gBAAgB,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC;QAAA,CAClC;QACD,eAAe,CAAC,SAA6B,EAAE;YAC9C,gBAAgB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QAAA,CACpC;QACD,uBAAuB,GAAG;YACzB,OAAO,gBAAgB,CAAC,MAAM,CAAC;QAAA,CAC/B;KACD,CAAC;AAAA,CACF;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,OAAO,GAAgC,EAAE,EAAsB;IAC3F,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC/B,EAAE,EAAE,IAAI,CAAC,QAAQ;QACjB,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QACvE,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,GAAG,EAAE;YACJ,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,IAAI,CAAC,cAAc;SACnC;KACD,CAAC,CAAC;IACH,OAAO;QACN,QAAQ;QACR,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;KACrD,CAAC;AAAA,CACF","sourcesContent":["import { createProvider, type Provider } from \"../models.ts\";\nimport type {\n\tAssistantMessage,\n\tAssistantMessageEventStream,\n\tDeferredCancelOptions,\n\tDeferredFetchOptions,\n\tDeferredHandle,\n\tDocumentContent,\n\tImageContent,\n\tMessage,\n\tModel,\n\tSimpleStreamOptions,\n\tStreamFunction,\n\tStreamOptions,\n\tTextContent,\n\tThinkingContent,\n\tToolCall,\n\tToolResultMessage,\n\tTranscriptContext,\n\tUsage,\n} from \"../types.ts\";\nimport { createAssistantMessageEventStream } from \"../utils/event-stream.ts\";\nimport { getSystemMessageText } from \"../utils/text.ts\";\n\nconst DEFAULT_API = \"faux\";\nconst DEFAULT_PROVIDER = \"faux\";\nconst DEFAULT_MODEL_ID = \"faux-1\";\nconst DEFAULT_MODEL_NAME = \"Faux Model\";\nconst DEFAULT_BASE_URL = \"http://localhost:0\";\nconst DEFAULT_MIN_TOKEN_SIZE = 3;\nconst DEFAULT_MAX_TOKEN_SIZE = 5;\n\nconst DEFAULT_USAGE: Usage = {\n\tinput: 0,\n\toutput: 0,\n\tcacheRead: 0,\n\tcacheWrite: 0,\n\ttotalTokens: 0,\n\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n};\n\nexport interface FauxModelDefinition {\n\tid: string;\n\tname?: string;\n\treasoning?: boolean;\n\tinput?: (\"text\" | \"image\")[];\n\tinputLimits?: Model<string>[\"inputLimits\"];\n\tcost?: { input: number; output: number; cacheRead: number; cacheWrite: number };\n\tcontextWindow?: number;\n\tmaxTokens?: number;\n}\n\nexport type FauxContentBlock = TextContent | ThinkingContent | ToolCall;\n\nexport function fauxText(text: string): TextContent {\n\treturn { type: \"text\", text };\n}\n\nexport function fauxThinking(thinking: string): ThinkingContent {\n\treturn { type: \"thinking\", thinking };\n}\n\nexport function fauxToolCall(name: string, arguments_: ToolCall[\"arguments\"], options: { id?: string } = {}): ToolCall {\n\treturn {\n\t\ttype: \"toolCall\",\n\t\tid: options.id ?? randomId(\"tool\"),\n\t\tname,\n\t\targuments: arguments_,\n\t};\n}\n\nfunction normalizeFauxAssistantContent(content: string | FauxContentBlock | FauxContentBlock[]): FauxContentBlock[] {\n\tif (typeof content === \"string\") {\n\t\treturn [fauxText(content)];\n\t}\n\treturn Array.isArray(content) ? content : [content];\n}\n\nexport function fauxAssistantMessage(\n\tcontent: string | FauxContentBlock | FauxContentBlock[],\n\toptions: {\n\t\tstopReason?: AssistantMessage[\"stopReason\"];\n\t\tdeferred?: DeferredHandle;\n\t\terrorMessage?: string;\n\t\tresponseId?: string;\n\t\ttimestamp?: number;\n\t} = {},\n): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: normalizeFauxAssistantContent(content),\n\t\tapi: DEFAULT_API,\n\t\tprovider: DEFAULT_PROVIDER,\n\t\tmodel: DEFAULT_MODEL_ID,\n\t\tusage: DEFAULT_USAGE,\n\t\tstopReason: options.stopReason ?? \"stop\",\n\t\tdeferred: options.deferred,\n\t\terrorMessage: options.errorMessage,\n\t\tresponseId: options.responseId,\n\t\ttimestamp: options.timestamp ?? Date.now(),\n\t};\n}\n\nexport interface FauxProviderState {\n\tcallCount: number;\n\tdeferredFetchCount: number;\n\tcancelledDeferred: DeferredHandle[];\n}\n\nexport type FauxResponseFactory = (\n\tcontext: TranscriptContext,\n\toptions: SimpleStreamOptions | undefined,\n\tstate: FauxProviderState,\n\tmodel: Model<string>,\n) => AssistantMessage | Promise<AssistantMessage>;\n\nexport type FauxResponseStep = AssistantMessage | FauxResponseFactory;\n\nexport interface RegisterFauxProviderOptions {\n\tapi?: string;\n\tprovider?: string;\n\tmodels?: FauxModelDefinition[];\n\tdeferred?: {\n\t\t/** Number of fetches that return the original handle before the scripted response becomes ready. */\n\t\tpendingFetches?: number;\n\t\tpollAfterMs?: number;\n\t};\n\ttokensPerSecond?: number;\n\ttokenSize?: {\n\t\tmin?: number;\n\t\tmax?: number;\n\t};\n}\n\nexport interface FauxProviderRegistration {\n\tapi: string;\n\tmodels: [Model<string>, ...Model<string>[]];\n\tgetModel(): Model<string>;\n\tgetModel(modelId: string): Model<string> | undefined;\n\tstate: FauxProviderState;\n\tsetResponses: (responses: FauxResponseStep[]) => void;\n\tappendResponses: (responses: FauxResponseStep[]) => void;\n\tgetPendingResponseCount: () => number;\n\tunregister: () => void;\n}\n\nexport interface FauxProviderHandle {\n\tprovider: Provider;\n\tapi: string;\n\tmodels: [Model<string>, ...Model<string>[]];\n\tgetModel(): Model<string>;\n\tgetModel(modelId: string): Model<string> | undefined;\n\tstate: FauxProviderState;\n\tsetResponses: (responses: FauxResponseStep[]) => void;\n\tappendResponses: (responses: FauxResponseStep[]) => void;\n\tgetPendingResponseCount: () => number;\n}\n\nfunction estimateTokens(text: string): number {\n\treturn Math.ceil(text.length / 4);\n}\n\nfunction randomId(prefix: string): string {\n\treturn `${prefix}:${Date.now()}:${Math.random().toString(36).slice(2)}`;\n}\n\nfunction contentToText(content: string | Array<TextContent | ImageContent | DocumentContent>): string {\n\tif (typeof content === \"string\") {\n\t\treturn content;\n\t}\n\treturn content\n\t\t.map((block) => {\n\t\t\tif (block.type === \"text\") {\n\t\t\t\treturn block.text;\n\t\t\t}\n\t\t\tif (block.type === \"document\") {\n\t\t\t\treturn `[document:${block.mimeType}:${block.data.length}]`;\n\t\t\t}\n\t\t\treturn `[image:${block.mimeType}:${block.data.length}]`;\n\t\t})\n\t\t.join(\"\\n\");\n}\n\nfunction assistantContentToText(content: AssistantMessage[\"content\"]): string {\n\treturn content\n\t\t.map((block) => {\n\t\t\tif (block.type === \"text\") {\n\t\t\t\treturn block.text;\n\t\t\t}\n\t\t\tif (block.type === \"thinking\") {\n\t\t\t\treturn block.thinking;\n\t\t\t}\n\t\t\t// Fallback boundary markers carry no text.\n\t\t\tif (block.type !== \"toolCall\") {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\treturn `${block.name}:${JSON.stringify(block.arguments)}`;\n\t\t})\n\t\t.join(\"\\n\");\n}\n\nfunction toolResultToText(message: ToolResultMessage): string {\n\treturn [message.toolName, ...message.content.map((block) => contentToText([block]))].join(\"\\n\");\n}\n\nfunction messageToText(message: Message): string {\n\tif (message.role === \"system\") {\n\t\treturn [\n\t\t\tgetSystemMessageText(message),\n\t\t\t...(message.toolsRemoved?.map((tool) => `tool-:${JSON.stringify(tool)}`) ?? []),\n\t\t\t...(message.toolsAdded?.map((tool) => `tool+:${JSON.stringify(tool)}`) ?? []),\n\t\t]\n\t\t\t.filter((part) => part.length > 0)\n\t\t\t.join(\"\\n\");\n\t}\n\tif (message.role === \"user\") {\n\t\treturn contentToText(message.content);\n\t}\n\tif (message.role === \"assistant\") {\n\t\treturn assistantContentToText(message.content);\n\t}\n\treturn toolResultToText(message);\n}\n\nfunction serializeContext(context: TranscriptContext): string {\n\treturn context.messages.map((message) => `${message.role}:${messageToText(message)}`).join(\"\\n\\n\");\n}\n\nfunction commonPrefixLength(a: string, b: string): number {\n\tconst length = Math.min(a.length, b.length);\n\tlet index = 0;\n\twhile (index < length && a[index] === b[index]) {\n\t\tindex++;\n\t}\n\treturn index;\n}\n\nfunction withUsageEstimate(\n\tmessage: AssistantMessage,\n\tcontext: TranscriptContext,\n\toptions: StreamOptions | undefined,\n\tpromptCache: Map<string, string>,\n): AssistantMessage {\n\tconst promptText = serializeContext(context);\n\tconst promptTokens = estimateTokens(promptText);\n\tconst outputTokens = estimateTokens(assistantContentToText(message.content));\n\tlet input = promptTokens;\n\tlet cacheRead = 0;\n\tlet cacheWrite = 0;\n\tconst sessionId = options?.sessionId;\n\n\tif (sessionId && options?.cacheRetention !== \"none\") {\n\t\tconst previousPrompt = promptCache.get(sessionId);\n\t\tif (previousPrompt) {\n\t\t\tconst cachedChars = commonPrefixLength(previousPrompt, promptText);\n\t\t\tcacheRead = estimateTokens(previousPrompt.slice(0, cachedChars));\n\t\t\tcacheWrite = estimateTokens(promptText.slice(cachedChars));\n\t\t\tinput = Math.max(0, promptTokens - cacheRead);\n\t\t} else {\n\t\t\tcacheWrite = promptTokens;\n\t\t}\n\t\tpromptCache.set(sessionId, promptText);\n\t}\n\n\treturn {\n\t\t...message,\n\t\tusage: {\n\t\t\tinput,\n\t\t\toutput: outputTokens,\n\t\t\tcacheRead,\n\t\t\tcacheWrite,\n\t\t\ttotalTokens: input + outputTokens + cacheRead + cacheWrite,\n\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n\t\t},\n\t};\n}\n\nfunction splitStringByTokenSize(text: string, minTokenSize: number, maxTokenSize: number): string[] {\n\tconst chunks: string[] = [];\n\tlet index = 0;\n\twhile (index < text.length) {\n\t\tconst tokenSize = minTokenSize + Math.floor(Math.random() * (maxTokenSize - minTokenSize + 1));\n\t\tconst charSize = Math.max(1, tokenSize * 4);\n\t\tchunks.push(text.slice(index, index + charSize));\n\t\tindex += charSize;\n\t}\n\treturn chunks.length > 0 ? chunks : [\"\"];\n}\n\nfunction cloneMessage(message: AssistantMessage, api: string, provider: string, modelId: string): AssistantMessage {\n\tconst cloned = structuredClone(message);\n\treturn {\n\t\t...cloned,\n\t\tapi,\n\t\tprovider,\n\t\tmodel: modelId,\n\t\ttimestamp: cloned.timestamp ?? Date.now(),\n\t\tusage: cloned.usage ?? DEFAULT_USAGE,\n\t};\n}\n\nfunction createDeferredMessage(model: Model<string>, handle: DeferredHandle): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: [],\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\tusage: DEFAULT_USAGE,\n\t\tstopReason: \"deferred\",\n\t\tdeferred: handle,\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction createErrorMessage(error: unknown, api: string, provider: string, modelId: string): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: [],\n\t\tapi,\n\t\tprovider,\n\t\tmodel: modelId,\n\t\tusage: DEFAULT_USAGE,\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction createAbortedMessage(partial: AssistantMessage): AssistantMessage {\n\treturn {\n\t\t...partial,\n\t\tstopReason: \"aborted\",\n\t\terrorMessage: \"Request was aborted\",\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction scheduleChunk(chunk: string, tokensPerSecond: number | undefined): Promise<void> {\n\tif (!tokensPerSecond || tokensPerSecond <= 0) {\n\t\treturn new Promise((resolve) => queueMicrotask(resolve));\n\t}\n\tconst delayMs = (estimateTokens(chunk) / tokensPerSecond) * 1000;\n\treturn new Promise((resolve) => setTimeout(resolve, delayMs));\n}\n\nasync function streamWithDeltas(\n\tstream: AssistantMessageEventStream,\n\tmessage: AssistantMessage,\n\tminTokenSize: number,\n\tmaxTokenSize: number,\n\ttokensPerSecond: number | undefined,\n\tsignal: AbortSignal | undefined,\n): Promise<void> {\n\tconst partial: AssistantMessage = { ...message, content: [], stopReason: \"pending\" };\n\tif (signal?.aborted) {\n\t\tconst aborted = createAbortedMessage(partial);\n\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\tstream.end(aborted);\n\t\treturn;\n\t}\n\n\tstream.push({ type: \"start\", partial: { ...partial } });\n\n\tfor (let index = 0; index < message.content.length; index++) {\n\t\tif (signal?.aborted) {\n\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\tstream.end(aborted);\n\t\t\treturn;\n\t\t}\n\n\t\tconst block = message.content[index];\n\n\t\tif (block.type === \"thinking\") {\n\t\t\tpartial.content = [...partial.content, { type: \"thinking\", thinking: \"\" }];\n\t\t\tstream.push({ type: \"thinking_start\", contentIndex: index, partial: { ...partial } });\n\t\t\tfor (const chunk of splitStringByTokenSize(block.thinking, minTokenSize, maxTokenSize)) {\n\t\t\t\tawait scheduleChunk(chunk, tokensPerSecond);\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\t\t\tstream.end(aborted);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t(partial.content[index] as ThinkingContent).thinking += chunk;\n\t\t\t\tstream.push({ type: \"thinking_delta\", contentIndex: index, delta: chunk, partial: { ...partial } });\n\t\t\t}\n\t\t\tstream.push({\n\t\t\t\ttype: \"thinking_end\",\n\t\t\t\tcontentIndex: index,\n\t\t\t\tcontent: block.thinking,\n\t\t\t\tpartial: { ...partial },\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (block.type === \"text\") {\n\t\t\tpartial.content = [...partial.content, { type: \"text\", text: \"\" }];\n\t\t\tstream.push({ type: \"text_start\", contentIndex: index, partial: { ...partial } });\n\t\t\tfor (const chunk of splitStringByTokenSize(block.text, minTokenSize, maxTokenSize)) {\n\t\t\t\tawait scheduleChunk(chunk, tokensPerSecond);\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\t\t\tstream.end(aborted);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t(partial.content[index] as TextContent).text += chunk;\n\t\t\t\tstream.push({ type: \"text_delta\", contentIndex: index, delta: chunk, partial: { ...partial } });\n\t\t\t}\n\t\t\tstream.push({ type: \"text_end\", contentIndex: index, content: block.text, partial: { ...partial } });\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Fallback boundary markers are replay metadata with nothing to stream, but they still\n\t\t// occupy a slot in `partial.content` so later blocks keep their source `contentIndex`.\n\t\t// This matches the real Anthropic provider, which pushes the wire `fallback` block into\n\t\t// `output.content` and emits no event for it; every `contentIndex` consumer indexes\n\t\t// `partial.content` directly, so skipping the slot would shift every later block by one.\n\t\tif (block.type !== \"toolCall\") {\n\t\t\tpartial.content = [...partial.content, block];\n\t\t\tcontinue;\n\t\t}\n\n\t\tpartial.content = [...partial.content, { type: \"toolCall\", id: block.id, name: block.name, arguments: {} }];\n\t\tstream.push({ type: \"toolcall_start\", contentIndex: index, partial: { ...partial } });\n\t\tfor (const chunk of splitStringByTokenSize(JSON.stringify(block.arguments), minTokenSize, maxTokenSize)) {\n\t\t\tawait scheduleChunk(chunk, tokensPerSecond);\n\t\t\tif (signal?.aborted) {\n\t\t\t\tconst aborted = createAbortedMessage(partial);\n\t\t\t\tstream.push({ type: \"error\", reason: \"aborted\", error: aborted });\n\t\t\t\tstream.end(aborted);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tstream.push({ type: \"toolcall_delta\", contentIndex: index, delta: chunk, partial: { ...partial } });\n\t\t}\n\t\t(partial.content[index] as ToolCall).arguments = block.arguments;\n\t\tstream.push({ type: \"toolcall_end\", contentIndex: index, toolCall: block, partial: { ...partial } });\n\t}\n\n\tif (message.stopReason === \"pending\") {\n\t\tthrow new Error(\"Faux response ended without a stop reason\");\n\t}\n\tif (message.stopReason === \"error\" || message.stopReason === \"aborted\") {\n\t\tstream.push({ type: \"error\", reason: message.stopReason, error: message });\n\t\tstream.end(message);\n\t\treturn;\n\t}\n\n\tstream.push({ type: \"done\", reason: message.stopReason, message });\n\tstream.end(message);\n}\n\nexport function createFauxCore(options: RegisterFauxProviderOptions) {\n\tconst api = options.api ?? randomId(DEFAULT_API);\n\tconst provider = options.provider ?? DEFAULT_PROVIDER;\n\tconst minTokenSize = Math.max(\n\t\t1,\n\t\tMath.min(options.tokenSize?.min ?? DEFAULT_MIN_TOKEN_SIZE, options.tokenSize?.max ?? DEFAULT_MAX_TOKEN_SIZE),\n\t);\n\tconst maxTokenSize = Math.max(minTokenSize, options.tokenSize?.max ?? DEFAULT_MAX_TOKEN_SIZE);\n\tlet pendingResponses: FauxResponseStep[] = [];\n\tconst tokensPerSecond = options.tokensPerSecond;\n\tconst state: FauxProviderState = { callCount: 0, deferredFetchCount: 0, cancelledDeferred: [] };\n\tconst promptCache = new Map<string, string>();\n\tconst deferredResponses = new Map<\n\t\tstring,\n\t\t{\n\t\t\thandle: DeferredHandle;\n\t\t\tstep: FauxResponseStep;\n\t\t\tcontext: TranscriptContext;\n\t\t\toptions: SimpleStreamOptions | undefined;\n\t\t\tmodel: Model<string>;\n\t\t\tpendingFetches: number;\n\t\t\tcancelled: boolean;\n\t\t\tfinal?: AssistantMessage;\n\t\t}\n\t>();\n\n\tconst modelDefinitions = options.models?.length\n\t\t? options.models\n\t\t: [\n\t\t\t\t{\n\t\t\t\t\tid: DEFAULT_MODEL_ID,\n\t\t\t\t\tname: DEFAULT_MODEL_NAME,\n\t\t\t\t\treasoning: false,\n\t\t\t\t\tinput: [\"text\", \"image\"] as (\"text\" | \"image\")[],\n\t\t\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\t\t\t\tcontextWindow: 128000,\n\t\t\t\t\tmaxTokens: 16384,\n\t\t\t\t},\n\t\t\t];\n\tconst models = modelDefinitions.map((definition) => ({\n\t\tid: definition.id,\n\t\tname: definition.name ?? definition.id,\n\t\tapi,\n\t\tprovider,\n\t\tbaseUrl: DEFAULT_BASE_URL,\n\t\treasoning: definition.reasoning ?? false,\n\t\tinput: definition.input ?? [\"text\", \"image\"],\n\t\tinputLimits: definition.inputLimits,\n\t\tcost: definition.cost ?? { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },\n\t\tcontextWindow: definition.contextWindow ?? 128000,\n\t\tmaxTokens: definition.maxTokens ?? 16384,\n\t})) as [Model<string>, ...Model<string>[]];\n\n\tconst resolveResponse = async (\n\t\tstep: FauxResponseStep,\n\t\tcontext: TranscriptContext,\n\t\tstreamOptions: SimpleStreamOptions | undefined,\n\t\trequestModel: Model<string>,\n\t): Promise<AssistantMessage> => {\n\t\tconst resolved = typeof step === \"function\" ? await step(context, streamOptions, state, requestModel) : step;\n\t\treturn withUsageEstimate(\n\t\t\tcloneMessage(resolved, api, provider, requestModel.id),\n\t\t\tcontext,\n\t\t\tstreamOptions,\n\t\t\tpromptCache,\n\t\t);\n\t};\n\n\tconst stream: StreamFunction<string, SimpleStreamOptions> = (requestModel, context, streamOptions) => {\n\t\tconst outer = createAssistantMessageEventStream();\n\t\tconst step = pendingResponses.shift();\n\t\tstate.callCount++;\n\n\t\tqueueMicrotask(async () => {\n\t\t\ttry {\n\t\t\t\tawait streamOptions?.onResponse?.({ status: 200, headers: {} }, requestModel);\n\t\t\t\tif (!step) {\n\t\t\t\t\tlet message = createErrorMessage(\n\t\t\t\t\t\tnew Error(\"No more faux responses queued\"),\n\t\t\t\t\t\tapi,\n\t\t\t\t\t\tprovider,\n\t\t\t\t\t\trequestModel.id,\n\t\t\t\t\t);\n\t\t\t\t\tmessage = withUsageEstimate(message, context, streamOptions, promptCache);\n\t\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\t\touter.end(message);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (streamOptions?.deferred) {\n\t\t\t\t\tconst handle: DeferredHandle = {\n\t\t\t\t\t\tprovider: requestModel.provider,\n\t\t\t\t\t\tmodelId: requestModel.id,\n\t\t\t\t\t\tapi: requestModel.api,\n\t\t\t\t\t\tid: randomId(\"deferred\"),\n\t\t\t\t\t\t...(options.deferred?.pollAfterMs !== undefined ? { pollAfterMs: options.deferred.pollAfterMs } : {}),\n\t\t\t\t\t};\n\t\t\t\t\tdeferredResponses.set(handle.id, {\n\t\t\t\t\t\thandle,\n\t\t\t\t\t\tstep,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\toptions: streamOptions,\n\t\t\t\t\t\tmodel: requestModel,\n\t\t\t\t\t\tpendingFetches: Math.max(0, Math.floor(options.deferred?.pendingFetches ?? 0)),\n\t\t\t\t\t\tcancelled: false,\n\t\t\t\t\t});\n\t\t\t\t\tawait streamWithDeltas(\n\t\t\t\t\t\touter,\n\t\t\t\t\t\tcreateDeferredMessage(requestModel, handle),\n\t\t\t\t\t\tminTokenSize,\n\t\t\t\t\t\tmaxTokenSize,\n\t\t\t\t\t\ttokensPerSecond,\n\t\t\t\t\t\tstreamOptions.signal,\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst message = await resolveResponse(step, context, streamOptions, requestModel);\n\t\t\t\tawait streamWithDeltas(outer, message, minTokenSize, maxTokenSize, tokensPerSecond, streamOptions?.signal);\n\t\t\t} catch (error) {\n\t\t\t\tconst message = createErrorMessage(error, api, provider, requestModel.id);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t}\n\t\t});\n\n\t\treturn outer;\n\t};\n\n\tconst streamSimple: StreamFunction<string, SimpleStreamOptions> = (streamModel, context, streamOptions) =>\n\t\tstream(streamModel, context, streamOptions);\n\n\tconst fetchDeferred = (\n\t\trequestModel: Model<string>,\n\t\thandle: DeferredHandle,\n\t\tfetchOptions?: DeferredFetchOptions,\n\t): AssistantMessageEventStream => {\n\t\tconst outer = createAssistantMessageEventStream();\n\t\tstate.deferredFetchCount++;\n\n\t\tqueueMicrotask(async () => {\n\t\t\ttry {\n\t\t\t\tawait fetchOptions?.onResponse?.({ status: 200, headers: {} }, requestModel);\n\t\t\t\tconst entry = deferredResponses.get(handle.id);\n\t\t\t\tif (\n\t\t\t\t\t!entry ||\n\t\t\t\t\tentry.handle.provider !== handle.provider ||\n\t\t\t\t\tentry.handle.modelId !== handle.modelId ||\n\t\t\t\t\tentry.handle.api !== handle.api\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(`Unknown faux deferred response: ${handle.id}`);\n\t\t\t\t}\n\t\t\t\tif (entry.cancelled) throw new Error(`Faux deferred response was cancelled: ${handle.id}`);\n\n\t\t\t\tif (entry.pendingFetches > 0) {\n\t\t\t\t\tentry.pendingFetches--;\n\t\t\t\t\tawait streamWithDeltas(\n\t\t\t\t\t\touter,\n\t\t\t\t\t\tcreateDeferredMessage(requestModel, entry.handle),\n\t\t\t\t\t\tminTokenSize,\n\t\t\t\t\t\tmaxTokenSize,\n\t\t\t\t\t\ttokensPerSecond,\n\t\t\t\t\t\tfetchOptions?.signal,\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!entry.final) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tdeferred: _deferred,\n\t\t\t\t\t\tsignal: _submissionSignal,\n\t\t\t\t\t\tonResponse: _submissionOnResponse,\n\t\t\t\t\t\t...submissionOptions\n\t\t\t\t\t} = entry.options ?? {};\n\t\t\t\t\ttry {\n\t\t\t\t\t\tentry.final = await resolveResponse(entry.step, entry.context, submissionOptions, entry.model);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tentry.final = createErrorMessage(error, api, provider, entry.model.id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait streamWithDeltas(\n\t\t\t\t\touter,\n\t\t\t\t\tentry.final,\n\t\t\t\t\tminTokenSize,\n\t\t\t\t\tmaxTokenSize,\n\t\t\t\t\ttokensPerSecond,\n\t\t\t\t\tfetchOptions?.signal,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tconst message = createErrorMessage(error, api, provider, requestModel.id);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t}\n\t\t});\n\n\t\treturn outer;\n\t};\n\n\tconst cancelDeferred = async (\n\t\trequestModel: Model<string>,\n\t\thandle: DeferredHandle,\n\t\tcancelOptions?: DeferredCancelOptions,\n\t): Promise<void> => {\n\t\tstate.cancelledDeferred.push(structuredClone(handle));\n\t\tconst entry = deferredResponses.get(handle.id);\n\t\tif (entry) entry.cancelled = true;\n\t\tawait cancelOptions?.onResponse?.({ status: 200, headers: {} }, requestModel);\n\t};\n\n\tfunction getModel(): Model<string>;\n\tfunction getModel(requestedModelId: string): Model<string> | undefined;\n\tfunction getModel(requestedModelId?: string): Model<string> | undefined {\n\t\tif (!requestedModelId) {\n\t\t\treturn models[0];\n\t\t}\n\t\treturn models.find((candidate) => candidate.id === requestedModelId);\n\t}\n\n\treturn {\n\t\tapi,\n\t\tprovider,\n\t\tmodels,\n\t\tstream,\n\t\tstreamSimple,\n\t\tfetchDeferred,\n\t\tcancelDeferred,\n\t\tgetModel,\n\t\tstate,\n\t\tsetResponses(responses: FauxResponseStep[]) {\n\t\t\tpendingResponses = [...responses];\n\t\t},\n\t\tappendResponses(responses: FauxResponseStep[]) {\n\t\t\tpendingResponses.push(...responses);\n\t\t},\n\t\tgetPendingResponseCount() {\n\t\t\treturn pendingResponses.length;\n\t\t},\n\t};\n}\n\n/**\n * Faux provider for tests built on explicit `Models` collections:\n *\n * ```ts\n * const faux = fauxProvider();\n * const models = createModels();\n * models.setProvider(faux.provider);\n * faux.setResponses([fauxAssistantMessage(\"hi\")]);\n * ```\n */\nexport function fauxProvider(options: RegisterFauxProviderOptions = {}): FauxProviderHandle {\n\tconst core = createFauxCore(options);\n\tconst provider = createProvider({\n\t\tid: core.provider,\n\t\tauth: { apiKey: { name: \"Faux\", resolve: async () => ({ auth: {} }) } },\n\t\tmodels: core.models,\n\t\tapi: {\n\t\t\tstream: core.stream,\n\t\t\tstreamSimple: core.streamSimple,\n\t\t\tfetchDeferred: core.fetchDeferred,\n\t\t\tcancelDeferred: core.cancelDeferred,\n\t\t},\n\t});\n\treturn {\n\t\tprovider,\n\t\tapi: core.api,\n\t\tmodels: core.models,\n\t\tgetModel: core.getModel,\n\t\tstate: core.state,\n\t\tsetResponses: core.setResponses,\n\t\tappendResponses: core.appendResponses,\n\t\tgetPendingResponseCount: core.getPendingResponseCount,\n\t};\n}\n"]}
@@ -1,4 +1,5 @@
1
- import values from "./data/fireworks.json";
2
- import { type ModelCatalog } from "../model-catalog.ts";
3
- export declare const FIREWORKS_MODELS: ModelCatalog<typeof values, "fireworks">;
1
+ import { type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from "../model-catalog.ts";
2
+ export declare const FIREWORKS_MODELS: ChatModelCatalog<typeof import("./data/fireworks.json", { with: { type: "json" } }), "fireworks">;
3
+ export declare const FIREWORKS_IMAGE_MODELS: ImageModelCatalog<typeof import("./data/fireworks.json", { with: { type: "json" } }), "fireworks">;
4
+ export declare const FIREWORKS_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import("./data/fireworks.json", { with: { type: "json" } }), "fireworks">;
4
5
  //# sourceMappingURL=fireworks.models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fireworks.models.d.ts","sourceRoot":"","sources":["../../src/providers/fireworks.models.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,uBAAuB,CAAuB;AACjE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,OAAO,MAAM,EAAE,WAAW,CAC7B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/fireworks.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const FIREWORKS_MODELS: ModelCatalog<typeof values, \"fireworks\"> =\n\tflattenModelCatalog(\"fireworks\", values);\n"]}
1
+ {"version":3,"file":"fireworks.models.d.ts","sourceRoot":"","sources":["../../src/providers/fireworks.models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoF,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnM,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,cAAc,uBAAuB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,WAAW,CAClF,CAAC;AAE9C,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,cAAc,uBAAuB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,WAAW,CACxF,CAAC;AAE/C,eAAO,MAAM,2BAA2B,EAAE,sBAAsB,CAAC,cAAc,uBAAuB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,WAAW,CAC7F,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/fireworks.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const FIREWORKS_MODELS: ChatModelCatalog<typeof import(\"./data/fireworks.json\", { with: { type: \"json\" } }), \"fireworks\"> =\n\tflattenChatModelCatalog(\"fireworks\", values);\n\nexport const FIREWORKS_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/fireworks.json\", { with: { type: \"json\" } }), \"fireworks\"> =\n\tflattenImageModelCatalog(\"fireworks\", values);\n\nexport const FIREWORKS_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/fireworks.json\", { with: { type: \"json\" } }), \"fireworks\"> =\n\tflattenClassifierModelCatalog(\"fireworks\", values);\n"]}
@@ -1,6 +1,8 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually - run 'npm run generate-models' to update
3
3
  import values from "./data/fireworks.json" with { type: "json" };
4
- import { flattenModelCatalog } from "../model-catalog.js";
5
- export const FIREWORKS_MODELS = flattenModelCatalog("fireworks", values);
4
+ import { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog } from "../model-catalog.js";
5
+ export const FIREWORKS_MODELS = flattenChatModelCatalog("fireworks", values);
6
+ export const FIREWORKS_IMAGE_MODELS = flattenImageModelCatalog("fireworks", values);
7
+ export const FIREWORKS_CLASSIFIER_MODELS = flattenClassifierModelCatalog("fireworks", values);
6
8
  //# sourceMappingURL=fireworks.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fireworks.models.js","sourceRoot":"","sources":["../../src/providers/fireworks.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAC5B,mBAAmB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/fireworks.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const FIREWORKS_MODELS: ModelCatalog<typeof values, \"fireworks\"> =\n\tflattenModelCatalog(\"fireworks\", values);\n"]}
1
+ {"version":3,"file":"fireworks.models.js","sourceRoot":"","sources":["../../src/providers/fireworks.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,6BAA6B,EAA8E,MAAM,qBAAqB,CAAC;AAEnM,MAAM,CAAC,MAAM,gBAAgB,GAC5B,uBAAuB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,CAAC,MAAM,sBAAsB,GAClC,wBAAwB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,2BAA2B,GACvC,6BAA6B,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/fireworks.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const FIREWORKS_MODELS: ChatModelCatalog<typeof import(\"./data/fireworks.json\", { with: { type: \"json\" } }), \"fireworks\"> =\n\tflattenChatModelCatalog(\"fireworks\", values);\n\nexport const FIREWORKS_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/fireworks.json\", { with: { type: \"json\" } }), \"fireworks\"> =\n\tflattenImageModelCatalog(\"fireworks\", values);\n\nexport const FIREWORKS_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/fireworks.json\", { with: { type: \"json\" } }), \"fireworks\"> =\n\tflattenClassifierModelCatalog(\"fireworks\", values);\n"]}
@@ -1,4 +1,5 @@
1
- import values from "./data/github-copilot.json";
2
- import { type ModelCatalog } from "../model-catalog.ts";
3
- export declare const GITHUB_COPILOT_MODELS: ModelCatalog<typeof values, "github-copilot">;
1
+ import { type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from "../model-catalog.ts";
2
+ export declare const GITHUB_COPILOT_MODELS: ChatModelCatalog<typeof import("./data/github-copilot.json", { with: { type: "json" } }), "github-copilot">;
3
+ export declare const GITHUB_COPILOT_IMAGE_MODELS: ImageModelCatalog<typeof import("./data/github-copilot.json", { with: { type: "json" } }), "github-copilot">;
4
+ export declare const GITHUB_COPILOT_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import("./data/github-copilot.json", { with: { type: "json" } }), "github-copilot">;
4
5
  //# sourceMappingURL=github-copilot.models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"github-copilot.models.d.ts","sourceRoot":"","sources":["../../src/providers/github-copilot.models.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,4BAA4B,CAAuB;AACtE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,OAAO,MAAM,EAAE,gBAAgB,CAClC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/github-copilot.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GITHUB_COPILOT_MODELS: ModelCatalog<typeof values, \"github-copilot\"> =\n\tflattenModelCatalog(\"github-copilot\", values);\n"]}
1
+ {"version":3,"file":"github-copilot.models.d.ts","sourceRoot":"","sources":["../../src/providers/github-copilot.models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoF,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnM,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,cAAc,4BAA4B,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,gBAAgB,CAC5F,CAAC;AAEnD,eAAO,MAAM,2BAA2B,EAAE,iBAAiB,CAAC,cAAc,4BAA4B,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,gBAAgB,CAClG,CAAC;AAEpD,eAAO,MAAM,gCAAgC,EAAE,sBAAsB,CAAC,cAAc,4BAA4B,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,gBAAgB,CACvG,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/github-copilot.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GITHUB_COPILOT_MODELS: ChatModelCatalog<typeof import(\"./data/github-copilot.json\", { with: { type: \"json\" } }), \"github-copilot\"> =\n\tflattenChatModelCatalog(\"github-copilot\", values);\n\nexport const GITHUB_COPILOT_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/github-copilot.json\", { with: { type: \"json\" } }), \"github-copilot\"> =\n\tflattenImageModelCatalog(\"github-copilot\", values);\n\nexport const GITHUB_COPILOT_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/github-copilot.json\", { with: { type: \"json\" } }), \"github-copilot\"> =\n\tflattenClassifierModelCatalog(\"github-copilot\", values);\n"]}
@@ -1,6 +1,8 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually - run 'npm run generate-models' to update
3
3
  import values from "./data/github-copilot.json" with { type: "json" };
4
- import { flattenModelCatalog } from "../model-catalog.js";
5
- export const GITHUB_COPILOT_MODELS = flattenModelCatalog("github-copilot", values);
4
+ import { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog } from "../model-catalog.js";
5
+ export const GITHUB_COPILOT_MODELS = flattenChatModelCatalog("github-copilot", values);
6
+ export const GITHUB_COPILOT_IMAGE_MODELS = flattenImageModelCatalog("github-copilot", values);
7
+ export const GITHUB_COPILOT_CLASSIFIER_MODELS = flattenClassifierModelCatalog("github-copilot", values);
6
8
  //# sourceMappingURL=github-copilot.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"github-copilot.models.js","sourceRoot":"","sources":["../../src/providers/github-copilot.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,qBAAqB,GACjC,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/github-copilot.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GITHUB_COPILOT_MODELS: ModelCatalog<typeof values, \"github-copilot\"> =\n\tflattenModelCatalog(\"github-copilot\", values);\n"]}
1
+ {"version":3,"file":"github-copilot.models.js","sourceRoot":"","sources":["../../src/providers/github-copilot.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,6BAA6B,EAA8E,MAAM,qBAAqB,CAAC;AAEnM,MAAM,CAAC,MAAM,qBAAqB,GACjC,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,2BAA2B,GACvC,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,gCAAgC,GAC5C,6BAA6B,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/github-copilot.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GITHUB_COPILOT_MODELS: ChatModelCatalog<typeof import(\"./data/github-copilot.json\", { with: { type: \"json\" } }), \"github-copilot\"> =\n\tflattenChatModelCatalog(\"github-copilot\", values);\n\nexport const GITHUB_COPILOT_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/github-copilot.json\", { with: { type: \"json\" } }), \"github-copilot\"> =\n\tflattenImageModelCatalog(\"github-copilot\", values);\n\nexport const GITHUB_COPILOT_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/github-copilot.json\", { with: { type: \"json\" } }), \"github-copilot\"> =\n\tflattenClassifierModelCatalog(\"github-copilot\", values);\n"]}
@@ -1,4 +1,5 @@
1
- import values from "./data/google-vertex.json";
2
- import { type ModelCatalog } from "../model-catalog.ts";
3
- export declare const GOOGLE_VERTEX_MODELS: ModelCatalog<typeof values, "google-vertex">;
1
+ import { type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from "../model-catalog.ts";
2
+ export declare const GOOGLE_VERTEX_MODELS: ChatModelCatalog<typeof import("./data/google-vertex.json", { with: { type: "json" } }), "google-vertex">;
3
+ export declare const GOOGLE_VERTEX_IMAGE_MODELS: ImageModelCatalog<typeof import("./data/google-vertex.json", { with: { type: "json" } }), "google-vertex">;
4
+ export declare const GOOGLE_VERTEX_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import("./data/google-vertex.json", { with: { type: "json" } }), "google-vertex">;
4
5
  //# sourceMappingURL=google-vertex.models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"google-vertex.models.d.ts","sourceRoot":"","sources":["../../src/providers/google-vertex.models.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,2BAA2B,CAAuB;AACrE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,OAAO,MAAM,EAAE,eAAe,CACjC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google-vertex.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_VERTEX_MODELS: ModelCatalog<typeof values, \"google-vertex\"> =\n\tflattenModelCatalog(\"google-vertex\", values);\n"]}
1
+ {"version":3,"file":"google-vertex.models.d.ts","sourceRoot":"","sources":["../../src/providers/google-vertex.models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoF,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnM,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,cAAc,2BAA2B,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,eAAe,CAC1F,CAAC;AAElD,eAAO,MAAM,0BAA0B,EAAE,iBAAiB,CAAC,cAAc,2BAA2B,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,eAAe,CAChG,CAAC;AAEnD,eAAO,MAAM,+BAA+B,EAAE,sBAAsB,CAAC,cAAc,2BAA2B,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,eAAe,CACrG,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google-vertex.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_VERTEX_MODELS: ChatModelCatalog<typeof import(\"./data/google-vertex.json\", { with: { type: \"json\" } }), \"google-vertex\"> =\n\tflattenChatModelCatalog(\"google-vertex\", values);\n\nexport const GOOGLE_VERTEX_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/google-vertex.json\", { with: { type: \"json\" } }), \"google-vertex\"> =\n\tflattenImageModelCatalog(\"google-vertex\", values);\n\nexport const GOOGLE_VERTEX_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/google-vertex.json\", { with: { type: \"json\" } }), \"google-vertex\"> =\n\tflattenClassifierModelCatalog(\"google-vertex\", values);\n"]}
@@ -1,6 +1,8 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually - run 'npm run generate-models' to update
3
3
  import values from "./data/google-vertex.json" with { type: "json" };
4
- import { flattenModelCatalog } from "../model-catalog.js";
5
- export const GOOGLE_VERTEX_MODELS = flattenModelCatalog("google-vertex", values);
4
+ import { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog } from "../model-catalog.js";
5
+ export const GOOGLE_VERTEX_MODELS = flattenChatModelCatalog("google-vertex", values);
6
+ export const GOOGLE_VERTEX_IMAGE_MODELS = flattenImageModelCatalog("google-vertex", values);
7
+ export const GOOGLE_VERTEX_CLASSIFIER_MODELS = flattenClassifierModelCatalog("google-vertex", values);
6
8
  //# sourceMappingURL=google-vertex.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"google-vertex.models.js","sourceRoot":"","sources":["../../src/providers/google-vertex.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,2BAA2B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,oBAAoB,GAChC,mBAAmB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google-vertex.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_VERTEX_MODELS: ModelCatalog<typeof values, \"google-vertex\"> =\n\tflattenModelCatalog(\"google-vertex\", values);\n"]}
1
+ {"version":3,"file":"google-vertex.models.js","sourceRoot":"","sources":["../../src/providers/google-vertex.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,2BAA2B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,6BAA6B,EAA8E,MAAM,qBAAqB,CAAC;AAEnM,MAAM,CAAC,MAAM,oBAAoB,GAChC,uBAAuB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,0BAA0B,GACtC,wBAAwB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,+BAA+B,GAC3C,6BAA6B,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google-vertex.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_VERTEX_MODELS: ChatModelCatalog<typeof import(\"./data/google-vertex.json\", { with: { type: \"json\" } }), \"google-vertex\"> =\n\tflattenChatModelCatalog(\"google-vertex\", values);\n\nexport const GOOGLE_VERTEX_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/google-vertex.json\", { with: { type: \"json\" } }), \"google-vertex\"> =\n\tflattenImageModelCatalog(\"google-vertex\", values);\n\nexport const GOOGLE_VERTEX_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/google-vertex.json\", { with: { type: \"json\" } }), \"google-vertex\"> =\n\tflattenClassifierModelCatalog(\"google-vertex\", values);\n"]}
@@ -1,4 +1,5 @@
1
- import values from "./data/google.json";
2
- import { type ModelCatalog } from "../model-catalog.ts";
3
- export declare const GOOGLE_MODELS: ModelCatalog<typeof values, "google">;
1
+ import { type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from "../model-catalog.ts";
2
+ export declare const GOOGLE_MODELS: ChatModelCatalog<typeof import("./data/google.json", { with: { type: "json" } }), "google">;
3
+ export declare const GOOGLE_IMAGE_MODELS: ImageModelCatalog<typeof import("./data/google.json", { with: { type: "json" } }), "google">;
4
+ export declare const GOOGLE_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import("./data/google.json", { with: { type: "json" } }), "google">;
4
5
  //# sourceMappingURL=google.models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"google.models.d.ts","sourceRoot":"","sources":["../../src/providers/google.models.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,oBAAoB,CAAuB;AAC9D,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,OAAO,MAAM,EAAE,QAAQ,CAC1B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_MODELS: ModelCatalog<typeof values, \"google\"> =\n\tflattenModelCatalog(\"google\", values);\n"]}
1
+ {"version":3,"file":"google.models.d.ts","sourceRoot":"","sources":["../../src/providers/google.models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoF,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnM,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,cAAc,oBAAoB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,QAAQ,CAC5E,CAAC;AAE3C,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,cAAc,oBAAoB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,QAAQ,CAClF,CAAC;AAE5C,eAAO,MAAM,wBAAwB,EAAE,sBAAsB,CAAC,cAAc,oBAAoB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,QAAQ,CACvF,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_MODELS: ChatModelCatalog<typeof import(\"./data/google.json\", { with: { type: \"json\" } }), \"google\"> =\n\tflattenChatModelCatalog(\"google\", values);\n\nexport const GOOGLE_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/google.json\", { with: { type: \"json\" } }), \"google\"> =\n\tflattenImageModelCatalog(\"google\", values);\n\nexport const GOOGLE_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/google.json\", { with: { type: \"json\" } }), \"google\"> =\n\tflattenClassifierModelCatalog(\"google\", values);\n"]}
@@ -1,6 +1,8 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually - run 'npm run generate-models' to update
3
3
  import values from "./data/google.json" with { type: "json" };
4
- import { flattenModelCatalog } from "../model-catalog.js";
5
- export const GOOGLE_MODELS = flattenModelCatalog("google", values);
4
+ import { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog } from "../model-catalog.js";
5
+ export const GOOGLE_MODELS = flattenChatModelCatalog("google", values);
6
+ export const GOOGLE_IMAGE_MODELS = flattenImageModelCatalog("google", values);
7
+ export const GOOGLE_CLASSIFIER_MODELS = flattenClassifierModelCatalog("google", values);
6
8
  //# sourceMappingURL=google.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"google.models.js","sourceRoot":"","sources":["../../src/providers/google.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,aAAa,GACzB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_MODELS: ModelCatalog<typeof values, \"google\"> =\n\tflattenModelCatalog(\"google\", values);\n"]}
1
+ {"version":3,"file":"google.models.js","sourceRoot":"","sources":["../../src/providers/google.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,6BAA6B,EAA8E,MAAM,qBAAqB,CAAC;AAEnM,MAAM,CAAC,MAAM,aAAa,GACzB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAC/B,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAE5C,MAAM,CAAC,MAAM,wBAAwB,GACpC,6BAA6B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/google.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GOOGLE_MODELS: ChatModelCatalog<typeof import(\"./data/google.json\", { with: { type: \"json\" } }), \"google\"> =\n\tflattenChatModelCatalog(\"google\", values);\n\nexport const GOOGLE_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/google.json\", { with: { type: \"json\" } }), \"google\"> =\n\tflattenImageModelCatalog(\"google\", values);\n\nexport const GOOGLE_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/google.json\", { with: { type: \"json\" } }), \"google\"> =\n\tflattenClassifierModelCatalog(\"google\", values);\n"]}
@@ -1,4 +1,5 @@
1
- import values from "./data/groq.json";
2
- import { type ModelCatalog } from "../model-catalog.ts";
3
- export declare const GROQ_MODELS: ModelCatalog<typeof values, "groq">;
1
+ import { type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from "../model-catalog.ts";
2
+ export declare const GROQ_MODELS: ChatModelCatalog<typeof import("./data/groq.json", { with: { type: "json" } }), "groq">;
3
+ export declare const GROQ_IMAGE_MODELS: ImageModelCatalog<typeof import("./data/groq.json", { with: { type: "json" } }), "groq">;
4
+ export declare const GROQ_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import("./data/groq.json", { with: { type: "json" } }), "groq">;
4
5
  //# sourceMappingURL=groq.models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"groq.models.d.ts","sourceRoot":"","sources":["../../src/providers/groq.models.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,kBAAkB,CAAuB;AAC5D,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,OAAO,MAAM,EAAE,MAAM,CACxB,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/groq.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GROQ_MODELS: ModelCatalog<typeof values, \"groq\"> =\n\tflattenModelCatalog(\"groq\", values);\n"]}
1
+ {"version":3,"file":"groq.models.d.ts","sourceRoot":"","sources":["../../src/providers/groq.models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoF,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnM,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,cAAc,kBAAkB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,MAAM,CACxE,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,cAAc,kBAAkB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,MAAM,CAC9E,CAAC;AAE1C,eAAO,MAAM,sBAAsB,EAAE,sBAAsB,CAAC,cAAc,kBAAkB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,MAAM,CACnF,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/groq.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GROQ_MODELS: ChatModelCatalog<typeof import(\"./data/groq.json\", { with: { type: \"json\" } }), \"groq\"> =\n\tflattenChatModelCatalog(\"groq\", values);\n\nexport const GROQ_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/groq.json\", { with: { type: \"json\" } }), \"groq\"> =\n\tflattenImageModelCatalog(\"groq\", values);\n\nexport const GROQ_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/groq.json\", { with: { type: \"json\" } }), \"groq\"> =\n\tflattenClassifierModelCatalog(\"groq\", values);\n"]}
@@ -1,6 +1,8 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually - run 'npm run generate-models' to update
3
3
  import values from "./data/groq.json" with { type: "json" };
4
- import { flattenModelCatalog } from "../model-catalog.js";
5
- export const GROQ_MODELS = flattenModelCatalog("groq", values);
4
+ import { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog } from "../model-catalog.js";
5
+ export const GROQ_MODELS = flattenChatModelCatalog("groq", values);
6
+ export const GROQ_IMAGE_MODELS = flattenImageModelCatalog("groq", values);
7
+ export const GROQ_CLASSIFIER_MODELS = flattenClassifierModelCatalog("groq", values);
6
8
  //# sourceMappingURL=groq.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"groq.models.js","sourceRoot":"","sources":["../../src/providers/groq.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,WAAW,GACvB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/groq.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const GROQ_MODELS: ModelCatalog<typeof values, \"groq\"> =\n\tflattenModelCatalog(\"groq\", values);\n"]}
1
+ {"version":3,"file":"groq.models.js","sourceRoot":"","sources":["../../src/providers/groq.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,6BAA6B,EAA8E,MAAM,qBAAqB,CAAC;AAEnM,MAAM,CAAC,MAAM,WAAW,GACvB,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAC7B,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAClC,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/groq.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const GROQ_MODELS: ChatModelCatalog<typeof import(\"./data/groq.json\", { with: { type: \"json\" } }), \"groq\"> =\n\tflattenChatModelCatalog(\"groq\", values);\n\nexport const GROQ_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/groq.json\", { with: { type: \"json\" } }), \"groq\"> =\n\tflattenImageModelCatalog(\"groq\", values);\n\nexport const GROQ_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/groq.json\", { with: { type: \"json\" } }), \"groq\"> =\n\tflattenClassifierModelCatalog(\"groq\", values);\n"]}
@@ -1,4 +1,5 @@
1
- import values from "./data/huggingface.json";
2
- import { type ModelCatalog } from "../model-catalog.ts";
3
- export declare const HUGGINGFACE_MODELS: ModelCatalog<typeof values, "huggingface">;
1
+ import { type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from "../model-catalog.ts";
2
+ export declare const HUGGINGFACE_MODELS: ChatModelCatalog<typeof import("./data/huggingface.json", { with: { type: "json" } }), "huggingface">;
3
+ export declare const HUGGINGFACE_IMAGE_MODELS: ImageModelCatalog<typeof import("./data/huggingface.json", { with: { type: "json" } }), "huggingface">;
4
+ export declare const HUGGINGFACE_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import("./data/huggingface.json", { with: { type: "json" } }), "huggingface">;
4
5
  //# sourceMappingURL=huggingface.models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"huggingface.models.d.ts","sourceRoot":"","sources":["../../src/providers/huggingface.models.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,yBAAyB,CAAuB;AACnE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,OAAO,MAAM,EAAE,aAAa,CAC/B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/huggingface.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const HUGGINGFACE_MODELS: ModelCatalog<typeof values, \"huggingface\"> =\n\tflattenModelCatalog(\"huggingface\", values);\n"]}
1
+ {"version":3,"file":"huggingface.models.d.ts","sourceRoot":"","sources":["../../src/providers/huggingface.models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoF,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnM,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,cAAc,yBAAyB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,aAAa,CACtF,CAAC;AAEhD,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,cAAc,yBAAyB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,aAAa,CAC5F,CAAC;AAEjD,eAAO,MAAM,6BAA6B,EAAE,sBAAsB,CAAC,cAAc,yBAAyB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,aAAa,CACjG,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/huggingface.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const HUGGINGFACE_MODELS: ChatModelCatalog<typeof import(\"./data/huggingface.json\", { with: { type: \"json\" } }), \"huggingface\"> =\n\tflattenChatModelCatalog(\"huggingface\", values);\n\nexport const HUGGINGFACE_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/huggingface.json\", { with: { type: \"json\" } }), \"huggingface\"> =\n\tflattenImageModelCatalog(\"huggingface\", values);\n\nexport const HUGGINGFACE_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/huggingface.json\", { with: { type: \"json\" } }), \"huggingface\"> =\n\tflattenClassifierModelCatalog(\"huggingface\", values);\n"]}
@@ -1,6 +1,8 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually - run 'npm run generate-models' to update
3
3
  import values from "./data/huggingface.json" with { type: "json" };
4
- import { flattenModelCatalog } from "../model-catalog.js";
5
- export const HUGGINGFACE_MODELS = flattenModelCatalog("huggingface", values);
4
+ import { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog } from "../model-catalog.js";
5
+ export const HUGGINGFACE_MODELS = flattenChatModelCatalog("huggingface", values);
6
+ export const HUGGINGFACE_IMAGE_MODELS = flattenImageModelCatalog("huggingface", values);
7
+ export const HUGGINGFACE_CLASSIFIER_MODELS = flattenClassifierModelCatalog("huggingface", values);
6
8
  //# sourceMappingURL=huggingface.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"huggingface.models.js","sourceRoot":"","sources":["../../src/providers/huggingface.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,yBAAyB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,kBAAkB,GAC9B,mBAAmB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/huggingface.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const HUGGINGFACE_MODELS: ModelCatalog<typeof values, \"huggingface\"> =\n\tflattenModelCatalog(\"huggingface\", values);\n"]}
1
+ {"version":3,"file":"huggingface.models.js","sourceRoot":"","sources":["../../src/providers/huggingface.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,yBAAyB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,6BAA6B,EAA8E,MAAM,qBAAqB,CAAC;AAEnM,MAAM,CAAC,MAAM,kBAAkB,GAC9B,uBAAuB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,wBAAwB,GACpC,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,6BAA6B,GACzC,6BAA6B,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/huggingface.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const HUGGINGFACE_MODELS: ChatModelCatalog<typeof import(\"./data/huggingface.json\", { with: { type: \"json\" } }), \"huggingface\"> =\n\tflattenChatModelCatalog(\"huggingface\", values);\n\nexport const HUGGINGFACE_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/huggingface.json\", { with: { type: \"json\" } }), \"huggingface\"> =\n\tflattenImageModelCatalog(\"huggingface\", values);\n\nexport const HUGGINGFACE_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/huggingface.json\", { with: { type: \"json\" } }), \"huggingface\"> =\n\tflattenClassifierModelCatalog(\"huggingface\", values);\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ImagesFunction, ImagesOptions } from "../../types.ts";
2
- export declare const generateImagesOpenRouter: ImagesFunction<"openrouter-images", ImagesOptions>;
2
+ export declare const generateImagesOpenRouter: ImagesFunction<ImagesOptions>;
3
3
  export declare function registerBuiltInImagesApiProviders(): void;
4
4
  //# sourceMappingURL=register-builtins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register-builtins.d.ts","sourceRoot":"","sources":["../../../src/providers/images/register-builtins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkC,cAAc,EAAe,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA2BjH,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,mBAAmB,EAAE,aAAa,CAWvF,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,IAAI,CAKxD","sourcesContent":["import type { generateImages as generateImagesOpenRouterFunction } from \"../../api/openrouter-images.ts\";\nimport { registerImagesApiProvider } from \"../../images-api-registry.ts\";\nimport type { AssistantImages, ImagesContext, ImagesFunction, ImagesModel, ImagesOptions } from \"../../types.ts\";\n\ninterface OpenRouterImagesProviderModule {\n\tgenerateImages: typeof generateImagesOpenRouterFunction;\n}\n\nlet openRouterImagesProviderModulePromise: Promise<OpenRouterImagesProviderModule> | undefined;\n\nfunction createLazyLoadErrorImages(model: ImagesModel<\"openrouter-images\">, error: unknown): AssistantImages {\n\treturn {\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\toutput: [],\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction loadOpenRouterImagesProviderModule(): Promise<OpenRouterImagesProviderModule> {\n\topenRouterImagesProviderModulePromise ||= import(\"../../api/openrouter-images.ts\").then(\n\t\t(module) => module as OpenRouterImagesProviderModule,\n\t);\n\treturn openRouterImagesProviderModulePromise;\n}\n\nexport const generateImagesOpenRouter: ImagesFunction<\"openrouter-images\", ImagesOptions> = async (\n\tmodel: ImagesModel<\"openrouter-images\">,\n\tcontext: ImagesContext,\n\toptions?: ImagesOptions,\n) => {\n\ttry {\n\t\tconst module = await loadOpenRouterImagesProviderModule();\n\t\treturn await module.generateImages(model, context, options);\n\t} catch (error) {\n\t\treturn createLazyLoadErrorImages(model, error);\n\t}\n};\n\nexport function registerBuiltInImagesApiProviders(): void {\n\tregisterImagesApiProvider({\n\t\tapi: \"openrouter-images\",\n\t\tgenerateImages: generateImagesOpenRouter,\n\t});\n}\n\nregisterBuiltInImagesApiProviders();\n"]}
1
+ {"version":3,"file":"register-builtins.d.ts","sourceRoot":"","sources":["../../../src/providers/images/register-builtins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKX,cAAc,EACd,aAAa,EACb,MAAM,gBAAgB,CAAC;AA2BxB,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,aAAa,CAWlE,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,IAAI,CAKxD","sourcesContent":["import type { generateImages as generateImagesOpenRouterFunction } from \"../../api/openrouter-images.ts\";\nimport { registerImagesApiProvider } from \"../../images-api-registry.ts\";\nimport type {\n\tAssistantImages,\n\tImageApi,\n\tImageModel,\n\tImagesContext,\n\tImagesFunction,\n\tImagesOptions,\n} from \"../../types.ts\";\n\ninterface OpenRouterImagesProviderModule {\n\tgenerateImages: typeof generateImagesOpenRouterFunction;\n}\n\nlet openRouterImagesProviderModulePromise: Promise<OpenRouterImagesProviderModule> | undefined;\n\nfunction createLazyLoadErrorImages(model: ImageModel<ImageApi>, error: unknown): AssistantImages {\n\treturn {\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\toutput: [],\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction loadOpenRouterImagesProviderModule(): Promise<OpenRouterImagesProviderModule> {\n\topenRouterImagesProviderModulePromise ||= import(\"../../api/openrouter-images.ts\").then(\n\t\t(module) => module as OpenRouterImagesProviderModule,\n\t);\n\treturn openRouterImagesProviderModulePromise;\n}\n\nexport const generateImagesOpenRouter: ImagesFunction<ImagesOptions> = async (\n\tmodel: ImageModel<ImageApi>,\n\tcontext: ImagesContext,\n\toptions?: ImagesOptions,\n) => {\n\ttry {\n\t\tconst module = await loadOpenRouterImagesProviderModule();\n\t\treturn await module.generateImages(model, context, options);\n\t} catch (error) {\n\t\treturn createLazyLoadErrorImages(model, error);\n\t}\n};\n\nexport function registerBuiltInImagesApiProviders(): void {\n\tregisterImagesApiProvider({\n\t\tapi: \"openrouter-images\",\n\t\tgenerateImages: generateImagesOpenRouter,\n\t});\n}\n\nregisterBuiltInImagesApiProviders();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"register-builtins.js","sourceRoot":"","sources":["../../../src/providers/images/register-builtins.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAOzE,IAAI,qCAA0F,CAAC;AAE/F,SAAS,yBAAyB,CAAC,KAAuC,EAAE,KAAc,EAAmB;IAC5G,OAAO;QACN,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,KAAK,CAAC,EAAE;QACf,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,OAAO;QACnB,YAAY,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QACpE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACrB,CAAC;AAAA,CACF;AAED,SAAS,kCAAkC,GAA4C;IACtF,qCAAqC,KAAK,MAAM,CAAC,gCAAgC,CAAC,CAAC,IAAI,CACtF,CAAC,MAAM,EAAE,EAAE,CAAC,MAAwC,CACpD,CAAC;IACF,OAAO,qCAAqC,CAAC;AAAA,CAC7C;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAuD,KAAK,EAChG,KAAuC,EACvC,OAAsB,EACtB,OAAuB,EACtB,EAAE,CAAC;IACJ,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,MAAM,kCAAkC,EAAE,CAAC;QAC1D,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,yBAAyB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;AAAA,CACD,CAAC;AAEF,MAAM,UAAU,iCAAiC,GAAS;IACzD,yBAAyB,CAAC;QACzB,GAAG,EAAE,mBAAmB;QACxB,cAAc,EAAE,wBAAwB;KACxC,CAAC,CAAC;AAAA,CACH;AAED,iCAAiC,EAAE,CAAC","sourcesContent":["import type { generateImages as generateImagesOpenRouterFunction } from \"../../api/openrouter-images.ts\";\nimport { registerImagesApiProvider } from \"../../images-api-registry.ts\";\nimport type { AssistantImages, ImagesContext, ImagesFunction, ImagesModel, ImagesOptions } from \"../../types.ts\";\n\ninterface OpenRouterImagesProviderModule {\n\tgenerateImages: typeof generateImagesOpenRouterFunction;\n}\n\nlet openRouterImagesProviderModulePromise: Promise<OpenRouterImagesProviderModule> | undefined;\n\nfunction createLazyLoadErrorImages(model: ImagesModel<\"openrouter-images\">, error: unknown): AssistantImages {\n\treturn {\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\toutput: [],\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction loadOpenRouterImagesProviderModule(): Promise<OpenRouterImagesProviderModule> {\n\topenRouterImagesProviderModulePromise ||= import(\"../../api/openrouter-images.ts\").then(\n\t\t(module) => module as OpenRouterImagesProviderModule,\n\t);\n\treturn openRouterImagesProviderModulePromise;\n}\n\nexport const generateImagesOpenRouter: ImagesFunction<\"openrouter-images\", ImagesOptions> = async (\n\tmodel: ImagesModel<\"openrouter-images\">,\n\tcontext: ImagesContext,\n\toptions?: ImagesOptions,\n) => {\n\ttry {\n\t\tconst module = await loadOpenRouterImagesProviderModule();\n\t\treturn await module.generateImages(model, context, options);\n\t} catch (error) {\n\t\treturn createLazyLoadErrorImages(model, error);\n\t}\n};\n\nexport function registerBuiltInImagesApiProviders(): void {\n\tregisterImagesApiProvider({\n\t\tapi: \"openrouter-images\",\n\t\tgenerateImages: generateImagesOpenRouter,\n\t});\n}\n\nregisterBuiltInImagesApiProviders();\n"]}
1
+ {"version":3,"file":"register-builtins.js","sourceRoot":"","sources":["../../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,CAAC","sourcesContent":["import type { generateImages as generateImagesOpenRouterFunction } from \"../../api/openrouter-images.ts\";\nimport { registerImagesApiProvider } from \"../../images-api-registry.ts\";\nimport type {\n\tAssistantImages,\n\tImageApi,\n\tImageModel,\n\tImagesContext,\n\tImagesFunction,\n\tImagesOptions,\n} from \"../../types.ts\";\n\ninterface OpenRouterImagesProviderModule {\n\tgenerateImages: typeof generateImagesOpenRouterFunction;\n}\n\nlet openRouterImagesProviderModulePromise: Promise<OpenRouterImagesProviderModule> | undefined;\n\nfunction createLazyLoadErrorImages(model: ImageModel<ImageApi>, error: unknown): AssistantImages {\n\treturn {\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\toutput: [],\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction loadOpenRouterImagesProviderModule(): Promise<OpenRouterImagesProviderModule> {\n\topenRouterImagesProviderModulePromise ||= import(\"../../api/openrouter-images.ts\").then(\n\t\t(module) => module as OpenRouterImagesProviderModule,\n\t);\n\treturn openRouterImagesProviderModulePromise;\n}\n\nexport const generateImagesOpenRouter: ImagesFunction<ImagesOptions> = async (\n\tmodel: ImageModel<ImageApi>,\n\tcontext: ImagesContext,\n\toptions?: ImagesOptions,\n) => {\n\ttry {\n\t\tconst module = await loadOpenRouterImagesProviderModule();\n\t\treturn await module.generateImages(model, context, options);\n\t} catch (error) {\n\t\treturn createLazyLoadErrorImages(model, error);\n\t}\n};\n\nexport function registerBuiltInImagesApiProviders(): void {\n\tregisterImagesApiProvider({\n\t\tapi: \"openrouter-images\",\n\t\tgenerateImages: generateImagesOpenRouter,\n\t});\n}\n\nregisterBuiltInImagesApiProviders();\n"]}
@@ -1,4 +1,5 @@
1
- import values from "./data/kimi-coding.json";
2
- import { type ModelCatalog } from "../model-catalog.ts";
3
- export declare const KIMI_CODING_MODELS: ModelCatalog<typeof values, "kimi-coding">;
1
+ import { type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from "../model-catalog.ts";
2
+ export declare const KIMI_CODING_MODELS: ChatModelCatalog<typeof import("./data/kimi-coding.json", { with: { type: "json" } }), "kimi-coding">;
3
+ export declare const KIMI_CODING_IMAGE_MODELS: ImageModelCatalog<typeof import("./data/kimi-coding.json", { with: { type: "json" } }), "kimi-coding">;
4
+ export declare const KIMI_CODING_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import("./data/kimi-coding.json", { with: { type: "json" } }), "kimi-coding">;
4
5
  //# sourceMappingURL=kimi-coding.models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kimi-coding.models.d.ts","sourceRoot":"","sources":["../../src/providers/kimi-coding.models.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,yBAAyB,CAAuB;AACnE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE7E,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,OAAO,MAAM,EAAE,aAAa,CAC/B,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/kimi-coding.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const KIMI_CODING_MODELS: ModelCatalog<typeof values, \"kimi-coding\"> =\n\tflattenModelCatalog(\"kimi-coding\", values);\n"]}
1
+ {"version":3,"file":"kimi-coding.models.d.ts","sourceRoot":"","sources":["../../src/providers/kimi-coding.models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoF,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAEnM,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,cAAc,yBAAyB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,aAAa,CACtF,CAAC;AAEhD,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,cAAc,yBAAyB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,aAAa,CAC5F,CAAC;AAEjD,eAAO,MAAM,6BAA6B,EAAE,sBAAsB,CAAC,cAAc,yBAAyB,EAAU,UAAE,IAAI,EAAE,MAAM,IAAE,CAAG,EAAE,aAAa,CACjG,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/kimi-coding.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const KIMI_CODING_MODELS: ChatModelCatalog<typeof import(\"./data/kimi-coding.json\", { with: { type: \"json\" } }), \"kimi-coding\"> =\n\tflattenChatModelCatalog(\"kimi-coding\", values);\n\nexport const KIMI_CODING_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/kimi-coding.json\", { with: { type: \"json\" } }), \"kimi-coding\"> =\n\tflattenImageModelCatalog(\"kimi-coding\", values);\n\nexport const KIMI_CODING_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/kimi-coding.json\", { with: { type: \"json\" } }), \"kimi-coding\"> =\n\tflattenClassifierModelCatalog(\"kimi-coding\", values);\n"]}
@@ -1,6 +1,8 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually - run 'npm run generate-models' to update
3
3
  import values from "./data/kimi-coding.json" with { type: "json" };
4
- import { flattenModelCatalog } from "../model-catalog.js";
5
- export const KIMI_CODING_MODELS = flattenModelCatalog("kimi-coding", values);
4
+ import { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog } from "../model-catalog.js";
5
+ export const KIMI_CODING_MODELS = flattenChatModelCatalog("kimi-coding", values);
6
+ export const KIMI_CODING_IMAGE_MODELS = flattenImageModelCatalog("kimi-coding", values);
7
+ export const KIMI_CODING_CLASSIFIER_MODELS = flattenClassifierModelCatalog("kimi-coding", values);
6
8
  //# sourceMappingURL=kimi-coding.models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kimi-coding.models.js","sourceRoot":"","sources":["../../src/providers/kimi-coding.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,yBAAyB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAE7E,MAAM,CAAC,MAAM,kBAAkB,GAC9B,mBAAmB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/kimi-coding.json\" with { type: \"json\" };\nimport { flattenModelCatalog, type ModelCatalog } from \"../model-catalog.ts\";\n\nexport const KIMI_CODING_MODELS: ModelCatalog<typeof values, \"kimi-coding\"> =\n\tflattenModelCatalog(\"kimi-coding\", values);\n"]}
1
+ {"version":3,"file":"kimi-coding.models.js","sourceRoot":"","sources":["../../src/providers/kimi-coding.models.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,iEAAiE;AAEjE,OAAO,MAAM,MAAM,yBAAyB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,6BAA6B,EAA8E,MAAM,qBAAqB,CAAC;AAEnM,MAAM,CAAC,MAAM,kBAAkB,GAC9B,uBAAuB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,wBAAwB,GACpC,wBAAwB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,6BAA6B,GACzC,6BAA6B,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC","sourcesContent":["// This file is auto-generated by scripts/generate-models.ts\n// Do not edit manually - run 'npm run generate-models' to update\n\nimport values from \"./data/kimi-coding.json\" with { type: \"json\" };\nimport { flattenChatModelCatalog, flattenImageModelCatalog, flattenClassifierModelCatalog, type ChatModelCatalog, type ImageModelCatalog, type ClassifierModelCatalog } from \"../model-catalog.ts\";\n\nexport const KIMI_CODING_MODELS: ChatModelCatalog<typeof import(\"./data/kimi-coding.json\", { with: { type: \"json\" } }), \"kimi-coding\"> =\n\tflattenChatModelCatalog(\"kimi-coding\", values);\n\nexport const KIMI_CODING_IMAGE_MODELS: ImageModelCatalog<typeof import(\"./data/kimi-coding.json\", { with: { type: \"json\" } }), \"kimi-coding\"> =\n\tflattenImageModelCatalog(\"kimi-coding\", values);\n\nexport const KIMI_CODING_CLASSIFIER_MODELS: ClassifierModelCatalog<typeof import(\"./data/kimi-coding.json\", { with: { type: \"json\" } }), \"kimi-coding\"> =\n\tflattenClassifierModelCatalog(\"kimi-coding\", values);\n"]}