@ttsc/graph 0.18.3 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +231 -36
- package/lib/TtscGraphApplication.d.ts +4 -3
- package/lib/TtscGraphApplication.js +54 -19
- package/lib/TtscGraphApplication.js.map +1 -1
- package/lib/index.d.ts +9 -4
- package/lib/index.js +24 -5
- package/lib/index.js.map +1 -1
- package/lib/model/TtscGraphMemory.js +80 -22
- package/lib/model/TtscGraphMemory.js.map +1 -1
- package/lib/model/TtscGraphSession.d.ts +36 -0
- package/lib/model/TtscGraphSession.js +457 -0
- package/lib/model/TtscGraphSession.js.map +1 -0
- package/lib/model/loadGraph.d.ts +3 -3
- package/lib/model/loadGraph.js +94 -141
- package/lib/model/loadGraph.js.map +1 -1
- package/lib/resolveGraphBinary.d.ts +4 -2
- package/lib/resolveGraphBinary.js +7 -3
- package/lib/resolveGraphBinary.js.map +1 -1
- package/lib/server/createServer.d.ts +16 -9
- package/lib/server/createServer.js +286 -190
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/exportSurface.d.ts +26 -0
- package/lib/server/exportSurface.js +44 -0
- package/lib/server/exportSurface.js.map +1 -0
- package/lib/server/resolveHandle.d.ts +26 -1
- package/lib/server/resolveHandle.js +124 -4
- package/lib/server/resolveHandle.js.map +1 -1
- package/lib/server/resultAudit.d.ts +74 -0
- package/lib/server/resultAudit.js +110 -0
- package/lib/server/resultAudit.js.map +1 -0
- package/lib/server/resultNext.d.ts +9 -0
- package/lib/server/resultNext.js +11 -0
- package/lib/server/resultNext.js.map +1 -0
- package/lib/server/runDetails.d.ts +15 -3
- package/lib/server/runDetails.js +105 -23
- package/lib/server/runDetails.js.map +1 -1
- package/lib/server/runEntrypoints.d.ts +2 -1
- package/lib/server/runEntrypoints.js +17 -10
- package/lib/server/runEntrypoints.js.map +1 -1
- package/lib/server/runLookup.d.ts +2 -1
- package/lib/server/runLookup.js +21 -9
- package/lib/server/runLookup.js.map +1 -1
- package/lib/server/runOverview.d.ts +2 -1
- package/lib/server/runOverview.js +5 -4
- package/lib/server/runOverview.js.map +1 -1
- package/lib/server/runTour.d.ts +2 -1
- package/lib/server/runTour.js +707 -331
- package/lib/server/runTour.js.map +1 -1
- package/lib/server/runTrace.d.ts +2 -1
- package/lib/server/runTrace.js +234 -54
- package/lib/server/runTrace.js.map +1 -1
- package/lib/server/startServer.d.ts +3 -2
- package/lib/server/startServer.js +13 -7
- package/lib/server/startServer.js.map +1 -1
- package/lib/structures/ITtscGraphApplication.d.ts +122 -114
- package/lib/structures/ITtscGraphDecorator.d.ts +4 -7
- package/lib/structures/ITtscGraphDetails.d.ts +51 -43
- package/lib/structures/ITtscGraphDump.d.ts +36 -11
- package/lib/structures/ITtscGraphEdge.d.ts +4 -6
- package/lib/structures/ITtscGraphEntrypoints.d.ts +10 -27
- package/lib/structures/ITtscGraphEscape.d.ts +6 -16
- package/lib/structures/ITtscGraphEvidence.d.ts +5 -8
- package/lib/structures/ITtscGraphLookup.d.ts +9 -20
- package/lib/structures/ITtscGraphNext.d.ts +10 -7
- package/lib/structures/ITtscGraphNode.d.ts +17 -8
- package/lib/structures/ITtscGraphOverview.d.ts +10 -14
- package/lib/structures/ITtscGraphSpan.d.ts +29 -0
- package/lib/structures/{ITtscGraphDiagnostic.js → ITtscGraphSpan.js} +1 -1
- package/lib/structures/ITtscGraphSpan.js.map +1 -0
- package/lib/structures/ITtscGraphTour.d.ts +65 -23
- package/lib/structures/ITtscGraphTrace.d.ts +72 -49
- package/lib/structures/TtscGraphEdgeKind.d.ts +7 -1
- package/lib/structures/index.d.ts +1 -1
- package/lib/structures/index.js +1 -1
- package/lib/structures/index.js.map +1 -1
- package/lib/view.js +3 -1
- package/lib/view.js.map +1 -1
- package/package.json +4 -4
- package/src/TtscGraphApplication.ts +66 -31
- package/src/index.ts +23 -5
- package/src/model/TtscGraphMemory.ts +86 -22
- package/src/model/TtscGraphSession.ts +204 -0
- package/src/model/loadGraph.ts +6 -4
- package/src/resolveGraphBinary.ts +7 -3
- package/src/server/createServer.ts +24 -17
- package/src/server/exportSurface.ts +40 -0
- package/src/server/resolveHandle.ts +141 -4
- package/src/server/resultAudit.ts +109 -0
- package/src/server/resultNext.ts +22 -0
- package/src/server/runDetails.ts +112 -28
- package/src/server/runEntrypoints.ts +26 -17
- package/src/server/runLookup.ts +29 -18
- package/src/server/runOverview.ts +9 -10
- package/src/server/runTour.ts +764 -363
- package/src/server/runTrace.ts +265 -71
- package/src/server/startServer.ts +13 -8
- package/src/structures/ITtscGraphApplication.ts +124 -114
- package/src/structures/ITtscGraphDecorator.ts +4 -7
- package/src/structures/ITtscGraphDetails.ts +60 -46
- package/src/structures/ITtscGraphDump.ts +41 -11
- package/src/structures/ITtscGraphEdge.ts +4 -6
- package/src/structures/ITtscGraphEntrypoints.ts +10 -30
- package/src/structures/ITtscGraphEscape.ts +6 -19
- package/src/structures/ITtscGraphEvidence.ts +5 -8
- package/src/structures/ITtscGraphLookup.ts +9 -22
- package/src/structures/ITtscGraphNext.ts +10 -7
- package/src/structures/ITtscGraphNode.ts +18 -8
- package/src/structures/ITtscGraphOverview.ts +10 -17
- package/src/structures/ITtscGraphSpan.ts +33 -0
- package/src/structures/ITtscGraphTour.ts +70 -28
- package/src/structures/ITtscGraphTrace.ts +82 -51
- package/src/structures/TtscGraphEdgeKind.ts +7 -0
- package/src/structures/index.ts +1 -1
- package/src/view.ts +3 -1
- package/lib/server/accessAliases.d.ts +0 -8
- package/lib/server/accessAliases.js +0 -53
- package/lib/server/accessAliases.js.map +0 -1
- package/lib/server/resultGuide.d.ts +0 -3
- package/lib/server/resultGuide.js +0 -16
- package/lib/server/resultGuide.js.map +0 -1
- package/lib/structures/ITtscGraphDiagnostic.d.ts +0 -27
- package/lib/structures/ITtscGraphDiagnostic.js.map +0 -1
- package/src/server/accessAliases.ts +0 -55
- package/src/server/resultGuide.ts +0 -20
- package/src/structures/ITtscGraphDiagnostic.ts +0 -34
|
@@ -37,36 +37,53 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.createServer = createServer;
|
|
40
|
-
const
|
|
41
|
-
const
|
|
40
|
+
const _llmApplicationFinalize_1 = __importStar(require("typia/lib/internal/_llmApplicationFinalize"));
|
|
41
|
+
const _validateReport_1 = __importStar(require("typia/lib/internal/_validateReport"));
|
|
42
42
|
const mcp_1 = require("@typia/mcp");
|
|
43
43
|
const typia_1 = __importDefault(require("typia"));
|
|
44
44
|
const TtscGraphApplication_1 = require("../TtscGraphApplication");
|
|
45
45
|
/**
|
|
46
|
-
* Build the MCP server for a graph.
|
|
47
|
-
* {@link ITtscGraphApplication} into the tool schema and validator (no
|
|
48
|
-
* hand-written schema), and `createMcpServer` from `@typia/mcp` handles the
|
|
49
|
-
* list/call registration, argument validation, and structured output.
|
|
46
|
+
* Build the MCP server for a graph.
|
|
50
47
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
48
|
+
* `typia.llm.controller` reflects {@link ITtscGraphApplication} into the tool's
|
|
49
|
+
* input and output schemas and its argument validator, with no hand-written
|
|
50
|
+
* schema: the interface's JSDoc becomes the handshake instructions, the
|
|
51
|
+
* method's becomes the tool description, and every property's becomes the
|
|
52
|
+
* description of that field — including `audit`, whose JSDoc is how a caller
|
|
53
|
+
* learns what the server checked before it answered.
|
|
54
|
+
*
|
|
55
|
+
* The registration was hand-written here for a while, because a tool that
|
|
56
|
+
* declares an output schema must answer with `structuredContent` and the helper
|
|
57
|
+
* also serialized the same JSON into a text block: the payload crossed the wire
|
|
58
|
+
* twice, a client counted both copies against its tool-result cap, and a 30 KB
|
|
59
|
+
* tour arrived as 60 KB, blew the cap, and was spilled to a file the model then
|
|
60
|
+
* shelled out to read back. `@typia/mcp` 13.1.0 ships the structured result
|
|
61
|
+
* once (samchon/typia#2020), so the hand-written server had nothing left to fix
|
|
62
|
+
* and the library owns the registration again.
|
|
56
63
|
*/
|
|
57
64
|
function createServer(graph, version) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
void version;
|
|
66
|
+
return (0, mcp_1.createMcpServer)({
|
|
67
|
+
"protocol": "class",
|
|
68
|
+
"name": "ttsc-graph",
|
|
69
|
+
"execute": new TtscGraphApplication_1.TtscGraphApplication(graph),
|
|
70
|
+
"application": _llmApplicationFinalize_1._llmApplicationFinalize({
|
|
71
|
+
description: "## Code Graph MCP\n\n`inspect_typescript_graph` returns a compiler-built TypeScript graph contract\nfor the current on-disk source snapshot.\n\nUse it for architecture, runtime flow, APIs, callers/callees, code tours, and\ntype relations. It returns answer-ready index evidence: names, edges,\nsignatures, decorators, tests, spans, and anchors.\n\nEvery returned fact \u2014 each name, edge, signature, and span \u2014 is\ncompiler-resolved and verified for the snapshot that call synchronized, so\ntrust it without re-checking against files. Where an operation ranks a\nshortlist against your question (`lookup`, `entrypoints`, `tour`), the facts\nstay verified but the selection is heuristic: judge whether its coverage\nanswers you, and a follow-up request or a read of a cited span is fair when\nit does not.\n\n## Requests\n\nA request is a union: pick the single type below that best fits the question,\nand submit exactly that one.\n\n- `tour`: architecture, runtime flow, orientation, or a code tour. One call is\n the whole answer; do not split it. Name the machinery you expect it to be\n made of in its `reinterpretations`, or send none.\n- `entrypoints`: find where execution starts when entry points are unknown.\n- `lookup`: locate a named symbol.\n- `trace`: follow calls or data flow forward or backward from a symbol, or \u2014\n with `to` \u2014 the path between two symbols when both ends are known, which is\n the one call that answers \"how does A reach B\".\n- `details`: signatures, members, and relations of named symbols \u2014 including\n the classes that implement an interface, which is the one call that answers\n \"what actually implements this\".\n- `overview`: project layers and folder structure.\n- `escape`: the answer is outside the graph (source body text, non-TypeScript\n files, exact search).\n\n## Chain of Thought\n\nFill these fields in order before the call; each one narrows the reasoning\ntoward the single request you submit.\n\n- `question`: the code question, in the user's own words.\n- `draft`: `{ reason, type }` \u2014 why the smallest request that could answer it,\n then that request's `type`.\n- `review`: fix a broad, stale, or duplicate draft. If the graph already\n answered, or the evidence is outside it, escape.\n- `request`: the final choice. Each branch documents its own fields; fill them\n from what the branch says, not from what another branch wanted.\n\n## What to trust\n\nBefore source edits, every returned fact is compiler-resolved and verified.\nNever use extra graph calls, repository search, or file reads to doubt,\nfact-check, re-derive, re-narrate, or re-confirm a returned node, span, edge,\nsignature, decorator, test, reference, step, or anchor. The server resolved\neach one to the type-checked program for the snapshot the call synced to, and\n`audit` says so on every result.\n\nSelection is the separate question. `lookup`, `entrypoints`, and `tour` match\nyour question and return a scored, ranked, per-file-capped, limited\nshortlist; their facts are still verified, but whether the shortlist covers\nwhat you asked is yours to judge, and their `audit` says that instead of\nclaiming completeness. A follow-up request or a read of a cited span for\nmissed coverage is legitimate \u2014 re-confirming a fact the graph already\nresolved is not.\n\n## Stop\n\nLet the result's `next` set the pace, and do not re-confirm what the graph\nresolved.\n\n- A span is a citation, not a cue to open the file to re-check a fact.\n- Follow the result's `next`: `answer` means stop and answer from it, `inspect`\n means make exactly the one request it names, `outside` means escape,\n `clarify` means restate the request.\n- For a ranked shortlist (`lookup`, `entrypoints`, `tour`), `next` and\n `truncated` say whether coverage is settled; when it is not, one more\n request is the right move \u2014 not a file read to re-verify facts already\n given.",
|
|
63
72
|
functions: [
|
|
64
73
|
{
|
|
65
|
-
description: "
|
|
74
|
+
description: "Answer a TypeScript question from the compiler's own index of this\nrepository.\n\nThe graph holds every symbol, call, type, decorator and test, each with its\nfile and line, resolved from the source on disk now. Submit exactly one\nrequest:\n\n- `tour`: architecture, the runtime flow from the public API to the code that\n does the work, nearby paths, and the tests to read \u2014 a whole orientation\n in one call\n- `trace`: what a symbol calls, what calls it, or the path from A to B\n- `details`: signatures, members, and what implements an interface\n- `lookup`: where a named symbol is declared\n- `entrypoints`: where execution starts, when the entry is unknown\n- `overview`: the project's layers and folder structure\n\nEvery fact in a result is the checker's own resolution, audited before\nreturn, so no fact needs verifying; for the ranked operations (`lookup`,\n`entrypoints`, `tour`), judge whether the shortlist covers your question.\nRead a file for what the graph does not carry: a body, the text in a span.",
|
|
66
75
|
name: "inspect_typescript_graph",
|
|
67
76
|
output: {
|
|
68
77
|
type: "object",
|
|
69
78
|
properties: {
|
|
79
|
+
audit: {
|
|
80
|
+
type: "string",
|
|
81
|
+
description: "What the server audited this result against before returning it, in its\nown words: every node, span, edge, signature, member, and step in it\nresolves to the type-checked program for the snapshot the call synced to,\nso opening a file it cites only returns a fact already in it.\n\nThe audit is operation-aware. For the exact operations (`trace`,\n`details`, `overview`) it reports the result as the structure the graph\nholds for the handles named, bounded only where `truncated` says. For the\nranked operations (`lookup`, `entrypoints`, `tour`) it adds that the\nselection is heuristic \u2014 matched, scored, ranked, and limited against the\nquestion \u2014 so the facts are verified but the shortlist's coverage is the\ncaller's to judge."
|
|
82
|
+
},
|
|
83
|
+
next: {
|
|
84
|
+
$ref: "#/$defs/ITtscGraphNext",
|
|
85
|
+
description: "What to do with `result`: answer, inspect one named request, or escape."
|
|
86
|
+
},
|
|
70
87
|
result: {
|
|
71
88
|
anyOf: [
|
|
72
89
|
{
|
|
@@ -107,6 +124,8 @@ function createServer(graph, version) {
|
|
|
107
124
|
}
|
|
108
125
|
},
|
|
109
126
|
required: [
|
|
127
|
+
"audit",
|
|
128
|
+
"next",
|
|
110
129
|
"result"
|
|
111
130
|
],
|
|
112
131
|
additionalProperties: false,
|
|
@@ -132,7 +151,7 @@ function createServer(graph, version) {
|
|
|
132
151
|
"arguments"
|
|
133
152
|
],
|
|
134
153
|
additionalProperties: false,
|
|
135
|
-
description: "A decorator as written on a declaration, carried on the decorated\n's `decorators
|
|
154
|
+
description: "A decorator as written on a declaration, carried on the decorated\n's `decorators`. Reported faithfully, not interpreted\nper framework: `name` is the decorator as written (`Controller`, `Get`,\n`TypedRoute.Get`, ...), and statically resolvable literal arguments are\npreserved so a consumer applies its own meaning without re-parsing source."
|
|
136
155
|
},
|
|
137
156
|
"ITtscGraphDecorator.IArgument": {
|
|
138
157
|
type: "object",
|
|
@@ -173,31 +192,83 @@ function createServer(graph, version) {
|
|
|
173
192
|
},
|
|
174
193
|
description: "Selected node facts, in the same order as resolved handles when possible."
|
|
175
194
|
},
|
|
176
|
-
next: {
|
|
177
|
-
$ref: "#/$defs/ITtscGraphNext",
|
|
178
|
-
description: "How to use this source-free result next."
|
|
179
|
-
},
|
|
180
|
-
guide: {
|
|
181
|
-
type: "string",
|
|
182
|
-
description: "Human-readable compatibility note mirroring `next`."
|
|
183
|
-
},
|
|
184
195
|
unknown: {
|
|
185
196
|
type: "array",
|
|
186
197
|
items: {
|
|
187
198
|
type: "string"
|
|
188
199
|
},
|
|
189
|
-
description: "Handles
|
|
200
|
+
description: "Handles the graph holds no node for."
|
|
201
|
+
},
|
|
202
|
+
ambiguous: {
|
|
203
|
+
type: "array",
|
|
204
|
+
items: {
|
|
205
|
+
$ref: "#/$defs/ITtscGraphDetails.IAmbiguity"
|
|
206
|
+
},
|
|
207
|
+
description: "Handles that name more than one node, with the nodes they name.\n\nA name the graph knows twice is not a name the graph does not know: two\nclasses called `Workbench` are two facts, and answering \"unknown\" to a\nhandle the checker resolved twice sends the caller to the files for what is\nalready here. Re-call `details` with the `id` of the one the question\nmeans."
|
|
190
208
|
}
|
|
191
209
|
},
|
|
192
210
|
required: [
|
|
193
211
|
"type",
|
|
194
212
|
"nodes",
|
|
195
|
-
"next",
|
|
196
|
-
"guide",
|
|
197
213
|
"unknown"
|
|
198
214
|
],
|
|
199
215
|
additionalProperties: false,
|
|
200
|
-
description: "
|
|
216
|
+
description: "Source-free facts for a few selected handles, not a file reader: signatures,\nmember outlines, direct calls and types, implementation candidates,\ndependency summaries, and sourceSpan citation anchors."
|
|
217
|
+
},
|
|
218
|
+
"ITtscGraphDetails.IAmbiguity": {
|
|
219
|
+
type: "object",
|
|
220
|
+
properties: {
|
|
221
|
+
handle: {
|
|
222
|
+
type: "string",
|
|
223
|
+
description: "The handle as submitted."
|
|
224
|
+
},
|
|
225
|
+
candidates: {
|
|
226
|
+
type: "array",
|
|
227
|
+
items: {
|
|
228
|
+
$ref: "#/$defs/ITtscGraphDetails.ICandidate"
|
|
229
|
+
},
|
|
230
|
+
description: "Every node the handle names, each with the id to re-call `details` on."
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
required: [
|
|
234
|
+
"handle",
|
|
235
|
+
"candidates"
|
|
236
|
+
],
|
|
237
|
+
additionalProperties: false,
|
|
238
|
+
description: "One handle and the several nodes it names."
|
|
239
|
+
},
|
|
240
|
+
"ITtscGraphDetails.ICandidate": {
|
|
241
|
+
type: "object",
|
|
242
|
+
properties: {
|
|
243
|
+
id: {
|
|
244
|
+
type: "string",
|
|
245
|
+
description: "Stable node id: submit this as the handle to select this one."
|
|
246
|
+
},
|
|
247
|
+
name: {
|
|
248
|
+
type: "string",
|
|
249
|
+
description: "Qualified symbol name when available, otherwise the simple name."
|
|
250
|
+
},
|
|
251
|
+
kind: {
|
|
252
|
+
type: "string",
|
|
253
|
+
description: "Declaration kind (`class`, `method`, `function`, ...)."
|
|
254
|
+
},
|
|
255
|
+
file: {
|
|
256
|
+
type: "string",
|
|
257
|
+
description: "Project-relative path of the file that declares this node."
|
|
258
|
+
},
|
|
259
|
+
line: {
|
|
260
|
+
type: "number",
|
|
261
|
+
description: "1-based declaration line, when known."
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
required: [
|
|
265
|
+
"id",
|
|
266
|
+
"name",
|
|
267
|
+
"kind",
|
|
268
|
+
"file"
|
|
269
|
+
],
|
|
270
|
+
additionalProperties: false,
|
|
271
|
+
description: "One node a handle could mean: enough to choose, not to answer from."
|
|
201
272
|
},
|
|
202
273
|
"ITtscGraphDetails.IMember": {
|
|
203
274
|
type: "object",
|
|
@@ -260,6 +331,10 @@ function createServer(graph, version) {
|
|
|
260
331
|
type: "string",
|
|
261
332
|
description: "The declaration signature: its first line(s) up to the body."
|
|
262
333
|
},
|
|
334
|
+
doc: {
|
|
335
|
+
type: "string",
|
|
336
|
+
description: "The first sentence of the doc comment above the declaration."
|
|
337
|
+
},
|
|
263
338
|
decorators: {
|
|
264
339
|
type: "array",
|
|
265
340
|
items: {
|
|
@@ -304,7 +379,7 @@ function createServer(graph, version) {
|
|
|
304
379
|
items: {
|
|
305
380
|
$ref: "#/$defs/ITtscGraphDetails.IMember"
|
|
306
381
|
},
|
|
307
|
-
description: "
|
|
382
|
+
description: "Owned symbol or top-level property outline a consumer reaches for on a\ncontainer or object-literal variable, without bodies."
|
|
308
383
|
},
|
|
309
384
|
sourceSpan: {
|
|
310
385
|
$ref: "#/$defs/PickITtscGraphEvidenceendLinefilestartLine",
|
|
@@ -363,14 +438,7 @@ function createServer(graph, version) {
|
|
|
363
438
|
},
|
|
364
439
|
evidence: {
|
|
365
440
|
$ref: "#/$defs/ITtscGraphEvidence",
|
|
366
|
-
description: "Source span
|
|
367
|
-
},
|
|
368
|
-
aliases: {
|
|
369
|
-
type: "array",
|
|
370
|
-
items: {
|
|
371
|
-
type: "string"
|
|
372
|
-
},
|
|
373
|
-
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."
|
|
441
|
+
description: "Source span that produced the edge: citation evidence, not a file-read\ncue."
|
|
374
442
|
}
|
|
375
443
|
},
|
|
376
444
|
required: [
|
|
@@ -393,10 +461,6 @@ function createServer(graph, version) {
|
|
|
393
461
|
],
|
|
394
462
|
description: "Discriminator for first-pass question indexing."
|
|
395
463
|
},
|
|
396
|
-
query: {
|
|
397
|
-
type: "string",
|
|
398
|
-
description: "The original question/search phrase the entrypoints were built for."
|
|
399
|
-
},
|
|
400
464
|
hits: {
|
|
401
465
|
type: "array",
|
|
402
466
|
items: {
|
|
@@ -418,27 +482,16 @@ function createServer(graph, version) {
|
|
|
418
482
|
},
|
|
419
483
|
description: "Direct dependency context for the resolved mentions and highest hits."
|
|
420
484
|
},
|
|
421
|
-
next: {
|
|
422
|
-
$ref: "#/$defs/ITtscGraphNext",
|
|
423
|
-
description: "How to use this source-free result next."
|
|
424
|
-
},
|
|
425
|
-
guide: {
|
|
426
|
-
type: "string",
|
|
427
|
-
description: "Human-readable compatibility note mirroring `next`."
|
|
428
|
-
},
|
|
429
485
|
truncated: {
|
|
430
486
|
type: "boolean",
|
|
431
|
-
description: "True when
|
|
487
|
+
description: "True when some low-signal seeds or references were capped; the list stands."
|
|
432
488
|
}
|
|
433
489
|
},
|
|
434
490
|
required: [
|
|
435
491
|
"type",
|
|
436
|
-
"query",
|
|
437
492
|
"hits",
|
|
438
493
|
"mentions",
|
|
439
|
-
"neighborhood"
|
|
440
|
-
"next",
|
|
441
|
-
"guide"
|
|
494
|
+
"neighborhood"
|
|
442
495
|
],
|
|
443
496
|
additionalProperties: false,
|
|
444
497
|
description: "The first compact source-free handle list for a TypeScript code question."
|
|
@@ -650,7 +703,7 @@ function createServer(graph, version) {
|
|
|
650
703
|
},
|
|
651
704
|
evidence: {
|
|
652
705
|
$ref: "#/$defs/ITtscGraphEvidence",
|
|
653
|
-
description: "Source span for the
|
|
706
|
+
description: "Source span for the edge: shows why it exists without opening the file."
|
|
654
707
|
}
|
|
655
708
|
},
|
|
656
709
|
required: [
|
|
@@ -684,14 +737,6 @@ function createServer(graph, version) {
|
|
|
684
737
|
type: "string",
|
|
685
738
|
description: "Why no graph operation should run."
|
|
686
739
|
},
|
|
687
|
-
next: {
|
|
688
|
-
$ref: "#/$defs/ITtscGraphNext",
|
|
689
|
-
description: "How to proceed after skipping graph work."
|
|
690
|
-
},
|
|
691
|
-
guide: {
|
|
692
|
-
type: "string",
|
|
693
|
-
description: "Human-readable compatibility note mirroring `next`."
|
|
694
|
-
},
|
|
695
740
|
nextStep: {
|
|
696
741
|
type: "string",
|
|
697
742
|
description: "Optional note about the next non-graph step."
|
|
@@ -700,9 +745,7 @@ function createServer(graph, version) {
|
|
|
700
745
|
required: [
|
|
701
746
|
"type",
|
|
702
747
|
"skipped",
|
|
703
|
-
"reason"
|
|
704
|
-
"next",
|
|
705
|
-
"guide"
|
|
748
|
+
"reason"
|
|
706
749
|
],
|
|
707
750
|
additionalProperties: false,
|
|
708
751
|
description: "The no-op result for when graph is not the useful next evidence source."
|
|
@@ -736,7 +779,7 @@ function createServer(graph, version) {
|
|
|
736
779
|
"startLine"
|
|
737
780
|
],
|
|
738
781
|
additionalProperties: false,
|
|
739
|
-
description: "A source location
|
|
782
|
+
description: "A source location grounding a node or edge in real code: the declaration span\nfor a node, or the expression range that produced an edge. Display and\ngrounding only, never identity (a node's id is position-invariant, see\n). Lines and columns are 1-based; MCP keeps evidence as\ncoordinates, so read the file yourself when you truly need source text."
|
|
740
783
|
},
|
|
741
784
|
ITtscGraphLookup: {
|
|
742
785
|
type: "object",
|
|
@@ -754,21 +797,11 @@ function createServer(graph, version) {
|
|
|
754
797
|
$ref: "#/$defs/ITtscGraphLookup.IHit"
|
|
755
798
|
},
|
|
756
799
|
description: "Ranked symbol matches for the query."
|
|
757
|
-
},
|
|
758
|
-
next: {
|
|
759
|
-
$ref: "#/$defs/ITtscGraphNext",
|
|
760
|
-
description: "How to use this source-free result next."
|
|
761
|
-
},
|
|
762
|
-
guide: {
|
|
763
|
-
type: "string",
|
|
764
|
-
description: "Human-readable compatibility note mirroring `next`."
|
|
765
800
|
}
|
|
766
801
|
},
|
|
767
802
|
required: [
|
|
768
803
|
"type",
|
|
769
|
-
"hits"
|
|
770
|
-
"next",
|
|
771
|
-
"guide"
|
|
804
|
+
"hits"
|
|
772
805
|
],
|
|
773
806
|
additionalProperties: false,
|
|
774
807
|
description: "Targeted symbol lookup when a concrete name or handle is being resolved."
|
|
@@ -798,7 +831,7 @@ function createServer(graph, version) {
|
|
|
798
831
|
},
|
|
799
832
|
signature: {
|
|
800
833
|
type: "string",
|
|
801
|
-
description: "
|
|
834
|
+
description: "Declaration signature, often enough to answer without a `details` call."
|
|
802
835
|
},
|
|
803
836
|
decorators: {
|
|
804
837
|
type: "array",
|
|
@@ -833,7 +866,7 @@ function createServer(graph, version) {
|
|
|
833
866
|
"inspect",
|
|
834
867
|
"outside"
|
|
835
868
|
],
|
|
836
|
-
description: "
|
|
869
|
+
description: "What to do with this result:\n\n- `answer`: the result carries the evidence; stop and answer, do not call\n graph again or read files to re-check it\n- `inspect`: the result is genuinely partial; make exactly the one `request`\n named, once\n- `outside`: the answer is outside the graph; escape and read source\n- `clarify`: the request was malformed or ambiguous; restate it"
|
|
837
870
|
},
|
|
838
871
|
request: {
|
|
839
872
|
type: "string",
|
|
@@ -845,11 +878,11 @@ function createServer(graph, version) {
|
|
|
845
878
|
"tour",
|
|
846
879
|
"trace"
|
|
847
880
|
],
|
|
848
|
-
description: "
|
|
881
|
+
description: "The single graph request type to use when `action` is `inspect`."
|
|
849
882
|
},
|
|
850
883
|
reason: {
|
|
851
884
|
type: "string",
|
|
852
|
-
description: "Why the returned
|
|
885
|
+
description: "Why the returned evidence supports that action."
|
|
853
886
|
}
|
|
854
887
|
},
|
|
855
888
|
required: [
|
|
@@ -857,7 +890,7 @@ function createServer(graph, version) {
|
|
|
857
890
|
"reason"
|
|
858
891
|
],
|
|
859
892
|
additionalProperties: false,
|
|
860
|
-
description: "
|
|
893
|
+
description: "What to do with a compiler-derived graph result."
|
|
861
894
|
},
|
|
862
895
|
ITtscGraphOverview: {
|
|
863
896
|
type: "object",
|
|
@@ -877,14 +910,6 @@ function createServer(graph, version) {
|
|
|
877
910
|
$ref: "#/$defs/ITtscGraphOverview.ICounts",
|
|
878
911
|
description: "Size of the graph."
|
|
879
912
|
},
|
|
880
|
-
next: {
|
|
881
|
-
$ref: "#/$defs/ITtscGraphNext",
|
|
882
|
-
description: "How to use this source-free result next."
|
|
883
|
-
},
|
|
884
|
-
guide: {
|
|
885
|
-
type: "string",
|
|
886
|
-
description: "Human-readable compatibility note mirroring `next`."
|
|
887
|
-
},
|
|
888
913
|
layers: {
|
|
889
914
|
type: "array",
|
|
890
915
|
items: {
|
|
@@ -910,9 +935,7 @@ function createServer(graph, version) {
|
|
|
910
935
|
required: [
|
|
911
936
|
"type",
|
|
912
937
|
"project",
|
|
913
|
-
"counts"
|
|
914
|
-
"next",
|
|
915
|
-
"guide"
|
|
938
|
+
"counts"
|
|
916
939
|
],
|
|
917
940
|
additionalProperties: false,
|
|
918
941
|
description: "A compact, source-read-free project map for broad orientation only."
|
|
@@ -1056,10 +1079,6 @@ function createServer(graph, version) {
|
|
|
1056
1079
|
],
|
|
1057
1080
|
description: "Discriminator for code-tour indexing."
|
|
1058
1081
|
},
|
|
1059
|
-
query: {
|
|
1060
|
-
type: "string",
|
|
1061
|
-
description: "Natural code question this tour was built for."
|
|
1062
|
-
},
|
|
1063
1082
|
entrypoints: {
|
|
1064
1083
|
type: "array",
|
|
1065
1084
|
items: {
|
|
@@ -1095,29 +1114,18 @@ function createServer(graph, version) {
|
|
|
1095
1114
|
},
|
|
1096
1115
|
description: "Ordered file/line anchors to cite in the final answer, not file reads."
|
|
1097
1116
|
},
|
|
1098
|
-
next: {
|
|
1099
|
-
$ref: "#/$defs/ITtscGraphNext",
|
|
1100
|
-
description: "How to use this source-free result next."
|
|
1101
|
-
},
|
|
1102
|
-
guide: {
|
|
1103
|
-
type: "string",
|
|
1104
|
-
description: "Human-readable compatibility note mirroring `next`."
|
|
1105
|
-
},
|
|
1106
1117
|
truncated: {
|
|
1107
1118
|
type: "boolean",
|
|
1108
|
-
description: "True when
|
|
1119
|
+
description: "True when some low-signal extras were capped; the returned tour stands."
|
|
1109
1120
|
}
|
|
1110
1121
|
},
|
|
1111
1122
|
required: [
|
|
1112
1123
|
"type",
|
|
1113
|
-
"query",
|
|
1114
1124
|
"entrypoints",
|
|
1115
1125
|
"primaryFlow",
|
|
1116
1126
|
"nearby",
|
|
1117
1127
|
"tests",
|
|
1118
|
-
"answerAnchors"
|
|
1119
|
-
"next",
|
|
1120
|
-
"guide"
|
|
1128
|
+
"answerAnchors"
|
|
1121
1129
|
],
|
|
1122
1130
|
additionalProperties: false,
|
|
1123
1131
|
description: "Answer-ready, source-free tour evidence for broad code-flow questions."
|
|
@@ -1180,27 +1188,19 @@ function createServer(graph, version) {
|
|
|
1180
1188
|
reached: {
|
|
1181
1189
|
type: "array",
|
|
1182
1190
|
items: {
|
|
1183
|
-
$ref: "#/$defs/ITtscGraphTour.
|
|
1184
|
-
},
|
|
1185
|
-
description: "Nodes reached by this flow."
|
|
1186
|
-
},
|
|
1187
|
-
anchors: {
|
|
1188
|
-
type: "array",
|
|
1189
|
-
items: {
|
|
1190
|
-
$ref: "#/$defs/ITtscGraphTour.IAnchor"
|
|
1191
|
+
$ref: "#/$defs/ITtscGraphTour.IReached"
|
|
1191
1192
|
},
|
|
1192
|
-
description: "
|
|
1193
|
+
description: "Every node this flow reached, with the handle to call the graph with\nnext.\n\nA step is prose \u2014 it names both of its ends and the file and line the\ncall sits on \u2014 and it carries no handle. So the nodes a step names are\nlisted here too: `steps` is the story, `reached` is what to go on with."
|
|
1193
1194
|
},
|
|
1194
1195
|
truncated: {
|
|
1195
1196
|
type: "boolean",
|
|
1196
|
-
description: "True when
|
|
1197
|
+
description: "True when some low-signal flow steps were capped; the flow stands."
|
|
1197
1198
|
}
|
|
1198
1199
|
},
|
|
1199
1200
|
required: [
|
|
1200
1201
|
"start",
|
|
1201
1202
|
"steps",
|
|
1202
|
-
"reached"
|
|
1203
|
-
"anchors"
|
|
1203
|
+
"reached"
|
|
1204
1204
|
],
|
|
1205
1205
|
additionalProperties: false,
|
|
1206
1206
|
description: "A primary flow slice from one selected entrypoint."
|
|
@@ -1236,6 +1236,10 @@ function createServer(graph, version) {
|
|
|
1236
1236
|
type: "string",
|
|
1237
1237
|
description: "Declaration head, when available."
|
|
1238
1238
|
},
|
|
1239
|
+
doc: {
|
|
1240
|
+
type: "string",
|
|
1241
|
+
description: "The first sentence of the doc comment above the declaration: what the\nproject says this symbol is for. A name and an edge say what calls what;\nthis says why, which is what a tour is asked for."
|
|
1242
|
+
},
|
|
1239
1243
|
decorators: {
|
|
1240
1244
|
type: "array",
|
|
1241
1245
|
items: {
|
|
@@ -1253,6 +1257,29 @@ function createServer(graph, version) {
|
|
|
1253
1257
|
additionalProperties: false,
|
|
1254
1258
|
description: "A compact symbol coordinate for a tour."
|
|
1255
1259
|
},
|
|
1260
|
+
"ITtscGraphTour.IReached": {
|
|
1261
|
+
type: "object",
|
|
1262
|
+
properties: {
|
|
1263
|
+
id: {
|
|
1264
|
+
type: "string",
|
|
1265
|
+
description: "Stable node id for later graph calls: `file#Qualified.Name:kind`."
|
|
1266
|
+
},
|
|
1267
|
+
name: {
|
|
1268
|
+
type: "string",
|
|
1269
|
+
description: "Qualified symbol name when available, otherwise the simple name."
|
|
1270
|
+
},
|
|
1271
|
+
line: {
|
|
1272
|
+
type: "number",
|
|
1273
|
+
description: "1-based declaration line, when known."
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
required: [
|
|
1277
|
+
"id",
|
|
1278
|
+
"name"
|
|
1279
|
+
],
|
|
1280
|
+
additionalProperties: false,
|
|
1281
|
+
description: "A node a flow reached, as its handle and its declaration line.\n\nA node id _is_ its coordinates \u2014 `path/to/file.ts#Owner.member:kind` \u2014 so a\nreached node carrying `file` and `kind` beside it bought the same fact\nthree times. Across the benchmark corpus that repetition was 15% of every\ntour, and a tour is re-sent whole on every turn of the conversation it\nopened."
|
|
1282
|
+
},
|
|
1256
1283
|
"ITtscGraphTour.ISpan": {
|
|
1257
1284
|
type: "object",
|
|
1258
1285
|
properties: {
|
|
@@ -1310,7 +1337,7 @@ function createServer(graph, version) {
|
|
|
1310
1337
|
},
|
|
1311
1338
|
truncated: {
|
|
1312
1339
|
type: "boolean",
|
|
1313
|
-
description: "True when the trace hit
|
|
1340
|
+
description: "True when the trace hit its node or depth cap; the returned flow stands."
|
|
1314
1341
|
},
|
|
1315
1342
|
target: {
|
|
1316
1343
|
$ref: "#/$defs/ITtscGraphTrace.INode",
|
|
@@ -1321,7 +1348,7 @@ function createServer(graph, version) {
|
|
|
1321
1348
|
items: {
|
|
1322
1349
|
$ref: "#/$defs/ITtscGraphTrace.INode"
|
|
1323
1350
|
},
|
|
1324
|
-
description: "
|
|
1351
|
+
description: "Ordered dependency path from `from` to `to` when `to` was given (`from`\nfirst, `to` last), empty when `to` is unreachable."
|
|
1325
1352
|
},
|
|
1326
1353
|
steps: {
|
|
1327
1354
|
type: "array",
|
|
@@ -1330,13 +1357,12 @@ function createServer(graph, version) {
|
|
|
1330
1357
|
},
|
|
1331
1358
|
description: "Compact hop summaries preserving node names and edge evidence, capped."
|
|
1332
1359
|
},
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
description: "Human-readable compatibility note mirroring `next`."
|
|
1360
|
+
junctions: {
|
|
1361
|
+
type: "array",
|
|
1362
|
+
items: {
|
|
1363
|
+
$ref: "#/$defs/ITtscGraphTrace.IJunction"
|
|
1364
|
+
},
|
|
1365
|
+
description: "Symbols both ends touch, when no call path runs between them.\n\nNothing calls across the gap because in an event-driven codebase nothing\ndoes: a handler registers a listener on an emitter, the emitter's `emit()`\nruns whatever a registration put in an array, and no call edge crosses that\narray. But both ends touch the emitter, and that is an edge, not a guess \u2014\nExcalidraw's pointer handler and its store's emit both reference\n`Store.onDurableIncrementEmitter`, which is exactly the seam the call graph\ncannot walk.\n\nA junction is not a path. It is the symbol to look at next, and the edges\nthat say why."
|
|
1340
1366
|
},
|
|
1341
1367
|
candidates: {
|
|
1342
1368
|
type: "array",
|
|
@@ -1351,9 +1377,7 @@ function createServer(graph, version) {
|
|
|
1351
1377
|
"direction",
|
|
1352
1378
|
"hops",
|
|
1353
1379
|
"reached",
|
|
1354
|
-
"truncated"
|
|
1355
|
-
"next",
|
|
1356
|
-
"guide"
|
|
1380
|
+
"truncated"
|
|
1357
1381
|
],
|
|
1358
1382
|
additionalProperties: false,
|
|
1359
1383
|
description: "The compact dependency or caller flow returned from a selected start symbol."
|
|
@@ -1379,14 +1403,7 @@ function createServer(graph, version) {
|
|
|
1379
1403
|
},
|
|
1380
1404
|
evidence: {
|
|
1381
1405
|
$ref: "#/$defs/ITtscGraphEvidence",
|
|
1382
|
-
description: "Source span
|
|
1383
|
-
},
|
|
1384
|
-
aliases: {
|
|
1385
|
-
type: "array",
|
|
1386
|
-
items: {
|
|
1387
|
-
type: "string"
|
|
1388
|
-
},
|
|
1389
|
-
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."
|
|
1406
|
+
description: "Source span that produced the hop: citable without opening the file."
|
|
1390
1407
|
}
|
|
1391
1408
|
},
|
|
1392
1409
|
required: [
|
|
@@ -1398,6 +1415,72 @@ function createServer(graph, version) {
|
|
|
1398
1415
|
additionalProperties: false,
|
|
1399
1416
|
description: "One traversed edge, with its depth from the start."
|
|
1400
1417
|
},
|
|
1418
|
+
"ITtscGraphTrace.IJunction": {
|
|
1419
|
+
type: "object",
|
|
1420
|
+
properties: {
|
|
1421
|
+
id: {
|
|
1422
|
+
type: "string",
|
|
1423
|
+
description: "Stable node id: trace or inspect this symbol to cross the seam."
|
|
1424
|
+
},
|
|
1425
|
+
name: {
|
|
1426
|
+
type: "string",
|
|
1427
|
+
description: "Qualified symbol name when available, otherwise the simple name."
|
|
1428
|
+
},
|
|
1429
|
+
kind: {
|
|
1430
|
+
type: "string",
|
|
1431
|
+
description: "Declaration kind (`variable`, `method`, `class`, ...)."
|
|
1432
|
+
},
|
|
1433
|
+
file: {
|
|
1434
|
+
type: "string",
|
|
1435
|
+
description: "Project-relative path of the file that declares it."
|
|
1436
|
+
},
|
|
1437
|
+
line: {
|
|
1438
|
+
type: "number",
|
|
1439
|
+
description: "1-based declaration line, when known."
|
|
1440
|
+
},
|
|
1441
|
+
fromStart: {
|
|
1442
|
+
$ref: "#/$defs/ITtscGraphTrace.IJunctionEdge",
|
|
1443
|
+
description: "How the start reaches it: the edge kind, and where that edge sits."
|
|
1444
|
+
},
|
|
1445
|
+
fromTarget: {
|
|
1446
|
+
$ref: "#/$defs/ITtscGraphTrace.IJunctionEdge",
|
|
1447
|
+
description: "How the target reaches it, or is reached from it."
|
|
1448
|
+
}
|
|
1449
|
+
},
|
|
1450
|
+
required: [
|
|
1451
|
+
"id",
|
|
1452
|
+
"name",
|
|
1453
|
+
"kind",
|
|
1454
|
+
"file",
|
|
1455
|
+
"fromStart",
|
|
1456
|
+
"fromTarget"
|
|
1457
|
+
],
|
|
1458
|
+
additionalProperties: false,
|
|
1459
|
+
description: "A symbol both ends of an unreachable path touch, and how each touches it."
|
|
1460
|
+
},
|
|
1461
|
+
"ITtscGraphTrace.IJunctionEdge": {
|
|
1462
|
+
type: "object",
|
|
1463
|
+
properties: {
|
|
1464
|
+
kind: {
|
|
1465
|
+
type: "string",
|
|
1466
|
+
description: "`calls`, `accesses`, `instantiates`, `type_ref`, ..."
|
|
1467
|
+
},
|
|
1468
|
+
outgoing: {
|
|
1469
|
+
type: "boolean",
|
|
1470
|
+
description: "True when the end is the edge's source, false when it is the target."
|
|
1471
|
+
},
|
|
1472
|
+
evidence: {
|
|
1473
|
+
$ref: "#/$defs/ITtscGraphEvidence",
|
|
1474
|
+
description: "Where the reference sits in source."
|
|
1475
|
+
}
|
|
1476
|
+
},
|
|
1477
|
+
required: [
|
|
1478
|
+
"kind",
|
|
1479
|
+
"outgoing"
|
|
1480
|
+
],
|
|
1481
|
+
additionalProperties: false,
|
|
1482
|
+
description: "One edge between an end of the requested path and the junction."
|
|
1483
|
+
},
|
|
1401
1484
|
"ITtscGraphTrace.INode": {
|
|
1402
1485
|
type: "object",
|
|
1403
1486
|
properties: {
|
|
@@ -1487,15 +1570,15 @@ function createServer(graph, version) {
|
|
|
1487
1570
|
properties: {
|
|
1488
1571
|
question: {
|
|
1489
1572
|
type: "string",
|
|
1490
|
-
description: "
|
|
1573
|
+
description: "The code question, in the user's own words.\n\nCut a long message down to the sentences that state the ask, but keep\ntheir terms: the graph ranks against these words, so a rewrite ranks a\ndifferent answer."
|
|
1491
1574
|
},
|
|
1492
1575
|
draft: {
|
|
1493
1576
|
$ref: "#/$defs/ITtscGraphApplication.IDraft",
|
|
1494
|
-
description: "
|
|
1577
|
+
description: "The smallest request that could answer, and why."
|
|
1495
1578
|
},
|
|
1496
1579
|
review: {
|
|
1497
1580
|
type: "string",
|
|
1498
|
-
description: "
|
|
1581
|
+
description: "Correct the draft. Escape if the graph already answered, or the next\nevidence is outside the graph."
|
|
1499
1582
|
},
|
|
1500
1583
|
request: {
|
|
1501
1584
|
anyOf: [
|
|
@@ -1521,7 +1604,7 @@ function createServer(graph, version) {
|
|
|
1521
1604
|
$ref: "#/$defs/ITtscGraphEscape.IRequest"
|
|
1522
1605
|
}
|
|
1523
1606
|
],
|
|
1524
|
-
description: "Final graph
|
|
1607
|
+
description: "Final graph request chosen after review, or a no-op escape.",
|
|
1525
1608
|
"x-discriminator": {
|
|
1526
1609
|
mapping: {
|
|
1527
1610
|
details: "#/$defs/ITtscGraphDetails.IRequest",
|
|
@@ -1550,7 +1633,7 @@ function createServer(graph, version) {
|
|
|
1550
1633
|
properties: {
|
|
1551
1634
|
reason: {
|
|
1552
1635
|
type: "string",
|
|
1553
|
-
description: "Why this
|
|
1636
|
+
description: "Why this is the smallest useful next step."
|
|
1554
1637
|
},
|
|
1555
1638
|
type: {
|
|
1556
1639
|
type: "string",
|
|
@@ -1563,7 +1646,7 @@ function createServer(graph, version) {
|
|
|
1563
1646
|
"tour",
|
|
1564
1647
|
"trace"
|
|
1565
1648
|
],
|
|
1566
|
-
description: "The request type being considered
|
|
1649
|
+
description: "The request type being considered."
|
|
1567
1650
|
}
|
|
1568
1651
|
},
|
|
1569
1652
|
required: [
|
|
@@ -1571,7 +1654,7 @@ function createServer(graph, version) {
|
|
|
1571
1654
|
"type"
|
|
1572
1655
|
],
|
|
1573
1656
|
additionalProperties: false,
|
|
1574
|
-
description: "First-pass
|
|
1657
|
+
description: "First-pass plan; `reason` precedes `type` so it is written first."
|
|
1575
1658
|
},
|
|
1576
1659
|
"ITtscGraphDetails.IRequest": {
|
|
1577
1660
|
type: "object",
|
|
@@ -1588,27 +1671,27 @@ function createServer(graph, version) {
|
|
|
1588
1671
|
items: {
|
|
1589
1672
|
type: "string"
|
|
1590
1673
|
},
|
|
1591
|
-
description: "Node ids
|
|
1674
|
+
description: "Node ids or dotted symbol handles (`OrderService.create`). Prefer one to\nthree; use `trace` for a path instead of widening this call."
|
|
1592
1675
|
},
|
|
1593
1676
|
neighbors: {
|
|
1594
1677
|
type: "boolean",
|
|
1595
|
-
description: "Also list each node's direct dependencies and dependents (
|
|
1678
|
+
description: "Also list each node's direct dependencies and dependents (symbols it uses\nand symbols that use it), capped. A relationship summary, not a file\nbody."
|
|
1596
1679
|
},
|
|
1597
1680
|
neighborLimit: {
|
|
1598
1681
|
type: "number",
|
|
1599
|
-
description: "Maximum dependencies and dependents
|
|
1682
|
+
description: "Maximum dependencies and dependents per side when `neighbors:true`. Above\na few is usually overfetch; call `trace` for flow instead."
|
|
1600
1683
|
},
|
|
1601
1684
|
memberLimit: {
|
|
1602
1685
|
type: "number",
|
|
1603
|
-
description: "Maximum owned members
|
|
1686
|
+
description: "Maximum owned members for a container or object literal."
|
|
1604
1687
|
},
|
|
1605
1688
|
dependencyLimit: {
|
|
1606
1689
|
type: "number",
|
|
1607
|
-
description: "Maximum direct execution and type references
|
|
1690
|
+
description: "Maximum direct execution and type references per group."
|
|
1608
1691
|
},
|
|
1609
1692
|
includeExternal: {
|
|
1610
1693
|
type: "boolean",
|
|
1611
|
-
description: "Include dependency-boundary references from node_modules or bundled\n`.d.ts` libraries.
|
|
1694
|
+
description: "Include dependency-boundary references from node_modules or bundled\n`.d.ts` libraries. Enable only when external type/API boundaries are the\nquestion."
|
|
1612
1695
|
}
|
|
1613
1696
|
},
|
|
1614
1697
|
required: [
|
|
@@ -1630,15 +1713,15 @@ function createServer(graph, version) {
|
|
|
1630
1713
|
},
|
|
1631
1714
|
query: {
|
|
1632
1715
|
type: "string",
|
|
1633
|
-
description: "A natural code question or search phrase
|
|
1716
|
+
description: "A natural code question or search phrase, prose mixed with code handles\n(`how Repository.find loads relations`). Keep it close to the user's\nquestion, not a broad keyword dump."
|
|
1634
1717
|
},
|
|
1635
1718
|
limit: {
|
|
1636
1719
|
type: "number",
|
|
1637
|
-
description: "Maximum ranked hits to return
|
|
1720
|
+
description: "Maximum ranked hits to return."
|
|
1638
1721
|
},
|
|
1639
1722
|
neighbors: {
|
|
1640
1723
|
type: "number",
|
|
1641
|
-
description: "Maximum direct dependencies and dependents
|
|
1724
|
+
description: "Maximum direct dependencies and dependents per indexed symbol. An\norientation slice, not a dependency dump; use `trace` or `details` with\n`neighbors:true` after choosing the specific handles."
|
|
1642
1725
|
}
|
|
1643
1726
|
},
|
|
1644
1727
|
required: [
|
|
@@ -1646,7 +1729,7 @@ function createServer(graph, version) {
|
|
|
1646
1729
|
"query"
|
|
1647
1730
|
],
|
|
1648
1731
|
additionalProperties: false,
|
|
1649
|
-
description: "
|
|
1732
|
+
description: "First handles when the question is narrow but the symbol name is not yet\nknown."
|
|
1650
1733
|
},
|
|
1651
1734
|
"ITtscGraphEscape.IRequest": {
|
|
1652
1735
|
type: "object",
|
|
@@ -1660,11 +1743,11 @@ function createServer(graph, version) {
|
|
|
1660
1743
|
},
|
|
1661
1744
|
reason: {
|
|
1662
1745
|
type: "string",
|
|
1663
|
-
description: "Why no graph operation should run
|
|
1746
|
+
description: "Why no graph operation should run. Use only when the next evidence is\noutside the indexed graph: package scripts, config files, generated\noutput, prose docs, exact text, or source body text. Name the smallest\nreturned sourceSpan when source body text is truly required."
|
|
1664
1747
|
},
|
|
1665
1748
|
nextStep: {
|
|
1666
1749
|
type: "string",
|
|
1667
|
-
description: "
|
|
1750
|
+
description: "A short final non-graph note, if useful, for example `answer from the\nprior graph result` or `source body needed at returned sourceSpan`."
|
|
1668
1751
|
}
|
|
1669
1752
|
},
|
|
1670
1753
|
required: [
|
|
@@ -1686,15 +1769,15 @@ function createServer(graph, version) {
|
|
|
1686
1769
|
},
|
|
1687
1770
|
query: {
|
|
1688
1771
|
type: "string",
|
|
1689
|
-
description: "What to find
|
|
1772
|
+
description: "What to find: a symbol name, a dotted member (`Service.create`), or a\nshort phrase (`request handler`). Exact names are not required, but this\nis not a second broad entrypoints call; use it for a missing or ambiguous\nnamed handle."
|
|
1690
1773
|
},
|
|
1691
1774
|
limit: {
|
|
1692
1775
|
type: "number",
|
|
1693
|
-
description: "Maximum hits to return
|
|
1776
|
+
description: "Maximum hits to return. A large hit list usually means the query is too\nbroad; refine the name instead of raising this."
|
|
1694
1777
|
},
|
|
1695
1778
|
includeExternal: {
|
|
1696
1779
|
type: "boolean",
|
|
1697
|
-
description: "Include dependency-boundary declarations from node_modules or bundled\n`.d.ts` libraries.
|
|
1780
|
+
description: "Include dependency-boundary declarations from node_modules or bundled\n`.d.ts` libraries. Enable only when external type/API boundaries are the\nquestion."
|
|
1698
1781
|
}
|
|
1699
1782
|
},
|
|
1700
1783
|
required: [
|
|
@@ -1722,7 +1805,7 @@ function createServer(graph, version) {
|
|
|
1722
1805
|
"layers",
|
|
1723
1806
|
"publicApi"
|
|
1724
1807
|
],
|
|
1725
|
-
description: "
|
|
1808
|
+
description: "Facet to project, or `all` for every facet:\n\n- `layers`: folder layering\n- `hotspots`: highest-dependency symbols\n- `publicApi`: exported API symbols ranked by how depended-on they are\n\nBroad public-API or layer orientation only. For behavior, lifecycle,\nrequest/render/validation flow, caller, or dependency questions, use\n`entrypoints` then `trace`."
|
|
1726
1809
|
}
|
|
1727
1810
|
},
|
|
1728
1811
|
required: [
|
|
@@ -1741,13 +1824,16 @@ function createServer(graph, version) {
|
|
|
1741
1824
|
],
|
|
1742
1825
|
description: "Discriminator for code-tour indexing."
|
|
1743
1826
|
},
|
|
1744
|
-
|
|
1745
|
-
type: "
|
|
1746
|
-
|
|
1827
|
+
reinterpretations: {
|
|
1828
|
+
type: "array",
|
|
1829
|
+
items: {
|
|
1830
|
+
type: "string"
|
|
1831
|
+
},
|
|
1832
|
+
description: "Symbol names, never a sentence: the machinery you expect the answer to be\nmade of, spelled the way this codebase would spell it. A question about\nhow a job reaches a worker is reinterpreted as `[\"JobQueue.push\",\n\"Scheduler.tick\", \"Worker.run\", \"drainQueue\"]`.\n\nWrite them from the question, before you have seen a line of the code. A\ncodebase names many things alike, and the question's own words cannot\ntell them apart: a question about _tracking_ matches the debug hook named\nafter tracking as readily as the function that does it, and one about a\n_request_ matches a message listener as readily as an HTTP router. The\nnames say which you meant.\n\nEach is resolved like a handle \u2014 a symbol name, a `Class.member`. The\nones the graph holds take half the tour's entrypoints, the rest stays\nwith what the graph finds central, and a name it does not know, or knows\nseveral of, is dropped. So a wrong guess costs nothing, and a specific\nname is worth more than a general one: `drainQueue` resolves, `queue`\ndoes not.\n\nSend `[]` when the question names no machinery \u2014 \"show me the central\nflow\" in a repository you have never seen. There is nothing to\nreinterpret then: the tour ranks on structure, which is what that\nquestion asks for. Do not look names up first to fill this."
|
|
1747
1833
|
},
|
|
1748
1834
|
limit: {
|
|
1749
1835
|
type: "number",
|
|
1750
|
-
description: "
|
|
1836
|
+
description: "Central entrypoints to seed the tour. Raise only when the question names\nseveral public paths that must all appear in one answer."
|
|
1751
1837
|
},
|
|
1752
1838
|
includeTests: {
|
|
1753
1839
|
type: "boolean",
|
|
@@ -1756,10 +1842,10 @@ function createServer(graph, version) {
|
|
|
1756
1842
|
},
|
|
1757
1843
|
required: [
|
|
1758
1844
|
"type",
|
|
1759
|
-
"
|
|
1845
|
+
"reinterpretations"
|
|
1760
1846
|
],
|
|
1761
1847
|
additionalProperties: false,
|
|
1762
|
-
description: "
|
|
1848
|
+
description: "A broad code tour: entrypoints, primary flow, nearby paths, and tests.\n\nIt asks for no question of its own \u2014 it ranks against the `question` the\ncaller has already written, in the user's words."
|
|
1763
1849
|
},
|
|
1764
1850
|
"ITtscGraphTrace.IRequest": {
|
|
1765
1851
|
type: "object",
|
|
@@ -1773,11 +1859,11 @@ function createServer(graph, version) {
|
|
|
1773
1859
|
},
|
|
1774
1860
|
from: {
|
|
1775
1861
|
type: "string",
|
|
1776
|
-
description: "Where to start: a node id
|
|
1862
|
+
description: "Where to start: a node id, a simple symbol name, or a dotted member\n(`OrderService.create`). An ambiguous name returns its candidates instead\nof a trace."
|
|
1777
1863
|
},
|
|
1778
1864
|
to: {
|
|
1779
1865
|
type: "string",
|
|
1780
|
-
description: "
|
|
1866
|
+
description: "Target symbol (node id, simple name, or dotted member). When given, the\ntool returns the dependency path from `from` to it, the one-call answer\nfor \"how does A reach B\". Prefer this path mode whenever both ends are\nknown."
|
|
1781
1867
|
},
|
|
1782
1868
|
direction: {
|
|
1783
1869
|
type: "string",
|
|
@@ -1786,7 +1872,7 @@ function createServer(graph, version) {
|
|
|
1786
1872
|
"impact",
|
|
1787
1873
|
"reverse"
|
|
1788
1874
|
],
|
|
1789
|
-
description: "`forward
|
|
1875
|
+
description: "Trace direction:\n\n- `forward`: what the start uses (callees, instantiations, renders)\n- `reverse`: what uses the start (callers); the usual fit for caller\n questions\n- `impact`: reverse trace prioritizing public API and test nodes a change\n reaches; its test nodes are semantic usage edges, not a text search"
|
|
1790
1876
|
},
|
|
1791
1877
|
focus: {
|
|
1792
1878
|
type: "string",
|
|
@@ -1795,19 +1881,19 @@ function createServer(graph, version) {
|
|
|
1795
1881
|
"execution",
|
|
1796
1882
|
"types"
|
|
1797
1883
|
],
|
|
1798
|
-
description: "
|
|
1884
|
+
description: "Non-structural edge family to follow:\n\n- `execution`: runtime calls, instantiations, property access, JSX renders\n- `types`: type references and inheritance\n- `all`: the full graph\n\nFlow questions usually want `execution`, not `all`."
|
|
1799
1885
|
},
|
|
1800
1886
|
maxDepth: {
|
|
1801
1887
|
type: "number",
|
|
1802
|
-
description: "
|
|
1888
|
+
description: "Hops deep to follow (open forward/reverse cap at 8, impact at 4, path\nmode at 12). Raise it to follow a runtime chain to its end in one call."
|
|
1803
1889
|
},
|
|
1804
1890
|
maxNodes: {
|
|
1805
1891
|
type: "number",
|
|
1806
|
-
description: "Cap on reached nodes
|
|
1892
|
+
description: "Cap on reached nodes (open forward/reverse cap at 32, impact at 16)."
|
|
1807
1893
|
},
|
|
1808
1894
|
includeExternal: {
|
|
1809
1895
|
type: "boolean",
|
|
1810
|
-
description: "Include dependency-boundary nodes from node_modules or bundled `.d.ts`\nlibraries.
|
|
1896
|
+
description: "Include dependency-boundary nodes from node_modules or bundled `.d.ts`\nlibraries. Enable only for questions about external type/API boundaries."
|
|
1811
1897
|
}
|
|
1812
1898
|
},
|
|
1813
1899
|
required: [
|
|
@@ -1852,7 +1938,7 @@ function createServer(graph, version) {
|
|
|
1852
1938
|
const _io3 = input => "entrypoints" === input.type && _ip2(input) && _ip3(input) && (undefined === input.neighbors || "number" === typeof input.neighbors);
|
|
1853
1939
|
const _io4 = input => "lookup" === input.type && _ip2(input) && _ip3(input) && _ip1(input);
|
|
1854
1940
|
const _io5 = input => "overview" === input.type && (undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect);
|
|
1855
|
-
const _io6 = input => "tour" === input.type &&
|
|
1941
|
+
const _io6 = input => "tour" === input.type && (Array.isArray(input.reinterpretations) && input.reinterpretations.every(elem => "string" === typeof elem)) && _ip3(input) && (undefined === input.includeTests || "boolean" === typeof input.includeTests);
|
|
1856
1942
|
const _io7 = input => "trace" === input.type && "string" === typeof input.from && (undefined === input.to || "string" === typeof input.to) && (undefined === input.direction || "forward" === input.direction || "impact" === input.direction || "reverse" === input.direction) && (undefined === input.focus || "all" === input.focus || "execution" === input.focus || "types" === input.focus) && (undefined === input.maxDepth || "number" === typeof input.maxDepth) && (undefined === input.maxNodes || "number" === typeof input.maxNodes) && _ip1(input);
|
|
1857
1943
|
const _io8 = input => "escape" === input.type && _ip0(input) && (undefined === input.nextStep || "string" === typeof input.nextStep);
|
|
1858
1944
|
const _iu0 = input => (() => {
|
|
@@ -1911,8 +1997,8 @@ function createServer(graph, version) {
|
|
|
1911
1997
|
path: _path + ".handles",
|
|
1912
1998
|
expected: "Array<string>",
|
|
1913
1999
|
value: input.handles
|
|
1914
|
-
})) && input.handles.map((elem,
|
|
1915
|
-
path: _path + ".handles[" +
|
|
2000
|
+
})) && input.handles.map((elem, _index3) => "string" === typeof elem || _report(_exceptionable, {
|
|
2001
|
+
path: _path + ".handles[" + _index3 + "]",
|
|
1916
2002
|
expected: "string",
|
|
1917
2003
|
value: elem
|
|
1918
2004
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1963,7 +2049,19 @@ function createServer(graph, version) {
|
|
|
1963
2049
|
path: _path + ".type",
|
|
1964
2050
|
expected: "\"tour\"",
|
|
1965
2051
|
value: input.type
|
|
1966
|
-
}),
|
|
2052
|
+
}), (Array.isArray(input.reinterpretations) || _report(_exceptionable, {
|
|
2053
|
+
path: _path + ".reinterpretations",
|
|
2054
|
+
expected: "Array<string>",
|
|
2055
|
+
value: input.reinterpretations
|
|
2056
|
+
})) && input.reinterpretations.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
|
|
2057
|
+
path: _path + ".reinterpretations[" + _index4 + "]",
|
|
2058
|
+
expected: "string",
|
|
2059
|
+
value: elem
|
|
2060
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
2061
|
+
path: _path + ".reinterpretations",
|
|
2062
|
+
expected: "Array<string>",
|
|
2063
|
+
value: input.reinterpretations
|
|
2064
|
+
}), _vp3(input, _path, true && _exceptionable), undefined === input.includeTests || "boolean" === typeof input.includeTests || _report(_exceptionable, {
|
|
1967
2065
|
path: _path + ".includeTests",
|
|
1968
2066
|
expected: "(boolean | undefined)",
|
|
1969
2067
|
value: input.includeTests
|
|
@@ -2034,7 +2132,7 @@ function createServer(graph, version) {
|
|
|
2034
2132
|
return input => {
|
|
2035
2133
|
if (false === __is(input)) {
|
|
2036
2134
|
errors = [];
|
|
2037
|
-
_report =
|
|
2135
|
+
_report = _validateReport_1._validateReport(errors);
|
|
2038
2136
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
2039
2137
|
path: _path + "",
|
|
2040
2138
|
expected: "ITtscGraphApplication.IProps",
|
|
@@ -2062,9 +2160,7 @@ function createServer(graph, version) {
|
|
|
2062
2160
|
})()
|
|
2063
2161
|
}
|
|
2064
2162
|
]
|
|
2065
|
-
})
|
|
2066
|
-
|
|
2067
|
-
};
|
|
2068
|
-
return (0, mcp_1.createMcpServer)(controller, version);
|
|
2163
|
+
})
|
|
2164
|
+
});
|
|
2069
2165
|
}
|
|
2070
2166
|
//# sourceMappingURL=createServer.js.map
|