@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,138 @@
|
|
|
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
|
+
dispatchFromCli
|
|
18
|
+
} from "./chunk-L7ONYSV6.js";
|
|
19
|
+
import "./chunk-6N6WGLXE.js";
|
|
20
|
+
import "./chunk-4VASFLUW.js";
|
|
21
|
+
import {
|
|
22
|
+
defineCommand,
|
|
23
|
+
showUsage
|
|
24
|
+
} from "./chunk-PKKZPOOP.js";
|
|
25
|
+
import "./chunk-QKMBWYAS.js";
|
|
26
|
+
import "./chunk-4RGSNUUP.js";
|
|
27
|
+
import "./chunk-6JSJNYH2.js";
|
|
28
|
+
import "./chunk-D7BAQNV2.js";
|
|
29
|
+
import "./chunk-TYC7G5LF.js";
|
|
30
|
+
|
|
31
|
+
// packages/cleo/src/cli/commands/history.ts
|
|
32
|
+
var logCommand = defineCommand({
|
|
33
|
+
meta: { name: "log", description: "Show operation audit log" },
|
|
34
|
+
args: {
|
|
35
|
+
days: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Show last N days",
|
|
38
|
+
default: "30"
|
|
39
|
+
},
|
|
40
|
+
since: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Show completions since date (YYYY-MM-DD)"
|
|
43
|
+
},
|
|
44
|
+
until: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Show completions until date (YYYY-MM-DD)"
|
|
47
|
+
},
|
|
48
|
+
"no-chart": {
|
|
49
|
+
type: "boolean",
|
|
50
|
+
description: "Disable bar charts",
|
|
51
|
+
default: false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
async run({ args }) {
|
|
55
|
+
await dispatchFromCli(
|
|
56
|
+
"query",
|
|
57
|
+
"admin",
|
|
58
|
+
"log",
|
|
59
|
+
{
|
|
60
|
+
days: Number.parseInt(args.days, 10),
|
|
61
|
+
since: args.since,
|
|
62
|
+
until: args.until
|
|
63
|
+
},
|
|
64
|
+
{ command: "history" }
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
var workCommand = defineCommand({
|
|
69
|
+
meta: { name: "work", description: "Show task work history (time tracked per task)" },
|
|
70
|
+
async run() {
|
|
71
|
+
await dispatchFromCli("query", "tasks", "history", {}, { command: "history" });
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var rankingCommand = defineCommand({
|
|
75
|
+
meta: {
|
|
76
|
+
name: "ranking",
|
|
77
|
+
description: "Who changed a task's priority, severity, kind or depends \u2014 actor, session, reason, before/after (D11161)"
|
|
78
|
+
},
|
|
79
|
+
args: {
|
|
80
|
+
taskId: { type: "positional", description: "Task ID", required: true },
|
|
81
|
+
limit: { type: "string", description: "Maximum entries (default 50)" }
|
|
82
|
+
},
|
|
83
|
+
async run({ args }) {
|
|
84
|
+
await dispatchFromCli(
|
|
85
|
+
"query",
|
|
86
|
+
"tasks",
|
|
87
|
+
"history",
|
|
88
|
+
{
|
|
89
|
+
taskId: String(args.taskId),
|
|
90
|
+
ranking: true,
|
|
91
|
+
...args.limit !== void 0 ? { limit: Number.parseInt(String(args.limit), 10) } : {}
|
|
92
|
+
},
|
|
93
|
+
{ command: "history" }
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var revertCommand = defineCommand({
|
|
98
|
+
meta: {
|
|
99
|
+
name: "revert",
|
|
100
|
+
description: "Undo one ranking change (an entry id from `cleo history ranking`); refused if a field changed again since, unless --force"
|
|
101
|
+
},
|
|
102
|
+
args: {
|
|
103
|
+
entryId: { type: "positional", description: "ranking_changed entry id", required: true },
|
|
104
|
+
reason: { type: "string", description: "Why it is reverted (recorded)" },
|
|
105
|
+
force: { type: "boolean", description: "Revert even though a field changed again since" }
|
|
106
|
+
},
|
|
107
|
+
async run({ args }) {
|
|
108
|
+
await dispatchFromCli(
|
|
109
|
+
"mutate",
|
|
110
|
+
"tasks",
|
|
111
|
+
"ranking.revert",
|
|
112
|
+
{
|
|
113
|
+
entryId: String(args.entryId),
|
|
114
|
+
...args.reason !== void 0 ? { reason: String(args.reason) } : {},
|
|
115
|
+
...args.force === true ? { force: true } : {}
|
|
116
|
+
},
|
|
117
|
+
{ command: "history" }
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var historyCommand = defineCommand({
|
|
122
|
+
meta: { name: "history", description: "Completion timeline and productivity analytics" },
|
|
123
|
+
subCommands: {
|
|
124
|
+
log: logCommand,
|
|
125
|
+
work: workCommand,
|
|
126
|
+
ranking: rankingCommand,
|
|
127
|
+
revert: revertCommand
|
|
128
|
+
},
|
|
129
|
+
async run({ cmd, rawArgs }) {
|
|
130
|
+
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
131
|
+
if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
|
|
132
|
+
await showUsage(cmd);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
export {
|
|
136
|
+
historyCommand
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=history-NACNUQTC.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
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 "./chunk-C3B7C43W.js";
|
|
17
|
+
import {
|
|
18
|
+
defineCommand,
|
|
19
|
+
showUsage
|
|
20
|
+
} from "./chunk-PKKZPOOP.js";
|
|
21
|
+
|
|
22
|
+
// packages/cleo/src/cli/commands/hook.ts
|
|
23
|
+
var heavyCommandSubcommand = defineCommand({
|
|
24
|
+
meta: {
|
|
25
|
+
name: "heavy-command",
|
|
26
|
+
description: "PreToolUse hook: route heavy shell commands (tests, builds, typechecks, installs) through cleo run. Reads the hook JSON on stdin; prints the harness answer."
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
provider: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Harness protocol to answer in: claude-code (default), codex, kimi, opencode"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
async run({ args }) {
|
|
35
|
+
const { runHookCli } = await import("./hook-entry.js");
|
|
36
|
+
const provider = typeof args.provider === "string" ? args.provider : "claude-code";
|
|
37
|
+
process.exitCode = await runHookCli(["heavy-command", "--provider", provider]);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var hookCommand = defineCommand({
|
|
41
|
+
meta: {
|
|
42
|
+
name: "hook",
|
|
43
|
+
description: "Agent-harness hooks installed by cleo init/upgrade; stdout is the harness hook protocol, not LAFS: cleo hook heavy-command --provider claude-code|codex|kimi|opencode"
|
|
44
|
+
},
|
|
45
|
+
subCommands: {
|
|
46
|
+
"heavy-command": heavyCommandSubcommand
|
|
47
|
+
},
|
|
48
|
+
async run({ cmd, rawArgs }) {
|
|
49
|
+
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
50
|
+
if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
|
|
51
|
+
await showUsage(cmd);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
hookCommand
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=hook-UF7J7R6D.js.map
|
package/dist/cli/hook-entry.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
|
+
const _installed = Symbol.for('cleocode.cli.sqliteWarningFilter');
|
|
3
|
+
if (globalThis[_installed]) return;
|
|
4
|
+
globalThis[_installed] = true;
|
|
2
5
|
const _origEmitWarning = process.emitWarning;
|
|
3
6
|
process.emitWarning = function(warning, type, code, ctor) {
|
|
4
7
|
if (typeof warning === 'object' && warning.name === 'ExperimentalWarning' && typeof warning.message === 'string' && /SQLite is an experimental feature/i.test(warning.message)) {
|
|
@@ -12,7 +15,8 @@
|
|
|
12
15
|
})();
|
|
13
16
|
|
|
14
17
|
// packages/cleo/src/cli/hook-entry.ts
|
|
15
|
-
import {
|
|
18
|
+
import { execFileSync } from "node:child_process";
|
|
19
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
16
20
|
import { homedir } from "node:os";
|
|
17
21
|
import { join } from "node:path";
|
|
18
22
|
var HEAVY_HOOK_PROVIDERS = [
|
|
@@ -27,6 +31,13 @@ var MIN_WAIT_SEC = 30;
|
|
|
27
31
|
var MAX_WAIT_SEC = 300;
|
|
28
32
|
var DEFAULT_WAIT_SEC = 60;
|
|
29
33
|
var REWRITE_MODES = /* @__PURE__ */ new Set(["bypassPermissions", "auto"]);
|
|
34
|
+
var PRE_APPROVE_MODES = /* @__PURE__ */ new Set([
|
|
35
|
+
"default",
|
|
36
|
+
"acceptEdits",
|
|
37
|
+
"dontAsk",
|
|
38
|
+
"auto"
|
|
39
|
+
]);
|
|
40
|
+
var PRE_APPROVED_REASON = "[cleo] your allow rules approve this command; the hook only queues it for the machine-wide budget";
|
|
30
41
|
var MAX_STDIN_BYTES = 1024 * 1024;
|
|
31
42
|
async function readProcessStdin() {
|
|
32
43
|
if (process.stdin.isTTY) return "";
|
|
@@ -119,7 +130,7 @@ function heavyHookContext(plan, pressure, provider = "claude-code") {
|
|
|
119
130
|
function demote(plan, reason) {
|
|
120
131
|
return plan.action === "rewrite" ? { action: "warn", reason, segments: plan.segments } : plan;
|
|
121
132
|
}
|
|
122
|
-
function renderHeavyHookAnswer(provider, toolInput, plan, context, timeoutMs) {
|
|
133
|
+
function renderHeavyHookAnswer(provider, toolInput, plan, context, timeoutMs, preApproved = false) {
|
|
123
134
|
if (plan.action === "none" && context === "") return "";
|
|
124
135
|
const rewrite = plan.action === "rewrite";
|
|
125
136
|
if (provider === "opencode") {
|
|
@@ -149,10 +160,12 @@ function renderHeavyHookAnswer(provider, toolInput, plan, context, timeoutMs) {
|
|
|
149
160
|
command: plan.command,
|
|
150
161
|
...provider === "claude-code" && timeoutMs !== void 0 ? { timeout: timeoutMs } : {}
|
|
151
162
|
} : void 0;
|
|
163
|
+
const allow = rewrite && (provider === "codex" || preApproved);
|
|
152
164
|
const output = {
|
|
153
165
|
hookSpecificOutput: {
|
|
154
166
|
hookEventName: "PreToolUse",
|
|
155
|
-
...
|
|
167
|
+
...allow ? { permissionDecision: "allow" } : {},
|
|
168
|
+
...allow && provider === "claude-code" ? { permissionDecisionReason: PRE_APPROVED_REASON } : {},
|
|
156
169
|
...updatedInput === void 0 ? {} : { updatedInput },
|
|
157
170
|
...context === "" ? {} : { additionalContext: context }
|
|
158
171
|
}
|
|
@@ -175,12 +188,33 @@ function heavyRuleWords(argv) {
|
|
|
175
188
|
function ruleWords(pattern) {
|
|
176
189
|
return pattern.split(/[\s:*()]+/).filter((w) => w !== "" && !w.startsWith("-")).map(wordBase);
|
|
177
190
|
}
|
|
178
|
-
function claudeRuleFiles(projectDir, env) {
|
|
179
|
-
|
|
180
|
-
|
|
191
|
+
function claudeRuleFiles(projectDir, env, managedDir = claudeManagedDir()) {
|
|
192
|
+
return [...claudeManagedFiles(env, managedDir), ...claudeSettingsFiles(projectDir, env)];
|
|
193
|
+
}
|
|
194
|
+
function claudeManagedDir(platform = process.platform) {
|
|
195
|
+
return platform === "darwin" ? "/Library/Application Support/ClaudeCode" : platform === "win32" ? "C:\\Program Files\\ClaudeCode" : "/etc/claude-code";
|
|
196
|
+
}
|
|
197
|
+
function claudeConfigDir(env) {
|
|
198
|
+
return env.CLAUDE_CONFIG_DIR || join(env.HOME || homedir(), ".claude");
|
|
199
|
+
}
|
|
200
|
+
function claudeManagedFiles(env, managedDir = claudeManagedDir()) {
|
|
201
|
+
const dropInDir = join(managedDir, "managed-settings.d");
|
|
202
|
+
let dropIns = [];
|
|
203
|
+
try {
|
|
204
|
+
dropIns = readdirSync(dropInDir).filter((n) => n.endsWith(".json") && !n.startsWith(".")).sort().map((n) => join(dropInDir, n));
|
|
205
|
+
} catch (err) {
|
|
206
|
+
const code = err.code;
|
|
207
|
+
if (code !== "ENOENT" && code !== "ENOTDIR") dropIns = [dropInDir];
|
|
208
|
+
}
|
|
209
|
+
return [
|
|
210
|
+
join(managedDir, "managed-settings.json"),
|
|
211
|
+
...dropIns,
|
|
212
|
+
join(claudeConfigDir(env), "remote-settings.json")
|
|
213
|
+
];
|
|
214
|
+
}
|
|
215
|
+
function claudeSettingsFiles(projectDir, env) {
|
|
181
216
|
return [
|
|
182
|
-
|
|
183
|
-
join(configDir, "settings.json"),
|
|
217
|
+
join(claudeConfigDir(env), "settings.json"),
|
|
184
218
|
join(projectDir, ".claude", "settings.json"),
|
|
185
219
|
join(projectDir, ".claude", "settings.local.json")
|
|
186
220
|
];
|
|
@@ -197,24 +231,154 @@ function claudeGuardedBashRules(files) {
|
|
|
197
231
|
if (code !== "ENOENT" && code !== "ENOTDIR") unreadable ??= file;
|
|
198
232
|
continue;
|
|
199
233
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
234
|
+
patterns.push(...bashRulePatterns(raw, ["deny", "ask"], 4));
|
|
235
|
+
}
|
|
236
|
+
return { patterns, unreadable };
|
|
237
|
+
}
|
|
238
|
+
function bashRulePatterns(doc, keys, depth = 0) {
|
|
239
|
+
if (!isRecord(doc)) return [];
|
|
240
|
+
const out = [];
|
|
241
|
+
const permissions = doc.permissions;
|
|
242
|
+
if (isRecord(permissions)) {
|
|
243
|
+
for (const key of keys) {
|
|
203
244
|
const rules = permissions[key];
|
|
204
245
|
if (!Array.isArray(rules)) continue;
|
|
205
246
|
for (const rule of rules) {
|
|
206
247
|
if (typeof rule !== "string") continue;
|
|
207
248
|
const trimmed = rule.trim();
|
|
208
249
|
if (trimmed === "Bash") {
|
|
209
|
-
|
|
250
|
+
out.push("*");
|
|
210
251
|
continue;
|
|
211
252
|
}
|
|
212
253
|
const match = /^Bash\((.*)\)$/s.exec(trimmed);
|
|
213
|
-
if (match?.[1] !== void 0)
|
|
254
|
+
if (match?.[1] !== void 0) out.push(match[1]);
|
|
214
255
|
}
|
|
215
256
|
}
|
|
216
257
|
}
|
|
217
|
-
|
|
258
|
+
if (depth > 0) {
|
|
259
|
+
for (const [key, value] of Object.entries(doc)) {
|
|
260
|
+
if (key !== "permissions") out.push(...bashRulePatterns(value, keys, depth - 1));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return out;
|
|
264
|
+
}
|
|
265
|
+
function setsTrue(doc, key, depth) {
|
|
266
|
+
if (!isRecord(doc)) return false;
|
|
267
|
+
if (doc[key] === true) return true;
|
|
268
|
+
return depth > 0 && Object.values(doc).some((v) => setsTrue(v, key, depth - 1));
|
|
269
|
+
}
|
|
270
|
+
var CLAUDE_RULE_FLAGS = /(?:^|\s)--(?:disallowedTools|disallowed-tools|settings|setting-sources)(?=[=\s]|$)/;
|
|
271
|
+
var ANCESTOR_DEPTH = 8;
|
|
272
|
+
function ancestorCommandText() {
|
|
273
|
+
const chain = [];
|
|
274
|
+
let pid = process.ppid;
|
|
275
|
+
if (process.platform === "linux") {
|
|
276
|
+
const lines = [];
|
|
277
|
+
for (let d = 0; d < ANCESTOR_DEPTH && pid > 1; d++) {
|
|
278
|
+
try {
|
|
279
|
+
lines.push(readFileSync(`/proc/${pid}/cmdline`, "utf-8").split("\0").join(" "));
|
|
280
|
+
const stat = readFileSync(`/proc/${pid}/stat`, "utf-8");
|
|
281
|
+
pid = Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]);
|
|
282
|
+
} catch {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return lines.join("\n");
|
|
287
|
+
}
|
|
288
|
+
const ps = (args) => {
|
|
289
|
+
try {
|
|
290
|
+
return execFileSync("ps", args, {
|
|
291
|
+
encoding: "utf-8",
|
|
292
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
293
|
+
timeout: 5e3,
|
|
294
|
+
maxBuffer: 32 * 1024 * 1024
|
|
295
|
+
});
|
|
296
|
+
} catch {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
const table = ps(["-A", "-o", "pid=,ppid="]);
|
|
301
|
+
if (table === null) return null;
|
|
302
|
+
const parent = /* @__PURE__ */ new Map();
|
|
303
|
+
for (const line of table.split("\n")) {
|
|
304
|
+
const m = /^\s*(\d+)\s+(\d+)\s*$/.exec(line);
|
|
305
|
+
if (m?.[1] && m[2]) parent.set(Number(m[1]), Number(m[2]));
|
|
306
|
+
}
|
|
307
|
+
for (let d = 0; d < ANCESTOR_DEPTH && pid > 1; d++) {
|
|
308
|
+
chain.push(pid);
|
|
309
|
+
const next = parent.get(pid);
|
|
310
|
+
if (next === void 0) break;
|
|
311
|
+
pid = next;
|
|
312
|
+
}
|
|
313
|
+
if (chain.length === 0) return null;
|
|
314
|
+
return ps(["-ww", "-o", "args=", "-p", chain.join(",")]);
|
|
315
|
+
}
|
|
316
|
+
function claudeAllowContext(projectDir, env) {
|
|
317
|
+
const user = env.USER || env.LOGNAME;
|
|
318
|
+
const profileDir = "/Library/Managed Preferences";
|
|
319
|
+
const profiles = process.platform === "darwin" ? [
|
|
320
|
+
join(profileDir, "com.anthropic.claudecode.plist"),
|
|
321
|
+
...user ? [join(profileDir, user, "com.anthropic.claudecode.plist")] : []
|
|
322
|
+
].filter((f) => existsSync(f)) : [];
|
|
323
|
+
return {
|
|
324
|
+
managedFiles: claudeManagedFiles(env),
|
|
325
|
+
profiles,
|
|
326
|
+
settingsFiles: claudeSettingsFiles(projectDir, env),
|
|
327
|
+
ancestors: ancestorCommandText(),
|
|
328
|
+
platform: process.platform
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function claudeAllowedBashRules(ctx, env) {
|
|
332
|
+
const untrusted = (reason) => ({ trusted: false, reason });
|
|
333
|
+
if (ctx.platform === "win32") {
|
|
334
|
+
return untrusted(
|
|
335
|
+
"managed policy on Windows lives in the registry, which the hook does not read"
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
if (env.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST) {
|
|
339
|
+
return untrusted("a host application supplies managed settings");
|
|
340
|
+
}
|
|
341
|
+
if (env.CLAUDE_CODE_ENTRYPOINT?.startsWith("sdk")) {
|
|
342
|
+
return untrusted("an Agent SDK session chooses its own settings sources");
|
|
343
|
+
}
|
|
344
|
+
if (ctx.profiles.length > 0) {
|
|
345
|
+
return untrusted(
|
|
346
|
+
`a managed configuration profile (${ctx.profiles[0]}) may restrict permission rules`
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
for (const file of ctx.managedFiles) {
|
|
350
|
+
let doc;
|
|
351
|
+
try {
|
|
352
|
+
doc = JSON.parse(readFileSync(file, "utf-8"));
|
|
353
|
+
} catch (err) {
|
|
354
|
+
const code = err.code;
|
|
355
|
+
if (code === "ENOENT" || code === "ENOTDIR") continue;
|
|
356
|
+
return untrusted(`managed settings ${file} cannot be read or parsed`);
|
|
357
|
+
}
|
|
358
|
+
if (setsTrue(doc, "allowManagedPermissionRulesOnly", 4)) {
|
|
359
|
+
return untrusted("managed settings make managed permission rules the only ones that apply");
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (ctx.ancestors === null) {
|
|
363
|
+
return untrusted(
|
|
364
|
+
"the Claude Code command line cannot be read for --disallowedTools or --settings"
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
if (CLAUDE_RULE_FLAGS.test(ctx.ancestors)) {
|
|
368
|
+
return untrusted(
|
|
369
|
+
"Claude Code was started with --disallowedTools, --settings or --setting-sources, whose rules the hook cannot read"
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
const patterns = [];
|
|
373
|
+
for (const file of ctx.settingsFiles) {
|
|
374
|
+
try {
|
|
375
|
+
patterns.push(
|
|
376
|
+
...bashRulePatterns(JSON.parse(readFileSync(file, "utf-8")), ["allow"])
|
|
377
|
+
);
|
|
378
|
+
} catch {
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return { trusted: true, patterns };
|
|
218
382
|
}
|
|
219
383
|
function codexGuardedWords(projectDir, env) {
|
|
220
384
|
const home = env.CODEX_HOME || join(env.HOME || homedir(), ".codex");
|
|
@@ -241,16 +405,23 @@ function codexGuardedWords(projectDir, env) {
|
|
|
241
405
|
}
|
|
242
406
|
return out;
|
|
243
407
|
}
|
|
244
|
-
function guardedHeavyCommand(provider, segments, projectDir, env, files = claudeRuleFiles(projectDir, env)) {
|
|
408
|
+
function guardedHeavyCommand(provider, segments, projectDir, env, files = claudeRuleFiles(projectDir, env), matches) {
|
|
245
409
|
let rules;
|
|
246
410
|
if (provider === "claude-code") {
|
|
247
411
|
const found = claudeGuardedBashRules(files);
|
|
248
412
|
if (found.unreadable !== null) return { kind: "unreadable", file: found.unreadable };
|
|
249
413
|
rules = found.patterns.map(ruleWords);
|
|
250
414
|
if (rules.some((words) => words.length === 0)) return { kind: "all" };
|
|
415
|
+
const governed = segments.map(
|
|
416
|
+
(s) => s.governed.slice(Math.max(0, s.governed.indexOf("cleo run ")))
|
|
417
|
+
);
|
|
418
|
+
if (matches && found.patterns.some((p) => governed.some((text) => matches(p, text)))) {
|
|
419
|
+
return { kind: "governed" };
|
|
420
|
+
}
|
|
251
421
|
} else if (provider === "codex") {
|
|
252
422
|
const words = codexGuardedWords(projectDir, env);
|
|
253
423
|
rules = words.length === 0 ? [] : [words];
|
|
424
|
+
if (words.includes("cleo")) return { kind: "governed" };
|
|
254
425
|
} else {
|
|
255
426
|
return null;
|
|
256
427
|
}
|
|
@@ -274,7 +445,7 @@ function guardedHeavyCommand(provider, segments, projectDir, env, files = claude
|
|
|
274
445
|
function providerProjectDir(provider, env) {
|
|
275
446
|
return provider === "claude-code" ? env.CLAUDE_PROJECT_DIR || void 0 : void 0;
|
|
276
447
|
}
|
|
277
|
-
async function heavyCommandHook(provider, stdin, io) {
|
|
448
|
+
async function heavyCommandHook(provider, stdin, io, deps = {}) {
|
|
278
449
|
const envMode = io.env.CLEO_HEAVY_COMMAND_HOOK?.trim().toLowerCase();
|
|
279
450
|
if (envMode === "off") return "";
|
|
280
451
|
const input = parseHookInput(stdin);
|
|
@@ -300,20 +471,51 @@ async function heavyCommandHook(provider, stdin, io) {
|
|
|
300
471
|
);
|
|
301
472
|
}
|
|
302
473
|
if (!core.executableOnPath("cleo", io.env.PATH)) plan = demote(plan, "`cleo` is not on PATH");
|
|
303
|
-
|
|
474
|
+
const permissionMode = input.permission_mode ?? "";
|
|
475
|
+
let preApproved = false;
|
|
476
|
+
if (plan.action === "rewrite" && provider === "claude-code" && PRE_APPROVE_MODES.has(permissionMode)) {
|
|
477
|
+
const projectDir = io.env.CLAUDE_PROJECT_DIR;
|
|
478
|
+
const verdict = claudePreApprovalVerdict(
|
|
479
|
+
input.tool_input.command,
|
|
480
|
+
cwd,
|
|
481
|
+
io.env,
|
|
482
|
+
core,
|
|
483
|
+
projectDir && deps.allowContext ? deps.allowContext(projectDir, io.env) : void 0
|
|
484
|
+
);
|
|
485
|
+
preApproved = verdict.approved;
|
|
486
|
+
if (!verdict.approved && !REWRITE_MODES.has(permissionMode)) {
|
|
487
|
+
plan = demote(
|
|
488
|
+
plan,
|
|
489
|
+
`rewriting it would change which permission rules match it, so in ${permissionMode} mode the hook rewrites only a command your Claude Code allow rules already approve, and ${verdict.reason} (bypassPermissions or auto mode rewrite every heavy command)`
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
if (provider !== "kimi" && !preApproved && !REWRITE_MODES.has(permissionMode)) {
|
|
304
494
|
plan = demote(
|
|
305
495
|
plan,
|
|
306
496
|
`rewriting it would change which permission rules match it, so the hook rewrites only in bypassPermissions or auto mode (this session: ${input.permission_mode ?? "unknown"})`
|
|
307
497
|
);
|
|
308
498
|
}
|
|
309
499
|
if (plan.action === "rewrite") {
|
|
310
|
-
const hit = guardedHeavyCommand(
|
|
500
|
+
const hit = guardedHeavyCommand(
|
|
501
|
+
provider,
|
|
502
|
+
plan.segments,
|
|
503
|
+
projectRoot,
|
|
504
|
+
io.env,
|
|
505
|
+
claudeRuleFiles(projectRoot, io.env),
|
|
506
|
+
core.claudeBashRuleMatches
|
|
507
|
+
);
|
|
311
508
|
const where = provider === "codex" ? "Codex rules" : "Claude Code settings";
|
|
312
509
|
if (hit?.kind === "word") {
|
|
313
510
|
plan = demote(
|
|
314
511
|
plan,
|
|
315
512
|
`a deny or ask rule in your ${where} names \`${hit.word}\`, and a rewrite would hide the command from it`
|
|
316
513
|
);
|
|
514
|
+
} else if (hit?.kind === "governed") {
|
|
515
|
+
plan = demote(
|
|
516
|
+
plan,
|
|
517
|
+
`a deny or ask rule in your ${where} matches \`cleo run\`, which the rewrite would run`
|
|
518
|
+
);
|
|
317
519
|
} else if (hit?.kind === "all") {
|
|
318
520
|
plan = demote(
|
|
319
521
|
plan,
|
|
@@ -327,7 +529,22 @@ async function heavyCommandHook(provider, stdin, io) {
|
|
|
327
529
|
}
|
|
328
530
|
}
|
|
329
531
|
const context = heavyHookContext(plan, await core.heavyPressureNotice(), provider);
|
|
330
|
-
return renderHeavyHookAnswer(
|
|
532
|
+
return renderHeavyHookAnswer(
|
|
533
|
+
provider,
|
|
534
|
+
input.tool_input,
|
|
535
|
+
plan,
|
|
536
|
+
context,
|
|
537
|
+
budget.timeoutMs,
|
|
538
|
+
preApproved && plan.action === "rewrite"
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
function claudePreApprovalVerdict(command, cwd, env, core, ctx) {
|
|
542
|
+
const projectDir = env.CLAUDE_PROJECT_DIR;
|
|
543
|
+
if (!projectDir) return { approved: false, reason: "CLAUDE_PROJECT_DIR is not set" };
|
|
544
|
+
const rules = claudeAllowedBashRules(ctx ?? claudeAllowContext(projectDir, env), env);
|
|
545
|
+
if (!rules.trusted) return { approved: false, reason: rules.reason };
|
|
546
|
+
const verdict = core.claudePreApproval(command, rules.patterns, { cwd, workingDir: projectDir });
|
|
547
|
+
return verdict.approved ? verdict : { approved: false, reason: `it is not pre-approved: ${verdict.reason}` };
|
|
331
548
|
}
|
|
332
549
|
var USAGE = "usage: cleo hook heavy-command [--provider claude-code|codex|kimi|opencode] < hook-input.json\n";
|
|
333
550
|
async function runHookCli(argv, io = processHookIo()) {
|
|
@@ -356,8 +573,16 @@ async function runHookCli(argv, io = processHookIo()) {
|
|
|
356
573
|
}
|
|
357
574
|
export {
|
|
358
575
|
HEAVY_HOOK_PROVIDERS,
|
|
576
|
+
ancestorCommandText,
|
|
577
|
+
bashRulePatterns,
|
|
578
|
+
claudeAllowContext,
|
|
579
|
+
claudeAllowedBashRules,
|
|
359
580
|
claudeGuardedBashRules,
|
|
581
|
+
claudeManagedDir,
|
|
582
|
+
claudeManagedFiles,
|
|
583
|
+
claudePreApprovalVerdict,
|
|
360
584
|
claudeRuleFiles,
|
|
585
|
+
claudeSettingsFiles,
|
|
361
586
|
codexGuardedWords,
|
|
362
587
|
guardedHeavyCommand,
|
|
363
588
|
heavyCommandHook,
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
|
|
20
|
+
// packages/cleo/src/cli/commands/hygiene.ts
|
|
21
|
+
import { getProjectRoot } from "@cleocode/core";
|
|
22
|
+
import { runSpawnReadinessHygieneCli } from "@cleocode/core/hygiene/validate-spawn-readiness.js";
|
|
23
|
+
var hygieneCommand = defineCommand({
|
|
24
|
+
meta: {
|
|
25
|
+
name: "hygiene",
|
|
26
|
+
description: "Run spawn-readiness hygiene checks"
|
|
27
|
+
},
|
|
28
|
+
subCommands: {
|
|
29
|
+
"validate-spawn-readiness": defineCommand({
|
|
30
|
+
meta: {
|
|
31
|
+
name: "validate-spawn-readiness",
|
|
32
|
+
description: "Run all pre-spawn hygiene gates (changeset lint, changelog drift, worktree location)"
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
"project-root": {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Project root directory (default: auto-detect)"
|
|
38
|
+
},
|
|
39
|
+
"worktree-path": {
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "Expected worktree path for location validation"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
async run({ args }) {
|
|
45
|
+
const projectRoot = args["project-root"] || getProjectRoot() || process.cwd();
|
|
46
|
+
const worktreePath = args["worktree-path"];
|
|
47
|
+
await runSpawnReadinessHygieneCli(projectRoot, worktreePath);
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
hygieneCommand
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=hygiene-3QZ2NI7P.js.map
|