promptfoo 0.120.27 → 0.121.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/README.md +1 -1
  2. package/dist/src/{ListApp-8WOe2nT6.js → ListApp-Du7YVwj5.js} +2 -4
  3. package/dist/src/accounts-B0pgC1oV.js +206 -0
  4. package/dist/src/{accounts-DVINui-2.js → accounts-Bm2D8Db9.js} +39 -34
  5. package/dist/src/{accounts-CPDRAMND.js → accounts-CiBLOnA7.js} +38 -33
  6. package/dist/src/{accounts-Fl2J3_Fu.cjs → accounts-gtkH-5KX.cjs} +77 -78
  7. package/dist/src/{agentic-utils-D922n6mm.js → agentic-utils-DS1g3GLF.js} +9 -10
  8. package/dist/src/{agents-BcsN_BgB.js → agents-9qiOy0ho.js} +16 -12
  9. package/dist/src/{agents-BXLmVsxR.js → agents-CBr9A01V.js} +37 -37
  10. package/dist/src/{agents-pMfppv9Z.js → agents-CmvBq8LV.js} +16 -18
  11. package/dist/src/{agents-hqgSV-3o.js → agents-D__IdAlg.js} +39 -40
  12. package/dist/src/{agents-BO2n8Z0d.cjs → agents-DbRtpYxR.cjs} +37 -40
  13. package/dist/src/{agents-BdUTAwi-.js → agents-DgF2zDag.js} +37 -42
  14. package/dist/src/{agents-DgJf2-ez.cjs → agents-Di9DKPzn.cjs} +16 -17
  15. package/dist/src/{agents-DNvSH78i.js → agents-cLXA8a_8.js} +17 -19
  16. package/dist/src/{aimlapi-DtgPI0nE.js → aimlapi-B4rcnZgv.js} +15 -17
  17. package/dist/src/{aimlapi-BE_Tg9Fl.cjs → aimlapi-BvlNH0gr.cjs} +15 -16
  18. package/dist/src/{aimlapi-DOib86oE.js → aimlapi-CnkC2HqE.js} +16 -18
  19. package/dist/src/{aimlapi-DTPACCB1.js → aimlapi-DHJU_kcV.js} +15 -4
  20. package/dist/src/app/assets/index-4LKxG2CG.js +439 -0
  21. package/dist/src/app/assets/{index-NCn4eVBv.css → index-C3zcsZFQ.css} +1 -1
  22. package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +36 -0
  23. package/dist/src/app/index.html +3 -3
  24. package/dist/src/app/tsconfig.app.tsbuildinfo +1 -1
  25. package/dist/src/{audio-BnRUGAm_.js → audio-Bkv46et0.js} +6 -5
  26. package/dist/src/{audio-Cwo68yZS.cjs → audio-CGMyULza.cjs} +6 -7
  27. package/dist/src/{audio-MSRki4JU.js → audio-ClI_AFre.js} +6 -8
  28. package/dist/src/{audio-BRYU0BFo.js → audio-Dz3z7s3J.js} +7 -9
  29. package/dist/src/{base-pGVmXNl4.cjs → base-CGrhspbK.cjs} +36 -38
  30. package/dist/src/{base-h961VXYk.js → base-CpjcHe4e.js} +11 -13
  31. package/dist/src/base-DLKtKMFh.js +193 -0
  32. package/dist/src/{base-XB2tDJrB.js → base-Dy1V8--Z.js} +11 -13
  33. package/dist/src/blobs-BDbfYdrJ.js +236 -0
  34. package/dist/src/{blobs-CR5C4Ihh.js → blobs-CBO20krR.js} +9 -12
  35. package/dist/src/{blobs-BM_e6hCa.js → blobs-CMHN0Qcz.js} +9 -12
  36. package/dist/src/{blobs-B-KQAFhX.cjs → blobs-D23XLin-.cjs} +34 -37
  37. package/dist/src/{cache-jsiwsAJv.js → cache-BVeDlD87.js} +132 -117
  38. package/dist/src/{cache-CIpsoBZR.js → cache-C4Nxf52C.js} +132 -118
  39. package/dist/src/cache-CeUpFm3M.cjs +5 -0
  40. package/dist/src/{cache-BTVYfbka.cjs → cache-Dh5WtQps.cjs} +182 -168
  41. package/dist/src/cache-i1P6crbO.js +756 -0
  42. package/dist/src/cache-n-RCJ-hL.js +6 -0
  43. package/dist/src/{chat-BcPjZXIp.js → chat-BiKyneZl.js} +45 -46
  44. package/dist/src/{chat-D31K7C4u.cjs → chat-C1Qst7jL.cjs} +20 -21
  45. package/dist/src/{chat-B84t99NW.js → chat-C2jrdPMx.js} +20 -9
  46. package/dist/src/{chat-BE44YOc6.cjs → chat-CgF-J-Jj.cjs} +65 -66
  47. package/dist/src/{chat-DwWifjxi.js → chat-CzkrVDfz.js} +20 -22
  48. package/dist/src/chat-DJIw17u0.js +766 -0
  49. package/dist/src/{chat-CcUCysjU.js → chat-DqxYYtWA.js} +45 -46
  50. package/dist/src/{chat-DZM2GUHO.js → chat-qmatte1u.js} +21 -23
  51. package/dist/src/{chatkit-D67HS_0b.js → chatkit-65VXf5SR.js} +58 -58
  52. package/dist/src/{chatkit-DAB_qfzI.js → chatkit-Be-Q-a9F.js} +58 -60
  53. package/dist/src/{chatkit-Biqb_wsD.js → chatkit-BxFvW8KY.js} +58 -60
  54. package/dist/src/{chatkit-PGG4ZYIn.cjs → chatkit-DKyPi1Gs.cjs} +58 -60
  55. package/dist/src/chunk-DEq-mXcV.js +15 -0
  56. package/dist/src/chunk-DRamLcfz.js +16 -0
  57. package/dist/src/{claude-agent-sdk-SVM6AdBu.js → claude-agent-sdk-Apiy0iaz.js} +31 -31
  58. package/dist/src/{claude-agent-sdk-C-IOTPfo.js → claude-agent-sdk-D2bJee9S.js} +31 -29
  59. package/dist/src/{claude-agent-sdk-C9SiaQub.cjs → claude-agent-sdk-D9Z5Pr9X.cjs} +31 -28
  60. package/dist/src/{claude-agent-sdk-CiluSyW1.js → claude-agent-sdk-DfCoW0E6.js} +33 -20
  61. package/dist/src/cloud-BBh91EUK.js +4 -0
  62. package/dist/src/{cloud-CZ-q9Ier.js → cloud-C0dlstV_.js} +7 -9
  63. package/dist/src/{cloudflare-ai-BahKHyhh.js → cloudflare-ai-8TDxHR0x.js} +16 -18
  64. package/dist/src/{cloudflare-ai-v_qZD6_q.js → cloudflare-ai-BxAGvfju.js} +17 -19
  65. package/dist/src/{cloudflare-ai-Dfahv5SY.cjs → cloudflare-ai-CknbZ5LJ.cjs} +16 -17
  66. package/dist/src/{cloudflare-ai-Dxyt50Nl.js → cloudflare-ai-g7PB6VHR.js} +16 -4
  67. package/dist/src/{cloudflare-gateway-Bi_FpOFy.js → cloudflare-gateway-B9HWA5wf.js} +23 -23
  68. package/dist/src/{cloudflare-gateway-BPWoZIzJ.cjs → cloudflare-gateway-BSnDmHYo.cjs} +21 -22
  69. package/dist/src/{cloudflare-gateway-C0guUNwk.js → cloudflare-gateway-CKDb4dJ8.js} +26 -14
  70. package/dist/src/{cloudflare-gateway-btS7h1OZ.js → cloudflare-gateway-CP9QEWYS.js} +21 -25
  71. package/dist/src/{codex-sdk-DSxAnbfT.js → codex-sdk-C6UMlxwV.js} +28 -29
  72. package/dist/src/{codex-sdk-IYVi9fuM.js → codex-sdk-DUwKWezN.js} +28 -27
  73. package/dist/src/{codex-sdk-DulY0ZRq.js → codex-sdk-GGAw0qbD.js} +28 -29
  74. package/dist/src/{codex-sdk-DFKMtAyf.cjs → codex-sdk-fAO0c3yA.cjs} +28 -29
  75. package/dist/src/{cometapi-DzrR3SR_.js → cometapi-BL9yvj_f.js} +16 -4
  76. package/dist/src/{cometapi-DIO64tf4.cjs → cometapi-C4xSqeID.cjs} +21 -22
  77. package/dist/src/{cometapi-C9EEpJzT.js → cometapi-CUQq3H_a.js} +21 -24
  78. package/dist/src/{cometapi-DkNBMk0G.js → cometapi-DFNiKmSz.js} +17 -19
  79. package/dist/src/{completion-CG29bfKX.js → completion-5MzrpJxT.js} +11 -13
  80. package/dist/src/{completion-CCRT4kX1.cjs → completion-CM6oK8PS.cjs} +21 -23
  81. package/dist/src/{completion-Bgf1VJoq.js → completion-DZ083F31.js} +11 -13
  82. package/dist/src/completion-qRoZAYRB.js +120 -0
  83. package/dist/src/{createHash-Dw_iLu31.js → createHash-CTQmL3G2.js} +2 -3
  84. package/dist/src/{createHash-CYQy4YeL.cjs → createHash-CfZSc0b4.cjs} +13 -14
  85. package/dist/src/{createHash-CJcfskIZ.js → createHash-Da8fMwqB.js} +2 -3
  86. package/dist/src/createHash-DmPQkvBh.js +15 -0
  87. package/dist/src/{docker-D-ayp2FW.js → docker-Bb5dcxr8.js} +18 -20
  88. package/dist/src/{docker-B81N0t4e.js → docker-BvfL2BrW.js} +19 -21
  89. package/dist/src/{docker-DNcLR4Ig.cjs → docker-DcF2pRrj.cjs} +18 -19
  90. package/dist/src/{docker-egERKxCF.js → docker-ExVyLp0S.js} +18 -7
  91. package/dist/src/entrypoint.js +2 -3
  92. package/dist/src/{errors-DnGCbnx8.js → errors-P6ll7XSJ.js} +2 -2
  93. package/dist/src/{esm-B9dPm_BF.js → esm-C03C-mv3.js} +17 -20
  94. package/dist/src/{esm-D2pZ87fL.js → esm-CaIwzWR5.js} +18 -21
  95. package/dist/src/esm-Cd1AjG1D.js +379 -0
  96. package/dist/src/{esm-Ct-Joyue.cjs → esm-CnNt7sI4.cjs} +47 -49
  97. package/dist/src/eval-B3r2CVXr.js +15 -0
  98. package/dist/src/{eval-C-Nr6wX_.js → eval-Dg2nG4v2.js} +47 -54
  99. package/dist/src/evalResult-5xwYnECe.js +12 -0
  100. package/dist/src/evalResult-71lY93Kj.cjs +10 -0
  101. package/dist/src/{evalResult-DXMWJ3sx.js → evalResult-BBRNtX4I.js} +10 -11
  102. package/dist/src/{evalResult-4BzI2tmj.js → evalResult-BDMqrapS.js} +16 -12
  103. package/dist/src/evalResult-Dx5P5cIv.js +10 -0
  104. package/dist/src/{evalResult-CX8wQecI.cjs → evalResult-fuaI8HkH.cjs} +20 -21
  105. package/dist/src/{evaluator-8aGyV12L.js → evaluator-BhoWwp5b.js} +211 -235
  106. package/dist/src/evaluator-Jx6bRZV6.js +36 -0
  107. package/dist/src/{extractor-V5x_m1i0.js → extractor-C0EVHewb.js} +22 -24
  108. package/dist/src/extractor-D25qpmGX.js +374 -0
  109. package/dist/src/{extractor-CD5yKL-G.js → extractor-DReVID0K.js} +22 -24
  110. package/dist/src/{extractor-C031XmTA.cjs → extractor-pYLLi3wS.cjs} +37 -39
  111. package/dist/src/{fetch-BmbD-v1L.cjs → fetch-BPkYtG8K.cjs} +244 -277
  112. package/dist/src/fetch-BxNb_Lp3.js +5 -0
  113. package/dist/src/{fetch-D3OHf-lV.js → fetch-Cwxnd8zz.js} +36 -44
  114. package/dist/src/{fetch-CXZI9RRr.js → fetch-Dxpd4_sr.js} +23 -35
  115. package/dist/src/fetch-HaqdX7U1.js +780 -0
  116. package/dist/src/{fileExtensions-ePDqouxn.js → fileExtensions-DnqA1y9x.js} +2 -2
  117. package/dist/src/{fileExtensions-BpuMmaFL.js → fileExtensions-Ds-foDzt.js} +2 -2
  118. package/dist/src/fileExtensions-LcDYkU4v.js +85 -0
  119. package/dist/src/{fileExtensions-DkJYkWUy.cjs → fileExtensions-bYh77CN8.cjs} +27 -28
  120. package/dist/src/{formatDuration-CdevI3An.js → formatDuration-DgBVMN65.js} +2 -2
  121. package/dist/src/{genaiTracer-Ce19n68P.js → genaiTracer-70Z8BIuV.js} +2 -3
  122. package/dist/src/{genaiTracer-CqNnnXrE.js → genaiTracer-C1rxGO8Q.js} +2 -3
  123. package/dist/src/genaiTracer-D3fD9dNV.js +256 -0
  124. package/dist/src/{genaiTracer-Dres3qrN.cjs → genaiTracer-DN4dQywX.cjs} +13 -14
  125. package/dist/src/{graders--1y2u9HO.js → graders-BTeBGqjJ.js} +349 -397
  126. package/dist/src/graders-B_pgMLS2.js +34 -0
  127. package/dist/src/{graders-DTeBrzWp.js → graders-Bj_Odv7c.js} +349 -397
  128. package/dist/src/graders-DErokPDO.cjs +32 -0
  129. package/dist/src/graders-DP7KFFo-.js +13466 -0
  130. package/dist/src/graders-DR_uNe54.js +32 -0
  131. package/dist/src/{graders-DohM2dir.cjs → graders-DU49_J8Y.cjs} +684 -732
  132. package/dist/src/graders-w3176Wz-.js +32 -0
  133. package/dist/src/{image-B0U4Hqll.js → image-B02ogr_b.js} +7 -9
  134. package/dist/src/{image-DmE-niFE.js → image-B0h9VEMc.js} +6 -5
  135. package/dist/src/{image-CuKHuccK.cjs → image-BLmROtN3.cjs} +29 -30
  136. package/dist/src/{image-DNEIf_aI.js → image-Bb4vWQLM.js} +6 -8
  137. package/dist/src/{image-DpKl2F15.cjs → image-C1madmKh.cjs} +6 -7
  138. package/dist/src/{image-C3wHC9_h.js → image-CHfWvljl.js} +9 -10
  139. package/dist/src/{image-O1u4bCFg.js → image-DS-o-0ph.js} +9 -10
  140. package/dist/src/image-Dpxa1Jt6.js +257 -0
  141. package/dist/src/index.cjs +615 -695
  142. package/dist/src/index.d.cts +271 -7
  143. package/dist/src/index.d.ts +271 -3
  144. package/dist/src/index.js +580 -664
  145. package/dist/src/{interactiveCheck-Bxj1Swex.js → interactiveCheck-BgLZUIt3.js} +7 -8
  146. package/dist/src/{invariant-DT20jrBd.js → invariant-BtWWVVhl.js} +2 -2
  147. package/dist/src/{invariant-1pAf2CD1.js → invariant-Ddh24eXh.js} +2 -2
  148. package/dist/src/{invariant-CKcJAQ6M.cjs → invariant-kfQ8Bu82.cjs} +7 -8
  149. package/dist/src/invariant-vgHWClmd.js +25 -0
  150. package/dist/src/{knowledgeBase-CEzQobWX.js → knowledgeBase-B3OoKIej.js} +14 -9
  151. package/dist/src/{knowledgeBase-Be_zyW4L.js → knowledgeBase-CYTLHOt1.js} +16 -16
  152. package/dist/src/{knowledgeBase-BZ41IFwq.js → knowledgeBase-D33Ty2l6.js} +14 -18
  153. package/dist/src/{knowledgeBase-D-5BMXlr.cjs → knowledgeBase-DOO_BM9b.cjs} +14 -15
  154. package/dist/src/{litellm-DnbRJ2if.js → litellm-AaeZcZQF.js} +18 -19
  155. package/dist/src/{litellm-hUSNM_M2.cjs → litellm-I_hbp_dc.cjs} +17 -17
  156. package/dist/src/{litellm-CRDqPhNI.js → litellm-NbjknEh6.js} +17 -18
  157. package/dist/src/{litellm-9vR8zpfU.js → litellm-TrljxD9G.js} +17 -5
  158. package/dist/src/{logger-CG1uZPbQ.js → logger-CT3IKMKA.js} +10 -29
  159. package/dist/src/{logger-B7sBeGa0.cjs → logger-Cp1GPUjj.cjs} +152 -180
  160. package/dist/src/logger-DLcq4dWf.js +713 -0
  161. package/dist/src/{logger-LSBxlt7a.js → logger-KkObSCzq.js} +13 -31
  162. package/dist/src/{luma-ray-4blv9iZ2.js → luma-ray-BS2_tY8L.js} +22 -21
  163. package/dist/src/{luma-ray-drvgdpP9.js → luma-ray-DDsjcgZZ.js} +20 -13
  164. package/dist/src/{luma-ray-Hm3d6VJE.cjs → luma-ray-Due0n7di.cjs} +20 -21
  165. package/dist/src/{luma-ray-B2__8lYH.js → luma-ray-f6I2fft-.js} +20 -23
  166. package/dist/src/main.js +1170 -1321
  167. package/dist/src/{messages-Uee41Mj5.js → messages-BS17jdMx.js} +22 -24
  168. package/dist/src/{messages-XhiwCbi4.cjs → messages-Bs1kC7P4.cjs} +32 -34
  169. package/dist/src/{messages-CGPPidQr.js → messages-D0lx5qK7.js} +22 -24
  170. package/dist/src/messages-ZJk778GH.js +240 -0
  171. package/dist/src/{meteor-BYykdXrV.js → meteor-44VjEACX.js} +3 -4
  172. package/dist/src/{meteor-CsopaHrH.js → meteor-D-SotUw9.js} +3 -4
  173. package/dist/src/{meteor-e-E-2vVl.cjs → meteor-DLZZ3osF.cjs} +3 -4
  174. package/dist/src/{meteor-C8lGP6P4.js → meteor-DUiCJRC-.js} +3 -4
  175. package/dist/src/{modelslab-yKz-ZNB4.js → modelslab-Bmni6skY.js} +17 -10
  176. package/dist/src/{modelslab-E9gO-bYd.js → modelslab-Bx9IrZfS.js} +18 -20
  177. package/dist/src/{modelslab-lUVW0cmB.cjs → modelslab-CoUX6Jc_.cjs} +17 -18
  178. package/dist/src/{modelslab-ClBkr8_9.js → modelslab-DRb74SP4.js} +17 -19
  179. package/dist/src/{nova-reel-Dk8jNpId.js → nova-reel-BfPq-0Yk.js} +20 -13
  180. package/dist/src/{nova-reel-D8CuO6QH.cjs → nova-reel-C_QM18Xn.cjs} +20 -21
  181. package/dist/src/{nova-reel-u2eF2Cxm.js → nova-reel-D_W1tjMH.js} +22 -21
  182. package/dist/src/{nova-reel-P9bwvtYX.js → nova-reel-bgjxilYW.js} +20 -23
  183. package/dist/src/{nova-sonic-CK2rAiKi.js → nova-sonic-CFb5GYhg.js} +30 -26
  184. package/dist/src/{nova-sonic-BaqWlkds.js → nova-sonic-DIGQNR07.js} +30 -31
  185. package/dist/src/{nova-sonic-yZapPLv7.js → nova-sonic-De1HW5fD.js} +31 -32
  186. package/dist/src/{nova-sonic-Ds1C-dpm.cjs → nova-sonic-zfcljeRp.cjs} +30 -31
  187. package/dist/src/{openai-DUFopMrH.cjs → openai-Cuif0GEt.cjs} +8 -9
  188. package/dist/src/{openai-PblZ3jUE.js → openai-DElQ-fPX.js} +3 -4
  189. package/dist/src/{openai-CcN1B8Sb.js → openai-DhbB7eWK.js} +3 -4
  190. package/dist/src/openai-j-sE2O7r.js +44 -0
  191. package/dist/src/{openclaw-B6qqDr_u.cjs → openclaw-CSugPYAr.cjs} +188 -130
  192. package/dist/src/{openclaw-A-3_loM7.js → openclaw-DiSz3I5L.js} +180 -109
  193. package/dist/src/{openclaw-a3lylB-V.js → openclaw-DuvJKEW5.js} +178 -124
  194. package/dist/src/{openclaw-COn6QzDi.js → openclaw-tiVYRtr-.js} +178 -122
  195. package/dist/src/opencode-sdk-0j6rTWNb.js +562 -0
  196. package/dist/src/opencode-sdk-B3CWY9h_.js +560 -0
  197. package/dist/src/opencode-sdk-BL764Jdi.cjs +564 -0
  198. package/dist/src/opencode-sdk-C2y6UkP2.js +560 -0
  199. package/dist/src/{otlpReceiver-oyf5wLGC.js → otlpReceiver-C99PPb48.js} +53 -51
  200. package/dist/src/{otlpReceiver-lXsYVbpj.cjs → otlpReceiver-CGq6LspY.cjs} +53 -55
  201. package/dist/src/{otlpReceiver-94URx7UW.js → otlpReceiver-CdNBdbsk.js} +53 -55
  202. package/dist/src/{otlpReceiver-BmmTiMjA.js → otlpReceiver-D89fR-rC.js} +53 -55
  203. package/dist/src/{providerRegistry-Cq_JK_CJ.js → providerRegistry-B0RUOLI_.js} +7 -8
  204. package/dist/src/{providerRegistry-DSSHjMKf.js → providerRegistry-CD8MEar9.js} +7 -8
  205. package/dist/src/{providerRegistry-CvHEVJad.cjs → providerRegistry-Civky8Ar.cjs} +12 -13
  206. package/dist/src/providerRegistry-DM8rZYol.js +45 -0
  207. package/dist/src/providers-B7V0njNs.js +32 -0
  208. package/dist/src/providers-BEwbhv0X.js +30 -0
  209. package/dist/src/{providers-Iil64vk9.js → providers-BlqUifFg.js} +1543 -1676
  210. package/dist/src/providers-CH3C7zf7.js +30 -0
  211. package/dist/src/{providers-DHbjzW2e.cjs → providers-CgKOSgTR.cjs} +1896 -2029
  212. package/dist/src/providers-D8lF1sqW.js +33246 -0
  213. package/dist/src/{providers-BnFpbY_s.js → providers-Dk_6ocUX.js} +1536 -1669
  214. package/dist/src/providers-zyB6k_38.cjs +31 -0
  215. package/dist/src/{pythonUtils-CcT5LH1M.js → pythonUtils-C3py6GC1.js} +18 -19
  216. package/dist/src/{pythonUtils-DBbuI3QJ.cjs → pythonUtils-CTU3Y3lw.cjs} +42 -43
  217. package/dist/src/{pythonUtils-hZ8LeQLv.js → pythonUtils-D5nxkQ0P.js} +18 -19
  218. package/dist/src/pythonUtils-D6fwaDSg.js +249 -0
  219. package/dist/src/{quiverai-BuI0tE39.js → quiverai-BbOUOn2L.js} +8 -7
  220. package/dist/src/{quiverai-DCGSZt4U.js → quiverai-CIaELU_m.js} +8 -10
  221. package/dist/src/{quiverai-DiMVJQDz.cjs → quiverai-PdShCPox.cjs} +8 -9
  222. package/dist/src/{quiverai-fQNkExW4.js → quiverai-uH-dcTIr.js} +9 -11
  223. package/dist/src/{render-Dj1smHEb.js → render-Drod8m7K.js} +4 -5
  224. package/dist/src/responses-CB2jwoAr.js +660 -0
  225. package/dist/src/{responses-ghR3IOfy.cjs → responses-D8SBTL64.cjs} +39 -42
  226. package/dist/src/{responses-DOAFFENS.js → responses-DIR9Ud3j.js} +24 -27
  227. package/dist/src/{responses-CxzoQoBe.js → responses-WNGNYe3K.js} +24 -27
  228. package/dist/src/rubyUtils-BUHu6PhO.js +5 -0
  229. package/dist/src/{rubyUtils-CwbGmgYN.js → rubyUtils-BUVePouc.js} +27 -20
  230. package/dist/src/rubyUtils-BcuGX77l.js +222 -0
  231. package/dist/src/{rubyUtils-DudlFZed.js → rubyUtils-Boc4HZzX.js} +18 -19
  232. package/dist/src/rubyUtils-CP42kMvq.cjs +4 -0
  233. package/dist/src/{rubyUtils-C8MhKGHb.cjs → rubyUtils-DhCAlxZr.cjs} +48 -50
  234. package/dist/src/{sagemaker-gmskuyre.js → sagemaker-CNBxx5CJ.js} +75 -70
  235. package/dist/src/{sagemaker-CcxhlOAR.js → sagemaker-CemTFp2h.js} +75 -79
  236. package/dist/src/{sagemaker-77zbJ2Q2.cjs → sagemaker-Cl28mZU2.cjs} +75 -76
  237. package/dist/src/{sagemaker-DuM71dVU.js → sagemaker-YSyBXQQh.js} +77 -77
  238. package/dist/src/{scanner-DJYiSXQj.js → scanner-BsBlNXNn.js} +100 -121
  239. package/dist/src/server/index.js +5520 -67427
  240. package/dist/src/{server-B5v33lvE.cjs → server-C_7Ax-hA.cjs} +57 -67
  241. package/dist/src/{server-BJ4m4f1D.js → server-CqzrVGpF.js} +26 -29
  242. package/dist/src/server-CuxBbeSY.js +229 -0
  243. package/dist/src/server-DA4Cyrrq.js +7 -0
  244. package/dist/src/server-Dulb-4-K.cjs +5 -0
  245. package/dist/src/{server-RV_i_YX5.js → server-VWgWb00X.js} +19 -24
  246. package/dist/src/{signal-BW33JuId.js → signal-4U3mfRvL.js} +9 -11
  247. package/dist/src/{slack-DEURelTy.cjs → slack-BmVAVGaK.cjs} +7 -8
  248. package/dist/src/{slack-BQYeW9L3.js → slack-DCUPTzS2.js} +8 -8
  249. package/dist/src/{slack-BB6yuZzp.js → slack-DOdy_kyv.js} +7 -8
  250. package/dist/src/{slack-2pRrhhgJ.js → slack-DXMKtA-f.js} +7 -9
  251. package/dist/src/store-CXGFv4aR.js +228 -0
  252. package/dist/src/store-CXS-Q_91.js +6 -0
  253. package/dist/src/{store-D7CgQzAR.cjs → store-DLlFCC4h.cjs} +44 -45
  254. package/dist/src/{store-DJNsD1iC.js → store-DXilxTl-.js} +40 -36
  255. package/dist/src/{store-s3SftUwF.js → store-Dim__MDd.js} +34 -35
  256. package/dist/src/store-eYkaKMwq.cjs +5 -0
  257. package/dist/src/{tables-DfTsNN7X.js → tables-6YKwjN9-.js} +19 -21
  258. package/dist/src/tables-DLJPUdUE.js +288 -0
  259. package/dist/src/{tables-BKTmd6u7.cjs → tables-DPi7wKeM.cjs} +89 -91
  260. package/dist/src/{tables-DMegD0Xf.js → tables-gftXzE9I.js} +21 -23
  261. package/dist/src/telemetry-BpMfhthR.cjs +5 -0
  262. package/dist/src/{telemetry--WAdAfVi.js → telemetry-CMrFgtPB.js} +11 -13
  263. package/dist/src/telemetry-Cps3mIU-.js +171 -0
  264. package/dist/src/{telemetry-DQgVBCAb.cjs → telemetry-DaX14Chu.cjs} +21 -24
  265. package/dist/src/{telemetry-BedSm-bZ.js → telemetry-Dthj_BbD.js} +17 -14
  266. package/dist/src/telemetry-Dw38hanS.js +7 -0
  267. package/dist/src/{text-oiSbwSOI.js → text-B_UCRPp2.js} +2 -2
  268. package/dist/src/{text-oKzCBnK6.cjs → text-CW1cyrwj.cjs} +12 -13
  269. package/dist/src/{text-B_IrO4GZ.js → text-Db-Wt2u2.js} +2 -2
  270. package/dist/src/text-TIv0QYnd.js +22 -0
  271. package/dist/src/{tokenUsageUtils-FZd5O_4A.js → tokenUsageUtils-BDGe-iyI.js} +2 -2
  272. package/dist/src/{tokenUsageUtils-DmZSD2eU.js → tokenUsageUtils-DflFMjS0.js} +2 -2
  273. package/dist/src/tokenUsageUtils-NYT-WKS6.js +138 -0
  274. package/dist/src/{tokenUsageUtils-CXhxVj72.cjs → tokenUsageUtils-bVa1ga6f.cjs} +32 -33
  275. package/dist/src/{transcription-mYS9vd5v.js → transcription-BNYURcXg.js} +14 -7
  276. package/dist/src/{transcription-X2-B4vkX.js → transcription-B_OdaHp7.js} +14 -16
  277. package/dist/src/{transcription-BO1AHegO.cjs → transcription-NLVG9MT1.cjs} +14 -15
  278. package/dist/src/{transcription-lzBLiTFJ.js → transcription-s6A-bNrZ.js} +15 -17
  279. package/dist/src/{transform-B1Hi5lWS.cjs → transform-CzK1Q0zl.cjs} +24 -26
  280. package/dist/src/{transform-DeGlxb0D.js → transform-D5HsjduX.js} +39 -47
  281. package/dist/src/{transform-CYDILYDe.js → transform-DECvGmzp.js} +15 -13
  282. package/dist/src/transform-DTGDnAzW.js +6 -0
  283. package/dist/src/{transform-BEgStbHK.js → transform-DilY9wbS.js} +10 -12
  284. package/dist/src/{transform-D5PjiWiZ.cjs → transform-DuHvhZpj.cjs} +179 -187
  285. package/dist/src/transform-aa6tmVpZ.js +216 -0
  286. package/dist/src/transform-m3qNw4KP.cjs +5 -0
  287. package/dist/src/transform-uAytVuyX.js +1506 -0
  288. package/dist/src/{transform-Dfl89yi4.js → transform-vNucnNr0.js} +39 -47
  289. package/dist/src/{transformersAvailability-SZnTS3pJ.js → transformersAvailability-CEVM2GNQ.js} +2 -2
  290. package/dist/src/{transformersAvailability-D-glmEy7.cjs → transformersAvailability-CwayUSlh.cjs} +2 -3
  291. package/dist/src/{transformersAvailability-CjeFXhuJ.js → transformersAvailability-D6c6ROpT.js} +2 -2
  292. package/dist/src/{types-DWNf48sT.cjs → types-C_7nyzr1.cjs} +538 -574
  293. package/dist/src/{types-CXQduE9o.js → types-Cbd8uOMq.js} +68 -100
  294. package/dist/src/types-CzW2QFyi.js +3288 -0
  295. package/dist/src/{types-C5hEkb-x.js → types-DmyIJ-sR.js} +63 -99
  296. package/dist/src/{util-CoQjmE3u.js → util-B3xGByQh.js} +4 -5
  297. package/dist/src/{util-aLhtl3fe.cjs → util-B9vlHIIh.cjs} +208 -223
  298. package/dist/src/{util-Du96oyYS.js → util-BHGHw5G1.js} +4 -5
  299. package/dist/src/{util-DQ984syk.js → util-BRYkYPTd.js} +36 -51
  300. package/dist/src/{util-D9eLdGfa.js → util-BV4XUC0n.js} +5 -6
  301. package/dist/src/util-Bv6uGDfH.js +293 -0
  302. package/dist/src/{util-1wWM599Z.cjs → util-BzMcevZc.cjs} +50 -51
  303. package/dist/src/{util-_h4pVqrz.js → util-C1CeHl-P.js} +36 -51
  304. package/dist/src/{util-Bm_-UMD_.js → util-CMy69ZgQ.js} +5 -6
  305. package/dist/src/{util-CyUdMzV0.cjs → util-DGNOS1db.cjs} +34 -35
  306. package/dist/src/util-Dnmk2mBQ.js +599 -0
  307. package/dist/src/util-ZzmqNPlg.js +1426 -0
  308. package/dist/src/{utils-BjLy-Q72.cjs → utils-Cz9qXqII.cjs} +29 -32
  309. package/dist/src/{utils-CFMn2yHW.js → utils-XiOAgly5.js} +4 -7
  310. package/dist/src/utils-dLokC-eR.js +94 -0
  311. package/dist/src/{utils-DvWMzuMx.js → utils-f2-Moju7.js} +4 -7
  312. package/dist/tsconfig.tsbuildinfo +1 -1
  313. package/package.json +38 -38
  314. package/dist/src/app/assets/index-B2D0bCSI.js +0 -439
  315. package/dist/src/app/assets/vendor-charts-CCl15Imd.js +0 -36
  316. package/dist/src/cache-ChPcurj7.js +0 -6
  317. package/dist/src/cache-VVu_W-yg.js +0 -8
  318. package/dist/src/cache-YLNCFEM2.cjs +0 -6
  319. package/dist/src/chunk-DHDDz29n.js +0 -22
  320. package/dist/src/chunk-FhC4c-0y.js +0 -21
  321. package/dist/src/cloud-BndfXy4H.js +0 -5
  322. package/dist/src/eval-BhHvMY82.js +0 -17
  323. package/dist/src/evalResult-Dq2gFNQY.js +0 -12
  324. package/dist/src/evalResult-nmcP5VKH.cjs +0 -12
  325. package/dist/src/evalResult-trqZjVYh.js +0 -14
  326. package/dist/src/evaluator-CnfPstzT.js +0 -39
  327. package/dist/src/fetch-IDPDue6F.cjs +0 -4
  328. package/dist/src/fetch-hKJ-It8q.js +0 -6
  329. package/dist/src/fetch-ouKnrWK-.js +0 -4
  330. package/dist/src/graders-CQn7WUsd.cjs +0 -34
  331. package/dist/src/graders-DC6QAbpW.js +0 -35
  332. package/dist/src/graders-DUWz3Y7j.js +0 -37
  333. package/dist/src/opencode-sdk-4bL9n-Gk.js +0 -382
  334. package/dist/src/opencode-sdk-BfC2zWcR.js +0 -376
  335. package/dist/src/opencode-sdk-DMJyuwMg.js +0 -380
  336. package/dist/src/opencode-sdk-Da-9adza.cjs +0 -383
  337. package/dist/src/providers-CsXB2Ix-.js +0 -35
  338. package/dist/src/providers-DO8ltjLC.js +0 -33
  339. package/dist/src/providers-Dtq-xnXd.cjs +0 -33
  340. package/dist/src/rubyUtils-BUbcND2f.js +0 -6
  341. package/dist/src/rubyUtils-Cr55X_KE.js +0 -5
  342. package/dist/src/rubyUtils-DlIiqoYo.cjs +0 -5
  343. package/dist/src/server-C2eQH4Gu.js +0 -6
  344. package/dist/src/server-CXWycu7H.cjs +0 -6
  345. package/dist/src/server-Q6OGlxxT.js +0 -8
  346. package/dist/src/store-B3EDO9Q3.js +0 -7
  347. package/dist/src/store-Dl9F8aw5.js +0 -6
  348. package/dist/src/store-SnrGrlt9.cjs +0 -6
  349. package/dist/src/telemetry-BGhiPZtl.js +0 -8
  350. package/dist/src/telemetry-CFfiYan6.cjs +0 -6
  351. package/dist/src/telemetry-DHzEduxX.js +0 -6
  352. package/dist/src/transform-C1x1ZlMQ.cjs +0 -6
  353. package/dist/src/transform-DYHjFmQu.js +0 -8
  354. package/dist/src/transform-rmwJT5JQ.js +0 -7
  355. package/dist/src/transformersAvailability-eJooj0gX.js +0 -35
