@ttsc/graph 0.30.4 → 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
package/README.md
CHANGED
|
@@ -65,6 +65,8 @@ The interactive charts, every model, and the method are on the benchmark page: h
|
|
|
65
65
|
|
|
66
66
|
```ts
|
|
67
67
|
/**
|
|
68
|
+
* ## Code Graph MCP
|
|
69
|
+
*
|
|
68
70
|
* `inspect_typescript_graph` returns a compiler-built TypeScript graph contract
|
|
69
71
|
* for the current on-disk source snapshot.
|
|
70
72
|
*
|
|
@@ -72,30 +74,103 @@ The interactive charts, every model, and the method are on the benchmark page: h
|
|
|
72
74
|
* type relations. It returns answer-ready index evidence: names, edges,
|
|
73
75
|
* signatures, decorators, tests, spans, and anchors.
|
|
74
76
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
+
* Declaration facts come from the compiler for the synchronized snapshot.
|
|
78
|
+
* The server derives file containers, containment, property kinds, path-convention test roles and dispatch
|
|
79
|
+
* hops; lint plugins supply artifact facts. The result's audit distinguishes
|
|
80
|
+
* these producers. Trust compiler facts without re-checking against files.
|
|
81
|
+
* Where an operation ranks a shortlist against your question (`lookup`,
|
|
82
|
+
* `entrypoints`, `tour`), its compiler facts retain that provenance while
|
|
83
|
+
* selection is heuristic: judge whether its coverage
|
|
84
|
+
* answers you, and a follow-up request or a read of a cited span is fair when
|
|
85
|
+
* it does not.
|
|
86
|
+
*
|
|
87
|
+
* ## Requests
|
|
88
|
+
*
|
|
89
|
+
* A request is a union: pick the single type below that best fits the question,
|
|
90
|
+
* and submit exactly that one.
|
|
91
|
+
*
|
|
92
|
+
* - `tour`: architecture, runtime flow, orientation, or a code tour. One call is
|
|
93
|
+
* the whole answer; do not split it. Name the machinery you expect it to be
|
|
94
|
+
* made of in its `reinterpretations`, or send none.
|
|
95
|
+
* - `entrypoints`: find where execution starts when entry points are unknown.
|
|
96
|
+
* - `lookup`: locate a named symbol, or — with a documentation target as the
|
|
97
|
+
* query (`docs/pricing.md#sale`, `POST:/orders`) — the declarations whose
|
|
98
|
+
* documentation cites it.
|
|
99
|
+
* - `trace`: follow calls or data flow forward or backward from a symbol, or —
|
|
100
|
+
* with `to` — the path between two symbols when both ends are known, which is
|
|
101
|
+
* the one call that answers "how does A reach B".
|
|
102
|
+
* - `details`: signatures, members, and relations of named symbols — including
|
|
103
|
+
* the classes that implement an interface, which is the one call that answers
|
|
104
|
+
* "what actually implements this".
|
|
105
|
+
* - `overview`: project layers and folder structure.
|
|
106
|
+
* - `escape`: the answer is outside the graph (source body text, non-TypeScript
|
|
107
|
+
* files, exact search).
|
|
108
|
+
*
|
|
109
|
+
* ## Chain of Thought
|
|
110
|
+
*
|
|
111
|
+
* Fill these fields in order before the call; each one narrows the reasoning
|
|
112
|
+
* toward the single request you submit.
|
|
113
|
+
*
|
|
114
|
+
* - `question`: the code question, in the user's own words.
|
|
115
|
+
* - `draft`: `{ reason, type }` — why the smallest request that could answer it,
|
|
116
|
+
* then that request's `type`.
|
|
117
|
+
* - `review`: fix a broad, stale, or duplicate draft. If the graph already
|
|
118
|
+
* answered, or the evidence is outside it, escape.
|
|
119
|
+
* - `request`: the final choice. Each branch documents its own fields; fill them
|
|
120
|
+
* from what the branch says, not from what another branch wanted.
|
|
121
|
+
*
|
|
122
|
+
* ## What to trust
|
|
123
|
+
*
|
|
124
|
+
* Before source edits, compiler declaration facts retain the resolution of the
|
|
125
|
+
* synchronized snapshot. The server derives `file` containers, `contains`
|
|
126
|
+
* ownership, `property` kinds, `dispatches` hops and path-convention `test`
|
|
127
|
+
* roles from those declarations. Lint plugins supply document, data-model and API-operation facts; `audit`
|
|
128
|
+
* identifies these distinct producers. Never use extra graph calls,
|
|
129
|
+
* repository search, or file reads to doubt,
|
|
130
|
+
* fact-check, re-derive, re-narrate, or re-confirm a returned node, span, edge,
|
|
131
|
+
* signature, decorator, test, reference, step, or anchor. The result projects
|
|
132
|
+
* the snapshot's facts and identifies their provenance; this server does not
|
|
133
|
+
* perform a second compiler verification pass.
|
|
134
|
+
*
|
|
135
|
+
* Selection is the separate question. `lookup`, `entrypoints`, and `tour` match
|
|
136
|
+
* your question and return a scored, ranked, per-file-capped, limited
|
|
137
|
+
* shortlist; their facts are still verified, but whether the shortlist covers
|
|
138
|
+
* what you asked is yours to judge, and their `audit` says that instead of
|
|
139
|
+
* claiming completeness. A follow-up request or a read of a cited span for
|
|
140
|
+
* missed coverage is legitimate — re-confirming a fact the graph already
|
|
141
|
+
* resolved is not.
|
|
142
|
+
*
|
|
143
|
+
* ## Stop
|
|
144
|
+
*
|
|
145
|
+
* Let the result's `next` set the pace, and do not re-confirm what the graph
|
|
146
|
+
* resolved.
|
|
147
|
+
*
|
|
148
|
+
* - A span is a citation, not a cue to open the file to re-check a fact.
|
|
149
|
+
* - Follow the result's `next`: `answer` means stop and answer from it, `inspect`
|
|
150
|
+
* means make exactly the one request it names, `outside` means escape,
|
|
151
|
+
* `clarify` means restate the request.
|
|
152
|
+
* - For a ranked shortlist (`lookup`, `entrypoints`, `tour`), `next` and
|
|
153
|
+
* `truncated` say whether coverage is settled; when it is not, one more
|
|
154
|
+
* request is the right move — not a file read to re-verify facts already
|
|
155
|
+
* given.
|
|
77
156
|
*/
|
|
78
157
|
export interface ITtscGraphApplication {
|
|
79
158
|
/**
|
|
80
|
-
* Answer a TypeScript question from the
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* The graph holds every symbol, call, type, decorator and test, each with its
|
|
84
|
-
* file and line, resolved from the source on disk now. Submit exactly one
|
|
85
|
-
* request:
|
|
159
|
+
* Answer a TypeScript question from the synchronized source snapshot.
|
|
160
|
+
* Submit one request:
|
|
86
161
|
*
|
|
87
|
-
* - `tour`: architecture,
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* - `
|
|
91
|
-
* - `
|
|
92
|
-
* - `
|
|
93
|
-
* - `
|
|
94
|
-
* - `overview`: the project's layers and folder structure
|
|
162
|
+
* - `tour`: architecture, runtime flow and nearby tests in one orientation
|
|
163
|
+
* - `trace`: calls, callers or the path from A to B
|
|
164
|
+
* - `details`: signatures, members and interface implementations
|
|
165
|
+
* - `lookup`: named declarations
|
|
166
|
+
* - `entrypoints`: where execution starts
|
|
167
|
+
* - `overview`: project layers and folders
|
|
168
|
+
* - `escape`: source bodies, span text or evidence outside the graph
|
|
95
169
|
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
170
|
+
* `audit` identifies compiler declaration facts, server-derived structure
|
|
171
|
+
* and plugin artifact facts; it does not claim a second compiler check.
|
|
172
|
+
* Judge the coverage of ranked `lookup`, `entrypoints` and `tour` shortlists.
|
|
173
|
+
* Follow `next`; read source for omitted body text or missed coverage.
|
|
99
174
|
*
|
|
100
175
|
* @param props Reasoning plus one graph request
|
|
101
176
|
* @returns Matching `result` union member
|
|
@@ -106,7 +181,9 @@ export interface ITtscGraphApplication {
|
|
|
106
181
|
}
|
|
107
182
|
|
|
108
183
|
export namespace ITtscGraphApplication {
|
|
109
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Draft, review, then submit exactly one graph request or escape.
|
|
186
|
+
*/
|
|
110
187
|
export interface IProps {
|
|
111
188
|
/**
|
|
112
189
|
* The code question, in the user's own words.
|
|
@@ -137,7 +214,9 @@ export namespace ITtscGraphApplication {
|
|
|
137
214
|
| ITtscGraphEscape.IRequest;
|
|
138
215
|
}
|
|
139
216
|
|
|
140
|
-
/**
|
|
217
|
+
/**
|
|
218
|
+
* First-pass plan; `reason` precedes `type` so it is written first.
|
|
219
|
+
*/
|
|
141
220
|
export interface IDraft {
|
|
142
221
|
/** Why this is the smallest useful next step. */
|
|
143
222
|
reason: string;
|
|
@@ -146,17 +225,26 @@ export namespace ITtscGraphApplication {
|
|
|
146
225
|
type: IProps["request"]["type"];
|
|
147
226
|
}
|
|
148
227
|
|
|
149
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* The selected request's output. `result.type` mirrors `request.type`.
|
|
230
|
+
*/
|
|
150
231
|
export interface IOutput {
|
|
151
232
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
233
|
+
* The provenance and coverage of the returned projection. Compiler facts
|
|
234
|
+
* belong to the synchronized program; file containers, containment,
|
|
235
|
+
* property kinds, path-convention test roles and dispatch hops are server-derived structure. Artifact
|
|
236
|
+
* facts come from the publishing lint plugin. This text reports those
|
|
237
|
+
* origins without claiming a second compiler verification pass.
|
|
156
238
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
239
|
+
* The audit is operation-aware. For the walks from a named handle (`trace`,
|
|
240
|
+
* `overview`) it reports the result as the structure the graph holds,
|
|
241
|
+
* bounded where `truncated` says. For `details` it reports the two halves
|
|
242
|
+
* of a resolved symbol: its own shape returned whole, its fan-out returned
|
|
243
|
+
* as a slice with `trace` for the rest. For the ranked operations
|
|
244
|
+
* (`lookup`, `entrypoints`, `tour`) it adds that the selection is heuristic
|
|
245
|
+
* — matched, scored, ranked, and limited against the question — so the
|
|
246
|
+
* facts are verified but the shortlist's coverage is the caller's to
|
|
247
|
+
* judge.
|
|
160
248
|
*/
|
|
161
249
|
audit: string;
|
|
162
250
|
|
|
@@ -188,7 +276,11 @@ The review is allowed to overturn the draft, and that matters more than the plan
|
|
|
188
276
|
|
|
189
277
|
Nothing is forbidden. The tool description says when the graph applies and when to stop. Grep and file reads stay available, and the agent still uses them when they are the right move.
|
|
190
278
|
|
|
191
|
-
What keeps the agent on the graph is precision.
|
|
279
|
+
What keeps the agent on the graph is precision. Declaration facts come from the TypeScript compiler for the synchronized snapshot. The server derives file containers, containment, property kinds, path-convention test roles and dispatch hops from those facts; lint plugins publish document, data-model and API-operation facts. The result's `audit` identifies these origins and distinguishes ranked selection from compiler resolution. No file body is included.
|
|
280
|
+
|
|
281
|
+
Declaration signatures come from the native compiler's declaration heads. When a producer omits a head, the response omits `signature` instead of guessing from a source line that may contain an implementation body. Consumers can use the returned source span when they need the missing text.
|
|
282
|
+
|
|
283
|
+
Resident graph models own detached, frozen node and edge facts. Public model accessors expose recursively readonly records and buckets; editable query results copy their nested facets. Caller-owned dump and transaction inputs remain editable without changing retained generations.
|
|
192
284
|
|
|
193
285
|
### Comparison
|
|
194
286
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owned temporary storage for one synchronous child stdout/stderr capture.
|
|
3
|
+
*
|
|
4
|
+
* @evidence contracts/common.md#principled-implementation Numeric descriptors can be passed directly to spawnSync while the stream union selects the matching captured text.
|
|
5
|
+
* @evidence contracts/common.md#clear-and-simple-design One handle groups two descriptors with read and disposal operations owned by the same capture.
|
|
6
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts File capture avoids a guessed pipe ceiling without modifying spawnSync internals.
|
|
7
|
+
* @evidence contracts/common.md#meaningful-documentation Native member comments state stream selection, caller ownership and the cleanup boundary.
|
|
8
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
9
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
11
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
12
|
+
*/
|
|
13
|
+
export interface CapturedProcessOutput {
|
|
14
|
+
/**
|
|
15
|
+
* Close the descriptors and remove the backing files once. Invoke after the
|
|
16
|
+
* child finishes, including failure paths; removal remains best effort.
|
|
17
|
+
*
|
|
18
|
+
* @evidence contracts/common.md#principled-implementation Disposal releases both capture descriptors before removing their containing directory.
|
|
19
|
+
* @evidence contracts/common.md#clear-and-simple-design Cleanup is one owned operation rather than independent caller-managed paths.
|
|
20
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Cleanup preserves the child outcome instead of replacing it with a secondary removal error.
|
|
21
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states invocation timing, failure coverage and best-effort removal.
|
|
22
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
23
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
24
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
25
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
26
|
+
*/
|
|
27
|
+
dispose(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Read one stream's UTF-8 text after the child finishes. A failed spawn
|
|
30
|
+
* leaves its pre-created capture file empty; a filesystem read failure
|
|
31
|
+
* propagates.
|
|
32
|
+
*
|
|
33
|
+
* @evidence contracts/common.md#principled-implementation The stream discriminant selects its backing file and UTF-8 decoding returns the captured textual channel.
|
|
34
|
+
* @evidence contracts/common.md#clear-and-simple-design One reader shares the same storage paths as the capture owner.
|
|
35
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts An unreadable capture is not replaced with empty text that could disguise lost output.
|
|
36
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains encoding, timing and read-failure propagation.
|
|
37
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
38
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
39
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
40
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
41
|
+
*/
|
|
42
|
+
read(stream: "stdout" | "stderr"): string;
|
|
43
|
+
/** Owned writable descriptor passed as the child's stderr destination. */
|
|
44
|
+
stderrFd: number;
|
|
45
|
+
/** Owned writable descriptor passed as the child's stdout destination. */
|
|
46
|
+
stdoutFd: number;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CapturedProcessOutput.js","sourceRoot":"","sources":["../src/CapturedProcessOutput.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type OptionKind = "value" | "string" | "flag" | "boolean";
|
|
2
|
+
/**
|
|
3
|
+
* One recognized launcher option and its accepted flag aliases.
|
|
4
|
+
*
|
|
5
|
+
* @evidence contracts/common.md#principled-implementation Key identifies the parsed value while aliases and kind determine accepted syntax.
|
|
6
|
+
* @evidence contracts/common.md#clear-and-simple-design One definition owns aliases and parsing mode so launchers share the same parser.
|
|
7
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Accepted tokens are explicit launcher grammar, not special cases for expected command output.
|
|
8
|
+
* @evidence contracts/common.md#meaningful-documentation Native member comments distinguish result key, accepted tokens and value/flag/boolean parsing.
|
|
9
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources data shape only: it holds no handle, task or retained state.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms data shape only: it contains no loop or algorithm.
|
|
11
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work data shape only: it computes nothing another request could share.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation data shape only: it touches no file, path or process.
|
|
13
|
+
*/
|
|
14
|
+
export interface ILauncherOption {
|
|
15
|
+
/** Canonical map key shared by every alias. */
|
|
16
|
+
key: string;
|
|
17
|
+
/** Accepted complete option tokens, including their leading hyphens. */
|
|
18
|
+
flags: readonly string[];
|
|
19
|
+
/** Value requires nonempty text; string preserves native empty/dash values. */
|
|
20
|
+
kind: OptionKind;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ILauncherOption.js","sourceRoot":"","sources":["../src/ILauncherOption.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project coordinates passed to the native graph producer.
|
|
3
|
+
*
|
|
4
|
+
* @evidence contracts/common.md#principled-implementation Absolute working directory and configuration locator determine which project the producer loads.
|
|
5
|
+
* @evidence contracts/common.md#clear-and-simple-design Two shared coordinates prevent launcher lanes from owning competing project defaults.
|
|
6
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Configuration remains caller-selected rather than pinned to a named repository.
|
|
7
|
+
* @evidence contracts/common.md#meaningful-documentation Native member comments identify directory absoluteness and configuration relativity.
|
|
8
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources data shape only: it holds no handle, task or retained state.
|
|
9
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms data shape only: it contains no loop or algorithm.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work data shape only: it computes nothing another request could share.
|
|
11
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation data shape only: it touches no file, path or process.
|
|
12
|
+
*/
|
|
13
|
+
export interface IProjectOptions {
|
|
14
|
+
/** Absolute project working directory. */
|
|
15
|
+
cwd: string;
|
|
16
|
+
/** Configuration path, relative to cwd unless already absolute. */
|
|
17
|
+
tsconfig: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IProjectOptions.js","sourceRoot":"","sources":["../src/IProjectOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsed canonical option keys with textual or boolean values.
|
|
3
|
+
*
|
|
4
|
+
* @evidence contracts/common.md#principled-implementation ReadonlyMap represents absent options distinctly from false and empty text, with value kinds preserved.
|
|
5
|
+
* @evidence contracts/common.md#clear-and-simple-design One map avoids separate alias-indexed result objects.
|
|
6
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The public view is readonly rather than mutating consumer options during later validation.
|
|
7
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline explains canonical keys and the two stored value categories.
|
|
8
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources data shape only: it holds no handle, task or retained state.
|
|
9
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms data shape only: it contains no loop or algorithm.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work data shape only: it computes nothing another request could share.
|
|
11
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation data shape only: it touches no file, path or process.
|
|
12
|
+
*/
|
|
13
|
+
export type ParsedLauncherOptions = ReadonlyMap<string, string | boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParsedLauncherOptions.js","sourceRoot":"","sources":["../src/ParsedLauncherOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { TtscGraphMemory } from "./model/TtscGraphMemory";
|
|
2
2
|
import { ITtscGraphApplication } from "./structures/ITtscGraphApplication";
|
|
3
|
+
/**
|
|
4
|
+
* A fixed graph generation or a provider synchronizing one before each request.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation The union admits resident values and synchronous/asynchronous producers with the same graph result contract.
|
|
7
|
+
* @evidence contracts/common.md#clear-and-simple-design One provider boundary lets dispatch use fixed dumps and refreshing sessions without separate applications.
|
|
8
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Refresh remains a supplied ownership boundary instead of foreign graph mutation.
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline states fixed versus synchronized generation and the provider's timing.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources data shape only: it holds no handle, task or retained state.
|
|
11
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms data shape only: it contains no loop or algorithm.
|
|
12
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work data shape only: it computes nothing another request could share.
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation data shape only: it touches no file, path or process.
|
|
14
|
+
*/
|
|
3
15
|
export type TtscGraphSource = TtscGraphMemory | (() => TtscGraphMemory | Promise<TtscGraphMemory>);
|
|
4
16
|
/**
|
|
5
17
|
* The MCP tool surface as a plain class over the resident
|
|
6
18
|
* {@link TtscGraphMemory}.
|
|
7
19
|
*
|
|
8
|
-
* Its public method is the MCP tool: `typia.llm.
|
|
20
|
+
* Its public method is the MCP tool: `typia.llm.controller` reflects
|
|
9
21
|
* {@link ITtscGraphApplication} to generate the tool's JSON schema and argument
|
|
10
22
|
* validator from the signature and JSDoc, with no hand-written schema, and
|
|
11
23
|
* `@typia/mcp`'s `createMcpServer` registers it (see `./server/createServer`).
|
|
@@ -16,10 +28,35 @@ export type TtscGraphSource = TtscGraphMemory | (() => TtscGraphMemory | Promise
|
|
|
16
28
|
* that graph before the operation when project files changed. Output is kept
|
|
17
29
|
* compact and bounded so a model can read structure without a file read, which
|
|
18
30
|
* is the token win the redesign exists for.
|
|
31
|
+
*
|
|
32
|
+
* @evidence contracts/common.md#principled-implementation Exhaustive request dispatch chooses the matching graph operation and its operation-specific audit; escape bypasses graph acquisition entirely.
|
|
33
|
+
* @evidence contracts/common.md#clear-and-simple-design The class binds one graph provider to pure runners, leaving traversal and ranking with their owning functions.
|
|
34
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No forced first lookup or agent-specific call suppression is introduced; legitimate escape and incomplete coverage remain explicit.
|
|
35
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain reflected tool wiring, provider refresh and source-free result ownership.
|
|
36
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources holds only the provider function; the session owns the resources.
|
|
37
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms dispatches one request to its runner and the runners own the algorithms.
|
|
38
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work each non-escape call asks the provider function for the graph, and the provider owns reuse.
|
|
39
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation dispatches to in-memory runners; the provider function owns session and process work.
|
|
19
40
|
*/
|
|
20
41
|
export declare class TtscGraphApplication implements ITtscGraphApplication {
|
|
21
42
|
private readonly graph;
|
|
22
43
|
constructor(source: TtscGraphSource);
|
|
44
|
+
/**
|
|
45
|
+
* Synchronize the graph once and dispatch the selected request.
|
|
46
|
+
*
|
|
47
|
+
* Escape returns an explicit no-op before invoking the provider. Ranked
|
|
48
|
+
* operations report heuristic selection; details distinguishes capped members
|
|
49
|
+
* from its complete identity facts.
|
|
50
|
+
*
|
|
51
|
+
* @evidence contracts/common.md#principled-implementation Each discriminated branch returns its corresponding runner result with the audit appropriate to that operation's actual completeness.
|
|
52
|
+
* @evidence contracts/common.md#clear-and-simple-design The exhaustive switch owns only dispatch and audit choice; runners own graph semantics and the provider owns synchronization.
|
|
53
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Escape does no indexing, and heuristic selection is not advertised as exhaustive compiler proof.
|
|
54
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains provider timing, no-op escape and operation-specific completeness before the tags.
|
|
55
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources keeps nothing between calls.
|
|
56
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms a switch over seven request types that calls one runner.
|
|
57
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work each non-escape call asks the provider function for the graph, and the provider owns reuse.
|
|
58
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation dispatches to in-memory runners; the provider function owns session and process work.
|
|
59
|
+
*/
|
|
23
60
|
inspect_typescript_graph(props: ITtscGraphApplication.IProps): Promise<ITtscGraphApplication.IOutput>;
|
|
24
61
|
private escape;
|
|
25
62
|
}
|
|
@@ -13,7 +13,7 @@ const runTrace_1 = require("./server/runTrace");
|
|
|
13
13
|
* The MCP tool surface as a plain class over the resident
|
|
14
14
|
* {@link TtscGraphMemory}.
|
|
15
15
|
*
|
|
16
|
-
* Its public method is the MCP tool: `typia.llm.
|
|
16
|
+
* Its public method is the MCP tool: `typia.llm.controller` reflects
|
|
17
17
|
* {@link ITtscGraphApplication} to generate the tool's JSON schema and argument
|
|
18
18
|
* validator from the signature and JSDoc, with no hand-written schema, and
|
|
19
19
|
* `@typia/mcp`'s `createMcpServer` registers it (see `./server/createServer`).
|
|
@@ -24,12 +24,37 @@ const runTrace_1 = require("./server/runTrace");
|
|
|
24
24
|
* that graph before the operation when project files changed. Output is kept
|
|
25
25
|
* compact and bounded so a model can read structure without a file read, which
|
|
26
26
|
* is the token win the redesign exists for.
|
|
27
|
+
*
|
|
28
|
+
* @evidence contracts/common.md#principled-implementation Exhaustive request dispatch chooses the matching graph operation and its operation-specific audit; escape bypasses graph acquisition entirely.
|
|
29
|
+
* @evidence contracts/common.md#clear-and-simple-design The class binds one graph provider to pure runners, leaving traversal and ranking with their owning functions.
|
|
30
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No forced first lookup or agent-specific call suppression is introduced; legitimate escape and incomplete coverage remain explicit.
|
|
31
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain reflected tool wiring, provider refresh and source-free result ownership.
|
|
32
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources holds only the provider function; the session owns the resources.
|
|
33
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms dispatches one request to its runner and the runners own the algorithms.
|
|
34
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work each non-escape call asks the provider function for the graph, and the provider owns reuse.
|
|
35
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation dispatches to in-memory runners; the provider function owns session and process work.
|
|
27
36
|
*/
|
|
28
37
|
class TtscGraphApplication {
|
|
29
38
|
graph;
|
|
30
39
|
constructor(source) {
|
|
31
40
|
this.graph = typeof source === "function" ? source : () => source;
|
|
32
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Synchronize the graph once and dispatch the selected request.
|
|
44
|
+
*
|
|
45
|
+
* Escape returns an explicit no-op before invoking the provider. Ranked
|
|
46
|
+
* operations report heuristic selection; details distinguishes capped members
|
|
47
|
+
* from its complete identity facts.
|
|
48
|
+
*
|
|
49
|
+
* @evidence contracts/common.md#principled-implementation Each discriminated branch returns its corresponding runner result with the audit appropriate to that operation's actual completeness.
|
|
50
|
+
* @evidence contracts/common.md#clear-and-simple-design The exhaustive switch owns only dispatch and audit choice; runners own graph semantics and the provider owns synchronization.
|
|
51
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Escape does no indexing, and heuristic selection is not advertised as exhaustive compiler proof.
|
|
52
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains provider timing, no-op escape and operation-specific completeness before the tags.
|
|
53
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources keeps nothing between calls.
|
|
54
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms a switch over seven request types that calls one runner.
|
|
55
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work each non-escape call asks the provider function for the graph, and the provider owns reuse.
|
|
56
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation dispatches to in-memory runners; the provider function owns session and process work.
|
|
57
|
+
*/
|
|
33
58
|
async inspect_typescript_graph(props) {
|
|
34
59
|
if (props.request.type === "escape") {
|
|
35
60
|
const result = this.escape(props.request.reason);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtscGraphApplication.js","sourceRoot":"","sources":["../src/TtscGraphApplication.ts"],"names":[],"mappings":";;;AACA,sDAM8B;AAC9B,oDAAiD;AACjD,oDAAiD;AACjD,4DAAyD;AACzD,kDAA+C;AAC/C,sDAAmD;AACnD,8CAA2C;AAC3C,gDAA6C;
|
|
1
|
+
{"version":3,"file":"TtscGraphApplication.js","sourceRoot":"","sources":["../src/TtscGraphApplication.ts"],"names":[],"mappings":";;;AACA,sDAM8B;AAC9B,oDAAiD;AACjD,oDAAiD;AACjD,4DAAyD;AACzD,kDAA+C;AAC/C,sDAAmD;AACnD,8CAA2C;AAC3C,gDAA6C;AAoB7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IACmB,KAAK,CAAmD;IAEzE,YAAmB,MAAuB;QACxC,IAAI,CAAC,KAAK,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACI,KAAK,CAAC,wBAAwB,CACnC,KAAmC;QAEnC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACjD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACzC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC3C,CAAC;YACD,OAAO;gBACL,KAAK,EAAE,iCAAmB;gBAC1B,IAAI,EAAE,IAAA,uBAAU,EACd,SAAS,EACT,2EAA2E,CAC5E;gBACD,MAAM;aACP,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACjC,QAAQ,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC3B,KAAK,aAAa,EAAE,CAAC;gBACnB,iEAAiE;gBACjE,uEAAuE;gBACvE,uDAAuD;gBACvD,MAAM,CAAC,GAAG,IAAA,+BAAc,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC/C,OAAO;oBACL,KAAK,EAAE,oCAAsB;oBAC7B,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,KAAK,QAAQ,EAAE,CAAC;gBACd,mEAAmE;gBACnE,sDAAsD;gBACtD,MAAM,CAAC,GAAG,IAAA,qBAAS,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC1C,OAAO;oBACL,KAAK,EAAE,oCAAsB;oBAC7B,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,KAAK,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBACzC,OAAO;oBACL,KAAK,EAAE,0BAAY;oBACnB,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,KAAK,SAAS,EAAE,CAAC;gBACf,qEAAqE;gBACrE,6DAA6D;gBAC7D,MAAM,CAAC,GAAG,IAAA,uBAAU,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC3C,OAAO;oBACL,KAAK,EACH,CAAC,CAAC,aAAa,KAAK,IAAI;wBACtB,CAAC,CAAC,yCAA2B;wBAC7B,CAAC,CAAC,kCAAoB;oBAC1B,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,KAAK,UAAU,EAAE,CAAC;gBAChB,MAAM,CAAC,GAAG,IAAA,yBAAW,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5C,OAAO;oBACL,KAAK,EAAE,0BAAY;oBACnB,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD,KAAK,MAAM,EAAE,CAAC;gBACZ,mEAAmE;gBACnE,kEAAkE;gBAClE,kEAAkE;gBAClE,0BAA0B;gBAC1B,MAAM,CAAC,GAAG,IAAA,iBAAO,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACxD,OAAO;oBACL,KAAK,EAAE,oCAAsB;oBAC7B,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;iBACjB,CAAC;YACJ,CAAC;YACD;gBACE,KAAK,CAAC,OAAuB,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,MAAc,EAAE,QAAiB;QAC9C,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;YACb,MAAM;YACN,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { IProjectOptions } from "./IProjectOptions";
|
|
2
|
+
/**
|
|
3
|
+
* Project, viewer and dump argument contracts consumed by the real launchers.
|
|
4
|
+
*
|
|
5
|
+
* @evidence contracts/common.md#principled-implementation Existing explicit grammar and typed validators qualify project coordinates before real launch work; dump tokens and completion preserve the native contract.
|
|
6
|
+
* @evidence contracts/common.md#clear-and-simple-design This namespace owns launcher grammar, dump launch-vector construction and completion mapping; native process execution remains with runGraph/view.
|
|
7
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Actual facades consume these operations without alternate test entrypoints, executable stand-ins or weakened grammar.
|
|
8
|
+
* @evidence contracts/common.md#meaningful-documentation Member prose identifies coordinate defaults, argv preservation and native completion ownership needed by the facades.
|
|
9
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation The namespace groups contracts; its members own native path and process-value representation.
|
|
10
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns plain values and holds no handle.
|
|
11
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms groups launcher parsers and completion mappers that each do bounded work.
|
|
12
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work its members run once per launcher invocation, so nothing is shared.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace TtscGraphLauncherArguments {
|
|
15
|
+
/**
|
|
16
|
+
* Parse MCP project coordinates with the shared cwd/config defaults.
|
|
17
|
+
*
|
|
18
|
+
* @evidence contracts/common.md#principled-implementation The shared PROJECT_OPTIONS grammar rejects unknown or incomplete tokens before projectOptions supplies its supported defaults.
|
|
19
|
+
* @evidence contracts/common.md#clear-and-simple-design Only the shared project grammar is selected; startServer retains lazy native lifetime ownership.
|
|
20
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
|
|
21
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
|
|
22
|
+
* @evidence contracts/portability.md#os-neutral-implementation Project normalization delegates to Node path.resolve; selected config spelling remains intact, with no shell or separator rewriting.
|
|
23
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
|
|
24
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one parseLauncherOptions pass over argv plus a path.resolve.
|
|
25
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work parses argv once per process start.
|
|
26
|
+
*/
|
|
27
|
+
function project(argv: readonly string[]): IProjectOptions;
|
|
28
|
+
/**
|
|
29
|
+
* Parse dump project coordinates without altering forwarded tokens.
|
|
30
|
+
*
|
|
31
|
+
* @evidence contracts/common.md#principled-implementation The original dump grammar accepts its cwd/config aliases, pretty booleans and help flags, rejecting incomplete or unknown options before resolution.
|
|
32
|
+
* @evidence contracts/common.md#clear-and-simple-design Dump validation returns coordinates and explicit artifact presence; dumpVector separately preserves the caller tokens actually sent to the producer.
|
|
33
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
|
|
34
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
|
|
35
|
+
* @evidence contracts/portability.md#os-neutral-implementation Project normalization delegates to Node path.resolve; selected config spelling remains intact, with no shell or separator rewriting.
|
|
36
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
|
|
37
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one parseLauncherOptions pass over argv plus a path.resolve.
|
|
38
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work parses argv once per process start.
|
|
39
|
+
*/
|
|
40
|
+
function dump(argv: readonly string[]): IProjectOptions & {
|
|
41
|
+
artifactsSpecified: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Parse viewer coordinates and bounded numeric options with existing
|
|
45
|
+
* defaults.
|
|
46
|
+
*
|
|
47
|
+
* @evidence contracts/common.md#principled-implementation The original viewer grammar plus safe integer validators retains port zero through 65,535 and positive maxNodes through Number.MAX_SAFE_INTEGER before graph work.
|
|
48
|
+
* @evidence contracts/common.md#clear-and-simple-design Project defaults and numeric policy share existing owners; the viewer retains build, reduction and HTTP lifetime.
|
|
49
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
|
|
50
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
|
|
51
|
+
* @evidence contracts/portability.md#os-neutral-implementation Project normalization delegates to Node path.resolve; selected config spelling remains intact, with no shell or separator rewriting.
|
|
52
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
|
|
53
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one parse pass over argv and up to two integer validations.
|
|
54
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work parses argv once per process start.
|
|
55
|
+
*/
|
|
56
|
+
function view(argv: readonly string[]): IViewOptions;
|
|
57
|
+
/**
|
|
58
|
+
* Preserve native dump argv, adding only a present published-artifact path.
|
|
59
|
+
*
|
|
60
|
+
* @evidence contracts/common.md#principled-implementation The dump token precedes the unmodified caller vector; a null publication adds no overlay coordinate.
|
|
61
|
+
* @evidence contracts/common.md#clear-and-simple-design One vector owner is consumed by the actual dump spawn; resident serve/lint vectors remain distinct in their existing owner.
|
|
62
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
|
|
63
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
|
|
64
|
+
* @evidence contracts/portability.md#os-neutral-implementation Separate argv elements preserve path and equals-form spelling exactly for Node spawn, without shell quoting.
|
|
65
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a fresh value and keeps no handle or state.
|
|
66
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one parse pass over argv and a copy of it with at most two appended entries.
|
|
67
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work builds one argv per spawn.
|
|
68
|
+
*/
|
|
69
|
+
function dumpVector(argv: readonly string[], artifacts: string | null): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Map native completion to its exit code and optional owned spawn diagnostic.
|
|
72
|
+
*
|
|
73
|
+
* @evidence contracts/common.md#principled-implementation Actual spawn errors return code one with the existing owned prefix; normal status passes through exactly, and absent status remains failure one.
|
|
74
|
+
* @evidence contracts/common.md#clear-and-simple-design The actual dump facade writes only the returned diagnostic and returns this code; completion decides no process timing or retry.
|
|
75
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing public flag and result contracts are used by actual facades without fixture branches or a synthetic producer.
|
|
76
|
+
* @evidence contracts/common.md#meaningful-documentation The native headline states this operation's input/result ownership and relevant absence/default meaning.
|
|
77
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node error and nullable numeric status are preserved as native result representations, with no platform shell exit interpretation.
|
|
78
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a small record and retains nothing.
|
|
79
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms reads two fields of the spawn result in constant time.
|
|
80
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work maps one spawn result once.
|
|
81
|
+
*/
|
|
82
|
+
function dumpCompletion(result: {
|
|
83
|
+
error?: Error;
|
|
84
|
+
status: number | null;
|
|
85
|
+
}): {
|
|
86
|
+
code: number;
|
|
87
|
+
diagnostic?: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Answer help without a producer, or retain the missing-installation failure.
|
|
91
|
+
*
|
|
92
|
+
* This summary is a fallback: installed native dump still owns its exact
|
|
93
|
+
* flags.
|
|
94
|
+
*
|
|
95
|
+
* @evidence contracts/common.md#principled-implementation Only the three existing help spellings qualify a missing-producer success; ordinary dump remains code one with the owned installation diagnostic.
|
|
96
|
+
* @evidence contracts/common.md#clear-and-simple-design The actual unresolved-binary facade writes these channels and returns their code; this operation decides neither resolution nor child execution.
|
|
97
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The qualified help summary names the native authority and its possible drift; no graph fact or native success is fabricated.
|
|
98
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose distinguishes missing-install help from installed authoritative help and ordinary missing-install failure.
|
|
99
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This completion maps already parsed tokens to fixed text and numeric code, without filesystem or process operations.
|
|
100
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources returns a small record of strings and retains nothing.
|
|
101
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms tests argv against three help spellings and returns a constant summary or message.
|
|
102
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work answers once per failed binary resolution.
|
|
103
|
+
*/
|
|
104
|
+
function missingDump(argv: readonly string[]): {
|
|
105
|
+
code: 0 | 1;
|
|
106
|
+
stdout?: string;
|
|
107
|
+
stderr?: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
interface IViewOptions extends IProjectOptions {
|
|
111
|
+
port: number;
|
|
112
|
+
open: boolean;
|
|
113
|
+
maxNodes: number;
|
|
114
|
+
}
|
|
115
|
+
export {};
|