promptfoo 0.125.0 → 0.125.1

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 (869) hide show
  1. package/README.md +3 -3
  2. package/dist/src/accounts-BOxNYxVN.js +229 -0
  3. package/dist/src/accounts-BezXLdAW.cjs +276 -0
  4. package/dist/src/accounts-CPISMNlh.js +227 -0
  5. package/dist/src/accounts-vJBPs89d.js +222 -0
  6. package/dist/src/agentWorkspace-Bom7SpF2.js +592 -0
  7. package/dist/src/agentWorkspace-CEomAcws.cjs +619 -0
  8. package/dist/src/agentWorkspace-DPtMLrlI.js +593 -0
  9. package/dist/src/agentWorkspace-DkAeEYLz.js +592 -0
  10. package/dist/src/agentic-utils-121v7mJo.js +197 -0
  11. package/dist/src/agentic-utils-CBWD_rcd.cjs +237 -0
  12. package/dist/src/agentic-utils-D8wyQwPG.js +198 -0
  13. package/dist/src/agentic-utils-EP1QkQCs.js +197 -0
  14. package/dist/src/agents-Br3ah8iA.js +778 -0
  15. package/dist/src/agents-C5wj_UTv.js +777 -0
  16. package/dist/src/agents-C9Efp4mC.js +266 -0
  17. package/dist/src/agents-CQYwaVCO.js +267 -0
  18. package/dist/src/agents-CjCd4Vo8.js +777 -0
  19. package/dist/src/agents-DRWiCHYz.js +266 -0
  20. package/dist/src/agents-F2rhx0iL.cjs +266 -0
  21. package/dist/src/agents-RTYyy69h.cjs +777 -0
  22. package/dist/src/agents-api-CY72O86e.js +711 -0
  23. package/dist/src/agents-api-CsSsC21b.js +710 -0
  24. package/dist/src/agents-api-DN-ibDc8.js +710 -0
  25. package/dist/src/agents-api-cNDsCCv1.cjs +710 -0
  26. package/dist/src/ai.studio-Bj6Dyi6o.js +2 -0
  27. package/dist/src/ai.studio-C-e0LzyW.js +369 -0
  28. package/dist/src/ai.studio-CR8M6Aqf.cjs +391 -0
  29. package/dist/src/ai.studio-YKk7F0tv.js +374 -0
  30. package/dist/src/aimlapi-BGunsuTu.js +30 -0
  31. package/dist/src/aimlapi-BkzcfBsL.js +29 -0
  32. package/dist/src/aimlapi-DXFcEdP8.js +28 -0
  33. package/dist/src/aimlapi-r-8iCcAw.cjs +29 -0
  34. package/dist/src/anthropicMessages-7-YNRgQR.js +114 -0
  35. package/dist/src/anthropicMessages-C8m9Whrd.cjs +114 -0
  36. package/dist/src/anthropicMessages-DS1vXD0f.js +115 -0
  37. package/dist/src/anthropicMessages-DmvGkz-0.js +114 -0
  38. package/dist/src/app/assets/index-CrdXWTXm.js +392 -0
  39. package/dist/src/app/browser-inventory.json +4 -4
  40. package/dist/src/app/index.html +1 -1
  41. package/dist/src/audio-BLgFgyw-.cjs +104 -0
  42. package/dist/src/audio-C2sibT7Q.js +104 -0
  43. package/dist/src/audio-DXEXb03H.js +104 -0
  44. package/dist/src/audio-TkvojpwO.js +105 -0
  45. package/dist/src/authoritativeMarkupInjection-BAT9B-Wj.js +79 -0
  46. package/dist/src/authoritativeMarkupInjection-B_yHETKT.js +78 -0
  47. package/dist/src/authoritativeMarkupInjection-BfjecQ3Q.cjs +78 -0
  48. package/dist/src/authoritativeMarkupInjection-D-hDKrhD.js +78 -0
  49. package/dist/src/aws-B_9unI_-.js +1149 -0
  50. package/dist/src/aws-D0FY3qkc.js +2433 -0
  51. package/dist/src/aws-Dh1-a90n.js +2433 -0
  52. package/dist/src/aws-qskKGczY.cjs +2454 -0
  53. package/dist/src/base-CaWlBkVz.js +462 -0
  54. package/dist/src/base-CcViNwVs.js +255 -0
  55. package/dist/src/base-CsVbPJkU.cjs +467 -0
  56. package/dist/src/base-DNK9py25.js +255 -0
  57. package/dist/src/base-DlH5tjEZ.js +463 -0
  58. package/dist/src/base-DyLOZ_iX.js +256 -0
  59. package/dist/src/base-RRYXfG7l.cjs +305 -0
  60. package/dist/src/base-oXVgvtVn.js +462 -0
  61. package/dist/src/bedrock-BP17ZXbR.cjs +2 -0
  62. package/dist/src/bedrock-CsjM1dOt.js +1300 -0
  63. package/dist/src/bedrock-CzPwj8GO.js +1 -0
  64. package/dist/src/bedrock-eGXZw8oh.js +1 -0
  65. package/dist/src/bedrock-tSWjmXdj.js +2 -0
  66. package/dist/src/bestOfN-BQ93nUKV.js +160 -0
  67. package/dist/src/bestOfN-ByGGwlcb.cjs +161 -0
  68. package/dist/src/bestOfN-CbP7csHr.js +159 -0
  69. package/dist/src/bestOfN-xn6i2Xs2.js +159 -0
  70. package/dist/src/cache-CHq9hPz9.js +2 -0
  71. package/dist/src/cache-D-9eZN3I.js +754 -0
  72. package/dist/src/cache-DSm6t1MZ.js +741 -0
  73. package/dist/src/cache-DeF5zIEN.js +782 -0
  74. package/dist/src/cache-iG87oYan.cjs +856 -0
  75. package/dist/src/cerebras-CTtM4yMH.js +98 -0
  76. package/dist/src/cerebras-CogcJ3ce.cjs +97 -0
  77. package/dist/src/cerebras-DmkRypTh.js +97 -0
  78. package/dist/src/cerebras-GUp0B8JY.js +97 -0
  79. package/dist/src/chat-B4ihd3fw.js +226 -0
  80. package/dist/src/chat-B9cAQ_rS.js +227 -0
  81. package/dist/src/chat-BU7EB4R-.cjs +76 -0
  82. package/dist/src/chat-C8yxJ2-s.cjs +226 -0
  83. package/dist/src/chat-ClTFM3qq.js +934 -0
  84. package/dist/src/chat-Cnq0Is68.js +123 -0
  85. package/dist/src/chat-CwrurR57.cjs +987 -0
  86. package/dist/src/chat-D0lsojPv.js +124 -0
  87. package/dist/src/chat-D7_8yFIx.js +76 -0
  88. package/dist/src/chat-DCoETlLG.js +226 -0
  89. package/dist/src/chat-DHE7xaTR.js +76 -0
  90. package/dist/src/chat-DmhT6rz2.cjs +123 -0
  91. package/dist/src/chat-DvfMe8KI.js +123 -0
  92. package/dist/src/chat-DwP5kVnl.js +935 -0
  93. package/dist/src/chat-MB7U-QE2.js +77 -0
  94. package/dist/src/chat-zCWuBKAj.js +934 -0
  95. package/dist/src/claude-agent-sdk-23bIVI75.js +999 -0
  96. package/dist/src/claude-agent-sdk-BACpnIJi.cjs +1005 -0
  97. package/dist/src/claude-agent-sdk-BlYlmcEr.js +999 -0
  98. package/dist/src/claude-agent-sdk-Cr-jqJZl.js +1000 -0
  99. package/dist/src/client-BktbiPx9.cjs +357 -0
  100. package/dist/src/client-CjztEBmW.js +351 -0
  101. package/dist/src/client-mRs2UvH9.js +351 -0
  102. package/dist/src/client-uCz0ydjC.js +352 -0
  103. package/dist/src/cloud-BtYF555L.js +2 -0
  104. package/dist/src/cloud-CVSUEmAy.js +287 -0
  105. package/dist/src/cloud-D7Ifb-Fl.js +599 -0
  106. package/dist/src/cloud-DB5oK5NX.cjs +666 -0
  107. package/dist/src/cloud-ecu989Em.js +657 -0
  108. package/dist/src/cloud-ramjGURF.js +599 -0
  109. package/dist/src/cloudflare-ai-BfDkIjO8.js +133 -0
  110. package/dist/src/cloudflare-ai-D9HaXz1M.js +134 -0
  111. package/dist/src/cloudflare-ai-HrD5WUK8.js +132 -0
  112. package/dist/src/cloudflare-ai-Qdj8aKP2.cjs +133 -0
  113. package/dist/src/cloudflare-gateway-C81uKETQ.js +276 -0
  114. package/dist/src/cloudflare-gateway-CX5Z9X0k.js +276 -0
  115. package/dist/src/cloudflare-gateway-DW-og8gb.js +277 -0
  116. package/dist/src/cloudflare-gateway-iRyXo9n2.cjs +276 -0
  117. package/dist/src/codex-app-server-BFIrSgdy.js +2155 -0
  118. package/dist/src/codex-app-server-By1eDVD4.js +2 -0
  119. package/dist/src/codex-app-server-DKsF4qmY.js +2156 -0
  120. package/dist/src/codex-app-server-n7n4uZzC.cjs +2162 -0
  121. package/dist/src/codex-app-server-xAoELVxu.js +2155 -0
  122. package/dist/src/codex-sdk-C2ZLxa6r.js +1552 -0
  123. package/dist/src/codex-sdk-CzG02tQt.cjs +1588 -0
  124. package/dist/src/codex-sdk-DNxAOhiV.js +2 -0
  125. package/dist/src/codex-sdk-DT3aQezK.js +1557 -0
  126. package/dist/src/codex-sdk-pw9DpcJP.js +1557 -0
  127. package/dist/src/codex-security-B0bLmXJF.js +406 -0
  128. package/dist/src/codex-security-BhYs-3iY.js +406 -0
  129. package/dist/src/codex-security-DQcOfxYW.js +407 -0
  130. package/dist/src/codex-security-DsCWr6GZ.cjs +411 -0
  131. package/dist/src/cometapi-B16asPLX.cjs +55 -0
  132. package/dist/src/cometapi-MgTbZA_H.js +53 -0
  133. package/dist/src/cometapi-i33vKzPV.js +55 -0
  134. package/dist/src/cometapi-wK2UWK0X.js +56 -0
  135. package/dist/src/compatible-COj8ZCy9.js +24 -0
  136. package/dist/src/compatible-CRSsIUGb.cjs +24 -0
  137. package/dist/src/compatible-Dy1vCcNF.js +25 -0
  138. package/dist/src/compatible-aUItQrpk.js +24 -0
  139. package/dist/src/completion-Bn7COFMk.js +119 -0
  140. package/dist/src/completion-Bub2N48b.js +118 -0
  141. package/dist/src/completion-Cf2G9OlM.cjs +123 -0
  142. package/dist/src/conversationScoring-BiTYJ9MD.js +374 -0
  143. package/dist/src/conversationScoring-CKL47uIu.js +373 -0
  144. package/dist/src/conversationScoring-DCvQKp6k.cjs +398 -0
  145. package/dist/src/conversationScoring-DLNJtDZI.js +373 -0
  146. package/dist/src/crescendo-5iLk9WiJ.cjs +734 -0
  147. package/dist/src/crescendo-B5ylG7kW.js +733 -0
  148. package/dist/src/crescendo-BD7k6TIx.js +730 -0
  149. package/dist/src/crescendo-DqO2Ch0P.js +732 -0
  150. package/dist/src/custom-8rv_aG2K.js +617 -0
  151. package/dist/src/custom-BOtrIHFN.js +619 -0
  152. package/dist/src/custom-BvN8seCs.cjs +620 -0
  153. package/dist/src/custom-Cld9v_Y4.js +618 -0
  154. package/dist/src/dataUrl-BdHUey2l.cjs +3187 -0
  155. package/dist/src/dataUrl-DBMifX6C.js +3133 -0
  156. package/dist/src/dataUrl-DUSr-ZvI.js +2868 -0
  157. package/dist/src/decisions-CLazADTw.js +516 -0
  158. package/dist/src/decisions-D5X93awq.js +515 -0
  159. package/dist/src/decisions-DmaeArEn.js +515 -0
  160. package/dist/src/decisions-DyQJyHJz.cjs +514 -0
  161. package/dist/src/docker-C9NYQFeu.js +94 -0
  162. package/dist/src/docker-CGq3mMol.cjs +94 -0
  163. package/dist/src/docker-DOm7nmpl.js +95 -0
  164. package/dist/src/docker-skFN-Kfo.js +93 -0
  165. package/dist/src/embedding-0UbzkTk9.js +82 -0
  166. package/dist/src/embedding-DTrSDt7k.cjs +86 -0
  167. package/dist/src/embedding-j2ORNl5H.js +81 -0
  168. package/dist/src/envoy-BvS8XTQO.js +60 -0
  169. package/dist/src/envoy-Cn6Hzw0e.js +60 -0
  170. package/dist/src/envoy-DC3KWcUY.cjs +60 -0
  171. package/dist/src/envoy-DetHjo5B.js +61 -0
  172. package/dist/src/eval-Cer9dPe9.js +1920 -0
  173. package/dist/src/eval-CytYmI2Z.js +2 -0
  174. package/dist/src/evalResult-DzOq5wt9.js +1300 -0
  175. package/dist/src/evaluator-BxCmvGtv.js +10578 -0
  176. package/dist/src/evaluator-Ct7YDELm.js +2 -0
  177. package/dist/src/evaluatorHelpers-B_AwIrsl.js +600 -0
  178. package/dist/src/evaluatorHelpers-D1Tpc7gd.js +601 -0
  179. package/dist/src/evaluatorHelpers-DRR3rLq0.cjs +622 -0
  180. package/dist/src/fetch-B5KxZuKu.js +1559 -0
  181. package/dist/src/fetch-BG_Jl7ty.js +1556 -0
  182. package/dist/src/fetch-BKlgUg08.cjs +1853 -0
  183. package/dist/src/fetch-C9Fsja0R.js +2 -0
  184. package/dist/src/fetch-CM7P8KWA.cjs +14 -0
  185. package/dist/src/fetch-D0FkIB3G.js +9 -0
  186. package/dist/src/fetch-RXHsZF-J.js +1280 -0
  187. package/dist/src/fetch-rSECy8jR.js +10 -0
  188. package/dist/src/functionCallbackUtils-BB9tmf6a.cjs +262 -0
  189. package/dist/src/functionCallbackUtils-BXk2iY01.js +246 -0
  190. package/dist/src/functionCallbackUtils-B_cYp7P5.js +245 -0
  191. package/dist/src/functionCallbackUtils-BfXnPo0o.js +245 -0
  192. package/dist/src/gemini-image-BXLMADDz.js +471 -0
  193. package/dist/src/gemini-image-BYUZyEUx.js +472 -0
  194. package/dist/src/gemini-image-DSt1QubZ.cjs +471 -0
  195. package/dist/src/gemini-image-DdNDMiZ_.js +471 -0
  196. package/dist/src/goat-9b-uU_k6.js +514 -0
  197. package/dist/src/goat-BCJuiDd0.js +515 -0
  198. package/dist/src/goat-CmAHbemm.js +512 -0
  199. package/dist/src/goat-DdOTdyoS.cjs +515 -0
  200. package/dist/src/goblin-Bp5C5lyb.js +22 -0
  201. package/dist/src/goblin-Dmr7GItI.js +23 -0
  202. package/dist/src/goblin-DpM8wxlf.cjs +22 -0
  203. package/dist/src/goblin-cJyH6Pq-.js +22 -0
  204. package/dist/src/google-B6eaPAbE.js +142 -0
  205. package/dist/src/google-D-FStdN6.cjs +142 -0
  206. package/dist/src/google-DAC7BsCW.js +142 -0
  207. package/dist/src/google-Id18H0Va.js +143 -0
  208. package/dist/src/graders-BjNQWkaB.js +2 -0
  209. package/dist/src/graders-CqdIp_vl.js +15470 -0
  210. package/dist/src/hydra-6Ouh74DE.js +610 -0
  211. package/dist/src/hydra-BHjhZnLB.cjs +612 -0
  212. package/dist/src/hydra-BL6k2REV.js +2 -0
  213. package/dist/src/hydra-BWUc0o67.js +613 -0
  214. package/dist/src/hydra-CUkEOLKw.js +612 -0
  215. package/dist/src/image-B6hG_xhb.js +481 -0
  216. package/dist/src/image-BFaq7Krd.cjs +209 -0
  217. package/dist/src/image-Bql5C0N9.cjs +504 -0
  218. package/dist/src/image-BtZfI2pT.js +163 -0
  219. package/dist/src/image-CIM4oN7Z.cjs +163 -0
  220. package/dist/src/image-CbAl7Jpu.js +209 -0
  221. package/dist/src/image-CiYm_yFw.js +209 -0
  222. package/dist/src/image-DCMNvBiV.js +163 -0
  223. package/dist/src/image-DL7pIuUZ.js +210 -0
  224. package/dist/src/image-ey0kxF8o.js +164 -0
  225. package/dist/src/image-smgIk3rE.js +482 -0
  226. package/dist/src/index.cjs +27 -27
  227. package/dist/src/index.d.cts +8 -8
  228. package/dist/src/index.js +27 -27
  229. package/dist/src/indirectWebPwn-B_-UpWY5.js +285 -0
  230. package/dist/src/indirectWebPwn-Cz3SLiEq.js +434 -0
  231. package/dist/src/indirectWebPwn-D2s8zGiM.cjs +463 -0
  232. package/dist/src/indirectWebPwn-DXbj2wGu.cjs +285 -0
  233. package/dist/src/indirectWebPwn-D_4H44E6.js +285 -0
  234. package/dist/src/indirectWebPwn-L044SrpV.js +434 -0
  235. package/dist/src/indirectWebPwn-cnmvdavH.js +435 -0
  236. package/dist/src/indirectWebPwn-zUBzsqTt.js +286 -0
  237. package/dist/src/interactions-Bu3oVQ-j.js +850 -0
  238. package/dist/src/interactions-CND010Lh.cjs +850 -0
  239. package/dist/src/interactions-DAx7tqUz.js +851 -0
  240. package/dist/src/interactions-DPkIumeh.js +850 -0
  241. package/dist/src/iterative-BO4JRnpG.js +545 -0
  242. package/dist/src/iterative-CAK-k9rz.js +548 -0
  243. package/dist/src/iterative-CDgHc0xO.cjs +549 -0
  244. package/dist/src/iterative-CXJlHLl9.js +547 -0
  245. package/dist/src/iterativeImage-BEdGKSmh.cjs +419 -0
  246. package/dist/src/iterativeImage-BfL0QZw5.js +417 -0
  247. package/dist/src/iterativeImage-C9KhnibC.js +417 -0
  248. package/dist/src/iterativeImage-btjkOfWG.js +418 -0
  249. package/dist/src/iterativeMeta-B5Bdw6QA.js +437 -0
  250. package/dist/src/iterativeMeta-C3mI4gpT.js +440 -0
  251. package/dist/src/iterativeMeta-Co2BKyqS.cjs +439 -0
  252. package/dist/src/iterativeMeta-DD8ihRWD.js +439 -0
  253. package/dist/src/iterativeTree-AMi4GV2O.js +878 -0
  254. package/dist/src/iterativeTree-C8FJOEje.cjs +879 -0
  255. package/dist/src/iterativeTree-CvrY1f2Z.js +877 -0
  256. package/dist/src/iterativeTree-bPtESmaD.js +876 -0
  257. package/dist/src/knowledgeBase-Cf5871e3.js +163 -0
  258. package/dist/src/knowledgeBase-D2PQhqLH.js +164 -0
  259. package/dist/src/knowledgeBase-DpoMw1IH.cjs +163 -0
  260. package/dist/src/knowledgeBase-npGFl763.js +163 -0
  261. package/dist/src/litellm-BBB5DQdt.cjs +146 -0
  262. package/dist/src/litellm-Bo43ow7r.js +145 -0
  263. package/dist/src/litellm-CaU8CMLS.js +146 -0
  264. package/dist/src/litellm-wY7Unh8o.js +147 -0
  265. package/dist/src/live-5g2w-M-E.js +891 -0
  266. package/dist/src/live-BfaXsDyD.cjs +891 -0
  267. package/dist/src/live-C1xewnGD.js +2 -0
  268. package/dist/src/live-DaF7nYy5.js +892 -0
  269. package/dist/src/live-lp3urLUw.js +891 -0
  270. package/dist/src/luma-ray-B7zvKGVG.js +309 -0
  271. package/dist/src/luma-ray-DCf5fnrz.cjs +309 -0
  272. package/dist/src/luma-ray-DepBcn6z.js +309 -0
  273. package/dist/src/luma-ray-XQC4M1pt.js +310 -0
  274. package/dist/src/main.js +26 -26
  275. package/dist/src/mantleChat-7xm95vSV.js +154 -0
  276. package/dist/src/mantleChat-CXhAs5RD.js +155 -0
  277. package/dist/src/mantleChat-CcE-zjfj.cjs +154 -0
  278. package/dist/src/mantleChat-Cpefl7Zm.js +154 -0
  279. package/dist/src/mcp-B0V0ikdM.js +84 -0
  280. package/dist/src/mcp-CV2k2gwj.js +85 -0
  281. package/dist/src/memoryPoisoning-BC5FQQWZ.js +111 -0
  282. package/dist/src/memoryPoisoning-BDwrtZKX.js +111 -0
  283. package/dist/src/memoryPoisoning-BFemS_FF.js +112 -0
  284. package/dist/src/memoryPoisoning-DRs2rbVV.cjs +111 -0
  285. package/dist/src/messages-Bc5oZoAJ.js +1128 -0
  286. package/dist/src/messages-BkaH8fRW.js +1127 -0
  287. package/dist/src/messages-CoHlziS5.js +1127 -0
  288. package/dist/src/messages-Cv_m6kYs.cjs +1161 -0
  289. package/dist/src/mischievousUser-BcyFxrqJ.js +51 -0
  290. package/dist/src/mischievousUser-BlhOQSd2.js +52 -0
  291. package/dist/src/mischievousUser-BuQiKE8D.js +51 -0
  292. package/dist/src/mischievousUser-ChIOk6cT.cjs +51 -0
  293. package/dist/src/modelslab-BXIWBTgX.js +171 -0
  294. package/dist/src/modelslab-ChVsUiaJ.js +170 -0
  295. package/dist/src/modelslab-DZ6BFlDv.js +170 -0
  296. package/dist/src/modelslab-DhRr-vyo.cjs +170 -0
  297. package/dist/src/nova-reel-BL8DrN4_.js +272 -0
  298. package/dist/src/nova-reel-BiOMUm5q.cjs +272 -0
  299. package/dist/src/nova-reel-CTsya1hV.js +273 -0
  300. package/dist/src/nova-reel-kgBY4Svd.js +272 -0
  301. package/dist/src/nova-sonic-CaSSA3Jq.cjs +374 -0
  302. package/dist/src/nova-sonic-DLpmoGsR.js +375 -0
  303. package/dist/src/nova-sonic-DwWc4SoN.js +374 -0
  304. package/dist/src/nova-sonic-qnReTaXm.js +374 -0
  305. package/dist/src/novita-B5mAt3Ui.js +114 -0
  306. package/dist/src/novita-D57vCjDD.js +116 -0
  307. package/dist/src/novita-ITRtG8IJ.js +115 -0
  308. package/dist/src/novita-Rh3T13YO.cjs +115 -0
  309. package/dist/src/nscale-8V7iZ_pI.js +210 -0
  310. package/dist/src/nscale-BQnMv4pH.cjs +209 -0
  311. package/dist/src/nscale-BWZXHZVF.js +209 -0
  312. package/dist/src/nscale-BqrHiUqU.js +207 -0
  313. package/dist/src/openaiResponses-BMtGTu8R.js +317 -0
  314. package/dist/src/openaiResponses-CvcI_viE.js +318 -0
  315. package/dist/src/openaiResponses-DYPZEMX1.cjs +318 -0
  316. package/dist/src/openaiResponses-DZTg1-kb.js +319 -0
  317. package/dist/src/openclaw-BeKuig4g.js +1338 -0
  318. package/dist/src/openclaw-COkdQ83y.js +1337 -0
  319. package/dist/src/openclaw-CSoX_HQ5.cjs +1344 -0
  320. package/dist/src/openclaw-DJlhPGCb.js +1336 -0
  321. package/dist/src/opencode-sdk-BEJftEs6.cjs +1018 -0
  322. package/dist/src/opencode-sdk-DMvBB3V7.js +1013 -0
  323. package/dist/src/opencode-sdk-Df7hMjLO.js +1012 -0
  324. package/dist/src/opencode-sdk-bQp5Xf3W.js +1012 -0
  325. package/dist/src/openinterpreter-B3GgVZjK.js +431 -0
  326. package/dist/src/openinterpreter-BiGcU-HN.cjs +435 -0
  327. package/dist/src/openinterpreter-Buj2l3Eh.js +432 -0
  328. package/dist/src/openinterpreter-C3_Cg5b_.js +431 -0
  329. package/dist/src/pricing-0Pampf0q.cjs +999 -0
  330. package/dist/src/pricing-B8VdhEhY.js +976 -0
  331. package/dist/src/pricing-CtLA-rKA.js +976 -0
  332. package/dist/src/promptfoo-4OkHtH9P.cjs +341 -0
  333. package/dist/src/promptfoo-Bhpm7sH6.js +286 -0
  334. package/dist/src/promptfoo-BqV8ogVA.js +285 -0
  335. package/dist/src/promptfoo-S1Q9OHk_.js +286 -0
  336. package/dist/src/providers-B5zs1ZRv.js +24437 -0
  337. package/dist/src/providers-Cd6CJh6m.js +2 -0
  338. package/dist/src/providers-CpJlgHET.js +24039 -0
  339. package/dist/src/providers-CzvLvK6G.cjs +24180 -0
  340. package/dist/src/quiverai-1E_IvLHn.js +325 -0
  341. package/dist/src/quiverai-BXH004Vv.js +325 -0
  342. package/dist/src/quiverai-Ccya2z8Y.cjs +325 -0
  343. package/dist/src/quiverai-Cez57oe-.js +326 -0
  344. package/dist/src/registry-3zX_M9Ik.js +131 -0
  345. package/dist/src/registry-AuCrKTvS.js +132 -0
  346. package/dist/src/registry-CxXWKtQG.js +131 -0
  347. package/dist/src/registry-DG3o66JQ.cjs +131 -0
  348. package/dist/src/remoteGeneration-CAtvamG6.js +370 -0
  349. package/dist/src/remoteGeneration-CF225pDl.cjs +482 -0
  350. package/dist/src/remoteGeneration-DtnqocnL.js +370 -0
  351. package/dist/src/remoteGeneration-g3KvW-sP.js +371 -0
  352. package/dist/src/responses-BMbaUXQI.js +1098 -0
  353. package/dist/src/responses-B_TOSof-.js +1099 -0
  354. package/dist/src/responses-v-yANwTA.cjs +1109 -0
  355. package/dist/src/runtimeTransform-BBZv-oUZ.js +156 -0
  356. package/dist/src/runtimeTransform-DT2v5ovW.js +156 -0
  357. package/dist/src/runtimeTransform-GXXEIXdS.cjs +161 -0
  358. package/dist/src/runtimeTransform-JTwBQc-P.js +157 -0
  359. package/dist/src/sagemaker-B8D0L4rj.cjs +716 -0
  360. package/dist/src/sagemaker-CR2_AGdB.js +713 -0
  361. package/dist/src/sagemaker-Cd9qSQUV.js +714 -0
  362. package/dist/src/sagemaker-mKlltN4p.js +713 -0
  363. package/dist/src/scanner-PG_8lh8r.js +1971 -0
  364. package/dist/src/server/index.js +55 -55
  365. package/dist/src/server-Bmh7sd9F.js +155 -0
  366. package/dist/src/server-C7b8z6aC.js +63 -0
  367. package/dist/src/server-CAcovgtL.js +2 -0
  368. package/dist/src/server-CuuMfKlh.cjs +74 -0
  369. package/dist/src/server-DMPCj9jy.js +189 -0
  370. package/dist/src/session-BksXvRH_.cjs +69 -0
  371. package/dist/src/session-DOxUjqGQ.js +63 -0
  372. package/dist/src/session-Dujsc-b9.js +62 -0
  373. package/dist/src/session-VjtIxREd.js +62 -0
  374. package/dist/src/shared-Bkyz_7e5.cjs +2185 -0
  375. package/dist/src/shared-DDJg8ycC.js +1929 -0
  376. package/dist/src/shared-Dh3yfRBd.js +1927 -0
  377. package/dist/src/shared-tfPT8Tna.js +1928 -0
  378. package/dist/src/simulatedUser-6JdkyL3k.cjs +252 -0
  379. package/dist/src/simulatedUser-CFr2mr3M.js +248 -0
  380. package/dist/src/simulatedUser-DjwwUqx-.js +247 -0
  381. package/dist/src/slack-C_gIYiUs.js +144 -0
  382. package/dist/src/slack-DhNbz9CM.cjs +144 -0
  383. package/dist/src/slack-Dm2iI1zu.js +145 -0
  384. package/dist/src/strategies-BIY-bNul.js +2248 -0
  385. package/dist/src/strategies-C1KQQj9G.cjs +2420 -0
  386. package/dist/src/strategies-DM_3mReG.js +2385 -0
  387. package/dist/src/telemetry-BhMTibZO.js +2 -0
  388. package/dist/src/telemetry-C04d25BM.cjs +216 -0
  389. package/dist/src/telemetry-CIqy4fSC.js +201 -0
  390. package/dist/src/telemetry-CXozp_6C.js +205 -0
  391. package/dist/src/telemetry-g7PkBxmY.js +205 -0
  392. package/dist/src/togetherai-BvCim68-.js +50 -0
  393. package/dist/src/togetherai-CWyDCA9m.cjs +49 -0
  394. package/dist/src/togetherai-CeSE31vK.js +49 -0
  395. package/dist/src/togetherai-_2W0URf8.js +48 -0
  396. package/dist/src/traceContext-Brw3Oe41.js +1016 -0
  397. package/dist/src/traceContext-DpAYv27G.js +1015 -0
  398. package/dist/src/traceContext-KSqhzZI2.cjs +1032 -0
  399. package/dist/src/transcription-BySopazW.js +175 -0
  400. package/dist/src/transcription-DO4UPkRI.cjs +178 -0
  401. package/dist/src/transcription-RJGBa-pC.js +176 -0
  402. package/dist/src/transcription-fZenF3G5.js +175 -0
  403. package/dist/src/transform-BzhRc5z2.js +125 -0
  404. package/dist/src/transform-CPQu05u6.cjs +154 -0
  405. package/dist/src/transform-DAED8imp.js +126 -0
  406. package/dist/src/transform-DIOIQDmM.js +125 -0
  407. package/dist/src/typesafe-ByE0Kxfg.js +253 -0
  408. package/dist/src/typesafe-CFqGFY34.js +253 -0
  409. package/dist/src/typesafe-DCWIw-CP.cjs +253 -0
  410. package/dist/src/typesafe-DyHFV5Qk.js +254 -0
  411. package/dist/src/util-BHkj9joz.js +2049 -0
  412. package/dist/src/util-CICwIpmu.cjs +934 -0
  413. package/dist/src/util-CePiY2xZ.js +286 -0
  414. package/dist/src/util-CgT3uf4p.js +743 -0
  415. package/dist/src/util-Cj9drvOY.js +1770 -0
  416. package/dist/src/util-ClJRjlQA.cjs +357 -0
  417. package/dist/src/util-Cxf8VF2M.js +395 -0
  418. package/dist/src/util-D7RdV7rS.js +395 -0
  419. package/dist/src/util-DMNFhk47.js +351 -0
  420. package/dist/src/util-DNzh3M0z.js +396 -0
  421. package/dist/src/util-Df7rfMGb.cjs +2305 -0
  422. package/dist/src/util-Kf0KnG_6.js +2051 -0
  423. package/dist/src/util-LEbeiYw_.js +743 -0
  424. package/dist/src/util-WH8CgVs4.js +352 -0
  425. package/dist/src/util-cx6Xw8Lw.cjs +478 -0
  426. package/dist/src/util-qzBqirBH.js +2050 -0
  427. package/dist/src/vertex-CBAMfRz3.js +854 -0
  428. package/dist/src/vertex-CMP2IpN9.js +2 -0
  429. package/dist/src/vertex-CZ5YOotT.js +848 -0
  430. package/dist/src/vertex-DNsh1F1M.cjs +871 -0
  431. package/dist/src/vertexLive-BTXYj3-F.js +55 -0
  432. package/dist/src/vertexLive-Ba_LAqEF.cjs +55 -0
  433. package/dist/src/vertexLive-DM4sFaaj.js +56 -0
  434. package/dist/src/vertexLive-JqZOw7HC.js +55 -0
  435. package/dist/src/video-BY7Q2Gii.cjs +706 -0
  436. package/dist/src/video-CYElP-CK.js +703 -0
  437. package/dist/src/video-C_AdEDH0.js +702 -0
  438. package/dist/src/video-DGvjQ_4j.js +702 -0
  439. package/package.json +1 -1
  440. package/dist/src/accounts-Dpb43yde.cjs +0 -276
  441. package/dist/src/accounts-GKrO1olH.js +0 -229
  442. package/dist/src/accounts-e4FGOsji.js +0 -227
  443. package/dist/src/accounts-sUiEJfkB.js +0 -222
  444. package/dist/src/agentWorkspace-B8A_wuMR.cjs +0 -619
  445. package/dist/src/agentWorkspace-DSPIscXR.js +0 -593
  446. package/dist/src/agentWorkspace-DxUqd-XK.js +0 -592
  447. package/dist/src/agentWorkspace-n0uOJXhD.js +0 -592
  448. package/dist/src/agentic-utils-9bCj4twQ.js +0 -197
  449. package/dist/src/agentic-utils-CyCLuLoj.js +0 -197
  450. package/dist/src/agentic-utils-D23qtOlx.cjs +0 -237
  451. package/dist/src/agentic-utils-DuBMMNCw.js +0 -198
  452. package/dist/src/agents-6hDRNoYD.js +0 -777
  453. package/dist/src/agents-B8w2o7Sc.cjs +0 -777
  454. package/dist/src/agents-Ck0NXl7v.js +0 -777
  455. package/dist/src/agents-CwT3B1qB.js +0 -778
  456. package/dist/src/agents-DOLjfOEq.js +0 -266
  457. package/dist/src/agents-OcF9hq--.js +0 -267
  458. package/dist/src/agents-api-CnZZt8bn.cjs +0 -710
  459. package/dist/src/agents-api-D04u3bmL.js +0 -711
  460. package/dist/src/agents-api-DWw0_Vio.js +0 -710
  461. package/dist/src/agents-api-IWHEwp8i.js +0 -710
  462. package/dist/src/agents-mHt2Mh9O.cjs +0 -266
  463. package/dist/src/agents-sICccZCA.js +0 -266
  464. package/dist/src/ai.studio-Ci4rypDT.js +0 -2
  465. package/dist/src/ai.studio-KkQ6KaHa.js +0 -369
  466. package/dist/src/ai.studio-gSXK2cGI.js +0 -374
  467. package/dist/src/ai.studio-nQF_B4DH.cjs +0 -391
  468. package/dist/src/aimlapi-BeSk5BDV.js +0 -30
  469. package/dist/src/aimlapi-CzNUhdKu.cjs +0 -29
  470. package/dist/src/aimlapi-DCkazDPI.js +0 -29
  471. package/dist/src/aimlapi-WeH5B6K1.js +0 -28
  472. package/dist/src/anthropicMessages-AcNWTpYO.js +0 -115
  473. package/dist/src/anthropicMessages-BUtvzbpL.js +0 -114
  474. package/dist/src/anthropicMessages-DTWhZDCd.js +0 -114
  475. package/dist/src/anthropicMessages-lGVnSgyx.cjs +0 -114
  476. package/dist/src/app/assets/index-CyEI5aDN.js +0 -392
  477. package/dist/src/audio-BE_Duiu1.js +0 -104
  478. package/dist/src/audio-CiUd00k2.cjs +0 -104
  479. package/dist/src/audio-Dop6omna.js +0 -105
  480. package/dist/src/audio-EZNTInr_.js +0 -104
  481. package/dist/src/authoritativeMarkupInjection-BUqH6hNk.js +0 -78
  482. package/dist/src/authoritativeMarkupInjection-BmbJdJO0.cjs +0 -78
  483. package/dist/src/authoritativeMarkupInjection-Cpz12Y3w.js +0 -78
  484. package/dist/src/authoritativeMarkupInjection-W4XfcH91.js +0 -79
  485. package/dist/src/aws-B2Jqbnet.js +0 -2433
  486. package/dist/src/aws-DHtuUIzQ.js +0 -1149
  487. package/dist/src/aws-DLqXP6wY.js +0 -2433
  488. package/dist/src/aws-DfduhmwL.cjs +0 -2454
  489. package/dist/src/base-B9L2Xvpc.js +0 -255
  490. package/dist/src/base-BTZnIsuH.cjs +0 -305
  491. package/dist/src/base-BhaWNQPJ.js +0 -462
  492. package/dist/src/base-Br-G_Xou.js +0 -256
  493. package/dist/src/base-Bzo8hiUS.cjs +0 -467
  494. package/dist/src/base-C82fd2jq.js +0 -463
  495. package/dist/src/base-CRdQwC1W.js +0 -462
  496. package/dist/src/base-CjGwZNOQ.js +0 -255
  497. package/dist/src/bedrock-BdMru_ro.js +0 -1300
  498. package/dist/src/bedrock-CBUmfLX1.cjs +0 -2
  499. package/dist/src/bedrock-DBDxBaF9.js +0 -2
  500. package/dist/src/bedrock-DDrECM21.js +0 -1
  501. package/dist/src/bedrock-DVwkgvRS.js +0 -1
  502. package/dist/src/bestOfN-AKF5beq4.js +0 -159
  503. package/dist/src/bestOfN-C1UIVGJV.js +0 -160
  504. package/dist/src/bestOfN-DlkETbXy.cjs +0 -161
  505. package/dist/src/bestOfN-XIfEgU-g.js +0 -159
  506. package/dist/src/cache-BZaVoKaA.js +0 -2
  507. package/dist/src/cache-CEYhFUsH.js +0 -741
  508. package/dist/src/cache-Cbw1zH6q.js +0 -782
  509. package/dist/src/cache-CdaZNb75.js +0 -754
  510. package/dist/src/cache-DpuIzPxh.cjs +0 -856
  511. package/dist/src/cerebras-Bpn6FPkJ.js +0 -97
  512. package/dist/src/cerebras-CqJ0BRCJ.cjs +0 -97
  513. package/dist/src/cerebras-D4ILa_TY.js +0 -97
  514. package/dist/src/cerebras-DR8uc7ee.js +0 -98
  515. package/dist/src/chat-B7PZfaYp.cjs +0 -987
  516. package/dist/src/chat-BVuSjdEb.js +0 -227
  517. package/dist/src/chat-BsaZRjXN.js +0 -76
  518. package/dist/src/chat-C5liqe3Y.js +0 -226
  519. package/dist/src/chat-C9hyHf5B.js +0 -124
  520. package/dist/src/chat-CFLalAck.js +0 -226
  521. package/dist/src/chat-CN8JGrHu.js +0 -76
  522. package/dist/src/chat-CaHBBpCb.js +0 -123
  523. package/dist/src/chat-CcbLSghx.js +0 -123
  524. package/dist/src/chat-CoSN6sr2.js +0 -934
  525. package/dist/src/chat-CsJRFX8a.cjs +0 -226
  526. package/dist/src/chat-DFoZLvO_.js +0 -934
  527. package/dist/src/chat-DiLQvL7r.js +0 -77
  528. package/dist/src/chat-F6qVSDk3.cjs +0 -123
  529. package/dist/src/chat-Oq4FaJgI.cjs +0 -76
  530. package/dist/src/chat-knMfQUKz.js +0 -935
  531. package/dist/src/claude-agent-sdk-CJkOLpnI.js +0 -999
  532. package/dist/src/claude-agent-sdk-Ckn76PRD.js +0 -999
  533. package/dist/src/claude-agent-sdk-DX0gTr11.cjs +0 -1005
  534. package/dist/src/claude-agent-sdk-LMeikxoR.js +0 -1000
  535. package/dist/src/client-BFf1r6Z8.js +0 -352
  536. package/dist/src/client-CdXyDdDi.js +0 -351
  537. package/dist/src/client-DV8XMu7i.js +0 -351
  538. package/dist/src/client-iEXtOBKW.cjs +0 -357
  539. package/dist/src/cloud-B02qcpjf.js +0 -2
  540. package/dist/src/cloud-BlHP-g1v.cjs +0 -666
  541. package/dist/src/cloud-C9BI4isF.js +0 -287
  542. package/dist/src/cloud-CTTLNdvj.js +0 -657
  543. package/dist/src/cloud-D5X5yQ_d.js +0 -599
  544. package/dist/src/cloud-QxPkpsHA.js +0 -599
  545. package/dist/src/cloudflare-ai-DRTRT1fc.js +0 -132
  546. package/dist/src/cloudflare-ai-DgaXapAV.cjs +0 -133
  547. package/dist/src/cloudflare-ai-DkuJXijS.js +0 -134
  548. package/dist/src/cloudflare-ai-wy9QCHku.js +0 -133
  549. package/dist/src/cloudflare-gateway-9cAN8g29.cjs +0 -276
  550. package/dist/src/cloudflare-gateway-BVFMD292.js +0 -277
  551. package/dist/src/cloudflare-gateway-BuUI4p6I.js +0 -276
  552. package/dist/src/cloudflare-gateway-TlYHizbW.js +0 -276
  553. package/dist/src/codex-app-server-BPz_feug.cjs +0 -2162
  554. package/dist/src/codex-app-server-C9noXM9C.js +0 -2155
  555. package/dist/src/codex-app-server-CEmD-Y5U.js +0 -2
  556. package/dist/src/codex-app-server-DZolc18r.js +0 -2156
  557. package/dist/src/codex-app-server-Dd0A37nO.js +0 -2155
  558. package/dist/src/codex-sdk-BbxjBvBk.cjs +0 -1588
  559. package/dist/src/codex-sdk-BpXeIs-_.js +0 -1557
  560. package/dist/src/codex-sdk-BtQp5X0f.js +0 -1552
  561. package/dist/src/codex-sdk-CH0v9Bk1.js +0 -2
  562. package/dist/src/codex-sdk-CgrN7JB8.js +0 -1557
  563. package/dist/src/codex-security-B5fENNUr.js +0 -406
  564. package/dist/src/codex-security-C6uuJx-y.cjs +0 -411
  565. package/dist/src/codex-security-CifWtZR_.js +0 -407
  566. package/dist/src/codex-security-Kg2bOEKy.js +0 -406
  567. package/dist/src/cometapi-BFpIDLIx.js +0 -55
  568. package/dist/src/cometapi-C6O2PIrN.js +0 -56
  569. package/dist/src/cometapi-D5Yupc6F.js +0 -53
  570. package/dist/src/cometapi-DzgIwJzJ.cjs +0 -55
  571. package/dist/src/compatible-0jhmVfOp.js +0 -25
  572. package/dist/src/compatible-DdtwWdJi.cjs +0 -24
  573. package/dist/src/compatible-Di4nR3sU.js +0 -24
  574. package/dist/src/compatible-iJKLWdnf.js +0 -24
  575. package/dist/src/completion-B0_hVUDG.js +0 -119
  576. package/dist/src/completion-BdI6v0-Q.cjs +0 -123
  577. package/dist/src/completion-CWcJscwv.js +0 -118
  578. package/dist/src/conversationScoring-99EOPJRa.js +0 -373
  579. package/dist/src/conversationScoring-BIq4J0Cq.js +0 -374
  580. package/dist/src/conversationScoring-DARyeATr.cjs +0 -398
  581. package/dist/src/conversationScoring-DS48t4Hb.js +0 -373
  582. package/dist/src/crescendo-CebvXIu4.js +0 -730
  583. package/dist/src/crescendo-CxrLS0oo.js +0 -732
  584. package/dist/src/crescendo-DZQXBSkj.js +0 -733
  585. package/dist/src/crescendo-wjEx68uD.cjs +0 -734
  586. package/dist/src/custom-BiQ-aUNw.cjs +0 -620
  587. package/dist/src/custom-ByyB5Z93.js +0 -619
  588. package/dist/src/custom-C5jOevNb.js +0 -617
  589. package/dist/src/custom-CCrsCz8o.js +0 -618
  590. package/dist/src/dataUrl-C9J7wz9H.js +0 -3133
  591. package/dist/src/dataUrl-CGsBT7UZ.cjs +0 -3187
  592. package/dist/src/dataUrl-CzKvvWNO.js +0 -2868
  593. package/dist/src/decisions-BTusXCUx.cjs +0 -514
  594. package/dist/src/decisions-BYtL9edD.js +0 -515
  595. package/dist/src/decisions-jYix_gCF.js +0 -515
  596. package/dist/src/decisions-nxxfHRAN.js +0 -516
  597. package/dist/src/docker-DDIv4zkg.js +0 -93
  598. package/dist/src/docker-DVLp_5OG.js +0 -94
  599. package/dist/src/docker-INm9w0SY.cjs +0 -94
  600. package/dist/src/docker-sGuoCul_.js +0 -95
  601. package/dist/src/embedding-CAhqLLrR.js +0 -82
  602. package/dist/src/embedding-D94GAsti.cjs +0 -86
  603. package/dist/src/embedding-zb4MAzQy.js +0 -81
  604. package/dist/src/envoy-BMPszwEa.cjs +0 -60
  605. package/dist/src/envoy-Bp-s39_8.js +0 -60
  606. package/dist/src/envoy-BswDt-Ou.js +0 -61
  607. package/dist/src/envoy-rVbYcV80.js +0 -60
  608. package/dist/src/eval-B1-XfrC7.js +0 -2
  609. package/dist/src/eval-pC4qCvLw.js +0 -1920
  610. package/dist/src/evalResult-CzjCb5bd.js +0 -1300
  611. package/dist/src/evaluator-CNq2K7J_.js +0 -10578
  612. package/dist/src/evaluator-LtfxdxEu.js +0 -2
  613. package/dist/src/evaluatorHelpers-C5J0NYpQ.js +0 -601
  614. package/dist/src/evaluatorHelpers-DcdCglCs.cjs +0 -622
  615. package/dist/src/evaluatorHelpers-Rvb88W6B.js +0 -600
  616. package/dist/src/fetch-5HtnNhHg.js +0 -1556
  617. package/dist/src/fetch-BCwjoIFd.js +0 -1559
  618. package/dist/src/fetch-BhfUnKen.js +0 -1280
  619. package/dist/src/fetch-C08w4vVl.js +0 -9
  620. package/dist/src/fetch-DBxy8Tlb.cjs +0 -14
  621. package/dist/src/fetch-DYte6oQX.cjs +0 -1853
  622. package/dist/src/fetch-ElpfcAVG.js +0 -10
  623. package/dist/src/fetch-lM1OIaSt.js +0 -2
  624. package/dist/src/functionCallbackUtils-BCAdWfHO.js +0 -246
  625. package/dist/src/functionCallbackUtils-BYq9qOhG.js +0 -245
  626. package/dist/src/functionCallbackUtils-ByWkmVud.cjs +0 -262
  627. package/dist/src/functionCallbackUtils-D_C_JaFd.js +0 -245
  628. package/dist/src/gemini-image-CAlwaJhZ.js +0 -471
  629. package/dist/src/gemini-image-DJoVoOnZ.cjs +0 -471
  630. package/dist/src/gemini-image-Waio-9Xx.js +0 -472
  631. package/dist/src/gemini-image-vbY6Ftbf.js +0 -471
  632. package/dist/src/goat-BWbtyY9c.js +0 -512
  633. package/dist/src/goat-CXzzeCOQ.cjs +0 -515
  634. package/dist/src/goat-CfgvzSgZ.js +0 -514
  635. package/dist/src/goat-DLeoIHBp.js +0 -515
  636. package/dist/src/goblin-CmfCfwqk.cjs +0 -22
  637. package/dist/src/goblin-CtcaORRH.js +0 -22
  638. package/dist/src/goblin-DF6DDhM-.js +0 -22
  639. package/dist/src/goblin-Nai0xxBV.js +0 -23
  640. package/dist/src/google-ClpkLtKL.cjs +0 -142
  641. package/dist/src/google-CrFgKu9k.js +0 -143
  642. package/dist/src/google-Dj_EIBqS.js +0 -142
  643. package/dist/src/google-e4-vARv6.js +0 -142
  644. package/dist/src/graders-BN1IIa71.js +0 -15470
  645. package/dist/src/graders-C5sCfSP5.js +0 -2
  646. package/dist/src/hydra-B7RfXVBK.js +0 -2
  647. package/dist/src/hydra-C1cFN-Jg.js +0 -613
  648. package/dist/src/hydra-CK6Uc1ia.js +0 -612
  649. package/dist/src/hydra-Dg65rAP_.js +0 -610
  650. package/dist/src/hydra-Fqx8l_Xu.cjs +0 -612
  651. package/dist/src/image-BdlUDAtp.js +0 -163
  652. package/dist/src/image-C-KwEhwt.cjs +0 -163
  653. package/dist/src/image-C76fp6NK.cjs +0 -209
  654. package/dist/src/image-D75ehv3D.js +0 -482
  655. package/dist/src/image-DKtc5v5W.js +0 -209
  656. package/dist/src/image-DT_xOkJY.js +0 -163
  657. package/dist/src/image-DVpdllEE.js +0 -209
  658. package/dist/src/image-DXZ8AzMf.js +0 -481
  659. package/dist/src/image-DZl_1mvy.js +0 -164
  660. package/dist/src/image-DcTD7Ak0.cjs +0 -504
  661. package/dist/src/image-ndxEvBKB.js +0 -210
  662. package/dist/src/indirectWebPwn-70WA5x_q.js +0 -435
  663. package/dist/src/indirectWebPwn-BRVyd3qV.cjs +0 -463
  664. package/dist/src/indirectWebPwn-BsJVsu0q.js +0 -285
  665. package/dist/src/indirectWebPwn-Cw6yJu0i.js +0 -285
  666. package/dist/src/indirectWebPwn-D-PhJzo4.js +0 -286
  667. package/dist/src/indirectWebPwn-DRPHt2I8.js +0 -434
  668. package/dist/src/indirectWebPwn-DXtfFhd9.cjs +0 -285
  669. package/dist/src/indirectWebPwn-DvpNouzc.js +0 -434
  670. package/dist/src/interactions-5ixfW7Cl.js +0 -850
  671. package/dist/src/interactions-BOUzfmg1.cjs +0 -850
  672. package/dist/src/interactions-CSSXcGNc.js +0 -851
  673. package/dist/src/interactions-WB_sgkN0.js +0 -850
  674. package/dist/src/iterative-BShRNqjC.cjs +0 -549
  675. package/dist/src/iterative-BcW_ELtB.js +0 -548
  676. package/dist/src/iterative-BpHbHz8B.js +0 -547
  677. package/dist/src/iterative-YcchP12d.js +0 -545
  678. package/dist/src/iterativeImage-BMFE5Hl7.cjs +0 -419
  679. package/dist/src/iterativeImage-CkSaYLMY.js +0 -417
  680. package/dist/src/iterativeImage-DAEUlQX_.js +0 -418
  681. package/dist/src/iterativeImage-DeUSkEnj.js +0 -417
  682. package/dist/src/iterativeMeta-DbdaKdEO.cjs +0 -439
  683. package/dist/src/iterativeMeta-DcF9JWEK.js +0 -437
  684. package/dist/src/iterativeMeta-DkfPqWIC.js +0 -439
  685. package/dist/src/iterativeMeta-DkrpnVSs.js +0 -440
  686. package/dist/src/iterativeTree-CEMY1FhE.cjs +0 -879
  687. package/dist/src/iterativeTree-Cv5W4tX9.js +0 -877
  688. package/dist/src/iterativeTree-DGvomd3M.js +0 -876
  689. package/dist/src/iterativeTree-KbtC2Mkz.js +0 -878
  690. package/dist/src/knowledgeBase-AYRXn4wO.js +0 -163
  691. package/dist/src/knowledgeBase-BNqQfx01.js +0 -163
  692. package/dist/src/knowledgeBase-C0IaCCVs.js +0 -164
  693. package/dist/src/knowledgeBase-C2uj6wK4.cjs +0 -163
  694. package/dist/src/litellm-CN1ScAwZ.js +0 -147
  695. package/dist/src/litellm-CTjwiKSa.js +0 -146
  696. package/dist/src/litellm-Cd4Nj5ue.js +0 -145
  697. package/dist/src/litellm-DMqLpEBg.cjs +0 -146
  698. package/dist/src/live-Bt50-InO.cjs +0 -891
  699. package/dist/src/live-Bu2ujadG.js +0 -2
  700. package/dist/src/live-C3M52i3p.js +0 -891
  701. package/dist/src/live-CRfHMO3B.js +0 -892
  702. package/dist/src/live-iCIpO14m.js +0 -891
  703. package/dist/src/luma-ray-B8eHC4c8.cjs +0 -309
  704. package/dist/src/luma-ray-BIvkPw0s.js +0 -309
  705. package/dist/src/luma-ray-ChsiBxMA.js +0 -309
  706. package/dist/src/luma-ray-DAvKrInz.js +0 -310
  707. package/dist/src/mantleChat-5YeEXAZI.js +0 -154
  708. package/dist/src/mantleChat-D--mW3hl.js +0 -154
  709. package/dist/src/mantleChat-DHP3siNg.cjs +0 -154
  710. package/dist/src/mantleChat-wBfAX46o.js +0 -155
  711. package/dist/src/mcp-49jlEcTQ.js +0 -85
  712. package/dist/src/mcp-__PIz81I.js +0 -84
  713. package/dist/src/memoryPoisoning-Chxge74M.js +0 -111
  714. package/dist/src/memoryPoisoning-QH6NCUVE.js +0 -112
  715. package/dist/src/memoryPoisoning-tCxZt8Nz.js +0 -111
  716. package/dist/src/memoryPoisoning-ymrRItRR.cjs +0 -111
  717. package/dist/src/messages-BE_eZ7NA.js +0 -1127
  718. package/dist/src/messages-Bo638ShI.js +0 -1127
  719. package/dist/src/messages-BzR0-NQ1.js +0 -1128
  720. package/dist/src/messages-Cbg5Pfd0.cjs +0 -1161
  721. package/dist/src/mischievousUser-BtED2Z5Z.cjs +0 -51
  722. package/dist/src/mischievousUser-KqSOjrDJ.js +0 -51
  723. package/dist/src/mischievousUser-YMD41YNZ.js +0 -51
  724. package/dist/src/mischievousUser-zBxlNdCu.js +0 -52
  725. package/dist/src/modelslab-B8gZxtfE.js +0 -171
  726. package/dist/src/modelslab-C7bmVpTB.js +0 -170
  727. package/dist/src/modelslab-CCeQCTZg.js +0 -170
  728. package/dist/src/modelslab-CvBJGv7y.cjs +0 -170
  729. package/dist/src/nova-reel-BOEWsEKA.cjs +0 -272
  730. package/dist/src/nova-reel-BtyBXq5M.js +0 -273
  731. package/dist/src/nova-reel-C1eF3-EE.js +0 -272
  732. package/dist/src/nova-reel-YhgrxEKT.js +0 -272
  733. package/dist/src/nova-sonic-BaERP20w.js +0 -374
  734. package/dist/src/nova-sonic-CxgM3O-P.cjs +0 -374
  735. package/dist/src/nova-sonic-DJS22fC3.js +0 -375
  736. package/dist/src/nova-sonic-DwvwHyRX.js +0 -374
  737. package/dist/src/novita-D1l2tG0O.js +0 -116
  738. package/dist/src/novita-D84VM3v0.cjs +0 -115
  739. package/dist/src/novita-DGInvwfR.js +0 -115
  740. package/dist/src/novita-vXHkXhTg.js +0 -114
  741. package/dist/src/nscale-CU0Ldr00.js +0 -209
  742. package/dist/src/nscale-ClfKlQeM.cjs +0 -209
  743. package/dist/src/nscale-DxaVnF0x.js +0 -210
  744. package/dist/src/nscale-_poVxIrO.js +0 -207
  745. package/dist/src/openaiResponses-CJGsneNj.js +0 -317
  746. package/dist/src/openaiResponses-CKSl5Sdg.js +0 -319
  747. package/dist/src/openaiResponses-DC8rzFUc.js +0 -318
  748. package/dist/src/openaiResponses-rMHIA3dV.cjs +0 -318
  749. package/dist/src/openclaw-CCbvsNFW.cjs +0 -1344
  750. package/dist/src/openclaw-CZw1lCDZ.js +0 -1336
  751. package/dist/src/openclaw-ChFLgC-a.js +0 -1338
  752. package/dist/src/openclaw-DrPMoRrH.js +0 -1337
  753. package/dist/src/opencode-sdk-2EfIDhFp.cjs +0 -1018
  754. package/dist/src/opencode-sdk-CHw3F845.js +0 -1013
  755. package/dist/src/opencode-sdk-D0EGGxvy.js +0 -1012
  756. package/dist/src/opencode-sdk-jSS7NI2Q.js +0 -1012
  757. package/dist/src/openinterpreter-CY622xHC.js +0 -431
  758. package/dist/src/openinterpreter-DATyhuhP.js +0 -432
  759. package/dist/src/openinterpreter-DDUMyIf1.js +0 -431
  760. package/dist/src/openinterpreter-s5Tz6Lid.cjs +0 -435
  761. package/dist/src/pricing-C498twd2.js +0 -976
  762. package/dist/src/pricing-DBd_bMIh.cjs +0 -999
  763. package/dist/src/pricing-ISrMCskv.js +0 -976
  764. package/dist/src/promptfoo-6p0WG2ih.js +0 -286
  765. package/dist/src/promptfoo-BQRfgNs_.js +0 -285
  766. package/dist/src/promptfoo-Bqo88z20.cjs +0 -341
  767. package/dist/src/promptfoo-Cq5AVI3I.js +0 -286
  768. package/dist/src/providers-ATbeMX5E.cjs +0 -24180
  769. package/dist/src/providers-B7F1FiNI.js +0 -2
  770. package/dist/src/providers-DazIw8mI.js +0 -24039
  771. package/dist/src/providers-QvGlNAD0.js +0 -24437
  772. package/dist/src/quiverai-BPlNcLkV.cjs +0 -325
  773. package/dist/src/quiverai-By99-YmJ.js +0 -325
  774. package/dist/src/quiverai-CmmByDqo.js +0 -325
  775. package/dist/src/quiverai-HZkoJJqw.js +0 -326
  776. package/dist/src/registry-BLTnTfjT.cjs +0 -131
  777. package/dist/src/registry-BMC-COHT.js +0 -132
  778. package/dist/src/registry-C8UZtmBp.js +0 -131
  779. package/dist/src/registry-CfwEUYXG.js +0 -131
  780. package/dist/src/remoteGeneration-Bgg6kC5V.js +0 -370
  781. package/dist/src/remoteGeneration-CKJFE960.cjs +0 -482
  782. package/dist/src/remoteGeneration-DaxwJDKv.js +0 -370
  783. package/dist/src/remoteGeneration-vHMGVKr1.js +0 -371
  784. package/dist/src/responses-BvnyIHrq.js +0 -1099
  785. package/dist/src/responses-CERAgvf-.js +0 -1098
  786. package/dist/src/responses-CwgjeuOg.cjs +0 -1109
  787. package/dist/src/runtimeTransform-3RF9Avyg.cjs +0 -161
  788. package/dist/src/runtimeTransform-C51Z5j4H.js +0 -156
  789. package/dist/src/runtimeTransform-CKE_Iyv8.js +0 -157
  790. package/dist/src/runtimeTransform-Cs11xJpj.js +0 -156
  791. package/dist/src/sagemaker-BJ4dOCxE.js +0 -713
  792. package/dist/src/sagemaker-Bt3JUAWq.js +0 -714
  793. package/dist/src/sagemaker-QVKyLgLF.cjs +0 -716
  794. package/dist/src/sagemaker-l3IB8iTs.js +0 -713
  795. package/dist/src/scanner-DGjIiTZ1.js +0 -1971
  796. package/dist/src/server-BNaLZH6u.js +0 -63
  797. package/dist/src/server-CBMuQul3.js +0 -189
  798. package/dist/src/server-CMKKIzKv.cjs +0 -74
  799. package/dist/src/server-CN2IS9Cs.js +0 -155
  800. package/dist/src/server-ua4cqbjC.js +0 -2
  801. package/dist/src/session-CQIjq_HZ.cjs +0 -69
  802. package/dist/src/session-FTlg8sEu.js +0 -62
  803. package/dist/src/session-GBQXtPWp.js +0 -63
  804. package/dist/src/session-_0-rTdwY.js +0 -62
  805. package/dist/src/shared-BtuO-OAM.js +0 -1927
  806. package/dist/src/shared-Ci78wTZX.js +0 -1928
  807. package/dist/src/shared-Dd3rimdM.js +0 -1929
  808. package/dist/src/shared-KAjFxRre.cjs +0 -2185
  809. package/dist/src/simulatedUser--OjW6xCx.js +0 -247
  810. package/dist/src/simulatedUser-D0-slRye.cjs +0 -252
  811. package/dist/src/simulatedUser-D1Kh_cwA.js +0 -248
  812. package/dist/src/slack-BX0FUevO.js +0 -144
  813. package/dist/src/slack-CcwXFiJE.cjs +0 -144
  814. package/dist/src/slack-CnfqKfXp.js +0 -145
  815. package/dist/src/strategies-2ntcK4tN.js +0 -2248
  816. package/dist/src/strategies-DZIW7Zcs.js +0 -2385
  817. package/dist/src/strategies-YRDF2j-N.cjs +0 -2420
  818. package/dist/src/telemetry-CL8CVA4p.js +0 -205
  819. package/dist/src/telemetry-Cix90qqz.js +0 -201
  820. package/dist/src/telemetry-CkmlqTjV.js +0 -205
  821. package/dist/src/telemetry-DQH7l5bb.js +0 -2
  822. package/dist/src/telemetry-DUCXc1-r.cjs +0 -216
  823. package/dist/src/togetherai-3yUt5Ck7.js +0 -49
  824. package/dist/src/togetherai-BJUByLwt.cjs +0 -49
  825. package/dist/src/togetherai-Bh6KZkmd.js +0 -50
  826. package/dist/src/togetherai-DDl9yk3b.js +0 -48
  827. package/dist/src/traceContext-BiJVppjT.cjs +0 -1032
  828. package/dist/src/traceContext-CKKluULP.js +0 -1016
  829. package/dist/src/traceContext-D3Sk8fO-.js +0 -1015
  830. package/dist/src/transcription-BoVQKIVz.js +0 -175
  831. package/dist/src/transcription-Bs5u8780.js +0 -175
  832. package/dist/src/transcription-Dl654d1p.cjs +0 -178
  833. package/dist/src/transcription-VEvhM1Fu.js +0 -176
  834. package/dist/src/transform-BAbkGpvl.js +0 -125
  835. package/dist/src/transform-C_j4hUH8.js +0 -126
  836. package/dist/src/transform-Da86hs4M.cjs +0 -154
  837. package/dist/src/transform-_i1raQNo.js +0 -125
  838. package/dist/src/typesafe-CKXBeh82.cjs +0 -253
  839. package/dist/src/typesafe-D3VaGeNm.js +0 -253
  840. package/dist/src/typesafe-DYM-SFNH.js +0 -253
  841. package/dist/src/typesafe-LXmSbw8F.js +0 -254
  842. package/dist/src/util-41rb0XHX.js +0 -743
  843. package/dist/src/util-B0WlHYFM.js +0 -2049
  844. package/dist/src/util-BD1R_PsR.js +0 -1770
  845. package/dist/src/util-BLbM_ItC.js +0 -395
  846. package/dist/src/util-C72P0iIa.js +0 -352
  847. package/dist/src/util-C7MpGlJ6.cjs +0 -2305
  848. package/dist/src/util-CCtqagKc.js +0 -286
  849. package/dist/src/util-CM2Ec_uY.js +0 -2051
  850. package/dist/src/util-CSSAWO8v.js +0 -351
  851. package/dist/src/util-CkQc-fx3.cjs +0 -934
  852. package/dist/src/util-DcOlFTFa.cjs +0 -478
  853. package/dist/src/util-DluGTGVB.js +0 -395
  854. package/dist/src/util-PfQ60chz.js +0 -743
  855. package/dist/src/util-f14-CPij.js +0 -396
  856. package/dist/src/util-l9pXX3Eu.cjs +0 -357
  857. package/dist/src/util-o_BnlYqS.js +0 -2050
  858. package/dist/src/vertex-B_-gQgzc.js +0 -2
  859. package/dist/src/vertex-CU4gqoYa.js +0 -854
  860. package/dist/src/vertex-DZ42UHb3.js +0 -848
  861. package/dist/src/vertex-DsYQJA0T.cjs +0 -871
  862. package/dist/src/vertexLive-BvIaHKGB.js +0 -55
  863. package/dist/src/vertexLive-CTULqNx7.js +0 -56
  864. package/dist/src/vertexLive-DjJ_YQBe.cjs +0 -55
  865. package/dist/src/vertexLive-STUGcteB.js +0 -55
  866. package/dist/src/video-CAQGmtEV.js +0 -703
  867. package/dist/src/video-_FSTWlwX.js +0 -702
  868. package/dist/src/video-aBPJPWdt.js +0 -702
  869. package/dist/src/video-gDjkWv5m.cjs +0 -706