@@ -1,15 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { t as __exportAll } from "./chunk-DHDDz29n.js";
3
- import { C as getEnvString, S as getEnvInt, b as getEnvBool, o as logger_default, v as getConfigDirectoryPath } from "./logger-LSBxlt7a.js";
4
- import { f as REQUEST_TIMEOUT_MS, l as sleep, r as fetchWithRetries } from "./fetch-CXZI9RRr.js";
5
- import { r as isTransientConnectionError } from "./errors-DnGCbnx8.js";
2
+ import { t as __exportAll } from "./chunk-DRamLcfz.js";
3
+ import { C as getEnvString, S as getEnvInt, b as getEnvBool, o as logger, v as getConfigDirectoryPath } from "./logger-KkObSCzq.js";
4
+ import { f as REQUEST_TIMEOUT_MS, l as sleep, r as fetchWithRetries } from "./fetch-Dxpd4_sr.js";
5
+ import { r as isTransientConnectionError } from "./errors-P6ll7XSJ.js";
6
6
  import fs from "fs";
7
7
  import path from "path";
8
8
  import { createCache } from "cache-manager";
9
9
  import { Keyv } from "keyv";
10
10
  import { KeyvFile } from "keyv-file";
11
11
  import { randomBytes } from "crypto";
12
-
13
12
  //#region src/cacheMigration.ts
