@ttsc/graph 0.16.4 → 0.16.5
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/LICENSE +21 -21
- package/README.md +24 -53
- package/lib/TtscGraphApplication.js +46 -0
- package/lib/TtscGraphApplication.js.map +1 -0
- package/lib/index.js +31 -108
- package/lib/index.js.map +1 -1
- package/lib/model/TtscGraphMemory.js +185 -0
- package/lib/model/TtscGraphMemory.js.map +1 -0
- package/lib/model/loadGraph.js +418 -0
- package/lib/model/loadGraph.js.map +1 -0
- package/lib/reduce.js +101 -0
- package/lib/reduce.js.map +1 -0
- package/lib/resolveGraphBinary.js +42 -0
- package/lib/resolveGraphBinary.js.map +1 -0
- package/lib/server/createServer.js +1227 -0
- package/lib/server/createServer.js.map +1 -0
- package/lib/server/instructions.js +32 -0
- package/lib/server/instructions.js.map +1 -0
- package/lib/server/resolveHandle.js +25 -0
- package/lib/server/resolveHandle.js.map +1 -0
- package/lib/server/runExpand.js +177 -0
- package/lib/server/runExpand.js.map +1 -0
- package/lib/server/runIndex.js +146 -0
- package/lib/server/runIndex.js.map +1 -0
- package/lib/server/runOverview.js +150 -0
- package/lib/server/runOverview.js.map +1 -0
- package/lib/server/runQuery.js +147 -0
- package/lib/server/runQuery.js.map +1 -0
- package/lib/server/runTrace.js +219 -0
- package/lib/server/runTrace.js.map +1 -0
- package/lib/server/startServer.js +21 -0
- package/lib/server/startServer.js.map +1 -0
- package/lib/structures/ITtscGraphApplication.js +3 -0
- package/lib/structures/ITtscGraphApplication.js.map +1 -0
- package/lib/structures/ITtscGraphDecorator.js +3 -0
- package/lib/structures/ITtscGraphDecorator.js.map +1 -0
- package/lib/structures/ITtscGraphDiagnostic.js +3 -0
- package/lib/structures/ITtscGraphDiagnostic.js.map +1 -0
- package/lib/structures/ITtscGraphDump.js +3 -0
- package/lib/structures/ITtscGraphDump.js.map +1 -0
- package/lib/structures/ITtscGraphEdge.js +3 -0
- package/lib/structures/ITtscGraphEdge.js.map +1 -0
- package/lib/structures/ITtscGraphEvidence.js +3 -0
- package/lib/structures/ITtscGraphEvidence.js.map +1 -0
- package/lib/structures/ITtscGraphExpand.js +3 -0
- package/lib/structures/ITtscGraphExpand.js.map +1 -0
- package/lib/structures/ITtscGraphIndex.js +3 -0
- package/lib/structures/ITtscGraphIndex.js.map +1 -0
- package/lib/structures/ITtscGraphNode.js +3 -0
- package/lib/structures/ITtscGraphNode.js.map +1 -0
- package/lib/structures/ITtscGraphOverview.js +3 -0
- package/lib/structures/ITtscGraphOverview.js.map +1 -0
- package/lib/structures/ITtscGraphQuery.js +3 -0
- package/lib/structures/ITtscGraphQuery.js.map +1 -0
- package/lib/structures/ITtscGraphTrace.js +3 -0
- package/lib/structures/ITtscGraphTrace.js.map +1 -0
- package/lib/structures/TtscGraphEdgeKind.js +3 -0
- package/lib/structures/TtscGraphEdgeKind.js.map +1 -0
- package/lib/structures/TtscGraphNodeKind.js +3 -0
- package/lib/structures/TtscGraphNodeKind.js.map +1 -0
- package/lib/structures/TtscGraphNodeModifier.js +3 -0
- package/lib/structures/TtscGraphNodeModifier.js.map +1 -0
- package/lib/structures/index.js +37 -0
- package/lib/structures/index.js.map +1 -0
- package/lib/view.js +140 -0
- package/lib/view.js.map +1 -0
- package/lib/viewer/index.html +123 -0
- package/lib/viewer/viewer.js +4610 -0
- package/package.json +17 -4
- package/src/TtscGraphApplication.ts +57 -0
- package/src/index.ts +40 -126
- package/src/model/TtscGraphMemory.ts +204 -0
- package/src/model/loadGraph.ts +85 -0
- package/src/reduce.ts +165 -0
- package/src/resolveGraphBinary.ts +40 -0
- package/src/server/createServer.ts +104 -0
- package/src/server/instructions.ts +28 -0
- package/src/server/resolveHandle.ts +34 -0
- package/src/server/runExpand.ts +186 -0
- package/src/server/runIndex.ts +181 -0
- package/src/server/runOverview.ts +154 -0
- package/src/server/runQuery.ts +150 -0
- package/src/server/runTrace.ts +233 -0
- package/src/server/startServer.ts +25 -0
- package/src/structures/ITtscGraphApplication.ts +68 -0
- package/src/structures/ITtscGraphDecorator.ts +33 -0
- package/src/structures/ITtscGraphDiagnostic.ts +34 -0
- package/src/structures/ITtscGraphDump.ts +35 -0
- package/src/structures/ITtscGraphEdge.ts +24 -0
- package/src/structures/ITtscGraphEvidence.ts +29 -0
- package/src/structures/ITtscGraphExpand.ts +85 -0
- package/src/structures/ITtscGraphIndex.ts +100 -0
- package/src/structures/ITtscGraphNode.ts +64 -0
- package/src/structures/ITtscGraphOverview.ts +79 -0
- package/src/structures/ITtscGraphQuery.ts +49 -0
- package/src/structures/ITtscGraphTrace.ts +97 -0
- package/src/structures/TtscGraphEdgeKind.ts +23 -0
- package/src/structures/TtscGraphNodeKind.ts +26 -0
- package/src/structures/TtscGraphNodeModifier.ts +19 -0
- package/src/structures/index.ts +21 -0
- package/src/view.ts +155 -0
- package/src/viewer/index.html +123 -0
- package/src/viewer/main.ts +209 -0
- package/lib/bin.d.ts +0 -2
- package/lib/diagnostics.d.ts +0 -23
- package/lib/diagnostics.js +0 -84
- package/lib/diagnostics.js.map +0 -1
- package/lib/index.d.ts +0 -29
- package/src/diagnostics.ts +0 -93
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createServer.js","sourceRoot":"","sources":["../../src/server/createServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAoE;AACpE,iEAG4C;AAC5C,kDAA0B;AAE1B,kEAAgF;AAGhF,iDAA8C;AAE9C;;;;;;;;;;;;;GAaG;AACH,sBACE,KAAsB,EACtB,OAAe;IAEf,MAAM,UAAU;;gBACd,OAAO;mBACP,IAAI,2CAAoB,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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|
4
|
+
/**
|
|
5
|
+
* The guidance delivered in the MCP initialize response. It is the only place
|
|
6
|
+
* the agent is told how to use the graph; nothing is written to its config
|
|
7
|
+
* files. Keep it short; the per-tool descriptions carry the detail.
|
|
8
|
+
*/
|
|
9
|
+
exports.instructions = `
|
|
10
|
+
This TypeScript project is indexed by the compiler. Use the graph as the first
|
|
11
|
+
source of codebase coordinates: it has already resolved symbols and the
|
|
12
|
+
relationships between them.
|
|
13
|
+
|
|
14
|
+
- graph_index: first call for source questions. It returns ranked symbols,
|
|
15
|
+
declaration signatures, directly mentioned code handles, and nearby dependency
|
|
16
|
+
context without source bodies.
|
|
17
|
+
- graph_overview: the architecture, layers, hotspots, and public API.
|
|
18
|
+
- graph_query: find any symbol by name or description; each hit carries its
|
|
19
|
+
signature, usually enough to answer without expanding. Use next.expand when
|
|
20
|
+
you need bodies.
|
|
21
|
+
- graph_trace: follow a flow forward, reverse, or to its impact; or give dotted
|
|
22
|
+
from/to names for the path between two symbols, how A reaches B, in one call.
|
|
23
|
+
- graph_expand: a symbol's declared shape, its signature, and a container's
|
|
24
|
+
members; source:true to read a specific TypeScript body after graph_index,
|
|
25
|
+
graph_query, or graph_trace has located it.
|
|
26
|
+
|
|
27
|
+
Answer in as few calls as you can. For TypeScript declarations, read source with
|
|
28
|
+
graph_expand(source:true) on the resolved handles. Use shell or file reads only
|
|
29
|
+
for a non-TypeScript file, generated output, or an exact literal text search that
|
|
30
|
+
is not represented as symbols or edges.
|
|
31
|
+
`.trim();
|
|
32
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../../src/server/instructions.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsB3B,CAAC,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveGraphHandle = resolveGraphHandle;
|
|
4
|
+
/** Resolve a tool handle as an id, exact symbol name, or dotted suffix. */
|
|
5
|
+
function resolveGraphHandle(graph, handle, candidateLimit = 12) {
|
|
6
|
+
const byId = graph.node(handle);
|
|
7
|
+
if (byId !== undefined)
|
|
8
|
+
return { node: byId };
|
|
9
|
+
const exact = graph.symbols(handle);
|
|
10
|
+
if (exact.length === 1)
|
|
11
|
+
return { node: exact[0] };
|
|
12
|
+
if (exact.length > 1)
|
|
13
|
+
return { candidates: exact.slice(0, candidateLimit) };
|
|
14
|
+
if (handle.includes(".")) {
|
|
15
|
+
const suffix = `.${handle}`;
|
|
16
|
+
const suffixMatches = graph.nodes.filter((node) => node.kind !== "file" && node.qualifiedName?.endsWith(suffix) === true);
|
|
17
|
+
if (suffixMatches.length === 1)
|
|
18
|
+
return { node: suffixMatches[0] };
|
|
19
|
+
if (suffixMatches.length > 1) {
|
|
20
|
+
return { candidates: suffixMatches.slice(0, candidateLimit) };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=resolveHandle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveHandle.js","sourceRoot":"","sources":["../../src/server/resolveHandle.ts"],"names":[],"mappings":";;;AAQA,2EAA2E;AAC3E,4BACE,KAAsB,EACtB,MAAc,EACd,cAAc,GAAG,EAAE;IAEnB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAE9C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAClD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC;IAE5E,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAC5B,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CACtC,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,CACxE,CAAC;QACF,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,EAAE,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC;QAChE,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runExpand = runExpand;
|
|
7
|
+
exports.signatureOf = signatureOf;
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const resolveHandle_1 = require("./resolveHandle");
|
|
11
|
+
// A whole declaration body can be large, so the full source is opt-in and capped
|
|
12
|
+
// when asked for; the default response carries only the declared shape.
|
|
13
|
+
const MAX_SOURCE_LINES = 200;
|
|
14
|
+
// A signature is the declaration head up to the body brace — a handful of lines.
|
|
15
|
+
const MAX_SIGNATURE_LINES = 6;
|
|
16
|
+
// Neighbor lists are a map, not a dump; keep them scannable.
|
|
17
|
+
const MAX_NEIGHBORS = 40;
|
|
18
|
+
// A container's outline can be long (a big class); keep it bounded.
|
|
19
|
+
const MAX_MEMBERS = 80;
|
|
20
|
+
// Structural relationships are navigation, not the dependency picture expand is for.
|
|
21
|
+
const STRUCTURAL_KINDS = new Set(["contains", "exports", "imports"]);
|
|
22
|
+
// Kinds whose value is their member outline, not a source body.
|
|
23
|
+
const CONTAINER_KINDS = new Set([
|
|
24
|
+
"class",
|
|
25
|
+
"interface",
|
|
26
|
+
"namespace",
|
|
27
|
+
"module",
|
|
28
|
+
"enum",
|
|
29
|
+
"file",
|
|
30
|
+
]);
|
|
31
|
+
/**
|
|
32
|
+
* Resolve each handle to its declared shape — its signature, and for a
|
|
33
|
+
* container the outline of its members — and, only when asked, its full source
|
|
34
|
+
* body. This is the graph's edge over a plain file read: it answers from the
|
|
35
|
+
* resolved structure it already holds, so the agent reads compact shape, not
|
|
36
|
+
* inlined code, unless it explicitly needs a body's logic.
|
|
37
|
+
*/
|
|
38
|
+
function runExpand(graph, props) {
|
|
39
|
+
const wantSource = props.source === true;
|
|
40
|
+
const nodes = [];
|
|
41
|
+
const unknown = [];
|
|
42
|
+
for (const handle of props.handles) {
|
|
43
|
+
const resolved = (0, resolveHandle_1.resolveGraphHandle)(graph, handle);
|
|
44
|
+
if (resolved.node === undefined) {
|
|
45
|
+
unknown.push(handle);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const node = resolved.node;
|
|
49
|
+
const expanded = {
|
|
50
|
+
id: node.id,
|
|
51
|
+
name: node.qualifiedName ?? node.name,
|
|
52
|
+
kind: node.kind,
|
|
53
|
+
file: node.file,
|
|
54
|
+
};
|
|
55
|
+
if (node.evidence?.startLine)
|
|
56
|
+
expanded.line = node.evidence.startLine;
|
|
57
|
+
const sig = signatureOf(graph.project, node);
|
|
58
|
+
if (sig !== undefined)
|
|
59
|
+
expanded.signature = sig;
|
|
60
|
+
if (CONTAINER_KINDS.has(node.kind)) {
|
|
61
|
+
const list = members(graph, node);
|
|
62
|
+
if (list.length > 0)
|
|
63
|
+
expanded.members = list;
|
|
64
|
+
}
|
|
65
|
+
if (wantSource) {
|
|
66
|
+
const source = readSource(graph.project, node);
|
|
67
|
+
if (source !== undefined) {
|
|
68
|
+
expanded.source = source.text;
|
|
69
|
+
if (source.truncated)
|
|
70
|
+
expanded.truncated = true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (props.neighbors === true) {
|
|
74
|
+
expanded.dependsOn = refs(graph, graph.outgoing(node.id), "to");
|
|
75
|
+
expanded.dependedOnBy = refs(graph, graph.incoming(node.id), "from");
|
|
76
|
+
}
|
|
77
|
+
nodes.push(expanded);
|
|
78
|
+
}
|
|
79
|
+
return { nodes, unknown };
|
|
80
|
+
}
|
|
81
|
+
/** The members a container owns (via `contains`), each with its own signature. */
|
|
82
|
+
function members(graph, node) {
|
|
83
|
+
const out = [];
|
|
84
|
+
for (const edge of graph.outgoing(node.id)) {
|
|
85
|
+
if (edge.kind !== "contains")
|
|
86
|
+
continue;
|
|
87
|
+
const member = graph.node(edge.to);
|
|
88
|
+
if (member === undefined)
|
|
89
|
+
continue;
|
|
90
|
+
const m = {
|
|
91
|
+
name: member.qualifiedName ?? member.name,
|
|
92
|
+
kind: member.kind,
|
|
93
|
+
};
|
|
94
|
+
if (member.evidence?.startLine)
|
|
95
|
+
m.line = member.evidence.startLine;
|
|
96
|
+
const sig = signatureOf(graph.project, member);
|
|
97
|
+
if (sig !== undefined)
|
|
98
|
+
m.signature = sig;
|
|
99
|
+
out.push(m);
|
|
100
|
+
if (out.length >= MAX_MEMBERS)
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
105
|
+
/** Map dependency edges to references on their far endpoint, dropping structure. */
|
|
106
|
+
function refs(graph, edges, end) {
|
|
107
|
+
const out = [];
|
|
108
|
+
for (const edge of edges) {
|
|
109
|
+
if (STRUCTURAL_KINDS.has(edge.kind))
|
|
110
|
+
continue;
|
|
111
|
+
const other = graph.node(end === "to" ? edge.to : edge.from);
|
|
112
|
+
if (other === undefined)
|
|
113
|
+
continue;
|
|
114
|
+
out.push({
|
|
115
|
+
id: other.id,
|
|
116
|
+
name: other.qualifiedName ?? other.name,
|
|
117
|
+
kind: other.kind,
|
|
118
|
+
relation: edge.kind,
|
|
119
|
+
});
|
|
120
|
+
if (out.length >= MAX_NEIGHBORS)
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
return out;
|
|
124
|
+
}
|
|
125
|
+
/** Read a file's lines once, or undefined when it cannot be read. */
|
|
126
|
+
function fileLines(project, node) {
|
|
127
|
+
if (node.evidence === undefined || node.file === "")
|
|
128
|
+
return undefined;
|
|
129
|
+
try {
|
|
130
|
+
return node_fs_1.default
|
|
131
|
+
.readFileSync(node_path_1.default.join(project, node.file), "utf8")
|
|
132
|
+
.split(/\r?\n/);
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The declaration signature: the head of the declaration up to and including
|
|
140
|
+
* the line that opens its body (`{`), or the single declaration line when there
|
|
141
|
+
* is no brace, capped so a wrapped signature cannot run away.
|
|
142
|
+
*/
|
|
143
|
+
function signatureOf(project, node) {
|
|
144
|
+
const lines = fileLines(project, node);
|
|
145
|
+
const evidence = node.evidence;
|
|
146
|
+
if (lines === undefined || evidence === undefined)
|
|
147
|
+
return undefined;
|
|
148
|
+
const start = Math.max(0, evidence.startLine - 1);
|
|
149
|
+
const out = [];
|
|
150
|
+
for (let i = start; i < lines.length && out.length < MAX_SIGNATURE_LINES; i++) {
|
|
151
|
+
const line = lines[i];
|
|
152
|
+
if (line === undefined)
|
|
153
|
+
break;
|
|
154
|
+
out.push(line);
|
|
155
|
+
if (line.includes("{"))
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
const text = out.join("\n").trim();
|
|
159
|
+
return text === "" ? undefined : text;
|
|
160
|
+
}
|
|
161
|
+
/** Slice a node's full declaration source from disk, capped at MAX_SOURCE_LINES. */
|
|
162
|
+
function readSource(project, node) {
|
|
163
|
+
const lines = fileLines(project, node);
|
|
164
|
+
const evidence = node.evidence;
|
|
165
|
+
if (lines === undefined || evidence === undefined)
|
|
166
|
+
return undefined;
|
|
167
|
+
const start = Math.max(0, evidence.startLine - 1);
|
|
168
|
+
const end = Math.min(evidence.endLine ?? evidence.startLine, lines.length);
|
|
169
|
+
let slice = lines.slice(start, Math.max(start + 1, end));
|
|
170
|
+
let truncated = false;
|
|
171
|
+
if (slice.length > MAX_SOURCE_LINES) {
|
|
172
|
+
slice = slice.slice(0, MAX_SOURCE_LINES);
|
|
173
|
+
truncated = true;
|
|
174
|
+
}
|
|
175
|
+
return { text: slice.join("\n"), truncated };
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=runExpand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runExpand.js","sourceRoot":"","sources":["../../src/server/runExpand.ts"],"names":[],"mappings":";;;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAM7B,mDAAqD;AAErD,iFAAiF;AACjF,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,iFAAiF;AACjF,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,6DAA6D;AAC7D,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,oEAAoE;AACpE,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAC7E,gEAAgE;AAChE,MAAM,eAAe,GA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;IACnC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC;AAED,oFAAoF;AACpF,SAAS,UAAU,CACjB,OAAe,EACf,IAAoB;IAEpB,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,IAAI,KAAK,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3E,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACzD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,KAAK,CAAC,MAAM,GAAG,gBAAgB,EAAE,CAAC;QACpC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;QACzC,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runIndex = runIndex;
|
|
4
|
+
const resolveHandle_1 = require("./resolveHandle");
|
|
5
|
+
const runExpand_1 = require("./runExpand");
|
|
6
|
+
const runQuery_1 = require("./runQuery");
|
|
7
|
+
const DEFAULT_LIMIT = 8;
|
|
8
|
+
const MAX_LIMIT = 20;
|
|
9
|
+
const DEFAULT_NEIGHBORS = 4;
|
|
10
|
+
const MAX_NEIGHBORS = 8;
|
|
11
|
+
const MAX_SEEDS = 6;
|
|
12
|
+
const STRUCTURAL_KINDS = new Set(["contains", "exports", "imports"]);
|
|
13
|
+
/**
|
|
14
|
+
* Build the first source-free index for a code question. The result gives the
|
|
15
|
+
* model stable handles, declaration signatures, and direct graph context. It is
|
|
16
|
+
* deliberately not a source reader; source remains opt-in through
|
|
17
|
+
* graph_expand.
|
|
18
|
+
*/
|
|
19
|
+
function runIndex(graph, props) {
|
|
20
|
+
const query = props.query.trim();
|
|
21
|
+
const limit = bound(props.limit, DEFAULT_LIMIT, 1, MAX_LIMIT);
|
|
22
|
+
const neighborLimit = bound(props.neighbors, DEFAULT_NEIGHBORS, 0, MAX_NEIGHBORS);
|
|
23
|
+
const queryResult = (0, runQuery_1.runQuery)(graph, { query, limit });
|
|
24
|
+
const hits = queryResult.hits.map((hit) => ({ ...hit }));
|
|
25
|
+
const mentions = directMentions(query).map((handle) => {
|
|
26
|
+
const resolved = (0, resolveHandle_1.resolveGraphHandle)(graph, handle, 6);
|
|
27
|
+
const mention = { handle };
|
|
28
|
+
if (resolved.node !== undefined)
|
|
29
|
+
mention.node = nodeOf(graph, resolved.node);
|
|
30
|
+
if (resolved.candidates !== undefined) {
|
|
31
|
+
mention.candidates = resolved.candidates.map((node) => nodeOf(graph, node));
|
|
32
|
+
}
|
|
33
|
+
return mention;
|
|
34
|
+
});
|
|
35
|
+
const seeds = [];
|
|
36
|
+
const seen = new Set();
|
|
37
|
+
const addSeed = (node) => {
|
|
38
|
+
if (node === undefined || seen.has(node.id))
|
|
39
|
+
return;
|
|
40
|
+
seen.add(node.id);
|
|
41
|
+
seeds.push(node);
|
|
42
|
+
};
|
|
43
|
+
for (const mention of mentions) {
|
|
44
|
+
if (mention.node !== undefined)
|
|
45
|
+
addSeed(graph.node(mention.node.id));
|
|
46
|
+
}
|
|
47
|
+
for (const hit of hits)
|
|
48
|
+
addSeed(graph.node(hit.id));
|
|
49
|
+
let truncated = seeds.length > MAX_SEEDS;
|
|
50
|
+
const neighborhood = [];
|
|
51
|
+
for (const seed of seeds.slice(0, MAX_SEEDS)) {
|
|
52
|
+
const outgoing = refs(graph, graph.outgoing(seed.id), "to", neighborLimit);
|
|
53
|
+
const incoming = refs(graph, graph.incoming(seed.id), "from", neighborLimit);
|
|
54
|
+
if (outgoing.truncated || incoming.truncated)
|
|
55
|
+
truncated = true;
|
|
56
|
+
neighborhood.push({
|
|
57
|
+
...nodeOf(graph, seed),
|
|
58
|
+
dependsOn: outgoing.items,
|
|
59
|
+
dependedOnBy: incoming.items,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
query,
|
|
64
|
+
hits,
|
|
65
|
+
mentions,
|
|
66
|
+
neighborhood,
|
|
67
|
+
next: {
|
|
68
|
+
expand: seeds.slice(0, MAX_SEEDS).map((node) => node.id),
|
|
69
|
+
traceFrom: mentions
|
|
70
|
+
.map((mention) => mention.node?.id)
|
|
71
|
+
.filter((id) => id !== undefined),
|
|
72
|
+
},
|
|
73
|
+
...(truncated ? { truncated: true } : {}),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function nodeOf(graph, node) {
|
|
77
|
+
const out = {
|
|
78
|
+
id: node.id,
|
|
79
|
+
name: node.qualifiedName ?? node.name,
|
|
80
|
+
kind: node.kind,
|
|
81
|
+
file: node.file,
|
|
82
|
+
};
|
|
83
|
+
if (node.evidence?.startLine !== undefined)
|
|
84
|
+
out.line = node.evidence.startLine;
|
|
85
|
+
const signature = (0, runExpand_1.signatureOf)(graph.project, node);
|
|
86
|
+
if (signature !== undefined)
|
|
87
|
+
out.signature = signature;
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
function refOf(node, edge) {
|
|
91
|
+
const out = {
|
|
92
|
+
id: node.id,
|
|
93
|
+
name: node.qualifiedName ?? node.name,
|
|
94
|
+
kind: node.kind,
|
|
95
|
+
file: node.file,
|
|
96
|
+
relation: edge.kind,
|
|
97
|
+
};
|
|
98
|
+
if (node.evidence?.startLine !== undefined)
|
|
99
|
+
out.line = node.evidence.startLine;
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
function refs(graph, edges, end, limit) {
|
|
103
|
+
const items = [];
|
|
104
|
+
const seen = new Set();
|
|
105
|
+
let available = 0;
|
|
106
|
+
for (const edge of edges) {
|
|
107
|
+
if (STRUCTURAL_KINDS.has(edge.kind))
|
|
108
|
+
continue;
|
|
109
|
+
const other = graph.node(end === "to" ? edge.to : edge.from);
|
|
110
|
+
if (other === undefined || other.kind === "file")
|
|
111
|
+
continue;
|
|
112
|
+
const key = `${edge.kind}:${other.id}`;
|
|
113
|
+
if (seen.has(key))
|
|
114
|
+
continue;
|
|
115
|
+
seen.add(key);
|
|
116
|
+
available++;
|
|
117
|
+
if (items.length < limit)
|
|
118
|
+
items.push(refOf(other, edge));
|
|
119
|
+
}
|
|
120
|
+
return { items, truncated: available > items.length };
|
|
121
|
+
}
|
|
122
|
+
function directMentions(query) {
|
|
123
|
+
const handles = new Set();
|
|
124
|
+
for (const match of query.matchAll(/`([^`]+)`/g)) {
|
|
125
|
+
const handle = normalizeHandle(match[1] ?? "");
|
|
126
|
+
if (handle !== undefined)
|
|
127
|
+
handles.add(handle);
|
|
128
|
+
}
|
|
129
|
+
for (const match of query.matchAll(/\b[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+\b/g)) {
|
|
130
|
+
const handle = normalizeHandle(match[0]);
|
|
131
|
+
if (handle !== undefined)
|
|
132
|
+
handles.add(handle);
|
|
133
|
+
}
|
|
134
|
+
return [...handles];
|
|
135
|
+
}
|
|
136
|
+
function normalizeHandle(raw) {
|
|
137
|
+
const value = raw.trim();
|
|
138
|
+
return /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(value)
|
|
139
|
+
? value
|
|
140
|
+
: undefined;
|
|
141
|
+
}
|
|
142
|
+
function bound(value, fallback, min, max) {
|
|
143
|
+
const n = value === undefined || !Number.isFinite(value) ? fallback : value;
|
|
144
|
+
return Math.max(min, Math.min(max, Math.floor(n)));
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=runIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runIndex.js","sourceRoot":"","sources":["../../src/server/runIndex.ts"],"names":[],"mappings":";;;AAIA,mDAAqD;AACrD,2CAA0C;AAC1C,yCAAsC;AAEtC,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,kBACE,KAAsB,EACtB,KAA6B;IAE7B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,KAAK,CACzB,KAAK,CAAC,SAAS,EACf,iBAAiB,EACjB,CAAC,EACD,aAAa,CACd,CAAC;IAEF,MAAM,WAAW,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CA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AChC,8CAA8C,CAC/C,EAAE,CAAC;QACF,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,eAAe,CAAC,GAAW;IAClC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACzB,OAAO,2CAA2C,CAAC,IAAI,CAAC,KAAK,CAAC;QAC5D,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,KAAK,CACZ,KAAyB,EACzB,QAAgB,EAChB,GAAW,EACX,GAAW;IAEX,MAAM,CAAC,GAAG,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5E,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runOverview = runOverview;
|
|
4
|
+
/** Edges that express nesting/packaging, not code dependency. */
|
|
5
|
+
const STRUCTURAL_KINDS = new Set(["contains", "exports", "imports"]);
|
|
6
|
+
/**
|
|
7
|
+
* Project a compact, source-read-free architecture map: counts by kind, folder
|
|
8
|
+
* layering with export density, the highest-dependency symbols (ranked by real
|
|
9
|
+
* fan-in/out, excluding structural edges so nesting does not masquerade as
|
|
10
|
+
* dependency), and the export surface by file. Output is bounded so a model
|
|
11
|
+
* reads structure cheaply.
|
|
12
|
+
*/
|
|
13
|
+
function runOverview(graph, props) {
|
|
14
|
+
const aspect = props.aspect ?? "all";
|
|
15
|
+
const want = (a) => aspect === "all" || aspect === a;
|
|
16
|
+
const byKind = {};
|
|
17
|
+
let files = 0;
|
|
18
|
+
for (const node of graph.nodes) {
|
|
19
|
+
byKind[node.kind] = (byKind[node.kind] ?? 0) + 1;
|
|
20
|
+
if (node.kind === "file")
|
|
21
|
+
files++;
|
|
22
|
+
}
|
|
23
|
+
const result = {
|
|
24
|
+
project: graph.project,
|
|
25
|
+
counts: {
|
|
26
|
+
files,
|
|
27
|
+
nodes: graph.nodes.length,
|
|
28
|
+
edges: graph.edges.length,
|
|
29
|
+
byKind,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
if (want("layers"))
|
|
33
|
+
result.layers = layers(graph);
|
|
34
|
+
if (want("hotspots"))
|
|
35
|
+
result.hotspots = hotspots(graph);
|
|
36
|
+
if (want("publicApi"))
|
|
37
|
+
result.publicApi = publicApi(graph);
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
/** Folder-level layering: how source and its export surface spread by directory. */
|
|
41
|
+
function layers(graph) {
|
|
42
|
+
const byDir = new Map();
|
|
43
|
+
for (const node of graph.nodes) {
|
|
44
|
+
if (node.external || node.kind === "file")
|
|
45
|
+
continue;
|
|
46
|
+
const dir = dirname(node.file);
|
|
47
|
+
let entry = byDir.get(dir);
|
|
48
|
+
if (!entry) {
|
|
49
|
+
entry = { files: new Set(), exported: 0 };
|
|
50
|
+
byDir.set(dir, entry);
|
|
51
|
+
}
|
|
52
|
+
entry.files.add(node.file);
|
|
53
|
+
if (node.exported)
|
|
54
|
+
entry.exported++;
|
|
55
|
+
}
|
|
56
|
+
return [...byDir.entries()]
|
|
57
|
+
.map(([dir, entry]) => ({
|
|
58
|
+
dir,
|
|
59
|
+
files: entry.files.size,
|
|
60
|
+
exported: entry.exported,
|
|
61
|
+
}))
|
|
62
|
+
.sort((a, b) => b.files - a.files)
|
|
63
|
+
.slice(0, 16);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The symbols at the center of the dependency graph, ranked by real fan-in and
|
|
67
|
+
* fan-out — structural `contains`/`exports`/`imports` edges are excluded so the
|
|
68
|
+
* ranking reflects code dependency, not nesting.
|
|
69
|
+
*/
|
|
70
|
+
function hotspots(graph) {
|
|
71
|
+
const real = (id, side) => {
|
|
72
|
+
const edges = side === "in" ? graph.incoming(id) : graph.outgoing(id);
|
|
73
|
+
let n = 0;
|
|
74
|
+
for (const edge of edges)
|
|
75
|
+
if (!STRUCTURAL_KINDS.has(edge.kind))
|
|
76
|
+
n++;
|
|
77
|
+
return n;
|
|
78
|
+
};
|
|
79
|
+
return graph.nodes
|
|
80
|
+
.filter((node) => !node.external && node.kind !== "file")
|
|
81
|
+
.map((node) => ({
|
|
82
|
+
id: node.id,
|
|
83
|
+
name: node.qualifiedName ?? node.name,
|
|
84
|
+
kind: node.kind,
|
|
85
|
+
file: node.file,
|
|
86
|
+
fanIn: real(node.id, "in"),
|
|
87
|
+
fanOut: real(node.id, "out"),
|
|
88
|
+
}))
|
|
89
|
+
.filter((h) => h.fanIn + h.fanOut > 0)
|
|
90
|
+
.sort((a, b) => b.fanIn + b.fanOut - (a.fanIn + a.fanOut))
|
|
91
|
+
.slice(0, 15);
|
|
92
|
+
}
|
|
93
|
+
/** Declaration kinds that make up a meaningful public API surface. */
|
|
94
|
+
const API_KINDS = new Set([
|
|
95
|
+
"class",
|
|
96
|
+
"interface",
|
|
97
|
+
"function",
|
|
98
|
+
"type",
|
|
99
|
+
"enum",
|
|
100
|
+
]);
|
|
101
|
+
/**
|
|
102
|
+
* The exported API surface: the exported symbols a consumer of the project would
|
|
103
|
+
* use, ranked by how depended-on each is (real fan-in/out, structural edges
|
|
104
|
+
* excluded). Ranking by dependency rather than by which file declares the most
|
|
105
|
+
* exports surfaces the load-bearing types (a DataSource, a SelectQueryBuilder)
|
|
106
|
+
* instead of whichever file bundles the most type aliases; test, typings, and
|
|
107
|
+
* generated files are dropped so they cannot crowd the real surface out.
|
|
108
|
+
*/
|
|
109
|
+
function publicApi(graph) {
|
|
110
|
+
const degree = (id) => {
|
|
111
|
+
let n = 0;
|
|
112
|
+
for (const edge of graph.outgoing(id))
|
|
113
|
+
if (!STRUCTURAL_KINDS.has(edge.kind))
|
|
114
|
+
n++;
|
|
115
|
+
for (const edge of graph.incoming(id))
|
|
116
|
+
if (!STRUCTURAL_KINDS.has(edge.kind))
|
|
117
|
+
n++;
|
|
118
|
+
return n;
|
|
119
|
+
};
|
|
120
|
+
return graph
|
|
121
|
+
.exported()
|
|
122
|
+
.filter((node) => API_KINDS.has(node.kind) && !isNoiseFile(node.file))
|
|
123
|
+
.map((node) => ({
|
|
124
|
+
name: node.qualifiedName ?? node.name,
|
|
125
|
+
kind: node.kind,
|
|
126
|
+
file: node.file,
|
|
127
|
+
degree: degree(node.id),
|
|
128
|
+
}))
|
|
129
|
+
.sort((a, b) => b.degree - a.degree)
|
|
130
|
+
.slice(0, 30)
|
|
131
|
+
.map(({ name, kind, file }) => ({ name, kind, file }));
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A file whose exports are noise for an architecture overview: a test, a
|
|
135
|
+
* dependency's bundled `.d.ts`/typings, or generated output. The conventions are
|
|
136
|
+
* universal (a `test`/`spec` path, a `typings` file), so excluding them is not
|
|
137
|
+
* framework-specific — it keeps the API surface to authored, used code.
|
|
138
|
+
*/
|
|
139
|
+
function isNoiseFile(file) {
|
|
140
|
+
return (/(^|\/)(test|tests|__tests__|spec|sample|samples)\//.test(file) ||
|
|
141
|
+
/\.(test|spec)\.[cm]?tsx?$/.test(file) ||
|
|
142
|
+
/(^|\/|\.)typings\.[cm]?ts$/.test(file) ||
|
|
143
|
+
/\.d\.[cm]?ts$/.test(file));
|
|
144
|
+
}
|
|
145
|
+
/** The parent directory of a project-relative path (`.` at the root). */
|
|
146
|
+
function dirname(file) {
|
|
147
|
+
const slash = file.lastIndexOf("/");
|
|
148
|
+
return slash >= 0 ? file.slice(0, slash) : ".";
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=runOverview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runOverview.js","sourceRoot":"","sources":["../../src/server/runOverview.ts"],"names":[],"mappings":";;;AAGA,iEAAiE;AACjE,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAE7E;;;;;;GAMG;AACH,qBACE,KAAsB,EACtB,KAAgC;IAEhC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC;IACrC,MAAM,IAAI,GAAG,CAAC,CAAsC,EAAW,EAAE,CAC/D,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,CAAC,CAAC;IAEnC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACjD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,KAAK,EAAE,CAAC;IACpC,CAAC;IAED,MAAM,MAAM,GAAuB;QACjC,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE;YACN,KAAK;YACL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;YACzB,MAAM;SACP;KACF,CAAC;IACF,IAAI,IAAI,CAAC,QAAQ,CAAC;QAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,IAAI,CAAC,UAAU,CAAC;QAAE,MAAM,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