@rulemetric/cli 0.7.2 → 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 -309
- 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 -781
- 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 -46
- 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 -15
- 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 -14
- 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 -11
- 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 -17
- package/dist/lib/manual-tasks-meta.js +1 -8
- package/dist/lib/manual-tasks.js +1 -79
- 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 +8 -7
- 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-7DULPSFU.js +0 -299
- package/dist/chunk-7DULPSFU.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-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-FZKLLNDS.js +0 -228
- package/dist/chunk-FZKLLNDS.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-OK3I555A.js +0 -243
- package/dist/chunk-OK3I555A.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-PMI56ED5.js +0 -167
- package/dist/chunk-PMI56ED5.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-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-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-YOBA3NAM.js +0 -55
- package/dist/chunk-YOBA3NAM.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,180 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
detectTmux
|
|
3
|
-
} from "../../chunk-BO76WKJR.js";
|
|
4
|
-
import "../../chunk-KRBQLMOP.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 "../../chunk-ZUJBM6HE.js";
|
|
13
|
-
import "../../chunk-W2YERO7E.js";
|
|
14
|
-
import "../../chunk-NSBPE2FW.js";
|
|
15
|
-
|
|
16
|
-
// src/commands/service/status.ts
|
|
17
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
18
|
-
import { execFileSync, execSync } from "node:child_process";
|
|
19
|
-
import { homedir } from "node:os";
|
|
20
|
-
import { join } from "node:path";
|
|
21
|
-
var PLIST_LABEL = "com.rulemetric.api";
|
|
22
|
-
var PLIST_PATH = join(homedir(), "Library", "LaunchAgents", `${PLIST_LABEL}.plist`);
|
|
23
|
-
var WORKER_PLIST_LABEL = "com.rulemetric.worker";
|
|
24
|
-
var WORKER_PLIST_PATH = join(homedir(), "Library", "LaunchAgents", `${WORKER_PLIST_LABEL}.plist`);
|
|
25
|
-
var GATEWAY_PLIST_LABEL = "com.rulemetric.gateway";
|
|
26
|
-
var GATEWAY_PLIST_PATH = join(homedir(), "Library", "LaunchAgents", `${GATEWAY_PLIST_LABEL}.plist`);
|
|
27
|
-
var PROXY_PLIST_LABEL = "com.rulemetric.proxy";
|
|
28
|
-
var PROXY_PLIST_PATH = join(homedir(), "Library", "LaunchAgents", `${PROXY_PLIST_LABEL}.plist`);
|
|
29
|
-
var LOG_DIR = join(homedir(), ".config", "rulemetric", "logs");
|
|
30
|
-
var GATEWAY_PORT = 8787;
|
|
31
|
-
var PROXY_PORT = 8788;
|
|
32
|
-
var ServiceStatus = class extends BaseCommand {
|
|
33
|
-
static description = "Check the status of all RuleMetric launchd services";
|
|
34
|
-
async run() {
|
|
35
|
-
if (process.platform !== "darwin") {
|
|
36
|
-
this.error("Service status is currently macOS-only.");
|
|
37
|
-
}
|
|
38
|
-
if (!existsSync(PLIST_PATH)) {
|
|
39
|
-
this.log("Service: not installed");
|
|
40
|
-
this.log("Run: rulemetric service install");
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const apiState = this.readServiceState(PLIST_LABEL, PLIST_PATH);
|
|
44
|
-
const apiPort = this.readApiPort(PLIST_PATH);
|
|
45
|
-
const apiHealth = await this.probeApiHealth(apiPort);
|
|
46
|
-
const dashboardServed = await this.probeDashboard(apiPort);
|
|
47
|
-
const workerState = this.readServiceState(WORKER_PLIST_LABEL, WORKER_PLIST_PATH);
|
|
48
|
-
const workerMode = this.readWorkerMode();
|
|
49
|
-
const gatewayState = this.readServiceState(GATEWAY_PLIST_LABEL, GATEWAY_PLIST_PATH);
|
|
50
|
-
const gatewayListening = this.isPortListening(GATEWAY_PORT);
|
|
51
|
-
const proxyState = this.readServiceState(PROXY_PLIST_LABEL, PROXY_PLIST_PATH);
|
|
52
|
-
const proxyListening = this.isPortListening(PROXY_PORT);
|
|
53
|
-
const apiDetail = `${apiHealth} (port ${apiPort})${dashboardServed ? " \u2014 dashboard served" : ""}`;
|
|
54
|
-
this.log(`API: ${this.fmtState(apiState)} \u2014 ${apiDetail}`);
|
|
55
|
-
const modeSuffix = workerMode === "listen" ? " [mode: listen \u2014 DEPRECATED, run `rulemetric service install --force` to upgrade]" : "";
|
|
56
|
-
this.log(`Worker: ${this.fmtState(workerState)}${modeSuffix}`);
|
|
57
|
-
this.log(`Gateway: ${this.fmtState(gatewayState)} \u2014 ${gatewayListening ? `listening :${GATEWAY_PORT}` : `NOT listening :${GATEWAY_PORT}`}`);
|
|
58
|
-
this.log(`Proxy: ${this.fmtState(proxyState)} \u2014 ${proxyListening ? `listening :${PROXY_PORT}` : `NOT listening :${PROXY_PORT}`}`);
|
|
59
|
-
const tmux = await detectTmux();
|
|
60
|
-
this.log(`Tmux: ${tmux.available ? tmux.version ? `v${tmux.version}` : "available" : "not found"}`);
|
|
61
|
-
this.log("");
|
|
62
|
-
this.log(`Plists: ${PLIST_PATH}`);
|
|
63
|
-
this.log(` ${WORKER_PLIST_PATH}`);
|
|
64
|
-
if (gatewayState.installed) this.log(` ${GATEWAY_PLIST_PATH}`);
|
|
65
|
-
if (proxyState.installed) this.log(` ${PROXY_PLIST_PATH}`);
|
|
66
|
-
this.log(`Logs: ${LOG_DIR}/{api,worker,gateway,proxy}-{stdout,stderr}.log`);
|
|
67
|
-
const allHealthy = apiState.launchdStatus === "running" && apiHealth === "healthy" && workerState.launchdStatus === "running" && (!gatewayState.installed || gatewayState.launchdStatus === "running" && gatewayListening) && (!proxyState.installed || proxyState.launchdStatus === "running" && proxyListening);
|
|
68
|
-
this.log("");
|
|
69
|
-
if (allHealthy) {
|
|
70
|
-
this.log("All good \u2014 sessions tracked, jobs processed, capture pipeline live.");
|
|
71
|
-
} else {
|
|
72
|
-
if (apiState.launchdStatus !== "running") {
|
|
73
|
-
this.log("API is not running. Try:");
|
|
74
|
-
this.log(` launchctl kickstart gui/$(id -u)/${PLIST_LABEL}`);
|
|
75
|
-
}
|
|
76
|
-
if (workerState.installed && workerState.launchdStatus !== "running") {
|
|
77
|
-
this.log("Worker is not running. Try:");
|
|
78
|
-
this.log(` launchctl kickstart gui/$(id -u)/${WORKER_PLIST_LABEL}`);
|
|
79
|
-
}
|
|
80
|
-
if (gatewayState.installed && (gatewayState.launchdStatus !== "running" || !gatewayListening)) {
|
|
81
|
-
this.log("Gateway is not running. Try:");
|
|
82
|
-
this.log(` launchctl kickstart gui/$(id -u)/${GATEWAY_PLIST_LABEL}`);
|
|
83
|
-
}
|
|
84
|
-
if (proxyState.installed && (proxyState.launchdStatus !== "running" || !proxyListening)) {
|
|
85
|
-
this.log("Proxy is not running. Try:");
|
|
86
|
-
this.log(` launchctl kickstart gui/$(id -u)/${PROXY_PLIST_LABEL}`);
|
|
87
|
-
}
|
|
88
|
-
if (!gatewayState.installed || !proxyState.installed) {
|
|
89
|
-
this.log("Gateway/proxy not installed. Run: rulemetric service install --force");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
readServiceState(label, plistPath) {
|
|
94
|
-
const installed = existsSync(plistPath);
|
|
95
|
-
if (!installed) {
|
|
96
|
-
return { installed: false, launchdStatus: "not installed", pid: null };
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
const output = execSync(`launchctl list ${label} 2>/dev/null`, { encoding: "utf-8" });
|
|
100
|
-
const pidMatch = output.match(/"PID"\s*=\s*(\d+)/);
|
|
101
|
-
const statusMatch = output.match(/"LastExitStatus"\s*=\s*(\d+)/);
|
|
102
|
-
if (pidMatch) {
|
|
103
|
-
return { installed: true, launchdStatus: "running", pid: pidMatch[1] };
|
|
104
|
-
}
|
|
105
|
-
if (statusMatch) {
|
|
106
|
-
const code = statusMatch[1];
|
|
107
|
-
return {
|
|
108
|
-
installed: true,
|
|
109
|
-
launchdStatus: code === "0" ? "stopped (clean exit)" : `stopped (exit ${code})`,
|
|
110
|
-
pid: null
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
return { installed: true, launchdStatus: "loaded", pid: null };
|
|
114
|
-
} catch {
|
|
115
|
-
return { installed: true, launchdStatus: "not loaded", pid: null };
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
fmtState(state) {
|
|
119
|
-
if (!state.installed) return "not installed";
|
|
120
|
-
return `${state.launchdStatus}${state.pid ? ` (PID ${state.pid})` : ""}`;
|
|
121
|
-
}
|
|
122
|
-
readApiPort(plistPath) {
|
|
123
|
-
try {
|
|
124
|
-
const plistContent = readFileSync(plistPath, "utf-8");
|
|
125
|
-
const portMatch = plistContent.match(/<key>PORT<\/key>\s*<string>(\d+)<\/string>/);
|
|
126
|
-
if (portMatch) return Number.parseInt(portMatch[1]);
|
|
127
|
-
} catch {
|
|
128
|
-
}
|
|
129
|
-
return 3e3;
|
|
130
|
-
}
|
|
131
|
-
// Returns 'agent' | 'listen' | null. Used to flag the stale Phase 4c
|
|
132
|
-
// mode where the plist still says `evals listen` and would crash-loop.
|
|
133
|
-
readWorkerMode() {
|
|
134
|
-
if (!existsSync(WORKER_PLIST_PATH)) return null;
|
|
135
|
-
try {
|
|
136
|
-
const plistContent = readFileSync(WORKER_PLIST_PATH, "utf-8");
|
|
137
|
-
const match = plistContent.match(/<string>evals<\/string>\s*<string>(listen|agent)<\/string>/);
|
|
138
|
-
if (match) return match[1];
|
|
139
|
-
} catch {
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
async probeApiHealth(port) {
|
|
144
|
-
try {
|
|
145
|
-
const res = await fetch(`http://localhost:${port}/health`);
|
|
146
|
-
if (res.ok) return "healthy";
|
|
147
|
-
return `unhealthy (${res.status})`;
|
|
148
|
-
} catch {
|
|
149
|
-
return "unreachable";
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Probe `/` on the API. Returns true if it serves HTML (= web bundle
|
|
153
|
-
// is mounted). Differentiates "API runs but dashboard 404s because
|
|
154
|
-
// apps/web/dist is missing" from "API serves dashboard properly".
|
|
155
|
-
async probeDashboard(port) {
|
|
156
|
-
try {
|
|
157
|
-
const res = await fetch(`http://localhost:${port}/`);
|
|
158
|
-
if (!res.ok) return false;
|
|
159
|
-
const contentType = res.headers.get("content-type") ?? "";
|
|
160
|
-
return contentType.includes("text/html");
|
|
161
|
-
} catch {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
isPortListening(port) {
|
|
166
|
-
try {
|
|
167
|
-
const out = execFileSync("lsof", ["-ti", `:${port}`, "-sTCP:LISTEN"], {
|
|
168
|
-
encoding: "utf-8",
|
|
169
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
170
|
-
});
|
|
171
|
-
return out.trim().length > 0;
|
|
172
|
-
} catch {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
export {
|
|
178
|
-
ServiceStatus as default
|
|
179
|
-
};
|
|
180
|
-
//# sourceMappingURL=status.js.map
|
|
1
|
+
import{a as b}from"../../chunk-6XEC6474.js";import"../../chunk-N7ODX6PO.js";import{a as A}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 T}from"../../chunk-ZLLER3HP.js";import{existsSync as S,readFileSync as k}from"node:fs";import{execFileSync as E,execSync as O}from"node:child_process";import{homedir as a}from"node:os";import{join as l}from"node:path";var y="com.rulemetric.api",u=l(a(),"Library","LaunchAgents",`${y}.plist`),$="com.rulemetric.worker",h=l(a(),"Library","LaunchAgents",`${$}.plist`),P="com.rulemetric.gateway",x=l(a(),"Library","LaunchAgents",`${P}.plist`),L="com.rulemetric.proxy",w=l(a(),"Library","LaunchAgents",`${L}.plist`),W=l(a(),".config","rulemetric","logs"),m=8787,f=8788,v=class extends A{static{T(this,"ServiceStatus")}static description="Check the status of all RuleMetric launchd services";async run(){if(process.platform!=="darwin"&&this.error("Service status is currently macOS-only."),!S(u)){this.log("Service: not installed"),this.log("Run: rulemetric service install");return}let t=this.readServiceState(y,u),e=this.readApiPort(u),i=await this.probeApiHealth(e),o=await this.probeDashboard(e),s=this.readServiceState($,h),c=this.readWorkerMode(),n=this.readServiceState(P,x),d=this.isPortListening(m),r=this.readServiceState(L,w),g=this.isPortListening(f),_=`${i} (port ${e})${o?" \u2014 dashboard served":""}`;this.log(`API: ${this.fmtState(t)} \u2014 ${_}`);let I=c==="listen"?" [mode: listen \u2014 DEPRECATED, run `rulemetric service install --force` to upgrade]":"";this.log(`Worker: ${this.fmtState(s)}${I}`),this.log(`Gateway: ${this.fmtState(n)} \u2014 ${d?`listening :${m}`:`NOT listening :${m}`}`),this.log(`Proxy: ${this.fmtState(r)} \u2014 ${g?`listening :${f}`:`NOT listening :${f}`}`);let p=await b();this.log(`Tmux: ${p.available?p.version?`v${p.version}`:"available":"not found"}`),this.log(""),this.log(`Plists: ${u}`),this.log(` ${h}`),n.installed&&this.log(` ${x}`),r.installed&&this.log(` ${w}`),this.log(`Logs: ${W}/{api,worker,gateway,proxy}-{stdout,stderr}.log`);let R=t.launchdStatus==="running"&&i==="healthy"&&s.launchdStatus==="running"&&(!n.installed||n.launchdStatus==="running"&&d)&&(!r.installed||r.launchdStatus==="running"&&g);this.log(""),R?this.log("All good \u2014 sessions tracked, jobs processed, capture pipeline live."):(t.launchdStatus!=="running"&&(this.log("API is not running. Try:"),this.log(` launchctl kickstart gui/$(id -u)/${y}`)),s.installed&&s.launchdStatus!=="running"&&(this.log("Worker is not running. Try:"),this.log(` launchctl kickstart gui/$(id -u)/${$}`)),n.installed&&(n.launchdStatus!=="running"||!d)&&(this.log("Gateway is not running. Try:"),this.log(` launchctl kickstart gui/$(id -u)/${P}`)),r.installed&&(r.launchdStatus!=="running"||!g)&&(this.log("Proxy is not running. Try:"),this.log(` launchctl kickstart gui/$(id -u)/${L}`)),(!n.installed||!r.installed)&&this.log("Gateway/proxy not installed. Run: rulemetric service install --force"))}readServiceState(t,e){if(!S(e))return{installed:!1,launchdStatus:"not installed",pid:null};try{let o=O(`launchctl list ${t} 2>/dev/null`,{encoding:"utf-8"}),s=o.match(/"PID"\s*=\s*(\d+)/),c=o.match(/"LastExitStatus"\s*=\s*(\d+)/);if(s)return{installed:!0,launchdStatus:"running",pid:s[1]};if(c){let n=c[1];return{installed:!0,launchdStatus:n==="0"?"stopped (clean exit)":`stopped (exit ${n})`,pid:null}}return{installed:!0,launchdStatus:"loaded",pid:null}}catch{return{installed:!0,launchdStatus:"not loaded",pid:null}}}fmtState(t){return t.installed?`${t.launchdStatus}${t.pid?` (PID ${t.pid})`:""}`:"not installed"}readApiPort(t){try{let i=k(t,"utf-8").match(/<key>PORT<\/key>\s*<string>(\d+)<\/string>/);if(i)return Number.parseInt(i[1])}catch{}return 3e3}readWorkerMode(){if(!S(h))return null;try{let e=k(h,"utf-8").match(/<string>evals<\/string>\s*<string>(listen|agent)<\/string>/);if(e)return e[1]}catch{}return null}async probeApiHealth(t){try{let e=await fetch(`http://localhost:${t}/health`);return e.ok?"healthy":`unhealthy (${e.status})`}catch{return"unreachable"}}async probeDashboard(t){try{let e=await fetch(`http://localhost:${t}/`);return e.ok?(e.headers.get("content-type")??"").includes("text/html"):!1}catch{return!1}}isPortListening(t){try{return E("lsof",["-ti",`:${t}`,"-sTCP:LISTEN"],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim().length>0}catch{return!1}}};export{v as default};
|
|
@@ -1,119 +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/service/uninstall.ts
|
|
13
|
-
import { existsSync, unlinkSync } from "node:fs";
|
|
14
|
-
import { execSync, execFileSync } from "node:child_process";
|
|
15
|
-
import { homedir } from "node:os";
|
|
16
|
-
import { join } from "node:path";
|
|
17
|
-
var SERVICES = [
|
|
18
|
-
{ label: "com.rulemetric.api", description: "API" },
|
|
19
|
-
{ label: "com.rulemetric.worker", description: "Worker" },
|
|
20
|
-
{ label: "com.rulemetric.gateway", description: "Gateway" },
|
|
21
|
-
{ label: "com.rulemetric.proxy", description: "Proxy" },
|
|
22
|
-
// Legacy daily worker-restart agent — install removes any stale copy,
|
|
23
|
-
// but uninstall still cleans it up so a user running uninstall on an
|
|
24
|
-
// older box gets a fully clean state.
|
|
25
|
-
{ label: "com.rulemetric.worker.restart", description: "Worker restart agent" }
|
|
26
|
-
];
|
|
27
|
-
function plistPathFor(label) {
|
|
28
|
-
return join(homedir(), "Library", "LaunchAgents", `${label}.plist`);
|
|
29
|
-
}
|
|
30
|
-
var WORKER_SYSTEMD_UNIT = "rulemetric-worker.service";
|
|
31
|
-
var WORKER_SYSTEMD_PATH = join(homedir(), ".config", "systemd", "user", WORKER_SYSTEMD_UNIT);
|
|
32
|
-
var ServiceUninstall = class extends BaseCommand {
|
|
33
|
-
static description = "Remove RuleMetric services (macOS launchd: API/worker/gateway/proxy; Linux: the --worker-only systemd unit)";
|
|
34
|
-
async run() {
|
|
35
|
-
if (process.platform === "linux") {
|
|
36
|
-
this.uninstallLinuxWorker();
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (process.platform !== "darwin") {
|
|
40
|
-
this.error("Service uninstall supports macOS (launchd) and Linux (systemd) only.");
|
|
41
|
-
}
|
|
42
|
-
const installed = SERVICES.filter((s) => existsSync(plistPathFor(s.label)));
|
|
43
|
-
if (installed.length === 0) {
|
|
44
|
-
this.log("No RuleMetric services are installed.");
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const uid = execSync("id -u", { encoding: "utf-8" }).trim();
|
|
48
|
-
for (const svc of installed) {
|
|
49
|
-
const path = plistPathFor(svc.label);
|
|
50
|
-
this.stopService(uid, path, svc.label, svc.description);
|
|
51
|
-
this.removePlist(path, svc.description);
|
|
52
|
-
}
|
|
53
|
-
this.log("");
|
|
54
|
-
this.log("All RuleMetric services removed. They will no longer start automatically.");
|
|
55
|
-
this.log("Use scripts/start.sh (dev) or `rulemetric service install` (always-on) to bring them back.");
|
|
56
|
-
}
|
|
57
|
-
stopService(uid, plistPath, label, description) {
|
|
58
|
-
try {
|
|
59
|
-
execFileSync("launchctl", ["bootout", `gui/${uid}`, plistPath], { encoding: "utf-8" });
|
|
60
|
-
this.log(`[OK] ${description} stopped`);
|
|
61
|
-
return;
|
|
62
|
-
} catch {
|
|
63
|
-
}
|
|
64
|
-
try {
|
|
65
|
-
execFileSync("launchctl", ["unload", plistPath], { encoding: "utf-8" });
|
|
66
|
-
this.log(`[OK] ${description} stopped (legacy)`);
|
|
67
|
-
return;
|
|
68
|
-
} catch {
|
|
69
|
-
try {
|
|
70
|
-
const output = execSync(`launchctl list ${label} 2>&1`, { encoding: "utf-8" });
|
|
71
|
-
if (output.includes("PID")) {
|
|
72
|
-
this.warn(`${description} appears to still be running. Try manually:`);
|
|
73
|
-
this.warn(` launchctl bootout gui/${uid} "${plistPath}"`);
|
|
74
|
-
} else {
|
|
75
|
-
this.log(`[OK] ${description} was not running`);
|
|
76
|
-
}
|
|
77
|
-
} catch {
|
|
78
|
-
this.log(`[OK] ${description} was not running`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
removePlist(plistPath, description) {
|
|
83
|
-
try {
|
|
84
|
-
unlinkSync(plistPath);
|
|
85
|
-
this.log(`[OK] Removed ${plistPath}`);
|
|
86
|
-
} catch (err) {
|
|
87
|
-
this.warn(`Could not remove ${description} plist: ${err.message}. Try: rm "${plistPath}"`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
uninstallLinuxWorker() {
|
|
91
|
-
if (!existsSync(WORKER_SYSTEMD_PATH)) {
|
|
92
|
-
this.log("No RuleMetric worker is installed (no systemd unit found).");
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
try {
|
|
96
|
-
execFileSync("systemctl", ["--user", "disable", "--now", WORKER_SYSTEMD_UNIT], { encoding: "utf-8" });
|
|
97
|
-
this.log("[OK] Worker stopped + disabled (systemctl --user)");
|
|
98
|
-
} catch (err) {
|
|
99
|
-
this.warn(`Could not disable the worker unit: ${err.message}`);
|
|
100
|
-
this.warn(` systemctl --user disable --now ${WORKER_SYSTEMD_UNIT}`);
|
|
101
|
-
}
|
|
102
|
-
try {
|
|
103
|
-
unlinkSync(WORKER_SYSTEMD_PATH);
|
|
104
|
-
this.log(`[OK] Removed ${WORKER_SYSTEMD_PATH}`);
|
|
105
|
-
} catch (err) {
|
|
106
|
-
this.warn(`Could not remove ${WORKER_SYSTEMD_PATH}: ${err.message}. Try: rm "${WORKER_SYSTEMD_PATH}"`);
|
|
107
|
-
}
|
|
108
|
-
try {
|
|
109
|
-
execFileSync("systemctl", ["--user", "daemon-reload"], { encoding: "utf-8" });
|
|
110
|
-
} catch {
|
|
111
|
-
}
|
|
112
|
-
this.log("");
|
|
113
|
-
this.log("RuleMetric worker removed. It will no longer start automatically.");
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
export {
|
|
117
|
-
ServiceUninstall as default
|
|
118
|
-
};
|
|
119
|
-
//# sourceMappingURL=uninstall.js.map
|
|
1
|
+
import{a as u}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 n}from"../../chunk-ZLLER3HP.js";import{existsSync as m,unlinkSync as d}from"node:fs";import{execSync as g,execFileSync as s}from"node:child_process";import{homedir as y}from"node:os";import{join as p}from"node:path";var v=[{label:"com.rulemetric.api",description:"API"},{label:"com.rulemetric.worker",description:"Worker"},{label:"com.rulemetric.gateway",description:"Gateway"},{label:"com.rulemetric.proxy",description:"Proxy"},{label:"com.rulemetric.worker.restart",description:"Worker restart agent"}];function h(a){return p(y(),"Library","LaunchAgents",`${a}.plist`)}n(h,"plistPathFor");var l="rulemetric-worker.service",i=p(y(),".config","systemd","user",l),c=class extends u{static{n(this,"ServiceUninstall")}static description="Remove RuleMetric services (macOS launchd: API/worker/gateway/proxy; Linux: the --worker-only systemd unit)";async run(){if(process.platform==="linux"){this.uninstallLinuxWorker();return}process.platform!=="darwin"&&this.error("Service uninstall supports macOS (launchd) and Linux (systemd) only.");let r=v.filter(t=>m(h(t.label)));if(r.length===0){this.log("No RuleMetric services are installed.");return}let o=g("id -u",{encoding:"utf-8"}).trim();for(let t of r){let e=h(t.label);this.stopService(o,e,t.label,t.description),this.removePlist(e,t.description)}this.log(""),this.log("All RuleMetric services removed. They will no longer start automatically."),this.log("Use scripts/start.sh (dev) or `rulemetric service install` (always-on) to bring them back.")}stopService(r,o,t,e){try{s("launchctl",["bootout",`gui/${r}`,o],{encoding:"utf-8"}),this.log(`[OK] ${e} stopped`);return}catch{}try{s("launchctl",["unload",o],{encoding:"utf-8"}),this.log(`[OK] ${e} stopped (legacy)`);return}catch{try{g(`launchctl list ${t} 2>&1`,{encoding:"utf-8"}).includes("PID")?(this.warn(`${e} appears to still be running. Try manually:`),this.warn(` launchctl bootout gui/${r} "${o}"`)):this.log(`[OK] ${e} was not running`)}catch{this.log(`[OK] ${e} was not running`)}}}removePlist(r,o){try{d(r),this.log(`[OK] Removed ${r}`)}catch(t){this.warn(`Could not remove ${o} plist: ${t.message}. Try: rm "${r}"`)}}uninstallLinuxWorker(){if(!m(i)){this.log("No RuleMetric worker is installed (no systemd unit found).");return}try{s("systemctl",["--user","disable","--now",l],{encoding:"utf-8"}),this.log("[OK] Worker stopped + disabled (systemctl --user)")}catch(r){this.warn(`Could not disable the worker unit: ${r.message}`),this.warn(` systemctl --user disable --now ${l}`)}try{d(i),this.log(`[OK] Removed ${i}`)}catch(r){this.warn(`Could not remove ${i}: ${r.message}. Try: rm "${i}"`)}try{s("systemctl",["--user","daemon-reload"],{encoding:"utf-8"})}catch{}this.log(""),this.log("RuleMetric worker removed. It will no longer start automatically.")}};export{c as default};
|
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
import {
|
|
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
|
-
apiPost
|
|
13
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
14
|
-
import "../../chunk-W2YERO7E.js";
|
|
15
|
-
import "../../chunk-NSBPE2FW.js";
|
|
16
|
-
|
|
17
|
-
// src/commands/sessions/analyze.ts
|
|
18
|
-
import { Args } from "@oclif/core";
|
|
19
|
-
var SessionsAnalyze = class _SessionsAnalyze extends BaseCommand {
|
|
20
|
-
static description = "Trigger AI analysis on a session";
|
|
21
|
-
static examples = [
|
|
22
|
-
"<%= config.bin %> sessions analyze <session-id>"
|
|
23
|
-
];
|
|
24
|
-
static args = {
|
|
25
|
-
id: Args.string({ description: "Session ID", required: true })
|
|
26
|
-
};
|
|
27
|
-
async run() {
|
|
28
|
-
const { args } = await this.parse(_SessionsAnalyze);
|
|
29
|
-
this.requireAuth();
|
|
30
|
-
validateUuid(args.id, "session ID");
|
|
31
|
-
this.log("Analyzing session...");
|
|
32
|
-
const result = await apiPost(
|
|
33
|
-
`/api/sessions/${args.id}/analyze`,
|
|
34
|
-
{}
|
|
35
|
-
);
|
|
36
|
-
this.log(`
|
|
37
|
-
Adherence Score: ${result.adherenceScore}/100`);
|
|
38
|
-
this.log(`Summary: ${result.summary}`);
|
|
39
|
-
if (result.suggestions.length > 0) {
|
|
40
|
-
this.log(`
|
|
41
|
-
${result.suggestions.length} suggestion(s) for instruction improvement.`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
SessionsAnalyze as default
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=analyze.js.map
|
|
1
|
+
import{a as t}from"../../chunk-WLVQJH4E.js";import{a as n}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import{e as o}from"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as r}from"../../chunk-ZLLER3HP.js";import{Args as g}from"@oclif/core";var i=class a extends n{static{r(this,"SessionsAnalyze")}static description="Trigger AI analysis on a session";static examples=["<%= config.bin %> sessions analyze <session-id>"];static args={id:g.string({description:"Session ID",required:!0})};async run(){let{args:e}=await this.parse(a);this.requireAuth(),t(e.id,"session ID"),this.log("Analyzing session...");let s=await o(`/api/sessions/${e.id}/analyze`,{});this.log(`
|
|
2
|
+
Adherence Score: ${s.adherenceScore}/100`),this.log(`Summary: ${s.summary}`),s.suggestions.length>0&&this.log(`
|
|
3
|
+
${s.suggestions.length} suggestion(s) for instruction improvement.`)}};export{i as default};
|
|
@@ -1,85 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
-
apiPatch
|
|
10
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
11
|
-
import "../../chunk-W2YERO7E.js";
|
|
12
|
-
import "../../chunk-NSBPE2FW.js";
|
|
13
|
-
|
|
14
|
-
// src/commands/sessions/end.ts
|
|
15
|
-
import { readdirSync, readFileSync, unlinkSync, statSync } from "node:fs";
|
|
16
|
-
import { tmpdir } from "node:os";
|
|
17
|
-
import { join } from "node:path";
|
|
18
|
-
var SKIP_SUFFIXES = [".log", ".seq", ".ctxhash", ".pid", ".lock"];
|
|
19
|
-
var SessionsEnd = class _SessionsEnd extends BaseCommand {
|
|
20
|
-
static description = "End the active capture session";
|
|
21
|
-
static examples = [
|
|
22
|
-
"<%= config.bin %> sessions end"
|
|
23
|
-
];
|
|
24
|
-
async run() {
|
|
25
|
-
await this.parse(_SessionsEnd);
|
|
26
|
-
this.requireAuth();
|
|
27
|
-
const sessionDir = join(tmpdir(), "rulemetric");
|
|
28
|
-
const active = this.findActiveSession(sessionDir);
|
|
29
|
-
if (!active) {
|
|
30
|
-
this.error("No active session found. Start one with: rulemetric sessions start --tool <name>");
|
|
31
|
-
}
|
|
32
|
-
try {
|
|
33
|
-
await apiPatch(`/api/sessions/${active.rwSessionId}`, {
|
|
34
|
-
endedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
35
|
-
});
|
|
36
|
-
} catch (err) {
|
|
37
|
-
this.warn(`Could not end session via API: ${err.message}`);
|
|
38
|
-
}
|
|
39
|
-
this.cleanupSessionFiles(sessionDir, active.externalId);
|
|
40
|
-
this.log(`Session ended: ${active.rwSessionId}`);
|
|
41
|
-
}
|
|
42
|
-
findActiveSession(sessionDir) {
|
|
43
|
-
let files;
|
|
44
|
-
try {
|
|
45
|
-
files = readdirSync(sessionDir);
|
|
46
|
-
} catch {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
const sessions = [];
|
|
50
|
-
for (const name of files) {
|
|
51
|
-
if (SKIP_SUFFIXES.some((s) => name.endsWith(s))) continue;
|
|
52
|
-
const path = join(sessionDir, name);
|
|
53
|
-
try {
|
|
54
|
-
const stat = statSync(path);
|
|
55
|
-
if (!stat.isFile()) continue;
|
|
56
|
-
const content = readFileSync(path, "utf-8").trim();
|
|
57
|
-
if (!content) continue;
|
|
58
|
-
sessions.push({
|
|
59
|
-
externalId: name,
|
|
60
|
-
rwSessionId: content.split("\n")[0].trim(),
|
|
61
|
-
path,
|
|
62
|
-
mtime: stat.mtimeMs
|
|
63
|
-
});
|
|
64
|
-
} catch {
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (sessions.length === 0) return null;
|
|
69
|
-
sessions.sort((a, b) => b.mtime - a.mtime);
|
|
70
|
-
return sessions[0];
|
|
71
|
-
}
|
|
72
|
-
cleanupSessionFiles(sessionDir, externalId) {
|
|
73
|
-
const base = join(sessionDir, externalId);
|
|
74
|
-
for (const suffix of ["", ".seq", ".ctxhash", ".log"]) {
|
|
75
|
-
try {
|
|
76
|
-
unlinkSync(base + suffix);
|
|
77
|
-
} catch {
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
export {
|
|
83
|
-
SessionsEnd as default
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=end.js.map
|
|
1
|
+
import{a as d}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import{g as m}from"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as l}from"../../chunk-ZLLER3HP.js";import{readdirSync as f,readFileSync as h,unlinkSync as p,statSync as S}from"node:fs";import{tmpdir as g}from"node:os";import{join as o}from"node:path";var v=[".log",".seq",".ctxhash",".pid",".lock"],a=class u extends d{static{l(this,"SessionsEnd")}static description="End the active capture session";static examples=["<%= config.bin %> sessions end"];async run(){await this.parse(u),this.requireAuth();let s=o(g(),"rulemetric"),t=this.findActiveSession(s);t||this.error("No active session found. Start one with: rulemetric sessions start --tool <name>");try{await m(`/api/sessions/${t.rwSessionId}`,{endedAt:new Date().toISOString()})}catch(e){this.warn(`Could not end session via API: ${e.message}`)}this.cleanupSessionFiles(s,t.externalId),this.log(`Session ended: ${t.rwSessionId}`)}findActiveSession(s){let t;try{t=f(s)}catch{return null}let e=[];for(let i of t){if(v.some(r=>i.endsWith(r)))continue;let n=o(s,i);try{let r=S(n);if(!r.isFile())continue;let c=h(n,"utf-8").trim();if(!c)continue;e.push({externalId:i,rwSessionId:c.split(`
|
|
2
|
+
`)[0].trim(),path:n,mtime:r.mtimeMs})}catch{continue}}return e.length===0?null:(e.sort((i,n)=>n.mtime-i.mtime),e[0])}cleanupSessionFiles(s,t){let e=o(s,t);for(let i of["",".seq",".ctxhash",".log"])try{p(e+i)}catch{}}};export{a as default};
|
|
@@ -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 {
|
|
9
|
-
apiPost
|
|
10
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
11
|
-
import "../../chunk-W2YERO7E.js";
|
|
12
|
-
import "../../chunk-NSBPE2FW.js";
|
|
13
|
-
|
|
14
|
-
// src/commands/sessions/import.ts
|
|
15
|
-
import * as fs from "node:fs";
|
|
16
|
-
import { Args, Flags } from "@oclif/core";
|
|
17
|
-
var SessionsImport = class _SessionsImport extends BaseCommand {
|
|
18
|
-
static description = "Import a session file (JSONL, JSON)";
|
|
19
|
-
static examples = [
|
|
20
|
-
"<%= config.bin %> sessions import ~/.claude/projects/my-project/session-abc.jsonl",
|
|
21
|
-
"<%= config.bin %> sessions import ./copilot-export.json --tool vscode_copilot"
|
|
22
|
-
];
|
|
23
|
-
static args = {
|
|
24
|
-
path: Args.string({ description: "Path to session file", required: true })
|
|
25
|
-
};
|
|
26
|
-
static flags = {
|
|
27
|
-
tool: Flags.string({ description: "Override tool detection (claude_code, cursor, vscode_copilot)" })
|
|
28
|
-
};
|
|
29
|
-
async run() {
|
|
30
|
-
const { args, flags } = await this.parse(_SessionsImport);
|
|
31
|
-
this.requireAuth();
|
|
32
|
-
if (!fs.existsSync(args.path)) {
|
|
33
|
-
this.error(`File not found: ${args.path}`);
|
|
34
|
-
}
|
|
35
|
-
const content = fs.readFileSync(args.path, "utf-8");
|
|
36
|
-
const result = await apiPost(
|
|
37
|
-
"/api/sessions/import",
|
|
38
|
-
{ content, tool: flags.tool }
|
|
39
|
-
);
|
|
40
|
-
this.log(`Imported session ${result.id} (${result.tool}, ${result.eventCount} events)`);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
SessionsImport as default
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=import.js.map
|
|
1
|
+
import{a as n}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import{e as r}from"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as i}from"../../chunk-ZLLER3HP.js";import*as o from"node:fs";import{Args as l,Flags as d}from"@oclif/core";var e=class a extends n{static{i(this,"SessionsImport")}static description="Import a session file (JSONL, JSON)";static examples=["<%= config.bin %> sessions import ~/.claude/projects/my-project/session-abc.jsonl","<%= config.bin %> sessions import ./copilot-export.json --tool vscode_copilot"];static args={path:l.string({description:"Path to session file",required:!0})};static flags={tool:d.string({description:"Override tool detection (claude_code, cursor, vscode_copilot)"})};async run(){let{args:t,flags:c}=await this.parse(a);this.requireAuth(),o.existsSync(t.path)||this.error(`File not found: ${t.path}`);let p=o.readFileSync(t.path,"utf-8"),s=await r("/api/sessions/import",{content:p,tool:c.tool});this.log(`Imported session ${s.id} (${s.tool}, ${s.eventCount} events)`)}};export{e as default};
|
|
@@ -1,48 +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
|
-
apiGet
|
|
10
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
11
|
-
import "../../chunk-W2YERO7E.js";
|
|
12
|
-
import "../../chunk-NSBPE2FW.js";
|
|
13
|
-
|
|
14
|
-
// src/commands/sessions/list.ts
|
|
15
|
-
import { Flags } from "@oclif/core";
|
|
16
|
-
var SessionsList = class _SessionsList extends BaseCommand {
|
|
17
|
-
static description = "List captured sessions";
|
|
18
|
-
static examples = [
|
|
19
|
-
"<%= config.bin %> sessions list",
|
|
20
|
-
"<%= config.bin %> sessions list --tool claude_code"
|
|
21
|
-
];
|
|
22
|
-
static flags = {
|
|
23
|
-
tool: Flags.string({ description: "Filter by tool (claude_code, cursor, vscode_copilot)" }),
|
|
24
|
-
limit: Flags.integer({ description: "Max results", default: 20 })
|
|
25
|
-
};
|
|
26
|
-
async run() {
|
|
27
|
-
const { flags } = await this.parse(_SessionsList);
|
|
28
|
-
this.requireAuth();
|
|
29
|
-
const params = new URLSearchParams();
|
|
30
|
-
if (flags.tool) params.set("tool", flags.tool);
|
|
31
|
-
params.set("limit", String(flags.limit));
|
|
32
|
-
const sessions = await apiGet(`/api/sessions?${params}`);
|
|
33
|
-
if (sessions.length === 0) {
|
|
34
|
-
this.log("No sessions found.");
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
for (const s of sessions) {
|
|
38
|
-
const project = s.projectPath?.split("/").pop() ?? "\u2014";
|
|
39
|
-
const adherence = s.analysis?.adherenceScore != null ? `${s.analysis.adherenceScore}%` : "\u2014";
|
|
40
|
-
const date = new Date(s.startedAt).toLocaleDateString();
|
|
41
|
-
this.log(`${s.id.slice(0, 8)} ${s.tool.padEnd(15)} ${project.padEnd(20)} ${String(s.eventCount).padStart(5)} events ${adherence.padStart(4)} adherence ${date}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
SessionsList as default
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=list.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{d as n}from"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as r}from"../../chunk-ZLLER3HP.js";import{Flags as c}from"@oclif/core";var o=class l extends a{static{r(this,"SessionsList")}static description="List captured sessions";static examples=["<%= config.bin %> sessions list","<%= config.bin %> sessions list --tool claude_code"];static flags={tool:c.string({description:"Filter by tool (claude_code, cursor, vscode_copilot)"}),limit:c.integer({description:"Max results",default:20})};async run(){let{flags:e}=await this.parse(l);this.requireAuth();let s=new URLSearchParams;e.tool&&s.set("tool",e.tool),s.set("limit",String(e.limit));let i=await n(`/api/sessions?${s}`);if(i.length===0){this.log("No sessions found.");return}for(let t of i){let d=t.projectPath?.split("/").pop()??"\u2014",p=t.analysis?.adherenceScore!=null?`${t.analysis.adherenceScore}%`:"\u2014",m=new Date(t.startedAt).toLocaleDateString();this.log(`${t.id.slice(0,8)} ${t.tool.padEnd(15)} ${d.padEnd(20)} ${String(t.eventCount).padStart(5)} events ${p.padStart(4)} adherence ${m}`)}}};export{o as default};
|
|
@@ -1,90 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
import "../../chunk-R56PH7YE.js";
|
|
5
|
-
import "../../chunk-GQNJO2P2.js";
|
|
6
|
-
import "../../chunk-37LN5O7M.js";
|
|
7
|
-
import {
|
|
8
|
-
readActiveOrg
|
|
9
|
-
} from "../../chunk-EKJ2CABV.js";
|
|
10
|
-
import {
|
|
11
|
-
apiPost
|
|
12
|
-
} from "../../chunk-ZUJBM6HE.js";
|
|
13
|
-
import "../../chunk-W2YERO7E.js";
|
|
14
|
-
import "../../chunk-NSBPE2FW.js";
|
|
15
|
-
|
|
16
|
-
// src/commands/sessions/start.ts
|
|
17
|
-
import { Flags } from "@oclif/core";
|
|
18
|
-
import { randomUUID } from "node:crypto";
|
|
19
|
-
import { mkdirSync, writeFileSync } from "node:fs";
|
|
20
|
-
import { tmpdir } from "node:os";
|
|
21
|
-
import { join } from "node:path";
|
|
22
|
-
import { execSync } from "node:child_process";
|
|
23
|
-
var SessionsStart = class _SessionsStart extends BaseCommand {
|
|
24
|
-
static description = "Start a capture session for any LLM provider (Cortex, Groq, etc.)";
|
|
25
|
-
static examples = [
|
|
26
|
-
"<%= config.bin %> sessions start --tool cortex",
|
|
27
|
-
"<%= config.bin %> sessions start --tool groq --project-dir /path/to/project",
|
|
28
|
-
'eval "$(rulemetric proxy env --python)" && rulemetric sessions start --tool cortex'
|
|
29
|
-
];
|
|
30
|
-
static flags = {
|
|
31
|
-
tool: Flags.string({
|
|
32
|
-
char: "t",
|
|
33
|
-
required: true,
|
|
34
|
-
description: "LLM provider or tool name (e.g., cortex, groq, deepseek, custom_app)"
|
|
35
|
-
}),
|
|
36
|
-
"project-dir": Flags.string({
|
|
37
|
-
char: "d",
|
|
38
|
-
description: "Project directory (defaults to cwd)"
|
|
39
|
-
})
|
|
40
|
-
};
|
|
41
|
-
async run() {
|
|
42
|
-
const { flags } = await this.parse(_SessionsStart);
|
|
43
|
-
this.requireAuth();
|
|
44
|
-
const projectPath = flags["project-dir"] ?? process.cwd();
|
|
45
|
-
const externalSessionId = randomUUID();
|
|
46
|
-
let gitBranch = "";
|
|
47
|
-
try {
|
|
48
|
-
gitBranch = execSync("git branch --show-current 2>/dev/null", {
|
|
49
|
-
cwd: projectPath,
|
|
50
|
-
encoding: "utf-8"
|
|
51
|
-
}).trim();
|
|
52
|
-
} catch {
|
|
53
|
-
}
|
|
54
|
-
let gitRemote = "";
|
|
55
|
-
try {
|
|
56
|
-
gitRemote = execSync("git remote get-url origin 2>/dev/null", {
|
|
57
|
-
cwd: projectPath,
|
|
58
|
-
encoding: "utf-8"
|
|
59
|
-
}).trim();
|
|
60
|
-
} catch {
|
|
61
|
-
}
|
|
62
|
-
const metadata = {};
|
|
63
|
-
if (gitRemote) metadata.gitRemote = gitRemote;
|
|
64
|
-
const activeOrg = readActiveOrg();
|
|
65
|
-
const session = await apiPost("/api/sessions", {
|
|
66
|
-
tool: flags.tool,
|
|
67
|
-
externalSessionId,
|
|
68
|
-
projectPath,
|
|
69
|
-
gitBranch,
|
|
70
|
-
metadata,
|
|
71
|
-
orgId: activeOrg?.orgId ?? null
|
|
72
|
-
});
|
|
73
|
-
const sessionDir = join(tmpdir(), "rulemetric");
|
|
74
|
-
mkdirSync(sessionDir, { recursive: true });
|
|
75
|
-
const sessionFile = join(sessionDir, externalSessionId);
|
|
76
|
-
writeFileSync(sessionFile, session.id + "\n");
|
|
77
|
-
writeFileSync(sessionFile + ".seq", "0\n");
|
|
78
|
-
this.log(`Session started: ${session.id}`);
|
|
79
|
-
this.log(` Tool: ${flags.tool}`);
|
|
80
|
-
this.log(` Project: ${projectPath}`);
|
|
81
|
-
if (gitBranch) this.log(` Branch: ${gitBranch}`);
|
|
82
|
-
this.log("");
|
|
83
|
-
this.log("The proxy will now capture LLM traffic for this session.");
|
|
84
|
-
this.log("When done, run: rulemetric sessions end");
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
export {
|
|
88
|
-
SessionsStart as default
|
|
89
|
-
};
|
|
90
|
-
//# sourceMappingURL=start.js.map
|
|
1
|
+
import{a as g}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import{a as m}from"../../chunk-3AV3GTMP.js";import{e as p}from"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as d}from"../../chunk-ZLLER3HP.js";import{Flags as h}from"@oclif/core";import{randomUUID as w}from"node:crypto";import{mkdirSync as j,writeFileSync as u}from"node:fs";import{tmpdir as S}from"node:os";import{join as f}from"node:path";import{execSync as v}from"node:child_process";var i=class x extends g{static{d(this,"SessionsStart")}static description="Start a capture session for any LLM provider (Cortex, Groq, etc.)";static examples=["<%= config.bin %> sessions start --tool cortex","<%= config.bin %> sessions start --tool groq --project-dir /path/to/project",'eval "$(rulemetric proxy env --python)" && rulemetric sessions start --tool cortex'];static flags={tool:h.string({char:"t",required:!0,description:"LLM provider or tool name (e.g., cortex, groq, deepseek, custom_app)"}),"project-dir":h.string({char:"d",description:"Project directory (defaults to cwd)"})};async run(){let{flags:r}=await this.parse(x);this.requireAuth();let t=r["project-dir"]??process.cwd(),s=w(),o="";try{o=v("git branch --show-current 2>/dev/null",{cwd:t,encoding:"utf-8"}).trim()}catch{}let e="";try{e=v("git remote get-url origin 2>/dev/null",{cwd:t,encoding:"utf-8"}).trim()}catch{}let n={};e&&(n.gitRemote=e);let y=m(),c=await p("/api/sessions",{tool:r.tool,externalSessionId:s,projectPath:t,gitBranch:o,metadata:n,orgId:y?.orgId??null}),a=f(S(),"rulemetric");j(a,{recursive:!0});let l=f(a,s);u(l,c.id+`
|
|
2
|
+
`),u(l+".seq",`0
|
|
3
|
+
`),this.log(`Session started: ${c.id}`),this.log(` Tool: ${r.tool}`),this.log(` Project: ${t}`),o&&this.log(` Branch: ${o}`),this.log(""),this.log("The proxy will now capture LLM traffic for this session."),this.log("When done, run: rulemetric sessions end")}};export{i as default};
|