@aestheticfunction/dspack-emit 0.4.0 → 0.5.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 (74) hide show
  1. package/README.md +16 -6
  2. package/dist/cli.js +56 -0
  3. package/dist/index.d.ts +4 -1
  4. package/dist/index.js +3 -1
  5. package/dist/targets/a2ui/diagnostics.d.ts +110 -0
  6. package/dist/targets/a2ui/diagnostics.js +94 -0
  7. package/dist/targets/a2ui/surface.d.ts +28 -9
  8. package/dist/targets/a2ui/surface.js +566 -224
  9. package/dist/transform/desugar.d.ts +32 -0
  10. package/dist/transform/desugar.js +156 -0
  11. package/dist/transform/emit.js +59 -0
  12. package/dist/transform/index.js +4 -0
  13. package/dist/transform/mapping.d.ts +0 -6
  14. package/dist/transform/mapping.js +50 -0
  15. package/dist/transform/model.d.ts +275 -0
  16. package/dist/transform/model.js +148 -0
  17. package/dist/transform/parse-v2.d.ts +78 -0
  18. package/dist/transform/parse-v2.js +305 -0
  19. package/dist/transform/profile-load.d.ts +8 -7
  20. package/dist/transform/profile-load.js +101 -24
  21. package/dist/transform/profile-schema-v2.d.ts +9 -0
  22. package/dist/transform/profile-schema-v2.js +430 -0
  23. package/dist/transform/profile-schema.d.ts +8 -0
  24. package/dist/transform/profile-schema.js +382 -0
  25. package/dist/transform/profiles.d.ts +31 -1
  26. package/dist/transform/scaffold.d.ts +29 -12
  27. package/dist/transform/scaffold.js +91 -31
  28. package/dist/transform/shadcn-v2-respelling.d.ts +12 -0
  29. package/dist/transform/shadcn-v2-respelling.js +49 -0
  30. package/dist/transform/validate-v2.d.ts +36 -0
  31. package/dist/transform/validate-v2.js +100 -0
  32. package/dist/types.d.ts +19 -0
  33. package/dist/validate/ajv.js +98 -29
  34. package/dist/validate/meta/catalog-meta.d.ts +10 -0
  35. package/dist/validate/meta/catalog-meta.js +157 -0
  36. package/package.json +3 -3
  37. package/src/__snapshots__/byte-neutral.test.ts.snap +66 -0
  38. package/src/browser-boundary.test.ts +47 -0
  39. package/src/byte-neutral.test.ts +246 -0
  40. package/src/cli.ts +60 -0
  41. package/src/dangling-ref.test.ts +118 -0
  42. package/src/desugar.test.ts +162 -0
  43. package/src/engine-boundary.test.ts +248 -0
  44. package/src/eval-fixture.test.ts +89 -0
  45. package/src/functions.test.ts +182 -0
  46. package/src/index.ts +4 -1
  47. package/src/profile-load.test.ts +99 -1
  48. package/src/profile-v2.test.ts +363 -0
  49. package/src/review-findings.test.ts +292 -0
  50. package/src/schema-mirrors.test.ts +35 -0
  51. package/src/surface-fidelity.test.ts +213 -0
  52. package/src/targets/a2ui/diagnostics.ts +136 -0
  53. package/src/targets/a2ui/surface.ts +920 -242
  54. package/src/transform/desugar.ts +194 -0
  55. package/src/transform/emit.ts +65 -0
  56. package/src/transform/index.ts +5 -0
  57. package/src/transform/mapping.ts +42 -0
  58. package/src/transform/model.ts +325 -0
  59. package/src/transform/parse-v2.ts +397 -0
  60. package/src/transform/profile-load.ts +107 -28
  61. package/src/transform/profile-schema-v2.ts +430 -0
  62. package/src/transform/profile-schema.ts +382 -0
  63. package/src/transform/profile.v2.schema.json +422 -0
  64. package/src/transform/profiles.ts +32 -1
  65. package/src/transform/scaffold.ts +124 -47
  66. package/src/transform/shadcn-v2-respelling.ts +61 -0
  67. package/src/transform/validate-v2.ts +138 -0
  68. package/src/types.ts +20 -0
  69. package/src/validate/ajv.ts +91 -32
  70. package/src/validate/meta/catalog-meta.ts +167 -0
  71. package/src/validate-v2.test.ts +173 -0
  72. package/dist/transform/profile.v1.schema.json +0 -153
  73. package/dist/validate/meta/a2ui-catalog.meta.0_9_1.json +0 -39
  74. package/dist/validate/meta/a2ui-catalog.meta.1_0.json +0 -34
