@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,423 @@
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
+ dispatchRaw
22
+ } from "./chunk-3IOQVUO7.js";
23
+ import "./chunk-AWCQH2W5.js";
24
+ import {
25
+ CLEO_DIR_NAME,
26
+ RESTORE_CONFLICTS_MD,
27
+ RESTORE_DEFAULT_FILE
28
+ } from "./chunk-OGV57L4J.js";
29
+ import "./chunk-ZBISIPCK.js";
30
+ import {
31
+ cliError,
32
+ cliOutput,
33
+ humanLine
34
+ } from "./chunk-3ZO3M37V.js";
35
+ import "./chunk-6JSJNYH2.js";
36
+ import "./chunk-QFFQSKRC.js";
37
+
38
+ // packages/cleo/src/cli/commands/restore.ts
39
+ import fs from "node:fs";
40
+ import path from "node:path";
41
+ import { ExitCode } from "@cleocode/contracts";
42
+ import {
43
+ CleoError,
44
+ getProjectRoot,
45
+ getTaskAccessor,
46
+ parseConflictReport,
47
+ setAtPath
48
+ } from "@cleocode/core";
49
+ import { parseConflictReport as parseConflictReport2 } from "@cleocode/core";
50
+ var finalizeCommand = defineCommand({
51
+ meta: {
52
+ name: "finalize",
53
+ description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
54
+ },
55
+ async run() {
56
+ const projectRoot = getProjectRoot();
57
+ const reportPath = path.join(projectRoot, CLEO_DIR_NAME, RESTORE_CONFLICTS_MD);
58
+ if (!fs.existsSync(reportPath)) {
59
+ humanLine("No pending restore conflicts. Nothing to finalize.");
60
+ return;
61
+ }
62
+ const content = fs.readFileSync(reportPath, "utf-8");
63
+ const allResolutions = parseConflictReport(content);
64
+ const pending = allResolutions.filter(
65
+ (r) => r.section === "manual" && (r.resolution === "A" || r.resolution === "B")
66
+ );
67
+ if (pending.length === 0) {
68
+ const stillPending = allResolutions.filter(
69
+ (r) => r.section === "manual" && r.resolution === "manual-review"
70
+ );
71
+ if (stillPending.length > 0) {
72
+ humanLine(
73
+ "No manual resolutions found in .cleo/restore-conflicts.md.\nEdit the file to mark resolutions, then re-run 'cleo restore finalize'."
74
+ );
75
+ return;
76
+ }
77
+ const timestamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
78
+ const archivePath2 = path.join(
79
+ projectRoot,
80
+ ".cleo",
81
+ `restore-conflicts-${timestamp2}.md.finalized`
82
+ );
83
+ fs.renameSync(reportPath, archivePath2);
84
+ cliOutput(
85
+ { applied: 0, archivedTo: archivePath2 },
86
+ { command: "restore", message: "No pending resolutions", operation: "restore.finalize" }
87
+ );
88
+ return;
89
+ }
90
+ const byFile = /* @__PURE__ */ new Map();
91
+ for (const r of pending) {
92
+ const existing = byFile.get(r.filename);
93
+ if (existing) {
94
+ existing.push(r);
95
+ } else {
96
+ byFile.set(r.filename, [r]);
97
+ }
98
+ }
99
+ let applied = 0;
100
+ for (const [filename, resolutions] of byFile) {
101
+ const filePath = path.join(projectRoot, CLEO_DIR_NAME, filename);
102
+ if (!fs.existsSync(filePath)) continue;
103
+ const raw = fs.readFileSync(filePath, "utf-8");
104
+ const obj = JSON.parse(raw);
105
+ for (const r of resolutions) {
106
+ const value = r.resolution === "A" ? r.localValue : r.importedValue;
107
+ setAtPath(obj, r.fieldPath, value);
108
+ applied++;
109
+ }
110
+ fs.writeFileSync(filePath, JSON.stringify(obj, null, 2));
111
+ }
112
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
113
+ const archivePath = path.join(
114
+ projectRoot,
115
+ CLEO_DIR_NAME,
116
+ `restore-conflicts-${timestamp}.md.finalized`
117
+ );
118
+ fs.renameSync(reportPath, archivePath);
119
+ cliOutput(
120
+ { applied, archivedTo: archivePath },
121
+ {
122
+ command: "restore",
123
+ message: `Finalized ${applied} conflict resolutions. Conflict report archived.`,
124
+ operation: "restore.finalize"
125
+ }
126
+ );
127
+ }
128
+ });
129
+ var backupSubCommand = defineCommand({
130
+ meta: { name: "backup", description: "Restore todo files from backup" },
131
+ args: {
132
+ file: {
133
+ type: "string",
134
+ description: "Specific file to restore (tasks.db, config.json, etc.)"
135
+ },
136
+ "dry-run": {
137
+ type: "boolean",
138
+ description: "Preview what would be restored",
139
+ default: false
140
+ },
141
+ scope: {
142
+ type: "string",
143
+ description: "Backup scope to restore from: project or global (default: project)",
144
+ default: "project"
145
+ },
146
+ "confirm-owner-store": {
147
+ type: "boolean",
148
+ description: "From inside a git worktree: allow overwriting the owning project's LIVE store (refused without it)",
149
+ default: false
150
+ }
151
+ },
152
+ async run({ args }) {
153
+ try {
154
+ const fileName = args.file ?? RESTORE_DEFAULT_FILE;
155
+ const scope = args.scope ?? "project";
156
+ const response = await dispatchRaw("mutate", "admin", "backup", {
157
+ action: "restore.file",
158
+ file: fileName,
159
+ dryRun: args["dry-run"] || void 0,
160
+ scope,
161
+ confirmOwnerStore: args["confirm-owner-store"] || void 0
162
+ });
163
+ if (!response.success) {
164
+ const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
165
+ throw new CleoError(code, response.error?.message ?? "Backup restore failed");
166
+ }
167
+ const data = response.data;
168
+ if (args["dry-run"]) {
169
+ cliOutput(
170
+ {
171
+ dryRun: true,
172
+ file: fileName,
173
+ wouldRestore: data?.from,
174
+ targetPath: data?.targetPath
175
+ },
176
+ {
177
+ command: "restore",
178
+ message: "Dry run - no changes made",
179
+ operation: "admin.backup.restore"
180
+ }
181
+ );
182
+ return;
183
+ }
184
+ cliOutput(
185
+ {
186
+ restored: true,
187
+ file: fileName,
188
+ restoredFrom: data?.from,
189
+ targetPath: data?.targetPath
190
+ },
191
+ { command: "restore", operation: "admin.backup.restore" }
192
+ );
193
+ } catch (err) {
194
+ if (err instanceof CleoError) {
195
+ cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
196
+ process.exit(err.code);
197
+ }
198
+ throw err;
199
+ }
200
+ }
201
+ });
202
+ var taskSubCommand = defineCommand({
203
+ meta: {
204
+ name: "task",
205
+ description: "Restore task from terminal state (archived, cancelled, or completed) back to active"
206
+ },
207
+ args: {
208
+ taskId: {
209
+ type: "positional",
210
+ description: "Task ID to restore",
211
+ required: true
212
+ },
213
+ status: {
214
+ type: "string",
215
+ description: "Status to restore task as (default: pending)",
216
+ default: "pending"
217
+ },
218
+ "preserve-status": {
219
+ type: "boolean",
220
+ description: "Keep the original task status",
221
+ default: false
222
+ },
223
+ reason: {
224
+ type: "string",
225
+ description: "Reason for restoring/reopening the task"
226
+ },
227
+ "dry-run": {
228
+ type: "boolean",
229
+ description: "Preview changes without applying",
230
+ default: false
231
+ }
232
+ },
233
+ async run({ args }) {
234
+ try {
235
+ const taskId = args.taskId;
236
+ const idPattern = /^T\d{3,}$/;
237
+ if (!idPattern.test(taskId)) {
238
+ throw new CleoError(ExitCode.INVALID_INPUT, `Invalid task ID: ${taskId}`);
239
+ }
240
+ const accessor = await getTaskAccessor();
241
+ const activeTask = await accessor.loadSingleTask(taskId);
242
+ if (activeTask) {
243
+ if (activeTask.status === "cancelled") {
244
+ if (args["dry-run"]) {
245
+ cliOutput(
246
+ {
247
+ dryRun: true,
248
+ taskId,
249
+ title: activeTask.title,
250
+ previousStatus: activeTask.status,
251
+ newStatus: args["preserve-status"] ? activeTask.status : args.status,
252
+ source: "active-tasks"
253
+ },
254
+ {
255
+ command: "restore",
256
+ message: "Dry run - no changes made",
257
+ operation: "tasks.restore"
258
+ }
259
+ );
260
+ return;
261
+ }
262
+ const response = await dispatchRaw("mutate", "tasks", "restore", { taskId });
263
+ if (!response.success) {
264
+ const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
265
+ throw new CleoError(code, response.error?.message ?? "Task restore failed");
266
+ }
267
+ const resultData = response.data;
268
+ cliOutput(
269
+ {
270
+ restored: true,
271
+ taskId: resultData?.task,
272
+ count: resultData?.count,
273
+ source: "active-tasks"
274
+ },
275
+ { command: "restore", operation: "tasks.restore" }
276
+ );
277
+ return;
278
+ } else if (activeTask.status === "done") {
279
+ if (args["dry-run"]) {
280
+ const newStatus = args["preserve-status"] ? activeTask.status : args.status;
281
+ cliOutput(
282
+ {
283
+ dryRun: true,
284
+ taskId,
285
+ title: activeTask.title,
286
+ previousStatus: activeTask.status,
287
+ newStatus,
288
+ source: "active-tasks"
289
+ },
290
+ {
291
+ command: "restore",
292
+ message: "Dry run - no changes made",
293
+ operation: "tasks.restore"
294
+ }
295
+ );
296
+ return;
297
+ }
298
+ const targetStatus = args["preserve-status"] ? void 0 : args.status;
299
+ const response = await dispatchRaw("mutate", "tasks", "restore", {
300
+ taskId,
301
+ from: "done",
302
+ status: targetStatus,
303
+ reason: args.reason
304
+ });
305
+ if (!response.success) {
306
+ const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
307
+ throw new CleoError(code, response.error?.message ?? "Task restore failed");
308
+ }
309
+ const resultData = response.data;
310
+ cliOutput(
311
+ {
312
+ restored: true,
313
+ taskId: resultData?.task,
314
+ previousStatus: resultData?.previousStatus,
315
+ newStatus: resultData?.newStatus,
316
+ source: "active-tasks"
317
+ },
318
+ { command: "restore", operation: "tasks.restore" }
319
+ );
320
+ return;
321
+ } else {
322
+ throw new CleoError(
323
+ ExitCode.VALIDATION_ERROR,
324
+ `Task ${taskId} is already active with status: ${activeTask.status}`
325
+ );
326
+ }
327
+ }
328
+ if (args["dry-run"]) {
329
+ const archiveData = await accessor.loadArchive();
330
+ if (archiveData) {
331
+ const archivedTasks = archiveData.archivedTasks;
332
+ if (Array.isArray(archivedTasks)) {
333
+ const task = archivedTasks.find((t) => t.id === taskId);
334
+ if (task) {
335
+ cliOutput(
336
+ {
337
+ dryRun: true,
338
+ taskId,
339
+ title: task.title,
340
+ previousStatus: task.status,
341
+ newStatus: args["preserve-status"] ? task.status : args.status,
342
+ source: "archive"
343
+ },
344
+ {
345
+ command: "restore",
346
+ message: "Dry run - no changes made",
347
+ operation: "tasks.restore"
348
+ }
349
+ );
350
+ return;
351
+ }
352
+ }
353
+ }
354
+ throw new CleoError(
355
+ ExitCode.NOT_FOUND,
356
+ `Task ${taskId} not found in active tasks or archive`,
357
+ {
358
+ fix: `cleo find "${taskId}" to search for the task`
359
+ }
360
+ );
361
+ }
362
+ try {
363
+ const targetStatus = args["preserve-status"] ? void 0 : args.status;
364
+ const response = await dispatchRaw("mutate", "tasks", "restore", {
365
+ taskId,
366
+ from: "archive",
367
+ status: targetStatus,
368
+ preserveStatus: !!args["preserve-status"]
369
+ });
370
+ if (!response.success) {
371
+ const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
372
+ throw new CleoError(code, response.error?.message ?? "Task unarchive failed");
373
+ }
374
+ const resultData = response.data;
375
+ cliOutput(
376
+ {
377
+ restored: true,
378
+ taskId: resultData?.task,
379
+ title: resultData?.title,
380
+ newStatus: resultData?.status,
381
+ source: "archive"
382
+ },
383
+ { command: "restore", operation: "tasks.restore" }
384
+ );
385
+ } catch {
386
+ throw new CleoError(
387
+ ExitCode.NOT_FOUND,
388
+ `Task ${taskId} not found in active tasks or archive`,
389
+ {
390
+ fix: `cleo find "${taskId}" to search for the task`
391
+ }
392
+ );
393
+ }
394
+ } catch (err) {
395
+ if (err instanceof CleoError) {
396
+ cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
397
+ process.exit(err.code);
398
+ }
399
+ throw err;
400
+ }
401
+ }
402
+ });
403
+ var restoreCommand = defineCommand({
404
+ meta: {
405
+ name: "restore",
406
+ description: "Restore from backup or restore tasks from terminal states (archived, cancelled, completed)"
407
+ },
408
+ subCommands: {
409
+ finalize: finalizeCommand,
410
+ backup: backupSubCommand,
411
+ task: taskSubCommand
412
+ },
413
+ async run({ cmd, rawArgs }) {
414
+ const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
415
+ if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
416
+ await showUsage(cmd);
417
+ }
418
+ });
419
+ export {
420
+ parseConflictReport2 as parseConflictReport,
421
+ restoreCommand
422
+ };
423
+ //# sourceMappingURL=restore-VEUOX7NF.js.map
@@ -0,0 +1,240 @@
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
+ import {
20
+ cliError,
21
+ cliOutput
22
+ } from "./chunk-3ZO3M37V.js";
23
+ import "./chunk-6JSJNYH2.js";
24
+
25
+ // packages/cleo/src/cli/commands/revert.ts
26
+ import { readFile } from "node:fs/promises";
27
+ import { join } from "node:path";
28
+ import { cwd as processCwd } from "node:process";
29
+ import { E_RECEIPT_NOT_FOUND } from "@cleocode/core/sentient/chain-walker.js";
30
+ import { SENTIENT_STATE_FILE } from "@cleocode/core/sentient/daemon.js";
31
+ import { loadSigningIdentity } from "@cleocode/core/sentient/kms.js";
32
+ import { executeSquashedRevert } from "@cleocode/core/sentient/revert-executor.js";
33
+ import { collectMergeCommits } from "@cleocode/core/sentient/revert-walker.js";
34
+ import {
35
+ E_OWNER_ATTESTATION_REQUIRED,
36
+ readSentientState
37
+ } from "@cleocode/core/sentient/state.js";
38
+ var OWNER_PUBKEYS_FILE = ".cleo/owner-pubkeys.json";
39
+ function resolveProjectRoot(arg) {
40
+ return arg && arg.length > 0 ? arg : processCwd();
41
+ }
42
+ function emitSuccess(payload, _jsonMode, _humanLine) {
43
+ cliOutput(payload, { command: "revert", operation: "revert.execute" });
44
+ }
45
+ function emitFailure(code, message, _jsonMode) {
46
+ cliError(message, 1, { name: code });
47
+ process.exit(1);
48
+ }
49
+ async function loadOwnerAttestation(attestationFilePath) {
50
+ let raw;
51
+ if (attestationFilePath) {
52
+ try {
53
+ raw = await readFile(attestationFilePath, "utf-8");
54
+ } catch (err) {
55
+ const message = err instanceof Error ? err.message : String(err);
56
+ throw new Error(`Failed to read attestation file "${attestationFilePath}": ${message}`);
57
+ }
58
+ } else if (process.env["CLEO_OWNER_ATTESTATION"]) {
59
+ raw = process.env["CLEO_OWNER_ATTESTATION"];
60
+ }
61
+ if (!raw) {
62
+ throw new Error(
63
+ 'Owner attestation is required. Provide one of:\n --attestation-file <path> path to a JSON attestation file\n CLEO_OWNER_ATTESTATION JSON string in environment variable\n\nAttestation format:\n { "afterRevertReceiptId": "<receiptId>",\n "issuedAt": "<ISO-8601>",\n "ownerPubkey": "<hex-64>",\n "sig": "<ed25519-hex-128>" }'
64
+ );
65
+ }
66
+ let parsed;
67
+ try {
68
+ parsed = JSON.parse(raw);
69
+ } catch {
70
+ throw new Error("Owner attestation is not valid JSON");
71
+ }
72
+ const obj = parsed;
73
+ if (typeof obj["afterRevertReceiptId"] !== "string" || typeof obj["issuedAt"] !== "string" || typeof obj["ownerPubkey"] !== "string" || typeof obj["sig"] !== "string") {
74
+ throw new Error(
75
+ "Owner attestation is missing required fields: afterRevertReceiptId, issuedAt, ownerPubkey, sig"
76
+ );
77
+ }
78
+ return obj;
79
+ }
80
+ async function loadOwnerPubkeys(projectRoot) {
81
+ const path = join(projectRoot, OWNER_PUBKEYS_FILE);
82
+ try {
83
+ const raw = await readFile(path, "utf-8");
84
+ const parsed = JSON.parse(raw);
85
+ if (Array.isArray(parsed)) {
86
+ return new Set(parsed.filter((k) => typeof k === "string"));
87
+ }
88
+ return /* @__PURE__ */ new Set();
89
+ } catch {
90
+ return /* @__PURE__ */ new Set();
91
+ }
92
+ }
93
+ var revertCommand = defineCommand({
94
+ meta: {
95
+ name: "revert",
96
+ description: "Owner kill-switch: squash-revert all sentient merge commits from a receipt ID"
97
+ },
98
+ args: {
99
+ from: {
100
+ type: "string",
101
+ description: "Receipt ID to revert from (inclusive)"
102
+ },
103
+ "attestation-file": {
104
+ type: "string",
105
+ description: "Path to owner attestation JSON file (alternatively set CLEO_OWNER_ATTESTATION env var)"
106
+ },
107
+ "include-human": {
108
+ type: "boolean",
109
+ description: "Allow reverting commits not authored by the sentient agent"
110
+ },
111
+ "dry-run": {
112
+ type: "boolean",
113
+ description: "Print commits that would be reverted without executing"
114
+ },
115
+ json: {
116
+ type: "boolean",
117
+ description: "Emit LAFS JSON envelope"
118
+ },
119
+ project: {
120
+ type: "string",
121
+ description: "Project root (defaults to process cwd)"
122
+ }
123
+ },
124
+ async run({ args }) {
125
+ const projectRoot = resolveProjectRoot(args.project);
126
+ const jsonMode = args.json === true;
127
+ const dryRun = args["dry-run"] === true;
128
+ const includeHuman = args["include-human"] === true;
129
+ const fromReceiptId = args.from;
130
+ const attestationFile = args["attestation-file"];
131
+ if (!fromReceiptId) {
132
+ emitFailure(
133
+ "E_MISSING_FLAG",
134
+ "--from <receiptId> is required. Usage: cleo revert --from <receiptId>",
135
+ jsonMode
136
+ );
137
+ }
138
+ let attestation;
139
+ if (!dryRun) {
140
+ try {
141
+ attestation = await loadOwnerAttestation(attestationFile);
142
+ } catch (err) {
143
+ const message = err instanceof Error ? err.message : String(err);
144
+ emitFailure(E_OWNER_ATTESTATION_REQUIRED, message, jsonMode);
145
+ }
146
+ }
147
+ if (attestation && attestation.afterRevertReceiptId !== fromReceiptId) {
148
+ emitFailure(
149
+ E_OWNER_ATTESTATION_REQUIRED,
150
+ `attestation.afterRevertReceiptId "${attestation.afterRevertReceiptId}" does not match --from "${fromReceiptId}"`,
151
+ jsonMode
152
+ );
153
+ }
154
+ const allowedPubkeys = await loadOwnerPubkeys(projectRoot);
155
+ if (attestation && allowedPubkeys.size > 0 && !allowedPubkeys.has(attestation.ownerPubkey)) {
156
+ emitFailure(
157
+ E_OWNER_ATTESTATION_REQUIRED,
158
+ `Attestation pubkey "${attestation.ownerPubkey}" is not in the owner allowlist at ${join(projectRoot, OWNER_PUBKEYS_FILE)}`,
159
+ jsonMode
160
+ );
161
+ }
162
+ let commits;
163
+ let mergeEvents;
164
+ try {
165
+ const result = await collectMergeCommits(projectRoot, fromReceiptId);
166
+ commits = result.commits;
167
+ mergeEvents = result.events;
168
+ } catch (err) {
169
+ const errCode = err.code === E_RECEIPT_NOT_FOUND ? E_RECEIPT_NOT_FOUND : "E_CHAIN_WALK_FAILED";
170
+ const message = err instanceof Error ? err.message : String(err);
171
+ emitFailure(errCode, message, jsonMode);
172
+ }
173
+ if (commits.length === 0) {
174
+ emitSuccess(
175
+ {
176
+ receiptId: fromReceiptId,
177
+ commits: [],
178
+ message: "No merge commits found starting from this receipt \u2014 nothing to revert"
179
+ },
180
+ jsonMode,
181
+ `No merge commits found starting from receipt ${fromReceiptId}. Nothing to revert.`
182
+ );
183
+ return;
184
+ }
185
+ if (dryRun) {
186
+ const lines = commits.map((sha, i) => ` [${i + 1}] ${sha}`).join("\n");
187
+ emitSuccess(
188
+ { dryRun: true, fromReceiptId, commits, count: commits.length },
189
+ jsonMode,
190
+ `Dry-run: would revert ${commits.length} commit(s) from ${fromReceiptId}:
191
+ ${lines}`
192
+ );
193
+ return;
194
+ }
195
+ let identity;
196
+ try {
197
+ identity = await loadSigningIdentity(projectRoot);
198
+ } catch (err) {
199
+ const message = err instanceof Error ? err.message : String(err);
200
+ emitFailure("E_KMS_LOAD", message, jsonMode);
201
+ }
202
+ try {
203
+ const result = await executeSquashedRevert({
204
+ cleoRoot: projectRoot,
205
+ commits,
206
+ mergeEvents,
207
+ fromReceiptId,
208
+ identity,
209
+ includeHuman
210
+ });
211
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
212
+ const state = await readSentientState(statePath);
213
+ emitSuccess(
214
+ {
215
+ revertCommitSha: result.revertCommitSha,
216
+ revertedRange: result.revertedRange,
217
+ eventsReverted: mergeEvents.length,
218
+ revertEventReceiptId: result.revertEventReceiptId,
219
+ humanCommitPresent: result.humanCommitPresent,
220
+ globalPauseSet: true,
221
+ pausedByRevert: state.pausedByRevert
222
+ },
223
+ jsonMode,
224
+ `Revert complete.
225
+ Reverted: ${result.revertedRange.length} commit(s)
226
+ Squash commit: ${result.revertCommitSha}
227
+ Revert event: ${result.revertEventReceiptId}
228
+ Global pause: ACTIVE (run 'cleo sentient resume' with owner attestation to clear)`
229
+ );
230
+ } catch (err) {
231
+ const errCode = err.code ?? "E_REVERT_FAILED";
232
+ const message = err instanceof Error ? err.message : String(err);
233
+ emitFailure(errCode, message, jsonMode);
234
+ }
235
+ }
236
+ });
237
+ export {
238
+ revertCommand
239
+ };
240
+ //# sourceMappingURL=revert-3YF2IL5G.js.map