@rulemetric/cli 0.7.3 → 0.7.5
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 +10 -8
- package/dist/base-command.js +1 -14
- package/dist/chunk-2JRDG4LJ.js +31 -0
- package/dist/chunk-2TC6WCUT.js +34 -0
- package/dist/chunk-2WLVDSAP.js +2 -0
- package/dist/chunk-32EEBARV.js +1 -0
- package/dist/chunk-3AV3GTMP.js +1 -0
- package/dist/chunk-43YBXX7R.js +1 -0
- package/dist/chunk-4Z5ECCJE.js +1 -0
- package/dist/chunk-5RBLIVBF.js +1 -0
- package/dist/chunk-67QCYUJU.js +1 -0
- package/dist/chunk-6QKI756T.js +2 -0
- package/dist/chunk-6V4WM73L.js +1 -0
- package/dist/chunk-6XEC6474.js +1 -0
- package/dist/chunk-7DFNBRLY.js +61 -0
- package/dist/chunk-ARNZQBMX.js +1 -0
- package/dist/chunk-AYUJY37O.js +5 -0
- package/dist/chunk-CADKBP3D.js +58 -0
- package/dist/chunk-CDI5CCHU.js +1 -0
- package/dist/chunk-CNQ5DTNC.js +1 -0
- package/dist/chunk-DCLWFGEA.js +1 -0
- package/dist/chunk-DNF4HDI6.js +14 -0
- package/dist/chunk-DPFNJZUO.js +1 -0
- package/dist/chunk-DSO2U4Y6.js +56 -0
- package/dist/chunk-DVN7GFJG.js +1 -0
- package/dist/chunk-G63KMH6U.js +1 -0
- package/dist/chunk-G6XGDHGC.js +2 -0
- package/dist/chunk-GBMF3TP6.js +1 -0
- package/dist/chunk-GY5IJ4RS.js +1 -0
- package/dist/chunk-H2ORWIEY.js +1 -0
- package/dist/chunk-H4SV7FN4.js +1 -0
- package/dist/chunk-HS7X43XE.js +24 -0
- package/dist/{chunk-OQBBVTDG.js → chunk-I2DZGJRR.js} +6 -71
- package/dist/chunk-IZTIYR5Q.js +2 -0
- package/dist/chunk-JAPCCEKF.js +3 -0
- package/dist/chunk-JQTGQXUX.js +1 -0
- package/dist/chunk-KAF3CYRW.js +9 -0
- package/dist/chunk-KKDHD4XA.js +2 -0
- package/dist/chunk-KV325CXF.js +33 -0
- package/dist/chunk-MGHFDHHM.js +1 -0
- package/dist/chunk-MODXEGCU.js +1 -0
- package/dist/chunk-MVM6OGAF.js +4 -0
- package/dist/chunk-N7ODX6PO.js +1 -0
- package/dist/chunk-N7TGRFVZ.js +70 -0
- package/dist/chunk-NBTC5FNV.js +1 -0
- package/dist/chunk-NEACEHQD.js +1 -0
- package/dist/chunk-NJ5UED3H.js +1 -0
- package/dist/chunk-NVKX36YN.js +3 -0
- package/dist/chunk-O2SDD2WW.js +1 -0
- package/dist/chunk-O6C2UGBY.js +7 -0
- package/dist/chunk-OMXUK4M6.js +1 -0
- package/dist/chunk-PPKPCXJD.js +4 -0
- package/dist/{chunk-XZXS2W24.js → chunk-QFVGUZDO.js} +11 -57
- package/dist/chunk-RDET7CKR.js +1 -0
- package/dist/chunk-RQ424GI6.js +5 -0
- package/dist/chunk-RSKQRVPJ.js +1 -0
- package/dist/chunk-RTWRHIKY.js +7 -0
- package/dist/chunk-SZ62CP55.js +1 -0
- package/dist/chunk-TDD7IOV2.js +1 -0
- package/dist/chunk-TIOKY2IA.js +1 -0
- package/dist/chunk-TQMG647B.js +15 -0
- package/dist/chunk-TU2AR6XO.js +1 -0
- package/dist/chunk-U6ABMRT3.js +9 -0
- package/dist/chunk-U6XEU573.js +1 -0
- package/dist/chunk-UF6US7VU.js +1 -0
- package/dist/chunk-V44SRRYR.js +1 -0
- package/dist/chunk-V5U3E4BZ.js +1 -0
- package/dist/chunk-VAXRCSSH.js +2 -0
- package/dist/chunk-VLOX6KOM.js +1 -0
- package/dist/chunk-VUGRXM7R.js +1 -0
- package/dist/chunk-W2MOTOQE.js +1 -0
- package/dist/chunk-W2MV25SB.js +1 -0
- package/dist/chunk-WLVQJH4E.js +1 -0
- package/dist/chunk-WSCK4WNK.js +1 -0
- package/dist/chunk-XICLXXRH.js +1 -0
- package/dist/chunk-XXDZJ6YI.js +1 -0
- package/dist/chunk-ZL4MZMUK.js +34 -0
- package/dist/chunk-ZLLER3HP.js +1 -0
- package/dist/chunk-ZR3MUNLS.js +1 -0
- package/dist/chunk-ZXF5NE54.js +1 -0
- package/dist/commands/antigravity/backfill.js +2 -136
- package/dist/commands/auth/create-key.js +1 -52
- package/dist/commands/auth/login.js +1 -85
- package/dist/commands/auth/logout.js +1 -29
- package/dist/commands/auth/revoke-key.js +4 -33
- package/dist/commands/auth/signup.js +1 -89
- package/dist/commands/auth/status.js +1 -42
- package/dist/commands/catalog/index.js +2 -52
- package/dist/commands/catalog/recommend.js +3 -43
- package/dist/commands/convert.js +1 -75
- package/dist/commands/converters.js +1 -54
- package/dist/commands/crons/list.js +1 -41
- package/dist/commands/crons/run.js +2 -76
- package/dist/commands/dashboard.js +1 -46
- package/dist/commands/diagnostics.js +1 -117
- package/dist/commands/eval-targets/create.js +1 -53
- package/dist/commands/eval-targets/list.js +1 -54
- package/dist/commands/evals/agent.js +3 -310
- package/dist/commands/evals/benchmark.js +6 -73
- package/dist/commands/evals/compare.js +13 -96
- package/dist/commands/evals/create.js +1 -67
- package/dist/commands/evals/optimize-description.js +25 -239
- package/dist/commands/evals/optimize.js +5 -211
- package/dist/commands/evals/run.js +3 -183
- package/dist/commands/gateway/ensure.js +1 -104
- package/dist/commands/hooks/emit-instructions.js +1 -25
- package/dist/commands/hooks/install.js +1 -442
- package/dist/commands/hooks/run.js +3 -81
- package/dist/commands/hooks/uninstall.js +2 -156
- package/dist/commands/import.js +1 -66
- package/dist/commands/instructions/create.js +1 -74
- package/dist/commands/instructions/delete.js +1 -55
- package/dist/commands/instructions/fork.js +1 -34
- package/dist/commands/instructions/get.js +1 -68
- package/dist/commands/instructions/list.js +1 -65
- package/dist/commands/instructions/promote.js +1 -42
- package/dist/commands/instructions/pull.js +1 -39
- package/dist/commands/instructions/upstream.js +1 -38
- package/dist/commands/instructions/versions.js +1 -53
- package/dist/commands/launcher.js +1 -40
- package/dist/commands/org/current.js +1 -77
- package/dist/commands/org/list.js +1 -52
- package/dist/commands/org/switch.js +1 -71
- package/dist/commands/packs/add-instruction.js +1 -37
- package/dist/commands/packs/apply.js +1 -39
- package/dist/commands/packs/create.js +1 -50
- package/dist/commands/packs/fork.js +1 -34
- package/dist/commands/packs/get.js +3 -56
- package/dist/commands/packs/list.js +1 -66
- package/dist/commands/packs/remove-instruction.js +1 -35
- package/dist/commands/proxy/env.js +3 -131
- package/dist/commands/proxy/logs.js +3 -85
- package/dist/commands/proxy/restart.js +1 -35
- package/dist/commands/proxy/setup.js +17 -454
- package/dist/commands/proxy/start.js +10 -333
- package/dist/commands/proxy/status.js +1 -78
- package/dist/commands/proxy/stop.js +1 -94
- package/dist/commands/research/backfill.js +1 -59
- package/dist/commands/research/tail-transcript.js +1 -70
- package/dist/commands/service/install.js +57 -796
- package/dist/commands/service/status.js +1 -180
- package/dist/commands/service/uninstall.js +1 -119
- package/dist/commands/sessions/analyze.js +1 -48
- package/dist/commands/sessions/end.js +2 -85
- package/dist/commands/sessions/import.js +1 -46
- package/dist/commands/sessions/list.js +1 -48
- package/dist/commands/sessions/start.js +3 -90
- package/dist/commands/setup.js +3 -150
- package/dist/commands/skills/export-approved.js +1 -46
- package/dist/commands/skills/install.js +4 -107
- package/dist/commands/skills/list.js +4 -65
- package/dist/commands/skills/publish.js +2 -98
- package/dist/commands/skills/search.js +3 -72
- package/dist/commands/skills/update.js +3 -55
- package/dist/commands/suggestions/accept.js +8 -84
- package/dist/commands/suggestions/dismiss.js +1 -45
- package/dist/commands/suggestions/list.js +2 -61
- package/dist/commands/suggestions/refresh.js +1 -27
- package/dist/cursor-T7AMCMKS.js +13 -0
- package/dist/dashboard/Dashboard.js +1 -243
- package/dist/dashboard/data.js +1 -15
- package/dist/dashboard/launcher/ActiveJobsList.js +1 -10
- package/dist/dashboard/launcher/LauncherOverlay.js +1 -16
- package/dist/dashboard/launcher/NewLaunchForm.js +1 -10
- package/dist/dashboard/launcher/api.js +1 -16
- package/dist/dashboard/launcher/tool-labels.js +1 -10
- package/dist/dashboard/launcher/types.js +0 -1
- package/dist/dashboard/launcher/useLaunchJobs.js +1 -11
- package/dist/dashboard/panels/friction.js +1 -10
- package/dist/dashboard/panels/insights.js +1 -10
- package/dist/dashboard/panels/instructions.js +1 -10
- package/dist/dashboard/panels/outcomes.js +1 -10
- package/dist/dashboard/panels/overview.js +1 -10
- package/dist/dashboard/panels/shared.js +1 -19
- package/dist/dashboard/types.js +1 -24
- package/dist/dist-FAVALJ5C.js +1 -0
- package/dist/index.js +1 -8
- package/dist/lib/active-org-refresh.js +1 -15
- package/dist/lib/active-org.js +1 -16
- package/dist/lib/agent-loop.js +1 -47
- package/dist/lib/antigravity-transcript.js +1 -22
- package/dist/lib/api-client.js +1 -23
- package/dist/lib/auth.js +1 -30
- package/dist/lib/capture-hosts.js +1 -8
- package/dist/lib/detect-languages.js +1 -8
- package/dist/lib/detect-tmux.js +1 -9
- package/dist/lib/diagnostics.js +1 -12
- package/dist/lib/editor-proxy-pins.js +1 -14
- package/dist/lib/ensure-api-key.js +1 -11
- package/dist/lib/ensure-fresh-token.js +1 -0
- package/dist/lib/eval-analyzer.js +1 -9
- package/dist/lib/eval-benchmark.js +1 -12
- package/dist/lib/eval-conversation-handler.js +1 -13
- package/dist/lib/eval-executor.js +1 -8
- package/dist/lib/eval-grader.js +1 -9
- package/dist/lib/eval-meta-judge.js +1 -9
- package/dist/lib/eval-trigger-tester.js +1 -11
- package/dist/lib/eval-worktree.js +1 -8
- package/dist/lib/gateway-entry.js +1 -61
- package/dist/lib/gateway-identity.js +1 -16
- package/dist/lib/gateway-lifecycle.js +1 -32
- package/dist/lib/gateway.js +1 -14
- package/dist/lib/handlers/cron-refresh-pricing.js +1 -0
- package/dist/lib/handlers/cron-refresh-skills.js +1 -8
- package/dist/lib/handlers/cron-suggest-instructions.js +1 -16
- package/dist/lib/handlers/process-announcement.js +1 -11
- package/dist/lib/handlers/process-changelog.js +1 -11
- package/dist/lib/handlers/process-conversation.js +1 -14
- package/dist/lib/handlers/process-eval.js +1 -15
- package/dist/lib/handlers/process-insights.js +1 -15
- package/dist/lib/handlers/process-launch.js +1 -16
- package/dist/lib/handlers/process-run-cleanup.js +1 -13
- package/dist/lib/handlers/process-send-message.js +1 -10
- package/dist/lib/handlers/process-session-goal.js +1 -12
- package/dist/lib/hooks-config.js +1 -81
- package/dist/lib/insights-prompts.js +1 -12
- package/dist/lib/instruction-snapshot.js +1 -8
- package/dist/lib/job-helpers.js +0 -1
- package/dist/lib/llm-client.js +1 -20
- package/dist/lib/manual-tasks-meta.js +1 -8
- package/dist/lib/manual-tasks.js +1 -80
- package/dist/lib/output.js +1 -12
- package/dist/lib/permanent-job-error.js +1 -10
- package/dist/lib/pid-identity.js +1 -14
- package/dist/lib/proxy-respawn.js +1 -12
- package/dist/lib/research-client.js +1 -12
- package/dist/lib/setup-steps.js +1 -33
- package/dist/lib/skills-loader.js +1 -8
- package/dist/lib/statusline-shim.js +1 -20
- package/dist/lib/telemetry.js +1 -16
- package/dist/lib/terminal-target-heartbeat.js +1 -15
- package/dist/lib/tmux.js +1 -16
- package/dist/lib/transcript-rate-limit-watcher.js +1 -22
- package/dist/lib/types.js +1 -8
- package/dist/lib/version-check.js +1 -12
- package/dist/lib/which.js +1 -8
- package/dist/lib/worktree.js +1 -17
- package/dist/opencode-QRJ3BH23.js +1 -0
- package/oclif.manifest.json +12 -34
- package/package.json +9 -8
- package/dist/base-command.js.map +0 -7
- package/dist/chunk-2HK7RGZB.js +0 -82
- package/dist/chunk-2HK7RGZB.js.map +0 -7
- package/dist/chunk-2ORJWTNZ.js +0 -307
- package/dist/chunk-2ORJWTNZ.js.map +0 -7
- package/dist/chunk-37LN5O7M.js +0 -59
- package/dist/chunk-37LN5O7M.js.map +0 -7
- package/dist/chunk-3S7223UR.js +0 -81
- package/dist/chunk-3S7223UR.js.map +0 -7
- package/dist/chunk-3TIMQ3O6.js +0 -96
- package/dist/chunk-3TIMQ3O6.js.map +0 -7
- package/dist/chunk-42GFSAJP.js +0 -32
- package/dist/chunk-42GFSAJP.js.map +0 -7
- package/dist/chunk-4BHDHHKL.js +0 -48
- package/dist/chunk-4BHDHHKL.js.map +0 -7
- package/dist/chunk-4D537GXE.js +0 -99
- package/dist/chunk-4D537GXE.js.map +0 -7
- package/dist/chunk-4LYCDS2N.js +0 -139
- package/dist/chunk-4LYCDS2N.js.map +0 -7
- package/dist/chunk-4SCZK7AL.js +0 -129
- package/dist/chunk-4SCZK7AL.js.map +0 -7
- package/dist/chunk-4XAWK6S2.js +0 -161
- package/dist/chunk-4XAWK6S2.js.map +0 -7
- package/dist/chunk-52WIYRZH.js +0 -73
- package/dist/chunk-52WIYRZH.js.map +0 -7
- package/dist/chunk-5BAOGNUH.js +0 -79
- package/dist/chunk-5BAOGNUH.js.map +0 -7
- package/dist/chunk-5EDMGK3W.js +0 -39
- package/dist/chunk-5EDMGK3W.js.map +0 -7
- package/dist/chunk-6NBS5XFS.js +0 -99
- package/dist/chunk-6NBS5XFS.js.map +0 -7
- package/dist/chunk-7LVVKQMZ.js +0 -98
- package/dist/chunk-7LVVKQMZ.js.map +0 -7
- package/dist/chunk-7NNFYWKK.js +0 -243
- package/dist/chunk-7NNFYWKK.js.map +0 -7
- package/dist/chunk-7NYKWN7U.js +0 -12
- package/dist/chunk-7NYKWN7U.js.map +0 -7
- package/dist/chunk-BO76WKJR.js +0 -42
- package/dist/chunk-BO76WKJR.js.map +0 -7
- package/dist/chunk-BRD5RUGM.js +0 -53
- package/dist/chunk-BRD5RUGM.js.map +0 -7
- package/dist/chunk-BT6Z6545.js +0 -43
- package/dist/chunk-BT6Z6545.js.map +0 -7
- package/dist/chunk-BZDKEQKU.js +0 -39
- package/dist/chunk-BZDKEQKU.js.map +0 -7
- package/dist/chunk-DGHWRQXL.js +0 -17
- package/dist/chunk-DGHWRQXL.js.map +0 -7
- package/dist/chunk-DIQUV5FR.js +0 -257
- package/dist/chunk-DIQUV5FR.js.map +0 -7
- package/dist/chunk-DMX5YOTM.js +0 -167
- package/dist/chunk-DMX5YOTM.js.map +0 -7
- package/dist/chunk-DNKSVWMD.js +0 -108
- package/dist/chunk-DNKSVWMD.js.map +0 -7
- package/dist/chunk-DQ3KELXD.js +0 -74
- package/dist/chunk-DQ3KELXD.js.map +0 -7
- package/dist/chunk-DUJSRBLP.js +0 -122
- package/dist/chunk-DUJSRBLP.js.map +0 -7
- package/dist/chunk-E3BIT53W.js +0 -154
- package/dist/chunk-E3BIT53W.js.map +0 -7
- package/dist/chunk-EARWG4EV.js +0 -22
- package/dist/chunk-EARWG4EV.js.map +0 -7
- package/dist/chunk-EI5BHWXA.js +0 -1662
- package/dist/chunk-EI5BHWXA.js.map +0 -7
- package/dist/chunk-EJ3YAFDP.js +0 -37
- package/dist/chunk-EJ3YAFDP.js.map +0 -7
- package/dist/chunk-EKJ2CABV.js +0 -76
- package/dist/chunk-EKJ2CABV.js.map +0 -7
- package/dist/chunk-EKP32DLN.js +0 -16
- package/dist/chunk-EKP32DLN.js.map +0 -7
- package/dist/chunk-EYPAAGN5.js +0 -51
- package/dist/chunk-EYPAAGN5.js.map +0 -7
- package/dist/chunk-F5N6CLJJ.js +0 -1995
- package/dist/chunk-F5N6CLJJ.js.map +0 -7
- package/dist/chunk-GIUBARWS.js +0 -99
- package/dist/chunk-GIUBARWS.js.map +0 -7
- package/dist/chunk-GQNJO2P2.js +0 -102
- package/dist/chunk-GQNJO2P2.js.map +0 -7
- package/dist/chunk-IJGF2ETG.js +0 -68
- package/dist/chunk-IJGF2ETG.js.map +0 -7
- package/dist/chunk-ILYDELUE.js +0 -46
- package/dist/chunk-ILYDELUE.js.map +0 -7
- package/dist/chunk-J6QFW4LD.js +0 -55
- package/dist/chunk-J6QFW4LD.js.map +0 -7
- package/dist/chunk-J7N3DLH6.js +0 -117
- package/dist/chunk-J7N3DLH6.js.map +0 -7
- package/dist/chunk-JFDWKLQC.js +0 -23
- package/dist/chunk-JFDWKLQC.js.map +0 -7
- package/dist/chunk-JULOLTZS.js +0 -61
- package/dist/chunk-JULOLTZS.js.map +0 -7
- package/dist/chunk-KJKBDQ4D.js +0 -220
- package/dist/chunk-KJKBDQ4D.js.map +0 -7
- package/dist/chunk-KRBQLMOP.js +0 -41
- package/dist/chunk-KRBQLMOP.js.map +0 -7
- package/dist/chunk-LXKPNATC.js +0 -624
- package/dist/chunk-LXKPNATC.js.map +0 -7
- package/dist/chunk-NSBPE2FW.js +0 -17
- package/dist/chunk-NSBPE2FW.js.map +0 -7
- package/dist/chunk-OCKHW72U.js +0 -55
- package/dist/chunk-OCKHW72U.js.map +0 -7
- package/dist/chunk-OKWCKCPE.js +0 -414
- package/dist/chunk-OKWCKCPE.js.map +0 -7
- package/dist/chunk-OO7JDFS4.js +0 -157
- package/dist/chunk-OO7JDFS4.js.map +0 -7
- package/dist/chunk-OQBBVTDG.js.map +0 -7
- package/dist/chunk-OQSQC7VB.js +0 -77
- package/dist/chunk-OQSQC7VB.js.map +0 -7
- package/dist/chunk-PED7L5GX.js +0 -92
- package/dist/chunk-PED7L5GX.js.map +0 -7
- package/dist/chunk-QJQS6TUN.js +0 -44
- package/dist/chunk-QJQS6TUN.js.map +0 -7
- package/dist/chunk-QN34TGD3.js +0 -83
- package/dist/chunk-QN34TGD3.js.map +0 -7
- package/dist/chunk-QSN77T7C.js +0 -250
- package/dist/chunk-QSN77T7C.js.map +0 -7
- package/dist/chunk-R56PH7YE.js +0 -78
- package/dist/chunk-R56PH7YE.js.map +0 -7
- package/dist/chunk-RAXRZYOB.js +0 -299
- package/dist/chunk-RAXRZYOB.js.map +0 -7
- package/dist/chunk-RH7NHVSK.js +0 -16
- package/dist/chunk-RH7NHVSK.js.map +0 -7
- package/dist/chunk-RMTT4KDY.js +0 -191
- package/dist/chunk-RMTT4KDY.js.map +0 -7
- package/dist/chunk-RQ2TMLKG.js +0 -142
- package/dist/chunk-RQ2TMLKG.js.map +0 -7
- package/dist/chunk-SO3T35U7.js +0 -80
- package/dist/chunk-SO3T35U7.js.map +0 -7
- package/dist/chunk-UKMLICWS.js +0 -51
- package/dist/chunk-UKMLICWS.js.map +0 -7
- package/dist/chunk-VA5FFOS7.js +0 -243
- package/dist/chunk-VA5FFOS7.js.map +0 -7
- package/dist/chunk-W2YERO7E.js +0 -170
- package/dist/chunk-W2YERO7E.js.map +0 -7
- package/dist/chunk-W53GKIZQ.js +0 -50
- package/dist/chunk-W53GKIZQ.js.map +0 -7
- package/dist/chunk-WA4MWYRW.js +0 -254
- package/dist/chunk-WA4MWYRW.js.map +0 -7
- package/dist/chunk-XC6M4CSW.js +0 -44
- package/dist/chunk-XC6M4CSW.js.map +0 -7
- package/dist/chunk-XK42ZBDE.js +0 -23
- package/dist/chunk-XK42ZBDE.js.map +0 -7
- package/dist/chunk-XUV6DDBF.js +0 -124
- package/dist/chunk-XUV6DDBF.js.map +0 -7
- package/dist/chunk-XZXS2W24.js.map +0 -7
- package/dist/chunk-Y3WD5CSW.js +0 -49
- package/dist/chunk-Y3WD5CSW.js.map +0 -7
- package/dist/chunk-Y4BJXXYV.js +0 -148
- package/dist/chunk-Y4BJXXYV.js.map +0 -7
- package/dist/chunk-YNIH3KMU.js +0 -121
- package/dist/chunk-YNIH3KMU.js.map +0 -7
- package/dist/chunk-ZUJBM6HE.js +0 -125
- package/dist/chunk-ZUJBM6HE.js.map +0 -7
- package/dist/commands/antigravity/backfill.js.map +0 -7
- package/dist/commands/auth/create-key.js.map +0 -7
- package/dist/commands/auth/login.js.map +0 -7
- package/dist/commands/auth/logout.js.map +0 -7
- package/dist/commands/auth/revoke-key.js.map +0 -7
- package/dist/commands/auth/signup.js.map +0 -7
- package/dist/commands/auth/status.js.map +0 -7
- package/dist/commands/catalog/index.js.map +0 -7
- package/dist/commands/catalog/recommend.js.map +0 -7
- package/dist/commands/convert.js.map +0 -7
- package/dist/commands/converters.js.map +0 -7
- package/dist/commands/crons/list.js.map +0 -7
- package/dist/commands/crons/run.js.map +0 -7
- package/dist/commands/dashboard.js.map +0 -7
- package/dist/commands/diagnostics.js.map +0 -7
- package/dist/commands/eval-targets/create.js.map +0 -7
- package/dist/commands/eval-targets/list.js.map +0 -7
- package/dist/commands/evals/agent.js.map +0 -7
- package/dist/commands/evals/benchmark.js.map +0 -7
- package/dist/commands/evals/compare.js.map +0 -7
- package/dist/commands/evals/create.js.map +0 -7
- package/dist/commands/evals/optimize-description.js.map +0 -7
- package/dist/commands/evals/optimize.js.map +0 -7
- package/dist/commands/evals/run.js.map +0 -7
- package/dist/commands/gateway/ensure.js.map +0 -7
- package/dist/commands/hooks/emit-instructions.js.map +0 -7
- package/dist/commands/hooks/install.js.map +0 -7
- package/dist/commands/hooks/run.js.map +0 -7
- package/dist/commands/hooks/uninstall.js.map +0 -7
- package/dist/commands/import.js.map +0 -7
- package/dist/commands/instructions/create.js.map +0 -7
- package/dist/commands/instructions/delete.js.map +0 -7
- package/dist/commands/instructions/fork.js.map +0 -7
- package/dist/commands/instructions/get.js.map +0 -7
- package/dist/commands/instructions/list.js.map +0 -7
- package/dist/commands/instructions/promote.js.map +0 -7
- package/dist/commands/instructions/pull.js.map +0 -7
- package/dist/commands/instructions/upstream.js.map +0 -7
- package/dist/commands/instructions/versions.js.map +0 -7
- package/dist/commands/launcher.js.map +0 -7
- package/dist/commands/org/current.js.map +0 -7
- package/dist/commands/org/list.js.map +0 -7
- package/dist/commands/org/switch.js.map +0 -7
- package/dist/commands/packs/add-instruction.js.map +0 -7
- package/dist/commands/packs/apply.js.map +0 -7
- package/dist/commands/packs/create.js.map +0 -7
- package/dist/commands/packs/fork.js.map +0 -7
- package/dist/commands/packs/get.js.map +0 -7
- package/dist/commands/packs/list.js.map +0 -7
- package/dist/commands/packs/remove-instruction.js.map +0 -7
- package/dist/commands/proxy/env.js.map +0 -7
- package/dist/commands/proxy/logs.js.map +0 -7
- package/dist/commands/proxy/restart.js.map +0 -7
- package/dist/commands/proxy/setup.js.map +0 -7
- package/dist/commands/proxy/start.js.map +0 -7
- package/dist/commands/proxy/status.js.map +0 -7
- package/dist/commands/proxy/stop.js.map +0 -7
- package/dist/commands/research/backfill.js.map +0 -7
- package/dist/commands/research/tail-transcript.js.map +0 -7
- package/dist/commands/service/install.js.map +0 -7
- package/dist/commands/service/status.js.map +0 -7
- package/dist/commands/service/uninstall.js.map +0 -7
- package/dist/commands/sessions/analyze.js.map +0 -7
- package/dist/commands/sessions/end.js.map +0 -7
- package/dist/commands/sessions/import.js.map +0 -7
- package/dist/commands/sessions/list.js.map +0 -7
- package/dist/commands/sessions/start.js.map +0 -7
- package/dist/commands/setup.js.map +0 -7
- package/dist/commands/skills/export-approved.js.map +0 -7
- package/dist/commands/skills/install.js.map +0 -7
- package/dist/commands/skills/list.js.map +0 -7
- package/dist/commands/skills/publish.js.map +0 -7
- package/dist/commands/skills/search.js.map +0 -7
- package/dist/commands/skills/update.js.map +0 -7
- package/dist/commands/suggestions/accept.js.map +0 -7
- package/dist/commands/suggestions/dismiss.js.map +0 -7
- package/dist/commands/suggestions/list.js.map +0 -7
- package/dist/commands/suggestions/refresh.js.map +0 -7
- package/dist/cursor-BGQJ4CWI.js +0 -134
- package/dist/cursor-BGQJ4CWI.js.map +0 -7
- package/dist/dashboard/Dashboard.js.map +0 -7
- package/dist/dashboard/data.js.map +0 -7
- package/dist/dashboard/launcher/ActiveJobsList.js.map +0 -7
- package/dist/dashboard/launcher/LauncherOverlay.js.map +0 -7
- package/dist/dashboard/launcher/NewLaunchForm.js.map +0 -7
- package/dist/dashboard/launcher/api.js.map +0 -7
- package/dist/dashboard/launcher/tool-labels.js.map +0 -7
- package/dist/dashboard/launcher/types.js.map +0 -7
- package/dist/dashboard/launcher/useLaunchJobs.js.map +0 -7
- package/dist/dashboard/panels/friction.js.map +0 -7
- package/dist/dashboard/panels/insights.js.map +0 -7
- package/dist/dashboard/panels/instructions.js.map +0 -7
- package/dist/dashboard/panels/outcomes.js.map +0 -7
- package/dist/dashboard/panels/overview.js.map +0 -7
- package/dist/dashboard/panels/shared.js.map +0 -7
- package/dist/dashboard/types.js.map +0 -7
- package/dist/dist-UNYP5PJR.js +0 -56
- package/dist/dist-UNYP5PJR.js.map +0 -7
- package/dist/index.js.map +0 -7
- package/dist/lib/active-org-refresh.js.map +0 -7
- package/dist/lib/active-org.js.map +0 -7
- package/dist/lib/agent-loop.js.map +0 -7
- package/dist/lib/antigravity-transcript.js.map +0 -7
- package/dist/lib/api-client.js.map +0 -7
- package/dist/lib/auth.js.map +0 -7
- package/dist/lib/capture-hosts.js.map +0 -7
- package/dist/lib/detect-languages.js.map +0 -7
- package/dist/lib/detect-tmux.js.map +0 -7
- package/dist/lib/diagnostics.js.map +0 -7
- package/dist/lib/editor-proxy-pins.js.map +0 -7
- package/dist/lib/ensure-api-key.js.map +0 -7
- package/dist/lib/eval-analyzer.js.map +0 -7
- package/dist/lib/eval-benchmark.js.map +0 -7
- package/dist/lib/eval-conversation-handler.js.map +0 -7
- package/dist/lib/eval-executor.js.map +0 -7
- package/dist/lib/eval-grader.js.map +0 -7
- package/dist/lib/eval-meta-judge.js.map +0 -7
- package/dist/lib/eval-trigger-tester.js.map +0 -7
- package/dist/lib/eval-worktree.js.map +0 -7
- package/dist/lib/gateway-entry.js.map +0 -7
- package/dist/lib/gateway-identity.js.map +0 -7
- package/dist/lib/gateway-lifecycle.js.map +0 -7
- package/dist/lib/gateway.js.map +0 -7
- package/dist/lib/handlers/cron-refresh-skills.js.map +0 -7
- package/dist/lib/handlers/cron-suggest-instructions.js.map +0 -7
- package/dist/lib/handlers/process-announcement.js.map +0 -7
- package/dist/lib/handlers/process-changelog.js.map +0 -7
- package/dist/lib/handlers/process-conversation.js.map +0 -7
- package/dist/lib/handlers/process-eval.js.map +0 -7
- package/dist/lib/handlers/process-insights.js.map +0 -7
- package/dist/lib/handlers/process-launch.js.map +0 -7
- package/dist/lib/handlers/process-run-cleanup.js.map +0 -7
- package/dist/lib/handlers/process-send-message.js.map +0 -7
- package/dist/lib/handlers/process-session-goal.js.map +0 -7
- package/dist/lib/hooks-config.js.map +0 -7
- package/dist/lib/insights-prompts.js.map +0 -7
- package/dist/lib/instruction-snapshot.js.map +0 -7
- package/dist/lib/job-helpers.js.map +0 -7
- package/dist/lib/llm-client.js.map +0 -7
- package/dist/lib/manual-tasks-meta.js.map +0 -7
- package/dist/lib/manual-tasks.js.map +0 -7
- package/dist/lib/output.js.map +0 -7
- package/dist/lib/permanent-job-error.js.map +0 -7
- package/dist/lib/pid-identity.js.map +0 -7
- package/dist/lib/proxy-respawn.js.map +0 -7
- package/dist/lib/research-client.js.map +0 -7
- package/dist/lib/setup-steps.js.map +0 -7
- package/dist/lib/skills-loader.js.map +0 -7
- package/dist/lib/statusline-shim.js.map +0 -7
- package/dist/lib/telemetry.js.map +0 -7
- package/dist/lib/terminal-target-heartbeat.js.map +0 -7
- package/dist/lib/tmux.js.map +0 -7
- package/dist/lib/transcript-rate-limit-watcher.js.map +0 -7
- package/dist/lib/types.js.map +0 -7
- package/dist/lib/version-check.js.map +0 -7
- package/dist/lib/which.js.map +0 -7
- package/dist/lib/worktree.js.map +0 -7
- package/dist/opencode-IQ7X5YMJ.js +0 -190
- package/dist/opencode-IQ7X5YMJ.js.map +0 -7
|
@@ -1,310 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
import "../../chunk-GIUBARWS.js";
|
|
5
|
-
import "../../chunk-6NBS5XFS.js";
|
|
6
|
-
import "../../chunk-W53GKIZQ.js";
|
|
7
|
-
import "../../chunk-OCKHW72U.js";
|
|
8
|
-
import "../../chunk-RQ2TMLKG.js";
|
|
9
|
-
import "../../chunk-DMX5YOTM.js";
|
|
10
|
-
import "../../chunk-OO7JDFS4.js";
|
|
11
|
-
import "../../chunk-E3BIT53W.js";
|
|
12
|
-
import "../../chunk-QSN77T7C.js";
|
|
13
|
-
import {
|
|
14
|
-
closeDb
|
|
15
|
-
} from "../../chunk-EI5BHWXA.js";
|
|
16
|
-
import "../../chunk-XK42ZBDE.js";
|
|
17
|
-
import "../../chunk-RMTT4KDY.js";
|
|
18
|
-
import "../../chunk-VA5FFOS7.js";
|
|
19
|
-
import "../../chunk-XZXS2W24.js";
|
|
20
|
-
import "../../chunk-DIQUV5FR.js";
|
|
21
|
-
import "../../chunk-JULOLTZS.js";
|
|
22
|
-
import "../../chunk-Y4BJXXYV.js";
|
|
23
|
-
import "../../chunk-DGHWRQXL.js";
|
|
24
|
-
import "../../chunk-J7N3DLH6.js";
|
|
25
|
-
import "../../chunk-52WIYRZH.js";
|
|
26
|
-
import "../../chunk-KJKBDQ4D.js";
|
|
27
|
-
import "../../chunk-OQSQC7VB.js";
|
|
28
|
-
import "../../chunk-EKP32DLN.js";
|
|
29
|
-
import "../../chunk-F5N6CLJJ.js";
|
|
30
|
-
import "../../chunk-KRBQLMOP.js";
|
|
31
|
-
import "../../chunk-42GFSAJP.js";
|
|
32
|
-
import "../../chunk-3TIMQ3O6.js";
|
|
33
|
-
import "../../chunk-YNIH3KMU.js";
|
|
34
|
-
import "../../chunk-QN34TGD3.js";
|
|
35
|
-
import {
|
|
36
|
-
BaseCommand
|
|
37
|
-
} from "../../chunk-2HK7RGZB.js";
|
|
38
|
-
import "../../chunk-R56PH7YE.js";
|
|
39
|
-
import "../../chunk-GQNJO2P2.js";
|
|
40
|
-
import "../../chunk-37LN5O7M.js";
|
|
41
|
-
import "../../chunk-EKJ2CABV.js";
|
|
42
|
-
import "../../chunk-ZUJBM6HE.js";
|
|
43
|
-
import {
|
|
44
|
-
getDefaultConfigDir,
|
|
45
|
-
loadToken
|
|
46
|
-
} from "../../chunk-W2YERO7E.js";
|
|
47
|
-
import "../../chunk-NSBPE2FW.js";
|
|
48
|
-
|
|
49
|
-
// ../../packages/telemetry/dist/init.js
|
|
50
|
-
import { trace, context } from "@opentelemetry/api";
|
|
51
|
-
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
52
|
-
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
53
|
-
import { BatchSpanProcessor, ConsoleSpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
|
|
54
|
-
import { Resource } from "@opentelemetry/resources";
|
|
55
|
-
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";
|
|
56
|
-
|
|
57
|
-
// ../../packages/telemetry/dist/otlp-headers.js
|
|
58
|
-
function parseOtlpHeaders(raw) {
|
|
59
|
-
if (!raw)
|
|
60
|
-
return {};
|
|
61
|
-
const out = {};
|
|
62
|
-
for (const entry of raw.split(",")) {
|
|
63
|
-
const eq = entry.indexOf("=");
|
|
64
|
-
if (eq === -1)
|
|
65
|
-
continue;
|
|
66
|
-
const key = entry.slice(0, eq).trim();
|
|
67
|
-
const value = entry.slice(eq + 1).trim();
|
|
68
|
-
if (!key)
|
|
69
|
-
continue;
|
|
70
|
-
out[key] = value;
|
|
71
|
-
}
|
|
72
|
-
return out;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// ../../packages/telemetry/dist/init.js
|
|
76
|
-
var sdk = null;
|
|
77
|
-
function isTelemetryEnabled() {
|
|
78
|
-
return process.env.TELEMETRY_ENABLED !== "false";
|
|
79
|
-
}
|
|
80
|
-
function initTelemetry(config) {
|
|
81
|
-
if (!isTelemetryEnabled()) {
|
|
82
|
-
return "off";
|
|
83
|
-
}
|
|
84
|
-
if (sdk !== null) {
|
|
85
|
-
return "off";
|
|
86
|
-
}
|
|
87
|
-
const resource = new Resource({
|
|
88
|
-
[ATTR_SERVICE_NAME]: config.serviceName,
|
|
89
|
-
[ATTR_SERVICE_VERSION]: config.serviceVersion ?? "0.1.0"
|
|
90
|
-
});
|
|
91
|
-
const endpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT;
|
|
92
|
-
let mode;
|
|
93
|
-
let spanProcessor;
|
|
94
|
-
if (endpoint) {
|
|
95
|
-
const headers = parseOtlpHeaders(process.env.OTEL_EXPORTER_OTLP_HEADERS);
|
|
96
|
-
const exporter = new OTLPTraceExporter({
|
|
97
|
-
url: `${endpoint}/v1/traces`,
|
|
98
|
-
headers
|
|
99
|
-
});
|
|
100
|
-
spanProcessor = new BatchSpanProcessor(exporter);
|
|
101
|
-
mode = "otlp";
|
|
102
|
-
} else if (process.env.OTEL_SPAN_EXPORT === "none") {
|
|
103
|
-
spanProcessor = void 0;
|
|
104
|
-
mode = "silent";
|
|
105
|
-
} else {
|
|
106
|
-
const exporter = new ConsoleSpanExporter();
|
|
107
|
-
spanProcessor = new SimpleSpanProcessor(exporter);
|
|
108
|
-
mode = "console";
|
|
109
|
-
}
|
|
110
|
-
sdk = new NodeSDK({
|
|
111
|
-
resource,
|
|
112
|
-
spanProcessors: spanProcessor ? [spanProcessor] : []
|
|
113
|
-
});
|
|
114
|
-
sdk.start();
|
|
115
|
-
return mode;
|
|
116
|
-
}
|
|
117
|
-
async function shutdownTelemetry() {
|
|
118
|
-
if (sdk) {
|
|
119
|
-
await sdk.shutdown();
|
|
120
|
-
sdk = null;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// ../../packages/telemetry/dist/hono-middleware.js
|
|
125
|
-
import { SpanKind, SpanStatusCode } from "@opentelemetry/api";
|
|
126
|
-
|
|
127
|
-
// ../../packages/telemetry/dist/span-attributes.js
|
|
128
|
-
import { trace as trace2, context as otelContext } from "@opentelemetry/api";
|
|
129
|
-
|
|
130
|
-
// ../../packages/telemetry/dist/sentry.js
|
|
131
|
-
import * as Sentry from "@sentry/node";
|
|
132
|
-
var enabled = false;
|
|
133
|
-
function initSentry(config) {
|
|
134
|
-
if (enabled)
|
|
135
|
-
return false;
|
|
136
|
-
const dsn = process.env.SENTRY_DSN;
|
|
137
|
-
if (!dsn)
|
|
138
|
-
return false;
|
|
139
|
-
Sentry.init({
|
|
140
|
-
dsn,
|
|
141
|
-
serverName: config.serviceName,
|
|
142
|
-
environment: process.env.NODE_ENV ?? "development",
|
|
143
|
-
// We rely on OpenTelemetry for tracing — Sentry stays errors-only here.
|
|
144
|
-
// Override at the env-var level if you ever want Sentry performance too:
|
|
145
|
-
// `SENTRY_TRACES_SAMPLE_RATE=0.05` (Sentry SDK reads it natively).
|
|
146
|
-
tracesSampleRate: 0
|
|
147
|
-
});
|
|
148
|
-
enabled = true;
|
|
149
|
-
return true;
|
|
150
|
-
}
|
|
151
|
-
async function flushSentry(timeoutMs) {
|
|
152
|
-
if (!enabled)
|
|
153
|
-
return;
|
|
154
|
-
await Sentry.flush(timeoutMs);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// src/commands/evals/agent.ts
|
|
158
|
-
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
159
|
-
import { dirname, join } from "node:path";
|
|
160
|
-
import { execFileSync } from "node:child_process";
|
|
161
|
-
var AGENT_LOCK_PATH = join(getDefaultConfigDir(), "evals-agent.lock");
|
|
162
|
-
function pidAlive(pid) {
|
|
163
|
-
try {
|
|
164
|
-
process.kill(pid, 0);
|
|
165
|
-
return true;
|
|
166
|
-
} catch (e) {
|
|
167
|
-
return e.code === "EPERM";
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
function isLiveAgent(pid) {
|
|
171
|
-
if (!pidAlive(pid)) return false;
|
|
172
|
-
try {
|
|
173
|
-
const cmd = execFileSync("ps", ["-p", String(pid), "-o", "command="], {
|
|
174
|
-
encoding: "utf-8",
|
|
175
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
176
|
-
});
|
|
177
|
-
return /run\.js\s+evals\s+agent|evals\s+agent/.test(cmd);
|
|
178
|
-
} catch {
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function acquireAgentLock() {
|
|
183
|
-
try {
|
|
184
|
-
mkdirSync(dirname(AGENT_LOCK_PATH), { recursive: true });
|
|
185
|
-
} catch {
|
|
186
|
-
}
|
|
187
|
-
for (let attempt = 0; attempt < 2; attempt++) {
|
|
188
|
-
try {
|
|
189
|
-
writeFileSync(AGENT_LOCK_PATH, String(process.pid), { flag: "wx" });
|
|
190
|
-
return { ok: true };
|
|
191
|
-
} catch (e) {
|
|
192
|
-
if (e.code !== "EEXIST") throw e;
|
|
193
|
-
let holder = 0;
|
|
194
|
-
try {
|
|
195
|
-
holder = Number(readFileSync(AGENT_LOCK_PATH, "utf-8").trim());
|
|
196
|
-
} catch {
|
|
197
|
-
}
|
|
198
|
-
if (holder && holder !== process.pid && isLiveAgent(holder)) {
|
|
199
|
-
return { ok: false, holder };
|
|
200
|
-
}
|
|
201
|
-
try {
|
|
202
|
-
unlinkSync(AGENT_LOCK_PATH);
|
|
203
|
-
} catch {
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
try {
|
|
208
|
-
writeFileSync(AGENT_LOCK_PATH, String(process.pid));
|
|
209
|
-
} catch {
|
|
210
|
-
}
|
|
211
|
-
return { ok: true };
|
|
212
|
-
}
|
|
213
|
-
function releaseAgentLock() {
|
|
214
|
-
try {
|
|
215
|
-
if (existsSync(AGENT_LOCK_PATH) && Number(readFileSync(AGENT_LOCK_PATH, "utf-8").trim()) === process.pid) {
|
|
216
|
-
unlinkSync(AGENT_LOCK_PATH);
|
|
217
|
-
}
|
|
218
|
-
} catch {
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
var EvalAgentCommand = class _EvalAgentCommand extends BaseCommand {
|
|
222
|
-
static description = "The worker daemon: long-polls /api/work/next, claims jobs, and runs them locally. Installed as a launchd service by `rulemetric service install`.";
|
|
223
|
-
static examples = [
|
|
224
|
-
"<%= config.bin %> evals agent"
|
|
225
|
-
];
|
|
226
|
-
async run() {
|
|
227
|
-
await this.parse(_EvalAgentCommand);
|
|
228
|
-
this.requireAuth();
|
|
229
|
-
const lock = acquireAgentLock();
|
|
230
|
-
if (!lock.ok) {
|
|
231
|
-
this.log(
|
|
232
|
-
`Another rulemetric evals agent is already running (pid ${lock.holder}). Refusing to start a second instance.`
|
|
233
|
-
);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
process.env.PG_APPLICATION_NAME ||= "rulemetric-agent";
|
|
237
|
-
const sentryEnabled = initSentry({ serviceName: "rulemetric-agent" });
|
|
238
|
-
if (sentryEnabled) this.log("[sentry] error capture enabled");
|
|
239
|
-
const otelMode = initTelemetry({ serviceName: "rulemetric-agent" });
|
|
240
|
-
if (otelMode === "otlp") {
|
|
241
|
-
this.log(`[otel] traces exporting to ${process.env.OTEL_EXPORTER_OTLP_ENDPOINT}`);
|
|
242
|
-
} else if (otelMode === "console") {
|
|
243
|
-
this.log("[otel] cron spans printing to stdout (set OTEL_EXPORTER_OTLP_ENDPOINT to ship to a backend)");
|
|
244
|
-
} else {
|
|
245
|
-
this.log("[otel] disabled (TELEMETRY_ENABLED=false)");
|
|
246
|
-
}
|
|
247
|
-
const token = loadToken();
|
|
248
|
-
if (!token && !process.env.RULEMETRIC_API_KEY) {
|
|
249
|
-
this.error("No auth token found. Run `rulemetric auth login` first.");
|
|
250
|
-
}
|
|
251
|
-
this.log("Starting thin agent (Phase 4b parallel-run)...");
|
|
252
|
-
this.log("Long-polling /api/work/next. Press Ctrl+C to stop.\n");
|
|
253
|
-
const controller = new AbortController();
|
|
254
|
-
const shutdown = async (signal) => {
|
|
255
|
-
this.log(`
|
|
256
|
-
[${signal}] shutting down agent...`);
|
|
257
|
-
controller.abort();
|
|
258
|
-
await Promise.allSettled([
|
|
259
|
-
flushSentry(2e3),
|
|
260
|
-
shutdownTelemetry(),
|
|
261
|
-
// Drain the postgres-js pool so this agent's Supavisor client sessions
|
|
262
|
-
// are released (Terminate) instead of orphaned as ghosts on every
|
|
263
|
-
// launchd bounce. Pool-exhaustion RCA 2026-06-21.
|
|
264
|
-
closeDb()
|
|
265
|
-
]);
|
|
266
|
-
releaseAgentLock();
|
|
267
|
-
process.exit(0);
|
|
268
|
-
};
|
|
269
|
-
process.on("SIGINT", () => {
|
|
270
|
-
void shutdown("SIGINT");
|
|
271
|
-
});
|
|
272
|
-
process.on("SIGTERM", () => {
|
|
273
|
-
void shutdown("SIGTERM");
|
|
274
|
-
});
|
|
275
|
-
let restartForUpgrade = false;
|
|
276
|
-
try {
|
|
277
|
-
await runAgentLoop({
|
|
278
|
-
signal: controller.signal,
|
|
279
|
-
log: (msg) => this.log(msg),
|
|
280
|
-
version: this.config.version,
|
|
281
|
-
readInstalledVersion: () => {
|
|
282
|
-
try {
|
|
283
|
-
const pkg = JSON.parse(
|
|
284
|
-
readFileSync(join(this.config.root, "package.json"), "utf-8")
|
|
285
|
-
);
|
|
286
|
-
return pkg.version ?? null;
|
|
287
|
-
} catch {
|
|
288
|
-
return null;
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
onVersionDrift: () => {
|
|
292
|
-
restartForUpgrade = true;
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
if (restartForUpgrade) {
|
|
296
|
-
this.log("[upgrade] Installed CLI version changed \u2014 restarting worker onto the new code.");
|
|
297
|
-
await Promise.allSettled([flushSentry(2e3), shutdownTelemetry(), closeDb()]);
|
|
298
|
-
releaseAgentLock();
|
|
299
|
-
process.exit(1);
|
|
300
|
-
}
|
|
301
|
-
} finally {
|
|
302
|
-
releaseAgentLock();
|
|
303
|
-
await closeDb();
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
export {
|
|
308
|
-
EvalAgentCommand as default
|
|
309
|
-
};
|
|
310
|
-
//# sourceMappingURL=agent.js.map
|
|
1
|
+
import{e as N}from"../../chunk-43YBXX7R.js";import"../../chunk-TIOKY2IA.js";import"../../chunk-TQMG647B.js";import"../../chunk-W2MOTOQE.js";import"../../chunk-VAXRCSSH.js";import"../../chunk-6QKI756T.js";import"../../chunk-RSKQRVPJ.js";import"../../chunk-AYUJY37O.js";import"../../chunk-QFVGUZDO.js";import"../../chunk-KAF3CYRW.js";import"../../chunk-UF6US7VU.js";import"../../chunk-DPFNJZUO.js";import"../../chunk-RTWRHIKY.js";import"../../chunk-2WLVDSAP.js";import"../../chunk-ZL4MZMUK.js";import"../../chunk-N7TGRFVZ.js";import{i as f}from"../../chunk-H4SV7FN4.js";import"../../chunk-NEACEHQD.js";import"../../chunk-32EEBARV.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-2TC6WCUT.js";import"../../chunk-6V4WM73L.js";import"../../chunk-HS7X43XE.js";import"../../chunk-TDD7IOV2.js";import"../../chunk-MODXEGCU.js";import"../../chunk-7DFNBRLY.js";import"../../chunk-N7ODX6PO.js";import"../../chunk-67QCYUJU.js";import"../../chunk-DSO2U4Y6.js";import"../../chunk-CADKBP3D.js";import"../../chunk-MGHFDHHM.js";import{a as _}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-H2ORWIEY.js";import{e as R,l as w}from"../../chunk-O6C2UGBY.js";import{a as e}from"../../chunk-ZLLER3HP.js";import{trace as z,context as Q}from"@opentelemetry/api";import{NodeSDK as A}from"@opentelemetry/sdk-node";import{OTLPTraceExporter as I}from"@opentelemetry/exporter-trace-otlp-http";import{BatchSpanProcessor as L,ConsoleSpanExporter as C,SimpleSpanProcessor as D}from"@opentelemetry/sdk-trace-node";import{Resource as M}from"@opentelemetry/resources";import{ATTR_SERVICE_NAME as V,ATTR_SERVICE_VERSION as q}from"@opentelemetry/semantic-conventions";function b(t){if(!t)return{};let r={};for(let n of t.split(",")){let o=n.indexOf("=");if(o===-1)continue;let s=n.slice(0,o).trim(),i=n.slice(o+1).trim();s&&(r[s]=i)}return r}e(b,"parseOtlpHeaders");var c=null;function g(){return process.env.TELEMETRY_ENABLED!=="false"}e(g,"isTelemetryEnabled");function E(t){if(!g()||c!==null)return"off";let r=new M({[V]:t.serviceName,[q]:t.serviceVersion??"0.1.0"}),n=process.env.OTEL_EXPORTER_OTLP_ENDPOINT,o,s;if(n){let i=b(process.env.OTEL_EXPORTER_OTLP_HEADERS),u=new I({url:`${n}/v1/traces`,headers:i});s=new L(u),o="otlp"}else if(process.env.OTEL_SPAN_EXPORT==="none")s=void 0,o="silent";else{let i=new C;s=new D(i),o="console"}return c=new A({resource:r,spanProcessors:s?[s]:[]}),c.start(),o}e(E,"initTelemetry");async function d(){c&&(await c.shutdown(),c=null)}e(d,"shutdownTelemetry");import{SpanKind as ae,SpanStatusCode as ce}from"@opentelemetry/api";import{trace as de,context as me}from"@opentelemetry/api";import*as l from"@sentry/node";var h=!1;function y(t){if(h)return!1;let r=process.env.SENTRY_DSN;return r?(l.init({dsn:r,serverName:t.serviceName,environment:process.env.NODE_ENV??"development",tracesSampleRate:0}),h=!0,!0):!1}e(y,"initSentry");async function m(t){h&&await l.flush(t)}e(m,"flushSentry");import{existsSync as G,mkdirSync as U,readFileSync as v,unlinkSync as k,writeFileSync as O}from"node:fs";import{dirname as X,join as P}from"node:path";import{execFileSync as $}from"node:child_process";var a=P(w(),"evals-agent.lock");function j(t){try{return process.kill(t,0),!0}catch(r){return r.code==="EPERM"}}e(j,"pidAlive");function B(t){if(!j(t))return!1;try{let r=$("ps",["-p",String(t),"-o","command="],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]});return/run\.js\s+evals\s+agent|evals\s+agent/.test(r)}catch{return!0}}e(B,"isLiveAgent");function H(){try{U(X(a),{recursive:!0})}catch{}for(let t=0;t<2;t++)try{return O(a,String(process.pid),{flag:"wx"}),{ok:!0}}catch(r){if(r.code!=="EEXIST")throw r;let n=0;try{n=Number(v(a,"utf-8").trim())}catch{}if(n&&n!==process.pid&&B(n))return{ok:!1,holder:n};try{k(a)}catch{}}try{O(a,String(process.pid))}catch{}return{ok:!0}}e(H,"acquireAgentLock");function S(){try{G(a)&&Number(v(a,"utf-8").trim())===process.pid&&k(a)}catch{}}e(S,"releaseAgentLock");var T=class t extends _{static{e(this,"EvalAgentCommand")}static description="The worker daemon: long-polls /api/work/next, claims jobs, and runs them locally. Installed as a launchd service by `rulemetric service install`.";static examples=["<%= config.bin %> evals agent"];async run(){await this.parse(t),this.requireAuth();let r=H();if(!r.ok){this.log(`Another rulemetric evals agent is already running (pid ${r.holder}). Refusing to start a second instance.`);return}process.env.PG_APPLICATION_NAME||="rulemetric-agent",y({serviceName:"rulemetric-agent"})&&this.log("[sentry] error capture enabled");let o=E({serviceName:"rulemetric-agent"});o==="otlp"?this.log(`[otel] traces exporting to ${process.env.OTEL_EXPORTER_OTLP_ENDPOINT}`):o==="console"?this.log("[otel] cron spans printing to stdout (set OTEL_EXPORTER_OTLP_ENDPOINT to ship to a backend)"):this.log("[otel] disabled (TELEMETRY_ENABLED=false)"),!R()&&!process.env.RULEMETRIC_API_KEY&&this.error("No auth token found. Run `rulemetric auth login` first."),this.log("Starting thin agent (Phase 4b parallel-run)..."),this.log(`Long-polling /api/work/next. Press Ctrl+C to stop.
|
|
2
|
+
`);let i=new AbortController,u=e(async p=>{this.log(`
|
|
3
|
+
[${p}] shutting down agent...`),i.abort(),await Promise.allSettled([m(2e3),d(),f()]),S(),process.exit(0)},"shutdown");process.on("SIGINT",()=>{u("SIGINT")}),process.on("SIGTERM",()=>{u("SIGTERM")});let x=!1;try{await N({signal:i.signal,log:e(p=>this.log(p),"log"),version:this.config.version,readInstalledVersion:e(()=>{try{return JSON.parse(v(P(this.config.root,"package.json"),"utf-8")).version??null}catch{return null}},"readInstalledVersion"),onVersionDrift:e(()=>{x=!0},"onVersionDrift")}),x&&(this.log("[upgrade] Installed CLI version changed \u2014 restarting worker onto the new code."),await Promise.allSettled([m(2e3),d(),f()]),S(),process.exit(1))}finally{S(),await f()}}};export{T as default};
|
|
@@ -1,73 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "../../chunk-2HK7RGZB.js";
|
|
8
|
-
import "../../chunk-R56PH7YE.js";
|
|
9
|
-
import "../../chunk-GQNJO2P2.js";
|
|
10
|
-
import "../../chunk-37LN5O7M.js";
|
|
11
|
-
import "../../chunk-EKJ2CABV.js";
|
|
12
|
-
import {
|
|
13
|
-
apiGet
|
|
14
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
15
|
-
import "../../chunk-W2YERO7E.js";
|
|
16
|
-
import "../../chunk-NSBPE2FW.js";
|
|
17
|
-
|
|
18
|
-
// src/commands/evals/benchmark.ts
|
|
19
|
-
import { Args, Flags } from "@oclif/core";
|
|
20
|
-
var EvalBenchmarkCommand = class _EvalBenchmarkCommand extends BaseCommand {
|
|
21
|
-
static description = "Aggregate eval runs into a benchmark for a target";
|
|
22
|
-
static examples = [
|
|
23
|
-
"<%= config.bin %> evals benchmark <target-id>",
|
|
24
|
-
"<%= config.bin %> evals benchmark <target-id> --iteration 2"
|
|
25
|
-
];
|
|
26
|
-
static args = {
|
|
27
|
-
targetId: Args.string({ description: "Eval target ID", required: true })
|
|
28
|
-
};
|
|
29
|
-
static flags = {
|
|
30
|
-
iteration: Flags.integer({ description: "Filter runs by iteration", default: 1 })
|
|
31
|
-
};
|
|
32
|
-
async run() {
|
|
33
|
-
const { args, flags } = await this.parse(_EvalBenchmarkCommand);
|
|
34
|
-
this.requireAuth();
|
|
35
|
-
const target = await apiGet(`/api/eval-targets/${args.targetId}`);
|
|
36
|
-
this.log(`Aggregating benchmark for "${target.name}" v${target.version}, iteration ${flags.iteration}`);
|
|
37
|
-
const result = await aggregateBenchmark(args.targetId, flags.iteration);
|
|
38
|
-
if (result.totalRuns === 0) {
|
|
39
|
-
this.error("No completed runs found. Run evals first with `rulemetric evals run`.");
|
|
40
|
-
}
|
|
41
|
-
this.log(`
|
|
42
|
-
Aggregated ${result.totalRuns} runs
|
|
43
|
-
`);
|
|
44
|
-
for (const [config, stats] of Object.entries(result.runSummary)) {
|
|
45
|
-
if (config === "delta") {
|
|
46
|
-
this.log(`
|
|
47
|
-
Delta (with_target - without_target):`);
|
|
48
|
-
for (const [metric, value] of Object.entries(stats)) {
|
|
49
|
-
this.log(` ${metric}: ${value}`);
|
|
50
|
-
}
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
this.log(`${config}:`);
|
|
54
|
-
for (const [metric, stat] of Object.entries(stats)) {
|
|
55
|
-
const s = stat;
|
|
56
|
-
this.log(` ${metric}: mean=${s.mean} stddev=${s.stddev} [${s.min}, ${s.max}]`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (result.notes.length > 0) {
|
|
60
|
-
this.log("\nNotes:");
|
|
61
|
-
for (const note of result.notes) {
|
|
62
|
-
this.log(` - ${note}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const benchmark = await postBenchmark(args.targetId, flags.iteration, result);
|
|
66
|
-
this.log(`
|
|
67
|
-
Benchmark saved: ${benchmark.id}`);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
export {
|
|
71
|
-
EvalBenchmarkCommand as default
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=benchmark.js.map
|
|
1
|
+
import{a as u,b as f}from"../../chunk-G63KMH6U.js";import{a as d}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import{e as l}from"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import{a as m}from"../../chunk-ZLLER3HP.js";import{Args as b,Flags as $}from"@oclif/core";var o=class h extends d{static{m(this,"EvalBenchmarkCommand")}static description="Aggregate eval runs into a benchmark for a target";static examples=["<%= config.bin %> evals benchmark <target-id>","<%= config.bin %> evals benchmark <target-id> --iteration 2"];static args={targetId:b.string({description:"Eval target ID",required:!0})};static flags={iteration:$.integer({description:"Filter runs by iteration",default:1})};async run(){let{args:i,flags:a}=await this.parse(h);this.requireAuth();let g=await l(`/api/eval-targets/${i.targetId}`);this.log(`Aggregating benchmark for "${g.name}" v${g.version}, iteration ${a.iteration}`);let t=await u(i.targetId,a.iteration);t.totalRuns===0&&this.error("No completed runs found. Run evals first with `rulemetric evals run`."),this.log(`
|
|
2
|
+
Aggregated ${t.totalRuns} runs
|
|
3
|
+
`);for(let[e,c]of Object.entries(t.runSummary)){if(e==="delta"){this.log(`
|
|
4
|
+
Delta (with_target - without_target):`);for(let[n,s]of Object.entries(c))this.log(` ${n}: ${s}`);continue}this.log(`${e}:`);for(let[n,s]of Object.entries(c)){let r=s;this.log(` ${n}: mean=${r.mean} stddev=${r.stddev} [${r.min}, ${r.max}]`)}}if(t.notes.length>0){this.log(`
|
|
5
|
+
Notes:`);for(let e of t.notes)this.log(` - ${e}`)}let v=await f(i.targetId,a.iteration,t);this.log(`
|
|
6
|
+
Benchmark saved: ${v.id}`)}};export{o as default};
|
|
@@ -1,90 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
BaseCommand
|
|
6
|
-
} from "../../chunk-2HK7RGZB.js";
|
|
7
|
-
import "../../chunk-R56PH7YE.js";
|
|
8
|
-
import "../../chunk-GQNJO2P2.js";
|
|
9
|
-
import "../../chunk-37LN5O7M.js";
|
|
10
|
-
import "../../chunk-EKJ2CABV.js";
|
|
11
|
-
import {
|
|
12
|
-
apiGet
|
|
13
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
14
|
-
import "../../chunk-W2YERO7E.js";
|
|
15
|
-
import "../../chunk-NSBPE2FW.js";
|
|
16
|
-
|
|
17
|
-
// src/commands/evals/compare.ts
|
|
18
|
-
import { Args, Flags } from "@oclif/core";
|
|
19
|
-
var EvalCompareCommand = class _EvalCompareCommand extends BaseCommand {
|
|
20
|
-
static description = "Blind A/B comparison between two eval target versions";
|
|
21
|
-
static examples = [
|
|
22
|
-
"<%= config.bin %> evals compare <target-a> <target-b>"
|
|
23
|
-
];
|
|
24
|
-
static args = {
|
|
25
|
-
targetA: Args.string({ description: "First eval target ID", required: true }),
|
|
26
|
-
targetB: Args.string({ description: "Second eval target ID", required: true })
|
|
27
|
-
};
|
|
28
|
-
static flags = {
|
|
29
|
-
model: Flags.string({ description: "Model for execution and comparison" }),
|
|
30
|
-
timeout: Flags.integer({ description: "Timeout per eval in ms", default: 12e4 })
|
|
31
|
-
};
|
|
32
|
-
async run() {
|
|
33
|
-
const { args, flags } = await this.parse(_EvalCompareCommand);
|
|
34
|
-
this.requireAuth();
|
|
35
|
-
const [targetA, targetB] = await Promise.all([
|
|
36
|
-
apiGet(`/api/eval-targets/${args.targetA}`),
|
|
37
|
-
apiGet(`/api/eval-targets/${args.targetB}`)
|
|
38
|
-
]);
|
|
39
|
-
const evals = await apiGet(`/api/eval-targets/${args.targetA}/evals`);
|
|
40
|
-
if (evals.length === 0) {
|
|
41
|
-
this.error("No evals found for target A. Create some first.");
|
|
42
|
-
}
|
|
43
|
-
this.log(`Comparing "${targetA.name}" v${targetA.version} vs "${targetB.name}" v${targetB.version}`);
|
|
44
|
-
this.log(`Running ${evals.length} eval(s)...
|
|
45
|
-
`);
|
|
46
|
-
const isSwapped = Math.random() > 0.5;
|
|
47
|
-
const contentA = isSwapped ? targetB.content : targetA.content;
|
|
48
|
-
const contentB = isSwapped ? targetA.content : targetB.content;
|
|
49
|
-
const labelA = isSwapped ? targetB.name : targetA.name;
|
|
50
|
-
const labelB = isSwapped ? targetA.name : targetB.name;
|
|
51
|
-
const comparisons = [];
|
|
52
|
-
for (const eval_ of evals) {
|
|
53
|
-
this.log(`[${eval_.name}] Running A...`);
|
|
54
|
-
const resultA = await executeEval({
|
|
55
|
-
prompt: eval_.prompt,
|
|
56
|
-
targetContent: contentA,
|
|
57
|
-
timeout: flags.timeout,
|
|
58
|
-
model: flags.model
|
|
59
|
-
});
|
|
60
|
-
this.log(`[${eval_.name}] Running B...`);
|
|
61
|
-
const resultB = await executeEval({
|
|
62
|
-
prompt: eval_.prompt,
|
|
63
|
-
targetContent: contentB,
|
|
64
|
-
timeout: flags.timeout,
|
|
65
|
-
model: flags.model
|
|
66
|
-
});
|
|
67
|
-
comparisons.push({
|
|
68
|
-
evalName: eval_.name,
|
|
69
|
-
outputA: resultA.output,
|
|
70
|
-
outputB: resultB.output
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
this.log("\nRunning blind comparison...");
|
|
74
|
-
const comparisonPrompt = comparisons.map((c) => `
|
|
75
|
-
## Eval: ${c.evalName}
|
|
1
|
+
import{a as i}from"../../chunk-MGHFDHHM.js";import{a as u}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import{e as a}from"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import{a as p}from"../../chunk-ZLLER3HP.js";import{Args as c,Flags as v}from"@oclif/core";var m=class d extends u{static{p(this,"EvalCompareCommand")}static description="Blind A/B comparison between two eval target versions";static examples=["<%= config.bin %> evals compare <target-a> <target-b>"];static args={targetA:c.string({description:"First eval target ID",required:!0}),targetB:c.string({description:"Second eval target ID",required:!0})};static flags={model:v.string({description:"Model for execution and comparison"}),timeout:v.integer({description:"Timeout per eval in ms",default:12e4})};async run(){let{args:s,flags:e}=await this.parse(d);this.requireAuth();let[o,n]=await Promise.all([a(`/api/eval-targets/${s.targetA}`),a(`/api/eval-targets/${s.targetB}`)]),l=await a(`/api/eval-targets/${s.targetA}/evals`);l.length===0&&this.error("No evals found for target A. Create some first."),this.log(`Comparing "${o.name}" v${o.version} vs "${n.name}" v${n.version}`),this.log(`Running ${l.length} eval(s)...
|
|
2
|
+
`);let r=Math.random()>.5,h=r?n.content:o.content,f=r?o.content:n.content,A=r?n.name:o.name,w=r?o.name:n.name,g=[];for(let t of l){this.log(`[${t.name}] Running A...`);let b=await i({prompt:t.prompt,targetContent:h,timeout:e.timeout,model:e.model});this.log(`[${t.name}] Running B...`);let E=await i({prompt:t.prompt,targetContent:f,timeout:e.timeout,model:e.model});g.push({evalName:t.name,outputA:b.output,outputB:E.output})}this.log(`
|
|
3
|
+
Running blind comparison...`);let B=g.map(t=>`
|
|
4
|
+
## Eval: ${t.evalName}
|
|
76
5
|
|
|
77
6
|
### Output A
|
|
78
|
-
${
|
|
7
|
+
${t.outputA}
|
|
79
8
|
|
|
80
9
|
### Output B
|
|
81
|
-
${
|
|
82
|
-
`).join(
|
|
83
|
-
|
|
84
|
-
|
|
10
|
+
${t.outputB}
|
|
11
|
+
`).join(`
|
|
12
|
+
---
|
|
13
|
+
`),$=await i({prompt:`Compare these two sets of outputs. For each eval, determine which output (A or B) is better.
|
|
85
14
|
Then provide an overall winner with reasoning.
|
|
86
15
|
|
|
87
|
-
${
|
|
16
|
+
${B}
|
|
88
17
|
|
|
89
18
|
Respond with JSON:
|
|
90
19
|
{
|
|
@@ -97,18 +26,6 @@ Respond with JSON:
|
|
|
97
26
|
"strengths_winner": ["..."],
|
|
98
27
|
"weaknesses_loser": ["..."]
|
|
99
28
|
}
|
|
100
|
-
}`,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
this.log("\n=== Comparison Results ===\n");
|
|
105
|
-
this.log(`A = "${labelA}" | B = "${labelB}"`);
|
|
106
|
-
if (isSwapped) this.log("(Labels were swapped for blind comparison)");
|
|
107
|
-
this.log("");
|
|
108
|
-
this.log(comparatorResult.output);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
export {
|
|
112
|
-
EvalCompareCommand as default
|
|
113
|
-
};
|
|
114
|
-
//# sourceMappingURL=compare.js.map
|
|
29
|
+
}`,timeout:e.timeout,model:e.model});this.log(`
|
|
30
|
+
=== Comparison Results ===
|
|
31
|
+
`),this.log(`A = "${A}" | B = "${w}"`),r&&this.log("(Labels were swapped for blind comparison)"),this.log(""),this.log($.output)}};export{m as default};
|
|
@@ -1,67 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BaseCommand
|
|
3
|
-
} from "../../chunk-2HK7RGZB.js";
|
|
4
|
-
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-GQNJO2P2.js";
|
|
6
|
-
import "../../chunk-37LN5O7M.js";
|
|
7
|
-
import "../../chunk-EKJ2CABV.js";
|
|
8
|
-
import {
|
|
9
|
-
apiPost
|
|
10
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
11
|
-
import "../../chunk-W2YERO7E.js";
|
|
12
|
-
import "../../chunk-NSBPE2FW.js";
|
|
13
|
-
|
|
14
|
-
// src/commands/evals/create.ts
|
|
15
|
-
import { Args, Flags } from "@oclif/core";
|
|
16
|
-
import { readFileSync } from "node:fs";
|
|
17
|
-
var EvalCreate = class _EvalCreate extends BaseCommand {
|
|
18
|
-
static description = "Create test cases (evals) for an eval target";
|
|
19
|
-
static examples = [
|
|
20
|
-
'<%= config.bin %> evals create <target-id> --name "ts-check" --prompt "Write a function to add two numbers"',
|
|
21
|
-
"<%= config.bin %> evals create <target-id> --from-file evals.json"
|
|
22
|
-
];
|
|
23
|
-
static args = {
|
|
24
|
-
targetId: Args.string({ description: "Eval target ID", required: true })
|
|
25
|
-
};
|
|
26
|
-
static flags = {
|
|
27
|
-
name: Flags.string({ char: "n", description: "Eval name" }),
|
|
28
|
-
prompt: Flags.string({ char: "p", description: "Test prompt" }),
|
|
29
|
-
"expected-output": Flags.string({ description: "Expected output description" }),
|
|
30
|
-
expectations: Flags.string({ char: "e", description: "Assertion (repeatable)", multiple: true }),
|
|
31
|
-
"from-file": Flags.string({ description: "Bulk create from JSON file" })
|
|
32
|
-
};
|
|
33
|
-
async run() {
|
|
34
|
-
const { args, flags } = await this.parse(_EvalCreate);
|
|
35
|
-
this.requireAuth();
|
|
36
|
-
if (flags["from-file"]) {
|
|
37
|
-
const data = JSON.parse(readFileSync(flags["from-file"], "utf-8"));
|
|
38
|
-
const evalsArray = Array.isArray(data) ? data : data.evals;
|
|
39
|
-
for (const evalItem of evalsArray) {
|
|
40
|
-
const result2 = await apiPost(`/api/eval-targets/${args.targetId}/evals`, {
|
|
41
|
-
name: evalItem.name,
|
|
42
|
-
prompt: evalItem.prompt,
|
|
43
|
-
expectedOutput: evalItem.expectedOutput ?? "",
|
|
44
|
-
expectations: evalItem.expectations ?? [],
|
|
45
|
-
files: evalItem.files ?? []
|
|
46
|
-
});
|
|
47
|
-
this.log(`Created eval: ${result2.name} (${result2.id})`);
|
|
48
|
-
}
|
|
49
|
-
this.log(`Created ${evalsArray.length} evals.`);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (!flags.name || !flags.prompt) {
|
|
53
|
-
this.error("Provide --name and --prompt, or use --from-file for bulk creation");
|
|
54
|
-
}
|
|
55
|
-
const result = await apiPost(`/api/eval-targets/${args.targetId}/evals`, {
|
|
56
|
-
name: flags.name,
|
|
57
|
-
prompt: flags.prompt,
|
|
58
|
-
expectedOutput: flags["expected-output"] ?? "",
|
|
59
|
-
expectations: flags.expectations ?? []
|
|
60
|
-
});
|
|
61
|
-
this.log(`Created eval: ${result.name} (${result.id})`);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
export {
|
|
65
|
-
EvalCreate as default
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=create.js.map
|
|
1
|
+
import{a as c}from"../../chunk-PPKPCXJD.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-V44SRRYR.js";import"../../chunk-U6XEU573.js";import"../../chunk-VLOX6KOM.js";import"../../chunk-3AV3GTMP.js";import{f as i}from"../../chunk-H2ORWIEY.js";import"../../chunk-O6C2UGBY.js";import{a as m}from"../../chunk-ZLLER3HP.js";import{Args as f,Flags as r}from"@oclif/core";import{readFileSync as g}from"node:fs";var s=class d extends c{static{m(this,"EvalCreate")}static description="Create test cases (evals) for an eval target";static examples=['<%= config.bin %> evals create <target-id> --name "ts-check" --prompt "Write a function to add two numbers"',"<%= config.bin %> evals create <target-id> --from-file evals.json"];static args={targetId:f.string({description:"Eval target ID",required:!0})};static flags={name:r.string({char:"n",description:"Eval name"}),prompt:r.string({char:"p",description:"Test prompt"}),expectations:r.string({char:"e",description:"Assertion (repeatable)",multiple:!0}),"from-file":r.string({description:"Bulk create from JSON file"})};async run(){let{args:n,flags:e}=await this.parse(d);if(this.requireAuth(),e["from-file"]){let a=JSON.parse(g(e["from-file"],"utf-8")),p=Array.isArray(a)?a:a.evals;for(let t of p){let l=await i(`/api/eval-targets/${n.targetId}/evals`,{name:t.name,prompt:t.prompt,expectations:t.expectations??[],files:t.files??[]});this.log(`Created eval: ${l.name} (${l.id})`)}this.log(`Created ${p.length} evals.`);return}(!e.name||!e.prompt)&&this.error("Provide --name and --prompt, or use --from-file for bulk creation");let o=await i(`/api/eval-targets/${n.targetId}/evals`,{name:e.name,prompt:e.prompt,expectations:e.expectations??[]});this.log(`Created eval: ${o.name} (${o.id})`)}};export{s as default};
|