@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
package/dist/chunk-4XAWK6S2.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActiveJobsList
|
|
3
|
-
} from "./chunk-5BAOGNUH.js";
|
|
4
|
-
import {
|
|
5
|
-
NewLaunchForm
|
|
6
|
-
} from "./chunk-DNKSVWMD.js";
|
|
7
|
-
import {
|
|
8
|
-
ORANGE
|
|
9
|
-
} from "./chunk-QJQS6TUN.js";
|
|
10
|
-
import {
|
|
11
|
-
useLaunchJobs
|
|
12
|
-
} from "./chunk-EYPAAGN5.js";
|
|
13
|
-
import {
|
|
14
|
-
cancelLaunchJob,
|
|
15
|
-
createLaunchJob,
|
|
16
|
-
listLaunchers
|
|
17
|
-
} from "./chunk-UKMLICWS.js";
|
|
18
|
-
|
|
19
|
-
// src/dashboard/launcher/LauncherOverlay.tsx
|
|
20
|
-
import { useEffect, useState } from "react";
|
|
21
|
-
import { Box, Text, useInput } from "ink";
|
|
22
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
-
function LauncherOverlay({
|
|
24
|
-
onClose,
|
|
25
|
-
activeOrg,
|
|
26
|
-
defaultProjectPath,
|
|
27
|
-
width
|
|
28
|
-
}) {
|
|
29
|
-
const { jobs, error, loading, refetch } = useLaunchJobs(20);
|
|
30
|
-
const [launchers, setLaunchers] = useState([]);
|
|
31
|
-
const [zone, setZone] = useState("list");
|
|
32
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
33
|
-
const [confirmCancel, setConfirmCancel] = useState(null);
|
|
34
|
-
const [resumePrefill, setResumePrefill] = useState(null);
|
|
35
|
-
const [toast, setToast] = useState(null);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
listLaunchers().then(setLaunchers).catch((e) => {
|
|
38
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
39
|
-
setToast(`couldn't load launchers: ${msg}`);
|
|
40
|
-
setLaunchers([
|
|
41
|
-
{ tool: "claude_code", capabilities: { headless: true, interactive: true, remoteSpawn: true } }
|
|
42
|
-
]);
|
|
43
|
-
});
|
|
44
|
-
}, []);
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
if (!toast) return;
|
|
47
|
-
const t = setTimeout(() => setToast(null), 5e3);
|
|
48
|
-
return () => clearTimeout(t);
|
|
49
|
-
}, [toast]);
|
|
50
|
-
useInput((input, key) => {
|
|
51
|
-
if (confirmCancel) {
|
|
52
|
-
if (input === "y" || input === "Y") {
|
|
53
|
-
const id = confirmCancel.id;
|
|
54
|
-
setConfirmCancel(null);
|
|
55
|
-
cancelLaunchJob(id).then(() => {
|
|
56
|
-
refetch();
|
|
57
|
-
setToast(`cancelled ${id.slice(0, 8)}`);
|
|
58
|
-
}).catch((e) => setToast(`cancel failed: ${e instanceof Error ? e.message : String(e)}`));
|
|
59
|
-
} else if (input === "n" || input === "N" || key.escape) {
|
|
60
|
-
setConfirmCancel(null);
|
|
61
|
-
}
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (key.escape) {
|
|
65
|
-
if (zone !== "none") {
|
|
66
|
-
setZone("none");
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
onClose();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (key.tab) {
|
|
73
|
-
setZone((z) => z === "list" ? "form" : z === "form" ? "none" : "list");
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (input === "q") return;
|
|
77
|
-
if (zone === "list") {
|
|
78
|
-
if (key.upArrow) {
|
|
79
|
-
setSelectedIndex((i) => Math.max(0, i - 1));
|
|
80
|
-
} else if (key.downArrow) {
|
|
81
|
-
setSelectedIndex((i) => Math.min(jobs.length - 1, i + 1));
|
|
82
|
-
} else if (input === "c") {
|
|
83
|
-
const sel = jobs[selectedIndex];
|
|
84
|
-
if (sel && (sel.status === "running" || sel.status === "queued" || sel.status === "pending")) {
|
|
85
|
-
setConfirmCancel(sel);
|
|
86
|
-
}
|
|
87
|
-
} else if (input === "r") {
|
|
88
|
-
const sel = jobs[selectedIndex];
|
|
89
|
-
const sid = sel?.result?.externalSessionId;
|
|
90
|
-
if (sel && sel.tool === "claude_code" && sid) {
|
|
91
|
-
setResumePrefill({
|
|
92
|
-
tool: "claude_code",
|
|
93
|
-
projectPath: sel.config.projectPath,
|
|
94
|
-
resumeSessionId: sid
|
|
95
|
-
});
|
|
96
|
-
setZone("form");
|
|
97
|
-
} else {
|
|
98
|
-
setToast("resume needs a Claude Code session with a session id");
|
|
99
|
-
}
|
|
100
|
-
} else if (input === "o") {
|
|
101
|
-
const sel = jobs[selectedIndex];
|
|
102
|
-
const sid = sel?.result?.externalSessionId;
|
|
103
|
-
if (sid) {
|
|
104
|
-
const webUrl = process.env.RULEMETRIC_WEB_URL ?? "http://localhost:5174";
|
|
105
|
-
void import("node:child_process").then(({ spawn }) => {
|
|
106
|
-
spawn("open", [`${webUrl}/sessions/${sid}`], { detached: true, stdio: "ignore" }).unref();
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
async function handleSubmit(payload) {
|
|
113
|
-
await createLaunchJob(payload);
|
|
114
|
-
setResumePrefill(null);
|
|
115
|
-
setZone("list");
|
|
116
|
-
setToast("launched");
|
|
117
|
-
refetch();
|
|
118
|
-
}
|
|
119
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: ORANGE, width, paddingX: 1, children: [
|
|
120
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
121
|
-
/* @__PURE__ */ jsx(Text, { bold: true, color: ORANGE, children: "Launcher" }),
|
|
122
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " active org: " }),
|
|
123
|
-
/* @__PURE__ */ jsx(Text, { children: activeOrg ?? "(none)" }),
|
|
124
|
-
loading && /* @__PURE__ */ jsx(Text, { dimColor: true, children: " loading\u2026" }),
|
|
125
|
-
error && /* @__PURE__ */ jsxs(Text, { color: "#F55B5B", children: [
|
|
126
|
-
" \u26A0 ",
|
|
127
|
-
error
|
|
128
|
-
] })
|
|
129
|
-
] }),
|
|
130
|
-
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(ActiveJobsList, { jobs, selectedIndex, focused: zone === "list" }) }),
|
|
131
|
-
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(
|
|
132
|
-
NewLaunchForm,
|
|
133
|
-
{
|
|
134
|
-
launchers,
|
|
135
|
-
defaultProjectPath: resumePrefill?.projectPath ?? defaultProjectPath,
|
|
136
|
-
defaultTool: resumePrefill?.tool,
|
|
137
|
-
defaultResumeSessionId: resumePrefill?.resumeSessionId,
|
|
138
|
-
focused: zone === "form",
|
|
139
|
-
onSubmit: handleSubmit
|
|
140
|
-
}
|
|
141
|
-
) }),
|
|
142
|
-
confirmCancel && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsxs(Text, { color: "#FFD700", children: [
|
|
143
|
-
"Cancel job ",
|
|
144
|
-
confirmCancel.id.slice(0, 8),
|
|
145
|
-
"? (y/n)"
|
|
146
|
-
] }) }),
|
|
147
|
-
toast && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
148
|
-
"\xB7 ",
|
|
149
|
-
toast
|
|
150
|
-
] }) }),
|
|
151
|
-
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
152
|
-
"\u2191\u2193 select tab focus c cancel r resume o open esc ",
|
|
153
|
-
zone === "none" ? "close" : "back"
|
|
154
|
-
] }) })
|
|
155
|
-
] });
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export {
|
|
159
|
-
LauncherOverlay
|
|
160
|
-
};
|
|
161
|
-
//# sourceMappingURL=chunk-4XAWK6S2.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/dashboard/launcher/LauncherOverlay.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect, useState } from 'react';\nimport { Box, Text, useInput } from 'ink';\nimport { ORANGE } from '../types.js';\nimport { useLaunchJobs } from './useLaunchJobs.js';\nimport { ActiveJobsList } from './ActiveJobsList.js';\nimport { NewLaunchForm } from './NewLaunchForm.js';\nimport { createLaunchJob, cancelLaunchJob, listLaunchers } from './api.js';\nimport type { AvailableLauncher, LaunchJob } from './types.js';\n\ntype FocusZone = 'none' | 'list' | 'form';\n\nexport function LauncherOverlay({\n onClose,\n activeOrg,\n defaultProjectPath,\n width,\n}: {\n onClose: () => void;\n activeOrg: string | null;\n defaultProjectPath: string;\n width: number;\n}) {\n const { jobs, error, loading, refetch } = useLaunchJobs(20);\n const [launchers, setLaunchers] = useState<AvailableLauncher[]>([]);\n const [zone, setZone] = useState<FocusZone>('list');\n const [selectedIndex, setSelectedIndex] = useState(0);\n const [confirmCancel, setConfirmCancel] = useState<LaunchJob | null>(null);\n const [resumePrefill, setResumePrefill] = useState<{\n tool: string;\n projectPath: string;\n resumeSessionId: string;\n } | null>(null);\n const [toast, setToast] = useState<string | null>(null);\n\n useEffect(() => {\n listLaunchers()\n .then(setLaunchers)\n .catch((e: unknown) => {\n const msg = e instanceof Error ? e.message : String(e);\n setToast(`couldn't load launchers: ${msg}`);\n // Still set a fallback so the form is usable; auth errors will re-surface on submit.\n setLaunchers([\n { tool: 'claude_code', capabilities: { headless: true, interactive: true, remoteSpawn: true } },\n ]);\n });\n }, []);\n\n useEffect(() => {\n if (!toast) return;\n const t = setTimeout(() => setToast(null), 5000);\n return () => clearTimeout(t);\n }, [toast]);\n\n useInput((input, key) => {\n if (confirmCancel) {\n if (input === 'y' || input === 'Y') {\n const id = confirmCancel.id;\n setConfirmCancel(null);\n cancelLaunchJob(id)\n .then(() => {\n refetch();\n setToast(`cancelled ${id.slice(0, 8)}`);\n })\n .catch((e: unknown) => setToast(`cancel failed: ${e instanceof Error ? e.message : String(e)}`));\n } else if (input === 'n' || input === 'N' || key.escape) {\n setConfirmCancel(null);\n }\n return;\n }\n if (key.escape) {\n if (zone !== 'none') {\n setZone('none');\n return;\n }\n onClose();\n return;\n }\n if (key.tab) {\n setZone((z) => (z === 'list' ? 'form' : z === 'form' ? 'none' : 'list'));\n return;\n }\n // q is intentionally swallowed; do not exit while overlay is open\n if (input === 'q') return;\n if (zone === 'list') {\n if (key.upArrow) {\n setSelectedIndex((i) => Math.max(0, i - 1));\n } else if (key.downArrow) {\n setSelectedIndex((i) => Math.min(jobs.length - 1, i + 1));\n } else if (input === 'c') {\n const sel = jobs[selectedIndex];\n if (sel && (sel.status === 'running' || sel.status === 'queued' || sel.status === 'pending')) {\n setConfirmCancel(sel);\n }\n } else if (input === 'r') {\n const sel = jobs[selectedIndex];\n const sid = sel?.result?.externalSessionId;\n if (sel && sel.tool === 'claude_code' && sid) {\n setResumePrefill({\n tool: 'claude_code',\n projectPath: sel.config.projectPath,\n resumeSessionId: sid,\n });\n setZone('form');\n } else {\n setToast('resume needs a Claude Code session with a session id');\n }\n } else if (input === 'o') {\n const sel = jobs[selectedIndex];\n const sid = sel?.result?.externalSessionId;\n if (sid) {\n const webUrl = process.env.RULEMETRIC_WEB_URL ?? 'http://localhost:5174';\n void import('node:child_process').then(({ spawn }) => {\n spawn('open', [`${webUrl}/sessions/${sid}`], { detached: true, stdio: 'ignore' }).unref();\n });\n }\n }\n }\n });\n\n async function handleSubmit(payload: Parameters<typeof createLaunchJob>[0]) {\n await createLaunchJob(payload);\n setResumePrefill(null);\n setZone('list');\n setToast('launched');\n refetch();\n }\n\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={ORANGE} width={width} paddingX={1}>\n <Box>\n <Text bold color={ORANGE}>Launcher</Text>\n <Text dimColor> active org: </Text>\n <Text>{activeOrg ?? '(none)'}</Text>\n {loading && <Text dimColor> loading\u2026</Text>}\n {error && <Text color=\"#F55B5B\"> \u26A0 {error}</Text>}\n </Box>\n <Box marginTop={1}>\n <ActiveJobsList jobs={jobs} selectedIndex={selectedIndex} focused={zone === 'list'} />\n </Box>\n <Box marginTop={1}>\n <NewLaunchForm\n launchers={launchers}\n defaultProjectPath={resumePrefill?.projectPath ?? defaultProjectPath}\n defaultTool={resumePrefill?.tool}\n defaultResumeSessionId={resumePrefill?.resumeSessionId}\n focused={zone === 'form'}\n onSubmit={handleSubmit}\n />\n </Box>\n {confirmCancel && (\n <Box marginTop={1}>\n <Text color=\"#FFD700\">Cancel job {confirmCancel.id.slice(0, 8)}? (y/n)</Text>\n </Box>\n )}\n {toast && (\n <Box marginTop={1}>\n <Text dimColor>\u00B7 {toast}</Text>\n </Box>\n )}\n <Box marginTop={1}>\n <Text dimColor>\n \u2191\u2193 select tab focus c cancel r resume o open esc {zone === 'none' ? 'close' : 'back'}\n </Text>\n </Box>\n </Box>\n );\n}\n"],
|
|
5
|
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U;AAAA;AAAA,MAAY,cAAc,GAAG,MAAM,GAAG,CAAC;AAAA,MAAE;AAAA,OAAO,GACxE;AAAA,IAED,SACC,oBAAC,OAAI,WAAW,GACd,+BAAC,QAAK,UAAQ,MAAC;AAAA;AAAA,MAAG;AAAA,OAAM,GAC1B;AAAA,IAEF,oBAAC,OAAI,WAAW,GACd,+BAAC,QAAK,UAAQ,MAAC;AAAA;AAAA,MAC0C,SAAS,SAAS,UAAU;AAAA,OACrF,GACF;AAAA,KACF;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/chunk-52WIYRZH.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// src/lib/eval-worktree.ts
|
|
2
|
-
import { execSync } from "node:child_process";
|
|
3
|
-
import { mkdtempSync, rmSync, existsSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
|
-
function createEvalWorktree(baseDir) {
|
|
7
|
-
const cwd = baseDir ?? process.cwd();
|
|
8
|
-
const prefix = join(tmpdir(), "rulemetric-eval-");
|
|
9
|
-
try {
|
|
10
|
-
execSync("git rev-parse --git-dir", { cwd, stdio: "pipe" });
|
|
11
|
-
} catch {
|
|
12
|
-
const tempDir = mkdtempSync(prefix);
|
|
13
|
-
return {
|
|
14
|
-
workDir: tempDir,
|
|
15
|
-
cleanup: () => safeRm(tempDir),
|
|
16
|
-
isWorktree: false
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
let ref;
|
|
20
|
-
try {
|
|
21
|
-
ref = execSync("git rev-parse HEAD", { cwd, stdio: "pipe" }).toString().trim();
|
|
22
|
-
} catch {
|
|
23
|
-
const tempDir = mkdtempSync(prefix);
|
|
24
|
-
return {
|
|
25
|
-
workDir: tempDir,
|
|
26
|
-
cleanup: () => safeRm(tempDir),
|
|
27
|
-
isWorktree: false
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
const worktreePath = mkdtempSync(prefix);
|
|
31
|
-
rmSync(worktreePath, { recursive: true });
|
|
32
|
-
try {
|
|
33
|
-
execSync(`git worktree add --detach "${worktreePath}" ${ref}`, {
|
|
34
|
-
cwd,
|
|
35
|
-
stdio: "pipe"
|
|
36
|
-
});
|
|
37
|
-
} catch {
|
|
38
|
-
const tempDir = mkdtempSync(prefix);
|
|
39
|
-
return {
|
|
40
|
-
workDir: tempDir,
|
|
41
|
-
cleanup: () => safeRm(tempDir),
|
|
42
|
-
isWorktree: false
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
workDir: worktreePath,
|
|
47
|
-
cleanup: () => {
|
|
48
|
-
try {
|
|
49
|
-
execSync(`git worktree remove --force "${worktreePath}"`, { cwd, stdio: "pipe" });
|
|
50
|
-
} catch {
|
|
51
|
-
safeRm(worktreePath);
|
|
52
|
-
try {
|
|
53
|
-
execSync("git worktree prune", { cwd, stdio: "pipe" });
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
isWorktree: true
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function safeRm(dir) {
|
|
62
|
-
try {
|
|
63
|
-
if (existsSync(dir)) {
|
|
64
|
-
rmSync(dir, { recursive: true, force: true });
|
|
65
|
-
}
|
|
66
|
-
} catch {
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export {
|
|
71
|
-
createEvalWorktree
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=chunk-52WIYRZH.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/lib/eval-worktree.ts"],
|
|
4
|
-
"sourcesContent": ["import { execSync } from 'node:child_process';\nimport { mkdtempSync, rmSync, existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { tmpdir } from 'node:os';\n\n/**\n * Create an isolated git worktree for eval execution.\n * Returns the worktree path and a cleanup function.\n * Falls back to a temp directory copy if not in a git repo.\n */\nexport function createEvalWorktree(baseDir?: string): {\n workDir: string;\n cleanup: () => void;\n isWorktree: boolean;\n} {\n const cwd = baseDir ?? process.cwd();\n const prefix = join(tmpdir(), 'rulemetric-eval-');\n\n // Check if we're in a git repo\n try {\n execSync('git rev-parse --git-dir', { cwd, stdio: 'pipe' });\n } catch {\n // Not a git repo \u2014 use a plain temp dir\n const tempDir = mkdtempSync(prefix);\n return {\n workDir: tempDir,\n cleanup: () => safeRm(tempDir),\n isWorktree: false,\n };\n }\n\n // Get current branch/commit\n let ref: string;\n try {\n ref = execSync('git rev-parse HEAD', { cwd, stdio: 'pipe' }).toString().trim();\n } catch {\n const tempDir = mkdtempSync(prefix);\n return {\n workDir: tempDir,\n cleanup: () => safeRm(tempDir),\n isWorktree: false,\n };\n }\n\n // Create worktree at a detached HEAD (no branch conflict)\n const worktreePath = mkdtempSync(prefix);\n // mkdtemp creates the dir \u2014 git worktree add needs it to not exist\n rmSync(worktreePath, { recursive: true });\n\n try {\n execSync(`git worktree add --detach \"${worktreePath}\" ${ref}`, {\n cwd,\n stdio: 'pipe',\n });\n } catch {\n // Worktree creation failed \u2014 fall back to temp dir\n const tempDir = mkdtempSync(prefix);\n return {\n workDir: tempDir,\n cleanup: () => safeRm(tempDir),\n isWorktree: false,\n };\n }\n\n return {\n workDir: worktreePath,\n cleanup: () => {\n try {\n execSync(`git worktree remove --force \"${worktreePath}\"`, { cwd, stdio: 'pipe' });\n } catch {\n // If git worktree remove fails, just delete the directory\n safeRm(worktreePath);\n // Prune stale worktree refs\n try { execSync('git worktree prune', { cwd, stdio: 'pipe' }); } catch { /* ignore */ }\n }\n },\n isWorktree: true,\n };\n}\n\nfunction safeRm(dir: string): void {\n try {\n if (existsSync(dir)) {\n rmSync(dir, { recursive: true, force: true });\n }\n } catch {\n // Best-effort cleanup\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,aAAa,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vF;AAAA,IACF;AAAA,IACA,YAAY;AAAA,EACd;AACF;AAEA,SAAS,OAAO,KAAmB;AACjC,MAAI;AACF,QAAI,WAAW,GAAG,GAAG;AACnB,aAAO,KAAK,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,IAC9C;AAAA,EACF,QAAQ;AAAA,EAER;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/chunk-5BAOGNUH.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DIM,
|
|
3
|
-
GREEN,
|
|
4
|
-
ORANGE,
|
|
5
|
-
RED
|
|
6
|
-
} from "./chunk-QJQS6TUN.js";
|
|
7
|
-
import {
|
|
8
|
-
toolLabel
|
|
9
|
-
} from "./chunk-RH7NHVSK.js";
|
|
10
|
-
|
|
11
|
-
// src/dashboard/launcher/ActiveJobsList.tsx
|
|
12
|
-
import { Box, Text } from "ink";
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
var STATUS_GLYPH = {
|
|
15
|
-
pending: { glyph: "\u25CC", color: DIM },
|
|
16
|
-
queued: { glyph: "\u25CC", color: DIM },
|
|
17
|
-
running: { glyph: "\u25CF", color: ORANGE },
|
|
18
|
-
completed: { glyph: "\u2713", color: GREEN },
|
|
19
|
-
failed: { glyph: "\u2717", color: RED },
|
|
20
|
-
cancelled: { glyph: "\u2298", color: DIM }
|
|
21
|
-
};
|
|
22
|
-
function ago(iso) {
|
|
23
|
-
const ms = Date.now() - new Date(iso).getTime();
|
|
24
|
-
const m = Math.floor(ms / 6e4);
|
|
25
|
-
if (m < 1) return "now";
|
|
26
|
-
if (m < 60) return `${m}m`;
|
|
27
|
-
const h = Math.floor(m / 60);
|
|
28
|
-
if (h < 24) return `${h}h`;
|
|
29
|
-
return `${Math.floor(h / 24)}d`;
|
|
30
|
-
}
|
|
31
|
-
function ActiveJobsList({
|
|
32
|
-
jobs,
|
|
33
|
-
selectedIndex,
|
|
34
|
-
focused
|
|
35
|
-
}) {
|
|
36
|
-
if (jobs.length === 0) {
|
|
37
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
|
|
38
|
-
/* @__PURE__ */ jsx(Text, { bold: true, color: ORANGE, children: "\u25BC Active jobs" }),
|
|
39
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " (no jobs yet \u2014 press tab to focus the form below)" })
|
|
40
|
-
] });
|
|
41
|
-
}
|
|
42
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
|
|
43
|
-
/* @__PURE__ */ jsxs(Text, { bold: true, color: ORANGE, children: [
|
|
44
|
-
"\u25BC Active jobs (last ",
|
|
45
|
-
jobs.length,
|
|
46
|
-
")"
|
|
47
|
-
] }),
|
|
48
|
-
jobs.map((j, i) => {
|
|
49
|
-
const sel = focused && i === selectedIndex;
|
|
50
|
-
const sg = STATUS_GLYPH[j.status] ?? { glyph: "?", color: DIM };
|
|
51
|
-
const project = j.config?.projectPath ?? "";
|
|
52
|
-
const prompt = (j.config?.prompt ?? "").slice(0, 30);
|
|
53
|
-
return /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
54
|
-
/* @__PURE__ */ jsx(Text, { color: sel ? ORANGE : DIM, children: sel ? "\u25B6 " : " " }),
|
|
55
|
-
/* @__PURE__ */ jsxs(Text, { color: sg.color, children: [
|
|
56
|
-
sg.glyph,
|
|
57
|
-
" "
|
|
58
|
-
] }),
|
|
59
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: j.status.padEnd(10) }),
|
|
60
|
-
/* @__PURE__ */ jsx(Text, { children: toolLabel(j.tool).padEnd(14) }),
|
|
61
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: project.padEnd(28) }),
|
|
62
|
-
/* @__PURE__ */ jsxs(Text, { children: [
|
|
63
|
-
'"',
|
|
64
|
-
prompt,
|
|
65
|
-
'"'
|
|
66
|
-
] }),
|
|
67
|
-
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
68
|
-
" ",
|
|
69
|
-
ago(j.createdAt)
|
|
70
|
-
] })
|
|
71
|
-
] }, j.id);
|
|
72
|
-
})
|
|
73
|
-
] });
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export {
|
|
77
|
-
ActiveJobsList
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=chunk-5BAOGNUH.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/dashboard/launcher/ActiveJobsList.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { Box, Text } from 'ink';\nimport { ORANGE, DIM, GREEN, RED } from '../types.js';\nimport { toolLabel } from './tool-labels.js';\nimport type { LaunchJob } from './types.js';\n\nconst STATUS_GLYPH: Record<string, { glyph: string; color: string }> = {\n pending: { glyph: '\u25CC', color: DIM },\n queued: { glyph: '\u25CC', color: DIM },\n running: { glyph: '\u25CF', color: ORANGE },\n completed: { glyph: '\u2713', color: GREEN },\n failed: { glyph: '\u2717', color: RED },\n cancelled: { glyph: '\u2298', color: DIM },\n};\n\nfunction ago(iso: string): string {\n const ms = Date.now() - new Date(iso).getTime();\n const m = Math.floor(ms / 60_000);\n if (m < 1) return 'now';\n if (m < 60) return `${m}m`;\n const h = Math.floor(m / 60);\n if (h < 24) return `${h}h`;\n return `${Math.floor(h / 24)}d`;\n}\n\nexport function ActiveJobsList({\n jobs,\n selectedIndex,\n focused,\n}: {\n jobs: LaunchJob[];\n selectedIndex: number;\n focused: boolean;\n}) {\n if (jobs.length === 0) {\n return (\n <Box flexDirection=\"column\" paddingX={1}>\n <Text bold color={ORANGE}>\u25BC Active jobs</Text>\n <Text dimColor> (no jobs yet \u2014 press tab to focus the form below)</Text>\n </Box>\n );\n }\n\n return (\n <Box flexDirection=\"column\" paddingX={1}>\n <Text bold color={ORANGE}>\u25BC Active jobs (last {jobs.length})</Text>\n {jobs.map((j, i) => {\n const sel = focused && i === selectedIndex;\n const sg = STATUS_GLYPH[j.status] ?? { glyph: '?', color: DIM };\n const project = j.config?.projectPath ?? '';\n const prompt = (j.config?.prompt ?? '').slice(0, 30);\n return (\n <Text key={j.id} wrap=\"truncate-end\">\n <Text color={sel ? ORANGE : DIM}>{sel ? '\u25B6 ' : ' '}</Text>\n <Text color={sg.color}>{sg.glyph} </Text>\n <Text dimColor>{j.status.padEnd(10)}</Text>\n <Text>{toolLabel(j.tool).padEnd(14)}</Text>\n <Text dimColor>{project.padEnd(28)}</Text>\n <Text>\"{prompt}\"</Text>\n <Text dimColor> {ago(j.createdAt)}</Text>\n </Text>\n );\n })}\n </Box>\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AACA,SAAS,KAAK,YAAY;AAmCpB,SACE,KADF;AA9BN,IAAM,eAAiE;AAAA,EACrE,SAAS,EAAE,OAAO,UAAK,OAAO,IAAI;AAAA,EAClC,QAAQ,EAAE,OAAO,UAAK,OAAO,IAAI;AAAA,EACjC,SAAS,EAAE,OAAO,UAAK,OAAO,OAAO;AAAA,EACrC,WAAW,EAAE,OAAO,UAAK,OAAO,MAAM;AAAA,EACtC,QAAQ,EAAE,OAAO,UAAK,OAAO,IAAI;AAAA,EACjC,WAAW,EAAE,OAAO,UAAK,OAAO,IAAI;AACtC;AAEA,SAAS,IAAI,KAAqB;AAChC,QAAM,KAAK,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE,QAAQ;AAC9C,QAAM,IAAI,KAAK,MAAM,KAAK,GAAM;AAChC,MAAI,IAAI,EAAG,QAAO;AAClB,MAAI,IAAI,GAAI,QAAO,GAAG,CAAC;AACvB,QAAM,IAAI,KAAK,MAAM,IAAI,EAAE;AAC3B,MAAI,IAAI,GAAI,QAAO,GAAG,CAAC;AACvB,SAAO,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC;AAC9B;AAEO,SAAS,eAAe;AAAA,EAC7B;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|
-
"names": []
|
|
7
|
-
}
|
package/dist/chunk-5EDMGK3W.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// src/lib/pid-identity.ts
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
|
-
var GATEWAY_ENTRY_COMMAND_PATTERN = /gateway-entry\.[cm]?js/;
|
|
4
|
-
var MITMPROXY_COMMAND_PATTERN = /mitm(dump|web)/;
|
|
5
|
-
function pidAlive(pid) {
|
|
6
|
-
try {
|
|
7
|
-
process.kill(pid, 0);
|
|
8
|
-
return true;
|
|
9
|
-
} catch (e) {
|
|
10
|
-
return e.code === "EPERM";
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function readCommandViaPs(pid) {
|
|
14
|
-
try {
|
|
15
|
-
return execFileSync("ps", ["-p", String(pid), "-o", "command="], {
|
|
16
|
-
encoding: "utf-8",
|
|
17
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
18
|
-
});
|
|
19
|
-
} catch {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function isPidLiveAndMatching(pid, commandPattern, opts = {}) {
|
|
24
|
-
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
25
|
-
const isAlive = opts.isAlive ?? pidAlive;
|
|
26
|
-
if (!isAlive(pid)) return false;
|
|
27
|
-
const readCommand = opts.readCommand ?? readCommandViaPs;
|
|
28
|
-
const command = readCommand(pid);
|
|
29
|
-
if (command === null) return true;
|
|
30
|
-
return commandPattern.test(command);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
GATEWAY_ENTRY_COMMAND_PATTERN,
|
|
35
|
-
MITMPROXY_COMMAND_PATTERN,
|
|
36
|
-
pidAlive,
|
|
37
|
-
isPidLiveAndMatching
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=chunk-5EDMGK3W.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/lib/pid-identity.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * PID-file identity validation \u2014 the shared defense against PID reuse.\n *\n * PID files survive reboots and SIGKILLs, and the OS may later hand the\n * recorded PID to an unrelated process. `kill -0` alone then reports \"alive\"\n * forever: self-heal is defeated and restarts are blocked (\"already running\").\n * Before trusting a PID file, confirm the process's command line actually\n * matches what the file claims to track (same pattern as the evals-agent\n * single-instance lock).\n */\nimport { execFileSync } from 'node:child_process';\n\n/** The gateway is always spawned as `node \u2026/gateway-entry.js`. */\nexport const GATEWAY_ENTRY_COMMAND_PATTERN = /gateway-entry\\.[cm]?js/;\n/** mitmproxy runs as mitmdump or mitmweb (pipx/brew both keep the name in argv). */\nexport const MITMPROXY_COMMAND_PATTERN = /mitm(dump|web)/;\n\nexport interface PidIdentityOptions {\n /** Override the liveness check (`process.kill(pid, 0)`). Used in tests. */\n isAlive?: (pid: number) => boolean;\n /**\n * Override `ps -p <pid> -o command=`. Return the command line, or null when\n * ps itself is unavailable/failed. Used in tests.\n */\n readCommand?: (pid: number) => string | null;\n}\n\n/** `kill -0` liveness. EPERM means the process exists but is owned by another user. */\nexport function pidAlive(pid: number): boolean {\n try {\n process.kill(pid, 0);\n return true;\n } catch (e) {\n return (e as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\nfunction readCommandViaPs(pid: number): string | null {\n try {\n return execFileSync('ps', ['-p', String(pid), '-o', 'command='], {\n encoding: 'utf-8',\n stdio: ['ignore', 'pipe', 'ignore'],\n });\n } catch {\n // ps unavailable (e.g. Windows) or failed \u2014 identity is unverifiable.\n return null;\n }\n}\n\n/**\n * True iff `pid` is alive AND its command line matches `commandPattern`.\n * A live-but-mismatched PID is a reused PID: callers must treat the PID file\n * as stale (reclaim/overwrite), and must never signal that process.\n * When the command line can't be read at all, falls back to liveness only\n * (conservative: a live PID stays \"held\", matching the evals-agent lock).\n */\nexport function isPidLiveAndMatching(\n pid: number,\n commandPattern: RegExp,\n opts: PidIdentityOptions = {},\n): boolean {\n if (!Number.isInteger(pid) || pid <= 0) return false;\n const isAlive = opts.isAlive ?? pidAlive;\n if (!isAlive(pid)) return false;\n const readCommand = opts.readCommand ?? readCommandViaPs;\n const command = readCommand(pid);\n if (command === null) return true;\n return commandPattern.test(command);\n}\n"],
|
|
5
|
-
"mappings": ";AAUA,SAAS,oBAAoB;AAGtB,IAAM,gCAAgC;AAEtC,IAAM,4BAA4B;AAalC,SAAS,SAAS,KAAsB;AAC7C,MAAI;AACF,YAAQ,KAAK,KAAK,CAAC;AACnB,WAAO;AAAA,EACT,SAAS,GAAG;AACV,WAAQ,EAA4B,SAAS;AAAA,EAC/C;AACF;AAEA,SAAS,iBAAiB,KAA4B;AACpD,MAAI;AACF,WAAO,aAAa,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,MAAM,UAAU,GAAG;AAAA,MAC/D,UAAU;AAAA,MACV,OAAO,CAAC,UAAU,QAAQ,QAAQ;AAAA,IACpC,CAAC;AAAA,EACH,QAAQ;AAEN,WAAO;AAAA,EACT;AACF;AASO,SAAS,qBACd,KACA,gBACA,OAA2B,CAAC,GACnB;AACT,MAAI,CAAC,OAAO,UAAU,GAAG,KAAK,OAAO,EAAG,QAAO;AAC/C,QAAM,UAAU,KAAK,WAAW;AAChC,MAAI,CAAC,QAAQ,GAAG,EAAG,QAAO;AAC1B,QAAM,cAAc,KAAK,eAAe;AACxC,QAAM,UAAU,YAAY,GAAG;AAC/B,MAAI,YAAY,KAAM,QAAO;AAC7B,SAAO,eAAe,KAAK,OAAO;AACpC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/chunk-6NBS5XFS.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
agentRuns,
|
|
3
|
-
getDb,
|
|
4
|
-
sessions
|
|
5
|
-
} from "./chunk-EI5BHWXA.js";
|
|
6
|
-
import {
|
|
7
|
-
removeWorktree
|
|
8
|
-
} from "./chunk-Y4BJXXYV.js";
|
|
9
|
-
import {
|
|
10
|
-
PermanentJobError
|
|
11
|
-
} from "./chunk-DGHWRQXL.js";
|
|
12
|
-
|
|
13
|
-
// src/lib/handlers/process-run-cleanup.ts
|
|
14
|
-
import { and, eq, isNotNull } from "drizzle-orm";
|
|
15
|
-
async function processRunCleanup(payload, deps = {}) {
|
|
16
|
-
const db = deps.db ?? getDb();
|
|
17
|
-
const doRemove = deps.removeWorktreeFn ?? removeWorktree;
|
|
18
|
-
const log = deps.log ?? ((msg) => process.stderr.write(`[process_run_cleanup] ${msg}
|
|
19
|
-
`));
|
|
20
|
-
const { runId } = payload;
|
|
21
|
-
const [run] = await db.select({
|
|
22
|
-
id: agentRuns.id,
|
|
23
|
-
userId: agentRuns.userId,
|
|
24
|
-
projectPath: agentRuns.projectPath
|
|
25
|
-
}).from(agentRuns).where(eq(agentRuns.id, runId)).limit(1);
|
|
26
|
-
if (!run) {
|
|
27
|
-
throw new PermanentJobError(`Run ${runId} not found`);
|
|
28
|
-
}
|
|
29
|
-
if (!run.projectPath) {
|
|
30
|
-
throw new PermanentJobError(
|
|
31
|
-
`Run ${runId} has no projectPath; cannot resolve a repo root for worktree cleanup`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
const repoRoot = run.projectPath;
|
|
35
|
-
const endedSessions = await db.select({
|
|
36
|
-
id: sessions.id,
|
|
37
|
-
projectPath: sessions.projectPath
|
|
38
|
-
}).from(sessions).where(
|
|
39
|
-
and(
|
|
40
|
-
eq(sessions.runId, runId),
|
|
41
|
-
eq(sessions.userId, run.userId),
|
|
42
|
-
isNotNull(sessions.endedAt)
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
const worktrees = [];
|
|
46
|
-
let removed = 0;
|
|
47
|
-
let skippedDirty = 0;
|
|
48
|
-
let absent = 0;
|
|
49
|
-
let errored = 0;
|
|
50
|
-
const seenPaths = /* @__PURE__ */ new Set();
|
|
51
|
-
for (const s of endedSessions) {
|
|
52
|
-
if (!s.projectPath || s.projectPath === repoRoot) continue;
|
|
53
|
-
if (seenPaths.has(s.projectPath)) continue;
|
|
54
|
-
seenPaths.add(s.projectPath);
|
|
55
|
-
try {
|
|
56
|
-
const result = await doRemove({ repoRoot, worktreePath: s.projectPath });
|
|
57
|
-
if (result.removed) {
|
|
58
|
-
removed++;
|
|
59
|
-
worktrees.push({ sessionId: s.id, worktreePath: s.projectPath, status: "removed" });
|
|
60
|
-
log(`removed worktree ${s.projectPath} (session ${s.id})`);
|
|
61
|
-
} else if (result.reason === "dirty") {
|
|
62
|
-
skippedDirty++;
|
|
63
|
-
worktrees.push({ sessionId: s.id, worktreePath: s.projectPath, status: "skipped-dirty" });
|
|
64
|
-
log(`skipped dirty worktree ${s.projectPath} (session ${s.id}) \u2014 uncommitted changes`);
|
|
65
|
-
} else {
|
|
66
|
-
absent++;
|
|
67
|
-
worktrees.push({ sessionId: s.id, worktreePath: s.projectPath, status: "absent" });
|
|
68
|
-
log(`worktree absent ${s.projectPath} (session ${s.id})`);
|
|
69
|
-
}
|
|
70
|
-
} catch (err) {
|
|
71
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
72
|
-
errored++;
|
|
73
|
-
worktrees.push({
|
|
74
|
-
sessionId: s.id,
|
|
75
|
-
worktreePath: s.projectPath,
|
|
76
|
-
status: "error",
|
|
77
|
-
error: message.slice(0, 1e3)
|
|
78
|
-
});
|
|
79
|
-
log(`error removing worktree ${s.projectPath} (session ${s.id}): ${message}`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
log(
|
|
83
|
-
`run ${runId} cleanup: removed=${removed} skippedDirty=${skippedDirty} absent=${absent} errored=${errored}`
|
|
84
|
-
);
|
|
85
|
-
return {
|
|
86
|
-
runId,
|
|
87
|
-
repoRoot,
|
|
88
|
-
removed,
|
|
89
|
-
skippedDirty,
|
|
90
|
-
absent,
|
|
91
|
-
errored,
|
|
92
|
-
worktrees
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export {
|
|
97
|
-
processRunCleanup
|
|
98
|
-
};
|
|
99
|
-
//# sourceMappingURL=chunk-6NBS5XFS.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/lib/handlers/process-run-cleanup.ts"],
|
|
4
|
-
"sourcesContent": ["import { and, eq, isNotNull } from 'drizzle-orm';\nimport { agentRuns, sessions, getDb } from '@rulemetric/db';\n\nimport { removeWorktree } from '../worktree.js';\nimport { PermanentJobError } from '../permanent-job-error.js';\n\nexport interface ProcessRunCleanupPayload {\n runId: string;\n}\n\n/** Per-worktree cleanup outcome for the summary returned to the API. */\nexport interface RunCleanupWorktreeOutcome {\n sessionId: string;\n worktreePath: string;\n /** 'removed' | 'skipped-dirty' | 'absent' | 'error' */\n status: 'removed' | 'skipped-dirty' | 'absent' | 'error';\n /** Present only when status === 'error'. */\n error?: string;\n}\n\nexport interface ProcessRunCleanupResult {\n runId: string;\n /** Repo root the worktrees were pruned from (the run's projectPath). */\n repoRoot: string | null;\n removed: number;\n skippedDirty: number;\n absent: number;\n errored: number;\n worktrees: RunCleanupWorktreeOutcome[];\n}\n\nexport interface ProcessRunCleanupDeps {\n db?: any;\n removeWorktreeFn?: typeof removeWorktree;\n log?: (msg: string) => void;\n}\n\n/**\n * Worker handler for the `process_run_cleanup` task (Task 5.2).\n *\n * Prunes the git worktrees of a run's ENDED sessions, GUARDING against\n * destroying uncommitted work. Only ENDED sessions are touched \u2014 an active\n * session is still using its worktree, so removing it would break the live\n * agent. Each worktree is removed via `removeWorktree`, which refuses to delete\n * a checkout with uncommitted changes (returns `skipped-dirty`) \u2014 never a\n * silent clobber (research \"merge-review bottleneck\" finding).\n *\n * Repo root = the run's `projectPath`. Each ended session's `projectPath` is\n * its worktree path (the launcher sets `config.projectPath = wt.path` before\n * spawning the session, and capture stamps that cwd onto `sessions.projectPath`\n * \u2014 see process-launch.ts + the linkRunSessions reconcile in runs.ts).\n *\n * Idempotent: a worktree already removed (or never created) reports `absent`,\n * not an error, so a re-run after a partial cleanup is safe. Per-worktree\n * errors are collected, not fatal \u2014 one bad worktree must not abort cleanup of\n * the others. The job only fails terminally on a missing run / missing repo\n * root, where there's nothing actionable to retry.\n *\n * No mirror table \u2014 this is an `agent_jobs` kind (like process_announcement /\n * process_session_goal). The result blob is returned to /api/work/:id/complete\n * and stored on the agent_jobs row for the API/UI to read.\n */\nexport async function processRunCleanup(\n payload: ProcessRunCleanupPayload,\n deps: ProcessRunCleanupDeps = {},\n): Promise<ProcessRunCleanupResult> {\n const db = deps.db ?? getDb();\n const doRemove = deps.removeWorktreeFn ?? removeWorktree;\n const log =\n deps.log ?? ((msg: string) => process.stderr.write(`[process_run_cleanup] ${msg}\\n`));\n\n const { runId } = payload;\n\n const [run] = await db\n .select({\n id: agentRuns.id,\n userId: agentRuns.userId,\n projectPath: agentRuns.projectPath,\n })\n .from(agentRuns)\n .where(eq(agentRuns.id, runId))\n .limit(1);\n\n if (!run) {\n throw new PermanentJobError(`Run ${runId} not found`);\n }\n if (!run.projectPath) {\n // No repo root to prune from \u2014 nothing we can ever do. Don't requeue.\n throw new PermanentJobError(\n `Run ${runId} has no projectPath; cannot resolve a repo root for worktree cleanup`,\n );\n }\n const repoRoot = run.projectPath;\n\n // ENDED sessions only (endedAt IS NOT NULL). Active sessions keep their\n // worktree \u2014 removing it out from under a running agent would break it.\n const endedSessions = await db\n .select({\n id: sessions.id,\n projectPath: sessions.projectPath,\n })\n .from(sessions)\n .where(\n and(\n eq(sessions.runId, runId),\n eq(sessions.userId, run.userId),\n isNotNull(sessions.endedAt),\n ),\n );\n\n const worktrees: RunCleanupWorktreeOutcome[] = [];\n let removed = 0;\n let skippedDirty = 0;\n let absent = 0;\n let errored = 0;\n\n // De-dupe by path so we don't double-remove if two ended sessions somehow\n // share a worktree path (shouldn't happen for autoWorktree runs, but cheap\n // insurance \u2014 git worktree remove on a gone path would otherwise count as a\n // spurious second `absent`).\n const seenPaths = new Set<string>();\n\n for (const s of endedSessions) {\n // A session without a cwd (or pointed at the shared repo root for a\n // non-worktree run) has no per-session worktree to remove \u2014 skip it. We\n // never remove the repo root itself.\n if (!s.projectPath || s.projectPath === repoRoot) continue;\n if (seenPaths.has(s.projectPath)) continue;\n seenPaths.add(s.projectPath);\n\n try {\n const result = await doRemove({ repoRoot, worktreePath: s.projectPath });\n if (result.removed) {\n removed++;\n worktrees.push({ sessionId: s.id, worktreePath: s.projectPath, status: 'removed' });\n log(`removed worktree ${s.projectPath} (session ${s.id})`);\n } else if (result.reason === 'dirty') {\n skippedDirty++;\n worktrees.push({ sessionId: s.id, worktreePath: s.projectPath, status: 'skipped-dirty' });\n log(`skipped dirty worktree ${s.projectPath} (session ${s.id}) \u2014 uncommitted changes`);\n } else {\n // reason === 'absent' (already removed / never existed)\n absent++;\n worktrees.push({ sessionId: s.id, worktreePath: s.projectPath, status: 'absent' });\n log(`worktree absent ${s.projectPath} (session ${s.id})`);\n }\n } catch (err) {\n // A single bad worktree must not abort cleanup of the rest.\n const message = err instanceof Error ? err.message : String(err);\n errored++;\n worktrees.push({\n sessionId: s.id,\n worktreePath: s.projectPath,\n status: 'error',\n error: message.slice(0, 1000),\n });\n log(`error removing worktree ${s.projectPath} (session ${s.id}): ${message}`);\n }\n }\n\n log(\n `run ${runId} cleanup: removed=${removed} skippedDirty=${skippedDirty} ` +\n `absent=${absent} errored=${errored}`,\n );\n\n return {\n runId,\n repoRoot,\n removed,\n skippedDirty,\n absent,\n errored,\n worktrees,\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAAA,SAAS,KAAK,IAAI,iBAAiB;AA8DnC,eAAsB,kBACpB,SACA,OAA8B,CAAC,GACG;AAClC,QAAM,KAAK,KAAK,MAAM,MAAM;AAC5B,QAAM,WAAW,KAAK,oBAAoB;AAC1C,QAAM,MACJ,KAAK,QAAQ,CAAC,QAAgB,QAAQ,OAAO,MAAM,yBAAyB,GAAG;AAAA,C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;AAAA,MAC3D,WAAW,OAAO,WAAW,SAAS;AACpC;AACA,kBAAU,KAAK,EAAE,WAAW,EAAE,IAAI,cAAc,EAAE,aAAa,QAAQ,gBAAgB,CAAC;AACxF,YAAI,0BAA0B,EAAE,WAAW,aAAa,EAAE,EAAE,8BAAyB;AAAA,MACvF,OAAO;AAEL;AACA,kBAAU,KAAK,EAAE,WAAW,EAAE,IAAI,cAAc,EAAE,aAAa,QAAQ,SAAS,CAAC;AACjF,YAAI,mBAAmB,EAAE,WAAW,aAAa,EAAE,EAAE,GAAG;AAAA,MAC1D;AAAA,IACF,SAAS,KAAK;AAEZ,YAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC/D;AACA,gBAAU,KAAK;AAAA,QACb,WAAW,EAAE;AAAA,QACb,cAAc,EAAE;AAAA,QAChB,QAAQ;AAAA,QACR,OAAO,QAAQ,MAAM,GAAG,GAAI;AAAA,MAC9B,CAAC;AACD,UAAI,2BAA2B,EAAE,WAAW,aAAa,EAAE,EAAE,MAAM,OAAO,EAAE;AAAA,IAC9E;AAAA,EACF;AAEA;AAAA,IACE,OAAO,KAAK,qBAAqB,OAAO,iBAAiB,YAAY,WACzD,MAAM,YAAY,OAAO;AAAA,EACvC;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/chunk-7LVVKQMZ.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// src/lib/gateway-identity.ts
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
|
-
import * as http from "node:http";
|
|
4
|
-
var GATEWAY_IDENTITY_PATH = "/__rulemetric_gateway__";
|
|
5
|
-
var GATEWAY_IDENTITY_SERVICE = "rulemetric-gateway";
|
|
6
|
-
var MAX_IDENTITY_BODY_BYTES = 4096;
|
|
7
|
-
function probeGatewayIdentity(port, timeoutMs = 1500) {
|
|
8
|
-
return new Promise((resolve) => {
|
|
9
|
-
let settled = false;
|
|
10
|
-
const finish = (result) => {
|
|
11
|
-
if (settled) return;
|
|
12
|
-
settled = true;
|
|
13
|
-
resolve(result);
|
|
14
|
-
};
|
|
15
|
-
const req = http.get(
|
|
16
|
-
{ host: "127.0.0.1", port, path: GATEWAY_IDENTITY_PATH, timeout: timeoutMs },
|
|
17
|
-
(res) => {
|
|
18
|
-
let body = "";
|
|
19
|
-
res.setEncoding("utf-8");
|
|
20
|
-
res.on("data", (chunk) => {
|
|
21
|
-
body += chunk;
|
|
22
|
-
if (body.length > MAX_IDENTITY_BODY_BYTES) {
|
|
23
|
-
req.destroy();
|
|
24
|
-
finish({ status: "foreign", detail: "oversized identity response" });
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
res.on("end", () => {
|
|
28
|
-
if (res.statusCode === 200) {
|
|
29
|
-
try {
|
|
30
|
-
const parsed = JSON.parse(body);
|
|
31
|
-
if (parsed?.service === GATEWAY_IDENTITY_SERVICE) {
|
|
32
|
-
finish({
|
|
33
|
-
status: "ours-live",
|
|
34
|
-
version: typeof parsed.version === "string" ? parsed.version : null,
|
|
35
|
-
pid: typeof parsed.pid === "number" ? parsed.pid : null
|
|
36
|
-
});
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
} catch {
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
finish({ status: "foreign", detail: `HTTP ${res.statusCode ?? "?"} without identity marker` });
|
|
43
|
-
});
|
|
44
|
-
res.on("error", () => finish({ status: "foreign", detail: "response stream error" }));
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
req.on("timeout", () => {
|
|
48
|
-
req.destroy();
|
|
49
|
-
finish({ status: "foreign", detail: "accepted TCP but no identity response (timeout)" });
|
|
50
|
-
});
|
|
51
|
-
req.on("error", (err) => {
|
|
52
|
-
const code = err.code;
|
|
53
|
-
if (code === "ECONNREFUSED") {
|
|
54
|
-
finish({ status: "dead" });
|
|
55
|
-
} else {
|
|
56
|
-
finish({ status: "foreign", detail: `socket error ${code ?? err.message}` });
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
async function waitForGatewayIdentity(port, { timeoutMs = 3e3, intervalMs = 150 } = {}) {
|
|
62
|
-
const deadline = Date.now() + timeoutMs;
|
|
63
|
-
for (; ; ) {
|
|
64
|
-
const identity = await probeGatewayIdentity(port, Math.min(1500, timeoutMs));
|
|
65
|
-
if (identity.status !== "dead") return identity;
|
|
66
|
-
if (Date.now() >= deadline) return identity;
|
|
67
|
-
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function runLsofDefault(port) {
|
|
71
|
-
try {
|
|
72
|
-
return execFileSync("lsof", ["-nP", `-iTCP:${port}`, "-sTCP:LISTEN"], {
|
|
73
|
-
encoding: "utf-8",
|
|
74
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
75
|
-
});
|
|
76
|
-
} catch {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function describePortOwner(port, opts = {}) {
|
|
81
|
-
const output = (opts.runLsof ?? runLsofDefault)(port);
|
|
82
|
-
if (!output) return null;
|
|
83
|
-
const rows = output.split("\n").filter((line) => line.trim().length > 0);
|
|
84
|
-
const dataRow = rows.find((line) => !/^COMMAND\s/.test(line));
|
|
85
|
-
if (!dataRow) return null;
|
|
86
|
-
const [command, pid] = dataRow.trim().split(/\s+/);
|
|
87
|
-
if (!command) return null;
|
|
88
|
-
return pid ? `${command} (PID ${pid})` : command;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
GATEWAY_IDENTITY_PATH,
|
|
93
|
-
GATEWAY_IDENTITY_SERVICE,
|
|
94
|
-
probeGatewayIdentity,
|
|
95
|
-
waitForGatewayIdentity,
|
|
96
|
-
describePortOwner
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=chunk-7LVVKQMZ.js.map
|