@ttsc/graph 0.16.5 → 0.16.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +22 -0
  2. package/lib/TtscGraphApplication.js +58 -22
  3. package/lib/TtscGraphApplication.js.map +1 -1
  4. package/lib/model/TtscGraphMemory.js +43 -4
  5. package/lib/model/TtscGraphMemory.js.map +1 -1
  6. package/lib/model/loadGraph.js +17 -17
  7. package/lib/server/accessAliases.js +53 -0
  8. package/lib/server/accessAliases.js.map +1 -0
  9. package/lib/server/createServer.js +1490 -657
  10. package/lib/server/createServer.js.map +1 -1
  11. package/lib/server/instructions.js +81 -21
  12. package/lib/server/instructions.js.map +1 -1
  13. package/lib/server/pathPolicy.js +35 -0
  14. package/lib/server/pathPolicy.js.map +1 -0
  15. package/lib/server/resultGuide.js +16 -0
  16. package/lib/server/resultGuide.js.map +1 -0
  17. package/lib/server/runDetails.js +474 -0
  18. package/lib/server/runDetails.js.map +1 -0
  19. package/lib/server/{runIndex.js → runEntrypoints.js} +92 -28
  20. package/lib/server/runEntrypoints.js.map +1 -0
  21. package/lib/server/runLookup.js +246 -0
  22. package/lib/server/runLookup.js.map +1 -0
  23. package/lib/server/runOverview.js +44 -27
  24. package/lib/server/runOverview.js.map +1 -1
  25. package/lib/server/runTour.js +737 -0
  26. package/lib/server/runTour.js.map +1 -0
  27. package/lib/server/runTrace.js +224 -43
  28. package/lib/server/runTrace.js.map +1 -1
  29. package/lib/structures/ITtscGraphDetails.js +3 -0
  30. package/lib/structures/ITtscGraphDetails.js.map +1 -0
  31. package/lib/structures/ITtscGraphEntrypoints.js +3 -0
  32. package/lib/structures/ITtscGraphEntrypoints.js.map +1 -0
  33. package/lib/structures/{ITtscGraphExpand.js → ITtscGraphEscape.js} +1 -1
  34. package/lib/structures/ITtscGraphEscape.js.map +1 -0
  35. package/lib/structures/ITtscGraphLookup.js +3 -0
  36. package/lib/structures/ITtscGraphLookup.js.map +1 -0
  37. package/lib/structures/{ITtscGraphIndex.js → ITtscGraphNext.js} +1 -1
  38. package/lib/structures/ITtscGraphNext.js.map +1 -0
  39. package/lib/structures/{ITtscGraphQuery.js → ITtscGraphTour.js} +1 -1
  40. package/lib/structures/ITtscGraphTour.js.map +1 -0
  41. package/lib/structures/index.js +6 -3
  42. package/lib/structures/index.js.map +1 -1
  43. package/package.json +2 -2
  44. package/src/TtscGraphApplication.ts +70 -30
  45. package/src/model/TtscGraphMemory.ts +46 -4
  46. package/src/server/accessAliases.ts +55 -0
  47. package/src/server/createServer.ts +4 -7
  48. package/src/server/instructions.ts +81 -21
  49. package/src/server/pathPolicy.ts +43 -0
  50. package/src/server/resultGuide.ts +20 -0
  51. package/src/server/runDetails.ts +553 -0
  52. package/src/server/{runIndex.ts → runEntrypoints.ts} +116 -36
  53. package/src/server/runLookup.ts +284 -0
  54. package/src/server/runOverview.ts +59 -31
  55. package/src/server/runTour.ts +881 -0
  56. package/src/server/runTrace.ts +299 -45
  57. package/src/structures/ITtscGraphApplication.ts +75 -56
  58. package/src/structures/ITtscGraphDecorator.ts +12 -14
  59. package/src/structures/ITtscGraphDetails.ts +197 -0
  60. package/src/structures/ITtscGraphEntrypoints.ts +149 -0
  61. package/src/structures/ITtscGraphEscape.ts +49 -0
  62. package/src/structures/ITtscGraphEvidence.ts +5 -8
  63. package/src/structures/ITtscGraphLookup.ts +82 -0
  64. package/src/structures/ITtscGraphNext.ts +23 -0
  65. package/src/structures/ITtscGraphNode.ts +10 -4
  66. package/src/structures/ITtscGraphOverview.ts +41 -18
  67. package/src/structures/ITtscGraphTour.ts +150 -0
  68. package/src/structures/ITtscGraphTrace.ts +93 -13
  69. package/src/structures/TtscGraphNodeKind.ts +2 -2
  70. package/src/structures/index.ts +6 -3
  71. package/lib/server/runExpand.js +0 -177
  72. package/lib/server/runExpand.js.map +0 -1
  73. package/lib/server/runIndex.js.map +0 -1
  74. package/lib/server/runQuery.js +0 -147
  75. package/lib/server/runQuery.js.map +0 -1
  76. package/lib/structures/ITtscGraphExpand.js.map +0 -1
  77. package/lib/structures/ITtscGraphIndex.js.map +0 -1
  78. package/lib/structures/ITtscGraphQuery.js.map +0 -1
  79. package/src/server/runExpand.ts +0 -186
  80. package/src/server/runQuery.ts +0 -150
  81. package/src/structures/ITtscGraphExpand.ts +0 -85
  82. package/src/structures/ITtscGraphIndex.ts +0 -100
  83. package/src/structures/ITtscGraphQuery.ts +0 -49
