@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.
Files changed (547) hide show
  1. package/dist/base-command.js +1 -14
  2. package/dist/chunk-2TC6WCUT.js +34 -0
  3. package/dist/chunk-2UC3ULIG.js +1 -0
  4. package/dist/chunk-3AV3GTMP.js +1 -0
  5. package/dist/chunk-4Z5ECCJE.js +1 -0
  6. package/dist/chunk-5RBLIVBF.js +1 -0
  7. package/dist/chunk-67QCYUJU.js +1 -0
  8. package/dist/chunk-6QKI756T.js +2 -0
  9. package/dist/chunk-6V4WM73L.js +1 -0
  10. package/dist/chunk-6XEC6474.js +1 -0
  11. package/dist/chunk-72XLQE3X.js +2 -0
  12. package/dist/chunk-7DFNBRLY.js +61 -0
  13. package/dist/chunk-7XQ4VPLC.js +2 -0
  14. package/dist/chunk-AHRHCERJ.js +1 -0
  15. package/dist/chunk-ARNZQBMX.js +1 -0
  16. package/dist/chunk-CADKBP3D.js +58 -0
  17. package/dist/chunk-CDI5CCHU.js +1 -0
  18. package/dist/chunk-CNQ5DTNC.js +1 -0
  19. package/dist/chunk-CRAKDQ4H.js +1 -0
  20. package/dist/chunk-DNF4HDI6.js +14 -0
  21. package/dist/chunk-DSO2U4Y6.js +56 -0
  22. package/dist/chunk-DT4GKEP5.js +5 -0
  23. package/dist/chunk-DVN7GFJG.js +1 -0
  24. package/dist/chunk-E4SFUPYR.js +15 -0
  25. package/dist/chunk-EUHNCVJQ.js +33 -0
  26. package/dist/chunk-F2VP4B4J.js +1 -0
  27. package/dist/chunk-FEHM5OKW.js +1 -0
  28. package/dist/chunk-FHVBTDBM.js +69 -0
  29. package/dist/chunk-GBMF3TP6.js +1 -0
  30. package/dist/chunk-GY5IJ4RS.js +1 -0
  31. package/dist/chunk-HOHD5HY2.js +5 -0
  32. package/dist/chunk-HP2BUPGS.js +24 -0
  33. package/dist/{chunk-OQBBVTDG.js → chunk-I2DZGJRR.js} +6 -71
  34. package/dist/chunk-I4YJ7NTX.js +1 -0
  35. package/dist/chunk-IY5NXR3N.js +1 -0
  36. package/dist/chunk-IZTIYR5Q.js +2 -0
  37. package/dist/chunk-KKDHD4XA.js +2 -0
  38. package/dist/chunk-LQRYQE6Q.js +4 -0
  39. package/dist/chunk-M6AJDVCL.js +5 -0
  40. package/dist/chunk-MGHFDHHM.js +1 -0
  41. package/dist/chunk-ML36XQW7.js +1 -0
  42. package/dist/chunk-MODXEGCU.js +1 -0
  43. package/dist/chunk-MVM6OGAF.js +4 -0
  44. package/dist/chunk-N7ODX6PO.js +1 -0
  45. package/dist/chunk-NBTC5FNV.js +1 -0
  46. package/dist/chunk-NJ5UED3H.js +1 -0
  47. package/dist/chunk-NVKX36YN.js +3 -0
  48. package/dist/chunk-NVOTOQBA.js +1 -0
  49. package/dist/chunk-O7ZMHCMG.js +31 -0
  50. package/dist/chunk-OMXUK4M6.js +1 -0
  51. package/dist/chunk-PZS2KOU7.js +1 -0
  52. package/dist/chunk-RSKQRVPJ.js +1 -0
  53. package/dist/chunk-RTEATXTP.js +1 -0
  54. package/dist/chunk-RTWRHIKY.js +7 -0
  55. package/dist/chunk-RVO4HV3M.js +1 -0
  56. package/dist/chunk-SBILN45P.js +1 -0
  57. package/dist/chunk-SZ62CP55.js +1 -0
  58. package/dist/chunk-T3W5N3BP.js +2 -0
  59. package/dist/chunk-TDD7IOV2.js +1 -0
  60. package/dist/chunk-TIQ7DQ3M.js +1 -0
  61. package/dist/chunk-TU2AR6XO.js +1 -0
  62. package/dist/chunk-UF6US7VU.js +1 -0
  63. package/dist/chunk-V5QFOF4F.js +9 -0
  64. package/dist/chunk-V5U3E4BZ.js +1 -0
  65. package/dist/chunk-VAFAH6QL.js +1 -0
  66. package/dist/chunk-VMWY7KHH.js +1 -0
  67. package/dist/chunk-VUGRXM7R.js +1 -0
  68. package/dist/{chunk-XZXS2W24.js → chunk-VWEXKDWG.js} +10 -56
  69. package/dist/chunk-W2MV25SB.js +1 -0
  70. package/dist/chunk-WJ3H73G6.js +1 -0
  71. package/dist/chunk-WJUQBMTF.js +9 -0
  72. package/dist/chunk-WLVQJH4E.js +1 -0
  73. package/dist/chunk-WPJ2BND4.js +1 -0
  74. package/dist/chunk-WSCK4WNK.js +1 -0
  75. package/dist/chunk-Y65CSJFF.js +3 -0
  76. package/dist/chunk-ZL4MZMUK.js +34 -0
  77. package/dist/chunk-ZLLER3HP.js +1 -0
  78. package/dist/chunk-ZXF5NE54.js +1 -0
  79. package/dist/commands/antigravity/backfill.js +2 -136
  80. package/dist/commands/auth/create-key.js +1 -52
  81. package/dist/commands/auth/login.js +1 -85
  82. package/dist/commands/auth/logout.js +1 -29
  83. package/dist/commands/auth/revoke-key.js +1 -33
  84. package/dist/commands/auth/signup.js +1 -89
  85. package/dist/commands/auth/status.js +1 -42
  86. package/dist/commands/catalog/index.js +2 -52
  87. package/dist/commands/catalog/recommend.js +3 -43
  88. package/dist/commands/convert.js +1 -75
  89. package/dist/commands/converters.js +1 -54
  90. package/dist/commands/crons/list.js +1 -41
  91. package/dist/commands/crons/run.js +2 -76
  92. package/dist/commands/dashboard.js +1 -46
  93. package/dist/commands/diagnostics.js +1 -117
  94. package/dist/commands/eval-targets/create.js +1 -53
  95. package/dist/commands/eval-targets/list.js +1 -54
  96. package/dist/commands/evals/agent.js +3 -310
  97. package/dist/commands/evals/benchmark.js +6 -73
  98. package/dist/commands/evals/compare.js +13 -96
  99. package/dist/commands/evals/create.js +1 -67
  100. package/dist/commands/evals/optimize-description.js +25 -239
  101. package/dist/commands/evals/optimize.js +5 -211
  102. package/dist/commands/evals/run.js +3 -183
  103. package/dist/commands/gateway/ensure.js +1 -104
  104. package/dist/commands/hooks/emit-instructions.js +1 -25
  105. package/dist/commands/hooks/install.js +1 -442
  106. package/dist/commands/hooks/run.js +3 -81
  107. package/dist/commands/hooks/uninstall.js +2 -156
  108. package/dist/commands/import.js +1 -66
  109. package/dist/commands/instructions/create.js +1 -74
  110. package/dist/commands/instructions/delete.js +1 -55
  111. package/dist/commands/instructions/fork.js +1 -34
  112. package/dist/commands/instructions/get.js +1 -68
  113. package/dist/commands/instructions/list.js +1 -65
  114. package/dist/commands/instructions/promote.js +1 -42
  115. package/dist/commands/instructions/pull.js +1 -39
  116. package/dist/commands/instructions/upstream.js +1 -38
  117. package/dist/commands/instructions/versions.js +1 -53
  118. package/dist/commands/launcher.js +1 -40
  119. package/dist/commands/org/current.js +1 -77
  120. package/dist/commands/org/list.js +1 -52
  121. package/dist/commands/org/switch.js +1 -71
  122. package/dist/commands/packs/add-instruction.js +1 -37
  123. package/dist/commands/packs/apply.js +1 -39
  124. package/dist/commands/packs/create.js +1 -50
  125. package/dist/commands/packs/fork.js +1 -34
  126. package/dist/commands/packs/get.js +3 -56
  127. package/dist/commands/packs/list.js +1 -66
  128. package/dist/commands/packs/remove-instruction.js +1 -35
  129. package/dist/commands/proxy/env.js +3 -131
  130. package/dist/commands/proxy/logs.js +3 -85
  131. package/dist/commands/proxy/restart.js +1 -35
  132. package/dist/commands/proxy/setup.js +15 -454
  133. package/dist/commands/proxy/start.js +10 -333
  134. package/dist/commands/proxy/status.js +1 -78
  135. package/dist/commands/proxy/stop.js +1 -94
  136. package/dist/commands/research/backfill.js +1 -59
  137. package/dist/commands/research/tail-transcript.js +1 -70
  138. package/dist/commands/service/install.js +57 -796
  139. package/dist/commands/service/status.js +1 -180
  140. package/dist/commands/service/uninstall.js +1 -119
  141. package/dist/commands/sessions/analyze.js +3 -48
  142. package/dist/commands/sessions/end.js +2 -85
  143. package/dist/commands/sessions/import.js +1 -46
  144. package/dist/commands/sessions/list.js +1 -48
  145. package/dist/commands/sessions/start.js +3 -90
  146. package/dist/commands/setup.js +3 -150
  147. package/dist/commands/skills/export-approved.js +1 -46
  148. package/dist/commands/skills/install.js +4 -107
  149. package/dist/commands/skills/list.js +4 -65
  150. package/dist/commands/skills/publish.js +2 -98
  151. package/dist/commands/skills/search.js +3 -72
  152. package/dist/commands/skills/update.js +3 -55
  153. package/dist/commands/suggestions/accept.js +8 -84
  154. package/dist/commands/suggestions/dismiss.js +1 -45
  155. package/dist/commands/suggestions/list.js +1 -61
  156. package/dist/commands/suggestions/refresh.js +1 -27
  157. package/dist/cursor-T7AMCMKS.js +13 -0
  158. package/dist/dashboard/Dashboard.js +1 -243
  159. package/dist/dashboard/data.js +1 -15
  160. package/dist/dashboard/launcher/ActiveJobsList.js +1 -10
  161. package/dist/dashboard/launcher/LauncherOverlay.js +1 -16
  162. package/dist/dashboard/launcher/NewLaunchForm.js +1 -10
  163. package/dist/dashboard/launcher/api.js +1 -16
  164. package/dist/dashboard/launcher/tool-labels.js +1 -10
  165. package/dist/dashboard/launcher/types.js +0 -1
  166. package/dist/dashboard/launcher/useLaunchJobs.js +1 -11
  167. package/dist/dashboard/panels/friction.js +1 -10
  168. package/dist/dashboard/panels/insights.js +1 -10
  169. package/dist/dashboard/panels/instructions.js +1 -10
  170. package/dist/dashboard/panels/outcomes.js +1 -10
  171. package/dist/dashboard/panels/overview.js +1 -10
  172. package/dist/dashboard/panels/shared.js +1 -19
  173. package/dist/dashboard/types.js +1 -24
  174. package/dist/dist-FAVALJ5C.js +1 -0
  175. package/dist/index.js +1 -8
  176. package/dist/lib/active-org-refresh.js +1 -15
  177. package/dist/lib/active-org.js +1 -16
  178. package/dist/lib/agent-loop.js +1 -47
  179. package/dist/lib/antigravity-transcript.js +1 -22
  180. package/dist/lib/api-client.js +1 -23
  181. package/dist/lib/auth.js +1 -30
  182. package/dist/lib/capture-hosts.js +1 -8
  183. package/dist/lib/detect-languages.js +1 -8
  184. package/dist/lib/detect-tmux.js +1 -9
  185. package/dist/lib/diagnostics.js +1 -12
  186. package/dist/lib/editor-proxy-pins.js +1 -14
  187. package/dist/lib/ensure-api-key.js +1 -11
  188. package/dist/lib/eval-analyzer.js +1 -9
  189. package/dist/lib/eval-benchmark.js +1 -12
  190. package/dist/lib/eval-conversation-handler.js +1 -13
  191. package/dist/lib/eval-executor.js +1 -8
  192. package/dist/lib/eval-grader.js +1 -9
  193. package/dist/lib/eval-meta-judge.js +1 -9
  194. package/dist/lib/eval-trigger-tester.js +1 -11
  195. package/dist/lib/eval-worktree.js +1 -8
  196. package/dist/lib/gateway-entry.js +1 -61
  197. package/dist/lib/gateway-identity.js +1 -16
  198. package/dist/lib/gateway-lifecycle.js +1 -32
  199. package/dist/lib/gateway.js +1 -14
  200. package/dist/lib/handlers/cron-refresh-pricing.js +1 -0
  201. package/dist/lib/handlers/cron-refresh-skills.js +1 -8
  202. package/dist/lib/handlers/cron-suggest-instructions.js +1 -16
  203. package/dist/lib/handlers/process-announcement.js +1 -11
  204. package/dist/lib/handlers/process-changelog.js +1 -11
  205. package/dist/lib/handlers/process-conversation.js +1 -14
  206. package/dist/lib/handlers/process-eval.js +1 -15
  207. package/dist/lib/handlers/process-insights.js +1 -15
  208. package/dist/lib/handlers/process-launch.js +1 -16
  209. package/dist/lib/handlers/process-run-cleanup.js +1 -13
  210. package/dist/lib/handlers/process-send-message.js +1 -10
  211. package/dist/lib/handlers/process-session-goal.js +1 -12
  212. package/dist/lib/hooks-config.js +1 -81
  213. package/dist/lib/insights-prompts.js +1 -12
  214. package/dist/lib/instruction-snapshot.js +1 -8
  215. package/dist/lib/job-helpers.js +0 -1
  216. package/dist/lib/llm-client.js +1 -20
  217. package/dist/lib/manual-tasks-meta.js +1 -8
  218. package/dist/lib/manual-tasks.js +1 -80
  219. package/dist/lib/output.js +1 -12
  220. package/dist/lib/permanent-job-error.js +1 -10
  221. package/dist/lib/pid-identity.js +1 -14
  222. package/dist/lib/proxy-respawn.js +1 -12
  223. package/dist/lib/research-client.js +1 -12
  224. package/dist/lib/setup-steps.js +1 -33
  225. package/dist/lib/skills-loader.js +1 -8
  226. package/dist/lib/statusline-shim.js +1 -20
  227. package/dist/lib/telemetry.js +1 -16
  228. package/dist/lib/terminal-target-heartbeat.js +1 -15
  229. package/dist/lib/tmux.js +1 -16
  230. package/dist/lib/transcript-rate-limit-watcher.js +1 -22
  231. package/dist/lib/types.js +1 -8
  232. package/dist/lib/version-check.js +1 -12
  233. package/dist/lib/which.js +1 -8
  234. package/dist/lib/worktree.js +1 -17
  235. package/dist/opencode-QRJ3BH23.js +1 -0
  236. package/oclif.manifest.json +135 -135
  237. package/package.json +9 -8
  238. package/dist/base-command.js.map +0 -7
  239. package/dist/chunk-2HK7RGZB.js +0 -82
  240. package/dist/chunk-2HK7RGZB.js.map +0 -7
  241. package/dist/chunk-2ORJWTNZ.js +0 -307
  242. package/dist/chunk-2ORJWTNZ.js.map +0 -7
  243. package/dist/chunk-37LN5O7M.js +0 -59
  244. package/dist/chunk-37LN5O7M.js.map +0 -7
  245. package/dist/chunk-3S7223UR.js +0 -81
  246. package/dist/chunk-3S7223UR.js.map +0 -7
  247. package/dist/chunk-3TIMQ3O6.js +0 -96
  248. package/dist/chunk-3TIMQ3O6.js.map +0 -7
  249. package/dist/chunk-42GFSAJP.js +0 -32
  250. package/dist/chunk-42GFSAJP.js.map +0 -7
  251. package/dist/chunk-4BHDHHKL.js +0 -48
  252. package/dist/chunk-4BHDHHKL.js.map +0 -7
  253. package/dist/chunk-4D537GXE.js +0 -99
  254. package/dist/chunk-4D537GXE.js.map +0 -7
  255. package/dist/chunk-4LYCDS2N.js +0 -139
  256. package/dist/chunk-4LYCDS2N.js.map +0 -7
  257. package/dist/chunk-4SCZK7AL.js +0 -129
  258. package/dist/chunk-4SCZK7AL.js.map +0 -7
  259. package/dist/chunk-4XAWK6S2.js +0 -161
  260. package/dist/chunk-4XAWK6S2.js.map +0 -7
  261. package/dist/chunk-52WIYRZH.js +0 -73
  262. package/dist/chunk-52WIYRZH.js.map +0 -7
  263. package/dist/chunk-5BAOGNUH.js +0 -79
  264. package/dist/chunk-5BAOGNUH.js.map +0 -7
  265. package/dist/chunk-5EDMGK3W.js +0 -39
  266. package/dist/chunk-5EDMGK3W.js.map +0 -7
  267. package/dist/chunk-6NBS5XFS.js +0 -99
  268. package/dist/chunk-6NBS5XFS.js.map +0 -7
  269. package/dist/chunk-7LVVKQMZ.js +0 -98
  270. package/dist/chunk-7LVVKQMZ.js.map +0 -7
  271. package/dist/chunk-7NNFYWKK.js +0 -243
  272. package/dist/chunk-7NNFYWKK.js.map +0 -7
  273. package/dist/chunk-7NYKWN7U.js +0 -12
  274. package/dist/chunk-7NYKWN7U.js.map +0 -7
  275. package/dist/chunk-BO76WKJR.js +0 -42
  276. package/dist/chunk-BO76WKJR.js.map +0 -7
  277. package/dist/chunk-BRD5RUGM.js +0 -53
  278. package/dist/chunk-BRD5RUGM.js.map +0 -7
  279. package/dist/chunk-BT6Z6545.js +0 -43
  280. package/dist/chunk-BT6Z6545.js.map +0 -7
  281. package/dist/chunk-BZDKEQKU.js +0 -39
  282. package/dist/chunk-BZDKEQKU.js.map +0 -7
  283. package/dist/chunk-DGHWRQXL.js +0 -17
  284. package/dist/chunk-DGHWRQXL.js.map +0 -7
  285. package/dist/chunk-DIQUV5FR.js +0 -257
  286. package/dist/chunk-DIQUV5FR.js.map +0 -7
  287. package/dist/chunk-DMX5YOTM.js +0 -167
  288. package/dist/chunk-DMX5YOTM.js.map +0 -7
  289. package/dist/chunk-DNKSVWMD.js +0 -108
  290. package/dist/chunk-DNKSVWMD.js.map +0 -7
  291. package/dist/chunk-DQ3KELXD.js +0 -74
  292. package/dist/chunk-DQ3KELXD.js.map +0 -7
  293. package/dist/chunk-DUJSRBLP.js +0 -122
  294. package/dist/chunk-DUJSRBLP.js.map +0 -7
  295. package/dist/chunk-E3BIT53W.js +0 -154
  296. package/dist/chunk-E3BIT53W.js.map +0 -7
  297. package/dist/chunk-EARWG4EV.js +0 -22
  298. package/dist/chunk-EARWG4EV.js.map +0 -7
  299. package/dist/chunk-EI5BHWXA.js +0 -1662
  300. package/dist/chunk-EI5BHWXA.js.map +0 -7
  301. package/dist/chunk-EJ3YAFDP.js +0 -37
  302. package/dist/chunk-EJ3YAFDP.js.map +0 -7
  303. package/dist/chunk-EKJ2CABV.js +0 -76
  304. package/dist/chunk-EKJ2CABV.js.map +0 -7
  305. package/dist/chunk-EKP32DLN.js +0 -16
  306. package/dist/chunk-EKP32DLN.js.map +0 -7
  307. package/dist/chunk-EYPAAGN5.js +0 -51
  308. package/dist/chunk-EYPAAGN5.js.map +0 -7
  309. package/dist/chunk-F5N6CLJJ.js +0 -1995
  310. package/dist/chunk-F5N6CLJJ.js.map +0 -7
  311. package/dist/chunk-GIUBARWS.js +0 -99
  312. package/dist/chunk-GIUBARWS.js.map +0 -7
  313. package/dist/chunk-GQNJO2P2.js +0 -102
  314. package/dist/chunk-GQNJO2P2.js.map +0 -7
  315. package/dist/chunk-IJGF2ETG.js +0 -68
  316. package/dist/chunk-IJGF2ETG.js.map +0 -7
  317. package/dist/chunk-ILYDELUE.js +0 -46
  318. package/dist/chunk-ILYDELUE.js.map +0 -7
  319. package/dist/chunk-J6QFW4LD.js +0 -55
  320. package/dist/chunk-J6QFW4LD.js.map +0 -7
  321. package/dist/chunk-J7N3DLH6.js +0 -117
  322. package/dist/chunk-J7N3DLH6.js.map +0 -7
  323. package/dist/chunk-JFDWKLQC.js +0 -23
  324. package/dist/chunk-JFDWKLQC.js.map +0 -7
  325. package/dist/chunk-JULOLTZS.js +0 -61
  326. package/dist/chunk-JULOLTZS.js.map +0 -7
  327. package/dist/chunk-KJKBDQ4D.js +0 -220
  328. package/dist/chunk-KJKBDQ4D.js.map +0 -7
  329. package/dist/chunk-KRBQLMOP.js +0 -41
  330. package/dist/chunk-KRBQLMOP.js.map +0 -7
  331. package/dist/chunk-LXKPNATC.js +0 -624
  332. package/dist/chunk-LXKPNATC.js.map +0 -7
  333. package/dist/chunk-NSBPE2FW.js +0 -17
  334. package/dist/chunk-NSBPE2FW.js.map +0 -7
  335. package/dist/chunk-OCKHW72U.js +0 -55
  336. package/dist/chunk-OCKHW72U.js.map +0 -7
  337. package/dist/chunk-OKWCKCPE.js +0 -414
  338. package/dist/chunk-OKWCKCPE.js.map +0 -7
  339. package/dist/chunk-OO7JDFS4.js +0 -157
  340. package/dist/chunk-OO7JDFS4.js.map +0 -7
  341. package/dist/chunk-OQBBVTDG.js.map +0 -7
  342. package/dist/chunk-OQSQC7VB.js +0 -77
  343. package/dist/chunk-OQSQC7VB.js.map +0 -7
  344. package/dist/chunk-PED7L5GX.js +0 -92
  345. package/dist/chunk-PED7L5GX.js.map +0 -7
  346. package/dist/chunk-QJQS6TUN.js +0 -44
  347. package/dist/chunk-QJQS6TUN.js.map +0 -7
  348. package/dist/chunk-QN34TGD3.js +0 -83
  349. package/dist/chunk-QN34TGD3.js.map +0 -7
  350. package/dist/chunk-QSN77T7C.js +0 -250
  351. package/dist/chunk-QSN77T7C.js.map +0 -7
  352. package/dist/chunk-R56PH7YE.js +0 -78
  353. package/dist/chunk-R56PH7YE.js.map +0 -7
  354. package/dist/chunk-RAXRZYOB.js +0 -299
  355. package/dist/chunk-RAXRZYOB.js.map +0 -7
  356. package/dist/chunk-RH7NHVSK.js +0 -16
  357. package/dist/chunk-RH7NHVSK.js.map +0 -7
  358. package/dist/chunk-RMTT4KDY.js +0 -191
  359. package/dist/chunk-RMTT4KDY.js.map +0 -7
  360. package/dist/chunk-RQ2TMLKG.js +0 -142
  361. package/dist/chunk-RQ2TMLKG.js.map +0 -7
  362. package/dist/chunk-SO3T35U7.js +0 -80
  363. package/dist/chunk-SO3T35U7.js.map +0 -7
  364. package/dist/chunk-UKMLICWS.js +0 -51
  365. package/dist/chunk-UKMLICWS.js.map +0 -7
  366. package/dist/chunk-VA5FFOS7.js +0 -243
  367. package/dist/chunk-VA5FFOS7.js.map +0 -7
  368. package/dist/chunk-W2YERO7E.js +0 -170
  369. package/dist/chunk-W2YERO7E.js.map +0 -7
  370. package/dist/chunk-W53GKIZQ.js +0 -50
  371. package/dist/chunk-W53GKIZQ.js.map +0 -7
  372. package/dist/chunk-WA4MWYRW.js +0 -254
  373. package/dist/chunk-WA4MWYRW.js.map +0 -7
  374. package/dist/chunk-XC6M4CSW.js +0 -44
  375. package/dist/chunk-XC6M4CSW.js.map +0 -7
  376. package/dist/chunk-XK42ZBDE.js +0 -23
  377. package/dist/chunk-XK42ZBDE.js.map +0 -7
  378. package/dist/chunk-XUV6DDBF.js +0 -124
  379. package/dist/chunk-XUV6DDBF.js.map +0 -7
  380. package/dist/chunk-XZXS2W24.js.map +0 -7
  381. package/dist/chunk-Y3WD5CSW.js +0 -49
  382. package/dist/chunk-Y3WD5CSW.js.map +0 -7
  383. package/dist/chunk-Y4BJXXYV.js +0 -148
  384. package/dist/chunk-Y4BJXXYV.js.map +0 -7
  385. package/dist/chunk-YNIH3KMU.js +0 -121
  386. package/dist/chunk-YNIH3KMU.js.map +0 -7
  387. package/dist/chunk-ZUJBM6HE.js +0 -125
  388. package/dist/chunk-ZUJBM6HE.js.map +0 -7
  389. package/dist/commands/antigravity/backfill.js.map +0 -7
  390. package/dist/commands/auth/create-key.js.map +0 -7
  391. package/dist/commands/auth/login.js.map +0 -7
  392. package/dist/commands/auth/logout.js.map +0 -7
  393. package/dist/commands/auth/revoke-key.js.map +0 -7
  394. package/dist/commands/auth/signup.js.map +0 -7
  395. package/dist/commands/auth/status.js.map +0 -7
  396. package/dist/commands/catalog/index.js.map +0 -7
  397. package/dist/commands/catalog/recommend.js.map +0 -7
  398. package/dist/commands/convert.js.map +0 -7
  399. package/dist/commands/converters.js.map +0 -7
  400. package/dist/commands/crons/list.js.map +0 -7
  401. package/dist/commands/crons/run.js.map +0 -7
  402. package/dist/commands/dashboard.js.map +0 -7
  403. package/dist/commands/diagnostics.js.map +0 -7
  404. package/dist/commands/eval-targets/create.js.map +0 -7
  405. package/dist/commands/eval-targets/list.js.map +0 -7
  406. package/dist/commands/evals/agent.js.map +0 -7
  407. package/dist/commands/evals/benchmark.js.map +0 -7
  408. package/dist/commands/evals/compare.js.map +0 -7
  409. package/dist/commands/evals/create.js.map +0 -7
  410. package/dist/commands/evals/optimize-description.js.map +0 -7
  411. package/dist/commands/evals/optimize.js.map +0 -7
  412. package/dist/commands/evals/run.js.map +0 -7
  413. package/dist/commands/gateway/ensure.js.map +0 -7
  414. package/dist/commands/hooks/emit-instructions.js.map +0 -7
  415. package/dist/commands/hooks/install.js.map +0 -7
  416. package/dist/commands/hooks/run.js.map +0 -7
  417. package/dist/commands/hooks/uninstall.js.map +0 -7
  418. package/dist/commands/import.js.map +0 -7
  419. package/dist/commands/instructions/create.js.map +0 -7
  420. package/dist/commands/instructions/delete.js.map +0 -7
  421. package/dist/commands/instructions/fork.js.map +0 -7
  422. package/dist/commands/instructions/get.js.map +0 -7
  423. package/dist/commands/instructions/list.js.map +0 -7
  424. package/dist/commands/instructions/promote.js.map +0 -7
  425. package/dist/commands/instructions/pull.js.map +0 -7
  426. package/dist/commands/instructions/upstream.js.map +0 -7
  427. package/dist/commands/instructions/versions.js.map +0 -7
  428. package/dist/commands/launcher.js.map +0 -7
  429. package/dist/commands/org/current.js.map +0 -7
  430. package/dist/commands/org/list.js.map +0 -7
  431. package/dist/commands/org/switch.js.map +0 -7
  432. package/dist/commands/packs/add-instruction.js.map +0 -7
  433. package/dist/commands/packs/apply.js.map +0 -7
  434. package/dist/commands/packs/create.js.map +0 -7
  435. package/dist/commands/packs/fork.js.map +0 -7
  436. package/dist/commands/packs/get.js.map +0 -7
  437. package/dist/commands/packs/list.js.map +0 -7
  438. package/dist/commands/packs/remove-instruction.js.map +0 -7
  439. package/dist/commands/proxy/env.js.map +0 -7
  440. package/dist/commands/proxy/logs.js.map +0 -7
  441. package/dist/commands/proxy/restart.js.map +0 -7
  442. package/dist/commands/proxy/setup.js.map +0 -7
  443. package/dist/commands/proxy/start.js.map +0 -7
  444. package/dist/commands/proxy/status.js.map +0 -7
  445. package/dist/commands/proxy/stop.js.map +0 -7
  446. package/dist/commands/research/backfill.js.map +0 -7
  447. package/dist/commands/research/tail-transcript.js.map +0 -7
  448. package/dist/commands/service/install.js.map +0 -7
  449. package/dist/commands/service/status.js.map +0 -7
  450. package/dist/commands/service/uninstall.js.map +0 -7
  451. package/dist/commands/sessions/analyze.js.map +0 -7
  452. package/dist/commands/sessions/end.js.map +0 -7
  453. package/dist/commands/sessions/import.js.map +0 -7
  454. package/dist/commands/sessions/list.js.map +0 -7
  455. package/dist/commands/sessions/start.js.map +0 -7
  456. package/dist/commands/setup.js.map +0 -7
  457. package/dist/commands/skills/export-approved.js.map +0 -7
  458. package/dist/commands/skills/install.js.map +0 -7
  459. package/dist/commands/skills/list.js.map +0 -7
  460. package/dist/commands/skills/publish.js.map +0 -7
  461. package/dist/commands/skills/search.js.map +0 -7
  462. package/dist/commands/skills/update.js.map +0 -7
  463. package/dist/commands/suggestions/accept.js.map +0 -7
  464. package/dist/commands/suggestions/dismiss.js.map +0 -7
  465. package/dist/commands/suggestions/list.js.map +0 -7
  466. package/dist/commands/suggestions/refresh.js.map +0 -7
  467. package/dist/cursor-BGQJ4CWI.js +0 -134
  468. package/dist/cursor-BGQJ4CWI.js.map +0 -7
  469. package/dist/dashboard/Dashboard.js.map +0 -7
  470. package/dist/dashboard/data.js.map +0 -7
  471. package/dist/dashboard/launcher/ActiveJobsList.js.map +0 -7
  472. package/dist/dashboard/launcher/LauncherOverlay.js.map +0 -7
  473. package/dist/dashboard/launcher/NewLaunchForm.js.map +0 -7
  474. package/dist/dashboard/launcher/api.js.map +0 -7
  475. package/dist/dashboard/launcher/tool-labels.js.map +0 -7
  476. package/dist/dashboard/launcher/types.js.map +0 -7
  477. package/dist/dashboard/launcher/useLaunchJobs.js.map +0 -7
  478. package/dist/dashboard/panels/friction.js.map +0 -7
  479. package/dist/dashboard/panels/insights.js.map +0 -7
  480. package/dist/dashboard/panels/instructions.js.map +0 -7
  481. package/dist/dashboard/panels/outcomes.js.map +0 -7
  482. package/dist/dashboard/panels/overview.js.map +0 -7
  483. package/dist/dashboard/panels/shared.js.map +0 -7
  484. package/dist/dashboard/types.js.map +0 -7
  485. package/dist/dist-UNYP5PJR.js +0 -56
  486. package/dist/dist-UNYP5PJR.js.map +0 -7
  487. package/dist/index.js.map +0 -7
  488. package/dist/lib/active-org-refresh.js.map +0 -7
  489. package/dist/lib/active-org.js.map +0 -7
  490. package/dist/lib/agent-loop.js.map +0 -7
  491. package/dist/lib/antigravity-transcript.js.map +0 -7
  492. package/dist/lib/api-client.js.map +0 -7
  493. package/dist/lib/auth.js.map +0 -7
  494. package/dist/lib/capture-hosts.js.map +0 -7
  495. package/dist/lib/detect-languages.js.map +0 -7
  496. package/dist/lib/detect-tmux.js.map +0 -7
  497. package/dist/lib/diagnostics.js.map +0 -7
  498. package/dist/lib/editor-proxy-pins.js.map +0 -7
  499. package/dist/lib/ensure-api-key.js.map +0 -7
  500. package/dist/lib/eval-analyzer.js.map +0 -7
  501. package/dist/lib/eval-benchmark.js.map +0 -7
  502. package/dist/lib/eval-conversation-handler.js.map +0 -7
  503. package/dist/lib/eval-executor.js.map +0 -7
  504. package/dist/lib/eval-grader.js.map +0 -7
  505. package/dist/lib/eval-meta-judge.js.map +0 -7
  506. package/dist/lib/eval-trigger-tester.js.map +0 -7
  507. package/dist/lib/eval-worktree.js.map +0 -7
  508. package/dist/lib/gateway-entry.js.map +0 -7
  509. package/dist/lib/gateway-identity.js.map +0 -7
  510. package/dist/lib/gateway-lifecycle.js.map +0 -7
  511. package/dist/lib/gateway.js.map +0 -7
  512. package/dist/lib/handlers/cron-refresh-skills.js.map +0 -7
  513. package/dist/lib/handlers/cron-suggest-instructions.js.map +0 -7
  514. package/dist/lib/handlers/process-announcement.js.map +0 -7
  515. package/dist/lib/handlers/process-changelog.js.map +0 -7
  516. package/dist/lib/handlers/process-conversation.js.map +0 -7
  517. package/dist/lib/handlers/process-eval.js.map +0 -7
  518. package/dist/lib/handlers/process-insights.js.map +0 -7
  519. package/dist/lib/handlers/process-launch.js.map +0 -7
  520. package/dist/lib/handlers/process-run-cleanup.js.map +0 -7
  521. package/dist/lib/handlers/process-send-message.js.map +0 -7
  522. package/dist/lib/handlers/process-session-goal.js.map +0 -7
  523. package/dist/lib/hooks-config.js.map +0 -7
  524. package/dist/lib/insights-prompts.js.map +0 -7
  525. package/dist/lib/instruction-snapshot.js.map +0 -7
  526. package/dist/lib/job-helpers.js.map +0 -7
  527. package/dist/lib/llm-client.js.map +0 -7
  528. package/dist/lib/manual-tasks-meta.js.map +0 -7
  529. package/dist/lib/manual-tasks.js.map +0 -7
  530. package/dist/lib/output.js.map +0 -7
  531. package/dist/lib/permanent-job-error.js.map +0 -7
  532. package/dist/lib/pid-identity.js.map +0 -7
  533. package/dist/lib/proxy-respawn.js.map +0 -7
  534. package/dist/lib/research-client.js.map +0 -7
  535. package/dist/lib/setup-steps.js.map +0 -7
  536. package/dist/lib/skills-loader.js.map +0 -7
  537. package/dist/lib/statusline-shim.js.map +0 -7
  538. package/dist/lib/telemetry.js.map +0 -7
  539. package/dist/lib/terminal-target-heartbeat.js.map +0 -7
  540. package/dist/lib/tmux.js.map +0 -7
  541. package/dist/lib/transcript-rate-limit-watcher.js.map +0 -7
  542. package/dist/lib/types.js.map +0 -7
  543. package/dist/lib/version-check.js.map +0 -7
  544. package/dist/lib/which.js.map +0 -7
  545. package/dist/lib/worktree.js.map +0 -7
  546. package/dist/opencode-IQ7X5YMJ.js +0 -190
  547. package/dist/opencode-IQ7X5YMJ.js.map +0 -7
