@cleocode/cleo 2026.10.3 → 2026.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/bin/cleo.js +11 -1
  2. package/dist/cli/adapter-LVXHFBC4.js +158 -0
  3. package/dist/cli/add-WUAV7LDT.js +443 -0
  4. package/dist/cli/add-batch-U2DLKAQC.js +163 -0
  5. package/dist/cli/admin-I7BQYVZD.js +340 -0
  6. package/dist/cli/adr-K2THMQBS.js +171 -0
  7. package/dist/cli/agent-WQ6XY2DW.js +2366 -0
  8. package/dist/cli/agent-outputs-BJIYLVTU.js +84 -0
  9. package/dist/cli/analyze-PGQZWGOC.js +48 -0
  10. package/dist/cli/archive-5LZPF7C3.js +64 -0
  11. package/dist/cli/archive-stats-U6CYC6JM.js +100 -0
  12. package/dist/cli/attention-SOURWCNI.js +167 -0
  13. package/dist/cli/audit-FO2Y4LH2.js +122 -0
  14. package/dist/cli/auth-ED7TAIXI.js +491 -0
  15. package/dist/cli/backfill-32TRAYRD.js +156 -0
  16. package/dist/cli/backup-LEJMZJKL.js +587 -0
  17. package/dist/cli/backup-inspect-6HPLUEI2.js +26 -0
  18. package/dist/cli/backup-recover-2BTYBZU2.js +29 -0
  19. package/dist/cli/blockers-5JULUJTV.js +54 -0
  20. package/dist/cli/brain-273N3FW4.js +400 -0
  21. package/dist/cli/briefing-7H6OLECX.js +212 -0
  22. package/dist/cli/caamp-MFQVN6VU.js +181 -0
  23. package/dist/cli/cancel-SCMJTXZB.js +84 -0
  24. package/dist/cli/canon-NPF5RODM.js +142 -0
  25. package/dist/cli/canon-docs-2GTOLF7Y.js +26 -0
  26. package/dist/cli/cant-46XCUP4P.js +239 -0
  27. package/dist/cli/changeset-32NMBGG2.js +248 -0
  28. package/dist/cli/check-RWJLBCI2.js +907 -0
  29. package/dist/cli/checkpoint-37HMMKD7.js +128 -0
  30. package/dist/cli/chunk-2JIJD2I7.js +108 -0
  31. package/dist/cli/chunk-37NU2XDP.js +171 -0
  32. package/dist/cli/chunk-3IOQVUO7.js +17308 -0
  33. package/dist/cli/chunk-3PGH67MT.js +175 -0
  34. package/dist/cli/chunk-3ZO3M37V.js +1002 -0
  35. package/dist/cli/chunk-47JYZAMS.js +30 -0
  36. package/dist/cli/chunk-5J2VH3BC.js +66 -0
  37. package/dist/cli/chunk-5ZFFUFH7.js +92 -0
  38. package/dist/cli/chunk-6JSJNYH2.js +114 -0
  39. package/dist/cli/chunk-7INMKEAD.js +85 -0
  40. package/dist/cli/chunk-A2IUEIM5.js +278 -0
  41. package/dist/cli/chunk-AWCQH2W5.js +35 -0
  42. package/dist/cli/chunk-AYA6F4ZT.js +56 -0
  43. package/dist/cli/chunk-BCEXRFA2.js +76 -0
  44. package/dist/cli/chunk-BPEVD37G.js +124 -0
  45. package/dist/cli/chunk-C3B7C43W.js +16 -0
  46. package/dist/cli/chunk-DVTPIZJM.js +72 -0
  47. package/dist/cli/chunk-DYABOIHB.js +96 -0
  48. package/dist/cli/chunk-EBRZ76HS.js +51 -0
  49. package/dist/cli/chunk-EGOTK2HA.js +57 -0
  50. package/dist/cli/chunk-EOPQFCSR.js +148 -0
  51. package/dist/cli/chunk-FORFDPP5.js +288 -0
  52. package/dist/cli/chunk-GFGLLDXX.js +110 -0
  53. package/dist/cli/chunk-GH37QXW5.js +280 -0
  54. package/dist/cli/chunk-GZFVDR44.js +320 -0
  55. package/dist/cli/chunk-I3CRQQAD.js +225 -0
  56. package/dist/cli/chunk-J3ZFM3UQ.js +754 -0
  57. package/dist/cli/chunk-JNZJPIPJ.js +90 -0
  58. package/dist/cli/chunk-KHB52JNB.js +209 -0
  59. package/dist/cli/chunk-KJDWWQFY.js +46 -0
  60. package/dist/cli/chunk-LKNUA3SB.js +83 -0
  61. package/dist/cli/chunk-LVGIFMCV.js +163 -0
  62. package/dist/cli/chunk-LWQBJQSE.js +67 -0
  63. package/dist/cli/chunk-MNJRLSEQ.js +107 -0
  64. package/dist/cli/chunk-NRKWJLMS.js +91 -0
  65. package/dist/cli/chunk-NSHV2JNM.js +48 -0
  66. package/dist/cli/chunk-NWTATTEQ.js +210 -0
  67. package/dist/cli/chunk-OAPN46TC.js +89 -0
  68. package/dist/cli/chunk-OGV57L4J.js +59 -0
  69. package/dist/cli/chunk-OILHT47L.js +252 -0
  70. package/dist/cli/chunk-OPTEQKBB.js +258 -0
  71. package/dist/cli/chunk-PKKZPOOP.js +352 -0
  72. package/dist/cli/chunk-QA6T2LQ5.js +71 -0
  73. package/dist/cli/chunk-QFFQSKRC.js +4497 -0
  74. package/dist/cli/chunk-QPUY2HQZ.js +74 -0
  75. package/dist/cli/chunk-REUTEW3O.js +258 -0
  76. package/dist/cli/chunk-S24YI723.js +88 -0
  77. package/dist/cli/chunk-SXXOC6KZ.js +209 -0
  78. package/dist/cli/chunk-ULN4OKQQ.js +259 -0
  79. package/dist/cli/chunk-V5GBGOGM.js +46 -0
  80. package/dist/cli/chunk-VLEYOOPH.js +31 -0
  81. package/dist/cli/chunk-W33Q3FBH.js +66 -0
  82. package/dist/cli/chunk-W3JLYKKY.js +140 -0
  83. package/dist/cli/chunk-XRAX6XFP.js +48 -0
  84. package/dist/cli/chunk-YGKEECTI.js +78 -0
  85. package/dist/cli/chunk-YUZJI67I.js +108 -0
  86. package/dist/cli/chunk-YY66LFZF.js +29 -0
  87. package/dist/cli/chunk-ZBISIPCK.js +78 -0
  88. package/dist/cli/chunk-ZZTHTMQP.js +77 -0
  89. package/dist/cli/claim-KPENYHIQ.js +96 -0
  90. package/dist/cli/classify-DRVMCFQU.js +117 -0
  91. package/dist/cli/cli-T3CR7J57.js +48 -0
  92. package/dist/cli/cloud-PPQ4O5TX.js +565 -0
  93. package/dist/cli/cockpit-RZKLGYPN.js +790 -0
  94. package/dist/cli/code-Z5CTMVTD.js +178 -0
  95. package/dist/cli/complete-UBOCOBRB.js +34 -0
  96. package/dist/cli/complexity-BV2AGQRZ.js +56 -0
  97. package/dist/cli/compliance-32PD5Y47.js +276 -0
  98. package/dist/cli/conduit-VDKCH33F.js +307 -0
  99. package/dist/cli/config-I72JAXK4.js +516 -0
  100. package/dist/cli/consensus-LFILLSTK.js +121 -0
  101. package/dist/cli/context-XUUVFVTP.js +141 -0
  102. package/dist/cli/contribution-37NQ4N5R.js +111 -0
  103. package/dist/cli/curator-TFDXU2EX.js +139 -0
  104. package/dist/cli/current-C4SN5BWV.js +42 -0
  105. package/dist/cli/daemon-DV25JQ62.js +451 -0
  106. package/dist/cli/dash-TFU4RLQW.js +70 -0
  107. package/dist/cli/decide-5VPMNTSI.js +419 -0
  108. package/dist/cli/decompose-KOYEZNJL.js +77 -0
  109. package/dist/cli/decomposition-7OHUFIQN.js +121 -0
  110. package/dist/cli/delete-Q7YCAFY5.js +68 -0
  111. package/dist/cli/deps-6UZKLDGJ.js +463 -0
  112. package/dist/cli/detect-FERY35UL.js +45 -0
  113. package/dist/cli/detect-drift-UL2JTPUK.js +408 -0
  114. package/dist/cli/diagnostics-TI5QAZXR.js +132 -0
  115. package/dist/cli/docs-QI2PRN3T.js +3095 -0
  116. package/dist/cli/doctor-AX5TICQO.js +1253 -0
  117. package/dist/cli/doctor-ac-bindings-YPMYHU2G.js +26 -0
  118. package/dist/cli/doctor-acceptance-drift-PYNFGMKB.js +26 -0
  119. package/dist/cli/doctor-credentials-UZRIADKM.js +26 -0
  120. package/dist/cli/doctor-db-substrate-Q2TOYM2S.js +27 -0
  121. package/dist/cli/doctor-dep-cycles-GCVYZY6F.js +26 -0
  122. package/dist/cli/doctor-exodus-RO5SUTC2.js +26 -0
  123. package/dist/cli/doctor-exodus-residue-EM2AWQXP.js +26 -0
  124. package/dist/cli/doctor-fk-check-Q3FOLECE.js +26 -0
  125. package/dist/cli/doctor-global-delivery-TNOAQ3NP.js +26 -0
  126. package/dist/cli/doctor-heavy-command-hook-IO3QAQLG.js +26 -0
  127. package/dist/cli/doctor-legacy-backups-O2YH5VLS.js +26 -0
  128. package/dist/cli/doctor-legacy-reaper-VSEJEIFA.js +26 -0
  129. package/dist/cli/doctor-malformed-ids-LQ766V5K.js +26 -0
  130. package/dist/cli/doctor-manifest-rows-6FQDNHLH.js +26 -0
  131. package/dist/cli/doctor-memory-guard-J4PSEKB5.js +26 -0
  132. package/dist/cli/doctor-migrations-ONOH56YM.js +26 -0
  133. package/dist/cli/doctor-nexus-residency-FUQAX7PV.js +26 -0
  134. package/dist/cli/doctor-project-identity-GUDK3HYX.js +26 -0
  135. package/dist/cli/doctor-projects-7L3BNL4O.js +30 -0
  136. package/dist/cli/doctor-projects-registry-TEAVHFQU.js +26 -0
  137. package/dist/cli/doctor-release-readiness-IEGHX6SL.js +26 -0
  138. package/dist/cli/doctor-repair-NBONOSZU.js +26 -0
  139. package/dist/cli/doctor-skill-fixtures-7Y6L34A3.js +26 -0
  140. package/dist/cli/doctor-split-brain-TUKIGVHF.js +26 -0
  141. package/dist/cli/doctor-superseded-store-BHZY2B2L.js +26 -0
  142. package/dist/cli/doctor-tool-locks-REQMIVYK.js +26 -0
  143. package/dist/cli/doctor-twin-collapse-222GOSPE.js +26 -0
  144. package/dist/cli/doctor-worktree-stores-J7TCRVJ3.js +26 -0
  145. package/dist/cli/done-V3AOO65B.js +195 -0
  146. package/dist/cli/dynamic-RR4HB7BB.js +29 -0
  147. package/dist/cli/event-EGNPGE5A.js +372 -0
  148. package/dist/cli/exists-H4SDCBPL.js +65 -0
  149. package/dist/cli/exodus-KALO3B3X.js +401 -0
  150. package/dist/cli/export-ROFOCG4M.js +92 -0
  151. package/dist/cli/export-tasks-US3WBIEQ.js +96 -0
  152. package/dist/cli/federation-SUIB5QWT.js +145 -0
  153. package/dist/cli/find-YICG4BG6.js +177 -0
  154. package/dist/cli/focus-TKCZPKOM.js +55 -0
  155. package/dist/cli/gateway-H4HFDC3E.js +77 -0
  156. package/dist/cli/gateway-auto-start-EDK7XI6E.js +36 -0
  157. package/dist/cli/gc-5R2TUY5T.js +291 -0
  158. package/dist/cli/go-PRQFK5YG.js +206 -0
  159. package/dist/cli/goal-7CZRMLHC.js +212 -0
  160. package/dist/cli/grade-PY2YRPUS.js +56 -0
  161. package/dist/cli/graph-XIXMCFKG.js +878 -0
  162. package/dist/cli/history-EIXADPAD.js +137 -0
  163. package/dist/cli/hook-UF7J7R6D.js +57 -0
  164. package/dist/cli/hook-entry.js +244 -19
  165. package/dist/cli/hygiene-3QZ2NI7P.js +55 -0
  166. package/dist/cli/import-R73SO444.js +88 -0
  167. package/dist/cli/import-tasks-O22FZJ4U.js +108 -0
  168. package/dist/cli/index.js +419 -94612
  169. package/dist/cli/init-IHEJDQWU.js +40 -0
  170. package/dist/cli/inject-LSRVWNCP.js +82 -0
  171. package/dist/cli/install-global-4AZUCH6U.js +95 -0
  172. package/dist/cli/intelligence-2OSFOGD2.js +181 -0
  173. package/dist/cli/issue-IIWEDNFC.js +158 -0
  174. package/dist/cli/janitor-GPMC7VOR.js +111 -0
  175. package/dist/cli/labels-5NPOIQXN.js +87 -0
  176. package/dist/cli/lifecycle-4FFS2K2T.js +272 -0
  177. package/dist/cli/list-47KEUGPQ.js +108 -0
  178. package/dist/cli/llm-G5B3I6GD.js +703 -0
  179. package/dist/cli/llm-cost-S7RS6BVA.js +25 -0
  180. package/dist/cli/llm-stream-24A45NTS.js +27 -0
  181. package/dist/cli/log-XF6H2XSD.js +75 -0
  182. package/dist/cli/login-LBPLGHYG.js +43 -0
  183. package/dist/cli/logout-SX4JSJIV.js +74 -0
  184. package/dist/cli/manifest-NMCW4PIW.js +353 -0
  185. package/dist/cli/map-BU72KMGF.js +52 -0
  186. package/dist/cli/memory-UHYIVGVM.js +1956 -0
  187. package/dist/cli/migrate-agents-v2-OO7OILZK.js +33 -0
  188. package/dist/cli/migrate-claude-mem-EDNYUY3K.js +201 -0
  189. package/dist/cli/next-RZFRG5X7.js +56 -0
  190. package/dist/cli/nexus-4S4Z5EVU.js +2923 -0
  191. package/dist/cli/ops-KR7AWCG3.js +51 -0
  192. package/dist/cli/orchestrate-HOYZY3VX.js +948 -0
  193. package/dist/cli/otel-U7IIRBCT.js +188 -0
  194. package/dist/cli/phase-NYZFHUE5.js +220 -0
  195. package/dist/cli/pivot-FF2CVUZL.js +87 -0
  196. package/dist/cli/plan-3SL2NTRV.js +48 -0
  197. package/dist/cli/playbook-2FCBV7N3.js +229 -0
  198. package/dist/cli/project-WDX2TGMC.js +330 -0
  199. package/dist/cli/promote-YINYFBZY.js +52 -0
  200. package/dist/cli/provenance-C7AYD7WG.js +128 -0
  201. package/dist/cli/provider-QLJEDQBR.js +212 -0
  202. package/dist/cli/reason-JF5BHBM5.js +137 -0
  203. package/dist/cli/reconcile-NMISHDGX.js +127 -0
  204. package/dist/cli/refresh-memory-EY5YNICV.js +45 -0
  205. package/dist/cli/relates-R3ZPICAY.js +259 -0
  206. package/dist/cli/release-4ZJTMUUT.js +524 -0
  207. package/dist/cli/remote-QSONJDIK.js +279 -0
  208. package/dist/cli/renderers-64OR3IWX.js +37 -0
  209. package/dist/cli/reorder-J3DOE7ST.js +86 -0
  210. package/dist/cli/reparent-2OUMKEZX.js +58 -0
  211. package/dist/cli/req-TZB7OFKO.js +129 -0
  212. package/dist/cli/research-MTD7EX45.js +365 -0
  213. package/dist/cli/restore-VEUOX7NF.js +423 -0
  214. package/dist/cli/revert-3YF2IL5G.js +240 -0
  215. package/dist/cli/roadmap-7OOQLXKG.js +61 -0
  216. package/dist/cli/run-2U5NZV5Z.js +211 -0
  217. package/dist/cli/safestop-VR4VK56D.js +88 -0
  218. package/dist/cli/saga-SEWPIOX2.js +285 -0
  219. package/dist/cli/schema-C52WZ35V.js +195 -0
  220. package/dist/cli/self-update-GQIGUDPS.js +504 -0
  221. package/dist/cli/selfimprove-3Y5L4ECT.js +88 -0
  222. package/dist/cli/sentient-M4YMAVGV.js +1088 -0
  223. package/dist/cli/sequence-6UBMA4IF.js +93 -0
  224. package/dist/cli/service-5R7SILZ7.js +155 -0
  225. package/dist/cli/session-3C6AAC4Y.js +707 -0
  226. package/dist/cli/setup-BTUBW5PU.js +323 -0
  227. package/dist/cli/show-MXT2V7TF.js +122 -0
  228. package/dist/cli/skill-GFUZOU2C.js +84 -0
  229. package/dist/cli/skills-EDWLKAF3.js +928 -0
  230. package/dist/cli/smoke-provider-SKUFMZXU.js +218 -0
  231. package/dist/cli/snapshot-GUWMURCM.js +119 -0
  232. package/dist/cli/src-66GAKPXR.js +80 -0
  233. package/dist/cli/start-QFG56RGN.js +67 -0
  234. package/dist/cli/stats-GW55P7RR.js +95 -0
  235. package/dist/cli/status-46HTKNRR.js +157 -0
  236. package/dist/cli/sticky-2DUZOUGI.js +338 -0
  237. package/dist/cli/stop-J2QEUKHX.js +42 -0
  238. package/dist/cli/sync-GJP2QYT5.js +154 -0
  239. package/dist/cli/tasks-BNXTM7PB.js +174 -0
  240. package/dist/cli/telemetry-55Z2XJWL.js +120 -0
  241. package/dist/cli/templates-7O77TKPV.js +611 -0
  242. package/dist/cli/testing-37YTBNKP.js +146 -0
  243. package/dist/cli/token-UAVJMNUI.js +220 -0
  244. package/dist/cli/transcript-LORQTV5Z.js +440 -0
  245. package/dist/cli/tui-BPUFHYKK.js +51 -0
  246. package/dist/cli/update-NVCYV2FT.js +476 -0
  247. package/dist/cli/upgrade-OXJXOGEF.js +243 -0
  248. package/dist/cli/verify-LYLDHPT2.js +190 -0
  249. package/dist/cli/web-QP2RP266.js +275 -0
  250. package/dist/cli/workgraph-FXBSZDQE.js +232 -0
  251. package/dist/cli/worktree-6RXAJIST.js +370 -0
  252. package/package.json +13 -13
  253. package/studio-dist/client/_app/immutable/chunks/{DMj27Pxj.js → Btgeq_wq.js} +1 -1
  254. package/studio-dist/client/_app/immutable/chunks/{qq3pe1aT.js → CgBjxmu6.js} +1 -1
  255. package/studio-dist/client/_app/immutable/chunks/{Dc2owyvE.js → DgEKqO6r.js} +1 -1
  256. package/studio-dist/client/_app/immutable/chunks/t81h7afa.js +1 -0
  257. package/studio-dist/client/_app/immutable/entry/{app.CHWXLeE9.js → app.a02HWaRB.js} +2 -2
  258. package/studio-dist/client/_app/immutable/entry/start.BreMSngo.js +1 -0
  259. package/studio-dist/client/_app/immutable/nodes/{0.DmKQGvFh.js → 0.nTXyRfc-.js} +1 -1
  260. package/studio-dist/client/_app/immutable/nodes/{1.DqJk_REO.js → 1.4zrWeHtl.js} +1 -1
  261. package/studio-dist/client/_app/immutable/nodes/{15.GUy6kdW1.js → 15.D9mk4JyY.js} +1 -1
  262. package/studio-dist/client/_app/immutable/nodes/{16.CcnKZ8f9.js → 16._-wt-sQf.js} +1 -1
  263. package/studio-dist/client/_app/immutable/nodes/{17.DAlQF3lQ.js → 17.CUu6LQDj.js} +1 -1
  264. package/studio-dist/client/_app/immutable/nodes/{18.vQFr-vFj.js → 18.Dz4QRTkX.js} +1 -1
  265. package/studio-dist/client/_app/immutable/nodes/{20.GVOj5j_r.js → 20.CJ2_EB0U.js} +1 -1
  266. package/studio-dist/client/_app/immutable/nodes/{24.2-wC6DOh.js → 24.Igj2FS7k.js} +1 -1
  267. package/studio-dist/client/_app/immutable/nodes/{25.D1vYaH8g.js → 25.BnATjVGN.js} +2 -2
  268. package/studio-dist/client/_app/immutable/nodes/{26.C3rNqzZF.js → 26.6iPyjT44.js} +1 -1
  269. package/studio-dist/client/_app/immutable/nodes/{3.b-7pzc3M.js → 3.AA5GwNgP.js} +1 -1
  270. package/studio-dist/client/_app/version.json +1 -1
  271. package/studio-dist/server/chunks/{0-BaCce-O1.js → 0-DGmsoBYm.js} +3 -3
  272. package/studio-dist/server/chunks/1-8PfxPvlK.js +9 -0
  273. package/studio-dist/server/chunks/{15-DRMOSIC9.js → 15-Bg6YTndh.js} +3 -3
  274. package/studio-dist/server/chunks/{16-BulXhoZZ.js → 16-BObLwgyD.js} +3 -3
  275. package/studio-dist/server/chunks/{17-DUEOCM0H.js → 17-BNXGyAHX.js} +3 -3
  276. package/studio-dist/server/chunks/{18-DP7Q8zPs.js → 18-UqQFRIID.js} +3 -3
  277. package/studio-dist/server/chunks/{20-9ta6MI7q.js → 20-CMn8a_yP.js} +3 -3
  278. package/studio-dist/server/chunks/{24-DysdL1ab.js → 24-BuOTDzib.js} +3 -3
  279. package/studio-dist/server/chunks/{25-CYsps38R.js → 25-CIMSmjVx.js} +4 -4
  280. package/studio-dist/server/chunks/{26-Df4YXgg0.js → 26-DWGObn2T.js} +3 -3
  281. package/studio-dist/server/chunks/{3-BEhOhYpL.js → 3-CyiffdJZ.js} +3 -3
  282. package/studio-dist/server/chunks/{_layout.svelte-CnLcXYG-.js → _layout.svelte-DYtClaIk.js} +4 -4
  283. package/studio-dist/server/chunks/{_page.svelte-HUqTICJR.js → _page.svelte-1h9E6s_f.js} +3 -3
  284. package/studio-dist/server/chunks/{_page.svelte-DOl0DGOO.js → _page.svelte-BNNF62Nm.js} +3 -3
  285. package/studio-dist/server/chunks/{_page.svelte-DzcZljiy.js → _page.svelte-BT1EUadj.js} +5 -5
  286. package/studio-dist/server/chunks/{_page.svelte-Dv8tmDEC.js → _page.svelte-Bip079LT.js} +3 -3
  287. package/studio-dist/server/chunks/{_page.svelte-DGhXqeRc.js → _page.svelte-CEATWp_5.js} +3 -3
  288. package/studio-dist/server/chunks/{_page.svelte-C0qgUvzA.js → _page.svelte-CV3xiD1y.js} +4 -4
  289. package/studio-dist/server/chunks/{_page.svelte-CbyEPj2j.js → _page.svelte-Cv_KVJDV.js} +3 -3
  290. package/studio-dist/server/chunks/{_page.svelte-ui7LnWkL.js → _page.svelte-DSSy6LuK.js} +3 -3
  291. package/studio-dist/server/chunks/{_page.svelte-Da4q5l93.js → _page.svelte-TF795TAS.js} +3 -3
  292. package/studio-dist/server/chunks/{_server.ts-CnKVmf_s.js → _server.ts-BlhRFLY3.js} +2 -2
  293. package/studio-dist/server/chunks/{_server.ts-Cr57EKWf.js → _server.ts-C4w6UdU0.js} +3 -3
  294. package/studio-dist/server/chunks/{_server.ts-P4wVVksg.js → _server.ts-CzrwbhkQ.js} +3 -3
  295. package/studio-dist/server/chunks/{_server.ts-2BazvYRP.js → _server.ts-DWt8Dziu.js} +3 -3
  296. package/studio-dist/server/chunks/{_server.ts-C0evMKCk.js → _server.ts-Db6mEile.js} +3 -3
  297. package/studio-dist/server/chunks/{client-CPM4LrO2.js → client-D8f2k-H_.js} +2 -2
  298. package/studio-dist/server/chunks/{dist-CdoCt9zT.js → dist-B8xbIrdB.js} +3 -1
  299. package/studio-dist/server/chunks/{error.svelte-ShcZo43D.js → error.svelte-DbbOwIme.js} +3 -3
  300. package/studio-dist/server/chunks/{http-BiQjEmVU.js → http-1ftNGTs5.js} +2 -2
  301. package/studio-dist/server/chunks/{internal-Cgsrya1j.js → internal-CTULuLPB.js} +2 -2
  302. package/studio-dist/server/chunks/{stores-BGrpEDMK.js → stores-CS5XOReX.js} +2 -2
  303. package/studio-dist/server/index.js +1 -1
  304. package/studio-dist/server/manifest.js +17 -17
  305. package/studio-dist/client/_app/immutable/chunks/Bw6J8NDM.js +0 -1
  306. package/studio-dist/client/_app/immutable/entry/start.C9bwPpvc.js +0 -1
  307. package/studio-dist/server/chunks/1-CVo7Nk6d.js +0 -9
