@ttsc/graph 0.16.5 → 0.16.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/lib/TtscGraphApplication.js +36 -23
  2. package/lib/TtscGraphApplication.js.map +1 -1
  3. package/lib/model/loadGraph.js +17 -17
  4. package/lib/server/accessAliases.js +53 -0
  5. package/lib/server/accessAliases.js.map +1 -0
  6. package/lib/server/createServer.js +1133 -634
  7. package/lib/server/createServer.js.map +1 -1
  8. package/lib/server/instructions.js +69 -21
  9. package/lib/server/instructions.js.map +1 -1
  10. package/lib/server/runDetails.js +413 -0
  11. package/lib/server/runDetails.js.map +1 -0
  12. package/lib/server/{runIndex.js → runEntrypoints.js} +91 -26
  13. package/lib/server/runEntrypoints.js.map +1 -0
  14. package/lib/server/{runQuery.js → runLookup.js} +102 -15
  15. package/lib/server/runLookup.js.map +1 -0
  16. package/lib/server/runOverview.js +31 -21
  17. package/lib/server/runOverview.js.map +1 -1
  18. package/lib/server/runTrace.js +133 -38
  19. package/lib/server/runTrace.js.map +1 -1
  20. package/lib/structures/{ITtscGraphQuery.js → ITtscGraphDetails.js} +1 -1
  21. package/lib/structures/ITtscGraphDetails.js.map +1 -0
  22. package/lib/structures/ITtscGraphEntrypoints.js +3 -0
  23. package/lib/structures/ITtscGraphEntrypoints.js.map +1 -0
  24. package/lib/structures/{ITtscGraphExpand.js → ITtscGraphEscape.js} +1 -1
  25. package/lib/structures/ITtscGraphEscape.js.map +1 -0
  26. package/lib/structures/{ITtscGraphIndex.js → ITtscGraphLookup.js} +1 -1
  27. package/lib/structures/ITtscGraphLookup.js.map +1 -0
  28. package/lib/structures/index.js +4 -3
  29. package/lib/structures/index.js.map +1 -1
  30. package/package.json +2 -2
  31. package/src/TtscGraphApplication.ts +39 -32
  32. package/src/server/accessAliases.ts +55 -0
  33. package/src/server/createServer.ts +4 -7
  34. package/src/server/instructions.ts +69 -21
  35. package/src/server/runDetails.ts +469 -0
  36. package/src/server/{runIndex.ts → runEntrypoints.ts} +109 -34
  37. package/src/server/{runQuery.ts → runLookup.ts} +123 -16
  38. package/src/server/runOverview.ts +35 -23
  39. package/src/server/runTrace.ts +164 -38
  40. package/src/structures/ITtscGraphApplication.ts +100 -52
  41. package/src/structures/ITtscGraphDecorator.ts +12 -14
  42. package/src/structures/ITtscGraphDetails.ts +134 -0
  43. package/src/structures/{ITtscGraphIndex.ts → ITtscGraphEntrypoints.ts} +34 -16
  44. package/src/structures/ITtscGraphEscape.ts +39 -0
  45. package/src/structures/ITtscGraphEvidence.ts +5 -8
  46. package/src/structures/ITtscGraphLookup.ts +61 -0
  47. package/src/structures/ITtscGraphNode.ts +10 -4
  48. package/src/structures/ITtscGraphOverview.ts +24 -16
  49. package/src/structures/ITtscGraphTrace.ts +54 -11
  50. package/src/structures/TtscGraphNodeKind.ts +2 -2
  51. package/src/structures/index.ts +4 -3
  52. package/lib/server/runExpand.js +0 -177
  53. package/lib/server/runExpand.js.map +0 -1
  54. package/lib/server/runIndex.js.map +0 -1
  55. package/lib/server/runQuery.js.map +0 -1
  56. package/lib/structures/ITtscGraphExpand.js.map +0 -1
  57. package/lib/structures/ITtscGraphIndex.js.map +0 -1
  58. package/lib/structures/ITtscGraphQuery.js.map +0 -1
  59. package/src/server/runExpand.ts +0 -186
  60. package/src/structures/ITtscGraphExpand.ts +0 -85
  61. package/src/structures/ITtscGraphQuery.ts +0 -49
@@ -46,7 +46,7 @@ const TtscGraphApplication_1 = require("../TtscGraphApplication");
46
46
  const instructions_1 = require("./instructions");