@@ -1,68 +0,0 @@
1
- import {
2
- formatCost,
3
- formatTokens
4
- } from "./chunk-DQ3KELXD.js";
5
- import {
6
- GOLD,
7
- ORANGE
8
- } from "./chunk-QJQS6TUN.js";
9
-
10
- // src/dashboard/panels/overview.tsx
11
- import { Box, Text } from "ink";
12
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
- function Overview({ local, api, label, width }) {
14
- const sessions = api?.total_sessions ?? local.totalSessions;
15
- const messages = api?.total_messages ?? 0;
16
- const inputTokens = api?.total_input_tokens ?? local.totalInputTokens;
17
- const outputTokens = api?.total_output_tokens ?? local.totalOutputTokens;
18
- const cacheRead = api?.total_cache_read_tokens ?? local.totalCacheReadTokens;
19
- const cacheWrite = api?.total_cache_write_tokens ?? local.totalCacheWriteTokens;
20
- const cost = api?.estimated_cost_usd ?? local.totalCostUSD;
21
- const daysActive = api?.days_active ?? 0;
22
- const commits = api?.git_commits ?? 0;
23
- const allInput = inputTokens + cacheRead + cacheWrite;
24
- const cacheHit = allInput > 0 ? cacheRead / allInput * 100 : 0;
25
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: ORANGE, paddingX: 1, width, children: [
26
- /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
27
- /* @__PURE__ */ jsx(Text, { bold: true, color: ORANGE, children: "RuleMetric" }),
28
- /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
29
- " ",
30
- label
31
- ] }),
32
- api && /* @__PURE__ */ jsx(Text, { color: "#5BF58C", children: " \u25CF API connected" }),
33
- !api && /* @__PURE__ */ jsx(Text, { color: "#F55B5B", children: " \u25CB API offline" })
34
- ] }),
35
- /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
36
- /* @__PURE__ */ jsx(Text, { bold: true, color: GOLD, children: formatCost(cost) }),
37
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: " cost " }),
38
- /* @__PURE__ */ jsx(Text, { bold: true, children: String(sessions) }),
39
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: " sessions " }),
40
- messages > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
41
- /* @__PURE__ */ jsx(Text, { bold: true, children: messages.toLocaleString() }),
42
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: " messages " })
43
- ] }),
44
- /* @__PURE__ */ jsxs(Text, { bold: true, children: [
45
- cacheHit.toFixed(1),
46
- "%"
47
- ] }),
48
- /* @__PURE__ */ jsx(Text, { dimColor: true, children: " cache hit" })
49
- ] }),
50
- /* @__PURE__ */ jsxs(Text, { dimColor: true, wrap: "truncate-end", children: [
51
- formatTokens(inputTokens),
52
- " in ",
53
- formatTokens(outputTokens),
54
- " out ",
55
- formatTokens(cacheRead),
56
- " cached ",
57
- formatTokens(cacheWrite),
58
- " written",
59
- daysActive > 0 ? ` ${daysActive} days active` : "",
60
- commits > 0 ? ` ${commits} commits` : ""
61
- ] })
62
- ] });
63
- }
64
-
65
- export {
66
- Overview
67
- };
68
- //# sourceMappingURL=chunk-IJGF2ETG.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/dashboard/panels/overview.tsx"],
4
- "sourcesContent": ["import React from 'react';\nimport { Box, Text } from 'ink';\nimport { ORANGE, GOLD } from '../types.js';\nimport type { LocalStats, ApiInsights } from '../types.js';\nimport { formatTokens, formatCost } from './shared.js';\n\nexport function Overview({ local, api, label, width }: {\n local: LocalStats; api: ApiInsights | null; label: string; width: number;\n}) {\n // Prefer API data when available (more complete), fall back to local\n const sessions = api?.total_sessions ?? local.totalSessions;\n const messages = api?.total_messages ?? 0;\n const inputTokens = api?.total_input_tokens ?? local.totalInputTokens;\n const outputTokens = api?.total_output_tokens ?? local.totalOutputTokens;\n const cacheRead = api?.total_cache_read_tokens ?? local.totalCacheReadTokens;\n const cacheWrite = api?.total_cache_write_tokens ?? local.totalCacheWriteTokens;\n const cost = api?.estimated_cost_usd ?? local.totalCostUSD;\n const daysActive = api?.days_active ?? 0;\n const commits = api?.git_commits ?? 0;\n\n const allInput = inputTokens + cacheRead + cacheWrite;\n const cacheHit = allInput > 0 ? (cacheRead / allInput) * 100 : 0;\n\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={ORANGE} paddingX={1} width={width}>\n <Text wrap=\"truncate-end\">\n <Text bold color={ORANGE}>RuleMetric</Text>\n <Text dimColor> {label}</Text>\n {api && <Text color=\"#5BF58C\"> \u25CF API connected</Text>}\n {!api && <Text color=\"#F55B5B\"> \u25CB API offline</Text>}\n </Text>\n <Text wrap=\"truncate-end\">\n <Text bold color={GOLD}>{formatCost(cost)}</Text>\n <Text dimColor> cost </Text>\n <Text bold>{String(sessions)}</Text>\n <Text dimColor> sessions </Text>\n {messages > 0 && <><Text bold>{messages.toLocaleString()}</Text><Text dimColor> messages </Text></>}\n <Text bold>{cacheHit.toFixed(1)}%</Text>\n <Text dimColor> cache hit</Text>\n </Text>\n <Text dimColor wrap=\"truncate-end\">\n {formatTokens(inputTokens)} in {formatTokens(outputTokens)} out {formatTokens(cacheRead)} cached {formatTokens(cacheWrite)} written\n {daysActive > 0 ? ` ${daysActive} days active` : ''}\n {commits > 0 ? ` ${commits} commits` : ''}\n </Text>\n </Box>\n );\n}\n"],
5
- "mappings": ";;;;;;;;;;AACA,SAAS,KAAK,YAAY;AAyBlB,SAUiB,UAVjB,KACA,YADA;AApBD,SAAS,SAAS,EAAE,OAAO,KAAK,OAAO,MAAM,GAEjD;AAED,QAAM,WAAW,KAAK,kBAAkB,MAAM;AAC9C,QAAM,WAAW,KAAK,kBAAkB;AACxC,QAAM,cAAc,KAAK,sBAAsB,MAAM;AACrD,QAAM,eAAe,KAAK,uBAAuB,MAAM;AACvD,QAAM,YAAY,KAAK,2BAA2B,MAAM;AACxD,QAAM,aAAa,KAAK,4BAA4B,MAAM;AAC1D,QAAM,OAAO,KAAK,sBAAsB,MAAM;AAC9C,QAAM,aAAa,KAAK,eAAe;AACvC,QAAM,UAAU,KAAK,eAAe;AAEpC,QAAM,WAAW,cAAc,YAAY;AAC3C,QAAM,WAAW,WAAW,IAAK,YAAY,WAAY,MAAM;AAE/D,SACE,qBAAC,OAAI,eAAc,UAAS,aAAY,SAAQ,aAAa,QAAQ,UAAU,GAAG,OAChF;AAAA,yBAAC,QAAK,MAAK,gBACT;AAAA,0BAAC,QAAK,MAAI,MAAC,OAAO,QAAQ,wBAAU;AAAA,MACpC,qBAAC,QAAK,UAAQ,MAAC;AAAA;AAAA,QAAG;AAAA,SAAM;AAAA,MACvB,OAAO,oBAAC,QAAK,OAAM,WAAU,oCAAiB;AAAA,MAC9C,CAAC,OAAO,oBAAC,QAAK,OAAM,WAAU,kCAAe;AAAA,OAChD;AAAA,IACA,qBAAC,QAAK,MAAK,gBACT;AAAA,0BAAC,QAAK,MAAI,MAAC,OAAO,MAAO,qBAAW,IAAI,GAAE;AAAA,MAC1C,oBAAC,QAAK,UAAQ,MAAC,sBAAQ;AAAA,MACvB,oBAAC,QAAK,MAAI,MAAE,iBAAO,QAAQ,GAAE;AAAA,MAC7B,oBAAC,QAAK,UAAQ,MAAC,0BAAY;AAAA,MAC1B,WAAW,KAAK,iCAAE;AAAA,4BAAC,QAAK,MAAI,MAAE,mBAAS,eAAe,GAAE;AAAA,QAAO,oBAAC,QAAK,UAAQ,MAAC,0BAAY;AAAA,SAAO;AAAA,MAClG,qBAAC,QAAK,MAAI,MAAE;AAAA,iBAAS,QAAQ,CAAC;AAAA,QAAE;AAAA,SAAC;AAAA,MACjC,oBAAC,QAAK,UAAQ,MAAC,wBAAU;AAAA,OAC3B;AAAA,IACA,qBAAC,QAAK,UAAQ,MAAC,MAAK,gBACjB;AAAA,mBAAa,WAAW;AAAA,MAAE;AAAA,MAAO,aAAa,YAAY;AAAA,MAAE;AAAA,MAAQ,aAAa,SAAS;AAAA,MAAE;AAAA,MAAW,aAAa,UAAU;AAAA,MAAE;AAAA,MAChI,aAAa,IAAI,MAAM,UAAU,iBAAiB;AAAA,MAClD,UAAU,IAAI,MAAM,OAAO,aAAa;AAAA,OAC3C;AAAA,KACF;AAEJ;",
6
- "names": []
7
- }
@@ -1,46 +0,0 @@
1
- // src/lib/proxy-respawn.ts
2
- var DEAD_CHECKS_BEFORE_RESPAWN = 5;
3
- var RESPAWN_COOLDOWN_MS = 10 * 6e4;
4
- var MitmproxyRespawnMonitor = class {
5
- constructor(deps) {
6
- this.deps = deps;
7
- }
8
- deadStreak = 0;
9
- lastAttemptAt = Number.NEGATIVE_INFINITY;
10
- skipLoggedThisStreak = false;
11
- /** Feed one health-check result (true = mitmproxy answered). */
12
- onHealthCheck(alive) {
13
- if (alive) {
14
- this.deadStreak = 0;
15
- this.skipLoggedThisStreak = false;
16
- return;
17
- }
18
- this.deadStreak++;
19
- if (this.deadStreak < DEAD_CHECKS_BEFORE_RESPAWN) return;
20
- const now = (this.deps.now ?? Date.now)();
21
- if (now - this.lastAttemptAt < RESPAWN_COOLDOWN_MS) return;
22
- if (!this.deps.hasCrashEvidence()) {
23
- if (!this.skipLoggedThisStreak) {
24
- this.skipLoggedThisStreak = true;
25
- this.deps.log(
26
- "mitmproxy is down with no crash evidence (no local proxy.pid) \u2014 not auto-restarting (deliberate `proxy stop` or Docker-managed)"
27
- );
28
- }
29
- return;
30
- }
31
- this.lastAttemptAt = now;
32
- this.deps.log(
33
- `mitmproxy dead for ${this.deadStreak} consecutive checks \u2014 attempting auto-restart (at most once per ${Math.round(RESPAWN_COOLDOWN_MS / 6e4)}min)`
34
- );
35
- if (!this.deps.respawn()) {
36
- this.deps.log("auto-restart unavailable \u2014 run `rulemetric proxy start` to restore deep capture");
37
- }
38
- }
39
- };
40
-
41
- export {
42
- DEAD_CHECKS_BEFORE_RESPAWN,
43
- RESPAWN_COOLDOWN_MS,
44
- MitmproxyRespawnMonitor
45
- };
46
- //# sourceMappingURL=chunk-ILYDELUE.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/lib/proxy-respawn.ts"],
4
- "sourcesContent": ["/**\n * Conservative mitmproxy auto-restart, driven by the gateway's 3s health\n * checks. A mid-session mitmproxy crash otherwise stays silent \u2014 the gateway\n * routes direct by design, so deep capture is simply gone until the next\n * session's session-start hook runs.\n *\n * Guard rails (this must never become a restart loop, and must never fight a\n * deliberate `proxy stop`):\n * - respawn fires only after DEAD_CHECKS_BEFORE_RESPAWN consecutive dead\n * checks (a transient blip never triggers it);\n * - at most one attempt per RESPAWN_COOLDOWN_MS window (in-memory \u2014 a\n * gateway restart resets the window, which is fine: it also resets the\n * dead-streak requirement);\n * - only with crash evidence: a live proxy.pid file. `proxy stop` removes\n * the PID file, so a deliberate stop is never overridden. Docker-managed\n * proxies (pidfile `docker:<name>`) are Docker's to restart.\n *\n * Pure state machine \u2014 time, crash evidence, and the spawn are injected so\n * the transition logic is unit-testable without timers or processes.\n */\n\n/** ~15s of confirmed downtime at the gateway's 3s health cadence. */\nexport const DEAD_CHECKS_BEFORE_RESPAWN = 5;\nexport const RESPAWN_COOLDOWN_MS = 10 * 60_000;\n\nexport interface RespawnMonitorDeps {\n /** Clock override. Used in tests. */\n now?: () => number;\n /** Whether the local proxy.pid file evidences a crash (vs a deliberate stop). */\n hasCrashEvidence: () => boolean;\n /** Fire one detached respawn attempt. Returns false if respawn is unavailable. */\n respawn: () => boolean;\n log: (msg: string) => void;\n}\n\nexport class MitmproxyRespawnMonitor {\n private deadStreak = 0;\n private lastAttemptAt = Number.NEGATIVE_INFINITY;\n private skipLoggedThisStreak = false;\n\n constructor(private readonly deps: RespawnMonitorDeps) {}\n\n /** Feed one health-check result (true = mitmproxy answered). */\n onHealthCheck(alive: boolean): void {\n if (alive) {\n this.deadStreak = 0;\n this.skipLoggedThisStreak = false;\n return;\n }\n\n this.deadStreak++;\n if (this.deadStreak < DEAD_CHECKS_BEFORE_RESPAWN) return;\n\n const now = (this.deps.now ?? Date.now)();\n if (now - this.lastAttemptAt < RESPAWN_COOLDOWN_MS) return;\n\n if (!this.deps.hasCrashEvidence()) {\n if (!this.skipLoggedThisStreak) {\n this.skipLoggedThisStreak = true;\n this.deps.log(\n 'mitmproxy is down with no crash evidence (no local proxy.pid) \u2014 ' +\n 'not auto-restarting (deliberate `proxy stop` or Docker-managed)',\n );\n }\n return;\n }\n\n this.lastAttemptAt = now;\n this.deps.log(\n `mitmproxy dead for ${this.deadStreak} consecutive checks \u2014 attempting auto-restart ` +\n `(at most once per ${Math.round(RESPAWN_COOLDOWN_MS / 60_000)}min)`,\n );\n if (!this.deps.respawn()) {\n this.deps.log('auto-restart unavailable \u2014 run `rulemetric proxy start` to restore deep capture');\n }\n }\n}\n"],
5
- "mappings": ";AAsBO,IAAM,6BAA6B;AACnC,IAAM,sBAAsB,KAAK;AAYjC,IAAM,0BAAN,MAA8B;AAAA,EAKnC,YAA6B,MAA0B;AAA1B;AAAA,EAA2B;AAAA,EAJhD,aAAa;AAAA,EACb,gBAAgB,OAAO;AAAA,EACvB,uBAAuB;AAAA;AAAA,EAK/B,cAAc,OAAsB;AAClC,QAAI,OAAO;AACT,WAAK,aAAa;AAClB,WAAK,uBAAuB;AAC5B;AAAA,IACF;AAEA,SAAK;AACL,QAAI,KAAK,aAAa,2BAA4B;AAElD,UAAM,OAAO,KAAK,KAAK,OAAO,KAAK,KAAK;AACxC,QAAI,MAAM,KAAK,gBAAgB,oBAAqB;AAEpD,QAAI,CAAC,KAAK,KAAK,iBAAiB,GAAG;AACjC,UAAI,CAAC,KAAK,sBAAsB;AAC9B,aAAK,uBAAuB;AAC5B,aAAK,KAAK;AAAA,UACR;AAAA,QAEF;AAAA,MACF;AACA;AAAA,IACF;AAEA,SAAK,gBAAgB;AACrB,SAAK,KAAK;AAAA,MACR,sBAAsB,KAAK,UAAU,wEACd,KAAK,MAAM,sBAAsB,GAAM,CAAC;AAAA,IACjE;AACA,QAAI,CAAC,KAAK,KAAK,QAAQ,GAAG;AACxB,WAAK,KAAK,IAAI,sFAAiF;AAAA,IACjG;AAAA,EACF;AACF;",
6
- "names": []
7
- }
@@ -1,55 +0,0 @@
1
- // src/lib/diagnostics.ts
2
- function parseNodeMajorMinor(v) {
3
- const m = /^v?(\d+)\.(\d+)/.exec(v.trim());
4
- if (!m) return { major: 0, minor: 0 };
5
- return { major: Number(m[1]), minor: Number(m[2]) };
6
- }
7
- function isProxyBreakingNode(v) {
8
- const { major, minor } = parseNodeMajorMinor(v);
9
- if (major === 0) return false;
10
- return major < 20 || major === 20 && minor < 11;
11
- }
12
- function diagnose(input) {
13
- const oldNode = isProxyBreakingNode(input.nodeVersion);
14
- if (!input.directApiOk) {
15
- return {
16
- severity: "fail",
17
- headline: "Can't reach the API directly (proxy bypassed).",
18
- hints: [
19
- "Check your network/DNS/firewall and that you can reach https://rulemetric.com/health.",
20
- "If a corporate proxy is required, it must allow rulemetric.com."
21
- ]
22
- };
23
- }
24
- if (input.httpsProxySet && input.proxyPathOk === false) {
25
- const hints = [
26
- "Direct reachability works but requests through your local proxy fail \u2014 your gateway/mitmproxy is the problem, NOT the API.",
27
- input.gatewayAlive ? "Gateway (:8787) is up but not routing successfully." : "Gateway (:8787) is NOT listening \u2014 Claude Code/CLI traffic pointed at it will 502. Run `rulemetric hooks install` to restore it.",
28
- input.mitmproxyAlive ? void 0 : "mitmproxy (:8788) is down \u2014 the gateway should route direct, so a 502 here points at the gateway itself.",
29
- oldNode ? `Node ${input.nodeVersion} is < 20.11, which breaks the bundled proxy \u2014 upgrade Node to \u2265 20.11, or reinstall hooks with --no-proxy.` : void 0,
30
- "Quick unblock: `rulemetric hooks install --no-proxy` (captures via hooks, no proxy), or `rulemetric proxy restart`."
31
- ].filter((h) => Boolean(h));
32
- return { severity: "fail", headline: "Your local proxy/gateway can't reach the API \u2014 this is the 502.", hints };
33
- }
34
- if (input.httpsProxySet && oldNode) {
35
- return {
36
- severity: "warn",
37
- headline: `Node ${input.nodeVersion} is < 20.11 with a proxy configured \u2014 the proxy is likely dead.`,
38
- hints: [
39
- "Upgrade Node to \u2265 20.11 (older Node breaks the bundled proxy), or run `rulemetric hooks install --no-proxy`."
40
- ]
41
- };
42
- }
43
- return {
44
- severity: "ok",
45
- headline: "Healthy \u2014 the API is reachable" + (input.httpsProxySet ? " directly and through your proxy." : " (no proxy configured)."),
46
- hints: []
47
- };
48
- }
49
-
50
- export {
51
- parseNodeMajorMinor,
52
- isProxyBreakingNode,
53
- diagnose
54
- };
55
- //# sourceMappingURL=chunk-J6QFW4LD.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/lib/diagnostics.ts"],
4
- "sourcesContent": ["// Pure diagnosis logic for `rulemetric diagnostics` \u2014 kept out of the command so\n// the decision-making (which is the valuable, bug-prone part) is unit-testable\n// without spawning curl or opening sockets. The command does the probing and\n// feeds the raw booleans here.\n\nexport interface DiagnoseInput {\n /** e.g. \"22.17.1\" or \"v22.17.1\" */\n nodeVersion: string;\n /** GET /health succeeded DIRECT (proxy bypassed). */\n directApiOk: boolean;\n /** HTTPS_PROXY is configured in the environment / settings. */\n httpsProxySet: boolean;\n /** The local gateway (:8787) is listening. */\n gatewayAlive: boolean;\n /** mitmproxy (:8788) is listening. */\n mitmproxyAlive: boolean;\n /** GET /health succeeded THROUGH the configured proxy. null when no proxy is set. */\n proxyPathOk: boolean | null;\n}\n\nexport interface Diagnosis {\n severity: 'ok' | 'warn' | 'fail';\n headline: string;\n hints: string[];\n}\n\n/** Parse major/minor from \"22.17.1\" or \"v22.17.1\". Unknown \u2192 {0,0}. */\nexport function parseNodeMajorMinor(v: string): { major: number; minor: number } {\n const m = /^v?(\\d+)\\.(\\d+)/.exec(v.trim());\n if (!m) return { major: 0, minor: 0 };\n return { major: Number(m[1]), minor: Number(m[2]) };\n}\n\n/**\n * Node < 20.11 breaks the bundled proxy (it relies on a module-path API that is\n * undefined on older Node; see the 2026-07-07 field finding). Below 20.11 the\n * proxy is likely dead even\n * though HTTPS_PROXY is set \u2014 a prime cause of a client-side \"502 Bad Gateway\".\n */\nexport function isProxyBreakingNode(v: string): boolean {\n const { major, minor } = parseNodeMajorMinor(v);\n if (major === 0) return false; // couldn't parse \u2014 don't cry wolf\n return major < 20 || (major === 20 && minor < 11);\n}\n\n/**\n * Turn the raw probe results into a single actionable diagnosis. The headline\n * case this exists for: DIRECT reachability works but the PROXY path fails \u2192\n * the user's own local gateway is eating requests and returning 502, even though\n * production is perfectly healthy.\n */\nexport function diagnose(input: DiagnoseInput): Diagnosis {\n const oldNode = isProxyBreakingNode(input.nodeVersion);\n\n // 1. Can't even reach the API directly \u2192 not a proxy problem; network/DNS/down.\n if (!input.directApiOk) {\n return {\n severity: 'fail',\n headline: \"Can't reach the API directly (proxy bypassed).\",\n hints: [\n 'Check your network/DNS/firewall and that you can reach https://rulemetric.com/health.',\n 'If a corporate proxy is required, it must allow rulemetric.com.',\n ],\n };\n }\n\n // 2. Direct works but the PROXY path fails \u2192 the local gateway is the culprit.\n // This is the client-side \"502 Bad Gateway\" class.\n if (input.httpsProxySet && input.proxyPathOk === false) {\n const hints = [\n 'Direct reachability works but requests through your local proxy fail \u2014 your gateway/mitmproxy is the problem, NOT the API.',\n input.gatewayAlive\n ? 'Gateway (:8787) is up but not routing successfully.'\n : 'Gateway (:8787) is NOT listening \u2014 Claude Code/CLI traffic pointed at it will 502. Run `rulemetric hooks install` to restore it.',\n input.mitmproxyAlive ? undefined : 'mitmproxy (:8788) is down \u2014 the gateway should route direct, so a 502 here points at the gateway itself.',\n oldNode\n ? `Node ${input.nodeVersion} is < 20.11, which breaks the bundled proxy \u2014 upgrade Node to \u2265 20.11, or reinstall hooks with --no-proxy.`\n : undefined,\n 'Quick unblock: `rulemetric hooks install --no-proxy` (captures via hooks, no proxy), or `rulemetric proxy restart`.',\n ].filter((h): h is string => Boolean(h));\n return { severity: 'fail', headline: 'Your local proxy/gateway can\\'t reach the API \u2014 this is the 502.', hints };\n }\n\n // 3. Old Node + proxy configured but we couldn't positively confirm the proxy\n // path (e.g. curl unavailable) \u2192 warn, since the proxy is likely dead.\n if (input.httpsProxySet && oldNode) {\n return {\n severity: 'warn',\n headline: `Node ${input.nodeVersion} is < 20.11 with a proxy configured \u2014 the proxy is likely dead.`,\n hints: [\n 'Upgrade Node to \u2265 20.11 (older Node breaks the bundled proxy), or run `rulemetric hooks install --no-proxy`.',\n ],\n };\n }\n\n // 4. Everything reachable.\n return {\n severity: 'ok',\n headline: 'Healthy \u2014 the API is reachable' + (input.httpsProxySet ? ' directly and through your proxy.' : ' (no proxy configured).'),\n hints: [],\n };\n}\n"],
5
- "mappings": ";AA2BO,SAAS,oBAAoB,GAA6C;AAC/E,QAAM,IAAI,kBAAkB,KAAK,EAAE,KAAK,CAAC;AACzC,MAAI,CAAC,EAAG,QAAO,EAAE,OAAO,GAAG,OAAO,EAAE;AACpC,SAAO,EAAE,OAAO,OAAO,EAAE,CAAC,CAAC,GAAG,OAAO,OAAO,EAAE,CAAC,CAAC,EAAE;AACpD;AAQO,SAAS,oBAAoB,GAAoB;AACtD,QAAM,EAAE,OAAO,MAAM,IAAI,oBAAoB,CAAC;AAC9C,MAAI,UAAU,EAAG,QAAO;AACxB,SAAO,QAAQ,MAAO,UAAU,MAAM,QAAQ;AAChD;AAQO,SAAS,SAAS,OAAiC;AACxD,QAAM,UAAU,oBAAoB,MAAM,WAAW;AAGrD,MAAI,CAAC,MAAM,aAAa;AACtB,WAAO;AAAA,MACL,UAAU;AAAA,MACV,UAAU;AAAA,MACV,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAIA,MAAI,MAAM,iBAAiB,MAAM,gBAAgB,OAAO;AACtD,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA,MAAM,eACF,wDACA;AAAA,MACJ,MAAM,iBAAiB,SAAY;AAAA,MACnC,UACI,QAAQ,MAAM,WAAW,yHACzB;AAAA,MACJ;AAAA,IACF,EAAE,OAAO,CAAC,MAAmB,QAAQ,CAAC,CAAC;AACvC,WAAO,EAAE,UAAU,QAAQ,UAAU,wEAAoE,MAAM;AAAA,EACjH;AAIA,MAAI,MAAM,iBAAiB,SAAS;AAClC,WAAO;AAAA,MACL,UAAU;AAAA,MACV,UAAU,QAAQ,MAAM,WAAW;AAAA,MACnC,OAAO;AAAA,QACL;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,SAAO;AAAA,IACL,UAAU;AAAA,IACV,UAAU,yCAAoC,MAAM,gBAAgB,sCAAsC;AAAA,IAC1G,OAAO,CAAC;AAAA,EACV;AACF;",
6
- "names": []
7
- }
@@ -1,117 +0,0 @@
1
- import {
2
- executeEval
3
- } from "./chunk-QN34TGD3.js";
4
-
5
- // src/lib/eval-meta-judge.ts
6
- var META_JUDGE_SYSTEM_PROMPT = `You are a meta-judge evaluating the quality of an eval run \u2014 not the code output, but whether the test cases and grading themselves are rigorous and meaningful.
7
-
8
- You will receive a summary of eval cases, their expectations, and grading results.
9
-
10
- Analyze for these quality issues:
11
-
12
- 1. **Weak expectations** \u2014 Expectations that are vague ("should follow conventions") or trivially satisfiable. Good expectations are specific and falsifiable.
13
-
14
- 2. **Inconsistent grading** \u2014 Cases where similar expectations get different pass/fail results, or where evidence doesn't match the verdict.
15
-
16
- 3. **Trivial tests** \u2014 Cases where the prompt doesn't actually challenge the rule. E.g., testing "NEVER use mocks" with a prompt that doesn't involve testing at all.
17
-
18
- 4. **Untestable expectations** \u2014 Expectations that can't be verified from the output alone (e.g., "the developer should feel confident").
19
-
20
- 5. **Suspicious 100% pass** \u2014 If every expectation passes, consider whether the tests were actually challenging enough.
21
-
22
- Respond in JSON:
23
- {
24
- "quality_score": <1-5>,
25
- "issues": [
26
- {
27
- "type": "weak_expectation | inconsistent_grading | trivial_test | untestable_expectation | all_pass_suspicious",
28
- "severity": "low | medium | high",
29
- "description": "<specific issue>",
30
- "affected_eval": "<eval name if applicable>"
31
- }
32
- ],
33
- "recommendations": ["<specific improvement suggestion>", ...],
34
- "summary": "<1-2 sentence overall assessment>"
35
- }
36
-
37
- Be constructive but honest. A quality_score of 3 means acceptable, 4 means good, 5 means rigorous. Most real-world eval runs score 2-4.`;
38
- async function judgeEvalQuality(input) {
39
- const evalSummary = input.evalResults.map((r) => {
40
- const gradingInfo = r.grading ? {
41
- pass_rate: r.grading.summary.pass_rate,
42
- expectations: r.grading.expectations.map((e) => ({
43
- text: e.text,
44
- passed: e.passed,
45
- evidence: e.evidence.slice(0, 200)
46
- })),
47
- feedback: r.grading.eval_feedback?.overall ?? ""
48
- } : null;
49
- return {
50
- eval_name: r.evalName,
51
- prompt: r.prompt.slice(0, 500),
52
- expectations: r.expectations,
53
- grading: gradingInfo,
54
- output_preview: r.output?.slice(0, 300) ?? "(not available)"
55
- };
56
- });
57
- const prompt = `Evaluate the quality of this eval run for target "${input.targetName}":
58
-
59
- ${JSON.stringify(evalSummary, null, 2)}`;
60
- const result = await executeEval({
61
- prompt,
62
- systemPrompt: META_JUDGE_SYSTEM_PROMPT,
63
- timeout: input.timeout ?? 6e4,
64
- model: input.model
65
- });
66
- if (result.error || !result.output) {
67
- return {
68
- quality_score: 0,
69
- issues: [{
70
- type: "inconsistent_grading",
71
- severity: "high",
72
- description: `Meta-judge failed: ${result.error ?? "no output"}`
73
- }],
74
- recommendations: ["Meta-judge could not complete \u2014 check model availability"],
75
- summary: "Meta-judge execution failed."
76
- };
77
- }
78
- try {
79
- const parsed = parseJsonFromOutput(result.output);
80
- const issues = Array.isArray(parsed.issues) ? parsed.issues : [];
81
- const recs = Array.isArray(parsed.recommendations) ? parsed.recommendations : [];
82
- return {
83
- quality_score: Math.max(1, Math.min(5, Number(parsed.quality_score) || 3)),
84
- issues: issues.map((i) => ({
85
- type: i.type ?? "weak_expectation",
86
- severity: i.severity ?? "medium",
87
- description: String(i.description ?? ""),
88
- affected_eval: i.affected_eval ? String(i.affected_eval) : void 0
89
- })),
90
- recommendations: recs,
91
- summary: String(parsed.summary ?? "No summary provided.")
92
- };
93
- } catch {
94
- return {
95
- quality_score: 3,
96
- issues: [],
97
- recommendations: [],
98
- summary: "Meta-judge returned unparseable output \u2014 defaulting to neutral score."
99
- };
100
- }
101
- }
102
- function parseJsonFromOutput(output) {
103
- try {
104
- return JSON.parse(output);
105
- } catch {
106
- const match = output.match(/```(?:json)?\s*\n?([\s\S]*?)\n?```/);
107
- if (match) {
108
- return JSON.parse(match[1]);
109
- }
110
- throw new Error("No JSON found in output");
111
- }
112
- }
113
-
114
- export {
115
- judgeEvalQuality
116
- };
117
- //# sourceMappingURL=chunk-J7N3DLH6.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/lib/eval-meta-judge.ts"],
4
- "sourcesContent": ["import { executeEval } from './eval-executor.js';\nimport type { GradingResult } from './eval-grader.js';\n\nexport interface MetaJudgement {\n quality_score: number; // 1-5 overall quality of the eval run\n issues: MetaIssue[];\n recommendations: string[];\n summary: string;\n}\n\nexport interface MetaIssue {\n type: 'weak_expectation' | 'inconsistent_grading' | 'trivial_test' | 'untestable_expectation' | 'all_pass_suspicious';\n severity: 'low' | 'medium' | 'high';\n description: string;\n affected_eval?: string;\n}\n\nconst META_JUDGE_SYSTEM_PROMPT = `You are a meta-judge evaluating the quality of an eval run \u2014 not the code output, but whether the test cases and grading themselves are rigorous and meaningful.\n\nYou will receive a summary of eval cases, their expectations, and grading results.\n\nAnalyze for these quality issues:\n\n1. **Weak expectations** \u2014 Expectations that are vague (\"should follow conventions\") or trivially satisfiable. Good expectations are specific and falsifiable.\n\n2. **Inconsistent grading** \u2014 Cases where similar expectations get different pass/fail results, or where evidence doesn't match the verdict.\n\n3. **Trivial tests** \u2014 Cases where the prompt doesn't actually challenge the rule. E.g., testing \"NEVER use mocks\" with a prompt that doesn't involve testing at all.\n\n4. **Untestable expectations** \u2014 Expectations that can't be verified from the output alone (e.g., \"the developer should feel confident\").\n\n5. **Suspicious 100% pass** \u2014 If every expectation passes, consider whether the tests were actually challenging enough.\n\nRespond in JSON:\n{\n \"quality_score\": <1-5>,\n \"issues\": [\n {\n \"type\": \"weak_expectation | inconsistent_grading | trivial_test | untestable_expectation | all_pass_suspicious\",\n \"severity\": \"low | medium | high\",\n \"description\": \"<specific issue>\",\n \"affected_eval\": \"<eval name if applicable>\"\n }\n ],\n \"recommendations\": [\"<specific improvement suggestion>\", ...],\n \"summary\": \"<1-2 sentence overall assessment>\"\n}\n\nBe constructive but honest. A quality_score of 3 means acceptable, 4 means good, 5 means rigorous. Most real-world eval runs score 2-4.`;\n\ninterface MetaJudgeInput {\n targetName: string;\n evalResults: Array<{\n evalName: string;\n prompt: string;\n expectations: string[];\n grading: GradingResult | null;\n output?: string;\n }>;\n model?: string;\n timeout?: number;\n}\n\nexport async function judgeEvalQuality(input: MetaJudgeInput): Promise<MetaJudgement> {\n // Build a summary of the eval run for the meta-judge\n const evalSummary = input.evalResults.map((r) => {\n const gradingInfo = r.grading\n ? {\n pass_rate: r.grading.summary.pass_rate,\n expectations: r.grading.expectations.map((e) => ({\n text: e.text,\n passed: e.passed,\n evidence: e.evidence.slice(0, 200),\n })),\n feedback: r.grading.eval_feedback?.overall ?? '',\n }\n : null;\n\n return {\n eval_name: r.evalName,\n prompt: r.prompt.slice(0, 500),\n expectations: r.expectations,\n grading: gradingInfo,\n output_preview: r.output?.slice(0, 300) ?? '(not available)',\n };\n });\n\n const prompt = `Evaluate the quality of this eval run for target \"${input.targetName}\":\n\n${JSON.stringify(evalSummary, null, 2)}`;\n\n const result = await executeEval({\n prompt,\n systemPrompt: META_JUDGE_SYSTEM_PROMPT,\n timeout: input.timeout ?? 60000,\n model: input.model,\n });\n\n if (result.error || !result.output) {\n return {\n quality_score: 0,\n issues: [{\n type: 'inconsistent_grading',\n severity: 'high',\n description: `Meta-judge failed: ${result.error ?? 'no output'}`,\n }],\n recommendations: ['Meta-judge could not complete \u2014 check model availability'],\n summary: 'Meta-judge execution failed.',\n };\n }\n\n try {\n const parsed = parseJsonFromOutput(result.output);\n const issues = Array.isArray(parsed.issues) ? parsed.issues : [];\n const recs = Array.isArray(parsed.recommendations) ? parsed.recommendations as string[] : [];\n return {\n quality_score: Math.max(1, Math.min(5, Number(parsed.quality_score) || 3)),\n issues: issues.map((i: Record<string, string>) => ({\n type: (i.type ?? 'weak_expectation') as MetaIssue['type'],\n severity: (i.severity ?? 'medium') as MetaIssue['severity'],\n description: String(i.description ?? ''),\n affected_eval: i.affected_eval ? String(i.affected_eval) : undefined,\n })),\n recommendations: recs,\n summary: String(parsed.summary ?? 'No summary provided.'),\n };\n } catch {\n return {\n quality_score: 3,\n issues: [],\n recommendations: [],\n summary: 'Meta-judge returned unparseable output \u2014 defaulting to neutral score.',\n };\n }\n}\n\nfunction parseJsonFromOutput(output: string): Record<string, unknown> {\n // Try direct JSON parse\n try {\n return JSON.parse(output);\n } catch {\n // Try extracting from markdown code block\n const match = output.match(/```(?:json)?\\s*\\n?([\\s\\S]*?)\\n?```/);\n if (match) {\n return JSON.parse(match[1]);\n }\n throw new Error('No JSON found in output');\n }\n}\n"],
5
- "mappings": ";;;;;AAiBA,IAAM,2BAA2B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CjC,eAAsB,iBAAiB,OAA+C;AAEpF,QAAM,cAAc,MAAM,YAAY,IAAI,CAAC,MAAM;AAC/C,UAAM,cAAc,EAAE,UAClB;AAAA,MACE,WAAW,EAAE,QAAQ,QAAQ;AAAA,MAC7B,cAAc,EAAE,QAAQ,aAAa,IAAI,CAAC,OAAO;AAAA,QAC/C,MAAM,EAAE;AAAA,QACR,QAAQ,EAAE;AAAA,QACV,UAAU,EAAE,SAAS,MAAM,GAAG,GAAG;AAAA,MACnC,EAAE;AAAA,MACF,UAAU,EAAE,QAAQ,eAAe,WAAW;AAAA,IAChD,IACA;AAEJ,WAAO;AAAA,MACL,WAAW,EAAE;AAAA,MACb,QAAQ,EAAE,OAAO,MAAM,GAAG,GAAG;AAAA,MAC7B,cAAc,EAAE;AAAA,MAChB,SAAS;AAAA,MACT,gBAAgB,EAAE,QAAQ,MAAM,GAAG,GAAG,KAAK;AAAA,IAC7C;AAAA,EACF,CAAC;AAED,QAAM,SAAS,qDAAqD,MAAM,UAAU;AAAA;AAAA,EAEpF,KAAK,UAAU,aAAa,MAAM,CAAC,CAAC;AAEpC,QAAM,SAAS,MAAM,YAAY;AAAA,IAC/B;AAAA,IACA,cAAc;AAAA,IACd,SAAS,MAAM,WAAW;AAAA,IAC1B,OAAO,MAAM;AAAA,EACf,CAAC;AAED,MAAI,OAAO,SAAS,CAAC,OAAO,QAAQ;AAClC,WAAO;AAAA,MACL,eAAe;AAAA,MACf,QAAQ,CAAC;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,aAAa,sBAAsB,OAAO,SAAS,WAAW;AAAA,MAChE,CAAC;AAAA,MACD,iBAAiB,CAAC,+DAA0D;AAAA,MAC5E,SAAS;AAAA,IACX;AAAA,EACF;AAEA,MAAI;AACF,UAAM,SAAS,oBAAoB,OAAO,MAAM;AAChD,UAAM,SAAS,MAAM,QAAQ,OAAO,MAAM,IAAI,OAAO,SAAS,CAAC;AAC/D,UAAM,OAAO,MAAM,QAAQ,OAAO,eAAe,IAAI,OAAO,kBAA8B,CAAC;AAC3F,WAAO;AAAA,MACL,eAAe,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,OAAO,OAAO,aAAa,KAAK,CAAC,CAAC;AAAA,MACzE,QAAQ,OAAO,IAAI,CAAC,OAA+B;AAAA,QACjD,MAAO,EAAE,QAAQ;AAAA,QACjB,UAAW,EAAE,YAAY;AAAA,QACzB,aAAa,OAAO,EAAE,eAAe,EAAE;AAAA,QACvC,eAAe,EAAE,gBAAgB,OAAO,EAAE,aAAa,IAAI;AAAA,MAC7D,EAAE;AAAA,MACF,iBAAiB;AAAA,MACjB,SAAS,OAAO,OAAO,WAAW,sBAAsB;AAAA,IAC1D;AAAA,EACF,QAAQ;AACN,WAAO;AAAA,MACL,eAAe;AAAA,MACf,QAAQ,CAAC;AAAA,MACT,iBAAiB,CAAC;AAAA,MAClB,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,SAAS,oBAAoB,QAAyC;AAEpE,MAAI;AACF,WAAO,KAAK,MAAM,MAAM;AAAA,EAC1B,QAAQ;AAEN,UAAM,QAAQ,OAAO,MAAM,oCAAoC;AAC/D,QAAI,OAAO;AACT,aAAO,KAAK,MAAM,MAAM,CAAC,CAAC;AAAA,IAC5B;AACA,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC3C;AACF;",
6
- "names": []
7
- }
@@ -1,23 +0,0 @@
1
- // src/lib/manual-tasks-meta.ts
2
- var MANUAL_TASK_META = [
3
- {
4
- name: "cron_check_changelog",
5
- description: "Parse CHANGELOG.md and create draft announcement rows for new versions.",
6
- scheduledBy: "manual only \u2014 announcement drafts are reminder-driven, never scheduled"
7
- },
8
- {
9
- name: "cron_suggest_instructions",
10
- description: "Precompute per-project instruction suggestions for the SessionStart hook.",
11
- scheduledBy: "Supabase pg_cron daily 04:30 UTC \u2192 agent_jobs \u2192 agent loop (migration 00083)"
12
- },
13
- {
14
- name: "cron_refresh_skills",
15
- description: "Refresh the skills registry from GitHub sources (disk JSON + public instructions sync). Requires GITHUB_TOKEN.",
16
- scheduledBy: "Supabase pg_cron daily 03:30 UTC \u2192 agent_jobs \u2192 agent loop (migration 00086)"
17
- }
18
- ];
19
-
20
- export {
21
- MANUAL_TASK_META
22
- };
23
- //# sourceMappingURL=chunk-JFDWKLQC.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/lib/manual-tasks-meta.ts"],
4
- "sourcesContent": ["// Pure, dependency-free metadata for the manual maintenance tasks.\n//\n// `crons list` imports ONLY this file, so listing tasks never pulls the heavy\n// worker handlers \u2014 and their `@rulemetric/db` -> `postgres` / OpenTelemetry /\n// Sentry dependencies \u2014 into the command's bundle chunk. With esbuild\n// `splitting: true`, a single shared chunk reachable from any statically-imported\n// module is loaded eagerly; keeping the handlers out of the static graph is what\n// stops a standalone `npm i -g @rulemetric/cli` install from crashing at\n// module-load with `Cannot find package 'postgres'`.\n//\n// The executable handlers + `runManualTask` live in `manual-tasks.ts`, which\n// `crons/run.ts` lazy-imports only when a task is actually executed.\n\nexport interface ManualTaskMeta {\n /** Task name, kept identical to the old cron names so muscle memory works. */\n name: string;\n /** One-line human description shown by `rulemetric crons list`. */\n description: string;\n /** Where the scheduled firing lives now (shown by `crons list`). */\n scheduledBy: string;\n}\n\nexport const MANUAL_TASK_META: readonly ManualTaskMeta[] = [\n {\n name: 'cron_check_changelog',\n description: 'Parse CHANGELOG.md and create draft announcement rows for new versions.',\n scheduledBy: 'manual only \u2014 announcement drafts are reminder-driven, never scheduled',\n },\n {\n name: 'cron_suggest_instructions',\n description: 'Precompute per-project instruction suggestions for the SessionStart hook.',\n scheduledBy: 'Supabase pg_cron daily 04:30 UTC \u2192 agent_jobs \u2192 agent loop (migration 00083)',\n },\n {\n name: 'cron_refresh_skills',\n description:\n 'Refresh the skills registry from GitHub sources (disk JSON + public instructions sync). Requires GITHUB_TOKEN.',\n scheduledBy: 'Supabase pg_cron daily 03:30 UTC \u2192 agent_jobs \u2192 agent loop (migration 00086)',\n },\n];\n"],
5
- "mappings": ";AAsBO,IAAM,mBAA8C;AAAA,EACvD;AAAA,IACI,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,IACI,MAAM;AAAA,IACN,aACI;AAAA,IACJ,aAAa;AAAA,EACjB;AACJ;",
6
- "names": []
7
- }
@@ -1,61 +0,0 @@
1
- import {
2
- ensureWorktree
3
- } from "./chunk-Y4BJXXYV.js";
4
- import {
5
- PermanentJobError
6
- } from "./chunk-DGHWRQXL.js";
7
- import {
8
- apiPatch
9
- } from "./chunk-ZUJBM6HE.js";
10
-
11
- // src/lib/handlers/process-launch.ts
12
- async function resolveWorktreeForLaunch(config) {
13
- if (!config.worktree?.create) {
14
- return config;
15
- }
16
- const { branch, baseRef } = config.worktree;
17
- const wt = await ensureWorktree({
18
- repoRoot: config.projectPath,
19
- branch,
20
- baseRef
21
- });
22
- return {
23
- ...config,
24
- projectPath: wt.path,
25
- gitBranch: wt.branch
26
- };
27
- }
28
- async function processLaunch(payload, helpers) {
29
- const { mirrorId, tool } = payload;
30
- let { config } = payload;
31
- const log = (msg) => helpers.logger.info(msg);
32
- if (helpers.job.attempts > 1) {
33
- throw new PermanentJobError(
34
- `process_launch is not safe to retry (attempt ${helpers.job.attempts}). Re-launch manually.`
35
- );
36
- }
37
- config = await resolveWorktreeForLaunch(config);
38
- if (config.worktree?.create) {
39
- log(`Worktree resolved: ${config.projectPath} (branch ${config.gitBranch})`);
40
- }
41
- log(`Launching ${tool}...`);
42
- const { getLauncher } = await import("./dist-UNYP5PJR.js");
43
- const launcher = getLauncher(tool);
44
- const launcherResult = await launcher.launch(config);
45
- log(`Launch completed: sessionId=${launcherResult.sessionId}`);
46
- const result = {
47
- ...launcherResult,
48
- worktreePath: config.worktree?.create ? config.projectPath : void 0,
49
- runId: config.runId
50
- };
51
- await apiPatch(`/api/launch-jobs/${mirrorId}/state`, { result }).catch((err) => {
52
- log(`result persist failed: ${err instanceof Error ? err.message : String(err)}`);
53
- });
54
- return result;
55
- }
56
-
57
- export {
58
- resolveWorktreeForLaunch,
59
- processLaunch
60
- };
61
- //# sourceMappingURL=chunk-JULOLTZS.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/lib/handlers/process-launch.ts"],
4
- "sourcesContent": ["import type { JobHelpers } from '../job-helpers.js';\nimport type { LaunchConfig as LauncherConfig } from '@rulemetric/session';\nimport { apiPatch } from '../api-client.js';\nimport { PermanentJobError } from '../permanent-job-error.js';\nimport { ensureWorktree } from '../worktree.js';\n\n/**\n * Extends the canonical launcher config (`@rulemetric/session`) with the\n * worker-only fields the `POST /api/runs` fan-out stamps. Extending \u2014 rather\n * than re-declaring \u2014 keeps the shared launcher fields (`projectPath`,\n * `prompt`, `mode`, `resumeSessionId`, \u2026) in lock-step with the launcher so\n * the two can't drift.\n */\nexport interface LaunchConfig extends LauncherConfig {\n gitBranch?: string;\n /**\n * Set by the `POST /api/runs` fan-out (Task 1.1). When `create` is true the\n * worker provisions an isolated git worktree+branch before launching, so the\n * session runs inside its own checkout of the repo.\n */\n worktree?: {\n create: boolean;\n branch: string;\n baseRef: string;\n };\n /**\n * The owning run's id, stamped by the fan-out. Carried through untouched and\n * passed to the launcher, which injects it as RULEMETRIC_RUN_ID into the\n * spawned session's env (Task 3.1). The session-start hook\n * (packages/hooks/scripts/_ensure-session.sh) forwards it as `runId` to\n * POST /api/sessions, which stamps sessions.run_id after validating ownership.\n */\n runId?: string;\n}\n\ninterface LaunchPayload {\n mirrorId: string;\n tool: string;\n config: LaunchConfig;\n}\n\n/**\n * If the launch carries a worktree spec, provision the worktree and return a\n * NEW config pointed at it (`projectPath` = worktree path, `gitBranch` = the\n * branch). When `worktree.create` is falsy the config is returned unchanged.\n *\n * Extracted as a pure-ish helper so it's unit-testable against a real temp git\n * repo without mocking the `@rulemetric/session` launcher. `allowExistingBranch`\n * is left at its default (false): same-run idempotency is handled by\n * `ensureWorktree`'s pre-existence guard, and the `attempts > 1` guard in\n * `processLaunch` prevents a retry from re-running this at all.\n */\nexport async function resolveWorktreeForLaunch(config: LaunchConfig): Promise<LaunchConfig> {\n if (!config.worktree?.create) {\n return config;\n }\n const { branch, baseRef } = config.worktree;\n const wt = await ensureWorktree({\n repoRoot: config.projectPath,\n branch,\n baseRef,\n });\n // New object \u2014 never mutate the caller's config in place.\n return {\n ...config,\n projectPath: wt.path,\n gitBranch: wt.branch,\n };\n}\n\n/**\n * Graphile-shaped handler for the `process_launch` task.\n *\n * Lifted from the legacy `eval-worker.ts:processLaunchJob`, with the queue\n * plumbing stripped out:\n * - no claim \u2014 Graphile already claimed the job before invoking us\n * - no /complete POST \u2014 we return the launcher result (or throw)\n * - no surrounding try/catch \u2014 errors propagate to Graphile's retry path\n *\n * The dynamic import of `@rulemetric/session` is intentional: it avoids\n * loading the launcher (and its tool-specific subprocess wrappers) unless a\n * launch job actually fires.\n */\nexport async function processLaunch(\n payload: LaunchPayload,\n helpers: JobHelpers,\n): Promise<Record<string, unknown>> {\n const { mirrorId, tool } = payload;\n let { config } = payload;\n const log = (msg: string) => helpers.logger.info(msg);\n\n // Fail-fast on retry. The launcher spawns subprocesses and registers a\n // session \u2014 re-running on Graphile retry would create a second session\n // with no link back to the first. Until the launcher path is properly\n // idempotent (resume from sessionId persisted to the mirror row),\n // surface the failure to the user instead of silently double-launching.\n // See docs/audits/2026-05-07-worker-audit.md \"Handlers not idempotent\".\n if (helpers.job.attempts > 1) {\n throw new PermanentJobError(\n `process_launch is not safe to retry (attempt ${helpers.job.attempts}). Re-launch manually.`,\n );\n }\n\n // Provision an isolated worktree (idempotent) BEFORE the launcher spawns \u2014\n // the launcher uses config.projectPath as the session cwd, so swapping it to\n // the worktree path is what makes the session run inside the worktree.\n config = await resolveWorktreeForLaunch(config);\n if (config.worktree?.create) {\n log(`Worktree resolved: ${config.projectPath} (branch ${config.gitBranch})`);\n }\n\n log(`Launching ${tool}...`);\n const { getLauncher } = await import('@rulemetric/session');\n const launcher = getLauncher(tool);\n // config.runId rides through here untouched; the launcher injects it as\n // RULEMETRIC_RUN_ID into the spawned session's env (Task 3.1).\n const launcherResult = await launcher.launch(config);\n log(`Launch completed: sessionId=${launcherResult.sessionId}`);\n\n // Persist the RESOLVED worktree path + runId onto the launch result so the\n // API's reconcile fallback (POST /api/runs/:id/link-sessions, Task 3.2) can\n // match a run's launch jobs to its captured sessions on `projectPath`. The\n // env\u2192hook path (Task 3.1) is the primary attribution channel; this is the\n // defense-in-depth join key for sessions that channel misses (non-Claude-Code\n // tools whose launchers don't inject RULEMETRIC_RUN_ID, proxy-created\n // sessions, tools without our hooks). `config.projectPath` here is already\n // the worktree path \u2014 `resolveWorktreeForLaunch` swapped it above \u2014 so the\n // captured `sessions.projectPath` (the session's cwd) equals it.\n const result: Record<string, unknown> = {\n ...launcherResult,\n worktreePath: config.worktree?.create ? config.projectPath : undefined,\n runId: config.runId,\n };\n\n // Graphile discards task return values, so persist the launcher result\n // (sessionId, etc.) onto the mirror row. Best-effort.\n await apiPatch(`/api/launch-jobs/${mirrorId}/state`, { result }).catch((err: unknown) => {\n log(`result persist failed: ${err instanceof Error ? err.message : String(err)}`);\n });\n\n return result;\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAoDA,eAAsB,yBAAyB,QAA6C;AAC1F,MAAI,CAAC,OAAO,UAAU,QAAQ;AAC5B,WAAO;AAAA,EACT;AACA,QAAM,EAAE,QAAQ,QAAQ,IAAI,OAAO;AACnC,QAAM,KAAK,MAAM,eAAe;AAAA,IAC9B,UAAU,OAAO;AAAA,IACjB;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,GAAG;AAAA,IACH,aAAa,GAAG;AAAA,IAChB,WAAW,GAAG;AAAA,EAChB;AACF;AAeA,eAAsB,cACpB,SACA,SACkC;AAClC,QAAM,EAAE,UAAU,KAAK,IAAI;AAC3B,MAAI,EAAE,OAAO,IAAI;AACjB,QAAM,MAAM,CAAC,QAAgB,QAAQ,OAAO,KAAK,GAAG;AAQpD,MAAI,QAAQ,IAAI,WAAW,GAAG;AAC5B,UAAM,IAAI;AAAA,MACR,gDAAgD,QAAQ,IAAI,QAAQ;AAAA,IACtE;AAAA,EACF;AAKA,WAAS,MAAM,yBAAyB,MAAM;AAC9C,MAAI,OAAO,UAAU,QAAQ;AAC3B,QAAI,sBAAsB,OAAO,WAAW,YAAY,OAAO,SAAS,GAAG;AAAA,EAC7E;AAEA,MAAI,aAAa,IAAI,KAAK;AAC1B,QAAM,EAAE,YAAY,IAAI,MAAM,OAAO,oBAAqB;AAC1D,QAAM,WAAW,YAAY,IAAI;AAGjC,QAAM,iBAAiB,MAAM,SAAS,OAAO,MAAM;AACnD,MAAI,+BAA+B,eAAe,SAAS,EAAE;AAW7D,QAAM,SAAkC;AAAA,IACtC,GAAG;AAAA,IACH,cAAc,OAAO,UAAU,SAAS,OAAO,cAAc;AAAA,IAC7D,OAAO,OAAO;AAAA,EAChB;AAIA,QAAM,SAAS,oBAAoB,QAAQ,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,QAAiB;AACvF,QAAI,0BAA0B,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC,EAAE;AAAA,EAClF,CAAC;AAED,SAAO;AACT;",
6
- "names": []
7
- }