@chrisdudek/yg 4.2.0 → 5.0.0-alpha.1
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 +4 -2
- package/dist/ast.d.ts +51 -0
- package/dist/ast.js +279 -0
- package/dist/bin.js +17276 -6486
- package/dist/grammars/tree-sitter-c.wasm +0 -0
- package/dist/grammars/tree-sitter-c_sharp.wasm +0 -0
- package/dist/grammars/tree-sitter-cpp.wasm +0 -0
- package/dist/grammars/tree-sitter-go.wasm +0 -0
- package/dist/grammars/tree-sitter-java.wasm +0 -0
- package/dist/grammars/tree-sitter-javascript.wasm +0 -0
- package/dist/grammars/tree-sitter-json.wasm +0 -0
- package/dist/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/grammars/tree-sitter-php_only.wasm +0 -0
- package/dist/grammars/tree-sitter-python.wasm +0 -0
- package/dist/grammars/tree-sitter-ruby.wasm +0 -0
- package/dist/grammars/tree-sitter-rust.wasm +0 -0
- package/dist/grammars/tree-sitter-toml.wasm +0 -0
- package/dist/grammars/tree-sitter-tsx.wasm +0 -0
- package/dist/grammars/tree-sitter-typescript.wasm +0 -0
- package/dist/grammars/tree-sitter-yaml.wasm +0 -0
- package/dist/loader-hook-impl.d.ts +9 -0
- package/dist/loader-hook-impl.js +16 -0
- package/dist/structure.d.ts +407 -0
- package/dist/structure.js +1131 -0
- package/graph-schemas/yg-architecture.yaml +39 -6
- package/graph-schemas/yg-aspect.yaml +69 -3
- package/graph-schemas/yg-config.yaml +28 -12
- package/graph-schemas/yg-flow.yaml +5 -3
- package/graph-schemas/yg-node.yaml +19 -5
- package/package.json +55 -19
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/ast/loader-hook-impl.ts
|
|
2
|
+
import { pathToFileURL, fileURLToPath } from "url";
|
|
3
|
+
import path from "path";
|
|
4
|
+
var selfDir = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
async function resolve(specifier, context, nextResolve) {
|
|
6
|
+
if (specifier.startsWith("@chrisdudek/yg/")) {
|
|
7
|
+
const exportName = specifier.slice("@chrisdudek/yg/".length);
|
|
8
|
+
const target = pathToFileURL(path.join(selfDir, `${exportName}.js`)).href;
|
|
9
|
+
return { url: target, shortCircuit: true };
|
|
10
|
+
}
|
|
11
|
+
return nextResolve(specifier, context);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
resolve
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=loader-hook-impl.js.map
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { Tree } from 'web-tree-sitter';
|
|
2
|
+
export { FindCommentsTarget, InFilePattern, closest, findComments, inFile, report, walk } from './ast.js';
|
|
3
|
+
|
|
4
|
+
interface File {
|
|
5
|
+
/** repo-relative POSIX path */
|
|
6
|
+
path: string;
|
|
7
|
+
/** raw file content */
|
|
8
|
+
content: string;
|
|
9
|
+
/** parsed tree-sitter Tree, eagerly attached for files of a registered language; undefined otherwise. May carry parse errors (inspect ast.rootNode.hasError). */
|
|
10
|
+
ast?: unknown;
|
|
11
|
+
/** language id from the extension registry (e.g. 'typescript'); undefined for files with no registered grammar */
|
|
12
|
+
language?: string;
|
|
13
|
+
}
|
|
14
|
+
interface Port {
|
|
15
|
+
description: string;
|
|
16
|
+
/** aspect ids required of consumers */
|
|
17
|
+
aspects: string[];
|
|
18
|
+
}
|
|
19
|
+
type RelationType$1 = 'calls' | 'uses' | 'extends' | 'implements' | 'emits' | 'listens';
|
|
20
|
+
interface Relation$1 {
|
|
21
|
+
type: RelationType$1;
|
|
22
|
+
/** target node path (e.g. 'orders/handler') */
|
|
23
|
+
target: string;
|
|
24
|
+
/** consumed port names (when applicable) */
|
|
25
|
+
consumes?: string[];
|
|
26
|
+
}
|
|
27
|
+
interface GraphNode$1 {
|
|
28
|
+
/** node path under model/ (e.g. 'cli/templates') */
|
|
29
|
+
id: string;
|
|
30
|
+
/** node_type id from yg-architecture.yaml */
|
|
31
|
+
type: string;
|
|
32
|
+
/** mapping entries from yg-node.yaml, untouched */
|
|
33
|
+
mapping: string[];
|
|
34
|
+
/** materialized files for this node's mapping (child carve-out applied for own node) */
|
|
35
|
+
files: File[];
|
|
36
|
+
ports: Record<string, Port>;
|
|
37
|
+
}
|
|
38
|
+
interface FsEntry {
|
|
39
|
+
/** basename, e.g. 'foo.ts' */
|
|
40
|
+
name: string;
|
|
41
|
+
kind: 'file' | 'dir';
|
|
42
|
+
}
|
|
43
|
+
interface Ctx {
|
|
44
|
+
node: GraphNode$1;
|
|
45
|
+
/** alias for node.files (own node files with child carve-out) */
|
|
46
|
+
files: File[];
|
|
47
|
+
fs: {
|
|
48
|
+
exists(path: string): 'file' | 'dir' | false;
|
|
49
|
+
list(dir: string): FsEntry[];
|
|
50
|
+
read(path: string): string;
|
|
51
|
+
};
|
|
52
|
+
graph: {
|
|
53
|
+
node(id: string): GraphNode$1 | undefined;
|
|
54
|
+
nodesByType(type: string): GraphNode$1[];
|
|
55
|
+
relationsFrom(node: GraphNode$1): Relation$1[];
|
|
56
|
+
relationsTo(node: GraphNode$1): Relation$1[];
|
|
57
|
+
children(node: GraphNode$1): GraphNode$1[];
|
|
58
|
+
flowParticipants(flowName: string): GraphNode$1[];
|
|
59
|
+
};
|
|
60
|
+
parseAst(file: File | string, language: string): unknown;
|
|
61
|
+
parseYaml(file: File | string): unknown;
|
|
62
|
+
parseJson(file: File | string): unknown;
|
|
63
|
+
parseToml(file: File | string): unknown;
|
|
64
|
+
}
|
|
65
|
+
interface Violation {
|
|
66
|
+
message: string;
|
|
67
|
+
file?: string;
|
|
68
|
+
line?: number;
|
|
69
|
+
column?: number;
|
|
70
|
+
/** Reserved prefix 'structure-aspect-*' for runtime emissions */
|
|
71
|
+
kind?: string;
|
|
72
|
+
}
|
|
73
|
+
/** check.mjs export signature (synchronous) */
|
|
74
|
+
type CheckFunction = (ctx: Ctx) => Violation[];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Applicability filter. Evaluated by the CLI against the graph before an aspect
|
|
78
|
+
* is considered effective on a node. If the predicate evaluates to false, the
|
|
79
|
+
* aspect is silently skipped on that node regardless of which channel attached it.
|
|
80
|
+
*
|
|
81
|
+
* Combines via AND with attach-site `when` declarations.
|
|
82
|
+
*
|
|
83
|
+
* Top-level atomic clauses are treated as implicit `all_of`.
|
|
84
|
+
*/
|
|
85
|
+
type WhenPredicate = BooleanClause | AtomicClause;
|
|
86
|
+
type BooleanClause = {
|
|
87
|
+
all_of: WhenPredicate[];
|
|
88
|
+
} | {
|
|
89
|
+
any_of: WhenPredicate[];
|
|
90
|
+
} | {
|
|
91
|
+
not: WhenPredicate;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* An atomic clause. All fields are optional — absent fields do not constrain.
|
|
95
|
+
* An empty object `{}` is therefore vacuously true. Parsers reject the empty
|
|
96
|
+
* form at the attach site (at least one operator/atomic key must be present).
|
|
97
|
+
*/
|
|
98
|
+
interface AtomicClause {
|
|
99
|
+
relations?: RelationClause;
|
|
100
|
+
descendants?: DescendantsClause;
|
|
101
|
+
node?: NodeClause;
|
|
102
|
+
}
|
|
103
|
+
type RelationClause = Partial<Record<RelationType, RelationMatch>>;
|
|
104
|
+
interface RelationMatch {
|
|
105
|
+
target_type?: string;
|
|
106
|
+
/** Node path relative to model/ */
|
|
107
|
+
target?: string;
|
|
108
|
+
consumes_port?: string;
|
|
109
|
+
}
|
|
110
|
+
interface DescendantsClause {
|
|
111
|
+
relations?: RelationClause;
|
|
112
|
+
type?: string;
|
|
113
|
+
has_port?: string;
|
|
114
|
+
}
|
|
115
|
+
interface NodeClause {
|
|
116
|
+
type?: string;
|
|
117
|
+
has_port?: string;
|
|
118
|
+
has_mapping?: boolean;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* FileWhenPredicate — per-file predicate for node_type classification.
|
|
123
|
+
*
|
|
124
|
+
* Two atoms: `path` (glob against file path) and `content` (regex against file content).
|
|
125
|
+
* Three operators: `all_of`, `any_of`, `not`.
|
|
126
|
+
* Top-level single atom permitted (implicit single-clause predicate).
|
|
127
|
+
*
|
|
128
|
+
* Distinct from aspect-level `WhenPredicate` (which uses graph-shape atoms
|
|
129
|
+
* relations/descendants/node). Same operator names, different atoms.
|
|
130
|
+
*/
|
|
131
|
+
type FileWhenPredicate = FileAtomicClause | FileBooleanClause;
|
|
132
|
+
type FileAtomicClause = {
|
|
133
|
+
/** Glob pattern matched against the file's repo-relative path. */
|
|
134
|
+
path?: string;
|
|
135
|
+
/** Regex pattern matched against the file content. */
|
|
136
|
+
content?: string;
|
|
137
|
+
};
|
|
138
|
+
type FileBooleanClause = {
|
|
139
|
+
all_of: FileWhenPredicate[];
|
|
140
|
+
} | {
|
|
141
|
+
any_of: FileWhenPredicate[];
|
|
142
|
+
} | {
|
|
143
|
+
not: FileWhenPredicate;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
interface IssueMessage {
|
|
147
|
+
/** What happened — facts, one line or short block */
|
|
148
|
+
what: string;
|
|
149
|
+
/** Why it's a problem — context for the agent */
|
|
150
|
+
why: string;
|
|
151
|
+
/** Concrete command or instruction to resolve */
|
|
152
|
+
next: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface ReviewerConfig {
|
|
156
|
+
/** Tier name used when an aspect doesn't declare one explicitly */
|
|
157
|
+
default?: string;
|
|
158
|
+
/** At least one entry required; key is the tier name */
|
|
159
|
+
tiers: Record<string, LlmConfig>;
|
|
160
|
+
}
|
|
161
|
+
interface YggConfig {
|
|
162
|
+
version?: string;
|
|
163
|
+
quality?: QualityConfig;
|
|
164
|
+
/** Reviewer configuration — tiers + default. Optional in the type
|
|
165
|
+
* to preserve FALLBACK_CONFIG ergonomics; validator emits
|
|
166
|
+
* `config-reviewer-missing` when absent on a real project. */
|
|
167
|
+
reviewer?: ReviewerConfig;
|
|
168
|
+
parallel?: number;
|
|
169
|
+
debug?: boolean;
|
|
170
|
+
}
|
|
171
|
+
interface ArchitectureNodeType {
|
|
172
|
+
description: string;
|
|
173
|
+
aspects?: string[];
|
|
174
|
+
/** Per-aspect applicability filters for aspects listed in `aspects` */
|
|
175
|
+
aspectWhens?: Record<string, WhenPredicate>;
|
|
176
|
+
/** Per-aspect explicit status override for aspects listed in `aspects` (channel 3) */
|
|
177
|
+
aspectStatus?: Record<string, AspectStatus>;
|
|
178
|
+
parents?: string[];
|
|
179
|
+
relations?: Partial<Record<RelationType, string[]>>;
|
|
180
|
+
/**
|
|
181
|
+
* Whether nodes of this type require a log entry per source-file change.
|
|
182
|
+
* Undefined means caller should apply its own default (typically true).
|
|
183
|
+
*/
|
|
184
|
+
log_required?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Per-file classification predicate. Types without `when` are organizational
|
|
187
|
+
* (parent-only — nodes of that type cannot carry a non-empty `mapping:`).
|
|
188
|
+
*/
|
|
189
|
+
when?: FileWhenPredicate;
|
|
190
|
+
/**
|
|
191
|
+
* When set to 'strict', backward enforcement applies: any repo file matching
|
|
192
|
+
* `when` must be in a node mapping of this type, and conversely a mapping
|
|
193
|
+
* file must satisfy `when`.
|
|
194
|
+
*/
|
|
195
|
+
enforce?: 'strict';
|
|
196
|
+
}
|
|
197
|
+
interface ArchitectureDef {
|
|
198
|
+
node_types: Record<string, ArchitectureNodeType>;
|
|
199
|
+
}
|
|
200
|
+
interface QualityConfig {
|
|
201
|
+
max_direct_relations: number;
|
|
202
|
+
/** Per-node character budget. A node whose mapped source files plus the
|
|
203
|
+
* reference files of its effective aspects exceed this total is an
|
|
204
|
+
* `oversized-node` error. Default 40000. Binary files do not count; a node
|
|
205
|
+
* may opt out via `sizeExempt`. */
|
|
206
|
+
max_node_chars?: number;
|
|
207
|
+
}
|
|
208
|
+
type RelationType = 'uses' | 'calls' | 'extends' | 'implements' | 'emits' | 'listens';
|
|
209
|
+
/** Port on a target node — consumers must satisfy port's aspects */
|
|
210
|
+
interface PortDef {
|
|
211
|
+
description: string;
|
|
212
|
+
aspects: string[];
|
|
213
|
+
/** Per-aspect applicability filters for aspects listed in `aspects` */
|
|
214
|
+
aspectWhens?: Record<string, WhenPredicate>;
|
|
215
|
+
/** Per-aspect explicit status override for aspects listed in `aspects` (channel 6) */
|
|
216
|
+
aspectStatus?: Record<string, AspectStatus>;
|
|
217
|
+
}
|
|
218
|
+
type ReviewerProvider = 'ollama' | 'openai' | 'anthropic' | 'google' | 'openai-compatible' | 'claude-code' | 'codex' | 'gemini-cli';
|
|
219
|
+
/** LLM configuration — merged from yg-config.yaml + yg-secrets.yaml */
|
|
220
|
+
interface LlmConfig {
|
|
221
|
+
provider: ReviewerProvider;
|
|
222
|
+
model: string;
|
|
223
|
+
endpoint?: string;
|
|
224
|
+
api_key?: string;
|
|
225
|
+
temperature: number;
|
|
226
|
+
consensus: number;
|
|
227
|
+
max_tokens: number | 'auto';
|
|
228
|
+
/** Ollama model_info key for context length (e.g. "qwen35.context_length"). Auto-detected if omitted. */
|
|
229
|
+
context_length_field?: string;
|
|
230
|
+
/** CLI providers: subprocess timeout in ms. Default: 120_000. */
|
|
231
|
+
timeout?: number;
|
|
232
|
+
/** Optional caps on reference files for aspects resolving to this tier. */
|
|
233
|
+
references?: {
|
|
234
|
+
/** Max bytes per single reference file. Default 65536 (64 KiB). */
|
|
235
|
+
max_bytes_per_file?: number;
|
|
236
|
+
/** Max sum of reference bytes per aspect. Default 262144 (256 KiB). */
|
|
237
|
+
max_total_bytes_per_aspect?: number;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
interface NodeMeta {
|
|
241
|
+
name: string;
|
|
242
|
+
type: string;
|
|
243
|
+
description?: string;
|
|
244
|
+
aspects?: string[];
|
|
245
|
+
/** Per-aspect applicability filters for aspects listed in `aspects` */
|
|
246
|
+
aspectWhens?: Record<string, WhenPredicate>;
|
|
247
|
+
/** Per-aspect explicit status override for aspects listed in `aspects` (channel 1) */
|
|
248
|
+
aspectStatus?: Record<string, AspectStatus>;
|
|
249
|
+
ports?: Record<string, PortDef>;
|
|
250
|
+
relations?: Relation[];
|
|
251
|
+
/** Flat list of file/directory paths relative to repo root */
|
|
252
|
+
mapping?: string[];
|
|
253
|
+
/** Documented opt-out from the per-node character budget (`oversized-node`).
|
|
254
|
+
* Use ONLY for nodes mapping an unsplittable generated or binary artifact
|
|
255
|
+
* (lockfile, append-only changelog, image). Requires a justification. */
|
|
256
|
+
sizeExempt?: {
|
|
257
|
+
reason: string;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
interface Relation {
|
|
261
|
+
target: string;
|
|
262
|
+
type: RelationType;
|
|
263
|
+
consumes?: string[];
|
|
264
|
+
/** For event relations (emits, listens): display name of the event, e.g. OrderPlaced */
|
|
265
|
+
event_name?: string;
|
|
266
|
+
}
|
|
267
|
+
interface GraphNode {
|
|
268
|
+
/** Path relative to model/, e.g. "orders/order-service" */
|
|
269
|
+
path: string;
|
|
270
|
+
/** Parsed yg-node.yaml content */
|
|
271
|
+
meta: NodeMeta;
|
|
272
|
+
/** Raw yg-node.yaml file content (for context assembly without disk access) */
|
|
273
|
+
nodeYamlRaw?: string;
|
|
274
|
+
/** Child nodes (subdirectories with yg-node.yaml) */
|
|
275
|
+
children: GraphNode[];
|
|
276
|
+
/** Parent node (null for top-level nodes) */
|
|
277
|
+
parent: GraphNode | null;
|
|
278
|
+
}
|
|
279
|
+
interface Artifact {
|
|
280
|
+
/** Filename, e.g. "content.md" */
|
|
281
|
+
filename: string;
|
|
282
|
+
/** Full text content of the file */
|
|
283
|
+
content: string;
|
|
284
|
+
}
|
|
285
|
+
interface AspectReviewerSpec {
|
|
286
|
+
type: 'llm' | 'deterministic';
|
|
287
|
+
/** Tier reference into ReviewerConfig.tiers; valid only when type === 'llm' */
|
|
288
|
+
tier?: string;
|
|
289
|
+
}
|
|
290
|
+
type AspectStatus = 'draft' | 'advisory' | 'enforced';
|
|
291
|
+
/** Propagation modifier on implies edges. */
|
|
292
|
+
type StatusInherit = 'strictest' | 'own-default';
|
|
293
|
+
interface AspectDef {
|
|
294
|
+
name: string;
|
|
295
|
+
id: string;
|
|
296
|
+
description?: string;
|
|
297
|
+
/** Reviewer specification — type and optional tier reference */
|
|
298
|
+
reviewer: AspectReviewerSpec;
|
|
299
|
+
implies?: string[];
|
|
300
|
+
/** Per-implies applicability filters for aspect ids listed in `implies` */
|
|
301
|
+
impliesWhens?: Record<string, WhenPredicate>;
|
|
302
|
+
/** Per-implies status propagation modifier for aspect ids listed in `implies`.
|
|
303
|
+
* Absent key → 'strictest' (default). */
|
|
304
|
+
impliesStatusInherit?: Record<string, StatusInherit>;
|
|
305
|
+
/** Global applicability filter for this aspect, applied on every channel */
|
|
306
|
+
when?: WhenPredicate;
|
|
307
|
+
artifacts: Artifact[];
|
|
308
|
+
/** Supporting files for the LLM reviewer (lookup tables, catalogues, contracts). Permitted only when reviewer.type === 'llm'. */
|
|
309
|
+
references?: Array<{
|
|
310
|
+
path: string;
|
|
311
|
+
description?: string;
|
|
312
|
+
}>;
|
|
313
|
+
/** Aspect-level default status. Absent → 'enforced'. Attach sites may override per the bump rule: bump up OK, downgrade is a validator error. */
|
|
314
|
+
status?: AspectStatus;
|
|
315
|
+
}
|
|
316
|
+
interface FlowDef {
|
|
317
|
+
/** Directory name under flows/, e.g. "checkout-flow" */
|
|
318
|
+
path: string;
|
|
319
|
+
name: string;
|
|
320
|
+
description?: string;
|
|
321
|
+
nodes: string[];
|
|
322
|
+
/** Optional aspect ids — aspects propagate to all participants */
|
|
323
|
+
aspects?: string[];
|
|
324
|
+
/** Per-aspect applicability filters for aspects listed in `aspects` */
|
|
325
|
+
aspectWhens?: Record<string, WhenPredicate>;
|
|
326
|
+
/** Per-aspect explicit status override for aspects listed in `aspects` (channel 5) */
|
|
327
|
+
aspectStatus?: Record<string, AspectStatus>;
|
|
328
|
+
}
|
|
329
|
+
interface SchemaDef {
|
|
330
|
+
/** Inferred from filename: 'node' | 'aspect' | 'flow' */
|
|
331
|
+
schemaType: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Architecture file load error.
|
|
335
|
+
*
|
|
336
|
+
* Bare string keeps backward compatibility with legacy parse failures.
|
|
337
|
+
* Structured form lets validators distinguish error codes — e.g.
|
|
338
|
+
* `when-predicate-invalid` vs. generic `architecture-invalid`.
|
|
339
|
+
*/
|
|
340
|
+
type ArchitectureLoadError = {
|
|
341
|
+
code: 'architecture-invalid';
|
|
342
|
+
messageData: IssueMessage;
|
|
343
|
+
} | {
|
|
344
|
+
code: 'when-predicate-invalid';
|
|
345
|
+
messageData: IssueMessage;
|
|
346
|
+
};
|
|
347
|
+
interface Graph {
|
|
348
|
+
config: YggConfig;
|
|
349
|
+
architecture: ArchitectureDef;
|
|
350
|
+
/** Present when yg-architecture.yaml could not be parsed */
|
|
351
|
+
architectureError?: ArchitectureLoadError;
|
|
352
|
+
/** Present when yg-config.yaml could not be parsed and loader used fallback config */
|
|
353
|
+
configError?: string;
|
|
354
|
+
/** Structured form of configError — present when the config parse failure has what/why/next fields */
|
|
355
|
+
configErrorMessage?: IssueMessage;
|
|
356
|
+
/** Parse errors for yg-node.yaml files; reported as yaml-invalid */
|
|
357
|
+
nodeParseErrors?: Array<{
|
|
358
|
+
nodePath: string;
|
|
359
|
+
messageData: IssueMessage;
|
|
360
|
+
}>;
|
|
361
|
+
/** Parse errors for yg-aspect.yaml files. Each carries the structured
|
|
362
|
+
* validator code for the validator to emit downstream. */
|
|
363
|
+
aspectParseErrors?: Array<{
|
|
364
|
+
aspectId: string;
|
|
365
|
+
code: string;
|
|
366
|
+
messageData: IssueMessage;
|
|
367
|
+
}>;
|
|
368
|
+
/** Structured error code carried alongside `configError`. Used by
|
|
369
|
+
* validator to suppress dependent checks (e.g., skip aspect-tier-unknown
|
|
370
|
+
* when the config is invalid). */
|
|
371
|
+
configErrorCode?: string;
|
|
372
|
+
/** All nodes indexed by their path (e.g. "orders/order-service") */
|
|
373
|
+
nodes: Map<string, GraphNode>;
|
|
374
|
+
aspects: AspectDef[];
|
|
375
|
+
flows: FlowDef[];
|
|
376
|
+
schemas: SchemaDef[];
|
|
377
|
+
/** Absolute path to the .yggdrasil/ directory */
|
|
378
|
+
rootPath: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** Per-invocation parse cache shared by AST and structure runners. */
|
|
382
|
+
type ParseCache = Map<string, {
|
|
383
|
+
content: string;
|
|
384
|
+
ast: Tree;
|
|
385
|
+
}>;
|
|
386
|
+
|
|
387
|
+
interface RunStructureAspectParams {
|
|
388
|
+
aspectDir: string;
|
|
389
|
+
aspectId: string;
|
|
390
|
+
nodePath: string;
|
|
391
|
+
graph: Graph;
|
|
392
|
+
projectRoot: string;
|
|
393
|
+
parseCache?: ParseCache;
|
|
394
|
+
}
|
|
395
|
+
interface RunStructureAspectResult {
|
|
396
|
+
violations: Violation[];
|
|
397
|
+
touchedFiles: string[];
|
|
398
|
+
succeeded?: boolean;
|
|
399
|
+
}
|
|
400
|
+
declare class StructureRunnerError extends Error {
|
|
401
|
+
readonly code: string;
|
|
402
|
+
readonly messageData: IssueMessage;
|
|
403
|
+
constructor(code: string, data: IssueMessage);
|
|
404
|
+
}
|
|
405
|
+
declare function runStructureAspect(params: RunStructureAspectParams): Promise<RunStructureAspectResult>;
|
|
406
|
+
|
|
407
|
+
export { type CheckFunction, type Ctx, type File, type FsEntry, type GraphNode$1 as GraphNode, type Port, type Relation$1 as Relation, type RelationType$1 as RelationType, StructureRunnerError, type Violation, runStructureAspect };
|