@ttsc/graph 0.18.3 → 0.19.0
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 +231 -36
- package/lib/TtscGraphApplication.d.ts +4 -3
- package/lib/TtscGraphApplication.js +54 -19
- package/lib/TtscGraphApplication.js.map +1 -1
- package/lib/index.d.ts +9 -4
- package/lib/index.js +24 -5
- package/lib/index.js.map +1 -1
- package/lib/model/TtscGraphMemory.js +80 -22
- package/lib/model/TtscGraphMemory.js.map +1 -1
- package/lib/model/TtscGraphSession.d.ts +36 -0
- package/lib/model/TtscGraphSession.js +457 -0
- package/lib/model/TtscGraphSession.js.map +1 -0
- package/lib/model/loadGraph.d.ts +3 -3
- package/lib/model/loadGraph.js +94 -141
- package/lib/model/loadGraph.js.map +1 -1
- package/lib/resolveGraphBinary.d.ts +4 -2
- package/lib/resolveGraphBinary.js +7 -3
- package/lib/resolveGraphBinary.js.map +1 -1
- package/lib/server/createServer.d.ts +16 -9
- package/lib/server/createServer.js +286 -190
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/exportSurface.d.ts +26 -0
- package/lib/server/exportSurface.js +44 -0
- package/lib/server/exportSurface.js.map +1 -0
- package/lib/server/resolveHandle.d.ts +26 -1
- package/lib/server/resolveHandle.js +124 -4
- package/lib/server/resolveHandle.js.map +1 -1
- package/lib/server/resultAudit.d.ts +74 -0
- package/lib/server/resultAudit.js +110 -0
- package/lib/server/resultAudit.js.map +1 -0
- package/lib/server/resultNext.d.ts +9 -0
- package/lib/server/resultNext.js +11 -0
- package/lib/server/resultNext.js.map +1 -0
- package/lib/server/runDetails.d.ts +15 -3
- package/lib/server/runDetails.js +105 -23
- package/lib/server/runDetails.js.map +1 -1
- package/lib/server/runEntrypoints.d.ts +2 -1
- package/lib/server/runEntrypoints.js +17 -10
- package/lib/server/runEntrypoints.js.map +1 -1
- package/lib/server/runLookup.d.ts +2 -1
- package/lib/server/runLookup.js +21 -9
- package/lib/server/runLookup.js.map +1 -1
- package/lib/server/runOverview.d.ts +2 -1
- package/lib/server/runOverview.js +5 -4
- package/lib/server/runOverview.js.map +1 -1
- package/lib/server/runTour.d.ts +2 -1
- package/lib/server/runTour.js +707 -331
- package/lib/server/runTour.js.map +1 -1
- package/lib/server/runTrace.d.ts +2 -1
- package/lib/server/runTrace.js +234 -54
- package/lib/server/runTrace.js.map +1 -1
- package/lib/server/startServer.d.ts +3 -2
- package/lib/server/startServer.js +13 -7
- package/lib/server/startServer.js.map +1 -1
- package/lib/structures/ITtscGraphApplication.d.ts +122 -114
- package/lib/structures/ITtscGraphDecorator.d.ts +4 -7
- package/lib/structures/ITtscGraphDetails.d.ts +51 -43
- package/lib/structures/ITtscGraphDump.d.ts +36 -11
- package/lib/structures/ITtscGraphEdge.d.ts +4 -6
- package/lib/structures/ITtscGraphEntrypoints.d.ts +10 -27
- package/lib/structures/ITtscGraphEscape.d.ts +6 -16
- package/lib/structures/ITtscGraphEvidence.d.ts +5 -8
- package/lib/structures/ITtscGraphLookup.d.ts +9 -20
- package/lib/structures/ITtscGraphNext.d.ts +10 -7
- package/lib/structures/ITtscGraphNode.d.ts +17 -8
- package/lib/structures/ITtscGraphOverview.d.ts +10 -14
- package/lib/structures/ITtscGraphSpan.d.ts +29 -0
- package/lib/structures/{ITtscGraphDiagnostic.js → ITtscGraphSpan.js} +1 -1
- package/lib/structures/ITtscGraphSpan.js.map +1 -0
- package/lib/structures/ITtscGraphTour.d.ts +65 -23
- package/lib/structures/ITtscGraphTrace.d.ts +72 -49
- package/lib/structures/TtscGraphEdgeKind.d.ts +7 -1
- package/lib/structures/index.d.ts +1 -1
- package/lib/structures/index.js +1 -1
- package/lib/structures/index.js.map +1 -1
- package/lib/view.js +3 -1
- package/lib/view.js.map +1 -1
- package/package.json +4 -4
- package/src/TtscGraphApplication.ts +66 -31
- package/src/index.ts +23 -5
- package/src/model/TtscGraphMemory.ts +86 -22
- package/src/model/TtscGraphSession.ts +204 -0
- package/src/model/loadGraph.ts +6 -4
- package/src/resolveGraphBinary.ts +7 -3
- package/src/server/createServer.ts +24 -17
- package/src/server/exportSurface.ts +40 -0
- package/src/server/resolveHandle.ts +141 -4
- package/src/server/resultAudit.ts +109 -0
- package/src/server/resultNext.ts +22 -0
- package/src/server/runDetails.ts +112 -28
- package/src/server/runEntrypoints.ts +26 -17
- package/src/server/runLookup.ts +29 -18
- package/src/server/runOverview.ts +9 -10
- package/src/server/runTour.ts +764 -363
- package/src/server/runTrace.ts +265 -71
- package/src/server/startServer.ts +13 -8
- package/src/structures/ITtscGraphApplication.ts +124 -114
- package/src/structures/ITtscGraphDecorator.ts +4 -7
- package/src/structures/ITtscGraphDetails.ts +60 -46
- package/src/structures/ITtscGraphDump.ts +41 -11
- package/src/structures/ITtscGraphEdge.ts +4 -6
- package/src/structures/ITtscGraphEntrypoints.ts +10 -30
- package/src/structures/ITtscGraphEscape.ts +6 -19
- package/src/structures/ITtscGraphEvidence.ts +5 -8
- package/src/structures/ITtscGraphLookup.ts +9 -22
- package/src/structures/ITtscGraphNext.ts +10 -7
- package/src/structures/ITtscGraphNode.ts +18 -8
- package/src/structures/ITtscGraphOverview.ts +10 -17
- package/src/structures/ITtscGraphSpan.ts +33 -0
- package/src/structures/ITtscGraphTour.ts +70 -28
- package/src/structures/ITtscGraphTrace.ts +82 -51
- package/src/structures/TtscGraphEdgeKind.ts +7 -0
- package/src/structures/index.ts +1 -1
- package/src/view.ts +3 -1
- package/lib/server/accessAliases.d.ts +0 -8
- package/lib/server/accessAliases.js +0 -53
- package/lib/server/accessAliases.js.map +0 -1
- package/lib/server/resultGuide.d.ts +0 -3
- package/lib/server/resultGuide.js +0 -16
- package/lib/server/resultGuide.js.map +0 -1
- package/lib/structures/ITtscGraphDiagnostic.d.ts +0 -27
- package/lib/structures/ITtscGraphDiagnostic.js.map +0 -1
- package/src/server/accessAliases.ts +0 -55
- package/src/server/resultGuide.ts +0 -20
- package/src/structures/ITtscGraphDiagnostic.ts +0 -34
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TtscGraphSession = void 0;
|
|
40
|
+
const _assertGuard_1 = __importStar(require("typia/lib/internal/_assertGuard"));
|
|
41
|
+
const node_child_process_1 = require("node:child_process");
|
|
42
|
+
const node_readline_1 = __importDefault(require("node:readline"));
|
|
43
|
+
const typia_1 = __importDefault(require("typia"));
|
|
44
|
+
const nativeExecutable_1 = require("../nativeExecutable");
|
|
45
|
+
const resolveGraphBinary_1 = require("../resolveGraphBinary");
|
|
46
|
+
const TtscGraphMemory_1 = require("./TtscGraphMemory");
|
|
47
|
+
/**
|
|
48
|
+
* Resident bridge to `ttscgraph serve`.
|
|
49
|
+
*
|
|
50
|
+
* Every graph request first asks the native session for the current disk
|
|
51
|
+
* snapshot. Unchanged requests reuse the existing {@link TtscGraphMemory}; an
|
|
52
|
+
* edited source reuses tsgo's resident Program through `driver.Session`, while
|
|
53
|
+
* config and root-file-set changes force a safe full reload.
|
|
54
|
+
*/
|
|
55
|
+
class TtscGraphSession {
|
|
56
|
+
cwd;
|
|
57
|
+
tsconfig;
|
|
58
|
+
binary;
|
|
59
|
+
child;
|
|
60
|
+
stderr = "";
|
|
61
|
+
nextId = 0;
|
|
62
|
+
pending = new Map();
|
|
63
|
+
queue = Promise.resolve();
|
|
64
|
+
current;
|
|
65
|
+
closed = false;
|
|
66
|
+
constructor(options) {
|
|
67
|
+
// Resolve the platform binary from the project this session serves, so the
|
|
68
|
+
// MCP server started from an unrelated directory still finds the target's
|
|
69
|
+
// installed `ttsc`.
|
|
70
|
+
const binary = options.binary ?? (0, resolveGraphBinary_1.resolveGraphBinary)(process.env, options.cwd);
|
|
71
|
+
if (binary === null) {
|
|
72
|
+
throw new Error("@ttsc/graph: could not resolve the ttscgraph binary. " +
|
|
73
|
+
"Install `ttsc` so its platform package is present, " +
|
|
74
|
+
"or set TTSC_GRAPH_BINARY to an absolute path.");
|
|
75
|
+
}
|
|
76
|
+
(0, nativeExecutable_1.ensureExecutable)(binary);
|
|
77
|
+
this.cwd = options.cwd;
|
|
78
|
+
this.tsconfig = options.tsconfig;
|
|
79
|
+
this.binary = binary;
|
|
80
|
+
}
|
|
81
|
+
/** Return a graph for the current disk snapshot, serialized per tool call. */
|
|
82
|
+
graph() {
|
|
83
|
+
let resolve;
|
|
84
|
+
let reject;
|
|
85
|
+
const result = new Promise((res, rej) => {
|
|
86
|
+
resolve = res;
|
|
87
|
+
reject = rej;
|
|
88
|
+
});
|
|
89
|
+
this.queue = this.queue
|
|
90
|
+
.catch(() => undefined)
|
|
91
|
+
.then(async () => {
|
|
92
|
+
try {
|
|
93
|
+
resolve(await this.refresh());
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
reject(asError(error));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
/** Close the native session. Safe to call more than once. */
|
|
102
|
+
close() {
|
|
103
|
+
this.closed = true;
|
|
104
|
+
const child = this.child;
|
|
105
|
+
this.child = undefined;
|
|
106
|
+
if (child !== undefined && !child.killed)
|
|
107
|
+
child.stdin.end();
|
|
108
|
+
this.failPending(new Error("@ttsc/graph: native session closed"));
|
|
109
|
+
}
|
|
110
|
+
async refresh() {
|
|
111
|
+
const response = await this.request();
|
|
112
|
+
if (response.error !== undefined) {
|
|
113
|
+
throw new Error(`@ttsc/graph: ${response.error}`);
|
|
114
|
+
}
|
|
115
|
+
if (response.changed) {
|
|
116
|
+
if (response.dump === undefined) {
|
|
117
|
+
throw new Error(`@ttsc/graph: native ${response.mode ?? "changed"} response omitted its dump`);
|
|
118
|
+
}
|
|
119
|
+
const dump = (() => {
|
|
120
|
+
const _iv0 = new Set(["class", "enum", "external_symbol", "file", "function", "interface", "method", "module", "namespace", "package", "parameter", "property", "type", "variable"]);
|
|
121
|
+
const _ip0 = input => "string" === typeof input["name"];
|
|
122
|
+
const _iv1 = new Set(["abstract", "async", "const", "declare", "default", "export", "optional", "private", "protected", "public", "readonly", "static"]);
|
|
123
|
+
const _ip1 = input => undefined === input["evidence"] || "object" === typeof input["evidence"] && null !== input["evidence"] && _io4(input["evidence"]);
|
|
124
|
+
const _iv2 = new Set(["accesses", "calls", "contains", "decorates", "dispatches", "exports", "extends", "implements", "imports", "instantiates", "overrides", "renders", "tests", "type_ref"]);
|
|
125
|
+
const _av0 = new Set(["class", "enum", "external_symbol", "file", "function", "interface", "method", "module", "namespace", "package", "parameter", "property", "type", "variable"]);
|
|
126
|
+
const _ae0 = "(\"class\" | \"enum\" | \"external_symbol\" | \"file\" | \"function\" | \"interface\" | \"method\" | \"module\" | \"namespace\" | \"package\" | \"parameter\" | \"property\" | \"type\" | \"variable\")";
|
|
127
|
+
const _ap0 = (input, _path, _exceptionable = true) => "string" === typeof input["name"] || _assertGuard_1._assertGuard(_exceptionable, {
|
|
128
|
+
method: "typia.assert",
|
|
129
|
+
path: _path + ".name",
|
|
130
|
+
expected: "string",
|
|
131
|
+
value: input["name"]
|
|
132
|
+
}, _errorFactory);
|
|
133
|
+
const _av1 = new Set(["abstract", "async", "const", "declare", "default", "export", "optional", "private", "protected", "public", "readonly", "static"]);
|
|
134
|
+
const _ae1 = "(\"abstract\" | \"async\" | \"const\" | \"declare\" | \"default\" | \"export\" | \"optional\" | \"private\" | \"protected\" | \"public\" | \"readonly\" | \"static\")";
|
|
135
|
+
const _ap1 = (input, _path, _exceptionable = true) => undefined === input["evidence"] || ("object" === typeof input["evidence"] && null !== input["evidence"] || _assertGuard_1._assertGuard(_exceptionable, {
|
|
136
|
+
method: "typia.assert",
|
|
137
|
+
path: _path + ".evidence",
|
|
138
|
+
expected: "(ITtscGraphSpan | undefined)",
|
|
139
|
+
value: input["evidence"]
|
|
140
|
+
}, _errorFactory)) && _ao4(input["evidence"], _path + ".evidence", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
141
|
+
method: "typia.assert",
|
|
142
|
+
path: _path + ".evidence",
|
|
143
|
+
expected: "(ITtscGraphSpan | undefined)",
|
|
144
|
+
value: input["evidence"]
|
|
145
|
+
}, _errorFactory);
|
|
146
|
+
const _av2 = new Set(["accesses", "calls", "contains", "decorates", "dispatches", "exports", "extends", "implements", "imports", "instantiates", "overrides", "renders", "tests", "type_ref"]);
|
|
147
|
+
const _ae2 = "(\"accesses\" | \"calls\" | \"contains\" | \"decorates\" | \"dispatches\" | \"exports\" | \"extends\" | \"implements\" | \"imports\" | \"instantiates\" | \"overrides\" | \"renders\" | \"tests\" | \"type_ref\")";
|
|
148
|
+
const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.project || _assertGuard_1._assertGuard(_exceptionable, {
|
|
149
|
+
method: "typia.assert",
|
|
150
|
+
path: _path + ".project",
|
|
151
|
+
expected: "string",
|
|
152
|
+
value: input.project
|
|
153
|
+
}, _errorFactory)) && ("string" === typeof input.tsconfig || _assertGuard_1._assertGuard(_exceptionable, {
|
|
154
|
+
method: "typia.assert",
|
|
155
|
+
path: _path + ".tsconfig",
|
|
156
|
+
expected: "string",
|
|
157
|
+
value: input.tsconfig
|
|
158
|
+
}, _errorFactory)) && ((Array.isArray(input.nodes) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
159
|
+
method: "typia.assert",
|
|
160
|
+
path: _path + ".nodes",
|
|
161
|
+
expected: "Array<ITtscGraphDump.INode>",
|
|
162
|
+
value: input.nodes
|
|
163
|
+
}, _errorFactory)) && input.nodes.every((elem, _index6) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
164
|
+
method: "typia.assert",
|
|
165
|
+
path: _path + ".nodes[" + _index6 + "]",
|
|
166
|
+
expected: "ITtscGraphDump.INode",
|
|
167
|
+
value: elem
|
|
168
|
+
}, _errorFactory)) && _ao1(elem, _path + ".nodes[" + _index6 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
169
|
+
method: "typia.assert",
|
|
170
|
+
path: _path + ".nodes[" + _index6 + "]",
|
|
171
|
+
expected: "ITtscGraphDump.INode",
|
|
172
|
+
value: elem
|
|
173
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
174
|
+
method: "typia.assert",
|
|
175
|
+
path: _path + ".nodes",
|
|
176
|
+
expected: "Array<ITtscGraphDump.INode>",
|
|
177
|
+
value: input.nodes
|
|
178
|
+
}, _errorFactory)) && ((Array.isArray(input.edges) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
179
|
+
method: "typia.assert",
|
|
180
|
+
path: _path + ".edges",
|
|
181
|
+
expected: "Array<ITtscGraphDump.IEdge>",
|
|
182
|
+
value: input.edges
|
|
183
|
+
}, _errorFactory)) && input.edges.every((elem, _index7) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
184
|
+
method: "typia.assert",
|
|
185
|
+
path: _path + ".edges[" + _index7 + "]",
|
|
186
|
+
expected: "ITtscGraphDump.IEdge",
|
|
187
|
+
value: elem
|
|
188
|
+
}, _errorFactory)) && _ao5(elem, _path + ".edges[" + _index7 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
189
|
+
method: "typia.assert",
|
|
190
|
+
path: _path + ".edges[" + _index7 + "]",
|
|
191
|
+
expected: "ITtscGraphDump.IEdge",
|
|
192
|
+
value: elem
|
|
193
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
194
|
+
method: "typia.assert",
|
|
195
|
+
path: _path + ".edges",
|
|
196
|
+
expected: "Array<ITtscGraphDump.IEdge>",
|
|
197
|
+
value: input.edges
|
|
198
|
+
}, _errorFactory));
|
|
199
|
+
const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || _assertGuard_1._assertGuard(_exceptionable, {
|
|
200
|
+
method: "typia.assert",
|
|
201
|
+
path: _path + ".id",
|
|
202
|
+
expected: "string",
|
|
203
|
+
value: input.id
|
|
204
|
+
}, _errorFactory)) && (true === _av0.has(input.kind) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
205
|
+
method: "typia.assert",
|
|
206
|
+
path: _path + ".kind",
|
|
207
|
+
expected: _ae0,
|
|
208
|
+
value: input.kind
|
|
209
|
+
}, _errorFactory)) && _ap0(input, _path, true && _exceptionable) && (undefined === input.qualifiedName || "string" === typeof input.qualifiedName || _assertGuard_1._assertGuard(_exceptionable, {
|
|
210
|
+
method: "typia.assert",
|
|
211
|
+
path: _path + ".qualifiedName",
|
|
212
|
+
expected: "(string | undefined)",
|
|
213
|
+
value: input.qualifiedName
|
|
214
|
+
}, _errorFactory)) && ("string" === typeof input.file || _assertGuard_1._assertGuard(_exceptionable, {
|
|
215
|
+
method: "typia.assert",
|
|
216
|
+
path: _path + ".file",
|
|
217
|
+
expected: "string",
|
|
218
|
+
value: input.file
|
|
219
|
+
}, _errorFactory)) && ("boolean" === typeof input.external || _assertGuard_1._assertGuard(_exceptionable, {
|
|
220
|
+
method: "typia.assert",
|
|
221
|
+
path: _path + ".external",
|
|
222
|
+
expected: "boolean",
|
|
223
|
+
value: input.external
|
|
224
|
+
}, _errorFactory)) && (undefined === input.ignored || "boolean" === typeof input.ignored || _assertGuard_1._assertGuard(_exceptionable, {
|
|
225
|
+
method: "typia.assert",
|
|
226
|
+
path: _path + ".ignored",
|
|
227
|
+
expected: "(boolean | undefined)",
|
|
228
|
+
value: input.ignored
|
|
229
|
+
}, _errorFactory)) && (undefined === input.exported || "boolean" === typeof input.exported || _assertGuard_1._assertGuard(_exceptionable, {
|
|
230
|
+
method: "typia.assert",
|
|
231
|
+
path: _path + ".exported",
|
|
232
|
+
expected: "(boolean | undefined)",
|
|
233
|
+
value: input.exported
|
|
234
|
+
}, _errorFactory)) && (undefined === input.closure || "boolean" === typeof input.closure || _assertGuard_1._assertGuard(_exceptionable, {
|
|
235
|
+
method: "typia.assert",
|
|
236
|
+
path: _path + ".closure",
|
|
237
|
+
expected: "(boolean | undefined)",
|
|
238
|
+
value: input.closure
|
|
239
|
+
}, _errorFactory)) && (undefined === input.modifiers || (Array.isArray(input.modifiers) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
240
|
+
method: "typia.assert",
|
|
241
|
+
path: _path + ".modifiers",
|
|
242
|
+
expected: "(Array<TtscGraphNodeModifier> | undefined)",
|
|
243
|
+
value: input.modifiers
|
|
244
|
+
}, _errorFactory)) && input.modifiers.every((elem, _index8) => true === _av1.has(elem) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
245
|
+
method: "typia.assert",
|
|
246
|
+
path: _path + ".modifiers[" + _index8 + "]",
|
|
247
|
+
expected: _ae1,
|
|
248
|
+
value: elem
|
|
249
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
250
|
+
method: "typia.assert",
|
|
251
|
+
path: _path + ".modifiers",
|
|
252
|
+
expected: "(Array<TtscGraphNodeModifier> | undefined)",
|
|
253
|
+
value: input.modifiers
|
|
254
|
+
}, _errorFactory)) && (undefined === input.decorators || (Array.isArray(input.decorators) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
255
|
+
method: "typia.assert",
|
|
256
|
+
path: _path + ".decorators",
|
|
257
|
+
expected: "(Array<ITtscGraphDecorator> | undefined)",
|
|
258
|
+
value: input.decorators
|
|
259
|
+
}, _errorFactory)) && input.decorators.every((elem, _index9) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
|
|
260
|
+
method: "typia.assert",
|
|
261
|
+
path: _path + ".decorators[" + _index9 + "]",
|
|
262
|
+
expected: "ITtscGraphDecorator",
|
|
263
|
+
value: elem
|
|
264
|
+
}, _errorFactory)) && _ao2(elem, _path + ".decorators[" + _index9 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
265
|
+
method: "typia.assert",
|
|
266
|
+
path: _path + ".decorators[" + _index9 + "]",
|
|
267
|
+
expected: "ITtscGraphDecorator",
|
|
268
|
+
value: elem
|
|
269
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
270
|
+
method: "typia.assert",
|
|
271
|
+
path: _path + ".decorators",
|
|
272
|
+
expected: "(Array<ITtscGraphDecorator> | undefined)",
|
|
273
|
+
value: input.decorators
|
|
274
|
+
}, _errorFactory)) && _ap1(input, _path, true && _exceptionable) && (undefined === input.implementation || ("object" === typeof input.implementation && null !== input.implementation || _assertGuard_1._assertGuard(_exceptionable, {
|
|
275
|
+
method: "typia.assert",
|
|
276
|
+
path: _path + ".implementation",
|
|
277
|
+
expected: "(ITtscGraphSpan | undefined)",
|
|
278
|
+
value: input.implementation
|
|
279
|
+
}, _errorFactory)) && _ao4(input.implementation, _path + ".implementation", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
280
|
+
method: "typia.assert",
|
|
281
|
+
path: _path + ".implementation",
|
|
282
|
+
expected: "(ITtscGraphSpan | undefined)",
|
|
283
|
+
value: input.implementation
|
|
284
|
+
}, _errorFactory));
|
|
285
|
+
const _ao2 = (input, _path, _exceptionable = true) => _ap0(input, _path, true && _exceptionable) && ((Array.isArray(input.arguments) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
286
|
+
method: "typia.assert",
|
|
287
|
+
path: _path + ".arguments",
|
|
288
|
+
expected: "Array<ITtscGraphDecorator.IArgument>",
|
|
289
|
+
value: input.arguments
|
|
290
|
+
}, _errorFactory)) && input.arguments.every((elem, _index10) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
291
|
+
method: "typia.assert",
|
|
292
|
+
path: _path + ".arguments[" + _index10 + "]",
|
|
293
|
+
expected: "ITtscGraphDecorator.IArgument",
|
|
294
|
+
value: elem
|
|
295
|
+
}, _errorFactory)) && _ao3(elem, _path + ".arguments[" + _index10 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
296
|
+
method: "typia.assert",
|
|
297
|
+
path: _path + ".arguments[" + _index10 + "]",
|
|
298
|
+
expected: "ITtscGraphDecorator.IArgument",
|
|
299
|
+
value: elem
|
|
300
|
+
}, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
301
|
+
method: "typia.assert",
|
|
302
|
+
path: _path + ".arguments",
|
|
303
|
+
expected: "Array<ITtscGraphDecorator.IArgument>",
|
|
304
|
+
value: input.arguments
|
|
305
|
+
}, _errorFactory));
|
|
306
|
+
const _ao3 = (input, _path, _exceptionable = true) => undefined === input.literal || "string" === typeof input.literal || "number" === typeof input.literal || "boolean" === typeof input.literal || _assertGuard_1._assertGuard(_exceptionable, {
|
|
307
|
+
method: "typia.assert",
|
|
308
|
+
path: _path + ".literal",
|
|
309
|
+
expected: "(boolean | number | string | undefined)",
|
|
310
|
+
value: input.literal
|
|
311
|
+
}, _errorFactory);
|
|
312
|
+
const _ao4 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || _assertGuard_1._assertGuard(_exceptionable, {
|
|
313
|
+
method: "typia.assert",
|
|
314
|
+
path: _path + ".file",
|
|
315
|
+
expected: "(string | undefined)",
|
|
316
|
+
value: input.file
|
|
317
|
+
}, _errorFactory)) && ("number" === typeof input.startLine || _assertGuard_1._assertGuard(_exceptionable, {
|
|
318
|
+
method: "typia.assert",
|
|
319
|
+
path: _path + ".startLine",
|
|
320
|
+
expected: "number",
|
|
321
|
+
value: input.startLine
|
|
322
|
+
}, _errorFactory)) && (undefined === input.startCol || "number" === typeof input.startCol || _assertGuard_1._assertGuard(_exceptionable, {
|
|
323
|
+
method: "typia.assert",
|
|
324
|
+
path: _path + ".startCol",
|
|
325
|
+
expected: "(number | undefined)",
|
|
326
|
+
value: input.startCol
|
|
327
|
+
}, _errorFactory)) && (undefined === input.endLine || "number" === typeof input.endLine || _assertGuard_1._assertGuard(_exceptionable, {
|
|
328
|
+
method: "typia.assert",
|
|
329
|
+
path: _path + ".endLine",
|
|
330
|
+
expected: "(number | undefined)",
|
|
331
|
+
value: input.endLine
|
|
332
|
+
}, _errorFactory)) && (undefined === input.endCol || "number" === typeof input.endCol || _assertGuard_1._assertGuard(_exceptionable, {
|
|
333
|
+
method: "typia.assert",
|
|
334
|
+
path: _path + ".endCol",
|
|
335
|
+
expected: "(number | undefined)",
|
|
336
|
+
value: input.endCol
|
|
337
|
+
}, _errorFactory));
|
|
338
|
+
const _ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.from || _assertGuard_1._assertGuard(_exceptionable, {
|
|
339
|
+
method: "typia.assert",
|
|
340
|
+
path: _path + ".from",
|
|
341
|
+
expected: "string",
|
|
342
|
+
value: input.from
|
|
343
|
+
}, _errorFactory)) && ("string" === typeof input.to || _assertGuard_1._assertGuard(_exceptionable, {
|
|
344
|
+
method: "typia.assert",
|
|
345
|
+
path: _path + ".to",
|
|
346
|
+
expected: "string",
|
|
347
|
+
value: input.to
|
|
348
|
+
}, _errorFactory)) && (true === _av2.has(input.kind) || _assertGuard_1._assertGuard(_exceptionable, {
|
|
349
|
+
method: "typia.assert",
|
|
350
|
+
path: _path + ".kind",
|
|
351
|
+
expected: _ae2,
|
|
352
|
+
value: input.kind
|
|
353
|
+
}, _errorFactory)) && _ap1(input, _path, true && _exceptionable);
|
|
354
|
+
const _io0 = input => "string" === typeof input.project && "string" === typeof input.tsconfig && (Array.isArray(input.nodes) && input.nodes.every(elem => "object" === typeof elem && null !== elem && _io1(elem))) && (Array.isArray(input.edges) && input.edges.every(elem => "object" === typeof elem && null !== elem && _io5(elem)));
|
|
355
|
+
const _io1 = input => "string" === typeof input.id && true === _iv0.has(input.kind) && _ip0(input) && (undefined === input.qualifiedName || "string" === typeof input.qualifiedName) && "string" === typeof input.file && "boolean" === typeof input.external && (undefined === input.ignored || "boolean" === typeof input.ignored) && (undefined === input.exported || "boolean" === typeof input.exported) && (undefined === input.closure || "boolean" === typeof input.closure) && (undefined === input.modifiers || Array.isArray(input.modifiers) && input.modifiers.every(elem => true === _iv1.has(elem))) && (undefined === input.decorators || Array.isArray(input.decorators) && input.decorators.every(elem => "object" === typeof elem && null !== elem && _io2(elem))) && _ip1(input) && (undefined === input.implementation || "object" === typeof input.implementation && null !== input.implementation && _io4(input.implementation));
|
|
356
|
+
const _io2 = input => _ip0(input) && (Array.isArray(input.arguments) && input.arguments.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io3(elem)));
|
|
357
|
+
const _io3 = input => undefined === input.literal || "string" === typeof input.literal || "number" === typeof input.literal || "boolean" === typeof input.literal;
|
|
358
|
+
const _io4 = input => (undefined === input.file || "string" === typeof input.file) && "number" === typeof input.startLine && (undefined === input.startCol || "number" === typeof input.startCol) && (undefined === input.endLine || "number" === typeof input.endLine) && (undefined === input.endCol || "number" === typeof input.endCol);
|
|
359
|
+
const _io5 = input => "string" === typeof input.from && "string" === typeof input.to && true === _iv2.has(input.kind) && _ip1(input);
|
|
360
|
+
const __is = input => "object" === typeof input && null !== input && _io0(input);
|
|
361
|
+
let _errorFactory;
|
|
362
|
+
return (input, errorFactory) => {
|
|
363
|
+
if (false === __is(input)) {
|
|
364
|
+
_errorFactory = errorFactory;
|
|
365
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _assertGuard_1._assertGuard(true, {
|
|
366
|
+
method: "typia.assert",
|
|
367
|
+
path: _path + "",
|
|
368
|
+
expected: "ITtscGraphDump",
|
|
369
|
+
value: input
|
|
370
|
+
}, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard_1._assertGuard(true, {
|
|
371
|
+
method: "typia.assert",
|
|
372
|
+
path: _path + "",
|
|
373
|
+
expected: "ITtscGraphDump",
|
|
374
|
+
value: input
|
|
375
|
+
}, _errorFactory))(input, "$input", true);
|
|
376
|
+
}
|
|
377
|
+
return input;
|
|
378
|
+
};
|
|
379
|
+
})()(response.dump);
|
|
380
|
+
this.current = TtscGraphMemory_1.TtscGraphMemory.from(dump);
|
|
381
|
+
}
|
|
382
|
+
if (this.current === undefined) {
|
|
383
|
+
throw new Error("@ttsc/graph: native session returned no initial graph snapshot");
|
|
384
|
+
}
|
|
385
|
+
return this.current;
|
|
386
|
+
}
|
|
387
|
+
request() {
|
|
388
|
+
const child = this.ensureChild();
|
|
389
|
+
const id = ++this.nextId;
|
|
390
|
+
return new Promise((resolve, reject) => {
|
|
391
|
+
this.pending.set(id, { resolve, reject });
|
|
392
|
+
child.stdin.write(`${JSON.stringify({ id })}\n`, (error) => {
|
|
393
|
+
if (error === null || error === undefined)
|
|
394
|
+
return;
|
|
395
|
+
this.pending.delete(id);
|
|
396
|
+
reject(new Error(`@ttsc/graph: could not request native snapshot: ${error.message}`));
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
ensureChild() {
|
|
401
|
+
if (this.closed) {
|
|
402
|
+
// A request queued behind the close must not respawn the native
|
|
403
|
+
// process; an orphaned resident compiler would outlive the MCP server.
|
|
404
|
+
throw new Error("@ttsc/graph: native session is closed");
|
|
405
|
+
}
|
|
406
|
+
if (this.child !== undefined && this.child.exitCode === null) {
|
|
407
|
+
return this.child;
|
|
408
|
+
}
|
|
409
|
+
this.stderr = "";
|
|
410
|
+
const child = (0, node_child_process_1.spawn)(this.binary, ["serve", "--cwd", this.cwd, "--tsconfig", this.tsconfig], { stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
|
|
411
|
+
this.child = child;
|
|
412
|
+
child.stderr.setEncoding("utf8");
|
|
413
|
+
child.stderr.on("data", (chunk) => {
|
|
414
|
+
this.stderr = (this.stderr + chunk).slice(-64 * 1024);
|
|
415
|
+
});
|
|
416
|
+
const lines = node_readline_1.default.createInterface({ input: child.stdout });
|
|
417
|
+
lines.on("line", (line) => this.onLine(line));
|
|
418
|
+
child.on("error", (error) => this.failChild(child, error));
|
|
419
|
+
child.on("exit", (code, signal) => {
|
|
420
|
+
if (this.child !== child)
|
|
421
|
+
return;
|
|
422
|
+
this.child = undefined;
|
|
423
|
+
this.failPending(new Error(`@ttsc/graph: native session exited (code=${String(code)}, signal=${String(signal)})${this.stderr.trim() === "" ? "" : `: ${this.stderr.trim()}`}`));
|
|
424
|
+
});
|
|
425
|
+
return child;
|
|
426
|
+
}
|
|
427
|
+
onLine(line) {
|
|
428
|
+
let response;
|
|
429
|
+
try {
|
|
430
|
+
response = JSON.parse(line);
|
|
431
|
+
}
|
|
432
|
+
catch (error) {
|
|
433
|
+
this.failPending(new Error(`@ttsc/graph: native session returned invalid JSON: ${asError(error).message}`));
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
const pending = this.pending.get(response.id);
|
|
437
|
+
if (pending === undefined)
|
|
438
|
+
return;
|
|
439
|
+
this.pending.delete(response.id);
|
|
440
|
+
pending.resolve(response);
|
|
441
|
+
}
|
|
442
|
+
failChild(child, error) {
|
|
443
|
+
if (this.child === child)
|
|
444
|
+
this.child = undefined;
|
|
445
|
+
this.failPending(new Error(`@ttsc/graph: native session failed: ${error.message}`));
|
|
446
|
+
}
|
|
447
|
+
failPending(error) {
|
|
448
|
+
for (const pending of this.pending.values())
|
|
449
|
+
pending.reject(error);
|
|
450
|
+
this.pending.clear();
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
exports.TtscGraphSession = TtscGraphSession;
|
|
454
|
+
function asError(error) {
|
|
455
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
456
|
+
}
|
|
457
|
+
//# sourceMappingURL=TtscGraphSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TtscGraphSession.js","sourceRoot":"","sources":["../../src/model/TtscGraphSession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA2E;AAC3E,kEAAqC;AACrC,kDAA0B;AAE1B,0DAAuD;AACvD,8DAA2D;AAE3D,uDAAoD;AAepD;;;;;;;GAOG;AACH;IACmB,GAAG,CAAS;IACZ,QAAQ,CAAS;IACjB,MAAM,CAAS;IACxB,KAAK,CAA6C;IAClD,MAAM,GAAG,EAAE,CAAC;IACZ,MAAM,GAAG,CAAC,CAAC;IACF,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,KAAK,GAAkB,OAAO,CAAC,OAAO,EAAE,C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CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACnE,CAAC"}
|
package/lib/model/loadGraph.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TtscGraphMemory } from "./TtscGraphMemory";
|
|
2
2
|
/**
|
|
3
3
|
* Build the resident {@link TtscGraphMemory} for a project by running `ttscgraph
|
|
4
|
-
* dump` once and loading its JSON. This is the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* dump` once and loading its JSON. This is the one-shot path for direct callers
|
|
5
|
+
* and the viewer. The MCP server uses `TtscGraphSession` instead so source
|
|
6
|
+
* edits refresh a resident compiler session.
|
|
7
7
|
*
|
|
8
8
|
* Throws when the binary cannot be resolved, the dump command fails, or its
|
|
9
9
|
* output is not a readable graph — the server surfaces the failure rather than
|