@ttsc/graph 0.16.5 → 0.16.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +22 -0
  2. package/lib/TtscGraphApplication.js +58 -22
  3. package/lib/TtscGraphApplication.js.map +1 -1
  4. package/lib/model/TtscGraphMemory.js +43 -4
  5. package/lib/model/TtscGraphMemory.js.map +1 -1
  6. package/lib/model/loadGraph.js +17 -17
  7. package/lib/server/accessAliases.js +53 -0
  8. package/lib/server/accessAliases.js.map +1 -0
  9. package/lib/server/createServer.js +1490 -657
  10. package/lib/server/createServer.js.map +1 -1
  11. package/lib/server/instructions.js +81 -21
  12. package/lib/server/instructions.js.map +1 -1
  13. package/lib/server/pathPolicy.js +35 -0
  14. package/lib/server/pathPolicy.js.map +1 -0
  15. package/lib/server/resultGuide.js +16 -0
  16. package/lib/server/resultGuide.js.map +1 -0
  17. package/lib/server/runDetails.js +474 -0
  18. package/lib/server/runDetails.js.map +1 -0
  19. package/lib/server/{runIndex.js → runEntrypoints.js} +92 -28
  20. package/lib/server/runEntrypoints.js.map +1 -0
  21. package/lib/server/runLookup.js +246 -0
  22. package/lib/server/runLookup.js.map +1 -0
  23. package/lib/server/runOverview.js +44 -27
  24. package/lib/server/runOverview.js.map +1 -1
  25. package/lib/server/runTour.js +737 -0
  26. package/lib/server/runTour.js.map +1 -0
  27. package/lib/server/runTrace.js +224 -43
  28. package/lib/server/runTrace.js.map +1 -1
  29. package/lib/structures/ITtscGraphDetails.js +3 -0
  30. package/lib/structures/ITtscGraphDetails.js.map +1 -0
  31. package/lib/structures/ITtscGraphEntrypoints.js +3 -0
  32. package/lib/structures/ITtscGraphEntrypoints.js.map +1 -0
  33. package/lib/structures/{ITtscGraphExpand.js → ITtscGraphEscape.js} +1 -1
  34. package/lib/structures/ITtscGraphEscape.js.map +1 -0
  35. package/lib/structures/ITtscGraphLookup.js +3 -0
  36. package/lib/structures/ITtscGraphLookup.js.map +1 -0
  37. package/lib/structures/{ITtscGraphIndex.js → ITtscGraphNext.js} +1 -1
  38. package/lib/structures/ITtscGraphNext.js.map +1 -0
  39. package/lib/structures/{ITtscGraphQuery.js → ITtscGraphTour.js} +1 -1
  40. package/lib/structures/ITtscGraphTour.js.map +1 -0
  41. package/lib/structures/index.js +6 -3
  42. package/lib/structures/index.js.map +1 -1
  43. package/package.json +2 -2
  44. package/src/TtscGraphApplication.ts +70 -30
  45. package/src/model/TtscGraphMemory.ts +46 -4
  46. package/src/server/accessAliases.ts +55 -0
  47. package/src/server/createServer.ts +4 -7
  48. package/src/server/instructions.ts +81 -21
  49. package/src/server/pathPolicy.ts +43 -0
  50. package/src/server/resultGuide.ts +20 -0
  51. package/src/server/runDetails.ts +553 -0
  52. package/src/server/{runIndex.ts → runEntrypoints.ts} +116 -36
  53. package/src/server/runLookup.ts +284 -0
  54. package/src/server/runOverview.ts +59 -31
  55. package/src/server/runTour.ts +881 -0
  56. package/src/server/runTrace.ts +299 -45
  57. package/src/structures/ITtscGraphApplication.ts +75 -56
  58. package/src/structures/ITtscGraphDecorator.ts +12 -14
  59. package/src/structures/ITtscGraphDetails.ts +197 -0
  60. package/src/structures/ITtscGraphEntrypoints.ts +149 -0
  61. package/src/structures/ITtscGraphEscape.ts +49 -0
  62. package/src/structures/ITtscGraphEvidence.ts +5 -8
  63. package/src/structures/ITtscGraphLookup.ts +82 -0
  64. package/src/structures/ITtscGraphNext.ts +23 -0
  65. package/src/structures/ITtscGraphNode.ts +10 -4
  66. package/src/structures/ITtscGraphOverview.ts +41 -18
  67. package/src/structures/ITtscGraphTour.ts +150 -0
  68. package/src/structures/ITtscGraphTrace.ts +93 -13
  69. package/src/structures/TtscGraphNodeKind.ts +2 -2
  70. package/src/structures/index.ts +6 -3
  71. package/lib/server/runExpand.js +0 -177
  72. package/lib/server/runExpand.js.map +0 -1
  73. package/lib/server/runIndex.js.map +0 -1
  74. package/lib/server/runQuery.js +0 -147
  75. package/lib/server/runQuery.js.map +0 -1
  76. package/lib/structures/ITtscGraphExpand.js.map +0 -1
  77. package/lib/structures/ITtscGraphIndex.js.map +0 -1
  78. package/lib/structures/ITtscGraphQuery.js.map +0 -1
  79. package/src/server/runExpand.ts +0 -186
  80. package/src/server/runQuery.ts +0 -150
  81. package/src/structures/ITtscGraphExpand.ts +0 -85
  82. package/src/structures/ITtscGraphIndex.ts +0 -100
  83. package/src/structures/ITtscGraphQuery.ts +0 -49
