@ttsc/graph 0.16.10 → 0.16.12

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 (53) hide show
  1. package/lib/TtscGraphApplication.d.ts +24 -0
  2. package/lib/bin.d.ts +2 -0
  3. package/lib/index.d.ts +12 -0
  4. package/lib/index.js +2 -0
  5. package/lib/index.js.map +1 -1
  6. package/lib/model/TtscGraphMemory.d.ts +41 -0
  7. package/lib/model/loadGraph.d.ts +23 -0
  8. package/lib/model/loadGraph.js +2 -0
  9. package/lib/model/loadGraph.js.map +1 -1
  10. package/lib/nativeExecutable.d.ts +9 -0
  11. package/lib/nativeExecutable.js +33 -0
  12. package/lib/nativeExecutable.js.map +1 -0
  13. package/lib/reduce.d.ts +46 -0
  14. package/lib/resolveGraphBinary.d.ts +18 -0
  15. package/lib/server/accessAliases.d.ts +8 -0
  16. package/lib/server/createServer.d.ts +15 -0
  17. package/lib/server/pathPolicy.d.ts +9 -0
  18. package/lib/server/resolveHandle.d.ts +8 -0
  19. package/lib/server/resultGuide.d.ts +3 -0
  20. package/lib/server/runDetails.d.ts +24 -0
  21. package/lib/server/runEntrypoints.d.ts +9 -0
  22. package/lib/server/runLookup.d.ts +10 -0
  23. package/lib/server/runOverview.d.ts +10 -0
  24. package/lib/server/runTour.d.ts +8 -0
  25. package/lib/server/runTrace.d.ts +10 -0
  26. package/lib/server/startServer.d.ts +11 -0
  27. package/lib/structures/ITtscGraphApplication.d.ts +161 -0
  28. package/lib/structures/ITtscGraphDecorator.d.ts +30 -0
  29. package/lib/structures/ITtscGraphDetails.d.ts +157 -0
  30. package/lib/structures/ITtscGraphDiagnostic.d.ts +27 -0
  31. package/lib/structures/ITtscGraphDump.d.ts +30 -0
  32. package/lib/structures/ITtscGraphEdge.d.ts +20 -0
  33. package/lib/structures/ITtscGraphEntrypoints.d.ts +117 -0
  34. package/lib/structures/ITtscGraphEscape.d.ts +40 -0
  35. package/lib/structures/ITtscGraphEvidence.d.ts +22 -0
  36. package/lib/structures/ITtscGraphLookup.d.ts +67 -0
  37. package/lib/structures/ITtscGraphNext.d.ts +15 -0
  38. package/lib/structures/ITtscGraphNode.d.ts +58 -0
  39. package/lib/structures/ITtscGraphOverview.d.ts +85 -0
  40. package/lib/structures/ITtscGraphTour.d.ts +113 -0
  41. package/lib/structures/ITtscGraphTrace.d.ts +143 -0
  42. package/lib/structures/TtscGraphEdgeKind.d.ts +10 -0
  43. package/lib/structures/TtscGraphNodeKind.d.ts +12 -0
  44. package/lib/structures/TtscGraphNodeModifier.d.ts +7 -0
  45. package/lib/structures/index.d.ts +18 -0
  46. package/lib/view.d.ts +7 -0
  47. package/lib/view.js +2 -0
  48. package/lib/view.js.map +1 -1
  49. package/package.json +2 -2
  50. package/src/index.ts +2 -0
  51. package/src/model/loadGraph.ts +2 -0
  52. package/src/nativeExecutable.ts +24 -0
  53. package/src/view.ts +2 -0
