@rulemetric/cli 0.7.2 → 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 -309
  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 -781
  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 -46
  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 -15
  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 -14
  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 -11
  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 -17
  217. package/dist/lib/manual-tasks-meta.js +1 -8
  218. package/dist/lib/manual-tasks.js +1 -79
  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 +8 -7
  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-7DULPSFU.js +0 -299
  270. package/dist/chunk-7DULPSFU.js.map +0 -7
  271. package/dist/chunk-7LVVKQMZ.js +0 -98
  272. package/dist/chunk-7LVVKQMZ.js.map +0 -7
  273. package/dist/chunk-7NNFYWKK.js +0 -243
  274. package/dist/chunk-7NNFYWKK.js.map +0 -7
  275. package/dist/chunk-7NYKWN7U.js +0 -12
  276. package/dist/chunk-7NYKWN7U.js.map +0 -7
  277. package/dist/chunk-BO76WKJR.js +0 -42
  278. package/dist/chunk-BO76WKJR.js.map +0 -7
  279. package/dist/chunk-BRD5RUGM.js +0 -53
  280. package/dist/chunk-BRD5RUGM.js.map +0 -7
  281. package/dist/chunk-BT6Z6545.js +0 -43
  282. package/dist/chunk-BT6Z6545.js.map +0 -7
  283. package/dist/chunk-BZDKEQKU.js +0 -39
  284. package/dist/chunk-BZDKEQKU.js.map +0 -7
  285. package/dist/chunk-DGHWRQXL.js +0 -17
  286. package/dist/chunk-DGHWRQXL.js.map +0 -7
  287. package/dist/chunk-DNKSVWMD.js +0 -108
  288. package/dist/chunk-DNKSVWMD.js.map +0 -7
  289. package/dist/chunk-DQ3KELXD.js +0 -74
  290. package/dist/chunk-DQ3KELXD.js.map +0 -7
  291. package/dist/chunk-DUJSRBLP.js +0 -122
  292. package/dist/chunk-DUJSRBLP.js.map +0 -7
  293. package/dist/chunk-E3BIT53W.js +0 -154
  294. package/dist/chunk-E3BIT53W.js.map +0 -7
  295. package/dist/chunk-EARWG4EV.js +0 -22
  296. package/dist/chunk-EARWG4EV.js.map +0 -7
  297. package/dist/chunk-EI5BHWXA.js +0 -1662
  298. package/dist/chunk-EI5BHWXA.js.map +0 -7
  299. package/dist/chunk-EJ3YAFDP.js +0 -37
  300. package/dist/chunk-EJ3YAFDP.js.map +0 -7
  301. package/dist/chunk-EKJ2CABV.js +0 -76
  302. package/dist/chunk-EKJ2CABV.js.map +0 -7
  303. package/dist/chunk-EKP32DLN.js +0 -16
  304. package/dist/chunk-EKP32DLN.js.map +0 -7
  305. package/dist/chunk-EYPAAGN5.js +0 -51
  306. package/dist/chunk-EYPAAGN5.js.map +0 -7
  307. package/dist/chunk-F5N6CLJJ.js +0 -1995
  308. package/dist/chunk-F5N6CLJJ.js.map +0 -7
  309. package/dist/chunk-FZKLLNDS.js +0 -228
  310. package/dist/chunk-FZKLLNDS.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-OK3I555A.js +0 -243
  336. package/dist/chunk-OK3I555A.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-PMI56ED5.js +0 -167
  347. package/dist/chunk-PMI56ED5.js.map +0 -7
  348. package/dist/chunk-QJQS6TUN.js +0 -44
  349. package/dist/chunk-QJQS6TUN.js.map +0 -7
  350. package/dist/chunk-QN34TGD3.js +0 -83
  351. package/dist/chunk-QN34TGD3.js.map +0 -7
  352. package/dist/chunk-QSN77T7C.js +0 -250
  353. package/dist/chunk-QSN77T7C.js.map +0 -7
  354. package/dist/chunk-R56PH7YE.js +0 -78
  355. package/dist/chunk-R56PH7YE.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-W2YERO7E.js +0 -170
  367. package/dist/chunk-W2YERO7E.js.map +0 -7
  368. package/dist/chunk-W53GKIZQ.js +0 -50
  369. package/dist/chunk-W53GKIZQ.js.map +0 -7
  370. package/dist/chunk-WA4MWYRW.js +0 -254
  371. package/dist/chunk-WA4MWYRW.js.map +0 -7
  372. package/dist/chunk-XC6M4CSW.js +0 -44
  373. package/dist/chunk-XC6M4CSW.js.map +0 -7
  374. package/dist/chunk-XK42ZBDE.js +0 -23
  375. package/dist/chunk-XK42ZBDE.js.map +0 -7
  376. package/dist/chunk-XUV6DDBF.js +0 -124
  377. package/dist/chunk-XUV6DDBF.js.map +0 -7
  378. package/dist/chunk-XZXS2W24.js.map +0 -7
  379. package/dist/chunk-Y3WD5CSW.js +0 -49
  380. package/dist/chunk-Y3WD5CSW.js.map +0 -7
  381. package/dist/chunk-Y4BJXXYV.js +0 -148
  382. package/dist/chunk-Y4BJXXYV.js.map +0 -7
  383. package/dist/chunk-YNIH3KMU.js +0 -121
  384. package/dist/chunk-YNIH3KMU.js.map +0 -7
  385. package/dist/chunk-YOBA3NAM.js +0 -55
  386. package/dist/chunk-YOBA3NAM.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,337 +1,14 @@
