@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.
Files changed (244) hide show
  1. package/README.md +1 -1
  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/fork-instructions.js +1 -1
  5. package/dist/src/cli/fork-scaffold.js +2 -2
  6. package/dist/src/cli/graph.d.ts +1 -1
  7. package/dist/src/cli/hook.js +11 -11
  8. package/dist/src/cli/index.js +41 -59
  9. package/dist/src/cli/init-preferences.js +5 -4
  10. package/dist/src/cli/init.d.ts +1 -1
  11. package/dist/src/cli/init.js +54 -45
  12. package/dist/src/cli/reindex.d.ts +1 -1
  13. package/dist/src/cli/reindex.js +2 -2
  14. package/dist/src/cli/search.d.ts +4 -4
  15. package/dist/src/cli/search.js +41 -28
  16. package/dist/src/cli/ui-build-server.d.ts +1 -1
  17. package/dist/src/cli/ui-build.d.ts +1 -1
  18. package/dist/src/cli/ui.d.ts +1 -1
  19. package/dist/src/fork/antigravity-hook.js +6 -6
  20. package/dist/src/fork/antigravity-init.d.ts +2 -2
  21. package/dist/src/fork/antigravity-init.js +2 -2
  22. package/dist/src/graph-export.js +7 -7
  23. package/dist/src/knowledge/index.js +2 -2
  24. package/dist/src/mcp/server.js +8 -8
  25. package/dist/src/search/cache.d.ts +1 -1
  26. package/dist/src/search/cache.js +40 -7
  27. package/dist/src/search/chunks.d.ts +2 -2
  28. package/dist/src/search/db.d.ts +5 -4
  29. package/dist/src/search/db.js +36 -40
  30. package/dist/src/search/embedder.js +1 -1
  31. package/dist/src/search/index.d.ts +1 -1
  32. package/dist/src/search/index.js +2 -2
  33. package/dist/src/search/lock.d.ts +4 -1
  34. package/dist/src/search/lock.js +30 -8
  35. package/dist/src/search/query.d.ts +5 -2
  36. package/dist/src/search/query.js +55 -38
  37. package/dist/src/search/search.d.ts +3 -1
  38. package/dist/src/search/search.js +21 -12
  39. package/dist/src/search/types.d.ts +2 -18
  40. package/dist/src/view/client/assets/{GraphView-BWlRdQM4.js → GraphView-Dij8mAA_.js} +1 -1
  41. package/dist/src/view/client/assets/{MarkdownEditor-MW-Ck1O0.js → MarkdownEditor-88Wbt0M1.js} +1 -1
  42. package/dist/src/view/client/assets/{abnfDiagram-VCTEODGH-Bn3RshMV.js → abnfDiagram-VCTEODGH-y0DlYa8E.js} +1 -1
  43. package/dist/src/view/client/assets/{arc-En9tdFQF.js → arc-FlMu8dnO.js} +1 -1
  44. package/dist/src/view/client/assets/{architectureDiagram-5GKGNRK7-B-9J1VAM.js → architectureDiagram-5GKGNRK7-DA_uWZW1.js} +1 -1
  45. package/dist/src/view/client/assets/{blockDiagram-I7D4REHJ-QlznwalP.js → blockDiagram-I7D4REHJ-BHQ5LU85.js} +1 -1
  46. package/dist/src/view/client/assets/{c4Diagram-7LVT6UL2-Bp2y8B4_.js → c4Diagram-7LVT6UL2-BRucKCt2.js} +1 -1
  47. package/dist/src/view/client/assets/channel-BgDNA_Ay.js +1 -0
  48. package/dist/src/view/client/assets/{chunk-2Q5K7J3B-CnBKL-lm.js → chunk-2Q5K7J3B-BJPcFivt.js} +1 -1
  49. package/dist/src/view/client/assets/{chunk-5VM5RSS4-LLYMi_n6.js → chunk-5VM5RSS4-v2q99bGz.js} +1 -1
  50. package/dist/src/view/client/assets/{chunk-F27PBJKO-VIeO7VF0.js → chunk-F27PBJKO-CcHOuJCs.js} +1 -1
  51. package/dist/src/view/client/assets/{chunk-IMKFNOWR-D5i67DVD.js → chunk-IMKFNOWR-DNxYuJNq.js} +1 -1
  52. package/dist/src/view/client/assets/{chunk-JWPE2WC7-D4qAtoL3.js → chunk-JWPE2WC7-C0eHKvLW.js} +1 -1
  53. package/dist/src/view/client/assets/{chunk-POPQ4Y6H-BMzOyiW_.js → chunk-POPQ4Y6H-57CWp2Ve.js} +1 -1
  54. package/dist/src/view/client/assets/{chunk-SVP7TREG-DWy5nbfp.js → chunk-SVP7TREG-BqcoxIJw.js} +1 -1
  55. package/dist/src/view/client/assets/{chunk-TICWLB2K-CVqCANFB.js → chunk-TICWLB2K-DRUJR5zH.js} +1 -1
  56. package/dist/src/view/client/assets/{chunk-XXDRQBXY-Bp23h6Tf.js → chunk-XXDRQBXY-Dez0oRoM.js} +1 -1
  57. package/dist/src/view/client/assets/classDiagram-ZZMXUADV-CFZ_Sgh5.js +1 -0
  58. package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-CFZ_Sgh5.js +1 -0
  59. package/dist/src/view/client/assets/{cose-bilkent-JH36ORCC-BCw7fCC2.js → cose-bilkent-JH36ORCC-BHtud6Hg.js} +1 -1
  60. package/dist/src/view/client/assets/{cynefin-OW5HDTMX--lYN4N9m.js → cynefin-OW5HDTMX-BjBW8VGk.js} +1 -1
  61. package/dist/src/view/client/assets/{cynefinDiagram-5FMLGOSQ-9sK5EV7v.js → cynefinDiagram-5FMLGOSQ-DwGuD7oF.js} +1 -1
  62. package/dist/src/view/client/assets/{dagre-GXQ25YYZ-CoMdEFCq.js → dagre-GXQ25YYZ-C5zSlGK9.js} +1 -1
  63. package/dist/src/view/client/assets/{diagram-S7CK7UJ4-D13dyWdd.js → diagram-S7CK7UJ4-C_NhA3bj.js} +1 -1
  64. package/dist/src/view/client/assets/{diagram-UQ7AKVKN-PdwLPPPA.js → diagram-UQ7AKVKN-az7QPYNb.js} +1 -1
  65. package/dist/src/view/client/assets/{diagram-VSXAHHWV-CtWWa_A7.js → diagram-VSXAHHWV-BRvDuM8_.js} +1 -1
  66. package/dist/src/view/client/assets/{diagram-VX7I27RA-BeCYcSU-.js → diagram-VX7I27RA-BWLgF6S-.js} +1 -1
  67. package/dist/src/view/client/assets/{diagram-Z3DM3KII-DiWabOBM.js → diagram-Z3DM3KII-DV3d6mL5.js} +1 -1
  68. package/dist/src/view/client/assets/{ebnfDiagram-PWID7BFC-CZQ3MD_K.js → ebnfDiagram-PWID7BFC-yUXrEAvK.js} +1 -1
  69. package/dist/src/view/client/assets/{erDiagram-RLTQ6QDP-B1AhXIrP.js → erDiagram-RLTQ6QDP-D35FN1Pt.js} +1 -1
  70. package/dist/src/view/client/assets/{flowDiagram-HODETNUW-Bhr0JM6P.js → flowDiagram-HODETNUW-BciZqsjT.js} +1 -1
  71. package/dist/src/view/client/assets/{ganttDiagram-EL5Y4UJY-CbP8iAkg.js → ganttDiagram-EL5Y4UJY-BysPGgXS.js} +1 -1
  72. package/dist/src/view/client/assets/{gitGraphDiagram-WWUBYQGX-B9uuGdLF.js → gitGraphDiagram-WWUBYQGX-C3DdJ5xG.js} +1 -1
  73. package/dist/src/view/client/assets/index-CJokoRSp.js +13 -0
  74. package/dist/src/view/client/assets/{infoDiagram-27XIBGKW-BrfwQ_Cq.js → infoDiagram-27XIBGKW-D3HZrDRb.js} +1 -1
  75. package/dist/src/view/client/assets/{ishikawaDiagram-5VMMS53U-CHtJ36re.js → ishikawaDiagram-5VMMS53U-BXyVIXTU.js} +1 -1
  76. package/dist/src/view/client/assets/{journeyDiagram-3NMN7TZE-BChcgX1s.js → journeyDiagram-3NMN7TZE-D4-1NxVU.js} +1 -1
  77. package/dist/src/view/client/assets/{kanban-definition-UXKFOSKX-BnwFsKiB.js → kanban-definition-UXKFOSKX-4Gu_5yBA.js} +1 -1
  78. package/dist/src/view/client/assets/{layout-Dnd0pLdb.js → layout-Jf1K3TMM.js} +1 -1
  79. package/dist/src/view/client/assets/{linear-CFhW2ozn.js → linear-DWfwzUT_.js} +1 -1
  80. package/dist/src/view/client/assets/{mermaid.core--OP6lXtW.js → mermaid.core-DMx_DAl8.js} +5 -5
  81. package/dist/src/view/client/assets/{mindmap-definition-YA3MSWOX-D51y2zbm.js → mindmap-definition-YA3MSWOX-8pxY_RWi.js} +1 -1
  82. package/dist/src/view/client/assets/{pegDiagram-XKGWAZYB--zyQJDvI.js → pegDiagram-XKGWAZYB-DNAw_O5t.js} +1 -1
  83. package/dist/src/view/client/assets/{pieDiagram-E7YTZNPT-Cj8mvpJy.js → pieDiagram-E7YTZNPT-uuvRCDkC.js} +1 -1
  84. package/dist/src/view/client/assets/{quadrantDiagram-AXDQQJYC-qvhJrnBf.js → quadrantDiagram-AXDQQJYC-BER2O4Aq.js} +1 -1
  85. package/dist/src/view/client/assets/{railroadDiagram-O6MQD6OU-CtWvxpSo.js → railroadDiagram-O6MQD6OU-CxEsJ_0n.js} +1 -1
  86. package/dist/src/view/client/assets/{requirementDiagram-BXWQKSXE-CBxen_KG.js → requirementDiagram-BXWQKSXE-yS9rspca.js} +1 -1
  87. package/dist/src/view/client/assets/{sankeyDiagram-P5KCCOFB-B_fUkmfc.js → sankeyDiagram-P5KCCOFB-Bqt70a2j.js} +1 -1
  88. package/dist/src/view/client/assets/{sequenceDiagram-WJ2MYXX4-Dclv4p68.js → sequenceDiagram-WJ2MYXX4-BvOOEJNr.js} +1 -1
  89. package/dist/src/view/client/assets/{sizeCapture-INFHLROL-GfG0sMTZ.js → sizeCapture-INFHLROL-CvO_Pjjo.js} +1 -1
  90. package/dist/src/view/client/assets/{stateDiagram-D77RDMKH-YQWPnzxU.js → stateDiagram-D77RDMKH-KLmVOZkq.js} +1 -1
  91. package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-KCS8Mdzu.js +1 -0
  92. package/dist/src/view/client/assets/{swimlanes-42K2YHIH-5yiCveVS.js → swimlanes-42K2YHIH-DC1r4_sq.js} +1 -1
  93. package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-B2TcAwis.js +8 -0
  94. package/dist/src/view/client/assets/{timeline-definition-24CTP7MA-BvAbB5Zs.js → timeline-definition-24CTP7MA-ChXLOuBL.js} +1 -1
  95. package/dist/src/view/client/assets/{vennDiagram-4TSXK5OY-guC-r60n.js → vennDiagram-4TSXK5OY-D9_h25-Y.js} +1 -1
  96. package/dist/src/view/client/assets/{wardleyDiagram-VM6X3IG4-C0yXcU2x.js → wardleyDiagram-VM6X3IG4-CsQJGGW0.js} +1 -1
  97. package/dist/src/view/client/assets/{xychartDiagram-S5SC5T6Z-RPmkPNfK.js → xychartDiagram-S5SC5T6Z-DGMuPMlm.js} +1 -1
  98. package/dist/src/view/client/index.html +1 -1
  99. package/dist/src/view/diagnostics.d.ts +2 -2
  100. package/dist/src/view/diagnostics.js +5 -5
  101. package/dist/src/view/external-document-tree.js +1 -1
  102. package/dist/src/view/git-diff.js +1 -1
  103. package/dist/src/view/git.js +1 -1
  104. package/dist/src/view/graph.d.ts +2 -2
  105. package/dist/src/view/graph.js +2 -2
  106. package/dist/src/view/markdown.js +1 -1
  107. package/dist/src/view/preindexed-search.d.ts +1 -1
  108. package/dist/src/view/protocol.d.ts +2 -18
  109. package/dist/src/view/publication.d.ts +2 -0
  110. package/dist/src/view/publication.js +78 -0
  111. package/dist/src/view/references.d.ts +3 -3
  112. package/dist/src/view/references.js +3 -3
  113. package/dist/src/view/repository.d.ts +6 -6
  114. package/dist/src/view/repository.js +28 -14
  115. package/dist/src/view/request-security.d.ts +5 -0
  116. package/dist/src/view/request-security.js +46 -0
  117. package/dist/src/view/search-result.d.ts +1 -1
  118. package/dist/src/view/search-result.js +1 -1
  119. package/dist/src/view/search.d.ts +1 -1
  120. package/dist/src/view/server-build.d.ts +2 -2
  121. package/dist/src/view/server-build.js +2 -2
  122. package/dist/src/view/server-deployment.d.ts +1 -2
  123. package/dist/src/view/server-deployment.js +6 -46
  124. package/dist/src/view/server-index-worker.d.ts +1 -1
  125. package/dist/src/view/server.d.ts +1 -1
  126. package/dist/src/view/server.js +13 -3
  127. package/dist/src/view/source-target.js +2 -2
  128. package/dist/src/view/static-build.d.ts +1 -1
  129. package/dist/src/view/static-build.js +49 -17
  130. package/dist/src/view/store.d.ts +4 -2
  131. package/dist/src/view/store.js +31 -19
  132. package/dist/src/view/table-of-contents.d.ts +1 -1
  133. package/dist/src/view/table-of-contents.js +1 -1
  134. package/dist/src/view/vercel-server-build.d.ts +1 -1
  135. package/package.json +19 -29
  136. package/templates/AGENTS.md +2 -2
  137. package/templates/cursor-rules.md +2 -2
  138. package/templates/opencode-plugin.ts +9 -9
  139. package/templates/pi-extension.ts +11 -11
  140. package/templates/skill/SKILL.md +2 -1
  141. package/dist/src/cli/check-context.d.ts +0 -56
  142. package/dist/src/cli/check-context.js +0 -215
  143. package/dist/src/cli/check-coverage.d.ts +0 -2
  144. package/dist/src/cli/check-coverage.js +0 -75
  145. package/dist/src/cli/check-frontmatter.d.ts +0 -12
  146. package/dist/src/cli/check-frontmatter.js +0 -44
  147. package/dist/src/cli/check-mode.d.ts +0 -21
  148. package/dist/src/cli/check-mode.js +0 -394
  149. package/dist/src/cli/check-status.d.ts +0 -74
  150. package/dist/src/cli/check-status.js +0 -217
  151. package/dist/src/cli/check.d.ts +0 -52
  152. package/dist/src/cli/check.js +0 -834
  153. package/dist/src/cli/context.d.ts +0 -11
  154. package/dist/src/cli/context.js +0 -58
  155. package/dist/src/cli/expand.d.ts +0 -7
  156. package/dist/src/cli/expand.js +0 -141
  157. package/dist/src/cli/external.d.ts +0 -11
  158. package/dist/src/cli/external.js +0 -185
  159. package/dist/src/cli/gen-index.d.ts +0 -45
  160. package/dist/src/cli/gen-index.js +0 -235
  161. package/dist/src/cli/link-scheme.d.ts +0 -54
  162. package/dist/src/cli/link-scheme.js +0 -101
  163. package/dist/src/cli/locate.d.ts +0 -2
  164. package/dist/src/cli/locate.js +0 -18
  165. package/dist/src/cli/refs.d.ts +0 -23
  166. package/dist/src/cli/refs.js +0 -274
  167. package/dist/src/cli/section.d.ts +0 -45
  168. package/dist/src/cli/section.js +0 -328
  169. package/dist/src/cli/select-menu.d.ts +0 -13
  170. package/dist/src/cli/select-menu.js +0 -100
  171. package/dist/src/code-refs.d.ts +0 -29
  172. package/dist/src/code-refs.js +0 -479
  173. package/dist/src/config.d.ts +0 -29
  174. package/dist/src/config.js +0 -83
  175. package/dist/src/context.d.ts +0 -26
  176. package/dist/src/context.js +0 -11
  177. package/dist/src/document-formats.d.ts +0 -7
  178. package/dist/src/document-formats.js +0 -39
  179. package/dist/src/extensions/alert-marker.d.ts +0 -25
  180. package/dist/src/extensions/alert-marker.js +0 -55
  181. package/dist/src/extensions/wiki-link/from-markdown.d.ts +0 -5
  182. package/dist/src/extensions/wiki-link/from-markdown.js +0 -34
  183. package/dist/src/extensions/wiki-link/index.d.ts +0 -4
  184. package/dist/src/extensions/wiki-link/index.js +0 -3
  185. package/dist/src/extensions/wiki-link/syntax.d.ts +0 -14
  186. package/dist/src/extensions/wiki-link/syntax.js +0 -121
  187. package/dist/src/extensions/wiki-link/to-markdown.d.ts +0 -5
  188. package/dist/src/extensions/wiki-link/to-markdown.js +0 -28
  189. package/dist/src/extensions/wiki-link/types.d.ts +0 -34
  190. package/dist/src/extensions/wiki-link/types.js +0 -1
  191. package/dist/src/external-documents.d.ts +0 -56
  192. package/dist/src/external-documents.js +0 -404
  193. package/dist/src/external-sources.d.ts +0 -136
  194. package/dist/src/external-sources.js +0 -1098
  195. package/dist/src/fork/frontmatter-fields.d.ts +0 -36
  196. package/dist/src/fork/frontmatter-fields.js +0 -23
  197. package/dist/src/format.d.ts +0 -16
  198. package/dist/src/format.js +0 -76
  199. package/dist/src/init-version.d.ts +0 -10
  200. package/dist/src/init-version.js +0 -49
  201. package/dist/src/lattice-model.d.ts +0 -84
  202. package/dist/src/lattice-model.js +0 -467
  203. package/dist/src/lattice.d.ts +0 -14
  204. package/dist/src/lattice.js +0 -353
  205. package/dist/src/markdown-analysis-cache.d.ts +0 -20
  206. package/dist/src/markdown-analysis-cache.js +0 -139
  207. package/dist/src/markdown-analysis-worker.d.ts +0 -16
  208. package/dist/src/markdown-analysis-worker.js +0 -33
  209. package/dist/src/markdown-analysis.d.ts +0 -61
  210. package/dist/src/markdown-analysis.js +0 -169
  211. package/dist/src/markdown-analyzer-loader.d.ts +0 -4
  212. package/dist/src/markdown-analyzer-loader.js +0 -13
  213. package/dist/src/markdown-validation.d.ts +0 -25
  214. package/dist/src/markdown-validation.js +0 -104
  215. package/dist/src/parser-cache.d.ts +0 -17
  216. package/dist/src/parser-cache.js +0 -65
  217. package/dist/src/parser-import.d.ts +0 -8
  218. package/dist/src/parser-import.js +0 -1
  219. package/dist/src/parser.d.ts +0 -3
  220. package/dist/src/parser.js +0 -93
  221. package/dist/src/path.d.ts +0 -2
  222. package/dist/src/path.js +0 -4
  223. package/dist/src/profiler.d.ts +0 -16
  224. package/dist/src/profiler.js +0 -81
  225. package/dist/src/project-analysis.d.ts +0 -59
  226. package/dist/src/project-analysis.js +0 -233
  227. package/dist/src/project-discovery.d.ts +0 -6
  228. package/dist/src/project-discovery.js +0 -30
  229. package/dist/src/repository-path.d.ts +0 -11
  230. package/dist/src/repository-path.js +0 -52
  231. package/dist/src/source-formats.d.ts +0 -7
  232. package/dist/src/source-formats.js +0 -30
  233. package/dist/src/source-parser.d.ts +0 -67
  234. package/dist/src/source-parser.js +0 -1749
  235. package/dist/src/untrusted.d.ts +0 -18
  236. package/dist/src/untrusted.js +0 -93
  237. package/dist/src/view/client/assets/channel-uy0fFvcW.js +0 -1
  238. package/dist/src/view/client/assets/classDiagram-ZZMXUADV-DbSEqjA5.js +0 -1
  239. package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-DbSEqjA5.js +0 -1
  240. package/dist/src/view/client/assets/index-nBmbYfun.js +0 -13
  241. package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-gUj6Hzgl.js +0 -1
  242. package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-DR7JhrxL.js +0 -8
  243. package/dist/src/walk.d.ts +0 -20
  244. package/dist/src/walk.js +0 -121
