@rulemetric/cli 0.7.3 → 0.7.5
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/README.md +10 -8
- package/dist/base-command.js +1 -14
- package/dist/chunk-2JRDG4LJ.js +31 -0
- package/dist/chunk-2TC6WCUT.js +34 -0
- package/dist/chunk-2WLVDSAP.js +2 -0
- package/dist/chunk-32EEBARV.js +1 -0
- package/dist/chunk-3AV3GTMP.js +1 -0
- package/dist/chunk-43YBXX7R.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-7DFNBRLY.js +61 -0
- package/dist/chunk-ARNZQBMX.js +1 -0
- package/dist/chunk-AYUJY37O.js +5 -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-DCLWFGEA.js +1 -0
- package/dist/chunk-DNF4HDI6.js +14 -0
- package/dist/chunk-DPFNJZUO.js +1 -0
- package/dist/chunk-DSO2U4Y6.js +56 -0
- package/dist/chunk-DVN7GFJG.js +1 -0
- package/dist/chunk-G63KMH6U.js +1 -0
- package/dist/chunk-G6XGDHGC.js +2 -0
- package/dist/chunk-GBMF3TP6.js +1 -0
- package/dist/chunk-GY5IJ4RS.js +1 -0
- package/dist/chunk-H2ORWIEY.js +1 -0
- package/dist/chunk-H4SV7FN4.js +1 -0
- package/dist/chunk-HS7X43XE.js +24 -0
- package/dist/{chunk-OQBBVTDG.js → chunk-I2DZGJRR.js} +6 -71
- package/dist/chunk-IZTIYR5Q.js +2 -0
- package/dist/chunk-JAPCCEKF.js +3 -0
- package/dist/chunk-JQTGQXUX.js +1 -0
- package/dist/chunk-KAF3CYRW.js +9 -0
- package/dist/chunk-KKDHD4XA.js +2 -0
- package/dist/chunk-KV325CXF.js +33 -0
- package/dist/chunk-MGHFDHHM.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-N7TGRFVZ.js +70 -0
- package/dist/chunk-NBTC5FNV.js +1 -0
- package/dist/chunk-NEACEHQD.js +1 -0
- package/dist/chunk-NJ5UED3H.js +1 -0
- package/dist/chunk-NVKX36YN.js +3 -0
- package/dist/chunk-O2SDD2WW.js +1 -0
- package/dist/chunk-O6C2UGBY.js +7 -0
- package/dist/chunk-OMXUK4M6.js +1 -0
- package/dist/chunk-PPKPCXJD.js +4 -0
- package/dist/{chunk-XZXS2W24.js → chunk-QFVGUZDO.js} +11 -57
- package/dist/chunk-RDET7CKR.js +1 -0
- package/dist/chunk-RQ424GI6.js +5 -0
- package/dist/chunk-RSKQRVPJ.js +1 -0
- package/dist/chunk-RTWRHIKY.js +7 -0
- package/dist/chunk-SZ62CP55.js +1 -0
- package/dist/chunk-TDD7IOV2.js +1 -0
- package/dist/chunk-TIOKY2IA.js +1 -0
- package/dist/chunk-TQMG647B.js +15 -0
- package/dist/chunk-TU2AR6XO.js +1 -0
- package/dist/chunk-U6ABMRT3.js +9 -0
- package/dist/chunk-U6XEU573.js +1 -0
- package/dist/chunk-UF6US7VU.js +1 -0
- package/dist/chunk-V44SRRYR.js +1 -0
- package/dist/chunk-V5U3E4BZ.js +1 -0
- package/dist/chunk-VAXRCSSH.js +2 -0
- package/dist/chunk-VLOX6KOM.js +1 -0
- package/dist/chunk-VUGRXM7R.js +1 -0
- package/dist/chunk-W2MOTOQE.js +1 -0
- package/dist/chunk-W2MV25SB.js +1 -0
- package/dist/chunk-WLVQJH4E.js +1 -0
- package/dist/chunk-WSCK4WNK.js +1 -0
- package/dist/chunk-XICLXXRH.js +1 -0
- package/dist/chunk-XXDZJ6YI.js +1 -0
- package/dist/chunk-ZL4MZMUK.js +34 -0
- package/dist/chunk-ZLLER3HP.js +1 -0
- package/dist/chunk-ZR3MUNLS.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 +4 -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 +17 -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 +1 -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 +2 -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/ensure-fresh-token.js +1 -0
- 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 +12 -34
- 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-4SCZK7AL.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Panel,
|
|
3
|
-
fit
|
|
4
|
-
} from "./chunk-DQ3KELXD.js";
|
|
5
|
-
import {
|
|
6
|
-
BLUE,
|
|
7
|
-
DIM,
|
|
8
|
-
GREEN,
|
|
9
|
-
ORANGE
|
|
10
|
-
} from "./chunk-QJQS6TUN.js";
|
|
11
|
-
import {
|
|
12
|
-
__require
|
|
13
|
-
} from "./chunk-NSBPE2FW.js";
|
|
14
|
-
|
|
15
|
-
// src/dashboard/panels/insights.tsx
|
|
16
|
-
import { useState, useMemo } from "react";
|
|
17
|
-
import { Box, Text, useInput } from "ink";
|
|
18
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
function extractSuggestions(api) {
|
|
20
|
-
const recs = api.recommendations;
|
|
21
|
-
if (!recs) return [];
|
|
22
|
-
const items = [];
|
|
23
|
-
for (const f of recs.suggestions?.features_to_try ?? []) {
|
|
24
|
-
if (!f.example_code) continue;
|
|
25
|
-
items.push({
|
|
26
|
-
label: f.feature,
|
|
27
|
-
description: f.why_for_you || f.one_liner,
|
|
28
|
-
command: f.example_code
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
for (const u of recs.suggestions?.usage_patterns ?? []) {
|
|
32
|
-
if (!u.copyable_prompt) continue;
|
|
33
|
-
items.push({
|
|
34
|
-
label: u.title,
|
|
35
|
-
description: u.suggestion,
|
|
36
|
-
command: u.copyable_prompt
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
for (const o of recs.on_the_horizon?.opportunities ?? []) {
|
|
40
|
-
if (!o.copyable_prompt) continue;
|
|
41
|
-
items.push({
|
|
42
|
-
label: o.title,
|
|
43
|
-
description: o.whats_possible,
|
|
44
|
-
command: o.copyable_prompt
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return items;
|
|
48
|
-
}
|
|
49
|
-
function toCliCommand(prompt) {
|
|
50
|
-
const trimmed = prompt.trim();
|
|
51
|
-
if (/^(claude|rulemetric|pnpm|npm|npx|git)\s/.test(trimmed)) {
|
|
52
|
-
return trimmed;
|
|
53
|
-
}
|
|
54
|
-
return `claude -p '${trimmed.replace(/'/g, "'\\''")}'`;
|
|
55
|
-
}
|
|
56
|
-
function copyToClipboard(text) {
|
|
57
|
-
try {
|
|
58
|
-
const { execSync } = __require("node:child_process");
|
|
59
|
-
if (process.platform === "darwin") {
|
|
60
|
-
execSync("pbcopy", { input: text, stdio: ["pipe", "ignore", "ignore"] });
|
|
61
|
-
} else {
|
|
62
|
-
execSync("xclip -selection clipboard", { input: text, stdio: ["pipe", "ignore", "ignore"] });
|
|
63
|
-
}
|
|
64
|
-
return true;
|
|
65
|
-
} catch {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function InsightsPanel({ api, width, focused, onSelect }) {
|
|
70
|
-
const [selectedIdx, setSelectedIdx] = useState(0);
|
|
71
|
-
const [copiedIdx, setCopiedIdx] = useState(null);
|
|
72
|
-
const suggestions = useMemo(() => api ? extractSuggestions(api) : [], [api]);
|
|
73
|
-
const atAGlance = api?.recommendations?.at_a_glance;
|
|
74
|
-
useInput((input, key) => {
|
|
75
|
-
if (!focused || suggestions.length === 0) return;
|
|
76
|
-
if (key.upArrow) {
|
|
77
|
-
setSelectedIdx((i) => Math.max(0, i - 1));
|
|
78
|
-
} else if (key.downArrow) {
|
|
79
|
-
setSelectedIdx((i) => Math.min(suggestions.length - 1, i + 1));
|
|
80
|
-
} else if (key.return) {
|
|
81
|
-
const item = suggestions[selectedIdx];
|
|
82
|
-
if (item) {
|
|
83
|
-
const cmd = toCliCommand(item.command);
|
|
84
|
-
const copied = copyToClipboard(cmd);
|
|
85
|
-
if (copied) {
|
|
86
|
-
setCopiedIdx(selectedIdx);
|
|
87
|
-
setTimeout(() => setCopiedIdx(null), 2e3);
|
|
88
|
-
}
|
|
89
|
-
onSelect?.(cmd);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
if (!api) {
|
|
94
|
-
return /* @__PURE__ */ jsx(Panel, { title: "Insights", color: ORANGE, width, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "API offline \u2014 no insights" }) });
|
|
95
|
-
}
|
|
96
|
-
if (!atAGlance && suggestions.length === 0) {
|
|
97
|
-
return /* @__PURE__ */ jsx(Panel, { title: "Insights", color: ORANGE, width, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "No recommendations yet. Run: rulemetric insights sync" }) });
|
|
98
|
-
}
|
|
99
|
-
const maxLabel = Math.min(30, Math.max(...suggestions.map((s) => s.label.length), 10));
|
|
100
|
-
const descWidth = Math.max(10, width - maxLabel - 12);
|
|
101
|
-
return /* @__PURE__ */ jsxs(Panel, { title: focused ? "\u25B8 Insights & Suggestions" : "Insights & Suggestions", color: focused ? ORANGE : DIM, width, children: [
|
|
102
|
-
atAGlance && Object.entries(atAGlance).length > 0 && /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 1, children: Object.entries(atAGlance).map(([key, value]) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
103
|
-
/* @__PURE__ */ jsx(Text, { color: DIM, bold: true, children: key.replace(/_/g, " ").toUpperCase() }),
|
|
104
|
-
/* @__PURE__ */ jsx(Text, { wrap: "wrap", children: String(value).slice(0, 200) })
|
|
105
|
-
] }, key)) }),
|
|
106
|
-
suggestions.length > 0 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
107
|
-
/* @__PURE__ */ jsxs(Box, { marginBottom: 0, children: [
|
|
108
|
-
/* @__PURE__ */ jsx(Text, { color: ORANGE, bold: true, children: "Suggestions" }),
|
|
109
|
-
focused && /* @__PURE__ */ jsx(Text, { dimColor: true, children: " \u2191\u2193 navigate \u23CE copy command" })
|
|
110
|
-
] }),
|
|
111
|
-
suggestions.map((s, i) => {
|
|
112
|
-
const isSelected = focused && i === selectedIdx;
|
|
113
|
-
const isCopied = i === copiedIdx;
|
|
114
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
115
|
-
/* @__PURE__ */ jsx(Text, { color: isSelected ? ORANGE : DIM, children: isSelected ? "\u25B8 " : " " }),
|
|
116
|
-
/* @__PURE__ */ jsx(Text, { color: isSelected ? ORANGE : BLUE, bold: isSelected, children: fit(s.label, maxLabel) }),
|
|
117
|
-
/* @__PURE__ */ jsx(Text, { color: DIM, children: " \u2502 " }),
|
|
118
|
-
/* @__PURE__ */ jsx(Text, { color: isSelected ? void 0 : DIM, wrap: "truncate-end", children: fit(s.description, descWidth) }),
|
|
119
|
-
isCopied && /* @__PURE__ */ jsx(Text, { color: GREEN, children: " \u2713 copied" })
|
|
120
|
-
] }, i);
|
|
121
|
-
})
|
|
122
|
-
] })
|
|
123
|
-
] });
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export {
|
|
127
|
-
InsightsPanel
|
|
128
|
-
};
|
|
129
|
-
//# sourceMappingURL=chunk-4SCZK7AL.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/dashboard/panels/insights.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useMemo } from 'react';\nimport { Box, Text, useInput } from 'ink';\nimport { ORANGE, DIM, GREEN, BLUE } from '../types.js';\nimport type { ApiInsights, Suggestion } from '../types.js';\nimport { Panel, fit } from './shared.js';\n\n/** Extract all actionable suggestions from recommendations into a flat list. */\nfunction extractSuggestions(api: ApiInsights): Suggestion[] {\n const recs = api.recommendations;\n if (!recs) return [];\n const items: Suggestion[] = [];\n\n // Features to try\n for (const f of recs.suggestions?.features_to_try ?? []) {\n if (!f.example_code) continue;\n items.push({\n label: f.feature,\n description: f.why_for_you || f.one_liner,\n command: f.example_code,\n });\n }\n\n // Usage patterns\n for (const u of recs.suggestions?.usage_patterns ?? []) {\n if (!u.copyable_prompt) continue;\n items.push({\n label: u.title,\n description: u.suggestion,\n command: u.copyable_prompt,\n });\n }\n\n // On the horizon\n for (const o of recs.on_the_horizon?.opportunities ?? []) {\n if (!o.copyable_prompt) continue;\n items.push({\n label: o.title,\n description: o.whats_possible,\n command: o.copyable_prompt,\n });\n }\n\n return items;\n}\n\n/** Format a prompt as a CLI command if it isn't one already. */\nfunction toCliCommand(prompt: string): string {\n const trimmed = prompt.trim();\n if (/^(claude|rulemetric|pnpm|npm|npx|git)\\s/.test(trimmed)) {\n return trimmed;\n }\n return `claude -p '${trimmed.replace(/'/g, \"'\\\\''\")}'`;\n}\n\n/** Copy text to system clipboard (best-effort). */\nfunction copyToClipboard(text: string): boolean {\n try {\n const { execSync } = require('node:child_process');\n if (process.platform === 'darwin') {\n execSync('pbcopy', { input: text, stdio: ['pipe', 'ignore', 'ignore'] });\n } else {\n execSync('xclip -selection clipboard', { input: text, stdio: ['pipe', 'ignore', 'ignore'] });\n }\n return true;\n } catch {\n return false;\n }\n}\n\nexport function InsightsPanel({ api, width, focused, onSelect }: {\n api: ApiInsights | null;\n width: number;\n focused?: boolean;\n onSelect?: (command: string) => void;\n}) {\n const [selectedIdx, setSelectedIdx] = useState(0);\n const [copiedIdx, setCopiedIdx] = useState<number | null>(null);\n\n const suggestions = useMemo(() => api ? extractSuggestions(api) : [], [api]);\n\n const atAGlance = api?.recommendations?.at_a_glance as Record<string, string> | undefined;\n\n useInput((input, key) => {\n if (!focused || suggestions.length === 0) return;\n\n if (key.upArrow) {\n setSelectedIdx(i => Math.max(0, i - 1));\n } else if (key.downArrow) {\n setSelectedIdx(i => Math.min(suggestions.length - 1, i + 1));\n } else if (key.return) {\n const item = suggestions[selectedIdx];\n if (item) {\n const cmd = toCliCommand(item.command);\n const copied = copyToClipboard(cmd);\n if (copied) {\n setCopiedIdx(selectedIdx);\n setTimeout(() => setCopiedIdx(null), 2000);\n }\n onSelect?.(cmd);\n }\n }\n });\n\n if (!api) {\n return (\n <Panel title=\"Insights\" color={ORANGE} width={width}>\n <Text dimColor>API offline \u2014 no insights</Text>\n </Panel>\n );\n }\n\n if (!atAGlance && suggestions.length === 0) {\n return (\n <Panel title=\"Insights\" color={ORANGE} width={width}>\n <Text dimColor>No recommendations yet. Run: rulemetric insights sync</Text>\n </Panel>\n );\n }\n\n const maxLabel = Math.min(30, Math.max(...suggestions.map(s => s.label.length), 10));\n const descWidth = Math.max(10, width - maxLabel - 12);\n\n return (\n <Panel title={focused ? '\u25B8 Insights & Suggestions' : 'Insights & Suggestions'} color={focused ? ORANGE : DIM} width={width}>\n {/* At a glance summary */}\n {atAGlance && Object.entries(atAGlance).length > 0 && (\n <Box flexDirection=\"column\" marginBottom={1}>\n {Object.entries(atAGlance).map(([key, value]) => (\n <Box key={key} flexDirection=\"column\">\n <Text color={DIM} bold>{key.replace(/_/g, ' ').toUpperCase()}</Text>\n <Text wrap=\"wrap\">{String(value).slice(0, 200)}</Text>\n </Box>\n ))}\n </Box>\n )}\n\n {/* Selectable suggestions */}\n {suggestions.length > 0 && (\n <Box flexDirection=\"column\">\n <Box marginBottom={0}>\n <Text color={ORANGE} bold>Suggestions</Text>\n {focused && <Text dimColor> \u2191\u2193 navigate \u23CE copy command</Text>}\n </Box>\n {suggestions.map((s, i) => {\n const isSelected = focused && i === selectedIdx;\n const isCopied = i === copiedIdx;\n return (\n <Box key={i}>\n <Text color={isSelected ? ORANGE : DIM}>{isSelected ? '\u25B8 ' : ' '}</Text>\n <Text color={isSelected ? ORANGE : BLUE} bold={isSelected}>\n {fit(s.label, maxLabel)}\n </Text>\n <Text color={DIM}> \u2502 </Text>\n <Text color={isSelected ? undefined : DIM} wrap=\"truncate-end\">\n {fit(s.description, descWidth)}\n </Text>\n {isCopied && <Text color={GREEN}> \u2713 copied</Text>}\n </Box>\n );\n })}\n </Box>\n )}\n </Panel>\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA,SAAgB,UAAU,eAAe;AACzC,SAAS,KAAK,MAAM,gBAAgB;AAyG5B,cAsBI,YAtBJ;AAnGR,SAAS,mBAAmB,KAAgC;AAC1D,QAAM,OAAO,IAAI;AACjB,MAAI,CAAC,KAAM,QAAO,CAAC;AACnB,QAAM,QAAsB,CAAC;AAG7B,aAAW,KAAK,KAAK,aAAa,mBAAmB,CAAC,GAAG;AACvD,QAAI,CAAC,EAAE,aAAc;AACrB,UAAM,KAAK;AAAA,MACT,OAAO,EAAE;AAAA,MACT,aAAa,EAAE,eAAe,EAAE;AAAA,MAChC,SAAS,EAAE;AAAA,IACb,CAAC;AAAA,EACH;AAGA,aAAW,KAAK,KAAK,aAAa,kBAAkB,CAAC,GAAG;AACtD,QAAI,CAAC,EAAE,gBAAiB;AACxB,UAAM,KAAK;AAAA,MACT,OAAO,EAAE;AAAA,MACT,aAAa,EAAE;AAAA,MACf,SAAS,EAAE;AA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,MAAM,GAAG,GAAG,GAAE;AAAA,SAFvC,GAGV,CACD,GACH;AAAA,IAID,YAAY,SAAS,KACpB,qBAAC,OAAI,eAAc,UACjB;AAAA,2BAAC,OAAI,cAAc,GACjB;AAAA,4BAAC,QAAK,OAAO,QAAQ,MAAI,MAAC,yBAAW;AAAA,QACpC,WAAW,oBAAC,QAAK,UAAQ,MAAC,0DAA6B;AAAA,SAC1D;AAAA,MACC,YAAY,IAAI,CAAC,GAAG,MAAM;AACzB,cAAM,aAAa,WAAW,MAAM;AACpC,cAAM,WAAW,MAAM;AACvB,eACE,qBAAC,OACC;AAAA,8BAAC,QAAK,OAAO,aAAa,SAAS,KAAM,uBAAa,YAAO,MAAK;AAAA,UAClE,oBAAC,QAAK,OAAO,aAAa,SAAS,MAAM,MAAM,YAC5C,cAAI,EAAE,OAAO,QAAQ,GACxB;AAAA,UACA,oBAAC,QAAK,OAAO,KAAK,sBAAG;AAAA,UACrB,oBAAC,QAAK,OAAO,aAAa,SAAY,KAAK,MAAK,gBAC7C,cAAI,EAAE,aAAa,SAAS,GAC/B;AAAA,UACC,YAAY,oBAAC,QAAK,OAAO,OAAO,4BAAS;AAAA,aATlC,CAUV;AAAA,MAEJ,CAAC;AAAA,OACH;AAAA,KAEJ;AAEJ;",
|
|
6
|
-
"names": []
|
|
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
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA,SAAgB,WAAW,gBAAgB;AAC3C,SAAS,KAAK,MAAM,gBAAgB;AAiI5B,cAIU,YAJV;AAvHD,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,QAAM,EAAE,MAAM,OAAO,SAAS,QAAQ,IAAI,cAAc,EAAE;AAC1D,QAAM,CAAC,WAAW,YAAY,IAAI,SAA8B,CAAC,CAAC;AAClE,QAAM,CAAC,MAAM,OAAO,IAAI,SAAoB,MAAM;AAClD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AACpD,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAA2B,IAAI;AACzE,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAIhC,IAAI;AACd,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AAEtD,YAAU,MAAM;AACd,kBAAc,EACX,KAAK,YAAY,EACjB,MAAM,CAAC,MAAe;AACrB,YAAM,MAAM,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AACrD,eAAS,4BAA4B,GAAG,EAAE;AAE1C,mBAAa;AAAA,QACX,EAAE,MAAM,eAAe,cAAc,EAAE,UAAU,MAAM,aAAa,MAAM,aAAa,KAAK,EAAE;AAAA,MAChG,CAAC;AAAA,IACH,CAAC;AAAA,EACL,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,QAAI,CAAC,MAAO;AACZ,UAAM,IAAI,WAAW,MAAM,SAAS,IAAI,GAAG,GAAI;AAC/C,WAAO,MAAM,aAAa,CAAC;AAAA,EAC7B,GAAG,CAAC,KAAK,CAAC;AAEV,WAAS,CAAC,O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Aa,eAAe;AAAA,QAC5B,wBAAwB,eAAe;AAAA,QACvC,SAAS,SAAS;AAAA,QAClB,UAAU;AAAA;AAAA,IACZ,GACF;AAAA,IACC,iBACC,oBAAC,OAAI,WAAW,GACd,+BAAC,QAAK,OAAM,WAAU;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,QAAQ,kBAAkB;AAChD,SAAS,YAAY;AACrB,SAAS,cAAc;AAOhB,SAAS,mBAAmB,SAIjC;AACA,QAAM,MAAM,WAAW,QAAQ,IAAI;AACnC,QAAM,SAAS,KAAK,OAAO,GAAG,kBAAkB;AAGhD,MAAI;AACF,aAAS,2BAA2B,EAAE,KAAK,OAAO,OAAO,CAAC;AAAA,EAC5D,QAAQ;AAEN,UAAM,UAAU,YAAY,MAAM;AAClC,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS,MAAM,OAAO,OAAO;AAAA,MAC7B,YAAY;AAAA,IACd;AAAA,EACF;AAGA,MAAI;AACJ,MAAI;AACF,UAAM,SAAS,sBAAsB,EAAE,KAAK,OAAO,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK;AAAA,EAC/E,QAAQ;AACN,UAAM,UAAU,YAAY,MAAM;AAClC,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS,MAAM,OAAO,OAAO;AAAA,MAC7B,YAAY;AAAA,IACd;AAAA,EACF;AAGA,QAAM,eAAe,YAAY,MAAM;AAEvC,SAAO,cAAc,EAAE,WAAW,KAAK,CAAC;AAExC,MAAI;AACF,aAAS,8BAA8B,YAAY,KAAK,GAAG,IAAI;AAAA,MAC7D;AAAA,MACA,OAAO;AAAA,IACT,CAAC;AAAA,EACH,QAAQ;AAEN,UAAM,UAAU,YAAY,MAAM;AAClC,WAAO;AAAA,MACL,SAAS;AAAA,MACT,SAAS,MAAM,OAAO,OAAO;AAAA,MAC7B,YAAY;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,SAAS,MAAM;AACb,UAAI;AACF,iBAAS,gCAAgC,YAAY,KAAK,EAAE,KAAK,OAAO,OAAO,CAAC;AAAA,MAClF,QAAQ;AAEN,eAAO,YAAY;AAEnB,YAAI;AAAE,mBAAS,sBAAsB,EAAE,KAAK,OAAO,OAAO,CAAC;AAAA,QAAG,QAAQ;AAAA,QAAe;AAAA,MACvF;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,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,WAAC;AAAA,QAChB,qBAAC,QAAK,UAAQ,MAAC;AAAA;AAAA,UAAG,IAAI,EAAE,SAAS;AAAA,WAAE;AAAA,WAP1B,EAAE,EAQb;AAAA,IAEJ,CAAC;AAAA,KACH;AAEJ;",
|
|
6
|
-
"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
|
-
}
|