@cleocode/cleo 2026.10.2 → 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 -94607
  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/{Buaay_Q8.js → Btgeq_wq.js} +1 -1
  254. package/studio-dist/client/_app/immutable/chunks/{BJp57kf2.js → CgBjxmu6.js} +1 -1
  255. package/studio-dist/client/_app/immutable/chunks/{CLP4JZvZ.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.CczVILch.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.Zy2IsLEl.js → 0.nTXyRfc-.js} +1 -1
  260. package/studio-dist/client/_app/immutable/nodes/{1.DJN1QI3l.js → 1.4zrWeHtl.js} +1 -1
  261. package/studio-dist/client/_app/immutable/nodes/{15.B4rwqbHV.js → 15.D9mk4JyY.js} +1 -1
  262. package/studio-dist/client/_app/immutable/nodes/{16.jn-5BG_L.js → 16._-wt-sQf.js} +1 -1
  263. package/studio-dist/client/_app/immutable/nodes/{17.DnWGC4t9.js → 17.CUu6LQDj.js} +1 -1
  264. package/studio-dist/client/_app/immutable/nodes/{18.0zddLZOY.js → 18.Dz4QRTkX.js} +1 -1
  265. package/studio-dist/client/_app/immutable/nodes/{20.DEKHq9Tc.js → 20.CJ2_EB0U.js} +1 -1
  266. package/studio-dist/client/_app/immutable/nodes/{24.CQB9KP-p.js → 24.Igj2FS7k.js} +1 -1
  267. package/studio-dist/client/_app/immutable/nodes/{25.BaqToZD-.js → 25.BnATjVGN.js} +2 -2
  268. package/studio-dist/client/_app/immutable/nodes/{26.BiE1i4iE.js → 26.6iPyjT44.js} +1 -1
  269. package/studio-dist/client/_app/immutable/nodes/{3.BObAOu_-.js → 3.AA5GwNgP.js} +1 -1
  270. package/studio-dist/client/_app/version.json +1 -1
  271. package/studio-dist/server/chunks/{0-BmUoS2yd.js → 0-DGmsoBYm.js} +3 -3
  272. package/studio-dist/server/chunks/1-8PfxPvlK.js +9 -0
  273. package/studio-dist/server/chunks/{15-Dt4kqUxW.js → 15-Bg6YTndh.js} +3 -3
  274. package/studio-dist/server/chunks/{16-kgTLJvbO.js → 16-BObLwgyD.js} +3 -3
  275. package/studio-dist/server/chunks/{17-mRYB5141.js → 17-BNXGyAHX.js} +3 -3
  276. package/studio-dist/server/chunks/{18-BjZ325q5.js → 18-UqQFRIID.js} +3 -3
  277. package/studio-dist/server/chunks/{20-DQ2Vrujq.js → 20-CMn8a_yP.js} +3 -3
  278. package/studio-dist/server/chunks/{24-DAeuAfXN.js → 24-BuOTDzib.js} +3 -3
  279. package/studio-dist/server/chunks/{25-DGCNmzAS.js → 25-CIMSmjVx.js} +4 -4
  280. package/studio-dist/server/chunks/{26-CiN6bbmR.js → 26-DWGObn2T.js} +3 -3
  281. package/studio-dist/server/chunks/{3-BS2FXYjP.js → 3-CyiffdJZ.js} +3 -3
  282. package/studio-dist/server/chunks/{_layout.svelte-DJ_UWmGp.js → _layout.svelte-DYtClaIk.js} +4 -4
  283. package/studio-dist/server/chunks/{_page.svelte-WR6jUiQE.js → _page.svelte-1h9E6s_f.js} +3 -3
  284. package/studio-dist/server/chunks/{_page.svelte-BUq8_eQH.js → _page.svelte-BNNF62Nm.js} +3 -3
  285. package/studio-dist/server/chunks/{_page.svelte-CRnYa4cW.js → _page.svelte-BT1EUadj.js} +5 -5
  286. package/studio-dist/server/chunks/{_page.svelte-Dk0znswQ.js → _page.svelte-Bip079LT.js} +3 -3
  287. package/studio-dist/server/chunks/{_page.svelte-CcP_KW3Y.js → _page.svelte-CEATWp_5.js} +3 -3
  288. package/studio-dist/server/chunks/{_page.svelte-Ca7x-ZvH.js → _page.svelte-CV3xiD1y.js} +4 -4
  289. package/studio-dist/server/chunks/{_page.svelte-Cfv9tDBA.js → _page.svelte-Cv_KVJDV.js} +3 -3
  290. package/studio-dist/server/chunks/{_page.svelte-J4HjPhfO.js → _page.svelte-DSSy6LuK.js} +3 -3
  291. package/studio-dist/server/chunks/{_page.svelte-D8dLEr7O.js → _page.svelte-TF795TAS.js} +3 -3
  292. package/studio-dist/server/chunks/{_server.ts-Bih2-_5O.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-Cl295FWH.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-ajn1HNOb.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-D9MtKHIF.js → internal-CTULuLPB.js} +2 -2
  302. package/studio-dist/server/chunks/{stores-BlknvZ80.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/C3l-lTkq.js +0 -1
  306. package/studio-dist/client/_app/immutable/entry/start.D7gHmBNS.js +0 -1
  307. package/studio-dist/server/chunks/1-CTjj2MYz.js +0 -9
@@ -0,0 +1,243 @@
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
+ getWorkflowTemplatesDir
18
+ } from "./chunk-OPTEQKBB.js";
19
+ import {
20
+ createUpgradeProgress
21
+ } from "./chunk-W3JLYKKY.js";
22
+ import "./chunk-J3ZFM3UQ.js";
23
+ import "./chunk-GZFVDR44.js";
24
+ import "./chunk-ULN4OKQQ.js";
25
+ import {
26
+ negatedFlag
27
+ } from "./chunk-47JYZAMS.js";
28
+ import "./chunk-C3B7C43W.js";
29
+ import {
30
+ defineCommand
31
+ } from "./chunk-PKKZPOOP.js";
32
+ import {
33
+ cliError,
34
+ cliOutput
35
+ } from "./chunk-3ZO3M37V.js";
36
+ import "./chunk-6JSJNYH2.js";
37
+
38
+ // packages/cleo/src/cli/commands/upgrade.ts
39
+ import { resolve } from "node:path";
40
+ import { CleoError, diagnoseUpgrade, runUpgrade, upgradeWorkflows } from "@cleocode/core/internal";
41
+ var workflowsSubcommand = defineCommand({
42
+ meta: {
43
+ name: "workflows",
44
+ description: "Re-render the four release-pipeline workflow templates and report drift (T9536)."
45
+ },
46
+ args: {
47
+ "dry-run": {
48
+ type: "boolean",
49
+ description: "Print the per-template diff without writing.",
50
+ default: false
51
+ },
52
+ check: {
53
+ type: "boolean",
54
+ description: "Exit 1 if drift is detected. Implies --dry-run for write semantics.",
55
+ default: false
56
+ },
57
+ force: {
58
+ type: "boolean",
59
+ description: "Overwrite drifted files (excluding `.workflow-overrides.yml` keys).",
60
+ default: false
61
+ },
62
+ json: { type: "boolean", description: "Output as JSON" },
63
+ human: { type: "boolean", description: "Force human-readable output" },
64
+ quiet: { type: "boolean", description: "Suppress non-essential output" }
65
+ },
66
+ async run({ args }) {
67
+ try {
68
+ const dryRun = args["dry-run"] === true || args.check === true;
69
+ const force = args.force === true && !dryRun;
70
+ const result = await upgradeWorkflows({
71
+ projectRoot: resolve(process.cwd()),
72
+ templatesDir: getWorkflowTemplatesDir(),
73
+ dryRun,
74
+ force
75
+ });
76
+ cliOutput(
77
+ {
78
+ outcomes: result.outcomes.map((o) => ({
79
+ template: o.template,
80
+ targetPath: o.targetPath,
81
+ status: o.status,
82
+ overrideDeclared: o.overrideDeclared
83
+ })),
84
+ resolvedTools: result.resolvedTools,
85
+ hasDrift: result.hasDrift,
86
+ ...dryRun ? {
87
+ rendered: result.outcomes.map((o) => ({
88
+ template: o.template,
89
+ rendered: o.rendered
90
+ }))
91
+ } : {}
92
+ },
93
+ { command: "upgrade", operation: "upgrade.workflows" }
94
+ );
95
+ if (args.check === true && result.hasDrift) {
96
+ process.exit(1);
97
+ }
98
+ } catch (err) {
99
+ if (err instanceof CleoError) {
100
+ cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
101
+ process.exit(err.code);
102
+ }
103
+ throw err;
104
+ }
105
+ }
106
+ });
107
+ var upgradeCommand = defineCommand({
108
+ meta: {
109
+ name: "upgrade",
110
+ description: "Unified project maintenance (storage migration, schema repair, structural fixes, doc refresh)"
111
+ },
112
+ subCommands: {
113
+ workflows: workflowsSubcommand
114
+ },
115
+ args: {
116
+ status: {
117
+ type: "boolean",
118
+ description: "Show what needs updating without making changes"
119
+ },
120
+ "dry-run": {
121
+ type: "boolean",
122
+ description: "Preview changes without applying"
123
+ },
124
+ diagnose: {
125
+ type: "boolean",
126
+ description: "Deep inspection of schema, columns, and migration journals"
127
+ },
128
+ "include-global": {
129
+ type: "boolean",
130
+ description: "Also check global ~/.cleo data"
131
+ },
132
+ "no-auto-migrate": {
133
+ type: "boolean",
134
+ description: "Skip automatic JSON->SQLite migration"
135
+ },
136
+ detect: {
137
+ type: "boolean",
138
+ description: "Force re-detection of project type (ignores staleness)"
139
+ },
140
+ "map-codebase": {
141
+ type: "boolean",
142
+ description: "Run full codebase analysis and store findings to brain.db"
143
+ },
144
+ name: {
145
+ type: "string",
146
+ description: "Update project name in project-info and nexus registry"
147
+ },
148
+ // Global output format flags — read directly from args (no optsWithGlobals in citty)
149
+ json: {
150
+ type: "boolean",
151
+ description: "Output as JSON"
152
+ },
153
+ human: {
154
+ type: "boolean",
155
+ description: "Force human-readable output"
156
+ },
157
+ quiet: {
158
+ type: "boolean",
159
+ description: "Suppress non-essential output"
160
+ }
161
+ },
162
+ async run({ args, cmd, rawArgs }) {
163
+ const firstPositional = rawArgs?.find((a) => !a.startsWith("-"));
164
+ if (firstPositional && cmd.subCommands && firstPositional in cmd.subCommands) return;
165
+ const isHuman = args.human === true || !!process.stdout.isTTY && args.json !== true;
166
+ const progress = createUpgradeProgress(isHuman);
167
+ try {
168
+ if (args.diagnose) {
169
+ progress.start();
170
+ progress.step(0, "Running deep schema/migration diagnostics");
171
+ const result2 = await diagnoseUpgrade();
172
+ progress.step(4, "Diagnostics complete");
173
+ cliOutput(result2, { command: "upgrade", operation: "upgrade.diagnose" });
174
+ if (!result2.success) {
175
+ progress.error(`${result2.summary.errors} error(s) found`);
176
+ process.exit(1);
177
+ }
178
+ progress.complete(
179
+ `Diagnostics complete: ${result2.summary.ok} ok, ${result2.summary.warnings} warning(s), ${result2.summary.errors} error(s)`
180
+ );
181
+ return;
182
+ }
183
+ const isDryRun = !!args["dry-run"] || !!args.status;
184
+ const includeGlobal = !!args["include-global"];
185
+ const autoMigrate = !negatedFlag(args, "auto-migrate");
186
+ const forceDetect = !!args.detect;
187
+ const mapCodebase = !!args["map-codebase"];
188
+ const projectName = args.name;
189
+ progress.start();
190
+ progress.step(0, "Analyzing current state");
191
+ if (includeGlobal) {
192
+ progress.step(1, "Checking global ~/.cleo data");
193
+ } else {
194
+ progress.step(1, "Checking storage migration needs");
195
+ }
196
+ progress.step(2, "Validating schemas");
197
+ progress.step(3, isDryRun ? "Previewing changes" : "Applying fixes");
198
+ const result = await runUpgrade({
199
+ dryRun: isDryRun,
200
+ includeGlobal,
201
+ autoMigrate,
202
+ forceDetect,
203
+ mapCodebase,
204
+ projectName
205
+ });
206
+ progress.step(4, "Verifying results");
207
+ cliOutput(
208
+ {
209
+ upToDate: result.upToDate,
210
+ dryRun: result.dryRun,
211
+ actions: result.actions,
212
+ applied: result.applied,
213
+ errors: result.errors.length > 0 ? result.errors : void 0,
214
+ summary: result.summary,
215
+ storageMigration: result.storageMigration
216
+ },
217
+ { command: "upgrade" }
218
+ );
219
+ if (!result.success) {
220
+ progress.error("Upgrade failed with errors");
221
+ process.exit(1);
222
+ }
223
+ progress.complete(isDryRun ? "Preview complete" : "Upgrade complete");
224
+ } catch (err) {
225
+ if (err instanceof CleoError) {
226
+ progress.error(err.message);
227
+ cliError(
228
+ err.message,
229
+ err.code,
230
+ { name: "CleoError", fix: err.fix },
231
+ { operation: "upgrade" }
232
+ );
233
+ process.exit(err.code);
234
+ }
235
+ progress.error("Unexpected error during upgrade");
236
+ throw err;
237
+ }
238
+ }
239
+ });
240
+ export {
241
+ upgradeCommand
242
+ };
243
+ //# sourceMappingURL=upgrade-OXJXOGEF.js.map
@@ -0,0 +1,190 @@
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
+ negatedFlag
18
+ } from "./chunk-47JYZAMS.js";
19
+ import {
20
+ defineCommand,
21
+ showUsage
22
+ } from "./chunk-PKKZPOOP.js";
23
+ import {
24
+ dispatchFromCli
25
+ } from "./chunk-3IOQVUO7.js";
26
+ import "./chunk-AWCQH2W5.js";
27
+ import "./chunk-OGV57L4J.js";
28
+ import "./chunk-ZBISIPCK.js";
29
+ import {
30
+ cliError,
31
+ cliOutput
32
+ } from "./chunk-3ZO3M37V.js";
33
+ import "./chunk-6JSJNYH2.js";
34
+ import "./chunk-QFFQSKRC.js";
35
+
36
+ // packages/cleo/src/cli/commands/verify.ts
37
+ import { ExitCode } from "@cleocode/contracts";
38
+ var verifyCommand = defineCommand({
39
+ meta: { name: "verify", description: "View or modify verification gates for a task" },
40
+ args: {
41
+ taskId: {
42
+ type: "positional",
43
+ description: "Task ID to inspect or update",
44
+ required: false
45
+ },
46
+ gate: {
47
+ type: "string",
48
+ description: "Set a specific gate by name"
49
+ },
50
+ value: {
51
+ type: "string",
52
+ description: "Gate value: true or false",
53
+ default: "true"
54
+ },
55
+ agent: {
56
+ type: "string",
57
+ description: "Agent setting the gate"
58
+ },
59
+ all: {
60
+ type: "boolean",
61
+ description: "Mark all required gates as passed"
62
+ },
63
+ reset: {
64
+ type: "boolean",
65
+ description: "Reset verification to initial state"
66
+ },
67
+ evidence: {
68
+ type: "string",
69
+ description: `Evidence for the gate (T832/ADR-051). Semicolon-separated atoms: 'commit:<sha>', 'files:<p1,p2>', 'test-run:<report.json>' (a runner's JSON report with test counts: vitest --reporter=json / jest --json numTotalTests,numPassedTests,numFailedTests; or a runner's summary {total,passed,failed,skipped}, e.g. {"total":43,"passed":42,"failed":0,"skipped":1}; or node --test {tests,pass,fail,skipped}; counts must be non-negative integers that add up to the total, and any failure refuses. It proves only what the file says: tool:test or ci:<pr> prove the run), 'tool:<name>' (e.g. tool:test, tool:test-affected, tool:lint), 'url:<url>', 'note:<text>', 'ci:<pr>' (required CI green on the merged PR's merge commit; testsPassed/qaPassed, opt-in via evidence.ciSatisfies).`
70
+ },
71
+ explain: {
72
+ type: "boolean",
73
+ description: "Enrich read-only view with per-gate evidence breakdown, re-validation status, and blockers[] preventing `cleo complete` (T1013 / ADR-051)."
74
+ },
75
+ run: {
76
+ type: "boolean",
77
+ description: "Execute the task's typed acceptance gates and report the results. Records no verification, so use `--evidence` to attest (T12308); passing results are cached so the attesting write reuses them instead of re-running (T12621). With a write, `--no-run` executes no typed gate and uses only cached passes, refusing with E_GATE_NOT_CACHED when one is missing."
78
+ },
79
+ auto: {
80
+ type: "boolean",
81
+ description: "Derive the evidence and record every required gate in one write, exactly as `cleo done` does, without completing the task (T12625). Takes --satisfies and --pr."
82
+ },
83
+ satisfies: {
84
+ type: "string",
85
+ description: 'With --auto: criteria this work satisfies, e.g. "AC1,AC3" or "all"'
86
+ },
87
+ pr: {
88
+ type: "string",
89
+ description: "With --auto: the merged PR that implements the task"
90
+ },
91
+ fresh: {
92
+ type: "boolean",
93
+ description: "Bypass the ADR-061 tool cache and re-run every tool: atom (same as CLEO_EVIDENCE_FRESH=1, which still works). Use only when a cached result is suspect, e.g. after adding an untracked file (T12964)."
94
+ },
95
+ "shared-evidence": {
96
+ type: "boolean",
97
+ description: "Acknowledge that the same evidence atom is applied to >3 distinct tasks in this session (T1502 / ADR-059). Without this flag, such reuse triggers a warning; in strict mode (CLEO_STRICT_EVIDENCE=1) it is a hard reject."
98
+ }
99
+ },
100
+ async run({ args, cmd }) {
101
+ if (!args.taskId) {
102
+ await showUsage(cmd);
103
+ return;
104
+ }
105
+ const isWrite = !!(args.gate || args.all || args.reset);
106
+ const priorFresh = process.env["CLEO_EVIDENCE_FRESH"];
107
+ if (args.fresh === true) process.env["CLEO_EVIDENCE_FRESH"] = "1";
108
+ try {
109
+ if (args.auto === true) {
110
+ if (isWrite || args.evidence || args.run === true) {
111
+ cliError(
112
+ "--auto derives its own evidence; drop --gate/--all/--reset/--evidence/--run",
113
+ "E_INVALID_INPUT"
114
+ );
115
+ process.exitCode = ExitCode.VALIDATION_ERROR;
116
+ return;
117
+ }
118
+ const { parseDoneOptions } = await import("@cleocode/core/tasks/done-plan.js");
119
+ const parsed = parseDoneOptions(args.satisfies, args.pr);
120
+ if (!parsed.ok) {
121
+ cliError(parsed.message, "E_INVALID_INPUT");
122
+ process.exitCode = ExitCode.VALIDATION_ERROR;
123
+ return;
124
+ }
125
+ const { recordTaskDone } = await import("@cleocode/core/tasks/done-record.js");
126
+ const { getProjectRoot } = await import("@cleocode/core/paths.js");
127
+ const r = await recordTaskDone(args.taskId, {
128
+ projectRoot: getProjectRoot(),
129
+ ...parsed.options,
130
+ ...args.agent ? { agent: args.agent } : {}
131
+ });
132
+ if (!r.success) {
133
+ cliError(r.error.message, r.error.code, { fix: r.error.fix, details: r.error.details });
134
+ process.exitCode = r.error.exitCode ?? 1;
135
+ return;
136
+ }
137
+ const { plan: _plan, ...summary } = r.data;
138
+ cliOutput(summary, { command: "verify", operation: "check.gate.auto" });
139
+ return;
140
+ }
141
+ if (args.satisfies !== void 0 || args.pr !== void 0) {
142
+ cliError("--satisfies and --pr apply only with --auto (or cleo done)", "E_INVALID_INPUT");
143
+ process.exitCode = ExitCode.VALIDATION_ERROR;
144
+ return;
145
+ }
146
+ if (args.run === true && isWrite) {
147
+ cliError(
148
+ "--run reports typed gate results and records nothing; it cannot be combined with --gate/--all/--reset.",
149
+ ExitCode.VALIDATION_ERROR,
150
+ {
151
+ name: "E_VALIDATION",
152
+ fix: "Run `cleo verify <id> --run` first, then attest with `cleo verify <id> --gate <name> --evidence <atoms>`"
153
+ },
154
+ { operation: "check.gate.run" }
155
+ );
156
+ process.exitCode = ExitCode.VALIDATION_ERROR;
157
+ return;
158
+ }
159
+ const useExplain = !isWrite && args.explain === true;
160
+ const operation = isWrite ? "gate.set" : args.run === true ? "gate.run" : useExplain ? "verify.explain" : "gate.status";
161
+ await dispatchFromCli(
162
+ isWrite ? "mutate" : "query",
163
+ "check",
164
+ operation,
165
+ {
166
+ taskId: args.taskId,
167
+ gate: args.gate,
168
+ value: args.value === "false" ? false : args.gate ? true : void 0,
169
+ agent: args.agent,
170
+ all: args.all,
171
+ reset: args.reset,
172
+ evidence: args.evidence,
173
+ sharedEvidence: args["shared-evidence"] ?? false,
174
+ // T12621: citty turns `--no-run` into `run: false`; read it through the helper.
175
+ ...isWrite && negatedFlag(args, "run") ? { noRun: true } : {}
176
+ },
177
+ { command: "verify" }
178
+ );
179
+ } finally {
180
+ if (args.fresh === true) {
181
+ if (priorFresh === void 0) delete process.env["CLEO_EVIDENCE_FRESH"];
182
+ else process.env["CLEO_EVIDENCE_FRESH"] = priorFresh;
183
+ }
184
+ }
185
+ }
186
+ });
187
+ export {
188
+ verifyCommand
189
+ };
190
+ //# sourceMappingURL=verify-LYLDHPT2.js.map
@@ -0,0 +1,275 @@
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
+ GATEWAY_DEFAULT_HOST,
18
+ GATEWAY_DEFAULT_PORT,
19
+ shouldAutoStartGateway,
20
+ spawnGatewayIfDown
21
+ } from "./chunk-LVGIFMCV.js";
22
+ import {
23
+ WEB_DEFAULT_HOST,
24
+ WEB_DEFAULT_PORT,
25
+ createWebSubsystem,
26
+ getWebPaths,
27
+ getWebStatus
28
+ } from "./chunk-GH37QXW5.js";
29
+ import {
30
+ defineCommand
31
+ } from "./chunk-PKKZPOOP.js";
32
+ import {
33
+ cliOutput
34
+ } from "./chunk-3ZO3M37V.js";
35
+ import "./chunk-6JSJNYH2.js";
36
+
37
+ // packages/cleo/src/cli/commands/web.ts
38
+ import { spawn } from "node:child_process";
39
+ import { rm } from "node:fs/promises";
40
+ import { ExitCode } from "@cleocode/contracts";
41
+ import { CleoError, formatError } from "@cleocode/core";
42
+ function buildStudioUrl(port, host) {
43
+ return `http://${host}:${port}`;
44
+ }
45
+ function openBrowser(url) {
46
+ try {
47
+ if (process.platform === "linux") {
48
+ spawn("xdg-open", [url], { detached: true, stdio: "ignore" }).unref();
49
+ } else if (process.platform === "darwin") {
50
+ spawn("open", [url], { detached: true, stdio: "ignore" }).unref();
51
+ } else if (process.platform === "win32") {
52
+ spawn("cmd", ["/c", "start", "", url], { detached: true, stdio: "ignore" }).unref();
53
+ }
54
+ } catch {
55
+ }
56
+ }
57
+ var startCommand = defineCommand({
58
+ meta: { name: "start", description: "Start the web server" },
59
+ args: {
60
+ port: {
61
+ type: "string",
62
+ description: "Server port",
63
+ default: String(WEB_DEFAULT_PORT)
64
+ },
65
+ host: {
66
+ type: "string",
67
+ description: "Server host",
68
+ default: WEB_DEFAULT_HOST
69
+ }
70
+ },
71
+ async run({ args }) {
72
+ try {
73
+ const port = Number.parseInt(args.port, 10);
74
+ const host = args.host;
75
+ const subsystem = createWebSubsystem({ port, host });
76
+ const ctx = await subsystem.start();
77
+ const { logFile } = getWebPaths();
78
+ cliOutput(
79
+ {
80
+ pid: ctx.pid,
81
+ port: ctx.port,
82
+ host: ctx.host,
83
+ url: `http://${ctx.host}:${ctx.port}`,
84
+ logFile
85
+ },
86
+ { command: "web", message: `CLEO Web UI running on port ${ctx.port}` }
87
+ );
88
+ } catch (err) {
89
+ if (err instanceof CleoError) {
90
+ console.error(formatError(err));
91
+ process.exit(err.code);
92
+ }
93
+ throw err;
94
+ }
95
+ }
96
+ });
97
+ var stopCommand = defineCommand({
98
+ meta: { name: "stop", description: "Stop the web server" },
99
+ async run() {
100
+ try {
101
+ const { pidFile, logFile } = getWebPaths();
102
+ const status = await getWebStatus();
103
+ if (!status.running || status.pid === null) {
104
+ await rm(pidFile, { force: true });
105
+ cliOutput({ running: false }, { command: "web", message: "Server is not running" });
106
+ return;
107
+ }
108
+ const subsystem = createWebSubsystem({
109
+ port: status.port ?? WEB_DEFAULT_PORT,
110
+ host: status.host ?? WEB_DEFAULT_HOST
111
+ });
112
+ await subsystem.shutdown({
113
+ pid: status.pid,
114
+ pidFile,
115
+ logFile,
116
+ port: status.port ?? WEB_DEFAULT_PORT,
117
+ host: status.host ?? WEB_DEFAULT_HOST
118
+ });
119
+ cliOutput({ stopped: true }, { command: "web", message: "CLEO Web UI stopped" });
120
+ } catch (err) {
121
+ if (err instanceof CleoError) {
122
+ console.error(formatError(err));
123
+ process.exit(err.code);
124
+ }
125
+ throw err;
126
+ }
127
+ }
128
+ });
129
+ var restartCommand = defineCommand({
130
+ meta: { name: "restart", description: "Restart the web server" },
131
+ args: {
132
+ port: {
133
+ type: "string",
134
+ description: "Server port",
135
+ default: String(WEB_DEFAULT_PORT)
136
+ },
137
+ host: {
138
+ type: "string",
139
+ description: "Server host",
140
+ default: WEB_DEFAULT_HOST
141
+ }
142
+ },
143
+ async run({ args }) {
144
+ try {
145
+ const port = Number.parseInt(args.port, 10);
146
+ const host = args.host;
147
+ const { pidFile, logFile } = getWebPaths();
148
+ const status = await getWebStatus();
149
+ if (status.running && status.pid !== null) {
150
+ const stopSubsystem = createWebSubsystem({
151
+ port: status.port ?? port,
152
+ host: status.host ?? host
153
+ });
154
+ await stopSubsystem.shutdown({
155
+ pid: status.pid,
156
+ pidFile,
157
+ logFile,
158
+ port: status.port ?? port,
159
+ host: status.host ?? host
160
+ });
161
+ }
162
+ const startSubsystem = createWebSubsystem({ port, host });
163
+ const ctx = await startSubsystem.start();
164
+ cliOutput(
165
+ {
166
+ pid: ctx.pid,
167
+ port: ctx.port,
168
+ host: ctx.host,
169
+ url: `http://${ctx.host}:${ctx.port}`,
170
+ logFile
171
+ },
172
+ { command: "web", message: `CLEO Web UI running on port ${ctx.port}` }
173
+ );
174
+ } catch (err) {
175
+ if (err instanceof CleoError) {
176
+ console.error(formatError(err));
177
+ process.exit(err.code);
178
+ }
179
+ throw err;
180
+ }
181
+ }
182
+ });
183
+ var statusCommand = defineCommand({
184
+ meta: { name: "status", description: "Check server status" },
185
+ async run() {
186
+ try {
187
+ const status = await getWebStatus();
188
+ cliOutput(status, { command: "web" });
189
+ } catch (err) {
190
+ if (err instanceof CleoError) {
191
+ console.error(formatError(err));
192
+ process.exit(err.code);
193
+ }
194
+ throw err;
195
+ }
196
+ }
197
+ });
198
+ var openCommand = defineCommand({
199
+ meta: { name: "open", description: "Open browser to the UI" },
200
+ async run() {
201
+ try {
202
+ const status = await getWebStatus();
203
+ if (!status.running || !status.url) {
204
+ throw new CleoError(
205
+ ExitCode.GENERAL_ERROR,
206
+ "Web server is not running. Start with: cleo web start"
207
+ );
208
+ }
209
+ const url = status.url;
210
+ openBrowser(url);
211
+ cliOutput({ url }, { command: "web", message: `Open browser to: ${url}` });
212
+ } catch (err) {
213
+ if (err instanceof CleoError) {
214
+ console.error(formatError(err));
215
+ process.exit(err.code);
216
+ }
217
+ throw err;
218
+ }
219
+ }
220
+ });
221
+ var webCommand = defineCommand({
222
+ meta: { name: "web", description: "Open CLEO Studio in the browser (starts gateway on demand)" },
223
+ args: {
224
+ port: {
225
+ type: "string",
226
+ description: `Gateway port (default ${GATEWAY_DEFAULT_PORT})`
227
+ },
228
+ host: {
229
+ type: "string",
230
+ description: `Gateway host (default ${GATEWAY_DEFAULT_HOST})`
231
+ }
232
+ },
233
+ subCommands: {
234
+ start: startCommand,
235
+ stop: stopCommand,
236
+ restart: restartCommand,
237
+ status: statusCommand,
238
+ open: openCommand
239
+ },
240
+ async run({ cmd, rawArgs, args }) {
241
+ const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
242
+ if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
243
+ const portArg = args.port;
244
+ const hostArg = args.host;
245
+ const port = portArg !== void 0 && portArg.length > 0 ? Number.parseInt(portArg, 10) : GATEWAY_DEFAULT_PORT;
246
+ const host = hostArg ?? GATEWAY_DEFAULT_HOST;
247
+ let autoStart = true;
248
+ try {
249
+ const { getRawConfig } = await import("@cleocode/core");
250
+ const cfg = await getRawConfig();
251
+ autoStart = shouldAutoStartGateway(cfg);
252
+ } catch {
253
+ }
254
+ const studioUrl = buildStudioUrl(port, host);
255
+ if (autoStart) {
256
+ await spawnGatewayIfDown({ port, host });
257
+ }
258
+ openBrowser(studioUrl);
259
+ const urlNotice = `Opening Studio: ${studioUrl}
260
+ `;
261
+ process.stderr.write(urlNotice);
262
+ const installNote = " Note: Studio static bundle ships in T11979 (parallel lane).\n If the page is blank, the bundle may not yet be deployed in this install.\n";
263
+ process.stderr.write(installNote);
264
+ cliOutput(
265
+ { url: studioUrl, port, host, gatewayAutoStart: autoStart },
266
+ { command: "web", message: `Studio URL: ${studioUrl}` }
267
+ );
268
+ }
269
+ });
270
+ export {
271
+ buildStudioUrl,
272
+ openBrowser,
273
+ webCommand
274
+ };
275
+ //# sourceMappingURL=web-QP2RP266.js.map