@samchon/graph 0.1.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/LICENSE +21 -0
- package/README.md +129 -0
- package/lib/AsyncSamchonGraphSource.d.ts +2 -0
- package/lib/AsyncSamchonGraphSource.js +3 -0
- package/lib/AsyncSamchonGraphSource.js.map +1 -0
- package/lib/SamchonGraphApplication.d.ts +10 -0
- package/lib/SamchonGraphApplication.js +64 -0
- package/lib/SamchonGraphApplication.js.map +1 -0
- package/lib/SamchonGraphSource.d.ts +2 -0
- package/lib/SamchonGraphSource.js +3 -0
- package/lib/SamchonGraphSource.js.map +1 -0
- package/lib/application.d.ts +3 -0
- package/lib/application.js +20 -0
- package/lib/application.js.map +1 -0
- package/lib/bin.d.ts +2 -0
- package/lib/bin.js +8 -0
- package/lib/bin.js.map +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/indexer/IBuildGraphOptions.d.ts +41 -0
- package/lib/indexer/IBuildGraphOptions.js +3 -0
- package/lib/indexer/IBuildGraphOptions.js.map +1 -0
- package/lib/indexer/IIndexerResult.d.ts +5 -0
- package/lib/indexer/IIndexerResult.js +3 -0
- package/lib/indexer/IIndexerResult.js.map +1 -0
- package/lib/indexer/ILanguageSpec.d.ts +10 -0
- package/lib/indexer/ILanguageSpec.js +3 -0
- package/lib/indexer/ILanguageSpec.js.map +1 -0
- package/lib/indexer/LANGUAGE_SPECS.d.ts +2 -0
- package/lib/indexer/LANGUAGE_SPECS.js +114 -0
- package/lib/indexer/LANGUAGE_SPECS.js.map +1 -0
- package/lib/indexer/allExtensions.d.ts +2 -0
- package/lib/indexer/allExtensions.js +16 -0
- package/lib/indexer/allExtensions.js.map +1 -0
- package/lib/indexer/buildGraph.d.ts +3 -0
- package/lib/indexer/buildGraph.js +10 -0
- package/lib/indexer/buildGraph.js.map +1 -0
- package/lib/indexer/buildGraphDump.d.ts +3 -0
- package/lib/indexer/buildGraphDump.js +394 -0
- package/lib/indexer/buildGraphDump.js.map +1 -0
- package/lib/indexer/buildLspGraph.d.ts +3 -0
- package/lib/indexer/buildLspGraph.js +617 -0
- package/lib/indexer/buildLspGraph.js.map +1 -0
- package/lib/indexer/buildStaticGraph.d.ts +3 -0
- package/lib/indexer/buildStaticGraph.js +479 -0
- package/lib/indexer/buildStaticGraph.js.map +1 -0
- package/lib/indexer/decoratorsAbove.d.ts +1 -0
- package/lib/indexer/decoratorsAbove.js +14 -0
- package/lib/indexer/decoratorsAbove.js.map +1 -0
- package/lib/indexer/languageOf.d.ts +2 -0
- package/lib/indexer/languageOf.js +19 -0
- package/lib/indexer/languageOf.js.map +1 -0
- package/lib/indexer/languages.d.ts +5 -0
- package/lib/indexer/languages.js +22 -0
- package/lib/indexer/languages.js.map +1 -0
- package/lib/indexer/lspIndexer.d.ts +1 -0
- package/lib/indexer/lspIndexer.js +18 -0
- package/lib/indexer/lspIndexer.js.map +1 -0
- package/lib/indexer/overrideEdges.d.ts +2 -0
- package/lib/indexer/overrideEdges.js +45 -0
- package/lib/indexer/overrideEdges.js.map +1 -0
- package/lib/indexer/resolveType.d.ts +2 -0
- package/lib/indexer/resolveType.js +11 -0
- package/lib/indexer/resolveType.js.map +1 -0
- package/lib/indexer/specOf.d.ts +3 -0
- package/lib/indexer/specOf.js +8 -0
- package/lib/indexer/specOf.js.map +1 -0
- package/lib/indexer/staticIndexer.d.ts +1 -0
- package/lib/indexer/staticIndexer.js +18 -0
- package/lib/indexer/staticIndexer.js.map +1 -0
- package/lib/indexer/supertypesOf.d.ts +4 -0
- package/lib/indexer/supertypesOf.js +48 -0
- package/lib/indexer/supertypesOf.js.map +1 -0
- package/lib/lsp/DocumentSymbolResult.d.ts +3 -0
- package/lib/lsp/DocumentSymbolResult.js +3 -0
- package/lib/lsp/DocumentSymbolResult.js.map +1 -0
- package/lib/lsp/IDiagnostic.d.ts +8 -0
- package/lib/lsp/IDiagnostic.js +3 -0
- package/lib/lsp/IDiagnostic.js.map +1 -0
- package/lib/lsp/IDocumentSymbol.d.ts +9 -0
- package/lib/lsp/IDocumentSymbol.js +3 -0
- package/lib/lsp/IDocumentSymbol.js.map +1 -0
- package/lib/lsp/ILocation.d.ts +5 -0
- package/lib/lsp/ILocation.js +3 -0
- package/lib/lsp/ILocation.js.map +1 -0
- package/lib/lsp/IPosition.d.ts +4 -0
- package/lib/lsp/IPosition.js +3 -0
- package/lib/lsp/IPosition.js.map +1 -0
- package/lib/lsp/IRange.d.ts +5 -0
- package/lib/lsp/IRange.js +3 -0
- package/lib/lsp/IRange.js.map +1 -0
- package/lib/lsp/ISymbolInformation.d.ts +7 -0
- package/lib/lsp/ISymbolInformation.js +3 -0
- package/lib/lsp/ISymbolInformation.js.map +1 -0
- package/lib/lsp/LspClient.d.ts +17 -0
- package/lib/lsp/LspClient.js +140 -0
- package/lib/lsp/LspClient.js.map +1 -0
- package/lib/lsp/isDocumentSymbol.d.ts +3 -0
- package/lib/lsp/isDocumentSymbol.js +7 -0
- package/lib/lsp/isDocumentSymbol.js.map +1 -0
- package/lib/lsp/types.d.ts +8 -0
- package/lib/lsp/types.js +25 -0
- package/lib/lsp/types.js.map +1 -0
- package/lib/mcp/createServer.d.ts +3 -0
- package/lib/mcp/createServer.js +1947 -0
- package/lib/mcp/createServer.js.map +1 -0
- package/lib/mcp/startServer.d.ts +5 -0
- package/lib/mcp/startServer.js +23 -0
- package/lib/mcp/startServer.js.map +1 -0
- package/lib/model/GraphMemory.d.ts +25 -0
- package/lib/model/GraphMemory.js +141 -0
- package/lib/model/GraphMemory.js.map +1 -0
- package/lib/operations/bound.d.ts +1 -0
- package/lib/operations/bound.js +8 -0
- package/lib/operations/bound.js.map +1 -0
- package/lib/operations/common.d.ts +15 -0
- package/lib/operations/common.js +32 -0
- package/lib/operations/common.js.map +1 -0
- package/lib/operations/compareEdges.d.ts +2 -0
- package/lib/operations/compareEdges.js +10 -0
- package/lib/operations/compareEdges.js.map +1 -0
- package/lib/operations/edgeRank.d.ts +1 -0
- package/lib/operations/edgeRank.js +25 -0
- package/lib/operations/edgeRank.js.map +1 -0
- package/lib/operations/isExecution.d.ts +1 -0
- package/lib/operations/isExecution.js +11 -0
- package/lib/operations/isExecution.js.map +1 -0
- package/lib/operations/isPublicApiNoisePath.d.ts +2 -0
- package/lib/operations/isPublicApiNoisePath.js +11 -0
- package/lib/operations/isPublicApiNoisePath.js.map +1 -0
- package/lib/operations/isStructural.d.ts +1 -0
- package/lib/operations/isStructural.js +7 -0
- package/lib/operations/isStructural.js.map +1 -0
- package/lib/operations/isSupportPath.d.ts +2 -0
- package/lib/operations/isSupportPath.js +16 -0
- package/lib/operations/isSupportPath.js.map +1 -0
- package/lib/operations/isTestPath.d.ts +1 -0
- package/lib/operations/isTestPath.js +9 -0
- package/lib/operations/isTestPath.js.map +1 -0
- package/lib/operations/isTypeEdge.d.ts +1 -0
- package/lib/operations/isTypeEdge.js +11 -0
- package/lib/operations/isTypeEdge.js.map +1 -0
- package/lib/operations/publicEvidence.d.ts +2 -0
- package/lib/operations/publicEvidence.js +13 -0
- package/lib/operations/publicEvidence.js.map +1 -0
- package/lib/operations/referencesFromEdges.d.ts +3 -0
- package/lib/operations/referencesFromEdges.js +38 -0
- package/lib/operations/referencesFromEdges.js.map +1 -0
- package/lib/operations/resolveHandle.d.ts +6 -0
- package/lib/operations/resolveHandle.js +28 -0
- package/lib/operations/resolveHandle.js.map +1 -0
- package/lib/operations/resultGuide.d.ts +1 -0
- package/lib/operations/resultGuide.js +7 -0
- package/lib/operations/resultGuide.js.map +1 -0
- package/lib/operations/resultNext.d.ts +2 -0
- package/lib/operations/resultNext.js +7 -0
- package/lib/operations/resultNext.js.map +1 -0
- package/lib/operations/runDetails.d.ts +8 -0
- package/lib/operations/runDetails.js +190 -0
- package/lib/operations/runDetails.js.map +1 -0
- package/lib/operations/runEntrypoints.d.ts +9 -0
- package/lib/operations/runEntrypoints.js +122 -0
- package/lib/operations/runEntrypoints.js.map +1 -0
- package/lib/operations/runLookup.d.ts +10 -0
- package/lib/operations/runLookup.js +229 -0
- package/lib/operations/runLookup.js.map +1 -0
- package/lib/operations/runOverview.d.ts +10 -0
- package/lib/operations/runOverview.js +142 -0
- package/lib/operations/runOverview.js.map +1 -0
- package/lib/operations/runTour.d.ts +8 -0
- package/lib/operations/runTour.js +539 -0
- package/lib/operations/runTour.js.map +1 -0
- package/lib/operations/runTrace.d.ts +10 -0
- package/lib/operations/runTrace.js +283 -0
- package/lib/operations/runTrace.js.map +1 -0
- package/lib/operations/signatureOf.d.ts +2 -0
- package/lib/operations/signatureOf.js +45 -0
- package/lib/operations/signatureOf.js.map +1 -0
- package/lib/operations/subwords.d.ts +1 -0
- package/lib/operations/subwords.js +12 -0
- package/lib/operations/subwords.js.map +1 -0
- package/lib/operations/summaryOf.d.ts +2 -0
- package/lib/operations/summaryOf.js +24 -0
- package/lib/operations/summaryOf.js.map +1 -0
- package/lib/runGraph.d.ts +1 -0
- package/lib/runGraph.js +165 -0
- package/lib/runGraph.js.map +1 -0
- package/lib/structures/GraphEdgeKind.d.ts +10 -0
- package/lib/structures/GraphEdgeKind.js +3 -0
- package/lib/structures/GraphEdgeKind.js.map +1 -0
- package/lib/structures/GraphLanguage.d.ts +2 -0
- package/lib/structures/GraphLanguage.js +3 -0
- package/lib/structures/GraphLanguage.js.map +1 -0
- package/lib/structures/GraphNodeKind.d.ts +11 -0
- package/lib/structures/GraphNodeKind.js +3 -0
- package/lib/structures/GraphNodeKind.js.map +1 -0
- package/lib/structures/IGraphDecorator.d.ts +22 -0
- package/lib/structures/IGraphDecorator.js +3 -0
- package/lib/structures/IGraphDecorator.js.map +1 -0
- package/lib/structures/IGraphDetails.d.ts +126 -0
- package/lib/structures/IGraphDetails.js +3 -0
- package/lib/structures/IGraphDetails.js.map +1 -0
- package/lib/structures/IGraphDiagnostic.d.ts +23 -0
- package/lib/structures/IGraphDiagnostic.js +3 -0
- package/lib/structures/IGraphDiagnostic.js.map +1 -0
- package/lib/structures/IGraphDump.d.ts +37 -0
- package/lib/structures/IGraphDump.js +3 -0
- package/lib/structures/IGraphDump.js.map +1 -0
- package/lib/structures/IGraphEdge.d.ts +20 -0
- package/lib/structures/IGraphEdge.js +3 -0
- package/lib/structures/IGraphEdge.js.map +1 -0
- package/lib/structures/IGraphEntrypoints.d.ts +57 -0
- package/lib/structures/IGraphEntrypoints.js +3 -0
- package/lib/structures/IGraphEntrypoints.js.map +1 -0
- package/lib/structures/IGraphEscape.d.ts +40 -0
- package/lib/structures/IGraphEscape.js +3 -0
- package/lib/structures/IGraphEscape.js.map +1 -0
- package/lib/structures/IGraphEvidence.d.ts +24 -0
- package/lib/structures/IGraphEvidence.js +3 -0
- package/lib/structures/IGraphEvidence.js.map +1 -0
- package/lib/structures/IGraphLookup.d.ts +66 -0
- package/lib/structures/IGraphLookup.js +3 -0
- package/lib/structures/IGraphLookup.js.map +1 -0
- package/lib/structures/IGraphNext.d.ts +15 -0
- package/lib/structures/IGraphNext.js +3 -0
- package/lib/structures/IGraphNext.js.map +1 -0
- package/lib/structures/IGraphNode.d.ts +62 -0
- package/lib/structures/IGraphNode.js +3 -0
- package/lib/structures/IGraphNode.js.map +1 -0
- package/lib/structures/IGraphOverview.d.ts +100 -0
- package/lib/structures/IGraphOverview.js +3 -0
- package/lib/structures/IGraphOverview.js.map +1 -0
- package/lib/structures/IGraphTour.d.ts +54 -0
- package/lib/structures/IGraphTour.js +3 -0
- package/lib/structures/IGraphTour.js.map +1 -0
- package/lib/structures/IGraphTrace.d.ts +126 -0
- package/lib/structures/IGraphTrace.js +3 -0
- package/lib/structures/IGraphTrace.js.map +1 -0
- package/lib/structures/ISamchonGraphApplication.d.ts +162 -0
- package/lib/structures/ISamchonGraphApplication.js +3 -0
- package/lib/structures/ISamchonGraphApplication.js.map +1 -0
- package/lib/structures/index.d.ts +18 -0
- package/lib/structures/index.js +35 -0
- package/lib/structures/index.js.map +1 -0
- package/lib/structures.d.ts +1 -0
- package/lib/structures.js +18 -0
- package/lib/structures.js.map +1 -0
- package/lib/utils/DEFAULT_IGNORES.d.ts +1 -0
- package/lib/utils/DEFAULT_IGNORES.js +39 -0
- package/lib/utils/DEFAULT_IGNORES.js.map +1 -0
- package/lib/utils/IWalkOptions.d.ts +5 -0
- package/lib/utils/IWalkOptions.js +3 -0
- package/lib/utils/IWalkOptions.js.map +1 -0
- package/lib/utils/basename.d.ts +1 -0
- package/lib/utils/basename.js +10 -0
- package/lib/utils/basename.js.map +1 -0
- package/lib/utils/dirname.d.ts +1 -0
- package/lib/utils/dirname.js +10 -0
- package/lib/utils/dirname.js.map +1 -0
- package/lib/utils/fileFromUri.d.ts +1 -0
- package/lib/utils/fileFromUri.js +20 -0
- package/lib/utils/fileFromUri.js.map +1 -0
- package/lib/utils/fileUri.d.ts +1 -0
- package/lib/utils/fileUri.js +19 -0
- package/lib/utils/fileUri.js.map +1 -0
- package/lib/utils/fs.d.ts +6 -0
- package/lib/utils/fs.js +23 -0
- package/lib/utils/fs.js.map +1 -0
- package/lib/utils/isSubPath.d.ts +1 -0
- package/lib/utils/isSubPath.js +15 -0
- package/lib/utils/isSubPath.js.map +1 -0
- package/lib/utils/normalizePath.d.ts +1 -0
- package/lib/utils/normalizePath.js +7 -0
- package/lib/utils/normalizePath.js.map +1 -0
- package/lib/utils/path.d.ts +7 -0
- package/lib/utils/path.js +24 -0
- package/lib/utils/path.js.map +1 -0
- package/lib/utils/projectRelative.d.ts +1 -0
- package/lib/utils/projectRelative.js +9 -0
- package/lib/utils/projectRelative.js.map +1 -0
- package/lib/utils/readLines.d.ts +1 -0
- package/lib/utils/readLines.js +8 -0
- package/lib/utils/readLines.js.map +1 -0
- package/lib/utils/readText.d.ts +1 -0
- package/lib/utils/readText.js +17 -0
- package/lib/utils/readText.js.map +1 -0
- package/lib/utils/relativePath.d.ts +1 -0
- package/lib/utils/relativePath.js +12 -0
- package/lib/utils/relativePath.js.map +1 -0
- package/lib/utils/walkSourceFiles.d.ts +2 -0
- package/lib/utils/walkSourceFiles.js +44 -0
- package/lib/utils/walkSourceFiles.js.map +1 -0
- package/package.json +55 -0
- package/src/AsyncSamchonGraphSource.ts +5 -0
- package/src/SamchonGraphApplication.ts +74 -0
- package/src/SamchonGraphSource.ts +3 -0
- package/src/application.ts +3 -0
- package/src/bin.ts +6 -0
- package/src/index.ts +13 -0
- package/src/indexer/IBuildGraphOptions.ts +42 -0
- package/src/indexer/IIndexerResult.ts +6 -0
- package/src/indexer/ILanguageSpec.ts +11 -0
- package/src/indexer/LANGUAGE_SPECS.ts +112 -0
- package/src/indexer/allExtensions.ts +12 -0
- package/src/indexer/buildGraph.ts +10 -0
- package/src/indexer/buildGraphDump.ts +29 -0
- package/src/indexer/buildLspGraph.ts +710 -0
- package/src/indexer/buildStaticGraph.ts +507 -0
- package/src/indexer/decoratorsAbove.ts +9 -0
- package/src/indexer/languageOf.ts +13 -0
- package/src/indexer/languages.ts +5 -0
- package/src/indexer/lspIndexer.ts +1 -0
- package/src/indexer/overrideEdges.ts +42 -0
- package/src/indexer/resolveType.ts +14 -0
- package/src/indexer/specOf.ts +7 -0
- package/src/indexer/staticIndexer.ts +1 -0
- package/src/indexer/supertypesOf.ts +43 -0
- package/src/lsp/DocumentSymbolResult.ts +4 -0
- package/src/lsp/IDiagnostic.ts +9 -0
- package/src/lsp/IDocumentSymbol.ts +10 -0
- package/src/lsp/ILocation.ts +6 -0
- package/src/lsp/IPosition.ts +4 -0
- package/src/lsp/IRange.ts +6 -0
- package/src/lsp/ISymbolInformation.ts +8 -0
- package/src/lsp/LspClient.ts +165 -0
- package/src/lsp/isDocumentSymbol.ts +8 -0
- package/src/lsp/types.ts +8 -0
- package/src/mcp/createServer.ts +23 -0
- package/src/mcp/startServer.ts +23 -0
- package/src/model/GraphMemory.ts +165 -0
- package/src/operations/bound.ts +9 -0
- package/src/operations/common.ts +15 -0
- package/src/operations/compareEdges.ts +10 -0
- package/src/operations/edgeRank.ts +23 -0
- package/src/operations/isExecution.ts +9 -0
- package/src/operations/isPublicApiNoisePath.ts +10 -0
- package/src/operations/isStructural.ts +3 -0
- package/src/operations/isSupportPath.ts +16 -0
- package/src/operations/isTestPath.ts +7 -0
- package/src/operations/isTypeEdge.ts +9 -0
- package/src/operations/publicEvidence.ts +11 -0
- package/src/operations/referencesFromEdges.ts +37 -0
- package/src/operations/resolveHandle.ts +27 -0
- package/src/operations/resultGuide.ts +3 -0
- package/src/operations/resultNext.ts +9 -0
- package/src/operations/runDetails.ts +240 -0
- package/src/operations/runEntrypoints.ts +153 -0
- package/src/operations/runLookup.ts +269 -0
- package/src/operations/runOverview.ts +158 -0
- package/src/operations/runTour.ts +582 -0
- package/src/operations/runTrace.ts +339 -0
- package/src/operations/signatureOf.ts +40 -0
- package/src/operations/subwords.ts +8 -0
- package/src/operations/summaryOf.ts +21 -0
- package/src/runGraph.ts +144 -0
- package/src/structures/GraphEdgeKind.ts +24 -0
- package/src/structures/GraphLanguage.ts +21 -0
- package/src/structures/GraphNodeKind.ts +27 -0
- package/src/structures/IGraphDecorator.ts +25 -0
- package/src/structures/IGraphDetails.ts +153 -0
- package/src/structures/IGraphDiagnostic.ts +29 -0
- package/src/structures/IGraphDump.ts +45 -0
- package/src/structures/IGraphEdge.ts +24 -0
- package/src/structures/IGraphEntrypoints.ts +70 -0
- package/src/structures/IGraphEscape.ts +49 -0
- package/src/structures/IGraphEvidence.ts +29 -0
- package/src/structures/IGraphLookup.ts +80 -0
- package/src/structures/IGraphNext.ts +23 -0
- package/src/structures/IGraphNode.ts +76 -0
- package/src/structures/IGraphOverview.ts +121 -0
- package/src/structures/IGraphTour.ts +68 -0
- package/src/structures/IGraphTrace.ts +154 -0
- package/src/structures/ISamchonGraphApplication.ts +186 -0
- package/src/structures/index.ts +18 -0
- package/src/structures.ts +1 -0
- package/src/utils/DEFAULT_IGNORES.ts +35 -0
- package/src/utils/IWalkOptions.ts +5 -0
- package/src/utils/basename.ts +7 -0
- package/src/utils/dirname.ts +7 -0
- package/src/utils/fileFromUri.ts +14 -0
- package/src/utils/fileUri.ts +13 -0
- package/src/utils/fs.ts +6 -0
- package/src/utils/isSubPath.ts +9 -0
- package/src/utils/normalizePath.ts +3 -0
- package/src/utils/path.ts +7 -0
- package/src/utils/projectRelative.ts +6 -0
- package/src/utils/readLines.ts +5 -0
- package/src/utils/readText.ts +10 -0
- package/src/utils/relativePath.ts +7 -0
- package/src/utils/walkSourceFiles.ts +35 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { IGraphDecorator } from "./IGraphDecorator";
|
|
2
|
+
import { IGraphDiagnostic } from "./IGraphDiagnostic";
|
|
3
|
+
import { IGraphEvidence } from "./IGraphEvidence";
|
|
4
|
+
import { IGraphNext } from "./IGraphNext";
|
|
5
|
+
import { IGraphOverview } from "./IGraphOverview";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The source-free facts for a few selected handles.
|
|
9
|
+
*
|
|
10
|
+
* This is not a file reader. It returns signatures, member outlines, direct
|
|
11
|
+
* calls, direct types, implementation candidates, dependency summaries, and
|
|
12
|
+
* sourceSpan citation anchors.
|
|
13
|
+
*/
|
|
14
|
+
export interface IGraphDetails {
|
|
15
|
+
/** Discriminator for selected symbol inspection. */
|
|
16
|
+
type: "details";
|
|
17
|
+
|
|
18
|
+
/** Selected node facts, in the same order as resolved handles when possible. */
|
|
19
|
+
nodes: IGraphDetails.INode[];
|
|
20
|
+
|
|
21
|
+
/** Handles that resolved to no node, or that were ambiguous. */
|
|
22
|
+
unknown: string[];
|
|
23
|
+
|
|
24
|
+
/** How to use this source-free result next. */
|
|
25
|
+
next: IGraphNext;
|
|
26
|
+
|
|
27
|
+
/** Human-readable compatibility note mirroring `next`. */
|
|
28
|
+
guide: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export namespace IGraphDetails {
|
|
32
|
+
/** Which selected handles to inspect, and how much of each to return. */
|
|
33
|
+
export interface IRequest {
|
|
34
|
+
/** Discriminator for selected symbol inspection. */
|
|
35
|
+
type: "details";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Node ids from another tool, or dotted symbol handles such as
|
|
39
|
+
* `OrderService.create`. Pass the few handles you need for source-free
|
|
40
|
+
* details. Prefer one to three handles. Use `trace` when you need a path
|
|
41
|
+
* instead of widening this call.
|
|
42
|
+
*/
|
|
43
|
+
handles: string[];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Also list each node's direct dependencies and dependents (the symbols it
|
|
47
|
+
* uses and the symbols that use it). The list is capped; raise
|
|
48
|
+
* `neighborLimit` when the first slice is truncated and the missing
|
|
49
|
+
* relation is named. This remains a relationship summary, not a file body.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
neighbors?: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Maximum dependencies and dependents to return per side when
|
|
57
|
+
* `neighbors:true`.
|
|
58
|
+
*
|
|
59
|
+
* Prefer the default. Values above a few neighbors are usually overfetch;
|
|
60
|
+
* call `trace` for flow instead.
|
|
61
|
+
*
|
|
62
|
+
* @default 2
|
|
63
|
+
*/
|
|
64
|
+
neighborLimit?: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Maximum owned members to return for a container or object literal. Raise
|
|
68
|
+
* only when the first outline is truncated and the missing member is
|
|
69
|
+
* named.
|
|
70
|
+
*
|
|
71
|
+
* @default 6
|
|
72
|
+
*/
|
|
73
|
+
memberLimit?: number;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Maximum direct execution and type references to return per group. Raise
|
|
77
|
+
* only when the first dependency slice is truncated and the missing
|
|
78
|
+
* dependency is named.
|
|
79
|
+
*
|
|
80
|
+
* @default 1
|
|
81
|
+
*/
|
|
82
|
+
dependencyLimit?: number;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Include dependency-boundary references from bundled libraries. Leave
|
|
86
|
+
* false for source-architecture answers; enable only when external
|
|
87
|
+
* type/API boundaries are the question.
|
|
88
|
+
*
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
includeExternal?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** One inspected node: its declared shape and graph coordinates. */
|
|
95
|
+
export interface INode extends IGraphOverview.INode {
|
|
96
|
+
/** The declaration signature: its first line(s) up to the body. */
|
|
97
|
+
signature?: string;
|
|
98
|
+
|
|
99
|
+
/** Decorators written on this declaration, when any. */
|
|
100
|
+
decorators?: IGraphDecorator[];
|
|
101
|
+
|
|
102
|
+
/** Assigned implementation span, when source comes from one. */
|
|
103
|
+
implementation?: IGraphEvidence;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* For a container or object-literal variable: the owned symbol or top-level
|
|
107
|
+
* property outline a consumer reaches for, without bodies.
|
|
108
|
+
*/
|
|
109
|
+
members?: IMember[];
|
|
110
|
+
|
|
111
|
+
/** Direct execution dependencies in source order, with edge evidence. */
|
|
112
|
+
calls?: IReference[];
|
|
113
|
+
|
|
114
|
+
/** Direct type dependencies in source order, with edge evidence. */
|
|
115
|
+
types?: IReference[];
|
|
116
|
+
|
|
117
|
+
/** Symbols this node uses (outgoing dependency edges). */
|
|
118
|
+
dependsOn?: IReference[];
|
|
119
|
+
|
|
120
|
+
/** Symbols that use this node (incoming dependency edges). */
|
|
121
|
+
dependedOnBy?: IReference[];
|
|
122
|
+
|
|
123
|
+
/** Diagnostics reported on this node's declaration, when any. */
|
|
124
|
+
diagnostics?: IGraphDiagnostic[];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** One member of a container node, with its signature but not its body. */
|
|
128
|
+
export interface IMember {
|
|
129
|
+
/** Member name, qualified when the graph records an owner-qualified handle. */
|
|
130
|
+
name: string;
|
|
131
|
+
|
|
132
|
+
/** Member kind (`method`, `property`, `class`, ...). */
|
|
133
|
+
kind: string;
|
|
134
|
+
|
|
135
|
+
/** 1-based declaration line, when known. */
|
|
136
|
+
line?: number;
|
|
137
|
+
|
|
138
|
+
/** The member's declaration signature. */
|
|
139
|
+
signature?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** A dependency neighbor of an inspected node and the edge that links them. */
|
|
143
|
+
export interface IReference extends IGraphOverview.INode {
|
|
144
|
+
/** The edge kind connecting the two (`calls`, `type_ref`, ...). */
|
|
145
|
+
relation: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Source span for the expression that produced this relationship. It is
|
|
149
|
+
* repository evidence for the edge, not a file-read instruction.
|
|
150
|
+
*/
|
|
151
|
+
evidence?: IGraphEvidence;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IGraphEvidence } from "./IGraphEvidence";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A language server or plugin diagnostic, fused onto the graph so an edit-triage
|
|
5
|
+
* query can name the owning symbol of an error.
|
|
6
|
+
*
|
|
7
|
+
* The language server's semantic pass contributes numeric-coded diagnostics;
|
|
8
|
+
* lint rules and transform plugins (typia, nestia, …) contribute `plugin`/`lint`
|
|
9
|
+
* findings whose `code` is a string.
|
|
10
|
+
*/
|
|
11
|
+
export interface IGraphDiagnostic {
|
|
12
|
+
/** Project-relative path of the file the diagnostic is reported in. */
|
|
13
|
+
file: string;
|
|
14
|
+
|
|
15
|
+
/** The human-readable diagnostic message. */
|
|
16
|
+
message: string;
|
|
17
|
+
|
|
18
|
+
/** Severity, when the producer distinguishes it. */
|
|
19
|
+
severity: "error" | "warning" | "information" | "hint";
|
|
20
|
+
|
|
21
|
+
/** Which producer emitted the diagnostic. */
|
|
22
|
+
source?: string;
|
|
23
|
+
|
|
24
|
+
/** Numeric language server code, or string rule id for a lint/plugin finding. */
|
|
25
|
+
code?: string | number;
|
|
26
|
+
|
|
27
|
+
/** The source span the diagnostic was attributed to, when resolved. */
|
|
28
|
+
evidence?: IGraphEvidence;
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { GraphLanguage } from "./GraphLanguage";
|
|
2
|
+
import { IGraphDiagnostic } from "./IGraphDiagnostic";
|
|
3
|
+
import { IGraphEdge } from "./IGraphEdge";
|
|
4
|
+
import { IGraphNode } from "./IGraphNode";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The whole-graph export `graph dump` writes and the MCP server loads — the
|
|
8
|
+
* wire contract between the fact-builder and the graph engine.
|
|
9
|
+
*
|
|
10
|
+
* It is the complete graph with none of the per-response caps the MCP tools
|
|
11
|
+
* apply: every node and edge the build resolved. The server parses it once at
|
|
12
|
+
* startup (validated) into an in-memory resident graph and answers every
|
|
13
|
+
* tool call from that warm model; the bundled 3D viewer reduces the same dump.
|
|
14
|
+
*
|
|
15
|
+
* Paths in `project` are absolute; `file` fields on nodes, edges, and
|
|
16
|
+
* diagnostics are project-relative.
|
|
17
|
+
*/
|
|
18
|
+
export interface IGraphDump {
|
|
19
|
+
/** Absolute path of the project root the graph was built for. */
|
|
20
|
+
project: string;
|
|
21
|
+
|
|
22
|
+
/** The source languages present in this dump. */
|
|
23
|
+
languages: GraphLanguage[];
|
|
24
|
+
|
|
25
|
+
/** ISO timestamp of when the dump was generated. */
|
|
26
|
+
generatedAt: string;
|
|
27
|
+
|
|
28
|
+
/** Which indexing strategy produced the graph. */
|
|
29
|
+
indexer: "lsp" | "static" | "hybrid";
|
|
30
|
+
|
|
31
|
+
/** Every node the build recorded. */
|
|
32
|
+
nodes: IGraphNode[];
|
|
33
|
+
|
|
34
|
+
/** Every edge the build resolved. */
|
|
35
|
+
edges: IGraphEdge[];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Fused language server and plugin diagnostics, when diagnostics were
|
|
39
|
+
* collected. Absent when the dump was built without a diagnostics pass.
|
|
40
|
+
*/
|
|
41
|
+
diagnostics?: IGraphDiagnostic[];
|
|
42
|
+
|
|
43
|
+
/** Non-fatal problems encountered while building the graph. */
|
|
44
|
+
warnings?: string[];
|
|
45
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GraphEdgeKind } from "./GraphEdgeKind";
|
|
2
|
+
import { IGraphEvidence } from "./IGraphEvidence";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A directed relationship from one {@link IGraphNode} to another, both named
|
|
6
|
+
* by `id`. The triple `(from, to, kind)` is unique; a repeated relationship
|
|
7
|
+
* keeps the first source-order evidence.
|
|
8
|
+
*
|
|
9
|
+
* Every edge is resolved by the language server, so there is no per-edge trust
|
|
10
|
+
* flag to carry — the whole graph is language-server-resolved fact.
|
|
11
|
+
*/
|
|
12
|
+
export interface IGraphEdge {
|
|
13
|
+
/** Node id the relationship originates from. */
|
|
14
|
+
from: string;
|
|
15
|
+
|
|
16
|
+
/** Node id the relationship points to. */
|
|
17
|
+
to: string;
|
|
18
|
+
|
|
19
|
+
/** The relationship kind. */
|
|
20
|
+
kind: GraphEdgeKind;
|
|
21
|
+
|
|
22
|
+
/** The source expression that produced the edge, for display and expansion. */
|
|
23
|
+
evidence?: IGraphEvidence;
|
|
24
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { GraphLanguage } from "./GraphLanguage";
|
|
2
|
+
import { IGraphNext } from "./IGraphNext";
|
|
3
|
+
import { IGraphOverview } from "./IGraphOverview";
|
|
4
|
+
|
|
5
|
+
/** The first compact source-free handle list for a code question. */
|
|
6
|
+
export interface IGraphEntrypoints {
|
|
7
|
+
/** Discriminator for first-pass question indexing. */
|
|
8
|
+
type: "entrypoints";
|
|
9
|
+
|
|
10
|
+
/** The original question/search phrase the entrypoints were built for. */
|
|
11
|
+
query: string;
|
|
12
|
+
|
|
13
|
+
/** Ranked symbols relevant to the query. */
|
|
14
|
+
ranked: IGraphEntrypoints.IEntrypoint[];
|
|
15
|
+
|
|
16
|
+
/** Code handles written directly in the query, resolved when possible. */
|
|
17
|
+
mentions: IGraphOverview.INode[];
|
|
18
|
+
|
|
19
|
+
/** Direct dependency context for the resolved mentions and highest hits. */
|
|
20
|
+
dependencyOrientation: string[];
|
|
21
|
+
|
|
22
|
+
/** How to use this source-free result next. */
|
|
23
|
+
next: IGraphNext;
|
|
24
|
+
|
|
25
|
+
/** Human-readable compatibility note mirroring `next`. */
|
|
26
|
+
guide: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export namespace IGraphEntrypoints {
|
|
30
|
+
/**
|
|
31
|
+
* Ask for first handles when the question is narrow but the symbol is not yet
|
|
32
|
+
* known. For broad tours, read-next, architecture, or multi-phase runtime
|
|
33
|
+
* flow, use `tour` instead of decomposing the answer into entrypoints and
|
|
34
|
+
* follow-up calls.
|
|
35
|
+
*/
|
|
36
|
+
export interface IRequest {
|
|
37
|
+
/** Discriminator for first-pass question indexing. */
|
|
38
|
+
type: "entrypoints";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A natural code question or search phrase. Mix prose with code handles,
|
|
42
|
+
* for example `how Repository.find loads relations` or
|
|
43
|
+
* `SelectQueryBuilder.setFindOptions join aliases`. Keep this close to the
|
|
44
|
+
* user's question; do not turn it into a broad keyword dump.
|
|
45
|
+
*/
|
|
46
|
+
query: string;
|
|
47
|
+
|
|
48
|
+
/** Target source language for the entrypoints. */
|
|
49
|
+
language?: GraphLanguage;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Maximum ranked hits to return.
|
|
53
|
+
*
|
|
54
|
+
* Prefer the default. Raise only when the first result was truncated and
|
|
55
|
+
* the missing handle is named.
|
|
56
|
+
*
|
|
57
|
+
* @default 4
|
|
58
|
+
*/
|
|
59
|
+
limit?: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** One ranked search hit. */
|
|
63
|
+
export interface IEntrypoint extends IGraphOverview.INode {
|
|
64
|
+
/** Relative relevance; higher is a better match. */
|
|
65
|
+
score: number;
|
|
66
|
+
|
|
67
|
+
/** Why this entrypoint was ranked for the query. */
|
|
68
|
+
reason: string;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IGraphNext } from "./IGraphNext";
|
|
2
|
+
|
|
3
|
+
/** The no-op result for when graph is not the useful next evidence source. */
|
|
4
|
+
export interface IGraphEscape {
|
|
5
|
+
/** Discriminator for the no-op escape route. */
|
|
6
|
+
type: "escape";
|
|
7
|
+
|
|
8
|
+
/** Always true so callers can distinguish an intentional no-op. */
|
|
9
|
+
skipped: true;
|
|
10
|
+
|
|
11
|
+
/** Why no graph operation should run. */
|
|
12
|
+
reason: string;
|
|
13
|
+
|
|
14
|
+
/** Optional note about the next non-graph step. */
|
|
15
|
+
nextStep?: string;
|
|
16
|
+
|
|
17
|
+
/** How to proceed after skipping graph work. */
|
|
18
|
+
next: IGraphNext;
|
|
19
|
+
|
|
20
|
+
/** Human-readable compatibility note mirroring `next`. */
|
|
21
|
+
guide: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export namespace IGraphEscape {
|
|
25
|
+
/** Skip graph work when graph evidence is unnecessary or exhausted. */
|
|
26
|
+
export interface IRequest {
|
|
27
|
+
/** Discriminator for the no-op escape route. */
|
|
28
|
+
type: "escape";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Why no graph operation should run.
|
|
32
|
+
*
|
|
33
|
+
* Use this only when the next evidence is outside the indexed code
|
|
34
|
+
* graph: package scripts, config files, generated output, prose docs, exact
|
|
35
|
+
* text, or exact source body text. Name the smallest returned sourceSpan
|
|
36
|
+
* when source body text is truly required.
|
|
37
|
+
*/
|
|
38
|
+
reason: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The final non-graph note, if useful.
|
|
42
|
+
*
|
|
43
|
+
* Keep this short. Examples: `answer from the prior graph result`, `source
|
|
44
|
+
* body needed at returned sourceSpan`, or `ask the user for a concrete
|
|
45
|
+
* symbol`.
|
|
46
|
+
*/
|
|
47
|
+
nextStep?: string;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A source location that grounds a node or edge in real code: the declaration
|
|
3
|
+
* span for a node, or the expression range that produced an edge.
|
|
4
|
+
*
|
|
5
|
+
* Evidence is display and grounding only; it is never identity. A node's id is
|
|
6
|
+
* position-invariant (see {@link IGraphNode}), so an edit that shifts a span
|
|
7
|
+
* does not re-key anything. `startLine`/`startCol` are 1-based. MCP output
|
|
8
|
+
* keeps evidence as coordinates; consumers can read the file themselves when
|
|
9
|
+
* they truly need source text.
|
|
10
|
+
*/
|
|
11
|
+
export interface IGraphEvidence {
|
|
12
|
+
/** Project-relative path of the file the span lives in. */
|
|
13
|
+
file: string;
|
|
14
|
+
|
|
15
|
+
/** 1-based line where the span starts. */
|
|
16
|
+
startLine: number;
|
|
17
|
+
|
|
18
|
+
/** 1-based column where the span starts, when known. */
|
|
19
|
+
startCol?: number;
|
|
20
|
+
|
|
21
|
+
/** 1-based line where the span ends, when it differs from `startLine`. */
|
|
22
|
+
endLine?: number;
|
|
23
|
+
|
|
24
|
+
/** 1-based column where the span ends, when known. */
|
|
25
|
+
endCol?: number;
|
|
26
|
+
|
|
27
|
+
/** The source text of the span, when captured. */
|
|
28
|
+
text?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { GraphLanguage } from "./GraphLanguage";
|
|
2
|
+
import { GraphNodeKind } from "./GraphNodeKind";
|
|
3
|
+
import { IGraphDecorator } from "./IGraphDecorator";
|
|
4
|
+
import { IGraphNext } from "./IGraphNext";
|
|
5
|
+
import { IGraphOverview } from "./IGraphOverview";
|
|
6
|
+
|
|
7
|
+
/** Targeted symbol lookup when a concrete name or handle is being resolved. */
|
|
8
|
+
export interface IGraphLookup {
|
|
9
|
+
/** Discriminator for targeted symbol lookup. */
|
|
10
|
+
type: "lookup";
|
|
11
|
+
|
|
12
|
+
/** Ranked symbol matches for the query. */
|
|
13
|
+
hits: IGraphLookup.IHit[];
|
|
14
|
+
|
|
15
|
+
/** Query terms that matched nothing. */
|
|
16
|
+
unknown?: string[];
|
|
17
|
+
|
|
18
|
+
/** How to use this source-free result next. */
|
|
19
|
+
next: IGraphNext;
|
|
20
|
+
|
|
21
|
+
/** Human-readable compatibility note mirroring `next`. */
|
|
22
|
+
guide: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export namespace IGraphLookup {
|
|
26
|
+
/** Find a concrete class, method, function, property, type, or dotted handle. */
|
|
27
|
+
export interface IRequest {
|
|
28
|
+
/** Discriminator for targeted symbol lookup. */
|
|
29
|
+
type: "lookup";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* What to find, in natural language and code vocabulary mixed freely: a
|
|
33
|
+
* symbol name, a dotted member (`Service.create`), or a short phrase
|
|
34
|
+
* (`request handler`). Exact names are not required, but this is not a
|
|
35
|
+
* second broad entrypoints call. Use it when a named handle is missing or
|
|
36
|
+
* ambiguous.
|
|
37
|
+
*/
|
|
38
|
+
query: string;
|
|
39
|
+
|
|
40
|
+
/** Restrict hits to this language. */
|
|
41
|
+
language?: GraphLanguage;
|
|
42
|
+
|
|
43
|
+
/** Restrict hits to this declaration kind. */
|
|
44
|
+
kind?: GraphNodeKind;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Maximum hits to return.
|
|
48
|
+
*
|
|
49
|
+
* Prefer the default. Large hit lists usually mean the query is too broad;
|
|
50
|
+
* refine the name instead of raising this.
|
|
51
|
+
*
|
|
52
|
+
* @default 5
|
|
53
|
+
*/
|
|
54
|
+
limit?: number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Include dependency-boundary declarations from bundled libraries. Leave
|
|
58
|
+
* false for project-source answers; enable only when external type/API
|
|
59
|
+
* boundaries are the question.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
includeExternal?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** One ranked hit with a handle to follow via `details` or `trace`. */
|
|
67
|
+
export interface IHit extends IGraphOverview.INode {
|
|
68
|
+
/** Relative relevance; higher is a better match. */
|
|
69
|
+
score: number;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The hit's declaration signature, so you can often answer without
|
|
73
|
+
* requesting details.
|
|
74
|
+
*/
|
|
75
|
+
signature?: string;
|
|
76
|
+
|
|
77
|
+
/** Decorators written on this declaration, when any. */
|
|
78
|
+
decorators?: IGraphDecorator[];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The required next step from a language-server-derived graph result. */
|
|
2
|
+
export interface IGraphNext {
|
|
3
|
+
/**
|
|
4
|
+
* Answer, continue graph inspection, leave graph, or clarify.
|
|
5
|
+
*
|
|
6
|
+
* `answer` means the returned graph result already carries the evidence
|
|
7
|
+
* contract for the current question, even when the slice is capped. Do not
|
|
8
|
+
* call graph again or read files to re-check or complete it.
|
|
9
|
+
*/
|
|
10
|
+
action: "answer" | "inspect" | "outside" | "clarify";
|
|
11
|
+
|
|
12
|
+
/** Smallest graph request type to use when `action` is `inspect`. */
|
|
13
|
+
request?:
|
|
14
|
+
| "entrypoints"
|
|
15
|
+
| "lookup"
|
|
16
|
+
| "trace"
|
|
17
|
+
| "details"
|
|
18
|
+
| "overview"
|
|
19
|
+
| "tour";
|
|
20
|
+
|
|
21
|
+
/** Why the returned graph evidence supports that action. */
|
|
22
|
+
reason: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { GraphLanguage } from "./GraphLanguage";
|
|
2
|
+
import { GraphNodeKind } from "./GraphNodeKind";
|
|
3
|
+
import { IGraphDecorator } from "./IGraphDecorator";
|
|
4
|
+
import { IGraphEvidence } from "./IGraphEvidence";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One node in the graph: a declared symbol or a structural container (file,
|
|
8
|
+
* package).
|
|
9
|
+
*
|
|
10
|
+
* The `id` is position-invariant: `path#qualifiedName:kind` (e.g.
|
|
11
|
+
* `src/order.ts#OrderService.create:method`), so inserting a line above a
|
|
12
|
+
* declaration does not re-key it. Line and span live in `evidence` and are
|
|
13
|
+
* never part of identity.
|
|
14
|
+
*/
|
|
15
|
+
export interface IGraphNode {
|
|
16
|
+
/** Position-invariant identity (see the interface doc for the id grammar). */
|
|
17
|
+
id: string;
|
|
18
|
+
|
|
19
|
+
/** What this node represents. */
|
|
20
|
+
kind: GraphNodeKind;
|
|
21
|
+
|
|
22
|
+
/** The source language this node was declared in. */
|
|
23
|
+
language: GraphLanguage;
|
|
24
|
+
|
|
25
|
+
/** The simple, unqualified declared name (`create`, `OrderService`, `App`). */
|
|
26
|
+
name: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The owner-qualified name, when the node lives inside another declaration:
|
|
30
|
+
* `OrderService.create`, `Shopping.ISale`. Absent for a top-level
|
|
31
|
+
* declaration.
|
|
32
|
+
*/
|
|
33
|
+
qualifiedName?: string;
|
|
34
|
+
|
|
35
|
+
/** Project-relative path of the file that declares this node. */
|
|
36
|
+
file: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* True when the declaration lives outside the workspace (a dependency). The
|
|
40
|
+
* graph keeps the leaf as a named endpoint but does not walk into its
|
|
41
|
+
* internals.
|
|
42
|
+
*/
|
|
43
|
+
external: boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* True when `file` is git-ignored generated code (a Prisma client, a codegen
|
|
47
|
+
* output). Projections desurface these so generated nodes do not bury the
|
|
48
|
+
* authored graph.
|
|
49
|
+
*/
|
|
50
|
+
ignored?: boolean;
|
|
51
|
+
|
|
52
|
+
/** True when the symbol is part of its module's export surface. */
|
|
53
|
+
exported?: boolean;
|
|
54
|
+
|
|
55
|
+
/** The declaration signature, for display. */
|
|
56
|
+
signature?: string;
|
|
57
|
+
|
|
58
|
+
/** Declaration modifiers, when the declaration pass recorded any. */
|
|
59
|
+
modifiers?: string[];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The decorators written on this declaration, in source order, when it has
|
|
63
|
+
* any: raw decorator facts (`@Controller`, `@Get`) a consumer can interpret
|
|
64
|
+
* without re-parsing source.
|
|
65
|
+
*/
|
|
66
|
+
decorators?: IGraphDecorator[];
|
|
67
|
+
|
|
68
|
+
/** The declaration span, for display and signatures. */
|
|
69
|
+
evidence?: IGraphEvidence;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The implementation span when a callable/property member is implemented by a
|
|
73
|
+
* function assignment separate from its declaration.
|
|
74
|
+
*/
|
|
75
|
+
implementation?: IGraphEvidence;
|
|
76
|
+
}
|