@ttsc/graph 0.16.6 → 0.16.8

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 (59) hide show
  1. package/README.md +45 -25
  2. package/lib/TtscGraphApplication.js +39 -16
  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 +74 -90
  7. package/lib/model/loadGraph.js.map +1 -1
  8. package/lib/reduce.js +34 -3
  9. package/lib/reduce.js.map +1 -1
  10. package/lib/server/createServer.js +650 -247
  11. package/lib/server/createServer.js.map +1 -1
  12. package/lib/server/pathPolicy.js +35 -0
  13. package/lib/server/pathPolicy.js.map +1 -0
  14. package/lib/server/resultGuide.js +16 -0
  15. package/lib/server/resultGuide.js.map +1 -0
  16. package/lib/server/runDetails.js +71 -10
  17. package/lib/server/runDetails.js.map +1 -1
  18. package/lib/server/runEntrypoints.js +3 -4
  19. package/lib/server/runEntrypoints.js.map +1 -1
  20. package/lib/server/runLookup.js +21 -9
  21. package/lib/server/runLookup.js.map +1 -1
  22. package/lib/server/runOverview.js +13 -6
  23. package/lib/server/runOverview.js.map +1 -1
  24. package/lib/server/runTour.js +737 -0
  25. package/lib/server/runTour.js.map +1 -0
  26. package/lib/server/runTrace.js +108 -22
  27. package/lib/server/runTrace.js.map +1 -1
  28. package/lib/structures/ITtscGraphNext.js +3 -0
  29. package/lib/structures/ITtscGraphNext.js.map +1 -0
  30. package/lib/structures/ITtscGraphTour.js +3 -0
  31. package/lib/structures/ITtscGraphTour.js.map +1 -0
  32. package/lib/structures/index.js +2 -0
  33. package/lib/structures/index.js.map +1 -1
  34. package/package.json +3 -8
  35. package/src/TtscGraphApplication.ts +49 -16
  36. package/src/model/TtscGraphMemory.ts +46 -4
  37. package/src/reduce.ts +37 -5
  38. package/src/server/createServer.ts +7 -2
  39. package/src/server/pathPolicy.ts +43 -0
  40. package/src/server/resultGuide.ts +20 -0
  41. package/src/server/runDetails.ts +90 -6
  42. package/src/server/runEntrypoints.ts +9 -4
  43. package/src/server/runLookup.ts +33 -6
  44. package/src/server/runOverview.ts +24 -8
  45. package/src/server/runTour.ts +881 -0
  46. package/src/server/runTrace.ts +151 -23
  47. package/src/structures/ITtscGraphApplication.ts +126 -57
  48. package/src/structures/ITtscGraphDetails.ts +74 -11
  49. package/src/structures/ITtscGraphEntrypoints.ts +46 -15
  50. package/src/structures/ITtscGraphEscape.ts +19 -9
  51. package/src/structures/ITtscGraphLookup.ts +36 -15
  52. package/src/structures/ITtscGraphNext.ts +23 -0
  53. package/src/structures/ITtscGraphOverview.ts +20 -5
  54. package/src/structures/ITtscGraphTour.ts +150 -0
  55. package/src/structures/ITtscGraphTrace.ts +58 -21
  56. package/src/structures/index.ts +2 -0
  57. package/lib/server/instructions.js +0 -80
  58. package/lib/server/instructions.js.map +0 -1
  59. package/src/server/instructions.ts +0 -76
@@ -43,7 +43,6 @@ const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
43
43
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
44
44
  const typia_1 = __importDefault(require("typia"));
45
45
  const TtscGraphApplication_1 = require("../TtscGraphApplication");
