@ttsc/graph 0.26.2 → 0.28.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 +3 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +15 -3
- package/lib/index.js.map +1 -1
- package/lib/model/TtscGraphMemory.d.ts +26 -0
- package/lib/model/TtscGraphMemory.js +121 -2
- package/lib/model/TtscGraphMemory.js.map +1 -1
- package/lib/model/TtscGraphSession.d.ts +23 -0
- package/lib/model/TtscGraphSession.js +248 -96
- package/lib/model/TtscGraphSession.js.map +1 -1
- package/lib/model/TtscGraphShardStore.js +6 -1
- package/lib/model/TtscGraphShardStore.js.map +1 -1
- package/lib/model/TtscLintDaemon.d.ts +54 -0
- package/lib/model/TtscLintDaemon.js +166 -0
- package/lib/model/TtscLintDaemon.js.map +1 -0
- package/lib/model/loadGraph.d.ts +8 -1
- package/lib/model/loadGraph.js +144 -72
- package/lib/model/loadGraph.js.map +1 -1
- package/lib/model/publishedArtifacts.d.ts +142 -0
- package/lib/model/publishedArtifacts.js +403 -0
- package/lib/model/publishedArtifacts.js.map +1 -0
- package/lib/nativeExecutable.js +17 -1
- package/lib/nativeExecutable.js.map +1 -1
- package/lib/reduce.js +20 -7
- package/lib/reduce.js.map +1 -1
- package/lib/server/createServer.js +38 -2
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/runDetails.d.ts +15 -0
- package/lib/server/runDetails.js +48 -0
- package/lib/server/runDetails.js.map +1 -1
- package/lib/server/runEntrypoints.js +7 -1
- package/lib/server/runEntrypoints.js.map +1 -1
- package/lib/server/runLookup.js +129 -11
- package/lib/server/runLookup.js.map +1 -1
- package/lib/structures/ITtscGraphApplication.d.ts +3 -1
- package/lib/structures/ITtscGraphDetails.d.ts +12 -0
- package/lib/structures/ITtscGraphDocTag.d.ts +44 -0
- package/lib/structures/ITtscGraphDocTag.js +3 -0
- package/lib/structures/ITtscGraphDocTag.js.map +1 -0
- package/lib/structures/ITtscGraphDump.d.ts +23 -4
- package/lib/structures/ITtscGraphLookup.d.ts +29 -0
- package/lib/structures/ITtscGraphNode.d.ts +25 -0
- package/lib/structures/TtscGraphArtifactNodeKind.d.ts +23 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js +37 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js.map +1 -0
- package/lib/structures/TtscGraphDumpEdgeKind.d.ts +1 -1
- package/lib/structures/TtscGraphDumpNodeKind.d.ts +10 -2
- package/lib/structures/TtscGraphEdgeKind.d.ts +8 -1
- package/lib/structures/TtscGraphNodeKind.d.ts +1 -1
- package/lib/structures/index.d.ts +2 -0
- package/lib/structures/index.js +2 -0
- package/lib/structures/index.js.map +1 -1
- package/lib/view.js +17 -1
- package/lib/view.js.map +1 -1
- package/lib/viewer/index.html +5 -13
- package/lib/viewer/viewer.js +190 -190
- package/package.json +5 -5
- package/src/index.ts +23 -6
- package/src/model/TtscGraphMemory.ts +118 -2
- package/src/model/TtscGraphSession.ts +112 -2
- package/src/model/TtscGraphShardStore.ts +6 -1
- package/src/model/TtscLintDaemon.ts +179 -0
- package/src/model/loadGraph.ts +29 -5
- package/src/model/publishedArtifacts.ts +548 -0
- package/src/nativeExecutable.ts +24 -1
- package/src/reduce.ts +20 -7
- package/src/server/runDetails.ts +52 -1
- package/src/server/runEntrypoints.ts +7 -1
- package/src/server/runLookup.ts +139 -14
- package/src/structures/ITtscGraphApplication.ts +3 -1
- package/src/structures/ITtscGraphDetails.ts +13 -0
- package/src/structures/ITtscGraphDocTag.ts +45 -0
- package/src/structures/ITtscGraphDump.ts +25 -4
- package/src/structures/ITtscGraphLookup.ts +31 -0
- package/src/structures/ITtscGraphNode.ts +27 -0
- package/src/structures/TtscGraphArtifactNodeKind.ts +35 -0
- package/src/structures/TtscGraphDumpEdgeKind.ts +1 -0
- package/src/structures/TtscGraphDumpNodeKind.ts +16 -2
- package/src/structures/TtscGraphEdgeKind.ts +8 -0
- package/src/structures/TtscGraphNodeKind.ts +7 -1
- package/src/structures/index.ts +2 -0
- package/src/view.ts +17 -1
- package/src/viewer/index.html +5 -13
- package/src/viewer/legend.ts +107 -0
- package/src/viewer/main.ts +19 -21
package/README.md
CHANGED
|
@@ -89,7 +89,9 @@ The interactive charts, every model, and the method are on the benchmark page: h
|
|
|
89
89
|
* - `tour`: architecture, runtime flow, orientation, or a code tour. One call is
|
|
90
90
|
* the whole answer; do not split it.
|
|
91
91
|
* - `entrypoints`: find where execution starts when entry points are unknown.
|
|
92
|
-
* - `lookup`: locate a named symbol
|
|
92
|
+
* - `lookup`: locate a named symbol, or — with a documentation target as the
|
|
93
|
+
* query (`docs/pricing.md#sale`, `POST:/orders`) — the declarations whose
|
|
94
|
+
* documentation cites it.
|
|
93
95
|
* - `trace`: follow calls or data flow forward or backward from a symbol, or —
|
|
94
96
|
* with `to` — the path between two symbols when both ends are known, which is
|
|
95
97
|
* the one call that answers "how does A reach B".
|
package/lib/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { resolveGraphBinary } from "./resolveGraphBinary";
|
|
|
12
12
|
*/
|
|
13
13
|
export { reduce } from "./reduce";
|
|
14
14
|
export type { RawDump, RawEdge, RawNode, ViewerPayload } from "./reduce";
|
|
15
|
-
export { loadGraph } from "./model/loadGraph";
|
|
15
|
+
export { DUMP_SCHEMA_VERSION, loadGraph } from "./model/loadGraph";
|
|
16
16
|
export { TtscGraphSession, type TtscGraphRequestOptions, type TtscGraphSessionOptions, } from "./model/TtscGraphSession";
|
|
17
17
|
/**
|
|
18
18
|
* Run the `@ttsc/graph` launcher.
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TtscGraphSession = exports.loadGraph = exports.reduce = exports.resolveGraphBinary = exports.RESULT_AUDIT_SELECTION = exports.RESULT_AUDIT_ESCAPE = exports.RESULT_AUDIT_DETAILS_CAPPED = exports.RESULT_AUDIT_DETAILS = exports.RESULT_AUDIT = void 0;
|
|
3
|
+
exports.TtscGraphSession = exports.loadGraph = exports.DUMP_SCHEMA_VERSION = exports.reduce = exports.resolveGraphBinary = exports.RESULT_AUDIT_SELECTION = exports.RESULT_AUDIT_ESCAPE = exports.RESULT_AUDIT_DETAILS_CAPPED = exports.RESULT_AUDIT_DETAILS = exports.RESULT_AUDIT = void 0;
|
|
4
4
|
exports.runGraph = runGraph;
|
|
5
5
|
const node_child_process_1 = require("node:child_process");
|
|
6
6
|
const launcherArgs_1 = require("./launcherArgs");
|
|
7
|
+
const publishedArtifacts_1 = require("./model/publishedArtifacts");
|
|
7
8
|
const nativeExecutable_1 = require("./nativeExecutable");
|
|
8
9
|
const resolveGraphBinary_1 = require("./resolveGraphBinary");
|
|
9
10
|
const startServer_1 = require("./server/startServer");
|
|
@@ -33,6 +34,7 @@ Object.defineProperty(exports, "resolveGraphBinary", { enumerable: true, get: fu
|
|
|
33
34
|
var reduce_1 = require("./reduce");
|
|
34
35
|
Object.defineProperty(exports, "reduce", { enumerable: true, get: function () { return reduce_1.reduce; } });
|
|
35
36
|
var loadGraph_1 = require("./model/loadGraph");
|
|
37
|
+
Object.defineProperty(exports, "DUMP_SCHEMA_VERSION", { enumerable: true, get: function () { return loadGraph_1.DUMP_SCHEMA_VERSION; } });
|
|
36
38
|
Object.defineProperty(exports, "loadGraph", { enumerable: true, get: function () { return loadGraph_1.loadGraph; } });
|
|
37
39
|
var TtscGraphSession_1 = require("./model/TtscGraphSession");
|
|
38
40
|
Object.defineProperty(exports, "TtscGraphSession", { enumerable: true, get: function () { return TtscGraphSession_1.TtscGraphSession; } });
|
|
@@ -101,7 +103,7 @@ function printDumpHelp() {
|
|
|
101
103
|
function runDump(argv) {
|
|
102
104
|
// Resolve the native binary from the target project the caller named with
|
|
103
105
|
// `--cwd`, not from wherever the launcher process happened to start.
|
|
104
|
-
const { cwd } = (0, launcherArgs_1.projectOptions)((0, launcherArgs_1.parseLauncherOptions)(argv, DUMP_OPTIONS));
|
|
106
|
+
const { cwd, tsconfig } = (0, launcherArgs_1.projectOptions)((0, launcherArgs_1.parseLauncherOptions)(argv, DUMP_OPTIONS));
|
|
105
107
|
const binary = (0, resolveGraphBinary_1.resolveGraphBinary)(process.env, cwd);
|
|
106
108
|
if (binary === null) {
|
|
107
109
|
// `ttscgraph` owns the flag contract, so a resolvable binary always answers
|
|
@@ -119,7 +121,17 @@ function runDump(argv) {
|
|
|
119
121
|
return 1;
|
|
120
122
|
}
|
|
121
123
|
(0, nativeExecutable_1.ensureExecutable)(binary);
|
|
122
|
-
|
|
124
|
+
// The same artifacts `loadGraph` and the resident session ask for, so the
|
|
125
|
+
// three ways to reach a dump answer a citation the same way. A caller that
|
|
126
|
+
// named `--artifacts` itself owns the answer and is not overridden.
|
|
127
|
+
const published = argv.includes("--artifacts")
|
|
128
|
+
? null
|
|
129
|
+
: (0, publishedArtifacts_1.publishArtifacts)({ cwd, tsconfig });
|
|
130
|
+
const result = (0, node_child_process_1.spawnSync)(binary, [
|
|
131
|
+
"dump",
|
|
132
|
+
...argv,
|
|
133
|
+
...(published?.file == null ? [] : ["--artifacts", published.file]),
|
|
134
|
+
], {
|
|
123
135
|
stdio: "inherit",
|
|
124
136
|
windowsHide: true,
|
|
125
137
|
});
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,2DAA+C;AAE/C,iDAIwB;AACxB,yDAAsD;AACtD,6DAA0D;AAC1D,sDAAmD;AACnD,iCAAiC;AAEjC,gEAAgE;AAChE,oDAM8B;AAL5B,2GAAA,YAAY,OAAA;AACZ,mHAAA,oBAAoB,OAAA;AACpB,0HAAA,2BAA2B,OAAA;AAC3B,kHAAA,mBAAmB,OAAA;AACnB,qHAAA,sBAAsB,OAAA;AAGxB,8EAA8E;AAC9E,0EAA0E;AAC1E,+EAA+E;AAC/E,+CAA+C;AAC/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E,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;KACpE,EACD;QACE,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,IAAI;KAClB,CACF,CAAC;IACF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;QAC/D,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -19,6 +19,7 @@ export declare class TtscGraphMemory {
|
|
|
19
19
|
private readonly inEdges;
|
|
20
20
|
private readonly byNameIndex;
|
|
21
21
|
private readonly bySymbolIndex;
|
|
22
|
+
private readonly byDocTagTarget;
|
|
22
23
|
/** The absolute project root the dump was built for. */
|
|
23
24
|
readonly project: string;
|
|
24
25
|
/** Every post-fold node, including refined properties and file containers. */
|
|
@@ -42,4 +43,29 @@ export declare class TtscGraphMemory {
|
|
|
42
43
|
symbols(handle: string): readonly ITtscGraphNode[];
|
|
43
44
|
/** Every workspace node on its module's export surface. */
|
|
44
45
|
exported(): ITtscGraphNode[];
|
|
46
|
+
/**
|
|
47
|
+
* Every declaration whose documentation names this address — the reverse of
|
|
48
|
+
* the citation question.
|
|
49
|
+
*
|
|
50
|
+
* The forward direction costs a reader one file: the tag sits above the
|
|
51
|
+
* declaration they already found. The reverse direction is what an index is
|
|
52
|
+
* for, because the declarations implementing one specification are scattered
|
|
53
|
+
* across every file that implements it, and finding them otherwise means
|
|
54
|
+
* searching the whole repository.
|
|
55
|
+
*
|
|
56
|
+
* The address is exact and is spelled as {@link documentationTarget} decides,
|
|
57
|
+
* so a caller passes that function's output rather than a raw query. Which
|
|
58
|
+
* part of a tag's text names a thing belongs to whatever convention wrote the
|
|
59
|
+
* tag, so this is a selection rule of the consuming layer rather than a fact
|
|
60
|
+
* the producer claims.
|
|
61
|
+
*/
|
|
62
|
+
citing(target: string): readonly ITtscGraphNode[];
|
|
45
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* The first whitespace-delimited token, or the whole brace group it opens.
|
|
66
|
+
*
|
|
67
|
+
* An unclosed brace group is not a token: `{@link ISale` with the brace
|
|
68
|
+
* forgotten would otherwise fall through to the whitespace split and index the
|
|
69
|
+
* address `{@link`, which every link in the project shares.
|
|
70
|
+
*/
|
|
71
|
+
export declare function leadingToken(text: string | undefined): string | undefined;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TtscGraphMemory = void 0;
|
|
4
|
+
exports.documentationTarget = documentationTarget;
|
|
5
|
+
exports.leadingToken = leadingToken;
|
|
6
|
+
const TtscGraphArtifactNodeKind_1 = require("../structures/TtscGraphArtifactNodeKind");
|
|
4
7
|
const TtscGraphNodeId_1 = require("./TtscGraphNodeId");
|
|
5
8
|
const TtscGraphSourceReader_1 = require("./TtscGraphSourceReader");
|
|
6
9
|
/**
|
|
@@ -20,6 +23,7 @@ class TtscGraphMemory {
|
|
|
20
23
|
inEdges;
|
|
21
24
|
byNameIndex;
|
|
22
25
|
bySymbolIndex;
|
|
26
|
+
byDocTagTarget;
|
|
23
27
|
/** The absolute project root the dump was built for. */
|
|
24
28
|
project;
|
|
25
29
|
/** Every post-fold node, including refined properties and file containers. */
|
|
@@ -36,6 +40,7 @@ class TtscGraphMemory {
|
|
|
36
40
|
this.byId = new Map(nodes.map((n) => [n.id, n]));
|
|
37
41
|
this.byNameIndex = new Map();
|
|
38
42
|
this.bySymbolIndex = new Map();
|
|
43
|
+
this.byDocTagTarget = new Map();
|
|
39
44
|
for (const node of nodes) {
|
|
40
45
|
const bucket = this.byNameIndex.get(node.name);
|
|
41
46
|
if (bucket)
|
|
@@ -48,6 +53,18 @@ class TtscGraphMemory {
|
|
|
48
53
|
push(this.bySymbolIndex, node.qualifiedName, node);
|
|
49
54
|
}
|
|
50
55
|
}
|
|
56
|
+
for (const target of docTagTargetsOf(node)) {
|
|
57
|
+
const carriers = this.byDocTagTarget.get(target);
|
|
58
|
+
// The membership check is redundant today — `docTagTargetsOf`
|
|
59
|
+
// deduplicates within a node and this loop visits each node once — and
|
|
60
|
+
// it is kept because the cost is a scan of a list that holds the
|
|
61
|
+
// carriers of one address, while the failure it prevents is a
|
|
62
|
+
// declaration reported twice as implementing one specification.
|
|
63
|
+
if (carriers === undefined)
|
|
64
|
+
this.byDocTagTarget.set(target, [node]);
|
|
65
|
+
else if (!carriers.includes(node))
|
|
66
|
+
carriers.push(node);
|
|
67
|
+
}
|
|
51
68
|
}
|
|
52
69
|
this.outEdges = new Map();
|
|
53
70
|
this.inEdges = new Map();
|
|
@@ -85,8 +102,101 @@ class TtscGraphMemory {
|
|
|
85
102
|
exported() {
|
|
86
103
|
return this.nodes.filter((n) => n.exported && !n.external);
|
|
87
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Every declaration whose documentation names this address — the reverse of
|
|
107
|
+
* the citation question.
|
|
108
|
+
*
|
|
109
|
+
* The forward direction costs a reader one file: the tag sits above the
|
|
110
|
+
* declaration they already found. The reverse direction is what an index is
|
|
111
|
+
* for, because the declarations implementing one specification are scattered
|
|
112
|
+
* across every file that implements it, and finding them otherwise means
|
|
113
|
+
* searching the whole repository.
|
|
114
|
+
*
|
|
115
|
+
* The address is exact and is spelled as {@link documentationTarget} decides,
|
|
116
|
+
* so a caller passes that function's output rather than a raw query. Which
|
|
117
|
+
* part of a tag's text names a thing belongs to whatever convention wrote the
|
|
118
|
+
* tag, so this is a selection rule of the consuming layer rather than a fact
|
|
119
|
+
* the producer claims.
|
|
120
|
+
*/
|
|
121
|
+
citing(target) {
|
|
122
|
+
return this.byDocTagTarget.get(target) ?? [];
|
|
123
|
+
}
|
|
88
124
|
}
|
|
89
125
|
exports.TtscGraphMemory = TtscGraphMemory;
|
|
126
|
+
/**
|
|
127
|
+
* The address each of a node's documentation tags names, deduplicated.
|
|
128
|
+
*
|
|
129
|
+
* A braced inline link is one token including its braces (`{@link ISale}`),
|
|
130
|
+
* because that is how the author wrote the target and how a reader searching
|
|
131
|
+
* for it will spell it. Splitting on whitespace alone would key it under
|
|
132
|
+
* `{@link`, which is every link in the project.
|
|
133
|
+
*/
|
|
134
|
+
function docTagTargetsOf(node) {
|
|
135
|
+
if (node.docTags === undefined)
|
|
136
|
+
return [];
|
|
137
|
+
const targets = [];
|
|
138
|
+
for (const tag of node.docTags) {
|
|
139
|
+
const token = documentationTarget(tag.text);
|
|
140
|
+
if (token !== undefined && !targets.includes(token))
|
|
141
|
+
targets.push(token);
|
|
142
|
+
}
|
|
143
|
+
return targets;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The address a documentation tag's text opens with, or undefined when its
|
|
147
|
+
* first token is ordinary prose.
|
|
148
|
+
*
|
|
149
|
+
* Every unrecognized tag arrives here, and most of them are not citations:
|
|
150
|
+
* TypeScript has no AST kind for `@remarks`, `@example`, `@todo`, `@internal`,
|
|
151
|
+
* or `@default` either, so their first word reaches this function exactly as a
|
|
152
|
+
* citation target does. Indexing those turned `@todo Add caching here` into a
|
|
153
|
+
* carrier of the address `Add`, and a query opening with that word answered
|
|
154
|
+
* with it — above every real name match, and labelled a certain citation.
|
|
155
|
+
*
|
|
156
|
+
* So a token qualifies only when it carries a separator that prose does not: a
|
|
157
|
+
* path or anchor (`docs/pricing.md#sale`), a namespaced or method-prefixed
|
|
158
|
+
* address (`POST:/orders`, `prisma:Sale`), an inline link, or a URL. An English
|
|
159
|
+
* word carries none of these, and neither does a bare number, so `@default 4`
|
|
160
|
+
* and `@todo Add caching` index nothing while every address form in use does.
|
|
161
|
+
*
|
|
162
|
+
* This is a selection rule, not a claim about the source. It lives here rather
|
|
163
|
+
* than in the producer for that reason: the graph reports the tag as written
|
|
164
|
+
* and this decides only what the ranked operations will match on, which is the
|
|
165
|
+
* layer whose audit already declares its selection heuristic. A convention
|
|
166
|
+
* whose addresses look like prose is simply not indexed; nothing is lost from
|
|
167
|
+
* the tag itself, which `details` still returns in full.
|
|
168
|
+
*/
|
|
169
|
+
function documentationTarget(text) {
|
|
170
|
+
const token = leadingToken(text);
|
|
171
|
+
if (token === undefined)
|
|
172
|
+
return undefined;
|
|
173
|
+
if (token.startsWith("{"))
|
|
174
|
+
return token;
|
|
175
|
+
// A separator anywhere but the last position: a trailing one is sentence
|
|
176
|
+
// punctuation ("Uses the cache." ends in a dot and names nothing), while an
|
|
177
|
+
// interior one is what every address form spells.
|
|
178
|
+
return /[/#:][^\s]/u.test(token) || /\.[^\s.]/u.test(token)
|
|
179
|
+
? token
|
|
180
|
+
: undefined;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The first whitespace-delimited token, or the whole brace group it opens.
|
|
184
|
+
*
|
|
185
|
+
* An unclosed brace group is not a token: `{@link ISale` with the brace
|
|
186
|
+
* forgotten would otherwise fall through to the whitespace split and index the
|
|
187
|
+
* address `{@link`, which every link in the project shares.
|
|
188
|
+
*/
|
|
189
|
+
function leadingToken(text) {
|
|
190
|
+
const trimmed = text?.trim();
|
|
191
|
+
if (trimmed === undefined || trimmed === "")
|
|
192
|
+
return undefined;
|
|
193
|
+
if (trimmed.startsWith("{")) {
|
|
194
|
+
const close = trimmed.indexOf("}");
|
|
195
|
+
return close > 0 ? trimmed.slice(0, close + 1) : undefined;
|
|
196
|
+
}
|
|
197
|
+
const stop = trimmed.search(/\s/u);
|
|
198
|
+
return stop < 0 ? trimmed : trimmed.slice(0, stop);
|
|
199
|
+
}
|
|
90
200
|
/** Append value to the slice stored at key, creating the slice on first use. */
|
|
91
201
|
function push(map, key, value) {
|
|
92
202
|
const bucket = map.get(key);
|
|
@@ -119,7 +229,7 @@ function ownerKey(node) {
|
|
|
119
229
|
const owner = node.qualifiedName.slice(0, -suffix.length);
|
|
120
230
|
return owner === "" ? undefined : owner;
|
|
121
231
|
}
|
|
122
|
-
/** A file's id and node name from its
|
|
232
|
+
/** A file's id and node name from its dump path coordinate. */
|
|
123
233
|
function fileNodeId(file) {
|
|
124
234
|
return file;
|
|
125
235
|
}
|
|
@@ -229,7 +339,7 @@ function synthesize(dump) {
|
|
|
229
339
|
});
|
|
230
340
|
};
|
|
231
341
|
for (const node of nodes) {
|
|
232
|
-
if (node.external)
|
|
342
|
+
if (node.external || (0, TtscGraphArtifactNodeKind_1.isArtifactNodeKind)(node.kind))
|
|
233
343
|
continue;
|
|
234
344
|
addFileNode(node.file);
|
|
235
345
|
}
|
|
@@ -244,6 +354,15 @@ function synthesize(dump) {
|
|
|
244
354
|
// legacy subpath.
|
|
245
355
|
const structural = [];
|
|
246
356
|
for (const node of nodes) {
|
|
357
|
+
// An artifact is contained by the artifact its producer named, and by
|
|
358
|
+
// nothing when that producer named none. It is never contained by a `file`
|
|
359
|
+
// node: a document is already its own node, a Prisma address carries no
|
|
360
|
+
// path on purpose, and an API operation has no file at all.
|
|
361
|
+
if ((0, TtscGraphArtifactNodeKind_1.isArtifactNodeKind)(node.kind)) {
|
|
362
|
+
if (node.parent !== undefined && node.parent !== "")
|
|
363
|
+
structural.push({ from: node.parent, to: node.id, kind: "contains" });
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
247
366
|
if (node.external || node.file === "")
|
|
248
367
|
continue;
|
|
249
368
|
const parent = owner(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtscGraphMemory.js","sourceRoot":"","sources":["../../src/model/TtscGraphMemory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TtscGraphMemory.js","sourceRoot":"","sources":["../../src/model/TtscGraphMemory.ts"],"names":[],"mappings":";;;;;AAKA,uFAA6E;AAE7E,uDAAwD;AACxD,mEAAgE;AAEhE;;;;;;;;;;GAUG;AACH;IACmB,IAAI,CAA8B;IAClC,QAAQ,CAAgC;IACxC,OAAO,CAAgC;IACvC,WAAW,CAAgC;IAC3C,aAAa,CAAgC;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IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;QACxC,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,UAAU,CAAC;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -31,6 +31,26 @@ export declare class TtscGraphSession {
|
|
|
31
31
|
private queue;
|
|
32
32
|
private current;
|
|
33
33
|
private shardStore;
|
|
34
|
+
/**
|
|
35
|
+
* The artifact answer the resident child was last handed, and the state of
|
|
36
|
+
* the inputs it came from.
|
|
37
|
+
*
|
|
38
|
+
* `undefined` only before a child exists. Once one does this is always an
|
|
39
|
+
* answer, including the answer that the project publishes nothing — which
|
|
40
|
+
* still carries inputs, so that adding a publisher is something a running
|
|
41
|
+
* session can notice.
|
|
42
|
+
*/
|
|
43
|
+
private artifacts;
|
|
44
|
+
/**
|
|
45
|
+
* One resident `@ttsc/lint` sidecar per plugin binary, opened lazily.
|
|
46
|
+
*
|
|
47
|
+
* A republish asks two verbs of every configured publisher, and a session
|
|
48
|
+
* republishes whenever a document moves. Held open, those questions cost a
|
|
49
|
+
* request each instead of a process, a plugin load and a configuration
|
|
50
|
+
* evaluation each. Keyed by binary because that is what a daemon is: the same
|
|
51
|
+
* binary answering for the same project.
|
|
52
|
+
*/
|
|
53
|
+
private readonly daemons;
|
|
34
54
|
private closed;
|
|
35
55
|
constructor(options: TtscGraphSessionOptions);
|
|
36
56
|
/** Return a graph for the current disk snapshot, serialized per tool call. */
|
|
@@ -39,6 +59,9 @@ export declare class TtscGraphSession {
|
|
|
39
59
|
close(): void;
|
|
40
60
|
private refresh;
|
|
41
61
|
private assertResponseSemantics;
|
|
62
|
+
private republishArtifacts;
|
|
63
|
+
/** The open sidecar for one plugin, opened on first use. */
|
|
64
|
+
private daemon;
|
|
42
65
|
private request;
|
|
43
66
|
private ensureChild;
|
|
44
67
|
private onLine;
|