@nimiplatform/app-tools 0.1.3 → 0.2.0

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 (120) hide show
  1. package/LICENSE +198 -6
  2. package/README.md +83 -27
  3. package/bin/nimi-app.mjs +328 -45
  4. package/lib/app-access-declaration.mjs +49 -0
  5. package/lib/app-doctor-update.mjs +411 -149
  6. package/lib/app-pack.mjs +401 -0
  7. package/lib/app-project-lifecycle.mjs +1141 -0
  8. package/lib/app-scaffold-capabilities.mjs +769 -0
  9. package/lib/app-scaffold-default-source.mjs +21 -0
  10. package/lib/app-scaffold-profiles.mjs +1093 -0
  11. package/lib/app-scaffold.mjs +1266 -813
  12. package/lib/index.mjs +194 -42
  13. package/lib/simulator-conformance-ast.mjs +498 -0
  14. package/lib/simulator-conformance-css.mjs +116 -0
  15. package/lib/simulator-conformance-graph.mjs +757 -0
  16. package/lib/simulator-conformance.d.mts +14 -0
  17. package/lib/simulator-conformance.mjs +203 -0
  18. package/lib/simulator-css-profile.d.mts +27 -0
  19. package/lib/simulator-css-profile.mjs +531 -0
  20. package/lib/simulator-kit-export-resolution.mjs +70 -0
  21. package/lib/simulator-manifest.mjs +334 -0
  22. package/package.json +66 -3
  23. package/scripts/dev-shell.mjs +465 -0
  24. package/scripts/sync-app-source.mjs +300 -0
  25. package/scripts/sync-scaffold-versions.mjs +91 -0
  26. package/templates/app-source/LICENSE +21 -0
  27. package/templates/app-source/src/ai-studio-core/ai-config.ts +100 -0
  28. package/templates/app-source/src/ai-studio-core/ai-studio-core.css +338 -0
  29. package/templates/app-source/src/ai-studio-core/contexts.tsx +61 -0
  30. package/templates/app-source/src/ai-studio-core/history-policy.ts +447 -0
  31. package/templates/app-source/src/ai-studio-core/history.ts +824 -0
  32. package/templates/app-source/src/ai-studio-core/host-context.tsx +79 -0
  33. package/templates/app-source/src/ai-studio-core/index.ts +214 -0
  34. package/templates/app-source/src/ai-studio-core/messages/en.json +310 -0
  35. package/templates/app-source/src/ai-studio-core/messages/index.ts +47 -0
  36. package/templates/app-source/src/ai-studio-core/messages/zh.json +310 -0
  37. package/templates/app-source/src/ai-studio-core/module-registration.ts +109 -0
  38. package/templates/app-source/src/ai-studio-core/non-success-presentation.ts +65 -0
  39. package/templates/app-source/src/ai-studio-core/parameter-fields.tsx +247 -0
  40. package/templates/app-source/src/ai-studio-core/parameters.ts +110 -0
  41. package/templates/app-source/src/ai-studio-core/prompt-drafts.ts +69 -0
  42. package/templates/app-source/src/ai-studio-core/run-target.ts +123 -0
  43. package/templates/app-source/src/ai-studio-core/runtime-dispatcher.ts +35 -0
  44. package/templates/app-source/src/ai-studio-core/runtime-types.ts +86 -0
  45. package/templates/app-source/src/ai-studio-core/runtime.ts +306 -0
  46. package/templates/app-source/src/ai-studio-core/section-ai-testing-admission.ts +38 -0
  47. package/templates/app-source/src/ai-studio-core/section-ai-testing-ai-config.tsx +30 -0
  48. package/templates/app-source/src/ai-studio-core/section-ai-testing-artifact-preview.ts +40 -0
  49. package/templates/app-source/src/ai-studio-core/section-ai-testing-composer.tsx +257 -0
  50. package/templates/app-source/src/ai-studio-core/section-ai-testing-history.tsx +676 -0
  51. package/templates/app-source/src/ai-studio-core/section-ai-testing-input.ts +19 -0
  52. package/templates/app-source/src/ai-studio-core/section-ai-testing-output.tsx +291 -0
  53. package/templates/app-source/src/ai-studio-core/section-ai-testing-result.tsx +413 -0
  54. package/templates/app-source/src/ai-studio-core/section-ai-testing-run.ts +174 -0
  55. package/templates/app-source/src/ai-studio-core/section-ai-testing-studio-result.tsx +449 -0
  56. package/templates/app-source/src/ai-studio-core/section-ai-testing-surface.tsx +45 -0
  57. package/templates/app-source/src/ai-studio-core/section-ai-testing.tsx +494 -0
  58. package/templates/app-source/src/ai-studio-core/studio-directives.ts +33 -0
  59. package/templates/app-source/src/ai-studio-core/workspace.tsx +381 -0
  60. package/templates/app-source/src/product-modules/agent-center/index.tsx +27 -0
  61. package/templates/app-source/src/product-modules/agent-conversation/index.tsx +19 -0
  62. package/templates/app-source/src/product-modules/agent-realtime/index.tsx +29 -0
  63. package/templates/app-source/src/product-modules/kit-recipes/gallery.tsx +142 -0
  64. package/templates/app-source/src/product-modules/kit-recipes/index.tsx +19 -0
  65. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-data-recipes.tsx +336 -0
  66. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-demos.tsx +165 -0
  67. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-recipes.tsx +682 -0
  68. package/templates/app-source/src/product-modules/kit-recipes/kit-component-gallery-surface.tsx +341 -0
  69. package/templates/app-source/src/studio-modules/studio-create/descriptors.ts +26 -0
  70. package/templates/app-source/src/studio-modules/studio-create/index.ts +14 -0
  71. package/templates/app-source/src/studio-modules/studio-create/messages/en.json +67 -0
  72. package/templates/app-source/src/studio-modules/studio-create/messages/index.ts +5 -0
  73. package/templates/app-source/src/studio-modules/studio-create/messages/zh.json +67 -0
  74. package/templates/app-source/src/studio-modules/studio-create/parameter-panel.tsx +153 -0
  75. package/templates/app-source/src/studio-modules/studio-create/parameters.ts +70 -0
  76. package/templates/app-source/src/studio-modules/studio-create/registration.ts +46 -0
  77. package/templates/app-source/src/studio-modules/studio-create/runtime.ts +339 -0
  78. package/templates/app-source/src/studio-modules/studio-media/descriptors.ts +22 -0
  79. package/templates/app-source/src/studio-modules/studio-media/index.ts +12 -0
  80. package/templates/app-source/src/studio-modules/studio-media/messages/en.json +82 -0
  81. package/templates/app-source/src/studio-modules/studio-media/messages/index.ts +5 -0
  82. package/templates/app-source/src/studio-modules/studio-media/messages/zh.json +82 -0
  83. package/templates/app-source/src/studio-modules/studio-media/parameter-panel.tsx +283 -0
  84. package/templates/app-source/src/studio-modules/studio-media/parameters.ts +94 -0
  85. package/templates/app-source/src/studio-modules/studio-media/registration.ts +44 -0
  86. package/templates/app-source/src/studio-modules/studio-media/runtime.ts +113 -0
  87. package/templates/app-source/src/studio-modules/studio-voice/descriptors.ts +28 -0
  88. package/templates/app-source/src/studio-modules/studio-voice/index.ts +16 -0
  89. package/templates/app-source/src/studio-modules/studio-voice/messages/en.json +99 -0
  90. package/templates/app-source/src/studio-modules/studio-voice/messages/index.ts +5 -0
  91. package/templates/app-source/src/studio-modules/studio-voice/messages/zh.json +99 -0
  92. package/templates/app-source/src/studio-modules/studio-voice/parameter-panel.tsx +284 -0
  93. package/templates/app-source/src/studio-modules/studio-voice/parameters.ts +116 -0
  94. package/templates/app-source/src/studio-modules/studio-voice/registration.ts +59 -0
  95. package/templates/app-source/src/studio-modules/studio-voice/runtime.ts +347 -0
  96. package/templates/app-source/src/workbench-core/empty-state.tsx +31 -0
  97. package/templates/app-source/src/workbench-core/index.ts +17 -0
  98. package/templates/app-source/src/workbench-core/runtime-gate.tsx +131 -0
  99. package/templates/app-source/src/workbench-core/workbench-core.css +255 -0
  100. package/templates/app-source/src/workbench-core/workbench-core.tsx +140 -0
  101. package/templates/app-source.manifest.json +333 -0
  102. package/templates/default-starter/AGENTS.md +33 -0
  103. package/templates/default-starter/LICENSE +21 -0
  104. package/templates/default-starter/README.md +41 -0
  105. package/templates/default-starter/SECURITY.md +5 -0
  106. package/templates/default-starter/index.html +12 -0
  107. package/templates/default-starter/scripts/validate.mjs +26 -0
  108. package/templates/default-starter/src/shell/App.tsx +27 -0
  109. package/templates/default-starter/src/shell/auth/app-identity.ts +3 -0
  110. package/templates/default-starter/src/shell/auth/local-app-client.ts +18 -0
  111. package/templates/default-starter/src/shell/auth/runtime-platform.ts +110 -0
  112. package/templates/default-starter/src/shell/authenticated-shell.tsx +20 -0
  113. package/templates/default-starter/src/shell/workbench-target-adapter.ts +40 -0
  114. package/templates/default-starter/src/styles.css +26 -0
  115. package/templates/default-starter/src-tauri/Cargo.toml +17 -0
  116. package/templates/default-starter/src-tauri/build.rs +5 -0
  117. package/templates/default-starter/src-tauri/capabilities/default.json +7 -0
  118. package/templates/default-starter/src-tauri/tauri.conf.json +26 -0
  119. package/templates/default-starter/tsconfig.json +18 -0
  120. package/templates/default-starter.manifest.json +99 -0
