skedyul 1.5.2 → 1.5.10
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/cli/index.js +18 -7
- package/dist/config/queue-config.d.ts +4 -0
- package/dist/config/types/channel.d.ts +2 -0
- package/dist/dedicated/server.js +16 -6
- package/dist/esm/index.mjs +1303 -1090
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1316 -1090
- package/dist/ratelimit/context.d.ts +4 -2
- package/dist/schemas.d.ts +48 -0
- package/dist/server/utils/schema.d.ts +3 -3
- package/dist/server.js +16 -6
- package/dist/serverless/server.mjs +16 -6
- package/dist/tools/sms/gsm7.d.ts +11 -0
- package/dist/types/estimation.d.ts +74 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/tool.d.ts +27 -2
- package/package.json +9 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { z as
|
|
4
|
+
import { z as z16 } from "zod/v4";
|
|
5
5
|
|
|
6
6
|
// src/types/invocation.ts
|
|
7
7
|
function createToolCallContext(params) {
|
|
@@ -56,12 +56,110 @@ function isCronContext(ctx) {
|
|
|
56
56
|
return ctx.trigger === "cron";
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// src/types/
|
|
59
|
+
// src/types/estimation.ts
|
|
60
60
|
import { z } from "zod/v4";
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
var MoneyMinorRangeSchema = z.object({
|
|
62
|
+
currency: z.string().min(3).max(3),
|
|
63
|
+
minorUnitsLow: z.number().int().nonnegative(),
|
|
64
|
+
minorUnitsHigh: z.number().int().nonnegative(),
|
|
65
|
+
minorUnitsExpected: z.number().int().nonnegative().optional()
|
|
66
|
+
});
|
|
67
|
+
var EstimationSchema = z.object({
|
|
68
|
+
deliverableCount: z.number().int().nonnegative(),
|
|
69
|
+
skippedCount: z.number().int().nonnegative().optional(),
|
|
70
|
+
cost: MoneyMinorRangeSchema.optional()
|
|
71
|
+
});
|
|
72
|
+
function createMoneyMinorRange(params) {
|
|
73
|
+
return {
|
|
74
|
+
currency: params.currency,
|
|
75
|
+
minorUnitsLow: params.minorUnitsLow,
|
|
76
|
+
minorUnitsHigh: params.minorUnitsHigh,
|
|
77
|
+
...params.minorUnitsExpected !== void 0 ? { minorUnitsExpected: params.minorUnitsExpected } : {}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function createEstimation(params) {
|
|
81
|
+
return {
|
|
82
|
+
deliverableCount: params.deliverableCount,
|
|
83
|
+
...params.skippedCount !== void 0 ? { skippedCount: params.skippedCount } : {},
|
|
84
|
+
...params.cost ? { cost: params.cost } : {}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function computeSkewedExpectedMinorUnits(range) {
|
|
88
|
+
if (range.minorUnitsExpected !== void 0) {
|
|
89
|
+
return range.minorUnitsExpected;
|
|
90
|
+
}
|
|
91
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
92
|
+
return range.minorUnitsLow;
|
|
93
|
+
}
|
|
94
|
+
return Math.round(0.8 * range.minorUnitsLow + 0.2 * range.minorUnitsHigh);
|
|
95
|
+
}
|
|
96
|
+
function formatMoneyMinorRange(range, locale) {
|
|
97
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
98
|
+
style: "currency",
|
|
99
|
+
currency: range.currency
|
|
100
|
+
});
|
|
101
|
+
const low = formatter.format(range.minorUnitsLow / 100);
|
|
102
|
+
const high = formatter.format(range.minorUnitsHigh / 100);
|
|
103
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
104
|
+
return low;
|
|
105
|
+
}
|
|
106
|
+
return `${low} \u2013 ${high}`;
|
|
107
|
+
}
|
|
108
|
+
function formatMoneyMinorEstimate(range, options) {
|
|
109
|
+
const formatter = new Intl.NumberFormat(options?.locale, {
|
|
110
|
+
style: "currency",
|
|
111
|
+
currency: range.currency
|
|
112
|
+
});
|
|
113
|
+
const maxSpreadRatio = options?.maxSpreadRatio ?? 3;
|
|
114
|
+
const spreadRatio = range.minorUnitsLow > 0 ? range.minorUnitsHigh / range.minorUnitsLow : 1;
|
|
115
|
+
if (spreadRatio > maxSpreadRatio) {
|
|
116
|
+
return formatMoneyMinorRange(range, options?.locale);
|
|
117
|
+
}
|
|
118
|
+
const expectedMinorUnits = options?.expectedMinorUnits ?? computeSkewedExpectedMinorUnits(range);
|
|
119
|
+
const expected = formatter.format(expectedMinorUnits / 100);
|
|
120
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
121
|
+
return expected;
|
|
122
|
+
}
|
|
123
|
+
return `~${expected}`;
|
|
124
|
+
}
|
|
125
|
+
function parseEstimationFromBilling(billing) {
|
|
126
|
+
if (!billing || typeof billing !== "object") {
|
|
127
|
+
return void 0;
|
|
128
|
+
}
|
|
129
|
+
const record2 = billing;
|
|
130
|
+
const nested = record2.estimation;
|
|
131
|
+
if (nested && typeof nested === "object") {
|
|
132
|
+
const parsed = EstimationSchema.safeParse(nested);
|
|
133
|
+
if (parsed.success) {
|
|
134
|
+
return parsed.data;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const currency = typeof record2.currency === "string" && record2.currency.trim() !== "" ? record2.currency : void 0;
|
|
138
|
+
const minorUnitsLow = typeof record2.minorUnitsLow === "number" ? record2.minorUnitsLow : typeof record2.costCentsLow === "number" ? record2.costCentsLow : void 0;
|
|
139
|
+
const minorUnitsHigh = typeof record2.minorUnitsHigh === "number" ? record2.minorUnitsHigh : typeof record2.costCentsHigh === "number" ? record2.costCentsHigh : void 0;
|
|
140
|
+
const minorUnitsExpected = typeof record2.minorUnitsExpected === "number" ? record2.minorUnitsExpected : typeof record2.costCentsExpected === "number" ? record2.costCentsExpected : void 0;
|
|
141
|
+
const deliverableCount = typeof record2.deliverableCount === "number" ? record2.deliverableCount : void 0;
|
|
142
|
+
if (deliverableCount === void 0 || minorUnitsLow === void 0 || minorUnitsHigh === void 0 || !currency) {
|
|
143
|
+
return void 0;
|
|
144
|
+
}
|
|
145
|
+
return createEstimation({
|
|
146
|
+
deliverableCount,
|
|
147
|
+
skippedCount: typeof record2.skippedCount === "number" ? record2.skippedCount : void 0,
|
|
148
|
+
cost: createMoneyMinorRange({
|
|
149
|
+
currency,
|
|
150
|
+
minorUnitsLow,
|
|
151
|
+
minorUnitsHigh,
|
|
152
|
+
...minorUnitsExpected !== void 0 ? { minorUnitsExpected } : {}
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/types/tool.ts
|
|
158
|
+
import { z as z2 } from "zod/v4";
|
|
159
|
+
var ToolResponseMetaSchema = z2.object({
|
|
160
|
+
success: z2.boolean(),
|
|
161
|
+
message: z2.string(),
|
|
162
|
+
toolName: z2.string()
|
|
65
163
|
});
|
|
66
164
|
|
|
67
165
|
// src/types/tool-response.ts
|
|
@@ -202,11 +300,11 @@ function isRuntimeWebhookContext(ctx) {
|
|
|
202
300
|
}
|
|
203
301
|
|
|
204
302
|
// src/schemas.ts
|
|
205
|
-
import { z as
|
|
303
|
+
import { z as z8 } from "zod/v4";
|
|
206
304
|
|
|
207
305
|
// src/schemas/crm-schema.ts
|
|
208
|
-
import { z as
|
|
209
|
-
var CRMFieldTypeSchema =
|
|
306
|
+
import { z as z3 } from "zod/v4";
|
|
307
|
+
var CRMFieldTypeSchema = z3.enum([
|
|
210
308
|
"string",
|
|
211
309
|
"long_string",
|
|
212
310
|
"number",
|
|
@@ -218,125 +316,125 @@ var CRMFieldTypeSchema = z2.enum([
|
|
|
218
316
|
"image",
|
|
219
317
|
"object"
|
|
220
318
|
]);
|
|
221
|
-
var CRMFieldRequirementSchema =
|
|
319
|
+
var CRMFieldRequirementSchema = z3.enum([
|
|
222
320
|
"optional",
|
|
223
321
|
"on_create",
|
|
224
322
|
"required"
|
|
225
323
|
]);
|
|
226
|
-
var CRMFieldOptionSchema =
|
|
227
|
-
label:
|
|
228
|
-
value:
|
|
229
|
-
color:
|
|
230
|
-
});
|
|
231
|
-
var CRMFieldDefinitionObjectSchema =
|
|
232
|
-
options:
|
|
233
|
-
limitChoices:
|
|
234
|
-
minLength:
|
|
235
|
-
maxLength:
|
|
236
|
-
min:
|
|
237
|
-
max:
|
|
238
|
-
pattern:
|
|
239
|
-
});
|
|
240
|
-
var CRMFieldDefinitionSchema =
|
|
241
|
-
|
|
324
|
+
var CRMFieldOptionSchema = z3.object({
|
|
325
|
+
label: z3.string(),
|
|
326
|
+
value: z3.string(),
|
|
327
|
+
color: z3.string().optional()
|
|
328
|
+
});
|
|
329
|
+
var CRMFieldDefinitionObjectSchema = z3.object({
|
|
330
|
+
options: z3.array(CRMFieldOptionSchema).optional(),
|
|
331
|
+
limitChoices: z3.number().optional(),
|
|
332
|
+
minLength: z3.number().optional(),
|
|
333
|
+
maxLength: z3.number().optional(),
|
|
334
|
+
min: z3.number().optional(),
|
|
335
|
+
max: z3.number().optional(),
|
|
336
|
+
pattern: z3.string().optional()
|
|
337
|
+
});
|
|
338
|
+
var CRMFieldDefinitionSchema = z3.union([
|
|
339
|
+
z3.string(),
|
|
242
340
|
CRMFieldDefinitionObjectSchema
|
|
243
341
|
]);
|
|
244
|
-
var CRMFieldAppearanceSchemaZ =
|
|
245
|
-
leftIcon:
|
|
246
|
-
rightIcon:
|
|
247
|
-
placeholder:
|
|
248
|
-
helpText:
|
|
249
|
-
});
|
|
250
|
-
var CRMFieldSchemaZ =
|
|
251
|
-
handle:
|
|
252
|
-
label:
|
|
342
|
+
var CRMFieldAppearanceSchemaZ = z3.object({
|
|
343
|
+
leftIcon: z3.string().optional(),
|
|
344
|
+
rightIcon: z3.string().optional(),
|
|
345
|
+
placeholder: z3.string().optional(),
|
|
346
|
+
helpText: z3.string().optional()
|
|
347
|
+
});
|
|
348
|
+
var CRMFieldSchemaZ = z3.object({
|
|
349
|
+
handle: z3.string().regex(/^[a-z][a-z0-9_]*$/, "Handle must be lowercase alphanumeric with underscores, starting with a letter"),
|
|
350
|
+
label: z3.string().min(1, "Label is required"),
|
|
253
351
|
type: CRMFieldTypeSchema,
|
|
254
352
|
/** Field description - explains what the field is for (metadata, not UI) */
|
|
255
|
-
description:
|
|
353
|
+
description: z3.string().optional(),
|
|
256
354
|
/** Field appearance - UI presentation settings */
|
|
257
355
|
appearance: CRMFieldAppearanceSchemaZ.optional(),
|
|
258
356
|
requirement: CRMFieldRequirementSchema.optional(),
|
|
259
|
-
unique:
|
|
260
|
-
list:
|
|
261
|
-
default:
|
|
357
|
+
unique: z3.boolean().optional(),
|
|
358
|
+
list: z3.boolean().optional(),
|
|
359
|
+
default: z3.unknown().optional(),
|
|
262
360
|
definition: CRMFieldDefinitionSchema.optional()
|
|
263
361
|
});
|
|
264
|
-
var CRMModelSchemaZ =
|
|
265
|
-
handle:
|
|
266
|
-
name:
|
|
267
|
-
namePlural:
|
|
268
|
-
labelTemplate:
|
|
269
|
-
description:
|
|
270
|
-
icon:
|
|
271
|
-
fields:
|
|
272
|
-
});
|
|
273
|
-
var CRMCardinalitySchema =
|
|
274
|
-
var CRMOnDeleteSchema =
|
|
275
|
-
var CRMRelationshipLinkSchema =
|
|
276
|
-
model:
|
|
277
|
-
field:
|
|
278
|
-
label:
|
|
279
|
-
});
|
|
280
|
-
var CRMRelationshipSchemaZ =
|
|
362
|
+
var CRMModelSchemaZ = z3.object({
|
|
363
|
+
handle: z3.string().regex(/^[a-z][a-z0-9_]*$/, "Handle must be lowercase alphanumeric with underscores, starting with a letter"),
|
|
364
|
+
name: z3.string().min(1, "Name is required"),
|
|
365
|
+
namePlural: z3.string().optional(),
|
|
366
|
+
labelTemplate: z3.string().optional(),
|
|
367
|
+
description: z3.string().optional(),
|
|
368
|
+
icon: z3.string().optional(),
|
|
369
|
+
fields: z3.array(CRMFieldSchemaZ)
|
|
370
|
+
});
|
|
371
|
+
var CRMCardinalitySchema = z3.enum(["one_to_one", "one_to_many"]);
|
|
372
|
+
var CRMOnDeleteSchema = z3.enum(["none", "cascade", "restrict"]);
|
|
373
|
+
var CRMRelationshipLinkSchema = z3.object({
|
|
374
|
+
model: z3.string(),
|
|
375
|
+
field: z3.string(),
|
|
376
|
+
label: z3.string()
|
|
377
|
+
});
|
|
378
|
+
var CRMRelationshipSchemaZ = z3.object({
|
|
281
379
|
source: CRMRelationshipLinkSchema,
|
|
282
380
|
target: CRMRelationshipLinkSchema,
|
|
283
381
|
cardinality: CRMCardinalitySchema,
|
|
284
382
|
onDelete: CRMOnDeleteSchema.optional()
|
|
285
383
|
});
|
|
286
|
-
var CRMBlockTypeSchema =
|
|
384
|
+
var CRMBlockTypeSchema = z3.enum([
|
|
287
385
|
"spreadsheet",
|
|
288
386
|
"form",
|
|
289
387
|
"card",
|
|
290
388
|
"metric",
|
|
291
389
|
"kanban"
|
|
292
390
|
]);
|
|
293
|
-
var CRMBlockSchemaZ =
|
|
391
|
+
var CRMBlockSchemaZ = z3.object({
|
|
294
392
|
type: CRMBlockTypeSchema,
|
|
295
|
-
title:
|
|
296
|
-
config:
|
|
297
|
-
default:
|
|
393
|
+
title: z3.string().optional(),
|
|
394
|
+
config: z3.unknown().optional(),
|
|
395
|
+
default: z3.boolean().optional()
|
|
298
396
|
});
|
|
299
|
-
var CRMPageTypeSchema =
|
|
300
|
-
var CRMPageSchemaZ =
|
|
301
|
-
path:
|
|
397
|
+
var CRMPageTypeSchema = z3.enum(["list", "instance"]);
|
|
398
|
+
var CRMPageSchemaZ = z3.object({
|
|
399
|
+
path: z3.string(),
|
|
302
400
|
type: CRMPageTypeSchema,
|
|
303
|
-
title:
|
|
304
|
-
icon:
|
|
305
|
-
modelHandle:
|
|
306
|
-
parentPath:
|
|
307
|
-
baseQuery:
|
|
308
|
-
blocks:
|
|
309
|
-
});
|
|
310
|
-
var CRMNavigationNodeBaseSchemaZ =
|
|
311
|
-
label:
|
|
312
|
-
icon:
|
|
313
|
-
path:
|
|
314
|
-
kind:
|
|
315
|
-
sortIndex:
|
|
316
|
-
});
|
|
317
|
-
var CRMNavigationItemSchemaZ =
|
|
401
|
+
title: z3.string(),
|
|
402
|
+
icon: z3.string().optional(),
|
|
403
|
+
modelHandle: z3.string(),
|
|
404
|
+
parentPath: z3.string().optional(),
|
|
405
|
+
baseQuery: z3.unknown().optional(),
|
|
406
|
+
blocks: z3.array(CRMBlockSchemaZ).optional()
|
|
407
|
+
});
|
|
408
|
+
var CRMNavigationNodeBaseSchemaZ = z3.object({
|
|
409
|
+
label: z3.string(),
|
|
410
|
+
icon: z3.string().optional(),
|
|
411
|
+
path: z3.string().optional(),
|
|
412
|
+
kind: z3.enum(["section", "group"]).optional(),
|
|
413
|
+
sortIndex: z3.number().optional()
|
|
414
|
+
});
|
|
415
|
+
var CRMNavigationItemSchemaZ = z3.lazy(
|
|
318
416
|
() => CRMNavigationNodeBaseSchemaZ.extend({
|
|
319
|
-
children:
|
|
417
|
+
children: z3.array(CRMNavigationItemSchemaZ).optional()
|
|
320
418
|
})
|
|
321
419
|
);
|
|
322
|
-
var CRMNavigationSchemaZ =
|
|
323
|
-
sidebar:
|
|
420
|
+
var CRMNavigationSchemaZ = z3.object({
|
|
421
|
+
sidebar: z3.array(CRMNavigationItemSchemaZ).optional()
|
|
324
422
|
});
|
|
325
|
-
var CRMSchemaZ =
|
|
423
|
+
var CRMSchemaZ = z3.object({
|
|
326
424
|
/** Schema format version for future compatibility */
|
|
327
|
-
$schema:
|
|
425
|
+
$schema: z3.literal("https://skedyul.com/schemas/crm/v1").optional(),
|
|
328
426
|
/** Schema name for identification */
|
|
329
|
-
name:
|
|
427
|
+
name: z3.string().min(1, "Name is required"),
|
|
330
428
|
/** Optional description */
|
|
331
|
-
description:
|
|
429
|
+
description: z3.string().optional(),
|
|
332
430
|
/** Schema version (semver) */
|
|
333
|
-
version:
|
|
431
|
+
version: z3.string().optional(),
|
|
334
432
|
/** Model definitions */
|
|
335
|
-
models:
|
|
433
|
+
models: z3.array(CRMModelSchemaZ),
|
|
336
434
|
/** Relationship definitions */
|
|
337
|
-
relationships:
|
|
435
|
+
relationships: z3.array(CRMRelationshipSchemaZ).optional(),
|
|
338
436
|
/** Page definitions */
|
|
339
|
-
pages:
|
|
437
|
+
pages: z3.array(CRMPageSchemaZ).optional(),
|
|
340
438
|
/** Navigation definitions */
|
|
341
439
|
navigation: CRMNavigationSchemaZ.optional()
|
|
342
440
|
});
|
|
@@ -363,11 +461,11 @@ function safeParseCRMSchema(data) {
|
|
|
363
461
|
}
|
|
364
462
|
|
|
365
463
|
// src/schemas/agent-schema-v3.ts
|
|
366
|
-
import { z as
|
|
464
|
+
import { z as z7 } from "zod/v4";
|
|
367
465
|
|
|
368
466
|
// src/events/types.ts
|
|
369
|
-
import { z as
|
|
370
|
-
var ThreadEventTypeSchema =
|
|
467
|
+
import { z as z4 } from "zod/v4";
|
|
468
|
+
var ThreadEventTypeSchema = z4.enum([
|
|
371
469
|
// Message events
|
|
372
470
|
"thread.message.received",
|
|
373
471
|
"thread.message.sent",
|
|
@@ -389,73 +487,73 @@ var ThreadEventTypeSchema = z3.enum([
|
|
|
389
487
|
// Signal events
|
|
390
488
|
"thread.signal.created"
|
|
391
489
|
]);
|
|
392
|
-
var CustomEventTypeSchema =
|
|
490
|
+
var CustomEventTypeSchema = z4.string().regex(/^custom\.[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$/, {
|
|
393
491
|
message: "Custom event type must match pattern: custom.{namespace}.{event}"
|
|
394
492
|
});
|
|
395
|
-
var EventTypeSchema =
|
|
396
|
-
var ParticipantKindSchema =
|
|
397
|
-
var BaseEventPayloadSchema =
|
|
398
|
-
threadId:
|
|
399
|
-
workplaceId:
|
|
400
|
-
timestamp:
|
|
493
|
+
var EventTypeSchema = z4.union([ThreadEventTypeSchema, CustomEventTypeSchema]);
|
|
494
|
+
var ParticipantKindSchema = z4.enum(["CONTACT", "MEMBER", "AGENT", "WORKFLOW"]);
|
|
495
|
+
var BaseEventPayloadSchema = z4.object({
|
|
496
|
+
threadId: z4.string(),
|
|
497
|
+
workplaceId: z4.string(),
|
|
498
|
+
timestamp: z4.string().datetime().optional()
|
|
401
499
|
});
|
|
402
500
|
var MessageEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
403
|
-
message:
|
|
404
|
-
id:
|
|
405
|
-
content:
|
|
406
|
-
senderId:
|
|
501
|
+
message: z4.object({
|
|
502
|
+
id: z4.string(),
|
|
503
|
+
content: z4.string(),
|
|
504
|
+
senderId: z4.string().optional()
|
|
407
505
|
}),
|
|
408
|
-
participant:
|
|
409
|
-
id:
|
|
506
|
+
participant: z4.object({
|
|
507
|
+
id: z4.string(),
|
|
410
508
|
kind: ParticipantKindSchema,
|
|
411
|
-
displayName:
|
|
509
|
+
displayName: z4.string().optional()
|
|
412
510
|
}).optional(),
|
|
413
|
-
isFirstMessage:
|
|
414
|
-
messageCount:
|
|
511
|
+
isFirstMessage: z4.boolean().optional(),
|
|
512
|
+
messageCount: z4.number().optional()
|
|
415
513
|
});
|
|
416
514
|
var ParticipantEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
417
|
-
participant:
|
|
418
|
-
id:
|
|
515
|
+
participant: z4.object({
|
|
516
|
+
id: z4.string(),
|
|
419
517
|
kind: ParticipantKindSchema,
|
|
420
|
-
displayName:
|
|
421
|
-
contactId:
|
|
422
|
-
memberId:
|
|
423
|
-
agentId:
|
|
424
|
-
workflowId:
|
|
518
|
+
displayName: z4.string().optional(),
|
|
519
|
+
contactId: z4.string().optional(),
|
|
520
|
+
memberId: z4.string().optional(),
|
|
521
|
+
agentId: z4.string().optional(),
|
|
522
|
+
workflowId: z4.string().optional()
|
|
425
523
|
})
|
|
426
524
|
});
|
|
427
525
|
var ContextChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
428
|
-
context:
|
|
429
|
-
handle:
|
|
430
|
-
model:
|
|
431
|
-
instanceId:
|
|
526
|
+
context: z4.object({
|
|
527
|
+
handle: z4.string(),
|
|
528
|
+
model: z4.string(),
|
|
529
|
+
instanceId: z4.string()
|
|
432
530
|
}),
|
|
433
|
-
change:
|
|
434
|
-
field:
|
|
435
|
-
oldValue:
|
|
436
|
-
newValue:
|
|
531
|
+
change: z4.object({
|
|
532
|
+
field: z4.string().optional(),
|
|
533
|
+
oldValue: z4.unknown().optional(),
|
|
534
|
+
newValue: z4.unknown().optional()
|
|
437
535
|
}).optional()
|
|
438
536
|
});
|
|
439
537
|
var StatusChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
440
|
-
oldStatus:
|
|
441
|
-
newStatus:
|
|
538
|
+
oldStatus: z4.string(),
|
|
539
|
+
newStatus: z4.string()
|
|
442
540
|
});
|
|
443
541
|
var ScheduledEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
444
|
-
scheduledEventId:
|
|
445
|
-
reason:
|
|
446
|
-
context:
|
|
542
|
+
scheduledEventId: z4.string(),
|
|
543
|
+
reason: z4.string().optional(),
|
|
544
|
+
context: z4.record(z4.string(), z4.unknown()).optional()
|
|
447
545
|
});
|
|
448
546
|
var AgentWorkflowEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
449
|
-
agentId:
|
|
450
|
-
workflowId:
|
|
451
|
-
workflowRunId:
|
|
452
|
-
outputs:
|
|
453
|
-
error:
|
|
547
|
+
agentId: z4.string().optional(),
|
|
548
|
+
workflowId: z4.string().optional(),
|
|
549
|
+
workflowRunId: z4.string().optional(),
|
|
550
|
+
outputs: z4.record(z4.string(), z4.unknown()).optional(),
|
|
551
|
+
error: z4.string().optional()
|
|
454
552
|
});
|
|
455
553
|
var CustomEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
456
|
-
data:
|
|
554
|
+
data: z4.record(z4.string(), z4.unknown()).optional()
|
|
457
555
|
});
|
|
458
|
-
var ThreadEventPayloadSchema =
|
|
556
|
+
var ThreadEventPayloadSchema = z4.union([
|
|
459
557
|
MessageEventPayloadSchema,
|
|
460
558
|
ParticipantEventPayloadSchema,
|
|
461
559
|
ContextChangedPayloadSchema,
|
|
@@ -464,164 +562,164 @@ var ThreadEventPayloadSchema = z3.union([
|
|
|
464
562
|
AgentWorkflowEventPayloadSchema,
|
|
465
563
|
CustomEventPayloadSchema
|
|
466
564
|
]);
|
|
467
|
-
var ThreadEventSchema =
|
|
468
|
-
id:
|
|
469
|
-
threadId:
|
|
565
|
+
var ThreadEventSchema = z4.object({
|
|
566
|
+
id: z4.string(),
|
|
567
|
+
threadId: z4.string(),
|
|
470
568
|
type: EventTypeSchema,
|
|
471
569
|
payload: ThreadEventPayloadSchema,
|
|
472
|
-
emittedBy:
|
|
473
|
-
createdAt:
|
|
570
|
+
emittedBy: z4.string().optional(),
|
|
571
|
+
createdAt: z4.string().datetime()
|
|
474
572
|
});
|
|
475
|
-
var CreateThreadEventInputSchema =
|
|
476
|
-
threadId:
|
|
573
|
+
var CreateThreadEventInputSchema = z4.object({
|
|
574
|
+
threadId: z4.string(),
|
|
477
575
|
type: EventTypeSchema,
|
|
478
|
-
payload:
|
|
479
|
-
emittedBy:
|
|
576
|
+
payload: z4.record(z4.string(), z4.unknown()),
|
|
577
|
+
emittedBy: z4.string().optional()
|
|
480
578
|
});
|
|
481
|
-
var EventSubscriptionSchema =
|
|
482
|
-
subscribes:
|
|
483
|
-
condition:
|
|
484
|
-
cancels:
|
|
485
|
-
cancelCondition:
|
|
579
|
+
var EventSubscriptionSchema = z4.object({
|
|
580
|
+
subscribes: z4.array(EventTypeSchema),
|
|
581
|
+
condition: z4.string().optional(),
|
|
582
|
+
cancels: z4.array(EventTypeSchema).optional(),
|
|
583
|
+
cancelCondition: z4.string().optional()
|
|
486
584
|
});
|
|
487
|
-
var EventWaitSchema =
|
|
585
|
+
var EventWaitSchema = z4.object({
|
|
488
586
|
event: EventTypeSchema,
|
|
489
|
-
timeout:
|
|
490
|
-
onTimeout:
|
|
587
|
+
timeout: z4.string().optional(),
|
|
588
|
+
onTimeout: z4.string().optional()
|
|
491
589
|
});
|
|
492
|
-
var EventsConfigSchema =
|
|
493
|
-
subscribes:
|
|
494
|
-
condition:
|
|
495
|
-
emits:
|
|
496
|
-
waits:
|
|
497
|
-
cancels:
|
|
498
|
-
cancelCondition:
|
|
590
|
+
var EventsConfigSchema = z4.object({
|
|
591
|
+
subscribes: z4.array(EventTypeSchema).optional(),
|
|
592
|
+
condition: z4.string().optional(),
|
|
593
|
+
emits: z4.array(EventTypeSchema).optional(),
|
|
594
|
+
waits: z4.array(EventWaitSchema).optional(),
|
|
595
|
+
cancels: z4.array(EventTypeSchema).optional(),
|
|
596
|
+
cancelCondition: z4.string().optional()
|
|
499
597
|
});
|
|
500
598
|
|
|
501
599
|
// src/skills/types.ts
|
|
502
|
-
import { z as
|
|
600
|
+
import { z as z5 } from "zod/v4";
|
|
503
601
|
var SKILL_SCHEMA_VERSION = "https://skedyul.com/schemas/skill/v1";
|
|
504
602
|
var SKILL_SCHEMA_VERSION_V2 = "https://skedyul.com/schemas/skill/v2";
|
|
505
|
-
var SkillSourceSchema =
|
|
506
|
-
var SkillToolRequirementSchema =
|
|
507
|
-
requires:
|
|
508
|
-
provides:
|
|
509
|
-
});
|
|
510
|
-
var SkillToolSandboxSchema =
|
|
511
|
-
mock:
|
|
512
|
-
});
|
|
513
|
-
var ToolConstraintsSchema =
|
|
514
|
-
maxCallsPerRun:
|
|
515
|
-
idempotent:
|
|
516
|
-
restricted:
|
|
517
|
-
tags:
|
|
518
|
-
});
|
|
519
|
-
var SkillToolDefinitionSchema =
|
|
520
|
-
tool:
|
|
521
|
-
description:
|
|
522
|
-
overrides:
|
|
603
|
+
var SkillSourceSchema = z5.enum(["BUILTIN", "S3", "APP", "EXTERNAL"]);
|
|
604
|
+
var SkillToolRequirementSchema = z5.object({
|
|
605
|
+
requires: z5.array(z5.string()).optional(),
|
|
606
|
+
provides: z5.array(z5.string()).optional()
|
|
607
|
+
});
|
|
608
|
+
var SkillToolSandboxSchema = z5.object({
|
|
609
|
+
mock: z5.unknown().optional()
|
|
610
|
+
});
|
|
611
|
+
var ToolConstraintsSchema = z5.object({
|
|
612
|
+
maxCallsPerRun: z5.number().optional(),
|
|
613
|
+
idempotent: z5.boolean().optional(),
|
|
614
|
+
restricted: z5.boolean().optional(),
|
|
615
|
+
tags: z5.array(z5.string()).optional()
|
|
616
|
+
});
|
|
617
|
+
var SkillToolDefinitionSchema = z5.object({
|
|
618
|
+
tool: z5.string(),
|
|
619
|
+
description: z5.string().optional(),
|
|
620
|
+
overrides: z5.record(z5.string(), z5.unknown()).optional(),
|
|
523
621
|
sandbox: SkillToolSandboxSchema.optional(),
|
|
524
|
-
requiresApproval:
|
|
622
|
+
requiresApproval: z5.boolean().optional(),
|
|
525
623
|
constraints: ToolConstraintsSchema.optional()
|
|
526
624
|
});
|
|
527
|
-
var SkillToolsSchema =
|
|
625
|
+
var SkillToolsSchema = z5.union([
|
|
528
626
|
SkillToolRequirementSchema,
|
|
529
|
-
|
|
627
|
+
z5.array(SkillToolDefinitionSchema)
|
|
530
628
|
]);
|
|
531
|
-
var SkillExampleSchema =
|
|
532
|
-
context:
|
|
533
|
-
input:
|
|
534
|
-
reasoning:
|
|
535
|
-
output:
|
|
536
|
-
tool_call:
|
|
629
|
+
var SkillExampleSchema = z5.object({
|
|
630
|
+
context: z5.string().optional(),
|
|
631
|
+
input: z5.string(),
|
|
632
|
+
reasoning: z5.string().optional(),
|
|
633
|
+
output: z5.string(),
|
|
634
|
+
tool_call: z5.string().optional()
|
|
537
635
|
});
|
|
538
|
-
var CRMModelFieldRequirementsSchema =
|
|
539
|
-
required:
|
|
540
|
-
recommended:
|
|
636
|
+
var CRMModelFieldRequirementsSchema = z5.object({
|
|
637
|
+
required: z5.array(z5.string()).optional(),
|
|
638
|
+
recommended: z5.array(z5.string()).optional()
|
|
541
639
|
});
|
|
542
|
-
var CRMContextSchema =
|
|
543
|
-
models:
|
|
640
|
+
var CRMContextSchema = z5.object({
|
|
641
|
+
models: z5.record(z5.string(), CRMModelFieldRequirementsSchema)
|
|
544
642
|
});
|
|
545
|
-
var SkillYAMLSchema =
|
|
643
|
+
var SkillYAMLSchema = z5.object({
|
|
546
644
|
// Schema version
|
|
547
|
-
$schema:
|
|
645
|
+
$schema: z5.string().optional(),
|
|
548
646
|
// Identity
|
|
549
|
-
handle:
|
|
550
|
-
name:
|
|
551
|
-
version:
|
|
552
|
-
description:
|
|
647
|
+
handle: z5.string(),
|
|
648
|
+
name: z5.string(),
|
|
649
|
+
version: z5.string().optional(),
|
|
650
|
+
description: z5.string().optional(),
|
|
553
651
|
// Instructions injected into agent system prompt
|
|
554
|
-
instructions:
|
|
652
|
+
instructions: z5.string(),
|
|
555
653
|
// Tool configuration - supports both v1 and v2 formats
|
|
556
654
|
tools: SkillToolsSchema.optional(),
|
|
557
655
|
// CRM context - specifies which models/fields to include in schema
|
|
558
656
|
crmContext: CRMContextSchema.optional(),
|
|
559
657
|
// Few-shot examples
|
|
560
|
-
examples:
|
|
561
|
-
});
|
|
562
|
-
var SkillYAMLV2Schema =
|
|
563
|
-
$schema:
|
|
564
|
-
handle:
|
|
565
|
-
name:
|
|
566
|
-
version:
|
|
567
|
-
description:
|
|
568
|
-
instructions:
|
|
569
|
-
tools:
|
|
658
|
+
examples: z5.array(SkillExampleSchema).optional()
|
|
659
|
+
});
|
|
660
|
+
var SkillYAMLV2Schema = z5.object({
|
|
661
|
+
$schema: z5.literal(SKILL_SCHEMA_VERSION_V2).optional(),
|
|
662
|
+
handle: z5.string(),
|
|
663
|
+
name: z5.string(),
|
|
664
|
+
version: z5.string().optional(),
|
|
665
|
+
description: z5.string().optional(),
|
|
666
|
+
instructions: z5.string(),
|
|
667
|
+
tools: z5.array(SkillToolDefinitionSchema).optional(),
|
|
570
668
|
crmContext: CRMContextSchema.optional(),
|
|
571
|
-
examples:
|
|
669
|
+
examples: z5.array(SkillExampleSchema).optional()
|
|
572
670
|
});
|
|
573
|
-
var SkillVersionWeightSchema =
|
|
574
|
-
version:
|
|
575
|
-
weight:
|
|
671
|
+
var SkillVersionWeightSchema = z5.object({
|
|
672
|
+
version: z5.number(),
|
|
673
|
+
weight: z5.number()
|
|
576
674
|
});
|
|
577
|
-
var SkillRefSchema =
|
|
578
|
-
|
|
675
|
+
var SkillRefSchema = z5.union([
|
|
676
|
+
z5.string(),
|
|
579
677
|
// Just handle - uses latest published version
|
|
580
|
-
|
|
581
|
-
skill:
|
|
582
|
-
description:
|
|
678
|
+
z5.object({
|
|
679
|
+
skill: z5.string(),
|
|
680
|
+
description: z5.string().optional(),
|
|
583
681
|
// For AI SDK Agent Skills discovery
|
|
584
682
|
/** Auto-inject this skill's instructions and tools on every agent turn */
|
|
585
|
-
alwaysLoad:
|
|
683
|
+
alwaysLoad: z5.boolean().optional(),
|
|
586
684
|
// Version selection (pick one):
|
|
587
|
-
version:
|
|
685
|
+
version: z5.number().optional(),
|
|
588
686
|
// Pin to specific version number
|
|
589
|
-
versions:
|
|
687
|
+
versions: z5.array(SkillVersionWeightSchema).optional(),
|
|
590
688
|
// A/B testing weights
|
|
591
689
|
// Legacy support:
|
|
592
|
-
instructions:
|
|
690
|
+
instructions: z5.string().optional(),
|
|
593
691
|
// Inline instructions (deprecated)
|
|
594
|
-
enabled:
|
|
692
|
+
enabled: z5.boolean().optional()
|
|
595
693
|
})
|
|
596
694
|
]);
|
|
597
|
-
var SkillMetadataSchema =
|
|
598
|
-
id:
|
|
599
|
-
handle:
|
|
600
|
-
name:
|
|
601
|
-
version:
|
|
602
|
-
description:
|
|
695
|
+
var SkillMetadataSchema = z5.object({
|
|
696
|
+
id: z5.string(),
|
|
697
|
+
handle: z5.string(),
|
|
698
|
+
name: z5.string(),
|
|
699
|
+
version: z5.string().optional(),
|
|
700
|
+
description: z5.string().optional(),
|
|
603
701
|
source: SkillSourceSchema,
|
|
604
|
-
s3Key:
|
|
605
|
-
appVersionId:
|
|
606
|
-
workplaceId:
|
|
607
|
-
createdAt:
|
|
608
|
-
updatedAt:
|
|
609
|
-
});
|
|
610
|
-
var ResolvedSkillSchema =
|
|
611
|
-
handle:
|
|
612
|
-
name:
|
|
613
|
-
instructions:
|
|
614
|
-
description:
|
|
615
|
-
tools:
|
|
616
|
-
examples:
|
|
617
|
-
});
|
|
618
|
-
var LoadedSkillSchema =
|
|
619
|
-
handle:
|
|
620
|
-
name:
|
|
621
|
-
instructions:
|
|
622
|
-
description:
|
|
623
|
-
tools:
|
|
624
|
-
examples:
|
|
702
|
+
s3Key: z5.string().optional(),
|
|
703
|
+
appVersionId: z5.string().optional(),
|
|
704
|
+
workplaceId: z5.string().optional(),
|
|
705
|
+
createdAt: z5.string().datetime().optional(),
|
|
706
|
+
updatedAt: z5.string().datetime().optional()
|
|
707
|
+
});
|
|
708
|
+
var ResolvedSkillSchema = z5.object({
|
|
709
|
+
handle: z5.string(),
|
|
710
|
+
name: z5.string(),
|
|
711
|
+
instructions: z5.string().optional(),
|
|
712
|
+
description: z5.string().optional(),
|
|
713
|
+
tools: z5.array(z5.string()).optional(),
|
|
714
|
+
examples: z5.array(SkillExampleSchema).optional()
|
|
715
|
+
});
|
|
716
|
+
var LoadedSkillSchema = z5.object({
|
|
717
|
+
handle: z5.string(),
|
|
718
|
+
name: z5.string(),
|
|
719
|
+
instructions: z5.string().optional(),
|
|
720
|
+
description: z5.string().optional(),
|
|
721
|
+
tools: z5.array(SkillToolDefinitionSchema).optional(),
|
|
722
|
+
examples: z5.array(SkillExampleSchema).optional()
|
|
625
723
|
});
|
|
626
724
|
function isV2SkillTools(tools) {
|
|
627
725
|
if (!tools) return false;
|
|
@@ -677,182 +775,182 @@ ${sections.join("\n\n---\n\n")}`;
|
|
|
677
775
|
}
|
|
678
776
|
|
|
679
777
|
// src/context/types.ts
|
|
680
|
-
import { z as
|
|
681
|
-
var CRMContextSchema2 =
|
|
682
|
-
model:
|
|
683
|
-
instanceId:
|
|
684
|
-
data:
|
|
778
|
+
import { z as z6 } from "zod/v4";
|
|
779
|
+
var CRMContextSchema2 = z6.object({
|
|
780
|
+
model: z6.string(),
|
|
781
|
+
instanceId: z6.string(),
|
|
782
|
+
data: z6.record(z6.string(), z6.unknown())
|
|
685
783
|
});
|
|
686
|
-
var SenderContextSchema =
|
|
784
|
+
var SenderContextSchema = z6.object({
|
|
687
785
|
kind: ParticipantKindSchema,
|
|
688
|
-
displayName:
|
|
689
|
-
email:
|
|
690
|
-
role:
|
|
691
|
-
permissions:
|
|
786
|
+
displayName: z6.string().optional(),
|
|
787
|
+
email: z6.string().optional(),
|
|
788
|
+
role: z6.string().optional(),
|
|
789
|
+
permissions: z6.array(z6.string()).optional(),
|
|
692
790
|
crm: CRMContextSchema2.optional()
|
|
693
791
|
});
|
|
694
|
-
var ThreadContextItemSchema =
|
|
695
|
-
handle:
|
|
696
|
-
model:
|
|
697
|
-
instanceId:
|
|
698
|
-
data:
|
|
699
|
-
});
|
|
700
|
-
var ThreadInfoSchema =
|
|
701
|
-
id:
|
|
702
|
-
title:
|
|
703
|
-
status:
|
|
704
|
-
kind:
|
|
705
|
-
});
|
|
706
|
-
var SubscriptionSchema =
|
|
707
|
-
identifierValue:
|
|
708
|
-
channelHandle:
|
|
709
|
-
});
|
|
710
|
-
var AssociationSchema =
|
|
711
|
-
id:
|
|
712
|
-
data:
|
|
713
|
-
});
|
|
714
|
-
var ContactSchema =
|
|
715
|
-
id:
|
|
716
|
-
name:
|
|
792
|
+
var ThreadContextItemSchema = z6.object({
|
|
793
|
+
handle: z6.string(),
|
|
794
|
+
model: z6.string(),
|
|
795
|
+
instanceId: z6.string(),
|
|
796
|
+
data: z6.record(z6.string(), z6.unknown()).optional()
|
|
797
|
+
});
|
|
798
|
+
var ThreadInfoSchema = z6.object({
|
|
799
|
+
id: z6.string(),
|
|
800
|
+
title: z6.string().optional(),
|
|
801
|
+
status: z6.string().optional(),
|
|
802
|
+
kind: z6.string().optional()
|
|
803
|
+
});
|
|
804
|
+
var SubscriptionSchema = z6.object({
|
|
805
|
+
identifierValue: z6.string(),
|
|
806
|
+
channelHandle: z6.string().optional()
|
|
807
|
+
});
|
|
808
|
+
var AssociationSchema = z6.object({
|
|
809
|
+
id: z6.string().optional(),
|
|
810
|
+
data: z6.record(z6.string(), z6.unknown())
|
|
811
|
+
});
|
|
812
|
+
var ContactSchema = z6.object({
|
|
813
|
+
id: z6.string().optional(),
|
|
814
|
+
name: z6.string().optional(),
|
|
717
815
|
subscription: SubscriptionSchema.optional(),
|
|
718
|
-
associations:
|
|
816
|
+
associations: z6.record(z6.string(), AssociationSchema).optional()
|
|
719
817
|
});
|
|
720
|
-
var AgentSenderContextSchema =
|
|
721
|
-
kind:
|
|
722
|
-
displayName:
|
|
723
|
-
role:
|
|
724
|
-
permissions:
|
|
818
|
+
var AgentSenderContextSchema = z6.object({
|
|
819
|
+
kind: z6.enum(["contact", "member"]),
|
|
820
|
+
displayName: z6.string().optional(),
|
|
821
|
+
role: z6.string().optional(),
|
|
822
|
+
permissions: z6.array(z6.string()).optional(),
|
|
725
823
|
contact: ContactSchema.optional()
|
|
726
824
|
});
|
|
727
|
-
var AgentThreadContextSchema =
|
|
728
|
-
handle:
|
|
729
|
-
model:
|
|
730
|
-
data:
|
|
825
|
+
var AgentThreadContextSchema = z6.object({
|
|
826
|
+
handle: z6.string(),
|
|
827
|
+
model: z6.string(),
|
|
828
|
+
data: z6.record(z6.string(), z6.unknown())
|
|
731
829
|
});
|
|
732
|
-
var AgentContextSchema =
|
|
830
|
+
var AgentContextSchema = z6.object({
|
|
733
831
|
sender: AgentSenderContextSchema,
|
|
734
|
-
contexts:
|
|
832
|
+
contexts: z6.array(AgentThreadContextSchema).optional()
|
|
735
833
|
});
|
|
736
|
-
var ContextIssueSeveritySchema =
|
|
737
|
-
var ContextIssueTypeSchema =
|
|
834
|
+
var ContextIssueSeveritySchema = z6.enum(["ERROR", "WARNING"]);
|
|
835
|
+
var ContextIssueTypeSchema = z6.enum([
|
|
738
836
|
"MISSING_ROUTING_PARTICIPANT",
|
|
739
837
|
"MISSING_ASSOCIATION",
|
|
740
838
|
"MISSING_REQUIRED_FIELD",
|
|
741
839
|
"MISSING_RECOMMENDED_FIELD"
|
|
742
840
|
]);
|
|
743
|
-
var ContextIssueSchema =
|
|
841
|
+
var ContextIssueSchema = z6.object({
|
|
744
842
|
type: ContextIssueTypeSchema,
|
|
745
843
|
severity: ContextIssueSeveritySchema,
|
|
746
|
-
model:
|
|
747
|
-
field:
|
|
748
|
-
message:
|
|
749
|
-
suggestion:
|
|
844
|
+
model: z6.string().optional(),
|
|
845
|
+
field: z6.string().optional(),
|
|
846
|
+
message: z6.string(),
|
|
847
|
+
suggestion: z6.string().optional()
|
|
750
848
|
});
|
|
751
|
-
var ContextValidationResultSchema =
|
|
752
|
-
valid:
|
|
753
|
-
degraded:
|
|
754
|
-
issues:
|
|
849
|
+
var ContextValidationResultSchema = z6.object({
|
|
850
|
+
valid: z6.boolean(),
|
|
851
|
+
degraded: z6.boolean(),
|
|
852
|
+
issues: z6.array(ContextIssueSchema)
|
|
755
853
|
});
|
|
756
854
|
var MockSenderContextSchema = AgentSenderContextSchema;
|
|
757
855
|
var MockThreadContextSchema = AgentThreadContextSchema;
|
|
758
856
|
var MockContextSchema = AgentContextSchema;
|
|
759
|
-
var SandboxConfigSchema =
|
|
760
|
-
enabled:
|
|
857
|
+
var SandboxConfigSchema = z6.object({
|
|
858
|
+
enabled: z6.boolean().optional(),
|
|
761
859
|
/** @deprecated Use 'context' instead of 'mockContext' */
|
|
762
860
|
mockContext: AgentContextSchema.optional(),
|
|
763
861
|
context: AgentContextSchema.optional()
|
|
764
862
|
});
|
|
765
863
|
|
|
766
864
|
// src/schemas/agent-schema-v3.ts
|
|
767
|
-
var PersonaVoiceFormatV3Schema =
|
|
768
|
-
maxChars:
|
|
769
|
-
noEmojis:
|
|
770
|
-
noHyphens:
|
|
771
|
-
noBulletPoints:
|
|
772
|
-
maxQuestionsPerMessage:
|
|
773
|
-
noSignOffs:
|
|
774
|
-
});
|
|
775
|
-
var PersonaVoiceV3Schema =
|
|
776
|
-
style:
|
|
865
|
+
var PersonaVoiceFormatV3Schema = z7.object({
|
|
866
|
+
maxChars: z7.number().optional(),
|
|
867
|
+
noEmojis: z7.boolean().optional(),
|
|
868
|
+
noHyphens: z7.boolean().optional(),
|
|
869
|
+
noBulletPoints: z7.boolean().optional(),
|
|
870
|
+
maxQuestionsPerMessage: z7.number().optional(),
|
|
871
|
+
noSignOffs: z7.boolean().optional()
|
|
872
|
+
});
|
|
873
|
+
var PersonaVoiceV3Schema = z7.object({
|
|
874
|
+
style: z7.string(),
|
|
777
875
|
format: PersonaVoiceFormatV3Schema.optional()
|
|
778
876
|
});
|
|
779
|
-
var PersonaV3Schema =
|
|
780
|
-
name:
|
|
877
|
+
var PersonaV3Schema = z7.object({
|
|
878
|
+
name: z7.string(),
|
|
781
879
|
voice: PersonaVoiceV3Schema
|
|
782
880
|
});
|
|
783
|
-
var ToolApprovalConfigSchema =
|
|
784
|
-
required:
|
|
785
|
-
requiredIf:
|
|
881
|
+
var ToolApprovalConfigSchema = z7.object({
|
|
882
|
+
required: z7.boolean().optional(),
|
|
883
|
+
requiredIf: z7.array(z7.string()).optional()
|
|
786
884
|
});
|
|
787
|
-
var ToolSandboxConfigSchema =
|
|
788
|
-
mock:
|
|
885
|
+
var ToolSandboxConfigSchema = z7.object({
|
|
886
|
+
mock: z7.unknown().optional()
|
|
789
887
|
});
|
|
790
|
-
var ToolRefV3Schema =
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
tool:
|
|
794
|
-
description:
|
|
888
|
+
var ToolRefV3Schema = z7.union([
|
|
889
|
+
z7.string(),
|
|
890
|
+
z7.object({
|
|
891
|
+
tool: z7.string(),
|
|
892
|
+
description: z7.string().optional(),
|
|
795
893
|
approval: ToolApprovalConfigSchema.optional(),
|
|
796
894
|
sandbox: ToolSandboxConfigSchema.optional(),
|
|
797
|
-
overrides:
|
|
895
|
+
overrides: z7.record(z7.string(), z7.unknown()).optional()
|
|
798
896
|
})
|
|
799
897
|
]);
|
|
800
|
-
var AgentToolRefSchema =
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
tool:
|
|
804
|
-
description:
|
|
898
|
+
var AgentToolRefSchema = z7.union([
|
|
899
|
+
z7.string(),
|
|
900
|
+
z7.object({
|
|
901
|
+
tool: z7.string(),
|
|
902
|
+
description: z7.string().optional()
|
|
805
903
|
})
|
|
806
904
|
]);
|
|
807
|
-
var WorkingMemoryConfigSchema =
|
|
808
|
-
strategy:
|
|
809
|
-
maxTokens:
|
|
810
|
-
summarizeAt:
|
|
905
|
+
var WorkingMemoryConfigSchema = z7.object({
|
|
906
|
+
strategy: z7.enum(["full", "rolling_summary", "sliding_window"]).optional(),
|
|
907
|
+
maxTokens: z7.number().optional(),
|
|
908
|
+
summarizeAt: z7.number().optional()
|
|
811
909
|
});
|
|
812
|
-
var ExternalMemoryConfigSchema =
|
|
813
|
-
enabled:
|
|
814
|
-
ttl:
|
|
910
|
+
var ExternalMemoryConfigSchema = z7.object({
|
|
911
|
+
enabled: z7.boolean().optional(),
|
|
912
|
+
ttl: z7.string().optional()
|
|
815
913
|
});
|
|
816
|
-
var SemanticMemoryConfigSchema =
|
|
817
|
-
enabled:
|
|
818
|
-
topK:
|
|
819
|
-
scope:
|
|
914
|
+
var SemanticMemoryConfigSchema = z7.object({
|
|
915
|
+
enabled: z7.boolean().optional(),
|
|
916
|
+
topK: z7.number().optional(),
|
|
917
|
+
scope: z7.enum(["thread", "instance", "workspace"]).optional()
|
|
820
918
|
});
|
|
821
|
-
var MemoryConfigV3Schema =
|
|
919
|
+
var MemoryConfigV3Schema = z7.object({
|
|
822
920
|
working: WorkingMemoryConfigSchema.optional(),
|
|
823
|
-
persistent:
|
|
824
|
-
namespace:
|
|
921
|
+
persistent: z7.object({
|
|
922
|
+
namespace: z7.string().optional()
|
|
825
923
|
}).optional(),
|
|
826
924
|
external: ExternalMemoryConfigSchema.optional(),
|
|
827
925
|
semantic: SemanticMemoryConfigSchema.optional()
|
|
828
926
|
});
|
|
829
|
-
var RequiresApprovalPolicySchema =
|
|
830
|
-
requiresApproval:
|
|
927
|
+
var RequiresApprovalPolicySchema = z7.object({
|
|
928
|
+
requiresApproval: z7.boolean().optional()
|
|
831
929
|
});
|
|
832
|
-
var PoliciesConfigV3Schema =
|
|
833
|
-
messages:
|
|
930
|
+
var PoliciesConfigV3Schema = z7.object({
|
|
931
|
+
messages: z7.object({
|
|
834
932
|
send: RequiresApprovalPolicySchema.optional(),
|
|
835
933
|
schedule: RequiresApprovalPolicySchema.optional()
|
|
836
934
|
}).optional(),
|
|
837
|
-
tools:
|
|
838
|
-
externalRequiresApproval:
|
|
839
|
-
systemRequiresApproval:
|
|
935
|
+
tools: z7.object({
|
|
936
|
+
externalRequiresApproval: z7.boolean().optional(),
|
|
937
|
+
systemRequiresApproval: z7.boolean().optional()
|
|
840
938
|
}).optional()
|
|
841
939
|
});
|
|
842
|
-
var RuntimeConfigV3Schema =
|
|
940
|
+
var RuntimeConfigV3Schema = z7.object({
|
|
843
941
|
/** LLM model identifier for reasoning (e.g., "google/gemini-3.1-flash-lite") */
|
|
844
|
-
model:
|
|
942
|
+
model: z7.string().optional(),
|
|
845
943
|
/** LLM model for persona transformation (e.g., "openai/gpt-5-nano") */
|
|
846
|
-
personaModel:
|
|
944
|
+
personaModel: z7.string().optional()
|
|
847
945
|
});
|
|
848
|
-
var TimeWindowTimeStampSchema =
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
hour:
|
|
852
|
-
minute:
|
|
946
|
+
var TimeWindowTimeStampSchema = z7.union([
|
|
947
|
+
z7.number().describe("Hour of day (0-23)"),
|
|
948
|
+
z7.object({
|
|
949
|
+
hour: z7.number(),
|
|
950
|
+
minute: z7.number().optional().default(0)
|
|
853
951
|
})
|
|
854
952
|
]);
|
|
855
|
-
var TimeWindowDayOfWeekSchema =
|
|
953
|
+
var TimeWindowDayOfWeekSchema = z7.enum([
|
|
856
954
|
"monday",
|
|
857
955
|
"tuesday",
|
|
858
956
|
"wednesday",
|
|
@@ -861,47 +959,47 @@ var TimeWindowDayOfWeekSchema = z6.enum([
|
|
|
861
959
|
"saturday",
|
|
862
960
|
"sunday"
|
|
863
961
|
]);
|
|
864
|
-
var TimeWindowSlotAgentSchema =
|
|
962
|
+
var TimeWindowSlotAgentSchema = z7.object({
|
|
865
963
|
startTime: TimeWindowTimeStampSchema,
|
|
866
964
|
endTime: TimeWindowTimeStampSchema,
|
|
867
|
-
days:
|
|
965
|
+
days: z7.array(TimeWindowDayOfWeekSchema)
|
|
868
966
|
});
|
|
869
|
-
var ResponseModeSchema =
|
|
967
|
+
var ResponseModeSchema = z7.enum([
|
|
870
968
|
"immediate",
|
|
871
969
|
"ack_and_schedule",
|
|
872
970
|
"schedule_only"
|
|
873
971
|
]);
|
|
874
|
-
var TimeWindowBehaviorSchema =
|
|
972
|
+
var TimeWindowBehaviorSchema = z7.object({
|
|
875
973
|
/** How to handle responses in this window */
|
|
876
974
|
responseMode: ResponseModeSchema,
|
|
877
975
|
/** Prompt injection for this time context */
|
|
878
|
-
prompt:
|
|
976
|
+
prompt: z7.string().optional().describe("Prompt injection for this time context"),
|
|
879
977
|
/** Window to schedule responses for (when responseMode is ack_and_schedule or schedule_only) */
|
|
880
|
-
scheduleFor:
|
|
978
|
+
scheduleFor: z7.string().optional().describe("Window name to schedule responses for")
|
|
881
979
|
});
|
|
882
|
-
var TimeWindowPolicySchema =
|
|
980
|
+
var TimeWindowPolicySchema = z7.object({
|
|
883
981
|
/** IANA timezone for the window (e.g., "Australia/Sydney") */
|
|
884
|
-
timezone:
|
|
982
|
+
timezone: z7.string().describe('IANA timezone, e.g., "Australia/Sydney"'),
|
|
885
983
|
/** Time slots when this window is active */
|
|
886
|
-
windows:
|
|
984
|
+
windows: z7.array(TimeWindowSlotAgentSchema),
|
|
887
985
|
/** Behavior for this window (optional - defaults to immediate response) */
|
|
888
986
|
behavior: TimeWindowBehaviorSchema.optional()
|
|
889
987
|
});
|
|
890
|
-
var TimeWindowPoliciesSchema =
|
|
988
|
+
var TimeWindowPoliciesSchema = z7.record(z7.string(), TimeWindowPolicySchema);
|
|
891
989
|
var TimeWindowDefaultSchema = TimeWindowBehaviorSchema.describe(
|
|
892
990
|
"Fallback behavior when no time window matches"
|
|
893
991
|
);
|
|
894
|
-
var ResponsesBehaviorConfigSchema =
|
|
992
|
+
var ResponsesBehaviorConfigSchema = z7.object({
|
|
895
993
|
/**
|
|
896
994
|
* Maximum immediate messages per agent run (acks, progress updates).
|
|
897
995
|
* @default 1
|
|
898
996
|
*/
|
|
899
|
-
maxImmediate:
|
|
997
|
+
maxImmediate: z7.number().optional(),
|
|
900
998
|
/**
|
|
901
999
|
* Maximum scheduled messages per agent run (follow-ups via sendAt).
|
|
902
1000
|
* @default 2
|
|
903
1001
|
*/
|
|
904
|
-
maxScheduled:
|
|
1002
|
+
maxScheduled: z7.number().optional(),
|
|
905
1003
|
/**
|
|
906
1004
|
* Maximum intermediate messages per agent run.
|
|
907
1005
|
* Intermediate = progress updates, acknowledgments before task completion.
|
|
@@ -909,74 +1007,74 @@ var ResponsesBehaviorConfigSchema = z6.object({
|
|
|
909
1007
|
* @deprecated Use maxImmediate instead
|
|
910
1008
|
* @default 2
|
|
911
1009
|
*/
|
|
912
|
-
maxIntermediate:
|
|
1010
|
+
maxIntermediate: z7.number().optional(),
|
|
913
1011
|
/**
|
|
914
1012
|
* Whether a final message is required before the run completes.
|
|
915
1013
|
* If true and no final message is sent, the run fails.
|
|
916
1014
|
* @default true
|
|
917
1015
|
*/
|
|
918
|
-
requireFinal:
|
|
1016
|
+
requireFinal: z7.boolean().optional(),
|
|
919
1017
|
/**
|
|
920
1018
|
* Whether the agent can schedule messages for future delivery.
|
|
921
1019
|
* Scheduled messages typically require approval.
|
|
922
1020
|
* @default false
|
|
923
1021
|
*/
|
|
924
|
-
allowSchedule:
|
|
1022
|
+
allowSchedule: z7.boolean().optional(),
|
|
925
1023
|
/**
|
|
926
1024
|
* Message splitting configuration.
|
|
927
1025
|
* Controls whether and how the agent splits responses into multiple messages.
|
|
928
1026
|
*/
|
|
929
|
-
messageSplitting:
|
|
1027
|
+
messageSplitting: z7.object({
|
|
930
1028
|
/**
|
|
931
1029
|
* Whether to allow natural message splitting.
|
|
932
1030
|
* When true, the agent may split responses into multiple messages
|
|
933
1031
|
* when it improves conversational flow.
|
|
934
1032
|
*/
|
|
935
|
-
enabled:
|
|
1033
|
+
enabled: z7.boolean(),
|
|
936
1034
|
/**
|
|
937
1035
|
* Custom prompt to override the default message splitting guidance.
|
|
938
1036
|
* If not provided, uses sensible defaults for when to split vs. keep together.
|
|
939
1037
|
*/
|
|
940
|
-
prompt:
|
|
1038
|
+
prompt: z7.string().optional()
|
|
941
1039
|
}).optional()
|
|
942
1040
|
});
|
|
943
|
-
var SchedulingDelaySchema =
|
|
1041
|
+
var SchedulingDelaySchema = z7.object({
|
|
944
1042
|
/** Time unit amount */
|
|
945
|
-
amount:
|
|
1043
|
+
amount: z7.number(),
|
|
946
1044
|
/** Time unit (e.g., "week", "weeks", "day", "days", "month", "months") */
|
|
947
|
-
unit:
|
|
1045
|
+
unit: z7.string(),
|
|
948
1046
|
/** Optional time window to constrain the delay */
|
|
949
|
-
timeWindow:
|
|
1047
|
+
timeWindow: z7.string().optional()
|
|
950
1048
|
});
|
|
951
|
-
var SchedulingPatternSchema =
|
|
1049
|
+
var SchedulingPatternSchema = z7.object({
|
|
952
1050
|
/** Trigger name for this pattern */
|
|
953
|
-
trigger:
|
|
1051
|
+
trigger: z7.string(),
|
|
954
1052
|
/** Human-readable description of when this pattern applies */
|
|
955
|
-
description:
|
|
1053
|
+
description: z7.string().optional(),
|
|
956
1054
|
/** Example user phrases that match this pattern */
|
|
957
|
-
examples:
|
|
1055
|
+
examples: z7.array(z7.string()).optional(),
|
|
958
1056
|
/** Default delay for this pattern */
|
|
959
1057
|
defaultDelay: SchedulingDelaySchema.optional()
|
|
960
1058
|
});
|
|
961
|
-
var SchedulingBehaviorConfigSchema =
|
|
1059
|
+
var SchedulingBehaviorConfigSchema = z7.object({
|
|
962
1060
|
/**
|
|
963
1061
|
* Patterns that trigger scheduling suggestions.
|
|
964
1062
|
* The agent uses these to know when to add sendAt to messages.
|
|
965
1063
|
*/
|
|
966
|
-
patterns:
|
|
1064
|
+
patterns: z7.array(SchedulingPatternSchema).optional(),
|
|
967
1065
|
/**
|
|
968
1066
|
* Default settings for scheduled messages.
|
|
969
1067
|
*/
|
|
970
|
-
defaults:
|
|
1068
|
+
defaults: z7.object({
|
|
971
1069
|
/** Cancel scheduled message if user replies before send time (default: true) */
|
|
972
|
-
cancelOnActivity:
|
|
1070
|
+
cancelOnActivity: z7.boolean().optional(),
|
|
973
1071
|
/** Whether scheduled messages require approval (default: true) */
|
|
974
|
-
requiresApproval:
|
|
1072
|
+
requiresApproval: z7.boolean().optional(),
|
|
975
1073
|
/** Default time window policy to constrain all scheduled messages */
|
|
976
|
-
timeWindow:
|
|
1074
|
+
timeWindow: z7.string().optional().describe("Time window policy name for scheduled messages")
|
|
977
1075
|
}).optional()
|
|
978
1076
|
});
|
|
979
|
-
var BehaviorConfigV3Schema =
|
|
1077
|
+
var BehaviorConfigV3Schema = z7.object({
|
|
980
1078
|
/**
|
|
981
1079
|
* Response behavior - controls message sending via tool calls.
|
|
982
1080
|
* When configured, agents must explicitly call system:message:send
|
|
@@ -989,32 +1087,32 @@ var BehaviorConfigV3Schema = z6.object({
|
|
|
989
1087
|
*/
|
|
990
1088
|
scheduling: SchedulingBehaviorConfigSchema.optional()
|
|
991
1089
|
});
|
|
992
|
-
var PromptsConfigV3Schema =
|
|
1090
|
+
var PromptsConfigV3Schema = z7.object({
|
|
993
1091
|
/** Main system prompt with workflow instructions */
|
|
994
|
-
system:
|
|
1092
|
+
system: z7.string().optional(),
|
|
995
1093
|
/** Injected during second pass when skills were loaded but tools not used */
|
|
996
|
-
recovery:
|
|
1094
|
+
recovery: z7.string().optional(),
|
|
997
1095
|
/** Injected during follow-up passes when context needs updating */
|
|
998
|
-
followUp:
|
|
1096
|
+
followUp: z7.string().optional(),
|
|
999
1097
|
/** Thread list title generation (system + user template with {{var}} placeholders) */
|
|
1000
|
-
titleEnrichment:
|
|
1001
|
-
system:
|
|
1002
|
-
user:
|
|
1098
|
+
titleEnrichment: z7.object({
|
|
1099
|
+
system: z7.string().optional(),
|
|
1100
|
+
user: z7.string().optional()
|
|
1003
1101
|
}).optional()
|
|
1004
1102
|
});
|
|
1005
|
-
var AgentYAMLV3Schema =
|
|
1006
|
-
$schema:
|
|
1007
|
-
handle:
|
|
1008
|
-
name:
|
|
1009
|
-
version:
|
|
1010
|
-
description:
|
|
1103
|
+
var AgentYAMLV3Schema = z7.object({
|
|
1104
|
+
$schema: z7.string().optional(),
|
|
1105
|
+
handle: z7.string(),
|
|
1106
|
+
name: z7.string(),
|
|
1107
|
+
version: z7.string().optional(),
|
|
1108
|
+
description: z7.string().optional(),
|
|
1011
1109
|
// Persona - Who the agent is
|
|
1012
1110
|
persona: PersonaV3Schema.optional(),
|
|
1013
1111
|
// Skills - What the agent knows how to do (skills own their tools)
|
|
1014
|
-
skills:
|
|
1112
|
+
skills: z7.array(SkillRefSchema).optional(),
|
|
1015
1113
|
// Tools - Always-available tools before any skill loads
|
|
1016
1114
|
// Examples: system:settings:business_information:get
|
|
1017
|
-
tools:
|
|
1115
|
+
tools: z7.array(AgentToolRefSchema).optional(),
|
|
1018
1116
|
/**
|
|
1019
1117
|
* Events - When the agent activates
|
|
1020
1118
|
* @deprecated Not yet implemented - this is a planned feature for event-driven agents.
|
|
@@ -1047,21 +1145,21 @@ var AgentYAMLV3Schema = z6.object({
|
|
|
1047
1145
|
});
|
|
1048
1146
|
|
|
1049
1147
|
// src/schemas.ts
|
|
1050
|
-
var EnvVisibilitySchema =
|
|
1051
|
-
var EnvVariableDefinitionSchema =
|
|
1052
|
-
label:
|
|
1053
|
-
required:
|
|
1148
|
+
var EnvVisibilitySchema = z8.enum(["visible", "encrypted"]);
|
|
1149
|
+
var EnvVariableDefinitionSchema = z8.object({
|
|
1150
|
+
label: z8.string(),
|
|
1151
|
+
required: z8.boolean().optional(),
|
|
1054
1152
|
visibility: EnvVisibilitySchema.optional(),
|
|
1055
|
-
default:
|
|
1056
|
-
description:
|
|
1057
|
-
placeholder:
|
|
1058
|
-
});
|
|
1059
|
-
var EnvSchemaSchema =
|
|
1060
|
-
var ComputeLayerTypeSchema =
|
|
1061
|
-
var FieldOwnerSchema =
|
|
1062
|
-
var PrimitiveSchema =
|
|
1063
|
-
var PrimitiveOrArraySchema =
|
|
1064
|
-
var FilterOperatorSchema =
|
|
1153
|
+
default: z8.string().optional(),
|
|
1154
|
+
description: z8.string().optional(),
|
|
1155
|
+
placeholder: z8.string().optional()
|
|
1156
|
+
});
|
|
1157
|
+
var EnvSchemaSchema = z8.record(z8.string(), EnvVariableDefinitionSchema);
|
|
1158
|
+
var ComputeLayerTypeSchema = z8.enum(["serverless", "dedicated"]);
|
|
1159
|
+
var FieldOwnerSchema = z8.enum(["APP", "SHARED"]);
|
|
1160
|
+
var PrimitiveSchema = z8.union([z8.string(), z8.number(), z8.boolean()]);
|
|
1161
|
+
var PrimitiveOrArraySchema = z8.union([PrimitiveSchema, z8.array(PrimitiveSchema)]);
|
|
1162
|
+
var FilterOperatorSchema = z8.enum([
|
|
1065
1163
|
"eq",
|
|
1066
1164
|
"neq",
|
|
1067
1165
|
"gt",
|
|
@@ -1079,7 +1177,7 @@ var FilterOperatorSchema = z7.enum([
|
|
|
1079
1177
|
"isEmpty",
|
|
1080
1178
|
"isNotEmpty"
|
|
1081
1179
|
]);
|
|
1082
|
-
var FilterConditionSchema =
|
|
1180
|
+
var FilterConditionSchema = z8.object({
|
|
1083
1181
|
eq: PrimitiveOrArraySchema,
|
|
1084
1182
|
neq: PrimitiveOrArraySchema,
|
|
1085
1183
|
gt: PrimitiveOrArraySchema,
|
|
@@ -1097,27 +1195,27 @@ var FilterConditionSchema = z7.object({
|
|
|
1097
1195
|
isEmpty: PrimitiveOrArraySchema,
|
|
1098
1196
|
isNotEmpty: PrimitiveOrArraySchema
|
|
1099
1197
|
}).partial();
|
|
1100
|
-
var StructuredFilterSchema =
|
|
1101
|
-
|
|
1198
|
+
var StructuredFilterSchema = z8.record(
|
|
1199
|
+
z8.string(),
|
|
1102
1200
|
FilterConditionSchema
|
|
1103
1201
|
);
|
|
1104
|
-
var ModelDependencySchema =
|
|
1105
|
-
model:
|
|
1106
|
-
fields:
|
|
1202
|
+
var ModelDependencySchema = z8.object({
|
|
1203
|
+
model: z8.string(),
|
|
1204
|
+
fields: z8.array(z8.string()).optional(),
|
|
1107
1205
|
where: StructuredFilterSchema.optional()
|
|
1108
1206
|
});
|
|
1109
|
-
var ChannelDependencySchema =
|
|
1110
|
-
channel:
|
|
1207
|
+
var ChannelDependencySchema = z8.object({
|
|
1208
|
+
channel: z8.string()
|
|
1111
1209
|
});
|
|
1112
|
-
var WorkflowDependencySchema =
|
|
1113
|
-
workflow:
|
|
1210
|
+
var WorkflowDependencySchema = z8.object({
|
|
1211
|
+
workflow: z8.string()
|
|
1114
1212
|
});
|
|
1115
|
-
var ResourceDependencySchema =
|
|
1213
|
+
var ResourceDependencySchema = z8.union([
|
|
1116
1214
|
ModelDependencySchema,
|
|
1117
1215
|
ChannelDependencySchema,
|
|
1118
1216
|
WorkflowDependencySchema
|
|
1119
1217
|
]);
|
|
1120
|
-
var FieldDataTypeSchema =
|
|
1218
|
+
var FieldDataTypeSchema = z8.enum([
|
|
1121
1219
|
"LONG_STRING",
|
|
1122
1220
|
"STRING",
|
|
1123
1221
|
"NUMBER",
|
|
@@ -1130,74 +1228,74 @@ var FieldDataTypeSchema = z7.enum([
|
|
|
1130
1228
|
"RELATION",
|
|
1131
1229
|
"OBJECT"
|
|
1132
1230
|
]);
|
|
1133
|
-
var FieldOptionSchema =
|
|
1134
|
-
label:
|
|
1135
|
-
value:
|
|
1136
|
-
color:
|
|
1137
|
-
});
|
|
1138
|
-
var InlineFieldDefinitionSchema =
|
|
1139
|
-
limitChoices:
|
|
1140
|
-
options:
|
|
1141
|
-
minLength:
|
|
1142
|
-
maxLength:
|
|
1143
|
-
min:
|
|
1144
|
-
max:
|
|
1145
|
-
relatedModel:
|
|
1146
|
-
pattern:
|
|
1147
|
-
});
|
|
1148
|
-
var AppFieldVisibilitySchema =
|
|
1149
|
-
data:
|
|
1150
|
-
list:
|
|
1151
|
-
filters:
|
|
1152
|
-
});
|
|
1153
|
-
var FieldRequirementTypeSchema =
|
|
1154
|
-
var ModelFieldDefinitionSchema =
|
|
1155
|
-
handle:
|
|
1156
|
-
label:
|
|
1231
|
+
var FieldOptionSchema = z8.object({
|
|
1232
|
+
label: z8.string(),
|
|
1233
|
+
value: z8.string(),
|
|
1234
|
+
color: z8.string().optional()
|
|
1235
|
+
});
|
|
1236
|
+
var InlineFieldDefinitionSchema = z8.object({
|
|
1237
|
+
limitChoices: z8.number().optional(),
|
|
1238
|
+
options: z8.array(FieldOptionSchema).optional(),
|
|
1239
|
+
minLength: z8.number().optional(),
|
|
1240
|
+
maxLength: z8.number().optional(),
|
|
1241
|
+
min: z8.number().optional(),
|
|
1242
|
+
max: z8.number().optional(),
|
|
1243
|
+
relatedModel: z8.string().optional(),
|
|
1244
|
+
pattern: z8.string().optional()
|
|
1245
|
+
});
|
|
1246
|
+
var AppFieldVisibilitySchema = z8.object({
|
|
1247
|
+
data: z8.boolean().optional(),
|
|
1248
|
+
list: z8.boolean().optional(),
|
|
1249
|
+
filters: z8.boolean().optional()
|
|
1250
|
+
});
|
|
1251
|
+
var FieldRequirementTypeSchema = z8.enum(["optional", "on_create", "required"]);
|
|
1252
|
+
var ModelFieldDefinitionSchema = z8.object({
|
|
1253
|
+
handle: z8.string(),
|
|
1254
|
+
label: z8.string(),
|
|
1157
1255
|
type: FieldDataTypeSchema.optional(),
|
|
1158
|
-
definition:
|
|
1256
|
+
definition: z8.union([InlineFieldDefinitionSchema, z8.string()]).optional(),
|
|
1159
1257
|
/** Field requirement type: 'optional', 'on_create', or 'required' */
|
|
1160
1258
|
requirement: FieldRequirementTypeSchema.optional(),
|
|
1161
1259
|
/** @deprecated Use `requirement` instead */
|
|
1162
|
-
required:
|
|
1163
|
-
unique:
|
|
1164
|
-
system:
|
|
1165
|
-
isList:
|
|
1166
|
-
defaultValue:
|
|
1167
|
-
description:
|
|
1260
|
+
required: z8.boolean().optional(),
|
|
1261
|
+
unique: z8.boolean().optional(),
|
|
1262
|
+
system: z8.boolean().optional(),
|
|
1263
|
+
isList: z8.boolean().optional(),
|
|
1264
|
+
defaultValue: z8.object({ value: z8.unknown() }).optional(),
|
|
1265
|
+
description: z8.string().optional(),
|
|
1168
1266
|
visibility: AppFieldVisibilitySchema.optional(),
|
|
1169
1267
|
owner: FieldOwnerSchema.optional()
|
|
1170
1268
|
});
|
|
1171
|
-
var ModelDefinitionSchema =
|
|
1172
|
-
handle:
|
|
1173
|
-
name:
|
|
1174
|
-
namePlural:
|
|
1175
|
-
labelTemplate:
|
|
1176
|
-
description:
|
|
1177
|
-
fields:
|
|
1178
|
-
requires:
|
|
1179
|
-
addDefaultPages:
|
|
1180
|
-
addNavigation:
|
|
1269
|
+
var ModelDefinitionSchema = z8.object({
|
|
1270
|
+
handle: z8.string(),
|
|
1271
|
+
name: z8.string(),
|
|
1272
|
+
namePlural: z8.string().optional(),
|
|
1273
|
+
labelTemplate: z8.string().optional(),
|
|
1274
|
+
description: z8.string().optional(),
|
|
1275
|
+
fields: z8.array(ModelFieldDefinitionSchema),
|
|
1276
|
+
requires: z8.array(ResourceDependencySchema).optional(),
|
|
1277
|
+
addDefaultPages: z8.boolean().optional(),
|
|
1278
|
+
addNavigation: z8.boolean().optional(),
|
|
1181
1279
|
/** Root path for developer resource UI (e.g., '/access_requests'). Links internal model to a provision.pages entry. */
|
|
1182
|
-
page:
|
|
1280
|
+
page: z8.string().optional()
|
|
1183
1281
|
});
|
|
1184
|
-
var RelationshipCardinalitySchema =
|
|
1282
|
+
var RelationshipCardinalitySchema = z8.enum([
|
|
1185
1283
|
"ONE_TO_ONE",
|
|
1186
1284
|
"ONE_TO_MANY"
|
|
1187
1285
|
]);
|
|
1188
|
-
var OnDeleteBehaviorSchema =
|
|
1189
|
-
var RelationshipLinkSchema =
|
|
1190
|
-
model:
|
|
1191
|
-
field:
|
|
1192
|
-
label:
|
|
1286
|
+
var OnDeleteBehaviorSchema = z8.enum(["NONE", "CASCADE", "RESTRICT"]);
|
|
1287
|
+
var RelationshipLinkSchema = z8.object({
|
|
1288
|
+
model: z8.string(),
|
|
1289
|
+
field: z8.string(),
|
|
1290
|
+
label: z8.string()
|
|
1193
1291
|
});
|
|
1194
|
-
var RelationshipDefinitionSchema =
|
|
1292
|
+
var RelationshipDefinitionSchema = z8.object({
|
|
1195
1293
|
source: RelationshipLinkSchema,
|
|
1196
1294
|
target: RelationshipLinkSchema,
|
|
1197
1295
|
cardinality: RelationshipCardinalitySchema,
|
|
1198
1296
|
onDelete: OnDeleteBehaviorSchema.default("NONE")
|
|
1199
1297
|
});
|
|
1200
|
-
var ChannelCapabilityTypeSchema =
|
|
1298
|
+
var ChannelCapabilityTypeSchema = z8.enum([
|
|
1201
1299
|
"messaging",
|
|
1202
1300
|
// Text-based: SMS, WhatsApp, Messenger, DMs
|
|
1203
1301
|
"voice",
|
|
@@ -1205,323 +1303,325 @@ var ChannelCapabilityTypeSchema = z7.enum([
|
|
|
1205
1303
|
"video"
|
|
1206
1304
|
// Video calls (future)
|
|
1207
1305
|
]);
|
|
1208
|
-
var ChannelCapabilitySchema =
|
|
1209
|
-
label:
|
|
1306
|
+
var ChannelCapabilitySchema = z8.object({
|
|
1307
|
+
label: z8.string(),
|
|
1210
1308
|
// Display name: "SMS", "WhatsApp Messages"
|
|
1211
|
-
icon:
|
|
1309
|
+
icon: z8.string().optional(),
|
|
1212
1310
|
// Lucide icon name
|
|
1213
|
-
receive:
|
|
1311
|
+
receive: z8.string().optional(),
|
|
1214
1312
|
// Inbound webhook handler
|
|
1215
|
-
send:
|
|
1313
|
+
send: z8.string().optional(),
|
|
1216
1314
|
// Outbound tool handle
|
|
1315
|
+
send_batch: z8.string().optional()
|
|
1316
|
+
// Batch outbound tool handle
|
|
1217
1317
|
});
|
|
1218
|
-
var ChannelFieldDefinitionSchema =
|
|
1219
|
-
handle:
|
|
1220
|
-
label:
|
|
1318
|
+
var ChannelFieldDefinitionSchema = z8.object({
|
|
1319
|
+
handle: z8.string(),
|
|
1320
|
+
label: z8.string(),
|
|
1221
1321
|
/** Field definition reference or inline definition */
|
|
1222
|
-
definition:
|
|
1322
|
+
definition: z8.union([InlineFieldDefinitionSchema, z8.string()]).optional(),
|
|
1223
1323
|
/** Marks this field as the identifier field for the channel */
|
|
1224
|
-
identifier:
|
|
1324
|
+
identifier: z8.boolean().optional(),
|
|
1225
1325
|
/** Whether this field is required */
|
|
1226
|
-
required:
|
|
1326
|
+
required: z8.boolean().optional(),
|
|
1227
1327
|
/** Default value when creating a new field */
|
|
1228
|
-
defaultValue:
|
|
1328
|
+
defaultValue: z8.object({ value: z8.unknown() }).passthrough().optional(),
|
|
1229
1329
|
/** Visibility settings for the field */
|
|
1230
|
-
visibility:
|
|
1231
|
-
data:
|
|
1232
|
-
list:
|
|
1233
|
-
filters:
|
|
1330
|
+
visibility: z8.object({
|
|
1331
|
+
data: z8.boolean().optional(),
|
|
1332
|
+
list: z8.boolean().optional(),
|
|
1333
|
+
filters: z8.boolean().optional()
|
|
1234
1334
|
}).passthrough().optional(),
|
|
1235
1335
|
/** Permission settings for the field */
|
|
1236
|
-
permissions:
|
|
1237
|
-
read:
|
|
1238
|
-
write:
|
|
1336
|
+
permissions: z8.object({
|
|
1337
|
+
read: z8.boolean().optional(),
|
|
1338
|
+
write: z8.boolean().optional()
|
|
1239
1339
|
}).passthrough().optional()
|
|
1240
1340
|
}).passthrough();
|
|
1241
|
-
var ChannelDefinitionSchema =
|
|
1242
|
-
handle:
|
|
1243
|
-
label:
|
|
1244
|
-
icon:
|
|
1341
|
+
var ChannelDefinitionSchema = z8.object({
|
|
1342
|
+
handle: z8.string(),
|
|
1343
|
+
label: z8.string(),
|
|
1344
|
+
icon: z8.string().optional(),
|
|
1245
1345
|
/** Array of field definitions for this channel. One field must have identifier: true. */
|
|
1246
|
-
fields:
|
|
1346
|
+
fields: z8.array(ChannelFieldDefinitionSchema),
|
|
1247
1347
|
// Capabilities keyed by standard type (messaging, voice, video) - all optional
|
|
1248
|
-
capabilities:
|
|
1348
|
+
capabilities: z8.object({
|
|
1249
1349
|
messaging: ChannelCapabilitySchema.optional(),
|
|
1250
1350
|
voice: ChannelCapabilitySchema.optional(),
|
|
1251
1351
|
video: ChannelCapabilitySchema.optional()
|
|
1252
1352
|
})
|
|
1253
1353
|
});
|
|
1254
|
-
var WorkflowActionInputSchema =
|
|
1255
|
-
key:
|
|
1256
|
-
label:
|
|
1257
|
-
fieldRef:
|
|
1258
|
-
fieldHandle:
|
|
1259
|
-
entityHandle:
|
|
1354
|
+
var WorkflowActionInputSchema = z8.object({
|
|
1355
|
+
key: z8.string(),
|
|
1356
|
+
label: z8.string(),
|
|
1357
|
+
fieldRef: z8.object({
|
|
1358
|
+
fieldHandle: z8.string(),
|
|
1359
|
+
entityHandle: z8.string()
|
|
1260
1360
|
}).optional(),
|
|
1261
|
-
template:
|
|
1262
|
-
});
|
|
1263
|
-
var WorkflowActionSchema =
|
|
1264
|
-
label:
|
|
1265
|
-
handle:
|
|
1266
|
-
batch:
|
|
1267
|
-
entityHandle:
|
|
1268
|
-
inputs:
|
|
1269
|
-
});
|
|
1270
|
-
var WorkflowDefinitionSchema =
|
|
1271
|
-
path:
|
|
1272
|
-
label:
|
|
1273
|
-
handle:
|
|
1274
|
-
requires:
|
|
1275
|
-
actions:
|
|
1276
|
-
});
|
|
1277
|
-
var PageTypeSchema =
|
|
1278
|
-
var PageBlockTypeSchema =
|
|
1279
|
-
var PageFieldTypeSchema =
|
|
1280
|
-
var PageFieldSourceSchema =
|
|
1281
|
-
model:
|
|
1282
|
-
field:
|
|
1283
|
-
});
|
|
1284
|
-
var PageFormHeaderSchema =
|
|
1285
|
-
title:
|
|
1286
|
-
description:
|
|
1287
|
-
});
|
|
1288
|
-
var PageActionDefinitionSchema =
|
|
1289
|
-
handle:
|
|
1290
|
-
label:
|
|
1291
|
-
handler:
|
|
1292
|
-
href:
|
|
1293
|
-
icon:
|
|
1294
|
-
variant:
|
|
1295
|
-
isDisabled:
|
|
1296
|
-
isHidden:
|
|
1361
|
+
template: z8.string().optional()
|
|
1362
|
+
});
|
|
1363
|
+
var WorkflowActionSchema = z8.object({
|
|
1364
|
+
label: z8.string(),
|
|
1365
|
+
handle: z8.string(),
|
|
1366
|
+
batch: z8.boolean().optional(),
|
|
1367
|
+
entityHandle: z8.string().optional(),
|
|
1368
|
+
inputs: z8.array(WorkflowActionInputSchema).optional()
|
|
1369
|
+
});
|
|
1370
|
+
var WorkflowDefinitionSchema = z8.object({
|
|
1371
|
+
path: z8.string(),
|
|
1372
|
+
label: z8.string().optional(),
|
|
1373
|
+
handle: z8.string().optional(),
|
|
1374
|
+
requires: z8.array(ResourceDependencySchema).optional(),
|
|
1375
|
+
actions: z8.array(WorkflowActionSchema)
|
|
1376
|
+
});
|
|
1377
|
+
var PageTypeSchema = z8.enum(["INSTANCE", "LIST"]);
|
|
1378
|
+
var PageBlockTypeSchema = z8.enum(["form", "spreadsheet", "kanban", "calendar", "link", "list", "card"]);
|
|
1379
|
+
var PageFieldTypeSchema = z8.enum(["STRING", "FILE", "NUMBER", "DATE", "BOOLEAN", "SELECT", "FORM", "RELATIONSHIP"]);
|
|
1380
|
+
var PageFieldSourceSchema = z8.object({
|
|
1381
|
+
model: z8.string(),
|
|
1382
|
+
field: z8.string()
|
|
1383
|
+
});
|
|
1384
|
+
var PageFormHeaderSchema = z8.object({
|
|
1385
|
+
title: z8.string(),
|
|
1386
|
+
description: z8.string().optional()
|
|
1387
|
+
});
|
|
1388
|
+
var PageActionDefinitionSchema = z8.object({
|
|
1389
|
+
handle: z8.string(),
|
|
1390
|
+
label: z8.string(),
|
|
1391
|
+
handler: z8.string().optional(),
|
|
1392
|
+
href: z8.string().optional(),
|
|
1393
|
+
icon: z8.string().optional(),
|
|
1394
|
+
variant: z8.enum(["primary", "secondary", "destructive", "outline"]).optional(),
|
|
1395
|
+
isDisabled: z8.union([z8.boolean(), z8.string()]).optional(),
|
|
1396
|
+
isHidden: z8.union([z8.boolean(), z8.string()]).optional()
|
|
1297
1397
|
}).refine((data) => Boolean(data.handler || data.href), {
|
|
1298
1398
|
message: "Page action requires handler or href"
|
|
1299
1399
|
});
|
|
1300
|
-
var FormV2StylePropsSchema =
|
|
1301
|
-
id:
|
|
1302
|
-
row:
|
|
1303
|
-
col:
|
|
1304
|
-
className:
|
|
1305
|
-
hidden:
|
|
1306
|
-
});
|
|
1307
|
-
var FieldSettingButtonPropsSchema =
|
|
1308
|
-
label:
|
|
1309
|
-
variant:
|
|
1310
|
-
size:
|
|
1311
|
-
isLoading:
|
|
1400
|
+
var FormV2StylePropsSchema = z8.object({
|
|
1401
|
+
id: z8.string(),
|
|
1402
|
+
row: z8.number(),
|
|
1403
|
+
col: z8.number(),
|
|
1404
|
+
className: z8.string().optional(),
|
|
1405
|
+
hidden: z8.boolean().optional()
|
|
1406
|
+
});
|
|
1407
|
+
var FieldSettingButtonPropsSchema = z8.object({
|
|
1408
|
+
label: z8.string(),
|
|
1409
|
+
variant: z8.enum(["default", "destructive", "outline", "secondary", "ghost", "link"]).optional(),
|
|
1410
|
+
size: z8.enum(["default", "sm", "lg", "icon"]).optional(),
|
|
1411
|
+
isLoading: z8.boolean().optional(),
|
|
1312
1412
|
/** Can be boolean or Liquid template string that resolves to boolean */
|
|
1313
|
-
isDisabled:
|
|
1314
|
-
leftIcon:
|
|
1413
|
+
isDisabled: z8.union([z8.boolean(), z8.string()]).optional(),
|
|
1414
|
+
leftIcon: z8.string().optional()
|
|
1315
1415
|
});
|
|
1316
|
-
var RelationshipExtensionSchema =
|
|
1317
|
-
model:
|
|
1416
|
+
var RelationshipExtensionSchema = z8.object({
|
|
1417
|
+
model: z8.string()
|
|
1318
1418
|
});
|
|
1319
|
-
var FormLayoutColumnDefinitionSchema =
|
|
1320
|
-
field:
|
|
1321
|
-
colSpan:
|
|
1322
|
-
dataType:
|
|
1323
|
-
subQuery:
|
|
1419
|
+
var FormLayoutColumnDefinitionSchema = z8.object({
|
|
1420
|
+
field: z8.string(),
|
|
1421
|
+
colSpan: z8.number(),
|
|
1422
|
+
dataType: z8.string().optional(),
|
|
1423
|
+
subQuery: z8.unknown().optional()
|
|
1324
1424
|
});
|
|
1325
|
-
var FormLayoutRowDefinitionSchema =
|
|
1326
|
-
columns:
|
|
1425
|
+
var FormLayoutRowDefinitionSchema = z8.object({
|
|
1426
|
+
columns: z8.array(FormLayoutColumnDefinitionSchema)
|
|
1327
1427
|
});
|
|
1328
|
-
var FormLayoutConfigDefinitionSchema =
|
|
1329
|
-
type:
|
|
1330
|
-
rows:
|
|
1428
|
+
var FormLayoutConfigDefinitionSchema = z8.object({
|
|
1429
|
+
type: z8.literal("form"),
|
|
1430
|
+
rows: z8.array(FormLayoutRowDefinitionSchema)
|
|
1331
1431
|
});
|
|
1332
1432
|
var InputComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1333
|
-
component:
|
|
1334
|
-
props:
|
|
1335
|
-
label:
|
|
1336
|
-
placeholder:
|
|
1337
|
-
helpText:
|
|
1338
|
-
type:
|
|
1339
|
-
required:
|
|
1340
|
-
disabled:
|
|
1341
|
-
value:
|
|
1433
|
+
component: z8.literal("Input"),
|
|
1434
|
+
props: z8.object({
|
|
1435
|
+
label: z8.string().optional(),
|
|
1436
|
+
placeholder: z8.string().optional(),
|
|
1437
|
+
helpText: z8.string().optional(),
|
|
1438
|
+
type: z8.enum(["text", "number", "email", "password", "tel", "url", "hidden"]).optional(),
|
|
1439
|
+
required: z8.boolean().optional(),
|
|
1440
|
+
disabled: z8.boolean().optional(),
|
|
1441
|
+
value: z8.union([z8.string(), z8.number()]).optional()
|
|
1342
1442
|
})
|
|
1343
1443
|
});
|
|
1344
1444
|
var TextareaComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1345
|
-
component:
|
|
1346
|
-
props:
|
|
1347
|
-
label:
|
|
1348
|
-
placeholder:
|
|
1349
|
-
helpText:
|
|
1350
|
-
required:
|
|
1351
|
-
disabled:
|
|
1352
|
-
value:
|
|
1445
|
+
component: z8.literal("Textarea"),
|
|
1446
|
+
props: z8.object({
|
|
1447
|
+
label: z8.string().optional(),
|
|
1448
|
+
placeholder: z8.string().optional(),
|
|
1449
|
+
helpText: z8.string().optional(),
|
|
1450
|
+
required: z8.boolean().optional(),
|
|
1451
|
+
disabled: z8.boolean().optional(),
|
|
1452
|
+
value: z8.string().optional()
|
|
1353
1453
|
})
|
|
1354
1454
|
});
|
|
1355
1455
|
var SelectComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1356
|
-
component:
|
|
1357
|
-
props:
|
|
1358
|
-
label:
|
|
1359
|
-
placeholder:
|
|
1360
|
-
helpText:
|
|
1456
|
+
component: z8.literal("Select"),
|
|
1457
|
+
props: z8.object({
|
|
1458
|
+
label: z8.string().optional(),
|
|
1459
|
+
placeholder: z8.string().optional(),
|
|
1460
|
+
helpText: z8.string().optional(),
|
|
1361
1461
|
/** Static items array (will be populated by iterable if using dynamic items) */
|
|
1362
|
-
items:
|
|
1363
|
-
value:
|
|
1364
|
-
isDisabled:
|
|
1365
|
-
required:
|
|
1462
|
+
items: z8.union([z8.array(z8.object({ value: z8.string(), label: z8.string() })), z8.string()]).optional(),
|
|
1463
|
+
value: z8.string().optional(),
|
|
1464
|
+
isDisabled: z8.boolean().optional(),
|
|
1465
|
+
required: z8.boolean().optional()
|
|
1366
1466
|
}),
|
|
1367
1467
|
relationship: RelationshipExtensionSchema.optional(),
|
|
1368
1468
|
/** For dynamic items using iterable pattern (e.g., 'system.models') */
|
|
1369
|
-
iterable:
|
|
1469
|
+
iterable: z8.string().optional(),
|
|
1370
1470
|
/** Template for each item in the iterable */
|
|
1371
|
-
itemTemplate:
|
|
1372
|
-
value:
|
|
1373
|
-
label:
|
|
1471
|
+
itemTemplate: z8.object({
|
|
1472
|
+
value: z8.string(),
|
|
1473
|
+
label: z8.string()
|
|
1374
1474
|
}).optional()
|
|
1375
1475
|
});
|
|
1376
1476
|
var ComboboxComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1377
|
-
component:
|
|
1378
|
-
props:
|
|
1379
|
-
label:
|
|
1380
|
-
placeholder:
|
|
1381
|
-
helpText:
|
|
1382
|
-
items:
|
|
1383
|
-
value:
|
|
1477
|
+
component: z8.literal("Combobox"),
|
|
1478
|
+
props: z8.object({
|
|
1479
|
+
label: z8.string().optional(),
|
|
1480
|
+
placeholder: z8.string().optional(),
|
|
1481
|
+
helpText: z8.string().optional(),
|
|
1482
|
+
items: z8.array(z8.object({ value: z8.string(), label: z8.string() })).optional(),
|
|
1483
|
+
value: z8.string().optional()
|
|
1384
1484
|
}),
|
|
1385
1485
|
relationship: RelationshipExtensionSchema.optional()
|
|
1386
1486
|
});
|
|
1387
1487
|
var CheckboxComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1388
|
-
component:
|
|
1389
|
-
props:
|
|
1390
|
-
label:
|
|
1391
|
-
helpText:
|
|
1392
|
-
checked:
|
|
1393
|
-
disabled:
|
|
1488
|
+
component: z8.literal("Checkbox"),
|
|
1489
|
+
props: z8.object({
|
|
1490
|
+
label: z8.string().optional(),
|
|
1491
|
+
helpText: z8.string().optional(),
|
|
1492
|
+
checked: z8.boolean().optional(),
|
|
1493
|
+
disabled: z8.boolean().optional()
|
|
1394
1494
|
})
|
|
1395
1495
|
});
|
|
1396
1496
|
var DatePickerComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1397
|
-
component:
|
|
1398
|
-
props:
|
|
1399
|
-
label:
|
|
1400
|
-
helpText:
|
|
1401
|
-
value:
|
|
1402
|
-
disabled:
|
|
1497
|
+
component: z8.literal("DatePicker"),
|
|
1498
|
+
props: z8.object({
|
|
1499
|
+
label: z8.string().optional(),
|
|
1500
|
+
helpText: z8.string().optional(),
|
|
1501
|
+
value: z8.union([z8.string(), z8.date()]).optional(),
|
|
1502
|
+
disabled: z8.boolean().optional()
|
|
1403
1503
|
})
|
|
1404
1504
|
});
|
|
1405
1505
|
var TimePickerComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1406
|
-
component:
|
|
1407
|
-
props:
|
|
1408
|
-
label:
|
|
1409
|
-
helpText:
|
|
1410
|
-
value:
|
|
1411
|
-
disabled:
|
|
1506
|
+
component: z8.literal("TimePicker"),
|
|
1507
|
+
props: z8.object({
|
|
1508
|
+
label: z8.string().optional(),
|
|
1509
|
+
helpText: z8.string().optional(),
|
|
1510
|
+
value: z8.string().optional(),
|
|
1511
|
+
disabled: z8.boolean().optional()
|
|
1412
1512
|
})
|
|
1413
1513
|
});
|
|
1414
1514
|
var ImageSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1415
|
-
component:
|
|
1416
|
-
props:
|
|
1417
|
-
label:
|
|
1418
|
-
description:
|
|
1419
|
-
helpText:
|
|
1420
|
-
accept:
|
|
1515
|
+
component: z8.literal("ImageSetting"),
|
|
1516
|
+
props: z8.object({
|
|
1517
|
+
label: z8.string().optional(),
|
|
1518
|
+
description: z8.string().optional(),
|
|
1519
|
+
helpText: z8.string().optional(),
|
|
1520
|
+
accept: z8.string().optional()
|
|
1421
1521
|
})
|
|
1422
1522
|
});
|
|
1423
1523
|
var FileSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1424
|
-
component:
|
|
1425
|
-
props:
|
|
1426
|
-
label:
|
|
1427
|
-
description:
|
|
1428
|
-
helpText:
|
|
1429
|
-
accept:
|
|
1430
|
-
required:
|
|
1431
|
-
button:
|
|
1432
|
-
label:
|
|
1433
|
-
variant:
|
|
1434
|
-
size:
|
|
1524
|
+
component: z8.literal("FileSetting"),
|
|
1525
|
+
props: z8.object({
|
|
1526
|
+
label: z8.string().optional(),
|
|
1527
|
+
description: z8.string().optional(),
|
|
1528
|
+
helpText: z8.string().optional(),
|
|
1529
|
+
accept: z8.string().optional(),
|
|
1530
|
+
required: z8.boolean().optional(),
|
|
1531
|
+
button: z8.object({
|
|
1532
|
+
label: z8.string().optional(),
|
|
1533
|
+
variant: z8.enum(["default", "outline", "ghost", "link"]).optional(),
|
|
1534
|
+
size: z8.enum(["sm", "md", "lg"]).optional()
|
|
1435
1535
|
}).optional()
|
|
1436
1536
|
})
|
|
1437
1537
|
});
|
|
1438
|
-
var ListItemTemplateSchema =
|
|
1439
|
-
component:
|
|
1440
|
-
span:
|
|
1441
|
-
mdSpan:
|
|
1442
|
-
lgSpan:
|
|
1443
|
-
props:
|
|
1538
|
+
var ListItemTemplateSchema = z8.object({
|
|
1539
|
+
component: z8.string(),
|
|
1540
|
+
span: z8.number().optional(),
|
|
1541
|
+
mdSpan: z8.number().optional(),
|
|
1542
|
+
lgSpan: z8.number().optional(),
|
|
1543
|
+
props: z8.record(z8.string(), z8.unknown())
|
|
1444
1544
|
});
|
|
1445
1545
|
var ListComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1446
|
-
component:
|
|
1447
|
-
props:
|
|
1448
|
-
title:
|
|
1449
|
-
items:
|
|
1450
|
-
id:
|
|
1451
|
-
label:
|
|
1452
|
-
description:
|
|
1546
|
+
component: z8.literal("List"),
|
|
1547
|
+
props: z8.object({
|
|
1548
|
+
title: z8.string().optional(),
|
|
1549
|
+
items: z8.array(z8.object({
|
|
1550
|
+
id: z8.string(),
|
|
1551
|
+
label: z8.string(),
|
|
1552
|
+
description: z8.string().optional()
|
|
1453
1553
|
})).optional(),
|
|
1454
|
-
emptyMessage:
|
|
1554
|
+
emptyMessage: z8.string().optional()
|
|
1455
1555
|
}),
|
|
1456
|
-
model:
|
|
1457
|
-
labelField:
|
|
1458
|
-
descriptionField:
|
|
1459
|
-
icon:
|
|
1556
|
+
model: z8.string().optional(),
|
|
1557
|
+
labelField: z8.string().optional(),
|
|
1558
|
+
descriptionField: z8.string().optional(),
|
|
1559
|
+
icon: z8.string().optional(),
|
|
1460
1560
|
/** Context variable name to iterate over (e.g., 'phone_numbers') */
|
|
1461
|
-
iterable:
|
|
1561
|
+
iterable: z8.string().optional(),
|
|
1462
1562
|
/** Template for each item - use {{ item.xyz }} for field values */
|
|
1463
1563
|
itemTemplate: ListItemTemplateSchema.optional()
|
|
1464
1564
|
});
|
|
1465
1565
|
var EmptyFormComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1466
|
-
component:
|
|
1467
|
-
props:
|
|
1468
|
-
title:
|
|
1469
|
-
description:
|
|
1470
|
-
icon:
|
|
1566
|
+
component: z8.literal("EmptyForm"),
|
|
1567
|
+
props: z8.object({
|
|
1568
|
+
title: z8.string().optional(),
|
|
1569
|
+
description: z8.string().optional(),
|
|
1570
|
+
icon: z8.string().optional()
|
|
1471
1571
|
})
|
|
1472
1572
|
});
|
|
1473
1573
|
var AlertComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1474
|
-
component:
|
|
1475
|
-
props:
|
|
1476
|
-
title:
|
|
1477
|
-
description:
|
|
1478
|
-
icon:
|
|
1479
|
-
variant:
|
|
1574
|
+
component: z8.literal("Alert"),
|
|
1575
|
+
props: z8.object({
|
|
1576
|
+
title: z8.string(),
|
|
1577
|
+
description: z8.string(),
|
|
1578
|
+
icon: z8.string().optional(),
|
|
1579
|
+
variant: z8.enum(["default", "destructive"]).optional()
|
|
1480
1580
|
})
|
|
1481
1581
|
});
|
|
1482
1582
|
var EventWiringPanelComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1483
|
-
component:
|
|
1484
|
-
props:
|
|
1485
|
-
eventTypes:
|
|
1486
|
-
|
|
1487
|
-
type:
|
|
1488
|
-
label:
|
|
1489
|
-
glofoxType:
|
|
1490
|
-
description:
|
|
1491
|
-
icon:
|
|
1583
|
+
component: z8.literal("EventWiringPanel"),
|
|
1584
|
+
props: z8.object({
|
|
1585
|
+
eventTypes: z8.array(
|
|
1586
|
+
z8.object({
|
|
1587
|
+
type: z8.string(),
|
|
1588
|
+
label: z8.string(),
|
|
1589
|
+
glofoxType: z8.string().optional(),
|
|
1590
|
+
description: z8.string().optional(),
|
|
1591
|
+
icon: z8.string().optional()
|
|
1492
1592
|
})
|
|
1493
1593
|
),
|
|
1494
|
-
recommendedWorkflowHandle:
|
|
1594
|
+
recommendedWorkflowHandle: z8.string().optional()
|
|
1495
1595
|
})
|
|
1496
1596
|
});
|
|
1497
|
-
var ModalFormDefinitionSchema =
|
|
1597
|
+
var ModalFormDefinitionSchema = z8.object({
|
|
1498
1598
|
header: PageFormHeaderSchema,
|
|
1499
|
-
handler:
|
|
1599
|
+
handler: z8.string(),
|
|
1500
1600
|
/** Named dialog template to use instead of inline fields */
|
|
1501
|
-
template:
|
|
1601
|
+
template: z8.string().optional(),
|
|
1502
1602
|
/** Template-specific params to pass to the dialog */
|
|
1503
|
-
templateParams:
|
|
1603
|
+
templateParams: z8.record(z8.string(), z8.unknown()).optional(),
|
|
1504
1604
|
/** Inline field definitions (used when template is not specified) */
|
|
1505
|
-
fields:
|
|
1605
|
+
fields: z8.lazy(() => z8.array(FormV2ComponentDefinitionSchema)).optional(),
|
|
1506
1606
|
layout: FormLayoutConfigDefinitionSchema.optional(),
|
|
1507
|
-
actions:
|
|
1607
|
+
actions: z8.array(PageActionDefinitionSchema).optional()
|
|
1508
1608
|
});
|
|
1509
1609
|
var FieldSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1510
|
-
component:
|
|
1511
|
-
props:
|
|
1512
|
-
label:
|
|
1513
|
-
description:
|
|
1514
|
-
helpText:
|
|
1515
|
-
mode:
|
|
1610
|
+
component: z8.literal("FieldSetting"),
|
|
1611
|
+
props: z8.object({
|
|
1612
|
+
label: z8.string(),
|
|
1613
|
+
description: z8.string().optional(),
|
|
1614
|
+
helpText: z8.string().optional(),
|
|
1615
|
+
mode: z8.enum(["field", "setting"]).optional(),
|
|
1516
1616
|
/** Status indicator - can be literal or Liquid template */
|
|
1517
|
-
status:
|
|
1617
|
+
status: z8.string().optional(),
|
|
1518
1618
|
/** Text to display alongside status badge - can be Liquid template */
|
|
1519
|
-
statusText:
|
|
1619
|
+
statusText: z8.string().optional(),
|
|
1520
1620
|
button: FieldSettingButtonPropsSchema
|
|
1521
1621
|
}),
|
|
1522
1622
|
modalForm: ModalFormDefinitionSchema.optional()
|
|
1523
1623
|
});
|
|
1524
|
-
var FormV2ComponentDefinitionSchema =
|
|
1624
|
+
var FormV2ComponentDefinitionSchema = z8.discriminatedUnion("component", [
|
|
1525
1625
|
InputComponentDefinitionSchema,
|
|
1526
1626
|
TextareaComponentDefinitionSchema,
|
|
1527
1627
|
SelectComponentDefinitionSchema,
|
|
@@ -1537,82 +1637,82 @@ var FormV2ComponentDefinitionSchema = z7.discriminatedUnion("component", [
|
|
|
1537
1637
|
AlertComponentDefinitionSchema,
|
|
1538
1638
|
EventWiringPanelComponentDefinitionSchema
|
|
1539
1639
|
]);
|
|
1540
|
-
var FormV2PropsDefinitionSchema =
|
|
1541
|
-
formVersion:
|
|
1542
|
-
id:
|
|
1543
|
-
fields:
|
|
1640
|
+
var FormV2PropsDefinitionSchema = z8.object({
|
|
1641
|
+
formVersion: z8.literal("v2"),
|
|
1642
|
+
id: z8.string().optional(),
|
|
1643
|
+
fields: z8.array(FormV2ComponentDefinitionSchema),
|
|
1544
1644
|
layout: FormLayoutConfigDefinitionSchema,
|
|
1545
1645
|
/** Optional actions that trigger MCP tool calls */
|
|
1546
|
-
actions:
|
|
1646
|
+
actions: z8.array(PageActionDefinitionSchema).optional()
|
|
1547
1647
|
});
|
|
1548
|
-
var CardBlockHeaderSchema =
|
|
1549
|
-
title:
|
|
1550
|
-
description:
|
|
1551
|
-
descriptionHref:
|
|
1648
|
+
var CardBlockHeaderSchema = z8.object({
|
|
1649
|
+
title: z8.string(),
|
|
1650
|
+
description: z8.string().optional(),
|
|
1651
|
+
descriptionHref: z8.string().optional()
|
|
1552
1652
|
});
|
|
1553
|
-
var CardBlockDefinitionSchema =
|
|
1554
|
-
type:
|
|
1555
|
-
restructurable:
|
|
1653
|
+
var CardBlockDefinitionSchema = z8.object({
|
|
1654
|
+
type: z8.literal("card"),
|
|
1655
|
+
restructurable: z8.boolean().optional(),
|
|
1556
1656
|
header: CardBlockHeaderSchema.optional(),
|
|
1557
1657
|
form: FormV2PropsDefinitionSchema,
|
|
1558
|
-
actions:
|
|
1559
|
-
secondaryActions:
|
|
1560
|
-
primaryActions:
|
|
1658
|
+
actions: z8.array(PageActionDefinitionSchema).optional(),
|
|
1659
|
+
secondaryActions: z8.array(PageActionDefinitionSchema).optional(),
|
|
1660
|
+
primaryActions: z8.array(PageActionDefinitionSchema).optional()
|
|
1561
1661
|
});
|
|
1562
|
-
var PageFieldDefinitionBaseSchema =
|
|
1563
|
-
handle:
|
|
1662
|
+
var PageFieldDefinitionBaseSchema = z8.object({
|
|
1663
|
+
handle: z8.string(),
|
|
1564
1664
|
type: PageFieldTypeSchema,
|
|
1565
|
-
label:
|
|
1566
|
-
description:
|
|
1567
|
-
required:
|
|
1568
|
-
handler:
|
|
1665
|
+
label: z8.string(),
|
|
1666
|
+
description: z8.string().optional(),
|
|
1667
|
+
required: z8.boolean().optional(),
|
|
1668
|
+
handler: z8.string().optional(),
|
|
1569
1669
|
source: PageFieldSourceSchema.optional(),
|
|
1570
|
-
options:
|
|
1571
|
-
accept:
|
|
1572
|
-
model:
|
|
1670
|
+
options: z8.array(z8.object({ value: z8.string(), label: z8.string() })).optional(),
|
|
1671
|
+
accept: z8.string().optional(),
|
|
1672
|
+
model: z8.string().optional()
|
|
1573
1673
|
});
|
|
1574
1674
|
var PageFieldDefinitionSchema = PageFieldDefinitionBaseSchema.extend({
|
|
1575
1675
|
header: PageFormHeaderSchema.optional(),
|
|
1576
|
-
fields:
|
|
1577
|
-
actions:
|
|
1578
|
-
});
|
|
1579
|
-
var LegacyFormBlockDefinitionSchema =
|
|
1580
|
-
type:
|
|
1581
|
-
title:
|
|
1582
|
-
fields:
|
|
1583
|
-
readonly:
|
|
1584
|
-
});
|
|
1585
|
-
var ListBlockDefinitionSchema =
|
|
1586
|
-
type:
|
|
1587
|
-
title:
|
|
1588
|
-
model:
|
|
1589
|
-
labelField:
|
|
1590
|
-
descriptionField:
|
|
1591
|
-
icon:
|
|
1592
|
-
emptyMessage:
|
|
1593
|
-
});
|
|
1594
|
-
var ModelMapperBlockDefinitionSchema =
|
|
1595
|
-
type:
|
|
1676
|
+
fields: z8.lazy(() => z8.array(PageFieldDefinitionSchema)).optional(),
|
|
1677
|
+
actions: z8.lazy(() => z8.array(PageActionDefinitionSchema)).optional()
|
|
1678
|
+
});
|
|
1679
|
+
var LegacyFormBlockDefinitionSchema = z8.object({
|
|
1680
|
+
type: z8.enum(["form", "spreadsheet", "kanban", "calendar", "link"]),
|
|
1681
|
+
title: z8.string().optional(),
|
|
1682
|
+
fields: z8.array(PageFieldDefinitionSchema).optional(),
|
|
1683
|
+
readonly: z8.boolean().optional()
|
|
1684
|
+
});
|
|
1685
|
+
var ListBlockDefinitionSchema = z8.object({
|
|
1686
|
+
type: z8.literal("list"),
|
|
1687
|
+
title: z8.string().optional(),
|
|
1688
|
+
model: z8.string(),
|
|
1689
|
+
labelField: z8.string().optional(),
|
|
1690
|
+
descriptionField: z8.string().optional(),
|
|
1691
|
+
icon: z8.string().optional(),
|
|
1692
|
+
emptyMessage: z8.string().optional()
|
|
1693
|
+
});
|
|
1694
|
+
var ModelMapperBlockDefinitionSchema = z8.object({
|
|
1695
|
+
type: z8.literal("model_mapper"),
|
|
1596
1696
|
/** The SHARED model handle from install config (e.g., "client", "patient") */
|
|
1597
|
-
model:
|
|
1697
|
+
model: z8.string()
|
|
1598
1698
|
});
|
|
1599
|
-
var PageBlockDefinitionSchema =
|
|
1699
|
+
var PageBlockDefinitionSchema = z8.union([
|
|
1600
1700
|
CardBlockDefinitionSchema,
|
|
1601
1701
|
LegacyFormBlockDefinitionSchema,
|
|
1602
1702
|
ListBlockDefinitionSchema,
|
|
1603
1703
|
ModelMapperBlockDefinitionSchema
|
|
1604
1704
|
]);
|
|
1605
|
-
var PageContextModeSchema =
|
|
1606
|
-
var PageContextFiltersSchema =
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1705
|
+
var PageContextModeSchema = z8.enum(["first", "many", "count", "all"]).transform((val) => val === "all" ? "many" : val);
|
|
1706
|
+
var PageContextFiltersSchema = z8.record(
|
|
1707
|
+
z8.string(),
|
|
1708
|
+
z8.record(
|
|
1709
|
+
z8.string(),
|
|
1710
|
+
z8.union([PrimitiveSchema, z8.array(PrimitiveSchema), z8.string()])
|
|
1611
1711
|
)
|
|
1612
1712
|
);
|
|
1613
|
-
var PageContextItemDefinitionSchema =
|
|
1713
|
+
var PageContextItemDefinitionSchema = z8.object({
|
|
1614
1714
|
/** Model handle to fetch data from */
|
|
1615
|
-
model:
|
|
1715
|
+
model: z8.string(),
|
|
1616
1716
|
/** Fetch mode: 'first' returns single object, 'many' returns array, 'count' returns number */
|
|
1617
1717
|
mode: PageContextModeSchema,
|
|
1618
1718
|
/**
|
|
@@ -1622,69 +1722,69 @@ var PageContextItemDefinitionSchema = z7.object({
|
|
|
1622
1722
|
*/
|
|
1623
1723
|
filters: PageContextFiltersSchema.optional(),
|
|
1624
1724
|
/** Optional limit for 'many' mode */
|
|
1625
|
-
limit:
|
|
1725
|
+
limit: z8.number().optional()
|
|
1626
1726
|
});
|
|
1627
|
-
var PageContextToolItemDefinitionSchema =
|
|
1727
|
+
var PageContextToolItemDefinitionSchema = z8.object({
|
|
1628
1728
|
/** Tool name to invoke for fetching context data */
|
|
1629
|
-
tool:
|
|
1729
|
+
tool: z8.string()
|
|
1630
1730
|
});
|
|
1631
|
-
var PageContextDefinitionSchema =
|
|
1632
|
-
|
|
1633
|
-
|
|
1731
|
+
var PageContextDefinitionSchema = z8.record(
|
|
1732
|
+
z8.string(),
|
|
1733
|
+
z8.union([PageContextItemDefinitionSchema, PageContextToolItemDefinitionSchema])
|
|
1634
1734
|
);
|
|
1635
|
-
var PageInstanceFilterSchema =
|
|
1636
|
-
model:
|
|
1637
|
-
where:
|
|
1735
|
+
var PageInstanceFilterSchema = z8.object({
|
|
1736
|
+
model: z8.string(),
|
|
1737
|
+
where: z8.record(z8.string(), z8.unknown()).optional()
|
|
1638
1738
|
});
|
|
1639
|
-
var NavigationItemSchema =
|
|
1739
|
+
var NavigationItemSchema = z8.object({
|
|
1640
1740
|
/** Display label (supports Liquid templates) */
|
|
1641
|
-
label:
|
|
1741
|
+
label: z8.string(),
|
|
1642
1742
|
/** URL href (supports Liquid templates with path_params and context) */
|
|
1643
|
-
href:
|
|
1743
|
+
href: z8.string(),
|
|
1644
1744
|
/** Optional icon name */
|
|
1645
|
-
icon:
|
|
1745
|
+
icon: z8.string().optional(),
|
|
1646
1746
|
/** When true, item is omitted from rendered navigation (supports Liquid templates) */
|
|
1647
|
-
hidden:
|
|
1747
|
+
hidden: z8.union([z8.boolean(), z8.string()]).optional()
|
|
1648
1748
|
});
|
|
1649
|
-
var NavigationSectionSchema =
|
|
1749
|
+
var NavigationSectionSchema = z8.object({
|
|
1650
1750
|
/** Section title (supports Liquid templates) */
|
|
1651
|
-
title:
|
|
1751
|
+
title: z8.string().optional(),
|
|
1652
1752
|
/** Navigation items in this section */
|
|
1653
|
-
items:
|
|
1753
|
+
items: z8.array(NavigationItemSchema)
|
|
1654
1754
|
});
|
|
1655
|
-
var NavigationSidebarSchema =
|
|
1755
|
+
var NavigationSidebarSchema = z8.object({
|
|
1656
1756
|
/** Sections to display in the sidebar */
|
|
1657
|
-
sections:
|
|
1757
|
+
sections: z8.array(NavigationSectionSchema)
|
|
1658
1758
|
});
|
|
1659
|
-
var BreadcrumbItemSchema =
|
|
1759
|
+
var BreadcrumbItemSchema = z8.object({
|
|
1660
1760
|
/** Display label (supports Liquid templates) */
|
|
1661
|
-
label:
|
|
1761
|
+
label: z8.string(),
|
|
1662
1762
|
/** Optional href - if not provided, item is not clickable */
|
|
1663
|
-
href:
|
|
1763
|
+
href: z8.string().optional()
|
|
1664
1764
|
});
|
|
1665
|
-
var NavigationBreadcrumbSchema =
|
|
1765
|
+
var NavigationBreadcrumbSchema = z8.object({
|
|
1666
1766
|
/** Breadcrumb items from left to right */
|
|
1667
|
-
items:
|
|
1767
|
+
items: z8.array(BreadcrumbItemSchema)
|
|
1668
1768
|
});
|
|
1669
|
-
var NavigationConfigSchema =
|
|
1769
|
+
var NavigationConfigSchema = z8.object({
|
|
1670
1770
|
/** Sidebar navigation */
|
|
1671
1771
|
sidebar: NavigationSidebarSchema.optional(),
|
|
1672
1772
|
/** Breadcrumb navigation */
|
|
1673
1773
|
breadcrumb: NavigationBreadcrumbSchema.optional()
|
|
1674
1774
|
});
|
|
1675
|
-
var PageAudienceSchema =
|
|
1676
|
-
var PageDefinitionSchema =
|
|
1775
|
+
var PageAudienceSchema = z8.enum(["install", "developer", "both"]);
|
|
1776
|
+
var PageDefinitionSchema = z8.object({
|
|
1677
1777
|
/** Unique identifier within the app (snake_case) */
|
|
1678
|
-
handle:
|
|
1778
|
+
handle: z8.string().optional(),
|
|
1679
1779
|
/** Human-readable display name */
|
|
1680
|
-
label:
|
|
1780
|
+
label: z8.string(),
|
|
1681
1781
|
/** Optional description for documentation/UI */
|
|
1682
|
-
description:
|
|
1782
|
+
description: z8.string().optional(),
|
|
1683
1783
|
type: PageTypeSchema,
|
|
1684
1784
|
/** URL path for this page (e.g., '/phone-numbers' or '/phone-numbers/[id]' for dynamic segments) */
|
|
1685
|
-
path:
|
|
1785
|
+
path: z8.string(),
|
|
1686
1786
|
/** When true, this page is the default landing page for the app installation */
|
|
1687
|
-
default:
|
|
1787
|
+
default: z8.boolean().optional(),
|
|
1688
1788
|
/**
|
|
1689
1789
|
* Page audience:
|
|
1690
1790
|
* - 'install': Visible only to app installers (default)
|
|
@@ -1698,115 +1798,134 @@ var PageDefinitionSchema = z7.object({
|
|
|
1698
1798
|
* - string: Liquid template that evaluates to true/false
|
|
1699
1799
|
* - NavigationConfigSchema: full navigation override for this page (replaces base navigation)
|
|
1700
1800
|
*/
|
|
1701
|
-
navigation:
|
|
1702
|
-
blocks:
|
|
1703
|
-
actions:
|
|
1801
|
+
navigation: z8.union([z8.boolean(), z8.string(), NavigationConfigSchema]).optional().default(true),
|
|
1802
|
+
blocks: z8.array(PageBlockDefinitionSchema),
|
|
1803
|
+
actions: z8.array(PageActionDefinitionSchema).optional(),
|
|
1704
1804
|
/** Context data to load for Liquid templates. appInstallationId filtering is automatic. */
|
|
1705
1805
|
context: PageContextDefinitionSchema.optional(),
|
|
1706
1806
|
/** @deprecated Use context instead */
|
|
1707
1807
|
filter: PageInstanceFilterSchema.optional()
|
|
1708
1808
|
});
|
|
1709
|
-
var WebhookHttpMethodSchema =
|
|
1710
|
-
var WebhookTypeSchema =
|
|
1711
|
-
var WebhookHandlerDefinitionSchema =
|
|
1712
|
-
description:
|
|
1713
|
-
methods:
|
|
1809
|
+
var WebhookHttpMethodSchema = z8.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]);
|
|
1810
|
+
var WebhookTypeSchema = z8.enum(["WEBHOOK", "CALLBACK"]);
|
|
1811
|
+
var WebhookHandlerDefinitionSchema = z8.object({
|
|
1812
|
+
description: z8.string().optional(),
|
|
1813
|
+
methods: z8.array(WebhookHttpMethodSchema).optional(),
|
|
1714
1814
|
/** Invocation type: WEBHOOK (fire-and-forget) or CALLBACK (waits for response). Defaults to WEBHOOK. */
|
|
1715
1815
|
type: WebhookTypeSchema.optional(),
|
|
1716
|
-
handler:
|
|
1816
|
+
handler: z8.unknown()
|
|
1717
1817
|
});
|
|
1718
|
-
var WebhooksSchema =
|
|
1719
|
-
var AgentDefinitionSchema =
|
|
1818
|
+
var WebhooksSchema = z8.record(z8.string(), WebhookHandlerDefinitionSchema);
|
|
1819
|
+
var AgentDefinitionSchema = z8.object({
|
|
1720
1820
|
/** Unique identifier within the app (used for upserts) */
|
|
1721
|
-
handle:
|
|
1821
|
+
handle: z8.string().regex(/^[a-z0-9_-]+$/, "Handle must be lowercase alphanumeric with dashes/underscores"),
|
|
1722
1822
|
/** Display name */
|
|
1723
|
-
name:
|
|
1823
|
+
name: z8.string().min(1),
|
|
1724
1824
|
/** Description of what the agent does */
|
|
1725
|
-
description:
|
|
1825
|
+
description: z8.string(),
|
|
1726
1826
|
/** System prompt (static, no templating) */
|
|
1727
|
-
system:
|
|
1827
|
+
system: z8.string(),
|
|
1728
1828
|
/** Tool names to bind (can be empty for orchestrator agents) */
|
|
1729
|
-
tools:
|
|
1829
|
+
tools: z8.array(z8.string()),
|
|
1730
1830
|
/** Optional LLM model override */
|
|
1731
|
-
llmModelId:
|
|
1831
|
+
llmModelId: z8.string().optional(),
|
|
1732
1832
|
/** Parent agent that can call this agent ('composer' or another agent handle) */
|
|
1733
|
-
parentAgent:
|
|
1833
|
+
parentAgent: z8.string().optional()
|
|
1734
1834
|
});
|
|
1735
|
-
var InstallConfigSchema =
|
|
1835
|
+
var InstallConfigSchema = z8.object({
|
|
1736
1836
|
env: EnvSchemaSchema.optional(),
|
|
1737
1837
|
/** SHARED model definitions (mapped to user's existing data during installation) */
|
|
1738
|
-
models:
|
|
1838
|
+
models: z8.array(ModelDefinitionSchema).optional(),
|
|
1739
1839
|
/** Relationship definitions between SHARED models */
|
|
1740
|
-
relationships:
|
|
1840
|
+
relationships: z8.array(RelationshipDefinitionSchema).optional()
|
|
1741
1841
|
});
|
|
1742
|
-
var ProvisionConfigSchema =
|
|
1842
|
+
var ProvisionConfigSchema = z8.object({
|
|
1743
1843
|
env: EnvSchemaSchema.optional(),
|
|
1744
1844
|
/** INTERNAL model definitions (app-owned, not visible to users) */
|
|
1745
|
-
models:
|
|
1845
|
+
models: z8.array(ModelDefinitionSchema).optional(),
|
|
1746
1846
|
/** Relationship definitions between INTERNAL models */
|
|
1747
|
-
relationships:
|
|
1748
|
-
channels:
|
|
1749
|
-
workflows:
|
|
1847
|
+
relationships: z8.array(RelationshipDefinitionSchema).optional(),
|
|
1848
|
+
channels: z8.array(ChannelDefinitionSchema).optional(),
|
|
1849
|
+
workflows: z8.array(WorkflowDefinitionSchema).optional(),
|
|
1750
1850
|
/** Base navigation configuration for all pages (can be overridden per page) */
|
|
1751
1851
|
navigation: NavigationConfigSchema.optional(),
|
|
1752
|
-
pages:
|
|
1852
|
+
pages: z8.array(PageDefinitionSchema).optional()
|
|
1753
1853
|
});
|
|
1754
|
-
var SkedyulConfigSchema =
|
|
1755
|
-
name:
|
|
1756
|
-
version:
|
|
1757
|
-
description:
|
|
1854
|
+
var SkedyulConfigSchema = z8.object({
|
|
1855
|
+
name: z8.string(),
|
|
1856
|
+
version: z8.string().optional(),
|
|
1857
|
+
description: z8.string().optional(),
|
|
1758
1858
|
computeLayer: ComputeLayerTypeSchema.optional(),
|
|
1759
|
-
tools:
|
|
1760
|
-
webhooks:
|
|
1761
|
-
provision:
|
|
1762
|
-
agents:
|
|
1859
|
+
tools: z8.unknown().optional(),
|
|
1860
|
+
webhooks: z8.unknown().optional(),
|
|
1861
|
+
provision: z8.union([ProvisionConfigSchema, z8.unknown()]).optional(),
|
|
1862
|
+
agents: z8.array(AgentDefinitionSchema).optional()
|
|
1763
1863
|
});
|
|
1764
1864
|
function safeParseConfig(data) {
|
|
1765
1865
|
const result = SkedyulConfigSchema.safeParse(data);
|
|
1766
1866
|
return result.success ? result.data : null;
|
|
1767
1867
|
}
|
|
1768
|
-
var MessageSendChannelSchema =
|
|
1769
|
-
id:
|
|
1770
|
-
handle:
|
|
1771
|
-
identifierValue:
|
|
1772
|
-
});
|
|
1773
|
-
var MessageSendSubscriptionSchema =
|
|
1774
|
-
id:
|
|
1775
|
-
identifierValue:
|
|
1776
|
-
});
|
|
1777
|
-
var MessageSendContactSchema =
|
|
1778
|
-
id:
|
|
1779
|
-
name:
|
|
1780
|
-
});
|
|
1781
|
-
var MessageSendRecipientSchema =
|
|
1782
|
-
address:
|
|
1783
|
-
name:
|
|
1784
|
-
participantId:
|
|
1785
|
-
contactId:
|
|
1786
|
-
});
|
|
1787
|
-
var MessageSendAttachmentSchema =
|
|
1788
|
-
filename:
|
|
1789
|
-
url:
|
|
1790
|
-
mimeType:
|
|
1791
|
-
size:
|
|
1792
|
-
});
|
|
1793
|
-
var MessageSendMessageSchema =
|
|
1794
|
-
id:
|
|
1795
|
-
content:
|
|
1796
|
-
contentRaw:
|
|
1797
|
-
title:
|
|
1798
|
-
attachments:
|
|
1799
|
-
});
|
|
1800
|
-
var MessageSendInputSchema =
|
|
1868
|
+
var MessageSendChannelSchema = z8.object({
|
|
1869
|
+
id: z8.string(),
|
|
1870
|
+
handle: z8.string(),
|
|
1871
|
+
identifierValue: z8.string()
|
|
1872
|
+
});
|
|
1873
|
+
var MessageSendSubscriptionSchema = z8.object({
|
|
1874
|
+
id: z8.string(),
|
|
1875
|
+
identifierValue: z8.string()
|
|
1876
|
+
});
|
|
1877
|
+
var MessageSendContactSchema = z8.object({
|
|
1878
|
+
id: z8.string(),
|
|
1879
|
+
name: z8.string().optional()
|
|
1880
|
+
});
|
|
1881
|
+
var MessageSendRecipientSchema = z8.object({
|
|
1882
|
+
address: z8.string(),
|
|
1883
|
+
name: z8.string().optional(),
|
|
1884
|
+
participantId: z8.string().optional(),
|
|
1885
|
+
contactId: z8.string().optional()
|
|
1886
|
+
});
|
|
1887
|
+
var MessageSendAttachmentSchema = z8.object({
|
|
1888
|
+
filename: z8.string(),
|
|
1889
|
+
url: z8.string(),
|
|
1890
|
+
mimeType: z8.string(),
|
|
1891
|
+
size: z8.number()
|
|
1892
|
+
});
|
|
1893
|
+
var MessageSendMessageSchema = z8.object({
|
|
1894
|
+
id: z8.string(),
|
|
1895
|
+
content: z8.string(),
|
|
1896
|
+
contentRaw: z8.string().optional(),
|
|
1897
|
+
title: z8.string().optional(),
|
|
1898
|
+
attachments: z8.array(MessageSendAttachmentSchema).optional()
|
|
1899
|
+
});
|
|
1900
|
+
var MessageSendInputSchema = z8.object({
|
|
1801
1901
|
channel: MessageSendChannelSchema,
|
|
1802
1902
|
subscription: MessageSendSubscriptionSchema.optional(),
|
|
1803
1903
|
contact: MessageSendContactSchema.optional(),
|
|
1804
1904
|
recipient: MessageSendRecipientSchema.optional(),
|
|
1805
1905
|
message: MessageSendMessageSchema
|
|
1806
1906
|
});
|
|
1807
|
-
var MessageSendOutputSchema =
|
|
1808
|
-
status:
|
|
1809
|
-
remoteId:
|
|
1907
|
+
var MessageSendOutputSchema = z8.object({
|
|
1908
|
+
status: z8.enum(["sent", "queued", "failed"]),
|
|
1909
|
+
remoteId: z8.string().optional()
|
|
1910
|
+
});
|
|
1911
|
+
var MessageBulkRecipientSchema = z8.object({
|
|
1912
|
+
address: z8.string(),
|
|
1913
|
+
renderedBody: z8.string(),
|
|
1914
|
+
instanceId: z8.string().optional(),
|
|
1915
|
+
threadId: z8.string().optional(),
|
|
1916
|
+
messageId: z8.string().optional(),
|
|
1917
|
+
contactId: z8.string().optional()
|
|
1918
|
+
});
|
|
1919
|
+
var MessageBulkSendInputSchema = z8.object({
|
|
1920
|
+
channel: MessageSendChannelSchema,
|
|
1921
|
+
recipients: z8.array(MessageBulkRecipientSchema).min(1).max(1e4),
|
|
1922
|
+
schedule: z8.object({ at: z8.string() }).optional()
|
|
1923
|
+
});
|
|
1924
|
+
var MessageBulkSendOutputSchema = z8.object({
|
|
1925
|
+
status: z8.enum(["accepted", "failed"]),
|
|
1926
|
+
operationId: z8.string().optional(),
|
|
1927
|
+
acceptedCount: z8.number().int().nonnegative(),
|
|
1928
|
+
rejectedCount: z8.number().int().nonnegative().optional()
|
|
1810
1929
|
});
|
|
1811
1930
|
function isModelDependency(dep) {
|
|
1812
1931
|
return "model" in dep;
|
|
@@ -1820,7 +1939,7 @@ function isWorkflowDependency(dep) {
|
|
|
1820
1939
|
|
|
1821
1940
|
// src/server/index.ts
|
|
1822
1941
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
1823
|
-
import * as
|
|
1942
|
+
import * as z11 from "zod";
|
|
1824
1943
|
|
|
1825
1944
|
// src/core/service.ts
|
|
1826
1945
|
var CoreApiService = class {
|
|
@@ -1929,17 +2048,20 @@ function getQueueConfigWithRetry(queueName) {
|
|
|
1929
2048
|
}
|
|
1930
2049
|
|
|
1931
2050
|
// src/server/utils/schema.ts
|
|
1932
|
-
import * as
|
|
2051
|
+
import * as z9 from "zod";
|
|
1933
2052
|
function normalizeBilling(billing) {
|
|
1934
|
-
if (!billing || typeof billing
|
|
2053
|
+
if (!billing || typeof billing !== "object") {
|
|
1935
2054
|
return { credits: 0 };
|
|
1936
2055
|
}
|
|
2056
|
+
if (typeof billing.credits !== "number") {
|
|
2057
|
+
return { ...billing, credits: 0 };
|
|
2058
|
+
}
|
|
1937
2059
|
return billing;
|
|
1938
2060
|
}
|
|
1939
2061
|
function toJsonSchema(schema) {
|
|
1940
2062
|
if (!schema) return void 0;
|
|
1941
2063
|
try {
|
|
1942
|
-
return
|
|
2064
|
+
return z9.toJSONSchema(schema, {
|
|
1943
2065
|
unrepresentable: "any"
|
|
1944
2066
|
// Handle z.date(), z.bigint() etc gracefully
|
|
1945
2067
|
});
|
|
@@ -1950,12 +2072,12 @@ function toJsonSchema(schema) {
|
|
|
1950
2072
|
}
|
|
1951
2073
|
function isToolSchemaWithJson(schema) {
|
|
1952
2074
|
return Boolean(
|
|
1953
|
-
schema && typeof schema === "object" && "zod" in schema && schema.zod instanceof
|
|
2075
|
+
schema && typeof schema === "object" && "zod" in schema && schema.zod instanceof z9.ZodType
|
|
1954
2076
|
);
|
|
1955
2077
|
}
|
|
1956
2078
|
function getZodSchema(schema) {
|
|
1957
2079
|
if (!schema) return void 0;
|
|
1958
|
-
if (schema instanceof
|
|
2080
|
+
if (schema instanceof z9.ZodType) {
|
|
1959
2081
|
return schema;
|
|
1960
2082
|
}
|
|
1961
2083
|
if (isToolSchemaWithJson(schema)) {
|
|
@@ -2102,7 +2224,7 @@ function buildToolCallErrorOutput(result) {
|
|
|
2102
2224
|
|
|
2103
2225
|
// src/core/client.ts
|
|
2104
2226
|
import { AsyncLocalStorage } from "async_hooks";
|
|
2105
|
-
import { z as
|
|
2227
|
+
import { z as z10 } from "zod/v4";
|
|
2106
2228
|
var requestConfigStorage = new AsyncLocalStorage();
|
|
2107
2229
|
var globalConfig = {
|
|
2108
2230
|
baseUrl: process.env.SKEDYUL_API_URL ?? process.env.SKEDYUL_NODE_URL ?? "",
|
|
@@ -3082,7 +3204,7 @@ var resource = {
|
|
|
3082
3204
|
}
|
|
3083
3205
|
};
|
|
3084
3206
|
function zodSchemaToJsonSchema(schema) {
|
|
3085
|
-
return
|
|
3207
|
+
return z10.toJSONSchema(schema);
|
|
3086
3208
|
}
|
|
3087
3209
|
var ai = {
|
|
3088
3210
|
/**
|
|
@@ -3308,10 +3430,27 @@ function getActiveQueuedOperation() {
|
|
|
3308
3430
|
function getActiveQueuedOperationStack() {
|
|
3309
3431
|
return activeOperationStackStorage.getStore() ?? [];
|
|
3310
3432
|
}
|
|
3311
|
-
function
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3433
|
+
function getActiveMutexQueueNames() {
|
|
3434
|
+
const names = /* @__PURE__ */ new Set();
|
|
3435
|
+
for (const operation of getActiveQueuedOperationStack()) {
|
|
3436
|
+
if (operation.lease === null) {
|
|
3437
|
+
continue;
|
|
3438
|
+
}
|
|
3439
|
+
const config = getQueueConfigWithRetry(operation.resolved.name);
|
|
3440
|
+
if (config?.mutex === true) {
|
|
3441
|
+
names.add(operation.resolved.name);
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3444
|
+
return [...names];
|
|
3445
|
+
}
|
|
3446
|
+
function shouldSkipNestedAcquire(queueName) {
|
|
3447
|
+
for (const mutexQueueName of getActiveMutexQueueNames()) {
|
|
3448
|
+
const config = getQueueConfigWithRetry(mutexQueueName);
|
|
3449
|
+
if (config?.suppressesQueues?.includes(queueName)) {
|
|
3450
|
+
return true;
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3453
|
+
return false;
|
|
3315
3454
|
}
|
|
3316
3455
|
function setActiveQueuedOperationLease(lease) {
|
|
3317
3456
|
const op = activeOperationStorage.getStore();
|
|
@@ -3548,6 +3687,7 @@ function buildToolMetadata(registry) {
|
|
|
3548
3687
|
const timeout = typeof rawTimeout === "number" && rawTimeout > 0 ? rawTimeout : 1e4;
|
|
3549
3688
|
const retries = typeof rawRetries === "number" && rawRetries >= 1 ? rawRetries : 1;
|
|
3550
3689
|
const queueTouchPoints = tool.queueTouchPoints ?? toolConfig.queueTouchPoints;
|
|
3690
|
+
const rateLimitHandoff = tool.rateLimitHandoff ?? toolConfig.rateLimitHandoff;
|
|
3551
3691
|
return {
|
|
3552
3692
|
name: tool.name,
|
|
3553
3693
|
displayName: tool.label || tool.name,
|
|
@@ -3558,11 +3698,13 @@ function buildToolMetadata(registry) {
|
|
|
3558
3698
|
timeout,
|
|
3559
3699
|
retries,
|
|
3560
3700
|
queueTouchPoints,
|
|
3701
|
+
rateLimitHandoff,
|
|
3561
3702
|
config: {
|
|
3562
3703
|
timeout,
|
|
3563
3704
|
retries,
|
|
3564
3705
|
completionHints: toolConfig.completionHints,
|
|
3565
|
-
queueTouchPoints
|
|
3706
|
+
queueTouchPoints,
|
|
3707
|
+
rateLimitHandoff
|
|
3566
3708
|
}
|
|
3567
3709
|
};
|
|
3568
3710
|
});
|
|
@@ -3604,7 +3746,8 @@ function createCallToolHandler(registry, state, onMaxRequests) {
|
|
|
3604
3746
|
}
|
|
3605
3747
|
const fn = tool.handler;
|
|
3606
3748
|
const args = toolArgsInput ?? {};
|
|
3607
|
-
const
|
|
3749
|
+
const rawContextForMode = args.context ?? {};
|
|
3750
|
+
const estimateMode = args.estimate === true || rawContextForMode.mode === "estimate";
|
|
3608
3751
|
if (!estimateMode) {
|
|
3609
3752
|
state.incrementRequestCount();
|
|
3610
3753
|
if (state.shouldShutdown()) {
|
|
@@ -4091,7 +4234,8 @@ function serializeConfig(config) {
|
|
|
4091
4234
|
// Read timeout/retries from top-level first, then fallback to config
|
|
4092
4235
|
timeout: tool.timeout ?? tool.config?.timeout,
|
|
4093
4236
|
retries: tool.retries ?? tool.config?.retries,
|
|
4094
|
-
queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints
|
|
4237
|
+
queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints,
|
|
4238
|
+
rateLimitHandoff: tool.rateLimitHandoff ?? tool.config?.rateLimitHandoff
|
|
4095
4239
|
})) : [],
|
|
4096
4240
|
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
4097
4241
|
name: w.name,
|
|
@@ -4786,11 +4930,12 @@ async function handleMcpRoute(req, ctx) {
|
|
|
4786
4930
|
async function handleMcpToolsCall(params, id, ctx) {
|
|
4787
4931
|
const toolName = params?.name;
|
|
4788
4932
|
const rawArgs = params?.arguments ?? {};
|
|
4789
|
-
const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs;
|
|
4933
|
+
const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs || "estimate" in rawArgs;
|
|
4790
4934
|
const toolInputs = hasSkedyulFormat ? rawArgs.inputs ?? {} : rawArgs;
|
|
4791
4935
|
const toolContext = hasSkedyulFormat ? rawArgs.context : void 0;
|
|
4792
4936
|
const toolEnv = hasSkedyulFormat ? rawArgs.env : void 0;
|
|
4793
4937
|
const toolInvocation = hasSkedyulFormat ? rawArgs.invocation : void 0;
|
|
4938
|
+
const estimate = hasSkedyulFormat && rawArgs.estimate === true;
|
|
4794
4939
|
const found = findToolInRegistry(ctx.registry, toolName);
|
|
4795
4940
|
if (!found) {
|
|
4796
4941
|
return {
|
|
@@ -4815,7 +4960,8 @@ async function handleMcpToolsCall(params, id, ctx) {
|
|
|
4815
4960
|
inputs: validatedInputs,
|
|
4816
4961
|
context: toolContext,
|
|
4817
4962
|
env: toolEnv,
|
|
4818
|
-
invocation: toolInvocation
|
|
4963
|
+
invocation: toolInvocation,
|
|
4964
|
+
estimate
|
|
4819
4965
|
});
|
|
4820
4966
|
let result;
|
|
4821
4967
|
const isFailure2 = isToolCallFailure(toolResult);
|
|
@@ -5273,12 +5419,12 @@ function createSkedyulServer(config) {
|
|
|
5273
5419
|
const toolDisplayName = tool.label || toolName;
|
|
5274
5420
|
const inputZodSchema = getZodSchema(tool.inputSchema);
|
|
5275
5421
|
const outputZodSchema = getZodSchema(tool.outputSchema);
|
|
5276
|
-
const wrappedInputSchema =
|
|
5277
|
-
inputs: inputZodSchema ??
|
|
5278
|
-
context:
|
|
5279
|
-
env:
|
|
5280
|
-
invocation:
|
|
5281
|
-
estimate:
|
|
5422
|
+
const wrappedInputSchema = z11.object({
|
|
5423
|
+
inputs: inputZodSchema ?? z11.record(z11.string(), z11.unknown()).optional(),
|
|
5424
|
+
context: z11.record(z11.string(), z11.unknown()).optional(),
|
|
5425
|
+
env: z11.record(z11.string(), z11.string()).optional(),
|
|
5426
|
+
invocation: z11.record(z11.string(), z11.unknown()).optional(),
|
|
5427
|
+
estimate: z11.boolean().optional()
|
|
5282
5428
|
}).passthrough();
|
|
5283
5429
|
mcpServer.registerTool(
|
|
5284
5430
|
toolName,
|
|
@@ -5987,7 +6133,7 @@ async function executeWithRetries(operation, maxRetries) {
|
|
|
5987
6133
|
operation.resolved.queueKey,
|
|
5988
6134
|
rateLimitCtx
|
|
5989
6135
|
);
|
|
5990
|
-
if (operation.resolved.name
|
|
6136
|
+
if (shouldSkipNestedAcquire(operation.resolved.name)) {
|
|
5991
6137
|
return operation.fn();
|
|
5992
6138
|
}
|
|
5993
6139
|
if (preAcquired) {
|
|
@@ -6091,86 +6237,86 @@ async function queuedFetchResponse(queueInput, url, init) {
|
|
|
6091
6237
|
}
|
|
6092
6238
|
|
|
6093
6239
|
// src/triggers/types.ts
|
|
6094
|
-
import { z as
|
|
6095
|
-
var CRMDataSchema =
|
|
6096
|
-
model:
|
|
6097
|
-
instanceId:
|
|
6098
|
-
data:
|
|
6240
|
+
import { z as z12 } from "zod/v4";
|
|
6241
|
+
var CRMDataSchema = z12.object({
|
|
6242
|
+
model: z12.string(),
|
|
6243
|
+
instanceId: z12.string(),
|
|
6244
|
+
data: z12.record(z12.string(), z12.unknown())
|
|
6099
6245
|
});
|
|
6100
|
-
var SenderContextSchema2 =
|
|
6246
|
+
var SenderContextSchema2 = z12.object({
|
|
6101
6247
|
kind: ParticipantKindSchema,
|
|
6102
|
-
displayName:
|
|
6248
|
+
displayName: z12.string().optional(),
|
|
6103
6249
|
crm: CRMDataSchema.optional()
|
|
6104
6250
|
});
|
|
6105
|
-
var ThreadContextItemSchema2 =
|
|
6106
|
-
handle:
|
|
6107
|
-
model:
|
|
6108
|
-
instanceId:
|
|
6109
|
-
data:
|
|
6251
|
+
var ThreadContextItemSchema2 = z12.object({
|
|
6252
|
+
handle: z12.string(),
|
|
6253
|
+
model: z12.string(),
|
|
6254
|
+
instanceId: z12.string(),
|
|
6255
|
+
data: z12.record(z12.string(), z12.unknown()).optional()
|
|
6110
6256
|
});
|
|
6111
|
-
var ParticipantContextSchema =
|
|
6112
|
-
id:
|
|
6257
|
+
var ParticipantContextSchema = z12.object({
|
|
6258
|
+
id: z12.string(),
|
|
6113
6259
|
kind: ParticipantKindSchema,
|
|
6114
|
-
displayName:
|
|
6115
|
-
contactId:
|
|
6116
|
-
memberId:
|
|
6117
|
-
agentId:
|
|
6118
|
-
workflowId:
|
|
6260
|
+
displayName: z12.string().optional(),
|
|
6261
|
+
contactId: z12.string().optional(),
|
|
6262
|
+
memberId: z12.string().optional(),
|
|
6263
|
+
agentId: z12.string().optional(),
|
|
6264
|
+
workflowId: z12.string().optional()
|
|
6119
6265
|
});
|
|
6120
|
-
var TriggerContextSchema =
|
|
6266
|
+
var TriggerContextSchema = z12.object({
|
|
6121
6267
|
// The event that triggered this
|
|
6122
|
-
event:
|
|
6268
|
+
event: z12.object({
|
|
6123
6269
|
type: EventTypeSchema,
|
|
6124
|
-
payload:
|
|
6270
|
+
payload: z12.record(z12.string(), z12.unknown()),
|
|
6125
6271
|
participant: ParticipantContextSchema.optional()
|
|
6126
6272
|
}),
|
|
6127
6273
|
// Thread information
|
|
6128
|
-
thread:
|
|
6129
|
-
id:
|
|
6130
|
-
title:
|
|
6131
|
-
status:
|
|
6274
|
+
thread: z12.object({
|
|
6275
|
+
id: z12.string(),
|
|
6276
|
+
title: z12.string().optional(),
|
|
6277
|
+
status: z12.string().optional(),
|
|
6132
6278
|
sender: SenderContextSchema2.optional(),
|
|
6133
|
-
context:
|
|
6134
|
-
participants:
|
|
6279
|
+
context: z12.record(z12.string(), CRMDataSchema).optional(),
|
|
6280
|
+
participants: z12.array(ParticipantContextSchema).optional()
|
|
6135
6281
|
}),
|
|
6136
6282
|
// Workplace info
|
|
6137
|
-
workplace:
|
|
6138
|
-
id:
|
|
6139
|
-
name:
|
|
6140
|
-
settings:
|
|
6283
|
+
workplace: z12.object({
|
|
6284
|
+
id: z12.string(),
|
|
6285
|
+
name: z12.string().optional(),
|
|
6286
|
+
settings: z12.record(z12.string(), z12.unknown()).optional()
|
|
6141
6287
|
})
|
|
6142
6288
|
});
|
|
6143
|
-
var InputMappingSchema =
|
|
6144
|
-
var EventConditionsSchema =
|
|
6145
|
-
var TriggerConfigSchema =
|
|
6146
|
-
id:
|
|
6147
|
-
workflowId:
|
|
6148
|
-
workflowVersionId:
|
|
6149
|
-
workplaceId:
|
|
6150
|
-
handle:
|
|
6289
|
+
var InputMappingSchema = z12.record(z12.string(), z12.string());
|
|
6290
|
+
var EventConditionsSchema = z12.record(z12.string(), z12.string());
|
|
6291
|
+
var TriggerConfigSchema = z12.object({
|
|
6292
|
+
id: z12.string(),
|
|
6293
|
+
workflowId: z12.string(),
|
|
6294
|
+
workflowVersionId: z12.string().optional(),
|
|
6295
|
+
workplaceId: z12.string(),
|
|
6296
|
+
handle: z12.string(),
|
|
6151
6297
|
// Input mappings: how to resolve workflow inputs from thread context
|
|
6152
6298
|
inputMappings: InputMappingSchema.optional(),
|
|
6153
6299
|
// Event conditions: additional workplace-specific conditions
|
|
6154
6300
|
eventConditions: EventConditionsSchema.optional(),
|
|
6155
6301
|
// Workplace-specific config overrides
|
|
6156
|
-
config:
|
|
6302
|
+
config: z12.record(z12.string(), z12.unknown()).optional(),
|
|
6157
6303
|
// Trigger type and status
|
|
6158
|
-
type:
|
|
6159
|
-
isEnabled:
|
|
6304
|
+
type: z12.string().optional(),
|
|
6305
|
+
isEnabled: z12.boolean().optional()
|
|
6160
6306
|
});
|
|
6161
|
-
var ResolvedTriggerSchema =
|
|
6307
|
+
var ResolvedTriggerSchema = z12.object({
|
|
6162
6308
|
trigger: TriggerConfigSchema,
|
|
6163
|
-
workflow:
|
|
6164
|
-
id:
|
|
6165
|
-
handle:
|
|
6166
|
-
name:
|
|
6167
|
-
inputs:
|
|
6168
|
-
events:
|
|
6169
|
-
subscribes:
|
|
6170
|
-
condition:
|
|
6309
|
+
workflow: z12.object({
|
|
6310
|
+
id: z12.string(),
|
|
6311
|
+
handle: z12.string(),
|
|
6312
|
+
name: z12.string().optional(),
|
|
6313
|
+
inputs: z12.record(z12.string(), z12.unknown()).optional(),
|
|
6314
|
+
events: z12.object({
|
|
6315
|
+
subscribes: z12.array(EventTypeSchema).optional(),
|
|
6316
|
+
condition: z12.string().optional()
|
|
6171
6317
|
}).optional()
|
|
6172
6318
|
}),
|
|
6173
|
-
inputs:
|
|
6319
|
+
inputs: z12.record(z12.string(), z12.unknown()),
|
|
6174
6320
|
context: TriggerContextSchema
|
|
6175
6321
|
});
|
|
6176
6322
|
var TriggerResolutionError = class extends Error {
|
|
@@ -6181,13 +6327,13 @@ var TriggerResolutionError = class extends Error {
|
|
|
6181
6327
|
this.name = "TriggerResolutionError";
|
|
6182
6328
|
}
|
|
6183
6329
|
};
|
|
6184
|
-
var WorkflowInputDefinitionSchema =
|
|
6185
|
-
type:
|
|
6186
|
-
required:
|
|
6187
|
-
description:
|
|
6188
|
-
default:
|
|
6330
|
+
var WorkflowInputDefinitionSchema = z12.object({
|
|
6331
|
+
type: z12.string(),
|
|
6332
|
+
required: z12.boolean().optional(),
|
|
6333
|
+
description: z12.string().optional(),
|
|
6334
|
+
default: z12.unknown().optional()
|
|
6189
6335
|
});
|
|
6190
|
-
var WorkflowInputSchemaSchema =
|
|
6336
|
+
var WorkflowInputSchemaSchema = z12.record(z12.string(), WorkflowInputDefinitionSchema);
|
|
6191
6337
|
|
|
6192
6338
|
// src/triggers/resolver.ts
|
|
6193
6339
|
function evaluateTemplate(template, context) {
|
|
@@ -6269,67 +6415,67 @@ function matchesTrigger(trigger, eventType, context) {
|
|
|
6269
6415
|
}
|
|
6270
6416
|
|
|
6271
6417
|
// src/workflows/types.ts
|
|
6272
|
-
import { z as
|
|
6418
|
+
import { z as z13 } from "zod/v4";
|
|
6273
6419
|
var WORKFLOW_SCHEMA_VERSION = "https://skedyul.com/schemas/workflow/v1";
|
|
6274
|
-
var WorkflowInputSchema =
|
|
6275
|
-
type:
|
|
6276
|
-
required:
|
|
6277
|
-
description:
|
|
6278
|
-
default:
|
|
6279
|
-
});
|
|
6280
|
-
var WorkflowStepInputSchema =
|
|
6281
|
-
var WorkflowStepSchema =
|
|
6420
|
+
var WorkflowInputSchema = z13.object({
|
|
6421
|
+
type: z13.string(),
|
|
6422
|
+
required: z13.boolean().optional().default(false),
|
|
6423
|
+
description: z13.string().optional(),
|
|
6424
|
+
default: z13.unknown().optional()
|
|
6425
|
+
});
|
|
6426
|
+
var WorkflowStepInputSchema = z13.union([z13.string(), z13.number(), z13.boolean(), z13.record(z13.string(), z13.unknown())]);
|
|
6427
|
+
var WorkflowStepSchema = z13.object({
|
|
6282
6428
|
// Service and command
|
|
6283
|
-
service:
|
|
6284
|
-
cmd:
|
|
6429
|
+
service: z13.string(),
|
|
6430
|
+
cmd: z13.string(),
|
|
6285
6431
|
// Dependencies
|
|
6286
|
-
needs:
|
|
6432
|
+
needs: z13.array(z13.string()).optional(),
|
|
6287
6433
|
// Inputs (Liquid templates supported)
|
|
6288
|
-
inputs:
|
|
6434
|
+
inputs: z13.record(z13.string(), WorkflowStepInputSchema).optional(),
|
|
6289
6435
|
// Conditional execution
|
|
6290
|
-
condition:
|
|
6436
|
+
condition: z13.string().optional(),
|
|
6291
6437
|
// Retry configuration
|
|
6292
|
-
retry:
|
|
6293
|
-
attempts:
|
|
6294
|
-
backoff:
|
|
6438
|
+
retry: z13.object({
|
|
6439
|
+
attempts: z13.number().optional(),
|
|
6440
|
+
backoff: z13.enum(["linear", "exponential"]).optional()
|
|
6295
6441
|
}).optional(),
|
|
6296
6442
|
// Timeout
|
|
6297
|
-
timeout:
|
|
6298
|
-
});
|
|
6299
|
-
var WorkflowRuntimeSchema =
|
|
6300
|
-
durable:
|
|
6301
|
-
timeout:
|
|
6302
|
-
retry:
|
|
6303
|
-
attempts:
|
|
6304
|
-
backoff:
|
|
6443
|
+
timeout: z13.string().optional()
|
|
6444
|
+
});
|
|
6445
|
+
var WorkflowRuntimeSchema = z13.object({
|
|
6446
|
+
durable: z13.boolean().optional().default(true),
|
|
6447
|
+
timeout: z13.string().optional(),
|
|
6448
|
+
retry: z13.object({
|
|
6449
|
+
attempts: z13.number().optional(),
|
|
6450
|
+
backoff: z13.enum(["linear", "exponential"]).optional()
|
|
6305
6451
|
}).optional()
|
|
6306
6452
|
});
|
|
6307
|
-
var WorkflowYAMLSchema =
|
|
6453
|
+
var WorkflowYAMLSchema = z13.object({
|
|
6308
6454
|
// Schema version
|
|
6309
|
-
$schema:
|
|
6455
|
+
$schema: z13.string().optional(),
|
|
6310
6456
|
// Identity
|
|
6311
|
-
handle:
|
|
6312
|
-
name:
|
|
6313
|
-
version:
|
|
6314
|
-
description:
|
|
6457
|
+
handle: z13.string(),
|
|
6458
|
+
name: z13.string(),
|
|
6459
|
+
version: z13.string().optional(),
|
|
6460
|
+
description: z13.string().optional(),
|
|
6315
6461
|
// Inputs this workflow needs (portable, declared in YAML)
|
|
6316
|
-
inputs:
|
|
6462
|
+
inputs: z13.record(z13.string(), WorkflowInputSchema).optional(),
|
|
6317
6463
|
// Event subscriptions and conditions
|
|
6318
6464
|
events: EventsConfigSchema.optional(),
|
|
6319
6465
|
// Deterministic steps
|
|
6320
|
-
steps:
|
|
6466
|
+
steps: z13.record(z13.string(), WorkflowStepSchema),
|
|
6321
6467
|
// Runtime configuration
|
|
6322
6468
|
runtime: WorkflowRuntimeSchema.optional()
|
|
6323
6469
|
});
|
|
6324
|
-
var WorkflowMetadataSchema =
|
|
6325
|
-
handle:
|
|
6326
|
-
name:
|
|
6327
|
-
version:
|
|
6328
|
-
description:
|
|
6329
|
-
inputs:
|
|
6470
|
+
var WorkflowMetadataSchema = z13.object({
|
|
6471
|
+
handle: z13.string(),
|
|
6472
|
+
name: z13.string(),
|
|
6473
|
+
version: z13.string().optional(),
|
|
6474
|
+
description: z13.string().optional(),
|
|
6475
|
+
inputs: z13.record(z13.string(), WorkflowInputDefinitionSchema).optional(),
|
|
6330
6476
|
events: EventsConfigSchema.optional()
|
|
6331
6477
|
});
|
|
6332
|
-
var WorkflowExecutionStatusSchema =
|
|
6478
|
+
var WorkflowExecutionStatusSchema = z13.enum([
|
|
6333
6479
|
"PENDING",
|
|
6334
6480
|
"RUNNING",
|
|
6335
6481
|
"COMPLETED",
|
|
@@ -6337,14 +6483,14 @@ var WorkflowExecutionStatusSchema = z12.enum([
|
|
|
6337
6483
|
"CANCELLED",
|
|
6338
6484
|
"WAITING"
|
|
6339
6485
|
]);
|
|
6340
|
-
var WorkflowExecutionResultSchema =
|
|
6486
|
+
var WorkflowExecutionResultSchema = z13.object({
|
|
6341
6487
|
status: WorkflowExecutionStatusSchema,
|
|
6342
|
-
outputs:
|
|
6343
|
-
error:
|
|
6344
|
-
startedAt:
|
|
6345
|
-
completedAt:
|
|
6346
|
-
cancelledAt:
|
|
6347
|
-
cancelReason:
|
|
6488
|
+
outputs: z13.record(z13.string(), z13.unknown()).optional(),
|
|
6489
|
+
error: z13.string().optional(),
|
|
6490
|
+
startedAt: z13.string().datetime().optional(),
|
|
6491
|
+
completedAt: z13.string().datetime().optional(),
|
|
6492
|
+
cancelledAt: z13.string().datetime().optional(),
|
|
6493
|
+
cancelReason: z13.string().optional()
|
|
6348
6494
|
});
|
|
6349
6495
|
function defineWorkflowYAML(workflow) {
|
|
6350
6496
|
return WorkflowYAMLSchema.parse(workflow);
|
|
@@ -6422,8 +6568,8 @@ function getAssociationByModel(context, model) {
|
|
|
6422
6568
|
}
|
|
6423
6569
|
|
|
6424
6570
|
// src/memory/types.ts
|
|
6425
|
-
import { z as
|
|
6426
|
-
var MemoryEntryTypeSchema =
|
|
6571
|
+
import { z as z14 } from "zod/v4";
|
|
6572
|
+
var MemoryEntryTypeSchema = z14.enum([
|
|
6427
6573
|
"WORKING",
|
|
6428
6574
|
// Current conversation context
|
|
6429
6575
|
"OBSERVATION",
|
|
@@ -6433,80 +6579,80 @@ var MemoryEntryTypeSchema = z13.enum([
|
|
|
6433
6579
|
"SEMANTIC"
|
|
6434
6580
|
// Semantic memory for retrieval
|
|
6435
6581
|
]);
|
|
6436
|
-
var MemoryEntrySchema =
|
|
6437
|
-
id:
|
|
6582
|
+
var MemoryEntrySchema = z14.object({
|
|
6583
|
+
id: z14.string(),
|
|
6438
6584
|
type: MemoryEntryTypeSchema,
|
|
6439
|
-
key:
|
|
6440
|
-
value:
|
|
6441
|
-
metadata:
|
|
6442
|
-
expiresAt:
|
|
6443
|
-
createdAt:
|
|
6444
|
-
updatedAt:
|
|
6445
|
-
});
|
|
6446
|
-
var WorkingMemoryConfigSchema2 =
|
|
6447
|
-
strategy:
|
|
6448
|
-
maxTokens:
|
|
6449
|
-
summarizeAt:
|
|
6450
|
-
ttl:
|
|
6451
|
-
});
|
|
6452
|
-
var SemanticMemoryConfigSchema2 =
|
|
6453
|
-
enabled:
|
|
6454
|
-
topK:
|
|
6455
|
-
scope:
|
|
6456
|
-
minScore:
|
|
6457
|
-
});
|
|
6458
|
-
var ExternalMemoryConfigSchema2 =
|
|
6459
|
-
namespace:
|
|
6460
|
-
ttl:
|
|
6461
|
-
});
|
|
6462
|
-
var MemoryConfigSchema =
|
|
6585
|
+
key: z14.string(),
|
|
6586
|
+
value: z14.unknown(),
|
|
6587
|
+
metadata: z14.record(z14.string(), z14.unknown()).optional(),
|
|
6588
|
+
expiresAt: z14.string().datetime().optional(),
|
|
6589
|
+
createdAt: z14.string().datetime(),
|
|
6590
|
+
updatedAt: z14.string().datetime()
|
|
6591
|
+
});
|
|
6592
|
+
var WorkingMemoryConfigSchema2 = z14.object({
|
|
6593
|
+
strategy: z14.enum(["full", "rolling_summary", "sliding_window"]).default("rolling_summary"),
|
|
6594
|
+
maxTokens: z14.number().default(8e3),
|
|
6595
|
+
summarizeAt: z14.number().optional(),
|
|
6596
|
+
ttl: z14.string().optional()
|
|
6597
|
+
});
|
|
6598
|
+
var SemanticMemoryConfigSchema2 = z14.object({
|
|
6599
|
+
enabled: z14.boolean().default(false),
|
|
6600
|
+
topK: z14.number().default(5),
|
|
6601
|
+
scope: z14.enum(["thread", "instance", "workspace"]).default("thread"),
|
|
6602
|
+
minScore: z14.number().default(0.7)
|
|
6603
|
+
});
|
|
6604
|
+
var ExternalMemoryConfigSchema2 = z14.object({
|
|
6605
|
+
namespace: z14.string(),
|
|
6606
|
+
ttl: z14.string().optional()
|
|
6607
|
+
});
|
|
6608
|
+
var MemoryConfigSchema = z14.object({
|
|
6463
6609
|
working: WorkingMemoryConfigSchema2.optional(),
|
|
6464
6610
|
semantic: SemanticMemoryConfigSchema2.optional(),
|
|
6465
6611
|
external: ExternalMemoryConfigSchema2.optional(),
|
|
6466
|
-
persistent:
|
|
6467
|
-
namespace:
|
|
6612
|
+
persistent: z14.object({
|
|
6613
|
+
namespace: z14.string()
|
|
6468
6614
|
}).optional()
|
|
6469
6615
|
});
|
|
6470
|
-
var MemoryScopeSchema =
|
|
6471
|
-
threadId:
|
|
6472
|
-
participantId:
|
|
6473
|
-
agentId:
|
|
6474
|
-
workplaceId:
|
|
6475
|
-
namespace:
|
|
6476
|
-
});
|
|
6477
|
-
var MemoryQueryOptionsSchema =
|
|
6478
|
-
types:
|
|
6479
|
-
keys:
|
|
6480
|
-
limit:
|
|
6481
|
-
includeExpired:
|
|
6482
|
-
});
|
|
6483
|
-
var ConversationSummarySchema =
|
|
6484
|
-
summary:
|
|
6485
|
-
keyPoints:
|
|
6486
|
-
entities:
|
|
6487
|
-
name:
|
|
6488
|
-
type:
|
|
6489
|
-
relevance:
|
|
6616
|
+
var MemoryScopeSchema = z14.object({
|
|
6617
|
+
threadId: z14.string().optional(),
|
|
6618
|
+
participantId: z14.string().optional(),
|
|
6619
|
+
agentId: z14.string().optional(),
|
|
6620
|
+
workplaceId: z14.string().optional(),
|
|
6621
|
+
namespace: z14.string().optional()
|
|
6622
|
+
});
|
|
6623
|
+
var MemoryQueryOptionsSchema = z14.object({
|
|
6624
|
+
types: z14.array(MemoryEntryTypeSchema).optional(),
|
|
6625
|
+
keys: z14.array(z14.string()).optional(),
|
|
6626
|
+
limit: z14.number().default(100),
|
|
6627
|
+
includeExpired: z14.boolean().default(false)
|
|
6628
|
+
});
|
|
6629
|
+
var ConversationSummarySchema = z14.object({
|
|
6630
|
+
summary: z14.string(),
|
|
6631
|
+
keyPoints: z14.array(z14.string()),
|
|
6632
|
+
entities: z14.array(z14.object({
|
|
6633
|
+
name: z14.string(),
|
|
6634
|
+
type: z14.string(),
|
|
6635
|
+
relevance: z14.number()
|
|
6490
6636
|
})),
|
|
6491
|
-
lastMessageId:
|
|
6492
|
-
messageCount:
|
|
6493
|
-
tokenCount:
|
|
6494
|
-
createdAt:
|
|
6495
|
-
});
|
|
6496
|
-
var AgentObservationSchema =
|
|
6497
|
-
observation:
|
|
6498
|
-
confidence:
|
|
6499
|
-
source:
|
|
6500
|
-
context:
|
|
6501
|
-
createdAt:
|
|
6502
|
-
});
|
|
6503
|
-
var ExternalDataCacheSchema =
|
|
6504
|
-
source:
|
|
6505
|
-
endpoint:
|
|
6506
|
-
data:
|
|
6507
|
-
fetchedAt:
|
|
6508
|
-
expiresAt:
|
|
6509
|
-
metadata:
|
|
6637
|
+
lastMessageId: z14.string().optional(),
|
|
6638
|
+
messageCount: z14.number(),
|
|
6639
|
+
tokenCount: z14.number(),
|
|
6640
|
+
createdAt: z14.string().datetime()
|
|
6641
|
+
});
|
|
6642
|
+
var AgentObservationSchema = z14.object({
|
|
6643
|
+
observation: z14.string(),
|
|
6644
|
+
confidence: z14.number().min(0).max(1),
|
|
6645
|
+
source: z14.enum(["inference", "explicit", "tool_result"]),
|
|
6646
|
+
context: z14.record(z14.string(), z14.unknown()).optional(),
|
|
6647
|
+
createdAt: z14.string().datetime()
|
|
6648
|
+
});
|
|
6649
|
+
var ExternalDataCacheSchema = z14.object({
|
|
6650
|
+
source: z14.string(),
|
|
6651
|
+
endpoint: z14.string().optional(),
|
|
6652
|
+
data: z14.unknown(),
|
|
6653
|
+
fetchedAt: z14.string().datetime(),
|
|
6654
|
+
expiresAt: z14.string().datetime().optional(),
|
|
6655
|
+
metadata: z14.record(z14.string(), z14.unknown()).optional()
|
|
6510
6656
|
});
|
|
6511
6657
|
|
|
6512
6658
|
// src/memory/service.ts
|
|
@@ -7097,16 +7243,16 @@ function estimateTokens(agent, skills) {
|
|
|
7097
7243
|
}
|
|
7098
7244
|
|
|
7099
7245
|
// src/scheduling/types.ts
|
|
7100
|
-
import { z as
|
|
7101
|
-
var TimeStampSchema =
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
hour:
|
|
7105
|
-
minute:
|
|
7106
|
-
second:
|
|
7246
|
+
import { z as z15 } from "zod/v4";
|
|
7247
|
+
var TimeStampSchema = z15.union([
|
|
7248
|
+
z15.number().describe("Hour of day (0-23)"),
|
|
7249
|
+
z15.object({
|
|
7250
|
+
hour: z15.number(),
|
|
7251
|
+
minute: z15.number().optional().default(0),
|
|
7252
|
+
second: z15.number().optional().default(0)
|
|
7107
7253
|
})
|
|
7108
7254
|
]);
|
|
7109
|
-
var DayOfWeekSchema =
|
|
7255
|
+
var DayOfWeekSchema = z15.enum([
|
|
7110
7256
|
"monday",
|
|
7111
7257
|
"tuesday",
|
|
7112
7258
|
"wednesday",
|
|
@@ -7115,13 +7261,13 @@ var DayOfWeekSchema = z14.enum([
|
|
|
7115
7261
|
"saturday",
|
|
7116
7262
|
"sunday"
|
|
7117
7263
|
]);
|
|
7118
|
-
var TimeWindowSlotSchema =
|
|
7264
|
+
var TimeWindowSlotSchema = z15.object({
|
|
7119
7265
|
startTime: TimeStampSchema,
|
|
7120
7266
|
endTime: TimeStampSchema,
|
|
7121
|
-
days:
|
|
7122
|
-
timezone:
|
|
7267
|
+
days: z15.array(DayOfWeekSchema),
|
|
7268
|
+
timezone: z15.string().optional()
|
|
7123
7269
|
});
|
|
7124
|
-
var WaitUnitSchema =
|
|
7270
|
+
var WaitUnitSchema = z15.enum([
|
|
7125
7271
|
"second",
|
|
7126
7272
|
"seconds",
|
|
7127
7273
|
"minute",
|
|
@@ -7137,17 +7283,17 @@ var WaitUnitSchema = z14.enum([
|
|
|
7137
7283
|
"year",
|
|
7138
7284
|
"years"
|
|
7139
7285
|
]);
|
|
7140
|
-
var WaitInputRelativeSchema =
|
|
7141
|
-
mode:
|
|
7142
|
-
amount:
|
|
7286
|
+
var WaitInputRelativeSchema = z15.object({
|
|
7287
|
+
mode: z15.literal("relative"),
|
|
7288
|
+
amount: z15.number(),
|
|
7143
7289
|
unit: WaitUnitSchema,
|
|
7144
|
-
windows:
|
|
7290
|
+
windows: z15.array(TimeWindowSlotSchema).optional()
|
|
7145
7291
|
});
|
|
7146
|
-
var WaitInputAbsoluteSchema =
|
|
7147
|
-
mode:
|
|
7148
|
-
scheduleAt:
|
|
7292
|
+
var WaitInputAbsoluteSchema = z15.object({
|
|
7293
|
+
mode: z15.literal("absolute"),
|
|
7294
|
+
scheduleAt: z15.union([z15.string(), z15.number()])
|
|
7149
7295
|
});
|
|
7150
|
-
var WaitInputSchema =
|
|
7296
|
+
var WaitInputSchema = z15.union([
|
|
7151
7297
|
WaitInputRelativeSchema,
|
|
7152
7298
|
WaitInputAbsoluteSchema
|
|
7153
7299
|
]);
|
|
@@ -7457,8 +7603,62 @@ function isTimeInPolicy(date, policy) {
|
|
|
7457
7603
|
return false;
|
|
7458
7604
|
}
|
|
7459
7605
|
|
|
7606
|
+
// src/tools/sms/gsm7.ts
|
|
7607
|
+
var GSM7_BASIC = `@\xA3$\xA5\xE8\xE9\xF9\xEC\xF2\xC7
|
|
7608
|
+
\xD8\xF8\r\xC5\xE5\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039E\xC6\xE6\xDF\xC9 !"#\xA4%&'()*+,-./0123456789:;<=>?\xA1ABCDEFGHIJKLMNOPQRSTUVWXYZ\xC4\xD6\xD1\xDC\xA7\xBFabcdefghijklmnopqrstuvwxyz\xE4\xF6\xF1\xFC\xE0`;
|
|
7609
|
+
var GSM7_EXTENDED = "^{}\\[~]|\u20AC";
|
|
7610
|
+
var GSM7_BASIC_SET = new Set(GSM7_BASIC.split(""));
|
|
7611
|
+
var GSM7_EXTENDED_SET = new Set(GSM7_EXTENDED.split(""));
|
|
7612
|
+
function toGsm7(value) {
|
|
7613
|
+
if (value === null || value === void 0) {
|
|
7614
|
+
return "";
|
|
7615
|
+
}
|
|
7616
|
+
const str = String(value);
|
|
7617
|
+
let result = "";
|
|
7618
|
+
for (const char of str) {
|
|
7619
|
+
if (GSM7_BASIC_SET.has(char) || GSM7_EXTENDED_SET.has(char)) {
|
|
7620
|
+
result += char;
|
|
7621
|
+
}
|
|
7622
|
+
}
|
|
7623
|
+
return result;
|
|
7624
|
+
}
|
|
7625
|
+
function isGsm7Character(char) {
|
|
7626
|
+
return GSM7_BASIC_SET.has(char) || GSM7_EXTENDED_SET.has(char);
|
|
7627
|
+
}
|
|
7628
|
+
function countGsm7Septets(text) {
|
|
7629
|
+
let septets = 0;
|
|
7630
|
+
for (const char of text) {
|
|
7631
|
+
septets += GSM7_EXTENDED_SET.has(char) ? 2 : 1;
|
|
7632
|
+
}
|
|
7633
|
+
return septets;
|
|
7634
|
+
}
|
|
7635
|
+
function estimateSmsSegments(text) {
|
|
7636
|
+
const normalized = text ?? "";
|
|
7637
|
+
const characters = [...normalized].length;
|
|
7638
|
+
if (characters === 0) {
|
|
7639
|
+
return { encoding: "GSM-7", characters: 0, septets: 0, segments: 0 };
|
|
7640
|
+
}
|
|
7641
|
+
const isGsm7 = [...normalized].every(isGsm7Character);
|
|
7642
|
+
if (isGsm7) {
|
|
7643
|
+
const septets = countGsm7Septets(normalized);
|
|
7644
|
+
const segments2 = septets <= 160 ? 1 : Math.ceil(septets / 153);
|
|
7645
|
+
return {
|
|
7646
|
+
encoding: "GSM-7",
|
|
7647
|
+
characters,
|
|
7648
|
+
septets,
|
|
7649
|
+
segments: segments2
|
|
7650
|
+
};
|
|
7651
|
+
}
|
|
7652
|
+
const segments = characters <= 70 ? 1 : Math.ceil(characters / 67);
|
|
7653
|
+
return {
|
|
7654
|
+
encoding: "UCS-2",
|
|
7655
|
+
characters,
|
|
7656
|
+
segments
|
|
7657
|
+
};
|
|
7658
|
+
}
|
|
7659
|
+
|
|
7460
7660
|
// src/index.ts
|
|
7461
|
-
var src_default = { z:
|
|
7661
|
+
var src_default = { z: z16 };
|
|
7462
7662
|
export {
|
|
7463
7663
|
AgentContextSchema,
|
|
7464
7664
|
AgentDefinitionSchema,
|
|
@@ -7514,6 +7714,7 @@ export {
|
|
|
7514
7714
|
EnvSchemaSchema,
|
|
7515
7715
|
EnvVariableDefinitionSchema,
|
|
7516
7716
|
EnvVisibilitySchema,
|
|
7717
|
+
EstimationSchema,
|
|
7517
7718
|
EventConditionsSchema,
|
|
7518
7719
|
EventSubscriptionSchema,
|
|
7519
7720
|
EventTypeSchema,
|
|
@@ -7555,6 +7756,9 @@ export {
|
|
|
7555
7756
|
MemoryQueryOptionsSchema,
|
|
7556
7757
|
MemoryScopeSchema,
|
|
7557
7758
|
MemoryService,
|
|
7759
|
+
MessageBulkRecipientSchema,
|
|
7760
|
+
MessageBulkSendInputSchema,
|
|
7761
|
+
MessageBulkSendOutputSchema,
|
|
7558
7762
|
MessageEventPayloadSchema,
|
|
7559
7763
|
MessageSendAttachmentSchema,
|
|
7560
7764
|
MessageSendChannelSchema,
|
|
@@ -7573,6 +7777,7 @@ export {
|
|
|
7573
7777
|
ModelDependencySchema,
|
|
7574
7778
|
ModelFieldDefinitionSchema,
|
|
7575
7779
|
ModelMapperBlockDefinitionSchema,
|
|
7780
|
+
MoneyMinorRangeSchema,
|
|
7576
7781
|
NavigationBreadcrumbSchema,
|
|
7577
7782
|
NavigationConfigSchema,
|
|
7578
7783
|
NavigationItemSchema,
|
|
@@ -7676,15 +7881,18 @@ export {
|
|
|
7676
7881
|
communicationChannel,
|
|
7677
7882
|
compileAgent,
|
|
7678
7883
|
compileWorkflow,
|
|
7884
|
+
computeSkewedExpectedMinorUnits,
|
|
7679
7885
|
configure,
|
|
7680
7886
|
createAuthError,
|
|
7681
7887
|
createConflictError,
|
|
7682
7888
|
createContextLogger,
|
|
7683
7889
|
createErrorResponse,
|
|
7890
|
+
createEstimation,
|
|
7684
7891
|
createExternalError,
|
|
7685
7892
|
createInMemoryService,
|
|
7686
7893
|
createInstanceClient,
|
|
7687
7894
|
createListResponse,
|
|
7895
|
+
createMoneyMinorRange,
|
|
7688
7896
|
createNotFoundError,
|
|
7689
7897
|
createPermissionError,
|
|
7690
7898
|
createQueueHandle,
|
|
@@ -7710,11 +7918,14 @@ export {
|
|
|
7710
7918
|
defineSkill,
|
|
7711
7919
|
defineWorkflow,
|
|
7712
7920
|
defineWorkflowYAML,
|
|
7921
|
+
estimateSmsSegments,
|
|
7713
7922
|
evaluateCondition,
|
|
7714
7923
|
evaluateTemplate,
|
|
7715
7924
|
event,
|
|
7716
7925
|
file,
|
|
7717
7926
|
formatContextForPrompt,
|
|
7927
|
+
formatMoneyMinorEstimate,
|
|
7928
|
+
formatMoneyMinorRange,
|
|
7718
7929
|
formatSkillInstructions,
|
|
7719
7930
|
getAllEnvKeys,
|
|
7720
7931
|
getAssociationByModel,
|
|
@@ -7740,6 +7951,7 @@ export {
|
|
|
7740
7951
|
isWorkflowDependency,
|
|
7741
7952
|
matchesTrigger,
|
|
7742
7953
|
parseCRMSchema,
|
|
7954
|
+
parseEstimationFromBilling,
|
|
7743
7955
|
queuedFetch,
|
|
7744
7956
|
queuedFetchResponse,
|
|
7745
7957
|
registerQueueConfig,
|
|
@@ -7753,11 +7965,12 @@ export {
|
|
|
7753
7965
|
safeParseCRMSchema,
|
|
7754
7966
|
safeParseConfig,
|
|
7755
7967
|
server,
|
|
7968
|
+
toGsm7,
|
|
7756
7969
|
token,
|
|
7757
7970
|
validateCRMSchema,
|
|
7758
7971
|
validateSkillYAML,
|
|
7759
7972
|
validateWorkflowYAML,
|
|
7760
7973
|
webhook,
|
|
7761
7974
|
workplace,
|
|
7762
|
-
|
|
7975
|
+
z16 as z
|
|
7763
7976
|
};
|