@@ -0,0 +1,24 @@
1
+ import { TtscGraphMemory } from "./model/TtscGraphMemory";
2
+ import { ITtscGraphApplication } from "./structures/ITtscGraphApplication";
3
+ export type TtscGraphSource = TtscGraphMemory | (() => TtscGraphMemory);
4
+ /**
5
+ * The MCP tool surface as a plain class over the resident
6
+ * {@link TtscGraphMemory}.
7
+ *
8
+ * Its public method is the MCP tool: `typia.llm.application` reflects
9
+ * {@link ITtscGraphApplication} to generate the tool's JSON schema and argument
10
+ * validator from the signature and JSDoc, with no hand-written schema, and
11
+ * `@typia/mcp`'s `createMcpServer` registers it (see `./server/createServer`).
12
+ * The method delegates to the pure graph functions in `./server`, which are
13
+ * unit-testable without a transport; this class only binds them to the graph.
14
+ *
15
+ * Every method answers from the resident graph; none recompiles. Output is kept
16
+ * compact and bounded so a model can read structure without a file read, which
17
+ * is the token win the redesign exists for.
18
+ */
19
+ export declare class TtscGraphApplication implements ITtscGraphApplication {
20
+ private readonly graph;
21
+ constructor(source: TtscGraphSource);
22
+ inspect_typescript_graph(props: ITtscGraphApplication.IProps): ITtscGraphApplication.IResult;
23
+ private escape;
24
+ }
package/lib/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/lib/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Run the `@ttsc/graph` launcher.
3
+ *
4
+ * - `view`: JS-orchestrated 3D viewer (dump -> reduce -> serve -> open).
5
+ * - `dump`: pass through to the native `ttscgraph dump`, which prints the whole
6
+ * graph as JSON for piping or the viewer.
7
+ * - Default: serve the MCP graph over stdio. The TypeScript server runs
8
+ * `ttscgraph dump` once to build the resident graph, then answers tool calls
9
+ * from memory; the agent's MCP client speaks JSON-RPC over this process's
10
+ * stdin/stdout. The process stays alive on the stdio transport.
11
+ */
12
+ export declare function runGraph(argv?: readonly string[]): number | void;
package/lib/index.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.runGraph = runGraph;
7
7
  const node_child_process_1 = require("node:child_process");
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
+ const nativeExecutable_1 = require("./nativeExecutable");
9
10
  const resolveGraphBinary_1 = require("./resolveGraphBinary");
10
11
  const startServer_1 = require("./server/startServer");
11
12
  const view_1 = require("./view");
@@ -67,6 +68,7 @@ function runDump(argv) {
67
68
  "or set TTSC_GRAPH_BINARY to an absolute path.\n");
68
69
  return 1;
69
70
  }
