@beehexa/hexasync-template-index 2608.15.1 → 2608.20.18
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/package.json +4 -4
- package/dist/checkpoints.d.ts +0 -47
- package/dist/checkpoints.d.ts.map +0 -1
- package/dist/checkpoints.js +0 -59
- package/dist/checkpoints.js.map +0 -1
- package/dist/cursorContext.d.ts +0 -204
- package/dist/cursorContext.d.ts.map +0 -1
- package/dist/cursorContext.js +0 -479
- package/dist/cursorContext.js.map +0 -1
- package/dist/detectors.d.ts +0 -103
- package/dist/detectors.d.ts.map +0 -1
- package/dist/detectors.js +0 -104
- package/dist/detectors.js.map +0 -1
- package/dist/discovery.d.ts +0 -249
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js +0 -455
- package/dist/discovery.js.map +0 -1
- package/dist/effectiveGraph.d.ts +0 -240
- package/dist/effectiveGraph.d.ts.map +0 -1
- package/dist/effectiveGraph.js +0 -523
- package/dist/effectiveGraph.js.map +0 -1
- package/dist/failures.d.ts +0 -50
- package/dist/failures.d.ts.map +0 -1
- package/dist/failures.js +0 -125
- package/dist/failures.js.map +0 -1
- package/dist/graph.d.ts +0 -47
- package/dist/graph.d.ts.map +0 -1
- package/dist/graph.js +0 -230
- package/dist/graph.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -38
- package/dist/index.js.map +0 -1
- package/dist/queries.d.ts +0 -102
- package/dist/queries.d.ts.map +0 -1
- package/dist/queries.js +0 -469
- package/dist/queries.js.map +0 -1
- package/dist/ranges.d.ts +0 -71
- package/dist/ranges.d.ts.map +0 -1
- package/dist/ranges.js +0 -322
- package/dist/ranges.js.map +0 -1
- package/dist/resolveField.d.ts +0 -125
- package/dist/resolveField.d.ts.map +0 -1
- package/dist/resolveField.js +0 -234
- package/dist/resolveField.js.map +0 -1
- package/dist/tier1Service.d.ts +0 -96
- package/dist/tier1Service.d.ts.map +0 -1
- package/dist/tier1Service.js +0 -194
- package/dist/tier1Service.js.map +0 -1
- package/dist/tier2Service.d.ts +0 -195
- package/dist/tier2Service.d.ts.map +0 -1
- package/dist/tier2Service.js +0 -642
- package/dist/tier2Service.js.map +0 -1
- package/dist/yamlScalar.d.ts +0 -17
- package/dist/yamlScalar.d.ts.map +0 -1
- package/dist/yamlScalar.js +0 -101
- package/dist/yamlScalar.js.map +0 -1
package/dist/ranges.js
DELETED
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where a component physically sits in its file (Story 3.4 AC 2).
|
|
3
|
-
*
|
|
4
|
-
* Computed ON DEMAND rather than carried on every component. A range is only ever wanted for the
|
|
5
|
-
* handful of components a developer looks at — a hover, a go-to-definition, a rename preview —
|
|
6
|
-
* while building one for all 273 would mean a second full parse of every worklist file at build
|
|
7
|
-
* time, which is the exact cost Story 3.1 spent the epic removing.
|
|
8
|
-
*
|
|
9
|
-
* The text comes from the graph's own prefetched `sources`, so this reads nothing.
|
|
10
|
-
*
|
|
11
|
-
* Looks the collection up DIRECTLY rather than walking every node and inspecting its ancestors.
|
|
12
|
-
* The first version did the latter and silently returned nothing for every map-keyed collection,
|
|
13
|
-
* because it reached for `.range` on a `Pair` — which is not a Node and has none. That is the
|
|
14
|
-
* whole of `objectAssociations`, so go-to-definition had nowhere to go for precisely the
|
|
15
|
-
* components this epic had just taught the graph to see.
|
|
16
|
-
*/
|
|
17
|
-
import { parseDocument, isScalar, isSeq, isMap, } from 'yaml';
|
|
18
|
-
import { normalizeComponentKey } from '@beehexa/hexasync-template-compose';
|
|
19
|
-
const positionAt = (text, offset) => {
|
|
20
|
-
let line = 0;
|
|
21
|
-
let lineStart = 0;
|
|
22
|
-
for (let i = 0; i < offset && i < text.length; i++) {
|
|
23
|
-
if (text[i] === '\n') {
|
|
24
|
-
line++;
|
|
25
|
-
lineStart = i + 1;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return { line, column: offset - lineStart };
|
|
29
|
-
};
|
|
30
|
-
const rangeOf = (node) => {
|
|
31
|
-
const range = node?.range;
|
|
32
|
-
return range ? [range[0], range[1]] : undefined;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* The range of one component within a file's text.
|
|
36
|
-
*
|
|
37
|
-
* Matched on the component's own identity — its `id`/`key` inside the named collection — rather
|
|
38
|
-
* than on a positional index. A file's components are not necessarily in the same order as the
|
|
39
|
-
* project's merged view of them, and an index taken from one and applied to the other is the
|
|
40
|
-
* defect this epic already had to fix once in the cursor path.
|
|
41
|
-
*
|
|
42
|
-
* When a file declares the same identity twice, the LAST one wins, because that is what the
|
|
43
|
-
* merge does — navigating to the entry that was overridden would point at text with no effect.
|
|
44
|
-
*/
|
|
45
|
-
export function findComponentRange(text, collection, id) {
|
|
46
|
-
let doc;
|
|
47
|
-
try {
|
|
48
|
-
doc = parseDocument(text, { keepSourceTokens: true });
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
// `parseDocument` COLLECTS errors rather than throwing, so the catch above is not the guard it
|
|
54
|
-
// looks like. A file mid-keystroke parses into something partial, and a range read off it can
|
|
55
|
-
// point anywhere; saying "no range" beats pointing a hover at the wrong line.
|
|
56
|
-
if (!doc || doc.errors.length > 0 || !isMap(doc.contents))
|
|
57
|
-
return undefined;
|
|
58
|
-
const node = doc.contents.get(collection, true);
|
|
59
|
-
if (!node)
|
|
60
|
-
return undefined;
|
|
61
|
-
let found;
|
|
62
|
-
// Array form: `collection: [ {id: X}, … ]`.
|
|
63
|
-
if (isSeq(node)) {
|
|
64
|
-
for (const item of node.items) {
|
|
65
|
-
if (!isMap(item))
|
|
66
|
-
continue;
|
|
67
|
-
const identity = normalizeComponentKey(item.get('id') ?? item.get('key'));
|
|
68
|
-
// Normalised the same way the graph keys components, so a quoted id is findable by its bare
|
|
69
|
-
// spelling and a `!`-removal directive is not mistaken for a declaration.
|
|
70
|
-
if (!identity || identity.removes || identity.id !== id)
|
|
71
|
-
continue;
|
|
72
|
-
const itemRange = rangeOf(item);
|
|
73
|
-
// Widened LEFT to include the `- ` list marker, which the item's own range starts after. A
|
|
74
|
-
// "select this component" action built on the unwidened range dropped the marker and produced
|
|
75
|
-
// a fragment that is not a list item.
|
|
76
|
-
found = itemRange
|
|
77
|
-
? [markerStart(text, itemRange[0]), itemRange[1]]
|
|
78
|
-
: found; // keep scanning: last wins
|
|
79
|
-
}
|
|
80
|
-
return found ? toRange(text, found) : undefined;
|
|
81
|
-
}
|
|
82
|
-
// Map form: `collection: { X: … }` — the component IS the pair's value, keyed by its id.
|
|
83
|
-
if (isMap(node)) {
|
|
84
|
-
for (const pair of node.items) {
|
|
85
|
-
if (!isScalar(pair.key) || String(pair.key.value) !== id)
|
|
86
|
-
continue;
|
|
87
|
-
// A `Pair` is not a Node and has no range of its own. The component spans from where its
|
|
88
|
-
// KEY starts to where its VALUE ends, which is what a reader would select.
|
|
89
|
-
const keyRange = rangeOf(pair.key);
|
|
90
|
-
const valueRange = rangeOf(pair.value);
|
|
91
|
-
if (!keyRange)
|
|
92
|
-
continue;
|
|
93
|
-
found = [keyRange[0], valueRange ? valueRange[1] : keyRange[1]];
|
|
94
|
-
}
|
|
95
|
-
return found ? toRange(text, found) : undefined;
|
|
96
|
-
}
|
|
97
|
-
return undefined;
|
|
98
|
-
}
|
|
99
|
-
/** The key `findComponentRanges` maps by — the same identity pair `getComponent` is asked for. */
|
|
100
|
-
export const componentRangeKey = (collection, id) => `${collection}\u0000${id}`;
|
|
101
|
-
/**
|
|
102
|
-
* EVERY component's range in a file, from ONE parse (Phase 3 Story 3.2 AC 3).
|
|
103
|
-
*
|
|
104
|
-
* `findComponentRange` above parses the whole document to answer for one component, which is right for
|
|
105
|
-
* the one-off lookups it was written for — a hover, a go-to-definition. It is quadratic for a caller
|
|
106
|
-
* that wants them all: `getComponent` cached per component, so an outline of a 40-component file paid
|
|
107
|
-
* 40 full parses of that file.
|
|
108
|
-
*
|
|
109
|
-
* Measured, which is why this exists. Story 3.2's outline came in at **p95 313 ms, worst project
|
|
110
|
-
* 1,161 ms** against a 200 ms budget, and the workspace query at 561 ms. The epic's own contingency note
|
|
111
|
-
* says a missed budget is answered with a different strategy and never a relaxed number, because
|
|
112
|
-
* counter-metric C1 makes responsiveness non-negotiable. This is that strategy: parse once, look up N
|
|
113
|
-
* times.
|
|
114
|
-
*
|
|
115
|
-
* Deliberately shares `collectRanges` with the single-component function rather than reimplementing the
|
|
116
|
-
* item walk. The list-marker widening and the `trimEnd` correction below were each found by a failing
|
|
117
|
-
* test, and a second copy of that logic would not have inherited either.
|
|
118
|
-
*/
|
|
119
|
-
export function findComponentRanges(text) {
|
|
120
|
-
const found = new Map();
|
|
121
|
-
let doc;
|
|
122
|
-
try {
|
|
123
|
-
doc = parseDocument(text, { keepSourceTokens: true });
|
|
124
|
-
}
|
|
125
|
-
catch {
|
|
126
|
-
return found;
|
|
127
|
-
}
|
|
128
|
-
// Same guard as the single lookup, and for the same reason: a partial parse yields ranges that can
|
|
129
|
-
// point anywhere, and an outline of confidently wrong ranges is worse than no outline.
|
|
130
|
-
if (!doc || doc.errors.length > 0 || !isMap(doc.contents))
|
|
131
|
-
return found;
|
|
132
|
-
for (const pair of doc.contents.items) {
|
|
133
|
-
if (!isScalar(pair.key))
|
|
134
|
-
continue;
|
|
135
|
-
const collection = String(pair.key.value);
|
|
136
|
-
const node = pair.value;
|
|
137
|
-
if (!node)
|
|
138
|
-
continue;
|
|
139
|
-
for (const [id, offsets] of collectRanges(text, node)) {
|
|
140
|
-
found.set(componentRangeKey(collection, id), toRange(text, offsets));
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return found;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Each component of one collection node, by id, as raw offsets.
|
|
147
|
-
*
|
|
148
|
-
* The shared half of both range functions. Two shapes occur — a sequence of `{id}` maps, and a map
|
|
149
|
-
* keyed by id — and the LAST declaration of an identity wins, because that is what the merge does:
|
|
150
|
-
* navigating to an entry that was overridden would point at text with no effect.
|
|
151
|
-
*/
|
|
152
|
-
function collectRanges(text, node) {
|
|
153
|
-
const found = new Map();
|
|
154
|
-
if (isSeq(node)) {
|
|
155
|
-
for (const item of node.items) {
|
|
156
|
-
if (!isMap(item))
|
|
157
|
-
continue;
|
|
158
|
-
const identity = normalizeComponentKey(item.get('id') ?? item.get('key'));
|
|
159
|
-
if (!identity || identity.removes)
|
|
160
|
-
continue;
|
|
161
|
-
const itemRange = rangeOf(item);
|
|
162
|
-
// Widened LEFT to include the `- ` list marker, which the item's own range starts after.
|
|
163
|
-
if (itemRange)
|
|
164
|
-
found.set(identity.id, [markerStart(text, itemRange[0]), itemRange[1]]);
|
|
165
|
-
}
|
|
166
|
-
return found;
|
|
167
|
-
}
|
|
168
|
-
if (isMap(node)) {
|
|
169
|
-
for (const pair of node.items) {
|
|
170
|
-
if (!isScalar(pair.key))
|
|
171
|
-
continue;
|
|
172
|
-
// A `Pair` is not a Node and has no range of its own. The component spans from where its KEY
|
|
173
|
-
// starts to where its VALUE ends, which is what a reader would select.
|
|
174
|
-
const keyRange = rangeOf(pair.key);
|
|
175
|
-
if (!keyRange)
|
|
176
|
-
continue;
|
|
177
|
-
const valueRange = rangeOf(pair.value);
|
|
178
|
-
found.set(String(pair.key.value), [
|
|
179
|
-
keyRange[0],
|
|
180
|
-
valueRange ? valueRange[1] : keyRange[1],
|
|
181
|
-
]);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return found;
|
|
185
|
-
}
|
|
186
|
-
const toRange = (text, [start, end]) => ({
|
|
187
|
-
start: positionAt(text, start),
|
|
188
|
-
end: positionAt(text, trimEnd(text, start, end)),
|
|
189
|
-
});
|
|
190
|
-
/**
|
|
191
|
-
* Pull an end offset back off trailing whitespace.
|
|
192
|
-
*
|
|
193
|
-
* `node.range[1]` for a block-collection member sits AFTER the newline that ends it, so on
|
|
194
|
-
* `objects:\n - id: ONE\n name: one\n - id: TWO\n` the range for ONE ended at line 3 column 0
|
|
195
|
-
* — which is TWO's own line. Any consumer asking "which component contains this position" got the
|
|
196
|
-
* wrong answer at every boundary, and two adjacent components' ranges touched.
|
|
197
|
-
*/
|
|
198
|
-
function trimEnd(text, start, end) {
|
|
199
|
-
let at = Math.min(end, text.length);
|
|
200
|
-
while (at > start && /\s/.test(text[at - 1]))
|
|
201
|
-
at--;
|
|
202
|
-
return at;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* The offset of the `-` that opens this list item, or the item's own start.
|
|
206
|
-
*
|
|
207
|
-
* A sequence item's range begins at its first key, so the `- ` marker sits outside it. Walks back
|
|
208
|
-
* over spaces only — if anything else is there, this is not a block sequence item and the original
|
|
209
|
-
* offset is right.
|
|
210
|
-
*/
|
|
211
|
-
function markerStart(text, itemStart) {
|
|
212
|
-
let at = itemStart - 1;
|
|
213
|
-
while (at >= 0 && (text[at] === ' ' || text[at] === '\t'))
|
|
214
|
-
at--;
|
|
215
|
-
return at >= 0 && text[at] === '-' ? at : itemStart;
|
|
216
|
-
}
|
|
217
|
-
/** The key `findStepRanges` maps by — a stage and a step key, which is how a flow node identifies itself. */
|
|
218
|
-
export const stepRangeKey = (stage, stepKey) => `${stage}\u0000${stepKey}`;
|
|
219
|
-
/**
|
|
220
|
-
* EVERY step's range inside ONE component, from ONE parse (Story 4.5, AC-4b).
|
|
221
|
-
*
|
|
222
|
-
* The producer AC-4b was waiting for. `workerFlow` takes a `locate` callback and carries whatever it returns; until now
|
|
223
|
-
* nothing could answer it, because the machinery above stops at the component and a flow node is a step *inside* one.
|
|
224
|
-
* Story 4.1 predicted this as "new plumbing, not a port", and it is.
|
|
225
|
-
*
|
|
226
|
-
* ### Why it lives here rather than in the extension
|
|
227
|
-
*
|
|
228
|
-
* AD-3 and NFR-4 forbid a CORE package from opening a file, and this opens none: like `findComponentRange` above, it is
|
|
229
|
-
* given the text — the extension reads it from the graph's own prefetched `sources`. What the rule forbids is the
|
|
230
|
-
* READING, which stays in the adapter. Parsing here reuses the `markerStart` widening and the `trimEnd` correction,
|
|
231
|
-
* each of which was found by a failing test, and spares the extension a `yaml` dependency it does not have today — one
|
|
232
|
-
* that would land in the web bundle the AD-3 gate exists to keep small.
|
|
233
|
-
*
|
|
234
|
-
* ### Stage-agnostic, deliberately
|
|
235
|
-
*
|
|
236
|
-
* It does not know what a stage is called. Every sequence-valued property of the component is walked and every item
|
|
237
|
-
* carrying a `key` scalar recorded under it. `WORKER_STAGES` lives in the flow package, one layer UP, so importing the
|
|
238
|
-
* list would invert the dependency — and a hardcoded copy would go stale the next time a stage is added, a drift this
|
|
239
|
-
* feature has already had to fix once. Properties that merely happen to hold keyed items cost nothing: the map is
|
|
240
|
-
* queried by a stage name the flow model already believes in, so an entry nobody asks for is never read.
|
|
241
|
-
*
|
|
242
|
-
* ONE level deep, which is what keeps that generality safe — a step's own nested arrays (`responseFilters`,
|
|
243
|
-
* `transformations`) sit INSIDE the step item, not beside it, so their keys can never be mistaken for a step's.
|
|
244
|
-
*/
|
|
245
|
-
export function findStepRanges(text, collection, id) {
|
|
246
|
-
const found = new Map();
|
|
247
|
-
let doc;
|
|
248
|
-
try {
|
|
249
|
-
doc = parseDocument(text, { keepSourceTokens: true });
|
|
250
|
-
}
|
|
251
|
-
catch {
|
|
252
|
-
return found;
|
|
253
|
-
}
|
|
254
|
-
// The same guard as both functions above, for the same reason: a file mid-keystroke yields ranges that can point
|
|
255
|
-
// anywhere, and a node claiming a confidently wrong location is worse than one honestly claiming none.
|
|
256
|
-
if (!doc || doc.errors.length > 0 || !isMap(doc.contents))
|
|
257
|
-
return found;
|
|
258
|
-
const collectionNode = doc.contents.get(collection, true);
|
|
259
|
-
if (!collectionNode)
|
|
260
|
-
return found;
|
|
261
|
-
const component = componentNode(collectionNode, id);
|
|
262
|
-
if (!component)
|
|
263
|
-
return found;
|
|
264
|
-
for (const property of component.items) {
|
|
265
|
-
if (!isScalar(property.key))
|
|
266
|
-
continue;
|
|
267
|
-
const stage = String(property.key.value);
|
|
268
|
-
const steps = property.value;
|
|
269
|
-
if (!steps || !isSeq(steps))
|
|
270
|
-
continue;
|
|
271
|
-
for (const item of steps.items) {
|
|
272
|
-
if (!isMap(item))
|
|
273
|
-
continue;
|
|
274
|
-
const key = item.get('key');
|
|
275
|
-
// A step without a scalar key is not addressable, and `workerFlow` drops it too — so a range for it could never
|
|
276
|
-
// be asked for. Coerced through `String` because YAML reads a bare `2` as a number, as the flow model also does.
|
|
277
|
-
if (key === undefined || key === null || typeof key === 'object')
|
|
278
|
-
continue;
|
|
279
|
-
const offsets = rangeOf(item);
|
|
280
|
-
if (!offsets)
|
|
281
|
-
continue;
|
|
282
|
-
const start = markerStart(text, offsets[0]);
|
|
283
|
-
// LAST wins, matching every other function in this file and for the same reason: an earlier declaration of the
|
|
284
|
-
// same key was overridden, so pointing at it would point at text with no effect.
|
|
285
|
-
found.set(stepRangeKey(stage, String(key)), {
|
|
286
|
-
range: toRange(text, [start, offsets[1]]),
|
|
287
|
-
// `trimEnd` for the TEXT as well as the range, or a block step's slice carries the blank line that follows it.
|
|
288
|
-
sourceText: text.slice(start, trimEnd(text, start, offsets[1])),
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
return found;
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* The map node for one component of a collection, in either of the two shapes.
|
|
296
|
-
*
|
|
297
|
-
* Split out rather than folded into the loop above: `collectRanges` answers "where is each component", this answers
|
|
298
|
-
* "which node IS this component" — the same two shapes, a different question. LAST declaration wins here as well.
|
|
299
|
-
*/
|
|
300
|
-
function componentNode(collectionNode, id) {
|
|
301
|
-
let found;
|
|
302
|
-
if (isSeq(collectionNode)) {
|
|
303
|
-
for (const item of collectionNode.items) {
|
|
304
|
-
if (!isMap(item))
|
|
305
|
-
continue;
|
|
306
|
-
const identity = normalizeComponentKey(item.get('id') ?? item.get('key'));
|
|
307
|
-
if (!identity || identity.removes || identity.id !== id)
|
|
308
|
-
continue;
|
|
309
|
-
found = item;
|
|
310
|
-
}
|
|
311
|
-
return found;
|
|
312
|
-
}
|
|
313
|
-
if (isMap(collectionNode)) {
|
|
314
|
-
for (const pair of collectionNode.items) {
|
|
315
|
-
if (!isScalar(pair.key) || String(pair.key.value) !== id)
|
|
316
|
-
continue;
|
|
317
|
-
found = isMap(pair.value) ? pair.value : undefined;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return found;
|
|
321
|
-
}
|
|
322
|
-
//# sourceMappingURL=ranges.js.map
|
package/dist/ranges.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ranges.js","sourceRoot":"","sources":["../src/ranges.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,EACL,KAAK,GAGN,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAM3E,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,MAAc,EAAE,EAAE;IAClD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACrB,IAAI,EAAE,CAAC;YACP,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;AAC9C,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,IAAa,EAAgC,EAAE;IAC9D,MAAM,KAAK,GAAI,IAA6C,EAAE,KAAK,CAAC;IACpE,OAAO,KAAK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,IAAI,QAAQ,CAAC,EAAE,KAAK,EAAE;gBAAE,SAAS;YAClE,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;QAC1B,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,KAAK,EAAE,CAAC;YACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE;gBAAE,SAAS;YACnE,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACrD,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/resolveField.d.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Point-wise value resolution — one field, on demand (FR-45, Story 3.3).
|
|
3
|
-
*
|
|
4
|
-
* Explaining a single field must not cost a whole-project substitution pass. A hover over one
|
|
5
|
-
* `url:` should not resolve 273 components, and a project that takes 650 ms to compose cannot
|
|
6
|
-
* afford to do it per cursor movement.
|
|
7
|
-
*
|
|
8
|
-
* It REUSES the composer's `resolveVariablePool` / `substituteVariables` rather than
|
|
9
|
-
* reimplementing them. Two answers to "what does this variable resolve to" is one answer too
|
|
10
|
-
* many: the editor explaining a field and the composer producing output have to agree, and the
|
|
11
|
-
* only way to guarantee that is one implementation. In particular the longest-key-first rule —
|
|
12
|
-
* without which `**Id**` corrupts `**ProductId**` — is the composer's, not a copy of it.
|
|
13
|
-
*/
|
|
14
|
-
import { type TemplateOccurrence } from '@beehexa/hexasync-template-model';
|
|
15
|
-
import { resolveVariablePool } from '@beehexa/hexasync-template-compose';
|
|
16
|
-
export interface ResolvedField {
|
|
17
|
-
/** The value with every resolvable compose-time token substituted. */
|
|
18
|
-
readonly value: string;
|
|
19
|
-
/** True when nothing needed substituting. */
|
|
20
|
-
readonly literal: boolean;
|
|
21
|
-
/** Compose-time tokens that contributed, with what each resolved to. */
|
|
22
|
-
readonly contributed: readonly {
|
|
23
|
-
key: string;
|
|
24
|
-
value: string;
|
|
25
|
-
}[];
|
|
26
|
-
/**
|
|
27
|
-
* Compose-time tokens with no definition in the pool.
|
|
28
|
-
*
|
|
29
|
-
* Reported, never silently left in the string: returning the raw text as though it were the
|
|
30
|
-
* value is how a `**Missing**` reaches production looking like a deliberate literal.
|
|
31
|
-
*/
|
|
32
|
-
readonly unresolved: readonly string[];
|
|
33
|
-
/**
|
|
34
|
-
* Runtime occurrences, untouched.
|
|
35
|
-
*
|
|
36
|
-
* Carried so a caller can SHOW them without ever trying to resolve them — the composer never
|
|
37
|
-
* owned `{{ … }}`, and reporting it as unresolved would be reporting on the wrong layer.
|
|
38
|
-
*/
|
|
39
|
-
readonly runtime: readonly TemplateOccurrence[];
|
|
40
|
-
}
|
|
41
|
-
/** A pool prepared once and reused across fields. */
|
|
42
|
-
export type PreparedPool = ReturnType<typeof resolveVariablePool>;
|
|
43
|
-
export declare function preparePool(variables: Record<string, unknown>): PreparedPool;
|
|
44
|
-
/**
|
|
45
|
-
* Resolve one field's value against a project's pool.
|
|
46
|
-
*
|
|
47
|
-
* `pool` is prepared by the caller so a burst of fields shares one preparation — the transitive
|
|
48
|
-
* pass over the pool is O(keys²) and doing it per field would dominate everything else.
|
|
49
|
-
*/
|
|
50
|
-
export declare function resolveFieldValue(raw: unknown, pool: PreparedPool, variables: Record<string, unknown>): ResolvedField;
|
|
51
|
-
/**
|
|
52
|
-
* A resolver bound to one project's pool, with a cache.
|
|
53
|
-
*
|
|
54
|
-
* Keyed by PROJECT and pool GENERATION, not by identity: the same field asked twice while
|
|
55
|
-
* nothing changed must not repeat the work, and the cache must vanish the moment
|
|
56
|
-
* `variables.yaml` moves — which is what Story 3.6's invalidation drops.
|
|
57
|
-
*/
|
|
58
|
-
export declare class FieldResolver {
|
|
59
|
-
#private;
|
|
60
|
-
private readonly variables;
|
|
61
|
-
/** Bumped by the owner whenever the pool changes; part of every cache key. */
|
|
62
|
-
readonly generation: number;
|
|
63
|
-
/**
|
|
64
|
-
* The project this resolver belongs to, also part of the key (Story 3.3 AC 3).
|
|
65
|
-
*
|
|
66
|
-
* Two projects genuinely can share a generation number — nothing in the type system stops a
|
|
67
|
-
* caller numbering its own — and `**BaseUrl**` resolves to a different host in each. That the
|
|
68
|
-
* current owner happens to hand out a service-global counter makes the collision unreachable
|
|
69
|
-
* today by accident, not by design, and an accident is not a cache key.
|
|
70
|
-
*/
|
|
71
|
-
readonly projectId: string;
|
|
72
|
-
/**
|
|
73
|
-
* Upper bound on the SHARED store, as a backstop against unbounded growth.
|
|
74
|
-
*
|
|
75
|
-
* Generous, because evicting a live project's entries costs a recompute rather than
|
|
76
|
-
* correctness, and the entries are small. The precise rule is `#evictSuperseded`'s
|
|
77
|
-
* generation check; this only catches what that cannot see.
|
|
78
|
-
*/
|
|
79
|
-
readonly maxEntries: number;
|
|
80
|
-
constructor(variables: Record<string, unknown>,
|
|
81
|
-
/** Bumped by the owner whenever the pool changes; part of every cache key. */
|
|
82
|
-
generation: number,
|
|
83
|
-
/**
|
|
84
|
-
* The project this resolver belongs to, also part of the key (Story 3.3 AC 3).
|
|
85
|
-
*
|
|
86
|
-
* Two projects genuinely can share a generation number — nothing in the type system stops a
|
|
87
|
-
* caller numbering its own — and `**BaseUrl**` resolves to a different host in each. That the
|
|
88
|
-
* current owner happens to hand out a service-global counter makes the collision unreachable
|
|
89
|
-
* today by accident, not by design, and an accident is not a cache key.
|
|
90
|
-
*/
|
|
91
|
-
projectId?: string,
|
|
92
|
-
/**
|
|
93
|
-
* A cache store, optionally SHARED with other resolvers.
|
|
94
|
-
*
|
|
95
|
-
* The default is private to this resolver, and with a private store the composite key below
|
|
96
|
-
* is decorative — the instance already implies its project and generation. That was the state
|
|
97
|
-
* this class shipped in, and a test asserting the key "worked" passed with the key reduced to
|
|
98
|
-
* the raw value, which is no assertion at all.
|
|
99
|
-
*
|
|
100
|
-
* A shared store is what makes the key load-bearing, and is what Story 3.3 AC 3 describes
|
|
101
|
-
* when it asks for a cache "keyed by project and pool generation": one store, many projects,
|
|
102
|
-
* entries that must not be served across them.
|
|
103
|
-
*/
|
|
104
|
-
store?: Map<string, ResolvedField>,
|
|
105
|
-
/**
|
|
106
|
-
* Upper bound on the SHARED store, as a backstop against unbounded growth.
|
|
107
|
-
*
|
|
108
|
-
* Generous, because evicting a live project's entries costs a recompute rather than
|
|
109
|
-
* correctness, and the entries are small. The precise rule is `#evictSuperseded`'s
|
|
110
|
-
* generation check; this only catches what that cannot see.
|
|
111
|
-
*/
|
|
112
|
-
maxEntries?: number);
|
|
113
|
-
resolve(raw: unknown): ResolvedField;
|
|
114
|
-
/**
|
|
115
|
-
* Forget everything this resolver cached.
|
|
116
|
-
*
|
|
117
|
-
* The invalidation hook Story 3.6 AC 2's second clause describes and nothing provided. Scoped to
|
|
118
|
-
* this project, so a shared store goes on serving the others.
|
|
119
|
-
*/
|
|
120
|
-
invalidate(): void;
|
|
121
|
-
/** How many distinct values are cached — exposed so caching is testable. Counts the whole
|
|
122
|
-
* store, which may be shared with other projects' resolvers. */
|
|
123
|
-
get cacheSize(): number;
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=resolveField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveField.d.ts","sourceRoot":"","sources":["../src/resolveField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mBAAmB,EAEpB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,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