@rulemetric/cli 0.18.1 → 0.19.1

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 (285) hide show
  1. package/dist/base-command.js +1 -1
  2. package/dist/{chunk-WLLIFRRE.js → chunk-2EXQM3UF.js} +1 -1
  3. package/dist/chunk-2RZDFKX4.js +1 -0
  4. package/dist/{chunk-NSO2EBYE.js → chunk-2WRP6ZJF.js} +1 -1
  5. package/dist/chunk-35NZJWFC.js +4 -0
  6. package/dist/{chunk-3ZHBOILE.js → chunk-45CCW25C.js} +1 -1
  7. package/dist/{chunk-NMCQ7JZZ.js → chunk-52RILE5M.js} +1 -1
  8. package/dist/{chunk-O7ZQEKND.js → chunk-5O62P6KC.js} +1 -1
  9. package/dist/chunk-6WX3AXMI.js +1 -0
  10. package/dist/{chunk-ENW5SUQJ.js → chunk-6XCD343D.js} +1 -1
  11. package/dist/chunk-6Z4JNHBO.js +1 -0
  12. package/dist/{chunk-MJLW5KN2.js → chunk-75H3CKWA.js} +1 -1
  13. package/dist/{chunk-XAGNGQL3.js → chunk-7CQBFCHP.js} +1 -1
  14. package/dist/{chunk-ZFEDOPRU.js → chunk-AEIKPNLG.js} +1 -1
  15. package/dist/{chunk-XCN2YPWI.js → chunk-ANPGOUIO.js} +1 -1
  16. package/dist/chunk-B56GMANB.js +1 -0
  17. package/dist/{chunk-CXENLSMR.js → chunk-B5FBLLKT.js} +1 -1
  18. package/dist/{chunk-KIQK7NVF.js → chunk-CLPIN7TY.js} +1 -1
  19. package/dist/{chunk-4LVSD2XZ.js → chunk-DRX65ZLX.js} +1 -1
  20. package/dist/{chunk-5VWVQCNR.js → chunk-E5FI5YHO.js} +1 -1
  21. package/dist/{chunk-7MQZPDDZ.js → chunk-E6O2IFOK.js} +1 -1
  22. package/dist/{chunk-BOYWPUV2.js → chunk-EA3X4TAE.js} +1 -1
  23. package/dist/{chunk-AZWY2DOT.js → chunk-EBGVDX3Z.js} +1 -1
  24. package/dist/{chunk-FGGESTXG.js → chunk-EYRM7BT4.js} +1 -1
  25. package/dist/chunk-FD272ZXG.js +2 -0
  26. package/dist/chunk-FKUFJWII.js +1 -0
  27. package/dist/chunk-G2MRNA45.js +1 -0
  28. package/dist/{chunk-C3XWDYZJ.js → chunk-G2UGWEMO.js} +1 -1
  29. package/dist/chunk-GRTEWHXU.js +5 -0
  30. package/dist/{chunk-RRBFKVCI.js → chunk-HEO56SKT.js} +1 -1
  31. package/dist/chunk-HRU6WGCG.js +1 -0
  32. package/dist/{chunk-MHLHLJ5T.js → chunk-I2U5GNNM.js} +2 -2
  33. package/dist/{chunk-AZRGURHR.js → chunk-ICULHHNZ.js} +1 -1
  34. package/dist/{chunk-BRYURAUN.js → chunk-ID47WFUP.js} +1 -1
  35. package/dist/chunk-IQOBKWVY.js +5 -0
  36. package/dist/chunk-JE2JX7IJ.js +4 -0
  37. package/dist/chunk-JVTSJFFI.js +1 -0
  38. package/dist/{chunk-D7L7IMJQ.js → chunk-K2PI3OGV.js} +1 -1
  39. package/dist/chunk-K4LO27GG.js +1 -0
  40. package/dist/chunk-KCX2YDC3.js +1 -0
  41. package/dist/{chunk-5LTJNYCP.js → chunk-KTLRSRHF.js} +1 -1
  42. package/dist/{chunk-K65DDLTZ.js → chunk-LKOUL3IF.js} +1 -1
  43. package/dist/{chunk-GWQ24FQP.js → chunk-LQRXWLFJ.js} +1 -1
  44. package/dist/{chunk-A2JFQUDW.js → chunk-NI6RDOZ5.js} +1 -1
  45. package/dist/{chunk-JCZOEIL7.js → chunk-NJKPUZNM.js} +1 -1
  46. package/dist/{chunk-PPQFN62M.js → chunk-NN4M476J.js} +1 -1
  47. package/dist/chunk-NX3PF3EQ.js +1 -0
  48. package/dist/{chunk-7J7H7YFQ.js → chunk-O662MWOR.js} +1 -1
  49. package/dist/{chunk-UROUVE3D.js → chunk-OHMVGDWQ.js} +1 -1
  50. package/dist/{chunk-RQBN7WNS.js → chunk-OLOECA5V.js} +7 -7
  51. package/dist/{chunk-IYX65N6T.js → chunk-ONDOPTSL.js} +1 -1
  52. package/dist/chunk-ONSRPEUQ.js +7 -0
  53. package/dist/{chunk-UQJNUESP.js → chunk-OT7ZUHJF.js} +1 -1
  54. package/dist/{chunk-CAQLSYOK.js → chunk-PCSSIYH6.js} +1 -1
  55. package/dist/chunk-PD4BUQ2X.js +1 -0
  56. package/dist/{chunk-WSUKOU3X.js → chunk-PRC5N4NB.js} +1 -1
  57. package/dist/chunk-Q37D6V2G.js +2 -0
  58. package/dist/chunk-Q42RXJ4R.js +1 -0
  59. package/dist/{chunk-3EZZGA72.js → chunk-RFLO7L5X.js} +1 -1
  60. package/dist/{chunk-QRKMRG6W.js → chunk-RR5EE23Q.js} +1 -1
  61. package/dist/{chunk-5U5SHJJA.js → chunk-RYMQMJ7O.js} +1 -1
  62. package/dist/chunk-S7ZQTZNB.js +3 -0
  63. package/dist/{chunk-LELSVLNK.js → chunk-SFZSHNZZ.js} +1 -1
  64. package/dist/{chunk-7N55TWYQ.js → chunk-T7DAU6DV.js} +1 -1
  65. package/dist/{chunk-HNPC5U3C.js → chunk-TUSFCQBL.js} +1 -1
  66. package/dist/chunk-UFRJ75FW.js +1 -0
  67. package/dist/{chunk-I2FPXRA6.js → chunk-VGBATQZ3.js} +1 -1
  68. package/dist/{chunk-NAS7FIGM.js → chunk-WLLSWFAJ.js} +1 -1
  69. package/dist/chunk-WUDHDZOG.js +1 -0
  70. package/dist/{chunk-A6JUIZ3H.js → chunk-WYDRKFXO.js} +1 -1
  71. package/dist/{chunk-LSZ32DUR.js → chunk-XPVI6H2L.js} +1 -1
  72. package/dist/{chunk-IPNBW7ZW.js → chunk-XQEI7NOC.js} +1 -1
  73. package/dist/{chunk-EKTNI6RV.js → chunk-Y6VBAURK.js} +1 -1
  74. package/dist/chunk-YMIO3CVV.js +2 -0
  75. package/dist/{chunk-RAMQVEJB.js → chunk-YRGNBYZZ.js} +1 -1
  76. package/dist/{chunk-TQFHRD5B.js → chunk-Z7LBSVG3.js} +1 -1
  77. package/dist/{chunk-ANLPPIMS.js → chunk-ZFIGOHQ6.js} +1 -1
  78. package/dist/chunk-ZVCKDNBT.js +1 -0
  79. package/dist/commands/antigravity/backfill.js +1 -1
  80. package/dist/commands/auth/create-key.js +1 -1
  81. package/dist/commands/auth/login.js +1 -1
  82. package/dist/commands/auth/logout.js +1 -1
  83. package/dist/commands/auth/revoke-key.js +1 -1
  84. package/dist/commands/auth/signup.js +1 -1
  85. package/dist/commands/auth/status.js +1 -1
  86. package/dist/commands/capture/scope.js +1 -1
  87. package/dist/commands/catalog/index.js +1 -1
  88. package/dist/commands/catalog/recommend.js +1 -1
  89. package/dist/commands/crons/list.js +1 -1
  90. package/dist/commands/crons/run.js +1 -1
  91. package/dist/commands/dashboard.js +1 -1
  92. package/dist/commands/diagnostics.js +1 -1
  93. package/dist/commands/eval-targets/create.js +1 -1
  94. package/dist/commands/eval-targets/list.js +1 -1
  95. package/dist/commands/evals/agent.js +3 -3
  96. package/dist/commands/evals/auto-run.js +1 -5
  97. package/dist/commands/evals/benchmark.js +1 -1
  98. package/dist/commands/evals/compare.js +1 -31
  99. package/dist/commands/evals/create.js +1 -1
  100. package/dist/commands/evals/optimize-description.js +1 -59
  101. package/dist/commands/evals/optimize.js +1 -5
  102. package/dist/commands/evals/refine-cases.js +1 -1
  103. package/dist/commands/evals/run.js +1 -3
  104. package/dist/commands/evals/validate-judge.js +1 -1
  105. package/dist/commands/experiments/enroll.js +1 -0
  106. package/dist/commands/experiments/list.js +1 -1
  107. package/dist/commands/gateway/ensure.js +1 -1
  108. package/dist/commands/hooks/install.js +1 -1
  109. package/dist/commands/hooks/run.js +1 -1
  110. package/dist/commands/hooks/uninstall.js +1 -1
  111. package/dist/commands/instructions/create.js +1 -1
  112. package/dist/commands/instructions/dedupe.js +1 -1
  113. package/dist/commands/instructions/delete.js +1 -1
  114. package/dist/commands/instructions/fork.js +1 -1
  115. package/dist/commands/instructions/get.js +1 -1
  116. package/dist/commands/instructions/list.js +1 -1
  117. package/dist/commands/instructions/promote.js +1 -1
  118. package/dist/commands/instructions/pull.js +1 -1
  119. package/dist/commands/instructions/restore.js +1 -1
  120. package/dist/commands/instructions/retract.js +1 -1
  121. package/dist/commands/instructions/upstream.js +1 -1
  122. package/dist/commands/instructions/versions.js +1 -1
  123. package/dist/commands/launcher.js +1 -1
  124. package/dist/commands/local/down.js +1 -1
  125. package/dist/commands/local/up.js +1 -1
  126. package/dist/commands/org/current.js +1 -1
  127. package/dist/commands/org/list.js +1 -1
  128. package/dist/commands/org/switch.js +1 -1
  129. package/dist/commands/packs/add-instruction.js +1 -1
  130. package/dist/commands/packs/apply.js +1 -1
  131. package/dist/commands/packs/create.js +1 -1
  132. package/dist/commands/packs/fork.js +1 -1
  133. package/dist/commands/packs/get.js +1 -1
  134. package/dist/commands/packs/list.js +1 -1
  135. package/dist/commands/packs/remove-instruction.js +1 -1
  136. package/dist/commands/proxy/env.js +1 -1
  137. package/dist/commands/proxy/logs.js +1 -1
  138. package/dist/commands/proxy/restart.js +1 -1
  139. package/dist/commands/proxy/setup.js +1 -1
  140. package/dist/commands/proxy/start.js +1 -1
  141. package/dist/commands/proxy/status.js +1 -1
  142. package/dist/commands/proxy/stop.js +1 -1
  143. package/dist/commands/research/backfill.js +1 -1
  144. package/dist/commands/research/resume-scoped-outcomes.js +1 -1
  145. package/dist/commands/research/tail-transcript.js +1 -1
  146. package/dist/commands/service/install.js +37 -37
  147. package/dist/commands/service/status.js +1 -1
  148. package/dist/commands/service/uninstall.js +1 -1
  149. package/dist/commands/service/updates.js +1 -0
  150. package/dist/commands/sessions/analyze.js +1 -1
  151. package/dist/commands/sessions/delete.js +1 -1
  152. package/dist/commands/sessions/end.js +1 -1
  153. package/dist/commands/sessions/import.js +1 -1
  154. package/dist/commands/sessions/list.js +1 -1
  155. package/dist/commands/sessions/start.js +1 -1
  156. package/dist/commands/setup.js +1 -1
  157. package/dist/commands/skills/export-approved.js +1 -1
  158. package/dist/commands/skills/install.js +1 -1
  159. package/dist/commands/skills/list.js +1 -1
  160. package/dist/commands/skills/publish.js +1 -1
  161. package/dist/commands/skills/search.js +1 -1
  162. package/dist/commands/skills/update.js +1 -1
  163. package/dist/commands/suggestions/accept.js +1 -1
  164. package/dist/commands/suggestions/auto.js +1 -1
  165. package/dist/commands/suggestions/dismiss.js +1 -1
  166. package/dist/commands/suggestions/list.js +1 -1
  167. package/dist/commands/suggestions/refresh.js +1 -1
  168. package/dist/commands/suggestions/undo.js +1 -1
  169. package/dist/dashboard/Dashboard.js +1 -1
  170. package/dist/dashboard/data.js +1 -1
  171. package/dist/dashboard/launcher/LauncherOverlay.js +1 -1
  172. package/dist/dashboard/launcher/api.js +1 -1
  173. package/dist/dashboard/launcher/useLaunchJobs.js +1 -1
  174. package/dist/dashboard/panels/measurement.js +1 -1
  175. package/dist/dashboard/telemetry.js +1 -1
  176. package/dist/{dist-ZJY72TUD.js → dist-TNM2RNPT.js} +1 -1
  177. package/dist/lib/active-org-refresh.js +1 -1
  178. package/dist/lib/agent-loop.js +1 -1
  179. package/dist/lib/agent-presence.js +1 -1
  180. package/dist/lib/antigravity-transcript.js +1 -1
  181. package/dist/lib/api-client.js +1 -1
  182. package/dist/lib/case-refinement-policy.js +1 -0
  183. package/dist/lib/discovery-evidence.js +1 -0
  184. package/dist/lib/discovery-repository.js +1 -0
  185. package/dist/lib/ensure-api-key.js +1 -1
  186. package/dist/lib/ensure-fresh-token.js +1 -1
  187. package/dist/lib/eval-benchmark.js +1 -1
  188. package/dist/lib/eval-candidate-run.js +1 -1
  189. package/dist/lib/eval-case-generator.js +1 -1
  190. package/dist/lib/eval-compare.js +1 -1
  191. package/dist/lib/eval-conversation-handler.js +1 -1
  192. package/dist/lib/eval-quota-gate.js +1 -1
  193. package/dist/lib/eval-resume.js +1 -1
  194. package/dist/lib/eval-run-batch.js +1 -1
  195. package/dist/lib/eval-trigger-tester.js +8 -1
  196. package/dist/lib/insights/generation/installed-asks.js +1 -1
  197. package/dist/lib/insights/generation/project-evidence.js +1 -1
  198. package/dist/lib/insights/generation/quality-review.js +1 -1
  199. package/dist/lib/insights/nomination/nominate.js +1 -1
  200. package/dist/lib/instruction-proposer.js +16 -1
  201. package/dist/lib/instruction-restoration.js +1 -1
  202. package/dist/lib/instructions/acceptance/accept-events.js +1 -1
  203. package/dist/lib/instructions/acceptance/accept-hook.js +1 -1
  204. package/dist/lib/instructions/acceptance/hook-install.js +1 -1
  205. package/dist/lib/instructions/acceptance/reverse-applications.js +1 -1
  206. package/dist/lib/instructions/acceptance/suggestion-accept.js +1 -1
  207. package/dist/lib/jobs/handlers/cron-auto-accept-suggestions.js +1 -1
  208. package/dist/lib/jobs/handlers/cron-eval-autorun.js +1 -1
  209. package/dist/lib/jobs/handlers/cron-instruction-training.js +1 -1
  210. package/dist/lib/jobs/handlers/cron-reconcile-attribution.js +1 -1
  211. package/dist/lib/jobs/handlers/cron-refine-cases.js +1 -1
  212. package/dist/lib/jobs/handlers/cron-refresh-pricing.js +1 -1
  213. package/dist/lib/jobs/handlers/cron-retire-unused-skills.js +1 -1
  214. package/dist/lib/jobs/handlers/cron-suggest-instructions.js +1 -1
  215. package/dist/lib/jobs/handlers/distill-memories.js +1 -1
  216. package/dist/lib/jobs/handlers/finalize-scoped-launch.js +1 -1
  217. package/dist/lib/jobs/handlers/harbor-ab.js +1 -1
  218. package/dist/lib/jobs/handlers/prepare-isolated-launch.js +1 -0
  219. package/dist/lib/jobs/handlers/prepare-suggestion-live.js +1 -1
  220. package/dist/lib/jobs/handlers/process-changelog.js +1 -1
  221. package/dist/lib/jobs/handlers/process-conversation.js +1 -1
  222. package/dist/lib/jobs/handlers/process-eval.js +1 -1
  223. package/dist/lib/jobs/handlers/process-insights.js +1 -1
  224. package/dist/lib/jobs/handlers/process-judge-review.js +1 -1
  225. package/dist/lib/jobs/handlers/process-launch.js +1 -1
  226. package/dist/lib/jobs/handlers/process-run-cleanup.js +1 -1
  227. package/dist/lib/jobs/handlers/process-session-goal.js +1 -1
  228. package/dist/lib/jobs/handlers/process-suggestion-adoption.js +1 -1
  229. package/dist/lib/jobs/handlers/process-suggestion-discovery.js +1 -1
  230. package/dist/lib/jobs/handlers/process-suggestion-eval.js +1 -1
  231. package/dist/lib/jobs/handlers/restore-instruction.js +1 -0
  232. package/dist/lib/jobs/shed-retry.js +1 -1
  233. package/dist/lib/judge-review-runner.js +1 -1
  234. package/dist/lib/llm-client.js +1 -1
  235. package/dist/lib/manual-tasks.js +1 -1
  236. package/dist/lib/projects/workspace/worktree.js +1 -1
  237. package/dist/lib/refine-cases.js +1 -1
  238. package/dist/lib/research-client.js +1 -1
  239. package/dist/lib/retraction.js +1 -1
  240. package/dist/lib/session-updates.js +1 -1
  241. package/dist/lib/setup-steps.js +1 -1
  242. package/dist/lib/study-result-store.js +1 -0
  243. package/dist/lib/suggestion-discovery.js +1 -1
  244. package/dist/lib/telemetry.js +1 -1
  245. package/dist/lib/terminal-target-heartbeat.js +1 -1
  246. package/dist/lib/transcript-sync.js +1 -1
  247. package/dist/lib/work-report.js +1 -1
  248. package/dist/lib/worker-updates.js +1 -0
  249. package/oclif.manifest.json +322 -199
  250. package/package.json +7 -7
  251. package/dist/chunk-2C7CFCMM.js +0 -1
  252. package/dist/chunk-647M2I2Y.js +0 -1
  253. package/dist/chunk-7OTOAC6C.js +0 -8
  254. package/dist/chunk-A6XQSO62.js +0 -4
  255. package/dist/chunk-AHLVY52I.js +0 -1
  256. package/dist/chunk-BDWQ6J4V.js +0 -1
  257. package/dist/chunk-BU3ZGLQG.js +0 -1
  258. package/dist/chunk-CJ2WSSHD.js +0 -1
  259. package/dist/chunk-DTTR4EUJ.js +0 -1
  260. package/dist/chunk-DZRBB34J.js +0 -16
  261. package/dist/chunk-FLJTAD2R.js +0 -1
  262. package/dist/chunk-G7V4ZZZ3.js +0 -1
  263. package/dist/chunk-GHUW7P55.js +0 -2
  264. package/dist/chunk-GYKYJJNF.js +0 -1
  265. package/dist/chunk-KFNFLMUR.js +0 -3
  266. package/dist/chunk-KOIFFSYW.js +0 -2
  267. package/dist/chunk-KR32Y5Q5.js +0 -1
  268. package/dist/chunk-L5ILEWHH.js +0 -1
  269. package/dist/chunk-LZPE6424.js +0 -5
  270. package/dist/chunk-MRQIYIQE.js +0 -1
  271. package/dist/chunk-NLUHMHPM.js +0 -1
  272. package/dist/chunk-NVOYP4HX.js +0 -1
  273. package/dist/chunk-P577DWWL.js +0 -1
  274. package/dist/chunk-PMMHMRFS.js +0 -1
  275. package/dist/chunk-R26SQ3BE.js +0 -5
  276. package/dist/chunk-RITL4NU3.js +0 -1
  277. package/dist/chunk-RWQG25JU.js +0 -1
  278. package/dist/chunk-YZQZD2E6.js +0 -1
  279. package/dist/chunk-ZJABRHIP.js +0 -1
  280. package/dist/lib/eval-accumulation.js +0 -1
  281. package/dist/lib/evolution-cost.js +0 -1
  282. package/dist/lib/evolution-enrolment.js +0 -1
  283. package/dist/lib/jobs/handlers/cron-instruction-evolution.js +0 -1
  284. package/dist/lib/jobs/handlers/process-memory-ab.js +0 -1
  285. package/dist/lib/optimize-compare.js +0 -1