1
- import {
2
- buildAllowHostsArgs
3
- } from "../../chunk-EARWG4EV.js";
4
- import {
5
- findBinary
6
- } from "../../chunk-42GFSAJP.js";
7
- import {
8
- MITMPROXY_COMMAND_PATTERN,
9
- isPidLiveAndMatching
10
- } from "../../chunk-5EDMGK3W.js";
11
- import {
12
- BaseCommand
13
- } from "../../chunk-2HK7RGZB.js";
14
- import "../../chunk-R56PH7YE.js";
15
- import "../../chunk-GQNJO2P2.js";
16
- import "../../chunk-37LN5O7M.js";
17
- import "../../chunk-EKJ2CABV.js";
18
- import "../../chunk-ZUJBM6HE.js";
19
- import {
20
- isAuthenticated
21
- } from "../../chunk-W2YERO7E.js";
22
- import "../../chunk-NSBPE2FW.js";
23
-
24
- // src/commands/proxy/start.ts
25
- import { Flags } from "@oclif/core";
26
- import { execSync, spawn, spawnSync } from "node:child_process";
27
- import { appendFileSync, existsSync, mkdirSync, openSync, readFileSync, writeFileSync } from "node:fs";
28
- import { createRequire } from "node:module";
29
- import { homedir } from "node:os";
30
- import { dirname, join, resolve } from "node:path";
31
- import { fileURLToPath } from "node:url";
32
- var MODULE_DIR = dirname(fileURLToPath(import.meta.url));
33
- var DEFAULT_PORT = 8788;
34
- var CONFIG_DIR = join(homedir(), ".config", "rulemetric");
35
- var PID_FILE = join(CONFIG_DIR, "proxy.pid");
36
- var LOG_FILE = join(CONFIG_DIR, "proxy.log");
37
- var DOCKER_IMAGE = "rulemetric/proxy";
38
- var DOCKER_CONTAINER = "rulemetric-proxy";
39
- function resolveProxyFile(subpath, fallbacks) {
40
- try {
41
- const req = createRequire(import.meta.url);
42
- const p = req.resolve(`@rulemetric/proxy/${subpath}`);
43
- if (existsSync(p)) return p;
44
- } catch {
45
- }
46
- for (const p of fallbacks) {
47
- if (existsSync(p)) return p;
48
- }
49
- return null;
50
- }
51
- function findAddonPath() {
52
- const candidates = [
53
- resolve(MODULE_DIR, "../../../../../packages/proxy/addon/rulemetric_addon.py"),
54
- resolve(MODULE_DIR, "../../../node_modules/@rulemetric/proxy/addon/rulemetric_addon.py"),
55
- resolve(MODULE_DIR, "../../../../../node_modules/@rulemetric/proxy/addon/rulemetric_addon.py")
56
- ];
57
- const found = resolveProxyFile("addon/rulemetric_addon.py", candidates);
58
- if (found) return found;
59
- throw new Error(
60
- "Could not find rulemetric_addon.py. Is @rulemetric/proxy installed?\nSearched (after module resolution):\n" + candidates.map((c) => ` ${c}`).join("\n")
61
- );
62
- }
63
- function findDockerfilePath() {
64
- const candidates = [
65
- resolve(MODULE_DIR, "../../../../../packages/proxy/Dockerfile"),
66
- resolve(MODULE_DIR, "../../../node_modules/@rulemetric/proxy/Dockerfile"),
67
- resolve(MODULE_DIR, "../../../../../node_modules/@rulemetric/proxy/Dockerfile")
68
- ];
69
- const found = resolveProxyFile("Dockerfile", candidates);
70
- if (found) return dirname(found);
71
- throw new Error("Could not find proxy Dockerfile. Is @rulemetric/proxy installed?");
72
- }
73
- function dockerImageExists() {
74
- const result = spawnSync("docker", ["image", "inspect", DOCKER_IMAGE], { stdio: "ignore" });
75
- return result.status === 0;
76
- }
77
- function dockerContainerRunning() {
78
- const result = spawnSync("docker", ["container", "inspect", "-f", "{{.State.Running}}", DOCKER_CONTAINER], {
79
- encoding: "utf-8",
80
- stdio: ["ignore", "pipe", "ignore"]
81
- });
82
- return result.status === 0 && result.stdout?.trim() === "true";
83
- }
84
- var ProxyStart = class _ProxyStart extends BaseCommand {
85
- static description = "Start context capture proxy";
86
- static examples = [
87
- "<%= config.bin %> proxy start",
88
- "<%= config.bin %> proxy start --docker",
89
- "<%= config.bin %> proxy start --port 9090",
90
- "<%= config.bin %> proxy start --web"
91
- ];
92
- static flags = {
93
- port: Flags.integer({ char: "p", default: DEFAULT_PORT, description: "Proxy listen port" }),
94
- docker: Flags.boolean({ char: "d", default: false, description: "Run proxy in Docker (no local mitmproxy needed)" }),
95
- web: Flags.boolean({ default: false, description: "Launch mitmweb debug UI instead of mitmdump (local mode only)" }),
96
- "skip-checks": Flags.boolean({ default: false, description: "Skip prerequisite checks" }),
97
- build: Flags.boolean({ default: false, description: "Force rebuild Docker image" })
98
- };
99
- async run() {
100
- const { flags } = await this.parse(_ProxyStart);
101
- const port = flags.port;
102
- if (flags.docker) {
103
- await this.startDocker(port, flags.build);
104
- } else {
105
- await this.startLocal(port, flags.web, flags["skip-checks"]);
106
- }
107
- }
108
- async startDocker(port, forceBuild) {
109
- try {
110
- execSync("docker info", { stdio: "ignore" });
111
- } catch {
112
- this.error("Docker is not running. Start Docker Desktop and try again.");
113
- }
114
- if (dockerContainerRunning()) {
115
- this.error(`Proxy container already running. Stop it first: rulemetric proxy stop`);
116
- }
117
- const composeFile = this.findComposeFile();
118
- const certDir = join(homedir(), ".mitmproxy");
119
- mkdirSync(certDir, { recursive: true });
120
- const tmpDir = process.env.TMPDIR || "/tmp";
121
- mkdirSync(join(tmpDir, "rulemetric"), { recursive: true });
122
- const envOverrides = {
123
- PROXY_PORT: String(port),
124
- RULEMETRIC_PROJECT_PATH: process.cwd()
125
- };
126
- if (!process.env.RULEMETRIC_API_KEY && !process.env.RULEMETRIC_ACCESS_TOKEN) {
127
- const envFile = join(homedir(), ".config", "rulemetric", "env");
128
- if (existsSync(envFile)) {
129
- for (const line of readFileSync(envFile, "utf-8").split("\n")) {
130
- const trimmed = line.trim();
131
- if (trimmed && !trimmed.startsWith("#") && trimmed.includes("=")) {
132
- const [key, ...rest] = trimmed.split("=");
133
- envOverrides[key] = rest.join("=");
134
- }
135
- }
136
- }
137
- }
138
- if (composeFile) {
139
- const composeEnv = { ...process.env, ...envOverrides };
140
- const buildFlag = forceBuild ? "--build" : "";
141
- const args = ["compose", "-f", composeFile, "up", "-d", "proxy"];
142
- if (forceBuild) args.splice(4, 0, "--build");
143
- this.log(forceBuild ? "Building and starting proxy via Docker Compose..." : "Starting proxy via Docker Compose...");
144
- const result = spawnSync("docker", args, {
145
- env: composeEnv,
146
- stdio: "inherit"
147
- });
148
- if (result.status !== 0) {
149
- this.error("Docker Compose failed. Try: docker compose -f docker-compose.yml up proxy");
150
- }
151
- } else {
152
- if (forceBuild || !dockerImageExists()) {
153
- const proxyDir = findDockerfilePath();
154
- this.log("Building proxy Docker image...");
155
- const build = spawnSync("docker", ["build", "-t", DOCKER_IMAGE, proxyDir], { stdio: "inherit" });
156
- if (build.status !== 0) {
157
- this.error("Docker build failed");
158
- }
159
- }
160
- spawnSync("docker", ["rm", "-f", DOCKER_CONTAINER], { stdio: "ignore" });
161
- const envArgs = [];
162
- for (const [key, val] of Object.entries(envOverrides)) {
163
- envArgs.push("-e", `${key}=${val}`);
164
- }
165
- for (const key of ["RULEMETRIC_API_URL", "RULEMETRIC_API_KEY", "RULEMETRIC_ACCESS_TOKEN"]) {
166
- if (process.env[key]) envArgs.push("-e", `${key}=${process.env[key]}`);
167
- }
168
- const dockerArgs = [
169
- "run",
170
- "-d",
171
- "--name",
172
- DOCKER_CONTAINER,
173
- "-p",
174
- `${port}:8787`,
175
- "-v",
176
- `${certDir}:/root/.mitmproxy`,
177
- "-v",
178
- `${join(tmpDir, "rulemetric")}:/tmp/rulemetric:ro`,
179
- ...envArgs,
180
- DOCKER_IMAGE
181
- ];
182
- const result = spawnSync("docker", dockerArgs, { encoding: "utf-8", stdio: ["ignore", "pipe", "pipe"] });
183
- if (result.status !== 0) {
184
- this.error(`Failed to start container: ${result.stderr}`);
185
- }
186
- }
187
- mkdirSync(CONFIG_DIR, { recursive: true });
188
- writeFileSync(PID_FILE, `docker:${DOCKER_CONTAINER}`);
189
- await new Promise((resolve2) => setTimeout(resolve2, 2e3));
190
- const inspectResult = spawnSync("docker", ["container", "inspect", "-f", "{{.Id}}", DOCKER_CONTAINER], {
191
- encoding: "utf-8",
192
- stdio: ["ignore", "pipe", "ignore"]
193
- });
194
- const containerId = inspectResult.stdout?.trim().slice(0, 12) || "unknown";
195
- this.log(`Proxy running in Docker on localhost:${port} (container: ${containerId})`);
196
- this.log("");
197
- this.log("View logs: rulemetric proxy logs -f");
198
- }
199
- findComposeFile() {
200
- const candidates = [
201
- join(process.cwd(), "docker-compose.yml"),
202
- resolve(MODULE_DIR, "../../../../../docker-compose.yml")
203
- ];
204
- for (const p of candidates) {
205
- if (existsSync(p)) return p;
206
- }
207
- return null;
208
- }
209
- async startLocal(port, useWeb, skipChecks) {
210
- if (existsSync(PID_FILE)) {
211
- const content = readFileSync(PID_FILE, "utf-8").trim();
212
- if (content.startsWith("docker:")) {
213
- this.error("Proxy is running in Docker. Stop it first: rulemetric proxy stop");
214
- }
215
- const pid = Number.parseInt(content, 10);
216
- if (!Number.isNaN(pid) && isPidLiveAndMatching(pid, MITMPROXY_COMMAND_PATTERN)) {
217
- this.error(`Proxy already running (PID ${pid}). Stop it first: rulemetric proxy stop`);
218
- }
219
- }
220
- const binaryName = useWeb ? "mitmweb" : "mitmdump";
221
- const binary = findBinary(binaryName);
222
- if (!binary) {
223
- this.error(
224
- `${binaryName} not found. Use Docker mode instead:
1
+ import{a as K}from"../../chunk-OMXUK4M6.js";import{a as U}from"../../chunk-67QCYUJU.js";import{b as F,d as N}from"../../chunk-SZ62CP55.js";import{a as M}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-TIQ7DQ3M.js";import{g as $}from"../../chunk-M6AJDVCL.js";import{a as u}from"../../chunk-ZLLER3HP.js";import{Flags as _}from"@oclif/core";import{execSync as H,spawn as q,spawnSync as m}from"node:child_process";import{appendFileSync as G,existsSync as l,mkdirSync as P,openSync as V,readFileSync as b,writeFileSync as Y}from"node:fs";import{createRequire as W}from"node:module";import{homedir as x}from"node:os";import{dirname as A,join as c,resolve as f}from"node:path";import{fileURLToPath as X}from"node:url";var g=A(X(import.meta.url)),J=8788,S=c(x(),".config","rulemetric"),T=c(S,"proxy.pid"),D=c(S,"proxy.log"),w="rulemetric/proxy",v="rulemetric-proxy";function j(s,o){try{let d=W(import.meta.url).resolve(`@rulemetric/proxy/${s}`);if(l(d))return d}catch{}for(let t of o)if(l(t))return t;return null}u(j,"resolveProxyFile");function B(){let s=[f(g,"../../../../../packages/proxy/addon/rulemetric_addon.py"),f(g,"../../../node_modules/@rulemetric/proxy/addon/rulemetric_addon.py"),f(g,"../../../../../node_modules/@rulemetric/proxy/addon/rulemetric_addon.py")],o=j("addon/rulemetric_addon.py",s);if(o)return o;throw new Error(`Could not find rulemetric_addon.py. Is @rulemetric/proxy installed?
2
+ Searched (after module resolution):
3
+ `+s.map(t=>` ${t}`).join(`
4
+ `))}u(B,"findAddonPath");function z(){let s=[f(g,"../../../../../packages/proxy/Dockerfile"),f(g,"../../../node_modules/@rulemetric/proxy/Dockerfile"),f(g,"../../../../../node_modules/@rulemetric/proxy/Dockerfile")],o=j("Dockerfile",s);if(o)return A(o);throw new Error("Could not find proxy Dockerfile. Is @rulemetric/proxy installed?")}u(z,"findDockerfilePath");function Q(){return m("docker",["image","inspect",w],{stdio:"ignore"}).status===0}u(Q,"dockerImageExists");function Z(){let s=m("docker",["container","inspect","-f","{{.State.Running}}",v],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]});return s.status===0&&s.stdout?.trim()==="true"}u(Z,"dockerContainerRunning");var L=class s extends M{static{u(this,"ProxyStart")}static description="Start context capture proxy";static examples=["<%= config.bin %> proxy start","<%= config.bin %> proxy start --docker","<%= config.bin %> proxy start --port 9090","<%= config.bin %> proxy start --web"];static flags={port:_.integer({char:"p",default:J,description:"Proxy listen port"}),docker:_.boolean({char:"d",default:!1,description:"Run proxy in Docker (no local mitmproxy needed)"}),web:_.boolean({default:!1,description:"Launch mitmweb debug UI instead of mitmdump (local mode only)"}),"skip-checks":_.boolean({default:!1,description:"Skip prerequisite checks"}),build:_.boolean({default:!1,description:"Force rebuild Docker image"})};async run(){let{flags:o}=await this.parse(s),t=o.port;o.docker?await this.startDocker(t,o.build):await this.startLocal(t,o.web,o["skip-checks"])}async startDocker(o,t){try{H("docker info",{stdio:"ignore"})}catch{this.error("Docker is not running. Start Docker Desktop and try again.")}Z()&&this.error("Proxy container already running. Stop it first: rulemetric proxy stop");let d=this.findComposeFile(),k=c(x(),".mitmproxy");P(k,{recursive:!0});let E=process.env.TMPDIR||"/tmp";P(c(E,"rulemetric"),{recursive:!0});let y={PROXY_PORT:String(o),RULEMETRIC_PROJECT_PATH:process.cwd()};if(!process.env.RULEMETRIC_API_KEY&&!process.env.RULEMETRIC_ACCESS_TOKEN){let n=c(x(),".config","rulemetric","env");if(l(n))for(let h of b(n,"utf-8").split(`
5
+ `)){let r=h.trim();if(r&&!r.startsWith("#")&&r.includes("=")){let[e,...i]=r.split("=");y[e]=i.join("=")}}}if(d){let n={...process.env,...y},h=t?"--build":"",r=["compose","-f",d,"up","-d","proxy"];t&&r.splice(4,0,"--build"),this.log(t?"Building and starting proxy via Docker Compose...":"Starting proxy via Docker Compose..."),m("docker",r,{env:n,stdio:"inherit"}).status!==0&&this.error("Docker Compose failed. Try: docker compose -f docker-compose.yml up proxy")}else{if(t||!Q()){let e=z();this.log("Building proxy Docker image..."),m("docker",["build","-t",w,e],{stdio:"inherit"}).status!==0&&this.error("Docker build failed")}m("docker",["rm","-f",v],{stdio:"ignore"});let n=[];for(let[e,i]of Object.entries(y))n.push("-e",`${e}=${i}`);for(let e of["RULEMETRIC_API_URL","RULEMETRIC_API_KEY","RULEMETRIC_ACCESS_TOKEN"])process.env[e]&&n.push("-e",`${e}=${process.env[e]}`);let h=["run","-d","--name",v,"-p",`${o}:8787`,"-v",`${k}:/root/.mitmproxy`,"-v",`${c(E,"rulemetric")}:/tmp/rulemetric:ro`,...n,w],r=m("docker",h,{encoding:"utf-8",stdio:["ignore","pipe","pipe"]});r.status!==0&&this.error(`Failed to start container: ${r.stderr}`)}P(S,{recursive:!0}),Y(T,`docker:${v}`),await new Promise(n=>setTimeout(n,2e3));let I=m("docker",["container","inspect","-f","{{.Id}}",v],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).stdout?.trim().slice(0,12)||"unknown";this.log(`Proxy running in Docker on localhost:${o} (container: ${I})`),this.log(""),this.log("View logs: rulemetric proxy logs -f")}findComposeFile(){let o=[c(process.cwd(),"docker-compose.yml"),f(g,"../../../../../docker-compose.yml")];for(let t of o)if(l(t))return t;return null}async startLocal(o,t,d){if(l(T)){let e=b(T,"utf-8").trim();e.startsWith("docker:")&&this.error("Proxy is running in Docker. Stop it first: rulemetric proxy stop");let i=Number.parseInt(e,10);!Number.isNaN(i)&&N(i,F)&&this.error(`Proxy already running (PID ${i}). Stop it first: rulemetric proxy stop`)}let k=t?"mitmweb":"mitmdump",E=U(k);if(E||this.error(`${k} not found. Use Docker mode instead:
225
6
  rulemetric proxy start --docker
226
7
 
227
8
  Or install mitmproxy locally:
228
9
  pipx install mitmproxy
229
- brew install mitmproxy`
230
- );
231
- }
232
- if (!skipChecks) {
233
- const warnings = [];
234
- if (!isAuthenticated() && !process.env.RULEMETRIC_API_KEY) {
235
- const envFile = join(homedir(), ".config", "rulemetric", "env");
236
- let hasEnvAuth = false;
237
- if (existsSync(envFile)) {
238
- const content = readFileSync(envFile, "utf-8");
239
- hasEnvAuth = content.includes("RULEMETRIC_API_KEY") || content.includes("RULEMETRIC_ACCESS_TOKEN");
240
- }
241
- if (!hasEnvAuth) {
242
- warnings.push("Not authenticated \u2014 snapshots cannot be stored. Run `rulemetric auth login`.");
243
- }
244
- }
245
- const certPath = join(homedir(), ".mitmproxy", "mitmproxy-ca-cert.pem");
246
- if (!existsSync(certPath)) {
247
- warnings.push("CA cert not found \u2014 HTTPS interception may fail. Run `rulemetric proxy setup`.");
248
- }
249
- const hasClaudeSettings = ["settings.local.json", "settings.json"].some(
250
- (fileName) => existsSync(join(process.cwd(), ".claude", fileName))
251
- );
252
- if (!hasClaudeSettings) {
253
- warnings.push("Session hooks not installed \u2014 snapshots won't link to sessions. Run `rulemetric hooks install`.");
254
- }
255
- if (warnings.length > 0) {
256
- for (const w of warnings) {
257
- this.log(` Warning: ${w}`);
258
- }
259
- this.log("");
260
- }
261
- }
262
- const addonPath = findAddonPath();
263
- const env = {
264
- ...process.env,
265
- RULEMETRIC_PROJECT_PATH: process.cwd(),
266
- // Bound to this CLI binary's version. The addon writes this to a
267
- // version file the gateway watches; on drift the gateway restarts
268
- // mitmproxy so an upgraded CLI doesn't sit next to a stale proxy.
269
- RULEMETRIC_CLI_VERSION: this.config.version
270
- };
271
- if (!env.RULEMETRIC_API_KEY && !env.RULEMETRIC_ACCESS_TOKEN) {
272
- const envFile = join(homedir(), ".config", "rulemetric", "env");
273
- if (existsSync(envFile)) {
274
- for (const line of readFileSync(envFile, "utf-8").split("\n")) {
275
- const trimmed = line.trim();
276
- if (trimmed && !trimmed.startsWith("#") && trimmed.includes("=")) {
277
- const [key, ...rest] = trimmed.split("=");
278
- env[key] = rest.join("=");
279
- }
280
- }
281
- }
282
- }
283
- mkdirSync(CONFIG_DIR, { recursive: true });
284
- appendFileSync(LOG_FILE, `
285
- --- Proxy started at ${(/* @__PURE__ */ new Date()).toISOString()} (port ${port}) ---
286
- `);
287
- const logFd = openSync(LOG_FILE, "a");
288
- const allowHostsArgs = buildAllowHostsArgs(dirname(addonPath));
289
- if (allowHostsArgs.length > 0) {
290
- this.log(`[OK] Interception scoped to ${allowHostsArgs.length / 2} LLM host patterns (RULEMETRIC_PROXY_ALL_HOSTS=1 to intercept everything)`);
291
- } else {
292
- this.log("[!!] Interception UNSCOPED \u2014 all HTTPS hosts pass through mitmproxy");
293
- }
294
- const args = [
295
- "--listen-port",
296
- String(port),
297
- "-s",
298
- addonPath,
299
- "--set",
300
- "console_eventlog_verbosity=info",
301
- ...allowHostsArgs
302
- ];
303
- const child = spawn(binary, args, {
304
- env,
305
- stdio: ["ignore", logFd, logFd],
306
- detached: true
307
- });
308
- child.unref();
309
- if (!child.pid) {
310
- this.error("Failed to start proxy process");
311
- }
312
- await new Promise((resolve2) => {
313
- let exited = false;
314
- child.once("exit", (code) => {
315
- exited = true;
316
- this.error(`Proxy exited immediately with code ${code}. Check logs:
317
- ${LOG_FILE}`);
318
- });
319
- setTimeout(() => {
320
- if (!exited) resolve2();
321
- }, 500);
322
- });
323
- writeFileSync(PID_FILE, String(child.pid));
324
- this.log(`Proxy running on localhost:${port} (PID ${child.pid})`);
325
- this.log(`Log file: ${LOG_FILE}`);
326
- if (useWeb) {
327
- this.log("");
328
- this.log("Debug UI: http://localhost:8081");
329
- }
330
- this.log("");
331
- this.log("View logs: rulemetric proxy logs -f");
332
- }
333
- };
334
- export {
335
- ProxyStart as default
336
- };
337
- //# sourceMappingURL=start.js.map
10
+ brew install mitmproxy`),!d){let e=[];if(!$()&&!process.env.RULEMETRIC_API_KEY){let a=c(x(),".config","rulemetric","env"),C=!1;if(l(a)){let O=b(a,"utf-8");C=O.includes("RULEMETRIC_API_KEY")||O.includes("RULEMETRIC_ACCESS_TOKEN")}C||e.push("Not authenticated \u2014 snapshots cannot be stored. Run `rulemetric auth login`.")}let i=c(x(),".mitmproxy","mitmproxy-ca-cert.pem");if(l(i)||e.push("CA cert not found \u2014 HTTPS interception may fail. Run `rulemetric proxy setup`."),["settings.local.json","settings.json"].some(a=>l(c(process.cwd(),".claude",a)))||e.push("Session hooks not installed \u2014 snapshots won't link to sessions. Run `rulemetric hooks install`."),e.length>0){for(let a of e)this.log(` Warning: ${a}`);this.log("")}}let y=B(),R={...process.env,RULEMETRIC_PROJECT_PATH:process.cwd(),RULEMETRIC_CLI_VERSION:this.config.version};if(!R.RULEMETRIC_API_KEY&&!R.RULEMETRIC_ACCESS_TOKEN){let e=c(x(),".config","rulemetric","env");if(l(e))for(let i of b(e,"utf-8").split(`
11
+ `)){let p=i.trim();if(p&&!p.startsWith("#")&&p.includes("=")){let[a,...C]=p.split("=");R[a]=C.join("=")}}}P(S,{recursive:!0}),G(D,`
12
+ --- Proxy started at ${new Date().toISOString()} (port ${o}) ---
13
+ `);let I=V(D,"a"),n=K(A(y));n.length>0?this.log(`[OK] Interception scoped to ${n.length/2} LLM host patterns (RULEMETRIC_PROXY_ALL_HOSTS=1 to intercept everything)`):this.log("[!!] Interception UNSCOPED \u2014 all HTTPS hosts pass through mitmproxy");let h=["--listen-port",String(o),"-s",y,"--set","console_eventlog_verbosity=info",...n],r=q(E,h,{env:R,stdio:["ignore",I,I],detached:!0});r.unref(),r.pid||this.error("Failed to start proxy process"),await new Promise(e=>{let i=!1;r.once("exit",p=>{i=!0,this.error(`Proxy exited immediately with code ${p}. Check logs:
14
+ ${D}`)}),setTimeout(()=>{i||e()},500)}),Y(T,String(r.pid)),this.log(`Proxy running on localhost:${o} (PID ${r.pid})`),this.log(`Log file: ${D}`),t&&(this.log(""),this.log("Debug UI: http://localhost:8081")),this.log(""),this.log("View logs: rulemetric proxy logs -f")}};export{L as default};
@@ -1,78 +1 @@
1
- import {
2
- GATEWAY_PORT,
3
- MITMPROXY_PORT,
4
- getGatewayPid,
5
- isGatewayRunning
6
- } from "../../chunk-4LYCDS2N.js";
7
- import "../../chunk-7LVVKQMZ.js";
8
- import {
9
- MITMPROXY_COMMAND_PATTERN,
10
- isPidLiveAndMatching,
11
- pidAlive
12
- } from "../../chunk-5EDMGK3W.js";
13
- import {
14
- BaseCommand
15
- } from "../../chunk-2HK7RGZB.js";
16
- import "../../chunk-R56PH7YE.js";
17
- import "../../chunk-GQNJO2P2.js";
18
- import "../../chunk-37LN5O7M.js";
19
- import "../../chunk-EKJ2CABV.js";
20
- import "../../chunk-ZUJBM6HE.js";
21
- import "../../chunk-W2YERO7E.js";
22
- import "../../chunk-NSBPE2FW.js";
23
-
24
- // src/commands/proxy/status.ts
25
- import { spawnSync } from "node:child_process";
26
- import { existsSync, readFileSync } from "node:fs";
27
- import { homedir } from "node:os";
28
- import { join } from "node:path";
29
- var CONFIG_DIR = join(homedir(), ".config", "rulemetric");
30
- var PID_FILE = join(CONFIG_DIR, "proxy.pid");
31
- var ProxyStatus = class _ProxyStatus extends BaseCommand {
32
- static description = "Check gateway and context capture proxy status";
33
- static examples = ["<%= config.bin %> proxy status"];
34
- async run() {
35
- await this.parse(_ProxyStatus);
36
- if (isGatewayRunning()) {
37
- const pid2 = getGatewayPid();
38
- this.log(`Gateway: running (PID ${pid2}) on :${GATEWAY_PORT}`);
39
- } else {
40
- this.log(`Gateway: not running`);
41
- }
42
- if (!existsSync(PID_FILE)) {
43
- this.log(`Mitmproxy: not running \u2014 routing direct (no capture)`);
44
- return;
45
- }
46
- const content = readFileSync(PID_FILE, "utf-8").trim();
47
- if (content.startsWith("docker:")) {
48
- const containerName = content.slice("docker:".length);
49
- const result = spawnSync("docker", ["container", "inspect", "-f", "{{.State.Status}}", containerName], {
50
- encoding: "utf-8",
51
- stdio: ["ignore", "pipe", "ignore"]
52
- });
53
- const status = result.stdout?.trim();
54
- if (result.status === 0 && status === "running") {
55
- this.log(`Mitmproxy: running in Docker (container: ${containerName}) on :${MITMPROXY_PORT} \u2014 capturing context`);
56
- } else {
57
- this.log(`Mitmproxy: container ${status || "not running"} (stale)`);
58
- }
59
- return;
60
- }
61
- const pid = Number.parseInt(content, 10);
62
- if (Number.isNaN(pid)) {
63
- this.log("Mitmproxy: not running (invalid PID file)");
64
- return;
65
- }
66
- if (isPidLiveAndMatching(pid, MITMPROXY_COMMAND_PATTERN)) {
67
- this.log(`Mitmproxy: running (PID ${pid}) on :${MITMPROXY_PORT} \u2014 capturing context`);
68
- } else if (pidAlive(pid)) {
69
- this.log(`Mitmproxy: not running (PID ${pid} was reused by another process \u2014 stale PID file)`);
70
- } else {
71
- this.log("Mitmproxy: not running (stale PID file)");
72
- }
73
- }
74
- };
75
- export {
76
- ProxyStatus as default
77
- };
78
- //# sourceMappingURL=status.js.map
1
+ import{c as m,d as o,i as l,j as d}from"../../chunk-MVM6OGAF.js";import"../../chunk-KKDHD4XA.js";import{b as p,c as u,d as g}from"../../chunk-SZ62CP55.js";import{a as c}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a}from"../../chunk-ZLLER3HP.js";import{spawnSync as x}from"node:child_process";import{existsSync as M,readFileSync as P}from"node:fs";import{homedir as I}from"node:os";import{join as y}from"node:path";var D=y(I(),".config","rulemetric"),f=y(D,"proxy.pid"),e=class h extends c{static{a(this,"ProxyStatus")}static description="Check gateway and context capture proxy status";static examples=["<%= config.bin %> proxy status"];async run(){if(await this.parse(h),l()){let n=d();this.log(`Gateway: running (PID ${n}) on :${m}`)}else this.log("Gateway: not running");if(!M(f)){this.log("Mitmproxy: not running \u2014 routing direct (no capture)");return}let i=P(f,"utf-8").trim();if(i.startsWith("docker:")){let n=i.slice(7),r=x("docker",["container","inspect","-f","{{.State.Status}}",n],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}),s=r.stdout?.trim();r.status===0&&s==="running"?this.log(`Mitmproxy: running in Docker (container: ${n}) on :${o} \u2014 capturing context`):this.log(`Mitmproxy: container ${s||"not running"} (stale)`);return}let t=Number.parseInt(i,10);if(Number.isNaN(t)){this.log("Mitmproxy: not running (invalid PID file)");return}g(t,p)?this.log(`Mitmproxy: running (PID ${t}) on :${o} \u2014 capturing context`):u(t)?this.log(`Mitmproxy: not running (PID ${t} was reused by another process \u2014 stale PID file)`):this.log("Mitmproxy: not running (stale PID file)")}};export{e as default};
@@ -1,94 +1 @@
1
- import {
2
- MITMPROXY_COMMAND_PATTERN,
3
- isPidLiveAndMatching
4
- } from "../../chunk-5EDMGK3W.js";
5
- import {
6
- BaseCommand
7
- } from "../../chunk-2HK7RGZB.js";
8
- import "../../chunk-R56PH7YE.js";
9
- import "../../chunk-GQNJO2P2.js";
10
- import "../../chunk-37LN5O7M.js";
11
- import "../../chunk-EKJ2CABV.js";
12
- import "../../chunk-ZUJBM6HE.js";
13
- import "../../chunk-W2YERO7E.js";
14
- import "../../chunk-NSBPE2FW.js";
15
-
16
- // src/commands/proxy/stop.ts
17
- import { spawnSync } from "node:child_process";
18
- import { existsSync, readFileSync, unlinkSync } from "node:fs";
19
- import { homedir } from "node:os";
20
- import { dirname, join, resolve } from "node:path";
21
- import { fileURLToPath } from "node:url";
22
- var MODULE_DIR = dirname(fileURLToPath(import.meta.url));
23
- var CONFIG_DIR = join(homedir(), ".config", "rulemetric");
24
- var PID_FILE = join(CONFIG_DIR, "proxy.pid");
25
- var ProxyStop = class _ProxyStop extends BaseCommand {
26
- static description = "Stop the context capture proxy";
27
- static examples = ["<%= config.bin %> proxy stop"];
28
- async run() {
29
- await this.parse(_ProxyStop);
30
- if (!existsSync(PID_FILE)) {
31
- this.log("No proxy process found (no PID file).");
32
- return;
33
- }
34
- const content = readFileSync(PID_FILE, "utf-8").trim();
35
- if (content.startsWith("docker:")) {
36
- const containerName = content.slice("docker:".length);
37
- const composeFile = this.findComposeFile();
38
- if (composeFile) {
39
- spawnSync("docker", ["compose", "-f", composeFile, "stop", "proxy"], { stdio: "inherit" });
40
- spawnSync("docker", ["compose", "-f", composeFile, "rm", "-f", "proxy"], { stdio: "ignore" });
41
- } else {
42
- spawnSync("docker", ["stop", containerName], { stdio: "ignore" });
43
- spawnSync("docker", ["rm", containerName], { stdio: "ignore" });
44
- }
45
- this.log(`Proxy container stopped.`);
46
- try {
47
- unlinkSync(PID_FILE);
48
- } catch {
49
- }
50
- return;
51
- }
52
- const pid = Number.parseInt(content, 10);
53
- if (Number.isNaN(pid)) {
54
- unlinkSync(PID_FILE);
55
- this.log("Invalid PID file removed.");
56
- return;
57
- }
58
- if (isPidLiveAndMatching(pid, MITMPROXY_COMMAND_PATTERN)) {
59
- try {
60
- process.kill(pid, "SIGTERM");
61
- this.log(`Proxy stopped (PID ${pid}).`);
62
- } catch (err) {
63
- const code = err.code;
64
- if (code === "ESRCH") {
65
- this.log("Proxy process not running (stale PID file removed).");
66
- } else {
67
- this.error(`Failed to stop proxy: ${err.message}`);
68
- }
69
- }
70
- } else {
71
- this.log("Proxy process not running (stale PID file removed).");
72
- }
73
- try {
74
- unlinkSync(PID_FILE);
75
- } catch {
76
- }
77
- this.log("");
78
- this.log("Gateway is still running \u2014 Claude Code will route direct until proxy restarts.");
79
- }
80
- findComposeFile() {
81
- const candidates = [
82
- join(process.cwd(), "docker-compose.yml"),
83
- resolve(MODULE_DIR, "../../../../../docker-compose.yml")
84
- ];
85
- for (const p of candidates) {
86
- if (existsSync(p)) return p;
87
- }
88
- return null;
89
- }
90
- };
91
- export {
92
- ProxyStop as default
93
- };
94
- //# sourceMappingURL=stop.js.map
1
+ import{b as m,d as a}from"../../chunk-SZ62CP55.js";import{a as d}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as l}from"../../chunk-ZLLER3HP.js";import{spawnSync as s}from"node:child_process";import{existsSync as f,readFileSync as y,unlinkSync as n}from"node:fs";import{homedir as h}from"node:os";import{dirname as g,join as p,resolve as x}from"node:path";import{fileURLToPath as I}from"node:url";var P=g(I(import.meta.url)),k=p(h(),".config","rulemetric"),t=p(k,"proxy.pid"),c=class u extends d{static{l(this,"ProxyStop")}static description="Stop the context capture proxy";static examples=["<%= config.bin %> proxy stop"];async run(){if(await this.parse(u),!f(t)){this.log("No proxy process found (no PID file).");return}let e=y(t,"utf-8").trim();if(e.startsWith("docker:")){let r=e.slice(7),i=this.findComposeFile();i?(s("docker",["compose","-f",i,"stop","proxy"],{stdio:"inherit"}),s("docker",["compose","-f",i,"rm","-f","proxy"],{stdio:"ignore"})):(s("docker",["stop",r],{stdio:"ignore"}),s("docker",["rm",r],{stdio:"ignore"})),this.log("Proxy container stopped.");try{n(t)}catch{}return}let o=Number.parseInt(e,10);if(Number.isNaN(o)){n(t),this.log("Invalid PID file removed.");return}if(a(o,m))try{process.kill(o,"SIGTERM"),this.log(`Proxy stopped (PID ${o}).`)}catch(r){r.code==="ESRCH"?this.log("Proxy process not running (stale PID file removed)."):this.error(`Failed to stop proxy: ${r.message}`)}else this.log("Proxy process not running (stale PID file removed).");try{n(t)}catch{}this.log(""),this.log("Gateway is still running \u2014 Claude Code will route direct until proxy restarts.")}findComposeFile(){let e=[p(process.cwd(),"docker-compose.yml"),x(P,"../../../../../docker-compose.yml")];for(let o of e)if(f(o))return o;return null}};export{c as default};
@@ -1,59 +1 @@
1
- import {
2
- scanAllTranscripts
3
- } from "../../chunk-WA4MWYRW.js";
4
- import {
5
- postObservations
6
- } from "../../chunk-Y3WD5CSW.js";
7
- import {
8
- BaseCommand
9
- } from "../../chunk-2HK7RGZB.js";
10
- import "../../chunk-R56PH7YE.js";
11
- import "../../chunk-GQNJO2P2.js";
12
- import "../../chunk-37LN5O7M.js";
13
- import "../../chunk-EKJ2CABV.js";
14
- import "../../chunk-ZUJBM6HE.js";
15
- import "../../chunk-W2YERO7E.js";
16
- import "../../chunk-NSBPE2FW.js";
17
-
18
- // src/commands/research/backfill.ts
19
- import { Flags } from "@oclif/core";
20
- import path from "node:path";
21
- import os from "node:os";
22
- var ResearchBackfill = class _ResearchBackfill extends BaseCommand {
23
- static description = "Scan every ~/.claude/projects transcript for past rate-limit (429) events and POST them as observations. Opt-in seed for the usage-research dataset \u2014 forward-only tail is the default capture path.";
24
- static examples = [
25
- "<%= config.bin %> research backfill",
26
- "<%= config.bin %> research backfill --claude-dir /custom/.claude --dry-run"
27
- ];
28
- static flags = {
29
- "claude-dir": Flags.string({
30
- description: "Override the Claude Code projects directory",
31
- default: path.join(os.homedir(), ".claude")
32
- }),
33
- "dry-run": Flags.boolean({
34
- description: "Print observation count without POSTing",
35
- default: false
36
- })
37
- };
38
- async run() {
39
- const { flags } = await this.parse(_ResearchBackfill);
40
- this.requireAuth();
41
- this.log(`Scanning ${path.join(flags["claude-dir"], "projects")} for rate-limit events...`);
42
- const observations = await scanAllTranscripts(flags["claude-dir"]);
43
- this.log(`Found ${observations.length} rate-limit observation(s).`);
44
- if (observations.length === 0) return;
45
- if (flags["dry-run"]) {
46
- this.log("Dry run \u2014 nothing posted.");
47
- return;
48
- }
49
- const result = await postObservations(observations);
50
- this.log(`Posted ${result.posted} observation(s); ${result.failed} failed.`);
51
- if (result.failed > 0) {
52
- for (const e of result.errors) this.warn(e);
53
- }
54
- }
55
- };
56
- export {
57
- ResearchBackfill as default
58
- };
59
- //# sourceMappingURL=backfill.js.map
1
+ import{e as a}from"../../chunk-NVKX36YN.js";import{b as n}from"../../chunk-2UC3ULIG.js";import{a as s}from"../../chunk-LQRYQE6Q.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-CRAKDQ4H.js";import"../../chunk-WPJ2BND4.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-TIQ7DQ3M.js";import"../../chunk-M6AJDVCL.js";import{a as o}from"../../chunk-ZLLER3HP.js";import{Flags as d}from"@oclif/core";import l from"node:path";import u from"node:os";var i=class c extends s{static{o(this,"ResearchBackfill")}static description="Scan every ~/.claude/projects transcript for past rate-limit (429) events and POST them as observations. Opt-in seed for the usage-research dataset \u2014 forward-only tail is the default capture path.";static examples=["<%= config.bin %> research backfill","<%= config.bin %> research backfill --claude-dir /custom/.claude --dry-run"];static flags={"claude-dir":d.string({description:"Override the Claude Code projects directory",default:l.join(u.homedir(),".claude")}),"dry-run":d.boolean({description:"Print observation count without POSTing",default:!1})};async run(){let{flags:r}=await this.parse(c);this.requireAuth(),this.log(`Scanning ${l.join(r["claude-dir"],"projects")} for rate-limit events...`);let e=await a(r["claude-dir"]);if(this.log(`Found ${e.length} rate-limit observation(s).`),e.length===0)return;if(r["dry-run"]){this.log("Dry run \u2014 nothing posted.");return}let t=await n(e);if(this.log(`Posted ${t.posted} observation(s); ${t.failed} failed.`),t.failed>0)for(let f of t.errors)this.warn(f)}};export{i as default};