@plebeiantech/lat.md 0.12.3-fork.9 → 0.13.4-fork.2
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 +27 -3
- package/dist/src/cli/agent-invocation.d.ts +6 -0
- package/dist/src/cli/agent-invocation.js +23 -0
- package/dist/src/cli/checklist-menu.d.ts +2 -1
- package/dist/src/cli/checklist-menu.js +3 -2
- package/dist/src/cli/fork-instructions.d.ts +1 -0
- package/dist/src/cli/fork-instructions.js +8 -32
- package/dist/src/cli/fork-scaffold.js +2 -2
- package/dist/src/cli/graph.d.ts +1 -1
- package/dist/src/cli/hook.d.ts +26 -0
- package/dist/src/cli/hook.js +115 -64
- package/dist/src/cli/index.js +178 -70
- package/dist/src/cli/init-preferences.d.ts +4 -0
- package/dist/src/cli/init-preferences.js +36 -0
- package/dist/src/cli/init.d.ts +2 -1
- package/dist/src/cli/init.js +100 -60
- package/dist/src/cli/reindex.d.ts +1 -1
- package/dist/src/cli/reindex.js +7 -10
- package/dist/src/cli/search.d.ts +14 -4
- package/dist/src/cli/search.js +115 -101
- package/dist/src/cli/ui-build-server.d.ts +12 -0
- package/dist/src/cli/ui-build-server.js +26 -0
- package/dist/src/cli/ui-build.d.ts +1 -1
- package/dist/src/cli/ui-build.js +1 -1
- package/dist/src/cli/ui.d.ts +1 -1
- package/dist/src/cli/ui.js +1 -1
- package/dist/src/cli/wiki.d.ts +12 -0
- package/dist/src/cli/wiki.js +85 -0
- package/dist/src/fork/antigravity-hook.d.ts +47 -0
- package/dist/src/fork/antigravity-hook.js +424 -0
- package/dist/src/fork/antigravity-init.d.ts +17 -0
- package/dist/src/fork/antigravity-init.js +124 -0
- package/dist/src/fork/upstream-drift.js +1 -1
- package/dist/src/fork/upstream-guard.d.ts +1 -1
- package/dist/src/fork/upstream-guard.js +8 -7
- package/dist/src/graph-export.js +7 -7
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/mcp/server.js +34 -18
- package/dist/src/search/cache.d.ts +3 -0
- package/dist/src/search/cache.js +104 -0
- package/dist/src/search/chunks.d.ts +23 -0
- package/dist/src/search/chunks.js +200 -0
- package/dist/src/search/db.d.ts +28 -16
- package/dist/src/search/db.js +100 -40
- package/dist/src/search/embedder.d.ts +2 -1
- package/dist/src/search/embedder.js +7 -6
- package/dist/src/search/index.d.ts +6 -2
- package/dist/src/search/index.js +176 -70
- package/dist/src/search/lexical.d.ts +6 -0
- package/dist/src/search/lexical.js +36 -0
- package/dist/src/search/lock.d.ts +5 -0
- package/dist/src/search/lock.js +45 -0
- package/dist/src/search/query.d.ts +26 -0
- package/dist/src/search/query.js +103 -0
- package/dist/src/search/search.d.ts +16 -7
- package/dist/src/search/search.js +165 -21
- package/dist/src/search/types.d.ts +15 -0
- package/dist/src/view/client/assets/GraphView-D_xnk0bP.js +456 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/src/view/client/assets/MarkdownEditor-bjqt_FoF.js +28 -0
- package/dist/src/view/client/assets/OrbitControls-DwcpQNja.js +1 -0
- package/dist/src/view/client/assets/STLLoader-CLWTKt5i.js +1 -0
- package/dist/src/view/client/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/src/view/client/assets/abnfDiagram-VCTEODGH-kWGvtRnL.js +1 -0
- package/dist/src/view/client/assets/arc-BPAFd7cP.js +1 -0
- package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-CsY39oIR.js +36 -0
- package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-DHGBG7BJ.js +129 -0
- package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-vywK4eb7.js +38 -0
- package/dist/src/view/client/assets/channel-CX71L_qV.js +1 -0
- package/dist/src/view/client/assets/chunk-2Q5K7J3B-Do3Hz_ci.js +1 -0
- package/dist/src/view/client/assets/chunk-5VM5RSS4-B5R1lSeY.js +15 -0
- package/dist/src/view/client/assets/chunk-F27PBJKO-Dm55FM_W.js +1 -0
- package/dist/src/view/client/assets/chunk-IMKFNOWR-ChptrvvM.js +231 -0
- package/dist/src/view/client/assets/chunk-JWPE2WC7-BRQBjrKS.js +1 -0
- package/dist/src/view/client/assets/chunk-POPQ4Y6H-CainVZIL.js +1 -0
- package/dist/src/view/client/assets/chunk-SVP7TREG-DsKsNGmM.js +88 -0
- package/dist/src/view/client/assets/chunk-TICWLB2K-BctkMcJc.js +206 -0
- package/dist/src/view/client/assets/chunk-XXDRQBXY-BN7SgOUT.js +1 -0
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-B1VyU6zO.js +1 -0
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-B1VyU6zO.js +1 -0
- package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-BszzwrMe.js +1 -0
- package/dist/src/view/client/assets/cynefin-OW5HDTMX-CdRyAkPs.js +166 -0
- package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-BLvKPZ1u.js +62 -0
- package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
- package/dist/src/view/client/assets/dagre-GXQ25YYZ-V68w_l65.js +4 -0
- package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/src/view/client/assets/diagram-S7CK7UJ4-C2i4eEMg.js +30 -0
- package/dist/src/view/client/assets/diagram-UQ7AKVKN-BiwWh5jC.js +41 -0
- package/dist/src/view/client/assets/diagram-VSXAHHWV-hkKR_vyS.js +3 -0
- package/dist/src/view/client/assets/diagram-VX7I27RA-DzRCSMAc.js +24 -0
- package/dist/src/view/client/assets/diagram-Z3DM3KII-fhSFPxyK.js +24 -0
- package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-CCEUDKSA.js +1 -0
- package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-FJ2IMyTi.js +99 -0
- package/dist/src/view/client/assets/flowDiagram-HODETNUW-BvasdLeK.js +168 -0
- package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-CiwkBZvY.js +292 -0
- package/dist/src/view/client/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/src/view/client/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/src/view/client/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/src/view/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/dist/src/view/client/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/src/view/client/assets/gitGraphDiagram-WWUBYQGX-DYlP2_js.js +106 -0
- package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
- package/dist/src/view/client/assets/index-CQ7EOox7.css +1 -0
- package/dist/src/view/client/assets/index-CynNDkxt.js +13 -0
- package/dist/src/view/client/assets/infoDiagram-27XIBGKW-DRPB2c48.js +2 -0
- package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-8VV429Cv.js +70 -0
- package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-Dzmwnf83.js +139 -0
- package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-pYyZZ1i-.js +89 -0
- package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/src/view/client/assets/layout-GF9k6yGo.js +1 -0
- package/dist/src/view/client/assets/linear-Yt2sSOYV.js +1 -0
- package/dist/src/view/client/assets/logo-RR_KBOAT.svg +149 -0
- package/dist/src/view/client/assets/maplibre-gl-CDX6Zuow.js +800 -0
- package/dist/src/view/client/assets/mermaid.core-ChWYCHN0.js +310 -0
- package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-Cc4fQvf1.js +96 -0
- package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-C0SsB8bZ.js +1 -0
- package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-DIJpqERZ.js +39 -0
- package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC--d-gl6j-.js +7 -0
- package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-BQxwTt7z.js +1 -0
- package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-B_oTeD2A.js +84 -0
- package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-DLukmE8X.js +40 -0
- package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-BNjVB2sc.js +162 -0
- package/dist/src/view/client/assets/sizeCapture-INFHLROL-BZecQTOw.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-D77RDMKH-Bu1urvXC.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-5pc_697G.js +1 -0
- package/dist/src/view/client/assets/swimlanes-42K2YHIH-bLAlcepB.js +1 -0
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-BbOpZjpp.js +8 -0
- package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
- package/dist/src/view/client/assets/timeline-definition-24CTP7MA-tbwCNvcA.js +120 -0
- package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-D8U8Fk0N.js +34 -0
- package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-LHBVIeNb.js +78 -0
- package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-CN4tfaFV.js +7 -0
- package/dist/src/view/client/index.html +2 -2
- package/dist/src/view/client-shell.d.ts +2 -0
- package/dist/src/view/client-shell.js +5 -0
- package/dist/src/view/diagnostics.d.ts +3 -2
- package/dist/src/view/diagnostics.js +49 -58
- package/dist/src/view/document-edit.d.ts +8 -0
- package/dist/src/view/document-edit.js +25 -0
- package/dist/src/view/document-route.d.ts +14 -0
- package/dist/src/view/document-route.js +137 -0
- package/dist/src/view/document-tree.d.ts +18 -0
- package/dist/src/view/document-tree.js +139 -0
- package/dist/src/view/external-document-tree.d.ts +3 -0
- package/dist/src/view/external-document-tree.js +674 -0
- package/dist/src/view/git-diff.js +202 -2
- package/dist/src/view/git.js +1 -1
- package/dist/src/view/graph.d.ts +4 -3
- package/dist/src/view/graph.js +100 -9
- package/dist/src/view/highlight.d.ts +10 -2
- package/dist/src/view/highlight.js +50648 -3166
- package/dist/src/view/markdown.d.ts +3 -2
- package/dist/src/view/markdown.js +256 -54
- package/dist/src/view/preindexed-search.d.ts +15 -0
- package/dist/src/view/preindexed-search.js +25 -0
- package/dist/src/view/protocol.d.ts +53 -7
- package/dist/src/view/publication.d.ts +2 -0
- package/dist/src/view/publication.js +78 -0
- package/dist/src/view/references.d.ts +11 -26
- package/dist/src/view/references.js +121 -112
- package/dist/src/view/repository.d.ts +14 -4
- package/dist/src/view/repository.js +260 -19
- package/dist/src/view/request-security.d.ts +5 -0
- package/dist/src/view/request-security.js +46 -0
- package/dist/src/view/search-result.d.ts +4 -0
- package/dist/src/view/search-result.js +25 -0
- package/dist/src/view/search.d.ts +7 -2
- package/dist/src/view/search.js +23 -34
- package/dist/src/view/server-build.d.ts +21 -0
- package/dist/src/view/server-build.js +145 -0
- package/dist/src/view/server-deployment.d.ts +31 -0
- package/dist/src/view/server-deployment.js +123 -0
- package/dist/src/view/server-index-worker.d.ts +6 -0
- package/dist/src/view/server-index-worker.js +14 -0
- package/dist/src/view/server.d.ts +11 -2
- package/dist/src/view/server.js +245 -73
- package/dist/src/view/source-target.d.ts +2 -0
- package/dist/src/view/source-target.js +49 -8
- package/dist/src/view/static-build.d.ts +18 -2
- package/dist/src/view/static-build.js +449 -110
- package/dist/src/view/static-protocol.d.ts +26 -2
- package/dist/src/view/static-protocol.js +5 -0
- package/dist/src/view/store.d.ts +20 -3
- package/dist/src/view/store.js +304 -48
- package/dist/src/view/table-of-contents.d.ts +2 -2
- package/dist/src/view/table-of-contents.js +2 -22
- package/dist/src/view/vercel-build.d.ts +24 -0
- package/dist/src/view/vercel-build.js +152 -0
- package/dist/src/view/vercel-server-build.d.ts +10 -0
- package/dist/src/view/vercel-server-build.js +61 -0
- package/dist/src/wiki/catalog.d.ts +21 -0
- package/dist/src/wiki/catalog.js +256 -0
- package/dist/src/wiki/publish.d.ts +27 -0
- package/dist/src/wiki/publish.js +265 -0
- package/dist/src/wiki/render.d.ts +20 -0
- package/dist/src/wiki/render.js +163 -0
- package/dist/src/wiki/transform.d.ts +7 -0
- package/dist/src/wiki/transform.js +264 -0
- package/dist/vendor/lat.md-server/cli.d.ts +2 -0
- package/dist/vendor/lat.md-server/cli.js +12 -0
- package/dist/vendor/lat.md-server/index.d.ts +38 -0
- package/dist/vendor/lat.md-server/index.js +128 -0
- package/package.json +68 -22
- package/plugins/lat-md/README.md +61 -0
- package/plugins/lat-md/hooks.json +38 -0
- package/plugins/lat-md/plugin.json +9 -0
- package/plugins/lat-md/rules/AGENTS.md +344 -0
- package/plugins/lat-md/skills/lat-md/SKILL.md +210 -0
- package/plugins/lat-md/skills/lat-md-conventions/SKILL.md +226 -0
- package/templates/AGENTS.md +26 -7
- package/templates/cursor-rules.md +23 -7
- package/templates/fork/conventions.md +133 -11
- package/templates/opencode-plugin.ts +9 -9
- package/templates/pi-extension.ts +11 -11
- package/templates/skill/SKILL.md +35 -3
- package/dist/src/cli/check-coverage.d.ts +0 -2
- package/dist/src/cli/check-coverage.js +0 -71
- package/dist/src/cli/check-frontmatter.d.ts +0 -12
- package/dist/src/cli/check-frontmatter.js +0 -44
- package/dist/src/cli/check-mode.d.ts +0 -21
- package/dist/src/cli/check-mode.js +0 -364
- package/dist/src/cli/check-status.d.ts +0 -74
- package/dist/src/cli/check-status.js +0 -217
- package/dist/src/cli/check.d.ts +0 -45
- package/dist/src/cli/check.js +0 -781
- package/dist/src/cli/context.d.ts +0 -11
- package/dist/src/cli/context.js +0 -58
- package/dist/src/cli/expand.d.ts +0 -8
- package/dist/src/cli/expand.js +0 -94
- package/dist/src/cli/gen-index.d.ts +0 -45
- package/dist/src/cli/gen-index.js +0 -235
- package/dist/src/cli/link-scheme.d.ts +0 -54
- package/dist/src/cli/link-scheme.js +0 -101
- package/dist/src/cli/locate.d.ts +0 -2
- package/dist/src/cli/locate.js +0 -17
- package/dist/src/cli/refs.d.ts +0 -22
- package/dist/src/cli/refs.js +0 -229
- package/dist/src/cli/section.d.ts +0 -43
- package/dist/src/cli/section.js +0 -252
- package/dist/src/cli/select-menu.d.ts +0 -13
- package/dist/src/cli/select-menu.js +0 -100
- package/dist/src/code-refs.d.ts +0 -17
- package/dist/src/code-refs.js +0 -298
- package/dist/src/config.d.ts +0 -29
- package/dist/src/config.js +0 -83
- package/dist/src/context.d.ts +0 -23
- package/dist/src/context.js +0 -11
- package/dist/src/extensions/wiki-link/from-markdown.d.ts +0 -5
- package/dist/src/extensions/wiki-link/from-markdown.js +0 -34
- package/dist/src/extensions/wiki-link/index.d.ts +0 -4
- package/dist/src/extensions/wiki-link/index.js +0 -3
- package/dist/src/extensions/wiki-link/syntax.d.ts +0 -14
- package/dist/src/extensions/wiki-link/syntax.js +0 -121
- package/dist/src/extensions/wiki-link/to-markdown.d.ts +0 -5
- package/dist/src/extensions/wiki-link/to-markdown.js +0 -28
- package/dist/src/extensions/wiki-link/types.d.ts +0 -34
- package/dist/src/format.d.ts +0 -8
- package/dist/src/format.js +0 -43
- package/dist/src/init-version.d.ts +0 -10
- package/dist/src/init-version.js +0 -49
- package/dist/src/lattice.d.ts +0 -109
- package/dist/src/lattice.js +0 -817
- package/dist/src/parser.d.ts +0 -3
- package/dist/src/parser.js +0 -18
- package/dist/src/source-parser.d.ts +0 -27
- package/dist/src/source-parser.js +0 -916
- package/dist/src/untrusted.d.ts +0 -18
- package/dist/src/untrusted.js +0 -93
- package/dist/src/view/client/assets/index-C3iaZyYT.css +0 -1
- package/dist/src/view/client/assets/index-KWi67IMz.js +0 -334
- package/dist/src/view/client/assets/logo-CNF8zs47.svg +0 -182
- package/dist/src/walk.d.ts +0 -18
- package/dist/src/walk.js +0 -27
- /package/dist/src/{extensions/wiki-link → search}/types.js +0 -0
package/dist/src/cli/index.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Suppress deprecation warnings from transitive dependencies unless --verbose
|
|
3
|
-
if (!process.argv.includes('--verbose')) {
|
|
4
|
-
process.noDeprecation = true;
|
|
5
|
-
}
|
|
6
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
7
|
-
import { dirname, join } from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
9
2
|
import { Command, InvalidArgumentError } from 'commander';
|
|
10
|
-
import {
|
|
3
|
+
import { handleResult, packageVersion, } from '@plebeiantech/lat.md-core/cli';
|
|
4
|
+
import { resolveContext } from '@plebeiantech/lat.md-core/cli/context';
|
|
5
|
+
import { DEFAULT_SEARCH_LIMIT, DEFAULT_MIN_SIMILARITY, } from '../search/search.js';
|
|
11
6
|
function parsePort(value) {
|
|
12
7
|
if (!/^\d+$/.test(value)) {
|
|
13
8
|
throw new InvalidArgumentError('port must be an integer from 1 to 65535');
|
|
@@ -18,8 +13,27 @@ function parsePort(value) {
|
|
|
18
13
|
}
|
|
19
14
|
return port;
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
function parseUiServerBuildTarget(value) {
|
|
17
|
+
if (value !== 'node' && value !== 'vercel') {
|
|
18
|
+
throw new InvalidArgumentError('target must be node or vercel');
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function configureUiRun(command) {
|
|
23
|
+
return command
|
|
24
|
+
.option('--logo-text <text>', 'top-left logo text')
|
|
25
|
+
.option('--no-git', 'disable Git working-tree integration')
|
|
26
|
+
.option('--port <number>', 'server port (default: 4242; explicit ports are strict)', parsePort);
|
|
27
|
+
}
|
|
28
|
+
function parseSimilarityThreshold(value) {
|
|
29
|
+
const threshold = Number(value);
|
|
30
|
+
if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
|
|
31
|
+
throw new InvalidArgumentError('min-similarity must be a number from 0 to 1');
|
|
32
|
+
}
|
|
33
|
+
return threshold;
|
|
34
|
+
}
|
|
35
|
+
import { resolveCheckContext } from '@plebeiantech/lat.md-core/cli/context';
|
|
36
|
+
function splitCheckTarget(args, name) {
|
|
23
37
|
let commandIndex = -1;
|
|
24
38
|
for (let i = 0; i < args.length; i++) {
|
|
25
39
|
const arg = args[i];
|
|
@@ -42,7 +56,7 @@ function splitCheckTarget(args) {
|
|
|
42
56
|
return { args };
|
|
43
57
|
const targets = args.slice(separatorIndex + 1);
|
|
44
58
|
if (targets.length !== 1 || targets[0] === '') {
|
|
45
|
-
console.error(
|
|
59
|
+
console.error(`error: \`${name} check --\` expects exactly one directory after \`--\``);
|
|
46
60
|
process.exit(1);
|
|
47
61
|
}
|
|
48
62
|
return {
|
|
@@ -50,45 +64,27 @@ function splitCheckTarget(args) {
|
|
|
50
64
|
target: targets[0],
|
|
51
65
|
};
|
|
52
66
|
}
|
|
53
|
-
const checkTargetArgs = splitCheckTarget(process.argv.slice(2));
|
|
54
|
-
function findPackageJson() {
|
|
55
|
-
let dir = dirname(fileURLToPath(import.meta.url));
|
|
56
|
-
while (true) {
|
|
57
|
-
const candidate = join(dir, 'package.json');
|
|
58
|
-
try {
|
|
59
|
-
return JSON.parse(readFileSync(candidate, 'utf-8')).version;
|
|
60
|
-
}
|
|
61
|
-
catch { }
|
|
62
|
-
const parent = dirname(dir);
|
|
63
|
-
if (parent === dir)
|
|
64
|
-
return '0.0.0';
|
|
65
|
-
dir = parent;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function handleResult(result) {
|
|
69
|
-
if (result.isError) {
|
|
70
|
-
console.error(result.output);
|
|
71
|
-
process.exit(1);
|
|
72
|
-
}
|
|
73
|
-
if (result.output)
|
|
74
|
-
console.log(result.output);
|
|
75
|
-
}
|
|
76
|
-
const version = findPackageJson();
|
|
67
|
+
const checkTargetArgs = splitCheckTarget(process.argv.slice(2), 'lat');
|
|
77
68
|
const program = new Command();
|
|
78
69
|
program
|
|
79
70
|
.name('lat')
|
|
71
|
+
.version(packageVersion(import.meta.url))
|
|
80
72
|
.description('Anchor source code to high-level concepts defined in markdown')
|
|
81
|
-
.version(version)
|
|
82
73
|
.option('--dir <path>', 'project root to look for lat.md in (default: cwd)')
|
|
83
74
|
.option('--no-color', 'disable color output')
|
|
84
75
|
.option('--verbose', 'show deprecation warnings and extra diagnostics');
|
|
76
|
+
if (checkTargetArgs.args.includes('--verbose'))
|
|
77
|
+
process.noDeprecation = false;
|
|
78
|
+
else
|
|
79
|
+
process.noDeprecation = true;
|
|
80
|
+
const args = checkTargetArgs.args;
|
|
85
81
|
program
|
|
86
82
|
.command('locate')
|
|
87
|
-
.description('Find
|
|
88
|
-
.argument('<query>', '
|
|
83
|
+
.description('Find section(s) by name or text')
|
|
84
|
+
.argument('<query>', 'name or text to search for')
|
|
89
85
|
.action(async (query) => {
|
|
90
86
|
const ctx = resolveContext(program.opts());
|
|
91
|
-
const { locateCommand } = await import('
|
|
87
|
+
const { locateCommand } = await import('@plebeiantech/lat.md-core/cli/locate');
|
|
92
88
|
handleResult(await locateCommand(ctx, query));
|
|
93
89
|
});
|
|
94
90
|
program
|
|
@@ -97,30 +93,63 @@ program
|
|
|
97
93
|
.argument('<query>', 'section id to look up')
|
|
98
94
|
.action(async (query) => {
|
|
99
95
|
const ctx = resolveContext(program.opts());
|
|
100
|
-
const { sectionCommand } = await import('
|
|
96
|
+
const { sectionCommand } = await import('@plebeiantech/lat.md-core/cli/section');
|
|
101
97
|
handleResult(await sectionCommand(ctx, query));
|
|
102
98
|
});
|
|
103
|
-
|
|
104
|
-
.command('
|
|
105
|
-
.description('
|
|
106
|
-
.option('--
|
|
107
|
-
.
|
|
108
|
-
|
|
99
|
+
program
|
|
100
|
+
.command('paths')
|
|
101
|
+
.description('Show configuration, cache, and temporary file locations')
|
|
102
|
+
.option('--config', 'show only the user configuration file path')
|
|
103
|
+
.action(async (options) => {
|
|
104
|
+
const { pathsCommand } = await import('@plebeiantech/lat.md-core/cli/paths');
|
|
105
|
+
console.log(pathsCommand({ ...program.opts(), ...options, search: true }));
|
|
106
|
+
});
|
|
107
|
+
async function runUi(opts) {
|
|
109
108
|
const ctx = resolveContext(program.opts());
|
|
110
109
|
const { uiCommand } = await import('./ui.js');
|
|
111
|
-
handleResult(await uiCommand(ctx, {
|
|
110
|
+
handleResult(await uiCommand(ctx, {
|
|
111
|
+
git: opts.git,
|
|
112
|
+
logoText: opts.logoText,
|
|
113
|
+
port: opts.port,
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
const ui = configureUiRun(program.command('ui').description('Run or build the Lat UI')).action(runUi);
|
|
117
|
+
configureUiRun(ui.command('run').description('Run the local Lat UI server')).action(async (opts) => {
|
|
118
|
+
await runUi(opts);
|
|
112
119
|
});
|
|
113
|
-
ui.command('build')
|
|
114
|
-
|
|
115
|
-
.
|
|
120
|
+
const uiBuild = ui.command('build').description('Build a deployable Lat UI');
|
|
121
|
+
uiBuild
|
|
122
|
+
.command('static')
|
|
123
|
+
.description('Build a fully static, read-only Lat UI')
|
|
124
|
+
.argument('[output]', 'output directory relative to the project (default: .lat-build/static)', '.lat-build/static')
|
|
116
125
|
.option('--base <path>', 'deployment base path', '/')
|
|
126
|
+
.option('--force', 'replace an existing output path')
|
|
117
127
|
.option('--logo-text <text>', 'top-left logo text')
|
|
118
128
|
.action(async (output, opts) => {
|
|
119
129
|
const ctx = resolveContext(program.opts());
|
|
120
130
|
const { uiBuildCommand } = await import('./ui-build.js');
|
|
121
131
|
handleResult(await uiBuildCommand(ctx, output, {
|
|
122
132
|
basePath: opts.base,
|
|
133
|
+
force: opts.force,
|
|
134
|
+
logoText: opts.logoText ?? ui.opts().logoText,
|
|
135
|
+
}));
|
|
136
|
+
});
|
|
137
|
+
uiBuild
|
|
138
|
+
.command('server')
|
|
139
|
+
.description('Build a static Lat UI with a portable search server')
|
|
140
|
+
.argument('[output]', 'output directory (default: .lat-build/server for node, .vercel/output for vercel)')
|
|
141
|
+
.option('--base <path>', 'deployment base path', '/')
|
|
142
|
+
.option('--force', 'replace an existing output path')
|
|
143
|
+
.option('--logo-text <text>', 'top-left logo text')
|
|
144
|
+
.option('--target <target>', 'deployment target: node or vercel', parseUiServerBuildTarget, 'node')
|
|
145
|
+
.action(async (output, opts) => {
|
|
146
|
+
const ctx = resolveContext(program.opts());
|
|
147
|
+
const { uiBuildServerCommand } = await import('./ui-build-server.js');
|
|
148
|
+
handleResult(await uiBuildServerCommand(ctx, output, {
|
|
149
|
+
basePath: opts.base,
|
|
150
|
+
force: opts.force,
|
|
123
151
|
logoText: opts.logoText ?? ui.opts().logoText,
|
|
152
|
+
target: opts.target,
|
|
124
153
|
}));
|
|
125
154
|
});
|
|
126
155
|
program
|
|
@@ -135,18 +164,56 @@ program
|
|
|
135
164
|
process.exit(1);
|
|
136
165
|
}
|
|
137
166
|
const ctx = resolveContext(program.opts());
|
|
138
|
-
const { refsCommand } = await import('
|
|
167
|
+
const { refsCommand } = await import('@plebeiantech/lat.md-core/cli/refs');
|
|
139
168
|
handleResult(await refsCommand(ctx, query, scope));
|
|
140
169
|
});
|
|
170
|
+
const external = program
|
|
171
|
+
.command('external')
|
|
172
|
+
.description('Manage pinned external source repositories');
|
|
173
|
+
external
|
|
174
|
+
.command('add')
|
|
175
|
+
.argument('[handle]', 'stable external source handle')
|
|
176
|
+
.argument('[repo]', 'canonical HTTPS Git repository')
|
|
177
|
+
.option('--commit <commit-or-ref>', 'commit, branch, or tag to pin')
|
|
178
|
+
.option('--prefix <path>', 'repository path prefix')
|
|
179
|
+
.option('--default-file-extension <extension>', 'extension for external paths that omit one')
|
|
180
|
+
.option('--strategy <strategy>', 'retrieval strategy: fetch or checkout')
|
|
181
|
+
.option('--fetch-url <template>', 'raw-file URL template')
|
|
182
|
+
.action(async (handle, repo, opts) => {
|
|
183
|
+
const ctx = resolveContext(program.opts());
|
|
184
|
+
const { externalAddCommand } = await import('@plebeiantech/lat.md-core/cli/external');
|
|
185
|
+
handleResult(await externalAddCommand(ctx, handle, repo, opts));
|
|
186
|
+
});
|
|
187
|
+
external
|
|
188
|
+
.command('show')
|
|
189
|
+
.argument('<source>', 'handle or exact external target')
|
|
190
|
+
.option('--json', 'emit structured JSON')
|
|
191
|
+
.action(async (source, opts) => {
|
|
192
|
+
const ctx = resolveContext(program.opts());
|
|
193
|
+
const { externalShowCommand } = await import('@plebeiantech/lat.md-core/cli/external');
|
|
194
|
+
handleResult(await externalShowCommand(ctx, source, !!opts.json));
|
|
195
|
+
});
|
|
196
|
+
external
|
|
197
|
+
.command('list')
|
|
198
|
+
.option('--json', 'emit structured JSON')
|
|
199
|
+
.action(async (opts) => {
|
|
200
|
+
const ctx = resolveContext(program.opts());
|
|
201
|
+
const { externalListCommand } = await import('@plebeiantech/lat.md-core/cli/external');
|
|
202
|
+
handleResult(await externalListCommand(ctx, !!opts.json));
|
|
203
|
+
});
|
|
141
204
|
const check = program
|
|
142
205
|
.command('check')
|
|
143
206
|
.usage('[subcommand] [-- <directory>]')
|
|
144
207
|
.description('Validate markdown, links, code references, and structure')
|
|
145
208
|
.option('--fix', 'generate/update directory index files from frontmatter')
|
|
209
|
+
.option('--profile', 'show detailed validation timing')
|
|
146
210
|
.action(async (opts) => {
|
|
147
211
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
148
|
-
const { checkAllCommand } = await import('
|
|
149
|
-
handleResult(await checkAllCommand(ctx, {
|
|
212
|
+
const { checkAllCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
213
|
+
handleResult(await checkAllCommand(ctx, {
|
|
214
|
+
fix: opts.fix,
|
|
215
|
+
profile: !!opts.profile,
|
|
216
|
+
}));
|
|
150
217
|
});
|
|
151
218
|
check
|
|
152
219
|
.command('md')
|
|
@@ -154,7 +221,7 @@ check
|
|
|
154
221
|
.description('Validate wiki links in markdown files')
|
|
155
222
|
.action(async () => {
|
|
156
223
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
157
|
-
const { checkMdCommand } = await import('
|
|
224
|
+
const { checkMdCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
158
225
|
handleResult(await checkMdCommand(ctx));
|
|
159
226
|
});
|
|
160
227
|
check
|
|
@@ -163,7 +230,7 @@ check
|
|
|
163
230
|
.description('Validate relative markdown links')
|
|
164
231
|
.action(async () => {
|
|
165
232
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
166
|
-
const { checkLinksCommand } = await import('
|
|
233
|
+
const { checkLinksCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
167
234
|
handleResult(await checkLinksCommand(ctx));
|
|
168
235
|
});
|
|
169
236
|
check
|
|
@@ -172,7 +239,7 @@ check
|
|
|
172
239
|
.description('Validate @lat code references and coverage')
|
|
173
240
|
.action(async () => {
|
|
174
241
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
175
|
-
const { checkCodeRefsCommand } = await import('
|
|
242
|
+
const { checkCodeRefsCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
176
243
|
handleResult(await checkCodeRefsCommand(ctx));
|
|
177
244
|
});
|
|
178
245
|
check
|
|
@@ -187,7 +254,7 @@ check
|
|
|
187
254
|
// read it off `check.opts()` instead.
|
|
188
255
|
.action(async () => {
|
|
189
256
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
190
|
-
const { checkIndexCommand } = await import('
|
|
257
|
+
const { checkIndexCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
191
258
|
handleResult(await checkIndexCommand(ctx, { fix: check.opts().fix }));
|
|
192
259
|
});
|
|
193
260
|
check
|
|
@@ -196,7 +263,7 @@ check
|
|
|
196
263
|
.description('Validate section leading paragraphs')
|
|
197
264
|
.action(async () => {
|
|
198
265
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
199
|
-
const { checkSectionsCommand } = await import('
|
|
266
|
+
const { checkSectionsCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
200
267
|
handleResult(await checkSectionsCommand(ctx));
|
|
201
268
|
});
|
|
202
269
|
check
|
|
@@ -205,7 +272,7 @@ check
|
|
|
205
272
|
.description('Validate Diátaxis modes and document shape')
|
|
206
273
|
.action(async () => {
|
|
207
274
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
208
|
-
const { checkModeCommand } = await import('
|
|
275
|
+
const { checkModeCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
209
276
|
handleResult(await checkModeCommand(ctx));
|
|
210
277
|
});
|
|
211
278
|
check
|
|
@@ -214,7 +281,7 @@ check
|
|
|
214
281
|
.description('Validate provenance status and detect stale reviews')
|
|
215
282
|
.action(async () => {
|
|
216
283
|
const ctx = resolveCheckContext(program.opts(), checkTargetArgs.target);
|
|
217
|
-
const { checkStatusCommand } = await import('
|
|
284
|
+
const { checkStatusCommand } = await import('@plebeiantech/lat.md-core/cli/check');
|
|
218
285
|
handleResult(await checkStatusCommand(ctx));
|
|
219
286
|
});
|
|
220
287
|
async function runExpand(text, opts) {
|
|
@@ -230,7 +297,7 @@ async function runExpand(text, opts) {
|
|
|
230
297
|
process.exit(1);
|
|
231
298
|
}
|
|
232
299
|
const ctx = resolveContext(program.opts());
|
|
233
|
-
const { expandCommand } = await import('
|
|
300
|
+
const { expandCommand } = await import('@plebeiantech/lat.md-core/cli/expand');
|
|
234
301
|
const result = await expandCommand(ctx, text);
|
|
235
302
|
if (result.isError) {
|
|
236
303
|
console.error(result.output);
|
|
@@ -256,14 +323,26 @@ program
|
|
|
256
323
|
});
|
|
257
324
|
program
|
|
258
325
|
.command('search')
|
|
259
|
-
.description('
|
|
326
|
+
.description('Hybrid search across lat.md sections')
|
|
260
327
|
.argument('[query]', 'search query in plain English')
|
|
261
|
-
.option('--limit <n>',
|
|
328
|
+
.option('--limit <n>', `max results (default: ${DEFAULT_SEARCH_LIMIT})`, String(DEFAULT_SEARCH_LIMIT))
|
|
329
|
+
.option('--preview <variant>', 'preview passage, intro, or both', (value) => {
|
|
330
|
+
if (!['passage', 'intro', 'both'].includes(value))
|
|
331
|
+
throw new InvalidArgumentError('preview must be passage, intro, or both');
|
|
332
|
+
return value;
|
|
333
|
+
}, 'passage')
|
|
334
|
+
.option('--debug', 'show retrieval scores and candidate diagnostics')
|
|
335
|
+
.option('--min-similarity <score>', `minimum cosine similarity score (default: ${DEFAULT_MIN_SIMILARITY})`, parseSimilarityThreshold)
|
|
262
336
|
.action(async (query, opts) => {
|
|
263
337
|
const ctx = resolveContext(program.opts());
|
|
264
338
|
const { searchCommand, cliProgress } = await import('./search.js');
|
|
265
339
|
const progress = cliProgress(ctx.styler);
|
|
266
|
-
const result = await searchCommand(ctx, query, {
|
|
340
|
+
const result = await searchCommand(ctx, query, {
|
|
341
|
+
limit: parseInt(opts.limit),
|
|
342
|
+
debug: opts.debug,
|
|
343
|
+
minSimilarity: opts.minSimilarity,
|
|
344
|
+
preview: opts.preview,
|
|
345
|
+
}, progress);
|
|
267
346
|
handleResult(result);
|
|
268
347
|
});
|
|
269
348
|
program
|
|
@@ -310,13 +389,11 @@ program
|
|
|
310
389
|
await startMcpServer();
|
|
311
390
|
});
|
|
312
391
|
program
|
|
313
|
-
.command('config')
|
|
314
|
-
.description('
|
|
392
|
+
.command('config', { hidden: true })
|
|
393
|
+
.description('Alias for paths --config')
|
|
315
394
|
.action(async () => {
|
|
316
|
-
const {
|
|
317
|
-
|
|
318
|
-
const exists = existsSync(configPath);
|
|
319
|
-
console.log(`Config file: ${configPath}${exists ? '' : ' (not found)'}`);
|
|
395
|
+
const { pathsCommand } = await import('@plebeiantech/lat.md-core/cli/paths');
|
|
396
|
+
console.log(pathsCommand({ config: true }));
|
|
320
397
|
});
|
|
321
398
|
program
|
|
322
399
|
.command('graph')
|
|
@@ -329,4 +406,35 @@ program
|
|
|
329
406
|
const { graphCommand } = await import('./graph.js');
|
|
330
407
|
handleResult(await graphCommand(ctx, opts));
|
|
331
408
|
});
|
|
409
|
+
const wikiCmd = program
|
|
410
|
+
.command('wiki')
|
|
411
|
+
.description('Publish Diátaxis documentation to GitHub Wiki');
|
|
412
|
+
wikiCmd
|
|
413
|
+
.command('build [output]')
|
|
414
|
+
.description('Build GitHub Wiki pages into a directory')
|
|
415
|
+
.option('--repo <owner/repo-or-url>', 'GitHub repository to resolve blob links against')
|
|
416
|
+
.option('--ref <ref>', 'Git revision for source links')
|
|
417
|
+
.action(async (output, opts) => {
|
|
418
|
+
const ctx = resolveContext(program.opts());
|
|
419
|
+
const { wikiBuildCommand } = await import('./wiki.js');
|
|
420
|
+
try {
|
|
421
|
+
handleResult(await wikiBuildCommand(ctx, output, opts));
|
|
422
|
+
}
|
|
423
|
+
catch (err) {
|
|
424
|
+
handleResult({ output: err.message, isError: true });
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
wikiCmd
|
|
428
|
+
.command('publish')
|
|
429
|
+
.description('Publish GitHub Wiki pages to companion .wiki.git repository')
|
|
430
|
+
.option('--remote <remote-or-url>', 'Git remote or URL (default: origin)')
|
|
431
|
+
.option('--repo <owner/repo-or-url>', 'GitHub repository for blob links')
|
|
432
|
+
.option('--ref <ref>', 'Git revision for source links')
|
|
433
|
+
.option('--message <message>', 'Commit message for the wiki push')
|
|
434
|
+
.option('--dry-run', 'Commit locally in the clone without pushing')
|
|
435
|
+
.action(async (opts) => {
|
|
436
|
+
const ctx = resolveContext(program.opts());
|
|
437
|
+
const { wikiPublishCommand } = await import('./wiki.js');
|
|
438
|
+
handleResult(await wikiPublishCommand(ctx, opts));
|
|
439
|
+
});
|
|
332
440
|
await program.parseAsync(checkTargetArgs.args, { from: 'user' });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Read machine-local checklist defaults without inferring installed agents. */
|
|
2
|
+
export declare function readInitAgents(latDir: string): string[];
|
|
3
|
+
/** Update just the confirmed selection, preserving other YAML and comments. */
|
|
4
|
+
export declare function writeInitAgents(latDir: string, agents: string[]): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { projectWritePath, writeProjectFile, } from '@plebeiantech/lat.md-core/project-write';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { isMap, parseDocument } from 'yaml';
|
|
5
|
+
function readPreferences(latDir) {
|
|
6
|
+
const path = projectWritePath(dirname(latDir), join(latDir, 'config.local.yaml'));
|
|
7
|
+
const document = parseDocument(existsSync(path) ? readFileSync(path, 'utf8') : '');
|
|
8
|
+
if (document.errors.length > 0) {
|
|
9
|
+
throw new Error(`Cannot parse ${path}: ${document.errors[0].message}`);
|
|
10
|
+
}
|
|
11
|
+
if (document.contents !== null && !isMap(document.contents)) {
|
|
12
|
+
throw new Error(`${path} must be a mapping`);
|
|
13
|
+
}
|
|
14
|
+
if (document.has('init') && !isMap(document.get('init', true))) {
|
|
15
|
+
throw new Error(`${path}: init must be a mapping`);
|
|
16
|
+
}
|
|
17
|
+
return { path, document };
|
|
18
|
+
}
|
|
19
|
+
/** Read machine-local checklist defaults without inferring installed agents. */
|
|
20
|
+
export function readInitAgents(latDir) {
|
|
21
|
+
const { path, document } = readPreferences(latDir);
|
|
22
|
+
const agents = document.toJS()?.init?.agents;
|
|
23
|
+
if (agents === undefined)
|
|
24
|
+
return [];
|
|
25
|
+
if (!Array.isArray(agents) ||
|
|
26
|
+
agents.some((agent) => typeof agent !== 'string')) {
|
|
27
|
+
throw new Error(`${path}: init.agents must be a list of strings`);
|
|
28
|
+
}
|
|
29
|
+
return agents;
|
|
30
|
+
}
|
|
31
|
+
/** Update just the confirmed selection, preserving other YAML and comments. */
|
|
32
|
+
export function writeInitAgents(latDir, agents) {
|
|
33
|
+
const { path, document } = readPreferences(latDir);
|
|
34
|
+
document.setIn(['init', 'agents'], agents);
|
|
35
|
+
writeProjectFile(dirname(latDir), path, document.toString());
|
|
36
|
+
}
|
package/dist/src/cli/init.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ type LatCommandStyle = 'global' | 'local' | 'npx';
|
|
|
3
3
|
* Remove all lat-owned hook entries from settings, then add fresh ones.
|
|
4
4
|
* Preserves any non-lat hooks the user may have configured.
|
|
5
5
|
*/
|
|
6
|
-
export declare function syncLatHooks(settingsPath: string, style: LatCommandStyle, agent?: 'claude' | 'codex'): void;
|
|
6
|
+
export declare function syncLatHooks(settingsPath: string, style: LatCommandStyle, agent?: 'claude' | 'codex', root?: string): void;
|
|
7
7
|
export declare function readLogo(): string;
|
|
8
|
+
export declare function ensureLatLocalConfigIgnored(latDir: string): void;
|
|
8
9
|
export declare function initCmd(targetDir?: string): Promise<void>;
|
|
9
10
|
export {};
|