promptfoo 0.120.26 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/drizzle/0023_wooden_mandrill.sql +2 -0
- package/dist/drizzle/meta/0023_snapshot.json +1496 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/src/{ListApp-D3DG0F8h.js → ListApp-Du7YVwj5.js} +2 -4
- package/dist/src/accounts-BgNJDBE6.js +206 -0
- package/dist/src/{accounts-BzEY8H3v.cjs → accounts-Bx-x3bmW.cjs} +99 -80
- package/dist/src/{accounts-DHHiXsy6.js → accounts-CMqkzrVf.js} +61 -36
- package/dist/src/{accounts-R3gfCR_g.js → accounts-xrUGFA6n.js} +60 -35
- package/dist/src/{agentic-utils-D6_gzOUF.js → agentic-utils-BKIN5PKu.js} +9 -10
- package/dist/src/{agents-CwM7re15.cjs → agents-B0f4HICh.cjs} +37 -40
- package/dist/src/{agents-Cnph5GLD.js → agents-C-dDThPK.js} +37 -37
- package/dist/src/{agents-C7BiinFI.cjs → agents-CErsqg5U.cjs} +19 -27
- package/dist/src/{agents-v4cW_ZgC.js → agents-CVIn-Utx.js} +19 -22
- package/dist/src/{agents-GiUianme.js → agents-CXknwsFX.js} +37 -40
- package/dist/src/{agents-DETIQHqF.js → agents-DeH4Gu94.js} +21 -28
- package/dist/src/{agents-DYIT-hQy.js → agents-Dy2YpZpa.js} +38 -41
- package/dist/src/{agents-Cao4i7AX.js → agents-aF4-T121.js} +19 -30
- package/dist/src/{aimlapi-DMF6v_vb.js → aimlapi-BAGZDo5G.js} +16 -18
- package/dist/src/{aimlapi-CMJpKK-B.js → aimlapi-BNfTBexL.js} +15 -17
- package/dist/src/{aimlapi-DtSf1ykJ.js → aimlapi-DHRKlBEA.js} +15 -4
- package/dist/src/{aimlapi-DoGLcQW_.cjs → aimlapi-tg0Gkcvr.cjs} +15 -16
- package/dist/src/app/assets/index-BFCZg7hQ.js +439 -0
- package/dist/src/app/assets/index-NCn4eVBv.css +1 -0
- package/dist/src/app/assets/{vendor-charts-CYyo8R8v.js → vendor-charts-CCl15Imd.js} +1 -1
- package/dist/src/app/assets/{vendor-markdown-DSmzq4Jh.js → vendor-markdown-0tekx3KX.js} +1 -1
- package/dist/src/app/index.html +4 -34
- package/dist/src/{audio-DUH4q0Xq.js → audio-BRODU0UK.js} +7 -9
- package/dist/src/{audio-BWjyvHn9.cjs → audio-BWeaWovU.cjs} +6 -7
- package/dist/src/{audio-U580w8jM.js → audio-CHQ4r-RV.js} +6 -5
- package/dist/src/{audio-BrJBFN2b.js → audio-tf_NBjlC.js} +6 -8
- package/dist/src/base-B0tcrnq_.js +193 -0
- package/dist/src/base-B4QJRyFS.js +194 -0
- package/dist/src/base-DBtwl2FR.cjs +222 -0
- package/dist/src/base-fEDN28WM.js +193 -0
- package/dist/src/{blobs-kt8v3UyH.js → blobs-BAU-dXan.js} +9 -12
- package/dist/src/{blobs-C9J2mVgo.js → blobs-Bpg5rH6i.js} +9 -12
- package/dist/src/{blobs-673H0jCl.cjs → blobs-DvS-O6be.cjs} +34 -37
- package/dist/src/blobs-qTYm-1PY.js +236 -0
- package/dist/src/{cache-BLLayYEN.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-mIszOnuz.js → cache-CG0SlR1d.js} +64 -66
- package/dist/src/{cache-7xULbvt3.cjs → cache-COish3-W.cjs} +114 -117
- package/dist/src/cache-D3eqDYGU.js +739 -0
- package/dist/src/{chat-Fl6TZJRS.cjs → chat-2K608PeQ.cjs} +20 -21
- package/dist/src/chat-BKm79wib.js +764 -0
- package/dist/src/{chat-XPN9YHhr.js → chat-CM_kyI8B.js} +20 -9
- package/dist/src/{chat-DIywASPG.js → chat-CRWNNq73.js} +49 -49
- package/dist/src/{chat-C8Ei4f87.js → chat-CznLWr_D.js} +49 -49
- package/dist/src/{chat-CgyGj2hC.js → chat-DHMH-N64.js} +20 -22
- package/dist/src/{chat-C4zqjObh.cjs → chat-DaqekjFr.cjs} +69 -69
- package/dist/src/{chat-Cpz3O-Xl.js → chat-DxysjBvt.js} +21 -23
- package/dist/src/{chatkit-Dpxrq4eD.js → chatkit-65VXf5SR.js} +58 -58
- package/dist/src/{chatkit-DIrJX8xk.js → chatkit-Be-Q-a9F.js} +58 -60
- package/dist/src/{chatkit-DEls11hE.js → chatkit-BxFvW8KY.js} +58 -60
- package/dist/src/{chatkit-e25Ziu17.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-6-xTaLwM.js → claude-agent-sdk-BLTu0WBO.js} +45 -31
- package/dist/src/{claude-agent-sdk-BzxF6NIJ.cjs → claude-agent-sdk-CJH22shf.cjs} +44 -29
- package/dist/src/{claude-agent-sdk-CmkTnKGH.js → claude-agent-sdk-D6_k9FKA.js} +45 -33
- package/dist/src/{claude-agent-sdk-rXCBLK_o.js → claude-agent-sdk-Dy5lT-Tx.js} +46 -21
- package/dist/src/{cloud-BMbRVJFw.js → cloud-Bc9526yV.js} +32 -12
- package/dist/src/cloud-DmE0EwsY.js +4 -0
- package/dist/src/{cloudflare-ai-CUg4BTcj.js → cloudflare-ai-C9r2sRhw.js} +16 -18
- package/dist/src/{cloudflare-ai-Z9X219gp.js → cloudflare-ai-CWWJCRim.js} +16 -4
- package/dist/src/{cloudflare-ai-BAQ0u_dg.cjs → cloudflare-ai-ClWSdor4.cjs} +16 -17
- package/dist/src/{cloudflare-ai-CobxMTR4.js → cloudflare-ai-ICsOuD-z.js} +17 -19
- package/dist/src/{cloudflare-gateway-C0sgfr_z.cjs → cloudflare-gateway-C2_-KG5o.cjs} +21 -22
- package/dist/src/{cloudflare-gateway-_itGuXry.js → cloudflare-gateway-D6O7AlYb.js} +23 -23
- package/dist/src/{cloudflare-gateway-D2_yi-Fh.js → cloudflare-gateway-D6xFc5pa.js} +21 -25
- package/dist/src/{cloudflare-gateway-Djf3F3_H.js → cloudflare-gateway-pXGHxJ47.js} +26 -14
- package/dist/src/{codex-sdk-ibXwdglL.js → codex-sdk-C6UMlxwV.js} +49 -32
- package/dist/src/{codex-sdk-BASDNkIl.js → codex-sdk-DUwKWezN.js} +49 -30
- package/dist/src/{codex-sdk-dSnGdgIp.js → codex-sdk-GGAw0qbD.js} +49 -32
- package/dist/src/{codex-sdk-wTEpMM_X.cjs → codex-sdk-fAO0c3yA.cjs} +49 -32
- package/dist/src/{cometapi-B01btbfb.js → cometapi-BasUi7-_.js} +17 -19
- package/dist/src/{cometapi-DHUAH6nK.js → cometapi-Bbjp5V4x.js} +16 -4
- package/dist/src/{cometapi-ChAaRjg5.js → cometapi-DkXrKi5z.js} +21 -24
- package/dist/src/{cometapi-JbvOJSCO.cjs → cometapi-vY6aDZgo.cjs} +21 -22
- package/dist/src/{completion-D9_MDlnd.js → completion-6Mx_iXxK.js} +11 -13
- package/dist/src/{completion-BBJ6zmG3.js → completion-C5rtR_9P.js} +11 -13
- package/dist/src/{completion-DDyL3Cb2.cjs → completion-CDOouNzq.cjs} +21 -23
- package/dist/src/completion-C_P3ypkJ.js +120 -0
- package/dist/src/createHash-CTQmL3G2.js +15 -0
- package/dist/src/createHash-CfZSc0b4.cjs +27 -0
- package/dist/src/createHash-Da8fMwqB.js +16 -0
- package/dist/src/createHash-DmPQkvBh.js +15 -0
- package/dist/src/{docker-JAAubMw3.js → docker-5KcG-_86.js} +18 -20
- package/dist/src/{docker-Ckw-j7Rr.cjs → docker-BwsKwxFs.cjs} +18 -19
- package/dist/src/{docker-vnOg96gi.js → docker-CZnqU1XV.js} +18 -7
- package/dist/src/{docker-BuButc4D.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-CYhseqj4.js → esm-C03C-mv3.js} +17 -20
- package/dist/src/{esm-rDtG_2rg.js → esm-CaIwzWR5.js} +18 -21
- package/dist/src/esm-Cd1AjG1D.js +379 -0
- package/dist/src/{esm-BQkx5roy.cjs → esm-CnNt7sI4.cjs} +47 -49
- package/dist/src/eval-17JizQIv.js +15 -0
- package/dist/src/{eval-CYrbG57o.js → eval-DmFyWU7i.js} +49 -55
- package/dist/src/{evalResult-COsVttMA.js → evalResult-CDQiuUuf.js} +16 -12
- package/dist/src/{evalResult-6JaUIStC.js → evalResult-CTG2AHOS.js} +10 -11
- package/dist/src/evalResult-Cqj8pldJ.js +12 -0
- package/dist/src/{evalResult-DlRfu_Rq.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-3EJCMTs0.js → evaluator-DPFRbFIL.js} +210 -232
- package/dist/src/{extractor-LSYjrhK0.js → extractor-CFG6bcWJ.js} +23 -38
- package/dist/src/{extractor-DbhlYEeo.cjs → extractor-DX36oYEv.cjs} +37 -64
- package/dist/src/{extractor-Hs7la_19.js → extractor-M67RUtg6.js} +23 -38
- package/dist/src/extractor-YMU_Gvt8.js +374 -0
- package/dist/src/fetch-4M3YRaqL.js +780 -0
- package/dist/src/{fetch-18MuNu9i.js → fetch-60Gzydls.js} +60 -46
- package/dist/src/{fetch-SRsE6Ctl.js → fetch-BMv0O527.js} +41 -35
- package/dist/src/{fetch-ZMn_oemb.cjs → fetch-BxUk8odA.cjs} +268 -279
- 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-Doo0xq-z.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-CQlpZkrp.cjs → genaiTracer-DN4dQywX.cjs} +13 -14
- package/dist/src/graders-Bu0H9nXi.js +32 -0
- package/dist/src/{graders-BaMCwIKp.js → graders-CHO8EPM4.js} +385 -417
- package/dist/src/graders-Cfhkvx-e.js +34 -0
- package/dist/src/{graders-QsALpIdy.js → graders-CpdqD9PI.js} +385 -417
- package/dist/src/graders-DClJVpGP.cjs +32 -0
- package/dist/src/{graders-DzUUnUjC.cjs → graders-DOXycdlG.cjs} +721 -753
- package/dist/src/graders-DcnJsrMO.js +32 -0
- package/dist/src/graders-R9rYUM0d.js +13466 -0
- package/dist/src/{image-BiEVdpdP.js → image-BmEZqVmk.js} +57 -18
- package/dist/src/{image-mhAGP07h.js → image-CBBVXWuT.js} +57 -18
- package/dist/src/{image-D10zEe1f.cjs → image-CDLQOcqT.cjs} +6 -7
- package/dist/src/{image-COCWy5dX.js → image-DJEvKveK.js} +6 -5
- package/dist/src/{image-C3BjJUAU.cjs → image-DTedmQPg.cjs} +77 -32
- package/dist/src/{image-DB4sHxdJ.js → image-gvmivTEe.js} +7 -9
- package/dist/src/image-pAX56tPG.js +257 -0
- package/dist/src/{image-BXt_7u0v.js → image-tL5hIOFh.js} +6 -8
- package/dist/src/index.cjs +696 -693
- package/dist/src/index.d.cts +113 -10
- package/dist/src/index.d.ts +113 -6
- package/dist/src/index.js +657 -658
- package/dist/src/{interactiveCheck-DU-MAhp5.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-DotRBzUE.js → knowledgeBase-CLJybhnF.js} +19 -34
- package/dist/src/{knowledgeBase-XJQ0Qyez.js → knowledgeBase-CoU-UQBg.js} +17 -41
- package/dist/src/{knowledgeBase-CMvMlLZR.js → knowledgeBase-DjWPVqSb.js} +17 -43
- package/dist/src/{knowledgeBase-Bnb00xKs.cjs → knowledgeBase-wkxuRFhA.cjs} +17 -40
- package/dist/src/{litellm-CHrRmPAe.js → litellm-B9Hysuri.js} +16 -18
- package/dist/src/{litellm-CrLJrPIm.js → litellm-CTfa0hqi.js} +15 -17
- package/dist/src/{litellm-BrnZhMcL.cjs → litellm-NYpQ8RQu.cjs} +15 -16
- package/dist/src/{litellm-BECdjOTx.js → litellm-ePxtr9F1.js} +15 -4
- package/dist/src/{logger-w8Ozp0Td.js → logger-CT3IKMKA.js} +24 -41
- package/dist/src/{logger-BdZ-IqBc.cjs → logger-Cp1GPUjj.cjs} +166 -192
- package/dist/src/logger-DLcq4dWf.js +713 -0
- package/dist/src/{logger-BotXmWKW.js → logger-KkObSCzq.js} +27 -43
- package/dist/src/{luma-ray-C0RkI3lt.cjs → luma-ray-B0GGNRc1.cjs} +20 -21
- package/dist/src/{luma-ray-C-w6EsJm.js → luma-ray-BE2mOt6N.js} +20 -13
- package/dist/src/{luma-ray-BOeX-h0M.js → luma-ray-BW9IRGIc.js} +22 -21
- package/dist/src/{luma-ray-DgKLS0BF.js → luma-ray-Cm1KZBhs.js} +20 -23
- package/dist/src/main.js +1985 -2055
- package/dist/src/{messages-DXV3Qh8_.cjs → messages-1JrJs91T.cjs} +35 -34
- package/dist/src/{messages-D61tPFQo.js → messages-1x9atZmP.js} +25 -24
- package/dist/src/{messages-CDZYGNlS.js → messages-BLbWdsyt.js} +25 -24
- package/dist/src/messages-D8EA0oDc.js +240 -0
- package/dist/src/{meteor-P2rUE-Uz.js → meteor-44VjEACX.js} +3 -4
- package/dist/src/{meteor-SLNTgmXm.js → meteor-D-SotUw9.js} +3 -4
- package/dist/src/{meteor-odmwVbyG.cjs → meteor-DLZZ3osF.cjs} +3 -4
- package/dist/src/{meteor-Dj8cTkU_.js → meteor-DUiCJRC-.js} +3 -4
- package/dist/src/modelslab-C1OLRmVX.js +166 -0
- package/dist/src/modelslab-CqXBy3U8.js +168 -0
- package/dist/src/modelslab-DcOSFwKh.cjs +166 -0
- package/dist/src/modelslab-X5-4LroM.js +166 -0
- package/dist/src/{nova-reel-C2LFfVTf.js → nova-reel-BgS1ZWuK.js} +20 -13
- package/dist/src/{nova-reel-DtCjbD5O.js → nova-reel-D2ZkOSyr.js} +22 -21
- package/dist/src/{nova-reel-D9FXq3Mt.cjs → nova-reel-D9xfaMBs.cjs} +20 -21
- package/dist/src/{nova-reel-Bk5npr2q.js → nova-reel-DihqLeol.js} +20 -23
- package/dist/src/{nova-sonic-BoRSY_U6.cjs → nova-sonic-DVu3mMIy.cjs} +30 -31
- package/dist/src/{nova-sonic-D_qERM-K.js → nova-sonic-DezhVUYT.js} +30 -26
- package/dist/src/{nova-sonic-CgaWLDM1.js → nova-sonic-P-CdUMlV.js} +30 -31
- package/dist/src/{nova-sonic-BXRfQyF-.js → nova-sonic-Q3BOJeig.js} +31 -32
- package/dist/src/{openai-Bigwjgo1.cjs → openai-Cuif0GEt.cjs} +8 -9
- package/dist/src/{openai-Dz3surb_.js → openai-DElQ-fPX.js} +3 -4
- package/dist/src/{openai-CT5fwbve.js → openai-DhbB7eWK.js} +3 -4
- package/dist/src/openai-j-sE2O7r.js +44 -0
- package/dist/src/{openclaw-dHLcXUWZ.js → openclaw-BiSZPL7J.js} +20 -14
- package/dist/src/{openclaw-CpPrXwf6.js → openclaw-Bv1DINsX.js} +20 -27
- package/dist/src/{openclaw-B6XY2kUf.js → openclaw-D1D_ej1z.js} +21 -28
- package/dist/src/{openclaw-DDSfq5fp.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-DmRb0NBj.js → otlpReceiver--AIRW_S4.js} +53 -51
- package/dist/src/{otlpReceiver-Dg817agV.js → otlpReceiver-Bn5wGB1v.js} +53 -55
- package/dist/src/{otlpReceiver-B6Xo4KZM.cjs → otlpReceiver-Diec4cln.cjs} +53 -55
- package/dist/src/{otlpReceiver-BO0rbDzh.js → otlpReceiver-g3ByGaXs.js} +53 -55
- package/dist/src/{providerRegistry-Xf0qdqGQ.js → providerRegistry-B0RUOLI_.js} +7 -8
- package/dist/src/{providerRegistry-wCWd7sKQ.js → providerRegistry-CD8MEar9.js} +7 -8
- package/dist/src/{providerRegistry-lc7a7utN.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-BiNq_Iyc.js → providers-BKRJTjBz.js} +1743 -1795
- package/dist/src/providers-C1rOSHiR.js +32 -0
- package/dist/src/{providers-BlEhY5mi.js → providers-CFLy1_ji.js} +1750 -1802
- package/dist/src/{providers-BNKVY53V.cjs → providers-CFu-TZl-.cjs} +2111 -2163
- 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-r1uBuA0n.js → pythonUtils-C3py6GC1.js} +18 -19
- package/dist/src/{pythonUtils-DZ6EbdY4.cjs → pythonUtils-CTU3Y3lw.cjs} +42 -43
- package/dist/src/{pythonUtils-vMlk9Qp5.js → pythonUtils-D5nxkQ0P.js} +18 -19
- package/dist/src/pythonUtils-D6fwaDSg.js +249 -0
- package/dist/src/quiverai-C2jVwbH1.js +213 -0
- package/dist/src/quiverai-CI6gYJVI.js +213 -0
- package/dist/src/quiverai-CLkWkyZc.cjs +213 -0
- package/dist/src/quiverai-MHSxbmmZ.js +215 -0
- package/dist/src/{render-CAZvKKkB.js → render-Drod8m7K.js} +4 -5
- package/dist/src/{responses-DLLjADw5.js → responses-BKqJmhhc.js} +34 -27
- package/dist/src/{responses-TsdODUpm.js → responses-CGw0DCzh.js} +34 -27
- package/dist/src/responses-jxdehPkC.js +660 -0
- package/dist/src/{responses-zOtKtnY_.cjs → responses-tD4Bd4dc.cjs} +49 -42
- package/dist/src/rubyUtils-BUHu6PhO.js +5 -0
- package/dist/src/{rubyUtils-Cs35SDYa.js → rubyUtils-BUVePouc.js} +27 -20
- package/dist/src/rubyUtils-BcuGX77l.js +222 -0
- package/dist/src/{rubyUtils-BtjlqyXt.js → rubyUtils-Boc4HZzX.js} +18 -19
- package/dist/src/rubyUtils-CP42kMvq.cjs +4 -0
- package/dist/src/{rubyUtils-DCVaJ3mc.cjs → rubyUtils-DhCAlxZr.cjs} +48 -50
- package/dist/src/{sagemaker-Du4LIR97.js → sagemaker-BK4Zb993.js} +75 -70
- package/dist/src/{sagemaker-CLdUAv5z.js → sagemaker-BfiWTmvn.js} +77 -77
- package/dist/src/{sagemaker-DwNnEVYt.cjs → sagemaker-CcQHM1jV.cjs} +75 -76
- package/dist/src/{sagemaker-BcgLu0U4.js → sagemaker-D2Q1c-sD.js} +75 -79
- package/dist/src/{scanner-Dyw21Wg_.js → scanner-J8CA3LsV.js} +149 -122
- package/dist/src/server/index.js +5620 -67302
- package/dist/src/{server-CgUQ25qW.cjs → server-B0PPuDw-.cjs} +57 -67
- package/dist/src/server-B1vi21hA.js +7 -0
- package/dist/src/{server-CbMTRQkg.js → server-BC7XJFgr.js} +19 -24
- package/dist/src/server-Cm9Kai_h.cjs +5 -0
- package/dist/src/{server-DWmZLfCy.js → server-DbFphssR.js} +26 -29
- package/dist/src/server-OAs3nBRT.js +229 -0
- package/dist/src/{signal-Bl32q42d.js → signal-BOTbd53Z.js} +9 -11
- package/dist/src/{slack-BtMkB6xP.cjs → slack-BmVAVGaK.cjs} +7 -8
- package/dist/src/{slack-OZYxoVON.js → slack-DCUPTzS2.js} +8 -8
- package/dist/src/{slack-DPqj42Ts.js → slack-DOdy_kyv.js} +7 -8
- package/dist/src/{slack-BfdBx2tO.js → slack-DXMKtA-f.js} +7 -9
- package/dist/src/store-BNmZ1KAz.cjs +5 -0
- package/dist/src/{store-BqwfFEyF.cjs → store-BSc-TF2w.cjs} +44 -45
- package/dist/src/store-BltJg2cd.js +6 -0
- package/dist/src/{store-D4gdn9ih.js → store-D1tv90v3.js} +34 -35
- package/dist/src/{store-2ocbYY9D.js → store-DQLEjuEO.js} +40 -36
- package/dist/src/store-Ub2vaGJ1.js +228 -0
- package/dist/src/{tables-D-NSwNIb.js → tables-5EvT_Bwn.js} +23 -23
- package/dist/src/{tables-B9E1kRp-.cjs → tables-C7K-XKWp.cjs} +93 -93
- package/dist/src/{tables-C7TT2XVn.js → tables-D36WTqKX.js} +25 -25
- package/dist/src/tables-xKANLRBD.js +288 -0
- package/dist/src/telemetry-5BCRNBbe.cjs +5 -0
- package/dist/src/{telemetry-DZ_7PaVq.js → telemetry-C15ziL8u.js} +17 -14
- package/dist/src/{telemetry-BXyVqyAg.js → telemetry-C2YDkUQH.js} +11 -13
- package/dist/src/{telemetry-D0_yFdtU.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-Dm78AVGG.js → text-B_UCRPp2.js} +2 -2
- package/dist/src/{text-DF2hMKdg.cjs → text-CW1cyrwj.cjs} +12 -13
- package/dist/src/{text-DgMr_tiM.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-FNIz3YOe.cjs → transcription-CL78qbOU.cjs} +14 -15
- package/dist/src/{transcription-C-M81iDA.js → transcription-DAtxHhAM.js} +14 -7
- package/dist/src/{transcription-CYuY5sFO.js → transcription-LNZTNUUL.js} +14 -16
- package/dist/src/{transcription-Ch7S-LWw.js → transcription-QHh3AH6Z.js} +15 -17
- package/dist/src/{transform-CoP2bJ7P.js → transform-Cgi24fJ7.js} +94 -66
- package/dist/src/{transform-Kd6u-oNm.cjs → transform-CzK1Q0zl.cjs} +24 -26
- package/dist/src/{transform-D8dILpfZ.js → transform-DECvGmzp.js} +15 -13
- package/dist/src/{transform-DMaxQwDx.js → transform-DGLazrMm.js} +94 -66
- package/dist/src/transform-DGxXocjk.js +1506 -0
- package/dist/src/{transform-ivxEY4f7.cjs → transform-DOcQeLld.cjs} +234 -206
- package/dist/src/transform-DTGDnAzW.js +6 -0
- package/dist/src/{transform-CqTFr7KR.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-DEU2naS1.js → transformersAvailability-CEVM2GNQ.js} +2 -2
- package/dist/src/{transformersAvailability-Bkep3ka7.cjs → transformersAvailability-CwayUSlh.cjs} +2 -3
- package/dist/src/{transformersAvailability-DwmezkVe.js → transformersAvailability-D6c6ROpT.js} +2 -2
- package/dist/src/{types-t52w-XsS.js → types-CH3Ge2sE.js} +103 -92
- package/dist/src/{types-DMVjYLpx.js → types-CLKiCBW3.js} +98 -91
- package/dist/src/types-CN_TZ2GJ.js +3260 -0
- package/dist/src/{types-BIfttHrT.cjs → types-LJ0r3wbR.cjs} +573 -566
- package/dist/src/util-5cB-L7U3.js +1430 -0
- package/dist/src/util-6-GqIvzS.js +599 -0
- package/dist/src/{util-vjscpUzy.js → util-B7T3SiBS.js} +5 -6
- package/dist/src/{util-Cl0zfT3V.js → util-Betm42rL.js} +44 -17
- package/dist/src/{util-CUEt0Vum.js → util-C-PPYSMq.js} +44 -17
- package/dist/src/{util-DkFTvieG.cjs → util-CchiqXh_.cjs} +35 -36
- package/dist/src/{util-mJ58qbbw.js → util-DaWTWKBK.js} +5 -6
- package/dist/src/{util-C08Kns6-.cjs → util-Db0a0AFH.cjs} +89 -62
- package/dist/src/{util-DiCePfDu.js → util-Dlz_Wvgm.js} +102 -53
- package/dist/src/{util-BSh4a_Q8.js → util-YT5HPZaS.js} +102 -53
- package/dist/src/{util-DUYOvxAy.cjs → util-Yz-1aEhW.cjs} +274 -219
- package/dist/src/util-ZZH-3QZz.js +293 -0
- package/dist/src/{utils-DFaZa6Rf.cjs → utils-Cz9qXqII.cjs} +32 -35
- package/dist/src/{utils-CVzb4YiI.js → utils-XiOAgly5.js} +4 -7
- package/dist/src/utils-dLokC-eR.js +94 -0
- package/dist/src/{utils-JaY9veb5.js → utils-f2-Moju7.js} +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +59 -53
- package/dist/src/app/assets/index-BOgkICuY.css +0 -1
- package/dist/src/app/assets/index-CSgqn_Vd.js +0 -428
- package/dist/src/app/tsconfig.app.tsbuildinfo +0 -1
- package/dist/src/base-BaXmtXYp.js +0 -107
- package/dist/src/base-Dtp8b4_N.js +0 -106
- package/dist/src/base-f71xxWai.cjs +0 -111
- package/dist/src/cache-BUPcq0Ad.js +0 -6
- package/dist/src/cache-CVfRb-HD.cjs +0 -6
- package/dist/src/cache-O4EuX2JV.js +0 -8
- package/dist/src/chunk-DHDDz29n.js +0 -22
- package/dist/src/chunk-FhC4c-0y.js +0 -21
- package/dist/src/cloud-CZ4hytdm.js +0 -5
- package/dist/src/eval-CKHWqG9f.js +0 -16
- package/dist/src/evalResult-CxTP-LMm.cjs +0 -11
- package/dist/src/evalResult-CzLURDcP.js +0 -13
- package/dist/src/evalResult-DyttNQ_G.js +0 -11
- package/dist/src/evaluator-0PvfeBYh.js +0 -38
- package/dist/src/fetch-Bi0o-fdp.js +0 -4
- package/dist/src/fetch-CMptBDVg.cjs +0 -4
- package/dist/src/fetch-DAZkv3gV.js +0 -6
- package/dist/src/graders-BCytzXrb.js +0 -34
- package/dist/src/graders-CGZQShfJ.cjs +0 -33
- package/dist/src/graders-spkuVC-E.js +0 -36
- package/dist/src/opencode-sdk-CImWVqy9.js +0 -382
- package/dist/src/opencode-sdk-CuCztr4P.js +0 -380
- package/dist/src/opencode-sdk-DhcfRbBH.js +0 -376
- package/dist/src/opencode-sdk-mqF-Oj3f.cjs +0 -383
- package/dist/src/providers-BMZZmPBJ.cjs +0 -32
- package/dist/src/providers-CQQrNaJk.js +0 -32
- package/dist/src/providers-Ck8HyrC-.js +0 -34
- package/dist/src/quiverai-BNfIwKCO.cjs +0 -54
- package/dist/src/quiverai-BQigKdIH.js +0 -57
- package/dist/src/quiverai-Bfy2WnE2.js +0 -55
- package/dist/src/quiverai-CedIP0PJ.js +0 -43
- package/dist/src/rubyUtils-D7--T12C.js +0 -6
- package/dist/src/rubyUtils-DRRiMFV2.js +0 -5
- package/dist/src/rubyUtils-vb8OYFC-.cjs +0 -5
- package/dist/src/server-BUbS0Qfh.js +0 -6
- package/dist/src/server-XpGXFHkS.cjs +0 -6
- package/dist/src/server-gfOx5Zrk.js +0 -8
- package/dist/src/store-5u2yriTV.js +0 -7
- package/dist/src/store-D_lq_8oQ.js +0 -6
- package/dist/src/store-m5KT6Ly7.cjs +0 -6
- package/dist/src/telemetry-5RHFoCJh.js +0 -6
- package/dist/src/telemetry-Do8wMnA-.js +0 -8
- package/dist/src/telemetry-LojxPoFq.cjs +0 -6
- package/dist/src/transform-8eGmaH-7.js +0 -7
- package/dist/src/transform-BRVvWaG4.cjs +0 -6
- package/dist/src/transform-GybT0X0u.js +0 -8
- package/dist/src/transformersAvailability-DkAWaK5B.js +0 -35
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import {
|
|
12
|
-
import { i as OPENAI_TRANSCRIPTION_MODELS } from "./util-CUEt0Vum.js";
|
|
2
|
+
import { o as logger } from "./logger-KkObSCzq.js";
|
|
3
|
+
import { f as REQUEST_TIMEOUT_MS } from "./fetch-BMv0O527.js";
|
|
4
|
+
import "./cloud-Bc9526yV.js";
|
|
5
|
+
import "./types-CH3Ge2sE.js";
|
|
6
|
+
import { a as fetchWithCache } from "./cache-CG0SlR1d.js";
|
|
7
|
+
import "./util-YT5HPZaS.js";
|
|
8
|
+
import "./esm-C03C-mv3.js";
|
|
9
|
+
import "./pythonUtils-C3py6GC1.js";
|
|
10
|
+
import { t as OpenAiGenericProvider } from "./openai-DhbB7eWK.js";
|
|
11
|
+
import { i as OPENAI_TRANSCRIPTION_MODELS } from "./util-C-PPYSMq.js";
|
|
13
12
|
import fs from "fs";
|
|
14
13
|
import path from "path";
|
|
15
|
-
|
|
16
14
|
//#region src/providers/openai/transcription.ts
|
|
17
15
|
var OpenAiTranscriptionProvider = class OpenAiTranscriptionProvider extends OpenAiGenericProvider {
|
|
18
16
|
static OPENAI_TRANSCRIPTION_MODEL_NAMES = OPENAI_TRANSCRIPTION_MODELS.map((model) => model.id);
|
|
19
17
|
config;
|
|
20
18
|
constructor(modelName, options = {}) {
|
|
21
|
-
if (!OpenAiTranscriptionProvider.OPENAI_TRANSCRIPTION_MODEL_NAMES.includes(modelName))
|
|
19
|
+
if (!OpenAiTranscriptionProvider.OPENAI_TRANSCRIPTION_MODEL_NAMES.includes(modelName)) logger.debug(`Using unknown transcription model: ${modelName}`);
|
|
22
20
|
super(modelName, options);
|
|
23
21
|
this.config = options.config || {};
|
|
24
22
|
}
|
|
@@ -74,7 +72,7 @@ var OpenAiTranscriptionProvider = class OpenAiTranscriptionProvider extends Open
|
|
|
74
72
|
}, REQUEST_TIMEOUT_MS, "json", context?.bustCache ?? context?.debug));
|
|
75
73
|
if (status < 200 || status >= 300) return { error: `API error: ${status} ${statusText}\n${typeof data === "string" ? data : JSON.stringify(data)}` };
|
|
76
74
|
} catch (err) {
|
|
77
|
-
|
|
75
|
+
logger.error("API call error", { error: err });
|
|
78
76
|
return { error: `API call error: ${String(err)}` };
|
|
79
77
|
}
|
|
80
78
|
if (data.error) return { error: typeof data.error === "string" ? data.error : JSON.stringify(data.error) };
|
|
@@ -119,12 +117,12 @@ var OpenAiTranscriptionProvider = class OpenAiTranscriptionProvider extends Open
|
|
|
119
117
|
}
|
|
120
118
|
};
|
|
121
119
|
} catch (err) {
|
|
122
|
-
|
|
120
|
+
logger.error("Transcription error", { error: err });
|
|
123
121
|
return { error: `Transcription error: ${String(err)}` };
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
};
|
|
127
|
-
|
|
128
125
|
//#endregion
|
|
129
126
|
export { OpenAiTranscriptionProvider };
|
|
130
|
-
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=transcription-QHh3AH6Z.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as getEnvString, o as
|
|
3
|
-
import {
|
|
4
|
-
import { p as maybeLoadFromExternalFile, w as getNunjucksEngine, x as renderVarsInObject } from "./util-
|
|
2
|
+
import { C as getEnvString, o as logger, p as getAjv } from "./logger-KkObSCzq.js";
|
|
3
|
+
import { n as fetchWithProxy, p as calculateCost, y as parseChatPrompt } from "./fetch-BMv0O527.js";
|
|
4
|
+
import { p as maybeLoadFromExternalFile, w as getNunjucksEngine, x as renderVarsInObject } from "./util-YT5HPZaS.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import crypto from "crypto";
|
|
7
7
|
import Clone from "rfdc";
|
|
8
|
-
|
|
9
8
|
//#region src/util/oauth.ts
|
|
10
9
|
/**
|
|
11
10
|
* Buffer time before token expiry to trigger proactive refresh (60 seconds)
|
|
@@ -20,7 +19,7 @@ const TOKEN_REFRESH_BUFFER_MS = 6e4;
|
|
|
20
19
|
*/
|
|
21
20
|
async function fetchOAuthToken(config) {
|
|
22
21
|
const now = Date.now();
|
|
23
|
-
|
|
22
|
+
logger.debug("[OAuth] Fetching new token");
|
|
24
23
|
const tokenRequestBody = new URLSearchParams();
|
|
25
24
|
tokenRequestBody.append("grant_type", config.grantType);
|
|
26
25
|
if (config.clientId) tokenRequestBody.append("client_id", config.clientId);
|
|
@@ -42,13 +41,12 @@ async function fetchOAuthToken(config) {
|
|
|
42
41
|
const tokenData = await response.json();
|
|
43
42
|
if (!tokenData.access_token) throw new Error("OAuth token response missing access_token");
|
|
44
43
|
const expiresAt = now + (tokenData.expires_in || 3600) * 1e3;
|
|
45
|
-
|
|
44
|
+
logger.debug("[OAuth] Successfully fetched token");
|
|
46
45
|
return {
|
|
47
46
|
accessToken: tokenData.access_token,
|
|
48
47
|
expiresAt
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
|
-
|
|
52
50
|
//#endregion
|
|
53
51
|
//#region src/providers/mcp/util.ts
|
|
54
52
|
/**
|
|
@@ -79,7 +77,7 @@ const tokenEndpointCache = /* @__PURE__ */ new Map();
|
|
|
79
77
|
async function discoverTokenEndpoint(serverUrl) {
|
|
80
78
|
const cached = tokenEndpointCache.get(serverUrl);
|
|
81
79
|
if (cached) {
|
|
82
|
-
|
|
80
|
+
logger.debug(`[MCP Auth] Using cached token endpoint for ${serverUrl}`);
|
|
83
81
|
return cached;
|
|
84
82
|
}
|
|
85
83
|
const url = new URL(serverUrl);
|
|
@@ -91,21 +89,21 @@ async function discoverTokenEndpoint(serverUrl) {
|
|
|
91
89
|
}
|
|
92
90
|
discoveryUrls.push(`${baseUrl}/.well-known/oauth-authorization-server`);
|
|
93
91
|
for (const discoveryUrl of discoveryUrls) try {
|
|
94
|
-
|
|
92
|
+
logger.debug(`[MCP Auth] Trying OAuth discovery at ${discoveryUrl}`);
|
|
95
93
|
const response = await fetchWithProxy(discoveryUrl);
|
|
96
94
|
if (!response.ok) {
|
|
97
|
-
|
|
95
|
+
logger.debug(`[MCP Auth] Discovery failed at ${discoveryUrl}: ${response.status}`);
|
|
98
96
|
continue;
|
|
99
97
|
}
|
|
100
98
|
const metadata = await response.json();
|
|
101
99
|
if (metadata.token_endpoint) {
|
|
102
|
-
|
|
100
|
+
logger.debug(`[MCP Auth] Discovered token endpoint: ${metadata.token_endpoint}`);
|
|
103
101
|
tokenEndpointCache.set(serverUrl, metadata.token_endpoint);
|
|
104
102
|
return metadata.token_endpoint;
|
|
105
103
|
}
|
|
106
|
-
|
|
104
|
+
logger.debug(`[MCP Auth] No token_endpoint in metadata from ${discoveryUrl}`);
|
|
107
105
|
} catch (error) {
|
|
108
|
-
|
|
106
|
+
logger.debug(`[MCP Auth] Error fetching ${discoveryUrl}: ${error}`);
|
|
109
107
|
}
|
|
110
108
|
throw new Error(`Failed to discover OAuth token endpoint for ${serverUrl}. Please configure tokenUrl explicitly in the auth config.`);
|
|
111
109
|
}
|
|
@@ -122,8 +120,8 @@ async function getOAuthTokenWithExpiry(auth, serverUrl) {
|
|
|
122
120
|
}
|
|
123
121
|
const cacheKey = getOAuthCacheKey(auth);
|
|
124
122
|
const cached = oauthTokenCache.get(cacheKey);
|
|
125
|
-
if (cached && Date.now() +
|
|
126
|
-
|
|
123
|
+
if (cached && Date.now() + 6e4 < cached.expiresAt) {
|
|
124
|
+
logger.debug("[MCP Auth] Using cached OAuth token");
|
|
127
125
|
return {
|
|
128
126
|
accessToken: cached.accessToken,
|
|
129
127
|
expiresAt: cached.expiresAt
|
|
@@ -142,7 +140,7 @@ async function getOAuthTokenWithExpiry(auth, serverUrl) {
|
|
|
142
140
|
accessToken: result.accessToken,
|
|
143
141
|
expiresAt: result.expiresAt
|
|
144
142
|
});
|
|
145
|
-
|
|
143
|
+
logger.debug("[MCP Auth] Cached OAuth token");
|
|
146
144
|
return result;
|
|
147
145
|
}
|
|
148
146
|
/**
|
|
@@ -174,7 +172,7 @@ function getAuthHeaders(server, oauthToken) {
|
|
|
174
172
|
}
|
|
175
173
|
case "oauth":
|
|
176
174
|
if (oauthToken) return { Authorization: `Bearer ${oauthToken}` };
|
|
177
|
-
|
|
175
|
+
logger.warn("[MCP Auth] OAuth auth configured but no token provided");
|
|
178
176
|
return {};
|
|
179
177
|
default: return {};
|
|
180
178
|
}
|
|
@@ -206,7 +204,6 @@ function applyQueryParams(url, params) {
|
|
|
206
204
|
function requiresAsyncAuth(server) {
|
|
207
205
|
return server.auth?.type === "oauth";
|
|
208
206
|
}
|
|
209
|
-
|
|
210
207
|
//#endregion
|
|
211
208
|
//#region src/util/dataUrl.ts
|
|
212
209
|
/**
|
|
@@ -282,7 +279,6 @@ function extractBase64FromDataUrl(value) {
|
|
|
282
279
|
function toDataUri(mimeType, base64Data) {
|
|
283
280
|
return `data:${mimeType};base64,${base64Data}`;
|
|
284
281
|
}
|
|
285
|
-
|
|
286
282
|
//#endregion
|
|
287
283
|
//#region src/providers/google/auth.ts
|
|
288
284
|
/**
|
|
@@ -307,6 +303,8 @@ function toDataUri(mimeType, base64Data) {
|
|
|
307
303
|
* - Conflict detection and warnings
|
|
308
304
|
*/
|
|
309
305
|
var GoogleAuthManager = class {
|
|
306
|
+
static cachedHasDefaultCredentials;
|
|
307
|
+
static pendingHasDefaultCredentials;
|
|
310
308
|
/**
|
|
311
309
|
* Get API key with proper priority order.
|
|
312
310
|
*
|
|
@@ -330,7 +328,7 @@ var GoogleAuthManager = class {
|
|
|
330
328
|
if (isVertexMode) {
|
|
331
329
|
const vertexKey = env?.VERTEX_API_KEY || getEnvString("VERTEX_API_KEY");
|
|
332
330
|
if (vertexKey) {
|
|
333
|
-
|
|
331
|
+
logger.warn("[Google] VERTEX_API_KEY is not a standard SDK env var. Use GOOGLE_API_KEY instead.");
|
|
334
332
|
return {
|
|
335
333
|
apiKey: vertexKey,
|
|
336
334
|
source: "VERTEX_API_KEY"
|
|
@@ -340,20 +338,20 @@ var GoogleAuthManager = class {
|
|
|
340
338
|
const googleKey = env?.GOOGLE_API_KEY || getEnvString("GOOGLE_API_KEY");
|
|
341
339
|
const geminiKey = env?.GEMINI_API_KEY || getEnvString("GEMINI_API_KEY");
|
|
342
340
|
const palmKey = isVertexMode ? void 0 : env?.PALM_API_KEY || getEnvString("PALM_API_KEY");
|
|
343
|
-
if (googleKey && geminiKey)
|
|
341
|
+
if (googleKey && geminiKey) logger.debug("[Google] Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.");
|
|
344
342
|
if (googleKey) return {
|
|
345
343
|
apiKey: googleKey,
|
|
346
344
|
source: "GOOGLE_API_KEY"
|
|
347
345
|
};
|
|
348
346
|
if (geminiKey) {
|
|
349
|
-
|
|
347
|
+
logger.debug("[Google] GEMINI_API_KEY is not a standard SDK env var. Consider using GOOGLE_API_KEY.");
|
|
350
348
|
return {
|
|
351
349
|
apiKey: geminiKey,
|
|
352
350
|
source: "GEMINI_API_KEY"
|
|
353
351
|
};
|
|
354
352
|
}
|
|
355
353
|
if (palmKey) {
|
|
356
|
-
|
|
354
|
+
logger.warn("[Google] PALM_API_KEY is deprecated. Use GOOGLE_API_KEY instead.");
|
|
357
355
|
return {
|
|
358
356
|
apiKey: palmKey,
|
|
359
357
|
source: "PALM_API_KEY"
|
|
@@ -379,13 +377,13 @@ var GoogleAuthManager = class {
|
|
|
379
377
|
if ((projectId || region) && apiKey) {
|
|
380
378
|
const message = "[Google] Project/location and API key are mutually exclusive in the client initializer. Use either apiKey for express mode OR projectId/region for OAuth mode, not both.";
|
|
381
379
|
if (isStrict) throw new Error(message);
|
|
382
|
-
else
|
|
380
|
+
else logger.warn(message);
|
|
383
381
|
}
|
|
384
|
-
if (useVertexEnv && vertexai === false)
|
|
385
|
-
if (cloudProject && projectId && cloudProject !== projectId)
|
|
386
|
-
if (apiKey && credentials)
|
|
382
|
+
if (useVertexEnv && vertexai === false) logger.warn("[Google] GOOGLE_GENAI_USE_VERTEXAI is set but vertexai: false was specified in config. Config takes precedence.");
|
|
383
|
+
if (cloudProject && projectId && cloudProject !== projectId) logger.warn("[Google] Both GOOGLE_CLOUD_PROJECT and config.projectId are set with different values. Using config.projectId.");
|
|
384
|
+
if (apiKey && credentials) logger.debug("[Google] Both apiKey and credentials are set. Using API key (express mode). Set expressMode: false to use OAuth/ADC instead.");
|
|
387
385
|
if (vertexai && !apiKey && !projectId && !cloudProject && !credentials) {
|
|
388
|
-
if (!Boolean(env?.GOOGLE_APPLICATION_CREDENTIALS || process.env.GOOGLE_APPLICATION_CREDENTIALS))
|
|
386
|
+
if (!Boolean(env?.GOOGLE_APPLICATION_CREDENTIALS || process.env.GOOGLE_APPLICATION_CREDENTIALS)) logger.debug("[Google] Vertex AI mode enabled but no projectId, credentials, or ADC detected. Authentication may fail.");
|
|
389
387
|
}
|
|
390
388
|
}
|
|
391
389
|
/**
|
|
@@ -405,14 +403,14 @@ var GoogleAuthManager = class {
|
|
|
405
403
|
if (config.vertexai !== void 0) return config.vertexai;
|
|
406
404
|
const useVertexEnv = getEnvString("GOOGLE_GENAI_USE_VERTEXAI");
|
|
407
405
|
if (useVertexEnv === "true" || useVertexEnv === "1") {
|
|
408
|
-
|
|
406
|
+
logger.debug("[Google] Vertex AI mode enabled via GOOGLE_GENAI_USE_VERTEXAI");
|
|
409
407
|
return true;
|
|
410
408
|
}
|
|
411
409
|
if (useVertexEnv === "false" || useVertexEnv === "0") return false;
|
|
412
410
|
const hasProjectId = Boolean(config.projectId || env?.VERTEX_PROJECT_ID || getEnvString("VERTEX_PROJECT_ID") || env?.GOOGLE_PROJECT_ID || getEnvString("GOOGLE_PROJECT_ID") || getEnvString("GOOGLE_CLOUD_PROJECT"));
|
|
413
411
|
const hasCredentials = Boolean(config.credentials);
|
|
414
412
|
if (hasProjectId || hasCredentials) {
|
|
415
|
-
|
|
413
|
+
logger.debug("[Google] Auto-detected Vertex AI mode from projectId/credentials. Set vertexai: true/false explicitly to suppress this message.");
|
|
416
414
|
return true;
|
|
417
415
|
}
|
|
418
416
|
return false;
|
|
@@ -478,7 +476,7 @@ var GoogleAuthManager = class {
|
|
|
478
476
|
client = await auth.fromJSON(parsedCredentials);
|
|
479
477
|
} catch (error) {
|
|
480
478
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
481
|
-
|
|
479
|
+
logger.error(`[Google] Could not load credentials: ${errorMsg}`);
|
|
482
480
|
throw new Error(`[Google] Could not load credentials: ${errorMsg}`);
|
|
483
481
|
}
|
|
484
482
|
} else client = await auth.getClient();
|
|
@@ -517,8 +515,8 @@ var GoogleAuthManager = class {
|
|
|
517
515
|
const vertexProjectId = env?.VERTEX_PROJECT_ID || getEnvString("VERTEX_PROJECT_ID");
|
|
518
516
|
const googleProjectId = env?.GOOGLE_PROJECT_ID || getEnvString("GOOGLE_PROJECT_ID");
|
|
519
517
|
const cloudProject = getEnvString("GOOGLE_CLOUD_PROJECT");
|
|
520
|
-
if (vertexProjectId && !config.projectId)
|
|
521
|
-
if (googleProjectId && !config.projectId && !vertexProjectId)
|
|
518
|
+
if (vertexProjectId && !config.projectId) logger.debug("[Google] VERTEX_PROJECT_ID is not a standard SDK env var. Consider using GOOGLE_CLOUD_PROJECT.");
|
|
519
|
+
if (googleProjectId && !config.projectId && !vertexProjectId) logger.debug("[Google] GOOGLE_PROJECT_ID is not a standard SDK env var. Consider using GOOGLE_CLOUD_PROJECT.");
|
|
522
520
|
return config.projectId || vertexProjectId || googleProjectId || cloudProject || authProjectId || "";
|
|
523
521
|
}
|
|
524
522
|
/**
|
|
@@ -538,7 +536,7 @@ var GoogleAuthManager = class {
|
|
|
538
536
|
static resolveRegion(config, env, hasApiKey) {
|
|
539
537
|
const vertexRegion = env?.VERTEX_REGION || getEnvString("VERTEX_REGION");
|
|
540
538
|
const cloudLocation = getEnvString("GOOGLE_CLOUD_LOCATION");
|
|
541
|
-
if (vertexRegion && !config.region)
|
|
539
|
+
if (vertexRegion && !config.region) logger.debug("[Google] VERTEX_REGION is not a standard SDK env var. Consider using GOOGLE_CLOUD_LOCATION.");
|
|
542
540
|
const configuredRegion = config.region || vertexRegion || cloudLocation;
|
|
543
541
|
if (configuredRegion) return configuredRegion;
|
|
544
542
|
if (hasApiKey === false) return "global";
|
|
@@ -550,25 +548,39 @@ var GoogleAuthManager = class {
|
|
|
550
548
|
* @returns True if ADC is available
|
|
551
549
|
*/
|
|
552
550
|
static async hasDefaultCredentials() {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
551
|
+
if (this.cachedHasDefaultCredentials !== void 0) return this.cachedHasDefaultCredentials;
|
|
552
|
+
if (!this.pendingHasDefaultCredentials) {
|
|
553
|
+
const probe = (async () => {
|
|
554
|
+
try {
|
|
555
|
+
await this.getOAuthClient();
|
|
556
|
+
return true;
|
|
557
|
+
} catch {
|
|
558
|
+
return false;
|
|
559
|
+
}
|
|
560
|
+
})();
|
|
561
|
+
this.pendingHasDefaultCredentials = probe;
|
|
562
|
+
probe.then((result) => {
|
|
563
|
+
if (this.pendingHasDefaultCredentials === probe) this.cachedHasDefaultCredentials = result;
|
|
564
|
+
return result;
|
|
565
|
+
}).finally(() => {
|
|
566
|
+
if (this.pendingHasDefaultCredentials === probe) this.pendingHasDefaultCredentials = void 0;
|
|
567
|
+
});
|
|
558
568
|
}
|
|
569
|
+
return this.pendingHasDefaultCredentials;
|
|
559
570
|
}
|
|
560
571
|
/**
|
|
561
|
-
* Clear
|
|
562
|
-
* @deprecated No longer uses instance-level caching; Google's auth library handles token caching internally.
|
|
572
|
+
* Clear internal auth detection caches (useful for testing).
|
|
563
573
|
*/
|
|
564
|
-
static clearCache() {
|
|
574
|
+
static clearCache() {
|
|
575
|
+
this.cachedHasDefaultCredentials = void 0;
|
|
576
|
+
this.pendingHasDefaultCredentials = void 0;
|
|
577
|
+
}
|
|
565
578
|
};
|
|
566
579
|
const loadCredentials = GoogleAuthManager.loadCredentials.bind(GoogleAuthManager);
|
|
567
580
|
const getGoogleClient = GoogleAuthManager.getOAuthClient.bind(GoogleAuthManager);
|
|
568
581
|
const resolveProjectId = GoogleAuthManager.resolveProjectId.bind(GoogleAuthManager);
|
|
569
582
|
const hasGoogleDefaultCredentials = GoogleAuthManager.hasDefaultCredentials.bind(GoogleAuthManager);
|
|
570
|
-
|
|
571
|
-
|
|
583
|
+
GoogleAuthManager.clearCache.bind(GoogleAuthManager);
|
|
572
584
|
//#endregion
|
|
573
585
|
//#region src/providers/google/shared.ts
|
|
574
586
|
/**
|
|
@@ -648,7 +660,8 @@ const GOOGLE_MODELS = [
|
|
|
648
660
|
...[
|
|
649
661
|
"gemini-2.5-flash",
|
|
650
662
|
"gemini-2.5-flash-preview-04-17",
|
|
651
|
-
"gemini-2.5-flash-preview-05-20"
|
|
663
|
+
"gemini-2.5-flash-preview-05-20",
|
|
664
|
+
"gemini-2.5-flash-preview-09-2025"
|
|
652
665
|
].map((id) => ({
|
|
653
666
|
id,
|
|
654
667
|
cost: {
|
|
@@ -663,13 +676,6 @@ const GOOGLE_MODELS = [
|
|
|
663
676
|
output: .4 / 1e6
|
|
664
677
|
}
|
|
665
678
|
})),
|
|
666
|
-
{
|
|
667
|
-
id: "gemini-2.5-flash-preview-09-2025",
|
|
668
|
-
cost: {
|
|
669
|
-
input: .3 / 1e6,
|
|
670
|
-
output: 2.5 / 1e6
|
|
671
|
-
}
|
|
672
|
-
},
|
|
673
679
|
...[
|
|
674
680
|
"gemini-2.0-flash",
|
|
675
681
|
"gemini-2.0-flash-001",
|
|
@@ -679,6 +685,10 @@ const GOOGLE_MODELS = [
|
|
|
679
685
|
cost: {
|
|
680
686
|
input: .1 / 1e6,
|
|
681
687
|
output: .4 / 1e6
|
|
688
|
+
},
|
|
689
|
+
vertexCost: {
|
|
690
|
+
input: .15 / 1e6,
|
|
691
|
+
output: .6 / 1e6
|
|
682
692
|
}
|
|
683
693
|
})),
|
|
684
694
|
...[
|
|
@@ -817,6 +827,20 @@ const GOOGLE_MODELS = [
|
|
|
817
827
|
output: 1.5 / 1e6
|
|
818
828
|
}
|
|
819
829
|
},
|
|
830
|
+
{
|
|
831
|
+
id: "gemini-robotics-er-1.5-preview",
|
|
832
|
+
cost: {
|
|
833
|
+
input: .3 / 1e6,
|
|
834
|
+
output: 2.5 / 1e6
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
id: "gemini-embedding-001",
|
|
839
|
+
cost: {
|
|
840
|
+
input: .15 / 1e6,
|
|
841
|
+
output: 0
|
|
842
|
+
}
|
|
843
|
+
},
|
|
820
844
|
{ id: "aqa" },
|
|
821
845
|
{ id: "chat-bison" },
|
|
822
846
|
{ id: "chat-bison-32k" },
|
|
@@ -842,7 +866,6 @@ const GOOGLE_MODELS = [
|
|
|
842
866
|
* Used for model validation in ai.studio.ts.
|
|
843
867
|
*/
|
|
844
868
|
const CHAT_MODELS = GOOGLE_MODELS.map((m) => m.id);
|
|
845
|
-
|
|
846
869
|
//#endregion
|
|
847
870
|
//#region src/providers/google/types.ts
|
|
848
871
|
const VALID_SCHEMA_TYPES = [
|
|
@@ -854,7 +877,6 @@ const VALID_SCHEMA_TYPES = [
|
|
|
854
877
|
"ARRAY",
|
|
855
878
|
"OBJECT"
|
|
856
879
|
];
|
|
857
|
-
|
|
858
880
|
//#endregion
|
|
859
881
|
//#region src/providers/google/util.ts
|
|
860
882
|
/**
|
|
@@ -869,25 +891,32 @@ function normalizeSafetySettings(safetySettings) {
|
|
|
869
891
|
}));
|
|
870
892
|
}
|
|
871
893
|
/**
|
|
872
|
-
* Calculates the cost for a Google
|
|
894
|
+
* Calculates the cost for a Google API call.
|
|
873
895
|
*
|
|
874
896
|
* Handles tiered pricing for models where cost varies by prompt size.
|
|
875
897
|
* For example, Gemini Pro models have higher rates for prompts >200k tokens.
|
|
898
|
+
* Some models (e.g. Gemini 2.0 Flash) have different pricing on Vertex AI.
|
|
876
899
|
*
|
|
877
900
|
* @param modelName - The name of the model used
|
|
878
901
|
* @param config - Provider configuration (may contain custom cost override)
|
|
879
902
|
* @param promptTokens - Number of tokens in the prompt
|
|
880
903
|
* @param completionTokens - Number of tokens in the completion
|
|
904
|
+
* @param isVertexMode - Whether the call was made via Vertex AI (uses Vertex pricing when available)
|
|
881
905
|
* @returns The calculated cost in dollars, or undefined if it cannot be calculated
|
|
882
906
|
*/
|
|
883
|
-
function calculateGoogleCost(modelName, config, promptTokens, completionTokens) {
|
|
907
|
+
function calculateGoogleCost(modelName, config, promptTokens, completionTokens, isVertexMode) {
|
|
908
|
+
const model = GOOGLE_MODELS.find((m) => m.id === modelName);
|
|
884
909
|
if (promptTokens != null && completionTokens != null) {
|
|
885
|
-
const model = GOOGLE_MODELS.find((m) => m.id === modelName);
|
|
886
910
|
if (model?.tieredCost && promptTokens > model.tieredCost.threshold) {
|
|
887
911
|
const inputCost = config.cost ?? model.tieredCost.above.input;
|
|
888
912
|
const outputCost = config.cost ?? model.tieredCost.above.output;
|
|
889
913
|
return inputCost * promptTokens + outputCost * completionTokens;
|
|
890
914
|
}
|
|
915
|
+
if (isVertexMode && model?.vertexCost) {
|
|
916
|
+
const inputCost = config.cost ?? model.vertexCost.input;
|
|
917
|
+
const outputCost = config.cost ?? model.vertexCost.output;
|
|
918
|
+
return inputCost * promptTokens + outputCost * completionTokens;
|
|
919
|
+
}
|
|
891
920
|
}
|
|
892
921
|
return calculateCost(modelName, config, promptTokens, completionTokens, GOOGLE_MODELS);
|
|
893
922
|
}
|
|
@@ -969,7 +998,7 @@ function maybeCoerceToGeminiFormat(contents, options) {
|
|
|
969
998
|
coercedContents = [contents];
|
|
970
999
|
coerced = true;
|
|
971
1000
|
} else {
|
|
972
|
-
|
|
1001
|
+
logger.warn(`Unknown format for Gemini: ${JSON.stringify(contents)}`);
|
|
973
1002
|
return {
|
|
974
1003
|
contents: Array.isArray(contents) ? contents : [],
|
|
975
1004
|
coerced: false,
|
|
@@ -1027,7 +1056,7 @@ async function getGoogleAccessToken(credentials) {
|
|
|
1027
1056
|
else client = await cachedGenerativeLanguageAuth.getClient();
|
|
1028
1057
|
return (await client.getAccessToken()).token || void 0;
|
|
1029
1058
|
} catch (error) {
|
|
1030
|
-
|
|
1059
|
+
logger.debug("[GoogleAuth] Could not get access token", { error: error instanceof Error ? error.message : String(error) });
|
|
1031
1060
|
return;
|
|
1032
1061
|
}
|
|
1033
1062
|
}
|
|
@@ -1047,7 +1076,7 @@ function getCandidate(data) {
|
|
|
1047
1076
|
errorDetails += `\n\nGot response: ${JSON.stringify(data)}`;
|
|
1048
1077
|
throw new Error(errorDetails);
|
|
1049
1078
|
}
|
|
1050
|
-
if (data.candidates.length > 1)
|
|
1079
|
+
if (data.candidates.length > 1) logger.debug(`Expected one candidate in AI Studio API response, but got ${data.candidates.length}: ${JSON.stringify(data)}`);
|
|
1051
1080
|
return data.candidates[0];
|
|
1052
1081
|
}
|
|
1053
1082
|
function formatCandidateContents(candidate) {
|
|
@@ -1109,7 +1138,7 @@ function loadFile(config_var, context_vars) {
|
|
|
1109
1138
|
const parsedContents = JSON.parse(fileContents);
|
|
1110
1139
|
return Array.isArray(parsedContents) ? normalizeTools(parsedContents) : parsedContents;
|
|
1111
1140
|
} catch (err) {
|
|
1112
|
-
|
|
1141
|
+
logger.debug(`ERROR: failed to convert file contents to JSON:\n${JSON.stringify(err)}`);
|
|
1113
1142
|
return fileContents;
|
|
1114
1143
|
}
|
|
1115
1144
|
if (Array.isArray(fileContents)) return normalizeTools(fileContents);
|
|
@@ -1141,7 +1170,7 @@ function getMimeTypeFromBase64(base64DataOrUrl) {
|
|
|
1141
1170
|
function processImagesInContents(contents, contextVars) {
|
|
1142
1171
|
if (!contextVars) return contents;
|
|
1143
1172
|
if (!Array.isArray(contents)) {
|
|
1144
|
-
|
|
1173
|
+
logger.warn("[Google] contents is not an array in processImagesInContents", {
|
|
1145
1174
|
contentsType: typeof contents,
|
|
1146
1175
|
contentsValue: contents
|
|
1147
1176
|
});
|
|
@@ -1218,7 +1247,7 @@ function geminiFormatAndSystemInstructions(prompt, contextVars, configSystemInst
|
|
|
1218
1247
|
}]);
|
|
1219
1248
|
const { contents: updatedContents, coerced, systemInstruction: parsedSystemInstruction } = maybeCoerceToGeminiFormat(contents, options);
|
|
1220
1249
|
if (coerced) {
|
|
1221
|
-
|
|
1250
|
+
logger.debug(`Coerced JSON prompt to Gemini format: ${JSON.stringify(contents)}`);
|
|
1222
1251
|
contents = updatedContents;
|
|
1223
1252
|
}
|
|
1224
1253
|
let systemInstruction = parsedSystemInstruction;
|
|
@@ -1373,7 +1402,6 @@ function createAuthCacheDiscriminator(headers) {
|
|
|
1373
1402
|
if (authValues.length === 0) return "";
|
|
1374
1403
|
return crypto.createHash("sha256").update(authValues.join("|")).digest("hex").substring(0, 16);
|
|
1375
1404
|
}
|
|
1376
|
-
|
|
1377
1405
|
//#endregion
|
|
1378
1406
|
//#region src/providers/mcp/transform.ts
|
|
1379
1407
|
function transformMCPToolsToOpenAi(tools) {
|
|
@@ -1473,7 +1501,7 @@ async function transformMCPServerConfigToClaudeCode(config) {
|
|
|
1473
1501
|
else throw new Error("MCP configuration cannot be converted to Claude Agent SDK MCP server config");
|
|
1474
1502
|
return [key, out];
|
|
1475
1503
|
}
|
|
1476
|
-
|
|
1477
1504
|
//#endregion
|
|
1478
1505
|
export { applyQueryParams as C, renderAuthVars as D, getOAuthTokenWithExpiry as E, TOKEN_REFRESH_BUFFER_MS as O, toDataUri as S, getAuthQueryParams as T, getGoogleClient as _, calculateGoogleCost as a, resolveProjectId as b, geminiFormatAndSystemInstructions as c, mergeParts as d, normalizeSafetySettings as f, GoogleAuthManager as g, CHAT_MODELS as h, transformMCPToolsToOpenAi as i, getCandidate as l, validateFunctionCall as m, transformMCPToolsToAnthropic as n, createAuthCacheDiscriminator as o, normalizeTools as p, transformMCPToolsToGoogle as r, formatCandidateContents as s, transformMCPConfigToClaudeCode as t, getGoogleAccessToken as u, hasGoogleDefaultCredentials as v, getAuthHeaders as w, parseDataUrl as x, loadCredentials as y };
|
|
1479
|
-
|
|
1506
|
+
|
|
1507
|
+
//# sourceMappingURL=transform-Cgi24fJ7.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
const require_logger = require(
|
|
2
|
-
const require_esm = require(
|
|
3
|
-
const require_pythonUtils = require(
|
|
4
|
-
const require_fileExtensions = require(
|
|
5
|
-
|
|
1
|
+
const require_logger = require("./logger-Cp1GPUjj.cjs");
|
|
2
|
+
const require_esm = require("./esm-CnNt7sI4.cjs");
|
|
3
|
+
const require_pythonUtils = require("./pythonUtils-CTU3Y3lw.cjs");
|
|
4
|
+
const require_fileExtensions = require("./fileExtensions-bYh77CN8.cjs");
|
|
6
5
|
//#region src/util/processShim.ts
|
|
7
6
|
/**
|
|
8
7
|
* Browser-safe process shim module.
|
|
@@ -92,7 +91,6 @@ function getProcessShim() {
|
|
|
92
91
|
}
|
|
93
92
|
return cachedNodeProcessShim;
|
|
94
93
|
}
|
|
95
|
-
|
|
96
94
|
//#endregion
|
|
97
95
|
//#region src/util/transform.ts
|
|
98
96
|
const TransformInputType = {
|
|
@@ -143,7 +141,7 @@ function getPythonTransformFunction(filePath, functionName = "get_transform") {
|
|
|
143
141
|
*/
|
|
144
142
|
async function getFileTransformFunction(filePath) {
|
|
145
143
|
const [actualFilePath, functionName] = parseFilePathAndFunctionName(filePath.slice(7));
|
|
146
|
-
const fullPath = require_esm.safeJoin(require_logger.
|
|
144
|
+
const fullPath = require_esm.safeJoin(require_logger.state.basePath || "", actualFilePath);
|
|
147
145
|
if (require_fileExtensions.isJavascriptFile(fullPath)) return getJavascriptTransformFunction(fullPath, functionName);
|
|
148
146
|
else if (fullPath.endsWith(".py")) return getPythonTransformFunction(fullPath, functionName);
|
|
149
147
|
throw new Error(`Unsupported transform file format: file://${actualFilePath}`);
|
|
@@ -174,13 +172,13 @@ async function getTransformFunction(codeOrFilepath, inputType) {
|
|
|
174
172
|
if (codeOrFilepath.startsWith("file://")) try {
|
|
175
173
|
transformFn = await getFileTransformFunction(codeOrFilepath);
|
|
176
174
|
} catch (error) {
|
|
177
|
-
require_logger.
|
|
175
|
+
require_logger.logger.error(`Error loading transform function from file: ${error instanceof Error ? error.message : String(error)}`);
|
|
178
176
|
throw error;
|
|
179
177
|
}
|
|
180
178
|
else try {
|
|
181
179
|
transformFn = getInlineTransformFunction(codeOrFilepath, inputType);
|
|
182
180
|
} catch (error) {
|
|
183
|
-
require_logger.
|
|
181
|
+
require_logger.logger.error(`Error creating inline transform function: ${error instanceof Error ? error.message : String(error)}`);
|
|
184
182
|
throw error;
|
|
185
183
|
}
|
|
186
184
|
return transformFn;
|
|
@@ -207,24 +205,24 @@ async function transform(codeOrFilepath, transformInput, context, validateReturn
|
|
|
207
205
|
if (validateReturn && (ret === null || ret === void 0)) throw new Error(`Transform function did not return a value\n\n${codeOrFilepath}`);
|
|
208
206
|
return ret;
|
|
209
207
|
}
|
|
210
|
-
|
|
211
208
|
//#endregion
|
|
212
|
-
Object.defineProperty(exports,
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
209
|
+
Object.defineProperty(exports, "TransformInputType", {
|
|
210
|
+
enumerable: true,
|
|
211
|
+
get: function() {
|
|
212
|
+
return TransformInputType;
|
|
213
|
+
}
|
|
217
214
|
});
|
|
218
|
-
Object.defineProperty(exports,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
215
|
+
Object.defineProperty(exports, "getProcessShim", {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: function() {
|
|
218
|
+
return getProcessShim;
|
|
219
|
+
}
|
|
223
220
|
});
|
|
224
|
-
Object.defineProperty(exports,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
221
|
+
Object.defineProperty(exports, "transform", {
|
|
222
|
+
enumerable: true,
|
|
223
|
+
get: function() {
|
|
224
|
+
return transform;
|
|
225
|
+
}
|
|
229
226
|
});
|
|
230
|
-
|
|
227
|
+
|
|
228
|
+
//# sourceMappingURL=transform-CzK1Q0zl.cjs.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { n as __require } from "./chunk-
|
|
2
|
-
import { i as
|
|
3
|
-
import { a as safeJoin, r as importModule } from "./esm-
|
|
4
|
-
import { r as runPython } from "./pythonUtils-
|
|
5
|
-
import { i as isJavascriptFile } from "./fileExtensions-
|
|
6
|
-
|
|
1
|
+
import { n as __require, t as __exportAll } from "./chunk-DEq-mXcV.js";
|
|
2
|
+
import { i as logger, w as state } from "./logger-CT3IKMKA.js";
|
|
3
|
+
import { a as safeJoin, r as importModule } from "./esm-Cd1AjG1D.js";
|
|
4
|
+
import { r as runPython } from "./pythonUtils-D5nxkQ0P.js";
|
|
5
|
+
import { i as isJavascriptFile } from "./fileExtensions-DnqA1y9x.js";
|
|
7
6
|
//#region src/util/processShim.ts
|
|
8
7
|
/**
|
|
9
8
|
* Browser-safe process shim module.
|
|
@@ -93,9 +92,12 @@ function getProcessShim() {
|
|
|
93
92
|
}
|
|
94
93
|
return cachedNodeProcessShim;
|
|
95
94
|
}
|
|
96
|
-
|
|
97
95
|
//#endregion
|
|
98
96
|
//#region src/util/transform.ts
|
|
97
|
+
var transform_exports = /* @__PURE__ */ __exportAll({
|
|
98
|
+
TransformInputType: () => TransformInputType,
|
|
99
|
+
transform: () => transform
|
|
100
|
+
});
|
|
99
101
|
const TransformInputType = {
|
|
100
102
|
OUTPUT: "output",
|
|
101
103
|
VARS: "vars"
|
|
@@ -144,7 +146,7 @@ function getPythonTransformFunction(filePath, functionName = "get_transform") {
|
|
|
144
146
|
*/
|
|
145
147
|
async function getFileTransformFunction(filePath) {
|
|
146
148
|
const [actualFilePath, functionName] = parseFilePathAndFunctionName(filePath.slice(7));
|
|
147
|
-
const fullPath = safeJoin(
|
|
149
|
+
const fullPath = safeJoin(state.basePath || "", actualFilePath);
|
|
148
150
|
if (isJavascriptFile(fullPath)) return getJavascriptTransformFunction(fullPath, functionName);
|
|
149
151
|
else if (fullPath.endsWith(".py")) return getPythonTransformFunction(fullPath, functionName);
|
|
150
152
|
throw new Error(`Unsupported transform file format: file://${actualFilePath}`);
|
|
@@ -175,13 +177,13 @@ async function getTransformFunction(codeOrFilepath, inputType) {
|
|
|
175
177
|
if (codeOrFilepath.startsWith("file://")) try {
|
|
176
178
|
transformFn = await getFileTransformFunction(codeOrFilepath);
|
|
177
179
|
} catch (error) {
|
|
178
|
-
|
|
180
|
+
logger.error(`Error loading transform function from file: ${error instanceof Error ? error.message : String(error)}`);
|
|
179
181
|
throw error;
|
|
180
182
|
}
|
|
181
183
|
else try {
|
|
182
184
|
transformFn = getInlineTransformFunction(codeOrFilepath, inputType);
|
|
183
185
|
} catch (error) {
|
|
184
|
-
|
|
186
|
+
logger.error(`Error creating inline transform function: ${error instanceof Error ? error.message : String(error)}`);
|
|
185
187
|
throw error;
|
|
186
188
|
}
|
|
187
189
|
return transformFn;
|
|
@@ -208,7 +210,7 @@ async function transform(codeOrFilepath, transformInput, context, validateReturn
|
|
|
208
210
|
if (validateReturn && (ret === null || ret === void 0)) throw new Error(`Transform function did not return a value\n\n${codeOrFilepath}`);
|
|
209
211
|
return ret;
|
|
210
212
|
}
|
|
211
|
-
|
|
212
213
|
//#endregion
|
|
213
|
-
export { transform as n,
|
|
214
|
-
|
|
214
|
+
export { getProcessShim as i, transform as n, transform_exports as r, TransformInputType as t };
|
|
215
|
+
|
|
216
|
+
//# sourceMappingURL=transform-DECvGmzp.js.map
|