@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
package/dist/failures.js DELETED
@@ -1,125 +0,0 @@
1
- /**
2
- * Turning a thrown error into something a diagnostic publisher can use (Story 3.6, AD-9).
3
- *
4
- * A developer produces dozens of transient invalid states in an hour of typing, and every one of
5
- * them reaches the index as an exception. What a publisher needs from each is not a string: it
6
- * needs a CODE to branch on, the FILE and RANGE to underline, and the original error kept intact
7
- * so nothing is lost on the way. A message alone forces the consumer to parse English back into
8
- * structure, which is how "Error at file /a/b.yaml: ..." becomes a squiggle in the wrong place.
9
- *
10
- * Phase 2 Story 2.1 publishes these. Nothing here publishes anything — this only makes the
11
- * failure describable.
12
- */
13
- /** `Error at file <path>: <message>` — the shape the merge engine wraps parse errors in. */
14
- const AT_FILE_RE = /^Error at file (.+?): /;
15
- /** `Could not read partial: <path>` — a worklist entry with no prefetched text. */
16
- const UNREADABLE_RE = /^Could not read partial: (.+)$/;
17
- /**
18
- * The composer's ACTUAL worklist-stage failures, anchored to how it phrases them.
19
- *
20
- * Enumerated from the `throw` sites in `template-compose` rather than guessed from keywords:
21
- *
22
- * projectResolver `inheritance cycle detected:\n …`
23
- * merge/searchMain `There is no main.yaml file in the project.` ← a missing `type: project` target
24
- * merge/searchMain `Looks like there are more than one mail.yaml file in the project.`
25
- * merge/searchMain `Could not read main.yaml at …`
26
- * merge `!md include not found: "…" (resolved to …) referenced in …`
27
- *
28
- * Anchored at the start so a user's own file path cannot flip the classification, and listed so the
29
- * next person edits this alongside the message rather than discovering the drift from a diagnostic
30
- * that never fired. `Could not read partial:` keeps its own branch above because it carries a path.
31
- */
32
- const RESOLVE_FAILURE_RE = /^(inheritance cycle detected|There is no main\.yaml file in the project|Looks like there are more than one mail\.yaml file|Could not read main\.yaml at |!md include not found)/;
33
- /**
34
- * A YAML parse error's position, when the thrown thing is one.
35
- *
36
- * Duck-typed rather than `instanceof YAMLParseError`: the error crosses a package boundary and
37
- * may have been constructed by a different copy of the `yaml` module, which `instanceof` would
38
- * quietly answer `false` for — leaving every parse error rangeless for a reason no one could see.
39
- */
40
- function rangeOf(error) {
41
- const linePos = error?.linePos;
42
- if (!Array.isArray(linePos) || linePos.length === 0)
43
- return undefined;
44
- const at = (i) => {
45
- const p = linePos[i];
46
- if (!p || typeof p.line !== 'number' || typeof p.col !== 'number') {
47
- return undefined;
48
- }
49
- // `yaml` counts from 1; editors count from 0.
50
- return { line: p.line - 1, column: p.col - 1 };
51
- };
52
- const start = at(0);
53
- if (!start)
54
- return undefined;
55
- return { start, end: at(1) ?? start };
56
- }
57
- /** Walk `cause` links until something carries a position, or the chain ends. */
58
- function firstRangeInChain(error, depth = 0) {
59
- if (!error || depth > 8)
60
- return undefined;
61
- return (rangeOf(error) ??
62
- firstRangeInChain(error.cause, depth + 1));
63
- }
64
- /**
65
- * Describe a thrown error as a structured failure. Never throws and never returns undefined:
66
- * a failure that cannot be described is still a failure, and swallowing it is what AC 3 forbids.
67
- */
68
- export function describeFailure(error, fallbackFile) {
69
- // `String(error)` can itself throw — a null-prototype object, or one whose `toString` throws —
70
- // and this function's contract is that it never does. An unprintable error is still a failure.
71
- let message;
72
- try {
73
- message = error instanceof Error ? error.message : String(error);
74
- }
75
- catch {
76
- message = 'An error that cannot be converted to text was thrown.';
77
- }
78
- const atFile = AT_FILE_RE.exec(message);
79
- if (atFile) {
80
- return {
81
- code: 'parse-failed',
82
- message,
83
- sourceFile: atFile[1],
84
- range: firstRangeInChain(error),
85
- cause: error,
86
- };
87
- }
88
- const unreadable = UNREADABLE_RE.exec(message);
89
- if (unreadable) {
90
- return {
91
- code: 'resolve-failed',
92
- message,
93
- sourceFile: unreadable[1],
94
- cause: error,
95
- };
96
- }
97
- // The worklist itself is wrong: a missing inheritance target, a cycle, an unresolvable external,
98
- // an `!md` include that is not there.
99
- //
100
- // Matched on the composer's ACTUAL messages, anchored, rather than on a free-text substring
101
- // search. The old `/not found|cycle|external/i` ran over arbitrary text and got it wrong in both
102
- // directions: `Cannot read properties of undefined (reading 'externals')` — a programmer error —
103
- // was classified `resolve-failed`, while the headline inheritance failure was NOT, because the
104
- // composer says "There is no main.yaml file in the project." and that matches none of the three
105
- // words. A publisher branching on `resolve-failed` for a missing `type: project` target therefore
106
- // never saw it, which is the case Story 3.6 AC 3 names explicitly. A user's own file path
107
- // containing "external" or "cycle" could also flip the code.
108
- if (RESOLVE_FAILURE_RE.test(message)) {
109
- return {
110
- code: 'resolve-failed',
111
- message,
112
- sourceFile: fallbackFile,
113
- range: firstRangeInChain(error),
114
- cause: error,
115
- };
116
- }
117
- return {
118
- code: 'compose-failed',
119
- message,
120
- sourceFile: fallbackFile,
121
- range: firstRangeInChain(error),
122
- cause: error,
123
- };
124
- }
125
- //# sourceMappingURL=failures.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failures.js","sourceRoot":"","sources":["../src/failures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsCH,4FAA4F;AAC5F,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,mFAAmF;AACnF,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAEvD;;;;;;;;;;;;;;GAcG;AACH,MAAM,kBAAkB,GACtB,iLAAiL,CAAC;AAEpL;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,KAAc;IAC7B,MAAM,OAAO,GAAI,KAA+B,EAAE,OAAO,CAAC;IAC1D,IAAI,CAAC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ritance edge could not be resolved to a project. */
3
- export type UnresolvedCause = 'no-main-yaml' | 'multiple-main-yaml';
4
- /** One inheritance relationship declared by a project's `main.yaml`. */
5
- export interface InheritanceEdge {
6
- /** Project id (normalized componentPath) that declared the external. */
7
- readonly from: string;
8
- /** `type: project` inherits a whole project; `type: local` pulls in one file. */
9
- readonly kind: 'project' | 'local';
10
- /** The declared `path`, verbatim, for reporting. */
11
- readonly declaredPath: string;
12
- /** Resolved absolute URI of the target — a project folder, or a single file for `local`. */
13
- readonly targetUri: string;
14
- /** Resolved project id when the target IS a known project; absent otherwise. */
15
- readonly to?: string;
16
- /** Set when the edge could not be tied to a project, with the reason. */
17
- readonly unresolved?: UnresolvedCause;
18
- }
19
- export interface ProjectGraph {
20
- readonly projects: readonly DiscoveredProject[];
21
- readonly edges: readonly InheritanceEdge[];
22
- /** Project ids that participate in an inheritance cycle. Recorded, never thrown. */
23
- readonly cycles: readonly (readonly string[])[];
24
- }
25
- /**
26
- * Build the graph from already-discovered projects.
27
- *
28
- * Pure: discovery did the reading, so this is a function of its input and cheap to re-run.
29
- */
30
- export declare function buildProjectGraph(projects: readonly DiscoveredProject[]): ProjectGraph;
31
- /**
32
- * The projects that inherit `fileUri`, directly or transitively (FR-42).
33
- *
34
- * This is the blast-radius query. A file is inherited when a project declares it as a
35
- * `type: local` external, or when it lives inside a project that another project inherits via
36
- * `type: project` — and inheritance is transitive, so an ancestor three levels up still counts.
37
- */
38
- export declare function getProjectsInheriting(graph: ProjectGraph, fileUri: string): string[];
39
- /** Direct inheritance edges declared BY a project. */
40
- export declare function getOutgoingEdges(graph: ProjectGraph, projectId: string): InheritanceEdge[];
41
- /** Direct inheritance edges pointing AT a project. */
42
- export declare function getIncomingEdges(graph: ProjectGraph, projectId: string): InheritanceEdge[];
43
- /** Edges that could not be tied to a project, for reporting a broken workspace honestly. */
44
- export declare function getUnresolvedEdges(graph: ProjectGraph): InheritanceEdge[];
45
- /** Convenience for callers holding a file path rather than a project id. */
46
- export declare function projectNameOf(graph: ProjectGraph, projectId: string): string;
47
- //# sourceMappingURL=graph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAiBA,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,kEAAkE;AAClE,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,oBAAoB,CAAC;AAEpE,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;IACnC,oDAAoD;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,4FAA4F;IAC5F,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAC3C,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC;CACjD;AAoBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GACrC,YAAY,CAuEd;AAwED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CA0CV;AAED,sDAAsD;AACtD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,GAChB,eAAe,EAAE,CAEnB;AAED,sDAAsD;AACtD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,GAChB,eAAe,EAAE,CAEnB;AAED,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,EAAE,CAEzE;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAK5E"}
package/dist/graph.js DELETED
@@ -1,230 +0,0 @@
1
- /**
2
- * The Tier 1 inheritance graph — who inherits what, in both directions (Story 2.2).
3
- *
4
- * This is the layer that answers "if I change this file, what breaks?" — a question the corpus
5
- * currently answers only by grepping and hoping. It is built from `main.yaml` alone, so it costs
6
- * nothing beyond discovery and is available before any effective graph exists.
7
- *
8
- * Nothing here throws on bad input. A workspace with one cyclic or one unresolvable project must
9
- * still index the other 112: a graph that refuses to build is worth less than a graph that tells
10
- * you which parts of it are broken.
11
- */
12
- import { parse } from 'yaml';
13
- import { basenameUri, normalizeUri, resolveUri, } from '@beehexa/hexasync-template-model';
14
- import { capabilitiesOf, projectForFile, } from './discovery.js';
15
- function parseExternals(mainYml) {
16
- try {
17
- const cnf = parse(mainYml, { keepSourceTokens: true }) || {};
18
- return Array.isArray(cnf.externals)
19
- ? cnf.externals
20
- : [];
21
- }
22
- catch {
23
- // A `main.yaml` that does not parse still identifies a project — discovery already found it.
24
- // It simply declares no edges until someone fixes it.
25
- return [];
26
- }
27
- }
28
- /**
29
- * Build the graph from already-discovered projects.
30
- *
31
- * Pure: discovery did the reading, so this is a function of its input and cheap to re-run.
32
- */
33
- export function buildProjectGraph(projects) {
34
- /**
35
- * Resolve a `type: project` target the way the COMPOSER resolves it.
36
- *
37
- * Corrected 2026-08-02 after the Epic 2 review. This originally keyed a map by project ROOT
38
- * (the parent of `partials`), which meant a target written as `.../connector/partials` — the
39
- * spelling 4 of the corpus's 5 real `type: project` externals use — matched nothing and was
40
- * recorded `no-main-yaml` while its `main.yaml` sat right there. Blast radius silently
41
- * returned EMPTY for three connector projects.
42
- *
43
- * The composer does `searchMain(resolveUri(componentPath, ext.path))`, which globs
44
- * `**​/main.yaml` UNDER the resolved folder and fails on zero or several. So a target matches
45
- * any project whose `main.yaml` lives at or beneath it — which resolves both spellings, and
46
- * makes the "multiple" case faithful too rather than a separate invention (NFR-1, NFR-3).
47
- */
48
- const candidatesFor = (targetUri) => projects.filter((p) =>
49
- // Only a kind that INHERITS can be the target of a `type: project` external.
50
- capabilitiesOf(p).inherits &&
51
- (p.componentPath === targetUri ||
52
- p.componentPath.startsWith(`${targetUri}/`)));
53
- const edges = [];
54
- for (const project of projects) {
55
- // Asked as a CAPABILITY, not as a kind check. A flat catalogue declares no inheritance, so
56
- // parsing its descriptor for `externals` would hunt a key that cannot exist and any edge
57
- // found would be fiction — but the rule is "does this kind inherit", which stays true when
58
- // a third kind appears.
59
- if (!capabilitiesOf(project).inherits)
60
- continue;
61
- for (const ext of parseExternals(project.descriptorText)) {
62
- if (!ext.path || (ext.type !== 'project' && ext.type !== 'local'))
63
- continue;
64
- const targetUri = normalizeUri(resolveUri(project.componentPath, ext.path));
65
- if (ext.type === 'local') {
66
- // A `type: local` external names a FILE, not a project. The edge still matters — it is
67
- // exactly how a shared component library is pulled in, and the reverse index over these
68
- // is what makes blast radius answerable.
69
- edges.push({
70
- from: project.id,
71
- kind: 'local',
72
- declaredPath: ext.path,
73
- targetUri,
74
- });
75
- continue;
76
- }
77
- const candidates = candidatesFor(targetUri);
78
- edges.push({
79
- from: project.id,
80
- kind: 'project',
81
- declaredPath: ext.path,
82
- targetUri,
83
- ...(candidates.length === 1
84
- ? { to: candidates[0].id }
85
- : {
86
- // Named separately because the fixes differ: a missing target is a wrong path,
87
- // an ambiguous one is a project that needs its duplicate `main.yaml` removed.
88
- unresolved: (candidates.length === 0
89
- ? 'no-main-yaml'
90
- : 'multiple-main-yaml'),
91
- }),
92
- });
93
- }
94
- }
95
- return { projects, edges, cycles: findCycles(projects, edges) };
96
- }
97
- /**
98
- * Every elementary project cycle, recorded so indexing can continue.
99
- *
100
- * Rewritten 2026-08-02 after the Epic 2 review brute-forced the previous version against ground
101
- * truth: 400 random graphs, **276 missed cycles**. The bug was a `visited` set marked at PUSH
102
- * time and shared across the whole search from one start node, which prunes alternate paths —
103
- * correct for reachability, wrong for cycle enumeration, where the whole point is that a node
104
- * may be reachable by several distinct routes.
105
- *
106
- * Pruning is now confined to the CURRENT PATH, which is what makes a walk enumerate elementary
107
- * cycles rather than merely visit nodes. Iterative, per AD-3's no-recursion rule.
108
- *
109
- * Bounded on purpose: cycle enumeration is exponential in the worst case, and this runs on
110
- * every index build. `MAX_CYCLE_STEPS` caps the work, and hitting it means some cycles go
111
- * unreported — never that a wrong one is reported, and never that indexing fails. A workspace
112
- * that pathological has a bigger problem than an incomplete cycle list.
113
- */
114
- const MAX_CYCLE_STEPS = 50_000;
115
- function findCycles(projects, edges) {
116
- // Adjacency once, rather than scanning every edge inside the walk.
117
- const out = new Map();
118
- for (const e of edges) {
119
- if (e.kind !== 'project' || !e.to)
120
- continue;
121
- const list = out.get(e.from);
122
- if (list)
123
- list.push(e.to);
124
- else
125
- out.set(e.from, [e.to]);
126
- }
127
- const cycles = new Map();
128
- let steps = 0;
129
- for (const project of projects) {
130
- const start = project.id;
131
- // Each frame carries its own path, so a node pruned on one route stays open on another.
132
- const stack = [
133
- { id: start, path: [start] },
134
- ];
135
- while (stack.length) {
136
- if (++steps > MAX_CYCLE_STEPS)
137
- return [...cycles.values()];
138
- const { id, path } = stack.pop();
139
- for (const next of out.get(id) ?? []) {
140
- if (next === start) {
141
- // Rotated to its lexicographically smallest member so one cycle is recorded once,
142
- // however many of its members we happen to start from.
143
- const lowest = path.indexOf([...path].sort()[0]);
144
- const rotated = [...path.slice(lowest), ...path.slice(0, lowest)];
145
- const key = rotated.join('>');
146
- if (!cycles.has(key))
147
- cycles.set(key, rotated);
148
- continue;
149
- }
150
- // Only skip nodes already ON THIS PATH — revisiting one would make the walk
151
- // non-elementary and could loop forever.
152
- if (path.includes(next))
153
- continue;
154
- // Starts smaller than `start` were already fully explored from their own start, so
155
- // skipping them halves the work without losing a cycle.
156
- if (next < start)
157
- continue;
158
- stack.push({ id: next, path: [...path, next] });
159
- }
160
- }
161
- }
162
- return [...cycles.values()];
163
- }
164
- /**
165
- * The projects that inherit `fileUri`, directly or transitively (FR-42).
166
- *
167
- * This is the blast-radius query. A file is inherited when a project declares it as a
168
- * `type: local` external, or when it lives inside a project that another project inherits via
169
- * `type: project` — and inheritance is transitive, so an ancestor three levels up still counts.
170
- */
171
- export function getProjectsInheriting(graph, fileUri) {
172
- const target = normalizeUri(fileUri);
173
- const found = new Set();
174
- // Seeds for the reverse walk. Both the file's owning project AND every project that pulls
175
- // the file in directly must be walked back from — a project that inherits a project that
176
- // declared the file inherits the file, transitively.
177
- const seeds = [];
178
- // Direct: someone declared this exact file as a `type: local` external.
179
- for (const e of graph.edges) {
180
- if (e.kind === 'local' && e.targetUri === target) {
181
- found.add(e.from);
182
- // Previously added to `found` but never enqueued, so anything inheriting THIS project
183
- // was missed. 1441 of the corpus's 1446 edges are `type: local`, so that was the
184
- // common path, not an edge case.
185
- seeds.push(e.from);
186
- }
187
- }
188
- // Indirect: the file belongs to a project, and projects inherit that project.
189
- //
190
- // NEAREST enclosing project, via the same helper file ownership uses. This used to be a
191
- // `.find()` over a list sorted by id, which returned the lexicographically FIRST enclosing
192
- // project — reporting the inheritors of an outer project while missing the inner one's.
193
- // Both a false positive and a false negative from one call.
194
- const owner = projectForFile(target, graph.projects);
195
- if (owner)
196
- seeds.push(owner.id);
197
- const queue = [...seeds];
198
- const seen = new Set(seeds);
199
- while (queue.length) {
200
- const current = queue.shift();
201
- for (const e of graph.edges) {
202
- if (e.kind !== 'project' || e.to !== current)
203
- continue;
204
- if (seen.has(e.from))
205
- continue;
206
- seen.add(e.from);
207
- found.add(e.from);
208
- queue.push(e.from);
209
- }
210
- }
211
- return [...found].sort();
212
- }
213
- /** Direct inheritance edges declared BY a project. */
214
- export function getOutgoingEdges(graph, projectId) {
215
- return graph.edges.filter((e) => e.from === projectId);
216
- }
217
- /** Direct inheritance edges pointing AT a project. */
218
- export function getIncomingEdges(graph, projectId) {
219
- return graph.edges.filter((e) => e.to === projectId);
220
- }
221
- /** Edges that could not be tied to a project, for reporting a broken workspace honestly. */
222
- export function getUnresolvedEdges(graph) {
223
- return graph.edges.filter((e) => e.unresolved !== undefined);
224
- }
225
- /** Convenience for callers holding a file path rather than a project id. */
226
- export function projectNameOf(graph, projectId) {
227
- return (graph.projects.find((p) => p.id === projectId)?.name ??
228
- basenameUri(projectId));
229
- }
230
- //# sourceMappingURL=graph.js.map
package/dist/graph.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,YAAY,EACZ,UAAU,GACX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,cAAc,GAEf,MAAM,gBAAgB,CAAC;AAiCxB,SAAS,cAAc,CAAC,OAAe;IACrC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QAC7D,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;YACjC,CAAC,CAAE,GAAG,CAAC,SAA4B;YACnC,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,6FAA6F;QAC7F,sDAAsD;QACtD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAsC;IAEtC;;;;;;;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B;IAClE,OAAO,CACL,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC,EAAE,IAAI;QACpD,WAAW,CAAC,SAAS,CAAC,CACvB,CAAC;AACJ,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * The semantic index over composed projects.
3
- *
4
- * Phase 1 Epic 2 delivers TIER 1 only: eager, workspace-wide, and deliberately cheap — one
5
- * `main.yaml` per project and nothing else. Tier 2 (the per-project effective graph) is Epic 3.
6
- */
7
- export { discoverProjects, listProjects, type ProjectListEntry, locateProjectUpward, descriptorNameOf, type UpwardLocation, rediscoverProject, projectForFile, projectNameFor, projectRootOf, isIgnoredPath, capabilitiesOf, DEFAULT_IGNORED_PATH_SEGMENTS, type DiscoveredProject, type ProjectKind, type DiscoveryOptions, } from './discovery.js';
8
- export { PROFILE_TEMPLATE_DETECTOR, CONNECTOR_TEMPLATE_DETECTOR, DEFAULT_DETECTORS, detectorFor, deriveDetector, dirnameComponentPath, partialsAwareRoot, folderBasename, acceptAll, type ProjectDetector, type ProjectCapabilities, } from './detectors.js';
9
- export { buildProjectGraph, getProjectsInheriting, getIncomingEdges, getOutgoingEdges, getUnresolvedEdges, projectNameOf, type ProjectGraph, type InheritanceEdge, type UnresolvedCause, } from './graph.js';
10
- export { Tier1IndexService, CANCELLED, type Cancelled, type Tier1Snapshot, type Tier1Options, type Tier1Listener, } from './tier1Service.js';
11
- export { buildEffectiveGraph, resumeEffectiveGraph, DIRECTIVE_KEYS, projectFolderOf, overlayReader, type EffectiveGraph, type GraphCheckpoint, type EffectiveComponent, type ComponentProvenance, type DocumentVersionLookup, type BuildEffectiveGraphOptions, } from './effectiveGraph.js';
12
- export { Tier2IndexService, TIER2_CANCELLED, TIER2_FAILED, type Tier2Cancelled, type Tier2Failed, type Tier2FailureListener, type Tier2Snapshot, type Tier2Options, type Tier2Listener, type Tier2Failure, type FileChange, } from './tier2Service.js';
13
- export { describeFailure, type IndexFailure, type FailureCode, type SourceRange, type SourcePosition, } from './failures.js';
14
- export { resolveFieldValue, preparePool, FieldResolver, type ResolvedField, type PreparedPool, } from './resolveField.js';
15
- export { getComponent, getComponentsByType, getIncomingRelations, getOutgoingRelations, getRelatedTask, getSubgraph, findReferences, searchComponents, QUERY_CANCELLED, type ComponentRelation, type QuerySignal, type QueryOptions, type QueryCancelled, type LocatedComponent, } from './queries.js';
16
- export { findComponentRange, findComponentRanges, componentRangeKey, findStepRanges, stepRangeKey, type StepRange, } from './ranges.js';
17
- export { resolveCursorContext, pathAtOffset, type CursorContext, type CursorResolution, type NoProjectContext, type CursorReference, type ReferenceSlot, type CursorFileType, type YamlPath, type NodeKind, type ResolveCursorInput, yamlSyntaxErrors, type YamlParseError, } from './cursorContext.js';
18
- export { quoteForYaml, plainScalarSurvives } from './yamlScalar.js';
19
- export { REFERENCE_PROPERTIES, REFERENCE_PROPERTY_LIST, NON_REFERENCE_ID_PROPERTIES, referencePropertyFor, resolvedConnectorIdOf, isWellFormedConnectorIdentity, isUnresolvedToken, resolveReferenceKind, isTokenForm, NESTED_REFERENCE_BLOCKS, nestedReferenceBlockFor, COLLECTIONS_KEYED_BY_REFERENCE, KEY_REFERENCE_PROPERTY, type ReferenceProperty, type ReferenceDiscriminator, type ReferenceKind, } from '@beehexa/hexasync-template-model';
20
- export { checkpointPositions, generationBoundary, nearestCheckpoint, DEFAULT_MAX_CHECKPOINTS, } from './checkpoints.js';
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,gBAAgB,EAEhB,YAAY,EACZ,KAAK,gBAAgB,EAErB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,cAAc,EACnB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,E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a,EAClB,KAAK,YAAY,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAIpE,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EAEpB,qBAAqB,EACrB,6BAA6B,EAC7B,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,GACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
package/dist/index.js DELETED
@@ -1,38 +0,0 @@
1
- /**
2
- * The semantic index over composed projects.
3
- *
4
- * Phase 1 Epic 2 delivers TIER 1 only: eager, workspace-wide, and deliberately cheap — one
5
- * `main.yaml` per project and nothing else. Tier 2 (the per-project effective graph) is Epic 3.
6
- */
7
- export { discoverProjects,
8
- // Every project in the workspace, with NO descriptor reads — for a list, the content buys nothing.
9
- listProjects,
10
- // The upward walk (NFR-8). "Which project is this file in" must not cost a workspace scan.
11
- locateProjectUpward, descriptorNameOf, rediscoverProject, projectForFile, projectNameFor, projectRootOf, isIgnoredPath, capabilitiesOf, DEFAULT_IGNORED_PATH_SEGMENTS, } from './discovery.js';
12
- export { PROFILE_TEMPLATE_DETECTOR, CONNECTOR_TEMPLATE_DETECTOR, DEFAULT_DETECTORS, detectorFor, deriveDetector, dirnameComponentPath, partialsAwareRoot, folderBasename, acceptAll, } from './detectors.js';
13
- export { buildProjectGraph, getProjectsInheriting, getIncomingEdges, getOutgoingEdges, getUnresolvedEdges, projectNameOf, } from './graph.js';
14
- export { Tier1IndexService, CANCELLED, } from './tier1Service.js';
15
- export { buildEffectiveGraph, resumeEffectiveGraph, DIRECTIVE_KEYS, projectFolderOf,
16
- // Exported for the editor's COMPOSE path (extension Phase 4 Story 2.2, FR-96). A graph build and an
17
- // editor-initiated compose both have to read a file as the developer currently has it, and the rule
18
- // for that has one subtlety worth not writing twice: a file present only in the overlay must report
19
- // as EXISTING, or an unsaved file looks absent to whatever asks. One decorator, one answer.
20
- overlayReader, } from './effectiveGraph.js';
21
- export { Tier2IndexService, TIER2_CANCELLED, TIER2_FAILED, } from './tier2Service.js';
22
- export { describeFailure, } from './failures.js';
23
- export { resolveFieldValue, preparePool, FieldResolver, } from './resolveField.js';
24
- export { getComponent, getComponentsByType, getIncomingRelations, getOutgoingRelations, getRelatedTask, getSubgraph, findReferences, searchComponents, QUERY_CANCELLED, } from './queries.js';
25
- export { findComponentRange, findComponentRanges, componentRangeKey, findStepRanges, stepRangeKey, } from './ranges.js';
26
- export { resolveCursorContext, pathAtOffset, yamlSyntaxErrors, } from './cursorContext.js';
27
- // Quoting an inserted scalar (Story 1.5 AC 4). Here rather than in the extension because `yaml` is a
28
- // dependency of this package and deliberately not of the extension — and because a CLI-side inserter
29
- // would have to quote identically or the two would write files that compose differently (NFR-2).
30
- export { quoteForYaml, plainScalarSurvives } from './yamlScalar.js';
31
- // The reference registry MOVED to `template-model` (Story 1.2): the validation rules need it as much
32
- // as the graph does, and `template-validate` cannot import a sibling. Re-exported here so every
33
- // existing consumer — including the extension — is unaffected by where it lives.
34
- export { REFERENCE_PROPERTIES, REFERENCE_PROPERTY_LIST, NON_REFERENCE_ID_PROPERTIES, referencePropertyFor,
35
- // Story 2.1: the connector-identity predicates, so a corpus spec and the CONN rule read ONE definition.
36
- resolvedConnectorIdOf, isWellFormedConnectorIdentity, isUnresolvedToken, resolveReferenceKind, isTokenForm, NESTED_REFERENCE_BLOCKS, nestedReferenceBlockFor, COLLECTIONS_KEYED_BY_REFERENCE, KEY_REFERENCE_PROPERTY, } from '@beehexa/hexasync-template-model';
37
- export { checkpointPositions, generationBoundary, nearestCheckpoint, DEFAULT_MAX_CHECKPOINTS, } from './checkpoints.js';
38
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,gBAAgB;AAChB,mGAAmG;AACnG,YAAY;AAEZ,2FAA2F;AAC3F,mBAAmB,EACnB,gBAAgB,EAEhB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,6BAA6B,GAI9B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,SAAS,GAGV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,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BAAiB,EACjB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
package/dist/queries.d.ts DELETED
@@ -1,102 +0,0 @@
1
- /**
2
- * The query surface over an effective graph (FR-42, Story 3.4).
3
- *
4
- * Exists so consumers do not each invent their own traversal. Every later phase — diagnostics,
5
- * pickers, preview, rename — asks the same handful of questions, and eight private traversals
6
- * would disagree about edge cases in eight different ways.
7
- *
8
- * Every query reads from an immutable snapshot and builds nothing. A query that could trigger a
9
- * compose would make cursor movement expensive, which is the anti-pattern NFR-8 records.
10
- */
11
- import type { EffectiveComponent, EffectiveGraph } from './effectiveGraph.js';
12
- import type { SourceRange } from './failures.js';
13
- /**
14
- * How a caller abandons a query it no longer wants (AD-14).
15
- *
16
- * A bare object rather than an `AbortSignal` so core names no host type; the extension adapts
17
- * whatever its editor gives it.
18
- */
19
- export interface QuerySignal {
20
- readonly cancelled: boolean;
21
- }
22
- /** What a cancelled query resolves to. Never thrown — cancellation is an ordinary outcome. */
23
- export declare const QUERY_CANCELLED: unique symbol;
24
- export type QueryCancelled = typeof QUERY_CANCELLED;
25
- export interface QueryOptions {
26
- readonly signal?: QuerySignal;
27
- }
28
- /** A component together with where it physically sits, which navigation needs. */
29
- export interface LocatedComponent {
30
- readonly component: EffectiveComponent;
31
- /** The project that owns it, and the file and range it lives at. */
32
- readonly projectId: string;
33
- readonly sourceFile: string;
34
- /** Absent when the file is mid-keystroke, or the component is not locatable in it. */
35
- readonly range?: SourceRange;
36
- }
37
- /** A reference from one component to another, discovered by scanning values. */
38
- export interface ComponentRelation {
39
- /** The component holding the reference. */
40
- readonly from: EffectiveComponent;
41
- /** The property that carried it — `taskId`, `pusherId`, … */
42
- readonly property: string;
43
- /** The referenced id, token form. */
44
- readonly targetId: string;
45
- /** Resolved target, when the graph contains exactly one candidate. */
46
- readonly to?: EffectiveComponent;
47
- /**
48
- * The collection this reference POINTS INTO, whether or not it resolved.
49
- *
50
- * Carried separately from `to` because "where was it aiming" survives the target being absent,
51
- * and every consumer that filters incoming references by collection needs it precisely when the
52
- * reference is broken. Filtering on `to.collection` alone silently matched every collection for
53
- * an unresolved id, so a rename preview for a table listed references that named objects.
54
- */
55
- readonly targetCollection?: string;
56
- /**
57
- * True when the id matched components in SEVERAL collections and the property does not say
58
- * which it means.
59
- *
60
- * Stated rather than resolved by picking one. In the corpus 33-61 ids per project sit in two
61
- * collections at once, so guessing would be wrong constantly and silently.
62
- */
63
- readonly ambiguous?: boolean;
64
- }
65
- /**
66
- * One component, with everything a caller needs to show OR NAVIGATE TO it.
67
- *
68
- * The range is resolved here rather than carried on every component: it is wanted for the few a
69
- * developer looks at, and building it for all 273 would mean re-parsing every worklist file at
70
- * build time — the cost this epic spent itself removing.
71
- */
72
- export declare function getComponent(graph: EffectiveGraph, collection: string, id: string, options?: QueryOptions): Promise<LocatedComponent | undefined | QueryCancelled>;
73
- /** Every component of a collection — `objects`, `pullers`, `tables`, … */
74
- export declare function getComponentsByType(graph: EffectiveGraph, collection: string, options?: QueryOptions): Promise<EffectiveComponent[] | QueryCancelled>;
75
- /** References this component makes. */
76
- export declare function getOutgoingRelations(graph: EffectiveGraph, collection: string, id: string, options?: QueryOptions): Promise<ComponentRelation[] | QueryCancelled>;
77
- /** References made TO this component — the blast radius of changing it. */
78
- export declare function getIncomingRelations(graph: EffectiveGraph, collection: string, id: string, options?: QueryOptions): Promise<ComponentRelation[] | QueryCancelled>;
79
- /**
80
- * The Task a component belongs to.
81
- *
82
- * Every Task-centric surface in later phases depends on this. A Task is an `objects` entry, and
83
- * a non-Task component belongs to one either by naming it (`objectId`) or by being named by it.
84
- */
85
- export declare function getRelatedTask(graph: EffectiveGraph, collection: string, id: string, options?: QueryOptions): Promise<EffectiveComponent | undefined | QueryCancelled>;
86
- /**
87
- * The component plus everything reachable from it, to a depth.
88
- *
89
- * Bounded on purpose: an unbounded walk over a 273-component graph returns most of it, which is
90
- * not a subgraph in any useful sense.
91
- */
92
- export declare function getSubgraph(graph: EffectiveGraph, collection: string, id: string, depth?: number, options?: QueryOptions): Promise<EffectiveComponent[] | QueryCancelled>;
93
- /** Every reference to a component, resolved or not — including ones pointing at nothing. */
94
- export declare function findReferences(graph: EffectiveGraph, collection: string, id: string, options?: QueryOptions): Promise<ComponentRelation[] | QueryCancelled>;
95
- /**
96
- * Search components by id, collection, file path, name, description, system and displayType.
97
- *
98
- * Case-insensitive substring, deliberately: a developer half-remembering a name should find it,
99
- * and a stricter match would send them back to grep — which is what the index exists to replace.
100
- */
101
- export declare function searchComponents(graph: EffectiveGraph, query: string, limit?: number, options?: QueryOptions): Promise<EffectiveComponent[] | QueryCancelled>;
102
- //# sourceMappingURL=queries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAS9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED,8FAA8F;AAC9F,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B;AAmCD,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAED,gFAAgF;AAChF,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IA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