@inf-monkeys-tech/monkeys 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/contracts/declarative-control-http.d.ts +55903 -73794
  2. package/lib/contracts/declarative-control-http.d.ts.map +1 -1
  3. package/lib/contracts/declarative-control-http.js +703 -544
  4. package/lib/contracts/declarative-control-http.js.map +1 -1
  5. package/lib/contracts/declarative-control.d.ts +1623 -3
  6. package/lib/contracts/declarative-control.d.ts.map +1 -1
  7. package/lib/contracts/declarative-control.js +2107 -1136
  8. package/lib/contracts/declarative-control.js.map +1 -1
  9. package/lib/contracts/render.d.ts +591 -1
  10. package/lib/contracts/render.d.ts.map +1 -1
  11. package/lib/contracts/render.js +331 -134
  12. package/lib/contracts/render.js.map +1 -1
  13. package/lib/contracts/tenant.d.ts +3 -3
  14. package/lib/contracts/theme.d.ts +1 -1
  15. package/lib/esm/contracts/index.mjs +1872 -409
  16. package/lib/esm/contracts/index.mjs.map +1 -1
  17. package/lib/esm/index.mjs +3028 -672
  18. package/lib/esm/index.mjs.map +1 -1
  19. package/lib/esm/runtime/index.mjs +3016 -670
  20. package/lib/esm/runtime/index.mjs.map +1 -1
  21. package/lib/esm/schemas/index.mjs +1866 -412
  22. package/lib/esm/schemas/index.mjs.map +1 -1
  23. package/lib/json-schema/overlay-node.schema.json +602 -0
  24. package/lib/json-schema/page-runtime-bundle.schema.json +602 -0
  25. package/lib/json-schema/page.schema.json +5619 -11743
  26. package/lib/json-schema/render-node.schema.json +602 -0
  27. package/lib/json-schema/render-tree.schema.json +602 -0
  28. package/lib/runtime/declarative-control-compiler.d.ts +52 -27
  29. package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
  30. package/lib/runtime/declarative-control-compiler.js +858 -366
  31. package/lib/runtime/declarative-control-compiler.js.map +1 -1
  32. package/lib/schemas/index.d.ts +787 -2335
  33. package/lib/schemas/index.d.ts.map +1 -1
  34. package/lib/schemas/index.js +100 -99
  35. package/lib/schemas/index.js.map +1 -1
  36. package/package.json +1 -1
@@ -1,82 +1,101 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ViewProviderDescriptorSchema = exports.ApplicationHandoffSchema = exports.ApplicationHandoffEndpointSchema = exports.OverlayNodeSchema = exports.OverlayZIndexLaneSchema = exports.RenderTreeSchema = exports.RenderNodeSchema = exports.RenderResponsiveRuleSchema = exports.RenderLayoutSchema = exports.RenderLifecycleSchema = exports.RenderActivationSchema = exports.RenderScrollSchema = exports.RenderSurfaceSchema = exports.RenderNodeKindSchema = exports.RenderNodeStateSchema = exports.ProductContextSchema = void 0;
3
+ exports.ViewProviderDescriptorSchema = exports.ApplicationHandoffSchema = exports.ApplicationHandoffEndpointSchema = exports.OverlayNodeSchema = exports.OverlayZIndexLaneSchema = exports.RenderTreeSchema = exports.RenderNodeSchema = exports.RenderStyleSchema = exports.RenderStyleValueSchema = exports.RenderResponsiveRuleSchema = exports.RenderLayoutSchema = exports.RenderLifecycleSchema = exports.RenderActivationSchema = exports.RenderScrollSchema = exports.RenderSurfaceSchema = exports.RenderNodeKindSchema = exports.RenderNodeStateSchema = exports.ProductContextSchema = void 0;
4
4
  const page_expression_1 = require("./page-expression");
5
5
  const zod_1 = require("zod");
6
6
  const common_1 = require("./common");
7
- exports.ProductContextSchema = zod_1.z.enum(['studio', 'kernel']);
7
+ exports.ProductContextSchema = zod_1.z.enum(["studio", "kernel"]);
8
8
  exports.RenderNodeStateSchema = zod_1.z.enum([
9
- 'idle',
10
- 'loading',
11
- 'empty',
12
- 'error',
13
- 'success',
14
- 'disabled',
15
- 'selected',
9
+ "idle",
10
+ "loading",
11
+ "empty",
12
+ "error",
13
+ "success",
14
+ "disabled",
15
+ "selected",
16
16
  ]);
