@cleocode/cleo 2026.10.3 → 2026.10.5-rc.ci.672
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.
- package/README.md +7 -0
- package/bin/cleo.js +11 -1
- package/dist/cli/adapter-OUQRSFZL.js +159 -0
- package/dist/cli/add-4SRRJL4U.js +443 -0
- package/dist/cli/add-batch-TSWICA5J.js +164 -0
- package/dist/cli/admin-L3F6CDYH.js +1428 -0
- package/dist/cli/admin-YMU55YCU.js +341 -0
- package/dist/cli/adr-XESRMFMP.js +172 -0
- package/dist/cli/agent-TAFPIYUU.js +2404 -0
- package/dist/cli/agent-outputs-HVJJIPS4.js +84 -0
- package/dist/cli/analyze-YQ22QVGW.js +49 -0
- package/dist/cli/archive-W5XX6AH7.js +65 -0
- package/dist/cli/archive-stats-HP2KPAJU.js +101 -0
- package/dist/cli/attention-7JBDCRZX.js +124 -0
- package/dist/cli/attention-ZXZANHKC.js +168 -0
- package/dist/cli/audit-ICA2SEFN.js +122 -0
- package/dist/cli/auth-DXIG5OG7.js +491 -0
- package/dist/cli/backfill-LBSYBWLR.js +156 -0
- package/dist/cli/backup-NUGBZ7NA.js +588 -0
- package/dist/cli/backup-inspect-PDRXI45A.js +26 -0
- package/dist/cli/backup-recover-TVKAPERB.js +29 -0
- package/dist/cli/blockers-ZOPCGHDW.js +55 -0
- package/dist/cli/brain-EJOBKL4A.js +397 -0
- package/dist/cli/briefing-RDQJ6WHS.js +213 -0
- package/dist/cli/caamp-Z3XPKEHB.js +181 -0
- package/dist/cli/cancel-S7EHLCJN.js +85 -0
- package/dist/cli/canon-NPF5RODM.js +142 -0
- package/dist/cli/canon-docs-2GTOLF7Y.js +26 -0
- package/dist/cli/cant-CHNN6O57.js +239 -0
- package/dist/cli/changeset-RYPHPN2B.js +246 -0
- package/dist/cli/check-C67YAU7W.js +759 -0
- package/dist/cli/check-DHMURGHC.js +924 -0
- package/dist/cli/checkpoint-UWDFOGYQ.js +128 -0
- package/dist/cli/chunk-22YPFZYB.js +91 -0
- package/dist/cli/chunk-2MGFDMDF.js +272 -0
- package/dist/cli/chunk-47JYZAMS.js +30 -0
- package/dist/cli/chunk-4JYHPP4C.js +76 -0
- package/dist/cli/chunk-4PEODTHY.js +278 -0
- package/dist/cli/chunk-4RGSNUUP.js +950 -0
- package/dist/cli/chunk-4VASFLUW.js +35 -0
- package/dist/cli/chunk-5PNI276X.js +124 -0
- package/dist/cli/chunk-6JSJNYH2.js +114 -0
- package/dist/cli/chunk-6N6WGLXE.js +63 -0
- package/dist/cli/chunk-75UH3BLS.js +210 -0
- package/dist/cli/chunk-7ACK4EIN.js +92 -0
- package/dist/cli/chunk-7NMKLVMI.js +107 -0
- package/dist/cli/chunk-7SINJXB6.js +110 -0
- package/dist/cli/chunk-7UARFJYS.js +46 -0
- package/dist/cli/chunk-7ZYPQV4N.js +90 -0
- package/dist/cli/chunk-AQCYT3L4.js +72 -0
- package/dist/cli/chunk-BQK6XTOH.js +57 -0
- package/dist/cli/chunk-C3B7C43W.js +16 -0
- package/dist/cli/chunk-CAPAGD5E.js +98 -0
- package/dist/cli/chunk-CHGEDCKG.js +77 -0
- package/dist/cli/chunk-COXFJ3PT.js +74 -0
- package/dist/cli/chunk-D7BAQNV2.js +55 -0
- package/dist/cli/chunk-EIUXVHNF.js +258 -0
- package/dist/cli/chunk-EUGB6P5V.js +173 -0
- package/dist/cli/chunk-EW2CKNNZ.js +304 -0
- package/dist/cli/chunk-FSKN4DWC.js +108 -0
- package/dist/cli/chunk-FVKLULL7.js +48 -0
- package/dist/cli/chunk-GAGUBU4Z.js +280 -0
- package/dist/cli/chunk-GKRFH2YG.js +171 -0
- package/dist/cli/chunk-GRU74UE4.js +270 -0
- package/dist/cli/chunk-GZFVDR44.js +320 -0
- package/dist/cli/chunk-HFLLZE6A.js +83 -0
- package/dist/cli/chunk-HXRXT3XU.js +78 -0
- package/dist/cli/chunk-IIOGUY3B.js +258 -0
- package/dist/cli/chunk-ILWWL462.js +60 -0
- package/dist/cli/chunk-J5USPJKZ.js +48 -0
- package/dist/cli/chunk-KEQS36GD.js +88 -0
- package/dist/cli/chunk-L7ONYSV6.js +2497 -0
- package/dist/cli/chunk-LVGIFMCV.js +163 -0
- package/dist/cli/chunk-NEFMQYLE.js +656 -0
- package/dist/cli/chunk-NU6CQQVB.js +4501 -0
- package/dist/cli/chunk-OILHT47L.js +252 -0
- package/dist/cli/chunk-PKKZPOOP.js +352 -0
- package/dist/cli/chunk-PN4WW5VX.js +66 -0
- package/dist/cli/chunk-PSJ33WVO.js +56 -0
- package/dist/cli/chunk-QA6T2LQ5.js +71 -0
- package/dist/cli/chunk-QJJWWCIC.js +288 -0
- package/dist/cli/chunk-QKMBWYAS.js +93 -0
- package/dist/cli/chunk-QWNKLLLG.js +84 -0
- package/dist/cli/chunk-QWUFFDL3.js +85 -0
- package/dist/cli/chunk-QY76BRUZ.js +35 -0
- package/dist/cli/chunk-R45KVF5Y.js +117 -0
- package/dist/cli/chunk-RRKP7HLU.js +66 -0
- package/dist/cli/chunk-SXXOC6KZ.js +209 -0
- package/dist/cli/chunk-T6GZJYL3.js +108 -0
- package/dist/cli/chunk-TLQ37HRE.js +67 -0
- package/dist/cli/chunk-TPTNEJZJ.js +52 -0
- package/dist/cli/chunk-TYC7G5LF.js +100 -0
- package/dist/cli/chunk-UWCZY52R.js +766 -0
- package/dist/cli/chunk-VB3LDPL5.js +46 -0
- package/dist/cli/chunk-VLEYOOPH.js +31 -0
- package/dist/cli/chunk-W3JLYKKY.js +140 -0
- package/dist/cli/chunk-WWCYZYSN.js +56 -0
- package/dist/cli/chunk-XA5WISNV.js +52 -0
- package/dist/cli/chunk-XHRZ7OYZ.js +132 -0
- package/dist/cli/chunk-XLPMIGJJ.js +148 -0
- package/dist/cli/chunk-YY66LFZF.js +29 -0
- package/dist/cli/chunk-ZMGDZMSJ.js +210 -0
- package/dist/cli/claim-IGOG2QOC.js +97 -0
- package/dist/cli/classify-MG4N7GMQ.js +117 -0
- package/dist/cli/cli-A23Q335V.js +51 -0
- package/dist/cli/cloud-SILYJVKO.js +731 -0
- package/dist/cli/cockpit-RZKLGYPN.js +790 -0
- package/dist/cli/code-H2FQCVMW.js +178 -0
- package/dist/cli/complete-JLX7NBI4.js +35 -0
- package/dist/cli/complexity-OKV7PVZH.js +57 -0
- package/dist/cli/compliance-QMGZHJNQ.js +277 -0
- package/dist/cli/conduit-4H32UYEA.js +308 -0
- package/dist/cli/conduit-EY54WTZA.js +535 -0
- package/dist/cli/config-TDYOC7XO.js +519 -0
- package/dist/cli/consensus-4XCOFPPT.js +122 -0
- package/dist/cli/context-FN4YTGHD.js +142 -0
- package/dist/cli/contribution-7RWFBJLC.js +112 -0
- package/dist/cli/curator-HKZJCVRL.js +139 -0
- package/dist/cli/current-B2NU7V3G.js +43 -0
- package/dist/cli/daemon-GBD4TVCD.js +452 -0
- package/dist/cli/dash-IGDANIE5.js +71 -0
- package/dist/cli/decide-26SXC2V6.js +416 -0
- package/dist/cli/decompose-LQ76TEZG.js +78 -0
- package/dist/cli/decomposition-WFRWNUSJ.js +122 -0
- package/dist/cli/delete-T5DUQHOX.js +69 -0
- package/dist/cli/deps-UTPZJBXL.js +462 -0
- package/dist/cli/detect-FFZSMVDT.js +46 -0
- package/dist/cli/detect-drift-TVCJOFYJ.js +408 -0
- package/dist/cli/diagnostics-GN5CVD3N.js +93 -0
- package/dist/cli/diagnostics-ZNBKH6GX.js +133 -0
- package/dist/cli/docs-CLQKEEUK.js +1710 -0
- package/dist/cli/docs-DPPDFTWR.js +3098 -0
- package/dist/cli/doctor-GPENOP4N.js +1270 -0
- package/dist/cli/doctor-ac-bindings-S3IOEFP4.js +26 -0
- package/dist/cli/doctor-acceptance-drift-VNFKPBSQ.js +26 -0
- package/dist/cli/doctor-credentials-A5H4JMTF.js +26 -0
- package/dist/cli/doctor-db-substrate-FGCISE4Z.js +27 -0
- package/dist/cli/doctor-dep-cycles-BKKKHHYG.js +26 -0
- package/dist/cli/doctor-exodus-ND2DH2KP.js +26 -0
- package/dist/cli/doctor-exodus-residue-4EMRYMEQ.js +26 -0
- package/dist/cli/doctor-fk-check-VY3RIQV3.js +26 -0
- package/dist/cli/doctor-global-delivery-JN6IGHUL.js +26 -0
- package/dist/cli/doctor-heavy-command-hook-XSN44WXU.js +26 -0
- package/dist/cli/doctor-legacy-backups-QAG5NHYP.js +26 -0
- package/dist/cli/doctor-legacy-reaper-CIRGFE6R.js +26 -0
- package/dist/cli/doctor-malformed-ids-WL7HT4TB.js +26 -0
- package/dist/cli/doctor-manifest-rows-SMQCKJ2T.js +26 -0
- package/dist/cli/doctor-memory-guard-LJDOJG76.js +26 -0
- package/dist/cli/doctor-migrations-ETQPFNUP.js +26 -0
- package/dist/cli/doctor-nexus-residency-A4JMKBEJ.js +26 -0
- package/dist/cli/doctor-project-identity-FFQJ5LNX.js +26 -0
- package/dist/cli/doctor-projects-MFUTKRHP.js +30 -0
- package/dist/cli/doctor-projects-registry-76X6VTGM.js +26 -0
- package/dist/cli/doctor-release-readiness-QJCOPFTK.js +26 -0
- package/dist/cli/doctor-repair-AU76FIKY.js +26 -0
- package/dist/cli/doctor-row-identity-KW6JYZQE.js +26 -0
- package/dist/cli/doctor-skill-fixtures-G3T7JUHS.js +26 -0
- package/dist/cli/doctor-split-brain-FUW6L7FS.js +26 -0
- package/dist/cli/doctor-superseded-store-DUHGSBLC.js +26 -0
- package/dist/cli/doctor-sync-journal-SXMUIKF7.js +26 -0
- package/dist/cli/doctor-sync-triggers-6WNJZFRM.js +26 -0
- package/dist/cli/doctor-tool-locks-66LSLUBN.js +26 -0
- package/dist/cli/doctor-twin-collapse-AYBYBFC4.js +26 -0
- package/dist/cli/doctor-worktree-stores-C5XEH5OG.js +26 -0
- package/dist/cli/done-R64XRZ32.js +196 -0
- package/dist/cli/dynamic-RR4HB7BB.js +29 -0
- package/dist/cli/entities-3JIHDIOK.js +361 -0
- package/dist/cli/event-45KEWV5H.js +372 -0
- package/dist/cli/exists-BEDZS5RI.js +65 -0
- package/dist/cli/exodus-DUX62344.js +401 -0
- package/dist/cli/export-C5PQIQ5O.js +93 -0
- package/dist/cli/export-tasks-CUXDZPJB.js +97 -0
- package/dist/cli/federation-ESM35EGG.js +145 -0
- package/dist/cli/find-5EUZHHQJ.js +178 -0
- package/dist/cli/focus-6AH4KLRO.js +368 -0
- package/dist/cli/focus-ANKAIRO5.js +56 -0
- package/dist/cli/gateway-2GW2KTK3.js +77 -0
- package/dist/cli/gateway-auto-start-EDK7XI6E.js +36 -0
- package/dist/cli/gc-CTOQLUSA.js +291 -0
- package/dist/cli/go-YJPNHHYT.js +206 -0
- package/dist/cli/goal-4GW4G77D.js +213 -0
- package/dist/cli/grade-25WSZH4X.js +57 -0
- package/dist/cli/graph-JUO3TMF3.js +879 -0
- package/dist/cli/history-NACNUQTC.js +138 -0
- package/dist/cli/hook-UF7J7R6D.js +57 -0
- package/dist/cli/hook-entry.js +244 -19
- package/dist/cli/hygiene-3QZ2NI7P.js +55 -0
- package/dist/cli/import-7ESGL5SS.js +89 -0
- package/dist/cli/import-tasks-FLE2RPBR.js +109 -0
- package/dist/cli/index.js +601 -94637
- package/dist/cli/init-AN4DZ2XO.js +40 -0
- package/dist/cli/inject-HQWA5GWY.js +83 -0
- package/dist/cli/install-global-YQV4W5OG.js +95 -0
- package/dist/cli/intelligence-OFFNQGHE.js +238 -0
- package/dist/cli/intelligence-QIC4SN4X.js +182 -0
- package/dist/cli/issue-P5RNMRDG.js +159 -0
- package/dist/cli/janitor-ZNCFQ7E3.js +111 -0
- package/dist/cli/labels-ORBM3T57.js +88 -0
- package/dist/cli/lifecycle-MHR22TVI.js +273 -0
- package/dist/cli/list-LB6GCYYU.js +109 -0
- package/dist/cli/llm-H7LZWQKX.js +130 -0
- package/dist/cli/llm-OTJWPMGI.js +704 -0
- package/dist/cli/llm-cost-MLMXEAR4.js +25 -0
- package/dist/cli/llm-stream-AAEUNKRP.js +27 -0
- package/dist/cli/log-W2A5M2NA.js +76 -0
- package/dist/cli/login-SIXFFZSP.js +45 -0
- package/dist/cli/logout-G3KVLQQM.js +74 -0
- package/dist/cli/manifest-G4T6EBSI.js +354 -0
- package/dist/cli/map-VU5M72TK.js +53 -0
- package/dist/cli/memory-2E27G2G5.js +1952 -0
- package/dist/cli/memory-IAEYKXG6.js +1895 -0
- package/dist/cli/migrate-agents-v2-A52QIYNJ.js +33 -0
- package/dist/cli/migrate-claude-mem-TPDW3R4Z.js +206 -0
- package/dist/cli/next-SVH4LIDY.js +57 -0
- package/dist/cli/nexus-FPQV2EAF.js +1059 -0
- package/dist/cli/nexus-XSFXN5E6.js +2924 -0
- package/dist/cli/ops-K6LHY5J6.js +52 -0
- package/dist/cli/orchestrate-CZ2J6W3L.js +1650 -0
- package/dist/cli/orchestrate-HURUCQFT.js +950 -0
- package/dist/cli/otel-JCNPVJLZ.js +188 -0
- package/dist/cli/phase-VDFRASSO.js +221 -0
- package/dist/cli/pipeline-TCZPOEDR.js +697 -0
- package/dist/cli/pivot-V5MSQZ7L.js +88 -0
- package/dist/cli/plan-SQUGCKSM.js +49 -0
- package/dist/cli/playbook-L47GLDQD.js +230 -0
- package/dist/cli/playbook-NJVO4R6P.js +33 -0
- package/dist/cli/project-YZEC7GYF.js +331 -0
- package/dist/cli/promote-FINF4HVK.js +53 -0
- package/dist/cli/provenance-3TUWVBFR.js +141 -0
- package/dist/cli/provenance-YZG33JGM.js +129 -0
- package/dist/cli/provider-23JVLLG3.js +213 -0
- package/dist/cli/reason-FHN54O7O.js +138 -0
- package/dist/cli/reconcile-MOM5T4AX.js +128 -0
- package/dist/cli/refresh-memory-3OSTRAVK.js +45 -0
- package/dist/cli/relates-6FWUFUS2.js +260 -0
- package/dist/cli/release-G2DPSG5M.js +347 -0
- package/dist/cli/release-URX6JHZ2.js +525 -0
- package/dist/cli/remote-VIULU2T5.js +279 -0
- package/dist/cli/renderers-TGSW77J4.js +37 -0
- package/dist/cli/reorder-UIPN6TQY.js +87 -0
- package/dist/cli/reparent-ALOWWUIU.js +59 -0
- package/dist/cli/req-RH2Y3H7A.js +130 -0
- package/dist/cli/research-G2Y72HRC.js +366 -0
- package/dist/cli/restore-VBR5XNML.js +470 -0
- package/dist/cli/revert-32LDNSGP.js +240 -0
- package/dist/cli/roadmap-LFU3AG7D.js +62 -0
- package/dist/cli/run-HXRILSR7.js +245 -0
- package/dist/cli/safestop-Z5UC7NGQ.js +89 -0
- package/dist/cli/saga-Y6FZS6AM.js +286 -0
- package/dist/cli/schema-OOOKLWUE.js +195 -0
- package/dist/cli/self-update-26SOTJMH.js +504 -0
- package/dist/cli/selfimprove-4SMOCLUV.js +89 -0
- package/dist/cli/selfimprove-EB4RQLP4.js +139 -0
- package/dist/cli/sentient-QPETVE53.js +254 -0
- package/dist/cli/sentient-RGMWR4XJ.js +1088 -0
- package/dist/cli/sequence-H7DSAJPF.js +94 -0
- package/dist/cli/service-EK5MGB2D.js +156 -0
- package/dist/cli/service-GLOMZWPQ.js +437 -0
- package/dist/cli/session-HYUXAQGC.js +708 -0
- package/dist/cli/session-N5ISU56W.js +568 -0
- package/dist/cli/setup-L3YYV53D.js +323 -0
- package/dist/cli/show-364V3KY2.js +123 -0
- package/dist/cli/skill-F2KR6HW5.js +84 -0
- package/dist/cli/skills-FS3DCP6E.js +929 -0
- package/dist/cli/smoke-provider-SKUFMZXU.js +218 -0
- package/dist/cli/snapshot-EGXEQ5PR.js +120 -0
- package/dist/cli/src-LYLXHXHH.js +80 -0
- package/dist/cli/start-6DXOCCKL.js +68 -0
- package/dist/cli/stats-UVUQEGYC.js +96 -0
- package/dist/cli/status-XLKYLN42.js +157 -0
- package/dist/cli/sticky-VSTQ2I2O.js +264 -0
- package/dist/cli/sticky-XZXZDCFW.js +339 -0
- package/dist/cli/stop-VNOAFWNB.js +43 -0
- package/dist/cli/sync-YYPARW3A.js +155 -0
- package/dist/cli/tasks-C24KHTFF.js +1118 -0
- package/dist/cli/tasks-LBJC7CZV.js +175 -0
- package/dist/cli/telemetry-CU7W5WAY.js +120 -0
- package/dist/cli/templates-G42JBUY4.js +609 -0
- package/dist/cli/testing-HSRITHEY.js +147 -0
- package/dist/cli/token-J74E7TSU.js +221 -0
- package/dist/cli/tools-BI74W7VE.js +652 -0
- package/dist/cli/transcript-RGK7RSGQ.js +440 -0
- package/dist/cli/tui-BPUFHYKK.js +51 -0
- package/dist/cli/update-2KQWA27S.js +478 -0
- package/dist/cli/update-check-entry.js +124 -0
- package/dist/cli/update-notice-6SQ6WPQG.js +68 -0
- package/dist/cli/upgrade-E2MJAPC7.js +136 -0
- package/dist/cli/upgrade-XRSQ4RWH.js +243 -0
- package/dist/cli/verify-WASRGDBA.js +191 -0
- package/dist/cli/web-NJ3P67EU.js +275 -0
- package/dist/cli/workgraph-OHJ2VKJD.js +232 -0
- package/dist/cli/worktree-FVQLORFY.js +371 -0
- package/dist/cli/worktree-ZJ6JTQNG.js +287 -0
- package/package.json +13 -13
- package/studio-dist/client/_app/immutable/chunks/{DMj27Pxj.js → AH7dIemv.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/{Dc2owyvE.js → BDgH40i3.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/BXDCSJ7U.js +1 -0
- package/studio-dist/client/_app/immutable/chunks/{qq3pe1aT.js → Gg4iYl59.js} +1 -1
- package/studio-dist/client/_app/immutable/entry/{app.CHWXLeE9.js → app.DUDNK-37.js} +2 -2
- package/studio-dist/client/_app/immutable/entry/start.DNmZ0pA4.js +1 -0
- package/studio-dist/client/_app/immutable/nodes/{0.DmKQGvFh.js → 0.DWqP3ail.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{1.DqJk_REO.js → 1.CZGVUP5B.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{15.GUy6kdW1.js → 15.DGaflZRS.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{16.CcnKZ8f9.js → 16.uYlarGXl.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{17.DAlQF3lQ.js → 17.CZMR0E47.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{18.vQFr-vFj.js → 18.CBC-AKH_.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{20.GVOj5j_r.js → 20.BGi43MvQ.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{24.2-wC6DOh.js → 24.Dv8ftCyR.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/25.DQPVlTDQ.js +39 -0
- package/studio-dist/client/_app/immutable/nodes/{26.C3rNqzZF.js → 26.Cl800304.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{3.b-7pzc3M.js → 3.D_fQKj9f.js} +1 -1
- package/studio-dist/client/_app/version.json +1 -1
- package/studio-dist/server/chunks/{0-BaCce-O1.js → 0-BpOagOst.js} +3 -3
- package/studio-dist/server/chunks/1-D0oRGR-C.js +9 -0
- package/studio-dist/server/chunks/{15-DRMOSIC9.js → 15-BcjHz7Tv.js} +3 -3
- package/studio-dist/server/chunks/{16-BulXhoZZ.js → 16-CXm8TUk7.js} +3 -3
- package/studio-dist/server/chunks/{17-DUEOCM0H.js → 17-mSgUK-cp.js} +3 -3
- package/studio-dist/server/chunks/{18-DP7Q8zPs.js → 18-BtfnIw1d.js} +3 -3
- package/studio-dist/server/chunks/{20-9ta6MI7q.js → 20-By1e4QDS.js} +3 -3
- package/studio-dist/server/chunks/{24-DysdL1ab.js → 24-0i2YLVxG.js} +3 -3
- package/studio-dist/server/chunks/{dist-CdoCt9zT.js → 25-DPsrqbrh.js} +797 -10736
- package/studio-dist/server/chunks/{26-Df4YXgg0.js → 26-P0XkOibm.js} +3 -3
- package/studio-dist/server/chunks/{3-BEhOhYpL.js → 3-WudjUK7e.js} +3 -3
- package/studio-dist/server/chunks/{_layout.svelte-CnLcXYG-.js → _layout.svelte-D9m81Rle.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-DGhXqeRc.js → _page.svelte-2PDLOF83.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-Dv8tmDEC.js → _page.svelte-BjE3jm2K.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-C0qgUvzA.js → _page.svelte-Clc0vmiZ.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-ui7LnWkL.js → _page.svelte-DABdRT3h.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-HUqTICJR.js → _page.svelte-DG3PjiHj.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-DzcZljiy.js → _page.svelte-Edy9CaE8.js} +20 -7
- package/studio-dist/server/chunks/{_page.svelte-DOl0DGOO.js → _page.svelte-Hrf3-ZR8.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-Da4q5l93.js → _page.svelte-VB4O4Nl5.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-CbyEPj2j.js → _page.svelte-d3jEgjsI.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-P4wVVksg.js → _server.ts-BcRFsyo3.js} +4 -5
- package/studio-dist/server/chunks/{_server.ts-Cr57EKWf.js → _server.ts-CEWpIFrj.js} +6 -5
- package/studio-dist/server/chunks/{_server.ts-CnKVmf_s.js → _server.ts-CLVdVIF9.js} +2 -2
- package/studio-dist/server/chunks/{_server.ts-C0evMKCk.js → _server.ts-D_j7aSy5.js} +6 -5
- package/studio-dist/server/chunks/{_server.ts-2BazvYRP.js → _server.ts-QEZF8h2q.js} +4 -5
- package/studio-dist/server/chunks/{client-CPM4LrO2.js → client-Kp1dP1od.js} +2 -2
- package/studio-dist/server/chunks/{error.svelte-ShcZo43D.js → error.svelte-WOCioJVX.js} +3 -3
- package/studio-dist/server/chunks/{hooks.server-D2qbf3Zp.js → hooks.server-DH9zkIrJ.js} +3 -1
- package/studio-dist/server/chunks/{http-BiQjEmVU.js → http-DT5kxaWk.js} +5 -4
- package/studio-dist/server/chunks/{internal-Cgsrya1j.js → internal-z0vqd5_u.js} +3 -3
- package/studio-dist/server/chunks/operations-registry-DdzmYzqX.js +10584 -0
- package/studio-dist/server/chunks/{stores-BGrpEDMK.js → stores-s2kaL315.js} +2 -2
- package/studio-dist/server/index.js +1 -1
- package/studio-dist/server/manifest.js +17 -17
- package/studio-dist/client/_app/immutable/chunks/Bw6J8NDM.js +0 -1
- package/studio-dist/client/_app/immutable/entry/start.C9bwPpvc.js +0 -1
- package/studio-dist/client/_app/immutable/nodes/25.D1vYaH8g.js +0 -39
- package/studio-dist/server/chunks/1-CVo7Nk6d.js +0 -9
- package/studio-dist/server/chunks/25-CYsps38R.js +0 -366
|
@@ -0,0 +1,470 @@
|
|
|
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
|
+
dispatchRaw
|
|
18
|
+
} from "./chunk-L7ONYSV6.js";
|
|
19
|
+
import {
|
|
20
|
+
CLEO_DIR_NAME,
|
|
21
|
+
RESTORE_CONFLICTS_MD,
|
|
22
|
+
RESTORE_DEFAULT_FILE
|
|
23
|
+
} from "./chunk-6N6WGLXE.js";
|
|
24
|
+
import "./chunk-4VASFLUW.js";
|
|
25
|
+
import {
|
|
26
|
+
defineCommand,
|
|
27
|
+
showUsage
|
|
28
|
+
} from "./chunk-PKKZPOOP.js";
|
|
29
|
+
import "./chunk-QKMBWYAS.js";
|
|
30
|
+
import {
|
|
31
|
+
cliError,
|
|
32
|
+
cliOutput,
|
|
33
|
+
humanLine
|
|
34
|
+
} from "./chunk-4RGSNUUP.js";
|
|
35
|
+
import "./chunk-6JSJNYH2.js";
|
|
36
|
+
import "./chunk-D7BAQNV2.js";
|
|
37
|
+
import "./chunk-TYC7G5LF.js";
|
|
38
|
+
|
|
39
|
+
// packages/cleo/src/cli/commands/restore.ts
|
|
40
|
+
import fs from "node:fs";
|
|
41
|
+
import path from "node:path";
|
|
42
|
+
import { ExitCode } from "@cleocode/contracts/exit-codes.js";
|
|
43
|
+
import {
|
|
44
|
+
CleoError,
|
|
45
|
+
getProjectRoot,
|
|
46
|
+
getTaskAccessor,
|
|
47
|
+
parseConflictReport,
|
|
48
|
+
setAtPath
|
|
49
|
+
} from "@cleocode/core";
|
|
50
|
+
import { parseConflictReport as parseConflictReport2 } from "@cleocode/core";
|
|
51
|
+
var finalizeCommand = defineCommand({
|
|
52
|
+
meta: {
|
|
53
|
+
name: "finalize",
|
|
54
|
+
description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
|
|
55
|
+
},
|
|
56
|
+
async run() {
|
|
57
|
+
const projectRoot = getProjectRoot();
|
|
58
|
+
const reportPath = path.join(projectRoot, CLEO_DIR_NAME, RESTORE_CONFLICTS_MD);
|
|
59
|
+
if (!fs.existsSync(reportPath)) {
|
|
60
|
+
humanLine("No pending restore conflicts. Nothing to finalize.");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const content = fs.readFileSync(reportPath, "utf-8");
|
|
64
|
+
const allResolutions = parseConflictReport(content);
|
|
65
|
+
const pending = allResolutions.filter(
|
|
66
|
+
(r) => r.section === "manual" && (r.resolution === "A" || r.resolution === "B")
|
|
67
|
+
);
|
|
68
|
+
if (pending.length === 0) {
|
|
69
|
+
const stillPending = allResolutions.filter(
|
|
70
|
+
(r) => r.section === "manual" && r.resolution === "manual-review"
|
|
71
|
+
);
|
|
72
|
+
if (stillPending.length > 0) {
|
|
73
|
+
humanLine(
|
|
74
|
+
"No manual resolutions found in .cleo/restore-conflicts.md.\nEdit the file to mark resolutions, then re-run 'cleo restore finalize'."
|
|
75
|
+
);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const timestamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
79
|
+
const archivePath2 = path.join(
|
|
80
|
+
projectRoot,
|
|
81
|
+
".cleo",
|
|
82
|
+
`restore-conflicts-${timestamp2}.md.finalized`
|
|
83
|
+
);
|
|
84
|
+
fs.renameSync(reportPath, archivePath2);
|
|
85
|
+
cliOutput(
|
|
86
|
+
{ applied: 0, archivedTo: archivePath2 },
|
|
87
|
+
{ command: "restore", message: "No pending resolutions", operation: "restore.finalize" }
|
|
88
|
+
);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const byFile = /* @__PURE__ */ new Map();
|
|
92
|
+
for (const r of pending) {
|
|
93
|
+
const existing = byFile.get(r.filename);
|
|
94
|
+
if (existing) {
|
|
95
|
+
existing.push(r);
|
|
96
|
+
} else {
|
|
97
|
+
byFile.set(r.filename, [r]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
let applied = 0;
|
|
101
|
+
for (const [filename, resolutions] of byFile) {
|
|
102
|
+
const filePath = path.join(projectRoot, CLEO_DIR_NAME, filename);
|
|
103
|
+
if (!fs.existsSync(filePath)) continue;
|
|
104
|
+
const raw = fs.readFileSync(filePath, "utf-8");
|
|
105
|
+
const obj = JSON.parse(raw);
|
|
106
|
+
for (const r of resolutions) {
|
|
107
|
+
const value = r.resolution === "A" ? r.localValue : r.importedValue;
|
|
108
|
+
setAtPath(obj, r.fieldPath, value);
|
|
109
|
+
applied++;
|
|
110
|
+
}
|
|
111
|
+
fs.writeFileSync(filePath, JSON.stringify(obj, null, 2));
|
|
112
|
+
}
|
|
113
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
114
|
+
const archivePath = path.join(
|
|
115
|
+
projectRoot,
|
|
116
|
+
CLEO_DIR_NAME,
|
|
117
|
+
`restore-conflicts-${timestamp}.md.finalized`
|
|
118
|
+
);
|
|
119
|
+
fs.renameSync(reportPath, archivePath);
|
|
120
|
+
cliOutput(
|
|
121
|
+
{ applied, archivedTo: archivePath },
|
|
122
|
+
{
|
|
123
|
+
command: "restore",
|
|
124
|
+
message: `Finalized ${applied} conflict resolutions. Conflict report archived.`,
|
|
125
|
+
operation: "restore.finalize"
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
var STORE_FILE_LABELS = /* @__PURE__ */ new Set(["tasks.db", "brain.db", "cleo.db"]);
|
|
131
|
+
var backupSubCommand = defineCommand({
|
|
132
|
+
meta: {
|
|
133
|
+
name: "backup",
|
|
134
|
+
description: "Restore the project store (.cleo/cleo.db: tasks and brain) from a named snapshot (--snapshot) or a backup id (--id): the snapshot is verified, live writers refuse it, and the replaced store is kept as a pre-restore backup. --file config.json restores a config file."
|
|
135
|
+
},
|
|
136
|
+
args: {
|
|
137
|
+
snapshot: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "A snapshot file of this project's store under .cleo/backups/ (e.g. cleo-identity-refill-*.db, tasks-*.db)"
|
|
140
|
+
},
|
|
141
|
+
id: {
|
|
142
|
+
type: "string",
|
|
143
|
+
description: "A backup id from `cleo backup list` (its store file is restored)"
|
|
144
|
+
},
|
|
145
|
+
"allow-external": {
|
|
146
|
+
type: "boolean",
|
|
147
|
+
description: "With --snapshot: accept a file outside this project's .cleo/backups/",
|
|
148
|
+
default: false
|
|
149
|
+
},
|
|
150
|
+
file: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Config file to restore from the newest numbered backup (config.json). The store restores only through --snapshot or --id"
|
|
153
|
+
},
|
|
154
|
+
"dry-run": {
|
|
155
|
+
type: "boolean",
|
|
156
|
+
description: "Preview what would be restored",
|
|
157
|
+
default: false
|
|
158
|
+
},
|
|
159
|
+
scope: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "With --snapshot/--id: project (.cleo/cleo.db, the default) or global (<CLEO_HOME>/cleo.db: the global brain, nexus, agent registry). A global restore needs every cleo process stopped (agent sessions, daemons, Studio): nearly all of them hold the global store open",
|
|
162
|
+
default: "project"
|
|
163
|
+
},
|
|
164
|
+
"confirm-owner-store": {
|
|
165
|
+
type: "boolean",
|
|
166
|
+
description: "From inside a git worktree: allow overwriting the owning project's LIVE store (refused without it)",
|
|
167
|
+
default: false
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
async run({ args }) {
|
|
171
|
+
try {
|
|
172
|
+
if (args.snapshot !== void 0 || args.id !== void 0) {
|
|
173
|
+
const { restoreStoreSnapshot } = await import("@cleocode/core/store/restore-store.js");
|
|
174
|
+
const scope2 = args.scope === "global" ? "global" : "project";
|
|
175
|
+
const result = await restoreStoreSnapshot({
|
|
176
|
+
scope: scope2,
|
|
177
|
+
projectRoot: scope2 === "global" ? process.cwd() : getProjectRoot(),
|
|
178
|
+
snapshot: args.snapshot,
|
|
179
|
+
backupId: args.id,
|
|
180
|
+
dryRun: args["dry-run"] === true,
|
|
181
|
+
allowExternal: args["allow-external"] === true,
|
|
182
|
+
confirmOwnerStore: args["confirm-owner-store"] === true,
|
|
183
|
+
cwd: process.cwd()
|
|
184
|
+
});
|
|
185
|
+
cliOutput(result, {
|
|
186
|
+
command: "restore",
|
|
187
|
+
operation: "admin.backup.restore-store",
|
|
188
|
+
...result.dryRun ? { message: "Dry run - no changes made" } : {}
|
|
189
|
+
});
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const fileName = args.file ?? RESTORE_DEFAULT_FILE;
|
|
193
|
+
const scope = args.scope ?? "project";
|
|
194
|
+
if (STORE_FILE_LABELS.has(fileName)) {
|
|
195
|
+
throw new CleoError(
|
|
196
|
+
ExitCode.INVALID_INPUT,
|
|
197
|
+
`E_RESTORE_STORE_LABEL: --file ${fileName} cannot restore the live store (.cleo/cleo.db holds tasks and brain)`,
|
|
198
|
+
{
|
|
199
|
+
fix: "cleo backup list, then cleo restore backup --id <backupId> (or --snapshot <file>)"
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
const response = await dispatchRaw("mutate", "admin", "backup", {
|
|
204
|
+
action: "restore.file",
|
|
205
|
+
file: fileName,
|
|
206
|
+
dryRun: args["dry-run"] || void 0,
|
|
207
|
+
scope,
|
|
208
|
+
confirmOwnerStore: args["confirm-owner-store"] || void 0
|
|
209
|
+
});
|
|
210
|
+
if (!response.success) {
|
|
211
|
+
const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
|
|
212
|
+
throw new CleoError(code, response.error?.message ?? "Backup restore failed");
|
|
213
|
+
}
|
|
214
|
+
const data = response.data;
|
|
215
|
+
if (args["dry-run"]) {
|
|
216
|
+
cliOutput(
|
|
217
|
+
{
|
|
218
|
+
dryRun: true,
|
|
219
|
+
file: fileName,
|
|
220
|
+
wouldRestore: data?.from,
|
|
221
|
+
targetPath: data?.targetPath
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
command: "restore",
|
|
225
|
+
message: "Dry run - no changes made",
|
|
226
|
+
operation: "admin.backup.restore"
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
cliOutput(
|
|
232
|
+
{
|
|
233
|
+
restored: true,
|
|
234
|
+
file: fileName,
|
|
235
|
+
restoredFrom: data?.from,
|
|
236
|
+
targetPath: data?.targetPath
|
|
237
|
+
},
|
|
238
|
+
{ command: "restore", operation: "admin.backup.restore" }
|
|
239
|
+
);
|
|
240
|
+
} catch (err) {
|
|
241
|
+
if (err instanceof CleoError) {
|
|
242
|
+
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
243
|
+
process.exit(err.code);
|
|
244
|
+
}
|
|
245
|
+
throw err;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
var taskSubCommand = defineCommand({
|
|
250
|
+
meta: {
|
|
251
|
+
name: "task",
|
|
252
|
+
description: "Restore task from terminal state (archived, cancelled, or completed) back to active"
|
|
253
|
+
},
|
|
254
|
+
args: {
|
|
255
|
+
taskId: {
|
|
256
|
+
type: "positional",
|
|
257
|
+
description: "Task ID to restore",
|
|
258
|
+
required: true
|
|
259
|
+
},
|
|
260
|
+
status: {
|
|
261
|
+
type: "string",
|
|
262
|
+
description: "Status to restore task as (default: pending)",
|
|
263
|
+
default: "pending"
|
|
264
|
+
},
|
|
265
|
+
"preserve-status": {
|
|
266
|
+
type: "boolean",
|
|
267
|
+
description: "Keep the original task status",
|
|
268
|
+
default: false
|
|
269
|
+
},
|
|
270
|
+
reason: {
|
|
271
|
+
type: "string",
|
|
272
|
+
description: "Reason for restoring/reopening the task"
|
|
273
|
+
},
|
|
274
|
+
"dry-run": {
|
|
275
|
+
type: "boolean",
|
|
276
|
+
description: "Preview changes without applying",
|
|
277
|
+
default: false
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
async run({ args }) {
|
|
281
|
+
try {
|
|
282
|
+
const taskId = args.taskId;
|
|
283
|
+
const idPattern = /^T\d{3,}$/;
|
|
284
|
+
if (!idPattern.test(taskId)) {
|
|
285
|
+
throw new CleoError(ExitCode.INVALID_INPUT, `Invalid task ID: ${taskId}`);
|
|
286
|
+
}
|
|
287
|
+
const accessor = await getTaskAccessor();
|
|
288
|
+
const activeTask = await accessor.loadSingleTask(taskId);
|
|
289
|
+
if (activeTask) {
|
|
290
|
+
if (activeTask.status === "cancelled") {
|
|
291
|
+
if (args["dry-run"]) {
|
|
292
|
+
cliOutput(
|
|
293
|
+
{
|
|
294
|
+
dryRun: true,
|
|
295
|
+
taskId,
|
|
296
|
+
title: activeTask.title,
|
|
297
|
+
previousStatus: activeTask.status,
|
|
298
|
+
newStatus: args["preserve-status"] ? activeTask.status : args.status,
|
|
299
|
+
source: "active-tasks"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
command: "restore",
|
|
303
|
+
message: "Dry run - no changes made",
|
|
304
|
+
operation: "tasks.restore"
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const response = await dispatchRaw("mutate", "tasks", "restore", { taskId });
|
|
310
|
+
if (!response.success) {
|
|
311
|
+
const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
|
|
312
|
+
throw new CleoError(code, response.error?.message ?? "Task restore failed");
|
|
313
|
+
}
|
|
314
|
+
const resultData = response.data;
|
|
315
|
+
cliOutput(
|
|
316
|
+
{
|
|
317
|
+
restored: true,
|
|
318
|
+
taskId: resultData?.task,
|
|
319
|
+
count: resultData?.count,
|
|
320
|
+
source: "active-tasks"
|
|
321
|
+
},
|
|
322
|
+
{ command: "restore", operation: "tasks.restore" }
|
|
323
|
+
);
|
|
324
|
+
return;
|
|
325
|
+
} else if (activeTask.status === "done") {
|
|
326
|
+
if (args["dry-run"]) {
|
|
327
|
+
const newStatus = args["preserve-status"] ? activeTask.status : args.status;
|
|
328
|
+
cliOutput(
|
|
329
|
+
{
|
|
330
|
+
dryRun: true,
|
|
331
|
+
taskId,
|
|
332
|
+
title: activeTask.title,
|
|
333
|
+
previousStatus: activeTask.status,
|
|
334
|
+
newStatus,
|
|
335
|
+
source: "active-tasks"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
command: "restore",
|
|
339
|
+
message: "Dry run - no changes made",
|
|
340
|
+
operation: "tasks.restore"
|
|
341
|
+
}
|
|
342
|
+
);
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
const targetStatus = args["preserve-status"] ? void 0 : args.status;
|
|
346
|
+
const response = await dispatchRaw("mutate", "tasks", "restore", {
|
|
347
|
+
taskId,
|
|
348
|
+
from: "done",
|
|
349
|
+
status: targetStatus,
|
|
350
|
+
reason: args.reason
|
|
351
|
+
});
|
|
352
|
+
if (!response.success) {
|
|
353
|
+
const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
|
|
354
|
+
throw new CleoError(code, response.error?.message ?? "Task restore failed");
|
|
355
|
+
}
|
|
356
|
+
const resultData = response.data;
|
|
357
|
+
cliOutput(
|
|
358
|
+
{
|
|
359
|
+
restored: true,
|
|
360
|
+
taskId: resultData?.task,
|
|
361
|
+
previousStatus: resultData?.previousStatus,
|
|
362
|
+
newStatus: resultData?.newStatus,
|
|
363
|
+
source: "active-tasks"
|
|
364
|
+
},
|
|
365
|
+
{ command: "restore", operation: "tasks.restore" }
|
|
366
|
+
);
|
|
367
|
+
return;
|
|
368
|
+
} else {
|
|
369
|
+
throw new CleoError(
|
|
370
|
+
ExitCode.VALIDATION_ERROR,
|
|
371
|
+
`Task ${taskId} is already active with status: ${activeTask.status}`
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (args["dry-run"]) {
|
|
376
|
+
const archiveData = await accessor.loadArchive();
|
|
377
|
+
if (archiveData) {
|
|
378
|
+
const archivedTasks = archiveData.archivedTasks;
|
|
379
|
+
if (Array.isArray(archivedTasks)) {
|
|
380
|
+
const task = archivedTasks.find((t) => t.id === taskId);
|
|
381
|
+
if (task) {
|
|
382
|
+
cliOutput(
|
|
383
|
+
{
|
|
384
|
+
dryRun: true,
|
|
385
|
+
taskId,
|
|
386
|
+
title: task.title,
|
|
387
|
+
previousStatus: task.status,
|
|
388
|
+
newStatus: args["preserve-status"] ? task.status : args.status,
|
|
389
|
+
source: "archive"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
command: "restore",
|
|
393
|
+
message: "Dry run - no changes made",
|
|
394
|
+
operation: "tasks.restore"
|
|
395
|
+
}
|
|
396
|
+
);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
throw new CleoError(
|
|
402
|
+
ExitCode.NOT_FOUND,
|
|
403
|
+
`Task ${taskId} not found in active tasks or archive`,
|
|
404
|
+
{
|
|
405
|
+
fix: `cleo find "${taskId}" to search for the task`
|
|
406
|
+
}
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
try {
|
|
410
|
+
const targetStatus = args["preserve-status"] ? void 0 : args.status;
|
|
411
|
+
const response = await dispatchRaw("mutate", "tasks", "restore", {
|
|
412
|
+
taskId,
|
|
413
|
+
from: "archive",
|
|
414
|
+
status: targetStatus,
|
|
415
|
+
preserveStatus: !!args["preserve-status"]
|
|
416
|
+
});
|
|
417
|
+
if (!response.success) {
|
|
418
|
+
const code = ExitCode[response.error?.code] ?? ExitCode.GENERAL_ERROR;
|
|
419
|
+
throw new CleoError(code, response.error?.message ?? "Task unarchive failed");
|
|
420
|
+
}
|
|
421
|
+
const resultData = response.data;
|
|
422
|
+
cliOutput(
|
|
423
|
+
{
|
|
424
|
+
restored: true,
|
|
425
|
+
taskId: resultData?.task,
|
|
426
|
+
title: resultData?.title,
|
|
427
|
+
newStatus: resultData?.status,
|
|
428
|
+
source: "archive"
|
|
429
|
+
},
|
|
430
|
+
{ command: "restore", operation: "tasks.restore" }
|
|
431
|
+
);
|
|
432
|
+
} catch {
|
|
433
|
+
throw new CleoError(
|
|
434
|
+
ExitCode.NOT_FOUND,
|
|
435
|
+
`Task ${taskId} not found in active tasks or archive`,
|
|
436
|
+
{
|
|
437
|
+
fix: `cleo find "${taskId}" to search for the task`
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
} catch (err) {
|
|
442
|
+
if (err instanceof CleoError) {
|
|
443
|
+
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
444
|
+
process.exit(err.code);
|
|
445
|
+
}
|
|
446
|
+
throw err;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
var restoreCommand = defineCommand({
|
|
451
|
+
meta: {
|
|
452
|
+
name: "restore",
|
|
453
|
+
description: "Restore from backup or restore tasks from terminal states (archived, cancelled, completed)"
|
|
454
|
+
},
|
|
455
|
+
subCommands: {
|
|
456
|
+
finalize: finalizeCommand,
|
|
457
|
+
backup: backupSubCommand,
|
|
458
|
+
task: taskSubCommand
|
|
459
|
+
},
|
|
460
|
+
async run({ cmd, rawArgs }) {
|
|
461
|
+
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
462
|
+
if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
|
|
463
|
+
await showUsage(cmd);
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
export {
|
|
467
|
+
parseConflictReport2 as parseConflictReport,
|
|
468
|
+
restoreCommand
|
|
469
|
+
};
|
|
470
|
+
//# sourceMappingURL=restore-VBR5XNML.js.map
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
|
|
3
|
+
if (globalThis[_installed]) return;
|
|
4
|
+
globalThis[_installed] = true;
|
|
5
|
+
const _origEmitWarning = process.emitWarning;
|
|
6
|
+
process.emitWarning = function(warning, type, code, ctor) {
|
|
7
|
+
if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (typeof warning === 'string' && /SQLite is an experimental feature/i.test(warning)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
return _origEmitWarning.call(process, warning, type, code, ctor);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import {
|
|
17
|
+
defineCommand
|
|
18
|
+
} from "./chunk-PKKZPOOP.js";
|
|
19
|
+
import {
|
|
20
|
+
cliError,
|
|
21
|
+
cliOutput
|
|
22
|
+
} from "./chunk-4RGSNUUP.js";
|
|
23
|
+
import "./chunk-6JSJNYH2.js";
|
|
24
|
+
|
|
25
|
+
// packages/cleo/src/cli/commands/revert.ts
|
|
26
|
+
import { readFile } from "node:fs/promises";
|
|
27
|
+
import { join } from "node:path";
|
|
28
|
+
import { cwd as processCwd } from "node:process";
|
|
29
|
+
import { E_RECEIPT_NOT_FOUND } from "@cleocode/core/sentient/chain-walker.js";
|
|
30
|
+
import { SENTIENT_STATE_FILE } from "@cleocode/core/sentient/daemon.js";
|
|
31
|
+
import { loadSigningIdentity } from "@cleocode/core/sentient/kms.js";
|
|
32
|
+
import { executeSquashedRevert } from "@cleocode/core/sentient/revert-executor.js";
|
|
33
|
+
import { collectMergeCommits } from "@cleocode/core/sentient/revert-walker.js";
|
|
34
|
+
import {
|
|
35
|
+
E_OWNER_ATTESTATION_REQUIRED,
|
|
36
|
+
readSentientState
|
|
37
|
+
} from "@cleocode/core/sentient/state.js";
|
|
38
|
+
var OWNER_PUBKEYS_FILE = ".cleo/owner-pubkeys.json";
|
|
39
|
+
function resolveProjectRoot(arg) {
|
|
40
|
+
return arg && arg.length > 0 ? arg : processCwd();
|
|
41
|
+
}
|
|
42
|
+
function emitSuccess(payload, _jsonMode, _humanLine) {
|
|
43
|
+
cliOutput(payload, { command: "revert", operation: "revert.execute" });
|
|
44
|
+
}
|
|
45
|
+
function emitFailure(code, message, _jsonMode) {
|
|
46
|
+
cliError(message, 1, { name: code });
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
async function loadOwnerAttestation(attestationFilePath) {
|
|
50
|
+
let raw;
|
|
51
|
+
if (attestationFilePath) {
|
|
52
|
+
try {
|
|
53
|
+
raw = await readFile(attestationFilePath, "utf-8");
|
|
54
|
+
} catch (err) {
|
|
55
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
56
|
+
throw new Error(`Failed to read attestation file "${attestationFilePath}": ${message}`);
|
|
57
|
+
}
|
|
58
|
+
} else if (process.env["CLEO_OWNER_ATTESTATION"]) {
|
|
59
|
+
raw = process.env["CLEO_OWNER_ATTESTATION"];
|
|
60
|
+
}
|
|
61
|
+
if (!raw) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
'Owner attestation is required. Provide one of:\n --attestation-file <path> path to a JSON attestation file\n CLEO_OWNER_ATTESTATION JSON string in environment variable\n\nAttestation format:\n { "afterRevertReceiptId": "<receiptId>",\n "issuedAt": "<ISO-8601>",\n "ownerPubkey": "<hex-64>",\n "sig": "<ed25519-hex-128>" }'
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
let parsed;
|
|
67
|
+
try {
|
|
68
|
+
parsed = JSON.parse(raw);
|
|
69
|
+
} catch {
|
|
70
|
+
throw new Error("Owner attestation is not valid JSON");
|
|
71
|
+
}
|
|
72
|
+
const obj = parsed;
|
|
73
|
+
if (typeof obj["afterRevertReceiptId"] !== "string" || typeof obj["issuedAt"] !== "string" || typeof obj["ownerPubkey"] !== "string" || typeof obj["sig"] !== "string") {
|
|
74
|
+
throw new Error(
|
|
75
|
+
"Owner attestation is missing required fields: afterRevertReceiptId, issuedAt, ownerPubkey, sig"
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return obj;
|
|
79
|
+
}
|
|
80
|
+
async function loadOwnerPubkeys(projectRoot) {
|
|
81
|
+
const path = join(projectRoot, OWNER_PUBKEYS_FILE);
|
|
82
|
+
try {
|
|
83
|
+
const raw = await readFile(path, "utf-8");
|
|
84
|
+
const parsed = JSON.parse(raw);
|
|
85
|
+
if (Array.isArray(parsed)) {
|
|
86
|
+
return new Set(parsed.filter((k) => typeof k === "string"));
|
|
87
|
+
}
|
|
88
|
+
return /* @__PURE__ */ new Set();
|
|
89
|
+
} catch {
|
|
90
|
+
return /* @__PURE__ */ new Set();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
var revertCommand = defineCommand({
|
|
94
|
+
meta: {
|
|
95
|
+
name: "revert",
|
|
96
|
+
description: "Owner kill-switch: squash-revert all sentient merge commits from a receipt ID"
|
|
97
|
+
},
|
|
98
|
+
args: {
|
|
99
|
+
from: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Receipt ID to revert from (inclusive)"
|
|
102
|
+
},
|
|
103
|
+
"attestation-file": {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "Path to owner attestation JSON file (alternatively set CLEO_OWNER_ATTESTATION env var)"
|
|
106
|
+
},
|
|
107
|
+
"include-human": {
|
|
108
|
+
type: "boolean",
|
|
109
|
+
description: "Allow reverting commits not authored by the sentient agent"
|
|
110
|
+
},
|
|
111
|
+
"dry-run": {
|
|
112
|
+
type: "boolean",
|
|
113
|
+
description: "Print commits that would be reverted without executing"
|
|
114
|
+
},
|
|
115
|
+
json: {
|
|
116
|
+
type: "boolean",
|
|
117
|
+
description: "Emit LAFS JSON envelope"
|
|
118
|
+
},
|
|
119
|
+
project: {
|
|
120
|
+
type: "string",
|
|
121
|
+
description: "Project root (defaults to process cwd)"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
async run({ args }) {
|
|
125
|
+
const projectRoot = resolveProjectRoot(args.project);
|
|
126
|
+
const jsonMode = args.json === true;
|
|
127
|
+
const dryRun = args["dry-run"] === true;
|
|
128
|
+
const includeHuman = args["include-human"] === true;
|
|
129
|
+
const fromReceiptId = args.from;
|
|
130
|
+
const attestationFile = args["attestation-file"];
|
|
131
|
+
if (!fromReceiptId) {
|
|
132
|
+
emitFailure(
|
|
133
|
+
"E_MISSING_FLAG",
|
|
134
|
+
"--from <receiptId> is required. Usage: cleo revert --from <receiptId>",
|
|
135
|
+
jsonMode
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
let attestation;
|
|
139
|
+
if (!dryRun) {
|
|
140
|
+
try {
|
|
141
|
+
attestation = await loadOwnerAttestation(attestationFile);
|
|
142
|
+
} catch (err) {
|
|
143
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
144
|
+
emitFailure(E_OWNER_ATTESTATION_REQUIRED, message, jsonMode);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (attestation && attestation.afterRevertReceiptId !== fromReceiptId) {
|
|
148
|
+
emitFailure(
|
|
149
|
+
E_OWNER_ATTESTATION_REQUIRED,
|
|
150
|
+
`attestation.afterRevertReceiptId "${attestation.afterRevertReceiptId}" does not match --from "${fromReceiptId}"`,
|
|
151
|
+
jsonMode
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
const allowedPubkeys = await loadOwnerPubkeys(projectRoot);
|
|
155
|
+
if (attestation && allowedPubkeys.size > 0 && !allowedPubkeys.has(attestation.ownerPubkey)) {
|
|
156
|
+
emitFailure(
|
|
157
|
+
E_OWNER_ATTESTATION_REQUIRED,
|
|
158
|
+
`Attestation pubkey "${attestation.ownerPubkey}" is not in the owner allowlist at ${join(projectRoot, OWNER_PUBKEYS_FILE)}`,
|
|
159
|
+
jsonMode
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
let commits;
|
|
163
|
+
let mergeEvents;
|
|
164
|
+
try {
|
|
165
|
+
const result = await collectMergeCommits(projectRoot, fromReceiptId);
|
|
166
|
+
commits = result.commits;
|
|
167
|
+
mergeEvents = result.events;
|
|
168
|
+
} catch (err) {
|
|
169
|
+
const errCode = err.code === E_RECEIPT_NOT_FOUND ? E_RECEIPT_NOT_FOUND : "E_CHAIN_WALK_FAILED";
|
|
170
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
171
|
+
emitFailure(errCode, message, jsonMode);
|
|
172
|
+
}
|
|
173
|
+
if (commits.length === 0) {
|
|
174
|
+
emitSuccess(
|
|
175
|
+
{
|
|
176
|
+
receiptId: fromReceiptId,
|
|
177
|
+
commits: [],
|
|
178
|
+
message: "No merge commits found starting from this receipt \u2014 nothing to revert"
|
|
179
|
+
},
|
|
180
|
+
jsonMode,
|
|
181
|
+
`No merge commits found starting from receipt ${fromReceiptId}. Nothing to revert.`
|
|
182
|
+
);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (dryRun) {
|
|
186
|
+
const lines = commits.map((sha, i) => ` [${i + 1}] ${sha}`).join("\n");
|
|
187
|
+
emitSuccess(
|
|
188
|
+
{ dryRun: true, fromReceiptId, commits, count: commits.length },
|
|
189
|
+
jsonMode,
|
|
190
|
+
`Dry-run: would revert ${commits.length} commit(s) from ${fromReceiptId}:
|
|
191
|
+
${lines}`
|
|
192
|
+
);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
let identity;
|
|
196
|
+
try {
|
|
197
|
+
identity = await loadSigningIdentity(projectRoot);
|
|
198
|
+
} catch (err) {
|
|
199
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
200
|
+
emitFailure("E_KMS_LOAD", message, jsonMode);
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
const result = await executeSquashedRevert({
|
|
204
|
+
cleoRoot: projectRoot,
|
|
205
|
+
commits,
|
|
206
|
+
mergeEvents,
|
|
207
|
+
fromReceiptId,
|
|
208
|
+
identity,
|
|
209
|
+
includeHuman
|
|
210
|
+
});
|
|
211
|
+
const statePath = join(projectRoot, SENTIENT_STATE_FILE);
|
|
212
|
+
const state = await readSentientState(statePath);
|
|
213
|
+
emitSuccess(
|
|
214
|
+
{
|
|
215
|
+
revertCommitSha: result.revertCommitSha,
|
|
216
|
+
revertedRange: result.revertedRange,
|
|
217
|
+
eventsReverted: mergeEvents.length,
|
|
218
|
+
revertEventReceiptId: result.revertEventReceiptId,
|
|
219
|
+
humanCommitPresent: result.humanCommitPresent,
|
|
220
|
+
globalPauseSet: true,
|
|
221
|
+
pausedByRevert: state.pausedByRevert
|
|
222
|
+
},
|
|
223
|
+
jsonMode,
|
|
224
|
+
`Revert complete.
|
|
225
|
+
Reverted: ${result.revertedRange.length} commit(s)
|
|
226
|
+
Squash commit: ${result.revertCommitSha}
|
|
227
|
+
Revert event: ${result.revertEventReceiptId}
|
|
228
|
+
Global pause: ACTIVE (run 'cleo sentient resume' with owner attestation to clear)`
|
|
229
|
+
);
|
|
230
|
+
} catch (err) {
|
|
231
|
+
const errCode = err.code ?? "E_REVERT_FAILED";
|
|
232
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
233
|
+
emitFailure(errCode, message, jsonMode);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
export {
|
|
238
|
+
revertCommand
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=revert-32LDNSGP.js.map
|