desen-core 1.0.0-draft → 1.0.0-draft.13

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > desen-core@1.0.0-draft build /Users/selmanay/Desktop/desen/packages/core
3
+ > desen-core@1.0.0-draft.13 build /Users/selmanay/Desktop/desen/packages/core
4
4
  > tsc
5
5
 
package/LICENSE.md ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Selman Ay
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -1,41 +1,41 @@
1
1
  import { z } from "zod";
2
- export declare const bindingSourceEnum: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
2
+ export declare const bindingSourceEnum: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
3
3
  export declare const bindingSpec: z.ZodObject<{
4
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
4
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
5
5
  path: z.ZodString;
6
6
  fallback: z.ZodOptional<z.ZodAny>;
7
7
  }, "strip", z.ZodTypeAny, {
8
- source: "session" | "backend" | "local" | "feature_flag";
8
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
9
9
  path: string;
10
10
  fallback?: any;
11
11
  }, {
12
- source: "session" | "backend" | "local" | "feature_flag";
12
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
13
13
  path: string;
14
14
  fallback?: any;
15
15
  }>;
16
16
  export declare const bindWrapper: z.ZodObject<{
17
17
  bind: z.ZodObject<{
18
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
18
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
19
19
  path: z.ZodString;
20
20
  fallback: z.ZodOptional<z.ZodAny>;
21
21
  }, "strip", z.ZodTypeAny, {
22
- source: "session" | "backend" | "local" | "feature_flag";
22
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
23
23
  path: string;
24
24
  fallback?: any;
25
25
  }, {
26
- source: "session" | "backend" | "local" | "feature_flag";
26
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
27
27
  path: string;
28
28
  fallback?: any;
29
29
  }>;
30
30
  }, "strip", z.ZodTypeAny, {
31
31
  bind: {
32
- source: "session" | "backend" | "local" | "feature_flag";
32
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
33
33
  path: string;
34
34
  fallback?: any;
35
35
  };
36
36
  }, {
37
37
  bind: {
38
- source: "session" | "backend" | "local" | "feature_flag";
38
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
39
39
  path: string;
40
40
  fallback?: any;
41
41
  };
@@ -43,27 +43,27 @@ export declare const bindWrapper: z.ZodObject<{
43
43
  export declare const modifiersSpec: z.ZodObject<{
44
44
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
45
45
  bind: z.ZodObject<{
46
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
46
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
47
47
  path: z.ZodString;
48
48
  fallback: z.ZodOptional<z.ZodAny>;
49
49
  }, "strip", z.ZodTypeAny, {
50
- source: "session" | "backend" | "local" | "feature_flag";
50
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
51
51
  path: string;
52
52
  fallback?: any;
53
53
  }, {
54
- source: "session" | "backend" | "local" | "feature_flag";
54
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
55
55
  path: string;
56
56
  fallback?: any;
57
57
  }>;
58
58
  }, "strip", z.ZodTypeAny, {
59
59
  bind: {
60
- source: "session" | "backend" | "local" | "feature_flag";
60
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
61
61
  path: string;
62
62
  fallback?: any;
63
63
  };
64
64
  }, {
65
65
  bind: {
66
- source: "session" | "backend" | "local" | "feature_flag";
66
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
67
67
  path: string;
68
68
  fallback?: any;
69
69
  };
@@ -71,7 +71,7 @@ export declare const modifiersSpec: z.ZodObject<{
71
71
  }, "strip", z.ZodTypeAny, {
72
72
  visible?: boolean | {
73
73
  bind: {
74
- source: "session" | "backend" | "local" | "feature_flag";
74
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
75
75
  path: string;
76
76
  fallback?: any;
77
77
  };
@@ -79,7 +79,7 @@ export declare const modifiersSpec: z.ZodObject<{
79
79
  }, {
80
80
  visible?: boolean | {
81
81
  bind: {
82
- source: "session" | "backend" | "local" | "feature_flag";
82
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
83
83
  path: string;
84
84
  fallback?: any;
85
85
  };
@@ -10,6 +10,7 @@ exports.bindingSourceEnum = zod_1.z.enum([
10
10
  "backend",
11
11
  "local",
12
12
  "feature_flag",
13
+ "sensor",
13
14
  ]);
14
15
  // ─── bindingSpec ─────────────────────────────────────────────────
15
16
  // SPEC.md §2.7: { source, path } required; fallback optional
@@ -16,6 +16,26 @@ export declare const layoutSpec: z.ZodObject<{
16
16
  gap: z.ZodOptional<z.ZodNumber>;
17
17
  columns: z.ZodOptional<z.ZodNumber>;
18
18
  align: z.ZodOptional<z.ZodEnum<["start", "center", "end", "stretch"]>>;
19
+ align_content: z.ZodOptional<z.ZodEnum<["start", "center", "end", "space-between", "space-around", "stretch"]>>;
20
+ align_items: z.ZodOptional<z.ZodEnum<["start", "center", "end", "stretch"]>>;
21
+ padding: z.ZodOptional<z.ZodObject<{
22
+ top: z.ZodOptional<z.ZodNumber>;
23
+ right: z.ZodOptional<z.ZodNumber>;
24
+ bottom: z.ZodOptional<z.ZodNumber>;
25
+ left: z.ZodOptional<z.ZodNumber>;
26
+ }, "strict", z.ZodTypeAny, {
27
+ top?: number | undefined;
28
+ right?: number | undefined;
29
+ bottom?: number | undefined;
30
+ left?: number | undefined;
31
+ }, {
32
+ top?: number | undefined;
33
+ right?: number | undefined;
34
+ bottom?: number | undefined;
35
+ left?: number | undefined;
36
+ }>>;
37
+ sizing_h: z.ZodOptional<z.ZodEnum<["hug", "fill", "fixed"]>>;
38
+ sizing_v: z.ZodOptional<z.ZodEnum<["hug", "fill", "fixed"]>>;
19
39
  positioning: z.ZodOptional<z.ZodObject<{
20
40
  type: z.ZodEnum<["relative", "sticky", "absolute"]>;
21
41
  }, "strip", z.ZodTypeAny, {
@@ -23,21 +43,41 @@ export declare const layoutSpec: z.ZodObject<{
23
43
  }, {
24
44
  type: "relative" | "sticky" | "absolute";
25
45
  }>>;
26
- }, "strip", z.ZodTypeAny, {
46
+ }, "strict", z.ZodTypeAny, {
27
47
  kind: "stack" | "grid";
48
+ padding?: {
49
+ top?: number | undefined;
50
+ right?: number | undefined;
51
+ bottom?: number | undefined;
52
+ left?: number | undefined;
53
+ } | undefined;
28
54
  direction?: "vertical" | "horizontal" | undefined;
29
55
  gap?: number | undefined;
30
56
  columns?: number | undefined;
31
57
  align?: "start" | "center" | "end" | "stretch" | undefined;
58
+ align_content?: "start" | "center" | "end" | "stretch" | "space-between" | "space-around" | undefined;
59
+ align_items?: "start" | "center" | "end" | "stretch" | undefined;
60
+ sizing_h?: "fill" | "hug" | "fixed" | undefined;
61
+ sizing_v?: "fill" | "hug" | "fixed" | undefined;
32
62
  positioning?: {
33
63
  type: "relative" | "sticky" | "absolute";
34
64
  } | undefined;
35
65
  }, {
36
66
  kind: "stack" | "grid";
67
+ padding?: {
68
+ top?: number | undefined;
69
+ right?: number | undefined;
70
+ bottom?: number | undefined;
71
+ left?: number | undefined;
72
+ } | undefined;
37
73
  direction?: "vertical" | "horizontal" | undefined;
38
74
  gap?: number | undefined;
39
75
  columns?: number | undefined;
40
76
  align?: "start" | "center" | "end" | "stretch" | undefined;
77
+ align_content?: "start" | "center" | "end" | "stretch" | "space-between" | "space-around" | undefined;
78
+ align_items?: "start" | "center" | "end" | "stretch" | undefined;
79
+ sizing_h?: "fill" | "hug" | "fixed" | undefined;
80
+ sizing_v?: "fill" | "hug" | "fixed" | undefined;
41
81
  positioning?: {
42
82
  type: "relative" | "sticky" | "absolute";
43
83
  } | undefined;
@@ -14,11 +14,21 @@ exports.positioningSpec = zod_1.z.object({
14
14
  exports.layoutSpec = zod_1.z.object({
15
15
  kind: zod_1.z.enum(["stack", "grid"]),
16
16
  direction: zod_1.z.enum(["vertical", "horizontal"]).optional(),
17
- gap: zod_1.z.number().min(0).optional(),
17
+ gap: zod_1.z.number().optional(),
18
18
  columns: zod_1.z.number().int().min(1).optional(),
19
19
  align: zod_1.z.enum(["start", "center", "end", "stretch"]).optional(),
20
+ align_content: zod_1.z.enum(["start", "center", "end", "space-between", "space-around", "stretch"]).optional(),
21
+ align_items: zod_1.z.enum(["start", "center", "end", "stretch"]).optional(),
22
+ padding: zod_1.z.object({
23
+ top: zod_1.z.number().optional(),
24
+ right: zod_1.z.number().optional(),
25
+ bottom: zod_1.z.number().optional(),
26
+ left: zod_1.z.number().optional()
27
+ }).strict().optional(),
28
+ sizing_h: zod_1.z.enum(["hug", "fill", "fixed"]).optional(),
29
+ sizing_v: zod_1.z.enum(["hug", "fill", "fixed"]).optional(),
20
30
  positioning: exports.positioningSpec.optional(),
21
- });
31
+ }).strict();
22
32
  // ─── Composition types ───────────────────────────────────────────
23
33
  const compositionTypeEnum = zod_1.z.enum(["Card", "Stack", "Grid", "Header", "Footer"]);
24
34
  const compositionTypes = new Set(["Card", "Stack", "Grid", "Header", "Footer"]);
@@ -38,10 +48,13 @@ const constraintsSpec = zod_1.z.object({
38
48
  // we use a custom z.lazy() that checks the `type` field to
39
49
  // dispatch to the correct schema — avoiding exponential backtracking.
40
50
  exports.nodeSpec = zod_1.z.lazy(() => zod_1.z.any().superRefine((val, ctx) => {
51
+ if (typeof val === "object" && val !== null && typeof val.$ref === "string") {
52
+ return; // Allow remote and local file refs
53
+ }
41
54
  if (typeof val !== "object" || val === null || typeof val.type !== "string") {
42
55
  ctx.addIssue({
43
56
  code: zod_1.z.ZodIssueCode.custom,
44
- message: "Node must be an object with a 'type' string property.",
57
+ message: "Node must be an object with a 'type' string property or a valid '$ref' object.",
45
58
  });
46
59
  return;
47
60
  }
@@ -66,6 +79,7 @@ exports.nodeSpec = zod_1.z.lazy(() => zod_1.z.any().superRefine((val, ctx) => {
66
79
  const elementSpecInternal = zod_1.z.object({
67
80
  type: zod_1.z.string().min(1),
68
81
  id: zod_1.z.string().min(1),
82
+ name: zod_1.z.string().optional(),
69
83
  props: zod_1.z.record(zod_1.z.any()),
70
84
  constraints: constraintsSpec,
71
85
  modifiers: binding_1.modifiersSpec.optional(),
@@ -78,22 +92,25 @@ const elementSpecInternal = zod_1.z.object({
78
92
  exports.compositionSpec = zod_1.z.lazy(() => zod_1.z.object({
79
93
  type: compositionTypeEnum,
80
94
  id: zod_1.z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/),
95
+ name: zod_1.z.string().optional(),
81
96
  layout: exports.layoutSpec,
97
+ style: zod_1.z.record(zod_1.z.any()).optional(),
82
98
  children: zod_1.z.array(exports.nodeSpec).min(0),
83
99
  constraints: constraintsSpec,
84
100
  modifiers: binding_1.modifiersSpec.optional(),
85
101
  telemetry: telemetry_1.telemetrySpec,
86
- }).passthrough());
102
+ }).strict());
87
103
  // ─── RepeaterSpec ────────────────────────────────────────────────
88
104
  // SPEC.md §2.5: type MUST be "Repeater", data.bind REQUIRED,
89
105
  // template MUST be a valid nodeSpec, telemetry REQUIRED.
90
106
  exports.repeaterSpec = zod_1.z.lazy(() => zod_1.z.object({
91
107
  type: zod_1.z.literal("Repeater"),
92
108
  id: zod_1.z.string().min(1),
109
+ name: zod_1.z.string().optional(),
93
110
  data: zod_1.z.object({
94
111
  bind: binding_1.bindingSpec,
95
112
  }),
96
113
  template: exports.nodeSpec,
97
114
  modifiers: binding_1.modifiersSpec.optional(),
98
115
  telemetry: telemetry_1.telemetrySpec,
99
- }).passthrough());
116
+ }).strict());
@@ -2,6 +2,7 @@ import { z } from "zod";
2
2
  export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
3
3
  type: z.ZodString;
4
4
  id: z.ZodString;
5
+ name: z.ZodOptional<z.ZodString>;
5
6
  props: z.ZodRecord<z.ZodString, z.ZodAny>;
6
7
  constraints: z.ZodOptional<z.ZodObject<{
7
8
  a11y: z.ZodOptional<z.ZodObject<{
@@ -58,27 +59,27 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
58
59
  modifiers: z.ZodOptional<z.ZodObject<{
59
60
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
60
61
  bind: z.ZodObject<{
61
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
62
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
62
63
  path: z.ZodString;
63
64
  fallback: z.ZodOptional<z.ZodAny>;
64
65
  }, "strip", z.ZodTypeAny, {
65
- source: "session" | "backend" | "local" | "feature_flag";
66
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
66
67
  path: string;
67
68
  fallback?: any;
68
69
  }, {
69
- source: "session" | "backend" | "local" | "feature_flag";
70
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
70
71
  path: string;
71
72
  fallback?: any;
72
73
  }>;
73
74
  }, "strip", z.ZodTypeAny, {
74
75
  bind: {
75
- source: "session" | "backend" | "local" | "feature_flag";
76
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
76
77
  path: string;
77
78
  fallback?: any;
78
79
  };
79
80
  }, {
80
81
  bind: {
81
- source: "session" | "backend" | "local" | "feature_flag";
82
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
82
83
  path: string;
83
84
  fallback?: any;
84
85
  };
@@ -86,7 +87,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
86
87
  }, "strip", z.ZodTypeAny, {
87
88
  visible?: boolean | {
88
89
  bind: {
89
- source: "session" | "backend" | "local" | "feature_flag";
90
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
90
91
  path: string;
91
92
  fallback?: any;
92
93
  };
@@ -94,7 +95,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
94
95
  }, {
95
96
  visible?: boolean | {
96
97
  bind: {
97
- source: "session" | "backend" | "local" | "feature_flag";
98
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
98
99
  path: string;
99
100
  fallback?: any;
100
101
  };
@@ -110,6 +111,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
110
111
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
111
112
  type: z.ZodString;
112
113
  id: z.ZodString;
114
+ name: z.ZodOptional<z.ZodString>;
113
115
  props: z.ZodRecord<z.ZodString, z.ZodAny>;
114
116
  constraints: z.ZodOptional<z.ZodObject<{
115
117
  a11y: z.ZodOptional<z.ZodObject<{
@@ -166,27 +168,27 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
166
168
  modifiers: z.ZodOptional<z.ZodObject<{
167
169
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
168
170
  bind: z.ZodObject<{
169
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
171
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
170
172
  path: z.ZodString;
171
173
  fallback: z.ZodOptional<z.ZodAny>;
172
174
  }, "strip", z.ZodTypeAny, {
173
- source: "session" | "backend" | "local" | "feature_flag";
175
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
174
176
  path: string;
175
177
  fallback?: any;
176
178
  }, {
177
- source: "session" | "backend" | "local" | "feature_flag";
179
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
178
180
  path: string;
179
181
  fallback?: any;
180
182
  }>;
181
183
  }, "strip", z.ZodTypeAny, {
182
184
  bind: {
183
- source: "session" | "backend" | "local" | "feature_flag";
185
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
184
186
  path: string;
185
187
  fallback?: any;
186
188
  };
187
189
  }, {
188
190
  bind: {
189
- source: "session" | "backend" | "local" | "feature_flag";
191
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
190
192
  path: string;
191
193
  fallback?: any;
192
194
  };
@@ -194,7 +196,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
194
196
  }, "strip", z.ZodTypeAny, {
195
197
  visible?: boolean | {
196
198
  bind: {
197
- source: "session" | "backend" | "local" | "feature_flag";
199
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
198
200
  path: string;
199
201
  fallback?: any;
200
202
  };
@@ -202,7 +204,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
202
204
  }, {
203
205
  visible?: boolean | {
204
206
  bind: {
205
- source: "session" | "backend" | "local" | "feature_flag";
207
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
206
208
  path: string;
207
209
  fallback?: any;
208
210
  };
@@ -218,6 +220,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
218
220
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
219
221
  type: z.ZodString;
220
222
  id: z.ZodString;
223
+ name: z.ZodOptional<z.ZodString>;
221
224
  props: z.ZodRecord<z.ZodString, z.ZodAny>;
222
225
  constraints: z.ZodOptional<z.ZodObject<{
223
226
  a11y: z.ZodOptional<z.ZodObject<{
@@ -274,27 +277,27 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
274
277
  modifiers: z.ZodOptional<z.ZodObject<{
275
278
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
276
279
  bind: z.ZodObject<{
277
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
280
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
278
281
  path: z.ZodString;
279
282
  fallback: z.ZodOptional<z.ZodAny>;
280
283
  }, "strip", z.ZodTypeAny, {
281
- source: "session" | "backend" | "local" | "feature_flag";
284
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
282
285
  path: string;
283
286
  fallback?: any;
284
287
  }, {
285
- source: "session" | "backend" | "local" | "feature_flag";
288
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
286
289
  path: string;
287
290
  fallback?: any;
288
291
  }>;
289
292
  }, "strip", z.ZodTypeAny, {
290
293
  bind: {
291
- source: "session" | "backend" | "local" | "feature_flag";
294
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
292
295
  path: string;
293
296
  fallback?: any;
294
297
  };
295
298
  }, {
296
299
  bind: {
297
- source: "session" | "backend" | "local" | "feature_flag";
300
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
298
301
  path: string;
299
302
  fallback?: any;
300
303
  };
@@ -302,7 +305,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
302
305
  }, "strip", z.ZodTypeAny, {
303
306
  visible?: boolean | {
304
307
  bind: {
305
- source: "session" | "backend" | "local" | "feature_flag";
308
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
306
309
  path: string;
307
310
  fallback?: any;
308
311
  };
@@ -310,7 +313,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
310
313
  }, {
311
314
  visible?: boolean | {
312
315
  bind: {
313
- source: "session" | "backend" | "local" | "feature_flag";
316
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
314
317
  path: string;
315
318
  fallback?: any;
316
319
  };
@@ -326,6 +329,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
326
329
  }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
327
330
  type: z.ZodString;
328
331
  id: z.ZodString;
332
+ name: z.ZodOptional<z.ZodString>;
329
333
  props: z.ZodRecord<z.ZodString, z.ZodAny>;
330
334
  constraints: z.ZodOptional<z.ZodObject<{
331
335
  a11y: z.ZodOptional<z.ZodObject<{
@@ -382,27 +386,27 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
382
386
  modifiers: z.ZodOptional<z.ZodObject<{
383
387
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
384
388
  bind: z.ZodObject<{
385
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
389
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
386
390
  path: z.ZodString;
387
391
  fallback: z.ZodOptional<z.ZodAny>;
388
392
  }, "strip", z.ZodTypeAny, {
389
- source: "session" | "backend" | "local" | "feature_flag";
393
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
390
394
  path: string;
391
395
  fallback?: any;
392
396
  }, {
393
- source: "session" | "backend" | "local" | "feature_flag";
397
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
394
398
  path: string;
395
399
  fallback?: any;
396
400
  }>;
397
401
  }, "strip", z.ZodTypeAny, {
398
402
  bind: {
399
- source: "session" | "backend" | "local" | "feature_flag";
403
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
400
404
  path: string;
401
405
  fallback?: any;
402
406
  };
403
407
  }, {
404
408
  bind: {
405
- source: "session" | "backend" | "local" | "feature_flag";
409
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
406
410
  path: string;
407
411
  fallback?: any;
408
412
  };
@@ -410,7 +414,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
410
414
  }, "strip", z.ZodTypeAny, {
411
415
  visible?: boolean | {
412
416
  bind: {
413
- source: "session" | "backend" | "local" | "feature_flag";
417
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
414
418
  path: string;
415
419
  fallback?: any;
416
420
  };
@@ -418,7 +422,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
418
422
  }, {
419
423
  visible?: boolean | {
420
424
  bind: {
421
- source: "session" | "backend" | "local" | "feature_flag";
425
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
422
426
  path: string;
423
427
  fallback?: any;
424
428
  };
@@ -434,6 +438,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
434
438
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
435
439
  type: z.ZodString;
436
440
  id: z.ZodString;
441
+ name: z.ZodOptional<z.ZodString>;
437
442
  props: z.ZodRecord<z.ZodString, z.ZodAny>;
438
443
  constraints: z.ZodOptional<z.ZodObject<{
439
444
  a11y: z.ZodOptional<z.ZodObject<{
@@ -490,27 +495,27 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
490
495
  modifiers: z.ZodOptional<z.ZodObject<{
491
496
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
492
497
  bind: z.ZodObject<{
493
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
498
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
494
499
  path: z.ZodString;
495
500
  fallback: z.ZodOptional<z.ZodAny>;
496
501
  }, "strip", z.ZodTypeAny, {
497
- source: "session" | "backend" | "local" | "feature_flag";
502
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
498
503
  path: string;
499
504
  fallback?: any;
500
505
  }, {
501
- source: "session" | "backend" | "local" | "feature_flag";
506
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
502
507
  path: string;
503
508
  fallback?: any;
504
509
  }>;
505
510
  }, "strip", z.ZodTypeAny, {
506
511
  bind: {
507
- source: "session" | "backend" | "local" | "feature_flag";
512
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
508
513
  path: string;
509
514
  fallback?: any;
510
515
  };
511
516
  }, {
512
517
  bind: {
513
- source: "session" | "backend" | "local" | "feature_flag";
518
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
514
519
  path: string;
515
520
  fallback?: any;
516
521
  };
@@ -518,7 +523,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
518
523
  }, "strip", z.ZodTypeAny, {
519
524
  visible?: boolean | {
520
525
  bind: {
521
- source: "session" | "backend" | "local" | "feature_flag";
526
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
522
527
  path: string;
523
528
  fallback?: any;
524
529
  };
@@ -526,7 +531,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
526
531
  }, {
527
532
  visible?: boolean | {
528
533
  bind: {
529
- source: "session" | "backend" | "local" | "feature_flag";
534
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
530
535
  path: string;
531
536
  fallback?: any;
532
537
  };
@@ -542,6 +547,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
542
547
  }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
543
548
  type: z.ZodString;
544
549
  id: z.ZodString;
550
+ name: z.ZodOptional<z.ZodString>;
545
551
  props: z.ZodRecord<z.ZodString, z.ZodAny>;
546
552
  constraints: z.ZodOptional<z.ZodObject<{
547
553
  a11y: z.ZodOptional<z.ZodObject<{
@@ -598,27 +604,27 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
598
604
  modifiers: z.ZodOptional<z.ZodObject<{
599
605
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
600
606
  bind: z.ZodObject<{
601
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
607
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
602
608
  path: z.ZodString;
603
609
  fallback: z.ZodOptional<z.ZodAny>;
604
610
  }, "strip", z.ZodTypeAny, {
605
- source: "session" | "backend" | "local" | "feature_flag";
611
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
606
612
  path: string;
607
613
  fallback?: any;
608
614
  }, {
609
- source: "session" | "backend" | "local" | "feature_flag";
615
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
610
616
  path: string;
611
617
  fallback?: any;
612
618
  }>;
613
619
  }, "strip", z.ZodTypeAny, {
614
620
  bind: {
615
- source: "session" | "backend" | "local" | "feature_flag";
621
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
616
622
  path: string;
617
623
  fallback?: any;
618
624
  };
619
625
  }, {
620
626
  bind: {
621
- source: "session" | "backend" | "local" | "feature_flag";
627
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
622
628
  path: string;
623
629
  fallback?: any;
624
630
  };
@@ -626,7 +632,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
626
632
  }, "strip", z.ZodTypeAny, {
627
633
  visible?: boolean | {
628
634
  bind: {
629
- source: "session" | "backend" | "local" | "feature_flag";
635
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
630
636
  path: string;
631
637
  fallback?: any;
632
638
  };
@@ -634,7 +640,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
634
640
  }, {
635
641
  visible?: boolean | {
636
642
  bind: {
637
- source: "session" | "backend" | "local" | "feature_flag";
643
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
638
644
  path: string;
639
645
  fallback?: any;
640
646
  };
@@ -650,6 +656,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
650
656
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
651
657
  type: z.ZodString;
652
658
  id: z.ZodString;
659
+ name: z.ZodOptional<z.ZodString>;
653
660
  props: z.ZodRecord<z.ZodString, z.ZodAny>;
654
661
  constraints: z.ZodOptional<z.ZodObject<{
655
662
  a11y: z.ZodOptional<z.ZodObject<{
@@ -706,27 +713,27 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
706
713
  modifiers: z.ZodOptional<z.ZodObject<{
707
714
  visible: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
708
715
  bind: z.ZodObject<{
709
- source: z.ZodEnum<["session", "backend", "local", "feature_flag"]>;
716
+ source: z.ZodEnum<["session", "backend", "local", "feature_flag", "sensor"]>;
710
717
  path: z.ZodString;
711
718
  fallback: z.ZodOptional<z.ZodAny>;
712
719
  }, "strip", z.ZodTypeAny, {
713
- source: "session" | "backend" | "local" | "feature_flag";
720
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
714
721
  path: string;
715
722
  fallback?: any;
716
723
  }, {
717
- source: "session" | "backend" | "local" | "feature_flag";
724
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
718
725
  path: string;
719
726
  fallback?: any;
720
727
  }>;
721
728
  }, "strip", z.ZodTypeAny, {
722
729
  bind: {
723
- source: "session" | "backend" | "local" | "feature_flag";
730
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
724
731
  path: string;
725
732
  fallback?: any;
726
733
  };
727
734
  }, {
728
735
  bind: {
729
- source: "session" | "backend" | "local" | "feature_flag";
736
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
730
737
  path: string;
731
738
  fallback?: any;
732
739
  };
@@ -734,7 +741,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
734
741
  }, "strip", z.ZodTypeAny, {
735
742
  visible?: boolean | {
736
743
  bind: {
737
- source: "session" | "backend" | "local" | "feature_flag";
744
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
738
745
  path: string;
739
746
  fallback?: any;
740
747
  };
@@ -742,7 +749,7 @@ export declare const elementSpec: z.ZodEffects<z.ZodEffects<z.ZodObject<{
742
749
  }, {
743
750
  visible?: boolean | {
744
751
  bind: {
745
- source: "session" | "backend" | "local" | "feature_flag";
752
+ source: "session" | "backend" | "local" | "feature_flag" | "sensor";
746
753
  path: string;
747
754
  fallback?: any;
748
755
  };
@@ -13,6 +13,7 @@ const telemetry_1 = require("./telemetry");
13
13
  exports.elementSpec = zod_1.z.object({
14
14
  type: zod_1.z.string().min(1),
15
15
  id: zod_1.z.string().min(1),
16
+ name: zod_1.z.string().optional(),
16
17
  props: zod_1.z.record(zod_1.z.any()),
17
18
  constraints: zod_1.z.object({
18
19
  a11y: zod_1.z.object({
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const surfaceSpec: z.ZodObject<{
3
3
  id: z.ZodString;
4
+ name: z.ZodOptional<z.ZodString>;
4
5
  root: z.ZodType<any, z.ZodTypeDef, any>;
5
6
  telemetry: z.ZodObject<{
6
7
  emit: z.ZodArray<z.ZodString, "many">;
@@ -11,29 +12,23 @@ export declare const surfaceSpec: z.ZodObject<{
11
12
  }>;
12
13
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
13
14
  environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
14
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
15
- id: z.ZodString;
16
- root: z.ZodType<any, z.ZodTypeDef, any>;
17
- telemetry: z.ZodObject<{
18
- emit: z.ZodArray<z.ZodString, "many">;
19
- }, "strip", z.ZodTypeAny, {
20
- emit: string[];
21
- }, {
22
- emit: string[];
23
- }>;
24
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
25
- environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
26
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
27
- id: z.ZodString;
28
- root: z.ZodType<any, z.ZodTypeDef, any>;
29
- telemetry: z.ZodObject<{
30
- emit: z.ZodArray<z.ZodString, "many">;
31
- }, "strip", z.ZodTypeAny, {
15
+ }, "strict", z.ZodTypeAny, {
16
+ id: string;
17
+ telemetry: {
32
18
  emit: string[];
33
- }, {
19
+ };
20
+ name?: string | undefined;
21
+ root?: any;
22
+ metadata?: Record<string, any> | undefined;
23
+ environment?: Record<string, any> | undefined;
24
+ }, {
25
+ id: string;
26
+ telemetry: {
34
27
  emit: string[];
35
- }>;
36
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
37
- environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
38
- }, z.ZodTypeAny, "passthrough">>;
28
+ };
29
+ name?: string | undefined;
30
+ root?: any;
31
+ metadata?: Record<string, any> | undefined;
32
+ environment?: Record<string, any> | undefined;
33
+ }>;
39
34
  export type SurfaceSpec = z.infer<typeof surfaceSpec>;
@@ -12,8 +12,9 @@ const telemetry_1 = require("./telemetry");
12
12
  // root level; it must be contained within a Composition.
13
13
  exports.surfaceSpec = zod_1.z.object({
14
14
  id: zod_1.z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/),
15
+ name: zod_1.z.string().optional(),
15
16
  root: composition_1.compositionSpec,
16
17
  telemetry: telemetry_1.telemetrySpec,
17
18
  metadata: zod_1.z.record(zod_1.z.any()).optional(),
18
19
  environment: zod_1.z.record(zod_1.z.any()).optional(),
19
- }).passthrough();
20
+ }).strict();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desen-core",
3
- "version": "1.0.0-draft",
3
+ "version": "1.0.0-draft.13",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -8,6 +8,7 @@ export const bindingSourceEnum = z.enum([
8
8
  "backend",
9
9
  "local",
10
10
  "feature_flag",
11
+ "sensor",
11
12
  ]);
12
13
 
13
14
  // ─── bindingSpec ─────────────────────────────────────────────────
@@ -22,11 +22,21 @@ export const positioningSpec = z.object({
22
22
  export const layoutSpec = z.object({
23
23
  kind: z.enum(["stack", "grid"]),
24
24
  direction: z.enum(["vertical", "horizontal"]).optional(),
25
- gap: z.number().min(0).optional(),
25
+ gap: z.number().optional(),
26
26
  columns: z.number().int().min(1).optional(),
27
27
  align: z.enum(["start", "center", "end", "stretch"]).optional(),
28
+ align_content: z.enum(["start", "center", "end", "space-between", "space-around", "stretch"]).optional(),
29
+ align_items: z.enum(["start", "center", "end", "stretch"]).optional(),
30
+ padding: z.object({
31
+ top: z.number().optional(),
32
+ right: z.number().optional(),
33
+ bottom: z.number().optional(),
34
+ left: z.number().optional()
35
+ }).strict().optional(),
36
+ sizing_h: z.enum(["hug", "fill", "fixed"]).optional(),
37
+ sizing_v: z.enum(["hug", "fill", "fixed"]).optional(),
28
38
  positioning: positioningSpec.optional(),
29
- });
39
+ }).strict();
30
40
 
31
41
  // ─── Composition types ───────────────────────────────────────────
32
42
  const compositionTypeEnum = z.enum(["Card", "Stack", "Grid", "Header", "Footer"]);
@@ -50,10 +60,14 @@ const constraintsSpec = z.object({
50
60
  // dispatch to the correct schema — avoiding exponential backtracking.
51
61
  export const nodeSpec: z.ZodType<NodeSpec> = z.lazy(() =>
52
62
  z.any().superRefine((val, ctx) => {
63
+ if (typeof val === "object" && val !== null && typeof val.$ref === "string") {
64
+ return; // Allow remote and local file refs
65
+ }
66
+
53
67
  if (typeof val !== "object" || val === null || typeof val.type !== "string") {
54
68
  ctx.addIssue({
55
69
  code: z.ZodIssueCode.custom,
56
- message: "Node must be an object with a 'type' string property.",
70
+ message: "Node must be an object with a 'type' string property or a valid '$ref' object.",
57
71
  });
58
72
  return;
59
73
  }
@@ -80,6 +94,7 @@ export const nodeSpec: z.ZodType<NodeSpec> = z.lazy(() =>
80
94
  const elementSpecInternal = z.object({
81
95
  type: z.string().min(1),
82
96
  id: z.string().min(1),
97
+ name: z.string().optional(),
83
98
  props: z.record(z.any()),
84
99
  constraints: constraintsSpec,
85
100
  modifiers: modifiersSpec.optional(),
@@ -100,12 +115,14 @@ export const compositionSpec: z.ZodType<any> = z.lazy(() =>
100
115
  z.object({
101
116
  type: compositionTypeEnum,
102
117
  id: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/),
118
+ name: z.string().optional(),
103
119
  layout: layoutSpec,
120
+ style: z.record(z.any()).optional(),
104
121
  children: z.array(nodeSpec).min(0),
105
122
  constraints: constraintsSpec,
106
123
  modifiers: modifiersSpec.optional(),
107
124
  telemetry: telemetrySpec,
108
- }).passthrough()
125
+ }).strict()
109
126
  );
110
127
 
111
128
  // ─── RepeaterSpec ────────────────────────────────────────────────
@@ -115,13 +132,14 @@ export const repeaterSpec: z.ZodType<any> = z.lazy(() =>
115
132
  z.object({
116
133
  type: z.literal("Repeater"),
117
134
  id: z.string().min(1),
135
+ name: z.string().optional(),
118
136
  data: z.object({
119
137
  bind: bindingSpec,
120
138
  }),
121
139
  template: nodeSpec,
122
140
  modifiers: modifiersSpec.optional(),
123
141
  telemetry: telemetrySpec,
124
- }).passthrough()
142
+ }).strict()
125
143
  );
126
144
 
127
145
  // ─── Types ───────────────────────────────────────────────────────
@@ -11,6 +11,7 @@ import { telemetrySpec } from "./telemetry";
11
11
  export const elementSpec = z.object({
12
12
  type: z.string().min(1),
13
13
  id: z.string().min(1),
14
+ name: z.string().optional(),
14
15
  props: z.record(z.any()),
15
16
  constraints: z.object({
16
17
  a11y: z.object({
@@ -10,11 +10,12 @@ import { telemetrySpec } from "./telemetry";
10
10
  // root level; it must be contained within a Composition.
11
11
  export const surfaceSpec = z.object({
12
12
  id: z.string().min(1).regex(/^[A-Za-z][A-Za-z0-9_.:-]{0,127}$/),
13
+ name: z.string().optional(),
13
14
  root: compositionSpec,
14
15
  telemetry: telemetrySpec,
15
16
  metadata: z.record(z.any()).optional(),
16
17
  environment: z.record(z.any()).optional(),
17
- }).passthrough();
18
+ }).strict();
18
19
 
19
20
  // ─── Types ───────────────────────────────────────────────────────
20
21
  export type SurfaceSpec = z.infer<typeof surfaceSpec>;