@jafreck/lore 0.3.6 → 0.3.8

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 (206) hide show
  1. package/README.md +38 -150
  2. package/dist/cli.d.ts +2 -1
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +80 -32
  5. package/dist/cli.js.map +1 -1
  6. package/dist/db/read-only.d.ts +22 -43
  7. package/dist/db/read-only.d.ts.map +1 -1
  8. package/dist/db/read-only.js +80 -156
  9. package/dist/db/read-only.js.map +1 -1
  10. package/dist/db/schema.d.ts +9 -0
  11. package/dist/db/schema.d.ts.map +1 -1
  12. package/dist/db/schema.js +171 -85
  13. package/dist/db/schema.js.map +1 -1
  14. package/dist/discovery/poller.d.ts +6 -16
  15. package/dist/discovery/poller.d.ts.map +1 -1
  16. package/dist/discovery/poller.js +21 -52
  17. package/dist/discovery/poller.js.map +1 -1
  18. package/dist/discovery/scip-flush.d.ts +44 -0
  19. package/dist/discovery/scip-flush.d.ts.map +1 -0
  20. package/dist/discovery/scip-flush.js +67 -0
  21. package/dist/discovery/scip-flush.js.map +1 -0
  22. package/dist/discovery/watcher.d.ts +6 -16
  23. package/dist/discovery/watcher.d.ts.map +1 -1
  24. package/dist/discovery/watcher.js +22 -54
  25. package/dist/discovery/watcher.js.map +1 -1
  26. package/dist/docs/docs.d.ts +0 -2
  27. package/dist/docs/docs.d.ts.map +1 -1
  28. package/dist/docs/docs.js +0 -27
  29. package/dist/docs/docs.js.map +1 -1
  30. package/dist/embeddings/embedder.d.ts +12 -8
  31. package/dist/embeddings/embedder.d.ts.map +1 -1
  32. package/dist/embeddings/embedder.js +35 -19
  33. package/dist/embeddings/embedder.js.map +1 -1
  34. package/dist/index.d.ts +5 -2
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +3 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/indexer/index.d.ts +19 -10
  39. package/dist/indexer/index.d.ts.map +1 -1
  40. package/dist/indexer/index.js +135 -28
  41. package/dist/indexer/index.js.map +1 -1
  42. package/dist/indexer/pipeline.d.ts +44 -21
  43. package/dist/indexer/pipeline.d.ts.map +1 -1
  44. package/dist/indexer/pipeline.js +48 -26
  45. package/dist/indexer/pipeline.js.map +1 -1
  46. package/dist/indexer/stages/docs-index.d.ts +1 -3
  47. package/dist/indexer/stages/docs-index.d.ts.map +1 -1
  48. package/dist/indexer/stages/docs-index.js +1 -25
  49. package/dist/indexer/stages/docs-index.js.map +1 -1
  50. package/dist/indexer/stages/index.d.ts +4 -2
  51. package/dist/indexer/stages/index.d.ts.map +1 -1
  52. package/dist/indexer/stages/index.js +3 -2
  53. package/dist/indexer/stages/index.js.map +1 -1
  54. package/dist/indexer/stages/lsp-enrichment.d.ts +1 -1
  55. package/dist/indexer/stages/lsp-enrichment.d.ts.map +1 -1
  56. package/dist/indexer/stages/lsp-enrichment.js +44 -21
  57. package/dist/indexer/stages/lsp-enrichment.js.map +1 -1
  58. package/dist/indexer/stages/overlay-cleanup.d.ts +31 -0
  59. package/dist/indexer/stages/overlay-cleanup.d.ts.map +1 -0
  60. package/dist/indexer/stages/overlay-cleanup.js +64 -0
  61. package/dist/indexer/stages/overlay-cleanup.js.map +1 -0
  62. package/dist/indexer/stages/reverse-deps.d.ts +13 -0
  63. package/dist/indexer/stages/reverse-deps.d.ts.map +1 -0
  64. package/dist/indexer/stages/reverse-deps.js +81 -0
  65. package/dist/indexer/stages/reverse-deps.js.map +1 -0
  66. package/dist/indexer/stages/{scip-source.d.ts → scip-indexer.d.ts} +38 -9
  67. package/dist/indexer/stages/scip-indexer.d.ts.map +1 -0
  68. package/dist/indexer/stages/{scip-source.js → scip-indexer.js} +359 -98
  69. package/dist/indexer/stages/scip-indexer.js.map +1 -0
  70. package/dist/indexer/stages/source-index.d.ts +3 -3
  71. package/dist/indexer/stages/source-index.d.ts.map +1 -1
  72. package/dist/indexer/stages/source-index.js +188 -70
  73. package/dist/indexer/stages/source-index.js.map +1 -1
  74. package/dist/lsp/enrichment.d.ts.map +1 -1
  75. package/dist/lsp/enrichment.js +1 -18
  76. package/dist/lsp/enrichment.js.map +1 -1
  77. package/dist/parsing/extractors/go.d.ts.map +1 -1
  78. package/dist/parsing/extractors/go.js +0 -38
  79. package/dist/parsing/extractors/go.js.map +1 -1
  80. package/dist/parsing/extractors/javascript.d.ts.map +1 -1
  81. package/dist/parsing/extractors/javascript.js +0 -47
  82. package/dist/parsing/extractors/javascript.js.map +1 -1
  83. package/dist/parsing/extractors/python.d.ts.map +1 -1
  84. package/dist/parsing/extractors/python.js +0 -22
  85. package/dist/parsing/extractors/python.js.map +1 -1
  86. package/dist/parsing/extractors/types.d.ts +0 -16
  87. package/dist/parsing/extractors/types.d.ts.map +1 -1
  88. package/dist/parsing/extractors/types.js +1 -1
  89. package/dist/parsing/extractors/types.js.map +1 -1
  90. package/dist/parsing/extractors/typescript.d.ts.map +1 -1
  91. package/dist/parsing/extractors/typescript.js +18 -2
  92. package/dist/parsing/extractors/typescript.js.map +1 -1
  93. package/dist/resolution/call-graph.d.ts +3 -1
  94. package/dist/resolution/call-graph.d.ts.map +1 -1
  95. package/dist/resolution/call-graph.js +15 -13
  96. package/dist/resolution/call-graph.js.map +1 -1
  97. package/dist/resolution/resolution-method.d.ts +1 -1
  98. package/dist/resolution/resolution-method.d.ts.map +1 -1
  99. package/dist/resolution/resolution-method.js +2 -0
  100. package/dist/resolution/resolution-method.js.map +1 -1
  101. package/dist/resolution/resolver.d.ts +6 -0
  102. package/dist/resolution/resolver.d.ts.map +1 -1
  103. package/dist/resolution/resolver.js +21 -0
  104. package/dist/resolution/resolver.js.map +1 -1
  105. package/dist/runtime.d.ts +0 -2
  106. package/dist/runtime.d.ts.map +1 -1
  107. package/dist/runtime.js.map +1 -1
  108. package/dist/scip/compdb.d.ts +38 -0
  109. package/dist/scip/compdb.d.ts.map +1 -0
  110. package/dist/scip/compdb.js +138 -0
  111. package/dist/scip/compdb.js.map +1 -0
  112. package/dist/scip/enrichment.d.ts +6 -1
  113. package/dist/scip/enrichment.d.ts.map +1 -1
  114. package/dist/scip/enrichment.js +62 -5
  115. package/dist/scip/enrichment.js.map +1 -1
  116. package/dist/scip/installer.d.ts +59 -0
  117. package/dist/scip/installer.d.ts.map +1 -0
  118. package/dist/scip/installer.js +302 -0
  119. package/dist/scip/installer.js.map +1 -0
  120. package/dist/scip/registry.d.ts +1 -1
  121. package/dist/scip/registry.d.ts.map +1 -1
  122. package/dist/scip/registry.js +33 -5
  123. package/dist/scip/registry.js.map +1 -1
  124. package/dist/server/server.d.ts +3 -8
  125. package/dist/server/server.d.ts.map +1 -1
  126. package/dist/server/server.js +7 -66
  127. package/dist/server/server.js.map +1 -1
  128. package/dist/server/tool-registry.d.ts +2 -2
  129. package/dist/server/tool-registry.d.ts.map +1 -1
  130. package/dist/server/tool-registry.js +37 -41
  131. package/dist/server/tool-registry.js.map +1 -1
  132. package/dist/server/tools/cohesion.d.ts +46 -0
  133. package/dist/server/tools/cohesion.d.ts.map +1 -0
  134. package/dist/server/tools/cohesion.js +100 -0
  135. package/dist/server/tools/cohesion.js.map +1 -0
  136. package/dist/server/tools/dependents.d.ts +139 -0
  137. package/dist/server/tools/dependents.d.ts.map +1 -0
  138. package/dist/server/tools/dependents.js +354 -0
  139. package/dist/server/tools/dependents.js.map +1 -0
  140. package/dist/server/tools/diff.d.ts +73 -0
  141. package/dist/server/tools/diff.d.ts.map +1 -0
  142. package/dist/server/tools/diff.js +157 -0
  143. package/dist/server/tools/diff.js.map +1 -0
  144. package/dist/server/tools/graph.d.ts +7 -3
  145. package/dist/server/tools/graph.d.ts.map +1 -1
  146. package/dist/server/tools/graph.js +15 -85
  147. package/dist/server/tools/graph.js.map +1 -1
  148. package/dist/server/tools/metrics.d.ts +5 -30
  149. package/dist/server/tools/metrics.d.ts.map +1 -1
  150. package/dist/server/tools/metrics.js +21 -57
  151. package/dist/server/tools/metrics.js.map +1 -1
  152. package/dist/server/tools/structure.d.ts +77 -0
  153. package/dist/server/tools/structure.d.ts.map +1 -0
  154. package/dist/server/tools/structure.js +309 -0
  155. package/dist/server/tools/structure.js.map +1 -0
  156. package/dist/server/tools/test-map.d.ts +7 -0
  157. package/dist/server/tools/test-map.d.ts.map +1 -1
  158. package/dist/server/tools/test-map.js +18 -1
  159. package/dist/server/tools/test-map.js.map +1 -1
  160. package/dist/server/tools/trace.d.ts +84 -0
  161. package/dist/server/tools/trace.d.ts.map +1 -0
  162. package/dist/server/tools/trace.js +317 -0
  163. package/dist/server/tools/trace.js.map +1 -0
  164. package/dist/testing/coverage.d.ts +11 -0
  165. package/dist/testing/coverage.d.ts.map +1 -1
  166. package/dist/testing/coverage.js +34 -2
  167. package/dist/testing/coverage.js.map +1 -1
  168. package/dist/testing/test-mapper.d.ts +1 -1
  169. package/dist/testing/test-mapper.d.ts.map +1 -1
  170. package/dist/testing/test-mapper.js +1 -0
  171. package/dist/testing/test-mapper.js.map +1 -1
  172. package/package.json +3 -1
  173. package/dist/indexer/stages/scip-enrichment.d.ts +0 -43
  174. package/dist/indexer/stages/scip-enrichment.d.ts.map +0 -1
  175. package/dist/indexer/stages/scip-enrichment.js +0 -174
  176. package/dist/indexer/stages/scip-enrichment.js.map +0 -1
  177. package/dist/indexer/stages/scip-source.d.ts.map +0 -1
  178. package/dist/indexer/stages/scip-source.js.map +0 -1
  179. package/dist/server/tools/annotations.d.ts +0 -40
  180. package/dist/server/tools/annotations.d.ts.map +0 -1
  181. package/dist/server/tools/annotations.js +0 -35
  182. package/dist/server/tools/annotations.js.map +0 -1
  183. package/dist/server/tools/architecture.d.ts +0 -67
  184. package/dist/server/tools/architecture.d.ts.map +0 -1
  185. package/dist/server/tools/architecture.js +0 -209
  186. package/dist/server/tools/architecture.js.map +0 -1
  187. package/dist/server/tools/coverage.d.ts +0 -67
  188. package/dist/server/tools/coverage.d.ts.map +0 -1
  189. package/dist/server/tools/coverage.js +0 -74
  190. package/dist/server/tools/coverage.js.map +0 -1
  191. package/dist/server/tools/graph-analysis.d.ts +0 -64
  192. package/dist/server/tools/graph-analysis.d.ts.map +0 -1
  193. package/dist/server/tools/graph-analysis.js +0 -82
  194. package/dist/server/tools/graph-analysis.js.map +0 -1
  195. package/dist/server/tools/notes.d.ts +0 -165
  196. package/dist/server/tools/notes.d.ts.map +0 -1
  197. package/dist/server/tools/notes.js +0 -214
  198. package/dist/server/tools/notes.js.map +0 -1
  199. package/dist/server/tools/routes.d.ts +0 -38
  200. package/dist/server/tools/routes.d.ts.map +0 -1
  201. package/dist/server/tools/routes.js +0 -38
  202. package/dist/server/tools/routes.js.map +0 -1
  203. package/dist/server/tools/writeback.d.ts +0 -49
  204. package/dist/server/tools/writeback.d.ts.map +0 -1
  205. package/dist/server/tools/writeback.js +0 -68
  206. package/dist/server/tools/writeback.js.map +0 -1
