promptfoo 0.120.26 → 0.121.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 (366) hide show
  1. package/README.md +1 -1
  2. package/dist/drizzle/0023_wooden_mandrill.sql +2 -0
  3. package/dist/drizzle/meta/0023_snapshot.json +1496 -0
  4. package/dist/drizzle/meta/_journal.json +7 -0
  5. package/dist/src/{ListApp-D3DG0F8h.js → ListApp-Du7YVwj5.js} +2 -4
  6. package/dist/src/accounts-BgNJDBE6.js +206 -0
  7. package/dist/src/{accounts-BzEY8H3v.cjs → accounts-Bx-x3bmW.cjs} +99 -80
  8. package/dist/src/{accounts-DHHiXsy6.js → accounts-CMqkzrVf.js} +61 -36
  9. package/dist/src/{accounts-R3gfCR_g.js → accounts-xrUGFA6n.js} +60 -35
  10. package/dist/src/{agentic-utils-D6_gzOUF.js → agentic-utils-BKIN5PKu.js} +9 -10
  11. package/dist/src/{agents-CwM7re15.cjs → agents-B0f4HICh.cjs} +37 -40
  12. package/dist/src/{agents-Cnph5GLD.js → agents-C-dDThPK.js} +37 -37
  13. package/dist/src/{agents-C7BiinFI.cjs → agents-CErsqg5U.cjs} +19 -27
  14. package/dist/src/{agents-v4cW_ZgC.js → agents-CVIn-Utx.js} +19 -22
  15. package/dist/src/{agents-GiUianme.js → agents-CXknwsFX.js} +37 -40
  16. package/dist/src/{agents-DETIQHqF.js → agents-DeH4Gu94.js} +21 -28
  17. package/dist/src/{agents-DYIT-hQy.js → agents-Dy2YpZpa.js} +38 -41
  18. package/dist/src/{agents-Cao4i7AX.js → agents-aF4-T121.js} +19 -30
  19. package/dist/src/{aimlapi-DMF6v_vb.js → aimlapi-BAGZDo5G.js} +16 -18
  20. package/dist/src/{aimlapi-CMJpKK-B.js → aimlapi-BNfTBexL.js} +15 -17
  21. package/dist/src/{aimlapi-DtSf1ykJ.js → aimlapi-DHRKlBEA.js} +15 -4
  22. package/dist/src/{aimlapi-DoGLcQW_.cjs → aimlapi-tg0Gkcvr.cjs} +15 -16
  23. package/dist/src/app/assets/index-BFCZg7hQ.js +439 -0
  24. package/dist/src/app/assets/index-NCn4eVBv.css +1 -0
  25. package/dist/src/app/assets/{vendor-charts-CYyo8R8v.js → vendor-charts-CCl15Imd.js} +1 -1
  26. package/dist/src/app/assets/{vendor-markdown-DSmzq4Jh.js → vendor-markdown-0tekx3KX.js} +1 -1
  27. package/dist/src/app/index.html +4 -34
  28. package/dist/src/{audio-DUH4q0Xq.js → audio-BRODU0UK.js} +7 -9
  29. package/dist/src/{audio-BWjyvHn9.cjs → audio-BWeaWovU.cjs} +6 -7
  30. package/dist/src/{audio-U580w8jM.js → audio-CHQ4r-RV.js} +6 -5
  31. package/dist/src/{audio-BrJBFN2b.js → audio-tf_NBjlC.js} +6 -8
  32. package/dist/src/base-B0tcrnq_.js +193 -0
  33. package/dist/src/base-B4QJRyFS.js +194 -0
  34. package/dist/src/base-DBtwl2FR.cjs +222 -0
  35. package/dist/src/base-fEDN28WM.js +193 -0
  36. package/dist/src/{blobs-kt8v3UyH.js → blobs-BAU-dXan.js} +9 -12
  37. package/dist/src/{blobs-C9J2mVgo.js → blobs-Bpg5rH6i.js} +9 -12
  38. package/dist/src/{blobs-673H0jCl.cjs → blobs-DvS-O6be.cjs} +34 -37
  39. package/dist/src/blobs-qTYm-1PY.js +236 -0
  40. package/dist/src/{cache-BLLayYEN.js → cache-8XhNqPKW.js} +64 -67
  41. package/dist/src/cache-Bbn1Nyrd.cjs +5 -0
  42. package/dist/src/cache-BwsMSda7.js +6 -0
  43. package/dist/src/{cache-mIszOnuz.js → cache-CG0SlR1d.js} +64 -66
  44. package/dist/src/{cache-7xULbvt3.cjs → cache-COish3-W.cjs} +114 -117
  45. package/dist/src/cache-D3eqDYGU.js +739 -0
  46. package/dist/src/{chat-Fl6TZJRS.cjs → chat-2K608PeQ.cjs} +20 -21
  47. package/dist/src/chat-BKm79wib.js +764 -0
  48. package/dist/src/{chat-XPN9YHhr.js → chat-CM_kyI8B.js} +20 -9
  49. package/dist/src/{chat-DIywASPG.js → chat-CRWNNq73.js} +49 -49
  50. package/dist/src/{chat-C8Ei4f87.js → chat-CznLWr_D.js} +49 -49
  51. package/dist/src/{chat-CgyGj2hC.js → chat-DHMH-N64.js} +20 -22
  52. package/dist/src/{chat-C4zqjObh.cjs → chat-DaqekjFr.cjs} +69 -69
  53. package/dist/src/{chat-Cpz3O-Xl.js → chat-DxysjBvt.js} +21 -23
  54. package/dist/src/{chatkit-Dpxrq4eD.js → chatkit-65VXf5SR.js} +58 -58
  55. package/dist/src/{chatkit-DIrJX8xk.js → chatkit-Be-Q-a9F.js} +58 -60
  56. package/dist/src/{chatkit-DEls11hE.js → chatkit-BxFvW8KY.js} +58 -60
  57. package/dist/src/{chatkit-e25Ziu17.cjs → chatkit-DKyPi1Gs.cjs} +58 -60
  58. package/dist/src/chunk-DEq-mXcV.js +15 -0
  59. package/dist/src/chunk-DRamLcfz.js +16 -0
  60. package/dist/src/{claude-agent-sdk-6-xTaLwM.js → claude-agent-sdk-BLTu0WBO.js} +45 -31
  61. package/dist/src/{claude-agent-sdk-BzxF6NIJ.cjs → claude-agent-sdk-CJH22shf.cjs} +44 -29
  62. package/dist/src/{claude-agent-sdk-CmkTnKGH.js → claude-agent-sdk-D6_k9FKA.js} +45 -33
  63. package/dist/src/{claude-agent-sdk-rXCBLK_o.js → claude-agent-sdk-Dy5lT-Tx.js} +46 -21
  64. package/dist/src/{cloud-BMbRVJFw.js → cloud-Bc9526yV.js} +32 -12
  65. package/dist/src/cloud-DmE0EwsY.js +4 -0
  66. package/dist/src/{cloudflare-ai-CUg4BTcj.js → cloudflare-ai-C9r2sRhw.js} +16 -18
  67. package/dist/src/{cloudflare-ai-Z9X219gp.js → cloudflare-ai-CWWJCRim.js} +16 -4
  68. package/dist/src/{cloudflare-ai-BAQ0u_dg.cjs → cloudflare-ai-ClWSdor4.cjs} +16 -17
  69. package/dist/src/{cloudflare-ai-CobxMTR4.js → cloudflare-ai-ICsOuD-z.js} +17 -19
  70. package/dist/src/{cloudflare-gateway-C0sgfr_z.cjs → cloudflare-gateway-C2_-KG5o.cjs} +21 -22
  71. package/dist/src/{cloudflare-gateway-_itGuXry.js → cloudflare-gateway-D6O7AlYb.js} +23 -23
  72. package/dist/src/{cloudflare-gateway-D2_yi-Fh.js → cloudflare-gateway-D6xFc5pa.js} +21 -25
  73. package/dist/src/{cloudflare-gateway-Djf3F3_H.js → cloudflare-gateway-pXGHxJ47.js} +26 -14
  74. package/dist/src/{codex-sdk-ibXwdglL.js → codex-sdk-C6UMlxwV.js} +49 -32
  75. package/dist/src/{codex-sdk-BASDNkIl.js → codex-sdk-DUwKWezN.js} +49 -30
  76. package/dist/src/{codex-sdk-dSnGdgIp.js → codex-sdk-GGAw0qbD.js} +49 -32
  77. package/dist/src/{codex-sdk-wTEpMM_X.cjs → codex-sdk-fAO0c3yA.cjs} +49 -32
  78. package/dist/src/{cometapi-B01btbfb.js → cometapi-BasUi7-_.js} +17 -19
  79. package/dist/src/{cometapi-DHUAH6nK.js → cometapi-Bbjp5V4x.js} +16 -4
  80. package/dist/src/{cometapi-ChAaRjg5.js → cometapi-DkXrKi5z.js} +21 -24
  81. package/dist/src/{cometapi-JbvOJSCO.cjs → cometapi-vY6aDZgo.cjs} +21 -22
  82. package/dist/src/{completion-D9_MDlnd.js → completion-6Mx_iXxK.js} +11 -13
  83. package/dist/src/{completion-BBJ6zmG3.js → completion-C5rtR_9P.js} +11 -13
  84. package/dist/src/{completion-DDyL3Cb2.cjs → completion-CDOouNzq.cjs} +21 -23
  85. package/dist/src/completion-C_P3ypkJ.js +120 -0
  86. package/dist/src/createHash-CTQmL3G2.js +15 -0
  87. package/dist/src/createHash-CfZSc0b4.cjs +27 -0
  88. package/dist/src/createHash-Da8fMwqB.js +16 -0
  89. package/dist/src/createHash-DmPQkvBh.js +15 -0
  90. package/dist/src/{docker-JAAubMw3.js → docker-5KcG-_86.js} +18 -20
  91. package/dist/src/{docker-Ckw-j7Rr.cjs → docker-BwsKwxFs.cjs} +18 -19
  92. package/dist/src/{docker-vnOg96gi.js → docker-CZnqU1XV.js} +18 -7
  93. package/dist/src/{docker-BuButc4D.js → docker-DzxyDPIj.js} +19 -21
  94. package/dist/src/entrypoint.js +2 -3
  95. package/dist/src/{errors-DnGCbnx8.js → errors-P6ll7XSJ.js} +2 -2
  96. package/dist/src/{esm-CYhseqj4.js → esm-C03C-mv3.js} +17 -20
  97. package/dist/src/{esm-rDtG_2rg.js → esm-CaIwzWR5.js} +18 -21
  98. package/dist/src/esm-Cd1AjG1D.js +379 -0
  99. package/dist/src/{esm-BQkx5roy.cjs → esm-CnNt7sI4.cjs} +47 -49
  100. package/dist/src/eval-17JizQIv.js +15 -0
  101. package/dist/src/{eval-CYrbG57o.js → eval-DmFyWU7i.js} +49 -55
  102. package/dist/src/{evalResult-COsVttMA.js → evalResult-CDQiuUuf.js} +16 -12
  103. package/dist/src/{evalResult-6JaUIStC.js → evalResult-CTG2AHOS.js} +10 -11
  104. package/dist/src/evalResult-Cqj8pldJ.js +12 -0
  105. package/dist/src/{evalResult-DlRfu_Rq.cjs → evalResult-Dap2CekP.cjs} +20 -21
  106. package/dist/src/evalResult-DvcJAWJU.cjs +10 -0
  107. package/dist/src/evalResult-Hftn-S_i.js +10 -0
  108. package/dist/src/evaluator-B2CFNt-P.js +36 -0
  109. package/dist/src/{evaluator-3EJCMTs0.js → evaluator-DPFRbFIL.js} +210 -232
  110. package/dist/src/{extractor-LSYjrhK0.js → extractor-CFG6bcWJ.js} +23 -38
  111. package/dist/src/{extractor-DbhlYEeo.cjs → extractor-DX36oYEv.cjs} +37 -64
  112. package/dist/src/{extractor-Hs7la_19.js → extractor-M67RUtg6.js} +23 -38
  113. package/dist/src/extractor-YMU_Gvt8.js +374 -0
  114. package/dist/src/fetch-4M3YRaqL.js +780 -0
  115. package/dist/src/{fetch-18MuNu9i.js → fetch-60Gzydls.js} +60 -46
  116. package/dist/src/{fetch-SRsE6Ctl.js → fetch-BMv0O527.js} +41 -35
  117. package/dist/src/{fetch-ZMn_oemb.cjs → fetch-BxUk8odA.cjs} +268 -279
  118. package/dist/src/fetch-KV5kNASw.js +5 -0
  119. package/dist/src/{fileExtensions-ePDqouxn.js → fileExtensions-DnqA1y9x.js} +2 -2
  120. package/dist/src/{fileExtensions-BpuMmaFL.js → fileExtensions-Ds-foDzt.js} +2 -2
  121. package/dist/src/fileExtensions-LcDYkU4v.js +85 -0
  122. package/dist/src/{fileExtensions-DkJYkWUy.cjs → fileExtensions-bYh77CN8.cjs} +27 -28
  123. package/dist/src/{formatDuration-Doo0xq-z.js → formatDuration-DgBVMN65.js} +2 -2
  124. package/dist/src/{genaiTracer-Ce19n68P.js → genaiTracer-70Z8BIuV.js} +2 -3
  125. package/dist/src/{genaiTracer-CqNnnXrE.js → genaiTracer-C1rxGO8Q.js} +2 -3
  126. package/dist/src/genaiTracer-D3fD9dNV.js +256 -0
  127. package/dist/src/{genaiTracer-CQlpZkrp.cjs → genaiTracer-DN4dQywX.cjs} +13 -14
  128. package/dist/src/graders-Bu0H9nXi.js +32 -0
  129. package/dist/src/{graders-BaMCwIKp.js → graders-CHO8EPM4.js} +385 -417
  130. package/dist/src/graders-Cfhkvx-e.js +34 -0
  131. package/dist/src/{graders-QsALpIdy.js → graders-CpdqD9PI.js} +385 -417
  132. package/dist/src/graders-DClJVpGP.cjs +32 -0
  133. package/dist/src/{graders-DzUUnUjC.cjs → graders-DOXycdlG.cjs} +721 -753
  134. package/dist/src/graders-DcnJsrMO.js +32 -0
  135. package/dist/src/graders-R9rYUM0d.js +13466 -0
  136. package/dist/src/{image-BiEVdpdP.js → image-BmEZqVmk.js} +57 -18
  137. package/dist/src/{image-mhAGP07h.js → image-CBBVXWuT.js} +57 -18
  138. package/dist/src/{image-D10zEe1f.cjs → image-CDLQOcqT.cjs} +6 -7
  139. package/dist/src/{image-COCWy5dX.js → image-DJEvKveK.js} +6 -5
  140. package/dist/src/{image-C3BjJUAU.cjs → image-DTedmQPg.cjs} +77 -32
  141. package/dist/src/{image-DB4sHxdJ.js → image-gvmivTEe.js} +7 -9
  142. package/dist/src/image-pAX56tPG.js +257 -0
  143. package/dist/src/{image-BXt_7u0v.js → image-tL5hIOFh.js} +6 -8
  144. package/dist/src/index.cjs +696 -693
  145. package/dist/src/index.d.cts +113 -10
  146. package/dist/src/index.d.ts +113 -6
  147. package/dist/src/index.js +657 -658
  148. package/dist/src/{interactiveCheck-DU-MAhp5.js → interactiveCheck-BgLZUIt3.js} +7 -8
  149. package/dist/src/{invariant-DT20jrBd.js → invariant-BtWWVVhl.js} +2 -2
  150. package/dist/src/{invariant-1pAf2CD1.js → invariant-Ddh24eXh.js} +2 -2
  151. package/dist/src/{invariant-CKcJAQ6M.cjs → invariant-kfQ8Bu82.cjs} +7 -8
  152. package/dist/src/invariant-vgHWClmd.js +25 -0
  153. package/dist/src/{knowledgeBase-DotRBzUE.js → knowledgeBase-CLJybhnF.js} +19 -34
  154. package/dist/src/{knowledgeBase-XJQ0Qyez.js → knowledgeBase-CoU-UQBg.js} +17 -41
  155. package/dist/src/{knowledgeBase-CMvMlLZR.js → knowledgeBase-DjWPVqSb.js} +17 -43
  156. package/dist/src/{knowledgeBase-Bnb00xKs.cjs → knowledgeBase-wkxuRFhA.cjs} +17 -40
  157. package/dist/src/{litellm-CHrRmPAe.js → litellm-B9Hysuri.js} +16 -18
  158. package/dist/src/{litellm-CrLJrPIm.js → litellm-CTfa0hqi.js} +15 -17
  159. package/dist/src/{litellm-BrnZhMcL.cjs → litellm-NYpQ8RQu.cjs} +15 -16
  160. package/dist/src/{litellm-BECdjOTx.js → litellm-ePxtr9F1.js} +15 -4
  161. package/dist/src/{logger-w8Ozp0Td.js → logger-CT3IKMKA.js} +24 -41
  162. package/dist/src/{logger-BdZ-IqBc.cjs → logger-Cp1GPUjj.cjs} +166 -192
  163. package/dist/src/logger-DLcq4dWf.js +713 -0
  164. package/dist/src/{logger-BotXmWKW.js → logger-KkObSCzq.js} +27 -43
  165. package/dist/src/{luma-ray-C0RkI3lt.cjs → luma-ray-B0GGNRc1.cjs} +20 -21
  166. package/dist/src/{luma-ray-C-w6EsJm.js → luma-ray-BE2mOt6N.js} +20 -13
  167. package/dist/src/{luma-ray-BOeX-h0M.js → luma-ray-BW9IRGIc.js} +22 -21
  168. package/dist/src/{luma-ray-DgKLS0BF.js → luma-ray-Cm1KZBhs.js} +20 -23
  169. package/dist/src/main.js +1985 -2055
  170. package/dist/src/{messages-DXV3Qh8_.cjs → messages-1JrJs91T.cjs} +35 -34
  171. package/dist/src/{messages-D61tPFQo.js → messages-1x9atZmP.js} +25 -24
  172. package/dist/src/{messages-CDZYGNlS.js → messages-BLbWdsyt.js} +25 -24
  173. package/dist/src/messages-D8EA0oDc.js +240 -0
  174. package/dist/src/{meteor-P2rUE-Uz.js → meteor-44VjEACX.js} +3 -4
  175. package/dist/src/{meteor-SLNTgmXm.js → meteor-D-SotUw9.js} +3 -4
  176. package/dist/src/{meteor-odmwVbyG.cjs → meteor-DLZZ3osF.cjs} +3 -4
  177. package/dist/src/{meteor-Dj8cTkU_.js → meteor-DUiCJRC-.js} +3 -4
  178. package/dist/src/modelslab-C1OLRmVX.js +166 -0
  179. package/dist/src/modelslab-CqXBy3U8.js +168 -0
  180. package/dist/src/modelslab-DcOSFwKh.cjs +166 -0
  181. package/dist/src/modelslab-X5-4LroM.js +166 -0
  182. package/dist/src/{nova-reel-C2LFfVTf.js → nova-reel-BgS1ZWuK.js} +20 -13
  183. package/dist/src/{nova-reel-DtCjbD5O.js → nova-reel-D2ZkOSyr.js} +22 -21
  184. package/dist/src/{nova-reel-D9FXq3Mt.cjs → nova-reel-D9xfaMBs.cjs} +20 -21
  185. package/dist/src/{nova-reel-Bk5npr2q.js → nova-reel-DihqLeol.js} +20 -23
  186. package/dist/src/{nova-sonic-BoRSY_U6.cjs → nova-sonic-DVu3mMIy.cjs} +30 -31
  187. package/dist/src/{nova-sonic-D_qERM-K.js → nova-sonic-DezhVUYT.js} +30 -26
  188. package/dist/src/{nova-sonic-CgaWLDM1.js → nova-sonic-P-CdUMlV.js} +30 -31
  189. package/dist/src/{nova-sonic-BXRfQyF-.js → nova-sonic-Q3BOJeig.js} +31 -32
  190. package/dist/src/{openai-Bigwjgo1.cjs → openai-Cuif0GEt.cjs} +8 -9
  191. package/dist/src/{openai-Dz3surb_.js → openai-DElQ-fPX.js} +3 -4
  192. package/dist/src/{openai-CT5fwbve.js → openai-DhbB7eWK.js} +3 -4
  193. package/dist/src/openai-j-sE2O7r.js +44 -0
  194. package/dist/src/{openclaw-dHLcXUWZ.js → openclaw-BiSZPL7J.js} +20 -14
  195. package/dist/src/{openclaw-CpPrXwf6.js → openclaw-Bv1DINsX.js} +20 -27
  196. package/dist/src/{openclaw-B6XY2kUf.js → openclaw-D1D_ej1z.js} +21 -28
  197. package/dist/src/{openclaw-DDSfq5fp.cjs → openclaw-DAfWQn-o.cjs} +33 -39
  198. package/dist/src/opencode-sdk-C7m-wRfI.js +560 -0
  199. package/dist/src/opencode-sdk-CfaLN8PY.cjs +564 -0
  200. package/dist/src/opencode-sdk-D95s6SnR.js +562 -0
  201. package/dist/src/opencode-sdk-DxUPkLT7.js +560 -0
  202. package/dist/src/{otlpReceiver-DmRb0NBj.js → otlpReceiver--AIRW_S4.js} +53 -51
  203. package/dist/src/{otlpReceiver-Dg817agV.js → otlpReceiver-Bn5wGB1v.js} +53 -55
  204. package/dist/src/{otlpReceiver-B6Xo4KZM.cjs → otlpReceiver-Diec4cln.cjs} +53 -55
  205. package/dist/src/{otlpReceiver-BO0rbDzh.js → otlpReceiver-g3ByGaXs.js} +53 -55
  206. package/dist/src/{providerRegistry-Xf0qdqGQ.js → providerRegistry-B0RUOLI_.js} +7 -8
  207. package/dist/src/{providerRegistry-wCWd7sKQ.js → providerRegistry-CD8MEar9.js} +7 -8
  208. package/dist/src/{providerRegistry-lc7a7utN.cjs → providerRegistry-Civky8Ar.cjs} +12 -13
  209. package/dist/src/providerRegistry-DM8rZYol.js +45 -0
  210. package/dist/src/providers-B3HvufyI.js +33246 -0
  211. package/dist/src/{providers-BiNq_Iyc.js → providers-BKRJTjBz.js} +1743 -1795
  212. package/dist/src/providers-C1rOSHiR.js +32 -0
  213. package/dist/src/{providers-BlEhY5mi.js → providers-CFLy1_ji.js} +1750 -1802
  214. package/dist/src/{providers-BNKVY53V.cjs → providers-CFu-TZl-.cjs} +2111 -2163
  215. package/dist/src/providers-CxmDwEFf.cjs +31 -0
  216. package/dist/src/providers-Dodakqr0.js +30 -0
  217. package/dist/src/providers-GIQ2TcsA.js +30 -0
  218. package/dist/src/{pythonUtils-r1uBuA0n.js → pythonUtils-C3py6GC1.js} +18 -19
  219. package/dist/src/{pythonUtils-DZ6EbdY4.cjs → pythonUtils-CTU3Y3lw.cjs} +42 -43
  220. package/dist/src/{pythonUtils-vMlk9Qp5.js → pythonUtils-D5nxkQ0P.js} +18 -19
  221. package/dist/src/pythonUtils-D6fwaDSg.js +249 -0
  222. package/dist/src/quiverai-C2jVwbH1.js +213 -0
  223. package/dist/src/quiverai-CI6gYJVI.js +213 -0
  224. package/dist/src/quiverai-CLkWkyZc.cjs +213 -0
  225. package/dist/src/quiverai-MHSxbmmZ.js +215 -0
  226. package/dist/src/{render-CAZvKKkB.js → render-Drod8m7K.js} +4 -5
  227. package/dist/src/{responses-DLLjADw5.js → responses-BKqJmhhc.js} +34 -27
  228. package/dist/src/{responses-TsdODUpm.js → responses-CGw0DCzh.js} +34 -27
  229. package/dist/src/responses-jxdehPkC.js +660 -0
  230. package/dist/src/{responses-zOtKtnY_.cjs → responses-tD4Bd4dc.cjs} +49 -42
  231. package/dist/src/rubyUtils-BUHu6PhO.js +5 -0
  232. package/dist/src/{rubyUtils-Cs35SDYa.js → rubyUtils-BUVePouc.js} +27 -20
  233. package/dist/src/rubyUtils-BcuGX77l.js +222 -0
  234. package/dist/src/{rubyUtils-BtjlqyXt.js → rubyUtils-Boc4HZzX.js} +18 -19
  235. package/dist/src/rubyUtils-CP42kMvq.cjs +4 -0
  236. package/dist/src/{rubyUtils-DCVaJ3mc.cjs → rubyUtils-DhCAlxZr.cjs} +48 -50
  237. package/dist/src/{sagemaker-Du4LIR97.js → sagemaker-BK4Zb993.js} +75 -70
  238. package/dist/src/{sagemaker-CLdUAv5z.js → sagemaker-BfiWTmvn.js} +77 -77
  239. package/dist/src/{sagemaker-DwNnEVYt.cjs → sagemaker-CcQHM1jV.cjs} +75 -76
  240. package/dist/src/{sagemaker-BcgLu0U4.js → sagemaker-D2Q1c-sD.js} +75 -79
  241. package/dist/src/{scanner-Dyw21Wg_.js → scanner-J8CA3LsV.js} +149 -122
  242. package/dist/src/server/index.js +5620 -67302
  243. package/dist/src/{server-CgUQ25qW.cjs → server-B0PPuDw-.cjs} +57 -67
  244. package/dist/src/server-B1vi21hA.js +7 -0
  245. package/dist/src/{server-CbMTRQkg.js → server-BC7XJFgr.js} +19 -24
  246. package/dist/src/server-Cm9Kai_h.cjs +5 -0
  247. package/dist/src/{server-DWmZLfCy.js → server-DbFphssR.js} +26 -29
  248. package/dist/src/server-OAs3nBRT.js +229 -0
  249. package/dist/src/{signal-Bl32q42d.js → signal-BOTbd53Z.js} +9 -11
  250. package/dist/src/{slack-BtMkB6xP.cjs → slack-BmVAVGaK.cjs} +7 -8
  251. package/dist/src/{slack-OZYxoVON.js → slack-DCUPTzS2.js} +8 -8
  252. package/dist/src/{slack-DPqj42Ts.js → slack-DOdy_kyv.js} +7 -8
  253. package/dist/src/{slack-BfdBx2tO.js → slack-DXMKtA-f.js} +7 -9
  254. package/dist/src/store-BNmZ1KAz.cjs +5 -0
  255. package/dist/src/{store-BqwfFEyF.cjs → store-BSc-TF2w.cjs} +44 -45
  256. package/dist/src/store-BltJg2cd.js +6 -0
  257. package/dist/src/{store-D4gdn9ih.js → store-D1tv90v3.js} +34 -35
  258. package/dist/src/{store-2ocbYY9D.js → store-DQLEjuEO.js} +40 -36
  259. package/dist/src/store-Ub2vaGJ1.js +228 -0
  260. package/dist/src/{tables-D-NSwNIb.js → tables-5EvT_Bwn.js} +23 -23
  261. package/dist/src/{tables-B9E1kRp-.cjs → tables-C7K-XKWp.cjs} +93 -93
  262. package/dist/src/{tables-C7TT2XVn.js → tables-D36WTqKX.js} +25 -25
  263. package/dist/src/tables-xKANLRBD.js +288 -0
  264. package/dist/src/telemetry-5BCRNBbe.cjs +5 -0
  265. package/dist/src/{telemetry-DZ_7PaVq.js → telemetry-C15ziL8u.js} +17 -14
  266. package/dist/src/{telemetry-BXyVqyAg.js → telemetry-C2YDkUQH.js} +11 -13
  267. package/dist/src/{telemetry-D0_yFdtU.cjs → telemetry-CbrnxHp_.cjs} +21 -24
  268. package/dist/src/telemetry-D4W5hboe.js +7 -0
  269. package/dist/src/telemetry-DMb2Mpfm.js +171 -0
  270. package/dist/src/{text-Dm78AVGG.js → text-B_UCRPp2.js} +2 -2
  271. package/dist/src/{text-DF2hMKdg.cjs → text-CW1cyrwj.cjs} +12 -13
  272. package/dist/src/{text-DgMr_tiM.js → text-Db-Wt2u2.js} +2 -2
  273. package/dist/src/text-TIv0QYnd.js +22 -0
  274. package/dist/src/{tokenUsageUtils-FZd5O_4A.js → tokenUsageUtils-BDGe-iyI.js} +2 -2
  275. package/dist/src/{tokenUsageUtils-DmZSD2eU.js → tokenUsageUtils-DflFMjS0.js} +2 -2
  276. package/dist/src/tokenUsageUtils-NYT-WKS6.js +138 -0
  277. package/dist/src/{tokenUsageUtils-CXhxVj72.cjs → tokenUsageUtils-bVa1ga6f.cjs} +32 -33
  278. package/dist/src/{transcription-FNIz3YOe.cjs → transcription-CL78qbOU.cjs} +14 -15
  279. package/dist/src/{transcription-C-M81iDA.js → transcription-DAtxHhAM.js} +14 -7
  280. package/dist/src/{transcription-CYuY5sFO.js → transcription-LNZTNUUL.js} +14 -16
  281. package/dist/src/{transcription-Ch7S-LWw.js → transcription-QHh3AH6Z.js} +15 -17
  282. package/dist/src/{transform-CoP2bJ7P.js → transform-Cgi24fJ7.js} +94 -66
  283. package/dist/src/{transform-Kd6u-oNm.cjs → transform-CzK1Q0zl.cjs} +24 -26
  284. package/dist/src/{transform-D8dILpfZ.js → transform-DECvGmzp.js} +15 -13
  285. package/dist/src/{transform-DMaxQwDx.js → transform-DGLazrMm.js} +94 -66
  286. package/dist/src/transform-DGxXocjk.js +1506 -0
  287. package/dist/src/{transform-ivxEY4f7.cjs → transform-DOcQeLld.cjs} +234 -206
  288. package/dist/src/transform-DTGDnAzW.js +6 -0
  289. package/dist/src/{transform-CqTFr7KR.js → transform-DilY9wbS.js} +10 -12
  290. package/dist/src/transform-aa6tmVpZ.js +216 -0
  291. package/dist/src/transform-m3qNw4KP.cjs +5 -0
  292. package/dist/src/{transformersAvailability-DEU2naS1.js → transformersAvailability-CEVM2GNQ.js} +2 -2
  293. package/dist/src/{transformersAvailability-Bkep3ka7.cjs → transformersAvailability-CwayUSlh.cjs} +2 -3
  294. package/dist/src/{transformersAvailability-DwmezkVe.js → transformersAvailability-D6c6ROpT.js} +2 -2
  295. package/dist/src/{types-t52w-XsS.js → types-CH3Ge2sE.js} +103 -92
  296. package/dist/src/{types-DMVjYLpx.js → types-CLKiCBW3.js} +98 -91
  297. package/dist/src/types-CN_TZ2GJ.js +3260 -0
  298. package/dist/src/{types-BIfttHrT.cjs → types-LJ0r3wbR.cjs} +573 -566
  299. package/dist/src/util-5cB-L7U3.js +1430 -0
  300. package/dist/src/util-6-GqIvzS.js +599 -0
  301. package/dist/src/{util-vjscpUzy.js → util-B7T3SiBS.js} +5 -6
  302. package/dist/src/{util-Cl0zfT3V.js → util-Betm42rL.js} +44 -17
  303. package/dist/src/{util-CUEt0Vum.js → util-C-PPYSMq.js} +44 -17
  304. package/dist/src/{util-DkFTvieG.cjs → util-CchiqXh_.cjs} +35 -36
  305. package/dist/src/{util-mJ58qbbw.js → util-DaWTWKBK.js} +5 -6
  306. package/dist/src/{util-C08Kns6-.cjs → util-Db0a0AFH.cjs} +89 -62
  307. package/dist/src/{util-DiCePfDu.js → util-Dlz_Wvgm.js} +102 -53
  308. package/dist/src/{util-BSh4a_Q8.js → util-YT5HPZaS.js} +102 -53
  309. package/dist/src/{util-DUYOvxAy.cjs → util-Yz-1aEhW.cjs} +274 -219
  310. package/dist/src/util-ZZH-3QZz.js +293 -0
  311. package/dist/src/{utils-DFaZa6Rf.cjs → utils-Cz9qXqII.cjs} +32 -35
  312. package/dist/src/{utils-CVzb4YiI.js → utils-XiOAgly5.js} +4 -7
  313. package/dist/src/utils-dLokC-eR.js +94 -0
  314. package/dist/src/{utils-JaY9veb5.js → utils-f2-Moju7.js} +4 -7
  315. package/dist/tsconfig.tsbuildinfo +1 -1
  316. package/package.json +59 -53
  317. package/dist/src/app/assets/index-BOgkICuY.css +0 -1
  318. package/dist/src/app/assets/index-CSgqn_Vd.js +0 -428
  319. package/dist/src/app/tsconfig.app.tsbuildinfo +0 -1
  320. package/dist/src/base-BaXmtXYp.js +0 -107
  321. package/dist/src/base-Dtp8b4_N.js +0 -106
  322. package/dist/src/base-f71xxWai.cjs +0 -111
  323. package/dist/src/cache-BUPcq0Ad.js +0 -6
  324. package/dist/src/cache-CVfRb-HD.cjs +0 -6
  325. package/dist/src/cache-O4EuX2JV.js +0 -8
  326. package/dist/src/chunk-DHDDz29n.js +0 -22
  327. package/dist/src/chunk-FhC4c-0y.js +0 -21
  328. package/dist/src/cloud-CZ4hytdm.js +0 -5
  329. package/dist/src/eval-CKHWqG9f.js +0 -16
  330. package/dist/src/evalResult-CxTP-LMm.cjs +0 -11
  331. package/dist/src/evalResult-CzLURDcP.js +0 -13
  332. package/dist/src/evalResult-DyttNQ_G.js +0 -11
  333. package/dist/src/evaluator-0PvfeBYh.js +0 -38
  334. package/dist/src/fetch-Bi0o-fdp.js +0 -4
  335. package/dist/src/fetch-CMptBDVg.cjs +0 -4
  336. package/dist/src/fetch-DAZkv3gV.js +0 -6
  337. package/dist/src/graders-BCytzXrb.js +0 -34
  338. package/dist/src/graders-CGZQShfJ.cjs +0 -33
  339. package/dist/src/graders-spkuVC-E.js +0 -36
  340. package/dist/src/opencode-sdk-CImWVqy9.js +0 -382
  341. package/dist/src/opencode-sdk-CuCztr4P.js +0 -380
  342. package/dist/src/opencode-sdk-DhcfRbBH.js +0 -376
  343. package/dist/src/opencode-sdk-mqF-Oj3f.cjs +0 -383
  344. package/dist/src/providers-BMZZmPBJ.cjs +0 -32
  345. package/dist/src/providers-CQQrNaJk.js +0 -32
  346. package/dist/src/providers-Ck8HyrC-.js +0 -34
  347. package/dist/src/quiverai-BNfIwKCO.cjs +0 -54
  348. package/dist/src/quiverai-BQigKdIH.js +0 -57
  349. package/dist/src/quiverai-Bfy2WnE2.js +0 -55
  350. package/dist/src/quiverai-CedIP0PJ.js +0 -43
  351. package/dist/src/rubyUtils-D7--T12C.js +0 -6
  352. package/dist/src/rubyUtils-DRRiMFV2.js +0 -5
  353. package/dist/src/rubyUtils-vb8OYFC-.cjs +0 -5
  354. package/dist/src/server-BUbS0Qfh.js +0 -6
  355. package/dist/src/server-XpGXFHkS.cjs +0 -6
  356. package/dist/src/server-gfOx5Zrk.js +0 -8
  357. package/dist/src/store-5u2yriTV.js +0 -7
  358. package/dist/src/store-D_lq_8oQ.js +0 -6
  359. package/dist/src/store-m5KT6Ly7.cjs +0 -6
  360. package/dist/src/telemetry-5RHFoCJh.js +0 -6
  361. package/dist/src/telemetry-Do8wMnA-.js +0 -8
  362. package/dist/src/telemetry-LojxPoFq.cjs +0 -6
  363. package/dist/src/transform-8eGmaH-7.js +0 -7
  364. package/dist/src/transform-BRVvWaG4.cjs +0 -6
  365. package/dist/src/transform-GybT0X0u.js +0 -8
  366. package/dist/src/transformersAvailability-DkAWaK5B.js +0 -35
