@venizia/vulcan 0.4.9-0 → 0.4.9-2

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 (141) hide show
  1. package/base/extensions/vulcan-guards.ts +48 -41
  2. package/base/hooks/antigravity-guards.ts +2 -2
  3. package/base/hooks/codex-guards.ts +15 -5
  4. package/base/hooks/guard-git.ts +8 -8
  5. package/base/hooks/guard-manifest.ts +4 -5
  6. package/base/hooks/guard-outside.ts +8 -8
  7. package/base/hooks/guard-package.ts +5 -6
  8. package/base/hooks/guard-remote-hosts.ts +6 -7
  9. package/base/hooks/guard-scripting.ts +5 -6
  10. package/base/hooks/guard-writes.ts +8 -9
  11. package/base/hooks/post-tool.ts +2 -2
  12. package/base/hooks/prompt-submit.ts +2 -2
  13. package/base/hooks/session-start.ts +3 -3
  14. package/base/hooks/stop.ts +2 -2
  15. package/base/hooks/subagent-start.ts +2 -2
  16. package/base/skills/docs-update/SKILL.md +4 -2
  17. package/base/skills/visualize-work/SKILL.md +9 -0
  18. package/package.json +3 -3
  19. package/src/agents/atlas-block.ts +43 -43
  20. package/src/agents/codex-hooks.ts +45 -43
  21. package/src/agents/detect.ts +19 -16
  22. package/src/agents/exclude.ts +96 -97
  23. package/src/agents/hooks-json.ts +38 -36
  24. package/src/agents/local.ts +46 -43
  25. package/src/agents/prompt.ts +45 -42
  26. package/src/agents/render.ts +201 -195
  27. package/src/agents/resolve.ts +133 -134
  28. package/src/agents/table.ts +12 -8
  29. package/src/commands/add.command.ts +2 -2
  30. package/src/commands/agents.command.ts +11 -17
  31. package/src/commands/clean.command.ts +6 -6
  32. package/src/commands/doctor.command.ts +4 -4
  33. package/src/commands/init.command.ts +12 -8
  34. package/src/commands/preset.command.ts +2 -2
  35. package/src/commands/profile.command.ts +42 -49
  36. package/src/commands/sync.command.ts +109 -111
  37. package/src/commands/upgrade.command.ts +80 -75
  38. package/src/commands/visualize.command.ts +7 -13
  39. package/src/commands/x.command.ts +55 -50
  40. package/src/common/format.ts +23 -21
  41. package/src/common/json.ts +8 -5
  42. package/src/common/layout-folder.ts +94 -91
  43. package/src/common/paths.ts +14 -12
  44. package/src/config/loader.ts +52 -49
  45. package/src/config/packages.ts +14 -11
  46. package/src/config/schema.ts +3 -3
  47. package/src/create/add-app.ts +519 -509
  48. package/src/create/add-lib.ts +237 -240
  49. package/src/create/bunfig.ts +26 -23
  50. package/src/create/checks.ts +36 -34
  51. package/src/create/diff.ts +21 -23
  52. package/src/create/dockerignore.ts +26 -24
  53. package/src/create/files.ts +7 -5
  54. package/src/create/init-monorepo.ts +75 -80
  55. package/src/create/lib-preset.ts +59 -63
  56. package/src/create/manifest-json.ts +10 -4
  57. package/src/create/names.ts +217 -210
  58. package/src/create/next.ts +26 -23
  59. package/src/create/plan.ts +15 -12
  60. package/src/create/preset-diff.ts +301 -303
  61. package/src/create/preset-menu.ts +38 -32
  62. package/src/create/preset.ts +202 -197
  63. package/src/create/process.ts +79 -72
  64. package/src/create/scratch.ts +48 -49
  65. package/src/create/workspace.ts +404 -396
  66. package/src/doctor/checks.ts +1027 -1014
  67. package/src/doctor/makefile.ts +17 -13
  68. package/src/doctor/runner.ts +88 -118
  69. package/src/doctor/skills.ts +97 -95
  70. package/src/doctor/tags.ts +42 -37
  71. package/src/hooks/codex-patch.ts +25 -22
  72. package/src/hooks/command-view.ts +44 -39
  73. package/src/hooks/decision.ts +37 -37
  74. package/src/hooks/guard-git.ts +51 -49
  75. package/src/hooks/guard-manifest.ts +58 -55
  76. package/src/hooks/guard-outside.ts +93 -91
  77. package/src/hooks/guard-package.ts +82 -79
  78. package/src/hooks/guard-scripting.ts +19 -14
  79. package/src/hooks/guard-writes.ts +154 -149
  80. package/src/hooks/owner-reply.ts +127 -127
  81. package/src/hooks/post-tool.ts +94 -93
  82. package/src/hooks/project-guards.ts +65 -62
  83. package/src/hooks/project-tmp.ts +27 -24
  84. package/src/hooks/remote-hosts.ts +153 -130
  85. package/src/hooks/session-digest.ts +98 -101
  86. package/src/hooks/shell.ts +509 -499
  87. package/src/hooks/subagent-card.ts +11 -7
  88. package/src/hooks/trusted-scripts.ts +106 -104
  89. package/src/init/scaffold.ts +135 -132
  90. package/src/local/clean.ts +38 -36
  91. package/src/local/format.ts +21 -17
  92. package/src/local/scan.ts +144 -138
  93. package/src/manifest/render.ts +110 -104
  94. package/src/owner/card.ts +51 -46
  95. package/src/owner/profile.ts +99 -93
  96. package/src/owner/reply-switch.ts +9 -6
  97. package/src/owner/shape.ts +71 -69
  98. package/src/owner/survey.ts +173 -171
  99. package/src/owner/view.ts +62 -59
  100. package/src/owner/violations.ts +119 -123
  101. package/src/rules/base.ts +15 -11
  102. package/src/rules/parser.ts +39 -32
  103. package/src/rules/slots.ts +8 -6
  104. package/src/signals/claims.ts +30 -28
  105. package/src/signals/classify.ts +38 -33
  106. package/src/signals/loop.ts +39 -37
  107. package/src/signals/state.ts +79 -81
  108. package/src/skills/frontmatter.ts +28 -28
  109. package/src/sync/agent-files.ts +217 -199
  110. package/src/sync/agent-removal.ts +56 -59
  111. package/src/sync/atlas-block.ts +45 -43
  112. package/src/sync/base-rules.ts +32 -30
  113. package/src/sync/claude-launch.ts +36 -34
  114. package/src/sync/exclude.ts +77 -69
  115. package/src/sync/local-choice.ts +50 -47
  116. package/src/sync/planner.ts +59 -61
  117. package/src/sync/prune.ts +52 -48
  118. package/src/sync/settings.ts +166 -167
  119. package/src/ui/capability.ts +12 -7
  120. package/src/ui/keyboard.ts +38 -38
  121. package/src/ui/prompt.ts +79 -77
  122. package/src/visualize/assets.ts +33 -24
  123. package/src/visualize/charts.ts +179 -176
  124. package/src/visualize/compare-css.ts +3 -2
  125. package/src/visualize/compare-render.ts +9 -7
  126. package/src/visualize/diagrams.ts +189 -174
  127. package/src/visualize/grid-span.ts +34 -0
  128. package/src/visualize/icons.ts +7 -5
  129. package/src/visualize/kinds-render.ts +50 -45
  130. package/src/visualize/kinds-validate.ts +12 -10
  131. package/src/visualize/labels.ts +21 -17
  132. package/src/visualize/layout.ts +112 -97
  133. package/src/visualize/page.ts +92 -104
  134. package/src/visualize/render.ts +143 -140
  135. package/src/visualize/sections.ts +395 -384
  136. package/src/visualize/sources.ts +2 -2
  137. package/src/visualize/theme.ts +12 -10
  138. package/src/visualize/validate.ts +13 -9
  139. package/src/wiki/anchors.ts +38 -36
  140. package/src/wiki/command.ts +4 -4
  141. package/src/wiki/source-links.ts +46 -44