17
17
  exports.RenderNodeKindSchema = zod_1.z.enum([
18
- 'shell',
19
- 'page',
20
- 'navigation',
21
- 'view',
22
- 'record',
23
- 'control',
24
- 'detail',
25
- 'action',
26
- 'overlay',
27
- 'professional-provider',
18
+ "shell",
19
+ "page",
20
+ "navigation",
21
+ "view",
22
+ "record",
23
+ "control",
24
+ "detail",
25
+ "action",
26
+ "overlay",
27
+ "professional-provider",
28
28
  ]);
29
29
  exports.RenderSurfaceSchema = zod_1.z
30
30
  .object({
31
- frameOwner: zod_1.z.enum(['host', 'provider', 'none']),
31
+ frameOwner: zod_1.z.enum(["host", "provider", "none"]),
32
32
  tone: common_1.ContractIdentifierSchema.optional(),
33
- density: zod_1.z.enum(['compact', 'default', 'comfortable']),
33
+ density: zod_1.z.enum(["compact", "default", "comfortable"]),
34
34
  })
35
35
  .strict();
36
36
  exports.RenderScrollSchema = zod_1.z
37
37
  .object({
38
- owner: zod_1.z.enum(['page', 'surface', 'provider']),
39
- axis: zod_1.z.enum(['x', 'y', 'both', 'none']),
38
+ owner: zod_1.z.enum(["page", "surface", "provider"]),
39
+ axis: zod_1.z.enum(["x", "y", "both", "none"]),
40
40
  restoreKey: common_1.ContractIdentifierSchema.optional(),
41
41
  virtualizationBoundary: zod_1.z.boolean(),
42
42
  })
43
43
  .strict()
