@plebeiantech/lat.md 0.12.3-fork.17 → 0.12.3-fork.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/cli/agent-invocation.d.ts +6 -0
- package/dist/src/cli/agent-invocation.js +23 -0
- package/dist/src/cli/fork-instructions.js +1 -1
- package/dist/src/cli/fork-scaffold.js +2 -2
- package/dist/src/cli/graph.d.ts +1 -1
- package/dist/src/cli/hook.js +11 -11
- package/dist/src/cli/index.js +41 -59
- package/dist/src/cli/init-preferences.js +5 -4
- package/dist/src/cli/init.d.ts +1 -1
- package/dist/src/cli/init.js +54 -45
- package/dist/src/cli/reindex.d.ts +1 -1
- package/dist/src/cli/reindex.js +2 -2
- package/dist/src/cli/search.d.ts +4 -4
- package/dist/src/cli/search.js +41 -28
- package/dist/src/cli/ui-build-server.d.ts +1 -1
- package/dist/src/cli/ui-build.d.ts +1 -1
- package/dist/src/cli/ui.d.ts +1 -1
- package/dist/src/fork/antigravity-hook.js +6 -6
- package/dist/src/fork/antigravity-init.d.ts +2 -2
- package/dist/src/fork/antigravity-init.js +2 -2
- package/dist/src/graph-export.js +7 -7
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/mcp/server.js +8 -8
- package/dist/src/search/cache.d.ts +1 -1
- package/dist/src/search/cache.js +40 -7
- package/dist/src/search/chunks.d.ts +2 -2
- package/dist/src/search/db.d.ts +5 -4
- package/dist/src/search/db.js +36 -40
- package/dist/src/search/embedder.js +1 -1
- package/dist/src/search/index.d.ts +1 -1
- package/dist/src/search/index.js +2 -2
- package/dist/src/search/lock.d.ts +4 -1
- package/dist/src/search/lock.js +30 -8
- package/dist/src/search/query.d.ts +5 -2
- package/dist/src/search/query.js +55 -38
- package/dist/src/search/search.d.ts +3 -1
- package/dist/src/search/search.js +21 -12
- package/dist/src/search/types.d.ts +2 -18
- package/dist/src/view/client/assets/{GraphView-BWlRdQM4.js → GraphView-Dij8mAA_.js} +1 -1
- package/dist/src/view/client/assets/{MarkdownEditor-MW-Ck1O0.js → MarkdownEditor-88Wbt0M1.js} +1 -1
- package/dist/src/view/client/assets/{abnfDiagram-VCTEODGH-Bn3RshMV.js → abnfDiagram-VCTEODGH-y0DlYa8E.js} +1 -1
- package/dist/src/view/client/assets/{arc-En9tdFQF.js → arc-FlMu8dnO.js} +1 -1
- package/dist/src/view/client/assets/{architectureDiagram-5GKGNRK7-B-9J1VAM.js → architectureDiagram-5GKGNRK7-DA_uWZW1.js} +1 -1
- package/dist/src/view/client/assets/{blockDiagram-I7D4REHJ-QlznwalP.js → blockDiagram-I7D4REHJ-BHQ5LU85.js} +1 -1
- package/dist/src/view/client/assets/{c4Diagram-7LVT6UL2-Bp2y8B4_.js → c4Diagram-7LVT6UL2-BRucKCt2.js} +1 -1
- package/dist/src/view/client/assets/channel-BgDNA_Ay.js +1 -0
- package/dist/src/view/client/assets/{chunk-2Q5K7J3B-CnBKL-lm.js → chunk-2Q5K7J3B-BJPcFivt.js} +1 -1
- package/dist/src/view/client/assets/{chunk-5VM5RSS4-LLYMi_n6.js → chunk-5VM5RSS4-v2q99bGz.js} +1 -1
- package/dist/src/view/client/assets/{chunk-F27PBJKO-VIeO7VF0.js → chunk-F27PBJKO-CcHOuJCs.js} +1 -1
- package/dist/src/view/client/assets/{chunk-IMKFNOWR-D5i67DVD.js → chunk-IMKFNOWR-DNxYuJNq.js} +1 -1
- package/dist/src/view/client/assets/{chunk-JWPE2WC7-D4qAtoL3.js → chunk-JWPE2WC7-C0eHKvLW.js} +1 -1
- package/dist/src/view/client/assets/{chunk-POPQ4Y6H-BMzOyiW_.js → chunk-POPQ4Y6H-57CWp2Ve.js} +1 -1
- package/dist/src/view/client/assets/{chunk-SVP7TREG-DWy5nbfp.js → chunk-SVP7TREG-BqcoxIJw.js} +1 -1
- package/dist/src/view/client/assets/{chunk-TICWLB2K-CVqCANFB.js → chunk-TICWLB2K-DRUJR5zH.js} +1 -1
- package/dist/src/view/client/assets/{chunk-XXDRQBXY-Bp23h6Tf.js → chunk-XXDRQBXY-Dez0oRoM.js} +1 -1
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-CFZ_Sgh5.js +1 -0
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-CFZ_Sgh5.js +1 -0
- package/dist/src/view/client/assets/{cose-bilkent-JH36ORCC-BCw7fCC2.js → cose-bilkent-JH36ORCC-BHtud6Hg.js} +1 -1
- package/dist/src/view/client/assets/{cynefin-OW5HDTMX--lYN4N9m.js → cynefin-OW5HDTMX-BjBW8VGk.js} +1 -1
- package/dist/src/view/client/assets/{cynefinDiagram-5FMLGOSQ-9sK5EV7v.js → cynefinDiagram-5FMLGOSQ-DwGuD7oF.js} +1 -1
- package/dist/src/view/client/assets/{dagre-GXQ25YYZ-CoMdEFCq.js → dagre-GXQ25YYZ-C5zSlGK9.js} +1 -1
- package/dist/src/view/client/assets/{diagram-S7CK7UJ4-D13dyWdd.js → diagram-S7CK7UJ4-C_NhA3bj.js} +1 -1
- package/dist/src/view/client/assets/{diagram-UQ7AKVKN-PdwLPPPA.js → diagram-UQ7AKVKN-az7QPYNb.js} +1 -1
- package/dist/src/view/client/assets/{diagram-VSXAHHWV-CtWWa_A7.js → diagram-VSXAHHWV-BRvDuM8_.js} +1 -1
- package/dist/src/view/client/assets/{diagram-VX7I27RA-BeCYcSU-.js → diagram-VX7I27RA-BWLgF6S-.js} +1 -1
- package/dist/src/view/client/assets/{diagram-Z3DM3KII-DiWabOBM.js → diagram-Z3DM3KII-DV3d6mL5.js} +1 -1
- package/dist/src/view/client/assets/{ebnfDiagram-PWID7BFC-CZQ3MD_K.js → ebnfDiagram-PWID7BFC-yUXrEAvK.js} +1 -1
- package/dist/src/view/client/assets/{erDiagram-RLTQ6QDP-B1AhXIrP.js → erDiagram-RLTQ6QDP-D35FN1Pt.js} +1 -1
- package/dist/src/view/client/assets/{flowDiagram-HODETNUW-Bhr0JM6P.js → flowDiagram-HODETNUW-BciZqsjT.js} +1 -1
- package/dist/src/view/client/assets/{ganttDiagram-EL5Y4UJY-CbP8iAkg.js → ganttDiagram-EL5Y4UJY-BysPGgXS.js} +1 -1
- package/dist/src/view/client/assets/{gitGraphDiagram-WWUBYQGX-B9uuGdLF.js → gitGraphDiagram-WWUBYQGX-C3DdJ5xG.js} +1 -1
- package/dist/src/view/client/assets/index-CJokoRSp.js +13 -0
- package/dist/src/view/client/assets/{infoDiagram-27XIBGKW-BrfwQ_Cq.js → infoDiagram-27XIBGKW-D3HZrDRb.js} +1 -1
- package/dist/src/view/client/assets/{ishikawaDiagram-5VMMS53U-CHtJ36re.js → ishikawaDiagram-5VMMS53U-BXyVIXTU.js} +1 -1
- package/dist/src/view/client/assets/{journeyDiagram-3NMN7TZE-BChcgX1s.js → journeyDiagram-3NMN7TZE-D4-1NxVU.js} +1 -1
- package/dist/src/view/client/assets/{kanban-definition-UXKFOSKX-BnwFsKiB.js → kanban-definition-UXKFOSKX-4Gu_5yBA.js} +1 -1
- package/dist/src/view/client/assets/{layout-Dnd0pLdb.js → layout-Jf1K3TMM.js} +1 -1
- package/dist/src/view/client/assets/{linear-CFhW2ozn.js → linear-DWfwzUT_.js} +1 -1
- package/dist/src/view/client/assets/{mermaid.core--OP6lXtW.js → mermaid.core-DMx_DAl8.js} +5 -5
- package/dist/src/view/client/assets/{mindmap-definition-YA3MSWOX-D51y2zbm.js → mindmap-definition-YA3MSWOX-8pxY_RWi.js} +1 -1
- package/dist/src/view/client/assets/{pegDiagram-XKGWAZYB--zyQJDvI.js → pegDiagram-XKGWAZYB-DNAw_O5t.js} +1 -1
- package/dist/src/view/client/assets/{pieDiagram-E7YTZNPT-Cj8mvpJy.js → pieDiagram-E7YTZNPT-uuvRCDkC.js} +1 -1
- package/dist/src/view/client/assets/{quadrantDiagram-AXDQQJYC-qvhJrnBf.js → quadrantDiagram-AXDQQJYC-BER2O4Aq.js} +1 -1
- package/dist/src/view/client/assets/{railroadDiagram-O6MQD6OU-CtWvxpSo.js → railroadDiagram-O6MQD6OU-CxEsJ_0n.js} +1 -1
- package/dist/src/view/client/assets/{requirementDiagram-BXWQKSXE-CBxen_KG.js → requirementDiagram-BXWQKSXE-yS9rspca.js} +1 -1
- package/dist/src/view/client/assets/{sankeyDiagram-P5KCCOFB-B_fUkmfc.js → sankeyDiagram-P5KCCOFB-Bqt70a2j.js} +1 -1
- package/dist/src/view/client/assets/{sequenceDiagram-WJ2MYXX4-Dclv4p68.js → sequenceDiagram-WJ2MYXX4-BvOOEJNr.js} +1 -1
- package/dist/src/view/client/assets/{sizeCapture-INFHLROL-GfG0sMTZ.js → sizeCapture-INFHLROL-CvO_Pjjo.js} +1 -1
- package/dist/src/view/client/assets/{stateDiagram-D77RDMKH-YQWPnzxU.js → stateDiagram-D77RDMKH-KLmVOZkq.js} +1 -1
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-KCS8Mdzu.js +1 -0
- package/dist/src/view/client/assets/{swimlanes-42K2YHIH-5yiCveVS.js → swimlanes-42K2YHIH-DC1r4_sq.js} +1 -1
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-B2TcAwis.js +8 -0
- package/dist/src/view/client/assets/{timeline-definition-24CTP7MA-BvAbB5Zs.js → timeline-definition-24CTP7MA-ChXLOuBL.js} +1 -1
- package/dist/src/view/client/assets/{vennDiagram-4TSXK5OY-guC-r60n.js → vennDiagram-4TSXK5OY-D9_h25-Y.js} +1 -1
- package/dist/src/view/client/assets/{wardleyDiagram-VM6X3IG4-C0yXcU2x.js → wardleyDiagram-VM6X3IG4-CsQJGGW0.js} +1 -1
- package/dist/src/view/client/assets/{xychartDiagram-S5SC5T6Z-RPmkPNfK.js → xychartDiagram-S5SC5T6Z-DGMuPMlm.js} +1 -1
- package/dist/src/view/client/index.html +1 -1
- package/dist/src/view/diagnostics.d.ts +2 -2
- package/dist/src/view/diagnostics.js +5 -5
- package/dist/src/view/external-document-tree.js +1 -1
- package/dist/src/view/git-diff.js +1 -1
- package/dist/src/view/git.js +1 -1
- package/dist/src/view/graph.d.ts +2 -2
- package/dist/src/view/graph.js +2 -2
- package/dist/src/view/markdown.js +1 -1
- package/dist/src/view/preindexed-search.d.ts +1 -1
- package/dist/src/view/protocol.d.ts +2 -18
- package/dist/src/view/publication.d.ts +2 -0
- package/dist/src/view/publication.js +78 -0
- package/dist/src/view/references.d.ts +3 -3
- package/dist/src/view/references.js +3 -3
- package/dist/src/view/repository.d.ts +6 -6
- package/dist/src/view/repository.js +28 -14
- 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 +1 -1
- package/dist/src/view/search-result.js +1 -1
- package/dist/src/view/search.d.ts +1 -1
- package/dist/src/view/server-build.d.ts +2 -2
- package/dist/src/view/server-build.js +2 -2
- package/dist/src/view/server-deployment.d.ts +1 -2
- package/dist/src/view/server-deployment.js +6 -46
- package/dist/src/view/server-index-worker.d.ts +1 -1
- package/dist/src/view/server.d.ts +1 -1
- package/dist/src/view/server.js +13 -3
- package/dist/src/view/source-target.js +2 -2
- package/dist/src/view/static-build.d.ts +1 -1
- package/dist/src/view/static-build.js +49 -17
- package/dist/src/view/store.d.ts +4 -2
- package/dist/src/view/store.js +31 -19
- package/dist/src/view/table-of-contents.d.ts +1 -1
- package/dist/src/view/table-of-contents.js +1 -1
- package/dist/src/view/vercel-server-build.d.ts +1 -1
- package/package.json +19 -29
- package/templates/AGENTS.md +2 -2
- package/templates/cursor-rules.md +2 -2
- package/templates/opencode-plugin.ts +9 -9
- package/templates/pi-extension.ts +11 -11
- package/templates/skill/SKILL.md +2 -1
- package/dist/src/cli/check-context.d.ts +0 -56
- package/dist/src/cli/check-context.js +0 -215
- package/dist/src/cli/check-coverage.d.ts +0 -2
- package/dist/src/cli/check-coverage.js +0 -75
- package/dist/src/cli/check-frontmatter.d.ts +0 -12
- package/dist/src/cli/check-frontmatter.js +0 -44
- package/dist/src/cli/check-mode.d.ts +0 -21
- package/dist/src/cli/check-mode.js +0 -394
- 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 -52
- package/dist/src/cli/check.js +0 -834
- 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 -7
- package/dist/src/cli/expand.js +0 -141
- package/dist/src/cli/external.d.ts +0 -11
- package/dist/src/cli/external.js +0 -185
- 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 -18
- package/dist/src/cli/refs.d.ts +0 -23
- package/dist/src/cli/refs.js +0 -274
- package/dist/src/cli/section.d.ts +0 -45
- package/dist/src/cli/section.js +0 -328
- 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 -29
- package/dist/src/code-refs.js +0 -479
- package/dist/src/config.d.ts +0 -29
- package/dist/src/config.js +0 -83
- package/dist/src/context.d.ts +0 -26
- package/dist/src/context.js +0 -11
- package/dist/src/document-formats.d.ts +0 -7
- package/dist/src/document-formats.js +0 -39
- package/dist/src/extensions/alert-marker.d.ts +0 -25
- package/dist/src/extensions/alert-marker.js +0 -55
- 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/extensions/wiki-link/types.js +0 -1
- package/dist/src/external-documents.d.ts +0 -56
- package/dist/src/external-documents.js +0 -404
- package/dist/src/external-sources.d.ts +0 -136
- package/dist/src/external-sources.js +0 -1098
- package/dist/src/fork/frontmatter-fields.d.ts +0 -36
- package/dist/src/fork/frontmatter-fields.js +0 -23
- package/dist/src/format.d.ts +0 -16
- package/dist/src/format.js +0 -76
- package/dist/src/init-version.d.ts +0 -10
- package/dist/src/init-version.js +0 -49
- package/dist/src/lattice-model.d.ts +0 -84
- package/dist/src/lattice-model.js +0 -467
- package/dist/src/lattice.d.ts +0 -14
- package/dist/src/lattice.js +0 -353
- package/dist/src/markdown-analysis-cache.d.ts +0 -20
- package/dist/src/markdown-analysis-cache.js +0 -139
- package/dist/src/markdown-analysis-worker.d.ts +0 -16
- package/dist/src/markdown-analysis-worker.js +0 -33
- package/dist/src/markdown-analysis.d.ts +0 -61
- package/dist/src/markdown-analysis.js +0 -169
- package/dist/src/markdown-analyzer-loader.d.ts +0 -4
- package/dist/src/markdown-analyzer-loader.js +0 -13
- package/dist/src/markdown-validation.d.ts +0 -25
- package/dist/src/markdown-validation.js +0 -104
- package/dist/src/parser-cache.d.ts +0 -17
- package/dist/src/parser-cache.js +0 -65
- package/dist/src/parser-import.d.ts +0 -8
- package/dist/src/parser-import.js +0 -1
- package/dist/src/parser.d.ts +0 -3
- package/dist/src/parser.js +0 -93
- package/dist/src/path.d.ts +0 -2
- package/dist/src/path.js +0 -4
- package/dist/src/profiler.d.ts +0 -16
- package/dist/src/profiler.js +0 -81
- package/dist/src/project-analysis.d.ts +0 -59
- package/dist/src/project-analysis.js +0 -233
- package/dist/src/project-discovery.d.ts +0 -6
- package/dist/src/project-discovery.js +0 -30
- package/dist/src/repository-path.d.ts +0 -11
- package/dist/src/repository-path.js +0 -52
- package/dist/src/source-formats.d.ts +0 -7
- package/dist/src/source-formats.js +0 -30
- package/dist/src/source-parser.d.ts +0 -67
- package/dist/src/source-parser.js +0 -1749
- package/dist/src/untrusted.d.ts +0 -18
- package/dist/src/untrusted.js +0 -93
- package/dist/src/view/client/assets/channel-uy0fFvcW.js +0 -1
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-DbSEqjA5.js +0 -1
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-DbSEqjA5.js +0 -1
- package/dist/src/view/client/assets/index-nBmbYfun.js +0 -13
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-gUj6Hzgl.js +0 -1
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-DR7JhrxL.js +0 -8
- package/dist/src/walk.d.ts +0 -20
- package/dist/src/walk.js +0 -121
package/dist/src/view/store.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { repositoryFilePath } from '@plebeiantech/lat.md-core/repository-path';
|
|
1
2
|
import { randomUUID } from 'node:crypto';
|
|
2
3
|
import { watch as watchFiles } from 'node:fs';
|
|
3
4
|
import { readFile, realpath, rename, rm, stat, writeFile, } from 'node:fs/promises';
|
|
4
5
|
import { basename, extname, isAbsolute, relative, resolve, sep, } from 'node:path';
|
|
5
|
-
import { createCodeReferenceDiscovery, LAT_REF_RE, } from '
|
|
6
|
-
import { createExternalResolver, } from '
|
|
7
|
-
import { listLatticeFiles } from '
|
|
8
|
-
import { analyzeMarkdownPath } from '
|
|
9
|
-
import { isSourceFileExtension } from '
|
|
10
|
-
import { toPosix } from '
|
|
6
|
+
import { createCodeReferenceDiscovery, LAT_REF_RE, } from '@plebeiantech/lat.md-core/code-refs';
|
|
7
|
+
import { createExternalResolver, } from '@plebeiantech/lat.md-core/external-sources';
|
|
8
|
+
import { listLatticeFiles } from '@plebeiantech/lat.md-core/project-discovery';
|
|
9
|
+
import { analyzeMarkdownPath } from '@plebeiantech/lat.md-core/markdown-analysis-cache';
|
|
10
|
+
import { isSourceFileExtension } from '@plebeiantech/lat.md-core/source-formats';
|
|
11
|
+
import { toPosix } from '@plebeiantech/lat.md-core/path';
|
|
11
12
|
import { renderMarkdown } from './markdown.js';
|
|
12
13
|
import { buildViewDiagnostics } from './diagnostics.js';
|
|
13
14
|
import { applyDocumentEdit, ViewDocumentConflictError, } from './document-edit.js';
|
|
@@ -16,7 +17,7 @@ import { buildViewGraph } from './graph.js';
|
|
|
16
17
|
import { buildViewTableOfContents } from './table-of-contents.js';
|
|
17
18
|
import { emptyViewGitSnapshot, findViewGitRepository, readViewGitSnapshot, sameViewGitSnapshot, } from './git.js';
|
|
18
19
|
import { DEFAULT_VIEW_LOGO_TEXT } from './protocol.js';
|
|
19
|
-
import { createMarkdownWikiLinkResolver, getViewExternal, getViewSource, ViewDocumentNotFoundError, } from './repository.js';
|
|
20
|
+
import { createMarkdownWikiLinkResolver, getViewExternal, getViewSource, ViewDocumentNotFoundError, ViewSourceNotFoundError, } from './repository.js';
|
|
20
21
|
import { buildViewReferenceIndex, renderSectionBackReferences, } from './references.js';
|
|
21
22
|
import { rewriteLocalFileLink } from './source-target.js';
|
|
22
23
|
const DEFAULT_DEBOUNCE_MS = 75;
|
|
@@ -75,7 +76,10 @@ async function loadCodeReferenceFiles(projectRoot, refs) {
|
|
|
75
76
|
const files = new Map();
|
|
76
77
|
await Promise.all([...refsByFile].map(async ([path, fileRefs]) => {
|
|
77
78
|
try {
|
|
78
|
-
const
|
|
79
|
+
const safePath = await repositoryFilePath(projectRoot, path);
|
|
80
|
+
if (!safePath)
|
|
81
|
+
return;
|
|
82
|
+
const content = await readFile(safePath, 'utf8');
|
|
79
83
|
files.set(path, { path, lines: content.split('\n'), refs: fileRefs });
|
|
80
84
|
}
|
|
81
85
|
catch {
|
|
@@ -84,16 +88,18 @@ async function loadCodeReferenceFiles(projectRoot, refs) {
|
|
|
84
88
|
}));
|
|
85
89
|
return files;
|
|
86
90
|
}
|
|
87
|
-
async function scanCodeState(projectRoot, excludedPaths = []) {
|
|
91
|
+
async function scanCodeState(projectRoot, excludedPaths = [], publishable) {
|
|
88
92
|
const discovery = createCodeReferenceDiscovery(projectRoot);
|
|
89
93
|
const [scan, sourceFiles] = await Promise.all([
|
|
90
94
|
discovery.scan(),
|
|
91
95
|
discovery.listSourceFiles(),
|
|
92
96
|
]);
|
|
93
97
|
const allowed = (path) => !excludedCodePath(projectRoot, path, excludedPaths);
|
|
94
|
-
const
|
|
95
|
-
const
|
|
98
|
+
const candidates = sourceFiles.filter(allowed);
|
|
99
|
+
const decisions = await Promise.all(candidates.map((path) => publishable?.(projectPath(projectRoot, path)) ?? true));
|
|
100
|
+
const files = candidates.filter((_, index) => decisions[index]);
|
|
96
101
|
const scope = new Set(files.map((path) => projectPath(projectRoot, path)));
|
|
102
|
+
const refs = scan.refs.filter((ref) => allowed(ref.file) && scope.has(ref.file));
|
|
97
103
|
return {
|
|
98
104
|
files: await loadCodeReferenceFiles(projectRoot, refs),
|
|
99
105
|
scope,
|
|
@@ -269,7 +275,7 @@ export class ViewStore {
|
|
|
269
275
|
const requestedPath = section
|
|
270
276
|
? toPosix(relative(this.latDir, resolve(this.projectRoot, section.filePath)))
|
|
271
277
|
: 'section-output.md';
|
|
272
|
-
const resolver = await createMarkdownWikiLinkResolver(this.latDir, requestedPath, snapshot.allSections, snapshot.references, snapshot.external);
|
|
278
|
+
const resolver = await createMarkdownWikiLinkResolver(this.latDir, requestedPath, snapshot.allSections, snapshot.references, snapshot.external, this.options.publishable);
|
|
273
279
|
return (await renderMarkdown(markdown, requestedPath, resolver)).tree;
|
|
274
280
|
}
|
|
275
281
|
async getDocument(requestedPath) {
|
|
@@ -284,7 +290,7 @@ export class ViewStore {
|
|
|
284
290
|
if (!file) {
|
|
285
291
|
throw new ViewDocumentNotFoundError('Markdown document not found');
|
|
286
292
|
}
|
|
287
|
-
const resolver = await createMarkdownWikiLinkResolver(this.latDir, requestedPath, snapshot.allSections, snapshot.references, snapshot.external);
|
|
293
|
+
const resolver = await createMarkdownWikiLinkResolver(this.latDir, requestedPath, snapshot.allSections, snapshot.references, snapshot.external, this.options.publishable);
|
|
288
294
|
const rendered = await renderMarkdown(file.content, requestedPath, resolver, {
|
|
289
295
|
errors: [...(snapshot.diagnostics.get(requestedPath) ?? [])],
|
|
290
296
|
rewriteMarkdownLink: (url) => rewriteLocalFileLink(url, requestedPath),
|
|
@@ -319,7 +325,7 @@ export class ViewStore {
|
|
|
319
325
|
return [headingId, node.id];
|
|
320
326
|
})),
|
|
321
327
|
errors,
|
|
322
|
-
backReferences: await renderSectionBackReferences(snapshot.references, file.sections, this.latDir, this.projectRoot, (path) => createMarkdownWikiLinkResolver(this.latDir, path, snapshot.allSections, snapshot.references, snapshot.external)),
|
|
328
|
+
backReferences: await renderSectionBackReferences(snapshot.references, file.sections, this.latDir, this.projectRoot, (path) => createMarkdownWikiLinkResolver(this.latDir, path, snapshot.allSections, snapshot.references, snapshot.external, this.options.publishable)),
|
|
323
329
|
frontmatter: {
|
|
324
330
|
requireCodeMention: file.frontmatter.requireCodeMention === true,
|
|
325
331
|
},
|
|
@@ -350,6 +356,9 @@ export class ViewStore {
|
|
|
350
356
|
return { path: requestedPath, content: await readFile(path, 'utf8') };
|
|
351
357
|
}
|
|
352
358
|
async getDocumentResource(requestedPath) {
|
|
359
|
+
if (this.options.publishable &&
|
|
360
|
+
!(await this.options.publishable(projectPath(this.projectRoot, resolve(this.latDir, requestedPath)))))
|
|
361
|
+
throw new ViewDocumentNotFoundError(`Resource is excluded from publication: ${requestedPath}`);
|
|
353
362
|
if (!requestedPath ||
|
|
354
363
|
requestedPath.includes('\\') ||
|
|
355
364
|
isAbsolute(requestedPath) ||
|
|
@@ -402,13 +411,16 @@ export class ViewStore {
|
|
|
402
411
|
this.editTail = operation.then(() => undefined, () => undefined);
|
|
403
412
|
return operation;
|
|
404
413
|
}
|
|
405
|
-
getSource(requestedPath, requestedSymbol = '', origin, requestedLine = 0) {
|
|
414
|
+
async getSource(requestedPath, requestedSymbol = '', origin, requestedLine = 0) {
|
|
415
|
+
if (this.options.publishable &&
|
|
416
|
+
!(await this.options.publishable(requestedPath)))
|
|
417
|
+
throw new ViewSourceNotFoundError(`Source is excluded from publication: ${requestedPath}`);
|
|
406
418
|
const snapshot = this.snapshotValue;
|
|
407
|
-
return getViewSource(this.latDir, this.projectRoot, requestedPath, requestedSymbol, origin, requestedLine, snapshot.allSections, snapshot.references);
|
|
419
|
+
return getViewSource(this.latDir, this.projectRoot, requestedPath, requestedSymbol, origin, requestedLine, snapshot.allSections, snapshot.references, this.options.publishable);
|
|
408
420
|
}
|
|
409
421
|
getExternal(target) {
|
|
410
422
|
const snapshot = this.snapshotValue;
|
|
411
|
-
return getViewExternal(this.latDir, this.projectRoot, target, snapshot.external, snapshot.allSections, snapshot.references);
|
|
423
|
+
return getViewExternal(this.latDir, this.projectRoot, target, snapshot.external, snapshot.allSections, snapshot.references, this.options.publishable);
|
|
412
424
|
}
|
|
413
425
|
refresh(paths) {
|
|
414
426
|
if (this.closed)
|
|
@@ -581,7 +593,7 @@ export class ViewStore {
|
|
|
581
593
|
paths.some((path) => path === '.gitignore' || path.endsWith('/.gitignore')) ||
|
|
582
594
|
codePaths.some((path) => !this.codeScope.has(path) && !this.ignoredCodePaths.has(path));
|
|
583
595
|
if (refreshCodeScope) {
|
|
584
|
-
const nextCode = await scanCodeState(this.projectRoot, this.options.codeExcludePaths);
|
|
596
|
+
const nextCode = await scanCodeState(this.projectRoot, this.options.codeExcludePaths, this.options.publishable);
|
|
585
597
|
codeFiles = nextCode.files;
|
|
586
598
|
this.codeScope = nextCode.scope;
|
|
587
599
|
this.ignoredCodePaths.clear();
|
|
@@ -639,7 +651,7 @@ export async function createViewStore(latDir, projectRoot, options = {}) {
|
|
|
639
651
|
const [realLatDir, markdownPaths, codeState, gitRepository] = await Promise.all([
|
|
640
652
|
realpath(latDir),
|
|
641
653
|
listLatticeFiles(latDir),
|
|
642
|
-
scanCodeState(projectRoot, options.codeExcludePaths),
|
|
654
|
+
scanCodeState(projectRoot, options.codeExcludePaths, options.publishable),
|
|
643
655
|
options.git === false
|
|
644
656
|
? Promise.resolve(null)
|
|
645
657
|
: findViewGitRepository(projectRoot, latDir),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Root } from 'mdast';
|
|
2
|
-
import { type Section } from '
|
|
2
|
+
import { type Section } from '@plebeiantech/lat.md-core/lattice-model';
|
|
3
3
|
import type { ViewDocumentError, ViewDocumentTocItem } from './protocol.js';
|
|
4
4
|
export type ViewTableOfContentsOptions = {
|
|
5
5
|
errors?: readonly ViewDocumentError[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CmdContext } from '
|
|
1
|
+
import type { CmdContext } from '@plebeiantech/lat.md-core/context';
|
|
2
2
|
import { buildServerView, type ServerViewBuildOptions, type ServerViewBuildResult } from './server-build.js';
|
|
3
3
|
import { type VercelBuildOptions, type VercelBuildResult } from './vercel-build.js';
|
|
4
4
|
export type VercelServerBuildDependencies = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plebeiantech/lat.md",
|
|
3
|
-
"version": "0.12.3-fork.
|
|
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",
|
|
@@ -71,55 +71,41 @@
|
|
|
71
71
|
"three": "^0.185.1",
|
|
72
72
|
"topojson-client": "^3.1.0",
|
|
73
73
|
"tsx": "^4.21.0",
|
|
74
|
-
"typescript": "
|
|
74
|
+
"typescript": "7.0.2",
|
|
75
75
|
"vite": "^7.0.0",
|
|
76
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",
|
|
77
82
|
"@lat.md/server": "0.1.0"
|
|
78
83
|
},
|
|
79
84
|
"dependencies": {
|
|
80
85
|
"@asciidoctor/core": "4.0.6",
|
|
81
|
-
"@folder/xdg": "^4.0.1",
|
|
82
86
|
"@libsql/client": "^0.17.0",
|
|
83
87
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
84
|
-
"@repomix/tree-sitter-wasms": "^0.1.17",
|
|
85
88
|
"@tursodatabase/database": "0.7.2",
|
|
86
89
|
"@vercel/nft": "^1.10.0",
|
|
87
90
|
"commander": "^14.0.3",
|
|
88
91
|
"diff": "^8.0.4",
|
|
89
92
|
"express": "^5.2.1",
|
|
90
93
|
"fs-native-extensions": "1.5.1",
|
|
91
|
-
"github-slugger": "^2.0.0",
|
|
92
|
-
"ignore-walk": "^8.0.0",
|
|
93
|
-
"mdast-util-gfm-autolink-literal": "^2.0.1",
|
|
94
|
-
"mdast-util-gfm-footnote": "^2.1.0",
|
|
95
|
-
"mdast-util-gfm-strikethrough": "^2.0.0",
|
|
96
|
-
"mdast-util-gfm-table": "^2.0.0",
|
|
97
|
-
"mdast-util-gfm-task-list-item": "^2.0.0",
|
|
98
|
-
"mdast-util-to-markdown": "^2.1.0",
|
|
99
|
-
"micromark-extension-gfm-autolink-literal": "^2.1.0",
|
|
100
|
-
"micromark-extension-gfm-footnote": "^2.1.0",
|
|
101
|
-
"micromark-extension-gfm-strikethrough": "^2.1.0",
|
|
102
|
-
"micromark-extension-gfm-table": "^2.1.1",
|
|
103
|
-
"micromark-extension-gfm-task-list-item": "^2.1.0",
|
|
104
94
|
"rehype-katex": "^7.0.1",
|
|
105
95
|
"rehype-raw": "^7.0.0",
|
|
106
96
|
"rehype-sanitize": "^6.0.0",
|
|
107
97
|
"rehype-slug": "^6.0.0",
|
|
108
98
|
"remark-emoji": "^5.0.2",
|
|
109
|
-
"remark-frontmatter": "^5.0.0",
|
|
110
|
-
"remark-math": "^6.0.0",
|
|
111
|
-
"remark-parse": "^11.0.0",
|
|
112
99
|
"remark-rehype": "^11.1.2",
|
|
113
|
-
"remark-stringify": "^11.0.0",
|
|
114
100
|
"rst-compiler": "0.5.9",
|
|
115
101
|
"unified": "^11.0.0",
|
|
116
102
|
"unist-util-visit": "^5.0.0",
|
|
117
|
-
"web-tree-sitter": "^0.26.6",
|
|
118
103
|
"yaml": "^2.8.2",
|
|
119
104
|
"zod": "^4.3.6",
|
|
120
105
|
"@lat.md/embed": "0.2.1",
|
|
121
|
-
"@lat.md
|
|
122
|
-
"@lat.md/embed-minilm-fp16": "0.1.0"
|
|
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"
|
|
123
109
|
},
|
|
124
110
|
"scripts": {
|
|
125
111
|
"build": "tsc && tsx scripts/fork-vendor-ui-server.ts && pnpm build:view",
|
|
@@ -131,12 +117,16 @@
|
|
|
131
117
|
"setup:rust": "pnpm --filter @lat.md/embed setup:rust",
|
|
132
118
|
"build:wasm": "pnpm --filter @lat.md/embed build:wasm",
|
|
133
119
|
"build:weights": "pnpm --filter @lat.md/embed-minilm-fp16 build:weights",
|
|
134
|
-
"build:packages": "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",
|
|
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",
|
|
135
121
|
"test": "vitest run",
|
|
136
122
|
"test:watch": "vitest",
|
|
137
|
-
"typecheck": "pnpm --filter @lat.md/server build && tsc --noEmit && tsc --noEmit -p view/tsconfig.json",
|
|
138
|
-
"format": "prettier --write \"src/**/*.ts\" \"packages/server/src/**/*.ts\" \"view/**/*.{ts,tsx,css,html}\"",
|
|
139
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"packages/server/src/**/*.ts\" \"view/**/*.{ts,tsx,css,html}\"",
|
|
140
|
-
"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"
|
|
141
131
|
}
|
|
142
132
|
}
|
package/templates/AGENTS.md
CHANGED
|
@@ -9,7 +9,7 @@ Use Lat's knowledge graph to ground each task before changing code.
|
|
|
9
9
|
|
|
10
10
|
After EVERY task, before responding to the user:
|
|
11
11
|
|
|
12
|
-
- [ ] Update `lat.md/` if you added or changed meaningful functionality, architecture, tests,
|
|
12
|
+
- [ ] Update `lat.md/` if you added or changed meaningful implemented functionality, architecture, tests, or behavior. Keep it a focused snapshot of the current implemented state, not a journal/changelog. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there.
|
|
13
13
|
- [ ] Run `lat check` — all validations must pass
|
|
14
14
|
- [ ] Do not skip these steps. Do not consider your task done until both are complete.
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ After EVERY task, before responding to the user:
|
|
|
19
19
|
|
|
20
20
|
Lat.md is the project's structured knowledge graph for architecture, design decisions, behavior, and tests.
|
|
21
21
|
|
|
22
|
-
The graph lives in `lat.md/` as cross-linked Markdown describing **what** the project does and **why**. Use it to ground work in actual architecture, and keep it a focused current
|
|
22
|
+
The graph lives in `lat.md/` as cross-linked Markdown describing **what** the project does and **why**. Use it to ground work in actual architecture, and keep it a focused snapshot of the current implemented state rather than a journal or changelog.
|
|
23
23
|
|
|
24
24
|
Project-specific lat documentation belongs in `lat.md/`. Do not modify this generated instruction file or a generated `lat-md` `SKILL.md` to record project guidance: both are owned by lat tooling and may be replaced by a later `lat init`.
|
|
25
25
|
|
|
@@ -9,7 +9,7 @@ Use Lat's knowledge graph to ground each task before changing code.
|
|
|
9
9
|
|
|
10
10
|
After EVERY task, before responding to the user:
|
|
11
11
|
|
|
12
|
-
- [ ] Update `lat.md/` if you added or changed meaningful functionality, architecture, tests,
|
|
12
|
+
- [ ] Update `lat.md/` if you added or changed meaningful implemented functionality, architecture, tests, or behavior. Keep it a focused snapshot of the current implemented state, not a journal/changelog. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there.
|
|
13
13
|
- [ ] Use the `lat_check` tool — all validations must pass
|
|
14
14
|
- [ ] Do not skip these steps. Do not consider your task done until both are complete.
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ After EVERY task, before responding to the user:
|
|
|
19
19
|
|
|
20
20
|
Lat.md is the project's structured knowledge graph for architecture, design decisions, behavior, and tests.
|
|
21
21
|
|
|
22
|
-
The graph lives in `lat.md/` as cross-linked Markdown describing **what** the project does and **why**. Use it to ground work in actual architecture, and keep it a focused current
|
|
22
|
+
The graph lives in `lat.md/` as cross-linked Markdown describing **what** the project does and **why**. Use it to ground work in actual architecture, and keep it a focused snapshot of the current implemented state rather than a journal or changelog.
|
|
23
23
|
|
|
24
24
|
# Tools
|
|
25
25
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Plugin, tool } from "@opencode-ai/plugin"
|
|
2
|
-
import { execSync } from "child_process"
|
|
2
|
+
import { execSync, execFileSync } from "child_process"
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
const LAT =
|
|
4
|
+
/** Executable and prefix arguments, injected by `lat init`. */
|
|
5
|
+
const LAT = __LAT_INVOCATION__
|
|
6
6
|
|
|
7
7
|
function run(args: string[]): string {
|
|
8
|
-
return
|
|
8
|
+
return execFileSync(LAT.command, [...LAT.args, ...args], {
|
|
9
9
|
cwd: process.cwd(),
|
|
10
10
|
encoding: "utf-8",
|
|
11
11
|
timeout: 30_000,
|
|
@@ -33,7 +33,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
33
33
|
),
|
|
34
34
|
},
|
|
35
35
|
async execute(args) {
|
|
36
|
-
const cliArgs = ["search",
|
|
36
|
+
const cliArgs = ["search", args.query]
|
|
37
37
|
if (args.limit) cliArgs.push("--limit", String(args.limit))
|
|
38
38
|
const output = tryRun(cliArgs)
|
|
39
39
|
return output || "No results found."
|
|
@@ -49,7 +49,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
49
49
|
),
|
|
50
50
|
},
|
|
51
51
|
async execute(args) {
|
|
52
|
-
const output = tryRun(["section",
|
|
52
|
+
const output = tryRun(["section", args.query])
|
|
53
53
|
return output || "Section not found."
|
|
54
54
|
},
|
|
55
55
|
}),
|
|
@@ -61,7 +61,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
61
61
|
query: tool.schema.string("Section name to locate"),
|
|
62
62
|
},
|
|
63
63
|
async execute(args) {
|
|
64
|
-
const output = tryRun(["locate",
|
|
64
|
+
const output = tryRun(["locate", args.query])
|
|
65
65
|
return output || "No sections matching query."
|
|
66
66
|
},
|
|
67
67
|
}),
|
|
@@ -87,7 +87,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
87
87
|
text: tool.schema.string("Text containing [[refs]] to expand"),
|
|
88
88
|
},
|
|
89
89
|
async execute(args) {
|
|
90
|
-
const output = tryRun(["expand",
|
|
90
|
+
const output = tryRun(["expand", args.text])
|
|
91
91
|
return output || args.text
|
|
92
92
|
},
|
|
93
93
|
}),
|
|
@@ -101,7 +101,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
101
101
|
),
|
|
102
102
|
},
|
|
103
103
|
async execute(args) {
|
|
104
|
-
const output = tryRun(["refs",
|
|
104
|
+
const output = tryRun(["refs", args.query])
|
|
105
105
|
return output || "No references found."
|
|
106
106
|
},
|
|
107
107
|
}),
|
|
@@ -30,12 +30,12 @@ function collapsibleResult(
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
const LAT =
|
|
33
|
+
/** Executable and prefix arguments, injected by `lat init`. */
|
|
34
|
+
const LAT = __LAT_INVOCATION__;
|
|
35
35
|
|
|
36
36
|
function run(args: string[], cwd?: string): string {
|
|
37
|
-
const {
|
|
38
|
-
return
|
|
37
|
+
const { execFileSync } = require("child_process") as typeof import('child_process');
|
|
38
|
+
return execFileSync(LAT.command, [...LAT.args, ...args], {
|
|
39
39
|
cwd: cwd ?? process.cwd(),
|
|
40
40
|
encoding: "utf-8",
|
|
41
41
|
timeout: 30_000,
|
|
@@ -69,7 +69,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
69
69
|
),
|
|
70
70
|
}),
|
|
71
71
|
async execute(_id, params) {
|
|
72
|
-
const args = ["search",
|
|
72
|
+
const args = ["search", params.query];
|
|
73
73
|
if (params.limit) args.push("--limit", String(params.limit));
|
|
74
74
|
const output = tryRun(args);
|
|
75
75
|
return {
|
|
@@ -99,7 +99,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
99
99
|
}),
|
|
100
100
|
}),
|
|
101
101
|
async execute(_id, params) {
|
|
102
|
-
const output = tryRun(["section",
|
|
102
|
+
const output = tryRun(["section", params.query]);
|
|
103
103
|
return {
|
|
104
104
|
content: [
|
|
105
105
|
{ type: "text", text: output || "Section not found." },
|
|
@@ -126,7 +126,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
126
126
|
query: Type.String({ description: "Section name to locate" }),
|
|
127
127
|
}),
|
|
128
128
|
async execute(_id, params) {
|
|
129
|
-
const output = tryRun(["locate",
|
|
129
|
+
const output = tryRun(["locate", params.query]);
|
|
130
130
|
return {
|
|
131
131
|
content: [
|
|
132
132
|
{ type: "text", text: output || "No sections matching query." },
|
|
@@ -179,7 +179,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
179
179
|
text: Type.String({ description: "Text containing [[refs]] to expand" }),
|
|
180
180
|
}),
|
|
181
181
|
async execute(_id, params) {
|
|
182
|
-
const output = tryRun(["expand",
|
|
182
|
+
const output = tryRun(["expand", params.text]);
|
|
183
183
|
return {
|
|
184
184
|
content: [{ type: "text", text: output || params.text }],
|
|
185
185
|
};
|
|
@@ -205,7 +205,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
205
205
|
}),
|
|
206
206
|
}),
|
|
207
207
|
async execute(_id, params) {
|
|
208
|
-
const output = tryRun(["refs",
|
|
208
|
+
const output = tryRun(["refs", params.query]);
|
|
209
209
|
return {
|
|
210
210
|
content: [{ type: "text", text: output || "No references found." }],
|
|
211
211
|
};
|
|
@@ -276,7 +276,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
276
276
|
"Use `lat_section` to read the full content of relevant matches.",
|
|
277
277
|
"Do not read files, write code, or run commands until you have searched.",
|
|
278
278
|
"",
|
|
279
|
-
"Remember: `lat.md/` must stay in sync with meaningful codebase state. If you change behavior, architecture,
|
|
279
|
+
"Remember: `lat.md/` must stay in sync with meaningful codebase state. If you change implemented behavior, architecture, or tests, update the relevant current-state sections and run `lat_check` before finishing. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there. Do not use `lat.md/` as a journal/changelog or add notes for insignificant details.",
|
|
280
280
|
].join("\n");
|
|
281
281
|
|
|
282
282
|
return {
|
|
@@ -307,7 +307,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
307
307
|
let needsSync = false;
|
|
308
308
|
let codeLines = 0;
|
|
309
309
|
try {
|
|
310
|
-
const { execSync } = require("child_process") as typeof import(
|
|
310
|
+
const { execSync } = require("child_process") as typeof import('child_process');
|
|
311
311
|
const numstat = execSync("git diff HEAD --numstat", {
|
|
312
312
|
encoding: "utf-8",
|
|
313
313
|
cwd: process.cwd(),
|
package/templates/skill/SKILL.md
CHANGED
|
@@ -16,7 +16,7 @@ Project-specific lat documentation belongs in `lat.md/`. Do not modify this gene
|
|
|
16
16
|
|
|
17
17
|
`lat.md/` files describe **what** the project does and **why** — domain concepts, key design decisions, business logic, and test specifications. They do NOT duplicate source code. Think of each section as an anchor that source code references back to.
|
|
18
18
|
|
|
19
|
-
Treat `lat.md/` as a focused snapshot of the current state
|
|
19
|
+
Treat `lat.md/` as a focused snapshot of the current implemented state. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there. A planning-only task does not require a knowledge-graph update. Do not use it as a journal or changelog, and do not grow it just to record insignificant implementation details.
|
|
20
20
|
|
|
21
21
|
Good candidates for sections:
|
|
22
22
|
- Architecture decisions and their rationale
|
|
@@ -29,6 +29,7 @@ Bad candidates:
|
|
|
29
29
|
- Step-by-step code walkthroughs (the code itself is the walkthrough)
|
|
30
30
|
- Auto-generated API docs (use tools for that)
|
|
31
31
|
- Journal/changelog entries for each change
|
|
32
|
+
- Proposals, planned features, hypothetical designs, or promises of future behavior, unless explicitly requested by the user or drafted alongside implementation to describe implemented behavior by commit time
|
|
32
33
|
- Temporary notes or TODOs
|
|
33
34
|
- Insignificant implementation details that do not change the current-state model
|
|
34
35
|
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
}
|