@@ -2,24 +2,40 @@
2
2
  * Profile-as-data: load a mapping Profile from JSON.
3
3
  *
4
4
  * The Profile has always been pure data (profiles.ts); this module makes it
5
- * *reachable* as data. `loadProfile` validates an untrusted JSON value against
6
- * schema `profile.v1.schema.json` (a one-to-one mirror of the TypeScript
7
- * `Profile` interface plus a `profileVersion` envelope const) and returns the
8
- * engine-ready `Profile`. Validation gates shape only — every judgment call
9
- * (valueMaps, casualties, surface plans) stays with the profile's author.
5
+ * *reachable* as data. `loadProfile` dispatches EXPLICITLY on the document's
6
+ * `profileVersion`:
7
+ *
8
+ * "1" — the original surface-plan directive language, validated against
9
+ * profile.v1.schema.json. Frozen: v1 documents keep loading and
10
+ * emitting byte-identically, indefinitely.
11
+ * "2" — the primitive language, validated against profile.v2.schema.json,
12
+ * then every plan's `surface` block is parsed and statically checked
13
+ * (parse-v2.ts) so that a v2 profile that loads is a profile the
14
+ * engine can emit. The returned Profile is stamped `language: "v2"`,
15
+ * which is what keys the transform layer's fail-closed contract
16
+ * validation — no document is ever silently interpreted under the
17
+ * wrong version.
18
+ *
19
+ * Anything else refuses with a pathed finding naming the supported versions.
20
+ * Validation gates shape and coherence only — every judgment call (valueMaps,
21
+ * casualties, routes) stays with the profile's author.
10
22
  *
11
23
  * Toolchain: ajv draft 2020-12, `strict: false`, ajv-formats — the same
12
24
  * convention as the catalog gates (src/validate/ajv.ts) and the dspack
13
25
  * harness.
14
26
  */
15
- import { readFileSync } from "node:fs";
16
- import { fileURLToPath } from "node:url";
17
27
  import Ajv2020 from "ajv/dist/2020.js";
18
28
  import addFormats from "ajv-formats";
