@codependix/configuration 0.0.0-stage → 0.0.3

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.
@@ -0,0 +1,1232 @@
1
+ import { RunMode } from '@codependix/core';
2
+ import { RunModeSelection } from '@codependix/core';
3
+ import { z } from 'zod';
4
+
5
+ /** Arguments accepted when applying `--include`/`--exclude` overrides. */
6
+ export declare interface ApplyOverridesArguments {
7
+ /** The configuration exactly as parsed, before any default is applied. */
8
+ authored: CodependixConfiguration;
9
+ overrides: CodependixConfigurationOverrides | undefined;
10
+ /** The configuration with every default already applied. */
11
+ resolved: ResolvedCodependixConfiguration;
12
+ }
13
+
14
+ /** What `--check boundaries` asks the run to fail on: an edge breaking a rule. */
15
+ export declare const CHECK_BOUNDARIES = "boundaries";
16
+
17
+ /**
18
+ * Everything `--check` accepts, in the order an error message lists them.
19
+ *
20
+ * Named here rather than spelled into each message, so the list a mistake is
21
+ * measured against and the list it is told about can never drift apart. The
22
+ * same arrangement `codometer` and `callidescope` both use, and `reports` is
23
+ * deliberately their word spelled the same way: a configured destination has
24
+ * gone stale is one finding across all three tools, and two names for it
25
+ * would make the three reports unreadable together.
26
+ */
27
+ export declare const CHECK_NAMES: string[];
28
+
29
+ /** What `--check reports` asks the run to fail on: a stale configured export. */
30
+ export declare const CHECK_REPORTS = "reports";
31
+
32
+ /** How a `--check` value is written: one comma-separated set, no spaces needed. */
33
+ export declare const CHECK_SEPARATOR = ",";
34
+
35
+ /** Export targets a graph type may be configured with, per project. */
36
+ export declare const CODEPENDIX_EXPORT_TARGETS: readonly ["both", "json", "markdown", "none"];
37
+
38
+ /** Graph levels codependix can build. */
39
+ export declare const CODEPENDIX_GRAPH_TYPES: readonly ["fileImports", "nestjsModules", "nxProjects"];
40
+
41
+ /**
42
+ * Every declared boundary rule, keyed by the graph level it judges.
43
+ *
44
+ * Keyed the same way `CodependixProjectConfiguration` is, and written out
45
+ * field by field for the same reason: under `exactOptionalPropertyTypes`,
46
+ * `Partial<Record<...>>` makes a field optional without widening its type to
47
+ * include `undefined`, which then rejects the "unset" value every
48
+ * default-resolution path needs to assign.
49
+ *
50
+ * A flat array with a `graph` discriminant would also work, and was rejected:
51
+ * it forces a reader to know which selector keys are legal at which level,
52
+ * which the key already says.
53
+ *
54
+ * `fileImports` nests by language rather than flattening to one rule array:
55
+ * a Python file cannot import a TypeScript file or vice versa, so no edge
56
+ * ever crosses languages, and the rule vocabularies genuinely differ (a
57
+ * `*.types.ts` naming convention has no Python equivalent). `nestjsModules`
58
+ * and `nxProjects` keep the flat shape every other level always had.
59
+ */
60
+ export declare interface CodependixBoundariesConfiguration {
61
+ fileImports?: CodependixFileImportsBoundariesConfiguration | undefined;
62
+ nestjsModules?: CodependixBoundaryRule[] | undefined;
63
+ nxProjects?: CodependixBoundaryRule[] | undefined;
64
+ }
65
+
66
+ /**
67
+ * One rule stating which nodes may reach which, at one graph level.
68
+ *
69
+ * `forbid` reports every edge whose source matches `from` and whose target
70
+ * matches `to`. `allow` reports the mirror image — an edge leaving `from` for
71
+ * anywhere `to` does not claim — so it states a node's whole permitted
72
+ * surface rather than one thing it may not touch. Written as two `kind`s of
73
+ * one rule rather than two rule types, because a reader comparing them wants
74
+ * to see the same three fields either way.
75
+ */
76
+ export declare interface CodependixBoundaryAccessRule {
77
+ /**
78
+ * Narrows which edges the rule judges, rather than which nodes it selects.
79
+ *
80
+ * Left unset, the rule judges every edge between the nodes it selects.
81
+ */
82
+ edges?: CodependixBoundaryEdgeSelector | undefined;
83
+ /** Selects the nodes the edge leaves. */
84
+ from: CodependixBoundarySelector;
85
+ kind: "allow" | "forbid";
86
+ /**
87
+ * Why the rule exists, appended to the generated sentence.
88
+ *
89
+ * Appended rather than substituted, so no wording a configuration chooses
90
+ * can cost a report the rule that fired and both ends of what it fired on.
91
+ */
92
+ message?: string | undefined;
93
+ /** How the rule is named in a report, and in whatever asks about it. */
94
+ name: string;
95
+ /** Selects the nodes the edge arrives at. */
96
+ to: CodependixBoundarySelector;
97
+ }
98
+
99
+ /**
100
+ * One rule forbidding a cycle among a selected set of nodes.
101
+ *
102
+ * Deliberately narrow at TypeScript file level, where `dependency-cruiser`'s
103
+ * `no-circular` is already the workspace's gate — see
104
+ * `configuration/dependency-cruiser.cjs`. At Nx project level and NestJS
105
+ * module level nothing else states it, which is where this earns its place.
106
+ */
107
+ export declare interface CodependixBoundaryAcyclicRule {
108
+ kind: "acyclic";
109
+ /** Why the rule exists, appended to the generated sentence. */
110
+ message?: string | undefined;
111
+ /** How the rule is named in a report, and in whatever asks about it. */
112
+ name: string;
113
+ /**
114
+ * Selects the nodes the rule covers, defaulting to every node in the graph.
115
+ *
116
+ * A cycle is only reported when every node in it is selected: a rule scoped
117
+ * to one directory should not fail because of a cycle running through code
118
+ * it was never asked about.
119
+ */
120
+ nodes?: CodependixBoundarySelector | undefined;
121
+ }
122
+
123
+ /**
124
+ * How a rule narrows which edges it judges.
125
+ *
126
+ * Separate from `CodependixBoundarySelector`, which picks the nodes at either
127
+ * end: this is about the edge itself, and only the Nx level draws an edge with
128
+ * an attribute worth narrowing on.
129
+ */
130
+ export declare interface CodependixBoundaryEdgeSelector {
131
+ /**
132
+ * Judge only implicit edges, or only explicit ones.
133
+ *
134
+ * `false` is what makes a rule mean exactly what an
135
+ * `@nx/enforce-module-boundaries` `depConstraint` means: that rule reads
136
+ * import statements, so an `implicitDependencies` entry is invisible to it.
137
+ * `true` inverts it — useful for finding the edges declared in
138
+ * configuration that no import backs. Unset judges both, which is the
139
+ * stricter reading and the right default for a rule about what a project
140
+ * may depend on rather than about what it may import.
141
+ *
142
+ * Every level that is not `nx` draws only explicit edges, so a rule naming
143
+ * `implicit: true` there selects nothing.
144
+ */
145
+ implicit?: boolean | undefined;
146
+ }
147
+
148
+ /** One declared rule, of either kind. */
149
+ export declare type CodependixBoundaryRule = CodependixBoundaryAccessRule | CodependixBoundaryAcyclicRule;
150
+
151
+ /**
152
+ * How a rule picks the nodes at one end of an edge.
153
+ *
154
+ * Four vocabularies, one node shape: an Nx project is selected by name or by
155
+ * tag, a file by its project-relative path, a NestJS module only by its class
156
+ * name — see `NestjsModuleGraph`, which carries no file path at all. Every
157
+ * field is a list of globs, matched with `path.matchesGlob`, and a node
158
+ * matches the selector when it matches every field the selector states.
159
+ * Within one field, one glob matching is enough.
160
+ *
161
+ * A selector stating no field at all is refused rather than read as "every
162
+ * node": the two are indistinguishable in a configuration file, and reading
163
+ * it as everything turns a typo into a rule that judges the whole workspace.
164
+ */
165
+ export declare interface CodependixBoundarySelector {
166
+ /** Globs matched against the node's identifier. */
167
+ id?: string[] | undefined;
168
+ /** Globs matched against the node's path, where its level carries one. */
169
+ path?: string[] | undefined;
170
+ /** Globs matched against the Nx project the node belongs to. */
171
+ project?: string[] | undefined;
172
+ /** Globs matched against the node's Nx tags; one tag matching is enough. */
173
+ tags?: string[] | undefined;
174
+ }
175
+
176
+ /**
177
+ * Configuration authored in a `codependix.config.ts` file.
178
+ *
179
+ * Every field is optional: a workspace with no configuration file at all
180
+ * resolves every graph type for every project to `target: "none"`, so
181
+ * codependix produces nothing until it is told where to write.
182
+ */
183
+ export declare interface CodependixConfiguration {
184
+ /**
185
+ * Rules every built graph is judged against, keyed by graph level.
186
+ *
187
+ * Separate from a project's own `codependix.config.ts`, which says where
188
+ * that project's export is written: a rule has no destination, and a
189
+ * violation is reported to the console and the exit code rather than
190
+ * published anywhere.
191
+ */
192
+ boundaries?: CodependixBoundariesConfiguration | undefined;
193
+ /** Project names or roots excluded from every graph, as globs. */
194
+ exclude?: string[] | undefined;
195
+ /** Project names or roots participating in graph export, as globs. */
196
+ include?: string[] | undefined;
197
+ /**
198
+ * A project graph to read instead of resolving the working directory's.
199
+ *
200
+ * A path, relative to the workspace root, to the JSON `nx graph
201
+ * --file=graph.json` emits. Nx resolves a project graph from the process
202
+ * working directory and takes no directory argument, so this is the only
203
+ * way to graph a workspace the process is not standing in — a CI job that
204
+ * checked out one repository and graphs another, or a test with no Nx
205
+ * workspace under it.
206
+ *
207
+ * A supplied graph's node roots are workspace-relative and resolve against
208
+ * the same root every export path does.
209
+ */
210
+ projectGraph?: string | undefined;
211
+ /**
212
+ * Export configuration for the whole-workspace Workspace Graph.
213
+ *
214
+ * Separate from `defaults`/`projects`: the Workspace Graph is exported once
215
+ * for the entire repository rather than once per project, so it carries no
216
+ * per-project override and is unaffected by `include`/`exclude`.
217
+ *
218
+ * `--projects` and `--tags` do reach it: a run naming a selection narrows
219
+ * the graph's node set to the projects it named. Its destination is still
220
+ * read from `workspace` either way.
221
+ */
222
+ workspace?: CodependixWorkspaceConfiguration | undefined;
223
+ }
224
+
225
+ /**
226
+ * Strict, per-field CLI overrides for a run's root configuration.
227
+ *
228
+ * Mirrors `@callidescope/configuration`'s override philosophy exactly: a
229
+ * field may be overridden only when the configuration this run reads already
230
+ * declared it — see `ConfigurationService.loadConfiguration`. An empty list is
231
+ * read the same as the field being left off entirely, matching how
232
+ * `--directories`/`--exclude` treat an empty list in callidescope.
233
+ */
234
+ export declare interface CodependixConfigurationOverrides {
235
+ /** Overrides `exclude` for this run. */
236
+ exclude?: string[] | undefined;
237
+ /** Overrides `include` for this run. */
238
+ include?: string[] | undefined;
239
+ }
240
+
241
+ /**
242
+ * Validates a codependix configuration file's contents.
243
+ *
244
+ * Zod strips unknown keys rather than rejecting them, so a configuration
245
+ * written for a newer codependix still loads under an older one instead of
246
+ * failing on a field it has no opinion about.
247
+ */
248
+ export declare const codependixConfigurationSchema: z.ZodObject<{
249
+ boundaries: z.ZodOptional<z.ZodObject<{
250
+ fileImports: z.ZodOptional<z.ZodObject<{
251
+ python: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
252
+ edges: z.ZodOptional<z.ZodObject<{
253
+ implicit: z.ZodOptional<z.ZodBoolean>;
254
+ }, z.core.$strip>>;
255
+ from: z.ZodObject<{
256
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
257
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
258
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
259
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
260
+ }, z.core.$strip>;
261
+ kind: z.ZodEnum<{
262
+ allow: "allow";
263
+ forbid: "forbid";
264
+ }>;
265
+ message: z.ZodOptional<z.ZodString>;
266
+ name: z.ZodString;
267
+ to: z.ZodObject<{
268
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
269
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
270
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
271
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
272
+ }, z.core.$strip>;
273
+ }, z.core.$strip>, z.ZodObject<{
274
+ kind: z.ZodLiteral<"acyclic">;
275
+ message: z.ZodOptional<z.ZodString>;
276
+ name: z.ZodString;
277
+ nodes: z.ZodOptional<z.ZodObject<{
278
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
279
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
280
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
281
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
282
+ }, z.core.$strip>>;
283
+ }, z.core.$strip>]>>>;
284
+ typescript: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
285
+ edges: z.ZodOptional<z.ZodObject<{
286
+ implicit: z.ZodOptional<z.ZodBoolean>;
287
+ }, z.core.$strip>>;
288
+ from: z.ZodObject<{
289
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
290
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
291
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
292
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
293
+ }, z.core.$strip>;
294
+ kind: z.ZodEnum<{
295
+ allow: "allow";
296
+ forbid: "forbid";
297
+ }>;
298
+ message: z.ZodOptional<z.ZodString>;
299
+ name: z.ZodString;
300
+ to: z.ZodObject<{
301
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
302
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
303
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
304
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
305
+ }, z.core.$strip>;
306
+ }, z.core.$strip>, z.ZodObject<{
307
+ kind: z.ZodLiteral<"acyclic">;
308
+ message: z.ZodOptional<z.ZodString>;
309
+ name: z.ZodString;
310
+ nodes: z.ZodOptional<z.ZodObject<{
311
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
312
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
313
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
314
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
315
+ }, z.core.$strip>>;
316
+ }, z.core.$strip>]>>>;
317
+ }, z.core.$strip>>;
318
+ nestjsModules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
319
+ edges: z.ZodOptional<z.ZodObject<{
320
+ implicit: z.ZodOptional<z.ZodBoolean>;
321
+ }, z.core.$strip>>;
322
+ from: z.ZodObject<{
323
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
324
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
325
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
326
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
327
+ }, z.core.$strip>;
328
+ kind: z.ZodEnum<{
329
+ allow: "allow";
330
+ forbid: "forbid";
331
+ }>;
332
+ message: z.ZodOptional<z.ZodString>;
333
+ name: z.ZodString;
334
+ to: z.ZodObject<{
335
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
336
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
337
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
338
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
+ }, z.core.$strip>;
340
+ }, z.core.$strip>, z.ZodObject<{
341
+ kind: z.ZodLiteral<"acyclic">;
342
+ message: z.ZodOptional<z.ZodString>;
343
+ name: z.ZodString;
344
+ nodes: z.ZodOptional<z.ZodObject<{
345
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
346
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
347
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
348
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
349
+ }, z.core.$strip>>;
350
+ }, z.core.$strip>]>>>;
351
+ nxProjects: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
352
+ edges: z.ZodOptional<z.ZodObject<{
353
+ implicit: z.ZodOptional<z.ZodBoolean>;
354
+ }, z.core.$strip>>;
355
+ from: z.ZodObject<{
356
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
357
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
358
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
359
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
360
+ }, z.core.$strip>;
361
+ kind: z.ZodEnum<{
362
+ allow: "allow";
363
+ forbid: "forbid";
364
+ }>;
365
+ message: z.ZodOptional<z.ZodString>;
366
+ name: z.ZodString;
367
+ to: z.ZodObject<{
368
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
369
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
370
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
371
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
372
+ }, z.core.$strip>;
373
+ }, z.core.$strip>, z.ZodObject<{
374
+ kind: z.ZodLiteral<"acyclic">;
375
+ message: z.ZodOptional<z.ZodString>;
376
+ name: z.ZodString;
377
+ nodes: z.ZodOptional<z.ZodObject<{
378
+ id: z.ZodOptional<z.ZodArray<z.ZodString>>;
379
+ path: z.ZodOptional<z.ZodArray<z.ZodString>>;
380
+ project: z.ZodOptional<z.ZodArray<z.ZodString>>;
381
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
382
+ }, z.core.$strip>>;
383
+ }, z.core.$strip>]>>>;
384
+ }, z.core.$strip>>;
385
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
386
+ include: z.ZodOptional<z.ZodArray<z.ZodString>>;
387
+ projectGraph: z.ZodOptional<z.ZodString>;
388
+ workspace: z.ZodOptional<z.ZodObject<{
389
+ fileImports: z.ZodOptional<z.ZodObject<{
390
+ json: z.ZodOptional<z.ZodObject<{
391
+ path: z.ZodString;
392
+ }, z.core.$strip>>;
393
+ markdown: z.ZodOptional<z.ZodObject<{
394
+ anchor: z.ZodOptional<z.ZodString>;
395
+ path: z.ZodOptional<z.ZodString>;
396
+ }, z.core.$strip>>;
397
+ target: z.ZodOptional<z.ZodEnum<{
398
+ both: "both";
399
+ json: "json";
400
+ markdown: "markdown";
401
+ none: "none";
402
+ }>>;
403
+ }, z.core.$strip>>;
404
+ nestjsModules: z.ZodOptional<z.ZodObject<{
405
+ json: z.ZodOptional<z.ZodObject<{
406
+ path: z.ZodString;
407
+ }, z.core.$strip>>;
408
+ markdown: z.ZodOptional<z.ZodObject<{
409
+ anchor: z.ZodOptional<z.ZodString>;
410
+ path: z.ZodOptional<z.ZodString>;
411
+ }, z.core.$strip>>;
412
+ target: z.ZodOptional<z.ZodEnum<{
413
+ both: "both";
414
+ json: "json";
415
+ markdown: "markdown";
416
+ none: "none";
417
+ }>>;
418
+ }, z.core.$strip>>;
419
+ nxProjects: z.ZodOptional<z.ZodObject<{
420
+ json: z.ZodOptional<z.ZodObject<{
421
+ path: z.ZodString;
422
+ }, z.core.$strip>>;
423
+ markdown: z.ZodOptional<z.ZodObject<{
424
+ anchor: z.ZodOptional<z.ZodString>;
425
+ path: z.ZodOptional<z.ZodString>;
426
+ }, z.core.$strip>>;
427
+ target: z.ZodOptional<z.ZodEnum<{
428
+ both: "both";
429
+ json: "json";
430
+ markdown: "markdown";
431
+ none: "none";
432
+ }>>;
433
+ }, z.core.$strip>>;
434
+ }, z.core.$strip>>;
435
+ }, z.core.$strip>;
436
+
437
+ /**
438
+ * Where a graph type's export lands for a project.
439
+ *
440
+ * `both` writes the JSON and the Markdown export together. Named explicitly
441
+ * rather than inferred from which destinations are configured, so a project
442
+ * carrying a `json` destination it does not want written yet can leave it in
443
+ * place with the target set to `markdown`.
444
+ */
445
+ export declare type CodependixExportTarget = "both" | "json" | "markdown" | "none";
446
+
447
+ /**
448
+ * `boundaries.fileImports`'s rules, nested by language.
449
+ *
450
+ * Separate from `CodependixBoundariesConfiguration` so both the authored and
451
+ * resolved shapes (see `ResolvedCodependixFileImportsBoundariesConfiguration`)
452
+ * can name it once rather than repeating the two-field object inline.
453
+ */
454
+ export declare interface CodependixFileImportsBoundariesConfiguration {
455
+ python?: CodependixBoundaryRule[] | undefined;
456
+ typescript?: CodependixBoundaryRule[] | undefined;
457
+ }
458
+
459
+ /** How one graph type's export is configured for a project. */
460
+ export declare interface CodependixGraphOutput {
461
+ json?: CodependixJsonOutput | undefined;
462
+ markdown?: CodependixMarkdownOutput | undefined;
463
+ target?: CodependixExportTarget | undefined;
464
+ }
465
+
466
+ /** A level of dependency graph codependix can build. */
467
+ export declare type CodependixGraphType = "fileImports" | "nestjsModules" | "nxProjects";
468
+
469
+ /** Where a graph's JSON export is written. */
470
+ export declare interface CodependixJsonOutput {
471
+ path: string;
472
+ }
473
+
474
+ /**
475
+ * Where a graph's Markdown export is written.
476
+ *
477
+ * Naming `anchor` places the export inside a named anchor block in the file at
478
+ * `path` — an existing Markdown file such as a project's `README.md`, defaulted
479
+ * to `README.md` when `path` is left out. Leaving `anchor` unset instead writes
480
+ * the export as the whole contents of a standalone file, whose `path` must then
481
+ * be given explicitly since there is no default worth guessing for it.
482
+ */
483
+ export declare interface CodependixMarkdownOutput {
484
+ anchor?: string | undefined;
485
+ path?: string | undefined;
486
+ }
487
+
488
+ /**
489
+ * A project's export configuration, keyed by graph type.
490
+ *
491
+ * Written out field by field rather than as `Partial<Record<...>>`: under
492
+ * `exactOptionalPropertyTypes`, `Partial` makes a field optional without
493
+ * widening its type to include `undefined`, which then rejects the very
494
+ * "unset" value every default-resolution path needs to assign.
495
+ */
496
+ export declare interface CodependixProjectConfiguration {
497
+ fileImports?: CodependixGraphOutput | undefined;
498
+ nestjsModules?: CodependixGraphOutput | undefined;
499
+ nxProjects?: CodependixGraphOutput | undefined;
500
+ }
501
+
502
+ /**
503
+ * Validates a project's own `codependix.config.ts`, keyed by graph type.
504
+ *
505
+ * The same shape a project's own file spreads `projectDefaults` into, and the
506
+ * same shape the root configuration's schema no longer carries — a project's
507
+ * export configuration is validated from its own file rather than from a root
508
+ * `projects` dict.
509
+ */
510
+ export declare const codependixProjectConfigurationSchema: z.ZodObject<{
511
+ fileImports: z.ZodOptional<z.ZodObject<{
512
+ json: z.ZodOptional<z.ZodObject<{
513
+ path: z.ZodString;
514
+ }, z.core.$strip>>;
515
+ markdown: z.ZodOptional<z.ZodObject<{
516
+ anchor: z.ZodOptional<z.ZodString>;
517
+ path: z.ZodOptional<z.ZodString>;
518
+ }, z.core.$strip>>;
519
+ target: z.ZodOptional<z.ZodEnum<{
520
+ both: "both";
521
+ json: "json";
522
+ markdown: "markdown";
523
+ none: "none";
524
+ }>>;
525
+ }, z.core.$strip>>;
526
+ nestjsModules: z.ZodOptional<z.ZodObject<{
527
+ json: z.ZodOptional<z.ZodObject<{
528
+ path: z.ZodString;
529
+ }, z.core.$strip>>;
530
+ markdown: z.ZodOptional<z.ZodObject<{
531
+ anchor: z.ZodOptional<z.ZodString>;
532
+ path: z.ZodOptional<z.ZodString>;
533
+ }, z.core.$strip>>;
534
+ target: z.ZodOptional<z.ZodEnum<{
535
+ both: "both";
536
+ json: "json";
537
+ markdown: "markdown";
538
+ none: "none";
539
+ }>>;
540
+ }, z.core.$strip>>;
541
+ nxProjects: z.ZodOptional<z.ZodObject<{
542
+ json: z.ZodOptional<z.ZodObject<{
543
+ path: z.ZodString;
544
+ }, z.core.$strip>>;
545
+ markdown: z.ZodOptional<z.ZodObject<{
546
+ anchor: z.ZodOptional<z.ZodString>;
547
+ path: z.ZodOptional<z.ZodString>;
548
+ }, z.core.$strip>>;
549
+ target: z.ZodOptional<z.ZodEnum<{
550
+ both: "both";
551
+ json: "json";
552
+ markdown: "markdown";
553
+ none: "none";
554
+ }>>;
555
+ }, z.core.$strip>>;
556
+ }, z.core.$strip>;
557
+
558
+ /**
559
+ * The `--projects` and `--tags` arguments as the command line captured them.
560
+ *
561
+ * Comma-separated strings rather than lists: the host captures raw option
562
+ * text and hands it over, and splitting it is resolution, which belongs
563
+ * beside the configuration file this package already parses.
564
+ */
565
+ export declare interface CodependixSelectionArguments {
566
+ projects?: string | undefined;
567
+ tags?: string | undefined;
568
+ }
569
+
570
+ /**
571
+ * The Workspace Graph's export configuration, keyed by graph type.
572
+ *
573
+ * All three graph types are declared: `codependix-file-imports` and
574
+ * `codependix-nestjs-modules` each build a whole-workspace aggregate graph the
575
+ * same way `codependix-nx-projects` always has, spanning every project rather
576
+ * than one — see each package's own `workspace-graph` module.
577
+ */
578
+ export declare interface CodependixWorkspaceConfiguration {
579
+ fileImports?: CodependixGraphOutput | undefined;
580
+ nestjsModules?: CodependixGraphOutput | undefined;
581
+ nxProjects?: CodependixGraphOutput | undefined;
582
+ }
583
+
584
+ /**
585
+ * File names searched for when no configuration path is given.
586
+ *
587
+ * Searched in order, so a workspace carrying both a TypeScript and a JSON
588
+ * configuration file gets the TypeScript one.
589
+ */
590
+ export declare const CONFIGURATION_FILE_NAMES: readonly ["codependix.config.ts", "codependix.config.mts", "codependix.config.cts", "codependix.config.js", "codependix.config.mjs", "codependix.config.cjs", "codependix.config.json"];
591
+
592
+ /** Raised when an explicitly named configuration file does not exist. */
593
+ export declare class ConfigurationFileNotFoundError extends Error {
594
+ constructor(filePath: string);
595
+ }
596
+
597
+ /**
598
+ * Finds, reads, and parses codependix configuration files from disk.
599
+ *
600
+ * Kept apart from `ConfigurationService`, which resolves what a loaded
601
+ * configuration means for a project or a workspace: this service only ever
602
+ * answers "what is on disk", never "what should happen because of it".
603
+ */
604
+ declare class ConfigurationLoaderService {
605
+ constructor();
606
+ /** Reads what a configuration module exported, through either interop shape. */
607
+ private readDefaultExport;
608
+ /**
609
+ * Walks upward from a directory looking for a configuration file.
610
+ *
611
+ * Returns `undefined` when the search reaches the filesystem root without
612
+ * finding one: a workspace that never wrote a configuration file resolves
613
+ * every graph to `target: "none"` rather than being told to write one.
614
+ */
615
+ findConfigurationFile(searchDirectory: string): string | undefined;
616
+ /**
617
+ * Looks for a project's own configuration file, exactly at its root.
618
+ *
619
+ * Unlike `findConfigurationFile`, this never walks upward: a project's own
620
+ * file must be colocated with it, and walking upward would find the
621
+ * workspace root's configuration — or another project's, in a nested
622
+ * layout — instead of correctly reporting that this project has none.
623
+ */
624
+ findProjectConfigurationFile(projectRoot: string): string | undefined;
625
+ /**
626
+ * Walks upward from the process cwd looking for the workspace root.
627
+ *
628
+ * Used to resolve a configuration path given relative to that root even when
629
+ * the command was invoked from a nested directory, which is what a task
630
+ * runner does whenever it sets the cwd to a project rather than the
631
+ * workspace.
632
+ */
633
+ findWorkspaceRoot(): string | undefined;
634
+ /** Loads a configuration module, choosing the reader by extension. */
635
+ loadConfigurationModule(args: {
636
+ configurationPath: string;
637
+ extension: string;
638
+ }): Promise<unknown>;
639
+ /** Loads and validates one configuration file at a resolved path. */
640
+ parseConfigurationFile(resolvedPath: string): Promise<CodependixConfiguration>;
641
+ /** Reads the root configuration file, or `{}` when none is found. */
642
+ readAuthoredConfiguration(args: {
643
+ configurationPath?: string | undefined;
644
+ searchDirectory?: string | undefined;
645
+ }): Promise<CodependixConfiguration>;
646
+ /** Resolves a configuration path against the cwd, then the workspace root. */
647
+ resolveConfigurationPath(configurationPath: string): string;
648
+ }
649
+
650
+ /**
651
+ * Provides everything one run is configured by: the configuration file, the
652
+ * command line resolved over it, and each project's own resolved output.
653
+ *
654
+ * `ConfigurationService` is the only thing this module exports, and the only
655
+ * service `@codependix/configuration` makes public. File loading, override
656
+ * resolution, option parsing, and run-mode selection are providers here
657
+ * rather than modules of their own, so a caller asking what a run is
658
+ * configured to do has exactly one place to ask.
659
+ */
660
+ export declare class ConfigurationModule {
661
+ }
662
+
663
+ /**
664
+ * Loads, validates, and resolves codependix configuration files.
665
+ *
666
+ * Loading and per-project resolution are kept apart on purpose: a project's
667
+ * actual export configuration depends on both the global defaults and its own
668
+ * name, so resolving it eagerly for every project in the workspace would mean
669
+ * redoing that work for a workspace whose graphs run against a filtered subset
670
+ * of projects. `resolveForProject` is called once per project that is
671
+ * actually built instead.
672
+ */
673
+ export declare class ConfigurationService {
674
+ private readonly configurationLoaderService;
675
+ private readonly flagResolutionService;
676
+ private readonly inputService;
677
+ private readonly overrideResolutionService;
678
+ constructor(configurationLoaderService: ConfigurationLoaderService, flagResolutionService: FlagResolutionService, inputService: InputService, overrideResolutionService: OverrideResolutionService);
679
+ /** Whether `--projects` or `--tags` names a project. */
680
+ private isProjectNamedOnCommandLine;
681
+ /** Whether a project's name matches at least one of a list of globs. */
682
+ private matchesAnyGlob;
683
+ /** Whether a project's name or its root matches at least one glob. */
684
+ private matchesAnyName;
685
+ /**
686
+ * Fills in every graph level a `boundaries` block may leave out.
687
+ *
688
+ * Every level resolves to a list rather than to `undefined`, so a caller
689
+ * walks all of them without asking which ones were configured — the same
690
+ * reason `include` resolves to a list nobody wrote. `fileImports` resolves
691
+ * both of its languages the same way, one level deeper.
692
+ */
693
+ private resolveBoundaries;
694
+ /** Applies defaults to one graph type's export configuration. */
695
+ private resolveGraphOutput;
696
+ /**
697
+ * Splits the `--projects` and `--tags` arguments into lists.
698
+ *
699
+ * Empty entries are dropped, so a trailing comma and a doubled one are both
700
+ * read as the author meant them rather than as a glob matching nothing.
701
+ */
702
+ private resolveSelection;
703
+ /** Splits one comma-separated argument, trimming and dropping blanks. */
704
+ private splitSelectionArgument;
705
+ /**
706
+ * Whether a project participates in graph export at all.
707
+ *
708
+ * A project matches when something claims it — an `include` glob, a
709
+ * `--projects` glob, or a `--tags` tag — and no `exclude` glob claims its
710
+ * name or root. The command line **widens** what the configuration already
711
+ * selects rather than replacing it; `exclude` wins over all three, because
712
+ * a flag that could resurrect an excluded project would make `exclude`
713
+ * advisory.
714
+ *
715
+ * `projectRoot` and `projectTags` are optional: a caller with neither handy
716
+ * still resolves against globs written against project names.
717
+ */
718
+ isProjectIncluded(args: ProjectSelectionArguments): boolean;
719
+ /**
720
+ * Whether a project is in the set a run's command line narrowed to.
721
+ *
722
+ * A run naming no selection selects **everything**, which is what keeps the
723
+ * whole-workspace graph and the boundary gate judging every project by
724
+ * default. Naming one narrows both to what it named.
725
+ *
726
+ * This is where `--projects`/`--tags` differ from `include`: `include` is
727
+ * about which projects have exports written for them, and never reaches the
728
+ * workspace graph or the gate. A selection reaches all three.
729
+ */
730
+ isProjectSelected(args: ProjectSelectionArguments): boolean;
731
+ /**
732
+ * Loads and validates a codependix configuration file.
733
+ *
734
+ * A path that was named explicitly must exist — a typo in a task runner's
735
+ * arguments should fail rather than quietly resolving every graph to
736
+ * `target: "none"`. A path that was not named is searched for from the
737
+ * search directory upward, and its absence is legal.
738
+ */
739
+ loadConfiguration(args?: LoadConfigurationArguments): Promise<ResolvedCodependixConfiguration>;
740
+ /**
741
+ * Loads and validates one project's own `codependix.config.ts`, or
742
+ * `undefined` when it has none.
743
+ *
744
+ * Searched for exactly at `projectRoot` — see
745
+ * `ConfigurationLoaderService.findProjectConfigurationFile` — rather than
746
+ * the upward search `loadConfiguration` performs for the workspace root's
747
+ * own file: a project's file is either colocated with it or it does not
748
+ * exist, and a project with none produces no per-project output rather than
749
+ * inheriting one from a parent directory.
750
+ */
751
+ loadProjectConfiguration(args: LoadProjectConfigurationArguments): Promise<CodependixProjectConfiguration | undefined>;
752
+ /**
753
+ * Parses a comma-separated list option, dropping blank entries.
754
+ *
755
+ * One of the six command-line methods this service forwards to the
756
+ * `input` and flag-resolution providers it owns. They are stated here
757
+ * rather than exported alongside it because this package makes exactly one
758
+ * service public: a host asking what a run is configured to do — from its
759
+ * configuration file or from its flags — asks `ConfigurationService`.
760
+ */
761
+ parseCommaDelimitedOption(value: string | undefined): string[];
762
+ /** Parses a valueless boolean flag, which is present or it is not. */
763
+ parseFlagOption(value: boolean | undefined): boolean;
764
+ /** Trims an optional string option, treating blank as absent. */
765
+ parseOptionalOption(value: string | undefined): string | undefined;
766
+ /** Parses a path option that falls back to the working directory. */
767
+ parsePathOption(value: string | undefined): string;
768
+ /**
769
+ * Fills in every field a configuration file may leave out.
770
+ *
771
+ * Exposed so a host embedding codependix can hand over a configuration
772
+ * object it assembled itself and get the same shape a configuration file
773
+ * produces.
774
+ */
775
+ resolveConfiguration(configuration: CodependixConfiguration, selection?: CodependixSelectionArguments): ResolvedCodependixConfiguration;
776
+ /**
777
+ * Resolves one project's export configuration for one graph type.
778
+ *
779
+ * A project's own `codependix.config.ts`, when it has one, is read exactly
780
+ * as loaded — no merge against a workspace-wide default happens here, since
781
+ * spreading the root-exported `projectDefaults` already happened when the
782
+ * project's own file was authored. A project excluded by the configured
783
+ * `include`/`exclude` globs, or one that has no configuration file of its
784
+ * own at all, always resolves to `target: "none"`: the former because a
785
+ * project excluded from graph export should not need every field rewritten
786
+ * to `"none"` by hand, the latter because a project matched by `include`
787
+ * with no file of its own has nothing to export, even though it still
788
+ * contributes to the Workspace Graph and is judged by boundary rules.
789
+ */
790
+ resolveForProject(args: ResolveForProjectArguments): ResolvedCodependixGraphOutput;
791
+ /**
792
+ * Resolves the Workspace Graph's export configuration for one graph type.
793
+ *
794
+ * A Workspace Graph is exported once for the whole repository rather than
795
+ * once per project, so it has no per-project override and is unaffected by
796
+ * `include`/`exclude` — those two apply only to `resolveForProject`.
797
+ *
798
+ * `--projects` and `--tags` do reach it, through the node set rather than
799
+ * through this: a run naming a selection draws the graph over the projects
800
+ * it named. Where that graph lands is still read from `workspace`, keyed by
801
+ * `graphType`.
802
+ */
803
+ resolveForWorkspace(configuration: ResolvedCodependixConfiguration, graphType: CodependixGraphType): ResolvedCodependixGraphOutput;
804
+ /**
805
+ * Reads the flags into what the run writes and what it fails on.
806
+ *
807
+ * See `FlagResolutionService.selectMode` for which combinations are
808
+ * refused and why.
809
+ */
810
+ selectMode(options: MapCommandOptions): Promise<RunModeSelection>;
811
+ /** Whether a run reads or rewrites the files its exports live in. */
812
+ touchesFiles(mode: RunMode): boolean;
813
+ }
814
+
815
+ /** Export target applied to a graph type naming none. */
816
+ export declare const DEFAULT_EXPORT_TARGET: CodependixExportTarget;
817
+
818
+ /**
819
+ * Projects that participate in graph export when a configuration names none.
820
+ *
821
+ * Deliberately empty: participation is always declared. A configuration that
822
+ * names `defaults` but no `include` exports nothing rather than quietly
823
+ * covering the whole workspace, which is what lets a later widening argument
824
+ * mean something — a union with `["**"]` as its base can never add a project.
825
+ */
826
+ export declare const DEFAULT_INCLUDE_GLOBS: readonly [];
827
+
828
+ /** Markdown file an anchor-mode destination writes into when it names none. */
829
+ export declare const DEFAULT_MARKDOWN_PATH = "README.md";
830
+
831
+ /**
832
+ * Reads the command line into what the run will do.
833
+ *
834
+ * Internal to the `configuration` module rather than a module of its own:
835
+ * resolving the command line is half of answering "what is this run actually
836
+ * configured to do", and `ConfigurationService` is the one public way to ask.
837
+ * `codometer-cli` and `callidescope-cli` still carry a `run-plan` module of
838
+ * this shape inside their hosts — and, deliberately, the same `--check
839
+ * reports` spelling, since a stale configured destination is one finding
840
+ * across all three.
841
+ */
842
+ declare class FlagResolutionService {
843
+ private readonly inputService;
844
+ constructor(inputService: InputService);
845
+ /** States what `--check` accepts, in front of whatever went wrong. */
846
+ private describeAcceptedCheckNames;
847
+ /** The mode nothing was selected for, so an error path has one to return. */
848
+ private emptyMode;
849
+ /**
850
+ * Asks which of the three things a run with no flags at all should do.
851
+ *
852
+ * Nothing is inferred: a session that cannot be asked fails rather than
853
+ * defaulting to a write nobody requested, and a run that quietly did
854
+ * nothing and exited 0 is worse than either.
855
+ */
856
+ private promptForMode;
857
+ /**
858
+ * Reads the `--check` value into the set of things the run fails on.
859
+ *
860
+ * A flag passed without a value arrives as `true` and is a mistake rather
861
+ * than a shorthand: read as "gate nothing" it would be a gate that cannot
862
+ * fail, and `--check "$GATES"` with the variable unset would pass forever
863
+ * over a workspace whose every rule was broken — worse than no gate at all,
864
+ * because it looks like protection.
865
+ */
866
+ private readCheckNames;
867
+ /** Keeps the names `--check` knows and complains about the rest. */
868
+ private validateCheckNames;
869
+ /**
870
+ * Reads the flags into what the run writes and what it fails on.
871
+ *
872
+ * `--write --check reports` is refused rather than obeyed: nothing can be
873
+ * stale immediately after being written, so a run asking for both has
874
+ * misunderstood one of them and would pass whatever it was meant to catch.
875
+ * `--write --check boundaries` is legal for the mirror-image reason — a
876
+ * boundary has no destination to be stale, so writing every export and
877
+ * judging every graph in one run is two independent things, not a
878
+ * contradiction.
879
+ */
880
+ selectMode(options: MapCommandOptions): Promise<RunModeSelection>;
881
+ /**
882
+ * Whether a run reads or rewrites the files its exports live in.
883
+ *
884
+ * `--check boundaries` alone reads no destination and writes nothing, so it
885
+ * leaves every committed export exactly as it found it — which is what
886
+ * makes it safe on a branch, where the exports are expected to be behind.
887
+ */
888
+ touchesFiles(mode: RunMode): boolean;
889
+ }
890
+
891
+ /**
892
+ * Thrown when a command line cannot be turned into a run.
893
+ *
894
+ * One class rather than one per cause: every cause is the same event to
895
+ * whoever catches it — nothing was attempted, and the fix is to retype the
896
+ * flags. Only the wording varies, which is what the factories below do.
897
+ *
898
+ * Sits beside the constants because that is where every error class in this
899
+ * repository lives — the project structure rule has no `errors` suffix, and
900
+ * the Constant File Shape rule whitelists `class X extends Error` for exactly
901
+ * this.
902
+ */
903
+ export declare class InputError extends Error {
904
+ constructor(message: string);
905
+ }
906
+
907
+ /**
908
+ * Parses CLI option values and asks for the ones a command still needs.
909
+ *
910
+ * Lives here rather than in `codependix-cli` so the shared flag rules are
911
+ * stated once, beside the configuration those flags select. Mirrors
912
+ * `@callidescope/configuration`'s `InputService`.
913
+ */
914
+ declare class InputService {
915
+ constructor();
916
+ /** Overridable so tests never touch a real terminal. */
917
+ private readonly promptRunner;
918
+ /**
919
+ * Refuses to draw a prompt nobody can answer.
920
+ *
921
+ * `prompts` does not fail on a non-terminal stdin — it renders the menu,
922
+ * never resolves, and lets the process exit 0, so a run that did nothing
923
+ * reads as one that succeeded. `isTTY` is read as falsy rather than
924
+ * coerced: `@types/node` calls it a `boolean`, so lint rejects a coercion.
925
+ */
926
+ private assertCanPrompt;
927
+ /**
928
+ * Parses a comma-separated list option, dropping blank entries.
929
+ *
930
+ * Mirrors `@callidescope/configuration`'s `InputService` exactly: an absent
931
+ * flag resolves to an empty list rather than `undefined`, so a caller
932
+ * overriding a configured list treats "the flag was left off" and "the flag
933
+ * named nothing" the same way.
934
+ */
935
+ parseCommaDelimitedOption(value: string | undefined): string[];
936
+ /**
937
+ * Parses a valueless boolean flag, which is present or it is not.
938
+ *
939
+ * Commander passes `undefined` for a flag carrying no value, so the flag
940
+ * appearing at all is what makes it true; reading that as false would turn
941
+ * every such flag permanently off.
942
+ */
943
+ parseFlagOption(value: boolean | undefined): boolean;
944
+ /** Trims an optional string option, treating blank as absent. */
945
+ parseOptionalOption(value: string | undefined): string | undefined;
946
+ /**
947
+ * Parses a path option that falls back to the working directory.
948
+ *
949
+ * Left unresolved: the caller resolves it against its own root, and
950
+ * resolving twice makes a relative path ambiguous about which it meant.
951
+ */
952
+ parsePathOption(value: string | undefined): string;
953
+ /** Prompts for one value out of a fixed set of choices. */
954
+ promptForSelect<Choice extends string>(args: {
955
+ choices: readonly Choice[];
956
+ message: string;
957
+ subject: string;
958
+ }): Promise<Choice>;
959
+ }
960
+
961
+ /** Arguments accepted when loading a configuration file. */
962
+ export declare interface LoadConfigurationArguments {
963
+ configurationPath?: string | undefined;
964
+ /** Strict per-field CLI overrides, applied after the file is resolved. */
965
+ overrides?: CodependixConfigurationOverrides | undefined;
966
+ searchDirectory?: string | undefined;
967
+ /** Command-line project selection, unparsed — see `CodependixSelectionArguments`. */
968
+ selection?: CodependixSelectionArguments | undefined;
969
+ }
970
+
971
+ /** Arguments accepted when loading one project's own configuration file. */
972
+ export declare interface LoadProjectConfigurationArguments {
973
+ /** The project's root, absolute or resolved against the process cwd. */
974
+ projectRoot: string;
975
+ }
976
+
977
+ /** Command-line options `codependix` accepts. */
978
+ export declare interface MapCommandOptions {
979
+ /**
980
+ * The set of findings `--check` gates, unparsed.
981
+ *
982
+ * `true` is the flag written with no value at all, which is refused rather
983
+ * than read as a shorthand — see `ConfigurationService.selectMode`.
984
+ */
985
+ check?: string | true | undefined;
986
+ config?: string | undefined;
987
+ directory?: string | undefined;
988
+ /** Overrides `exclude` for this run. Refused when never configured. */
989
+ exclude?: string[] | undefined;
990
+ /**
991
+ * Builds, checks, and writes the `fileImports` graph type for this run.
992
+ *
993
+ * `undefined` when neither `--file-imports` nor `--no-file-imports` was
994
+ * given, which leaves the graph type enabled — the behavior every run had
995
+ * before this flag existed.
996
+ */
997
+ fileImports?: boolean | undefined;
998
+ /**
999
+ * What `--format` prints to standard output, unparsed.
1000
+ *
1001
+ * Defaults to `"markdown"` when the flag was left off entirely — unlike
1002
+ * codometer's `--format`, which falls back to a resolved configuration
1003
+ * field, codependix's configuration declares no such field, so the default
1004
+ * is a fixed constant instead.
1005
+ */
1006
+ format?: string | undefined;
1007
+ /** Overrides `include` for this run. Refused when never configured. */
1008
+ include?: string[] | undefined;
1009
+ /**
1010
+ * Writes every active graph type's data, combined into one JSON file at
1011
+ * this path, keyed by graph type name.
1012
+ */
1013
+ jsonOutput?: string | undefined;
1014
+ /**
1015
+ * Writes every active graph type's rendered diagram, combined into one
1016
+ * Markdown file at this path — each type's own anchor-spliced section,
1017
+ * the same splicing `DeliveryService` applies per project, applied here to
1018
+ * one shared destination instead.
1019
+ */
1020
+ markdownOutput?: string | undefined;
1021
+ /** Builds, checks, and writes the `nestjsModules` graph type for this run. */
1022
+ nestjsModules?: boolean | undefined;
1023
+ /** Builds, checks, and writes the `nxProjects` graph type for this run. */
1024
+ nxProjects?: boolean | undefined;
1025
+ /**
1026
+ * Projects to export for beyond what `include` already selects, unparsed.
1027
+ *
1028
+ * Comma-separated globs matched against a project's name or its
1029
+ * workspace-relative root.
1030
+ */
1031
+ projects?: string | undefined;
1032
+ /** Nx tags to export for beyond what `include` selects, unparsed. */
1033
+ tags?: string | undefined;
1034
+ write?: boolean | undefined;
1035
+ }
1036
+
1037
+ /**
1038
+ * A required value that cannot be asked for, because stdin is not a terminal.
1039
+ *
1040
+ * `prompts` does not fail there — it draws its menu, never resolves, and the
1041
+ * process exits 0 having done nothing. This refuses to become that silent
1042
+ * green no-op.
1043
+ */
1044
+ export declare const missingInputError: (subject: string) => InputError;
1045
+
1046
+ /**
1047
+ * Applies strict, per-field CLI overrides to an already-resolved
1048
+ * configuration.
1049
+ *
1050
+ * Mirrors `@callidescope/configuration`'s `FlagResolutionService` philosophy
1051
+ * exactly: a flag may override a value the configuration already declares,
1052
+ * and is refused when the configuration never declared that field at all.
1053
+ * Kept apart from `ConfigurationService` so the resolution logic — and the
1054
+ * file-length budget it would otherwise share with loading, boundary
1055
+ * defaulting, and per-project resolution — is stated and tested once, on its
1056
+ * own.
1057
+ */
1058
+ declare class OverrideResolutionService {
1059
+ constructor();
1060
+ /**
1061
+ * Applies one list override, refusing it when the author never declared
1062
+ * the field it names.
1063
+ *
1064
+ * Checked against `authored` — the configuration exactly as parsed, before
1065
+ * `include`/`exclude` are defaulted — rather than against the resolved
1066
+ * value: `ConfigurationService.resolveConfiguration` fills in
1067
+ * `DEFAULT_INCLUDE_GLOBS`/`[]` for a field the author never wrote, so the
1068
+ * resolved value is never itself `undefined`. Checking there would make
1069
+ * every override legal regardless of what the configuration actually
1070
+ * declared, which is the opposite of the precedence rule this mirrors.
1071
+ *
1072
+ * An empty override list is read the same as no override at all.
1073
+ */
1074
+ private resolveOverride;
1075
+ /**
1076
+ * Applies `--include`/`--exclude` on top of an already-resolved
1077
+ * configuration.
1078
+ */
1079
+ applyOverrides(args: ApplyOverridesArguments): ResolvedCodependixConfiguration;
1080
+ }
1081
+
1082
+ /** Arguments accepted when resolving one project's export configuration. */
1083
+ export declare interface ProjectSelectionArguments {
1084
+ configuration: ResolvedCodependixConfiguration;
1085
+ projectName: string;
1086
+ /**
1087
+ * The project's root, relative to the workspace, as read from the Nx
1088
+ * project graph.
1089
+ *
1090
+ * Optional so a caller with no root handy — a test, or a host that only
1091
+ * knows a project by name — still resolves against `include`/`exclude`
1092
+ * globs written against project names.
1093
+ */
1094
+ projectRoot?: string | undefined;
1095
+ /**
1096
+ * The project's own Nx tags, for matching `--tags`.
1097
+ *
1098
+ * Optional for the same reason `projectRoot` is: a caller that knows a
1099
+ * project only by name still resolves against everything else.
1100
+ */
1101
+ projectTags?: string[] | undefined;
1102
+ }
1103
+
1104
+ /**
1105
+ * A prompt someone dismissed without answering.
1106
+ *
1107
+ * Worded apart from a prompt that resolved to something unrecognized:
1108
+ * pressing escape is ordinary, and reporting it as a crash sends the reader
1109
+ * debugging for nothing.
1110
+ */
1111
+ export declare const promptCancelledError: (subject: string) => InputError;
1112
+
1113
+ /**
1114
+ * Marks the workspace root during an upward search from the process cwd.
1115
+ *
1116
+ * A package manifest is deliberately not one of them: every project in the
1117
+ * workspace carries one, so the search would stop at the nearest project
1118
+ * rather than the root a configuration path was written relative to.
1119
+ */
1120
+ export declare const REPOSITORY_ROOT_MARKERS: readonly [".git", "pnpm-workspace.yaml"];
1121
+
1122
+ /**
1123
+ * Every graph level's declared rules, with a level naming none resolved to an
1124
+ * empty list rather than left unset — so a caller iterates every level
1125
+ * without asking whether each one was configured.
1126
+ */
1127
+ export declare interface ResolvedCodependixBoundariesConfiguration {
1128
+ fileImports: ResolvedCodependixFileImportsBoundariesConfiguration;
1129
+ nestjsModules: CodependixBoundaryRule[];
1130
+ nxProjects: CodependixBoundaryRule[];
1131
+ }
1132
+
1133
+ /**
1134
+ * Configuration with every default applied.
1135
+ *
1136
+ * Carries no per-project state at all: a project's own export configuration
1137
+ * lives in its own colocated `codependix.config.ts`, loaded on demand by
1138
+ * `ConfigurationService.loadProjectConfiguration` and handed to
1139
+ * `resolveForProject` — which is also where `include` and `exclude` globs
1140
+ * are applied.
1141
+ */
1142
+ export declare interface ResolvedCodependixConfiguration {
1143
+ boundaries: ResolvedCodependixBoundariesConfiguration;
1144
+ exclude: string[];
1145
+ include: string[];
1146
+ /** A project graph to read instead of the working directory's, if named. */
1147
+ projectGraph: string | undefined;
1148
+ /**
1149
+ * What `--projects` and `--tags` named, resolved.
1150
+ *
1151
+ * Carried on the resolved configuration rather than passed alongside it so
1152
+ * that everything already handed a configuration — the export passes, the
1153
+ * workspace graph, and the boundary gate — sees the same selection without
1154
+ * a second argument threaded through each of them.
1155
+ */
1156
+ selection: ResolvedCodependixSelection;
1157
+ workspace: CodependixWorkspaceConfiguration;
1158
+ }
1159
+
1160
+ /** `fileImports`'s rules, resolved so both languages always resolve to a list. */
1161
+ export declare interface ResolvedCodependixFileImportsBoundariesConfiguration {
1162
+ python: CodependixBoundaryRule[];
1163
+ typescript: CodependixBoundaryRule[];
1164
+ }
1165
+
1166
+ /** A graph type's export configuration with every default applied. */
1167
+ export declare interface ResolvedCodependixGraphOutput {
1168
+ json: ResolvedCodependixJsonOutput | undefined;
1169
+ markdown: ResolvedCodependixMarkdownOutput | undefined;
1170
+ target: CodependixExportTarget;
1171
+ }
1172
+
1173
+ /** JSON output destination, unresolved beyond what `CodependixJsonOutput` is. */
1174
+ export declare type ResolvedCodependixJsonOutput = CodependixJsonOutput;
1175
+
1176
+ /** Markdown output destination with its path defaulted. */
1177
+ export declare interface ResolvedCodependixMarkdownOutput {
1178
+ anchor: string | undefined;
1179
+ path: string;
1180
+ }
1181
+
1182
+ /**
1183
+ * A run's project selection, split and trimmed.
1184
+ *
1185
+ * Both lists empty means no selection was made at all, which is not the same
1186
+ * as a selection that matches nothing: an absent selection leaves the
1187
+ * whole-workspace graph and the boundary gate judging every project, while a
1188
+ * selection naming something narrows both to what it names.
1189
+ */
1190
+ export declare interface ResolvedCodependixSelection {
1191
+ /** Globs matched against a project's name or its workspace-relative root. */
1192
+ projects: string[];
1193
+ /** Nx tags, matched exactly against a project's own. */
1194
+ tags: string[];
1195
+ }
1196
+
1197
+ /** Arguments for resolving one project's export configuration. */
1198
+ export declare interface ResolveForProjectArguments extends ProjectSelectionArguments {
1199
+ graphType: CodependixGraphType;
1200
+ /**
1201
+ * The project's own loaded `codependix.config.ts`, or `undefined` when it
1202
+ * has none — see `ConfigurationService.loadProjectConfiguration`.
1203
+ *
1204
+ * Read as-is rather than merged with anything else: a project's own file
1205
+ * already spreads the root-exported `projectDefaults` at authoring time, so
1206
+ * whatever `loadProjectConfiguration` returns is the complete statement of
1207
+ * that project's export configuration. A project naming no file of its own
1208
+ * resolves to `target: "none"` regardless of `include`/`exclude` — it
1209
+ * simply has nothing to export.
1210
+ */
1211
+ projectConfiguration: CodependixProjectConfiguration | undefined;
1212
+ }
1213
+
1214
+ /**
1215
+ * What a command line naming no mode at all is asked to choose between.
1216
+ *
1217
+ * Three choices rather than the two `--check`/`--write` used to offer, since
1218
+ * `--check` now names which finding it gates. Kept as a prompt rather than
1219
+ * defaulted to anything: a run that silently did nothing and exited 0 is the
1220
+ * failure this whole flag arrangement exists to prevent.
1221
+ */
1222
+ export declare const RUN_MODE_CHOICES: readonly ["boundaries", "reports", "write"];
1223
+
1224
+ /** What the prompt calls the thing it is asking for, in its error messages. */
1225
+ export declare const RUN_MODE_SUBJECT = "A run mode (--check or --write)";
1226
+
1227
+ /** Raised when the configuration path points to an unsupported file type. */
1228
+ export declare class UnknownConfigurationFileTypeError extends Error {
1229
+ constructor(filePath: string);
1230
+ }
1231
+
1232
+ export { }