@ttsc/graph 0.19.1 → 0.19.3

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 (46) hide show
  1. package/lib/TtscGraphApplication.js +3 -1
  2. package/lib/TtscGraphApplication.js.map +1 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/index.js +2 -1
  5. package/lib/index.js.map +1 -1
  6. package/lib/model/TtscGraphSession.js +509 -162
  7. package/lib/model/TtscGraphSession.js.map +1 -1
  8. package/lib/model/loadGraph.d.ts +14 -0
  9. package/lib/model/loadGraph.js +382 -101
  10. package/lib/model/loadGraph.js.map +1 -1
  11. package/lib/resolveGraphBinary.d.ts +9 -3
  12. package/lib/resolveGraphBinary.js +9 -3
  13. package/lib/resolveGraphBinary.js.map +1 -1
  14. package/lib/server/createServer.js +5 -5
  15. package/lib/server/resultAudit.d.ts +29 -8
  16. package/lib/server/resultAudit.js +47 -9
  17. package/lib/server/resultAudit.js.map +1 -1
  18. package/lib/server/runDetails.d.ts +7 -0
  19. package/lib/server/runDetails.js +87 -58
  20. package/lib/server/runDetails.js.map +1 -1
  21. package/lib/structures/ITtscGraphApplication.d.ts +8 -7
  22. package/lib/structures/ITtscGraphDetails.d.ts +18 -8
  23. package/lib/structures/ITtscGraphDump.d.ts +169 -6
  24. package/lib/structures/ITtscGraphNode.d.ts +37 -0
  25. package/lib/structures/ITtscGraphSnapshot.d.ts +55 -0
  26. package/lib/structures/ITtscGraphSnapshot.js +3 -0
  27. package/lib/structures/ITtscGraphSnapshot.js.map +1 -0
  28. package/lib/structures/ITtscGraphTour.d.ts +1 -1
  29. package/lib/structures/index.d.ts +1 -0
  30. package/lib/structures/index.js +1 -0
  31. package/lib/structures/index.js.map +1 -1
  32. package/package.json +5 -2
  33. package/src/TtscGraphApplication.ts +4 -1
  34. package/src/index.ts +1 -0
  35. package/src/model/TtscGraphSession.ts +89 -16
  36. package/src/model/loadGraph.ts +36 -0
  37. package/src/resolveGraphBinary.ts +9 -3
  38. package/src/server/resultAudit.ts +47 -8
  39. package/src/server/runDetails.ts +95 -70
  40. package/src/structures/ITtscGraphApplication.ts +8 -7
  41. package/src/structures/ITtscGraphDetails.ts +18 -8
  42. package/src/structures/ITtscGraphDump.ts +194 -6
  43. package/src/structures/ITtscGraphNode.ts +40 -0
  44. package/src/structures/ITtscGraphSnapshot.ts +69 -0
  45. package/src/structures/ITtscGraphTour.ts +1 -1
  46. package/src/structures/index.ts +1 -0
@@ -43,7 +43,17 @@ const node_readline_1 = __importDefault(require("node:readline"));
43
43
  const typia_1 = __importDefault(require("typia"));
44
44
  const nativeExecutable_1 = require("../nativeExecutable");
45
45
  const resolveGraphBinary_1 = require("../resolveGraphBinary");
46
+ const loadGraph_1 = require("./loadGraph");
46
47
  const TtscGraphMemory_1 = require("./TtscGraphMemory");