@@ -38,122 +38,125 @@ export class LayoutKeys {
38
38
  }
39
39
  }
40
40
 
41
- /** Why a layout folder is not one, or undefined when it is: 1 to 4 segments, each a plain lower-case name. */
42
- export const layoutFolderProblem = (opts: { folder: unknown }): string | undefined => {
43
- const { folder } = opts;
44
-
45
- if (typeof folder !== 'string' || folder === '') {
46
- return 'a folder is a non-empty string';
47
- }
48
-
49
- if (folder.includes('\\')) {
50
- return `'${folder}' has a backslash: a folder is written with '/'`;
51
- }
41
+ /** Whether `inner` is `outer` or sits below it. */
42
+ const isWithin = (opts: { inner: string; outer: string }): boolean =>
43
+ opts.inner === opts.outer || opts.inner.startsWith(`${opts.outer}/`);
52
44
 
53
- if (folder.startsWith('/') || folder.endsWith('/')) {
54
- return `'${folder}' starts or ends with '/': a folder is a path from the project root`;
45
+ export class LayoutFolder {
46
+ private static entriesOf(opts: { layout: ILayout }): { key: string; folder: string }[] {
47
+ return LayoutKeys.ALL.flatMap((key) =>
48
+ LayoutFolder.layoutFoldersOf({ value: opts.layout[key] }).map((folder) => ({ key, folder })),
49
+ );
55
50
  }
56
51
 
57
- const segments = folder.split('/');
58
-
59
- if (segments.length > LayoutFolderLimits.MAX_SEGMENTS) {
60
- return `'${folder}' has more than ${LayoutFolderLimits.MAX_SEGMENTS} segments`;
61
- }
52
+ /** Why a layout folder is not one, or undefined when it is: 1 to 4 segments, each a plain lower-case name. */
53
+ static layoutFolderProblem(opts: { folder: unknown }): string | undefined {
54
+ const { folder } = opts;
62
55
 
63
- for (const segment of segments) {
64
- if (segment === '') {
65
- return `'${folder}' has an empty segment`;
56
+ if (typeof folder !== 'string' || folder === '') {
57
+ return 'a folder is a non-empty string';
66
58
  }
67
59
 
68
- if (segment === '..' || segment === '.') {
69
- return `'${folder}' climbs or repeats a folder ('${segment}')`;
60
+ if (folder.includes('\\')) {
61
+ return `'${folder}' has a backslash: a folder is written with '/'`;
70
62
  }
71
63
 
72
- if (LayoutFolderLimits.FORBIDDEN_SEGMENTS.has(segment)) {
73
- return `'${folder}' goes through '${segment}'`;
64
+ if (folder.startsWith('/') || folder.endsWith('/')) {
65
+ return `'${folder}' starts or ends with '/': a folder is a path from the project root`;
74
66
  }
75
67
 
76
- if (!LayoutFolderLimits.SEGMENT_PATTERN.test(segment)) {
77
- return `'${folder}' has the segment '${segment}': lowercase letters, digits and '-', starting with a letter or digit`;
68
+ const segments = folder.split('/');
69
+
70
+ if (segments.length > LayoutFolderLimits.MAX_SEGMENTS) {
71
+ return `'${folder}' has more than ${LayoutFolderLimits.MAX_SEGMENTS} segments`;
78
72
  }
79
- }
80
73
 
81
- return undefined;
82
- };
74
+ for (const segment of segments) {
75
+ if (segment === '') {
76
+ return `'${folder}' has an empty segment`;
77
+ }
78
+
79
+ if (segment === '..' || segment === '.') {
80
+ return `'${folder}' climbs or repeats a folder ('${segment}')`;
81
+ }
83
82
 
84
- /** The folders a layout value names, in order: a string is one, a list is its strings. Nothing is validated. */
85
- export const layoutFoldersOf = (opts: { value: unknown }): string[] => {
86
- const { value } = opts;
83
+ if (LayoutFolderLimits.FORBIDDEN_SEGMENTS.has(segment)) {
84
+ return `'${folder}' goes through '${segment}'`;
85
+ }
87
86
 
88
- if (typeof value === 'string') {
89
- return [value];
87
+ if (!LayoutFolderLimits.SEGMENT_PATTERN.test(segment)) {
88
+ return `'${folder}' has the segment '${segment}': lowercase letters, digits and '-', starting with a letter or digit`;
89
+ }
90
+ }
91
+
92
+ return undefined;
90
93
  }
91
94
 
92
- return Array.isArray(value)
93
- ? value.filter((entry): entry is string => typeof entry === 'string')
94
- : [];
95
- };
95
+ /** The folders a layout value names, in order: a string is one, a list is its strings. Nothing is validated. */
96
+ static layoutFoldersOf(opts: { value: unknown }): string[] {
97
+ const { value } = opts;
96
98
 
97
- /** Whether `inner` is `outer` or sits below it. */
98
- const isWithin = (opts: { inner: string; outer: string }): boolean =>
99
- opts.inner === opts.outer || opts.inner.startsWith(`${opts.outer}/`);
99
+ if (typeof value === 'string') {
100
+ return [value];
101
+ }
102
+
103
+ return Array.isArray(value)
104
+ ? value.filter((entry): entry is string => typeof entry === 'string')
105
+ : [];
106
+ }
100
107
 
101
- const entriesOf = (opts: { layout: ILayout }): { key: string; folder: string }[] =>
102
- LayoutKeys.ALL.flatMap((key) =>
103
- layoutFoldersOf({ value: opts.layout[key] }).map((folder) => ({ key, folder })),
104
- );
105
-
106
- /** A folder listed twice or under two keys, and a folder inside another: a package path must belong to exactly one folder. */
107
- export const layoutOverlapProblems = (opts: { layout: ILayout }): string[] => {
108
- const entries = entriesOf({ layout: opts.layout }).filter(
109
- (entry) => layoutFolderProblem({ folder: entry.folder }) === undefined,
110
- );
111
- const problems: string[] = [];
112
-
113
- for (const [index, entry] of entries.entries()) {
114
- for (const other of entries.slice(index + 1)) {
115
- if (entry.folder === other.folder) {
116
- problems.push(
117
- `layout.${other.key} names '${other.folder}' again (also layout.${entry.key}): a folder belongs to one kind of code`,
118
- );
119
- } else if (
120
- isWithin({ inner: entry.folder, outer: other.folder }) ||
121
- isWithin({ inner: other.folder, outer: entry.folder })
122
- ) {
123
- problems.push(
124
- `layout.${entry.key} '${entry.folder}' and layout.${other.key} '${other.folder}' are nested: a package path must belong to exactly one folder`,
125
- );
108
+ /** A folder listed twice or under two keys, and a folder inside another: a package path must belong to exactly one folder. */
109
+ static layoutOverlapProblems(opts: { layout: ILayout }): string[] {
110
+ const entries = LayoutFolder.entriesOf({ layout: opts.layout }).filter(
111
+ (entry) => LayoutFolder.layoutFolderProblem({ folder: entry.folder }) === undefined,
112
+ );
113
+ const problems: string[] = [];
114
+
115
+ for (const [index, entry] of entries.entries()) {
116
+ for (const other of entries.slice(index + 1)) {
117
+ if (entry.folder === other.folder) {
118
+ problems.push(
119
+ `layout.${other.key} names '${other.folder}' again (also layout.${entry.key}): a folder belongs to one kind of code`,
120
+ );
121
+ } else if (
122
+ isWithin({ inner: entry.folder, outer: other.folder }) ||
123
+ isWithin({ inner: other.folder, outer: entry.folder })
124
+ ) {
125
+ problems.push(
126
+ `layout.${entry.key} '${entry.folder}' and layout.${other.key} '${other.folder}' are nested: a package path must belong to exactly one folder`,
127
+ );
128
+ }
126
129
  }
127
130
  }
131
+
132
+ return problems;
128
133
  }
129
134
 
130
- return problems;
131
- };
135
+ /** The layout value with `folder` in it: unchanged when it is there already, a string that grows into a list otherwise. */
136
+ static withLayoutFolder(opts: { value: TLayoutValue | undefined; folder: string }): TLayoutValue {
137
+ const folders = LayoutFolder.layoutFoldersOf({ value: opts.value });
132
138
 
133
- /** The layout value with `folder` in it: unchanged when it is there already, a string that grows into a list otherwise. */
134
- export const withLayoutFolder = (opts: {
135
- value: TLayoutValue | undefined;
136
- folder: string;
137
- }): TLayoutValue => {
138
- const folders = layoutFoldersOf({ value: opts.value });
139
+ if (folders.includes(opts.folder)) {
140
+ return opts.value ?? opts.folder;
141
+ }
139
142
 
140
- if (folders.includes(opts.folder)) {
141
- return opts.value ?? opts.folder;
143
+ return folders.length === 0 ? opts.folder : [...folders, opts.folder];
142
144
  }
143
145
 
144
- return folders.length === 0 ? opts.folder : [...folders, opts.folder];
145
- };
146
-
147
- /** The valid folders of a layout value; a manifest is read through this, never trusted. */
148
- export const validLayoutFolders = (opts: { value: unknown }): string[] =>
149
- layoutFoldersOf({ value: opts.value }).filter(
150
- (folder) => layoutFolderProblem({ folder }) === undefined,
151
- );
146
+ /** The valid folders of a layout value; a manifest is read through this, never trusted. */
147
+ static valid(opts: { value: unknown }): string[] {
148
+ return LayoutFolder.layoutFoldersOf({ value: opts.value }).filter(
149
+ (folder) => LayoutFolder.layoutFolderProblem({ folder }) === undefined,
150
+ );
151
+ }
152
152
 
153
- /** The folders as a sentence part: `'a'`, or `'a', 'b'`. */
154
- export const describeFolders = (opts: { folders: string[] }): string =>
155
- opts.folders.map((folder) => `'${folder}'`).join(', ');
153
+ /** The folders as a sentence part: `'a'`, or `'a', 'b'`. */
154
+ static describe(opts: { folders: string[] }): string {
155
+ return opts.folders.map((folder) => `'${folder}'`).join(', ');
156
+ }
156
157
 
157
- /** What an error says when a flag must pick among several listed folders. */
158
- export const listedFoldersNote = (opts: { folders: string[] }): string =>
159
- `the layout lists ${describeFolders({ folders: opts.folders })}`;
158
+ /** What an error says when a flag must pick among several listed folders. */
159
+ static listedNote(opts: { folders: string[] }): string {
160
+ return `the layout lists ${LayoutFolder.describe({ folders: opts.folders })}`;
161
+ }
162
+ }
@@ -9,19 +9,21 @@ export const BASE_DIRECTORY = join(PACKAGE_ROOT, 'base');
9
9
 
10
10
  export const PACKAGE_NAME = '@venizia/vulcan';
11
11
 
12
- /**
13
- * The base as a project reaches it: through `node_modules/@venizia/vulcan` when that resolves to this
14
- * package. bun's isolated install keeps the files in a hashed store directory that every upgrade
15
- * replaces, so a link to the real path dies with the next upgrade; the stable path does not.
16
- * Anywhere else - no install, or another copy installed - the real directory.
17
- */
18
- export const stableBaseDirectoryOf = (opts: { root: string }): string => {
19
- const installed = join(opts.root, 'node_modules', PACKAGE_NAME, 'base');
12
+ export class BaseDirectory {
13
+ /**
14
+ * The base as a project reaches it: through `node_modules/@venizia/vulcan` when that resolves to this
15
+ * package. bun's isolated install keeps the files in a hashed store directory that every upgrade
16
+ * replaces, so a link to the real path dies with the next upgrade; the stable path does not.
17
+ * Anywhere else - no install, or another copy installed - the real directory.
18
+ */
19
+ static stableOf(opts: { root: string }): string {
20
+ const installed = join(opts.root, 'node_modules', PACKAGE_NAME, 'base');
20
21
 
21
- return existsSync(installed) && realpathSync(installed) === realpathSync(BASE_DIRECTORY)
22
- ? installed
23
- : BASE_DIRECTORY;
24
- };
22
+ return existsSync(installed) && realpathSync(installed) === realpathSync(BASE_DIRECTORY)
23
+ ? installed
24
+ : BASE_DIRECTORY;
25
+ }
26
+ }
25
27
 
26
28
  export const VULCAN_VERSION: string = JSON.parse(
27
29
  readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8'),
@@ -12,65 +12,68 @@ type TLoadResult =
12
12
  const describeError = (opts: { error: unknown }): string =>
13
13
  opts.error instanceof Error ? opts.error.message : String(opts.error);
14
14
 
15
- /** Every `.configs/vulcan.config.<ext>` present, in lookup order. */
16
- export const findConfigFiles = (opts: { root: string }): string[] =>
17
- ConfigExtensions.LOOKUP_ORDER.map((extension) =>
18
- join(opts.root, ConfigConstants.DIRECTORY, `${ConfigConstants.BASENAME}.${extension}`),
19
- ).filter((file) => existsSync(file));
20
-
21
- export const loadConfig = async (opts: { root: string }): Promise<TLoadResult> => {
22
- const files = findConfigFiles({ root: opts.root });
23
-
24
- if (files.length === 0) {
25
- return {
26
- ok: false,
27
- error: `no ${ConfigConstants.DIRECTORY}/${ConfigConstants.BASENAME}.* found in ${opts.root}`,
28
- };
15
+ export class ConfigLoader {
16
+ /** Every `.configs/vulcan.config.<ext>` present, in lookup order. */
17
+ static findFiles(opts: { root: string }): string[] {
18
+ return ConfigExtensions.LOOKUP_ORDER.map((extension) =>
19
+ join(opts.root, ConfigConstants.DIRECTORY, `${ConfigConstants.BASENAME}.${extension}`),
20
+ ).filter((file) => existsSync(file));
29
21
  }
30
22
 
31
- if (files.length > 1) {
32
- const names = files.map((file) => relative(opts.root, file)).join(', ');
23
+ static async load(opts: { root: string }): Promise<TLoadResult> {
24
+ const files = ConfigLoader.findFiles({ root: opts.root });
33
25
 
34
- return { ok: false, error: `more than one config - keep exactly one of: ${names}` };
35
- }
26
+ if (files.length === 0) {
27
+ return {
28
+ ok: false,
29
+ error: `no ${ConfigConstants.DIRECTORY}/${ConfigConstants.BASENAME}.* found in ${opts.root}`,
30
+ };
31
+ }
36
32
 
37
- const [file] = files;
38
- const shown = relative(opts.root, file);
33
+ if (files.length > 1) {
34
+ const names = files.map((file) => relative(opts.root, file)).join(', ');
39
35
 
40
- let loaded: { default?: unknown };
36
+ return { ok: false, error: `more than one config - keep exactly one of: ${names}` };
37
+ }
41
38
 
42
- try {
43
- const imported = await import(pathToFileURL(file).href);
39
+ const [file] = files;
40
+ const shown = relative(opts.root, file);
44
41
 
45
- loaded = imported;
46
- } catch (error) {
47
- return { ok: false, file, error: `${shown}: failed to load - ${describeError({ error })}` };
48
- }
42
+ let loaded: { default?: unknown };
49
43
 
50
- if (loaded.default === undefined) {
51
- return {
52
- ok: false,
53
- file,
54
- error: `${shown}: no default export - write 'export default { ... }'`,
55
- };
56
- }
44
+ try {
45
+ const imported = await import(pathToFileURL(file).href);
57
46
 
58
- const parsed = VULCAN_CONFIG_SCHEMA.safeParse(loaded.default);
47
+ loaded = imported;
48
+ } catch (error) {
49
+ return { ok: false, file, error: `${shown}: failed to load - ${describeError({ error })}` };
50
+ }
59
51
 
60
- if (!parsed.success) {
61
- const issues = parsed.error.issues
62
- .map((issue) => {
63
- const path =
64
- issue.code === 'unrecognized_keys'
65
- ? issue.keys.join(', ')
66
- : issue.path.join('.') || '(root)';
52
+ if (loaded.default === undefined) {
53
+ return {
54
+ ok: false,
55
+ file,
56
+ error: `${shown}: no default export - write 'export default { ... }'`,
57
+ };
58
+ }
67
59
 
68
- return ` ${path}: ${issue.message}`;
69
- })
70
- .join('\n');
60
+ const parsed = VULCAN_CONFIG_SCHEMA.safeParse(loaded.default);
71
61
 
72
- return { ok: false, file, error: `${shown}: invalid config\n${issues}` };
73
- }
62
+ if (!parsed.success) {
63
+ const issues = parsed.error.issues
64
+ .map((issue) => {
65
+ const path =
66
+ issue.code === 'unrecognized_keys'
67
+ ? issue.keys.join(', ')
68
+ : issue.path.join('.') || '(root)';
74
69
 
75
- return { ok: true, file, config: parsed.data };
76
- };
70
+ return ` ${path}: ${issue.message}`;
71
+ })
72
+ .join('\n');
73
+
74
+ return { ok: false, file, error: `${shown}: invalid config\n${issues}` };
75
+ }
76
+
77
+ return { ok: true, file, config: parsed.data };
78
+ }
79
+ }
@@ -15,14 +15,17 @@ export interface IProjectPackage {
15
15
  presetKind?: TLibraryKind;
16
16
  }
17
17
 
18
- /** The project's packages in release order. */
19
- export const resolvePackages = (opts: { config: TResolvedConfig }): IProjectPackage[] =>
20
- opts.config.packages.map((entry) => ({
21
- dir: entry.dir,
22
- name: entry.name,
23
- path: entry.path ?? `${DEFAULT_PACKAGES_DIRECTORY}/${entry.dir}`,
24
- aliases: entry.aliases,
25
- retired: entry.retired,
26
- ...(entry.kind === undefined ? {} : { kind: entry.kind }),
27
- ...(entry.presetKind === undefined ? {} : { presetKind: entry.presetKind }),
28
- }));
18
+ export class ProjectPackages {
19
+ /** The project's packages in release order. */
20
+ static resolve(opts: { config: TResolvedConfig }): IProjectPackage[] {
21
+ return opts.config.packages.map((entry) => ({
22
+ dir: entry.dir,
23
+ name: entry.name,
24
+ path: entry.path ?? `${DEFAULT_PACKAGES_DIRECTORY}/${entry.dir}`,
25
+ aliases: entry.aliases,
26
+ retired: entry.retired,
27
+ ...(entry.kind === undefined ? {} : { kind: entry.kind }),
28
+ ...(entry.presetKind === undefined ? {} : { presetKind: entry.presetKind }),
29
+ }));
30
+ }
31
+ }
@@ -1,6 +1,6 @@
1
1
  import { isAbsolute } from 'node:path';
2
2
  import { z } from 'zod';
3
- import { layoutFolderProblem, layoutOverlapProblems } from '../common/layout-folder.ts';
3
+ import { LayoutFolder } from '../common/layout-folder.ts';
4
4
  import { OWNER_SCHEMA } from '../owner/schema.ts';
5
5
  import {
6
6
  CodingAgents,
@@ -54,7 +54,7 @@ const PUSH_TARGET = z
54
54
 
55
55
  /** A layout folder: 1 to 4 plain segments, never climbing, never absolute (the validator `guard-package` shares). */
56
56
  const LAYOUT_FOLDER = z.string().superRefine((value, context) => {
57
- const problem = layoutFolderProblem({ folder: value });
57
+ const problem = LayoutFolder.layoutFolderProblem({ folder: value });
58
58
 
59
59
  if (problem !== undefined) {
60
60
  context.addIssue({ code: 'custom', message: problem });
@@ -212,7 +212,7 @@ export const VULCAN_CONFIG_SCHEMA = z.strictObject({
212
212
  other: LAYOUT_VALUE.optional(),
213
213
  })
214
214
  .superRefine((layout, context) => {
215
- for (const problem of layoutOverlapProblems({ layout })) {
215
+ for (const problem of LayoutFolder.layoutOverlapProblems({ layout })) {
216
216
  context.addIssue({ code: 'custom', message: problem });
217
217
  }
218
218
  })