@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,454 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// src/commands/proxy/setup.ts
|
|
18
|
-
import { Flags } from "@oclif/core";
|
|
19
|
-
import { execSync, spawnSync } from "node:child_process";
|
|
20
|
-
import { existsSync, readFileSync, appendFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
21
|
-
import { homedir } from "node:os";
|
|
22
|
-
import { dirname, join } from "node:path";
|
|
23
|
-
var CERT_PATH = join(homedir(), ".mitmproxy", "mitmproxy-ca-cert.pem");
|
|
24
|
-
var CONFIG_DIR = join(homedir(), ".config", "rulemetric");
|
|
25
|
-
var DEFAULT_PORT = 8787;
|
|
26
|
-
var ProxySetup = class _ProxySetup extends BaseCommand {
|
|
27
|
-
static description = "Set up context capture proxy (installs mitmproxy, configures shell)";
|
|
28
|
-
static examples = [
|
|
29
|
-
"<%= config.bin %> proxy setup",
|
|
30
|
-
"<%= config.bin %> proxy setup --shell zsh",
|
|
31
|
-
"<%= config.bin %> proxy setup --check"
|
|
32
|
-
];
|
|
33
|
-
static flags = {
|
|
34
|
-
shell: Flags.string({
|
|
35
|
-
description: "Shell to configure (auto-detected if omitted)",
|
|
36
|
-
options: ["zsh", "bash", "fish", "powershell"]
|
|
37
|
-
}),
|
|
38
|
-
port: Flags.integer({
|
|
39
|
-
char: "p",
|
|
40
|
-
default: DEFAULT_PORT,
|
|
41
|
-
description: "Proxy listen port"
|
|
42
|
-
}),
|
|
43
|
-
check: Flags.boolean({
|
|
44
|
-
description: "Only check prerequisites, do not install anything",
|
|
45
|
-
default: false
|
|
46
|
-
})
|
|
47
|
-
};
|
|
48
|
-
async run() {
|
|
49
|
-
const { flags } = await this.parse(_ProxySetup);
|
|
50
|
-
const checkOnly = flags.check;
|
|
51
|
-
const port = flags.port;
|
|
52
|
-
this.log("RuleMetric Proxy Setup");
|
|
53
|
-
this.log("=====================\n");
|
|
54
|
-
const checks = [
|
|
55
|
-
await this.checkAuth(),
|
|
56
|
-
await this.checkMitmproxy(),
|
|
57
|
-
await this.checkCACert(),
|
|
58
|
-
await this.checkHooks(),
|
|
59
|
-
this.checkShellEnv(port)
|
|
60
|
-
];
|
|
61
|
-
let allPassed = true;
|
|
62
|
-
for (const check of checks) {
|
|
63
|
-
const icon = check.ok ? "[OK]" : "[!!]";
|
|
64
|
-
this.log(`${icon} ${check.name}: ${check.message}`);
|
|
65
|
-
if (!check.ok) allPassed = false;
|
|
66
|
-
}
|
|
67
|
-
if (allPassed) {
|
|
68
|
-
this.log("\nAll checks passed. Run `rulemetric proxy start` to begin capturing.");
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (checkOnly) {
|
|
72
|
-
this.log("\nSome checks failed. Run `rulemetric proxy setup` (without --check) to fix.");
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this.log("\nFixing issues...\n");
|
|
76
|
-
for (const check of checks) {
|
|
77
|
-
if (check.ok || !check.fix) continue;
|
|
78
|
-
this.log(`Fixing: ${check.name}...`);
|
|
79
|
-
const fixed = await check.fix();
|
|
80
|
-
if (fixed) {
|
|
81
|
-
this.log(` Fixed.
|
|
82
|
-
`);
|
|
83
|
-
} else {
|
|
84
|
-
this.log(` Could not auto-fix. See instructions above.
|
|
85
|
-
`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
this.log("---\nVerifying...\n");
|
|
89
|
-
const reChecks = [
|
|
90
|
-
await this.checkAuth(),
|
|
91
|
-
await this.checkMitmproxy(),
|
|
92
|
-
await this.checkCACert(),
|
|
93
|
-
await this.checkHooks(),
|
|
94
|
-
this.checkShellEnv(port)
|
|
95
|
-
];
|
|
96
|
-
let finalOk = true;
|
|
97
|
-
for (const check of reChecks) {
|
|
98
|
-
const icon = check.ok ? "[OK]" : "[!!]";
|
|
99
|
-
this.log(`${icon} ${check.name}: ${check.message}`);
|
|
100
|
-
if (!check.ok) finalOk = false;
|
|
101
|
-
}
|
|
102
|
-
if (finalOk) {
|
|
103
|
-
this.log("\nSetup complete! Next steps:");
|
|
104
|
-
this.log(" 1. Restart your shell (or run `source ~/.zshrc`)");
|
|
105
|
-
this.log(" 2. Run `rulemetric proxy start`");
|
|
106
|
-
this.log(" 3. Start Claude Code \u2014 context will be captured automatically");
|
|
107
|
-
} else {
|
|
108
|
-
this.log("\nSome issues remain. Fix manually and re-run `rulemetric proxy setup --check`.");
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
async checkAuth() {
|
|
112
|
-
if (isAuthenticated()) {
|
|
113
|
-
return { name: "Authentication", ok: true, message: "Logged in (JWT)" };
|
|
114
|
-
}
|
|
115
|
-
const apiKey = process.env.RULEMETRIC_API_KEY;
|
|
116
|
-
if (apiKey) {
|
|
117
|
-
return { name: "Authentication", ok: true, message: `API key (RULEMETRIC_API_KEY=${apiKey.slice(0, 8)}...)` };
|
|
118
|
-
}
|
|
119
|
-
const envFile = join(homedir(), ".config", "rulemetric", "env");
|
|
120
|
-
if (existsSync(envFile)) {
|
|
121
|
-
const content = readFileSync(envFile, "utf-8");
|
|
122
|
-
if (content.includes("RULEMETRIC_API_KEY") || content.includes("RULEMETRIC_ACCESS_TOKEN")) {
|
|
123
|
-
return { name: "Authentication", ok: true, message: "Configured via ~/.config/rulemetric/env" };
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
name: "Authentication",
|
|
128
|
-
ok: false,
|
|
129
|
-
message: "Not authenticated",
|
|
130
|
-
fix: async () => {
|
|
131
|
-
this.log(" Run `rulemetric auth login` to authenticate.");
|
|
132
|
-
this.log(" Or set RULEMETRIC_API_KEY in ~/.config/rulemetric/env.");
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
async checkMitmproxy() {
|
|
138
|
-
const binary = this.findBinary("mitmdump");
|
|
139
|
-
if (binary) {
|
|
140
|
-
try {
|
|
141
|
-
const output = execSync(`${binary} --version 2>&1`, { encoding: "utf-8" });
|
|
142
|
-
const version = output.match(/Mitmproxy:\s*([\d.]+)/)?.[1] ?? "unknown";
|
|
143
|
-
return { name: "mitmproxy", ok: true, message: `Installed (v${version})` };
|
|
144
|
-
} catch {
|
|
145
|
-
return { name: "mitmproxy", ok: true, message: `Found at ${binary}` };
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return {
|
|
149
|
-
name: "mitmproxy",
|
|
150
|
-
ok: false,
|
|
151
|
-
message: "Not installed",
|
|
152
|
-
fix: async () => this.installMitmproxy()
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
async installMitmproxy() {
|
|
156
|
-
if (this.findBinary("pipx")) {
|
|
157
|
-
this.log(" Installing via pipx...");
|
|
158
|
-
const result = spawnSync("pipx", ["install", "mitmproxy"], { stdio: "inherit" });
|
|
159
|
-
if (result.status === 0) return true;
|
|
160
|
-
}
|
|
161
|
-
if (this.findBinary("uv")) {
|
|
162
|
-
this.log(" Installing via uv...");
|
|
163
|
-
const result = spawnSync("uv", ["tool", "install", "mitmproxy"], { stdio: "inherit" });
|
|
164
|
-
if (result.status === 0) return true;
|
|
165
|
-
}
|
|
166
|
-
if (this.findBinary("pip3") || this.findBinary("pip")) {
|
|
167
|
-
const pip = this.findBinary("pip3") || this.findBinary("pip");
|
|
168
|
-
this.log(` Installing via ${pip} --user...`);
|
|
169
|
-
const result = spawnSync(pip, ["install", "--user", "mitmproxy"], { stdio: "inherit" });
|
|
170
|
-
if (result.status === 0) return true;
|
|
171
|
-
}
|
|
172
|
-
if (this.findBinary("brew")) {
|
|
173
|
-
this.log(" Installing via brew...");
|
|
174
|
-
const result = spawnSync("brew", ["install", "mitmproxy"], { stdio: "inherit" });
|
|
175
|
-
if (result.status === 0) return true;
|
|
176
|
-
}
|
|
177
|
-
this.log(" Could not auto-install mitmproxy. Install manually:");
|
|
178
|
-
this.log(" pipx install mitmproxy # recommended");
|
|
179
|
-
this.log(" brew install mitmproxy # macOS");
|
|
180
|
-
this.log(" pip install --user mitmproxy");
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
async checkCACert() {
|
|
184
|
-
if (existsSync(CERT_PATH)) {
|
|
185
|
-
return { name: "CA Certificate", ok: true, message: `Found at ${CERT_PATH}` };
|
|
186
|
-
}
|
|
187
|
-
return {
|
|
188
|
-
name: "CA Certificate",
|
|
189
|
-
ok: false,
|
|
190
|
-
message: "Not generated yet",
|
|
191
|
-
fix: async () => this.generateCACert()
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
async generateCACert() {
|
|
195
|
-
const mitmdump = this.findBinary("mitmdump");
|
|
196
|
-
if (!mitmdump) {
|
|
197
|
-
this.log(" Cannot generate cert \u2014 mitmproxy not installed.");
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
this.log(" Generating CA certificate...");
|
|
201
|
-
const result = spawnSync(mitmdump, ["--set", "listen_port=0", "-q"], {
|
|
202
|
-
timeout: 5e3,
|
|
203
|
-
stdio: "ignore"
|
|
204
|
-
});
|
|
205
|
-
if (existsSync(CERT_PATH)) {
|
|
206
|
-
this.log(` Certificate generated at ${CERT_PATH}`);
|
|
207
|
-
if (process.platform === "darwin") {
|
|
208
|
-
this.log(" Adding CA cert to macOS keychain (may require sudo)...");
|
|
209
|
-
const trustResult = spawnSync("sudo", [
|
|
210
|
-
"security",
|
|
211
|
-
"add-trusted-cert",
|
|
212
|
-
"-d",
|
|
213
|
-
"-r",
|
|
214
|
-
"trustRoot",
|
|
215
|
-
"-k",
|
|
216
|
-
"/Library/Keychains/System.keychain",
|
|
217
|
-
CERT_PATH
|
|
218
|
-
], { stdio: "inherit" });
|
|
219
|
-
if (trustResult.status === 0) {
|
|
220
|
-
this.log(" CA cert trusted system-wide.");
|
|
221
|
-
} else {
|
|
222
|
-
this.log(" Could not auto-trust cert. You may need NODE_EXTRA_CA_CERTS env var.");
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return true;
|
|
226
|
-
}
|
|
227
|
-
this.log(" Failed to generate cert. Try running: mitmdump --help");
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
async checkHooks() {
|
|
231
|
-
let sawSettingsFile = false;
|
|
232
|
-
for (const fileName of ["settings.local.json", "settings.json"]) {
|
|
233
|
-
const settingsPath = join(process.cwd(), ".claude", fileName);
|
|
234
|
-
if (!existsSync(settingsPath)) continue;
|
|
235
|
-
sawSettingsFile = true;
|
|
236
|
-
try {
|
|
237
|
-
const settings = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
238
|
-
const hasHooks = settings.hooks && Object.keys(settings.hooks).length > 0;
|
|
239
|
-
if (hasHooks) {
|
|
240
|
-
return { name: "Session Hooks", ok: true, message: "Installed in current project" };
|
|
241
|
-
}
|
|
242
|
-
} catch {
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
if (!sawSettingsFile) {
|
|
246
|
-
return {
|
|
247
|
-
name: "Session Hooks",
|
|
248
|
-
ok: false,
|
|
249
|
-
message: "Not installed in current project",
|
|
250
|
-
fix: async () => {
|
|
251
|
-
this.log(" Run `rulemetric hooks install` in your project directory.");
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
return {
|
|
257
|
-
name: "Session Hooks",
|
|
258
|
-
ok: false,
|
|
259
|
-
message: "settings file exists but hooks not configured",
|
|
260
|
-
fix: async () => {
|
|
261
|
-
this.log(" Run `rulemetric hooks install` to configure hooks.");
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
checkShellEnv(port) {
|
|
267
|
-
const proxySet = process.env.HTTPS_PROXY?.includes(String(port));
|
|
268
|
-
const certSet = !!process.env.NODE_EXTRA_CA_CERTS;
|
|
269
|
-
if (proxySet && certSet) {
|
|
270
|
-
return { name: "Shell Environment", ok: true, message: "HTTPS_PROXY and NODE_EXTRA_CA_CERTS set" };
|
|
271
|
-
}
|
|
272
|
-
const missing = [];
|
|
273
|
-
if (!proxySet) missing.push("HTTPS_PROXY");
|
|
274
|
-
if (!certSet) missing.push("NODE_EXTRA_CA_CERTS");
|
|
275
|
-
return {
|
|
276
|
-
name: "Shell Environment",
|
|
277
|
-
ok: false,
|
|
278
|
-
message: `Missing: ${missing.join(", ")}`,
|
|
279
|
-
fix: async () => this.writeShellEnv(port)
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
async writeShellEnv(port) {
|
|
283
|
-
const shell = this.detectShell();
|
|
284
|
-
const rcFile = this.getShellRcFile(shell);
|
|
285
|
-
if (!rcFile) {
|
|
286
|
-
this.log(` Could not detect shell RC file. Add these to your shell profile:`);
|
|
287
|
-
this.log(` export HTTPS_PROXY=http://localhost:${port}`);
|
|
288
|
-
this.log(` export NODE_EXTRA_CA_CERTS=${CERT_PATH}`);
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
const oldMarker = "# RuleMetric proxy";
|
|
292
|
-
const marker = "# RuleMetric proxy (auto-detect)";
|
|
293
|
-
const envFile = join(CONFIG_DIR, "proxy.env");
|
|
294
|
-
const pidFile = join(CONFIG_DIR, "proxy.pid");
|
|
295
|
-
const sentinel = shell === "powershell" ? "_RuleMetricProxyCheck" : "_rulemetric_proxy_check";
|
|
296
|
-
const block = shell === "powershell" ? this.buildPowerShellBlock(marker, pidFile, port) : shell === "fish" ? [
|
|
297
|
-
"",
|
|
298
|
-
marker,
|
|
299
|
-
"function _rulemetric_proxy_check",
|
|
300
|
-
` if test -f ${pidFile}; and kill -0 (cat ${pidFile}) 2>/dev/null`,
|
|
301
|
-
` source ${envFile} 2>/dev/null`,
|
|
302
|
-
" else",
|
|
303
|
-
" set -e HTTPS_PROXY 2>/dev/null",
|
|
304
|
-
" set -e NODE_EXTRA_CA_CERTS 2>/dev/null",
|
|
305
|
-
" end",
|
|
306
|
-
"end",
|
|
307
|
-
""
|
|
308
|
-
].join("\n") : shell === "zsh" ? [
|
|
309
|
-
"",
|
|
310
|
-
marker,
|
|
311
|
-
"_rulemetric_proxy_check() {",
|
|
312
|
-
` if [ -f "${pidFile}" ] && kill -0 "$(cat "${pidFile}" 2>/dev/null)" 2>/dev/null; then`,
|
|
313
|
-
` [ -z "\${HTTPS_PROXY:-}" ] && source "${envFile}" 2>/dev/null`,
|
|
314
|
-
" else",
|
|
315
|
-
` [ -n "\${HTTPS_PROXY:-}" ] && unset HTTPS_PROXY NODE_EXTRA_CA_CERTS`,
|
|
316
|
-
" fi",
|
|
317
|
-
"}",
|
|
318
|
-
"precmd_functions+=(_rulemetric_proxy_check)",
|
|
319
|
-
""
|
|
320
|
-
].join("\n") : [
|
|
321
|
-
"",
|
|
322
|
-
marker,
|
|
323
|
-
"_rulemetric_proxy_check() {",
|
|
324
|
-
` if [ -f "${pidFile}" ] && kill -0 "$(cat "${pidFile}" 2>/dev/null)" 2>/dev/null; then`,
|
|
325
|
-
` [ -z "\${HTTPS_PROXY:-}" ] && source "${envFile}" 2>/dev/null`,
|
|
326
|
-
" else",
|
|
327
|
-
` [ -n "\${HTTPS_PROXY:-}" ] && unset HTTPS_PROXY NODE_EXTRA_CA_CERTS`,
|
|
328
|
-
" fi",
|
|
329
|
-
"}",
|
|
330
|
-
'PROMPT_COMMAND="_rulemetric_proxy_check${PROMPT_COMMAND:+;$PROMPT_COMMAND}"',
|
|
331
|
-
""
|
|
332
|
-
].join("\n");
|
|
333
|
-
mkdirSync(dirname(rcFile), { recursive: true });
|
|
334
|
-
if (existsSync(rcFile)) {
|
|
335
|
-
let content = readFileSync(rcFile, "utf-8");
|
|
336
|
-
if (content.includes(oldMarker) && !content.includes(marker)) {
|
|
337
|
-
content = content.replace(
|
|
338
|
-
/\n# RuleMetric proxy\nexport HTTPS_PROXY=[^\n]*\nexport NODE_EXTRA_CA_CERTS=[^\n]*\n/,
|
|
339
|
-
"\n"
|
|
340
|
-
);
|
|
341
|
-
writeFileSync(rcFile, content);
|
|
342
|
-
this.log(` Removed old static env vars from ${rcFile}`);
|
|
343
|
-
}
|
|
344
|
-
if (content.includes("# RuleMetric proxy (auto-detect") && !content.includes("_rulemetric_proxy_check")) {
|
|
345
|
-
content = content.replace(
|
|
346
|
-
/\n# RuleMetric proxy \(auto-detect[^\n]*\)\nif \[.*?\nfi\n/s,
|
|
347
|
-
"\n"
|
|
348
|
-
);
|
|
349
|
-
writeFileSync(rcFile, content);
|
|
350
|
-
this.log(` Upgraded old auto-detect block in ${rcFile}`);
|
|
351
|
-
}
|
|
352
|
-
if (content.includes(sentinel)) {
|
|
353
|
-
this.log(` Shell env already configured in ${rcFile}`);
|
|
354
|
-
return true;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
this.log(` Appending proxy auto-detect hook to ${rcFile}`);
|
|
358
|
-
this.log(` (HTTPS_PROXY is set/unset automatically when proxy starts/stops)`);
|
|
359
|
-
appendFileSync(rcFile, block);
|
|
360
|
-
return true;
|
|
361
|
-
}
|
|
362
|
-
detectShell() {
|
|
363
|
-
if (process.platform === "win32") return "powershell";
|
|
364
|
-
const shell = process.env.SHELL || "";
|
|
365
|
-
if (shell.includes("zsh")) return "zsh";
|
|
366
|
-
if (shell.includes("bash")) return "bash";
|
|
367
|
-
if (shell.includes("fish")) return "fish";
|
|
368
|
-
return "zsh";
|
|
369
|
-
}
|
|
370
|
-
getShellRcFile(shell) {
|
|
371
|
-
const home = homedir();
|
|
372
|
-
switch (shell) {
|
|
373
|
-
case "zsh":
|
|
374
|
-
return join(home, ".zshrc");
|
|
375
|
-
case "bash":
|
|
376
|
-
return join(home, ".bashrc");
|
|
377
|
-
case "fish":
|
|
378
|
-
return join(home, ".config", "fish", "config.fish");
|
|
379
|
-
case "powershell":
|
|
380
|
-
return this.getPowerShellProfilePath();
|
|
381
|
-
default:
|
|
382
|
-
return null;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Resolve the PowerShell profile that loads for every host (console, VS Code
|
|
387
|
-
* integrated terminal, etc.). We ask PowerShell itself for the canonical path
|
|
388
|
-
* — guessing `~/Documents/...` is wrong when Documents is OneDrive-redirected.
|
|
389
|
-
* Falls back to the PowerShell 7 default only if no PS binary is reachable.
|
|
390
|
-
*/
|
|
391
|
-
getPowerShellProfilePath() {
|
|
392
|
-
const psBin = findBinary("pwsh") || findBinary("powershell");
|
|
393
|
-
if (psBin) {
|
|
394
|
-
try {
|
|
395
|
-
const out = execSync(`"${psBin}" -NoProfile -Command "$PROFILE.CurrentUserAllHosts"`, {
|
|
396
|
-
encoding: "utf-8"
|
|
397
|
-
}).trim();
|
|
398
|
-
if (out) return out;
|
|
399
|
-
} catch {
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
return join(homedir(), "Documents", "PowerShell", "profile.ps1");
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Self-contained PowerShell prompt hook. Unlike the POSIX blocks it does NOT
|
|
406
|
-
* source `proxy.env` (that file is `export KEY=val` syntax PowerShell can't
|
|
407
|
-
* read) — it embeds the values directly. Each prompt it sets HTTPS_PROXY while
|
|
408
|
-
* the proxy PID is alive and removes the vars once it stops, so a dead proxy
|
|
409
|
-
* never leaves a dangling HTTPS_PROXY that would break Claude Code.
|
|
410
|
-
*/
|
|
411
|
-
buildPowerShellBlock(marker, pidFile, port) {
|
|
412
|
-
const proxyUrl = `http://localhost:${port}`;
|
|
413
|
-
const psPid = pidFile.replace(/'/g, "''");
|
|
414
|
-
const psCert = CERT_PATH.replace(/'/g, "''");
|
|
415
|
-
return [
|
|
416
|
-
"",
|
|
417
|
-
marker,
|
|
418
|
-
"function _RuleMetricProxyCheck {",
|
|
419
|
-
` $pidFile = '${psPid}'`,
|
|
420
|
-
" $alive = $false",
|
|
421
|
-
" if (Test-Path $pidFile) {",
|
|
422
|
-
" $procId = (Get-Content $pidFile -ErrorAction SilentlyContinue | Select-Object -First 1)",
|
|
423
|
-
" if ($procId -match '^\\d+$' -and (Get-Process -Id ([int]$procId) -ErrorAction SilentlyContinue)) {",
|
|
424
|
-
" $alive = $true",
|
|
425
|
-
" }",
|
|
426
|
-
" }",
|
|
427
|
-
" if ($alive) {",
|
|
428
|
-
` $env:HTTPS_PROXY = '${proxyUrl}'`,
|
|
429
|
-
` $env:HTTP_PROXY = '${proxyUrl}'`,
|
|
430
|
-
` $env:NODE_EXTRA_CA_CERTS = '${psCert}'`,
|
|
431
|
-
" } else {",
|
|
432
|
-
" Remove-Item Env:HTTPS_PROXY, Env:HTTP_PROXY, Env:NODE_EXTRA_CA_CERTS -ErrorAction SilentlyContinue",
|
|
433
|
-
" }",
|
|
434
|
-
"}",
|
|
435
|
-
"# Wrap the existing prompt once so the check runs every prompt.",
|
|
436
|
-
"if (-not (Test-Path Function:\\_RuleMetricOriginalPrompt)) {",
|
|
437
|
-
" $existing = Get-Command prompt -ErrorAction SilentlyContinue",
|
|
438
|
-
" if ($existing) { Set-Item Function:\\_RuleMetricOriginalPrompt $existing.ScriptBlock }",
|
|
439
|
-
"}",
|
|
440
|
-
"function prompt {",
|
|
441
|
-
" _RuleMetricProxyCheck",
|
|
442
|
-
' if (Test-Path Function:\\_RuleMetricOriginalPrompt) { & _RuleMetricOriginalPrompt } else { "PS $($PWD.Path)> " }',
|
|
443
|
-
"}",
|
|
444
|
-
""
|
|
445
|
-
].join("\n");
|
|
446
|
-
}
|
|
447
|
-
findBinary(name) {
|
|
448
|
-
return findBinary(name);
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
export {
|
|
452
|
-
ProxySetup as default
|
|
453
|
-
};
|
|
454
|
-
//# sourceMappingURL=setup.js.map
|
|
1
|
+
import{a as g}from"../../chunk-67QCYUJU.js";import{a as x}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{g as R}from"../../chunk-M6AJDVCL.js";import{a}from"../../chunk-ZLLER3HP.js";import{Flags as y}from"@oclif/core";import{execSync as P,spawnSync as m}from"node:child_process";import{existsSync as f,readFileSync as k,appendFileSync as T,writeFileSync as C,mkdirSync as E}from"node:fs";import{homedir as d}from"node:os";import{dirname as $,join as c}from"node:path";var h=c(d(),".mitmproxy","mitmproxy-ca-cert.pem"),S=c(d(),".config","rulemetric"),A=8787,_=class v extends x{static{a(this,"ProxySetup")}static description="Set up context capture proxy (installs mitmproxy, configures shell)";static examples=["<%= config.bin %> proxy setup","<%= config.bin %> proxy setup --shell zsh","<%= config.bin %> proxy setup --check"];static flags={shell:y.string({description:"Shell to configure (auto-detected if omitted)",options:["zsh","bash","fish","powershell"]}),port:y.integer({char:"p",default:A,description:"Proxy listen port"}),check:y.boolean({description:"Only check prerequisites, do not install anything",default:!1})};async run(){let{flags:e}=await this.parse(v),t=e.check,i=e.port;this.log("RuleMetric Proxy Setup"),this.log(`=====================
|
|
2
|
+
`);let s=[await this.checkAuth(),await this.checkMitmproxy(),await this.checkCACert(),await this.checkHooks(),this.checkShellEnv(i)],r=!0;for(let n of s){let p=n.ok?"[OK]":"[!!]";this.log(`${p} ${n.name}: ${n.message}`),n.ok||(r=!1)}if(r){this.log("\nAll checks passed. Run `rulemetric proxy start` to begin capturing.");return}if(t){this.log("\nSome checks failed. Run `rulemetric proxy setup` (without --check) to fix.");return}this.log(`
|
|
3
|
+
Fixing issues...
|
|
4
|
+
`);for(let n of s){if(n.ok||!n.fix)continue;this.log(`Fixing: ${n.name}...`),await n.fix()?this.log(` Fixed.
|
|
5
|
+
`):this.log(` Could not auto-fix. See instructions above.
|
|
6
|
+
`)}this.log(`---
|
|
7
|
+
Verifying...
|
|
8
|
+
`);let u=[await this.checkAuth(),await this.checkMitmproxy(),await this.checkCACert(),await this.checkHooks(),this.checkShellEnv(i)],l=!0;for(let n of u){let p=n.ok?"[OK]":"[!!]";this.log(`${p} ${n.name}: ${n.message}`),n.ok||(l=!1)}l?(this.log(`
|
|
9
|
+
Setup complete! Next steps:`),this.log(" 1. Restart your shell (or run `source ~/.zshrc`)"),this.log(" 2. Run `rulemetric proxy start`"),this.log(" 3. Start Claude Code \u2014 context will be captured automatically")):this.log("\nSome issues remain. Fix manually and re-run `rulemetric proxy setup --check`.")}async checkAuth(){if(R())return{name:"Authentication",ok:!0,message:"Logged in (JWT)"};let e=process.env.RULEMETRIC_API_KEY;if(e)return{name:"Authentication",ok:!0,message:`API key (RULEMETRIC_API_KEY=${e.slice(0,8)}...)`};let t=c(d(),".config","rulemetric","env");if(f(t)){let i=k(t,"utf-8");if(i.includes("RULEMETRIC_API_KEY")||i.includes("RULEMETRIC_ACCESS_TOKEN"))return{name:"Authentication",ok:!0,message:"Configured via ~/.config/rulemetric/env"}}return{name:"Authentication",ok:!1,message:"Not authenticated",fix:a(async()=>(this.log(" Run `rulemetric auth login` to authenticate."),this.log(" Or set RULEMETRIC_API_KEY in ~/.config/rulemetric/env."),!1),"fix")}}async checkMitmproxy(){let e=this.findBinary("mitmdump");if(e)try{return{name:"mitmproxy",ok:!0,message:`Installed (v${P(`${e} --version 2>&1`,{encoding:"utf-8"}).match(/Mitmproxy:\s*([\d.]+)/)?.[1]??"unknown"})`}}catch{return{name:"mitmproxy",ok:!0,message:`Found at ${e}`}}return{name:"mitmproxy",ok:!1,message:"Not installed",fix:a(async()=>this.installMitmproxy(),"fix")}}async installMitmproxy(){if(this.findBinary("pipx")&&(this.log(" Installing via pipx..."),m("pipx",["install","mitmproxy"],{stdio:"inherit"}).status===0)||this.findBinary("uv")&&(this.log(" Installing via uv..."),m("uv",["tool","install","mitmproxy"],{stdio:"inherit"}).status===0))return!0;if(this.findBinary("pip3")||this.findBinary("pip")){let e=this.findBinary("pip3")||this.findBinary("pip");if(this.log(` Installing via ${e} --user...`),m(e,["install","--user","mitmproxy"],{stdio:"inherit"}).status===0)return!0}return this.findBinary("brew")&&(this.log(" Installing via brew..."),m("brew",["install","mitmproxy"],{stdio:"inherit"}).status===0)?!0:(this.log(" Could not auto-install mitmproxy. Install manually:"),this.log(" pipx install mitmproxy # recommended"),this.log(" brew install mitmproxy # macOS"),this.log(" pip install --user mitmproxy"),!1)}async checkCACert(){return f(h)?{name:"CA Certificate",ok:!0,message:`Found at ${h}`}:{name:"CA Certificate",ok:!1,message:"Not generated yet",fix:a(async()=>this.generateCACert(),"fix")}}async generateCACert(){let e=this.findBinary("mitmdump");if(!e)return this.log(" Cannot generate cert \u2014 mitmproxy not installed."),!1;this.log(" Generating CA certificate...");let t=m(e,["--set","listen_port=0","-q"],{timeout:5e3,stdio:"ignore"});return f(h)?(this.log(` Certificate generated at ${h}`),process.platform==="darwin"&&(this.log(" Adding CA cert to macOS keychain (may require sudo)..."),m("sudo",["security","add-trusted-cert","-d","-r","trustRoot","-k","/Library/Keychains/System.keychain",h],{stdio:"inherit"}).status===0?this.log(" CA cert trusted system-wide."):this.log(" Could not auto-trust cert. You may need NODE_EXTRA_CA_CERTS env var.")),!0):(this.log(" Failed to generate cert. Try running: mitmdump --help"),!1)}async checkHooks(){let e=!1;for(let t of["settings.local.json","settings.json"]){let i=c(process.cwd(),".claude",t);if(f(i)){e=!0;try{let s=JSON.parse(k(i,"utf-8"));if(s.hooks&&Object.keys(s.hooks).length>0)return{name:"Session Hooks",ok:!0,message:"Installed in current project"}}catch{}}}return e?{name:"Session Hooks",ok:!1,message:"settings file exists but hooks not configured",fix:a(async()=>(this.log(" Run `rulemetric hooks install` to configure hooks."),!1),"fix")}:{name:"Session Hooks",ok:!1,message:"Not installed in current project",fix:a(async()=>(this.log(" Run `rulemetric hooks install` in your project directory."),!1),"fix")}}checkShellEnv(e){let t=process.env.HTTPS_PROXY?.includes(String(e)),i=!!process.env.NODE_EXTRA_CA_CERTS;if(t&&i)return{name:"Shell Environment",ok:!0,message:"HTTPS_PROXY and NODE_EXTRA_CA_CERTS set"};let s=[];return t||s.push("HTTPS_PROXY"),i||s.push("NODE_EXTRA_CA_CERTS"),{name:"Shell Environment",ok:!1,message:`Missing: ${s.join(", ")}`,fix:a(async()=>this.writeShellEnv(e),"fix")}}async writeShellEnv(e){let t=this.detectShell(),i=this.getShellRcFile(t);if(!i)return this.log(" Could not detect shell RC file. Add these to your shell profile:"),this.log(` export HTTPS_PROXY=http://localhost:${e}`),this.log(` export NODE_EXTRA_CA_CERTS=${h}`),!1;let s="# RuleMetric proxy",r="# RuleMetric proxy (auto-detect)",u=c(S,"proxy.env"),l=c(S,"proxy.pid"),n=t==="powershell"?"_RuleMetricProxyCheck":"_rulemetric_proxy_check",p=t==="powershell"?this.buildPowerShellBlock(r,l,e):t==="fish"?["",r,"function _rulemetric_proxy_check",` if test -f ${l}; and kill -0 (cat ${l}) 2>/dev/null`,` source ${u} 2>/dev/null`," else"," set -e HTTPS_PROXY 2>/dev/null"," set -e NODE_EXTRA_CA_CERTS 2>/dev/null"," end","end",""].join(`
|
|
10
|
+
`):t==="zsh"?["",r,"_rulemetric_proxy_check() {",` if [ -f "${l}" ] && kill -0 "$(cat "${l}" 2>/dev/null)" 2>/dev/null; then`,` [ -z "\${HTTPS_PROXY:-}" ] && source "${u}" 2>/dev/null`," else",' [ -n "${HTTPS_PROXY:-}" ] && unset HTTPS_PROXY NODE_EXTRA_CA_CERTS'," fi","}","precmd_functions+=(_rulemetric_proxy_check)",""].join(`
|
|
11
|
+
`):["",r,"_rulemetric_proxy_check() {",` if [ -f "${l}" ] && kill -0 "$(cat "${l}" 2>/dev/null)" 2>/dev/null; then`,` [ -z "\${HTTPS_PROXY:-}" ] && source "${u}" 2>/dev/null`," else",' [ -n "${HTTPS_PROXY:-}" ] && unset HTTPS_PROXY NODE_EXTRA_CA_CERTS'," fi","}",'PROMPT_COMMAND="_rulemetric_proxy_check${PROMPT_COMMAND:+;$PROMPT_COMMAND}"',""].join(`
|
|
12
|
+
`);if(E($(i),{recursive:!0}),f(i)){let o=k(i,"utf-8");if(o.includes(s)&&!o.includes(r)&&(o=o.replace(/\n# RuleMetric proxy\nexport HTTPS_PROXY=[^\n]*\nexport NODE_EXTRA_CA_CERTS=[^\n]*\n/,`
|
|
13
|
+
`),C(i,o),this.log(` Removed old static env vars from ${i}`)),o.includes("# RuleMetric proxy (auto-detect")&&!o.includes("_rulemetric_proxy_check")&&(o=o.replace(/\n# RuleMetric proxy \(auto-detect[^\n]*\)\nif \[.*?\nfi\n/s,`
|
|
14
|
+
`),C(i,o),this.log(` Upgraded old auto-detect block in ${i}`)),o.includes(n))return this.log(` Shell env already configured in ${i}`),!0}return this.log(` Appending proxy auto-detect hook to ${i}`),this.log(" (HTTPS_PROXY is set/unset automatically when proxy starts/stops)"),T(i,p),!0}detectShell(){if(process.platform==="win32")return"powershell";let e=process.env.SHELL||"";return e.includes("zsh")?"zsh":e.includes("bash")?"bash":e.includes("fish")?"fish":"zsh"}getShellRcFile(e){let t=d();switch(e){case"zsh":return c(t,".zshrc");case"bash":return c(t,".bashrc");case"fish":return c(t,".config","fish","config.fish");case"powershell":return this.getPowerShellProfilePath();default:return null}}getPowerShellProfilePath(){let e=g("pwsh")||g("powershell");if(e)try{let t=P(`"${e}" -NoProfile -Command "$PROFILE.CurrentUserAllHosts"`,{encoding:"utf-8"}).trim();if(t)return t}catch{}return c(d(),"Documents","PowerShell","profile.ps1")}buildPowerShellBlock(e,t,i){let s=`http://localhost:${i}`,r=t.replace(/'/g,"''"),u=h.replace(/'/g,"''");return["",e,"function _RuleMetricProxyCheck {",` $pidFile = '${r}'`," $alive = $false"," if (Test-Path $pidFile) {"," $procId = (Get-Content $pidFile -ErrorAction SilentlyContinue | Select-Object -First 1)"," if ($procId -match '^\\d+$' -and (Get-Process -Id ([int]$procId) -ErrorAction SilentlyContinue)) {"," $alive = $true"," }"," }"," if ($alive) {",` $env:HTTPS_PROXY = '${s}'`,` $env:HTTP_PROXY = '${s}'`,` $env:NODE_EXTRA_CA_CERTS = '${u}'`," } else {"," Remove-Item Env:HTTPS_PROXY, Env:HTTP_PROXY, Env:NODE_EXTRA_CA_CERTS -ErrorAction SilentlyContinue"," }","}","# Wrap the existing prompt once so the check runs every prompt.","if (-not (Test-Path Function:\\_RuleMetricOriginalPrompt)) {"," $existing = Get-Command prompt -ErrorAction SilentlyContinue"," if ($existing) { Set-Item Function:\\_RuleMetricOriginalPrompt $existing.ScriptBlock }","}","function prompt {"," _RuleMetricProxyCheck",' if (Test-Path Function:\\_RuleMetricOriginalPrompt) { & _RuleMetricOriginalPrompt } else { "PS $($PWD.Path)> " }',"}",""].join(`
|
|
15
|
+
`)}findBinary(e){return g(e)}};export{_ as default};
|