@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.
Files changed (57) hide show
  1. package/package.json +4 -4
  2. package/dist/checkpoints.d.ts +0 -47
  3. package/dist/checkpoints.d.ts.map +0 -1
  4. package/dist/checkpoints.js +0 -59
  5. package/dist/checkpoints.js.map +0 -1
  6. package/dist/cursorContext.d.ts +0 -204
  7. package/dist/cursorContext.d.ts.map +0 -1
  8. package/dist/cursorContext.js +0 -479
  9. package/dist/cursorContext.js.map +0 -1
  10. package/dist/detectors.d.ts +0 -103
  11. package/dist/detectors.d.ts.map +0 -1
  12. package/dist/detectors.js +0 -104
  13. package/dist/detectors.js.map +0 -1
  14. package/dist/discovery.d.ts +0 -249
  15. package/dist/discovery.d.ts.map +0 -1
  16. package/dist/discovery.js +0 -455
  17. package/dist/discovery.js.map +0 -1
  18. package/dist/effectiveGraph.d.ts +0 -240
  19. package/dist/effectiveGraph.d.ts.map +0 -1
  20. package/dist/effectiveGraph.js +0 -523
  21. package/dist/effectiveGraph.js.map +0 -1
  22. package/dist/failures.d.ts +0 -50
  23. package/dist/failures.d.ts.map +0 -1
  24. package/dist/failures.js +0 -125
  25. package/dist/failures.js.map +0 -1
  26. package/dist/graph.d.ts +0 -47
  27. package/dist/graph.d.ts.map +0 -1
  28. package/dist/graph.js +0 -230
  29. package/dist/graph.js.map +0 -1
  30. package/dist/index.d.ts +0 -21
  31. package/dist/index.d.ts.map +0 -1
  32. package/dist/index.js +0 -38
  33. package/dist/index.js.map +0 -1
  34. package/dist/queries.d.ts +0 -102
  35. package/dist/queries.d.ts.map +0 -1
  36. package/dist/queries.js +0 -469
  37. package/dist/queries.js.map +0 -1
  38. package/dist/ranges.d.ts +0 -71
  39. package/dist/ranges.d.ts.map +0 -1
  40. package/dist/ranges.js +0 -322
  41. package/dist/ranges.js.map +0 -1
  42. package/dist/resolveField.d.ts +0 -125
  43. package/dist/resolveField.d.ts.map +0 -1
  44. package/dist/resolveField.js +0 -234
  45. package/dist/resolveField.js.map +0 -1
  46. package/dist/tier1Service.d.ts +0 -96
  47. package/dist/tier1Service.d.ts.map +0 -1
  48. package/dist/tier1Service.js +0 -194
  49. package/dist/tier1Service.js.map +0 -1
  50. package/dist/tier2Service.d.ts +0 -195
  51. package/dist/tier2Service.d.ts.map +0 -1
  52. package/dist/tier2Service.js +0 -642
  53. package/dist/tier2Service.js.map +0 -1
  54. package/dist/yamlScalar.d.ts +0 -17
  55. package/dist/yamlScalar.d.ts.map +0 -1
  56. package/dist/yamlScalar.js +0 -101
  57. package/dist/yamlScalar.js.map +0 -1
