@ttsc/graph 0.18.4 → 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.
Files changed (119) hide show
  1. package/README.md +231 -37
  2. package/lib/TtscGraphApplication.d.ts +1 -1
  3. package/lib/TtscGraphApplication.js +50 -17
  4. package/lib/TtscGraphApplication.js.map +1 -1
  5. package/lib/index.d.ts +5 -0
  6. package/lib/index.js +20 -1
  7. package/lib/index.js.map +1 -1
  8. package/lib/model/TtscGraphMemory.js +80 -22
  9. package/lib/model/TtscGraphMemory.js.map +1 -1
  10. package/lib/model/TtscGraphSession.js +92 -138
  11. package/lib/model/TtscGraphSession.js.map +1 -1
  12. package/lib/model/loadGraph.js +91 -138
  13. package/lib/model/loadGraph.js.map +1 -1
  14. package/lib/resolveGraphBinary.d.ts +4 -2
  15. package/lib/resolveGraphBinary.js +7 -3
  16. package/lib/resolveGraphBinary.js.map +1 -1
  17. package/lib/server/createServer.d.ts +16 -9
  18. package/lib/server/createServer.js +286 -190
  19. package/lib/server/createServer.js.map +1 -1
  20. package/lib/server/exportSurface.d.ts +26 -0
  21. package/lib/server/exportSurface.js +44 -0
  22. package/lib/server/exportSurface.js.map +1 -0
  23. package/lib/server/resolveHandle.d.ts +26 -1
  24. package/lib/server/resolveHandle.js +124 -4
  25. package/lib/server/resolveHandle.js.map +1 -1
  26. package/lib/server/resultAudit.d.ts +74 -0
  27. package/lib/server/resultAudit.js +110 -0
  28. package/lib/server/resultAudit.js.map +1 -0
  29. package/lib/server/resultNext.d.ts +9 -0
  30. package/lib/server/resultNext.js +11 -0
  31. package/lib/server/resultNext.js.map +1 -0
  32. package/lib/server/runDetails.d.ts +15 -3
  33. package/lib/server/runDetails.js +105 -23
  34. package/lib/server/runDetails.js.map +1 -1
  35. package/lib/server/runEntrypoints.d.ts +2 -1
  36. package/lib/server/runEntrypoints.js +17 -10
  37. package/lib/server/runEntrypoints.js.map +1 -1
  38. package/lib/server/runLookup.d.ts +2 -1
  39. package/lib/server/runLookup.js +21 -9
  40. package/lib/server/runLookup.js.map +1 -1
  41. package/lib/server/runOverview.d.ts +2 -1
  42. package/lib/server/runOverview.js +5 -4
  43. package/lib/server/runOverview.js.map +1 -1
  44. package/lib/server/runTour.d.ts +2 -1
  45. package/lib/server/runTour.js +707 -331
  46. package/lib/server/runTour.js.map +1 -1
  47. package/lib/server/runTrace.d.ts +2 -1
  48. package/lib/server/runTrace.js +234 -54
  49. package/lib/server/runTrace.js.map +1 -1
  50. package/lib/structures/ITtscGraphApplication.d.ts +122 -118
  51. package/lib/structures/ITtscGraphDecorator.d.ts +4 -7
  52. package/lib/structures/ITtscGraphDetails.d.ts +51 -43
  53. package/lib/structures/ITtscGraphDump.d.ts +32 -8
  54. package/lib/structures/ITtscGraphEdge.d.ts +4 -6
  55. package/lib/structures/ITtscGraphEntrypoints.d.ts +10 -27
  56. package/lib/structures/ITtscGraphEscape.d.ts +6 -16
  57. package/lib/structures/ITtscGraphEvidence.d.ts +5 -8
  58. package/lib/structures/ITtscGraphLookup.d.ts +9 -20
  59. package/lib/structures/ITtscGraphNext.d.ts +10 -7
  60. package/lib/structures/ITtscGraphNode.d.ts +17 -8
  61. package/lib/structures/ITtscGraphOverview.d.ts +10 -14
  62. package/lib/structures/ITtscGraphSpan.d.ts +29 -0
  63. package/lib/structures/{ITtscGraphDiagnostic.js → ITtscGraphSpan.js} +1 -1
  64. package/lib/structures/ITtscGraphSpan.js.map +1 -0
  65. package/lib/structures/ITtscGraphTour.d.ts +65 -23
  66. package/lib/structures/ITtscGraphTrace.d.ts +72 -49
  67. package/lib/structures/TtscGraphEdgeKind.d.ts +7 -1
  68. package/lib/structures/index.d.ts +1 -1
  69. package/lib/structures/index.js +1 -1
  70. package/lib/structures/index.js.map +1 -1
  71. package/lib/view.js +3 -1
  72. package/lib/view.js.map +1 -1
  73. package/package.json +4 -4
  74. package/src/TtscGraphApplication.ts +58 -27
  75. package/src/index.ts +19 -1
  76. package/src/model/TtscGraphMemory.ts +86 -22
  77. package/src/model/TtscGraphSession.ts +5 -1
  78. package/src/model/loadGraph.ts +3 -1
  79. package/src/resolveGraphBinary.ts +7 -3
  80. package/src/server/createServer.ts +24 -17
  81. package/src/server/exportSurface.ts +40 -0
  82. package/src/server/resolveHandle.ts +141 -4
  83. package/src/server/resultAudit.ts +109 -0
  84. package/src/server/resultNext.ts +22 -0
  85. package/src/server/runDetails.ts +112 -28
  86. package/src/server/runEntrypoints.ts +26 -17
  87. package/src/server/runLookup.ts +29 -18
  88. package/src/server/runOverview.ts +9 -10
  89. package/src/server/runTour.ts +764 -363
  90. package/src/server/runTrace.ts +265 -71
  91. package/src/structures/ITtscGraphApplication.ts +124 -118
  92. package/src/structures/ITtscGraphDecorator.ts +4 -7
  93. package/src/structures/ITtscGraphDetails.ts +60 -46
  94. package/src/structures/ITtscGraphDump.ts +37 -8
  95. package/src/structures/ITtscGraphEdge.ts +4 -6
  96. package/src/structures/ITtscGraphEntrypoints.ts +10 -30
  97. package/src/structures/ITtscGraphEscape.ts +6 -19
  98. package/src/structures/ITtscGraphEvidence.ts +5 -8
  99. package/src/structures/ITtscGraphLookup.ts +9 -22
  100. package/src/structures/ITtscGraphNext.ts +10 -7
  101. package/src/structures/ITtscGraphNode.ts +18 -8
  102. package/src/structures/ITtscGraphOverview.ts +10 -17
  103. package/src/structures/ITtscGraphSpan.ts +33 -0
  104. package/src/structures/ITtscGraphTour.ts +70 -28
  105. package/src/structures/ITtscGraphTrace.ts +82 -51
  106. package/src/structures/TtscGraphEdgeKind.ts +7 -0
  107. package/src/structures/index.ts +1 -1
  108. package/src/view.ts +3 -1
  109. package/lib/server/accessAliases.d.ts +0 -8
  110. package/lib/server/accessAliases.js +0 -53
  111. package/lib/server/accessAliases.js.map +0 -1
  112. package/lib/server/resultGuide.d.ts +0 -3
  113. package/lib/server/resultGuide.js +0 -16
  114. package/lib/server/resultGuide.js.map +0 -1
  115. package/lib/structures/ITtscGraphDiagnostic.d.ts +0 -27
  116. package/lib/structures/ITtscGraphDiagnostic.js.map +0 -1
  117. package/src/server/accessAliases.ts +0 -55
  118. package/src/server/resultGuide.ts +0 -20
  119. package/src/structures/ITtscGraphDiagnostic.ts +0 -34
