@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.
- package/bin/cleo.js +11 -1
- package/dist/cli/adapter-LVXHFBC4.js +158 -0
- package/dist/cli/add-WUAV7LDT.js +443 -0
- package/dist/cli/add-batch-U2DLKAQC.js +163 -0
- package/dist/cli/admin-I7BQYVZD.js +340 -0
- package/dist/cli/adr-K2THMQBS.js +171 -0
- package/dist/cli/agent-WQ6XY2DW.js +2366 -0
- package/dist/cli/agent-outputs-BJIYLVTU.js +84 -0
- package/dist/cli/analyze-PGQZWGOC.js +48 -0
- package/dist/cli/archive-5LZPF7C3.js +64 -0
- package/dist/cli/archive-stats-U6CYC6JM.js +100 -0
- package/dist/cli/attention-SOURWCNI.js +167 -0
- package/dist/cli/audit-FO2Y4LH2.js +122 -0
- package/dist/cli/auth-ED7TAIXI.js +491 -0
- package/dist/cli/backfill-32TRAYRD.js +156 -0
- package/dist/cli/backup-LEJMZJKL.js +587 -0
- package/dist/cli/backup-inspect-6HPLUEI2.js +26 -0
- package/dist/cli/backup-recover-2BTYBZU2.js +29 -0
- package/dist/cli/blockers-5JULUJTV.js +54 -0
- package/dist/cli/brain-273N3FW4.js +400 -0
- package/dist/cli/briefing-7H6OLECX.js +212 -0
- package/dist/cli/caamp-MFQVN6VU.js +181 -0
- package/dist/cli/cancel-SCMJTXZB.js +84 -0
- package/dist/cli/canon-NPF5RODM.js +142 -0
- package/dist/cli/canon-docs-2GTOLF7Y.js +26 -0
- package/dist/cli/cant-46XCUP4P.js +239 -0
- package/dist/cli/changeset-32NMBGG2.js +248 -0
- package/dist/cli/check-RWJLBCI2.js +907 -0
- package/dist/cli/checkpoint-37HMMKD7.js +128 -0
- package/dist/cli/chunk-2JIJD2I7.js +108 -0
- package/dist/cli/chunk-37NU2XDP.js +171 -0
- package/dist/cli/chunk-3IOQVUO7.js +17308 -0
- package/dist/cli/chunk-3PGH67MT.js +175 -0
- package/dist/cli/chunk-3ZO3M37V.js +1002 -0
- package/dist/cli/chunk-47JYZAMS.js +30 -0
- package/dist/cli/chunk-5J2VH3BC.js +66 -0
- package/dist/cli/chunk-5ZFFUFH7.js +92 -0
- package/dist/cli/chunk-6JSJNYH2.js +114 -0
- package/dist/cli/chunk-7INMKEAD.js +85 -0
- package/dist/cli/chunk-A2IUEIM5.js +278 -0
- package/dist/cli/chunk-AWCQH2W5.js +35 -0
- package/dist/cli/chunk-AYA6F4ZT.js +56 -0
- package/dist/cli/chunk-BCEXRFA2.js +76 -0
- package/dist/cli/chunk-BPEVD37G.js +124 -0
- package/dist/cli/chunk-C3B7C43W.js +16 -0
- package/dist/cli/chunk-DVTPIZJM.js +72 -0
- package/dist/cli/chunk-DYABOIHB.js +96 -0
- package/dist/cli/chunk-EBRZ76HS.js +51 -0
- package/dist/cli/chunk-EGOTK2HA.js +57 -0
- package/dist/cli/chunk-EOPQFCSR.js +148 -0
- package/dist/cli/chunk-FORFDPP5.js +288 -0
- package/dist/cli/chunk-GFGLLDXX.js +110 -0
- package/dist/cli/chunk-GH37QXW5.js +280 -0
- package/dist/cli/chunk-GZFVDR44.js +320 -0
- package/dist/cli/chunk-I3CRQQAD.js +225 -0
- package/dist/cli/chunk-J3ZFM3UQ.js +754 -0
- package/dist/cli/chunk-JNZJPIPJ.js +90 -0
- package/dist/cli/chunk-KHB52JNB.js +209 -0
- package/dist/cli/chunk-KJDWWQFY.js +46 -0
- package/dist/cli/chunk-LKNUA3SB.js +83 -0
- package/dist/cli/chunk-LVGIFMCV.js +163 -0
- package/dist/cli/chunk-LWQBJQSE.js +67 -0
- package/dist/cli/chunk-MNJRLSEQ.js +107 -0
- package/dist/cli/chunk-NRKWJLMS.js +91 -0
- package/dist/cli/chunk-NSHV2JNM.js +48 -0
- package/dist/cli/chunk-NWTATTEQ.js +210 -0
- package/dist/cli/chunk-OAPN46TC.js +89 -0
- package/dist/cli/chunk-OGV57L4J.js +59 -0
- package/dist/cli/chunk-OILHT47L.js +252 -0
- package/dist/cli/chunk-OPTEQKBB.js +258 -0
- package/dist/cli/chunk-PKKZPOOP.js +352 -0
- package/dist/cli/chunk-QA6T2LQ5.js +71 -0
- package/dist/cli/chunk-QFFQSKRC.js +4497 -0
- package/dist/cli/chunk-QPUY2HQZ.js +74 -0
- package/dist/cli/chunk-REUTEW3O.js +258 -0
- package/dist/cli/chunk-S24YI723.js +88 -0
- package/dist/cli/chunk-SXXOC6KZ.js +209 -0
- package/dist/cli/chunk-ULN4OKQQ.js +259 -0
- package/dist/cli/chunk-V5GBGOGM.js +46 -0
- package/dist/cli/chunk-VLEYOOPH.js +31 -0
- package/dist/cli/chunk-W33Q3FBH.js +66 -0
- package/dist/cli/chunk-W3JLYKKY.js +140 -0
- package/dist/cli/chunk-XRAX6XFP.js +48 -0
- package/dist/cli/chunk-YGKEECTI.js +78 -0
- package/dist/cli/chunk-YUZJI67I.js +108 -0
- package/dist/cli/chunk-YY66LFZF.js +29 -0
- package/dist/cli/chunk-ZBISIPCK.js +78 -0
- package/dist/cli/chunk-ZZTHTMQP.js +77 -0
- package/dist/cli/claim-KPENYHIQ.js +96 -0
- package/dist/cli/classify-DRVMCFQU.js +117 -0
- package/dist/cli/cli-T3CR7J57.js +48 -0
- package/dist/cli/cloud-PPQ4O5TX.js +565 -0
- package/dist/cli/cockpit-RZKLGYPN.js +790 -0
- package/dist/cli/code-Z5CTMVTD.js +178 -0
- package/dist/cli/complete-UBOCOBRB.js +34 -0
- package/dist/cli/complexity-BV2AGQRZ.js +56 -0
- package/dist/cli/compliance-32PD5Y47.js +276 -0
- package/dist/cli/conduit-VDKCH33F.js +307 -0
- package/dist/cli/config-I72JAXK4.js +516 -0
- package/dist/cli/consensus-LFILLSTK.js +121 -0
- package/dist/cli/context-XUUVFVTP.js +141 -0
- package/dist/cli/contribution-37NQ4N5R.js +111 -0
- package/dist/cli/curator-TFDXU2EX.js +139 -0
- package/dist/cli/current-C4SN5BWV.js +42 -0
- package/dist/cli/daemon-DV25JQ62.js +451 -0
- package/dist/cli/dash-TFU4RLQW.js +70 -0
- package/dist/cli/decide-5VPMNTSI.js +419 -0
- package/dist/cli/decompose-KOYEZNJL.js +77 -0
- package/dist/cli/decomposition-7OHUFIQN.js +121 -0
- package/dist/cli/delete-Q7YCAFY5.js +68 -0
- package/dist/cli/deps-6UZKLDGJ.js +463 -0
- package/dist/cli/detect-FERY35UL.js +45 -0
- package/dist/cli/detect-drift-UL2JTPUK.js +408 -0
- package/dist/cli/diagnostics-TI5QAZXR.js +132 -0
- package/dist/cli/docs-QI2PRN3T.js +3095 -0
- package/dist/cli/doctor-AX5TICQO.js +1253 -0
- package/dist/cli/doctor-ac-bindings-YPMYHU2G.js +26 -0
- package/dist/cli/doctor-acceptance-drift-PYNFGMKB.js +26 -0
- package/dist/cli/doctor-credentials-UZRIADKM.js +26 -0
- package/dist/cli/doctor-db-substrate-Q2TOYM2S.js +27 -0
- package/dist/cli/doctor-dep-cycles-GCVYZY6F.js +26 -0
- package/dist/cli/doctor-exodus-RO5SUTC2.js +26 -0
- package/dist/cli/doctor-exodus-residue-EM2AWQXP.js +26 -0
- package/dist/cli/doctor-fk-check-Q3FOLECE.js +26 -0
- package/dist/cli/doctor-global-delivery-TNOAQ3NP.js +26 -0
- package/dist/cli/doctor-heavy-command-hook-IO3QAQLG.js +26 -0
- package/dist/cli/doctor-legacy-backups-O2YH5VLS.js +26 -0
- package/dist/cli/doctor-legacy-reaper-VSEJEIFA.js +26 -0
- package/dist/cli/doctor-malformed-ids-LQ766V5K.js +26 -0
- package/dist/cli/doctor-manifest-rows-6FQDNHLH.js +26 -0
- package/dist/cli/doctor-memory-guard-J4PSEKB5.js +26 -0
- package/dist/cli/doctor-migrations-ONOH56YM.js +26 -0
- package/dist/cli/doctor-nexus-residency-FUQAX7PV.js +26 -0
- package/dist/cli/doctor-project-identity-GUDK3HYX.js +26 -0
- package/dist/cli/doctor-projects-7L3BNL4O.js +30 -0
- package/dist/cli/doctor-projects-registry-TEAVHFQU.js +26 -0
- package/dist/cli/doctor-release-readiness-IEGHX6SL.js +26 -0
- package/dist/cli/doctor-repair-NBONOSZU.js +26 -0
- package/dist/cli/doctor-skill-fixtures-7Y6L34A3.js +26 -0
- package/dist/cli/doctor-split-brain-TUKIGVHF.js +26 -0
- package/dist/cli/doctor-superseded-store-BHZY2B2L.js +26 -0
- package/dist/cli/doctor-tool-locks-REQMIVYK.js +26 -0
- package/dist/cli/doctor-twin-collapse-222GOSPE.js +26 -0
- package/dist/cli/doctor-worktree-stores-J7TCRVJ3.js +26 -0
- package/dist/cli/done-V3AOO65B.js +195 -0
- package/dist/cli/dynamic-RR4HB7BB.js +29 -0
- package/dist/cli/event-EGNPGE5A.js +372 -0
- package/dist/cli/exists-H4SDCBPL.js +65 -0
- package/dist/cli/exodus-KALO3B3X.js +401 -0
- package/dist/cli/export-ROFOCG4M.js +92 -0
- package/dist/cli/export-tasks-US3WBIEQ.js +96 -0
- package/dist/cli/federation-SUIB5QWT.js +145 -0
- package/dist/cli/find-YICG4BG6.js +177 -0
- package/dist/cli/focus-TKCZPKOM.js +55 -0
- package/dist/cli/gateway-H4HFDC3E.js +77 -0
- package/dist/cli/gateway-auto-start-EDK7XI6E.js +36 -0
- package/dist/cli/gc-5R2TUY5T.js +291 -0
- package/dist/cli/go-PRQFK5YG.js +206 -0
- package/dist/cli/goal-7CZRMLHC.js +212 -0
- package/dist/cli/grade-PY2YRPUS.js +56 -0
- package/dist/cli/graph-XIXMCFKG.js +878 -0
- package/dist/cli/history-EIXADPAD.js +137 -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-R73SO444.js +88 -0
- package/dist/cli/import-tasks-O22FZJ4U.js +108 -0
- package/dist/cli/index.js +419 -94607
- package/dist/cli/init-IHEJDQWU.js +40 -0
- package/dist/cli/inject-LSRVWNCP.js +82 -0
- package/dist/cli/install-global-4AZUCH6U.js +95 -0
- package/dist/cli/intelligence-2OSFOGD2.js +181 -0
- package/dist/cli/issue-IIWEDNFC.js +158 -0
- package/dist/cli/janitor-GPMC7VOR.js +111 -0
- package/dist/cli/labels-5NPOIQXN.js +87 -0
- package/dist/cli/lifecycle-4FFS2K2T.js +272 -0
- package/dist/cli/list-47KEUGPQ.js +108 -0
- package/dist/cli/llm-G5B3I6GD.js +703 -0
- package/dist/cli/llm-cost-S7RS6BVA.js +25 -0
- package/dist/cli/llm-stream-24A45NTS.js +27 -0
- package/dist/cli/log-XF6H2XSD.js +75 -0
- package/dist/cli/login-LBPLGHYG.js +43 -0
- package/dist/cli/logout-SX4JSJIV.js +74 -0
- package/dist/cli/manifest-NMCW4PIW.js +353 -0
- package/dist/cli/map-BU72KMGF.js +52 -0
- package/dist/cli/memory-UHYIVGVM.js +1956 -0
- package/dist/cli/migrate-agents-v2-OO7OILZK.js +33 -0
- package/dist/cli/migrate-claude-mem-EDNYUY3K.js +201 -0
- package/dist/cli/next-RZFRG5X7.js +56 -0
- package/dist/cli/nexus-4S4Z5EVU.js +2923 -0
- package/dist/cli/ops-KR7AWCG3.js +51 -0
- package/dist/cli/orchestrate-HOYZY3VX.js +948 -0
- package/dist/cli/otel-U7IIRBCT.js +188 -0
- package/dist/cli/phase-NYZFHUE5.js +220 -0
- package/dist/cli/pivot-FF2CVUZL.js +87 -0
- package/dist/cli/plan-3SL2NTRV.js +48 -0
- package/dist/cli/playbook-2FCBV7N3.js +229 -0
- package/dist/cli/project-WDX2TGMC.js +330 -0
- package/dist/cli/promote-YINYFBZY.js +52 -0
- package/dist/cli/provenance-C7AYD7WG.js +128 -0
- package/dist/cli/provider-QLJEDQBR.js +212 -0
- package/dist/cli/reason-JF5BHBM5.js +137 -0
- package/dist/cli/reconcile-NMISHDGX.js +127 -0
- package/dist/cli/refresh-memory-EY5YNICV.js +45 -0
- package/dist/cli/relates-R3ZPICAY.js +259 -0
- package/dist/cli/release-4ZJTMUUT.js +524 -0
- package/dist/cli/remote-QSONJDIK.js +279 -0
- package/dist/cli/renderers-64OR3IWX.js +37 -0
- package/dist/cli/reorder-J3DOE7ST.js +86 -0
- package/dist/cli/reparent-2OUMKEZX.js +58 -0
- package/dist/cli/req-TZB7OFKO.js +129 -0
- package/dist/cli/research-MTD7EX45.js +365 -0
- package/dist/cli/restore-VEUOX7NF.js +423 -0
- package/dist/cli/revert-3YF2IL5G.js +240 -0
- package/dist/cli/roadmap-7OOQLXKG.js +61 -0
- package/dist/cli/run-2U5NZV5Z.js +211 -0
- package/dist/cli/safestop-VR4VK56D.js +88 -0
- package/dist/cli/saga-SEWPIOX2.js +285 -0
- package/dist/cli/schema-C52WZ35V.js +195 -0
- package/dist/cli/self-update-GQIGUDPS.js +504 -0
- package/dist/cli/selfimprove-3Y5L4ECT.js +88 -0
- package/dist/cli/sentient-M4YMAVGV.js +1088 -0
- package/dist/cli/sequence-6UBMA4IF.js +93 -0
- package/dist/cli/service-5R7SILZ7.js +155 -0
- package/dist/cli/session-3C6AAC4Y.js +707 -0
- package/dist/cli/setup-BTUBW5PU.js +323 -0
- package/dist/cli/show-MXT2V7TF.js +122 -0
- package/dist/cli/skill-GFUZOU2C.js +84 -0
- package/dist/cli/skills-EDWLKAF3.js +928 -0
- package/dist/cli/smoke-provider-SKUFMZXU.js +218 -0
- package/dist/cli/snapshot-GUWMURCM.js +119 -0
- package/dist/cli/src-66GAKPXR.js +80 -0
- package/dist/cli/start-QFG56RGN.js +67 -0
- package/dist/cli/stats-GW55P7RR.js +95 -0
- package/dist/cli/status-46HTKNRR.js +157 -0
- package/dist/cli/sticky-2DUZOUGI.js +338 -0
- package/dist/cli/stop-J2QEUKHX.js +42 -0
- package/dist/cli/sync-GJP2QYT5.js +154 -0
- package/dist/cli/tasks-BNXTM7PB.js +174 -0
- package/dist/cli/telemetry-55Z2XJWL.js +120 -0
- package/dist/cli/templates-7O77TKPV.js +611 -0
- package/dist/cli/testing-37YTBNKP.js +146 -0
- package/dist/cli/token-UAVJMNUI.js +220 -0
- package/dist/cli/transcript-LORQTV5Z.js +440 -0
- package/dist/cli/tui-BPUFHYKK.js +51 -0
- package/dist/cli/update-NVCYV2FT.js +476 -0
- package/dist/cli/upgrade-OXJXOGEF.js +243 -0
- package/dist/cli/verify-LYLDHPT2.js +190 -0
- package/dist/cli/web-QP2RP266.js +275 -0
- package/dist/cli/workgraph-FXBSZDQE.js +232 -0
- package/dist/cli/worktree-6RXAJIST.js +370 -0
- package/package.json +13 -13
- package/studio-dist/client/_app/immutable/chunks/{Buaay_Q8.js → Btgeq_wq.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/{BJp57kf2.js → CgBjxmu6.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/{CLP4JZvZ.js → DgEKqO6r.js} +1 -1
- package/studio-dist/client/_app/immutable/chunks/t81h7afa.js +1 -0
- package/studio-dist/client/_app/immutable/entry/{app.CczVILch.js → app.a02HWaRB.js} +2 -2
- package/studio-dist/client/_app/immutable/entry/start.BreMSngo.js +1 -0
- package/studio-dist/client/_app/immutable/nodes/{0.Zy2IsLEl.js → 0.nTXyRfc-.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{1.DJN1QI3l.js → 1.4zrWeHtl.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{15.B4rwqbHV.js → 15.D9mk4JyY.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{16.jn-5BG_L.js → 16._-wt-sQf.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{17.DnWGC4t9.js → 17.CUu6LQDj.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{18.0zddLZOY.js → 18.Dz4QRTkX.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{20.DEKHq9Tc.js → 20.CJ2_EB0U.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{24.CQB9KP-p.js → 24.Igj2FS7k.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{25.BaqToZD-.js → 25.BnATjVGN.js} +2 -2
- package/studio-dist/client/_app/immutable/nodes/{26.BiE1i4iE.js → 26.6iPyjT44.js} +1 -1
- package/studio-dist/client/_app/immutable/nodes/{3.BObAOu_-.js → 3.AA5GwNgP.js} +1 -1
- package/studio-dist/client/_app/version.json +1 -1
- package/studio-dist/server/chunks/{0-BmUoS2yd.js → 0-DGmsoBYm.js} +3 -3
- package/studio-dist/server/chunks/1-8PfxPvlK.js +9 -0
- package/studio-dist/server/chunks/{15-Dt4kqUxW.js → 15-Bg6YTndh.js} +3 -3
- package/studio-dist/server/chunks/{16-kgTLJvbO.js → 16-BObLwgyD.js} +3 -3
- package/studio-dist/server/chunks/{17-mRYB5141.js → 17-BNXGyAHX.js} +3 -3
- package/studio-dist/server/chunks/{18-BjZ325q5.js → 18-UqQFRIID.js} +3 -3
- package/studio-dist/server/chunks/{20-DQ2Vrujq.js → 20-CMn8a_yP.js} +3 -3
- package/studio-dist/server/chunks/{24-DAeuAfXN.js → 24-BuOTDzib.js} +3 -3
- package/studio-dist/server/chunks/{25-DGCNmzAS.js → 25-CIMSmjVx.js} +4 -4
- package/studio-dist/server/chunks/{26-CiN6bbmR.js → 26-DWGObn2T.js} +3 -3
- package/studio-dist/server/chunks/{3-BS2FXYjP.js → 3-CyiffdJZ.js} +3 -3
- package/studio-dist/server/chunks/{_layout.svelte-DJ_UWmGp.js → _layout.svelte-DYtClaIk.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-WR6jUiQE.js → _page.svelte-1h9E6s_f.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-BUq8_eQH.js → _page.svelte-BNNF62Nm.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-CRnYa4cW.js → _page.svelte-BT1EUadj.js} +5 -5
- package/studio-dist/server/chunks/{_page.svelte-Dk0znswQ.js → _page.svelte-Bip079LT.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-CcP_KW3Y.js → _page.svelte-CEATWp_5.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-Ca7x-ZvH.js → _page.svelte-CV3xiD1y.js} +4 -4
- package/studio-dist/server/chunks/{_page.svelte-Cfv9tDBA.js → _page.svelte-Cv_KVJDV.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-J4HjPhfO.js → _page.svelte-DSSy6LuK.js} +3 -3
- package/studio-dist/server/chunks/{_page.svelte-D8dLEr7O.js → _page.svelte-TF795TAS.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-Bih2-_5O.js → _server.ts-BlhRFLY3.js} +2 -2
- package/studio-dist/server/chunks/{_server.ts-Cr57EKWf.js → _server.ts-C4w6UdU0.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-P4wVVksg.js → _server.ts-CzrwbhkQ.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-2BazvYRP.js → _server.ts-DWt8Dziu.js} +3 -3
- package/studio-dist/server/chunks/{_server.ts-C0evMKCk.js → _server.ts-Db6mEile.js} +3 -3
- package/studio-dist/server/chunks/{client-Cl295FWH.js → client-D8f2k-H_.js} +2 -2
- package/studio-dist/server/chunks/{dist-CdoCt9zT.js → dist-B8xbIrdB.js} +3 -1
- package/studio-dist/server/chunks/{error.svelte-ajn1HNOb.js → error.svelte-DbbOwIme.js} +3 -3
- package/studio-dist/server/chunks/{http-BiQjEmVU.js → http-1ftNGTs5.js} +2 -2
- package/studio-dist/server/chunks/{internal-D9MtKHIF.js → internal-CTULuLPB.js} +2 -2
- package/studio-dist/server/chunks/{stores-BlknvZ80.js → stores-CS5XOReX.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/C3l-lTkq.js +0 -1
- package/studio-dist/client/_app/immutable/entry/start.D7gHmBNS.js +0 -1
- package/studio-dist/server/chunks/1-CTjj2MYz.js +0 -9
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
cliOutput
|
|
21
|
+
} from "./chunk-3ZO3M37V.js";
|
|
22
|
+
|
|
23
|
+
// packages/cleo/src/cli/commands/doctor-heavy-command-hook.ts
|
|
24
|
+
import { getProjectRoot } from "@cleocode/core/paths.js";
|
|
25
|
+
import {
|
|
26
|
+
deliverHeavyCommandHooks,
|
|
27
|
+
heavyHookPresent,
|
|
28
|
+
inspectHeavyCommandHooks,
|
|
29
|
+
isHeavyHookProblem,
|
|
30
|
+
probeHeavyHookCliFor
|
|
31
|
+
} from "@cleocode/core/resources/heavy-command-hook-delivery.js";
|
|
32
|
+
var doctorHeavyCommandHookCommand = defineCommand({
|
|
33
|
+
meta: {
|
|
34
|
+
name: "heavy-command-hook",
|
|
35
|
+
description: "Report, per agent harness in use, whether the heavy-command hook (routes agent-run tests and builds through cleo run) is installed, outdated, missing or blocked. --fix installs it."
|
|
36
|
+
},
|
|
37
|
+
args: {
|
|
38
|
+
fix: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "Install or refresh the hook in this project (project-level configs only, never user-global)"
|
|
41
|
+
},
|
|
42
|
+
json: { type: "boolean", description: "Output as JSON" },
|
|
43
|
+
human: { type: "boolean", description: "Force human-readable output" },
|
|
44
|
+
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
45
|
+
},
|
|
46
|
+
async run({ args }) {
|
|
47
|
+
const projectRoot = getProjectRoot();
|
|
48
|
+
const outcomes = args.fix === true ? (await deliverHeavyCommandHooks(projectRoot)).outcomes : [];
|
|
49
|
+
const { mode, inspections } = await inspectHeavyCommandHooks(projectRoot);
|
|
50
|
+
const cli = mode !== "off" && heavyHookPresent(inspections) ? await probeHeavyHookCliFor(projectRoot) : null;
|
|
51
|
+
const problems = inspections.filter(isHeavyHookProblem);
|
|
52
|
+
const cliProblem = cli !== null && cli.state !== "current";
|
|
53
|
+
cliOutput(
|
|
54
|
+
{
|
|
55
|
+
projectRoot,
|
|
56
|
+
mode,
|
|
57
|
+
inspections,
|
|
58
|
+
cli,
|
|
59
|
+
fixApplied: args.fix === true,
|
|
60
|
+
outcomes,
|
|
61
|
+
healthy: problems.length === 0 && !cliProblem
|
|
62
|
+
},
|
|
63
|
+
{ command: "doctor", operation: "doctor.heavy-command-hook.run" }
|
|
64
|
+
);
|
|
65
|
+
if ((problems.length > 0 || cliProblem) && (process.exitCode ?? 0) === 0) {
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
doctorHeavyCommandHookCommand
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=chunk-QPUY2HQZ.js.map
|
|
@@ -0,0 +1,258 @@
|
|
|
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
|
+
humanInfo,
|
|
23
|
+
humanLine,
|
|
24
|
+
humanWarn
|
|
25
|
+
} from "./chunk-3ZO3M37V.js";
|
|
26
|
+
|
|
27
|
+
// packages/cleo/src/cli/commands/migrate-agents-v2.ts
|
|
28
|
+
import { createHash } from "node:crypto";
|
|
29
|
+
import { appendFileSync, existsSync, mkdirSync, readdirSync, readFileSync } from "node:fs";
|
|
30
|
+
import { join } from "node:path";
|
|
31
|
+
import {
|
|
32
|
+
ensureGlobalAgentRegistryDb,
|
|
33
|
+
getGlobalAgentRegistryNativeDb,
|
|
34
|
+
getProjectRoot,
|
|
35
|
+
installAgentFromCant
|
|
36
|
+
} from "@cleocode/core/internal";
|
|
37
|
+
var AUDIT_LOG_RELATIVE = ".cleo/audit/migration-agents-v2.jsonl";
|
|
38
|
+
var MIGRATE_CONFLICT_DIAGNOSTIC_ID = "MIGRATE-AGENTS-V2-CONFLICT";
|
|
39
|
+
function sha256Hex(bytes) {
|
|
40
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
41
|
+
}
|
|
42
|
+
function extractAgentName(source) {
|
|
43
|
+
let body = source;
|
|
44
|
+
if (body.startsWith("---")) {
|
|
45
|
+
const end = body.indexOf("\n---", 3);
|
|
46
|
+
if (end >= 0) {
|
|
47
|
+
const afterFence = body.indexOf("\n", end + 4);
|
|
48
|
+
body = afterFence >= 0 ? body.slice(afterFence + 1) : "";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const headerMatch = body.match(/^\s*agent\s+([a-zA-Z][\w-]*)\s*:\s*$/m);
|
|
52
|
+
if (!headerMatch) return null;
|
|
53
|
+
return headerMatch[1] ?? null;
|
|
54
|
+
}
|
|
55
|
+
function appendAuditLog(projectRoot, entry) {
|
|
56
|
+
const auditPath = join(projectRoot, AUDIT_LOG_RELATIVE);
|
|
57
|
+
const auditDir = join(auditPath, "..");
|
|
58
|
+
if (!existsSync(auditDir)) {
|
|
59
|
+
mkdirSync(auditDir, { recursive: true });
|
|
60
|
+
}
|
|
61
|
+
appendFileSync(auditPath, JSON.stringify(entry) + "\n", "utf8");
|
|
62
|
+
}
|
|
63
|
+
function walkAgentsDir(db, scanDir, projectRoot, summary, verbose) {
|
|
64
|
+
if (!existsSync(scanDir)) return;
|
|
65
|
+
let files;
|
|
66
|
+
try {
|
|
67
|
+
files = readdirSync(scanDir).filter((f) => f.endsWith(".cant"));
|
|
68
|
+
} catch (err) {
|
|
69
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
70
|
+
humanWarn(`Error: failed to enumerate ${scanDir}: ${msg}`);
|
|
71
|
+
summary.errors++;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
for (const filename of files) {
|
|
75
|
+
const cantPath = join(scanDir, filename);
|
|
76
|
+
const relPath = cantPath.replace(`${projectRoot}/`, "");
|
|
77
|
+
let sourceBytes;
|
|
78
|
+
let sourceText;
|
|
79
|
+
try {
|
|
80
|
+
sourceBytes = readFileSync(cantPath);
|
|
81
|
+
sourceText = sourceBytes.toString("utf8");
|
|
82
|
+
} catch (err) {
|
|
83
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
84
|
+
humanWarn(`Error: failed to read ${cantPath}: ${msg}`);
|
|
85
|
+
summary.errors++;
|
|
86
|
+
appendAuditLog(projectRoot, {
|
|
87
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
88
|
+
type: "conflict",
|
|
89
|
+
agentName: filename.replace(/\.cant$/, ""),
|
|
90
|
+
filePath: relPath,
|
|
91
|
+
action: `read-error: ${msg}`
|
|
92
|
+
});
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const newSha256 = sha256Hex(sourceBytes);
|
|
96
|
+
const agentName = extractAgentName(sourceText);
|
|
97
|
+
if (!agentName) {
|
|
98
|
+
humanWarn(`Warning: no agent declaration found in ${cantPath} \u2014 skipping.`);
|
|
99
|
+
summary.errors++;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const existingRow = db.prepare("SELECT cant_sha256 FROM agent_registry_agents WHERE agent_id = ?").get(agentName);
|
|
103
|
+
if (existingRow) {
|
|
104
|
+
const existingSha256 = existingRow.cant_sha256 ?? "";
|
|
105
|
+
if (existingSha256 === newSha256) {
|
|
106
|
+
if (verbose) {
|
|
107
|
+
humanLine(` skipped (already registered): ${agentName}`);
|
|
108
|
+
}
|
|
109
|
+
appendAuditLog(projectRoot, {
|
|
110
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
111
|
+
type: "skipped",
|
|
112
|
+
agentName,
|
|
113
|
+
filePath: relPath,
|
|
114
|
+
action: "already-registered-same-content"
|
|
115
|
+
});
|
|
116
|
+
summary.skipped++;
|
|
117
|
+
} else {
|
|
118
|
+
humanWarn(
|
|
119
|
+
` WARN: conflict for ${agentName}: disk sha256=${newSha256.slice(0, 12)}... db sha256=${existingSha256.slice(0, 12)}... \u2014 NOT overwriting`
|
|
120
|
+
);
|
|
121
|
+
appendAuditLog(projectRoot, {
|
|
122
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
123
|
+
type: "conflict",
|
|
124
|
+
agentName,
|
|
125
|
+
filePath: relPath,
|
|
126
|
+
existingSha256,
|
|
127
|
+
newSha256,
|
|
128
|
+
action: "skipped-conflict-do-not-overwrite",
|
|
129
|
+
doctor_diagnostic_id: MIGRATE_CONFLICT_DIAGNOSTIC_ID
|
|
130
|
+
});
|
|
131
|
+
summary.conflicts++;
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
try {
|
|
135
|
+
installAgentFromCant(db, {
|
|
136
|
+
cantSource: cantPath,
|
|
137
|
+
targetTier: "project",
|
|
138
|
+
installedFrom: "manual",
|
|
139
|
+
projectRoot
|
|
140
|
+
});
|
|
141
|
+
if (verbose) {
|
|
142
|
+
humanLine(` registered: ${agentName} from ${relPath}`);
|
|
143
|
+
}
|
|
144
|
+
appendAuditLog(projectRoot, {
|
|
145
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
146
|
+
type: "registered",
|
|
147
|
+
agentName,
|
|
148
|
+
filePath: relPath,
|
|
149
|
+
action: "registered-via-installAgentFromCant"
|
|
150
|
+
});
|
|
151
|
+
summary.registered++;
|
|
152
|
+
} catch (err) {
|
|
153
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
154
|
+
humanWarn(` ERROR: failed to register ${agentName}: ${msg}`);
|
|
155
|
+
summary.errors++;
|
|
156
|
+
appendAuditLog(projectRoot, {
|
|
157
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
158
|
+
type: "conflict",
|
|
159
|
+
agentName,
|
|
160
|
+
filePath: relPath,
|
|
161
|
+
action: `install-error: ${msg}`
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
async function runMigrateAgentsV2(projectRoot, verbose = true) {
|
|
168
|
+
const summary = { registered: 0, skipped: 0, conflicts: 0, errors: 0 };
|
|
169
|
+
await ensureGlobalAgentRegistryDb();
|
|
170
|
+
const db = getGlobalAgentRegistryNativeDb();
|
|
171
|
+
try {
|
|
172
|
+
const canonicalDir = join(projectRoot, ".cleo", "cant", "agents");
|
|
173
|
+
walkAgentsDir(db, canonicalDir, projectRoot, summary, verbose);
|
|
174
|
+
const legacyDir = join(projectRoot, ".cleo", "agents");
|
|
175
|
+
walkAgentsDir(db, legacyDir, projectRoot, summary, verbose);
|
|
176
|
+
} finally {
|
|
177
|
+
db.close();
|
|
178
|
+
}
|
|
179
|
+
return summary;
|
|
180
|
+
}
|
|
181
|
+
function readMigrationConflicts(projectRoot) {
|
|
182
|
+
const auditPath = join(projectRoot, AUDIT_LOG_RELATIVE);
|
|
183
|
+
if (!existsSync(auditPath)) return [];
|
|
184
|
+
let raw;
|
|
185
|
+
try {
|
|
186
|
+
raw = readFileSync(auditPath, "utf8");
|
|
187
|
+
} catch {
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
190
|
+
const conflicts = [];
|
|
191
|
+
for (const line of raw.split("\n")) {
|
|
192
|
+
const trimmed = line.trim();
|
|
193
|
+
if (!trimmed) continue;
|
|
194
|
+
try {
|
|
195
|
+
const entry = JSON.parse(trimmed);
|
|
196
|
+
if (entry.type === "conflict" && entry.doctor_diagnostic_id === MIGRATE_CONFLICT_DIAGNOSTIC_ID) {
|
|
197
|
+
conflicts.push(entry);
|
|
198
|
+
}
|
|
199
|
+
} catch {
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return conflicts;
|
|
203
|
+
}
|
|
204
|
+
var migrateAgentsV2Command = defineCommand({
|
|
205
|
+
meta: {
|
|
206
|
+
name: "agents-v2",
|
|
207
|
+
description: "Register existing .cant agent files into signaldock.db (idempotent, conflict-safe)"
|
|
208
|
+
},
|
|
209
|
+
args: {
|
|
210
|
+
quiet: {
|
|
211
|
+
type: "boolean",
|
|
212
|
+
description: "Suppress per-agent INFO lines; only print the summary"
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
async run({ args }) {
|
|
216
|
+
const projectRoot = getProjectRoot();
|
|
217
|
+
const verbose = args.quiet !== true;
|
|
218
|
+
if (verbose) {
|
|
219
|
+
humanInfo("Scanning .cleo/cant/agents/ and .cleo/agents/ for unregistered agents...");
|
|
220
|
+
}
|
|
221
|
+
try {
|
|
222
|
+
const summary = await runMigrateAgentsV2(projectRoot, verbose);
|
|
223
|
+
const summaryLine = `Migration complete: ${summary.registered} registered, ${summary.skipped} skipped, ${summary.conflicts} conflicts.`;
|
|
224
|
+
humanLine(summaryLine);
|
|
225
|
+
if (summary.conflicts > 0) {
|
|
226
|
+
humanLine(` Conflicts logged to ${AUDIT_LOG_RELATIVE}. Run 'cleo doctor' for details.`);
|
|
227
|
+
}
|
|
228
|
+
cliOutput(
|
|
229
|
+
{
|
|
230
|
+
registered: summary.registered,
|
|
231
|
+
skipped: summary.skipped,
|
|
232
|
+
conflicts: summary.conflicts,
|
|
233
|
+
errors: summary.errors,
|
|
234
|
+
auditLog: summary.conflicts > 0 || summary.errors > 0 ? AUDIT_LOG_RELATIVE : null
|
|
235
|
+
},
|
|
236
|
+
{ command: "migrate agents-v2", operation: "migrate.agents-v2" }
|
|
237
|
+
);
|
|
238
|
+
if (summary.errors > 0) {
|
|
239
|
+
process.exitCode = 1;
|
|
240
|
+
}
|
|
241
|
+
} catch (err) {
|
|
242
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
243
|
+
cliError(message, "E_MIGRATION_FAILED", void 0, {
|
|
244
|
+
operation: "migrate.agents-v2"
|
|
245
|
+
});
|
|
246
|
+
process.exitCode = 1;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
export {
|
|
252
|
+
extractAgentName,
|
|
253
|
+
walkAgentsDir,
|
|
254
|
+
runMigrateAgentsV2,
|
|
255
|
+
readMigrationConflicts,
|
|
256
|
+
migrateAgentsV2Command
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=chunk-REUTEW3O.js.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
|
|
3
|
+
if (globalThis[_installed]) return;
|
|
4
|
+
globalThis[_installed] = true;
|
|
5
|
+
const _origEmitWarning = process.emitWarning;
|
|
6
|
+
process.emitWarning = function(warning, type, code, ctor) {
|
|
7
|
+
if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (typeof warning === 'string' && /SQLite is an experimental feature/i.test(warning)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
return _origEmitWarning.call(process, warning, type, code, ctor);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import {
|
|
17
|
+
defineCommand
|
|
18
|
+
} from "./chunk-PKKZPOOP.js";
|
|
19
|
+
import {
|
|
20
|
+
cliError,
|
|
21
|
+
cliOutput
|
|
22
|
+
} from "./chunk-3ZO3M37V.js";
|
|
23
|
+
|
|
24
|
+
// packages/cleo/src/cli/commands/doctor-superseded-store.ts
|
|
25
|
+
import { getProjectRoot } from "@cleocode/core";
|
|
26
|
+
import { scanSupersededStores } from "@cleocode/core/doctor/superseded-store.js";
|
|
27
|
+
import { reconcileSupersededStores } from "@cleocode/core/store/exodus/index.js";
|
|
28
|
+
var doctorSupersededStoreCommand = defineCommand({
|
|
29
|
+
meta: {
|
|
30
|
+
name: "superseded-store",
|
|
31
|
+
description: "Report pre-dual-scope store files (.cleo/tasks.db, .cleo/brain.db) still on disk under their old LIVE names after the cleo.db migration, proving which store holds the data. Read-only \u2014 deletes nothing."
|
|
32
|
+
},
|
|
33
|
+
args: {
|
|
34
|
+
reconcile: {
|
|
35
|
+
type: "boolean",
|
|
36
|
+
description: "Copy rows the superseded files hold that are missing from cleo.db (additive, verified, reverted on mismatch; legacy files are never touched). Writes a receipt."
|
|
37
|
+
},
|
|
38
|
+
additive: {
|
|
39
|
+
type: "boolean",
|
|
40
|
+
description: "With --reconcile, for a project already running on cleo.db: copy only history rows whose keys are absent from live, never write the live task graph, and list every row left uncopied as a conflict in the receipt"
|
|
41
|
+
},
|
|
42
|
+
"dry-run": {
|
|
43
|
+
type: "boolean",
|
|
44
|
+
description: "With --reconcile: report per-table counts and what would be copied; write nothing"
|
|
45
|
+
},
|
|
46
|
+
json: { type: "boolean", description: "Output as JSON" },
|
|
47
|
+
human: { type: "boolean", description: "Force human-readable output" },
|
|
48
|
+
quiet: { type: "boolean", description: "Suppress non-essential output" }
|
|
49
|
+
},
|
|
50
|
+
async run({ args }) {
|
|
51
|
+
if (args.reconcile === true) {
|
|
52
|
+
const receipt = await reconcileSupersededStores(getProjectRoot(), {
|
|
53
|
+
dryRun: args["dry-run"] === true,
|
|
54
|
+
additive: args.additive === true
|
|
55
|
+
});
|
|
56
|
+
if (receipt.outcome === "refused") {
|
|
57
|
+
cliError(receipt.reason, "E_RECONCILE_REFUSED", {
|
|
58
|
+
details: receipt,
|
|
59
|
+
fix: `Inspect ${receipt.receiptPath ?? "the receipt"}; the legacy files are unchanged, so it is safe to retry after fixing the cause.`
|
|
60
|
+
});
|
|
61
|
+
process.exitCode = 1;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
cliOutput(
|
|
65
|
+
{ kind: "generic", ...receipt },
|
|
66
|
+
{
|
|
67
|
+
command: "doctor",
|
|
68
|
+
operation: "doctor.superseded-store.reconcile",
|
|
69
|
+
message: receipt.reason
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const result = scanSupersededStores(getProjectRoot());
|
|
75
|
+
cliOutput(result, {
|
|
76
|
+
command: "doctor",
|
|
77
|
+
operation: "doctor.superseded-store.run"
|
|
78
|
+
});
|
|
79
|
+
if (result.entries.length > 0 && (process.exitCode === void 0 || process.exitCode === 0)) {
|
|
80
|
+
process.exitCode = 1;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
doctorSupersededStoreCommand
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=chunk-S24YI723.js.map
|
|
@@ -0,0 +1,209 @@
|
|
|
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
|
+
|
|
17
|
+
// packages/cleo/src/dispatch/domains/check/canon-docs.ts
|
|
18
|
+
import { execFileSync } from "node:child_process";
|
|
19
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
20
|
+
import { join, sep } from "node:path";
|
|
21
|
+
import { resolveCanonDocPathPolicy } from "@cleocode/core/session/canon-lint";
|
|
22
|
+
import { parse as parseYaml } from "yaml";
|
|
23
|
+
var CanonDocsDiffError = class extends Error {
|
|
24
|
+
/** Stable diagnostic code for an unavailable Git candidate inventory. */
|
|
25
|
+
code = "E_CANON_DIFF_FAILED";
|
|
26
|
+
/**
|
|
27
|
+
* Preserve the requested scope and underlying command failure.
|
|
28
|
+
*
|
|
29
|
+
* @param projectRoot - Repository that could not be assessed.
|
|
30
|
+
* @param baseRef - Requested Git comparison base.
|
|
31
|
+
* @param cause - Original Git process failure.
|
|
32
|
+
*/
|
|
33
|
+
constructor(projectRoot, baseRef, cause) {
|
|
34
|
+
super(
|
|
35
|
+
`E_CANON_DIFF_FAILED: Cannot assess docs in ${projectRoot} against ${baseRef}: ${cause.message}`,
|
|
36
|
+
{ cause }
|
|
37
|
+
);
|
|
38
|
+
this.name = "CanonDocsDiffError";
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
function listAddedMarkdownFiles(projectRoot, baseRef) {
|
|
42
|
+
try {
|
|
43
|
+
const out = execFileSync(
|
|
44
|
+
"git",
|
|
45
|
+
[
|
|
46
|
+
"diff",
|
|
47
|
+
"--diff-filter=A",
|
|
48
|
+
"--name-only",
|
|
49
|
+
"-z",
|
|
50
|
+
"--end-of-options",
|
|
51
|
+
`${baseRef}...HEAD`,
|
|
52
|
+
"--"
|
|
53
|
+
],
|
|
54
|
+
{
|
|
55
|
+
cwd: projectRoot,
|
|
56
|
+
encoding: "utf8",
|
|
57
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
58
|
+
timeout: 3e4
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
return out.split("\0").filter((line) => line.length > 0 && line.endsWith(".md"));
|
|
62
|
+
} catch (error) {
|
|
63
|
+
throw new CanonDocsDiffError(
|
|
64
|
+
projectRoot,
|
|
65
|
+
baseRef,
|
|
66
|
+
error instanceof Error ? error : new Error(String(error))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function validateCanonRegistry(raw, source) {
|
|
71
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
72
|
+
throw new Error(`${source}: top-level value must be an object`);
|
|
73
|
+
}
|
|
74
|
+
const obj = raw;
|
|
75
|
+
const version = obj["version"];
|
|
76
|
+
if (typeof version !== "number" || version !== 1) {
|
|
77
|
+
throw new Error(`${source}: 'version' must be the integer 1 (got ${String(version)})`);
|
|
78
|
+
}
|
|
79
|
+
const kindsRaw = obj["kinds"];
|
|
80
|
+
if (kindsRaw === null || typeof kindsRaw !== "object" || Array.isArray(kindsRaw)) {
|
|
81
|
+
throw new Error(`${source}: 'kinds' must be an object`);
|
|
82
|
+
}
|
|
83
|
+
const kinds = {};
|
|
84
|
+
for (const [kindId, entryRaw] of Object.entries(kindsRaw)) {
|
|
85
|
+
kinds[kindId] = validateKindEntry(kindId, entryRaw, source);
|
|
86
|
+
}
|
|
87
|
+
const similarity = validateSimilarity(obj["similarity"], source);
|
|
88
|
+
return similarity !== void 0 ? { version, kinds, similarity } : { version, kinds };
|
|
89
|
+
}
|
|
90
|
+
function validateSimilarity(raw, source) {
|
|
91
|
+
if (raw === void 0 || raw === null) {
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
94
|
+
if (typeof raw !== "object" || Array.isArray(raw)) {
|
|
95
|
+
throw new Error(`${source}: 'similarity' must be an object`);
|
|
96
|
+
}
|
|
97
|
+
const obj = raw;
|
|
98
|
+
const warnThresholdRaw = obj["warnThreshold"];
|
|
99
|
+
let warnThreshold = 0.85;
|
|
100
|
+
if (warnThresholdRaw !== void 0) {
|
|
101
|
+
if (typeof warnThresholdRaw !== "number" || Number.isNaN(warnThresholdRaw) || warnThresholdRaw < 0 || warnThresholdRaw > 1) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
`${source}: 'similarity.warnThreshold' must be a number in [0, 1] (got ${String(warnThresholdRaw)})`
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
warnThreshold = warnThresholdRaw;
|
|
107
|
+
}
|
|
108
|
+
const modeRaw = obj["mode"];
|
|
109
|
+
let mode = "warn";
|
|
110
|
+
if (modeRaw !== void 0) {
|
|
111
|
+
if (modeRaw !== "warn" && modeRaw !== "block") {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`${source}: 'similarity.mode' must be 'warn' or 'block' (got ${String(modeRaw)})`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
mode = modeRaw;
|
|
117
|
+
}
|
|
118
|
+
return { warnThreshold, mode };
|
|
119
|
+
}
|
|
120
|
+
function validateKindEntry(kindId, raw, source) {
|
|
121
|
+
const where = `${source} kinds.${kindId}`;
|
|
122
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
123
|
+
throw new Error(`${where}: must be an object`);
|
|
124
|
+
}
|
|
125
|
+
const obj = raw;
|
|
126
|
+
const canonicalHome = obj["canonicalHome"];
|
|
127
|
+
if (canonicalHome !== "ssot" && canonicalHome !== "ssot-first") {
|
|
128
|
+
throw new Error(
|
|
129
|
+
`${where}: 'canonicalHome' must be 'ssot' or 'ssot-first' (got ${String(canonicalHome)})`
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
const publishMirror = obj["publishMirror"];
|
|
133
|
+
if (typeof publishMirror !== "string" || publishMirror.length === 0) {
|
|
134
|
+
throw new Error(`${where}: 'publishMirror' must be a non-empty string`);
|
|
135
|
+
}
|
|
136
|
+
const rawMdAllowed = obj["rawMdAllowed"];
|
|
137
|
+
if (typeof rawMdAllowed !== "boolean") {
|
|
138
|
+
throw new Error(`${where}: 'rawMdAllowed' must be a boolean`);
|
|
139
|
+
}
|
|
140
|
+
const rawMdPathsRaw = obj["rawMdPaths"];
|
|
141
|
+
let rawMdPaths;
|
|
142
|
+
if (rawMdPathsRaw !== void 0) {
|
|
143
|
+
if (!Array.isArray(rawMdPathsRaw)) {
|
|
144
|
+
throw new Error(`${where}: 'rawMdPaths' must be an array`);
|
|
145
|
+
}
|
|
146
|
+
for (const p of rawMdPathsRaw) {
|
|
147
|
+
if (typeof p !== "string" || p.length === 0) {
|
|
148
|
+
throw new Error(`${where}: 'rawMdPaths' entries must be non-empty strings`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
rawMdPaths = rawMdPathsRaw;
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
canonicalHome,
|
|
155
|
+
publishMirror,
|
|
156
|
+
rawMdAllowed,
|
|
157
|
+
...rawMdPaths !== void 0 ? { rawMdPaths } : {}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function loadCanonRegistry(projectRoot) {
|
|
161
|
+
const path = join(projectRoot, ".cleo", "canon.yml");
|
|
162
|
+
if (!existsSync(path)) {
|
|
163
|
+
return void 0;
|
|
164
|
+
}
|
|
165
|
+
const text = readFileSync(path, "utf8");
|
|
166
|
+
const parsed = parseYaml(text);
|
|
167
|
+
return validateCanonRegistry(parsed, path);
|
|
168
|
+
}
|
|
169
|
+
function runCanonDocsCheck(params) {
|
|
170
|
+
const { projectRoot, baseRef = "origin/main", candidateFiles } = params;
|
|
171
|
+
const registry = loadCanonRegistry(projectRoot);
|
|
172
|
+
if (!registry) {
|
|
173
|
+
return {
|
|
174
|
+
passed: true,
|
|
175
|
+
baseRef,
|
|
176
|
+
scanned: 0,
|
|
177
|
+
violations: [],
|
|
178
|
+
mode: "no-canon"
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
const candidates = candidateFiles ?? listAddedMarkdownFiles(projectRoot, baseRef);
|
|
182
|
+
const violations = [];
|
|
183
|
+
for (const file of candidates) {
|
|
184
|
+
const normalised = file.split(sep).join("/");
|
|
185
|
+
const policy = resolveCanonDocPathPolicy(registry, normalised);
|
|
186
|
+
if (policy && !policy.rawMdAllowed) {
|
|
187
|
+
violations.push({
|
|
188
|
+
file: normalised,
|
|
189
|
+
kind: policy.docKind,
|
|
190
|
+
matchedPath: policy.matchedPath,
|
|
191
|
+
fix: `cleo docs add <taskId> ${normalised} --type ${policy.docKind}`
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
passed: violations.length === 0,
|
|
197
|
+
baseRef,
|
|
198
|
+
scanned: candidates.length,
|
|
199
|
+
violations,
|
|
200
|
+
mode: "enforced"
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export {
|
|
205
|
+
CanonDocsDiffError,
|
|
206
|
+
loadCanonRegistry,
|
|
207
|
+
runCanonDocsCheck
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=chunk-SXXOC6KZ.js.map
|