@@ -1,274 +0,0 @@
1
- import { existsSync } from 'node:fs';
2
- import { extname, join, relative } from 'node:path';
3
- import { findSections, resolveRef, } from '../lattice-model.js';
4
- import { formatResultList } from '../format.js';
5
- import { commandProjectAnalysis, commandProjectSession, } from '../project-analysis.js';
6
- import { isSourceFileExtension } from '../source-formats.js';
7
- /**
8
- * Check if a query looks like a source file path (has a recognized extension
9
- * and the file exists on disk).
10
- */
11
- function isSourceQuery(query, projectRoot) {
12
- const hashIdx = query.indexOf('#');
13
- const filePart = hashIdx === -1 ? query : query.slice(0, hashIdx);
14
- const symbolPart = hashIdx === -1 ? '' : query.slice(hashIdx + 1);
15
- const ext = extname(filePart);
16
- if (!isSourceFileExtension(ext))
17
- return null;
18
- if (!existsSync(join(projectRoot, filePart)))
19
- return null;
20
- return { filePart, symbolPart };
21
- }
22
- /**
23
- * Find references to a source file or symbol across lat.md and code files.
24
- * For file-level queries (no #symbol), matches all wiki links targeting
25
- * that file or any symbol in it.
26
- */
27
- async function findSourceRefs(ctx, query, scope) {
28
- const { projectRoot } = ctx;
29
- const hashIdx = query.indexOf('#');
30
- const filePart = hashIdx === -1 ? query : query.slice(0, hashIdx);
31
- const isFileLevel = hashIdx === -1;
32
- const queryLower = query.toLowerCase();
33
- const fileLower = filePart.toLowerCase();
34
- // Build a synthetic Section for the target
35
- const target = {
36
- id: query,
37
- heading: hashIdx === -1 ? filePart : query.slice(hashIdx + 1),
38
- depth: 0,
39
- file: filePart,
40
- filePath: filePart,
41
- children: [],
42
- startLine: 0,
43
- endLine: 0,
44
- firstParagraph: '',
45
- };
46
- // Try to get real line info from the source parser
47
- try {
48
- const { resolveSourceSymbol } = await import('../source-parser.js');
49
- if (hashIdx !== -1) {
50
- const symbolPart = query.slice(hashIdx + 1);
51
- const { found, symbols } = await resolveSourceSymbol(filePart, symbolPart, projectRoot, commandProjectSession(ctx).sourceSymbolOptions());
52
- if (found) {
53
- const parts = symbolPart.split('#');
54
- const sym = symbols.find((s) => parts.length === 1
55
- ? s.name === parts[0] && !s.parent
56
- : s.name === parts[1] && s.parent === parts[0]);
57
- if (sym) {
58
- target.startLine = sym.startLine;
59
- target.endLine = sym.endLine;
60
- target.firstParagraph = sym.signature;
61
- }
62
- }
63
- }
64
- }
65
- catch {
66
- // source parser unavailable — proceed without line info
67
- }
68
- const project = await commandProjectAnalysis(ctx);
69
- const flat = project.sections;
70
- const mdRefs = [];
71
- const codeRefs = [];
72
- if (scope === 'md' || scope === 'md+code') {
73
- const matchingFromSections = new Set();
74
- for (const file of project.files.values()) {
75
- for (const ref of file.wikiRefs) {
76
- const targetLower = ref.target.toLowerCase();
77
- const matches = isFileLevel
78
- ? targetLower === fileLower || targetLower.startsWith(fileLower + '#')
79
- : targetLower === queryLower;
80
- if (matches) {
81
- matchingFromSections.add(ref.fromSection.toLowerCase());
82
- }
83
- }
84
- }
85
- if (matchingFromSections.size > 0) {
86
- const referrers = flat.filter((s) => matchingFromSections.has(s.id.toLowerCase()));
87
- for (const s of referrers) {
88
- mdRefs.push({ section: s, reason: 'wiki link' });
89
- }
90
- }
91
- }
92
- if (scope === 'code' || scope === 'md+code') {
93
- const { refs: scannedRefs } = await commandProjectSession(ctx).codeRefs();
94
- for (const ref of scannedRefs) {
95
- const targetLower = ref.target.toLowerCase();
96
- const matches = isFileLevel
97
- ? targetLower === fileLower || targetLower.startsWith(fileLower + '#')
98
- : targetLower === queryLower;
99
- if (matches) {
100
- const displayPath = relative(process.cwd(), join(projectRoot, ref.file));
101
- codeRefs.push(`${displayPath}:${ref.line}`);
102
- }
103
- }
104
- }
105
- return { kind: 'found', target, mdRefs, codeRefs };
106
- }
107
- async function findExternalRefs(ctx, query, scope) {
108
- const external = await commandProjectSession(ctx).external();
109
- const parsed = external.parse(query);
110
- const target = {
111
- id: parsed.identity,
112
- heading: parsed.fragment || parsed.authoredPath,
113
- depth: 0,
114
- file: parsed.identity,
115
- filePath: parsed.identity,
116
- children: [],
117
- startLine: 0,
118
- endLine: 0,
119
- firstParagraph: '',
120
- };
121
- const project = await commandProjectAnalysis(ctx);
122
- const flat = project.sections;
123
- const matchingSections = new Set();
124
- const codeRefs = [];
125
- const matchesTarget = (candidate) => {
126
- try {
127
- return external.parse(candidate)?.identity === parsed.identity;
128
- }
129
- catch {
130
- return false;
131
- }
132
- };
133
- if (scope !== 'code') {
134
- for (const file of project.files.values()) {
135
- for (const ref of file.wikiRefs) {
136
- if (matchesTarget(ref.target))
137
- matchingSections.add(ref.fromSection.toLowerCase());
138
- }
139
- }
140
- }
141
- if (scope !== 'md') {
142
- for (const ref of (await commandProjectSession(ctx).codeRefs()).refs) {
143
- if (matchesTarget(ref.target)) {
144
- codeRefs.push(`${relative(process.cwd(), join(ctx.projectRoot, ref.file))}:${ref.line}`);
145
- }
146
- }
147
- }
148
- return {
149
- kind: 'found',
150
- target,
151
- mdRefs: flat
152
- .filter((section) => matchingSections.has(section.id.toLowerCase()))
153
- .map((section) => ({ section, reason: 'wiki link' })),
154
- codeRefs,
155
- };
156
- }
157
- /**
158
- * Find all sections and code locations that reference a given section or
159
- * source file. Accepts section ids (full-path, short-form) and source file
160
- * paths (e.g. src/app.rs#foo). Source file queries match wiki links directly
161
- * without section resolution.
162
- */
163
- export async function findRefs(ctx, query, scope) {
164
- query = query.replace(/^\[\[|\]\]$/g, '');
165
- const external = await commandProjectSession(ctx).external();
166
- try {
167
- if (external.parse(query))
168
- return findExternalRefs(ctx, query, scope);
169
- }
170
- catch (error) {
171
- return {
172
- kind: 'no-match',
173
- suggestions: [],
174
- message: error.message,
175
- };
176
- }
177
- const unknownExternal = external.unknownTargetMessage(query);
178
- if (unknownExternal) {
179
- return { kind: 'no-match', suggestions: [], message: unknownExternal };
180
- }
181
- // Source file queries bypass section resolution
182
- if (isSourceQuery(query, ctx.projectRoot)) {
183
- return findSourceRefs(ctx, query, scope);
184
- }
185
- const project = await commandProjectAnalysis(ctx);
186
- const { allSections, sections: flat, fileIndex, slugIndex } = project;
187
- const sectionIds = new Set(project.sectionIds);
188
- const { resolved } = resolveRef(query, sectionIds, fileIndex, slugIndex);
189
- const q = resolved.toLowerCase();
190
- let exactMatch = flat.find((s) => s.id.toLowerCase() === q);
191
- // If resolveRef didn't land on an exact id, use findSections as fallback
192
- const matches = !exactMatch ? findSections(allSections, query) : [];
193
- if (!exactMatch && matches.length >= 1) {
194
- const top = matches[0];
195
- const isConfident = top.reason === 'exact match' ||
196
- top.reason.startsWith('file stem expanded') ||
197
- top.reason === 'section name match';
198
- if (isConfident) {
199
- exactMatch = top.section;
200
- }
201
- }
202
- if (!exactMatch) {
203
- const suggestions = matches.length > 0 ? matches : findSections(allSections, query);
204
- return { kind: 'no-match', suggestions };
205
- }
206
- const targetId = exactMatch.id.toLowerCase();
207
- const mdRefs = [];
208
- const codeRefs = [];
209
- if (scope === 'md' || scope === 'md+code') {
210
- const matchingFromSections = new Set();
211
- for (const ref of project.incomingRefsBySection.get(targetId) ?? []) {
212
- matchingFromSections.add(ref.fromSection.toLowerCase());
213
- }
214
- if (matchingFromSections.size > 0) {
215
- const referrers = flat.filter((s) => matchingFromSections.has(s.id.toLowerCase()));
216
- for (const s of referrers) {
217
- mdRefs.push({ section: s, reason: 'wiki link' });
218
- }
219
- }
220
- }
221
- if (scope === 'code' || scope === 'md+code') {
222
- const { refs: scannedRefs } = await commandProjectSession(ctx).codeRefs();
223
- for (const ref of scannedRefs) {
224
- const { resolved: codeResolved } = resolveRef(ref.target, sectionIds, fileIndex, slugIndex);
225
- if (codeResolved.toLowerCase() === targetId) {
226
- const displayPath = relative(process.cwd(), join(ctx.projectRoot, ref.file));
227
- codeRefs.push(`${displayPath}:${ref.line}`);
228
- }
229
- }
230
- }
231
- return { kind: 'found', target: exactMatch, mdRefs, codeRefs };
232
- }
233
- export async function refsCommand(ctx, query, scope) {
234
- const result = await findRefs(ctx, query, scope);
235
- if (result.kind === 'no-match') {
236
- const s = ctx.styler;
237
- if (result.message) {
238
- return { output: s.red(result.message), isError: true };
239
- }
240
- if (result.suggestions.length > 0) {
241
- const suggestions = result.suggestions
242
- .map((m) => ` ${s.dim('*')} ${s.white(m.section.id)} ${s.dim(`(${m.reason})`)}`)
243
- .join('\n');
244
- return {
245
- output: s.red(`No section "${query}" found.`) +
246
- ' Did you mean:\n' +
247
- suggestions,
248
- isError: true,
249
- };
250
- }
251
- return {
252
- output: s.red(`No section matching "${query}"`),
253
- isError: true,
254
- };
255
- }
256
- const { target, mdRefs, codeRefs } = result;
257
- if (mdRefs.length === 0 && codeRefs.length === 0) {
258
- return {
259
- output: ctx.styler.yellow(`No references to "${target.id}" found`),
260
- isError: true,
261
- };
262
- }
263
- const s = ctx.styler;
264
- const parts = [];
265
- if (mdRefs.length > 0) {
266
- parts.push(formatResultList(ctx, `References to "${target.id}":`, mdRefs));
267
- }
268
- if (codeRefs.length > 0) {
269
- parts.push('## Code references:' +
270
- '\n\n' +
271
- codeRefs.map((l) => `${s.dim('*')} ${l}`).join('\n'));
272
- }
273
- return { output: parts.join('\n') };
274
- }
@@ -1,45 +0,0 @@
1
- import { type Section, type SectionMatch } from '../lattice-model.js';
2
- import type { CmdContext, CmdResult } from '../context.js';
3
- import type { ResolvedExternalContent } from '../external-sources.js';
4
- import { type ProvenanceNote } from './check-status.js';
5
- export type CodeBackRef = {
6
- file: string;
7
- line: number;
8
- snippet: string;
9
- };
10
- export type SourceRef = {
11
- target: string;
12
- file: string;
13
- line: number;
14
- endLine: number;
15
- snippet: string;
16
- };
17
- export type SectionFound = {
18
- kind: 'found';
19
- section: Section;
20
- content: string;
21
- /** Provenance of the document holding this section, or null if unmarked. */
22
- status: ProvenanceNote | null;
23
- outgoingRefs: {
24
- target: string;
25
- resolved: Section;
26
- }[];
27
- outgoingSourceRefs: SourceRef[];
28
- outgoingExternalRefs: ResolvedExternalContent[];
29
- incomingRefs: SectionMatch[];
30
- codeRefs: CodeBackRef[];
31
- };
32
- export type SectionResult = SectionFound | {
33
- kind: 'no-match';
34
- suggestions: SectionMatch[];
35
- };
36
- /**
37
- * Look up a section by id, return its content, outgoing wiki link targets,
38
- * and incoming references from other sections.
39
- */
40
- export declare function getSection(ctx: CmdContext, query: string): Promise<SectionResult>;
41
- /**
42
- * Format a successful section result with styling.
43
- */
44
- export declare function formatSectionOutput(ctx: CmdContext, result: SectionFound): string;
45
- export declare function sectionCommand(ctx: CmdContext, query: string): Promise<CmdResult>;
@@ -1,328 +0,0 @@
1
- import { readFile } from 'node:fs/promises';
2
- import { extname, join, relative } from 'node:path';
3
- import { findSections, flattenSections, resolveRef, } from '../lattice-model.js';
4
- import { MAX_SECTION_SUMMARY_LENGTH } from '../markdown-validation.js';
5
- import { resolveSourceSymbol } from '../source-parser.js';
6
- import { isSourceFileExtension } from '../source-formats.js';
7
- import { formatNavHints, formatResultList, formatSectionId, } from '../format.js';
8
- import { findRefs } from './refs.js';
9
- import { commandProjectAnalysis, commandProjectSession, } from '../project-analysis.js';
10
- import { provenanceNote, formatProvenanceNote, } from './check-status.js';
11
- /**
12
- * Look up a section by id, return its content, outgoing wiki link targets,
13
- * and incoming references from other sections.
14
- */
15
- export async function getSection(ctx, query) {
16
- query = query.replace(/^\[\[|\]\]$/g, '');
17
- const project = await commandProjectAnalysis(ctx);
18
- const matches = findSections(project.allSections, query);
19
- if (matches.length === 0) {
20
- return { kind: 'no-match', suggestions: [] };
21
- }
22
- // Accept the top match if confident
23
- const top = matches[0];
24
- const isConfident = top.reason === 'exact match' ||
25
- top.reason.startsWith('file stem expanded') ||
26
- top.reason === 'section name match';
27
- if (!isConfident) {
28
- return { kind: 'no-match', suggestions: matches };
29
- }
30
- const section = top.section;
31
- // Read raw content between startLine and the end of the last descendant
32
- const absPath = join(ctx.projectRoot, section.filePath);
33
- const analyzedFile = project.filesByAbsolutePath.get(absPath);
34
- if (!analyzedFile)
35
- return { kind: 'no-match', suggestions: [] };
36
- const fileContent = analyzedFile.content;
37
- const lines = fileContent.split('\n');
38
- const end = fullEndLine(section);
39
- const content = lines.slice(section.startLine - 1, end).join('\n');
40
- // Find outgoing wiki link targets within this section's content
41
- const flat = project.sections;
42
- const sectionIds = new Set(project.sectionIds);
43
- const { fileIndex, slugIndex } = project;
44
- const sectionId = section.id.toLowerCase();
45
- const subtreeSections = flattenSections([section]);
46
- const subtreeSectionIds = new Set(subtreeSections.map((subtreeSection) => subtreeSection.id.toLowerCase()));
47
- const sectionRefs = subtreeSections.flatMap((subtreeSection) => project.outgoingRefsBySection.get(subtreeSection.id.toLowerCase()) ?? []);
48
- const outgoingRefs = [];
49
- const outgoingSourceRefs = [];
50
- const outgoingExternalRefs = [];
51
- const external = await commandProjectSession(ctx).external();
52
- const seen = new Set();
53
- for (const ref of sectionRefs) {
54
- if (!subtreeSectionIds.has(ref.fromSection.toLowerCase()))
55
- continue;
56
- if (external.parse(ref.target)) {
57
- if (!seen.has(ref.target)) {
58
- seen.add(ref.target);
59
- outgoingExternalRefs.push(await external.resolve(ref.target));
60
- }
61
- continue;
62
- }
63
- // Detect source code references by file extension
64
- const hashIdx = ref.target.indexOf('#');
65
- const filePart = hashIdx === -1 ? ref.target : ref.target.slice(0, hashIdx);
66
- const ext = extname(filePart);
67
- if (isSourceFileExtension(ext)) {
68
- const targetLower = ref.target.toLowerCase();
69
- if (!seen.has(targetLower)) {
70
- seen.add(targetLower);
71
- const symbolPart = hashIdx === -1 ? '' : ref.target.slice(hashIdx + 1);
72
- let line = 0;
73
- let endLine = 0;
74
- let snippet = '';
75
- if (symbolPart) {
76
- const { found, symbols } = await resolveSourceSymbol(filePart, symbolPart, ctx.projectRoot, commandProjectSession(ctx).sourceSymbolOptions());
77
- if (found) {
78
- const parts = symbolPart.split('#');
79
- const sym = symbols.find((s) => parts.length === 1
80
- ? s.name === parts[0] && !s.parent
81
- : s.name === parts[1] && s.parent === parts[0]);
82
- if (sym) {
83
- line = sym.startLine;
84
- endLine = sym.endLine;
85
- try {
86
- const src = await readFile(join(ctx.projectRoot, filePart), 'utf-8');
87
- const srcLines = src.split('\n');
88
- const start = sym.startLine - 1;
89
- const end = Math.min(srcLines.length, start + 5);
90
- snippet = srcLines.slice(start, end).join('\n');
91
- }
92
- catch {
93
- // file unreadable
94
- }
95
- }
96
- }
97
- }
98
- outgoingSourceRefs.push({
99
- target: ref.target,
100
- file: filePart,
101
- line,
102
- endLine,
103
- snippet,
104
- });
105
- }
106
- continue;
107
- }
108
- const { resolved } = resolveRef(ref.target, sectionIds, fileIndex, slugIndex);
109
- const resolvedLower = resolved.toLowerCase();
110
- if (seen.has(resolvedLower))
111
- continue;
112
- seen.add(resolvedLower);
113
- const targetSection = flat.find((s) => s.id.toLowerCase() === resolvedLower);
114
- if (targetSection) {
115
- outgoingRefs.push({ target: ref.target, resolved: targetSection });
116
- }
117
- }
118
- // Find incoming references: other sections that link to this one
119
- const incomingRefs = [];
120
- const incomingSections = new Set();
121
- for (const ref of project.incomingRefsBySection.get(sectionId) ?? []) {
122
- if (ref.fromSection.toLowerCase() === sectionId)
123
- continue;
124
- if (!incomingSections.has(ref.fromSection.toLowerCase())) {
125
- incomingSections.add(ref.fromSection.toLowerCase());
126
- const fromSection = project.sectionById.get(ref.fromSection.toLowerCase());
127
- if (fromSection) {
128
- incomingRefs.push({ section: fromSection, reason: 'wiki link' });
129
- }
130
- }
131
- }
132
- // Find code back-references: @lat: comments pointing to this section
133
- const codeRefs = [];
134
- const { refs: scannedRefs } = await commandProjectSession(ctx).codeRefs();
135
- for (const ref of scannedRefs) {
136
- const { resolved: codeResolved } = resolveRef(ref.target, sectionIds, fileIndex, slugIndex);
137
- if (subtreeSectionIds.has(codeResolved.toLowerCase())) {
138
- const absFile = join(ctx.projectRoot, ref.file);
139
- let snippet = '';
140
- try {
141
- const src = await readFile(absFile, 'utf-8');
142
- const srcLines = src.split('\n');
143
- const start = Math.max(0, ref.line - 1 - 2);
144
- const end = Math.min(srcLines.length, ref.line - 1 + 3);
145
- snippet = srcLines.slice(start, end).join('\n');
146
- }
147
- catch {
148
- // file unreadable — skip snippet
149
- }
150
- codeRefs.push({ file: ref.file, line: ref.line, snippet });
151
- }
152
- }
153
- return {
154
- kind: 'found',
155
- section,
156
- content,
157
- status: provenanceNote(fileContent),
158
- outgoingRefs,
159
- outgoingSourceRefs,
160
- outgoingExternalRefs,
161
- incomingRefs,
162
- codeRefs,
163
- };
164
- }
165
- function fullEndLine(section) {
166
- if (section.children.length === 0)
167
- return section.endLine;
168
- return fullEndLine(section.children[section.children.length - 1]);
169
- }
170
- function truncate(s, max) {
171
- return s.length > max ? s.slice(0, max) + '...' : s;
172
- }
173
- const SECTION_SUMMARY_SAFETY_LIMIT = MAX_SECTION_SUMMARY_LENGTH + 50;
174
- function sectionSummary(section) {
175
- return truncate(section.firstParagraph, SECTION_SUMMARY_SAFETY_LIMIT);
176
- }
177
- function markdownInlineCode(value) {
178
- const content = value || ' ';
179
- const longestBacktickRun = Math.max(0, ...(content.match(/`+/g) ?? []).map((run) => run.length));
180
- const delimiter = '`'.repeat(longestBacktickRun + 1);
181
- const padded = content.startsWith('`') || content.endsWith('`') ? ` ${content} ` : content;
182
- return `${delimiter}${padded}${delimiter}`;
183
- }
184
- /**
185
- * Format a successful section result with styling.
186
- */
187
- export function formatSectionOutput(ctx, result) {
188
- const s = ctx.styler;
189
- const { section, content, status, outgoingRefs, outgoingSourceRefs, outgoingExternalRefs, incomingRefs, codeRefs, } = result;
190
- const relPath = relative(process.cwd(), join(ctx.projectRoot, section.filePath));
191
- const loc = `${s.cyan(relPath)}${s.dim(`:${section.startLine}-${section.endLine}`)}`;
192
- const quoted = content
193
- .split('\n')
194
- .map((line) => (line ? `> ${line}` : '>'))
195
- .join('\n');
196
- const parts = [
197
- `${s.bold('[[' + formatSectionId(section.id, s) + ']]')} (${loc})`,
198
- ];
199
- // Above the text, not below it: a reader who acts on the first line of a
200
- // quoted section has already acted before a trailing caveat reaches them.
201
- if (status)
202
- parts.push(formatProvenanceNote(status, s));
203
- parts.push('', quoted);
204
- if (outgoingRefs.length > 0 ||
205
- outgoingSourceRefs.length > 0 ||
206
- outgoingExternalRefs.length > 0) {
207
- parts.push('', '## This section references:', '');
208
- for (const ref of outgoingRefs) {
209
- const body = ref.resolved.firstParagraph
210
- ? ` ${s.dim('—')} ${sectionSummary(ref.resolved)}`
211
- : '';
212
- parts.push(`${s.dim('*')} [[${formatSectionId(ref.resolved.id, s)}]]${body}`);
213
- }
214
- for (const ref of outgoingSourceRefs) {
215
- const loc = ref.line
216
- ? ref.endLine && ref.endLine !== ref.line
217
- ? `${s.dim(` (${ref.file}:${ref.line}-${ref.endLine})`)}`
218
- : `${s.dim(` (${ref.file}:${ref.line})`)}`
219
- : `${s.dim(` (${ref.file})`)}`;
220
- parts.push(`${s.dim('*')} [[${s.cyan(ref.target)}]]${loc}`);
221
- if (ref.snippet) {
222
- const snippetLines = ref.snippet.split('\n');
223
- for (const line of snippetLines) {
224
- parts.push(` ${s.dim('|')} ${markdownInlineCode(line)}`);
225
- }
226
- }
227
- }
228
- for (const ref of outgoingExternalRefs) {
229
- parts.push(`${s.dim('*')} [[${s.cyan(ref.target.identity)}]]${s.dim(` (${ref.target.repositoryPath}:${ref.startLine}-${ref.endLine}, ${ref.provider})`)}`);
230
- for (const line of ref.content.split('\n').slice(0, 5)) {
231
- parts.push(` ${s.dim('|')} ${ref.kind === 'source' ? markdownInlineCode(line) : line}`);
232
- }
233
- }
234
- }
235
- if (incomingRefs.length > 0) {
236
- parts.push('', '## Referenced by:', '');
237
- for (const ref of incomingRefs) {
238
- const body = ref.section.firstParagraph
239
- ? ` ${s.dim('—')} ${sectionSummary(ref.section)}`
240
- : '';
241
- parts.push(`${s.dim('*')} [[${formatSectionId(ref.section.id, s)}]]${body}`);
242
- }
243
- }
244
- if (codeRefs.length > 0) {
245
- parts.push('', '## Referenced by code:', '');
246
- for (const ref of codeRefs) {
247
- const codeRelPath = relative(process.cwd(), join(ctx.projectRoot, ref.file));
248
- parts.push(`${s.dim('*')} ${s.cyan(codeRelPath)}${s.dim(`:${ref.line}`)}`);
249
- if (ref.snippet) {
250
- const snippetLines = ref.snippet.split('\n');
251
- for (const line of snippetLines) {
252
- parts.push(` ${s.dim('|')} ${markdownInlineCode(line)}`);
253
- }
254
- }
255
- }
256
- }
257
- parts.push(formatNavHints(ctx));
258
- return parts.join('\n');
259
- }
260
- export async function sectionCommand(ctx, query) {
261
- const external = await commandProjectSession(ctx).external();
262
- let externalTarget = null;
263
- try {
264
- externalTarget = external.parse(query);
265
- }
266
- catch (error) {
267
- return { output: ctx.styler.red(error.message), isError: true };
268
- }
269
- if (externalTarget) {
270
- try {
271
- const resolved = await external.resolve(query);
272
- const backlinks = await findRefs(ctx, resolved.target.identity, 'md+code');
273
- const location = `${resolved.target.handle}:${resolved.target.authoredPath}:${resolved.startLine}-${resolved.endLine}`;
274
- const quoted = resolved.content
275
- .split('\n')
276
- .map((line) => (line ? `> ${line}` : '>'))
277
- .join('\n');
278
- const warnings = resolved.source.localError
279
- ? `\n\n${ctx.styler.yellow(`Warning: ${resolved.source.localError}; using ${resolved.provider}`)}`
280
- : '';
281
- const parts = [
282
- `${ctx.styler.bold(`[[${resolved.target.identity}]]`)} (${ctx.styler.cyan(location)})`,
283
- ctx.styler.dim(`${resolved.source.repo} @ ${resolved.source.commit} via ${resolved.provider}`),
284
- '',
285
- quoted,
286
- ];
287
- if (backlinks.kind === 'found' && backlinks.mdRefs.length > 0) {
288
- parts.push(formatResultList(ctx, `Referenced by Markdown:`, backlinks.mdRefs));
289
- }
290
- if (backlinks.kind === 'found' && backlinks.codeRefs.length > 0) {
291
- parts.push('', '## Referenced by code:', '', ...backlinks.codeRefs.map((value) => `${ctx.styler.dim('*')} ${value}`));
292
- }
293
- return {
294
- output: parts.join('\n') + warnings + formatNavHints(ctx),
295
- };
296
- }
297
- catch (error) {
298
- return {
299
- output: ctx.styler.red(error.message),
300
- isError: true,
301
- };
302
- }
303
- }
304
- const unknownExternal = external.unknownTargetMessage(query);
305
- if (unknownExternal) {
306
- return { output: ctx.styler.red(unknownExternal), isError: true };
307
- }
308
- const result = await getSection(ctx, query);
309
- if (result.kind === 'no-match') {
310
- const s = ctx.styler;
311
- if (result.suggestions.length > 0) {
312
- const suggestions = result.suggestions
313
- .map((m) => ` ${s.dim('*')} ${s.white(m.section.id)} ${s.dim(`(${m.reason})`)}`)
314
- .join('\n');
315
- return {
316
- output: s.red(`No section "${query}" found.`) +
317
- ' Did you mean:\n' +
318
- suggestions,
319
- isError: true,
320
- };
321
- }
322
- return {
323
- output: s.red(`No sections matching "${query}"`),
324
- isError: true,
325
- };
326
- }
327
- return { output: formatSectionOutput(ctx, result) };
328
- }
@@ -1,13 +0,0 @@
1
- export interface SelectOption {
2
- label: string;
3
- value: string;
4
- /** If true, this option uses a distinct highlight style (e.g. for "done" actions). */
5
- accent?: boolean;
6
- }
7
- /**
8
- * Display an interactive select menu with arrow-key navigation.
9
- * Returns the selected option's value, or null if the user pressed Ctrl+C.
10
- *
11
- * @param defaultIndex - initial cursor position (defaults to 0)
12
- */
13
- export declare function selectMenu(options: SelectOption[], prompt?: string, defaultIndex?: number): Promise<string | null>;