@@ -1 +1 @@
1
- import{a as n}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{f as r}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as i}from"../../chunk-ZLLER3HP.js";import*as o from"node:fs";import{Args as l,Flags as d}from"@oclif/core";var e=class a extends n{static{i(this,"SessionsImport")}static description="Import a session file (JSONL, JSON)";static examples=["<%= config.bin %> sessions import ~/.claude/projects/my-project/session-abc.jsonl","<%= config.bin %> sessions import ./copilot-export.json --tool vscode_copilot"];static args={path:l.string({description:"Path to session file",required:!0})};static flags={tool:d.string({description:"Override tool detection (claude_code, cursor, vscode_copilot)"})};async run(){let{args:t,flags:c}=await this.parse(a);this.requireAuth(),o.existsSync(t.path)||this.error(`File not found: ${t.path}`);let p=o.readFileSync(t.path,"utf-8"),s=await r("/api/sessions/import",{content:p,tool:c.tool});this.log(`Imported session ${s.id} (${s.tool}, ${s.eventCount} events)`)}};export{e as default};
1
+ import{a as n}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as r}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as i}from"../../chunk-ZLLER3HP.js";import*as o from"node:fs";import{Args as l,Flags as d}from"@oclif/core";var e=class a extends n{static{i(this,"SessionsImport")}static description="Import a session file (JSONL, JSON)";static examples=["<%= config.bin %> sessions import ~/.claude/projects/my-project/session-abc.jsonl","<%= config.bin %> sessions import ./copilot-export.json --tool vscode_copilot"];static args={path:l.string({description:"Path to session file",required:!0})};static flags={tool:d.string({description:"Override tool detection (claude_code, cursor, vscode_copilot)"})};async run(){let{args:t,flags:c}=await this.parse(a);this.requireAuth(),o.existsSync(t.path)||this.error(`File not found: ${t.path}`);let p=o.readFileSync(t.path,"utf-8"),s=await r("/api/sessions/import",{content:p,tool:c.tool});this.log(`Imported session ${s.id} (${s.tool}, ${s.eventCount} events)`)}};export{e as default};
@@ -1 +1 @@
1
- import{a as l}from"../../chunk-RQBN7WNS.js";import{a}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{e as r}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as n}from"../../chunk-ZLLER3HP.js";import{Flags as c}from"@oclif/core";var o=class d extends a{static{n(this,"SessionsList")}static description="List captured sessions";static examples=["<%= config.bin %> sessions list","<%= config.bin %> sessions list --tool claude_code","<%= config.bin %> sessions list --tool codex"];static flags={tool:c.string({description:`Filter by tool (${l.join(", ")})`}),limit:c.integer({description:"Max results",default:20})};async run(){let{flags:e}=await this.parse(d);this.requireAuth();let s=new URLSearchParams;e.tool&&s.set("tool",e.tool),s.set("limit",String(e.limit));let i=await r(`/api/sessions?${s}`);if(i.length===0){this.log("No sessions found.");return}for(let t of i){let p=t.projectPath?.split("/").pop()??"\u2014",m=t.analysis?.adherenceScore!=null?`${t.analysis.adherenceScore}%`:"\u2014",u=new Date(t.startedAt).toLocaleDateString();this.log(`${t.id.slice(0,8)} ${t.tool.padEnd(15)} ${p.padEnd(20)} ${String(t.eventCount).padStart(5)} events ${m.padStart(4)} adherence ${u}`)}}};export{o as default};
1
+ import{a as l}from"../../chunk-OLOECA5V.js";import{a}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as r}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as n}from"../../chunk-ZLLER3HP.js";import{Flags as c}from"@oclif/core";var o=class d extends a{static{n(this,"SessionsList")}static description="List captured sessions";static examples=["<%= config.bin %> sessions list","<%= config.bin %> sessions list --tool claude_code","<%= config.bin %> sessions list --tool codex"];static flags={tool:c.string({description:`Filter by tool (${l.join(", ")})`}),limit:c.integer({description:"Max results",default:20})};async run(){let{flags:e}=await this.parse(d);this.requireAuth();let s=new URLSearchParams;e.tool&&s.set("tool",e.tool),s.set("limit",String(e.limit));let i=await r(`/api/sessions?${s}`);if(i.length===0){this.log("No sessions found.");return}for(let t of i){let p=t.projectPath?.split("/").pop()??"\u2014",m=t.analysis?.adherenceScore!=null?`${t.analysis.adherenceScore}%`:"\u2014",u=new Date(t.startedAt).toLocaleDateString();this.log(`${t.id.slice(0,8)} ${t.tool.padEnd(15)} ${p.padEnd(20)} ${String(t.eventCount).padStart(5)} events ${m.padStart(4)} adherence ${u}`)}}};export{o as default};
@@ -1,3 +1,3 @@
1
- import{a as g}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import{a as m}from"../../chunk-3AV3GTMP.js";import{f as p}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as d}from"../../chunk-ZLLER3HP.js";import{Flags as h}from"@oclif/core";import{randomUUID as w}from"node:crypto";import{mkdirSync as j,writeFileSync as u}from"node:fs";import{tmpdir as S}from"node:os";import{join as f}from"node:path";import{execSync as v}from"node:child_process";var i=class x extends g{static{d(this,"SessionsStart")}static description="Start a capture session for any LLM provider (Cortex, Groq, etc.)";static examples=["<%= config.bin %> sessions start --tool cortex","<%= config.bin %> sessions start --tool groq --project-dir /path/to/project",'eval "$(rulemetric proxy env --python)" && rulemetric sessions start --tool cortex'];static flags={tool:h.string({char:"t",required:!0,description:"LLM provider or tool name (e.g., cortex, groq, deepseek, custom_app)"}),"project-dir":h.string({char:"d",description:"Project directory (defaults to cwd)"})};async run(){let{flags:r}=await this.parse(x);this.requireAuth();let t=r["project-dir"]??process.cwd(),s=w(),o="";try{o=v("git branch --show-current 2>/dev/null",{cwd:t,encoding:"utf-8"}).trim()}catch{}let e="";try{e=v("git remote get-url origin 2>/dev/null",{cwd:t,encoding:"utf-8"}).trim()}catch{}let n={};e&&(n.gitRemote=e);let y=m(),c=await p("/api/sessions",{tool:r.tool,externalSessionId:s,projectPath:t,gitBranch:o,metadata:n,orgId:y?.orgId??null}),a=f(S(),"rulemetric");j(a,{recursive:!0});let l=f(a,s);u(l,c.id+`
1
+ import{a as g}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import{a as m}from"../../chunk-3AV3GTMP.js";import{f as p}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as d}from"../../chunk-ZLLER3HP.js";import{Flags as h}from"@oclif/core";import{randomUUID as w}from"node:crypto";import{mkdirSync as j,writeFileSync as u}from"node:fs";import{tmpdir as S}from"node:os";import{join as f}from"node:path";import{execSync as v}from"node:child_process";var i=class x extends g{static{d(this,"SessionsStart")}static description="Start a capture session for any LLM provider (Cortex, Groq, etc.)";static examples=["<%= config.bin %> sessions start --tool cortex","<%= config.bin %> sessions start --tool groq --project-dir /path/to/project",'eval "$(rulemetric proxy env --python)" && rulemetric sessions start --tool cortex'];static flags={tool:h.string({char:"t",required:!0,description:"LLM provider or tool name (e.g., cortex, groq, deepseek, custom_app)"}),"project-dir":h.string({char:"d",description:"Project directory (defaults to cwd)"})};async run(){let{flags:r}=await this.parse(x);this.requireAuth();let t=r["project-dir"]??process.cwd(),s=w(),o="";try{o=v("git branch --show-current 2>/dev/null",{cwd:t,encoding:"utf-8"}).trim()}catch{}let e="";try{e=v("git remote get-url origin 2>/dev/null",{cwd:t,encoding:"utf-8"}).trim()}catch{}let n={};e&&(n.gitRemote=e);let y=m(),c=await p("/api/sessions",{tool:r.tool,externalSessionId:s,projectPath:t,gitBranch:o,metadata:n,orgId:y?.orgId??null}),a=f(S(),"rulemetric");j(a,{recursive:!0});let l=f(a,s);u(l,c.id+`
2
2
  `),u(l+".seq",`0
3
3
  `),this.log(`Session started: ${c.id}`),this.log(` Tool: ${r.tool}`),this.log(` Project: ${t}`),o&&this.log(` Branch: ${o}`),this.log(""),this.log("The proxy will now capture LLM traffic for this session."),this.log("When done, run: rulemetric sessions end")}};export{i as default};
@@ -1,3 +1,3 @@
1
- import{c as l,d as h,f as m,g as p,h as f,i as y,j as r}from"../chunk-LSZ32DUR.js";import"../chunk-QWCEZEDO.js";import"../chunk-KKDHD4XA.js";import"../chunk-SZ62CP55.js";import"../chunk-OZQNSELV.js";import"../chunk-HFGO5762.js";import"../chunk-VS5ROGDP.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import{a as g}from"../chunk-TQFHRD5B.js";import"../chunk-IZTIYR5Q.js";import"../chunk-5LTJNYCP.js";import"../chunk-3EZZGA72.js";import"../chunk-XAGNGQL3.js";import"../chunk-3AV3GTMP.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import{a as u}from"../chunk-ZLLER3HP.js";import{Args as b,Flags as c}from"@oclif/core";import*as w from"node:readline/promises";var d=class v extends g{static{u(this,"Setup")}static description="Agentic, transparent setup: plan / show diffs / apply the four core onboarding steps";static examples=["<%= config.bin %> setup # interactive walk (TTY)","<%= config.bin %> setup plan # read-only: every remaining artifact + diff","<%= config.bin %> setup hooks --show # print one step's diff","<%= config.bin %> setup hooks --apply # apply one step","<%= config.bin %> setup --json # machine-readable status (exit 0 iff complete)"];static args={target:b.string({description:`"plan" or a step id (${l.join(", ")})`,required:!1})};static flags={json:c.boolean({description:"Machine-readable output",default:!1}),show:c.boolean({description:"Print the step diff (read-only)",default:!1}),apply:c.boolean({description:"Apply the step",default:!1})};async run(){let{args:t,flags:e}=await this.parse(v),i=h();if(t.target==="plan"){await this.runPlan(i,e.json);return}if(t.target&&y(t.target)){if(e.apply){await f(t.target).apply(i);return}let n=await f(t.target).plan(i);this.printPlan(n);return}if(t.target&&this.error(`Unknown target "${t.target}". Use "plan" or one of: ${l.join(", ")}.`),e.json){let n=await r(i);this.log(JSON.stringify(n,null,2)),n.coreComplete||this.exit(1);return}await this.runInteractive(i)}async runPlan(t,e){let i=await r(t),n=p.filter(s=>!i.steps.find(a=>a.id===s.id)?.done),o=[];for(let s of n)o.push(await s.plan(t));if(e){this.log(JSON.stringify({...i,plans:o},null,2));return}if(o.length===0){this.log("[OK] All core steps complete \u2014 nothing to install.");return}this.log(`The following steps would be applied:
1
+ import{c as l,d as h,f as m,g as p,h as f,i as y,j as r}from"../chunk-XPVI6H2L.js";import"../chunk-QWCEZEDO.js";import"../chunk-KKDHD4XA.js";import"../chunk-SZ62CP55.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-OZQNSELV.js";import"../chunk-HFGO5762.js";import"../chunk-VS5ROGDP.js";import{a as g}from"../chunk-Z7LBSVG3.js";import"../chunk-IZTIYR5Q.js";import"../chunk-RFLO7L5X.js";import"../chunk-KTLRSRHF.js";import"../chunk-7CQBFCHP.js";import"../chunk-3AV3GTMP.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import{a as u}from"../chunk-ZLLER3HP.js";import{Args as b,Flags as c}from"@oclif/core";import*as w from"node:readline/promises";var d=class v extends g{static{u(this,"Setup")}static description="Agentic, transparent setup: plan / show diffs / apply the four core onboarding steps";static examples=["<%= config.bin %> setup # interactive walk (TTY)","<%= config.bin %> setup plan # read-only: every remaining artifact + diff","<%= config.bin %> setup hooks --show # print one step's diff","<%= config.bin %> setup hooks --apply # apply one step","<%= config.bin %> setup --json # machine-readable status (exit 0 iff complete)"];static args={target:b.string({description:`"plan" or a step id (${l.join(", ")})`,required:!1})};static flags={json:c.boolean({description:"Machine-readable output",default:!1}),show:c.boolean({description:"Print the step diff (read-only)",default:!1}),apply:c.boolean({description:"Apply the step",default:!1})};async run(){let{args:t,flags:e}=await this.parse(v),i=h();if(t.target==="plan"){await this.runPlan(i,e.json);return}if(t.target&&y(t.target)){if(e.apply){await f(t.target).apply(i);return}let n=await f(t.target).plan(i);this.printPlan(n);return}if(t.target&&this.error(`Unknown target "${t.target}". Use "plan" or one of: ${l.join(", ")}.`),e.json){let n=await r(i);this.log(JSON.stringify(n,null,2)),n.coreComplete||this.exit(1);return}await this.runInteractive(i)}async runPlan(t,e){let i=await r(t),n=p.filter(s=>!i.steps.find(a=>a.id===s.id)?.done),o=[];for(let s of n)o.push(await s.plan(t));if(e){this.log(JSON.stringify({...i,plans:o},null,2));return}if(o.length===0){this.log("[OK] All core steps complete \u2014 nothing to install.");return}this.log(`The following steps would be applied:
2
2
  `);for(let s of o)this.printPlan(s),this.log("")}printPlan(t){this.log(`[..] ${t.title} (${t.id})`),t.command&&this.log(` command: ${t.command}`);for(let e of t.artifacts){this.log(` ${e.kind}: ${e.path}${e.masked?" (secret masked)":""}`);let i=m(e.before,e.after);for(let n of i.split(`
3
3
  `))this.log(` ${n}`)}}async runInteractive(t){if(!process.stdin.isTTY){this.log("Not a TTY \u2014 interactive walk needs a terminal."),this.log("Use one of:"),this.log(" rulemetric setup plan \u2014 see every remaining artifact + diff"),this.log(" rulemetric setup <step> --show \u2014 print one step diff"),this.log(" rulemetric setup <step> --apply \u2014 apply one step"),this.log(" rulemetric setup --json \u2014 machine-readable status");return}let e=await r(t),i=p.filter(o=>!e.steps.find(s=>s.id===o.id)?.done);if(i.length===0){this.log("[OK] All core steps complete.");return}let n=w.createInterface({input:process.stdin,output:process.stdout});try{for(let o of i){let s=await o.plan(t);this.printPlan(s);let a=(await n.question(`Apply "${s.title}"? [y/N] `)).trim().toLowerCase();a==="y"||a==="yes"?(await o.apply(t),this.log(`[OK] Applied ${s.title}.`)):this.log(`[..] Skipped ${s.title}.`),this.log("")}}finally{n.close()}}};export{d as default};
@@ -1 +1 @@
1
- import{a as e}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{e as r}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";import*as a from"node:fs";import*as n from"node:path";import{Flags as m}from"@oclif/core";var t=class p extends e{static{o(this,"SkillsExportApproved")}static description="Export approved community submissions as community-skills.json for registry merge";static examples=["<%= config.bin %> skills export-approved","<%= config.bin %> skills export-approved --output ./community-skills.json"];static flags={output:m.string({description:"Output file path",default:"packages/skills-registry/community-skills.json"})};async run(){let{flags:l}=await this.parse(p);this.requireAuth();let s=await r("/api/skills/submissions/approved");if(s.length===0){this.log("No approved submissions to export.");return}let i=n.resolve(l.output);a.writeFileSync(i,JSON.stringify(s,null,2)),this.log(`Exported ${s.length} approved skills to ${i}`)}};export{t as default};
1
+ import{a as e}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as r}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as o}from"../../chunk-ZLLER3HP.js";import*as a from"node:fs";import*as n from"node:path";import{Flags as m}from"@oclif/core";var t=class p extends e{static{o(this,"SkillsExportApproved")}static description="Export approved community submissions as community-skills.json for registry merge";static examples=["<%= config.bin %> skills export-approved","<%= config.bin %> skills export-approved --output ./community-skills.json"];static flags={output:m.string({description:"Output file path",default:"packages/skills-registry/community-skills.json"})};async run(){let{flags:l}=await this.parse(p);this.requireAuth();let s=await r("/api/skills/submissions/approved");if(s.length===0){this.log("No approved submissions to export.");return}let i=n.resolve(l.output);a.writeFileSync(i,JSON.stringify(s,null,2)),this.log(`Exported ${s.length} approved skills to ${i}`)}};export{t as default};
@@ -1,4 +1,4 @@
1
- import{a as p}from"../../chunk-CDI5CCHU.js";import{a as s,b as l,g}from"../../chunk-UPFH72PF.js";import{a as c}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as d}from"../../chunk-ZLLER3HP.js";import*as o from"node:path";import{Args as u,Flags as r}from"@oclif/core";var a=class h extends c{static{d(this,"SkillsInstall")}static description="Install a skill from the registry into your project";static examples=["<%= config.bin %> skills install tdd-workflow","<%= config.bin %> skills install tdd-workflow --preview","<%= config.bin %> skills install tdd-workflow --force"];static args={id:u.string({description:"Skill ID to install",required:!0})};static flags={tool:r.string({description:"Deprecated and ignored \u2014 skills install to every agent path at once",options:["claude_code","cursor","copilot"],hidden:!0}),preview:r.boolean({description:"Preview content without writing",default:!1}),dir:r.string({description:"Project directory",default:"."}),force:r.boolean({description:"Replace an existing skill directory at the Claude Code path",default:!1})};async run(){let{args:n,flags:e}=await this.parse(h),i=(await p(this)).get(n.id);if(i||this.error(`Skill "${n.id}" not found. Try: rulemetric skills search`),i.kind==="supporting"&&this.warn(`"${n.id}" is supporting material for another skill (${i.source.path}), not a standalone skill. Installing it gives you that one file.`),e.preview){this.log(`
1
+ import{a as p}from"../../chunk-CDI5CCHU.js";import{a as s,b as l,g}from"../../chunk-UPFH72PF.js";import{a as c}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as d}from"../../chunk-ZLLER3HP.js";import*as o from"node:path";import{Args as u,Flags as r}from"@oclif/core";var a=class h extends c{static{d(this,"SkillsInstall")}static description="Install a skill from the registry into your project";static examples=["<%= config.bin %> skills install tdd-workflow","<%= config.bin %> skills install tdd-workflow --preview","<%= config.bin %> skills install tdd-workflow --force"];static args={id:u.string({description:"Skill ID to install",required:!0})};static flags={tool:r.string({description:"Deprecated and ignored \u2014 skills install to every agent path at once",options:["claude_code","cursor","copilot"],hidden:!0}),preview:r.boolean({description:"Preview content without writing",default:!1}),dir:r.string({description:"Project directory",default:"."}),force:r.boolean({description:"Replace an existing skill directory at the Claude Code path",default:!1})};async run(){let{args:n,flags:e}=await this.parse(h),i=(await p(this)).get(n.id);if(i||this.error(`Skill "${n.id}" not found. Try: rulemetric skills search`),i.kind==="supporting"&&this.warn(`"${n.id}" is supporting material for another skill (${i.source.path}), not a standalone skill. Installing it gives you that one file.`),e.preview){this.log(`
2
2
  ${i.name}`),this.log(`${"\u2500".repeat(i.name.length)}`),this.log(`Category: ${i.category}`),this.log(`Tools: ${i.tools.join(", ")}`),this.log(`Source: ${i.source.url}
3
3
  `),this.log(i.content.slice(0,2e3)),i.content.length>2e3&&this.log(`
4
4
  ... (${i.content.length-2e3} more characters)`);return}e.tool&&this.warn("--tool is ignored: a skill now installs to every agent path at once.");let f=o.resolve(e.dir),t=g({dir:f,name:i.id,content:i.content,description:i.description,force:e.force});this.log(`Installed "${i.name}" as ${t.dirName}`),this.log(` ${o.join(s,t.dirName,"SKILL.md")} (Cursor, Codex, Copilot, Gemini CLI, Cline, Amp, Warp, Zed, OpenCode)`),t.linkKind==="symlink"?this.log(` ${o.join(l,t.dirName)} -> ${o.join(s,t.dirName)} (Claude Code)`):t.linkKind==="copy"&&this.log(` ${o.join(l,t.dirName)} (Claude Code \u2014 copy, not a link)`);for(let m of t.warnings)this.warn(m);this.log(` Source: ${i.source.url}`)}};export{a as default};
@@ -1,4 +1,4 @@
1
- import{a as n}from"../../chunk-CDI5CCHU.js";import{a}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";import{Flags as g}from"@oclif/core";var e=class s extends a{static{r(this,"SkillsList")}static description="List skills in the registry";static examples=["<%= config.bin %> skills list","<%= config.bin %> skills list --stats"];static flags={stats:g.boolean({description:"Show registry statistics",default:!1}),limit:g.integer({description:"Max skills to show",default:30})};async run(){let{flags:t}=await this.parse(s),i=await n(this);if(t.stats){this.log(`Skills Registry Statistics
1
+ import{a as n}from"../../chunk-CDI5CCHU.js";import{a}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";import{Flags as g}from"@oclif/core";var e=class s extends a{static{r(this,"SkillsList")}static description="List skills in the registry";static examples=["<%= config.bin %> skills list","<%= config.bin %> skills list --stats"];static flags={stats:g.boolean({description:"Show registry statistics",default:!1}),limit:g.integer({description:"Max skills to show",default:30})};async run(){let{flags:t}=await this.parse(s),i=await n(this);if(t.stats){this.log(`Skills Registry Statistics
2
2
  `),this.log(` Total skills: ${i.size}`),this.log(` Categories: ${i.categories().join(", ")}`),this.log(` Tools: ${i.tools().join(", ")}`),this.log(` Top tags: ${i.tags().slice(0,15).join(", ")}`);return}let o=i.search({limit:t.limit});if(o.length===0){this.log("Registry is empty. Run: rulemetric skills update");return}this.log(`Showing ${o.length} of ${i.size} skills (sorted by popularity):
3
3
  `);for(let l of o){let h=l.popularity?.stars?`${u(l.popularity.stars)} stars`:"";this.log(` ${c(l.id,40)} ${c(l.category,14)} ${h}`)}this.log(`
4
4
  Search: rulemetric skills search <query>`),this.log("Install: rulemetric skills install <id>")}};function u(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}r(u,"formatStars");function c(s,t){return s.length>t?s.slice(0,t-1)+"\u2026":s.padEnd(t)}r(c,"pad");export{e as default};
@@ -1,2 +1,2 @@
1
- import{a as h}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{f as d}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as p}from"../../chunk-ZLLER3HP.js";import*as a from"node:fs";import*as i from"node:path";import{Args as k,Flags as o}from"@oclif/core";var c=class f extends h{static{p(this,"SkillsPublish")}static description="Submit a skill file to the RuleMetric skills registry";static examples=["<%= config.bin %> skills publish ./my-skill.md","<%= config.bin %> skills publish ./my-skill.md --category workflow --tool claude_code"];static args={file:k.string({description:"Path to skill file (.md)",required:!0})};static flags={name:o.string({description:"Skill name (defaults to filename)"}),description:o.string({description:"One-line description"}),category:o.string({description:"Skill category",options:["workflow","language","framework","tool","security","testing","architecture","devops","documentation","performance","other"],default:"other"}),tool:o.string({description:"Primary tool this skill targets",options:["claude_code","cursor","copilot","windsurf","universal"],default:"universal"}),tags:o.string({description:"Comma-separated tags",default:""})};async run(){let{args:u,flags:e}=await this.parse(f);this.requireAuth();let s=i.resolve(u.file);a.existsSync(s)||this.error(`File not found: ${s}`);let l=a.readFileSync(s,"utf-8");l.trim().length<20&&this.error("Skill content is too short (minimum 20 characters)");let g=i.basename(s,i.extname(s)),r=e.name??g.replace(/[-_]+/g," ").replace(/\b\w/g,t=>t.toUpperCase()),m=g.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),n=e.tags?e.tags.split(",").map(t=>t.trim()).filter(Boolean):[];this.log(`Publishing skill: ${r} (${m})`),this.log(` Category: ${e.category}`),this.log(` Tool: ${e.tool}`),n.length>0&&this.log(` Tags: ${n.join(", ")}`),this.log(` Content: ${l.length} characters
1
+ import{a as h}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as d}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as p}from"../../chunk-ZLLER3HP.js";import*as a from"node:fs";import*as i from"node:path";import{Args as k,Flags as o}from"@oclif/core";var c=class f extends h{static{p(this,"SkillsPublish")}static description="Submit a skill file to the RuleMetric skills registry";static examples=["<%= config.bin %> skills publish ./my-skill.md","<%= config.bin %> skills publish ./my-skill.md --category workflow --tool claude_code"];static args={file:k.string({description:"Path to skill file (.md)",required:!0})};static flags={name:o.string({description:"Skill name (defaults to filename)"}),description:o.string({description:"One-line description"}),category:o.string({description:"Skill category",options:["workflow","language","framework","tool","security","testing","architecture","devops","documentation","performance","other"],default:"other"}),tool:o.string({description:"Primary tool this skill targets",options:["claude_code","cursor","copilot","windsurf","universal"],default:"universal"}),tags:o.string({description:"Comma-separated tags",default:""})};async run(){let{args:u,flags:e}=await this.parse(f);this.requireAuth();let s=i.resolve(u.file);a.existsSync(s)||this.error(`File not found: ${s}`);let l=a.readFileSync(s,"utf-8");l.trim().length<20&&this.error("Skill content is too short (minimum 20 characters)");let g=i.basename(s,i.extname(s)),r=e.name??g.replace(/[-_]+/g," ").replace(/\b\w/g,t=>t.toUpperCase()),m=g.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),n=e.tags?e.tags.split(",").map(t=>t.trim()).filter(Boolean):[];this.log(`Publishing skill: ${r} (${m})`),this.log(` Category: ${e.category}`),this.log(` Tool: ${e.tool}`),n.length>0&&this.log(` Tags: ${n.join(", ")}`),this.log(` Content: ${l.length} characters
2
2
  `);let y={id:m,name:r,description:e.description??`Community skill: ${r}`,category:e.category,tools:[e.tool],tags:n,content:l};try{let t=await d("/api/skills/publish",y);this.log(`Published! ${t.message??`Skill "${r}" submitted to the registry.`}`)}catch(t){throw t instanceof Error&&this.error(`Failed to publish: ${t.message}`),t}}};export{c as default};
