@plebeiantech/lat.md 0.12.3-fork.2 → 0.12.3-fork.20
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 +31 -2
- 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/comment-guard.d.ts +14 -0
- package/dist/src/cli/comment-guard.js +10 -33
- package/dist/src/cli/comment-reminder.d.ts +65 -6
- package/dist/src/cli/comment-reminder.js +164 -28
- package/dist/src/cli/fork-instructions.d.ts +20 -0
- package/dist/src/cli/fork-instructions.js +184 -0
- package/dist/src/cli/fork-scaffold.d.ts +106 -0
- package/dist/src/cli/fork-scaffold.js +490 -0
- package/dist/src/cli/graph.d.ts +1 -1
- package/dist/src/cli/hook.d.ts +26 -0
- package/dist/src/cli/hook.js +118 -46
- package/dist/src/cli/index.js +166 -64
- 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 +107 -50
- 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 +116 -100
- 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 +4 -0
- package/dist/src/cli/ui-build.js +13 -0
- package/dist/src/cli/ui.d.ts +1 -1
- package/dist/src/cli/ui.js +18 -2
- 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-cli.js +2 -0
- package/dist/src/fork/upstream-drift.d.ts +26 -0
- package/dist/src/fork/upstream-drift.js +185 -0
- package/dist/src/fork/upstream-guard-cli.d.ts +1 -0
- package/dist/src/fork/upstream-guard-cli.js +2 -0
- package/dist/src/fork/upstream-guard.d.ts +72 -0
- package/dist/src/fork/upstream-guard.js +445 -0
- package/dist/src/graph-export.d.ts +2 -0
- package/dist/src/graph-export.js +38 -19
- package/dist/src/knowledge/claude-memory.d.ts +1 -0
- package/dist/src/knowledge/claude-memory.js +33 -4
- 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 +197 -0
- package/dist/src/search/db.d.ts +28 -16
- package/dist/src/search/db.js +106 -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 +17 -7
- package/dist/src/search/search.js +164 -14
- package/dist/src/search/types.d.ts +15 -0
- package/dist/src/search/types.js +1 -0
- package/dist/src/view/client/assets/GraphView-Dij8mAA_.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-88Wbt0M1.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-y0DlYa8E.js +1 -0
- package/dist/src/view/client/assets/arc-FlMu8dnO.js +1 -0
- package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-DA_uWZW1.js +36 -0
- package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-BHQ5LU85.js +129 -0
- package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-BRucKCt2.js +38 -0
- package/dist/src/view/client/assets/channel-BgDNA_Ay.js +1 -0
- package/dist/src/view/client/assets/chunk-2Q5K7J3B-BJPcFivt.js +1 -0
- package/dist/src/view/client/assets/chunk-5VM5RSS4-v2q99bGz.js +15 -0
- package/dist/src/view/client/assets/chunk-F27PBJKO-CcHOuJCs.js +1 -0
- package/dist/src/view/client/assets/chunk-IMKFNOWR-DNxYuJNq.js +231 -0
- package/dist/src/view/client/assets/chunk-JWPE2WC7-C0eHKvLW.js +1 -0
- package/dist/src/view/client/assets/chunk-POPQ4Y6H-57CWp2Ve.js +1 -0
- package/dist/src/view/client/assets/chunk-SVP7TREG-BqcoxIJw.js +88 -0
- package/dist/src/view/client/assets/chunk-TICWLB2K-DRUJR5zH.js +206 -0
- package/dist/src/view/client/assets/chunk-XXDRQBXY-Dez0oRoM.js +1 -0
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-CFZ_Sgh5.js +1 -0
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-CFZ_Sgh5.js +1 -0
- package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-BHtud6Hg.js +1 -0
- package/dist/src/view/client/assets/cynefin-OW5HDTMX-BjBW8VGk.js +166 -0
- package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-DwGuD7oF.js +62 -0
- package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
- package/dist/src/view/client/assets/dagre-GXQ25YYZ-C5zSlGK9.js +4 -0
- package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/src/view/client/assets/diagram-S7CK7UJ4-C_NhA3bj.js +30 -0
- package/dist/src/view/client/assets/diagram-UQ7AKVKN-az7QPYNb.js +41 -0
- package/dist/src/view/client/assets/diagram-VSXAHHWV-BRvDuM8_.js +3 -0
- package/dist/src/view/client/assets/diagram-VX7I27RA-BWLgF6S-.js +24 -0
- package/dist/src/view/client/assets/diagram-Z3DM3KII-DV3d6mL5.js +24 -0
- package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-yUXrEAvK.js +1 -0
- package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-D35FN1Pt.js +99 -0
- package/dist/src/view/client/assets/flowDiagram-HODETNUW-BciZqsjT.js +168 -0
- package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-BysPGgXS.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-C3DdJ5xG.js +106 -0
- package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
- package/dist/src/view/client/assets/index-CJokoRSp.js +13 -0
- package/dist/src/view/client/assets/index-DG0Ez15D.css +1 -0
- package/dist/src/view/client/assets/infoDiagram-27XIBGKW-D3HZrDRb.js +2 -0
- package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-BXyVIXTU.js +70 -0
- package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-D4-1NxVU.js +139 -0
- package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-4Gu_5yBA.js +89 -0
- package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/src/view/client/assets/layout-Jf1K3TMM.js +1 -0
- package/dist/src/view/client/assets/linear-DWfwzUT_.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-DMx_DAl8.js +310 -0
- package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-8pxY_RWi.js +96 -0
- package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-DNAw_O5t.js +1 -0
- package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-uuvRCDkC.js +39 -0
- package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC-BER2O4Aq.js +7 -0
- package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-CxEsJ_0n.js +1 -0
- package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-yS9rspca.js +84 -0
- package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-Bqt70a2j.js +40 -0
- package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-BvOOEJNr.js +162 -0
- package/dist/src/view/client/assets/sizeCapture-INFHLROL-CvO_Pjjo.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-D77RDMKH-KLmVOZkq.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-KCS8Mdzu.js +1 -0
- package/dist/src/view/client/assets/swimlanes-42K2YHIH-DC1r4_sq.js +1 -0
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-B2TcAwis.js +8 -0
- package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
- package/dist/src/view/client/assets/timeline-definition-24CTP7MA-ChXLOuBL.js +120 -0
- package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-D9_h25-Y.js +34 -0
- package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-CsQJGGW0.js +78 -0
- package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-DGMuPMlm.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 +126 -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 +205 -1
- package/dist/src/view/git.js +1 -1
- package/dist/src/view/graph.d.ts +7 -0
- package/dist/src/view/graph.js +267 -0
- package/dist/src/view/highlight.d.ts +10 -2
- package/dist/src/view/highlight.js +4547 -1363
- package/dist/src/view/markdown.d.ts +8 -3
- package/dist/src/view/markdown.js +308 -41
- 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 +95 -6
- package/dist/src/view/protocol.js +1 -1
- package/dist/src/view/publication.d.ts +2 -0
- package/dist/src/view/publication.js +78 -0
- package/dist/src/view/references.d.ts +13 -26
- package/dist/src/view/references.js +150 -119
- package/dist/src/view/repository.d.ts +18 -5
- package/dist/src/view/repository.js +269 -27
- 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 -33
- 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 +94 -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 +14 -2
- package/dist/src/view/server.js +254 -51
- package/dist/src/view/source-target.d.ts +10 -0
- package/dist/src/view/source-target.js +43 -0
- package/dist/src/view/static-build.d.ts +32 -0
- package/dist/src/view/static-build.js +741 -0
- package/dist/src/view/static-protocol.d.ts +47 -0
- package/dist/src/view/static-protocol.js +15 -0
- package/dist/src/view/store.d.ts +26 -3
- package/dist/src/view/store.js +325 -44
- package/dist/src/view/table-of-contents.d.ts +9 -0
- package/dist/src/view/table-of-contents.js +83 -0
- package/dist/src/view/vercel-build.d.ts +24 -0
- package/dist/src/view/vercel-build.js +140 -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 +72 -25
- 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 +118 -0
- package/plugins/lat-md/skills/lat-md/SKILL.md +178 -0
- package/plugins/lat-md/skills/lat-md-conventions/SKILL.md +182 -0
- package/templates/AGENTS.md +19 -18
- package/templates/cursor-rules.md +14 -5
- package/templates/fork/conventions.md +173 -0
- package/templates/opencode-plugin.ts +9 -9
- package/templates/pi-extension.ts +11 -11
- package/templates/skill/SKILL.md +28 -17
- 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 -6
- package/dist/src/cli/check-mode.js +0 -303
- 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 -777
- 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 -277
- 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 -108
- package/dist/src/lattice.js +0 -816
- 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 -24
- package/dist/src/untrusted.js +0 -97
- package/dist/src/view/client/assets/index-B0n0u03y.css +0 -1
- package/dist/src/view/client/assets/index-xm2_px4q.js +0 -23
- package/dist/src/walk.d.ts +0 -18
- package/dist/src/walk.js +0 -27
- /package/dist/src/{extensions/wiki-link/types.js → fork/upstream-drift-cli.d.ts} +0 -0
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 {};
|
package/dist/src/cli/init.js
CHANGED
|
@@ -1,20 +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';
|
|
20
|
+
import { writeForkInstructions } from './fork-instructions.js';
|
|
21
|
+
import { offerRequireMode, writeForkScaffold } from './fork-scaffold.js';
|
|
22
|
+
import { setupAntigravity } from '../fork/antigravity-init.js';
|
|
23
|
+
import { readInitAgents, writeInitAgents } from './init-preferences.js';
|
|
18
24
|
async function confirm(rl, message) {
|
|
19
25
|
while (true) {
|
|
20
26
|
let answer;
|
|
@@ -120,7 +126,8 @@ function isLatHookEntry(entry) {
|
|
|
120
126
|
* Remove all lat-owned hook entries from settings, then add fresh ones.
|
|
121
127
|
* Preserves any non-lat hooks the user may have configured.
|
|
122
128
|
*/
|
|
123
|
-
export function syncLatHooks(settingsPath, style, agent = 'claude') {
|
|
129
|
+
export function syncLatHooks(settingsPath, style, agent = 'claude', root = dirname(dirname(settingsPath))) {
|
|
130
|
+
projectWritePath(root, settingsPath);
|
|
124
131
|
let settings = {};
|
|
125
132
|
if (existsSync(settingsPath)) {
|
|
126
133
|
const raw = readFileSync(settingsPath, 'utf-8');
|
|
@@ -172,7 +179,7 @@ export function syncLatHooks(settingsPath, style, agent = 'claude') {
|
|
|
172
179
|
},
|
|
173
180
|
],
|
|
174
181
|
});
|
|
175
|
-
|
|
182
|
+
writeProjectFile(root, settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
176
183
|
}
|
|
177
184
|
function cursorHooksTemplate(style) {
|
|
178
185
|
return (JSON.stringify({
|
|
@@ -193,7 +200,7 @@ function cursorHooksTemplate(style) {
|
|
|
193
200
|
}
|
|
194
201
|
// ── Gitignore helper ─────────────────────────────────────────────────
|
|
195
202
|
function ensureGitignored(root, entry) {
|
|
196
|
-
const gitignorePath = join(root, '.gitignore');
|
|
203
|
+
const gitignorePath = projectWritePath(root, join(root, '.gitignore'));
|
|
197
204
|
const gitDir = join(root, '.git');
|
|
198
205
|
// Check if already ignored
|
|
199
206
|
if (existsSync(gitignorePath)) {
|
|
@@ -229,12 +236,12 @@ function ensureGitignored(root, entry) {
|
|
|
229
236
|
let content = readFileSync(gitignorePath, 'utf-8');
|
|
230
237
|
if (!content.endsWith('\n'))
|
|
231
238
|
content += '\n';
|
|
232
|
-
|
|
239
|
+
writeProjectFile(root, gitignorePath, content + entry + '\n');
|
|
233
240
|
console.log(styleText('green', ` Added ${entry}`) + ' to .gitignore');
|
|
234
241
|
}
|
|
235
242
|
else if (existsSync(gitDir)) {
|
|
236
243
|
// Create .gitignore with the entry
|
|
237
|
-
|
|
244
|
+
writeProjectFile(root, gitignorePath, entry + '\n');
|
|
238
245
|
console.log(styleText('green', ` Created .gitignore`) + ` with ${entry}`);
|
|
239
246
|
}
|
|
240
247
|
else {
|
|
@@ -257,7 +264,8 @@ function mcpCommand() {
|
|
|
257
264
|
args: [...args, 'mcp'],
|
|
258
265
|
};
|
|
259
266
|
}
|
|
260
|
-
function hasMcpServer(configPath, key) {
|
|
267
|
+
function hasMcpServer(root, configPath, key) {
|
|
268
|
+
projectWritePath(root, configPath);
|
|
261
269
|
if (!existsSync(configPath))
|
|
262
270
|
return false;
|
|
263
271
|
try {
|
|
@@ -269,7 +277,8 @@ function hasMcpServer(configPath, key) {
|
|
|
269
277
|
return false;
|
|
270
278
|
}
|
|
271
279
|
}
|
|
272
|
-
function addMcpServer(configPath, key, style) {
|
|
280
|
+
function addMcpServer(root, configPath, key, style) {
|
|
281
|
+
projectWritePath(root, configPath);
|
|
273
282
|
let cfg = { [key]: {} };
|
|
274
283
|
if (existsSync(configPath)) {
|
|
275
284
|
const raw = readFileSync(configPath, 'utf-8');
|
|
@@ -284,14 +293,15 @@ function addMcpServer(configPath, key, style) {
|
|
|
284
293
|
}
|
|
285
294
|
cfg[key].lat = styledMcpCommand(style);
|
|
286
295
|
mkdirSync(join(configPath, '..'), { recursive: true });
|
|
287
|
-
|
|
296
|
+
writeProjectFile(root, configPath, JSON.stringify(cfg, null, 2) + '\n');
|
|
288
297
|
}
|
|
289
298
|
// ── Codex TOML MCP helpers ────────────────────────────────────────────
|
|
290
299
|
/**
|
|
291
300
|
* Check whether `.codex/config.toml` already contains an `[mcp_servers.lat]`
|
|
292
301
|
* table. We use a simple regex match — no TOML parser needed.
|
|
293
302
|
*/
|
|
294
|
-
function hasCodexMcpServer(configPath) {
|
|
303
|
+
function hasCodexMcpServer(root, configPath) {
|
|
304
|
+
projectWritePath(root, configPath);
|
|
295
305
|
if (!existsSync(configPath))
|
|
296
306
|
return false;
|
|
297
307
|
try {
|
|
@@ -316,7 +326,8 @@ function hasCodexMcpServer(configPath) {
|
|
|
316
326
|
* args = ["mcp"]
|
|
317
327
|
* ```
|
|
318
328
|
*/
|
|
319
|
-
function addCodexMcpServer(configPath, style) {
|
|
329
|
+
function addCodexMcpServer(root, configPath, style) {
|
|
330
|
+
projectWritePath(root, configPath);
|
|
320
331
|
const cmd = styledMcpCommand(style);
|
|
321
332
|
// Format args as a TOML inline array of quoted strings
|
|
322
333
|
const argsToml = '[' + cmd.args.map((a) => `"${a}"`).join(', ') + ']';
|
|
@@ -327,10 +338,10 @@ function addCodexMcpServer(configPath, style) {
|
|
|
327
338
|
if (!content.endsWith('\n'))
|
|
328
339
|
content += '\n';
|
|
329
340
|
content += '\n' + block;
|
|
330
|
-
|
|
341
|
+
writeProjectFile(root, configPath, content);
|
|
331
342
|
}
|
|
332
343
|
else {
|
|
333
|
-
|
|
344
|
+
writeProjectFile(root, configPath, block);
|
|
334
345
|
}
|
|
335
346
|
}
|
|
336
347
|
// ── Template file helpers ─────────────────────────────────────────────
|
|
@@ -341,11 +352,11 @@ function addCodexMcpServer(configPath, style) {
|
|
|
341
352
|
* Returns the hash of the written content, or null if the file was skipped.
|
|
342
353
|
*/
|
|
343
354
|
async function writeTemplateFile(root, latDir, relPath, template, genTarget, label, indent, ask) {
|
|
344
|
-
const absPath = join(root, relPath);
|
|
355
|
+
const absPath = projectWritePath(root, join(root, relPath));
|
|
345
356
|
const templateHash = contentHash(template);
|
|
346
357
|
if (!existsSync(absPath)) {
|
|
347
358
|
mkdirSync(join(absPath, '..'), { recursive: true });
|
|
348
|
-
|
|
359
|
+
writeProjectFile(root, absPath, template);
|
|
349
360
|
console.log(styleText('green', `${indent}Created ${label}`));
|
|
350
361
|
return templateHash;
|
|
351
362
|
}
|
|
@@ -360,7 +371,7 @@ async function writeTemplateFile(root, latDir, relPath, template, genTarget, lab
|
|
|
360
371
|
}
|
|
361
372
|
if (storedHash && currentHash === storedHash) {
|
|
362
373
|
// Unmodified by user — safe to overwrite with new template
|
|
363
|
-
|
|
374
|
+
writeProjectFile(root, absPath, template);
|
|
364
375
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
365
376
|
return templateHash;
|
|
366
377
|
}
|
|
@@ -368,7 +379,7 @@ async function writeTemplateFile(root, latDir, relPath, template, genTarget, lab
|
|
|
368
379
|
console.log(styleText('yellow', `${indent}${label}`) +
|
|
369
380
|
' exists and may contain your own content.');
|
|
370
381
|
if (await ask(`${indent}Overwrite with latest lat template?`)) {
|
|
371
|
-
|
|
382
|
+
writeProjectFile(root, absPath, template);
|
|
372
383
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
373
384
|
return templateHash;
|
|
374
385
|
}
|
|
@@ -410,12 +421,12 @@ function wrapWithMarkers(template) {
|
|
|
410
421
|
* Returns the hash of the written template content, or null if skipped.
|
|
411
422
|
*/
|
|
412
423
|
async function appendTemplateSection(root, latDir, relPath, template, label, indent, ask) {
|
|
413
|
-
const absPath = join(root, relPath);
|
|
424
|
+
const absPath = projectWritePath(root, join(root, relPath));
|
|
414
425
|
const templateHash = contentHash(template);
|
|
415
426
|
const wrapped = wrapWithMarkers(template);
|
|
416
427
|
if (!existsSync(absPath)) {
|
|
417
428
|
mkdirSync(join(absPath, '..'), { recursive: true });
|
|
418
|
-
|
|
429
|
+
writeProjectFile(root, absPath, wrapped);
|
|
419
430
|
console.log(styleText('green', `${indent}Created ${label}`));
|
|
420
431
|
return templateHash;
|
|
421
432
|
}
|
|
@@ -439,7 +450,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
439
450
|
const updated = currentContent.slice(0, beginIdx) +
|
|
440
451
|
wrapped +
|
|
441
452
|
currentContent.slice(endWithNl);
|
|
442
|
-
|
|
453
|
+
writeProjectFile(root, absPath, updated);
|
|
443
454
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
444
455
|
return templateHash;
|
|
445
456
|
}
|
|
@@ -453,7 +464,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
453
464
|
const updated = currentContent.slice(0, beginIdx) +
|
|
454
465
|
wrapped +
|
|
455
466
|
currentContent.slice(endWithNl);
|
|
456
|
-
|
|
467
|
+
writeProjectFile(root, absPath, updated);
|
|
457
468
|
console.log(styleText('green', `${indent}Updated ${label}`));
|
|
458
469
|
return templateHash;
|
|
459
470
|
}
|
|
@@ -466,7 +477,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
466
477
|
const storedHash = readFileHash(latDir, relPath);
|
|
467
478
|
if (storedHash && currentHash === storedHash) {
|
|
468
479
|
// Unmodified old-style file — migrate: wrap existing content with markers
|
|
469
|
-
|
|
480
|
+
writeProjectFile(root, absPath, wrapWithMarkers(currentContent));
|
|
470
481
|
console.log(styleText('green', `${indent}Migrated ${label}`) + ' to marker format');
|
|
471
482
|
// Return hash of what's now in the section (the old content)
|
|
472
483
|
return currentHash;
|
|
@@ -476,7 +487,7 @@ async function appendTemplateSection(root, latDir, relPath, template, label, ind
|
|
|
476
487
|
if (!content.endsWith('\n'))
|
|
477
488
|
content += '\n';
|
|
478
489
|
content += '\n' + wrapped;
|
|
479
|
-
|
|
490
|
+
writeProjectFile(root, absPath, content);
|
|
480
491
|
console.log(styleText('green', `${indent}Appended lat section to ${label}`));
|
|
481
492
|
return templateHash;
|
|
482
493
|
}
|
|
@@ -504,10 +515,10 @@ async function setupClaudeCode(root, latDir, template, hashes, ask, style) {
|
|
|
504
515
|
console.log('');
|
|
505
516
|
console.log(styleText('dim', ' Hooks inject lat.md workflow reminders into every prompt and remind'));
|
|
506
517
|
console.log(styleText('dim', ' the agent to update lat.md/ before finishing.'));
|
|
507
|
-
const claudeDir = join(root, '.claude');
|
|
518
|
+
const claudeDir = projectWritePath(root, join(root, '.claude'));
|
|
508
519
|
const settingsPath = join(claudeDir, 'settings.json');
|
|
509
520
|
mkdirSync(claudeDir, { recursive: true });
|
|
510
|
-
syncLatHooks(settingsPath, style);
|
|
521
|
+
syncLatHooks(settingsPath, style, 'claude', root);
|
|
511
522
|
console.log(styleText('green', ' Hooks') +
|
|
512
523
|
' synced (UserPromptSubmit + Stop + PostToolUse)');
|
|
513
524
|
// .claude/skills/lat-md/SKILL.md — skill for authoring lat.md files
|
|
@@ -524,11 +535,11 @@ async function setupClaudeCode(root, latDir, template, hashes, ask, style) {
|
|
|
524
535
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
525
536
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
526
537
|
const mcpPath = join(root, '.mcp.json');
|
|
527
|
-
if (hasMcpServer(mcpPath, 'mcpServers')) {
|
|
538
|
+
if (hasMcpServer(root, mcpPath, 'mcpServers')) {
|
|
528
539
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
529
540
|
}
|
|
530
541
|
else {
|
|
531
|
-
addMcpServer(mcpPath, 'mcpServers', style);
|
|
542
|
+
addMcpServer(root, mcpPath, 'mcpServers', style);
|
|
532
543
|
console.log(styleText('green', ' MCP server') + ' registered in .mcp.json');
|
|
533
544
|
}
|
|
534
545
|
// Ensure .mcp.json is gitignored (it contains local absolute paths)
|
|
@@ -551,11 +562,11 @@ async function setupCursor(root, latDir, hashes, ask, style) {
|
|
|
551
562
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
552
563
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
553
564
|
const mcpPath = join(root, '.cursor', 'mcp.json');
|
|
554
|
-
if (hasMcpServer(mcpPath, 'mcpServers')) {
|
|
565
|
+
if (hasMcpServer(root, mcpPath, 'mcpServers')) {
|
|
555
566
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
556
567
|
}
|
|
557
568
|
else {
|
|
558
|
-
addMcpServer(mcpPath, 'mcpServers', style);
|
|
569
|
+
addMcpServer(root, mcpPath, 'mcpServers', style);
|
|
559
570
|
console.log(styleText('green', ' MCP server') + ' registered in .cursor/mcp.json');
|
|
560
571
|
}
|
|
561
572
|
// Ensure .cursor is gitignored (hooks and MCP config may contain local paths)
|
|
@@ -576,11 +587,11 @@ async function setupCopilot(root, latDir, hashes, ask, style) {
|
|
|
576
587
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
577
588
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
578
589
|
const mcpPath = join(root, '.vscode', 'mcp.json');
|
|
579
|
-
if (hasMcpServer(mcpPath, 'servers')) {
|
|
590
|
+
if (hasMcpServer(root, mcpPath, 'servers')) {
|
|
580
591
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
581
592
|
}
|
|
582
593
|
else {
|
|
583
|
-
addMcpServer(mcpPath, 'servers', style);
|
|
594
|
+
addMcpServer(root, mcpPath, 'servers', style);
|
|
584
595
|
console.log(styleText('green', ' MCP server') + ' registered in .vscode/mcp.json');
|
|
585
596
|
}
|
|
586
597
|
// .agents/skills/lat-md/SKILL.md — skill for authoring lat.md files
|
|
@@ -593,7 +604,7 @@ async function setupPi(root, latDir, hashes, ask, style) {
|
|
|
593
604
|
console.log('');
|
|
594
605
|
console.log(styleText('dim', ' The Pi extension registers lat tools and hooks into the agent lifecycle'));
|
|
595
606
|
console.log(styleText('dim', ' to inject search context and validate lat.md/ before finishing.'));
|
|
596
|
-
const template = readPiExtensionTemplate().replace('
|
|
607
|
+
const template = readPiExtensionTemplate().replace('__LAT_INVOCATION__', () => JSON.stringify(agentInvocation(style, resolveLatInvocation())));
|
|
597
608
|
const hash = await writeTemplateFile(root, latDir, '.pi/extensions/lat.ts', template, 'pi-extension.ts', 'Extension (.pi/extensions/lat.ts)', ' ', ask);
|
|
598
609
|
if (hash)
|
|
599
610
|
hashes['.pi/extensions/lat.ts'] = hash;
|
|
@@ -614,7 +625,7 @@ async function setupOpenCode(root, latDir, hashes, ask, style) {
|
|
|
614
625
|
console.log('');
|
|
615
626
|
console.log(styleText('dim', ' The OpenCode plugin registers lat tools and hooks into the session'));
|
|
616
627
|
console.log(styleText('dim', ' lifecycle to validate lat.md/ when the agent finishes.'));
|
|
617
|
-
const template = readOpenCodePluginTemplate().replace('
|
|
628
|
+
const template = readOpenCodePluginTemplate().replace('__LAT_INVOCATION__', () => JSON.stringify(agentInvocation(style, resolveLatInvocation())));
|
|
618
629
|
const hash = await writeTemplateFile(root, latDir, '.opencode/plugins/lat.ts', template, 'opencode-plugin.ts', 'Plugin (.opencode/plugins/lat.ts)', ' ', ask);
|
|
619
630
|
if (hash)
|
|
620
631
|
hashes['.opencode/plugins/lat.ts'] = hash;
|
|
@@ -630,10 +641,10 @@ async function setupCodex(root, latDir, hashes, ask, style) {
|
|
|
630
641
|
console.log('');
|
|
631
642
|
console.log(styleText('dim', ' Hooks inject lat.md workflow reminders into every prompt and remind'));
|
|
632
643
|
console.log(styleText('dim', ' the agent to update lat.md/ before finishing.'));
|
|
633
|
-
const codexDir = join(root, '.codex');
|
|
644
|
+
const codexDir = projectWritePath(root, join(root, '.codex'));
|
|
634
645
|
const hooksPath = join(codexDir, 'hooks.json');
|
|
635
646
|
mkdirSync(codexDir, { recursive: true });
|
|
636
|
-
syncLatHooks(hooksPath, style, 'codex');
|
|
647
|
+
syncLatHooks(hooksPath, style, 'codex', root);
|
|
637
648
|
console.log(styleText('green', ' Hooks') +
|
|
638
649
|
' synced (UserPromptSubmit + Stop + PostToolUse)');
|
|
639
650
|
// .codex/config.toml — MCP server registration
|
|
@@ -641,11 +652,11 @@ async function setupCodex(root, latDir, hashes, ask, style) {
|
|
|
641
652
|
console.log(styleText('dim', ' Agents can call `lat` from the command line, but an MCP server gives lat'));
|
|
642
653
|
console.log(styleText('dim', ' more visibility and makes agents more likely to use it proactively.'));
|
|
643
654
|
const mcpPath = join(root, '.codex', 'config.toml');
|
|
644
|
-
if (hasCodexMcpServer(mcpPath)) {
|
|
655
|
+
if (hasCodexMcpServer(root, mcpPath)) {
|
|
645
656
|
console.log(styleText('green', ' MCP server') + ' already configured');
|
|
646
657
|
}
|
|
647
658
|
else {
|
|
648
|
-
addCodexMcpServer(mcpPath, style);
|
|
659
|
+
addCodexMcpServer(root, mcpPath, style);
|
|
649
660
|
console.log(styleText('green', ' MCP server') + ' registered in .codex/config.toml');
|
|
650
661
|
}
|
|
651
662
|
// Ensure .codex is gitignored (config contains local absolute paths)
|
|
@@ -664,11 +675,10 @@ async function setupCodex(root, latDir, hashes, ask, style) {
|
|
|
664
675
|
' Run /hooks in Codex to review and trust the project hooks.');
|
|
665
676
|
}
|
|
666
677
|
async function readStoredEmbeddingModel(latDir) {
|
|
667
|
-
if (!existsSync(join(latDir, '.cache', '
|
|
678
|
+
if (!existsSync(join(latDir, '.cache', 'search.db')))
|
|
668
679
|
return null;
|
|
669
|
-
const db = openDb(latDir);
|
|
680
|
+
const db = openDb(latDir, undefined, true);
|
|
670
681
|
try {
|
|
671
|
-
await ensureMeta(db);
|
|
672
682
|
return await getStoredModel(db);
|
|
673
683
|
}
|
|
674
684
|
finally {
|
|
@@ -817,6 +827,7 @@ function printNextSteps(selectedAgents) {
|
|
|
817
827
|
pi: 'Pi',
|
|
818
828
|
opencode: 'OpenCode',
|
|
819
829
|
codex: 'Codex',
|
|
830
|
+
antigravity: 'Antigravity',
|
|
820
831
|
};
|
|
821
832
|
if (!hasClaudeCode && ideAgents.length === 0)
|
|
822
833
|
return;
|
|
@@ -839,6 +850,16 @@ function printNextSteps(selectedAgents) {
|
|
|
839
850
|
export function readLogo() {
|
|
840
851
|
return readFileSync(join(findTemplatesDir(), 'logo.txt'), 'utf-8');
|
|
841
852
|
}
|
|
853
|
+
export function ensureLatLocalConfigIgnored(latDir) {
|
|
854
|
+
const root = dirname(latDir);
|
|
855
|
+
const path = projectWritePath(root, join(latDir, '.gitignore'));
|
|
856
|
+
const entry = 'config.local.yaml';
|
|
857
|
+
const current = existsSync(path) ? readFileSync(path, 'utf8') : '';
|
|
858
|
+
if (current.split(/\r?\n/).includes(entry))
|
|
859
|
+
return;
|
|
860
|
+
const prefix = current && !current.endsWith('\n') ? `${current}\n` : current;
|
|
861
|
+
writeProjectFile(root, path, `${prefix}${entry}\n`);
|
|
862
|
+
}
|
|
842
863
|
export async function initCmd(targetDir) {
|
|
843
864
|
console.log(styleText('cyan', readLogo()));
|
|
844
865
|
// Upfront version check — let the user upgrade before proceeding
|
|
@@ -862,6 +883,7 @@ export async function initCmd(targetDir) {
|
|
|
862
883
|
}
|
|
863
884
|
const root = resolve(targetDir ?? process.cwd());
|
|
864
885
|
const latDir = join(root, 'lat.md');
|
|
886
|
+
projectWritePath(root, latDir);
|
|
865
887
|
const storedInitVersion = readInitVersion(latDir);
|
|
866
888
|
const interactive = process.stdin.isTTY ?? false;
|
|
867
889
|
// Readline is created AFTER the selectMenu loop below.
|
|
@@ -900,7 +922,10 @@ export async function initCmd(targetDir) {
|
|
|
900
922
|
mkdirSync(latDir, { recursive: true });
|
|
901
923
|
cpSync(templateDir, latDir, { recursive: true });
|
|
902
924
|
console.log(styleText('green', 'Created lat.md/'));
|
|
925
|
+
writeForkScaffold(latDir);
|
|
903
926
|
}
|
|
927
|
+
ensureLatLocalConfigIgnored(latDir);
|
|
928
|
+
ensureGitignored(root, '.lat-build');
|
|
904
929
|
// Step 2: Configure fresh/outdated setups, ask interactive users about an
|
|
905
930
|
// available key, and offer to rebuild an index whose backend differs. This
|
|
906
931
|
// happens before agent selection so "no agents" still completes it.
|
|
@@ -914,21 +939,24 @@ export async function initCmd(targetDir) {
|
|
|
914
939
|
{ label: 'VS Code Copilot', value: 'copilot' },
|
|
915
940
|
{ label: 'OpenCode', value: 'opencode' },
|
|
916
941
|
{ label: 'Codex', value: 'codex' },
|
|
942
|
+
{ label: 'Antigravity / Gemini', value: 'antigravity' },
|
|
917
943
|
];
|
|
918
|
-
const selectedAgents = await checklistMenu(allAgents, 'Which coding agents do you use?');
|
|
944
|
+
const selectedAgents = await checklistMenu(allAgents, 'Which coding agents do you use?', readInitAgents(latDir));
|
|
919
945
|
const useClaudeCode = selectedAgents.includes('claude');
|
|
920
946
|
const usePi = selectedAgents.includes('pi');
|
|
921
947
|
const useCursor = selectedAgents.includes('cursor');
|
|
922
948
|
const useCopilot = selectedAgents.includes('copilot');
|
|
923
949
|
const useOpenCode = selectedAgents.includes('opencode');
|
|
924
950
|
const useCodex = selectedAgents.includes('codex');
|
|
951
|
+
const useAntigravity = selectedAgents.includes('antigravity');
|
|
925
952
|
const anySelected = selectedAgents.length > 0;
|
|
926
953
|
const needsLatCommand = useClaudeCode ||
|
|
927
954
|
usePi ||
|
|
928
955
|
useCursor ||
|
|
929
956
|
useCopilot ||
|
|
930
957
|
useOpenCode ||
|
|
931
|
-
useCodex
|
|
958
|
+
useCodex ||
|
|
959
|
+
useAntigravity;
|
|
932
960
|
// Step 4: How should agents run lat?
|
|
933
961
|
let commandStyle = 'local';
|
|
934
962
|
if (anySelected && needsLatCommand && interactive) {
|
|
@@ -954,11 +982,14 @@ export async function initCmd(targetDir) {
|
|
|
954
982
|
output: process.stdout,
|
|
955
983
|
});
|
|
956
984
|
}
|
|
985
|
+
await offerRequireMode(latDir, interactive, ask);
|
|
957
986
|
if (!anySelected) {
|
|
958
987
|
// Embedding setup is complete even when the user does not configure an
|
|
959
988
|
// agent. Stamp the version so future non-interactive runs do not reapply
|
|
960
989
|
// fresh/outdated defaults and overwrite the chosen backend.
|
|
961
990
|
writeInitMeta(latDir, {});
|
|
991
|
+
if (interactive)
|
|
992
|
+
writeInitAgents(latDir, selectedAgents);
|
|
962
993
|
console.log('');
|
|
963
994
|
console.log(styleText('dim', 'No agents selected. You can re-run') +
|
|
964
995
|
' lat init ' +
|
|
@@ -969,7 +1000,12 @@ export async function initCmd(targetDir) {
|
|
|
969
1000
|
const template = readAgentsTemplate();
|
|
970
1001
|
const fileHashes = {};
|
|
971
1002
|
// Step 5: AGENTS.md (shared by non-Claude agents)
|
|
972
|
-
const needsAgentsMd = usePi ||
|
|
1003
|
+
const needsAgentsMd = usePi ||
|
|
1004
|
+
useCursor ||
|
|
1005
|
+
useCopilot ||
|
|
1006
|
+
useOpenCode ||
|
|
1007
|
+
useCodex ||
|
|
1008
|
+
useAntigravity;
|
|
973
1009
|
if (needsAgentsMd) {
|
|
974
1010
|
await setupAgentsMd(root, latDir, template, fileHashes, ask);
|
|
975
1011
|
}
|
|
@@ -1004,15 +1040,36 @@ export async function initCmd(targetDir) {
|
|
|
1004
1040
|
console.log(styleText('bold', 'Setting up Codex...'));
|
|
1005
1041
|
await setupCodex(root, latDir, fileHashes, ask, commandStyle);
|
|
1006
1042
|
}
|
|
1043
|
+
if (useAntigravity) {
|
|
1044
|
+
console.log('');
|
|
1045
|
+
console.log(styleText('bold', 'Setting up Antigravity / Gemini...'));
|
|
1046
|
+
await setupAntigravity({
|
|
1047
|
+
root,
|
|
1048
|
+
latDir,
|
|
1049
|
+
template,
|
|
1050
|
+
hashes: fileHashes,
|
|
1051
|
+
ask,
|
|
1052
|
+
style: commandStyle,
|
|
1053
|
+
latBin: latBinString(commandStyle),
|
|
1054
|
+
appendTemplateSection,
|
|
1055
|
+
writeTemplateFile,
|
|
1056
|
+
ensureGitignored,
|
|
1057
|
+
hasMcpServer,
|
|
1058
|
+
addMcpServer,
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
await writeForkInstructions(root, latDir, fileHashes, ask);
|
|
1007
1062
|
// Record init version and file hashes so `lat check` can detect stale setups
|
|
1008
1063
|
writeInitMeta(latDir, fileHashes);
|
|
1064
|
+
if (interactive)
|
|
1065
|
+
writeInitAgents(latDir, selectedAgents);
|
|
1009
1066
|
console.log('');
|
|
1010
1067
|
console.log(styleText('green', 'Done!') +
|
|
1011
1068
|
' Run ' +
|
|
1012
1069
|
styleText('cyan', 'lat check') +
|
|
1013
1070
|
' to validate your setup.');
|
|
1014
1071
|
// Suggest ripgrep if not available
|
|
1015
|
-
const { hasRipgrep } = await import('
|
|
1072
|
+
const { hasRipgrep } = await import('@plebeiantech/lat.md-core/code-refs');
|
|
1016
1073
|
if (!(await hasRipgrep())) {
|
|
1017
1074
|
console.log('');
|
|
1018
1075
|
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>;
|