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.
- package/README.md +1 -1
- package/dist/src/{ListApp-8WOe2nT6.js → ListApp-Du7YVwj5.js} +2 -4
- package/dist/src/accounts-B0pgC1oV.js +206 -0
- package/dist/src/{accounts-DVINui-2.js → accounts-Bm2D8Db9.js} +39 -34
- package/dist/src/{accounts-CPDRAMND.js → accounts-CiBLOnA7.js} +38 -33
- package/dist/src/{accounts-Fl2J3_Fu.cjs → accounts-gtkH-5KX.cjs} +77 -78
- package/dist/src/{agentic-utils-D922n6mm.js → agentic-utils-DS1g3GLF.js} +9 -10
- package/dist/src/{agents-BcsN_BgB.js → agents-9qiOy0ho.js} +16 -12
- package/dist/src/{agents-BXLmVsxR.js → agents-CBr9A01V.js} +37 -37
- package/dist/src/{agents-pMfppv9Z.js → agents-CmvBq8LV.js} +16 -18
- package/dist/src/{agents-hqgSV-3o.js → agents-D__IdAlg.js} +39 -40
- package/dist/src/{agents-BO2n8Z0d.cjs → agents-DbRtpYxR.cjs} +37 -40
- package/dist/src/{agents-BdUTAwi-.js → agents-DgF2zDag.js} +37 -42
- package/dist/src/{agents-DgJf2-ez.cjs → agents-Di9DKPzn.cjs} +16 -17
- package/dist/src/{agents-DNvSH78i.js → agents-cLXA8a_8.js} +17 -19
- package/dist/src/{aimlapi-DtgPI0nE.js → aimlapi-B4rcnZgv.js} +15 -17
- package/dist/src/{aimlapi-BE_Tg9Fl.cjs → aimlapi-BvlNH0gr.cjs} +15 -16
- package/dist/src/{aimlapi-DOib86oE.js → aimlapi-CnkC2HqE.js} +16 -18
- package/dist/src/{aimlapi-DTPACCB1.js → aimlapi-DHJU_kcV.js} +15 -4
- package/dist/src/app/assets/index-4LKxG2CG.js +439 -0
- package/dist/src/app/assets/{index-NCn4eVBv.css → index-C3zcsZFQ.css} +1 -1
- package/dist/src/app/assets/vendor-charts-BnDWwBlI.js +36 -0
- package/dist/src/app/index.html +3 -3
- package/dist/src/app/tsconfig.app.tsbuildinfo +1 -1
- package/dist/src/{audio-BnRUGAm_.js → audio-Bkv46et0.js} +6 -5
- package/dist/src/{audio-Cwo68yZS.cjs → audio-CGMyULza.cjs} +6 -7
- package/dist/src/{audio-MSRki4JU.js → audio-ClI_AFre.js} +6 -8
- package/dist/src/{audio-BRYU0BFo.js → audio-Dz3z7s3J.js} +7 -9
- package/dist/src/{base-pGVmXNl4.cjs → base-CGrhspbK.cjs} +36 -38
- package/dist/src/{base-h961VXYk.js → base-CpjcHe4e.js} +11 -13
- package/dist/src/base-DLKtKMFh.js +193 -0
- package/dist/src/{base-XB2tDJrB.js → base-Dy1V8--Z.js} +11 -13
- package/dist/src/blobs-BDbfYdrJ.js +236 -0
- package/dist/src/{blobs-CR5C4Ihh.js → blobs-CBO20krR.js} +9 -12
- package/dist/src/{blobs-BM_e6hCa.js → blobs-CMHN0Qcz.js} +9 -12
- package/dist/src/{blobs-B-KQAFhX.cjs → blobs-D23XLin-.cjs} +34 -37
- package/dist/src/{cache-jsiwsAJv.js → cache-BVeDlD87.js} +132 -117
- package/dist/src/{cache-CIpsoBZR.js → cache-C4Nxf52C.js} +132 -118
- package/dist/src/cache-CeUpFm3M.cjs +5 -0
- package/dist/src/{cache-BTVYfbka.cjs → cache-Dh5WtQps.cjs} +182 -168
- package/dist/src/cache-i1P6crbO.js +756 -0
- package/dist/src/cache-n-RCJ-hL.js +6 -0
- package/dist/src/{chat-BcPjZXIp.js → chat-BiKyneZl.js} +45 -46
- package/dist/src/{chat-D31K7C4u.cjs → chat-C1Qst7jL.cjs} +20 -21
- package/dist/src/{chat-B84t99NW.js → chat-C2jrdPMx.js} +20 -9
- package/dist/src/{chat-BE44YOc6.cjs → chat-CgF-J-Jj.cjs} +65 -66
- package/dist/src/{chat-DwWifjxi.js → chat-CzkrVDfz.js} +20 -22
- package/dist/src/chat-DJIw17u0.js +766 -0
- package/dist/src/{chat-CcUCysjU.js → chat-DqxYYtWA.js} +45 -46
- package/dist/src/{chat-DZM2GUHO.js → chat-qmatte1u.js} +21 -23
- package/dist/src/{chatkit-D67HS_0b.js → chatkit-65VXf5SR.js} +58 -58
- package/dist/src/{chatkit-DAB_qfzI.js → chatkit-Be-Q-a9F.js} +58 -60
- package/dist/src/{chatkit-Biqb_wsD.js → chatkit-BxFvW8KY.js} +58 -60
- package/dist/src/{chatkit-PGG4ZYIn.cjs → chatkit-DKyPi1Gs.cjs} +58 -60
- package/dist/src/chunk-DEq-mXcV.js +15 -0
- package/dist/src/chunk-DRamLcfz.js +16 -0
- package/dist/src/{claude-agent-sdk-SVM6AdBu.js → claude-agent-sdk-Apiy0iaz.js} +31 -31
- package/dist/src/{claude-agent-sdk-C-IOTPfo.js → claude-agent-sdk-D2bJee9S.js} +31 -29
- package/dist/src/{claude-agent-sdk-C9SiaQub.cjs → claude-agent-sdk-D9Z5Pr9X.cjs} +31 -28
- package/dist/src/{claude-agent-sdk-CiluSyW1.js → claude-agent-sdk-DfCoW0E6.js} +33 -20
- package/dist/src/cloud-BBh91EUK.js +4 -0
- package/dist/src/{cloud-CZ-q9Ier.js → cloud-C0dlstV_.js} +7 -9
- package/dist/src/{cloudflare-ai-BahKHyhh.js → cloudflare-ai-8TDxHR0x.js} +16 -18
- package/dist/src/{cloudflare-ai-v_qZD6_q.js → cloudflare-ai-BxAGvfju.js} +17 -19
- package/dist/src/{cloudflare-ai-Dfahv5SY.cjs → cloudflare-ai-CknbZ5LJ.cjs} +16 -17
- package/dist/src/{cloudflare-ai-Dxyt50Nl.js → cloudflare-ai-g7PB6VHR.js} +16 -4
- package/dist/src/{cloudflare-gateway-Bi_FpOFy.js → cloudflare-gateway-B9HWA5wf.js} +23 -23
- package/dist/src/{cloudflare-gateway-BPWoZIzJ.cjs → cloudflare-gateway-BSnDmHYo.cjs} +21 -22
- package/dist/src/{cloudflare-gateway-C0guUNwk.js → cloudflare-gateway-CKDb4dJ8.js} +26 -14
- package/dist/src/{cloudflare-gateway-btS7h1OZ.js → cloudflare-gateway-CP9QEWYS.js} +21 -25
- package/dist/src/{codex-sdk-DSxAnbfT.js → codex-sdk-C6UMlxwV.js} +28 -29
- package/dist/src/{codex-sdk-IYVi9fuM.js → codex-sdk-DUwKWezN.js} +28 -27
- package/dist/src/{codex-sdk-DulY0ZRq.js → codex-sdk-GGAw0qbD.js} +28 -29
- package/dist/src/{codex-sdk-DFKMtAyf.cjs → codex-sdk-fAO0c3yA.cjs} +28 -29
- package/dist/src/{cometapi-DzrR3SR_.js → cometapi-BL9yvj_f.js} +16 -4
- package/dist/src/{cometapi-DIO64tf4.cjs → cometapi-C4xSqeID.cjs} +21 -22
- package/dist/src/{cometapi-C9EEpJzT.js → cometapi-CUQq3H_a.js} +21 -24
- package/dist/src/{cometapi-DkNBMk0G.js → cometapi-DFNiKmSz.js} +17 -19
- package/dist/src/{completion-CG29bfKX.js → completion-5MzrpJxT.js} +11 -13
- package/dist/src/{completion-CCRT4kX1.cjs → completion-CM6oK8PS.cjs} +21 -23
- package/dist/src/{completion-Bgf1VJoq.js → completion-DZ083F31.js} +11 -13
- package/dist/src/completion-qRoZAYRB.js +120 -0
- package/dist/src/{createHash-Dw_iLu31.js → createHash-CTQmL3G2.js} +2 -3
- package/dist/src/{createHash-CYQy4YeL.cjs → createHash-CfZSc0b4.cjs} +13 -14
- package/dist/src/{createHash-CJcfskIZ.js → createHash-Da8fMwqB.js} +2 -3
- package/dist/src/createHash-DmPQkvBh.js +15 -0
- package/dist/src/{docker-D-ayp2FW.js → docker-Bb5dcxr8.js} +18 -20
- package/dist/src/{docker-B81N0t4e.js → docker-BvfL2BrW.js} +19 -21
- package/dist/src/{docker-DNcLR4Ig.cjs → docker-DcF2pRrj.cjs} +18 -19
- package/dist/src/{docker-egERKxCF.js → docker-ExVyLp0S.js} +18 -7
- package/dist/src/entrypoint.js +2 -3
- package/dist/src/{errors-DnGCbnx8.js → errors-P6ll7XSJ.js} +2 -2
- package/dist/src/{esm-B9dPm_BF.js → esm-C03C-mv3.js} +17 -20
- package/dist/src/{esm-D2pZ87fL.js → esm-CaIwzWR5.js} +18 -21
- package/dist/src/esm-Cd1AjG1D.js +379 -0
- package/dist/src/{esm-Ct-Joyue.cjs → esm-CnNt7sI4.cjs} +47 -49
- package/dist/src/eval-B3r2CVXr.js +15 -0
- package/dist/src/{eval-C-Nr6wX_.js → eval-Dg2nG4v2.js} +47 -54
- package/dist/src/evalResult-5xwYnECe.js +12 -0
- package/dist/src/evalResult-71lY93Kj.cjs +10 -0
- package/dist/src/{evalResult-DXMWJ3sx.js → evalResult-BBRNtX4I.js} +10 -11
- package/dist/src/{evalResult-4BzI2tmj.js → evalResult-BDMqrapS.js} +16 -12
- package/dist/src/evalResult-Dx5P5cIv.js +10 -0
- package/dist/src/{evalResult-CX8wQecI.cjs → evalResult-fuaI8HkH.cjs} +20 -21
- package/dist/src/{evaluator-8aGyV12L.js → evaluator-BhoWwp5b.js} +211 -235
- package/dist/src/evaluator-Jx6bRZV6.js +36 -0
- package/dist/src/{extractor-V5x_m1i0.js → extractor-C0EVHewb.js} +22 -24
- package/dist/src/extractor-D25qpmGX.js +374 -0
- package/dist/src/{extractor-CD5yKL-G.js → extractor-DReVID0K.js} +22 -24
- package/dist/src/{extractor-C031XmTA.cjs → extractor-pYLLi3wS.cjs} +37 -39
- package/dist/src/{fetch-BmbD-v1L.cjs → fetch-BPkYtG8K.cjs} +244 -277
- package/dist/src/fetch-BxNb_Lp3.js +5 -0
- package/dist/src/{fetch-D3OHf-lV.js → fetch-Cwxnd8zz.js} +36 -44
- package/dist/src/{fetch-CXZI9RRr.js → fetch-Dxpd4_sr.js} +23 -35
- package/dist/src/fetch-HaqdX7U1.js +780 -0
- package/dist/src/{fileExtensions-ePDqouxn.js → fileExtensions-DnqA1y9x.js} +2 -2
- package/dist/src/{fileExtensions-BpuMmaFL.js → fileExtensions-Ds-foDzt.js} +2 -2
- package/dist/src/fileExtensions-LcDYkU4v.js +85 -0
- package/dist/src/{fileExtensions-DkJYkWUy.cjs → fileExtensions-bYh77CN8.cjs} +27 -28
- package/dist/src/{formatDuration-CdevI3An.js → formatDuration-DgBVMN65.js} +2 -2
- package/dist/src/{genaiTracer-Ce19n68P.js → genaiTracer-70Z8BIuV.js} +2 -3
- package/dist/src/{genaiTracer-CqNnnXrE.js → genaiTracer-C1rxGO8Q.js} +2 -3
- package/dist/src/genaiTracer-D3fD9dNV.js +256 -0
- package/dist/src/{genaiTracer-Dres3qrN.cjs → genaiTracer-DN4dQywX.cjs} +13 -14
- package/dist/src/{graders--1y2u9HO.js → graders-BTeBGqjJ.js} +349 -397
- package/dist/src/graders-B_pgMLS2.js +34 -0
- package/dist/src/{graders-DTeBrzWp.js → graders-Bj_Odv7c.js} +349 -397
- package/dist/src/graders-DErokPDO.cjs +32 -0
- package/dist/src/graders-DP7KFFo-.js +13466 -0
- package/dist/src/graders-DR_uNe54.js +32 -0
- package/dist/src/{graders-DohM2dir.cjs → graders-DU49_J8Y.cjs} +684 -732
- package/dist/src/graders-w3176Wz-.js +32 -0
- package/dist/src/{image-B0U4Hqll.js → image-B02ogr_b.js} +7 -9
- package/dist/src/{image-DmE-niFE.js → image-B0h9VEMc.js} +6 -5
- package/dist/src/{image-CuKHuccK.cjs → image-BLmROtN3.cjs} +29 -30
- package/dist/src/{image-DNEIf_aI.js → image-Bb4vWQLM.js} +6 -8
- package/dist/src/{image-DpKl2F15.cjs → image-C1madmKh.cjs} +6 -7
- package/dist/src/{image-C3wHC9_h.js → image-CHfWvljl.js} +9 -10
- package/dist/src/{image-O1u4bCFg.js → image-DS-o-0ph.js} +9 -10
- package/dist/src/image-Dpxa1Jt6.js +257 -0
- package/dist/src/index.cjs +615 -695
- package/dist/src/index.d.cts +271 -7
- package/dist/src/index.d.ts +271 -3
- package/dist/src/index.js +580 -664
- package/dist/src/{interactiveCheck-Bxj1Swex.js → interactiveCheck-BgLZUIt3.js} +7 -8
- package/dist/src/{invariant-DT20jrBd.js → invariant-BtWWVVhl.js} +2 -2
- package/dist/src/{invariant-1pAf2CD1.js → invariant-Ddh24eXh.js} +2 -2
- package/dist/src/{invariant-CKcJAQ6M.cjs → invariant-kfQ8Bu82.cjs} +7 -8
- package/dist/src/invariant-vgHWClmd.js +25 -0
- package/dist/src/{knowledgeBase-CEzQobWX.js → knowledgeBase-B3OoKIej.js} +14 -9
- package/dist/src/{knowledgeBase-Be_zyW4L.js → knowledgeBase-CYTLHOt1.js} +16 -16
- package/dist/src/{knowledgeBase-BZ41IFwq.js → knowledgeBase-D33Ty2l6.js} +14 -18
- package/dist/src/{knowledgeBase-D-5BMXlr.cjs → knowledgeBase-DOO_BM9b.cjs} +14 -15
- package/dist/src/{litellm-DnbRJ2if.js → litellm-AaeZcZQF.js} +18 -19
- package/dist/src/{litellm-hUSNM_M2.cjs → litellm-I_hbp_dc.cjs} +17 -17
- package/dist/src/{litellm-CRDqPhNI.js → litellm-NbjknEh6.js} +17 -18
- package/dist/src/{litellm-9vR8zpfU.js → litellm-TrljxD9G.js} +17 -5
- package/dist/src/{logger-CG1uZPbQ.js → logger-CT3IKMKA.js} +10 -29
- package/dist/src/{logger-B7sBeGa0.cjs → logger-Cp1GPUjj.cjs} +152 -180
- package/dist/src/logger-DLcq4dWf.js +713 -0
- package/dist/src/{logger-LSBxlt7a.js → logger-KkObSCzq.js} +13 -31
- package/dist/src/{luma-ray-4blv9iZ2.js → luma-ray-BS2_tY8L.js} +22 -21
- package/dist/src/{luma-ray-drvgdpP9.js → luma-ray-DDsjcgZZ.js} +20 -13
- package/dist/src/{luma-ray-Hm3d6VJE.cjs → luma-ray-Due0n7di.cjs} +20 -21
- package/dist/src/{luma-ray-B2__8lYH.js → luma-ray-f6I2fft-.js} +20 -23
- package/dist/src/main.js +1170 -1321
- package/dist/src/{messages-Uee41Mj5.js → messages-BS17jdMx.js} +22 -24
- package/dist/src/{messages-XhiwCbi4.cjs → messages-Bs1kC7P4.cjs} +32 -34
- package/dist/src/{messages-CGPPidQr.js → messages-D0lx5qK7.js} +22 -24
- package/dist/src/messages-ZJk778GH.js +240 -0
- package/dist/src/{meteor-BYykdXrV.js → meteor-44VjEACX.js} +3 -4
- package/dist/src/{meteor-CsopaHrH.js → meteor-D-SotUw9.js} +3 -4
- package/dist/src/{meteor-e-E-2vVl.cjs → meteor-DLZZ3osF.cjs} +3 -4
- package/dist/src/{meteor-C8lGP6P4.js → meteor-DUiCJRC-.js} +3 -4
- package/dist/src/{modelslab-yKz-ZNB4.js → modelslab-Bmni6skY.js} +17 -10
- package/dist/src/{modelslab-E9gO-bYd.js → modelslab-Bx9IrZfS.js} +18 -20
- package/dist/src/{modelslab-lUVW0cmB.cjs → modelslab-CoUX6Jc_.cjs} +17 -18
- package/dist/src/{modelslab-ClBkr8_9.js → modelslab-DRb74SP4.js} +17 -19
- package/dist/src/{nova-reel-Dk8jNpId.js → nova-reel-BfPq-0Yk.js} +20 -13
- package/dist/src/{nova-reel-D8CuO6QH.cjs → nova-reel-C_QM18Xn.cjs} +20 -21
- package/dist/src/{nova-reel-u2eF2Cxm.js → nova-reel-D_W1tjMH.js} +22 -21
- package/dist/src/{nova-reel-P9bwvtYX.js → nova-reel-bgjxilYW.js} +20 -23
- package/dist/src/{nova-sonic-CK2rAiKi.js → nova-sonic-CFb5GYhg.js} +30 -26
- package/dist/src/{nova-sonic-BaqWlkds.js → nova-sonic-DIGQNR07.js} +30 -31
- package/dist/src/{nova-sonic-yZapPLv7.js → nova-sonic-De1HW5fD.js} +31 -32
- package/dist/src/{nova-sonic-Ds1C-dpm.cjs → nova-sonic-zfcljeRp.cjs} +30 -31
- package/dist/src/{openai-DUFopMrH.cjs → openai-Cuif0GEt.cjs} +8 -9
- package/dist/src/{openai-PblZ3jUE.js → openai-DElQ-fPX.js} +3 -4
- package/dist/src/{openai-CcN1B8Sb.js → openai-DhbB7eWK.js} +3 -4
- package/dist/src/openai-j-sE2O7r.js +44 -0
- package/dist/src/{openclaw-B6qqDr_u.cjs → openclaw-CSugPYAr.cjs} +188 -130
- package/dist/src/{openclaw-A-3_loM7.js → openclaw-DiSz3I5L.js} +180 -109
- package/dist/src/{openclaw-a3lylB-V.js → openclaw-DuvJKEW5.js} +178 -124
- package/dist/src/{openclaw-COn6QzDi.js → openclaw-tiVYRtr-.js} +178 -122
- package/dist/src/opencode-sdk-0j6rTWNb.js +562 -0
- package/dist/src/opencode-sdk-B3CWY9h_.js +560 -0
- package/dist/src/opencode-sdk-BL764Jdi.cjs +564 -0
- package/dist/src/opencode-sdk-C2y6UkP2.js +560 -0
- package/dist/src/{otlpReceiver-oyf5wLGC.js → otlpReceiver-C99PPb48.js} +53 -51
- package/dist/src/{otlpReceiver-lXsYVbpj.cjs → otlpReceiver-CGq6LspY.cjs} +53 -55
- package/dist/src/{otlpReceiver-94URx7UW.js → otlpReceiver-CdNBdbsk.js} +53 -55
- package/dist/src/{otlpReceiver-BmmTiMjA.js → otlpReceiver-D89fR-rC.js} +53 -55
- package/dist/src/{providerRegistry-Cq_JK_CJ.js → providerRegistry-B0RUOLI_.js} +7 -8
- package/dist/src/{providerRegistry-DSSHjMKf.js → providerRegistry-CD8MEar9.js} +7 -8
- package/dist/src/{providerRegistry-CvHEVJad.cjs → providerRegistry-Civky8Ar.cjs} +12 -13
- package/dist/src/providerRegistry-DM8rZYol.js +45 -0
- package/dist/src/providers-B7V0njNs.js +32 -0
- package/dist/src/providers-BEwbhv0X.js +30 -0
- package/dist/src/{providers-Iil64vk9.js → providers-BlqUifFg.js} +1543 -1676
- package/dist/src/providers-CH3C7zf7.js +30 -0
- package/dist/src/{providers-DHbjzW2e.cjs → providers-CgKOSgTR.cjs} +1896 -2029
- package/dist/src/providers-D8lF1sqW.js +33246 -0
- package/dist/src/{providers-BnFpbY_s.js → providers-Dk_6ocUX.js} +1536 -1669
- package/dist/src/providers-zyB6k_38.cjs +31 -0
- package/dist/src/{pythonUtils-CcT5LH1M.js → pythonUtils-C3py6GC1.js} +18 -19
- package/dist/src/{pythonUtils-DBbuI3QJ.cjs → pythonUtils-CTU3Y3lw.cjs} +42 -43
- package/dist/src/{pythonUtils-hZ8LeQLv.js → pythonUtils-D5nxkQ0P.js} +18 -19
- package/dist/src/pythonUtils-D6fwaDSg.js +249 -0
- package/dist/src/{quiverai-BuI0tE39.js → quiverai-BbOUOn2L.js} +8 -7
- package/dist/src/{quiverai-DCGSZt4U.js → quiverai-CIaELU_m.js} +8 -10
- package/dist/src/{quiverai-DiMVJQDz.cjs → quiverai-PdShCPox.cjs} +8 -9
- package/dist/src/{quiverai-fQNkExW4.js → quiverai-uH-dcTIr.js} +9 -11
- package/dist/src/{render-Dj1smHEb.js → render-Drod8m7K.js} +4 -5
- package/dist/src/responses-CB2jwoAr.js +660 -0
- package/dist/src/{responses-ghR3IOfy.cjs → responses-D8SBTL64.cjs} +39 -42
- package/dist/src/{responses-DOAFFENS.js → responses-DIR9Ud3j.js} +24 -27
- package/dist/src/{responses-CxzoQoBe.js → responses-WNGNYe3K.js} +24 -27
- package/dist/src/rubyUtils-BUHu6PhO.js +5 -0
- package/dist/src/{rubyUtils-CwbGmgYN.js → rubyUtils-BUVePouc.js} +27 -20
- package/dist/src/rubyUtils-BcuGX77l.js +222 -0
- package/dist/src/{rubyUtils-DudlFZed.js → rubyUtils-Boc4HZzX.js} +18 -19
- package/dist/src/rubyUtils-CP42kMvq.cjs +4 -0
- package/dist/src/{rubyUtils-C8MhKGHb.cjs → rubyUtils-DhCAlxZr.cjs} +48 -50
- package/dist/src/{sagemaker-gmskuyre.js → sagemaker-CNBxx5CJ.js} +75 -70
- package/dist/src/{sagemaker-CcxhlOAR.js → sagemaker-CemTFp2h.js} +75 -79
- package/dist/src/{sagemaker-77zbJ2Q2.cjs → sagemaker-Cl28mZU2.cjs} +75 -76
- package/dist/src/{sagemaker-DuM71dVU.js → sagemaker-YSyBXQQh.js} +77 -77
- package/dist/src/{scanner-DJYiSXQj.js → scanner-BsBlNXNn.js} +100 -121
- package/dist/src/server/index.js +5520 -67427
- package/dist/src/{server-B5v33lvE.cjs → server-C_7Ax-hA.cjs} +57 -67
- package/dist/src/{server-BJ4m4f1D.js → server-CqzrVGpF.js} +26 -29
- package/dist/src/server-CuxBbeSY.js +229 -0
- package/dist/src/server-DA4Cyrrq.js +7 -0
- package/dist/src/server-Dulb-4-K.cjs +5 -0
- package/dist/src/{server-RV_i_YX5.js → server-VWgWb00X.js} +19 -24
- package/dist/src/{signal-BW33JuId.js → signal-4U3mfRvL.js} +9 -11
- package/dist/src/{slack-DEURelTy.cjs → slack-BmVAVGaK.cjs} +7 -8
- package/dist/src/{slack-BQYeW9L3.js → slack-DCUPTzS2.js} +8 -8
- package/dist/src/{slack-BB6yuZzp.js → slack-DOdy_kyv.js} +7 -8
- package/dist/src/{slack-2pRrhhgJ.js → slack-DXMKtA-f.js} +7 -9
- package/dist/src/store-CXGFv4aR.js +228 -0
- package/dist/src/store-CXS-Q_91.js +6 -0
- package/dist/src/{store-D7CgQzAR.cjs → store-DLlFCC4h.cjs} +44 -45
- package/dist/src/{store-DJNsD1iC.js → store-DXilxTl-.js} +40 -36
- package/dist/src/{store-s3SftUwF.js → store-Dim__MDd.js} +34 -35
- package/dist/src/store-eYkaKMwq.cjs +5 -0
- package/dist/src/{tables-DfTsNN7X.js → tables-6YKwjN9-.js} +19 -21
- package/dist/src/tables-DLJPUdUE.js +288 -0
- package/dist/src/{tables-BKTmd6u7.cjs → tables-DPi7wKeM.cjs} +89 -91
- package/dist/src/{tables-DMegD0Xf.js → tables-gftXzE9I.js} +21 -23
- package/dist/src/telemetry-BpMfhthR.cjs +5 -0
- package/dist/src/{telemetry--WAdAfVi.js → telemetry-CMrFgtPB.js} +11 -13
- package/dist/src/telemetry-Cps3mIU-.js +171 -0
- package/dist/src/{telemetry-DQgVBCAb.cjs → telemetry-DaX14Chu.cjs} +21 -24
- package/dist/src/{telemetry-BedSm-bZ.js → telemetry-Dthj_BbD.js} +17 -14
- package/dist/src/telemetry-Dw38hanS.js +7 -0
- package/dist/src/{text-oiSbwSOI.js → text-B_UCRPp2.js} +2 -2
- package/dist/src/{text-oKzCBnK6.cjs → text-CW1cyrwj.cjs} +12 -13
- package/dist/src/{text-B_IrO4GZ.js → text-Db-Wt2u2.js} +2 -2
- package/dist/src/text-TIv0QYnd.js +22 -0
- package/dist/src/{tokenUsageUtils-FZd5O_4A.js → tokenUsageUtils-BDGe-iyI.js} +2 -2
- package/dist/src/{tokenUsageUtils-DmZSD2eU.js → tokenUsageUtils-DflFMjS0.js} +2 -2
- package/dist/src/tokenUsageUtils-NYT-WKS6.js +138 -0
- package/dist/src/{tokenUsageUtils-CXhxVj72.cjs → tokenUsageUtils-bVa1ga6f.cjs} +32 -33
- package/dist/src/{transcription-mYS9vd5v.js → transcription-BNYURcXg.js} +14 -7
- package/dist/src/{transcription-X2-B4vkX.js → transcription-B_OdaHp7.js} +14 -16
- package/dist/src/{transcription-BO1AHegO.cjs → transcription-NLVG9MT1.cjs} +14 -15
- package/dist/src/{transcription-lzBLiTFJ.js → transcription-s6A-bNrZ.js} +15 -17
- package/dist/src/{transform-B1Hi5lWS.cjs → transform-CzK1Q0zl.cjs} +24 -26
- package/dist/src/{transform-DeGlxb0D.js → transform-D5HsjduX.js} +39 -47
- package/dist/src/{transform-CYDILYDe.js → transform-DECvGmzp.js} +15 -13
- package/dist/src/transform-DTGDnAzW.js +6 -0
- package/dist/src/{transform-BEgStbHK.js → transform-DilY9wbS.js} +10 -12
- package/dist/src/{transform-D5PjiWiZ.cjs → transform-DuHvhZpj.cjs} +179 -187
- package/dist/src/transform-aa6tmVpZ.js +216 -0
- package/dist/src/transform-m3qNw4KP.cjs +5 -0
- package/dist/src/transform-uAytVuyX.js +1506 -0
- package/dist/src/{transform-Dfl89yi4.js → transform-vNucnNr0.js} +39 -47
- package/dist/src/{transformersAvailability-SZnTS3pJ.js → transformersAvailability-CEVM2GNQ.js} +2 -2
- package/dist/src/{transformersAvailability-D-glmEy7.cjs → transformersAvailability-CwayUSlh.cjs} +2 -3
- package/dist/src/{transformersAvailability-CjeFXhuJ.js → transformersAvailability-D6c6ROpT.js} +2 -2
- package/dist/src/{types-DWNf48sT.cjs → types-C_7nyzr1.cjs} +538 -574
- package/dist/src/{types-CXQduE9o.js → types-Cbd8uOMq.js} +68 -100
- package/dist/src/types-CzW2QFyi.js +3288 -0
- package/dist/src/{types-C5hEkb-x.js → types-DmyIJ-sR.js} +63 -99
- package/dist/src/{util-CoQjmE3u.js → util-B3xGByQh.js} +4 -5
- package/dist/src/{util-aLhtl3fe.cjs → util-B9vlHIIh.cjs} +208 -223
- package/dist/src/{util-Du96oyYS.js → util-BHGHw5G1.js} +4 -5
- package/dist/src/{util-DQ984syk.js → util-BRYkYPTd.js} +36 -51
- package/dist/src/{util-D9eLdGfa.js → util-BV4XUC0n.js} +5 -6
- package/dist/src/util-Bv6uGDfH.js +293 -0
- package/dist/src/{util-1wWM599Z.cjs → util-BzMcevZc.cjs} +50 -51
- package/dist/src/{util-_h4pVqrz.js → util-C1CeHl-P.js} +36 -51
- package/dist/src/{util-Bm_-UMD_.js → util-CMy69ZgQ.js} +5 -6
- package/dist/src/{util-CyUdMzV0.cjs → util-DGNOS1db.cjs} +34 -35
- package/dist/src/util-Dnmk2mBQ.js +599 -0
- package/dist/src/util-ZzmqNPlg.js +1426 -0
- package/dist/src/{utils-BjLy-Q72.cjs → utils-Cz9qXqII.cjs} +29 -32
- package/dist/src/{utils-CFMn2yHW.js → utils-XiOAgly5.js} +4 -7
- package/dist/src/utils-dLokC-eR.js +94 -0
- package/dist/src/{utils-DvWMzuMx.js → utils-f2-Moju7.js} +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -38
- package/dist/src/app/assets/index-B2D0bCSI.js +0 -439
- package/dist/src/app/assets/vendor-charts-CCl15Imd.js +0 -36
- package/dist/src/cache-ChPcurj7.js +0 -6
- package/dist/src/cache-VVu_W-yg.js +0 -8
- package/dist/src/cache-YLNCFEM2.cjs +0 -6
- package/dist/src/chunk-DHDDz29n.js +0 -22
- package/dist/src/chunk-FhC4c-0y.js +0 -21
- package/dist/src/cloud-BndfXy4H.js +0 -5
- package/dist/src/eval-BhHvMY82.js +0 -17
- package/dist/src/evalResult-Dq2gFNQY.js +0 -12
- package/dist/src/evalResult-nmcP5VKH.cjs +0 -12
- package/dist/src/evalResult-trqZjVYh.js +0 -14
- package/dist/src/evaluator-CnfPstzT.js +0 -39
- package/dist/src/fetch-IDPDue6F.cjs +0 -4
- package/dist/src/fetch-hKJ-It8q.js +0 -6
- package/dist/src/fetch-ouKnrWK-.js +0 -4
- package/dist/src/graders-CQn7WUsd.cjs +0 -34
- package/dist/src/graders-DC6QAbpW.js +0 -35
- package/dist/src/graders-DUWz3Y7j.js +0 -37
- package/dist/src/opencode-sdk-4bL9n-Gk.js +0 -382
- package/dist/src/opencode-sdk-BfC2zWcR.js +0 -376
- package/dist/src/opencode-sdk-DMJyuwMg.js +0 -380
- package/dist/src/opencode-sdk-Da-9adza.cjs +0 -383
- package/dist/src/providers-CsXB2Ix-.js +0 -35
- package/dist/src/providers-DO8ltjLC.js +0 -33
- package/dist/src/providers-Dtq-xnXd.cjs +0 -33
- package/dist/src/rubyUtils-BUbcND2f.js +0 -6
- package/dist/src/rubyUtils-Cr55X_KE.js +0 -5
- package/dist/src/rubyUtils-DlIiqoYo.cjs +0 -5
- package/dist/src/server-C2eQH4Gu.js +0 -6
- package/dist/src/server-CXWycu7H.cjs +0 -6
- package/dist/src/server-Q6OGlxxT.js +0 -8
- package/dist/src/store-B3EDO9Q3.js +0 -7
- package/dist/src/store-Dl9F8aw5.js +0 -6
- package/dist/src/store-SnrGrlt9.cjs +0 -6
- package/dist/src/telemetry-BGhiPZtl.js +0 -8
- package/dist/src/telemetry-CFfiYan6.cjs +0 -6
- package/dist/src/telemetry-DHzEduxX.js +0 -6
- package/dist/src/transform-C1x1ZlMQ.cjs +0 -6
- package/dist/src/transform-DYHjFmQu.js +0 -8
- package/dist/src/transform-rmwJT5JQ.js +0 -7
- package/dist/src/transformersAvailability-eJooj0gX.js +0 -35
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { i as logger } from "./logger-CT3IKMKA.js";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import path$1 from "node:path";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import fsPromises from "node:fs/promises";
|
|
8
|
+
import vm from "node:vm";
|
|
9
|
+
import { resolveModulePath } from "exsolve";
|
|
10
|
+
//#region node_modules/tsdown/esm-shims.js
|
|
11
|
+
const getFilename = () => fileURLToPath(import.meta.url);
|
|
12
|
+
const getDirname = () => path$1.dirname(getFilename());
|
|
13
|
+
const __dirname = /* @__PURE__ */ getDirname();
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/util/pathUtils.ts
|
|
16
|
+
/**
|
|
17
|
+
* Path resolution utilities that work with both regular paths and file:// URLs
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Check if a file path is absolute, handling both regular paths and URLs
|
|
21
|
+
* @param filePath - The file path to check
|
|
22
|
+
* @returns True if the path is absolute
|
|
23
|
+
*/
|
|
24
|
+
function isAbsolute(filePath) {
|
|
25
|
+
if (!filePath) return false;
|
|
26
|
+
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(filePath)) {
|
|
27
|
+
if (filePath.startsWith("file://")) try {
|
|
28
|
+
return path.isAbsolute(fileURLToPath(filePath));
|
|
29
|
+
} catch {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return path.isAbsolute(filePath);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Safely resolves a path - only calls resolve() if the last path is relative
|
|
38
|
+
* Leaves absolute paths and absolute URLs unchanged
|
|
39
|
+
*
|
|
40
|
+
* @param paths - The path segments to resolve
|
|
41
|
+
* @returns The resolved path if last path is relative, or the last path if it's absolute
|
|
42
|
+
*/
|
|
43
|
+
function safeResolve(...paths) {
|
|
44
|
+
const lastPath = paths[paths.length - 1] || "";
|
|
45
|
+
if (isAbsolute(lastPath)) return lastPath;
|
|
46
|
+
return path.resolve(...paths);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Safely joins paths - only joins if the last path is relative
|
|
50
|
+
* If the last path is absolute or an absolute URL, returns it directly
|
|
51
|
+
*
|
|
52
|
+
* @param paths - The path segments to join
|
|
53
|
+
* @returns The joined path if last path is relative, or the last path if it's absolute
|
|
54
|
+
*/
|
|
55
|
+
function safeJoin(...paths) {
|
|
56
|
+
const lastPath = paths[paths.length - 1] || "";
|
|
57
|
+
if (isAbsolute(lastPath)) return lastPath;
|
|
58
|
+
return path.join(...paths);
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/esm.ts
|
|
62
|
+
/**
|
|
63
|
+
* Mapping of wrapper types to their subdirectory names.
|
|
64
|
+
* These correspond to the directory structure under src/ and dist/src/.
|
|
65
|
+
*/
|
|
66
|
+
const WRAPPER_SUBDIRS = {
|
|
67
|
+
python: "python",
|
|
68
|
+
ruby: "ruby",
|
|
69
|
+
golang: "golang"
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Cache for wrapper directory paths to avoid repeated path construction.
|
|
73
|
+
*/
|
|
74
|
+
const wrapperDirCache = {};
|
|
75
|
+
/**
|
|
76
|
+
* Returns the directory containing wrapper scripts for the specified language.
|
|
77
|
+
*
|
|
78
|
+
* This function provides a consistent way to locate wrapper scripts (wrapper.py,
|
|
79
|
+
* wrapper.rb, wrapper.go, etc.) that works correctly in both development and
|
|
80
|
+
* production (bundled) environments.
|
|
81
|
+
*
|
|
82
|
+
* Directory resolution:
|
|
83
|
+
* - Development (tsx): src/{python|ruby|golang}/
|
|
84
|
+
* - Production (bundled): dist/src/{python|ruby|golang}/
|
|
85
|
+
*
|
|
86
|
+
* Results are cached for performance.
|
|
87
|
+
*
|
|
88
|
+
* @param type - The wrapper type ('python', 'ruby', or 'golang')
|
|
89
|
+
* @returns The absolute path to the wrapper directory
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* // Get Python wrapper path
|
|
94
|
+
* const pythonDir = getWrapperDir('python');
|
|
95
|
+
* const wrapperPath = path.join(pythonDir, 'wrapper.py');
|
|
96
|
+
*
|
|
97
|
+
* // Get Ruby wrapper path
|
|
98
|
+
* const rubyDir = getWrapperDir('ruby');
|
|
99
|
+
* const wrapperPath = path.join(rubyDir, 'wrapper.rb');
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
function getWrapperDir(type) {
|
|
103
|
+
if (wrapperDirCache[type]) return wrapperDirCache[type];
|
|
104
|
+
const baseDir = getDirectory();
|
|
105
|
+
const result = path$1.join(baseDir, WRAPPER_SUBDIRS[type]);
|
|
106
|
+
wrapperDirCache[type] = result;
|
|
107
|
+
logger.debug(`Resolved ${type} wrapper directory: ${result}`);
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Resolves the entry point path for an npm package, handling ESM-only packages
|
|
112
|
+
* with restrictive `exports` fields.
|
|
113
|
+
*
|
|
114
|
+
* ## Why this function exists
|
|
115
|
+
*
|
|
116
|
+
* Some ESM-only packages (like `@openai/codex-sdk`) have restrictive `exports` fields:
|
|
117
|
+
*
|
|
118
|
+
* ```json
|
|
119
|
+
* {
|
|
120
|
+
* "type": "module",
|
|
121
|
+
* "exports": {
|
|
122
|
+
* ".": { "import": "./dist/index.js" }
|
|
123
|
+
* }
|
|
124
|
+
* }
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* This causes problems with Node.js's `require.resolve()`:
|
|
128
|
+
* - `require.resolve('@openai/codex-sdk')` fails with "No exports main defined"
|
|
129
|
+
* because there's no `"require"` or `"default"` condition.
|
|
130
|
+
*
|
|
131
|
+
* ## Solution
|
|
132
|
+
*
|
|
133
|
+
* This function uses `exsolve` which implements Node's ESM resolution algorithm,
|
|
134
|
+
* correctly handling all `exports` field variations:
|
|
135
|
+
* - Direct string exports: `"exports": "./index.js"`
|
|
136
|
+
* - Shorthand object: `"exports": { ".": "./index.js" }`
|
|
137
|
+
* - Conditional exports: `"exports": { ".": { "import": "./index.js" } }`
|
|
138
|
+
* - Nested conditionals, array fallbacks, pattern exports, etc.
|
|
139
|
+
*
|
|
140
|
+
* @param packageName - The npm package name (e.g., '@openai/codex-sdk')
|
|
141
|
+
* @param baseDir - The directory to resolve from (should contain node_modules)
|
|
142
|
+
* @returns The absolute path to the package entry point, or null if not found
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* // Resolve from current directory
|
|
147
|
+
* const codexPath = resolvePackageEntryPoint('@openai/codex-sdk', process.cwd());
|
|
148
|
+
* if (codexPath) {
|
|
149
|
+
* const module = await importModule(codexPath);
|
|
150
|
+
* }
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
function resolvePackageEntryPoint(packageName, baseDir) {
|
|
154
|
+
const from = pathToFileURL(path$1.join(baseDir, "package.json")).href;
|
|
155
|
+
const resolved = resolveModulePath(packageName, {
|
|
156
|
+
from,
|
|
157
|
+
conditions: [
|
|
158
|
+
"node",
|
|
159
|
+
"import",
|
|
160
|
+
"require",
|
|
161
|
+
"default"
|
|
162
|
+
],
|
|
163
|
+
try: true
|
|
164
|
+
});
|
|
165
|
+
return resolved ? path$1.normalize(resolved) : null;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* ESM replacement for __dirname - guarded for dual CJS/ESM builds.
|
|
169
|
+
*
|
|
170
|
+
* This is the canonical way to get the current directory in dual ESM/CJS code.
|
|
171
|
+
* Use this instead of implementing the try-catch pattern in each file.
|
|
172
|
+
*
|
|
173
|
+
* Build contexts:
|
|
174
|
+
* - ESM (production/bundled): BUILD_FORMAT='esm', import.meta.url is valid
|
|
175
|
+
* - CJS (library build): BUILD_FORMAT='cjs', import.meta.url may be empty, __dirname available
|
|
176
|
+
* - Development (tsx): BUILD_FORMAT=undefined, import.meta.url is valid
|
|
177
|
+
* - Vitest tests: BUILD_FORMAT=undefined, import.meta is valid in ESM mode
|
|
178
|
+
*
|
|
179
|
+
* The try-catch is necessary because `import.meta` syntax itself causes a SyntaxError
|
|
180
|
+
* in CJS environments (Node require), not just an undefined value.
|
|
181
|
+
*/
|
|
182
|
+
function getDirectory() {
|
|
183
|
+
try {
|
|
184
|
+
const url = import.meta.url;
|
|
185
|
+
if (url && url !== "") return path$1.dirname(fileURLToPath(url));
|
|
186
|
+
} catch {}
|
|
187
|
+
if (typeof __dirname !== "undefined") return __dirname;
|
|
188
|
+
throw new Error("Unable to determine directory: neither import.meta.url nor __dirname available. This indicates an unsupported module environment.");
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* ESM-only module loader - simplified without eval() or CommonJS fallback
|
|
192
|
+
* Uses Node.js native ESM import with proper URL resolution
|
|
193
|
+
*/
|
|
194
|
+
async function importModule(modulePath, functionName) {
|
|
195
|
+
logger.debug(`Attempting to import module: ${JSON.stringify({
|
|
196
|
+
resolvedPath: safeResolve(modulePath),
|
|
197
|
+
moduleId: modulePath
|
|
198
|
+
})}`);
|
|
199
|
+
try {
|
|
200
|
+
if (modulePath.endsWith(".ts") || modulePath.endsWith(".mjs")) {
|
|
201
|
+
logger.debug("TypeScript/ESM module detected, importing tsx/cjs");
|
|
202
|
+
await import("tsx/cjs");
|
|
203
|
+
}
|
|
204
|
+
const resolvedPath = pathToFileURL(safeResolve(modulePath));
|
|
205
|
+
const resolvedPathStr = resolvedPath.toString();
|
|
206
|
+
logger.debug(`Attempting ESM import from: ${resolvedPathStr}`);
|
|
207
|
+
const importedModule = await import(resolvedPathStr);
|
|
208
|
+
const mod = importedModule?.default?.default || importedModule?.default || importedModule;
|
|
209
|
+
logger.debug(`Successfully imported module: ${JSON.stringify({
|
|
210
|
+
resolvedPath,
|
|
211
|
+
moduleId: modulePath
|
|
212
|
+
})}`);
|
|
213
|
+
if (functionName) {
|
|
214
|
+
logger.debug(`Returning named export: ${functionName}`);
|
|
215
|
+
return mod[functionName];
|
|
216
|
+
}
|
|
217
|
+
return mod;
|
|
218
|
+
} catch (err) {
|
|
219
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
220
|
+
if (modulePath.endsWith(".js") && isCjsInEsmError(errorMessage)) {
|
|
221
|
+
logger.debug(`ESM import failed for ${modulePath}, attempting vm-based CJS fallback: ${errorMessage}`);
|
|
222
|
+
try {
|
|
223
|
+
const resolvedPath = safeResolve(modulePath);
|
|
224
|
+
const mod = loadCjsModule(resolvedPath);
|
|
225
|
+
logger.debug(`Successfully loaded module via CJS fallback: ${JSON.stringify({
|
|
226
|
+
resolvedPath,
|
|
227
|
+
moduleId: modulePath
|
|
228
|
+
})}`);
|
|
229
|
+
if (functionName) {
|
|
230
|
+
logger.debug(`Returning named export: ${functionName}`);
|
|
231
|
+
return mod[functionName];
|
|
232
|
+
}
|
|
233
|
+
return mod;
|
|
234
|
+
} catch (cjsErr) {
|
|
235
|
+
const cjsErrorMessage = cjsErr instanceof Error ? cjsErr.message : String(cjsErr);
|
|
236
|
+
logger.error(`ESM import failed for ${modulePath}: ${errorMessage}`);
|
|
237
|
+
logger.error(`CJS fallback also failed: ${cjsErrorMessage}`);
|
|
238
|
+
const combinedError = /* @__PURE__ */ new Error(`Failed to load module ${modulePath}:\n ESM import error: ${errorMessage}\n CJS fallback error: ${cjsErrorMessage}\nTo fix this, either:\n 1. Rename the file to .cjs (recommended for CommonJS)\n 2. Convert to ESM syntax (import/export)\n 3. Ensure the file has valid JavaScript syntax`);
|
|
239
|
+
combinedError.cause = {
|
|
240
|
+
esmError: err,
|
|
241
|
+
cjsError: cjsErr
|
|
242
|
+
};
|
|
243
|
+
throw combinedError;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const e = err;
|
|
247
|
+
if (e.stack) logger.debug(e.stack);
|
|
248
|
+
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
249
|
+
const resolvedModulePath = safeResolve(modulePath);
|
|
250
|
+
try {
|
|
251
|
+
await fsPromises.access(resolvedModulePath);
|
|
252
|
+
logger.error(`ESM import failed: ${err}`);
|
|
253
|
+
} catch {
|
|
254
|
+
const enoentError = /* @__PURE__ */ new Error(`ENOENT: no such file or directory, open '${resolvedModulePath}'`);
|
|
255
|
+
enoentError.code = "ENOENT";
|
|
256
|
+
enoentError.path = resolvedModulePath;
|
|
257
|
+
throw enoentError;
|
|
258
|
+
}
|
|
259
|
+
} else logger.error(`ESM import failed: ${err}`);
|
|
260
|
+
throw err;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Detects if an error message indicates a CommonJS module being loaded in ESM context.
|
|
265
|
+
*/
|
|
266
|
+
function isCjsInEsmError(message) {
|
|
267
|
+
return [
|
|
268
|
+
"require is not defined",
|
|
269
|
+
"module is not defined",
|
|
270
|
+
"exports is not defined",
|
|
271
|
+
"__dirname is not defined",
|
|
272
|
+
"__filename is not defined",
|
|
273
|
+
"Cannot use import statement",
|
|
274
|
+
"ERR_REQUIRE_ESM"
|
|
275
|
+
].some((pattern) => message.includes(pattern));
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Loads a CommonJS module by executing it in a vm context with proper CJS globals.
|
|
279
|
+
* This bypasses Node.js's module type detection which is based on package.json "type" field.
|
|
280
|
+
*
|
|
281
|
+
* SECURITY NOTE: This is NOT a security sandbox. The executed code has full access to
|
|
282
|
+
* the file system, network, etc. via the injected require function and process object.
|
|
283
|
+
* This is intentional - it's designed for loading trusted user configuration files
|
|
284
|
+
* (custom providers, assertions, hooks) that need full Node.js capabilities.
|
|
285
|
+
*/
|
|
286
|
+
function loadCjsModule(modulePath) {
|
|
287
|
+
const code = fs.readFileSync(modulePath, "utf-8");
|
|
288
|
+
const dirname = path$1.dirname(modulePath);
|
|
289
|
+
const filename = modulePath;
|
|
290
|
+
const moduleRequire = createRequire(pathToFileURL(modulePath).href);
|
|
291
|
+
const moduleObj = { exports: {} };
|
|
292
|
+
const context = vm.createContext({
|
|
293
|
+
module: moduleObj,
|
|
294
|
+
exports: moduleObj.exports,
|
|
295
|
+
require: moduleRequire,
|
|
296
|
+
__dirname: dirname,
|
|
297
|
+
__filename: filename,
|
|
298
|
+
global: globalThis,
|
|
299
|
+
globalThis,
|
|
300
|
+
console,
|
|
301
|
+
process,
|
|
302
|
+
Buffer,
|
|
303
|
+
setTimeout,
|
|
304
|
+
setInterval,
|
|
305
|
+
setImmediate,
|
|
306
|
+
clearTimeout,
|
|
307
|
+
clearInterval,
|
|
308
|
+
clearImmediate,
|
|
309
|
+
queueMicrotask,
|
|
310
|
+
URL,
|
|
311
|
+
URLSearchParams,
|
|
312
|
+
TextEncoder,
|
|
313
|
+
TextDecoder,
|
|
314
|
+
atob: globalThis.atob,
|
|
315
|
+
btoa: globalThis.btoa,
|
|
316
|
+
fetch: globalThis.fetch,
|
|
317
|
+
Request: globalThis.Request,
|
|
318
|
+
Response: globalThis.Response,
|
|
319
|
+
Headers: globalThis.Headers,
|
|
320
|
+
AbortController: globalThis.AbortController,
|
|
321
|
+
AbortSignal: globalThis.AbortSignal,
|
|
322
|
+
Event: globalThis.Event,
|
|
323
|
+
EventTarget: globalThis.EventTarget,
|
|
324
|
+
Error,
|
|
325
|
+
TypeError,
|
|
326
|
+
ReferenceError,
|
|
327
|
+
SyntaxError,
|
|
328
|
+
RangeError,
|
|
329
|
+
Array,
|
|
330
|
+
Object,
|
|
331
|
+
String,
|
|
332
|
+
Number,
|
|
333
|
+
Boolean,
|
|
334
|
+
Symbol,
|
|
335
|
+
Map,
|
|
336
|
+
Set,
|
|
337
|
+
WeakMap,
|
|
338
|
+
WeakSet,
|
|
339
|
+
Promise,
|
|
340
|
+
Proxy,
|
|
341
|
+
Reflect,
|
|
342
|
+
JSON,
|
|
343
|
+
Math,
|
|
344
|
+
Date,
|
|
345
|
+
RegExp,
|
|
346
|
+
Int8Array,
|
|
347
|
+
Uint8Array,
|
|
348
|
+
Uint8ClampedArray,
|
|
349
|
+
Int16Array,
|
|
350
|
+
Uint16Array,
|
|
351
|
+
Int32Array,
|
|
352
|
+
Uint32Array,
|
|
353
|
+
Float32Array,
|
|
354
|
+
Float64Array,
|
|
355
|
+
BigInt64Array,
|
|
356
|
+
BigUint64Array,
|
|
357
|
+
DataView,
|
|
358
|
+
ArrayBuffer,
|
|
359
|
+
SharedArrayBuffer: globalThis.SharedArrayBuffer,
|
|
360
|
+
Atomics: globalThis.Atomics,
|
|
361
|
+
BigInt,
|
|
362
|
+
eval: void 0,
|
|
363
|
+
Function,
|
|
364
|
+
isNaN,
|
|
365
|
+
isFinite,
|
|
366
|
+
parseFloat,
|
|
367
|
+
parseInt,
|
|
368
|
+
decodeURI,
|
|
369
|
+
decodeURIComponent,
|
|
370
|
+
encodeURI,
|
|
371
|
+
encodeURIComponent
|
|
372
|
+
});
|
|
373
|
+
vm.runInContext(code, context, { filename: modulePath });
|
|
374
|
+
return moduleObj.exports;
|
|
375
|
+
}
|
|
376
|
+
//#endregion
|
|
377
|
+
export { safeJoin as a, resolvePackageEntryPoint as i, getWrapperDir as n, safeResolve as o, importModule as r, getDirectory as t };
|
|
378
|
+
|
|
379
|
+
//# sourceMappingURL=esm-Cd1AjG1D.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_logger = require(
|
|
1
|
+
const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
2
2
|
let path = require("path");
|
|
3
3
|
path = require_logger.__toESM(path);
|
|
4
4
|
let node_fs = require("node:fs");
|
|
@@ -12,7 +12,6 @@ let node_url = require("node:url");
|
|
|
12
12
|
let node_vm = require("node:vm");
|
|
13
13
|
node_vm = require_logger.__toESM(node_vm);
|
|
14
14
|
let exsolve = require("exsolve");
|
|
15
|
-
|
|
16
15
|
//#region src/util/pathUtils.ts
|
|
17
16
|
/**
|
|
18
17
|
* Path resolution utilities that work with both regular paths and file:// URLs
|
|
@@ -58,7 +57,6 @@ function safeJoin(...paths) {
|
|
|
58
57
|
if (isAbsolute(lastPath)) return lastPath;
|
|
59
58
|
return path.default.join(...paths);
|
|
60
59
|
}
|
|
61
|
-
|
|
62
60
|
//#endregion
|
|
63
61
|
//#region src/esm.ts
|
|
64
62
|
/**
|
|
@@ -106,7 +104,7 @@ function getWrapperDir(type) {
|
|
|
106
104
|
const baseDir = getDirectory();
|
|
107
105
|
const result = node_path.default.join(baseDir, WRAPPER_SUBDIRS[type]);
|
|
108
106
|
wrapperDirCache[type] = result;
|
|
109
|
-
require_logger.
|
|
107
|
+
require_logger.logger.debug(`Resolved ${type} wrapper directory: ${result}`);
|
|
110
108
|
return result;
|
|
111
109
|
}
|
|
112
110
|
/**
|
|
@@ -189,49 +187,49 @@ function getDirectory() {
|
|
|
189
187
|
* Uses Node.js native ESM import with proper URL resolution
|
|
190
188
|
*/
|
|
191
189
|
async function importModule(modulePath, functionName) {
|
|
192
|
-
require_logger.
|
|
190
|
+
require_logger.logger.debug(`Attempting to import module: ${JSON.stringify({
|
|
193
191
|
resolvedPath: safeResolve(modulePath),
|
|
194
192
|
moduleId: modulePath
|
|
195
193
|
})}`);
|
|
196
194
|
try {
|
|
197
195
|
if (modulePath.endsWith(".ts") || modulePath.endsWith(".mjs")) {
|
|
198
|
-
require_logger.
|
|
196
|
+
require_logger.logger.debug("TypeScript/ESM module detected, importing tsx/cjs");
|
|
199
197
|
await import("tsx/cjs");
|
|
200
198
|
}
|
|
201
199
|
const resolvedPath = (0, node_url.pathToFileURL)(safeResolve(modulePath));
|
|
202
200
|
const resolvedPathStr = resolvedPath.toString();
|
|
203
|
-
require_logger.
|
|
201
|
+
require_logger.logger.debug(`Attempting ESM import from: ${resolvedPathStr}`);
|
|
204
202
|
const importedModule = await import(resolvedPathStr);
|
|
205
203
|
const mod = importedModule?.default?.default || importedModule?.default || importedModule;
|
|
206
|
-
require_logger.
|
|
204
|
+
require_logger.logger.debug(`Successfully imported module: ${JSON.stringify({
|
|
207
205
|
resolvedPath,
|
|
208
206
|
moduleId: modulePath
|
|
209
207
|
})}`);
|
|
210
208
|
if (functionName) {
|
|
211
|
-
require_logger.
|
|
209
|
+
require_logger.logger.debug(`Returning named export: ${functionName}`);
|
|
212
210
|
return mod[functionName];
|
|
213
211
|
}
|
|
214
212
|
return mod;
|
|
215
213
|
} catch (err) {
|
|
216
214
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
217
215
|
if (modulePath.endsWith(".js") && isCjsInEsmError(errorMessage)) {
|
|
218
|
-
require_logger.
|
|
216
|
+
require_logger.logger.debug(`ESM import failed for ${modulePath}, attempting vm-based CJS fallback: ${errorMessage}`);
|
|
219
217
|
try {
|
|
220
218
|
const resolvedPath = safeResolve(modulePath);
|
|
221
219
|
const mod = loadCjsModule(resolvedPath);
|
|
222
|
-
require_logger.
|
|
220
|
+
require_logger.logger.debug(`Successfully loaded module via CJS fallback: ${JSON.stringify({
|
|
223
221
|
resolvedPath,
|
|
224
222
|
moduleId: modulePath
|
|
225
223
|
})}`);
|
|
226
224
|
if (functionName) {
|
|
227
|
-
require_logger.
|
|
225
|
+
require_logger.logger.debug(`Returning named export: ${functionName}`);
|
|
228
226
|
return mod[functionName];
|
|
229
227
|
}
|
|
230
228
|
return mod;
|
|
231
229
|
} catch (cjsErr) {
|
|
232
230
|
const cjsErrorMessage = cjsErr instanceof Error ? cjsErr.message : String(cjsErr);
|
|
233
|
-
require_logger.
|
|
234
|
-
require_logger.
|
|
231
|
+
require_logger.logger.error(`ESM import failed for ${modulePath}: ${errorMessage}`);
|
|
232
|
+
require_logger.logger.error(`CJS fallback also failed: ${cjsErrorMessage}`);
|
|
235
233
|
const combinedError = /* @__PURE__ */ new Error(`Failed to load module ${modulePath}:\n ESM import error: ${errorMessage}\n CJS fallback error: ${cjsErrorMessage}\nTo fix this, either:\n 1. Rename the file to .cjs (recommended for CommonJS)\n 2. Convert to ESM syntax (import/export)\n 3. Ensure the file has valid JavaScript syntax`);
|
|
236
234
|
combinedError.cause = {
|
|
237
235
|
esmError: err,
|
|
@@ -241,19 +239,19 @@ async function importModule(modulePath, functionName) {
|
|
|
241
239
|
}
|
|
242
240
|
}
|
|
243
241
|
const e = err;
|
|
244
|
-
if (e.stack) require_logger.
|
|
242
|
+
if (e.stack) require_logger.logger.debug(e.stack);
|
|
245
243
|
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
246
244
|
const resolvedModulePath = safeResolve(modulePath);
|
|
247
245
|
try {
|
|
248
246
|
await node_fs_promises.default.access(resolvedModulePath);
|
|
249
|
-
require_logger.
|
|
247
|
+
require_logger.logger.error(`ESM import failed: ${err}`);
|
|
250
248
|
} catch {
|
|
251
249
|
const enoentError = /* @__PURE__ */ new Error(`ENOENT: no such file or directory, open '${resolvedModulePath}'`);
|
|
252
250
|
enoentError.code = "ENOENT";
|
|
253
251
|
enoentError.path = resolvedModulePath;
|
|
254
252
|
throw enoentError;
|
|
255
253
|
}
|
|
256
|
-
} else require_logger.
|
|
254
|
+
} else require_logger.logger.error(`ESM import failed: ${err}`);
|
|
257
255
|
throw err;
|
|
258
256
|
}
|
|
259
257
|
}
|
|
@@ -370,42 +368,42 @@ function loadCjsModule(modulePath) {
|
|
|
370
368
|
node_vm.default.runInContext(code, context, { filename: modulePath });
|
|
371
369
|
return moduleObj.exports;
|
|
372
370
|
}
|
|
373
|
-
|
|
374
371
|
//#endregion
|
|
375
|
-
Object.defineProperty(exports,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
372
|
+
Object.defineProperty(exports, "getDirectory", {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function() {
|
|
375
|
+
return getDirectory;
|
|
376
|
+
}
|
|
380
377
|
});
|
|
381
|
-
Object.defineProperty(exports,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
378
|
+
Object.defineProperty(exports, "getWrapperDir", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function() {
|
|
381
|
+
return getWrapperDir;
|
|
382
|
+
}
|
|
386
383
|
});
|
|
387
|
-
Object.defineProperty(exports,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
384
|
+
Object.defineProperty(exports, "importModule", {
|
|
385
|
+
enumerable: true,
|
|
386
|
+
get: function() {
|
|
387
|
+
return importModule;
|
|
388
|
+
}
|
|
392
389
|
});
|
|
393
|
-
Object.defineProperty(exports,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
390
|
+
Object.defineProperty(exports, "resolvePackageEntryPoint", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
get: function() {
|
|
393
|
+
return resolvePackageEntryPoint;
|
|
394
|
+
}
|
|
398
395
|
});
|
|
399
|
-
Object.defineProperty(exports,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
396
|
+
Object.defineProperty(exports, "safeJoin", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function() {
|
|
399
|
+
return safeJoin;
|
|
400
|
+
}
|
|
404
401
|
});
|
|
405
|
-
Object.defineProperty(exports,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
402
|
+
Object.defineProperty(exports, "safeResolve", {
|
|
403
|
+
enumerable: true,
|
|
404
|
+
get: function() {
|
|
405
|
+
return safeResolve;
|
|
406
|
+
}
|
|
410
407
|
});
|
|
411
|
-
|
|
408
|
+
|
|
409
|
+
//# sourceMappingURL=esm-CnNt7sI4.cjs.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import "./logger-KkObSCzq.js";
|
|
3
|
+
import "./fetch-Dxpd4_sr.js";
|
|
4
|
+
import "./accounts-Bm2D8Db9.js";
|
|
5
|
+
import "./cloud-C0dlstV_.js";
|
|
6
|
+
import "./types-Cbd8uOMq.js";
|
|
7
|
+
import "./utils-f2-Moju7.js";
|
|
8
|
+
import "./blobs-CMHN0Qcz.js";
|
|
9
|
+
import "./tables-gftXzE9I.js";
|
|
10
|
+
import "./extractor-DReVID0K.js";
|
|
11
|
+
import "./store-Dim__MDd.js";
|
|
12
|
+
import "./signal-4U3mfRvL.js";
|
|
13
|
+
import { t as Eval } from "./eval-Dg2nG4v2.js";
|
|
14
|
+
import "./evalResult-BBRNtX4I.js";
|
|
15
|
+
export { Eval as default };
|