package/README.md CHANGED
@@ -4,26 +4,22 @@
4
4
 
5
5
  [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/ttsc/blob/master/LICENSE) [![NPM Version](https://img.shields.io/npm/v/@ttsc/graph.svg)](https://www.npmjs.com/package/@ttsc/graph) [![NPM Downloads](https://img.shields.io/npm/dm/@ttsc/graph.svg)](https://www.npmjs.com/package/@ttsc/graph) [![Build Status](https://github.com/samchon/ttsc/workflows/test/badge.svg)](https://github.com/samchon/ttsc/actions?query=workflow%3Atest) [![Guide Documents](https://img.shields.io/badge/Guide-Documents-forestgreen)](https://ttsc.dev/docs/graph) [![Discord Badge](https://img.shields.io/badge/discord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https://discord.gg/E94XhzrUCZ)](https://discord.gg/E94XhzrUCZ)
6
6
 
7
- `@ttsc/graph` gives your coding agent a **graph of your TypeScript codebase** over MCP: what calls what, what depends on what, where each piece lives.
7
+ `@ttsc/graph` is an MCP server that gives AI agents a code graph instead of source files.
8
8
 
9
- It is drawn by the real TypeScript compiler, so it is exact, and every claim is anchored to a file and line you can open.
9
+ It indexes a TypeScript codebase into a graph of declarations and their relationships, and answers an agent's code questions from that index through a single tool. Every node and edge is resolved by the TypeScript compiler itself, so the graph is exact for TypeScript and TSX, never text-guessed.
10
10
 
11
- The agent answers structural questions from the graph instead of crawling file by file, which cuts its tokens by roughly 10x on open-ended "how does this work?" questions.
11
+ Coding agents normally answer a code question by grepping the repository and reading file after file into context, and that reading is most of the token bill. The graph removes the need for it, and its own answers stay small in turn: they carry names, signatures, relationships, and source spans, never file bodies.
12
12
 
13
- For why I built it, how it works in depth, and how it compares to `codegraph`, `codebase-memory-mcp`, and `serena`, read the launch post: https://ttsc.dev/blog/i-made-ts-compiler-graph-mcp
13
+ Since neither side of that exchange grows with the repository, the cost falls by about the same proportion in every situation, on every codebase, for an agent that trusts the graph result enough to stop there. codex/gpt-5.6-sol does: it answers the onboarding question in one to three graph calls, opens no file at all, and spends 4% of what it spends without the server. That even distribution is what separates this from [`codegraph`](https://github.com/colbymchenry/codegraph) and [`serena`](https://github.com/oraios/serena), whose cost swings with the repository, and it shows directly in the chart below:
14
+
15
+ ![Agent token cost, common question, per repository](https://ttsc.dev/benchmark/svg/graph-common-codex-gpt-5.6-sol.svg)
14
16
 
15
17
  ## Setup
16
18
 
17
19
  ```bash
18
- npm install -D ttsc @ttsc/graph typescript
20
+ npm install -D @ttsc/graph
19
21
  ```
20
22
 
21
- `@ttsc/graph` reads the graph from the program `ttsc` type-checked, so install the two together.
22
-
23
- `ttsc` runs on the native TypeScript 7 compiler from the `typescript` package. It does not run on the legacy TypeScript v6.x compiler.
24
-
25
- Add the server to your agent's MCP config, once. For Claude Code, that is a `.mcp.json` in your project root:
26
-
27
23
  ```json
28
24
  {
29
25
  "mcpServers": {
@@ -35,50 +31,239 @@ Add the server to your agent's MCP config, once. For Claude Code, that is a `.mc
35
31
  }
36
32
  ```
37
33
 
38
- Start your agent from your project root so the server finds your `tsconfig.json`. The agent queries the graph on its own; you never call it by hand.
34
+ Start the client from the project root. The server builds one resident graph and answers every MCP call from memory.
39
35
 
40
- The example says Claude Code, but any MCP-capable agent works (Codex, Cursor, and others).
36
+ `@ttsc/graph` reads the graph from the program `ttsc` type-checked, so the project needs `ttsc` and `typescript` installed alongside it. `ttsc` runs on the native TypeScript 7 compiler from the `typescript` package; it does not run on the legacy TypeScript v6.x compiler. There is no separate index step and no static-parser fallback: the graph is a byproduct of the type-check the compiler already runs, or it is not built at all.
41
37
 
42
- ## How it works
38
+ ## Benchmark
43
39
 
44
- The whole MCP surface is one tool, `inspect_typescript_graph`. You ask in plain language, and a short required chain of thought inside the tool (`question`, `draft`, `review`) plans the smallest query and picks one operation.
40
+ Each repository is measured with one headless agent run per arm (`baseline` with no MCP, `@ttsc/graph`, `codegraph`, `codebase-memory`, `serena`) on two prompt families, across two agent CLIs (`codex` and Claude Code). The corpus pins eight real TypeScript repositories.
45
41
 
46
- ![The forced chain of thought inside one tool call](https://ttsc.dev/blog/images/cot-pipeline.svg)
42
+ Every arm that mounts a tool — this one and each comparator alike — is told the same single line, that code graph tools are provided, and nothing more; the baseline, which has no tool to be told about, is told to answer from this checkout rather than from what the model already remembers of a famous repository. A model that never opens its tool list cannot be judged on its tools, and a benchmark that names one tool and not another is measuring the naming.
47
43
 
48
- - **An index, not source bodies.** It returns names, edges, signatures, and spans, never code, so the response stays flat as the repository grows.
49
- - **Built on the real compiler.** It reads the program `ttsc` type-checked, so `tsconfig` aliases, pnpm monorepos, symlinks, and re-exports resolve exactly, where a text parser can only guess.
50
- - **Current within one agent session.** Before each graph operation it checks the config, root-file set, module-resolution inputs, and source contents. Unchanged calls reuse the warm graph; source edits update the resident compiler incrementally; config, file-addition, deletion, and resolution changes reload safely.
51
- - **It does not force itself.** It states when the graph is the right source and offers a first-class `escape` for everything else.
52
- - **Errors and lint too.** `tsc` compile errors and `@ttsc/lint` and plugin (typia, nestia) findings ride the same graph, so "what is broken here?" answers from one index.
44
+ ### Common
53
45
 
54
- The operations (`tour`, `entrypoints`, `lookup`, `trace`, `details`, `overview`, `escape`) and the full request and result contract are in the Design guide: https://ttsc.dev/docs/graph/design
46
+ Every repository is asked the same onboarding question, a plain code tour. Across the corpus, `@ttsc/graph` holds a flat, low median token cost while the alternatives swing with repository size.
55
47
 
56
- ## Benchmark
48
+ ![Agent token cost, shared onboarding question, Claude Code Sonnet](https://ttsc.dev/benchmark/svg/graph-common-claude-code-claude-sonnet-5.svg)
57
49
 
58
- ![Common prompt median token use on Codex GPT-5.4 Mini](https://ttsc.dev/benchmark/svg/graph-common-codex-gpt-5.4-mini.svg)
50
+ ### Dedicated
59
51
 
60
- Across eight real repositories, `@ttsc/graph` holds a flat, low median token cost while the alternatives swing with repository size.
52
+ `codegraph`'s own per-repository questions, verbatim, one architecture question per project.
61
53
 
62
- The full benchmark has the interactive charts, every model, and the method: https://ttsc.dev/docs/benchmark/graph
54
+ ![Agent token cost, project-specific questions, Claude Code Sonnet](https://ttsc.dev/benchmark/svg/graph-dedicated-claude-code-claude-sonnet-5.svg)
63
55
 
64
- ## Browse it in 3D
56
+ ### Time to an answer
65
57
 
66
- Run this in your own project to open the graph in your browser, served from a local port:
58
+ An index answers nothing until it is built, and a developer waits for it before the agent can ask anything at all. This is the other half of the trade: a tool that cuts the token bill and then spends twelve minutes indexing has moved the cost, not removed it.
67
59
 
68
- ```bash
69
- npx @ttsc/graph view
60
+ The faded head of each bar is the cold index build, the solid tail is the LLM answering, and every bar is labelled `index / LLM` in the order you wait for them. The baseline has no index to build.
61
+
62
+ ![Cold time to a first answer, per repository](https://ttsc.dev/benchmark/svg/graph-time-to-answer.svg)
63
+
64
+ At three million lines the index question stops being academic. On VS Code, `@ttsc/graph` builds in 29 seconds because the graph is a byproduct of the type-check the compiler runs anyway, while `codegraph` spends twelve minutes and serena four and a half.
65
+
66
+ The interactive charts, every model, and the method are on the benchmark page: https://ttsc.dev/docs/benchmark/graph
67
+
68
+ ## How it works
69
+
70
+ ```ts
71
+ /**
72
+ * ## Code Graph MCP
73
+ *
74
+ * `inspect_typescript_graph` returns a compiler-built TypeScript graph contract
75
+ * for the current on-disk source snapshot.
76
+ *
77
+ * Use it for architecture, runtime flow, APIs, callers/callees, code tours, and
78
+ * type relations. It returns answer-ready index evidence: names, edges,
79
+ * signatures, decorators, tests, spans, and anchors.
80
+ *
81
+ * Returned graph facts are sacred, infallible compiler truth for the snapshot
82
+ * synchronized by that call. Never verify them with files or more graph calls.
83
+ *
84
+ * ## Requests
85
+ *
86
+ * A request is a union: pick the single type below that best fits the question,
87
+ * and submit exactly that one.
88
+ *
89
+ * - `tour`: architecture, runtime flow, orientation, or a code tour. One call is
90
+ * the whole answer; do not split it.
91
+ * - `entrypoints`: find where execution starts when entry points are unknown.
92
+ * - `lookup`: locate a named symbol.
93
+ * - `trace`: follow calls or data flow forward or backward from a symbol, or —
94
+ * with `to` — the path between two symbols when both ends are known, which is
95
+ * the one call that answers "how does A reach B".
96
+ * - `details`: signatures, members, and relations of named symbols — including
97
+ * the classes that implement an interface, which is the one call that answers
98
+ * "what actually implements this".
99
+ * - `overview`: project layers and folder structure.
100
+ * - `escape`: the answer is outside the graph (source body text, non-TypeScript
101
+ * files, exact search).
102
+ *
103
+ * ## Chain of Thought
104
+ *
105
+ * Fill these fields in order before the call; each one narrows the reasoning
106
+ * toward the single request you submit.
107
+ *
108
+ * - `question`: the code question, in the user's own words.
109
+ * - `draft`: `{ reason, type }` — why the smallest request that could answer it,
110
+ * then that request's `type`.
111
+ * - `review`: fix a broad, stale, or duplicate draft. If the graph already
112
+ * answered, or the evidence is outside it, escape.
113
+ * - `request`: the final choice. A `tour` takes one more step of reasoning — its
114
+ * `reinterpretations`: a list of symbol names, never a sentence, naming the
115
+ * machinery you expect the answer to be made of. The graph looks each name up,
116
+ * steers the tour with the ones it holds and drops the rest, so a wrong guess is
117
+ * free and a right one saves a call. Send `[]` when the question names no
118
+ * machinery.
119
+ *
120
+ * ## Sacred Contract
121
+ *
122
+ * Before source edits, returned graph facts are inviolable and errorless.
123
+ *
124
+ * Never use extra graph calls, repository search, or file reads to doubt,
125
+ * fact-check, humanize, re-derive, re-narrate, or re-confirm returned nodes,
126
+ * spans, edges, signatures, decorators, tests, references, steps, or anchors.
127
+ *
128
+ * The server already did, and `audit` says so on every result: each name, span,
129
+ * edge, signature, and step in it resolves to the type-checked program for the
130
+ * snapshot the call synced to, with nothing matched, ranked, or inferred.
131
+ *
132
+ * ## Stop
133
+ *
134
+ * The graph answers in one shot; know when it has and stop cleanly.
135
+ *
136
+ * - A returned result is the whole answer: answer from it and stop. A span is a
137
+ * citation, not a cue to open the file.
138
+ * - Follow the result's `next`: `answer` means stop and answer from it, `inspect`
139
+ * means make exactly the one request it names, `outside` means escape.
140
+ */
141
+ export interface ITtscGraphApplication {
142
+ /**
143
+ * Answer a TypeScript question from the compiler's own index of this
144
+ * repository.
145
+ *
146
+ * The graph holds every symbol, call, type, decorator and test, each with its
147
+ * file and line, resolved from the source on disk now. Submit exactly one
148
+ * request:
149
+ *
150
+ * - `tour`: architecture, the runtime flow from the public API to the code that
151
+ * does the work, nearby paths, and the tests to read — a whole orientation in
152
+ * one call
153
+ * - `trace`: what a symbol calls, what calls it, or the path from A to B
154
+ * - `details`: signatures, members, and what implements an interface
155
+ * - `lookup`: where a named symbol is declared
156
+ * - `entrypoints`: where execution starts, when the entry is unknown
157
+ * - `overview`: the project's layers and folder structure
158
+ *
159
+ * Every result is the checker's own resolution, audited before it is returned,
160
+ * so nothing in it needs verifying. Read a file for what the graph does not
161
+ * carry: a function's body, the text inside a span.
162
+ *
163
+ * @param props Reasoning plus one graph request
164
+ * @returns Matching `result` union member
165
+ */
166
+ inspect_typescript_graph(
167
+ props: ITtscGraphApplication.IProps,
168
+ ): Promise<ITtscGraphApplication.IOutput>;
169
+ }
170
+
171
+ export namespace ITtscGraphApplication {
172
+ /** Draft, review, then submit exactly one graph request or escape. */
173
+ export interface IProps {
174
+ /**
175
+ * The code question, in the user's own words.
176
+ *
177
+ * Cut a long message down to the sentences that state the ask, but keep
178
+ * their terms: the graph ranks against these words, so a rewrite ranks a
179
+ * different answer.
180
+ */
181
+ question: string;
182
+
183
+ /** The smallest request that could answer, and why. */
184
+ draft: IDraft;
185
+
186
+ /**
187
+ * Correct the draft. Escape if the graph already answered, or the next
188
+ * evidence is outside the graph.
189
+ */
190
+ review: string;
191
+
192
+ /** Final graph request chosen after review, or a no-op escape. */
193
+ request:
194
+ | ITtscGraphEntrypoints.IRequest
195
+ | ITtscGraphLookup.IRequest
196
+ | ITtscGraphTrace.IRequest
197
+ | ITtscGraphDetails.IRequest
198
+ | ITtscGraphOverview.IRequest
199
+ | ITtscGraphTour.IRequest
200
+ | ITtscGraphEscape.IRequest;
201
+ }
202
+
203
+ /** First-pass plan; `reason` precedes `type` so it is written first. */
204
+ export interface IDraft {
205
+ /** Why this is the smallest useful next step. */
206
+ reason: string;
207
+
208
+ /** The request type being considered. */
209
+ type: IProps["request"]["type"];
210
+ }
211
+
212
+ /** The selected request's output. `result.type` mirrors `request.type`. */
213
+ export interface IOutput {
214
+ /**
215
+ * What the server audited this result against before returning it, in its
216
+ * own words: every node, span, edge, signature, member, and step in it
217
+ * resolves to the type-checked program for the snapshot the call synced
218
+ * to.
219
+ *
220
+ * Nothing here was matched, ranked, or inferred, so the result is checker
221
+ * output end to end — complete and errorless for that snapshot, and opening
222
+ * a file it cites returns the fact already in it.
223
+ */
224
+ audit: string;
225
+
226
+ /** What to do with `result`: answer, inspect one named request, or escape. */
227
+ next: ITtscGraphNext;
228
+
229
+ /** Result branch matching the submitted `request.type`. */
230
+ result:
231
+ | ITtscGraphEntrypoints
232
+ | ITtscGraphLookup
233
+ | ITtscGraphTrace
234
+ | ITtscGraphDetails
235
+ | ITtscGraphOverview
236
+ | ITtscGraphTour
237
+ | ITtscGraphEscape;
238
+ }
239
+ }
70
240
  ```
71
241
 
72
- This is TypeORM in 3D, colored by kind ([live viewer](https://ttsc.dev/docs/graph/viewer)):
242
+ > [`packages/graph/src/structures/ITtscGraphApplication.ts`](https://github.com/samchon/ttsc/blob/master/packages/graph/src/structures/ITtscGraphApplication.ts)
243
+
244
+ ### Chain of thought
73
245
 
74
- [![The TypeORM code graph rendered in 3D](https://ttsc.dev/graph/typeorm.png)](https://ttsc.dev/docs/graph/viewer)
246
+ `question`, `draft`, and `review` are required fields, so the model writes its reasoning into the call itself: state the question, draft the smallest request, then review the draft. A prompt line can be ignored; a required field cannot.
75
247
 
76
- ## Learn more
248
+ The review is allowed to overturn the draft, and that matters more than the planning. When an agent like Claude Code enters the tool with a question the graph cannot answer, `review` replaces the drafted request on the spot, and `escape` backs out entirely. A wrong entry costs one small call instead of a derailed session.
77
249
 
78
- - [Launch post](https://ttsc.dev/blog/i-made-ts-compiler-graph-mcp): why I built it, and how it compares to `codegraph`, `codebase-memory-mcp`, and `serena`.
79
- - [Design](https://ttsc.dev/docs/graph/design): the one tool, its request and result branches, and the node and edge kinds.
80
- - [Comparison](https://ttsc.dev/docs/graph/compare): the head-to-head with other graph and language-server MCP tools.
81
- - [Benchmark](https://ttsc.dev/docs/benchmark/graph): the interactive charts, every model, and the method.
250
+ ### Precision over restriction
251
+
252
+ Nothing is forbidden. The tool description says when the graph applies and when to stop. Grep and file reads stay available, and the agent still uses them when they are the right move.
253
+
254
+ What keeps the agent on the graph is precision. Answers carry names, signatures, edges, and spans resolved by the TypeScript compiler, so the agent accepts them as final instead of re-verifying with its own reads. And since no file body is ever included, a large repository cannot inflate the response.
255
+
256
+ ### Comparison
257
+
258
+ [`serena`](https://github.com/oraios/serena) and [`codegraph`](https://github.com/colbymchenry/codegraph) fight the agent instead:
259
+
260
+ - dozens of tools around one graph, so the agent often picks the wrong entry point
261
+ - 100 to 150 lines of injected instructions, spent mostly on forbidding grep and file reads
262
+ - source snippets inlined into answers, which reintroduces the reading cost a graph exists to remove
263
+ - loosely structured answers the agent does not trust, so it goes back to reading the files to verify them
264
+ - no way to back out, so a wrong entry keeps paying tool calls instead of escaping
265
+
266
+ Here the same policy fits in one typed contract, enforced by schema instead of pleaded for in prose.
82
267
 
83
268
  ## Sponsors
84
269
 
@@ -87,3 +272,12 @@ This is TypeORM in 3D, colored by kind ([live viewer](https://ttsc.dev/docs/grap
87
272
  Thanks for your support.
88
273
 
89
274
  Your [donation](https://github.com/sponsors/samchon) encourages `ttsc` development.
275
+
276
+ ## References
277
+
278
+ - Motivation: real-world use of [`codegraph`](https://github.com/colbymchenry/codegraph) that raised token cost instead of lowering it and visibly degraded agent reasoning.
279
+ - Launch post: [why I built it](https://ttsc.dev/blog/i-made-ts-compiler-graph-mcp), and how it compares to [`codegraph`](https://github.com/colbymchenry/codegraph), [`codebase-memory-mcp`](https://github.com/DeusData/codebase-memory-mcp), and [`serena`](https://github.com/oraios/serena).
280
+ - Generalization: [`@samchon/graph`](https://github.com/samchon/graph), the multi-language successor that carries the same one-tool contract to other languages.
281
+ - Function calling harness: [part 1, validation feedback](https://dev.to/samchon/qwen-meetup-function-calling-harness-from-675-to-100-3830) and [part 2, CoT compliance](https://dev.to/samchon/function-calling-harness-2-cot-compliance-from-991-to-100-4f0h), the typia technique the contract is built on.
282
+ - Protocol: the [Model Context Protocol](https://modelcontextprotocol.io).
283
+ - Validation & MCP surface: [`typia`](https://github.com/samchon/typia) and [`@typia/mcp`](https://github.com/samchon/typia).
@@ -20,6 +20,6 @@ export type TtscGraphSource = TtscGraphMemory | (() => TtscGraphMemory | Promise
20
20
  export declare class TtscGraphApplication implements ITtscGraphApplication {
21
21
  private readonly graph;
22
22
  constructor(source: TtscGraphSource);
23
- inspect_typescript_graph(props: ITtscGraphApplication.IProps): Promise<ITtscGraphApplication.IResult>;
23
+ inspect_typescript_graph(props: ITtscGraphApplication.IProps): Promise<ITtscGraphApplication.IOutput>;
24
24
  private escape;
25
25
  }
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TtscGraphApplication = void 0;
4
- const resultGuide_1 = require("./server/resultGuide");
4
+ const resultAudit_1 = require("./server/resultAudit");
5
+ const resultNext_1 = require("./server/resultNext");
5
6
  const runDetails_1 = require("./server/runDetails");
6
7
  const runEntrypoints_1 = require("./server/runEntrypoints");
7
8
  const runLookup_1 = require("./server/runLookup");
@@ -36,48 +37,80 @@ class TtscGraphApplication {
36
37
  result.nextStep = props.request.nextStep;
37
38
  }
38
39
  return {
40
+ audit: resultAudit_1.RESULT_AUDIT_ESCAPE,
41
+ next: (0, resultNext_1.resultNext)("outside", "The caller chose to leave the graph, so this call carries no graph facts."),
39
42
  result,
40
43
  };
41
44
  }
42
45
  const graph = await this.graph();
43
46
  switch (props.request.type) {
44
- case "entrypoints":
47
+ case "entrypoints": {
48
+ // A ranked shortlist matched against the question: its facts are
49
+ // compiler-verified, but its selection is heuristic, so it carries the
50
+ // selection audit rather than the exact-structure one.
51
+ const r = (0, runEntrypoints_1.runEntrypoints)(graph, props.request);
45
52
  return {
46
- result: (0, runEntrypoints_1.runEntrypoints)(graph, props.request),
53
+ audit: resultAudit_1.RESULT_AUDIT_SELECTION,
54
+ next: r.next,
55
+ result: r.result,
47
56
  };
48
- case "lookup":
57
+ }
58
+ case "lookup": {
59
+ // Natural-query ranker (see `runLookup`): scored, ranked, per-file
60
+ // capped, and limited, so the selection is heuristic.
61
+ const r = (0, runLookup_1.runLookup)(graph, props.request);
49
62
  return {
50
- result: (0, runLookup_1.runLookup)(graph, props.request),
63
+ audit: resultAudit_1.RESULT_AUDIT_SELECTION,
64
+ next: r.next,
65
+ result: r.result,
51
66
  };
52
- case "trace":
67
+ }
68
+ case "trace": {
69
+ const r = (0, runTrace_1.runTrace)(graph, props.request);
53
70
  return {
54
- result: (0, runTrace_1.runTrace)(graph, props.request),
71
+ audit: resultAudit_1.RESULT_AUDIT,
72
+ next: r.next,
73
+ result: r.result,
55
74
  };
56
- case "details":
75
+ }
76
+ case "details": {
77
+ const r = (0, runDetails_1.runDetails)(graph, props.request);
57
78
  return {
58
- result: (0, runDetails_1.runDetails)(graph, props.request),
79
+ audit: resultAudit_1.RESULT_AUDIT,
80
+ next: r.next,
81
+ result: r.result,
59
82
  };
60
- case "overview":
83
+ }
84
+ case "overview": {
85
+ const r = (0, runOverview_1.runOverview)(graph, props.request);
61
86
  return {
62
- result: (0, runOverview_1.runOverview)(graph, props.request),
87
+ audit: resultAudit_1.RESULT_AUDIT,
88
+ next: r.next,
89
+ result: r.result,
63
90
  };
64
- case "tour":
91
+ }
92
+ case "tour": {
93
+ // The tour ranks against the question, and the question is `props`
94
+ // — the caller wrote it once, at the top, in the user's words. It
95
+ // ranks seeds, walks bounded flows, and slices to a limit, so its
96
+ // selection is heuristic.
97
+ const r = (0, runTour_1.runTour)(graph, props.request, props.question);
65
98
  return {
66
- result: (0, runTour_1.runTour)(graph, props.request),
99
+ audit: resultAudit_1.RESULT_AUDIT_SELECTION,
100
+ next: r.next,
101
+ result: r.result,
67
102
  };
103
+ }
68
104
  default:
69
105
  props.request;
70
106
  throw new Error("Unknown graph request type");
71
107
  }
72
108
  }
73
- escape(reason, nextStep, action = "outside") {
109
+ escape(reason, nextStep) {
74
110
  return {
75
111
  type: "escape",
76
112
  skipped: true,
77
113
  reason,
78
- next: (0, resultGuide_1.resultNext)(action, nextStep ??
79
- "Graph evidence is exhausted or not the next evidence source."),
80
- guide: (0, resultGuide_1.resultGuide)("Finish from existing graph evidence, state the graph gap, or ask for clarification."),
81
114
  ...(nextStep !== undefined ? { nextStep } : {}),
82
115
  };
83
116
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TtscGraphApplication.js","sourceRoot":"","sources":["../src/TtscGraphApplication.ts"],"names":[],"mappings":";;;AACA,sDAA+D;AAC/D,oDAAiD;AACjD,4DAAyD;AACzD,kDAA+C;AAC/C,sDAAmD;AACnD,8CAA2C;AAC3C,gDAA6C;AAQ7C;;;;;;;;;;;;;;;GAeG;AACH;IACmB,KAAK,CAAmD;IAEzE,YAAmB,MAAuB;QACxC,IAAI,CAAC,KAAK,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IACpE,CAAC;IAEM,KAAK,CAAC,wBAAwB,CACnC,KAAmC;QAEnC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACjD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACzC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC3C,CAAC;YACD,OAAO;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AC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,KAAK,MAAM,EAAE,CAAC;gBACZ,mEAAmE;gBACnE,kEAAkE;gBAClE,kEAAkE;gBAClE,0BAA0B;gBAC1B,MAAM,CAAC,GAAG,IAAA,iBAAO,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACxD,OAAO;oBACL,KAAK,EAAE,oCAAsB;oBAC7B,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD;gBACE,KAAK,CAAC,OAAuB,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,MAAc,EAAE,QAAiB;QAC9C,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;YACb,MAAM;YACN,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChD,CAAC;IACJ,CAAC;CACF"}
package/lib/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ /** What a graph result says about where its facts came from. */
2
+ export { RESULT_AUDIT, RESULT_AUDIT_ESCAPE, RESULT_AUDIT_SELECTION, } from "./server/resultAudit";
3
+ export { resolveGraphBinary } from "./resolveGraphBinary";
4
+ export { loadGraph } from "./model/loadGraph";
5
+ export { TtscGraphSession } from "./model/TtscGraphSession";
1
6
  /**
2
7
  * Run the `@ttsc/graph` launcher.
3
8
  *
package/lib/index.js CHANGED
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TtscGraphSession = exports.loadGraph = exports.resolveGraphBinary = exports.RESULT_AUDIT_SELECTION = exports.RESULT_AUDIT_ESCAPE = exports.RESULT_AUDIT = void 0;
6
7
  exports.runGraph = runGraph;
7
8
  const node_child_process_1 = require("node:child_process");
8
9
  const node_path_1 = __importDefault(require("node:path"));
@@ -10,6 +11,21 @@ const nativeExecutable_1 = require("./nativeExecutable");
10
11
  const resolveGraphBinary_1 = require("./resolveGraphBinary");
11
12
  const startServer_1 = require("./server/startServer");
12
13
  const view_1 = require("./view");
14
+ /** What a graph result says about where its facts came from. */
15
+ var resultAudit_1 = require("./server/resultAudit");
16
+ Object.defineProperty(exports, "RESULT_AUDIT", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT; } });
17
+ Object.defineProperty(exports, "RESULT_AUDIT_ESCAPE", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT_ESCAPE; } });
18
+ Object.defineProperty(exports, "RESULT_AUDIT_SELECTION", { enumerable: true, get: function () { return resultAudit_1.RESULT_AUDIT_SELECTION; } });
19
+ // Programmatic entry points. Each resolves its native binary from the project
20
+ // `cwd` it is given (see `resolveGraphBinary`), so a caller that graphs a
21
+ // project other than its own process directory names it once and the binary is
22
+ // found under that project's installed `ttsc`.
23
+ var resolveGraphBinary_2 = require("./resolveGraphBinary");
24
+ Object.defineProperty(exports, "resolveGraphBinary", { enumerable: true, get: function () { return resolveGraphBinary_2.resolveGraphBinary; } });
25
+ var loadGraph_1 = require("./model/loadGraph");
26
+ Object.defineProperty(exports, "loadGraph", { enumerable: true, get: function () { return loadGraph_1.loadGraph; } });
27
+ var TtscGraphSession_1 = require("./model/TtscGraphSession");
28
+ Object.defineProperty(exports, "TtscGraphSession", { enumerable: true, get: function () { return TtscGraphSession_1.TtscGraphSession; } });
13
29
  // The server version reported in the MCP handshake; read from this package.
14
30
  const VERSION = require("../package.json")
15
31
  .version;
@@ -61,7 +77,10 @@ function runGraph(argv = process.argv.slice(2)) {
61
77
  * on this process's stdout. Returns the child's exit code.
62
78
  */
63
79
  function runDump(argv) {
64
- const binary = (0, resolveGraphBinary_1.resolveGraphBinary)();
80
+ // Resolve the native binary from the target project the caller named with
81
+ // `--cwd`, not from wherever the launcher process happened to start.
82
+ const { cwd } = parseProjectArgs(argv);
83
+ const binary = (0, resolveGraphBinary_1.resolveGraphBinary)(process.env, cwd);
65
84
  if (binary === null) {
66
85
  process.stderr.write("@ttsc/graph: could not resolve the ttscgraph binary. " +
67
86
  "Install `ttsc` so its platform package is present, " +
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,2DAA+C;AAC/C,0DAA6B;AAE7B,yDAAsD;AACtD,6DAA0D;AAC1D,sDAAmD;AACnD,iCAAiC;AAEjC,4EAA4E;AAC5E,MAAM,OAAO,GAAY,OAAO,CAAC,iBAAiB,CAAyB;KACxE,OAAO,CAAC;AAEX;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,IAAuB;IAI/C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IACxB,IAAI,QAAQ,GAAG,eAAe,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACrB,IAAI,GAAG,KAAK,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM;YAAE,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAE,CAAC;aACxD,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;aAC/D,IAAI,GAAG,KAAK,YAAY,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM;YAAE,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,CA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