@@ -0,0 +1,137 @@
1
+ (() => {
2
+ const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
3
+ if (globalThis[_installed]) return;
4
+ globalThis[_installed] = true;
5
+ const _origEmitWarning = process.emitWarning;
6
+ process.emitWarning = function(warning, type, code, ctor) {
7
+ if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
8
+ return;
9
+ }
10
+ if (typeof warning === 'string' && /SQLite is an experimental feature/i.test(warning)) {
11
+ return;
12
+ }
13
+ return _origEmitWarning.call(process, warning, type, code, ctor);
14
+ };
15
+ })();
16
+ import {
17
+ defineCommand,
18
+ showUsage
19
+ } from "./chunk-PKKZPOOP.js";
20
+ import {
21
+ dispatchFromCli
22
+ } from "./chunk-3IOQVUO7.js";
23
+ import "./chunk-AWCQH2W5.js";
24
+ import "./chunk-OGV57L4J.js";
25
+ import "./chunk-ZBISIPCK.js";
26
+ import "./chunk-3ZO3M37V.js";
27
+ import "./chunk-6JSJNYH2.js";
28
+ import "./chunk-QFFQSKRC.js";
29
+
30
+ // packages/cleo/src/cli/commands/history.ts
31
+ var logCommand = defineCommand({
32
+ meta: { name: "log", description: "Show operation audit log" },
33
+ args: {
34
+ days: {
35
+ type: "string",
36
+ description: "Show last N days",
37
+ default: "30"
38
+ },
39
+ since: {
40
+ type: "string",
41
+ description: "Show completions since date (YYYY-MM-DD)"
42
+ },
43
+ until: {
44
+ type: "string",
45
+ description: "Show completions until date (YYYY-MM-DD)"
46
+ },
47
+ "no-chart": {
48
+ type: "boolean",
49
+ description: "Disable bar charts",
50
+ default: false
51
+ }
52
+ },
53
+ async run({ args }) {
54
+ await dispatchFromCli(
55
+ "query",
56
+ "admin",
57
+ "log",
58
+ {
59
+ days: Number.parseInt(args.days, 10),
60
+ since: args.since,
61
+ until: args.until
62
+ },
63
+ { command: "history" }
64
+ );
65
+ }
66
+ });
67
+ var workCommand = defineCommand({
68
+ meta: { name: "work", description: "Show task work history (time tracked per task)" },
69
+ async run() {
70
+ await dispatchFromCli("query", "tasks", "history", {}, { command: "history" });
71
+ }
72
+ });
73
+ var rankingCommand = defineCommand({
74
+ meta: {
75
+ name: "ranking",
76
+ description: "Who changed a task's priority, severity, kind or depends \u2014 actor, session, reason, before/after (D11161)"
77
+ },
78
+ args: {
79
+ taskId: { type: "positional", description: "Task ID", required: true },
80
+ limit: { type: "string", description: "Maximum entries (default 50)" }
81
+ },
82
+ async run({ args }) {
83
+ await dispatchFromCli(
84
+ "query",
85
+ "tasks",
86
+ "history",
87
+ {
88
+ taskId: String(args.taskId),
89
+ ranking: true,
90
+ ...args.limit !== void 0 ? { limit: Number.parseInt(String(args.limit), 10) } : {}
91
+ },
92
+ { command: "history" }
93
+ );
94
+ }
95
+ });
96
+ var revertCommand = defineCommand({
97
+ meta: {
98
+ name: "revert",
99
+ description: "Undo one ranking change (an entry id from `cleo history ranking`); refused if a field changed again since, unless --force"
100
+ },
101
+ args: {
102
+ entryId: { type: "positional", description: "ranking_changed entry id", required: true },
103
+ reason: { type: "string", description: "Why it is reverted (recorded)" },
104
+ force: { type: "boolean", description: "Revert even though a field changed again since" }
105
+ },
106
+ async run({ args }) {
107
+ await dispatchFromCli(
108
+ "mutate",
109
+ "tasks",
110
+ "ranking.revert",
111
+ {
112
+ entryId: String(args.entryId),
113
+ ...args.reason !== void 0 ? { reason: String(args.reason) } : {},
114
+ ...args.force === true ? { force: true } : {}
115
+ },
116
+ { command: "history" }
117
+ );
118
+ }
119
+ });
120
+ var historyCommand = defineCommand({
121
+ meta: { name: "history", description: "Completion timeline and productivity analytics" },
122
+ subCommands: {
123
+ log: logCommand,
124
+ work: workCommand,
125
+ ranking: rankingCommand,
126
+ revert: revertCommand
127
+ },
128
+ async run({ cmd, rawArgs }) {
129
+ const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
130
+ if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
131
+ await showUsage(cmd);
132
+ }
133
+ });
134
+ export {
135
+ historyCommand
136
+ };
137
+ //# sourceMappingURL=history-EIXADPAD.js.map
@@ -0,0 +1,57 @@
1
+ (() => {
2
+ const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
3
+ if (globalThis[_installed]) return;
4
+ globalThis[_installed] = true;
5
+ const _origEmitWarning = process.emitWarning;
6
+ process.emitWarning = function(warning, type, code, ctor) {
7
+ if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
8
+ return;
9
+ }
10
+ if (typeof warning === 'string' && /SQLite is an experimental feature/i.test(warning)) {
11
+ return;
12
+ }
13
+ return _origEmitWarning.call(process, warning, type, code, ctor);
14
+ };
15
+ })();
16
+ import "./chunk-C3B7C43W.js";
17
+ import {
18
+ defineCommand,
19
+ showUsage
20
+ } from "./chunk-PKKZPOOP.js";
21
+
22
+ // packages/cleo/src/cli/commands/hook.ts
23
+ var heavyCommandSubcommand = defineCommand({
24
+ meta: {
25
+ name: "heavy-command",
26
+ description: "PreToolUse hook: route heavy shell commands (tests, builds, typechecks, installs) through cleo run. Reads the hook JSON on stdin; prints the harness answer."
27
+ },
28
+ args: {
29
+ provider: {
30
+ type: "string",
31
+ description: "Harness protocol to answer in: claude-code (default), codex, kimi, opencode"
32
+ }
33
+ },
34
+ async run({ args }) {
35
+ const { runHookCli } = await import("./hook-entry.js");
36
+ const provider = typeof args.provider === "string" ? args.provider : "claude-code";
37
+ process.exitCode = await runHookCli(["heavy-command", "--provider", provider]);
38
+ }
39
+ });
40
+ var hookCommand = defineCommand({
41
+ meta: {
42
+ name: "hook",
43
+ description: "Agent-harness hooks installed by cleo init/upgrade; stdout is the harness hook protocol, not LAFS: cleo hook heavy-command --provider claude-code|codex|kimi|opencode"
44
+ },
45
+ subCommands: {
46
+ "heavy-command": heavyCommandSubcommand
47
+ },
48
+ async run({ cmd, rawArgs }) {
49
+ const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
50
+ if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
51
+ await showUsage(cmd);
52
+ }
53
+ });
54
+ export {
55
+ hookCommand
56
+ };
57
+ //# sourceMappingURL=hook-UF7J7R6D.js.map
@@ -1,4 +1,7 @@
1
1
  (() => {
2
+ const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
3
+ if (globalThis[_installed]) return;
4
+ globalThis[_installed] = true;
2
5
  const _origEmitWarning = process.emitWarning;
3
6
  process.emitWarning = function(warning, type, code, ctor) {
4
7
  if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
@@ -12,7 +15,8 @@
12
15
  })();
13
16
 
14
17
  // packages/cleo/src/cli/hook-entry.ts
15
- import { readdirSync, readFileSync } from "node:fs";
18
+ import { execFileSync } from "node:child_process";
19
+ import { existsSync, readdirSync, readFileSync } from "node:fs";
16
20
  import { homedir } from "node:os";
17
21
  import { join } from "node:path";
18
22
  var HEAVY_HOOK_PROVIDERS = [
@@ -27,6 +31,13 @@ var MIN_WAIT_SEC = 30;
27
31
  var MAX_WAIT_SEC = 300;
28
32
  var DEFAULT_WAIT_SEC = 60;
29
33
  var REWRITE_MODES = /* @__PURE__ */ new Set(["bypassPermissions", "auto"]);
34
+ var PRE_APPROVE_MODES = /* @__PURE__ */ new Set([
35
+ "default",
36
+ "acceptEdits",
37
+ "dontAsk",
38
+ "auto"
39
+ ]);
40
+ var PRE_APPROVED_REASON = "[cleo] your allow rules approve this command; the hook only queues it for the machine-wide budget";
30
41
  var MAX_STDIN_BYTES = 1024 * 1024;
31
42
  async function readProcessStdin() {
32
43
  if (process.stdin.isTTY) return "";
@@ -119,7 +130,7 @@ function heavyHookContext(plan, pressure, provider = "claude-code") {
119
130
  function demote(plan, reason) {
120
131
  return plan.action === "rewrite" ? { action: "warn", reason, segments: plan.segments } : plan;
121
132
  }
122
- function renderHeavyHookAnswer(provider, toolInput, plan, context, timeoutMs) {
133
+ function renderHeavyHookAnswer(provider, toolInput, plan, context, timeoutMs, preApproved = false) {
123
134
  if (plan.action === "none" && context === "") return "";
124
135
  const rewrite = plan.action === "rewrite";
125
136
  if (provider === "opencode") {
@@ -149,10 +160,12 @@ function renderHeavyHookAnswer(provider, toolInput, plan, context, timeoutMs) {
149
160
  command: plan.command,
150
161
  ...provider === "claude-code" && timeoutMs !== void 0 ? { timeout: timeoutMs } : {}
151
162
  } : void 0;
163
+ const allow = rewrite && (provider === "codex" || preApproved);
152
164
  const output = {
153
165
  hookSpecificOutput: {
154
166
  hookEventName: "PreToolUse",
155
- ...rewrite && provider === "codex" ? { permissionDecision: "allow" } : {},
167
+ ...allow ? { permissionDecision: "allow" } : {},
168
+ ...allow && provider === "claude-code" ? { permissionDecisionReason: PRE_APPROVED_REASON } : {},
156
169
  ...updatedInput === void 0 ? {} : { updatedInput },
157
170
  ...context === "" ? {} : { additionalContext: context }
158
171
  }
@@ -175,12 +188,33 @@ function heavyRuleWords(argv) {
175
188
  function ruleWords(pattern) {
176
189
  return pattern.split(/[\s:*()]+/).filter((w) => w !== "" && !w.startsWith("-")).map(wordBase);
177
190
  }
178
- function claudeRuleFiles(projectDir, env) {
179
- const managed = process.platform === "darwin" ? "/Library/Application Support/ClaudeCode/managed-settings.json" : process.platform === "win32" ? "C:\\Program Files\\ClaudeCode\\managed-settings.json" : "/etc/claude-code/managed-settings.json";
180
- const configDir = env.CLAUDE_CONFIG_DIR || join(env.HOME || homedir(), ".claude");
191
+ function claudeRuleFiles(projectDir, env, managedDir = claudeManagedDir()) {
192
+ return [...claudeManagedFiles(env, managedDir), ...claudeSettingsFiles(projectDir, env)];
193
+ }
194
+ function claudeManagedDir(platform = process.platform) {
195
+ return platform === "darwin" ? "/Library/Application Support/ClaudeCode" : platform === "win32" ? "C:\\Program Files\\ClaudeCode" : "/etc/claude-code";
196
+ }
197
+ function claudeConfigDir(env) {
198
+ return env.CLAUDE_CONFIG_DIR || join(env.HOME || homedir(), ".claude");
199
+ }
200
+ function claudeManagedFiles(env, managedDir = claudeManagedDir()) {
201
+ const dropInDir = join(managedDir, "managed-settings.d");
202
+ let dropIns = [];
203
+ try {
204
+ dropIns = readdirSync(dropInDir).filter((n) => n.endsWith(".json") && !n.startsWith(".")).sort().map((n) => join(dropInDir, n));
205
+ } catch (err) {
206
+ const code = err.code;
207
+ if (code !== "ENOENT" && code !== "ENOTDIR") dropIns = [dropInDir];
208
+ }
209
+ return [
210
+ join(managedDir, "managed-settings.json"),
211
+ ...dropIns,
212
+ join(claudeConfigDir(env), "remote-settings.json")
213
+ ];
214
+ }
215
+ function claudeSettingsFiles(projectDir, env) {
181
216
  return [
182
- managed,
183
- join(configDir, "settings.json"),
217
+ join(claudeConfigDir(env), "settings.json"),
184
218
  join(projectDir, ".claude", "settings.json"),
185
219
  join(projectDir, ".claude", "settings.local.json")
186
220
  ];
@@ -197,24 +231,154 @@ function claudeGuardedBashRules(files) {
197
231
  if (code !== "ENOENT" && code !== "ENOTDIR") unreadable ??= file;
198
232
  continue;
199
233
  }
200
- const permissions = isRecord(raw) ? raw.permissions : void 0;
201
- if (!isRecord(permissions)) continue;
202
- for (const key of ["deny", "ask"]) {
234
+ patterns.push(...bashRulePatterns(raw, ["deny", "ask"], 4));
235
+ }
236
+ return { patterns, unreadable };
237
+ }
238
+ function bashRulePatterns(doc, keys, depth = 0) {
239
+ if (!isRecord(doc)) return [];
240
+ const out = [];
241
+ const permissions = doc.permissions;
242
+ if (isRecord(permissions)) {
243
+ for (const key of keys) {
203
244
  const rules = permissions[key];
204
245
  if (!Array.isArray(rules)) continue;
205
246
  for (const rule of rules) {
206
247
  if (typeof rule !== "string") continue;
207
248
  const trimmed = rule.trim();
208
249
  if (trimmed === "Bash") {
209
- patterns.push("*");
250
+ out.push("*");
210
251
  continue;
211
252
  }
212
253
  const match = /^Bash\((.*)\)$/s.exec(trimmed);
213
- if (match?.[1] !== void 0) patterns.push(match[1]);
254
+ if (match?.[1] !== void 0) out.push(match[1]);
214
255
  }
215
256
  }
216
257
  }
217
- return { patterns, unreadable };
258
+ if (depth > 0) {
259
+ for (const [key, value] of Object.entries(doc)) {
260
+ if (key !== "permissions") out.push(...bashRulePatterns(value, keys, depth - 1));
261
+ }
262
+ }
263
+ return out;
264
+ }
265
+ function setsTrue(doc, key, depth) {
266
+ if (!isRecord(doc)) return false;
267
+ if (doc[key] === true) return true;
268
+ return depth > 0 && Object.values(doc).some((v) => setsTrue(v, key, depth - 1));
269
+ }
270
+ var CLAUDE_RULE_FLAGS = /(?:^|\s)--(?:disallowedTools|disallowed-tools|settings|setting-sources)(?=[=\s]|$)/;
271
+ var ANCESTOR_DEPTH = 8;
272
+ function ancestorCommandText() {
273
+ const chain = [];
274
+ let pid = process.ppid;
275
+ if (process.platform === "linux") {
276
+ const lines = [];
277
+ for (let d = 0; d < ANCESTOR_DEPTH && pid > 1; d++) {
278
+ try {
279
+ lines.push(readFileSync(`/proc/${pid}/cmdline`, "utf-8").split("\0").join(" "));
280
+ const stat = readFileSync(`/proc/${pid}/stat`, "utf-8");
281
+ pid = Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]);
282
+ } catch {
283
+ return null;
284
+ }
285
+ }
286
+ return lines.join("\n");
287
+ }
288
+ const ps = (args) => {
289
+ try {
290
+ return execFileSync("ps", args, {
291
+ encoding: "utf-8",
292
+ stdio: ["ignore", "pipe", "ignore"],
293
+ timeout: 5e3,
294
+ maxBuffer: 32 * 1024 * 1024
295
+ });
296
+ } catch {
297
+ return null;
298
+ }
299
+ };
300
+ const table = ps(["-A", "-o", "pid=,ppid="]);
301
+ if (table === null) return null;
302
+ const parent = /* @__PURE__ */ new Map();
303
+ for (const line of table.split("\n")) {
304
+ const m = /^\s*(\d+)\s+(\d+)\s*$/.exec(line);
305
+ if (m?.[1] && m[2]) parent.set(Number(m[1]), Number(m[2]));
306
+ }
307
+ for (let d = 0; d < ANCESTOR_DEPTH && pid > 1; d++) {
308
+ chain.push(pid);
309
+ const next = parent.get(pid);
310
+ if (next === void 0) break;
311
+ pid = next;
312
+ }
313
+ if (chain.length === 0) return null;
314
+ return ps(["-ww", "-o", "args=", "-p", chain.join(",")]);
315
+ }
316
+ function claudeAllowContext(projectDir, env) {
317
+ const user = env.USER || env.LOGNAME;
318
+ const profileDir = "/Library/Managed Preferences";
319
+ const profiles = process.platform === "darwin" ? [
320
+ join(profileDir, "com.anthropic.claudecode.plist"),
321
+ ...user ? [join(profileDir, user, "com.anthropic.claudecode.plist")] : []
322
+ ].filter((f) => existsSync(f)) : [];
323
+ return {
324
+ managedFiles: claudeManagedFiles(env),
325
+ profiles,
326
+ settingsFiles: claudeSettingsFiles(projectDir, env),
327
+ ancestors: ancestorCommandText(),
328
+ platform: process.platform
329
+ };
330
+ }
331
+ function claudeAllowedBashRules(ctx, env) {
332
+ const untrusted = (reason) => ({ trusted: false, reason });
333
+ if (ctx.platform === "win32") {
334
+ return untrusted(
335
+ "managed policy on Windows lives in the registry, which the hook does not read"
336
+ );
337
+ }
338
+ if (env.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST) {
339
+ return untrusted("a host application supplies managed settings");
340
+ }
341
+ if (env.CLAUDE_CODE_ENTRYPOINT?.startsWith("sdk")) {
342
+ return untrusted("an Agent SDK session chooses its own settings sources");
343
+ }
344
+ if (ctx.profiles.length > 0) {
345
+ return untrusted(
346
+ `a managed configuration profile (${ctx.profiles[0]}) may restrict permission rules`
347
+ );
348
+ }
349
+ for (const file of ctx.managedFiles) {
350
+ let doc;
351
+ try {
352
+ doc = JSON.parse(readFileSync(file, "utf-8"));
353
+ } catch (err) {
354
+ const code = err.code;
355
+ if (code === "ENOENT" || code === "ENOTDIR") continue;
356
+ return untrusted(`managed settings ${file} cannot be read or parsed`);
357
+ }
358
+ if (setsTrue(doc, "allowManagedPermissionRulesOnly", 4)) {
359
+ return untrusted("managed settings make managed permission rules the only ones that apply");
360
+ }
361
+ }
362
+ if (ctx.ancestors === null) {
363
+ return untrusted(
364
+ "the Claude Code command line cannot be read for --disallowedTools or --settings"
365
+ );
366
+ }
367
+ if (CLAUDE_RULE_FLAGS.test(ctx.ancestors)) {
368
+ return untrusted(
369
+ "Claude Code was started with --disallowedTools, --settings or --setting-sources, whose rules the hook cannot read"
370
+ );
371
+ }
372
+ const patterns = [];
373
+ for (const file of ctx.settingsFiles) {
374
+ try {
375
+ patterns.push(
376
+ ...bashRulePatterns(JSON.parse(readFileSync(file, "utf-8")), ["allow"])
377
+ );
378
+ } catch {
379
+ }
380
+ }
381
+ return { trusted: true, patterns };
218
382
  }
219
383
  function codexGuardedWords(projectDir, env) {
220
384
  const home = env.CODEX_HOME || join(env.HOME || homedir(), ".codex");
@@ -241,16 +405,23 @@ function codexGuardedWords(projectDir, env) {
241
405
  }
242
406
  return out;
243
407
  }
244
- function guardedHeavyCommand(provider, segments, projectDir, env, files = claudeRuleFiles(projectDir, env)) {
408
+ function guardedHeavyCommand(provider, segments, projectDir, env, files = claudeRuleFiles(projectDir, env), matches) {
245
409
  let rules;
246
410
  if (provider === "claude-code") {
247
411
  const found = claudeGuardedBashRules(files);
248
412
  if (found.unreadable !== null) return { kind: "unreadable", file: found.unreadable };
249
413
  rules = found.patterns.map(ruleWords);
250
414
  if (rules.some((words) => words.length === 0)) return { kind: "all" };
415
+ const governed = segments.map(
416
+ (s) => s.governed.slice(Math.max(0, s.governed.indexOf("cleo run ")))
417
+ );
418
+ if (matches && found.patterns.some((p) => governed.some((text) => matches(p, text)))) {
419
+ return { kind: "governed" };
420
+ }
251
421
  } else if (provider === "codex") {
252
422
  const words = codexGuardedWords(projectDir, env);
253
423
  rules = words.length === 0 ? [] : [words];
424
+ if (words.includes("cleo")) return { kind: "governed" };
254
425
  } else {
255
426
  return null;
256
427
  }
@@ -274,7 +445,7 @@ function guardedHeavyCommand(provider, segments, projectDir, env, files = claude
274
445
  function providerProjectDir(provider, env) {
275
446
  return provider === "claude-code" ? env.CLAUDE_PROJECT_DIR || void 0 : void 0;
276
447
  }
277
- async function heavyCommandHook(provider, stdin, io) {
448
+ async function heavyCommandHook(provider, stdin, io, deps = {}) {
278
449
  const envMode = io.env.CLEO_HEAVY_COMMAND_HOOK?.trim().toLowerCase();
279
450
  if (envMode === "off") return "";
280
451
  const input = parseHookInput(stdin);
@@ -300,20 +471,51 @@ async function heavyCommandHook(provider, stdin, io) {
300
471
  );
301
472
  }
302
473
  if (!core.executableOnPath("cleo", io.env.PATH)) plan = demote(plan, "`cleo` is not on PATH");
303
- if (provider !== "kimi" && !REWRITE_MODES.has(input.permission_mode ?? "")) {
474
+ const permissionMode = input.permission_mode ?? "";
475
+ let preApproved = false;
476
+ if (plan.action === "rewrite" && provider === "claude-code" && PRE_APPROVE_MODES.has(permissionMode)) {
477
+ const projectDir = io.env.CLAUDE_PROJECT_DIR;
478
+ const verdict = claudePreApprovalVerdict(
479
+ input.tool_input.command,
480
+ cwd,
481
+ io.env,
482
+ core,
483
+ projectDir && deps.allowContext ? deps.allowContext(projectDir, io.env) : void 0
484
+ );
485
+ preApproved = verdict.approved;
486
+ if (!verdict.approved && !REWRITE_MODES.has(permissionMode)) {
487
+ plan = demote(
488
+ plan,
489
+ `rewriting it would change which permission rules match it, so in ${permissionMode} mode the hook rewrites only a command your Claude Code allow rules already approve, and ${verdict.reason} (bypassPermissions or auto mode rewrite every heavy command)`
490
+ );
491
+ }
492
+ }
493
+ if (provider !== "kimi" && !preApproved && !REWRITE_MODES.has(permissionMode)) {
304
494
  plan = demote(
305
495
  plan,
306
496
  `rewriting it would change which permission rules match it, so the hook rewrites only in bypassPermissions or auto mode (this session: ${input.permission_mode ?? "unknown"})`
307
497
  );
308
498
  }
309
499
  if (plan.action === "rewrite") {
310
- const hit = guardedHeavyCommand(provider, plan.segments, projectRoot, io.env);
500
+ const hit = guardedHeavyCommand(
501
+ provider,
502
+ plan.segments,
503
+ projectRoot,
504
+ io.env,
505
+ claudeRuleFiles(projectRoot, io.env),
506
+ core.claudeBashRuleMatches
507
+ );
311
508
  const where = provider === "codex" ? "Codex rules" : "Claude Code settings";
312
509
  if (hit?.kind === "word") {
313
510
  plan = demote(
314
511
  plan,
315
512
  `a deny or ask rule in your ${where} names \`${hit.word}\`, and a rewrite would hide the command from it`
316
513
  );
514
+ } else if (hit?.kind === "governed") {
515
+ plan = demote(
516
+ plan,
517
+ `a deny or ask rule in your ${where} matches \`cleo run\`, which the rewrite would run`
518
+ );
317
519
  } else if (hit?.kind === "all") {
318
520
  plan = demote(
319
521
  plan,
@@ -327,7 +529,22 @@ async function heavyCommandHook(provider, stdin, io) {
327
529
  }
328
530
  }
329
531
  const context = heavyHookContext(plan, await core.heavyPressureNotice(), provider);
330
- return renderHeavyHookAnswer(provider, input.tool_input, plan, context, budget.timeoutMs);
532
+ return renderHeavyHookAnswer(
533
+ provider,
534
+ input.tool_input,
535
+ plan,
536
+ context,
537
+ budget.timeoutMs,
538
+ preApproved && plan.action === "rewrite"
539
+ );
540
+ }
541
+ function claudePreApprovalVerdict(command, cwd, env, core, ctx) {
542
+ const projectDir = env.CLAUDE_PROJECT_DIR;
543
+ if (!projectDir) return { approved: false, reason: "CLAUDE_PROJECT_DIR is not set" };
544
+ const rules = claudeAllowedBashRules(ctx ?? claudeAllowContext(projectDir, env), env);
545
+ if (!rules.trusted) return { approved: false, reason: rules.reason };
546
+ const verdict = core.claudePreApproval(command, rules.patterns, { cwd, workingDir: projectDir });
547
+ return verdict.approved ? verdict : { approved: false, reason: `it is not pre-approved: ${verdict.reason}` };
331
548
  }
332
549
  var USAGE = "usage: cleo hook heavy-command [--provider claude-code|codex|kimi|opencode] < hook-input.json\n";
333
550
  async function runHookCli(argv, io = processHookIo()) {
@@ -356,8 +573,16 @@ async function runHookCli(argv, io = processHookIo()) {
356
573
  }
357
574
  export {
358
575
  HEAVY_HOOK_PROVIDERS,
576
+ ancestorCommandText,
577
+ bashRulePatterns,
578
+ claudeAllowContext,
579
+ claudeAllowedBashRules,
359
580
  claudeGuardedBashRules,
581
+ claudeManagedDir,
582
+ claudeManagedFiles,
583
+ claudePreApprovalVerdict,
360
584
  claudeRuleFiles,
585
+ claudeSettingsFiles,
361
586
  codexGuardedWords,
362
587
  guardedHeavyCommand,
363
588
  heavyCommandHook,
@@ -0,0 +1,55 @@
1
+ (() => {
2
+ const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
3
+ if (globalThis[_installed]) return;
4
+ globalThis[_installed] = true;
5
+ const _origEmitWarning = process.emitWarning;
6
+ process.emitWarning = function(warning, type, code, ctor) {
7
+ if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
8
+ return;
9
+ }
10
+ if (typeof warning === 'string' && /SQLite is an experimental feature/i.test(warning)) {
11
+ return;
12
+ }
13
+ return _origEmitWarning.call(process, warning, type, code, ctor);
14
+ };
15
+ })();
16
+ import {
17
+ defineCommand
18
+ } from "./chunk-PKKZPOOP.js";
19
+
20
+ // packages/cleo/src/cli/commands/hygiene.ts
21
+ import { getProjectRoot } from "@cleocode/core";
22
+ import { runSpawnReadinessHygieneCli } from "@cleocode/core/hygiene/validate-spawn-readiness.js";
23
+ var hygieneCommand = defineCommand({
24
+ meta: {
25
+ name: "hygiene",
26
+ description: "Run spawn-readiness hygiene checks"
27
+ },
28
+ subCommands: {
29
+ "validate-spawn-readiness": defineCommand({
30
+ meta: {
31
+ name: "validate-spawn-readiness",
32
+ description: "Run all pre-spawn hygiene gates (changeset lint, changelog drift, worktree location)"
33
+ },
34
+ args: {
35
+ "project-root": {
36
+ type: "string",
37
+ description: "Project root directory (default: auto-detect)"
38
+ },
39
+ "worktree-path": {
40
+ type: "string",
41
+ description: "Expected worktree path for location validation"
42
+ }
43
+ },
44
+ async run({ args }) {
45
+ const projectRoot = args["project-root"] || getProjectRoot() || process.cwd();
46
+ const worktreePath = args["worktree-path"];
47
+ await runSpawnReadinessHygieneCli(projectRoot, worktreePath);
48
+ }
49
+ })
50
+ }
51
+ });
52
+ export {
53
+ hygieneCommand
54
+ };
55
+ //# sourceMappingURL=hygiene-3QZ2NI7P.js.map