44
44
  .superRefine((scroll, context) => {
45
- if (scroll.owner === 'provider' && scroll.restoreKey) {
45
+ if (scroll.owner === "provider" && scroll.restoreKey) {
46
46
  context.addIssue({
47
- code: 'custom',
48
- path: ['restoreKey'],
49
- message: 'Provider-owned scroll state cannot declare a host restoreKey.',
47
+ code: "custom",
48
+ path: ["restoreKey"],
49
+ message: "Provider-owned scroll state cannot declare a host restoreKey.",
50
50
  });
51
51
  }
52
- if (scroll.virtualizationBoundary && scroll.owner !== 'provider') {
52
+ if (scroll.virtualizationBoundary && scroll.owner !== "provider") {
53
53
  context.addIssue({
54
- code: 'custom',
55
- path: ['owner'],
56
- message: 'A virtualization boundary must keep scroll ownership in the provider.',
54
+ code: "custom",
55
+ path: ["owner"],
56
+ message: "A virtualization boundary must keep scroll ownership in the provider.",
57
57
  });
58
58
  }
59
59
  });
60
60
  exports.RenderActivationSchema = zod_1.z
61
61
  .object({
62
62
  activationId: common_1.ContractIdentifierSchema,
63
- mode: zod_1.z.enum(['navigate', 'select', 'drawer', 'modal', 'fullscreen', 'inline']),
64
- targetPath: zod_1.z.string().trim().regex(/^\/(?!\/)/, 'Expected an application-relative path.').optional(),
65
- history: zod_1.z.enum(['push', 'replace']).optional(),
63
+ mode: zod_1.z.enum([
64
+ "navigate",
65
+ "select",
66
+ "drawer",
67
+ "modal",
68
+ "fullscreen",
69
+ "inline",
70
+ ]),
71
+ targetPath: zod_1.z
72
+ .string()
73
+ .trim()
74
+ .regex(/^\/(?!\/)/, "Expected an application-relative path.")
75
+ .optional(),
76
+ history: zod_1.z.enum(["push", "replace"]).optional(),
66
77
  })
67
78
  .strict()
68
79
  .superRefine((activation, context) => {
69
- if (activation.mode === 'navigate' && !activation.targetPath) {
70
- context.addIssue({ code: 'custom', path: ['targetPath'], message: 'Navigate activation requires an application-relative targetPath.' });
80
+ if (activation.mode === "navigate" && !activation.targetPath) {
81
+ context.addIssue({
82
+ code: "custom",
83
+ path: ["targetPath"],
84
+ message: "Navigate activation requires an application-relative targetPath.",
85
+ });
71
86
  }
72
- if (activation.mode !== 'navigate' && activation.targetPath) {
73
- context.addIssue({ code: 'custom', path: ['targetPath'], message: 'Only navigate activation may declare targetPath.' });
87
+ if (activation.mode !== "navigate" && activation.targetPath) {
88
+ context.addIssue({
89
+ code: "custom",
90
+ path: ["targetPath"],
91
+ message: "Only navigate activation may declare targetPath.",
92
+ });
74
93
  }
75
94
  });
76
95
  exports.RenderLifecycleSchema = zod_1.z
77
96
  .object({
78
- mountPolicy: zod_1.z.enum(['always', 'when-visible', 'when-active']),
79
- queryPolicy: zod_1.z.enum(['always', 'when-visible', 'when-active', 'manual']),
97
+ mountPolicy: zod_1.z.enum(["always", "when-visible", "when-active"]),
98
+ queryPolicy: zod_1.z.enum(["always", "when-visible", "when-active", "manual"]),
80
99
  retainOnDeactivate: zod_1.z.boolean(),
81
100
  deepLink: zod_1.z.boolean(),
82
101
  focusReturn: zod_1.z.boolean(),
@@ -84,23 +103,35 @@ exports.RenderLifecycleSchema = zod_1.z
84
103
  .strict();
85
104
  exports.RenderLayoutSchema = zod_1.z
86
105
  .object({
87
- mode: zod_1.z.enum(['contents', 'block', 'flex', 'grid', 'absolute']),
88
- direction: zod_1.z.enum(['row', 'column']).optional(),
106
+ mode: zod_1.z.enum(["contents", "block", "flex", "grid", "absolute"]),
107
+ direction: zod_1.z.enum(["row", "column"]).optional(),
89
108
  columns: zod_1.z.number().int().positive().optional(),
90
- align: zod_1.z.enum(['start', 'center', 'end', 'stretch']).optional(),
91
- justify: zod_1.z.enum(['start', 'center', 'end', 'between', 'around']).optional(),
109
+ align: zod_1.z.enum(["start", "center", "end", "stretch"]).optional(),
110
+ justify: zod_1.z.enum(["start", "center", "end", "between", "around"]).optional(),
92
111
  gapTokenRef: common_1.EntityRefSchema.optional(),
93
112
  })
94
113
  .strict()
95
114
  .superRefine((layout, context) => {
96
- if (layout.direction && layout.mode !== 'flex') {
97
- context.addIssue({ code: 'custom', path: ['direction'], message: 'direction is only valid for flex layout.' });
115
+ if (layout.direction && layout.mode !== "flex") {
116
+ context.addIssue({
117
+ code: "custom",
118
+ path: ["direction"],
119
+ message: "direction is only valid for flex layout.",
120
+ });
98
121
  }
99
- if (layout.columns && layout.mode !== 'grid') {
100
- context.addIssue({ code: 'custom', path: ['columns'], message: 'columns is only valid for grid layout.' });
122
+ if (layout.columns && layout.mode !== "grid") {
123
+ context.addIssue({
124
+ code: "custom",
125
+ path: ["columns"],
126
+ message: "columns is only valid for grid layout.",
127
+ });
101
128
  }
102
- if (layout.gapTokenRef && layout.gapTokenRef.kind !== 'design-token') {
103
- context.addIssue({ code: 'custom', path: ['gapTokenRef', 'kind'], message: 'gapTokenRef must reference design-token.' });
129
+ if (layout.gapTokenRef && layout.gapTokenRef.kind !== "design-token") {
130
+ context.addIssue({
131
+ code: "custom",
132
+ path: ["gapTokenRef", "kind"],
133
+ message: "gapTokenRef must reference design-token.",
134
+ });
104
135
  }
105
136
  });
106
137
  exports.RenderResponsiveRuleSchema = zod_1.z
@@ -112,20 +143,143 @@ exports.RenderResponsiveRuleSchema = zod_1.z
112
143
  .strict()
113
144
  .superRefine((rule, context) => {
114
145
  if (rule.minWidthPx === undefined && rule.maxWidthPx === undefined) {
115
- context.addIssue({ code: 'custom', path: [], message: 'Responsive rule must declare minWidthPx or maxWidthPx.' });
146
+ context.addIssue({
147
+ code: "custom",
148
+ path: [],
149
+ message: "Responsive rule must declare minWidthPx or maxWidthPx.",
150
+ });
116
151
  }
117
- if (rule.minWidthPx !== undefined && rule.maxWidthPx !== undefined && rule.minWidthPx > rule.maxWidthPx) {
118
- context.addIssue({ code: 'custom', path: ['maxWidthPx'], message: 'maxWidthPx must be greater than or equal to minWidthPx.' });
152
+ if (rule.minWidthPx !== undefined &&
153
+ rule.maxWidthPx !== undefined &&
154
+ rule.minWidthPx > rule.maxWidthPx) {
155
+ context.addIssue({
156
+ code: "custom",
157
+ path: ["maxWidthPx"],
158
+ message: "maxWidthPx must be greater than or equal to minWidthPx.",
159
+ });
119
160
  }
120
161
  });
162
+ exports.RenderStyleValueSchema = zod_1.z.union([
163
+ zod_1.z.number().finite(),
164
+ zod_1.z
165
+ .string()
166
+ .trim()
167
+ .min(1)
168
+ .max(256)
169
+ .superRefine((value, context) => {
170
+ if (/[;{}]/.test(value) ||
171
+ /(?:url|expression|javascript|var)\s*\(/i.test(value)) {
172
+ context.addIssue({
173
+ code: "custom",
174
+ message: "Render style values must be bounded CSS values or $ Design Token references.",
175
+ });
176
+ }
177
+ }),
178
+ ]);
179
+ exports.RenderStyleSchema = zod_1.z
180
+ .object({
181
+ width: exports.RenderStyleValueSchema.optional(),
182
+ height: exports.RenderStyleValueSchema.optional(),
183
+ minWidth: exports.RenderStyleValueSchema.optional(),
184
+ maxWidth: exports.RenderStyleValueSchema.optional(),
185
+ minHeight: exports.RenderStyleValueSchema.optional(),
186
+ maxHeight: exports.RenderStyleValueSchema.optional(),
187
+ padding: exports.RenderStyleValueSchema.optional(),
188
+ paddingBlock: exports.RenderStyleValueSchema.optional(),
189
+ paddingInline: exports.RenderStyleValueSchema.optional(),
190
+ margin: exports.RenderStyleValueSchema.optional(),
191
+ marginBlockStart: exports.RenderStyleValueSchema.optional(),
192
+ marginBlockEnd: exports.RenderStyleValueSchema.optional(),
193
+ marginInlineStart: exports.RenderStyleValueSchema.optional(),
194
+ marginInlineEnd: exports.RenderStyleValueSchema.optional(),
195
+ display: zod_1.z
196
+ .enum([
197
+ "none",
198
+ "block",
199
+ "inline",
200
+ "inline-block",
201
+ "flex",
202
+ "inline-flex",
203
+ "grid",
204
+ "contents",
205
+ ])
206
+ .optional(),
207
+ gap: exports.RenderStyleValueSchema.optional(),
208
+ rowGap: exports.RenderStyleValueSchema.optional(),
209
+ columnGap: exports.RenderStyleValueSchema.optional(),
210
+ background: exports.RenderStyleValueSchema.optional(),
211
+ color: exports.RenderStyleValueSchema.optional(),
212
+ borderColor: exports.RenderStyleValueSchema.optional(),
213
+ borderWidth: exports.RenderStyleValueSchema.optional(),
214
+ borderStyle: zod_1.z.enum(["none", "solid", "dashed", "dotted"]).optional(),
215
+ borderRadius: exports.RenderStyleValueSchema.optional(),
216
+ boxShadow: exports.RenderStyleValueSchema.optional(),
217
+ fontSize: exports.RenderStyleValueSchema.optional(),
218
+ fontFamily: exports.RenderStyleValueSchema.optional(),
219
+ fontWeight: exports.RenderStyleValueSchema.optional(),
220
+ lineHeight: exports.RenderStyleValueSchema.optional(),
221
+ textAlign: zod_1.z.enum(["start", "center", "end", "left", "right"]).optional(),
222
+ whiteSpace: zod_1.z
223
+ .enum(["normal", "nowrap", "pre", "pre-wrap", "pre-line", "break-spaces"])
224
+ .optional(),
225
+ overflow: zod_1.z
226
+ .enum(["visible", "hidden", "auto", "scroll", "clip"])
227
+ .optional(),
228
+ overflowX: zod_1.z
229
+ .enum(["visible", "hidden", "auto", "scroll", "clip"])
230
+ .optional(),
231
+ overflowY: zod_1.z
232
+ .enum(["visible", "hidden", "auto", "scroll", "clip"])
233
+ .optional(),
234
+ position: zod_1.z
235
+ .enum(["static", "relative", "absolute", "sticky", "fixed"])
236
+ .optional(),
237
+ inset: exports.RenderStyleValueSchema.optional(),
238
+ top: exports.RenderStyleValueSchema.optional(),
239
+ right: exports.RenderStyleValueSchema.optional(),
240
+ bottom: exports.RenderStyleValueSchema.optional(),
241
+ left: exports.RenderStyleValueSchema.optional(),
242
+ gridTemplateColumns: exports.RenderStyleValueSchema.optional(),
243
+ gridColumn: exports.RenderStyleValueSchema.optional(),
244
+ gridRow: exports.RenderStyleValueSchema.optional(),
245
+ flex: exports.RenderStyleValueSchema.optional(),
246
+ flexDirection: zod_1.z
247
+ .enum(["row", "row-reverse", "column", "column-reverse"])
248
+ .optional(),
249
+ flexWrap: zod_1.z.enum(["nowrap", "wrap", "wrap-reverse"]).optional(),
250
+ alignItems: zod_1.z
251
+ .enum(["start", "center", "end", "stretch", "baseline"])
252
+ .optional(),
253
+ justifyContent: zod_1.z
254
+ .enum([
255
+ "start",
256
+ "center",
257
+ "end",
258
+ "space-between",
259
+ "space-around",
260
+ "space-evenly",
261
+ ])
262
+ .optional(),
263
+ flexGrow: zod_1.z.number().finite().nonnegative().optional(),
264
+ flexShrink: zod_1.z.number().finite().nonnegative().optional(),
265
+ alignSelf: zod_1.z.enum(["auto", "start", "center", "end", "stretch"]).optional(),
266
+ justifySelf: zod_1.z
267
+ .enum(["auto", "start", "center", "end", "stretch"])
268
+ .optional(),
269
+ objectFit: zod_1.z
270
+ .enum(["contain", "cover", "fill", "none", "scale-down"])
271
+ .optional(),
272
+ opacity: zod_1.z.number().finite().min(0).max(1).optional(),
273
+ })
274
+ .strict();
121
275
  const requireRef = (reference, expectedKind, path, context) => {
122
276
  if (!reference)
123
277
  return;
124
278
  if (reference.kind !== expectedKind) {
125
279
  context.addIssue({
126
- code: 'custom',
127
- path: [...path, 'kind'],
128
- message: `${path.join('.')} must reference ${expectedKind}.`,
280
+ code: "custom",
281
+ path: [...path, "kind"],
282
+ message: `${path.join(".")} must reference ${expectedKind}.`,
129
283
  });
130
284
  }
131
285
  };
@@ -135,22 +289,22 @@ const requirePinnedOwnedRef = (reference, expectedKind, path, context) => {
135
289
  return;
136
290
  if (reference.version === undefined) {
137
291
  context.addIssue({
138
- code: 'custom',
139
- path: [...path, 'version'],
140
- message: `${path.join('.')} must pin a version.`,
292
+ code: "custom",
293
+ path: [...path, "version"],
294
+ message: `${path.join(".")} must pin a version.`,
141
295
  });
142
296
  }
143
297
  if (reference.ownerRepo === undefined) {
144
298
  context.addIssue({
145
- code: 'custom',
146
- path: [...path, 'ownerRepo'],
147
- message: `${path.join('.')} must declare its owner repository.`,
299
+ code: "custom",
300
+ path: [...path, "ownerRepo"],
301
+ message: `${path.join(".")} must declare its owner repository.`,
148
302
  });
149
303
  }
150
304
  };
151
305
  exports.RenderNodeSchema = zod_1.z
152
306
  .object({
153
- contract: zod_1.z.literal('RenderNode'),
307
+ contract: zod_1.z.literal("RenderNode"),
154
308
  nodeId: common_1.ContractIdentifierSchema,
155
309
  kind: exports.RenderNodeKindSchema,
156
310
  version: common_1.ContractVersionSchema,
@@ -169,44 +323,60 @@ exports.RenderNodeSchema = zod_1.z
169
323
  activation: exports.RenderActivationSchema,
170
324
  lifecycle: exports.RenderLifecycleSchema,
171
325
  layout: exports.RenderLayoutSchema,
326
+ style: exports.RenderStyleSchema.optional(),
172
327
  responsive: zod_1.z.array(exports.RenderResponsiveRuleSchema),
173
328
  accessRef: common_1.EntityRefSchema.optional(),
174
329
  evidenceRef: common_1.EntityRefSchema.optional(),
175
330
  state: exports.RenderNodeStateSchema,
176
331
  renderModel: common_1.JsonObjectSchema,
177
- repeat: zod_1.z.object({ source: page_expression_1.PageExpressionSchema, keyPath: page_expression_1.PageValuePathSchema.min(1), limit: zod_1.z.number().int().min(1).max(1000).default(200) }).strict().optional(),
332
+ repeat: zod_1.z
333
+ .object({
334
+ source: page_expression_1.PageExpressionSchema,
335
+ keyPath: page_expression_1.PageValuePathSchema.min(1),
336
+ limit: zod_1.z.number().int().min(1).max(1000).default(200),
337
+ })
338
+ .strict()
339
+ .optional(),
178
340
  })
179
341
  .strict()
180
342
  .superRefine((node, context) => {
181
- requireRef(node.pageRef, 'page', ['pageRef'], context);
182
- requirePinnedOwnedRef(node.capabilityRef, 'capability', ['capabilityRef'], context);
183
- requirePinnedOwnedRef(node.providerRef, 'view-provider', ['providerRef'], context);
184
- requireRef(node.accessRef, 'access-policy', ['accessRef'], context);
185
- requireRef(node.evidenceRef, 'evidence', ['evidenceRef'], context);
343
+ requireRef(node.pageRef, "page", ["pageRef"], context);
344
+ requirePinnedOwnedRef(node.capabilityRef, "capability", ["capabilityRef"], context);
345
+ requirePinnedOwnedRef(node.providerRef, "view-provider", ["providerRef"], context);
346
+ requireRef(node.accessRef, "access-policy", ["accessRef"], context);
347
+ requireRef(node.evidenceRef, "evidence", ["evidenceRef"], context);
186
348
  if (node.parentNodeId === node.nodeId) {
187
349
  context.addIssue({
188
- code: 'custom',
189
- path: ['parentNodeId'],
190
- message: 'RenderNode cannot be its own parent.',
350
+ code: "custom",
351
+ path: ["parentNodeId"],
352
+ message: "RenderNode cannot be its own parent.",
191
353
  });
192
354
  }
193
355
  if (new Set(node.children).size !== node.children.length) {
194
- context.addIssue({ code: 'custom', path: ['children'], message: 'RenderNode children must be unique.' });
356
+ context.addIssue({
357
+ code: "custom",
358
+ path: ["children"],
359
+ message: "RenderNode children must be unique.",
360
+ });
195
361
  }
196
362
  if (node.children.includes(node.nodeId)) {
197
- context.addIssue({ code: 'custom', path: ['children'], message: 'RenderNode cannot be its own child.' });
363
+ context.addIssue({
364
+ code: "custom",
365
+ path: ["children"],
366
+ message: "RenderNode cannot be its own child.",
367
+ });
198
368
  }
199
- if (node.surface.frameOwner === 'provider' && !node.providerRef) {
369
+ if (node.surface.frameOwner === "provider" && !node.providerRef) {
200
370
  context.addIssue({
201
- code: 'custom',
202
- path: ['providerRef'],
203
- message: 'Provider-owned surfaces require providerRef.',
371
+ code: "custom",
372
+ path: ["providerRef"],
373
+ message: "Provider-owned surfaces require providerRef.",
204
374
  });
205
375
  }
206
376
  });
207
377
  exports.RenderTreeSchema = zod_1.z
208
378
  .object({
209
- contract: zod_1.z.literal('RenderTree'),
379
+ contract: zod_1.z.literal("RenderTree"),
210
380
  treeId: common_1.ContractIdentifierSchema,
211
381
  product: exports.ProductContextSchema,
212
382
  rootNodeId: common_1.ContractIdentifierSchema,
@@ -214,30 +384,30 @@ exports.RenderTreeSchema = zod_1.z
214
384
  })
215
385
  .strict();
216
386
  exports.OverlayZIndexLaneSchema = zod_1.z.enum([
217
- 'popover',
218
- 'drawer',
219
- 'modal',
220
- 'fullscreen',
221
- 'system',
387
+ "popover",
388
+ "drawer",
389
+ "modal",
390
+ "fullscreen",
391
+ "system",
222
392
  ]);
223
393
  exports.OverlayNodeSchema = zod_1.z
224
394
  .object({
225
- contract: zod_1.z.literal('OverlayNode'),
395
+ contract: zod_1.z.literal("OverlayNode"),
226
396
  overlayId: common_1.ContractIdentifierSchema,
227
397
  renderNode: exports.RenderNodeSchema,
228
- presentation: zod_1.z.enum(['drawer', 'modal', 'fullscreen']),
398
+ presentation: zod_1.z.enum(["drawer", "modal", "fullscreen"]),
229
399
  zIndexLane: exports.OverlayZIndexLaneSchema,
230
400
  url: zod_1.z
231
401
  .object({
232
402
  parameter: common_1.ContractIdentifierSchema,
233
403
  value: common_1.ContractIdentifierSchema,
234
- openMode: zod_1.z.enum(['push', 'replace']),
235
- closeMode: zod_1.z.enum(['back', 'replace']),
404
+ openMode: zod_1.z.enum(["push", "replace"]),
405
+ closeMode: zod_1.z.enum(["back", "replace"]),
236
406
  })
237
407
  .strict(),
238
408
  focus: zod_1.z
239
409
  .object({
240
- initial: zod_1.z.enum(['first-interactive', 'container', 'explicit']),
410
+ initial: zod_1.z.enum(["first-interactive", "container", "explicit"]),
241
411
  trap: zod_1.z.boolean(),
242
412
  })
243
413
  .strict(),
@@ -250,46 +420,48 @@ exports.OverlayNodeSchema = zod_1.z
250
420
  })
251
421
  .strict()
252
422
  .superRefine((value, context) => {
253
- if (value.renderNode.kind !== 'overlay') {
423
+ if (value.renderNode.kind !== "overlay") {
254
424
  context.addIssue({
255
- code: 'custom',
256
- path: ['renderNode', 'kind'],
257
- message: 'OverlayNode renderNode.kind must be overlay.',
425
+ code: "custom",
426
+ path: ["renderNode", "kind"],
427
+ message: "OverlayNode renderNode.kind must be overlay.",
258
428
  });
259
429
  }
260
430
  if (value.renderNode.activation.mode !== value.presentation) {
261
431
  context.addIssue({
262
- code: 'custom',
263
- path: ['renderNode', 'activation', 'mode'],
264
- message: 'OverlayNode presentation must match the RenderNode activation mode.',
432
+ code: "custom",
433
+ path: ["renderNode", "activation", "mode"],
434
+ message: "OverlayNode presentation must match the RenderNode activation mode.",
265
435
  });
266
436
  }
267
- if (value.presentation === 'drawer' && value.zIndexLane !== 'drawer') {
437
+ if (value.presentation === "drawer" && value.zIndexLane !== "drawer") {
268
438
  context.addIssue({
269
- code: 'custom',
270
- path: ['zIndexLane'],
271
- message: 'Drawer overlays must use the drawer z-index lane.',
439
+ code: "custom",
440
+ path: ["zIndexLane"],
441
+ message: "Drawer overlays must use the drawer z-index lane.",
272
442
  });
273
443
  }
274
- if (value.presentation === 'modal' && value.zIndexLane !== 'modal') {
444
+ if (value.presentation === "modal" && value.zIndexLane !== "modal") {
275
445
  context.addIssue({
276
- code: 'custom',
277
- path: ['zIndexLane'],
278
- message: 'Modal overlays must use the modal z-index lane.',
446
+ code: "custom",
447
+ path: ["zIndexLane"],
448
+ message: "Modal overlays must use the modal z-index lane.",
279
449
  });
280
450
  }
281
- if (value.presentation === 'fullscreen' && value.zIndexLane !== 'fullscreen' && value.zIndexLane !== 'system') {
451
+ if (value.presentation === "fullscreen" &&
452
+ value.zIndexLane !== "fullscreen" &&
453
+ value.zIndexLane !== "system") {
282
454
  context.addIssue({
283
- code: 'custom',
284
- path: ['zIndexLane'],
285
- message: 'Fullscreen overlays must use the fullscreen or system z-index lane.',
455
+ code: "custom",
456
+ path: ["zIndexLane"],
457
+ message: "Fullscreen overlays must use the fullscreen or system z-index lane.",
286
458
  });
287
459
  }
288
460
  });
289
461
  const ProductPathSchema = zod_1.z
290
462
  .string()
291
463
  .trim()
292
- .regex(/^\/(?!\/)/, 'Expected an application-relative path.');
464
+ .regex(/^\/(?!\/)/, "Expected an application-relative path.");
293
465
  exports.ApplicationHandoffEndpointSchema = zod_1.z
294
466
  .object({
295
467
  product: exports.ProductContextSchema,
@@ -303,7 +475,7 @@ exports.ApplicationHandoffEndpointSchema = zod_1.z
303
475
  .strict();
304
476
  exports.ApplicationHandoffSchema = zod_1.z
305
477
  .object({
306
- contract: zod_1.z.literal('ApplicationHandoff'),
478
+ contract: zod_1.z.literal("ApplicationHandoff"),
307
479
  handoffId: common_1.ContractIdentifierSchema,
308
480
  source: exports.ApplicationHandoffEndpointSchema,
309
481
  target: exports.ApplicationHandoffEndpointSchema,
@@ -313,17 +485,18 @@ exports.ApplicationHandoffSchema = zod_1.z
313
485
  })
314
486
  .strict()
315
487
  .superRefine((value, context) => {
316
- if (value.source.product === value.target.product && value.source.pageId === value.target.pageId) {
488
+ if (value.source.product === value.target.product &&
489
+ value.source.pageId === value.target.pageId) {
317
490
  context.addIssue({
318
- code: 'custom',
319
- path: ['target'],
320
- message: 'ApplicationHandoff target must identify a different product page.',
491
+ code: "custom",
492
+ path: ["target"],
493
+ message: "ApplicationHandoff target must identify a different product page.",
321
494
  });
322
495
  }
323
496
  });
324
497
  exports.ViewProviderDescriptorSchema = zod_1.z
325
498
  .object({
326
- contract: zod_1.z.literal('ViewProviderDescriptor'),
499
+ contract: zod_1.z.literal("ViewProviderDescriptor"),
327
500
  providerId: common_1.ContractIdentifierSchema,
328
501
  providerVersion: common_1.ContractIdentifierSchema,
329
502
  ownerRepo: common_1.ContractIdentifierSchema,
@@ -331,15 +504,29 @@ exports.ViewProviderDescriptorSchema = zod_1.z
331
504
  rendererKey: common_1.ContractIdentifierSchema,
332
505
  renderModelSchemaRef: common_1.ContractIdentifierSchema,
333
506
  intentSchemaRef: common_1.ContractIdentifierSchema.optional(),
334
- loading: zod_1.z.enum(['eager', 'lazy', 'viewport', 'on-activation']),
335
- stateOwner: zod_1.z.enum(['host', 'provider', 'external']),
507
+ loading: zod_1.z.enum(["eager", "lazy", "viewport", "on-activation"]),
508
+ stateOwner: zod_1.z.enum(["host", "provider", "external"]),
336
509
  supportedPageTypes: zod_1.z.array(common_1.ContractIdentifierSchema).min(1),
337
510
  supportedSurfaces: zod_1.z
338
- .array(zod_1.z.enum(['page', 'workspace', 'view', 'record', 'action', 'overlay', 'agent']))
511
+ .array(zod_1.z.enum([
512
+ "page",
513
+ "workspace",
514
+ "view",
515
+ "record",
516
+ "action",
517
+ "overlay",
518
+ "agent",
519
+ ]))
339
520
  .min(1),
340
- frameOwner: zod_1.z.enum(['host', 'provider', 'none']),
341
- sideEffects: zod_1.z
342
- .array(zod_1.z.enum(['network', 'storage', 'navigation', 'clipboard', 'worker', 'websocket'])),
521
+ frameOwner: zod_1.z.enum(["host", "provider", "none"]),
522
+ sideEffects: zod_1.z.array(zod_1.z.enum([
523
+ "network",
524
+ "storage",
525
+ "navigation",
526
+ "clipboard",
527
+ "worker",
528
+ "websocket",
529
+ ])),
343
530
  sideEffectAdapterRef: common_1.EntityRefSchema.optional(),
344
531
  lifecycle: zod_1.z
345
532
  .object({
@@ -360,29 +547,39 @@ exports.ViewProviderDescriptorSchema = zod_1.z
360
547
  })
361
548
  .strict()
362
549
  .superRefine((provider, context) => {
363
- requirePinnedOwnedRef(provider.capabilityRef, 'capability', ['capabilityRef'], context);
364
- requirePinnedOwnedRef(provider.sideEffectAdapterRef, 'side-effect-adapter', ['sideEffectAdapterRef'], context);
365
- requireRef(provider.accessRef, 'access-policy', ['accessRef'], context);
366
- requireRef(provider.evidenceRef, 'evidence', ['evidenceRef'], context);
550
+ requirePinnedOwnedRef(provider.capabilityRef, "capability", ["capabilityRef"], context);
551
+ requirePinnedOwnedRef(provider.sideEffectAdapterRef, "side-effect-adapter", ["sideEffectAdapterRef"], context);
552
+ requireRef(provider.accessRef, "access-policy", ["accessRef"], context);
553
+ requireRef(provider.evidenceRef, "evidence", ["evidenceRef"], context);
367
554
  if (provider.capabilityRef.version === undefined) {
368
555
  context.addIssue({
369
- code: 'custom',
370
- path: ['capabilityRef', 'version'],
371
- message: 'Provider capabilityRef must pin an active capability version.',
556
+ code: "custom",
557
+ path: ["capabilityRef", "version"],
558
+ message: "Provider capabilityRef must pin an active capability version.",
372
559
  });
373
560
  }
374
- if (provider.frameOwner === 'provider' && provider.stateOwner === 'host' && !provider.lifecycle.preserveMount) {
561
+ if (provider.frameOwner === "provider" &&
562
+ provider.stateOwner === "host" &&
563
+ !provider.lifecycle.preserveMount) {
375
564
  context.addIssue({
376
- code: 'custom',
377
- path: ['lifecycle', 'preserveMount'],
378
- message: 'Host-owned state on a provider-owned frame must preserve the provider mount.',
565
+ code: "custom",
566
+ path: ["lifecycle", "preserveMount"],
567
+ message: "Host-owned state on a provider-owned frame must preserve the provider mount.",
379
568
  });
380
569
  }
381
570
  if (provider.sideEffects.length > 0 && !provider.sideEffectAdapterRef) {
382
- context.addIssue({ code: 'custom', path: ['sideEffectAdapterRef'], message: 'Providers with side effects require a pinned side-effect adapter.' });
571
+ context.addIssue({
572
+ code: "custom",
573
+ path: ["sideEffectAdapterRef"],
574
+ message: "Providers with side effects require a pinned side-effect adapter.",
575
+ });
383
576
  }
384
577
  if (provider.sideEffects.length === 0 && provider.sideEffectAdapterRef) {
385
- context.addIssue({ code: 'custom', path: ['sideEffectAdapterRef'], message: 'Pure providers cannot declare a side-effect adapter.' });
578
+ context.addIssue({
579
+ code: "custom",
580
+ path: ["sideEffectAdapterRef"],
581
+ message: "Pure providers cannot declare a side-effect adapter.",
582
+ });
386
583
  }
387
584
  });
388
585
  //# sourceMappingURL=render.js.map