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,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as logger } from "./logger-CT3IKMKA.js";
|
|
2
|
+
import { t as getDirectory } from "./esm-Cd1AjG1D.js";
|
|
3
|
+
import "./types-CLKiCBW3.js";
|
|
4
|
+
import "./tables-5EvT_Bwn.js";
|
|
5
|
+
import { t as getTraceStore } from "./store-DQLEjuEO.js";
|
|
2
6
|
import path from "path";
|
|
3
7
|
import express from "express";
|
|
4
8
|
import protobuf from "protobufjs";
|
|
5
|
-
|
|
6
9
|
//#region src/tracing/protobuf.ts
|
|
7
10
|
/**
|
|
8
11
|
* OTLP Protobuf decoder for trace data
|
|
@@ -24,9 +27,9 @@ function getProtoDir() {
|
|
|
24
27
|
*/
|
|
25
28
|
async function loadProtoDefinitions() {
|
|
26
29
|
if (protoRoot) return protoRoot;
|
|
27
|
-
|
|
30
|
+
logger.debug("[Protobuf] Loading OTLP proto definitions");
|
|
28
31
|
const protoDir = getProtoDir();
|
|
29
|
-
|
|
32
|
+
logger.debug(`[Protobuf] Proto directory: ${protoDir}`);
|
|
30
33
|
try {
|
|
31
34
|
const root = new protobuf.Root();
|
|
32
35
|
root.resolvePath = (_origin, target) => {
|
|
@@ -34,10 +37,10 @@ async function loadProtoDefinitions() {
|
|
|
34
37
|
};
|
|
35
38
|
await root.load("opentelemetry/proto/collector/trace/v1/trace_service.proto");
|
|
36
39
|
protoRoot = root;
|
|
37
|
-
|
|
40
|
+
logger.debug("[Protobuf] Successfully loaded OTLP proto definitions");
|
|
38
41
|
return protoRoot;
|
|
39
42
|
} catch (error) {
|
|
40
|
-
|
|
43
|
+
logger.error(`[Protobuf] Failed to load proto definitions: ${error}`);
|
|
41
44
|
throw error;
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -72,14 +75,13 @@ async function decodeExportTraceServiceRequest(data) {
|
|
|
72
75
|
defaults: true,
|
|
73
76
|
arrays: true
|
|
74
77
|
});
|
|
75
|
-
|
|
78
|
+
logger.debug(`[Protobuf] Decoded ExportTraceServiceRequest with ${decoded.resourceSpans?.length || 0} resource spans`);
|
|
76
79
|
return decoded;
|
|
77
80
|
} catch (error) {
|
|
78
|
-
|
|
81
|
+
logger.error(`[Protobuf] Failed to decode ExportTraceServiceRequest: ${error}`);
|
|
79
82
|
throw new Error(`Invalid protobuf data: ${error instanceof Error ? error.message : error}`);
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
|
|
83
85
|
//#endregion
|
|
84
86
|
//#region src/tracing/otlpReceiver.ts
|
|
85
87
|
const SPAN_KIND_MAP = {
|
|
@@ -98,7 +100,7 @@ var OTLPReceiver = class {
|
|
|
98
100
|
constructor() {
|
|
99
101
|
this.app = express();
|
|
100
102
|
this.traceStore = getTraceStore();
|
|
101
|
-
|
|
103
|
+
logger.debug("[OtlpReceiver] Initializing OTLP receiver");
|
|
102
104
|
this.setupMiddleware();
|
|
103
105
|
this.setupRoutes();
|
|
104
106
|
}
|
|
@@ -111,14 +113,14 @@ var OTLPReceiver = class {
|
|
|
111
113
|
type: "application/x-protobuf",
|
|
112
114
|
limit: "10mb"
|
|
113
115
|
}));
|
|
114
|
-
|
|
116
|
+
logger.debug("[OtlpReceiver] Middleware configured for JSON and protobuf");
|
|
115
117
|
}
|
|
116
118
|
setupRoutes() {
|
|
117
119
|
this.app.post("/v1/traces", async (req, res) => {
|
|
118
120
|
const contentType = req.headers["content-type"] || "unknown";
|
|
119
121
|
const bodySize = req.body ? JSON.stringify(req.body).length : 0;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
logger.debug(`[OtlpReceiver] Received trace request: ${req.headers["content-type"]} with ${bodySize} bytes`);
|
|
123
|
+
logger.debug("[OtlpReceiver] Starting to process traces");
|
|
122
124
|
const isJson = contentType === "application/json";
|
|
123
125
|
const isProtobuf = contentType === "application/x-protobuf";
|
|
124
126
|
if (!isJson && !isProtobuf) {
|
|
@@ -128,15 +130,15 @@ var OTLPReceiver = class {
|
|
|
128
130
|
try {
|
|
129
131
|
let traces = [];
|
|
130
132
|
if (isJson) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
+
logger.debug("[OtlpReceiver] Parsing OTLP JSON request");
|
|
134
|
+
logger.debug(`[OtlpReceiver] Request body: ${JSON.stringify(req.body).substring(0, 500)}...`);
|
|
133
135
|
traces = this.parseOTLPJSONRequest(req.body);
|
|
134
136
|
} else if (isProtobuf) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
logger.debug("[OtlpReceiver] Parsing OTLP protobuf request");
|
|
138
|
+
logger.debug(`[OtlpReceiver] Request body size: ${req.body?.length || 0} bytes`);
|
|
137
139
|
traces = await this.parseOTLPProtobufRequest(req.body);
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
logger.debug(`[OtlpReceiver] Parsed ${traces.length} traces from request`);
|
|
140
142
|
const spansByTrace = /* @__PURE__ */ new Map();
|
|
141
143
|
const traceInfoById = /* @__PURE__ */ new Map();
|
|
142
144
|
for (const trace of traces) {
|
|
@@ -151,26 +153,26 @@ var OTLPReceiver = class {
|
|
|
151
153
|
}
|
|
152
154
|
spansByTrace.get(trace.traceId).push(trace.span);
|
|
153
155
|
}
|
|
154
|
-
|
|
156
|
+
logger.debug(`[OtlpReceiver] Grouped spans into ${spansByTrace.size} traces`);
|
|
155
157
|
for (const [traceId, info] of traceInfoById) try {
|
|
156
|
-
|
|
158
|
+
logger.debug(`[OtlpReceiver] Creating trace record for ${traceId}`);
|
|
157
159
|
await this.traceStore.createTrace({
|
|
158
160
|
traceId,
|
|
159
161
|
evaluationId: info.evaluationId || "",
|
|
160
162
|
testCaseId: info.testCaseId || ""
|
|
161
163
|
});
|
|
162
164
|
} catch (error) {
|
|
163
|
-
|
|
165
|
+
logger.debug(`[OtlpReceiver] Trace ${traceId} may already exist: ${error}`);
|
|
164
166
|
}
|
|
165
167
|
for (const [traceId, spans] of spansByTrace) {
|
|
166
|
-
|
|
168
|
+
logger.debug(`[OtlpReceiver] Storing ${spans.length} spans for trace ${traceId}`);
|
|
167
169
|
await this.traceStore.addSpans(traceId, spans, { skipTraceCheck: true });
|
|
168
170
|
}
|
|
169
171
|
res.status(200).json({ partialSuccess: {} });
|
|
170
|
-
|
|
172
|
+
logger.debug("[OtlpReceiver] Successfully processed traces");
|
|
171
173
|
} catch (error) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
+
logger.error(`[OtlpReceiver] Failed to process OTLP traces: ${error}`);
|
|
175
|
+
logger.error(`[OtlpReceiver] Error stack: ${error instanceof Error ? error.stack : "No stack"}`);
|
|
174
176
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
175
177
|
if (errorMessage.toLowerCase().includes("invalid protobuf")) {
|
|
176
178
|
res.status(400).json({ error: errorMessage });
|
|
@@ -180,7 +182,7 @@ var OTLPReceiver = class {
|
|
|
180
182
|
}
|
|
181
183
|
});
|
|
182
184
|
this.app.get("/health", (_req, res) => {
|
|
183
|
-
|
|
185
|
+
logger.debug("[OtlpReceiver] Health check requested");
|
|
184
186
|
res.status(200).json({ status: "ok" });
|
|
185
187
|
});
|
|
186
188
|
this.app.get("/v1/traces", (_req, res) => {
|
|
@@ -199,8 +201,8 @@ var OTLPReceiver = class {
|
|
|
199
201
|
});
|
|
200
202
|
});
|
|
201
203
|
this.app.use((error, _req, res, _next) => {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
logger.error(`[OtlpReceiver] Global error handler: ${error}`);
|
|
205
|
+
logger.error(`[OtlpReceiver] Error stack: ${error.stack}`);
|
|
204
206
|
if (error instanceof SyntaxError && "body" in error) {
|
|
205
207
|
res.status(400).json({ error: "Invalid JSON" });
|
|
206
208
|
return;
|
|
@@ -210,15 +212,15 @@ var OTLPReceiver = class {
|
|
|
210
212
|
}
|
|
211
213
|
parseOTLPJSONRequest(body) {
|
|
212
214
|
const traces = [];
|
|
213
|
-
|
|
215
|
+
logger.debug(`[OtlpReceiver] Parsing request with ${body.resourceSpans?.length || 0} resource spans`);
|
|
214
216
|
for (const resourceSpan of body.resourceSpans) {
|
|
215
217
|
const resourceAttributes = this.parseAttributes(resourceSpan.resource?.attributes);
|
|
216
|
-
|
|
218
|
+
logger.debug(`[OtlpReceiver] Parsed ${Object.keys(resourceAttributes).length} resource attributes`);
|
|
217
219
|
for (const scopeSpan of resourceSpan.scopeSpans) for (const span of scopeSpan.spans) {
|
|
218
220
|
const traceId = this.convertId(span.traceId, 32);
|
|
219
221
|
const spanId = this.convertId(span.spanId, 16);
|
|
220
222
|
const parentSpanId = span.parentSpanId ? this.convertId(span.parentSpanId, 16) : void 0;
|
|
221
|
-
|
|
223
|
+
logger.debug(`[OtlpReceiver] Processing span: ${span.name} (${spanId}) in trace ${traceId}`);
|
|
222
224
|
const spanKindName = SPAN_KIND_MAP[span.kind] ?? "unspecified";
|
|
223
225
|
const attributes = {
|
|
224
226
|
...resourceAttributes,
|
|
@@ -248,15 +250,15 @@ var OTLPReceiver = class {
|
|
|
248
250
|
async parseOTLPProtobufRequest(body) {
|
|
249
251
|
const traces = [];
|
|
250
252
|
const decoded = await decodeExportTraceServiceRequest(body);
|
|
251
|
-
|
|
253
|
+
logger.debug(`[OtlpReceiver] Parsing protobuf request with ${decoded.resourceSpans?.length || 0} resource spans`);
|
|
252
254
|
for (const resourceSpan of decoded.resourceSpans || []) {
|
|
253
255
|
const resourceAttributes = this.parseDecodedAttributes(resourceSpan.resource?.attributes);
|
|
254
|
-
|
|
256
|
+
logger.debug(`[OtlpReceiver] Parsed ${Object.keys(resourceAttributes).length} resource attributes from protobuf`);
|
|
255
257
|
for (const scopeSpan of resourceSpan.scopeSpans || []) for (const span of scopeSpan.spans || []) {
|
|
256
258
|
const traceId = bytesToHex(span.traceId, 32);
|
|
257
259
|
const spanId = bytesToHex(span.spanId, 16);
|
|
258
260
|
const parentSpanId = span.parentSpanId?.length ? bytesToHex(span.parentSpanId, 16) : void 0;
|
|
259
|
-
|
|
261
|
+
logger.debug(`[OtlpReceiver] Processing protobuf span: ${span.name} (${spanId}) in trace ${traceId}`);
|
|
260
262
|
const spanKindName = SPAN_KIND_MAP[span.kind ?? 0] ?? "unspecified";
|
|
261
263
|
const attributes = {
|
|
262
264
|
...resourceAttributes,
|
|
@@ -330,53 +332,53 @@ var OTLPReceiver = class {
|
|
|
330
332
|
}
|
|
331
333
|
}
|
|
332
334
|
convertId(id, expectedHexLength) {
|
|
333
|
-
|
|
335
|
+
logger.debug(`[OtlpReceiver] Converting ID: ${id} (length: ${id.length}, expected hex length: ${expectedHexLength})`);
|
|
334
336
|
if (id.length === expectedHexLength && /^[0-9a-f]+$/i.test(id)) {
|
|
335
|
-
|
|
337
|
+
logger.debug(`[OtlpReceiver] ID is already hex format`);
|
|
336
338
|
return id.toLowerCase();
|
|
337
339
|
}
|
|
338
340
|
try {
|
|
339
341
|
const buffer = Buffer.from(id, "base64");
|
|
340
342
|
const hex = buffer.toString("hex");
|
|
341
|
-
|
|
343
|
+
logger.debug(`[OtlpReceiver] Base64 decoded: ${id} -> ${hex} (${buffer.length} bytes)`);
|
|
342
344
|
const utf8String = buffer.toString("utf8");
|
|
343
345
|
if (utf8String.length === expectedHexLength && /^[0-9a-f]+$/i.test(utf8String)) {
|
|
344
|
-
|
|
346
|
+
logger.debug(`[OtlpReceiver] Detected hex string encoded as UTF-8: ${utf8String}`);
|
|
345
347
|
return utf8String.toLowerCase();
|
|
346
348
|
}
|
|
347
349
|
if (hex.length === expectedHexLength) return hex;
|
|
348
|
-
|
|
350
|
+
logger.warn(`[OtlpReceiver] Unexpected ID format: ${id} -> ${hex} (expected ${expectedHexLength} hex chars)`);
|
|
349
351
|
return id.toLowerCase();
|
|
350
352
|
} catch (error) {
|
|
351
|
-
|
|
353
|
+
logger.error(`[OtlpReceiver] Failed to convert ID: ${error}`);
|
|
352
354
|
return id.toLowerCase();
|
|
353
355
|
}
|
|
354
356
|
}
|
|
355
357
|
listen(port = 4318, host = "127.0.0.1") {
|
|
356
358
|
this.port = port;
|
|
357
|
-
|
|
359
|
+
logger.debug(`[OtlpReceiver] Starting receiver on ${host}:${port}`);
|
|
358
360
|
return new Promise((resolve, reject) => {
|
|
359
361
|
this.server = this.app.listen(port, host, () => {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
logger.info(`[OtlpReceiver] Listening on http://${host}:${port}`);
|
|
363
|
+
logger.debug("[OtlpReceiver] Receiver fully initialized and ready to accept traces");
|
|
362
364
|
resolve();
|
|
363
365
|
});
|
|
364
366
|
this.server.on("error", (error) => {
|
|
365
|
-
|
|
367
|
+
logger.error(`[OtlpReceiver] Failed to start: ${error}`);
|
|
366
368
|
reject(error);
|
|
367
369
|
});
|
|
368
370
|
});
|
|
369
371
|
}
|
|
370
372
|
stop() {
|
|
371
|
-
|
|
373
|
+
logger.debug("[OtlpReceiver] Stopping receiver");
|
|
372
374
|
return new Promise((resolve) => {
|
|
373
375
|
if (this.server) this.server.close(() => {
|
|
374
|
-
|
|
376
|
+
logger.info("[OtlpReceiver] Server stopped");
|
|
375
377
|
this.server = void 0;
|
|
376
378
|
resolve();
|
|
377
379
|
});
|
|
378
380
|
else {
|
|
379
|
-
|
|
381
|
+
logger.debug("[OtlpReceiver] No server to stop");
|
|
380
382
|
resolve();
|
|
381
383
|
}
|
|
382
384
|
});
|
|
@@ -391,17 +393,17 @@ function getOTLPReceiver() {
|
|
|
391
393
|
return otlpReceiver;
|
|
392
394
|
}
|
|
393
395
|
async function startOTLPReceiver(port, host) {
|
|
394
|
-
|
|
396
|
+
logger.debug("[OtlpReceiver] Starting receiver through startOTLPReceiver function");
|
|
395
397
|
await getOTLPReceiver().listen(port, host);
|
|
396
398
|
}
|
|
397
399
|
async function stopOTLPReceiver() {
|
|
398
|
-
|
|
400
|
+
logger.debug("[OtlpReceiver] Stopping receiver through stopOTLPReceiver function");
|
|
399
401
|
if (otlpReceiver) {
|
|
400
402
|
await otlpReceiver.stop();
|
|
401
403
|
otlpReceiver = null;
|
|
402
404
|
}
|
|
403
405
|
}
|
|
404
|
-
|
|
405
406
|
//#endregion
|
|
406
407
|
export { startOTLPReceiver, stopOTLPReceiver };
|
|
407
|
-
|
|
408
|
+
|
|
409
|
+
//# sourceMappingURL=otlpReceiver--AIRW_S4.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { o as
|
|
3
|
-
import "./types-
|
|
4
|
-
import { t as getDirectory } from "./esm-
|
|
5
|
-
import "./tables-
|
|
6
|
-
import { n as getTraceStore } from "./store-
|
|
2
|
+
import { o as logger } from "./logger-KkObSCzq.js";
|
|
3
|
+
import "./types-CH3Ge2sE.js";
|
|
4
|
+
import { t as getDirectory } from "./esm-C03C-mv3.js";
|
|
5
|
+
import "./tables-D36WTqKX.js";
|
|
6
|
+
import { n as getTraceStore } from "./store-D1tv90v3.js";
|
|
7
7
|
import path from "path";
|
|
8
8
|
import express from "express";
|
|
9
9
|
import protobuf from "protobufjs";
|
|
10
|
-
|
|
11
10
|
//#region src/tracing/protobuf.ts
|
|
12
11
|
/**
|
|
13
12
|
* OTLP Protobuf decoder for trace data
|
|
@@ -29,9 +28,9 @@ function getProtoDir() {
|
|
|
29
28
|
*/
|
|
30
29
|
async function loadProtoDefinitions() {
|
|
31
30
|
if (protoRoot) return protoRoot;
|
|
32
|
-
|
|
31
|
+
logger.debug("[Protobuf] Loading OTLP proto definitions");
|
|
33
32
|
const protoDir = getProtoDir();
|
|
34
|
-
|
|
33
|
+
logger.debug(`[Protobuf] Proto directory: ${protoDir}`);
|
|
35
34
|
try {
|
|
36
35
|
const root = new protobuf.Root();
|
|
37
36
|
root.resolvePath = (_origin, target) => {
|
|
@@ -39,10 +38,10 @@ async function loadProtoDefinitions() {
|
|
|
39
38
|
};
|
|
40
39
|
await root.load("opentelemetry/proto/collector/trace/v1/trace_service.proto");
|
|
41
40
|
protoRoot = root;
|
|
42
|
-
|
|
41
|
+
logger.debug("[Protobuf] Successfully loaded OTLP proto definitions");
|
|
43
42
|
return protoRoot;
|
|
44
43
|
} catch (error) {
|
|
45
|
-
|
|
44
|
+
logger.error(`[Protobuf] Failed to load proto definitions: ${error}`);
|
|
46
45
|
throw error;
|
|
47
46
|
}
|
|
48
47
|
}
|
|
@@ -77,14 +76,13 @@ async function decodeExportTraceServiceRequest(data) {
|
|
|
77
76
|
defaults: true,
|
|
78
77
|
arrays: true
|
|
79
78
|
});
|
|
80
|
-
|
|
79
|
+
logger.debug(`[Protobuf] Decoded ExportTraceServiceRequest with ${decoded.resourceSpans?.length || 0} resource spans`);
|
|
81
80
|
return decoded;
|
|
82
81
|
} catch (error) {
|
|
83
|
-
|
|
82
|
+
logger.error(`[Protobuf] Failed to decode ExportTraceServiceRequest: ${error}`);
|
|
84
83
|
throw new Error(`Invalid protobuf data: ${error instanceof Error ? error.message : error}`);
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
|
-
|
|
88
86
|
//#endregion
|
|
89
87
|
//#region src/tracing/otlpReceiver.ts
|
|
90
88
|
const SPAN_KIND_MAP = {
|
|
@@ -103,7 +101,7 @@ var OTLPReceiver = class {
|
|
|
103
101
|
constructor() {
|
|
104
102
|
this.app = express();
|
|
105
103
|
this.traceStore = getTraceStore();
|
|
106
|
-
|
|
104
|
+
logger.debug("[OtlpReceiver] Initializing OTLP receiver");
|
|
107
105
|
this.setupMiddleware();
|
|
108
106
|
this.setupRoutes();
|
|
109
107
|
}
|
|
@@ -116,14 +114,14 @@ var OTLPReceiver = class {
|
|
|
116
114
|
type: "application/x-protobuf",
|
|
117
115
|
limit: "10mb"
|
|
118
116
|
}));
|
|
119
|
-
|
|
117
|
+
logger.debug("[OtlpReceiver] Middleware configured for JSON and protobuf");
|
|
120
118
|
}
|
|
121
119
|
setupRoutes() {
|
|
122
120
|
this.app.post("/v1/traces", async (req, res) => {
|
|
123
121
|
const contentType = req.headers["content-type"] || "unknown";
|
|
124
122
|
const bodySize = req.body ? JSON.stringify(req.body).length : 0;
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
logger.debug(`[OtlpReceiver] Received trace request: ${req.headers["content-type"]} with ${bodySize} bytes`);
|
|
124
|
+
logger.debug("[OtlpReceiver] Starting to process traces");
|
|
127
125
|
const isJson = contentType === "application/json";
|
|
128
126
|
const isProtobuf = contentType === "application/x-protobuf";
|
|
129
127
|
if (!isJson && !isProtobuf) {
|
|
@@ -133,15 +131,15 @@ var OTLPReceiver = class {
|
|
|
133
131
|
try {
|
|
134
132
|
let traces = [];
|
|
135
133
|
if (isJson) {
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
logger.debug("[OtlpReceiver] Parsing OTLP JSON request");
|
|
135
|
+
logger.debug(`[OtlpReceiver] Request body: ${JSON.stringify(req.body).substring(0, 500)}...`);
|
|
138
136
|
traces = this.parseOTLPJSONRequest(req.body);
|
|
139
137
|
} else if (isProtobuf) {
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
logger.debug("[OtlpReceiver] Parsing OTLP protobuf request");
|
|
139
|
+
logger.debug(`[OtlpReceiver] Request body size: ${req.body?.length || 0} bytes`);
|
|
142
140
|
traces = await this.parseOTLPProtobufRequest(req.body);
|
|
143
141
|
}
|
|
144
|
-
|
|
142
|
+
logger.debug(`[OtlpReceiver] Parsed ${traces.length} traces from request`);
|
|
145
143
|
const spansByTrace = /* @__PURE__ */ new Map();
|
|
146
144
|
const traceInfoById = /* @__PURE__ */ new Map();
|
|
147
145
|
for (const trace of traces) {
|
|
@@ -156,26 +154,26 @@ var OTLPReceiver = class {
|
|
|
156
154
|
}
|
|
157
155
|
spansByTrace.get(trace.traceId).push(trace.span);
|
|
158
156
|
}
|
|
159
|
-
|
|
157
|
+
logger.debug(`[OtlpReceiver] Grouped spans into ${spansByTrace.size} traces`);
|
|
160
158
|
for (const [traceId, info] of traceInfoById) try {
|
|
161
|
-
|
|
159
|
+
logger.debug(`[OtlpReceiver] Creating trace record for ${traceId}`);
|
|
162
160
|
await this.traceStore.createTrace({
|
|
163
161
|
traceId,
|
|
164
162
|
evaluationId: info.evaluationId || "",
|
|
165
163
|
testCaseId: info.testCaseId || ""
|
|
166
164
|
});
|
|
167
165
|
} catch (error) {
|
|
168
|
-
|
|
166
|
+
logger.debug(`[OtlpReceiver] Trace ${traceId} may already exist: ${error}`);
|
|
169
167
|
}
|
|
170
168
|
for (const [traceId, spans] of spansByTrace) {
|
|
171
|
-
|
|
169
|
+
logger.debug(`[OtlpReceiver] Storing ${spans.length} spans for trace ${traceId}`);
|
|
172
170
|
await this.traceStore.addSpans(traceId, spans, { skipTraceCheck: true });
|
|
173
171
|
}
|
|
174
172
|
res.status(200).json({ partialSuccess: {} });
|
|
175
|
-
|
|
173
|
+
logger.debug("[OtlpReceiver] Successfully processed traces");
|
|
176
174
|
} catch (error) {
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
logger.error(`[OtlpReceiver] Failed to process OTLP traces: ${error}`);
|
|
176
|
+
logger.error(`[OtlpReceiver] Error stack: ${error instanceof Error ? error.stack : "No stack"}`);
|
|
179
177
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
180
178
|
if (errorMessage.toLowerCase().includes("invalid protobuf")) {
|
|
181
179
|
res.status(400).json({ error: errorMessage });
|
|
@@ -185,7 +183,7 @@ var OTLPReceiver = class {
|
|
|
185
183
|
}
|
|
186
184
|
});
|
|
187
185
|
this.app.get("/health", (_req, res) => {
|
|
188
|
-
|
|
186
|
+
logger.debug("[OtlpReceiver] Health check requested");
|
|
189
187
|
res.status(200).json({ status: "ok" });
|
|
190
188
|
});
|
|
191
189
|
this.app.get("/v1/traces", (_req, res) => {
|
|
@@ -204,8 +202,8 @@ var OTLPReceiver = class {
|
|
|
204
202
|
});
|
|
205
203
|
});
|
|
206
204
|
this.app.use((error, _req, res, _next) => {
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
logger.error(`[OtlpReceiver] Global error handler: ${error}`);
|
|
206
|
+
logger.error(`[OtlpReceiver] Error stack: ${error.stack}`);
|
|
209
207
|
if (error instanceof SyntaxError && "body" in error) {
|
|
210
208
|
res.status(400).json({ error: "Invalid JSON" });
|
|
211
209
|
return;
|
|
@@ -215,15 +213,15 @@ var OTLPReceiver = class {
|
|
|
215
213
|
}
|
|
216
214
|
parseOTLPJSONRequest(body) {
|
|
217
215
|
const traces = [];
|
|
218
|
-
|
|
216
|
+
logger.debug(`[OtlpReceiver] Parsing request with ${body.resourceSpans?.length || 0} resource spans`);
|
|
219
217
|
for (const resourceSpan of body.resourceSpans) {
|
|
220
218
|
const resourceAttributes = this.parseAttributes(resourceSpan.resource?.attributes);
|
|
221
|
-
|
|
219
|
+
logger.debug(`[OtlpReceiver] Parsed ${Object.keys(resourceAttributes).length} resource attributes`);
|
|
222
220
|
for (const scopeSpan of resourceSpan.scopeSpans) for (const span of scopeSpan.spans) {
|
|
223
221
|
const traceId = this.convertId(span.traceId, 32);
|
|
224
222
|
const spanId = this.convertId(span.spanId, 16);
|
|
225
223
|
const parentSpanId = span.parentSpanId ? this.convertId(span.parentSpanId, 16) : void 0;
|
|
226
|
-
|
|
224
|
+
logger.debug(`[OtlpReceiver] Processing span: ${span.name} (${spanId}) in trace ${traceId}`);
|
|
227
225
|
const spanKindName = SPAN_KIND_MAP[span.kind] ?? "unspecified";
|
|
228
226
|
const attributes = {
|
|
229
227
|
...resourceAttributes,
|
|
@@ -253,15 +251,15 @@ var OTLPReceiver = class {
|
|
|
253
251
|
async parseOTLPProtobufRequest(body) {
|
|
254
252
|
const traces = [];
|
|
255
253
|
const decoded = await decodeExportTraceServiceRequest(body);
|
|
256
|
-
|
|
254
|
+
logger.debug(`[OtlpReceiver] Parsing protobuf request with ${decoded.resourceSpans?.length || 0} resource spans`);
|
|
257
255
|
for (const resourceSpan of decoded.resourceSpans || []) {
|
|
258
256
|
const resourceAttributes = this.parseDecodedAttributes(resourceSpan.resource?.attributes);
|
|
259
|
-
|
|
257
|
+
logger.debug(`[OtlpReceiver] Parsed ${Object.keys(resourceAttributes).length} resource attributes from protobuf`);
|
|
260
258
|
for (const scopeSpan of resourceSpan.scopeSpans || []) for (const span of scopeSpan.spans || []) {
|
|
261
259
|
const traceId = bytesToHex(span.traceId, 32);
|
|
262
260
|
const spanId = bytesToHex(span.spanId, 16);
|
|
263
261
|
const parentSpanId = span.parentSpanId?.length ? bytesToHex(span.parentSpanId, 16) : void 0;
|
|
264
|
-
|
|
262
|
+
logger.debug(`[OtlpReceiver] Processing protobuf span: ${span.name} (${spanId}) in trace ${traceId}`);
|
|
265
263
|
const spanKindName = SPAN_KIND_MAP[span.kind ?? 0] ?? "unspecified";
|
|
266
264
|
const attributes = {
|
|
267
265
|
...resourceAttributes,
|
|
@@ -335,53 +333,53 @@ var OTLPReceiver = class {
|
|
|
335
333
|
}
|
|
336
334
|
}
|
|
337
335
|
convertId(id, expectedHexLength) {
|
|
338
|
-
|
|
336
|
+
logger.debug(`[OtlpReceiver] Converting ID: ${id} (length: ${id.length}, expected hex length: ${expectedHexLength})`);
|
|
339
337
|
if (id.length === expectedHexLength && /^[0-9a-f]+$/i.test(id)) {
|
|
340
|
-
|
|
338
|
+
logger.debug(`[OtlpReceiver] ID is already hex format`);
|
|
341
339
|
return id.toLowerCase();
|
|
342
340
|
}
|
|
343
341
|
try {
|
|
344
342
|
const buffer = Buffer.from(id, "base64");
|
|
345
343
|
const hex = buffer.toString("hex");
|
|
346
|
-
|
|
344
|
+
logger.debug(`[OtlpReceiver] Base64 decoded: ${id} -> ${hex} (${buffer.length} bytes)`);
|
|
347
345
|
const utf8String = buffer.toString("utf8");
|
|
348
346
|
if (utf8String.length === expectedHexLength && /^[0-9a-f]+$/i.test(utf8String)) {
|
|
349
|
-
|
|
347
|
+
logger.debug(`[OtlpReceiver] Detected hex string encoded as UTF-8: ${utf8String}`);
|
|
350
348
|
return utf8String.toLowerCase();
|
|
351
349
|
}
|
|
352
350
|
if (hex.length === expectedHexLength) return hex;
|
|
353
|
-
|
|
351
|
+
logger.warn(`[OtlpReceiver] Unexpected ID format: ${id} -> ${hex} (expected ${expectedHexLength} hex chars)`);
|
|
354
352
|
return id.toLowerCase();
|
|
355
353
|
} catch (error) {
|
|
356
|
-
|
|
354
|
+
logger.error(`[OtlpReceiver] Failed to convert ID: ${error}`);
|
|
357
355
|
return id.toLowerCase();
|
|
358
356
|
}
|
|
359
357
|
}
|
|
360
358
|
listen(port = 4318, host = "127.0.0.1") {
|
|
361
359
|
this.port = port;
|
|
362
|
-
|
|
360
|
+
logger.debug(`[OtlpReceiver] Starting receiver on ${host}:${port}`);
|
|
363
361
|
return new Promise((resolve, reject) => {
|
|
364
362
|
this.server = this.app.listen(port, host, () => {
|
|
365
|
-
|
|
366
|
-
|
|
363
|
+
logger.info(`[OtlpReceiver] Listening on http://${host}:${port}`);
|
|
364
|
+
logger.debug("[OtlpReceiver] Receiver fully initialized and ready to accept traces");
|
|
367
365
|
resolve();
|
|
368
366
|
});
|
|
369
367
|
this.server.on("error", (error) => {
|
|
370
|
-
|
|
368
|
+
logger.error(`[OtlpReceiver] Failed to start: ${error}`);
|
|
371
369
|
reject(error);
|
|
372
370
|
});
|
|
373
371
|
});
|
|
374
372
|
}
|
|
375
373
|
stop() {
|
|
376
|
-
|
|
374
|
+
logger.debug("[OtlpReceiver] Stopping receiver");
|
|
377
375
|
return new Promise((resolve) => {
|
|
378
376
|
if (this.server) this.server.close(() => {
|
|
379
|
-
|
|
377
|
+
logger.info("[OtlpReceiver] Server stopped");
|
|
380
378
|
this.server = void 0;
|
|
381
379
|
resolve();
|
|
382
380
|
});
|
|
383
381
|
else {
|
|
384
|
-
|
|
382
|
+
logger.debug("[OtlpReceiver] No server to stop");
|
|
385
383
|
resolve();
|
|
386
384
|
}
|
|
387
385
|
});
|
|
@@ -396,17 +394,17 @@ function getOTLPReceiver() {
|
|
|
396
394
|
return otlpReceiver;
|
|
397
395
|
}
|
|
398
396
|
async function startOTLPReceiver(port, host) {
|
|
399
|
-
|
|
397
|
+
logger.debug("[OtlpReceiver] Starting receiver through startOTLPReceiver function");
|
|
400
398
|
await getOTLPReceiver().listen(port, host);
|
|
401
399
|
}
|
|
402
400
|
async function stopOTLPReceiver() {
|
|
403
|
-
|
|
401
|
+
logger.debug("[OtlpReceiver] Stopping receiver through stopOTLPReceiver function");
|
|
404
402
|
if (otlpReceiver) {
|
|
405
403
|
await otlpReceiver.stop();
|
|
406
404
|
otlpReceiver = null;
|
|
407
405
|
}
|
|
408
406
|
}
|
|
409
|
-
|
|
410
407
|
//#endregion
|
|
411
408
|
export { startOTLPReceiver, stopOTLPReceiver };
|
|
412
|
-
|
|
409
|
+
|
|
410
|
+
//# sourceMappingURL=otlpReceiver-Bn5wGB1v.js.map
|