skedyul 0.3.2 → 0.3.3
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.
- package/dist/.build-stamp +1 -1
- package/dist/dockerfile.d.ts +1 -1
- package/dist/dockerfile.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +397 -397
- package/dist/types/handlers.d.ts +9 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +6 -1
- package/dist/types/invocation.d.ts +71 -0
- package/dist/types/invocation.js +61 -0
- package/dist/types/tool-context.d.ts +3 -0
- package/dist/types/tool.d.ts +1 -1
- package/dist/types/tool.js +5 -5
- package/dist/types/webhook.d.ts +3 -0
- package/package.json +4 -3
package/dist/schemas.js
CHANGED
|
@@ -6,43 +6,43 @@ exports.safeParseConfig = safeParseConfig;
|
|
|
6
6
|
exports.isModelDependency = isModelDependency;
|
|
7
7
|
exports.isChannelDependency = isChannelDependency;
|
|
8
8
|
exports.isWorkflowDependency = isWorkflowDependency;
|
|
9
|
-
const
|
|
9
|
+
const v4_1 = require("zod/v4");
|
|
10
10
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
11
11
|
// Env Variable Schemas
|
|
12
12
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
-
exports.EnvVisibilitySchema =
|
|
14
|
-
exports.EnvVariableDefinitionSchema =
|
|
15
|
-
label:
|
|
16
|
-
required:
|
|
13
|
+
exports.EnvVisibilitySchema = v4_1.z.enum(['visible', 'encrypted']);
|
|
14
|
+
exports.EnvVariableDefinitionSchema = v4_1.z.object({
|
|
15
|
+
label: v4_1.z.string(),
|
|
16
|
+
required: v4_1.z.boolean().optional(),
|
|
17
17
|
visibility: exports.EnvVisibilitySchema.optional(),
|
|
18
|
-
default:
|
|
19
|
-
description:
|
|
20
|
-
placeholder:
|
|
18
|
+
default: v4_1.z.string().optional(),
|
|
19
|
+
description: v4_1.z.string().optional(),
|
|
20
|
+
placeholder: v4_1.z.string().optional(),
|
|
21
21
|
});
|
|
22
|
-
exports.EnvSchemaSchema =
|
|
22
|
+
exports.EnvSchemaSchema = v4_1.z.record(v4_1.z.string(), exports.EnvVariableDefinitionSchema);
|
|
23
23
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
24
24
|
// Compute Layer
|
|
25
25
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
26
|
-
exports.ComputeLayerTypeSchema =
|
|
26
|
+
exports.ComputeLayerTypeSchema = v4_1.z.enum(['serverless', 'dedicated']);
|
|
27
27
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
28
28
|
// Resource Scope and Dependencies
|
|
29
29
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
30
|
-
exports.ResourceScopeSchema =
|
|
31
|
-
exports.FieldOwnerSchema =
|
|
32
|
-
const PrimitiveSchema =
|
|
33
|
-
exports.StructuredFilterSchema =
|
|
34
|
-
exports.ModelDependencySchema =
|
|
35
|
-
model:
|
|
36
|
-
fields:
|
|
30
|
+
exports.ResourceScopeSchema = v4_1.z.enum(['INTERNAL', 'SHARED']);
|
|
31
|
+
exports.FieldOwnerSchema = v4_1.z.enum(['APP', 'WORKPLACE', 'BOTH']);
|
|
32
|
+
const PrimitiveSchema = v4_1.z.union([v4_1.z.string(), v4_1.z.number(), v4_1.z.boolean()]);
|
|
33
|
+
exports.StructuredFilterSchema = v4_1.z.record(v4_1.z.string(), v4_1.z.record(v4_1.z.string(), v4_1.z.union([PrimitiveSchema, v4_1.z.array(PrimitiveSchema)])));
|
|
34
|
+
exports.ModelDependencySchema = v4_1.z.object({
|
|
35
|
+
model: v4_1.z.string(),
|
|
36
|
+
fields: v4_1.z.array(v4_1.z.string()).optional(),
|
|
37
37
|
where: exports.StructuredFilterSchema.optional(),
|
|
38
38
|
});
|
|
39
|
-
exports.ChannelDependencySchema =
|
|
40
|
-
channel:
|
|
39
|
+
exports.ChannelDependencySchema = v4_1.z.object({
|
|
40
|
+
channel: v4_1.z.string(),
|
|
41
41
|
});
|
|
42
|
-
exports.WorkflowDependencySchema =
|
|
43
|
-
workflow:
|
|
42
|
+
exports.WorkflowDependencySchema = v4_1.z.object({
|
|
43
|
+
workflow: v4_1.z.string(),
|
|
44
44
|
});
|
|
45
|
-
exports.ResourceDependencySchema =
|
|
45
|
+
exports.ResourceDependencySchema = v4_1.z.union([
|
|
46
46
|
exports.ModelDependencySchema,
|
|
47
47
|
exports.ChannelDependencySchema,
|
|
48
48
|
exports.WorkflowDependencySchema,
|
|
@@ -50,7 +50,7 @@ exports.ResourceDependencySchema = zod_1.z.union([
|
|
|
50
50
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
51
51
|
// Model Schemas
|
|
52
52
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
53
|
-
exports.FieldDataTypeSchema =
|
|
53
|
+
exports.FieldDataTypeSchema = v4_1.z.enum([
|
|
54
54
|
'LONG_STRING',
|
|
55
55
|
'STRING',
|
|
56
56
|
'NUMBER',
|
|
@@ -63,69 +63,69 @@ exports.FieldDataTypeSchema = zod_1.z.enum([
|
|
|
63
63
|
'RELATION',
|
|
64
64
|
'OBJECT',
|
|
65
65
|
]);
|
|
66
|
-
exports.FieldOptionSchema =
|
|
67
|
-
label:
|
|
68
|
-
value:
|
|
69
|
-
color:
|
|
70
|
-
});
|
|
71
|
-
exports.InlineFieldDefinitionSchema =
|
|
72
|
-
limitChoices:
|
|
73
|
-
options:
|
|
74
|
-
minLength:
|
|
75
|
-
maxLength:
|
|
76
|
-
min:
|
|
77
|
-
max:
|
|
78
|
-
relatedModel:
|
|
79
|
-
pattern:
|
|
80
|
-
});
|
|
81
|
-
exports.AppFieldVisibilitySchema =
|
|
82
|
-
data:
|
|
83
|
-
list:
|
|
84
|
-
filters:
|
|
85
|
-
});
|
|
86
|
-
exports.ModelFieldDefinitionSchema =
|
|
87
|
-
handle:
|
|
88
|
-
label:
|
|
66
|
+
exports.FieldOptionSchema = v4_1.z.object({
|
|
67
|
+
label: v4_1.z.string(),
|
|
68
|
+
value: v4_1.z.string(),
|
|
69
|
+
color: v4_1.z.string().optional(),
|
|
70
|
+
});
|
|
71
|
+
exports.InlineFieldDefinitionSchema = v4_1.z.object({
|
|
72
|
+
limitChoices: v4_1.z.number().optional(),
|
|
73
|
+
options: v4_1.z.array(exports.FieldOptionSchema).optional(),
|
|
74
|
+
minLength: v4_1.z.number().optional(),
|
|
75
|
+
maxLength: v4_1.z.number().optional(),
|
|
76
|
+
min: v4_1.z.number().optional(),
|
|
77
|
+
max: v4_1.z.number().optional(),
|
|
78
|
+
relatedModel: v4_1.z.string().optional(),
|
|
79
|
+
pattern: v4_1.z.string().optional(),
|
|
80
|
+
});
|
|
81
|
+
exports.AppFieldVisibilitySchema = v4_1.z.object({
|
|
82
|
+
data: v4_1.z.boolean().optional(),
|
|
83
|
+
list: v4_1.z.boolean().optional(),
|
|
84
|
+
filters: v4_1.z.boolean().optional(),
|
|
85
|
+
});
|
|
86
|
+
exports.ModelFieldDefinitionSchema = v4_1.z.object({
|
|
87
|
+
handle: v4_1.z.string(),
|
|
88
|
+
label: v4_1.z.string(),
|
|
89
89
|
type: exports.FieldDataTypeSchema.optional(),
|
|
90
|
-
definitionHandle:
|
|
90
|
+
definitionHandle: v4_1.z.string().optional(),
|
|
91
91
|
definition: exports.InlineFieldDefinitionSchema.optional(),
|
|
92
|
-
required:
|
|
93
|
-
unique:
|
|
94
|
-
system:
|
|
95
|
-
isList:
|
|
96
|
-
defaultValue:
|
|
97
|
-
description:
|
|
92
|
+
required: v4_1.z.boolean().optional(),
|
|
93
|
+
unique: v4_1.z.boolean().optional(),
|
|
94
|
+
system: v4_1.z.boolean().optional(),
|
|
95
|
+
isList: v4_1.z.boolean().optional(),
|
|
96
|
+
defaultValue: v4_1.z.object({ value: v4_1.z.unknown() }).optional(),
|
|
97
|
+
description: v4_1.z.string().optional(),
|
|
98
98
|
visibility: exports.AppFieldVisibilitySchema.optional(),
|
|
99
99
|
owner: exports.FieldOwnerSchema.optional(),
|
|
100
100
|
});
|
|
101
|
-
exports.ModelDefinitionSchema =
|
|
102
|
-
handle:
|
|
103
|
-
name:
|
|
104
|
-
namePlural:
|
|
101
|
+
exports.ModelDefinitionSchema = v4_1.z.object({
|
|
102
|
+
handle: v4_1.z.string(),
|
|
103
|
+
name: v4_1.z.string(),
|
|
104
|
+
namePlural: v4_1.z.string().optional(),
|
|
105
105
|
scope: exports.ResourceScopeSchema,
|
|
106
|
-
labelTemplate:
|
|
107
|
-
description:
|
|
108
|
-
fields:
|
|
109
|
-
requires:
|
|
106
|
+
labelTemplate: v4_1.z.string().optional(),
|
|
107
|
+
description: v4_1.z.string().optional(),
|
|
108
|
+
fields: v4_1.z.array(exports.ModelFieldDefinitionSchema),
|
|
109
|
+
requires: v4_1.z.array(exports.ResourceDependencySchema).optional(),
|
|
110
110
|
});
|
|
111
111
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
112
112
|
// Relationship Schemas
|
|
113
113
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
114
|
-
exports.RelationshipCardinalitySchema =
|
|
114
|
+
exports.RelationshipCardinalitySchema = v4_1.z.enum([
|
|
115
115
|
'ONE_TO_ONE',
|
|
116
116
|
'ONE_TO_MANY',
|
|
117
117
|
'MANY_TO_ONE',
|
|
118
118
|
'MANY_TO_MANY',
|
|
119
119
|
]);
|
|
120
|
-
exports.OnDeleteBehaviorSchema =
|
|
121
|
-
exports.RelationshipLinkSchema =
|
|
122
|
-
model:
|
|
123
|
-
field:
|
|
124
|
-
label:
|
|
120
|
+
exports.OnDeleteBehaviorSchema = v4_1.z.enum(['NONE', 'CASCADE', 'RESTRICT']);
|
|
121
|
+
exports.RelationshipLinkSchema = v4_1.z.object({
|
|
122
|
+
model: v4_1.z.string(),
|
|
123
|
+
field: v4_1.z.string(),
|
|
124
|
+
label: v4_1.z.string(),
|
|
125
125
|
cardinality: exports.RelationshipCardinalitySchema,
|
|
126
126
|
onDelete: exports.OnDeleteBehaviorSchema.default('NONE'),
|
|
127
127
|
});
|
|
128
|
-
exports.RelationshipDefinitionSchema =
|
|
128
|
+
exports.RelationshipDefinitionSchema = v4_1.z.object({
|
|
129
129
|
source: exports.RelationshipLinkSchema,
|
|
130
130
|
target: exports.RelationshipLinkSchema,
|
|
131
131
|
});
|
|
@@ -133,340 +133,340 @@ exports.RelationshipDefinitionSchema = zod_1.z.object({
|
|
|
133
133
|
// Channel Schemas
|
|
134
134
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
135
135
|
/** Standard capability types for communication channels */
|
|
136
|
-
exports.ChannelCapabilityTypeSchema =
|
|
136
|
+
exports.ChannelCapabilityTypeSchema = v4_1.z.enum([
|
|
137
137
|
'messaging', // Text-based: SMS, WhatsApp, Messenger, DMs
|
|
138
138
|
'voice', // Audio calls: Phone, WhatsApp Voice, etc.
|
|
139
139
|
'video', // Video calls (future)
|
|
140
140
|
]);
|
|
141
141
|
/** Capability definition with display info and handler references */
|
|
142
|
-
exports.ChannelCapabilitySchema =
|
|
143
|
-
name:
|
|
144
|
-
icon:
|
|
145
|
-
receive:
|
|
146
|
-
send:
|
|
142
|
+
exports.ChannelCapabilitySchema = v4_1.z.object({
|
|
143
|
+
name: v4_1.z.string(), // Display name: "SMS", "WhatsApp Messages"
|
|
144
|
+
icon: v4_1.z.string().optional(), // Lucide icon name
|
|
145
|
+
receive: v4_1.z.string().optional(), // Inbound webhook handler
|
|
146
|
+
send: v4_1.z.string().optional(), // Outbound tool handle
|
|
147
147
|
});
|
|
148
148
|
/**
|
|
149
149
|
* Field definition for channel field mappings.
|
|
150
150
|
* Defines fields that can be mapped when linking a channel to a model.
|
|
151
151
|
* One field should have identifier: true to mark it as the channel identifier.
|
|
152
152
|
*/
|
|
153
|
-
exports.ChannelFieldDefinitionSchema =
|
|
154
|
-
handle:
|
|
155
|
-
label:
|
|
156
|
-
definition:
|
|
157
|
-
handle:
|
|
153
|
+
exports.ChannelFieldDefinitionSchema = v4_1.z.object({
|
|
154
|
+
handle: v4_1.z.string(),
|
|
155
|
+
label: v4_1.z.string(),
|
|
156
|
+
definition: v4_1.z.object({
|
|
157
|
+
handle: v4_1.z.string(),
|
|
158
158
|
}).passthrough(),
|
|
159
159
|
/** Marks this field as the identifier field for the channel */
|
|
160
|
-
identifier:
|
|
160
|
+
identifier: v4_1.z.boolean().optional(),
|
|
161
161
|
/** Whether this field is required */
|
|
162
|
-
required:
|
|
162
|
+
required: v4_1.z.boolean().optional(),
|
|
163
163
|
/** Default value when creating a new field */
|
|
164
|
-
defaultValue:
|
|
164
|
+
defaultValue: v4_1.z.object({ value: v4_1.z.unknown() }).passthrough().optional(),
|
|
165
165
|
/** Visibility settings for the field */
|
|
166
|
-
visibility:
|
|
167
|
-
data:
|
|
168
|
-
list:
|
|
169
|
-
filters:
|
|
166
|
+
visibility: v4_1.z.object({
|
|
167
|
+
data: v4_1.z.boolean().optional(),
|
|
168
|
+
list: v4_1.z.boolean().optional(),
|
|
169
|
+
filters: v4_1.z.boolean().optional(),
|
|
170
170
|
}).passthrough().optional(),
|
|
171
171
|
/** Permission settings for the field */
|
|
172
|
-
permissions:
|
|
173
|
-
read:
|
|
174
|
-
write:
|
|
172
|
+
permissions: v4_1.z.object({
|
|
173
|
+
read: v4_1.z.boolean().optional(),
|
|
174
|
+
write: v4_1.z.boolean().optional(),
|
|
175
175
|
}).passthrough().optional(),
|
|
176
176
|
}).passthrough();
|
|
177
|
-
exports.ChannelDefinitionSchema =
|
|
178
|
-
handle:
|
|
179
|
-
name:
|
|
180
|
-
icon:
|
|
177
|
+
exports.ChannelDefinitionSchema = v4_1.z.object({
|
|
178
|
+
handle: v4_1.z.string(),
|
|
179
|
+
name: v4_1.z.string(),
|
|
180
|
+
icon: v4_1.z.string().optional(),
|
|
181
181
|
/** Array of field definitions for this channel. One field must have identifier: true. */
|
|
182
|
-
fields:
|
|
182
|
+
fields: v4_1.z.array(exports.ChannelFieldDefinitionSchema),
|
|
183
183
|
// Capabilities keyed by standard type (messaging, voice, video)
|
|
184
|
-
capabilities:
|
|
184
|
+
capabilities: v4_1.z.record(exports.ChannelCapabilityTypeSchema, exports.ChannelCapabilitySchema),
|
|
185
185
|
});
|
|
186
186
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
187
187
|
// Workflow Schemas
|
|
188
188
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
189
|
-
exports.WorkflowActionInputSchema =
|
|
190
|
-
key:
|
|
191
|
-
label:
|
|
192
|
-
fieldRef:
|
|
193
|
-
fieldHandle:
|
|
194
|
-
entityHandle:
|
|
189
|
+
exports.WorkflowActionInputSchema = v4_1.z.object({
|
|
190
|
+
key: v4_1.z.string(),
|
|
191
|
+
label: v4_1.z.string(),
|
|
192
|
+
fieldRef: v4_1.z.object({
|
|
193
|
+
fieldHandle: v4_1.z.string(),
|
|
194
|
+
entityHandle: v4_1.z.string(),
|
|
195
195
|
}).optional(),
|
|
196
|
-
template:
|
|
196
|
+
template: v4_1.z.string().optional(),
|
|
197
197
|
});
|
|
198
|
-
exports.WorkflowActionSchema =
|
|
199
|
-
label:
|
|
200
|
-
handle:
|
|
201
|
-
batch:
|
|
202
|
-
entityHandle:
|
|
203
|
-
inputs:
|
|
198
|
+
exports.WorkflowActionSchema = v4_1.z.object({
|
|
199
|
+
label: v4_1.z.string(),
|
|
200
|
+
handle: v4_1.z.string(),
|
|
201
|
+
batch: v4_1.z.boolean().optional(),
|
|
202
|
+
entityHandle: v4_1.z.string().optional(),
|
|
203
|
+
inputs: v4_1.z.array(exports.WorkflowActionInputSchema).optional(),
|
|
204
204
|
});
|
|
205
|
-
exports.WorkflowDefinitionSchema =
|
|
206
|
-
path:
|
|
207
|
-
label:
|
|
208
|
-
handle:
|
|
209
|
-
requires:
|
|
210
|
-
actions:
|
|
205
|
+
exports.WorkflowDefinitionSchema = v4_1.z.object({
|
|
206
|
+
path: v4_1.z.string(),
|
|
207
|
+
label: v4_1.z.string().optional(),
|
|
208
|
+
handle: v4_1.z.string().optional(),
|
|
209
|
+
requires: v4_1.z.array(exports.ResourceDependencySchema).optional(),
|
|
210
|
+
actions: v4_1.z.array(exports.WorkflowActionSchema),
|
|
211
211
|
});
|
|
212
212
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
213
213
|
// Page Schemas
|
|
214
214
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
215
|
-
exports.PageTypeSchema =
|
|
216
|
-
exports.PageBlockTypeSchema =
|
|
217
|
-
exports.PageFieldTypeSchema =
|
|
218
|
-
exports.PageFieldSourceSchema =
|
|
219
|
-
model:
|
|
220
|
-
field:
|
|
215
|
+
exports.PageTypeSchema = v4_1.z.enum(['INSTANCE', 'LIST']);
|
|
216
|
+
exports.PageBlockTypeSchema = v4_1.z.enum(['form', 'spreadsheet', 'kanban', 'calendar', 'link', 'list', 'card']);
|
|
217
|
+
exports.PageFieldTypeSchema = v4_1.z.enum(['STRING', 'FILE', 'NUMBER', 'DATE', 'BOOLEAN', 'SELECT', 'FORM', 'RELATIONSHIP']);
|
|
218
|
+
exports.PageFieldSourceSchema = v4_1.z.object({
|
|
219
|
+
model: v4_1.z.string(),
|
|
220
|
+
field: v4_1.z.string(),
|
|
221
221
|
});
|
|
222
|
-
exports.PageFormHeaderSchema =
|
|
223
|
-
title:
|
|
224
|
-
description:
|
|
222
|
+
exports.PageFormHeaderSchema = v4_1.z.object({
|
|
223
|
+
title: v4_1.z.string(),
|
|
224
|
+
description: v4_1.z.string().optional(),
|
|
225
225
|
});
|
|
226
|
-
exports.PageActionDefinitionSchema =
|
|
227
|
-
handle:
|
|
228
|
-
label:
|
|
229
|
-
handler:
|
|
230
|
-
icon:
|
|
231
|
-
variant:
|
|
232
|
-
isDisabled:
|
|
233
|
-
isHidden:
|
|
226
|
+
exports.PageActionDefinitionSchema = v4_1.z.object({
|
|
227
|
+
handle: v4_1.z.string(),
|
|
228
|
+
label: v4_1.z.string(),
|
|
229
|
+
handler: v4_1.z.string(),
|
|
230
|
+
icon: v4_1.z.string().optional(),
|
|
231
|
+
variant: v4_1.z.enum(['primary', 'secondary', 'destructive']).optional(),
|
|
232
|
+
isDisabled: v4_1.z.union([v4_1.z.boolean(), v4_1.z.string()]).optional(),
|
|
233
|
+
isHidden: v4_1.z.union([v4_1.z.boolean(), v4_1.z.string()]).optional(),
|
|
234
234
|
});
|
|
235
235
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
236
236
|
// FormV2 Component Schemas (mirrors skedyul-ui FormComponentV2)
|
|
237
237
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
238
238
|
/** Base style props for FormV2 components */
|
|
239
|
-
exports.FormV2StylePropsSchema =
|
|
240
|
-
id:
|
|
241
|
-
row:
|
|
242
|
-
col:
|
|
243
|
-
className:
|
|
244
|
-
hidden:
|
|
239
|
+
exports.FormV2StylePropsSchema = v4_1.z.object({
|
|
240
|
+
id: v4_1.z.string(),
|
|
241
|
+
row: v4_1.z.number(),
|
|
242
|
+
col: v4_1.z.number(),
|
|
243
|
+
className: v4_1.z.string().optional(),
|
|
244
|
+
hidden: v4_1.z.boolean().optional(),
|
|
245
245
|
});
|
|
246
246
|
/** Button props for FieldSetting component */
|
|
247
|
-
exports.FieldSettingButtonPropsSchema =
|
|
248
|
-
label:
|
|
249
|
-
variant:
|
|
250
|
-
size:
|
|
251
|
-
isLoading:
|
|
247
|
+
exports.FieldSettingButtonPropsSchema = v4_1.z.object({
|
|
248
|
+
label: v4_1.z.string(),
|
|
249
|
+
variant: v4_1.z.enum(['default', 'destructive', 'outline', 'secondary', 'ghost', 'link']).optional(),
|
|
250
|
+
size: v4_1.z.enum(['default', 'sm', 'lg', 'icon']).optional(),
|
|
251
|
+
isLoading: v4_1.z.boolean().optional(),
|
|
252
252
|
/** Can be boolean or Liquid template string that resolves to boolean */
|
|
253
|
-
isDisabled:
|
|
254
|
-
leftIcon:
|
|
253
|
+
isDisabled: v4_1.z.union([v4_1.z.boolean(), v4_1.z.string()]).optional(),
|
|
254
|
+
leftIcon: v4_1.z.string().optional(),
|
|
255
255
|
});
|
|
256
256
|
/** Relationship extension for dynamic data loading */
|
|
257
|
-
exports.RelationshipExtensionSchema =
|
|
258
|
-
model:
|
|
257
|
+
exports.RelationshipExtensionSchema = v4_1.z.object({
|
|
258
|
+
model: v4_1.z.string(),
|
|
259
259
|
});
|
|
260
260
|
/** Layout column definition */
|
|
261
|
-
exports.FormLayoutColumnDefinitionSchema =
|
|
262
|
-
field:
|
|
263
|
-
colSpan:
|
|
264
|
-
dataType:
|
|
265
|
-
subQuery:
|
|
261
|
+
exports.FormLayoutColumnDefinitionSchema = v4_1.z.object({
|
|
262
|
+
field: v4_1.z.string(),
|
|
263
|
+
colSpan: v4_1.z.number(),
|
|
264
|
+
dataType: v4_1.z.string().optional(),
|
|
265
|
+
subQuery: v4_1.z.unknown().optional(),
|
|
266
266
|
});
|
|
267
267
|
/** Layout row definition */
|
|
268
|
-
exports.FormLayoutRowDefinitionSchema =
|
|
269
|
-
columns:
|
|
268
|
+
exports.FormLayoutRowDefinitionSchema = v4_1.z.object({
|
|
269
|
+
columns: v4_1.z.array(exports.FormLayoutColumnDefinitionSchema),
|
|
270
270
|
});
|
|
271
271
|
/** FormLayoutConfig definition */
|
|
272
|
-
exports.FormLayoutConfigDefinitionSchema =
|
|
273
|
-
type:
|
|
274
|
-
rows:
|
|
272
|
+
exports.FormLayoutConfigDefinitionSchema = v4_1.z.object({
|
|
273
|
+
type: v4_1.z.literal('form'),
|
|
274
|
+
rows: v4_1.z.array(exports.FormLayoutRowDefinitionSchema),
|
|
275
275
|
});
|
|
276
276
|
/** Input component definition */
|
|
277
277
|
exports.InputComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
278
|
-
component:
|
|
279
|
-
props:
|
|
280
|
-
label:
|
|
281
|
-
placeholder:
|
|
282
|
-
helpText:
|
|
283
|
-
type:
|
|
284
|
-
required:
|
|
285
|
-
disabled:
|
|
286
|
-
value:
|
|
278
|
+
component: v4_1.z.literal('Input'),
|
|
279
|
+
props: v4_1.z.object({
|
|
280
|
+
label: v4_1.z.string().optional(),
|
|
281
|
+
placeholder: v4_1.z.string().optional(),
|
|
282
|
+
helpText: v4_1.z.string().optional(),
|
|
283
|
+
type: v4_1.z.enum(['text', 'number', 'email', 'password', 'tel', 'url', 'hidden']).optional(),
|
|
284
|
+
required: v4_1.z.boolean().optional(),
|
|
285
|
+
disabled: v4_1.z.boolean().optional(),
|
|
286
|
+
value: v4_1.z.union([v4_1.z.string(), v4_1.z.number()]).optional(),
|
|
287
287
|
}),
|
|
288
288
|
});
|
|
289
289
|
/** Textarea component definition */
|
|
290
290
|
exports.TextareaComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
291
|
-
component:
|
|
292
|
-
props:
|
|
293
|
-
label:
|
|
294
|
-
placeholder:
|
|
295
|
-
helpText:
|
|
296
|
-
required:
|
|
297
|
-
disabled:
|
|
298
|
-
value:
|
|
291
|
+
component: v4_1.z.literal('Textarea'),
|
|
292
|
+
props: v4_1.z.object({
|
|
293
|
+
label: v4_1.z.string().optional(),
|
|
294
|
+
placeholder: v4_1.z.string().optional(),
|
|
295
|
+
helpText: v4_1.z.string().optional(),
|
|
296
|
+
required: v4_1.z.boolean().optional(),
|
|
297
|
+
disabled: v4_1.z.boolean().optional(),
|
|
298
|
+
value: v4_1.z.string().optional(),
|
|
299
299
|
}),
|
|
300
300
|
});
|
|
301
301
|
/** Select component definition */
|
|
302
302
|
exports.SelectComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
303
|
-
component:
|
|
304
|
-
props:
|
|
305
|
-
label:
|
|
306
|
-
placeholder:
|
|
307
|
-
helpText:
|
|
303
|
+
component: v4_1.z.literal('Select'),
|
|
304
|
+
props: v4_1.z.object({
|
|
305
|
+
label: v4_1.z.string().optional(),
|
|
306
|
+
placeholder: v4_1.z.string().optional(),
|
|
307
|
+
helpText: v4_1.z.string().optional(),
|
|
308
308
|
/** Static items array (will be populated by iterable if using dynamic items) */
|
|
309
|
-
items:
|
|
310
|
-
value:
|
|
311
|
-
isDisabled:
|
|
312
|
-
required:
|
|
309
|
+
items: v4_1.z.union([v4_1.z.array(v4_1.z.object({ value: v4_1.z.string(), label: v4_1.z.string() })), v4_1.z.string()]).optional(),
|
|
310
|
+
value: v4_1.z.string().optional(),
|
|
311
|
+
isDisabled: v4_1.z.boolean().optional(),
|
|
312
|
+
required: v4_1.z.boolean().optional(),
|
|
313
313
|
}),
|
|
314
314
|
relationship: exports.RelationshipExtensionSchema.optional(),
|
|
315
315
|
/** For dynamic items using iterable pattern (e.g., 'system.models') */
|
|
316
|
-
iterable:
|
|
316
|
+
iterable: v4_1.z.string().optional(),
|
|
317
317
|
/** Template for each item in the iterable */
|
|
318
|
-
itemTemplate:
|
|
319
|
-
value:
|
|
320
|
-
label:
|
|
318
|
+
itemTemplate: v4_1.z.object({
|
|
319
|
+
value: v4_1.z.string(),
|
|
320
|
+
label: v4_1.z.string(),
|
|
321
321
|
}).optional(),
|
|
322
322
|
});
|
|
323
323
|
/** Combobox component definition */
|
|
324
324
|
exports.ComboboxComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
325
|
-
component:
|
|
326
|
-
props:
|
|
327
|
-
label:
|
|
328
|
-
placeholder:
|
|
329
|
-
helpText:
|
|
330
|
-
items:
|
|
331
|
-
value:
|
|
325
|
+
component: v4_1.z.literal('Combobox'),
|
|
326
|
+
props: v4_1.z.object({
|
|
327
|
+
label: v4_1.z.string().optional(),
|
|
328
|
+
placeholder: v4_1.z.string().optional(),
|
|
329
|
+
helpText: v4_1.z.string().optional(),
|
|
330
|
+
items: v4_1.z.array(v4_1.z.object({ value: v4_1.z.string(), label: v4_1.z.string() })).optional(),
|
|
331
|
+
value: v4_1.z.string().optional(),
|
|
332
332
|
}),
|
|
333
333
|
relationship: exports.RelationshipExtensionSchema.optional(),
|
|
334
334
|
});
|
|
335
335
|
/** Checkbox component definition */
|
|
336
336
|
exports.CheckboxComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
337
|
-
component:
|
|
338
|
-
props:
|
|
339
|
-
label:
|
|
340
|
-
helpText:
|
|
341
|
-
checked:
|
|
342
|
-
disabled:
|
|
337
|
+
component: v4_1.z.literal('Checkbox'),
|
|
338
|
+
props: v4_1.z.object({
|
|
339
|
+
label: v4_1.z.string().optional(),
|
|
340
|
+
helpText: v4_1.z.string().optional(),
|
|
341
|
+
checked: v4_1.z.boolean().optional(),
|
|
342
|
+
disabled: v4_1.z.boolean().optional(),
|
|
343
343
|
}),
|
|
344
344
|
});
|
|
345
345
|
/** DatePicker component definition */
|
|
346
346
|
exports.DatePickerComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
347
|
-
component:
|
|
348
|
-
props:
|
|
349
|
-
label:
|
|
350
|
-
helpText:
|
|
351
|
-
value:
|
|
352
|
-
disabled:
|
|
347
|
+
component: v4_1.z.literal('DatePicker'),
|
|
348
|
+
props: v4_1.z.object({
|
|
349
|
+
label: v4_1.z.string().optional(),
|
|
350
|
+
helpText: v4_1.z.string().optional(),
|
|
351
|
+
value: v4_1.z.union([v4_1.z.string(), v4_1.z.date()]).optional(),
|
|
352
|
+
disabled: v4_1.z.boolean().optional(),
|
|
353
353
|
}),
|
|
354
354
|
});
|
|
355
355
|
/** TimePicker component definition */
|
|
356
356
|
exports.TimePickerComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
357
|
-
component:
|
|
358
|
-
props:
|
|
359
|
-
label:
|
|
360
|
-
helpText:
|
|
361
|
-
value:
|
|
362
|
-
disabled:
|
|
357
|
+
component: v4_1.z.literal('TimePicker'),
|
|
358
|
+
props: v4_1.z.object({
|
|
359
|
+
label: v4_1.z.string().optional(),
|
|
360
|
+
helpText: v4_1.z.string().optional(),
|
|
361
|
+
value: v4_1.z.string().optional(),
|
|
362
|
+
disabled: v4_1.z.boolean().optional(),
|
|
363
363
|
}),
|
|
364
364
|
});
|
|
365
365
|
/** ImageSetting component definition */
|
|
366
366
|
exports.ImageSettingComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
367
|
-
component:
|
|
368
|
-
props:
|
|
369
|
-
label:
|
|
370
|
-
description:
|
|
371
|
-
helpText:
|
|
372
|
-
accept:
|
|
367
|
+
component: v4_1.z.literal('ImageSetting'),
|
|
368
|
+
props: v4_1.z.object({
|
|
369
|
+
label: v4_1.z.string().optional(),
|
|
370
|
+
description: v4_1.z.string().optional(),
|
|
371
|
+
helpText: v4_1.z.string().optional(),
|
|
372
|
+
accept: v4_1.z.string().optional(),
|
|
373
373
|
}),
|
|
374
374
|
});
|
|
375
375
|
/** FileSetting component definition for file uploads */
|
|
376
376
|
exports.FileSettingComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
377
|
-
component:
|
|
378
|
-
props:
|
|
379
|
-
label:
|
|
380
|
-
description:
|
|
381
|
-
helpText:
|
|
382
|
-
accept:
|
|
383
|
-
required:
|
|
384
|
-
button:
|
|
385
|
-
label:
|
|
386
|
-
variant:
|
|
387
|
-
size:
|
|
377
|
+
component: v4_1.z.literal('FileSetting'),
|
|
378
|
+
props: v4_1.z.object({
|
|
379
|
+
label: v4_1.z.string().optional(),
|
|
380
|
+
description: v4_1.z.string().optional(),
|
|
381
|
+
helpText: v4_1.z.string().optional(),
|
|
382
|
+
accept: v4_1.z.string().optional(),
|
|
383
|
+
required: v4_1.z.boolean().optional(),
|
|
384
|
+
button: v4_1.z.object({
|
|
385
|
+
label: v4_1.z.string().optional(),
|
|
386
|
+
variant: v4_1.z.enum(['default', 'outline', 'ghost', 'link']).optional(),
|
|
387
|
+
size: v4_1.z.enum(['sm', 'md', 'lg']).optional(),
|
|
388
388
|
}).optional(),
|
|
389
389
|
}),
|
|
390
390
|
});
|
|
391
391
|
/** Item template schema for server-side iterable rendering */
|
|
392
|
-
exports.ListItemTemplateSchema =
|
|
393
|
-
component:
|
|
394
|
-
span:
|
|
395
|
-
mdSpan:
|
|
396
|
-
lgSpan:
|
|
397
|
-
props:
|
|
392
|
+
exports.ListItemTemplateSchema = v4_1.z.object({
|
|
393
|
+
component: v4_1.z.string(),
|
|
394
|
+
span: v4_1.z.number().optional(),
|
|
395
|
+
mdSpan: v4_1.z.number().optional(),
|
|
396
|
+
lgSpan: v4_1.z.number().optional(),
|
|
397
|
+
props: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()),
|
|
398
398
|
});
|
|
399
399
|
/** List component definition */
|
|
400
400
|
exports.ListComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
401
|
-
component:
|
|
402
|
-
props:
|
|
403
|
-
title:
|
|
404
|
-
items:
|
|
405
|
-
id:
|
|
406
|
-
label:
|
|
407
|
-
description:
|
|
401
|
+
component: v4_1.z.literal('List'),
|
|
402
|
+
props: v4_1.z.object({
|
|
403
|
+
title: v4_1.z.string().optional(),
|
|
404
|
+
items: v4_1.z.array(v4_1.z.object({
|
|
405
|
+
id: v4_1.z.string(),
|
|
406
|
+
label: v4_1.z.string(),
|
|
407
|
+
description: v4_1.z.string().optional(),
|
|
408
408
|
})).optional(),
|
|
409
|
-
emptyMessage:
|
|
409
|
+
emptyMessage: v4_1.z.string().optional(),
|
|
410
410
|
}),
|
|
411
|
-
model:
|
|
412
|
-
labelField:
|
|
413
|
-
descriptionField:
|
|
414
|
-
icon:
|
|
411
|
+
model: v4_1.z.string().optional(),
|
|
412
|
+
labelField: v4_1.z.string().optional(),
|
|
413
|
+
descriptionField: v4_1.z.string().optional(),
|
|
414
|
+
icon: v4_1.z.string().optional(),
|
|
415
415
|
/** Context variable name to iterate over (e.g., 'phone_numbers') */
|
|
416
|
-
iterable:
|
|
416
|
+
iterable: v4_1.z.string().optional(),
|
|
417
417
|
/** Template for each item - use {{ item.xyz }} for field values */
|
|
418
418
|
itemTemplate: exports.ListItemTemplateSchema.optional(),
|
|
419
419
|
});
|
|
420
420
|
/** EmptyForm component definition */
|
|
421
421
|
exports.EmptyFormComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
422
|
-
component:
|
|
423
|
-
props:
|
|
424
|
-
title:
|
|
425
|
-
description:
|
|
426
|
-
icon:
|
|
422
|
+
component: v4_1.z.literal('EmptyForm'),
|
|
423
|
+
props: v4_1.z.object({
|
|
424
|
+
title: v4_1.z.string().optional(),
|
|
425
|
+
description: v4_1.z.string().optional(),
|
|
426
|
+
icon: v4_1.z.string().optional(),
|
|
427
427
|
}),
|
|
428
428
|
});
|
|
429
429
|
/** Alert component definition for display-only informational content */
|
|
430
430
|
exports.AlertComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
431
|
-
component:
|
|
432
|
-
props:
|
|
433
|
-
title:
|
|
434
|
-
description:
|
|
435
|
-
icon:
|
|
436
|
-
variant:
|
|
431
|
+
component: v4_1.z.literal('Alert'),
|
|
432
|
+
props: v4_1.z.object({
|
|
433
|
+
title: v4_1.z.string(),
|
|
434
|
+
description: v4_1.z.string(),
|
|
435
|
+
icon: v4_1.z.string().optional(),
|
|
436
|
+
variant: v4_1.z.enum(['default', 'destructive']).optional(),
|
|
437
437
|
}),
|
|
438
438
|
});
|
|
439
439
|
/** Modal form definition for nested forms */
|
|
440
|
-
exports.ModalFormDefinitionSchema =
|
|
440
|
+
exports.ModalFormDefinitionSchema = v4_1.z.object({
|
|
441
441
|
header: exports.PageFormHeaderSchema,
|
|
442
|
-
handler:
|
|
442
|
+
handler: v4_1.z.string(),
|
|
443
443
|
/** Named dialog template to use instead of inline fields */
|
|
444
|
-
template:
|
|
444
|
+
template: v4_1.z.string().optional(),
|
|
445
445
|
/** Template-specific params to pass to the dialog */
|
|
446
|
-
templateParams:
|
|
446
|
+
templateParams: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional(),
|
|
447
447
|
/** Inline field definitions (used when template is not specified) */
|
|
448
|
-
fields:
|
|
448
|
+
fields: v4_1.z.lazy(() => v4_1.z.array(exports.FormV2ComponentDefinitionSchema)).optional(),
|
|
449
449
|
layout: exports.FormLayoutConfigDefinitionSchema.optional(),
|
|
450
|
-
actions:
|
|
450
|
+
actions: v4_1.z.array(exports.PageActionDefinitionSchema).optional(),
|
|
451
451
|
});
|
|
452
452
|
/** FieldSetting component definition */
|
|
453
453
|
exports.FieldSettingComponentDefinitionSchema = exports.FormV2StylePropsSchema.extend({
|
|
454
|
-
component:
|
|
455
|
-
props:
|
|
456
|
-
label:
|
|
457
|
-
description:
|
|
458
|
-
helpText:
|
|
459
|
-
mode:
|
|
454
|
+
component: v4_1.z.literal('FieldSetting'),
|
|
455
|
+
props: v4_1.z.object({
|
|
456
|
+
label: v4_1.z.string(),
|
|
457
|
+
description: v4_1.z.string().optional(),
|
|
458
|
+
helpText: v4_1.z.string().optional(),
|
|
459
|
+
mode: v4_1.z.enum(['field', 'setting']).optional(),
|
|
460
460
|
/** Status indicator - can be literal or Liquid template */
|
|
461
|
-
status:
|
|
461
|
+
status: v4_1.z.string().optional(),
|
|
462
462
|
/** Text to display alongside status badge - can be Liquid template */
|
|
463
|
-
statusText:
|
|
463
|
+
statusText: v4_1.z.string().optional(),
|
|
464
464
|
button: exports.FieldSettingButtonPropsSchema,
|
|
465
465
|
}),
|
|
466
466
|
modalForm: exports.ModalFormDefinitionSchema.optional(),
|
|
467
467
|
});
|
|
468
468
|
/** Union of all FormV2 component definitions */
|
|
469
|
-
exports.FormV2ComponentDefinitionSchema =
|
|
469
|
+
exports.FormV2ComponentDefinitionSchema = v4_1.z.discriminatedUnion('component', [
|
|
470
470
|
exports.InputComponentDefinitionSchema,
|
|
471
471
|
exports.TextareaComponentDefinitionSchema,
|
|
472
472
|
exports.SelectComponentDefinitionSchema,
|
|
@@ -482,94 +482,94 @@ exports.FormV2ComponentDefinitionSchema = zod_1.z.discriminatedUnion('component'
|
|
|
482
482
|
exports.AlertComponentDefinitionSchema,
|
|
483
483
|
]);
|
|
484
484
|
/** FormV2 props definition */
|
|
485
|
-
exports.FormV2PropsDefinitionSchema =
|
|
486
|
-
formVersion:
|
|
487
|
-
id:
|
|
488
|
-
fields:
|
|
485
|
+
exports.FormV2PropsDefinitionSchema = v4_1.z.object({
|
|
486
|
+
formVersion: v4_1.z.literal('v2'),
|
|
487
|
+
id: v4_1.z.string().optional(),
|
|
488
|
+
fields: v4_1.z.array(exports.FormV2ComponentDefinitionSchema),
|
|
489
489
|
layout: exports.FormLayoutConfigDefinitionSchema,
|
|
490
490
|
/** Optional actions that trigger MCP tool calls */
|
|
491
|
-
actions:
|
|
491
|
+
actions: v4_1.z.array(exports.PageActionDefinitionSchema).optional(),
|
|
492
492
|
});
|
|
493
493
|
/** Card block header definition */
|
|
494
|
-
exports.CardBlockHeaderSchema =
|
|
495
|
-
title:
|
|
496
|
-
description:
|
|
497
|
-
descriptionHref:
|
|
494
|
+
exports.CardBlockHeaderSchema = v4_1.z.object({
|
|
495
|
+
title: v4_1.z.string(),
|
|
496
|
+
description: v4_1.z.string().optional(),
|
|
497
|
+
descriptionHref: v4_1.z.string().optional(),
|
|
498
498
|
});
|
|
499
499
|
/** Card block definition (CardV2-aligned) */
|
|
500
|
-
exports.CardBlockDefinitionSchema =
|
|
501
|
-
type:
|
|
502
|
-
restructurable:
|
|
500
|
+
exports.CardBlockDefinitionSchema = v4_1.z.object({
|
|
501
|
+
type: v4_1.z.literal('card'),
|
|
502
|
+
restructurable: v4_1.z.boolean().optional(),
|
|
503
503
|
header: exports.CardBlockHeaderSchema.optional(),
|
|
504
504
|
form: exports.FormV2PropsDefinitionSchema,
|
|
505
|
-
actions:
|
|
506
|
-
secondaryActions:
|
|
507
|
-
primaryActions:
|
|
505
|
+
actions: v4_1.z.array(exports.PageActionDefinitionSchema).optional(),
|
|
506
|
+
secondaryActions: v4_1.z.array(exports.PageActionDefinitionSchema).optional(),
|
|
507
|
+
primaryActions: v4_1.z.array(exports.PageActionDefinitionSchema).optional(),
|
|
508
508
|
});
|
|
509
509
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
510
510
|
// Legacy Page Field Definition (for backward compatibility)
|
|
511
511
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
512
512
|
/** Base field definition */
|
|
513
|
-
const PageFieldDefinitionBaseSchema =
|
|
514
|
-
handle:
|
|
513
|
+
const PageFieldDefinitionBaseSchema = v4_1.z.object({
|
|
514
|
+
handle: v4_1.z.string(),
|
|
515
515
|
type: exports.PageFieldTypeSchema,
|
|
516
|
-
label:
|
|
517
|
-
description:
|
|
518
|
-
required:
|
|
519
|
-
handler:
|
|
516
|
+
label: v4_1.z.string(),
|
|
517
|
+
description: v4_1.z.string().optional(),
|
|
518
|
+
required: v4_1.z.boolean().optional(),
|
|
519
|
+
handler: v4_1.z.string().optional(),
|
|
520
520
|
source: exports.PageFieldSourceSchema.optional(),
|
|
521
|
-
options:
|
|
522
|
-
accept:
|
|
523
|
-
model:
|
|
521
|
+
options: v4_1.z.array(v4_1.z.object({ value: v4_1.z.string(), label: v4_1.z.string() })).optional(),
|
|
522
|
+
accept: v4_1.z.string().optional(),
|
|
523
|
+
model: v4_1.z.string().optional(),
|
|
524
524
|
});
|
|
525
525
|
/** Self-contained field definition for page blocks */
|
|
526
526
|
exports.PageFieldDefinitionSchema = PageFieldDefinitionBaseSchema.extend({
|
|
527
527
|
header: exports.PageFormHeaderSchema.optional(),
|
|
528
|
-
fields:
|
|
529
|
-
actions:
|
|
528
|
+
fields: v4_1.z.lazy(() => v4_1.z.array(exports.PageFieldDefinitionSchema)).optional(),
|
|
529
|
+
actions: v4_1.z.lazy(() => v4_1.z.array(exports.PageActionDefinitionSchema)).optional(),
|
|
530
530
|
});
|
|
531
531
|
/** Legacy form block definition */
|
|
532
|
-
exports.LegacyFormBlockDefinitionSchema =
|
|
533
|
-
type:
|
|
534
|
-
title:
|
|
535
|
-
fields:
|
|
536
|
-
readonly:
|
|
532
|
+
exports.LegacyFormBlockDefinitionSchema = v4_1.z.object({
|
|
533
|
+
type: v4_1.z.enum(['form', 'spreadsheet', 'kanban', 'calendar', 'link']),
|
|
534
|
+
title: v4_1.z.string().optional(),
|
|
535
|
+
fields: v4_1.z.array(exports.PageFieldDefinitionSchema).optional(),
|
|
536
|
+
readonly: v4_1.z.boolean().optional(),
|
|
537
537
|
});
|
|
538
538
|
/** List block definition */
|
|
539
|
-
exports.ListBlockDefinitionSchema =
|
|
540
|
-
type:
|
|
541
|
-
title:
|
|
542
|
-
model:
|
|
543
|
-
labelField:
|
|
544
|
-
descriptionField:
|
|
545
|
-
icon:
|
|
546
|
-
emptyMessage:
|
|
539
|
+
exports.ListBlockDefinitionSchema = v4_1.z.object({
|
|
540
|
+
type: v4_1.z.literal('list'),
|
|
541
|
+
title: v4_1.z.string().optional(),
|
|
542
|
+
model: v4_1.z.string(),
|
|
543
|
+
labelField: v4_1.z.string().optional(),
|
|
544
|
+
descriptionField: v4_1.z.string().optional(),
|
|
545
|
+
icon: v4_1.z.string().optional(),
|
|
546
|
+
emptyMessage: v4_1.z.string().optional(),
|
|
547
547
|
});
|
|
548
548
|
/** Model mapper block definition - for mapping SHARED models to workspace models */
|
|
549
|
-
exports.ModelMapperBlockDefinitionSchema =
|
|
550
|
-
type:
|
|
549
|
+
exports.ModelMapperBlockDefinitionSchema = v4_1.z.object({
|
|
550
|
+
type: v4_1.z.literal('model-mapper'),
|
|
551
551
|
/** The SHARED model handle from provision config (e.g., "client", "patient") */
|
|
552
|
-
model:
|
|
552
|
+
model: v4_1.z.string(),
|
|
553
553
|
});
|
|
554
554
|
/** Union of all block types */
|
|
555
|
-
exports.PageBlockDefinitionSchema =
|
|
555
|
+
exports.PageBlockDefinitionSchema = v4_1.z.union([
|
|
556
556
|
exports.CardBlockDefinitionSchema,
|
|
557
557
|
exports.LegacyFormBlockDefinitionSchema,
|
|
558
558
|
exports.ListBlockDefinitionSchema,
|
|
559
559
|
exports.ModelMapperBlockDefinitionSchema,
|
|
560
560
|
]);
|
|
561
561
|
/** Mode for context data fetching */
|
|
562
|
-
exports.PageContextModeSchema =
|
|
562
|
+
exports.PageContextModeSchema = v4_1.z.enum(['first', 'many', 'count']);
|
|
563
563
|
/**
|
|
564
564
|
* Page context filters schema.
|
|
565
565
|
* Uses structured filter format: { fieldHandle: { operator: value } }
|
|
566
566
|
* Values can be Liquid template strings, e.g., { id: { eq: '{{ path_params.id }}' } }
|
|
567
567
|
*/
|
|
568
|
-
exports.PageContextFiltersSchema =
|
|
568
|
+
exports.PageContextFiltersSchema = v4_1.z.record(v4_1.z.string(), v4_1.z.record(v4_1.z.string(), v4_1.z.union([PrimitiveSchema, v4_1.z.array(PrimitiveSchema), v4_1.z.string()])));
|
|
569
569
|
/** Single context item definition (model-based) */
|
|
570
|
-
exports.PageContextItemDefinitionSchema =
|
|
570
|
+
exports.PageContextItemDefinitionSchema = v4_1.z.object({
|
|
571
571
|
/** Model handle to fetch data from */
|
|
572
|
-
model:
|
|
572
|
+
model: v4_1.z.string(),
|
|
573
573
|
/** Fetch mode: 'first' returns single object, 'many' returns array, 'count' returns number */
|
|
574
574
|
mode: exports.PageContextModeSchema,
|
|
575
575
|
/**
|
|
@@ -579,79 +579,79 @@ exports.PageContextItemDefinitionSchema = zod_1.z.object({
|
|
|
579
579
|
*/
|
|
580
580
|
filters: exports.PageContextFiltersSchema.optional(),
|
|
581
581
|
/** Optional limit for 'many' mode */
|
|
582
|
-
limit:
|
|
582
|
+
limit: v4_1.z.number().optional(),
|
|
583
583
|
});
|
|
584
584
|
/** Single context item definition (tool-based) */
|
|
585
|
-
exports.PageContextToolItemDefinitionSchema =
|
|
585
|
+
exports.PageContextToolItemDefinitionSchema = v4_1.z.object({
|
|
586
586
|
/** Tool name to invoke for fetching context data */
|
|
587
|
-
tool:
|
|
587
|
+
tool: v4_1.z.string(),
|
|
588
588
|
});
|
|
589
589
|
/** Context definition: variable name -> context item (model or tool-based) */
|
|
590
|
-
exports.PageContextDefinitionSchema =
|
|
590
|
+
exports.PageContextDefinitionSchema = v4_1.z.record(v4_1.z.string(), v4_1.z.union([exports.PageContextItemDefinitionSchema, exports.PageContextToolItemDefinitionSchema]));
|
|
591
591
|
/** @deprecated Use PageContextDefinitionSchema instead */
|
|
592
|
-
exports.PageInstanceFilterSchema =
|
|
593
|
-
model:
|
|
594
|
-
where:
|
|
592
|
+
exports.PageInstanceFilterSchema = v4_1.z.object({
|
|
593
|
+
model: v4_1.z.string(),
|
|
594
|
+
where: v4_1.z.record(v4_1.z.string(), v4_1.z.unknown()).optional(),
|
|
595
595
|
});
|
|
596
596
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
597
597
|
// Navigation Schemas
|
|
598
598
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
599
599
|
/** Navigation item for sidebar */
|
|
600
|
-
exports.NavigationItemSchema =
|
|
600
|
+
exports.NavigationItemSchema = v4_1.z.object({
|
|
601
601
|
/** Display label (supports Liquid templates) */
|
|
602
|
-
label:
|
|
602
|
+
label: v4_1.z.string(),
|
|
603
603
|
/** URL href (supports Liquid templates with path_params and context) */
|
|
604
|
-
href:
|
|
604
|
+
href: v4_1.z.string(),
|
|
605
605
|
/** Optional icon name */
|
|
606
|
-
icon:
|
|
606
|
+
icon: v4_1.z.string().optional(),
|
|
607
607
|
});
|
|
608
608
|
/** Navigation section with title and items */
|
|
609
|
-
exports.NavigationSectionSchema =
|
|
609
|
+
exports.NavigationSectionSchema = v4_1.z.object({
|
|
610
610
|
/** Section title (supports Liquid templates) */
|
|
611
|
-
title:
|
|
611
|
+
title: v4_1.z.string().optional(),
|
|
612
612
|
/** Navigation items in this section */
|
|
613
|
-
items:
|
|
613
|
+
items: v4_1.z.array(exports.NavigationItemSchema),
|
|
614
614
|
});
|
|
615
615
|
/** Sidebar navigation configuration */
|
|
616
|
-
exports.NavigationSidebarSchema =
|
|
616
|
+
exports.NavigationSidebarSchema = v4_1.z.object({
|
|
617
617
|
/** Sections to display in the sidebar */
|
|
618
|
-
sections:
|
|
618
|
+
sections: v4_1.z.array(exports.NavigationSectionSchema),
|
|
619
619
|
});
|
|
620
620
|
/** Breadcrumb item */
|
|
621
|
-
exports.BreadcrumbItemSchema =
|
|
621
|
+
exports.BreadcrumbItemSchema = v4_1.z.object({
|
|
622
622
|
/** Display label (supports Liquid templates) */
|
|
623
|
-
label:
|
|
623
|
+
label: v4_1.z.string(),
|
|
624
624
|
/** Optional href - if not provided, item is not clickable */
|
|
625
|
-
href:
|
|
625
|
+
href: v4_1.z.string().optional(),
|
|
626
626
|
});
|
|
627
627
|
/** Breadcrumb navigation configuration */
|
|
628
|
-
exports.NavigationBreadcrumbSchema =
|
|
628
|
+
exports.NavigationBreadcrumbSchema = v4_1.z.object({
|
|
629
629
|
/** Breadcrumb items from left to right */
|
|
630
|
-
items:
|
|
630
|
+
items: v4_1.z.array(exports.BreadcrumbItemSchema),
|
|
631
631
|
});
|
|
632
632
|
/** Full navigation configuration */
|
|
633
|
-
exports.NavigationConfigSchema =
|
|
633
|
+
exports.NavigationConfigSchema = v4_1.z.object({
|
|
634
634
|
/** Sidebar navigation */
|
|
635
635
|
sidebar: exports.NavigationSidebarSchema.optional(),
|
|
636
636
|
/** Breadcrumb navigation */
|
|
637
637
|
breadcrumb: exports.NavigationBreadcrumbSchema.optional(),
|
|
638
638
|
});
|
|
639
|
-
exports.PageDefinitionSchema =
|
|
639
|
+
exports.PageDefinitionSchema = v4_1.z.object({
|
|
640
640
|
type: exports.PageTypeSchema,
|
|
641
|
-
title:
|
|
641
|
+
title: v4_1.z.string(),
|
|
642
642
|
/** URL path for this page (e.g., '/phone-numbers' or '/phone-numbers/[id]' for dynamic segments) */
|
|
643
|
-
path:
|
|
643
|
+
path: v4_1.z.string(),
|
|
644
644
|
/** When true, this page is the default landing page for the app installation */
|
|
645
|
-
default:
|
|
645
|
+
default: v4_1.z.boolean().optional(),
|
|
646
646
|
/**
|
|
647
647
|
* Navigation configuration:
|
|
648
648
|
* - true/false: show/hide in auto-generated navigation
|
|
649
649
|
* - string: Liquid template that evaluates to true/false
|
|
650
650
|
* - NavigationConfigSchema: full navigation override for this page (replaces base navigation)
|
|
651
651
|
*/
|
|
652
|
-
navigation:
|
|
653
|
-
blocks:
|
|
654
|
-
actions:
|
|
652
|
+
navigation: v4_1.z.union([v4_1.z.boolean(), v4_1.z.string(), exports.NavigationConfigSchema]).optional().default(true),
|
|
653
|
+
blocks: v4_1.z.array(exports.PageBlockDefinitionSchema),
|
|
654
|
+
actions: v4_1.z.array(exports.PageActionDefinitionSchema).optional(),
|
|
655
655
|
/** Context data to load for Liquid templates. appInstallationId filtering is automatic. */
|
|
656
656
|
context: exports.PageContextDefinitionSchema.optional(),
|
|
657
657
|
/** @deprecated Use context instead */
|
|
@@ -660,60 +660,60 @@ exports.PageDefinitionSchema = zod_1.z.object({
|
|
|
660
660
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
661
661
|
// Webhook Schemas
|
|
662
662
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
663
|
-
exports.WebhookHttpMethodSchema =
|
|
664
|
-
exports.WebhookTypeSchema =
|
|
665
|
-
exports.WebhookHandlerDefinitionSchema =
|
|
666
|
-
description:
|
|
667
|
-
methods:
|
|
663
|
+
exports.WebhookHttpMethodSchema = v4_1.z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']);
|
|
664
|
+
exports.WebhookTypeSchema = v4_1.z.enum(['WEBHOOK', 'CALLBACK']);
|
|
665
|
+
exports.WebhookHandlerDefinitionSchema = v4_1.z.object({
|
|
666
|
+
description: v4_1.z.string().optional(),
|
|
667
|
+
methods: v4_1.z.array(exports.WebhookHttpMethodSchema).optional(),
|
|
668
668
|
/** Invocation type: WEBHOOK (fire-and-forget) or CALLBACK (waits for response). Defaults to WEBHOOK. */
|
|
669
669
|
type: exports.WebhookTypeSchema.optional(),
|
|
670
|
-
handler:
|
|
670
|
+
handler: v4_1.z.unknown(),
|
|
671
671
|
});
|
|
672
|
-
exports.WebhooksSchema =
|
|
672
|
+
exports.WebhooksSchema = v4_1.z.record(v4_1.z.string(), exports.WebhookHandlerDefinitionSchema);
|
|
673
673
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
674
674
|
// Provision Config Schema
|
|
675
675
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
676
676
|
// Agent Definition Schema
|
|
677
677
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
678
|
-
exports.AgentDefinitionSchema =
|
|
678
|
+
exports.AgentDefinitionSchema = v4_1.z.object({
|
|
679
679
|
/** Unique identifier within the app (used for upserts) */
|
|
680
|
-
handle:
|
|
680
|
+
handle: v4_1.z.string().regex(/^[a-z0-9_-]+$/, 'Handle must be lowercase alphanumeric with dashes/underscores'),
|
|
681
681
|
/** Display name */
|
|
682
|
-
name:
|
|
682
|
+
name: v4_1.z.string().min(1),
|
|
683
683
|
/** Description of what the agent does */
|
|
684
|
-
description:
|
|
684
|
+
description: v4_1.z.string(),
|
|
685
685
|
/** System prompt (static, no templating) */
|
|
686
|
-
system:
|
|
686
|
+
system: v4_1.z.string(),
|
|
687
687
|
/** Tool names to bind (can be empty for orchestrator agents) */
|
|
688
|
-
tools:
|
|
688
|
+
tools: v4_1.z.array(v4_1.z.string()),
|
|
689
689
|
/** Optional LLM model override */
|
|
690
|
-
llmModelId:
|
|
690
|
+
llmModelId: v4_1.z.string().optional(),
|
|
691
691
|
/** Parent agent that can call this agent ('composer' or another agent handle) */
|
|
692
|
-
parentAgent:
|
|
692
|
+
parentAgent: v4_1.z.string().optional(),
|
|
693
693
|
});
|
|
694
694
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
695
|
-
exports.ProvisionConfigSchema =
|
|
695
|
+
exports.ProvisionConfigSchema = v4_1.z.object({
|
|
696
696
|
env: exports.EnvSchemaSchema.optional(),
|
|
697
|
-
models:
|
|
698
|
-
relationships:
|
|
699
|
-
channels:
|
|
700
|
-
workflows:
|
|
697
|
+
models: v4_1.z.array(exports.ModelDefinitionSchema).optional(),
|
|
698
|
+
relationships: v4_1.z.array(exports.RelationshipDefinitionSchema).optional(),
|
|
699
|
+
channels: v4_1.z.array(exports.ChannelDefinitionSchema).optional(),
|
|
700
|
+
workflows: v4_1.z.array(exports.WorkflowDefinitionSchema).optional(),
|
|
701
701
|
/** Base navigation configuration for all pages (can be overridden per page) */
|
|
702
702
|
navigation: exports.NavigationConfigSchema.optional(),
|
|
703
|
-
pages:
|
|
703
|
+
pages: v4_1.z.array(exports.PageDefinitionSchema).optional(),
|
|
704
704
|
});
|
|
705
705
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
706
706
|
// Main Config Schema
|
|
707
707
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
708
|
-
exports.SkedyulConfigSchema =
|
|
709
|
-
name:
|
|
710
|
-
version:
|
|
711
|
-
description:
|
|
708
|
+
exports.SkedyulConfigSchema = v4_1.z.object({
|
|
709
|
+
name: v4_1.z.string(),
|
|
710
|
+
version: v4_1.z.string().optional(),
|
|
711
|
+
description: v4_1.z.string().optional(),
|
|
712
712
|
computeLayer: exports.ComputeLayerTypeSchema.optional(),
|
|
713
|
-
tools:
|
|
714
|
-
webhooks:
|
|
715
|
-
provision:
|
|
716
|
-
agents:
|
|
713
|
+
tools: v4_1.z.unknown().optional(),
|
|
714
|
+
webhooks: v4_1.z.unknown().optional(),
|
|
715
|
+
provision: v4_1.z.union([exports.ProvisionConfigSchema, v4_1.z.unknown()]).optional(),
|
|
716
|
+
agents: v4_1.z.array(exports.AgentDefinitionSchema).optional(),
|
|
717
717
|
});
|
|
718
718
|
function safeParseConfig(data) {
|
|
719
719
|
const result = exports.SkedyulConfigSchema.safeParse(data);
|
|
@@ -722,34 +722,34 @@ function safeParseConfig(data) {
|
|
|
722
722
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
723
723
|
// Messaging Tool Schemas
|
|
724
724
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
725
|
-
exports.MessageSendChannelSchema =
|
|
726
|
-
id:
|
|
727
|
-
handle:
|
|
728
|
-
identifierValue:
|
|
725
|
+
exports.MessageSendChannelSchema = v4_1.z.object({
|
|
726
|
+
id: v4_1.z.string(),
|
|
727
|
+
handle: v4_1.z.string(),
|
|
728
|
+
identifierValue: v4_1.z.string(),
|
|
729
729
|
});
|
|
730
|
-
exports.MessageSendSubscriptionSchema =
|
|
731
|
-
id:
|
|
732
|
-
identifierValue:
|
|
730
|
+
exports.MessageSendSubscriptionSchema = v4_1.z.object({
|
|
731
|
+
id: v4_1.z.string(),
|
|
732
|
+
identifierValue: v4_1.z.string(),
|
|
733
733
|
});
|
|
734
|
-
exports.MessageSendContactSchema =
|
|
735
|
-
id:
|
|
736
|
-
name:
|
|
734
|
+
exports.MessageSendContactSchema = v4_1.z.object({
|
|
735
|
+
id: v4_1.z.string(),
|
|
736
|
+
name: v4_1.z.string().optional(),
|
|
737
737
|
});
|
|
738
|
-
exports.MessageSendMessageSchema =
|
|
739
|
-
id:
|
|
740
|
-
content:
|
|
741
|
-
contentRaw:
|
|
742
|
-
title:
|
|
738
|
+
exports.MessageSendMessageSchema = v4_1.z.object({
|
|
739
|
+
id: v4_1.z.string(),
|
|
740
|
+
content: v4_1.z.string(),
|
|
741
|
+
contentRaw: v4_1.z.string().optional(),
|
|
742
|
+
title: v4_1.z.string().optional(),
|
|
743
743
|
});
|
|
744
|
-
exports.MessageSendInputSchema =
|
|
744
|
+
exports.MessageSendInputSchema = v4_1.z.object({
|
|
745
745
|
channel: exports.MessageSendChannelSchema,
|
|
746
746
|
subscription: exports.MessageSendSubscriptionSchema,
|
|
747
747
|
contact: exports.MessageSendContactSchema,
|
|
748
748
|
message: exports.MessageSendMessageSchema,
|
|
749
749
|
});
|
|
750
|
-
exports.MessageSendOutputSchema =
|
|
751
|
-
status:
|
|
752
|
-
remoteId:
|
|
750
|
+
exports.MessageSendOutputSchema = v4_1.z.object({
|
|
751
|
+
status: v4_1.z.enum(['sent', 'queued', 'failed']),
|
|
752
|
+
remoteId: v4_1.z.string().optional(),
|
|
753
753
|
});
|
|
754
754
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
755
755
|
// Type Guards
|