@@ -0,0 +1,1853 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
+ const require_logger = require("./logger-DXUHJBHJ.cjs");
3
+ const require_invariant = require("./invariant-C2JOzzO2.cjs");
4
+ const require_shared = require("./shared-D9Bf3UgD.cjs");
5
+ const require_time = require("./time-CY7bOv6D.cjs");
6
+ let path = require("path");
7
+ path = require_rolldown_runtime.__toESM(path, 1);
8
+ let node_async_hooks = require("node:async_hooks");
9
+ let fs = require("fs");
10
+ fs = require_rolldown_runtime.__toESM(fs, 1);
11
+ let js_yaml = require("js-yaml");
12
+ js_yaml = require_rolldown_runtime.__toESM(js_yaml, 1);
13
+ let node_fs_promises = require("node:fs/promises");
14
+ node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
15
+ let proxy_from_env = require("proxy-from-env");
16
+ let undici = require("undici");
17
+ let util = require("util");
18
+ let zlib = require("zlib");
19
+ //#region src/version.ts
20
+ /**
21
+ * Application version from package.json.
22
+ * Injected at build time, or read from npm environment in development.
23
+ */
24
+ const VERSION = "0.125.1";
25
+ /**
26
+ * PostHog analytics key.
27
+ * Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
28
+ * Empty string in development/test.
29
+ */
30
+ const POSTHOG_KEY = "phc_E5n5uHnDo2eREJL1uqX1cIlbkoRby4yFWt3V94HqRRg";
31
+ function getShareApiBaseUrl() {
32
+ return require_logger.getEnvString("PROMPTFOO_REMOTE_API_BASE_URL") || "https://api.promptfoo.app";
33
+ }
34
+ function getDefaultShareViewBaseUrl() {
35
+ return require_logger.getEnvString("PROMPTFOO_SHARING_APP_BASE_URL", `https://promptfoo.app`);
36
+ }
37
+ function getShareViewBaseUrl() {
38
+ return require_logger.getEnvString("PROMPTFOO_REMOTE_APP_BASE_URL") || getDefaultShareViewBaseUrl();
39
+ }
40
+ const TERMINAL_MAX_WIDTH = process?.stdout?.isTTY && process?.stdout?.columns && process?.stdout?.columns > 10 ? process?.stdout?.columns - 10 : 120;
41
+ const CLOUD_PROVIDER_PREFIX = "promptfoo://provider/";
42
+ const CONSENT_ENDPOINT = "https://api.promptfoo.dev/consent";
43
+ const EVENTS_ENDPOINT = "https://a.promptfoo.app";
44
+ const R_ENDPOINT = "https://r.promptfoo.app/";
45
+ //#endregion
46
+ //#region src/globalConfig/globalConfig.ts
47
+ /**
48
+ * Functions for manipulating the global configuration file, which lives at
49
+ * ~/.promptfoo/promptfoo.yaml by default.
50
+ */
51
+ function writeGlobalConfig(config) {
52
+ fs.writeFileSync(path.join(require_logger.getConfigDirectoryPath(true), "promptfoo.yaml"), js_yaml.dump(config));
53
+ }
54
+ function readGlobalConfig() {
55
+ const configDir = require_logger.getConfigDirectoryPath();
56
+ const configFilePath = path.join(configDir, "promptfoo.yaml");
57
+ let globalConfig = { id: crypto.randomUUID() };
58
+ if (fs.existsSync(configFilePath)) {
59
+ globalConfig = require_logger.loadYaml(fs.readFileSync(configFilePath, "utf-8")) || {};
60
+ if (!globalConfig?.id) {
61
+ globalConfig = {
62
+ ...globalConfig,
63
+ id: crypto.randomUUID()
64
+ };
65
+ writeGlobalConfig(globalConfig);
66
+ }
67
+ } else {
68
+ if (!fs.existsSync(configDir)) fs.mkdirSync(configDir, { recursive: true });
69
+ fs.writeFileSync(configFilePath, js_yaml.dump(globalConfig));
70
+ }
71
+ return globalConfig;
72
+ }
73
+ /**
74
+ * Merges the top-level keys into existing config.
75
+ * @param partialConfig New keys to merge into the existing config.
76
+ */
77
+ function writeGlobalConfigPartial(partialConfig) {
78
+ const updatedConfig = { ...readGlobalConfig() };
79
+ Object.entries(partialConfig).forEach(([key, value]) => {
80
+ if (value !== void 0 && value !== null) updatedConfig[key] = value;
81
+ else delete updatedConfig[key];
82
+ });
83
+ writeGlobalConfig(updatedConfig);
84
+ }
85
+ const CLOUD_HOSTNAMES = /* @__PURE__ */ new Set([
86
+ new URL("https://api.promptfoo.app").hostname,
87
+ new URL("https://www.promptfoo.app").hostname,
88
+ new URL("https://promptfoo.app").hostname
89
+ ]);
90
+ const SHARING_CUTOFF_DATE = /* @__PURE__ */ new Date("2026-03-09T00:00:00Z");
91
+ function isPromptfooCloudHost(url) {
92
+ try {
93
+ const hostname = new URL(url).hostname.toLowerCase().replace(/\.$/, "");
94
+ return CLOUD_HOSTNAMES.has(hostname);
95
+ } catch {
96
+ return false;
97
+ }
98
+ }
99
+ let hasWarnedAboutLegacyApiHost = false;
100
+ function warnOnceAboutLegacyApiHost() {
101
+ if (hasWarnedAboutLegacyApiHost) return;
102
+ hasWarnedAboutLegacyApiHost = true;
103
+ require_logger.logger.warn("Ignoring the API_HOST environment variable for Promptfoo Cloud routing. To point at a self-hosted deployment, use PROMPTFOO_CLOUD_API_URL or `promptfoo auth login --host <url>`.");
104
+ }
105
+ var CloudConfig = class {
106
+ configState = null;
107
+ constructor(initializeImmediately = true) {
108
+ if (initializeImmediately) this.config;
109
+ }
110
+ get config() {
111
+ this.configState ??= this.readConfig();
112
+ return this.configState;
113
+ }
114
+ set config(config) {
115
+ this.configState = config;
116
+ }
117
+ readConfig() {
118
+ const savedConfig = readGlobalConfig()?.cloud || {};
119
+ return {
120
+ appUrl: savedConfig.appUrl || "https://www.promptfoo.app",
121
+ apiHost: savedConfig.apiHost,
122
+ apiKey: savedConfig.apiKey,
123
+ authHeaderName: savedConfig.authHeaderName,
124
+ sharing: savedConfig.sharing,
125
+ currentOrganizationId: savedConfig.currentOrganizationId,
126
+ currentTeamId: savedConfig.currentTeamId,
127
+ teams: savedConfig.teams
128
+ };
129
+ }
130
+ /**
131
+ * Returns the API key from config file or PROMPTFOO_API_KEY environment variable.
132
+ * Config file takes precedence over environment variable.
133
+ */
134
+ resolveApiKey() {
135
+ return this.config.apiKey || process.env.PROMPTFOO_API_KEY;
136
+ }
137
+ /**
138
+ * Returns the API host from config file, PROMPTFOO_CLOUD_API_URL environment variable,
139
+ * or defaults to the standard cloud API host.
140
+ * Config file takes precedence over environment variable.
141
+ *
142
+ * Trailing slashes are stripped so callers that append a path (e.g.
143
+ * `${getApiHost()}/api/v1/...`) never produce a double slash. On-prem hosts
144
+ * entered via `promptfoo auth login --host https://host/` commonly include one.
145
+ */
146
+ resolveApiHost() {
147
+ const host = this.config.apiHost || process.env.PROMPTFOO_CLOUD_API_URL || "https://api.promptfoo.app";
148
+ if (!this.config.apiHost && !process.env.PROMPTFOO_CLOUD_API_URL && process.env.API_HOST && this.resolveApiKey()) warnOnceAboutLegacyApiHost();
149
+ return host.replace(/\/+$/, "");
150
+ }
151
+ /**
152
+ * Returns the header name used to carry the Cloud API credential, from config file,
153
+ * PROMPTFOO_CLOUD_AUTH_HEADER environment variable, or the default `Authorization`.
154
+ * Config file takes precedence over environment variable, matching resolveApiHost().
155
+ *
156
+ * process.env is read directly (not getEnvString) for the same reason as
157
+ * PROMPTFOO_CLOUD_API_URL: an eval config's `env` block must never be able to
158
+ * influence Cloud auth routing.
159
+ */
160
+ resolveAuthHeaderName() {
161
+ return this.config.authHeaderName || process.env.PROMPTFOO_CLOUD_AUTH_HEADER || "Authorization";
162
+ }
163
+ isEnabled() {
164
+ return !!this.resolveApiKey();
165
+ }
166
+ setApiHost(apiHost) {
167
+ this.config.apiHost = apiHost.replace(/\/+$/, "");
168
+ this.saveConfig();
169
+ }
170
+ setApiKey(apiKey) {
171
+ this.config.apiKey = apiKey;
172
+ this.saveConfig();
173
+ }
174
+ getApiKey() {
175
+ return this.resolveApiKey();
176
+ }
177
+ getApiHost() {
178
+ return this.resolveApiHost();
179
+ }
180
+ setAuthHeaderName(authHeaderName) {
181
+ this.config.authHeaderName = authHeaderName;
182
+ this.saveConfig();
183
+ }
184
+ getAuthHeaderName() {
185
+ return this.resolveAuthHeaderName();
186
+ }
187
+ /**
188
+ * Returns the header(s) to attach to a Cloud API request for the current credential,
189
+ * or `undefined` when no API key is resolved. Callers should spread the result
190
+ * conditionally (`...(cloudConfig.getAuthHeaders() ?? {})`) rather than sending a
191
+ * header with a `Bearer undefined` value.
192
+ */
193
+ getAuthHeaders() {
194
+ const token = this.getApiKey();
195
+ if (!token) return;
196
+ return { [this.getAuthHeaderName()]: `Bearer ${token}` };
197
+ }
198
+ setAppUrl(appUrl) {
199
+ this.config.appUrl = appUrl;
200
+ this.saveConfig();
201
+ }
202
+ getAppUrl() {
203
+ return this.config.appUrl;
204
+ }
205
+ getSharing() {
206
+ return this.config.sharing;
207
+ }
208
+ /**
209
+ * Sets the sharing preference. Note: this value is only updated at authentication time
210
+ * (via `validateAndSetApiToken`) and may become stale if the user's license status
211
+ * changes between re-authentications.
212
+ */
213
+ setSharing(sharing) {
214
+ this.config.sharing = sharing;
215
+ this.saveConfig();
216
+ }
217
+ delete() {
218
+ writeGlobalConfigPartial({ cloud: {} });
219
+ this.reload();
220
+ }
221
+ saveConfig() {
222
+ writeGlobalConfigPartial({ cloud: this.config });
223
+ this.reload();
224
+ }
225
+ reload() {
226
+ this.config = this.readConfig();
227
+ }
228
+ saveValidatedApiToken(token, apiHost, user, app, hasActiveLicense, authHeaderName) {
229
+ this.setApiKey(token);
230
+ this.setApiHost(apiHost);
231
+ this.setAppUrl(app.url);
232
+ if (authHeaderName) this.setAuthHeaderName(authHeaderName);
233
+ if (!(isPromptfooCloudHost(apiHost) || isPromptfooCloudHost(app.url))) this.setSharing(true);
234
+ else if (typeof hasActiveLicense === "boolean") {
235
+ const createdAt = user?.createdAt ? new Date(user.createdAt) : null;
236
+ const isGrandfathered = createdAt != null && createdAt < SHARING_CUTOFF_DATE;
237
+ this.setSharing(hasActiveLicense || isGrandfathered);
238
+ }
239
+ }
240
+ async validateApiToken(token, apiHost, authHeaderName) {
241
+ try {
242
+ const { fetchWithProxy } = await Promise.resolve().then(() => fetch_exports);
243
+ const response = await fetchWithProxy(`${apiHost}/api/v1/users/me`, {
244
+ headers: { [authHeaderName || this.getAuthHeaderName()]: `Bearer ${token}` },
245
+ skipCloudAuthInjection: true
246
+ });
247
+ if (!response.ok) {
248
+ const errorMessage = await response.text();
249
+ require_logger.logger.error(`[Cloud] Failed to validate API token: ${errorMessage}. HTTP Status: ${response.status} - ${response.statusText}.`);
250
+ throw new Error("Failed to validate API token: " + response.statusText);
251
+ }
252
+ const { user, organization, app, hasActiveLicense } = await response.json();
253
+ return {
254
+ user,
255
+ organization,
256
+ app,
257
+ ...typeof hasActiveLicense === "boolean" ? { hasActiveLicense } : {}
258
+ };
259
+ } catch (err) {
260
+ const error = err;
261
+ const errorMessage = error instanceof Error ? error.message : String(error);
262
+ require_logger.logger.error(`[Cloud] Failed to validate API token with host ${apiHost}: ${errorMessage}`);
263
+ if (error.cause) require_logger.logger.error(`Cause: ${error.cause}`);
264
+ throw error;
265
+ }
266
+ }
267
+ async validateAndSetApiToken(token, apiHost) {
268
+ const authHeaderName = this.getAuthHeaderName();
269
+ const { user, organization, app, hasActiveLicense } = await this.validateApiToken(token, apiHost, authHeaderName);
270
+ this.saveValidatedApiToken(token, apiHost, user, app, hasActiveLicense, authHeaderName);
271
+ return {
272
+ user,
273
+ organization,
274
+ app,
275
+ hasActiveLicense: typeof hasActiveLicense === "boolean" ? hasActiveLicense : false
276
+ };
277
+ }
278
+ getCurrentOrganizationId() {
279
+ return this.config.currentOrganizationId;
280
+ }
281
+ setCurrentOrganization(organizationId) {
282
+ this.config.currentOrganizationId = organizationId;
283
+ this.saveConfig();
284
+ }
285
+ getCurrentTeamId(organizationId) {
286
+ if (organizationId) return this.config.teams?.[organizationId]?.currentTeamId;
287
+ return this.config.currentTeamId;
288
+ }
289
+ setCurrentTeamId(teamId, organizationId) {
290
+ if (organizationId) {
291
+ if (!this.config.teams) this.config.teams = {};
292
+ if (!this.config.teams[organizationId]) this.config.teams[organizationId] = {};
293
+ this.config.teams[organizationId].currentTeamId = teamId;
294
+ } else this.config.currentTeamId = teamId;
295
+ this.saveConfig();
296
+ }
297
+ clearCurrentTeamId(organizationId) {
298
+ if (organizationId) {
299
+ if (this.config.teams?.[organizationId]) delete this.config.teams[organizationId].currentTeamId;
300
+ } else delete this.config.currentTeamId;
301
+ this.saveConfig();
302
+ }
303
+ cacheTeams(teams, organizationId) {
304
+ if (organizationId) {
305
+ if (!this.config.teams) this.config.teams = {};
306
+ if (!this.config.teams[organizationId]) this.config.teams[organizationId] = {};
307
+ this.config.teams[organizationId].cache = teams.map((t) => ({
308
+ id: t.id,
309
+ name: t.name,
310
+ slug: t.slug,
311
+ lastFetched: (/* @__PURE__ */ new Date()).toISOString()
312
+ }));
313
+ }
314
+ this.saveConfig();
315
+ }
316
+ getCachedTeams(organizationId) {
317
+ if (organizationId) return this.config.teams?.[organizationId]?.cache;
318
+ }
319
+ };
320
+ const cloudConfig = new CloudConfig(false);
321
+ //#endregion
322
+ //#region src/scheduler/headerParser.ts
323
+ const OPENAI_HEADERS = {
324
+ remainingRequests: "x-ratelimit-remaining-requests",
325
+ remainingTokens: "x-ratelimit-remaining-tokens",
326
+ limitRequests: "x-ratelimit-limit-requests",
327
+ limitTokens: "x-ratelimit-limit-tokens",
328
+ resetRequests: "x-ratelimit-reset-requests",
329
+ resetTokens: "x-ratelimit-reset-tokens"
330
+ };
331
+ const ANTHROPIC_HEADERS = {
332
+ remainingRequests: "anthropic-ratelimit-requests-remaining",
333
+ remainingTokens: "anthropic-ratelimit-tokens-remaining",
334
+ limitRequests: "anthropic-ratelimit-requests-limit",
335
+ limitTokens: "anthropic-ratelimit-tokens-limit",
336
+ resetRequests: "anthropic-ratelimit-requests-reset",
337
+ resetTokens: "anthropic-ratelimit-tokens-reset"
338
+ };
339
+ const STANDARD_HEADERS = {
340
+ remaining: "ratelimit-remaining",
341
+ limit: "ratelimit-limit",
342
+ reset: "ratelimit-reset",
343
+ remainingAlt: "x-ratelimit-remaining",
344
+ limitAlt: "x-ratelimit-limit",
345
+ resetAlt: "x-ratelimit-reset"
346
+ };
347
+ /**
348
+ * Parse rate limit headers from response.
349
+ */
350
+ function parseRateLimitHeaders(headers) {
351
+ const result = {};
352
+ const h = lowercaseKeys(headers);
353
+ result.remainingRequests = parseFirstMatch(h, [
354
+ OPENAI_HEADERS.remainingRequests,
355
+ ANTHROPIC_HEADERS.remainingRequests,
356
+ STANDARD_HEADERS.remainingAlt,
357
+ STANDARD_HEADERS.remaining
358
+ ]);
359
+ result.remainingTokens = parseFirstMatch(h, [OPENAI_HEADERS.remainingTokens, ANTHROPIC_HEADERS.remainingTokens]);
360
+ result.limitRequests = parseFirstMatch(h, [
361
+ OPENAI_HEADERS.limitRequests,
362
+ ANTHROPIC_HEADERS.limitRequests,
363
+ STANDARD_HEADERS.limitAlt,
364
+ STANDARD_HEADERS.limit
365
+ ]);
366
+ result.limitTokens = parseFirstMatch(h, [OPENAI_HEADERS.limitTokens, ANTHROPIC_HEADERS.limitTokens]);
367
+ for (const name of [
368
+ OPENAI_HEADERS.resetRequests,
369
+ OPENAI_HEADERS.resetTokens,
370
+ ANTHROPIC_HEADERS.resetRequests,
371
+ ANTHROPIC_HEADERS.resetTokens,
372
+ STANDARD_HEADERS.resetAlt,
373
+ STANDARD_HEADERS.reset
374
+ ]) if (h[name] !== void 0) {
375
+ const parsed = parseResetTime(h[name]);
376
+ if (parsed !== null) {
377
+ result.resetAt = parsed;
378
+ break;
379
+ }
380
+ }
381
+ if (h["retry-after-ms"] !== void 0) {
382
+ const ms = Number.parseInt(h["retry-after-ms"], 10);
383
+ if (Number.isFinite(ms) && ms >= 0) {
384
+ result.retryAfterMs = ms;
385
+ if (result.resetAt === void 0) result.resetAt = Date.now() + ms;
386
+ }
387
+ }
388
+ if (result.retryAfterMs === void 0 && h["retry-after"] !== void 0) {
389
+ const parsed = parseRetryAfter(h["retry-after"]);
390
+ if (parsed !== null) {
391
+ result.retryAfterMs = parsed;
392
+ if (result.resetAt === void 0) result.resetAt = Date.now() + parsed;
393
+ }
394
+ }
395
+ return result;
396
+ }
397
+ /**
398
+ * Parse Retry-After header value.
399
+ * Returns duration in milliseconds.
400
+ * Exported for integration use.
401
+ */
402
+ function parseRetryAfter(value) {
403
+ const seconds = Number.parseInt(value, 10);
404
+ const durationMs = seconds * 1e3;
405
+ if (Number.isFinite(seconds) && seconds >= 0 && String(seconds) === value.trim() && Number.isFinite(durationMs)) return durationMs;
406
+ const httpDate = parseHttpDate(value);
407
+ if (httpDate !== null) return Math.max(0, httpDate - Date.now());
408
+ return null;
409
+ }
410
+ function parseFirstMatch(headers, names) {
411
+ for (const name of names) {
412
+ const value = headers[name];
413
+ if (value !== void 0) {
414
+ const num = Number.parseInt(value, 10);
415
+ if (Number.isFinite(num) && num >= 0) return num;
416
+ }
417
+ }
418
+ }
419
+ /**
420
+ * A bare non-negative decimal number and nothing else: "0", "120", "1.5".
421
+ *
422
+ * `Number.parseFloat` stops at the first character it cannot consume, so
423
+ * without this guard it silently reads the leading digits of a timestamp
424
+ * ("2026-08-07T21:00:00Z" -> 2026) and the magnitude heuristic below then
425
+ * treats them as relative seconds. Same intent as the `String(seconds) ===
426
+ * value.trim()` check in `parseRetryAfter`.
427
+ */
428
+ const BARE_NUMBER_RE = /^\d+(?:\.\d+)?$/;
429
+ /**
430
+ * Parse reset time from various formats.
431
+ * Returns absolute Unix timestamp in milliseconds.
432
+ */
433
+ function parseResetTime(value) {
434
+ const durationMs = parseDuration(value);
435
+ if (durationMs !== null) return Date.now() + durationMs;
436
+ if (BARE_NUMBER_RE.test(value.trim())) {
437
+ const num = Number.parseFloat(value);
438
+ if (Number.isFinite(num) && num >= 0) {
439
+ if (num < 1e9) return Date.now() + num * 1e3;
440
+ else if (num < 1e10) return num * 1e3;
441
+ else return num;
442
+ }
443
+ }
444
+ const httpDate = parseHttpDate(value);
445
+ if (httpDate !== null) return httpDate;
446
+ return null;
447
+ }
448
+ /**
449
+ * Parse HTTP-date format (RFC 7231).
450
+ */
451
+ function parseHttpDate(value) {
452
+ const timestamp = Date.parse(value);
453
+ if (Number.isFinite(timestamp)) {
454
+ const now = Date.now();
455
+ const oneYearMs = 31536e6;
456
+ if (timestamp > now - oneYearMs && timestamp < now + oneYearMs) return timestamp;
457
+ }
458
+ return null;
459
+ }
460
+ /**
461
+ * Parse duration strings like "1s", "100ms", "1m30s", "1h30s", "2h15m30s".
462
+ *
463
+ * Supported formats:
464
+ * - Xms (milliseconds)
465
+ * - Xs or X.Xs (seconds)
466
+ * - Xm or XmYs (minutes with optional seconds)
467
+ * - Xh or XhYm or XhYs or XhYmZs (hours with optional minutes/seconds)
468
+ */
469
+ function parseDuration(value) {
470
+ const match = value.match(/^(?:(\d+)h)?(?:(\d+)m(?!s))?(?:(\d+(?:\.\d+)?)(ms|s))?$/);
471
+ if (!match) return null;
472
+ const [, hours, minutes, secondsValue, secondsUnit] = match;
473
+ if (!hours && !minutes && !secondsValue) return null;
474
+ let ms = 0;
475
+ if (hours) ms += Number.parseInt(hours, 10) * 36e5;
476
+ if (minutes) ms += Number.parseInt(minutes, 10) * 6e4;
477
+ if (secondsValue) {
478
+ const num = Number.parseFloat(secondsValue);
479
+ ms += secondsUnit === "ms" ? num : num * 1e3;
480
+ }
481
+ return Number.isFinite(ms) ? ms : null;
482
+ }
483
+ function lowercaseKeys(obj) {
484
+ const result = {};
485
+ for (const [key, value] of Object.entries(obj)) result[key.toLowerCase()] = value;
486
+ return result;
487
+ }
488
+ //#endregion
489
+ //#region src/util/fetch/cloudAuthRedirects.ts
490
+ var CloudAuthRedirectError = class extends Error {
491
+ constructor() {
492
+ super("Cloud authentication cannot follow a redirect to a different origin. Use the final API URL with promptfoo auth login --host.");
493
+ this.name = "CloudAuthRedirectError";
494
+ }
495
+ };
496
+ function unwrapCloudAuthRedirectError(error) {
497
+ return error instanceof Error && "cause" in error && error.cause instanceof CloudAuthRedirectError ? error.cause : error;
498
+ }
499
+ /** Keep native fetch's redirect handling, but bind this authenticated request to its initial origin. */
500
+ function restrictCloudAuthRedirects(url, dispatcher = (0, undici.getGlobalDispatcher)()) {
501
+ const origin = new URL(url).origin;
502
+ const dispatch = (options, handler) => {
503
+ if (!options.origin || new URL(options.origin.toString()).origin !== origin) throw new CloudAuthRedirectError();
504
+ return dispatcher.dispatch(options, handler);
505
+ };
506
+ return new Proxy({ dispatch }, { get(target, property) {
507
+ return property === "dispatch" ? target.dispatch : Reflect.get(dispatcher, property, dispatcher);
508
+ } });
509
+ }
510
+ //#endregion
511
+ //#region src/util/fetch/decompress.ts
512
+ /** Create the required decoder without exposing undici's internal API notice to CLI users. */
513
+ function createDecompressionInterceptor() {
514
+ const originalEmitWarning = process.emitWarning;
515
+ const wrappedEmitWarning = ((warning, ...args) => {
516
+ if (warning === "DecompressInterceptor is experimental and subject to change" && args[0] === "ExperimentalWarning") return;
517
+ Reflect.apply(originalEmitWarning, process, [warning, ...args]);
518
+ });
519
+ process.emitWarning = wrappedEmitWarning;
520
+ try {
521
+ return undici.interceptors.decompress({
522
+ skipErrorResponses: false,
523
+ maxSize: 67108864
524
+ });
525
+ } finally {
526
+ if (process.emitWarning === wrappedEmitWarning) process.emitWarning = originalEmitWarning;
527
+ }
528
+ }
529
+ function hasContentEncoding(headers) {
530
+ if ("content-encoding" in headers) return true;
531
+ return Object.keys(headers).some((key) => key.toLowerCase() === "content-encoding");
532
+ }
533
+ var StripEncodingHandler = class {
534
+ #handler;
535
+ constructor(handler) {
536
+ this.#handler = handler;
537
+ }
538
+ onRequestStart(controller, context) {
539
+ return this.#handler.onRequestStart?.(controller, context);
540
+ }
541
+ onRequestUpgrade(controller, statusCode, headers, socket) {
542
+ return this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
543
+ }
544
+ onResponseStart(controller, statusCode, headers, statusMessage) {
545
+ const ctrl = controller;
546
+ if (Array.isArray(ctrl.rawHeaders) && !hasContentEncoding(headers)) {
547
+ const filtered = [];
548
+ let rawHadContentEncoding = false;
549
+ const pairCount = ctrl.rawHeaders.length - ctrl.rawHeaders.length % 2;
550
+ for (let i = 0; i < pairCount; i += 2) {
551
+ const name = ctrl.rawHeaders[i].toString().toLowerCase();
552
+ if (name === "content-encoding") rawHadContentEncoding = true;
553
+ else if (name !== "content-length") filtered.push(ctrl.rawHeaders[i], ctrl.rawHeaders[i + 1]);
554
+ }
555
+ if (rawHadContentEncoding) {
556
+ if (ctrl.rawHeaders.length % 2 === 1) filtered.push(ctrl.rawHeaders[ctrl.rawHeaders.length - 1]);
557
+ ctrl.rawHeaders = filtered;
558
+ }
559
+ }
560
+ return this.#handler.onResponseStart?.(controller, statusCode, headers, statusMessage);
561
+ }
562
+ onResponseStarted() {
563
+ return this.#handler.onResponseStarted?.();
564
+ }
565
+ onResponseData(controller, chunk) {
566
+ return this.#handler.onResponseData?.(controller, chunk);
567
+ }
568
+ onResponseEnd(controller, trailers) {
569
+ return this.#handler.onResponseEnd?.(controller, trailers);
570
+ }
571
+ onResponseError(controller, err) {
572
+ return this.#handler.onResponseError?.(controller, err);
573
+ }
574
+ };
575
+ function stripDecompressionHeaders() {
576
+ return (dispatch) => (opts, handler) => dispatch(opts, new StripEncodingHandler(handler));
577
+ }
578
+ //#endregion
579
+ //#region src/util/fetch/errors.ts
580
+ /**
581
+ * Body-level error codes that indicate a hard quota/billing failure rather than
582
+ * a transient per-window rate limit. Retrying these will not succeed and just
583
+ * amplifies load and cost; callers should fail fast.
584
+ *
585
+ * References:
586
+ * - OpenAI: https://platform.openai.com/docs/guides/error-codes/api-errors
587
+ * - Azure OpenAI: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
588
+ * - Anthropic: https://platform.claude.com/docs/en/api/errors
589
+ *
590
+ * Note: Azure OpenAI is known to return `insufficient_quota` for both billing
591
+ * exhaustion AND per-minute deployment quota saturation. The
592
+ * {@link HttpRateLimitError} constructor downgrades such an ambiguous quota
593
+ * code to `rate_limit` when the server also hints at a near-term recovery
594
+ * (`Retry-After` / reset header) — a billing server has no reason to hint at
595
+ * recovery time. The codes in {@link DEFINITIVE_BILLING_ERROR_CODES} name a
596
+ * billing state explicitly and are never downgraded.
597
+ */
598
+ const HARD_QUOTA_ERROR_CODES = /* @__PURE__ */ new Set([
599
+ "insufficient_quota",
600
+ "billing_hard_limit_reached",
601
+ "billing_not_active",
602
+ "access_terminated",
603
+ "quota_exceeded",
604
+ "credit_balance_exhausted"
605
+ ]);
606
+ /**
607
+ * Subset of {@link HARD_QUOTA_ERROR_CODES} that unambiguously describes the
608
+ * account's billing state (no credits, hard limit reached, billing inactive,
609
+ * access terminated). Unlike `insufficient_quota` / `quota_exceeded`, these
610
+ * are not reused for per-window throttling, so a `Retry-After` next to them
611
+ * (some gateways attach one to every 429) must not turn them retryable.
612
+ */
613
+ const DEFINITIVE_BILLING_ERROR_CODES = /* @__PURE__ */ new Set([
614
+ "credit_balance_exhausted",
615
+ "billing_hard_limit_reached",
616
+ "billing_not_active",
617
+ "access_terminated"
618
+ ]);
619
+ /**
620
+ * Body codes that name a per-window throttle outright (OpenAI / Azure OpenAI
621
+ * `rate_limit_exceeded`, Anthropic `rate_limit_error` / `overloaded_error`,
622
+ * per-minute token / request buckets). An AMBIGUOUS hard-quota `type`
623
+ * (`insufficient_quota`, `quota_exceeded`) is only a fallback for an
624
+ * unrecognized `code`; next to one of these it never promotes the error to
625
+ * `quota`, whether or not the server sent a `Retry-After` / reset header. A
626
+ * {@link DEFINITIVE_BILLING_ERROR_CODES} type still does, because it names the
627
+ * account's billing state rather than guessing at it.
628
+ */
629
+ const TRANSIENT_RATE_LIMIT_ERROR_CODES = /* @__PURE__ */ new Set([
630
+ "rate_limit_exceeded",
631
+ "rate_limit_error",
632
+ "rate_limit",
633
+ "rate_limited",
634
+ "overloaded_error",
635
+ "too_many_requests",
636
+ "tokens",
637
+ "requests",
638
+ "tokens_per_min",
639
+ "requests_per_min",
640
+ "tokens_per_day",
641
+ "requests_per_day"
642
+ ]);
643
+ /**
644
+ * Upper bound for the "server hinted a recovery time, so this isn't billing"
645
+ * heuristic. A server that says "retry in &lt;= 1 hour" (via `Retry-After`
646
+ * or a reset timestamp) is signalling a per-window throttle, not a billing
647
+ * exhaustion. Above 1h we treat the hint as ambiguous and let the body code
648
+ * decide.
649
+ */
650
+ const RATE_LIMIT_QUOTA_DOWNGRADE_THRESHOLD_MS = 36e5;
651
+ /**
652
+ * Normalize a caller-supplied millisecond duration / timestamp: a finite,
653
+ * non-negative number passes through; anything else maps to `undefined`.
654
+ */
655
+ function normalizeNonNegativeMs(value) {
656
+ return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
657
+ }
658
+ /**
659
+ * Structured error representing a final HTTP rate limit (status 429 or an
660
+ * equivalent header signal) — i.e. retries are exhausted, or the response
661
+ * code indicates a hard quota that should not be retried.
662
+ *
663
+ * Distinguishes:
664
+ * - `kind: 'quota'` — daily / billing / contractual exhaustion. Don't retry.
665
+ * - `kind: 'rate_limit'` — per-window throttling. Retry honoring `retryAfterMs`.
666
+ *
667
+ * The rendered `message` always contains the kind prefix (`"Rate limit
668
+ * exceeded"` or `"Quota exceeded"`) plus the literal status code. When the
669
+ * status is 429 (the typical construction path) the message also contains
670
+ * `"429"` and the default `"Too Many Requests"` statusText, which is what
671
+ * legacy substring classifiers downstream rely on.
672
+ *
673
+ * The `Http` prefix on the name scopes this to the network transport
674
+ * boundary, distinguishing it from rate-limit-shaped errors in other
675
+ * layers (e.g. an in-process scheduler queue exhausting its budget).
676
+ */
677
+ var HttpRateLimitError = class extends Error {
678
+ status;
679
+ statusText;
680
+ retryAfterMs;
681
+ resetAt;
682
+ code;
683
+ type;
684
+ kind;
685
+ headers;
686
+ body;
687
+ constructor(init) {
688
+ const status = init.status;
689
+ const statusText = init.statusText || "Too Many Requests";
690
+ const retryAfterMs = normalizeNonNegativeMs(init.retryAfterMs);
691
+ const resetAt = normalizeNonNegativeMs(init.resetAt);
692
+ const typeImpliesQuota = isHardQuotaCode(init.type) && (isDefinitiveBillingCode(init.type) || !isTransientRateLimitCode(init.code));
693
+ let kind = isHardQuotaCode(init.code) || typeImpliesQuota ? "quota" : "rate_limit";
694
+ if (kind === "quota" && !isDefinitiveBillingCode(init.code) && !isDefinitiveBillingCode(init.type) && hasNearTermRecoveryHint(retryAfterMs, resetAt)) kind = "rate_limit";
695
+ const prefix = kind === "quota" ? "Quota exceeded" : "Rate limit exceeded";
696
+ const codeSuffix = init.code ? ` (code: ${init.code})` : "";
697
+ super(`${prefix}: HTTP ${status} ${statusText}${codeSuffix}`);
698
+ this.name = "HttpRateLimitError";
699
+ this.status = status;
700
+ this.statusText = statusText;
701
+ this.retryAfterMs = retryAfterMs;
702
+ this.resetAt = resetAt;
703
+ this.code = init.code;
704
+ this.type = init.type;
705
+ this.kind = kind;
706
+ this.headers = init.headers ? { ...init.headers } : void 0;
707
+ this.body = init.body;
708
+ }
709
+ };
710
+ function isHardQuotaCode(code) {
711
+ return code !== void 0 && HARD_QUOTA_ERROR_CODES.has(code);
712
+ }
713
+ function isDefinitiveBillingCode(code) {
714
+ return code !== void 0 && DEFINITIVE_BILLING_ERROR_CODES.has(code);
715
+ }
716
+ function isTransientRateLimitCode(code) {
717
+ return code !== void 0 && TRANSIENT_RATE_LIMIT_ERROR_CODES.has(code);
718
+ }
719
+ /**
720
+ * Whether the server advertised a recovery within
721
+ * {@link RATE_LIMIT_QUOTA_DOWNGRADE_THRESHOLD_MS}: an explicit `Retry-After`,
722
+ * or a reset timestamp whose remaining wait (from now) is within the bound.
723
+ * A reset timestamp in the past counts as "recovers now".
724
+ */
725
+ function hasNearTermRecoveryHint(retryAfterMs, resetAt) {
726
+ if (retryAfterMs !== void 0) return retryAfterMs <= RATE_LIMIT_QUOTA_DOWNGRADE_THRESHOLD_MS;
727
+ if (resetAt !== void 0) return resetAt - Date.now() <= RATE_LIMIT_QUOTA_DOWNGRADE_THRESHOLD_MS;
728
+ return false;
729
+ }
730
+ /**
731
+ * Render the per-window retry-after / reset detail for a structured
732
+ * rate-limit error. Returns empty string when:
733
+ * - No retry metadata is available, OR
734
+ * - The error is a hard quota (`kind === 'quota'`) — retries won't help,
735
+ * so showing a "retry after Xs" hint would contradict the quota message.
736
+ */
737
+ function formatRateLimitDetail(err) {
738
+ if (err.kind === "quota") return "";
739
+ const parts = [];
740
+ if (typeof err.retryAfterMs === "number") parts.push(`retry after ${Math.round(err.retryAfterMs / 1e3)}s`);
741
+ else if (typeof err.resetAt === "number") {
742
+ const remainingMs = Math.max(err.resetAt - Date.now(), 0);
743
+ if (remainingMs > 0) parts.push(`resets in ${Math.round(remainingMs / 1e3)}s`);
744
+ }
745
+ return parts.length > 0 ? ` [${parts.join(", ")}]` : "";
746
+ }
747
+ /**
748
+ * Render the user-facing error string for a structured rate-limit / quota
749
+ * failure. Single-prefix format (no provider-specific wrapper duplication):
750
+ *
751
+ * "Rate limit exceeded: HTTP 429 Too Many Requests (code: rate_limit_exceeded) [retry after 7s]"
752
+ * "Quota exceeded: HTTP 429 Too Many Requests (code: insufficient_quota). Retries will not help — check your billing or daily quota."
753
+ *
754
+ * `details` (optional) is appended verbatim before the kind-specific
755
+ * trailer. Use it to surface upstream-provided context (e.g. an SDK
756
+ * error's full message that names the deployment / token count) that the
757
+ * structured error itself doesn't carry.
758
+ */
759
+ function formatRateLimitErrorMessage(err, details) {
760
+ const codePart = err.code ? ` (code: ${err.code})` : "";
761
+ const trailingDetails = details ? ` ${details}` : "";
762
+ if (err.kind === "quota") return `Quota exceeded: HTTP ${err.status} ${err.statusText}${codePart}${trailingDetails}. Retries will not help — check your billing or daily quota.`;
763
+ const detail = formatRateLimitDetail(err);
764
+ return `Rate limit exceeded: HTTP ${err.status} ${err.statusText}${codePart}${trailingDetails}${detail}`;
765
+ }
766
+ function isHttpRateLimitError(err) {
767
+ return err instanceof HttpRateLimitError;
768
+ }
769
+ /**
770
+ * Best-effort extraction of an error code from a parsed response body across
771
+ * provider variants (OpenAI / Azure / Anthropic / generic JSON-RPC style).
772
+ */
773
+ function extractRateLimitErrorCode(body) {
774
+ if (typeof body !== "object" || body === null) return;
775
+ const root = body;
776
+ if (typeof root.error === "object" && root.error !== null) {
777
+ const err = root.error;
778
+ const metadata = err.metadata;
779
+ const providerCode = typeof metadata === "object" && metadata !== null ? metadata.provider_code : void 0;
780
+ if (typeof providerCode === "string" && isDefinitiveBillingCode(providerCode.toLowerCase())) return providerCode.toLowerCase();
781
+ if (typeof err.code === "string" && err.code.length > 0) return err.code;
782
+ }
783
+ if (typeof root.code === "string" && root.code.length > 0) return root.code;
784
+ return extractRateLimitErrorType(body);
785
+ }
786
+ /**
787
+ * Best-effort extraction of the broad error class (`error.type` / top-level
788
+ * `type`) from a parsed response body. OpenAI pairs `type: "insufficient_quota"`
789
+ * with billing-specific codes such as `credit_balance_exhausted`, so the type
790
+ * still carries the quota classification when the code is not recognized.
791
+ * Returns `undefined` when the body has no separate `type` field.
792
+ */
793
+ function extractRateLimitErrorType(body) {
794
+ if (typeof body !== "object" || body === null) return;
795
+ const root = body;
796
+ const nested = typeof root.error === "object" && root.error !== null ? root.error.type : void 0;
797
+ if (typeof nested === "string" && nested.length > 0) return nested;
798
+ return typeof root.type === "string" && root.type.length > 0 ? root.type : void 0;
799
+ }
800
+ /**
801
+ * Non-transient HTTP status codes that indicate the target is unavailable or misconfigured.
802
+ * These errors will not resolve on retry and should abort the scan immediately.
803
+ *
804
+ * - 401: Unauthorized - authentication required or invalid credentials
805
+ * - 403: Forbidden - valid credentials but access denied
806
+ * - 404: Not Found - target endpoint doesn't exist
807
+ * - 501: Not Implemented - server doesn't support the request method
808
+ *
809
+ * Excluded: 500 (often transient — server crashes, DB timeouts, deployment rollouts,
810
+ * or input-dependent bugs where one prompt triggers it but the next doesn't),
811
+ * 502/503/504 (typically transient gateway issues).
812
+ */
813
+ const NON_TRANSIENT_HTTP_STATUSES = [
814
+ 401,
815
+ 403,
816
+ 404,
817
+ 501
818
+ ];
819
+ function isNonTransientHttpStatus(status) {
820
+ return NON_TRANSIENT_HTTP_STATUSES.includes(status);
821
+ }
822
+ function isTransientConnectionError(error) {
823
+ if (!error) return false;
824
+ const code = error.code;
825
+ if (code === "ECONNRESET" || code === "EPIPE") return true;
826
+ const message = (error.message ?? "").toLowerCase();
827
+ if (message.includes("eproto") && (message.includes("wrong version number") || message.includes("self signed") || message.includes("unable to verify") || message.includes("unknown ca") || message.includes("cert"))) return false;
828
+ return message.includes("bad record mac") || message.includes("eproto") || message.includes("econnreset") || message.includes("socket hang up");
829
+ }
830
+ /**
831
+ * True when an error represents an aborted/cancelled operation (an AbortController
832
+ * signal firing). Callers use this to suppress expected cancellation rather than
833
+ * treating it as a real failure, so the abort's `.name` must be preserved upstream.
834
+ */
835
+ function isAbortError(error) {
836
+ return error instanceof Error && (error.name === "AbortError" || error.name === "AbortException");
837
+ }
838
+ function getAbortError(signal) {
839
+ const reason = signal.reason;
840
+ if (reason instanceof Error && reason.name === "AbortError") return reason;
841
+ const error = new Error(reason instanceof Error ? reason.message : "Request was aborted");
842
+ error.name = "AbortError";
843
+ return error;
844
+ }
845
+ //#endregion
846
+ //#region src/util/fetch/monkeyPatchFetch.ts
847
+ const gzipAsync = (0, util.promisify)(zlib.gzip);
848
+ const PROMPTFOO_TEAM_ID_HEADER = "x-promptfoo-team-id";
849
+ function isConnectionError(error) {
850
+ return error instanceof TypeError && error.message === "fetch failed" && error.cause?.stack?.includes("internalConnectMultiple");
851
+ }
852
+ /** Extracts the request URL as a string. A `Request`'s `toString()` is "[object Request]", so read `.url`. */
853
+ function getRequestUrlString(url) {
854
+ return url instanceof Request ? url.url : url.toString();
855
+ }
856
+ function matchesNoLogUrl(url, noLogUrl) {
857
+ try {
858
+ const target = new URL(url);
859
+ const excluded = new URL(noLogUrl);
860
+ if (target.origin !== excluded.origin) return false;
861
+ const excludedPath = excluded.pathname.replace(/\/+$/, "");
862
+ return excludedPath === "" || target.pathname === excludedPath || target.pathname.startsWith(`${excludedPath}/`);
863
+ } catch {
864
+ return false;
865
+ }
866
+ }
867
+ function getSafeUrlForConnectionLog(url) {
868
+ return require_logger.sanitizeUrl(getRequestUrlString(url));
869
+ }
870
+ function getSafeProxyForConnectionLog() {
871
+ const proxyUrl = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
872
+ return proxyUrl ? `or Proxy: ${require_logger.sanitizeUrl(proxyUrl)}` : "";
873
+ }
874
+ /**
875
+ * Returns true when `url` targets the configured Promptfoo Cloud origin: the public
876
+ * cloud host by default, or the on-prem host when one is configured via
877
+ * `cloudConfig.getApiHost()`. Matching is scheme+host+port exact (`URL.origin`), so
878
+ * look-alike hosts, HTTP downgrades, and different ports never match. Matching is
879
+ * origin-wide — every path on the configured cloud origin is treated as cloud, so the
880
+ * saved token may also reach sibling services hosted on that same origin. Fails closed
881
+ * (returns false) when either URL is unparseable, so a misconfigured host never leaks
882
+ * the token.
883
+ */
884
+ function isPromptfooCloudApiHost(url) {
885
+ try {
886
+ const targetUrl = url instanceof Request ? url.url : url.toString();
887
+ return new URL(targetUrl).origin === new URL(cloudConfig.getApiHost()).origin;
888
+ } catch {
889
+ return false;
890
+ }
891
+ }
892
+ /**
893
+ * Resolves the header name used to carry the Cloud API credential (defaults to
894
+ * `Authorization`, but may be configured to a different name via
895
+ * `promptfoo auth login --auth-header-name` or `PROMPTFOO_CLOUD_AUTH_HEADER`).
896
+ */
897
+ function getCloudAuthHeaderName() {
898
+ return cloudConfig.getAuthHeaderName();
899
+ }
900
+ /**
901
+ * Resolves the auth header value for a request to the configured Promptfoo
902
+ * Cloud origin, or `undefined` when the request is not cloud-bound or no API key is
903
+ * saved. Centralizing this keeps the live request (`monkeyPatchFetch`) and the cache
904
+ * key (`getHeadersForCacheKey` in cache.ts) in lockstep.
905
+ */
906
+ function getCloudBearerToken(url) {
907
+ if (!isPromptfooCloudApiHost(url)) return;
908
+ const token = cloudConfig.getApiKey();
909
+ return token ? `Bearer ${token}` : void 0;
910
+ }
911
+ function isPromptfooCloudTaskUrl(url) {
912
+ if (!isPromptfooCloudApiHost(url)) return false;
913
+ try {
914
+ const pathname = new URL(getRequestUrlString(url)).pathname.replace(/\/+$/, "");
915
+ return pathname.endsWith("/api/v1/task") || pathname.endsWith("/api/v1/task/harmful");
916
+ } catch {
917
+ return false;
918
+ }
919
+ }
920
+ /** Returns the persisted CLI team for authenticated Cloud task requests. */
921
+ function getCloudTaskTeamId(url) {
922
+ if (!isPromptfooCloudTaskUrl(url)) return;
923
+ if (!getCloudBearerToken(url)) return;
924
+ const organizationId = cloudConfig.getCurrentOrganizationId();
925
+ return cloudConfig.getCurrentTeamId(organizationId);
926
+ }
927
+ /**
928
+ * Resolves the caller-supplied headers for a request: the explicit `options.headers` when
929
+ * present, otherwise the headers carried by a `Request` URL.
930
+ *
931
+ * `monkeyPatchFetch`'s only in-repo caller (`fetchWithProxy`) always normalizes headers to
932
+ * a plain object, but the function is exported and typed to accept any `HeadersInit` /
933
+ * `Request`, so the helpers here preserve every shape rather than assuming a `Record`.
934
+ */
935
+ function getEffectiveHeaders(url, headers) {
936
+ return headers ?? (url instanceof Request ? url.headers : void 0);
937
+ }
938
+ function hasHeader(headers, name) {
939
+ return new Headers(headers).has(name);
940
+ }
941
+ /**
942
+ * Returns `headers` with `name: value` set. Plain objects retain their shape, while a
943
+ * `Headers` instance or `[name, value][]` array is normalized through `Headers` so existing
944
+ * entries are never dropped (a naive object spread would discard them).
945
+ */
946
+ function setHeader(headers, name, value) {
947
+ if (headers instanceof Headers || Array.isArray(headers)) {
948
+ const merged = new Headers(headers);
949
+ merged.set(name, value);
950
+ return merged;
951
+ }
952
+ return {
953
+ ...headers ?? {},
954
+ [name]: value
955
+ };
956
+ }
957
+ function usesCustomCloudAuth(url, headers, explicitCloudAuth = false) {
958
+ const effectiveHeaders = new Headers(headers);
959
+ if (explicitCloudAuth) return Array.from(effectiveHeaders).some(([name, value]) => name !== "authorization" && /^Bearer\s/i.test(value));
960
+ const headerName = getCloudAuthHeaderName().toLowerCase();
961
+ if (headerName === "authorization") return false;
962
+ for (const [name, value] of effectiveHeaders) if (name === headerName) return /^Bearer\s/i.test(value) && (isPromptfooCloudApiHost(url) || value.replace(/^Bearer\s+/i, "") === cloudConfig.getApiKey());
963
+ return Boolean(getCloudBearerToken(url));
964
+ }
965
+ /** Capture the Cloud redirect policy before any asynchronous work or retry. */
966
+ function preserveCloudAuthRedirects(url, options = {}) {
967
+ if (options.restrictCloudAuthRedirects || !usesCustomCloudAuth(url, getEffectiveHeaders(url, options.headers), options.skipCloudAuthInjection)) return options;
968
+ return {
969
+ ...options,
970
+ restrictCloudAuthRedirects: true
971
+ };
972
+ }
973
+ /**
974
+ * Enhanced fetch wrapper that adds logging, authentication, error handling, and optional compression
975
+ */
976
+ async function monkeyPatchFetch(url, options) {
977
+ const NO_LOG_URLS = [
978
+ R_ENDPOINT,
979
+ CONSENT_ENDPOINT,
980
+ EVENTS_ENDPOINT
981
+ ];
982
+ const urlString = getRequestUrlString(url);
983
+ const callerHeaders = getEffectiveHeaders(url, options?.headers);
984
+ const isSilent = new Headers(callerHeaders).get("x-promptfoo-silent") === "true";
985
+ const logEnabled = !NO_LOG_URLS.some((logUrl) => matchesNoLogUrl(urlString, logUrl)) && !isSilent;
986
+ const { restrictCloudAuthRedirects: restrictRedirects, ...opts } = preserveCloudAuthRedirects(url, options);
987
+ const originalBody = opts.body;
988
+ if (options?.compress && opts.body && typeof opts.body === "string") try {
989
+ opts.body = await gzipAsync(opts.body);
990
+ opts.headers = setHeader(getEffectiveHeaders(url, opts.headers), "Content-Encoding", "gzip");
991
+ } catch (e) {
992
+ require_logger.logger.warn(`Failed to compress request body: ${e}`);
993
+ }
994
+ if (!options?.skipCloudAuthInjection) {
995
+ const cloudAuth = getCloudBearerToken(url);
996
+ if (cloudAuth) {
997
+ const cloudAuthHeaderName = getCloudAuthHeaderName();
998
+ const effectiveHeaders = getEffectiveHeaders(url, opts.headers);
999
+ if (!hasHeader(effectiveHeaders, cloudAuthHeaderName)) opts.headers = setHeader(effectiveHeaders, cloudAuthHeaderName, cloudAuth);
1000
+ }
1001
+ const cloudTaskTeamId = getCloudTaskTeamId(url);
1002
+ const headersWithAuth = getEffectiveHeaders(url, opts.headers);
1003
+ if (cloudTaskTeamId && !hasHeader(headersWithAuth, "x-promptfoo-team-id")) opts.headers = setHeader(headersWithAuth, PROMPTFOO_TEAM_ID_HEADER, cloudTaskTeamId);
1004
+ }
1005
+ if (restrictRedirects || usesCustomCloudAuth(url, getEffectiveHeaders(url, opts.headers), options?.skipCloudAuthInjection)) opts.dispatcher = restrictCloudAuthRedirects(urlString, opts.dispatcher);
1006
+ try {
1007
+ const response = await fetch(url, opts);
1008
+ if (logEnabled) require_logger.logRequestResponse({
1009
+ url: urlString,
1010
+ requestBody: originalBody,
1011
+ requestMethod: opts.method || "GET",
1012
+ response
1013
+ });
1014
+ return response;
1015
+ } catch (e) {
1016
+ if (logEnabled) {
1017
+ require_logger.logRequestResponse({
1018
+ url: urlString,
1019
+ requestBody: opts.body,
1020
+ requestMethod: opts.method || "GET",
1021
+ response: null
1022
+ });
1023
+ if (isConnectionError(e)) {
1024
+ require_logger.logger.debug(`Connection error, please check your network connectivity to the host: ${getSafeUrlForConnectionLog(url)} ${getSafeProxyForConnectionLog()}`);
1025
+ throw e;
1026
+ }
1027
+ const safeUrl = require_logger.sanitizeUrlForLogging(urlString);
1028
+ const safeError = `${JSON.stringify(e, Object.getOwnPropertyNames(e), 2)} ${e instanceof Error ? e.stack : ""}`.split(urlString).join(safeUrl);
1029
+ require_logger.logger.debug(`Error in fetch: ${safeError}`);
1030
+ }
1031
+ throw unwrapCloudAuthRedirectError(e);
1032
+ }
1033
+ }
1034
+ //#endregion
1035
+ //#region src/util/fetch/retryContext.ts
1036
+ const fetchRetryContext = new node_async_hooks.AsyncLocalStorage();
1037
+ /**
1038
+ * Run `fn` with a fetch retry context so nested `fetchWithRetries` /
1039
+ * `fetchWithProxy` calls inherit the provider's configured `maxRetries`.
1040
+ *
1041
+ * When `maxRetries` is `undefined`, the new scope deliberately shadows any
1042
+ * outer provider context so providers without an override fall back to defaults.
1043
+ */
1044
+ function withFetchRetryContext(maxRetries, fn) {
1045
+ return fetchRetryContext.run({ maxRetries }, fn);
1046
+ }
1047
+ /**
1048
+ * Read the active context's `maxRetries`, or `undefined` when none is set.
1049
+ */
1050
+ function getFetchRetryContextMaxRetries() {
1051
+ return fetchRetryContext.getStore()?.maxRetries;
1052
+ }
1053
+ //#endregion
1054
+ //#region src/util/fetch/index.ts
1055
+ var fetch_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
1056
+ computeRateLimitWaitMs: () => computeRateLimitWaitMs,
1057
+ fetchWithProxy: () => fetchWithProxy,
1058
+ fetchWithRetries: () => fetchWithRetries,
1059
+ fetchWithTimeout: () => fetchWithTimeout,
1060
+ getFetchWithProxyHeaders: () => getFetchWithProxyHeaders,
1061
+ handleRateLimit: () => handleRateLimit,
1062
+ isRateLimited: () => isRateLimited,
1063
+ isTransientError: () => isTransientError,
1064
+ rateLimitTimingFromHeaders: () => rateLimitTimingFromHeaders,
1065
+ readBoundedText: () => readBoundedText
1066
+ });
1067
+ var RequestAuthenticationError = class extends Error {};
1068
+ async function resolveAuthenticationHeaders(getAuthHeaders, explicitHeaders, signal) {
1069
+ signal?.throwIfAborted();
1070
+ let headers;
1071
+ try {
1072
+ headers = new Headers(await getAuthHeaders(signal ?? void 0));
1073
+ } catch (error) {
1074
+ signal?.throwIfAborted();
1075
+ throw Object.assign(new RequestAuthenticationError(error instanceof Error ? error.message : "Request authentication failed"), { cause: error });
1076
+ }
1077
+ signal?.throwIfAborted();
1078
+ new Headers(explicitHeaders).forEach((value, name) => headers.set(name, value));
1079
+ return Object.fromEntries(headers);
1080
+ }
1081
+ const cachedAgents = /* @__PURE__ */ new Map();
1082
+ const cachedProxyAgents = /* @__PURE__ */ new Map();
1083
+ /**
1084
+ * Get the connection pool size for HTTP agents.
1085
+ * Priority: PROMPTFOO_FETCH_CONNECTIONS env var > CLI -j flag > DEFAULT_MAX_CONCURRENCY (4).
1086
+ * Set PROMPTFOO_FETCH_CONNECTIONS to override independently of eval concurrency
1087
+ * (e.g., server deployments that need more connections than the default 4).
1088
+ */
1089
+ function getConnectionPoolSize() {
1090
+ const envConnections = require_logger.getEnvString("PROMPTFOO_FETCH_CONNECTIONS");
1091
+ if (envConnections != null) {
1092
+ const normalized = envConnections.trim();
1093
+ const parsed = Number(normalized);
1094
+ if (/^\d+$/.test(normalized) && Number.isSafeInteger(parsed) && parsed > 0) return parsed;
1095
+ }
1096
+ return require_logger.state.maxConcurrency || 4;
1097
+ }
1098
+ function getOrCreateAgent(tlsOptions) {
1099
+ const concurrency = getConnectionPoolSize();
1100
+ const existing = cachedAgents.get(concurrency);
1101
+ if (existing) return existing;
1102
+ const agent = new undici.Agent({
1103
+ headersTimeout: require_shared.getRequestTimeoutMs(),
1104
+ keepAliveTimeout: 3e4,
1105
+ keepAliveMaxTimeout: 6e4,
1106
+ connections: concurrency,
1107
+ connect: tlsOptions
1108
+ }).compose(createDecompressionInterceptor()).compose(stripDecompressionHeaders());
1109
+ cachedAgents.set(concurrency, agent);
1110
+ return agent;
1111
+ }
1112
+ function getProxyAgentCacheKey(proxyUrl, concurrency) {
1113
+ return `${proxyUrl}::${concurrency}`;
1114
+ }
1115
+ function getOrCreateProxyAgent(proxyUrl, tlsOptions) {
1116
+ const concurrency = getConnectionPoolSize();
1117
+ const cacheKey = getProxyAgentCacheKey(proxyUrl, concurrency);
1118
+ const existing = cachedProxyAgents.get(cacheKey);
1119
+ if (existing) return existing;
1120
+ const agent = new undici.ProxyAgent({
1121
+ uri: proxyUrl,
1122
+ proxyTls: tlsOptions,
1123
+ requestTls: tlsOptions,
1124
+ headersTimeout: require_shared.getRequestTimeoutMs(),
1125
+ keepAliveTimeout: 3e4,
1126
+ keepAliveMaxTimeout: 6e4,
1127
+ connections: concurrency
1128
+ }).compose(createDecompressionInterceptor()).compose(stripDecompressionHeaders());
1129
+ cachedProxyAgents.set(cacheKey, agent);
1130
+ return agent;
1131
+ }
1132
+ /**
1133
+ * Resolve whether to disable transient-error retries. An explicit caller flag
1134
+ * always wins (a caller may opt back in even when the provider set
1135
+ * `maxRetries: 0`); otherwise we disable only when the retry context carries
1136
+ * `maxRetries === 0`.
1137
+ */
1138
+ function resolveTransientRetryDisabled(explicit) {
1139
+ if (explicit !== void 0) return explicit;
1140
+ return getFetchRetryContextMaxRetries() === 0;
1141
+ }
1142
+ function headersInitToRecord(headers) {
1143
+ if (!headers) return {};
1144
+ if (headers instanceof Headers) return Object.fromEntries(headers.entries());
1145
+ if (Array.isArray(headers)) return Object.fromEntries(new Headers(headers).entries());
1146
+ return { ...headers };
1147
+ }
1148
+ function getFetchWithProxyHeaders(url, options) {
1149
+ const requestHeaders = url instanceof Request && options.headers === void 0 ? headersInitToRecord(url.headers) : {};
1150
+ const optionHeaders = headersInitToRecord(options.headers);
1151
+ return {
1152
+ ...requestHeaders,
1153
+ ...optionHeaders,
1154
+ "x-promptfoo-version": VERSION
1155
+ };
1156
+ }
1157
+ function getFetchUrlString(url) {
1158
+ if (typeof url === "string") return url;
1159
+ if (url instanceof URL) return url.toString();
1160
+ if (url instanceof Request) return url.url;
1161
+ }
1162
+ async function fetchWithProxy(url, options = {}, abortSignal) {
1163
+ options = preserveCloudAuthRedirects(url, options);
1164
+ let finalUrl = url;
1165
+ let finalUrlString = getFetchUrlString(url);
1166
+ if (!finalUrlString) throw new Error("Invalid URL");
1167
+ const combinedSignal = abortSignal ? options.signal ? AbortSignal.any([options.signal, abortSignal]) : abortSignal : options.signal;
1168
+ const { getAuthHeaders, ...requestOptions } = options;
1169
+ const finalOptions = {
1170
+ ...requestOptions,
1171
+ headers: getFetchWithProxyHeaders(url, options),
1172
+ signal: combinedSignal
1173
+ };
1174
+ const logEnabled = new Headers(finalOptions.headers).get("x-promptfoo-silent") !== "true";
1175
+ if (typeof url === "string") try {
1176
+ const parsedUrl = new URL(url);
1177
+ if (parsedUrl.username || parsedUrl.password) {
1178
+ const headers = finalOptions.headers ?? {};
1179
+ if (Object.keys(headers).some((name) => name.toLowerCase() === "authorization")) {
1180
+ if (logEnabled) require_logger.logger.warn("Both URL credentials and Authorization header present - URL credentials will be ignored");
1181
+ } else {
1182
+ const credentials = [parsedUrl.username, parsedUrl.password].map((part) => {
1183
+ try {
1184
+ return decodeURIComponent(part);
1185
+ } catch {
1186
+ return part;
1187
+ }
1188
+ }).join(":");
1189
+ finalOptions.headers = {
1190
+ ...headers,
1191
+ Authorization: `Basic ${Buffer.from(credentials).toString("base64")}`
1192
+ };
1193
+ }
1194
+ parsedUrl.username = "";
1195
+ parsedUrl.password = "";
1196
+ finalUrl = parsedUrl.toString();
1197
+ finalUrlString = finalUrl;
1198
+ }
1199
+ } catch (e) {
1200
+ if (logEnabled) require_logger.logger.debug(`URL parsing failed in fetchWithProxy: ${e}`);
1201
+ }
1202
+ const tlsOptions = { rejectUnauthorized: !require_logger.getEnvBool("PROMPTFOO_INSECURE_SSL", true) };
1203
+ const caCertPath = require_logger.getEnvString("PROMPTFOO_CA_CERT_PATH");
1204
+ if (caCertPath) try {
1205
+ const resolvedPath = path.default.resolve(require_logger.state.basePath || "", caCertPath);
1206
+ tlsOptions.ca = await node_fs_promises.readFile(resolvedPath, "utf8");
1207
+ if (logEnabled) require_logger.logger.debug(`Using custom CA certificate from ${resolvedPath}`);
1208
+ } catch (e) {
1209
+ if (logEnabled) require_logger.logger.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
1210
+ }
1211
+ const proxyUrl = finalUrlString ? (0, proxy_from_env.getProxyForUrl)(finalUrlString) : "";
1212
+ if (!finalOptions.dispatcher) {
1213
+ if (proxyUrl) {
1214
+ if (logEnabled) require_logger.logger.debug(`Using proxy: ${require_logger.sanitizeUrl(proxyUrl)}`);
1215
+ finalOptions.dispatcher = getOrCreateProxyAgent(proxyUrl, tlsOptions);
1216
+ } else finalOptions.dispatcher = getOrCreateAgent(tlsOptions);
1217
+ }
1218
+ const disableTransientRetries = resolveTransientRetryDisabled(options.disableTransientRetries);
1219
+ const maxTransientRetries = disableTransientRetries ? 0 : 3;
1220
+ for (let attempt = 0; attempt <= maxTransientRetries; attempt++) {
1221
+ let attemptOptions = finalOptions;
1222
+ if (getAuthHeaders) attemptOptions = {
1223
+ ...finalOptions,
1224
+ headers: await resolveAuthenticationHeaders(getAuthHeaders, finalOptions.headers, combinedSignal)
1225
+ };
1226
+ const response = await monkeyPatchFetch(finalUrl, attemptOptions);
1227
+ if (!disableTransientRetries && isTransientError(response) && attempt < maxTransientRetries) {
1228
+ const backoffMs = Math.pow(2, attempt) * 1e3;
1229
+ if (logEnabled) require_logger.logger.debug(`Transient error (${response.status} ${response.statusText}), retry ${attempt + 1}/${maxTransientRetries} after ${backoffMs}ms`);
1230
+ await require_time.sleep(backoffMs);
1231
+ continue;
1232
+ }
1233
+ return response;
1234
+ }
1235
+ throw new Error("Unexpected end of transient retry loop");
1236
+ }
1237
+ function fetchWithTimeout(url, options = {}, timeout) {
1238
+ return new Promise((resolve, reject) => {
1239
+ const timeoutController = new AbortController();
1240
+ const signal = options.signal ? AbortSignal.any([options.signal, timeoutController.signal]) : timeoutController.signal;
1241
+ const timeoutId = setTimeout(() => {
1242
+ timeoutController.abort();
1243
+ reject(/* @__PURE__ */ new Error(`Request timed out after ${timeout} ms`));
1244
+ }, timeout);
1245
+ fetchWithProxy(url, {
1246
+ ...options,
1247
+ signal
1248
+ }).then((response) => {
1249
+ clearTimeout(timeoutId);
1250
+ resolve(response);
1251
+ }).catch((error) => {
1252
+ clearTimeout(timeoutId);
1253
+ reject(error);
1254
+ });
1255
+ });
1256
+ }
1257
+ /**
1258
+ * Check if a response indicates rate limiting
1259
+ */
1260
+ function isRateLimited(response) {
1261
+ require_invariant.invariant(response.headers, "Response headers are missing");
1262
+ require_invariant.invariant(response.status, "Response status is missing");
1263
+ return response.headers.get("X-RateLimit-Remaining") === "0" || response.status === 429 || response.headers.get("x-ratelimit-remaining-requests") === "0" || response.headers.get("x-ratelimit-remaining-tokens") === "0";
1264
+ }
1265
+ /**
1266
+ * Compute how long to wait after a rate-limited response.
1267
+ * Reads `retry-after-ms`, `Retry-After`, `X-RateLimit-Reset`, and OpenAI-style reset headers.
1268
+ * Default: 60s.
1269
+ */
1270
+ function computeRateLimitWaitMs(response) {
1271
+ const parsedHeaders = parseRateLimitHeaders(Object.fromEntries(response.headers.entries()));
1272
+ const rateLimitReset = response.headers.get("X-RateLimit-Reset");
1273
+ if (response.headers.get("x-ratelimit-reset-requests") || response.headers.get("x-ratelimit-reset-tokens")) {
1274
+ if (parsedHeaders.resetAt !== void 0) return Math.max(parsedHeaders.resetAt - Date.now(), 0);
1275
+ }
1276
+ if (rateLimitReset) {
1277
+ const resetAt = Number.parseInt(rateLimitReset, 10) * 1e3;
1278
+ if (Number.isFinite(resetAt) && resetAt >= 0) return Math.max(resetAt - Date.now() + 1e3, 0);
1279
+ }
1280
+ return parsedHeaders.retryAfterMs ?? 6e4;
1281
+ }
1282
+ /**
1283
+ * Maximum jitter (in ms) added to rate-limit waits. Spreads concurrent
1284
+ * waiters so they don't all retry in the same instant after Retry-After.
1285
+ */
1286
+ const RATE_LIMIT_JITTER_MS = 1e3;
1287
+ async function sleepWithAbort(waitTime, signal) {
1288
+ if (!signal) {
1289
+ await require_time.sleep(waitTime);
1290
+ return;
1291
+ }
1292
+ if (signal.aborted) throw getAbortError(signal);
1293
+ await new Promise((resolve, reject) => {
1294
+ const timeout = setTimeout(() => {
1295
+ signal.removeEventListener("abort", onAbort);
1296
+ resolve();
1297
+ }, waitTime);
1298
+ const onAbort = () => {
1299
+ clearTimeout(timeout);
1300
+ signal.removeEventListener("abort", onAbort);
1301
+ reject(getAbortError(signal));
1302
+ };
1303
+ signal.addEventListener("abort", onAbort, { once: true });
1304
+ });
1305
+ }
1306
+ /**
1307
+ * Handle rate limiting by waiting the appropriate amount of time, plus a
1308
+ * uniform random jitter to avoid synchronized retry storms when many
1309
+ * concurrent requests hit the same rate limit.
1310
+ */
1311
+ async function handleRateLimit(response, signal, onRateLimitBackoff) {
1312
+ const waitTime = computeRateLimitWaitMs(response);
1313
+ if (!signal?.aborted) onRateLimitBackoff?.(Object.freeze({
1314
+ headers: Object.freeze(Object.fromEntries(response.headers.entries())),
1315
+ status: response.status,
1316
+ resetAt: Date.now() + waitTime
1317
+ }));
1318
+ const jitter = Math.floor(Math.random() * RATE_LIMIT_JITTER_MS);
1319
+ const totalWait = waitTime + jitter;
1320
+ require_logger.logger.debug(`Rate limited, waiting ${totalWait}ms (base ${waitTime}ms + ${jitter}ms jitter) before retry`);
1321
+ await sleepWithAbort(totalWait, signal);
1322
+ }
1323
+ /**
1324
+ * Hard cap on bytes read from a 429 response body during classification.
1325
+ * A hostile or buggy upstream could otherwise stream a multi-MB body on
1326
+ * every 429, amplifying memory pressure under concurrent eval load. 64 KB
1327
+ * is well above any well-formed provider error envelope (typical OpenAI
1328
+ * / Anthropic JSON errors are <1 KB).
1329
+ */
1330
+ const RATE_LIMIT_BODY_PEEK_BYTES = 65536;
1331
+ /**
1332
+ * Read the body of a rate-limited response without consuming the original
1333
+ * stream. Returns the parsed body (JSON if parseable, else raw text) and
1334
+ * any extracted error code (e.g. `insufficient_quota`).
1335
+ *
1336
+ * Why clone: `Response.text()` consumes the underlying stream. The original
1337
+ * response may still be observed by upstream wrappers (logging middleware,
1338
+ * monkey-patched fetch); cloning preserves their ability to read the body.
1339
+ *
1340
+ * Clone/read failures degrade to `{ body: undefined, code: undefined }`
1341
+ * unless the caller cancelled the unfinished peek. Losing the body code only
1342
+ * widens classification from `quota` to `rate_limit`, which is the safer
1343
+ * (retryable) side of the misclassification.
1344
+ */
1345
+ async function peekRateLimitBody(response, logEnabled, signal) {
1346
+ let cloned;
1347
+ try {
1348
+ cloned = response.clone();
1349
+ } catch (err) {
1350
+ if (signal?.aborted) throw getAbortError(signal);
1351
+ if (logEnabled) require_logger.logger.debug(`[fetch] peekRateLimitBody: clone failed, skipping body code lookup: ${err}`);
1352
+ return {
1353
+ body: void 0,
1354
+ code: void 0,
1355
+ type: void 0
1356
+ };
1357
+ }
1358
+ let text;
1359
+ try {
1360
+ text = await readBoundedText(cloned, RATE_LIMIT_BODY_PEEK_BYTES, { requireStream: true });
1361
+ } catch (err) {
1362
+ if (signal?.aborted) throw getAbortError(signal);
1363
+ if (logEnabled) require_logger.logger.debug(`[fetch] peekRateLimitBody: body read failed: ${err}`);
1364
+ return {
1365
+ body: void 0,
1366
+ code: void 0,
1367
+ type: void 0
1368
+ };
1369
+ }
1370
+ if (!text) return {
1371
+ body: void 0,
1372
+ code: void 0,
1373
+ type: void 0
1374
+ };
1375
+ try {
1376
+ const json = JSON.parse(text);
1377
+ return {
1378
+ body: json,
1379
+ code: extractRateLimitErrorCode(json),
1380
+ type: extractRateLimitErrorType(json)
1381
+ };
1382
+ } catch {
1383
+ if (logEnabled) require_logger.logger.debug("[fetch] peekRateLimitBody: response body was not JSON");
1384
+ return {
1385
+ body: text,
1386
+ code: void 0,
1387
+ type: void 0
1388
+ };
1389
+ }
1390
+ }
1391
+ /**
1392
+ * Drain a Response's body into a string, but stop reading once `maxBytes`
1393
+ * have been collected. Each streamed chunk is bounded to the remaining
1394
+ * budget *before* it enters the in-memory buffer, so a single oversized
1395
+ * chunk cannot exceed `maxBytes` of retained memory. `requireStream` skips
1396
+ * streamless polyfills to guarantee bounded buffering for rate-limit peeking.
1397
+ * Other callers retain the legacy text fallback, which buffers before truncation.
1398
+ */
1399
+ async function readBoundedText(response, maxBytes, options = {}) {
1400
+ if (!response.body) {
1401
+ const contentLength = Number.parseInt(response.headers?.get?.("content-length") ?? "", 10);
1402
+ if (options.requireStream || Number.isFinite(contentLength) && contentLength > maxBytes) return "";
1403
+ const text = await response.text();
1404
+ return text.length > maxBytes ? text.slice(0, maxBytes) : text;
1405
+ }
1406
+ const reader = response.body.getReader();
1407
+ const chunks = [];
1408
+ let total = 0;
1409
+ try {
1410
+ while (total < maxBytes) {
1411
+ const { done, value } = await reader.read();
1412
+ if (done) break;
1413
+ const room = maxBytes - total;
1414
+ const bounded = value.byteLength <= room ? value : value.slice(0, room);
1415
+ chunks.push(bounded);
1416
+ total += bounded.byteLength;
1417
+ }
1418
+ } finally {
1419
+ try {
1420
+ await reader.cancel();
1421
+ } catch {}
1422
+ }
1423
+ const merged = new Uint8Array(total);
1424
+ let offset = 0;
1425
+ for (const chunk of chunks) {
1426
+ merged.set(chunk, offset);
1427
+ offset += chunk.byteLength;
1428
+ }
1429
+ return new TextDecoder().decode(merged);
1430
+ }
1431
+ /**
1432
+ * Retry-After / reset timing from a rate-limit response's headers, for callers
1433
+ * that build an {@link HttpRateLimitError} from an SDK error rather than a
1434
+ * `Response`. Keeps the header parsing in one place.
1435
+ */
1436
+ function rateLimitTimingFromHeaders(headers) {
1437
+ const parsed = parseRateLimitHeaders(headers);
1438
+ return {
1439
+ retryAfterMs: parsed.retryAfterMs,
1440
+ resetAt: parsed.resetAt
1441
+ };
1442
+ }
1443
+ function buildHttpRateLimitError(response, body, code, type) {
1444
+ const headers = Object.fromEntries(response.headers.entries());
1445
+ const parsed = parseRateLimitHeaders(headers);
1446
+ return new HttpRateLimitError({
1447
+ status: response.status,
1448
+ statusText: response.statusText,
1449
+ retryAfterMs: parsed.retryAfterMs,
1450
+ resetAt: parsed.resetAt,
1451
+ code,
1452
+ type,
1453
+ headers,
1454
+ body
1455
+ });
1456
+ }
1457
+ /**
1458
+ * Check if a response indicates a transient server error that should be retried.
1459
+ * Matches specific status codes with their expected status text to avoid
1460
+ * retrying permanent failures (e.g., some APIs return 502 for auth errors).
1461
+ */
1462
+ function isTransientError(response) {
1463
+ if (!response?.statusText) return false;
1464
+ const statusText = response.statusText.toLowerCase();
1465
+ switch (response.status) {
1466
+ case 502: return statusText.includes("bad gateway");
1467
+ case 503: return statusText.includes("service unavailable");
1468
+ case 504: return statusText.includes("gateway timeout");
1469
+ case 524: return statusText.includes("timeout");
1470
+ default: return false;
1471
+ }
1472
+ }
1473
+ /**
1474
+ * Decide what to do with a rate-limited response inside `fetchWithRetries`.
1475
+ *
1476
+ * Throws on hard-quota fail-fast or retry exhaustion (with a structured
1477
+ * {@link HttpRateLimitError} for status 429, or a plain `Error` for the soft
1478
+ * `X-RateLimit-Remaining=0` 200 case). Otherwise sleeps via
1479
+ * {@link handleRateLimit} and returns so the caller can `continue` the loop.
1480
+ */
1481
+ /**
1482
+ * Returns a string form of a {@link RequestInfo} suitable for log output.
1483
+ * Strips basic-auth credentials and known sensitive query parameters (api_key,
1484
+ * token, password, signature, …) via {@link sanitizeUrl} so providers that
1485
+ * embed credentials in the URL (e.g. n8n webhooks, HTTP providers with
1486
+ * `?api_key=…`) do not leak them into retry diagnostics.
1487
+ */
1488
+ function urlForLog(url) {
1489
+ const raw = typeof url === "string" ? url : url.url;
1490
+ return require_logger.sanitizeUrlForLogging(raw);
1491
+ }
1492
+ async function handleRateLimitedResponse(response, url, attempt, maxRetries, logEnabled, signal, onRateLimitBackoff) {
1493
+ const isHardRateLimit = response.status === 429;
1494
+ const safeUrl = urlForLog(url);
1495
+ let rateLimitError;
1496
+ if (isHardRateLimit) {
1497
+ const { body, code, type } = await peekRateLimitBody(response, logEnabled, signal);
1498
+ rateLimitError = buildHttpRateLimitError(response, body, code, type);
1499
+ }
1500
+ if (rateLimitError?.kind === "quota") {
1501
+ if (logEnabled) require_logger.logger.debug(`Quota exhausted on URL ${safeUrl}: HTTP ${response.status} (code: ${rateLimitError.code}), failing fast.`);
1502
+ throw rateLimitError;
1503
+ }
1504
+ if (attempt >= maxRetries) {
1505
+ if (rateLimitError) {
1506
+ if (logEnabled) require_logger.logger.debug(`Rate limited on URL ${safeUrl}: HTTP ${response.status} ${response.statusText}, attempt ${attempt + 1}/${maxRetries + 1}, no retries remain.`);
1507
+ throw rateLimitError;
1508
+ }
1509
+ throw new Error(`Rate limited: ${response.status} ${response.statusText} after ${maxRetries + 1} attempts`);
1510
+ }
1511
+ if (logEnabled) require_logger.logger.debug(`Rate limited on URL ${safeUrl}: HTTP ${response.status} ${response.statusText}, attempt ${attempt + 1}/${maxRetries + 1}, waiting before retry...`);
1512
+ await handleRateLimit(response, signal, onRateLimitBackoff);
1513
+ }
1514
+ function formatFetchErrorMessage(error, url) {
1515
+ if (!(error instanceof Error)) return String(error);
1516
+ const typedError = error;
1517
+ const rawUrl = typeof url === "string" ? url : url.url;
1518
+ const redactUrl = (value) => value.split(rawUrl).join(urlForLog(url));
1519
+ let message = `${typedError.name}: ${redactUrl(typedError.message)}`;
1520
+ if (typedError.cause) message += ` (Cause: ${redactUrl(String(typedError.cause))})`;
1521
+ if (typedError.code) message += ` (Code: ${typedError.code})`;
1522
+ return message;
1523
+ }
1524
+ async function fetchWithRetries(url, options = {}, timeout, maxRetries, onRateLimitBackoff) {
1525
+ options = preserveCloudAuthRedirects(url, options);
1526
+ const contextMaxRetries = getFetchRetryContextMaxRetries();
1527
+ maxRetries = Math.max(0, maxRetries ?? contextMaxRetries ?? 4);
1528
+ let lastErrorMessage;
1529
+ const backoff = require_logger.getEnvInt("PROMPTFOO_REQUEST_BACKOFF_MS", 5e3);
1530
+ const signal = require_shared.getEffectiveRequestSignal(url, options);
1531
+ const logEnabled = new Headers(getFetchWithProxyHeaders(url, options)).get("x-promptfoo-silent") !== "true";
1532
+ for (let i = 0; i <= maxRetries; i++) {
1533
+ let response;
1534
+ try {
1535
+ response = await fetchWithTimeout(url, {
1536
+ ...options,
1537
+ disableTransientRetries: true
1538
+ }, timeout);
1539
+ if (require_logger.getEnvBool("PROMPTFOO_RETRY_5XX") && response.status >= 500 && response.status < 600) throw new Error(`Internal Server Error: ${response.status} ${response.statusText}`);
1540
+ if (response && isRateLimited(response)) {
1541
+ await handleRateLimitedResponse(response, url, i, maxRetries, logEnabled, signal, onRateLimitBackoff);
1542
+ continue;
1543
+ }
1544
+ return response;
1545
+ } catch (error) {
1546
+ if (error instanceof Error && error.name === "AbortError") throw error;
1547
+ if (error instanceof CloudAuthRedirectError || error instanceof HttpRateLimitError || error instanceof RequestAuthenticationError) throw error;
1548
+ if (signal?.aborted) throw getAbortError(signal);
1549
+ const errorMessage = formatFetchErrorMessage(error, url);
1550
+ if (logEnabled) require_logger.logger.debug(`Request to ${urlForLog(url)} failed (attempt #${i + 1}), retrying: ${errorMessage}`);
1551
+ if (i < maxRetries) await sleepWithAbort(Math.pow(2, i) * (backoff + 1e3 * Math.random()), signal);
1552
+ lastErrorMessage = errorMessage;
1553
+ }
1554
+ }
1555
+ throw new Error(`Request failed after ${maxRetries} retries: ${lastErrorMessage}`);
1556
+ }
1557
+ //#endregion
1558
+ Object.defineProperty(exports, "CLOUD_PROVIDER_PREFIX", {
1559
+ enumerable: true,
1560
+ get: function() {
1561
+ return CLOUD_PROVIDER_PREFIX;
1562
+ }
1563
+ });
1564
+ Object.defineProperty(exports, "CONSENT_ENDPOINT", {
1565
+ enumerable: true,
1566
+ get: function() {
1567
+ return CONSENT_ENDPOINT;
1568
+ }
1569
+ });
1570
+ Object.defineProperty(exports, "CloudConfig", {
1571
+ enumerable: true,
1572
+ get: function() {
1573
+ return CloudConfig;
1574
+ }
1575
+ });
1576
+ Object.defineProperty(exports, "DEFINITIVE_BILLING_ERROR_CODES", {
1577
+ enumerable: true,
1578
+ get: function() {
1579
+ return DEFINITIVE_BILLING_ERROR_CODES;
1580
+ }
1581
+ });
1582
+ Object.defineProperty(exports, "EVENTS_ENDPOINT", {
1583
+ enumerable: true,
1584
+ get: function() {
1585
+ return EVENTS_ENDPOINT;
1586
+ }
1587
+ });
1588
+ Object.defineProperty(exports, "HARD_QUOTA_ERROR_CODES", {
1589
+ enumerable: true,
1590
+ get: function() {
1591
+ return HARD_QUOTA_ERROR_CODES;
1592
+ }
1593
+ });
1594
+ Object.defineProperty(exports, "HttpRateLimitError", {
1595
+ enumerable: true,
1596
+ get: function() {
1597
+ return HttpRateLimitError;
1598
+ }
1599
+ });
1600
+ Object.defineProperty(exports, "NON_TRANSIENT_HTTP_STATUSES", {
1601
+ enumerable: true,
1602
+ get: function() {
1603
+ return NON_TRANSIENT_HTTP_STATUSES;
1604
+ }
1605
+ });
1606
+ Object.defineProperty(exports, "POSTHOG_KEY", {
1607
+ enumerable: true,
1608
+ get: function() {
1609
+ return POSTHOG_KEY;
1610
+ }
1611
+ });
1612
+ Object.defineProperty(exports, "PROMPTFOO_TEAM_ID_HEADER", {
1613
+ enumerable: true,
1614
+ get: function() {
1615
+ return PROMPTFOO_TEAM_ID_HEADER;
1616
+ }
1617
+ });
1618
+ Object.defineProperty(exports, "R_ENDPOINT", {
1619
+ enumerable: true,
1620
+ get: function() {
1621
+ return R_ENDPOINT;
1622
+ }
1623
+ });
1624
+ Object.defineProperty(exports, "TERMINAL_MAX_WIDTH", {
1625
+ enumerable: true,
1626
+ get: function() {
1627
+ return TERMINAL_MAX_WIDTH;
1628
+ }
1629
+ });
1630
+ Object.defineProperty(exports, "VERSION", {
1631
+ enumerable: true,
1632
+ get: function() {
1633
+ return VERSION;
1634
+ }
1635
+ });
1636
+ Object.defineProperty(exports, "cloudConfig", {
1637
+ enumerable: true,
1638
+ get: function() {
1639
+ return cloudConfig;
1640
+ }
1641
+ });
1642
+ Object.defineProperty(exports, "createDecompressionInterceptor", {
1643
+ enumerable: true,
1644
+ get: function() {
1645
+ return createDecompressionInterceptor;
1646
+ }
1647
+ });
1648
+ Object.defineProperty(exports, "extractRateLimitErrorCode", {
1649
+ enumerable: true,
1650
+ get: function() {
1651
+ return extractRateLimitErrorCode;
1652
+ }
1653
+ });
1654
+ Object.defineProperty(exports, "extractRateLimitErrorType", {
1655
+ enumerable: true,
1656
+ get: function() {
1657
+ return extractRateLimitErrorType;
1658
+ }
1659
+ });
1660
+ Object.defineProperty(exports, "fetchWithProxy", {
1661
+ enumerable: true,
1662
+ get: function() {
1663
+ return fetchWithProxy;
1664
+ }
1665
+ });
1666
+ Object.defineProperty(exports, "fetchWithRetries", {
1667
+ enumerable: true,
1668
+ get: function() {
1669
+ return fetchWithRetries;
1670
+ }
1671
+ });
1672
+ Object.defineProperty(exports, "fetchWithTimeout", {
1673
+ enumerable: true,
1674
+ get: function() {
1675
+ return fetchWithTimeout;
1676
+ }
1677
+ });
1678
+ Object.defineProperty(exports, "fetch_exports", {
1679
+ enumerable: true,
1680
+ get: function() {
1681
+ return fetch_exports;
1682
+ }
1683
+ });
1684
+ Object.defineProperty(exports, "formatRateLimitErrorMessage", {
1685
+ enumerable: true,
1686
+ get: function() {
1687
+ return formatRateLimitErrorMessage;
1688
+ }
1689
+ });
1690
+ Object.defineProperty(exports, "getAbortError", {
1691
+ enumerable: true,
1692
+ get: function() {
1693
+ return getAbortError;
1694
+ }
1695
+ });
1696
+ Object.defineProperty(exports, "getCloudAuthHeaderName", {
1697
+ enumerable: true,
1698
+ get: function() {
1699
+ return getCloudAuthHeaderName;
1700
+ }
1701
+ });
1702
+ Object.defineProperty(exports, "getCloudBearerToken", {
1703
+ enumerable: true,
1704
+ get: function() {
1705
+ return getCloudBearerToken;
1706
+ }
1707
+ });
1708
+ Object.defineProperty(exports, "getCloudTaskTeamId", {
1709
+ enumerable: true,
1710
+ get: function() {
1711
+ return getCloudTaskTeamId;
1712
+ }
1713
+ });
1714
+ Object.defineProperty(exports, "getDefaultShareViewBaseUrl", {
1715
+ enumerable: true,
1716
+ get: function() {
1717
+ return getDefaultShareViewBaseUrl;
1718
+ }
1719
+ });
1720
+ Object.defineProperty(exports, "getFetchRetryContextMaxRetries", {
1721
+ enumerable: true,
1722
+ get: function() {
1723
+ return getFetchRetryContextMaxRetries;
1724
+ }
1725
+ });
1726
+ Object.defineProperty(exports, "getFetchWithProxyHeaders", {
1727
+ enumerable: true,
1728
+ get: function() {
1729
+ return getFetchWithProxyHeaders;
1730
+ }
1731
+ });
1732
+ Object.defineProperty(exports, "getRequestUrlString", {
1733
+ enumerable: true,
1734
+ get: function() {
1735
+ return getRequestUrlString;
1736
+ }
1737
+ });
1738
+ Object.defineProperty(exports, "getShareApiBaseUrl", {
1739
+ enumerable: true,
1740
+ get: function() {
1741
+ return getShareApiBaseUrl;
1742
+ }
1743
+ });
1744
+ Object.defineProperty(exports, "getShareViewBaseUrl", {
1745
+ enumerable: true,
1746
+ get: function() {
1747
+ return getShareViewBaseUrl;
1748
+ }
1749
+ });
1750
+ Object.defineProperty(exports, "isAbortError", {
1751
+ enumerable: true,
1752
+ get: function() {
1753
+ return isAbortError;
1754
+ }
1755
+ });
1756
+ Object.defineProperty(exports, "isDefinitiveBillingCode", {
1757
+ enumerable: true,
1758
+ get: function() {
1759
+ return isDefinitiveBillingCode;
1760
+ }
1761
+ });
1762
+ Object.defineProperty(exports, "isHardQuotaCode", {
1763
+ enumerable: true,
1764
+ get: function() {
1765
+ return isHardQuotaCode;
1766
+ }
1767
+ });
1768
+ Object.defineProperty(exports, "isHttpRateLimitError", {
1769
+ enumerable: true,
1770
+ get: function() {
1771
+ return isHttpRateLimitError;
1772
+ }
1773
+ });
1774
+ Object.defineProperty(exports, "isNonTransientHttpStatus", {
1775
+ enumerable: true,
1776
+ get: function() {
1777
+ return isNonTransientHttpStatus;
1778
+ }
1779
+ });
1780
+ Object.defineProperty(exports, "isPromptfooCloudApiHost", {
1781
+ enumerable: true,
1782
+ get: function() {
1783
+ return isPromptfooCloudApiHost;
1784
+ }
1785
+ });
1786
+ Object.defineProperty(exports, "isTransientConnectionError", {
1787
+ enumerable: true,
1788
+ get: function() {
1789
+ return isTransientConnectionError;
1790
+ }
1791
+ });
1792
+ Object.defineProperty(exports, "parseRateLimitHeaders", {
1793
+ enumerable: true,
1794
+ get: function() {
1795
+ return parseRateLimitHeaders;
1796
+ }
1797
+ });
1798
+ Object.defineProperty(exports, "parseRetryAfter", {
1799
+ enumerable: true,
1800
+ get: function() {
1801
+ return parseRetryAfter;
1802
+ }
1803
+ });
1804
+ Object.defineProperty(exports, "preserveCloudAuthRedirects", {
1805
+ enumerable: true,
1806
+ get: function() {
1807
+ return preserveCloudAuthRedirects;
1808
+ }
1809
+ });
1810
+ Object.defineProperty(exports, "rateLimitTimingFromHeaders", {
1811
+ enumerable: true,
1812
+ get: function() {
1813
+ return rateLimitTimingFromHeaders;
1814
+ }
1815
+ });
1816
+ Object.defineProperty(exports, "readBoundedText", {
1817
+ enumerable: true,
1818
+ get: function() {
1819
+ return readBoundedText;
1820
+ }
1821
+ });
1822
+ Object.defineProperty(exports, "readGlobalConfig", {
1823
+ enumerable: true,
1824
+ get: function() {
1825
+ return readGlobalConfig;
1826
+ }
1827
+ });
1828
+ Object.defineProperty(exports, "stripDecompressionHeaders", {
1829
+ enumerable: true,
1830
+ get: function() {
1831
+ return stripDecompressionHeaders;
1832
+ }
1833
+ });
1834
+ Object.defineProperty(exports, "withFetchRetryContext", {
1835
+ enumerable: true,
1836
+ get: function() {
1837
+ return withFetchRetryContext;
1838
+ }
1839
+ });
1840
+ Object.defineProperty(exports, "writeGlobalConfig", {
1841
+ enumerable: true,
1842
+ get: function() {
1843
+ return writeGlobalConfig;
1844
+ }
1845
+ });
1846
+ Object.defineProperty(exports, "writeGlobalConfigPartial", {
1847
+ enumerable: true,
1848
+ get: function() {
1849
+ return writeGlobalConfigPartial;
1850
+ }
1851
+ });
1852
+
1853
+ //# sourceMappingURL=fetch-BKlgUg08.cjs.map