14
13
  /**
15
14
  * Migration sunset date: After this date, skip migration entirely.
@@ -41,7 +40,7 @@ function getDirSize(dirPath) {
41
40
  else totalSize += fs.statSync(itemPath).size;
42
41
  }
43
42
  } catch (err) {
44
- if (err.code !== "ENOENT") logger_default.warn(`[Cache Migration] Error calculating directory size: ${err.message}`);
43
+ if (err.code !== "ENOENT") logger.warn(`[Cache Migration] Error calculating directory size: ${err.message}`);
45
44
  }
46
45
  return totalSize;
47
46
  }
@@ -56,18 +55,18 @@ function checkDiskSpace(cachePath) {
56
55
  const stats = fs.statfsSync(cachePath);
57
56
  const availableBytes = stats.bavail * stats.bsize;
58
57
  const requiredBytes = cacheSize * 2 + 10 * 1024 * 1024;
59
- logger_default.debug(`[Cache Migration] Disk space check: need ${(requiredBytes / 1024 / 1024).toFixed(2)}MB, have ${(availableBytes / 1024 / 1024).toFixed(2)}MB available`);
58
+ logger.debug(`[Cache Migration] Disk space check: need ${(requiredBytes / 1024 / 1024).toFixed(2)}MB, have ${(availableBytes / 1024 / 1024).toFixed(2)}MB available`);
60
59
  if (availableBytes < requiredBytes) {
61
- logger_default.error(`[Cache Migration] Insufficient disk space for migration. Need ${(requiredBytes / 1024 / 1024).toFixed(0)}MB, have ${(availableBytes / 1024 / 1024).toFixed(0)}MB available.`);
60
+ logger.error(`[Cache Migration] Insufficient disk space for migration. Need ${(requiredBytes / 1024 / 1024).toFixed(0)}MB, have ${(availableBytes / 1024 / 1024).toFixed(0)}MB available.`);
62
61
  return false;
63
62
  }
64
63
  return true;
65
64
  } else {
66
- logger_default.debug("[Cache Migration] Disk space check not available on this platform, proceeding");
65
+ logger.debug("[Cache Migration] Disk space check not available on this platform, proceeding");
67
66
  return true;
68
67
  }
69
68
  } catch (err) {
70
- logger_default.warn(`[Cache Migration] Could not check disk space: ${err.message}`);
69
+ logger.warn(`[Cache Migration] Could not check disk space: ${err.message}`);
71
70
  return true;
72
71
  }
73
72
  }
@@ -93,7 +92,7 @@ function isProcessRunning(pid) {
93
92
  */