48
+ /**
49
+ * The serve protocol version this client speaks.
50
+ *
51
+ * Keep it equal to `serveProtocolVersion` in
52
+ * `packages/ttsc/cmd/ttscgraph/serve.go`. The two are hand-synchronized, and
53
+ * `serve_protocol_version_matches_the_typescript_client_test.go` reads this
54
+ * constant out of this file and fails if the pair drifts.
55
+ */
56
+ const PROTOCOL_VERSION = 1;
47
57
  /**
48
58
  * Resident bridge to `ttscgraph serve`.
49
59
  *
@@ -108,23 +118,131 @@ class TtscGraphSession {
108
118
  this.failPending(new Error("@ttsc/graph: native session closed"));
109
119
  }
110
120
  async refresh() {
121
+ // The protocol version and the envelope shape were both settled in onLine,
122
+ // before this frame was ever routed here.
111
123
  const response = await this.request();
112
124
  if (response.error !== undefined) {
113
125
  throw new Error(`@ttsc/graph: ${response.error}`);
114
126
  }
115
127
  if (response.changed) {
116
128
  if (response.dump === undefined) {
117
- throw new Error(`@ttsc/graph: native ${response.mode ?? "changed"} response omitted its dump`);
129
+ throw new Error(`@ttsc/graph: native ${response.mode} response omitted its dump`);
118
130
  }
119
- const dump = (() => {
131
+ this.current = TtscGraphMemory_1.TtscGraphMemory.from(response.dump);
132
+ }
133
+ if (this.current === undefined) {
134
+ throw new Error("@ttsc/graph: native session returned no initial graph snapshot");
135
+ }
136
+ return this.current;
137
+ }
138
+ request() {
139
+ const child = this.ensureChild();
140
+ const id = ++this.nextId;
141
+ return new Promise((resolve, reject) => {
142
+ this.pending.set(id, { resolve, reject });
143
+ child.stdin.write(`${JSON.stringify({ id })}\n`, (error) => {
144
+ if (error === null || error === undefined)
145
+ return;
146
+ this.pending.delete(id);
147
+ reject(new Error(`@ttsc/graph: could not request native snapshot: ${error.message}`));
148
+ });
149
+ });
150
+ }
151
+ ensureChild() {
152
+ if (this.closed) {
153
+ // A request queued behind the close must not respawn the native
154
+ // process; an orphaned resident compiler would outlive the MCP server.
155
+ throw new Error("@ttsc/graph: native session is closed");
156
+ }
157
+ if (this.child !== undefined && this.child.exitCode === null) {
158
+ return this.child;
159
+ }
160
+ this.stderr = "";
161
+ const child = (0, node_child_process_1.spawn)(this.binary, ["serve", "--cwd", this.cwd, "--tsconfig", this.tsconfig], { stdio: ["pipe", "pipe", "pipe"], windowsHide: true });
162
+ this.child = child;
163
+ child.stderr.setEncoding("utf8");
164
+ child.stderr.on("data", (chunk) => {
165
+ this.stderr = (this.stderr + chunk).slice(-64 * 1024);
166
+ });
167
+ const lines = node_readline_1.default.createInterface({ input: child.stdout });
168
+ lines.on("line", (line) => this.onLine(line));
169
+ child.on("error", (error) => this.failChild(child, error));
170
+ child.on("exit", (code, signal) => {
171
+ if (this.child !== child)
172
+ return;
173
+ this.child = undefined;
174
+ this.failPending(new Error(`@ttsc/graph: native session exited (code=${String(code)}, signal=${String(signal)})${this.stderr.trim() === "" ? "" : `: ${this.stderr.trim()}`}`));
175
+ });
176
+ return child;
177
+ }
178
+ onLine(line) {
179
+ let parsed;
180
+ try {
181
+ parsed = JSON.parse(line);
182
+ }
183
+ catch (error) {
184
+ this.failPending(new Error(`@ttsc/graph: native session returned invalid JSON: ${asError(error).message}`));
185
+ return;
186
+ }
187
+ // Read the version before the shape, because a server speaking another
188
+ // version is entitled to a different shape. Asserting first would report
189
+ // that mismatch as a field complaint — "expected string at $input.mode" —
190
+ // about a contract the other side never agreed to, which is the misparse
191
+ // this field exists to prevent. Ask what protocol it is first, then hold it
192
+ // to that protocol.
193
+ const version = (() => {
194
+ const _io0 = input => "number" === typeof input.protocolVersion;
195
+ return input => "object" === typeof input && null !== input && _io0(input);
196
+ })()(parsed) ? parsed.protocolVersion
197
+ : undefined;
198
+ if (version !== PROTOCOL_VERSION) {
199
+ // Session-wide: a version mismatch is not one bad frame, it is the wrong
200
+ // binary, and every request against it is equally doomed.
201
+ this.failPending(new Error(`@ttsc/graph: ttscgraph speaks serve protocol ${version === undefined ? "an unknown version" : `v${String(version)}`}, this client speaks v${String(PROTOCOL_VERSION)}. ` +
202
+ "Install a matching `ttsc` (the binary resolves from the target " +
203
+ "project, or from TTSC_GRAPH_BINARY)."));
204
+ return;
205
+ }
206
+ let response;
207
+ try {
208
+ // Validate the envelope, not just the dump it carries. The dump was
209
+ // typia-asserted while the envelope around it was a bare cast, so the
210
+ // fields the client actually branches on — the mode, and the id that
211
+ // routes the frame — were the unchecked ones. Anything added to the
212
+ // envelope belongs on this side of that line.
213
+ response = (() => {
214
+ const _ip0 = input => Array.isArray(input["capabilities"]) && input["capabilities"].every(elem => "string" === typeof elem);
215
+ const _ip1 = input => "string" === typeof input["file"];
120
216
  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"];
217
+ const _ip2 = input => "string" === typeof input["name"];
122
218
  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"]);
219
+ const _ip3 = input => undefined === input["evidence"] || "object" === typeof input["evidence"] && null !== input["evidence"] && _io13(input["evidence"]);
124
220
  const _iv2 = new Set(["accesses", "calls", "contains", "decorates", "dispatches", "exports", "extends", "implements", "imports", "instantiates", "overrides", "renders", "tests", "type_ref"]);
221
+ const _ap0 = (input, _path, _exceptionable = true) => (Array.isArray(input["capabilities"]) || _assertGuard_1._assertGuard(_exceptionable, {
222
+ method: "typia.assert",
223
+ path: _path + ".capabilities",
224
+ expected: "Array<string>",
225
+ value: input["capabilities"]
226
+ }, _errorFactory)) && input["capabilities"].every((elem, _index13) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
227
+ method: "typia.assert",
228
+ path: _path + ".capabilities[" + _index13 + "]",
229
+ expected: "string",
230
+ value: elem
231
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
232
+ method: "typia.assert",
233
+ path: _path + ".capabilities",
234
+ expected: "Array<string>",
235
+ value: input["capabilities"]
236
+ }, _errorFactory);
237
+ const _ap1 = (input, _path, _exceptionable = true) => "string" === typeof input["file"] || _assertGuard_1._assertGuard(_exceptionable, {
238
+ method: "typia.assert",
239
+ path: _path + ".file",
240
+ expected: "string",
241
+ value: input["file"]
242
+ }, _errorFactory);
125
243
  const _av0 = new Set(["class", "enum", "external_symbol", "file", "function", "interface", "method", "module", "namespace", "package", "parameter", "property", "type", "variable"]);
126
244
  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, {
245
+ const _ap2 = (input, _path, _exceptionable = true) => "string" === typeof input["name"] || _assertGuard_1._assertGuard(_exceptionable, {
128
246
  method: "typia.assert",
129
247
  path: _path + ".name",
130
248
  expected: "string",
@@ -132,12 +250,12 @@ class TtscGraphSession {
132
250
  }, _errorFactory);
133
251
  const _av1 = new Set(["abstract", "async", "const", "declare", "default", "export", "optional", "private", "protected", "public", "readonly", "static"]);
134
252
  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, {
253
+ const _ap3 = (input, _path, _exceptionable = true) => undefined === input["evidence"] || ("object" === typeof input["evidence"] && null !== input["evidence"] || _assertGuard_1._assertGuard(_exceptionable, {
136
254
  method: "typia.assert",
137
255
  path: _path + ".evidence",
138
256
  expected: "(ITtscGraphSpan | undefined)",
139
257
  value: input["evidence"]
140
- }, _errorFactory)) && _ao4(input["evidence"], _path + ".evidence", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
258
+ }, _errorFactory)) && _ao13(input["evidence"], _path + ".evidence", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
141
259
  method: "typia.assert",
142
260
  path: _path + ".evidence",
143
261
  expected: "(ITtscGraphSpan | undefined)",
@@ -145,7 +263,43 @@ class TtscGraphSession {
145
263
  }, _errorFactory);
146
264
  const _av2 = new Set(["accesses", "calls", "contains", "decorates", "dispatches", "exports", "extends", "implements", "imports", "instantiates", "overrides", "renders", "tests", "type_ref"]);
147
265
  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, {
266
+ const _ao0 = (input, _path, _exceptionable = true) => ("number" === typeof input.id || _assertGuard_1._assertGuard(_exceptionable, {
267
+ method: "typia.assert",
268
+ path: _path + ".id",
269
+ expected: "number",
270
+ value: input.id
271
+ }, _errorFactory)) && ("number" === typeof input.protocolVersion || _assertGuard_1._assertGuard(_exceptionable, {
272
+ method: "typia.assert",
273
+ path: _path + ".protocolVersion",
274
+ expected: "number",
275
+ value: input.protocolVersion
276
+ }, _errorFactory)) && ("error" === input.mode || "incremental" === input.mode || "initial" === input.mode || "rebuild" === input.mode || "reload" === input.mode || "unchanged" === input.mode || _assertGuard_1._assertGuard(_exceptionable, {
277
+ method: "typia.assert",
278
+ path: _path + ".mode",
279
+ expected: "(\"error\" | \"incremental\" | \"initial\" | \"rebuild\" | \"reload\" | \"unchanged\")",
280
+ value: input.mode
281
+ }, _errorFactory)) && _ap0(input, _path, true && _exceptionable) && ("boolean" === typeof input.changed || _assertGuard_1._assertGuard(_exceptionable, {
282
+ method: "typia.assert",
283
+ path: _path + ".changed",
284
+ expected: "boolean",
285
+ value: input.changed
286
+ }, _errorFactory)) && (undefined === input.dump || ("object" === typeof input.dump && null !== input.dump || _assertGuard_1._assertGuard(_exceptionable, {
287
+ method: "typia.assert",
288
+ path: _path + ".dump",
289
+ expected: "(ITtscGraphDump | undefined)",
290
+ value: input.dump
291
+ }, _errorFactory)) && _ao1(input.dump, _path + ".dump", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
292
+ method: "typia.assert",
293
+ path: _path + ".dump",
294
+ expected: "(ITtscGraphDump | undefined)",
295
+ value: input.dump
296
+ }, _errorFactory)) && (undefined === input.error || "string" === typeof input.error || _assertGuard_1._assertGuard(_exceptionable, {
297
+ method: "typia.assert",
298
+ path: _path + ".error",
299
+ expected: "(string | undefined)",
300
+ value: input.error
301
+ }, _errorFactory));
302
+ const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.project || _assertGuard_1._assertGuard(_exceptionable, {
149
303
  method: "typia.assert",
150
304
  path: _path + ".project",
151
305
  expected: "string",
@@ -155,19 +309,49 @@ class TtscGraphSession {
155
309
  path: _path + ".tsconfig",
156
310
  expected: "string",
157
311
  value: input.tsconfig
312
+ }, _errorFactory)) && (("object" === typeof input.provenance && null !== input.provenance || _assertGuard_1._assertGuard(_exceptionable, {
313
+ method: "typia.assert",
314
+ path: _path + ".provenance",
315
+ expected: "ITtscGraphDump.IProvenance",
316
+ value: input.provenance
317
+ }, _errorFactory)) && _ao2(input.provenance, _path + ".provenance", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
318
+ method: "typia.assert",
319
+ path: _path + ".provenance",
320
+ expected: "ITtscGraphDump.IProvenance",
321
+ value: input.provenance
322
+ }, _errorFactory)) && ((Array.isArray(input.diagnostics) || _assertGuard_1._assertGuard(_exceptionable, {
323
+ method: "typia.assert",
324
+ path: _path + ".diagnostics",
325
+ expected: "Array<ITtscGraphDump.IDiagnostic>",
326
+ value: input.diagnostics
327
+ }, _errorFactory)) && input.diagnostics.every((elem, _index14) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
328
+ method: "typia.assert",
329
+ path: _path + ".diagnostics[" + _index14 + "]",
330
+ expected: "ITtscGraphDump.IDiagnostic",
331
+ value: elem
332
+ }, _errorFactory)) && _ao8(elem, _path + ".diagnostics[" + _index14 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
333
+ method: "typia.assert",
334
+ path: _path + ".diagnostics[" + _index14 + "]",
335
+ expected: "ITtscGraphDump.IDiagnostic",
336
+ value: elem
337
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
338
+ method: "typia.assert",
339
+ path: _path + ".diagnostics",
340
+ expected: "Array<ITtscGraphDump.IDiagnostic>",
341
+ value: input.diagnostics
158
342
  }, _errorFactory)) && ((Array.isArray(input.nodes) || _assertGuard_1._assertGuard(_exceptionable, {
159
343
  method: "typia.assert",
160
344
  path: _path + ".nodes",
161
345
  expected: "Array<ITtscGraphDump.INode>",
162
346
  value: input.nodes
163
- }, _errorFactory)) && input.nodes.every((elem, _index6) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
347
+ }, _errorFactory)) && input.nodes.every((elem, _index15) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
164
348
  method: "typia.assert",
165
- path: _path + ".nodes[" + _index6 + "]",
349
+ path: _path + ".nodes[" + _index15 + "]",
166
350
  expected: "ITtscGraphDump.INode",
167
351
  value: elem
168
- }, _errorFactory)) && _ao1(elem, _path + ".nodes[" + _index6 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
352
+ }, _errorFactory)) && _ao9(elem, _path + ".nodes[" + _index15 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
169
353
  method: "typia.assert",
170
- path: _path + ".nodes[" + _index6 + "]",
354
+ path: _path + ".nodes[" + _index15 + "]",
171
355
  expected: "ITtscGraphDump.INode",
172
356
  value: elem
173
357
  }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
@@ -180,14 +364,14 @@ class TtscGraphSession {
180
364
  path: _path + ".edges",
181
365
  expected: "Array<ITtscGraphDump.IEdge>",
182
366
  value: input.edges
183
- }, _errorFactory)) && input.edges.every((elem, _index7) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
367
+ }, _errorFactory)) && input.edges.every((elem, _index16) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
184
368
  method: "typia.assert",
185
- path: _path + ".edges[" + _index7 + "]",
369
+ path: _path + ".edges[" + _index16 + "]",
186
370
  expected: "ITtscGraphDump.IEdge",
187
371
  value: elem
188
- }, _errorFactory)) && _ao5(elem, _path + ".edges[" + _index7 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
372
+ }, _errorFactory)) && _ao14(elem, _path + ".edges[" + _index16 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
189
373
  method: "typia.assert",
190
- path: _path + ".edges[" + _index7 + "]",
374
+ path: _path + ".edges[" + _index16 + "]",
191
375
  expected: "ITtscGraphDump.IEdge",
192
376
  value: elem
193
377
  }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
@@ -196,7 +380,234 @@ class TtscGraphSession {
196
380
  expected: "Array<ITtscGraphDump.IEdge>",
197
381
  value: input.edges
198
382
  }, _errorFactory));
199
- const _ao1 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || _assertGuard_1._assertGuard(_exceptionable, {
383
+ const _ao10 = (input, _path, _exceptionable = true) => _ap2(input, _path, true && _exceptionable) && (undefined === input.value || "string" === typeof input.value || _assertGuard_1._assertGuard(_exceptionable, {
384
+ method: "typia.assert",
385
+ path: _path + ".value",
386
+ expected: "(string | undefined)",
387
+ value: input.value
388
+ }, _errorFactory));
389
+ const _ao11 = (input, _path, _exceptionable = true) => _ap2(input, _path, true && _exceptionable) && ((Array.isArray(input.arguments) || _assertGuard_1._assertGuard(_exceptionable, {
390
+ method: "typia.assert",
391
+ path: _path + ".arguments",
392
+ expected: "Array<ITtscGraphDecorator.IArgument>",
393
+ value: input.arguments
394
+ }, _errorFactory)) && input.arguments.every((elem, _index24) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || _assertGuard_1._assertGuard(_exceptionable, {
395
+ method: "typia.assert",
396
+ path: _path + ".arguments[" + _index24 + "]",
397
+ expected: "ITtscGraphDecorator.IArgument",
398
+ value: elem
399
+ }, _errorFactory)) && _ao12(elem, _path + ".arguments[" + _index24 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
400
+ method: "typia.assert",
401
+ path: _path + ".arguments[" + _index24 + "]",
402
+ expected: "ITtscGraphDecorator.IArgument",
403
+ value: elem
404
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
405
+ method: "typia.assert",
406
+ path: _path + ".arguments",
407
+ expected: "Array<ITtscGraphDecorator.IArgument>",
408
+ value: input.arguments
409
+ }, _errorFactory));
410
+ const _ao12 = (input, _path, _exceptionable = true) => undefined === input.literal || "string" === typeof input.literal || "number" === typeof input.literal || "boolean" === typeof input.literal || _assertGuard_1._assertGuard(_exceptionable, {
411
+ method: "typia.assert",
412
+ path: _path + ".literal",
413
+ expected: "(boolean | number | string | undefined)",
414
+ value: input.literal
415
+ }, _errorFactory);
416
+ const _ao13 = (input, _path, _exceptionable = true) => (undefined === input.file || "string" === typeof input.file || _assertGuard_1._assertGuard(_exceptionable, {
417
+ method: "typia.assert",
418
+ path: _path + ".file",
419
+ expected: "(string | undefined)",
420
+ value: input.file
421
+ }, _errorFactory)) && ("number" === typeof input.startLine || _assertGuard_1._assertGuard(_exceptionable, {
422
+ method: "typia.assert",
423
+ path: _path + ".startLine",
424
+ expected: "number",
425
+ value: input.startLine
426
+ }, _errorFactory)) && (undefined === input.startCol || "number" === typeof input.startCol || _assertGuard_1._assertGuard(_exceptionable, {
427
+ method: "typia.assert",
428
+ path: _path + ".startCol",
429
+ expected: "(number | undefined)",
430
+ value: input.startCol
431
+ }, _errorFactory)) && (undefined === input.endLine || "number" === typeof input.endLine || _assertGuard_1._assertGuard(_exceptionable, {
432
+ method: "typia.assert",
433
+ path: _path + ".endLine",
434
+ expected: "(number | undefined)",
435
+ value: input.endLine
436
+ }, _errorFactory)) && (undefined === input.endCol || "number" === typeof input.endCol || _assertGuard_1._assertGuard(_exceptionable, {
437
+ method: "typia.assert",
438
+ path: _path + ".endCol",
439
+ expected: "(number | undefined)",
440
+ value: input.endCol
441
+ }, _errorFactory));
442
+ const _ao14 = (input, _path, _exceptionable = true) => ("string" === typeof input.from || _assertGuard_1._assertGuard(_exceptionable, {
443
+ method: "typia.assert",
444
+ path: _path + ".from",
445
+ expected: "string",
446
+ value: input.from
447
+ }, _errorFactory)) && ("string" === typeof input.to || _assertGuard_1._assertGuard(_exceptionable, {
448
+ method: "typia.assert",
449
+ path: _path + ".to",
450
+ expected: "string",
451
+ value: input.to
452
+ }, _errorFactory)) && (true === _av2.has(input.kind) || _assertGuard_1._assertGuard(_exceptionable, {
453
+ method: "typia.assert",
454
+ path: _path + ".kind",
455
+ expected: _ae2,
456
+ value: input.kind
457
+ }, _errorFactory)) && _ap3(input, _path, true && _exceptionable);
458
+ const _ao2 = (input, _path, _exceptionable = true) => ("number" === typeof input.schemaVersion || _assertGuard_1._assertGuard(_exceptionable, {
459
+ method: "typia.assert",
460
+ path: _path + ".schemaVersion",
461
+ expected: "number",
462
+ value: input.schemaVersion
463
+ }, _errorFactory)) && _ap0(input, _path, true && _exceptionable) && (("object" === typeof input.producer && null !== input.producer || _assertGuard_1._assertGuard(_exceptionable, {
464
+ method: "typia.assert",
465
+ path: _path + ".producer",
466
+ expected: "ITtscGraphDump.IProducer",
467
+ value: input.producer
468
+ }, _errorFactory)) && _ao3(input.producer, _path + ".producer", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
469
+ method: "typia.assert",
470
+ path: _path + ".producer",
471
+ expected: "ITtscGraphDump.IProducer",
472
+ value: input.producer
473
+ }, _errorFactory)) && (("object" === typeof input.universe && null !== input.universe || _assertGuard_1._assertGuard(_exceptionable, {
474
+ method: "typia.assert",
475
+ path: _path + ".universe",
476
+ expected: "ITtscGraphDump.IUniverse",
477
+ value: input.universe
478
+ }, _errorFactory)) && _ao4(input.universe, _path + ".universe", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
479
+ method: "typia.assert",
480
+ path: _path + ".universe",
481
+ expected: "ITtscGraphDump.IUniverse",
482
+ value: input.universe
483
+ }, _errorFactory)) && ((Array.isArray(input.sources) || _assertGuard_1._assertGuard(_exceptionable, {
484
+ method: "typia.assert",
485
+ path: _path + ".sources",
486
+ expected: "Array<ITtscGraphDump.ISourceDigest>",
487
+ value: input.sources
488
+ }, _errorFactory)) && input.sources.every((elem, _index17) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
489
+ method: "typia.assert",
490
+ path: _path + ".sources[" + _index17 + "]",
491
+ expected: "ITtscGraphDump.ISourceDigest",
492
+ value: elem
493
+ }, _errorFactory)) && _ao7(elem, _path + ".sources[" + _index17 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
494
+ method: "typia.assert",
495
+ path: _path + ".sources[" + _index17 + "]",
496
+ expected: "ITtscGraphDump.ISourceDigest",
497
+ value: elem
498
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
499
+ method: "typia.assert",
500
+ path: _path + ".sources",
501
+ expected: "Array<ITtscGraphDump.ISourceDigest>",
502
+ value: input.sources
503
+ }, _errorFactory));
504
+ const _ao3 = (input, _path, _exceptionable = true) => ("string" === typeof input.tool || _assertGuard_1._assertGuard(_exceptionable, {
505
+ method: "typia.assert",
506
+ path: _path + ".tool",
507
+ expected: "string",
508
+ value: input.tool
509
+ }, _errorFactory)) && ("string" === typeof input.version || _assertGuard_1._assertGuard(_exceptionable, {
510
+ method: "typia.assert",
511
+ path: _path + ".version",
512
+ expected: "string",
513
+ value: input.version
514
+ }, _errorFactory)) && ("string" === typeof input.typescript || _assertGuard_1._assertGuard(_exceptionable, {
515
+ method: "typia.assert",
516
+ path: _path + ".typescript",
517
+ expected: "string",
518
+ value: input.typescript
519
+ }, _errorFactory));
520
+ const _ao4 = (input, _path, _exceptionable = true) => ((Array.isArray(input.configs) || _assertGuard_1._assertGuard(_exceptionable, {
521
+ method: "typia.assert",
522
+ path: _path + ".configs",
523
+ expected: "Array<ITtscGraphDump.IFileDigest>",
524
+ value: input.configs
525
+ }, _errorFactory)) && input.configs.every((elem, _index18) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
526
+ method: "typia.assert",
527
+ path: _path + ".configs[" + _index18 + "]",
528
+ expected: "ITtscGraphDump.IFileDigest",
529
+ value: elem
530
+ }, _errorFactory)) && _ao5(elem, _path + ".configs[" + _index18 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
531
+ method: "typia.assert",
532
+ path: _path + ".configs[" + _index18 + "]",
533
+ expected: "ITtscGraphDump.IFileDigest",
534
+ value: elem
535
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
536
+ method: "typia.assert",
537
+ path: _path + ".configs",
538
+ expected: "Array<ITtscGraphDump.IFileDigest>",
539
+ value: input.configs
540
+ }, _errorFactory)) && ((Array.isArray(input.roots) || _assertGuard_1._assertGuard(_exceptionable, {
541
+ method: "typia.assert",
542
+ path: _path + ".roots",
543
+ expected: "Array<ITtscGraphDump.IRootFile>",
544
+ value: input.roots
545
+ }, _errorFactory)) && input.roots.every((elem, _index19) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
546
+ method: "typia.assert",
547
+ path: _path + ".roots[" + _index19 + "]",
548
+ expected: "ITtscGraphDump.IRootFile",
549
+ value: elem
550
+ }, _errorFactory)) && _ao6(elem, _path + ".roots[" + _index19 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
551
+ method: "typia.assert",
552
+ path: _path + ".roots[" + _index19 + "]",
553
+ expected: "ITtscGraphDump.IRootFile",
554
+ value: elem
555
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
556
+ method: "typia.assert",
557
+ path: _path + ".roots",
558
+ expected: "Array<ITtscGraphDump.IRootFile>",
559
+ value: input.roots
560
+ }, _errorFactory));
561
+ const _ao5 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && ("string" === typeof input.digest || _assertGuard_1._assertGuard(_exceptionable, {
562
+ method: "typia.assert",
563
+ path: _path + ".digest",
564
+ expected: "string",
565
+ value: input.digest
566
+ }, _errorFactory));
567
+ const _ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.config || _assertGuard_1._assertGuard(_exceptionable, {
568
+ method: "typia.assert",
569
+ path: _path + ".config",
570
+ expected: "string",
571
+ value: input.config
572
+ }, _errorFactory)) && _ap1(input, _path, true && _exceptionable);
573
+ const _ao7 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && ("string" === typeof input.checkerDigest || _assertGuard_1._assertGuard(_exceptionable, {
574
+ method: "typia.assert",
575
+ path: _path + ".checkerDigest",
576
+ expected: "string",
577
+ value: input.checkerDigest
578
+ }, _errorFactory)) && ("string" === typeof input.diskDigest || _assertGuard_1._assertGuard(_exceptionable, {
579
+ method: "typia.assert",
580
+ path: _path + ".diskDigest",
581
+ expected: "string",
582
+ value: input.diskDigest
583
+ }, _errorFactory));
584
+ const _ao8 = (input, _path, _exceptionable = true) => _ap1(input, _path, true && _exceptionable) && ("number" === typeof input.line || _assertGuard_1._assertGuard(_exceptionable, {
585
+ method: "typia.assert",
586
+ path: _path + ".line",
587
+ expected: "number",
588
+ value: input.line
589
+ }, _errorFactory)) && ("number" === typeof input.column || _assertGuard_1._assertGuard(_exceptionable, {
590
+ method: "typia.assert",
591
+ path: _path + ".column",
592
+ expected: "number",
593
+ value: input.column
594
+ }, _errorFactory)) && ("number" === typeof input.code || _assertGuard_1._assertGuard(_exceptionable, {
595
+ method: "typia.assert",
596
+ path: _path + ".code",
597
+ expected: "number",
598
+ value: input.code
599
+ }, _errorFactory)) && ("error" === input.category || "warning" === input.category || _assertGuard_1._assertGuard(_exceptionable, {
600
+ method: "typia.assert",
601
+ path: _path + ".category",
602
+ expected: "(\"error\" | \"warning\")",
603
+ value: input.category
604
+ }, _errorFactory)) && ("string" === typeof input.message || _assertGuard_1._assertGuard(_exceptionable, {
605
+ method: "typia.assert",
606
+ path: _path + ".message",
607
+ expected: "string",
608
+ value: input.message
609
+ }, _errorFactory));
610
+ const _ao9 = (input, _path, _exceptionable = true) => ("string" === typeof input.id || _assertGuard_1._assertGuard(_exceptionable, {
200
611
  method: "typia.assert",
201
612
  path: _path + ".id",
202
613
  expected: "string",
@@ -206,17 +617,12 @@ class TtscGraphSession {
206
617
  path: _path + ".kind",
207
618
  expected: _ae0,
208
619
  value: input.kind
209
- }, _errorFactory)) && _ap0(input, _path, true && _exceptionable) && (undefined === input.qualifiedName || "string" === typeof input.qualifiedName || _assertGuard_1._assertGuard(_exceptionable, {
620
+ }, _errorFactory)) && _ap2(input, _path, true && _exceptionable) && (undefined === input.qualifiedName || "string" === typeof input.qualifiedName || _assertGuard_1._assertGuard(_exceptionable, {
210
621
  method: "typia.assert",
211
622
  path: _path + ".qualifiedName",
212
623
  expected: "(string | undefined)",
213
624
  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, {
625
+ }, _errorFactory)) && _ap1(input, _path, true && _exceptionable) && ("boolean" === typeof input.external || _assertGuard_1._assertGuard(_exceptionable, {
220
626
  method: "typia.assert",
221
627
  path: _path + ".external",
222
628
  expected: "boolean",
@@ -241,9 +647,9 @@ class TtscGraphSession {
241
647
  path: _path + ".modifiers",
242
648
  expected: "(Array<TtscGraphNodeModifier> | undefined)",
243
649
  value: input.modifiers
244
- }, _errorFactory)) && input.modifiers.every((elem, _index8) => true === _av1.has(elem) || _assertGuard_1._assertGuard(_exceptionable, {
650
+ }, _errorFactory)) && input.modifiers.every((elem, _index20) => true === _av1.has(elem) || _assertGuard_1._assertGuard(_exceptionable, {
245
651
  method: "typia.assert",
246
- path: _path + ".modifiers[" + _index8 + "]",
652
+ path: _path + ".modifiers[" + _index20 + "]",
247
653
  expected: _ae1,
248
654
  value: elem
249
655
  }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
@@ -251,19 +657,54 @@ class TtscGraphSession {
251
657
  path: _path + ".modifiers",
252
658
  expected: "(Array<TtscGraphNodeModifier> | undefined)",
253
659
  value: input.modifiers
660
+ }, _errorFactory)) && (undefined === input.literals || (Array.isArray(input.literals) || _assertGuard_1._assertGuard(_exceptionable, {
661
+ method: "typia.assert",
662
+ path: _path + ".literals",
663
+ expected: "(Array<string> | undefined)",
664
+ value: input.literals
665
+ }, _errorFactory)) && input.literals.every((elem, _index21) => "string" === typeof elem || _assertGuard_1._assertGuard(_exceptionable, {
666
+ method: "typia.assert",
667
+ path: _path + ".literals[" + _index21 + "]",
668
+ expected: "string",
669
+ value: elem
670
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
671
+ method: "typia.assert",
672
+ path: _path + ".literals",
673
+ expected: "(Array<string> | undefined)",
674
+ value: input.literals
675
+ }, _errorFactory)) && (undefined === input.enumMembers || (Array.isArray(input.enumMembers) || _assertGuard_1._assertGuard(_exceptionable, {
676
+ method: "typia.assert",
677
+ path: _path + ".enumMembers",
678
+ expected: "(Array<ITtscGraphNode.IEnumMember> | undefined)",
679
+ value: input.enumMembers
680
+ }, _errorFactory)) && input.enumMembers.every((elem, _index22) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
681
+ method: "typia.assert",
682
+ path: _path + ".enumMembers[" + _index22 + "]",
683
+ expected: "ITtscGraphNode.IEnumMember",
684
+ value: elem
685
+ }, _errorFactory)) && _ao10(elem, _path + ".enumMembers[" + _index22 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
686
+ method: "typia.assert",
687
+ path: _path + ".enumMembers[" + _index22 + "]",
688
+ expected: "ITtscGraphNode.IEnumMember",
689
+ value: elem
690
+ }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
691
+ method: "typia.assert",
692
+ path: _path + ".enumMembers",
693
+ expected: "(Array<ITtscGraphNode.IEnumMember> | undefined)",
694
+ value: input.enumMembers
254
695
  }, _errorFactory)) && (undefined === input.decorators || (Array.isArray(input.decorators) || _assertGuard_1._assertGuard(_exceptionable, {
255
696
  method: "typia.assert",
256
697
  path: _path + ".decorators",
257
698
  expected: "(Array<ITtscGraphDecorator> | undefined)",
258
699
  value: input.decorators
259
- }, _errorFactory)) && input.decorators.every((elem, _index9) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
700
+ }, _errorFactory)) && input.decorators.every((elem, _index23) => ("object" === typeof elem && null !== elem || _assertGuard_1._assertGuard(_exceptionable, {
260
701
  method: "typia.assert",
261
- path: _path + ".decorators[" + _index9 + "]",
702
+ path: _path + ".decorators[" + _index23 + "]",
262
703
  expected: "ITtscGraphDecorator",
263
704
  value: elem
264
- }, _errorFactory)) && _ao2(elem, _path + ".decorators[" + _index9 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
705
+ }, _errorFactory)) && _ao11(elem, _path + ".decorators[" + _index23 + "]", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
265
706
  method: "typia.assert",
266
- path: _path + ".decorators[" + _index9 + "]",
707
+ path: _path + ".decorators[" + _index23 + "]",
267
708
  expected: "ITtscGraphDecorator",
268
709
  value: elem
269
710
  }, _errorFactory)) || _assertGuard_1._assertGuard(_exceptionable, {
@@ -271,92 +712,32 @@ class TtscGraphSession {
271
712
  path: _path + ".decorators",
272
713
  expected: "(Array<ITtscGraphDecorator> | undefined)",
273
714
  value: input.decorators
274
- }, _errorFactory)) && _ap1(input, _path, true && _exceptionable) && (undefined === input.implementation || ("object" === typeof input.implementation && null !== input.implementation || _assertGuard_1._assertGuard(_exceptionable, {
715
+ }, _errorFactory)) && _ap3(input, _path, true && _exceptionable) && (undefined === input.implementation || ("object" === typeof input.implementation && null !== input.implementation || _assertGuard_1._assertGuard(_exceptionable, {
275
716
  method: "typia.assert",
276
717
  path: _path + ".implementation",
277
718
  expected: "(ITtscGraphSpan | undefined)",
278
719
  value: input.implementation
279
- }, _errorFactory)) && _ao4(input.implementation, _path + ".implementation", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
720
+ }, _errorFactory)) && _ao13(input.implementation, _path + ".implementation", true && _exceptionable) || _assertGuard_1._assertGuard(_exceptionable, {
280
721
  method: "typia.assert",
281
722
  path: _path + ".implementation",
282
723
  expected: "(ITtscGraphSpan | undefined)",
283
724
  value: input.implementation
284
725
  }, _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);
726
+ const _io0 = input => "number" === typeof input.id && "number" === typeof input.protocolVersion && ("error" === input.mode || "incremental" === input.mode || "initial" === input.mode || "rebuild" === input.mode || "reload" === input.mode || "unchanged" === input.mode) && _ip0(input) && "boolean" === typeof input.changed && (undefined === input.dump || "object" === typeof input.dump && null !== input.dump && _io1(input.dump)) && (undefined === input.error || "string" === typeof input.error);
727
+ const _io1 = input => "string" === typeof input.project && "string" === typeof input.tsconfig && ("object" === typeof input.provenance && null !== input.provenance && _io2(input.provenance)) && (Array.isArray(input.diagnostics) && input.diagnostics.every(elem => "object" === typeof elem && null !== elem && _io8(elem))) && (Array.isArray(input.nodes) && input.nodes.every(elem => "object" === typeof elem && null !== elem && _io9(elem))) && (Array.isArray(input.edges) && input.edges.every(elem => "object" === typeof elem && null !== elem && _io14(elem)));
728
+ const _io10 = input => _ip2(input) && (undefined === input.value || "string" === typeof input.value);
729
+ const _io11 = input => _ip2(input) && (Array.isArray(input.arguments) && input.arguments.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && _io12(elem)));
730
+ const _io12 = input => undefined === input.literal || "string" === typeof input.literal || "number" === typeof input.literal || "boolean" === typeof input.literal;
731
+ const _io13 = 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);
732
+ const _io14 = input => "string" === typeof input.from && "string" === typeof input.to && true === _iv2.has(input.kind) && _ip3(input);
733
+ const _io2 = input => "number" === typeof input.schemaVersion && _ip0(input) && ("object" === typeof input.producer && null !== input.producer && _io3(input.producer)) && ("object" === typeof input.universe && null !== input.universe && _io4(input.universe)) && (Array.isArray(input.sources) && input.sources.every(elem => "object" === typeof elem && null !== elem && _io7(elem)));
734
+ const _io3 = input => "string" === typeof input.tool && "string" === typeof input.version && "string" === typeof input.typescript;
735
+ const _io4 = input => Array.isArray(input.configs) && input.configs.every(elem => "object" === typeof elem && null !== elem && _io5(elem)) && (Array.isArray(input.roots) && input.roots.every(elem => "object" === typeof elem && null !== elem && _io6(elem)));
736
+ const _io5 = input => _ip1(input) && "string" === typeof input.digest;
737
+ const _io6 = input => "string" === typeof input.config && _ip1(input);
738
+ const _io7 = input => _ip1(input) && "string" === typeof input.checkerDigest && "string" === typeof input.diskDigest;
739
+ const _io8 = input => _ip1(input) && "number" === typeof input.line && "number" === typeof input.column && "number" === typeof input.code && ("error" === input.category || "warning" === input.category) && "string" === typeof input.message;
740
+ const _io9 = input => "string" === typeof input.id && true === _iv0.has(input.kind) && _ip2(input) && (undefined === input.qualifiedName || "string" === typeof input.qualifiedName) && _ip1(input) && "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.literals || Array.isArray(input.literals) && input.literals.every(elem => "string" === typeof elem)) && (undefined === input.enumMembers || Array.isArray(input.enumMembers) && input.enumMembers.every(elem => "object" === typeof elem && null !== elem && _io10(elem))) && (undefined === input.decorators || Array.isArray(input.decorators) && input.decorators.every(elem => "object" === typeof elem && null !== elem && _io11(elem))) && _ip3(input) && (undefined === input.implementation || "object" === typeof input.implementation && null !== input.implementation && _io13(input.implementation));
360
741
  const __is = input => "object" === typeof input && null !== input && _io0(input);
361
742
  let _errorFactory;
362
743
  return (input, errorFactory) => {
@@ -365,72 +746,38 @@ class TtscGraphSession {
365
746
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _assertGuard_1._assertGuard(true, {
366
747
  method: "typia.assert",
367
748
  path: _path + "",
368
- expected: "ITtscGraphDump",
749
+ expected: "ITtscGraphSnapshot",
369
750
  value: input
370
751
  }, _errorFactory)) && _ao0(input, _path + "", true) || _assertGuard_1._assertGuard(true, {
371
752
  method: "typia.assert",
372
753
  path: _path + "",
373
- expected: "ITtscGraphDump",
754
+ expected: "ITtscGraphSnapshot",
374
755
  value: input
375
756
  }, _errorFactory))(input, "$input", true);
376
757
  }
377
758
  return input;
378
759
  };
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);
760
+ })()(parsed);
431
761
  }
432
762
  catch (error) {
433
- this.failPending(new Error(`@ttsc/graph: native session returned invalid JSON: ${asError(error).message}`));
763
+ this.failPending(new Error(`@ttsc/graph: native session returned an unreadable response: ${asError(error).message}`));
764
+ return;
765
+ }
766
+ // The envelope's version is not the body's, and only the envelope has been
767
+ // held to one so far. A producer can speak this protocol and still carry a
768
+ // dump from another schema — the two move apart the moment a node field is
769
+ // added without the frame around it changing — and then the facts that field
770
+ // holds are silently absent rather than refused. `literals` is exactly that
771
+ // shape: an older producer resolves no value set, so a union comes back
772
+ // looking like a type with no members. Hold the body to its own number too,
773
+ // once the frame is understood.
774
+ if (response.dump !== undefined &&
775
+ response.dump.provenance.schemaVersion !== loadGraph_1.DUMP_SCHEMA_VERSION) {
776
+ // Session-wide, for the same reason the protocol mismatch above is: it is
777
+ // the wrong binary, not one bad frame.
778
+ this.failPending(new Error(`@ttsc/graph: ttscgraph sends dump schema v${String(response.dump.provenance.schemaVersion)}, this client reads v${String(loadGraph_1.DUMP_SCHEMA_VERSION)}. ` +
779
+ "Install a matching `ttsc` (the binary resolves from the target " +
780
+ "project, or from TTSC_GRAPH_BINARY)."));
434
781
  return;
435
782
  }
436
783
  const pending = this.pending.get(response.id);