@ttsc/graph 0.16.5 → 0.16.6
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/lib/TtscGraphApplication.js +36 -23
- package/lib/TtscGraphApplication.js.map +1 -1
- package/lib/model/loadGraph.js +17 -17
- package/lib/server/accessAliases.js +53 -0
- package/lib/server/accessAliases.js.map +1 -0
- package/lib/server/createServer.js +1133 -634
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/instructions.js +69 -21
- package/lib/server/instructions.js.map +1 -1
- package/lib/server/runDetails.js +413 -0
- package/lib/server/runDetails.js.map +1 -0
- package/lib/server/{runIndex.js → runEntrypoints.js} +91 -26
- package/lib/server/runEntrypoints.js.map +1 -0
- package/lib/server/{runQuery.js → runLookup.js} +102 -15
- package/lib/server/runLookup.js.map +1 -0
- package/lib/server/runOverview.js +31 -21
- package/lib/server/runOverview.js.map +1 -1
- package/lib/server/runTrace.js +133 -38
- package/lib/server/runTrace.js.map +1 -1
- package/lib/structures/{ITtscGraphQuery.js → ITtscGraphDetails.js} +1 -1
- package/lib/structures/ITtscGraphDetails.js.map +1 -0
- package/lib/structures/ITtscGraphEntrypoints.js +3 -0
- package/lib/structures/ITtscGraphEntrypoints.js.map +1 -0
- package/lib/structures/{ITtscGraphExpand.js → ITtscGraphEscape.js} +1 -1
- package/lib/structures/ITtscGraphEscape.js.map +1 -0
- package/lib/structures/{ITtscGraphIndex.js → ITtscGraphLookup.js} +1 -1
- package/lib/structures/ITtscGraphLookup.js.map +1 -0
- package/lib/structures/index.js +4 -3
- package/lib/structures/index.js.map +1 -1
- package/package.json +2 -2
- package/src/TtscGraphApplication.ts +39 -32
- package/src/server/accessAliases.ts +55 -0
- package/src/server/createServer.ts +4 -7
- package/src/server/instructions.ts +69 -21
- package/src/server/runDetails.ts +469 -0
- package/src/server/{runIndex.ts → runEntrypoints.ts} +109 -34
- package/src/server/{runQuery.ts → runLookup.ts} +123 -16
- package/src/server/runOverview.ts +35 -23
- package/src/server/runTrace.ts +164 -38
- package/src/structures/ITtscGraphApplication.ts +100 -52
- package/src/structures/ITtscGraphDecorator.ts +12 -14
- package/src/structures/ITtscGraphDetails.ts +134 -0
- package/src/structures/{ITtscGraphIndex.ts → ITtscGraphEntrypoints.ts} +34 -16
- package/src/structures/ITtscGraphEscape.ts +39 -0
- package/src/structures/ITtscGraphEvidence.ts +5 -8
- package/src/structures/ITtscGraphLookup.ts +61 -0
- package/src/structures/ITtscGraphNode.ts +10 -4
- package/src/structures/ITtscGraphOverview.ts +24 -16
- package/src/structures/ITtscGraphTrace.ts +54 -11
- package/src/structures/TtscGraphNodeKind.ts +2 -2
- package/src/structures/index.ts +4 -3
- package/lib/server/runExpand.js +0 -177
- package/lib/server/runExpand.js.map +0 -1
- package/lib/server/runIndex.js.map +0 -1
- package/lib/server/runQuery.js.map +0 -1
- package/lib/structures/ITtscGraphExpand.js.map +0 -1
- package/lib/structures/ITtscGraphIndex.js.map +0 -1
- package/lib/structures/ITtscGraphQuery.js.map +0 -1
- package/src/server/runExpand.ts +0 -186
- package/src/structures/ITtscGraphExpand.ts +0 -85
- package/src/structures/ITtscGraphQuery.ts +0 -49
package/lib/server/runExpand.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,IAAI,GAAG,CAAS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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ITtscGraphIndex.js","sourceRoot":"","sources":["../../src/structures/ITtscGraphIndex.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ITtscGraphQuery.js","sourceRoot":"","sources":["../../src/structures/ITtscGraphQuery.ts"],"names":[],"mappings":""}
|
package/src/server/runExpand.ts
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
import { TtscGraphMemory } from "../model/TtscGraphMemory";
|
|
5
|
-
import { ITtscGraphEdge } from "../structures/ITtscGraphEdge";
|
|
6
|
-
import { ITtscGraphExpand } from "../structures/ITtscGraphExpand";
|
|
7
|
-
import { ITtscGraphNode } from "../structures/ITtscGraphNode";
|
|
8
|
-
import { resolveGraphHandle } from "./resolveHandle";
|
|
9
|
-
|
|
10
|
-
// A whole declaration body can be large, so the full source is opt-in and capped
|
|
11
|
-
// when asked for; the default response carries only the declared shape.
|
|
12
|
-
const MAX_SOURCE_LINES = 200;
|
|
13
|
-
// A signature is the declaration head up to the body brace — a handful of lines.
|
|
14
|
-
const MAX_SIGNATURE_LINES = 6;
|
|
15
|
-
// Neighbor lists are a map, not a dump; keep them scannable.
|
|
16
|
-
const MAX_NEIGHBORS = 40;
|
|
17
|
-
// A container's outline can be long (a big class); keep it bounded.
|
|
18
|
-
const MAX_MEMBERS = 80;
|
|
19
|
-
// Structural relationships are navigation, not the dependency picture expand is for.
|
|
20
|
-
const STRUCTURAL_KINDS = new Set<string>(["contains", "exports", "imports"]);
|
|
21
|
-
// Kinds whose value is their member outline, not a source body.
|
|
22
|
-
const CONTAINER_KINDS = new Set<string>([
|
|
23
|
-
"class",
|
|
24
|
-
"interface",
|
|
25
|
-
"namespace",
|
|
26
|
-
"module",
|
|
27
|
-
"enum",
|
|
28
|
-
"file",
|
|
29
|
-
]);
|
|
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
|
-
export function runExpand(
|
|
39
|
-
graph: TtscGraphMemory,
|
|
40
|
-
props: ITtscGraphExpand.IProps,
|
|
41
|
-
): ITtscGraphExpand {
|
|
42
|
-
const wantSource = props.source === true;
|
|
43
|
-
const nodes: ITtscGraphExpand.INode[] = [];
|
|
44
|
-
const unknown: string[] = [];
|
|
45
|
-
for (const handle of props.handles) {
|
|
46
|
-
const resolved = resolveGraphHandle(graph, handle);
|
|
47
|
-
if (resolved.node === undefined) {
|
|
48
|
-
unknown.push(handle);
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
const node = resolved.node;
|
|
52
|
-
const expanded: ITtscGraphExpand.INode = {
|
|
53
|
-
id: node.id,
|
|
54
|
-
name: node.qualifiedName ?? node.name,
|
|
55
|
-
kind: node.kind,
|
|
56
|
-
file: node.file,
|
|
57
|
-
};
|
|
58
|
-
if (node.evidence?.startLine) expanded.line = node.evidence.startLine;
|
|
59
|
-
const sig = signatureOf(graph.project, node);
|
|
60
|
-
if (sig !== undefined) expanded.signature = sig;
|
|
61
|
-
if (CONTAINER_KINDS.has(node.kind)) {
|
|
62
|
-
const list = members(graph, node);
|
|
63
|
-
if (list.length > 0) 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) expanded.truncated = true;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (props.neighbors === true) {
|
|
73
|
-
expanded.dependsOn = refs(graph, graph.outgoing(node.id), "to");
|
|
74
|
-
expanded.dependedOnBy = refs(graph, graph.incoming(node.id), "from");
|
|
75
|
-
}
|
|
76
|
-
nodes.push(expanded);
|
|
77
|
-
}
|
|
78
|
-
return { nodes, unknown };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** The members a container owns (via `contains`), each with its own signature. */
|
|
82
|
-
function members(
|
|
83
|
-
graph: TtscGraphMemory,
|
|
84
|
-
node: ITtscGraphNode,
|
|
85
|
-
): ITtscGraphExpand.IMember[] {
|
|
86
|
-
const out: ITtscGraphExpand.IMember[] = [];
|
|
87
|
-
for (const edge of graph.outgoing(node.id)) {
|
|
88
|
-
if (edge.kind !== "contains") continue;
|
|
89
|
-
const member = graph.node(edge.to);
|
|
90
|
-
if (member === undefined) continue;
|
|
91
|
-
const m: ITtscGraphExpand.IMember = {
|
|
92
|
-
name: member.qualifiedName ?? member.name,
|
|
93
|
-
kind: member.kind,
|
|
94
|
-
};
|
|
95
|
-
if (member.evidence?.startLine) m.line = member.evidence.startLine;
|
|
96
|
-
const sig = signatureOf(graph.project, member);
|
|
97
|
-
if (sig !== undefined) m.signature = sig;
|
|
98
|
-
out.push(m);
|
|
99
|
-
if (out.length >= MAX_MEMBERS) break;
|
|
100
|
-
}
|
|
101
|
-
return out;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** Map dependency edges to references on their far endpoint, dropping structure. */
|
|
105
|
-
function refs(
|
|
106
|
-
graph: TtscGraphMemory,
|
|
107
|
-
edges: readonly ITtscGraphEdge[],
|
|
108
|
-
end: "to" | "from",
|
|
109
|
-
): ITtscGraphExpand.IReference[] {
|
|
110
|
-
const out: ITtscGraphExpand.IReference[] = [];
|
|
111
|
-
for (const edge of edges) {
|
|
112
|
-
if (STRUCTURAL_KINDS.has(edge.kind)) continue;
|
|
113
|
-
const other = graph.node(end === "to" ? edge.to : edge.from);
|
|
114
|
-
if (other === undefined) continue;
|
|
115
|
-
out.push({
|
|
116
|
-
id: other.id,
|
|
117
|
-
name: other.qualifiedName ?? other.name,
|
|
118
|
-
kind: other.kind,
|
|
119
|
-
relation: edge.kind,
|
|
120
|
-
});
|
|
121
|
-
if (out.length >= MAX_NEIGHBORS) break;
|
|
122
|
-
}
|
|
123
|
-
return out;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Read a file's lines once, or undefined when it cannot be read. */
|
|
127
|
-
function fileLines(
|
|
128
|
-
project: string,
|
|
129
|
-
node: ITtscGraphNode,
|
|
130
|
-
): string[] | undefined {
|
|
131
|
-
if (node.evidence === undefined || node.file === "") return undefined;
|
|
132
|
-
try {
|
|
133
|
-
return fs
|
|
134
|
-
.readFileSync(path.join(project, node.file), "utf8")
|
|
135
|
-
.split(/\r?\n/);
|
|
136
|
-
} catch {
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* The declaration signature: the head of the declaration up to and including
|
|
143
|
-
* the line that opens its body (`{`), or the single declaration line when there
|
|
144
|
-
* is no brace, capped so a wrapped signature cannot run away.
|
|
145
|
-
*/
|
|
146
|
-
export function signatureOf(
|
|
147
|
-
project: string,
|
|
148
|
-
node: ITtscGraphNode,
|
|
149
|
-
): string | undefined {
|
|
150
|
-
const lines = fileLines(project, node);
|
|
151
|
-
const evidence = node.evidence;
|
|
152
|
-
if (lines === undefined || evidence === undefined) return undefined;
|
|
153
|
-
const start = Math.max(0, evidence.startLine - 1);
|
|
154
|
-
const out: string[] = [];
|
|
155
|
-
for (
|
|
156
|
-
let i = start;
|
|
157
|
-
i < lines.length && out.length < MAX_SIGNATURE_LINES;
|
|
158
|
-
i++
|
|
159
|
-
) {
|
|
160
|
-
const line = lines[i];
|
|
161
|
-
if (line === undefined) break;
|
|
162
|
-
out.push(line);
|
|
163
|
-
if (line.includes("{")) break;
|
|
164
|
-
}
|
|
165
|
-
const text = out.join("\n").trim();
|
|
166
|
-
return text === "" ? undefined : text;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/** Slice a node's full declaration source from disk, capped at MAX_SOURCE_LINES. */
|
|
170
|
-
function readSource(
|
|
171
|
-
project: string,
|
|
172
|
-
node: ITtscGraphNode,
|
|
173
|
-
): { text: string; truncated: boolean } | undefined {
|
|
174
|
-
const lines = fileLines(project, node);
|
|
175
|
-
const evidence = node.evidence;
|
|
176
|
-
if (lines === undefined || evidence === undefined) return undefined;
|
|
177
|
-
const start = Math.max(0, evidence.startLine - 1);
|
|
178
|
-
const end = Math.min(evidence.endLine ?? evidence.startLine, lines.length);
|
|
179
|
-
let slice = lines.slice(start, Math.max(start + 1, end));
|
|
180
|
-
let truncated = false;
|
|
181
|
-
if (slice.length > MAX_SOURCE_LINES) {
|
|
182
|
-
slice = slice.slice(0, MAX_SOURCE_LINES);
|
|
183
|
-
truncated = true;
|
|
184
|
-
}
|
|
185
|
-
return { text: slice.join("\n"), truncated };
|
|
186
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The resolved nodes the `graph_expand` tool returns for a set of handles —
|
|
3
|
-
* their declared shape (signature, and a container's members), and only on
|
|
4
|
-
* request their full source body.
|
|
5
|
-
*/
|
|
6
|
-
export interface ITtscGraphExpand {
|
|
7
|
-
nodes: ITtscGraphExpand.INode[];
|
|
8
|
-
|
|
9
|
-
/** Handles that resolved to no node, or that were ambiguous. */
|
|
10
|
-
unknown: string[];
|
|
11
|
-
}
|
|
12
|
-
export namespace ITtscGraphExpand {
|
|
13
|
-
/** Which handles to expand, and how much of each to return. */
|
|
14
|
-
export interface IProps {
|
|
15
|
-
/**
|
|
16
|
-
* Node ids from another tool, or dotted symbol handles such as
|
|
17
|
-
* `OrderService.create`. Pass every handle you need in one call.
|
|
18
|
-
*/
|
|
19
|
-
handles: string[];
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Also list each node's direct dependencies and dependents (the symbols it
|
|
23
|
-
* uses and the symbols that use it).
|
|
24
|
-
*
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
neighbors?: boolean;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Return the full declaration source body too. Off by default: expand
|
|
31
|
-
* returns the declared shape — a symbol's signature, and a class/interface/
|
|
32
|
-
* namespace's member outline — which is what you usually need and a
|
|
33
|
-
* fraction of the tokens. Turn this on only for the few leaf functions or
|
|
34
|
-
* methods whose actual control-flow logic you must read.
|
|
35
|
-
*
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
source?: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** One expanded node: its declared shape, and on request its source. */
|
|
42
|
-
export interface INode {
|
|
43
|
-
id: string;
|
|
44
|
-
name: string;
|
|
45
|
-
kind: string;
|
|
46
|
-
file: string;
|
|
47
|
-
/** 1-based declaration line, when known. */
|
|
48
|
-
line?: number;
|
|
49
|
-
/** The declaration signature — its first line(s) up to the body. */
|
|
50
|
-
signature?: string;
|
|
51
|
-
/**
|
|
52
|
-
* For a class, interface, namespace, module, enum, or file: the symbols it
|
|
53
|
-
* contains, each with its own signature — the member outline a consumer
|
|
54
|
-
* reaches for, without the bodies.
|
|
55
|
-
*/
|
|
56
|
-
members?: IMember[];
|
|
57
|
-
/** The full declaration source — only when `source` was requested. */
|
|
58
|
-
source?: string;
|
|
59
|
-
/** True when `source` was cut at the line cap. */
|
|
60
|
-
truncated?: boolean;
|
|
61
|
-
/** Symbols this node uses (outgoing dependency edges). */
|
|
62
|
-
dependsOn?: IReference[];
|
|
63
|
-
/** Symbols that use this node (incoming dependency edges). */
|
|
64
|
-
dependedOnBy?: IReference[];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** One member of a container node, with its signature but not its body. */
|
|
68
|
-
export interface IMember {
|
|
69
|
-
name: string;
|
|
70
|
-
kind: string;
|
|
71
|
-
/** 1-based declaration line, when known. */
|
|
72
|
-
line?: number;
|
|
73
|
-
/** The member's declaration signature. */
|
|
74
|
-
signature?: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** A dependency neighbor of an expanded node and the edge that links them. */
|
|
78
|
-
export interface IReference {
|
|
79
|
-
id: string;
|
|
80
|
-
name: string;
|
|
81
|
-
kind: string;
|
|
82
|
-
/** The edge kind connecting the two (`calls`, `type_ref`, …). */
|
|
83
|
-
relation: string;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/** The ranked hits the `graph_query` tool returns for a natural code query. */
|
|
2
|
-
export interface ITtscGraphQuery {
|
|
3
|
-
hits: ITtscGraphQuery.IHit[];
|
|
4
|
-
|
|
5
|
-
/** Follow-up handles for source or member details. */
|
|
6
|
-
next: ITtscGraphQuery.INext;
|
|
7
|
-
}
|
|
8
|
-
export namespace ITtscGraphQuery {
|
|
9
|
-
/** Find the symbols and clusters most relevant to a natural code query. */
|
|
10
|
-
export interface IProps {
|
|
11
|
-
/**
|
|
12
|
-
* What to find, in natural language and code vocabulary mixed freely — a
|
|
13
|
-
* symbol name, a dotted member (`OrderService.create`), or a phrase
|
|
14
|
-
* (`shopping order create`, `repository find relations`). Exact names are
|
|
15
|
-
* not required; subword and CamelCase matches rank too.
|
|
16
|
-
*/
|
|
17
|
-
query: string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Maximum hits to return.
|
|
21
|
-
*
|
|
22
|
-
* @default 12
|
|
23
|
-
*/
|
|
24
|
-
limit?: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** One ranked hit with a handle to follow via `graph_expand` or `graph_trace`. */
|
|
28
|
-
export interface IHit {
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
kind: string;
|
|
32
|
-
file: string;
|
|
33
|
-
/** 1-based declaration line, when known. */
|
|
34
|
-
line?: number;
|
|
35
|
-
/**
|
|
36
|
-
* The hit's declaration signature, so you can often answer without
|
|
37
|
-
* expanding.
|
|
38
|
-
*/
|
|
39
|
-
signature?: string;
|
|
40
|
-
/** Relative relevance; higher is a better match. */
|
|
41
|
-
score: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** Tool-call handles suggested by this index result. */
|
|
45
|
-
export interface INext {
|
|
46
|
-
/** Pass these ids to `graph_expand`, with `source: true` only when needed. */
|
|
47
|
-
expand: string[];
|
|
48
|
-
}
|
|
49
|
-
}
|