94
93
  function acquireMigrationLock(cachePath, attempt = 1) {
95
94
  if (attempt > MAX_LOCK_ATTEMPTS) {
96
- logger_default.warn(`[Cache Migration] Failed to acquire lock after ${MAX_LOCK_ATTEMPTS} attempts`);
95
+ logger.warn(`[Cache Migration] Failed to acquire lock after ${MAX_LOCK_ATTEMPTS} attempts`);
97
96
  return null;
98
97
  }
99
98
  const lockFile = path.join(cachePath, ".migration.lock");
@@ -102,7 +101,7 @@ function acquireMigrationLock(cachePath, attempt = 1) {
102
101
  const fd = fs.openSync(lockFile, "wx");
103
102
  fs.writeSync(fd, process.pid.toString());
104
103
  fs.fsyncSync(fd);
105
- logger_default.debug(`[Cache Migration] Lock acquired (PID: ${process.pid})`);
104
+ logger.debug(`[Cache Migration] Lock acquired (PID: ${process.pid})`);
106
105
  return fd;
107
106
  } catch (err) {
108
107
  if (err.code === "EEXIST") {
@@ -111,20 +110,20 @@ function acquireMigrationLock(cachePath, attempt = 1) {
111
110
  const pid = parseInt(content, 10);
112
111
  if (!isNaN(pid)) {
113
112
  if (isProcessRunning(pid)) {
114
- logger_default.info(`[Cache Migration] Another migration is in progress (PID: ${pid})`);
113
+ logger.info(`[Cache Migration] Another migration is in progress (PID: ${pid})`);
115
114
  return null;
116
115
  }
117
- logger_default.warn(`[Cache Migration] Removing stale lock file (PID: ${pid} not found)`);
116
+ logger.warn(`[Cache Migration] Removing stale lock file (PID: ${pid} not found)`);
118
117
  try {
119
118
  fs.unlinkSync(lockFile);
120
119
  return acquireMigrationLock(cachePath, attempt + 1);
121
120
  } catch (unlinkErr) {
122
- logger_default.error(`[Cache Migration] Failed to remove stale lock: ${unlinkErr.message}`);
121
+ logger.error(`[Cache Migration] Failed to remove stale lock: ${unlinkErr.message}`);
123
122
  return null;
124
123
  }
125
124
  }
126
125
  } catch (readErr) {
127
- logger_default.warn(`[Cache Migration] Could not read lock file: ${readErr.message}`);
126
+ logger.warn(`[Cache Migration] Could not read lock file: ${readErr.message}`);
128
127
  }
129
128
  return null;
130
129
  }
@@ -140,13 +139,13 @@ function releaseMigrationLock(fd, cachePath) {
140
139
  try {
141
140
  fs.closeSync(fd);
142
141
  } catch (err) {
143
- logger_default.warn(`[Cache Migration] Failed to close lock file: ${err.message}`);
142
+ logger.warn(`[Cache Migration] Failed to close lock file: ${err.message}`);
144
143
  }
145
144
  try {
146
145
  fs.unlinkSync(lockFile);
147
- logger_default.debug("[Cache Migration] Lock released");
146
+ logger.debug("[Cache Migration] Lock released");
148
147
  } catch (err) {
149
- logger_default.warn(`[Cache Migration] Failed to remove lock file: ${err.message}`);
148
+ logger.warn(`[Cache Migration] Failed to remove lock file: ${err.message}`);
150
149
  }
151
150
  }
152
151
  /**
@@ -179,28 +178,28 @@ function readOldCacheEntries(cachePath) {
179
178
  };
180
179
  const entries = /* @__PURE__ */ new Map();
181
180
  if (!fs.existsSync(cachePath)) {
182
- logger_default.info(`[Cache Migration] No old cache directory found at ${cachePath}`);
181
+ logger.info(`[Cache Migration] No old cache directory found at ${cachePath}`);
183
182
  return {
184
183
  entries,
185
184
  stats
186
185
  };
187
186
  }
188
187
  const diskstoreDirs = fs.readdirSync(cachePath, { withFileTypes: true }).filter((dirEntry) => dirEntry.isDirectory() && dirEntry.name.startsWith("diskstore-")).map((dirEntry) => dirEntry.name);
189
- logger_default.info(`[Cache Migration] Found ${diskstoreDirs.length} diskstore directories`);
188
+ logger.info(`[Cache Migration] Found ${diskstoreDirs.length} diskstore directories`);
190
189
  const shouldLogProgress = diskstoreDirs.length > 100;
191
- if (shouldLogProgress) logger_default.info(`[Cache Migration] Processing large cache, this may take a moment...`);
190
+ if (shouldLogProgress) logger.info(`[Cache Migration] Processing large cache, this may take a moment...`);
192
191
  const now = Date.now();
193
192
  let dirCount = 0;
194
193
  for (const dir of diskstoreDirs) {
195
194
  const dirPath = path.join(cachePath, dir);
196
195
  dirCount++;
197
- if (shouldLogProgress && dirCount % 100 === 0) logger_default.info(`[Cache Migration] Processed ${dirCount}/${diskstoreDirs.length} directories...`);
196
+ if (shouldLogProgress && dirCount % 100 === 0) logger.info(`[Cache Migration] Processed ${dirCount}/${diskstoreDirs.length} directories...`);
198
197
  try {
199
198
  const jsonFiles = fs.readdirSync(dirPath).filter((f) => f.endsWith(".json"));
200
199
  for (const file of jsonFiles) {
201
200
  const filePath = path.join(dirPath, file);
202
201
  stats.totalFiles++;
203
- if (stats.totalFiles % 1e3 === 0 && stats.totalFiles > 0) logger_default.info(`[Cache Migration] Processed ${stats.totalFiles} files...`);
202
+ if (stats.totalFiles % 1e3 === 0 && stats.totalFiles > 0) logger.info(`[Cache Migration] Processed ${stats.totalFiles} files...`);
204
203
  try {
205
204
  const content = fs.readFileSync(filePath, "utf-8");
206
205
  const oldEntry = JSON.parse(content);
@@ -251,7 +250,7 @@ function validateCacheFile(cachePath, expectedEntryCount) {
251
250
  if (!Array.isArray(parsed.cache)) throw new Error("Cache file has invalid structure: missing or invalid \"cache\" array");
252
251
  if (typeof parsed.lastExpire !== "number") throw new Error("Cache file has invalid structure: missing or invalid \"lastExpire\" field");
253
252
  if (parsed.cache.length !== expectedEntryCount) throw new Error(`Cache file entry count mismatch: expected ${expectedEntryCount}, got ${parsed.cache.length}`);
254
- logger_default.debug(`[Cache Migration] Validated cache file: ${cachePath} (${expectedEntryCount} entries)`);
253
+ logger.debug(`[Cache Migration] Validated cache file: ${cachePath} (${expectedEntryCount} entries)`);
255
254
  }
256
255
  /**
257
256
  * Write entries in keyv-file format using atomic write operation.
@@ -275,7 +274,7 @@ function writeNewCacheFile(entries, newCachePath) {
275
274
  }
276
275
  fs.writeFileSync(tempFile, serialized, "utf-8");
277
276
  fs.renameSync(tempFile, newCachePath);
278
- logger_default.debug(`[Cache Migration] Atomically wrote cache file: ${newCachePath}`);
277
+ logger.debug(`[Cache Migration] Atomically wrote cache file: ${newCachePath}`);
279
278
  validateCacheFile(newCachePath, entries.size);
280
279
  } catch (err) {
281
280
  try {
@@ -289,7 +288,7 @@ function writeNewCacheFile(entries, newCachePath) {
289
288
  */
290
289
  function createBackup(cachePath) {
291
290
  const backupPath = `${cachePath}.backup.${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`;
292
- logger_default.info(`[Cache Migration] Creating backup at ${backupPath}`);
291
+ logger.info(`[Cache Migration] Creating backup at ${backupPath}`);
293
292
  if (fs.existsSync(cachePath)) fs.cpSync(cachePath, backupPath, { recursive: true });
294
293
  return backupPath;
295
294
  }
@@ -317,11 +316,11 @@ function isMigrationComplete(cacheBasePath, newCacheFile) {
317
316
  if (newCacheFile && fs.existsSync(newCacheFile)) return true;
318
317
  if (newCacheFile) {
319
318
  if (hasOldCacheFormat(cacheBasePath)) {
320
- logger_default.warn("[Cache Migration] Marker file exists but migration appears incomplete. Old cache format found but new cache missing. Retrying migration...");
319
+ logger.warn("[Cache Migration] Marker file exists but migration appears incomplete. Old cache format found but new cache missing. Retrying migration...");
321
320
  try {
322
321
  fs.unlinkSync(markerPath);
323
322
  } catch (err) {
324
- logger_default.warn(`[Cache Migration] Failed to remove stale marker: ${err.message}`);
323
+ logger.warn(`[Cache Migration] Failed to remove stale marker: ${err.message}`);
325
324
  }
326
325
  return false;
327
326
  }
@@ -353,7 +352,7 @@ function cleanupOldCache(cachePath) {
353
352
  throw err;
354
353
  }
355
354
  const diskstoreDirs = dirEntries.filter((dirEntry) => dirEntry.isDirectory() && dirEntry.name.startsWith("diskstore-")).map((dirEntry) => dirEntry.name);
356
- logger_default.info(`[Cache Migration] Cleaning up ${diskstoreDirs.length} old cache directories`);
355
+ logger.info(`[Cache Migration] Cleaning up ${diskstoreDirs.length} old cache directories`);
357
356
  for (const dir of diskstoreDirs) {
358
357
  const dirPath = path.join(cachePath, dir);
359
358
  try {
@@ -362,7 +361,7 @@ function cleanupOldCache(cachePath) {
362
361
  force: true
363
362
  });
364
363
  } catch (err) {
365
- logger_default.warn(`[Cache Migration] Failed to remove ${dirPath}: ${err.message}`);
364
+ logger.warn(`[Cache Migration] Failed to remove ${dirPath}: ${err.message}`);
366
365
  }
367
366
  }
368
367
  }
@@ -372,23 +371,23 @@ function cleanupOldCache(cachePath) {
372
371
  */
373
372
  function cleanupBackup(backupPath, stats) {
374
373
  if (stats.successCount === 0 && stats.failureCount === 0) {
375
- logger_default.info(`[Cache Migration] No valid entries found (${stats.skippedExpired} expired only). Removing backup to save space.`);
374
+ logger.info(`[Cache Migration] No valid entries found (${stats.skippedExpired} expired only). Removing backup to save space.`);
376
375
  try {
377
376
  fs.rmSync(backupPath, {
378
377
  recursive: true,
379
378
  force: true
380
379
  });
381
- logger_default.info(`[Cache Migration] Backup removed: ${backupPath}`);
380
+ logger.info(`[Cache Migration] Backup removed: ${backupPath}`);
382
381
  return true;
383
382
  } catch (err) {
384
- logger_default.warn(`[Cache Migration] Failed to remove backup ${backupPath}: ${err.message}`);
383
+ logger.warn(`[Cache Migration] Failed to remove backup ${backupPath}: ${err.message}`);
385
384
  return false;
386
385
  }
387
386
  } else if (stats.failureCount > 0) {
388
- logger_default.info(`[Cache Migration] Backup kept at ${backupPath} due to ${stats.failureCount} migration errors. You may want to investigate these failures.`);
387
+ logger.info(`[Cache Migration] Backup kept at ${backupPath} due to ${stats.failureCount} migration errors. You may want to investigate these failures.`);
389
388
  return false;
390
389
  } else {
391
- logger_default.info(`[Cache Migration] Backup kept at ${backupPath} (migrated ${stats.successCount} valid entries). You can manually delete this backup if you no longer need it.`);
390
+ logger.info(`[Cache Migration] Backup kept at ${backupPath} (migrated ${stats.successCount} valid entries). You can manually delete this backup if you no longer need it.`);
392
391
  return false;
393
392
  }
394
393
  }
@@ -397,10 +396,10 @@ function cleanupBackup(backupPath, stats) {
397
396
  * Migrates cache from cache-manager v4 (cache-manager-fs-hash) to v7 (keyv-file)
398
397
  */
399
398
  function runMigration(cachePath, newCacheFilePath) {
400
- logger_default.info("[Cache Migration] Starting cache migration from v4 to v7");
399
+ logger.info("[Cache Migration] Starting cache migration from v4 to v7");
401
400
  const lock = acquireMigrationLock(cachePath);
402
401
  if (lock === null) {
403
- logger_default.info("[Cache Migration] Another migration is in progress, skipping");
402
+ logger.info("[Cache Migration] Another migration is in progress, skipping");
404
403
  return {
405
404
  success: true,
406
405
  stats: {
@@ -414,7 +413,7 @@ function runMigration(cachePath, newCacheFilePath) {
414
413
  }
415
414
  try {
416
415
  if (isMigrationComplete(cachePath, newCacheFilePath)) {
417
- logger_default.info("[Cache Migration] Migration already completed, skipping");
416
+ logger.info("[Cache Migration] Migration already completed, skipping");
418
417
  return {
419
418
  success: true,
420
419
  stats: {
@@ -427,7 +426,7 @@ function runMigration(cachePath, newCacheFilePath) {
427
426
  };
428
427
  }
429
428
  if (!hasOldCacheFormat(cachePath)) {
430
- logger_default.info("[Cache Migration] No old cache format detected, skipping migration");
429
+ logger.info("[Cache Migration] No old cache format detected, skipping migration");
431
430
  markMigrationComplete(cachePath, {
432
431
  totalFiles: 0,
433
432
  successCount: 0,
@@ -447,7 +446,7 @@ function runMigration(cachePath, newCacheFilePath) {
447
446
  };
448
447
  }
449
448
  if (!checkDiskSpace(cachePath)) {
450
- logger_default.error("[Cache Migration] Insufficient disk space, aborting migration");
449
+ logger.error("[Cache Migration] Insufficient disk space, aborting migration");
451
450
  return {
452
451
  success: false,
453
452
  stats: {
@@ -460,30 +459,30 @@ function runMigration(cachePath, newCacheFilePath) {
460
459
  };
461
460
  }
462
461
  const backupPath = createBackup(cachePath);
463
- logger_default.info("[Cache Migration] Reading old cache entries");
462
+ logger.info("[Cache Migration] Reading old cache entries");
464
463
  const { entries, stats } = readOldCacheEntries(cachePath);
465
- logger_default.info(`[Cache Migration] Read ${stats.successCount} entries (${stats.failureCount} failures, ${stats.skippedExpired} expired)`);
464
+ logger.info(`[Cache Migration] Read ${stats.successCount} entries (${stats.failureCount} failures, ${stats.skippedExpired} expired)`);
466
465
  if (stats.errors.length > 0) {
467
- logger_default.warn(`[Cache Migration] Encountered ${stats.errors.length} errors:`);
468
- stats.errors.slice(0, 10).forEach((err) => logger_default.warn(` - ${err}`));
469
- if (stats.errors.length > 10) logger_default.warn(` ... and ${stats.errors.length - 10} more errors`);
466
+ logger.warn(`[Cache Migration] Encountered ${stats.errors.length} errors:`);
467
+ stats.errors.slice(0, 10).forEach((err) => logger.warn(` - ${err}`));
468
+ if (stats.errors.length > 10) logger.warn(` ... and ${stats.errors.length - 10} more errors`);
470
469
  }
471
470
  if (entries.size > 0) {
472
- logger_default.info(`[Cache Migration] Writing ${entries.size} entries to new cache file: ${newCacheFilePath}`);
471
+ logger.info(`[Cache Migration] Writing ${entries.size} entries to new cache file: ${newCacheFilePath}`);
473
472
  writeNewCacheFile(entries, newCacheFilePath);
474
- } else logger_default.info("[Cache Migration] No entries to migrate");
473
+ } else logger.info("[Cache Migration] No entries to migrate");
475
474
  cleanupOldCache(cachePath);
476
475
  const backupDeleted = cleanupBackup(backupPath, stats);
477
476
  markMigrationComplete(cachePath, stats);
478
- logger_default.info("[Cache Migration] Migration completed successfully");
477
+ logger.info("[Cache Migration] Migration completed successfully");
479
478
  return {
480
479
  success: true,
481
480
  stats,
482
481
  backupPath: backupDeleted ? void 0 : backupPath
483
482
  };
484
483
  } catch (err) {
485
- logger_default.error(`[Cache Migration] Migration failed: ${err.message}`);
486
- logger_default.error(`[Cache Migration] Stack trace: ${err.stack}`);
484
+ logger.error(`[Cache Migration] Migration failed: ${err.message}`);
485
+ logger.error(`[Cache Migration] Stack trace: ${err.stack}`);
487
486
  return {
488
487
  success: false,
489
488
  stats: {
@@ -510,7 +509,6 @@ function shouldRunMigration(cachePath, newCacheFile) {
510
509
  if (isMigrationComplete(cachePath, newCacheFile)) return false;
511
510
  return hasOldCacheFormat(cachePath);
512
511
  }
513
-
514
512
  //#endregion
515
513
  //#region src/cache.ts
516
514
  var cache_exports = /* @__PURE__ */ __exportAll({
@@ -541,23 +539,23 @@ function getCache() {
541
539
  if (cacheType === "disk" && enabled) {
542
540
  cachePath = getEnvString("PROMPTFOO_CACHE_PATH") || path.join(getConfigDirectoryPath(), "cache");
543
541
  if (!fs.existsSync(cachePath)) {
544
- logger_default.info(`Creating cache folder at ${cachePath}.`);
542
+ logger.info(`Creating cache folder at ${cachePath}.`);
545
543
  fs.mkdirSync(cachePath, { recursive: true });
546
544
  }
547
545
  const newCacheFile = path.join(cachePath, "cache.json");
548
546
  if (shouldRunMigration(cachePath, newCacheFile)) {
549
- logger_default.info("[Cache] Migrating cache from v4 to v7...");
547
+ logger.info("[Cache] Migrating cache from v4 to v7...");
550
548
  try {
551
549
  const result = runMigration(cachePath, newCacheFile);
552
550
  if (result.success) {
553
- logger_default.info(`[Cache] Migration completed: ${result.stats.successCount} entries migrated, ${result.stats.skippedExpired} expired`);
554
- if (result.backupPath) logger_default.info(`[Cache] Backup kept at: ${result.backupPath}`);
551
+ logger.info(`[Cache] Migration completed: ${result.stats.successCount} entries migrated, ${result.stats.skippedExpired} expired`);
552
+ if (result.backupPath) logger.info(`[Cache] Backup kept at: ${result.backupPath}`);
555
553
  } else {
556
- logger_default.error(`[Cache] Migration failed: ${result.stats.errors.join(", ")}. Falling back to memory cache.`);
554
+ logger.error(`[Cache] Migration failed: ${result.stats.errors.join(", ")}. Falling back to memory cache.`);
557
555
  migrationFailed = true;
558
556
  }
559
557
  } catch (err) {
560
- logger_default.error(`[Cache] Migration error: ${err.message}. Falling back to memory cache.`);
558
+ logger.error(`[Cache] Migration error: ${err.message}. Falling back to memory cache.`);
561
559
  migrationFailed = true;
562
560
  }
563
561
  }
@@ -568,7 +566,7 @@ function getCache() {
568
566
  });
569
567
  stores.push(keyv);
570
568
  } catch (err) {
571
- logger_default.warn(`[Cache] Failed to initialize disk cache: ${err.message}. Using memory cache instead.`);
569
+ logger.warn(`[Cache] Failed to initialize disk cache: ${err.message}. Using memory cache instead.`);
572
570
  }
573
571
  }
574
572
  cacheInstance = createCache({
@@ -579,6 +577,31 @@ function getCache() {
579
577
  }
580
578
  return cacheInstance;
581
579
  }
580
+ const inflightFetchResponses = /* @__PURE__ */ new Map();
581
+ function serializeFetchResponse(data, status, statusText, headers, latencyMs) {
582
+ return JSON.stringify({
583
+ data,
584
+ status,
585
+ statusText,
586
+ headers,
587
+ latencyMs
588
+ });
589
+ }
590
+ function deserializeFetchResponse(response, cached, cache, cacheKey) {
591
+ const parsedResponse = JSON.parse(response);
592
+ return {
593
+ cached,
594
+ data: parsedResponse.data,
595
+ status: parsedResponse.status,
596
+ statusText: parsedResponse.statusText,
597
+ headers: parsedResponse.headers,
598
+ latencyMs: parsedResponse.latencyMs,
599
+ deleteFromCache: async () => {
600
+ await cache.del(cacheKey);
601
+ logger.debug(`Evicted from cache: ${cacheKey}`);
602
+ }
603
+ };
604
+ }
582
605
  async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent) {
583
606
  const maxBodyRetries = isIdempotent ? 2 : 0;
584
607
  for (let bodyAttempt = 0; bodyAttempt <= maxBodyRetries; bodyAttempt++) {
@@ -594,7 +617,7 @@ async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent)
594
617
  } catch (err) {
595
618
  if (isTransientConnectionError(err) && bodyAttempt < maxBodyRetries) {
596
619
  const backoffMs = Math.pow(2, bodyAttempt) * 1e3;
597
- logger_default.debug("[Cache] Body stream failed with transient error, retrying", {
620
+ logger.debug("[Cache] Body stream failed with transient error, retrying", {
598
621
  attempt: bodyAttempt + 1,
599
622
  maxRetries: maxBodyRetries,
600
623
  backoffMs,
@@ -608,6 +631,35 @@ async function fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent)
608
631
  }
609
632
  throw new Error("Exhausted body retries without returning or throwing");
610
633
  }
634
+ async function prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format) {
635
+ const result = await fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent);
636
+ const response = result.resp;
637
+ const responseText = result.respText;
638
+ const fetchLatencyMs = result.fetchLatencyMs;
639
+ const headers = Object.fromEntries(response.headers.entries());
640
+ try {
641
+ const parsedData = format === "json" ? JSON.parse(responseText) : responseText;
642
+ const serializedResponse = serializeFetchResponse(parsedData, response.status, response.statusText, headers, fetchLatencyMs);
643
+ if (!response.ok) return {
644
+ response: responseText === "" ? serializeFetchResponse(`Empty Response: ${response.status}: ${response.statusText}`, response.status, response.statusText, headers, fetchLatencyMs) : serializedResponse,
645
+ cacheable: false
646
+ };
647
+ if (format === "json" && parsedData?.error) {
648
+ logger.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
649
+ return {
650
+ response: serializedResponse,
651
+ cacheable: false
652
+ };
653
+ }
654
+ logger.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${serializedResponse}`);
655
+ return {
656
+ response: serializedResponse,
657
+ cacheable: true
658
+ };
659
+ } catch (err) {
660
+ throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
661
+ }
662
+ }
611
663
  async function fetchWithCache(url, options = {}, timeout = REQUEST_TIMEOUT_MS, format = "json", bust = false, maxRetries) {
612
664
  const method = (options.method ?? (url instanceof Request ? url.method : "GET")).toUpperCase();
613
665
  const isIdempotent = [
@@ -637,61 +689,23 @@ async function fetchWithCache(url, options = {}, timeout = REQUEST_TIMEOUT_MS, f
637
689
  delete copy.headers;
638
690
  const cacheKey = `fetch:v2:${url}:${JSON.stringify(copy)}`;
639
691
  const cache = await getCache();
640
- let cached = true;
641
- let errorResponse = null;
642
- let fetchLatencyMs;
643
- const cachedResponse = await cache.wrap(cacheKey, async () => {
644
- cached = false;
645
- const result = await fetchAndReadBody(url, options, timeout, maxRetries, isIdempotent);
646
- const response = result.resp;
647
- const responseText = result.respText;
648
- fetchLatencyMs = result.fetchLatencyMs;
649
- const headers = Object.fromEntries(response.headers.entries());
650
- try {
651
- const parsedData = format === "json" ? JSON.parse(responseText) : responseText;
652
- const data = JSON.stringify({
653
- data: parsedData,
654
- status: response.status,
655
- statusText: response.statusText,
656
- headers,
657
- latencyMs: fetchLatencyMs
658
- });
659
- if (!response.ok) {
660
- if (responseText == "") errorResponse = JSON.stringify({
661
- data: `Empty Response: ${response.status}: ${response.statusText}`,
662
- status: response.status,
663
- statusText: response.statusText,
664
- headers,
665
- latencyMs: fetchLatencyMs
666
- });
667
- else errorResponse = data;
668
- return;
669
- }
670
- if (!data) return;
671
- if (format === "json" && parsedData?.error) {
672
- logger_default.debug(`Not caching ${url} because it contains an 'error' key: ${parsedData.error}`);
673
- return data;
674
- }
675
- logger_default.debug(`Storing ${url} response in cache with latencyMs=${fetchLatencyMs}: ${data}`);
676
- return data;
677
- } catch (err) {
678
- throw new Error(`Error parsing response from ${url}: ${err.message}. Received text: ${responseText}`);
679
- }
680
- });
681
- if (cached && cachedResponse) logger_default.debug(`Returning cached response for ${url}: ${cachedResponse}`);
682
- const parsedResponse = JSON.parse(cachedResponse ?? errorResponse);
683
- return {
684
- cached,
685
- data: parsedResponse.data,
686
- status: parsedResponse.status,
687
- statusText: parsedResponse.statusText,
688
- headers: parsedResponse.headers,
689
- latencyMs: parsedResponse.latencyMs,
690
- deleteFromCache: async () => {
691
- await cache.del(cacheKey);
692
- logger_default.debug(`Evicted from cache: ${cacheKey}`);
693
- }
694
- };
692
+ const cachedResponse = await cache.get(cacheKey);
693
+ if (cachedResponse != null) {
694
+ logger.debug(`Returning cached response for ${url}: ${cachedResponse}`);
695
+ return deserializeFetchResponse(cachedResponse, true, cache, cacheKey);
696
+ }
697
+ let inflightResponse = inflightFetchResponses.get(cacheKey);
698
+ if (!inflightResponse) {
699
+ inflightResponse = (async () => {
700
+ const preparedResponse = await prepareFetchResponse(url, options, timeout, maxRetries, isIdempotent, format);
701
+ if (preparedResponse.cacheable) await cache.set(cacheKey, preparedResponse.response);
702
+ return preparedResponse.response;
703
+ })().finally(() => {
704
+ inflightFetchResponses.delete(cacheKey);
705
+ });
706
+ inflightFetchResponses.set(cacheKey, inflightResponse);
707
+ }
708
+ return deserializeFetchResponse(await inflightResponse, false, cache, cacheKey);
695
709
  }
696
710
  function enableCache() {
697
711
  enabled = true;
@@ -700,12 +714,13 @@ function disableCache() {
700
714
  enabled = false;
701
715
  }
702
716
  async function clearCache() {
717
+ inflightFetchResponses.clear();
703
718
  return getCache().clear();
704
719
  }
705
720
  function isCacheEnabled() {
706
721
  return enabled;
707
722
  }
708
-
709
723
  //#endregion
710
724
  export { fetchWithCache as a, enableCache as i, clearCache as n, getCache as o, disableCache as r, isCacheEnabled as s, cache_exports as t };
711
- //# sourceMappingURL=cache-jsiwsAJv.js.map
725
+
726
+ //# sourceMappingURL=cache-BVeDlD87.js.map