@@ -1,3 +1,3 @@
1
- import{a as n}from"../../chunk-CDI5CCHU.js";import{a}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as e}from"../../chunk-ZLLER3HP.js";import{Args as m,Flags as o}from"@oclif/core";var l=class r extends a{static{e(this,"SkillsSearch")}static description="Search the community skills registry";static examples=['<%= config.bin %> skills search "tdd"',"<%= config.bin %> skills search --tool cursor --category testing","<%= config.bin %> skills search --language python"];static args={query:m.string({description:"Search term",required:!1})};static flags={tool:o.string({description:"Filter by tool",options:["claude_code","cursor","copilot","windsurf","cline","universal"]}),category:o.string({description:"Filter by category",options:["workflow","language","framework","tool","security","testing","architecture","devops","documentation","performance"]}),language:o.string({description:"Filter by programming language"}),framework:o.string({description:"Filter by framework"}),limit:o.integer({description:"Max results",default:20})};async run(){let{args:g,flags:i}=await this.parse(r),s=(await n(this)).search({query:g.query,tool:i.tool,category:i.category,language:i.language,framework:i.framework,limit:i.limit});if(s.length===0){this.log("No skills found matching your criteria."),this.log(`
1
+ import{a as n}from"../../chunk-CDI5CCHU.js";import{a}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as e}from"../../chunk-ZLLER3HP.js";import{Args as m,Flags as o}from"@oclif/core";var l=class r extends a{static{e(this,"SkillsSearch")}static description="Search the community skills registry";static examples=['<%= config.bin %> skills search "tdd"',"<%= config.bin %> skills search --tool cursor --category testing","<%= config.bin %> skills search --language python"];static args={query:m.string({description:"Search term",required:!1})};static flags={tool:o.string({description:"Filter by tool",options:["claude_code","cursor","copilot","windsurf","cline","universal"]}),category:o.string({description:"Filter by category",options:["workflow","language","framework","tool","security","testing","architecture","devops","documentation","performance"]}),language:o.string({description:"Filter by programming language"}),framework:o.string({description:"Filter by framework"}),limit:o.integer({description:"Max results",default:20})};async run(){let{args:g,flags:i}=await this.parse(r),s=(await n(this)).search({query:g.query,tool:i.tool,category:i.category,language:i.language,framework:i.framework,limit:i.limit});if(s.length===0){this.log("No skills found matching your criteria."),this.log(`
2
2
  Try a broader search or run: rulemetric skills list`);return}this.log(`Found ${s.length} skill${s.length===1?"":"s"}:
3
3
  `);for(let t of s){let c=t.popularity?.stars?` (${p(t.popularity.stars)} stars)`:"",u=t.kind==="supporting"?" [supporting file]":"",d=t.tools.join(", ");this.log(` ${t.id}`),this.log(` ${t.name}${u} \u2014 ${t.description}`),this.log(` tools: ${d} category: ${t.category}${c}`),t.tags.length>0&&this.log(` tags: ${t.tags.join(", ")}`),this.log("")}this.log("Run: rulemetric skills install <id> to install a skill")}};function p(r){return r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}e(p,"formatStars");export{l as default};
@@ -1,3 +1,3 @@
1
- import{a as n}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as e}from"../../chunk-ZLLER3HP.js";import*as s from"node:fs";import*as r from"node:path";import*as m from"node:os";import{Flags as h}from"@oclif/core";import{fetchAllSources as y,TIER_1_SOURCES as c,TIER_2_SOURCES as S}from"@rulemetric/skills-registry";var i=r.join(m.homedir(),".config","rulemetric"),f=r.join(i,"skills-registry.json"),t=class g extends n{static{e(this,"SkillsUpdate")}static description="Fetch latest skills from GitHub sources and update local registry";static examples=["<%= config.bin %> skills update","<%= config.bin %> skills update --all"];static flags={all:h.boolean({description:"Include Tier 2 (niche) sources",default:!1})};async run(){let{flags:o}=await this.parse(g),l=o.all?[...c,...S]:c;this.log(`Fetching skills from ${l.length} sources${o.all?" (Tier 1 + 2)":""}...
1
+ import{a as n}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as e}from"../../chunk-ZLLER3HP.js";import*as s from"node:fs";import*as r from"node:path";import*as m from"node:os";import{Flags as h}from"@oclif/core";import{fetchAllSources as y,TIER_1_SOURCES as c,TIER_2_SOURCES as S}from"@rulemetric/skills-registry";var i=r.join(m.homedir(),".config","rulemetric"),f=r.join(i,"skills-registry.json"),t=class g extends n{static{e(this,"SkillsUpdate")}static description="Fetch latest skills from GitHub sources and update local registry";static examples=["<%= config.bin %> skills update","<%= config.bin %> skills update --all"];static flags={all:h.boolean({description:"Include Tier 2 (niche) sources",default:!1})};async run(){let{flags:o}=await this.parse(g),l=o.all?[...c,...S]:c;this.log(`Fetching skills from ${l.length} sources${o.all?" (Tier 1 + 2)":""}...
2
2
  `);let a=await y(l,{onProgress:e((p,u)=>{this.log(` ${p}: ${u} skills`)},"onProgress")}),d={version:"1.0.0",generatedAt:new Date().toISOString(),skills:a.entries};s.existsSync(i)||s.mkdirSync(i,{recursive:!0}),s.writeFileSync(f,JSON.stringify(d)),this.log(`
3
3
  Updated registry: ${a.entries.length} skills cached at ${f}`)}};export{t as default};
@@ -1 +1 @@
1
- import{a}from"../../chunk-WLVQJH4E.js";import{h as r}from"../../chunk-BOYWPUV2.js";import"../../chunk-ENW5SUQJ.js";import"../../chunk-C3XWDYZJ.js";import"../../chunk-CAQLSYOK.js";import"../../chunk-LJRE3LZ2.js";import{a as o}from"../../chunk-MODXEGCU.js";import"../../chunk-OZQNSELV.js";import"../../chunk-HFGO5762.js";import"../../chunk-VS5ROGDP.js";import"../../chunk-GYNZ3OZF.js";import"../../chunk-UPFH72PF.js";import{a as i}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Args as m,Flags as p}from"@oclif/core";var e=class c extends i{static{s(this,"SuggestionsAccept")}static description="Accept a suggestion and append the instruction to CLAUDE.md";static examples=["<%= config.bin %> suggestions accept <id>"];static args={id:m.string({description:"Suggestion UUID from `suggestions list`",required:!0})};static flags={force:p.boolean({description:"Add the rule even if this project already says the same thing in other words",default:!1})};async run(){let{args:t,flags:d}=await this.parse(c);this.requireAuth(),a(t.id,"suggestion ID");let n=await r({suggestionId:t.id,dir:process.cwd(),projectPath:o(process.cwd()),actor:"human",force:d.force});for(let g of n.messages)this.log(g)}};export{e as default};
1
+ import{a}from"../../chunk-WLVQJH4E.js";import{h as r}from"../../chunk-EA3X4TAE.js";import"../../chunk-6XCD343D.js";import"../../chunk-PCSSIYH6.js";import"../../chunk-G2UGWEMO.js";import"../../chunk-GYNZ3OZF.js";import"../../chunk-UPFH72PF.js";import"../../chunk-LJRE3LZ2.js";import{a as o}from"../../chunk-MODXEGCU.js";import"../../chunk-OZQNSELV.js";import"../../chunk-HFGO5762.js";import"../../chunk-VS5ROGDP.js";import{a as i}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as s}from"../../chunk-ZLLER3HP.js";import{Args as m,Flags as p}from"@oclif/core";var e=class c extends i{static{s(this,"SuggestionsAccept")}static description="Accept a suggestion and append the instruction to CLAUDE.md";static examples=["<%= config.bin %> suggestions accept <id>"];static args={id:m.string({description:"Suggestion UUID from `suggestions list`",required:!0})};static flags={force:p.boolean({description:"Add the rule even if this project already says the same thing in other words",default:!1})};async run(){let{args:t,flags:d}=await this.parse(c);this.requireAuth(),a(t.id,"suggestion ID");let n=await r({suggestionId:t.id,dir:process.cwd(),projectPath:o(process.cwd()),actor:"human",force:d.force});for(let g of n.messages)this.log(g)}};export{e as default};
@@ -1 +1 @@
1
- import{a as p}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{e as u,h as l}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as c}from"../../chunk-ZLLER3HP.js";import{Flags as t}from"@oclif/core";var d=class r extends p{static{c(this,"SuggestionsAuto")}static description="Show or change automatic adoption of high-confidence suggestions into CLAUDE.md";static examples=["<%= config.bin %> suggestions auto","<%= config.bin %> suggestions auto --off","<%= config.bin %> suggestions auto --on","<%= config.bin %> suggestions auto --off --project <project-id>"];static flags={on:t.boolean({description:"Enable automatic adoption",exclusive:["off"]}),off:t.boolean({description:"Disable automatic adoption",exclusive:["on"]}),project:t.string({description:"Apply to one project only (overrides the account default)"}),"max-per-window":t.integer({description:"How many rules the loop may adopt per project per window (0 stops it adopting)"}),"max-per-run":t.integer({description:"How many rules one nightly run may adopt"}),"window-days":t.integer({description:"Length of the budget window, in days"}),"min-score":t.string({description:"Minimum suggestion score the loop may adopt (0\u20131)"}),reset:t.boolean({description:"Clear the budget overrides at this level and fall back to the shipped defaults"})};async run(){let{flags:e}=await this.parse(r);this.requireAuth();let i=e.reset?{minScore:null,maxPerRun:null,maxPerWindow:null,windowDays:null}:{...e["min-score"]!==void 0?{minScore:Number(e["min-score"])}:{},...e["max-per-run"]!==void 0?{maxPerRun:e["max-per-run"]}:{},...e["max-per-window"]!==void 0?{maxPerWindow:e["max-per-window"]}:{},...e["window-days"]!==void 0?{windowDays:e["window-days"]}:{}},n=Object.keys(i).length>0;if(e.on||e.off||n){let s=e.on||e.off?!!e.on:void 0,g=await l("/api/settings/auto-accept",{...s!==void 0?{enabled:s}:{},...n?{limits:i}:{},...e.project?{projectId:e.project}:{}});if(n){let a=g.limits;this.log(`Budget for ${e.project?`project ${e.project}`:"your account"}: ${a.maxPerRun} per night, ${a.maxPerWindow} per ${a.windowDays} days, score >= ${a.minScore}.`)}if(s===void 0)return;let m=e.project?`project ${e.project}`:"your account";this.log(`Automatic adoption is now ${s?"ON":"OFF"} for ${m}.`),s||(this.log("Already-adopted rules stay in CLAUDE.md \u2014 remove one with:"),this.log(" rulemetric suggestions undo <instruction-id>"));return}let o=await u("/api/settings/auto-accept"+(e.project?`?projectId=${encodeURIComponent(e.project)}`:""));this.log(`Automatic adoption: ${o.effective?"ON":"OFF"} (from ${o.source})`),this.log(` account default: ${o.accountDefault?"on":"off"}`),e.project&&this.log(` project override: ${o.projectOverride===null?"none":o.projectOverride?"on":"off"}`),this.log(""),this.log("When on, the nightly loop may add \u2014 and only add \u2014 suggestions that:"),this.log(` \u2022 score >= ${o.limits.minScore} (already injected into every session)`),this.log(` \u2022 are '${o.limits.kind}' proposals; removals and trims always wait for you`),this.log(" \u2022 contain no unfilled placeholders"),this.log(` \u2022 at most ${o.limits.maxPerRun} per night, ${o.limits.maxPerWindow} per ${o.limits.windowDays} days \u2014 per PROJECT, counting every checkout of it (${f(o.limits.source)})`),this.log(""),this.log("Change the budget: rulemetric suggestions auto --max-per-window 20"),this.log("Back to defaults: rulemetric suggestions auto --reset"),this.log(""),this.log("Every adopted rule is a tagged block in CLAUDE.md; undo one with:"),this.log(" rulemetric suggestions undo <instruction-id>"),this.log("Turn it off entirely with: rulemetric suggestions auto --off")}};function f(r){let e=new Set(Object.values(r));if(e.size===1){let i=[...e][0];return i==="default"?"shipped defaults":`set on your ${i}`}return Object.entries(r).map(([i,n])=>`${i}: ${n}`).join(", ")}c(f,"describeSource");export{d as default};
1
+ import{a as p}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as u,h as l}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as c}from"../../chunk-ZLLER3HP.js";import{Flags as t}from"@oclif/core";var d=class r extends p{static{c(this,"SuggestionsAuto")}static description="Show or change automatic adoption of high-confidence suggestions into CLAUDE.md";static examples=["<%= config.bin %> suggestions auto","<%= config.bin %> suggestions auto --off","<%= config.bin %> suggestions auto --on","<%= config.bin %> suggestions auto --off --project <project-id>"];static flags={on:t.boolean({description:"Enable automatic adoption",exclusive:["off"]}),off:t.boolean({description:"Disable automatic adoption",exclusive:["on"]}),project:t.string({description:"Apply to one project only (overrides the account default)"}),"max-per-window":t.integer({description:"How many rules the loop may adopt per project per window (0 stops it adopting)"}),"max-per-run":t.integer({description:"How many rules one nightly run may adopt"}),"window-days":t.integer({description:"Length of the budget window, in days"}),"min-score":t.string({description:"Minimum suggestion score the loop may adopt (0\u20131)"}),reset:t.boolean({description:"Clear the budget overrides at this level and fall back to the shipped defaults"})};async run(){let{flags:e}=await this.parse(r);this.requireAuth();let i=e.reset?{minScore:null,maxPerRun:null,maxPerWindow:null,windowDays:null}:{...e["min-score"]!==void 0?{minScore:Number(e["min-score"])}:{},...e["max-per-run"]!==void 0?{maxPerRun:e["max-per-run"]}:{},...e["max-per-window"]!==void 0?{maxPerWindow:e["max-per-window"]}:{},...e["window-days"]!==void 0?{windowDays:e["window-days"]}:{}},n=Object.keys(i).length>0;if(e.on||e.off||n){let s=e.on||e.off?!!e.on:void 0,g=await l("/api/settings/auto-accept",{...s!==void 0?{enabled:s}:{},...n?{limits:i}:{},...e.project?{projectId:e.project}:{}});if(n){let a=g.limits;this.log(`Budget for ${e.project?`project ${e.project}`:"your account"}: ${a.maxPerRun} per night, ${a.maxPerWindow} per ${a.windowDays} days, score >= ${a.minScore}.`)}if(s===void 0)return;let m=e.project?`project ${e.project}`:"your account";this.log(`Automatic adoption is now ${s?"ON":"OFF"} for ${m}.`),s||(this.log("Already-adopted rules stay in CLAUDE.md \u2014 remove one with:"),this.log(" rulemetric suggestions undo <instruction-id>"));return}let o=await u("/api/settings/auto-accept"+(e.project?`?projectId=${encodeURIComponent(e.project)}`:""));this.log(`Automatic adoption: ${o.effective?"ON":"OFF"} (from ${o.source})`),this.log(` account default: ${o.accountDefault?"on":"off"}`),e.project&&this.log(` project override: ${o.projectOverride===null?"none":o.projectOverride?"on":"off"}`),this.log(""),this.log("When on, the nightly loop may add \u2014 and only add \u2014 suggestions that:"),this.log(` \u2022 score >= ${o.limits.minScore} (already injected into every session)`),this.log(` \u2022 are '${o.limits.kind}' proposals; removals and trims always wait for you`),this.log(" \u2022 contain no unfilled placeholders"),this.log(` \u2022 at most ${o.limits.maxPerRun} per night, ${o.limits.maxPerWindow} per ${o.limits.windowDays} days \u2014 per PROJECT, counting every checkout of it (${f(o.limits.source)})`),this.log(""),this.log("Change the budget: rulemetric suggestions auto --max-per-window 20"),this.log("Back to defaults: rulemetric suggestions auto --reset"),this.log(""),this.log("Every adopted rule is a tagged block in CLAUDE.md; undo one with:"),this.log(" rulemetric suggestions undo <instruction-id>"),this.log("Turn it off entirely with: rulemetric suggestions auto --off")}};function f(r){let e=new Set(Object.values(r));if(e.size===1){let i=[...e][0];return i==="default"?"shipped defaults":`set on your ${i}`}return Object.entries(r).map(([i,n])=>`${i}: ${n}`).join(", ")}c(f,"describeSource");export{d as default};
@@ -1 +1 @@
1
- import{a}from"../../chunk-WLVQJH4E.js";import{a as r}from"../../chunk-MODXEGCU.js";import{a as o}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{f as t}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as e}from"../../chunk-ZLLER3HP.js";import{Args as m}from"@oclif/core";var s=class n extends o{static{e(this,"SuggestionsDismiss")}static description="Dismiss a suggestion so it will not re-surface for 30 days";static examples=["<%= config.bin %> suggestions dismiss <id>"];static args={id:m.string({description:"Suggestion UUID from `suggestions list`",required:!0})};async run(){let{args:i}=await this.parse(n);this.requireAuth(),a(i.id,"suggestion ID");let d=r(process.cwd());await t(`/api/instruction-suggestions/${encodeURIComponent(i.id)}/events`,{eventType:"dismissed",projectPath:d}),this.log("Dismissed. Won't re-surface for 30 days.")}};export{s as default};
1
+ import{a}from"../../chunk-WLVQJH4E.js";import{a as r}from"../../chunk-MODXEGCU.js";import{a as o}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as t}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as e}from"../../chunk-ZLLER3HP.js";import{Args as m}from"@oclif/core";var s=class n extends o{static{e(this,"SuggestionsDismiss")}static description="Dismiss a suggestion so it will not re-surface for 30 days";static examples=["<%= config.bin %> suggestions dismiss <id>"];static args={id:m.string({description:"Suggestion UUID from `suggestions list`",required:!0})};async run(){let{args:i}=await this.parse(n);this.requireAuth(),a(i.id,"suggestion ID");let d=r(process.cwd());await t(`/api/instruction-suggestions/${encodeURIComponent(i.id)}/events`,{eventType:"dismissed",projectPath:d}),this.log("Dismissed. Won't re-surface for 30 days.")}};export{s as default};
@@ -1,3 +1,3 @@
1
- import{a as u}from"../../chunk-MODXEGCU.js";import{a as g}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{e as d}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import{Flags as j}from"@oclif/core";import{printTable as v}from"@oclif/table";var r=class p extends g{static{a(this,"SuggestionsList")}static description="List instruction suggestions for a project";static examples=["<%= config.bin %> suggestions list","<%= config.bin %> suggestions list --project /path/to/project"];static flags={project:j.string({char:"p",description:"Project path (defaults to current directory)"})};async run(){let{flags:m}=await this.parse(p);this.requireAuth();let l=u(m.project??process.cwd()),f=encodeURIComponent(l),s=await d(`/api/instruction-suggestions?projectPath=${f}&limit=10&groupByKind=true`);if(s.suggestions.length===0){this.log("No suggestions for this project. They are recomputed daily at 04:30 UTC by a server-side cron and run on your background worker \u2014 make sure one is running (`rulemetric evals agent`, or `rulemetric service install --worker-only`).");return}v({data:s.suggestions.map(e=>({ID:e.id,Action:(e.kind??"add")==="add"?"add":(e.kind??"add").toUpperCase(),Scope:e.instructionScope,Name:e.name,Tokens:e.estimatedTokens?String(e.estimatedTokens):"-",Score:e.score.toFixed(2),Reason:e.reason.length>60?e.reason.slice(0,59)+"\u2026":e.reason})),columns:["ID","Action","Scope","Name","Tokens","Score","Reason"]});let o=s.suggestions.filter(e=>e.kind==="remove");if(o.length>0){let e=o.reduce((h,k)=>h+(k.estimatedTokens??0),0);this.log(`
1
+ import{a as u}from"../../chunk-MODXEGCU.js";import{a as g}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{e as d}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a}from"../../chunk-ZLLER3HP.js";import{Flags as j}from"@oclif/core";import{printTable as v}from"@oclif/table";var r=class p extends g{static{a(this,"SuggestionsList")}static description="List instruction suggestions for a project";static examples=["<%= config.bin %> suggestions list","<%= config.bin %> suggestions list --project /path/to/project"];static flags={project:j.string({char:"p",description:"Project path (defaults to current directory)"})};async run(){let{flags:m}=await this.parse(p);this.requireAuth();let l=u(m.project??process.cwd()),f=encodeURIComponent(l),s=await d(`/api/instruction-suggestions?projectPath=${f}&limit=10&groupByKind=true`);if(s.suggestions.length===0){this.log("No suggestions for this project. They are recomputed daily at 04:30 UTC by a server-side cron and run on your background worker \u2014 make sure one is running (`rulemetric evals agent`, or `rulemetric service install --worker-only`).");return}v({data:s.suggestions.map(e=>({ID:e.id,Action:(e.kind??"add")==="add"?"add":(e.kind??"add").toUpperCase(),Scope:e.instructionScope,Name:e.name,Tokens:e.estimatedTokens?String(e.estimatedTokens):"-",Score:e.score.toFixed(2),Reason:e.reason.length>60?e.reason.slice(0,59)+"\u2026":e.reason})),columns:["ID","Action","Scope","Name","Tokens","Score","Reason"]});let o=s.suggestions.filter(e=>e.kind==="remove");if(o.length>0){let e=o.reduce((h,k)=>h+(k.estimatedTokens??0),0);this.log(`
2
2
  ${o.length} retirement proposal(s) \u2014 accepting one archives the instruction (reversible: rulemetric instructions restore <instruction-id>).`+(e>0?` Together they cost roughly ${e} tokens of context per session.`:""))}let t=s.stats??{},i=(t.surfaced??0)+(t.surfaced_with_content??0)+(t.proxy_injected??0),n=(t.accepted??0)+(t.promoted??0),c=t.dismissed??0;i+n+c>0&&this.log(`
3
3
  Lifetime for this project: ${i} surfaced \xB7 ${n} accepted \xB7 ${c} dismissed`)}};export{r as default};
@@ -1 +1 @@
1
- import{a as i}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";var e=class extends i{static{r(this,"SuggestionsRefresh")}static description="Information about refreshing instruction suggestions";static examples=["<%= config.bin %> suggestions refresh"];async run(){this.log("Suggestions are recomputed automatically: a server-side cron enqueues a job daily at 04:30 UTC, and your background worker picks it up \u2014 there is no manual trigger."),this.log("Just make sure a worker is running: `rulemetric evals agent` (foreground), or install it persistently with `rulemetric service install --worker-only`.")}};export{e as default};
1
+ import{a as i}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as r}from"../../chunk-ZLLER3HP.js";var e=class extends i{static{r(this,"SuggestionsRefresh")}static description="Information about refreshing instruction suggestions";static examples=["<%= config.bin %> suggestions refresh"];async run(){this.log("Suggestions are recomputed automatically: a server-side cron enqueues a job daily at 04:30 UTC, and your background worker picks it up \u2014 there is no manual trigger."),this.log("Just make sure a worker is running: `rulemetric evals agent` (foreground), or install it persistently with `rulemetric service install --worker-only`.")}};export{e as default};
@@ -1 +1 @@
1
- import{a as f,c as g}from"../../chunk-UROUVE3D.js";import{a as l}from"../../chunk-WLVQJH4E.js";import{d as p}from"../../chunk-BOYWPUV2.js";import"../../chunk-ENW5SUQJ.js";import"../../chunk-C3XWDYZJ.js";import"../../chunk-CAQLSYOK.js";import"../../chunk-LJRE3LZ2.js";import{a as m}from"../../chunk-MODXEGCU.js";import"../../chunk-OZQNSELV.js";import"../../chunk-HFGO5762.js";import"../../chunk-VS5ROGDP.js";import{d as u}from"../../chunk-GYNZ3OZF.js";import"../../chunk-UPFH72PF.js";import{a as d}from"../../chunk-TQFHRD5B.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-5LTJNYCP.js";import"../../chunk-3EZZGA72.js";import"../../chunk-XAGNGQL3.js";import"../../chunk-3AV3GTMP.js";import{f as a}from"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as c}from"../../chunk-ZLLER3HP.js";import{relative as h}from"node:path";import{Args as P}from"@oclif/core";var o=class I extends d{static{c(this,"SuggestionsUndo")}static description="Remove an adopted instruction from this project's agent instruction files and stop it being re-proposed";static examples=["<%= config.bin %> suggestions undo <instruction-id>"];static args={instructionId:P.string({description:"Instruction ID from the rulemetric:start marker in the instruction file",required:!0})};async run(){let{args:r}=await this.parse(I);this.requireAuth(),l(r.instructionId,"instruction ID");let e=m(process.cwd()),i=process.cwd(),v=u(i).map(t=>h(i,t.path)),w=p(i,r.instructionId).map(t=>h(i,t.path)),A=await f({dir:process.cwd(),instructionId:r.instructionId,projectPath:e}),n=null,s=null;try{n=(await a("/api/instruction-suggestions/undo",{projectPath:e,instructionId:r.instructionId})).name}catch(t){s=t instanceof Error?t.message:String(t)}for(let t of g({stripped:w,searched:v,reversals:A,name:n,instructionId:r.instructionId,dismissalError:s}))this.log(t);s&&this.exit(1)}};export{o as default};
1
+ import{a as f,c as g}from"../../chunk-OHMVGDWQ.js";import{a as l}from"../../chunk-WLVQJH4E.js";import{d as p}from"../../chunk-EA3X4TAE.js";import"../../chunk-6XCD343D.js";import"../../chunk-PCSSIYH6.js";import"../../chunk-G2UGWEMO.js";import{d as u}from"../../chunk-GYNZ3OZF.js";import"../../chunk-UPFH72PF.js";import"../../chunk-LJRE3LZ2.js";import{a as m}from"../../chunk-MODXEGCU.js";import"../../chunk-OZQNSELV.js";import"../../chunk-HFGO5762.js";import"../../chunk-VS5ROGDP.js";import{a as d}from"../../chunk-Z7LBSVG3.js";import"../../chunk-IZTIYR5Q.js";import"../../chunk-RFLO7L5X.js";import"../../chunk-KTLRSRHF.js";import"../../chunk-7CQBFCHP.js";import"../../chunk-3AV3GTMP.js";import{f as a}from"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as c}from"../../chunk-ZLLER3HP.js";import{relative as h}from"node:path";import{Args as P}from"@oclif/core";var o=class I extends d{static{c(this,"SuggestionsUndo")}static description="Remove an adopted instruction from this project's agent instruction files and stop it being re-proposed";static examples=["<%= config.bin %> suggestions undo <instruction-id>"];static args={instructionId:P.string({description:"Instruction ID from the rulemetric:start marker in the instruction file",required:!0})};async run(){let{args:r}=await this.parse(I);this.requireAuth(),l(r.instructionId,"instruction ID");let e=m(process.cwd()),i=process.cwd(),v=u(i).map(t=>h(i,t.path)),w=p(i,r.instructionId).map(t=>h(i,t.path)),A=await f({dir:process.cwd(),instructionId:r.instructionId,projectPath:e}),n=null,s=null;try{n=(await a("/api/instruction-suggestions/undo",{projectPath:e,instructionId:r.instructionId})).name}catch(t){s=t instanceof Error?t.message:String(t)}for(let t of g({stripped:w,searched:v,reversals:A,name:n,instructionId:r.instructionId,dismissalError:s}))this.log(t);s&&this.exit(1)}};export{o as default};
@@ -1 +1 @@
1
- import{a as P}from"../chunk-YALBJNHO.js";import{a as E}from"../chunk-A6JUIZ3H.js";import{a as M}from"../chunk-DVN7GFJG.js";import{a as v}from"../chunk-O2SDD2WW.js";import{a as j}from"../chunk-XCN2YPWI.js";import{a as S}from"../chunk-WSCK4WNK.js";import{a as D}from"../chunk-4Z5ECCJE.js";import"../chunk-ARNZQBMX.js";import{a as B,b as k}from"../chunk-I2FPXRA6.js";import{a as h,b,d as l,e as R}from"../chunk-NJ5UED3H.js";import"../chunk-RQBN7WNS.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import{a as c}from"../chunk-ZLLER3HP.js";import{useState as T,useEffect as $,useCallback as G,useRef as it}from"react";import{render as U,Box as m,Text as i,useInput as rt,useApp as st}from"ink";import{Fragment as dt,jsx as t,jsxs as u}from"react/jsx-runtime";var nt=90;function J(){let n=process.stdout.columns||80,s=Math.min(160,n),e=s>=nt,f=e?Math.floor(s/2):s,g=Math.max(6,Math.min(10,f-34));return{dashWidth:s,wide:e,halfWidth:f,barWidth:g}}c(J,"getLayout");function z({active:n,providerName:s}){return u(m,{justifyContent:"space-between",paddingX:1,children:[t(m,{gap:1,children:h.map(e=>t(i,{bold:n===e,color:n===e?l:R,children:n===e?`[ ${b[e]} ]`:` ${b[e]} `},e))}),s&&t(i,{color:l,bold:!0,children:s})]})}c(z,"PeriodTabs");function H({width:n,insightsFocused:s=!1}){return t(m,{borderStyle:"round",borderColor:R,width:n,justifyContent:"center",paddingX:1,children:u(i,{children:[t(i,{color:l,bold:!0,children:"<"}),t(i,{color:l,children:">"}),t(i,{dimColor:!0,children:" switch "}),t(i,{color:l,bold:!0,children:"q"}),t(i,{dimColor:!0,children:" quit "}),t(i,{color:l,bold:!0,children:"s"}),u(i,{dimColor:!0,children:[" ",s?"back":"suggestions"," "]}),t(i,{color:l,bold:!0,children:"1"}),t(i,{dimColor:!0,children:"-"}),t(i,{color:l,bold:!0,children:"5"}),t(i,{dimColor:!0,children:" period "}),t(i,{color:l,bold:!0,children:"r"}),t(i,{dimColor:!0,children:" refresh "}),t(i,{color:l,bold:!0,children:"m"}),t(i,{dimColor:!0,children:" measurement"})]})})}c(H,"StatusBar");function at({wide:n,width:s,children:e}){return n?t(m,{width:s,children:e}):t(dt,{children:e})}c(at,"Row");function lt({initialLocal:n,initialApi:s,initialPeriod:e,initialTelemetry:f}){let{exit:g}=st(),[r,C]=T(e),[K,Q]=T(n),[W,V]=T(s),[F,Z]=T(f),[tt,O]=T(!1),[_,Y]=T(!1),[p,I]=T(!1),L=it(null),et=J(),x=G(async()=>{O(!0);let[o,d]=await Promise.all([B(),k()]);Q(o),V(d),O(!1)},[]);$(()=>{let o=!1,d,y=c(async()=>{let A=await E();o||(Z(A),d=setTimeout(y,6e4))},"poll");return d=setTimeout(y,6e4),()=>{o=!0,clearTimeout(d)}},[]),$(()=>{let o=setInterval(x,3e4);return()=>clearInterval(o)},[x]);let w=G(o=>{o!==r&&(C(o),L.current&&clearTimeout(L.current),L.current=setTimeout(x,300))},[r,x]);rt((o,d)=>{if(_)return;if(o==="q"){if(p){I(!1);return}g();return}if(o==="s"){I(A=>!A);return}if(d.escape&&p){I(!1);return}if(o==="m"&&!p){Y(!0);return}if(p)return;if(o==="r"){x();return}let y=h.indexOf(r);d.leftArrow?w(h[(y-1+h.length)%h.length]):d.rightArrow||d.tab?w(h[(y+1)%h.length]):o==="1"?w("today"):o==="2"?w("week"):o==="3"?w("30days"):o==="4"?w("month"):o==="5"&&w("all")});let{dashWidth:a,wide:q,halfWidth:ot,barWidth:N}=et,X=q?ot:a;return _?t(j,{width:a,onClose:()=>Y(!1)}):tt?u(m,{flexDirection:"column",width:a,children:[t(z,{active:r}),t(m,{borderStyle:"round",borderColor:l,paddingX:1,width:a,children:u(i,{dimColor:!0,children:["Loading ",b[r],"..."]})}),t(P,{checks:F,width:a}),t(H,{width:a})]}):u(m,{flexDirection:"column",width:a,children:[t(z,{active:r}),t(D,{local:K,api:W,label:b[r],width:a}),t(P,{checks:F,width:a}),u(at,{wide:q,width:a,children:[t(S,{api:W,width:X,barWidth:N}),t(M,{api:W,width:X,barWidth:N})]}),t(v,{api:W,width:a,focused:p}),t(H,{width:a,insightsFocused:p})]})}c(lt,"InteractiveDashboard");async function Wt(n="week"){let[s,e,f]=await Promise.all([B(),k(),E()]);if(process.stdin.isTTY&&process.stdout.isTTY){let{waitUntilExit:r}=U(t(lt,{initialLocal:s,initialApi:e,initialPeriod:n,initialTelemetry:f}));await r()}else{let r=J(),{unmount:C}=U(u(m,{flexDirection:"column",width:r.dashWidth,children:[t(D,{local:s,api:e,label:b[n],width:r.dashWidth}),t(P,{checks:f,width:r.dashWidth}),t(S,{api:e,width:r.dashWidth,barWidth:r.barWidth}),t(M,{api:e,width:r.dashWidth,barWidth:r.barWidth}),t(v,{api:e,width:r.dashWidth})]}),{patchConsole:!1});C()}}c(Wt,"renderDashboard");export{Wt as renderDashboard};
1
+ import{a as S}from"../chunk-WSCK4WNK.js";import{a as D}from"../chunk-4Z5ECCJE.js";import{a as P}from"../chunk-YALBJNHO.js";import{a as E}from"../chunk-WYDRKFXO.js";import{a as M}from"../chunk-DVN7GFJG.js";import{a as v}from"../chunk-O2SDD2WW.js";import"../chunk-ARNZQBMX.js";import{a as j}from"../chunk-ANPGOUIO.js";import{a as B,b as k}from"../chunk-VGBATQZ3.js";import{a as h,b,d as l,e as R}from"../chunk-NJ5UED3H.js";import"../chunk-OLOECA5V.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import{a as c}from"../chunk-ZLLER3HP.js";import{useState as T,useEffect as $,useCallback as G,useRef as it}from"react";import{render as U,Box as m,Text as i,useInput as rt,useApp as st}from"ink";import{Fragment as dt,jsx as t,jsxs as u}from"react/jsx-runtime";var nt=90;function J(){let n=process.stdout.columns||80,s=Math.min(160,n),e=s>=nt,f=e?Math.floor(s/2):s,g=Math.max(6,Math.min(10,f-34));return{dashWidth:s,wide:e,halfWidth:f,barWidth:g}}c(J,"getLayout");function z({active:n,providerName:s}){return u(m,{justifyContent:"space-between",paddingX:1,children:[t(m,{gap:1,children:h.map(e=>t(i,{bold:n===e,color:n===e?l:R,children:n===e?`[ ${b[e]} ]`:` ${b[e]} `},e))}),s&&t(i,{color:l,bold:!0,children:s})]})}c(z,"PeriodTabs");function H({width:n,insightsFocused:s=!1}){return t(m,{borderStyle:"round",borderColor:R,width:n,justifyContent:"center",paddingX:1,children:u(i,{children:[t(i,{color:l,bold:!0,children:"<"}),t(i,{color:l,children:">"}),t(i,{dimColor:!0,children:" switch "}),t(i,{color:l,bold:!0,children:"q"}),t(i,{dimColor:!0,children:" quit "}),t(i,{color:l,bold:!0,children:"s"}),u(i,{dimColor:!0,children:[" ",s?"back":"suggestions"," "]}),t(i,{color:l,bold:!0,children:"1"}),t(i,{dimColor:!0,children:"-"}),t(i,{color:l,bold:!0,children:"5"}),t(i,{dimColor:!0,children:" period "}),t(i,{color:l,bold:!0,children:"r"}),t(i,{dimColor:!0,children:" refresh "}),t(i,{color:l,bold:!0,children:"m"}),t(i,{dimColor:!0,children:" measurement"})]})})}c(H,"StatusBar");function at({wide:n,width:s,children:e}){return n?t(m,{width:s,children:e}):t(dt,{children:e})}c(at,"Row");function lt({initialLocal:n,initialApi:s,initialPeriod:e,initialTelemetry:f}){let{exit:g}=st(),[r,C]=T(e),[K,Q]=T(n),[W,V]=T(s),[F,Z]=T(f),[tt,O]=T(!1),[_,Y]=T(!1),[p,I]=T(!1),L=it(null),et=J(),x=G(async()=>{O(!0);let[o,d]=await Promise.all([B(),k()]);Q(o),V(d),O(!1)},[]);$(()=>{let o=!1,d,y=c(async()=>{let A=await E();o||(Z(A),d=setTimeout(y,6e4))},"poll");return d=setTimeout(y,6e4),()=>{o=!0,clearTimeout(d)}},[]),$(()=>{let o=setInterval(x,3e4);return()=>clearInterval(o)},[x]);let w=G(o=>{o!==r&&(C(o),L.current&&clearTimeout(L.current),L.current=setTimeout(x,300))},[r,x]);rt((o,d)=>{if(_)return;if(o==="q"){if(p){I(!1);return}g();return}if(o==="s"){I(A=>!A);return}if(d.escape&&p){I(!1);return}if(o==="m"&&!p){Y(!0);return}if(p)return;if(o==="r"){x();return}let y=h.indexOf(r);d.leftArrow?w(h[(y-1+h.length)%h.length]):d.rightArrow||d.tab?w(h[(y+1)%h.length]):o==="1"?w("today"):o==="2"?w("week"):o==="3"?w("30days"):o==="4"?w("month"):o==="5"&&w("all")});let{dashWidth:a,wide:q,halfWidth:ot,barWidth:N}=et,X=q?ot:a;return _?t(j,{width:a,onClose:()=>Y(!1)}):tt?u(m,{flexDirection:"column",width:a,children:[t(z,{active:r}),t(m,{borderStyle:"round",borderColor:l,paddingX:1,width:a,children:u(i,{dimColor:!0,children:["Loading ",b[r],"..."]})}),t(P,{checks:F,width:a}),t(H,{width:a})]}):u(m,{flexDirection:"column",width:a,children:[t(z,{active:r}),t(D,{local:K,api:W,label:b[r],width:a}),t(P,{checks:F,width:a}),u(at,{wide:q,width:a,children:[t(S,{api:W,width:X,barWidth:N}),t(M,{api:W,width:X,barWidth:N})]}),t(v,{api:W,width:a,focused:p}),t(H,{width:a,insightsFocused:p})]})}c(lt,"InteractiveDashboard");async function Wt(n="week"){let[s,e,f]=await Promise.all([B(),k(),E()]);if(process.stdin.isTTY&&process.stdout.isTTY){let{waitUntilExit:r}=U(t(lt,{initialLocal:s,initialApi:e,initialPeriod:n,initialTelemetry:f}));await r()}else{let r=J(),{unmount:C}=U(u(m,{flexDirection:"column",width:r.dashWidth,children:[t(D,{local:s,api:e,label:b[n],width:r.dashWidth}),t(P,{checks:f,width:r.dashWidth}),t(S,{api:e,width:r.dashWidth,barWidth:r.barWidth}),t(M,{api:e,width:r.dashWidth,barWidth:r.barWidth}),t(v,{api:e,width:r.dashWidth})]}),{patchConsole:!1});C()}}c(Wt,"renderDashboard");export{Wt as renderDashboard};
@@ -1 +1 @@
1
- import{a,b}from"../chunk-I2FPXRA6.js";import"../chunk-RQBN7WNS.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as loadApiInsights,a as loadLocalStats};
1
+ import{a,b}from"../chunk-VGBATQZ3.js";import"../chunk-OLOECA5V.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as loadApiInsights,a as loadLocalStats};
@@ -1 +1 @@
1
- import{a as E}from"../../chunk-EKTNI6RV.js";import{a as I}from"../../chunk-X23L2MF6.js";import{a as J}from"../../chunk-B22HYCBV.js";import"../../chunk-ZXF5NE54.js";import{d as T}from"../../chunk-NJ5UED3H.js";import{b as P,c as v,d as j}from"../../chunk-NMCQ7JZZ.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as b}from"../../chunk-ZLLER3HP.js";import{useEffect as R,useState as i}from"react";import{Box as l,Text as s,useInput as Z}from"ink";import{jsx as t,jsxs as a}from"react/jsx-runtime";function K({onClose:A,activeOrg:F,defaultProjectPath:y,width:_}){let{jobs:u,error:L,loading:$,refetch:S}=E(20),[M,C]=i([]),[d,m]=i("list"),[f,w]=i(0),[h,g]=i(null),[x,B]=i(null),[p,c]=i(null);R(()=>{j().then(C).catch(o=>{let r=o instanceof Error?o.message:String(o);c(`couldn't load launchers: ${r}`),C([{tool:"claude_code",capabilities:{headless:!0,interactive:!0,remoteSpawn:!0}}])})},[]),R(()=>{if(!p)return;let o=setTimeout(()=>c(null),5e3);return()=>clearTimeout(o)},[p]),Z((o,r)=>{if(h){if(o==="y"||o==="Y"){let e=h.id;g(null),v(e).then(()=>{S(),c(`cancelled ${e.slice(0,8)}`)}).catch(n=>c(`cancel failed: ${n instanceof Error?n.message:String(n)}`))}else(o==="n"||o==="N"||r.escape)&&g(null);return}if(r.escape){if(d!=="none"){m("none");return}A();return}if(r.tab){m(e=>e==="list"?"form":e==="form"?"none":"list");return}if(o!=="q"&&d==="list"){if(r.upArrow)w(e=>Math.max(0,e-1));else if(r.downArrow)w(e=>Math.min(u.length-1,e+1));else if(o==="c"){let e=u[f];e&&(e.status==="running"||e.status==="queued"||e.status==="pending")&&g(e)}else if(o==="r"){let e=u[f],n=e?.result?.externalSessionId;e&&e.tool==="claude_code"&&n?(B({tool:"claude_code",projectPath:e.config.projectPath,resumeSessionId:n}),m("form")):c("resume needs a Claude Code session with a session id")}else if(o==="o"){let n=u[f]?.result?.externalSessionId;if(n){let O=process.env.RULEMETRIC_WEB_URL??"http://localhost:5174";import("node:child_process").then(({spawn:U})=>{U("open",[`${O}/sessions/${n}`],{detached:!0,stdio:"ignore"}).unref()})}}}});async function N(o){await P(o),B(null),m("list"),c("launched"),S()}return b(N,"handleSubmit"),a(l,{flexDirection:"column",borderStyle:"round",borderColor:T,width:_,paddingX:1,children:[a(l,{children:[t(s,{bold:!0,color:T,children:"Launcher"}),t(s,{dimColor:!0,children:" active org: "}),t(s,{children:F??"(none)"}),$&&t(s,{dimColor:!0,children:" loading\u2026"}),L&&a(s,{color:"#F55B5B",children:[" \u26A0 ",L]})]}),t(l,{marginTop:1,children:t(I,{jobs:u,selectedIndex:f,focused:d==="list"})}),t(l,{marginTop:1,children:t(J,{launchers:M,defaultProjectPath:x?.projectPath??y,defaultTool:x?.tool,defaultResumeSessionId:x?.resumeSessionId,focused:d==="form",onSubmit:N})}),h&&t(l,{marginTop:1,children:a(s,{color:"#FFD700",children:["Cancel job ",h.id.slice(0,8),"? (y/n)"]})}),p&&t(l,{marginTop:1,children:a(s,{dimColor:!0,children:["\xB7 ",p]})}),t(l,{marginTop:1,children:a(s,{dimColor:!0,children:["\u2191\u2193 select tab focus c cancel r resume o open esc ",d==="none"?"close":"back"]})})]})}b(K,"LauncherOverlay");export{K as LauncherOverlay};
1
+ import{a as J}from"../../chunk-B22HYCBV.js";import{a as E}from"../../chunk-Y6VBAURK.js";import{b as P,c as v,d as j}from"../../chunk-52RILE5M.js";import{a as I}from"../../chunk-X23L2MF6.js";import"../../chunk-ZXF5NE54.js";import{d as T}from"../../chunk-NJ5UED3H.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import{a as b}from"../../chunk-ZLLER3HP.js";import{useEffect as R,useState as i}from"react";import{Box as l,Text as s,useInput as Z}from"ink";import{jsx as t,jsxs as a}from"react/jsx-runtime";function K({onClose:A,activeOrg:F,defaultProjectPath:y,width:_}){let{jobs:u,error:L,loading:$,refetch:S}=E(20),[M,C]=i([]),[d,m]=i("list"),[f,w]=i(0),[h,g]=i(null),[x,B]=i(null),[p,c]=i(null);R(()=>{j().then(C).catch(o=>{let r=o instanceof Error?o.message:String(o);c(`couldn't load launchers: ${r}`),C([{tool:"claude_code",capabilities:{headless:!0,interactive:!0,remoteSpawn:!0}}])})},[]),R(()=>{if(!p)return;let o=setTimeout(()=>c(null),5e3);return()=>clearTimeout(o)},[p]),Z((o,r)=>{if(h){if(o==="y"||o==="Y"){let e=h.id;g(null),v(e).then(()=>{S(),c(`cancelled ${e.slice(0,8)}`)}).catch(n=>c(`cancel failed: ${n instanceof Error?n.message:String(n)}`))}else(o==="n"||o==="N"||r.escape)&&g(null);return}if(r.escape){if(d!=="none"){m("none");return}A();return}if(r.tab){m(e=>e==="list"?"form":e==="form"?"none":"list");return}if(o!=="q"&&d==="list"){if(r.upArrow)w(e=>Math.max(0,e-1));else if(r.downArrow)w(e=>Math.min(u.length-1,e+1));else if(o==="c"){let e=u[f];e&&(e.status==="running"||e.status==="queued"||e.status==="pending")&&g(e)}else if(o==="r"){let e=u[f],n=e?.result?.externalSessionId;e&&e.tool==="claude_code"&&n?(B({tool:"claude_code",projectPath:e.config.projectPath,resumeSessionId:n}),m("form")):c("resume needs a Claude Code session with a session id")}else if(o==="o"){let n=u[f]?.result?.externalSessionId;if(n){let O=process.env.RULEMETRIC_WEB_URL??"http://localhost:5174";import("node:child_process").then(({spawn:U})=>{U("open",[`${O}/sessions/${n}`],{detached:!0,stdio:"ignore"}).unref()})}}}});async function N(o){await P(o),B(null),m("list"),c("launched"),S()}return b(N,"handleSubmit"),a(l,{flexDirection:"column",borderStyle:"round",borderColor:T,width:_,paddingX:1,children:[a(l,{children:[t(s,{bold:!0,color:T,children:"Launcher"}),t(s,{dimColor:!0,children:" active org: "}),t(s,{children:F??"(none)"}),$&&t(s,{dimColor:!0,children:" loading\u2026"}),L&&a(s,{color:"#F55B5B",children:[" \u26A0 ",L]})]}),t(l,{marginTop:1,children:t(I,{jobs:u,selectedIndex:f,focused:d==="list"})}),t(l,{marginTop:1,children:t(J,{launchers:M,defaultProjectPath:x?.projectPath??y,defaultTool:x?.tool,defaultResumeSessionId:x?.resumeSessionId,focused:d==="form",onSubmit:N})}),h&&t(l,{marginTop:1,children:a(s,{color:"#FFD700",children:["Cancel job ",h.id.slice(0,8),"? (y/n)"]})}),p&&t(l,{marginTop:1,children:a(s,{dimColor:!0,children:["\xB7 ",p]})}),t(l,{marginTop:1,children:a(s,{dimColor:!0,children:["\u2191\u2193 select tab focus c cancel r resume o open esc ",d==="none"?"close":"back"]})})]})}b(K,"LauncherOverlay");export{K as LauncherOverlay};
@@ -1 +1 @@
1
- import{a,b,c,d}from"../../chunk-NMCQ7JZZ.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import"../../chunk-ZLLER3HP.js";export{c as cancelLaunchJob,b as createLaunchJob,a as fetchLaunchJobs,d as listLaunchers};
1
+ import{a,b,c,d}from"../../chunk-52RILE5M.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import"../../chunk-ZLLER3HP.js";export{c as cancelLaunchJob,b as createLaunchJob,a as fetchLaunchJobs,d as listLaunchers};
@@ -1 +1 @@
1
- import{a}from"../../chunk-EKTNI6RV.js";import"../../chunk-NMCQ7JZZ.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import"../../chunk-ZLLER3HP.js";export{a as useLaunchJobs};
1
+ import{a}from"../../chunk-Y6VBAURK.js";import"../../chunk-52RILE5M.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import"../../chunk-ZLLER3HP.js";export{a as useLaunchJobs};
@@ -1 +1 @@
1
- import{a}from"../../chunk-XCN2YPWI.js";import"../../chunk-NJ5UED3H.js";import"../../chunk-5VWVQCNR.js";import"../../chunk-MHLHLJ5T.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import"../../chunk-ZLLER3HP.js";export{a as MeasurementPanel};
1
+ import{a}from"../../chunk-ANPGOUIO.js";import"../../chunk-NJ5UED3H.js";import"../../chunk-E5FI5YHO.js";import"../../chunk-I2U5GNNM.js";import"../../chunk-XQYAVSUQ.js";import"../../chunk-PZNWH4VQ.js";import"../../chunk-ZLLER3HP.js";export{a as MeasurementPanel};
@@ -1 +1 @@
1
- import{a}from"../chunk-A6JUIZ3H.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as loadTelemetryChecks};
1
+ import{a}from"../chunk-WYDRKFXO.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as loadTelemetryChecks};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"./chunk-RQBN7WNS.js";import"./chunk-ZLLER3HP.js";export{h as CODEX_PARSER_VERSION,c as ClaudeCodeAdapter,j as CodexAdapter,f as CopilotAgentAdapter,d as CursorAdapter,k as PiAdapter,g as RuleMetricMcpAdapter,b as SESSION_EVENT_TYPES,a as SESSION_TOOLS,e as VSCodeCopilotAdapter,u as buildTmuxAttachCommand,t as buildTmuxHasSessionArgs,r as buildTmuxLaunchArgs,s as buildTmuxSendKeysArgs,m as detectTool,o as discoverAllSessions,i as freshCodexState,l as getAdapter,n as getAllProviders,w as getAvailableLaunchers,v as getLauncher,p as getProvider,x as sanitizeBranch,q as sanitizeTmuxName,y as worktreePathFor};
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"./chunk-OLOECA5V.js";import"./chunk-ZLLER3HP.js";export{h as CODEX_PARSER_VERSION,c as ClaudeCodeAdapter,j as CodexAdapter,f as CopilotAgentAdapter,d as CursorAdapter,k as PiAdapter,g as RuleMetricMcpAdapter,b as SESSION_EVENT_TYPES,a as SESSION_TOOLS,e as VSCodeCopilotAdapter,u as buildTmuxAttachCommand,t as buildTmuxHasSessionArgs,r as buildTmuxLaunchArgs,s as buildTmuxSendKeysArgs,m as detectTool,o as discoverAllSessions,i as freshCodexState,l as getAdapter,n as getAllProviders,w as getAvailableLaunchers,v as getLauncher,p as getProvider,x as sanitizeBranch,q as sanitizeTmuxName,y as worktreePathFor};
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-XAGNGQL3.js";import"../chunk-3AV3GTMP.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{c as _resetRefreshAttempt,b as bootstrapActiveOrg,a as maybeRefreshActiveOrg};
1
+ import{a,b,c}from"../chunk-7CQBFCHP.js";import"../chunk-3AV3GTMP.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{c as _resetRefreshAttempt,b as bootstrapActiveOrg,a as maybeRefreshActiveOrg};
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"../chunk-NVOYP4HX.js";import"../chunk-5U5SHJJA.js";import"../chunk-IEQDLURA.js";import"../chunk-KINIFUZQ.js";import"../chunk-ZYGBABMZ.js";import"../chunk-QRKMRG6W.js";import"../chunk-D7L7IMJQ.js";import"../chunk-MRQIYIQE.js";import"../chunk-R26SQ3BE.js";import"../chunk-PMMHMRFS.js";import"../chunk-IYX65N6T.js";import"../chunk-GHUW7P55.js";import"../chunk-JU5ZNXPK.js";import"../chunk-RAMQVEJB.js";import"../chunk-BRYURAUN.js";import"../chunk-NLUHMHPM.js";import"../chunk-DTTR4EUJ.js";import"../chunk-WLLIFRRE.js";import"../chunk-RRBFKVCI.js";import"../chunk-5RBLIVBF.js";import"../chunk-SW24KZ5C.js";import"../chunk-NSO2EBYE.js";import"../chunk-3ZHVP3KE.js";import"../chunk-2C7CFCMM.js";import"../chunk-HOQPVOMF.js";import"../chunk-WSUKOU3X.js";import"../chunk-A6XQSO62.js";import"../chunk-MOJY6S5J.js";import"../chunk-CJ2WSSHD.js";import"../chunk-KOIFFSYW.js";import"../chunk-IPNBW7ZW.js";import"../chunk-P577DWWL.js";import"../chunk-7MQZPDDZ.js";import"../chunk-ANLPPIMS.js";import"../chunk-AZRGURHR.js";import"../chunk-CXENLSMR.js";import"../chunk-MJLW5KN2.js";import"../chunk-77FH6UZP.js";import"../chunk-K65DDLTZ.js";import"../chunk-LELSVLNK.js";import"../chunk-A2JFQUDW.js";import"../chunk-LZPE6424.js";import"../chunk-3UKZJAFS.js";import"../chunk-FGGESTXG.js";import"../chunk-PX2E644Q.js";import"../chunk-DQYYHX6K.js";import"../chunk-GIRPEMTW.js";import"../chunk-RWQG25JU.js";import"../chunk-3ZHBOILE.js";import"../chunk-PIVEJTNF.js";import"../chunk-BOYWPUV2.js";import"../chunk-ENW5SUQJ.js";import"../chunk-C3XWDYZJ.js";import"../chunk-CAQLSYOK.js";import"../chunk-RQBN7WNS.js";import"../chunk-ZJABRHIP.js";import"../chunk-XFOG2PDJ.js";import"../chunk-SIGZEQ3K.js";import"../chunk-AZWY2DOT.js";import"../chunk-LJRE3LZ2.js";import"../chunk-YZQZD2E6.js";import"../chunk-FLJTAD2R.js";import"../chunk-UQJNUESP.js";import"../chunk-FLXWL4F4.js";import"../chunk-KIQK7NVF.js";import"../chunk-6UEFCMR2.js";import"../chunk-MODXEGCU.js";import"../chunk-RBSEE2Z6.js";import"../chunk-NBTH6ZKD.js";import"../chunk-L5ILEWHH.js";import"../chunk-M7QSC64D.js";import"../chunk-DZRBB34J.js";import"../chunk-KR32Y5Q5.js";import"../chunk-G7V4ZZZ3.js";import"../chunk-RITL4NU3.js";import"../chunk-GYKYJJNF.js";import"../chunk-V6L25LFD.js";import"../chunk-GWQ24FQP.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-AHLVY52I.js";import"../chunk-PPQFN62M.js";import"../chunk-N7ODX6PO.js";import"../chunk-OZQNSELV.js";import"../chunk-HFGO5762.js";import"../chunk-VS5ROGDP.js";import"../chunk-NAS7FIGM.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-GYNZ3OZF.js";import"../chunk-UPFH72PF.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-KFNFLMUR.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as CAPABILITIES,a as HANDLERS,c as availableCapabilities,d as pollForWork,e as runAgentLoop};
1
+ import{a,b,c,d,e}from"../chunk-NX3PF3EQ.js";import"../chunk-RYMQMJ7O.js";import"../chunk-IEQDLURA.js";import"../chunk-KINIFUZQ.js";import"../chunk-2EXQM3UF.js";import"../chunk-ZYGBABMZ.js";import"../chunk-RR5EE23Q.js";import"../chunk-K2PI3OGV.js";import"../chunk-JVTSJFFI.js";import"../chunk-IQOBKWVY.js";import"../chunk-KCX2YDC3.js";import"../chunk-UFRJ75FW.js";import"../chunk-6WX3AXMI.js";import"../chunk-ONDOPTSL.js";import"../chunk-35NZJWFC.js";import"../chunk-6Z4JNHBO.js";import"../chunk-JU5ZNXPK.js";import"../chunk-YRGNBYZZ.js";import"../chunk-ID47WFUP.js";import"../chunk-PD4BUQ2X.js";import"../chunk-HEO56SKT.js";import"../chunk-ZVCKDNBT.js";import"../chunk-FD272ZXG.js";import"../chunk-5RBLIVBF.js";import"../chunk-75H3CKWA.js";import"../chunk-SW24KZ5C.js";import"../chunk-2WRP6ZJF.js";import"../chunk-3ZHVP3KE.js";import"../chunk-2RZDFKX4.js";import"../chunk-HOQPVOMF.js";import"../chunk-PRC5N4NB.js";import"../chunk-JE2JX7IJ.js";import"../chunk-MOJY6S5J.js";import"../chunk-XQEI7NOC.js";import"../chunk-Q42RXJ4R.js";import"../chunk-M7QSC64D.js";import"../chunk-E6O2IFOK.js";import"../chunk-ZFIGOHQ6.js";import"../chunk-ICULHHNZ.js";import"../chunk-B5FBLLKT.js";import"../chunk-NI6RDOZ5.js";import"../chunk-77FH6UZP.js";import"../chunk-LKOUL3IF.js";import"../chunk-SFZSHNZZ.js";import"../chunk-B56GMANB.js";import"../chunk-PX2E644Q.js";import"../chunk-WLLSWFAJ.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-EYRM7BT4.js";import"../chunk-NBTH6ZKD.js";import"../chunk-GIRPEMTW.js";import"../chunk-ONSRPEUQ.js";import"../chunk-GRTEWHXU.js";import"../chunk-3UKZJAFS.js";import"../chunk-Q37D6V2G.js";import"../chunk-RBSEE2Z6.js";import"../chunk-DQYYHX6K.js";import"../chunk-FKUFJWII.js";import"../chunk-45CCW25C.js";import"../chunk-PIVEJTNF.js";import"../chunk-EA3X4TAE.js";import"../chunk-6XCD343D.js";import"../chunk-PCSSIYH6.js";import"../chunk-G2UGWEMO.js";import"../chunk-GYNZ3OZF.js";import"../chunk-OLOECA5V.js";import"../chunk-WUDHDZOG.js";import"../chunk-XFOG2PDJ.js";import"../chunk-SIGZEQ3K.js";import"../chunk-EBGVDX3Z.js";import"../chunk-UPFH72PF.js";import"../chunk-LJRE3LZ2.js";import"../chunk-G2MRNA45.js";import"../chunk-OT7ZUHJF.js";import"../chunk-FLXWL4F4.js";import"../chunk-V6L25LFD.js";import"../chunk-LQRXWLFJ.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-K4LO27GG.js";import"../chunk-CLPIN7TY.js";import"../chunk-6UEFCMR2.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-MODXEGCU.js";import"../chunk-N7ODX6PO.js";import"../chunk-S7ZQTZNB.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-OZQNSELV.js";import"../chunk-HFGO5762.js";import"../chunk-VS5ROGDP.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as CAPABILITIES,a as HANDLERS,c as availableCapabilities,d as pollForWork,e as runAgentLoop};
@@ -1 +1 @@
1
- import{a}from"../chunk-RWQG25JU.js";import"../chunk-3ZHBOILE.js";import"../chunk-PIVEJTNF.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as startPresenceHeartbeat};
1
+ import{a}from"../chunk-FKUFJWII.js";import"../chunk-45CCW25C.js";import"../chunk-PIVEJTNF.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as startPresenceHeartbeat};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g}from"../chunk-HNPC5U3C.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{d as classifyRecord,e as emitRecordsAsEvents,c as extractUserPrompt,b as findMaxStepIndex,a as readNewRecords,g as stateApi,f as tailAntigravityTranscript};
1
+ import{a,b,c,d,e,f,g}from"../chunk-TUSFCQBL.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{d as classifyRecord,e as emitRecordsAsEvents,c as extractUserPrompt,b as findMaxStepIndex,a as readNewRecords,g as stateApi,f as tailAntigravityTranscript};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i}from"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as ApiError,a as DEFAULT_API_URL,d as api,i as apiDelete,e as apiGet,h as apiPatch,f as apiPost,g as apiPut,c as getBaseUrl};
1
+ import{a,b,c,d,e,f,g,h,i}from"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as ApiError,a as DEFAULT_API_URL,d as api,i as apiDelete,e as apiGet,h as apiPatch,f as apiPost,g as apiPut,c as getBaseUrl};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-K4LO27GG.js";import"../chunk-ZLLER3HP.js";export{a as MIN_LIVE_CASES};
@@ -0,0 +1 @@
1
+ import{a,b,c}from"../chunk-ONSRPEUQ.js";import"../chunk-GRTEWHXU.js";import"../chunk-3UKZJAFS.js";import"../chunk-ZLLER3HP.js";export{b as collectDiscoveryEvidence,c as focusDiscoveryEvidence,a as taskRequestScore};
@@ -0,0 +1 @@
1
+ import{a}from"../chunk-Q37D6V2G.js";import"../chunk-ZLLER3HP.js";export{a as collectDiscoveryRepository};
@@ -1 +1 @@
1
- import{a}from"../chunk-JCZOEIL7.js";import"../chunk-5LTJNYCP.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as ensureDeviceApiKey};
1
+ import{a}from"../chunk-NJKPUZNM.js";import"../chunk-KTLRSRHF.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as ensureDeviceApiKey};
@@ -1 +1 @@
1
- import{a}from"../chunk-3EZZGA72.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as ensureFreshToken};
1
+ import{a}from"../chunk-RFLO7L5X.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as ensureFreshToken};
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-7N55TWYQ.js";import"../chunk-KFNFLMUR.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as aggregateBenchmark,c as postBenchmark,a as summarizeRuns};
1
+ import{a,b,c}from"../chunk-T7DAU6DV.js";import"../chunk-S7ZQTZNB.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{b as aggregateBenchmark,c as postBenchmark,a as summarizeRuns};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f,g,h,i}from"../chunk-PPQFN62M.js";import"../chunk-NAS7FIGM.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-GYNZ3OZF.js";import"../chunk-UPFH72PF.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as CANDIDATE_ARM,b as PRIOR_VERSION_ARM,f as accountForFailures,g as attributeShortfall,h as buildCandidateQueue,d as measurementBatchKey,c as observedExecutionKey,e as pairCandidateRuns,i as runCandidateBatchAndPost};
1
+ import{a,b,c,d,e,f,g,h,i}from"../chunk-NN4M476J.js";import"../chunk-WLLSWFAJ.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-GYNZ3OZF.js";import"../chunk-UPFH72PF.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as CANDIDATE_ARM,b as PRIOR_VERSION_ARM,f as accountForFailures,g as attributeShortfall,h as buildCandidateQueue,d as measurementBatchKey,c as observedExecutionKey,e as pairCandidateRuns,i as runCandidateBatchAndPost};
@@ -1 +1 @@
1
- import{a,b}from"../chunk-UQJNUESP.js";import"../chunk-FLXWL4F4.js";import"../chunk-V6L25LFD.js";import"../chunk-GWQ24FQP.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-N7ODX6PO.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-XQYAVSUQ.js";import"../chunk-ZLLER3HP.js";export{a as buildFeedbackBlock,b as generateEvalCases};
1
+ import{a,b}from"../chunk-OT7ZUHJF.js";import"../chunk-FLXWL4F4.js";import"../chunk-V6L25LFD.js";import"../chunk-LQRXWLFJ.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-N7ODX6PO.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-XQYAVSUQ.js";import"../chunk-ZLLER3HP.js";export{a as buildFeedbackBlock,b as generateEvalCases};
@@ -1 +1 @@
1
- import{a,b}from"../chunk-647M2I2Y.js";import"../chunk-ZLLER3HP.js";export{a as parseComparatorOutput,b as resolveComparison};
1
+ import{a as s}from"../chunk-ZLLER3HP.js";function w(r){if(typeof r!="string")return null;let n=r.toUpperCase();return n==="A"||n==="B"||n==="TIE"?n:null}s(w,"normalizeWinner");function v(r){return Array.isArray(r)?r.filter(n=>typeof n=="string"):[]}s(v,"stringList");function d(r){let n=r.trim(),a=n.match(/```(?:json)?\s*([\s\S]*?)```/);a&&(n=a[1].trim());let e=n.match(/\{[\s\S]*\}/);e&&(n=e[0]);let t;try{t=JSON.parse(n)}catch{return null}if(typeof t!="object"||t===null)return null;let{per_eval:l,overall:g}=t,i=typeof g=="object"&&g!==null?g:{},u=w(i.winner);return u?{perEval:(Array.isArray(l)?l:[]).flatMap(p=>{if(typeof p!="object"||p===null)return[];let o=p,c=w(o.winner);return!c||typeof o.eval_name!="string"?[]:[{evalName:o.eval_name,winner:c,reasoning:typeof o.reasoning=="string"?o.reasoning:""}]}),overall:{winner:u,reasoning:typeof i.reasoning=="string"?i.reasoning:"",strengthsWinner:v(i.strengths_winner),weaknessesLoser:v(i.weaknesses_loser)}}:null}s(d,"parseComparatorOutput");function m(r,n){let a=s(e=>{if(e==="TIE")return null;let t=n.isSwapped?n.targetBId:n.targetAId,l=n.isSwapped?n.targetAId:n.targetBId;return e==="A"?t:l},"resolve");return{winnerTargetId:a(r.overall.winner),perEval:r.perEval.map(e=>({evalName:e.evalName,winnerTargetId:a(e.winner),reasoning:e.reasoning})),overall:{reasoning:r.overall.reasoning,strengthsWinner:r.overall.strengthsWinner,weaknessesLoser:r.overall.weaknessesLoser}}}s(m,"resolveComparison");export{d as parseComparatorOutput,m as resolveComparison};
@@ -1 +1 @@
1
- import{a}from"../chunk-FGGESTXG.js";import"../chunk-UQJNUESP.js";import"../chunk-FLXWL4F4.js";import"../chunk-NBTH6ZKD.js";import"../chunk-V6L25LFD.js";import"../chunk-GWQ24FQP.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-N7ODX6PO.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as processConversationJob};
1
+ import{a}from"../chunk-EYRM7BT4.js";import"../chunk-NBTH6ZKD.js";import"../chunk-OT7ZUHJF.js";import"../chunk-FLXWL4F4.js";import"../chunk-V6L25LFD.js";import"../chunk-LQRXWLFJ.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-N7ODX6PO.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as processConversationJob};
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-G7V4ZZZ3.js";import"../chunk-ZLLER3HP.js";export{a as DEFAULT_REQUIRED_HEADROOM_PCT,b as MAX_OBSERVATION_AGE_MS,c as assessQuotaHeadroom};
1
+ import{a as n}from"../chunk-ZLLER3HP.js";var c=25,d=54e5;function f(i){let{limits:a,now:t,requiredHeadroomPct:r=25,maxAgeMs:u=54e5}=i,e=a?.five_hour;if(!e||typeof e.used_percentage!="number")return{ok:!0};let s=Date.parse(e.observed_at);if(!Number.isFinite(s))return{ok:!0};if(t.getTime()-s>u)return{ok:!0};if(e.resets_at){let o=Date.parse(e.resets_at);if(Number.isFinite(o)&&o<=t.getTime())return{ok:!0}}if(100-e.used_percentage>=r)return{ok:!0};let _=e.resets_at?` \u2014 resets at ${new Date(e.resets_at).toISOString().slice(11,16)}Z`:"";return{ok:!1,reason:`five-hour window ${e.used_percentage}% used, below the ${r}% headroom a full cycle needs${_}`}}n(f,"assessQuotaHeadroom");export{c as DEFAULT_REQUIRED_HEADROOM_PCT,d as MAX_OBSERVATION_AGE_MS,f as assessQuotaHeadroom};
@@ -1 +1 @@
1
- import{a,b,c,d,e,f}from"../chunk-RITL4NU3.js";import"../chunk-PPQFN62M.js";import"../chunk-NAS7FIGM.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-GYNZ3OZF.js";import"../chunk-UPFH72PF.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as OPEN_CANDIDATE_KEY,e as bankOpenCandidate,f as buildOpenCandidate,d as fetchCarriedPairs,c as owedPasses,b as resolveOpenCandidate};
1
+ import{d as h,e as g}from"../chunk-NN4M476J.js";import"../chunk-WLLSWFAJ.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-GYNZ3OZF.js";import"../chunk-UPFH72PF.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import{e as p,g as f}from"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import{a as o}from"../chunk-ZLLER3HP.js";var u="openCandidate";function K(n,s,a){let t=(n??{})[u];if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;return e.executionKey!==a||typeof e.content!="string"||!e.content||typeof e.hash!="string"||!e.hash||typeof e.priorHash!="string"||e.priorHash!==s?null:{...a?{executionKey:a}:{},...typeof e.observedKey=="string"?{observedKey:e.observedKey}:{},content:e.content,hash:e.hash,priorHash:e.priorHash,plannedPairs:typeof e.plannedPairs=="number"?e.plannedPairs:0,updatedAt:typeof e.updatedAt=="string"?e.updatedAt:""}}o(K,"resolveOpenCandidate");function C(n){let{plannedPairs:s,carriedPairs:a,liveCases:t}=n;if(t<=0)return 0;let e=s-a;return e<=0?0:Math.ceil(e/t)}o(C,"owedPasses");var d=100;async function x(n){let{evalTargetId:s,candidateContentHash:a}=n,t=[];for(let e=0;;e+=d){let i=await p(`/api/eval-targets/${s}/runs?candidateContentHash=${encodeURIComponent(a)}&limit=${d}&offset=${e}`);if(!Array.isArray(i)||i.length===0||(t.push(...i.filter(r=>{if(r.outputs?.executionKey!==n.executionKey)return!1;if(!n.executionKey)return!0;if(!n.observedKey)return!1;let l=h([r]);if(!l)return!1;let[y,c]=JSON.parse(l),[b,m]=JSON.parse(n.observedKey);return y===b&&(c===null||c===m)})),i.length<d))break}return g(t)}o(x,"fetchCarriedPairs");async function A(n){let{evalTargetId:s,meta:a,blob:t,log:e,tag:i}=n;try{let r={...a};t?r[u]=t:delete r[u],await f(`/api/eval-targets/${s}`,{metadata:r}),e(t?`${i}: banked candidate ${t.hash.slice(0,8)} \u2014 the next run resumes instead of restarting`:`${i}: cleared the banked candidate (this cycle reached a decision)`)}catch(r){e(`${i}: could not update the candidate bank (${r instanceof Error?r.message:String(r)})`)}}o(A,"bankOpenCandidate");function O(n){return{...n.executionKey?{executionKey:n.executionKey}:{},...n.observedKey?{observedKey:n.observedKey}:{},content:n.content,hash:n.hash,priorHash:n.priorHash,plannedPairs:n.plannedPairs,updatedAt:n.now.toISOString()}}o(O,"buildOpenCandidate");export{u as OPEN_CANDIDATE_KEY,A as bankOpenCandidate,O as buildOpenCandidate,x as fetchCarriedPairs,C as owedPasses,K as resolveOpenCandidate};
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"../chunk-NAS7FIGM.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-GYNZ3OZF.js";import"../chunk-UPFH72PF.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{d as executeAndGradeCase,c as resolveMeasurementJob,b as resolveMeasurementJudge,e as runBatchAndPost,a as selectEvalJudge};
1
+ import{a,b,c,d,e}from"../chunk-WLLSWFAJ.js";import"../chunk-VZYNZS5U.js";import"../chunk-U2NT5OSQ.js";import"../chunk-KGURGIZ2.js";import"../chunk-GYNZ3OZF.js";import"../chunk-UPFH72PF.js";import"../chunk-3HJT572X.js";import"../chunk-CDY7TQFZ.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{d as executeAndGradeCase,c as resolveMeasurementJob,b as resolveMeasurementJudge,e as runBatchAndPost,a as selectEvalJudge};
@@ -1 +1,8 @@
1
- import{a,b}from"../chunk-7OTOAC6C.js";import"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-ZLLER3HP.js";export{b as computeTriggerScore,a as testTrigger};
1
+ import{g as p}from"../chunk-FLP6WIJV.js";import"../chunk-JP6ULOEX.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import{a as l}from"../chunk-ZLLER3HP.js";var k=[{name:"git-commit-helper",description:"Writes conventional commit messages and PR descriptions from a diff"},{name:"sql-query-optimizer",description:"Analyzes slow SQL queries and proposes indexes and rewrites"},{name:"i18n-string-extractor",description:"Finds hardcoded UI strings and extracts them into translation files"}],T=`You are an AI coding assistant with access to a set of optional skills. When a user request matches a skill's description, you invoke that skill before answering; when no skill applies, you answer directly without one. Descriptions are your ONLY information about each skill.
2
+
3
+ {{CATALOG}}
4
+
5
+ Decide which single skill (if any) you would invoke for the user's request. Respond with ONLY a valid JSON object:
6
+ {"skill": "<exact skill name>" or null, "confidence": 0.0-1.0, "reason": "one sentence"}`;function b(n,t,e){let i=k.filter(s=>s.name!==n).map(s=>`- ${s.name}: ${s.description}`),d=(e%(i.length+1)+i.length+1)%(i.length+1);return i.splice(d,0,`- ${n}: ${t}`),`Available skills:
7
+ ${i.join(`
8
+ `)}`}l(b,"buildCatalog");async function v(n){let{query:t,shouldTrigger:e,skillName:a,skillDescription:i,model:d,timeout:s=6e4,variant:f=0}=n,h=T.replace("{{CATALOG}}",b(a,i,f)),c=await p({prompt:t,targetContent:h,timeout:s,model:d});if(c.error)return{query:t,shouldTrigger:e,didTrigger:!1,correct:!e,confidence:0,evidence:`Execution failed: ${c.error}`};try{let o=c.output.trim(),u=o.match(/```(?:json)?\s*([\s\S]*?)```/);u&&(o=u[1].trim());let g=o.match(/\{[\s\S]*\}/);g&&(o=g[0]);let r=JSON.parse(o),m=r.skill===a;return{query:t,shouldTrigger:e,didTrigger:m,correct:m===e,confidence:typeof r.confidence=="number"?r.confidence:0,evidence:`Chose ${r.skill===null||r.skill===void 0?"no skill":`"${r.skill}"`}${r.reason?`: ${r.reason}`:""}`}}catch{return{query:t,shouldTrigger:e,didTrigger:!1,correct:!e,confidence:0,evidence:`Model returned unparseable output: ${c.output.slice(0,200)}`}}}l(v,"testTrigger");function w(n){return n.length===0?0:n.filter(e=>e.correct).length/n.length}l(w,"computeTriggerScore");export{w as computeTriggerScore,v as testTrigger};
@@ -1 +1 @@
1
- import{a,b,c}from"../../../chunk-A2JFQUDW.js";import"../../../chunk-LJRE3LZ2.js";import"../../../chunk-MHLHLJ5T.js";import"../../../chunk-XQYAVSUQ.js";import"../../../chunk-ZLLER3HP.js";export{b as MAX_ASK_CHARS,a as MAX_INSTALLED_ASKS,c as readInstalledAsks};
1
+ import{a,b,c}from"../../../chunk-NI6RDOZ5.js";import"../../../chunk-LJRE3LZ2.js";import"../../../chunk-I2U5GNNM.js";import"../../../chunk-XQYAVSUQ.js";import"../../../chunk-ZLLER3HP.js";export{b as MAX_ASK_CHARS,a as MAX_INSTALLED_ASKS,c as readInstalledAsks};
@@ -1 +1 @@
1
- import{a,b}from"../../../chunk-LZPE6424.js";import"../../../chunk-3UKZJAFS.js";import"../../../chunk-ZLLER3HP.js";export{b as collectProjectEvidence,a as retainCitedCandidates};
1
+ import{a,b,c}from"../../../chunk-GRTEWHXU.js";import"../../../chunk-3UKZJAFS.js";import"../../../chunk-ZLLER3HP.js";export{c as collectProjectEvidence,b as retainCitedCandidates,a as stripEvidencePreamble};
@@ -1 +1 @@
1
- import{a,b,c,d}from"../../../chunk-K65DDLTZ.js";import"../../../chunk-LZPE6424.js";import"../../../chunk-3UKZJAFS.js";import"../../../chunk-LJRE3LZ2.js";import"../../../chunk-MHLHLJ5T.js";import"../../../chunk-XQYAVSUQ.js";import"../../../chunk-ZLLER3HP.js";export{a as QUALITY_REVIEW_PROMPT,d as improveInsightCandidates,b as readQualityContext,c as reviewInsightCandidates};
1
+ import{a,b,c,d}from"../../../chunk-LKOUL3IF.js";import"../../../chunk-GRTEWHXU.js";import"../../../chunk-3UKZJAFS.js";import"../../../chunk-LJRE3LZ2.js";import"../../../chunk-I2U5GNNM.js";import"../../../chunk-XQYAVSUQ.js";import"../../../chunk-ZLLER3HP.js";export{a as QUALITY_REVIEW_PROMPT,d as improveInsightCandidates,b as readQualityContext,c as reviewInsightCandidates};
@@ -1 +1 @@
1
- import{a}from"../../../chunk-LELSVLNK.js";import"../../../chunk-5VWVQCNR.js";import"../../../chunk-MHLHLJ5T.js";import"../../../chunk-XQYAVSUQ.js";import"../../../chunk-PZNWH4VQ.js";import"../../../chunk-ZLLER3HP.js";export{a as nominateRecommendations};
1
+ import{a}from"../../../chunk-SFZSHNZZ.js";import"../../../chunk-E5FI5YHO.js";import"../../../chunk-I2U5GNNM.js";import"../../../chunk-XQYAVSUQ.js";import"../../../chunk-PZNWH4VQ.js";import"../../../chunk-ZLLER3HP.js";export{a as nominateRecommendations};
@@ -1 +1,16 @@
1
- import{a,b,c,d,e,f,g,h,i}from"../chunk-DZRBB34J.js";import"../chunk-GWQ24FQP.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-N7ODX6PO.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import"../chunk-ZLLER3HP.js";export{a as FILE_CONTENT_BEGIN,b as FILE_CONTENT_END,d as MAX_GROWTH_FACTOR,c as MIN_RETAINED_FRACTION,g as buildProposerData,e as buildProposerSystemPrompt,f as describePriorDecision,h as parseProposalResponse,i as proposeInstructionEdit};
1
+ import{h as E}from"../chunk-LQRXWLFJ.js";import"../chunk-PPAHIVG5.js";import"../chunk-CT7FWSIU.js";import"../chunk-5MXZJWQS.js";import"../chunk-SVZYRGO5.js";import"../chunk-WULEBQPI.js";import"../chunk-N7ODX6PO.js";import"../chunk-GPBN4ROE.js";import"../chunk-6XTLP2G7.js";import"../chunk-PJ3WHQ67.js";import{a as r}from"../chunk-ZLLER3HP.js";var g="<<<FILE-CONTENT-BEGIN>>>",m="<<<FILE-CONTENT-END>>>",b="<RATIONALE>",R="</RATIONALE>",u="<PROPOSED_INSTRUCTION>",p="</PROPOSED_INSTRUCTION>",d=.5,f=3;function y(e){let t=e.immutableSections.length>0?e.immutableSections.map(s=>` - ${s}`).join(`
2
+ `):" (none)",o=e.evidence.priorDecisions.length>0?["6. You have edited this file before. The attempts are listed below with"," how each was judged. Do not re-propose an edit that was MEASURED and"," rejected: it was replayed against this exact file and did not beat it,"," so measuring it again spends the same budget for the same answer. An"," attempt marked NOT MEASURED is different \u2014 the gate stopped it before"," it earned a verdict, so whether it would have helped is still unknown."]:[],n=e.currentContent.trim().length,i=` It is currently ${n} characters. Your proposal must stay between ${Math.ceil(n*d)} and ${Math.floor(n*f)} characters \u2014 outside that it is discarded unmeasured as a truncation or runaway rewrite.`;return["You are improving an AI coding assistant instruction file so that it scores","better on a fixed set of evaluation cases.","",`The file is a ${e.targetType} named "${e.targetName}".`,i,"","RULES",`0. The current file is EXACTLY the text between ${g} and`,` ${m} in the data message. Headings after the closing`," sentinel (underperforming cases, notes, prior attempts) are evidence",' ABOUT the file \u2014 they are not in the file, and "removing" one of them'," is not an edit. Do not include the sentinels in your output.","1. Return the COMPLETE new file, not a diff, not a patch, not a summary,"," and not an excerpt. Everything you omit will be DELETED from the file.","2. Preserve everything you are not deliberately changing, byte for byte.","3. Make a focused edit. You are one step in a measured loop: a small change"," that can be attributed beats a rewrite that cannot.","4. Do not edit these sections or anything nested under them \u2014 an edit that"," touches them is refused downstream and the whole proposal is wasted:",t,"5. Do not add meta-commentary about the evaluation, the loop, or this"," prompt to the file. The file is read by other agents as instructions.",...o,"","OUTPUT FORMAT \u2014 exactly this, with no text before or after:",b,"One or two sentences: what you changed and which evidence motivated it.",R,u,"The complete new file content.",p].join(`
3
+ `)}r(y,"buildProposerSystemPrompt");var h=r(e=>`${e>=0?"+":"-"}${Math.abs(e*100).toFixed(1)}pp`,"signedPp");function O(e){let t=/^\d{4}-\d{2}-\d{2}/.exec(e.at??"")?.[0]??"undated",o;if(e.measured){let i=e.measured;o=`MEASURED against this exact file and ${e.decision==="promote"?"ACCEPTED":"REJECTED"}: ${h(i.delta)} (CI ${h(i.ciLower)} to ${h(i.ciUpper)}, ${i.nPairs} paired cases)`}else o=`NOT MEASURED \u2014 the gate refused it, so its merit is still unknown: ${e.refusals.length>0?e.refusals.join("; "):"no reason recorded"}`;let n=[`- ${t} \u2014 ${o}`];return e.decision==="promote"&&n.push(e.applied?" The file WAS rewritten by this decision.":" Dry run: the file was NOT rewritten, so this edit is still available."),e.touched.length>0&&n.push(` Sections touched: ${e.touched.join(", ")}`),e.rationale.trim()!==""&&n.push(` You said at the time: ${e.rationale.trim()}`),n.join(`
4
+ `)}r(O,"describePriorDecision");function P(e){let t=e.evidence,o=["## CURRENT FILE CONTENT","","The file is EXACTLY the text between the two sentinel lines below \u2014","nothing before the first sentinel or after the second is part of it.","Everything after the closing sentinel is evidence ABOUT the file.","",g,e.currentContent,m,""];if(t.weakest.length>0){o.push("## CASES WHERE THIS FILE CURRENTLY UNDERPERFORMS","");for(let n of t.weakest)o.push(`- ${n.name}: passes ${(n.withPassRate*100).toFixed(0)}% with the file vs ${(n.withoutPassRate*100).toFixed(0)}% without it`);o.push("")}return t.nonDiscriminating.length>0&&o.push("## CASES THAT CARRY NO SIGNAL EITHER WAY","","These score the same with and without the file. Changing the file to chase","them is unlikely to move anything.","",...t.nonDiscriminating.map(n=>`- ${n}`),""),t.priorDecisions.length>0&&o.push("## WHAT YOU ALREADY PROPOSED FOR THIS FILE, AND HOW IT WAS JUDGED","","Newest first. Every attempt listed here was made against the file above,","byte for byte. Attempts against a different version of the file are not","shown, because a verdict earned by different text says nothing about this","one.","",...t.priorDecisions.map(O),""),t.notes.length>0&&o.push("## NOTES","",...t.notes.map(n=>`- ${n}`),""),o.join(`
5
+ `)}r(P,"buildProposerData");function T(e,t,o){let n=e.lastIndexOf(o);if(n<0)return null;let i=e.lastIndexOf(t,n);return i<0?null:e.slice(i+t.length,n)}r(T,"between");function A(e){let t=e.split(`
6
+ `);for(;t.length>0&&t[0].trim()==="";)t.shift();for(;t.length>0&&t[t.length-1].trim()==="";)t.pop();if(t.length<2)return t.join(`
7
+ `);let o=t[0].trim(),n=t[t.length-1].trim(),i=/^(`{3,}|~{3,})[a-zA-Z0-9_-]*$/.test(o),s=/^(`{3,}|~{3,})$/.test(n);return i&&s?t.slice(1,-1).join(`
8
+ `):t.join(`
9
+ `)}r(A,"stripWrappingFence");function w(e,t){if(!e||e.trim()==="")return{ok:!1,reason:"proposer returned nothing"};let o=T(e,u,p);if(o==null)return{ok:!1,reason:`proposer reply had no ${u}\u2026${p} block`};let n=A(o).split(`
10
+ `).filter(a=>{let l=a.trim();return l!==g&&l!==m}).join(`
11
+ `).trim();if(n==="")return{ok:!1,reason:"proposed content was empty"};if(n===t.trim())return{ok:!1,reason:"proposal is identical to the current version"};let i=n.length/Math.max(1,t.trim().length);if(i<d)return{ok:!1,reason:`proposal retains only ${(i*100).toFixed(0)}% of the predecessor's length (floor ${(d*100).toFixed(0)}%) \u2014 treating it as a truncated or summarised reply rather than an edit`};if(i>f)return{ok:!1,reason:`proposal is ${i.toFixed(1)}x the predecessor's length (ceiling ${f}x) \u2014 treating it as runaway generation`};let s=(T(e,b,R)??"").trim();return{ok:!0,proposal:{candidateContent:n,rationale:s===""?"(proposer supplied no rationale)":s}}}r(w,"parseProposalResponse");async function x(e,t=16e3,o=E){let n=y(e),i=P(e),s=await o(n,i,t);if(s==null)return{ok:!1,reason:"no LLM backend available, or the proposer call failed"};let a=w(s,e.currentContent);if(a.ok||!N(a.reason))return a;let l=await o(n,`${i}
12
+
13
+ ## YOUR PREVIOUS ATTEMPT WAS DISCARDED
14
+
15
+ - ${a.reason}
16
+ Produce the proposal again, within the stated length bounds.`,t);if(l==null)return a;let c=w(l,e.currentContent);return c.ok?c:{ok:!1,reason:`${c.reason} (after one retry: ${a.reason})`}}r(x,"proposeInstructionEdit");function N(e){return e.includes("retains only")||e.includes("runaway generation")}r(N,"isLengthBoundFailure");export{g as FILE_CONTENT_BEGIN,m as FILE_CONTENT_END,f as MAX_GROWTH_FACTOR,d as MIN_RETAINED_FRACTION,P as buildProposerData,y as buildProposerSystemPrompt,O as describePriorDecision,w as parseProposalResponse,x as proposeInstructionEdit};
@@ -1 +1 @@
1
- import{a}from"../chunk-KR32Y5Q5.js";import"../chunk-KFNFLMUR.js";import"../chunk-5VWVQCNR.js";import"../chunk-MHLHLJ5T.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as restoreInstruction};
1
+ import{a}from"../chunk-B56GMANB.js";import"../chunk-S7ZQTZNB.js";import"../chunk-E5FI5YHO.js";import"../chunk-I2U5GNNM.js";import"../chunk-XQYAVSUQ.js";import"../chunk-PZNWH4VQ.js";import"../chunk-ZLLER3HP.js";export{a as restoreInstruction};