@plebeiantech/lat.md 0.12.3-fork.8 → 0.13.4-fork.1
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 +147 -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/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 -53
- 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/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-VZwPPiFE.js +0 -334
- package/dist/src/view/client/assets/index-W8ktvNj9.css +0 -1
- 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/init.js
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { agentInvocation } from './agent-invocation.js';
|
|
2
|
+
import { projectWritePath, writeProjectFile, } from '@plebeiantech/lat.md-core/project-write';
|
|
3
|
+
import { existsSync, cpSync, mkdirSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
5
|
import { execSync } from 'node:child_process';
|
|
4
6
|
import { createInterface } from 'node:readline/promises';
|
|
5
7
|
import { styleText } from 'node:util';
|
|
6
8
|
import { createEmbedder } from '@lat.md/embed';
|
|
7
9
|
import { findTemplatesDir } from './templates.js';
|
|
8
10
|
import { readAgentsTemplate, readCursorRulesTemplate, readPiExtensionTemplate, readOpenCodePluginTemplate, readSkillTemplate, } from './gen.js';
|
|
9
|
-
import { getLlmKey, getRepoEmbedding, setRepoEmbedding } from '
|
|
10
|
-
import { makeStyler } from '
|
|
11
|
-
import { closeDb,
|
|
11
|
+
import { getLlmKey, getRepoEmbedding, setRepoEmbedding, } from '@plebeiantech/lat.md-core/config';
|
|
12
|
+
import { makeStyler } from '@plebeiantech/lat.md-core/cli/context';
|
|
13
|
+
import { closeDb, getStoredModel, openDb } from '../search/db.js';
|
|
12
14
|
import { modelKey } from '../search/embedder.js';
|
|
13
15
|
import { reindexCommand } from './reindex.js';
|
|
14
|
-
import { INIT_VERSION, writeInitMeta, readInitVersion, readFileHash, contentHash, } from '
|
|
16
|
+
import { INIT_VERSION, writeInitMeta, readInitVersion, readFileHash, contentHash, } from '@plebeiantech/lat.md-core/init-version';
|
|
15
17
|
import { getLocalVersion, fetchLatestVersion } from '../version.js';
|
|
16
|
-
import { selectMenu } from '
|
|
18
|
+
import { selectMenu, } from '@plebeiantech/lat.md-core/cli/select-menu';
|
|
17
19
|
import { checklistMenu } from './checklist-menu.js';
|
|
18
20
|
import { writeForkInstructions } from './fork-instructions.js';
|
|
19
21
|
import { offerRequireMode, writeForkScaffold } from './fork-scaffold.js';
|
|
22
|
+
import { setupAntigravity } from '../fork/antigravity-init.js';
|
|
23
|
+
import { readInitAgents, writeInitAgents } from './init-preferences.js';
|
|
20
24
|
async function confirm(rl, message) {
|
|
21
25
|
while (true) {
|
|
22
26
|
let answer;
|
|
@@ -122,7 +126,8 @@ function isLatHookEntry(entry) {
|
|
|
122
126
|
* Remove all lat-owned hook entries from settings, then add fresh ones.
|
|
123
127
|
* Preserves any non-lat hooks the user may have configured.
|
|
124
128
|
*/
|
|
125
|
-
export function syncLatHooks(settingsPath, style, agent = 'claude') {
|
|
129
|
+
export function syncLatHooks(settingsPath, style, agent = 'claude', root = dirname(dirname(settingsPath))) {
|
|
130
|
+
projectWritePath(root, settingsPath);
|
|
126
131
|
let settings = {};
|
|
127
132
|
if (existsSync(settingsPath)) {
|
|
128
133
|
const raw = readFileSync(settingsPath, 'utf-8');
|
|
@@ -174,7 +179,7 @@ export function syncLatHooks(settingsPath, style, agent = 'claude') {
|
|
|
174
179
|
},
|
|
175
180
|
],
|
|
176
181
|
});
|
|
177
|
-
|
|
182
|
+
writeProjectFile(root, settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
178
183
|
}
|
|
179
184
|
function cursorHooksTemplate(style) {
|
|
180
185
|
return (JSON.stringify({
|
|
@@ -195,7 +200,7 @@ function cursorHooksTemplate(style) {
|
|
|
195
200
|
}
|
|
196
201
|
// ── Gitignore helper ─────────────────────────────────────────────────
|
|
197
202
|
function ensureGitignored(root, entry) {
|
|
198
|
-
const gitignorePath = join(root, '.gitignore');
|
|
203
|
+
const gitignorePath = projectWritePath(root, join(root, '.gitignore'));
|
|
199
204
|
const gitDir = join(root, '.git');
|
|
200
205
|
// Check if already ignored
|
|
201
206
|
if (existsSync(gitignorePath)) {
|
|
@@ -231,12 +236,12 @@ function ensureGitignored(root, entry) {
|
|
|
231
236
|
let content = readFileSync(gitignorePath, 'utf-8');
|
|
232
237
|
if (!content.endsWith('\n'))
|
|
233
238
|
content += '\n';
|
|
234
|
-
|
|
239
|
+
writeProjectFile(root, gitignorePath, content + entry + '\n');
|
|
235
240
|
console.log(styleText('green', ` Added ${entry}`) + ' to .gitignore');
|
|
236
241
|
}
|
|
237
242
|
else if (existsSync(gitDir)) {
|
|
238
243
|
// Create .gitignore with the entry
|
|
239
|
-
|
|
244
|
+
writeProjectFile(root, gitignorePath, entry + '\n');
|
|
240
245
|
console.log(styleText('green', ` Created .gitignore`) + ` with ${entry}`);
|
|
241
246
|
}
|
|
242
247
|
else {
|
|
@@ -259,7 +264,8 @@ function mcpCommand() {
|
|
|
259
264
|
args: [...args, 'mcp'],
|
|
260
265
|
};
|
|
261
266
|
}
|
|
262
|
-
function hasMcpServer(configPath, key) {
|
|
267
|
+
function hasMcpServer(root, configPath, key) {
|
|
268
|
+
projectWritePath(root, configPath);
|
|
263
269
|
if (!existsSync(configPath))
|
|
264
270
|
return false;
|
|
265
271
|
try {
|
|
@@ -271,7 +277,8 @@ function hasMcpServer(configPath, key) {
|
|
|
271
277
|
return false;
|
|
272
278
|
}
|
|
273
279
|
}
|
|
274
|
-
function addMcpServer(configPath, key, style) {
|
|
280
|
+
function addMcpServer(root, configPath, key, style) {
|
|
281
|
+
projectWritePath(root, configPath);
|
|
275
282
|
let cfg = { [key]: {} };
|
|
276
283
|
if (existsSync(configPath)) {
|
|
277
284
|
const raw = readFileSync(configPath, 'utf-8');
|
|
@@ -286,14 +293,15 @@ function addMcpServer(configPath, key, style) {
|
|
|
286
293
|
}
|
|
287
294
|
cfg[key].lat = styledMcpCommand(style);
|
|
288
295
|
mkdirSync(join(configPath, '..'), { recursive: true });
|
|
289
|
-
|
|
296
|
+
writeProjectFile(root, configPath, JSON.stringify(cfg, null, 2) + '\n');
|
|
290
297
|
}
|
|
291
298
|
// ── Codex TOML MCP helpers ────────────────────────────────────────────
|
|
292
299
|
/**
|
|
293
300
|
* Check whether `.codex/config.toml` already contains an `[mcp_servers.lat]`
|
|
294
301
|
* table. We use a simple regex match — no TOML parser needed.
|
|
295
302
|
*/
|
|
296
|
-
function hasCodexMcpServer(configPath) {
|
|
303
|
+
function hasCodexMcpServer(root, configPath) {
|
|
304
|
+
projectWritePath(root, configPath);
|
|
297
305
|
if (!existsSync(configPath))
|
|
298
306
|
return false;
|
|
299
307
|
try {
|
|
@@ -318,7 +326,8 @@ function hasCodexMcpServer(configPath) {
|
|
|
318
326
|
* args = ["mcp"]
|
|
319
327
|
* ```
|
|
320
328
|
*/
|
|
321
|
-
function addCodexMcpServer(configPath, style) {
|
|
329
|
+
function addCodexMcpServer(root, configPath, style) {
|
|
330
|
+
projectWritePath(root, configPath);
|
|
322
331
|
const cmd = styledMcpCommand(style);
|
|
323
332
|
// Format args as a TOML inline array of quoted strings
|
|
324
333
|
const argsToml = '[' + cmd.args.map((a) => `"${a}"`).join(', ') + ']';
|
|
@@ -329,10 +338,10 @@ function addCodexMcpServer(configPath, style) {
|
|
|
329
338
|
if (!content.endsWith('\n'))
|
|
330
339
|
content += '\n';
|
|
331
340
|
content += '\n' + block;
|
|
332
|
-
|
|
341
|
+
writeProjectFile(root, configPath, content);
|
|
333
342
|
}
|
|
334
343
|
else {
|
|
335
|
-
|
|
344
|
+
writeProjectFile(root, configPath, block);
|
|
336
345
|
}
|
|
337
346
|
}
|
|
338
347
|
// ── Template file helpers ─────────────────────────────────────────────
|
|
@@ -343,11 +352,11 @@ function addCodexMcpServer(configPath, style) {
|
|
|
343
352
|
* Returns the hash of the written content, or null if the file was skipped.
|
|
344
353
|
*/
|
|
345
354
|
async function writeTemplateFile(root, latDir, relPath, template, genTarget, label, indent, ask) {
|
|
346
|
-
const absPath = join(root, relPath);
|
|
355
|
+
const absPath = projectWritePath(root, join(root, relPath));
|
|
347
356
|
const templateHash = contentHash(template);
|
|
348
357
|
if (!existsSync(absPath)) {
|
|
349
358
|
mkdirSync(join(absPath, '..'), { recursive: true });
|
|
350
|
-
|
|
359
|
+
writeProjectFile(root, absPath, template);
|
|
351
360
|
console.log(styleText('green', `${indent}Created ${label}`));
|
|
352
361
|
return templateHash;
|
|
353
362
|
}
|
|
@@ -362,7 +371,7 @@ async function writeTemplateFile(root, latDir, relPath, template, genTarget, lab
|
|
|
362
371
|
}
|
|
363
372
|
if (storedHash && currentHash === storedHash) {
|
|
364
373
|
// Unmodified by user — safe to overwrite with new template
|
|
365
|
-
|
|
374
|
+
writeProjectFile(root, absPath, template);
|
|
366
375
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
367
376
|
return templateHash;
|
|
368
377
|
}
|
|
@@ -370,7 +379,7 @@ async function writeTemplateFile(root, latDir, relPath, template, genTarget, lab
|
|
|
370
379
|
console.log(styleText('yellow', `${indent}${label}`) +
|
|
371
380
|
' exists and may contain your own content.');
|
|
372
381
|
if (await ask(`${indent}Overwrite with latest lat template?`)) {
|
|
373
|
-
|
|
382
|
+
writeProjectFile(root, absPath, template);
|
|
374
383
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
375
384
|
return templateHash;
|
|
376
385
|
}
|
|
@@ -412,12 +421,12 @@ function wrapWithMarkers(template) {
|
|
|
412
421
|
* Returns the hash of the written template content, or null if skipped.
|
|
413
422
|
*/
|
|
414
423
|
async function appendTemplateSection(root, latDir, relPath, template, label, indent, ask) {
|
|
415
|
-
const absPath = join(root, relPath);
|
|
424
|
+
const absPath = projectWritePath(root, join(root, relPath));
|
|
416
425
|
const templateHash = contentHash(template);
|
|
417
426
|
const wrapped = wrapWithMarkers(template);
|
|
418
427
|
if (!existsSync(absPath)) {
|
|
419
428
|
mkdirSync(join(absPath, '..'), { recursive: true });
|
|
420
|
-
|
|
429
|
+
writeProjectFile(root, absPath, wrapped);
|
|
421
430
|
console.log(styleText('green', `${indent}Created ${label}`));
|
|
422
431
|
return templateHash;
|
|
423
432
|
}
|
|
@@ -441,7 +450,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
441
450
|
const updated = currentContent.slice(0, beginIdx) +
|
|
442
451
|
wrapped +
|
|
443
452
|
currentContent.slice(endWithNl);
|
|
444
|
-
|
|
453
|
+
writeProjectFile(root, absPath, updated);
|
|
445
454
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
446
455
|
return templateHash;
|
|
447
456
|
}
|
|
@@ -455,7 +464,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
455
464
|
const updated = currentContent.slice(0, beginIdx) +
|
|
456
465
|
wrapped +
|
|
457
466
|
currentContent.slice(endWithNl);
|
|
458
|
-
|
|
467
|
+
writeProjectFile(root, absPath, updated);
|
|
459
468
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
460
469
|
return templateHash;
|
|
461
470
|
}
|
|
@@ -468,7 +477,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
468
477
|
const storedHash = readFileHash(latDir, relPath);
|
|
469
478
|
if (storedHash && currentHash === storedHash) {
|
|
470
479
|
// Unmodified old-style file — migrate: wrap existing content with markers
|
|
471
|
-
|
|
480
|
+
writeProjectFile(root, absPath, wrapWithMarkers(currentContent));
|
|
472
481
|
console.log(styleText('green', `${indent}Migrated ${label}`) + ' to marker format');
|
|
473
482
|
// Return hash of what's now in the section (the old content)
|
|
474
483
|
return currentHash;
|
|
@@ -478,7 +487,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
478
487
|
if (!content.endsWith('\n'))
|
|
479
488
|
content += '\n';
|
|
480
489
|
content += '\n' + wrapped;
|
|
481
|
-
|
|
490
|
+
writeProjectFile(root, absPath, content);
|
|
482
491
|
console.log(styleText('green', `${indent}Appended lat section to ${label}`));
|
|
483
492
|
return templateHash;
|
|
484
493
|
}
|
|
@@ -497,19 +506,15 @@ async function setupAgentsMd(root, latDir, template, hashes, ask) {
|
|
|
497
506
|
if (hash)
|
|
498
507
|
hashes['AGENTS.md'] = hash;
|
|
499
508
|
}
|
|
500
|
-
async function setupClaudeCode(root, latDir,
|
|
501
|
-
// CLAUDE.md — append-mode with markers (preserves user content)
|
|
502
|
-
const hash = await appendTemplateSection(root, latDir, 'CLAUDE.md', template, 'CLAUDE.md', ' ', ask);
|
|
503
|
-
if (hash)
|
|
504
|
-
hashes['CLAUDE.md'] = hash;
|
|
509
|
+
async function setupClaudeCode(root, latDir, hashes, ask, style) {
|
|
505
510
|
// Hooks — UserPromptSubmit (lat.md reminders + [[ref]] expansion) and Stop (update reminder)
|
|
506
511
|
console.log('');
|
|
507
512
|
console.log(styleText('dim', ' Hooks inject lat.md workflow reminders into every prompt and remind'));
|
|
508
513
|
console.log(styleText('dim', ' the agent to update lat.md/ before finishing.'));
|
|
509
|
-
const claudeDir = join(root, '.claude');
|
|
514
|
+
const claudeDir = projectWritePath(root, join(root, '.claude'));
|
|
510
515
|
const settingsPath = join(claudeDir, 'settings.json');
|
|
511
516
|
mkdirSync(claudeDir, { recursive: true });
|
|
512
|
-
syncLatHooks(settingsPath, style);
|
|
517
|
+
syncLatHooks(settingsPath, style, 'claude', root);
|
|
513
518
|
console.log(styleText('green', ' Hooks') +
|
|
514
519
|
' synced (UserPromptSubmit + Stop + PostToolUse)');
|
|
515
520
|
// .claude/skills/lat-md/SKILL.md — skill for authoring lat.md files
|
|
@@ -526,11 +531,11 @@ async function setupClaudeCode(root, latDir, template, hashes, ask, style) {
|
|
|
526
531
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
527
532
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
528
533
|
const mcpPath = join(root, '.mcp.json');
|
|
529
|
-
if (hasMcpServer(mcpPath, 'mcpServers')) {
|
|
534
|
+
if (hasMcpServer(root, mcpPath, 'mcpServers')) {
|
|
530
535
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
531
536
|
}
|
|
532
537
|
else {
|
|
533
|
-
addMcpServer(mcpPath, 'mcpServers', style);
|
|
538
|
+
addMcpServer(root, mcpPath, 'mcpServers', style);
|
|
534
539
|
console.log(styleText('green', ' MCP server') + ' registered in .mcp.json');
|
|
535
540
|
}
|
|
536
541
|
// Ensure .mcp.json is gitignored (it contains local absolute paths)
|
|
@@ -553,11 +558,11 @@ async function setupCursor(root, latDir, hashes, ask, style) {
|
|
|
553
558
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
554
559
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
555
560
|
const mcpPath = join(root, '.cursor', 'mcp.json');
|
|
556
|
-
if (hasMcpServer(mcpPath, 'mcpServers')) {
|
|
561
|
+
if (hasMcpServer(root, mcpPath, 'mcpServers')) {
|
|
557
562
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
558
563
|
}
|
|
559
564
|
else {
|
|
560
|
-
addMcpServer(mcpPath, 'mcpServers', style);
|
|
565
|
+
addMcpServer(root, mcpPath, 'mcpServers', style);
|
|
561
566
|
console.log(styleText('green', ' MCP server') + ' registered in .cursor/mcp.json');
|
|
562
567
|
}
|
|
563
568
|
// Ensure .cursor is gitignored (hooks and MCP config may contain local paths)
|
|
@@ -578,11 +583,11 @@ async function setupCopilot(root, latDir, hashes, ask, style) {
|
|
|
578
583
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
579
584
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
580
585
|
const mcpPath = join(root, '.vscode', 'mcp.json');
|
|
581
|
-
if (hasMcpServer(mcpPath, 'servers')) {
|
|
586
|
+
if (hasMcpServer(root, mcpPath, 'servers')) {
|
|
582
587
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
583
588
|
}
|
|
584
589
|
else {
|
|
585
|
-
addMcpServer(mcpPath, 'servers', style);
|
|
590
|
+
addMcpServer(root, mcpPath, 'servers', style);
|
|
586
591
|
console.log(styleText('green', ' MCP server') + ' registered in .vscode/mcp.json');
|
|
587
592
|
}
|
|
588
593
|
// .agents/skills/lat-md/SKILL.md — skill for authoring lat.md files
|
|
@@ -595,7 +600,7 @@ async function setupPi(root, latDir, hashes, ask, style) {
|
|
|
595
600
|
console.log('');
|
|
596
601
|
console.log(styleText('dim', ' The Pi extension registers lat tools and hooks into the agent lifecycle'));
|
|
597
602
|
console.log(styleText('dim', ' to inject search context and validate lat.md/ before finishing.'));
|
|
598
|
-
const template = readPiExtensionTemplate().replace('
|
|
603
|
+
const template = readPiExtensionTemplate().replace('__LAT_INVOCATION__', () => JSON.stringify(agentInvocation(style, resolveLatInvocation())));
|
|
599
604
|
const hash = await writeTemplateFile(root, latDir, '.pi/extensions/lat.ts', template, 'pi-extension.ts', 'Extension (.pi/extensions/lat.ts)', ' ', ask);
|
|
600
605
|
if (hash)
|
|
601
606
|
hashes['.pi/extensions/lat.ts'] = hash;
|
|
@@ -616,7 +621,7 @@ async function setupOpenCode(root, latDir, hashes, ask, style) {
|
|
|
616
621
|
console.log('');
|
|
617
622
|
console.log(styleText('dim', ' The OpenCode plugin registers lat tools and hooks into the session'));
|
|
618
623
|
console.log(styleText('dim', ' lifecycle to validate lat.md/ when the agent finishes.'));
|
|
619
|
-
const template = readOpenCodePluginTemplate().replace('
|
|
624
|
+
const template = readOpenCodePluginTemplate().replace('__LAT_INVOCATION__', () => JSON.stringify(agentInvocation(style, resolveLatInvocation())));
|
|
620
625
|
const hash = await writeTemplateFile(root, latDir, '.opencode/plugins/lat.ts', template, 'opencode-plugin.ts', 'Plugin (.opencode/plugins/lat.ts)', ' ', ask);
|
|
621
626
|
if (hash)
|
|
622
627
|
hashes['.opencode/plugins/lat.ts'] = hash;
|
|
@@ -632,10 +637,10 @@ async function setupCodex(root, latDir, hashes, ask, style) {
|
|
|
632
637
|
console.log('');
|
|
633
638
|
console.log(styleText('dim', ' Hooks inject lat.md workflow reminders into every prompt and remind'));
|
|
634
639
|
console.log(styleText('dim', ' the agent to update lat.md/ before finishing.'));
|
|
635
|
-
const codexDir = join(root, '.codex');
|
|
640
|
+
const codexDir = projectWritePath(root, join(root, '.codex'));
|
|
636
641
|
const hooksPath = join(codexDir, 'hooks.json');
|
|
637
642
|
mkdirSync(codexDir, { recursive: true });
|
|
638
|
-
syncLatHooks(hooksPath, style, 'codex');
|
|
643
|
+
syncLatHooks(hooksPath, style, 'codex', root);
|
|
639
644
|
console.log(styleText('green', ' Hooks') +
|
|
640
645
|
' synced (UserPromptSubmit + Stop + PostToolUse)');
|
|
641
646
|
// .codex/config.toml — MCP server registration
|
|
@@ -643,11 +648,11 @@ async function setupCodex(root, latDir, hashes, ask, style) {
|
|
|
643
648
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
644
649
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
645
650
|
const mcpPath = join(root, '.codex', 'config.toml');
|
|
646
|
-
if (hasCodexMcpServer(mcpPath)) {
|
|
651
|
+
if (hasCodexMcpServer(root, mcpPath)) {
|
|
647
652
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
648
653
|
}
|
|
649
654
|
else {
|
|
650
|
-
addCodexMcpServer(mcpPath, style);
|
|
655
|
+
addCodexMcpServer(root, mcpPath, style);
|
|
651
656
|
console.log(styleText('green', ' MCP server') + ' registered in .codex/config.toml');
|
|
652
657
|
}
|
|
653
658
|
// Ensure .codex is gitignored (config contains local absolute paths)
|
|
@@ -666,11 +671,10 @@ async function setupCodex(root, latDir, hashes, ask, style) {
|
|
|
666
671
|
' Run /hooks in Codex to review and trust the project hooks.');
|
|
667
672
|
}
|
|
668
673
|
async function readStoredEmbeddingModel(latDir) {
|
|
669
|
-
if (!existsSync(join(latDir, '.cache', '
|
|
674
|
+
if (!existsSync(join(latDir, '.cache', 'search.db')))
|
|
670
675
|
return null;
|
|
671
|
-
const db = openDb(latDir);
|
|
676
|
+
const db = openDb(latDir, undefined, true);
|
|
672
677
|
try {
|
|
673
|
-
await ensureMeta(db);
|
|
674
678
|
return await getStoredModel(db);
|
|
675
679
|
}
|
|
676
680
|
finally {
|
|
@@ -819,6 +823,7 @@ function printNextSteps(selectedAgents) {
|
|
|
819
823
|
pi: 'Pi',
|
|
820
824
|
opencode: 'OpenCode',
|
|
821
825
|
codex: 'Codex',
|
|
826
|
+
antigravity: 'Antigravity',
|
|
822
827
|
};
|
|
823
828
|
if (!hasClaudeCode && ideAgents.length === 0)
|
|
824
829
|
return;
|
|
@@ -841,6 +846,16 @@ function printNextSteps(selectedAgents) {
|
|
|
841
846
|
export function readLogo() {
|
|
842
847
|
return readFileSync(join(findTemplatesDir(), 'logo.txt'), 'utf-8');
|
|
843
848
|
}
|
|
849
|
+
export function ensureLatLocalConfigIgnored(latDir) {
|
|
850
|
+
const root = dirname(latDir);
|
|
851
|
+
const path = projectWritePath(root, join(latDir, '.gitignore'));
|
|
852
|
+
const entry = 'config.local.yaml';
|
|
853
|
+
const current = existsSync(path) ? readFileSync(path, 'utf8') : '';
|
|
854
|
+
if (current.split(/\r?\n/).includes(entry))
|
|
855
|
+
return;
|
|
856
|
+
const prefix = current && !current.endsWith('\n') ? `${current}\n` : current;
|
|
857
|
+
writeProjectFile(root, path, `${prefix}${entry}\n`);
|
|
858
|
+
}
|
|
844
859
|
export async function initCmd(targetDir) {
|
|
845
860
|
console.log(styleText('cyan', readLogo()));
|
|
846
861
|
// Upfront version check — let the user upgrade before proceeding
|
|
@@ -864,6 +879,7 @@ export async function initCmd(targetDir) {
|
|
|
864
879
|
}
|
|
865
880
|
const root = resolve(targetDir ?? process.cwd());
|
|
866
881
|
const latDir = join(root, 'lat.md');
|
|
882
|
+
projectWritePath(root, latDir);
|
|
867
883
|
const storedInitVersion = readInitVersion(latDir);
|
|
868
884
|
const interactive = process.stdin.isTTY ?? false;
|
|
869
885
|
// Readline is created AFTER the selectMenu loop below.
|
|
@@ -904,6 +920,8 @@ export async function initCmd(targetDir) {
|
|
|
904
920
|
console.log(styleText('green', 'Created lat.md/'));
|
|
905
921
|
writeForkScaffold(latDir);
|
|
906
922
|
}
|
|
923
|
+
ensureLatLocalConfigIgnored(latDir);
|
|
924
|
+
ensureGitignored(root, '.lat-build');
|
|
907
925
|
// Step 2: Configure fresh/outdated setups, ask interactive users about an
|
|
908
926
|
// available key, and offer to rebuild an index whose backend differs. This
|
|
909
927
|
// happens before agent selection so "no agents" still completes it.
|
|
@@ -917,21 +935,24 @@ export async function initCmd(targetDir) {
|
|
|
917
935
|
{ label: 'VS Code Copilot', value: 'copilot' },
|
|
918
936
|
{ label: 'OpenCode', value: 'opencode' },
|
|
919
937
|
{ label: 'Codex', value: 'codex' },
|
|
938
|
+
{ label: 'Antigravity / Gemini', value: 'antigravity' },
|
|
920
939
|
];
|
|
921
|
-
const selectedAgents = await checklistMenu(allAgents, 'Which coding agents do you use?');
|
|
940
|
+
const selectedAgents = await checklistMenu(allAgents, 'Which coding agents do you use?', readInitAgents(latDir));
|
|
922
941
|
const useClaudeCode = selectedAgents.includes('claude');
|
|
923
942
|
const usePi = selectedAgents.includes('pi');
|
|
924
943
|
const useCursor = selectedAgents.includes('cursor');
|
|
925
944
|
const useCopilot = selectedAgents.includes('copilot');
|
|
926
945
|
const useOpenCode = selectedAgents.includes('opencode');
|
|
927
946
|
const useCodex = selectedAgents.includes('codex');
|
|
947
|
+
const useAntigravity = selectedAgents.includes('antigravity');
|
|
928
948
|
const anySelected = selectedAgents.length > 0;
|
|
929
949
|
const needsLatCommand = useClaudeCode ||
|
|
930
950
|
usePi ||
|
|
931
951
|
useCursor ||
|
|
932
952
|
useCopilot ||
|
|
933
953
|
useOpenCode ||
|
|
934
|
-
useCodex
|
|
954
|
+
useCodex ||
|
|
955
|
+
useAntigravity;
|
|
935
956
|
// Step 4: How should agents run lat?
|
|
936
957
|
let commandStyle = 'local';
|
|
937
958
|
if (anySelected && needsLatCommand && interactive) {
|
|
@@ -963,6 +984,8 @@ export async function initCmd(targetDir) {
|
|
|
963
984
|
// agent. Stamp the version so future non-interactive runs do not reapply
|
|
964
985
|
// fresh/outdated defaults and overwrite the chosen backend.
|
|
965
986
|
writeInitMeta(latDir, {});
|
|
987
|
+
if (interactive)
|
|
988
|
+
writeInitAgents(latDir, selectedAgents);
|
|
966
989
|
console.log('');
|
|
967
990
|
console.log(styleText('dim', 'No agents selected. You can re-run') +
|
|
968
991
|
' lat init ' +
|
|
@@ -972,16 +995,13 @@ export async function initCmd(targetDir) {
|
|
|
972
995
|
console.log('');
|
|
973
996
|
const template = readAgentsTemplate();
|
|
974
997
|
const fileHashes = {};
|
|
975
|
-
// Step 5: AGENTS.md (shared by
|
|
976
|
-
|
|
977
|
-
if (needsAgentsMd) {
|
|
978
|
-
await setupAgentsMd(root, latDir, template, fileHashes, ask);
|
|
979
|
-
}
|
|
998
|
+
// Step 5: AGENTS.md (shared by all selected agents)
|
|
999
|
+
await setupAgentsMd(root, latDir, template, fileHashes, ask);
|
|
980
1000
|
// Step 6: Per-agent setup
|
|
981
1001
|
if (useClaudeCode) {
|
|
982
1002
|
console.log('');
|
|
983
1003
|
console.log(styleText('bold', 'Setting up Claude Code...'));
|
|
984
|
-
await setupClaudeCode(root, latDir,
|
|
1004
|
+
await setupClaudeCode(root, latDir, fileHashes, ask, commandStyle);
|
|
985
1005
|
}
|
|
986
1006
|
if (usePi) {
|
|
987
1007
|
console.log('');
|
|
@@ -1008,16 +1028,36 @@ export async function initCmd(targetDir) {
|
|
|
1008
1028
|
console.log(styleText('bold', 'Setting up Codex...'));
|
|
1009
1029
|
await setupCodex(root, latDir, fileHashes, ask, commandStyle);
|
|
1010
1030
|
}
|
|
1031
|
+
if (useAntigravity) {
|
|
1032
|
+
console.log('');
|
|
1033
|
+
console.log(styleText('bold', 'Setting up Antigravity / Gemini...'));
|
|
1034
|
+
await setupAntigravity({
|
|
1035
|
+
root,
|
|
1036
|
+
latDir,
|
|
1037
|
+
template,
|
|
1038
|
+
hashes: fileHashes,
|
|
1039
|
+
ask,
|
|
1040
|
+
style: commandStyle,
|
|
1041
|
+
latBin: latBinString(commandStyle),
|
|
1042
|
+
appendTemplateSection,
|
|
1043
|
+
writeTemplateFile,
|
|
1044
|
+
ensureGitignored,
|
|
1045
|
+
hasMcpServer,
|
|
1046
|
+
addMcpServer,
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1011
1049
|
await writeForkInstructions(root, latDir, fileHashes, ask);
|
|
1012
1050
|
// Record init version and file hashes so `lat check` can detect stale setups
|
|
1013
1051
|
writeInitMeta(latDir, fileHashes);
|
|
1052
|
+
if (interactive)
|
|
1053
|
+
writeInitAgents(latDir, selectedAgents);
|
|
1014
1054
|
console.log('');
|
|
1015
1055
|
console.log(styleText('green', 'Done!') +
|
|
1016
1056
|
' Run ' +
|
|
1017
1057
|
styleText('cyan', 'lat check') +
|
|
1018
1058
|
' to validate your setup.');
|
|
1019
1059
|
// Suggest ripgrep if not available
|
|
1020
|
-
const { hasRipgrep } = await import('
|
|
1060
|
+
const { hasRipgrep } = await import('@plebeiantech/lat.md-core/code-refs');
|
|
1021
1061
|
if (!(await hasRipgrep())) {
|
|
1022
1062
|
console.log('');
|
|
1023
1063
|
console.log(styleText('yellow', 'Tip:') +
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CmdContext, CmdResult } from '
|
|
1
|
+
import type { CmdContext, CmdResult } from '@plebeiantech/lat.md-core/context';
|
|
2
2
|
/**
|
|
3
3
|
* Rebuild the embedding index. Honors the durable per-repo backend preference:
|
|
4
4
|
* a repo pinned to local rebuilds local and ignores the key. `--local` forces
|
package/dist/src/cli/reindex.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { writeIndex } from '../search/cache.js';
|
|
1
2
|
import readline from 'node:readline/promises';
|
|
2
|
-
import {
|
|
3
|
+
import { ensureMeta, setStoredModel, ensureSectionsSchema, dropSections, } from '../search/db.js';
|
|
3
4
|
import { embedderFromEnv, localEmbedder, modelKey, EmbeddingAuthError, } from '../search/embedder.js';
|
|
4
|
-
import { getLlmKey, getRepoEmbedding, setRepoEmbedding } from '
|
|
5
|
+
import { getLlmKey, getRepoEmbedding, setRepoEmbedding, } from '@plebeiantech/lat.md-core/config';
|
|
5
6
|
import { indexSections } from '../search/index.js';
|
|
7
|
+
import { commandProjectAnalysis } from '@plebeiantech/lat.md-core/project-analysis';
|
|
6
8
|
const SPINNER = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
7
9
|
async function confirmUseLocal(ctx, status, assumeYes) {
|
|
8
10
|
const s = ctx.styler;
|
|
@@ -82,11 +84,9 @@ export async function reindexCommand(ctx, opts) {
|
|
|
82
84
|
embedder = await localEmbedder();
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
const db = openDb(ctx.latDir);
|
|
86
87
|
const interactive = ctx.mode === 'cli' && !!process.stderr.isTTY;
|
|
87
|
-
|
|
88
|
+
return writeIndex(ctx.latDir, undefined, true, async (db) => {
|
|
88
89
|
await ensureMeta(db);
|
|
89
|
-
await dropSections(db);
|
|
90
90
|
await ensureSectionsSchema(db, embedder.dimensions);
|
|
91
91
|
const label = `Reindexing with ${embedder.name}`;
|
|
92
92
|
// Interactive terminals get a live progress line driven per embed-chunk
|
|
@@ -106,7 +106,7 @@ export async function reindexCommand(ctx, opts) {
|
|
|
106
106
|
process.stderr.write(s.dim(label + '…\n'));
|
|
107
107
|
let stats;
|
|
108
108
|
try {
|
|
109
|
-
stats = await indexSections(ctx.latDir, db, embedder, onProgress);
|
|
109
|
+
stats = await indexSections(ctx.latDir, db, embedder, onProgress, await commandProjectAnalysis(ctx));
|
|
110
110
|
// Pin the backend only after a successful build, so a failed reindex never
|
|
111
111
|
// records a model that doesn't match a completed index.
|
|
112
112
|
await setStoredModel(db, modelKey(embedder));
|
|
@@ -129,8 +129,5 @@ export async function reindexCommand(ctx, opts) {
|
|
|
129
129
|
output: s.green(`Reindexed ${stats.added} sections`) +
|
|
130
130
|
` using ${s.cyan(embedder.name)}.`,
|
|
131
131
|
};
|
|
132
|
-
}
|
|
133
|
-
finally {
|
|
134
|
-
await closeDb(db);
|
|
135
|
-
}
|
|
132
|
+
});
|
|
136
133
|
}
|
package/dist/src/cli/search.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { CmdContext, CmdResult, Styler } from '
|
|
1
|
+
import type { CmdContext, CmdResult, Styler } from '@plebeiantech/lat.md-core/context';
|
|
2
2
|
import { type IndexStats } from '../search/index.js';
|
|
3
|
-
import
|
|
3
|
+
import type { SectionMatch } from '@plebeiantech/lat.md-core/lattice-model';
|
|
4
|
+
import type { Section } from '@plebeiantech/lat.md-core/lattice-model';
|
|
5
|
+
import { type MarkdownProjectAnalysis } from '@plebeiantech/lat.md-core/project-analysis';
|
|
4
6
|
export type SearchResult = {
|
|
5
7
|
query: string;
|
|
6
8
|
matches: SectionMatch[];
|
|
@@ -23,14 +25,22 @@ export type IndexProgress = {
|
|
|
23
25
|
*/
|
|
24
26
|
export declare function runSearch(latDir: string, query: string, limit: number, progress?: IndexProgress, opts?: {
|
|
25
27
|
buildIndex?: boolean;
|
|
26
|
-
|
|
28
|
+
project?: MarkdownProjectAnalysis;
|
|
29
|
+
sectionById?: ReadonlyMap<string, Section>;
|
|
30
|
+
minSimilarity?: number;
|
|
31
|
+
cacheDir?: string;
|
|
27
32
|
}): Promise<SearchResult>;
|
|
28
33
|
/**
|
|
29
34
|
* Index-only mode (no query) — builds the index on first use. Rebuilding is
|
|
30
35
|
* `lat reindex`, not a flag here.
|
|
31
36
|
*/
|
|
32
|
-
export declare function runIndex(latDir: string, progress?: IndexProgress
|
|
37
|
+
export declare function runIndex(latDir: string, progress?: IndexProgress, analyzedProject?: MarkdownProjectAnalysis, options?: {
|
|
38
|
+
cacheDir?: string;
|
|
39
|
+
}): Promise<void>;
|
|
33
40
|
export declare function cliProgress(s: Styler): IndexProgress;
|
|
34
41
|
export declare function searchCommand(ctx: CmdContext, query: string | undefined, opts: {
|
|
35
42
|
limit: number;
|
|
43
|
+
debug?: boolean;
|
|
44
|
+
minSimilarity?: number;
|
|
45
|
+
preview?: 'passage' | 'intro' | 'both';
|
|
36
46
|
}, progress?: IndexProgress): Promise<CmdResult>;
|