@@ -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,142 +66,412 @@ 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: "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: {
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/ITtscGraphTour"
93
+ },
94
+ {
95
+ $ref: "#/$defs/ITtscGraphTrace"
96
+ }
97
+ ],
98
+ description: "Result branch matching the submitted `request.type`.",
99
+ "x-discriminator": {
100
+ mapping: {
101
+ details: "#/$defs/ITtscGraphDetails",
102
+ entrypoints: "#/$defs/ITtscGraphEntrypoints",
103
+ escape: "#/$defs/ITtscGraphEscape",
104
+ lookup: "#/$defs/ITtscGraphLookup",
105
+ overview: "#/$defs/ITtscGraphOverview",
106
+ tour: "#/$defs/ITtscGraphTour",
107
+ trace: "#/$defs/ITtscGraphTrace"
108
+ },
109
+ propertyName: "type"
110
+ }
111
+ }
112
+ },
113
+ required: [
114
+ "result"
115
+ ],
116
+ additionalProperties: false,
117
+ $defs: {
118
+ ITtscGraphDecorator: {
119
+ type: "object",
120
+ properties: {
121
+ arguments: {
122
+ type: "array",
123
+ items: {
124
+ $ref: "#/$defs/ITtscGraphDecorator.IArgument"
125
+ },
126
+ description: "The literal call arguments, in source order. Empty for a bare decorator."
127
+ },
128
+ name: {
129
+ type: "string",
130
+ description: "The decorator name as written, qualified through its access path:\n`Controller`, `Get`, `TypedRoute.Get`, `MessagePattern`."
131
+ }
78
132
  },
79
- description: "Ranked symbols relevant to the query."
133
+ required: [
134
+ "name",
135
+ "arguments"
136
+ ],
137
+ additionalProperties: false
80
138
  },
81
- mentions: {
82
- type: "array",
83
- items: {
84
- $ref: "#/$defs/ITtscGraphIndex.IMention"
139
+ "ITtscGraphDecorator.IArgument": {
140
+ type: "object",
141
+ properties: {
142
+ literal: {
143
+ anyOf: [
144
+ {
145
+ type: "string"
146
+ },
147
+ {
148
+ type: "number"
149
+ },
150
+ {
151
+ type: "boolean"
152
+ }
153
+ ],
154
+ description: "The statically-resolved literal value, when the argument is a literal."
155
+ }
85
156
  },
86
- description: "Code handles written directly in the query, resolved when possible."
157
+ required: [],
158
+ additionalProperties: false
87
159
  },
88
- neighborhood: {
89
- type: "array",
90
- items: {
91
- $ref: "#/$defs/ITtscGraphIndex.INeighborhood"
160
+ ITtscGraphDetails: {
161
+ type: "object",
162
+ properties: {
163
+ type: {
164
+ type: "string",
165
+ "enum": [
166
+ "details"
167
+ ],
168
+ description: "Discriminator for selected symbol inspection."
169
+ },
170
+ guide: {
171
+ type: "string",
172
+ description: "Human-readable compatibility note mirroring `next`."
173
+ },
174
+ next: {
175
+ $ref: "#/$defs/ITtscGraphNext",
176
+ description: "How to use this source-free result next."
177
+ },
178
+ nodes: {
179
+ type: "array",
180
+ items: {
181
+ $ref: "#/$defs/ITtscGraphDetails.INode"
182
+ },
183
+ description: "Selected node facts, in the same order as resolved handles when possible."
184
+ },
185
+ unknown: {
186
+ type: "array",
187
+ items: {
188
+ type: "string"
189
+ },
190
+ description: "Handles that resolved to no node, or that were ambiguous."
191
+ }
92
192
  },
93
- description: "Direct dependency context for the resolved mentions and highest hits."
94
- },
95
- next: {
96
- $ref: "#/$defs/ITtscGraphIndex.INext",
97
- description: "Follow-up handles for deeper graph calls."
193
+ required: [
194
+ "type",
195
+ "nodes",
196
+ "next",
197
+ "guide",
198
+ "unknown"
199
+ ],
200
+ additionalProperties: false
98
201
  },
99
- query: {
100
- type: "string",
101
- description: "The original query the index was built for."
202
+ "ITtscGraphDetails.IMember": {
203
+ type: "object",
204
+ properties: {
205
+ decorators: {
206
+ type: "array",
207
+ items: {
208
+ $ref: "#/$defs/ITtscGraphDecorator"
209
+ },
210
+ description: "Decorators written on this member, when any."
211
+ },
212
+ kind: {
213
+ type: "string",
214
+ description: "Member kind (`method`, `property`, `class`, ...)."
215
+ },
216
+ line: {
217
+ type: "number",
218
+ description: "1-based declaration line, when known."
219
+ },
220
+ name: {
221
+ type: "string",
222
+ description: "Member name, qualified when the graph records an owner-qualified handle."
223
+ },
224
+ signature: {
225
+ type: "string",
226
+ description: "The member's declaration signature."
227
+ }
228
+ },
229
+ required: [
230
+ "name",
231
+ "kind"
232
+ ],
233
+ additionalProperties: false
102
234
  },
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": {
235
+ "ITtscGraphDetails.INode": {
118
236
  type: "object",
119
237
  properties: {
238
+ calls: {
239
+ type: "array",
240
+ items: {
241
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
242
+ },
243
+ description: "Direct execution dependencies in source order, with edge evidence."
244
+ },
245
+ decorators: {
246
+ type: "array",
247
+ items: {
248
+ $ref: "#/$defs/ITtscGraphDecorator"
249
+ },
250
+ description: "Decorators written on this declaration, when any."
251
+ },
252
+ dependedOnBy: {
253
+ type: "array",
254
+ items: {
255
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
256
+ },
257
+ description: "Symbols that use this node (incoming dependency edges)."
258
+ },
259
+ dependsOn: {
260
+ type: "array",
261
+ items: {
262
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
263
+ },
264
+ description: "Symbols this node uses (outgoing dependency edges)."
265
+ },
120
266
  file: {
121
- type: "string"
267
+ type: "string",
268
+ description: "Project-relative path of the file that declares this node."
122
269
  },
123
270
  id: {
124
- type: "string"
271
+ type: "string",
272
+ description: "Stable node id for subsequent `details` or `trace` calls."
273
+ },
274
+ implementation: {
275
+ $ref: "#/$defs/ITtscGraphEvidence",
276
+ description: "Assigned implementation span, when source comes from one."
277
+ },
278
+ implementedBy: {
279
+ type: "array",
280
+ items: {
281
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
282
+ },
283
+ description: "Concrete nodes that implement or override this interface/base member."
125
284
  },
126
285
  kind: {
127
- type: "string"
286
+ type: "string",
287
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
128
288
  },
129
289
  line: {
130
290
  type: "number",
131
291
  description: "1-based declaration line, when known."
132
292
  },
133
- name: {
134
- type: "string"
293
+ literals: {
294
+ type: "array",
295
+ items: {
296
+ type: "string"
297
+ },
298
+ description: "String literal values from the signature."
135
299
  },
136
- score: {
137
- type: "number",
138
- description: "Relative relevance; higher is a better match."
300
+ members: {
301
+ type: "array",
302
+ items: {
303
+ $ref: "#/$defs/ITtscGraphDetails.IMember"
304
+ },
305
+ description: "For a container or object-literal variable: the owned symbol or top-level\nproperty outline a consumer reaches for, without bodies."
306
+ },
307
+ name: {
308
+ type: "string",
309
+ description: "Qualified symbol name when available, otherwise the simple name."
139
310
  },
140
311
  signature: {
141
312
  type: "string",
142
- description: "Declaration head, included only for indexed symbols."
313
+ description: "The declaration signature: its first line(s) up to the body."
314
+ },
315
+ sourceSpan: {
316
+ $ref: "#/$defs/PickITtscGraphEvidenceendLinefilestartLine",
317
+ description: "Declaration or implementation citation range, when known."
318
+ },
319
+ types: {
320
+ type: "array",
321
+ items: {
322
+ $ref: "#/$defs/ITtscGraphDetails.IReference"
323
+ },
324
+ description: "Direct type dependencies in source order, with edge evidence."
143
325
  }
144
326
  },
145
327
  required: [
146
328
  "id",
147
329
  "name",
148
330
  "kind",
149
- "file",
150
- "score"
331
+ "file"
151
332
  ],
152
333
  additionalProperties: false
153
334
  },
154
- "ITtscGraphIndex.IMention": {
335
+ "ITtscGraphDetails.IReference": {
155
336
  type: "object",
156
337
  properties: {
157
- candidates: {
338
+ aliases: {
158
339
  type: "array",
159
340
  items: {
160
- $ref: "#/$defs/ITtscGraphIndex.INode"
161
- }
341
+ type: "string"
342
+ },
343
+ 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."
162
344
  },
163
- handle: {
164
- type: "string"
345
+ evidence: {
346
+ $ref: "#/$defs/ITtscGraphEvidence",
347
+ description: "Source span for the expression that produced this relationship. It is\nrepository evidence for the edge, not a file-read instruction."
165
348
  },
166
- node: {
167
- $ref: "#/$defs/ITtscGraphIndex.INode"
349
+ file: {
350
+ type: "string",
351
+ description: "Project-relative declaration file for the neighbor."
352
+ },
353
+ id: {
354
+ type: "string",
355
+ description: "Stable id of the neighboring node."
356
+ },
357
+ kind: {
358
+ type: "string",
359
+ description: "Neighbor declaration kind."
360
+ },
361
+ line: {
362
+ type: "number",
363
+ description: "1-based declaration line, when known."
364
+ },
365
+ name: {
366
+ type: "string",
367
+ description: "Neighbor symbol name, qualified when available."
368
+ },
369
+ relation: {
370
+ type: "string",
371
+ description: "The edge kind connecting the two (`calls`, `type_ref`, ...)."
168
372
  }
169
373
  },
170
374
  required: [
171
- "handle"
375
+ "id",
376
+ "name",
377
+ "kind",
378
+ "file",
379
+ "relation"
172
380
  ],
173
381
  additionalProperties: false
174
382
  },
175
- "ITtscGraphIndex.INeighborhood": {
383
+ ITtscGraphEntrypoints: {
176
384
  type: "object",
177
385
  properties: {
178
- dependedOnBy: {
386
+ type: {
387
+ type: "string",
388
+ "enum": [
389
+ "entrypoints"
390
+ ],
391
+ description: "Discriminator for first-pass question indexing."
392
+ },
393
+ guide: {
394
+ type: "string",
395
+ description: "Human-readable compatibility note mirroring `next`."
396
+ },
397
+ hits: {
179
398
  type: "array",
180
399
  items: {
181
- $ref: "#/$defs/ITtscGraphIndex.IReference"
182
- }
400
+ $ref: "#/$defs/ITtscGraphEntrypoints.IHit"
401
+ },
402
+ description: "Ranked symbols relevant to the query."
183
403
  },
184
- dependsOn: {
404
+ mentions: {
405
+ type: "array",
406
+ items: {
407
+ $ref: "#/$defs/ITtscGraphEntrypoints.IMention"
408
+ },
409
+ description: "Code handles written directly in the query, resolved when possible."
410
+ },
411
+ neighborhood: {
412
+ type: "array",
413
+ items: {
414
+ $ref: "#/$defs/ITtscGraphEntrypoints.INeighborhood"
415
+ },
416
+ description: "Direct dependency context for the resolved mentions and highest hits."
417
+ },
418
+ next: {
419
+ $ref: "#/$defs/ITtscGraphNext",
420
+ description: "How to use this source-free result next."
421
+ },
422
+ query: {
423
+ type: "string",
424
+ description: "The original question/search phrase the entrypoints were built for."
425
+ },
426
+ truncated: {
427
+ type: "boolean",
428
+ description: "True when result caps hid additional seeds or references."
429
+ }
430
+ },
431
+ required: [
432
+ "type",
433
+ "query",
434
+ "hits",
435
+ "mentions",
436
+ "neighborhood",
437
+ "next",
438
+ "guide"
439
+ ],
440
+ additionalProperties: false
441
+ },
442
+ "ITtscGraphEntrypoints.IHit": {
443
+ type: "object",
444
+ properties: {
445
+ decorators: {
185
446
  type: "array",
186
447
  items: {
187
- $ref: "#/$defs/ITtscGraphIndex.IReference"
188
- }
448
+ $ref: "#/$defs/ITtscGraphDecorator"
449
+ },
450
+ description: "Decorators written on this declaration, when any."
189
451
  },
190
452
  file: {
191
- type: "string"
453
+ type: "string",
454
+ description: "Project-relative path of the declaration file."
192
455
  },
193
456
  id: {
194
- type: "string"
457
+ type: "string",
458
+ description: "Stable node id for subsequent graph calls."
195
459
  },
196
460
  kind: {
197
- type: "string"
461
+ type: "string",
462
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
198
463
  },
199
464
  line: {
200
465
  type: "number",
201
466
  description: "1-based declaration line, when known."
202
467
  },
203
468
  name: {
204
- type: "string"
469
+ type: "string",
470
+ description: "Qualified symbol name when available, otherwise the simple name."
471
+ },
472
+ score: {
473
+ type: "number",
474
+ description: "Relative relevance; higher is a better match."
205
475
  },
206
476
  signature: {
207
477
  type: "string",
@@ -213,53 +483,77 @@ function createServer(graph, version) {
213
483
  "name",
214
484
  "kind",
215
485
  "file",
216
- "dependsOn",
217
- "dependedOnBy"
486
+ "score"
218
487
  ],
219
488
  additionalProperties: false
220
489
  },
221
- "ITtscGraphIndex.INext": {
490
+ "ITtscGraphEntrypoints.IMention": {
222
491
  type: "object",
223
492
  properties: {
224
- expand: {
493
+ candidates: {
225
494
  type: "array",
226
495
  items: {
227
- type: "string"
496
+ $ref: "#/$defs/ITtscGraphEntrypoints.INode"
228
497
  },
229
- description: "Pass these ids to `graph_expand`, with `source: true` only when needed."
498
+ description: "Candidate nodes when the handle is ambiguous."
230
499
  },
231
- traceFrom: {
232
- type: "array",
233
- items: {
234
- type: "string"
235
- },
236
- description: "Pass these ids to `graph_trace` when following dependency flow."
500
+ handle: {
501
+ type: "string",
502
+ description: "The exact handle text found in the query."
503
+ },
504
+ node: {
505
+ $ref: "#/$defs/ITtscGraphEntrypoints.INode",
506
+ description: "Resolved node when the handle maps unambiguously."
237
507
  }
238
508
  },
239
509
  required: [
240
- "expand",
241
- "traceFrom"
510
+ "handle"
242
511
  ],
243
512
  additionalProperties: false
244
513
  },
245
- "ITtscGraphIndex.INode": {
514
+ "ITtscGraphEntrypoints.INeighborhood": {
246
515
  type: "object",
247
516
  properties: {
517
+ decorators: {
518
+ type: "array",
519
+ items: {
520
+ $ref: "#/$defs/ITtscGraphDecorator"
521
+ },
522
+ description: "Decorators written on this declaration, when any."
523
+ },
524
+ dependedOnBy: {
525
+ type: "array",
526
+ items: {
527
+ $ref: "#/$defs/ITtscGraphEntrypoints.IReference"
528
+ },
529
+ description: "Symbols that directly use this node, capped by `neighbors`."
530
+ },
531
+ dependsOn: {
532
+ type: "array",
533
+ items: {
534
+ $ref: "#/$defs/ITtscGraphEntrypoints.IReference"
535
+ },
536
+ description: "Symbols this node directly uses, capped by `neighbors`."
537
+ },
248
538
  file: {
249
- type: "string"
539
+ type: "string",
540
+ description: "Project-relative path of the declaration file."
250
541
  },
251
542
  id: {
252
- type: "string"
543
+ type: "string",
544
+ description: "Stable node id for subsequent graph calls."
253
545
  },
254
546
  kind: {
255
- type: "string"
547
+ type: "string",
548
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
256
549
  },
257
550
  line: {
258
551
  type: "number",
259
552
  description: "1-based declaration line, when known."
260
553
  },
261
554
  name: {
262
- type: "string"
555
+ type: "string",
556
+ description: "Qualified symbol name when available, otherwise the simple name."
263
557
  },
264
558
  signature: {
265
559
  type: "string",
@@ -270,156 +564,344 @@ function createServer(graph, version) {
270
564
  "id",
271
565
  "name",
272
566
  "kind",
273
- "file"
567
+ "file",
568
+ "dependsOn",
569
+ "dependedOnBy"
274
570
  ],
275
571
  additionalProperties: false
276
572
  },
277
- "ITtscGraphIndex.IReference": {
573
+ "ITtscGraphEntrypoints.INode": {
278
574
  type: "object",
279
575
  properties: {
576
+ decorators: {
577
+ type: "array",
578
+ items: {
579
+ $ref: "#/$defs/ITtscGraphDecorator"
580
+ },
581
+ description: "Decorators written on this declaration, when any."
582
+ },
280
583
  file: {
281
- type: "string"
584
+ type: "string",
585
+ description: "Project-relative path of the declaration file."
282
586
  },
283
587
  id: {
284
- type: "string"
588
+ type: "string",
589
+ description: "Stable node id for subsequent graph calls."
285
590
  },
286
591
  kind: {
287
- type: "string"
592
+ type: "string",
593
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
288
594
  },
289
595
  line: {
290
596
  type: "number",
291
597
  description: "1-based declaration line, when known."
292
598
  },
293
599
  name: {
294
- type: "string"
600
+ type: "string",
601
+ description: "Qualified symbol name when available, otherwise the simple name."
295
602
  },
296
- relation: {
297
- type: "string"
603
+ signature: {
604
+ type: "string",
605
+ description: "Declaration head, included only for indexed symbols."
298
606
  }
299
607
  },
300
608
  required: [
301
609
  "id",
302
610
  "name",
303
611
  "kind",
304
- "file",
305
- "relation"
612
+ "file"
306
613
  ],
307
614
  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
615
  },
318
- neighbors: {
319
- type: "number",
320
- description: "Maximum direct dependencies and dependents to return per indexed symbol."
616
+ "ITtscGraphEntrypoints.IReference": {
617
+ type: "object",
618
+ properties: {
619
+ evidence: {
620
+ $ref: "#/$defs/ITtscGraphEvidence",
621
+ description: "Source span for the expression that produced this relationship. It lets\nan agent see why the edge exists without opening the file."
622
+ },
623
+ file: {
624
+ type: "string",
625
+ description: "Project-relative declaration file for the neighbor."
626
+ },
627
+ id: {
628
+ type: "string",
629
+ description: "Stable id of the neighboring node."
630
+ },
631
+ kind: {
632
+ type: "string",
633
+ description: "Neighbor declaration kind."
634
+ },
635
+ line: {
636
+ type: "number",
637
+ description: "1-based declaration line, when known."
638
+ },
639
+ name: {
640
+ type: "string",
641
+ description: "Neighbor symbol name, qualified when available."
642
+ },
643
+ relation: {
644
+ type: "string",
645
+ description: "Edge kind connecting the indexed node and this neighbor."
646
+ }
647
+ },
648
+ required: [
649
+ "id",
650
+ "name",
651
+ "kind",
652
+ "file",
653
+ "relation"
654
+ ],
655
+ additionalProperties: false
321
656
  },
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."
657
+ ITtscGraphEscape: {
658
+ type: "object",
659
+ properties: {
660
+ type: {
661
+ type: "string",
662
+ "enum": [
663
+ "escape"
664
+ ],
665
+ description: "Discriminator for the no-op escape route."
666
+ },
667
+ guide: {
668
+ type: "string",
669
+ description: "Human-readable compatibility note mirroring `next`."
670
+ },
671
+ next: {
672
+ $ref: "#/$defs/ITtscGraphNext",
673
+ description: "How to proceed after skipping graph work."
674
+ },
675
+ nextStep: {
676
+ type: "string",
677
+ description: "Optional note about the next non-graph step."
678
+ },
679
+ reason: {
680
+ type: "string",
681
+ description: "Why no graph operation should run."
682
+ },
683
+ skipped: {
684
+ type: "boolean",
685
+ "enum": [
686
+ true
687
+ ],
688
+ description: "Always true so callers can distinguish an intentional no-op."
689
+ }
690
+ },
691
+ required: [
692
+ "type",
693
+ "skipped",
694
+ "reason",
695
+ "next",
696
+ "guide"
697
+ ],
698
+ additionalProperties: false
699
+ },
700
+ ITtscGraphEvidence: {
701
+ type: "object",
702
+ properties: {
703
+ endCol: {
704
+ type: "number",
705
+ description: "1-based column where the span ends, when known."
706
+ },
707
+ endLine: {
708
+ type: "number",
709
+ description: "1-based line where the span ends, when it differs from `startLine`."
710
+ },
711
+ file: {
712
+ type: "string",
713
+ description: "Project-relative path of the file the span lives in."
714
+ },
715
+ startCol: {
716
+ type: "number",
717
+ description: "1-based column where the span starts, when known."
718
+ },
719
+ startLine: {
720
+ type: "number",
721
+ description: "1-based line where the span starts."
722
+ }
723
+ },
724
+ required: [
725
+ "file",
726
+ "startLine"
727
+ ],
728
+ additionalProperties: false
390
729
  },
391
- hotspots: {
392
- type: "array",
393
- items: {
394
- $ref: "#/$defs/ITtscGraphOverview.IHotspot"
730
+ ITtscGraphLookup: {
731
+ type: "object",
732
+ properties: {
733
+ type: {
734
+ type: "string",
735
+ "enum": [
736
+ "lookup"
737
+ ],
738
+ description: "Discriminator for targeted symbol lookup."
739
+ },
740
+ guide: {
741
+ type: "string",
742
+ description: "Human-readable compatibility note mirroring `next`."
743
+ },
744
+ hits: {
745
+ type: "array",
746
+ items: {
747
+ $ref: "#/$defs/ITtscGraphLookup.IHit"
748
+ },
749
+ description: "Ranked symbol matches for the query."
750
+ },
751
+ next: {
752
+ $ref: "#/$defs/ITtscGraphNext",
753
+ description: "How to use this source-free result next."
754
+ }
395
755
  },
396
- description: "Highest-dependency symbols, busiest first."
756
+ required: [
757
+ "type",
758
+ "hits",
759
+ "next",
760
+ "guide"
761
+ ],
762
+ additionalProperties: false
397
763
  },
398
- layers: {
399
- type: "array",
400
- items: {
401
- $ref: "#/$defs/ITtscGraphOverview.ILayer"
764
+ "ITtscGraphLookup.IHit": {
765
+ type: "object",
766
+ properties: {
767
+ decorators: {
768
+ type: "array",
769
+ items: {
770
+ $ref: "#/$defs/ITtscGraphDecorator"
771
+ },
772
+ description: "Decorators written on this declaration, when any."
773
+ },
774
+ file: {
775
+ type: "string",
776
+ description: "Project-relative path of the declaration file."
777
+ },
778
+ id: {
779
+ type: "string",
780
+ description: "Stable node id for subsequent graph calls."
781
+ },
782
+ kind: {
783
+ type: "string",
784
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
785
+ },
786
+ line: {
787
+ type: "number",
788
+ description: "1-based declaration line, when known."
789
+ },
790
+ name: {
791
+ type: "string",
792
+ description: "Qualified symbol name when available, otherwise the simple name."
793
+ },
794
+ score: {
795
+ type: "number",
796
+ description: "Relative relevance; higher is a better match."
797
+ },
798
+ signature: {
799
+ type: "string",
800
+ description: "The hit's declaration signature, so you can often answer without\nrequesting details."
801
+ }
402
802
  },
403
- description: "Folder layering, largest first."
803
+ required: [
804
+ "id",
805
+ "name",
806
+ "kind",
807
+ "file",
808
+ "score"
809
+ ],
810
+ additionalProperties: false
404
811
  },
405
- project: {
406
- type: "string",
407
- description: "Absolute project root."
812
+ ITtscGraphNext: {
813
+ type: "object",
814
+ properties: {
815
+ action: {
816
+ type: "string",
817
+ "enum": [
818
+ "answer",
819
+ "clarify",
820
+ "inspect",
821
+ "outside"
822
+ ],
823
+ 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."
824
+ },
825
+ reason: {
826
+ type: "string",
827
+ description: "Why the returned graph evidence supports that action."
828
+ },
829
+ request: {
830
+ type: "string",
831
+ "enum": [
832
+ "details",
833
+ "entrypoints",
834
+ "lookup",
835
+ "overview",
836
+ "tour",
837
+ "trace"
838
+ ],
839
+ description: "Smallest graph request type to use when `action` is `inspect`."
840
+ }
841
+ },
842
+ required: [
843
+ "action",
844
+ "reason"
845
+ ],
846
+ additionalProperties: false
408
847
  },
409
- publicApi: {
410
- type: "array",
411
- items: {
412
- $ref: "#/$defs/ITtscGraphOverview.IPublicApi"
848
+ ITtscGraphOverview: {
849
+ type: "object",
850
+ properties: {
851
+ type: {
852
+ type: "string",
853
+ "enum": [
854
+ "overview"
855
+ ],
856
+ description: "Discriminator for source-free project overview."
857
+ },
858
+ counts: {
859
+ $ref: "#/$defs/ITtscGraphOverview.ICounts",
860
+ description: "Size of the graph."
861
+ },
862
+ guide: {
863
+ type: "string",
864
+ description: "Human-readable compatibility note mirroring `next`."
865
+ },
866
+ hotspots: {
867
+ type: "array",
868
+ items: {
869
+ $ref: "#/$defs/ITtscGraphOverview.IHotspot"
870
+ },
871
+ description: "Highest-dependency symbols, busiest first."
872
+ },
873
+ layers: {
874
+ type: "array",
875
+ items: {
876
+ $ref: "#/$defs/ITtscGraphOverview.ILayer"
877
+ },
878
+ description: "Folder layering, largest first."
879
+ },
880
+ next: {
881
+ $ref: "#/$defs/ITtscGraphNext",
882
+ description: "How to use this source-free result next."
883
+ },
884
+ project: {
885
+ type: "string",
886
+ description: "Absolute project root."
887
+ },
888
+ publicApi: {
889
+ type: "array",
890
+ items: {
891
+ $ref: "#/$defs/ITtscGraphOverview.INode"
892
+ },
893
+ description: "Exported API symbols, most-depended-on first."
894
+ }
413
895
  },
414
- description: "Exported API symbols, most-depended-on first."
415
- }
416
- },
417
- required: [
418
- "project",
419
- "counts"
420
- ],
421
- additionalProperties: false,
422
- $defs: {
896
+ required: [
897
+ "type",
898
+ "project",
899
+ "counts",
900
+ "next",
901
+ "guide"
902
+ ],
903
+ additionalProperties: false
904
+ },
423
905
  "ITtscGraphOverview.ICounts": {
424
906
  type: "object",
425
907
  properties: {
@@ -428,13 +910,16 @@ function createServer(graph, version) {
428
910
  description: "Node count per kind."
429
911
  },
430
912
  edges: {
431
- type: "number"
913
+ type: "number",
914
+ description: "Total edge count, including structural edges."
432
915
  },
433
916
  files: {
434
- type: "number"
917
+ type: "number",
918
+ description: "Number of source file container nodes."
435
919
  },
436
920
  nodes: {
437
- type: "number"
921
+ type: "number",
922
+ description: "Total node count, including declarations and file containers."
438
923
  }
439
924
  },
440
925
  required: [
@@ -457,16 +942,24 @@ function createServer(graph, version) {
457
942
  description: "Non-structural edges leaving this symbol."
458
943
  },
459
944
  file: {
460
- type: "string"
945
+ type: "string",
946
+ description: "Project-relative path of the file that declares it."
461
947
  },
462
948
  id: {
463
- type: "string"
949
+ type: "string",
950
+ description: "Stable handle for `details` or `trace`."
464
951
  },
465
952
  kind: {
466
- type: "string"
953
+ type: "string",
954
+ description: "Its declaration kind (`class`, `interface`, `function`, ...)."
955
+ },
956
+ line: {
957
+ type: "number",
958
+ description: "1-based declaration line, when known."
467
959
  },
468
960
  name: {
469
- type: "string"
961
+ type: "string",
962
+ description: "The symbol's qualified name when available."
470
963
  }
471
964
  },
472
965
  required: [
@@ -502,529 +995,373 @@ function createServer(graph, version) {
502
995
  ],
503
996
  additionalProperties: false
504
997
  },
505
- "ITtscGraphOverview.IPublicApi": {
998
+ "ITtscGraphOverview.INode": {
506
999
  type: "object",
507
1000
  properties: {
508
1001
  file: {
509
1002
  type: "string",
510
1003
  description: "Project-relative path of the file that declares it."
511
1004
  },
1005
+ id: {
1006
+ type: "string",
1007
+ description: "Stable handle for `details` or `trace`."
1008
+ },
512
1009
  kind: {
513
1010
  type: "string",
514
- description: "Its declaration kind (`class`, `interface`, `function`, \u2026)."
1011
+ description: "Its declaration kind (`class`, `interface`, `function`, ...)."
1012
+ },
1013
+ line: {
1014
+ type: "number",
1015
+ description: "1-based declaration line, when known."
515
1016
  },
516
1017
  name: {
517
1018
  type: "string",
518
- description: "The exported symbol's name."
1019
+ description: "The symbol's qualified name when available."
519
1020
  }
520
1021
  },
521
1022
  required: [
1023
+ "id",
522
1024
  "name",
523
1025
  "kind",
524
1026
  "file"
525
1027
  ],
526
1028
  additionalProperties: false
527
1029
  },
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": {
1030
+ ITtscGraphTour: {
623
1031
  type: "object",
624
1032
  properties: {
625
- kind: {
626
- type: "string"
627
- },
628
- line: {
629
- type: "number",
630
- description: "1-based declaration line, when known."
631
- },
632
- name: {
633
- type: "string"
634
- },
635
- signature: {
1033
+ type: {
636
1034
  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: {
1035
+ "enum": [
1036
+ "tour"
1037
+ ],
1038
+ description: "Discriminator for code-tour indexing."
1039
+ },
1040
+ answerAnchors: {
650
1041
  type: "array",
651
1042
  items: {
652
- $ref: "#/$defs/ITtscGraphExpand.IReference"
1043
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
653
1044
  },
654
- description: "Symbols that use this node (incoming dependency edges)."
1045
+ description: "Ordered file/line anchors to cite in the final answer, not file reads."
655
1046
  },
656
- dependsOn: {
1047
+ entrypoints: {
657
1048
  type: "array",
658
1049
  items: {
659
- $ref: "#/$defs/ITtscGraphExpand.IReference"
1050
+ $ref: "#/$defs/ITtscGraphTour.INode"
660
1051
  },
661
- description: "Symbols this node uses (outgoing dependency edges)."
1052
+ description: "Central entrypoints selected for the tour."
662
1053
  },
663
- file: {
664
- type: "string"
665
- },
666
- id: {
667
- type: "string"
1054
+ guide: {
1055
+ type: "string",
1056
+ description: "Human-readable compatibility note mirroring `next`."
668
1057
  },
669
- kind: {
670
- type: "string"
1058
+ nearby: {
1059
+ type: "array",
1060
+ items: {
1061
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
1062
+ },
1063
+ description: "Nearby dependency anchors around the selected entrypoints."
671
1064
  },
672
- line: {
673
- type: "number",
674
- description: "1-based declaration line, when known."
1065
+ next: {
1066
+ $ref: "#/$defs/ITtscGraphNext",
1067
+ description: "How to use this source-free result next."
675
1068
  },
676
- members: {
1069
+ primaryFlow: {
677
1070
  type: "array",
678
1071
  items: {
679
- $ref: "#/$defs/ITtscGraphExpand.IMember"
1072
+ $ref: "#/$defs/ITtscGraphTour.IFlow"
680
1073
  },
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."
682
- },
683
- name: {
684
- type: "string"
1074
+ description: "Selected primary runtime flows; sufficient for an index-level tour."
685
1075
  },
686
- signature: {
1076
+ query: {
687
1077
  type: "string",
688
- description: "The declaration signature \u2014 its first line(s) up to the body."
1078
+ description: "Natural code question this tour was built for."
689
1079
  },
690
- source: {
691
- type: "string",
692
- description: "The full declaration source \u2014 only when `source` was requested."
1080
+ tests: {
1081
+ type: "array",
1082
+ items: {
1083
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
1084
+ },
1085
+ description: "Test or usage anchors reached through graph impact edges."
693
1086
  },
694
1087
  truncated: {
695
1088
  type: "boolean",
696
- description: "True when `source` was cut at the line cap."
1089
+ description: "True when any internal slice hit its cap."
697
1090
  }
698
1091
  },
699
1092
  required: [
700
- "id",
701
- "name",
702
- "kind",
703
- "file"
1093
+ "type",
1094
+ "query",
1095
+ "entrypoints",
1096
+ "primaryFlow",
1097
+ "nearby",
1098
+ "tests",
1099
+ "answerAnchors",
1100
+ "next",
1101
+ "guide"
704
1102
  ],
705
1103
  additionalProperties: false
706
1104
  },
707
- "ITtscGraphExpand.IReference": {
1105
+ "ITtscGraphTour.IAnchor": {
708
1106
  type: "object",
709
1107
  properties: {
1108
+ endLine: {
1109
+ type: "number",
1110
+ description: "1-based end line, when known."
1111
+ },
1112
+ file: {
1113
+ type: "string",
1114
+ description: "Project-relative file."
1115
+ },
710
1116
  id: {
711
- type: "string"
1117
+ type: "string",
1118
+ description: "Stable node id when the anchor belongs to a node."
712
1119
  },
713
1120
  kind: {
714
- type: "string"
1121
+ type: "string",
1122
+ description: "Declaration kind, when this anchor belongs to a node."
715
1123
  },
716
1124
  name: {
717
- type: "string"
1125
+ type: "string",
1126
+ description: "Symbol, edge, or test name to show in the answer."
718
1127
  },
719
- relation: {
1128
+ reason: {
720
1129
  type: "string",
721
- description: "The edge kind connecting the two (`calls`, `type_ref`, \u2026)."
1130
+ description: "Why this anchor matters in the tour."
1131
+ },
1132
+ startLine: {
1133
+ type: "number",
1134
+ description: "1-based start line."
722
1135
  }
723
1136
  },
724
1137
  required: [
725
- "id",
1138
+ "reason",
726
1139
  "name",
727
- "kind",
728
- "relation"
1140
+ "file",
1141
+ "startLine"
729
1142
  ],
730
1143
  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
1144
  },
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
- }
1145
+ "ITtscGraphTour.IFlow": {
1146
+ type: "object",
1147
+ properties: {
1148
+ anchors: {
1149
+ type: "array",
1150
+ items: {
1151
+ $ref: "#/$defs/ITtscGraphTour.IAnchor"
1152
+ },
1153
+ description: "Edge and node anchors that explain the flow."
1154
+ },
1155
+ reached: {
1156
+ type: "array",
1157
+ items: {
1158
+ $ref: "#/$defs/ITtscGraphTour.INode"
1159
+ },
1160
+ description: "Nodes reached by this flow."
1161
+ },
1162
+ start: {
1163
+ $ref: "#/$defs/ITtscGraphTour.INode",
1164
+ description: "Flow start node."
1165
+ },
1166
+ steps: {
1167
+ type: "array",
1168
+ items: {
1169
+ type: "string"
1170
+ },
1171
+ description: "Compact edge summaries in graph order."
1172
+ },
1173
+ truncated: {
1174
+ type: "boolean",
1175
+ description: "True when the flow hit graph caps."
1176
+ }
1177
+ },
1178
+ required: [
1179
+ "start",
1180
+ "steps",
1181
+ "reached",
1182
+ "anchors"
1183
+ ],
1184
+ additionalProperties: false
826
1185
  },
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": {
1186
+ "ITtscGraphTour.INode": {
839
1187
  type: "object",
840
1188
  properties: {
1189
+ decorators: {
1190
+ type: "array",
1191
+ items: {
1192
+ $ref: "#/$defs/ITtscGraphDecorator"
1193
+ },
1194
+ description: "Decorators written on the declaration, when any."
1195
+ },
841
1196
  file: {
842
- type: "string"
1197
+ type: "string",
1198
+ description: "Project-relative declaration file."
843
1199
  },
844
1200
  id: {
845
- type: "string"
1201
+ type: "string",
1202
+ description: "Stable node id for later graph calls."
846
1203
  },
847
1204
  kind: {
848
- type: "string"
1205
+ type: "string",
1206
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
849
1207
  },
850
1208
  line: {
851
1209
  type: "number",
852
1210
  description: "1-based declaration line, when known."
853
1211
  },
854
1212
  name: {
855
- type: "string"
856
- },
857
- score: {
858
- type: "number",
859
- description: "Relative relevance; higher is a better match."
1213
+ type: "string",
1214
+ description: "Qualified symbol name when available, otherwise the simple name."
860
1215
  },
861
1216
  signature: {
862
1217
  type: "string",
863
- description: "The hit's declaration signature, so you can often answer without\nexpanding."
1218
+ description: "Declaration head, when available."
1219
+ },
1220
+ sourceSpan: {
1221
+ $ref: "#/$defs/ITtscGraphTour.ISpan",
1222
+ description: "Declaration or implementation range, when known."
864
1223
  }
865
1224
  },
866
1225
  required: [
867
1226
  "id",
868
1227
  "name",
869
1228
  "kind",
870
- "file",
871
- "score"
1229
+ "file"
872
1230
  ],
873
1231
  additionalProperties: false
874
1232
  },
875
- "ITtscGraphQuery.INext": {
1233
+ "ITtscGraphTour.ISpan": {
876
1234
  type: "object",
877
1235
  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."
1236
+ endLine: {
1237
+ type: "number",
1238
+ description: "1-based end line, when known."
1239
+ },
1240
+ file: {
1241
+ type: "string",
1242
+ description: "Project-relative file."
1243
+ },
1244
+ startLine: {
1245
+ type: "number",
1246
+ description: "1-based start line."
884
1247
  }
885
1248
  },
886
1249
  required: [
887
- "expand"
1250
+ "file",
1251
+ "startLine"
888
1252
  ],
889
1253
  additionalProperties: false
890
- }
891
- }
892
- },
893
- parameters: {
894
- type: "object",
895
- properties: {
896
- limit: {
897
- type: "number",
898
- description: "Maximum hits to return."
899
1254
  },
900
- query: {
901
- 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."
977
- },
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"
1255
+ ITtscGraphTrace: {
1256
+ type: "object",
1257
+ properties: {
1258
+ type: {
1259
+ type: "string",
1260
+ "enum": [
1261
+ "trace"
1262
+ ],
1263
+ description: "Discriminator for dependency tracing."
1264
+ },
1265
+ candidates: {
1266
+ type: "array",
1267
+ items: {
1268
+ $ref: "#/$defs/ITtscGraphTrace.INode"
1269
+ },
1270
+ description: "When `from` was an ambiguous name, the matches to disambiguate with."
1271
+ },
1272
+ direction: {
1273
+ type: "string",
1274
+ description: "Trace direction actually used by this result."
1275
+ },
1276
+ guide: {
1277
+ type: "string",
1278
+ description: "Human-readable compatibility note mirroring `next`."
1279
+ },
1280
+ hops: {
1281
+ type: "array",
1282
+ items: {
1283
+ $ref: "#/$defs/ITtscGraphTrace.IHop"
1284
+ },
1285
+ description: "Edges traversed, in breadth-first order."
1286
+ },
1287
+ next: {
1288
+ $ref: "#/$defs/ITtscGraphNext",
1289
+ description: "How to use this source-free result next."
1290
+ },
1291
+ path: {
1292
+ type: "array",
1293
+ items: {
1294
+ $ref: "#/$defs/ITtscGraphTrace.INode"
1295
+ },
1296
+ 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`."
1297
+ },
1298
+ reached: {
1299
+ type: "array",
1300
+ items: {
1301
+ $ref: "#/$defs/ITtscGraphTrace.INode"
1302
+ },
1303
+ description: "Unique nodes reached (excluding the start), each with its depth and roles."
1304
+ },
1305
+ start: {
1306
+ $ref: "#/$defs/ITtscGraphTrace.INode",
1307
+ description: "The resolved start node, or undefined when `from` matched nothing."
1308
+ },
1309
+ steps: {
1310
+ type: "array",
1311
+ items: {
1312
+ type: "string"
1313
+ },
1314
+ description: "Compact hop summaries preserving node names and edge evidence, capped."
1315
+ },
1316
+ target: {
1317
+ $ref: "#/$defs/ITtscGraphTrace.INode",
1318
+ description: "The resolved `to` target, when a path was requested."
1319
+ },
1320
+ truncated: {
1321
+ type: "boolean",
1322
+ description: "True when the trace hit maxNodes or maxDepth and more flow exists."
1323
+ }
989
1324
  },
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."
995
- },
996
- target: {
997
- $ref: "#/$defs/ITtscGraphTrace.INode",
998
- description: "The resolved `to` target, when a path was requested."
1325
+ required: [
1326
+ "type",
1327
+ "direction",
1328
+ "hops",
1329
+ "reached",
1330
+ "truncated",
1331
+ "next",
1332
+ "guide"
1333
+ ],
1334
+ additionalProperties: false
999
1335
  },
1000
- truncated: {
1001
- type: "boolean",
1002
- description: "True when the trace hit maxNodes or maxDepth and more flow exists."
1003
- }
1004
- },
1005
- required: [
1006
- "direction",
1007
- "hops",
1008
- "reached",
1009
- "truncated"
1010
- ],
1011
- additionalProperties: false,
1012
- $defs: {
1013
1336
  "ITtscGraphTrace.IHop": {
1014
1337
  type: "object",
1015
1338
  properties: {
1339
+ aliases: {
1340
+ type: "array",
1341
+ items: {
1342
+ type: "string"
1343
+ },
1344
+ 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."
1345
+ },
1016
1346
  depth: {
1017
1347
  type: "number",
1018
1348
  description: "Hops from the start (1 = direct)."
1019
1349
  },
1350
+ evidence: {
1351
+ $ref: "#/$defs/ITtscGraphEvidence",
1352
+ 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."
1353
+ },
1020
1354
  from: {
1021
- type: "string"
1355
+ type: "string",
1356
+ description: "Source node id for this traversed edge."
1022
1357
  },
1023
1358
  kind: {
1024
- type: "string"
1359
+ type: "string",
1360
+ description: "Edge kind (`calls`, `type_ref`, `accesses`, ...)."
1025
1361
  },
1026
1362
  to: {
1027
- type: "string"
1363
+ type: "string",
1364
+ description: "Target node id for this traversed edge."
1028
1365
  }
1029
1366
  },
1030
1367
  required: [
@@ -1043,16 +1380,24 @@ function createServer(graph, version) {
1043
1380
  description: "Hops from the start, on a reached node."
1044
1381
  },
1045
1382
  file: {
1046
- type: "string"
1383
+ type: "string",
1384
+ description: "Project-relative path of the declaration file."
1047
1385
  },
1048
1386
  id: {
1049
- type: "string"
1387
+ type: "string",
1388
+ description: "Stable node id for subsequent graph calls."
1050
1389
  },
1051
1390
  kind: {
1052
- type: "string"
1391
+ type: "string",
1392
+ description: "Declaration kind (`class`, `method`, `function`, ...)."
1393
+ },
1394
+ line: {
1395
+ type: "number",
1396
+ description: "1-based declaration line, when known."
1053
1397
  },
1054
1398
  name: {
1055
- type: "string"
1399
+ type: "string",
1400
+ description: "Qualified symbol name when available, otherwise the simple name."
1056
1401
  },
1057
1402
  roles: {
1058
1403
  type: "array",
@@ -1063,7 +1408,11 @@ function createServer(graph, version) {
1063
1408
  },
1064
1409
  signature: {
1065
1410
  type: "string",
1066
- description: "The node's signature \u2014 carried on path nodes so the path explains itself."
1411
+ description: "The node's signature, carried on path nodes so the path explains itself."
1412
+ },
1413
+ sourceSpan: {
1414
+ $ref: "#/$defs/PickITtscGraphEvidenceendLinefilestartLine",
1415
+ description: "Declaration or implementation citation range, when known."
1067
1416
  }
1068
1417
  },
1069
1418
  required: [
@@ -1073,47 +1422,490 @@ function createServer(graph, version) {
1073
1422
  "file"
1074
1423
  ],
1075
1424
  additionalProperties: false
1425
+ },
1426
+ PickITtscGraphEvidenceendLinefilestartLine: {
1427
+ type: "object",
1428
+ properties: {
1429
+ endLine: {
1430
+ type: "number",
1431
+ description: "1-based line where the span ends, when it differs from `startLine`."
1432
+ },
1433
+ file: {
1434
+ type: "string",
1435
+ description: "Project-relative path of the file the span lives in."
1436
+ },
1437
+ startLine: {
1438
+ type: "number",
1439
+ description: "1-based line where the span starts."
1440
+ }
1441
+ },
1442
+ required: [
1443
+ "file",
1444
+ "startLine"
1445
+ ],
1446
+ additionalProperties: false
1447
+ },
1448
+ Recordstringnumber: {
1449
+ type: "object",
1450
+ properties: {},
1451
+ required: [],
1452
+ additionalProperties: {
1453
+ type: "number"
1454
+ }
1076
1455
  }
1077
1456
  }
1078
1457
  },
1079
1458
  parameters: {
1080
1459
  type: "object",
1081
1460
  properties: {
1082
- direction: {
1461
+ draft: {
1083
1462
  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."
1463
+ description: "Initial request plan before final arguments are filled.\n\nName the intended request type and why it seems smallest. Broad flow,\narchitecture, repository-orientation, and read-next questions should\nnormally draft `tour`; narrow named symbols can draft `lookup`, `trace`,\nor `details`."
1090
1464
  },
1091
- from: {
1465
+ question: {
1092
1466
  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."
1467
+ 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`."
1094
1468
  },
1095
- maxDepth: {
1096
- type: "number",
1097
- description: "How many hops deep to follow."
1098
- },
1099
- maxNodes: {
1100
- type: "number",
1101
- description: "Cap on reached nodes; the trace stops and marks itself truncated past it."
1469
+ request: {
1470
+ anyOf: [
1471
+ {
1472
+ $ref: "#/$defs/ITtscGraphDetails.IRequest"
1473
+ },
1474
+ {
1475
+ $ref: "#/$defs/ITtscGraphEntrypoints.IRequest"
1476
+ },
1477
+ {
1478
+ $ref: "#/$defs/ITtscGraphLookup.IRequest"
1479
+ },
1480
+ {
1481
+ $ref: "#/$defs/ITtscGraphOverview.IRequest"
1482
+ },
1483
+ {
1484
+ $ref: "#/$defs/ITtscGraphTour.IRequest"
1485
+ },
1486
+ {
1487
+ $ref: "#/$defs/ITtscGraphTrace.IRequest"
1488
+ },
1489
+ {
1490
+ $ref: "#/$defs/ITtscGraphEscape.IRequest"
1491
+ }
1492
+ ],
1493
+ description: "Final graph operation chosen after review, or a no-op escape.",
1494
+ "x-discriminator": {
1495
+ mapping: {
1496
+ details: "#/$defs/ITtscGraphDetails.IRequest",
1497
+ entrypoints: "#/$defs/ITtscGraphEntrypoints.IRequest",
1498
+ escape: "#/$defs/ITtscGraphEscape.IRequest",
1499
+ lookup: "#/$defs/ITtscGraphLookup.IRequest",
1500
+ overview: "#/$defs/ITtscGraphOverview.IRequest",
1501
+ tour: "#/$defs/ITtscGraphTour.IRequest",
1502
+ trace: "#/$defs/ITtscGraphTrace.IRequest"
1503
+ },
1504
+ propertyName: "type"
1505
+ }
1102
1506
  },
1103
- to: {
1507
+ review: {
1104
1508
  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."
1509
+ 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."
1106
1510
  }
1107
1511
  },
1108
1512
  required: [
1109
- "from"
1513
+ "question",
1514
+ "draft",
1515
+ "review",
1516
+ "request"
1110
1517
  ],
1111
1518
  additionalProperties: false,
1112
- $defs: {}
1519
+ $defs: {
1520
+ "ITtscGraphDetails.IRequest": {
1521
+ type: "object",
1522
+ properties: {
1523
+ type: {
1524
+ type: "string",
1525
+ "enum": [
1526
+ "details"
1527
+ ],
1528
+ description: "Discriminator for selected symbol inspection."
1529
+ },
1530
+ dependencyLimit: {
1531
+ type: "number",
1532
+ 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."
1533
+ },
1534
+ handles: {
1535
+ type: "array",
1536
+ items: {
1537
+ type: "string"
1538
+ },
1539
+ 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."
1540
+ },
1541
+ includeExternal: {
1542
+ type: "boolean",
1543
+ 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."
1544
+ },
1545
+ memberLimit: {
1546
+ type: "number",
1547
+ 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."
1548
+ },
1549
+ neighborLimit: {
1550
+ type: "number",
1551
+ 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."
1552
+ },
1553
+ neighbors: {
1554
+ type: "boolean",
1555
+ 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."
1556
+ }
1557
+ },
1558
+ required: [
1559
+ "type",
1560
+ "handles"
1561
+ ],
1562
+ additionalProperties: false
1563
+ },
1564
+ "ITtscGraphEntrypoints.IRequest": {
1565
+ type: "object",
1566
+ properties: {
1567
+ type: {
1568
+ type: "string",
1569
+ "enum": [
1570
+ "entrypoints"
1571
+ ],
1572
+ description: "Discriminator for first-pass question indexing."
1573
+ },
1574
+ limit: {
1575
+ type: "number",
1576
+ description: "Maximum ranked hits to return.\n\nPrefer the default. Raise only when the first result was truncated and\nthe missing handle is named."
1577
+ },
1578
+ neighbors: {
1579
+ type: "number",
1580
+ 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."
1581
+ },
1582
+ query: {
1583
+ type: "string",
1584
+ 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."
1585
+ }
1586
+ },
1587
+ required: [
1588
+ "type",
1589
+ "query"
1590
+ ],
1591
+ additionalProperties: false
1592
+ },
1593
+ "ITtscGraphEscape.IRequest": {
1594
+ type: "object",
1595
+ properties: {
1596
+ type: {
1597
+ type: "string",
1598
+ "enum": [
1599
+ "escape"
1600
+ ],
1601
+ description: "Discriminator for the no-op escape route."
1602
+ },
1603
+ nextStep: {
1604
+ type: "string",
1605
+ 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`."
1606
+ },
1607
+ reason: {
1608
+ type: "string",
1609
+ 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."
1610
+ }
1611
+ },
1612
+ required: [
1613
+ "type",
1614
+ "reason"
1615
+ ],
1616
+ additionalProperties: false
1617
+ },
1618
+ "ITtscGraphLookup.IRequest": {
1619
+ type: "object",
1620
+ properties: {
1621
+ type: {
1622
+ type: "string",
1623
+ "enum": [
1624
+ "lookup"
1625
+ ],
1626
+ description: "Discriminator for targeted symbol lookup."
1627
+ },
1628
+ includeExternal: {
1629
+ type: "boolean",
1630
+ 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."
1631
+ },
1632
+ limit: {
1633
+ type: "number",
1634
+ 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."
1635
+ },
1636
+ query: {
1637
+ type: "string",
1638
+ 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."
1639
+ }
1640
+ },
1641
+ required: [
1642
+ "type",
1643
+ "query"
1644
+ ],
1645
+ additionalProperties: false
1646
+ },
1647
+ "ITtscGraphOverview.IRequest": {
1648
+ type: "object",
1649
+ properties: {
1650
+ type: {
1651
+ type: "string",
1652
+ "enum": [
1653
+ "overview"
1654
+ ],
1655
+ description: "Discriminator for source-free project overview."
1656
+ },
1657
+ aspect: {
1658
+ type: "string",
1659
+ "enum": [
1660
+ "all",
1661
+ "hotspots",
1662
+ "layers",
1663
+ "publicApi"
1664
+ ],
1665
+ 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."
1666
+ }
1667
+ },
1668
+ required: [
1669
+ "type"
1670
+ ],
1671
+ additionalProperties: false
1672
+ },
1673
+ "ITtscGraphTour.IRequest": {
1674
+ type: "object",
1675
+ properties: {
1676
+ type: {
1677
+ type: "string",
1678
+ "enum": [
1679
+ "tour"
1680
+ ],
1681
+ description: "Discriminator for code-tour indexing."
1682
+ },
1683
+ includeTests: {
1684
+ type: "boolean",
1685
+ description: "Include graph-reached test or usage anchors when available."
1686
+ },
1687
+ limit: {
1688
+ type: "number",
1689
+ 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."
1690
+ },
1691
+ query: {
1692
+ type: "string",
1693
+ description: "The user's natural code-tour question."
1694
+ }
1695
+ },
1696
+ required: [
1697
+ "type",
1698
+ "query"
1699
+ ],
1700
+ additionalProperties: false
1701
+ },
1702
+ "ITtscGraphTrace.IRequest": {
1703
+ type: "object",
1704
+ properties: {
1705
+ type: {
1706
+ type: "string",
1707
+ "enum": [
1708
+ "trace"
1709
+ ],
1710
+ description: "Discriminator for dependency tracing."
1711
+ },
1712
+ direction: {
1713
+ type: "string",
1714
+ "enum": [
1715
+ "forward",
1716
+ "impact",
1717
+ "reverse"
1718
+ ],
1719
+ 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`."
1720
+ },
1721
+ focus: {
1722
+ type: "string",
1723
+ "enum": [
1724
+ "all",
1725
+ "execution",
1726
+ "types"
1727
+ ],
1728
+ 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`."
1729
+ },
1730
+ from: {
1731
+ type: "string",
1732
+ 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."
1733
+ },
1734
+ includeExternal: {
1735
+ type: "boolean",
1736
+ 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."
1737
+ },
1738
+ maxDepth: {
1739
+ type: "number",
1740
+ 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."
1741
+ },
1742
+ maxNodes: {
1743
+ type: "number",
1744
+ 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."
1745
+ },
1746
+ to: {
1747
+ type: "string",
1748
+ 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."
1749
+ }
1750
+ },
1751
+ required: [
1752
+ "type",
1753
+ "from"
1754
+ ],
1755
+ additionalProperties: false
1756
+ }
1757
+ }
1113
1758
  },
1114
1759
  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, {
1760
+ const _io0 = input => "string" === typeof input.question && "string" === typeof input.draft && "string" === typeof input.review && ("object" === typeof input.request && null !== input.request && _iu0(input.request));
1761
+ const _io1 = 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) && (undefined === input.includeExternal || "boolean" === typeof input.includeExternal);
1762
+ const _io2 = input => "entrypoints" === input.type && "string" === typeof input.query && (undefined === input.limit || "number" === typeof input.limit) && (undefined === input.neighbors || "number" === typeof input.neighbors);
1763
+ const _io3 = input => "lookup" === input.type && "string" === typeof input.query && (undefined === input.limit || "number" === typeof input.limit) && (undefined === input.includeExternal || "boolean" === typeof input.includeExternal);
1764
+ const _io4 = input => "overview" === input.type && (undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect);
1765
+ const _io5 = input => "tour" === input.type && "string" === typeof input.query && (undefined === input.limit || "number" === typeof input.limit) && (undefined === input.includeTests || "boolean" === typeof input.includeTests);
1766
+ 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) && (undefined === input.includeExternal || "boolean" === typeof input.includeExternal);
1767
+ const _io7 = input => "escape" === input.type && "string" === typeof input.reason && (undefined === input.nextStep || "string" === typeof input.nextStep);
1768
+ const _iu0 = input => (() => {
1769
+ if ("details" === input.type)
1770
+ return _io1(input);
1771
+ else if ("entrypoints" === input.type)
1772
+ return _io2(input);
1773
+ else if ("lookup" === input.type)
1774
+ return _io3(input);
1775
+ else if ("overview" === input.type)
1776
+ return _io4(input);
1777
+ else if ("tour" === input.type)
1778
+ return _io5(input);
1779
+ else if ("trace" === input.type)
1780
+ return _io6(input);
1781
+ else if ("escape" === input.type)
1782
+ return _io7(input);
1783
+ else
1784
+ return false;
1785
+ })();
1786
+ const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.question || _report(_exceptionable, {
1787
+ path: _path + ".question",
1788
+ expected: "string",
1789
+ value: input.question
1790
+ }), "string" === typeof input.draft || _report(_exceptionable, {
1791
+ path: _path + ".draft",
1792
+ expected: "string",
1793
+ value: input.draft
1794
+ }), "string" === typeof input.review || _report(_exceptionable, {
1795
+ path: _path + ".review",
1796
+ expected: "string",
1797
+ value: input.review
1798
+ }), ("object" === typeof input.request && null !== input.request || _report(_exceptionable, {
1799
+ path: _path + ".request",
1800
+ expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphEscape.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTour.IRequest | ITtscGraphTrace.IRequest)",
1801
+ value: input.request
1802
+ })) && _vu0(input.request, _path + ".request", true && _exceptionable) || _report(_exceptionable, {
1803
+ path: _path + ".request",
1804
+ expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphEscape.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTour.IRequest | ITtscGraphTrace.IRequest)",
1805
+ value: input.request
1806
+ })].every(flag => flag);
1807
+ const _vo1 = (input, _path, _exceptionable = true) => ["details" === input.type || _report(_exceptionable, {
1808
+ path: _path + ".type",
1809
+ expected: "\"details\"",
1810
+ value: input.type
1811
+ }), (Array.isArray(input.handles) || _report(_exceptionable, {
1812
+ path: _path + ".handles",
1813
+ expected: "Array<string>",
1814
+ value: input.handles
1815
+ })) && input.handles.map((elem, _index2) => "string" === typeof elem || _report(_exceptionable, {
1816
+ path: _path + ".handles[" + _index2 + "]",
1817
+ expected: "string",
1818
+ value: elem
1819
+ })).every(flag => flag) || _report(_exceptionable, {
1820
+ path: _path + ".handles",
1821
+ expected: "Array<string>",
1822
+ value: input.handles
1823
+ }), undefined === input.neighbors || "boolean" === typeof input.neighbors || _report(_exceptionable, {
1824
+ path: _path + ".neighbors",
1825
+ expected: "(boolean | undefined)",
1826
+ value: input.neighbors
1827
+ }), undefined === input.neighborLimit || "number" === typeof input.neighborLimit || _report(_exceptionable, {
1828
+ path: _path + ".neighborLimit",
1829
+ expected: "(number | undefined)",
1830
+ value: input.neighborLimit
1831
+ }), undefined === input.memberLimit || "number" === typeof input.memberLimit || _report(_exceptionable, {
1832
+ path: _path + ".memberLimit",
1833
+ expected: "(number | undefined)",
1834
+ value: input.memberLimit
1835
+ }), undefined === input.dependencyLimit || "number" === typeof input.dependencyLimit || _report(_exceptionable, {
1836
+ path: _path + ".dependencyLimit",
1837
+ expected: "(number | undefined)",
1838
+ value: input.dependencyLimit
1839
+ }), undefined === input.includeExternal || "boolean" === typeof input.includeExternal || _report(_exceptionable, {
1840
+ path: _path + ".includeExternal",
1841
+ expected: "(boolean | undefined)",
1842
+ value: input.includeExternal
1843
+ })].every(flag => flag);
1844
+ const _vo2 = (input, _path, _exceptionable = true) => ["entrypoints" === input.type || _report(_exceptionable, {
1845
+ path: _path + ".type",
1846
+ expected: "\"entrypoints\"",
1847
+ value: input.type
1848
+ }), "string" === typeof input.query || _report(_exceptionable, {
1849
+ path: _path + ".query",
1850
+ expected: "string",
1851
+ value: input.query
1852
+ }), undefined === input.limit || "number" === typeof input.limit || _report(_exceptionable, {
1853
+ path: _path + ".limit",
1854
+ expected: "(number | undefined)",
1855
+ value: input.limit
1856
+ }), undefined === input.neighbors || "number" === typeof input.neighbors || _report(_exceptionable, {
1857
+ path: _path + ".neighbors",
1858
+ expected: "(number | undefined)",
1859
+ value: input.neighbors
1860
+ })].every(flag => flag);
1861
+ const _vo3 = (input, _path, _exceptionable = true) => ["lookup" === input.type || _report(_exceptionable, {
1862
+ path: _path + ".type",
1863
+ expected: "\"lookup\"",
1864
+ value: input.type
1865
+ }), "string" === typeof input.query || _report(_exceptionable, {
1866
+ path: _path + ".query",
1867
+ expected: "string",
1868
+ value: input.query
1869
+ }), undefined === input.limit || "number" === typeof input.limit || _report(_exceptionable, {
1870
+ path: _path + ".limit",
1871
+ expected: "(number | undefined)",
1872
+ value: input.limit
1873
+ }), undefined === input.includeExternal || "boolean" === typeof input.includeExternal || _report(_exceptionable, {
1874
+ path: _path + ".includeExternal",
1875
+ expected: "(boolean | undefined)",
1876
+ value: input.includeExternal
1877
+ })].every(flag => flag);
1878
+ const _vo4 = (input, _path, _exceptionable = true) => ["overview" === input.type || _report(_exceptionable, {
1879
+ path: _path + ".type",
1880
+ expected: "\"overview\"",
1881
+ value: input.type
1882
+ }), undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect || _report(_exceptionable, {
1883
+ path: _path + ".aspect",
1884
+ expected: "(\"all\" | \"hotspots\" | \"layers\" | \"publicApi\" | undefined)",
1885
+ value: input.aspect
1886
+ })].every(flag => flag);
1887
+ const _vo5 = (input, _path, _exceptionable = true) => ["tour" === input.type || _report(_exceptionable, {
1888
+ path: _path + ".type",
1889
+ expected: "\"tour\"",
1890
+ value: input.type
1891
+ }), "string" === typeof input.query || _report(_exceptionable, {
1892
+ path: _path + ".query",
1893
+ expected: "string",
1894
+ value: input.query
1895
+ }), undefined === input.limit || "number" === typeof input.limit || _report(_exceptionable, {
1896
+ path: _path + ".limit",
1897
+ expected: "(number | undefined)",
1898
+ value: input.limit
1899
+ }), undefined === input.includeTests || "boolean" === typeof input.includeTests || _report(_exceptionable, {
1900
+ path: _path + ".includeTests",
1901
+ expected: "(boolean | undefined)",
1902
+ value: input.includeTests
1903
+ })].every(flag => flag);
1904
+ const _vo6 = (input, _path, _exceptionable = true) => ["trace" === input.type || _report(_exceptionable, {
1905
+ path: _path + ".type",
1906
+ expected: "\"trace\"",
1907
+ value: input.type
1908
+ }), "string" === typeof input.from || _report(_exceptionable, {
1117
1909
  path: _path + ".from",
1118
1910
  expected: "string",
1119
1911
  value: input.from
@@ -1125,6 +1917,10 @@ function createServer(graph, version) {
1125
1917
  path: _path + ".direction",
1126
1918
  expected: "(\"forward\" | \"impact\" | \"reverse\" | undefined)",
1127
1919
  value: input.direction
1920
+ }), undefined === input.focus || "all" === input.focus || "execution" === input.focus || "types" === input.focus || _report(_exceptionable, {
1921
+ path: _path + ".focus",
1922
+ expected: "(\"all\" | \"execution\" | \"types\" | undefined)",
1923
+ value: input.focus
1128
1924
  }), undefined === input.maxDepth || "number" === typeof input.maxDepth || _report(_exceptionable, {
1129
1925
  path: _path + ".maxDepth",
1130
1926
  expected: "(number | undefined)",
@@ -1133,7 +1929,46 @@ function createServer(graph, version) {
1133
1929
  path: _path + ".maxNodes",
1134
1930
  expected: "(number | undefined)",
1135
1931
  value: input.maxNodes
1932
+ }), undefined === input.includeExternal || "boolean" === typeof input.includeExternal || _report(_exceptionable, {
1933
+ path: _path + ".includeExternal",
1934
+ expected: "(boolean | undefined)",
1935
+ value: input.includeExternal
1136
1936
  })].every(flag => flag);
1937
+ const _vo7 = (input, _path, _exceptionable = true) => ["escape" === input.type || _report(_exceptionable, {
1938
+ path: _path + ".type",
1939
+ expected: "\"escape\"",
1940
+ value: input.type
1941
+ }), "string" === typeof input.reason || _report(_exceptionable, {
1942
+ path: _path + ".reason",
1943
+ expected: "string",
1944
+ value: input.reason
1945
+ }), undefined === input.nextStep || "string" === typeof input.nextStep || _report(_exceptionable, {
1946
+ path: _path + ".nextStep",
1947
+ expected: "(string | undefined)",
1948
+ value: input.nextStep
1949
+ })].every(flag => flag);
1950
+ const _vu0 = (input, _path, _exceptionable = true) => (() => {
1951
+ if ("details" === input.type)
1952
+ return _vo1(input, _path, true && _exceptionable);
1953
+ else if ("entrypoints" === input.type)
1954
+ return _vo2(input, _path, true && _exceptionable);
1955
+ else if ("lookup" === input.type)
1956
+ return _vo3(input, _path, true && _exceptionable);
1957
+ else if ("overview" === input.type)
1958
+ return _vo4(input, _path, true && _exceptionable);
1959
+ else if ("tour" === input.type)
1960
+ return _vo5(input, _path, true && _exceptionable);
1961
+ else if ("trace" === input.type)
1962
+ return _vo6(input, _path, true && _exceptionable);
1963
+ else if ("escape" === input.type)
1964
+ return _vo7(input, _path, true && _exceptionable);
1965
+ else
1966
+ return _report(_exceptionable, {
1967
+ path: _path,
1968
+ expected: "(ITtscGraphDetails.IRequest | ITtscGraphEntrypoints.IRequest | ITtscGraphLookup.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTour.IRequest | ITtscGraphTrace.IRequest | ITtscGraphEscape.IRequest)",
1969
+ value: input
1970
+ });
1971
+ })();
1137
1972
  const __is = input => "object" === typeof input && null !== input && _io0(input);
1138
1973
  let errors;
1139
1974
  let _report;
@@ -1143,11 +1978,11 @@ function createServer(graph, version) {
1143
1978
  _report = _b._validateReport(errors);
1144
1979
  ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1145
1980
  path: _path + "",
1146
- expected: "ITtscGraphTrace.IProps",
1981
+ expected: "ITtscGraphApplication.IProps",
1147
1982
  value: input
1148
1983
  })) && _vo0(input, _path + "", true) || _report(true, {
1149
1984
  path: _path + "",
1150
- expected: "ITtscGraphTrace.IProps",
1985
+ expected: "ITtscGraphApplication.IProps",
1151
1986
  value: input
1152
1987
  }))(input, "$input", true);
1153
1988
  const success = 0 === errors.length;
@@ -1193,8 +2028,8 @@ function createServer(graph, version) {
1193
2028
  if (func === undefined || method === undefined) {
1194
2029
  return error(`Unknown tool: ${request.params.name}`);
1195
2030
  }
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".
2031
+ // Validate an empty object when a client omits `arguments`, so typia can
2032
+ // return field-level errors instead of a generic "expected object".
1198
2033
  const validation = func.validate(request.params.arguments ?? {});
1199
2034
  if (!validation.success) {
1200
2035
  // Hand typia's validation errors back so the model can correct its call.
@@ -1206,9 +2041,7 @@ function createServer(graph, version) {
1206
2041
  content: [
1207
2042
  {
1208
2043
  type: "text",
1209
- text: result === undefined
1210
- ? "Success"
1211
- : JSON.stringify(result, null, 2),
2044
+ text: result === undefined ? "Success" : JSON.stringify(result),
1212
2045
  },
1213
2046
  ],
1214
2047
  };