@@ -1,67 +0,0 @@
1
- /**
2
- * @module lore-server/tools/coverage
3
- *
4
- * MCP tool: query symbol-level coverage and coverage staleness metadata.
5
- */
6
- import type { Database } from '../../db/read-only.js';
7
- export declare const toolDef: {
8
- readonly name: "lore_coverage";
9
- readonly description: string;
10
- readonly inputSchema: {
11
- readonly type: "object";
12
- readonly properties: {
13
- readonly symbol_id: {
14
- readonly type: "number";
15
- readonly description: "Optional symbol id to fetch exact coverage for.";
16
- };
17
- readonly symbol_name: {
18
- readonly type: "string";
19
- readonly description: "Optional symbol name filter (case-insensitive).";
20
- };
21
- readonly path: {
22
- readonly type: "string";
23
- readonly description: "Optional file path filter.";
24
- };
25
- readonly branch: {
26
- readonly type: "string";
27
- readonly description: "Optional branch filter.";
28
- };
29
- readonly limit: {
30
- readonly type: "number";
31
- readonly description: "Maximum symbols to return (default 50).";
32
- };
33
- };
34
- readonly required: readonly [];
35
- };
36
- };
37
- export interface CoverageArgs {
38
- symbol_id?: number;
39
- symbol_name?: string;
40
- path?: string;
41
- branch?: string;
42
- limit?: number;
43
- }
44
- export interface CoverageSymbolResult {
45
- symbol_id: number;
46
- symbol_name: string;
47
- file_path: string;
48
- start_line: number;
49
- end_line: number;
50
- total_lines: number;
51
- covered_lines: number;
52
- uncovered_lines: number[];
53
- coverage_percent: number | null;
54
- }
55
- export interface CoverageResult {
56
- coverage_available: boolean;
57
- coverage_commit: string | null;
58
- current_commit: string | null;
59
- commits_behind: number;
60
- stale: boolean;
61
- global_lines_found: number | null;
62
- global_lines_hit: number | null;
63
- global_coverage_percent: number | null;
64
- symbols: CoverageSymbolResult[];
65
- }
66
- export declare function handler(db: Database.Database, args: CoverageArgs): CoverageResult;
67
- //# sourceMappingURL=coverage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../../src/server/tools/coverage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAStD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BV,CAAC;AAEX,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAID,wBAAgB,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,cAAc,CAoCjF"}
@@ -1,74 +0,0 @@
1
- /**
2
- * @module lore-server/tools/coverage
3
- *
4
- * MCP tool: query symbol-level coverage and coverage staleness metadata.
5
- */
6
- import { getCoverageStaleness, getLatestCoverageRun, getLatestCoverageTotals, getSymbolCoverageAggregates, getSymbolsByName, } from '../../db/read-only.js';
7
- export const toolDef = {
8
- name: 'lore_coverage',
9
- description: 'Return symbol-level coverage percentages, uncovered lines, and staleness metadata ' +
10
- 'for the latest ingested coverage run.',
11
- inputSchema: {
12
- type: 'object',
13
- properties: {
14
- symbol_id: {
15
- type: 'number',
16
- description: 'Optional symbol id to fetch exact coverage for.',
17
- },
18
- symbol_name: {
19
- type: 'string',
20
- description: 'Optional symbol name filter (case-insensitive).',
21
- },
22
- path: {
23
- type: 'string',
24
- description: 'Optional file path filter.',
25
- },
26
- branch: {
27
- type: 'string',
28
- description: 'Optional branch filter.',
29
- },
30
- limit: {
31
- type: 'number',
32
- description: 'Maximum symbols to return (default 50).',
33
- },
34
- },
35
- required: [],
36
- },
37
- };
38
- const DEFAULT_LIMIT = 50;
39
- export function handler(db, args) {
40
- const latestRun = getLatestCoverageRun(db);
41
- const staleness = getCoverageStaleness(db);
42
- const totals = getLatestCoverageTotals(db);
43
- const limit = Math.max(1, Math.floor(args.limit ?? DEFAULT_LIMIT));
44
- let symbolIds;
45
- if (args.symbol_id !== undefined) {
46
- symbolIds = [args.symbol_id];
47
- }
48
- else if (args.symbol_name !== undefined) {
49
- symbolIds = getSymbolsByName(db, args.symbol_name, args.branch).map((symbol) => symbol.id);
50
- if (symbolIds.length === 0) {
51
- symbolIds = [-1];
52
- }
53
- }
54
- const symbols = latestRun
55
- ? getSymbolCoverageAggregates(db, {
56
- symbolIds,
57
- path: args.path,
58
- branch: args.branch,
59
- limit,
60
- })
61
- : [];
62
- return {
63
- coverage_available: latestRun !== undefined,
64
- coverage_commit: staleness.coverage_commit,
65
- current_commit: staleness.current_commit,
66
- commits_behind: staleness.commits_behind,
67
- stale: staleness.stale,
68
- global_lines_found: totals?.lines_found ?? null,
69
- global_lines_hit: totals?.lines_hit ?? null,
70
- global_coverage_percent: totals?.coverage_percent ?? null,
71
- symbols,
72
- };
73
- }
74
- //# sourceMappingURL=coverage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../../src/server/tools/coverage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,oFAAoF;QACpF,uCAAuC;IACzC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iDAAiD;aAC/D;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iDAAiD;aAC/D;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4BAA4B;aAC1C;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yBAAyB;aACvC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW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Ae,EAAE,SAAS,CAAC,eAAe;QAC1C,cAAc,EAAE,SAAS,CAAC,cAAc;QACxC,cAAc,EAAE,SAAS,CAAC,cAAc;QACxC,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,kBAAkB,EAAE,MAAM,EAAE,WAAW,IAAI,IAAI;QAC/C,gBAAgB,EAAE,MAAM,EAAE,SAAS,IAAI,IAAI;QAC3C,uBAAuB,EAAE,MAAM,EAAE,gBAAgB,IAAI,IAAI;QACzD,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -1,64 +0,0 @@
1
- /**
2
- * @module lore-server/tools/graph-analysis
3
- *
4
- * MCP tool: run graph analysis primitives (symbol cycles, connected
5
- * components, symbol clustering, codebase summary).
6
- */
7
- import type { Database } from '../../db/read-only.js';
8
- import type { EdgeKind, SymbolCluster, CodebaseSummary } from '../../resolution/graph-analysis.js';
9
- export declare const toolDef: {
10
- readonly name: "lore_analyze";
11
- readonly description: string;
12
- readonly inputSchema: {
13
- readonly type: "object";
14
- readonly properties: {
15
- readonly mode: {
16
- readonly type: "string";
17
- readonly enum: readonly ["cycles", "components", "clusters", "summary"];
18
- readonly description: string;
19
- };
20
- readonly edge_kinds: {
21
- readonly type: "string";
22
- readonly enum: readonly ["call", "type", "both"];
23
- readonly description: "Which edge types to traverse. Default: \"both\".";
24
- };
25
- readonly scope: {
26
- readonly type: "string";
27
- readonly enum: readonly ["file", "symbol"];
28
- readonly description: "Scope for components mode. Default: \"symbol\".";
29
- };
30
- readonly branch: {
31
- readonly type: "string";
32
- readonly description: "Optional branch filter.";
33
- };
34
- readonly max_lines: {
35
- readonly type: "number";
36
- readonly description: "Maximum lines per cluster/module (for clusters and summary modes). Default: 500.";
37
- readonly minimum: 1;
38
- };
39
- };
40
- readonly required: readonly ["mode"];
41
- };
42
- };
43
- export interface AnalyzeArgs {
44
- mode: 'cycles' | 'components' | 'clusters' | 'summary';
45
- edge_kinds?: EdgeKind;
46
- scope?: 'file' | 'symbol';
47
- branch?: string;
48
- max_lines?: number;
49
- }
50
- export type AnalyzeResult = {
51
- mode: 'cycles';
52
- sccs: number[][];
53
- } | {
54
- mode: 'components';
55
- components: number[][];
56
- } | {
57
- mode: 'clusters';
58
- clusters: SymbolCluster[];
59
- } | {
60
- mode: 'summary';
61
- summary: CodebaseSummary;
62
- };
63
- export declare function handler(db: Database.Database, args: AnalyzeArgs): AnalyzeResult;
64
- //# sourceMappingURL=graph-analysis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph-analysis.d.ts","sourceRoot":"","sources":["../../../src/server/tools/graph-analysis.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOtD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAI5C,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCV,CAAC;AAIX,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;IACvD,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,CAAC;AAElD,wBAAgB,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,GAAG,aAAa,CAqC/E"}
@@ -1,82 +0,0 @@
1
- /**
2
- * @module lore-server/tools/graph-analysis
3
- *
4
- * MCP tool: run graph analysis primitives (symbol cycles, connected
5
- * components, symbol clustering, codebase summary).
6
- */
7
- import { detectSymbolCycles, findConnectedComponents, clusterSymbols, buildCodebaseSummary, } from '../../resolution/graph-analysis.js';
8
- // ─── Tool definition ──────────────────────────────────────────────────────────
9
- export const toolDef = {
10
- name: 'lore_analyze',
11
- description: 'Run graph analysis on the knowledge-base. Supports four modes: ' +
12
- '"cycles" (symbol-level strongly connected components / mutual recursion), ' +
13
- '"components" (connected components at file or symbol level), ' +
14
- '"clusters" (partition symbol graph into bounded-size coherent chunks), ' +
15
- '"summary" (condensed codebase dependency overview with modules, SCCs, and components).',
16
- inputSchema: {
17
- type: 'object',
18
- properties: {
19
- mode: {
20
- type: 'string',
21
- enum: ['cycles', 'components', 'clusters', 'summary'],
22
- description: 'Analysis mode. "cycles": symbol-level SCC detection; "components": connected components; ' +
23
- '"clusters": bounded-size symbol clustering; "summary": full codebase summary.',
24
- },
25
- edge_kinds: {
26
- type: 'string',
27
- enum: ['call', 'type', 'both'],
28
- description: 'Which edge types to traverse. Default: "both".',
29
- },
30
- scope: {
31
- type: 'string',
32
- enum: ['file', 'symbol'],
33
- description: 'Scope for components mode. Default: "symbol".',
34
- },
35
- branch: {
36
- type: 'string',
37
- description: 'Optional branch filter.',
38
- },
39
- max_lines: {
40
- type: 'number',
41
- description: 'Maximum lines per cluster/module (for clusters and summary modes). Default: 500.',
42
- minimum: 1,
43
- },
44
- },
45
- required: ['mode'],
46
- },
47
- };
48
- export function handler(db, args) {
49
- const opts = {
50
- edgeKinds: args.edge_kinds ?? 'both',
51
- branch: args.branch,
52
- };
53
- switch (args.mode) {
54
- case 'cycles':
55
- return { mode: 'cycles', sccs: detectSymbolCycles(db, opts) };
56
- case 'components':
57
- return {
58
- mode: 'components',
59
- components: findConnectedComponents(db, {
60
- ...opts,
61
- scope: args.scope ?? 'symbol',
62
- }),
63
- };
64
- case 'clusters':
65
- return {
66
- mode: 'clusters',
67
- clusters: clusterSymbols(db, {
68
- ...opts,
69
- maxLinesPerCluster: args.max_lines,
70
- }),
71
- };
72
- case 'summary':
73
- return {
74
- mode: 'summary',
75
- summary: buildCodebaseSummary(db, {
76
- ...opts,
77
- maxLinesPerModule: args.max_lines,
78
- }),
79
- };
80
- }
81
- }
82
- //# sourceMappingURL=graph-analysis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph-analysis.js","sourceRoot":"","sources":["../../../src/server/tools/graph-analysis.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAO5C,iFAAiF;AAEjF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,iEAAiE;QACjE,4EAA4E;QAC5E,+DAA+D;QAC/D,yEAAyE;QACzE,wFAAwF;IAC1F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,CAAC;gBACrD,WAAW,EACT,2FAA2F;oBAC3F,+EAA+E;aAClF;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;gBAC9B,WAAW,EAAE,gDAAgD;aAC9D;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;gBACxB,WAAW,EAAE,+CAA+C;aAC7D;YACD,MAAM,EAAE;gBAC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
- * - lore_notes_read: retrieve notes with staleness/recency metadata
7
- */
8
- import type { Database as LoreDatabase } from '../../db/read-only.js';
9
- export declare const loreNotesWriteToolDef: {
10
- readonly name: "lore_notes_write";
11
- readonly description: string;
12
- readonly inputSchema: {
13
- readonly type: "object";
14
- readonly properties: {
15
- readonly key: {
16
- readonly type: "string";
17
- readonly description: "Topic identifier, e.g. \"architecture/overview\".";
18
- };
19
- readonly scope: {
20
- readonly type: "string";
21
- readonly description: "Optional scope (default \"global\"), e.g. file:<path>, module:<name>.";
22
- };
23
- readonly content: {
24
- readonly type: "string";
25
- readonly description: "The note text.";
26
- };
27
- readonly model: {
28
- readonly type: "string";
29
- readonly description: "Model identifier that authored the note.";
30
- };
31
- readonly source_hash: {
32
- readonly type: "string";
33
- readonly description: "Optional source hash used for staleness detection.";
34
- };
35
- };
36
- readonly required: readonly ["key", "content"];
37
- };
38
- };
39
- export declare const loreNotesReadToolDef: {
40
- readonly name: "lore_notes_read";
41
- readonly description: string;
42
- readonly inputSchema: {
43
- readonly type: "object";
44
- readonly properties: {
45
- readonly key: {
46
- readonly type: "string";
47
- readonly description: "Exact key match.";
48
- };
49
- readonly key_prefix: {
50
- readonly type: "string";
51
- readonly description: "Prefix match (e.g. \"architecture/\").";
52
- };
53
- readonly scope: {
54
- readonly type: "string";
55
- readonly description: "Optional scope filter.";
56
- };
57
- readonly limit: {
58
- readonly type: "number";
59
- readonly description: "Max notes to return (default 20, max 200).";
60
- };
61
- };
62
- readonly required: readonly [];
63
- };
64
- };
65
- export interface NotesWriteArgs {
66
- key: string;
67
- scope?: string;
68
- content: string;
69
- model?: string;
70
- source_hash?: string;
71
- }
72
- export interface NotesWriteResult {
73
- ok: boolean;
74
- key: string;
75
- scope: string;
76
- updated_at: number;
77
- }
78
- interface NoteRow {
79
- key: string;
80
- scope: string;
81
- content: string;
82
- model: string;
83
- source_hash: string | null;
84
- created_at: number;
85
- updated_at: number;
86
- }
87
- export interface NotesReadArgs {
88
- key?: string;
89
- key_prefix?: string;
90
- scope?: string;
91
- limit?: number;
92
- }
93
- export interface NoteWithMetadata extends NoteRow {
94
- stale: boolean;
95
- stale_reason: 'source_hash_mismatch' | 'file_missing' | 'doc_missing' | 'indexed_after_note' | 'lore_reindexed_since_note' | null;
96
- file_last_hash: string | null;
97
- file_indexed_at: number | null;
98
- lore_indexed_at: number | null;
99
- }
100
- export interface NotesReadResult {
101
- notes: NoteWithMetadata[];
102
- count: number;
103
- }
104
- export declare function loreNotesWriteHandler(dbPath: string, args: NotesWriteArgs): NotesWriteResult;
105
- export declare function loreNotesReadHandler(db: LoreDatabase.Database, args: NotesReadArgs): NotesReadResult;
106
- export declare const writeToolDef: {
107
- readonly name: "lore_notes_write";
108
- readonly description: string;
109
- readonly inputSchema: {
110
- readonly type: "object";
111
- readonly properties: {
112
- readonly key: {
113
- readonly type: "string";
114
- readonly description: "Topic identifier, e.g. \"architecture/overview\".";
115
- };
116
- readonly scope: {
117
- readonly type: "string";
118
- readonly description: "Optional scope (default \"global\"), e.g. file:<path>, module:<name>.";
119
- };
120
- readonly content: {
121
- readonly type: "string";
122
- readonly description: "The note text.";
123
- };
124
- readonly model: {
125
- readonly type: "string";
126
- readonly description: "Model identifier that authored the note.";
127
- };
128
- readonly source_hash: {
129
- readonly type: "string";
130
- readonly description: "Optional source hash used for staleness detection.";
131
- };
132
- };
133
- readonly required: readonly ["key", "content"];
134
- };
135
- };
136
- export declare const readToolDef: {
137
- readonly name: "lore_notes_read";
138
- readonly description: string;
139
- readonly inputSchema: {
140
- readonly type: "object";
141
- readonly properties: {
142
- readonly key: {
143
- readonly type: "string";
144
- readonly description: "Exact key match.";
145
- };
146
- readonly key_prefix: {
147
- readonly type: "string";
148
- readonly description: "Prefix match (e.g. \"architecture/\").";
149
- };
150
- readonly scope: {
151
- readonly type: "string";
152
- readonly description: "Optional scope filter.";
153
- };
154
- readonly limit: {
155
- readonly type: "number";
156
- readonly description: "Max notes to return (default 20, max 200).";
157
- };
158
- };
159
- readonly required: readonly [];
160
- };
161
- };
162
- export declare const writeHandler: typeof loreNotesWriteHandler;
163
- export declare const readHandler: typeof loreNotesReadHandler;
164
- export {};
165
- //# sourceMappingURL=notes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../../src/server/tools/notes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAWtE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;CAevB,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,OAAO;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAYD,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAA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