47
47
  /**
48
48
  * Build the MCP server for a graph. `typia.llm.controller` reflects
49
- * {@link ITtscGraphApplication} into a validated tool application every tool's
49
+ * {@link ITtscGraphApplication} into a validated tool application. Every tool's
50
50
  * JSON schema and argument validator is generated from the method's TypeScript
51
51
  * types and JSDoc, so there is no hand-written schema. The list/call handlers
52
52
  * below are the minimal standalone registration: list the generated functions,
@@ -66,57 +66,351 @@ function createServer(graph, version) {
66
66
  "application": _a._llmApplicationFinalize({
67
67
  functions: [
68
68
  {
69
- description: "The first source-free index for a code question: ranked symbols, exact code\nhandles mentioned in the query, declaration signatures, and direct\ndependency context. Use this before reading source.",
70
- name: "graph_index",
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",
71
71
  output: {
72
72
  type: "object",
73
73
  properties: {
74
- hits: {
75
- type: "array",
76
- items: {
77
- $ref: "#/$defs/ITtscGraphIndex.IHit"
74
+ result: {
75
+ anyOf: [
76
+ {
77
+ $ref: "#/$defs/ITtscGraphDetails"
78
+ },
79
+ {
80
+ $ref: "#/$defs/ITtscGraphEntrypoints"
81
+ },
82
+ {
83
+ $ref: "#/$defs/ITtscGraphEscape"
84
+ },
85
+ {
86
+ $ref: "#/$defs/ITtscGraphLookup"
87
+ },
88
+ {
89
+ $ref: "#/$defs/ITtscGraphOverview"
90
+ },
91
+ {
92
+ $ref: "#/$defs/ITtscGraphTrace"
93
+ }
94
+ ],
95
+ "x-discriminator": {
96
+ mapping: {
97
+ details: "#/$defs/ITtscGraphDetails",
98
+ entrypoints: "#/$defs/ITtscGraphEntrypoints",
99
+ escape: "#/$defs/ITtscGraphEscape",
100
+ lookup: "#/$defs/ITtscGraphLookup",
101
+ overview: "#/$defs/ITtscGraphOverview",
102
+ trace: "#/$defs/ITtscGraphTrace"
103
+ },
104
+ propertyName: "type"
105
+ }
106
+ }
107
+ },
108
+ required: [
109
+ "result"
110
+ ],
111
+ additionalProperties: false,
112
+ $defs: {
113
+ ITtscGraphDecorator: {
114
+ type: "object",
115
+ properties: {
116
+ arguments: {
117
+ type: "array",
118
+ items: {
119
+ $ref: "#/$defs/ITtscGraphDecorator.IArgument"
120
+ },
121
+ description: "The literal call arguments, in source order. Empty for a bare decorator."
122
+ },
123
+ name: {
124
+ type: "string",
125
+ description: "The decorator name as written, qualified through its access path:\n`Controller`, `Get`, `TypedRoute.Get`, `MessagePattern`."
126
+ }
78
127
  },
79
- description: "Ranked symbols relevant to the query."
128
+ required: [
129
+ "name",
130
+ "arguments"
131
+ ],
132
+ additionalProperties: false
80
133
  },
81
- mentions: {
82
- type: "array",
83
- items: {
84
- $ref: "#/$defs/ITtscGraphIndex.IMention"
134
+ "ITtscGraphDecorator.IArgument": {
135
+ type: "object",
136
+ properties: {
137
+ literal: {
138
+ anyOf: [
139
+ {
140
+ type: "string"
141
+ },
142
+ {
143
+ type: "number"
144
+ },
145
+ {
146
+ type: "boolean"
147
+ }
148
+ ],
149
+ description: "The statically-resolved literal value, when the argument is a literal."
150
+ }
85
151
  },
86
- description: "Code handles written directly in the query, resolved when possible."
152
+ required: [],
153
+ additionalProperties: false
87
154
  },
88
- neighborhood: {
89
- type: "array",
90
- items: {
91
- $ref: "#/$defs/ITtscGraphIndex.INeighborhood"
155
+ ITtscGraphDetails: {
156
+ type: "object",
157
+ properties: {
158
+ type: {
159
+ type: "string",
160
+ "enum": [
161
+ "details"
162
+ ],
163
+ description: "Discriminator for selected symbol inspection."
164
+ },
165
+ nodes: {
166
+ type: "array",
167
+ items: {
168
+ $ref: "#/$defs/ITtscGraphDetails.INode"
169
+ }
170
+ },
171
+ unknown: {
172
+ type: "array",
173
+ items: {
174
+ type: "string"
175
+ },
176
+ description: "Handles that resolved to no node, or that were ambiguous."
177
+ }
92
178
  },
93
- description: "Direct dependency context for the resolved mentions and highest hits."
179
+ required: [
180
+ "type",
181
+ "nodes",
182
+ "unknown"
183
+ ],
184
+ additionalProperties: false
94
185
  },
95
- next: {
96
- $ref: "#/$defs/ITtscGraphIndex.INext",
97
- description: "Follow-up handles for deeper graph calls."
186
+ "ITtscGraphDetails.IMember": {
187
+ type: "object",
188
+ properties: {
189
+ decorators: {
190
+ type: "array",
191
+ items: {
192
+ $ref: "#/$defs/ITtscGraphDecorator"
193
+ },
194
+ description: "Decorators written on this member, when any."
195
+ },
196
+ kind: {
197
+ type: "string"
198
+ },
199
+ line: {
200
+ type: "number",
201
+ description: "1-based declaration line, when known."
202
+ },
203
+ name: {
204
+ type: "string"
205
+ },
206
+ signature: {
207
+ type: "string",
208
+ description: "The member's declaration signature."
209
+ }
210
+ },
211
+ required: [
212
+ "name",
213
+ "kind"
214
+ ],
215
+ additionalProperties: false
98
216
  },
99
- query: {
100
- type: "string",
101
- description: "The original query the index was built for."
217
+ "ITtscGraphDetails.INode": {
218
+ type: "object",
219
+ properties: {
220
+ calls: {
221
+ type: "array",
222
+ items: {
223
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
224
+ },
225
+ description: "Direct execution dependencies in source order, with edge evidence."
226
+ },
227
+ decorators: {
228
+ type: "array",
229
+ items: {
230
+ $ref: "#/$defs/ITtscGraphDecorator"
231
+ },
232
+ description: "Decorators written on this declaration, when any."
233
+ },
234
+ dependedOnBy: {
235
+ type: "array",
236
+ items: {
237
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
238
+ },
239
+ description: "Symbols that use this node (incoming dependency edges)."
240
+ },
241
+ dependsOn: {
242
+ type: "array",
243
+ items: {
244
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
245
+ },
246
+ description: "Symbols this node uses (outgoing dependency edges)."
247
+ },
248
+ file: {
249
+ type: "string"
250
+ },
251
+ id: {
252
+ type: "string"
253
+ },
254
+ implementation: {
255
+ $ref: "#/$defs/ITtscGraphEvidence",
256
+ description: "Assigned implementation span, when source comes from one."
257
+ },
258
+ kind: {
259
+ type: "string"
260
+ },
261
+ line: {
262
+ type: "number",
263
+ description: "1-based declaration line, when known."
264
+ },
265
+ literals: {
266
+ type: "array",
267
+ items: {
268
+ type: "string"
269
+ },
270
+ description: "String literal values from the signature."
271
+ },
272
+ members: {
273
+ type: "array",
274
+ items: {
275
+ $ref: "#/$defs/ITtscGraphDetails.IMember"
276
+ },
277
+ description: "For a container or object-literal variable: the owned symbol or top-level\nproperty outline a consumer reaches for, without bodies."
278
+ },
279
+ name: {
280
+ type: "string"
281
+ },
282
+ signature: {
283
+ type: "string",
284
+ description: "The declaration signature: its first line(s) up to the body."
285
+ },
286
+ sourceSpan: {
287
+ $ref: "#/$defs/PickITtscGraphEvidenceendLinefilestartLine",
288
+ description: "The declaration or implementation file and line range, when known."
289
+ },
290
+ types: {
291
+ type: "array",
292
+ items: {
293
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
294
+ },
295
+ description: "Direct type dependencies in source order, with edge evidence."
296
+ }
297
+ },
298
+ required: [
299
+ "id",
300
+ "name",
301
+ "kind",
302
+ "file"
303
+ ],
304
+ additionalProperties: false
102
305
  },
103
- truncated: {
104
- type: "boolean",
105
- description: "True when result caps hid additional seeds or references."
106
- }
107
- },
108
- required: [
109
- "query",
110
- "hits",
111
- "mentions",
112
- "neighborhood",
113
- "next"
114
- ],
115
- additionalProperties: false,
116
- $defs: {
117
- "ITtscGraphIndex.IHit": {
306
+ "ITtscGraphDetails.IReference": {
307
+ type: "object",
308
+ properties: {
309
+ aliases: {
310
+ type: "array",
311
+ items: {
312
+ type: "string"
313
+ },
314
+ description: "Stable access-path aliases derived from edge evidence. For example, an\nedge to `Owner.member` through `obj.slot.member` may expose\n`Owner.slot.member` so answers can preserve both the resolved symbol and\nthe source access path."
315
+ },
316
+ evidence: {
317
+ $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."
319
+ },
320
+ file: {
321
+ type: "string"
322
+ },
323
+ id: {
324
+ type: "string"
325
+ },
326
+ kind: {
327
+ type: "string"
328
+ },
329
+ line: {
330
+ type: "number",
331
+ description: "1-based declaration line, when known."
332
+ },
333
+ name: {
334
+ type: "string"
335
+ },
336
+ relation: {
337
+ type: "string",
338
+ description: "The edge kind connecting the two (`calls`, `type_ref`, ...)."
339
+ }
340
+ },
341
+ required: [
342
+ "id",
343
+ "name",
344
+ "kind",
345
+ "file",
346
+ "relation"
347
+ ],
348
+ additionalProperties: false
349
+ },
350
+ ITtscGraphEntrypoints: {
351
+ type: "object",
352
+ properties: {
353
+ type: {
354
+ type: "string",
355
+ "enum": [
356
+ "entrypoints"
357
+ ],
358
+ description: "Discriminator for first-pass question indexing."
359
+ },
360
+ hits: {
361
+ type: "array",
362
+ items: {
363
+ $ref: "#/$defs/ITtscGraphEntrypoints.IHit"
364
+ },
365
+ description: "Ranked symbols relevant to the query."
366
+ },
367
+ mentions: {
368
+ type: "array",
369
+ items: {
370
+ $ref: "#/$defs/ITtscGraphEntrypoints.IMention"
371
+ },
372
+ description: "Code handles written directly in the query, resolved when possible."
373
+ },
374
+ neighborhood: {
375
+ type: "array",
376
+ items: {
377
+ $ref: "#/$defs/ITtscGraphEntrypoints.INeighborhood"
378
+ },
379
+ description: "Direct dependency context for the resolved mentions and highest hits."
380
+ },
381
+ next: {
382
+ $ref: "#/$defs/ITtscGraphEntrypoints.INext",
383
+ description: "Follow-up handles for deeper graph calls."
384
+ },
385
+ query: {
386
+ type: "string",
387
+ description: "The original question/search phrase the entrypoints were built for."
388
+ },
389
+ truncated: {
390
+ type: "boolean",
391
+ description: "True when result caps hid additional seeds or references."
392
+ }
393
+ },
394
+ required: [
395
+ "type",
396
+ "query",
397
+ "hits",
398
+ "mentions",
399
+ "neighborhood",
400
+ "next"
401
+ ],
402
+ additionalProperties: false
403
+ },
404
+ "ITtscGraphEntrypoints.IHit": {
118
405
  type: "object",
119
406
  properties: {
407
+ decorators: {
408
+ type: "array",
409
+ items: {
410
+ $ref: "#/$defs/ITtscGraphDecorator"
411
+ },
412
+ description: "Decorators written on this declaration, when any."
413
+ },
120
414
  file: {
121
415
  type: "string"
122
416
  },
@@ -151,20 +445,20 @@ function createServer(graph, version) {
151
445
  ],
152
446
  additionalProperties: false
153
447
  },
154
- "ITtscGraphIndex.IMention": {
448
+ "ITtscGraphEntrypoints.IMention": {
155
449
  type: "object",
156
450
  properties: {
157
451
  candidates: {
158
452
  type: "array",
159
453
  items: {
160
- $ref: "#/$defs/ITtscGraphIndex.INode"
454
+ $ref: "#/$defs/ITtscGraphEntrypoints.INode"
161
455
  }
162
456
  },
163
457
  handle: {
164
458
  type: "string"
165
459
  },
166
460
  node: {
167
- $ref: "#/$defs/ITtscGraphIndex.INode"
461
+ $ref: "#/$defs/ITtscGraphEntrypoints.INode"
168
462
  }
169
463
  },
170
464
  required: [
@@ -172,19 +466,26 @@ function createServer(graph, version) {
172
466
  ],
173
467
  additionalProperties: false
174
468
  },
175
- "ITtscGraphIndex.INeighborhood": {
469
+ "ITtscGraphEntrypoints.INeighborhood": {
176
470
  type: "object",
177
471
  properties: {
472
+ decorators: {
473
+ type: "array",
474
+ items: {
475
+ $ref: "#/$defs/ITtscGraphDecorator"
476
+ },
477
+ description: "Decorators written on this declaration, when any."
478
+ },
178
479
  dependedOnBy: {
179
480
  type: "array",
180
481
  items: {
181
- $ref: "#/$defs/ITtscGraphIndex.IReference"
482
+ $ref: "#/$defs/ITtscGraphEntrypoints.IReference"
182
483
  }
183
484
  },
184
485
  dependsOn: {
185
486
  type: "array",
186
487
  items: {
187
- $ref: "#/$defs/ITtscGraphIndex.IReference"
488
+ $ref: "#/$defs/ITtscGraphEntrypoints.IReference"
188
489
  }
189
490
  },
190
491
  file: {
@@ -218,33 +519,40 @@ function createServer(graph, version) {
218
519
  ],
219
520
  additionalProperties: false
220
521
  },
221
- "ITtscGraphIndex.INext": {
522
+ "ITtscGraphEntrypoints.INext": {
222
523
  type: "object",
223
524
  properties: {
224
- expand: {
525
+ details: {
225
526
  type: "array",
226
527
  items: {
227
528
  type: "string"
228
529
  },
229
- description: "Pass these ids to `graph_expand`, with `source: true` only when needed."
530
+ description: "Pass these ids to `details` for source-free symbol facts."
230
531
  },
231
532
  traceFrom: {
232
533
  type: "array",
233
534
  items: {
234
535
  type: "string"
235
536
  },
236
- description: "Pass these ids to `graph_trace` when following dependency flow."
537
+ description: "Pass these ids to `trace` when following dependency flow."
237
538
  }
238
539
  },
239
540
  required: [
240
- "expand",
541
+ "details",
241
542
  "traceFrom"
242
543
  ],
243
544
  additionalProperties: false
244
545
  },
245
- "ITtscGraphIndex.INode": {
546
+ "ITtscGraphEntrypoints.INode": {
246
547
  type: "object",
247
548
  properties: {
549
+ decorators: {
550
+ type: "array",
551
+ items: {
552
+ $ref: "#/$defs/ITtscGraphDecorator"
553
+ },
554
+ description: "Decorators written on this declaration, when any."
555
+ },
248
556
  file: {
249
557
  type: "string"
250
558
  },
@@ -274,9 +582,13 @@ function createServer(graph, version) {
274
582
  ],
275
583
  additionalProperties: false
276
584
  },
277
- "ITtscGraphIndex.IReference": {
585
+ "ITtscGraphEntrypoints.IReference": {
278
586
  type: "object",
279
587
  properties: {
588
+ evidence: {
589
+ $ref: "#/$defs/ITtscGraphEvidence",
590
+ description: "Source span for the expression that produced this relationship. It lets\nan agent see why the edge exists without opening the file."
591
+ },
280
592
  file: {
281
593
  type: "string"
282
594
  },
@@ -305,121 +617,213 @@ function createServer(graph, version) {
305
617
  "relation"
306
618
  ],
307
619
  additionalProperties: false
308
- }
309
- }
310
- },
311
- parameters: {
312
- type: "object",
313
- properties: {
314
- limit: {
315
- type: "number",
316
- description: "Maximum ranked hits to return."
317
620
  },
318
- neighbors: {
319
- type: "number",
320
- description: "Maximum direct dependencies and dependents to return per indexed symbol."
621
+ ITtscGraphEscape: {
622
+ type: "object",
623
+ properties: {
624
+ type: {
625
+ type: "string",
626
+ "enum": [
627
+ "escape"
628
+ ],
629
+ description: "Discriminator for the no-op escape route."
630
+ },
631
+ nextStep: {
632
+ type: "string",
633
+ description: "The next non-graph step, if useful."
634
+ },
635
+ reason: {
636
+ type: "string",
637
+ description: "Why no graph operation should run."
638
+ },
639
+ skipped: {
640
+ type: "boolean",
641
+ "enum": [
642
+ true
643
+ ],
644
+ description: "Always true so callers can distinguish an intentional no-op."
645
+ }
646
+ },
647
+ required: [
648
+ "type",
649
+ "skipped",
650
+ "reason"
651
+ ],
652
+ additionalProperties: false
321
653
  },
322
- query: {
323
- type: "string",
324
- 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`."
325
- }
326
- },
327
- required: [
328
- "query"
329
- ],
330
- additionalProperties: false,
331
- $defs: {}
332
- },
333
- validate: (() => {
334
- const _io0 = input => "string" === typeof input.query && (undefined === input.limit || "number" === typeof input.limit) && (undefined === input.neighbors || "number" === typeof input.neighbors);
335
- const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.query || _report(_exceptionable, {
336
- path: _path + ".query",
337
- expected: "string",
338
- value: input.query
339
- }), undefined === input.limit || "number" === typeof input.limit || _report(_exceptionable, {
340
- path: _path + ".limit",
341
- expected: "(number | undefined)",
342
- value: input.limit
343
- }), undefined === input.neighbors || "number" === typeof input.neighbors || _report(_exceptionable, {
344
- path: _path + ".neighbors",
345
- expected: "(number | undefined)",
346
- value: input.neighbors
347
- })].every(flag => flag);
348
- const __is = input => "object" === typeof input && null !== input && _io0(input);
349
- let errors;
350
- let _report;
351
- return input => {
352
- if (false === __is(input)) {
353
- errors = [];
354
- _report = _b._validateReport(errors);
355
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
356
- path: _path + "",
357
- expected: "ITtscGraphIndex.IProps",
358
- value: input
359
- })) && _vo0(input, _path + "", true) || _report(true, {
360
- path: _path + "",
361
- expected: "ITtscGraphIndex.IProps",
362
- value: input
363
- }))(input, "$input", true);
364
- const success = 0 === errors.length;
365
- return success ? {
366
- success,
367
- data: input
368
- } : {
369
- success,
370
- errors,
371
- data: input
372
- };
373
- }
374
- return {
375
- success: true,
376
- data: input
377
- };
378
- };
379
- })()
380
- },
381
- {
382
- description: "The project's architecture \u2014 folder layers, dependency hotspots, and the\npublic API. Call first to orient on an unfamiliar codebase.",
383
- name: "graph_overview",
384
- output: {
385
- type: "object",
386
- properties: {
387
- counts: {
388
- $ref: "#/$defs/ITtscGraphOverview.ICounts",
389
- description: "Size of the graph."
654
+ ITtscGraphEvidence: {
655
+ type: "object",
656
+ properties: {
657
+ endCol: {
658
+ type: "number",
659
+ description: "1-based column where the span ends, when known."
660
+ },
661
+ endLine: {
662
+ type: "number",
663
+ description: "1-based line where the span ends, when it differs from `startLine`."
664
+ },
665
+ file: {
666
+ type: "string",
667
+ description: "Project-relative path of the file the span lives in."
668
+ },
669
+ startCol: {
670
+ type: "number",
671
+ description: "1-based column where the span starts, when known."
672
+ },
673
+ startLine: {
674
+ type: "number",
675
+ description: "1-based line where the span starts."
676
+ }
677
+ },
678
+ required: [
679
+ "file",
680
+ "startLine"
681
+ ],
682
+ additionalProperties: false
390
683
  },
391
- hotspots: {
392
- type: "array",
393
- items: {
394
- $ref: "#/$defs/ITtscGraphOverview.IHotspot"
684
+ ITtscGraphLookup: {
685
+ type: "object",
686
+ properties: {
687
+ type: {
688
+ type: "string",
689
+ "enum": [
690
+ "lookup"
691
+ ],
692
+ description: "Discriminator for targeted symbol lookup."
693
+ },
694
+ hits: {
695
+ type: "array",
696
+ items: {
697
+ $ref: "#/$defs/ITtscGraphLookup.IHit"
698
+ }
699
+ },
700
+ next: {
701
+ $ref: "#/$defs/ITtscGraphLookup.INext",
702
+ description: "Follow-up handles for selected symbol details."
703
+ }
395
704
  },
396
- description: "Highest-dependency symbols, busiest first."
705
+ required: [
706
+ "type",
707
+ "hits",
708
+ "next"
709
+ ],
710
+ additionalProperties: false
397
711
  },
398
- layers: {
399
- type: "array",
400
- items: {
401
- $ref: "#/$defs/ITtscGraphOverview.ILayer"
712
+ "ITtscGraphLookup.IHit": {
713
+ type: "object",
714
+ properties: {
715
+ decorators: {
716
+ type: "array",
717
+ items: {
718
+ $ref: "#/$defs/ITtscGraphDecorator"
719
+ },
720
+ description: "Decorators written on this declaration, when any."
721
+ },
722
+ file: {
723
+ type: "string"
724
+ },
725
+ id: {
726
+ type: "string"
727
+ },
728
+ kind: {
729
+ type: "string"
730
+ },
731
+ line: {
732
+ type: "number",
733
+ description: "1-based declaration line, when known."
734
+ },
735
+ name: {
736
+ type: "string"
737
+ },
738
+ score: {
739
+ type: "number",
740
+ description: "Relative relevance; higher is a better match."
741
+ },
742
+ signature: {
743
+ type: "string",
744
+ description: "The hit's declaration signature, so you can often answer without\nrequesting details."
745
+ }
402
746
  },
403
- description: "Folder layering, largest first."
747
+ required: [
748
+ "id",
749
+ "name",
750
+ "kind",
751
+ "file",
752
+ "score"
753
+ ],
754
+ additionalProperties: false
404
755
  },
405
- project: {
406
- type: "string",
407
- description: "Absolute project root."
756
+ "ITtscGraphLookup.INext": {
757
+ type: "object",
758
+ properties: {
759
+ details: {
760
+ type: "array",
761
+ items: {
762
+ type: "string"
763
+ },
764
+ description: "Pass these ids to `details` for source-free symbol facts."
765
+ },
766
+ traceFrom: {
767
+ type: "array",
768
+ items: {
769
+ type: "string"
770
+ },
771
+ description: "Pass these ids to `trace` when following dependency flow."
772
+ }
773
+ },
774
+ required: [
775
+ "details",
776
+ "traceFrom"
777
+ ],
778
+ additionalProperties: false
408
779
  },
409
- publicApi: {
410
- type: "array",
411
- items: {
412
- $ref: "#/$defs/ITtscGraphOverview.IPublicApi"
780
+ ITtscGraphOverview: {
781
+ type: "object",
782
+ properties: {
783
+ type: {
784
+ type: "string",
785
+ "enum": [
786
+ "overview"
787
+ ],
788
+ description: "Discriminator for source-free project overview."
789
+ },
790
+ counts: {
791
+ $ref: "#/$defs/ITtscGraphOverview.ICounts",
792
+ description: "Size of the graph."
793
+ },
794
+ hotspots: {
795
+ type: "array",
796
+ items: {
797
+ $ref: "#/$defs/ITtscGraphOverview.IHotspot"
798
+ },
799
+ description: "Highest-dependency symbols, busiest first."
800
+ },
801
+ layers: {
802
+ type: "array",
803
+ items: {
804
+ $ref: "#/$defs/ITtscGraphOverview.ILayer"
805
+ },
806
+ description: "Folder layering, largest first."
807
+ },
808
+ project: {
809
+ type: "string",
810
+ description: "Absolute project root."
811
+ },
812
+ publicApi: {
813
+ type: "array",
814
+ items: {
815
+ $ref: "#/$defs/ITtscGraphOverview.INode"
816
+ },
817
+ description: "Exported API symbols, most-depended-on first."
818
+ }
413
819
  },
414
- description: "Exported API symbols, most-depended-on first."
415
- }
416
- },
417
- required: [
418
- "project",
419
- "counts"
420
- ],
421
- additionalProperties: false,
422
- $defs: {
820
+ required: [
821
+ "type",
822
+ "project",
823
+ "counts"
824
+ ],
825
+ additionalProperties: false
826
+ },
423
827
  "ITtscGraphOverview.ICounts": {
424
828
  type: "object",
425
829
  properties: {
@@ -457,16 +861,24 @@ function createServer(graph, version) {
457
861
  description: "Non-structural edges leaving this symbol."
458
862
  },
459
863
  file: {
460
- type: "string"
864
+ type: "string",
865
+ description: "Project-relative path of the file that declares it."
461
866
  },
462
867
  id: {
463
- type: "string"
868
+ type: "string",
869
+ description: "Stable handle for `details` or `trace`."
464
870
  },
465
871
  kind: {
466
- type: "string"
872
+ type: "string",
873
+ description: "Its declaration kind (`class`, `interface`, `function`, ...)."
874
+ },
875
+ line: {
876
+ type: "number",
877
+ description: "1-based declaration line, when known."
467
878
  },
468
879
  name: {
469
- type: "string"
880
+ type: "string",
881
+ description: "The symbol's qualified name when available."
470
882
  }
471
883
  },
472
884
  required: [
@@ -502,342 +914,179 @@ function createServer(graph, version) {
502
914
  ],
503
915
  additionalProperties: false
504
916
  },
505
- "ITtscGraphOverview.IPublicApi": {
917
+ "ITtscGraphOverview.INode": {
506
918
  type: "object",
507
919
  properties: {
508
920
  file: {
509
921
  type: "string",
510
922
  description: "Project-relative path of the file that declares it."
511
923
  },
924
+ id: {
925
+ type: "string",
926
+ description: "Stable handle for `details` or `trace`."
927
+ },
512
928
  kind: {
513
929
  type: "string",
514
- description: "Its declaration kind (`class`, `interface`, `function`, \u2026)."
930
+ description: "Its declaration kind (`class`, `interface`, `function`, ...)."
931
+ },
932
+ line: {
933
+ type: "number",
934
+ description: "1-based declaration line, when known."
515
935
  },
516
936
  name: {
517
937
  type: "string",
518
- description: "The exported symbol's name."
938
+ description: "The symbol's qualified name when available."
519
939
  }
520
940
  },
521
941
  required: [
942
+ "id",
522
943
  "name",
523
944
  "kind",
524
945
  "file"
525
946
  ],
526
947
  additionalProperties: false
527
948
  },
528
- Recordstringnumber: {
529
- type: "object",
530
- properties: {},
531
- required: [],
532
- additionalProperties: {
533
- type: "number"
534
- }
535
- }
536
- }
537
- },
538
- parameters: {
539
- type: "object",
540
- properties: {
541
- aspect: {
542
- type: "string",
543
- "enum": [
544
- "all",
545
- "hotspots",
546
- "layers",
547
- "publicApi"
548
- ],
549
- 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."
550
- }
551
- },
552
- required: [],
553
- additionalProperties: false,
554
- $defs: {}
555
- },
556
- validate: (() => {
557
- const _io0 = input => undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect;
558
- const _vo0 = (input, _path, _exceptionable = true) => [undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect || _report(_exceptionable, {
559
- path: _path + ".aspect",
560
- expected: "(\"all\" | \"hotspots\" | \"layers\" | \"publicApi\" | undefined)",
561
- value: input.aspect
562
- })].every(flag => flag);
563
- const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
564
- let errors;
565
- let _report;
566
- return input => {
567
- if (false === __is(input)) {
568
- errors = [];
569
- _report = _b._validateReport(errors);
570
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
571
- path: _path + "",
572
- expected: "ITtscGraphOverview.IProps",
573
- value: input
574
- })) && _vo0(input, _path + "", true) || _report(true, {
575
- path: _path + "",
576
- expected: "ITtscGraphOverview.IProps",
577
- value: input
578
- }))(input, "$input", true);
579
- const success = 0 === errors.length;
580
- return success ? {
581
- success,
582
- data: input
583
- } : {
584
- success,
585
- errors,
586
- data: input
587
- };
588
- }
589
- return {
590
- success: true,
591
- data: input
592
- };
593
- };
594
- })()
595
- },
596
- {
597
- description: "The declared shape of the given symbols: each one's signature, and for a\nclass/interface/namespace its members. Handles may be ids or dotted symbol\nnames. Set `source: true` to also read a specific body, `neighbors: true`\nto list what it uses and what uses it.",
598
- name: "graph_expand",
599
- output: {
600
- type: "object",
601
- properties: {
602
- nodes: {
603
- type: "array",
604
- items: {
605
- $ref: "#/$defs/ITtscGraphExpand.INode"
606
- }
607
- },
608
- unknown: {
609
- type: "array",
610
- items: {
611
- type: "string"
612
- },
613
- description: "Handles that resolved to no node, or that were ambiguous."
614
- }
615
- },
616
- required: [
617
- "nodes",
618
- "unknown"
619
- ],
620
- additionalProperties: false,
621
- $defs: {
622
- "ITtscGraphExpand.IMember": {
949
+ ITtscGraphTrace: {
623
950
  type: "object",
624
951
  properties: {
625
- kind: {
626
- type: "string"
952
+ type: {
953
+ type: "string",
954
+ "enum": [
955
+ "trace"
956
+ ],
957
+ description: "Discriminator for dependency tracing."
627
958
  },
628
- line: {
629
- type: "number",
630
- description: "1-based declaration line, when known."
959
+ candidates: {
960
+ type: "array",
961
+ items: {
962
+ $ref: "#/$defs/ITtscGraphTrace.INode"
963
+ },
964
+ description: "When `from` was an ambiguous name, the matches to disambiguate with."
631
965
  },
632
- name: {
966
+ direction: {
633
967
  type: "string"
634
968
  },
635
- signature: {
636
- type: "string",
637
- description: "The member's declaration signature."
638
- }
639
- },
640
- required: [
641
- "name",
642
- "kind"
643
- ],
644
- additionalProperties: false
645
- },
646
- "ITtscGraphExpand.INode": {
647
- type: "object",
648
- properties: {
649
- dependedOnBy: {
969
+ hops: {
650
970
  type: "array",
651
971
  items: {
652
- $ref: "#/$defs/ITtscGraphExpand.IReference"
972
+ $ref: "#/$defs/ITtscGraphTrace.IHop"
653
973
  },
654
- description: "Symbols that use this node (incoming dependency edges)."
974
+ description: "Edges traversed, in breadth-first order."
655
975
  },
656
- dependsOn: {
976
+ next: {
977
+ $ref: "#/$defs/ITtscGraphTrace.INext",
978
+ description: "Follow-up handles for inspecting or continuing the trace."
979
+ },
980
+ path: {
657
981
  type: "array",
658
982
  items: {
659
- $ref: "#/$defs/ITtscGraphExpand.IReference"
983
+ $ref: "#/$defs/ITtscGraphTrace.INode"
660
984
  },
661
- description: "Symbols this node uses (outgoing dependency edges)."
662
- },
663
- file: {
664
- type: "string"
665
- },
666
- id: {
667
- type: "string"
668
- },
669
- kind: {
670
- type: "string"
671
- },
672
- line: {
673
- type: "number",
674
- description: "1-based declaration line, when known."
985
+ description: "When `to` was given: the ordered dependency path from `from` to `to`\n(`from` first, `to` last), or empty when `to` is not reachable from\n`from`."
675
986
  },
676
- members: {
987
+ reached: {
677
988
  type: "array",
678
989
  items: {
679
- $ref: "#/$defs/ITtscGraphExpand.IMember"
990
+ $ref: "#/$defs/ITtscGraphTrace.INode"
680
991
  },
681
- description: "For a class, interface, namespace, module, enum, or file: the symbols it\ncontains, each with its own signature \u2014 the member outline a consumer\nreaches for, without the bodies."
992
+ description: "Unique nodes reached (excluding the start), each with its depth and roles."
682
993
  },
683
- name: {
684
- type: "string"
994
+ start: {
995
+ $ref: "#/$defs/ITtscGraphTrace.INode",
996
+ description: "The resolved start node, or undefined when `from` matched nothing."
685
997
  },
686
- signature: {
687
- type: "string",
688
- description: "The declaration signature \u2014 its first line(s) up to the body."
998
+ steps: {
999
+ type: "array",
1000
+ items: {
1001
+ type: "string"
1002
+ },
1003
+ description: "Compact hop summaries preserving node names and edge evidence, capped."
689
1004
  },
690
- source: {
691
- type: "string",
692
- description: "The full declaration source \u2014 only when `source` was requested."
1005
+ target: {
1006
+ $ref: "#/$defs/ITtscGraphTrace.INode",
1007
+ description: "The resolved `to` target, when a path was requested."
693
1008
  },
694
1009
  truncated: {
695
1010
  type: "boolean",
696
- description: "True when `source` was cut at the line cap."
1011
+ description: "True when the trace hit maxNodes or maxDepth and more flow exists."
697
1012
  }
698
1013
  },
699
1014
  required: [
700
- "id",
701
- "name",
702
- "kind",
703
- "file"
1015
+ "type",
1016
+ "direction",
1017
+ "hops",
1018
+ "reached",
1019
+ "truncated"
704
1020
  ],
705
1021
  additionalProperties: false
706
1022
  },
707
- "ITtscGraphExpand.IReference": {
1023
+ "ITtscGraphTrace.IHop": {
708
1024
  type: "object",
709
1025
  properties: {
710
- id: {
1026
+ aliases: {
1027
+ type: "array",
1028
+ items: {
1029
+ type: "string"
1030
+ },
1031
+ description: "Stable access-path aliases derived from edge evidence. These preserve a\nresolved member's owner and the concrete property path used at the call\nsite."
1032
+ },
1033
+ depth: {
1034
+ type: "number",
1035
+ description: "Hops from the start (1 = direct)."
1036
+ },
1037
+ evidence: {
1038
+ $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."
1040
+ },
1041
+ from: {
711
1042
  type: "string"
712
1043
  },
713
1044
  kind: {
714
1045
  type: "string"
715
1046
  },
716
- name: {
1047
+ to: {
717
1048
  type: "string"
718
- },
719
- relation: {
720
- type: "string",
721
- description: "The edge kind connecting the two (`calls`, `type_ref`, \u2026)."
722
1049
  }
723
1050
  },
724
1051
  required: [
725
- "id",
726
- "name",
1052
+ "from",
1053
+ "to",
727
1054
  "kind",
728
- "relation"
1055
+ "depth"
729
1056
  ],
730
1057
  additionalProperties: false
731
- }
732
- }
733
- },
734
- parameters: {
735
- type: "object",
736
- properties: {
737
- handles: {
738
- type: "array",
739
- items: {
740
- type: "string"
741
- },
742
- description: "Node ids from another tool, or dotted symbol handles such as\n`OrderService.create`. Pass every handle you need in one call."
743
- },
744
- neighbors: {
745
- type: "boolean",
746
- description: "Also list each node's direct dependencies and dependents (the symbols it\nuses and the symbols that use it)."
747
1058
  },
748
- source: {
749
- type: "boolean",
750
- description: "Return the full declaration source body too. Off by default: expand\nreturns the declared shape \u2014 a symbol's signature, and a class/interface/\nnamespace's member outline \u2014 which is what you usually need and a\nfraction of the tokens. Turn this on only for the few leaf functions or\nmethods whose actual control-flow logic you must read."
751
- }
752
- },
753
- required: [
754
- "handles"
755
- ],
756
- additionalProperties: false,
757
- $defs: {}
758
- },
759
- validate: (() => {
760
- const _io0 = input => Array.isArray(input.handles) && input.handles.every(elem => "string" === typeof elem) && (undefined === input.neighbors || "boolean" === typeof input.neighbors) && (undefined === input.source || "boolean" === typeof input.source);
761
- const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.handles) || _report(_exceptionable, {
762
- path: _path + ".handles",
763
- expected: "Array<string>",
764
- value: input.handles
765
- })) && input.handles.map((elem, _index2) => "string" === typeof elem || _report(_exceptionable, {
766
- path: _path + ".handles[" + _index2 + "]",
767
- expected: "string",
768
- value: elem
769
- })).every(flag => flag) || _report(_exceptionable, {
770
- path: _path + ".handles",
771
- expected: "Array<string>",
772
- value: input.handles
773
- }), undefined === input.neighbors || "boolean" === typeof input.neighbors || _report(_exceptionable, {
774
- path: _path + ".neighbors",
775
- expected: "(boolean | undefined)",
776
- value: input.neighbors
777
- }), undefined === input.source || "boolean" === typeof input.source || _report(_exceptionable, {
778
- path: _path + ".source",
779
- expected: "(boolean | undefined)",
780
- value: input.source
781
- })].every(flag => flag);
782
- const __is = input => "object" === typeof input && null !== input && _io0(input);
783
- let errors;
784
- let _report;
785
- return input => {
786
- if (false === __is(input)) {
787
- errors = [];
788
- _report = _b._validateReport(errors);
789
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
790
- path: _path + "",
791
- expected: "ITtscGraphExpand.IProps",
792
- value: input
793
- })) && _vo0(input, _path + "", true) || _report(true, {
794
- path: _path + "",
795
- expected: "ITtscGraphExpand.IProps",
796
- value: input
797
- }))(input, "$input", true);
798
- const success = 0 === errors.length;
799
- return success ? {
800
- success,
801
- data: input
802
- } : {
803
- success,
804
- errors,
805
- data: input
806
- };
807
- }
808
- return {
809
- success: true,
810
- data: input
811
- };
812
- };
813
- })()
814
- },
815
- {
816
- description: "Find any symbol \u2014 class, function, method, or field \u2014 by name or\ndescription. Each hit comes with its signature, so the query alone often\nanswers the question, and `next.expand` gives handles for source\nfollow-up.",
817
- name: "graph_query",
818
- output: {
819
- type: "object",
820
- properties: {
821
- hits: {
822
- type: "array",
823
- items: {
824
- $ref: "#/$defs/ITtscGraphQuery.IHit"
825
- }
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
826
1082
  },
827
- next: {
828
- $ref: "#/$defs/ITtscGraphQuery.INext",
829
- description: "Follow-up handles for source or member details."
830
- }
831
- },
832
- required: [
833
- "hits",
834
- "next"
835
- ],
836
- additionalProperties: false,
837
- $defs: {
838
- "ITtscGraphQuery.IHit": {
1083
+ "ITtscGraphTrace.INode": {
839
1084
  type: "object",
840
1085
  properties: {
1086
+ depth: {
1087
+ type: "number",
1088
+ description: "Hops from the start, on a reached node."
1089
+ },
841
1090
  file: {
842
1091
  type: "string"
843
1092
  },
@@ -847,273 +1096,488 @@ function createServer(graph, version) {
847
1096
  kind: {
848
1097
  type: "string"
849
1098
  },
850
- line: {
851
- type: "number",
852
- description: "1-based declaration line, when known."
853
- },
854
1099
  name: {
855
1100
  type: "string"
856
1101
  },
857
- score: {
858
- type: "number",
859
- description: "Relative relevance; higher is a better match."
1102
+ roles: {
1103
+ type: "array",
1104
+ items: {
1105
+ type: "string"
1106
+ },
1107
+ description: "Why this node matters to an impact trace: `exported`, `test`."
860
1108
  },
861
1109
  signature: {
862
1110
  type: "string",
863
- description: "The hit's declaration signature, so you can often answer without\nexpanding."
1111
+ description: "The node's signature, carried on path nodes so the path explains itself."
864
1112
  }
865
1113
  },
866
1114
  required: [
867
1115
  "id",
868
1116
  "name",
869
1117
  "kind",
870
- "file",
871
- "score"
1118
+ "file"
872
1119
  ],
873
1120
  additionalProperties: false
874
1121
  },
875
- "ITtscGraphQuery.INext": {
1122
+ PickITtscGraphEvidenceendLinefilestartLine: {
876
1123
  type: "object",
877
1124
  properties: {
878
- expand: {
879
- type: "array",
880
- items: {
881
- type: "string"
882
- },
883
- description: "Pass these ids to `graph_expand`, with `source: true` only when needed."
1125
+ endLine: {
1126
+ type: "number",
1127
+ description: "1-based line where the span ends, when it differs from `startLine`."
1128
+ },
1129
+ file: {
1130
+ type: "string",
1131
+ description: "Project-relative path of the file the span lives in."
1132
+ },
1133
+ startLine: {
1134
+ type: "number",
1135
+ description: "1-based line where the span starts."
884
1136
  }
885
1137
  },
886
1138
  required: [
887
- "expand"
1139
+ "file",
1140
+ "startLine"
888
1141
  ],
889
1142
  additionalProperties: false
1143
+ },
1144
+ Recordstringnumber: {
1145
+ type: "object",
1146
+ properties: {},
1147
+ required: [],
1148
+ additionalProperties: {
1149
+ type: "number"
1150
+ }
890
1151
  }
891
1152
  }
892
1153
  },
893
1154
  parameters: {
894
1155
  type: "object",
895
1156
  properties: {
896
- limit: {
897
- type: "number",
898
- description: "Maximum hits to return."
1157
+ 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`."
899
1160
  },
900
- query: {
1161
+ graphNeed: {
901
1162
  type: "string",
902
- description: "What to find, in natural language and code vocabulary mixed freely \u2014 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."
903
- }
904
- },
905
- required: [
906
- "query"
907
- ],
908
- additionalProperties: false,
909
- $defs: {}
910
- },
911
- validate: (() => {
912
- const _io0 = input => "string" === typeof input.query && (undefined === input.limit || "number" === typeof input.limit);
913
- const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.query || _report(_exceptionable, {
914
- path: _path + ".query",
915
- expected: "string",
916
- value: input.query
917
- }), undefined === input.limit || "number" === typeof input.limit || _report(_exceptionable, {
918
- path: _path + ".limit",
919
- expected: "(number | undefined)",
920
- value: input.limit
921
- })].every(flag => flag);
922
- const __is = input => "object" === typeof input && null !== input && _io0(input);
923
- let errors;
924
- let _report;
925
- return input => {
926
- if (false === __is(input)) {
927
- errors = [];
928
- _report = _b._validateReport(errors);
929
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
930
- path: _path + "",
931
- expected: "ITtscGraphQuery.IProps",
932
- value: input
933
- })) && _vo0(input, _path + "", true) || _report(true, {
934
- path: _path + "",
935
- expected: "ITtscGraphQuery.IProps",
936
- value: input
937
- }))(input, "$input", true);
938
- const success = 0 === errors.length;
939
- return success ? {
940
- success,
941
- data: input
942
- } : {
943
- success,
944
- errors,
945
- data: input
946
- };
947
- }
948
- return {
949
- success: true,
950
- data: input
951
- };
952
- };
953
- })()
954
- },
955
- {
956
- description: "Follow dependency flow from a symbol: `forward` to what it uses, `reverse`\nto what uses it, or `impact` to the public API and tests a change reaches.\nGive `from`/`to` as ids or dotted names to get the path between two symbols\nin one call \u2014 how A reaches B.",
957
- name: "graph_trace",
958
- output: {
959
- type: "object",
960
- properties: {
961
- candidates: {
962
- type: "array",
963
- items: {
964
- $ref: "#/$defs/ITtscGraphTrace.INode"
965
- },
966
- description: "When `from` was an ambiguous name, the matches to disambiguate with."
967
- },
968
- direction: {
969
- type: "string"
970
- },
971
- hops: {
972
- type: "array",
973
- items: {
974
- $ref: "#/$defs/ITtscGraphTrace.IHop"
975
- },
976
- description: "Edges traversed, in breadth-first order."
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`."
977
1164
  },
978
- path: {
979
- type: "array",
980
- items: {
981
- $ref: "#/$defs/ITtscGraphTrace.INode"
982
- },
983
- description: "When `to` was given: the ordered dependency path from `from` to `to`\n(`from` first, `to` last), or empty when `to` is not reachable from\n`from`."
984
- },
985
- reached: {
986
- type: "array",
987
- items: {
988
- $ref: "#/$defs/ITtscGraphTrace.INode"
989
- },
990
- description: "Unique nodes reached (excluding the start), each with its depth and roles."
991
- },
992
- start: {
993
- $ref: "#/$defs/ITtscGraphTrace.INode",
994
- description: "The resolved start node, or undefined when `from` matched nothing."
1165
+ question: {
1166
+ 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."
995
1168
  },
996
- target: {
997
- $ref: "#/$defs/ITtscGraphTrace.INode",
998
- description: "The resolved `to` target, when a path was requested."
1169
+ request: {
1170
+ anyOf: [
1171
+ {
1172
+ $ref: "#/$defs/ITtscGraphDetails.IRequest"
1173
+ },
1174
+ {
1175
+ $ref: "#/$defs/ITtscGraphEntrypoints.IRequest"
1176
+ },
1177
+ {
1178
+ $ref: "#/$defs/ITtscGraphLookup.IRequest"
1179
+ },
1180
+ {
1181
+ $ref: "#/$defs/ITtscGraphOverview.IRequest"
1182
+ },
1183
+ {
1184
+ $ref: "#/$defs/ITtscGraphTrace.IRequest"
1185
+ },
1186
+ {
1187
+ $ref: "#/$defs/ITtscGraphEscape.IRequest"
1188
+ }
1189
+ ],
1190
+ description: "The graph operation chosen from the reasoning above, or a no-op escape.",
1191
+ "x-discriminator": {
1192
+ mapping: {
1193
+ details: "#/$defs/ITtscGraphDetails.IRequest",
1194
+ entrypoints: "#/$defs/ITtscGraphEntrypoints.IRequest",
1195
+ escape: "#/$defs/ITtscGraphEscape.IRequest",
1196
+ lookup: "#/$defs/ITtscGraphLookup.IRequest",
1197
+ overview: "#/$defs/ITtscGraphOverview.IRequest",
1198
+ trace: "#/$defs/ITtscGraphTrace.IRequest"
1199
+ },
1200
+ propertyName: "type"
1201
+ }
999
1202
  },
1000
- truncated: {
1001
- type: "boolean",
1002
- description: "True when the trace hit maxNodes or maxDepth and more flow exists."
1203
+ review: {
1204
+ 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`."
1003
1206
  }
1004
1207
  },
1005
1208
  required: [
1006
- "direction",
1007
- "hops",
1008
- "reached",
1009
- "truncated"
1209
+ "question",
1210
+ "graphNeed",
1211
+ "draft",
1212
+ "review",
1213
+ "request"
1010
1214
  ],
1011
1215
  additionalProperties: false,
1012
1216
  $defs: {
1013
- "ITtscGraphTrace.IHop": {
1217
+ "ITtscGraphApplication.IRequestDraft": {
1014
1218
  type: "object",
1015
1219
  properties: {
1016
- depth: {
1220
+ type: {
1221
+ type: "string",
1222
+ "enum": [
1223
+ "details",
1224
+ "entrypoints",
1225
+ "escape",
1226
+ "lookup",
1227
+ "overview",
1228
+ "trace"
1229
+ ],
1230
+ description: "Draft discriminator for the intended graph operation."
1231
+ },
1232
+ reason: {
1233
+ type: "string",
1234
+ description: "Why this operation type is the smallest useful next step."
1235
+ }
1236
+ },
1237
+ required: [
1238
+ "reason",
1239
+ "type"
1240
+ ],
1241
+ additionalProperties: false
1242
+ },
1243
+ "ITtscGraphDetails.IRequest": {
1244
+ type: "object",
1245
+ properties: {
1246
+ type: {
1247
+ type: "string",
1248
+ "enum": [
1249
+ "details"
1250
+ ],
1251
+ description: "Discriminator for selected symbol inspection."
1252
+ },
1253
+ dependencyLimit: {
1017
1254
  type: "number",
1018
- description: "Hops from the start (1 = direct)."
1255
+ description: "Maximum direct execution and type references to return per group. Raise\nonly when the first dependency slice is not enough."
1019
1256
  },
1020
- from: {
1021
- type: "string"
1257
+ handles: {
1258
+ type: "array",
1259
+ items: {
1260
+ type: "string"
1261
+ },
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."
1022
1263
  },
1023
- kind: {
1024
- type: "string"
1264
+ memberLimit: {
1265
+ type: "number",
1266
+ description: "Maximum owned members to return for a container or object literal. Raise\nonly when the first outline is truncated."
1025
1267
  },
1026
- to: {
1027
- type: "string"
1268
+ neighborLimit: {
1269
+ type: "number",
1270
+ description: "Maximum dependencies and dependents to return per side when\n`neighbors:true`."
1271
+ },
1272
+ neighbors: {
1273
+ 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."
1028
1275
  }
1029
1276
  },
1030
1277
  required: [
1031
- "from",
1032
- "to",
1033
- "kind",
1034
- "depth"
1278
+ "type",
1279
+ "handles"
1035
1280
  ],
1036
1281
  additionalProperties: false
1037
1282
  },
1038
- "ITtscGraphTrace.INode": {
1283
+ "ITtscGraphEntrypoints.IRequest": {
1039
1284
  type: "object",
1040
1285
  properties: {
1041
- depth: {
1286
+ type: {
1287
+ type: "string",
1288
+ "enum": [
1289
+ "entrypoints"
1290
+ ],
1291
+ description: "Discriminator for first-pass question indexing."
1292
+ },
1293
+ limit: {
1042
1294
  type: "number",
1043
- description: "Hops from the start, on a reached node."
1295
+ description: "Maximum ranked hits to return."
1044
1296
  },
1045
- file: {
1046
- type: "string"
1297
+ neighbors: {
1298
+ 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."
1047
1300
  },
1048
- id: {
1049
- type: "string"
1301
+ query: {
1302
+ 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`."
1304
+ }
1305
+ },
1306
+ required: [
1307
+ "type",
1308
+ "query"
1309
+ ],
1310
+ additionalProperties: false
1311
+ },
1312
+ "ITtscGraphEscape.IRequest": {
1313
+ type: "object",
1314
+ properties: {
1315
+ type: {
1316
+ type: "string",
1317
+ "enum": [
1318
+ "escape"
1319
+ ],
1320
+ description: "Discriminator for the no-op escape route."
1050
1321
  },
1051
- kind: {
1052
- type: "string"
1322
+ nextStep: {
1323
+ 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`."
1053
1325
  },
1054
- name: {
1055
- type: "string"
1326
+ reason: {
1327
+ 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."
1329
+ }
1330
+ },
1331
+ required: [
1332
+ "type",
1333
+ "reason"
1334
+ ],
1335
+ additionalProperties: false
1336
+ },
1337
+ "ITtscGraphLookup.IRequest": {
1338
+ type: "object",
1339
+ properties: {
1340
+ type: {
1341
+ type: "string",
1342
+ "enum": [
1343
+ "lookup"
1344
+ ],
1345
+ description: "Discriminator for targeted symbol lookup."
1056
1346
  },
1057
- roles: {
1058
- type: "array",
1059
- items: {
1060
- type: "string"
1061
- },
1062
- description: "Why this node matters to an impact trace: `exported`, `test`."
1347
+ limit: {
1348
+ type: "number",
1349
+ description: "Maximum hits to return."
1063
1350
  },
1064
- signature: {
1351
+ query: {
1065
1352
  type: "string",
1066
- description: "The node's signature \u2014 carried on path nodes so the path explains itself."
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."
1067
1354
  }
1068
1355
  },
1069
1356
  required: [
1070
- "id",
1071
- "name",
1072
- "kind",
1073
- "file"
1357
+ "type",
1358
+ "query"
1074
1359
  ],
1075
1360
  additionalProperties: false
1076
- }
1077
- }
1078
- },
1079
- parameters: {
1080
- type: "object",
1081
- properties: {
1082
- direction: {
1083
- type: "string",
1084
- "enum": [
1085
- "forward",
1086
- "impact",
1087
- "reverse"
1088
- ],
1089
- 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."
1090
- },
1091
- from: {
1092
- type: "string",
1093
- 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."
1094
- },
1095
- maxDepth: {
1096
- type: "number",
1097
- description: "How many hops deep to follow."
1098
1361
  },
1099
- maxNodes: {
1100
- type: "number",
1101
- description: "Cap on reached nodes; the trace stops and marks itself truncated past it."
1362
+ "ITtscGraphOverview.IRequest": {
1363
+ type: "object",
1364
+ properties: {
1365
+ type: {
1366
+ type: "string",
1367
+ "enum": [
1368
+ "overview"
1369
+ ],
1370
+ description: "Discriminator for source-free project overview."
1371
+ },
1372
+ aspect: {
1373
+ type: "string",
1374
+ "enum": [
1375
+ "all",
1376
+ "hotspots",
1377
+ "layers",
1378
+ "publicApi"
1379
+ ],
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."
1381
+ }
1382
+ },
1383
+ required: [
1384
+ "type"
1385
+ ],
1386
+ additionalProperties: false
1102
1387
  },
1103
- to: {
1104
- type: "string",
1105
- 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 \u2014\nthe one-call answer for \"how does A reach B\" \u2014 instead of an open-ended\ntrace."
1388
+ "ITtscGraphTrace.IRequest": {
1389
+ type: "object",
1390
+ properties: {
1391
+ type: {
1392
+ type: "string",
1393
+ "enum": [
1394
+ "trace"
1395
+ ],
1396
+ description: "Discriminator for dependency tracing."
1397
+ },
1398
+ direction: {
1399
+ type: "string",
1400
+ "enum": [
1401
+ "forward",
1402
+ "impact",
1403
+ "reverse"
1404
+ ],
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."
1406
+ },
1407
+ focus: {
1408
+ type: "string",
1409
+ "enum": [
1410
+ "all",
1411
+ "execution",
1412
+ "types"
1413
+ ],
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."
1415
+ },
1416
+ from: {
1417
+ type: "string",
1418
+ 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
+ },
1420
+ maxDepth: {
1421
+ type: "number",
1422
+ description: "How many hops deep to follow. Open traces are capped at 2; path mode is\ncapped at 12."
1423
+ },
1424
+ maxNodes: {
1425
+ 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."
1427
+ },
1428
+ to: {
1429
+ 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."
1431
+ }
1432
+ },
1433
+ required: [
1434
+ "type",
1435
+ "from"
1436
+ ],
1437
+ additionalProperties: false
1106
1438
  }
1107
- },
1108
- required: [
1109
- "from"
1110
- ],
1111
- additionalProperties: false,
1112
- $defs: {}
1439
+ }
1113
1440
  },
1114
1441
  validate: (() => {
1115
- const _io0 = input => "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.maxDepth || "number" === typeof input.maxDepth) && (undefined === input.maxNodes || "number" === typeof input.maxNodes);
1116
- const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.from || _report(_exceptionable, {
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);
1447
+ 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);
1450
+ const _iu0 = input => (() => {
1451
+ if ("details" === input.type)
1452
+ return _io2(input);
1453
+ else if ("entrypoints" === input.type)
1454
+ return _io3(input);
1455
+ else if ("lookup" === input.type)
1456
+ return _io4(input);
1457
+ else if ("overview" === input.type)
1458
+ return _io5(input);
1459
+ else if ("trace" === input.type)
1460
+ return _io6(input);
1461
+ else if ("escape" === input.type)
1462
+ return _io7(input);
1463
+ else
1464
+ return false;
1465
+ })();
1466
+ const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.question || _report(_exceptionable, {
1467
+ path: _path + ".question",
1468
+ expected: "string",
1469
+ value: input.question
1470
+ }), "string" === typeof input.graphNeed || _report(_exceptionable, {
1471
+ path: _path + ".graphNeed",
1472
+ expected: "string",
1473
+ value: input.graphNeed
1474
+ }), ("object" === typeof input.draft && null !== input.draft || _report(_exceptionable, {
1475
+ path: _path + ".draft",
1476
+ expected: "ITtscGraphApplication.IRequestDraft",
1477
+ value: input.draft
1478
+ })) && _vo1(input.draft, _path + ".draft", true && _exceptionable) || _report(_exceptionable, {
1479
+ path: _path + ".draft",
1480
+ expected: "ITtscGraphApplication.IRequestDraft",
1481
+ value: input.draft
1482
+ }), "string" === typeof input.review || _report(_exceptionable, {
1483
+ path: _path + ".review",
1484
+ expected: "string",
1485
+ value: input.review
1486
+ }), ("object" === typeof input.request && null !== input.request || _report(_exceptionable, {
1487
+ path: _path + ".request",
1488
+ expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphEscape.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTrace.IRequest)",
1489
+ value: input.request
1490
+ })) && _vu0(input.request, _path + ".request", true && _exceptionable) || _report(_exceptionable, {
1491
+ path: _path + ".request",
1492
+ expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphEscape.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTrace.IRequest)",
1493
+ value: input.request
1494
+ })].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, {
1500
+ path: _path + ".type",
1501
+ expected: "(\"details\" | \"entrypoints\" | \"escape\" | \"lookup\" | \"overview\" | \"trace\")",
1502
+ value: input.type
1503
+ })].every(flag => flag);
1504
+ const _vo2 = (input, _path, _exceptionable = true) => ["details" === input.type || _report(_exceptionable, {
1505
+ path: _path + ".type",
1506
+ expected: "\"details\"",
1507
+ value: input.type
1508
+ }), (Array.isArray(input.handles) || _report(_exceptionable, {
1509
+ path: _path + ".handles",
1510
+ expected: "Array<string>",
1511
+ value: input.handles
1512
+ })) && input.handles.map((elem, _index2) => "string" === typeof elem || _report(_exceptionable, {
1513
+ path: _path + ".handles[" + _index2 + "]",
1514
+ expected: "string",
1515
+ value: elem
1516
+ })).every(flag => flag) || _report(_exceptionable, {
1517
+ path: _path + ".handles",
1518
+ expected: "Array<string>",
1519
+ value: input.handles
1520
+ }), undefined === input.neighbors || "boolean" === typeof input.neighbors || _report(_exceptionable, {
1521
+ path: _path + ".neighbors",
1522
+ expected: "(boolean | undefined)",
1523
+ value: input.neighbors
1524
+ }), undefined === input.neighborLimit || "number" === typeof input.neighborLimit || _report(_exceptionable, {
1525
+ path: _path + ".neighborLimit",
1526
+ expected: "(number | undefined)",
1527
+ value: input.neighborLimit
1528
+ }), undefined === input.memberLimit || "number" === typeof input.memberLimit || _report(_exceptionable, {
1529
+ path: _path + ".memberLimit",
1530
+ expected: "(number | undefined)",
1531
+ value: input.memberLimit
1532
+ }), undefined === input.dependencyLimit || "number" === typeof input.dependencyLimit || _report(_exceptionable, {
1533
+ path: _path + ".dependencyLimit",
1534
+ expected: "(number | undefined)",
1535
+ value: input.dependencyLimit
1536
+ })].every(flag => flag);
1537
+ const _vo3 = (input, _path, _exceptionable = true) => ["entrypoints" === input.type || _report(_exceptionable, {
1538
+ path: _path + ".type",
1539
+ expected: "\"entrypoints\"",
1540
+ 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, {
1550
+ path: _path + ".neighbors",
1551
+ expected: "(number | undefined)",
1552
+ value: input.neighbors
1553
+ })].every(flag => flag);
1554
+ const _vo4 = (input, _path, _exceptionable = true) => ["lookup" === input.type || _report(_exceptionable, {
1555
+ path: _path + ".type",
1556
+ expected: "\"lookup\"",
1557
+ 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);
1567
+ const _vo5 = (input, _path, _exceptionable = true) => ["overview" === input.type || _report(_exceptionable, {
1568
+ path: _path + ".type",
1569
+ expected: "\"overview\"",
1570
+ value: input.type
1571
+ }), undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect || _report(_exceptionable, {
1572
+ path: _path + ".aspect",
1573
+ expected: "(\"all\" | \"hotspots\" | \"layers\" | \"publicApi\" | undefined)",
1574
+ value: input.aspect
1575
+ })].every(flag => flag);
1576
+ const _vo6 = (input, _path, _exceptionable = true) => ["trace" === input.type || _report(_exceptionable, {
1577
+ path: _path + ".type",
1578
+ expected: "\"trace\"",
1579
+ value: input.type
1580
+ }), "string" === typeof input.from || _report(_exceptionable, {
1117
1581
  path: _path + ".from",
1118
1582
  expected: "string",
1119
1583
  value: input.from
@@ -1125,6 +1589,10 @@ function createServer(graph, version) {
1125
1589
  path: _path + ".direction",
1126
1590
  expected: "(\"forward\" | \"impact\" | \"reverse\" | undefined)",
1127
1591
  value: input.direction
1592
+ }), undefined === input.focus || "all" === input.focus || "execution" === input.focus || "types" === input.focus || _report(_exceptionable, {
1593
+ path: _path + ".focus",
1594
+ expected: "(\"all\" | \"execution\" | \"types\" | undefined)",
1595
+ value: input.focus
1128
1596
  }), undefined === input.maxDepth || "number" === typeof input.maxDepth || _report(_exceptionable, {
1129
1597
  path: _path + ".maxDepth",
1130
1598
  expected: "(number | undefined)",
@@ -1134,6 +1602,39 @@ function createServer(graph, version) {
1134
1602
  expected: "(number | undefined)",
1135
1603
  value: input.maxNodes
1136
1604
  })].every(flag => flag);
1605
+ const _vo7 = (input, _path, _exceptionable = true) => ["escape" === input.type || _report(_exceptionable, {
1606
+ path: _path + ".type",
1607
+ expected: "\"escape\"",
1608
+ 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, {
1614
+ path: _path + ".nextStep",
1615
+ expected: "(string | undefined)",
1616
+ value: input.nextStep
1617
+ })].every(flag => flag);
1618
+ const _vu0 = (input, _path, _exceptionable = true) => (() => {
1619
+ if ("details" === input.type)
1620
+ return _vo2(input, _path, true && _exceptionable);
1621
+ else if ("entrypoints" === input.type)
1622
+ return _vo3(input, _path, true && _exceptionable);
1623
+ else if ("lookup" === input.type)
1624
+ return _vo4(input, _path, true && _exceptionable);
1625
+ else if ("overview" === input.type)
1626
+ return _vo5(input, _path, true && _exceptionable);
1627
+ else if ("trace" === input.type)
1628
+ return _vo6(input, _path, true && _exceptionable);
1629
+ else if ("escape" === input.type)
1630
+ return _vo7(input, _path, true && _exceptionable);
1631
+ else
1632
+ return _report(_exceptionable, {
1633
+ path: _path,
1634
+ expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTrace.IRequest | ITtscGraphEscape.IRequest)",
1635
+ value: input
1636
+ });
1637
+ })();
1137
1638
  const __is = input => "object" === typeof input && null !== input && _io0(input);
1138
1639
  let errors;
1139
1640
  let _report;
@@ -1143,11 +1644,11 @@ function createServer(graph, version) {
1143
1644
  _report = _b._validateReport(errors);
1144
1645
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1145
1646
  path: _path + "",
1146
- expected: "ITtscGraphTrace.IProps",
1647
+ expected: "ITtscGraphApplication.IProps",
1147
1648
  value: input
1148
1649
  })) && _vo0(input, _path + "", true) || _report(true, {
1149
1650
  path: _path + "",
1150
- expected: "ITtscGraphTrace.IProps",
1651
+ expected: "ITtscGraphApplication.IProps",
1151
1652
  value: input
1152
1653
  }))(input, "$input", true);
1153
1654
  const success = 0 === errors.length;
@@ -1193,8 +1694,8 @@ function createServer(graph, version) {
1193
1694
  if (func === undefined || method === undefined) {
1194
1695
  return error(`Unknown tool: ${request.params.name}`);
1195
1696
  }
1196
- // A client may omit `arguments` for an all-optional tool (e.g. graph_overview);
1197
- // validate an empty object so that call succeeds instead of failing on "expected object".
1697
+ // Validate an empty object when a client omits `arguments`, so typia can
1698
+ // return field-level errors instead of a generic "expected object".
1198
1699
  const validation = func.validate(request.params.arguments ?? {});
1199
1700
  if (!validation.success) {
1200
1701
  // Hand typia's validation errors back so the model can correct its call.
@@ -1206,9 +1707,7 @@ function createServer(graph, version) {
1206
1707
  content: [
1207
1708
  {
1208
1709
  type: "text",
1209
- text: result === undefined
1210
- ? "Success"
1211
- : JSON.stringify(result, null, 2),
1710
+ text: result === undefined ? "Success" : JSON.stringify(result),
1212
1711
  },
1213
1712
  ],
1214
1713
  };