@@ -1,240 +0,0 @@
1
- import type { TemplateReader } from '@beehexa/hexasync-template-ports';
2
- import { type ComposeSources, type ProjectVariableSet, type ResolverIO, type WorklistItem, type LibraryVariableSet, type VariableProvenance, type OverwriteRecord } from '@beehexa/hexasync-template-compose';
3
- /**
4
- * Collections whose entries are components.
5
- *
6
- * Re-exported from the composer rather than re-declared. The two lists were byte-identical, and
7
- * two answers to "which top-level keys are directives rather than components" is one too many:
8
- * the day a new directive is added to the merge engine, an independent copy here would start
9
- * reporting it as authored data in every query and search.
10
- */
11
- export { DIRECTIVE_KEYS } from '@beehexa/hexasync-template-compose';
12
- /** Where a component came from, which is what makes an inherited one navigable. */
13
- export interface ComponentProvenance {
14
- /** The project that DECLARED it — the library or ancestor, not the inheritor. */
15
- readonly project: string;
16
- /** 0 = this project's own; higher = further up the inheritance chain. */
17
- readonly generation: number;
18
- /** The file it truly lives in. */
19
- readonly sourceFile: string;
20
- /**
21
- * True when this component overrode an INHERITED one — a definition at a higher generation.
22
- *
23
- * Computed from generations, not from a count. It was `seen > 1`, which is a different statement:
24
- * a component declared twice inside one project, with no inheritance anywhere, reported
25
- * `overrides: true`. The covering test used a genuine inheritance case, so it passed under either
26
- * meaning and could not tell them apart.
27
- */
28
- readonly overrides: boolean;
29
- /**
30
- * True when the identity was defined more than once anywhere in the worklist.
31
- *
32
- * The old meaning of `overrides`, kept because it is independently useful — Phase 2's
33
- * wholesale-overwrite rule is about redefinition regardless of generation — and separated because
34
- * conflating "someone else also declared this" with "I overrode my ancestor" makes both unusable.
35
- */
36
- readonly redefined: boolean;
37
- }
38
- export interface EffectiveComponent {
39
- /** Collection it belongs to — `objects`, `pullers`, `pushers`, … */
40
- readonly collection: string;
41
- /** Token-form id or key. Substitution-independent by design. */
42
- readonly id: string;
43
- /** The component's value, token form. */
44
- readonly value: unknown;
45
- readonly provenance: ComponentProvenance;
46
- }
47
- export interface EffectiveGraph {
48
- readonly projectId: string;
49
- /** The project's `partials` folder — the merge base's directory. */
50
- readonly componentPath: string;
51
- /** What this project's own files declare, before inheritance. */
52
- readonly authored: readonly EffectiveComponent[];
53
- /** What the project actually contains, after inheritance and precedence. */
54
- readonly effective: readonly EffectiveComponent[];
55
- /**
56
- * The composed document itself, in TOKEN form — before variable substitution.
57
- *
58
- * Retained rather than discarded because the validation rules read the DOCUMENT, not a component
59
- * list: `referenceRule` and its siblings walk `ctx.tokenForm`. Re-deriving a document by grouping
60
- * `effective` back into collections would be a second implementation of "what did compose produce",
61
- * and this epic has already paid for that mistake twice — the editor and the CLI would then disagree
62
- * about validity, which is precisely what NFR-2 and counter-metric C3 forbid.
63
- *
64
- * Costs nothing: it is the same object the components were collected from, not a copy. Frozen with
65
- * the rest of the snapshot, so a rule cannot mutate what a later rule reads.
66
- */
67
- readonly mergedValue: unknown;
68
- /** The assembled variable pool, for point-wise resolution (Story 3.3). */
69
- readonly variables: Record<string, unknown>;
70
- /**
71
- * Where each variable's winning value came from, and what it shadows (Story 2.6, FR-78).
72
- *
73
- * Carried on the graph rather than derived by a consumer, because it comes from the same pass that builds
74
- * `variables` — see `assembleVariablesWithProvenance`. A consumer computing it separately would be a
75
- * second answer to "which set wins".
76
- */
77
- readonly variableProvenance: Record<string, VariableProvenance>;
78
- readonly variableSets: readonly ProjectVariableSet[];
79
- /**
80
- * `variables.yaml` files DISCOVERED by the component glob but never admitted to the pool.
81
- *
82
- * Only the resolver knows this: by the time anything sees the composed output, an unadmitted file
83
- * is indistinguishable from one that defined nothing. Carried here because VAR-3 and VAR-4 report
84
- * on it, and a graph that dropped it made the editor silently find FEWER issues than the CLI on the
85
- * same project — which counter-metric C3 forbids, and which the parity test caught.
86
- */
87
- readonly unadmittedVariableFiles: readonly string[];
88
- /**
89
- * The variable declarations of every component library this project borrows a file from (Story 1.8).
90
- *
91
- * Only the resolver can know them: they are located from the worklist, which is the only record
92
- * that this project reads a file from somewhere else. Carried here for the same reason
93
- * `unadmittedVariableFiles` is — a rule reports on them, and a graph that dropped them would make
94
- * the editor find fewer issues than the CLI, which C3 forbids.
95
- */
96
- readonly libraryVariableSets: readonly LibraryVariableSet[];
97
- /**
98
- * Wholesale array overwrites that DROPPED inherited components (Story 1.9).
99
- *
100
- * The one inheritance loss that leaves nothing to point at: an override array whose items carry no
101
- * `id`, so the merge cannot match element-by-element and replaces the whole array. The dropped
102
- * components are simply absent from the merged document — no `!` removal, no duplicate, nothing a
103
- * rule reading the document could notice. Collected here through the merge's `onOverwrite` hook,
104
- * from the same records the CLI's merge-integrity report has always used.
105
- */
106
- readonly overwrites: readonly OverwriteRecord[];
107
- /** The worklist that produced it, in merge order — Story 3.5 re-merges from a prefix. */
108
- readonly worklist: readonly WorklistItem[];
109
- /** Prefetched file text, so a re-merge costs no IO. */
110
- readonly sources: ComposeSources;
111
- /**
112
- * The document version of every file this was built from (AD-7a).
113
- *
114
- * A consumer validating text at version N can tell whether the graph it holds was built from
115
- * that text or from something older. Without it, a stale answer is indistinguishable from a
116
- * fresh one — which is exactly the confusion AD-7a exists to prevent.
117
- */
118
- readonly watermark: ReadonlyMap<string, number>;
119
- /**
120
- * Retained prefix checkpoints, ascending (Story 3.5). Empty when capture was not asked for.
121
- *
122
- * Kept ON the graph rather than beside it so they are evicted with it: a checkpoint outliving
123
- * the graph it belongs to is a checkpoint that can be resumed onto a worklist that has moved.
124
- */
125
- readonly checkpoints: readonly GraphCheckpoint[];
126
- /**
127
- * The worklist index the fold started at, when this graph was resumed from a checkpoint.
128
- *
129
- * Absent on a full build. Present so the saving is REPORTABLE — NFR-6a asks for a measured
130
- * figure, and "it was fast" is not a measurement of how much work was skipped.
131
- */
132
- readonly resumedFrom?: number;
133
- }
134
- /** The merge state after one worklist position, enough to resume from (Story 3.5). */
135
- export interface GraphCheckpoint {
136
- /** The last worklist index folded into `merged`. */
137
- readonly index: number;
138
- /** A deep COPY of the accumulated document — the live one goes on being mutated. */
139
- readonly merged: unknown;
140
- /** How much of `authored` had been collected by this point. */
141
- readonly authoredCount: number;
142
- /** Winning-definition provenance as it stood, so a resume need not rewalk the prefix. */
143
- readonly winningSource: ReadonlyMap<string, WinningSource>;
144
- /**
145
- * Wholesale losses observed in the PREFIX (Story 1.9).
146
- *
147
- * Retained because a resume re-merges only the suffix and therefore only re-observes the suffix's
148
- * losses. Carrying the previous graph's full set forward instead would keep reporting a loss the
149
- * developer has just fixed — the finding would survive its own cause, which is what makes a
150
- * diagnostic untrustworthy. Prefix + freshly-observed suffix is the whole set and nothing else.
151
- */
152
- readonly overwrites: readonly OverwriteRecord[];
153
- }
154
- /** Where an identity's winning definition came from, and how many times it was defined. */
155
- type WinningSource = Omit<ComponentProvenance, 'overrides' | 'redefined'> & {
156
- seen: number;
157
- /**
158
- * The HIGHEST generation any definition of this identity came from.
159
- *
160
- * Kept so `overrides` can mean what it says. The merge folds ancestors first and the project's own
161
- * files last, so the winner has the lowest generation; a winner whose generation is below this
162
- * maximum is one that beat an inherited definition.
163
- */
164
- maxGeneration: number;
165
- };
166
- /** How the host reports the version of an open document. Absent means "as on disk". */
167
- export type DocumentVersionLookup = (uri: string) => number | undefined;
168
- export interface BuildEffectiveGraphOptions {
169
- readonly io: ResolverIO;
170
- readonly reader: TemplateReader;
171
- readonly documentVersion?: DocumentVersionLookup;
172
- /**
173
- * Retain prefix checkpoints so later edits re-merge incrementally (Story 3.5).
174
- *
175
- * Off by default, and deliberately so: capture costs one deep copy per retained position and
176
- * holds them for the life of the graph. A caller that composes once — the CLI — should pay
177
- * neither. The editor turns it on for the project being worked in.
178
- */
179
- readonly checkpoints?: boolean | {
180
- readonly max?: number;
181
- };
182
- /**
183
- * Text the HOST holds that the disk does not — unsaved editor buffers.
184
- *
185
- * Without this a rebuild reads through `io`/`reader` and therefore reads the file as SAVED,
186
- * so an edit to an unsaved `variables.yaml` republishes the old pool under a fresh version and
187
- * an up-to-date watermark: precisely the false freshness AD-7a exists to prevent. The cursor
188
- * already resolves against the editor's text (Story 3.7); the build must not disagree with it.
189
- */
190
- readonly overlay?: ReadonlyMap<string, string>;
191
- }
192
- /**
193
- * Serve the host's text for any file it has newer than disk, and fall through for the rest.
194
- *
195
- * Exported (Story 2.2 of the extension's Phase 4) because an editor-initiated compose needs exactly
196
- * this and a second copy would be free to disagree about the one clause that is easy to get wrong:
197
- * `exists` must be true for a file the overlay holds, or an unsaved file reads as absent.
198
- */
199
- export declare function overlayReader(base: TemplateReader, texts: ReadonlyMap<string, string>): TemplateReader;
200
- /**
201
- * Build one project's effective graph.
202
- *
203
- * Goes through the composer rather than reimplementing merge, so the graph and the artefact
204
- * `compose` produces cannot drift — NFR-1's rule that the editor invents no semantics the
205
- * runtime lacks is only true if there is one implementation of them.
206
- */
207
- export declare function buildEffectiveGraph(projectId: string, componentPath: string, mainYml: string, options: BuildEffectiveGraphOptions): Promise<EffectiveGraph>;
208
- /**
209
- * Rebuild a graph after an edit, resuming from a retained prefix checkpoint (Story 3.5, FR-46).
210
- *
211
- * Returns `undefined` when the change cannot be applied incrementally, rather than guessing.
212
- * The caller then does a full build — which is always correct, so every case this declines is a
213
- * case that stays right rather than a case that breaks.
214
- *
215
- * `updates` carries the new text of each changed file. Nothing is read here: an incremental
216
- * re-merge that went back to the filesystem would be reading the very files the editor already
217
- * holds newer versions of.
218
- */
219
- export declare function resumeEffectiveGraph(graph: EffectiveGraph,
220
- /**
221
- * The checkpoints to resume from — passed in rather than read off the graph.
222
- *
223
- * They are the heaviest thing the build produces and the only part a holder may want to drop
224
- * independently of the graph itself (AD-10's last-good snapshot is worth keeping long after
225
- * its checkpoints are worth their memory). Making the holder name them is what lets the Tier 2
226
- * service bound them to the project being edited while every hot graph stays whole.
227
- */
228
- checkpoints: readonly GraphCheckpoint[], updates: ReadonlyMap<string, string>, options?: {
229
- readonly documentVersion?: DocumentVersionLookup;
230
- /**
231
- * The same budget the graph was BUILT with.
232
- *
233
- * Passed in rather than defaulted: a holder configured for four checkpoints that resumed
234
- * against eight would mix two schedules and quietly exceed its own bound.
235
- */
236
- readonly maxCheckpoints?: number;
237
- }): EffectiveGraph | undefined;
238
- /** The directory a project's files live under — used to scope watchers. */
239
- export declare const projectFolderOf: (componentPath: string) => string;
240
- //# sourceMappingURL=effectiveGraph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"effectiveGraph.d.ts","sourceRoot":"","sources":["../src/effectiveGraph.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACrB,MAAM,oCAAoC,CAAC;AAO5C;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,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