@@ -1,5 +1,6 @@
1
- import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, g as getConfigDirectoryPath, i as logger_default, r as logRequestResponse, w as cliState_default, y as getEnvInt } from "./logger-w8Ozp0Td.js";
2
- import { t as invariant } from "./invariant-1pAf2CD1.js";
1
+ import { t as __exportAll } from "./chunk-DEq-mXcV.js";
2
+ import { _ as getEnvBool, b as getEnvString, c as sanitizeUrl, g as getConfigDirectoryPath, i as logger, r as logRequestResponse, w as state, y as getEnvInt } from "./logger-CT3IKMKA.js";
3
+ import { t as invariant } from "./invariant-Ddh24eXh.js";
3
4
  import * as fs$1 from "fs";
4
5
  import * as path$1 from "path";
5
6
  import path from "path";
@@ -9,7 +10,6 @@ import * as fsPromises from "fs/promises";
9
10
  import { getProxyForUrl } from "proxy-from-env";
10
11
  import { Agent, ProxyAgent } from "undici";
11
12
  import { gzip } from "zlib";
12
-
13
13
  //#region src/providers/constants.ts
14
14
  const FILE_METADATA_KEY = "_promptfooFileMetadata";
15
15
  /**
@@ -17,28 +17,21 @@ const FILE_METADATA_KEY = "_promptfooFileMetadata";
17
17
  * Used to distinguish human ratings from automated assertions.
18
18
  */
