@plebeiantech/lat.md 0.12.3-fork.12 → 0.12.3-fork.14
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 +24 -0
- package/dist/src/cli/check-context.d.ts +56 -0
- package/dist/src/cli/check-context.js +215 -0
- package/dist/src/cli/check-coverage.js +9 -5
- package/dist/src/cli/check-frontmatter.js +1 -1
- package/dist/src/cli/check-mode.js +33 -3
- package/dist/src/cli/check-status.js +1 -1
- package/dist/src/cli/check.d.ts +19 -12
- package/dist/src/cli/check.js +259 -206
- package/dist/src/cli/context.js +1 -1
- package/dist/src/cli/expand.d.ts +1 -2
- package/dist/src/cli/expand.js +52 -5
- package/dist/src/cli/external.d.ts +11 -0
- package/dist/src/cli/external.js +185 -0
- package/dist/src/cli/fork-instructions.d.ts +1 -0
- package/dist/src/cli/fork-instructions.js +3 -2
- package/dist/src/cli/hook.d.ts +26 -0
- package/dist/src/cli/hook.js +112 -40
- package/dist/src/cli/index.js +55 -3
- package/dist/src/cli/init.d.ts +1 -0
- package/dist/src/cli/init.js +40 -2
- package/dist/src/cli/locate.js +4 -3
- package/dist/src/cli/refs.d.ts +2 -1
- package/dist/src/cli/refs.js +88 -43
- package/dist/src/cli/reindex.js +2 -1
- package/dist/src/cli/search.d.ts +12 -3
- package/dist/src/cli/search.js +45 -49
- package/dist/src/cli/section.d.ts +3 -1
- package/dist/src/cli/section.js +114 -38
- package/dist/src/code-refs.d.ts +17 -5
- package/dist/src/code-refs.js +246 -65
- package/dist/src/context.d.ts +3 -0
- package/dist/src/document-formats.d.ts +7 -0
- package/dist/src/document-formats.js +39 -0
- package/dist/src/extensions/alert-marker.d.ts +25 -0
- package/dist/src/extensions/alert-marker.js +55 -0
- package/dist/src/external-documents.d.ts +56 -0
- package/dist/src/external-documents.js +404 -0
- package/dist/src/external-sources.d.ts +136 -0
- package/dist/src/external-sources.js +1098 -0
- package/dist/src/fork/antigravity-hook.d.ts +47 -0
- package/dist/src/fork/antigravity-hook.js +424 -0
- package/dist/src/fork/antigravity-init.d.ts +17 -0
- package/dist/src/fork/antigravity-init.js +124 -0
- package/dist/src/fork/frontmatter-fields.d.ts +36 -0
- package/dist/src/fork/frontmatter-fields.js +23 -0
- package/dist/src/format.d.ts +5 -2
- package/dist/src/format.js +8 -3
- package/dist/src/graph-export.js +1 -1
- package/dist/src/lattice-model.d.ts +77 -0
- package/dist/src/lattice-model.js +464 -0
- package/dist/src/lattice.d.ts +9 -104
- package/dist/src/lattice.js +69 -516
- package/dist/src/markdown-analysis-cache.d.ts +20 -0
- package/dist/src/markdown-analysis-cache.js +139 -0
- package/dist/src/markdown-analysis-worker.d.ts +16 -0
- package/dist/src/markdown-analysis-worker.js +33 -0
- package/dist/src/markdown-analysis.d.ts +50 -0
- package/dist/src/markdown-analysis.js +139 -0
- package/dist/src/markdown-analyzer-loader.d.ts +4 -0
- package/dist/src/markdown-analyzer-loader.js +13 -0
- package/dist/src/markdown-validation.d.ts +25 -0
- package/dist/src/markdown-validation.js +104 -0
- package/dist/src/mcp/server.js +27 -11
- package/dist/src/parser-cache.d.ts +17 -0
- package/dist/src/parser-cache.js +65 -0
- package/dist/src/parser-import.d.ts +8 -0
- package/dist/src/parser-import.js +1 -0
- package/dist/src/parser.js +80 -5
- package/dist/src/path.d.ts +2 -0
- package/dist/src/path.js +4 -0
- package/dist/src/profiler.d.ts +16 -0
- package/dist/src/profiler.js +81 -0
- package/dist/src/project-analysis.d.ts +59 -0
- package/dist/src/project-analysis.js +233 -0
- package/dist/src/project-discovery.d.ts +6 -0
- package/dist/src/project-discovery.js +30 -0
- package/dist/src/repository-path.d.ts +11 -0
- package/dist/src/repository-path.js +52 -0
- package/dist/src/search/db.d.ts +1 -1
- package/dist/src/search/db.js +2 -2
- package/dist/src/search/embedder.d.ts +2 -1
- package/dist/src/search/embedder.js +6 -5
- package/dist/src/search/index.d.ts +2 -1
- package/dist/src/search/index.js +10 -8
- package/dist/src/search/query.d.ts +20 -0
- package/dist/src/search/query.js +67 -0
- package/dist/src/search/search.d.ts +3 -1
- package/dist/src/search/search.js +5 -2
- package/dist/src/source-formats.d.ts +7 -0
- package/dist/src/source-formats.js +26 -0
- package/dist/src/source-parser.d.ts +44 -4
- package/dist/src/source-parser.js +494 -57
- 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-B7quqPb8.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/abnfDiagram-VCTEODGH-V7-T6qsl.js +1 -0
- package/dist/src/view/client/assets/arc-BnwR8Bu7.js +1 -0
- package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-u97vDna9.js +36 -0
- package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-DETl8e_H.js +129 -0
- package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-DJRAT1Ve.js +38 -0
- package/dist/src/view/client/assets/channel-BwQbnWCN.js +1 -0
- package/dist/src/view/client/assets/chunk-2Q5K7J3B-C0TmOC1Q.js +1 -0
- package/dist/src/view/client/assets/chunk-5VM5RSS4-dfBOrYE6.js +15 -0
- package/dist/src/view/client/assets/chunk-F27PBJKO-DAnks99K.js +1 -0
- package/dist/src/view/client/assets/chunk-IMKFNOWR-CPjB07if.js +231 -0
- package/dist/src/view/client/assets/chunk-JWPE2WC7-VvU_gZI6.js +1 -0
- package/dist/src/view/client/assets/chunk-POPQ4Y6H-DDUbVF55.js +1 -0
- package/dist/src/view/client/assets/chunk-SVP7TREG-BHROkr6D.js +88 -0
- package/dist/src/view/client/assets/chunk-TICWLB2K-95PzGIOg.js +206 -0
- package/dist/src/view/client/assets/chunk-XXDRQBXY-MdmuLhIs.js +1 -0
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-HvQKkIS-.js +1 -0
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-HvQKkIS-.js +1 -0
- package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-CauUf_rN.js +1 -0
- package/dist/src/view/client/assets/cynefin-OW5HDTMX-CeA8IKWo.js +166 -0
- package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-L1rtcT8l.js +62 -0
- package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
- package/dist/src/view/client/assets/dagre-GXQ25YYZ-DLQwTa3H.js +4 -0
- package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/src/view/client/assets/diagram-S7CK7UJ4-kbKdIyXG.js +30 -0
- package/dist/src/view/client/assets/diagram-UQ7AKVKN-kmzp92RC.js +41 -0
- package/dist/src/view/client/assets/diagram-VSXAHHWV-EXJTU8qq.js +3 -0
- package/dist/src/view/client/assets/diagram-VX7I27RA-DAiIyMCG.js +24 -0
- package/dist/src/view/client/assets/diagram-Z3DM3KII-G9wz50ZV.js +24 -0
- package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-D2tVRCNA.js +1 -0
- package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-C925J5A3.js +99 -0
- package/dist/src/view/client/assets/flowDiagram-HODETNUW-DzoCa-Nq.js +168 -0
- package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-D2ebbg4p.js +292 -0
- package/dist/src/view/client/assets/gitGraphDiagram-WWUBYQGX-B4QratYy.js +106 -0
- package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
- package/dist/src/view/client/assets/index-D0ajr_Ja.css +1 -0
- package/dist/src/view/client/assets/index-KZcnpXJH.js +321 -0
- package/dist/src/view/client/assets/infoDiagram-27XIBGKW-DL4mtHkt.js +2 -0
- package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-CW4mto2d.js +70 -0
- package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-8R4eacFW.js +139 -0
- package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-Cy9ioXEJ.js +89 -0
- package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/src/view/client/assets/layout-C0MFuhth.js +1 -0
- package/dist/src/view/client/assets/linear-Dv3N4dQR.js +1 -0
- package/dist/src/view/client/assets/logo-small-RR_KBOAT.svg +149 -0
- package/dist/src/view/client/assets/maplibre-gl-DnqZgfUS.js +800 -0
- package/dist/src/view/client/assets/mermaid.core-bds9A7e2.js +310 -0
- package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-DjmGW355.js +96 -0
- package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-BWsZp0ab.js +1 -0
- package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-CCH2gGR-.js +39 -0
- package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC-CjocPJFz.js +7 -0
- package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-BjLeb2KF.js +1 -0
- package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-Ct6AoXRr.js +84 -0
- package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-CIpgGN_w.js +40 -0
- package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-DrmLFj6w.js +162 -0
- package/dist/src/view/client/assets/sizeCapture-INFHLROL-BdFMe2Lr.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-D77RDMKH-Zd9F1goW.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-ByIKCftl.js +1 -0
- package/dist/src/view/client/assets/swimlanes-42K2YHIH-a7VFwi00.js +1 -0
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-CzxaUHB-.js +8 -0
- package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
- package/dist/src/view/client/assets/timeline-definition-24CTP7MA-BExPu6X5.js +120 -0
- package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-PC1MU3si.js +34 -0
- package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-DNWqU3fa.js +78 -0
- package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-E1uA28_D.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 +12 -0
- package/dist/src/view/document-route.js +93 -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 +187 -0
- package/dist/src/view/git.js +1 -1
- package/dist/src/view/graph.d.ts +3 -2
- package/dist/src/view/graph.js +94 -7
- package/dist/src/view/highlight.d.ts +10 -2
- package/dist/src/view/highlight.js +4540 -1360
- package/dist/src/view/markdown.d.ts +3 -2
- package/dist/src/view/markdown.js +214 -53
- package/dist/src/view/protocol.d.ts +59 -6
- package/dist/src/view/references.d.ts +10 -25
- package/dist/src/view/references.js +117 -107
- package/dist/src/view/repository.d.ts +13 -3
- package/dist/src/view/repository.js +234 -15
- package/dist/src/view/search.d.ts +1 -1
- package/dist/src/view/search.js +3 -7
- package/dist/src/view/server.d.ts +11 -2
- package/dist/src/view/server.js +212 -70
- package/dist/src/view/source-target.js +5 -8
- package/dist/src/view/static-build.d.ts +1 -0
- package/dist/src/view/static-build.js +245 -42
- package/dist/src/view/static-protocol.d.ts +19 -2
- package/dist/src/view/store.d.ts +16 -3
- package/dist/src/view/store.js +228 -36
- package/dist/src/view/table-of-contents.d.ts +2 -2
- package/dist/src/view/table-of-contents.js +2 -22
- package/dist/src/walk.d.ts +5 -3
- package/dist/src/walk.js +102 -8
- package/package.json +46 -8
- 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 +15 -3
- package/templates/cursor-rules.md +12 -3
- package/templates/fork/conventions.md +30 -4
- package/templates/skill/SKILL.md +22 -1
- package/dist/src/view/client/assets/index-C3iaZyYT.css +0 -1
- package/dist/src/view/client/assets/index-KWi67IMz.js +0 -334
- package/dist/src/view/client/assets/logo-CNF8zs47.svg +0 -182
package/README.md
CHANGED
|
@@ -77,6 +77,30 @@ The hooks are also packaged as a plugin, installable straight from this reposito
|
|
|
77
77
|
|
|
78
78
|
The plugin ships hooks only and finds `lat` on your `PATH`, accepting a build only if its version carries a `-fork` suffix.
|
|
79
79
|
|
|
80
|
+
### As an Antigravity / Gemini CLI plugin
|
|
81
|
+
|
|
82
|
+
The hooks, rules, and skills are packaged as an Antigravity plugin under `plugins/lat-md/`.
|
|
83
|
+
|
|
84
|
+
You can install it directly without cloning the repository:
|
|
85
|
+
|
|
86
|
+
**Global installation (all local projects):**
|
|
87
|
+
```bash
|
|
88
|
+
mkdir -p ~/.gemini/config/plugins/lat-md && \
|
|
89
|
+
curl -sL https://github.com/PlebeianTech/lat.md/archive/refs/heads/main.tar.gz | \
|
|
90
|
+
tar -xz -C ~/.gemini/config/plugins/lat-md --strip-components=2 lat.md-main/plugins/lat-md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Workspace installation (single repository):**
|
|
94
|
+
```bash
|
|
95
|
+
mkdir -p .agents/plugins/lat-md && \
|
|
96
|
+
curl -sL https://github.com/PlebeianTech/lat.md/archive/refs/heads/main.tar.gz | \
|
|
97
|
+
tar -xz -C .agents/plugins/lat-md --strip-components=2 lat.md-main/plugins/lat-md
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Alternatively, install `@plebeiantech/lat.md` via npm/mise, run `lat init` in your project, and select **Antigravity / Gemini** from the agent checklist.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
80
104
|
## How it works
|
|
81
105
|
|
|
82
106
|
Run `lat init` to scaffold a `lat.md/` directory, then write markdown files describing your architecture, business logic, test specs — whatever matters. Link between sections using `[[file#Section#Subsection]]` syntax. Link to source code symbols with `[[src/auth.ts#validateToken]]`. Annotate source code with `// @lat: [[section-id]]` (or `# @lat: [[section-id]]` in Python) comments to tie implementation back to concepts.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type LatFrontmatter, type MdLink, type Ref, type Section, type SectionSlugIndex } from '../lattice-model.js';
|
|
2
|
+
import { type ScanResult } from '../code-refs.js';
|
|
3
|
+
import { type ResolveSourceSymbolOptions } from '../source-parser.js';
|
|
4
|
+
import { type ExternalResolver, type ResolvedExternalContent } from '../external-sources.js';
|
|
5
|
+
import type { Profiler } from '../profiler.js';
|
|
6
|
+
import { type MarkdownAnalysisExecutor, type MarkdownProjectAnalysis } from '../project-analysis.js';
|
|
7
|
+
import type { LocalMarkdownDiagnostic } from '../markdown-validation.js';
|
|
8
|
+
export type CheckSectionIndex = {
|
|
9
|
+
sectionIds: Set<string>;
|
|
10
|
+
fileIndex: Map<string, string[]>;
|
|
11
|
+
slugIndex: SectionSlugIndex;
|
|
12
|
+
};
|
|
13
|
+
/** Lazy, command-scoped cache shared by every validator in one check run. */
|
|
14
|
+
export declare class CheckRunContext {
|
|
15
|
+
readonly latticeDir: string;
|
|
16
|
+
readonly projectRoot: string;
|
|
17
|
+
readonly profile?: Profiler | undefined;
|
|
18
|
+
readonly executor: MarkdownAnalysisExecutor;
|
|
19
|
+
private projectPromise?;
|
|
20
|
+
private codeRefsPromise?;
|
|
21
|
+
private externalResolverPromise?;
|
|
22
|
+
private reconciledExternalPromise?;
|
|
23
|
+
private sourceSymbolCacheCleared;
|
|
24
|
+
private readonly sourceParserRuntime;
|
|
25
|
+
private readonly headingPromises;
|
|
26
|
+
private readonly externalContentPromises;
|
|
27
|
+
private readonly repositoryLinkErrorPromises;
|
|
28
|
+
private readonly auxiliaryFilePromises;
|
|
29
|
+
constructor(latticeDir: string, projectRoot: string, profile?: Profiler | undefined, executor?: MarkdownAnalysisExecutor);
|
|
30
|
+
private time;
|
|
31
|
+
private timeSync;
|
|
32
|
+
private recordAnalysis;
|
|
33
|
+
private recordParserImport;
|
|
34
|
+
private recordSourceAnalysis;
|
|
35
|
+
private recordExternalDocumentAnalysis;
|
|
36
|
+
sourceSymbolOptions(): ResolveSourceSymbolOptions;
|
|
37
|
+
clearSourceSymbolCache(): void;
|
|
38
|
+
project(): Promise<MarkdownProjectAnalysis>;
|
|
39
|
+
entries(): Promise<string[]>;
|
|
40
|
+
markdownFiles(): Promise<string[]>;
|
|
41
|
+
private file;
|
|
42
|
+
content(file: string): Promise<string>;
|
|
43
|
+
sections(file: string): Promise<Section[]>;
|
|
44
|
+
refs(file: string): Promise<Ref[]>;
|
|
45
|
+
links(file: string): Promise<MdLink[]>;
|
|
46
|
+
frontmatter(file: string): Promise<LatFrontmatter>;
|
|
47
|
+
diagnostics(file: string): Promise<LocalMarkdownDiagnostic[]>;
|
|
48
|
+
allSections(): Promise<Section[]>;
|
|
49
|
+
sectionIndex(): Promise<CheckSectionIndex>;
|
|
50
|
+
headings(file: string): Promise<Set<string>>;
|
|
51
|
+
codeRefs(): Promise<ScanResult>;
|
|
52
|
+
private loadExternalResolver;
|
|
53
|
+
externalResolver(): Promise<ExternalResolver>;
|
|
54
|
+
resolveExternal(target: string): Promise<ResolvedExternalContent>;
|
|
55
|
+
resolveRepositoryLink(target: string, resolveLink: () => Promise<string | null>): Promise<string | null>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { flattenSections, } from '../lattice-model.js';
|
|
2
|
+
import { scanCodeRefs } from '../code-refs.js';
|
|
3
|
+
import { SourceParserRuntime, } from '../source-parser.js';
|
|
4
|
+
import { createExternalResolver, } from '../external-sources.js';
|
|
5
|
+
import { analyzeMarkdownProject, } from '../project-analysis.js';
|
|
6
|
+
import { analyzeMarkdownPath } from '../markdown-analysis-cache.js';
|
|
7
|
+
/** Lazy, command-scoped cache shared by every validator in one check run. */
|
|
8
|
+
export class CheckRunContext {
|
|
9
|
+
latticeDir;
|
|
10
|
+
projectRoot;
|
|
11
|
+
profile;
|
|
12
|
+
executor;
|
|
13
|
+
projectPromise;
|
|
14
|
+
codeRefsPromise;
|
|
15
|
+
externalResolverPromise;
|
|
16
|
+
reconciledExternalPromise;
|
|
17
|
+
sourceSymbolCacheCleared = false;
|
|
18
|
+
sourceParserRuntime = new SourceParserRuntime();
|
|
19
|
+
headingPromises = new Map();
|
|
20
|
+
externalContentPromises = new Map();
|
|
21
|
+
repositoryLinkErrorPromises = new Map();
|
|
22
|
+
auxiliaryFilePromises = new Map();
|
|
23
|
+
constructor(latticeDir, projectRoot, profile, executor = 'auto') {
|
|
24
|
+
this.latticeDir = latticeDir;
|
|
25
|
+
this.projectRoot = projectRoot;
|
|
26
|
+
this.profile = profile;
|
|
27
|
+
this.executor = executor;
|
|
28
|
+
}
|
|
29
|
+
time(label, work, detail) {
|
|
30
|
+
return this.profile ? this.profile.time(label, work, detail) : work();
|
|
31
|
+
}
|
|
32
|
+
timeSync(label, work, detail) {
|
|
33
|
+
return this.profile ? this.profile.timeSync(label, work, detail) : work();
|
|
34
|
+
}
|
|
35
|
+
recordAnalysis(analysis) {
|
|
36
|
+
if (!this.profile)
|
|
37
|
+
return;
|
|
38
|
+
const detail = analysis.path;
|
|
39
|
+
const timings = analysis.timings;
|
|
40
|
+
this.profile.record('read Markdown file', timings.readMs, detail);
|
|
41
|
+
this.profile.record('hash Markdown file', timings.hashMs, detail);
|
|
42
|
+
if (timings.cacheStatus !== 'disabled') {
|
|
43
|
+
this.profile.record('read parsed Markdown cache', timings.cacheReadMs, detail);
|
|
44
|
+
this.profile.record(`parsed Markdown cache ${timings.cacheStatus}`, 0);
|
|
45
|
+
}
|
|
46
|
+
if (timings.cacheStatus === 'hit')
|
|
47
|
+
return;
|
|
48
|
+
this.profile.record('parse Markdown AST', timings.parseMs, detail);
|
|
49
|
+
this.profile.record('extract Markdown sections', timings.sectionsMs, detail);
|
|
50
|
+
this.profile.record('extract wiki links', timings.refsMs, detail);
|
|
51
|
+
this.profile.record('extract relative links', timings.linksMs, detail);
|
|
52
|
+
this.profile.record('extract Markdown presentation facts', timings.paragraphsMs, detail);
|
|
53
|
+
this.profile.record('parse code-mention frontmatter', timings.frontmatterMs, detail);
|
|
54
|
+
this.profile.record('extract directory-index entries', timings.indexEntriesMs, detail);
|
|
55
|
+
this.profile.record('validate local Markdown facts', timings.diagnosticsMs, detail);
|
|
56
|
+
if (timings.cacheStatus === 'miss') {
|
|
57
|
+
this.profile.record('write parsed Markdown cache', timings.cacheWriteMs, detail);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
recordParserImport(event) {
|
|
61
|
+
if (!this.profile)
|
|
62
|
+
return;
|
|
63
|
+
this.profile.record(event.imported ? `import ${event.parser}` : `skip ${event.parser} import`, event.durationMs, event.detail);
|
|
64
|
+
}
|
|
65
|
+
recordSourceAnalysis(analysis) {
|
|
66
|
+
if (!this.profile)
|
|
67
|
+
return;
|
|
68
|
+
const detail = analysis.path;
|
|
69
|
+
const timings = analysis.timings;
|
|
70
|
+
this.profile.record('read source file', timings.readMs, detail);
|
|
71
|
+
this.profile.record('hash source file', timings.hashMs, detail);
|
|
72
|
+
if (timings.cacheStatus !== 'disabled') {
|
|
73
|
+
this.profile.record('read parsed source cache', timings.cacheReadMs, detail);
|
|
74
|
+
this.profile.record(`parsed source cache ${timings.cacheStatus}`, 0);
|
|
75
|
+
}
|
|
76
|
+
if (timings.cacheStatus === 'hit')
|
|
77
|
+
return;
|
|
78
|
+
this.profile.record('parse source symbols', timings.parseMs, detail);
|
|
79
|
+
if (timings.cacheStatus === 'miss') {
|
|
80
|
+
this.profile.record('write parsed source cache', timings.cacheWriteMs, detail);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
recordExternalDocumentAnalysis(analysis) {
|
|
84
|
+
if (!this.profile)
|
|
85
|
+
return;
|
|
86
|
+
const detail = analysis.path;
|
|
87
|
+
const timings = analysis.timings;
|
|
88
|
+
this.profile.record('hash external document', timings.hashMs, detail);
|
|
89
|
+
if (timings.cacheStatus !== 'disabled') {
|
|
90
|
+
this.profile.record('read parsed external document cache', timings.cacheReadMs, detail);
|
|
91
|
+
this.profile.record(`parsed external document cache ${timings.cacheStatus}`, 0);
|
|
92
|
+
}
|
|
93
|
+
if (timings.cacheStatus === 'hit')
|
|
94
|
+
return;
|
|
95
|
+
this.profile.record('parse external document', timings.parseMs, detail);
|
|
96
|
+
if (timings.cacheStatus === 'miss') {
|
|
97
|
+
this.profile.record('write parsed external document cache', timings.cacheWriteMs, detail);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
sourceSymbolOptions() {
|
|
101
|
+
return {
|
|
102
|
+
latDir: this.latticeDir,
|
|
103
|
+
runtime: this.sourceParserRuntime,
|
|
104
|
+
onFileAnalyzed: (analysis) => this.recordSourceAnalysis(analysis),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
clearSourceSymbolCache() {
|
|
108
|
+
if (this.sourceSymbolCacheCleared)
|
|
109
|
+
return;
|
|
110
|
+
this.sourceSymbolCacheCleared = true;
|
|
111
|
+
this.timeSync('clear source-symbol cache', () => this.sourceParserRuntime.clear());
|
|
112
|
+
}
|
|
113
|
+
project() {
|
|
114
|
+
this.projectPromise ??= this.time('analyze Markdown project', () => analyzeMarkdownProject(this.latticeDir, this.projectRoot, {
|
|
115
|
+
executor: this.executor,
|
|
116
|
+
onFileAnalyzed: (analysis) => this.recordAnalysis(analysis),
|
|
117
|
+
onParserImport: (event) => this.recordParserImport(event),
|
|
118
|
+
}));
|
|
119
|
+
return this.projectPromise;
|
|
120
|
+
}
|
|
121
|
+
async entries() {
|
|
122
|
+
return (await this.project()).entries;
|
|
123
|
+
}
|
|
124
|
+
async markdownFiles() {
|
|
125
|
+
return (await this.project()).markdownFiles;
|
|
126
|
+
}
|
|
127
|
+
async file(file) {
|
|
128
|
+
const analysis = (await this.project()).filesByAbsolutePath.get(file);
|
|
129
|
+
if (analysis)
|
|
130
|
+
return analysis;
|
|
131
|
+
let auxiliary = this.auxiliaryFilePromises.get(file);
|
|
132
|
+
if (!auxiliary) {
|
|
133
|
+
auxiliary = (async () => {
|
|
134
|
+
const result = await analyzeMarkdownPath(file, this.latticeDir, this.projectRoot, true, (event) => this.recordParserImport(event));
|
|
135
|
+
this.recordAnalysis(result);
|
|
136
|
+
return result;
|
|
137
|
+
})();
|
|
138
|
+
this.auxiliaryFilePromises.set(file, auxiliary);
|
|
139
|
+
}
|
|
140
|
+
return auxiliary;
|
|
141
|
+
}
|
|
142
|
+
async content(file) {
|
|
143
|
+
return (await this.file(file)).content;
|
|
144
|
+
}
|
|
145
|
+
async sections(file) {
|
|
146
|
+
return (await this.file(file)).sections;
|
|
147
|
+
}
|
|
148
|
+
async refs(file) {
|
|
149
|
+
return (await this.file(file)).wikiRefs;
|
|
150
|
+
}
|
|
151
|
+
async links(file) {
|
|
152
|
+
return (await this.file(file)).validationLinks;
|
|
153
|
+
}
|
|
154
|
+
async frontmatter(file) {
|
|
155
|
+
return (await this.file(file)).frontmatter;
|
|
156
|
+
}
|
|
157
|
+
async diagnostics(file) {
|
|
158
|
+
return (await this.file(file)).diagnostics;
|
|
159
|
+
}
|
|
160
|
+
async allSections() {
|
|
161
|
+
return (await this.project()).allSections;
|
|
162
|
+
}
|
|
163
|
+
async sectionIndex() {
|
|
164
|
+
const project = await this.project();
|
|
165
|
+
return {
|
|
166
|
+
sectionIds: new Set(project.sectionIds),
|
|
167
|
+
fileIndex: project.fileIndex,
|
|
168
|
+
slugIndex: project.slugIndex,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
headings(file) {
|
|
172
|
+
let headings = this.headingPromises.get(file);
|
|
173
|
+
if (!headings) {
|
|
174
|
+
headings = (async () => {
|
|
175
|
+
const sections = await this.sections(file);
|
|
176
|
+
return this.timeSync('collect Markdown headings', () => new Set(flattenSections(sections).map((section) => section.githubSlug)), (await this.file(file)).path);
|
|
177
|
+
})();
|
|
178
|
+
this.headingPromises.set(file, headings);
|
|
179
|
+
}
|
|
180
|
+
return headings;
|
|
181
|
+
}
|
|
182
|
+
codeRefs() {
|
|
183
|
+
this.codeRefsPromise ??= this.time('scan project files for @lat references', () => scanCodeRefs(this.projectRoot, this.profile));
|
|
184
|
+
return this.codeRefsPromise;
|
|
185
|
+
}
|
|
186
|
+
loadExternalResolver() {
|
|
187
|
+
this.externalResolverPromise ??= this.time('load external-source configuration', () => createExternalResolver(this.latticeDir, this.projectRoot, {
|
|
188
|
+
onDocumentAnalyzed: (analysis) => this.recordExternalDocumentAnalysis(analysis),
|
|
189
|
+
onParserImport: (event) => this.recordParserImport(event),
|
|
190
|
+
}));
|
|
191
|
+
return this.externalResolverPromise;
|
|
192
|
+
}
|
|
193
|
+
async externalResolver() {
|
|
194
|
+
const resolver = await this.loadExternalResolver();
|
|
195
|
+
this.reconciledExternalPromise ??= this.time('reconcile external cache', () => resolver.reconcile());
|
|
196
|
+
await this.reconciledExternalPromise;
|
|
197
|
+
return resolver;
|
|
198
|
+
}
|
|
199
|
+
resolveExternal(target) {
|
|
200
|
+
let content = this.externalContentPromises.get(target);
|
|
201
|
+
if (!content) {
|
|
202
|
+
content = this.time('resolve external reference', async () => (await this.externalResolver()).resolve(target), target);
|
|
203
|
+
this.externalContentPromises.set(target, content);
|
|
204
|
+
}
|
|
205
|
+
return content;
|
|
206
|
+
}
|
|
207
|
+
resolveRepositoryLink(target, resolveLink) {
|
|
208
|
+
let error = this.repositoryLinkErrorPromises.get(target);
|
|
209
|
+
if (!error) {
|
|
210
|
+
error = this.time('resolve repository wiki link', resolveLink, target);
|
|
211
|
+
this.repositoryLinkErrorPromises.set(target, error);
|
|
212
|
+
}
|
|
213
|
+
return error;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { relative } from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { createCodeReferenceDiscovery } from '../code-refs.js';
|
|
4
4
|
import { listLatticeFiles } from '../lattice.js';
|
|
5
5
|
import { indexNameFor } from './check-mode.js';
|
|
6
|
-
import { toPosix } from '../
|
|
6
|
+
import { toPosix } from '../path.js';
|
|
7
7
|
import { basename, dirname } from 'node:path';
|
|
8
8
|
/**
|
|
9
9
|
* Fail a `lat.md/` tree that has documents and no `@lat:` ref pointing into it
|
|
@@ -35,10 +35,14 @@ export async function checkCoverage(latticeDir, projectRoot = dirname(latticeDir
|
|
|
35
35
|
const documents = files.filter((f) => !isIndex(latticeDir, f));
|
|
36
36
|
if (documents.length === 0)
|
|
37
37
|
return [];
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
// One discovery for both questions: it coalesces the repeated call and
|
|
39
|
+
// shares the ripgrep exclusion scan between them. Upstream's ScanResult no
|
|
40
|
+
// longer carries the file list, so the scope has to be asked for separately.
|
|
41
|
+
const discovery = createCodeReferenceDiscovery(projectRoot);
|
|
42
|
+
const { refs } = await discovery.scan();
|
|
43
|
+
if (refs.length > 0)
|
|
40
44
|
return [];
|
|
41
|
-
if (
|
|
45
|
+
if ((await discovery.listSourceFiles()).length === 0)
|
|
42
46
|
return [];
|
|
43
47
|
const rootIndexPath = `${latticeDir}/${indexNameFor(basename(latticeDir))}`;
|
|
44
48
|
const rootIndexRel = toPosix(relative(process.cwd(), rootIndexPath));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname, relative } from 'node:path';
|
|
3
3
|
import { listLatticeFiles, parseFrontmatter } from '../lattice.js';
|
|
4
|
-
import { toPosix } from '../
|
|
4
|
+
import { toPosix } from '../path.js';
|
|
5
5
|
/**
|
|
6
6
|
* Report frontmatter that parses to nothing useful, or that puts a lat field
|
|
7
7
|
* somewhere the parser will not look.
|
|
@@ -3,7 +3,7 @@ import { basename, dirname, join, relative } from 'node:path';
|
|
|
3
3
|
import { listLatticeFiles, parseFrontmatter } from '../lattice.js';
|
|
4
4
|
import { parse } from '../parser.js';
|
|
5
5
|
import { quoteUntrusted } from '../untrusted.js';
|
|
6
|
-
import { toPosix } from '../
|
|
6
|
+
import { toPosix } from '../path.js';
|
|
7
7
|
export const DIATAXIS_MODES = [
|
|
8
8
|
'tutorial',
|
|
9
9
|
'how-to',
|
|
@@ -95,12 +95,40 @@ function inlineTextOf(node) {
|
|
|
95
95
|
})
|
|
96
96
|
.join('');
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* A GFM table that the parser handed back as a paragraph.
|
|
100
|
+
*
|
|
101
|
+
* `src/parser.ts` runs remark without `remark-gfm`, so a pipe table is never a
|
|
102
|
+
* `table` node — its rows arrive as one paragraph and every reference document
|
|
103
|
+
* containing a table failed with "this is a second paragraph", while the error
|
|
104
|
+
* text told the author to use a table. Adding the plugin would mean editing an
|
|
105
|
+
* upstream file and changing what `remarkStringify` emits for the whole tool,
|
|
106
|
+
* which `tests/roundtrip` pins; recognising the shape here costs nothing
|
|
107
|
+
* outside this check.
|
|
108
|
+
*
|
|
109
|
+
* The signature is a delimiter row — `| --- | :--: |` — under a line that opens
|
|
110
|
+
* a row. Both are required, because a delimiter row is what separates a table
|
|
111
|
+
* from prose that merely contains pipes.
|
|
112
|
+
*/
|
|
113
|
+
function isPipeTable(node, lines) {
|
|
114
|
+
const start = node.position?.start.line;
|
|
115
|
+
const end = node.position?.end.line;
|
|
116
|
+
if (!start || !end || end - start < 1)
|
|
117
|
+
return false;
|
|
118
|
+
const rows = lines.slice(start - 1, end);
|
|
119
|
+
return rows.some((row, i) => i > 0 &&
|
|
120
|
+
/^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(row) &&
|
|
121
|
+
rows[i - 1].trimStart().startsWith('|'));
|
|
122
|
+
}
|
|
98
123
|
/**
|
|
99
124
|
* Extra top-level paragraphs found under headings, beyond the one
|
|
100
125
|
* `checkSections` already permits as the leading summary. A paragraph
|
|
101
126
|
* before the first heading is the document lead, not narrative prose.
|
|
127
|
+
*
|
|
128
|
+
* A pipe table is not prose and never counts, in either position: it is
|
|
129
|
+
* neither the leading summary a reference is allowed nor an offender.
|
|
102
130
|
*/
|
|
103
|
-
function extraParagraphs(tree) {
|
|
131
|
+
function extraParagraphs(tree, lines) {
|
|
104
132
|
const offenders = [];
|
|
105
133
|
let currentHeading = null;
|
|
106
134
|
let seenParagraphUnderHeading = false;
|
|
@@ -111,6 +139,8 @@ function extraParagraphs(tree) {
|
|
|
111
139
|
continue;
|
|
112
140
|
}
|
|
113
141
|
if (node.type === 'paragraph') {
|
|
142
|
+
if (isPipeTable(node, lines))
|
|
143
|
+
continue;
|
|
114
144
|
if (currentHeading === null) {
|
|
115
145
|
// Document lead paragraph before any heading — allowed.
|
|
116
146
|
continue;
|
|
@@ -329,7 +359,7 @@ export async function checkMode(latticeDir, projectRoot = dirname(latticeDir), o
|
|
|
329
359
|
continue;
|
|
330
360
|
}
|
|
331
361
|
if (mode === 'reference') {
|
|
332
|
-
for (const offender of extraParagraphs(tree)) {
|
|
362
|
+
for (const offender of extraParagraphs(tree, content.split('\n'))) {
|
|
333
363
|
errors.push({
|
|
334
364
|
file: relPath,
|
|
335
365
|
line: offender.line,
|
|
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { dirname, relative } from 'node:path';
|
|
4
4
|
import { listLatticeFiles, parseFrontmatter } from '../lattice.js';
|
|
5
|
-
import { toPosix } from '../
|
|
5
|
+
import { toPosix } from '../path.js';
|
|
6
6
|
import { quoteUntrusted } from '../untrusted.js';
|
|
7
7
|
import { fencedLineMask } from './gen-index.js';
|
|
8
8
|
/**
|
package/dist/src/cli/check.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ResolveSourceSymbolOptions } from '../source-parser.js';
|
|
1
2
|
import type { CmdContext, CmdResult } from '../context.js';
|
|
3
|
+
import { CheckRunContext } from './check-context.js';
|
|
2
4
|
export type CheckError = {
|
|
3
5
|
file: string;
|
|
4
6
|
line: number;
|
|
@@ -7,20 +9,17 @@ export type CheckError = {
|
|
|
7
9
|
};
|
|
8
10
|
/** Format an ambiguous-ref error as structured markdown-like text. */
|
|
9
11
|
export declare function ambiguousRefMessage(target: string, candidates: string[], suggested: string | null): string;
|
|
10
|
-
/** File counts grouped by extension (e.g. { ".ts": 5, ".py": 2 }). */
|
|
11
|
-
export type FileStats = Record<string, number>;
|
|
12
12
|
export type CheckResult = {
|
|
13
13
|
errors: CheckError[];
|
|
14
|
-
files: FileStats;
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Returns null
|
|
16
|
+
* Validate an unresolved wiki link as a repository path or source symbol.
|
|
17
|
+
* Returns null when valid, otherwise a user-facing error message.
|
|
19
18
|
*/
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function checkMd(latticeDir: string, projectRoot?: string): Promise<CheckResult>;
|
|
22
|
-
export declare function checkLinks(latticeDir: string): Promise<CheckError[]>;
|
|
23
|
-
export declare function checkCodeRefs(latticeDir: string, projectRoot?: string): Promise<CheckResult>;
|
|
19
|
+
export declare function repositoryRefError(target: string, projectRoot: string, sourceOptions?: ResolveSourceSymbolOptions): Promise<string | null>;
|
|
20
|
+
export declare function checkMd(latticeDir: string, projectRoot?: string, context?: CheckRunContext): Promise<CheckResult>;
|
|
21
|
+
export declare function checkLinks(latticeDir: string, context?: CheckRunContext): Promise<CheckError[]>;
|
|
22
|
+
export declare function checkCodeRefs(latticeDir: string, projectRoot?: string, context?: CheckRunContext): Promise<CheckResult>;
|
|
24
23
|
export type IndexError = {
|
|
25
24
|
dir: string;
|
|
26
25
|
message: string;
|
|
@@ -33,9 +32,17 @@ export type CheckIndexOptions = {
|
|
|
33
32
|
*/
|
|
34
33
|
fix?: boolean;
|
|
35
34
|
};
|
|
36
|
-
export declare function checkIndex(latticeDir: string, opts?: CheckIndexOptions): Promise<IndexError[]>;
|
|
37
|
-
export declare function checkSections(latticeDir: string, projectRoot?: string): Promise<CheckError[]>;
|
|
38
|
-
export
|
|
35
|
+
export declare function checkIndex(latticeDir: string, context?: CheckRunContext, opts?: CheckIndexOptions): Promise<IndexError[]>;
|
|
36
|
+
export declare function checkSections(latticeDir: string, projectRoot?: string, context?: CheckRunContext): Promise<CheckError[]>;
|
|
37
|
+
export type CheckCommandOptions = {
|
|
38
|
+
profile?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Generate/rewrite index files instead of reporting errors for them.
|
|
41
|
+
* Non-.md-file errors are still reported — --fix only ever writes markdown.
|
|
42
|
+
*/
|
|
43
|
+
fix?: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare function checkAllCommand(ctx: CmdContext, options?: CheckCommandOptions): Promise<CmdResult>;
|
|
39
46
|
export declare function checkMdCommand(ctx: CmdContext): Promise<CmdResult>;
|
|
40
47
|
export declare function checkLinksCommand(ctx: CmdContext): Promise<CmdResult>;
|
|
41
48
|
export declare function checkCodeRefsCommand(ctx: CmdContext): Promise<CmdResult>;
|