@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.
Files changed (341) hide show
  1. package/README.md +31 -2
  2. package/dist/src/cli/agent-invocation.d.ts +6 -0
  3. package/dist/src/cli/agent-invocation.js +23 -0
  4. package/dist/src/cli/checklist-menu.d.ts +2 -1
  5. package/dist/src/cli/checklist-menu.js +3 -2
  6. package/dist/src/cli/comment-guard.d.ts +14 -0
  7. package/dist/src/cli/comment-guard.js +10 -33
  8. package/dist/src/cli/comment-reminder.d.ts +65 -6
  9. package/dist/src/cli/comment-reminder.js +164 -28
  10. package/dist/src/cli/fork-instructions.d.ts +20 -0
  11. package/dist/src/cli/fork-instructions.js +184 -0
  12. package/dist/src/cli/fork-scaffold.d.ts +106 -0
  13. package/dist/src/cli/fork-scaffold.js +490 -0
  14. package/dist/src/cli/graph.d.ts +1 -1
  15. package/dist/src/cli/hook.d.ts +26 -0
  16. package/dist/src/cli/hook.js +118 -46
  17. package/dist/src/cli/index.js +166 -64
  18. package/dist/src/cli/init-preferences.d.ts +4 -0
  19. package/dist/src/cli/init-preferences.js +36 -0
  20. package/dist/src/cli/init.d.ts +2 -1
  21. package/dist/src/cli/init.js +107 -50
  22. package/dist/src/cli/reindex.d.ts +1 -1
  23. package/dist/src/cli/reindex.js +7 -10
  24. package/dist/src/cli/search.d.ts +14 -4
  25. package/dist/src/cli/search.js +116 -100
  26. package/dist/src/cli/ui-build-server.d.ts +12 -0
  27. package/dist/src/cli/ui-build-server.js +26 -0
  28. package/dist/src/cli/ui-build.d.ts +4 -0
  29. package/dist/src/cli/ui-build.js +13 -0
  30. package/dist/src/cli/ui.d.ts +1 -1
  31. package/dist/src/cli/ui.js +18 -2
  32. package/dist/src/fork/antigravity-hook.d.ts +47 -0
  33. package/dist/src/fork/antigravity-hook.js +424 -0
  34. package/dist/src/fork/antigravity-init.d.ts +17 -0
  35. package/dist/src/fork/antigravity-init.js +124 -0
  36. package/dist/src/fork/upstream-drift-cli.js +2 -0
  37. package/dist/src/fork/upstream-drift.d.ts +26 -0
  38. package/dist/src/fork/upstream-drift.js +185 -0
  39. package/dist/src/fork/upstream-guard-cli.d.ts +1 -0
  40. package/dist/src/fork/upstream-guard-cli.js +2 -0
  41. package/dist/src/fork/upstream-guard.d.ts +72 -0
  42. package/dist/src/fork/upstream-guard.js +445 -0
  43. package/dist/src/graph-export.d.ts +2 -0
  44. package/dist/src/graph-export.js +38 -19
  45. package/dist/src/knowledge/claude-memory.d.ts +1 -0
  46. package/dist/src/knowledge/claude-memory.js +33 -4
  47. package/dist/src/knowledge/index.js +2 -2
  48. package/dist/src/mcp/server.js +34 -18
  49. package/dist/src/search/cache.d.ts +3 -0
  50. package/dist/src/search/cache.js +104 -0
  51. package/dist/src/search/chunks.d.ts +23 -0
  52. package/dist/src/search/chunks.js +197 -0
  53. package/dist/src/search/db.d.ts +28 -16
  54. package/dist/src/search/db.js +106 -40
  55. package/dist/src/search/embedder.d.ts +2 -1
  56. package/dist/src/search/embedder.js +7 -6
  57. package/dist/src/search/index.d.ts +6 -2
  58. package/dist/src/search/index.js +176 -53
  59. package/dist/src/search/lexical.d.ts +6 -0
  60. package/dist/src/search/lexical.js +36 -0
  61. package/dist/src/search/lock.d.ts +5 -0
  62. package/dist/src/search/lock.js +45 -0
  63. package/dist/src/search/query.d.ts +26 -0
  64. package/dist/src/search/query.js +103 -0
  65. package/dist/src/search/search.d.ts +17 -7
  66. package/dist/src/search/search.js +164 -14
  67. package/dist/src/search/types.d.ts +15 -0
  68. package/dist/src/search/types.js +1 -0
  69. package/dist/src/view/client/assets/GraphView-Dij8mAA_.js +456 -0
  70. package/dist/src/view/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  71. package/dist/src/view/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  72. package/dist/src/view/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  73. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  74. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  75. package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  76. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  77. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  78. package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  79. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  80. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  81. package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  82. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  83. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  84. package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  85. package/dist/src/view/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  86. package/dist/src/view/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  87. package/dist/src/view/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  88. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  89. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  90. package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  91. package/dist/src/view/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  92. package/dist/src/view/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  93. package/dist/src/view/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  94. package/dist/src/view/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  95. package/dist/src/view/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  96. package/dist/src/view/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  97. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  98. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  99. package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  100. package/dist/src/view/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  101. package/dist/src/view/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  102. package/dist/src/view/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  103. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  104. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  105. package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  106. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  107. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  108. package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  109. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  110. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  111. package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  112. package/dist/src/view/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  113. package/dist/src/view/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  114. package/dist/src/view/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  115. package/dist/src/view/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  116. package/dist/src/view/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  117. package/dist/src/view/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  118. package/dist/src/view/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  119. package/dist/src/view/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  120. package/dist/src/view/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  121. package/dist/src/view/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  122. package/dist/src/view/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  123. package/dist/src/view/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  124. package/dist/src/view/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  125. package/dist/src/view/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  126. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  127. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  128. package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  129. package/dist/src/view/client/assets/MarkdownEditor-88Wbt0M1.js +28 -0
  130. package/dist/src/view/client/assets/OrbitControls-DwcpQNja.js +1 -0
  131. package/dist/src/view/client/assets/STLLoader-CLWTKt5i.js +1 -0
  132. package/dist/src/view/client/assets/_commonjsHelpers-CqkleIqs.js +1 -0
  133. package/dist/src/view/client/assets/abnfDiagram-VCTEODGH-y0DlYa8E.js +1 -0
  134. package/dist/src/view/client/assets/arc-FlMu8dnO.js +1 -0
  135. package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-DA_uWZW1.js +36 -0
  136. package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-BHQ5LU85.js +129 -0
  137. package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-BRucKCt2.js +38 -0
  138. package/dist/src/view/client/assets/channel-BgDNA_Ay.js +1 -0
  139. package/dist/src/view/client/assets/chunk-2Q5K7J3B-BJPcFivt.js +1 -0
  140. package/dist/src/view/client/assets/chunk-5VM5RSS4-v2q99bGz.js +15 -0
  141. package/dist/src/view/client/assets/chunk-F27PBJKO-CcHOuJCs.js +1 -0
  142. package/dist/src/view/client/assets/chunk-IMKFNOWR-DNxYuJNq.js +231 -0
  143. package/dist/src/view/client/assets/chunk-JWPE2WC7-C0eHKvLW.js +1 -0
  144. package/dist/src/view/client/assets/chunk-POPQ4Y6H-57CWp2Ve.js +1 -0
  145. package/dist/src/view/client/assets/chunk-SVP7TREG-BqcoxIJw.js +88 -0
  146. package/dist/src/view/client/assets/chunk-TICWLB2K-DRUJR5zH.js +206 -0
  147. package/dist/src/view/client/assets/chunk-XXDRQBXY-Dez0oRoM.js +1 -0
  148. package/dist/src/view/client/assets/classDiagram-ZZMXUADV-CFZ_Sgh5.js +1 -0
  149. package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-CFZ_Sgh5.js +1 -0
  150. package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-BHtud6Hg.js +1 -0
  151. package/dist/src/view/client/assets/cynefin-OW5HDTMX-BjBW8VGk.js +166 -0
  152. package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-DwGuD7oF.js +62 -0
  153. package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
  154. package/dist/src/view/client/assets/dagre-GXQ25YYZ-C5zSlGK9.js +4 -0
  155. package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
  156. package/dist/src/view/client/assets/diagram-S7CK7UJ4-C_NhA3bj.js +30 -0
  157. package/dist/src/view/client/assets/diagram-UQ7AKVKN-az7QPYNb.js +41 -0
  158. package/dist/src/view/client/assets/diagram-VSXAHHWV-BRvDuM8_.js +3 -0
  159. package/dist/src/view/client/assets/diagram-VX7I27RA-BWLgF6S-.js +24 -0
  160. package/dist/src/view/client/assets/diagram-Z3DM3KII-DV3d6mL5.js +24 -0
  161. package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-yUXrEAvK.js +1 -0
  162. package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-D35FN1Pt.js +99 -0
  163. package/dist/src/view/client/assets/flowDiagram-HODETNUW-BciZqsjT.js +168 -0
  164. package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-BysPGgXS.js +292 -0
  165. package/dist/src/view/client/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  166. package/dist/src/view/client/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  167. package/dist/src/view/client/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  168. package/dist/src/view/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  169. package/dist/src/view/client/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  170. package/dist/src/view/client/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  171. package/dist/src/view/client/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  172. package/dist/src/view/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  173. package/dist/src/view/client/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  174. package/dist/src/view/client/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  175. package/dist/src/view/client/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  176. package/dist/src/view/client/assets/gitGraphDiagram-WWUBYQGX-C3DdJ5xG.js +106 -0
  177. package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
  178. package/dist/src/view/client/assets/index-CJokoRSp.js +13 -0
  179. package/dist/src/view/client/assets/index-DG0Ez15D.css +1 -0
  180. package/dist/src/view/client/assets/infoDiagram-27XIBGKW-D3HZrDRb.js +2 -0
  181. package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
  182. package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-BXyVIXTU.js +70 -0
  183. package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-D4-1NxVU.js +139 -0
  184. package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-4Gu_5yBA.js +89 -0
  185. package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
  186. package/dist/src/view/client/assets/layout-Jf1K3TMM.js +1 -0
  187. package/dist/src/view/client/assets/linear-DWfwzUT_.js +1 -0
  188. package/dist/src/view/client/assets/logo-RR_KBOAT.svg +149 -0
  189. package/dist/src/view/client/assets/maplibre-gl-CDX6Zuow.js +800 -0
  190. package/dist/src/view/client/assets/mermaid.core-DMx_DAl8.js +310 -0
  191. package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-8pxY_RWi.js +96 -0
  192. package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
  193. package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-DNAw_O5t.js +1 -0
  194. package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-uuvRCDkC.js +39 -0
  195. package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC-BER2O4Aq.js +7 -0
  196. package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-CxEsJ_0n.js +1 -0
  197. package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-yS9rspca.js +84 -0
  198. package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-Bqt70a2j.js +40 -0
  199. package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-BvOOEJNr.js +162 -0
  200. package/dist/src/view/client/assets/sizeCapture-INFHLROL-CvO_Pjjo.js +1 -0
  201. package/dist/src/view/client/assets/stateDiagram-D77RDMKH-KLmVOZkq.js +1 -0
  202. package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-KCS8Mdzu.js +1 -0
  203. package/dist/src/view/client/assets/swimlanes-42K2YHIH-DC1r4_sq.js +1 -0
  204. package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-B2TcAwis.js +8 -0
  205. package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
  206. package/dist/src/view/client/assets/timeline-definition-24CTP7MA-ChXLOuBL.js +120 -0
  207. package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-D9_h25-Y.js +34 -0
  208. package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-CsQJGGW0.js +78 -0
  209. package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-DGMuPMlm.js +7 -0
  210. package/dist/src/view/client/index.html +2 -2
  211. package/dist/src/view/client-shell.d.ts +2 -0
  212. package/dist/src/view/client-shell.js +5 -0
  213. package/dist/src/view/diagnostics.d.ts +3 -2
  214. package/dist/src/view/diagnostics.js +49 -58
  215. package/dist/src/view/document-edit.d.ts +8 -0
  216. package/dist/src/view/document-edit.js +25 -0
  217. package/dist/src/view/document-route.d.ts +14 -0
  218. package/dist/src/view/document-route.js +126 -0
  219. package/dist/src/view/document-tree.d.ts +18 -0
  220. package/dist/src/view/document-tree.js +139 -0
  221. package/dist/src/view/external-document-tree.d.ts +3 -0
  222. package/dist/src/view/external-document-tree.js +674 -0
  223. package/dist/src/view/git-diff.js +205 -1
  224. package/dist/src/view/git.js +1 -1
  225. package/dist/src/view/graph.d.ts +7 -0
  226. package/dist/src/view/graph.js +267 -0
  227. package/dist/src/view/highlight.d.ts +10 -2
  228. package/dist/src/view/highlight.js +4547 -1363
  229. package/dist/src/view/markdown.d.ts +8 -3
  230. package/dist/src/view/markdown.js +308 -41
  231. package/dist/src/view/preindexed-search.d.ts +15 -0
  232. package/dist/src/view/preindexed-search.js +25 -0
  233. package/dist/src/view/protocol.d.ts +95 -6
  234. package/dist/src/view/protocol.js +1 -1
  235. package/dist/src/view/publication.d.ts +2 -0
  236. package/dist/src/view/publication.js +78 -0
  237. package/dist/src/view/references.d.ts +13 -26
  238. package/dist/src/view/references.js +150 -119
  239. package/dist/src/view/repository.d.ts +18 -5
  240. package/dist/src/view/repository.js +269 -27
  241. package/dist/src/view/request-security.d.ts +5 -0
  242. package/dist/src/view/request-security.js +46 -0
  243. package/dist/src/view/search-result.d.ts +4 -0
  244. package/dist/src/view/search-result.js +25 -0
  245. package/dist/src/view/search.d.ts +7 -2
  246. package/dist/src/view/search.js +23 -33
  247. package/dist/src/view/server-build.d.ts +21 -0
  248. package/dist/src/view/server-build.js +145 -0
  249. package/dist/src/view/server-deployment.d.ts +31 -0
  250. package/dist/src/view/server-deployment.js +94 -0
  251. package/dist/src/view/server-index-worker.d.ts +6 -0
  252. package/dist/src/view/server-index-worker.js +14 -0
  253. package/dist/src/view/server.d.ts +14 -2
  254. package/dist/src/view/server.js +254 -51
  255. package/dist/src/view/source-target.d.ts +10 -0
  256. package/dist/src/view/source-target.js +43 -0
  257. package/dist/src/view/static-build.d.ts +32 -0
  258. package/dist/src/view/static-build.js +741 -0
  259. package/dist/src/view/static-protocol.d.ts +47 -0
  260. package/dist/src/view/static-protocol.js +15 -0
  261. package/dist/src/view/store.d.ts +26 -3
  262. package/dist/src/view/store.js +325 -44
  263. package/dist/src/view/table-of-contents.d.ts +9 -0
  264. package/dist/src/view/table-of-contents.js +83 -0
  265. package/dist/src/view/vercel-build.d.ts +24 -0
  266. package/dist/src/view/vercel-build.js +140 -0
  267. package/dist/src/view/vercel-server-build.d.ts +10 -0
  268. package/dist/src/view/vercel-server-build.js +61 -0
  269. package/dist/vendor/lat.md-server/cli.d.ts +2 -0
  270. package/dist/vendor/lat.md-server/cli.js +12 -0
  271. package/dist/vendor/lat.md-server/index.d.ts +38 -0
  272. package/dist/vendor/lat.md-server/index.js +128 -0
  273. package/package.json +72 -25
  274. package/plugins/lat-md/README.md +61 -0
  275. package/plugins/lat-md/hooks.json +38 -0
  276. package/plugins/lat-md/plugin.json +9 -0
  277. package/plugins/lat-md/rules/AGENTS.md +118 -0
  278. package/plugins/lat-md/skills/lat-md/SKILL.md +178 -0
  279. package/plugins/lat-md/skills/lat-md-conventions/SKILL.md +182 -0
  280. package/templates/AGENTS.md +19 -18
  281. package/templates/cursor-rules.md +14 -5
  282. package/templates/fork/conventions.md +173 -0
  283. package/templates/opencode-plugin.ts +9 -9
  284. package/templates/pi-extension.ts +11 -11
  285. package/templates/skill/SKILL.md +28 -17
  286. package/dist/src/cli/check-frontmatter.d.ts +0 -12
  287. package/dist/src/cli/check-frontmatter.js +0 -44
  288. package/dist/src/cli/check-mode.d.ts +0 -6
  289. package/dist/src/cli/check-mode.js +0 -303
  290. package/dist/src/cli/check-status.d.ts +0 -74
  291. package/dist/src/cli/check-status.js +0 -217
  292. package/dist/src/cli/check.d.ts +0 -45
  293. package/dist/src/cli/check.js +0 -777
  294. package/dist/src/cli/context.d.ts +0 -11
  295. package/dist/src/cli/context.js +0 -58
  296. package/dist/src/cli/expand.d.ts +0 -8
  297. package/dist/src/cli/expand.js +0 -94
  298. package/dist/src/cli/gen-index.d.ts +0 -45
  299. package/dist/src/cli/gen-index.js +0 -235
  300. package/dist/src/cli/link-scheme.d.ts +0 -54
  301. package/dist/src/cli/link-scheme.js +0 -101
  302. package/dist/src/cli/locate.d.ts +0 -2
  303. package/dist/src/cli/locate.js +0 -17
  304. package/dist/src/cli/refs.d.ts +0 -22
  305. package/dist/src/cli/refs.js +0 -229
  306. package/dist/src/cli/section.d.ts +0 -43
  307. package/dist/src/cli/section.js +0 -252
  308. package/dist/src/cli/select-menu.d.ts +0 -13
  309. package/dist/src/cli/select-menu.js +0 -100
  310. package/dist/src/code-refs.d.ts +0 -17
  311. package/dist/src/code-refs.js +0 -277
  312. package/dist/src/config.d.ts +0 -29
  313. package/dist/src/config.js +0 -83
  314. package/dist/src/context.d.ts +0 -23
  315. package/dist/src/context.js +0 -11
  316. package/dist/src/extensions/wiki-link/from-markdown.d.ts +0 -5
  317. package/dist/src/extensions/wiki-link/from-markdown.js +0 -34
  318. package/dist/src/extensions/wiki-link/index.d.ts +0 -4
  319. package/dist/src/extensions/wiki-link/index.js +0 -3
  320. package/dist/src/extensions/wiki-link/syntax.d.ts +0 -14
  321. package/dist/src/extensions/wiki-link/syntax.js +0 -121
  322. package/dist/src/extensions/wiki-link/to-markdown.d.ts +0 -5
  323. package/dist/src/extensions/wiki-link/to-markdown.js +0 -28
  324. package/dist/src/extensions/wiki-link/types.d.ts +0 -34
  325. package/dist/src/format.d.ts +0 -8
  326. package/dist/src/format.js +0 -43
  327. package/dist/src/init-version.d.ts +0 -10
  328. package/dist/src/init-version.js +0 -49
  329. package/dist/src/lattice.d.ts +0 -108
  330. package/dist/src/lattice.js +0 -816
  331. package/dist/src/parser.d.ts +0 -3
  332. package/dist/src/parser.js +0 -18
  333. package/dist/src/source-parser.d.ts +0 -27
  334. package/dist/src/source-parser.js +0 -916
  335. package/dist/src/untrusted.d.ts +0 -24
  336. package/dist/src/untrusted.js +0 -97
  337. package/dist/src/view/client/assets/index-B0n0u03y.css +0 -1
  338. package/dist/src/view/client/assets/index-xm2_px4q.js +0 -23
  339. package/dist/src/walk.d.ts +0 -18
  340. package/dist/src/walk.js +0 -27
  341. /package/dist/src/{extensions/wiki-link/types.js → fork/upstream-drift-cli.d.ts} +0 -0