@@ -1,14 +1,22 @@
1
- /**
2
- * A compact, source-read-free architecture map of the project — the result of
3
- * the `graph_overview` tool.
4
- */
1
+ import { ITtscGraphNext } from "./ITtscGraphNext";
2
+
3
+ /** A compact, source-read-free project map for broad orientation only. */
5
4
  export interface ITtscGraphOverview {
5
+ /** Discriminator for source-free project overview. */
6
+ type: "overview";
7
+
6
8
  /** Absolute project root. */
7
9
  project: string;
8
10
 
9
11
  /** Size of the graph. */
10
12
  counts: ITtscGraphOverview.ICounts;
11
13
 
14
+ /** How to use this source-free result next. */
15
+ next: ITtscGraphNext;
16
+
17
+ /** Human-readable compatibility note mirroring `next`. */
18
+ guide: string;
19
+
12
20
  /** Folder layering, largest first. */
13
21
  layers?: ITtscGraphOverview.ILayer[];
14
22
 
@@ -19,13 +27,20 @@ export interface ITtscGraphOverview {
19
27
  publicApi?: ITtscGraphOverview.IPublicApi[];
20
28
  }
21
29
  export namespace ITtscGraphOverview {
22
- /** Which architecture facets `graph_overview` should return. */
23
- export interface IProps {
30
+ /** Which broad architecture facets `overview` should return. */
31
+ export interface IRequest {
32
+ /** Discriminator for source-free project overview. */
33
+ type: "overview";
34
+
24
35
  /**
25
36
  * The facet to project, or `all` for every facet. `layers` is the folder
26
37
  * layering, `hotspots` the highest-dependency symbols, `publicApi` the
27
38
  * exported API symbols ranked by how depended-on they are.
28
39
  *
40
+ * Use this only for broad public API or layer orientation. For behavior,
41
+ * lifecycle, request-flow, rendering-flow, validation-flow, caller, or
42
+ * dependency questions, use `entrypoints` then `trace` instead.
43
+ *
29
44
  * @default "all"
30
45
  */
31
46
  aspect?: "all" | "layers" | "hotspots" | "publicApi";
@@ -33,9 +48,15 @@ export namespace ITtscGraphOverview {
33
48
 
34
49
  /** Size of the graph by node/edge totals and per-kind node counts. */
35
50
  export interface ICounts {
51
+ /** Number of source file container nodes. */
36
52
  files: number;
53
+
54
+ /** Total node count, including declarations and file containers. */
37
55
  nodes: number;
56
+
57
+ /** Total edge count, including structural edges. */
38
58
  edges: number;
59
+
39
60
  /** Node count per kind. */
40
61
  byKind: Record<string, number>;
41
62
  }
@@ -50,12 +71,22 @@ export namespace ITtscGraphOverview {
50
71
  exported: number;
51
72
  }
52
73
 
53
- /** A high-dependency symbol with its non-structural fan-in and fan-out. */
54
- export interface IHotspot {
74
+ /** A compact symbol coordinate that can be passed to deeper graph tools. */
75
+ export interface INode {
76
+ /** Stable handle for `details` or `trace`. */
55
77
  id: string;
78
+ /** The symbol's qualified name when available. */
56
79
  name: string;
80
+ /** Its declaration kind (`class`, `interface`, `function`, ...). */
57
81
  kind: string;
82
+ /** Project-relative path of the file that declares it. */
58
83
  file: string;
84
+ /** 1-based declaration line, when known. */
85
+ line?: number;
86
+ }
87
+
88
+ /** A high-dependency symbol with its non-structural fan-in and fan-out. */
89
+ export interface IHotspot extends INode {
59
90
  /** Non-structural edges pointing at this symbol. */
60
91
  fanIn: number;
61
92
  /** Non-structural edges leaving this symbol. */
@@ -65,15 +96,7 @@ export namespace ITtscGraphOverview {
65
96
  /**
66
97
  * One symbol on the project's exported public API surface. The list is ranked
67
98
  * by how depended-on the symbol is, with test, typings, and generated files
68
- * excluded, so the names a consumer of the project would reach for surface
69
- * first — not whichever file happens to declare the most exports.
99
+ * excluded.
70
100
  */
71
- export interface IPublicApi {
72
- /** The exported symbol's name. */
73
- name: string;
74
- /** Its declaration kind (`class`, `interface`, `function`, …). */
75
- kind: string;
76
- /** Project-relative path of the file that declares it. */
77
- file: string;
78
- }
101
+ export type IPublicApi = INode;
79
102
  }
@@ -0,0 +1,150 @@
1
+ import { ITtscGraphDecorator } from "./ITtscGraphDecorator";
2
+ import { ITtscGraphNext } from "./ITtscGraphNext";
3
+
4
+ /** Answer-ready, source-free tour evidence for broad code-flow questions. */
5
+ export interface ITtscGraphTour {
6
+ /** Discriminator for code-tour indexing. */
7
+ type: "tour";
8
+
9
+ /** Natural code question this tour was built for. */
10
+ query: string;
11
+
12
+ /** Central entrypoints selected for the tour. */
13
+ entrypoints: ITtscGraphTour.INode[];
14
+
15
+ /** Selected primary runtime flows; sufficient for an index-level tour. */
16
+ primaryFlow: ITtscGraphTour.IFlow[];
17
+
18
+ /** Nearby dependency anchors around the selected entrypoints. */
19
+ nearby: ITtscGraphTour.IAnchor[];
20
+
21
+ /** Test or usage anchors reached through graph impact edges. */
22
+ tests: ITtscGraphTour.IAnchor[];
23
+
24
+ /** Ordered file/line anchors to cite in the final answer, not file reads. */
25
+ answerAnchors: ITtscGraphTour.IAnchor[];
26
+
27
+ /** How to use this source-free result next. */
28
+ next: ITtscGraphNext;
29
+
30
+ /** Human-readable compatibility note mirroring `next`. */
31
+ guide: string;
32
+
33
+ /** True when any internal slice hit its cap. */
34
+ truncated?: boolean;
35
+ }
36
+
37
+ export namespace ITtscGraphTour {
38
+ /**
39
+ * Build the complete index-level answer surface for broad code tours: central
40
+ * entrypoints, primary flow, nearby paths, tests, and answer anchors. Use
41
+ * this instead of decomposing repository-orientation, read-next,
42
+ * architecture, or multi-phase runtime-flow questions into many
43
+ * lookup/details/trace calls.
44
+ */
45
+ export interface IRequest {
46
+ /** Discriminator for code-tour indexing. */
47
+ type: "tour";
48
+
49
+ /** The user's natural code-tour question. */
50
+ query: string;
51
+
52
+ /**
53
+ * Maximum central entrypoints to seed the tour.
54
+ *
55
+ * Prefer the default. Raise only when the question names several distinct
56
+ * public paths that must all appear in one answer.
57
+ *
58
+ * @default 4
59
+ */
60
+ limit?: number;
61
+
62
+ /**
63
+ * Include graph-reached test or usage anchors when available.
64
+ *
65
+ * @default true
66
+ */
67
+ includeTests?: boolean;
68
+ }
69
+
70
+ /** A compact symbol coordinate for a tour. */
71
+ export interface INode {
72
+ /** Stable node id for later graph calls. */
73
+ id: string;
74
+
75
+ /** Qualified symbol name when available, otherwise the simple name. */
76
+ name: string;
77
+
78
+ /** Declaration kind (`class`, `method`, `function`, ...). */
79
+ kind: string;
80
+
81
+ /** Project-relative declaration file. */
82
+ file: string;
83
+
84
+ /** 1-based declaration line, when known. */
85
+ line?: number;
86
+
87
+ /** Declaration or implementation range, when known. */
88
+ sourceSpan?: ITtscGraphTour.ISpan;
89
+
90
+ /** Declaration head, when available. */
91
+ signature?: string;
92
+
93
+ /** Decorators written on the declaration, when any. */
94
+ decorators?: ITtscGraphDecorator[];
95
+ }
96
+
97
+ /** A primary flow slice from one selected entrypoint. */
98
+ export interface IFlow {
99
+ /** Flow start node. */
100
+ start: ITtscGraphTour.INode;
101
+
102
+ /** Compact edge summaries in graph order. */
103
+ steps: string[];
104
+
105
+ /** Nodes reached by this flow. */
106
+ reached: ITtscGraphTour.INode[];
107
+
108
+ /** Edge and node anchors that explain the flow. */
109
+ anchors: ITtscGraphTour.IAnchor[];
110
+
111
+ /** True when the flow hit graph caps. */
112
+ truncated?: boolean;
113
+ }
114
+
115
+ /** A file/line citation chosen by the graph, not source body text. */
116
+ export interface IAnchor {
117
+ /** Why this anchor matters in the tour. */
118
+ reason: string;
119
+
120
+ /** Stable node id when the anchor belongs to a node. */
121
+ id?: string;
122
+
123
+ /** Symbol, edge, or test name to show in the answer. */
124
+ name: string;
125
+
126
+ /** Declaration kind, when this anchor belongs to a node. */
127
+ kind?: string;
128
+
129
+ /** Project-relative file. */
130
+ file: string;
131
+
132
+ /** 1-based start line. */
133
+ startLine: number;
134
+
135
+ /** 1-based end line, when known. */
136
+ endLine?: number;
137
+ }
138
+
139
+ /** Source coordinates without source text. */
140
+ export interface ISpan {
141
+ /** Project-relative file. */
142
+ file: string;
143
+
144
+ /** 1-based start line. */
145
+ startLine: number;
146
+
147
+ /** 1-based end line, when known. */
148
+ endLine?: number;
149
+ }
150
+ }
@@ -1,11 +1,15 @@
1
- /**
2
- * The ordered dependency flow the `graph_trace` tool returns from a start
3
- * symbol.
4
- */
1
+ import { ITtscGraphEvidence } from "./ITtscGraphEvidence";
2
+ import { ITtscGraphNext } from "./ITtscGraphNext";
3
+
4
+ /** The compact dependency or caller flow returned from a selected start symbol. */
5
5
  export interface ITtscGraphTrace {
6
+ /** Discriminator for dependency tracing. */
7
+ type: "trace";
8
+
6
9
  /** The resolved start node, or undefined when `from` matched nothing. */
7
10
  start?: ITtscGraphTrace.INode;
8
11
 
12
+ /** Trace direction actually used by this result. */
9
13
  direction: string;
10
14
 
11
15
  /** Edges traversed, in breadth-first order. */
@@ -27,12 +31,24 @@ export interface ITtscGraphTrace {
27
31
  */
28
32
  path?: ITtscGraphTrace.INode[];
29
33
 
34
+ /** Compact hop summaries preserving node names and edge evidence, capped. */
35
+ steps?: string[];
36
+
37
+ /** How to use this source-free result next. */
38
+ next: ITtscGraphNext;
39
+
40
+ /** Human-readable compatibility note mirroring `next`. */
41
+ guide: string;
42
+
30
43
  /** When `from` was an ambiguous name, the matches to disambiguate with. */
31
44
  candidates?: ITtscGraphTrace.INode[];
32
45
  }
33
46
  export namespace ITtscGraphTrace {
34
47
  /** Where and how far to trace dependency flow. */
35
- export interface IProps {
48
+ export interface IRequest {
49
+ /** Discriminator for dependency tracing. */
50
+ type: "trace";
51
+
36
52
  /**
37
53
  * Where to start: a node id from another tool, a simple symbol name, or a
38
54
  * dotted member name such as `OrderService.create`. An ambiguous name
@@ -42,55 +58,119 @@ export namespace ITtscGraphTrace {
42
58
 
43
59
  /**
44
60
  * A target symbol: node id, simple symbol name, or dotted member name. When
45
- * given, the tool returns the dependency path from `from` to this target
46
- * the one-call answer for "how does A reach B" instead of an open-ended
47
- * trace.
61
+ * given, the tool returns the dependency path from `from` to this target,
62
+ * the one-call answer for "how does A reach B", instead of an open-ended
63
+ * trace. Prefer this path mode whenever both ends are known.
48
64
  */
49
65
  to?: string;
50
66
 
51
67
  /**
52
68
  * `forward` follows what the start uses (callees, instantiations, renders);
53
69
  * `reverse` follows what uses the start (callers); `impact` is a reverse
54
- * trace that flags the public API and tests a change would reach.
70
+ * trace that prioritizes public API and test nodes a change would reach.
71
+ * Its test nodes are semantic usage edges, not a text-search inventory.
72
+ * Caller questions usually fit `reverse`.
55
73
  *
56
74
  * @default "forward"
57
75
  */
58
76
  direction?: "forward" | "reverse" | "impact";
59
77
 
60
78
  /**
61
- * How many hops deep to follow.
79
+ * Which non-structural edge family to follow: `execution` follows runtime
80
+ * calls, instantiations, property access, and JSX renders; `types` follows
81
+ * type references and inheritance; `all` preserves the full graph. Flow
82
+ * questions should usually choose `execution` rather than `all`.
62
83
  *
63
- * @default 6
84
+ * @default "all"
85
+ */
86
+ focus?: "all" | "execution" | "types";
87
+
88
+ /**
89
+ * How many hops deep to follow. Open forward/reverse traces are capped at
90
+ * 2; impact traces at 4; path mode at 12.
91
+ *
92
+ * Prefer the default for open traces. Raise only for path mode or when the
93
+ * previous trace named the missing next hop.
94
+ *
95
+ * @default 2
64
96
  */
65
97
  maxDepth?: number;
66
98
 
67
99
  /**
68
100
  * Cap on reached nodes; the trace stops and marks itself truncated past it.
101
+ * Open forward/reverse traces are capped at 8 nodes, impact at 16 nodes.
69
102
  *
70
- * @default 60
103
+ * Prefer the default; use larger open traces only when a named missing edge
104
+ * requires it.
105
+ *
106
+ * @default 6
71
107
  */
72
108
  maxNodes?: number;
109
+
110
+ /**
111
+ * Include dependency-boundary nodes from node_modules or bundled `.d.ts`
112
+ * libraries. Leave false for source-flow tours; enable only when the user
113
+ * asks about external type/API boundaries.
114
+ *
115
+ * @default false
116
+ */
117
+ includeExternal?: boolean;
73
118
  }
74
119
 
75
120
  /** One traversed edge, with its depth from the start. */
76
121
  export interface IHop {
122
+ /** Source node id for this traversed edge. */
77
123
  from: string;
124
+
125
+ /** Target node id for this traversed edge. */
78
126
  to: string;
127
+
128
+ /** Edge kind (`calls`, `type_ref`, `accesses`, ...). */
79
129
  kind: string;
130
+
80
131
  /** Hops from the start (1 = direct). */
81
132
  depth: number;
133
+
134
+ /**
135
+ * Source span for the expression that produced this hop. It is repository
136
+ * evidence for the hop and can be cited without opening the file.
137
+ */
138
+ evidence?: ITtscGraphEvidence;
139
+
140
+ /**
141
+ * Stable access-path aliases derived from edge evidence. These preserve a
142
+ * resolved member's owner and the concrete property path used at the call
143
+ * site.
144
+ */
145
+ aliases?: string[];
82
146
  }
83
147
 
84
148
  /** A node on the trace: the start, a reached node, or a candidate. */
85
149
  export interface INode {
150
+ /** Stable node id for subsequent graph calls. */
86
151
  id: string;
152
+
153
+ /** Qualified symbol name when available, otherwise the simple name. */
87
154
  name: string;
155
+
156
+ /** Declaration kind (`class`, `method`, `function`, ...). */
88
157
  kind: string;
158
+
159
+ /** Project-relative path of the declaration file. */
89
160
  file: string;
161
+
162
+ /** 1-based declaration line, when known. */
163
+ line?: number;
164
+
165
+ /** Declaration or implementation citation range, when known. */
166
+ sourceSpan?: Pick<ITtscGraphEvidence, "file" | "startLine" | "endLine">;
167
+
90
168
  /** Hops from the start, on a reached node. */
91
169
  depth?: number;
92
- /** The node's signature — carried on path nodes so the path explains itself. */
170
+
171
+ /** The node's signature, carried on path nodes so the path explains itself. */
93
172
  signature?: string;
173
+
94
174
  /** Why this node matters to an impact trace: `exported`, `test`. */
95
175
  roles?: string[];
96
176
  }
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * The symbol kinds (`file` through `parameter`) are declarations the TypeScript
5
5
  * program owns and the checker resolves. `external_symbol` is a
6
- * dependency-boundary leaf the workspace references but does not declare — the
7
- * graph keeps it as a named endpoint without expanding the dependency's
6
+ * dependency-boundary leaf the workspace references but does not declare. The
7
+ * graph keeps it as a named endpoint without walking into the dependency's
8
8
  * internals.
9
9
  *
10
10
  * Used as the `kind` discriminant on {@link ITtscGraphNode}.
@@ -10,12 +10,15 @@ export * from "./ITtscGraphDiagnostic";
10
10
  export * from "./ITtscGraphDump";
11
11
  export * from "./ITtscGraphEdge";
12
12
  export * from "./ITtscGraphEvidence";
13
- export * from "./ITtscGraphExpand";
14
- export * from "./ITtscGraphIndex";
13
+ export * from "./ITtscGraphEscape";
14
+ export * from "./ITtscGraphDetails";
15
+ export * from "./ITtscGraphEntrypoints";
15
16
  export * from "./ITtscGraphNode";
16
17
  export * from "./ITtscGraphOverview";
17
- export * from "./ITtscGraphQuery";
18
+ export * from "./ITtscGraphLookup";
19
+ export * from "./ITtscGraphNext";
18
20
  export * from "./ITtscGraphTrace";
21
+ export * from "./ITtscGraphTour";
19
22
  export * from "./TtscGraphEdgeKind";
20
23
  export * from "./TtscGraphNodeKind";
21
24
  export * from "./TtscGraphNodeModifier";
@@ -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;IACtC,OAAO;IACP,WAAW;IACX,WAAW;IACX,QAAQ;IACR,MAAM;IACN,MAAM;CACP,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,mBACE,KAAsB,EACtB,KAA8B;IAE9B,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IACzC,MAAM,KAAK,GAA6B,EAAE,CAAC;IAC3C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,IAAA,kCAAkB,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACnD,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,C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