@@ -0,0 +1,769 @@
1
+ // @nimi-authority: rule.nimi.platform.app-ecosystem.p-scaf-019c
2
+
3
+ import semver from 'semver';
4
+
5
+ function frozenSourceMapping(sourceRoot, targetRoot = sourceRoot) {
6
+ return Object.freeze({ sourceRoot, targetRoot });
7
+ }
8
+
9
+ function frozenModule(definition) {
10
+ const cargoDependencies = Object.fromEntries(
11
+ Object.entries(definition.cargoDependencies || {}).map(([name, value]) => [
12
+ name,
13
+ value && typeof value === 'object' && !Array.isArray(value)
14
+ ? Object.freeze({
15
+ ...value,
16
+ ...(Array.isArray(value.features) ? { features: Object.freeze([...value.features]) } : {}),
17
+ })
18
+ : value,
19
+ ]),
20
+ );
21
+ return Object.freeze({
22
+ ...definition,
23
+ requires: Object.freeze([...(definition.requires || [])]),
24
+ sourceMappings: Object.freeze([...(definition.sourceMappings || [])]),
25
+ appAccessItems: Object.freeze([...(definition.appAccessItems || [])]),
26
+ capabilityContractRefs: Object.freeze([...(definition.capabilityContractRefs || [])]),
27
+ requiredStandardizedFeatureRefs: Object.freeze([...(definition.requiredStandardizedFeatureRefs || [])]),
28
+ npmDependencies: Object.freeze({ ...(definition.npmDependencies || {}) }),
29
+ cargoDependencies: Object.freeze(cargoDependencies),
30
+ views: Object.freeze([...(definition.views || [])]),
31
+ navigation: Object.freeze([...(definition.navigation || [])]),
32
+ styles: Object.freeze([...(definition.styles || [])]),
33
+ assets: Object.freeze([...(definition.assets || [])]),
34
+ });
35
+ }
36
+
37
+ export const APP_SCAFFOLD_MODULE_REGISTRY = Object.freeze({
38
+ 'ai-studio-core': frozenModule({
39
+ id: 'ai-studio-core',
40
+ kind: 'internal',
41
+ order: 0,
42
+ requires: [],
43
+ sourceMappings: [frozenSourceMapping('src/ai-studio-core', 'src/capabilities/ai-studio-core')],
44
+ appAccessItems: [],
45
+ npmDependencies: {
46
+ i18next: '$versions.i18nextVersion',
47
+ 'lucide-react': '$versions.lucideReactVersion',
48
+ },
49
+ cargoDependencies: {},
50
+ hostAdapterContract: 'ai-studio-host-v1',
51
+ views: [],
52
+ navigation: [],
53
+ styles: ['src/ai-studio-core/ai-studio-core.css'],
54
+ assets: [],
55
+ productEntry: Object.freeze({
56
+ kind: 'ai-studio-core',
57
+ modulePath: 'src/ai-studio-core/index.ts',
58
+ componentExport: 'AIStudioWorkspace',
59
+ messageExport: 'aiStudioCoreMessageBundles',
60
+ }),
61
+ }),
62
+ 'studio-create': frozenModule({
63
+ id: 'studio-create',
64
+ kind: 'feature',
65
+ lifecycle: 'admitted',
66
+ order: 10,
67
+ label: 'Create',
68
+ requires: ['ai-studio-core'],
69
+ sourceMappings: [frozenSourceMapping('src/studio-modules/studio-create', 'src/capabilities/studio-create')],
70
+ appAccessItems: ['runtime.consume'],
71
+ capabilityContractRefs: ['text.generate', 'text.embed'],
72
+ requiredStandardizedFeatureRefs: [],
73
+ npmDependencies: {},
74
+ cargoDependencies: {},
75
+ hostAdapterContract: 'ai-studio-host-v1',
76
+ views: ['text.generate', 'chat.stream', 'text.embed'],
77
+ navigation: ['text.generate', 'chat.stream', 'text.embed'],
78
+ styles: [],
79
+ assets: [],
80
+ productEntry: Object.freeze({
81
+ kind: 'ai-studio-module',
82
+ modulePath: 'src/studio-modules/studio-create/index.ts',
83
+ registrationExport: 'studioCreateModule',
84
+ runtimeExport: 'studioCreateRuntimeHandlers',
85
+ messageExport: 'studioCreateMessageBundles',
86
+ }),
87
+ }),
88
+ 'studio-media': frozenModule({
89
+ id: 'studio-media',
90
+ kind: 'feature',
91
+ lifecycle: 'admitted',
92
+ order: 20,
93
+ label: 'Media',
94
+ requires: ['ai-studio-core'],
95
+ sourceMappings: [frozenSourceMapping('src/studio-modules/studio-media', 'src/capabilities/studio-media')],
96
+ appAccessItems: ['runtime.consume'],
97
+ capabilityContractRefs: ['image.generate', 'video.generate', 'music.generate'],
98
+ requiredStandardizedFeatureRefs: [],
99
+ npmDependencies: {},
100
+ cargoDependencies: {},
101
+ hostAdapterContract: 'ai-studio-host-v1',
102
+ views: ['image.generate', 'video.generate', 'music.generate'],
103
+ navigation: ['image.generate', 'video.generate', 'music.generate'],
104
+ styles: [],
105
+ assets: [],
106
+ productEntry: Object.freeze({
107
+ kind: 'ai-studio-module',
108
+ modulePath: 'src/studio-modules/studio-media/index.ts',
109
+ registrationExport: 'studioMediaModule',
110
+ runtimeExport: 'studioMediaRuntimeHandlers',
111
+ messageExport: 'studioMediaMessageBundles',
112
+ }),
113
+ }),
114
+ 'studio-voice': frozenModule({
115
+ id: 'studio-voice',
116
+ kind: 'feature',
117
+ lifecycle: 'admitted',
118
+ order: 30,
119
+ label: 'Voice',
120
+ requires: ['ai-studio-core'],
121
+ sourceMappings: [frozenSourceMapping('src/studio-modules/studio-voice', 'src/capabilities/studio-voice')],
122
+ appAccessItems: ['runtime.consume'],
123
+ capabilityContractRefs: ['audio.synthesize', 'audio.transcribe', 'voice.create'],
124
+ requiredStandardizedFeatureRefs: [],
125
+ npmDependencies: {},
126
+ cargoDependencies: {},
127
+ hostAdapterContract: 'ai-studio-host-v1',
128
+ views: ['audio.synthesize', 'audio.transcribe', 'voice.create', 'speech.bundle'],
129
+ navigation: ['audio.synthesize', 'audio.transcribe', 'voice.create', 'speech.bundle'],
130
+ styles: [],
131
+ assets: [],
132
+ productEntry: Object.freeze({
133
+ kind: 'ai-studio-module',
134
+ modulePath: 'src/studio-modules/studio-voice/index.ts',
135
+ registrationExport: 'studioVoiceModule',
136
+ runtimeExport: 'studioVoiceRuntimeHandlers',
137
+ messageExport: 'studioVoiceMessageBundles',
138
+ }),
139
+ }),
140
+ 'kit-recipes': frozenModule({
141
+ id: 'kit-recipes',
142
+ kind: 'feature',
143
+ lifecycle: 'admitted',
144
+ order: 40,
145
+ label: 'UI Recipes',
146
+ requires: [],
147
+ sourceMappings: [frozenSourceMapping('src/product-modules/kit-recipes', 'src/capabilities/kit-recipes')],
148
+ appAccessItems: [],
149
+ npmDependencies: {
150
+ 'lucide-react': '$versions.lucideReactVersion',
151
+ },
152
+ cargoDependencies: {},
153
+ hostAdapterContract: 'clipboard-copy-v1',
154
+ views: ['kit-recipes'],
155
+ navigation: ['kit-recipes'],
156
+ styles: [],
157
+ assets: [],
158
+ productEntry: Object.freeze({
159
+ kind: 'component',
160
+ modulePath: 'src/product-modules/kit-recipes/index.tsx',
161
+ componentExport: 'KitRecipesCapability',
162
+ identityProp: 'exampleAppId',
163
+ }),
164
+ }),
165
+ 'agent-center': frozenModule({
166
+ id: 'agent-center',
167
+ kind: 'feature',
168
+ lifecycle: 'admitted',
169
+ order: 50,
170
+ label: 'Agent Center',
171
+ requires: [],
172
+ sourceMappings: [frozenSourceMapping('src/product-modules/agent-center', 'src/capabilities/agent-center')],
173
+ appAccessItems: ['agent.local', 'agent.configure'],
174
+ npmDependencies: {
175
+ 'lucide-react': '$versions.lucideReactVersion',
176
+ },
177
+ cargoDependencies: {},
178
+ hostAdapterContract: 'local-app-standard-shell-v1',
179
+ views: ['agent-center'],
180
+ navigation: ['agent-center'],
181
+ styles: [],
182
+ assets: [],
183
+ productEntry: Object.freeze({
184
+ kind: 'component',
185
+ modulePath: 'src/product-modules/agent-center/index.tsx',
186
+ componentExport: 'AgentCenterCapability',
187
+ clientProp: 'client',
188
+ }),
189
+ }),
190
+ 'agent-conversation': frozenModule({
191
+ id: 'agent-conversation',
192
+ kind: 'feature',
193
+ lifecycle: 'admitted',
194
+ order: 60,
195
+ label: 'Agent Conversation',
196
+ requires: [],
197
+ sourceMappings: [frozenSourceMapping('src/product-modules/agent-conversation', 'src/capabilities/agent-conversation')],
198
+ appAccessItems: ['agent.local'],
199
+ npmDependencies: {
200
+ 'lucide-react': '$versions.lucideReactVersion',
201
+ },
202
+ cargoDependencies: {},
203
+ hostAdapterContract: 'app-conversation-browser-media-v1',
204
+ views: ['agent-conversation'],
205
+ navigation: ['agent-conversation'],
206
+ styles: [],
207
+ assets: [],
208
+ productEntry: Object.freeze({
209
+ kind: 'component',
210
+ modulePath: 'src/product-modules/agent-conversation/index.tsx',
211
+ componentExport: 'AgentConversationCapability',
212
+ clientProp: 'client',
213
+ }),
214
+ }),
215
+ 'agent-realtime': frozenModule({
216
+ id: 'agent-realtime',
217
+ kind: 'feature',
218
+ lifecycle: 'admitted',
219
+ order: 70,
220
+ label: 'Agent Realtime',
221
+ requires: [],
222
+ sourceMappings: [frozenSourceMapping('src/product-modules/agent-realtime', 'src/capabilities/agent-realtime')],
223
+ appAccessItems: ['agent.local'],
224
+ npmDependencies: {
225
+ 'lucide-react': '$versions.lucideReactVersion',
226
+ },
227
+ cargoDependencies: {},
228
+ hostAdapterContract: 'agent-realtime-browser-media-v1',
229
+ views: ['agent-realtime'],
230
+ navigation: ['agent-realtime'],
231
+ styles: [],
232
+ assets: [],
233
+ productEntry: Object.freeze({
234
+ kind: 'component',
235
+ modulePath: 'src/product-modules/agent-realtime/index.tsx',
236
+ componentExport: 'AgentRealtimeCapability',
237
+ clientProp: 'client',
238
+ }),
239
+ }),
240
+ });
241
+
242
+ function registryEntries(registry) {
243
+ return Object.entries(registry).sort(([, left], [, right]) => (
244
+ left.order - right.order || left.id.localeCompare(right.id)
245
+ ));
246
+ }
247
+
248
+ function assertRelativePosixPath(value, label) {
249
+ const normalized = String(value || '');
250
+ if (
251
+ !normalized
252
+ || normalized.startsWith('/')
253
+ || normalized.endsWith('/')
254
+ || normalized.includes('..')
255
+ || normalized.includes('\\')
256
+ || normalized.split('/').some((segment) => !segment || segment === '.')
257
+ ) {
258
+ throw new Error(`App scaffold module has invalid ${label}: ${normalized || 'missing'}`);
259
+ }
260
+ }
261
+
262
+ function assertUniqueStrings(values, label) {
263
+ if (!Array.isArray(values)) throw new Error(`App scaffold module ${label} must be an array`);
264
+ const seen = new Set();
265
+ for (const value of values) {
266
+ if (typeof value !== 'string' || !value || value !== value.trim() || seen.has(value)) {
267
+ throw new Error(`App scaffold module has invalid or duplicate ${label}: ${String(value || 'missing')}`);
268
+ }
269
+ seen.add(value);
270
+ }
271
+ }
272
+
273
+ function pathsOverlap(left, right) {
274
+ const normalizedLeft = left.toLowerCase();
275
+ const normalizedRight = right.toLowerCase();
276
+ return normalizedLeft === normalizedRight
277
+ || normalizedLeft.startsWith(`${normalizedRight}/`)
278
+ || normalizedRight.startsWith(`${normalizedLeft}/`);
279
+ }
280
+
281
+ function targetPathForOwnedSource(entry, sourcePath) {
282
+ const mapping = entry.sourceMappings.find((candidate) => (
283
+ sourcePath === candidate.sourceRoot || sourcePath.startsWith(`${candidate.sourceRoot}/`)
284
+ ));
285
+ if (!mapping) throw new Error(`App scaffold module owned source is outside its mappings: ${entry.id}: ${sourcePath}`);
286
+ const suffix = sourcePath === mapping.sourceRoot
287
+ ? ''
288
+ : sourcePath.slice(mapping.sourceRoot.length + 1);
289
+ return suffix ? `${mapping.targetRoot}/${suffix}` : mapping.targetRoot;
290
+ }
291
+
292
+ function canonicalDependencyValue(value) {
293
+ if (Array.isArray(value)) return value.map(canonicalDependencyValue);
294
+ if (!value || typeof value !== 'object') return value;
295
+ return Object.fromEntries(
296
+ Object.keys(value).sort().map((key) => [key, canonicalDependencyValue(value[key])]),
297
+ );
298
+ }
299
+
300
+ function dependencyValuesEqual(left, right) {
301
+ return JSON.stringify(canonicalDependencyValue(left)) === JSON.stringify(canonicalDependencyValue(right));
302
+ }
303
+
304
+ export function validateAppScaffoldCargoDependencyValue(value, label) {
305
+ if (typeof value === 'string') {
306
+ if (isCargoRegistryVersionRequirement(value)) return;
307
+ throw new Error(`App scaffold module Cargo dependency must use a public registry version: ${label}`);
308
+ }
309
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
310
+ throw new Error(`App scaffold module Cargo dependency is invalid: ${label}`);
311
+ }
312
+ const allowed = new Set(['version', 'package', 'features', 'default-features', 'optional']);
313
+ const entries = Object.entries(value);
314
+ if (entries.length === 0) throw new Error(`App scaffold module Cargo dependency is empty: ${label}`);
315
+ for (const [key, field] of entries) {
316
+ if (!allowed.has(key)) throw new Error(`App scaffold module Cargo dependency field is invalid: ${label}.${key}`);
317
+ if (key === 'version' && typeof field === 'string') {
318
+ if (!isCargoRegistryVersionRequirement(field)) {
319
+ throw new Error(`App scaffold module Cargo dependency must use a public registry version: ${label}.${key}`);
320
+ }
321
+ continue;
322
+ }
323
+ if (key === 'package' && typeof field === 'string') {
324
+ if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/u.test(field)) {
325
+ throw new Error(`App scaffold module Cargo dependency package name is invalid: ${label}.${key}`);
326
+ }
327
+ continue;
328
+ }
329
+ if (key === 'features' && Array.isArray(field) && field.every((item) => typeof item === 'string' && item && item === item.trim())) continue;
330
+ if ((key === 'default-features' || key === 'optional') && typeof field === 'boolean') continue;
331
+ throw new Error(`App scaffold module Cargo dependency value has the wrong type: ${label}.${key}`);
332
+ }
333
+ if (!Object.hasOwn(value, 'version')) {
334
+ throw new Error(`App scaffold module Cargo registry dependency version is missing: ${label}`);
335
+ }
336
+ }
337
+
338
+ function assertPublicNpmDependencyVersion(value, label) {
339
+ if (typeof value === 'string' && /^\$versions\.[A-Za-z][A-Za-z0-9]*$/u.test(value)) return;
340
+ validateAppScaffoldNpmRegistryVersion(value, label);
341
+ }
342
+
343
+ export function validateAppScaffoldNpmRegistryVersion(value, label) {
344
+ const normalized = String(value || '').trim();
345
+ if (!normalized || normalized !== value) {
346
+ throw new Error(`App scaffold module npm dependency is invalid: ${label}`);
347
+ }
348
+ if (isNpmRegistryVersionSelector(normalized)) return;
349
+ const alias = normalized.match(/^npm:((?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*)@(.+)$/u);
350
+ if (alias && isNpmRegistryVersionSelector(alias[2])) return;
351
+ throw new Error(`App scaffold module npm dependency must use a public registry version: ${label}`);
352
+ }
353
+
354
+ function isNpmRegistryVersionSelector(value) {
355
+ if (semver.validRange(value, { loose: false }) !== null) return true;
356
+ return /^[A-Za-z0-9][A-Za-z0-9._-]*$/u.test(value);
357
+ }
358
+
359
+ const CARGO_NUMERIC_IDENTIFIER = '(?:0|[1-9][0-9]*)';
360
+ const CARGO_PRERELEASE_IDENTIFIER = '[0-9A-Za-z-]+';
361
+ const CARGO_PRERELEASE = `(?:-${CARGO_PRERELEASE_IDENTIFIER}(?:\\.${CARGO_PRERELEASE_IDENTIFIER})*)?`;
362
+ const CARGO_BUILD = `(?:\\+${CARGO_PRERELEASE_IDENTIFIER}(?:\\.${CARGO_PRERELEASE_IDENTIFIER})*)?`;
363
+ const CARGO_VERSION = new RegExp(
364
+ `^(?:\\*|${CARGO_NUMERIC_IDENTIFIER}|${CARGO_NUMERIC_IDENTIFIER}\\.\\*|${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}|${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}\\.\\*|${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}\\.${CARGO_NUMERIC_IDENTIFIER}${CARGO_PRERELEASE}${CARGO_BUILD})$`,
365
+ 'u',
366
+ );
367
+
368
+ function isCargoRegistryVersionRequirement(value) {
369
+ if (typeof value !== 'string' || !value || value !== value.trim()) return false;
370
+ const comparators = value.split(',').map((entry) => entry.trim());
371
+ if (comparators.length === 0 || comparators.some((entry) => !entry)) return false;
372
+ return comparators.every((entry) => {
373
+ const match = entry.match(/^(\^|~|>=|<=|>|<|=)?\s*(.+)$/u);
374
+ if (!match || !isCargoVersionToken(match[2])) return false;
375
+ return !(match[1] && match[2].includes('*'));
376
+ });
377
+ }
378
+
379
+ function isCargoVersionToken(value) {
380
+ if (!CARGO_VERSION.test(value)) return false;
381
+ if (value.includes('*') || value.split(/[+-]/u, 1)[0].split('.').length < 3) return true;
382
+ return semver.valid(value, { loose: false }) !== null;
383
+ }
384
+
385
+ function assertProductEntry(id, entry) {
386
+ const productEntry = entry.productEntry;
387
+ if (!productEntry || typeof productEntry !== 'object' || Array.isArray(productEntry)) {
388
+ throw new Error(`App scaffold module productEntry is missing: ${id}`);
389
+ }
390
+ if (!['ai-studio-core', 'ai-studio-module', 'component'].includes(productEntry.kind)) {
391
+ throw new Error(`App scaffold module productEntry kind is invalid: ${id}`);
392
+ }
393
+ assertRelativePosixPath(productEntry.modulePath, `${id} productEntry modulePath`);
394
+ if (!entry.sourceMappings.some((mapping) => (
395
+ productEntry.modulePath === mapping.sourceRoot
396
+ || productEntry.modulePath.startsWith(`${mapping.sourceRoot}/`)
397
+ ))) {
398
+ throw new Error(`App scaffold module productEntry is outside its source mappings: ${id}`);
399
+ }
400
+ const exportNames = productEntry.kind === 'ai-studio-module'
401
+ ? [productEntry.registrationExport, productEntry.runtimeExport, productEntry.messageExport]
402
+ : productEntry.kind === 'ai-studio-core'
403
+ ? [productEntry.componentExport, productEntry.messageExport]
404
+ : [productEntry.componentExport];
405
+ if (exportNames.some((value) => typeof value !== 'string' || !/^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(value))) {
406
+ throw new Error(`App scaffold module productEntry export is invalid: ${id}`);
407
+ }
408
+ if (productEntry.identityProp !== undefined
409
+ && (productEntry.kind !== 'component'
410
+ || typeof productEntry.identityProp !== 'string'
411
+ || !/^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(productEntry.identityProp))) {
412
+ throw new Error(`App scaffold module productEntry identity prop is invalid: ${id}`);
413
+ }
414
+ if (productEntry.clientProp !== undefined
415
+ && (productEntry.kind !== 'component'
416
+ || typeof productEntry.clientProp !== 'string'
417
+ || !/^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(productEntry.clientProp))) {
418
+ throw new Error(`App scaffold module productEntry client prop is invalid: ${id}`);
419
+ }
420
+ }
421
+
422
+ function assertModuleEntry(id, entry, registry) {
423
+ if (!entry || entry.id !== id) throw new Error(`App scaffold module registry id mismatch: ${id}`);
424
+ if (!['feature', 'internal'].includes(entry.kind)) {
425
+ throw new Error(`App scaffold module has invalid kind: ${id}`);
426
+ }
427
+ if (!Number.isSafeInteger(entry.order) || entry.order < 0) {
428
+ throw new Error(`App scaffold module has invalid order: ${id}`);
429
+ }
430
+ if (entry.kind === 'feature') {
431
+ if (!['candidate', 'admitted'].includes(entry.lifecycle)) {
432
+ throw new Error(`App scaffold feature has invalid lifecycle: ${id}`);
433
+ }
434
+ if (typeof entry.label !== 'string' || !entry.label.trim()) {
435
+ throw new Error(`App scaffold feature label is missing: ${id}`);
436
+ }
437
+ } else if (Object.hasOwn(entry, 'lifecycle')) {
438
+ throw new Error(`App scaffold internal module cannot declare lifecycle: ${id}`);
439
+ }
440
+ assertUniqueStrings(entry.requires, `${id} requires`);
441
+ assertUniqueStrings(entry.appAccessItems, `${id} appAccessItems`);
442
+ assertUniqueStrings(entry.capabilityContractRefs || [], `${id} capabilityContractRefs`);
443
+ assertUniqueStrings(entry.requiredStandardizedFeatureRefs || [], `${id} requiredStandardizedFeatureRefs`);
444
+ assertUniqueStrings(entry.views, `${id} views`);
445
+ assertUniqueStrings(entry.navigation, `${id} navigation`);
446
+ assertUniqueStrings(entry.styles, `${id} styles`);
447
+ assertUniqueStrings(entry.assets, `${id} assets`);
448
+ if (entry.kind === 'internal' && entry.appAccessItems.length > 0) {
449
+ throw new Error(`App scaffold internal module cannot declare App access: ${id}`);
450
+ }
451
+ if (!Array.isArray(entry.sourceMappings) || entry.sourceMappings.length === 0) {
452
+ throw new Error(`App scaffold module sourceMappings are missing: ${id}`);
453
+ }
454
+ for (const mapping of entry.sourceMappings) {
455
+ assertRelativePosixPath(mapping?.sourceRoot, `${id} sourceRoot`);
456
+ assertRelativePosixPath(mapping?.targetRoot, `${id} targetRoot`);
457
+ }
458
+ for (const [kind, paths] of [['style', entry.styles], ['asset', entry.assets]]) {
459
+ for (const itemPath of paths) {
460
+ assertRelativePosixPath(itemPath, `${id} ${kind}`);
461
+ if (!entry.sourceMappings.some((mapping) => (
462
+ itemPath === mapping.sourceRoot || itemPath.startsWith(`${mapping.sourceRoot}/`)
463
+ ))) {
464
+ throw new Error(`App scaffold module ${kind} is outside its source mappings: ${id}: ${itemPath}`);
465
+ }
466
+ }
467
+ }
468
+ for (const dependency of entry.requires) {
469
+ if (!Object.hasOwn(registry, dependency)) {
470
+ throw new Error(`App scaffold module ${id} requires unknown module: ${dependency}`);
471
+ }
472
+ }
473
+ for (const viewId of entry.navigation) {
474
+ if (!entry.views.includes(viewId)) {
475
+ throw new Error(`App scaffold module ${id} navigation references unknown view: ${viewId}`);
476
+ }
477
+ }
478
+ if (!entry.npmDependencies || typeof entry.npmDependencies !== 'object' || Array.isArray(entry.npmDependencies)) {
479
+ throw new Error(`App scaffold module npmDependencies are missing: ${id}`);
480
+ }
481
+ if (!entry.cargoDependencies || typeof entry.cargoDependencies !== 'object' || Array.isArray(entry.cargoDependencies)) {
482
+ throw new Error(`App scaffold module cargoDependencies are missing: ${id}`);
483
+ }
484
+ for (const [name, version] of Object.entries(entry.npmDependencies)) {
485
+ if (!name || name !== name.trim() || typeof version !== 'string' || !version.trim()) {
486
+ throw new Error(`App scaffold module npm dependency is invalid: ${id}: ${name || 'missing'}`);
487
+ }
488
+ assertPublicNpmDependencyVersion(version, `${id}:${name}`);
489
+ }
490
+ for (const [name, value] of Object.entries(entry.cargoDependencies)) {
491
+ if (!name || name !== name.trim() || value === undefined || value === null) {
492
+ throw new Error(`App scaffold module Cargo dependency is invalid: ${id}: ${name || 'missing'}`);
493
+ }
494
+ validateAppScaffoldCargoDependencyValue(value, `${id}:${name}`);
495
+ }
496
+ if (typeof entry.hostAdapterContract !== 'string' || !entry.hostAdapterContract.trim()) {
497
+ throw new Error(`App scaffold module hostAdapterContract is missing: ${id}`);
498
+ }
499
+ assertProductEntry(id, entry);
500
+ }
501
+
502
+ export function validateAppScaffoldModuleRegistry(registry = APP_SCAFFOLD_MODULE_REGISTRY) {
503
+ const orders = new Map();
504
+ const sourceRoots = new Map();
505
+ const targetRoots = new Map();
506
+ const viewOwners = new Map();
507
+ const navigationOwners = new Map();
508
+ const styleOwners = new Map();
509
+ const assetOwners = new Map();
510
+ for (const [id, entry] of registryEntries(registry)) {
511
+ assertModuleEntry(id, entry, registry);
512
+ if (orders.has(entry.order)) {
513
+ throw new Error(`App scaffold module order collision: ${orders.get(entry.order)} and ${id}`);
514
+ }
515
+ orders.set(entry.order, id);
516
+ for (const mapping of entry.sourceMappings) {
517
+ for (const [otherRoot, otherOwner] of sourceRoots) {
518
+ if (pathsOverlap(mapping.sourceRoot, otherRoot)) {
519
+ throw new Error(`App scaffold module source collision: ${otherOwner} and ${id}`);
520
+ }
521
+ }
522
+ sourceRoots.set(mapping.sourceRoot, id);
523
+ for (const [otherRoot, otherOwner] of targetRoots) {
524
+ if (pathsOverlap(mapping.targetRoot, otherRoot)) {
525
+ throw new Error(`App scaffold module target collision: ${otherOwner} and ${id}`);
526
+ }
527
+ }
528
+ targetRoots.set(mapping.targetRoot, id);
529
+ }
530
+ for (const viewId of entry.views) {
531
+ if (viewOwners.has(viewId)) {
532
+ throw new Error(`App scaffold module view collision: ${viewOwners.get(viewId)} and ${id}: ${viewId}`);
533
+ }
534
+ viewOwners.set(viewId, id);
535
+ }
536
+ for (const navigationId of entry.navigation) {
537
+ if (navigationOwners.has(navigationId)) {
538
+ throw new Error(`App scaffold module navigation collision: ${navigationOwners.get(navigationId)} and ${id}: ${navigationId}`);
539
+ }
540
+ navigationOwners.set(navigationId, id);
541
+ }
542
+ for (const [value, owners, label] of [
543
+ ...entry.styles.map((style) => [style, styleOwners, 'style']),
544
+ ...entry.assets.map((asset) => [asset, assetOwners, 'asset']),
545
+ ]) {
546
+ for (const [otherPath, otherOwner] of owners) {
547
+ if (pathsOverlap(value, otherPath)) {
548
+ throw new Error(`App scaffold module ${label} collision: ${otherOwner} and ${id}: ${value}`);
549
+ }
550
+ }
551
+ owners.set(value, id);
552
+ }
553
+ }
554
+ return true;
555
+ }
556
+
557
+ function normalizeSelectionInput(input, { allowAll, requireArray }) {
558
+ if (input === undefined || input === null || input === '') return [];
559
+ if (requireArray && !Array.isArray(input)) {
560
+ throw new Error('Candidate feature selection must be an explicit feature id array');
561
+ }
562
+ const source = Array.isArray(input) ? input : [input];
563
+ if (requireArray && source.some((value) => typeof value !== 'string')) {
564
+ throw new Error('Candidate feature selection must contain only feature id strings');
565
+ }
566
+ const values = source.flatMap((value) => (
567
+ requireArray ? [String(value)] : String(value).split(',')
568
+ ));
569
+ const normalized = values.map((value) => value.trim());
570
+ if (normalized.some((value) => value.length === 0)) {
571
+ throw new Error('Feature selection contains an empty feature id');
572
+ }
573
+ if (normalized.includes('all')) {
574
+ if (!allowAll) throw new Error('Candidate feature selection does not accept "all"');
575
+ if (normalized.length !== 1) {
576
+ throw new Error('Feature selection "all" cannot be combined with explicit feature ids');
577
+ }
578
+ }
579
+ return normalized;
580
+ }
581
+
582
+ function resolveAppScaffoldGraph(input, registry, mode) {
583
+ validateAppScaffoldModuleRegistry(registry);
584
+ const ordered = registryEntries(registry);
585
+ const admittedFeatureIds = ordered
586
+ .filter(([, entry]) => entry.kind === 'feature' && entry.lifecycle === 'admitted')
587
+ .map(([id]) => id);
588
+ const normalized = normalizeSelectionInput(input, {
589
+ allowAll: mode === 'public',
590
+ requireArray: mode !== 'public',
591
+ });
592
+ const requested = normalized[0] === 'all'
593
+ ? (() => {
594
+ if (admittedFeatureIds.length === 0) {
595
+ throw new Error('No app scaffold capabilities are currently admitted');
596
+ }
597
+ return admittedFeatureIds;
598
+ })()
599
+ : normalized;
600
+ const requestedSet = new Set();
601
+ for (const id of requested) {
602
+ const entry = registry[id];
603
+ if (!entry) throw new Error(`Unknown app scaffold feature: ${id}`);
604
+ if (entry.kind === 'internal') {
605
+ throw new Error(`App scaffold internal module cannot be selected directly: ${id}`);
606
+ }
607
+ if (mode === 'public' && entry.lifecycle !== 'admitted') {
608
+ throw new Error(`App scaffold feature is not admitted: ${id}`);
609
+ }
610
+ requestedSet.add(id);
611
+ }
612
+
613
+ const visiting = new Set();
614
+ const included = new Set();
615
+ const visit = (id, lineage = []) => {
616
+ if (included.has(id)) return;
617
+ if (visiting.has(id)) {
618
+ throw new Error(`App scaffold module dependency cycle: ${[...lineage, id].join(' -> ')}`);
619
+ }
620
+ const entry = registry[id];
621
+ if (!entry) {
622
+ throw new Error(`App scaffold module dependency is unknown: ${[...lineage, id].join(' -> ')}`);
623
+ }
624
+ if (mode === 'public' && entry.kind === 'feature' && entry.lifecycle !== 'admitted') {
625
+ throw new Error(`Admitted app scaffold feature depends on non-admitted feature: ${id}`);
626
+ }
627
+ visiting.add(id);
628
+ for (const dependency of entry.requires) visit(dependency, [...lineage, id]);
629
+ visiting.delete(id);
630
+ included.add(id);
631
+ };
632
+ for (const id of requestedSet) visit(id);
633
+
634
+ const directFeatureIds = ordered
635
+ .map(([id]) => id)
636
+ .filter((id) => requestedSet.has(id));
637
+ const resolvedModuleIds = ordered
638
+ .map(([id]) => id)
639
+ .filter((id) => included.has(id));
640
+ const resolvedFeatureIds = resolvedModuleIds.filter((id) => registry[id].kind === 'feature');
641
+ if (mode === 'existing-intent') {
642
+ if (JSON.stringify(requested) !== JSON.stringify(directFeatureIds)) {
643
+ throw new Error('Existing scaffold intent directFeatures must be canonical registry order without duplicates');
644
+ }
645
+ }
646
+
647
+ const appAccessItems = [];
648
+ const appAccessSeen = new Set();
649
+ const npmDependencies = {};
650
+ const cargoDependencies = {};
651
+ const views = [];
652
+ const navigation = [];
653
+ const styles = [];
654
+ const assets = [];
655
+ const hostAdapterContracts = [];
656
+ const hostAdapterSeen = new Set();
657
+ const capabilityContractRefs = [];
658
+ const capabilityContractSeen = new Set();
659
+ const requiredStandardizedFeatureRefs = [];
660
+ const requiredStandardizedFeatureSeen = new Set();
661
+ for (const id of resolvedFeatureIds) {
662
+ const entry = registry[id];
663
+ for (const item of entry.appAccessItems) {
664
+ if (!appAccessSeen.has(item)) {
665
+ appAccessSeen.add(item);
666
+ appAccessItems.push(item);
667
+ }
668
+ }
669
+ for (const item of entry.capabilityContractRefs || []) {
670
+ if (!capabilityContractSeen.has(item)) {
671
+ capabilityContractSeen.add(item);
672
+ capabilityContractRefs.push(item);
673
+ }
674
+ }
675
+ for (const item of entry.requiredStandardizedFeatureRefs || []) {
676
+ if (!requiredStandardizedFeatureSeen.has(item)) {
677
+ requiredStandardizedFeatureSeen.add(item);
678
+ requiredStandardizedFeatureRefs.push(item);
679
+ }
680
+ }
681
+ }
682
+ for (const id of resolvedModuleIds) {
683
+ const entry = registry[id];
684
+ views.push(...entry.views);
685
+ navigation.push(...entry.navigation);
686
+ styles.push(...entry.styles.map((style) => targetPathForOwnedSource(entry, style)));
687
+ assets.push(...entry.assets.map((asset) => targetPathForOwnedSource(entry, asset)));
688
+ if (!hostAdapterSeen.has(entry.hostAdapterContract)) {
689
+ hostAdapterSeen.add(entry.hostAdapterContract);
690
+ hostAdapterContracts.push(entry.hostAdapterContract);
691
+ }
692
+ for (const [name, version] of Object.entries(entry.npmDependencies)) {
693
+ if (Object.hasOwn(npmDependencies, name) && npmDependencies[name] !== version) {
694
+ throw new Error(`App scaffold module dependency version collision for ${name}`);
695
+ }
696
+ npmDependencies[name] = version;
697
+ }
698
+ for (const [name, version] of Object.entries(entry.cargoDependencies)) {
699
+ if (Object.hasOwn(cargoDependencies, name) && !dependencyValuesEqual(cargoDependencies[name], version)) {
700
+ throw new Error(`App scaffold module Cargo dependency version collision for ${name}`);
701
+ }
702
+ cargoDependencies[name] = version;
703
+ }
704
+ }
705
+
706
+ return Object.freeze({
707
+ directFeatureIds: Object.freeze(directFeatureIds),
708
+ resolvedFeatureIds: Object.freeze(resolvedFeatureIds),
709
+ resolvedModuleIds: Object.freeze(resolvedModuleIds),
710
+ modules: Object.freeze(resolvedModuleIds.map((id) => registry[id])),
711
+ appAccessItems: Object.freeze(appAccessItems),
712
+ capabilityContractRefs: Object.freeze(capabilityContractRefs),
713
+ requiredStandardizedFeatureRefs: Object.freeze(requiredStandardizedFeatureRefs),
714
+ npmDependencies: Object.freeze(npmDependencies),
715
+ cargoDependencies: Object.freeze(cargoDependencies),
716
+ views: Object.freeze(views),
717
+ navigation: Object.freeze(navigation),
718
+ styles: Object.freeze(styles),
719
+ assets: Object.freeze(assets),
720
+ hostAdapterContracts: Object.freeze(hostAdapterContracts),
721
+ });
722
+ }
723
+
724
+ export function resolveAppScaffoldFeatures(input, registry = APP_SCAFFOLD_MODULE_REGISTRY) {
725
+ return resolveAppScaffoldGraph(input, registry, 'public');
726
+ }
727
+
728
+ export function resolveAppScaffoldCandidateFeatures(input, registry = APP_SCAFFOLD_MODULE_REGISTRY) {
729
+ return resolveAppScaffoldGraph(input, registry, 'candidate-validation');
730
+ }
731
+
732
+ export function resolveAppScaffoldIntentFeatures(input, registry = APP_SCAFFOLD_MODULE_REGISTRY) {
733
+ if (
734
+ !Array.isArray(input)
735
+ || input.some((value) => typeof value !== 'string' || value !== value.trim() || value.includes(','))
736
+ ) {
737
+ throw new Error('Existing scaffold canonical resolved intent directFeatures must be a canonical feature id array');
738
+ }
739
+ return resolveAppScaffoldGraph(input, registry, 'existing-intent');
740
+ }
741
+
742
+ function resolveAdmittedModuleIds(registry) {
743
+ validateAppScaffoldModuleRegistry(registry);
744
+ const admittedFeatureIds = registryEntries(registry)
745
+ .filter(([, entry]) => entry.kind === 'feature' && entry.lifecycle === 'admitted')
746
+ .map(([id]) => id);
747
+ if (admittedFeatureIds.length === 0) return Object.freeze([]);
748
+ return resolveAppScaffoldGraph(admittedFeatureIds, registry, 'public').resolvedModuleIds;
749
+ }
750
+
751
+ export const APP_SCAFFOLD_FEATURE_IDS = Object.freeze(
752
+ registryEntries(APP_SCAFFOLD_MODULE_REGISTRY)
753
+ .filter(([, entry]) => entry.kind === 'feature' && entry.lifecycle === 'admitted')
754
+ .map(([id]) => id),
755
+ );
756
+
757
+ // Exact active input for a fresh ordinary protected reference App.
758
+ export const APP_SCAFFOLD_REFERENCE_APP_FEATURE_IDS = Object.freeze([
759
+ 'studio-create',
760
+ 'studio-media',
761
+ 'studio-voice',
762
+ 'agent-center',
763
+ 'agent-conversation',
764
+ 'agent-realtime',
765
+ ]);
766
+
767
+ export const APP_SCAFFOLD_ADMITTED_MODULE_IDS = resolveAdmittedModuleIds(
768
+ APP_SCAFFOLD_MODULE_REGISTRY,
769
+ );