@@ -0,0 +1,140 @@
1
+ import { cp, lstat, mkdir, mkdtemp, readFile, rename, rm, writeFile, } from 'node:fs/promises';
2
+ import { dirname, isAbsolute, join, resolve, sep } from 'node:path';
3
+ import { nodeFileTrace } from '@vercel/nft';
4
+ import { LAT_UI_CONTENT_SECURITY_POLICY } from '../../vendor/lat.md-server/index.js';
5
+ import { INDEX_FILE, hasIndex } from '../search/db.js';
6
+ const defaultDependencies = {
7
+ traceFiles: nodeFileTrace,
8
+ };
9
+ function json(value) {
10
+ return `${JSON.stringify(value, null, 2)}\n`;
11
+ }
12
+ function basePathSegments(basePath) {
13
+ const parsed = new URL(basePath, 'http://lat.local');
14
+ if (parsed.origin !== 'http://lat.local' ||
15
+ parsed.search ||
16
+ parsed.hash ||
17
+ !basePath.startsWith('/')) {
18
+ throw new Error(`Invalid Lat UI server base path: ${basePath}`);
19
+ }
20
+ return parsed.pathname
21
+ .split('/')
22
+ .filter(Boolean)
23
+ .map((part) => {
24
+ const decoded = decodeURIComponent(part);
25
+ if (decoded === '.' ||
26
+ decoded === '..' ||
27
+ decoded.includes('/') ||
28
+ decoded.includes('\\')) {
29
+ throw new Error(`Invalid Lat UI server base path: ${basePath}`);
30
+ }
31
+ return decoded;
32
+ });
33
+ }
34
+ function safeTracePath(path) {
35
+ if (isAbsolute(path) ||
36
+ path === '..' ||
37
+ path.startsWith(`..${sep}`) ||
38
+ path.split(/[\\/]/).includes('..')) {
39
+ throw new Error(`Node file trace escaped the server artifact: ${path}`);
40
+ }
41
+ return path;
42
+ }
43
+ function outputConfig() {
44
+ const securityHeaders = {
45
+ 'Content-Security-Policy': LAT_UI_CONTENT_SECURITY_POLICY,
46
+ 'Referrer-Policy': 'no-referrer',
47
+ 'X-Content-Type-Options': 'nosniff',
48
+ };
49
+ const immutableHeaders = {
50
+ 'Cache-Control': 'public, max-age=31536000, immutable',
51
+ };
52
+ return {
53
+ version: 3,
54
+ routes: [
55
+ { src: '/(.*)', headers: securityHeaders, continue: true },
56
+ {
57
+ src: '/(?:.*?/)?assets/.*',
58
+ headers: immutableHeaders,
59
+ continue: true,
60
+ },
61
+ {
62
+ src: '/(?:.*?/)?data/[^/]+/[a-f0-9]{20}\\.json',
63
+ headers: immutableHeaders,
64
+ continue: true,
65
+ },
66
+ { handle: 'filesystem' },
67
+ { src: '/', dest: '/index.html' },
68
+ { src: '/(.*)/', dest: '/$1/index.html' },
69
+ { src: '/(.*)', dest: '/$1/index.html' },
70
+ ],
71
+ };
72
+ }
73
+ /** Convert an installed portable Lat UI server into Vercel Build Output API v3. */
74
+ export async function buildVercelOutput(requestedArtifact, requestedOutput = '.vercel/output', options = {}, dependencies = defaultDependencies) {
75
+ const artifactDir = resolve(requestedArtifact);
76
+ const outputDir = resolve(requestedOutput);
77
+ if (!options.force) {
78
+ try {
79
+ await lstat(outputDir);
80
+ throw new Error(`Vercel build output already exists: ${outputDir}. Use force to replace it.`);
81
+ }
82
+ catch (error) {
83
+ if (error.code !== 'ENOENT')
84
+ throw error;
85
+ }
86
+ }
87
+ const manifestFile = join(artifactDir, 'server-data', 'server.json');
88
+ const manifest = JSON.parse(await readFile(manifestFile, 'utf8'));
89
+ if (typeof manifest.basePath !== 'string') {
90
+ throw new Error(`Invalid Lat UI server manifest: ${manifestFile}`);
91
+ }
92
+ const entrypoint = join(artifactDir, 'app.mjs');
93
+ const trace = await dependencies.traceFiles([entrypoint], {
94
+ base: artifactDir,
95
+ conditions: ['node', 'production'],
96
+ exportsOnly: true,
97
+ processCwd: artifactDir,
98
+ });
99
+ for (const warning of trace.warnings) {
100
+ options.warn?.(`Node file trace: ${warning.message}`);
101
+ }
102
+ // Keep the database in the function even if tracing cannot infer the asset.
103
+ if (!hasIndex(join(artifactDir, 'server-data'))) {
104
+ throw new Error('Missing hybrid search database; rebuild this deployment.');
105
+ }
106
+ trace.fileList.add('server-data/server.json');
107
+ trace.fileList.add(`server-data/${INDEX_FILE}`);
108
+ await mkdir(dirname(outputDir), { recursive: true });
109
+ const stagingDir = await mkdtemp(join(dirname(outputDir), '.lat-vercel-staging-'));
110
+ try {
111
+ const staticDir = join(stagingDir, 'static');
112
+ const functionPath = join('functions', ...basePathSegments(manifest.basePath), 'api', 'search.func');
113
+ const functionDir = join(stagingDir, functionPath);
114
+ await cp(join(artifactDir, 'public'), staticDir, { recursive: true });
115
+ for (const traced of trace.fileList) {
116
+ const path = safeTracePath(traced);
117
+ const destination = join(functionDir, path);
118
+ await mkdir(dirname(destination), { recursive: true });
119
+ await cp(join(artifactDir, path), destination, {
120
+ dereference: true,
121
+ recursive: true,
122
+ });
123
+ }
124
+ await writeFile(join(functionDir, '.vc-config.json'), json({
125
+ runtime: 'nodejs22.x',
126
+ handler: 'app.mjs',
127
+ launcherType: 'Nodejs',
128
+ shouldAddHelpers: true,
129
+ }));
130
+ await writeFile(join(stagingDir, 'config.json'), json(outputConfig()));
131
+ if (options.force)
132
+ await rm(outputDir, { recursive: true, force: true });
133
+ await rename(stagingDir, outputDir);
134
+ return { files: trace.fileList.size, functionPath, outputDir };
135
+ }
136
+ catch (error) {
137
+ await rm(stagingDir, { recursive: true, force: true });
138
+ throw error;
139
+ }
140
+ }
@@ -0,0 +1,10 @@
1
+ import type { CmdContext } from '@plebeiantech/lat.md-core/context';
2
+ import { buildServerView, type ServerViewBuildOptions, type ServerViewBuildResult } from './server-build.js';
3
+ import { type VercelBuildOptions, type VercelBuildResult } from './vercel-build.js';
4
+ export type VercelServerBuildDependencies = {
5
+ buildNode: typeof buildServerView;
6
+ buildOutput: (artifact: string, output: string, options: VercelBuildOptions) => Promise<VercelBuildResult>;
7
+ installDependencies: (artifact: string) => Promise<void>;
8
+ };
9
+ /** Build the portable server in staging, install it, then emit Vercel v3 output. */
10
+ export declare function buildVercelServerView(ctx: CmdContext, requestedOutput: string, options?: ServerViewBuildOptions, dependencies?: VercelServerBuildDependencies): Promise<ServerViewBuildResult>;
@@ -0,0 +1,61 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { mkdir, mkdtemp, rm } from 'node:fs/promises';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { buildServerView, } from './server-build.js';
5
+ import { validateViewBuildOutput } from './static-build.js';
6
+ import { buildVercelOutput, } from './vercel-build.js';
7
+ function installServerDependencies(artifact) {
8
+ const executable = process.platform === 'win32' ? 'npm.cmd' : 'npm';
9
+ const args = [
10
+ 'install',
11
+ '--ignore-scripts',
12
+ '--no-package-lock',
13
+ '--omit=dev',
14
+ '--no-audit',
15
+ '--no-fund',
16
+ ];
17
+ return new Promise((resolveInstall, reject) => {
18
+ const child = spawn(executable, args, { cwd: artifact, stdio: 'inherit' });
19
+ child.once('error', reject);
20
+ child.once('exit', (code, signal) => {
21
+ if (code === 0) {
22
+ resolveInstall();
23
+ return;
24
+ }
25
+ reject(new Error(`npm install failed${signal ? ` with signal ${signal}` : ` with exit code ${code}`}`));
26
+ });
27
+ });
28
+ }
29
+ const defaultDependencies = {
30
+ buildNode: buildServerView,
31
+ buildOutput: buildVercelOutput,
32
+ installDependencies: installServerDependencies,
33
+ };
34
+ /** Build the portable server in staging, install it, then emit Vercel v3 output. */
35
+ export async function buildVercelServerView(ctx, requestedOutput, options = {}, dependencies = defaultDependencies) {
36
+ const outputDir = resolve(ctx.projectRoot, requestedOutput);
37
+ await validateViewBuildOutput(outputDir, ctx.projectRoot, 'Vercel', options.force);
38
+ await mkdir(dirname(outputDir), { recursive: true });
39
+ const stagingDir = await mkdtemp(join(dirname(outputDir), '.lat-vercel-server-'));
40
+ const nodeArtifact = join(stagingDir, 'node');
41
+ try {
42
+ const result = await dependencies.buildNode(ctx, nodeArtifact, {
43
+ ...options,
44
+ force: false,
45
+ });
46
+ await dependencies.installDependencies(nodeArtifact);
47
+ await dependencies.buildOutput(nodeArtifact, outputDir, {
48
+ force: options.force,
49
+ warn: (message) => console.warn(message),
50
+ });
51
+ return { ...result, outputDir };
52
+ }
53
+ finally {
54
+ await rm(stagingDir, {
55
+ recursive: true,
56
+ force: true,
57
+ maxRetries: 10,
58
+ retryDelay: 150,
59
+ });
60
+ }
61
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from 'node:path';
3
+ import { pathToFileURL } from 'node:url';
4
+ import { runLatServer } from './index.js';
5
+ const entry = process.argv[2];
6
+ if (!entry)
7
+ throw new Error('Usage: lat-ui-server <app-module>');
8
+ const module = (await import(pathToFileURL(resolve(entry)).href));
9
+ if (typeof module.default !== 'function') {
10
+ throw new Error(`${entry} must default-export an Express app`);
11
+ }
12
+ await runLatServer(module.default, { close: module.close });
@@ -0,0 +1,38 @@
1
+ import { type IncomingMessage, type RequestListener, type Server, type ServerResponse } from 'node:http';
2
+ import { type Express } from 'express';
3
+ export declare const LAT_UI_CONTENT_SECURITY_POLICY = "default-src 'self'; connect-src 'self' https://tiles.openfreemap.org; font-src 'self' data:; img-src 'self' data: https://github.com https://github.githubassets.com https://img.shields.io; style-src 'self' 'unsafe-inline'; worker-src 'self' blob:; object-src 'none'; base-uri 'none'; frame-ancestors 'none'";
4
+ export type LatServerAppOptions = {
5
+ /** Handle dynamic routes before immutable files and fallback handlers. */
6
+ handle?: LatServerRequestHandler;
7
+ /** Serve a completed Lat UI export after dynamic routes. */
8
+ publicDir?: string;
9
+ };
10
+ export type LatServerApp = RequestListener;
11
+ export type LatServerRequestHandler = (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => void | Promise<void>;
12
+ export type ListenLatServerOptions = {
13
+ host: string;
14
+ port: number;
15
+ /** Advance through occupied ports. Explicit user ports should leave this off. */
16
+ findAvailablePort?: boolean;
17
+ };
18
+ export type RunningLatServer = {
19
+ server: Server;
20
+ host: string;
21
+ port: number;
22
+ url: string;
23
+ close: () => Promise<void>;
24
+ };
25
+ /** Create the common Express stack used by live and exported Lat UI servers. */
26
+ export declare function createLatServerApp(options?: LatServerAppOptions, app?: Express): LatServerApp;
27
+ /** Listen with the same strict-or-next-port behavior in every Lat UI host. */
28
+ export declare function listenLatServer(app: LatServerApp, options: ListenLatServerOptions): Promise<RunningLatServer>;
29
+ export type RunLatServerOptions = {
30
+ host?: string;
31
+ port?: number;
32
+ close?: () => void | Promise<void>;
33
+ log?: (message: string) => void;
34
+ };
35
+ /** Run an exported Express app until the standalone process is terminated. */
36
+ export declare function runLatServer(app: LatServerApp, options?: RunLatServerOptions): Promise<RunningLatServer>;
37
+ /** Read this published package's exact version for generated artifacts. */
38
+ export declare function getLatServerVersion(): string;
@@ -0,0 +1,128 @@
1
+ import { createServer, } from 'node:http';
2
+ import { readFileSync } from 'node:fs';
3
+ import express from 'express';
4
+ export const LAT_UI_CONTENT_SECURITY_POLICY = "default-src 'self'; connect-src 'self' https://tiles.openfreemap.org; font-src 'self' data:; img-src 'self' data: https://github.com https://github.githubassets.com https://img.shields.io; style-src 'self' 'unsafe-inline'; worker-src 'self' blob:; object-src 'none'; base-uri 'none'; frame-ancestors 'none'";
5
+ function setSecurityHeaders(res) {
6
+ res.setHeader('Content-Security-Policy', LAT_UI_CONTENT_SECURITY_POLICY);
7
+ res.setHeader('Referrer-Policy', 'no-referrer');
8
+ res.setHeader('X-Content-Type-Options', 'nosniff');
9
+ }
10
+ function isImmutablePublicFile(path) {
11
+ const parts = path.split(/[/\\]/);
12
+ if (parts.includes('assets'))
13
+ return true;
14
+ return /[/\\]data[/\\][^/\\]+[/\\][a-f0-9]{20}\.json$/.test(path);
15
+ }
16
+ /** Create the common Express stack used by live and exported Lat UI servers. */
17
+ export function createLatServerApp(options = {}, app = express()) {
18
+ app.disable('x-powered-by');
19
+ app.use((_req, res, next) => {
20
+ setSecurityHeaders(res);
21
+ next();
22
+ });
23
+ if (options.handle) {
24
+ app.use((req, res, next) => {
25
+ try {
26
+ void Promise.resolve(options.handle(req, res, next)).catch(next);
27
+ }
28
+ catch (error) {
29
+ next(error);
30
+ }
31
+ });
32
+ }
33
+ if (options.publicDir) {
34
+ app.use(express.static(options.publicDir, {
35
+ setHeaders(res, path) {
36
+ res.setHeader('Cache-Control', isImmutablePublicFile(path)
37
+ ? 'public, max-age=31536000, immutable'
38
+ : 'no-cache');
39
+ },
40
+ }));
41
+ }
42
+ app.use((_req, res) => {
43
+ res.status(404).type('text/plain').send('Not found');
44
+ });
45
+ app.use((error, _req, res, _next) => {
46
+ console.error(error);
47
+ res.status(500).json({ error: 'Internal server error' });
48
+ });
49
+ return app;
50
+ }
51
+ function listen(server, host, port) {
52
+ return new Promise((resolveListen, reject) => {
53
+ const onError = (error) => {
54
+ server.off('listening', onListening);
55
+ reject(error);
56
+ };
57
+ const onListening = () => {
58
+ server.off('error', onError);
59
+ resolveListen();
60
+ };
61
+ server.once('error', onError);
62
+ server.once('listening', onListening);
63
+ server.listen(port, host);
64
+ });
65
+ }
66
+ function closeServer(server) {
67
+ return new Promise((resolveClose, reject) => {
68
+ server.close((error) => (error ? reject(error) : resolveClose()));
69
+ });
70
+ }
71
+ /** Listen with the same strict-or-next-port behavior in every Lat UI host. */
72
+ export async function listenLatServer(app, options) {
73
+ const server = createServer(app);
74
+ let port = options.port;
75
+ while (true) {
76
+ try {
77
+ await listen(server, options.host, port);
78
+ break;
79
+ }
80
+ catch (error) {
81
+ if (!options.findAvailablePort ||
82
+ error.code !== 'EADDRINUSE' ||
83
+ port === 65_535) {
84
+ throw error;
85
+ }
86
+ port++;
87
+ }
88
+ }
89
+ const address = server.address();
90
+ if (!address) {
91
+ await closeServer(server);
92
+ throw new Error('Could not determine Lat UI server address');
93
+ }
94
+ return {
95
+ server,
96
+ host: options.host,
97
+ port: address.port,
98
+ url: `http://${options.host}:${address.port}/`,
99
+ close: () => closeServer(server),
100
+ };
101
+ }
102
+ /** Run an exported Express app until the standalone process is terminated. */
103
+ export async function runLatServer(app, options = {}) {
104
+ const host = options.host ?? process.env.HOST ?? '0.0.0.0';
105
+ const rawPort = options.port ?? Number(process.env.PORT ?? 3000);
106
+ if (!Number.isInteger(rawPort) || rawPort < 1 || rawPort > 65_535) {
107
+ throw new Error('PORT must be an integer from 1 to 65535');
108
+ }
109
+ const running = await listenLatServer(app, { host, port: rawPort });
110
+ (options.log ?? console.log)(`Lat UI listening on ${running.url}`);
111
+ let closing = false;
112
+ const shutdown = () => {
113
+ if (closing)
114
+ return;
115
+ closing = true;
116
+ void Promise.all([running.close(), options.close?.()]).catch((error) => {
117
+ console.error(error);
118
+ process.exitCode = 1;
119
+ });
120
+ };
121
+ process.once('SIGINT', shutdown);
122
+ process.once('SIGTERM', shutdown);
123
+ return running;
124
+ }
125
+ /** Read this published package's exact version for generated artifacts. */
126
+ export function getLatServerVersion() {
127
+ return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
128
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plebeiantech/lat.md",
3
- "version": "0.12.3-fork.2",
3
+ "version": "0.12.3-fork.20",
4
4
  "description": "A knowledge graph for your codebase, written in markdown",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,64 +22,111 @@
22
22
  "bin": {
23
23
  "lat": "./dist/src/cli/index.js"
24
24
  },
25
+ "exports": {
26
+ "./server": {
27
+ "types": "./dist/src/view/server-deployment.d.ts",
28
+ "import": "./dist/src/view/server-deployment.js"
29
+ }
30
+ },
25
31
  "files": [
26
32
  "dist/src",
27
- "templates"
33
+ "dist/vendor",
34
+ "templates",
35
+ "plugins"
28
36
  ],
29
37
  "devDependencies": {
38
+ "@codemirror/commands": "^6.11.0",
39
+ "@codemirror/lang-markdown": "^6.5.2",
40
+ "@codemirror/language": "^6.12.4",
41
+ "@codemirror/merge": "^6.12.2",
42
+ "@codemirror/state": "^6.7.1",
43
+ "@codemirror/view": "^6.43.9",
44
+ "@fontsource-variable/geist": "^5.3.0",
45
+ "@fontsource-variable/geist-mono": "^5.3.0",
46
+ "@lezer/highlight": "^1.2.3",
47
+ "@types/express": "^5.0.6",
48
+ "@types/geojson": "^7946.0.16",
49
+ "@types/hast": "^3.0.5",
50
+ "@types/mdast": "^4.0.4",
51
+ "@types/node": "^25.3.0",
30
52
  "@types/react": "^19.0.0",
31
53
  "@types/react-dom": "^19.0.0",
54
+ "@types/three": "^0.185.4",
55
+ "@types/topojson-client": "^3.1.5",
32
56
  "@vitejs/plugin-react": "^5.0.0",
33
- "@types/mdast": "^4.0.4",
34
- "@types/node": "^25.3.0",
57
+ "graphology": "^0.26.0",
35
58
  "highlight.js": "^11.12.0",
59
+ "jsdom": "^30.0.1",
60
+ "katex": "^0.18.4",
61
+ "lowlight": "^3.3.0",
62
+ "maplibre-gl": "^5.24.0",
36
63
  "mdast-util-from-markdown": "^2.0.3",
64
+ "mermaid": "^11.17.2",
37
65
  "micromark-util-types": "^2.0.2",
38
66
  "prettier": "^3.8.1",
39
67
  "react": "^19.0.0",
40
68
  "react-dom": "^19.0.0",
69
+ "rehype-stringify": "^10.0.1",
70
+ "sigma": "^3.0.3",
71
+ "three": "^0.185.1",
72
+ "topojson-client": "^3.1.0",
41
73
  "tsx": "^4.21.0",
42
- "typescript": "^5.7.0",
74
+ "typescript": "7.0.2",
43
75
  "vite": "^7.0.0",
44
- "vitest": "^3.0.0"
76
+ "vitest": "^3.0.0",
77
+ "web-tree-sitter": "^0.26.6",
78
+ "micromark-extension-gfm-table": "^2.1.1",
79
+ "mdast-util-gfm-table": "^2.0.0",
80
+ "remark-math": "^6.0.0",
81
+ "@folder/xdg": "^4.0.1",
82
+ "@lat.md/server": "0.1.0"
45
83
  },
46
84
  "dependencies": {
47
- "@folder/xdg": "^4.0.1",
85
+ "@asciidoctor/core": "4.0.6",
48
86
  "@libsql/client": "^0.17.0",
49
87
  "@modelcontextprotocol/sdk": "^1.27.1",
50
- "@repomix/tree-sitter-wasms": "^0.1.16",
88
+ "@tursodatabase/database": "0.7.2",
89
+ "@vercel/nft": "^1.10.0",
51
90
  "commander": "^14.0.3",
52
- "github-slugger": "^2.0.0",
53
- "ignore-walk": "^8.0.0",
54
- "mdast-util-to-markdown": "^2.1.0",
55
- "remark-frontmatter": "^5.0.0",
56
- "remark-parse": "^11.0.0",
57
- "remark-rehype": "^11.1.2",
58
- "remark-stringify": "^11.0.0",
91
+ "diff": "^8.0.4",
92
+ "express": "^5.2.1",
93
+ "fs-native-extensions": "1.5.1",
94
+ "rehype-katex": "^7.0.1",
95
+ "rehype-raw": "^7.0.0",
59
96
  "rehype-sanitize": "^6.0.0",
60
97
  "rehype-slug": "^6.0.0",
61
- "rehype-stringify": "^10.0.1",
98
+ "remark-emoji": "^5.0.2",
99
+ "remark-rehype": "^11.1.2",
100
+ "rst-compiler": "0.5.9",
62
101
  "unified": "^11.0.0",
63
102
  "unist-util-visit": "^5.0.0",
64
- "web-tree-sitter": "^0.26.6",
65
103
  "yaml": "^2.8.2",
66
104
  "zod": "^4.3.6",
67
- "@lat.md/embed": "0.2.0",
68
- "@lat.md/embed-minilm-fp16": "0.1.0"
105
+ "@lat.md/embed": "0.2.1",
106
+ "@plebeiantech/lat.md-core": "0.12.3-fork.20",
107
+ "@lat.md/embed-minilm-fp16": "0.1.0",
108
+ "@lat.md/stemmer": "0.1.0"
69
109
  },
70
110
  "scripts": {
71
- "build": "tsc && pnpm build:view",
111
+ "build": "tsc && tsx scripts/fork-vendor-ui-server.ts && pnpm build:view",
72
112
  "build:view": "vite build --config view/vite.config.ts && vite build --config view/highlight.vite.config.ts",
113
+ "build:site": "pnpm --filter @lat.md/server build && node scripts/prepare-site-packages.mjs && pnpm build && node dist/src/cli/index.js ui build server --force",
114
+ "build:site:vercel": "pnpm build:site && node scripts/vendor-site-packages.mjs && npm install --prefix .lat-build/server --ignore-scripts --no-package-lock && node scripts/build-vercel-output.mjs",
115
+ "build:site:source": "pnpm buildall && node dist/src/cli/index.js ui build server --force",
73
116
  "buildall": "pnpm build:packages && pnpm build",
74
117
  "setup:rust": "pnpm --filter @lat.md/embed setup:rust",
75
118
  "build:wasm": "pnpm --filter @lat.md/embed build:wasm",
76
119
  "build:weights": "pnpm --filter @lat.md/embed-minilm-fp16 build:weights",
77
- "build:packages": "pnpm --filter @lat.md/embed build && pnpm --filter @lat.md/embed-minilm-fp16 build",
120
+ "build:packages": "pnpm build:core && pnpm --filter @lat.md/server build && pnpm --filter @lat.md/stemmer build && pnpm --filter @lat.md/embed build && pnpm --filter @lat.md/embed-minilm-fp16 build",
78
121
  "test": "vitest run",
79
122
  "test:watch": "vitest",
80
- "typecheck": "tsc --noEmit && tsc --noEmit -p view/tsconfig.json",
81
- "format": "prettier --write \"src/**/*.ts\" \"view/**/*.{ts,tsx,css,html}\"",
82
- "format:check": "prettier --check \"src/**/*.ts\" \"view/**/*.{ts,tsx,css,html}\"",
83
- "cook-test-rag": "tsx scripts/cook-test-rag.ts"
123
+ "typecheck": "pnpm build:core && pnpm --filter @lat.md/server build && tsc --noEmit && tsc --noEmit -p view/tsconfig.json",
124
+ "format": "prettier --write \"src/**/*.ts\" \"packages/core/src/**/*.ts\" \"packages/server/src/**/*.ts\" \"view/**/*.{ts,tsx,css,html}\"",
125
+ "format:check": "prettier --check \"src/**/*.ts\" \"packages/core/src/**/*.ts\" \"packages/server/src/**/*.ts\" \"view/**/*.{ts,tsx,css,html}\"",
126
+ "cook-test-rag": "tsx scripts/cook-test-rag.ts",
127
+ "build:core": "pnpm --filter @plebeiantech/lat.md-core build",
128
+ "build:action": "pnpm build:core && node scripts/build-check-action.mjs",
129
+ "test:core": "node --test scripts/test-core-distribution.js",
130
+ "test:action": "node --test scripts/test-check-action.js"
84
131
  }
85
132
  }
@@ -0,0 +1,61 @@
1
+ # Antigravity & Gemini CLI Plugin for lat.md
2
+
3
+ This plugin integrates [lat.md](https://github.com/PlebeianTech/lat.md) with Google Antigravity and Gemini CLI. It grounds the agent in your codebase knowledge graph, prevents multi-line rationale comments in source code, maintains directory indexes, and blocks finishing work on check failures.
4
+
5
+ ## Features
6
+
7
+ - **PreInvocation Hook**: Automatically expands wiki links (`[[section]]`) in user prompts, retrieves relevant sections using semantic search, and reminds the agent to maintain the knowledge graph.
8
+ - **PreToolUse Hook**: Intercepts file edits (`replace_file_content` and `write_to_file`) and blocks multi-line rationale comments, prompting the agent to document the reasoning in `lat.md/` with a `@lat:` pointer instead.
9
+ - **PostToolUse Hook**: Runs index synchronization after file modifications.
10
+ - **Stop Hook**: Enforces `lat check` (including Diátaxis mode validation) before the agent completes its work, refusing stop if errors remain.
11
+ - **Bundled Skills**: Provides `lat-md` (syntax & structure authoring guide) and `lat-md-conventions` (fork conventions & rules).
12
+ - **Rules**: Injects core `lat.md` workflow directives via `rules/AGENTS.md`.
13
+
14
+ ## Installation
15
+
16
+ ### Option 1: Via `lat init` (Zero Clone, Recommended)
17
+
18
+ You do not need to clone the repository to use lat.md with Antigravity. Install the CLI and initialize your repository directly:
19
+
20
+ ```bash
21
+ npm install -g @plebeiantech/lat.md
22
+ # or: mise use -g npm:@plebeiantech/lat.md@latest
23
+
24
+ lat init
25
+ ```
26
+
27
+ Select **Antigravity / Gemini** from the agent checklist menu. This automatically writes `.agents/hooks.json`, `GEMINI.md`, and `.agents/skills/`.
28
+
29
+ ### Option 2: Global User Plugin (Without Cloning)
30
+
31
+ To install the plugin bundle globally across all repositories without cloning:
32
+
33
+ ```bash
34
+ mkdir -p ~/.gemini/config/plugins/lat-md && \
35
+ curl -sL https://github.com/PlebeianTech/lat.md/archive/refs/heads/main.tar.gz | \
36
+ tar -xz -C ~/.gemini/config/plugins/lat-md --strip-components=2 lat.md-main/plugins/lat-md
37
+ ```
38
+
39
+ ### Option 3: Workspace Plugin (Without Cloning)
40
+
41
+ To install the plugin bundle into a specific repository without cloning:
42
+
43
+ ```bash
44
+ mkdir -p .agents/plugins/lat-md && \
45
+ curl -sL https://github.com/PlebeianTech/lat.md/archive/refs/heads/main.tar.gz | \
46
+ tar -xz -C .agents/plugins/lat-md --strip-components=2 lat.md-main/plugins/lat-md
47
+ ```
48
+
49
+ ## Requirements
50
+
51
+ The plugin requires the `@plebeiantech/lat.md` CLI on your `PATH`:
52
+
53
+ ```bash
54
+ npm install -g @plebeiantech/lat.md
55
+ ```
56
+
57
+ Or using [mise](https://mise.jdx.dev/):
58
+
59
+ ```bash
60
+ mise use -g npm:@plebeiantech/lat.md@latest
61
+ ```
@@ -0,0 +1,38 @@
1
+ {
2
+ "lat-md": {
3
+ "PreInvocation": [
4
+ {
5
+ "type": "command",
6
+ "command": "lat hook antigravity PreInvocation"
7
+ }
8
+ ],
9
+ "PreToolUse": [
10
+ {
11
+ "matcher": "replace_file_content|write_to_file",
12
+ "hooks": [
13
+ {
14
+ "type": "command",
15
+ "command": "lat hook antigravity PreToolUse"
16
+ }
17
+ ]
18
+ }
19
+ ],
20
+ "PostToolUse": [
21
+ {
22
+ "matcher": "replace_file_content|write_to_file",
23
+ "hooks": [
24
+ {
25
+ "type": "command",
26
+ "command": "lat hook antigravity PostToolUse"
27
+ }
28
+ ]
29
+ }
30
+ ],
31
+ "Stop": [
32
+ {
33
+ "type": "command",
34
+ "command": "lat hook antigravity Stop"
35
+ }
36
+ ]
37
+ }
38
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "lat-md",
3
+ "version": "0.12.3",
4
+ "description": "Grounds an agent in a project's lat.md/ knowledge graph deterministically: resolves [[refs]] and federates knowledge into prompts, blocks multi-line rationale comments before they reach source, regenerates directory indexes after edits, and blocks Stop on a failing lat check — including Diataxis mode validation.",
5
+ "author": {
6
+ "name": "PlebeianTech"
7
+ },
8
+ "keywords": ["documentation", "diataxis", "lat.md", "knowledge-graph"]
9
+ }