19
19
  const HUMAN_ASSERTION_TYPE = "human";
20
-
21
20
  //#endregion
22
21
  //#region src/version.ts
23
22
  /**
24
23
  * Application version from package.json.
25
24
  * Injected at build time, or read from npm environment in development.
26
25
  */
27
- const VERSION = "0.120.26";
26
+ const VERSION = "0.121.1";
28
27
  /**
29
28
  * PostHog analytics key.
30
29
  * Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
31
30
  * Empty string in development/test.
32
31
  */
33
32
  const POSTHOG_KEY = "phc_E5n5uHnDo2eREJL1uqX1cIlbkoRby4yFWt3V94HqRRg";
34
-
35
- //#endregion
36
- //#region src/constants.ts
37
- const DEFAULT_QUERY_LIMIT = 100;
38
- const DEFAULT_MAX_CONCURRENCY = 4;
39
- const DEFAULT_API_BASE_URL = "https://api.promptfoo.app";
40
33
  function getShareApiBaseUrl() {
41
- return getEnvString("PROMPTFOO_REMOTE_API_BASE_URL") || DEFAULT_API_BASE_URL;
34
+ return getEnvString("PROMPTFOO_REMOTE_API_BASE_URL") || "https://api.promptfoo.app";
42
35
  }
43
36
  function getDefaultShareViewBaseUrl() {
44
37
  return getEnvString("PROMPTFOO_SHARING_APP_BASE_URL", `https://promptfoo.app`);
@@ -51,7 +44,6 @@ const CLOUD_PROVIDER_PREFIX = "promptfoo://provider/";
51
44
  const CONSENT_ENDPOINT = "https://api.promptfoo.dev/consent";
52
45
  const EVENTS_ENDPOINT = "https://a.promptfoo.app";
53
46
  const R_ENDPOINT = "https://r.promptfoo.app/";
54
-
55
47
  //#endregion
56
48
  //#region src/providers/shared.ts
57
49
  /**
@@ -290,14 +282,12 @@ function transformTools(tools, format) {
290
282
  default: return tools;
291
283
  }
292
284
  }
293
-
294
285
  //#endregion
295
286
  //#region src/util/time.ts
296
287
  function getCurrentTimestamp() {
297
288
  return Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
298
289
  }
299
290
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
300
-
301
291
  //#endregion
302
292
  //#region src/globalConfig/globalConfig.ts
303
293
  /**
@@ -338,11 +328,8 @@ function writeGlobalConfigPartial(partialConfig) {
338
328
  });
339
329
  writeGlobalConfig(updatedConfig);
340
330
  }
341
-
342
- //#endregion
343
- //#region src/globalConfig/cloud.ts
344
- const CLOUD_API_HOST = "https://api.promptfoo.app";
345
- const API_HOST = getEnvString("API_HOST", CLOUD_API_HOST);
331
+ const API_HOST = getEnvString("API_HOST", "https://api.promptfoo.app");
332
+ const SHARING_CUTOFF_DATE = /* @__PURE__ */ new Date("2026-03-09T00:00:00Z");
346
333
  var CloudConfig = class {
347
334
  config;
348
335
  constructor() {
@@ -351,6 +338,7 @@ var CloudConfig = class {
351
338
  appUrl: savedConfig.appUrl || "https://www.promptfoo.app",
352
339
  apiHost: savedConfig.apiHost,
353
340
  apiKey: savedConfig.apiKey,
341
+ sharing: savedConfig.sharing,
354
342
  currentOrganizationId: savedConfig.currentOrganizationId,
355
343
  currentTeamId: savedConfig.currentTeamId,
356
344
  teams: savedConfig.teams
@@ -395,8 +383,21 @@ var CloudConfig = class {
395
383
  getAppUrl() {
396
384
  return this.config.appUrl;
397
385
  }
386
+ getSharing() {
387
+ return this.config.sharing;
388
+ }
389
+ /**
390
+ * Sets the sharing preference. Note: this value is only updated at authentication time
391
+ * (via `validateAndSetApiToken`) and may become stale if the user's license status
392
+ * changes between re-authentications.
393
+ */
394
+ setSharing(sharing) {
395
+ this.config.sharing = sharing;
396
+ this.saveConfig();
397
+ }
398
398
  delete() {
399
399
  writeGlobalConfigPartial({ cloud: {} });
400
+ this.reload();
400
401
  }
401
402
  saveConfig() {
402
403
  writeGlobalConfigPartial({ cloud: this.config });
@@ -408,6 +409,7 @@ var CloudConfig = class {
408
409
  appUrl: savedConfig.appUrl || "https://www.promptfoo.app",
409
410
  apiHost: savedConfig.apiHost,
410
411
  apiKey: savedConfig.apiKey,
412
+ sharing: savedConfig.sharing,
411
413
  currentOrganizationId: savedConfig.currentOrganizationId,
412
414
  currentTeamId: savedConfig.currentTeamId,
413
415
  teams: savedConfig.teams
@@ -415,27 +417,33 @@ var CloudConfig = class {
415
417
  }
416
418
  async validateAndSetApiToken(token, apiHost) {
417
419
  try {
418
- const { fetchWithProxy } = await import("./fetch-Bi0o-fdp.js");
420
+ const { fetchWithProxy } = await Promise.resolve().then(() => fetch_exports);
419
421
  const response = await fetchWithProxy(`${apiHost}/api/v1/users/me`, { headers: { Authorization: `Bearer ${token}` } });
420
422
  if (!response.ok) {
421
423
  const errorMessage = await response.text();
422
- logger_default.error(`[Cloud] Failed to validate API token: ${errorMessage}. HTTP Status: ${response.status} - ${response.statusText}.`);
424
+ logger.error(`[Cloud] Failed to validate API token: ${errorMessage}. HTTP Status: ${response.status} - ${response.statusText}.`);
423
425
  throw new Error("Failed to validate API token: " + response.statusText);
424
426
  }
425
- const { user, organization, app } = await response.json();
427
+ const { user, organization, app, hasActiveLicense } = await response.json();
426
428
  this.setApiKey(token);
427
429
  this.setApiHost(apiHost);
428
430
  this.setAppUrl(app.url);
431
+ if (typeof hasActiveLicense === "boolean") {
432
+ const createdAt = user?.createdAt ? new Date(user.createdAt) : null;
433
+ const isGrandfathered = createdAt != null && createdAt < SHARING_CUTOFF_DATE;
434
+ this.setSharing(hasActiveLicense || isGrandfathered);
435
+ }
429
436
  return {
430
437
  user,
431
438
  organization,
432
- app
439
+ app,
440
+ hasActiveLicense: typeof hasActiveLicense === "boolean" ? hasActiveLicense : false
433
441
  };
434
442
  } catch (err) {
435
443
  const error = err;
436
444
  const errorMessage = error instanceof Error ? error.message : String(error);
437
- logger_default.error(`[Cloud] Failed to validate API token with host ${apiHost}: ${errorMessage}`);
438
- if (error.cause) logger_default.error(`Cause: ${error.cause}`);
445
+ logger.error(`[Cloud] Failed to validate API token with host ${apiHost}: ${errorMessage}`);
446
+ if (error.cause) logger.error(`Cause: ${error.cause}`);
439
447
  throw error;
440
448
  }
441
449
  }
@@ -482,7 +490,6 @@ var CloudConfig = class {
482
490
  }
483
491
  };
484
492
  const cloudConfig = new CloudConfig();
485
-
486
493
  //#endregion
487
494
  //#region src/util/fetch/monkeyPatchFetch.ts
488
495
  const gzipAsync = promisify(gzip);
@@ -509,9 +516,9 @@ async function monkeyPatchFetch(url, options) {
509
516
  "Content-Encoding": "gzip"
510
517
  };
511
518
  } catch (e) {
512
- logger_default.warn(`Failed to compress request body: ${e}`);
519
+ logger.warn(`Failed to compress request body: ${e}`);
513
520
  }
514
- if (typeof url === "string" && url.startsWith(CLOUD_API_HOST) || url instanceof URL && url.host === CLOUD_API_HOST.replace(/^https?:\/\//, "")) {
521
+ if (typeof url === "string" && url.startsWith("https://api.promptfoo.app") || url instanceof URL && url.host === "https://api.promptfoo.app".replace(/^https?:\/\//, "")) {
515
522
  const token = cloudConfig.getApiKey();
516
523
  opts.headers = {
517
524
  ...opts.headers || {},
@@ -536,17 +543,24 @@ async function monkeyPatchFetch(url, options) {
536
543
  response: null
537
544
  });
538
545
  if (isConnectionError(e)) {
539
- logger_default.debug(`Connection error, please check your network connectivity to the host: ${url} ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY ? `or Proxy: ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY}` : ""}`);
546
+ logger.debug(`Connection error, please check your network connectivity to the host: ${url} ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY ? `or Proxy: ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY}` : ""}`);
540
547
  throw e;
541
548
  }
542
- logger_default.debug(`Error in fetch: ${JSON.stringify(e, Object.getOwnPropertyNames(e), 2)} ${e instanceof Error ? e.stack : ""}`);
549
+ logger.debug(`Error in fetch: ${JSON.stringify(e, Object.getOwnPropertyNames(e), 2)} ${e instanceof Error ? e.stack : ""}`);
543
550
  }
544
551
  throw e;
545
552
  }
546
553
  }
547
-
548
554
  //#endregion
549
555
  //#region src/util/fetch/index.ts
556
+ var fetch_exports = /* @__PURE__ */ __exportAll({
557
+ fetchWithProxy: () => fetchWithProxy,
558
+ fetchWithRetries: () => fetchWithRetries,
559
+ fetchWithTimeout: () => fetchWithTimeout,
560
+ handleRateLimit: () => handleRateLimit,
561
+ isRateLimited: () => isRateLimited,
562
+ isTransientError: () => isTransientError
563
+ });
550
564
  let cachedAgent = null;
551
565
  let cachedAgentConcurrency;
552
566
  let cachedProxyAgents = /* @__PURE__ */ new Map();
@@ -562,7 +576,7 @@ function getConnectionPoolSize() {
562
576
  const parsed = parseInt(envConnections, 10);
563
577
  if (!isNaN(parsed)) return parsed;
564
578
  }
565
- return cliState_default.maxConcurrency || DEFAULT_MAX_CONCURRENCY;
579
+ return state.maxConcurrency || 4;
566
580
  }
567
581
  function getOrCreateAgent(tlsOptions) {
568
582
  const concurrency = getConnectionPoolSize();
@@ -616,7 +630,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
616
630
  if (typeof url === "string") try {
617
631
  const parsedUrl = new URL(url);
618
632
  if (parsedUrl.username || parsedUrl.password) {
619
- if (finalOptions.headers && "Authorization" in finalOptions.headers) logger_default.warn("Both URL credentials and Authorization header present - URL credentials will be ignored");
633
+ if (finalOptions.headers && "Authorization" in finalOptions.headers) logger.warn("Both URL credentials and Authorization header present - URL credentials will be ignored");
620
634
  else {
621
635
  const username = parsedUrl.username || "";
622
636
  const password = parsedUrl.password || "";
@@ -632,20 +646,20 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
632
646
  finalUrlString = finalUrl.toString();
633
647
  }
634
648
  } catch (e) {
635
- logger_default.debug(`URL parsing failed in fetchWithProxy: ${e}`);
649
+ logger.debug(`URL parsing failed in fetchWithProxy: ${e}`);
636
650
  }
637
651
  const tlsOptions = { rejectUnauthorized: !getEnvBool("PROMPTFOO_INSECURE_SSL", true) };
638
652
  const caCertPath = getEnvString("PROMPTFOO_CA_CERT_PATH");
639
653
  if (caCertPath) try {
640
- const resolvedPath = path.resolve(cliState_default.basePath || "", caCertPath);
654
+ const resolvedPath = path.resolve(state.basePath || "", caCertPath);
641
655
  tlsOptions.ca = await fsPromises.readFile(resolvedPath, "utf8");
642
- logger_default.debug(`Using custom CA certificate from ${resolvedPath}`);
656
+ logger.debug(`Using custom CA certificate from ${resolvedPath}`);
643
657
  } catch (e) {
644
- logger_default.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
658
+ logger.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
645
659
  }
646
660
  const proxyUrl = finalUrlString ? getProxyForUrl(finalUrlString) : "";
647
661
  if (!finalOptions.dispatcher) if (proxyUrl) {
648
- logger_default.debug(`Using proxy: ${sanitizeUrl(proxyUrl)}`);
662
+ logger.debug(`Using proxy: ${sanitizeUrl(proxyUrl)}`);
649
663
  finalOptions.dispatcher = getOrCreateProxyAgent(proxyUrl, tlsOptions);
650
664
  } else finalOptions.dispatcher = getOrCreateAgent(tlsOptions);
651
665
  const maxTransientRetries = options.disableTransientRetries ? 0 : 3;
@@ -653,7 +667,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
653
667
  const response = await monkeyPatchFetch(finalUrl, finalOptions);
654
668
  if (!options.disableTransientRetries && isTransientError(response) && attempt < maxTransientRetries) {
655
669
  const backoffMs = Math.pow(2, attempt) * 1e3;
656
- logger_default.debug(`Transient error (${response.status} ${response.statusText}), retry ${attempt + 1}/${maxTransientRetries} after ${backoffMs}ms`);
670
+ logger.debug(`Transient error (${response.status} ${response.statusText}), retry ${attempt + 1}/${maxTransientRetries} after ${backoffMs}ms`);
657
671
  await sleep(backoffMs);
658
672
  continue;
659
673
  }
@@ -703,7 +717,7 @@ async function handleRateLimit(response) {
703
717
  const now = /* @__PURE__ */ new Date();
704
718
  waitTime = Math.max(resetTime.getTime() - now.getTime() + 1e3, 0);
705
719
  } else if (retryAfter) waitTime = Number.parseInt(retryAfter) * 1e3;
706
- logger_default.debug(`Rate limited, waiting ${waitTime}ms before retry`);
720
+ logger.debug(`Rate limited, waiting ${waitTime}ms before retry`);
707
721
  await sleep(waitTime);
708
722
  }
709
723
  /**
@@ -735,7 +749,7 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
735
749
  }, timeout);
736
750
  if (getEnvBool("PROMPTFOO_RETRY_5XX") && response.status >= 500 && response.status < 600) throw new Error(`Internal Server Error: ${response.status} ${response.statusText}`);
737
751
  if (response && isRateLimited(response)) {
738
- logger_default.debug(`Rate limited on URL ${url}: ${response.status} ${response.statusText}, attempt ${i + 1}/${maxRetries + 1}, waiting before retry...`);
752
+ logger.debug(`Rate limited on URL ${url}: ${response.status} ${response.statusText}, attempt ${i + 1}/${maxRetries + 1}, waiting before retry...`);
739
753
  lastErrorMessage = `Rate limited: ${response.status} ${response.statusText}`;
740
754
  await handleRateLimit(response);
741
755
  continue;
@@ -750,14 +764,14 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
750
764
  if (typedError.cause) errorMessage += ` (Cause: ${typedError.cause})`;
751
765
  if (typedError.code) errorMessage += ` (Code: ${typedError.code})`;
752
766
  } else errorMessage = String(error);
753
- logger_default.debug(`Request to ${url} failed (attempt #${i + 1}), retrying: ${errorMessage}`);
767
+ logger.debug(`Request to ${url} failed (attempt #${i + 1}), retrying: ${errorMessage}`);
754
768
  if (i < maxRetries) await sleep(Math.pow(2, i) * (backoff + 1e3 * Math.random()));
755
769
  lastErrorMessage = errorMessage;
756
770
  }
757
771
  }
758
772
  throw new Error(`Request failed after ${maxRetries} retries: ${lastErrorMessage}`);
759
773
  }
760
-
761
774
  //#endregion
762
- export { EVENTS_ENDPOINT as A, toTitleCase as C, CONSENT_ENDPOINT as D, CLOUD_PROVIDER_PREFIX as E, getShareViewBaseUrl as F, POSTHOG_KEY as I, VERSION as L, TERMINAL_MAX_WIDTH as M, getDefaultShareViewBaseUrl as N, DEFAULT_MAX_CONCURRENCY as O, getShareApiBaseUrl as P, FILE_METADATA_KEY as R, parseChatPrompt as S, transformTools as T, isOpenAIToolArray as _, isRateLimited as a, openaiToolChoiceToBedrock as b, cloudConfig as c, writeGlobalConfigPartial as d, getCurrentTimestamp as f, calculateCost as g, REQUEST_TIMEOUT_MS as h, handleRateLimit as i, R_ENDPOINT as j, DEFAULT_QUERY_LIMIT as k, readGlobalConfig as l, LONG_RUNNING_MODEL_TIMEOUT_MS as m, fetchWithRetries as n, isTransientError as o, sleep as p, fetchWithTimeout as r, CloudConfig as s, fetchWithProxy as t, writeGlobalConfig as u, isOpenAIToolChoice as v, transformToolChoice as w, openaiToolsToBedrock as x, isPromptfooSampleTarget as y, HUMAN_ASSERTION_TYPE as z };
763
- //# sourceMappingURL=fetch-18MuNu9i.js.map
775
+ export { getShareApiBaseUrl as A, transformTools as C, R_ENDPOINT as D, EVENTS_ENDPOINT as E, HUMAN_ASSERTION_TYPE as F, POSTHOG_KEY as M, VERSION as N, TERMINAL_MAX_WIDTH as O, FILE_METADATA_KEY as P, transformToolChoice as S, CONSENT_ENDPOINT as T, isPromptfooSampleTarget as _, CloudConfig as a, parseChatPrompt as b, writeGlobalConfig as c, sleep as d, LONG_RUNNING_MODEL_TIMEOUT_MS as f, isOpenAIToolChoice as g, isOpenAIToolArray as h, fetch_exports as i, getShareViewBaseUrl as j, getDefaultShareViewBaseUrl as k, writeGlobalConfigPartial as l, calculateCost as m, fetchWithRetries as n, cloudConfig as o, REQUEST_TIMEOUT_MS as p, fetchWithTimeout as r, readGlobalConfig as s, fetchWithProxy as t, getCurrentTimestamp as u, openaiToolChoiceToBedrock as v, CLOUD_PROVIDER_PREFIX as w, toTitleCase as x, openaiToolsToBedrock as y };
776
+
777
+ //# sourceMappingURL=fetch-60Gzydls.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { C as getEnvString, O as cliState_default, S as getEnvInt, a as logRequestResponse, b as getEnvBool, o as logger_default, u as sanitizeUrl } from "./logger-BotXmWKW.js";
3
- import { t as invariant } from "./invariant-DT20jrBd.js";
4
- import { i as cloudConfig, n as CLOUD_API_HOST } from "./cloud-BMbRVJFw.js";
2
+ import { C as getEnvString, O as state, S as getEnvInt, a as logRequestResponse, b as getEnvBool, o as logger, u as sanitizeUrl } from "./logger-KkObSCzq.js";
3
+ import { t as invariant } from "./invariant-BtWWVVhl.js";
4
+ import { a as cloudConfig } from "./cloud-Bc9526yV.js";
5
5
  import { Agent, ProxyAgent } from "undici";
6
6
  import path from "path";
7
7
  import yaml from "js-yaml";
@@ -9,7 +9,6 @@ import * as fsPromises from "fs/promises";
9
9
  import { getProxyForUrl } from "proxy-from-env";
10
10
  import { promisify } from "util";
11
11
  import { gzip } from "zlib";
12
-
13
12
  //#region src/providers/constants.ts
14
13
  const FILE_METADATA_KEY = "_promptfooFileMetadata";
15
14
  /**
@@ -17,28 +16,21 @@ const FILE_METADATA_KEY = "_promptfooFileMetadata";
17
16
  * Used to distinguish human ratings from automated assertions.
18
17
  */
19
18
  const HUMAN_ASSERTION_TYPE = "human";
20
-
21
19
  //#endregion
22
20
  //#region src/version.ts
23
21
  /**
24
22
  * Application version from package.json.
25
23
  * Injected at build time, or read from npm environment in development.
26
24
  */
27
- const VERSION = "0.120.26";
25
+ const VERSION = "0.121.1";
28
26
  /**
29
27
  * PostHog analytics key.
30
28
  * Only populated during production builds via PROMPTFOO_POSTHOG_KEY env var.
31
29
  * Empty string in development/test.
32
30
  */
33
31
  const POSTHOG_KEY = "phc_E5n5uHnDo2eREJL1uqX1cIlbkoRby4yFWt3V94HqRRg";
34
-
35
- //#endregion
36
- //#region src/constants.ts
37
- const DEFAULT_QUERY_LIMIT = 100;
38
- const DEFAULT_MAX_CONCURRENCY = 4;
39
- const DEFAULT_API_BASE_URL = "https://api.promptfoo.app";
40
32
  function getShareApiBaseUrl() {
41
- return getEnvString("PROMPTFOO_REMOTE_API_BASE_URL") || DEFAULT_API_BASE_URL;
33
+ return getEnvString("PROMPTFOO_REMOTE_API_BASE_URL") || "https://api.promptfoo.app";
42
34
  }
43
35
  function getDefaultShareViewBaseUrl() {
44
36
  return getEnvString("PROMPTFOO_SHARING_APP_BASE_URL", `https://promptfoo.app`);
@@ -54,7 +46,6 @@ const CLOUD_PROVIDER_PREFIX = "promptfoo://provider/";
54
46
  const CONSENT_ENDPOINT = "https://api.promptfoo.dev/consent";
55
47
  const EVENTS_ENDPOINT = "https://a.promptfoo.app";
56
48
  const R_ENDPOINT = "https://r.promptfoo.app/";
57
-
58
49
  //#endregion
59
50
  //#region src/providers/shared.ts
60
51
  /**
@@ -293,14 +284,30 @@ function transformTools(tools, format) {
293
284
  default: return tools;
294
285
  }
295
286
  }
296
-
297
287
  //#endregion
298
288
  //#region src/util/time.ts
299
289
  function getCurrentTimestamp() {
300
290
  return Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
301
291
  }
302
292
  const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
303
-
293
+ /**
294
+ * Sleep that can be interrupted by an abort signal.
295
+ * Throws 'cancelled by user' if signal is already aborted or aborts during sleep.
296
+ */
297
+ async function sleepWithAbort(ms, signal) {
298
+ if (signal.aborted) throw new Error("cancelled by user");
299
+ return new Promise((resolve, reject) => {
300
+ const timeout = setTimeout(() => {
301
+ signal.removeEventListener("abort", onAbort);
302
+ resolve();
303
+ }, ms);
304
+ const onAbort = () => {
305
+ clearTimeout(timeout);
306
+ reject(/* @__PURE__ */ new Error("cancelled by user"));
307
+ };
308
+ signal.addEventListener("abort", onAbort, { once: true });
309
+ });
310
+ }
304
311
  //#endregion
305
312
  //#region src/util/fetch/monkeyPatchFetch.ts
306
313
  const gzipAsync = promisify(gzip);
@@ -327,9 +334,9 @@ async function monkeyPatchFetch(url, options) {
327
334
  "Content-Encoding": "gzip"
328
335
  };
329
336
  } catch (e) {
330
- logger_default.warn(`Failed to compress request body: ${e}`);
337
+ logger.warn(`Failed to compress request body: ${e}`);
331
338
  }
332
- if (typeof url === "string" && url.startsWith(CLOUD_API_HOST) || url instanceof URL && url.host === CLOUD_API_HOST.replace(/^https?:\/\//, "")) {
339
+ if (typeof url === "string" && url.startsWith("https://api.promptfoo.app") || url instanceof URL && url.host === "https://api.promptfoo.app".replace(/^https?:\/\//, "")) {
333
340
  const token = cloudConfig.getApiKey();
334
341
  opts.headers = {
335
342
  ...opts.headers || {},
@@ -354,15 +361,14 @@ async function monkeyPatchFetch(url, options) {
354
361
  response: null
355
362
  });
356
363
  if (isConnectionError(e)) {
357
- logger_default.debug(`Connection error, please check your network connectivity to the host: ${url} ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY ? `or Proxy: ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY}` : ""}`);
364
+ logger.debug(`Connection error, please check your network connectivity to the host: ${url} ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY ? `or Proxy: ${process.env.HTTP_PROXY || process.env.HTTPS_PROXY}` : ""}`);
358
365
  throw e;
359
366
  }
360
- logger_default.debug(`Error in fetch: ${JSON.stringify(e, Object.getOwnPropertyNames(e), 2)} ${e instanceof Error ? e.stack : ""}`);
367
+ logger.debug(`Error in fetch: ${JSON.stringify(e, Object.getOwnPropertyNames(e), 2)} ${e instanceof Error ? e.stack : ""}`);
361
368
  }
362
369
  throw e;
363
370
  }
364
371
  }
365
-
366
372
  //#endregion
367
373
  //#region src/util/fetch/index.ts
368
374
  let cachedAgent = null;
@@ -380,7 +386,7 @@ function getConnectionPoolSize() {
380
386
  const parsed = parseInt(envConnections, 10);
381
387
  if (!isNaN(parsed)) return parsed;
382
388
  }
383
- return cliState_default.maxConcurrency || DEFAULT_MAX_CONCURRENCY;
389
+ return state.maxConcurrency || 4;
384
390
  }
385
391
  /**
386
392
  * Clear cached agents so the next request creates fresh ones.
@@ -445,7 +451,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
445
451
  if (typeof url === "string") try {
446
452
  const parsedUrl = new URL(url);
447
453
  if (parsedUrl.username || parsedUrl.password) {
448
- if (finalOptions.headers && "Authorization" in finalOptions.headers) logger_default.warn("Both URL credentials and Authorization header present - URL credentials will be ignored");
454
+ if (finalOptions.headers && "Authorization" in finalOptions.headers) logger.warn("Both URL credentials and Authorization header present - URL credentials will be ignored");
449
455
  else {
450
456
  const username = parsedUrl.username || "";
451
457
  const password = parsedUrl.password || "";
@@ -461,20 +467,20 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
461
467
  finalUrlString = finalUrl.toString();
462
468
  }
463
469
  } catch (e) {
464
- logger_default.debug(`URL parsing failed in fetchWithProxy: ${e}`);
470
+ logger.debug(`URL parsing failed in fetchWithProxy: ${e}`);
465
471
  }
466
472
  const tlsOptions = { rejectUnauthorized: !getEnvBool("PROMPTFOO_INSECURE_SSL", true) };
467
473
  const caCertPath = getEnvString("PROMPTFOO_CA_CERT_PATH");
468
474
  if (caCertPath) try {
469
- const resolvedPath = path.resolve(cliState_default.basePath || "", caCertPath);
475
+ const resolvedPath = path.resolve(state.basePath || "", caCertPath);
470
476
  tlsOptions.ca = await fsPromises.readFile(resolvedPath, "utf8");
471
- logger_default.debug(`Using custom CA certificate from ${resolvedPath}`);
477
+ logger.debug(`Using custom CA certificate from ${resolvedPath}`);
472
478
  } catch (e) {
473
- logger_default.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
479
+ logger.warn(`Failed to read CA certificate from ${caCertPath}: ${e}`);
474
480
  }
475
481
  const proxyUrl = finalUrlString ? getProxyForUrl(finalUrlString) : "";
476
482
  if (!finalOptions.dispatcher) if (proxyUrl) {
477
- logger_default.debug(`Using proxy: ${sanitizeUrl(proxyUrl)}`);
483
+ logger.debug(`Using proxy: ${sanitizeUrl(proxyUrl)}`);
478
484
  finalOptions.dispatcher = getOrCreateProxyAgent(proxyUrl, tlsOptions);
479
485
  } else finalOptions.dispatcher = getOrCreateAgent(tlsOptions);
480
486
  const maxTransientRetries = options.disableTransientRetries ? 0 : 3;
@@ -482,7 +488,7 @@ async function fetchWithProxy(url, options = {}, abortSignal) {
482
488
  const response = await monkeyPatchFetch(finalUrl, finalOptions);
483
489
  if (!options.disableTransientRetries && isTransientError(response) && attempt < maxTransientRetries) {
484
490
  const backoffMs = Math.pow(2, attempt) * 1e3;
485
- logger_default.debug(`Transient error (${response.status} ${response.statusText}), retry ${attempt + 1}/${maxTransientRetries} after ${backoffMs}ms`);
491
+ logger.debug(`Transient error (${response.status} ${response.statusText}), retry ${attempt + 1}/${maxTransientRetries} after ${backoffMs}ms`);
486
492
  await sleep(backoffMs);
487
493
  continue;
488
494
  }
@@ -532,7 +538,7 @@ async function handleRateLimit(response) {
532
538
  const now = /* @__PURE__ */ new Date();
533
539
  waitTime = Math.max(resetTime.getTime() - now.getTime() + 1e3, 0);
534
540
  } else if (retryAfter) waitTime = Number.parseInt(retryAfter) * 1e3;
535
- logger_default.debug(`Rate limited, waiting ${waitTime}ms before retry`);
541
+ logger.debug(`Rate limited, waiting ${waitTime}ms before retry`);
536
542
  await sleep(waitTime);
537
543
  }
538
544
  /**
@@ -564,7 +570,7 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
564
570
  }, timeout);
565
571
  if (getEnvBool("PROMPTFOO_RETRY_5XX") && response.status >= 500 && response.status < 600) throw new Error(`Internal Server Error: ${response.status} ${response.statusText}`);
566
572
  if (response && isRateLimited(response)) {
567
- logger_default.debug(`Rate limited on URL ${url}: ${response.status} ${response.statusText}, attempt ${i + 1}/${maxRetries + 1}, waiting before retry...`);
573
+ logger.debug(`Rate limited on URL ${url}: ${response.status} ${response.statusText}, attempt ${i + 1}/${maxRetries + 1}, waiting before retry...`);
568
574
  lastErrorMessage = `Rate limited: ${response.status} ${response.statusText}`;
569
575
  await handleRateLimit(response);
570
576
  continue;
@@ -579,14 +585,14 @@ async function fetchWithRetries(url, options = {}, timeout, maxRetries) {
579
585
  if (typedError.cause) errorMessage += ` (Cause: ${typedError.cause})`;
580
586
  if (typedError.code) errorMessage += ` (Code: ${typedError.code})`;
581
587
  } else errorMessage = String(error);
582
- logger_default.debug(`Request to ${url} failed (attempt #${i + 1}), retrying: ${errorMessage}`);
588
+ logger.debug(`Request to ${url} failed (attempt #${i + 1}), retrying: ${errorMessage}`);
583
589
  if (i < maxRetries) await sleep(Math.pow(2, i) * (backoff + 1e3 * Math.random()));
584
590
  lastErrorMessage = errorMessage;
585
591
  }
586
592
  }
587
593
  throw new Error(`Request failed after ${maxRetries} retries: ${lastErrorMessage}`);
588
594
  }
589
-
590
595
  //#endregion
591
- export { getDefaultShareViewBaseUrl as A, CONSENT_ENDPOINT as C, R_ENDPOINT as D, EVENTS_ENDPOINT as E, FILE_METADATA_KEY as F, HUMAN_ASSERTION_TYPE as I, getShareViewBaseUrl as M, POSTHOG_KEY as N, TERMINAL_MAX_WIDTH as O, VERSION as P, CLOUD_PROVIDER_PREFIX as S, DEFAULT_QUERY_LIMIT as T, openaiToolsToBedrock as _, handleRateLimit as a, transformToolChoice as b, getCurrentTimestamp as c, REQUEST_TIMEOUT_MS as d, calculateCost as f, openaiToolChoiceToBedrock as g, isPromptfooSampleTarget as h, fetchWithTimeout as i, getShareApiBaseUrl as j, getDefaultPort as k, sleep as l, isOpenAIToolChoice as m, fetchWithProxy as n, isRateLimited as o, isOpenAIToolArray as p, fetchWithRetries as r, isTransientError as s, clearAgentCache as t, LONG_RUNNING_MODEL_TIMEOUT_MS as u, parseChatPrompt as v, DEFAULT_MAX_CONCURRENCY as w, transformTools as x, toTitleCase as y };
592
- //# sourceMappingURL=fetch-SRsE6Ctl.js.map
596
+ export { getShareApiBaseUrl as A, CLOUD_PROVIDER_PREFIX as C, TERMINAL_MAX_WIDTH as D, R_ENDPOINT as E, HUMAN_ASSERTION_TYPE as F, POSTHOG_KEY as M, VERSION as N, getDefaultPort as O, FILE_METADATA_KEY as P, transformTools as S, EVENTS_ENDPOINT as T, openaiToolChoiceToBedrock as _, handleRateLimit as a, toTitleCase as b, getCurrentTimestamp as c, LONG_RUNNING_MODEL_TIMEOUT_MS as d, REQUEST_TIMEOUT_MS as f, isPromptfooSampleTarget as g, isOpenAIToolChoice as h, fetchWithTimeout as i, getShareViewBaseUrl as j, getDefaultShareViewBaseUrl as k, sleep as l, isOpenAIToolArray as m, fetchWithProxy as n, isRateLimited as o, calculateCost as p, fetchWithRetries as r, isTransientError as s, clearAgentCache as t, sleepWithAbort as u, openaiToolsToBedrock as v, CONSENT_ENDPOINT as w, transformToolChoice as x, parseChatPrompt as y };
597
+
598
+ //# sourceMappingURL=fetch-BMv0O527.js.map