@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,1088 @@
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
+ isSubCommandDispatch
21
+ } from "./chunk-YY66LFZF.js";
22
+ import {
23
+ defineCommand
24
+ } from "./chunk-PKKZPOOP.js";
25
+ import {
26
+ cliError,
27
+ cliOutput
28
+ } from "./chunk-3ZO3M37V.js";
29
+ import "./chunk-6JSJNYH2.js";
30
+
31
+ // packages/cleo/src/cli/commands/sentient.ts
32
+ import { join } from "node:path";
33
+ import { cwd as processCwd, stdin, stdout } from "node:process";
34
+ import { createInterface } from "node:readline/promises";
35
+ import {
36
+ getSentientDaemonStatus,
37
+ monitorWorkers,
38
+ RUNAWAY_BUDGET_MULTIPLIER,
39
+ resumeSentientDaemon,
40
+ SENTIENT_STATE_FILE,
41
+ spawnSentientDaemon,
42
+ stopSentientDaemon,
43
+ WORKER_BUDGET_MS
44
+ } from "@cleocode/core/sentient/daemon.js";
45
+ import {
46
+ appendSentientExecuteAudit,
47
+ executeFixAction,
48
+ extractFixActionFromNotesJson,
49
+ parseFixAction
50
+ } from "@cleocode/core/sentient/execute-action.js";
51
+ import { safeRunProposeTick } from "@cleocode/core/sentient/propose-tick.js";
52
+ import { patchSentientState, readSentientState } from "@cleocode/core/sentient/state.js";
53
+ import { safeRunTick } from "@cleocode/core/sentient/tick.js";
54
+ import {
55
+ getSkillPatch,
56
+ getSkillReview,
57
+ listSkillReviews,
58
+ markSkillPatchRejected
59
+ } from "@cleocode/core/store/skills-store.js";
60
+ var projectArgs = {
61
+ project: {
62
+ type: "string",
63
+ description: "Project root (defaults to process cwd)"
64
+ },
65
+ json: {
66
+ type: "boolean",
67
+ description: "Emit LAFS JSON envelope"
68
+ }
69
+ };
70
+ function resolveProjectRoot(arg) {
71
+ return arg && arg.length > 0 ? arg : processCwd();
72
+ }
73
+ function emitSuccess(payload, _jsonMode, message, operation) {
74
+ cliOutput(payload, { command: "sentient", message, ...operation ? { operation } : {} });
75
+ }
76
+ function emitFailure(code, message, _jsonMode, operation) {
77
+ cliError(message, code, { name: code }, operation ? { operation } : void 0);
78
+ process.exit(1);
79
+ }
80
+ var startSub = defineCommand({
81
+ meta: {
82
+ name: "start",
83
+ description: "Spawn the sentient daemon as a detached background process"
84
+ },
85
+ args: {
86
+ ...projectArgs,
87
+ "dry-run": {
88
+ type: "boolean",
89
+ description: "Run a single in-process tick without spawning the daemon"
90
+ }
91
+ },
92
+ async run({ args }) {
93
+ const projectRoot = resolveProjectRoot(args.project);
94
+ const jsonMode = args.json === true;
95
+ const dryRun = args["dry-run"] === true;
96
+ try {
97
+ const existing = await getSentientDaemonStatus(projectRoot);
98
+ if (existing.running && existing.pid) {
99
+ emitSuccess(
100
+ { running: true, pid: existing.pid, message: "daemon already running" },
101
+ jsonMode,
102
+ `Sentient daemon already running (pid ${existing.pid})`
103
+ );
104
+ return;
105
+ }
106
+ if (dryRun) {
107
+ const statePath2 = join(projectRoot, SENTIENT_STATE_FILE);
108
+ const outcome = await safeRunTick({ projectRoot, statePath: statePath2, dryRun: true });
109
+ emitSuccess(
110
+ { dryRun: true, outcome },
111
+ jsonMode,
112
+ `Dry-run tick: ${outcome.kind} (task=${outcome.taskId ?? "n/a"}) ${outcome.detail}`
113
+ );
114
+ return;
115
+ }
116
+ const { pid, statePath, logPath } = await spawnSentientDaemon(projectRoot);
117
+ emitSuccess(
118
+ { pid, statePath, logPath, message: "sentient daemon started" },
119
+ jsonMode,
120
+ `Sentient daemon started (pid ${pid})
121
+ State: ${statePath}
122
+ Logs: ${logPath}`
123
+ );
124
+ } catch (err) {
125
+ const message = err instanceof Error ? err.message : String(err);
126
+ emitFailure("E_SENTIENT_START", message, jsonMode);
127
+ }
128
+ }
129
+ });
130
+ var stopSub = defineCommand({
131
+ meta: {
132
+ name: "stop",
133
+ description: "Flip killSwitch=true and send SIGTERM to the daemon"
134
+ },
135
+ args: {
136
+ ...projectArgs,
137
+ reason: {
138
+ type: "string",
139
+ description: "Reason stored on sentient-state.json for diagnostics"
140
+ }
141
+ },
142
+ async run({ args }) {
143
+ const projectRoot = resolveProjectRoot(args.project);
144
+ const jsonMode = args.json === true;
145
+ const reason = args.reason ?? "cleo sentient stop";
146
+ try {
147
+ const result = await stopSentientDaemon(projectRoot, reason);
148
+ emitSuccess(result, jsonMode, `Sentient stop: ${result.reason}`);
149
+ } catch (err) {
150
+ const message = err instanceof Error ? err.message : String(err);
151
+ emitFailure("E_SENTIENT_STOP", message, jsonMode);
152
+ }
153
+ }
154
+ });
155
+ var statusSub = defineCommand({
156
+ meta: {
157
+ name: "status",
158
+ description: "Show daemon pid, stats, kill-switch state"
159
+ },
160
+ args: projectArgs,
161
+ async run({ args }) {
162
+ const projectRoot = resolveProjectRoot(args.project);
163
+ const jsonMode = args.json === true;
164
+ try {
165
+ const status = await getSentientDaemonStatus(projectRoot);
166
+ const runStr = status.running ? `running (pid ${status.pid})` : "stopped";
167
+ const ksStr = status.killSwitch ? `ACTIVE${status.killSwitchReason ? ` (${status.killSwitchReason})` : ""}` : "inactive";
168
+ emitSuccess(
169
+ status,
170
+ jsonMode,
171
+ `Daemon: ${runStr} | killSwitch=${ksStr} | picked=${status.stats.tasksPicked} completed=${status.stats.tasksCompleted} failed=${status.stats.tasksFailed}`,
172
+ "sentient.status"
173
+ );
174
+ } catch (err) {
175
+ const message = err instanceof Error ? err.message : String(err);
176
+ emitFailure("E_SENTIENT_STATUS", message, jsonMode, "sentient.status");
177
+ }
178
+ }
179
+ });
180
+ var resumeSub = defineCommand({
181
+ meta: {
182
+ name: "resume",
183
+ description: "Clear killSwitch so the cron schedule resumes execution"
184
+ },
185
+ args: projectArgs,
186
+ async run({ args }) {
187
+ const projectRoot = resolveProjectRoot(args.project);
188
+ const jsonMode = args.json === true;
189
+ try {
190
+ const state = await resumeSentientDaemon(projectRoot);
191
+ emitSuccess(
192
+ {
193
+ killSwitch: state.killSwitch,
194
+ killSwitchReason: state.killSwitchReason,
195
+ message: "killSwitch cleared"
196
+ },
197
+ jsonMode,
198
+ "Sentient kill-switch cleared. Daemon will resume ticks on next cron cadence."
199
+ );
200
+ } catch (err) {
201
+ const message = err instanceof Error ? err.message : String(err);
202
+ emitFailure("E_SENTIENT_RESUME", message, jsonMode);
203
+ }
204
+ }
205
+ });
206
+ var tickSub = defineCommand({
207
+ meta: {
208
+ name: "tick",
209
+ description: "Run a single tick in-process (diagnostic / owner verify)"
210
+ },
211
+ args: {
212
+ ...projectArgs,
213
+ "dry-run": {
214
+ type: "boolean",
215
+ description: "Skip the actual worker spawn"
216
+ }
217
+ },
218
+ async run({ args }) {
219
+ const projectRoot = resolveProjectRoot(args.project);
220
+ const jsonMode = args.json === true;
221
+ const dryRun = args["dry-run"] === true;
222
+ try {
223
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
224
+ const outcome = await safeRunTick({ projectRoot, statePath, dryRun });
225
+ emitSuccess(
226
+ { outcome, dryRun },
227
+ jsonMode,
228
+ `Tick outcome: ${outcome.kind} (task=${outcome.taskId ?? "n/a"}) ${outcome.detail}`
229
+ );
230
+ } catch (err) {
231
+ const message = err instanceof Error ? err.message : String(err);
232
+ emitFailure("E_SENTIENT_TICK", message, jsonMode);
233
+ }
234
+ }
235
+ });
236
+ var proposeListSub = defineCommand({
237
+ meta: {
238
+ name: "list",
239
+ description: "List all Tier-2 proposals (status=proposed)"
240
+ },
241
+ args: {
242
+ ...projectArgs,
243
+ limit: { type: "string", description: "Maximum proposals to return (default 50)" }
244
+ },
245
+ async run({ args }) {
246
+ const projectRoot = resolveProjectRoot(args.project);
247
+ const jsonMode = args.json === true;
248
+ const limit = args.limit ? Number.parseInt(args.limit, 10) : 50;
249
+ try {
250
+ const { Cleo } = await import("@cleocode/core/sdk");
251
+ const cleo = await Cleo.init(projectRoot);
252
+ const result = await cleo.dispatch?.("sentient", "query", "propose.list", { limit });
253
+ const data = result?.data ?? result;
254
+ emitSuccess(data, jsonMode, JSON.stringify(data, null, 2));
255
+ } catch (err) {
256
+ const message = err instanceof Error ? err.message : String(err);
257
+ emitFailure("E_SENTIENT_PROPOSE_LIST", message, jsonMode);
258
+ }
259
+ }
260
+ });
261
+ var promptAcceptExecution = async (fixAction) => {
262
+ const rl = createInterface({ input: stdin, output: stdout });
263
+ try {
264
+ stdout.write(`[sentient] Proposal accepted. fixAction:
265
+ $ ${fixAction}
266
+ `);
267
+ const answer = await rl.question("Execute now? [y/N] ");
268
+ const normalised = answer.trim().toLowerCase();
269
+ return normalised === "y" || normalised === "yes";
270
+ } finally {
271
+ rl.close();
272
+ }
273
+ };
274
+ function __setPromptAcceptExecutionForTest(next) {
275
+ const prev = promptAcceptExecution;
276
+ promptAcceptExecution = next;
277
+ return () => {
278
+ promptAcceptExecution = prev;
279
+ };
280
+ }
281
+ var proposeAcceptSub = defineCommand({
282
+ meta: {
283
+ name: "accept",
284
+ description: "Accept a proposal \u2014 transition proposed \u2192 pending, optionally execute its fixAction"
285
+ },
286
+ args: {
287
+ ...projectArgs,
288
+ id: { type: "positional", description: "Proposal task ID", required: true },
289
+ execute: {
290
+ type: "boolean",
291
+ description: "Execute proposal.fixAction without prompting"
292
+ },
293
+ "no-execute": {
294
+ type: "boolean",
295
+ description: "Skip fixAction execution even if the proposal carries one"
296
+ }
297
+ },
298
+ async run({ args }) {
299
+ const projectRoot = resolveProjectRoot(args.project);
300
+ const jsonMode = args.json === true;
301
+ const id = args.id;
302
+ const forceExecute = args.execute === true;
303
+ const skipExecute = negatedFlag(args, "execute");
304
+ try {
305
+ const { getDb } = await import("@cleocode/core/store/sqlite.js");
306
+ const { tasks } = await import("@cleocode/core/store/tasks-schema");
307
+ const { and, eq, like } = await import("drizzle-orm");
308
+ const db = await getDb(projectRoot);
309
+ const now = (/* @__PURE__ */ new Date()).toISOString();
310
+ const existing = await db.select().from(tasks).where(
311
+ and(
312
+ eq(tasks.id, id),
313
+ eq(tasks.status, "proposed"),
314
+ like(tasks.labelsJson, "%sentient-tier2%")
315
+ )
316
+ ).get();
317
+ if (!existing) {
318
+ emitFailure("E_NOT_FOUND", `Task ${id} is not a pending Tier-2 proposal`, jsonMode);
319
+ return;
320
+ }
321
+ await db.update(tasks).set({ status: "pending", updatedAt: now }).where(eq(tasks.id, id)).run();
322
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
323
+ const state = await readSentientState(statePath);
324
+ await patchSentientState(statePath, {
325
+ tier2Stats: {
326
+ ...state.tier2Stats,
327
+ proposalsAccepted: state.tier2Stats.proposalsAccepted + 1
328
+ }
329
+ });
330
+ const fixAction = extractFixActionFromNotesJson(existing.notesJson ?? null);
331
+ let shouldExecute = false;
332
+ if (fixAction && !skipExecute) {
333
+ if (forceExecute) {
334
+ shouldExecute = true;
335
+ } else {
336
+ shouldExecute = await promptAcceptExecution(fixAction);
337
+ }
338
+ }
339
+ if (!shouldExecute) {
340
+ emitSuccess(
341
+ {
342
+ id,
343
+ status: "pending",
344
+ acceptedAt: now,
345
+ executed: false,
346
+ fixAction: fixAction ?? null
347
+ },
348
+ jsonMode,
349
+ `Proposal ${id} accepted \u2192 pending`
350
+ );
351
+ return;
352
+ }
353
+ const parsed = parseFixAction(fixAction);
354
+ if (!parsed.ok) {
355
+ emitFailure(parsed.code, parsed.reason, jsonMode);
356
+ return;
357
+ }
358
+ const result = await executeFixAction(parsed, { cwd: projectRoot });
359
+ await appendSentientExecuteAudit(projectRoot, {
360
+ proposalId: id,
361
+ fixAction,
362
+ exitCode: result.exitCode,
363
+ durationMs: result.durationMs,
364
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
365
+ });
366
+ emitSuccess(
367
+ {
368
+ id,
369
+ status: "pending",
370
+ acceptedAt: now,
371
+ executed: true,
372
+ exitCode: result.exitCode,
373
+ stderrSnippet: result.stderrSnippet,
374
+ fixAction
375
+ },
376
+ jsonMode,
377
+ `Proposal ${id} accepted \u2192 pending (fixAction exit=${result.exitCode})`
378
+ );
379
+ } catch (err) {
380
+ const message = err instanceof Error ? err.message : String(err);
381
+ emitFailure("E_SENTIENT_PROPOSE_ACCEPT", message, jsonMode);
382
+ }
383
+ }
384
+ });
385
+ var proposeRejectSub = defineCommand({
386
+ meta: {
387
+ name: "reject",
388
+ description: "Reject a proposal \u2014 transition proposed \u2192 cancelled"
389
+ },
390
+ args: {
391
+ ...projectArgs,
392
+ id: { type: "positional", description: "Proposal task ID", required: true },
393
+ reason: { type: "string", description: "Rejection reason" }
394
+ },
395
+ async run({ args }) {
396
+ const projectRoot = resolveProjectRoot(args.project);
397
+ const jsonMode = args.json === true;
398
+ const id = args.id;
399
+ const reason = args.reason ?? "rejected by owner";
400
+ try {
401
+ const { getDb } = await import("@cleocode/core/store/sqlite.js");
402
+ const { tasks } = await import("@cleocode/core/store/tasks-schema");
403
+ const { and, eq, like } = await import("drizzle-orm");
404
+ const db = await getDb(projectRoot);
405
+ const now = (/* @__PURE__ */ new Date()).toISOString();
406
+ const existing = await db.select().from(tasks).where(
407
+ and(
408
+ eq(tasks.id, id),
409
+ eq(tasks.status, "proposed"),
410
+ like(tasks.labelsJson, "%sentient-tier2%")
411
+ )
412
+ ).get();
413
+ if (!existing) {
414
+ emitFailure("E_NOT_FOUND", `Task ${id} is not a pending Tier-2 proposal`, jsonMode);
415
+ return;
416
+ }
417
+ await db.update(tasks).set({ status: "cancelled", cancellationReason: reason, cancelledAt: now, updatedAt: now }).where(eq(tasks.id, id)).run();
418
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
419
+ const state = await readSentientState(statePath);
420
+ await patchSentientState(statePath, {
421
+ tier2Stats: {
422
+ ...state.tier2Stats,
423
+ proposalsRejected: state.tier2Stats.proposalsRejected + 1
424
+ }
425
+ });
426
+ emitSuccess(
427
+ { id, status: "cancelled", rejectedAt: now, reason },
428
+ jsonMode,
429
+ `Proposal ${id} rejected \u2192 cancelled`
430
+ );
431
+ } catch (err) {
432
+ const message = err instanceof Error ? err.message : String(err);
433
+ emitFailure("E_SENTIENT_PROPOSE_REJECT", message, jsonMode);
434
+ }
435
+ }
436
+ });
437
+ var proposeDiffSub = defineCommand({
438
+ meta: {
439
+ name: "diff",
440
+ description: "Show what a proposal would change (Tier-3 stub)"
441
+ },
442
+ args: {
443
+ ...projectArgs,
444
+ id: { type: "positional", description: "Proposal task ID", required: true }
445
+ },
446
+ async run({ args }) {
447
+ const jsonMode = args.json === true;
448
+ const id = args.id;
449
+ const msg = `Content diff is a Tier-3 feature (blocked on T992+T993+T995). Proposal ${id} is a task-creation suggestion; no diff is available.`;
450
+ emitSuccess({ id, diff: null, message: msg }, jsonMode, msg);
451
+ }
452
+ });
453
+ var proposeRunSub = defineCommand({
454
+ meta: {
455
+ name: "run",
456
+ description: "Manually trigger a single propose tick in-process"
457
+ },
458
+ args: projectArgs,
459
+ async run({ args }) {
460
+ const projectRoot = resolveProjectRoot(args.project);
461
+ const jsonMode = args.json === true;
462
+ try {
463
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
464
+ const outcome = await safeRunProposeTick({ projectRoot, statePath });
465
+ emitSuccess(
466
+ { outcome },
467
+ jsonMode,
468
+ `Propose tick: ${outcome.kind} (written=${outcome.written}, count=${outcome.count}) ${outcome.detail}`
469
+ );
470
+ } catch (err) {
471
+ const message = err instanceof Error ? err.message : String(err);
472
+ emitFailure("E_SENTIENT_PROPOSE_RUN", message, jsonMode);
473
+ }
474
+ }
475
+ });
476
+ var proposeEnableSub = defineCommand({
477
+ meta: { name: "enable", description: "Enable Tier-2 proposal generation" },
478
+ args: projectArgs,
479
+ async run({ args }) {
480
+ const projectRoot = resolveProjectRoot(args.project);
481
+ const jsonMode = args.json === true;
482
+ try {
483
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
484
+ const updated = await patchSentientState(statePath, { tier2Enabled: true });
485
+ emitSuccess({ tier2Enabled: updated.tier2Enabled }, jsonMode, "Tier-2 proposals enabled");
486
+ } catch (err) {
487
+ emitFailure(
488
+ "E_SENTIENT_PROPOSE_ENABLE",
489
+ err instanceof Error ? err.message : String(err),
490
+ jsonMode
491
+ );
492
+ }
493
+ }
494
+ });
495
+ var proposeDisableSub = defineCommand({
496
+ meta: { name: "disable", description: "Disable Tier-2 proposal generation" },
497
+ args: projectArgs,
498
+ async run({ args }) {
499
+ const projectRoot = resolveProjectRoot(args.project);
500
+ const jsonMode = args.json === true;
501
+ try {
502
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
503
+ const updated = await patchSentientState(statePath, { tier2Enabled: false });
504
+ emitSuccess({ tier2Enabled: updated.tier2Enabled }, jsonMode, "Tier-2 proposals disabled");
505
+ } catch (err) {
506
+ emitFailure(
507
+ "E_SENTIENT_PROPOSE_DISABLE",
508
+ err instanceof Error ? err.message : String(err),
509
+ jsonMode
510
+ );
511
+ }
512
+ }
513
+ });
514
+ var proposeSub = defineCommand({
515
+ meta: {
516
+ name: "propose",
517
+ description: "Tier-2 proposal queue management (list/accept/reject/diff/run)"
518
+ },
519
+ args: projectArgs,
520
+ subCommands: {
521
+ list: proposeListSub,
522
+ accept: proposeAcceptSub,
523
+ reject: proposeRejectSub,
524
+ diff: proposeDiffSub,
525
+ run: proposeRunSub,
526
+ enable: proposeEnableSub,
527
+ disable: proposeDisableSub
528
+ },
529
+ async run({ args }) {
530
+ const projectRoot = resolveProjectRoot(args.project);
531
+ const jsonMode = args.json === true;
532
+ try {
533
+ const statePath = join(projectRoot, SENTIENT_STATE_FILE);
534
+ const state = await readSentientState(statePath);
535
+ emitSuccess(
536
+ {
537
+ tier2Enabled: state.tier2Enabled,
538
+ tier2Stats: state.tier2Stats
539
+ },
540
+ jsonMode,
541
+ `Tier-2 proposals: ${state.tier2Enabled ? "enabled" : "disabled"} | generated=${state.tier2Stats.proposalsGenerated} accepted=${state.tier2Stats.proposalsAccepted} rejected=${state.tier2Stats.proposalsRejected}`
542
+ );
543
+ } catch (err) {
544
+ emitFailure("E_SENTIENT_PROPOSE", err instanceof Error ? err.message : String(err), jsonMode);
545
+ }
546
+ }
547
+ });
548
+ var baselineCaptureSub = defineCommand({
549
+ meta: {
550
+ name: "capture",
551
+ description: "Capture a signed baseline event for a commit SHA (must predate experiment worktree creation)"
552
+ },
553
+ args: {
554
+ ...projectArgs,
555
+ sha: {
556
+ type: "positional",
557
+ description: "Git commit SHA to anchor the baseline to (40 hex chars)",
558
+ required: true
559
+ }
560
+ },
561
+ async run({ args }) {
562
+ const projectRoot = resolveProjectRoot(args.project);
563
+ const jsonMode = args.json === true;
564
+ const commitSha = args.sha;
565
+ try {
566
+ const { captureBaseline } = await import("@cleocode/core/sentient/baseline.js");
567
+ const baseline = await captureBaseline(projectRoot, commitSha);
568
+ emitSuccess(
569
+ baseline,
570
+ jsonMode,
571
+ `Baseline captured: receipt=${baseline.receiptId} commit=${baseline.commitSha} pub=${baseline.publicKey.slice(0, 16)}...`
572
+ );
573
+ } catch (err) {
574
+ const message = err instanceof Error ? err.message : String(err);
575
+ emitFailure("E_SENTIENT_BASELINE_CAPTURE", message, jsonMode);
576
+ }
577
+ }
578
+ });
579
+ var baselineSub = defineCommand({
580
+ meta: {
581
+ name: "baseline",
582
+ description: "Tier-3 baseline management (capture signed pre-experiment baseline)"
583
+ },
584
+ args: projectArgs,
585
+ subCommands: {
586
+ capture: baselineCaptureSub
587
+ },
588
+ async run({ args, cmd, rawArgs }) {
589
+ if (isSubCommandDispatch(rawArgs, cmd.subCommands)) return;
590
+ const jsonMode = args.json === true;
591
+ emitSuccess(
592
+ { message: "Use: cleo sentient baseline capture <sha>" },
593
+ jsonMode,
594
+ "Usage: cleo sentient baseline capture <sha>"
595
+ );
596
+ }
597
+ });
598
+ var allowlistListSub = defineCommand({
599
+ meta: {
600
+ name: "list",
601
+ description: "Show the current ownerPubkeys allowlist"
602
+ },
603
+ args: projectArgs,
604
+ async run({ args }) {
605
+ const projectRoot = resolveProjectRoot(args.project);
606
+ const jsonMode = args.json === true;
607
+ try {
608
+ const { getOwnerPubkeys } = await import("@cleocode/core/sentient/allowlist.js");
609
+ const pubkeys = await getOwnerPubkeys(projectRoot, { noCache: true });
610
+ const b64List = pubkeys.map((k) => Buffer.from(k).toString("base64"));
611
+ emitSuccess(
612
+ { ownerPubkeys: b64List, count: b64List.length },
613
+ jsonMode,
614
+ b64List.length === 0 ? "No owner pubkeys configured (allowlist is empty)" : `Owner pubkeys (${b64List.length}):
615
+ ${b64List.map((k, i) => ` ${i + 1}. ${k}`).join("\n")}`
616
+ );
617
+ } catch (err) {
618
+ emitFailure(
619
+ "E_SENTIENT_ALLOWLIST_LIST",
620
+ err instanceof Error ? err.message : String(err),
621
+ jsonMode
622
+ );
623
+ }
624
+ }
625
+ });
626
+ var allowlistAddSub = defineCommand({
627
+ meta: {
628
+ name: "add",
629
+ description: "Add a base64-encoded Ed25519 pubkey to the owner allowlist"
630
+ },
631
+ args: {
632
+ ...projectArgs,
633
+ pubkey: {
634
+ type: "positional",
635
+ description: "Base64-encoded Ed25519 public key (32 bytes)",
636
+ required: true
637
+ }
638
+ },
639
+ async run({ args }) {
640
+ const projectRoot = resolveProjectRoot(args.project);
641
+ const jsonMode = args.json === true;
642
+ const pubkeyBase64 = args.pubkey;
643
+ try {
644
+ const { addOwnerPubkey } = await import("@cleocode/core/sentient/allowlist.js");
645
+ await addOwnerPubkey(projectRoot, pubkeyBase64);
646
+ emitSuccess(
647
+ { added: pubkeyBase64 },
648
+ jsonMode,
649
+ `Pubkey added to allowlist: ${pubkeyBase64.slice(0, 16)}...`
650
+ );
651
+ } catch (err) {
652
+ emitFailure(
653
+ "E_SENTIENT_ALLOWLIST_ADD",
654
+ err instanceof Error ? err.message : String(err),
655
+ jsonMode
656
+ );
657
+ }
658
+ }
659
+ });
660
+ var allowlistRemoveSub = defineCommand({
661
+ meta: {
662
+ name: "remove",
663
+ description: "Remove a base64-encoded Ed25519 pubkey from the owner allowlist"
664
+ },
665
+ args: {
666
+ ...projectArgs,
667
+ pubkey: {
668
+ type: "positional",
669
+ description: "Base64-encoded Ed25519 public key to remove",
670
+ required: true
671
+ }
672
+ },
673
+ async run({ args }) {
674
+ const projectRoot = resolveProjectRoot(args.project);
675
+ const jsonMode = args.json === true;
676
+ const pubkeyBase64 = args.pubkey;
677
+ try {
678
+ const { removeOwnerPubkey } = await import("@cleocode/core/sentient/allowlist.js");
679
+ await removeOwnerPubkey(projectRoot, pubkeyBase64);
680
+ emitSuccess(
681
+ { removed: pubkeyBase64 },
682
+ jsonMode,
683
+ `Pubkey removed from allowlist: ${pubkeyBase64.slice(0, 16)}...`
684
+ );
685
+ } catch (err) {
686
+ const code = err.code === "E_ALLOWLIST_KEY_NOT_FOUND" ? "E_ALLOWLIST_KEY_NOT_FOUND" : "E_SENTIENT_ALLOWLIST_REMOVE";
687
+ emitFailure(code, err instanceof Error ? err.message : String(err), jsonMode);
688
+ }
689
+ }
690
+ });
691
+ var allowlistSub = defineCommand({
692
+ meta: {
693
+ name: "allowlist",
694
+ description: "Manage the owner pubkey allowlist for Tier-3 sentient operations"
695
+ },
696
+ args: projectArgs,
697
+ subCommands: {
698
+ list: allowlistListSub,
699
+ add: allowlistAddSub,
700
+ remove: allowlistRemoveSub
701
+ },
702
+ async run({ args, cmd, rawArgs }) {
703
+ if (isSubCommandDispatch(rawArgs, cmd.subCommands)) return;
704
+ const jsonMode = args.json === true;
705
+ emitSuccess(
706
+ { message: "Use: cleo sentient allowlist list|add|remove" },
707
+ jsonMode,
708
+ "Usage: cleo sentient allowlist list|add <base64>|remove <base64>"
709
+ );
710
+ }
711
+ });
712
+ var monitorSub = defineCommand({
713
+ meta: {
714
+ name: "monitor",
715
+ description: "Show active workers and flag runaway tasks exceeding size-based budgets"
716
+ },
717
+ args: {
718
+ ...projectArgs,
719
+ "show-budgets": {
720
+ type: "boolean",
721
+ description: "Print the size-budget table before worker rows"
722
+ }
723
+ },
724
+ async run({ args }) {
725
+ const projectRoot = resolveProjectRoot(args.project);
726
+ const jsonMode = args.json === true;
727
+ const showBudgets = args["show-budgets"] === true;
728
+ try {
729
+ const rows = await monitorWorkers(projectRoot);
730
+ if (jsonMode) {
731
+ emitSuccess(
732
+ { workers: rows, budgetMultiplier: RUNAWAY_BUDGET_MULTIPLIER, budgets: WORKER_BUDGET_MS },
733
+ jsonMode,
734
+ `sentient monitor: ${rows.length} active worker(s), ${rows.filter((r) => r.runaway).length} runaway`,
735
+ "sentient.monitor"
736
+ );
737
+ return;
738
+ }
739
+ if (showBudgets) {
740
+ process.stdout.write("\nSize budgets:\n");
741
+ for (const [size, ms] of Object.entries(WORKER_BUDGET_MS)) {
742
+ const mins = Math.round(ms / 6e4);
743
+ process.stdout.write(
744
+ ` ${size.padEnd(8)} ${mins} min (runaway at ${mins * RUNAWAY_BUDGET_MULTIPLIER} min)
745
+ `
746
+ );
747
+ }
748
+ process.stdout.write("\n");
749
+ }
750
+ if (rows.length === 0) {
751
+ process.stdout.write("No active workers.\n");
752
+ return;
753
+ }
754
+ process.stdout.write(`Active workers (${rows.length}):
755
+
756
+ `);
757
+ for (const row of rows) {
758
+ const elapsed = Math.round(row.elapsedMs / 6e4);
759
+ const budget = Math.round(row.budgetMs / 6e4);
760
+ const label = row.runaway ? "RUNAWAY" : row.overBudget ? "WARNING" : "OK ";
761
+ process.stdout.write(
762
+ ` [${label}] ${row.taskId} \u2014 ${row.title.slice(0, 50)} | size=${row.size} elapsed=${elapsed}m budget=${budget}m
763
+ `
764
+ );
765
+ }
766
+ } catch (err) {
767
+ const message = err instanceof Error ? err.message : String(err);
768
+ emitFailure("E_SENTIENT_MONITOR", message, jsonMode, "sentient.monitor");
769
+ }
770
+ }
771
+ });
772
+ var reviewStatusListSub = defineCommand({
773
+ meta: {
774
+ name: "list",
775
+ description: "List pending auto-improve reviews + linked patches (read-only)"
776
+ },
777
+ args: {
778
+ json: { type: "boolean", description: "Emit LAFS JSON envelope" },
779
+ pending: {
780
+ type: "boolean",
781
+ description: "Filter to entries with a `proposed` patch awaiting accept/reject"
782
+ },
783
+ limit: { type: "string", description: "Max entries to return (default 50)" }
784
+ },
785
+ async run({ args }) {
786
+ const jsonMode = args.json === true;
787
+ const limit = args.limit ? Number.parseInt(args.limit, 10) : 50;
788
+ const pendingOnly = args.pending === true;
789
+ try {
790
+ const entries = await listSkillReviews({ pendingOnly, limit });
791
+ emitSuccess(
792
+ { entries, count: entries.length, pendingOnly },
793
+ jsonMode,
794
+ `Reviews: ${entries.length}${pendingOnly ? " (pending only)" : ""}`,
795
+ "sentient.review-status.list"
796
+ );
797
+ } catch (err) {
798
+ emitFailure(
799
+ "E_REVIEW_STATUS_LIST",
800
+ err instanceof Error ? err.message : String(err),
801
+ jsonMode,
802
+ "sentient.review-status.list"
803
+ );
804
+ }
805
+ }
806
+ });
807
+ var reviewStatusShowSub = defineCommand({
808
+ meta: {
809
+ name: "show",
810
+ description: "Show full detail for one auto-improve review row"
811
+ },
812
+ args: {
813
+ "review-id": {
814
+ type: "positional",
815
+ description: "`skill_reviews.id` to inspect",
816
+ required: true
817
+ },
818
+ json: { type: "boolean", description: "Emit LAFS JSON envelope" }
819
+ },
820
+ async run({ args }) {
821
+ const jsonMode = args.json === true;
822
+ const reviewId = Number.parseInt(String(args["review-id"]), 10);
823
+ if (!Number.isInteger(reviewId)) {
824
+ emitFailure(
825
+ "E_VALIDATION",
826
+ `review-id must be an integer (got '${String(args["review-id"])}')`,
827
+ jsonMode,
828
+ "sentient.review-status.show"
829
+ );
830
+ return;
831
+ }
832
+ try {
833
+ const detail = await getSkillReview(reviewId);
834
+ if (!detail.review) {
835
+ emitFailure(
836
+ "E_NOT_FOUND",
837
+ `No skill_reviews row for id=${reviewId}`,
838
+ jsonMode,
839
+ "sentient.review-status.show"
840
+ );
841
+ return;
842
+ }
843
+ emitSuccess(
844
+ {
845
+ review: detail.review,
846
+ patches: detail.patches,
847
+ isCanonical: detail.isCanonical,
848
+ skillRow: detail.skillRow
849
+ },
850
+ jsonMode,
851
+ `Review ${reviewId} for ${detail.review.skillName}: ${detail.review.outcome}`,
852
+ "sentient.review-status.show"
853
+ );
854
+ } catch (err) {
855
+ emitFailure(
856
+ "E_REVIEW_STATUS_SHOW",
857
+ err instanceof Error ? err.message : String(err),
858
+ jsonMode,
859
+ "sentient.review-status.show"
860
+ );
861
+ }
862
+ }
863
+ });
864
+ var reviewStatusAcceptSub = defineCommand({
865
+ meta: {
866
+ name: "accept",
867
+ description: "Accept a proposed patch \u2014 routes Sphere A to PR-cut, Sphere B to local-apply"
868
+ },
869
+ args: {
870
+ "patch-id": {
871
+ type: "positional",
872
+ description: "`skill_patches.id` to accept",
873
+ required: true
874
+ },
875
+ json: { type: "boolean", description: "Emit LAFS JSON envelope" }
876
+ },
877
+ async run({ args }) {
878
+ const jsonMode = args.json === true;
879
+ const patchId = Number.parseInt(String(args["patch-id"]), 10);
880
+ if (!Number.isInteger(patchId)) {
881
+ emitFailure(
882
+ "E_VALIDATION",
883
+ `patch-id must be an integer (got '${String(args["patch-id"])}')`,
884
+ jsonMode,
885
+ "sentient.review-status.accept"
886
+ );
887
+ return;
888
+ }
889
+ try {
890
+ const detail = await getSkillPatch(patchId);
891
+ const patch = detail.patch;
892
+ if (!patch) {
893
+ emitFailure(
894
+ "E_NOT_FOUND",
895
+ `No skill_patches row for id=${patchId}`,
896
+ jsonMode,
897
+ "sentient.review-status.accept"
898
+ );
899
+ return;
900
+ }
901
+ if (patch.status !== "proposed") {
902
+ emitFailure(
903
+ "E_VALIDATION",
904
+ `patch ${patchId} is not in 'proposed' state (status='${patch.status}')`,
905
+ jsonMode,
906
+ "sentient.review-status.accept"
907
+ );
908
+ return;
909
+ }
910
+ const skillRow = detail.skillRow;
911
+ if (!skillRow) {
912
+ emitFailure(
913
+ "E_NOT_FOUND",
914
+ `No skills row for name='${patch.skillName}'`,
915
+ jsonMode,
916
+ "sentient.review-status.accept"
917
+ );
918
+ return;
919
+ }
920
+ if (skillRow.sourceType === "canonical") {
921
+ const suggestion = `cleo skills propose-patch ${patch.skillName} --diff <write the diff to a file>`;
922
+ emitSuccess(
923
+ {
924
+ patchId,
925
+ skillName: patch.skillName,
926
+ route: "pr-generator",
927
+ isCanonical: true,
928
+ command: suggestion,
929
+ note: "Sphere A canonical \u2014 owner must run `cleo skills propose-patch` to cut a PR"
930
+ },
931
+ jsonMode,
932
+ `Patch ${patchId} targets canonical skill ${patch.skillName} \u2014 run: ${suggestion}`,
933
+ "sentient.review-status.accept"
934
+ );
935
+ return;
936
+ }
937
+ const { applyLocalSkillPatch } = await import("@cleocode/core/sentient");
938
+ emitSuccess(
939
+ {
940
+ patchId,
941
+ skillName: patch.skillName,
942
+ route: "local-apply",
943
+ isCanonical: false,
944
+ note: "Sphere B \u2014 daemons calling this CLI MUST also surface the file payload via `applyLocalSkillPatch`. This CLI is the dispatch surface; mutation happens in the daemon."
945
+ },
946
+ jsonMode,
947
+ `Patch ${patchId} routed to local-apply for ${patch.skillName}`,
948
+ "sentient.review-status.accept"
949
+ );
950
+ void applyLocalSkillPatch;
951
+ } catch (err) {
952
+ emitFailure(
953
+ "E_REVIEW_STATUS_ACCEPT",
954
+ err instanceof Error ? err.message : String(err),
955
+ jsonMode,
956
+ "sentient.review-status.accept"
957
+ );
958
+ }
959
+ }
960
+ });
961
+ var reviewStatusRejectSub = defineCommand({
962
+ meta: {
963
+ name: "reject",
964
+ description: "Reject a proposed patch \u2014 sets skill_patches.status=rejected"
965
+ },
966
+ args: {
967
+ "patch-id": {
968
+ type: "positional",
969
+ description: "`skill_patches.id` to reject",
970
+ required: true
971
+ },
972
+ reason: { type: "string", description: "Free-form rejection reason" },
973
+ json: { type: "boolean", description: "Emit LAFS JSON envelope" }
974
+ },
975
+ async run({ args }) {
976
+ const jsonMode = args.json === true;
977
+ const patchId = Number.parseInt(String(args["patch-id"]), 10);
978
+ if (!Number.isInteger(patchId)) {
979
+ emitFailure(
980
+ "E_VALIDATION",
981
+ `patch-id must be an integer (got '${String(args["patch-id"])}')`,
982
+ jsonMode,
983
+ "sentient.review-status.reject"
984
+ );
985
+ return;
986
+ }
987
+ try {
988
+ const detail = await getSkillPatch(patchId);
989
+ if (!detail.patch) {
990
+ emitFailure(
991
+ "E_NOT_FOUND",
992
+ `No skill_patches row for id=${patchId}`,
993
+ jsonMode,
994
+ "sentient.review-status.reject"
995
+ );
996
+ return;
997
+ }
998
+ if (detail.patch.status !== "proposed") {
999
+ emitFailure(
1000
+ "E_VALIDATION",
1001
+ `patch ${patchId} is not in 'proposed' state (status='${detail.patch.status}')`,
1002
+ jsonMode,
1003
+ "sentient.review-status.reject"
1004
+ );
1005
+ return;
1006
+ }
1007
+ await markSkillPatchRejected(patchId);
1008
+ const reason = args.reason ?? "rejected by operator";
1009
+ emitSuccess(
1010
+ { patchId, skillName: detail.patch.skillName, status: "rejected", reason },
1011
+ jsonMode,
1012
+ `Patch ${patchId} rejected (${reason})`,
1013
+ "sentient.review-status.reject"
1014
+ );
1015
+ } catch (err) {
1016
+ emitFailure(
1017
+ "E_REVIEW_STATUS_REJECT",
1018
+ err instanceof Error ? err.message : String(err),
1019
+ jsonMode,
1020
+ "sentient.review-status.reject"
1021
+ );
1022
+ }
1023
+ }
1024
+ });
1025
+ var reviewStatusSub = defineCommand({
1026
+ meta: {
1027
+ name: "review-status",
1028
+ description: "Auto-improve review/patch status (read-only listing + accept/reject dispatch \u2014 T9727)"
1029
+ },
1030
+ subCommands: {
1031
+ list: reviewStatusListSub,
1032
+ show: reviewStatusShowSub,
1033
+ accept: reviewStatusAcceptSub,
1034
+ reject: reviewStatusRejectSub
1035
+ },
1036
+ async run({ cmd, rawArgs }) {
1037
+ if (isSubCommandDispatch(rawArgs, cmd.subCommands)) return;
1038
+ await reviewStatusListSub.run?.({
1039
+ args: {},
1040
+ cmd: reviewStatusListSub,
1041
+ rawArgs,
1042
+ data: void 0
1043
+ });
1044
+ }
1045
+ });
1046
+ var sentientCommand = defineCommand({
1047
+ meta: {
1048
+ name: "sentient",
1049
+ description: "Manage the Tier-1 sentient autonomous loop daemon and Tier-2 proposals"
1050
+ },
1051
+ args: projectArgs,
1052
+ subCommands: {
1053
+ start: startSub,
1054
+ stop: stopSub,
1055
+ status: statusSub,
1056
+ resume: resumeSub,
1057
+ tick: tickSub,
1058
+ propose: proposeSub,
1059
+ baseline: baselineSub,
1060
+ allowlist: allowlistSub,
1061
+ monitor: monitorSub,
1062
+ "review-status": reviewStatusSub
1063
+ },
1064
+ async run({ args, cmd, rawArgs }) {
1065
+ if (isSubCommandDispatch(rawArgs, cmd.subCommands)) return;
1066
+ const projectRoot = resolveProjectRoot(args.project);
1067
+ const jsonMode = args.json === true;
1068
+ try {
1069
+ const status = await getSentientDaemonStatus(projectRoot);
1070
+ const ksStr = status.killSwitch ? "ACTIVE" : "inactive";
1071
+ emitSuccess(
1072
+ status,
1073
+ jsonMode,
1074
+ `Daemon: ${status.running ? `running (pid ${status.pid})` : "stopped"} | killSwitch=${ksStr} | picked=${status.stats.tasksPicked} completed=${status.stats.tasksCompleted} failed=${status.stats.tasksFailed}`,
1075
+ "sentient.status"
1076
+ );
1077
+ } catch (err) {
1078
+ const message = err instanceof Error ? err.message : String(err);
1079
+ emitFailure("E_SENTIENT_STATUS", message, jsonMode, "sentient.status");
1080
+ }
1081
+ }
1082
+ });
1083
+ export {
1084
+ __setPromptAcceptExecutionForTest,
1085
+ promptAcceptExecution,
1086
+ sentientCommand
1087
+ };
1088
+ //# sourceMappingURL=sentient-M4YMAVGV.js.map