@rulemetric/cli 0.7.3 → 0.7.4
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/dist/base-command.js +1 -14
- package/dist/chunk-2TC6WCUT.js +34 -0
- package/dist/chunk-2UC3ULIG.js +1 -0
- package/dist/chunk-3AV3GTMP.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-72XLQE3X.js +2 -0
- package/dist/chunk-7DFNBRLY.js +61 -0
- package/dist/chunk-7XQ4VPLC.js +2 -0
- package/dist/chunk-AHRHCERJ.js +1 -0
- package/dist/chunk-ARNZQBMX.js +1 -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-CRAKDQ4H.js +1 -0
- package/dist/chunk-DNF4HDI6.js +14 -0
- package/dist/chunk-DSO2U4Y6.js +56 -0
- package/dist/chunk-DT4GKEP5.js +5 -0
- package/dist/chunk-DVN7GFJG.js +1 -0
- package/dist/chunk-E4SFUPYR.js +15 -0
- package/dist/chunk-EUHNCVJQ.js +33 -0
- package/dist/chunk-F2VP4B4J.js +1 -0
- package/dist/chunk-FEHM5OKW.js +1 -0
- package/dist/chunk-FHVBTDBM.js +69 -0
- package/dist/chunk-GBMF3TP6.js +1 -0
- package/dist/chunk-GY5IJ4RS.js +1 -0
- package/dist/chunk-HOHD5HY2.js +5 -0
- package/dist/chunk-HP2BUPGS.js +24 -0
- package/dist/{chunk-OQBBVTDG.js → chunk-I2DZGJRR.js} +6 -71
- package/dist/chunk-I4YJ7NTX.js +1 -0
- package/dist/chunk-IY5NXR3N.js +1 -0
- package/dist/chunk-IZTIYR5Q.js +2 -0
- package/dist/chunk-KKDHD4XA.js +2 -0
- package/dist/chunk-LQRYQE6Q.js +4 -0
- package/dist/chunk-M6AJDVCL.js +5 -0
- package/dist/chunk-MGHFDHHM.js +1 -0
- package/dist/chunk-ML36XQW7.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-NBTC5FNV.js +1 -0
- package/dist/chunk-NJ5UED3H.js +1 -0
- package/dist/chunk-NVKX36YN.js +3 -0
- package/dist/chunk-NVOTOQBA.js +1 -0
- package/dist/chunk-O7ZMHCMG.js +31 -0
- package/dist/chunk-OMXUK4M6.js +1 -0
- package/dist/chunk-PZS2KOU7.js +1 -0
- package/dist/chunk-RSKQRVPJ.js +1 -0
- package/dist/chunk-RTEATXTP.js +1 -0
- package/dist/chunk-RTWRHIKY.js +7 -0
- package/dist/chunk-RVO4HV3M.js +1 -0
- package/dist/chunk-SBILN45P.js +1 -0
- package/dist/chunk-SZ62CP55.js +1 -0
- package/dist/chunk-T3W5N3BP.js +2 -0
- package/dist/chunk-TDD7IOV2.js +1 -0
- package/dist/chunk-TIQ7DQ3M.js +1 -0
- package/dist/chunk-TU2AR6XO.js +1 -0
- package/dist/chunk-UF6US7VU.js +1 -0
- package/dist/chunk-V5QFOF4F.js +9 -0
- package/dist/chunk-V5U3E4BZ.js +1 -0
- package/dist/chunk-VAFAH6QL.js +1 -0
- package/dist/chunk-VMWY7KHH.js +1 -0
- package/dist/chunk-VUGRXM7R.js +1 -0
- package/dist/{chunk-XZXS2W24.js → chunk-VWEXKDWG.js} +10 -56
- package/dist/chunk-W2MV25SB.js +1 -0
- package/dist/chunk-WJ3H73G6.js +1 -0
- package/dist/chunk-WJUQBMTF.js +9 -0
- package/dist/chunk-WLVQJH4E.js +1 -0
- package/dist/chunk-WPJ2BND4.js +1 -0
- package/dist/chunk-WSCK4WNK.js +1 -0
- package/dist/chunk-Y65CSJFF.js +3 -0
- package/dist/chunk-ZL4MZMUK.js +34 -0
- package/dist/chunk-ZLLER3HP.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 +1 -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 +15 -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 +3 -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 +1 -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/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 +135 -135
- 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,46 +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 "../chunk-ZUJBM6HE.js";
|
|
9
|
-
import "../chunk-W2YERO7E.js";
|
|
10
|
-
import "../chunk-NSBPE2FW.js";
|
|
11
|
-
|
|
12
|
-
// src/commands/dashboard.ts
|
|
13
|
-
import { Flags } from "@oclif/core";
|
|
14
|
-
var Dashboard = class _Dashboard extends BaseCommand {
|
|
15
|
-
static description = "Interactive TUI dashboard showing session analytics, outcomes, friction, and insights";
|
|
16
|
-
static examples = [
|
|
17
|
-
"<%= config.bin %> dashboard",
|
|
18
|
-
"<%= config.bin %> dashboard --period 30days",
|
|
19
|
-
"<%= config.bin %> dashboard --launcher"
|
|
20
|
-
];
|
|
21
|
-
static flags = {
|
|
22
|
-
period: Flags.string({
|
|
23
|
-
char: "p",
|
|
24
|
-
default: "week",
|
|
25
|
-
options: ["today", "week", "30days", "month", "all"],
|
|
26
|
-
description: "Initial time period"
|
|
27
|
-
}),
|
|
28
|
-
launcher: Flags.boolean({
|
|
29
|
-
char: "l",
|
|
30
|
-
default: false,
|
|
31
|
-
description: "Open the launcher overlay immediately"
|
|
32
|
-
})
|
|
33
|
-
};
|
|
34
|
-
async run() {
|
|
35
|
-
const { flags } = await this.parse(_Dashboard);
|
|
36
|
-
const { renderDashboard } = await import("../dashboard/Dashboard.js");
|
|
37
|
-
await renderDashboard(
|
|
38
|
-
flags.period,
|
|
39
|
-
{ openLauncher: flags.launcher }
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
Dashboard as default
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=dashboard.js.map
|
|
1
|
+
import{a as o}from"../chunk-LQRYQE6Q.js";import"../chunk-IZTIYR5Q.js";import"../chunk-CRAKDQ4H.js";import"../chunk-WPJ2BND4.js";import"../chunk-3AV3GTMP.js";import"../chunk-TIQ7DQ3M.js";import"../chunk-M6AJDVCL.js";import{a as i}from"../chunk-ZLLER3HP.js";import{Flags as r}from"@oclif/core";var a=class s extends o{static{i(this,"Dashboard")}static description="Interactive TUI dashboard showing session analytics, outcomes, friction, and insights";static examples=["<%= config.bin %> dashboard","<%= config.bin %> dashboard --period 30days","<%= config.bin %> dashboard --launcher"];static flags={period:r.string({char:"p",default:"week",options:["today","week","30days","month","all"],description:"Initial time period"}),launcher:r.boolean({char:"l",default:!1,description:"Open the launcher overlay immediately"})};async run(){let{flags:e}=await this.parse(s),{renderDashboard:t}=await import("../dashboard/Dashboard.js");await t(e.period,{openLauncher:e.launcher})}};export{a as default};
|
|
@@ -1,117 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
diagnose,
|
|
3
|
-
isProxyBreakingNode
|
|
4
|
-
} from "../chunk-J6QFW4LD.js";
|
|
5
|
-
import {
|
|
6
|
-
GATEWAY_PORT,
|
|
7
|
-
MITMPROXY_PORT,
|
|
8
|
-
isGatewayListening
|
|
9
|
-
} from "../chunk-4LYCDS2N.js";
|
|
10
|
-
import "../chunk-7LVVKQMZ.js";
|
|
11
|
-
import "../chunk-5EDMGK3W.js";
|
|
12
|
-
import {
|
|
13
|
-
BaseCommand
|
|
14
|
-
} from "../chunk-2HK7RGZB.js";
|
|
15
|
-
import "../chunk-R56PH7YE.js";
|
|
16
|
-
import "../chunk-GQNJO2P2.js";
|
|
17
|
-
import "../chunk-37LN5O7M.js";
|
|
18
|
-
import "../chunk-EKJ2CABV.js";
|
|
19
|
-
import {
|
|
20
|
-
DEFAULT_API_URL
|
|
21
|
-
} from "../chunk-ZUJBM6HE.js";
|
|
22
|
-
import {
|
|
23
|
-
isAuthenticated,
|
|
24
|
-
loadEnvFileAuth
|
|
25
|
-
} from "../chunk-W2YERO7E.js";
|
|
26
|
-
import "../chunk-NSBPE2FW.js";
|
|
27
|
-
|
|
28
|
-
// src/commands/diagnostics.ts
|
|
29
|
-
import { spawnSync } from "node:child_process";
|
|
30
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
31
|
-
import { join } from "node:path";
|
|
32
|
-
var Diagnostics = class _Diagnostics extends BaseCommand {
|
|
33
|
-
static description = 'Diagnose capture / proxy / connectivity problems (e.g. a client-side "502 Bad Gateway")';
|
|
34
|
-
static examples = ["<%= config.bin %> diagnostics"];
|
|
35
|
-
baseUrl() {
|
|
36
|
-
return process.env.RULEMETRIC_API_URL ?? loadEnvFileAuth().apiUrl ?? DEFAULT_API_URL;
|
|
37
|
-
}
|
|
38
|
-
/** GET /health with the proxy bypassed — "is production reachable at all?" */
|
|
39
|
-
async checkDirect() {
|
|
40
|
-
const savedHttps = process.env.HTTPS_PROXY;
|
|
41
|
-
const savedHttp = process.env.HTTP_PROXY;
|
|
42
|
-
delete process.env.HTTPS_PROXY;
|
|
43
|
-
delete process.env.HTTP_PROXY;
|
|
44
|
-
const controller = new AbortController();
|
|
45
|
-
const timer = setTimeout(() => controller.abort(), 8e3);
|
|
46
|
-
try {
|
|
47
|
-
const res = await globalThis.fetch(`${this.baseUrl()}/health`, { signal: controller.signal });
|
|
48
|
-
return res.ok;
|
|
49
|
-
} catch {
|
|
50
|
-
return false;
|
|
51
|
-
} finally {
|
|
52
|
-
clearTimeout(timer);
|
|
53
|
-
if (savedHttps !== void 0) process.env.HTTPS_PROXY = savedHttps;
|
|
54
|
-
if (savedHttp !== void 0) process.env.HTTP_PROXY = savedHttp;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/** Resolve the configured proxy: env HTTPS_PROXY, else the project settings files. */
|
|
58
|
-
configuredProxy() {
|
|
59
|
-
if (process.env.HTTPS_PROXY) return process.env.HTTPS_PROXY;
|
|
60
|
-
for (const fileName of ["settings.local.json", "settings.json"]) {
|
|
61
|
-
const settingsPath = join(process.cwd(), ".claude", fileName);
|
|
62
|
-
if (!existsSync(settingsPath)) continue;
|
|
63
|
-
try {
|
|
64
|
-
const parsed = JSON.parse(readFileSync(settingsPath, "utf8"));
|
|
65
|
-
if (parsed.env?.HTTPS_PROXY) return parsed.env.HTTPS_PROXY;
|
|
66
|
-
} catch {
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
/** GET /health THROUGH the proxy via curl (Node fetch won't honor HTTPS_PROXY). */
|
|
72
|
-
checkThroughProxy(proxyUrl) {
|
|
73
|
-
const res = spawnSync(
|
|
74
|
-
"curl",
|
|
75
|
-
["-sS", "-x", proxyUrl, "--max-time", "8", "-o", "/dev/null", "-w", "%{http_code}", `${this.baseUrl()}/health`],
|
|
76
|
-
{ encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }
|
|
77
|
-
);
|
|
78
|
-
if (res.error || typeof res.stdout !== "string") return null;
|
|
79
|
-
return res.stdout.trim() === "200";
|
|
80
|
-
}
|
|
81
|
-
async run() {
|
|
82
|
-
await this.parse(_Diagnostics);
|
|
83
|
-
const nodeVersion = process.version;
|
|
84
|
-
const proxyUrl = this.configuredProxy();
|
|
85
|
-
const httpsProxySet = proxyUrl != null;
|
|
86
|
-
const [directApiOk, gatewayAlive, mitmproxyAlive] = await Promise.all([
|
|
87
|
-
this.checkDirect(),
|
|
88
|
-
isGatewayListening(GATEWAY_PORT),
|
|
89
|
-
isGatewayListening(MITMPROXY_PORT)
|
|
90
|
-
]);
|
|
91
|
-
const proxyPathOk = httpsProxySet && proxyUrl ? this.checkThroughProxy(proxyUrl) : null;
|
|
92
|
-
const line = (label, ok, detail) => {
|
|
93
|
-
const mark = ok === null ? "\u2013" : ok ? "[OK]" : "[!!]";
|
|
94
|
-
this.log(` ${mark} ${label.padEnd(22)} ${detail}`);
|
|
95
|
-
};
|
|
96
|
-
this.log("RuleMetric diagnostics");
|
|
97
|
-
this.log("");
|
|
98
|
-
line("Node", !isProxyBreakingNode(nodeVersion), `${nodeVersion}${isProxyBreakingNode(nodeVersion) ? " (< 20.11 \u2014 breaks the bundled proxy)" : ""}`);
|
|
99
|
-
line("API (direct)", directApiOk, `${this.baseUrl()}/health ${directApiOk ? "reachable" : "UNREACHABLE"}`);
|
|
100
|
-
line("Authenticated", isAuthenticated(), isAuthenticated() ? "yes" : "no \u2014 run `rulemetric auth login`");
|
|
101
|
-
line("Proxy configured", httpsProxySet ? true : null, httpsProxySet ? proxyUrl : "no HTTPS_PROXY set");
|
|
102
|
-
if (httpsProxySet) {
|
|
103
|
-
line("Gateway :" + GATEWAY_PORT, gatewayAlive, gatewayAlive ? "listening" : "NOT listening");
|
|
104
|
-
line("mitmproxy :" + MITMPROXY_PORT, mitmproxyAlive, mitmproxyAlive ? "listening" : "not listening (gateway should route direct)");
|
|
105
|
-
line("API (via proxy)", proxyPathOk, proxyPathOk === null ? "inconclusive (curl unavailable)" : proxyPathOk ? "reachable" : "FAILED \u2014 502/blocked through your proxy");
|
|
106
|
-
}
|
|
107
|
-
const d = diagnose({ nodeVersion, directApiOk, httpsProxySet, gatewayAlive, mitmproxyAlive, proxyPathOk });
|
|
108
|
-
this.log("");
|
|
109
|
-
const badge = d.severity === "ok" ? "[OK]" : d.severity === "warn" ? "[!!]" : "[XX]";
|
|
110
|
-
this.log(`${badge} ${d.headline}`);
|
|
111
|
-
for (const h of d.hints) this.log(` \u2022 ${h}`);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
export {
|
|
115
|
-
Diagnostics as default
|
|
116
|
-
};
|
|
117
|
-
//# sourceMappingURL=diagnostics.js.map
|
|
1
|
+
import{b as P,c as x}from"../chunk-V5U3E4BZ.js";import{c as p,d as h,e as g}from"../chunk-MVM6OGAF.js";import"../chunk-KKDHD4XA.js";import"../chunk-SZ62CP55.js";import{a as v}from"../chunk-LQRYQE6Q.js";import"../chunk-IZTIYR5Q.js";import"../chunk-CRAKDQ4H.js";import"../chunk-WPJ2BND4.js";import"../chunk-3AV3GTMP.js";import{a as f}from"../chunk-TIQ7DQ3M.js";import{a as y,g as d}from"../chunk-M6AJDVCL.js";import{a as u}from"../chunk-ZLLER3HP.js";import{spawnSync as A}from"node:child_process";import{existsSync as H,readFileSync as S}from"node:fs";import{join as X}from"node:path";var m=class O extends v{static{u(this,"Diagnostics")}static description='Diagnose capture / proxy / connectivity problems (e.g. a client-side "502 Bad Gateway")';static examples=["<%= config.bin %> diagnostics"];baseUrl(){return process.env.RULEMETRIC_API_URL??y().apiUrl??f}async checkDirect(){let t=process.env.HTTPS_PROXY,e=process.env.HTTP_PROXY;delete process.env.HTTPS_PROXY,delete process.env.HTTP_PROXY;let r=new AbortController,n=setTimeout(()=>r.abort(),8e3);try{return(await globalThis.fetch(`${this.baseUrl()}/health`,{signal:r.signal})).ok}catch{return!1}finally{clearTimeout(n),t!==void 0&&(process.env.HTTPS_PROXY=t),e!==void 0&&(process.env.HTTP_PROXY=e)}}configuredProxy(){if(process.env.HTTPS_PROXY)return process.env.HTTPS_PROXY;for(let t of["settings.local.json","settings.json"]){let e=X(process.cwd(),".claude",t);if(H(e))try{let r=JSON.parse(S(e,"utf8"));if(r.env?.HTTPS_PROXY)return r.env.HTTPS_PROXY}catch{}}return null}checkThroughProxy(t){let e=A("curl",["-sS","-x",t,"--max-time","8","-o","/dev/null","-w","%{http_code}",`${this.baseUrl()}/health`],{encoding:"utf8",stdio:["ignore","pipe","ignore"]});return e.error||typeof e.stdout!="string"?null:e.stdout.trim()==="200"}async run(){await this.parse(O);let t=process.version,e=this.configuredProxy(),r=e!=null,[n,s,l]=await Promise.all([this.checkDirect(),g(p),g(h)]),i=r&&e?this.checkThroughProxy(e):null,o=u((c,T,b)=>{let _=T===null?"\u2013":T?"[OK]":"[!!]";this.log(` ${_} ${c.padEnd(22)} ${b}`)},"line");this.log("RuleMetric diagnostics"),this.log(""),o("Node",!P(t),`${t}${P(t)?" (< 20.11 \u2014 breaks the bundled proxy)":""}`),o("API (direct)",n,`${this.baseUrl()}/health ${n?"reachable":"UNREACHABLE"}`),o("Authenticated",d(),d()?"yes":"no \u2014 run `rulemetric auth login`"),o("Proxy configured",r?!0:null,r?e:"no HTTPS_PROXY set"),r&&(o("Gateway :"+p,s,s?"listening":"NOT listening"),o("mitmproxy :"+h,l,l?"listening":"not listening (gateway should route direct)"),o("API (via proxy)",i,i===null?"inconclusive (curl unavailable)":i?"reachable":"FAILED \u2014 502/blocked through your proxy"));let a=x({nodeVersion:t,directApiOk:n,httpsProxySet:r,gatewayAlive:s,mitmproxyAlive:l,proxyPathOk:i});this.log("");let R=a.severity==="ok"?"[OK]":a.severity==="warn"?"[!!]":"[XX]";this.log(`${R} ${a.headline}`);for(let c of a.hints)this.log(` \u2022 ${c}`)}};export{m as default};
|
|
@@ -1,53 +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/eval-targets/create.ts
|
|
15
|
-
import { Flags } from "@oclif/core";
|
|
16
|
-
import { readFileSync } from "node:fs";
|
|
17
|
-
var EvalTargetCreate = class _EvalTargetCreate extends BaseCommand {
|
|
18
|
-
static description = "Create an eval target (instruction, skill, prompt, or plan to test)";
|
|
19
|
-
static examples = [
|
|
20
|
-
"<%= config.bin %> eval-targets create --name my-rules --type instruction --file ./CLAUDE.md",
|
|
21
|
-
'<%= config.bin %> eval-targets create --name my-prompt --type prompt --content "Always use TypeScript"'
|
|
22
|
-
];
|
|
23
|
-
static flags = {
|
|
24
|
-
name: Flags.string({ char: "n", description: "Name for the eval target", required: true }),
|
|
25
|
-
type: Flags.string({ char: "t", description: "Target type", options: ["instruction", "skill", "prompt", "plan"], required: true }),
|
|
26
|
-
file: Flags.string({ char: "f", description: "Path to content file" }),
|
|
27
|
-
content: Flags.string({ char: "c", description: "Content string (alternative to --file)" }),
|
|
28
|
-
description: Flags.string({ char: "d", description: "Description of the target", default: "" })
|
|
29
|
-
};
|
|
30
|
-
async run() {
|
|
31
|
-
const { flags } = await this.parse(_EvalTargetCreate);
|
|
32
|
-
this.requireAuth();
|
|
33
|
-
let content;
|
|
34
|
-
if (flags.file) {
|
|
35
|
-
content = readFileSync(flags.file, "utf-8");
|
|
36
|
-
} else if (flags.content) {
|
|
37
|
-
content = flags.content;
|
|
38
|
-
} else {
|
|
39
|
-
this.error("Provide either --file or --content");
|
|
40
|
-
}
|
|
41
|
-
const result = await apiPost("/api/eval-targets", {
|
|
42
|
-
name: flags.name,
|
|
43
|
-
type: flags.type,
|
|
44
|
-
content,
|
|
45
|
-
description: flags.description
|
|
46
|
-
});
|
|
47
|
-
this.log(`Created eval target: ${result.name} (${result.id}) v${result.version}`);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
EvalTargetCreate as default
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=create.js.map
|
|
1
|
+
import{a}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import{e as s}from"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as o}from"../../chunk-ZLLER3HP.js";import{Flags as e}from"@oclif/core";import{readFileSync as p}from"node:fs";var n=class c extends a{static{o(this,"EvalTargetCreate")}static description="Create an eval target (instruction, skill, prompt, or plan to test)";static examples=["<%= config.bin %> eval-targets create --name my-rules --type instruction --file ./CLAUDE.md",'<%= config.bin %> eval-targets create --name my-prompt --type prompt --content "Always use TypeScript"'];static flags={name:e.string({char:"n",description:"Name for the eval target",required:!0}),type:e.string({char:"t",description:"Target type",options:["instruction","skill","prompt","plan"],required:!0}),file:e.string({char:"f",description:"Path to content file"}),content:e.string({char:"c",description:"Content string (alternative to --file)"}),description:e.string({char:"d",description:"Description of the target",default:""})};async run(){let{flags:t}=await this.parse(c);this.requireAuth();let i;t.file?i=p(t.file,"utf-8"):t.content?i=t.content:this.error("Provide either --file or --content");let r=await s("/api/eval-targets",{name:t.name,type:t.type,content:i,description:t.description});this.log(`Created eval target: ${r.name} (${r.id}) v${r.version}`)}};export{n as default};
|
|
@@ -1,54 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatDate,
|
|
3
|
-
truncate
|
|
4
|
-
} from "../../chunk-BZDKEQKU.js";
|
|
5
|
-
import {
|
|
6
|
-
BaseCommand
|
|
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/eval-targets/list.ts
|
|
19
|
-
import { Flags } from "@oclif/core";
|
|
20
|
-
import { printTable } from "@oclif/table";
|
|
21
|
-
var EvalTargetList = class _EvalTargetList extends BaseCommand {
|
|
22
|
-
static description = "List eval targets";
|
|
23
|
-
static examples = [
|
|
24
|
-
"<%= config.bin %> eval-targets list",
|
|
25
|
-
"<%= config.bin %> eval-targets list --type instruction"
|
|
26
|
-
];
|
|
27
|
-
static flags = {
|
|
28
|
-
type: Flags.string({ char: "t", description: "Filter by type", options: ["instruction", "skill", "prompt", "plan"] })
|
|
29
|
-
};
|
|
30
|
-
async run() {
|
|
31
|
-
const { flags } = await this.parse(_EvalTargetList);
|
|
32
|
-
this.requireAuth();
|
|
33
|
-
const query = flags.type ? `?type=${flags.type}` : "";
|
|
34
|
-
const results = await apiGet(`/api/eval-targets${query}`);
|
|
35
|
-
if (results.length === 0) {
|
|
36
|
-
this.log("No eval targets found. Create one with `rulemetric eval-targets create`.");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
printTable({
|
|
40
|
-
data: results.map((t) => ({
|
|
41
|
-
Name: truncate(t.name, 30),
|
|
42
|
-
Type: t.type,
|
|
43
|
-
Version: `v${t.version}`,
|
|
44
|
-
Description: truncate(t.description, 40),
|
|
45
|
-
Updated: formatDate(t.updatedAt)
|
|
46
|
-
})),
|
|
47
|
-
columns: ["Name", "Type", "Version", "Description", "Updated"]
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
EvalTargetList as default
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=list.js.map
|
|
1
|
+
import{a as p,b as e}from"../../chunk-W2MV25SB.js";import{a as o}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import{d as n}from"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Flags as m}from"@oclif/core";import{printTable as d}from"@oclif/table";var r=class l extends o{static{s(this,"EvalTargetList")}static description="List eval targets";static examples=["<%= config.bin %> eval-targets list","<%= config.bin %> eval-targets list --type instruction"];static flags={type:m.string({char:"t",description:"Filter by type",options:["instruction","skill","prompt","plan"]})};async run(){let{flags:i}=await this.parse(l);this.requireAuth();let c=i.type?`?type=${i.type}`:"",a=await n(`/api/eval-targets${c}`);if(a.length===0){this.log("No eval targets found. Create one with `rulemetric eval-targets create`.");return}d({data:a.map(t=>({Name:e(t.name,30),Type:t.type,Version:`v${t.version}`,Description:e(t.description,40),Updated:p(t.updatedAt)})),columns:["Name","Type","Version","Description","Updated"]})}};export{r as default};
|
|
@@ -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-ML36XQW7.js";import"../../chunk-PZS2KOU7.js";import"../../chunk-RTEATXTP.js";import"../../chunk-7XQ4VPLC.js";import"../../chunk-6QKI756T.js";import"../../chunk-RSKQRVPJ.js";import"../../chunk-HOHD5HY2.js";import"../../chunk-V5QFOF4F.js";import"../../chunk-UF6US7VU.js";import"../../chunk-IY5NXR3N.js";import"../../chunk-72XLQE3X.js";import"../../chunk-FHVBTDBM.js";import{i as f}from"../../chunk-NVOTOQBA.js";import"../../chunk-I4YJ7NTX.js";import"../../chunk-F2VP4B4J.js";import"../../chunk-E4SFUPYR.js";import"../../chunk-VWEXKDWG.js";import"../../chunk-RTWRHIKY.js";import"../../chunk-ZL4MZMUK.js";import"../../chunk-5RBLIVBF.js";import"../../chunk-2TC6WCUT.js";import"../../chunk-6V4WM73L.js";import"../../chunk-HP2BUPGS.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-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-TIQ7DQ3M.js";import{e as R,k as w}from"../../chunk-M6AJDVCL.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};
|