71
+ (0, nativeExecutable_1.ensureExecutable)(binary);
70
72
  const result = (0, node_child_process_1.spawnSync)(binary, [...argv], {
71
73
  stdio: "inherit",
72
74
  windowsHide: true,
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,6DAA0D;AAC1D,sDAAmD;AACnD,iCAAiC;AAEjC,4EAA4E;AAC5E,MAAM,OAAO,GAAY,OAAO,CAAC,iBAAiB,CAAyB;KACxE,OAAO,CAAC;A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X,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { ITtscGraphDump } from "../structures/ITtscGraphDump";
2
+ import { ITtscGraphEdge } from "../structures/ITtscGraphEdge";
3
+ import { ITtscGraphNode } from "../structures/ITtscGraphNode";
4
+ /**
5
+ * The in-memory resident graph the MCP tools answer from.
6
+ *
7
+ * It loads one `ttscgraph dump` — the checker-resolved fact graph — then
8
+ * synthesizes the structural relationships the dump deliberately leaves to this
9
+ * layer: `file` container nodes, the `contains` ownership tree, and `exports`
10
+ * edges, plus class/interface member implementation edges and the refinement of
11
+ * a class-member `variable` to a `property`. Every tool call is then a lookup
12
+ * or a traversal over the indexes built here; nothing recompiles.
13
+ */
14
+ export declare class TtscGraphMemory {
15
+ private readonly byId;
16
+ private readonly outEdges;
17
+ private readonly inEdges;
18
+ private readonly byNameIndex;
19
+ private readonly bySymbolIndex;
20
+ /** The absolute project root the dump was built for. */
21
+ readonly project: string;
22
+ /** Every node, raw plus synthesized (file containers). */
23
+ readonly nodes: readonly ITtscGraphNode[];
24
+ /** Every edge, raw plus synthesized (contains, exports). */
25
+ readonly edges: readonly ITtscGraphEdge[];
26
+ private constructor();
27
+ /** Build a model from a parsed dump, synthesizing structural relationships. */
28
+ static from(dump: ITtscGraphDump): TtscGraphMemory;
29
+ /** The node with this id, or undefined. */
30
+ node(id: string): ITtscGraphNode | undefined;
31
+ /** Edges leaving a node (the node is the `from`). */
32
+ outgoing(id: string): readonly ITtscGraphEdge[];
33
+ /** Edges entering a node (the node is the `to`). */
34
+ incoming(id: string): readonly ITtscGraphEdge[];
35
+ /** Every node whose simple name equals `name`. */
36
+ named(name: string): readonly ITtscGraphNode[];
37
+ /** Every non-file node whose simple or owner-qualified symbol handle matches. */
38
+ symbols(handle: string): readonly ITtscGraphNode[];
39
+ /** Every workspace node on its module's export surface. */
40
+ exported(): ITtscGraphNode[];
41
+ }
@@ -0,0 +1,23 @@
1
+ import { TtscGraphMemory } from "./TtscGraphMemory";
2
+ /**
3
+ * Build the resident {@link TtscGraphMemory} for a project by running `ttscgraph
4
+ * dump` once and loading its JSON. This is the cold path behind the MCP tool
5
+ * calls: one type-check in Go produces the checker-resolved fact graph, then
6
+ * every later tool call is answered from the in-memory model.
7
+ *
8
+ * Throws when the binary cannot be resolved, the dump command fails, or its
9
+ * output is not a readable graph — the server surfaces the failure rather than
10
+ * answering from an empty graph.
11
+ */
12
+ export declare function loadGraph(options?: {
13
+ /** Project root the graph is built for (default: `process.cwd()`). */
14
+ cwd?: string;
15
+ /** Project tsconfig, relative to `cwd` (default: `tsconfig.json`). */
16
+ tsconfig?: string;
17
+ /**
18
+ * Absolute path to the `ttscgraph` binary. Defaults to the per-platform
19
+ * binary resolved from the project's installed `ttsc`; pass it explicitly
20
+ * to point at a custom build.
21
+ */
22
+ binary?: string;
23
+ }): TtscGraphMemory;
@@ -40,6 +40,7 @@ exports.loadGraph = loadGraph;
40
40
  const _a = __importStar(require("typia/lib/internal/_assertGuard"));
41
41
  const node_child_process_1 = require("node:child_process");
42
42
  const typia_1 = __importDefault(require("typia"));
43
+ const nativeExecutable_1 = require("../nativeExecutable");
43
44
  const resolveGraphBinary_1 = require("../resolveGraphBinary");
44
45
  const TtscGraphMemory_1 = require("./TtscGraphMemory");
45
46
  // A full-project dump is the whole fact graph as one JSON document; a large
@@ -65,6 +66,7 @@ function loadGraph(options = {}) {
65
66
  "Install `ttsc` so its platform package is present, " +
66
67
  "or set TTSC_GRAPH_BINARY to an absolute path.");
67
68
  }
69
+ (0, nativeExecutable_1.ensureExecutable)(binary);
68
70
  const result = (0, node_child_process_1.spawnSync)(binary, ["dump", "--cwd", cwd, "--tsconfig", tsconfig], { encoding: "utf8", maxBuffer: MAX_DUMP_BYTES, windowsHide: true });
69
71
  if (result.error) {
70
72
  throw new Error(`@ttsc/graph: ttscgraph dump failed: ${result.error.message}`);
@@ -1 +1 @@
1
- {"version":3,"file":"loadGraph.js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I,KAAK,CACb,+CACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;IACJ,CAAC;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAoC,KAAK,EAAE;AAC7C,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Ensure a resolved native binary can be executed on POSIX installs.
3
+ *
4
+ * Some package managers or non-POSIX pack hosts can materialize platform
5
+ * package binaries without executable bits. The ttsc launcher already repairs
6
+ * its native helper before spawning; @ttsc/graph has its own ttscgraph spawn
7
+ * paths, so it must apply the same first-run repair here.
8
+ */
9
+ export declare function ensureExecutable(binary: string): void;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ensureExecutable = ensureExecutable;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ /**
9
+ * Ensure a resolved native binary can be executed on POSIX installs.
10
+ *
11
+ * Some package managers or non-POSIX pack hosts can materialize platform
12
+ * package binaries without executable bits. The ttsc launcher already repairs
13
+ * its native helper before spawning; @ttsc/graph has its own ttscgraph spawn
14
+ * paths, so it must apply the same first-run repair here.
15
+ */
16
+ function ensureExecutable(binary) {
17
+ if (process.platform === "win32")
18
+ return;
19
+ try {
20
+ node_fs_1.default.accessSync(binary, node_fs_1.default.constants.X_OK);
21
+ return;
22
+ }
23
+ catch {
24
+ try {
25
+ const mode = node_fs_1.default.statSync(binary).mode & 0o777;
26
+ node_fs_1.default.chmodSync(binary, mode | 0o755);
27
+ }
28
+ catch {
29
+ /* keep the original spawn error path */
30
+ }
31
+ }
32
+ }
33
+ //# sourceMappingURL=nativeExecutable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeExecutable.js","sourceRoot":"","sources":["../src/nativeExecutable.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AAEzB;;;;;;;GAOG;AACH,0BAAiC,MAAc;IAC7C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO;IACzC,IAAI,CAAC;QACH,iBAAE,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO;IACT,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,iBAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;YAC9C,iBAAE,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,wCAAwC;QAC1C,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,46 @@
1
+ export interface RawNode {
2
+ id: string;
3
+ name: string;
4
+ kind: string;
5
+ file: string;
6
+ external?: boolean;
7
+ }
8
+ export interface RawEdge {
9
+ from: string;
10
+ to: string;
11
+ kind: string;
12
+ }
13
+ export interface RawDump {
14
+ project?: string;
15
+ nodes: RawNode[];
16
+ edges: RawEdge[];
17
+ }
18
+ export interface ViewerNode {
19
+ id: string;
20
+ name: string;
21
+ kind: string;
22
+ file: string;
23
+ degree: number;
24
+ }
25
+ export interface ViewerLink {
26
+ source: string;
27
+ target: string;
28
+ kind: string;
29
+ }
30
+ export interface ViewerPayload {
31
+ project: string;
32
+ counts: {
33
+ rawNodes: number;
34
+ rawEdges: number;
35
+ nodes: number;
36
+ links: number;
37
+ droppedExternal: number;
38
+ droppedByCap: number;
39
+ };
40
+ nodes: ViewerNode[];
41
+ links: ViewerLink[];
42
+ }
43
+ export declare function reduce(raw: RawDump, { maxNodes, keepExternal }?: {
44
+ maxNodes?: number;
45
+ keepExternal?: boolean;
46
+ }): ViewerPayload;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Resolve the per-platform `ttscgraph` binary, or `null` when it cannot be
3
+ * located.
4
+ *
5
+ * `ttsc` is a peer the user installs alongside `@ttsc/graph` (not a dependency
6
+ * of this launcher), so resolution starts from the user's project, not from
7
+ * this package's own tree.
8
+ *
9
+ * Resolution order:
10
+ *
11
+ * 1. `TTSC_GRAPH_BINARY` env var, when set to an absolute path.
12
+ * 2. The per-platform npm package `@ttsc/<platform>-<arch>/bin/ttscgraph[.exe]`.
13
+ * That package carries `ttsc`, `ttscserver`, and `ttscgraph` together and is
14
+ * an `optionalDependency` of `ttsc`, so it is resolved from `ttsc`'s
15
+ * location — found from `process.cwd()` (the project where the agent ran the
16
+ * server).
17
+ */
18
+ export declare function resolveGraphBinary(env?: NodeJS.ProcessEnv, cwd?: string): string | null;
@@ -0,0 +1,8 @@
1
+ import { ITtscGraphNode } from "../structures/ITtscGraphNode";
2
+ /**
3
+ * Derive stable access-path aliases for a member edge from its source
4
+ * expression. If a hop reaches `Owner.member` through `obj.path.member`, the
5
+ * alias `Owner.path.member` keeps both the resolved owner and the concrete
6
+ * access path visible without reopening source.
7
+ */
8
+ export declare function accessAliasesFor(node: ITtscGraphNode | undefined, evidenceText: string | undefined): string[] | undefined;
@@ -0,0 +1,15 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { TtscGraphSource } from "../TtscGraphApplication";
3
+ /**
4
+ * Build the MCP server for a graph. `typia.llm.application` reflects
5
+ * {@link ITtscGraphApplication} into the tool schema and validator (no
6
+ * hand-written schema), and `createMcpServer` from `@typia/mcp` handles the
7
+ * list/call registration, argument validation, and structured output.
8
+ *
9
+ * We assemble the `ILlmController` (`{ protocol, name, application, execute }`)
10
+ * directly rather than via `typia.llm.controller` so the server is named
11
+ * "ttsc-graph" on our terms, not coupled to a reflected class name. Handshake
12
+ * instructions come from the class JSDoc; the single tool is named from its
13
+ * method, `inspect_typescript_graph`.
14
+ */
15
+ export declare function createServer(graph: TtscGraphSource, version: string): McpServer;
@@ -0,0 +1,9 @@
1
+ import { ITtscGraphNode } from "../structures/ITtscGraphNode";
2
+ /** True for dependency declarations outside the authored project graph. */
3
+ export declare function isExternalNode(node: ITtscGraphNode): boolean;
4
+ /** True for tests, examples, fixtures, generated output, and build artifacts. */
5
+ export declare function isSupportPath(file: string): boolean;
6
+ /** True for source files whose declarations are tests or test helpers. */
7
+ export declare function isTestPath(file: string): boolean;
8
+ /** True when exported symbols are unlikely to be authored public API. */
9
+ export declare function isPublicApiNoisePath(file: string): boolean;
@@ -0,0 +1,8 @@
1
+ import { TtscGraphMemory } from "../model/TtscGraphMemory";
2
+ import { ITtscGraphNode } from "../structures/ITtscGraphNode";
3
+ export interface IResolvedGraphHandle {
4
+ node?: ITtscGraphNode;
5
+ candidates?: ITtscGraphNode[];
6
+ }
7
+ /** Resolve a tool handle as an id, exact symbol name, or dotted suffix. */
8
+ export declare function resolveGraphHandle(graph: TtscGraphMemory, handle: string, candidateLimit?: number): IResolvedGraphHandle;
@@ -0,0 +1,3 @@
1
+ import { ITtscGraphNext } from "../structures/ITtscGraphNext";
2
+ export declare function resultGuide(action: string): string;
3
+ export declare function resultNext(action: ITtscGraphNext["action"], reason: string, request?: ITtscGraphNext["request"]): ITtscGraphNext;
@@ -0,0 +1,24 @@
1
+ import { TtscGraphMemory } from "../model/TtscGraphMemory";
2
+ import { ITtscGraphDecorator } from "../structures/ITtscGraphDecorator";
3
+ import { ITtscGraphDetails } from "../structures/ITtscGraphDetails";
4
+ import { ITtscGraphEdge } from "../structures/ITtscGraphEdge";
5
+ import { ITtscGraphEvidence } from "../structures/ITtscGraphEvidence";
6
+ import { ITtscGraphNode } from "../structures/ITtscGraphNode";
7
+ /**
8
+ * Resolve each handle to its declared shape: sourceSpan anchors, signature,
9
+ * direct dependencies, and for containers, member outlines. It answers from the
10
+ * graph's resolved structure instead of inlining implementation bodies.
11
+ */
12
+ export declare function runDetails(graph: TtscGraphMemory, props: ITtscGraphDetails.IRequest): ITtscGraphDetails;
13
+ /** Decorator facts already captured on a node, omitted when absent. */
14
+ export declare function decoratorsOf(node: ITtscGraphNode): ITtscGraphDecorator[] | undefined;
15
+ /** Relationship evidence as public coordinates, omitted when absent. */
16
+ export declare function edgeEvidenceOf(edge: ITtscGraphEdge): ITtscGraphEvidence | undefined;
17
+ /** Source text is an internal alias hint, not part of the MCP evidence object. */
18
+ export declare function edgeEvidenceTextOf(edge: ITtscGraphEdge): string | undefined;
19
+ /**
20
+ * The declaration signature: the head of the declaration up to and including
21
+ * the line that opens its body (`{`), or the single declaration line when there
22
+ * is no brace, capped so a wrapped signature cannot run away.
23
+ */
24
+ export declare function signatureOf(project: string, node: ITtscGraphNode): string | undefined;
@@ -0,0 +1,9 @@
1
+ import { TtscGraphMemory } from "../model/TtscGraphMemory";
2
+ import { ITtscGraphEntrypoints } from "../structures/ITtscGraphEntrypoints";
3
+ /**
4
+ * Build the first source-free entrypoints list for a code question. The result
5
+ * gives the model stable handles, declaration signatures, and direct graph
6
+ * context. It is deliberately not a source reader; details adds selected symbol
7
+ * shape and ranges, not implementation text.
8
+ */
9
+ export declare function runEntrypoints(graph: TtscGraphMemory, props: ITtscGraphEntrypoints.IRequest): ITtscGraphEntrypoints;
@@ -0,0 +1,10 @@
1
+ import { TtscGraphMemory } from "../model/TtscGraphMemory";
2
+ import { ITtscGraphLookup } from "../structures/ITtscGraphLookup";
3
+ /**
4
+ * Rank the graph's symbols against a natural query. Scoring blends exact and
5
+ * dotted-name matches, CamelCase/subword coverage, file-path terms, a prefix
6
+ * bonus, and dependency centrality, then dampens external, generated, and test
7
+ * nodes and caps per file so the result is a diverse, relevant shortlist rather
8
+ * than one file's roster.
9
+ */
10
+ export declare function runLookup(graph: TtscGraphMemory, props: ITtscGraphLookup.IRequest): ITtscGraphLookup;
@@ -0,0 +1,10 @@
1
+ import { TtscGraphMemory } from "../model/TtscGraphMemory";
2
+ import { ITtscGraphOverview } from "../structures/ITtscGraphOverview";
3
+ /**
4
+ * Project a compact, source-read-free architecture map: counts by kind, folder
5
+ * layering with export density, the highest-dependency symbols (ranked by real
6
+ * fan-in/out, excluding structural edges so nesting does not masquerade as
7
+ * dependency), and the export surface by file. Output is bounded so a model
8
+ * reads structure cheaply.
9
+ */
10
+ export declare function runOverview(graph: TtscGraphMemory, props: ITtscGraphOverview.IRequest): ITtscGraphOverview;
@@ -0,0 +1,8 @@
1
+ import { TtscGraphMemory } from "../model/TtscGraphMemory";
2
+ import { ITtscGraphTour } from "../structures/ITtscGraphTour";
3
+ /**
4
+ * Compose a repository-orientation/code-tour answer surface from existing graph
5
+ * operations. It returns selected symbols, flows, nearby edges, test anchors,
6
+ * and answer anchors without reading or embedding source bodies.
7
+ */
8
+ export declare function runTour(graph: TtscGraphMemory, props: ITtscGraphTour.IRequest): ITtscGraphTour;
@@ -0,0 +1,10 @@
1
+ import { TtscGraphMemory } from "../model/TtscGraphMemory";
2
+ import { ITtscGraphTrace } from "../structures/ITtscGraphTrace";
3
+ /**
4
+ * Breadth-first trace along the dependency graph. Structural
5
+ * (contains/exports/imports) edges are excluded so the path is real call/type
6
+ * flow; forward walks callees, reverse and impact walk callers. Impact
7
+ * additionally tags each reached node's role so the blast radius on the public
8
+ * surface is legible.
9
+ */
10
+ export declare function runTrace(graph: TtscGraphMemory, props: ITtscGraphTrace.IRequest): ITtscGraphTrace;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Serve the graph tools over MCP on stdio. The server answers the MCP handshake
3
+ * immediately and builds the resident graph on the first tool call, so a large
4
+ * project cannot make the client give up before tools are advertised.
5
+ */
6
+ export declare function startServer(options: {
7
+ cwd?: string;
8
+ tsconfig?: string;
9
+ /** Server version reported in the MCP handshake. */
10
+ version: string;
11
+ }): Promise<void>;
@@ -0,0 +1,161 @@
1
+ import { ITtscGraphDetails } from "./ITtscGraphDetails";
2
+ import { ITtscGraphEntrypoints } from "./ITtscGraphEntrypoints";
3
+ import { ITtscGraphEscape } from "./ITtscGraphEscape";
4
+ import { ITtscGraphLookup } from "./ITtscGraphLookup";
5
+ import { ITtscGraphOverview } from "./ITtscGraphOverview";
6
+ import { ITtscGraphTour } from "./ITtscGraphTour";
7
+ import { ITtscGraphTrace } from "./ITtscGraphTrace";
8
+ /**
9
+ * ## What This MCP Is
10
+ *
11
+ * `inspect_typescript_graph` returns a compiler-built TypeScript graph contract
12
+ * for the current source snapshot.
13
+ *
14
+ * Use it for architecture, runtime flow, APIs, callers/callees, code tours, and
15
+ * type relations. It returns answer-ready index evidence: names, edges,
16
+ * signatures, decorators, tests, spans, and anchors.
17
+ *
18
+ * Until TS source is edited, returned graph facts are sacred, infallible
19
+ * compiler truth. Never verify them with files or more graph calls.
20
+ *
21
+ * ## Result Contract
22
+ *
23
+ * - The returned object is the graph evidence contract: names, signatures, spans,
24
+ * decorators, tests, edges, steps, anchors, and `next` are answer evidence,
25
+ * not hints.
26
+ * - When `next.action` is `answer`, stop tool use for the current question and
27
+ * answer from the returned result.
28
+ * - `truncated` means the answer surface hit an index cap. Mention the cap if it
29
+ * matters; do not expand every branch to compensate.
30
+ * - When `next.action` is `inspect`, make the focused graph request it names or
31
+ * choose `escape` if the result already answers.
32
+ * - Read files only for exact source body text, configs, docs, generated output,
33
+ * exact text search, non-TypeScript files, or facts the graph marks outside
34
+ * itself. A returned span is a citation anchor, not a reading command.
35
+ * - After editing TypeScript source, the old graph no longer governs changed
36
+ * code. Rebuild/reload the graph or verify changed code normally.
37
+ *
38
+ * ## Sacred Contract
39
+ *
40
+ * Before source edits, returned graph facts are inviolable and errorless. Never
41
+ * use extra graph calls, repository search, or file reads to doubt, fact-check,
42
+ * humanize, re-derive, re-narrate, or re-confirm returned nodes, spans, edges,
43
+ * signatures, decorators, tests, references, steps, or anchors.
44
+ *
45
+ * ## Tour Contract
46
+ *
47
+ * Use `tour` for repository orientation, read-next, architecture tours, and
48
+ * broad runtime flow, including questions that name several phases or
49
+ * subsystems. A tour is the complete index-level answer surface: central
50
+ * entrypoints, primary flow, nearby paths, tests, and anchors. Do not decompose
51
+ * a broad tour into lookup/details loops unless the user later asks for a named
52
+ * missing symbol or exact source text.
53
+ *
54
+ * ## Use Contract
55
+ *
56
+ * 1. Ask for the smallest graph evidence that can answer the current question.
57
+ * 2. Broad flow, repository-orientation, code-tour, or read-next question: start
58
+ * with `tour`.
59
+ * 3. Concrete named symbol: use `lookup`, then `details` only if needed.
60
+ * 4. Known endpoint pair or one selected handle: use one `trace`.
61
+ * 5. Unknown narrow orientation: use `entrypoints` once.
62
+ * 6. Selected symbol shape: use `details` for one to three handles.
63
+ * 7. Follow the returned `next`: answer, inspect once more, leave graph, or
64
+ * clarify.
65
+ * 8. Use `escape` when another graph call would repeat evidence or the remaining
66
+ * evidence is outside the TypeScript graph.
67
+ *
68
+ * Most TypeScript structure answers need one or two graph calls.
69
+ *
70
+ * ## Request Fields
71
+ *
72
+ * Fill the visible checklist, then exactly one request.
73
+ *
74
+ * - `question`: restate the code question being considered.
75
+ * - `draft`: initial request type and why it seems smallest.
76
+ * - `review`: correct a wrong, broad, stale, or duplicate draft. If graph facts
77
+ * already answer, if prior `next.action` was `answer`, or if the next
78
+ * evidence is outside the indexed TypeScript graph, say so here and make
79
+ * `request.type` be `escape`. If a broad flow draft is not `tour`, correct it
80
+ * here.
81
+ * - `request`: final request after review.
82
+ *
83
+ * ## How to answer from graph evidence
84
+ *
85
+ * - Use returned node names, signatures, edges, references, evidence, and
86
+ * `sourceSpan` ranges directly.
87
+ * - Explain the central path first, then mention important branches.
88
+ * - For tests, impact, or reading lists, returned nodes and ranges are the answer
89
+ * evidence, not search keywords.
90
+ * - A returned range is a sacred citation anchor, not permission to open the
91
+ * file.
92
+ */
93
+ export interface ITtscGraphApplication {
94
+ /**
95
+ * Inspect the TypeScript compiler graph contract.
96
+ *
97
+ * Use this before repository search when an answer depends on TypeScript
98
+ * symbols, calls, types, decorators, references, ranges, or runtime/source
99
+ * relationships. For repository orientation, read-next, architecture, and
100
+ * broad runtime flow questions, use `tour`.
101
+ *
102
+ * Returned nodes, edges, signatures, spans, tests, anchors, and `next` are
103
+ * the answer surface. If `next.action` is `answer`, stop tool use and answer
104
+ * from that result. Before source edits, graph facts are sacred, inviolable,
105
+ * complete, and infallible.
106
+ *
107
+ * @param props Reasoning plus one graph request
108
+ * @returns Matching `result` union member
109
+ */
110
+ inspect_typescript_graph(props: ITtscGraphApplication.IProps): ITtscGraphApplication.IResult;
111
+ }
112
+ export declare namespace ITtscGraphApplication {
113
+ /** Draft, review, then submit exactly one graph request or escape. */
114
+ interface IProps {
115
+ /**
116
+ * User's TypeScript code question.
117
+ *
118
+ * Restate the code question being considered. If the next evidence is a
119
+ * script, config, doc, generated output, exact text, non-TypeScript file,
120
+ * or source body text, choose `escape`.
121
+ */
122
+ question: string;
123
+ /**
124
+ * Initial request plan before final arguments are filled.
125
+ *
126
+ * Name the intended request type in `type` and why it seems smallest in
127
+ * `reason`. Broad flow, architecture, repository-orientation, and read-next
128
+ * questions should normally draft `tour`; narrow named symbols can draft
129
+ * `lookup`, `trace`, or `details`.
130
+ */
131
+ draft: IDraft;
132
+ /**
133
+ * Final self-review before calling.
134
+ *
135
+ * Correct a stale, broad, duplicate, or wrong draft here. If broad flow was
136
+ * split into search/detail steps, switch to `tour`. If graph facts already
137
+ * answer, or prior `next.action` was `answer`, make `request.type` be
138
+ * `escape`; do not call graph or read files to re-confirm returned facts.
139
+ */
140
+ review: string;
141
+ /** Final graph operation chosen after review, or a no-op escape. */
142
+ request: ITtscGraphEntrypoints.IRequest | ITtscGraphLookup.IRequest | ITtscGraphTrace.IRequest | ITtscGraphDetails.IRequest | ITtscGraphOverview.IRequest | ITtscGraphTour.IRequest | ITtscGraphEscape.IRequest;
143
+ }
144
+ /**
145
+ * First-pass request plan, filled before the final `request` arguments.
146
+ *
147
+ * `reason` comes before `type` so the justification is written before the
148
+ * choice it justifies.
149
+ */
150
+ interface IDraft {
151
+ /** Why this request type looks like the smallest useful next step. */
152
+ reason: string;
153
+ /** The request type being considered, corrected later in `review`. */
154
+ type: IProps["request"]["type"];
155
+ }
156
+ /** The selected request's output. `result.type` mirrors `request.type`. */
157
+ interface IResult {
158
+ /** Result branch matching the submitted `request.type`. */
159
+ result: ITtscGraphEntrypoints | ITtscGraphLookup | ITtscGraphTrace | ITtscGraphDetails | ITtscGraphOverview | ITtscGraphTour | ITtscGraphEscape;
160
+ }
161
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * A decorator as written on a declaration, carried on the decorated
3
+ * {@link ITtscGraphNode}'s `decorators`.
4
+ *
5
+ * The graph reports the decorator faithfully rather than interpreting any
6
+ * framework's convention: the `name` is the decorator as written (`Controller`,
7
+ * `Get`, `TypedRoute.Get`, ...), and statically resolvable literal arguments
8
+ * are preserved so a consumer can apply its own meaning without re-parsing
9
+ * source.
10
+ */
11
+ export interface ITtscGraphDecorator {
12
+ /**
13
+ * The decorator name as written, qualified through its access path:
14
+ * `Controller`, `Get`, `TypedRoute.Get`, `MessagePattern`.
15
+ */
16
+ name: string;
17
+ /** The literal call arguments, in source order. Empty for a bare decorator. */
18
+ arguments: ITtscGraphDecorator.IArgument[];
19
+ }
20
+ export declare namespace ITtscGraphDecorator {
21
+ /**
22
+ * One argument of an {@link ITtscGraphDecorator}. `literal` is set only when
23
+ * the argument is a string, number, or boolean literal the producer could
24
+ * resolve statically, so a consumer can use it without evaluating code.
25
+ */
26
+ interface IArgument {
27
+ /** The statically-resolved literal value, when the argument is a literal. */
28
+ literal?: string | number | boolean;
29
+ }
30
+ }