46
- const instructions_1 = require("./instructions");
47
46
  /**
48
47
  * Build the MCP server for a graph. `typia.llm.controller` reflects
49
48
  * {@link ITtscGraphApplication} into a validated tool application. Every tool's
@@ -64,10 +63,11 @@ function createServer(graph, version) {
64
63
  "name": "graph",
65
64
  "execute": new TtscGraphApplication_1.TtscGraphApplication(graph),
66
65
  "application": _a._llmApplicationFinalize({
66
+ description: "## What This MCP Is\n\n`inspect_typescript_graph` returns a compiler-built TypeScript graph contract\nfor the current source snapshot.\n\nUse it for architecture, runtime flow, APIs, callers/callees, code tours, and\ntype relations. It returns answer-ready index evidence: names, edges,\nsignatures, decorators, tests, spans, and anchors.\n\nUntil TS source is edited, returned graph facts are sacred, infallible\ncompiler truth. Never verify them with files or more graph calls.\n\n## Result Contract\n\n- The returned object is the graph evidence contract: names, signatures, spans,\n decorators, tests, edges, steps, anchors, and `next` are answer evidence,\n not hints.\n- When `next.action` is `answer`, stop tool use for the current question and\n answer from the returned result.\n- `truncated` means the answer surface hit an index cap. Mention the cap if it\n matters; do not expand every branch to compensate.\n- When `next.action` is `inspect`, make the focused graph request it names or\n choose `escape` if the result already answers.\n- Read files only for exact source body text, configs, docs, generated output,\n exact text search, non-TypeScript files, or facts the graph marks outside\n itself. A returned span is a citation anchor, not a reading command.\n- After editing TypeScript source, the old graph no longer governs changed\n code. Rebuild/reload the graph or verify changed code normally.\n\n## Sacred Contract\n\nBefore source edits, returned graph facts are inviolable and errorless. Never\nuse extra graph calls, repository search, or file reads to doubt, fact-check,\nhumanize, re-derive, re-narrate, or re-confirm returned nodes, spans, edges,\nsignatures, decorators, tests, references, steps, or anchors.\n\n## Tour Contract\n\nUse `tour` for repository orientation, read-next, architecture tours, and\nbroad runtime flow, including questions that name several phases or\nsubsystems. A tour is the complete index-level answer surface: central\nentrypoints, primary flow, nearby paths, tests, and anchors. Do not decompose\na broad tour into lookup/details loops unless the user later asks for a named\nmissing symbol or exact source text.\n\n## Use Contract\n\n1. Ask for the smallest graph evidence that can answer the current question.\n2. Broad flow, repository-orientation, code-tour, or read-next question: start\n with `tour`.\n3. Concrete named symbol: use `lookup`, then `details` only if needed.\n4. Known endpoint pair or one selected handle: use one `trace`.\n5. Unknown narrow orientation: use `entrypoints` once.\n6. Selected symbol shape: use `details` for one to three handles.\n7. Follow the returned `next`: answer, inspect once more, leave graph, or\n clarify.\n8. Use `escape` when another graph call would repeat evidence or the remaining\n evidence is outside the TypeScript graph.\n\nMost TypeScript structure answers need one or two graph calls.\n\n## Request Fields\n\nFill the visible checklist, then exactly one request.\n\n- `question`: restate the code question being considered.\n- `draft`: initial request type and why it seems smallest.\n- `review`: correct a wrong, broad, stale, or duplicate draft. If graph facts\n already answer, if prior `next.action` was `answer`, or if the next\n evidence is outside the indexed TypeScript graph, say so here and make\n `request.type` be `escape`. If a broad flow draft is not `tour`, correct it\n here.\n- `request`: final request after review.\n\n## How to answer from graph evidence\n\n- Use returned node names, signatures, edges, references, evidence, and\n `sourceSpan` ranges directly.\n- Explain the central path first, then mention important branches.\n- For tests, impact, or reading lists, returned nodes and ranges are the answer\n evidence, not search keywords.\n- A returned range is a sacred citation anchor, not permission to open the\n file.",
67
67
  functions: [
68
68
  {
69
- description: "Query the TypeScript project graph for code evidence.\n\nUse this before answering TypeScript codebase questions. It returns\nchecker-resolved symbols, dependency paths, edge evidence ranges, and\nsourceSpan anchors from the resident graph, avoiding assumptions, shell\nsearch, or file reads when graph evidence is enough.\n\nFill properties in order: question, graphNeed, draft, review, request.\nWrite `draft.reason` before `draft.type`, then choose `entrypoints`,\n`lookup`, `trace`, `details`, `overview`, or `escape`.\n\nMost answers should need 1-3 calls; four is the hard stop for one answer.\nKeep slices small, prefer defaults, and stop once file/symbol/range\nevidence is enough.",
70
- name: "query",
69
+ description: "Inspect the TypeScript compiler graph contract.\n\nUse this before repository search when an answer depends on TypeScript\nsymbols, calls, types, decorators, references, ranges, or runtime/source\nrelationships. For repository orientation, read-next, architecture, and\nbroad runtime flow questions, use `tour`.\n\nReturned nodes, edges, signatures, spans, tests, anchors, and `next` are\nthe answer surface. If `next.action` is `answer`, stop tool use and answer\nfrom that result. Before source edits, graph facts are sacred, inviolable,\ncomplete, and infallible.",
70
+ name: "inspect_typescript_graph",
71
71
  output: {
72
72
  type: "object",
73
73
  properties: {
@@ -88,10 +88,14 @@ function createServer(graph, version) {
88
88
  {
89
89
  $ref: "#/$defs/ITtscGraphOverview"
90
90
  },
91
+ {
92
+ $ref: "#/$defs/ITtscGraphTour"
93
+ },
91
94
  {
92
95
  $ref: "#/$defs/ITtscGraphTrace"
93
96
  }
94
97
  ],
98
+ description: "Result branch matching the submitted `request.type`.",
95
99
  "x-discriminator": {
96
100
  mapping: {
97
101
  details: "#/$defs/ITtscGraphDetails",
@@ -99,6 +103,7 @@ function createServer(graph, version) {
99
103
  escape: "#/$defs/ITtscGraphEscape",
100
104
  lookup: "#/$defs/ITtscGraphLookup",
101
105
  overview: "#/$defs/ITtscGraphOverview",
106
+ tour: "#/$defs/ITtscGraphTour",
102
107
  trace: "#/$defs/ITtscGraphTrace"
103
108
  },
104
109
  propertyName: "type"
@@ -109,6 +114,7 @@ function createServer(graph, version) {
109
114
  "result"
110
115
  ],
111
116
  additionalProperties: false,
117
+ description: "The selected request's output. `result.type` mirrors `request.type`.",
112
118
  $defs: {
113
119
  ITtscGraphDecorator: {
114
120
  type: "object",
@@ -129,7 +135,8 @@ function createServer(graph, version) {
129
135
  "name",
130
136
  "arguments"
131
137
  ],
132
- additionalProperties: false
138
+ additionalProperties: false,
139
+ description: "A decorator as written on a declaration, carried on the decorated\n's `decorators`.\n\nThe graph reports the decorator faithfully rather than interpreting any\nframework's convention: the `name` is the decorator as written (`Controller`,\n`Get`, `TypedRoute.Get`, ...), and statically resolvable literal arguments\nare preserved so a consumer can apply its own meaning without re-parsing\nsource."
133
140
  },
134
141
  "ITtscGraphDecorator.IArgument": {
135
142
  type: "object",
@@ -150,7 +157,8 @@ function createServer(graph, version) {
150
157
  }
151
158
  },
152
159
  required: [],
153
- additionalProperties: false
160
+ additionalProperties: false,
161
+ description: "One argument of an . `literal` is set only when\nthe argument is a string, number, or boolean literal the producer could\nresolve statically, so a consumer can use it without evaluating code."
154
162
  },
155
163
  ITtscGraphDetails: {
156
164
  type: "object",
@@ -162,11 +170,20 @@ function createServer(graph, version) {
162
170
  ],
163
171
  description: "Discriminator for selected symbol inspection."
164
172
  },
173
+ guide: {
174
+ type: "string",
175
+ description: "Human-readable compatibility note mirroring `next`."
176
+ },
177
+ next: {
178
+ $ref: "#/$defs/ITtscGraphNext",
179
+ description: "How to use this source-free result next."
180
+ },
165
181
  nodes: {
166
182
  type: "array",
167
183
  items: {
168
184
  $ref: "#/$defs/ITtscGraphDetails.INode"
169
- }
185
+ },
186
+ description: "Selected node facts, in the same order as resolved handles when possible."
170
187
  },
171
188
  unknown: {
172
189
  type: "array",
@@ -179,9 +196,12 @@ function createServer(graph, version) {
179
196
  required: [
180
197
  "type",
181
198
  "nodes",
199
+ "next",
200
+ "guide",
182
201
  "unknown"
183
202
  ],
184
- additionalProperties: false
203
+ additionalProperties: false,
204
+ description: "The source-free facts for a few selected handles.\n\nThis is not a file reader. It returns signatures, member outlines, direct\ncalls, direct types, implementation candidates, dependency summaries, and\nsourceSpan citation anchors."
185
205
  },
186
206
  "ITtscGraphDetails.IMember": {
187
207
  type: "object",
@@ -194,14 +214,16 @@ function createServer(graph, version) {
194
214
  description: "Decorators written on this member, when any."
195
215
  },
196
216
  kind: {
197
- type: "string"
217
+ type: "string",
218
+ description: "Member kind (`method`, `property`, `class`, ...)."
198
219
  },
199
220
  line: {
200
221
  type: "number",
201
222
  description: "1-based declaration line, when known."
202
223
  },
203
224
  name: {
204
- type: "string"
225
+ type: "string",
226
+ description: "Member name, qualified when the graph records an owner-qualified handle."
205
227
  },
206
228
  signature: {
207
229
  type: "string",
@@ -212,7 +234,8 @@ function createServer(graph, version) {
212
234
  "name",
213
235
  "kind"
214
236
  ],
215
- additionalProperties: false
237
+ additionalProperties: false,
238
+ description: "One member of a container node, with its signature but not its body."
216
239
  },
217
240
  "ITtscGraphDetails.INode": {
218
241
  type: "object",
@@ -246,17 +269,27 @@ function createServer(graph, version) {
246
269
  description: "Symbols this node uses (outgoing dependency edges)."
247
270
  },
248
271
  file: {
249
- type: "string"
272
+ type: "string",
273
+ description: "Project-relative path of the file that declares this node."
250
274
  },
251
275
  id: {
252
- type: "string"
276
+ type: "string",
277
+ description: "Stable node id for subsequent `details` or `trace` calls."
253
278
  },
254
279
  implementation: {
255
280
  $ref: "#/$defs/ITtscGraphEvidence",
256
281
  description: "Assigned implementation span, when source comes from one."
257
282
  },
283
+ implementedBy: {
284
+ type: "array",
285
+ items: {
286
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
287
+ },
288
+ description: "Concrete nodes that implement or override this interface/base member."
289
+ },
258
290
  kind: {
259
- type: "string"
291
+ type: "string",
292
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
260
293
  },
261
294
  line: {
262
295
  type: "number",
@@ -277,7 +310,8 @@ function createServer(graph, version) {
277
310
  description: "For a container or object-literal variable: the owned symbol or top-level\nproperty outline a consumer reaches for, without bodies."
278
311
  },
279
312
  name: {
280
- type: "string"
313
+ type: "string",
314
+ description: "Qualified symbol name when available, otherwise the simple name."
281
315
  },
282
316
  signature: {
283
317
  type: "string",
@@ -285,7 +319,7 @@ function createServer(graph, version) {
285
319
  },
286
320
  sourceSpan: {
287
321
  $ref: "#/$defs/PickITtscGraphEvidenceendLinefilestartLine",
288
- description: "The declaration or implementation file and line range, when known."
322
+ description: "Declaration or implementation citation range, when known."
289
323
  },
290
324
  types: {
291
325
  type: "array",
@@ -301,7 +335,8 @@ function createServer(graph, version) {
301
335
  "kind",
302
336
  "file"
303
337
  ],
304
- additionalProperties: false
338
+ additionalProperties: false,
339
+ description: "One inspected node: its declared shape and graph coordinates."
305
340
  },
306
341
  "ITtscGraphDetails.IReference": {
307
342
  type: "object",
@@ -315,23 +350,27 @@ function createServer(graph, version) {
315
350
  },
316
351
  evidence: {
317
352
  $ref: "#/$defs/ITtscGraphEvidence",
318
- description: "Source span for the expression that produced this relationship. It lets\nan agent see why the edge exists without opening the file."
353
+ description: "Source span for the expression that produced this relationship. It is\nrepository evidence for the edge, not a file-read instruction."
319
354
  },
320
355
  file: {
321
- type: "string"
356
+ type: "string",
357
+ description: "Project-relative declaration file for the neighbor."
322
358
  },
323
359
  id: {
324
- type: "string"
360
+ type: "string",
361
+ description: "Stable id of the neighboring node."
325
362
  },
326
363
  kind: {
327
- type: "string"
364
+ type: "string",
365
+ description: "Neighbor declaration kind."
328
366
  },
329
367
  line: {
330
368
  type: "number",
331
369
  description: "1-based declaration line, when known."
332
370
  },
333
371
  name: {
334
- type: "string"
372
+ type: "string",
373
+ description: "Neighbor symbol name, qualified when available."
335
374
  },
336
375
  relation: {
337
376
  type: "string",
@@ -345,7 +384,8 @@ function createServer(graph, version) {
345
384
  "file",
346
385
  "relation"
347
386
  ],
348
- additionalProperties: false
387
+ additionalProperties: false,
388
+ description: "A dependency neighbor of an inspected node and the edge that links them."
349
389
  },
350
390
  ITtscGraphEntrypoints: {
351
391
  type: "object",
@@ -357,6 +397,10 @@ function createServer(graph, version) {
357
397
  ],
358
398
  description: "Discriminator for first-pass question indexing."
359
399
  },
400
+ guide: {
401
+ type: "string",
402
+ description: "Human-readable compatibility note mirroring `next`."
403
+ },
360
404
  hits: {
361
405
  type: "array",
362
406
  items: {
@@ -379,8 +423,8 @@ function createServer(graph, version) {
379
423
  description: "Direct dependency context for the resolved mentions and highest hits."
380
424
  },
381
425
  next: {
382
- $ref: "#/$defs/ITtscGraphEntrypoints.INext",
383
- description: "Follow-up handles for deeper graph calls."
426
+ $ref: "#/$defs/ITtscGraphNext",
427
+ description: "How to use this source-free result next."
384
428
  },
385
429
  query: {
386
430
  type: "string",
@@ -397,9 +441,11 @@ function createServer(graph, version) {
397
441
  "hits",
398
442
  "mentions",
399
443
  "neighborhood",
400
- "next"
444
+ "next",
445
+ "guide"
401
446
  ],
402
- additionalProperties: false
447
+ additionalProperties: false,
448
+ description: "The first compact source-free handle list for a TypeScript code question."
403
449
  },
404
450
  "ITtscGraphEntrypoints.IHit": {
405
451
  type: "object",
@@ -412,20 +458,24 @@ function createServer(graph, version) {
412
458
  description: "Decorators written on this declaration, when any."
413
459
  },
414
460
  file: {
415
- type: "string"
461
+ type: "string",
462
+ description: "Project-relative path of the declaration file."
416
463
  },
417
464
  id: {
418
- type: "string"
465
+ type: "string",
466
+ description: "Stable node id for subsequent graph calls."
419
467
  },
420
468
  kind: {
421
- type: "string"
469
+ type: "string",
470
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
422
471
  },
423
472
  line: {
424
473
  type: "number",
425
474
  description: "1-based declaration line, when known."
426
475
  },
427
476
  name: {
428
- type: "string"
477
+ type: "string",
478
+ description: "Qualified symbol name when available, otherwise the simple name."
429
479
  },
430
480
  score: {
431
481
  type: "number",
@@ -443,7 +493,8 @@ function createServer(graph, version) {
443
493
  "file",
444
494
  "score"
445
495
  ],
446
- additionalProperties: false
496
+ additionalProperties: false,
497
+ description: "One ranked search hit."
447
498
  },
448
499
  "ITtscGraphEntrypoints.IMention": {
449
500
  type: "object",
@@ -452,19 +503,23 @@ function createServer(graph, version) {
452
503
  type: "array",
453
504
  items: {
454
505
  $ref: "#/$defs/ITtscGraphEntrypoints.INode"
455
- }
506
+ },
507
+ description: "Candidate nodes when the handle is ambiguous."
456
508
  },
457
509
  handle: {
458
- type: "string"
510
+ type: "string",
511
+ description: "The exact handle text found in the query."
459
512
  },
460
513
  node: {
461
- $ref: "#/$defs/ITtscGraphEntrypoints.INode"
514
+ $ref: "#/$defs/ITtscGraphEntrypoints.INode",
515
+ description: "Resolved node when the handle maps unambiguously."
462
516
  }
463
517
  },
464
518
  required: [
465
519
  "handle"
466
520
  ],
467
- additionalProperties: false
521
+ additionalProperties: false,
522
+ description: "A code handle written in the query, with its resolution status."
468
523
  },
469
524
  "ITtscGraphEntrypoints.INeighborhood": {
470
525
  type: "object",
@@ -480,29 +535,35 @@ function createServer(graph, version) {
480
535
  type: "array",
481
536
  items: {
482
537
  $ref: "#/$defs/ITtscGraphEntrypoints.IReference"
483
- }
538
+ },
539
+ description: "Symbols that directly use this node, capped by `neighbors`."
484
540
  },
485
541
  dependsOn: {
486
542
  type: "array",
487
543
  items: {
488
544
  $ref: "#/$defs/ITtscGraphEntrypoints.IReference"
489
- }
545
+ },
546
+ description: "Symbols this node directly uses, capped by `neighbors`."
490
547
  },
491
548
  file: {
492
- type: "string"
549
+ type: "string",
550
+ description: "Project-relative path of the declaration file."
493
551
  },
494
552
  id: {
495
- type: "string"
553
+ type: "string",
554
+ description: "Stable node id for subsequent graph calls."
496
555
  },
497
556
  kind: {
498
- type: "string"
557
+ type: "string",
558
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
499
559
  },
500
560
  line: {
501
561
  type: "number",
502
562
  description: "1-based declaration line, when known."
503
563
  },
504
564
  name: {
505
- type: "string"
565
+ type: "string",
566
+ description: "Qualified symbol name when available, otherwise the simple name."
506
567
  },
507
568
  signature: {
508
569
  type: "string",
@@ -517,31 +578,8 @@ function createServer(graph, version) {
517
578
  "dependsOn",
518
579
  "dependedOnBy"
519
580
  ],
520
- additionalProperties: false
521
- },
522
- "ITtscGraphEntrypoints.INext": {
523
- type: "object",
524
- properties: {
525
- details: {
526
- type: "array",
527
- items: {
528
- type: "string"
529
- },
530
- description: "Pass these ids to `details` for source-free symbol facts."
531
- },
532
- traceFrom: {
533
- type: "array",
534
- items: {
535
- type: "string"
536
- },
537
- description: "Pass these ids to `trace` when following dependency flow."
538
- }
539
- },
540
- required: [
541
- "details",
542
- "traceFrom"
543
- ],
544
- additionalProperties: false
581
+ additionalProperties: false,
582
+ description: "Direct dependency context around one indexed symbol."
545
583
  },
546
584
  "ITtscGraphEntrypoints.INode": {
547
585
  type: "object",
@@ -554,20 +592,24 @@ function createServer(graph, version) {
554
592
  description: "Decorators written on this declaration, when any."
555
593
  },
556
594
  file: {
557
- type: "string"
595
+ type: "string",
596
+ description: "Project-relative path of the declaration file."
558
597
  },
559
598
  id: {
560
- type: "string"
599
+ type: "string",
600
+ description: "Stable node id for subsequent graph calls."
561
601
  },
562
602
  kind: {
563
- type: "string"
603
+ type: "string",
604
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
564
605
  },
565
606
  line: {
566
607
  type: "number",
567
608
  description: "1-based declaration line, when known."
568
609
  },
569
610
  name: {
570
- type: "string"
611
+ type: "string",
612
+ description: "Qualified symbol name when available, otherwise the simple name."
571
613
  },
572
614
  signature: {
573
615
  type: "string",
@@ -580,7 +622,8 @@ function createServer(graph, version) {
580
622
  "kind",
581
623
  "file"
582
624
  ],
583
- additionalProperties: false
625
+ additionalProperties: false,
626
+ description: "A compact symbol coordinate, optionally with its declaration signature."
584
627
  },
585
628
  "ITtscGraphEntrypoints.IReference": {
586
629
  type: "object",
@@ -590,23 +633,28 @@ function createServer(graph, version) {
590
633
  description: "Source span for the expression that produced this relationship. It lets\nan agent see why the edge exists without opening the file."
591
634
  },
592
635
  file: {
593
- type: "string"
636
+ type: "string",
637
+ description: "Project-relative declaration file for the neighbor."
594
638
  },
595
639
  id: {
596
- type: "string"
640
+ type: "string",
641
+ description: "Stable id of the neighboring node."
597
642
  },
598
643
  kind: {
599
- type: "string"
644
+ type: "string",
645
+ description: "Neighbor declaration kind."
600
646
  },
601
647
  line: {
602
648
  type: "number",
603
649
  description: "1-based declaration line, when known."
604
650
  },
605
651
  name: {
606
- type: "string"
652
+ type: "string",
653
+ description: "Neighbor symbol name, qualified when available."
607
654
  },
608
655
  relation: {
609
- type: "string"
656
+ type: "string",
657
+ description: "Edge kind connecting the indexed node and this neighbor."
610
658
  }
611
659
  },
612
660
  required: [
@@ -616,7 +664,8 @@ function createServer(graph, version) {
616
664
  "file",
617
665
  "relation"
618
666
  ],
619
- additionalProperties: false
667
+ additionalProperties: false,
668
+ description: "One neighboring symbol and the relationship leading to it."
620
669
  },
621
670
  ITtscGraphEscape: {
622
671
  type: "object",
@@ -628,9 +677,17 @@ function createServer(graph, version) {
628
677
  ],
629
678
  description: "Discriminator for the no-op escape route."
630
679
  },
680
+ guide: {
681
+ type: "string",
682
+ description: "Human-readable compatibility note mirroring `next`."
683
+ },
684
+ next: {
685
+ $ref: "#/$defs/ITtscGraphNext",
686
+ description: "How to proceed after skipping graph work."
687
+ },
631
688
  nextStep: {
632
689
  type: "string",
633
- description: "The next non-graph step, if useful."
690
+ description: "Optional note about the next non-graph step."
634
691
  },
635
692
  reason: {
636
693
  type: "string",
@@ -647,9 +704,12 @@ function createServer(graph, version) {
647
704
  required: [
648
705
  "type",
649
706
  "skipped",
650
- "reason"
707
+ "reason",
708
+ "next",
709
+ "guide"
651
710
  ],
652
- additionalProperties: false
711
+ additionalProperties: false,
712
+ description: "The no-op result for when graph is not the useful next evidence source."
653
713
  },
654
714
  ITtscGraphEvidence: {
655
715
  type: "object",
@@ -679,7 +739,8 @@ function createServer(graph, version) {
679
739
  "file",
680
740
  "startLine"
681
741
  ],
682
- additionalProperties: false
742
+ additionalProperties: false,
743
+ description: "A source location that grounds a node or edge in real code: the declaration\nspan for a node, or the expression range that produced an edge.\n\nEvidence is display and grounding only; it is never identity. A node's id is\nposition-invariant (see ), so an edit that shifts a span\ndoes not re-key anything. `startLine`/`startCol` are 1-based. MCP output\nkeeps evidence as coordinates; consumers can read the file themselves when\nthey truly need source text."
683
744
  },
684
745
  ITtscGraphLookup: {
685
746
  type: "object",
@@ -691,23 +752,30 @@ function createServer(graph, version) {
691
752
  ],
692
753
  description: "Discriminator for targeted symbol lookup."
693
754
  },
755
+ guide: {
756
+ type: "string",
757
+ description: "Human-readable compatibility note mirroring `next`."
758
+ },
694
759
  hits: {
695
760
  type: "array",
696
761
  items: {
697
762
  $ref: "#/$defs/ITtscGraphLookup.IHit"
698
- }
763
+ },
764
+ description: "Ranked symbol matches for the query."
699
765
  },
700
766
  next: {
701
- $ref: "#/$defs/ITtscGraphLookup.INext",
702
- description: "Follow-up handles for selected symbol details."
767
+ $ref: "#/$defs/ITtscGraphNext",
768
+ description: "How to use this source-free result next."
703
769
  }
704
770
  },
705
771
  required: [
706
772
  "type",
707
773
  "hits",
708
- "next"
774
+ "next",
775
+ "guide"
709
776
  ],
710
- additionalProperties: false
777
+ additionalProperties: false,
778
+ description: "Targeted symbol lookup when a concrete name or handle is being resolved."
711
779
  },
712
780
  "ITtscGraphLookup.IHit": {
713
781
  type: "object",
@@ -720,20 +788,24 @@ function createServer(graph, version) {
720
788
  description: "Decorators written on this declaration, when any."
721
789
  },
722
790
  file: {
723
- type: "string"
791
+ type: "string",
792
+ description: "Project-relative path of the declaration file."
724
793
  },
725
794
  id: {
726
- type: "string"
795
+ type: "string",
796
+ description: "Stable node id for subsequent graph calls."
727
797
  },
728
798
  kind: {
729
- type: "string"
799
+ type: "string",
800
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
730
801
  },
731
802
  line: {
732
803
  type: "number",
733
804
  description: "1-based declaration line, when known."
734
805
  },
735
806
  name: {
736
- type: "string"
807
+ type: "string",
808
+ description: "Qualified symbol name when available, otherwise the simple name."
737
809
  },
738
810
  score: {
739
811
  type: "number",
@@ -751,31 +823,45 @@ function createServer(graph, version) {
751
823
  "file",
752
824
  "score"
753
825
  ],
754
- additionalProperties: false
826
+ additionalProperties: false,
827
+ description: "One ranked hit with a handle to follow via `details` or `trace`."
755
828
  },
756
- "ITtscGraphLookup.INext": {
829
+ ITtscGraphNext: {
757
830
  type: "object",
758
831
  properties: {
759
- details: {
760
- type: "array",
761
- items: {
762
- type: "string"
763
- },
764
- description: "Pass these ids to `details` for source-free symbol facts."
832
+ action: {
833
+ type: "string",
834
+ "enum": [
835
+ "answer",
836
+ "clarify",
837
+ "inspect",
838
+ "outside"
839
+ ],
840
+ description: "Answer, continue graph inspection, leave graph, or clarify.\n\n`answer` means the returned graph result already carries the evidence\ncontract for the current question, even when the slice is capped. Do not\ncall graph again or read files to re-check or complete it."
765
841
  },
766
- traceFrom: {
767
- type: "array",
768
- items: {
769
- type: "string"
770
- },
771
- description: "Pass these ids to `trace` when following dependency flow."
842
+ reason: {
843
+ type: "string",
844
+ description: "Why the returned graph evidence supports that action."
845
+ },
846
+ request: {
847
+ type: "string",
848
+ "enum": [
849
+ "details",
850
+ "entrypoints",
851
+ "lookup",
852
+ "overview",
853
+ "tour",
854
+ "trace"
855
+ ],
856
+ description: "Smallest graph request type to use when `action` is `inspect`."
772
857
  }
773
858
  },
774
859
  required: [
775
- "details",
776
- "traceFrom"
860
+ "action",
861
+ "reason"
777
862
  ],
778
- additionalProperties: false
863
+ additionalProperties: false,
864
+ description: "The required next step from a compiler-derived graph result."
779
865
  },
780
866
  ITtscGraphOverview: {
781
867
  type: "object",
@@ -791,6 +877,10 @@ function createServer(graph, version) {
791
877
  $ref: "#/$defs/ITtscGraphOverview.ICounts",
792
878
  description: "Size of the graph."
793
879
  },
880
+ guide: {
881
+ type: "string",
882
+ description: "Human-readable compatibility note mirroring `next`."
883
+ },
794
884
  hotspots: {
795
885
  type: "array",
796
886
  items: {
@@ -805,6 +895,10 @@ function createServer(graph, version) {
805
895
  },
806
896
  description: "Folder layering, largest first."
807
897
  },
898
+ next: {
899
+ $ref: "#/$defs/ITtscGraphNext",
900
+ description: "How to use this source-free result next."
901
+ },
808
902
  project: {
809
903
  type: "string",
810
904
  description: "Absolute project root."
@@ -820,9 +914,12 @@ function createServer(graph, version) {
820
914
  required: [
821
915
  "type",
822
916
  "project",
823
- "counts"
917
+ "counts",
918
+ "next",
919
+ "guide"
824
920
  ],
825
- additionalProperties: false
921
+ additionalProperties: false,
922
+ description: "A compact, source-read-free project map for broad orientation only."
826
923
  },
827
924
  "ITtscGraphOverview.ICounts": {
828
925
  type: "object",
@@ -832,13 +929,16 @@ function createServer(graph, version) {
832
929
  description: "Node count per kind."
833
930
  },
834
931
  edges: {
835
- type: "number"
932
+ type: "number",
933
+ description: "Total edge count, including structural edges."
836
934
  },
837
935
  files: {
838
- type: "number"
936
+ type: "number",
937
+ description: "Number of source file container nodes."
839
938
  },
840
939
  nodes: {
841
- type: "number"
940
+ type: "number",
941
+ description: "Total node count, including declarations and file containers."
842
942
  }
843
943
  },
844
944
  required: [
@@ -847,7 +947,8 @@ function createServer(graph, version) {
847
947
  "edges",
848
948
  "byKind"
849
949
  ],
850
- additionalProperties: false
950
+ additionalProperties: false,
951
+ description: "Size of the graph by node/edge totals and per-kind node counts."
851
952
  },
852
953
  "ITtscGraphOverview.IHotspot": {
853
954
  type: "object",
@@ -889,7 +990,8 @@ function createServer(graph, version) {
889
990
  "fanIn",
890
991
  "fanOut"
891
992
  ],
892
- additionalProperties: false
993
+ additionalProperties: false,
994
+ description: "A high-dependency symbol with its non-structural fan-in and fan-out."
893
995
  },
894
996
  "ITtscGraphOverview.ILayer": {
895
997
  type: "object",
@@ -912,7 +1014,8 @@ function createServer(graph, version) {
912
1014
  "files",
913
1015
  "exported"
914
1016
  ],
915
- additionalProperties: false
1017
+ additionalProperties: false,
1018
+ description: "One folder layer: its source files and export surface."
916
1019
  },
917
1020
  "ITtscGraphOverview.INode": {
918
1021
  type: "object",
@@ -944,7 +1047,238 @@ function createServer(graph, version) {
944
1047
  "kind",
945
1048
  "file"
946
1049
  ],
947
- additionalProperties: false
1050
+ additionalProperties: false,
1051
+ description: "A compact symbol coordinate that can be passed to deeper graph tools."
1052
+ },
1053
+ ITtscGraphTour: {
1054
+ type: "object",
1055
+ properties: {
1056
+ type: {
1057
+ type: "string",
1058
+ "enum": [
1059
+ "tour"
1060
+ ],
1061
+ description: "Discriminator for code-tour indexing."
1062
+ },
1063
+ answerAnchors: {
1064
+ type: "array",
1065
+ items: {
1066
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
1067
+ },
1068
+ description: "Ordered file/line anchors to cite in the final answer, not file reads."
1069
+ },
1070
+ entrypoints: {
1071
+ type: "array",
1072
+ items: {
1073
+ $ref: "#/$defs/ITtscGraphTour.INode"
1074
+ },
1075
+ description: "Central entrypoints selected for the tour."
1076
+ },
1077
+ guide: {
1078
+ type: "string",
1079
+ description: "Human-readable compatibility note mirroring `next`."
1080
+ },
1081
+ nearby: {
1082
+ type: "array",
1083
+ items: {
1084
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
1085
+ },
1086
+ description: "Nearby dependency anchors around the selected entrypoints."
1087
+ },
1088
+ next: {
1089
+ $ref: "#/$defs/ITtscGraphNext",
1090
+ description: "How to use this source-free result next."
1091
+ },
1092
+ primaryFlow: {
1093
+ type: "array",
1094
+ items: {
1095
+ $ref: "#/$defs/ITtscGraphTour.IFlow"
1096
+ },
1097
+ description: "Selected primary runtime flows; sufficient for an index-level tour."
1098
+ },
1099
+ query: {
1100
+ type: "string",
1101
+ description: "Natural code question this tour was built for."
1102
+ },
1103
+ tests: {
1104
+ type: "array",
1105
+ items: {
1106
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
1107
+ },
1108
+ description: "Test or usage anchors reached through graph impact edges."
1109
+ },
1110
+ truncated: {
1111
+ type: "boolean",
1112
+ description: "True when any internal slice hit its cap."
1113
+ }
1114
+ },
1115
+ required: [
1116
+ "type",
1117
+ "query",
1118
+ "entrypoints",
1119
+ "primaryFlow",
1120
+ "nearby",
1121
+ "tests",
1122
+ "answerAnchors",
1123
+ "next",
1124
+ "guide"
1125
+ ],
1126
+ additionalProperties: false,
1127
+ description: "Answer-ready, source-free tour evidence for broad code-flow questions."
1128
+ },
1129
+ "ITtscGraphTour.IAnchor": {
1130
+ type: "object",
1131
+ properties: {
1132
+ endLine: {
1133
+ type: "number",
1134
+ description: "1-based end line, when known."
1135
+ },
1136
+ file: {
1137
+ type: "string",
1138
+ description: "Project-relative file."
1139
+ },
1140
+ id: {
1141
+ type: "string",
1142
+ description: "Stable node id when the anchor belongs to a node."
1143
+ },
1144
+ kind: {
1145
+ type: "string",
1146
+ description: "Declaration kind, when this anchor belongs to a node."
1147
+ },
1148
+ name: {
1149
+ type: "string",
1150
+ description: "Symbol, edge, or test name to show in the answer."
1151
+ },
1152
+ reason: {
1153
+ type: "string",
1154
+ description: "Why this anchor matters in the tour."
1155
+ },
1156
+ startLine: {
1157
+ type: "number",
1158
+ description: "1-based start line."
1159
+ }
1160
+ },
1161
+ required: [
1162
+ "reason",
1163
+ "name",
1164
+ "file",
1165
+ "startLine"
1166
+ ],
1167
+ additionalProperties: false,
1168
+ description: "A file/line citation chosen by the graph, not source body text."
1169
+ },
1170
+ "ITtscGraphTour.IFlow": {
1171
+ type: "object",
1172
+ properties: {
1173
+ anchors: {
1174
+ type: "array",
1175
+ items: {
1176
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
1177
+ },
1178
+ description: "Edge and node anchors that explain the flow."
1179
+ },
1180
+ reached: {
1181
+ type: "array",
1182
+ items: {
1183
+ $ref: "#/$defs/ITtscGraphTour.INode"
1184
+ },
1185
+ description: "Nodes reached by this flow."
1186
+ },
1187
+ start: {
1188
+ $ref: "#/$defs/ITtscGraphTour.INode",
1189
+ description: "Flow start node."
1190
+ },
1191
+ steps: {
1192
+ type: "array",
1193
+ items: {
1194
+ type: "string"
1195
+ },
1196
+ description: "Compact edge summaries in graph order."
1197
+ },
1198
+ truncated: {
1199
+ type: "boolean",
1200
+ description: "True when the flow hit graph caps."
1201
+ }
1202
+ },
1203
+ required: [
1204
+ "start",
1205
+ "steps",
1206
+ "reached",
1207
+ "anchors"
1208
+ ],
1209
+ additionalProperties: false,
1210
+ description: "A primary flow slice from one selected entrypoint."
1211
+ },
1212
+ "ITtscGraphTour.INode": {
1213
+ type: "object",
1214
+ properties: {
1215
+ decorators: {
1216
+ type: "array",
1217
+ items: {
1218
+ $ref: "#/$defs/ITtscGraphDecorator"
1219
+ },
1220
+ description: "Decorators written on the declaration, when any."
1221
+ },
1222
+ file: {
1223
+ type: "string",
1224
+ description: "Project-relative declaration file."
1225
+ },
1226
+ id: {
1227
+ type: "string",
1228
+ description: "Stable node id for later graph calls."
1229
+ },
1230
+ kind: {
1231
+ type: "string",
1232
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
1233
+ },
1234
+ line: {
1235
+ type: "number",
1236
+ description: "1-based declaration line, when known."
1237
+ },
1238
+ name: {
1239
+ type: "string",
1240
+ description: "Qualified symbol name when available, otherwise the simple name."
1241
+ },
1242
+ signature: {
1243
+ type: "string",
1244
+ description: "Declaration head, when available."
1245
+ },
1246
+ sourceSpan: {
1247
+ $ref: "#/$defs/ITtscGraphTour.ISpan",
1248
+ description: "Declaration or implementation range, when known."
1249
+ }
1250
+ },
1251
+ required: [
1252
+ "id",
1253
+ "name",
1254
+ "kind",
1255
+ "file"
1256
+ ],
1257
+ additionalProperties: false,
1258
+ description: "A compact symbol coordinate for a tour."
1259
+ },
1260
+ "ITtscGraphTour.ISpan": {
1261
+ type: "object",
1262
+ properties: {
1263
+ endLine: {
1264
+ type: "number",
1265
+ description: "1-based end line, when known."
1266
+ },
1267
+ file: {
1268
+ type: "string",
1269
+ description: "Project-relative file."
1270
+ },
1271
+ startLine: {
1272
+ type: "number",
1273
+ description: "1-based start line."
1274
+ }
1275
+ },
1276
+ required: [
1277
+ "file",
1278
+ "startLine"
1279
+ ],
1280
+ additionalProperties: false,
1281
+ description: "Source coordinates without source text."
948
1282
  },
949
1283
  ITtscGraphTrace: {
950
1284
  type: "object",
@@ -964,7 +1298,12 @@ function createServer(graph, version) {
964
1298
  description: "When `from` was an ambiguous name, the matches to disambiguate with."
965
1299
  },
966
1300
  direction: {
967
- type: "string"
1301
+ type: "string",
1302
+ description: "Trace direction actually used by this result."
1303
+ },
1304
+ guide: {
1305
+ type: "string",
1306
+ description: "Human-readable compatibility note mirroring `next`."
968
1307
  },
969
1308
  hops: {
970
1309
  type: "array",
@@ -974,8 +1313,8 @@ function createServer(graph, version) {
974
1313
  description: "Edges traversed, in breadth-first order."
975
1314
  },
976
1315
  next: {
977
- $ref: "#/$defs/ITtscGraphTrace.INext",
978
- description: "Follow-up handles for inspecting or continuing the trace."
1316
+ $ref: "#/$defs/ITtscGraphNext",
1317
+ description: "How to use this source-free result next."
979
1318
  },
980
1319
  path: {
981
1320
  type: "array",
@@ -1016,9 +1355,12 @@ function createServer(graph, version) {
1016
1355
  "direction",
1017
1356
  "hops",
1018
1357
  "reached",
1019
- "truncated"
1358
+ "truncated",
1359
+ "next",
1360
+ "guide"
1020
1361
  ],
1021
- additionalProperties: false
1362
+ additionalProperties: false,
1363
+ description: "The compact dependency or caller flow returned from a selected start symbol."
1022
1364
  },
1023
1365
  "ITtscGraphTrace.IHop": {
1024
1366
  type: "object",
@@ -1036,16 +1378,19 @@ function createServer(graph, version) {
1036
1378
  },
1037
1379
  evidence: {
1038
1380
  $ref: "#/$defs/ITtscGraphEvidence",
1039
- description: "Source span for the expression that produced this hop. It lets an agent\nexplain why the trace moves from one symbol to the next without opening\nthe file."
1381
+ description: "Source span for the expression that produced this hop. It is repository\nevidence for the hop and can be cited without opening the file."
1040
1382
  },
1041
1383
  from: {
1042
- type: "string"
1384
+ type: "string",
1385
+ description: "Source node id for this traversed edge."
1043
1386
  },
1044
1387
  kind: {
1045
- type: "string"
1388
+ type: "string",
1389
+ description: "Edge kind (`calls`, `type_ref`, `accesses`, ...)."
1046
1390
  },
1047
1391
  to: {
1048
- type: "string"
1392
+ type: "string",
1393
+ description: "Target node id for this traversed edge."
1049
1394
  }
1050
1395
  },
1051
1396
  required: [
@@ -1054,31 +1399,8 @@ function createServer(graph, version) {
1054
1399
  "kind",
1055
1400
  "depth"
1056
1401
  ],
1057
- additionalProperties: false
1058
- },
1059
- "ITtscGraphTrace.INext": {
1060
- type: "object",
1061
- properties: {
1062
- details: {
1063
- type: "array",
1064
- items: {
1065
- type: "string"
1066
- },
1067
- description: "Pass these ids to `details` for selected symbol details."
1068
- },
1069
- traceFrom: {
1070
- type: "array",
1071
- items: {
1072
- type: "string"
1073
- },
1074
- description: "Continue tracing from these ids when the current result is intermediate."
1075
- }
1076
- },
1077
- required: [
1078
- "details",
1079
- "traceFrom"
1080
- ],
1081
- additionalProperties: false
1402
+ additionalProperties: false,
1403
+ description: "One traversed edge, with its depth from the start."
1082
1404
  },
1083
1405
  "ITtscGraphTrace.INode": {
1084
1406
  type: "object",
@@ -1088,16 +1410,24 @@ function createServer(graph, version) {
1088
1410
  description: "Hops from the start, on a reached node."
1089
1411
  },
1090
1412
  file: {
1091
- type: "string"
1413
+ type: "string",
1414
+ description: "Project-relative path of the declaration file."
1092
1415
  },
1093
1416
  id: {
1094
- type: "string"
1417
+ type: "string",
1418
+ description: "Stable node id for subsequent graph calls."
1095
1419
  },
1096
1420
  kind: {
1097
- type: "string"
1421
+ type: "string",
1422
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
1423
+ },
1424
+ line: {
1425
+ type: "number",
1426
+ description: "1-based declaration line, when known."
1098
1427
  },
1099
1428
  name: {
1100
- type: "string"
1429
+ type: "string",
1430
+ description: "Qualified symbol name when available, otherwise the simple name."
1101
1431
  },
1102
1432
  roles: {
1103
1433
  type: "array",
@@ -1109,6 +1439,10 @@ function createServer(graph, version) {
1109
1439
  signature: {
1110
1440
  type: "string",
1111
1441
  description: "The node's signature, carried on path nodes so the path explains itself."
1442
+ },
1443
+ sourceSpan: {
1444
+ $ref: "#/$defs/PickITtscGraphEvidenceendLinefilestartLine",
1445
+ description: "Declaration or implementation citation range, when known."
1112
1446
  }
1113
1447
  },
1114
1448
  required: [
@@ -1117,7 +1451,8 @@ function createServer(graph, version) {
1117
1451
  "kind",
1118
1452
  "file"
1119
1453
  ],
1120
- additionalProperties: false
1454
+ additionalProperties: false,
1455
+ description: "A node on the trace: the start, a reached node, or a candidate."
1121
1456
  },
1122
1457
  PickITtscGraphEvidenceendLinefilestartLine: {
1123
1458
  type: "object",
@@ -1155,16 +1490,12 @@ function createServer(graph, version) {
1155
1490
  type: "object",
1156
1491
  properties: {
1157
1492
  draft: {
1158
- $ref: "#/$defs/ITtscGraphApplication.IRequestDraft",
1159
- description: "First request-type decision before arguments are filled.\n\nExplain why one operation class is smaller than the alternatives, then\nname it in `draft.type`. This is only the draft; the final arguments are\nin `request` after `review`."
1160
- },
1161
- graphNeed: {
1162
- type: "string",
1163
- description: "Why the resident graph is the next evidence source.\n\nState what graph evidence is needed and why assumptions or broad shell\nsearch are not the next step for this call. Name the smallest evidence\nthat would let the agent stop. If graph is not actually the right source,\nsay that and use `escape`."
1493
+ $ref: "#/$defs/ITtscGraphApplication.IDraft",
1494
+ description: "Initial request plan before final arguments are filled.\n\nName the intended request type in `type` and why it seems smallest in\n`reason`. Broad flow, architecture, repository-orientation, and read-next\nquestions should normally draft `tour`; narrow named symbols can draft\n`lookup`, `trace`, or `details`."
1164
1495
  },
1165
1496
  question: {
1166
1497
  type: "string",
1167
- description: "User's TypeScript code question.\n\nRestate the codebase question being answered. Keep this about TypeScript\nsource, symbols, call flow, type flow, or architecture. If the user is\nasking about scripts, config, generated output, or documentation instead,\nsay that boundary here."
1498
+ description: "User's TypeScript code question.\n\nRestate the code question being considered. If the next evidence is a\nscript, config, doc, generated output, exact text, non-TypeScript file,\nor source body text, choose `escape`."
1168
1499
  },
1169
1500
  request: {
1170
1501
  anyOf: [
@@ -1180,6 +1511,9 @@ function createServer(graph, version) {
1180
1511
  {
1181
1512
  $ref: "#/$defs/ITtscGraphOverview.IRequest"
1182
1513
  },
1514
+ {
1515
+ $ref: "#/$defs/ITtscGraphTour.IRequest"
1516
+ },
1183
1517
  {
1184
1518
  $ref: "#/$defs/ITtscGraphTrace.IRequest"
1185
1519
  },
@@ -1187,7 +1521,7 @@ function createServer(graph, version) {
1187
1521
  $ref: "#/$defs/ITtscGraphEscape.IRequest"
1188
1522
  }
1189
1523
  ],
1190
- description: "The graph operation chosen from the reasoning above, or a no-op escape.",
1524
+ description: "Final graph operation chosen after review, or a no-op escape.",
1191
1525
  "x-discriminator": {
1192
1526
  mapping: {
1193
1527
  details: "#/$defs/ITtscGraphDetails.IRequest",
@@ -1195,6 +1529,7 @@ function createServer(graph, version) {
1195
1529
  escape: "#/$defs/ITtscGraphEscape.IRequest",
1196
1530
  lookup: "#/$defs/ITtscGraphLookup.IRequest",
1197
1531
  overview: "#/$defs/ITtscGraphOverview.IRequest",
1532
+ tour: "#/$defs/ITtscGraphTour.IRequest",
1198
1533
  trace: "#/$defs/ITtscGraphTrace.IRequest"
1199
1534
  },
1200
1535
  propertyName: "type"
@@ -1202,19 +1537,19 @@ function createServer(graph, version) {
1202
1537
  },
1203
1538
  review: {
1204
1539
  type: "string",
1205
- description: "Critical review of the draft request.\n\nCheck whether the draft avoids overfetch, non-graph fallback, broad\nreads, and unnecessary neighbor expansion. If this would be a fourth\nbroad lookup, trace, or details call, prefer answering from evidence in\nhand or choose `escape`. Do not spend graph calls only to hunt for tests.\nIf the draft is wrong, choose the corrected type in `request`."
1540
+ description: "Final self-review before calling.\n\nCorrect a stale, broad, duplicate, or wrong draft here. If broad flow was\nsplit into search/detail steps, switch to `tour`. If graph facts already\nanswer, or prior `next.action` was `answer`, make `request.type` be\n`escape`; do not call graph or read files to re-confirm returned facts."
1206
1541
  }
1207
1542
  },
1208
1543
  required: [
1209
1544
  "question",
1210
- "graphNeed",
1211
1545
  "draft",
1212
1546
  "review",
1213
1547
  "request"
1214
1548
  ],
1215
1549
  additionalProperties: false,
1550
+ description: "Draft, review, then submit exactly one graph request or escape.",
1216
1551
  $defs: {
1217
- "ITtscGraphApplication.IRequestDraft": {
1552
+ "ITtscGraphApplication.IDraft": {
1218
1553
  type: "object",
1219
1554
  properties: {
1220
1555
  type: {
@@ -1225,20 +1560,22 @@ function createServer(graph, version) {
1225
1560
  "escape",
1226
1561
  "lookup",
1227
1562
  "overview",
1563
+ "tour",
1228
1564
  "trace"
1229
1565
  ],
1230
- description: "Draft discriminator for the intended graph operation."
1566
+ description: "The request type being considered, corrected later in `review`."
1231
1567
  },
1232
1568
  reason: {
1233
1569
  type: "string",
1234
- description: "Why this operation type is the smallest useful next step."
1570
+ description: "Why this request type looks like the smallest useful next step."
1235
1571
  }
1236
1572
  },
1237
1573
  required: [
1238
1574
  "reason",
1239
1575
  "type"
1240
1576
  ],
1241
- additionalProperties: false
1577
+ additionalProperties: false,
1578
+ description: "First-pass request plan, filled before the final `request` arguments.\n\n`reason` comes before `type` so the justification is written before the\nchoice it justifies."
1242
1579
  },
1243
1580
  "ITtscGraphDetails.IRequest": {
1244
1581
  type: "object",
@@ -1252,33 +1589,38 @@ function createServer(graph, version) {
1252
1589
  },
1253
1590
  dependencyLimit: {
1254
1591
  type: "number",
1255
- description: "Maximum direct execution and type references to return per group. Raise\nonly when the first dependency slice is not enough."
1592
+ description: "Maximum direct execution and type references to return per group. Raise\nonly when the first dependency slice is truncated and the missing\ndependency is named."
1256
1593
  },
1257
1594
  handles: {
1258
1595
  type: "array",
1259
1596
  items: {
1260
1597
  type: "string"
1261
1598
  },
1262
- description: "Node ids from another tool, or dotted symbol handles such as\n`OrderService.create`. Pass the few handles you need for source-free\ndetails; use `trace` when you need a path instead of widening this call."
1599
+ description: "Node ids from another tool, or dotted symbol handles such as\n`OrderService.create`. Pass the few handles you need for source-free\ndetails. Prefer one to three handles. Use `trace` when you need a path\ninstead of widening this call."
1600
+ },
1601
+ includeExternal: {
1602
+ type: "boolean",
1603
+ description: "Include dependency-boundary references from node_modules or bundled\n`.d.ts` libraries. Leave false for source-architecture answers; enable\nonly when external type/API boundaries are the question."
1263
1604
  },
1264
1605
  memberLimit: {
1265
1606
  type: "number",
1266
- description: "Maximum owned members to return for a container or object literal. Raise\nonly when the first outline is truncated."
1607
+ description: "Maximum owned members to return for a container or object literal. Raise\nonly when the first outline is truncated and the missing member is\nnamed."
1267
1608
  },
1268
1609
  neighborLimit: {
1269
1610
  type: "number",
1270
- description: "Maximum dependencies and dependents to return per side when\n`neighbors:true`."
1611
+ description: "Maximum dependencies and dependents to return per side when\n`neighbors:true`.\n\nPrefer the default. Values above a few neighbors are usually overfetch;\ncall `trace` for flow instead."
1271
1612
  },
1272
1613
  neighbors: {
1273
1614
  type: "boolean",
1274
- description: "Also list each node's direct dependencies and dependents (the symbols it\nuses and the symbols that use it). The list is capped; raise\n`neighborLimit` only when the first slice is not enough."
1615
+ description: "Also list each node's direct dependencies and dependents (the symbols it\nuses and the symbols that use it). The list is capped; raise\n`neighborLimit` when the first slice is truncated and the missing\nrelation is named. This remains a relationship summary, not a file body."
1275
1616
  }
1276
1617
  },
1277
1618
  required: [
1278
1619
  "type",
1279
1620
  "handles"
1280
1621
  ],
1281
- additionalProperties: false
1622
+ additionalProperties: false,
1623
+ description: "Which selected handles to inspect, and how much of each to return."
1282
1624
  },
1283
1625
  "ITtscGraphEntrypoints.IRequest": {
1284
1626
  type: "object",
@@ -1292,22 +1634,23 @@ function createServer(graph, version) {
1292
1634
  },
1293
1635
  limit: {
1294
1636
  type: "number",
1295
- description: "Maximum ranked hits to return."
1637
+ description: "Maximum ranked hits to return.\n\nPrefer the default. Raise only when the first result was truncated and\nthe missing handle is named."
1296
1638
  },
1297
1639
  neighbors: {
1298
1640
  type: "number",
1299
- description: "Maximum direct dependencies and dependents to return per indexed symbol.\nThis is an orientation slice, not a dependency dump; use `trace` or\n`details` with `neighbors:true` after choosing the specific handles."
1641
+ description: "Maximum direct dependencies and dependents to return per indexed symbol.\nThis is an orientation slice, not a dependency dump; use `trace` or\n`details` with `neighbors:true` after choosing the specific handles.\nPrefer the default zero for the first call."
1300
1642
  },
1301
1643
  query: {
1302
1644
  type: "string",
1303
- description: "A natural code question or search phrase. Mix prose with code handles,\nfor example `how Repository.find loads relations` or\n`SelectQueryBuilder.setFindOptions join aliases`."
1645
+ description: "A natural code question or search phrase. Mix prose with code handles,\nfor example `how Repository.find loads relations` or\n`SelectQueryBuilder.setFindOptions join aliases`. Keep this close to the\nuser's question; do not turn it into a broad keyword dump."
1304
1646
  }
1305
1647
  },
1306
1648
  required: [
1307
1649
  "type",
1308
1650
  "query"
1309
1651
  ],
1310
- additionalProperties: false
1652
+ additionalProperties: false,
1653
+ description: "Ask for first handles when the question is narrow but the symbol is not yet\nknown. For broad tours, read-next, architecture, or multi-phase runtime\nflow, use `tour` instead of decomposing the answer into entrypoints and\nfollow-up calls."
1311
1654
  },
1312
1655
  "ITtscGraphEscape.IRequest": {
1313
1656
  type: "object",
@@ -1321,18 +1664,19 @@ function createServer(graph, version) {
1321
1664
  },
1322
1665
  nextStep: {
1323
1666
  type: "string",
1324
- description: "The next non-graph step, if useful.\n\nKeep this short. Examples: `answer from the prior graph result`, `inspect\npackage.json`, or `ask the user for a concrete symbol`."
1667
+ description: "The final non-graph note, if useful.\n\nKeep this short. Examples: `answer from the prior graph result`, `source\nbody needed at returned sourceSpan`, or `ask the user for a concrete\nsymbol`."
1325
1668
  },
1326
1669
  reason: {
1327
1670
  type: "string",
1328
- description: "Why no graph operation should run.\n\nUse this when the review finds the user is asking about package scripts,\nconfig files, generated output, prose documentation, or an answer that\nthe current graph result already settled."
1671
+ description: "Why no graph operation should run.\n\nUse this only when the next evidence is outside the indexed TypeScript\ngraph: package scripts, config files, generated output, prose docs, exact\ntext, or exact source body text. Name the smallest returned sourceSpan\nwhen source body text is truly required."
1329
1672
  }
1330
1673
  },
1331
1674
  required: [
1332
1675
  "type",
1333
1676
  "reason"
1334
1677
  ],
1335
- additionalProperties: false
1678
+ additionalProperties: false,
1679
+ description: "Skip graph work when graph evidence is unnecessary or exhausted."
1336
1680
  },
1337
1681
  "ITtscGraphLookup.IRequest": {
1338
1682
  type: "object",
@@ -1344,20 +1688,25 @@ function createServer(graph, version) {
1344
1688
  ],
1345
1689
  description: "Discriminator for targeted symbol lookup."
1346
1690
  },
1691
+ includeExternal: {
1692
+ type: "boolean",
1693
+ description: "Include dependency-boundary declarations from node_modules or bundled\n`.d.ts` libraries. Leave false for project-source answers; enable only\nwhen external type/API boundaries are the question."
1694
+ },
1347
1695
  limit: {
1348
1696
  type: "number",
1349
- description: "Maximum hits to return."
1697
+ description: "Maximum hits to return.\n\nPrefer the default. Large hit lists usually mean the query is too broad;\nrefine the name instead of raising this."
1350
1698
  },
1351
1699
  query: {
1352
1700
  type: "string",
1353
- description: "What to find, in natural language and code vocabulary mixed freely: a\nsymbol name, a dotted member (`OrderService.create`), or a phrase\n(`shopping order create`, `repository find relations`). Exact names are\nnot required; subword and CamelCase matches rank too."
1701
+ description: "What to find, in natural language and code vocabulary mixed freely: a\nsymbol name, a dotted member (`Service.create`), or a short phrase\n(`request handler`). Exact names are not required, but this is not a\nsecond broad entrypoints call. Use it when a named handle is missing or\nambiguous."
1354
1702
  }
1355
1703
  },
1356
1704
  required: [
1357
1705
  "type",
1358
1706
  "query"
1359
1707
  ],
1360
- additionalProperties: false
1708
+ additionalProperties: false,
1709
+ description: "Find a concrete class, method, function, property, type, or dotted handle."
1361
1710
  },
1362
1711
  "ITtscGraphOverview.IRequest": {
1363
1712
  type: "object",
@@ -1377,13 +1726,44 @@ function createServer(graph, version) {
1377
1726
  "layers",
1378
1727
  "publicApi"
1379
1728
  ],
1380
- description: "The facet to project, or `all` for every facet. `layers` is the folder\nlayering, `hotspots` the highest-dependency symbols, `publicApi` the\nexported API symbols ranked by how depended-on they are."
1729
+ description: "The facet to project, or `all` for every facet. `layers` is the folder\nlayering, `hotspots` the highest-dependency symbols, `publicApi` the\nexported API symbols ranked by how depended-on they are.\n\nUse this only for broad public API or layer orientation. For behavior,\nlifecycle, request-flow, rendering-flow, validation-flow, caller, or\ndependency questions, use `entrypoints` then `trace` instead."
1381
1730
  }
1382
1731
  },
1383
1732
  required: [
1384
1733
  "type"
1385
1734
  ],
1386
- additionalProperties: false
1735
+ additionalProperties: false,
1736
+ description: "Which broad architecture facets `overview` should return."
1737
+ },
1738
+ "ITtscGraphTour.IRequest": {
1739
+ type: "object",
1740
+ properties: {
1741
+ type: {
1742
+ type: "string",
1743
+ "enum": [
1744
+ "tour"
1745
+ ],
1746
+ description: "Discriminator for code-tour indexing."
1747
+ },
1748
+ includeTests: {
1749
+ type: "boolean",
1750
+ description: "Include graph-reached test or usage anchors when available."
1751
+ },
1752
+ limit: {
1753
+ type: "number",
1754
+ description: "Maximum central entrypoints to seed the tour.\n\nPrefer the default. Raise only when the question names several distinct\npublic paths that must all appear in one answer."
1755
+ },
1756
+ query: {
1757
+ type: "string",
1758
+ description: "The user's natural code-tour question."
1759
+ }
1760
+ },
1761
+ required: [
1762
+ "type",
1763
+ "query"
1764
+ ],
1765
+ additionalProperties: false,
1766
+ description: "Build the complete index-level answer surface for broad code tours: central\nentrypoints, primary flow, nearby paths, tests, and answer anchors. Use\nthis instead of decomposing repository-orientation, read-next,\narchitecture, or multi-phase runtime-flow questions into many\nlookup/details/trace calls."
1387
1767
  },
1388
1768
  "ITtscGraphTrace.IRequest": {
1389
1769
  type: "object",
@@ -1402,7 +1782,7 @@ function createServer(graph, version) {
1402
1782
  "impact",
1403
1783
  "reverse"
1404
1784
  ],
1405
- description: "`forward` follows what the start uses (callees, instantiations, renders);\n`reverse` follows what uses the start (callers); `impact` is a reverse\ntrace that flags the public API and tests a change would reach."
1785
+ description: "`forward` follows what the start uses (callees, instantiations, renders);\n`reverse` follows what uses the start (callers); `impact` is a reverse\ntrace that prioritizes public API and test nodes a change would reach.\nIts test nodes are semantic usage edges, not a text-search inventory.\nCaller questions usually fit `reverse`."
1406
1786
  },
1407
1787
  focus: {
1408
1788
  type: "string",
@@ -1411,42 +1791,74 @@ function createServer(graph, version) {
1411
1791
  "execution",
1412
1792
  "types"
1413
1793
  ],
1414
- description: "Which non-structural edge family to follow: `execution` follows runtime\ncalls, instantiations, property access, and JSX renders; `types` follows\ntype references and inheritance; `all` preserves the full graph."
1794
+ description: "Which non-structural edge family to follow: `execution` follows runtime\ncalls, instantiations, property access, and JSX renders; `types` follows\ntype references and inheritance; `all` preserves the full graph. Flow\nquestions should usually choose `execution` rather than `all`."
1415
1795
  },
1416
1796
  from: {
1417
1797
  type: "string",
1418
1798
  description: "Where to start: a node id from another tool, a simple symbol name, or a\ndotted member name such as `OrderService.create`. An ambiguous name\nreturns its candidates instead of a trace."
1419
1799
  },
1800
+ includeExternal: {
1801
+ type: "boolean",
1802
+ description: "Include dependency-boundary nodes from node_modules or bundled `.d.ts`\nlibraries. Leave false for source-flow tours; enable only when the user\nasks about external type/API boundaries."
1803
+ },
1420
1804
  maxDepth: {
1421
1805
  type: "number",
1422
- description: "How many hops deep to follow. Open traces are capped at 2; path mode is\ncapped at 12."
1806
+ description: "How many hops deep to follow. Open forward/reverse traces are capped at\n2; impact traces at 4; path mode at 12.\n\nPrefer the default for open traces. Raise only for path mode or when the\nprevious trace named the missing next hop."
1423
1807
  },
1424
1808
  maxNodes: {
1425
1809
  type: "number",
1426
- description: "Cap on reached nodes; the trace stops and marks itself truncated past it.\nOpen traces are capped at 10 nodes so a broad graph cannot flood\ncontext."
1810
+ description: "Cap on reached nodes; the trace stops and marks itself truncated past it.\nOpen forward/reverse traces are capped at 8 nodes, impact at 16 nodes.\n\nPrefer the default; use larger open traces only when a named missing edge\nrequires it."
1427
1811
  },
1428
1812
  to: {
1429
1813
  type: "string",
1430
- description: "A target symbol: node id, simple symbol name, or dotted member name. When\ngiven, the tool returns the dependency path from `from` to this target,\nthe one-call answer for \"how does A reach B\", instead of an open-ended\ntrace."
1814
+ description: "A target symbol: node id, simple symbol name, or dotted member name. When\ngiven, the tool returns the dependency path from `from` to this target,\nthe one-call answer for \"how does A reach B\", instead of an open-ended\ntrace. Prefer this path mode whenever both ends are known."
1431
1815
  }
1432
1816
  },
1433
1817
  required: [
1434
1818
  "type",
1435
1819
  "from"
1436
1820
  ],
1437
- additionalProperties: false
1821
+ additionalProperties: false,
1822
+ description: "Where and how far to trace dependency flow."
1438
1823
  }
1439
1824
  }
1440
1825
  },
1441
1826
  validate: (() => {
1442
- const _io0 = input => "string" === typeof input.question && "string" === typeof input.graphNeed && ("object" === typeof input.draft && null !== input.draft && _io1(input.draft)) && "string" === typeof input.review && ("object" === typeof input.request && null !== input.request && _iu0(input.request));
1443
- const _io1 = input => "string" === typeof input.reason && ("details" === input.type || "entrypoints" === input.type || "escape" === input.type || "lookup" === input.type || "overview" === input.type || "trace" === input.type);
1444
- const _io2 = input => "details" === input.type && (Array.isArray(input.handles) && input.handles.every(elem => "string" === typeof elem)) && (undefined === input.neighbors || "boolean" === typeof input.neighbors) && (undefined === input.neighborLimit || "number" === typeof input.neighborLimit) && (undefined === input.memberLimit || "number" === typeof input.memberLimit) && (undefined === input.dependencyLimit || "number" === typeof input.dependencyLimit);
1445
- const _io3 = input => "entrypoints" === input.type && "string" === typeof input.query && (undefined === input.limit || "number" === typeof input.limit) && (undefined === input.neighbors || "number" === typeof input.neighbors);
1446
- const _io4 = input => "lookup" === input.type && "string" === typeof input.query && (undefined === input.limit || "number" === typeof input.limit);
1827
+ const _ip0 = input => "string" === typeof input["reason"];
1828
+ const _ip1 = input => undefined === input["includeExternal"] || "boolean" === typeof input["includeExternal"];
1829
+ const _ip2 = input => "string" === typeof input["query"];
1830
+ const _ip3 = input => undefined === input["limit"] || "number" === typeof input["limit"];
1831
+ const _ve0 = "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphEscape.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTour.IRequest | ITtscGraphTrace.IRequest)";
1832
+ const _vp0 = (input, _path, _exceptionable = true) => "string" === typeof input["reason"] || _report(_exceptionable, {
1833
+ path: _path + ".reason",
1834
+ expected: "string",
1835
+ value: input["reason"]
1836
+ });
1837
+ const _vp1 = (input, _path, _exceptionable = true) => undefined === input["includeExternal"] || "boolean" === typeof input["includeExternal"] || _report(_exceptionable, {
1838
+ path: _path + ".includeExternal",
1839
+ expected: "(boolean | undefined)",
1840
+ value: input["includeExternal"]
1841
+ });
1842
+ const _vp2 = (input, _path, _exceptionable = true) => "string" === typeof input["query"] || _report(_exceptionable, {
1843
+ path: _path + ".query",
1844
+ expected: "string",
1845
+ value: input["query"]
1846
+ });
1847
+ const _vp3 = (input, _path, _exceptionable = true) => undefined === input["limit"] || "number" === typeof input["limit"] || _report(_exceptionable, {
1848
+ path: _path + ".limit",
1849
+ expected: "(number | undefined)",
1850
+ value: input["limit"]
1851
+ });
1852
+ const _ve1 = "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTour.IRequest | ITtscGraphTrace.IRequest | ITtscGraphEscape.IRequest)";
1853
+ const _io0 = input => "string" === typeof input.question && ("object" === typeof input.draft && null !== input.draft && _io1(input.draft)) && "string" === typeof input.review && ("object" === typeof input.request && null !== input.request && _iu0(input.request));
1854
+ const _io1 = input => _ip0(input) && ("details" === input.type || "entrypoints" === input.type || "escape" === input.type || "lookup" === input.type || "overview" === input.type || "tour" === input.type || "trace" === input.type);
1855
+ const _io2 = input => "details" === input.type && (Array.isArray(input.handles) && input.handles.every(elem => "string" === typeof elem)) && (undefined === input.neighbors || "boolean" === typeof input.neighbors) && (undefined === input.neighborLimit || "number" === typeof input.neighborLimit) && (undefined === input.memberLimit || "number" === typeof input.memberLimit) && (undefined === input.dependencyLimit || "number" === typeof input.dependencyLimit) && _ip1(input);
1856
+ const _io3 = input => "entrypoints" === input.type && _ip2(input) && _ip3(input) && (undefined === input.neighbors || "number" === typeof input.neighbors);
1857
+ const _io4 = input => "lookup" === input.type && _ip2(input) && _ip3(input) && _ip1(input);
1447
1858
  const _io5 = input => "overview" === input.type && (undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect);
1448
- const _io6 = input => "trace" === input.type && "string" === typeof input.from && (undefined === input.to || "string" === typeof input.to) && (undefined === input.direction || "forward" === input.direction || "impact" === input.direction || "reverse" === input.direction) && (undefined === input.focus || "all" === input.focus || "execution" === input.focus || "types" === input.focus) && (undefined === input.maxDepth || "number" === typeof input.maxDepth) && (undefined === input.maxNodes || "number" === typeof input.maxNodes);
1449
- const _io7 = input => "escape" === input.type && "string" === typeof input.reason && (undefined === input.nextStep || "string" === typeof input.nextStep);
1859
+ const _io6 = input => "tour" === input.type && _ip2(input) && _ip3(input) && (undefined === input.includeTests || "boolean" === typeof input.includeTests);
1860
+ const _io7 = input => "trace" === input.type && "string" === typeof input.from && (undefined === input.to || "string" === typeof input.to) && (undefined === input.direction || "forward" === input.direction || "impact" === input.direction || "reverse" === input.direction) && (undefined === input.focus || "all" === input.focus || "execution" === input.focus || "types" === input.focus) && (undefined === input.maxDepth || "number" === typeof input.maxDepth) && (undefined === input.maxNodes || "number" === typeof input.maxNodes) && _ip1(input);
1861
+ const _io8 = input => "escape" === input.type && _ip0(input) && (undefined === input.nextStep || "string" === typeof input.nextStep);
1450
1862
  const _iu0 = input => (() => {
1451
1863
  if ("details" === input.type)
1452
1864
  return _io2(input);
@@ -1456,10 +1868,12 @@ function createServer(graph, version) {
1456
1868
  return _io4(input);
1457
1869
  else if ("overview" === input.type)
1458
1870
  return _io5(input);
1459
- else if ("trace" === input.type)
1871
+ else if ("tour" === input.type)
1460
1872
  return _io6(input);
1461
- else if ("escape" === input.type)
1873
+ else if ("trace" === input.type)
1462
1874
  return _io7(input);
1875
+ else if ("escape" === input.type)
1876
+ return _io8(input);
1463
1877
  else
1464
1878
  return false;
1465
1879
  })();
@@ -1467,17 +1881,13 @@ function createServer(graph, version) {
1467
1881
  path: _path + ".question",
1468
1882
  expected: "string",
1469
1883
  value: input.question
1470
- }), "string" === typeof input.graphNeed || _report(_exceptionable, {
1471
- path: _path + ".graphNeed",
1472
- expected: "string",
1473
- value: input.graphNeed
1474
1884
  }), ("object" === typeof input.draft && null !== input.draft || _report(_exceptionable, {
1475
1885
  path: _path + ".draft",
1476
- expected: "ITtscGraphApplication.IRequestDraft",
1886
+ expected: "ITtscGraphApplication.IDraft",
1477
1887
  value: input.draft
1478
1888
  })) && _vo1(input.draft, _path + ".draft", true && _exceptionable) || _report(_exceptionable, {
1479
1889
  path: _path + ".draft",
1480
- expected: "ITtscGraphApplication.IRequestDraft",
1890
+ expected: "ITtscGraphApplication.IDraft",
1481
1891
  value: input.draft
1482
1892
  }), "string" === typeof input.review || _report(_exceptionable, {
1483
1893
  path: _path + ".review",
@@ -1485,20 +1895,16 @@ function createServer(graph, version) {
1485
1895
  value: input.review
1486
1896
  }), ("object" === typeof input.request && null !== input.request || _report(_exceptionable, {
1487
1897
  path: _path + ".request",
1488
- expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphEscape.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTrace.IRequest)",
1898
+ expected: _ve0,
1489
1899
  value: input.request
1490
1900
  })) && _vu0(input.request, _path + ".request", true && _exceptionable) || _report(_exceptionable, {
1491
1901
  path: _path + ".request",
1492
- expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphEscape.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTrace.IRequest)",
1902
+ expected: _ve0,
1493
1903
  value: input.request
1494
1904
  })].every(flag => flag);
1495
- const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.reason || _report(_exceptionable, {
1496
- path: _path + ".reason",
1497
- expected: "string",
1498
- value: input.reason
1499
- }), "details" === input.type || "entrypoints" === input.type || "escape" === input.type || "lookup" === input.type || "overview" === input.type || "trace" === input.type || _report(_exceptionable, {
1905
+ const _vo1 = (input, _path, _exceptionable = true) => [_vp0(input, _path, true && _exceptionable), "details" === input.type || "entrypoints" === input.type || "escape" === input.type || "lookup" === input.type || "overview" === input.type || "tour" === input.type || "trace" === input.type || _report(_exceptionable, {
1500
1906
  path: _path + ".type",
1501
- expected: "(\"details\" | \"entrypoints\" | \"escape\" | \"lookup\" | \"overview\" | \"trace\")",
1907
+ expected: "(\"details\" | \"entrypoints\" | \"escape\" | \"lookup\" | \"overview\" | \"tour\" | \"trace\")",
1502
1908
  value: input.type
1503
1909
  })].every(flag => flag);
1504
1910
  const _vo2 = (input, _path, _exceptionable = true) => ["details" === input.type || _report(_exceptionable, {
@@ -1533,20 +1939,12 @@ function createServer(graph, version) {
1533
1939
  path: _path + ".dependencyLimit",
1534
1940
  expected: "(number | undefined)",
1535
1941
  value: input.dependencyLimit
1536
- })].every(flag => flag);
1942
+ }), _vp1(input, _path, true && _exceptionable)].every(flag => flag);
1537
1943
  const _vo3 = (input, _path, _exceptionable = true) => ["entrypoints" === input.type || _report(_exceptionable, {
1538
1944
  path: _path + ".type",
1539
1945
  expected: "\"entrypoints\"",
1540
1946
  value: input.type
1541
- }), "string" === typeof input.query || _report(_exceptionable, {
1542
- path: _path + ".query",
1543
- expected: "string",
1544
- value: input.query
1545
- }), undefined === input.limit || "number" === typeof input.limit || _report(_exceptionable, {
1546
- path: _path + ".limit",
1547
- expected: "(number | undefined)",
1548
- value: input.limit
1549
- }), undefined === input.neighbors || "number" === typeof input.neighbors || _report(_exceptionable, {
1947
+ }), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), undefined === input.neighbors || "number" === typeof input.neighbors || _report(_exceptionable, {
1550
1948
  path: _path + ".neighbors",
1551
1949
  expected: "(number | undefined)",
1552
1950
  value: input.neighbors
@@ -1555,15 +1953,7 @@ function createServer(graph, version) {
1555
1953
  path: _path + ".type",
1556
1954
  expected: "\"lookup\"",
1557
1955
  value: input.type
1558
- }), "string" === typeof input.query || _report(_exceptionable, {
1559
- path: _path + ".query",
1560
- expected: "string",
1561
- value: input.query
1562
- }), undefined === input.limit || "number" === typeof input.limit || _report(_exceptionable, {
1563
- path: _path + ".limit",
1564
- expected: "(number | undefined)",
1565
- value: input.limit
1566
- })].every(flag => flag);
1956
+ }), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), _vp1(input, _path, true && _exceptionable)].every(flag => flag);
1567
1957
  const _vo5 = (input, _path, _exceptionable = true) => ["overview" === input.type || _report(_exceptionable, {
1568
1958
  path: _path + ".type",
1569
1959
  expected: "\"overview\"",
@@ -1573,7 +1963,16 @@ function createServer(graph, version) {
1573
1963
  expected: "(\"all\" | \"hotspots\" | \"layers\" | \"publicApi\" | undefined)",
1574
1964
  value: input.aspect
1575
1965
  })].every(flag => flag);
1576
- const _vo6 = (input, _path, _exceptionable = true) => ["trace" === input.type || _report(_exceptionable, {
1966
+ const _vo6 = (input, _path, _exceptionable = true) => ["tour" === input.type || _report(_exceptionable, {
1967
+ path: _path + ".type",
1968
+ expected: "\"tour\"",
1969
+ value: input.type
1970
+ }), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), undefined === input.includeTests || "boolean" === typeof input.includeTests || _report(_exceptionable, {
1971
+ path: _path + ".includeTests",
1972
+ expected: "(boolean | undefined)",
1973
+ value: input.includeTests
1974
+ })].every(flag => flag);
1975
+ const _vo7 = (input, _path, _exceptionable = true) => ["trace" === input.type || _report(_exceptionable, {
1577
1976
  path: _path + ".type",
1578
1977
  expected: "\"trace\"",
1579
1978
  value: input.type
@@ -1601,16 +2000,12 @@ function createServer(graph, version) {
1601
2000
  path: _path + ".maxNodes",
1602
2001
  expected: "(number | undefined)",
1603
2002
  value: input.maxNodes
1604
- })].every(flag => flag);
1605
- const _vo7 = (input, _path, _exceptionable = true) => ["escape" === input.type || _report(_exceptionable, {
2003
+ }), _vp1(input, _path, true && _exceptionable)].every(flag => flag);
2004
+ const _vo8 = (input, _path, _exceptionable = true) => ["escape" === input.type || _report(_exceptionable, {
1606
2005
  path: _path + ".type",
1607
2006
  expected: "\"escape\"",
1608
2007
  value: input.type
1609
- }), "string" === typeof input.reason || _report(_exceptionable, {
1610
- path: _path + ".reason",
1611
- expected: "string",
1612
- value: input.reason
1613
- }), undefined === input.nextStep || "string" === typeof input.nextStep || _report(_exceptionable, {
2008
+ }), _vp0(input, _path, true && _exceptionable), undefined === input.nextStep || "string" === typeof input.nextStep || _report(_exceptionable, {
1614
2009
  path: _path + ".nextStep",
1615
2010
  expected: "(string | undefined)",
1616
2011
  value: input.nextStep
@@ -1624,14 +2019,16 @@ function createServer(graph, version) {
1624
2019
  return _vo4(input, _path, true && _exceptionable);
1625
2020
  else if ("overview" === input.type)
1626
2021
  return _vo5(input, _path, true && _exceptionable);
1627
- else if ("trace" === input.type)
2022
+ else if ("tour" === input.type)
1628
2023
  return _vo6(input, _path, true && _exceptionable);
1629
- else if ("escape" === input.type)
2024
+ else if ("trace" === input.type)
1630
2025
  return _vo7(input, _path, true && _exceptionable);
2026
+ else if ("escape" === input.type)
2027
+ return _vo8(input, _path, true && _exceptionable);
1631
2028
  else
1632
2029
  return _report(_exceptionable, {
1633
2030
  path: _path,
1634
- expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTrace.IRequest | ITtscGraphEscape.IRequest)",
2031
+ expected: _ve1,
1635
2032
  value: input
1636
2033
  });
1637
2034
  })();
@@ -1673,7 +2070,13 @@ function createServer(graph, version) {
1673
2070
  };
1674
2071
  const functions = controller.application.functions;
1675
2072
  const execute = controller.execute;
1676
- const server = new mcp_js_1.McpServer({ name: "ttsc-graph", version }, { capabilities: { tools: {} }, instructions: instructions_1.instructions });
2073
+ const server = new mcp_js_1.McpServer({ name: "ttsc-graph", version }, {
2074
+ capabilities: { tools: {} },
2075
+ // The MCP `instructions` are the interface's JSDoc, which
2076
+ // `typia.llm.controller` reflects onto `application.description`. See
2077
+ // {@link ITtscGraphApplication}.
2078
+ instructions: controller.application.description,
2079
+ });
1677
2080
  const raw = server.server;
1678
2081
  raw.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
1679
2082
  tools: functions.map((func) => ({