promptfoo 0.120.27 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/{ListApp-8WOe2nT6.js → ListApp-Du7YVwj5.js} +2 -4
- package/dist/src/accounts-BgNJDBE6.js +206 -0
- package/dist/src/{accounts-Fl2J3_Fu.cjs → accounts-Bx-x3bmW.cjs} +77 -78
- package/dist/src/{accounts-DVINui-2.js → accounts-CMqkzrVf.js} +39 -34
- package/dist/src/{accounts-CPDRAMND.js → accounts-xrUGFA6n.js} +38 -33
- package/dist/src/{agentic-utils-D922n6mm.js → agentic-utils-BKIN5PKu.js} +9 -10
- package/dist/src/{agents-BO2n8Z0d.cjs → agents-B0f4HICh.cjs} +37 -40
- package/dist/src/{agents-BXLmVsxR.js → agents-C-dDThPK.js} +37 -37
- package/dist/src/{agents-DgJf2-ez.cjs → agents-CErsqg5U.cjs} +16 -17
- package/dist/src/{agents-BcsN_BgB.js → agents-CVIn-Utx.js} +16 -12
- package/dist/src/{agents-hqgSV-3o.js → agents-CXknwsFX.js} +37 -40
- package/dist/src/{agents-pMfppv9Z.js → agents-DeH4Gu94.js} +18 -18
- package/dist/src/{agents-BdUTAwi-.js → agents-Dy2YpZpa.js} +38 -41
- package/dist/src/{agents-DNvSH78i.js → agents-aF4-T121.js} +16 -20
- package/dist/src/{aimlapi-DOib86oE.js → aimlapi-BAGZDo5G.js} +16 -18
- package/dist/src/{aimlapi-DtgPI0nE.js → aimlapi-BNfTBexL.js} +15 -17
- package/dist/src/{aimlapi-DTPACCB1.js → aimlapi-DHRKlBEA.js} +15 -4
- package/dist/src/{aimlapi-BE_Tg9Fl.cjs → aimlapi-tg0Gkcvr.cjs} +15 -16
- package/dist/src/app/assets/index-BFCZg7hQ.js +439 -0
- package/dist/src/app/index.html +1 -1
- package/dist/src/{audio-BRYU0BFo.js → audio-BRODU0UK.js} +7 -9
- package/dist/src/{audio-Cwo68yZS.cjs → audio-BWeaWovU.cjs} +6 -7
- package/dist/src/{audio-BnRUGAm_.js → audio-CHQ4r-RV.js} +6 -5
- package/dist/src/{audio-MSRki4JU.js → audio-tf_NBjlC.js} +6 -8
- package/dist/src/{base-h961VXYk.js → base-B0tcrnq_.js} +11 -13
- package/dist/src/{base-XB2tDJrB.js → base-B4QJRyFS.js} +11 -13
- package/dist/src/{base-pGVmXNl4.cjs → base-DBtwl2FR.cjs} +36 -38
- package/dist/src/base-fEDN28WM.js +193 -0
- package/dist/src/{blobs-BM_e6hCa.js → blobs-BAU-dXan.js} +9 -12
- package/dist/src/{blobs-CR5C4Ihh.js → blobs-Bpg5rH6i.js} +9 -12
- package/dist/src/{blobs-B-KQAFhX.cjs → blobs-DvS-O6be.cjs} +34 -37
- package/dist/src/blobs-qTYm-1PY.js +236 -0
- package/dist/src/{cache-CIpsoBZR.js → cache-8XhNqPKW.js} +64 -67
- package/dist/src/cache-Bbn1Nyrd.cjs +5 -0
- package/dist/src/cache-BwsMSda7.js +6 -0
- package/dist/src/{cache-jsiwsAJv.js → cache-CG0SlR1d.js} +64 -66
- package/dist/src/{cache-BTVYfbka.cjs → cache-COish3-W.cjs} +114 -117
- package/dist/src/cache-D3eqDYGU.js +739 -0
- package/dist/src/{chat-D31K7C4u.cjs → chat-2K608PeQ.cjs} +20 -21
- package/dist/src/chat-BKm79wib.js +764 -0
- package/dist/src/{chat-B84t99NW.js → chat-CM_kyI8B.js} +20 -9
- package/dist/src/{chat-BcPjZXIp.js → chat-CRWNNq73.js} +41 -44
- package/dist/src/{chat-CcUCysjU.js → chat-CznLWr_D.js} +41 -44
- package/dist/src/{chat-DwWifjxi.js → chat-DHMH-N64.js} +20 -22
- package/dist/src/{chat-BE44YOc6.cjs → chat-DaqekjFr.cjs} +61 -64
- package/dist/src/{chat-DZM2GUHO.js → chat-DxysjBvt.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-BLTu0WBO.js} +31 -31
- package/dist/src/{claude-agent-sdk-C9SiaQub.cjs → claude-agent-sdk-CJH22shf.cjs} +31 -28
- package/dist/src/{claude-agent-sdk-C-IOTPfo.js → claude-agent-sdk-D6_k9FKA.js} +31 -29
- package/dist/src/{claude-agent-sdk-CiluSyW1.js → claude-agent-sdk-Dy5lT-Tx.js} +33 -20
- package/dist/src/{cloud-CZ-q9Ier.js → cloud-Bc9526yV.js} +7 -9
- package/dist/src/cloud-DmE0EwsY.js +4 -0
- package/dist/src/{cloudflare-ai-BahKHyhh.js → cloudflare-ai-C9r2sRhw.js} +16 -18
- package/dist/src/{cloudflare-ai-Dxyt50Nl.js → cloudflare-ai-CWWJCRim.js} +16 -4
- package/dist/src/{cloudflare-ai-Dfahv5SY.cjs → cloudflare-ai-ClWSdor4.cjs} +16 -17
- package/dist/src/{cloudflare-ai-v_qZD6_q.js → cloudflare-ai-ICsOuD-z.js} +17 -19
- package/dist/src/{cloudflare-gateway-BPWoZIzJ.cjs → cloudflare-gateway-C2_-KG5o.cjs} +21 -22
- package/dist/src/{cloudflare-gateway-Bi_FpOFy.js → cloudflare-gateway-D6O7AlYb.js} +23 -23
- package/dist/src/{cloudflare-gateway-btS7h1OZ.js → cloudflare-gateway-D6xFc5pa.js} +21 -25
- package/dist/src/{cloudflare-gateway-C0guUNwk.js → cloudflare-gateway-pXGHxJ47.js} +26 -14
- 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-DkNBMk0G.js → cometapi-BasUi7-_.js} +17 -19
- package/dist/src/{cometapi-DzrR3SR_.js → cometapi-Bbjp5V4x.js} +16 -4
- package/dist/src/{cometapi-C9EEpJzT.js → cometapi-DkXrKi5z.js} +21 -24
- package/dist/src/{cometapi-DIO64tf4.cjs → cometapi-vY6aDZgo.cjs} +21 -22
- package/dist/src/{completion-CG29bfKX.js → completion-6Mx_iXxK.js} +11 -13
- package/dist/src/{completion-Bgf1VJoq.js → completion-C5rtR_9P.js} +11 -13
- package/dist/src/{completion-CCRT4kX1.cjs → completion-CDOouNzq.cjs} +21 -23
- package/dist/src/completion-C_P3ypkJ.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-5KcG-_86.js} +18 -20
- package/dist/src/{docker-DNcLR4Ig.cjs → docker-BwsKwxFs.cjs} +18 -19
- package/dist/src/{docker-egERKxCF.js → docker-CZnqU1XV.js} +18 -7
- package/dist/src/{docker-B81N0t4e.js → docker-DzxyDPIj.js} +19 -21
- 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-17JizQIv.js +15 -0
- package/dist/src/{eval-C-Nr6wX_.js → eval-DmFyWU7i.js} +47 -54
- package/dist/src/{evalResult-4BzI2tmj.js → evalResult-CDQiuUuf.js} +16 -12
- package/dist/src/{evalResult-DXMWJ3sx.js → evalResult-CTG2AHOS.js} +10 -11
- package/dist/src/evalResult-Cqj8pldJ.js +12 -0
- package/dist/src/{evalResult-CX8wQecI.cjs → evalResult-Dap2CekP.cjs} +20 -21
- package/dist/src/evalResult-DvcJAWJU.cjs +10 -0
- package/dist/src/evalResult-Hftn-S_i.js +10 -0
- package/dist/src/evaluator-B2CFNt-P.js +36 -0
- package/dist/src/{evaluator-8aGyV12L.js → evaluator-DPFRbFIL.js} +201 -229
- package/dist/src/{extractor-CD5yKL-G.js → extractor-CFG6bcWJ.js} +22 -24
- package/dist/src/{extractor-C031XmTA.cjs → extractor-DX36oYEv.cjs} +37 -39
- package/dist/src/{extractor-V5x_m1i0.js → extractor-M67RUtg6.js} +22 -24
- package/dist/src/extractor-YMU_Gvt8.js +374 -0
- package/dist/src/{fetch-D3OHf-lV.js → fetch-4M3YRaqL.js} +40 -45
- package/dist/src/fetch-60Gzydls.js +777 -0
- package/dist/src/{fetch-CXZI9RRr.js → fetch-BMv0O527.js} +23 -35
- package/dist/src/{fetch-BmbD-v1L.cjs → fetch-BxUk8odA.cjs} +244 -277
- package/dist/src/fetch-KV5kNASw.js +5 -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-Bu0H9nXi.js +32 -0
- package/dist/src/{graders-DTeBrzWp.js → graders-CHO8EPM4.js} +349 -397
- package/dist/src/graders-Cfhkvx-e.js +34 -0
- package/dist/src/{graders--1y2u9HO.js → graders-CpdqD9PI.js} +349 -397
- package/dist/src/graders-DClJVpGP.cjs +32 -0
- package/dist/src/{graders-DohM2dir.cjs → graders-DOXycdlG.cjs} +684 -732
- package/dist/src/graders-DcnJsrMO.js +32 -0
- package/dist/src/graders-R9rYUM0d.js +13466 -0
- package/dist/src/{image-C3wHC9_h.js → image-BmEZqVmk.js} +9 -10
- package/dist/src/{image-O1u4bCFg.js → image-CBBVXWuT.js} +9 -10
- package/dist/src/{image-DpKl2F15.cjs → image-CDLQOcqT.cjs} +6 -7
- package/dist/src/{image-DmE-niFE.js → image-DJEvKveK.js} +6 -5
- package/dist/src/{image-CuKHuccK.cjs → image-DTedmQPg.cjs} +29 -30
- package/dist/src/{image-B0U4Hqll.js → image-gvmivTEe.js} +7 -9
- package/dist/src/image-pAX56tPG.js +257 -0
- package/dist/src/{image-DNEIf_aI.js → image-tL5hIOFh.js} +6 -8
- package/dist/src/index.cjs +605 -689
- package/dist/src/index.d.cts +11 -7
- package/dist/src/index.d.ts +11 -3
- package/dist/src/index.js +570 -658
- 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-Be_zyW4L.js → knowledgeBase-CLJybhnF.js} +16 -16
- package/dist/src/{knowledgeBase-CEzQobWX.js → knowledgeBase-CoU-UQBg.js} +14 -9
- package/dist/src/{knowledgeBase-BZ41IFwq.js → knowledgeBase-DjWPVqSb.js} +14 -18
- package/dist/src/{knowledgeBase-D-5BMXlr.cjs → knowledgeBase-wkxuRFhA.cjs} +14 -15
- package/dist/src/{litellm-DnbRJ2if.js → litellm-B9Hysuri.js} +16 -18
- package/dist/src/{litellm-CRDqPhNI.js → litellm-CTfa0hqi.js} +15 -17
- package/dist/src/{litellm-hUSNM_M2.cjs → litellm-NYpQ8RQu.cjs} +15 -16
- package/dist/src/{litellm-9vR8zpfU.js → litellm-ePxtr9F1.js} +15 -4
- 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-Hm3d6VJE.cjs → luma-ray-B0GGNRc1.cjs} +20 -21
- package/dist/src/{luma-ray-drvgdpP9.js → luma-ray-BE2mOt6N.js} +20 -13
- package/dist/src/{luma-ray-4blv9iZ2.js → luma-ray-BW9IRGIc.js} +22 -21
- package/dist/src/{luma-ray-B2__8lYH.js → luma-ray-Cm1KZBhs.js} +20 -23
- package/dist/src/main.js +1170 -1321
- package/dist/src/{messages-XhiwCbi4.cjs → messages-1JrJs91T.cjs} +32 -34
- package/dist/src/{messages-CGPPidQr.js → messages-1x9atZmP.js} +22 -24
- package/dist/src/{messages-Uee41Mj5.js → messages-BLbWdsyt.js} +22 -24
- package/dist/src/messages-D8EA0oDc.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-C1OLRmVX.js} +17 -10
- package/dist/src/{modelslab-E9gO-bYd.js → modelslab-CqXBy3U8.js} +18 -20
- package/dist/src/{modelslab-lUVW0cmB.cjs → modelslab-DcOSFwKh.cjs} +17 -18
- package/dist/src/{modelslab-ClBkr8_9.js → modelslab-X5-4LroM.js} +17 -19
- package/dist/src/{nova-reel-Dk8jNpId.js → nova-reel-BgS1ZWuK.js} +20 -13
- package/dist/src/{nova-reel-u2eF2Cxm.js → nova-reel-D2ZkOSyr.js} +22 -21
- package/dist/src/{nova-reel-D8CuO6QH.cjs → nova-reel-D9xfaMBs.cjs} +20 -21
- package/dist/src/{nova-reel-P9bwvtYX.js → nova-reel-DihqLeol.js} +20 -23
- package/dist/src/{nova-sonic-Ds1C-dpm.cjs → nova-sonic-DVu3mMIy.cjs} +30 -31
- package/dist/src/{nova-sonic-CK2rAiKi.js → nova-sonic-DezhVUYT.js} +30 -26
- package/dist/src/{nova-sonic-BaqWlkds.js → nova-sonic-P-CdUMlV.js} +30 -31
- package/dist/src/{nova-sonic-yZapPLv7.js → nova-sonic-Q3BOJeig.js} +31 -32
- 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-A-3_loM7.js → openclaw-BiSZPL7J.js} +20 -14
- package/dist/src/{openclaw-COn6QzDi.js → openclaw-Bv1DINsX.js} +20 -27
- package/dist/src/{openclaw-a3lylB-V.js → openclaw-D1D_ej1z.js} +21 -28
- package/dist/src/{openclaw-B6qqDr_u.cjs → openclaw-DAfWQn-o.cjs} +33 -39
- package/dist/src/opencode-sdk-C7m-wRfI.js +560 -0
- package/dist/src/opencode-sdk-CfaLN8PY.cjs +564 -0
- package/dist/src/opencode-sdk-D95s6SnR.js +562 -0
- package/dist/src/opencode-sdk-DxUPkLT7.js +560 -0
- package/dist/src/{otlpReceiver-oyf5wLGC.js → otlpReceiver--AIRW_S4.js} +53 -51
- package/dist/src/{otlpReceiver-BmmTiMjA.js → otlpReceiver-Bn5wGB1v.js} +53 -55
- package/dist/src/{otlpReceiver-lXsYVbpj.cjs → otlpReceiver-Diec4cln.cjs} +53 -55
- package/dist/src/{otlpReceiver-94URx7UW.js → otlpReceiver-g3ByGaXs.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-B3HvufyI.js +33246 -0
- package/dist/src/{providers-BnFpbY_s.js → providers-BKRJTjBz.js} +1536 -1669
- package/dist/src/providers-C1rOSHiR.js +32 -0
- package/dist/src/{providers-Iil64vk9.js → providers-CFLy1_ji.js} +1543 -1676
- package/dist/src/{providers-DHbjzW2e.cjs → providers-CFu-TZl-.cjs} +1896 -2029
- package/dist/src/providers-CxmDwEFf.cjs +31 -0
- package/dist/src/providers-Dodakqr0.js +30 -0
- package/dist/src/providers-GIQ2TcsA.js +30 -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-C2jVwbH1.js} +8 -7
- package/dist/src/{quiverai-DCGSZt4U.js → quiverai-CI6gYJVI.js} +8 -10
- package/dist/src/{quiverai-DiMVJQDz.cjs → quiverai-CLkWkyZc.cjs} +8 -9
- package/dist/src/{quiverai-fQNkExW4.js → quiverai-MHSxbmmZ.js} +9 -11
- package/dist/src/{render-Dj1smHEb.js → render-Drod8m7K.js} +4 -5
- package/dist/src/{responses-DOAFFENS.js → responses-BKqJmhhc.js} +22 -25
- package/dist/src/{responses-CxzoQoBe.js → responses-CGw0DCzh.js} +22 -25
- package/dist/src/responses-jxdehPkC.js +660 -0
- package/dist/src/{responses-ghR3IOfy.cjs → responses-tD4Bd4dc.cjs} +37 -40
- 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-BK4Zb993.js} +75 -70
- package/dist/src/{sagemaker-DuM71dVU.js → sagemaker-BfiWTmvn.js} +77 -77
- package/dist/src/{sagemaker-77zbJ2Q2.cjs → sagemaker-CcQHM1jV.cjs} +75 -76
- package/dist/src/{sagemaker-CcxhlOAR.js → sagemaker-D2Q1c-sD.js} +75 -79
- package/dist/src/{scanner-DJYiSXQj.js → scanner-J8CA3LsV.js} +100 -121
- package/dist/src/server/index.js +5505 -67416
- package/dist/src/{server-B5v33lvE.cjs → server-B0PPuDw-.cjs} +57 -67
- package/dist/src/server-B1vi21hA.js +7 -0
- package/dist/src/{server-RV_i_YX5.js → server-BC7XJFgr.js} +19 -24
- package/dist/src/server-Cm9Kai_h.cjs +5 -0
- package/dist/src/{server-BJ4m4f1D.js → server-DbFphssR.js} +26 -29
- package/dist/src/server-OAs3nBRT.js +229 -0
- package/dist/src/{signal-BW33JuId.js → signal-BOTbd53Z.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-BNmZ1KAz.cjs +5 -0
- package/dist/src/{store-D7CgQzAR.cjs → store-BSc-TF2w.cjs} +44 -45
- package/dist/src/store-BltJg2cd.js +6 -0
- package/dist/src/{store-s3SftUwF.js → store-D1tv90v3.js} +34 -35
- package/dist/src/{store-DJNsD1iC.js → store-DQLEjuEO.js} +40 -36
- package/dist/src/store-Ub2vaGJ1.js +228 -0
- package/dist/src/{tables-DfTsNN7X.js → tables-5EvT_Bwn.js} +19 -21
- package/dist/src/{tables-BKTmd6u7.cjs → tables-C7K-XKWp.cjs} +89 -91
- package/dist/src/{tables-DMegD0Xf.js → tables-D36WTqKX.js} +21 -23
- package/dist/src/tables-xKANLRBD.js +288 -0
- package/dist/src/telemetry-5BCRNBbe.cjs +5 -0
- package/dist/src/{telemetry-BedSm-bZ.js → telemetry-C15ziL8u.js} +17 -14
- package/dist/src/{telemetry--WAdAfVi.js → telemetry-C2YDkUQH.js} +11 -13
- package/dist/src/{telemetry-DQgVBCAb.cjs → telemetry-CbrnxHp_.cjs} +21 -24
- package/dist/src/telemetry-D4W5hboe.js +7 -0
- package/dist/src/telemetry-DMb2Mpfm.js +171 -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-BO1AHegO.cjs → transcription-CL78qbOU.cjs} +14 -15
- package/dist/src/{transcription-mYS9vd5v.js → transcription-DAtxHhAM.js} +14 -7
- package/dist/src/{transcription-X2-B4vkX.js → transcription-LNZTNUUL.js} +14 -16
- package/dist/src/{transcription-lzBLiTFJ.js → transcription-QHh3AH6Z.js} +15 -17
- package/dist/src/{transform-DeGlxb0D.js → transform-Cgi24fJ7.js} +39 -47
- package/dist/src/{transform-B1Hi5lWS.cjs → transform-CzK1Q0zl.cjs} +24 -26
- package/dist/src/{transform-CYDILYDe.js → transform-DECvGmzp.js} +15 -13
- package/dist/src/{transform-Dfl89yi4.js → transform-DGLazrMm.js} +39 -47
- package/dist/src/transform-DGxXocjk.js +1506 -0
- package/dist/src/{transform-D5PjiWiZ.cjs → transform-DOcQeLld.cjs} +179 -187
- package/dist/src/transform-DTGDnAzW.js +6 -0
- package/dist/src/{transform-BEgStbHK.js → transform-DilY9wbS.js} +10 -12
- package/dist/src/transform-aa6tmVpZ.js +216 -0
- package/dist/src/transform-m3qNw4KP.cjs +5 -0
- 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-CXQduE9o.js → types-CH3Ge2sE.js} +30 -90
- package/dist/src/{types-C5hEkb-x.js → types-CLKiCBW3.js} +25 -89
- package/dist/src/types-CN_TZ2GJ.js +3260 -0
- package/dist/src/{types-DWNf48sT.cjs → types-LJ0r3wbR.cjs} +500 -564
- package/dist/src/util-5cB-L7U3.js +1430 -0
- package/dist/src/util-6-GqIvzS.js +599 -0
- package/dist/src/{util-CoQjmE3u.js → util-B7T3SiBS.js} +4 -5
- package/dist/src/{util-D9eLdGfa.js → util-Betm42rL.js} +5 -6
- package/dist/src/{util-Bm_-UMD_.js → util-C-PPYSMq.js} +5 -6
- package/dist/src/{util-CyUdMzV0.cjs → util-CchiqXh_.cjs} +34 -35
- package/dist/src/{util-Du96oyYS.js → util-DaWTWKBK.js} +4 -5
- package/dist/src/{util-1wWM599Z.cjs → util-Db0a0AFH.cjs} +50 -51
- package/dist/src/{util-DQ984syk.js → util-Dlz_Wvgm.js} +37 -48
- package/dist/src/{util-_h4pVqrz.js → util-YT5HPZaS.js} +37 -48
- package/dist/src/{util-aLhtl3fe.cjs → util-Yz-1aEhW.cjs} +209 -220
- package/dist/src/util-ZZH-3QZz.js +293 -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 +30 -30
- package/dist/src/app/assets/index-B2D0bCSI.js +0 -439
- package/dist/src/app/tsconfig.app.tsbuildinfo +0 -1
- 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
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ It works on the command line too:
|
|
|
64
64
|
|
|
65
65
|
It also can generate [security vulnerability reports](https://www.promptfoo.dev/docs/red-team/):
|
|
66
66
|
|
|
67
|
-
<img src="https://www.promptfoo.dev/img/
|
|
67
|
+
<img src="https://www.promptfoo.dev/img/redteam-dashboard@2x.jpg" alt="gen ai red team" width="700">
|
|
68
68
|
|
|
69
69
|
## Why Promptfoo?
|
|
70
70
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { Box, Text, useApp, useInput } from "ink";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
5
|
//#region src/ui/init/components/shared/TextInput.tsx
|
|
7
6
|
/**
|
|
8
7
|
* TextInput - Single-line text input component.
|
|
@@ -103,7 +102,6 @@ function TextInput({ value, onChange, onSubmit, placeholder = "", isFocused = tr
|
|
|
103
102
|
]
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
|
-
|
|
107
105
|
//#endregion
|
|
108
106
|
//#region src/ui/list/ListApp.tsx
|
|
109
107
|
/**
|
|
@@ -575,7 +573,7 @@ function ListApp({ resourceType, items: initialItems = [], onSelect, onExit, onL
|
|
|
575
573
|
]
|
|
576
574
|
});
|
|
577
575
|
}
|
|
578
|
-
|
|
579
576
|
//#endregion
|
|
580
577
|
export { ListApp };
|
|
581
|
-
|
|
578
|
+
|
|
579
|
+
//# sourceMappingURL=ListApp-Du7YVwj5.js.map
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { C as isCI, b as getEnvString, i as logger } from "./logger-DLcq4dWf.js";
|
|
2
|
+
import { O as TERMINAL_MAX_WIDTH, a as CloudConfig, c as writeGlobalConfig, l as writeGlobalConfigPartial, r as fetchWithTimeout, s as readGlobalConfig } from "./fetch-4M3YRaqL.js";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import input from "@inquirer/input";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
const BAD_EMAIL_RESULT = "bad_email";
|
|
7
|
+
const EmailValidationStatus = {
|
|
8
|
+
OK: "ok",
|
|
9
|
+
EXCEEDED_LIMIT: "exceeded_limit",
|
|
10
|
+
SHOW_USAGE_WARNING: "show_usage_warning",
|
|
11
|
+
EMAIL_VERIFICATION_REQUIRED: "email_verification_required",
|
|
12
|
+
RISKY_EMAIL: "risky_email",
|
|
13
|
+
DISPOSABLE_EMAIL: "disposable_email"
|
|
14
|
+
};
|
|
15
|
+
const NO_EMAIL_STATUS = "no_email";
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/globalConfig/accounts.ts
|
|
18
|
+
const CI_PLACEHOLDER_EMAIL = "ci-placeholder@promptfoo.dev";
|
|
19
|
+
function getUserId() {
|
|
20
|
+
let globalConfig = readGlobalConfig();
|
|
21
|
+
if (!globalConfig?.id) {
|
|
22
|
+
const newId = crypto.randomUUID();
|
|
23
|
+
globalConfig = {
|
|
24
|
+
...globalConfig,
|
|
25
|
+
id: newId
|
|
26
|
+
};
|
|
27
|
+
writeGlobalConfig(globalConfig);
|
|
28
|
+
return newId;
|
|
29
|
+
}
|
|
30
|
+
return globalConfig.id;
|
|
31
|
+
}
|
|
32
|
+
function getUserEmail() {
|
|
33
|
+
return readGlobalConfig()?.account?.email || null;
|
|
34
|
+
}
|
|
35
|
+
function setUserEmail(email) {
|
|
36
|
+
const account = readGlobalConfig()?.account ?? {};
|
|
37
|
+
account.email = email;
|
|
38
|
+
writeGlobalConfigPartial({ account });
|
|
39
|
+
}
|
|
40
|
+
function clearUserEmail() {
|
|
41
|
+
const account = readGlobalConfig()?.account ?? {};
|
|
42
|
+
delete account.email;
|
|
43
|
+
writeGlobalConfigPartial({ account });
|
|
44
|
+
}
|
|
45
|
+
function getUserEmailNeedsValidation() {
|
|
46
|
+
return readGlobalConfig()?.account?.emailNeedsValidation || false;
|
|
47
|
+
}
|
|
48
|
+
function setUserEmailNeedsValidation(needsValidation) {
|
|
49
|
+
const account = readGlobalConfig()?.account ?? {};
|
|
50
|
+
account.emailNeedsValidation = needsValidation;
|
|
51
|
+
writeGlobalConfigPartial({ account });
|
|
52
|
+
}
|
|
53
|
+
function getUserEmailValidated() {
|
|
54
|
+
return readGlobalConfig()?.account?.emailValidated || false;
|
|
55
|
+
}
|
|
56
|
+
function setUserEmailValidated(validated) {
|
|
57
|
+
const account = readGlobalConfig()?.account ?? {};
|
|
58
|
+
account.emailValidated = validated;
|
|
59
|
+
writeGlobalConfigPartial({ account });
|
|
60
|
+
}
|
|
61
|
+
function getAuthor() {
|
|
62
|
+
return getEnvString("PROMPTFOO_AUTHOR") || getUserEmail() || null;
|
|
63
|
+
}
|
|
64
|
+
function isLoggedIntoCloud() {
|
|
65
|
+
return new CloudConfig().isEnabled();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get the authentication method used for cloud access
|
|
69
|
+
* @returns 'api-key' | 'email' | 'none'
|
|
70
|
+
*/
|
|
71
|
+
function getAuthMethod() {
|
|
72
|
+
const hasApiKey = new CloudConfig().isEnabled();
|
|
73
|
+
const hasEmail = !!getUserEmail();
|
|
74
|
+
if (hasApiKey && hasEmail) return "api-key";
|
|
75
|
+
if (hasApiKey) return "api-key";
|
|
76
|
+
if (hasEmail) return "email";
|
|
77
|
+
return "none";
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Shared function to check email status with the promptfoo API
|
|
81
|
+
* Used by both CLI and server routes
|
|
82
|
+
*/
|
|
83
|
+
async function checkEmailStatus(options) {
|
|
84
|
+
const { default: telemetry } = await import("./telemetry-DMb2Mpfm.js").then((n) => n.r);
|
|
85
|
+
const ciMode = isCI();
|
|
86
|
+
const userEmail = ciMode ? CI_PLACEHOLDER_EMAIL : getUserEmail();
|
|
87
|
+
if (!userEmail) return {
|
|
88
|
+
status: NO_EMAIL_STATUS,
|
|
89
|
+
hasEmail: false,
|
|
90
|
+
message: "Redteam evals require email verification. Please enter your work email:"
|
|
91
|
+
};
|
|
92
|
+
if (ciMode) return {
|
|
93
|
+
status: EmailValidationStatus.OK,
|
|
94
|
+
hasEmail: true,
|
|
95
|
+
email: userEmail
|
|
96
|
+
};
|
|
97
|
+
try {
|
|
98
|
+
const validateParam = options?.validate ? "&validate=true" : "";
|
|
99
|
+
const timeout = options?.validate ? 3e3 : 500;
|
|
100
|
+
if (options?.validate) logger.info(`Checking email...`);
|
|
101
|
+
const data = await (await fetchWithTimeout(`${getEnvString("PROMPTFOO_CLOUD_API_URL", "https://api.promptfoo.app")}/api/users/status?email=${encodeURIComponent(userEmail)}${validateParam}`, void 0, timeout)).json();
|
|
102
|
+
if (options?.validate) if (new Set([
|
|
103
|
+
EmailValidationStatus.RISKY_EMAIL,
|
|
104
|
+
EmailValidationStatus.DISPOSABLE_EMAIL,
|
|
105
|
+
EmailValidationStatus.EMAIL_VERIFICATION_REQUIRED
|
|
106
|
+
]).has(data.status)) {
|
|
107
|
+
if (data.status === EmailValidationStatus.EMAIL_VERIFICATION_REQUIRED) {
|
|
108
|
+
setUserEmailValidated(false);
|
|
109
|
+
setUserEmailNeedsValidation(true);
|
|
110
|
+
}
|
|
111
|
+
if (data.status === EmailValidationStatus.RISKY_EMAIL || data.status === EmailValidationStatus.DISPOSABLE_EMAIL) await telemetry.saveConsent(userEmail, { source: "filteredInvalidEmail" });
|
|
112
|
+
} else {
|
|
113
|
+
setUserEmailValidated(true);
|
|
114
|
+
await telemetry.saveConsent(userEmail, { source: "promptForEmailValidated" });
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
status: data.status,
|
|
118
|
+
message: data.message ?? data.error,
|
|
119
|
+
email: userEmail,
|
|
120
|
+
hasEmail: true
|
|
121
|
+
};
|
|
122
|
+
} catch (e) {
|
|
123
|
+
logger.debug(`Failed to check user status: ${e}`);
|
|
124
|
+
return {
|
|
125
|
+
status: EmailValidationStatus.OK,
|
|
126
|
+
message: "Unable to verify email status, but proceeding",
|
|
127
|
+
email: userEmail,
|
|
128
|
+
hasEmail: true
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function promptForEmailUnverified() {
|
|
133
|
+
const { default: telemetry } = await import("./telemetry-DMb2Mpfm.js").then((n) => n.r);
|
|
134
|
+
const ciMode = isCI();
|
|
135
|
+
const existingEmail = getUserEmail();
|
|
136
|
+
let email = ciMode ? CI_PLACEHOLDER_EMAIL : existingEmail;
|
|
137
|
+
const existingEmailNeedsValidation = !ciMode && getUserEmailNeedsValidation();
|
|
138
|
+
const existingEmailValidated = ciMode || getUserEmailValidated();
|
|
139
|
+
let emailNeedsValidation = existingEmailNeedsValidation && !existingEmailValidated;
|
|
140
|
+
if (!email) {
|
|
141
|
+
await telemetry.record("feature_used", { feature: "promptForEmailUnverified" });
|
|
142
|
+
const border = "─".repeat(TERMINAL_MAX_WIDTH);
|
|
143
|
+
logger.info("");
|
|
144
|
+
logger.info(chalk.cyan(border));
|
|
145
|
+
logger.info(chalk.cyan.bold(" Email Verification Required"));
|
|
146
|
+
logger.info(chalk.cyan(border));
|
|
147
|
+
logger.info("");
|
|
148
|
+
logger.info(" Red team scans require email verification to continue.");
|
|
149
|
+
logger.info("");
|
|
150
|
+
const emailSchema = z.email();
|
|
151
|
+
try {
|
|
152
|
+
email = await input({
|
|
153
|
+
message: chalk.bold("Work email:"),
|
|
154
|
+
validate: (input) => {
|
|
155
|
+
const result = emailSchema.safeParse(input);
|
|
156
|
+
return result.success || result.error.issues[0].message;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
} catch (error) {
|
|
160
|
+
const err = error;
|
|
161
|
+
if (err?.name === "AbortPromptError" || err?.name === "ExitPromptError") process.exit(1);
|
|
162
|
+
logger.error(`failed to prompt for email: ${err}`);
|
|
163
|
+
throw err;
|
|
164
|
+
}
|
|
165
|
+
setUserEmail(email);
|
|
166
|
+
setUserEmailNeedsValidation(true);
|
|
167
|
+
setUserEmailValidated(false);
|
|
168
|
+
emailNeedsValidation = true;
|
|
169
|
+
await telemetry.record("feature_used", { feature: "userCompletedPromptForEmailUnverified" });
|
|
170
|
+
}
|
|
171
|
+
return { emailNeedsValidation };
|
|
172
|
+
}
|
|
173
|
+
async function checkEmailStatusAndMaybeExit(options) {
|
|
174
|
+
const result = await checkEmailStatus(options);
|
|
175
|
+
if (isCI()) return "ok";
|
|
176
|
+
if (result.status === EmailValidationStatus.RISKY_EMAIL || result.status === EmailValidationStatus.DISPOSABLE_EMAIL) {
|
|
177
|
+
logger.error("Please use a valid work email.");
|
|
178
|
+
setUserEmail("");
|
|
179
|
+
return BAD_EMAIL_RESULT;
|
|
180
|
+
}
|
|
181
|
+
if (result.status === EmailValidationStatus.EXCEEDED_LIMIT) {
|
|
182
|
+
logger.error("You have exceeded the maximum cloud inference limit. Please contact inquiries@promptfoo.dev to upgrade your account.");
|
|
183
|
+
process.exit(1);
|
|
184
|
+
}
|
|
185
|
+
if (result.status === EmailValidationStatus.EMAIL_VERIFICATION_REQUIRED) {
|
|
186
|
+
setUserEmailNeedsValidation(true);
|
|
187
|
+
setUserEmailValidated(false);
|
|
188
|
+
const message = result.message || "Your email address is not verified. Check your inbox for a verification link, then rerun the command.";
|
|
189
|
+
logger.error(message, {
|
|
190
|
+
status: result.status,
|
|
191
|
+
hasEmail: result.hasEmail
|
|
192
|
+
});
|
|
193
|
+
process.exit(1);
|
|
194
|
+
}
|
|
195
|
+
if (result.status === EmailValidationStatus.SHOW_USAGE_WARNING && result.message) {
|
|
196
|
+
const border = "=".repeat(TERMINAL_MAX_WIDTH);
|
|
197
|
+
logger.info(chalk.yellow(border));
|
|
198
|
+
logger.warn(chalk.yellow(result.message));
|
|
199
|
+
logger.info(chalk.yellow(border));
|
|
200
|
+
}
|
|
201
|
+
return "ok";
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
export { getAuthor as a, isLoggedIntoCloud as c, getAuthMethod as i, promptForEmailUnverified as l, checkEmailStatusAndMaybeExit as n, getUserEmail as o, clearUserEmail as r, getUserId as s, checkEmailStatus as t, setUserEmail as u };
|
|
205
|
+
|
|
206
|
+
//# sourceMappingURL=accounts-BgNJDBE6.js.map
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
const require_logger = require(
|
|
2
|
-
const require_fetch = require(
|
|
1
|
+
const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
2
|
+
const require_fetch = require("./fetch-BxUk8odA.cjs");
|
|
3
3
|
let chalk = require("chalk");
|
|
4
4
|
chalk = require_logger.__toESM(chalk);
|
|
5
5
|
let zod = require("zod");
|
|
6
6
|
let _inquirer_input = require("@inquirer/input");
|
|
7
7
|
_inquirer_input = require_logger.__toESM(_inquirer_input);
|
|
8
|
-
|
|
9
|
-
//#region src/types/email.ts
|
|
10
|
-
const EMAIL_OK_STATUS = "ok";
|
|
11
8
|
const BAD_EMAIL_RESULT = "bad_email";
|
|
12
9
|
const EmailValidationStatus = {
|
|
13
|
-
OK:
|
|
10
|
+
OK: "ok",
|
|
14
11
|
EXCEEDED_LIMIT: "exceeded_limit",
|
|
15
12
|
SHOW_USAGE_WARNING: "show_usage_warning",
|
|
16
13
|
EMAIL_VERIFICATION_REQUIRED: "email_verification_required",
|
|
@@ -18,9 +15,9 @@ const EmailValidationStatus = {
|
|
|
18
15
|
DISPOSABLE_EMAIL: "disposable_email"
|
|
19
16
|
};
|
|
20
17
|
const NO_EMAIL_STATUS = "no_email";
|
|
21
|
-
|
|
22
18
|
//#endregion
|
|
23
19
|
//#region src/globalConfig/accounts.ts
|
|
20
|
+
const CI_PLACEHOLDER_EMAIL = "ci-placeholder@promptfoo.dev";
|
|
24
21
|
function getUserId() {
|
|
25
22
|
let globalConfig = require_fetch.readGlobalConfig();
|
|
26
23
|
if (!globalConfig?.id) {
|
|
@@ -81,17 +78,23 @@ function getAuthMethod() {
|
|
|
81
78
|
* Used by both CLI and server routes
|
|
82
79
|
*/
|
|
83
80
|
async function checkEmailStatus(options) {
|
|
84
|
-
const { default: telemetry } = await Promise.resolve().then(() => require("./telemetry-
|
|
85
|
-
const
|
|
81
|
+
const { default: telemetry } = await Promise.resolve().then(() => require("./telemetry-5BCRNBbe.cjs"));
|
|
82
|
+
const ciMode = require_logger.isCI();
|
|
83
|
+
const userEmail = ciMode ? CI_PLACEHOLDER_EMAIL : getUserEmail();
|
|
86
84
|
if (!userEmail) return {
|
|
87
85
|
status: NO_EMAIL_STATUS,
|
|
88
86
|
hasEmail: false,
|
|
89
87
|
message: "Redteam evals require email verification. Please enter your work email:"
|
|
90
88
|
};
|
|
89
|
+
if (ciMode) return {
|
|
90
|
+
status: EmailValidationStatus.OK,
|
|
91
|
+
hasEmail: true,
|
|
92
|
+
email: userEmail
|
|
93
|
+
};
|
|
91
94
|
try {
|
|
92
95
|
const validateParam = options?.validate ? "&validate=true" : "";
|
|
93
96
|
const timeout = options?.validate ? 3e3 : 500;
|
|
94
|
-
if (options?.validate) require_logger.
|
|
97
|
+
if (options?.validate) require_logger.logger.info(`Checking email...`);
|
|
95
98
|
const data = await (await require_fetch.fetchWithTimeout(`${require_logger.getEnvString("PROMPTFOO_CLOUD_API_URL", "https://api.promptfoo.app")}/api/users/status?email=${encodeURIComponent(userEmail)}${validateParam}`, void 0, timeout)).json();
|
|
96
99
|
if (options?.validate) if (new Set([
|
|
97
100
|
EmailValidationStatus.RISKY_EMAIL,
|
|
@@ -114,7 +117,7 @@ async function checkEmailStatus(options) {
|
|
|
114
117
|
hasEmail: true
|
|
115
118
|
};
|
|
116
119
|
} catch (e) {
|
|
117
|
-
require_logger.
|
|
120
|
+
require_logger.logger.debug(`Failed to check user status: ${e}`);
|
|
118
121
|
return {
|
|
119
122
|
status: EmailValidationStatus.OK,
|
|
120
123
|
message: "Unable to verify email status, but proceeding",
|
|
@@ -124,22 +127,23 @@ async function checkEmailStatus(options) {
|
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
129
|
async function promptForEmailUnverified() {
|
|
127
|
-
const { default: telemetry } = await Promise.resolve().then(() => require("./telemetry-
|
|
130
|
+
const { default: telemetry } = await Promise.resolve().then(() => require("./telemetry-5BCRNBbe.cjs"));
|
|
131
|
+
const ciMode = require_logger.isCI();
|
|
128
132
|
const existingEmail = getUserEmail();
|
|
129
|
-
let email =
|
|
130
|
-
const existingEmailNeedsValidation = !
|
|
131
|
-
const existingEmailValidated =
|
|
133
|
+
let email = ciMode ? CI_PLACEHOLDER_EMAIL : existingEmail;
|
|
134
|
+
const existingEmailNeedsValidation = !ciMode && getUserEmailNeedsValidation();
|
|
135
|
+
const existingEmailValidated = ciMode || getUserEmailValidated();
|
|
132
136
|
let emailNeedsValidation = existingEmailNeedsValidation && !existingEmailValidated;
|
|
133
137
|
if (!email) {
|
|
134
138
|
await telemetry.record("feature_used", { feature: "promptForEmailUnverified" });
|
|
135
139
|
const border = "─".repeat(require_fetch.TERMINAL_MAX_WIDTH);
|
|
136
|
-
require_logger.
|
|
137
|
-
require_logger.
|
|
138
|
-
require_logger.
|
|
139
|
-
require_logger.
|
|
140
|
-
require_logger.
|
|
141
|
-
require_logger.
|
|
142
|
-
require_logger.
|
|
140
|
+
require_logger.logger.info("");
|
|
141
|
+
require_logger.logger.info(chalk.default.cyan(border));
|
|
142
|
+
require_logger.logger.info(chalk.default.cyan.bold(" Email Verification Required"));
|
|
143
|
+
require_logger.logger.info(chalk.default.cyan(border));
|
|
144
|
+
require_logger.logger.info("");
|
|
145
|
+
require_logger.logger.info(" Red team scans require email verification to continue.");
|
|
146
|
+
require_logger.logger.info("");
|
|
143
147
|
const emailSchema = zod.z.email();
|
|
144
148
|
try {
|
|
145
149
|
email = await (0, _inquirer_input.default)({
|
|
@@ -152,7 +156,7 @@ async function promptForEmailUnverified() {
|
|
|
152
156
|
} catch (error) {
|
|
153
157
|
const err = error;
|
|
154
158
|
if (err?.name === "AbortPromptError" || err?.name === "ExitPromptError") process.exit(1);
|
|
155
|
-
require_logger.
|
|
159
|
+
require_logger.logger.error(`failed to prompt for email: ${err}`);
|
|
156
160
|
throw err;
|
|
157
161
|
}
|
|
158
162
|
setUserEmail(email);
|
|
@@ -165,20 +169,21 @@ async function promptForEmailUnverified() {
|
|
|
165
169
|
}
|
|
166
170
|
async function checkEmailStatusAndMaybeExit(options) {
|
|
167
171
|
const result = await checkEmailStatus(options);
|
|
172
|
+
if (require_logger.isCI()) return "ok";
|
|
168
173
|
if (result.status === EmailValidationStatus.RISKY_EMAIL || result.status === EmailValidationStatus.DISPOSABLE_EMAIL) {
|
|
169
|
-
require_logger.
|
|
174
|
+
require_logger.logger.error("Please use a valid work email.");
|
|
170
175
|
setUserEmail("");
|
|
171
176
|
return BAD_EMAIL_RESULT;
|
|
172
177
|
}
|
|
173
178
|
if (result.status === EmailValidationStatus.EXCEEDED_LIMIT) {
|
|
174
|
-
require_logger.
|
|
179
|
+
require_logger.logger.error("You have exceeded the maximum cloud inference limit. Please contact inquiries@promptfoo.dev to upgrade your account.");
|
|
175
180
|
process.exit(1);
|
|
176
181
|
}
|
|
177
182
|
if (result.status === EmailValidationStatus.EMAIL_VERIFICATION_REQUIRED) {
|
|
178
183
|
setUserEmailNeedsValidation(true);
|
|
179
184
|
setUserEmailValidated(false);
|
|
180
185
|
const message = result.message || "Your email address is not verified. Check your inbox for a verification link, then rerun the command.";
|
|
181
|
-
require_logger.
|
|
186
|
+
require_logger.logger.error(message, {
|
|
182
187
|
status: result.status,
|
|
183
188
|
hasEmail: result.hasEmail
|
|
184
189
|
});
|
|
@@ -186,66 +191,60 @@ async function checkEmailStatusAndMaybeExit(options) {
|
|
|
186
191
|
}
|
|
187
192
|
if (result.status === EmailValidationStatus.SHOW_USAGE_WARNING && result.message) {
|
|
188
193
|
const border = "=".repeat(require_fetch.TERMINAL_MAX_WIDTH);
|
|
189
|
-
require_logger.
|
|
190
|
-
require_logger.
|
|
191
|
-
require_logger.
|
|
194
|
+
require_logger.logger.info(chalk.default.yellow(border));
|
|
195
|
+
require_logger.logger.warn(chalk.default.yellow(result.message));
|
|
196
|
+
require_logger.logger.info(chalk.default.yellow(border));
|
|
192
197
|
}
|
|
193
|
-
return
|
|
198
|
+
return "ok";
|
|
194
199
|
}
|
|
195
|
-
|
|
196
200
|
//#endregion
|
|
197
|
-
Object.defineProperty(exports,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
});
|
|
203
|
-
Object.defineProperty(exports, 'checkEmailStatusAndMaybeExit', {
|
|
204
|
-
enumerable: true,
|
|
205
|
-
get: function () {
|
|
206
|
-
return checkEmailStatusAndMaybeExit;
|
|
207
|
-
}
|
|
201
|
+
Object.defineProperty(exports, "checkEmailStatusAndMaybeExit", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function() {
|
|
204
|
+
return checkEmailStatusAndMaybeExit;
|
|
205
|
+
}
|
|
208
206
|
});
|
|
209
|
-
Object.defineProperty(exports,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
207
|
+
Object.defineProperty(exports, "getAuthMethod", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function() {
|
|
210
|
+
return getAuthMethod;
|
|
211
|
+
}
|
|
214
212
|
});
|
|
215
|
-
Object.defineProperty(exports,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
Object.defineProperty(exports, "getAuthor", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function() {
|
|
216
|
+
return getAuthor;
|
|
217
|
+
}
|
|
220
218
|
});
|
|
221
|
-
Object.defineProperty(exports,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
219
|
+
Object.defineProperty(exports, "getUserEmail", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function() {
|
|
222
|
+
return getUserEmail;
|
|
223
|
+
}
|
|
226
224
|
});
|
|
227
|
-
Object.defineProperty(exports,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
225
|
+
Object.defineProperty(exports, "getUserId", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function() {
|
|
228
|
+
return getUserId;
|
|
229
|
+
}
|
|
232
230
|
});
|
|
233
|
-
Object.defineProperty(exports,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
231
|
+
Object.defineProperty(exports, "isLoggedIntoCloud", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function() {
|
|
234
|
+
return isLoggedIntoCloud;
|
|
235
|
+
}
|
|
238
236
|
});
|
|
239
|
-
Object.defineProperty(exports,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
237
|
+
Object.defineProperty(exports, "promptForEmailUnverified", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function() {
|
|
240
|
+
return promptForEmailUnverified;
|
|
241
|
+
}
|
|
244
242
|
});
|
|
245
|
-
Object.defineProperty(exports,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
243
|
+
Object.defineProperty(exports, "setUserEmail", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function() {
|
|
246
|
+
return setUserEmail;
|
|
247
|
+
}
|
|
250
248
|
});
|
|
251
|
-
|
|
249
|
+
|
|
250
|
+
//# sourceMappingURL=accounts-Bx-x3bmW.cjs.map
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as getEnvString, E as isCI, o as
|
|
3
|
-
import {
|
|
4
|
-
import { c as writeGlobalConfigPartial, o as readGlobalConfig, r as CloudConfig, s as writeGlobalConfig } from "./cloud-
|
|
2
|
+
import { C as getEnvString, E as isCI, o as logger } from "./logger-KkObSCzq.js";
|
|
3
|
+
import { D as TERMINAL_MAX_WIDTH, i as fetchWithTimeout } from "./fetch-BMv0O527.js";
|
|
4
|
+
import { c as writeGlobalConfigPartial, o as readGlobalConfig, r as CloudConfig, s as writeGlobalConfig } from "./cloud-Bc9526yV.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import input from "@inquirer/input";
|
|
7
7
|
import chalk from "chalk";
|
|
8
|
-
|
|
9
|
-
//#region src/types/email.ts
|
|
10
|
-
const EMAIL_OK_STATUS = "ok";
|
|
11
8
|
const BAD_EMAIL_RESULT = "bad_email";
|
|
12
9
|
const EmailValidationStatus = {
|
|
13
|
-
OK:
|
|
10
|
+
OK: "ok",
|
|
14
11
|
EXCEEDED_LIMIT: "exceeded_limit",
|
|
15
12
|
SHOW_USAGE_WARNING: "show_usage_warning",
|
|
16
13
|
EMAIL_VERIFICATION_REQUIRED: "email_verification_required",
|
|
@@ -18,9 +15,9 @@ const EmailValidationStatus = {
|
|
|
18
15
|
DISPOSABLE_EMAIL: "disposable_email"
|
|
19
16
|
};
|
|
20
17
|
const NO_EMAIL_STATUS = "no_email";
|
|
21
|
-
|
|
22
18
|
//#endregion
|
|
23
19
|
//#region src/globalConfig/accounts.ts
|
|
20
|
+
const CI_PLACEHOLDER_EMAIL = "ci-placeholder@promptfoo.dev";
|
|
24
21
|
function getUserId() {
|
|
25
22
|
let globalConfig = readGlobalConfig();
|
|
26
23
|
if (!globalConfig?.id) {
|
|
@@ -86,17 +83,23 @@ function getAuthMethod() {
|
|
|
86
83
|
* Used by both CLI and server routes
|
|
87
84
|
*/
|
|
88
85
|
async function checkEmailStatus(options) {
|
|
89
|
-
const { default: telemetry } = await import("./telemetry-
|
|
90
|
-
const
|
|
86
|
+
const { default: telemetry } = await import("./telemetry-D4W5hboe.js");
|
|
87
|
+
const ciMode = isCI();
|
|
88
|
+
const userEmail = ciMode ? CI_PLACEHOLDER_EMAIL : getUserEmail();
|
|
91
89
|
if (!userEmail) return {
|
|
92
90
|
status: NO_EMAIL_STATUS,
|
|
93
91
|
hasEmail: false,
|
|
94
92
|
message: "Redteam evals require email verification. Please enter your work email:"
|
|
95
93
|
};
|
|
94
|
+
if (ciMode) return {
|
|
95
|
+
status: EmailValidationStatus.OK,
|
|
96
|
+
hasEmail: true,
|
|
97
|
+
email: userEmail
|
|
98
|
+
};
|
|
96
99
|
try {
|
|
97
100
|
const validateParam = options?.validate ? "&validate=true" : "";
|
|
98
101
|
const timeout = options?.validate ? 3e3 : 500;
|
|
99
|
-
if (options?.validate)
|
|
102
|
+
if (options?.validate) logger.info(`Checking email...`);
|
|
100
103
|
const data = await (await fetchWithTimeout(`${getEnvString("PROMPTFOO_CLOUD_API_URL", "https://api.promptfoo.app")}/api/users/status?email=${encodeURIComponent(userEmail)}${validateParam}`, void 0, timeout)).json();
|
|
101
104
|
if (options?.validate) if (new Set([
|
|
102
105
|
EmailValidationStatus.RISKY_EMAIL,
|
|
@@ -119,7 +122,7 @@ async function checkEmailStatus(options) {
|
|
|
119
122
|
hasEmail: true
|
|
120
123
|
};
|
|
121
124
|
} catch (e) {
|
|
122
|
-
|
|
125
|
+
logger.debug(`Failed to check user status: ${e}`);
|
|
123
126
|
return {
|
|
124
127
|
status: EmailValidationStatus.OK,
|
|
125
128
|
message: "Unable to verify email status, but proceeding",
|
|
@@ -129,22 +132,23 @@ async function checkEmailStatus(options) {
|
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
134
|
async function promptForEmailUnverified() {
|
|
132
|
-
const { default: telemetry } = await import("./telemetry-
|
|
135
|
+
const { default: telemetry } = await import("./telemetry-D4W5hboe.js");
|
|
136
|
+
const ciMode = isCI();
|
|
133
137
|
const existingEmail = getUserEmail();
|
|
134
|
-
let email =
|
|
135
|
-
const existingEmailNeedsValidation = !
|
|
136
|
-
const existingEmailValidated =
|
|
138
|
+
let email = ciMode ? CI_PLACEHOLDER_EMAIL : existingEmail;
|
|
139
|
+
const existingEmailNeedsValidation = !ciMode && getUserEmailNeedsValidation();
|
|
140
|
+
const existingEmailValidated = ciMode || getUserEmailValidated();
|
|
137
141
|
let emailNeedsValidation = existingEmailNeedsValidation && !existingEmailValidated;
|
|
138
142
|
if (!email) {
|
|
139
143
|
await telemetry.record("feature_used", { feature: "promptForEmailUnverified" });
|
|
140
144
|
const border = "─".repeat(TERMINAL_MAX_WIDTH);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
logger.info("");
|
|
146
|
+
logger.info(chalk.cyan(border));
|
|
147
|
+
logger.info(chalk.cyan.bold(" Email Verification Required"));
|
|
148
|
+
logger.info(chalk.cyan(border));
|
|
149
|
+
logger.info("");
|
|
150
|
+
logger.info(" Red team scans require email verification to continue.");
|
|
151
|
+
logger.info("");
|
|
148
152
|
const emailSchema = z.email();
|
|
149
153
|
try {
|
|
150
154
|
email = await input({
|
|
@@ -157,7 +161,7 @@ async function promptForEmailUnverified() {
|
|
|
157
161
|
} catch (error) {
|
|
158
162
|
const err = error;
|
|
159
163
|
if (err?.name === "AbortPromptError" || err?.name === "ExitPromptError") process.exit(1);
|
|
160
|
-
|
|
164
|
+
logger.error(`failed to prompt for email: ${err}`);
|
|
161
165
|
throw err;
|
|
162
166
|
}
|
|
163
167
|
setUserEmail(email);
|
|
@@ -170,20 +174,21 @@ async function promptForEmailUnverified() {
|
|
|
170
174
|
}
|
|
171
175
|
async function checkEmailStatusAndMaybeExit(options) {
|
|
172
176
|
const result = await checkEmailStatus(options);
|
|
177
|
+
if (isCI()) return "ok";
|
|
173
178
|
if (result.status === EmailValidationStatus.RISKY_EMAIL || result.status === EmailValidationStatus.DISPOSABLE_EMAIL) {
|
|
174
|
-
|
|
179
|
+
logger.error("Please use a valid work email.");
|
|
175
180
|
setUserEmail("");
|
|
176
181
|
return BAD_EMAIL_RESULT;
|
|
177
182
|
}
|
|
178
183
|
if (result.status === EmailValidationStatus.EXCEEDED_LIMIT) {
|
|
179
|
-
|
|
184
|
+
logger.error("You have exceeded the maximum cloud inference limit. Please contact inquiries@promptfoo.dev to upgrade your account.");
|
|
180
185
|
process.exit(1);
|
|
181
186
|
}
|
|
182
187
|
if (result.status === EmailValidationStatus.EMAIL_VERIFICATION_REQUIRED) {
|
|
183
188
|
setUserEmailNeedsValidation(true);
|
|
184
189
|
setUserEmailValidated(false);
|
|
185
190
|
const message = result.message || "Your email address is not verified. Check your inbox for a verification link, then rerun the command.";
|
|
186
|
-
|
|
191
|
+
logger.error(message, {
|
|
187
192
|
status: result.status,
|
|
188
193
|
hasEmail: result.hasEmail
|
|
189
194
|
});
|
|
@@ -191,13 +196,13 @@ async function checkEmailStatusAndMaybeExit(options) {
|
|
|
191
196
|
}
|
|
192
197
|
if (result.status === EmailValidationStatus.SHOW_USAGE_WARNING && result.message) {
|
|
193
198
|
const border = "=".repeat(TERMINAL_MAX_WIDTH);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
199
|
+
logger.info(chalk.yellow(border));
|
|
200
|
+
logger.warn(chalk.yellow(result.message));
|
|
201
|
+
logger.info(chalk.yellow(border));
|
|
197
202
|
}
|
|
198
|
-
return
|
|
203
|
+
return "ok";
|
|
199
204
|
}
|
|
200
|
-
|
|
201
205
|
//#endregion
|
|
202
|
-
export { getAuthor as a, isLoggedIntoCloud as c,
|
|
203
|
-
|
|
206
|
+
export { getAuthor as a, isLoggedIntoCloud as c, getAuthMethod as i, promptForEmailUnverified as l, checkEmailStatusAndMaybeExit as n, getUserEmail as o, clearUserEmail as r, getUserId as s, checkEmailStatus as t, setUserEmail as u };
|
|
207
|
+
|
|
208
|
+
//# sourceMappingURL=accounts-CMqkzrVf.js.map
|