@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.
- package/README.md +38 -150
- package/dist/cli.d.ts +2 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +80 -32
- package/dist/cli.js.map +1 -1
- package/dist/db/read-only.d.ts +22 -43
- package/dist/db/read-only.d.ts.map +1 -1
- package/dist/db/read-only.js +80 -156
- package/dist/db/read-only.js.map +1 -1
- package/dist/db/schema.d.ts +9 -0
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +171 -85
- package/dist/db/schema.js.map +1 -1
- package/dist/discovery/poller.d.ts +6 -16
- package/dist/discovery/poller.d.ts.map +1 -1
- package/dist/discovery/poller.js +21 -52
- package/dist/discovery/poller.js.map +1 -1
- package/dist/discovery/scip-flush.d.ts +44 -0
- package/dist/discovery/scip-flush.d.ts.map +1 -0
- package/dist/discovery/scip-flush.js +67 -0
- package/dist/discovery/scip-flush.js.map +1 -0
- package/dist/discovery/watcher.d.ts +6 -16
- package/dist/discovery/watcher.d.ts.map +1 -1
- package/dist/discovery/watcher.js +22 -54
- package/dist/discovery/watcher.js.map +1 -1
- package/dist/docs/docs.d.ts +0 -2
- package/dist/docs/docs.d.ts.map +1 -1
- package/dist/docs/docs.js +0 -27
- package/dist/docs/docs.js.map +1 -1
- package/dist/embeddings/embedder.d.ts +12 -8
- package/dist/embeddings/embedder.d.ts.map +1 -1
- package/dist/embeddings/embedder.js +35 -19
- package/dist/embeddings/embedder.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/indexer/index.d.ts +19 -10
- package/dist/indexer/index.d.ts.map +1 -1
- package/dist/indexer/index.js +135 -28
- package/dist/indexer/index.js.map +1 -1
- package/dist/indexer/pipeline.d.ts +44 -21
- package/dist/indexer/pipeline.d.ts.map +1 -1
- package/dist/indexer/pipeline.js +48 -26
- package/dist/indexer/pipeline.js.map +1 -1
- package/dist/indexer/stages/docs-index.d.ts +1 -3
- package/dist/indexer/stages/docs-index.d.ts.map +1 -1
- package/dist/indexer/stages/docs-index.js +1 -25
- package/dist/indexer/stages/docs-index.js.map +1 -1
- package/dist/indexer/stages/index.d.ts +4 -2
- package/dist/indexer/stages/index.d.ts.map +1 -1
- package/dist/indexer/stages/index.js +3 -2
- package/dist/indexer/stages/index.js.map +1 -1
- package/dist/indexer/stages/lsp-enrichment.d.ts +1 -1
- package/dist/indexer/stages/lsp-enrichment.d.ts.map +1 -1
- package/dist/indexer/stages/lsp-enrichment.js +44 -21
- package/dist/indexer/stages/lsp-enrichment.js.map +1 -1
- package/dist/indexer/stages/overlay-cleanup.d.ts +31 -0
- package/dist/indexer/stages/overlay-cleanup.d.ts.map +1 -0
- package/dist/indexer/stages/overlay-cleanup.js +64 -0
- package/dist/indexer/stages/overlay-cleanup.js.map +1 -0
- package/dist/indexer/stages/reverse-deps.d.ts +13 -0
- package/dist/indexer/stages/reverse-deps.d.ts.map +1 -0
- package/dist/indexer/stages/reverse-deps.js +81 -0
- package/dist/indexer/stages/reverse-deps.js.map +1 -0
- package/dist/indexer/stages/{scip-source.d.ts → scip-indexer.d.ts} +38 -9
- package/dist/indexer/stages/scip-indexer.d.ts.map +1 -0
- package/dist/indexer/stages/{scip-source.js → scip-indexer.js} +359 -98
- package/dist/indexer/stages/scip-indexer.js.map +1 -0
- package/dist/indexer/stages/source-index.d.ts +3 -3
- package/dist/indexer/stages/source-index.d.ts.map +1 -1
- package/dist/indexer/stages/source-index.js +188 -70
- package/dist/indexer/stages/source-index.js.map +1 -1
- package/dist/lsp/enrichment.d.ts.map +1 -1
- package/dist/lsp/enrichment.js +1 -18
- package/dist/lsp/enrichment.js.map +1 -1
- package/dist/parsing/extractors/go.d.ts.map +1 -1
- package/dist/parsing/extractors/go.js +0 -38
- package/dist/parsing/extractors/go.js.map +1 -1
- package/dist/parsing/extractors/javascript.d.ts.map +1 -1
- package/dist/parsing/extractors/javascript.js +0 -47
- package/dist/parsing/extractors/javascript.js.map +1 -1
- package/dist/parsing/extractors/python.d.ts.map +1 -1
- package/dist/parsing/extractors/python.js +0 -22
- package/dist/parsing/extractors/python.js.map +1 -1
- package/dist/parsing/extractors/types.d.ts +0 -16
- package/dist/parsing/extractors/types.d.ts.map +1 -1
- package/dist/parsing/extractors/types.js +1 -1
- package/dist/parsing/extractors/types.js.map +1 -1
- package/dist/parsing/extractors/typescript.d.ts.map +1 -1
- package/dist/parsing/extractors/typescript.js +18 -2
- package/dist/parsing/extractors/typescript.js.map +1 -1
- package/dist/resolution/call-graph.d.ts +3 -1
- package/dist/resolution/call-graph.d.ts.map +1 -1
- package/dist/resolution/call-graph.js +15 -13
- package/dist/resolution/call-graph.js.map +1 -1
- package/dist/resolution/resolution-method.d.ts +1 -1
- package/dist/resolution/resolution-method.d.ts.map +1 -1
- package/dist/resolution/resolution-method.js +2 -0
- package/dist/resolution/resolution-method.js.map +1 -1
- package/dist/resolution/resolver.d.ts +6 -0
- package/dist/resolution/resolver.d.ts.map +1 -1
- package/dist/resolution/resolver.js +21 -0
- package/dist/resolution/resolver.js.map +1 -1
- package/dist/runtime.d.ts +0 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/scip/compdb.d.ts +38 -0
- package/dist/scip/compdb.d.ts.map +1 -0
- package/dist/scip/compdb.js +138 -0
- package/dist/scip/compdb.js.map +1 -0
- package/dist/scip/enrichment.d.ts +6 -1
- package/dist/scip/enrichment.d.ts.map +1 -1
- package/dist/scip/enrichment.js +62 -5
- package/dist/scip/enrichment.js.map +1 -1
- package/dist/scip/installer.d.ts +59 -0
- package/dist/scip/installer.d.ts.map +1 -0
- package/dist/scip/installer.js +302 -0
- package/dist/scip/installer.js.map +1 -0
- package/dist/scip/registry.d.ts +1 -1
- package/dist/scip/registry.d.ts.map +1 -1
- package/dist/scip/registry.js +33 -5
- package/dist/scip/registry.js.map +1 -1
- package/dist/server/server.d.ts +3 -8
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +7 -66
- package/dist/server/server.js.map +1 -1
- package/dist/server/tool-registry.d.ts +2 -2
- package/dist/server/tool-registry.d.ts.map +1 -1
- package/dist/server/tool-registry.js +37 -41
- package/dist/server/tool-registry.js.map +1 -1
- package/dist/server/tools/cohesion.d.ts +46 -0
- package/dist/server/tools/cohesion.d.ts.map +1 -0
- package/dist/server/tools/cohesion.js +100 -0
- package/dist/server/tools/cohesion.js.map +1 -0
- package/dist/server/tools/dependents.d.ts +139 -0
- package/dist/server/tools/dependents.d.ts.map +1 -0
- package/dist/server/tools/dependents.js +354 -0
- package/dist/server/tools/dependents.js.map +1 -0
- package/dist/server/tools/diff.d.ts +73 -0
- package/dist/server/tools/diff.d.ts.map +1 -0
- package/dist/server/tools/diff.js +157 -0
- package/dist/server/tools/diff.js.map +1 -0
- package/dist/server/tools/graph.d.ts +7 -3
- package/dist/server/tools/graph.d.ts.map +1 -1
- package/dist/server/tools/graph.js +15 -85
- package/dist/server/tools/graph.js.map +1 -1
- package/dist/server/tools/metrics.d.ts +5 -30
- package/dist/server/tools/metrics.d.ts.map +1 -1
- package/dist/server/tools/metrics.js +21 -57
- package/dist/server/tools/metrics.js.map +1 -1
- package/dist/server/tools/structure.d.ts +77 -0
- package/dist/server/tools/structure.d.ts.map +1 -0
- package/dist/server/tools/structure.js +309 -0
- package/dist/server/tools/structure.js.map +1 -0
- package/dist/server/tools/test-map.d.ts +7 -0
- package/dist/server/tools/test-map.d.ts.map +1 -1
- package/dist/server/tools/test-map.js +18 -1
- package/dist/server/tools/test-map.js.map +1 -1
- package/dist/server/tools/trace.d.ts +84 -0
- package/dist/server/tools/trace.d.ts.map +1 -0
- package/dist/server/tools/trace.js +317 -0
- package/dist/server/tools/trace.js.map +1 -0
- package/dist/testing/coverage.d.ts +11 -0
- package/dist/testing/coverage.d.ts.map +1 -1
- package/dist/testing/coverage.js +34 -2
- package/dist/testing/coverage.js.map +1 -1
- package/dist/testing/test-mapper.d.ts +1 -1
- package/dist/testing/test-mapper.d.ts.map +1 -1
- package/dist/testing/test-mapper.js +1 -0
- package/dist/testing/test-mapper.js.map +1 -1
- package/package.json +3 -1
- package/dist/indexer/stages/scip-enrichment.d.ts +0 -43
- package/dist/indexer/stages/scip-enrichment.d.ts.map +0 -1
- package/dist/indexer/stages/scip-enrichment.js +0 -174
- package/dist/indexer/stages/scip-enrichment.js.map +0 -1
- package/dist/indexer/stages/scip-source.d.ts.map +0 -1
- package/dist/indexer/stages/scip-source.js.map +0 -1
- package/dist/server/tools/annotations.d.ts +0 -40
- package/dist/server/tools/annotations.d.ts.map +0 -1
- package/dist/server/tools/annotations.js +0 -35
- package/dist/server/tools/annotations.js.map +0 -1
- package/dist/server/tools/architecture.d.ts +0 -67
- package/dist/server/tools/architecture.d.ts.map +0 -1
- package/dist/server/tools/architecture.js +0 -209
- package/dist/server/tools/architecture.js.map +0 -1
- package/dist/server/tools/coverage.d.ts +0 -67
- package/dist/server/tools/coverage.d.ts.map +0 -1
- package/dist/server/tools/coverage.js +0 -74
- package/dist/server/tools/coverage.js.map +0 -1
- package/dist/server/tools/graph-analysis.d.ts +0 -64
- package/dist/server/tools/graph-analysis.d.ts.map +0 -1
- package/dist/server/tools/graph-analysis.js +0 -82
- package/dist/server/tools/graph-analysis.js.map +0 -1
- package/dist/server/tools/notes.d.ts +0 -165
- package/dist/server/tools/notes.d.ts.map +0 -1
- package/dist/server/tools/notes.js +0 -214
- package/dist/server/tools/notes.js.map +0 -1
- package/dist/server/tools/routes.d.ts +0 -38
- package/dist/server/tools/routes.d.ts.map +0 -1
- package/dist/server/tools/routes.js +0 -38
- package/dist/server/tools/routes.js.map +0 -1
- package/dist/server/tools/writeback.d.ts +0 -49
- package/dist/server/tools/writeback.d.ts.map +0 -1
- package/dist/server/tools/writeback.js +0 -68
- package/dist/server/tools/writeback.js.map +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module lore-server/tools/dependents
|
|
3
|
+
*
|
|
4
|
+
* MCP tool: unified reverse-dependency / blast-radius queries.
|
|
5
|
+
*
|
|
6
|
+
* Given a symbol name or file path, returns all dependents across edge types
|
|
7
|
+
* (callers, importers, subclasses, type references) in a single call.
|
|
8
|
+
* This is a higher-level abstraction over `lore_graph` that resolves names
|
|
9
|
+
* internally and aggregates across edge kinds.
|
|
10
|
+
*/
|
|
11
|
+
import type { Database } from '../../db/read-only.js';
|
|
12
|
+
export declare const toolDef: {
|
|
13
|
+
readonly name: "lore_dependents";
|
|
14
|
+
readonly description: string;
|
|
15
|
+
readonly inputSchema: {
|
|
16
|
+
readonly type: "object";
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly query: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "Symbol name, class name, or file path to find dependents of.";
|
|
21
|
+
};
|
|
22
|
+
readonly kind: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly enum: readonly ["symbol", "file"];
|
|
25
|
+
readonly description: "\"symbol\" resolves query as a symbol name; \"file\" resolves query as a file path.";
|
|
26
|
+
};
|
|
27
|
+
readonly depth: {
|
|
28
|
+
readonly type: "number";
|
|
29
|
+
readonly description: string;
|
|
30
|
+
readonly minimum: 1;
|
|
31
|
+
readonly maximum: 5;
|
|
32
|
+
};
|
|
33
|
+
readonly branch: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
readonly description: "Optional branch name to filter results.";
|
|
36
|
+
};
|
|
37
|
+
readonly compact: {
|
|
38
|
+
readonly type: "boolean";
|
|
39
|
+
readonly description: "If true, omit provenance fields (line, character, resolution details) to reduce token count. Default false.";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly required: readonly ["query", "kind"];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export interface DependentsArgs {
|
|
46
|
+
query: string;
|
|
47
|
+
kind: 'symbol' | 'file';
|
|
48
|
+
depth?: number;
|
|
49
|
+
branch?: string;
|
|
50
|
+
compact?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface DependentTarget {
|
|
53
|
+
id: number;
|
|
54
|
+
name: string;
|
|
55
|
+
kind: string;
|
|
56
|
+
file?: string;
|
|
57
|
+
}
|
|
58
|
+
interface CallerEntry {
|
|
59
|
+
caller_id: number;
|
|
60
|
+
caller_name: string;
|
|
61
|
+
caller_kind: string;
|
|
62
|
+
caller_file: string;
|
|
63
|
+
line?: number;
|
|
64
|
+
character?: number | null;
|
|
65
|
+
resolution_method?: string;
|
|
66
|
+
}
|
|
67
|
+
interface CompactCallerEntry {
|
|
68
|
+
caller_id: number;
|
|
69
|
+
caller_name: string;
|
|
70
|
+
caller_kind: string;
|
|
71
|
+
caller_file: string;
|
|
72
|
+
}
|
|
73
|
+
interface ImporterEntry {
|
|
74
|
+
file_id: number;
|
|
75
|
+
file_path: string;
|
|
76
|
+
raw_import: string;
|
|
77
|
+
}
|
|
78
|
+
interface CompactImporterEntry {
|
|
79
|
+
file_id: number;
|
|
80
|
+
file_path: string;
|
|
81
|
+
}
|
|
82
|
+
interface SubclassEntry {
|
|
83
|
+
symbol_id: number;
|
|
84
|
+
symbol_name: string;
|
|
85
|
+
symbol_kind: string;
|
|
86
|
+
file: string;
|
|
87
|
+
relationship_type: string;
|
|
88
|
+
line?: number;
|
|
89
|
+
character?: number | null;
|
|
90
|
+
resolution_method?: string;
|
|
91
|
+
}
|
|
92
|
+
interface CompactSubclassEntry {
|
|
93
|
+
symbol_id: number;
|
|
94
|
+
symbol_name: string;
|
|
95
|
+
symbol_kind: string;
|
|
96
|
+
file: string;
|
|
97
|
+
relationship_type: string;
|
|
98
|
+
}
|
|
99
|
+
interface TypeRefEntry {
|
|
100
|
+
symbol_id: number;
|
|
101
|
+
symbol_name: string;
|
|
102
|
+
symbol_kind: string;
|
|
103
|
+
file: string;
|
|
104
|
+
ref_kind: string;
|
|
105
|
+
line?: number;
|
|
106
|
+
character?: number | null;
|
|
107
|
+
resolution_method?: string;
|
|
108
|
+
}
|
|
109
|
+
interface CompactTypeRefEntry {
|
|
110
|
+
symbol_id: number;
|
|
111
|
+
symbol_name: string;
|
|
112
|
+
symbol_kind: string;
|
|
113
|
+
file: string;
|
|
114
|
+
ref_kind: string;
|
|
115
|
+
}
|
|
116
|
+
export interface DependentsResult {
|
|
117
|
+
target: DependentTarget;
|
|
118
|
+
dependents: {
|
|
119
|
+
callers: CallerEntry[] | CompactCallerEntry[];
|
|
120
|
+
importers: ImporterEntry[] | CompactImporterEntry[];
|
|
121
|
+
subclasses: SubclassEntry[] | CompactSubclassEntry[];
|
|
122
|
+
type_references: TypeRefEntry[] | CompactTypeRefEntry[];
|
|
123
|
+
};
|
|
124
|
+
depth_used: number;
|
|
125
|
+
total_count: number;
|
|
126
|
+
}
|
|
127
|
+
export interface DependentsErrorResult {
|
|
128
|
+
error: string;
|
|
129
|
+
candidates?: Array<{
|
|
130
|
+
id: number;
|
|
131
|
+
name: string;
|
|
132
|
+
kind: string;
|
|
133
|
+
file: string;
|
|
134
|
+
}>;
|
|
135
|
+
}
|
|
136
|
+
/** Unified reverse-dependency / blast-radius query. */
|
|
137
|
+
export declare function handler(db: Database.Database, args: DependentsArgs): DependentsResult | DependentsErrorResult;
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=dependents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependents.d.ts","sourceRoot":"","sources":["../../../src/server/tools/dependents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUtD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCV,CAAC;AAIX,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,KAAK,CAA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,CACrB,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,IAAI,EAAE,cAAc,GACnB,gBAAgB,GAAG,qBAAqB,CAS1C"}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module lore-server/tools/dependents
|
|
3
|
+
*
|
|
4
|
+
* MCP tool: unified reverse-dependency / blast-radius queries.
|
|
5
|
+
*
|
|
6
|
+
* Given a symbol name or file path, returns all dependents across edge types
|
|
7
|
+
* (callers, importers, subclasses, type references) in a single call.
|
|
8
|
+
* This is a higher-level abstraction over `lore_graph` that resolves names
|
|
9
|
+
* internally and aggregates across edge kinds.
|
|
10
|
+
*/
|
|
11
|
+
import { getSymbolsByName, getFileByPath, getFileById, } from '../../db/read-only.js';
|
|
12
|
+
// ─── Tool definition ──────────────────────────────────────────────────────────
|
|
13
|
+
export const toolDef = {
|
|
14
|
+
name: 'lore_dependents',
|
|
15
|
+
description: 'Find everything affected by changing a symbol or file — unified blast-radius / reverse-dependency query. ' +
|
|
16
|
+
'Takes a name or path (not a numeric ID) and returns callers, importers, subclasses, and type references in one call. ' +
|
|
17
|
+
'For kind="symbol", resolves the query to a symbol and returns callers, subclasses, and type-referencers. ' +
|
|
18
|
+
'For kind="file", resolves the query to a file and returns files that import it plus symbols in other files that call into its symbols. ' +
|
|
19
|
+
'Set depth > 1 for transitive closure (up to 5 hops). Set compact=true to reduce token count.',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
query: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Symbol name, class name, or file path to find dependents of.',
|
|
26
|
+
},
|
|
27
|
+
kind: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
enum: ['symbol', 'file'],
|
|
30
|
+
description: '"symbol" resolves query as a symbol name; "file" resolves query as a file path.',
|
|
31
|
+
},
|
|
32
|
+
depth: {
|
|
33
|
+
type: 'number',
|
|
34
|
+
description: 'Transitive hops (default 1, max 5). depth=1 returns direct dependents only. ' +
|
|
35
|
+
'depth=N follows dependents N hops deep.',
|
|
36
|
+
minimum: 1,
|
|
37
|
+
maximum: 5,
|
|
38
|
+
},
|
|
39
|
+
branch: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Optional branch name to filter results.',
|
|
42
|
+
},
|
|
43
|
+
compact: {
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
description: 'If true, omit provenance fields (line, character, resolution details) to reduce token count. Default false.',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: ['query', 'kind'],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
// ─── Query helpers ────────────────────────────────────────────────────────────
|
|
52
|
+
function queryCallers(db, symbolIds, branch, limit) {
|
|
53
|
+
if (symbolIds.length === 0)
|
|
54
|
+
return [];
|
|
55
|
+
const placeholders = symbolIds.map(() => '?').join(', ');
|
|
56
|
+
const conditions = [`sr.callee_id IN (${placeholders})`];
|
|
57
|
+
const params = [...symbolIds];
|
|
58
|
+
if (branch !== undefined) {
|
|
59
|
+
conditions.push('f.branch = ?');
|
|
60
|
+
params.push(branch);
|
|
61
|
+
}
|
|
62
|
+
params.push(limit);
|
|
63
|
+
return db
|
|
64
|
+
.prepare(`SELECT sr.caller_id,
|
|
65
|
+
s.name AS caller_name,
|
|
66
|
+
s.kind AS caller_kind,
|
|
67
|
+
f.path AS caller_file,
|
|
68
|
+
sr.call_line + 1 AS line,
|
|
69
|
+
CASE WHEN sr.call_character IS NULL THEN NULL ELSE sr.call_character + 1 END AS character,
|
|
70
|
+
sr.resolution_method
|
|
71
|
+
FROM symbol_refs sr
|
|
72
|
+
JOIN symbols s ON s.id = sr.caller_id
|
|
73
|
+
JOIN files f ON f.id = s.file_id
|
|
74
|
+
WHERE ${conditions.join(' AND ')}
|
|
75
|
+
LIMIT ?`)
|
|
76
|
+
.all(...params);
|
|
77
|
+
}
|
|
78
|
+
function queryImporters(db, fileIds, branch, limit) {
|
|
79
|
+
if (fileIds.length === 0)
|
|
80
|
+
return [];
|
|
81
|
+
const placeholders = fileIds.map(() => '?').join(', ');
|
|
82
|
+
const conditions = [`fi.resolved_id IN (${placeholders})`];
|
|
83
|
+
const params = [...fileIds];
|
|
84
|
+
if (branch !== undefined) {
|
|
85
|
+
conditions.push('f.branch = ?');
|
|
86
|
+
params.push(branch);
|
|
87
|
+
}
|
|
88
|
+
params.push(limit);
|
|
89
|
+
return db
|
|
90
|
+
.prepare(`SELECT fi.file_id,
|
|
91
|
+
f.path AS file_path,
|
|
92
|
+
fi.raw_import
|
|
93
|
+
FROM file_imports fi
|
|
94
|
+
JOIN files f ON f.id = fi.file_id
|
|
95
|
+
WHERE ${conditions.join(' AND ')}
|
|
96
|
+
LIMIT ?`)
|
|
97
|
+
.all(...params);
|
|
98
|
+
}
|
|
99
|
+
function querySubclasses(db, symbolIds, branch, limit) {
|
|
100
|
+
if (symbolIds.length === 0)
|
|
101
|
+
return [];
|
|
102
|
+
const placeholders = symbolIds.map(() => '?').join(', ');
|
|
103
|
+
const conditions = [
|
|
104
|
+
`rel.target_symbol_id IN (${placeholders})`,
|
|
105
|
+
"rel.relationship_type IN ('extends', 'implements')",
|
|
106
|
+
];
|
|
107
|
+
const params = [...symbolIds];
|
|
108
|
+
if (branch !== undefined) {
|
|
109
|
+
conditions.push('f.branch = ?');
|
|
110
|
+
params.push(branch);
|
|
111
|
+
}
|
|
112
|
+
params.push(limit);
|
|
113
|
+
return db
|
|
114
|
+
.prepare(`SELECT rel.source_symbol_id AS symbol_id,
|
|
115
|
+
s.name AS symbol_name,
|
|
116
|
+
s.kind AS symbol_kind,
|
|
117
|
+
f.path AS file,
|
|
118
|
+
rel.relationship_type,
|
|
119
|
+
CASE WHEN rel.line IS NULL THEN NULL ELSE rel.line + 1 END AS line,
|
|
120
|
+
CASE WHEN rel.character IS NULL THEN NULL ELSE rel.character + 1 END AS character,
|
|
121
|
+
rel.resolution_method
|
|
122
|
+
FROM symbol_relationships rel
|
|
123
|
+
JOIN symbols s ON s.id = rel.source_symbol_id
|
|
124
|
+
JOIN files f ON f.id = s.file_id
|
|
125
|
+
WHERE ${conditions.join(' AND ')}
|
|
126
|
+
LIMIT ?`)
|
|
127
|
+
.all(...params);
|
|
128
|
+
}
|
|
129
|
+
function queryTypeReferences(db, symbolIds, branch, limit) {
|
|
130
|
+
if (symbolIds.length === 0)
|
|
131
|
+
return [];
|
|
132
|
+
const placeholders = symbolIds.map(() => '?').join(', ');
|
|
133
|
+
const conditions = [`tr.type_id IN (${placeholders})`];
|
|
134
|
+
const params = [...symbolIds];
|
|
135
|
+
if (branch !== undefined) {
|
|
136
|
+
conditions.push('f.branch = ?');
|
|
137
|
+
params.push(branch);
|
|
138
|
+
}
|
|
139
|
+
params.push(limit);
|
|
140
|
+
return db
|
|
141
|
+
.prepare(`SELECT tr.symbol_id,
|
|
142
|
+
COALESCE(s.name, '') AS symbol_name,
|
|
143
|
+
COALESCE(s.kind, '') AS symbol_kind,
|
|
144
|
+
f.path AS file,
|
|
145
|
+
tr.ref_kind,
|
|
146
|
+
tr.ref_line + 1 AS line,
|
|
147
|
+
CASE WHEN tr.ref_character IS NULL THEN NULL ELSE tr.ref_character + 1 END AS character,
|
|
148
|
+
tr.resolution_method
|
|
149
|
+
FROM type_refs tr
|
|
150
|
+
JOIN files f ON f.id = tr.file_id
|
|
151
|
+
LEFT JOIN symbols s ON s.id = tr.symbol_id
|
|
152
|
+
WHERE ${conditions.join(' AND ')}
|
|
153
|
+
LIMIT ?`)
|
|
154
|
+
.all(...params);
|
|
155
|
+
}
|
|
156
|
+
/** For kind="file", find all symbols defined in the given file(s) so we can query their callers. */
|
|
157
|
+
function getSymbolIdsInFiles(db, fileIds, branch) {
|
|
158
|
+
if (fileIds.length === 0)
|
|
159
|
+
return [];
|
|
160
|
+
const placeholders = fileIds.map(() => '?').join(', ');
|
|
161
|
+
const conditions = [`s.file_id IN (${placeholders})`];
|
|
162
|
+
const params = [...fileIds];
|
|
163
|
+
if (branch !== undefined) {
|
|
164
|
+
conditions.push('f.branch = ?');
|
|
165
|
+
params.push(branch);
|
|
166
|
+
}
|
|
167
|
+
const rows = db
|
|
168
|
+
.prepare(`SELECT s.id
|
|
169
|
+
FROM symbols s
|
|
170
|
+
JOIN files f ON f.id = s.file_id
|
|
171
|
+
WHERE ${conditions.join(' AND ')}`)
|
|
172
|
+
.all(...params);
|
|
173
|
+
return rows.map((r) => r.id);
|
|
174
|
+
}
|
|
175
|
+
// ─── Compact helpers ──────────────────────────────────────────────────────────
|
|
176
|
+
function compactCaller(row) {
|
|
177
|
+
return {
|
|
178
|
+
caller_id: row.caller_id,
|
|
179
|
+
caller_name: row.caller_name,
|
|
180
|
+
caller_kind: row.caller_kind,
|
|
181
|
+
caller_file: row.caller_file,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function compactImporter(row) {
|
|
185
|
+
return {
|
|
186
|
+
file_id: row.file_id,
|
|
187
|
+
file_path: row.file_path,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function compactSubclass(row) {
|
|
191
|
+
return {
|
|
192
|
+
symbol_id: row.symbol_id,
|
|
193
|
+
symbol_name: row.symbol_name,
|
|
194
|
+
symbol_kind: row.symbol_kind,
|
|
195
|
+
file: row.file,
|
|
196
|
+
relationship_type: row.relationship_type,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function compactTypeRef(row) {
|
|
200
|
+
return {
|
|
201
|
+
symbol_id: row.symbol_id,
|
|
202
|
+
symbol_name: row.symbol_name,
|
|
203
|
+
symbol_kind: row.symbol_kind,
|
|
204
|
+
file: row.file,
|
|
205
|
+
ref_kind: row.ref_kind,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
// ─── Multi-hop expansion ──────────────────────────────────────────────────────
|
|
209
|
+
function expandCallers(db, seedIds, branch, depth, limit) {
|
|
210
|
+
const all = [];
|
|
211
|
+
const seen = new Set();
|
|
212
|
+
let frontier = seedIds;
|
|
213
|
+
for (let hop = 0; hop < depth && frontier.length > 0 && all.length < limit; hop++) {
|
|
214
|
+
const remaining = limit - all.length;
|
|
215
|
+
const rows = queryCallers(db, frontier, branch, remaining);
|
|
216
|
+
const nextFrontier = [];
|
|
217
|
+
for (const row of rows) {
|
|
218
|
+
if (seen.has(row.caller_id))
|
|
219
|
+
continue;
|
|
220
|
+
seen.add(row.caller_id);
|
|
221
|
+
all.push(row);
|
|
222
|
+
nextFrontier.push(row.caller_id);
|
|
223
|
+
}
|
|
224
|
+
frontier = nextFrontier;
|
|
225
|
+
}
|
|
226
|
+
return all;
|
|
227
|
+
}
|
|
228
|
+
function expandImporters(db, seedIds, branch, depth, limit) {
|
|
229
|
+
const all = [];
|
|
230
|
+
const seen = new Set();
|
|
231
|
+
let frontier = seedIds;
|
|
232
|
+
for (let hop = 0; hop < depth && frontier.length > 0 && all.length < limit; hop++) {
|
|
233
|
+
const remaining = limit - all.length;
|
|
234
|
+
const rows = queryImporters(db, frontier, branch, remaining);
|
|
235
|
+
const nextFrontier = [];
|
|
236
|
+
for (const row of rows) {
|
|
237
|
+
if (seen.has(row.file_id))
|
|
238
|
+
continue;
|
|
239
|
+
seen.add(row.file_id);
|
|
240
|
+
all.push(row);
|
|
241
|
+
nextFrontier.push(row.file_id);
|
|
242
|
+
}
|
|
243
|
+
frontier = nextFrontier;
|
|
244
|
+
}
|
|
245
|
+
return all;
|
|
246
|
+
}
|
|
247
|
+
function expandSubclasses(db, seedIds, branch, depth, limit) {
|
|
248
|
+
const all = [];
|
|
249
|
+
const seen = new Set();
|
|
250
|
+
let frontier = seedIds;
|
|
251
|
+
for (let hop = 0; hop < depth && frontier.length > 0 && all.length < limit; hop++) {
|
|
252
|
+
const remaining = limit - all.length;
|
|
253
|
+
const rows = querySubclasses(db, frontier, branch, remaining);
|
|
254
|
+
const nextFrontier = [];
|
|
255
|
+
for (const row of rows) {
|
|
256
|
+
if (seen.has(row.symbol_id))
|
|
257
|
+
continue;
|
|
258
|
+
seen.add(row.symbol_id);
|
|
259
|
+
all.push(row);
|
|
260
|
+
nextFrontier.push(row.symbol_id);
|
|
261
|
+
}
|
|
262
|
+
frontier = nextFrontier;
|
|
263
|
+
}
|
|
264
|
+
return all;
|
|
265
|
+
}
|
|
266
|
+
// ─── Handler ──────────────────────────────────────────────────────────────────
|
|
267
|
+
const DEFAULT_LIMIT = 200;
|
|
268
|
+
/** Unified reverse-dependency / blast-radius query. */
|
|
269
|
+
export function handler(db, args) {
|
|
270
|
+
const depth = Math.max(1, Math.min(args.depth ?? 1, 5));
|
|
271
|
+
const compact = args.compact ?? false;
|
|
272
|
+
const limit = DEFAULT_LIMIT;
|
|
273
|
+
if (args.kind === 'file') {
|
|
274
|
+
return handleFileDependents(db, args, depth, compact, limit);
|
|
275
|
+
}
|
|
276
|
+
return handleSymbolDependents(db, args, depth, compact, limit);
|
|
277
|
+
}
|
|
278
|
+
function handleFileDependents(db, args, depth, compact, limit) {
|
|
279
|
+
const file = getFileByPath(db, args.query, args.branch);
|
|
280
|
+
if (!file) {
|
|
281
|
+
return { error: `No file found matching path "${args.query}"` };
|
|
282
|
+
}
|
|
283
|
+
const target = {
|
|
284
|
+
id: file.id,
|
|
285
|
+
name: file.path,
|
|
286
|
+
kind: 'file',
|
|
287
|
+
file: file.path,
|
|
288
|
+
};
|
|
289
|
+
// Get importers of this file
|
|
290
|
+
const importerRows = expandImporters(db, [file.id], args.branch, depth, limit);
|
|
291
|
+
// Get symbols defined in this file, then find callers from other files
|
|
292
|
+
const symbolIds = getSymbolIdsInFiles(db, [file.id], args.branch);
|
|
293
|
+
const callerRows = expandCallers(db, symbolIds, args.branch, depth, limit)
|
|
294
|
+
// Exclude callers that are within the same file
|
|
295
|
+
.filter((row) => row.caller_file !== file.path);
|
|
296
|
+
// For files, subclasses and type_references target symbols within the file
|
|
297
|
+
const subclassRows = expandSubclasses(db, symbolIds, args.branch, depth, limit);
|
|
298
|
+
const typeRefRows = queryTypeReferences(db, symbolIds, args.branch, limit);
|
|
299
|
+
return buildResult(target, callerRows, importerRows, subclassRows, typeRefRows, compact, depth);
|
|
300
|
+
}
|
|
301
|
+
function handleSymbolDependents(db, args, depth, compact, limit) {
|
|
302
|
+
const symbols = getSymbolsByName(db, args.query, {
|
|
303
|
+
branch: args.branch,
|
|
304
|
+
matchMode: 'exact',
|
|
305
|
+
});
|
|
306
|
+
if (symbols.length === 0) {
|
|
307
|
+
return { error: `No symbol found matching name "${args.query}"` };
|
|
308
|
+
}
|
|
309
|
+
// If multiple matches, use the first but if many are ambiguous, report
|
|
310
|
+
if (symbols.length > 5) {
|
|
311
|
+
return {
|
|
312
|
+
error: `Ambiguous: ${symbols.length} symbols match "${args.query}". Narrow your query with a more specific name.`,
|
|
313
|
+
candidates: symbols.slice(0, 10).map((s) => {
|
|
314
|
+
const file = getFileById(db, s.file_id, args.branch);
|
|
315
|
+
return { id: s.id, name: s.name, kind: s.kind, file: file?.path ?? '' };
|
|
316
|
+
}),
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
// Use the best match (first result). If there are a few, aggregate across all.
|
|
320
|
+
const symbolIds = symbols.map((s) => s.id);
|
|
321
|
+
const primarySymbol = symbols[0];
|
|
322
|
+
const primaryFile = getFileById(db, primarySymbol.file_id, args.branch);
|
|
323
|
+
const target = {
|
|
324
|
+
id: primarySymbol.id,
|
|
325
|
+
name: primarySymbol.name,
|
|
326
|
+
kind: primarySymbol.kind,
|
|
327
|
+
file: primaryFile?.path,
|
|
328
|
+
};
|
|
329
|
+
const callerRows = expandCallers(db, symbolIds, args.branch, depth, limit);
|
|
330
|
+
const subclassRows = expandSubclasses(db, symbolIds, args.branch, depth, limit);
|
|
331
|
+
const typeRefRows = queryTypeReferences(db, symbolIds, args.branch, limit);
|
|
332
|
+
// For symbols, importers are files that import the file containing this symbol
|
|
333
|
+
const fileIds = [...new Set(symbols.map((s) => s.file_id))];
|
|
334
|
+
const importerRows = expandImporters(db, fileIds, args.branch, depth, limit);
|
|
335
|
+
return buildResult(target, callerRows, importerRows, subclassRows, typeRefRows, compact, depth);
|
|
336
|
+
}
|
|
337
|
+
function buildResult(target, callerRows, importerRows, subclassRows, typeRefRows, compact, depth) {
|
|
338
|
+
const callers = compact ? callerRows.map(compactCaller) : callerRows;
|
|
339
|
+
const importers = compact ? importerRows.map(compactImporter) : importerRows;
|
|
340
|
+
const subclasses = compact ? subclassRows.map(compactSubclass) : subclassRows;
|
|
341
|
+
const typeRefs = compact ? typeRefRows.map(compactTypeRef) : typeRefRows;
|
|
342
|
+
return {
|
|
343
|
+
target,
|
|
344
|
+
dependents: {
|
|
345
|
+
callers,
|
|
346
|
+
importers,
|
|
347
|
+
subclasses,
|
|
348
|
+
type_references: typeRefs,
|
|
349
|
+
},
|
|
350
|
+
depth_used: depth,
|
|
351
|
+
total_count: callers.length + importers.length + subclasses.length + typeRefs.length,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=dependents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependents.js","sourceRoot":"","sources":["../../../src/server/tools/dependents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,gBAAgB,EAChB,aAAa,EAEb,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAE/B,iFAAiF;AAEjF,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,2GAA2G;QAC3G,uHAAuH;QACvH,2GAA2G;QAC3G,yIAAyI;QACzI,8FAA8F;IAChG,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8DAA8D;aAC5E;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACxB,WAAW,EACT,iFAAiF;aACpF;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,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CAAC;IAC9E,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;IAEzE,OAAO;QACL,MAAM;QACN,UAAU,EAAE;YACV,OAAO;YACP,SAAS;YACT,UAAU;YACV,eAAe,EAAE,QAAQ;SAC1B;QACD,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM;KACrF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module lore-server/tools/diff
|
|
3
|
+
*
|
|
4
|
+
* MCP tool: compare exported symbols between two indexed branches.
|
|
5
|
+
*/
|
|
6
|
+
import type { Database } from '../../db/read-only.js';
|
|
7
|
+
export declare const toolDef: {
|
|
8
|
+
readonly name: "lore_diff";
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly inputSchema: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly properties: {
|
|
13
|
+
readonly old_branch: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "The baseline branch to diff from.";
|
|
16
|
+
};
|
|
17
|
+
readonly new_branch: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "The target branch to diff to. Defaults to the most recently indexed branch.";
|
|
20
|
+
};
|
|
21
|
+
readonly path_prefix: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly description: "Limit results to files whose path starts with this prefix.";
|
|
24
|
+
};
|
|
25
|
+
readonly kind: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly description: "Limit results to symbols of this kind (e.g. \"function\", \"class\").";
|
|
28
|
+
};
|
|
29
|
+
readonly limit: {
|
|
30
|
+
readonly type: "integer";
|
|
31
|
+
readonly description: "Max entries per result array (default 50, max 500).";
|
|
32
|
+
readonly minimum: 1;
|
|
33
|
+
readonly maximum: 500;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly required: readonly ["old_branch"];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export interface DiffArgs {
|
|
40
|
+
old_branch: string;
|
|
41
|
+
new_branch?: string;
|
|
42
|
+
path_prefix?: string;
|
|
43
|
+
kind?: string;
|
|
44
|
+
limit?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface DiffEntry {
|
|
47
|
+
name: string;
|
|
48
|
+
kind: string;
|
|
49
|
+
file_path: string;
|
|
50
|
+
signature: string | null;
|
|
51
|
+
}
|
|
52
|
+
export interface ChangedEntry {
|
|
53
|
+
name: string;
|
|
54
|
+
kind: string;
|
|
55
|
+
file_path: string;
|
|
56
|
+
old_signature: string | null;
|
|
57
|
+
new_signature: string | null;
|
|
58
|
+
}
|
|
59
|
+
export interface DiffResult {
|
|
60
|
+
old_branch: string;
|
|
61
|
+
new_branch: string;
|
|
62
|
+
added: DiffEntry[];
|
|
63
|
+
removed: DiffEntry[];
|
|
64
|
+
changed: ChangedEntry[];
|
|
65
|
+
summary: {
|
|
66
|
+
added_count: number;
|
|
67
|
+
removed_count: number;
|
|
68
|
+
changed_count: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Compare exported symbols between two indexed branches. */
|
|
72
|
+
export declare function handler(db: Database.Database, args: DiffArgs): DiffResult;
|
|
73
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../../src/server/tools/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCV,CAAC;AAIX,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;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