@ttsc/graph 0.30.3 → 0.31.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 +122 -30
- package/lib/CapturedProcessOutput.d.ts +47 -0
- package/lib/CapturedProcessOutput.js +3 -0
- package/lib/CapturedProcessOutput.js.map +1 -0
- package/lib/ILauncherOption.d.ts +22 -0
- package/lib/ILauncherOption.js +3 -0
- package/lib/ILauncherOption.js.map +1 -0
- package/lib/IProjectOptions.d.ts +18 -0
- package/lib/IProjectOptions.js +3 -0
- package/lib/IProjectOptions.js.map +1 -0
- package/lib/ParsedLauncherOptions.d.ts +13 -0
- package/lib/ParsedLauncherOptions.js +3 -0
- package/lib/ParsedLauncherOptions.js.map +1 -0
- package/lib/TtscGraphApplication.d.ts +38 -1
- package/lib/TtscGraphApplication.js +26 -1
- package/lib/TtscGraphApplication.js.map +1 -1
- package/lib/TtscGraphLauncherArguments.d.ts +115 -0
- package/lib/TtscGraphLauncherArguments.js +181 -0
- package/lib/TtscGraphLauncherArguments.js.map +1 -0
- package/lib/TtscGraphViewSnapshot.d.ts +35 -0
- package/lib/TtscGraphViewSnapshot.js +48 -0
- package/lib/TtscGraphViewSnapshot.js.map +1 -0
- package/lib/index.d.ts +9 -24
- package/lib/index.js +6 -128
- package/lib/index.js.map +1 -1
- package/lib/internal/GraphProcessTrace.d.ts +1 -0
- package/lib/internal/GraphProcessTrace.js +235 -0
- package/lib/internal/GraphProcessTrace.js.map +1 -0
- package/lib/launcherArgs.d.ts +75 -16
- package/lib/launcherArgs.js +77 -8
- package/lib/launcherArgs.js.map +1 -1
- package/lib/model/IArtifactDirectory.d.ts +26 -0
- package/lib/model/IArtifactDirectory.js +3 -0
- package/lib/model/IArtifactDirectory.js.map +1 -0
- package/lib/model/IArtifactInputs.d.ts +19 -0
- package/lib/model/IArtifactInputs.js +3 -0
- package/lib/model/IArtifactInputs.js.map +1 -0
- package/lib/model/IPublishedArtifacts.d.ts +76 -0
- package/lib/model/IPublishedArtifacts.js +3 -0
- package/lib/model/IPublishedArtifacts.js.map +1 -0
- package/lib/model/IPublishedArtifactsResident.d.ts +19 -0
- package/lib/model/IPublishedArtifactsResident.js +3 -0
- package/lib/model/IPublishedArtifactsResident.js.map +1 -0
- package/lib/model/ITtscLintDaemonTarget.d.ts +20 -0
- package/lib/model/ITtscLintDaemonTarget.js +3 -0
- package/lib/model/ITtscLintDaemonTarget.js.map +1 -0
- package/lib/model/TtscGraphLinePeer.d.ts +146 -0
- package/lib/model/TtscGraphLinePeer.js +213 -0
- package/lib/model/TtscGraphLinePeer.js.map +1 -0
- package/lib/model/TtscGraphMemory.d.ts +156 -16
- package/lib/model/TtscGraphMemory.js +228 -222
- package/lib/model/TtscGraphMemory.js.map +1 -1
- package/lib/model/TtscGraphNativeArguments.d.ts +40 -0
- package/lib/model/TtscGraphNativeArguments.js +64 -0
- package/lib/model/TtscGraphNativeArguments.js.map +1 -0
- package/lib/model/TtscGraphNodeId.d.ts +55 -3
- package/lib/model/TtscGraphNodeId.js +40 -2
- package/lib/model/TtscGraphNodeId.js.map +1 -1
- package/lib/model/TtscGraphProjection.d.ts +156 -0
- package/lib/model/TtscGraphProjection.js +390 -0
- package/lib/model/TtscGraphProjection.js.map +1 -0
- package/lib/model/TtscGraphProtocol.d.ts +28 -0
- package/lib/model/TtscGraphProtocol.js +928 -0
- package/lib/model/TtscGraphProtocol.js.map +1 -0
- package/lib/model/TtscGraphReadonly.d.ts +15 -0
- package/lib/model/TtscGraphReadonly.js +3 -0
- package/lib/model/TtscGraphReadonly.js.map +1 -0
- package/lib/model/TtscGraphRequestOptions.d.ts +16 -0
- package/lib/model/TtscGraphRequestOptions.js +3 -0
- package/lib/model/TtscGraphRequestOptions.js.map +1 -0
- package/lib/model/TtscGraphSession.d.ts +82 -36
- package/lib/model/TtscGraphSession.js +164 -1238
- package/lib/model/TtscGraphSession.js.map +1 -1
- package/lib/model/TtscGraphSessionOptions.d.ts +20 -0
- package/lib/model/TtscGraphSessionOptions.js +3 -0
- package/lib/model/TtscGraphSessionOptions.js.map +1 -0
- package/lib/model/TtscGraphSessionState.d.ts +187 -0
- package/lib/model/TtscGraphSessionState.js +417 -0
- package/lib/model/TtscGraphSessionState.js.map +1 -0
- package/lib/model/TtscGraphShardStore.d.ts +64 -3
- package/lib/model/TtscGraphShardStore.js +85 -15
- package/lib/model/TtscGraphShardStore.js.map +1 -1
- package/lib/model/TtscGraphSourceReader.d.ts +31 -8
- package/lib/model/TtscGraphSourceReader.js +37 -13
- package/lib/model/TtscGraphSourceReader.js.map +1 -1
- package/lib/model/TtscLintDaemon.d.ts +35 -17
- package/lib/model/TtscLintDaemon.js +39 -117
- package/lib/model/TtscLintDaemon.js.map +1 -1
- package/lib/model/TtscLintDaemonState.d.ts +69 -0
- package/lib/model/TtscLintDaemonState.js +166 -0
- package/lib/model/TtscLintDaemonState.js.map +1 -0
- package/lib/model/copyGraphRecords.d.ts +14 -0
- package/lib/model/copyGraphRecords.js +19 -0
- package/lib/model/copyGraphRecords.js.map +1 -0
- package/lib/model/copyGraphSnapshot.d.ts +17 -0
- package/lib/model/copyGraphSnapshot.js +33 -0
- package/lib/model/copyGraphSnapshot.js.map +1 -0
- package/lib/model/loadGraph.d.ts +19 -10
- package/lib/model/loadGraph.js +21 -12
- package/lib/model/loadGraph.js.map +1 -1
- package/lib/model/publishedArtifacts.d.ts +78 -97
- package/lib/model/publishedArtifacts.js +271 -85
- package/lib/model/publishedArtifacts.js.map +1 -1
- package/lib/nativeExecutable.d.ts +19 -8
- package/lib/nativeExecutable.js +75 -15
- package/lib/nativeExecutable.js.map +1 -1
- package/lib/reduce.d.ts +19 -45
- package/lib/reduce.js +19 -3
- package/lib/reduce.js.map +1 -1
- package/lib/resolveGraphBinary.d.ts +9 -0
- package/lib/resolveGraphBinary.js +11 -3
- package/lib/resolveGraphBinary.js.map +1 -1
- package/lib/runGraph.d.ts +21 -0
- package/lib/runGraph.js +83 -0
- package/lib/runGraph.js.map +1 -0
- package/lib/server/IResolvedGraphHandle.d.ts +22 -0
- package/lib/server/IResolvedGraphHandle.js +3 -0
- package/lib/server/IResolvedGraphHandle.js.map +1 -0
- package/lib/server/createServer.d.ts +14 -10
- package/lib/server/createServer.js +42 -39
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/exportSurface.d.ts +23 -1
- package/lib/server/exportSurface.js +23 -1
- package/lib/server/exportSurface.js.map +1 -1
- package/lib/server/formatGraphFailure.d.ts +20 -0
- package/lib/server/formatGraphFailure.js +35 -0
- package/lib/server/formatGraphFailure.js.map +1 -0
- package/lib/server/pathPolicy.d.ts +70 -5
- package/lib/server/pathPolicy.js +66 -4
- package/lib/server/pathPolicy.js.map +1 -1
- package/lib/server/resolveHandle.d.ts +10 -5
- package/lib/server/resolveHandle.js +39 -7
- package/lib/server/resolveHandle.js.map +1 -1
- package/lib/server/resultAudit.d.ts +17 -14
- package/lib/server/resultAudit.js +56 -27
- package/lib/server/resultAudit.js.map +1 -1
- package/lib/server/resultNext.d.ts +26 -1
- package/lib/server/resultNext.js +14 -0
- package/lib/server/resultNext.js.map +1 -1
- package/lib/server/runDetails.d.ts +72 -15
- package/lib/server/runDetails.js +104 -69
- package/lib/server/runDetails.js.map +1 -1
- package/lib/server/runEntrypoints.d.ts +9 -0
- package/lib/server/runEntrypoints.js +9 -0
- package/lib/server/runEntrypoints.js.map +1 -1
- package/lib/server/runLookup.d.ts +13 -3
- package/lib/server/runLookup.js +19 -6
- package/lib/server/runLookup.js.map +1 -1
- package/lib/server/runOverview.d.ts +13 -4
- package/lib/server/runOverview.js +13 -4
- package/lib/server/runOverview.js.map +1 -1
- package/lib/server/runTour.d.ts +9 -0
- package/lib/server/runTour.js +33 -65
- package/lib/server/runTour.js.map +1 -1
- package/lib/server/runTrace.d.ts +25 -1
- package/lib/server/runTrace.js +133 -88
- package/lib/server/runTrace.js.map +1 -1
- package/lib/server/startServer.d.ts +16 -0
- package/lib/server/startServer.js +24 -1
- package/lib/server/startServer.js.map +1 -1
- package/lib/structures/ITtscGraphApplication.d.ts +95 -41
- package/lib/structures/ITtscGraphDecorator.d.ts +18 -0
- package/lib/structures/ITtscGraphDetails.d.ts +81 -6
- package/lib/structures/ITtscGraphDocTag.d.ts +17 -8
- package/lib/structures/ITtscGraphDump.d.ts +106 -8
- package/lib/structures/ITtscGraphEdge.d.ts +14 -2
- package/lib/structures/ITtscGraphEntrypoints.d.ts +81 -6
- package/lib/structures/ITtscGraphEscape.d.ts +24 -2
- package/lib/structures/ITtscGraphEvidence.d.ts +9 -0
- package/lib/structures/ITtscGraphLookup.d.ts +42 -9
- package/lib/structures/ITtscGraphNext.d.ts +12 -1
- package/lib/structures/ITtscGraphNode.d.ts +38 -11
- package/lib/structures/ITtscGraphOverview.d.ts +81 -6
- package/lib/structures/ITtscGraphSnapshot.d.ts +97 -2
- package/lib/structures/ITtscGraphSpan.d.ts +9 -0
- package/lib/structures/ITtscGraphTour.d.ts +83 -9
- package/lib/structures/ITtscGraphTrace.d.ts +99 -14
- package/lib/structures/RawDump.d.ts +22 -0
- package/lib/structures/RawDump.js +3 -0
- package/lib/structures/RawDump.js.map +1 -0
- package/lib/structures/RawEdge.d.ts +20 -0
- package/lib/structures/RawEdge.js +3 -0
- package/lib/structures/RawEdge.js.map +1 -0
- package/lib/structures/RawNode.d.ts +26 -0
- package/lib/structures/RawNode.js +3 -0
- package/lib/structures/RawNode.js.map +1 -0
- package/lib/structures/TtscGraphArtifactNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js +9 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js.map +1 -1
- package/lib/structures/TtscGraphDumpEdgeKind.d.ts +15 -1
- package/lib/structures/TtscGraphDumpNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphEdgeKind.d.ts +13 -4
- package/lib/structures/TtscGraphNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphNodeModifier.d.ts +9 -0
- package/lib/structures/ViewerLink.d.ts +20 -0
- package/lib/structures/ViewerLink.js +3 -0
- package/lib/structures/ViewerLink.js.map +1 -0
- package/lib/structures/ViewerNode.d.ts +24 -0
- package/lib/structures/ViewerNode.js +3 -0
- package/lib/structures/ViewerNode.js.map +1 -0
- package/lib/structures/ViewerPayload.d.ts +42 -0
- package/lib/structures/ViewerPayload.js +3 -0
- package/lib/structures/ViewerPayload.js.map +1 -0
- package/lib/view.d.ts +9 -0
- package/lib/view.js +203 -91
- package/lib/view.js.map +1 -1
- package/lib/viewer/viewer.js +1 -1
- package/package.json +8 -6
- package/src/CapturedProcessOutput.ts +50 -0
- package/src/ILauncherOption.ts +24 -0
- package/src/IProjectOptions.ts +19 -0
- package/src/ParsedLauncherOptions.ts +13 -0
- package/src/TtscGraphApplication.ts +38 -1
- package/src/TtscGraphLauncherArguments.ts +207 -0
- package/src/TtscGraphViewSnapshot.ts +46 -0
- package/src/index.ts +9 -160
- package/src/internal/GraphProcessTrace.ts +242 -0
- package/src/launcherArgs.ts +89 -23
- package/src/model/IArtifactDirectory.ts +27 -0
- package/src/model/IArtifactInputs.ts +21 -0
- package/src/model/IPublishedArtifacts.ts +81 -0
- package/src/model/IPublishedArtifactsResident.ts +24 -0
- package/src/model/ITtscLintDaemonTarget.ts +22 -0
- package/src/model/TtscGraphLinePeer.ts +318 -0
- package/src/model/TtscGraphMemory.ts +284 -246
- package/src/model/TtscGraphNativeArguments.ts +67 -0
- package/src/model/TtscGraphNodeId.ts +57 -3
- package/src/model/TtscGraphProjection.ts +473 -0
- package/src/model/TtscGraphProtocol.ts +90 -0
- package/src/model/TtscGraphReadonly.ts +17 -0
- package/src/model/TtscGraphRequestOptions.ts +16 -0
- package/src/model/TtscGraphSession.ts +196 -475
- package/src/model/TtscGraphSessionOptions.ts +22 -0
- package/src/model/TtscGraphSessionState.ts +558 -0
- package/src/model/TtscGraphShardStore.ts +99 -23
- package/src/model/TtscGraphSourceReader.ts +37 -15
- package/src/model/TtscLintDaemon.ts +55 -136
- package/src/model/TtscLintDaemonState.ts +174 -0
- package/src/model/copyGraphRecords.ts +17 -0
- package/src/model/copyGraphSnapshot.ts +30 -0
- package/src/model/loadGraph.ts +23 -12
- package/src/model/publishedArtifacts.ts +361 -182
- package/src/nativeExecutable.ts +93 -26
- package/src/reduce.ts +24 -51
- package/src/resolveGraphBinary.ts +13 -3
- package/src/runGraph.ts +90 -0
- package/src/server/IResolvedGraphHandle.ts +24 -0
- package/src/server/createServer.ts +16 -22
- package/src/server/exportSurface.ts +23 -1
- package/src/server/formatGraphFailure.ts +32 -0
- package/src/server/pathPolicy.ts +70 -5
- package/src/server/resolveHandle.ts +45 -14
- package/src/server/resultAudit.ts +58 -27
- package/src/server/resultNext.ts +26 -1
- package/src/server/runDetails.ts +138 -73
- package/src/server/runEntrypoints.ts +13 -1
- package/src/server/runLookup.ts +23 -7
- package/src/server/runOverview.ts +17 -5
- package/src/server/runTour.ts +44 -82
- package/src/server/runTrace.ts +175 -102
- package/src/server/startServer.ts +29 -1
- package/src/structures/ITtscGraphApplication.ts +95 -41
- package/src/structures/ITtscGraphDecorator.ts +18 -0
- package/src/structures/ITtscGraphDetails.ts +81 -6
- package/src/structures/ITtscGraphDocTag.ts +17 -8
- package/src/structures/ITtscGraphDump.ts +106 -8
- package/src/structures/ITtscGraphEdge.ts +14 -2
- package/src/structures/ITtscGraphEntrypoints.ts +81 -6
- package/src/structures/ITtscGraphEscape.ts +24 -2
- package/src/structures/ITtscGraphEvidence.ts +9 -0
- package/src/structures/ITtscGraphLookup.ts +42 -9
- package/src/structures/ITtscGraphNext.ts +12 -1
- package/src/structures/ITtscGraphNode.ts +38 -11
- package/src/structures/ITtscGraphOverview.ts +88 -6
- package/src/structures/ITtscGraphSnapshot.ts +117 -2
- package/src/structures/ITtscGraphSpan.ts +9 -0
- package/src/structures/ITtscGraphTour.ts +83 -9
- package/src/structures/ITtscGraphTrace.ts +100 -14
- package/src/structures/RawDump.ts +25 -0
- package/src/structures/RawEdge.ts +22 -0
- package/src/structures/RawNode.ts +31 -0
- package/src/structures/TtscGraphArtifactNodeKind.ts +9 -0
- package/src/structures/TtscGraphDumpEdgeKind.ts +15 -1
- package/src/structures/TtscGraphDumpNodeKind.ts +9 -0
- package/src/structures/TtscGraphEdgeKind.ts +13 -4
- package/src/structures/TtscGraphNodeKind.ts +9 -0
- package/src/structures/TtscGraphNodeModifier.ts +9 -0
- package/src/structures/ViewerLink.ts +22 -0
- package/src/structures/ViewerNode.ts +28 -0
- package/src/structures/ViewerPayload.ts +52 -0
- package/src/view.ts +208 -110
- package/src/viewer/legend.ts +119 -27
|
@@ -49,38 +49,42 @@ const TtscGraphApplication_1 = require("../TtscGraphApplication");
|
|
|
49
49
|
* input and output schemas and its argument validator, with no hand-written
|
|
50
50
|
* schema: the interface's JSDoc becomes the handshake instructions, the
|
|
51
51
|
* method's becomes the tool description, and every property's becomes the
|
|
52
|
-
* description of that field — including `audit`, whose JSDoc
|
|
53
|
-
*
|
|
52
|
+
* description of that field — including `audit`, whose JSDoc explains fact
|
|
53
|
+
* provenance and coverage without claiming a second compiler check.
|
|
54
54
|
*
|
|
55
|
-
* The
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
55
|
+
* The library owns registration and sends structured results once by default.
|
|
56
|
+
* Its version option identifies this graph server in the handshake without
|
|
57
|
+
* changing SDK internals after construction.
|
|
58
|
+
*
|
|
59
|
+
* @evidence contracts/common.md#principled-implementation The typed controller supplies reflected schemas and executor dispatch; the supported version option sets the MCP implementation identity at construction.
|
|
60
|
+
* @evidence contracts/common.md#clear-and-simple-design The integration delegates registration and result serialization to the library instead of maintaining another transport implementation.
|
|
61
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Handshake version uses the public createMcpServer option; no SDK private field or foreign method is patched.
|
|
62
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain schema/JSDoc reflection, structured-result ownership and public version configuration.
|
|
63
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a server whose transport lifetime startServer owns.
|
|
64
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms builds the MCP server once from the typia controller, with no loop of its own.
|
|
65
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work called once per process; the schema reflection happens at compile time.
|
|
66
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation creates an in-memory MCP server object; startServer attaches the stdio transport.
|
|
63
67
|
*/
|
|
64
68
|
function createServer(graph, version) {
|
|
65
|
-
|
|
69
|
+
return (0, mcp_1.createMcpServer)({
|
|
66
70
|
"protocol": "class",
|
|
67
71
|
"name": "ttsc-graph",
|
|
68
72
|
"execute": new TtscGraphApplication_1.TtscGraphApplication(graph),
|
|
69
73
|
"application": _llmApplicationFinalize_1._llmApplicationFinalize({
|
|
70
|
-
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\
|
|
74
|
+
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\nDeclaration facts come from the compiler for the synchronized snapshot.\nThe server derives file containers, containment, property kinds, path-convention test roles and dispatch\nhops; lint plugins supply artifact facts. The result's audit distinguishes\nthese producers. Trust compiler facts without re-checking against files.\nWhere an operation ranks a shortlist against your question (`lookup`,\n`entrypoints`, `tour`), its compiler facts retain that provenance while\nselection 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, or \u2014 with a documentation target as the\n query (`docs/pricing.md#sale`, `POST:/orders`) \u2014 the declarations whose\n documentation cites it.\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, compiler declaration facts retain the resolution of the\nsynchronized snapshot. The server derives `file` containers, `contains`\nownership, `property` kinds, `dispatches` hops and path-convention `test`\nroles from those declarations. Lint plugins supply document, data-model and API-operation facts; `audit`\nidentifies these distinct producers. Never use extra graph calls,\nrepository 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 result projects\nthe snapshot's facts and identifies their provenance; this server does not\nperform a second compiler verification pass.\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.",
|
|
71
75
|
config: {
|
|
72
76
|
strict: false
|
|
73
77
|
},
|
|
74
78
|
functions: [
|
|
75
79
|
{
|
|
76
|
-
description: "Answer a TypeScript question from the
|
|
80
|
+
description: "Answer a TypeScript question from the synchronized source snapshot.\nSubmit one request:\n\n- `tour`: architecture, runtime flow and nearby tests in one orientation\n- `trace`: calls, callers or the path from A to B\n- `details`: signatures, members and interface implementations\n- `lookup`: named declarations\n- `entrypoints`: where execution starts\n- `overview`: project layers and folders\n- `escape`: source bodies, span text or evidence outside the graph\n\n`audit` identifies compiler declaration facts, server-derived structure\nand plugin artifact facts; it does not claim a second compiler check.\nJudge the coverage of ranked `lookup`, `entrypoints` and `tour` shortlists.\nFollow `next`; read source for omitted body text or missed coverage.",
|
|
77
81
|
name: "inspect_typescript_graph",
|
|
78
82
|
output: {
|
|
79
83
|
type: "object",
|
|
80
84
|
properties: {
|
|
81
85
|
audit: {
|
|
82
86
|
type: "string",
|
|
83
|
-
description: "
|
|
87
|
+
description: "The provenance and coverage of the returned projection. Compiler facts\nbelong to the synchronized program; file containers, containment,\nproperty kinds, path-convention test roles and dispatch hops are server-derived structure. Artifact\nfacts come from the publishing lint plugin. This text reports those\norigins without claiming a second compiler verification pass.\n\nThe audit is operation-aware. For the walks from a named handle (`trace`,\n`overview`) it reports the result as the structure the graph holds,\nbounded where `truncated` says. For `details` it reports the two halves\nof a resolved symbol: its own shape returned whole, its fan-out returned\nas a slice with `trace` for the rest. For the ranked operations\n(`lookup`, `entrypoints`, `tour`) it adds that the selection is heuristic\n\u2014 matched, scored, ranked, and limited against the question \u2014 so the\nfacts are verified but the shortlist's coverage is the caller's to\njudge."
|
|
84
88
|
},
|
|
85
89
|
next: {
|
|
86
90
|
$ref: "#/$defs/ITtscGraphNext",
|
|
@@ -131,7 +135,7 @@ function createServer(graph, version) {
|
|
|
131
135
|
"result"
|
|
132
136
|
],
|
|
133
137
|
additionalProperties: false,
|
|
134
|
-
description: "The selected request's output. `result.type` mirrors `request.type`.",
|
|
138
|
+
description: "The selected request's output. `result.type` mirrors `request.type`.\n\n------------------------------\n\nDescription of the current {@link ITtscGraphApplication.IOutput} type:\n\n> The selected request's output. `result.type` mirrors `request.type`.",
|
|
135
139
|
$defs: {
|
|
136
140
|
ITtscGraphDecorator: {
|
|
137
141
|
type: "object",
|
|
@@ -469,14 +473,14 @@ function createServer(graph, version) {
|
|
|
469
473
|
},
|
|
470
474
|
text: {
|
|
471
475
|
type: "string",
|
|
472
|
-
description: "Everything written after the tag name, joined into one line.\n\nAn inline link keeps the braced form it was written in (`{@link ISale}`)
|
|
476
|
+
description: "Everything written after the tag name, joined into one line.\n\nAn inline link keeps the braced form it was written in (`{@link ISale}`), so\na consumer matching a citation target sees what the author typed. The same\nlink is separately a resolved edge on the node, which is what says _which_\n`ISale` \u2014 a name can be declared twice and only the checker knows.\n\nAbsent when the tag carries no text."
|
|
473
477
|
}
|
|
474
478
|
},
|
|
475
479
|
required: [
|
|
476
480
|
"name"
|
|
477
481
|
],
|
|
478
482
|
additionalProperties: false,
|
|
479
|
-
description: "One documentation tag TypeScript itself does not recognize, written on a\ndeclaration and carried on its ITtscGraphNode's `docTags`.\n\nA convention attaches a declaration to something outside the type system \u2014 a\nspecification section, an API operation, a reference document \u2014 and writes\nthat attachment as a tag, because the thing on the other end is not a\nTypeScript declaration and so cannot be an edge. `@evidence\ndocs/pricing.md#sale`, `@reference https://\u2026`, and a project's own `@spec`\nare one fact in three spellings.\n\nReported faithfully, never interpreted. The graph does not say a tag's text\nresolves to anything, is covered, or is true \u2014 a target naming nothing is\ncarried exactly as written, the way ITtscGraphDecorator carries\n`@Controller` without knowing what a controller is.\n\nWhich tags arrive is the compiler's boundary, not a list kept here: these are\nthe tags the parser had no meaning for. A known tag \u2014 `@param`, `@returns`,\n`@deprecated` \u2014 has its own shape and its own meaning and is not one of\nthese.\n\nThe parser also decides where a tag begins, and that decision is reported\nrather than second-guessed. TypeScript opens a tag at an `@` wherever it sits\ninside a documentation block, so a tag name written mid-sentence arrives here\nas a tag, while a `//` comment is not documentation and contributes nothing
|
|
483
|
+
description: "One documentation tag TypeScript itself does not recognize, written on a\ndeclaration and carried on its ITtscGraphNode's `docTags`.\n\nA convention attaches a declaration to something outside the type system \u2014 a\nspecification section, an API operation, a reference document \u2014 and writes\nthat attachment as a tag, because the thing on the other end is not a\nTypeScript declaration and so cannot be an edge. `@evidence\ndocs/pricing.md#sale`, `@reference https://\u2026`, and a project's own `@spec`\nare one fact in three spellings.\n\nReported faithfully, never interpreted. The graph does not say a tag's text\nresolves to anything, is covered, or is true \u2014 a target naming nothing is\ncarried exactly as written, the way ITtscGraphDecorator carries\n`@Controller` without knowing what a controller is.\n\nWhich tags arrive is the compiler's boundary, not a list kept here: these are\nthe tags the parser had no meaning for. A known tag \u2014 `@param`, `@returns`,\n`@deprecated` \u2014 has its own shape and its own meaning and is not one of\nthese.\n\nThe parser also decides where a tag begins, and that decision is reported\nrather than second-guessed. TypeScript opens a tag at an `@` wherever it sits\ninside a documentation block, so a tag name written mid-sentence arrives here\nas a tag, while a `//` comment is not documentation and contributes nothing\nat all. A convention that wants the stricter rule enforces it in its own\nlinter, where the author gets a diagnostic; the graph reports what the\ncompiler parsed."
|
|
480
484
|
},
|
|
481
485
|
ITtscGraphEntrypoints: {
|
|
482
486
|
type: "object",
|
|
@@ -827,7 +831,7 @@ function createServer(graph, version) {
|
|
|
827
831
|
},
|
|
828
832
|
truncated: {
|
|
829
833
|
type: "boolean",
|
|
830
|
-
description: "True when a match was left out by the limit.\n\nThe audit for the ranked operations already tells a reader that
|
|
834
|
+
description: "True when a match was left out by the limit.\n\nThe audit for the ranked operations already tells a reader that `truncated`\nmarks where more was left out, and this result had no such field \u2014 so a cut\nlooked exactly like a complete answer. That is tolerable for a name query,\nwhere the ranking is a shortlist by design, and it is not for a\ndocumentation target: those hits are an exact match on an address, so a\ncaller asking which code implements a specification is owed the fact that\nit did not get all of it."
|
|
831
835
|
}
|
|
832
836
|
},
|
|
833
837
|
required: [
|
|
@@ -1371,11 +1375,11 @@ function createServer(graph, version) {
|
|
|
1371
1375
|
items: {
|
|
1372
1376
|
$ref: "#/$defs/ITtscGraphTrace.INode"
|
|
1373
1377
|
},
|
|
1374
|
-
description: "Unique nodes reached (excluding the start), each with its depth and roles."
|
|
1378
|
+
description: "Unique nodes reached (excluding the start), each with its depth, and its roles on an impact trace."
|
|
1375
1379
|
},
|
|
1376
1380
|
truncated: {
|
|
1377
1381
|
type: "boolean",
|
|
1378
|
-
description: "
|
|
1382
|
+
description: "True when an open walk omitted an eligible node or hop, or an unsuccessful path search stopped on a depth or dispatch bound."
|
|
1379
1383
|
},
|
|
1380
1384
|
target: {
|
|
1381
1385
|
$ref: "#/$defs/ITtscGraphTrace.INode",
|
|
@@ -1393,14 +1397,14 @@ function createServer(graph, version) {
|
|
|
1393
1397
|
items: {
|
|
1394
1398
|
type: "string"
|
|
1395
1399
|
},
|
|
1396
|
-
description: "
|
|
1400
|
+
description: "Hop summaries preserving names and evidence. First twelve by default; every returned hop with `complete: true`."
|
|
1397
1401
|
},
|
|
1398
1402
|
junctions: {
|
|
1399
1403
|
type: "array",
|
|
1400
1404
|
items: {
|
|
1401
1405
|
$ref: "#/$defs/ITtscGraphTrace.IJunction"
|
|
1402
1406
|
},
|
|
1403
|
-
description: "
|
|
1407
|
+
description: "Up to four ranked symbols both ends touch, when no call path runs between\nthem. This diagnostic summary does not change path-search completeness.\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."
|
|
1404
1408
|
},
|
|
1405
1409
|
candidates: {
|
|
1406
1410
|
type: "array",
|
|
@@ -1559,7 +1563,7 @@ function createServer(graph, version) {
|
|
|
1559
1563
|
items: {
|
|
1560
1564
|
type: "string"
|
|
1561
1565
|
},
|
|
1562
|
-
description: "Why this node matters to an impact trace: `exported
|
|
1566
|
+
description: "Why this node matters to an impact trace: `exported` (a compiler fact) or `test` (assigned by the server from a conventional test path, not by the compiler)."
|
|
1563
1567
|
}
|
|
1564
1568
|
},
|
|
1565
1569
|
required: [
|
|
@@ -1664,7 +1668,7 @@ function createServer(graph, version) {
|
|
|
1664
1668
|
"request"
|
|
1665
1669
|
],
|
|
1666
1670
|
additionalProperties: false,
|
|
1667
|
-
description: "Draft, review, then submit exactly one graph request or escape.",
|
|
1671
|
+
description: "Draft, review, then submit exactly one graph request or escape.\n\n------------------------------\n\nDescription of the current {@link ITtscGraphApplication.IProps} type:\n\n> Draft, review, then submit exactly one graph request or escape.",
|
|
1668
1672
|
$defs: {
|
|
1669
1673
|
"ITtscGraphApplication.IDraft": {
|
|
1670
1674
|
type: "object",
|
|
@@ -1871,7 +1875,7 @@ function createServer(graph, version) {
|
|
|
1871
1875
|
},
|
|
1872
1876
|
limit: {
|
|
1873
1877
|
type: "number",
|
|
1874
|
-
description: "Central entrypoints to seed the tour.
|
|
1878
|
+
description: "Central entrypoints to seed the tour, from 1 to 5. The default is the\nmaximum, so a larger value changes nothing and a smaller one narrows the\ntour."
|
|
1875
1879
|
},
|
|
1876
1880
|
includeTests: {
|
|
1877
1881
|
type: "boolean",
|
|
@@ -1883,7 +1887,7 @@ function createServer(graph, version) {
|
|
|
1883
1887
|
"reinterpretations"
|
|
1884
1888
|
],
|
|
1885
1889
|
additionalProperties: false,
|
|
1886
|
-
description: "A broad code tour: entrypoints, primary flow, nearby paths, and tests.\n\nIt
|
|
1890
|
+
description: "A broad code tour: entrypoints, primary flow, nearby paths, and tests.\n\nIt uses the outer question for explicit handles and the caller's symbol\nreinterpretations for identifier alignment, alongside graph centrality."
|
|
1887
1891
|
},
|
|
1888
1892
|
"ITtscGraphTrace.IRequest": {
|
|
1889
1893
|
type: "object",
|
|
@@ -1921,13 +1925,17 @@ function createServer(graph, version) {
|
|
|
1921
1925
|
],
|
|
1922
1926
|
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`."
|
|
1923
1927
|
},
|
|
1928
|
+
complete: {
|
|
1929
|
+
type: "boolean",
|
|
1930
|
+
description: "Exhaust the finite graph admitted by direction, focus and external-node\npolicy, including every eligible dispatch relation. Overrides maxDepth,\nmaxNodes, hop budgets and limits on hop summaries. Path mode returns one shortest path.\n\nOutput and synchronous traversal can grow with the entire graph; there is\nno per-request cancellation or fixed response-size bound. Resource or\ntransport failures fail the request rather than return partial success."
|
|
1931
|
+
},
|
|
1924
1932
|
maxDepth: {
|
|
1925
1933
|
type: "number",
|
|
1926
|
-
description: "Hops deep to follow
|
|
1934
|
+
description: "Hops deep to follow. Positive finite values have no upper clamp and are\nrounded down; invalid or omitted values use 3 (12 in path mode).\nValues below one become one. Ignored with complete true."
|
|
1927
1935
|
},
|
|
1928
1936
|
maxNodes: {
|
|
1929
1937
|
type: "number",
|
|
1930
|
-
description: "Cap on reached nodes
|
|
1938
|
+
description: "Cap on unique reached nodes, excluding the start. Positive finite values\nhave no upper clamp and are rounded down; invalid or omitted values use\n12. Values below one become one. Open walks also limit hops to twice this\nbudget and withhold dispatch fanouts of twelve or more implementations.\nUse complete true to remove every traversal budget. Path mode ignores\nmaxNodes."
|
|
1931
1939
|
},
|
|
1932
1940
|
includeExternal: {
|
|
1933
1941
|
type: "boolean",
|
|
@@ -1977,7 +1985,7 @@ function createServer(graph, version) {
|
|
|
1977
1985
|
const _io4 = input => "lookup" === input.type && _ip2(input) && _ip3(input) && _ip1(input);
|
|
1978
1986
|
const _io5 = input => "overview" === input.type && (undefined === input.aspect || "all" === input.aspect || "hotspots" === input.aspect || "layers" === input.aspect || "publicApi" === input.aspect);
|
|
1979
1987
|
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);
|
|
1980
|
-
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);
|
|
1988
|
+
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.complete || "boolean" === typeof input.complete) && (undefined === input.maxDepth || "number" === typeof input.maxDepth) && (undefined === input.maxNodes || "number" === typeof input.maxNodes) && _ip1(input);
|
|
1981
1989
|
const _io8 = input => "escape" === input.type && _ip0(input) && (undefined === input.nextStep || "string" === typeof input.nextStep);
|
|
1982
1990
|
const _iu0 = input => (() => {
|
|
1983
1991
|
if ("details" === input.type)
|
|
@@ -2124,6 +2132,10 @@ function createServer(graph, version) {
|
|
|
2124
2132
|
path: _path + ".focus",
|
|
2125
2133
|
expected: "(\"all\" | \"execution\" | \"types\" | undefined)",
|
|
2126
2134
|
value: input.focus
|
|
2135
|
+
}), undefined === input.complete || "boolean" === typeof input.complete || _report(_exceptionable, {
|
|
2136
|
+
path: _path + ".complete",
|
|
2137
|
+
expected: "(boolean | undefined)",
|
|
2138
|
+
value: input.complete
|
|
2127
2139
|
}), undefined === input.maxDepth || "number" === typeof input.maxDepth || _report(_exceptionable, {
|
|
2128
2140
|
path: _path + ".maxDepth",
|
|
2129
2141
|
expected: "(number | undefined)",
|
|
@@ -2199,15 +2211,6 @@ function createServer(graph, version) {
|
|
|
2199
2211
|
}
|
|
2200
2212
|
]
|
|
2201
2213
|
})
|
|
2202
|
-
});
|
|
2203
|
-
// @typia/mcp 13.1.0 exposes no class-controller version option. The MCP SDK
|
|
2204
|
-
// keeps the initialize implementation on its public inner Server, so update
|
|
2205
|
-
// that already-constructed implementation before any transport connects.
|
|
2206
|
-
const inner = server.server;
|
|
2207
|
-
if (inner._serverInfo === undefined) {
|
|
2208
|
-
throw new Error("@ttsc/graph: MCP SDK omitted the server implementation");
|
|
2209
|
-
}
|
|
2210
|
-
inner._serverInfo.version = version;
|
|
2211
|
-
return server;
|
|
2214
|
+
}, { version });
|
|
2212
2215
|
}
|
|
2213
2216
|
//# sourceMappingURL=createServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServer.js","sourceRoot":"","sources":["../../src/server/createServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oCAA6C;AAC7C,kDAA0B;AAE1B,kEAAgF;AAGhF
|
|
1
|
+
{"version":3,"file":"createServer.js","sourceRoot":"","sources":["../../src/server/createServer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,oCAA6C;AAC7C,kDAA0B;AAE1B,kEAAgF;AAGhF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,sBACE,KAAsB,EACtB,OAAe;IAEf,OAAO,IAAA,qBAAe;;gBAElB,YAAY;mBACZ,IAAI,2CAAoB,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEjC,EAAE,OAAO,EAAE,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -20,7 +20,29 @@ import { TtscGraphMemory } from "../model/TtscGraphMemory";
|
|
|
20
20
|
*
|
|
21
21
|
* The count is a fact the compiler resolved. It reads no package.json, guesses
|
|
22
22
|
* from no filename, and holds for a project that has neither.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation Counting incoming exports edges reports modules whose checker-resolved export tables publish this exact node.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One predicate supplies the graph-derived public-surface signal to handle and tour ranking.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No package.json, file-name front-door guess or named project's expected score substitutes for export relationships.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain barrel/re-export propagation and distinguish edge count from declaring-file exported status.
|
|
28
|
+
* @evidence contracts/performance.md#efficient-algorithms The incoming index restricts counting to this node's degree instead of scanning every graph edge.
|
|
29
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This count is a primitive over an already shared generation index; caller-owned rank computation decides any broader reuse.
|
|
30
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Counting borrows indexed edges and retains only a scalar local accumulator.
|
|
31
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation counts edges in an in-memory index.
|
|
23
32
|
*/
|
|
24
33
|
export declare function exportFanIn(graph: TtscGraphMemory, id: string): number;
|
|
25
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* True when the graph carries an exports edge at all.
|
|
36
|
+
*
|
|
37
|
+
* The answer is cached by immutable graph generation, including false.
|
|
38
|
+
*
|
|
39
|
+
* @evidence contracts/common.md#principled-implementation Existence of an exports edge establishes collection of at least one module surface without guessing from local declaration flags.
|
|
40
|
+
* @evidence contracts/common.md#clear-and-simple-design A WeakMap holds the generation-wide predicate result for all rankers.
|
|
41
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts A false cached answer is retained as a real result rather than mistaken for a cache miss.
|
|
42
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the edge criterion and generation-scoped caching.
|
|
43
|
+
* @evidence contracts/performance.md#efficient-algorithms The first check scans edges until a match; later lookups are map accesses.
|
|
44
|
+
* @evidence contracts/performance.md#reuse-equivalent-work The model's owned frozen facts make graph identity a stable generation key; a new generation is a different key and does not inherit the result.
|
|
45
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources WeakMap entries follow graph reachability and do not retain historical graph generations.
|
|
46
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation scans in-memory edges and caches the answer per graph object.
|
|
47
|
+
*/
|
|
26
48
|
export declare function hasExportSurface(graph: TtscGraphMemory): boolean;
|
|
@@ -23,6 +23,15 @@ exports.hasExportSurface = hasExportSurface;
|
|
|
23
23
|
*
|
|
24
24
|
* The count is a fact the compiler resolved. It reads no package.json, guesses
|
|
25
25
|
* from no filename, and holds for a project that has neither.
|
|
26
|
+
*
|
|
27
|
+
* @evidence contracts/common.md#principled-implementation Counting incoming exports edges reports modules whose checker-resolved export tables publish this exact node.
|
|
28
|
+
* @evidence contracts/common.md#clear-and-simple-design One predicate supplies the graph-derived public-surface signal to handle and tour ranking.
|
|
29
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No package.json, file-name front-door guess or named project's expected score substitutes for export relationships.
|
|
30
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain barrel/re-export propagation and distinguish edge count from declaring-file exported status.
|
|
31
|
+
* @evidence contracts/performance.md#efficient-algorithms The incoming index restricts counting to this node's degree instead of scanning every graph edge.
|
|
32
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work This count is a primitive over an already shared generation index; caller-owned rank computation decides any broader reuse.
|
|
33
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Counting borrows indexed edges and retains only a scalar local accumulator.
|
|
34
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation counts edges in an in-memory index.
|
|
26
35
|
*/
|
|
27
36
|
function exportFanIn(graph, id) {
|
|
28
37
|
let count = 0;
|
|
@@ -31,7 +40,20 @@ function exportFanIn(graph, id) {
|
|
|
31
40
|
count++;
|
|
32
41
|
return count;
|
|
33
42
|
}
|
|
34
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* True when the graph carries an exports edge at all.
|
|
45
|
+
*
|
|
46
|
+
* The answer is cached by immutable graph generation, including false.
|
|
47
|
+
*
|
|
48
|
+
* @evidence contracts/common.md#principled-implementation Existence of an exports edge establishes collection of at least one module surface without guessing from local declaration flags.
|
|
49
|
+
* @evidence contracts/common.md#clear-and-simple-design A WeakMap holds the generation-wide predicate result for all rankers.
|
|
50
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts A false cached answer is retained as a real result rather than mistaken for a cache miss.
|
|
51
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the edge criterion and generation-scoped caching.
|
|
52
|
+
* @evidence contracts/performance.md#efficient-algorithms The first check scans edges until a match; later lookups are map accesses.
|
|
53
|
+
* @evidence contracts/performance.md#reuse-equivalent-work The model's owned frozen facts make graph identity a stable generation key; a new generation is a different key and does not inherit the result.
|
|
54
|
+
* @evidence contracts/performance.md#bound-retention-and-release-resources WeakMap entries follow graph reachability and do not retain historical graph generations.
|
|
55
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation scans in-memory edges and caches the answer per graph object.
|
|
56
|
+
*/
|
|
35
57
|
function hasExportSurface(graph) {
|
|
36
58
|
const known = cache.get(graph);
|
|
37
59
|
if (known !== undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportSurface.js","sourceRoot":"","sources":["../../src/server/exportSurface.ts"],"names":[],"mappings":";;;;AAEA
|
|
1
|
+
{"version":3,"file":"exportSurface.js","sourceRoot":"","sources":["../../src/server/exportSurface.ts"],"names":[],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAA4B,KAAsB,EAAE,EAAU;IAC5D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAAE,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,KAAK,EAAE,CAAC;IAC5E,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,0BAAiC,KAAsB;IACrD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAClE,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,KAAK,GAAG,IAAI,OAAO,EAA4B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render a terminal graph failure with its nested causes and aggregate members.
|
|
3
|
+
*
|
|
4
|
+
* The SDK's descriptor-based failure description preserves causes and shared
|
|
5
|
+
* references without evaluating getters. Node then displays that passive data
|
|
6
|
+
* without invoking custom inspectors. Proxy reflection retains the serializer's
|
|
7
|
+
* documented inspection limits.
|
|
8
|
+
*
|
|
9
|
+
* It is stderr text, not a serialization format or a retirement certificate.
|
|
10
|
+
*
|
|
11
|
+
* @evidence contracts/common.md#principled-implementation The SDK failure serializer preserves nested causes and aggregate members as passive data; Node inspection renders that finite description rather than projecting the outer message.
|
|
12
|
+
* @evidence contracts/common.md#clear-and-simple-design One renderer owns shutdown diagnostic text; the server continues to own its failing exit status.
|
|
13
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Diagnostic formatting changes no cleanup result, admission state or original lifetime proof.
|
|
14
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose defines nested diagnostics, disabled user hooks and the absence of transport or retirement authority.
|
|
15
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This renderer observes JavaScript values and selects no OS path or process primitive.
|
|
16
|
+
* @evidence contracts/performance.md#efficient-algorithms Delegated serialization visits distinct observed objects and owned fields; unlimited diagnostic inspection then renders that finite description. Structural work and returned text grow with the observed diagnostic graph, excluding arbitrary Proxy reflection.
|
|
17
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each failure is rendered when reported; there is no reusable computation population.
|
|
18
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned diagnostic string is caller-owned; no handle or retained cache is acquired.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatGraphFailure(error: unknown): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatGraphFailure = formatGraphFailure;
|
|
4
|
+
const node_util_1 = require("node:util");
|
|
5
|
+
const ttsc_1 = require("ttsc");
|
|
6
|
+
/**
|
|
7
|
+
* Render a terminal graph failure with its nested causes and aggregate members.
|
|
8
|
+
*
|
|
9
|
+
* The SDK's descriptor-based failure description preserves causes and shared
|
|
10
|
+
* references without evaluating getters. Node then displays that passive data
|
|
11
|
+
* without invoking custom inspectors. Proxy reflection retains the serializer's
|
|
12
|
+
* documented inspection limits.
|
|
13
|
+
*
|
|
14
|
+
* It is stderr text, not a serialization format or a retirement certificate.
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/common.md#principled-implementation The SDK failure serializer preserves nested causes and aggregate members as passive data; Node inspection renders that finite description rather than projecting the outer message.
|
|
17
|
+
* @evidence contracts/common.md#clear-and-simple-design One renderer owns shutdown diagnostic text; the server continues to own its failing exit status.
|
|
18
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Diagnostic formatting changes no cleanup result, admission state or original lifetime proof.
|
|
19
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose defines nested diagnostics, disabled user hooks and the absence of transport or retirement authority.
|
|
20
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This renderer observes JavaScript values and selects no OS path or process primitive.
|
|
21
|
+
* @evidence contracts/performance.md#efficient-algorithms Delegated serialization visits distinct observed objects and owned fields; unlimited diagnostic inspection then renders that finite description. Structural work and returned text grow with the observed diagnostic graph, excluding arbitrary Proxy reflection.
|
|
22
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work Each failure is rendered when reported; there is no reusable computation population.
|
|
23
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The returned diagnostic string is caller-owned; no handle or retained cache is acquired.
|
|
24
|
+
*/
|
|
25
|
+
function formatGraphFailure(error) {
|
|
26
|
+
return (0, node_util_1.inspect)((0, ttsc_1.serializeCompilerError)(error), {
|
|
27
|
+
depth: null,
|
|
28
|
+
customInspect: false,
|
|
29
|
+
getters: false,
|
|
30
|
+
colors: false,
|
|
31
|
+
maxArrayLength: null,
|
|
32
|
+
maxStringLength: null,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=formatGraphFailure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatGraphFailure.js","sourceRoot":"","sources":["../../src/server/formatGraphFailure.ts"],"names":[],"mappings":";;;AAAA,yCAAoC;AACpC,+BAA8C;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,4BAAmC,KAAc;IAC/C,OAAO,IAAA,mBAAO,EAAC,IAAA,6BAAsB,EAAC,KAAK,CAAC,EAAE;QAC5C,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,KAAK;QACpB,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;QACb,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,IAAI;KACtB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,15 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { TtscGraphReadonly } from "../model/TtscGraphReadonly";
|
|
2
|
+
import { ITtscGraphNode as NodeShape } from "../structures/ITtscGraphNode";
|
|
3
|
+
type ITtscGraphNode = TtscGraphReadonly<NodeShape>;
|
|
4
|
+
/**
|
|
5
|
+
* True for dependency declarations outside the authored project graph.
|
|
6
|
+
*
|
|
7
|
+
* @evidence contracts/common.md#principled-implementation Producer external status, bundled coordinates and node_modules path segments identify dependency boundaries in the graph's portable vocabulary.
|
|
8
|
+
* @evidence contracts/common.md#clear-and-simple-design One predicate owns external selection for projections.
|
|
9
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Selection follows provenance and dependency coordinates rather than named repositories.
|
|
10
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline states dependency-boundary meaning; the predicate uses portable graph coordinates rather than native paths.
|
|
11
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a boolean and retains nothing.
|
|
12
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one flag read and two string tests on a single coordinate.
|
|
13
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work pure per-call work with no cache, so there is nothing to share or invalidate.
|
|
14
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation classifies a slash-normalized coordinate string from the dump and never touches the filesystem.
|
|
15
|
+
*/
|
|
3
16
|
export declare function isExternalNode(node: ITtscGraphNode): boolean;
|
|
4
17
|
/**
|
|
5
18
|
* True for a `.d.ts` declaration file. Every declaration such a file holds is
|
|
6
19
|
* ambient by construction, so none of them carries a body the graph can walk
|
|
7
20
|
* into, whether or not the `declare` keyword is written out.
|
|
21
|
+
*
|
|
22
|
+
* @evidence contracts/common.md#principled-implementation The declaration-file suffix recognizes d.ts, d.cts and d.mts ambient files under TypeScript's supported filename conventions.
|
|
23
|
+
* @evidence contracts/common.md#clear-and-simple-design One suffix predicate is reused by body and support-file policies.
|
|
24
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Ambient status is not guessed from fixture names or missing written declare keywords.
|
|
25
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains why ambient declarations are bodyless regardless of modifier spelling.
|
|
26
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a boolean and retains nothing.
|
|
27
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one suffix test on a single coordinate.
|
|
28
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work pure per-call work with no cache, so there is nothing to share or invalidate.
|
|
29
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation tests the suffix of a coordinate string and never touches the filesystem.
|
|
8
30
|
*/
|
|
9
31
|
export declare function isDeclarationFile(file: string): boolean;
|
|
10
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* True for conventional tests, examples, fixtures, generated output and builds.
|
|
34
|
+
*
|
|
35
|
+
* This is a projection heuristic over portable graph coordinates, not proof
|
|
36
|
+
* that a source is generated or a package's manifest classification.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation Segment and suffix conventions select likely support material; declaration-file and dependency checks share the established coordinate vocabulary.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One policy combines conventional support categories for rankers rather than duplicating regexes in each runner.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The heuristic uses general path categories and does not hardcode benchmark repositories or expected symbols.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states heuristic status and its provenance limitation rather than certifying generated source from naming.
|
|
42
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a boolean and retains nothing.
|
|
43
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms a fixed handful of string and pattern tests on a single coordinate.
|
|
44
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work pure per-call work with no cache, so there is nothing to share or invalidate.
|
|
45
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation classifies a slash-normalized coordinate string from the dump and never touches the filesystem.
|
|
46
|
+
*/
|
|
11
47
|
export declare function isSupportPath(file: string): boolean;
|
|
12
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* True for conventional test-directory or test/spec-suffixed source paths.
|
|
50
|
+
*
|
|
51
|
+
* This identifies likely test anchors by path convention; it does not execute
|
|
52
|
+
* tests or establish their behavioral coverage.
|
|
53
|
+
*
|
|
54
|
+
* @evidence contracts/common.md#principled-implementation Complete path segments and TypeScript/JavaScript test suffixes recognize conventional test locations without substring matches on arbitrary names.
|
|
55
|
+
* @evidence contracts/common.md#clear-and-simple-design The test subset has one predicate separate from the broader support-file policy.
|
|
56
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Returned test anchors follow general conventions rather than an expected benchmark answer list.
|
|
57
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains conventional selection and its lack of behavioral verification.
|
|
58
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a boolean and retains nothing.
|
|
59
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms two pattern tests on a single coordinate.
|
|
60
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work pure per-call work with no cache, so there is nothing to share or invalidate.
|
|
61
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation classifies a slash-normalized coordinate string from the dump and never touches the filesystem.
|
|
62
|
+
*/
|
|
13
63
|
export declare function isTestPath(file: string): boolean;
|
|
14
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* True when exported symbols are unlikely to be authored public API.
|
|
66
|
+
*
|
|
67
|
+
* Support material, ambient typings and internal directories are selection
|
|
68
|
+
* signals, not proof that a symbol cannot be imported.
|
|
69
|
+
*
|
|
70
|
+
* @evidence contracts/common.md#principled-implementation Shared support selection plus typings/internal conventions identify likely API noise while preserving actual compiler export facts elsewhere.
|
|
71
|
+
* @evidence contracts/common.md#clear-and-simple-design The API projection adds its own two exclusions to the common support predicate.
|
|
72
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Heuristic API visibility does not rewrite the producer's actual export table.
|
|
73
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes likely authored API from supported importability.
|
|
74
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a boolean and retains nothing.
|
|
75
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms a fixed handful of pattern tests on a single coordinate.
|
|
76
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work pure per-call work with no cache, so there is nothing to share or invalidate.
|
|
77
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation classifies a slash-normalized coordinate string from the dump and never touches the filesystem.
|
|
78
|
+
*/
|
|
15
79
|
export declare function isPublicApiNoisePath(file: string): boolean;
|
|
80
|
+
export {};
|