@rulemetric/cli 0.2.1 → 0.2.3
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 +13 -52
- package/dist/base-command.js.map +7 -1
- package/dist/chunk-2AM54TUK.js +59 -0
- package/dist/chunk-2AM54TUK.js.map +7 -0
- package/dist/chunk-3TIMQ3O6.js +96 -0
- package/dist/chunk-3TIMQ3O6.js.map +7 -0
- package/dist/chunk-4BHDHHKL.js +48 -0
- package/dist/chunk-4BHDHHKL.js.map +7 -0
- package/dist/chunk-4D537GXE.js +99 -0
- package/dist/chunk-4D537GXE.js.map +7 -0
- package/dist/chunk-4SCZK7AL.js +129 -0
- package/dist/chunk-4SCZK7AL.js.map +7 -0
- package/dist/chunk-4WFE4PFP.js +61 -0
- package/dist/chunk-4WFE4PFP.js.map +7 -0
- package/dist/chunk-52WIYRZH.js +73 -0
- package/dist/chunk-52WIYRZH.js.map +7 -0
- package/dist/chunk-7FAA3YNB.js +1549 -0
- package/dist/chunk-7FAA3YNB.js.map +7 -0
- package/dist/chunk-7NYKWN7U.js +12 -0
- package/dist/chunk-7NYKWN7U.js.map +7 -0
- package/dist/chunk-AULP2OWH.js +99 -0
- package/dist/chunk-AULP2OWH.js.map +7 -0
- package/dist/chunk-B5KNTGMJ.js +1788 -0
- package/dist/chunk-B5KNTGMJ.js.map +7 -0
- package/dist/chunk-BD7CY42U.js +23 -0
- package/dist/chunk-BD7CY42U.js.map +7 -0
- package/dist/chunk-BO76WKJR.js +42 -0
- package/dist/chunk-BO76WKJR.js.map +7 -0
- package/dist/chunk-BRD5RUGM.js +53 -0
- package/dist/chunk-BRD5RUGM.js.map +7 -0
- package/dist/chunk-BT6Z6545.js +43 -0
- package/dist/chunk-BT6Z6545.js.map +7 -0
- package/dist/chunk-BZDKEQKU.js +39 -0
- package/dist/chunk-BZDKEQKU.js.map +7 -0
- package/dist/chunk-CROYS75W.js +161 -0
- package/dist/chunk-CROYS75W.js.map +7 -0
- package/dist/chunk-DGHWRQXL.js +17 -0
- package/dist/chunk-DGHWRQXL.js.map +7 -0
- package/dist/chunk-DQ3KELXD.js +74 -0
- package/dist/chunk-DQ3KELXD.js.map +7 -0
- package/dist/chunk-DTFXCHHI.js +108 -0
- package/dist/chunk-DTFXCHHI.js.map +7 -0
- package/dist/chunk-DU73QUS3.js +75 -0
- package/dist/chunk-DU73QUS3.js.map +7 -0
- package/dist/chunk-EHZJ6OXD.js +307 -0
- package/dist/chunk-EHZJ6OXD.js.map +7 -0
- package/dist/chunk-EJOI2ZGU.js +109 -0
- package/dist/chunk-EJOI2ZGU.js.map +7 -0
- package/dist/chunk-EKJ2CABV.js +76 -0
- package/dist/chunk-EKJ2CABV.js.map +7 -0
- package/dist/chunk-EKP32DLN.js +16 -0
- package/dist/chunk-EKP32DLN.js.map +7 -0
- package/dist/chunk-EOOP6WTC.js +148 -0
- package/dist/chunk-EOOP6WTC.js.map +7 -0
- package/dist/chunk-ERPMDAO3.js +20 -0
- package/dist/chunk-ERPMDAO3.js.map +7 -0
- package/dist/chunk-FTJRMUID.js +96 -0
- package/dist/chunk-FTJRMUID.js.map +7 -0
- package/dist/chunk-FZKLLNDS.js +228 -0
- package/dist/chunk-FZKLLNDS.js.map +7 -0
- package/dist/chunk-GQCISMAH.js +157 -0
- package/dist/chunk-GQCISMAH.js.map +7 -0
- package/dist/chunk-IGXX624H.js +55 -0
- package/dist/chunk-IGXX624H.js.map +7 -0
- package/dist/chunk-IJGF2ETG.js +68 -0
- package/dist/chunk-IJGF2ETG.js.map +7 -0
- package/dist/chunk-IWYCRLEK.js +220 -0
- package/dist/chunk-IWYCRLEK.js.map +7 -0
- package/dist/chunk-J7N3DLH6.js +117 -0
- package/dist/chunk-J7N3DLH6.js.map +7 -0
- package/dist/chunk-JX5UI6RW.js +99 -0
- package/dist/chunk-JX5UI6RW.js.map +7 -0
- package/dist/chunk-K3BFZ7KG.js +154 -0
- package/dist/chunk-K3BFZ7KG.js.map +7 -0
- package/dist/chunk-KHJUQFIK.js +51 -0
- package/dist/chunk-KHJUQFIK.js.map +7 -0
- package/dist/chunk-KRBQLMOP.js +41 -0
- package/dist/chunk-KRBQLMOP.js.map +7 -0
- package/dist/chunk-KZRFUXGF.js +145 -0
- package/dist/chunk-KZRFUXGF.js.map +7 -0
- package/dist/chunk-L674RNKQ.js +492 -0
- package/dist/chunk-L674RNKQ.js.map +7 -0
- package/dist/chunk-N52AHNBH.js +47 -0
- package/dist/chunk-N52AHNBH.js.map +7 -0
- package/dist/chunk-NIDLJO6F.js +228 -0
- package/dist/chunk-NIDLJO6F.js.map +7 -0
- package/dist/chunk-NSBPE2FW.js +17 -0
- package/dist/chunk-NSBPE2FW.js.map +7 -0
- package/dist/chunk-OGVORIFM.js +70 -0
- package/dist/chunk-OGVORIFM.js.map +7 -0
- package/dist/chunk-OQSQC7VB.js +77 -0
- package/dist/chunk-OQSQC7VB.js.map +7 -0
- package/dist/chunk-PHLMIZKM.js +153 -0
- package/dist/chunk-PHLMIZKM.js.map +7 -0
- package/dist/chunk-PQU7GZ7A.js +92 -0
- package/dist/chunk-PQU7GZ7A.js.map +7 -0
- package/dist/chunk-PXVQLD7S.js +196 -0
- package/dist/chunk-PXVQLD7S.js.map +7 -0
- package/dist/chunk-QD6X4L4L.js +79 -0
- package/dist/chunk-QD6X4L4L.js.map +7 -0
- package/dist/chunk-QJQS6TUN.js +44 -0
- package/dist/chunk-QJQS6TUN.js.map +7 -0
- package/dist/chunk-QJXAULRC.js +191 -0
- package/dist/chunk-QJXAULRC.js.map +7 -0
- package/dist/chunk-QN34TGD3.js +83 -0
- package/dist/chunk-QN34TGD3.js.map +7 -0
- package/dist/chunk-R5MFHGHR.js +122 -0
- package/dist/chunk-R5MFHGHR.js.map +7 -0
- package/dist/chunk-RH7NHVSK.js +16 -0
- package/dist/chunk-RH7NHVSK.js.map +7 -0
- package/dist/chunk-RJ7BHDLM.js +121 -0
- package/dist/chunk-RJ7BHDLM.js.map +7 -0
- package/dist/chunk-RQ2TMLKG.js +142 -0
- package/dist/chunk-RQ2TMLKG.js.map +7 -0
- package/dist/chunk-S56LOTGQ.js +63 -0
- package/dist/chunk-S56LOTGQ.js.map +7 -0
- package/dist/chunk-UF73WX2J.js +49 -0
- package/dist/chunk-UF73WX2J.js.map +7 -0
- package/dist/chunk-W53GKIZQ.js +50 -0
- package/dist/chunk-W53GKIZQ.js.map +7 -0
- package/dist/chunk-WA4MWYRW.js +254 -0
- package/dist/chunk-WA4MWYRW.js.map +7 -0
- package/dist/chunk-WFULKPEQ.js +269 -0
- package/dist/chunk-WFULKPEQ.js.map +7 -0
- package/dist/chunk-XC6M4CSW.js +44 -0
- package/dist/chunk-XC6M4CSW.js.map +7 -0
- package/dist/chunk-XPUEGHXN.js +243 -0
- package/dist/chunk-XPUEGHXN.js.map +7 -0
- package/dist/chunk-XZXS2W24.js +148 -0
- package/dist/chunk-XZXS2W24.js.map +7 -0
- package/dist/chunk-YBNW7ARH.js +167 -0
- package/dist/chunk-YBNW7ARH.js.map +7 -0
- package/dist/chunk-YNIH3KMU.js +121 -0
- package/dist/chunk-YNIH3KMU.js.map +7 -0
- package/dist/commands/antigravity/backfill.js +135 -0
- package/dist/commands/antigravity/backfill.js.map +7 -0
- package/dist/commands/auth/create-key.js +48 -33
- package/dist/commands/auth/create-key.js.map +7 -1
- package/dist/commands/auth/login.js +58 -46
- package/dist/commands/auth/login.js.map +7 -1
- package/dist/commands/auth/logout.js +28 -13
- package/dist/commands/auth/logout.js.map +7 -1
- package/dist/commands/auth/revoke-key.js +32 -18
- package/dist/commands/auth/revoke-key.js.map +7 -1
- package/dist/commands/auth/status.js +40 -22
- package/dist/commands/auth/status.js.map +7 -1
- package/dist/commands/catalog/index.js +50 -34
- package/dist/commands/catalog/index.js.map +7 -1
- package/dist/commands/catalog/recommend.js +41 -26
- package/dist/commands/catalog/recommend.js.map +7 -1
- package/dist/commands/convert.js +72 -54
- package/dist/commands/convert.js.map +7 -1
- package/dist/commands/converters.js +52 -38
- package/dist/commands/converters.js.map +7 -1
- package/dist/commands/crons/list.js +50 -24
- package/dist/commands/crons/list.js.map +7 -1
- package/dist/commands/crons/run.js +72 -47
- package/dist/commands/crons/run.js.map +7 -1
- package/dist/commands/dashboard.js +45 -24
- package/dist/commands/dashboard.js.map +7 -1
- package/dist/commands/eval-targets/create.js +51 -39
- package/dist/commands/eval-targets/create.js.map +7 -1
- package/dist/commands/eval-targets/list.js +52 -35
- package/dist/commands/eval-targets/list.js.map +7 -1
- package/dist/commands/evals/agent.js +292 -0
- package/dist/commands/evals/agent.js.map +7 -0
- package/dist/commands/evals/benchmark.js +70 -51
- package/dist/commands/evals/benchmark.js.map +7 -1
- package/dist/commands/evals/compare.js +90 -78
- package/dist/commands/evals/compare.js.map +7 -1
- package/dist/commands/evals/create.js +64 -50
- package/dist/commands/evals/create.js.map +7 -1
- package/dist/commands/evals/optimize-description.js +225 -222
- package/dist/commands/evals/optimize-description.js.map +7 -1
- package/dist/commands/evals/optimize.js +206 -196
- package/dist/commands/evals/optimize.js.map +7 -1
- package/dist/commands/evals/run.js +178 -164
- package/dist/commands/evals/run.js.map +7 -1
- package/dist/commands/gateway/ensure.js +33 -19
- package/dist/commands/gateway/ensure.js.map +7 -1
- package/dist/commands/hooks/install.js +335 -275
- package/dist/commands/hooks/install.js.map +7 -1
- package/dist/commands/hooks/run.js +72 -53
- package/dist/commands/hooks/run.js.map +7 -1
- package/dist/commands/hooks/uninstall.js +117 -94
- package/dist/commands/hooks/uninstall.js.map +7 -1
- package/dist/commands/import.js +63 -53
- package/dist/commands/import.js.map +7 -1
- package/dist/commands/instructions/create.js +71 -58
- package/dist/commands/instructions/create.js.map +7 -1
- package/dist/commands/instructions/delete.js +53 -36
- package/dist/commands/instructions/delete.js.map +7 -1
- package/dist/commands/instructions/fork.js +33 -19
- package/dist/commands/instructions/fork.js.map +7 -1
- package/dist/commands/instructions/get.js +66 -49
- package/dist/commands/instructions/get.js.map +7 -1
- package/dist/commands/instructions/list.js +63 -46
- package/dist/commands/instructions/list.js.map +7 -1
- package/dist/commands/instructions/promote.js +41 -27
- package/dist/commands/instructions/promote.js.map +7 -1
- package/dist/commands/instructions/pull.js +37 -21
- package/dist/commands/instructions/pull.js.map +7 -1
- package/dist/commands/instructions/upstream.js +36 -21
- package/dist/commands/instructions/upstream.js.map +7 -1
- package/dist/commands/instructions/versions.js +51 -33
- package/dist/commands/instructions/versions.js.map +7 -1
- package/dist/commands/launcher.js +39 -0
- package/dist/commands/launcher.js.map +7 -0
- package/dist/commands/org/current.js +74 -68
- package/dist/commands/org/current.js.map +7 -1
- package/dist/commands/org/list.js +50 -36
- package/dist/commands/org/list.js.map +7 -1
- package/dist/commands/org/switch.js +69 -51
- package/dist/commands/org/switch.js.map +7 -1
- package/dist/commands/packs/add-instruction.js +36 -22
- package/dist/commands/packs/add-instruction.js.map +7 -1
- package/dist/commands/packs/apply.js +38 -24
- package/dist/commands/packs/apply.js.map +7 -1
- package/dist/commands/packs/create.js +47 -33
- package/dist/commands/packs/create.js.map +7 -1
- package/dist/commands/packs/fork.js +33 -19
- package/dist/commands/packs/fork.js.map +7 -1
- package/dist/commands/packs/get.js +54 -35
- package/dist/commands/packs/get.js.map +7 -1
- package/dist/commands/packs/list.js +64 -47
- package/dist/commands/packs/list.js.map +7 -1
- package/dist/commands/packs/remove-instruction.js +34 -20
- package/dist/commands/packs/remove-instruction.js.map +7 -1
- package/dist/commands/proxy/env.js +126 -116
- package/dist/commands/proxy/env.js.map +7 -1
- package/dist/commands/proxy/logs.js +83 -74
- package/dist/commands/proxy/logs.js.map +7 -1
- package/dist/commands/proxy/restart.js +34 -36
- package/dist/commands/proxy/restart.js.map +7 -1
- package/dist/commands/proxy/setup.js +432 -375
- package/dist/commands/proxy/setup.js.map +7 -1
- package/dist/commands/proxy/start.js +289 -289
- package/dist/commands/proxy/start.js.map +7 -1
- package/dist/commands/proxy/status.js +74 -64
- package/dist/commands/proxy/status.js.map +7 -1
- package/dist/commands/proxy/stop.js +81 -75
- package/dist/commands/proxy/stop.js.map +7 -1
- package/dist/commands/research/backfill.js +58 -0
- package/dist/commands/research/backfill.js.map +7 -0
- package/dist/commands/research/tail-transcript.js +69 -0
- package/dist/commands/research/tail-transcript.js.map +7 -0
- package/dist/commands/service/install.js +639 -405
- package/dist/commands/service/install.js.map +7 -1
- package/dist/commands/service/status.js +178 -111
- package/dist/commands/service/status.js.map +7 -1
- package/dist/commands/service/uninstall.js +85 -110
- package/dist/commands/service/uninstall.js.map +7 -1
- package/dist/commands/sessions/analyze.js +46 -25
- package/dist/commands/sessions/analyze.js.map +7 -1
- package/dist/commands/sessions/end.js +81 -79
- package/dist/commands/sessions/end.js.map +7 -1
- package/dist/commands/sessions/import.js +44 -27
- package/dist/commands/sessions/import.js.map +7 -1
- package/dist/commands/sessions/list.js +46 -33
- package/dist/commands/sessions/list.js.map +7 -1
- package/dist/commands/sessions/start.js +88 -87
- package/dist/commands/sessions/start.js.map +7 -1
- package/dist/commands/signals/report.js +42 -34
- package/dist/commands/signals/report.js.map +7 -1
- package/dist/commands/skills/export-approved.js +44 -30
- package/dist/commands/skills/export-approved.js.map +7 -1
- package/dist/commands/skills/install.js +99 -84
- package/dist/commands/skills/install.js.map +7 -1
- package/dist/commands/skills/list.js +59 -42
- package/dist/commands/skills/list.js.map +7 -1
- package/dist/commands/skills/publish.js +95 -78
- package/dist/commands/skills/publish.js.map +7 -1
- package/dist/commands/skills/search.js +68 -53
- package/dist/commands/skills/search.js.map +7 -1
- package/dist/commands/skills/update.js +52 -39
- package/dist/commands/skills/update.js.map +7 -1
- package/dist/commands/suggestions/accept.js +82 -59
- package/dist/commands/suggestions/accept.js.map +7 -1
- package/dist/commands/suggestions/dismiss.js +44 -26
- package/dist/commands/suggestions/dismiss.js.map +7 -1
- package/dist/commands/suggestions/list.js +59 -39
- package/dist/commands/suggestions/list.js.map +7 -1
- package/dist/commands/suggestions/refresh.js +26 -11
- package/dist/commands/suggestions/refresh.js.map +7 -1
- package/dist/cursor-BGQJ4CWI.js +134 -0
- package/dist/cursor-BGQJ4CWI.js.map +7 -0
- package/dist/dashboard/Dashboard.js +229 -126
- package/dist/dashboard/Dashboard.js.map +7 -1
- package/dist/dashboard/data.js +13 -137
- package/dist/dashboard/data.js.map +7 -1
- package/dist/dashboard/launcher/ActiveJobsList.js +10 -0
- package/dist/dashboard/launcher/ActiveJobsList.js.map +7 -0
- package/dist/dashboard/launcher/LauncherOverlay.js +14 -0
- package/dist/dashboard/launcher/LauncherOverlay.js.map +7 -0
- package/dist/dashboard/launcher/NewLaunchForm.js +10 -0
- package/dist/dashboard/launcher/NewLaunchForm.js.map +7 -0
- package/dist/dashboard/launcher/api.js +14 -0
- package/dist/dashboard/launcher/api.js.map +7 -0
- package/dist/dashboard/launcher/tool-labels.js +10 -0
- package/dist/dashboard/launcher/tool-labels.js.map +7 -0
- package/dist/dashboard/launcher/types.js +1 -0
- package/dist/dashboard/launcher/types.js.map +7 -0
- package/dist/dashboard/launcher/useLaunchJobs.js +9 -0
- package/dist/dashboard/launcher/useLaunchJobs.js.map +7 -0
- package/dist/dashboard/panels/friction.js +10 -22
- package/dist/dashboard/panels/friction.js.map +7 -1
- package/dist/dashboard/panels/insights.js +10 -109
- package/dist/dashboard/panels/insights.js.map +7 -1
- package/dist/dashboard/panels/instructions.js +10 -17
- package/dist/dashboard/panels/instructions.js.map +7 -1
- package/dist/dashboard/panels/outcomes.js +9 -28
- package/dist/dashboard/panels/outcomes.js.map +7 -1
- package/dist/dashboard/panels/overview.js +10 -20
- package/dist/dashboard/panels/overview.js.map +7 -1
- package/dist/dashboard/panels/shared.js +18 -61
- package/dist/dashboard/panels/shared.js.map +7 -1
- package/dist/dashboard/types.js +23 -26
- package/dist/dashboard/types.js.map +7 -1
- package/dist/dist-CSUYFYKI.js +52 -0
- package/dist/dist-CSUYFYKI.js.map +7 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +7 -1
- package/dist/lib/active-org-refresh.js +15 -108
- package/dist/lib/active-org-refresh.js.map +7 -1
- package/dist/lib/active-org.js +15 -95
- package/dist/lib/active-org.js.map +7 -1
- package/dist/lib/agent-loop.js +44 -0
- package/dist/lib/agent-loop.js.map +7 -0
- package/dist/lib/antigravity-transcript.js +22 -0
- package/dist/lib/antigravity-transcript.js.map +7 -0
- package/dist/lib/api-client.js +21 -92
- package/dist/lib/api-client.js.map +7 -1
- package/dist/lib/auth.js +26 -137
- package/dist/lib/auth.js.map +7 -1
- package/dist/lib/detect-languages.js +8 -113
- package/dist/lib/detect-languages.js.map +7 -1
- package/dist/lib/detect-tmux.js +9 -0
- package/dist/lib/detect-tmux.js.map +7 -0
- package/dist/lib/eval-analyzer.js +9 -89
- package/dist/lib/eval-analyzer.js.map +7 -1
- package/dist/lib/eval-benchmark.js +12 -92
- package/dist/lib/eval-benchmark.js.map +7 -1
- package/dist/lib/eval-conversation-handler.js +13 -200
- package/dist/lib/eval-conversation-handler.js.map +7 -1
- package/dist/lib/eval-executor.js +8 -83
- package/dist/lib/eval-executor.js.map +7 -1
- package/dist/lib/eval-grader.js +9 -123
- package/dist/lib/eval-grader.js.map +7 -1
- package/dist/lib/eval-meta-judge.js +9 -116
- package/dist/lib/eval-meta-judge.js.map +7 -1
- package/dist/lib/eval-trigger-tester.js +11 -96
- package/dist/lib/eval-trigger-tester.js.map +7 -1
- package/dist/lib/eval-worktree.js +8 -87
- package/dist/lib/eval-worktree.js.map +7 -1
- package/dist/lib/gateway-entry.js +20 -18
- package/dist/lib/gateway-entry.js.map +7 -1
- package/dist/lib/gateway-lifecycle.js +22 -97
- package/dist/lib/gateway-lifecycle.js.map +7 -1
- package/dist/lib/gateway.js +12 -216
- package/dist/lib/gateway.js.map +7 -1
- package/dist/lib/handlers/cron-close-stale-sessions.js +18 -7
- package/dist/lib/handlers/cron-close-stale-sessions.js.map +7 -1
- package/dist/lib/handlers/cron-data-integrity-audit.js +21 -15
- package/dist/lib/handlers/cron-data-integrity-audit.js.map +7 -1
- package/dist/lib/handlers/cron-refresh-skills.js +7 -90
- package/dist/lib/handlers/cron-refresh-skills.js.map +7 -1
- package/dist/lib/handlers/cron-suggest-instructions.js +14 -158
- package/dist/lib/handlers/cron-suggest-instructions.js.map +7 -1
- package/dist/lib/handlers/process-announcement.js +11 -0
- package/dist/lib/handlers/process-announcement.js.map +7 -0
- package/dist/lib/handlers/process-changelog.js +11 -0
- package/dist/lib/handlers/process-changelog.js.map +7 -0
- package/dist/lib/handlers/process-conversation.js +14 -35
- package/dist/lib/handlers/process-conversation.js.map +7 -1
- package/dist/lib/handlers/process-eval.js +15 -207
- package/dist/lib/handlers/process-eval.js.map +7 -1
- package/dist/lib/handlers/process-insights.js +14 -300
- package/dist/lib/handlers/process-insights.js.map +7 -1
- package/dist/lib/handlers/process-launch.js +16 -41
- package/dist/lib/handlers/process-launch.js.map +7 -1
- package/dist/lib/handlers/process-run-cleanup.js +13 -0
- package/dist/lib/handlers/process-run-cleanup.js.map +7 -0
- package/dist/lib/handlers/process-send-message.js +10 -0
- package/dist/lib/handlers/process-send-message.js.map +7 -0
- package/dist/lib/handlers/process-session-goal.js +11 -74
- package/dist/lib/handlers/process-session-goal.js.map +7 -1
- package/dist/lib/hooks-config.js +52 -544
- package/dist/lib/hooks-config.js.map +7 -1
- package/dist/lib/insights-prompts.js +12 -145
- package/dist/lib/insights-prompts.js.map +7 -1
- package/dist/lib/job-helpers.js +1 -0
- package/dist/lib/job-helpers.js.map +7 -0
- package/dist/lib/llm-client.js +16 -274
- package/dist/lib/llm-client.js.map +7 -1
- package/dist/lib/manual-tasks.js +22 -0
- package/dist/lib/manual-tasks.js.map +7 -0
- package/dist/lib/output.js +12 -36
- package/dist/lib/output.js.map +7 -1
- package/dist/lib/permanent-job-error.js +10 -23
- package/dist/lib/permanent-job-error.js.map +7 -1
- package/dist/lib/provider-aggregator.js +57 -55
- package/dist/lib/provider-aggregator.js.map +7 -1
- package/dist/lib/research-client.js +12 -0
- package/dist/lib/research-client.js.map +7 -0
- package/dist/lib/skills-loader.js +8 -51
- package/dist/lib/skills-loader.js.map +7 -1
- package/dist/lib/statusline-shim.js +16 -0
- package/dist/lib/statusline-shim.js.map +7 -0
- package/dist/lib/terminal-target-heartbeat.js +15 -0
- package/dist/lib/terminal-target-heartbeat.js.map +7 -0
- package/dist/lib/tmux.js +16 -0
- package/dist/lib/tmux.js.map +7 -0
- package/dist/lib/transcript-rate-limit-watcher.js +22 -0
- package/dist/lib/transcript-rate-limit-watcher.js.map +7 -0
- package/dist/lib/types.js +8 -7
- package/dist/lib/types.js.map +7 -1
- package/dist/lib/version-check.js +10 -106
- package/dist/lib/version-check.js.map +7 -1
- package/dist/lib/which.js +8 -0
- package/dist/lib/which.js.map +7 -0
- package/dist/lib/worktree.js +17 -0
- package/dist/lib/worktree.js.map +7 -0
- package/dist/opencode-IQ7X5YMJ.js +190 -0
- package/dist/opencode-IQ7X5YMJ.js.map +7 -0
- package/oclif.manifest.json +299 -66
- package/package.json +26 -10
- package/dist/base-command.d.ts +0 -12
- package/dist/base-command.d.ts.map +0 -1
- package/dist/commands/auth/create-key.d.ts +0 -11
- package/dist/commands/auth/create-key.d.ts.map +0 -1
- package/dist/commands/auth/login.d.ts +0 -11
- package/dist/commands/auth/login.d.ts.map +0 -1
- package/dist/commands/auth/logout.d.ts +0 -7
- package/dist/commands/auth/logout.d.ts.map +0 -1
- package/dist/commands/auth/revoke-key.d.ts +0 -10
- package/dist/commands/auth/revoke-key.d.ts.map +0 -1
- package/dist/commands/auth/status.d.ts +0 -7
- package/dist/commands/auth/status.d.ts.map +0 -1
- package/dist/commands/catalog/index.d.ts +0 -11
- package/dist/commands/catalog/index.d.ts.map +0 -1
- package/dist/commands/catalog/recommend.d.ts +0 -9
- package/dist/commands/catalog/recommend.d.ts.map +0 -1
- package/dist/commands/convert.d.ts +0 -15
- package/dist/commands/convert.d.ts.map +0 -1
- package/dist/commands/converters.d.ts +0 -12
- package/dist/commands/converters.d.ts.map +0 -1
- package/dist/commands/crons/list.d.ts +0 -7
- package/dist/commands/crons/list.d.ts.map +0 -1
- package/dist/commands/crons/run.d.ts +0 -13
- package/dist/commands/crons/run.d.ts.map +0 -1
- package/dist/commands/dashboard.d.ts +0 -10
- package/dist/commands/dashboard.d.ts.map +0 -1
- package/dist/commands/eval-targets/create.d.ts +0 -14
- package/dist/commands/eval-targets/create.d.ts.map +0 -1
- package/dist/commands/eval-targets/list.d.ts +0 -10
- package/dist/commands/eval-targets/list.d.ts.map +0 -1
- package/dist/commands/evals/benchmark.d.ts +0 -13
- package/dist/commands/evals/benchmark.d.ts.map +0 -1
- package/dist/commands/evals/compare.d.ts +0 -15
- package/dist/commands/evals/compare.d.ts.map +0 -1
- package/dist/commands/evals/create.d.ts +0 -17
- package/dist/commands/evals/create.d.ts.map +0 -1
- package/dist/commands/evals/listen.d.ts +0 -37
- package/dist/commands/evals/listen.d.ts.map +0 -1
- package/dist/commands/evals/listen.js +0 -188
- package/dist/commands/evals/listen.js.map +0 -1
- package/dist/commands/evals/listen.test.d.ts +0 -2
- package/dist/commands/evals/listen.test.d.ts.map +0 -1
- package/dist/commands/evals/listen.test.js +0 -48
- package/dist/commands/evals/listen.test.js.map +0 -1
- package/dist/commands/evals/optimize-description.d.ts +0 -22
- package/dist/commands/evals/optimize-description.d.ts.map +0 -1
- package/dist/commands/evals/optimize.d.ts +0 -22
- package/dist/commands/evals/optimize.d.ts.map +0 -1
- package/dist/commands/evals/run.d.ts +0 -21
- package/dist/commands/evals/run.d.ts.map +0 -1
- package/dist/commands/gateway/ensure.d.ts +0 -7
- package/dist/commands/gateway/ensure.d.ts.map +0 -1
- package/dist/commands/hooks/install.d.ts +0 -16
- package/dist/commands/hooks/install.d.ts.map +0 -1
- package/dist/commands/hooks/run.d.ts +0 -11
- package/dist/commands/hooks/run.d.ts.map +0 -1
- package/dist/commands/hooks/uninstall.d.ts +0 -7
- package/dist/commands/hooks/uninstall.d.ts.map +0 -1
- package/dist/commands/import.d.ts +0 -17
- package/dist/commands/import.d.ts.map +0 -1
- package/dist/commands/instructions/create.d.ts +0 -17
- package/dist/commands/instructions/create.d.ts.map +0 -1
- package/dist/commands/instructions/delete.d.ts +0 -13
- package/dist/commands/instructions/delete.d.ts.map +0 -1
- package/dist/commands/instructions/fork.d.ts +0 -10
- package/dist/commands/instructions/fork.d.ts.map +0 -1
- package/dist/commands/instructions/get.d.ts +0 -15
- package/dist/commands/instructions/get.d.ts.map +0 -1
- package/dist/commands/instructions/list.d.ts +0 -12
- package/dist/commands/instructions/list.d.ts.map +0 -1
- package/dist/commands/instructions/promote.d.ts +0 -14
- package/dist/commands/instructions/promote.d.ts.map +0 -1
- package/dist/commands/instructions/pull.d.ts +0 -9
- package/dist/commands/instructions/pull.d.ts.map +0 -1
- package/dist/commands/instructions/upstream.d.ts +0 -9
- package/dist/commands/instructions/upstream.d.ts.map +0 -1
- package/dist/commands/instructions/versions.d.ts +0 -12
- package/dist/commands/instructions/versions.d.ts.map +0 -1
- package/dist/commands/org/current.d.ts +0 -7
- package/dist/commands/org/current.d.ts.map +0 -1
- package/dist/commands/org/list.d.ts +0 -7
- package/dist/commands/org/list.d.ts.map +0 -1
- package/dist/commands/org/switch.d.ts +0 -13
- package/dist/commands/org/switch.d.ts.map +0 -1
- package/dist/commands/packs/add-instruction.d.ts +0 -11
- package/dist/commands/packs/add-instruction.d.ts.map +0 -1
- package/dist/commands/packs/apply.d.ts +0 -13
- package/dist/commands/packs/apply.d.ts.map +0 -1
- package/dist/commands/packs/create.d.ts +0 -13
- package/dist/commands/packs/create.d.ts.map +0 -1
- package/dist/commands/packs/fork.d.ts +0 -10
- package/dist/commands/packs/fork.d.ts.map +0 -1
- package/dist/commands/packs/get.d.ts +0 -10
- package/dist/commands/packs/get.d.ts.map +0 -1
- package/dist/commands/packs/list.d.ts +0 -22
- package/dist/commands/packs/list.d.ts.map +0 -1
- package/dist/commands/packs/remove-instruction.d.ts +0 -11
- package/dist/commands/packs/remove-instruction.d.ts.map +0 -1
- package/dist/commands/proxy/env.d.ts +0 -14
- package/dist/commands/proxy/env.d.ts.map +0 -1
- package/dist/commands/proxy/logs.d.ts +0 -11
- package/dist/commands/proxy/logs.d.ts.map +0 -1
- package/dist/commands/proxy/restart.d.ts +0 -11
- package/dist/commands/proxy/restart.d.ts.map +0 -1
- package/dist/commands/proxy/setup.d.ts +0 -23
- package/dist/commands/proxy/setup.d.ts.map +0 -1
- package/dist/commands/proxy/start.d.ts +0 -17
- package/dist/commands/proxy/start.d.ts.map +0 -1
- package/dist/commands/proxy/status.d.ts +0 -7
- package/dist/commands/proxy/status.d.ts.map +0 -1
- package/dist/commands/proxy/stop.d.ts +0 -8
- package/dist/commands/proxy/stop.d.ts.map +0 -1
- package/dist/commands/service/install.d.ts +0 -33
- package/dist/commands/service/install.d.ts.map +0 -1
- package/dist/commands/service/install.test.d.ts +0 -2
- package/dist/commands/service/install.test.d.ts.map +0 -1
- package/dist/commands/service/install.test.js +0 -345
- package/dist/commands/service/install.test.js.map +0 -1
- package/dist/commands/service/status.d.ts +0 -6
- package/dist/commands/service/status.d.ts.map +0 -1
- package/dist/commands/service/uninstall.d.ts +0 -6
- package/dist/commands/service/uninstall.d.ts.map +0 -1
- package/dist/commands/sessions/analyze.d.ts +0 -10
- package/dist/commands/sessions/analyze.d.ts.map +0 -1
- package/dist/commands/sessions/end.d.ts +0 -9
- package/dist/commands/sessions/end.d.ts.map +0 -1
- package/dist/commands/sessions/import.d.ts +0 -13
- package/dist/commands/sessions/import.d.ts.map +0 -1
- package/dist/commands/sessions/list.d.ts +0 -11
- package/dist/commands/sessions/list.d.ts.map +0 -1
- package/dist/commands/sessions/start.d.ts +0 -11
- package/dist/commands/sessions/start.d.ts.map +0 -1
- package/dist/commands/signals/report.d.ts +0 -10
- package/dist/commands/signals/report.d.ts.map +0 -1
- package/dist/commands/signals/report.test.d.ts +0 -2
- package/dist/commands/signals/report.test.d.ts.map +0 -1
- package/dist/commands/signals/report.test.js +0 -65
- package/dist/commands/signals/report.test.js.map +0 -1
- package/dist/commands/skills/export-approved.d.ts +0 -10
- package/dist/commands/skills/export-approved.d.ts.map +0 -1
- package/dist/commands/skills/install.d.ts +0 -15
- package/dist/commands/skills/install.d.ts.map +0 -1
- package/dist/commands/skills/list.d.ts +0 -11
- package/dist/commands/skills/list.d.ts.map +0 -1
- package/dist/commands/skills/publish.d.ts +0 -17
- package/dist/commands/skills/publish.d.ts.map +0 -1
- package/dist/commands/skills/search.d.ts +0 -17
- package/dist/commands/skills/search.d.ts.map +0 -1
- package/dist/commands/skills/update.d.ts +0 -10
- package/dist/commands/skills/update.d.ts.map +0 -1
- package/dist/commands/suggestions/accept.d.ts +0 -16
- package/dist/commands/suggestions/accept.d.ts.map +0 -1
- package/dist/commands/suggestions/accept.test.d.ts +0 -2
- package/dist/commands/suggestions/accept.test.d.ts.map +0 -1
- package/dist/commands/suggestions/accept.test.js +0 -52
- package/dist/commands/suggestions/accept.test.js.map +0 -1
- package/dist/commands/suggestions/dismiss.d.ts +0 -10
- package/dist/commands/suggestions/dismiss.d.ts.map +0 -1
- package/dist/commands/suggestions/list.d.ts +0 -10
- package/dist/commands/suggestions/list.d.ts.map +0 -1
- package/dist/commands/suggestions/refresh.d.ts +0 -7
- package/dist/commands/suggestions/refresh.d.ts.map +0 -1
- package/dist/dashboard/Dashboard.d.ts +0 -3
- package/dist/dashboard/Dashboard.d.ts.map +0 -1
- package/dist/dashboard/data.d.ts +0 -11
- package/dist/dashboard/data.d.ts.map +0 -1
- package/dist/dashboard/panels/friction.d.ts +0 -7
- package/dist/dashboard/panels/friction.d.ts.map +0 -1
- package/dist/dashboard/panels/insights.d.ts +0 -8
- package/dist/dashboard/panels/insights.d.ts.map +0 -1
- package/dist/dashboard/panels/instructions.d.ts +0 -9
- package/dist/dashboard/panels/instructions.d.ts.map +0 -1
- package/dist/dashboard/panels/outcomes.d.ts +0 -7
- package/dist/dashboard/panels/outcomes.d.ts.map +0 -1
- package/dist/dashboard/panels/overview.d.ts +0 -8
- package/dist/dashboard/panels/overview.d.ts.map +0 -1
- package/dist/dashboard/panels/shared.d.ts +0 -17
- package/dist/dashboard/panels/shared.d.ts.map +0 -1
- package/dist/dashboard/types.d.ts +0 -80
- package/dist/dashboard/types.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/active-org-refresh.d.ts +0 -22
- package/dist/lib/active-org-refresh.d.ts.map +0 -1
- package/dist/lib/active-org-refresh.test.d.ts +0 -2
- package/dist/lib/active-org-refresh.test.d.ts.map +0 -1
- package/dist/lib/active-org-refresh.test.js +0 -190
- package/dist/lib/active-org-refresh.test.js.map +0 -1
- package/dist/lib/active-org.d.ts +0 -43
- package/dist/lib/active-org.d.ts.map +0 -1
- package/dist/lib/active-org.test.d.ts +0 -2
- package/dist/lib/active-org.test.d.ts.map +0 -1
- package/dist/lib/active-org.test.js +0 -147
- package/dist/lib/active-org.test.js.map +0 -1
- package/dist/lib/api-client.d.ts +0 -17
- package/dist/lib/api-client.d.ts.map +0 -1
- package/dist/lib/api-client.test.d.ts +0 -2
- package/dist/lib/api-client.test.d.ts.map +0 -1
- package/dist/lib/api-client.test.js +0 -161
- package/dist/lib/api-client.test.js.map +0 -1
- package/dist/lib/auth.d.ts +0 -27
- package/dist/lib/auth.d.ts.map +0 -1
- package/dist/lib/auth.test.d.ts +0 -2
- package/dist/lib/auth.test.d.ts.map +0 -1
- package/dist/lib/auth.test.js +0 -110
- package/dist/lib/auth.test.js.map +0 -1
- package/dist/lib/cron-registry.d.ts +0 -47
- package/dist/lib/cron-registry.d.ts.map +0 -1
- package/dist/lib/cron-registry.js +0 -102
- package/dist/lib/cron-registry.js.map +0 -1
- package/dist/lib/cron-registry.test.d.ts +0 -2
- package/dist/lib/cron-registry.test.d.ts.map +0 -1
- package/dist/lib/cron-registry.test.js +0 -136
- package/dist/lib/cron-registry.test.js.map +0 -1
- package/dist/lib/cron-runner.d.ts +0 -16
- package/dist/lib/cron-runner.d.ts.map +0 -1
- package/dist/lib/cron-runner.js +0 -68
- package/dist/lib/cron-runner.js.map +0 -1
- package/dist/lib/detect-languages.d.ts +0 -7
- package/dist/lib/detect-languages.d.ts.map +0 -1
- package/dist/lib/detect-languages.test.d.ts +0 -2
- package/dist/lib/detect-languages.test.d.ts.map +0 -1
- package/dist/lib/detect-languages.test.js +0 -29
- package/dist/lib/detect-languages.test.js.map +0 -1
- package/dist/lib/eval-analyzer.d.ts +0 -23
- package/dist/lib/eval-analyzer.d.ts.map +0 -1
- package/dist/lib/eval-benchmark.d.ts +0 -17
- package/dist/lib/eval-benchmark.d.ts.map +0 -1
- package/dist/lib/eval-conversation-handler.d.ts +0 -9
- package/dist/lib/eval-conversation-handler.d.ts.map +0 -1
- package/dist/lib/eval-executor.d.ts +0 -21
- package/dist/lib/eval-executor.d.ts.map +0 -1
- package/dist/lib/eval-executor.test.d.ts +0 -2
- package/dist/lib/eval-executor.test.d.ts.map +0 -1
- package/dist/lib/eval-executor.test.js +0 -8
- package/dist/lib/eval-executor.test.js.map +0 -1
- package/dist/lib/eval-grader.d.ts +0 -38
- package/dist/lib/eval-grader.d.ts.map +0 -1
- package/dist/lib/eval-grader.test.d.ts +0 -2
- package/dist/lib/eval-grader.test.d.ts.map +0 -1
- package/dist/lib/eval-grader.test.js +0 -8
- package/dist/lib/eval-grader.test.js.map +0 -1
- package/dist/lib/eval-meta-judge.d.ts +0 -28
- package/dist/lib/eval-meta-judge.d.ts.map +0 -1
- package/dist/lib/eval-trigger-tester.d.ts +0 -19
- package/dist/lib/eval-trigger-tester.d.ts.map +0 -1
- package/dist/lib/eval-worktree.d.ts +0 -11
- package/dist/lib/eval-worktree.d.ts.map +0 -1
- package/dist/lib/eval-worktree.test.d.ts +0 -2
- package/dist/lib/eval-worktree.test.d.ts.map +0 -1
- package/dist/lib/eval-worktree.test.js +0 -68
- package/dist/lib/eval-worktree.test.js.map +0 -1
- package/dist/lib/gateway-entry.d.ts +0 -3
- package/dist/lib/gateway-entry.d.ts.map +0 -1
- package/dist/lib/gateway-lifecycle.d.ts +0 -9
- package/dist/lib/gateway-lifecycle.d.ts.map +0 -1
- package/dist/lib/gateway.d.ts +0 -11
- package/dist/lib/gateway.d.ts.map +0 -1
- package/dist/lib/graphile-worker-runner.d.ts +0 -124
- package/dist/lib/graphile-worker-runner.d.ts.map +0 -1
- package/dist/lib/graphile-worker-runner.js +0 -530
- package/dist/lib/graphile-worker-runner.js.map +0 -1
- package/dist/lib/graphile-worker-runner.test.d.ts +0 -2
- package/dist/lib/graphile-worker-runner.test.d.ts.map +0 -1
- package/dist/lib/graphile-worker-runner.test.js +0 -153
- package/dist/lib/graphile-worker-runner.test.js.map +0 -1
- package/dist/lib/handlers/cron-close-stale-sessions.d.ts +0 -3
- package/dist/lib/handlers/cron-close-stale-sessions.d.ts.map +0 -1
- package/dist/lib/handlers/cron-data-integrity-audit.d.ts +0 -3
- package/dist/lib/handlers/cron-data-integrity-audit.d.ts.map +0 -1
- package/dist/lib/handlers/cron-refresh-skills.d.ts +0 -3
- package/dist/lib/handlers/cron-refresh-skills.d.ts.map +0 -1
- package/dist/lib/handlers/cron-refresh-skills.test.d.ts +0 -2
- package/dist/lib/handlers/cron-refresh-skills.test.d.ts.map +0 -1
- package/dist/lib/handlers/cron-refresh-skills.test.js +0 -114
- package/dist/lib/handlers/cron-refresh-skills.test.js.map +0 -1
- package/dist/lib/handlers/cron-regenerate-insights.d.ts +0 -3
- package/dist/lib/handlers/cron-regenerate-insights.d.ts.map +0 -1
- package/dist/lib/handlers/cron-regenerate-insights.js +0 -6
- package/dist/lib/handlers/cron-regenerate-insights.js.map +0 -1
- package/dist/lib/handlers/cron-suggest-instructions.d.ts +0 -3
- package/dist/lib/handlers/cron-suggest-instructions.d.ts.map +0 -1
- package/dist/lib/handlers/cron-suggest-instructions.test.d.ts +0 -2
- package/dist/lib/handlers/cron-suggest-instructions.test.d.ts.map +0 -1
- package/dist/lib/handlers/cron-suggest-instructions.test.js +0 -80
- package/dist/lib/handlers/cron-suggest-instructions.test.js.map +0 -1
- package/dist/lib/handlers/process-conversation.d.ts +0 -35
- package/dist/lib/handlers/process-conversation.d.ts.map +0 -1
- package/dist/lib/handlers/process-eval.d.ts +0 -32
- package/dist/lib/handlers/process-eval.d.ts.map +0 -1
- package/dist/lib/handlers/process-insights.d.ts +0 -39
- package/dist/lib/handlers/process-insights.d.ts.map +0 -1
- package/dist/lib/handlers/process-launch.d.ts +0 -29
- package/dist/lib/handlers/process-launch.d.ts.map +0 -1
- package/dist/lib/handlers/process-session-goal.d.ts +0 -29
- package/dist/lib/handlers/process-session-goal.d.ts.map +0 -1
- package/dist/lib/handlers/process-session-goal.test.d.ts +0 -2
- package/dist/lib/handlers/process-session-goal.test.d.ts.map +0 -1
- package/dist/lib/handlers/process-session-goal.test.js +0 -134
- package/dist/lib/handlers/process-session-goal.test.js.map +0 -1
- package/dist/lib/hooks-config.d.ts +0 -119
- package/dist/lib/hooks-config.d.ts.map +0 -1
- package/dist/lib/hooks-config.test.d.ts +0 -2
- package/dist/lib/hooks-config.test.d.ts.map +0 -1
- package/dist/lib/hooks-config.test.js +0 -231
- package/dist/lib/hooks-config.test.js.map +0 -1
- package/dist/lib/insights-prompts.d.ts +0 -13
- package/dist/lib/insights-prompts.d.ts.map +0 -1
- package/dist/lib/llm-client.d.ts +0 -26
- package/dist/lib/llm-client.d.ts.map +0 -1
- package/dist/lib/llm-client.test.d.ts +0 -2
- package/dist/lib/llm-client.test.d.ts.map +0 -1
- package/dist/lib/llm-client.test.js +0 -62
- package/dist/lib/llm-client.test.js.map +0 -1
- package/dist/lib/mirror-writer-db.d.ts +0 -12
- package/dist/lib/mirror-writer-db.d.ts.map +0 -1
- package/dist/lib/mirror-writer-db.js +0 -51
- package/dist/lib/mirror-writer-db.js.map +0 -1
- package/dist/lib/mirror-writer.d.ts +0 -35
- package/dist/lib/mirror-writer.d.ts.map +0 -1
- package/dist/lib/mirror-writer.js +0 -27
- package/dist/lib/mirror-writer.js.map +0 -1
- package/dist/lib/mirror-writer.test.d.ts +0 -2
- package/dist/lib/mirror-writer.test.d.ts.map +0 -1
- package/dist/lib/mirror-writer.test.js +0 -47
- package/dist/lib/mirror-writer.test.js.map +0 -1
- package/dist/lib/output.d.ts +0 -4
- package/dist/lib/output.d.ts.map +0 -1
- package/dist/lib/output.test.d.ts +0 -2
- package/dist/lib/output.test.d.ts.map +0 -1
- package/dist/lib/output.test.js +0 -71
- package/dist/lib/output.test.js.map +0 -1
- package/dist/lib/permanent-job-error.d.ts +0 -17
- package/dist/lib/permanent-job-error.d.ts.map +0 -1
- package/dist/lib/permanent-job-error.test.d.ts +0 -2
- package/dist/lib/permanent-job-error.test.d.ts.map +0 -1
- package/dist/lib/permanent-job-error.test.js +0 -29
- package/dist/lib/permanent-job-error.test.js.map +0 -1
- package/dist/lib/provider-aggregator.d.ts +0 -24
- package/dist/lib/provider-aggregator.d.ts.map +0 -1
- package/dist/lib/provider-aggregator.test.d.ts +0 -2
- package/dist/lib/provider-aggregator.test.d.ts.map +0 -1
- package/dist/lib/provider-aggregator.test.js +0 -103
- package/dist/lib/provider-aggregator.test.js.map +0 -1
- package/dist/lib/skills-loader.d.ts +0 -6
- package/dist/lib/skills-loader.d.ts.map +0 -1
- package/dist/lib/types.d.ts +0 -48
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/version-check.d.ts +0 -11
- package/dist/lib/version-check.d.ts.map +0 -1
- package/dist/test-helpers.d.ts +0 -58
- package/dist/test-helpers.d.ts.map +0 -1
- package/dist/test-helpers.js +0 -58
- package/dist/test-helpers.js.map +0 -1
|
@@ -1,310 +1,310 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import {
|
|
2
|
+
findBinary
|
|
3
|
+
} from "../../chunk-ERPMDAO3.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseCommand
|
|
6
|
+
} from "../../chunk-S56LOTGQ.js";
|
|
7
|
+
import "../../chunk-OGVORIFM.js";
|
|
8
|
+
import "../../chunk-2AM54TUK.js";
|
|
9
|
+
import "../../chunk-EJOI2ZGU.js";
|
|
10
|
+
import {
|
|
11
|
+
isAuthenticated
|
|
12
|
+
} from "../../chunk-KZRFUXGF.js";
|
|
13
|
+
import "../../chunk-EKJ2CABV.js";
|
|
14
|
+
import "../../chunk-NSBPE2FW.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/proxy/start.ts
|
|
17
|
+
import { Flags } from "@oclif/core";
|
|
18
|
+
import { execSync, spawn, spawnSync } from "node:child_process";
|
|
19
|
+
import { appendFileSync, existsSync, mkdirSync, openSync, readFileSync, writeFileSync } from "node:fs";
|
|
20
|
+
import { homedir } from "node:os";
|
|
21
|
+
import { join, resolve } from "node:path";
|
|
22
|
+
var DEFAULT_PORT = 8788;
|
|
23
|
+
var CONFIG_DIR = join(homedir(), ".config", "rulemetric");
|
|
24
|
+
var PID_FILE = join(CONFIG_DIR, "proxy.pid");
|
|
25
|
+
var LOG_FILE = join(CONFIG_DIR, "proxy.log");
|
|
26
|
+
var DOCKER_IMAGE = "rulemetric/proxy";
|
|
27
|
+
var DOCKER_CONTAINER = "rulemetric-proxy";
|
|
14
28
|
function findAddonPath() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
const candidates = [
|
|
30
|
+
resolve(import.meta.dirname, "../../../../../packages/proxy/addon/rulemetric_addon.py"),
|
|
31
|
+
resolve(import.meta.dirname, "../../../node_modules/@rulemetric/proxy/addon/rulemetric_addon.py"),
|
|
32
|
+
resolve(import.meta.dirname, "../../../../../node_modules/@rulemetric/proxy/addon/rulemetric_addon.py")
|
|
33
|
+
];
|
|
34
|
+
for (const p of candidates) {
|
|
35
|
+
if (existsSync(p)) return p;
|
|
36
|
+
}
|
|
37
|
+
throw new Error(
|
|
38
|
+
"Could not find rulemetric_addon.py. Is @rulemetric/proxy installed?\nSearched:\n" + candidates.map((c) => ` ${c}`).join("\n")
|
|
39
|
+
);
|
|
26
40
|
}
|
|
27
41
|
function findDockerfilePath() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
throw new Error('Could not find proxy Dockerfile. Is @rulemetric/proxy installed?');
|
|
42
|
+
const candidates = [
|
|
43
|
+
resolve(import.meta.dirname, "../../../../../packages/proxy"),
|
|
44
|
+
resolve(import.meta.dirname, "../../../node_modules/@rulemetric/proxy"),
|
|
45
|
+
resolve(import.meta.dirname, "../../../../../node_modules/@rulemetric/proxy")
|
|
46
|
+
];
|
|
47
|
+
for (const p of candidates) {
|
|
48
|
+
if (existsSync(join(p, "Dockerfile"))) return p;
|
|
49
|
+
}
|
|
50
|
+
throw new Error("Could not find proxy Dockerfile. Is @rulemetric/proxy installed?");
|
|
38
51
|
}
|
|
39
52
|
function dockerImageExists() {
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
const result = spawnSync("docker", ["image", "inspect", DOCKER_IMAGE], { stdio: "ignore" });
|
|
54
|
+
return result.status === 0;
|
|
42
55
|
}
|
|
43
56
|
function dockerContainerRunning() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
const result = spawnSync("docker", ["container", "inspect", "-f", "{{.State.Running}}", DOCKER_CONTAINER], {
|
|
58
|
+
encoding: "utf-8",
|
|
59
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
60
|
+
});
|
|
61
|
+
return result.status === 0 && result.stdout?.trim() === "true";
|
|
49
62
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
var ProxyStart = class _ProxyStart extends BaseCommand {
|
|
64
|
+
static description = "Start context capture proxy";
|
|
65
|
+
static examples = [
|
|
66
|
+
"<%= config.bin %> proxy start",
|
|
67
|
+
"<%= config.bin %> proxy start --docker",
|
|
68
|
+
"<%= config.bin %> proxy start --port 9090",
|
|
69
|
+
"<%= config.bin %> proxy start --web"
|
|
70
|
+
];
|
|
71
|
+
static flags = {
|
|
72
|
+
port: Flags.integer({ char: "p", default: DEFAULT_PORT, description: "Proxy listen port" }),
|
|
73
|
+
docker: Flags.boolean({ char: "d", default: false, description: "Run proxy in Docker (no local mitmproxy needed)" }),
|
|
74
|
+
web: Flags.boolean({ default: false, description: "Launch mitmweb debug UI instead of mitmdump (local mode only)" }),
|
|
75
|
+
"skip-checks": Flags.boolean({ default: false, description: "Skip prerequisite checks" }),
|
|
76
|
+
build: Flags.boolean({ default: false, description: "Force rebuild Docker image" })
|
|
77
|
+
};
|
|
78
|
+
async run() {
|
|
79
|
+
const { flags } = await this.parse(_ProxyStart);
|
|
80
|
+
const port = flags.port;
|
|
81
|
+
if (flags.docker) {
|
|
82
|
+
await this.startDocker(port, flags.build);
|
|
83
|
+
} else {
|
|
84
|
+
await this.startLocal(port, flags.web, flags["skip-checks"]);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async startDocker(port, forceBuild) {
|
|
88
|
+
try {
|
|
89
|
+
execSync("docker info", { stdio: "ignore" });
|
|
90
|
+
} catch {
|
|
91
|
+
this.error("Docker is not running. Start Docker Desktop and try again.");
|
|
92
|
+
}
|
|
93
|
+
if (dockerContainerRunning()) {
|
|
94
|
+
this.error(`Proxy container already running. Stop it first: rulemetric proxy stop`);
|
|
95
|
+
}
|
|
96
|
+
const composeFile = this.findComposeFile();
|
|
97
|
+
const certDir = join(homedir(), ".mitmproxy");
|
|
98
|
+
mkdirSync(certDir, { recursive: true });
|
|
99
|
+
const tmpDir = process.env.TMPDIR || "/tmp";
|
|
100
|
+
mkdirSync(join(tmpDir, "rulemetric"), { recursive: true });
|
|
101
|
+
const envOverrides = {
|
|
102
|
+
PROXY_PORT: String(port),
|
|
103
|
+
RULEMETRIC_PROJECT_PATH: process.cwd()
|
|
64
104
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
105
|
+
if (!process.env.RULEMETRIC_API_KEY && !process.env.RULEMETRIC_ACCESS_TOKEN) {
|
|
106
|
+
const envFile = join(homedir(), ".config", "rulemetric", "env");
|
|
107
|
+
if (existsSync(envFile)) {
|
|
108
|
+
for (const line of readFileSync(envFile, "utf-8").split("\n")) {
|
|
109
|
+
const trimmed = line.trim();
|
|
110
|
+
if (trimmed && !trimmed.startsWith("#") && trimmed.includes("=")) {
|
|
111
|
+
const [key, ...rest] = trimmed.split("=");
|
|
112
|
+
envOverrides[key] = rest.join("=");
|
|
113
|
+
}
|
|
73
114
|
}
|
|
115
|
+
}
|
|
74
116
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const envOverrides = {
|
|
96
|
-
PROXY_PORT: String(port),
|
|
97
|
-
RULEMETRIC_PROJECT_PATH: process.cwd(),
|
|
98
|
-
};
|
|
99
|
-
if (!process.env.RULEMETRIC_API_KEY && !process.env.RULEMETRIC_ACCESS_TOKEN) {
|
|
100
|
-
const envFile = join(homedir(), '.config', 'rulemetric', 'env');
|
|
101
|
-
if (existsSync(envFile)) {
|
|
102
|
-
for (const line of readFileSync(envFile, 'utf-8').split('\n')) {
|
|
103
|
-
const trimmed = line.trim();
|
|
104
|
-
if (trimmed && !trimmed.startsWith('#') && trimmed.includes('=')) {
|
|
105
|
-
const [key, ...rest] = trimmed.split('=');
|
|
106
|
-
envOverrides[key] = rest.join('=');
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (composeFile) {
|
|
112
|
-
// Use docker compose
|
|
113
|
-
const composeEnv = { ...process.env, ...envOverrides };
|
|
114
|
-
const buildFlag = forceBuild ? '--build' : '';
|
|
115
|
-
const args = ['compose', '-f', composeFile, 'up', '-d', 'proxy'];
|
|
116
|
-
if (forceBuild)
|
|
117
|
-
args.splice(4, 0, '--build');
|
|
118
|
-
this.log(forceBuild ? 'Building and starting proxy via Docker Compose...' : 'Starting proxy via Docker Compose...');
|
|
119
|
-
const result = spawnSync('docker', args, {
|
|
120
|
-
env: composeEnv,
|
|
121
|
-
stdio: 'inherit',
|
|
122
|
-
});
|
|
123
|
-
if (result.status !== 0) {
|
|
124
|
-
this.error('Docker Compose failed. Try: docker compose -f docker-compose.yml up proxy');
|
|
125
|
-
}
|
|
117
|
+
if (composeFile) {
|
|
118
|
+
const composeEnv = { ...process.env, ...envOverrides };
|
|
119
|
+
const buildFlag = forceBuild ? "--build" : "";
|
|
120
|
+
const args = ["compose", "-f", composeFile, "up", "-d", "proxy"];
|
|
121
|
+
if (forceBuild) args.splice(4, 0, "--build");
|
|
122
|
+
this.log(forceBuild ? "Building and starting proxy via Docker Compose..." : "Starting proxy via Docker Compose...");
|
|
123
|
+
const result = spawnSync("docker", args, {
|
|
124
|
+
env: composeEnv,
|
|
125
|
+
stdio: "inherit"
|
|
126
|
+
});
|
|
127
|
+
if (result.status !== 0) {
|
|
128
|
+
this.error("Docker Compose failed. Try: docker compose -f docker-compose.yml up proxy");
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
if (forceBuild || !dockerImageExists()) {
|
|
132
|
+
const proxyDir = findDockerfilePath();
|
|
133
|
+
this.log("Building proxy Docker image...");
|
|
134
|
+
const build = spawnSync("docker", ["build", "-t", DOCKER_IMAGE, proxyDir], { stdio: "inherit" });
|
|
135
|
+
if (build.status !== 0) {
|
|
136
|
+
this.error("Docker build failed");
|
|
126
137
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
DOCKER_IMAGE,
|
|
155
|
-
];
|
|
156
|
-
const result = spawnSync('docker', dockerArgs, { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
157
|
-
if (result.status !== 0) {
|
|
158
|
-
this.error(`Failed to start container: ${result.stderr}`);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
// Write marker so proxy stop knows it's Docker
|
|
162
|
-
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
163
|
-
writeFileSync(PID_FILE, `docker:${DOCKER_CONTAINER}`);
|
|
164
|
-
// Wait for container to be ready
|
|
165
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
166
|
-
const inspectResult = spawnSync('docker', ['container', 'inspect', '-f', '{{.Id}}', DOCKER_CONTAINER], {
|
|
167
|
-
encoding: 'utf-8', stdio: ['ignore', 'pipe', 'ignore'],
|
|
168
|
-
});
|
|
169
|
-
const containerId = inspectResult.stdout?.trim().slice(0, 12) || 'unknown';
|
|
170
|
-
this.log(`Proxy running in Docker on localhost:${port} (container: ${containerId})`);
|
|
171
|
-
this.log('');
|
|
172
|
-
this.log('View logs: rulemetric proxy logs -f');
|
|
138
|
+
}
|
|
139
|
+
spawnSync("docker", ["rm", "-f", DOCKER_CONTAINER], { stdio: "ignore" });
|
|
140
|
+
const envArgs = [];
|
|
141
|
+
for (const [key, val] of Object.entries(envOverrides)) {
|
|
142
|
+
envArgs.push("-e", `${key}=${val}`);
|
|
143
|
+
}
|
|
144
|
+
for (const key of ["RULEMETRIC_API_URL", "RULEMETRIC_API_KEY", "RULEMETRIC_ACCESS_TOKEN"]) {
|
|
145
|
+
if (process.env[key]) envArgs.push("-e", `${key}=${process.env[key]}`);
|
|
146
|
+
}
|
|
147
|
+
const dockerArgs = [
|
|
148
|
+
"run",
|
|
149
|
+
"-d",
|
|
150
|
+
"--name",
|
|
151
|
+
DOCKER_CONTAINER,
|
|
152
|
+
"-p",
|
|
153
|
+
`${port}:8787`,
|
|
154
|
+
"-v",
|
|
155
|
+
`${certDir}:/root/.mitmproxy`,
|
|
156
|
+
"-v",
|
|
157
|
+
`${join(tmpDir, "rulemetric")}:/tmp/rulemetric:ro`,
|
|
158
|
+
...envArgs,
|
|
159
|
+
DOCKER_IMAGE
|
|
160
|
+
];
|
|
161
|
+
const result = spawnSync("docker", dockerArgs, { encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] });
|
|
162
|
+
if (result.status !== 0) {
|
|
163
|
+
this.error(`Failed to start container: ${result.stderr}`);
|
|
164
|
+
}
|
|
173
165
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
166
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
167
|
+
writeFileSync(PID_FILE, `docker:${DOCKER_CONTAINER}`);
|
|
168
|
+
await new Promise((resolve2) => setTimeout(resolve2, 2e3));
|
|
169
|
+
const inspectResult = spawnSync("docker", ["container", "inspect", "-f", "{{.Id}}", DOCKER_CONTAINER], {
|
|
170
|
+
encoding: "utf-8",
|
|
171
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
172
|
+
});
|
|
173
|
+
const containerId = inspectResult.stdout?.trim().slice(0, 12) || "unknown";
|
|
174
|
+
this.log(`Proxy running in Docker on localhost:${port} (container: ${containerId})`);
|
|
175
|
+
this.log("");
|
|
176
|
+
this.log("View logs: rulemetric proxy logs -f");
|
|
177
|
+
}
|
|
178
|
+
findComposeFile() {
|
|
179
|
+
const candidates = [
|
|
180
|
+
join(process.cwd(), "docker-compose.yml"),
|
|
181
|
+
resolve(import.meta.dirname, "../../../../../docker-compose.yml")
|
|
182
|
+
];
|
|
183
|
+
for (const p of candidates) {
|
|
184
|
+
if (existsSync(p)) return p;
|
|
184
185
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
process.kill(pid, 0);
|
|
196
|
-
this.error(`Proxy already running (PID ${pid}). Stop it first: rulemetric proxy stop`);
|
|
197
|
-
}
|
|
198
|
-
catch { /* stale PID, continue */ }
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
// Check mitmproxy is installed
|
|
202
|
-
const binary = useWeb ? 'mitmweb' : 'mitmdump';
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
async startLocal(port, useWeb, skipChecks) {
|
|
189
|
+
if (existsSync(PID_FILE)) {
|
|
190
|
+
const content = readFileSync(PID_FILE, "utf-8").trim();
|
|
191
|
+
if (content.startsWith("docker:")) {
|
|
192
|
+
this.error("Proxy is running in Docker. Stop it first: rulemetric proxy stop");
|
|
193
|
+
}
|
|
194
|
+
const pid = Number.parseInt(content, 10);
|
|
195
|
+
if (!Number.isNaN(pid)) {
|
|
203
196
|
try {
|
|
204
|
-
|
|
197
|
+
process.kill(pid, 0);
|
|
198
|
+
this.error(`Proxy already running (PID ${pid}). Stop it first: rulemetric proxy stop`);
|
|
199
|
+
} catch {
|
|
205
200
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const certPath = join(homedir(), '.mitmproxy', 'mitmproxy-ca-cert.pem');
|
|
228
|
-
if (!existsSync(certPath)) {
|
|
229
|
-
warnings.push('CA cert not found — HTTPS interception may fail. Run `rulemetric proxy setup`.');
|
|
230
|
-
}
|
|
231
|
-
const settingsPath = join(process.cwd(), '.claude', 'settings.json');
|
|
232
|
-
if (!existsSync(settingsPath)) {
|
|
233
|
-
warnings.push('Session hooks not installed — snapshots won\'t link to sessions. Run `rulemetric hooks install`.');
|
|
234
|
-
}
|
|
235
|
-
if (warnings.length > 0) {
|
|
236
|
-
for (const w of warnings) {
|
|
237
|
-
this.log(` Warning: ${w}`);
|
|
238
|
-
}
|
|
239
|
-
this.log('');
|
|
240
|
-
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const binary = useWeb ? "mitmweb" : "mitmdump";
|
|
204
|
+
if (!findBinary(binary)) {
|
|
205
|
+
this.error(
|
|
206
|
+
`${binary} not found. Use Docker mode instead:
|
|
207
|
+
rulemetric proxy start --docker
|
|
208
|
+
|
|
209
|
+
Or install mitmproxy locally:
|
|
210
|
+
pipx install mitmproxy
|
|
211
|
+
brew install mitmproxy`
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
if (!skipChecks) {
|
|
215
|
+
const warnings = [];
|
|
216
|
+
if (!isAuthenticated() && !process.env.RULEMETRIC_API_KEY) {
|
|
217
|
+
const envFile = join(homedir(), ".config", "rulemetric", "env");
|
|
218
|
+
let hasEnvAuth = false;
|
|
219
|
+
if (existsSync(envFile)) {
|
|
220
|
+
const content = readFileSync(envFile, "utf-8");
|
|
221
|
+
hasEnvAuth = content.includes("RULEMETRIC_API_KEY") || content.includes("RULEMETRIC_ACCESS_TOKEN");
|
|
241
222
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
// Build env — pass through auth credentials for the reporter
|
|
245
|
-
const env = {
|
|
246
|
-
...process.env,
|
|
247
|
-
RULEMETRIC_PROJECT_PATH: process.cwd(),
|
|
248
|
-
// Bound to this CLI binary's version. The addon writes this to a
|
|
249
|
-
// version file the gateway watches; on drift the gateway restarts
|
|
250
|
-
// mitmproxy so an upgraded CLI doesn't sit next to a stale proxy.
|
|
251
|
-
RULEMETRIC_CLI_VERSION: this.config.version,
|
|
252
|
-
};
|
|
253
|
-
// Load auth from env file if not already in environment
|
|
254
|
-
if (!env.RULEMETRIC_API_KEY && !env.RULEMETRIC_ACCESS_TOKEN) {
|
|
255
|
-
const envFile = join(homedir(), '.config', 'rulemetric', 'env');
|
|
256
|
-
if (existsSync(envFile)) {
|
|
257
|
-
for (const line of readFileSync(envFile, 'utf-8').split('\n')) {
|
|
258
|
-
const trimmed = line.trim();
|
|
259
|
-
if (trimmed && !trimmed.startsWith('#') && trimmed.includes('=')) {
|
|
260
|
-
const [key, ...rest] = trimmed.split('=');
|
|
261
|
-
env[key] = rest.join('=');
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
223
|
+
if (!hasEnvAuth) {
|
|
224
|
+
warnings.push("Not authenticated \u2014 snapshots cannot be stored. Run `rulemetric auth login`.");
|
|
265
225
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
env,
|
|
279
|
-
stdio: ['ignore', logFd, logFd],
|
|
280
|
-
detached: true,
|
|
281
|
-
});
|
|
282
|
-
child.unref();
|
|
283
|
-
if (!child.pid) {
|
|
284
|
-
this.error('Failed to start proxy process');
|
|
226
|
+
}
|
|
227
|
+
const certPath = join(homedir(), ".mitmproxy", "mitmproxy-ca-cert.pem");
|
|
228
|
+
if (!existsSync(certPath)) {
|
|
229
|
+
warnings.push("CA cert not found \u2014 HTTPS interception may fail. Run `rulemetric proxy setup`.");
|
|
230
|
+
}
|
|
231
|
+
const settingsPath = join(process.cwd(), ".claude", "settings.json");
|
|
232
|
+
if (!existsSync(settingsPath)) {
|
|
233
|
+
warnings.push("Session hooks not installed \u2014 snapshots won't link to sessions. Run `rulemetric hooks install`.");
|
|
234
|
+
}
|
|
235
|
+
if (warnings.length > 0) {
|
|
236
|
+
for (const w of warnings) {
|
|
237
|
+
this.log(` Warning: ${w}`);
|
|
285
238
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
239
|
+
this.log("");
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const addonPath = findAddonPath();
|
|
243
|
+
const env = {
|
|
244
|
+
...process.env,
|
|
245
|
+
RULEMETRIC_PROJECT_PATH: process.cwd(),
|
|
246
|
+
// Bound to this CLI binary's version. The addon writes this to a
|
|
247
|
+
// version file the gateway watches; on drift the gateway restarts
|
|
248
|
+
// mitmproxy so an upgraded CLI doesn't sit next to a stale proxy.
|
|
249
|
+
RULEMETRIC_CLI_VERSION: this.config.version
|
|
250
|
+
};
|
|
251
|
+
if (!env.RULEMETRIC_API_KEY && !env.RULEMETRIC_ACCESS_TOKEN) {
|
|
252
|
+
const envFile = join(homedir(), ".config", "rulemetric", "env");
|
|
253
|
+
if (existsSync(envFile)) {
|
|
254
|
+
for (const line of readFileSync(envFile, "utf-8").split("\n")) {
|
|
255
|
+
const trimmed = line.trim();
|
|
256
|
+
if (trimmed && !trimmed.startsWith("#") && trimmed.includes("=")) {
|
|
257
|
+
const [key, ...rest] = trimmed.split("=");
|
|
258
|
+
env[key] = rest.join("=");
|
|
259
|
+
}
|
|
305
260
|
}
|
|
306
|
-
|
|
307
|
-
this.log('View logs: rulemetric proxy logs -f');
|
|
261
|
+
}
|
|
308
262
|
}
|
|
309
|
-
}
|
|
310
|
-
|
|
263
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
264
|
+
appendFileSync(LOG_FILE, `
|
|
265
|
+
--- Proxy started at ${(/* @__PURE__ */ new Date()).toISOString()} (port ${port}) ---
|
|
266
|
+
`);
|
|
267
|
+
const logFd = openSync(LOG_FILE, "a");
|
|
268
|
+
const args = [
|
|
269
|
+
"--listen-port",
|
|
270
|
+
String(port),
|
|
271
|
+
"-s",
|
|
272
|
+
addonPath,
|
|
273
|
+
"--set",
|
|
274
|
+
"console_eventlog_verbosity=info"
|
|
275
|
+
];
|
|
276
|
+
const child = spawn(binary, args, {
|
|
277
|
+
env,
|
|
278
|
+
stdio: ["ignore", logFd, logFd],
|
|
279
|
+
detached: true
|
|
280
|
+
});
|
|
281
|
+
child.unref();
|
|
282
|
+
if (!child.pid) {
|
|
283
|
+
this.error("Failed to start proxy process");
|
|
284
|
+
}
|
|
285
|
+
await new Promise((resolve2) => {
|
|
286
|
+
let exited = false;
|
|
287
|
+
child.once("exit", (code) => {
|
|
288
|
+
exited = true;
|
|
289
|
+
this.error(`Proxy exited immediately with code ${code}. Check logs:
|
|
290
|
+
${LOG_FILE}`);
|
|
291
|
+
});
|
|
292
|
+
setTimeout(() => {
|
|
293
|
+
if (!exited) resolve2();
|
|
294
|
+
}, 500);
|
|
295
|
+
});
|
|
296
|
+
writeFileSync(PID_FILE, String(child.pid));
|
|
297
|
+
this.log(`Proxy running on localhost:${port} (PID ${child.pid})`);
|
|
298
|
+
this.log(`Log file: ${LOG_FILE}`);
|
|
299
|
+
if (useWeb) {
|
|
300
|
+
this.log("");
|
|
301
|
+
this.log("Debug UI: http://localhost:8081");
|
|
302
|
+
}
|
|
303
|
+
this.log("");
|
|
304
|
+
this.log("View logs: rulemetric proxy logs -f");
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
export {
|
|
308
|
+
ProxyStart as default
|
|
309
|
+
};
|
|
310
|
+
//# sourceMappingURL=start.js.map
|