@plebeiantech/lat.md 0.12.3-fork.2 → 0.12.3-fork.21
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 +115 -64
- 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 +200 -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-0bPe_Q5I.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-1_8mI7lO.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-BLIuikwY.js +1 -0
- package/dist/src/view/client/assets/arc-D4PzdKSA.js +1 -0
- package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-35Egww62.js +36 -0
- package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-tqNy53-W.js +129 -0
- package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-DZ_GcD9K.js +38 -0
- package/dist/src/view/client/assets/channel-DensupHE.js +1 -0
- package/dist/src/view/client/assets/chunk-2Q5K7J3B-BUjq4Q7b.js +1 -0
- package/dist/src/view/client/assets/chunk-5VM5RSS4-BsIix6I5.js +15 -0
- package/dist/src/view/client/assets/chunk-F27PBJKO-Dxo7UheG.js +1 -0
- package/dist/src/view/client/assets/chunk-IMKFNOWR-C5lzUDK5.js +231 -0
- package/dist/src/view/client/assets/chunk-JWPE2WC7-qCHQlKfY.js +1 -0
- package/dist/src/view/client/assets/chunk-POPQ4Y6H-CDPKw21I.js +1 -0
- package/dist/src/view/client/assets/chunk-SVP7TREG-CD_C-9M-.js +88 -0
- package/dist/src/view/client/assets/chunk-TICWLB2K-ZMatRvad.js +206 -0
- package/dist/src/view/client/assets/chunk-XXDRQBXY-dDs4quwg.js +1 -0
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-CV7ArHLW.js +1 -0
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-CV7ArHLW.js +1 -0
- package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-CwH3-T1N.js +1 -0
- package/dist/src/view/client/assets/cynefin-OW5HDTMX-DodS6r00.js +166 -0
- package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-D7WDoy0K.js +62 -0
- package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
- package/dist/src/view/client/assets/dagre-GXQ25YYZ-yc2GTi5h.js +4 -0
- package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/src/view/client/assets/diagram-S7CK7UJ4-CEP0FGL8.js +30 -0
- package/dist/src/view/client/assets/diagram-UQ7AKVKN-BZIEojBf.js +41 -0
- package/dist/src/view/client/assets/diagram-VSXAHHWV-BSB6COmM.js +3 -0
- package/dist/src/view/client/assets/diagram-VX7I27RA-DqfR3psV.js +24 -0
- package/dist/src/view/client/assets/diagram-Z3DM3KII-B79t0s5P.js +24 -0
- package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-CqbCQhE1.js +1 -0
- package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-BVfoYIhJ.js +99 -0
- package/dist/src/view/client/assets/flowDiagram-HODETNUW-Dfyjm6ib.js +168 -0
- package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-Da9ta_k3.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-BDqlQ6LG.js +106 -0
- package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
- package/dist/src/view/client/assets/index-DG0Ez15D.css +1 -0
- package/dist/src/view/client/assets/index-heNSjszK.js +13 -0
- package/dist/src/view/client/assets/infoDiagram-27XIBGKW-CozIUYm1.js +2 -0
- package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-tkBLr-Tn.js +70 -0
- package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-Dcd_Ofwc.js +139 -0
- package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-CQvZmdAf.js +89 -0
- package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/src/view/client/assets/layout-BxuGL0Ip.js +1 -0
- package/dist/src/view/client/assets/linear-D8tR6G5K.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-BlHZooLK.js +310 -0
- package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-BqvVz5lC.js +96 -0
- package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-BkbOOTxX.js +1 -0
- package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-BToTpG0m.js +39 -0
- package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC-CerD2TfT.js +7 -0
- package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-B2oElPYD.js +1 -0
- package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-BCL8RGFd.js +84 -0
- package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-BqnkNRPm.js +40 -0
- package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-DKSKYknp.js +162 -0
- package/dist/src/view/client/assets/sizeCapture-INFHLROL-D8reQ7IM.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-D77RDMKH-B-Eme-BN.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-yXL-Y-Ym.js +1 -0
- package/dist/src/view/client/assets/swimlanes-42K2YHIH-lK0158X4.js +1 -0
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-CGn5WOGw.js +8 -0
- package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
- package/dist/src/view/client/assets/timeline-definition-24CTP7MA-imh-edhJ.js +120 -0
- package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-Ixwhcd6r.js +34 -0
- package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-Cvr_zzKI.js +78 -0
- package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-BvcmHKlQ.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 +50648 -3166
- package/dist/src/view/markdown.d.ts +8 -3
- package/dist/src/view/markdown.js +311 -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 -20
- package/templates/cursor-rules.md +14 -7
- 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
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { styleText } from 'node:util';
|
|
4
|
+
import { contentHash, readFileHash, } from '@plebeiantech/lat.md-core/init-version';
|
|
5
|
+
import { findTemplatesDir } from './templates.js';
|
|
6
|
+
/**
|
|
7
|
+
* The fork's own instruction channel into a consumer project.
|
|
8
|
+
*
|
|
9
|
+
* Upstream teaches a consumer's agent through `templates/AGENTS.md` and
|
|
10
|
+
* `templates/skill/SKILL.md`. Both are upstream files, and both are the ones
|
|
11
|
+
* upstream is most likely to rewrite, so every sentence this fork adds to them
|
|
12
|
+
* is a merge conflict bought on credit. The fork's Diátaxis block cost 13
|
|
13
|
+
* lines in one and 14 in the other before this module existed.
|
|
14
|
+
*
|
|
15
|
+
* Everything here writes into fork-owned paths instead. The entire upstream
|
|
16
|
+
* footprint is one import and one call in `initCmd`.
|
|
17
|
+
*
|
|
18
|
+
* Two shapes, because the destinations behave differently:
|
|
19
|
+
*
|
|
20
|
+
* - Always-loaded instruction files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`,
|
|
21
|
+
* `.github/copilot-instructions.md`) already carry upstream's
|
|
22
|
+
* `%% lat:begin %%` block, so this appends a *second* block under its own
|
|
23
|
+
* `%% lat-fork:begin %%` markers. Upstream's `appendTemplateSection` slices
|
|
24
|
+
* between its own markers and leaves anything after them intact, so the two
|
|
25
|
+
* blocks do not fight on re-run.
|
|
26
|
+
* - Skill directories get a separate `lat-md-conventions/SKILL.md`. Upstream
|
|
27
|
+
* writes its `lat-md` skill with a whole-file hash comparison, so appending
|
|
28
|
+
* to that file would make every later `lat init` report it as
|
|
29
|
+
* user-modified and prompt.
|
|
30
|
+
*/
|
|
31
|
+
const FORK_BEGIN = '%% lat-fork:begin %%';
|
|
32
|
+
const FORK_END = '%% lat-fork:end %%';
|
|
33
|
+
/**
|
|
34
|
+
* Hash-map key for a fork block inside a file upstream also owns. Suffixed so
|
|
35
|
+
* it can never collide with upstream's entry for the same path — both live in
|
|
36
|
+
* one flat `file_hashes` record.
|
|
37
|
+
*/
|
|
38
|
+
function forkHashKey(relPath) {
|
|
39
|
+
return `${relPath}#lat-fork`;
|
|
40
|
+
}
|
|
41
|
+
/** Instruction files that use upstream's marker-append shape. */
|
|
42
|
+
const BLOCK_TARGETS = [
|
|
43
|
+
'CLAUDE.md',
|
|
44
|
+
'AGENTS.md',
|
|
45
|
+
'GEMINI.md',
|
|
46
|
+
'.github/copilot-instructions.md',
|
|
47
|
+
];
|
|
48
|
+
/**
|
|
49
|
+
* Skill roots every agent integration installs into. Written to only when the
|
|
50
|
+
* directory already exists, which is what keeps this list from creating skill
|
|
51
|
+
* directories for agents the user did not select.
|
|
52
|
+
*/
|
|
53
|
+
const SKILL_ROOTS = [
|
|
54
|
+
'.claude/skills',
|
|
55
|
+
'.pi/skills',
|
|
56
|
+
'.agents/skills',
|
|
57
|
+
'.codex/skills',
|
|
58
|
+
];
|
|
59
|
+
const SKILL_NAME = 'lat-md-conventions';
|
|
60
|
+
export const SKILL_FRONTMATTER = `---
|
|
61
|
+
name: ${SKILL_NAME}
|
|
62
|
+
description: >-
|
|
63
|
+
Rules lat check enforces in this project: Diátaxis mode placement for every
|
|
64
|
+
lat.md/ document, mandatory @lat: code refs starting at the application
|
|
65
|
+
entrypoint, and test specs wired to their tests. Load alongside lat-md
|
|
66
|
+
whenever creating or editing files under lat.md/.
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
`;
|
|
70
|
+
export function readForkConventions() {
|
|
71
|
+
return readFileSync(join(findTemplatesDir(), 'fork', 'conventions.md'), 'utf-8');
|
|
72
|
+
}
|
|
73
|
+
function wrapBlock(body) {
|
|
74
|
+
return `${FORK_BEGIN}\n${body}${body.endsWith('\n') ? '' : '\n'}${FORK_END}\n`;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Replace the fork block in `content`, or append one when absent.
|
|
78
|
+
*
|
|
79
|
+
* Returns null when the block is already byte-identical, so the caller can
|
|
80
|
+
* stay quiet rather than announce a write that did not happen.
|
|
81
|
+
*/
|
|
82
|
+
export function spliceForkBlock(content, body) {
|
|
83
|
+
const wrapped = wrapBlock(body);
|
|
84
|
+
const begin = content.indexOf(FORK_BEGIN);
|
|
85
|
+
const end = content.indexOf(FORK_END);
|
|
86
|
+
if (begin === -1 || end === -1 || end <= begin) {
|
|
87
|
+
let base = content;
|
|
88
|
+
if (base.length > 0 && !base.endsWith('\n'))
|
|
89
|
+
base += '\n';
|
|
90
|
+
return base + (base.length > 0 ? '\n' : '') + wrapped;
|
|
91
|
+
}
|
|
92
|
+
const endWithMarker = end + FORK_END.length;
|
|
93
|
+
const endWithNl = content[endWithMarker] === '\n' ? endWithMarker + 1 : endWithMarker;
|
|
94
|
+
const existing = content.slice(begin, endWithNl);
|
|
95
|
+
if (existing === wrapped)
|
|
96
|
+
return null;
|
|
97
|
+
return content.slice(0, begin) + wrapped + content.slice(endWithNl);
|
|
98
|
+
}
|
|
99
|
+
/** Read the body currently fenced by the fork markers, or null if absent. */
|
|
100
|
+
export function extractForkBlock(content) {
|
|
101
|
+
const begin = content.indexOf(FORK_BEGIN);
|
|
102
|
+
const end = content.indexOf(FORK_END);
|
|
103
|
+
if (begin === -1 || end === -1 || end <= begin)
|
|
104
|
+
return null;
|
|
105
|
+
return content.slice(begin + FORK_BEGIN.length + 1, end);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Write the fork's conventions into every instruction file and skill directory
|
|
109
|
+
* the selected agents produced.
|
|
110
|
+
*
|
|
111
|
+
* `fileHashes` is upstream's record, threaded through so `writeInitMeta`
|
|
112
|
+
* persists these entries alongside its own; a stored hash is what lets a later
|
|
113
|
+
* run tell "the user edited our block" from "the template moved on".
|
|
114
|
+
*/
|
|
115
|
+
export async function writeForkInstructions(root, latDir, fileHashes, ask) {
|
|
116
|
+
const body = readForkConventions();
|
|
117
|
+
const bodyHash = contentHash(body);
|
|
118
|
+
const written = [];
|
|
119
|
+
for (const relPath of BLOCK_TARGETS) {
|
|
120
|
+
const absPath = join(root, relPath);
|
|
121
|
+
if (!existsSync(absPath))
|
|
122
|
+
continue;
|
|
123
|
+
const current = readFileSync(absPath, 'utf-8');
|
|
124
|
+
const existingBlock = extractForkBlock(current);
|
|
125
|
+
if (existingBlock !== null) {
|
|
126
|
+
const existingHash = contentHash(existingBlock);
|
|
127
|
+
if (existingHash === bodyHash) {
|
|
128
|
+
fileHashes[forkHashKey(relPath)] = bodyHash;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const storedHash = readFileHash(latDir, forkHashKey(relPath));
|
|
132
|
+
if (storedHash && existingHash !== storedHash) {
|
|
133
|
+
console.log(styleText('yellow', ` ${relPath}`) +
|
|
134
|
+
' lat-fork section has been modified.');
|
|
135
|
+
if (!(await ask(' Replace lat-fork section with latest template?'))) {
|
|
136
|
+
console.log(styleText('dim', ' Kept existing section.'));
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const updated = spliceForkBlock(current, body);
|
|
142
|
+
if (updated === null) {
|
|
143
|
+
fileHashes[forkHashKey(relPath)] = bodyHash;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
writeFileSync(absPath, updated);
|
|
147
|
+
fileHashes[forkHashKey(relPath)] = bodyHash;
|
|
148
|
+
written.push(relPath);
|
|
149
|
+
}
|
|
150
|
+
const skillBody = SKILL_FRONTMATTER + body;
|
|
151
|
+
const skillHash = contentHash(skillBody);
|
|
152
|
+
for (const skillRoot of SKILL_ROOTS) {
|
|
153
|
+
const rootAbs = join(root, skillRoot);
|
|
154
|
+
if (!existsSync(rootAbs))
|
|
155
|
+
continue;
|
|
156
|
+
const relPath = `${skillRoot}/${SKILL_NAME}/SKILL.md`;
|
|
157
|
+
const absPath = join(root, relPath);
|
|
158
|
+
if (existsSync(absPath)) {
|
|
159
|
+
const current = readFileSync(absPath, 'utf-8');
|
|
160
|
+
if (contentHash(current) === skillHash) {
|
|
161
|
+
fileHashes[relPath] = skillHash;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const storedHash = readFileHash(latDir, relPath);
|
|
165
|
+
if (storedHash && contentHash(current) !== storedHash) {
|
|
166
|
+
console.log(styleText('yellow', ` ${relPath}`) + ' has been modified.');
|
|
167
|
+
if (!(await ask(' Overwrite with latest lat template?'))) {
|
|
168
|
+
console.log(styleText('dim', ' Kept existing file.'));
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
mkdirSync(join(absPath, '..'), { recursive: true });
|
|
174
|
+
writeFileSync(absPath, skillBody);
|
|
175
|
+
fileHashes[relPath] = skillHash;
|
|
176
|
+
written.push(relPath);
|
|
177
|
+
}
|
|
178
|
+
if (written.length > 0) {
|
|
179
|
+
console.log('');
|
|
180
|
+
console.log(styleText('green', ' lat.md conventions') +
|
|
181
|
+
' written to ' +
|
|
182
|
+
written.join(', '));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** What the root index says about the gate today. */
|
|
2
|
+
export type RequireModeState = 'on' | 'off' | 'unset' | 'invalid';
|
|
3
|
+
/**
|
|
4
|
+
* Read the gate straight from a root index's frontmatter.
|
|
5
|
+
*
|
|
6
|
+
* Four states rather than a boolean, because `checkMode` enforces on `=== true`
|
|
7
|
+
* and anything looser here disagrees with it. A root index reading
|
|
8
|
+
* `require-mode: yes` is a string to this parser: treating that as "set" left
|
|
9
|
+
* the user believing the gate was on, `checkMode` enforcing nothing, and the
|
|
10
|
+
* one prompt that would have said so permanently silenced by the same value.
|
|
11
|
+
* `invalid` is reported rather than assumed either way.
|
|
12
|
+
*/
|
|
13
|
+
export declare function requireModeState(content: string): RequireModeState;
|
|
14
|
+
/** What `planRequireMode` decided, before anything is written or asked. */
|
|
15
|
+
export type StampPlan =
|
|
16
|
+
/** Already `true`; nothing to do. */
|
|
17
|
+
{
|
|
18
|
+
kind: 'on';
|
|
19
|
+
}
|
|
20
|
+
/** Explicitly `false`. A deliberate opt-out is not re-offered. */
|
|
21
|
+
| {
|
|
22
|
+
kind: 'off';
|
|
23
|
+
}
|
|
24
|
+
/** The edited document, ready to write. */
|
|
25
|
+
| {
|
|
26
|
+
kind: 'stamped';
|
|
27
|
+
content: string;
|
|
28
|
+
movedRootKey: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Present but neither `true` nor `false`. */
|
|
31
|
+
| {
|
|
32
|
+
kind: 'invalid';
|
|
33
|
+
detail: string;
|
|
34
|
+
}
|
|
35
|
+
/** The frontmatter does not parse, so no field on it is read at all. */
|
|
36
|
+
| {
|
|
37
|
+
kind: 'unparseable';
|
|
38
|
+
detail: string;
|
|
39
|
+
}
|
|
40
|
+
/** `lat:` holds something that cannot carry a mapping key. */
|
|
41
|
+
| {
|
|
42
|
+
kind: 'unsupported';
|
|
43
|
+
detail: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Decide what turning the gate on in this document would do, without doing it.
|
|
47
|
+
*
|
|
48
|
+
* Parsed and re-emitted through the YAML document API rather than edited line
|
|
49
|
+
* by line. Line surgery looked cheaper — it preserves the file byte for byte
|
|
50
|
+
* except where it inserts — but it has to answer, from raw text, every question
|
|
51
|
+
* the parser already answers: which line opens the block, which lines are the
|
|
52
|
+
* `lat:` mapping's own children rather than a later key's, how far they are
|
|
53
|
+
* indented, and whether the value on the `lat:` line is a flow mapping, an
|
|
54
|
+
* anchor or a block scalar. Each wrong answer was its own defect: a flow
|
|
55
|
+
* mapping and an anchor were refused although both merge cleanly, an empty
|
|
56
|
+
* `lat:` beside a sibling list was refused because the scan walked past the end
|
|
57
|
+
* of the block, and one shape produced frontmatter that no longer parsed at
|
|
58
|
+
* all. `parseDocument` answers all of it, and round-trips comments and blank
|
|
59
|
+
* lines while doing so.
|
|
60
|
+
*
|
|
61
|
+
* The one thing the document API does not give for free is that the fields
|
|
62
|
+
* already there survive, so that is asserted below rather than assumed.
|
|
63
|
+
*/
|
|
64
|
+
export declare function planRequireMode(content: string): StampPlan;
|
|
65
|
+
/** The edited document when the gate can be turned on, the input when not. */
|
|
66
|
+
export declare function stampRequireMode(content: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Append the four mode directories to the root index.
|
|
69
|
+
*
|
|
70
|
+
* Without this a fresh `lat init` leaves `lat check index` reporting four
|
|
71
|
+
* missing entries, which is a poor first impression of a tool whose whole
|
|
72
|
+
* pitch is that the check passes. Each directory is tested for separately: an
|
|
73
|
+
* index that already links `reference/` used to suppress the other three, so
|
|
74
|
+
* the three unlinked directories this had just created turned a passing
|
|
75
|
+
* `lat check index` into a failing one.
|
|
76
|
+
*/
|
|
77
|
+
export declare function listModeDirs(content: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Scaffold the four mode directories and turn the gate on.
|
|
80
|
+
*
|
|
81
|
+
* Nothing at all happens when the gate cannot land in the root index. A tree
|
|
82
|
+
* left with four new directories and the gate still off is worse than one left
|
|
83
|
+
* alone: `checkMode` passes on it, so nothing ever says the adoption stopped
|
|
84
|
+
* half way — and if the index was not rewritten to list them, `lat check index`
|
|
85
|
+
* fails instead, on four directories the user never asked for.
|
|
86
|
+
*/
|
|
87
|
+
export declare function writeForkScaffold(latDir: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Offer the gate to a tree `lat init` did not create.
|
|
90
|
+
*
|
|
91
|
+
* `writeForkScaffold` runs only on the branch that creates `lat.md/`, which
|
|
92
|
+
* left the flag unreachable for every project that already had one — that is,
|
|
93
|
+
* for every project that needs it. Restructuring someone's tree without asking
|
|
94
|
+
* is still wrong, so this asks.
|
|
95
|
+
*
|
|
96
|
+
* Whether the flag *can* be written is decided before anything is asked and
|
|
97
|
+
* before anything is written. Asking first cost a tree four directories and a
|
|
98
|
+
* rewritten index in exchange for a gate that never landed, and the user was
|
|
99
|
+
* told in the same breath that nothing could be edited.
|
|
100
|
+
*
|
|
101
|
+
* Silent when the flag is already set either way, when a previous run was told
|
|
102
|
+
* no, and when there is no TTY to ask — the non-interactive path prints the
|
|
103
|
+
* count and the manual edit instead, and records nothing, so a later
|
|
104
|
+
* interactive run still offers.
|
|
105
|
+
*/
|
|
106
|
+
export declare function offerRequireMode(latDir: string, interactive: boolean, ask: (message: string) => Promise<boolean>): Promise<void>;
|