29
+ import { profileSchema } from "./profile-schema.js";
30
+ import { profileSchemaV2 } from "./profile-schema-v2.js";
31
+ import { ProfileParseError, parseSurfaceV2 } from "./parse-v2.js";
32
+ /** The profile schemas, as shipped (also exported for hosts that surface them in UI). */
33
+ export { profileSchema } from "./profile-schema.js";
34
+ export { profileSchemaV2 } from "./profile-schema-v2.js";
19
35
  export class ProfileLoadError extends Error {
20
36
  issues;
21
- constructor(issues) {
22
- super(`profile does not conform to profile.v1.schema.json (${issues.length} issue${issues.length === 1 ? "" : "s"}): ` +
37
+ constructor(issues, schemaName = "profile.v1.schema.json") {
38
+ super(`profile does not conform to ${schemaName} (${issues.length} issue${issues.length === 1 ? "" : "s"}): ` +
23
39
  issues
24
40
  .slice(0, 3)
25
41
  .map((i) => `${i.path || "$"}: ${i.message}`)
@@ -29,30 +45,91 @@ export class ProfileLoadError extends Error {
29
45
  this.name = "ProfileLoadError";
30
46
  }
31
47
  }
32
- const schemaPath = fileURLToPath(new URL("./profile.v1.schema.json", import.meta.url));
33
- /** The profile schema, as shipped (also exported for hosts that surface it in UI). */
34
- export const profileSchema = JSON.parse(readFileSync(schemaPath, "utf8"));
35
- let compiled;
36
- function validator() {
37
- if (!compiled) {
48
+ const compiled = new Map();
49
+ function validator(version) {
50
+ let v = compiled.get(version);
51
+ if (!v) {
38
52
  const ajv = new Ajv2020({ strict: false, allErrors: true, validateFormats: true });
39
53
  addFormats(ajv);
40
- compiled = ajv.compile(profileSchema);
54
+ v = ajv.compile(version === "1" ? profileSchema : profileSchemaV2);
55
+ compiled.set(version, v);
41
56
  }
42
- return compiled;
57
+ return v;
58
+ }
59
+ function ajvIssues(validate) {
60
+ const errors = (validate.errors ?? []);
61
+ return errors.map((e) => ({ path: e.instancePath ?? "", message: e.message ?? "invalid" }));
43
62
  }
44
63
  /**
45
- * Validate `json` as a v1 profile document and return the engine-ready
46
- * `Profile`. The `profileVersion` envelope field is stripped — it belongs to
47
- * the document format, not the engine. Top-level `x-` extension keys are
48
- * preserved (the engine ignores them; provenance tools may not).
64
+ * Validate `json` as a profile document and return the engine-ready `Profile`.
65
+ * The `profileVersion` envelope field is stripped — it belongs to the document
66
+ * format, not the engine. Top-level `x-` extension keys are preserved (the
67
+ * engine ignores them; provenance tools may not).
49
68
  */
50
69
  export function loadProfile(json) {
51
- const validate = validator();
70
+ const version = json?.profileVersion;
71
+ if (version !== "1" && version !== "2") {
72
+ throw new ProfileLoadError([
73
+ {
74
+ path: "/profileVersion",
75
+ message: `unknown profile version ${JSON.stringify(version)} — this loader speaks "1" (surface-plan directives) and "2" (the primitive language)`,
76
+ },
77
+ ], "any supported profile schema");
78
+ }
79
+ const validate = validator(version);
52
80
  if (!validate(json)) {
53
- const errors = (validate.errors ?? []);
54
- throw new ProfileLoadError(errors.map((e) => ({ path: e.instancePath ?? "", message: e.message ?? "invalid" })));
81
+ throw new ProfileLoadError(ajvIssues(validate), `profile.v${version}.schema.json`);
55
82
  }
56
83
  const { profileVersion: _envelope, ...profile } = json;
84
+ if (version === "2") {
85
+ // Declared function args must be SELF-CONTAINED schemas. A $ref inside
86
+ // them couples the function's signature to emit internals at best and, at
87
+ // worst, is a dangling reference that ajv defers past gate A1's compile
88
+ // and then throws raw out of gate A3 — pass-or-crash, never a finding.
89
+ // Refuse the whole class at load, with the path.
90
+ const functions = profile.functions ?? {};
91
+ const refIssues = [];
92
+ const findRefs = (value, at) => {
93
+ if (Array.isArray(value))
94
+ value.forEach((v, i) => findRefs(v, `${at}/${i}`));
95
+ else if (value && typeof value === "object") {
96
+ for (const [k, v] of Object.entries(value)) {
97
+ if (k === "$ref")
98
+ refIssues.push({ path: at, message: `function args must be self-contained schemas; '$ref' is refused (found ${JSON.stringify(v)})` });
99
+ else
100
+ findRefs(v, `${at}/${k}`);
101
+ }
102
+ }
103
+ };
104
+ for (const [name, fn] of Object.entries(functions)) {
105
+ if (fn?.args)
106
+ findRefs(fn.args, `/functions/${name}/args`);
107
+ }
108
+ if (refIssues.length > 0)
109
+ throw new ProfileLoadError(refIssues, "profile.v2.schema.json (functions)");
110
+ // Parse every plan's surface block now, so a v2 profile that LOADS is a
111
+ // profile the engine can EMIT — grammar errors surface at load with
112
+ // pathed findings, not mid-emission.
113
+ const collections = [
114
+ ["components", profile.components ?? []],
115
+ ["synthesized", profile.synthesized ?? []],
116
+ ];
117
+ for (const [key, plans] of collections) {
118
+ for (const [i, plan] of plans.entries()) {
119
+ if (!plan.surface)
120
+ continue;
121
+ try {
122
+ parseSurfaceV2(plan.surface, plan, `/${key}/${i}/surface`);
123
+ }
124
+ catch (e) {
125
+ if (e instanceof ProfileParseError) {
126
+ throw new ProfileLoadError(e.issues, "profile.v2.schema.json (surface syntax)");
127
+ }
128
+ throw e;
129
+ }
130
+ }
131
+ }
132
+ profile.language = "v2";
133
+ }
57
134
  return profile;
58
135
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Runtime mirror of profile.v2.schema.json — same convention as
3
+ * profile-schema.ts: the .json file stays the reviewable schema document,
4
+ * this constant is what loadProfile imports so the loader bundles for the
5
+ * browser (dspack-studio composer) without filesystem access.
6
+ * src/schema-mirrors.test.ts asserts mirror and JSON stay identical — edit
7
+ * both together.
8
+ */
9
+ export declare const profileSchemaV2: Record<string, unknown>;
@@ -0,0 +1,430 @@
1
+ /**
2
+ * Runtime mirror of profile.v2.schema.json — same convention as
3
+ * profile-schema.ts: the .json file stays the reviewable schema document,
4
+ * this constant is what loadProfile imports so the loader bundles for the
5
+ * browser (dspack-studio composer) without filesystem access.
6
+ * src/schema-mirrors.test.ts asserts mirror and JSON stay identical — edit
7
+ * both together.
8
+ */
9
+ export const profileSchemaV2 = {
10
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
11
+ "$id": "https://aestheticfunction.github.io/dspack-emit/schema/profile.v2.schema.json",
12
+ "title": "dspack-emit a2ui Profile v2",
13
+ "description": "JSON form of the a2ui target's mapping Profile, second language. A v2 plan authors the internal transformation model directly \u2014 Identity / Route / Collect in a closed string syntax \u2014 instead of the v1 surface-plan directives. One profile language per document: this schema refuses `surfacePlan` and `subCoverage`; profile.v1.schema.json refuses `surface` and `functions`. loadProfile() dispatches on `profileVersion` and validates against exactly one of the two.",
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "patternProperties": {
17
+ "^x-": {}
18
+ },
19
+ "required": [
20
+ "profileVersion",
21
+ "catalogTitle",
22
+ "catalogDescription",
23
+ "catalogIdBase",
24
+ "instructions",
25
+ "primaryColorToken",
26
+ "components",
27
+ "synthesized",
28
+ "casualtyComponents",
29
+ "surfaceSynthesis"
30
+ ],
31
+ "properties": {
32
+ "profileVersion": {
33
+ "const": "2"
34
+ },
35
+ "catalogTitle": {
36
+ "type": "string",
37
+ "minLength": 1
38
+ },
39
+ "catalogDescription": {
40
+ "type": "string",
41
+ "minLength": 1
42
+ },
43
+ "catalogIdBase": {
44
+ "type": "string",
45
+ "format": "uri",
46
+ "pattern": "^https://"
47
+ },
48
+ "instructions": {
49
+ "type": "string"
50
+ },
51
+ "primaryColorToken": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": [
55
+ "category",
56
+ "name"
57
+ ],
58
+ "properties": {
59
+ "category": {
60
+ "type": "string",
61
+ "minLength": 1
62
+ },
63
+ "name": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ }
67
+ }
68
+ },
69
+ "components": {
70
+ "type": "array",
71
+ "items": {
72
+ "$ref": "#/$defs/componentPlan"
73
+ }
74
+ },
75
+ "synthesized": {
76
+ "type": "array",
77
+ "items": {
78
+ "$ref": "#/$defs/componentPlan"
79
+ }
80
+ },
81
+ "casualtyComponents": {
82
+ "type": "array",
83
+ "items": {
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "patternProperties": {
87
+ "^x-": {}
88
+ },
89
+ "required": [
90
+ "dspackId",
91
+ "attempted",
92
+ "class",
93
+ "reason"
94
+ ],
95
+ "properties": {
96
+ "dspackId": {
97
+ "$ref": "#/$defs/dspackId"
98
+ },
99
+ "attempted": {
100
+ "type": "string",
101
+ "minLength": 1
102
+ },
103
+ "class": {
104
+ "enum": [
105
+ "maps-cleanly",
106
+ "synthesis-defaults",
107
+ "lossy",
108
+ "cannot-represent"
109
+ ]
110
+ },
111
+ "reason": {
112
+ "type": "string",
113
+ "minLength": 1
114
+ }
115
+ }
116
+ }
117
+ },
118
+ "intentionallyOmitted": {
119
+ "type": "array",
120
+ "items": {
121
+ "$ref": "#/$defs/dspackId"
122
+ }
123
+ },
124
+ "surfaceSynthesis": {
125
+ "type": "object",
126
+ "additionalProperties": false,
127
+ "required": [
128
+ "textComponent",
129
+ "textProp",
130
+ "wrapComponent",
131
+ "wrapChildrenProp"
132
+ ],
133
+ "properties": {
134
+ "textComponent": {
135
+ "$ref": "#/$defs/a2uiName"
136
+ },
137
+ "textProp": {
138
+ "type": "string",
139
+ "minLength": 1
140
+ },
141
+ "wrapComponent": {
142
+ "$ref": "#/$defs/a2uiName"
143
+ },
144
+ "wrapChildrenProp": {
145
+ "type": "string",
146
+ "minLength": 1
147
+ }
148
+ }
149
+ },
150
+ "functions": {
151
+ "type": "object",
152
+ "description": "A2UI catalog functions this profile declares, keyed by call name. Emitted into the catalog's functions section and enforced on every FunctionCall: an instance calling an undeclared function fails gate A3. Definitions are declarative schemas for the call's args \u2014 never executable code.",
153
+ "propertyNames": {
154
+ "pattern": "^[a-z][A-Za-z0-9]*$"
155
+ },
156
+ "additionalProperties": {
157
+ "type": "object",
158
+ "additionalProperties": false,
159
+ "required": [
160
+ "description",
161
+ "returns"
162
+ ],
163
+ "properties": {
164
+ "description": {
165
+ "type": "string",
166
+ "minLength": 1
167
+ },
168
+ "returns": {
169
+ "enum": [
170
+ "string",
171
+ "number",
172
+ "boolean",
173
+ "array",
174
+ "object"
175
+ ]
176
+ },
177
+ "args": {
178
+ "type": "object",
179
+ "description": "JSON Schema (object form) validating the call's args object; omit for arg-less functions."
180
+ }
181
+ }
182
+ }
183
+ }
184
+ },
185
+ "$defs": {
186
+ "dspackId": {
187
+ "type": "string",
188
+ "pattern": "^[a-z][a-z0-9-]*$"
189
+ },
190
+ "a2uiName": {
191
+ "type": "string",
192
+ "pattern": "^[A-Z][A-Za-z0-9]*$"
193
+ },
194
+ "componentPlan": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "patternProperties": {
198
+ "^x-": {}
199
+ },
200
+ "required": [
201
+ "a2ui",
202
+ "commons",
203
+ "structural",
204
+ "required"
205
+ ],
206
+ "properties": {
207
+ "a2ui": {
208
+ "$ref": "#/$defs/a2uiName"
209
+ },
210
+ "dspackId": {
211
+ "$ref": "#/$defs/dspackId"
212
+ },
213
+ "description": {
214
+ "type": "string"
215
+ },
216
+ "commons": {
217
+ "type": "array",
218
+ "items": {
219
+ "type": "string",
220
+ "minLength": 1
221
+ }
222
+ },
223
+ "structural": {
224
+ "type": "object",
225
+ "additionalProperties": {
226
+ "type": "object",
227
+ "additionalProperties": false,
228
+ "required": [
229
+ "schema",
230
+ "description",
231
+ "synthNote"
232
+ ],
233
+ "properties": {
234
+ "schema": {},
235
+ "description": {
236
+ "type": "string",
237
+ "minLength": 1
238
+ },
239
+ "synthNote": {
240
+ "type": "string",
241
+ "minLength": 1
242
+ }
243
+ }
244
+ }
245
+ },
246
+ "propMap": {
247
+ "type": "object",
248
+ "additionalProperties": {
249
+ "type": "object",
250
+ "additionalProperties": false,
251
+ "required": [
252
+ "a2ui",
253
+ "kind"
254
+ ],
255
+ "properties": {
256
+ "a2ui": {
257
+ "type": "string",
258
+ "minLength": 1
259
+ },
260
+ "kind": {
261
+ "enum": [
262
+ "enum",
263
+ "string",
264
+ "boolean",
265
+ "number"
266
+ ]
267
+ },
268
+ "targetEnum": {
269
+ "type": "array",
270
+ "items": {
271
+ "type": "string"
272
+ },
273
+ "minItems": 1
274
+ },
275
+ "valueMap": {
276
+ "type": "object",
277
+ "additionalProperties": {
278
+ "type": "string"
279
+ }
280
+ },
281
+ "default": {
282
+ "type": "string"
283
+ },
284
+ "description": {
285
+ "type": "string"
286
+ }
287
+ }
288
+ }
289
+ },
290
+ "required": {
291
+ "type": "array",
292
+ "items": {
293
+ "type": "string"
294
+ }
295
+ },
296
+ "surface": {
297
+ "type": "object",
298
+ "additionalProperties": false,
299
+ "patternProperties": {
300
+ "^x-": {}
301
+ },
302
+ "properties": {
303
+ "routes": {
304
+ "type": "array",
305
+ "items": {
306
+ "type": "object",
307
+ "additionalProperties": false,
308
+ "required": [
309
+ "from",
310
+ "to"
311
+ ],
312
+ "properties": {
313
+ "from": {
314
+ "type": "array",
315
+ "minItems": 1,
316
+ "description": "Ordered fallback chain; the first selector that yields a value wins.",
317
+ "items": {
318
+ "type": "string",
319
+ "pattern": "^(self\\.text|self\\.props\\.[A-Za-z][A-Za-z0-9]*|sub\\([a-z][a-z0-9-]*(\\|[a-z][a-z0-9-]*)*\\)\\.(text|label|firstText|subtreeText)|children|synthesized\\.action)$"
320
+ }
321
+ },
322
+ "to": {
323
+ "type": "string",
324
+ "pattern": "^(prop|textChild|slot|slots|action):[A-Za-z][A-Za-z0-9]*$"
325
+ },
326
+ "overwrite": {
327
+ "type": "boolean"
328
+ }
329
+ }
330
+ }
331
+ },
332
+ "collects": {
333
+ "type": "array",
334
+ "items": {
335
+ "type": "object",
336
+ "additionalProperties": false,
337
+ "required": [
338
+ "of",
339
+ "into",
340
+ "shape",
341
+ "row",
342
+ "cells"
343
+ ],
344
+ "properties": {
345
+ "of": {
346
+ "type": "array",
347
+ "minItems": 1,
348
+ "items": {
349
+ "type": "string",
350
+ "pattern": "^[a-z][a-z0-9-]*$"
351
+ }
352
+ },
353
+ "into": {
354
+ "type": "string",
355
+ "pattern": "^prop:[A-Za-z][A-Za-z0-9]*$"
356
+ },
357
+ "shape": {
358
+ "enum": [
359
+ "flat",
360
+ "records"
361
+ ]
362
+ },
363
+ "field": {
364
+ "type": "string",
365
+ "pattern": "^[A-Za-z][A-Za-z0-9]*$"
366
+ },
367
+ "row": {
368
+ "type": "array",
369
+ "minItems": 1,
370
+ "items": {
371
+ "type": "string",
372
+ "pattern": "^[a-z][a-z0-9-]*$"
373
+ }
374
+ },
375
+ "cells": {
376
+ "type": "array",
377
+ "minItems": 1,
378
+ "items": {
379
+ "type": "string",
380
+ "pattern": "^[a-z][a-z0-9-]*$"
381
+ }
382
+ }
383
+ }
384
+ }
385
+ },
386
+ "subs": {
387
+ "type": "object",
388
+ "propertyNames": {
389
+ "pattern": "^[a-z][a-z0-9-]*$"
390
+ },
391
+ "additionalProperties": {
392
+ "oneOf": [
393
+ {
394
+ "const": "transparent"
395
+ },
396
+ {
397
+ "type": "object",
398
+ "additionalProperties": false,
399
+ "required": [
400
+ "asText"
401
+ ],
402
+ "properties": {
403
+ "asText": {
404
+ "type": "string",
405
+ "minLength": 1
406
+ }
407
+ }
408
+ },
409
+ {
410
+ "type": "object",
411
+ "additionalProperties": false,
412
+ "required": [
413
+ "drop"
414
+ ],
415
+ "properties": {
416
+ "drop": {
417
+ "type": "string",
418
+ "minLength": 1
419
+ }
420
+ }
421
+ }
422
+ ]
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
429
+ }
430
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Runtime mirror of profile.v1.schema.json. The .json file stays the
3
+ * reviewable schema document (docs/PROFILES.md links it); this constant
4
+ * exists because loadProfile must run in a browser bundle (dspack-studio
5
+ * composer), where readFileSync is not available. src/schema-mirrors.test.ts
6
+ * asserts mirror and JSON stay identical — edit both together.
7
+ */
8
+ export declare const profileSchema: Record<string, unknown>;