skedyul 1.5.2 → 1.5.12
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 +16 -0
- package/dist/dedicated/server.js +16 -6
- package/dist/esm/index.mjs +1358 -1090
- package/dist/estimation/index.d.ts +2 -0
- package/dist/estimation/index.js +151 -0
- package/dist/estimation/index.mjs +116 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +1377 -1090
- package/dist/ratelimit/context.d.ts +4 -2
- package/dist/schemas.d.ts +143 -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 +95 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/tool.d.ts +27 -2
- package/package.json +9 -3
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ __export(index_exports, {
|
|
|
58
58
|
CRMSchemaZ: () => CRMSchemaZ,
|
|
59
59
|
CardBlockDefinitionSchema: () => CardBlockDefinitionSchema,
|
|
60
60
|
CardBlockHeaderSchema: () => CardBlockHeaderSchema,
|
|
61
|
+
ChannelBatchCapabilitySchema: () => ChannelBatchCapabilitySchema,
|
|
61
62
|
ChannelCapabilitySchema: () => ChannelCapabilitySchema,
|
|
62
63
|
ChannelCapabilityTypeSchema: () => ChannelCapabilityTypeSchema,
|
|
63
64
|
ChannelDefinitionSchema: () => ChannelDefinitionSchema,
|
|
@@ -84,6 +85,8 @@ __export(index_exports, {
|
|
|
84
85
|
EnvSchemaSchema: () => EnvSchemaSchema,
|
|
85
86
|
EnvVariableDefinitionSchema: () => EnvVariableDefinitionSchema,
|
|
86
87
|
EnvVisibilitySchema: () => EnvVisibilitySchema,
|
|
88
|
+
EstimationSchema: () => EstimationSchema,
|
|
89
|
+
EstimationSkippedBreakdownSchema: () => EstimationSkippedBreakdownSchema,
|
|
87
90
|
EventConditionsSchema: () => EventConditionsSchema,
|
|
88
91
|
EventSubscriptionSchema: () => EventSubscriptionSchema,
|
|
89
92
|
EventTypeSchema: () => EventTypeSchema,
|
|
@@ -125,6 +128,13 @@ __export(index_exports, {
|
|
|
125
128
|
MemoryQueryOptionsSchema: () => MemoryQueryOptionsSchema,
|
|
126
129
|
MemoryScopeSchema: () => MemoryScopeSchema,
|
|
127
130
|
MemoryService: () => MemoryService,
|
|
131
|
+
MessageBulkRecipientSchema: () => MessageBulkRecipientSchema,
|
|
132
|
+
MessageBulkSendInputSchema: () => MessageBulkSendInputSchema,
|
|
133
|
+
MessageBulkSendOutputSchema: () => MessageBulkSendOutputSchema,
|
|
134
|
+
MessageBulkStatusInputSchema: () => MessageBulkStatusInputSchema,
|
|
135
|
+
MessageBulkStatusMessageSchema: () => MessageBulkStatusMessageSchema,
|
|
136
|
+
MessageBulkStatusOutputSchema: () => MessageBulkStatusOutputSchema,
|
|
137
|
+
MessageBulkStatusStatsSchema: () => MessageBulkStatusStatsSchema,
|
|
128
138
|
MessageEventPayloadSchema: () => MessageEventPayloadSchema,
|
|
129
139
|
MessageSendAttachmentSchema: () => MessageSendAttachmentSchema,
|
|
130
140
|
MessageSendChannelSchema: () => MessageSendChannelSchema,
|
|
@@ -143,6 +153,7 @@ __export(index_exports, {
|
|
|
143
153
|
ModelDependencySchema: () => ModelDependencySchema,
|
|
144
154
|
ModelFieldDefinitionSchema: () => ModelFieldDefinitionSchema,
|
|
145
155
|
ModelMapperBlockDefinitionSchema: () => ModelMapperBlockDefinitionSchema,
|
|
156
|
+
MoneyMinorRangeSchema: () => MoneyMinorRangeSchema,
|
|
146
157
|
NavigationBreadcrumbSchema: () => NavigationBreadcrumbSchema,
|
|
147
158
|
NavigationConfigSchema: () => NavigationConfigSchema,
|
|
148
159
|
NavigationItemSchema: () => NavigationItemSchema,
|
|
@@ -246,15 +257,18 @@ __export(index_exports, {
|
|
|
246
257
|
communicationChannel: () => communicationChannel,
|
|
247
258
|
compileAgent: () => compileAgent,
|
|
248
259
|
compileWorkflow: () => compileWorkflow,
|
|
260
|
+
computeSkewedExpectedMinorUnits: () => computeSkewedExpectedMinorUnits,
|
|
249
261
|
configure: () => configure,
|
|
250
262
|
createAuthError: () => createAuthError,
|
|
251
263
|
createConflictError: () => createConflictError,
|
|
252
264
|
createContextLogger: () => createContextLogger,
|
|
253
265
|
createErrorResponse: () => createErrorResponse,
|
|
266
|
+
createEstimation: () => createEstimation,
|
|
254
267
|
createExternalError: () => createExternalError,
|
|
255
268
|
createInMemoryService: () => createInMemoryService,
|
|
256
269
|
createInstanceClient: () => createInstanceClient,
|
|
257
270
|
createListResponse: () => createListResponse,
|
|
271
|
+
createMoneyMinorRange: () => createMoneyMinorRange,
|
|
258
272
|
createNotFoundError: () => createNotFoundError,
|
|
259
273
|
createPermissionError: () => createPermissionError,
|
|
260
274
|
createQueueHandle: () => createQueueHandle,
|
|
@@ -280,11 +294,14 @@ __export(index_exports, {
|
|
|
280
294
|
defineSkill: () => defineSkill,
|
|
281
295
|
defineWorkflow: () => defineWorkflow,
|
|
282
296
|
defineWorkflowYAML: () => defineWorkflowYAML,
|
|
297
|
+
estimateSmsSegments: () => estimateSmsSegments,
|
|
283
298
|
evaluateCondition: () => evaluateCondition,
|
|
284
299
|
evaluateTemplate: () => evaluateTemplate,
|
|
285
300
|
event: () => event,
|
|
286
301
|
file: () => file,
|
|
287
302
|
formatContextForPrompt: () => formatContextForPrompt,
|
|
303
|
+
formatMoneyMinorEstimate: () => formatMoneyMinorEstimate,
|
|
304
|
+
formatMoneyMinorRange: () => formatMoneyMinorRange,
|
|
288
305
|
formatSkillInstructions: () => formatSkillInstructions,
|
|
289
306
|
getAllEnvKeys: () => getAllEnvKeys,
|
|
290
307
|
getAssociationByModel: () => getAssociationByModel,
|
|
@@ -310,6 +327,7 @@ __export(index_exports, {
|
|
|
310
327
|
isWorkflowDependency: () => isWorkflowDependency,
|
|
311
328
|
matchesTrigger: () => matchesTrigger,
|
|
312
329
|
parseCRMSchema: () => parseCRMSchema,
|
|
330
|
+
parseEstimationFromBilling: () => parseEstimationFromBilling,
|
|
313
331
|
queuedFetch: () => queuedFetch,
|
|
314
332
|
queuedFetchResponse: () => queuedFetchResponse,
|
|
315
333
|
registerQueueConfig: () => registerQueueConfig,
|
|
@@ -323,16 +341,17 @@ __export(index_exports, {
|
|
|
323
341
|
safeParseCRMSchema: () => safeParseCRMSchema,
|
|
324
342
|
safeParseConfig: () => safeParseConfig,
|
|
325
343
|
server: () => server,
|
|
344
|
+
toGsm7: () => toGsm7,
|
|
326
345
|
token: () => token,
|
|
327
346
|
validateCRMSchema: () => validateCRMSchema,
|
|
328
347
|
validateSkillYAML: () => validateSkillYAML,
|
|
329
348
|
validateWorkflowYAML: () => validateWorkflowYAML,
|
|
330
349
|
webhook: () => webhook,
|
|
331
350
|
workplace: () => workplace,
|
|
332
|
-
z: () =>
|
|
351
|
+
z: () => import_v414.z
|
|
333
352
|
});
|
|
334
353
|
module.exports = __toCommonJS(index_exports);
|
|
335
|
-
var
|
|
354
|
+
var import_v414 = require("zod/v4");
|
|
336
355
|
|
|
337
356
|
// src/types/invocation.ts
|
|
338
357
|
function createToolCallContext(params) {
|
|
@@ -387,12 +406,118 @@ function isCronContext(ctx) {
|
|
|
387
406
|
return ctx.trigger === "cron";
|
|
388
407
|
}
|
|
389
408
|
|
|
390
|
-
// src/types/
|
|
409
|
+
// src/types/estimation.ts
|
|
391
410
|
var import_v4 = require("zod/v4");
|
|
392
|
-
var
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
411
|
+
var MoneyMinorRangeSchema = import_v4.z.object({
|
|
412
|
+
currency: import_v4.z.string().min(3).max(3),
|
|
413
|
+
minorUnitsLow: import_v4.z.number().int().nonnegative(),
|
|
414
|
+
minorUnitsHigh: import_v4.z.number().int().nonnegative(),
|
|
415
|
+
minorUnitsExpected: import_v4.z.number().int().nonnegative().optional()
|
|
416
|
+
});
|
|
417
|
+
var EstimationSkippedBreakdownSchema = import_v4.z.object({
|
|
418
|
+
missingAddress: import_v4.z.number().int().nonnegative(),
|
|
419
|
+
optOut: import_v4.z.number().int().nonnegative(),
|
|
420
|
+
emptyMessage: import_v4.z.number().int().nonnegative(),
|
|
421
|
+
unavailable: import_v4.z.number().int().nonnegative()
|
|
422
|
+
});
|
|
423
|
+
var EstimationSchema = import_v4.z.object({
|
|
424
|
+
deliverableCount: import_v4.z.number().int().nonnegative(),
|
|
425
|
+
skippedCount: import_v4.z.number().int().nonnegative().optional(),
|
|
426
|
+
skippedBreakdown: EstimationSkippedBreakdownSchema.optional(),
|
|
427
|
+
cost: MoneyMinorRangeSchema.optional()
|
|
428
|
+
});
|
|
429
|
+
function createMoneyMinorRange(params) {
|
|
430
|
+
return {
|
|
431
|
+
currency: params.currency,
|
|
432
|
+
minorUnitsLow: params.minorUnitsLow,
|
|
433
|
+
minorUnitsHigh: params.minorUnitsHigh,
|
|
434
|
+
...params.minorUnitsExpected !== void 0 ? { minorUnitsExpected: params.minorUnitsExpected } : {}
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function createEstimation(params) {
|
|
438
|
+
return {
|
|
439
|
+
deliverableCount: params.deliverableCount,
|
|
440
|
+
...params.skippedCount !== void 0 ? { skippedCount: params.skippedCount } : {},
|
|
441
|
+
...params.skippedBreakdown ? { skippedBreakdown: params.skippedBreakdown } : {},
|
|
442
|
+
...params.cost ? { cost: params.cost } : {}
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
function computeSkewedExpectedMinorUnits(range) {
|
|
446
|
+
if (range.minorUnitsExpected !== void 0) {
|
|
447
|
+
return range.minorUnitsExpected;
|
|
448
|
+
}
|
|
449
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
450
|
+
return range.minorUnitsLow;
|
|
451
|
+
}
|
|
452
|
+
return Math.round(0.8 * range.minorUnitsLow + 0.2 * range.minorUnitsHigh);
|
|
453
|
+
}
|
|
454
|
+
function formatMoneyMinorRange(range, locale) {
|
|
455
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
456
|
+
style: "currency",
|
|
457
|
+
currency: range.currency
|
|
458
|
+
});
|
|
459
|
+
const low = formatter.format(range.minorUnitsLow / 100);
|
|
460
|
+
const high = formatter.format(range.minorUnitsHigh / 100);
|
|
461
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
462
|
+
return low;
|
|
463
|
+
}
|
|
464
|
+
return `${low} \u2013 ${high}`;
|
|
465
|
+
}
|
|
466
|
+
function formatMoneyMinorEstimate(range, options) {
|
|
467
|
+
const formatter = new Intl.NumberFormat(options?.locale, {
|
|
468
|
+
style: "currency",
|
|
469
|
+
currency: range.currency
|
|
470
|
+
});
|
|
471
|
+
const maxSpreadRatio = options?.maxSpreadRatio ?? 4;
|
|
472
|
+
const spreadRatio = range.minorUnitsLow > 0 ? range.minorUnitsHigh / range.minorUnitsLow : 1;
|
|
473
|
+
if (spreadRatio > maxSpreadRatio) {
|
|
474
|
+
return formatMoneyMinorRange(range, options?.locale);
|
|
475
|
+
}
|
|
476
|
+
const expectedMinorUnits = options?.expectedMinorUnits ?? computeSkewedExpectedMinorUnits(range);
|
|
477
|
+
const expected = formatter.format(expectedMinorUnits / 100);
|
|
478
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
479
|
+
return expected;
|
|
480
|
+
}
|
|
481
|
+
return `~${expected}`;
|
|
482
|
+
}
|
|
483
|
+
function parseEstimationFromBilling(billing) {
|
|
484
|
+
if (!billing || typeof billing !== "object") {
|
|
485
|
+
return void 0;
|
|
486
|
+
}
|
|
487
|
+
const record2 = billing;
|
|
488
|
+
const nested = record2.estimation;
|
|
489
|
+
if (nested && typeof nested === "object") {
|
|
490
|
+
const parsed = EstimationSchema.safeParse(nested);
|
|
491
|
+
if (parsed.success) {
|
|
492
|
+
return parsed.data;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const currency = typeof record2.currency === "string" && record2.currency.trim() !== "" ? record2.currency : void 0;
|
|
496
|
+
const minorUnitsLow = typeof record2.minorUnitsLow === "number" ? record2.minorUnitsLow : typeof record2.costCentsLow === "number" ? record2.costCentsLow : void 0;
|
|
497
|
+
const minorUnitsHigh = typeof record2.minorUnitsHigh === "number" ? record2.minorUnitsHigh : typeof record2.costCentsHigh === "number" ? record2.costCentsHigh : void 0;
|
|
498
|
+
const minorUnitsExpected = typeof record2.minorUnitsExpected === "number" ? record2.minorUnitsExpected : typeof record2.costCentsExpected === "number" ? record2.costCentsExpected : void 0;
|
|
499
|
+
const deliverableCount = typeof record2.deliverableCount === "number" ? record2.deliverableCount : void 0;
|
|
500
|
+
if (deliverableCount === void 0 || minorUnitsLow === void 0 || minorUnitsHigh === void 0 || !currency) {
|
|
501
|
+
return void 0;
|
|
502
|
+
}
|
|
503
|
+
return createEstimation({
|
|
504
|
+
deliverableCount,
|
|
505
|
+
skippedCount: typeof record2.skippedCount === "number" ? record2.skippedCount : void 0,
|
|
506
|
+
cost: createMoneyMinorRange({
|
|
507
|
+
currency,
|
|
508
|
+
minorUnitsLow,
|
|
509
|
+
minorUnitsHigh,
|
|
510
|
+
...minorUnitsExpected !== void 0 ? { minorUnitsExpected } : {}
|
|
511
|
+
})
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// src/types/tool.ts
|
|
516
|
+
var import_v42 = require("zod/v4");
|
|
517
|
+
var ToolResponseMetaSchema = import_v42.z.object({
|
|
518
|
+
success: import_v42.z.boolean(),
|
|
519
|
+
message: import_v42.z.string(),
|
|
520
|
+
toolName: import_v42.z.string()
|
|
396
521
|
});
|
|
397
522
|
|
|
398
523
|
// src/types/tool-response.ts
|
|
@@ -533,11 +658,11 @@ function isRuntimeWebhookContext(ctx) {
|
|
|
533
658
|
}
|
|
534
659
|
|
|
535
660
|
// src/schemas.ts
|
|
536
|
-
var
|
|
661
|
+
var import_v48 = require("zod/v4");
|
|
537
662
|
|
|
538
663
|
// src/schemas/crm-schema.ts
|
|
539
|
-
var
|
|
540
|
-
var CRMFieldTypeSchema =
|
|
664
|
+
var import_v43 = require("zod/v4");
|
|
665
|
+
var CRMFieldTypeSchema = import_v43.z.enum([
|
|
541
666
|
"string",
|
|
542
667
|
"long_string",
|
|
543
668
|
"number",
|
|
@@ -549,125 +674,125 @@ var CRMFieldTypeSchema = import_v42.z.enum([
|
|
|
549
674
|
"image",
|
|
550
675
|
"object"
|
|
551
676
|
]);
|
|
552
|
-
var CRMFieldRequirementSchema =
|
|
677
|
+
var CRMFieldRequirementSchema = import_v43.z.enum([
|
|
553
678
|
"optional",
|
|
554
679
|
"on_create",
|
|
555
680
|
"required"
|
|
556
681
|
]);
|
|
557
|
-
var CRMFieldOptionSchema =
|
|
558
|
-
label:
|
|
559
|
-
value:
|
|
560
|
-
color:
|
|
561
|
-
});
|
|
562
|
-
var CRMFieldDefinitionObjectSchema =
|
|
563
|
-
options:
|
|
564
|
-
limitChoices:
|
|
565
|
-
minLength:
|
|
566
|
-
maxLength:
|
|
567
|
-
min:
|
|
568
|
-
max:
|
|
569
|
-
pattern:
|
|
570
|
-
});
|
|
571
|
-
var CRMFieldDefinitionSchema =
|
|
572
|
-
|
|
682
|
+
var CRMFieldOptionSchema = import_v43.z.object({
|
|
683
|
+
label: import_v43.z.string(),
|
|
684
|
+
value: import_v43.z.string(),
|
|
685
|
+
color: import_v43.z.string().optional()
|
|
686
|
+
});
|
|
687
|
+
var CRMFieldDefinitionObjectSchema = import_v43.z.object({
|
|
688
|
+
options: import_v43.z.array(CRMFieldOptionSchema).optional(),
|
|
689
|
+
limitChoices: import_v43.z.number().optional(),
|
|
690
|
+
minLength: import_v43.z.number().optional(),
|
|
691
|
+
maxLength: import_v43.z.number().optional(),
|
|
692
|
+
min: import_v43.z.number().optional(),
|
|
693
|
+
max: import_v43.z.number().optional(),
|
|
694
|
+
pattern: import_v43.z.string().optional()
|
|
695
|
+
});
|
|
696
|
+
var CRMFieldDefinitionSchema = import_v43.z.union([
|
|
697
|
+
import_v43.z.string(),
|
|
573
698
|
CRMFieldDefinitionObjectSchema
|
|
574
699
|
]);
|
|
575
|
-
var CRMFieldAppearanceSchemaZ =
|
|
576
|
-
leftIcon:
|
|
577
|
-
rightIcon:
|
|
578
|
-
placeholder:
|
|
579
|
-
helpText:
|
|
580
|
-
});
|
|
581
|
-
var CRMFieldSchemaZ =
|
|
582
|
-
handle:
|
|
583
|
-
label:
|
|
700
|
+
var CRMFieldAppearanceSchemaZ = import_v43.z.object({
|
|
701
|
+
leftIcon: import_v43.z.string().optional(),
|
|
702
|
+
rightIcon: import_v43.z.string().optional(),
|
|
703
|
+
placeholder: import_v43.z.string().optional(),
|
|
704
|
+
helpText: import_v43.z.string().optional()
|
|
705
|
+
});
|
|
706
|
+
var CRMFieldSchemaZ = import_v43.z.object({
|
|
707
|
+
handle: import_v43.z.string().regex(/^[a-z][a-z0-9_]*$/, "Handle must be lowercase alphanumeric with underscores, starting with a letter"),
|
|
708
|
+
label: import_v43.z.string().min(1, "Label is required"),
|
|
584
709
|
type: CRMFieldTypeSchema,
|
|
585
710
|
/** Field description - explains what the field is for (metadata, not UI) */
|
|
586
|
-
description:
|
|
711
|
+
description: import_v43.z.string().optional(),
|
|
587
712
|
/** Field appearance - UI presentation settings */
|
|
588
713
|
appearance: CRMFieldAppearanceSchemaZ.optional(),
|
|
589
714
|
requirement: CRMFieldRequirementSchema.optional(),
|
|
590
|
-
unique:
|
|
591
|
-
list:
|
|
592
|
-
default:
|
|
715
|
+
unique: import_v43.z.boolean().optional(),
|
|
716
|
+
list: import_v43.z.boolean().optional(),
|
|
717
|
+
default: import_v43.z.unknown().optional(),
|
|
593
718
|
definition: CRMFieldDefinitionSchema.optional()
|
|
594
719
|
});
|
|
595
|
-
var CRMModelSchemaZ =
|
|
596
|
-
handle:
|
|
597
|
-
name:
|
|
598
|
-
namePlural:
|
|
599
|
-
labelTemplate:
|
|
600
|
-
description:
|
|
601
|
-
icon:
|
|
602
|
-
fields:
|
|
603
|
-
});
|
|
604
|
-
var CRMCardinalitySchema =
|
|
605
|
-
var CRMOnDeleteSchema =
|
|
606
|
-
var CRMRelationshipLinkSchema =
|
|
607
|
-
model:
|
|
608
|
-
field:
|
|
609
|
-
label:
|
|
610
|
-
});
|
|
611
|
-
var CRMRelationshipSchemaZ =
|
|
720
|
+
var CRMModelSchemaZ = import_v43.z.object({
|
|
721
|
+
handle: import_v43.z.string().regex(/^[a-z][a-z0-9_]*$/, "Handle must be lowercase alphanumeric with underscores, starting with a letter"),
|
|
722
|
+
name: import_v43.z.string().min(1, "Name is required"),
|
|
723
|
+
namePlural: import_v43.z.string().optional(),
|
|
724
|
+
labelTemplate: import_v43.z.string().optional(),
|
|
725
|
+
description: import_v43.z.string().optional(),
|
|
726
|
+
icon: import_v43.z.string().optional(),
|
|
727
|
+
fields: import_v43.z.array(CRMFieldSchemaZ)
|
|
728
|
+
});
|
|
729
|
+
var CRMCardinalitySchema = import_v43.z.enum(["one_to_one", "one_to_many"]);
|
|
730
|
+
var CRMOnDeleteSchema = import_v43.z.enum(["none", "cascade", "restrict"]);
|
|
731
|
+
var CRMRelationshipLinkSchema = import_v43.z.object({
|
|
732
|
+
model: import_v43.z.string(),
|
|
733
|
+
field: import_v43.z.string(),
|
|
734
|
+
label: import_v43.z.string()
|
|
735
|
+
});
|
|
736
|
+
var CRMRelationshipSchemaZ = import_v43.z.object({
|
|
612
737
|
source: CRMRelationshipLinkSchema,
|
|
613
738
|
target: CRMRelationshipLinkSchema,
|
|
614
739
|
cardinality: CRMCardinalitySchema,
|
|
615
740
|
onDelete: CRMOnDeleteSchema.optional()
|
|
616
741
|
});
|
|
617
|
-
var CRMBlockTypeSchema =
|
|
742
|
+
var CRMBlockTypeSchema = import_v43.z.enum([
|
|
618
743
|
"spreadsheet",
|
|
619
744
|
"form",
|
|
620
745
|
"card",
|
|
621
746
|
"metric",
|
|
622
747
|
"kanban"
|
|
623
748
|
]);
|
|
624
|
-
var CRMBlockSchemaZ =
|
|
749
|
+
var CRMBlockSchemaZ = import_v43.z.object({
|
|
625
750
|
type: CRMBlockTypeSchema,
|
|
626
|
-
title:
|
|
627
|
-
config:
|
|
628
|
-
default:
|
|
751
|
+
title: import_v43.z.string().optional(),
|
|
752
|
+
config: import_v43.z.unknown().optional(),
|
|
753
|
+
default: import_v43.z.boolean().optional()
|
|
629
754
|
});
|
|
630
|
-
var CRMPageTypeSchema =
|
|
631
|
-
var CRMPageSchemaZ =
|
|
632
|
-
path:
|
|
755
|
+
var CRMPageTypeSchema = import_v43.z.enum(["list", "instance"]);
|
|
756
|
+
var CRMPageSchemaZ = import_v43.z.object({
|
|
757
|
+
path: import_v43.z.string(),
|
|
633
758
|
type: CRMPageTypeSchema,
|
|
634
|
-
title:
|
|
635
|
-
icon:
|
|
636
|
-
modelHandle:
|
|
637
|
-
parentPath:
|
|
638
|
-
baseQuery:
|
|
639
|
-
blocks:
|
|
640
|
-
});
|
|
641
|
-
var CRMNavigationNodeBaseSchemaZ =
|
|
642
|
-
label:
|
|
643
|
-
icon:
|
|
644
|
-
path:
|
|
645
|
-
kind:
|
|
646
|
-
sortIndex:
|
|
647
|
-
});
|
|
648
|
-
var CRMNavigationItemSchemaZ =
|
|
759
|
+
title: import_v43.z.string(),
|
|
760
|
+
icon: import_v43.z.string().optional(),
|
|
761
|
+
modelHandle: import_v43.z.string(),
|
|
762
|
+
parentPath: import_v43.z.string().optional(),
|
|
763
|
+
baseQuery: import_v43.z.unknown().optional(),
|
|
764
|
+
blocks: import_v43.z.array(CRMBlockSchemaZ).optional()
|
|
765
|
+
});
|
|
766
|
+
var CRMNavigationNodeBaseSchemaZ = import_v43.z.object({
|
|
767
|
+
label: import_v43.z.string(),
|
|
768
|
+
icon: import_v43.z.string().optional(),
|
|
769
|
+
path: import_v43.z.string().optional(),
|
|
770
|
+
kind: import_v43.z.enum(["section", "group"]).optional(),
|
|
771
|
+
sortIndex: import_v43.z.number().optional()
|
|
772
|
+
});
|
|
773
|
+
var CRMNavigationItemSchemaZ = import_v43.z.lazy(
|
|
649
774
|
() => CRMNavigationNodeBaseSchemaZ.extend({
|
|
650
|
-
children:
|
|
775
|
+
children: import_v43.z.array(CRMNavigationItemSchemaZ).optional()
|
|
651
776
|
})
|
|
652
777
|
);
|
|
653
|
-
var CRMNavigationSchemaZ =
|
|
654
|
-
sidebar:
|
|
778
|
+
var CRMNavigationSchemaZ = import_v43.z.object({
|
|
779
|
+
sidebar: import_v43.z.array(CRMNavigationItemSchemaZ).optional()
|
|
655
780
|
});
|
|
656
|
-
var CRMSchemaZ =
|
|
781
|
+
var CRMSchemaZ = import_v43.z.object({
|
|
657
782
|
/** Schema format version for future compatibility */
|
|
658
|
-
$schema:
|
|
783
|
+
$schema: import_v43.z.literal("https://skedyul.com/schemas/crm/v1").optional(),
|
|
659
784
|
/** Schema name for identification */
|
|
660
|
-
name:
|
|
785
|
+
name: import_v43.z.string().min(1, "Name is required"),
|
|
661
786
|
/** Optional description */
|
|
662
|
-
description:
|
|
787
|
+
description: import_v43.z.string().optional(),
|
|
663
788
|
/** Schema version (semver) */
|
|
664
|
-
version:
|
|
789
|
+
version: import_v43.z.string().optional(),
|
|
665
790
|
/** Model definitions */
|
|
666
|
-
models:
|
|
791
|
+
models: import_v43.z.array(CRMModelSchemaZ),
|
|
667
792
|
/** Relationship definitions */
|
|
668
|
-
relationships:
|
|
793
|
+
relationships: import_v43.z.array(CRMRelationshipSchemaZ).optional(),
|
|
669
794
|
/** Page definitions */
|
|
670
|
-
pages:
|
|
795
|
+
pages: import_v43.z.array(CRMPageSchemaZ).optional(),
|
|
671
796
|
/** Navigation definitions */
|
|
672
797
|
navigation: CRMNavigationSchemaZ.optional()
|
|
673
798
|
});
|
|
@@ -694,11 +819,11 @@ function safeParseCRMSchema(data) {
|
|
|
694
819
|
}
|
|
695
820
|
|
|
696
821
|
// src/schemas/agent-schema-v3.ts
|
|
697
|
-
var
|
|
822
|
+
var import_v47 = require("zod/v4");
|
|
698
823
|
|
|
699
824
|
// src/events/types.ts
|
|
700
|
-
var
|
|
701
|
-
var ThreadEventTypeSchema =
|
|
825
|
+
var import_v44 = require("zod/v4");
|
|
826
|
+
var ThreadEventTypeSchema = import_v44.z.enum([
|
|
702
827
|
// Message events
|
|
703
828
|
"thread.message.received",
|
|
704
829
|
"thread.message.sent",
|
|
@@ -720,73 +845,73 @@ var ThreadEventTypeSchema = import_v43.z.enum([
|
|
|
720
845
|
// Signal events
|
|
721
846
|
"thread.signal.created"
|
|
722
847
|
]);
|
|
723
|
-
var CustomEventTypeSchema =
|
|
848
|
+
var CustomEventTypeSchema = import_v44.z.string().regex(/^custom\.[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$/, {
|
|
724
849
|
message: "Custom event type must match pattern: custom.{namespace}.{event}"
|
|
725
850
|
});
|
|
726
|
-
var EventTypeSchema =
|
|
727
|
-
var ParticipantKindSchema =
|
|
728
|
-
var BaseEventPayloadSchema =
|
|
729
|
-
threadId:
|
|
730
|
-
workplaceId:
|
|
731
|
-
timestamp:
|
|
851
|
+
var EventTypeSchema = import_v44.z.union([ThreadEventTypeSchema, CustomEventTypeSchema]);
|
|
852
|
+
var ParticipantKindSchema = import_v44.z.enum(["CONTACT", "MEMBER", "AGENT", "WORKFLOW"]);
|
|
853
|
+
var BaseEventPayloadSchema = import_v44.z.object({
|
|
854
|
+
threadId: import_v44.z.string(),
|
|
855
|
+
workplaceId: import_v44.z.string(),
|
|
856
|
+
timestamp: import_v44.z.string().datetime().optional()
|
|
732
857
|
});
|
|
733
858
|
var MessageEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
734
|
-
message:
|
|
735
|
-
id:
|
|
736
|
-
content:
|
|
737
|
-
senderId:
|
|
859
|
+
message: import_v44.z.object({
|
|
860
|
+
id: import_v44.z.string(),
|
|
861
|
+
content: import_v44.z.string(),
|
|
862
|
+
senderId: import_v44.z.string().optional()
|
|
738
863
|
}),
|
|
739
|
-
participant:
|
|
740
|
-
id:
|
|
864
|
+
participant: import_v44.z.object({
|
|
865
|
+
id: import_v44.z.string(),
|
|
741
866
|
kind: ParticipantKindSchema,
|
|
742
|
-
displayName:
|
|
867
|
+
displayName: import_v44.z.string().optional()
|
|
743
868
|
}).optional(),
|
|
744
|
-
isFirstMessage:
|
|
745
|
-
messageCount:
|
|
869
|
+
isFirstMessage: import_v44.z.boolean().optional(),
|
|
870
|
+
messageCount: import_v44.z.number().optional()
|
|
746
871
|
});
|
|
747
872
|
var ParticipantEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
748
|
-
participant:
|
|
749
|
-
id:
|
|
873
|
+
participant: import_v44.z.object({
|
|
874
|
+
id: import_v44.z.string(),
|
|
750
875
|
kind: ParticipantKindSchema,
|
|
751
|
-
displayName:
|
|
752
|
-
contactId:
|
|
753
|
-
memberId:
|
|
754
|
-
agentId:
|
|
755
|
-
workflowId:
|
|
876
|
+
displayName: import_v44.z.string().optional(),
|
|
877
|
+
contactId: import_v44.z.string().optional(),
|
|
878
|
+
memberId: import_v44.z.string().optional(),
|
|
879
|
+
agentId: import_v44.z.string().optional(),
|
|
880
|
+
workflowId: import_v44.z.string().optional()
|
|
756
881
|
})
|
|
757
882
|
});
|
|
758
883
|
var ContextChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
759
|
-
context:
|
|
760
|
-
handle:
|
|
761
|
-
model:
|
|
762
|
-
instanceId:
|
|
884
|
+
context: import_v44.z.object({
|
|
885
|
+
handle: import_v44.z.string(),
|
|
886
|
+
model: import_v44.z.string(),
|
|
887
|
+
instanceId: import_v44.z.string()
|
|
763
888
|
}),
|
|
764
|
-
change:
|
|
765
|
-
field:
|
|
766
|
-
oldValue:
|
|
767
|
-
newValue:
|
|
889
|
+
change: import_v44.z.object({
|
|
890
|
+
field: import_v44.z.string().optional(),
|
|
891
|
+
oldValue: import_v44.z.unknown().optional(),
|
|
892
|
+
newValue: import_v44.z.unknown().optional()
|
|
768
893
|
}).optional()
|
|
769
894
|
});
|
|
770
895
|
var StatusChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
771
|
-
oldStatus:
|
|
772
|
-
newStatus:
|
|
896
|
+
oldStatus: import_v44.z.string(),
|
|
897
|
+
newStatus: import_v44.z.string()
|
|
773
898
|
});
|
|
774
899
|
var ScheduledEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
775
|
-
scheduledEventId:
|
|
776
|
-
reason:
|
|
777
|
-
context:
|
|
900
|
+
scheduledEventId: import_v44.z.string(),
|
|
901
|
+
reason: import_v44.z.string().optional(),
|
|
902
|
+
context: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).optional()
|
|
778
903
|
});
|
|
779
904
|
var AgentWorkflowEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
780
|
-
agentId:
|
|
781
|
-
workflowId:
|
|
782
|
-
workflowRunId:
|
|
783
|
-
outputs:
|
|
784
|
-
error:
|
|
905
|
+
agentId: import_v44.z.string().optional(),
|
|
906
|
+
workflowId: import_v44.z.string().optional(),
|
|
907
|
+
workflowRunId: import_v44.z.string().optional(),
|
|
908
|
+
outputs: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).optional(),
|
|
909
|
+
error: import_v44.z.string().optional()
|
|
785
910
|
});
|
|
786
911
|
var CustomEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
787
|
-
data:
|
|
912
|
+
data: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).optional()
|
|
788
913
|
});
|
|
789
|
-
var ThreadEventPayloadSchema =
|
|
914
|
+
var ThreadEventPayloadSchema = import_v44.z.union([
|
|
790
915
|
MessageEventPayloadSchema,
|
|
791
916
|
ParticipantEventPayloadSchema,
|
|
792
917
|
ContextChangedPayloadSchema,
|
|
@@ -795,164 +920,164 @@ var ThreadEventPayloadSchema = import_v43.z.union([
|
|
|
795
920
|
AgentWorkflowEventPayloadSchema,
|
|
796
921
|
CustomEventPayloadSchema
|
|
797
922
|
]);
|
|
798
|
-
var ThreadEventSchema =
|
|
799
|
-
id:
|
|
800
|
-
threadId:
|
|
923
|
+
var ThreadEventSchema = import_v44.z.object({
|
|
924
|
+
id: import_v44.z.string(),
|
|
925
|
+
threadId: import_v44.z.string(),
|
|
801
926
|
type: EventTypeSchema,
|
|
802
927
|
payload: ThreadEventPayloadSchema,
|
|
803
|
-
emittedBy:
|
|
804
|
-
createdAt:
|
|
928
|
+
emittedBy: import_v44.z.string().optional(),
|
|
929
|
+
createdAt: import_v44.z.string().datetime()
|
|
805
930
|
});
|
|
806
|
-
var CreateThreadEventInputSchema =
|
|
807
|
-
threadId:
|
|
931
|
+
var CreateThreadEventInputSchema = import_v44.z.object({
|
|
932
|
+
threadId: import_v44.z.string(),
|
|
808
933
|
type: EventTypeSchema,
|
|
809
|
-
payload:
|
|
810
|
-
emittedBy:
|
|
934
|
+
payload: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()),
|
|
935
|
+
emittedBy: import_v44.z.string().optional()
|
|
811
936
|
});
|
|
812
|
-
var EventSubscriptionSchema =
|
|
813
|
-
subscribes:
|
|
814
|
-
condition:
|
|
815
|
-
cancels:
|
|
816
|
-
cancelCondition:
|
|
937
|
+
var EventSubscriptionSchema = import_v44.z.object({
|
|
938
|
+
subscribes: import_v44.z.array(EventTypeSchema),
|
|
939
|
+
condition: import_v44.z.string().optional(),
|
|
940
|
+
cancels: import_v44.z.array(EventTypeSchema).optional(),
|
|
941
|
+
cancelCondition: import_v44.z.string().optional()
|
|
817
942
|
});
|
|
818
|
-
var EventWaitSchema =
|
|
943
|
+
var EventWaitSchema = import_v44.z.object({
|
|
819
944
|
event: EventTypeSchema,
|
|
820
|
-
timeout:
|
|
821
|
-
onTimeout:
|
|
945
|
+
timeout: import_v44.z.string().optional(),
|
|
946
|
+
onTimeout: import_v44.z.string().optional()
|
|
822
947
|
});
|
|
823
|
-
var EventsConfigSchema =
|
|
824
|
-
subscribes:
|
|
825
|
-
condition:
|
|
826
|
-
emits:
|
|
827
|
-
waits:
|
|
828
|
-
cancels:
|
|
829
|
-
cancelCondition:
|
|
948
|
+
var EventsConfigSchema = import_v44.z.object({
|
|
949
|
+
subscribes: import_v44.z.array(EventTypeSchema).optional(),
|
|
950
|
+
condition: import_v44.z.string().optional(),
|
|
951
|
+
emits: import_v44.z.array(EventTypeSchema).optional(),
|
|
952
|
+
waits: import_v44.z.array(EventWaitSchema).optional(),
|
|
953
|
+
cancels: import_v44.z.array(EventTypeSchema).optional(),
|
|
954
|
+
cancelCondition: import_v44.z.string().optional()
|
|
830
955
|
});
|
|
831
956
|
|
|
832
957
|
// src/skills/types.ts
|
|
833
|
-
var
|
|
958
|
+
var import_v45 = require("zod/v4");
|
|
834
959
|
var SKILL_SCHEMA_VERSION = "https://skedyul.com/schemas/skill/v1";
|
|
835
960
|
var SKILL_SCHEMA_VERSION_V2 = "https://skedyul.com/schemas/skill/v2";
|
|
836
|
-
var SkillSourceSchema =
|
|
837
|
-
var SkillToolRequirementSchema =
|
|
838
|
-
requires:
|
|
839
|
-
provides:
|
|
840
|
-
});
|
|
841
|
-
var SkillToolSandboxSchema =
|
|
842
|
-
mock:
|
|
843
|
-
});
|
|
844
|
-
var ToolConstraintsSchema =
|
|
845
|
-
maxCallsPerRun:
|
|
846
|
-
idempotent:
|
|
847
|
-
restricted:
|
|
848
|
-
tags:
|
|
849
|
-
});
|
|
850
|
-
var SkillToolDefinitionSchema =
|
|
851
|
-
tool:
|
|
852
|
-
description:
|
|
853
|
-
overrides:
|
|
961
|
+
var SkillSourceSchema = import_v45.z.enum(["BUILTIN", "S3", "APP", "EXTERNAL"]);
|
|
962
|
+
var SkillToolRequirementSchema = import_v45.z.object({
|
|
963
|
+
requires: import_v45.z.array(import_v45.z.string()).optional(),
|
|
964
|
+
provides: import_v45.z.array(import_v45.z.string()).optional()
|
|
965
|
+
});
|
|
966
|
+
var SkillToolSandboxSchema = import_v45.z.object({
|
|
967
|
+
mock: import_v45.z.unknown().optional()
|
|
968
|
+
});
|
|
969
|
+
var ToolConstraintsSchema = import_v45.z.object({
|
|
970
|
+
maxCallsPerRun: import_v45.z.number().optional(),
|
|
971
|
+
idempotent: import_v45.z.boolean().optional(),
|
|
972
|
+
restricted: import_v45.z.boolean().optional(),
|
|
973
|
+
tags: import_v45.z.array(import_v45.z.string()).optional()
|
|
974
|
+
});
|
|
975
|
+
var SkillToolDefinitionSchema = import_v45.z.object({
|
|
976
|
+
tool: import_v45.z.string(),
|
|
977
|
+
description: import_v45.z.string().optional(),
|
|
978
|
+
overrides: import_v45.z.record(import_v45.z.string(), import_v45.z.unknown()).optional(),
|
|
854
979
|
sandbox: SkillToolSandboxSchema.optional(),
|
|
855
|
-
requiresApproval:
|
|
980
|
+
requiresApproval: import_v45.z.boolean().optional(),
|
|
856
981
|
constraints: ToolConstraintsSchema.optional()
|
|
857
982
|
});
|
|
858
|
-
var SkillToolsSchema =
|
|
983
|
+
var SkillToolsSchema = import_v45.z.union([
|
|
859
984
|
SkillToolRequirementSchema,
|
|
860
|
-
|
|
985
|
+
import_v45.z.array(SkillToolDefinitionSchema)
|
|
861
986
|
]);
|
|
862
|
-
var SkillExampleSchema =
|
|
863
|
-
context:
|
|
864
|
-
input:
|
|
865
|
-
reasoning:
|
|
866
|
-
output:
|
|
867
|
-
tool_call:
|
|
987
|
+
var SkillExampleSchema = import_v45.z.object({
|
|
988
|
+
context: import_v45.z.string().optional(),
|
|
989
|
+
input: import_v45.z.string(),
|
|
990
|
+
reasoning: import_v45.z.string().optional(),
|
|
991
|
+
output: import_v45.z.string(),
|
|
992
|
+
tool_call: import_v45.z.string().optional()
|
|
868
993
|
});
|
|
869
|
-
var CRMModelFieldRequirementsSchema =
|
|
870
|
-
required:
|
|
871
|
-
recommended:
|
|
994
|
+
var CRMModelFieldRequirementsSchema = import_v45.z.object({
|
|
995
|
+
required: import_v45.z.array(import_v45.z.string()).optional(),
|
|
996
|
+
recommended: import_v45.z.array(import_v45.z.string()).optional()
|
|
872
997
|
});
|
|
873
|
-
var CRMContextSchema =
|
|
874
|
-
models:
|
|
998
|
+
var CRMContextSchema = import_v45.z.object({
|
|
999
|
+
models: import_v45.z.record(import_v45.z.string(), CRMModelFieldRequirementsSchema)
|
|
875
1000
|
});
|
|
876
|
-
var SkillYAMLSchema =
|
|
1001
|
+
var SkillYAMLSchema = import_v45.z.object({
|
|
877
1002
|
// Schema version
|
|
878
|
-
$schema:
|
|
1003
|
+
$schema: import_v45.z.string().optional(),
|
|
879
1004
|
// Identity
|
|
880
|
-
handle:
|
|
881
|
-
name:
|
|
882
|
-
version:
|
|
883
|
-
description:
|
|
1005
|
+
handle: import_v45.z.string(),
|
|
1006
|
+
name: import_v45.z.string(),
|
|
1007
|
+
version: import_v45.z.string().optional(),
|
|
1008
|
+
description: import_v45.z.string().optional(),
|
|
884
1009
|
// Instructions injected into agent system prompt
|
|
885
|
-
instructions:
|
|
1010
|
+
instructions: import_v45.z.string(),
|
|
886
1011
|
// Tool configuration - supports both v1 and v2 formats
|
|
887
1012
|
tools: SkillToolsSchema.optional(),
|
|
888
1013
|
// CRM context - specifies which models/fields to include in schema
|
|
889
1014
|
crmContext: CRMContextSchema.optional(),
|
|
890
1015
|
// Few-shot examples
|
|
891
|
-
examples:
|
|
892
|
-
});
|
|
893
|
-
var SkillYAMLV2Schema =
|
|
894
|
-
$schema:
|
|
895
|
-
handle:
|
|
896
|
-
name:
|
|
897
|
-
version:
|
|
898
|
-
description:
|
|
899
|
-
instructions:
|
|
900
|
-
tools:
|
|
1016
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
1017
|
+
});
|
|
1018
|
+
var SkillYAMLV2Schema = import_v45.z.object({
|
|
1019
|
+
$schema: import_v45.z.literal(SKILL_SCHEMA_VERSION_V2).optional(),
|
|
1020
|
+
handle: import_v45.z.string(),
|
|
1021
|
+
name: import_v45.z.string(),
|
|
1022
|
+
version: import_v45.z.string().optional(),
|
|
1023
|
+
description: import_v45.z.string().optional(),
|
|
1024
|
+
instructions: import_v45.z.string(),
|
|
1025
|
+
tools: import_v45.z.array(SkillToolDefinitionSchema).optional(),
|
|
901
1026
|
crmContext: CRMContextSchema.optional(),
|
|
902
|
-
examples:
|
|
1027
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
903
1028
|
});
|
|
904
|
-
var SkillVersionWeightSchema =
|
|
905
|
-
version:
|
|
906
|
-
weight:
|
|
1029
|
+
var SkillVersionWeightSchema = import_v45.z.object({
|
|
1030
|
+
version: import_v45.z.number(),
|
|
1031
|
+
weight: import_v45.z.number()
|
|
907
1032
|
});
|
|
908
|
-
var SkillRefSchema =
|
|
909
|
-
|
|
1033
|
+
var SkillRefSchema = import_v45.z.union([
|
|
1034
|
+
import_v45.z.string(),
|
|
910
1035
|
// Just handle - uses latest published version
|
|
911
|
-
|
|
912
|
-
skill:
|
|
913
|
-
description:
|
|
1036
|
+
import_v45.z.object({
|
|
1037
|
+
skill: import_v45.z.string(),
|
|
1038
|
+
description: import_v45.z.string().optional(),
|
|
914
1039
|
// For AI SDK Agent Skills discovery
|
|
915
1040
|
/** Auto-inject this skill's instructions and tools on every agent turn */
|
|
916
|
-
alwaysLoad:
|
|
1041
|
+
alwaysLoad: import_v45.z.boolean().optional(),
|
|
917
1042
|
// Version selection (pick one):
|
|
918
|
-
version:
|
|
1043
|
+
version: import_v45.z.number().optional(),
|
|
919
1044
|
// Pin to specific version number
|
|
920
|
-
versions:
|
|
1045
|
+
versions: import_v45.z.array(SkillVersionWeightSchema).optional(),
|
|
921
1046
|
// A/B testing weights
|
|
922
1047
|
// Legacy support:
|
|
923
|
-
instructions:
|
|
1048
|
+
instructions: import_v45.z.string().optional(),
|
|
924
1049
|
// Inline instructions (deprecated)
|
|
925
|
-
enabled:
|
|
1050
|
+
enabled: import_v45.z.boolean().optional()
|
|
926
1051
|
})
|
|
927
1052
|
]);
|
|
928
|
-
var SkillMetadataSchema =
|
|
929
|
-
id:
|
|
930
|
-
handle:
|
|
931
|
-
name:
|
|
932
|
-
version:
|
|
933
|
-
description:
|
|
1053
|
+
var SkillMetadataSchema = import_v45.z.object({
|
|
1054
|
+
id: import_v45.z.string(),
|
|
1055
|
+
handle: import_v45.z.string(),
|
|
1056
|
+
name: import_v45.z.string(),
|
|
1057
|
+
version: import_v45.z.string().optional(),
|
|
1058
|
+
description: import_v45.z.string().optional(),
|
|
934
1059
|
source: SkillSourceSchema,
|
|
935
|
-
s3Key:
|
|
936
|
-
appVersionId:
|
|
937
|
-
workplaceId:
|
|
938
|
-
createdAt:
|
|
939
|
-
updatedAt:
|
|
940
|
-
});
|
|
941
|
-
var ResolvedSkillSchema =
|
|
942
|
-
handle:
|
|
943
|
-
name:
|
|
944
|
-
instructions:
|
|
945
|
-
description:
|
|
946
|
-
tools:
|
|
947
|
-
examples:
|
|
948
|
-
});
|
|
949
|
-
var LoadedSkillSchema =
|
|
950
|
-
handle:
|
|
951
|
-
name:
|
|
952
|
-
instructions:
|
|
953
|
-
description:
|
|
954
|
-
tools:
|
|
955
|
-
examples:
|
|
1060
|
+
s3Key: import_v45.z.string().optional(),
|
|
1061
|
+
appVersionId: import_v45.z.string().optional(),
|
|
1062
|
+
workplaceId: import_v45.z.string().optional(),
|
|
1063
|
+
createdAt: import_v45.z.string().datetime().optional(),
|
|
1064
|
+
updatedAt: import_v45.z.string().datetime().optional()
|
|
1065
|
+
});
|
|
1066
|
+
var ResolvedSkillSchema = import_v45.z.object({
|
|
1067
|
+
handle: import_v45.z.string(),
|
|
1068
|
+
name: import_v45.z.string(),
|
|
1069
|
+
instructions: import_v45.z.string().optional(),
|
|
1070
|
+
description: import_v45.z.string().optional(),
|
|
1071
|
+
tools: import_v45.z.array(import_v45.z.string()).optional(),
|
|
1072
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
1073
|
+
});
|
|
1074
|
+
var LoadedSkillSchema = import_v45.z.object({
|
|
1075
|
+
handle: import_v45.z.string(),
|
|
1076
|
+
name: import_v45.z.string(),
|
|
1077
|
+
instructions: import_v45.z.string().optional(),
|
|
1078
|
+
description: import_v45.z.string().optional(),
|
|
1079
|
+
tools: import_v45.z.array(SkillToolDefinitionSchema).optional(),
|
|
1080
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
956
1081
|
});
|
|
957
1082
|
function isV2SkillTools(tools) {
|
|
958
1083
|
if (!tools) return false;
|
|
@@ -1008,182 +1133,182 @@ ${sections.join("\n\n---\n\n")}`;
|
|
|
1008
1133
|
}
|
|
1009
1134
|
|
|
1010
1135
|
// src/context/types.ts
|
|
1011
|
-
var
|
|
1012
|
-
var CRMContextSchema2 =
|
|
1013
|
-
model:
|
|
1014
|
-
instanceId:
|
|
1015
|
-
data:
|
|
1136
|
+
var import_v46 = require("zod/v4");
|
|
1137
|
+
var CRMContextSchema2 = import_v46.z.object({
|
|
1138
|
+
model: import_v46.z.string(),
|
|
1139
|
+
instanceId: import_v46.z.string(),
|
|
1140
|
+
data: import_v46.z.record(import_v46.z.string(), import_v46.z.unknown())
|
|
1016
1141
|
});
|
|
1017
|
-
var SenderContextSchema =
|
|
1142
|
+
var SenderContextSchema = import_v46.z.object({
|
|
1018
1143
|
kind: ParticipantKindSchema,
|
|
1019
|
-
displayName:
|
|
1020
|
-
email:
|
|
1021
|
-
role:
|
|
1022
|
-
permissions:
|
|
1144
|
+
displayName: import_v46.z.string().optional(),
|
|
1145
|
+
email: import_v46.z.string().optional(),
|
|
1146
|
+
role: import_v46.z.string().optional(),
|
|
1147
|
+
permissions: import_v46.z.array(import_v46.z.string()).optional(),
|
|
1023
1148
|
crm: CRMContextSchema2.optional()
|
|
1024
1149
|
});
|
|
1025
|
-
var ThreadContextItemSchema =
|
|
1026
|
-
handle:
|
|
1027
|
-
model:
|
|
1028
|
-
instanceId:
|
|
1029
|
-
data:
|
|
1030
|
-
});
|
|
1031
|
-
var ThreadInfoSchema =
|
|
1032
|
-
id:
|
|
1033
|
-
title:
|
|
1034
|
-
status:
|
|
1035
|
-
kind:
|
|
1036
|
-
});
|
|
1037
|
-
var SubscriptionSchema =
|
|
1038
|
-
identifierValue:
|
|
1039
|
-
channelHandle:
|
|
1040
|
-
});
|
|
1041
|
-
var AssociationSchema =
|
|
1042
|
-
id:
|
|
1043
|
-
data:
|
|
1044
|
-
});
|
|
1045
|
-
var ContactSchema =
|
|
1046
|
-
id:
|
|
1047
|
-
name:
|
|
1150
|
+
var ThreadContextItemSchema = import_v46.z.object({
|
|
1151
|
+
handle: import_v46.z.string(),
|
|
1152
|
+
model: import_v46.z.string(),
|
|
1153
|
+
instanceId: import_v46.z.string(),
|
|
1154
|
+
data: import_v46.z.record(import_v46.z.string(), import_v46.z.unknown()).optional()
|
|
1155
|
+
});
|
|
1156
|
+
var ThreadInfoSchema = import_v46.z.object({
|
|
1157
|
+
id: import_v46.z.string(),
|
|
1158
|
+
title: import_v46.z.string().optional(),
|
|
1159
|
+
status: import_v46.z.string().optional(),
|
|
1160
|
+
kind: import_v46.z.string().optional()
|
|
1161
|
+
});
|
|
1162
|
+
var SubscriptionSchema = import_v46.z.object({
|
|
1163
|
+
identifierValue: import_v46.z.string(),
|
|
1164
|
+
channelHandle: import_v46.z.string().optional()
|
|
1165
|
+
});
|
|
1166
|
+
var AssociationSchema = import_v46.z.object({
|
|
1167
|
+
id: import_v46.z.string().optional(),
|
|
1168
|
+
data: import_v46.z.record(import_v46.z.string(), import_v46.z.unknown())
|
|
1169
|
+
});
|
|
1170
|
+
var ContactSchema = import_v46.z.object({
|
|
1171
|
+
id: import_v46.z.string().optional(),
|
|
1172
|
+
name: import_v46.z.string().optional(),
|
|
1048
1173
|
subscription: SubscriptionSchema.optional(),
|
|
1049
|
-
associations:
|
|
1174
|
+
associations: import_v46.z.record(import_v46.z.string(), AssociationSchema).optional()
|
|
1050
1175
|
});
|
|
1051
|
-
var AgentSenderContextSchema =
|
|
1052
|
-
kind:
|
|
1053
|
-
displayName:
|
|
1054
|
-
role:
|
|
1055
|
-
permissions:
|
|
1176
|
+
var AgentSenderContextSchema = import_v46.z.object({
|
|
1177
|
+
kind: import_v46.z.enum(["contact", "member"]),
|
|
1178
|
+
displayName: import_v46.z.string().optional(),
|
|
1179
|
+
role: import_v46.z.string().optional(),
|
|
1180
|
+
permissions: import_v46.z.array(import_v46.z.string()).optional(),
|
|
1056
1181
|
contact: ContactSchema.optional()
|
|
1057
1182
|
});
|
|
1058
|
-
var AgentThreadContextSchema =
|
|
1059
|
-
handle:
|
|
1060
|
-
model:
|
|
1061
|
-
data:
|
|
1183
|
+
var AgentThreadContextSchema = import_v46.z.object({
|
|
1184
|
+
handle: import_v46.z.string(),
|
|
1185
|
+
model: import_v46.z.string(),
|
|
1186
|
+
data: import_v46.z.record(import_v46.z.string(), import_v46.z.unknown())
|
|
1062
1187
|
});
|
|
1063
|
-
var AgentContextSchema =
|
|
1188
|
+
var AgentContextSchema = import_v46.z.object({
|
|
1064
1189
|
sender: AgentSenderContextSchema,
|
|
1065
|
-
contexts:
|
|
1190
|
+
contexts: import_v46.z.array(AgentThreadContextSchema).optional()
|
|
1066
1191
|
});
|
|
1067
|
-
var ContextIssueSeveritySchema =
|
|
1068
|
-
var ContextIssueTypeSchema =
|
|
1192
|
+
var ContextIssueSeveritySchema = import_v46.z.enum(["ERROR", "WARNING"]);
|
|
1193
|
+
var ContextIssueTypeSchema = import_v46.z.enum([
|
|
1069
1194
|
"MISSING_ROUTING_PARTICIPANT",
|
|
1070
1195
|
"MISSING_ASSOCIATION",
|
|
1071
1196
|
"MISSING_REQUIRED_FIELD",
|
|
1072
1197
|
"MISSING_RECOMMENDED_FIELD"
|
|
1073
1198
|
]);
|
|
1074
|
-
var ContextIssueSchema =
|
|
1199
|
+
var ContextIssueSchema = import_v46.z.object({
|
|
1075
1200
|
type: ContextIssueTypeSchema,
|
|
1076
1201
|
severity: ContextIssueSeveritySchema,
|
|
1077
|
-
model:
|
|
1078
|
-
field:
|
|
1079
|
-
message:
|
|
1080
|
-
suggestion:
|
|
1202
|
+
model: import_v46.z.string().optional(),
|
|
1203
|
+
field: import_v46.z.string().optional(),
|
|
1204
|
+
message: import_v46.z.string(),
|
|
1205
|
+
suggestion: import_v46.z.string().optional()
|
|
1081
1206
|
});
|
|
1082
|
-
var ContextValidationResultSchema =
|
|
1083
|
-
valid:
|
|
1084
|
-
degraded:
|
|
1085
|
-
issues:
|
|
1207
|
+
var ContextValidationResultSchema = import_v46.z.object({
|
|
1208
|
+
valid: import_v46.z.boolean(),
|
|
1209
|
+
degraded: import_v46.z.boolean(),
|
|
1210
|
+
issues: import_v46.z.array(ContextIssueSchema)
|
|
1086
1211
|
});
|
|
1087
1212
|
var MockSenderContextSchema = AgentSenderContextSchema;
|
|
1088
1213
|
var MockThreadContextSchema = AgentThreadContextSchema;
|
|
1089
1214
|
var MockContextSchema = AgentContextSchema;
|
|
1090
|
-
var SandboxConfigSchema =
|
|
1091
|
-
enabled:
|
|
1215
|
+
var SandboxConfigSchema = import_v46.z.object({
|
|
1216
|
+
enabled: import_v46.z.boolean().optional(),
|
|
1092
1217
|
/** @deprecated Use 'context' instead of 'mockContext' */
|
|
1093
1218
|
mockContext: AgentContextSchema.optional(),
|
|
1094
1219
|
context: AgentContextSchema.optional()
|
|
1095
1220
|
});
|
|
1096
1221
|
|
|
1097
1222
|
// src/schemas/agent-schema-v3.ts
|
|
1098
|
-
var PersonaVoiceFormatV3Schema =
|
|
1099
|
-
maxChars:
|
|
1100
|
-
noEmojis:
|
|
1101
|
-
noHyphens:
|
|
1102
|
-
noBulletPoints:
|
|
1103
|
-
maxQuestionsPerMessage:
|
|
1104
|
-
noSignOffs:
|
|
1105
|
-
});
|
|
1106
|
-
var PersonaVoiceV3Schema =
|
|
1107
|
-
style:
|
|
1223
|
+
var PersonaVoiceFormatV3Schema = import_v47.z.object({
|
|
1224
|
+
maxChars: import_v47.z.number().optional(),
|
|
1225
|
+
noEmojis: import_v47.z.boolean().optional(),
|
|
1226
|
+
noHyphens: import_v47.z.boolean().optional(),
|
|
1227
|
+
noBulletPoints: import_v47.z.boolean().optional(),
|
|
1228
|
+
maxQuestionsPerMessage: import_v47.z.number().optional(),
|
|
1229
|
+
noSignOffs: import_v47.z.boolean().optional()
|
|
1230
|
+
});
|
|
1231
|
+
var PersonaVoiceV3Schema = import_v47.z.object({
|
|
1232
|
+
style: import_v47.z.string(),
|
|
1108
1233
|
format: PersonaVoiceFormatV3Schema.optional()
|
|
1109
1234
|
});
|
|
1110
|
-
var PersonaV3Schema =
|
|
1111
|
-
name:
|
|
1235
|
+
var PersonaV3Schema = import_v47.z.object({
|
|
1236
|
+
name: import_v47.z.string(),
|
|
1112
1237
|
voice: PersonaVoiceV3Schema
|
|
1113
1238
|
});
|
|
1114
|
-
var ToolApprovalConfigSchema =
|
|
1115
|
-
required:
|
|
1116
|
-
requiredIf:
|
|
1239
|
+
var ToolApprovalConfigSchema = import_v47.z.object({
|
|
1240
|
+
required: import_v47.z.boolean().optional(),
|
|
1241
|
+
requiredIf: import_v47.z.array(import_v47.z.string()).optional()
|
|
1117
1242
|
});
|
|
1118
|
-
var ToolSandboxConfigSchema =
|
|
1119
|
-
mock:
|
|
1243
|
+
var ToolSandboxConfigSchema = import_v47.z.object({
|
|
1244
|
+
mock: import_v47.z.unknown().optional()
|
|
1120
1245
|
});
|
|
1121
|
-
var ToolRefV3Schema =
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
tool:
|
|
1125
|
-
description:
|
|
1246
|
+
var ToolRefV3Schema = import_v47.z.union([
|
|
1247
|
+
import_v47.z.string(),
|
|
1248
|
+
import_v47.z.object({
|
|
1249
|
+
tool: import_v47.z.string(),
|
|
1250
|
+
description: import_v47.z.string().optional(),
|
|
1126
1251
|
approval: ToolApprovalConfigSchema.optional(),
|
|
1127
1252
|
sandbox: ToolSandboxConfigSchema.optional(),
|
|
1128
|
-
overrides:
|
|
1253
|
+
overrides: import_v47.z.record(import_v47.z.string(), import_v47.z.unknown()).optional()
|
|
1129
1254
|
})
|
|
1130
1255
|
]);
|
|
1131
|
-
var AgentToolRefSchema =
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
tool:
|
|
1135
|
-
description:
|
|
1256
|
+
var AgentToolRefSchema = import_v47.z.union([
|
|
1257
|
+
import_v47.z.string(),
|
|
1258
|
+
import_v47.z.object({
|
|
1259
|
+
tool: import_v47.z.string(),
|
|
1260
|
+
description: import_v47.z.string().optional()
|
|
1136
1261
|
})
|
|
1137
1262
|
]);
|
|
1138
|
-
var WorkingMemoryConfigSchema =
|
|
1139
|
-
strategy:
|
|
1140
|
-
maxTokens:
|
|
1141
|
-
summarizeAt:
|
|
1263
|
+
var WorkingMemoryConfigSchema = import_v47.z.object({
|
|
1264
|
+
strategy: import_v47.z.enum(["full", "rolling_summary", "sliding_window"]).optional(),
|
|
1265
|
+
maxTokens: import_v47.z.number().optional(),
|
|
1266
|
+
summarizeAt: import_v47.z.number().optional()
|
|
1142
1267
|
});
|
|
1143
|
-
var ExternalMemoryConfigSchema =
|
|
1144
|
-
enabled:
|
|
1145
|
-
ttl:
|
|
1268
|
+
var ExternalMemoryConfigSchema = import_v47.z.object({
|
|
1269
|
+
enabled: import_v47.z.boolean().optional(),
|
|
1270
|
+
ttl: import_v47.z.string().optional()
|
|
1146
1271
|
});
|
|
1147
|
-
var SemanticMemoryConfigSchema =
|
|
1148
|
-
enabled:
|
|
1149
|
-
topK:
|
|
1150
|
-
scope:
|
|
1272
|
+
var SemanticMemoryConfigSchema = import_v47.z.object({
|
|
1273
|
+
enabled: import_v47.z.boolean().optional(),
|
|
1274
|
+
topK: import_v47.z.number().optional(),
|
|
1275
|
+
scope: import_v47.z.enum(["thread", "instance", "workspace"]).optional()
|
|
1151
1276
|
});
|
|
1152
|
-
var MemoryConfigV3Schema =
|
|
1277
|
+
var MemoryConfigV3Schema = import_v47.z.object({
|
|
1153
1278
|
working: WorkingMemoryConfigSchema.optional(),
|
|
1154
|
-
persistent:
|
|
1155
|
-
namespace:
|
|
1279
|
+
persistent: import_v47.z.object({
|
|
1280
|
+
namespace: import_v47.z.string().optional()
|
|
1156
1281
|
}).optional(),
|
|
1157
1282
|
external: ExternalMemoryConfigSchema.optional(),
|
|
1158
1283
|
semantic: SemanticMemoryConfigSchema.optional()
|
|
1159
1284
|
});
|
|
1160
|
-
var RequiresApprovalPolicySchema =
|
|
1161
|
-
requiresApproval:
|
|
1285
|
+
var RequiresApprovalPolicySchema = import_v47.z.object({
|
|
1286
|
+
requiresApproval: import_v47.z.boolean().optional()
|
|
1162
1287
|
});
|
|
1163
|
-
var PoliciesConfigV3Schema =
|
|
1164
|
-
messages:
|
|
1288
|
+
var PoliciesConfigV3Schema = import_v47.z.object({
|
|
1289
|
+
messages: import_v47.z.object({
|
|
1165
1290
|
send: RequiresApprovalPolicySchema.optional(),
|
|
1166
1291
|
schedule: RequiresApprovalPolicySchema.optional()
|
|
1167
1292
|
}).optional(),
|
|
1168
|
-
tools:
|
|
1169
|
-
externalRequiresApproval:
|
|
1170
|
-
systemRequiresApproval:
|
|
1293
|
+
tools: import_v47.z.object({
|
|
1294
|
+
externalRequiresApproval: import_v47.z.boolean().optional(),
|
|
1295
|
+
systemRequiresApproval: import_v47.z.boolean().optional()
|
|
1171
1296
|
}).optional()
|
|
1172
1297
|
});
|
|
1173
|
-
var RuntimeConfigV3Schema =
|
|
1298
|
+
var RuntimeConfigV3Schema = import_v47.z.object({
|
|
1174
1299
|
/** LLM model identifier for reasoning (e.g., "google/gemini-3.1-flash-lite") */
|
|
1175
|
-
model:
|
|
1300
|
+
model: import_v47.z.string().optional(),
|
|
1176
1301
|
/** LLM model for persona transformation (e.g., "openai/gpt-5-nano") */
|
|
1177
|
-
personaModel:
|
|
1302
|
+
personaModel: import_v47.z.string().optional()
|
|
1178
1303
|
});
|
|
1179
|
-
var TimeWindowTimeStampSchema =
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
hour:
|
|
1183
|
-
minute:
|
|
1304
|
+
var TimeWindowTimeStampSchema = import_v47.z.union([
|
|
1305
|
+
import_v47.z.number().describe("Hour of day (0-23)"),
|
|
1306
|
+
import_v47.z.object({
|
|
1307
|
+
hour: import_v47.z.number(),
|
|
1308
|
+
minute: import_v47.z.number().optional().default(0)
|
|
1184
1309
|
})
|
|
1185
1310
|
]);
|
|
1186
|
-
var TimeWindowDayOfWeekSchema =
|
|
1311
|
+
var TimeWindowDayOfWeekSchema = import_v47.z.enum([
|
|
1187
1312
|
"monday",
|
|
1188
1313
|
"tuesday",
|
|
1189
1314
|
"wednesday",
|
|
@@ -1192,47 +1317,47 @@ var TimeWindowDayOfWeekSchema = import_v46.z.enum([
|
|
|
1192
1317
|
"saturday",
|
|
1193
1318
|
"sunday"
|
|
1194
1319
|
]);
|
|
1195
|
-
var TimeWindowSlotAgentSchema =
|
|
1320
|
+
var TimeWindowSlotAgentSchema = import_v47.z.object({
|
|
1196
1321
|
startTime: TimeWindowTimeStampSchema,
|
|
1197
1322
|
endTime: TimeWindowTimeStampSchema,
|
|
1198
|
-
days:
|
|
1323
|
+
days: import_v47.z.array(TimeWindowDayOfWeekSchema)
|
|
1199
1324
|
});
|
|
1200
|
-
var ResponseModeSchema =
|
|
1325
|
+
var ResponseModeSchema = import_v47.z.enum([
|
|
1201
1326
|
"immediate",
|
|
1202
1327
|
"ack_and_schedule",
|
|
1203
1328
|
"schedule_only"
|
|
1204
1329
|
]);
|
|
1205
|
-
var TimeWindowBehaviorSchema =
|
|
1330
|
+
var TimeWindowBehaviorSchema = import_v47.z.object({
|
|
1206
1331
|
/** How to handle responses in this window */
|
|
1207
1332
|
responseMode: ResponseModeSchema,
|
|
1208
1333
|
/** Prompt injection for this time context */
|
|
1209
|
-
prompt:
|
|
1334
|
+
prompt: import_v47.z.string().optional().describe("Prompt injection for this time context"),
|
|
1210
1335
|
/** Window to schedule responses for (when responseMode is ack_and_schedule or schedule_only) */
|
|
1211
|
-
scheduleFor:
|
|
1336
|
+
scheduleFor: import_v47.z.string().optional().describe("Window name to schedule responses for")
|
|
1212
1337
|
});
|
|
1213
|
-
var TimeWindowPolicySchema =
|
|
1338
|
+
var TimeWindowPolicySchema = import_v47.z.object({
|
|
1214
1339
|
/** IANA timezone for the window (e.g., "Australia/Sydney") */
|
|
1215
|
-
timezone:
|
|
1340
|
+
timezone: import_v47.z.string().describe('IANA timezone, e.g., "Australia/Sydney"'),
|
|
1216
1341
|
/** Time slots when this window is active */
|
|
1217
|
-
windows:
|
|
1342
|
+
windows: import_v47.z.array(TimeWindowSlotAgentSchema),
|
|
1218
1343
|
/** Behavior for this window (optional - defaults to immediate response) */
|
|
1219
1344
|
behavior: TimeWindowBehaviorSchema.optional()
|
|
1220
1345
|
});
|
|
1221
|
-
var TimeWindowPoliciesSchema =
|
|
1346
|
+
var TimeWindowPoliciesSchema = import_v47.z.record(import_v47.z.string(), TimeWindowPolicySchema);
|
|
1222
1347
|
var TimeWindowDefaultSchema = TimeWindowBehaviorSchema.describe(
|
|
1223
1348
|
"Fallback behavior when no time window matches"
|
|
1224
1349
|
);
|
|
1225
|
-
var ResponsesBehaviorConfigSchema =
|
|
1350
|
+
var ResponsesBehaviorConfigSchema = import_v47.z.object({
|
|
1226
1351
|
/**
|
|
1227
1352
|
* Maximum immediate messages per agent run (acks, progress updates).
|
|
1228
1353
|
* @default 1
|
|
1229
1354
|
*/
|
|
1230
|
-
maxImmediate:
|
|
1355
|
+
maxImmediate: import_v47.z.number().optional(),
|
|
1231
1356
|
/**
|
|
1232
1357
|
* Maximum scheduled messages per agent run (follow-ups via sendAt).
|
|
1233
1358
|
* @default 2
|
|
1234
1359
|
*/
|
|
1235
|
-
maxScheduled:
|
|
1360
|
+
maxScheduled: import_v47.z.number().optional(),
|
|
1236
1361
|
/**
|
|
1237
1362
|
* Maximum intermediate messages per agent run.
|
|
1238
1363
|
* Intermediate = progress updates, acknowledgments before task completion.
|
|
@@ -1240,74 +1365,74 @@ var ResponsesBehaviorConfigSchema = import_v46.z.object({
|
|
|
1240
1365
|
* @deprecated Use maxImmediate instead
|
|
1241
1366
|
* @default 2
|
|
1242
1367
|
*/
|
|
1243
|
-
maxIntermediate:
|
|
1368
|
+
maxIntermediate: import_v47.z.number().optional(),
|
|
1244
1369
|
/**
|
|
1245
1370
|
* Whether a final message is required before the run completes.
|
|
1246
1371
|
* If true and no final message is sent, the run fails.
|
|
1247
1372
|
* @default true
|
|
1248
1373
|
*/
|
|
1249
|
-
requireFinal:
|
|
1374
|
+
requireFinal: import_v47.z.boolean().optional(),
|
|
1250
1375
|
/**
|
|
1251
1376
|
* Whether the agent can schedule messages for future delivery.
|
|
1252
1377
|
* Scheduled messages typically require approval.
|
|
1253
1378
|
* @default false
|
|
1254
1379
|
*/
|
|
1255
|
-
allowSchedule:
|
|
1380
|
+
allowSchedule: import_v47.z.boolean().optional(),
|
|
1256
1381
|
/**
|
|
1257
1382
|
* Message splitting configuration.
|
|
1258
1383
|
* Controls whether and how the agent splits responses into multiple messages.
|
|
1259
1384
|
*/
|
|
1260
|
-
messageSplitting:
|
|
1385
|
+
messageSplitting: import_v47.z.object({
|
|
1261
1386
|
/**
|
|
1262
1387
|
* Whether to allow natural message splitting.
|
|
1263
1388
|
* When true, the agent may split responses into multiple messages
|
|
1264
1389
|
* when it improves conversational flow.
|
|
1265
1390
|
*/
|
|
1266
|
-
enabled:
|
|
1391
|
+
enabled: import_v47.z.boolean(),
|
|
1267
1392
|
/**
|
|
1268
1393
|
* Custom prompt to override the default message splitting guidance.
|
|
1269
1394
|
* If not provided, uses sensible defaults for when to split vs. keep together.
|
|
1270
1395
|
*/
|
|
1271
|
-
prompt:
|
|
1396
|
+
prompt: import_v47.z.string().optional()
|
|
1272
1397
|
}).optional()
|
|
1273
1398
|
});
|
|
1274
|
-
var SchedulingDelaySchema =
|
|
1399
|
+
var SchedulingDelaySchema = import_v47.z.object({
|
|
1275
1400
|
/** Time unit amount */
|
|
1276
|
-
amount:
|
|
1401
|
+
amount: import_v47.z.number(),
|
|
1277
1402
|
/** Time unit (e.g., "week", "weeks", "day", "days", "month", "months") */
|
|
1278
|
-
unit:
|
|
1403
|
+
unit: import_v47.z.string(),
|
|
1279
1404
|
/** Optional time window to constrain the delay */
|
|
1280
|
-
timeWindow:
|
|
1405
|
+
timeWindow: import_v47.z.string().optional()
|
|
1281
1406
|
});
|
|
1282
|
-
var SchedulingPatternSchema =
|
|
1407
|
+
var SchedulingPatternSchema = import_v47.z.object({
|
|
1283
1408
|
/** Trigger name for this pattern */
|
|
1284
|
-
trigger:
|
|
1409
|
+
trigger: import_v47.z.string(),
|
|
1285
1410
|
/** Human-readable description of when this pattern applies */
|
|
1286
|
-
description:
|
|
1411
|
+
description: import_v47.z.string().optional(),
|
|
1287
1412
|
/** Example user phrases that match this pattern */
|
|
1288
|
-
examples:
|
|
1413
|
+
examples: import_v47.z.array(import_v47.z.string()).optional(),
|
|
1289
1414
|
/** Default delay for this pattern */
|
|
1290
1415
|
defaultDelay: SchedulingDelaySchema.optional()
|
|
1291
1416
|
});
|
|
1292
|
-
var SchedulingBehaviorConfigSchema =
|
|
1417
|
+
var SchedulingBehaviorConfigSchema = import_v47.z.object({
|
|
1293
1418
|
/**
|
|
1294
1419
|
* Patterns that trigger scheduling suggestions.
|
|
1295
1420
|
* The agent uses these to know when to add sendAt to messages.
|
|
1296
1421
|
*/
|
|
1297
|
-
patterns:
|
|
1422
|
+
patterns: import_v47.z.array(SchedulingPatternSchema).optional(),
|
|
1298
1423
|
/**
|
|
1299
1424
|
* Default settings for scheduled messages.
|
|
1300
1425
|
*/
|
|
1301
|
-
defaults:
|
|
1426
|
+
defaults: import_v47.z.object({
|
|
1302
1427
|
/** Cancel scheduled message if user replies before send time (default: true) */
|
|
1303
|
-
cancelOnActivity:
|
|
1428
|
+
cancelOnActivity: import_v47.z.boolean().optional(),
|
|
1304
1429
|
/** Whether scheduled messages require approval (default: true) */
|
|
1305
|
-
requiresApproval:
|
|
1430
|
+
requiresApproval: import_v47.z.boolean().optional(),
|
|
1306
1431
|
/** Default time window policy to constrain all scheduled messages */
|
|
1307
|
-
timeWindow:
|
|
1432
|
+
timeWindow: import_v47.z.string().optional().describe("Time window policy name for scheduled messages")
|
|
1308
1433
|
}).optional()
|
|
1309
1434
|
});
|
|
1310
|
-
var BehaviorConfigV3Schema =
|
|
1435
|
+
var BehaviorConfigV3Schema = import_v47.z.object({
|
|
1311
1436
|
/**
|
|
1312
1437
|
* Response behavior - controls message sending via tool calls.
|
|
1313
1438
|
* When configured, agents must explicitly call system:message:send
|
|
@@ -1320,32 +1445,32 @@ var BehaviorConfigV3Schema = import_v46.z.object({
|
|
|
1320
1445
|
*/
|
|
1321
1446
|
scheduling: SchedulingBehaviorConfigSchema.optional()
|
|
1322
1447
|
});
|
|
1323
|
-
var PromptsConfigV3Schema =
|
|
1448
|
+
var PromptsConfigV3Schema = import_v47.z.object({
|
|
1324
1449
|
/** Main system prompt with workflow instructions */
|
|
1325
|
-
system:
|
|
1450
|
+
system: import_v47.z.string().optional(),
|
|
1326
1451
|
/** Injected during second pass when skills were loaded but tools not used */
|
|
1327
|
-
recovery:
|
|
1452
|
+
recovery: import_v47.z.string().optional(),
|
|
1328
1453
|
/** Injected during follow-up passes when context needs updating */
|
|
1329
|
-
followUp:
|
|
1454
|
+
followUp: import_v47.z.string().optional(),
|
|
1330
1455
|
/** Thread list title generation (system + user template with {{var}} placeholders) */
|
|
1331
|
-
titleEnrichment:
|
|
1332
|
-
system:
|
|
1333
|
-
user:
|
|
1456
|
+
titleEnrichment: import_v47.z.object({
|
|
1457
|
+
system: import_v47.z.string().optional(),
|
|
1458
|
+
user: import_v47.z.string().optional()
|
|
1334
1459
|
}).optional()
|
|
1335
1460
|
});
|
|
1336
|
-
var AgentYAMLV3Schema =
|
|
1337
|
-
$schema:
|
|
1338
|
-
handle:
|
|
1339
|
-
name:
|
|
1340
|
-
version:
|
|
1341
|
-
description:
|
|
1461
|
+
var AgentYAMLV3Schema = import_v47.z.object({
|
|
1462
|
+
$schema: import_v47.z.string().optional(),
|
|
1463
|
+
handle: import_v47.z.string(),
|
|
1464
|
+
name: import_v47.z.string(),
|
|
1465
|
+
version: import_v47.z.string().optional(),
|
|
1466
|
+
description: import_v47.z.string().optional(),
|
|
1342
1467
|
// Persona - Who the agent is
|
|
1343
1468
|
persona: PersonaV3Schema.optional(),
|
|
1344
1469
|
// Skills - What the agent knows how to do (skills own their tools)
|
|
1345
|
-
skills:
|
|
1470
|
+
skills: import_v47.z.array(SkillRefSchema).optional(),
|
|
1346
1471
|
// Tools - Always-available tools before any skill loads
|
|
1347
1472
|
// Examples: system:settings:business_information:get
|
|
1348
|
-
tools:
|
|
1473
|
+
tools: import_v47.z.array(AgentToolRefSchema).optional(),
|
|
1349
1474
|
/**
|
|
1350
1475
|
* Events - When the agent activates
|
|
1351
1476
|
* @deprecated Not yet implemented - this is a planned feature for event-driven agents.
|
|
@@ -1378,21 +1503,21 @@ var AgentYAMLV3Schema = import_v46.z.object({
|
|
|
1378
1503
|
});
|
|
1379
1504
|
|
|
1380
1505
|
// src/schemas.ts
|
|
1381
|
-
var EnvVisibilitySchema =
|
|
1382
|
-
var EnvVariableDefinitionSchema =
|
|
1383
|
-
label:
|
|
1384
|
-
required:
|
|
1506
|
+
var EnvVisibilitySchema = import_v48.z.enum(["visible", "encrypted"]);
|
|
1507
|
+
var EnvVariableDefinitionSchema = import_v48.z.object({
|
|
1508
|
+
label: import_v48.z.string(),
|
|
1509
|
+
required: import_v48.z.boolean().optional(),
|
|
1385
1510
|
visibility: EnvVisibilitySchema.optional(),
|
|
1386
|
-
default:
|
|
1387
|
-
description:
|
|
1388
|
-
placeholder:
|
|
1389
|
-
});
|
|
1390
|
-
var EnvSchemaSchema =
|
|
1391
|
-
var ComputeLayerTypeSchema =
|
|
1392
|
-
var FieldOwnerSchema =
|
|
1393
|
-
var PrimitiveSchema =
|
|
1394
|
-
var PrimitiveOrArraySchema =
|
|
1395
|
-
var FilterOperatorSchema =
|
|
1511
|
+
default: import_v48.z.string().optional(),
|
|
1512
|
+
description: import_v48.z.string().optional(),
|
|
1513
|
+
placeholder: import_v48.z.string().optional()
|
|
1514
|
+
});
|
|
1515
|
+
var EnvSchemaSchema = import_v48.z.record(import_v48.z.string(), EnvVariableDefinitionSchema);
|
|
1516
|
+
var ComputeLayerTypeSchema = import_v48.z.enum(["serverless", "dedicated"]);
|
|
1517
|
+
var FieldOwnerSchema = import_v48.z.enum(["APP", "SHARED"]);
|
|
1518
|
+
var PrimitiveSchema = import_v48.z.union([import_v48.z.string(), import_v48.z.number(), import_v48.z.boolean()]);
|
|
1519
|
+
var PrimitiveOrArraySchema = import_v48.z.union([PrimitiveSchema, import_v48.z.array(PrimitiveSchema)]);
|
|
1520
|
+
var FilterOperatorSchema = import_v48.z.enum([
|
|
1396
1521
|
"eq",
|
|
1397
1522
|
"neq",
|
|
1398
1523
|
"gt",
|
|
@@ -1410,7 +1535,7 @@ var FilterOperatorSchema = import_v47.z.enum([
|
|
|
1410
1535
|
"isEmpty",
|
|
1411
1536
|
"isNotEmpty"
|
|
1412
1537
|
]);
|
|
1413
|
-
var FilterConditionSchema =
|
|
1538
|
+
var FilterConditionSchema = import_v48.z.object({
|
|
1414
1539
|
eq: PrimitiveOrArraySchema,
|
|
1415
1540
|
neq: PrimitiveOrArraySchema,
|
|
1416
1541
|
gt: PrimitiveOrArraySchema,
|
|
@@ -1428,27 +1553,27 @@ var FilterConditionSchema = import_v47.z.object({
|
|
|
1428
1553
|
isEmpty: PrimitiveOrArraySchema,
|
|
1429
1554
|
isNotEmpty: PrimitiveOrArraySchema
|
|
1430
1555
|
}).partial();
|
|
1431
|
-
var StructuredFilterSchema =
|
|
1432
|
-
|
|
1556
|
+
var StructuredFilterSchema = import_v48.z.record(
|
|
1557
|
+
import_v48.z.string(),
|
|
1433
1558
|
FilterConditionSchema
|
|
1434
1559
|
);
|
|
1435
|
-
var ModelDependencySchema =
|
|
1436
|
-
model:
|
|
1437
|
-
fields:
|
|
1560
|
+
var ModelDependencySchema = import_v48.z.object({
|
|
1561
|
+
model: import_v48.z.string(),
|
|
1562
|
+
fields: import_v48.z.array(import_v48.z.string()).optional(),
|
|
1438
1563
|
where: StructuredFilterSchema.optional()
|
|
1439
1564
|
});
|
|
1440
|
-
var ChannelDependencySchema =
|
|
1441
|
-
channel:
|
|
1565
|
+
var ChannelDependencySchema = import_v48.z.object({
|
|
1566
|
+
channel: import_v48.z.string()
|
|
1442
1567
|
});
|
|
1443
|
-
var WorkflowDependencySchema =
|
|
1444
|
-
workflow:
|
|
1568
|
+
var WorkflowDependencySchema = import_v48.z.object({
|
|
1569
|
+
workflow: import_v48.z.string()
|
|
1445
1570
|
});
|
|
1446
|
-
var ResourceDependencySchema =
|
|
1571
|
+
var ResourceDependencySchema = import_v48.z.union([
|
|
1447
1572
|
ModelDependencySchema,
|
|
1448
1573
|
ChannelDependencySchema,
|
|
1449
1574
|
WorkflowDependencySchema
|
|
1450
1575
|
]);
|
|
1451
|
-
var FieldDataTypeSchema =
|
|
1576
|
+
var FieldDataTypeSchema = import_v48.z.enum([
|
|
1452
1577
|
"LONG_STRING",
|
|
1453
1578
|
"STRING",
|
|
1454
1579
|
"NUMBER",
|
|
@@ -1461,74 +1586,74 @@ var FieldDataTypeSchema = import_v47.z.enum([
|
|
|
1461
1586
|
"RELATION",
|
|
1462
1587
|
"OBJECT"
|
|
1463
1588
|
]);
|
|
1464
|
-
var FieldOptionSchema =
|
|
1465
|
-
label:
|
|
1466
|
-
value:
|
|
1467
|
-
color:
|
|
1468
|
-
});
|
|
1469
|
-
var InlineFieldDefinitionSchema =
|
|
1470
|
-
limitChoices:
|
|
1471
|
-
options:
|
|
1472
|
-
minLength:
|
|
1473
|
-
maxLength:
|
|
1474
|
-
min:
|
|
1475
|
-
max:
|
|
1476
|
-
relatedModel:
|
|
1477
|
-
pattern:
|
|
1478
|
-
});
|
|
1479
|
-
var AppFieldVisibilitySchema =
|
|
1480
|
-
data:
|
|
1481
|
-
list:
|
|
1482
|
-
filters:
|
|
1483
|
-
});
|
|
1484
|
-
var FieldRequirementTypeSchema =
|
|
1485
|
-
var ModelFieldDefinitionSchema =
|
|
1486
|
-
handle:
|
|
1487
|
-
label:
|
|
1589
|
+
var FieldOptionSchema = import_v48.z.object({
|
|
1590
|
+
label: import_v48.z.string(),
|
|
1591
|
+
value: import_v48.z.string(),
|
|
1592
|
+
color: import_v48.z.string().optional()
|
|
1593
|
+
});
|
|
1594
|
+
var InlineFieldDefinitionSchema = import_v48.z.object({
|
|
1595
|
+
limitChoices: import_v48.z.number().optional(),
|
|
1596
|
+
options: import_v48.z.array(FieldOptionSchema).optional(),
|
|
1597
|
+
minLength: import_v48.z.number().optional(),
|
|
1598
|
+
maxLength: import_v48.z.number().optional(),
|
|
1599
|
+
min: import_v48.z.number().optional(),
|
|
1600
|
+
max: import_v48.z.number().optional(),
|
|
1601
|
+
relatedModel: import_v48.z.string().optional(),
|
|
1602
|
+
pattern: import_v48.z.string().optional()
|
|
1603
|
+
});
|
|
1604
|
+
var AppFieldVisibilitySchema = import_v48.z.object({
|
|
1605
|
+
data: import_v48.z.boolean().optional(),
|
|
1606
|
+
list: import_v48.z.boolean().optional(),
|
|
1607
|
+
filters: import_v48.z.boolean().optional()
|
|
1608
|
+
});
|
|
1609
|
+
var FieldRequirementTypeSchema = import_v48.z.enum(["optional", "on_create", "required"]);
|
|
1610
|
+
var ModelFieldDefinitionSchema = import_v48.z.object({
|
|
1611
|
+
handle: import_v48.z.string(),
|
|
1612
|
+
label: import_v48.z.string(),
|
|
1488
1613
|
type: FieldDataTypeSchema.optional(),
|
|
1489
|
-
definition:
|
|
1614
|
+
definition: import_v48.z.union([InlineFieldDefinitionSchema, import_v48.z.string()]).optional(),
|
|
1490
1615
|
/** Field requirement type: 'optional', 'on_create', or 'required' */
|
|
1491
1616
|
requirement: FieldRequirementTypeSchema.optional(),
|
|
1492
1617
|
/** @deprecated Use `requirement` instead */
|
|
1493
|
-
required:
|
|
1494
|
-
unique:
|
|
1495
|
-
system:
|
|
1496
|
-
isList:
|
|
1497
|
-
defaultValue:
|
|
1498
|
-
description:
|
|
1618
|
+
required: import_v48.z.boolean().optional(),
|
|
1619
|
+
unique: import_v48.z.boolean().optional(),
|
|
1620
|
+
system: import_v48.z.boolean().optional(),
|
|
1621
|
+
isList: import_v48.z.boolean().optional(),
|
|
1622
|
+
defaultValue: import_v48.z.object({ value: import_v48.z.unknown() }).optional(),
|
|
1623
|
+
description: import_v48.z.string().optional(),
|
|
1499
1624
|
visibility: AppFieldVisibilitySchema.optional(),
|
|
1500
1625
|
owner: FieldOwnerSchema.optional()
|
|
1501
1626
|
});
|
|
1502
|
-
var ModelDefinitionSchema =
|
|
1503
|
-
handle:
|
|
1504
|
-
name:
|
|
1505
|
-
namePlural:
|
|
1506
|
-
labelTemplate:
|
|
1507
|
-
description:
|
|
1508
|
-
fields:
|
|
1509
|
-
requires:
|
|
1510
|
-
addDefaultPages:
|
|
1511
|
-
addNavigation:
|
|
1627
|
+
var ModelDefinitionSchema = import_v48.z.object({
|
|
1628
|
+
handle: import_v48.z.string(),
|
|
1629
|
+
name: import_v48.z.string(),
|
|
1630
|
+
namePlural: import_v48.z.string().optional(),
|
|
1631
|
+
labelTemplate: import_v48.z.string().optional(),
|
|
1632
|
+
description: import_v48.z.string().optional(),
|
|
1633
|
+
fields: import_v48.z.array(ModelFieldDefinitionSchema),
|
|
1634
|
+
requires: import_v48.z.array(ResourceDependencySchema).optional(),
|
|
1635
|
+
addDefaultPages: import_v48.z.boolean().optional(),
|
|
1636
|
+
addNavigation: import_v48.z.boolean().optional(),
|
|
1512
1637
|
/** Root path for developer resource UI (e.g., '/access_requests'). Links internal model to a provision.pages entry. */
|
|
1513
|
-
page:
|
|
1638
|
+
page: import_v48.z.string().optional()
|
|
1514
1639
|
});
|
|
1515
|
-
var RelationshipCardinalitySchema =
|
|
1640
|
+
var RelationshipCardinalitySchema = import_v48.z.enum([
|
|
1516
1641
|
"ONE_TO_ONE",
|
|
1517
1642
|
"ONE_TO_MANY"
|
|
1518
1643
|
]);
|
|
1519
|
-
var OnDeleteBehaviorSchema =
|
|
1520
|
-
var RelationshipLinkSchema =
|
|
1521
|
-
model:
|
|
1522
|
-
field:
|
|
1523
|
-
label:
|
|
1644
|
+
var OnDeleteBehaviorSchema = import_v48.z.enum(["NONE", "CASCADE", "RESTRICT"]);
|
|
1645
|
+
var RelationshipLinkSchema = import_v48.z.object({
|
|
1646
|
+
model: import_v48.z.string(),
|
|
1647
|
+
field: import_v48.z.string(),
|
|
1648
|
+
label: import_v48.z.string()
|
|
1524
1649
|
});
|
|
1525
|
-
var RelationshipDefinitionSchema =
|
|
1650
|
+
var RelationshipDefinitionSchema = import_v48.z.object({
|
|
1526
1651
|
source: RelationshipLinkSchema,
|
|
1527
1652
|
target: RelationshipLinkSchema,
|
|
1528
1653
|
cardinality: RelationshipCardinalitySchema,
|
|
1529
1654
|
onDelete: OnDeleteBehaviorSchema.default("NONE")
|
|
1530
1655
|
});
|
|
1531
|
-
var ChannelCapabilityTypeSchema =
|
|
1656
|
+
var ChannelCapabilityTypeSchema = import_v48.z.enum([
|
|
1532
1657
|
"messaging",
|
|
1533
1658
|
// Text-based: SMS, WhatsApp, Messenger, DMs
|
|
1534
1659
|
"voice",
|
|
@@ -1536,323 +1661,329 @@ var ChannelCapabilityTypeSchema = import_v47.z.enum([
|
|
|
1536
1661
|
"video"
|
|
1537
1662
|
// Video calls (future)
|
|
1538
1663
|
]);
|
|
1539
|
-
var
|
|
1540
|
-
|
|
1664
|
+
var ChannelBatchCapabilitySchema = import_v48.z.object({
|
|
1665
|
+
send: import_v48.z.string(),
|
|
1666
|
+
get_status: import_v48.z.string()
|
|
1667
|
+
});
|
|
1668
|
+
var ChannelCapabilitySchema = import_v48.z.object({
|
|
1669
|
+
label: import_v48.z.string(),
|
|
1541
1670
|
// Display name: "SMS", "WhatsApp Messages"
|
|
1542
|
-
icon:
|
|
1671
|
+
icon: import_v48.z.string().optional(),
|
|
1543
1672
|
// Lucide icon name
|
|
1544
|
-
receive:
|
|
1673
|
+
receive: import_v48.z.string().optional(),
|
|
1545
1674
|
// Inbound webhook handler
|
|
1546
|
-
send:
|
|
1675
|
+
send: import_v48.z.string().optional(),
|
|
1547
1676
|
// Outbound tool handle
|
|
1677
|
+
send_batch: import_v48.z.union([import_v48.z.string(), ChannelBatchCapabilitySchema]).optional()
|
|
1678
|
+
// Batch outbound tool handle, or { send, get_status }
|
|
1548
1679
|
});
|
|
1549
|
-
var ChannelFieldDefinitionSchema =
|
|
1550
|
-
handle:
|
|
1551
|
-
label:
|
|
1680
|
+
var ChannelFieldDefinitionSchema = import_v48.z.object({
|
|
1681
|
+
handle: import_v48.z.string(),
|
|
1682
|
+
label: import_v48.z.string(),
|
|
1552
1683
|
/** Field definition reference or inline definition */
|
|
1553
|
-
definition:
|
|
1684
|
+
definition: import_v48.z.union([InlineFieldDefinitionSchema, import_v48.z.string()]).optional(),
|
|
1554
1685
|
/** Marks this field as the identifier field for the channel */
|
|
1555
|
-
identifier:
|
|
1686
|
+
identifier: import_v48.z.boolean().optional(),
|
|
1556
1687
|
/** Whether this field is required */
|
|
1557
|
-
required:
|
|
1688
|
+
required: import_v48.z.boolean().optional(),
|
|
1558
1689
|
/** Default value when creating a new field */
|
|
1559
|
-
defaultValue:
|
|
1690
|
+
defaultValue: import_v48.z.object({ value: import_v48.z.unknown() }).passthrough().optional(),
|
|
1560
1691
|
/** Visibility settings for the field */
|
|
1561
|
-
visibility:
|
|
1562
|
-
data:
|
|
1563
|
-
list:
|
|
1564
|
-
filters:
|
|
1692
|
+
visibility: import_v48.z.object({
|
|
1693
|
+
data: import_v48.z.boolean().optional(),
|
|
1694
|
+
list: import_v48.z.boolean().optional(),
|
|
1695
|
+
filters: import_v48.z.boolean().optional()
|
|
1565
1696
|
}).passthrough().optional(),
|
|
1566
1697
|
/** Permission settings for the field */
|
|
1567
|
-
permissions:
|
|
1568
|
-
read:
|
|
1569
|
-
write:
|
|
1698
|
+
permissions: import_v48.z.object({
|
|
1699
|
+
read: import_v48.z.boolean().optional(),
|
|
1700
|
+
write: import_v48.z.boolean().optional()
|
|
1570
1701
|
}).passthrough().optional()
|
|
1571
1702
|
}).passthrough();
|
|
1572
|
-
var ChannelDefinitionSchema =
|
|
1573
|
-
handle:
|
|
1574
|
-
label:
|
|
1575
|
-
icon:
|
|
1703
|
+
var ChannelDefinitionSchema = import_v48.z.object({
|
|
1704
|
+
handle: import_v48.z.string(),
|
|
1705
|
+
label: import_v48.z.string(),
|
|
1706
|
+
icon: import_v48.z.string().optional(),
|
|
1576
1707
|
/** Array of field definitions for this channel. One field must have identifier: true. */
|
|
1577
|
-
fields:
|
|
1708
|
+
fields: import_v48.z.array(ChannelFieldDefinitionSchema),
|
|
1578
1709
|
// Capabilities keyed by standard type (messaging, voice, video) - all optional
|
|
1579
|
-
capabilities:
|
|
1710
|
+
capabilities: import_v48.z.object({
|
|
1580
1711
|
messaging: ChannelCapabilitySchema.optional(),
|
|
1581
1712
|
voice: ChannelCapabilitySchema.optional(),
|
|
1582
1713
|
video: ChannelCapabilitySchema.optional()
|
|
1583
1714
|
})
|
|
1584
1715
|
});
|
|
1585
|
-
var WorkflowActionInputSchema =
|
|
1586
|
-
key:
|
|
1587
|
-
label:
|
|
1588
|
-
fieldRef:
|
|
1589
|
-
fieldHandle:
|
|
1590
|
-
entityHandle:
|
|
1716
|
+
var WorkflowActionInputSchema = import_v48.z.object({
|
|
1717
|
+
key: import_v48.z.string(),
|
|
1718
|
+
label: import_v48.z.string(),
|
|
1719
|
+
fieldRef: import_v48.z.object({
|
|
1720
|
+
fieldHandle: import_v48.z.string(),
|
|
1721
|
+
entityHandle: import_v48.z.string()
|
|
1591
1722
|
}).optional(),
|
|
1592
|
-
template:
|
|
1593
|
-
});
|
|
1594
|
-
var WorkflowActionSchema =
|
|
1595
|
-
label:
|
|
1596
|
-
handle:
|
|
1597
|
-
batch:
|
|
1598
|
-
entityHandle:
|
|
1599
|
-
inputs:
|
|
1600
|
-
});
|
|
1601
|
-
var WorkflowDefinitionSchema =
|
|
1602
|
-
path:
|
|
1603
|
-
label:
|
|
1604
|
-
handle:
|
|
1605
|
-
requires:
|
|
1606
|
-
actions:
|
|
1607
|
-
});
|
|
1608
|
-
var PageTypeSchema =
|
|
1609
|
-
var PageBlockTypeSchema =
|
|
1610
|
-
var PageFieldTypeSchema =
|
|
1611
|
-
var PageFieldSourceSchema =
|
|
1612
|
-
model:
|
|
1613
|
-
field:
|
|
1614
|
-
});
|
|
1615
|
-
var PageFormHeaderSchema =
|
|
1616
|
-
title:
|
|
1617
|
-
description:
|
|
1618
|
-
});
|
|
1619
|
-
var PageActionDefinitionSchema =
|
|
1620
|
-
handle:
|
|
1621
|
-
label:
|
|
1622
|
-
handler:
|
|
1623
|
-
href:
|
|
1624
|
-
icon:
|
|
1625
|
-
variant:
|
|
1626
|
-
isDisabled:
|
|
1627
|
-
isHidden:
|
|
1723
|
+
template: import_v48.z.string().optional()
|
|
1724
|
+
});
|
|
1725
|
+
var WorkflowActionSchema = import_v48.z.object({
|
|
1726
|
+
label: import_v48.z.string(),
|
|
1727
|
+
handle: import_v48.z.string(),
|
|
1728
|
+
batch: import_v48.z.boolean().optional(),
|
|
1729
|
+
entityHandle: import_v48.z.string().optional(),
|
|
1730
|
+
inputs: import_v48.z.array(WorkflowActionInputSchema).optional()
|
|
1731
|
+
});
|
|
1732
|
+
var WorkflowDefinitionSchema = import_v48.z.object({
|
|
1733
|
+
path: import_v48.z.string(),
|
|
1734
|
+
label: import_v48.z.string().optional(),
|
|
1735
|
+
handle: import_v48.z.string().optional(),
|
|
1736
|
+
requires: import_v48.z.array(ResourceDependencySchema).optional(),
|
|
1737
|
+
actions: import_v48.z.array(WorkflowActionSchema)
|
|
1738
|
+
});
|
|
1739
|
+
var PageTypeSchema = import_v48.z.enum(["INSTANCE", "LIST"]);
|
|
1740
|
+
var PageBlockTypeSchema = import_v48.z.enum(["form", "spreadsheet", "kanban", "calendar", "link", "list", "card"]);
|
|
1741
|
+
var PageFieldTypeSchema = import_v48.z.enum(["STRING", "FILE", "NUMBER", "DATE", "BOOLEAN", "SELECT", "FORM", "RELATIONSHIP"]);
|
|
1742
|
+
var PageFieldSourceSchema = import_v48.z.object({
|
|
1743
|
+
model: import_v48.z.string(),
|
|
1744
|
+
field: import_v48.z.string()
|
|
1745
|
+
});
|
|
1746
|
+
var PageFormHeaderSchema = import_v48.z.object({
|
|
1747
|
+
title: import_v48.z.string(),
|
|
1748
|
+
description: import_v48.z.string().optional()
|
|
1749
|
+
});
|
|
1750
|
+
var PageActionDefinitionSchema = import_v48.z.object({
|
|
1751
|
+
handle: import_v48.z.string(),
|
|
1752
|
+
label: import_v48.z.string(),
|
|
1753
|
+
handler: import_v48.z.string().optional(),
|
|
1754
|
+
href: import_v48.z.string().optional(),
|
|
1755
|
+
icon: import_v48.z.string().optional(),
|
|
1756
|
+
variant: import_v48.z.enum(["primary", "secondary", "destructive", "outline"]).optional(),
|
|
1757
|
+
isDisabled: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional(),
|
|
1758
|
+
isHidden: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional()
|
|
1628
1759
|
}).refine((data) => Boolean(data.handler || data.href), {
|
|
1629
1760
|
message: "Page action requires handler or href"
|
|
1630
1761
|
});
|
|
1631
|
-
var FormV2StylePropsSchema =
|
|
1632
|
-
id:
|
|
1633
|
-
row:
|
|
1634
|
-
col:
|
|
1635
|
-
className:
|
|
1636
|
-
hidden:
|
|
1637
|
-
});
|
|
1638
|
-
var FieldSettingButtonPropsSchema =
|
|
1639
|
-
label:
|
|
1640
|
-
variant:
|
|
1641
|
-
size:
|
|
1642
|
-
isLoading:
|
|
1762
|
+
var FormV2StylePropsSchema = import_v48.z.object({
|
|
1763
|
+
id: import_v48.z.string(),
|
|
1764
|
+
row: import_v48.z.number(),
|
|
1765
|
+
col: import_v48.z.number(),
|
|
1766
|
+
className: import_v48.z.string().optional(),
|
|
1767
|
+
hidden: import_v48.z.boolean().optional()
|
|
1768
|
+
});
|
|
1769
|
+
var FieldSettingButtonPropsSchema = import_v48.z.object({
|
|
1770
|
+
label: import_v48.z.string(),
|
|
1771
|
+
variant: import_v48.z.enum(["default", "destructive", "outline", "secondary", "ghost", "link"]).optional(),
|
|
1772
|
+
size: import_v48.z.enum(["default", "sm", "lg", "icon"]).optional(),
|
|
1773
|
+
isLoading: import_v48.z.boolean().optional(),
|
|
1643
1774
|
/** Can be boolean or Liquid template string that resolves to boolean */
|
|
1644
|
-
isDisabled:
|
|
1645
|
-
leftIcon:
|
|
1775
|
+
isDisabled: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional(),
|
|
1776
|
+
leftIcon: import_v48.z.string().optional()
|
|
1646
1777
|
});
|
|
1647
|
-
var RelationshipExtensionSchema =
|
|
1648
|
-
model:
|
|
1778
|
+
var RelationshipExtensionSchema = import_v48.z.object({
|
|
1779
|
+
model: import_v48.z.string()
|
|
1649
1780
|
});
|
|
1650
|
-
var FormLayoutColumnDefinitionSchema =
|
|
1651
|
-
field:
|
|
1652
|
-
colSpan:
|
|
1653
|
-
dataType:
|
|
1654
|
-
subQuery:
|
|
1781
|
+
var FormLayoutColumnDefinitionSchema = import_v48.z.object({
|
|
1782
|
+
field: import_v48.z.string(),
|
|
1783
|
+
colSpan: import_v48.z.number(),
|
|
1784
|
+
dataType: import_v48.z.string().optional(),
|
|
1785
|
+
subQuery: import_v48.z.unknown().optional()
|
|
1655
1786
|
});
|
|
1656
|
-
var FormLayoutRowDefinitionSchema =
|
|
1657
|
-
columns:
|
|
1787
|
+
var FormLayoutRowDefinitionSchema = import_v48.z.object({
|
|
1788
|
+
columns: import_v48.z.array(FormLayoutColumnDefinitionSchema)
|
|
1658
1789
|
});
|
|
1659
|
-
var FormLayoutConfigDefinitionSchema =
|
|
1660
|
-
type:
|
|
1661
|
-
rows:
|
|
1790
|
+
var FormLayoutConfigDefinitionSchema = import_v48.z.object({
|
|
1791
|
+
type: import_v48.z.literal("form"),
|
|
1792
|
+
rows: import_v48.z.array(FormLayoutRowDefinitionSchema)
|
|
1662
1793
|
});
|
|
1663
1794
|
var InputComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1664
|
-
component:
|
|
1665
|
-
props:
|
|
1666
|
-
label:
|
|
1667
|
-
placeholder:
|
|
1668
|
-
helpText:
|
|
1669
|
-
type:
|
|
1670
|
-
required:
|
|
1671
|
-
disabled:
|
|
1672
|
-
value:
|
|
1795
|
+
component: import_v48.z.literal("Input"),
|
|
1796
|
+
props: import_v48.z.object({
|
|
1797
|
+
label: import_v48.z.string().optional(),
|
|
1798
|
+
placeholder: import_v48.z.string().optional(),
|
|
1799
|
+
helpText: import_v48.z.string().optional(),
|
|
1800
|
+
type: import_v48.z.enum(["text", "number", "email", "password", "tel", "url", "hidden"]).optional(),
|
|
1801
|
+
required: import_v48.z.boolean().optional(),
|
|
1802
|
+
disabled: import_v48.z.boolean().optional(),
|
|
1803
|
+
value: import_v48.z.union([import_v48.z.string(), import_v48.z.number()]).optional()
|
|
1673
1804
|
})
|
|
1674
1805
|
});
|
|
1675
1806
|
var TextareaComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1676
|
-
component:
|
|
1677
|
-
props:
|
|
1678
|
-
label:
|
|
1679
|
-
placeholder:
|
|
1680
|
-
helpText:
|
|
1681
|
-
required:
|
|
1682
|
-
disabled:
|
|
1683
|
-
value:
|
|
1807
|
+
component: import_v48.z.literal("Textarea"),
|
|
1808
|
+
props: import_v48.z.object({
|
|
1809
|
+
label: import_v48.z.string().optional(),
|
|
1810
|
+
placeholder: import_v48.z.string().optional(),
|
|
1811
|
+
helpText: import_v48.z.string().optional(),
|
|
1812
|
+
required: import_v48.z.boolean().optional(),
|
|
1813
|
+
disabled: import_v48.z.boolean().optional(),
|
|
1814
|
+
value: import_v48.z.string().optional()
|
|
1684
1815
|
})
|
|
1685
1816
|
});
|
|
1686
1817
|
var SelectComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1687
|
-
component:
|
|
1688
|
-
props:
|
|
1689
|
-
label:
|
|
1690
|
-
placeholder:
|
|
1691
|
-
helpText:
|
|
1818
|
+
component: import_v48.z.literal("Select"),
|
|
1819
|
+
props: import_v48.z.object({
|
|
1820
|
+
label: import_v48.z.string().optional(),
|
|
1821
|
+
placeholder: import_v48.z.string().optional(),
|
|
1822
|
+
helpText: import_v48.z.string().optional(),
|
|
1692
1823
|
/** Static items array (will be populated by iterable if using dynamic items) */
|
|
1693
|
-
items:
|
|
1694
|
-
value:
|
|
1695
|
-
isDisabled:
|
|
1696
|
-
required:
|
|
1824
|
+
items: import_v48.z.union([import_v48.z.array(import_v48.z.object({ value: import_v48.z.string(), label: import_v48.z.string() })), import_v48.z.string()]).optional(),
|
|
1825
|
+
value: import_v48.z.string().optional(),
|
|
1826
|
+
isDisabled: import_v48.z.boolean().optional(),
|
|
1827
|
+
required: import_v48.z.boolean().optional()
|
|
1697
1828
|
}),
|
|
1698
1829
|
relationship: RelationshipExtensionSchema.optional(),
|
|
1699
1830
|
/** For dynamic items using iterable pattern (e.g., 'system.models') */
|
|
1700
|
-
iterable:
|
|
1831
|
+
iterable: import_v48.z.string().optional(),
|
|
1701
1832
|
/** Template for each item in the iterable */
|
|
1702
|
-
itemTemplate:
|
|
1703
|
-
value:
|
|
1704
|
-
label:
|
|
1833
|
+
itemTemplate: import_v48.z.object({
|
|
1834
|
+
value: import_v48.z.string(),
|
|
1835
|
+
label: import_v48.z.string()
|
|
1705
1836
|
}).optional()
|
|
1706
1837
|
});
|
|
1707
1838
|
var ComboboxComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1708
|
-
component:
|
|
1709
|
-
props:
|
|
1710
|
-
label:
|
|
1711
|
-
placeholder:
|
|
1712
|
-
helpText:
|
|
1713
|
-
items:
|
|
1714
|
-
value:
|
|
1839
|
+
component: import_v48.z.literal("Combobox"),
|
|
1840
|
+
props: import_v48.z.object({
|
|
1841
|
+
label: import_v48.z.string().optional(),
|
|
1842
|
+
placeholder: import_v48.z.string().optional(),
|
|
1843
|
+
helpText: import_v48.z.string().optional(),
|
|
1844
|
+
items: import_v48.z.array(import_v48.z.object({ value: import_v48.z.string(), label: import_v48.z.string() })).optional(),
|
|
1845
|
+
value: import_v48.z.string().optional()
|
|
1715
1846
|
}),
|
|
1716
1847
|
relationship: RelationshipExtensionSchema.optional()
|
|
1717
1848
|
});
|
|
1718
1849
|
var CheckboxComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1719
|
-
component:
|
|
1720
|
-
props:
|
|
1721
|
-
label:
|
|
1722
|
-
helpText:
|
|
1723
|
-
checked:
|
|
1724
|
-
disabled:
|
|
1850
|
+
component: import_v48.z.literal("Checkbox"),
|
|
1851
|
+
props: import_v48.z.object({
|
|
1852
|
+
label: import_v48.z.string().optional(),
|
|
1853
|
+
helpText: import_v48.z.string().optional(),
|
|
1854
|
+
checked: import_v48.z.boolean().optional(),
|
|
1855
|
+
disabled: import_v48.z.boolean().optional()
|
|
1725
1856
|
})
|
|
1726
1857
|
});
|
|
1727
1858
|
var DatePickerComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1728
|
-
component:
|
|
1729
|
-
props:
|
|
1730
|
-
label:
|
|
1731
|
-
helpText:
|
|
1732
|
-
value:
|
|
1733
|
-
disabled:
|
|
1859
|
+
component: import_v48.z.literal("DatePicker"),
|
|
1860
|
+
props: import_v48.z.object({
|
|
1861
|
+
label: import_v48.z.string().optional(),
|
|
1862
|
+
helpText: import_v48.z.string().optional(),
|
|
1863
|
+
value: import_v48.z.union([import_v48.z.string(), import_v48.z.date()]).optional(),
|
|
1864
|
+
disabled: import_v48.z.boolean().optional()
|
|
1734
1865
|
})
|
|
1735
1866
|
});
|
|
1736
1867
|
var TimePickerComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1737
|
-
component:
|
|
1738
|
-
props:
|
|
1739
|
-
label:
|
|
1740
|
-
helpText:
|
|
1741
|
-
value:
|
|
1742
|
-
disabled:
|
|
1868
|
+
component: import_v48.z.literal("TimePicker"),
|
|
1869
|
+
props: import_v48.z.object({
|
|
1870
|
+
label: import_v48.z.string().optional(),
|
|
1871
|
+
helpText: import_v48.z.string().optional(),
|
|
1872
|
+
value: import_v48.z.string().optional(),
|
|
1873
|
+
disabled: import_v48.z.boolean().optional()
|
|
1743
1874
|
})
|
|
1744
1875
|
});
|
|
1745
1876
|
var ImageSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1746
|
-
component:
|
|
1747
|
-
props:
|
|
1748
|
-
label:
|
|
1749
|
-
description:
|
|
1750
|
-
helpText:
|
|
1751
|
-
accept:
|
|
1877
|
+
component: import_v48.z.literal("ImageSetting"),
|
|
1878
|
+
props: import_v48.z.object({
|
|
1879
|
+
label: import_v48.z.string().optional(),
|
|
1880
|
+
description: import_v48.z.string().optional(),
|
|
1881
|
+
helpText: import_v48.z.string().optional(),
|
|
1882
|
+
accept: import_v48.z.string().optional()
|
|
1752
1883
|
})
|
|
1753
1884
|
});
|
|
1754
1885
|
var FileSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1755
|
-
component:
|
|
1756
|
-
props:
|
|
1757
|
-
label:
|
|
1758
|
-
description:
|
|
1759
|
-
helpText:
|
|
1760
|
-
accept:
|
|
1761
|
-
required:
|
|
1762
|
-
button:
|
|
1763
|
-
label:
|
|
1764
|
-
variant:
|
|
1765
|
-
size:
|
|
1886
|
+
component: import_v48.z.literal("FileSetting"),
|
|
1887
|
+
props: import_v48.z.object({
|
|
1888
|
+
label: import_v48.z.string().optional(),
|
|
1889
|
+
description: import_v48.z.string().optional(),
|
|
1890
|
+
helpText: import_v48.z.string().optional(),
|
|
1891
|
+
accept: import_v48.z.string().optional(),
|
|
1892
|
+
required: import_v48.z.boolean().optional(),
|
|
1893
|
+
button: import_v48.z.object({
|
|
1894
|
+
label: import_v48.z.string().optional(),
|
|
1895
|
+
variant: import_v48.z.enum(["default", "outline", "ghost", "link"]).optional(),
|
|
1896
|
+
size: import_v48.z.enum(["sm", "md", "lg"]).optional()
|
|
1766
1897
|
}).optional()
|
|
1767
1898
|
})
|
|
1768
1899
|
});
|
|
1769
|
-
var ListItemTemplateSchema =
|
|
1770
|
-
component:
|
|
1771
|
-
span:
|
|
1772
|
-
mdSpan:
|
|
1773
|
-
lgSpan:
|
|
1774
|
-
props:
|
|
1900
|
+
var ListItemTemplateSchema = import_v48.z.object({
|
|
1901
|
+
component: import_v48.z.string(),
|
|
1902
|
+
span: import_v48.z.number().optional(),
|
|
1903
|
+
mdSpan: import_v48.z.number().optional(),
|
|
1904
|
+
lgSpan: import_v48.z.number().optional(),
|
|
1905
|
+
props: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown())
|
|
1775
1906
|
});
|
|
1776
1907
|
var ListComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1777
|
-
component:
|
|
1778
|
-
props:
|
|
1779
|
-
title:
|
|
1780
|
-
items:
|
|
1781
|
-
id:
|
|
1782
|
-
label:
|
|
1783
|
-
description:
|
|
1908
|
+
component: import_v48.z.literal("List"),
|
|
1909
|
+
props: import_v48.z.object({
|
|
1910
|
+
title: import_v48.z.string().optional(),
|
|
1911
|
+
items: import_v48.z.array(import_v48.z.object({
|
|
1912
|
+
id: import_v48.z.string(),
|
|
1913
|
+
label: import_v48.z.string(),
|
|
1914
|
+
description: import_v48.z.string().optional()
|
|
1784
1915
|
})).optional(),
|
|
1785
|
-
emptyMessage:
|
|
1916
|
+
emptyMessage: import_v48.z.string().optional()
|
|
1786
1917
|
}),
|
|
1787
|
-
model:
|
|
1788
|
-
labelField:
|
|
1789
|
-
descriptionField:
|
|
1790
|
-
icon:
|
|
1918
|
+
model: import_v48.z.string().optional(),
|
|
1919
|
+
labelField: import_v48.z.string().optional(),
|
|
1920
|
+
descriptionField: import_v48.z.string().optional(),
|
|
1921
|
+
icon: import_v48.z.string().optional(),
|
|
1791
1922
|
/** Context variable name to iterate over (e.g., 'phone_numbers') */
|
|
1792
|
-
iterable:
|
|
1923
|
+
iterable: import_v48.z.string().optional(),
|
|
1793
1924
|
/** Template for each item - use {{ item.xyz }} for field values */
|
|
1794
1925
|
itemTemplate: ListItemTemplateSchema.optional()
|
|
1795
1926
|
});
|
|
1796
1927
|
var EmptyFormComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1797
|
-
component:
|
|
1798
|
-
props:
|
|
1799
|
-
title:
|
|
1800
|
-
description:
|
|
1801
|
-
icon:
|
|
1928
|
+
component: import_v48.z.literal("EmptyForm"),
|
|
1929
|
+
props: import_v48.z.object({
|
|
1930
|
+
title: import_v48.z.string().optional(),
|
|
1931
|
+
description: import_v48.z.string().optional(),
|
|
1932
|
+
icon: import_v48.z.string().optional()
|
|
1802
1933
|
})
|
|
1803
1934
|
});
|
|
1804
1935
|
var AlertComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1805
|
-
component:
|
|
1806
|
-
props:
|
|
1807
|
-
title:
|
|
1808
|
-
description:
|
|
1809
|
-
icon:
|
|
1810
|
-
variant:
|
|
1936
|
+
component: import_v48.z.literal("Alert"),
|
|
1937
|
+
props: import_v48.z.object({
|
|
1938
|
+
title: import_v48.z.string(),
|
|
1939
|
+
description: import_v48.z.string(),
|
|
1940
|
+
icon: import_v48.z.string().optional(),
|
|
1941
|
+
variant: import_v48.z.enum(["default", "destructive"]).optional()
|
|
1811
1942
|
})
|
|
1812
1943
|
});
|
|
1813
1944
|
var EventWiringPanelComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1814
|
-
component:
|
|
1815
|
-
props:
|
|
1816
|
-
eventTypes:
|
|
1817
|
-
|
|
1818
|
-
type:
|
|
1819
|
-
label:
|
|
1820
|
-
glofoxType:
|
|
1821
|
-
description:
|
|
1822
|
-
icon:
|
|
1945
|
+
component: import_v48.z.literal("EventWiringPanel"),
|
|
1946
|
+
props: import_v48.z.object({
|
|
1947
|
+
eventTypes: import_v48.z.array(
|
|
1948
|
+
import_v48.z.object({
|
|
1949
|
+
type: import_v48.z.string(),
|
|
1950
|
+
label: import_v48.z.string(),
|
|
1951
|
+
glofoxType: import_v48.z.string().optional(),
|
|
1952
|
+
description: import_v48.z.string().optional(),
|
|
1953
|
+
icon: import_v48.z.string().optional()
|
|
1823
1954
|
})
|
|
1824
1955
|
),
|
|
1825
|
-
recommendedWorkflowHandle:
|
|
1956
|
+
recommendedWorkflowHandle: import_v48.z.string().optional()
|
|
1826
1957
|
})
|
|
1827
1958
|
});
|
|
1828
|
-
var ModalFormDefinitionSchema =
|
|
1959
|
+
var ModalFormDefinitionSchema = import_v48.z.object({
|
|
1829
1960
|
header: PageFormHeaderSchema,
|
|
1830
|
-
handler:
|
|
1961
|
+
handler: import_v48.z.string(),
|
|
1831
1962
|
/** Named dialog template to use instead of inline fields */
|
|
1832
|
-
template:
|
|
1963
|
+
template: import_v48.z.string().optional(),
|
|
1833
1964
|
/** Template-specific params to pass to the dialog */
|
|
1834
|
-
templateParams:
|
|
1965
|
+
templateParams: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional(),
|
|
1835
1966
|
/** Inline field definitions (used when template is not specified) */
|
|
1836
|
-
fields:
|
|
1967
|
+
fields: import_v48.z.lazy(() => import_v48.z.array(FormV2ComponentDefinitionSchema)).optional(),
|
|
1837
1968
|
layout: FormLayoutConfigDefinitionSchema.optional(),
|
|
1838
|
-
actions:
|
|
1969
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional()
|
|
1839
1970
|
});
|
|
1840
1971
|
var FieldSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1841
|
-
component:
|
|
1842
|
-
props:
|
|
1843
|
-
label:
|
|
1844
|
-
description:
|
|
1845
|
-
helpText:
|
|
1846
|
-
mode:
|
|
1972
|
+
component: import_v48.z.literal("FieldSetting"),
|
|
1973
|
+
props: import_v48.z.object({
|
|
1974
|
+
label: import_v48.z.string(),
|
|
1975
|
+
description: import_v48.z.string().optional(),
|
|
1976
|
+
helpText: import_v48.z.string().optional(),
|
|
1977
|
+
mode: import_v48.z.enum(["field", "setting"]).optional(),
|
|
1847
1978
|
/** Status indicator - can be literal or Liquid template */
|
|
1848
|
-
status:
|
|
1979
|
+
status: import_v48.z.string().optional(),
|
|
1849
1980
|
/** Text to display alongside status badge - can be Liquid template */
|
|
1850
|
-
statusText:
|
|
1981
|
+
statusText: import_v48.z.string().optional(),
|
|
1851
1982
|
button: FieldSettingButtonPropsSchema
|
|
1852
1983
|
}),
|
|
1853
1984
|
modalForm: ModalFormDefinitionSchema.optional()
|
|
1854
1985
|
});
|
|
1855
|
-
var FormV2ComponentDefinitionSchema =
|
|
1986
|
+
var FormV2ComponentDefinitionSchema = import_v48.z.discriminatedUnion("component", [
|
|
1856
1987
|
InputComponentDefinitionSchema,
|
|
1857
1988
|
TextareaComponentDefinitionSchema,
|
|
1858
1989
|
SelectComponentDefinitionSchema,
|
|
@@ -1868,82 +1999,82 @@ var FormV2ComponentDefinitionSchema = import_v47.z.discriminatedUnion("component
|
|
|
1868
1999
|
AlertComponentDefinitionSchema,
|
|
1869
2000
|
EventWiringPanelComponentDefinitionSchema
|
|
1870
2001
|
]);
|
|
1871
|
-
var FormV2PropsDefinitionSchema =
|
|
1872
|
-
formVersion:
|
|
1873
|
-
id:
|
|
1874
|
-
fields:
|
|
2002
|
+
var FormV2PropsDefinitionSchema = import_v48.z.object({
|
|
2003
|
+
formVersion: import_v48.z.literal("v2"),
|
|
2004
|
+
id: import_v48.z.string().optional(),
|
|
2005
|
+
fields: import_v48.z.array(FormV2ComponentDefinitionSchema),
|
|
1875
2006
|
layout: FormLayoutConfigDefinitionSchema,
|
|
1876
2007
|
/** Optional actions that trigger MCP tool calls */
|
|
1877
|
-
actions:
|
|
2008
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional()
|
|
1878
2009
|
});
|
|
1879
|
-
var CardBlockHeaderSchema =
|
|
1880
|
-
title:
|
|
1881
|
-
description:
|
|
1882
|
-
descriptionHref:
|
|
2010
|
+
var CardBlockHeaderSchema = import_v48.z.object({
|
|
2011
|
+
title: import_v48.z.string(),
|
|
2012
|
+
description: import_v48.z.string().optional(),
|
|
2013
|
+
descriptionHref: import_v48.z.string().optional()
|
|
1883
2014
|
});
|
|
1884
|
-
var CardBlockDefinitionSchema =
|
|
1885
|
-
type:
|
|
1886
|
-
restructurable:
|
|
2015
|
+
var CardBlockDefinitionSchema = import_v48.z.object({
|
|
2016
|
+
type: import_v48.z.literal("card"),
|
|
2017
|
+
restructurable: import_v48.z.boolean().optional(),
|
|
1887
2018
|
header: CardBlockHeaderSchema.optional(),
|
|
1888
2019
|
form: FormV2PropsDefinitionSchema,
|
|
1889
|
-
actions:
|
|
1890
|
-
secondaryActions:
|
|
1891
|
-
primaryActions:
|
|
2020
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional(),
|
|
2021
|
+
secondaryActions: import_v48.z.array(PageActionDefinitionSchema).optional(),
|
|
2022
|
+
primaryActions: import_v48.z.array(PageActionDefinitionSchema).optional()
|
|
1892
2023
|
});
|
|
1893
|
-
var PageFieldDefinitionBaseSchema =
|
|
1894
|
-
handle:
|
|
2024
|
+
var PageFieldDefinitionBaseSchema = import_v48.z.object({
|
|
2025
|
+
handle: import_v48.z.string(),
|
|
1895
2026
|
type: PageFieldTypeSchema,
|
|
1896
|
-
label:
|
|
1897
|
-
description:
|
|
1898
|
-
required:
|
|
1899
|
-
handler:
|
|
2027
|
+
label: import_v48.z.string(),
|
|
2028
|
+
description: import_v48.z.string().optional(),
|
|
2029
|
+
required: import_v48.z.boolean().optional(),
|
|
2030
|
+
handler: import_v48.z.string().optional(),
|
|
1900
2031
|
source: PageFieldSourceSchema.optional(),
|
|
1901
|
-
options:
|
|
1902
|
-
accept:
|
|
1903
|
-
model:
|
|
2032
|
+
options: import_v48.z.array(import_v48.z.object({ value: import_v48.z.string(), label: import_v48.z.string() })).optional(),
|
|
2033
|
+
accept: import_v48.z.string().optional(),
|
|
2034
|
+
model: import_v48.z.string().optional()
|
|
1904
2035
|
});
|
|
1905
2036
|
var PageFieldDefinitionSchema = PageFieldDefinitionBaseSchema.extend({
|
|
1906
2037
|
header: PageFormHeaderSchema.optional(),
|
|
1907
|
-
fields:
|
|
1908
|
-
actions:
|
|
1909
|
-
});
|
|
1910
|
-
var LegacyFormBlockDefinitionSchema =
|
|
1911
|
-
type:
|
|
1912
|
-
title:
|
|
1913
|
-
fields:
|
|
1914
|
-
readonly:
|
|
1915
|
-
});
|
|
1916
|
-
var ListBlockDefinitionSchema =
|
|
1917
|
-
type:
|
|
1918
|
-
title:
|
|
1919
|
-
model:
|
|
1920
|
-
labelField:
|
|
1921
|
-
descriptionField:
|
|
1922
|
-
icon:
|
|
1923
|
-
emptyMessage:
|
|
1924
|
-
});
|
|
1925
|
-
var ModelMapperBlockDefinitionSchema =
|
|
1926
|
-
type:
|
|
2038
|
+
fields: import_v48.z.lazy(() => import_v48.z.array(PageFieldDefinitionSchema)).optional(),
|
|
2039
|
+
actions: import_v48.z.lazy(() => import_v48.z.array(PageActionDefinitionSchema)).optional()
|
|
2040
|
+
});
|
|
2041
|
+
var LegacyFormBlockDefinitionSchema = import_v48.z.object({
|
|
2042
|
+
type: import_v48.z.enum(["form", "spreadsheet", "kanban", "calendar", "link"]),
|
|
2043
|
+
title: import_v48.z.string().optional(),
|
|
2044
|
+
fields: import_v48.z.array(PageFieldDefinitionSchema).optional(),
|
|
2045
|
+
readonly: import_v48.z.boolean().optional()
|
|
2046
|
+
});
|
|
2047
|
+
var ListBlockDefinitionSchema = import_v48.z.object({
|
|
2048
|
+
type: import_v48.z.literal("list"),
|
|
2049
|
+
title: import_v48.z.string().optional(),
|
|
2050
|
+
model: import_v48.z.string(),
|
|
2051
|
+
labelField: import_v48.z.string().optional(),
|
|
2052
|
+
descriptionField: import_v48.z.string().optional(),
|
|
2053
|
+
icon: import_v48.z.string().optional(),
|
|
2054
|
+
emptyMessage: import_v48.z.string().optional()
|
|
2055
|
+
});
|
|
2056
|
+
var ModelMapperBlockDefinitionSchema = import_v48.z.object({
|
|
2057
|
+
type: import_v48.z.literal("model_mapper"),
|
|
1927
2058
|
/** The SHARED model handle from install config (e.g., "client", "patient") */
|
|
1928
|
-
model:
|
|
2059
|
+
model: import_v48.z.string()
|
|
1929
2060
|
});
|
|
1930
|
-
var PageBlockDefinitionSchema =
|
|
2061
|
+
var PageBlockDefinitionSchema = import_v48.z.union([
|
|
1931
2062
|
CardBlockDefinitionSchema,
|
|
1932
2063
|
LegacyFormBlockDefinitionSchema,
|
|
1933
2064
|
ListBlockDefinitionSchema,
|
|
1934
2065
|
ModelMapperBlockDefinitionSchema
|
|
1935
2066
|
]);
|
|
1936
|
-
var PageContextModeSchema =
|
|
1937
|
-
var PageContextFiltersSchema =
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
2067
|
+
var PageContextModeSchema = import_v48.z.enum(["first", "many", "count", "all"]).transform((val) => val === "all" ? "many" : val);
|
|
2068
|
+
var PageContextFiltersSchema = import_v48.z.record(
|
|
2069
|
+
import_v48.z.string(),
|
|
2070
|
+
import_v48.z.record(
|
|
2071
|
+
import_v48.z.string(),
|
|
2072
|
+
import_v48.z.union([PrimitiveSchema, import_v48.z.array(PrimitiveSchema), import_v48.z.string()])
|
|
1942
2073
|
)
|
|
1943
2074
|
);
|
|
1944
|
-
var PageContextItemDefinitionSchema =
|
|
2075
|
+
var PageContextItemDefinitionSchema = import_v48.z.object({
|
|
1945
2076
|
/** Model handle to fetch data from */
|
|
1946
|
-
model:
|
|
2077
|
+
model: import_v48.z.string(),
|
|
1947
2078
|
/** Fetch mode: 'first' returns single object, 'many' returns array, 'count' returns number */
|
|
1948
2079
|
mode: PageContextModeSchema,
|
|
1949
2080
|
/**
|
|
@@ -1953,69 +2084,69 @@ var PageContextItemDefinitionSchema = import_v47.z.object({
|
|
|
1953
2084
|
*/
|
|
1954
2085
|
filters: PageContextFiltersSchema.optional(),
|
|
1955
2086
|
/** Optional limit for 'many' mode */
|
|
1956
|
-
limit:
|
|
2087
|
+
limit: import_v48.z.number().optional()
|
|
1957
2088
|
});
|
|
1958
|
-
var PageContextToolItemDefinitionSchema =
|
|
2089
|
+
var PageContextToolItemDefinitionSchema = import_v48.z.object({
|
|
1959
2090
|
/** Tool name to invoke for fetching context data */
|
|
1960
|
-
tool:
|
|
2091
|
+
tool: import_v48.z.string()
|
|
1961
2092
|
});
|
|
1962
|
-
var PageContextDefinitionSchema =
|
|
1963
|
-
|
|
1964
|
-
|
|
2093
|
+
var PageContextDefinitionSchema = import_v48.z.record(
|
|
2094
|
+
import_v48.z.string(),
|
|
2095
|
+
import_v48.z.union([PageContextItemDefinitionSchema, PageContextToolItemDefinitionSchema])
|
|
1965
2096
|
);
|
|
1966
|
-
var PageInstanceFilterSchema =
|
|
1967
|
-
model:
|
|
1968
|
-
where:
|
|
2097
|
+
var PageInstanceFilterSchema = import_v48.z.object({
|
|
2098
|
+
model: import_v48.z.string(),
|
|
2099
|
+
where: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional()
|
|
1969
2100
|
});
|
|
1970
|
-
var NavigationItemSchema =
|
|
2101
|
+
var NavigationItemSchema = import_v48.z.object({
|
|
1971
2102
|
/** Display label (supports Liquid templates) */
|
|
1972
|
-
label:
|
|
2103
|
+
label: import_v48.z.string(),
|
|
1973
2104
|
/** URL href (supports Liquid templates with path_params and context) */
|
|
1974
|
-
href:
|
|
2105
|
+
href: import_v48.z.string(),
|
|
1975
2106
|
/** Optional icon name */
|
|
1976
|
-
icon:
|
|
2107
|
+
icon: import_v48.z.string().optional(),
|
|
1977
2108
|
/** When true, item is omitted from rendered navigation (supports Liquid templates) */
|
|
1978
|
-
hidden:
|
|
2109
|
+
hidden: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional()
|
|
1979
2110
|
});
|
|
1980
|
-
var NavigationSectionSchema =
|
|
2111
|
+
var NavigationSectionSchema = import_v48.z.object({
|
|
1981
2112
|
/** Section title (supports Liquid templates) */
|
|
1982
|
-
title:
|
|
2113
|
+
title: import_v48.z.string().optional(),
|
|
1983
2114
|
/** Navigation items in this section */
|
|
1984
|
-
items:
|
|
2115
|
+
items: import_v48.z.array(NavigationItemSchema)
|
|
1985
2116
|
});
|
|
1986
|
-
var NavigationSidebarSchema =
|
|
2117
|
+
var NavigationSidebarSchema = import_v48.z.object({
|
|
1987
2118
|
/** Sections to display in the sidebar */
|
|
1988
|
-
sections:
|
|
2119
|
+
sections: import_v48.z.array(NavigationSectionSchema)
|
|
1989
2120
|
});
|
|
1990
|
-
var BreadcrumbItemSchema =
|
|
2121
|
+
var BreadcrumbItemSchema = import_v48.z.object({
|
|
1991
2122
|
/** Display label (supports Liquid templates) */
|
|
1992
|
-
label:
|
|
2123
|
+
label: import_v48.z.string(),
|
|
1993
2124
|
/** Optional href - if not provided, item is not clickable */
|
|
1994
|
-
href:
|
|
2125
|
+
href: import_v48.z.string().optional()
|
|
1995
2126
|
});
|
|
1996
|
-
var NavigationBreadcrumbSchema =
|
|
2127
|
+
var NavigationBreadcrumbSchema = import_v48.z.object({
|
|
1997
2128
|
/** Breadcrumb items from left to right */
|
|
1998
|
-
items:
|
|
2129
|
+
items: import_v48.z.array(BreadcrumbItemSchema)
|
|
1999
2130
|
});
|
|
2000
|
-
var NavigationConfigSchema =
|
|
2131
|
+
var NavigationConfigSchema = import_v48.z.object({
|
|
2001
2132
|
/** Sidebar navigation */
|
|
2002
2133
|
sidebar: NavigationSidebarSchema.optional(),
|
|
2003
2134
|
/** Breadcrumb navigation */
|
|
2004
2135
|
breadcrumb: NavigationBreadcrumbSchema.optional()
|
|
2005
2136
|
});
|
|
2006
|
-
var PageAudienceSchema =
|
|
2007
|
-
var PageDefinitionSchema =
|
|
2137
|
+
var PageAudienceSchema = import_v48.z.enum(["install", "developer", "both"]);
|
|
2138
|
+
var PageDefinitionSchema = import_v48.z.object({
|
|
2008
2139
|
/** Unique identifier within the app (snake_case) */
|
|
2009
|
-
handle:
|
|
2140
|
+
handle: import_v48.z.string().optional(),
|
|
2010
2141
|
/** Human-readable display name */
|
|
2011
|
-
label:
|
|
2142
|
+
label: import_v48.z.string(),
|
|
2012
2143
|
/** Optional description for documentation/UI */
|
|
2013
|
-
description:
|
|
2144
|
+
description: import_v48.z.string().optional(),
|
|
2014
2145
|
type: PageTypeSchema,
|
|
2015
2146
|
/** URL path for this page (e.g., '/phone-numbers' or '/phone-numbers/[id]' for dynamic segments) */
|
|
2016
|
-
path:
|
|
2147
|
+
path: import_v48.z.string(),
|
|
2017
2148
|
/** When true, this page is the default landing page for the app installation */
|
|
2018
|
-
default:
|
|
2149
|
+
default: import_v48.z.boolean().optional(),
|
|
2019
2150
|
/**
|
|
2020
2151
|
* Page audience:
|
|
2021
2152
|
* - 'install': Visible only to app installers (default)
|
|
@@ -2029,115 +2160,171 @@ var PageDefinitionSchema = import_v47.z.object({
|
|
|
2029
2160
|
* - string: Liquid template that evaluates to true/false
|
|
2030
2161
|
* - NavigationConfigSchema: full navigation override for this page (replaces base navigation)
|
|
2031
2162
|
*/
|
|
2032
|
-
navigation:
|
|
2033
|
-
blocks:
|
|
2034
|
-
actions:
|
|
2163
|
+
navigation: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string(), NavigationConfigSchema]).optional().default(true),
|
|
2164
|
+
blocks: import_v48.z.array(PageBlockDefinitionSchema),
|
|
2165
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional(),
|
|
2035
2166
|
/** Context data to load for Liquid templates. appInstallationId filtering is automatic. */
|
|
2036
2167
|
context: PageContextDefinitionSchema.optional(),
|
|
2037
2168
|
/** @deprecated Use context instead */
|
|
2038
2169
|
filter: PageInstanceFilterSchema.optional()
|
|
2039
2170
|
});
|
|
2040
|
-
var WebhookHttpMethodSchema =
|
|
2041
|
-
var WebhookTypeSchema =
|
|
2042
|
-
var WebhookHandlerDefinitionSchema =
|
|
2043
|
-
description:
|
|
2044
|
-
methods:
|
|
2171
|
+
var WebhookHttpMethodSchema = import_v48.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]);
|
|
2172
|
+
var WebhookTypeSchema = import_v48.z.enum(["WEBHOOK", "CALLBACK"]);
|
|
2173
|
+
var WebhookHandlerDefinitionSchema = import_v48.z.object({
|
|
2174
|
+
description: import_v48.z.string().optional(),
|
|
2175
|
+
methods: import_v48.z.array(WebhookHttpMethodSchema).optional(),
|
|
2045
2176
|
/** Invocation type: WEBHOOK (fire-and-forget) or CALLBACK (waits for response). Defaults to WEBHOOK. */
|
|
2046
2177
|
type: WebhookTypeSchema.optional(),
|
|
2047
|
-
handler:
|
|
2178
|
+
handler: import_v48.z.unknown()
|
|
2048
2179
|
});
|
|
2049
|
-
var WebhooksSchema =
|
|
2050
|
-
var AgentDefinitionSchema =
|
|
2180
|
+
var WebhooksSchema = import_v48.z.record(import_v48.z.string(), WebhookHandlerDefinitionSchema);
|
|
2181
|
+
var AgentDefinitionSchema = import_v48.z.object({
|
|
2051
2182
|
/** Unique identifier within the app (used for upserts) */
|
|
2052
|
-
handle:
|
|
2183
|
+
handle: import_v48.z.string().regex(/^[a-z0-9_-]+$/, "Handle must be lowercase alphanumeric with dashes/underscores"),
|
|
2053
2184
|
/** Display name */
|
|
2054
|
-
name:
|
|
2185
|
+
name: import_v48.z.string().min(1),
|
|
2055
2186
|
/** Description of what the agent does */
|
|
2056
|
-
description:
|
|
2187
|
+
description: import_v48.z.string(),
|
|
2057
2188
|
/** System prompt (static, no templating) */
|
|
2058
|
-
system:
|
|
2189
|
+
system: import_v48.z.string(),
|
|
2059
2190
|
/** Tool names to bind (can be empty for orchestrator agents) */
|
|
2060
|
-
tools:
|
|
2191
|
+
tools: import_v48.z.array(import_v48.z.string()),
|
|
2061
2192
|
/** Optional LLM model override */
|
|
2062
|
-
llmModelId:
|
|
2193
|
+
llmModelId: import_v48.z.string().optional(),
|
|
2063
2194
|
/** Parent agent that can call this agent ('composer' or another agent handle) */
|
|
2064
|
-
parentAgent:
|
|
2195
|
+
parentAgent: import_v48.z.string().optional()
|
|
2065
2196
|
});
|
|
2066
|
-
var InstallConfigSchema =
|
|
2197
|
+
var InstallConfigSchema = import_v48.z.object({
|
|
2067
2198
|
env: EnvSchemaSchema.optional(),
|
|
2068
2199
|
/** SHARED model definitions (mapped to user's existing data during installation) */
|
|
2069
|
-
models:
|
|
2200
|
+
models: import_v48.z.array(ModelDefinitionSchema).optional(),
|
|
2070
2201
|
/** Relationship definitions between SHARED models */
|
|
2071
|
-
relationships:
|
|
2202
|
+
relationships: import_v48.z.array(RelationshipDefinitionSchema).optional()
|
|
2072
2203
|
});
|
|
2073
|
-
var ProvisionConfigSchema =
|
|
2204
|
+
var ProvisionConfigSchema = import_v48.z.object({
|
|
2074
2205
|
env: EnvSchemaSchema.optional(),
|
|
2075
2206
|
/** INTERNAL model definitions (app-owned, not visible to users) */
|
|
2076
|
-
models:
|
|
2207
|
+
models: import_v48.z.array(ModelDefinitionSchema).optional(),
|
|
2077
2208
|
/** Relationship definitions between INTERNAL models */
|
|
2078
|
-
relationships:
|
|
2079
|
-
channels:
|
|
2080
|
-
workflows:
|
|
2209
|
+
relationships: import_v48.z.array(RelationshipDefinitionSchema).optional(),
|
|
2210
|
+
channels: import_v48.z.array(ChannelDefinitionSchema).optional(),
|
|
2211
|
+
workflows: import_v48.z.array(WorkflowDefinitionSchema).optional(),
|
|
2081
2212
|
/** Base navigation configuration for all pages (can be overridden per page) */
|
|
2082
2213
|
navigation: NavigationConfigSchema.optional(),
|
|
2083
|
-
pages:
|
|
2214
|
+
pages: import_v48.z.array(PageDefinitionSchema).optional()
|
|
2084
2215
|
});
|
|
2085
|
-
var SkedyulConfigSchema =
|
|
2086
|
-
name:
|
|
2087
|
-
version:
|
|
2088
|
-
description:
|
|
2216
|
+
var SkedyulConfigSchema = import_v48.z.object({
|
|
2217
|
+
name: import_v48.z.string(),
|
|
2218
|
+
version: import_v48.z.string().optional(),
|
|
2219
|
+
description: import_v48.z.string().optional(),
|
|
2089
2220
|
computeLayer: ComputeLayerTypeSchema.optional(),
|
|
2090
|
-
tools:
|
|
2091
|
-
webhooks:
|
|
2092
|
-
provision:
|
|
2093
|
-
agents:
|
|
2221
|
+
tools: import_v48.z.unknown().optional(),
|
|
2222
|
+
webhooks: import_v48.z.unknown().optional(),
|
|
2223
|
+
provision: import_v48.z.union([ProvisionConfigSchema, import_v48.z.unknown()]).optional(),
|
|
2224
|
+
agents: import_v48.z.array(AgentDefinitionSchema).optional()
|
|
2094
2225
|
});
|
|
2095
2226
|
function safeParseConfig(data) {
|
|
2096
2227
|
const result = SkedyulConfigSchema.safeParse(data);
|
|
2097
2228
|
return result.success ? result.data : null;
|
|
2098
2229
|
}
|
|
2099
|
-
var MessageSendChannelSchema =
|
|
2100
|
-
id:
|
|
2101
|
-
handle:
|
|
2102
|
-
identifierValue:
|
|
2103
|
-
});
|
|
2104
|
-
var MessageSendSubscriptionSchema =
|
|
2105
|
-
id:
|
|
2106
|
-
identifierValue:
|
|
2107
|
-
});
|
|
2108
|
-
var MessageSendContactSchema =
|
|
2109
|
-
id:
|
|
2110
|
-
name:
|
|
2111
|
-
});
|
|
2112
|
-
var MessageSendRecipientSchema =
|
|
2113
|
-
address:
|
|
2114
|
-
name:
|
|
2115
|
-
participantId:
|
|
2116
|
-
contactId:
|
|
2117
|
-
});
|
|
2118
|
-
var MessageSendAttachmentSchema =
|
|
2119
|
-
filename:
|
|
2120
|
-
url:
|
|
2121
|
-
mimeType:
|
|
2122
|
-
size:
|
|
2123
|
-
});
|
|
2124
|
-
var MessageSendMessageSchema =
|
|
2125
|
-
id:
|
|
2126
|
-
content:
|
|
2127
|
-
contentRaw:
|
|
2128
|
-
title:
|
|
2129
|
-
attachments:
|
|
2130
|
-
});
|
|
2131
|
-
var MessageSendInputSchema =
|
|
2230
|
+
var MessageSendChannelSchema = import_v48.z.object({
|
|
2231
|
+
id: import_v48.z.string(),
|
|
2232
|
+
handle: import_v48.z.string(),
|
|
2233
|
+
identifierValue: import_v48.z.string()
|
|
2234
|
+
});
|
|
2235
|
+
var MessageSendSubscriptionSchema = import_v48.z.object({
|
|
2236
|
+
id: import_v48.z.string(),
|
|
2237
|
+
identifierValue: import_v48.z.string()
|
|
2238
|
+
});
|
|
2239
|
+
var MessageSendContactSchema = import_v48.z.object({
|
|
2240
|
+
id: import_v48.z.string(),
|
|
2241
|
+
name: import_v48.z.string().optional()
|
|
2242
|
+
});
|
|
2243
|
+
var MessageSendRecipientSchema = import_v48.z.object({
|
|
2244
|
+
address: import_v48.z.string(),
|
|
2245
|
+
name: import_v48.z.string().optional(),
|
|
2246
|
+
participantId: import_v48.z.string().optional(),
|
|
2247
|
+
contactId: import_v48.z.string().optional()
|
|
2248
|
+
});
|
|
2249
|
+
var MessageSendAttachmentSchema = import_v48.z.object({
|
|
2250
|
+
filename: import_v48.z.string(),
|
|
2251
|
+
url: import_v48.z.string(),
|
|
2252
|
+
mimeType: import_v48.z.string(),
|
|
2253
|
+
size: import_v48.z.number()
|
|
2254
|
+
});
|
|
2255
|
+
var MessageSendMessageSchema = import_v48.z.object({
|
|
2256
|
+
id: import_v48.z.string(),
|
|
2257
|
+
content: import_v48.z.string(),
|
|
2258
|
+
contentRaw: import_v48.z.string().optional(),
|
|
2259
|
+
title: import_v48.z.string().optional(),
|
|
2260
|
+
attachments: import_v48.z.array(MessageSendAttachmentSchema).optional()
|
|
2261
|
+
});
|
|
2262
|
+
var MessageSendInputSchema = import_v48.z.object({
|
|
2132
2263
|
channel: MessageSendChannelSchema,
|
|
2133
2264
|
subscription: MessageSendSubscriptionSchema.optional(),
|
|
2134
2265
|
contact: MessageSendContactSchema.optional(),
|
|
2135
2266
|
recipient: MessageSendRecipientSchema.optional(),
|
|
2136
2267
|
message: MessageSendMessageSchema
|
|
2137
2268
|
});
|
|
2138
|
-
var MessageSendOutputSchema =
|
|
2139
|
-
status:
|
|
2140
|
-
remoteId:
|
|
2269
|
+
var MessageSendOutputSchema = import_v48.z.object({
|
|
2270
|
+
status: import_v48.z.enum(["sent", "queued", "failed"]),
|
|
2271
|
+
remoteId: import_v48.z.string().optional()
|
|
2272
|
+
});
|
|
2273
|
+
var MessageBulkRecipientSchema = import_v48.z.object({
|
|
2274
|
+
address: import_v48.z.string(),
|
|
2275
|
+
renderedBody: import_v48.z.string(),
|
|
2276
|
+
instanceId: import_v48.z.string().optional(),
|
|
2277
|
+
threadId: import_v48.z.string().optional(),
|
|
2278
|
+
messageId: import_v48.z.string().optional(),
|
|
2279
|
+
contactId: import_v48.z.string().optional()
|
|
2280
|
+
});
|
|
2281
|
+
var MessageBulkSendInputSchema = import_v48.z.object({
|
|
2282
|
+
channel: MessageSendChannelSchema,
|
|
2283
|
+
recipients: import_v48.z.array(MessageBulkRecipientSchema).min(1).max(1e4),
|
|
2284
|
+
schedule: import_v48.z.object({ at: import_v48.z.string() }).optional()
|
|
2285
|
+
});
|
|
2286
|
+
var MessageBulkSendOutputSchema = import_v48.z.object({
|
|
2287
|
+
status: import_v48.z.enum(["accepted", "failed"]),
|
|
2288
|
+
operationId: import_v48.z.string().optional(),
|
|
2289
|
+
acceptedCount: import_v48.z.number().int().nonnegative(),
|
|
2290
|
+
rejectedCount: import_v48.z.number().int().nonnegative().optional()
|
|
2291
|
+
});
|
|
2292
|
+
var MessageBulkStatusMessageSchema = import_v48.z.object({
|
|
2293
|
+
address: import_v48.z.string(),
|
|
2294
|
+
status: import_v48.z.string(),
|
|
2295
|
+
messageId: import_v48.z.string().optional(),
|
|
2296
|
+
errorCode: import_v48.z.union([import_v48.z.string(), import_v48.z.number()]).optional(),
|
|
2297
|
+
errorMessage: import_v48.z.string().optional()
|
|
2298
|
+
});
|
|
2299
|
+
var MessageBulkStatusStatsSchema = import_v48.z.object({
|
|
2300
|
+
total: import_v48.z.number().int().nonnegative().optional(),
|
|
2301
|
+
recipients: import_v48.z.number().int().nonnegative().optional(),
|
|
2302
|
+
attempts: import_v48.z.number().int().nonnegative().optional(),
|
|
2303
|
+
unaddressable: import_v48.z.number().int().nonnegative().optional(),
|
|
2304
|
+
queued: import_v48.z.number().int().nonnegative().optional(),
|
|
2305
|
+
sent: import_v48.z.number().int().nonnegative().optional(),
|
|
2306
|
+
scheduled: import_v48.z.number().int().nonnegative().optional(),
|
|
2307
|
+
delivered: import_v48.z.number().int().nonnegative().optional(),
|
|
2308
|
+
read: import_v48.z.number().int().nonnegative().optional(),
|
|
2309
|
+
undelivered: import_v48.z.number().int().nonnegative().optional(),
|
|
2310
|
+
failed: import_v48.z.number().int().nonnegative().optional(),
|
|
2311
|
+
canceled: import_v48.z.number().int().nonnegative().optional()
|
|
2312
|
+
});
|
|
2313
|
+
var MessageBulkStatusInputSchema = import_v48.z.object({
|
|
2314
|
+
channel: MessageSendChannelSchema,
|
|
2315
|
+
operationId: import_v48.z.string().min(1)
|
|
2316
|
+
});
|
|
2317
|
+
var MessageBulkStatusOutputSchema = import_v48.z.object({
|
|
2318
|
+
operationId: import_v48.z.string(),
|
|
2319
|
+
status: import_v48.z.string(),
|
|
2320
|
+
complete: import_v48.z.boolean(),
|
|
2321
|
+
/**
|
|
2322
|
+
* When true, the provider skipped real delivery (e.g. MOCK_OUTBOUND_MESSAGES).
|
|
2323
|
+
* Core should mark all recipients in the operation as sent without per-message rows.
|
|
2324
|
+
*/
|
|
2325
|
+
mock: import_v48.z.boolean().optional(),
|
|
2326
|
+
stats: MessageBulkStatusStatsSchema.optional(),
|
|
2327
|
+
messages: import_v48.z.array(MessageBulkStatusMessageSchema)
|
|
2141
2328
|
});
|
|
2142
2329
|
function isModelDependency(dep) {
|
|
2143
2330
|
return "model" in dep;
|
|
@@ -2151,7 +2338,7 @@ function isWorkflowDependency(dep) {
|
|
|
2151
2338
|
|
|
2152
2339
|
// src/server/index.ts
|
|
2153
2340
|
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
2154
|
-
var
|
|
2341
|
+
var z11 = __toESM(require("zod"));
|
|
2155
2342
|
|
|
2156
2343
|
// src/core/service.ts
|
|
2157
2344
|
var CoreApiService = class {
|
|
@@ -2260,17 +2447,20 @@ function getQueueConfigWithRetry(queueName) {
|
|
|
2260
2447
|
}
|
|
2261
2448
|
|
|
2262
2449
|
// src/server/utils/schema.ts
|
|
2263
|
-
var
|
|
2450
|
+
var z9 = __toESM(require("zod"));
|
|
2264
2451
|
function normalizeBilling(billing) {
|
|
2265
|
-
if (!billing || typeof billing
|
|
2452
|
+
if (!billing || typeof billing !== "object") {
|
|
2266
2453
|
return { credits: 0 };
|
|
2267
2454
|
}
|
|
2455
|
+
if (typeof billing.credits !== "number") {
|
|
2456
|
+
return { ...billing, credits: 0 };
|
|
2457
|
+
}
|
|
2268
2458
|
return billing;
|
|
2269
2459
|
}
|
|
2270
2460
|
function toJsonSchema(schema) {
|
|
2271
2461
|
if (!schema) return void 0;
|
|
2272
2462
|
try {
|
|
2273
|
-
return
|
|
2463
|
+
return z9.toJSONSchema(schema, {
|
|
2274
2464
|
unrepresentable: "any"
|
|
2275
2465
|
// Handle z.date(), z.bigint() etc gracefully
|
|
2276
2466
|
});
|
|
@@ -2281,12 +2471,12 @@ function toJsonSchema(schema) {
|
|
|
2281
2471
|
}
|
|
2282
2472
|
function isToolSchemaWithJson(schema) {
|
|
2283
2473
|
return Boolean(
|
|
2284
|
-
schema && typeof schema === "object" && "zod" in schema && schema.zod instanceof
|
|
2474
|
+
schema && typeof schema === "object" && "zod" in schema && schema.zod instanceof z9.ZodType
|
|
2285
2475
|
);
|
|
2286
2476
|
}
|
|
2287
2477
|
function getZodSchema(schema) {
|
|
2288
2478
|
if (!schema) return void 0;
|
|
2289
|
-
if (schema instanceof
|
|
2479
|
+
if (schema instanceof z9.ZodType) {
|
|
2290
2480
|
return schema;
|
|
2291
2481
|
}
|
|
2292
2482
|
if (isToolSchemaWithJson(schema)) {
|
|
@@ -2433,7 +2623,7 @@ function buildToolCallErrorOutput(result) {
|
|
|
2433
2623
|
|
|
2434
2624
|
// src/core/client.ts
|
|
2435
2625
|
var import_async_hooks = require("async_hooks");
|
|
2436
|
-
var
|
|
2626
|
+
var import_v49 = require("zod/v4");
|
|
2437
2627
|
var requestConfigStorage = new import_async_hooks.AsyncLocalStorage();
|
|
2438
2628
|
var globalConfig = {
|
|
2439
2629
|
baseUrl: process.env.SKEDYUL_API_URL ?? process.env.SKEDYUL_NODE_URL ?? "",
|
|
@@ -3413,7 +3603,7 @@ var resource = {
|
|
|
3413
3603
|
}
|
|
3414
3604
|
};
|
|
3415
3605
|
function zodSchemaToJsonSchema(schema) {
|
|
3416
|
-
return
|
|
3606
|
+
return import_v49.z.toJSONSchema(schema);
|
|
3417
3607
|
}
|
|
3418
3608
|
var ai = {
|
|
3419
3609
|
/**
|
|
@@ -3639,10 +3829,27 @@ function getActiveQueuedOperation() {
|
|
|
3639
3829
|
function getActiveQueuedOperationStack() {
|
|
3640
3830
|
return activeOperationStackStorage.getStore() ?? [];
|
|
3641
3831
|
}
|
|
3642
|
-
function
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3832
|
+
function getActiveMutexQueueNames() {
|
|
3833
|
+
const names = /* @__PURE__ */ new Set();
|
|
3834
|
+
for (const operation of getActiveQueuedOperationStack()) {
|
|
3835
|
+
if (operation.lease === null) {
|
|
3836
|
+
continue;
|
|
3837
|
+
}
|
|
3838
|
+
const config = getQueueConfigWithRetry(operation.resolved.name);
|
|
3839
|
+
if (config?.mutex === true) {
|
|
3840
|
+
names.add(operation.resolved.name);
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
return [...names];
|
|
3844
|
+
}
|
|
3845
|
+
function shouldSkipNestedAcquire(queueName) {
|
|
3846
|
+
for (const mutexQueueName of getActiveMutexQueueNames()) {
|
|
3847
|
+
const config = getQueueConfigWithRetry(mutexQueueName);
|
|
3848
|
+
if (config?.suppressesQueues?.includes(queueName)) {
|
|
3849
|
+
return true;
|
|
3850
|
+
}
|
|
3851
|
+
}
|
|
3852
|
+
return false;
|
|
3646
3853
|
}
|
|
3647
3854
|
function setActiveQueuedOperationLease(lease) {
|
|
3648
3855
|
const op = activeOperationStorage.getStore();
|
|
@@ -3879,6 +4086,7 @@ function buildToolMetadata(registry) {
|
|
|
3879
4086
|
const timeout = typeof rawTimeout === "number" && rawTimeout > 0 ? rawTimeout : 1e4;
|
|
3880
4087
|
const retries = typeof rawRetries === "number" && rawRetries >= 1 ? rawRetries : 1;
|
|
3881
4088
|
const queueTouchPoints = tool.queueTouchPoints ?? toolConfig.queueTouchPoints;
|
|
4089
|
+
const rateLimitHandoff = tool.rateLimitHandoff ?? toolConfig.rateLimitHandoff;
|
|
3882
4090
|
return {
|
|
3883
4091
|
name: tool.name,
|
|
3884
4092
|
displayName: tool.label || tool.name,
|
|
@@ -3889,11 +4097,13 @@ function buildToolMetadata(registry) {
|
|
|
3889
4097
|
timeout,
|
|
3890
4098
|
retries,
|
|
3891
4099
|
queueTouchPoints,
|
|
4100
|
+
rateLimitHandoff,
|
|
3892
4101
|
config: {
|
|
3893
4102
|
timeout,
|
|
3894
4103
|
retries,
|
|
3895
4104
|
completionHints: toolConfig.completionHints,
|
|
3896
|
-
queueTouchPoints
|
|
4105
|
+
queueTouchPoints,
|
|
4106
|
+
rateLimitHandoff
|
|
3897
4107
|
}
|
|
3898
4108
|
};
|
|
3899
4109
|
});
|
|
@@ -3935,7 +4145,8 @@ function createCallToolHandler(registry, state, onMaxRequests) {
|
|
|
3935
4145
|
}
|
|
3936
4146
|
const fn = tool.handler;
|
|
3937
4147
|
const args = toolArgsInput ?? {};
|
|
3938
|
-
const
|
|
4148
|
+
const rawContextForMode = args.context ?? {};
|
|
4149
|
+
const estimateMode = args.estimate === true || rawContextForMode.mode === "estimate";
|
|
3939
4150
|
if (!estimateMode) {
|
|
3940
4151
|
state.incrementRequestCount();
|
|
3941
4152
|
if (state.shouldShutdown()) {
|
|
@@ -4422,7 +4633,8 @@ function serializeConfig(config) {
|
|
|
4422
4633
|
// Read timeout/retries from top-level first, then fallback to config
|
|
4423
4634
|
timeout: tool.timeout ?? tool.config?.timeout,
|
|
4424
4635
|
retries: tool.retries ?? tool.config?.retries,
|
|
4425
|
-
queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints
|
|
4636
|
+
queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints,
|
|
4637
|
+
rateLimitHandoff: tool.rateLimitHandoff ?? tool.config?.rateLimitHandoff
|
|
4426
4638
|
})) : [],
|
|
4427
4639
|
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
4428
4640
|
name: w.name,
|
|
@@ -5117,11 +5329,12 @@ async function handleMcpRoute(req, ctx) {
|
|
|
5117
5329
|
async function handleMcpToolsCall(params, id, ctx) {
|
|
5118
5330
|
const toolName = params?.name;
|
|
5119
5331
|
const rawArgs = params?.arguments ?? {};
|
|
5120
|
-
const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs;
|
|
5332
|
+
const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs || "estimate" in rawArgs;
|
|
5121
5333
|
const toolInputs = hasSkedyulFormat ? rawArgs.inputs ?? {} : rawArgs;
|
|
5122
5334
|
const toolContext = hasSkedyulFormat ? rawArgs.context : void 0;
|
|
5123
5335
|
const toolEnv = hasSkedyulFormat ? rawArgs.env : void 0;
|
|
5124
5336
|
const toolInvocation = hasSkedyulFormat ? rawArgs.invocation : void 0;
|
|
5337
|
+
const estimate = hasSkedyulFormat && rawArgs.estimate === true;
|
|
5125
5338
|
const found = findToolInRegistry(ctx.registry, toolName);
|
|
5126
5339
|
if (!found) {
|
|
5127
5340
|
return {
|
|
@@ -5146,7 +5359,8 @@ async function handleMcpToolsCall(params, id, ctx) {
|
|
|
5146
5359
|
inputs: validatedInputs,
|
|
5147
5360
|
context: toolContext,
|
|
5148
5361
|
env: toolEnv,
|
|
5149
|
-
invocation: toolInvocation
|
|
5362
|
+
invocation: toolInvocation,
|
|
5363
|
+
estimate
|
|
5150
5364
|
});
|
|
5151
5365
|
let result;
|
|
5152
5366
|
const isFailure2 = isToolCallFailure(toolResult);
|
|
@@ -5604,12 +5818,12 @@ function createSkedyulServer(config) {
|
|
|
5604
5818
|
const toolDisplayName = tool.label || toolName;
|
|
5605
5819
|
const inputZodSchema = getZodSchema(tool.inputSchema);
|
|
5606
5820
|
const outputZodSchema = getZodSchema(tool.outputSchema);
|
|
5607
|
-
const wrappedInputSchema =
|
|
5608
|
-
inputs: inputZodSchema ??
|
|
5609
|
-
context:
|
|
5610
|
-
env:
|
|
5611
|
-
invocation:
|
|
5612
|
-
estimate:
|
|
5821
|
+
const wrappedInputSchema = z11.object({
|
|
5822
|
+
inputs: inputZodSchema ?? z11.record(z11.string(), z11.unknown()).optional(),
|
|
5823
|
+
context: z11.record(z11.string(), z11.unknown()).optional(),
|
|
5824
|
+
env: z11.record(z11.string(), z11.string()).optional(),
|
|
5825
|
+
invocation: z11.record(z11.string(), z11.unknown()).optional(),
|
|
5826
|
+
estimate: z11.boolean().optional()
|
|
5613
5827
|
}).passthrough();
|
|
5614
5828
|
mcpServer.registerTool(
|
|
5615
5829
|
toolName,
|
|
@@ -6318,7 +6532,7 @@ async function executeWithRetries(operation, maxRetries) {
|
|
|
6318
6532
|
operation.resolved.queueKey,
|
|
6319
6533
|
rateLimitCtx
|
|
6320
6534
|
);
|
|
6321
|
-
if (operation.resolved.name
|
|
6535
|
+
if (shouldSkipNestedAcquire(operation.resolved.name)) {
|
|
6322
6536
|
return operation.fn();
|
|
6323
6537
|
}
|
|
6324
6538
|
if (preAcquired) {
|
|
@@ -6422,86 +6636,86 @@ async function queuedFetchResponse(queueInput, url, init) {
|
|
|
6422
6636
|
}
|
|
6423
6637
|
|
|
6424
6638
|
// src/triggers/types.ts
|
|
6425
|
-
var
|
|
6426
|
-
var CRMDataSchema =
|
|
6427
|
-
model:
|
|
6428
|
-
instanceId:
|
|
6429
|
-
data:
|
|
6639
|
+
var import_v410 = require("zod/v4");
|
|
6640
|
+
var CRMDataSchema = import_v410.z.object({
|
|
6641
|
+
model: import_v410.z.string(),
|
|
6642
|
+
instanceId: import_v410.z.string(),
|
|
6643
|
+
data: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown())
|
|
6430
6644
|
});
|
|
6431
|
-
var SenderContextSchema2 =
|
|
6645
|
+
var SenderContextSchema2 = import_v410.z.object({
|
|
6432
6646
|
kind: ParticipantKindSchema,
|
|
6433
|
-
displayName:
|
|
6647
|
+
displayName: import_v410.z.string().optional(),
|
|
6434
6648
|
crm: CRMDataSchema.optional()
|
|
6435
6649
|
});
|
|
6436
|
-
var ThreadContextItemSchema2 =
|
|
6437
|
-
handle:
|
|
6438
|
-
model:
|
|
6439
|
-
instanceId:
|
|
6440
|
-
data:
|
|
6650
|
+
var ThreadContextItemSchema2 = import_v410.z.object({
|
|
6651
|
+
handle: import_v410.z.string(),
|
|
6652
|
+
model: import_v410.z.string(),
|
|
6653
|
+
instanceId: import_v410.z.string(),
|
|
6654
|
+
data: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional()
|
|
6441
6655
|
});
|
|
6442
|
-
var ParticipantContextSchema =
|
|
6443
|
-
id:
|
|
6656
|
+
var ParticipantContextSchema = import_v410.z.object({
|
|
6657
|
+
id: import_v410.z.string(),
|
|
6444
6658
|
kind: ParticipantKindSchema,
|
|
6445
|
-
displayName:
|
|
6446
|
-
contactId:
|
|
6447
|
-
memberId:
|
|
6448
|
-
agentId:
|
|
6449
|
-
workflowId:
|
|
6659
|
+
displayName: import_v410.z.string().optional(),
|
|
6660
|
+
contactId: import_v410.z.string().optional(),
|
|
6661
|
+
memberId: import_v410.z.string().optional(),
|
|
6662
|
+
agentId: import_v410.z.string().optional(),
|
|
6663
|
+
workflowId: import_v410.z.string().optional()
|
|
6450
6664
|
});
|
|
6451
|
-
var TriggerContextSchema =
|
|
6665
|
+
var TriggerContextSchema = import_v410.z.object({
|
|
6452
6666
|
// The event that triggered this
|
|
6453
|
-
event:
|
|
6667
|
+
event: import_v410.z.object({
|
|
6454
6668
|
type: EventTypeSchema,
|
|
6455
|
-
payload:
|
|
6669
|
+
payload: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()),
|
|
6456
6670
|
participant: ParticipantContextSchema.optional()
|
|
6457
6671
|
}),
|
|
6458
6672
|
// Thread information
|
|
6459
|
-
thread:
|
|
6460
|
-
id:
|
|
6461
|
-
title:
|
|
6462
|
-
status:
|
|
6673
|
+
thread: import_v410.z.object({
|
|
6674
|
+
id: import_v410.z.string(),
|
|
6675
|
+
title: import_v410.z.string().optional(),
|
|
6676
|
+
status: import_v410.z.string().optional(),
|
|
6463
6677
|
sender: SenderContextSchema2.optional(),
|
|
6464
|
-
context:
|
|
6465
|
-
participants:
|
|
6678
|
+
context: import_v410.z.record(import_v410.z.string(), CRMDataSchema).optional(),
|
|
6679
|
+
participants: import_v410.z.array(ParticipantContextSchema).optional()
|
|
6466
6680
|
}),
|
|
6467
6681
|
// Workplace info
|
|
6468
|
-
workplace:
|
|
6469
|
-
id:
|
|
6470
|
-
name:
|
|
6471
|
-
settings:
|
|
6682
|
+
workplace: import_v410.z.object({
|
|
6683
|
+
id: import_v410.z.string(),
|
|
6684
|
+
name: import_v410.z.string().optional(),
|
|
6685
|
+
settings: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional()
|
|
6472
6686
|
})
|
|
6473
6687
|
});
|
|
6474
|
-
var InputMappingSchema =
|
|
6475
|
-
var EventConditionsSchema =
|
|
6476
|
-
var TriggerConfigSchema =
|
|
6477
|
-
id:
|
|
6478
|
-
workflowId:
|
|
6479
|
-
workflowVersionId:
|
|
6480
|
-
workplaceId:
|
|
6481
|
-
handle:
|
|
6688
|
+
var InputMappingSchema = import_v410.z.record(import_v410.z.string(), import_v410.z.string());
|
|
6689
|
+
var EventConditionsSchema = import_v410.z.record(import_v410.z.string(), import_v410.z.string());
|
|
6690
|
+
var TriggerConfigSchema = import_v410.z.object({
|
|
6691
|
+
id: import_v410.z.string(),
|
|
6692
|
+
workflowId: import_v410.z.string(),
|
|
6693
|
+
workflowVersionId: import_v410.z.string().optional(),
|
|
6694
|
+
workplaceId: import_v410.z.string(),
|
|
6695
|
+
handle: import_v410.z.string(),
|
|
6482
6696
|
// Input mappings: how to resolve workflow inputs from thread context
|
|
6483
6697
|
inputMappings: InputMappingSchema.optional(),
|
|
6484
6698
|
// Event conditions: additional workplace-specific conditions
|
|
6485
6699
|
eventConditions: EventConditionsSchema.optional(),
|
|
6486
6700
|
// Workplace-specific config overrides
|
|
6487
|
-
config:
|
|
6701
|
+
config: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional(),
|
|
6488
6702
|
// Trigger type and status
|
|
6489
|
-
type:
|
|
6490
|
-
isEnabled:
|
|
6703
|
+
type: import_v410.z.string().optional(),
|
|
6704
|
+
isEnabled: import_v410.z.boolean().optional()
|
|
6491
6705
|
});
|
|
6492
|
-
var ResolvedTriggerSchema =
|
|
6706
|
+
var ResolvedTriggerSchema = import_v410.z.object({
|
|
6493
6707
|
trigger: TriggerConfigSchema,
|
|
6494
|
-
workflow:
|
|
6495
|
-
id:
|
|
6496
|
-
handle:
|
|
6497
|
-
name:
|
|
6498
|
-
inputs:
|
|
6499
|
-
events:
|
|
6500
|
-
subscribes:
|
|
6501
|
-
condition:
|
|
6708
|
+
workflow: import_v410.z.object({
|
|
6709
|
+
id: import_v410.z.string(),
|
|
6710
|
+
handle: import_v410.z.string(),
|
|
6711
|
+
name: import_v410.z.string().optional(),
|
|
6712
|
+
inputs: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional(),
|
|
6713
|
+
events: import_v410.z.object({
|
|
6714
|
+
subscribes: import_v410.z.array(EventTypeSchema).optional(),
|
|
6715
|
+
condition: import_v410.z.string().optional()
|
|
6502
6716
|
}).optional()
|
|
6503
6717
|
}),
|
|
6504
|
-
inputs:
|
|
6718
|
+
inputs: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()),
|
|
6505
6719
|
context: TriggerContextSchema
|
|
6506
6720
|
});
|
|
6507
6721
|
var TriggerResolutionError = class extends Error {
|
|
@@ -6512,13 +6726,13 @@ var TriggerResolutionError = class extends Error {
|
|
|
6512
6726
|
this.name = "TriggerResolutionError";
|
|
6513
6727
|
}
|
|
6514
6728
|
};
|
|
6515
|
-
var WorkflowInputDefinitionSchema =
|
|
6516
|
-
type:
|
|
6517
|
-
required:
|
|
6518
|
-
description:
|
|
6519
|
-
default:
|
|
6729
|
+
var WorkflowInputDefinitionSchema = import_v410.z.object({
|
|
6730
|
+
type: import_v410.z.string(),
|
|
6731
|
+
required: import_v410.z.boolean().optional(),
|
|
6732
|
+
description: import_v410.z.string().optional(),
|
|
6733
|
+
default: import_v410.z.unknown().optional()
|
|
6520
6734
|
});
|
|
6521
|
-
var WorkflowInputSchemaSchema =
|
|
6735
|
+
var WorkflowInputSchemaSchema = import_v410.z.record(import_v410.z.string(), WorkflowInputDefinitionSchema);
|
|
6522
6736
|
|
|
6523
6737
|
// src/triggers/resolver.ts
|
|
6524
6738
|
function evaluateTemplate(template, context) {
|
|
@@ -6600,67 +6814,67 @@ function matchesTrigger(trigger, eventType, context) {
|
|
|
6600
6814
|
}
|
|
6601
6815
|
|
|
6602
6816
|
// src/workflows/types.ts
|
|
6603
|
-
var
|
|
6817
|
+
var import_v411 = require("zod/v4");
|
|
6604
6818
|
var WORKFLOW_SCHEMA_VERSION = "https://skedyul.com/schemas/workflow/v1";
|
|
6605
|
-
var WorkflowInputSchema =
|
|
6606
|
-
type:
|
|
6607
|
-
required:
|
|
6608
|
-
description:
|
|
6609
|
-
default:
|
|
6610
|
-
});
|
|
6611
|
-
var WorkflowStepInputSchema =
|
|
6612
|
-
var WorkflowStepSchema =
|
|
6819
|
+
var WorkflowInputSchema = import_v411.z.object({
|
|
6820
|
+
type: import_v411.z.string(),
|
|
6821
|
+
required: import_v411.z.boolean().optional().default(false),
|
|
6822
|
+
description: import_v411.z.string().optional(),
|
|
6823
|
+
default: import_v411.z.unknown().optional()
|
|
6824
|
+
});
|
|
6825
|
+
var WorkflowStepInputSchema = import_v411.z.union([import_v411.z.string(), import_v411.z.number(), import_v411.z.boolean(), import_v411.z.record(import_v411.z.string(), import_v411.z.unknown())]);
|
|
6826
|
+
var WorkflowStepSchema = import_v411.z.object({
|
|
6613
6827
|
// Service and command
|
|
6614
|
-
service:
|
|
6615
|
-
cmd:
|
|
6828
|
+
service: import_v411.z.string(),
|
|
6829
|
+
cmd: import_v411.z.string(),
|
|
6616
6830
|
// Dependencies
|
|
6617
|
-
needs:
|
|
6831
|
+
needs: import_v411.z.array(import_v411.z.string()).optional(),
|
|
6618
6832
|
// Inputs (Liquid templates supported)
|
|
6619
|
-
inputs:
|
|
6833
|
+
inputs: import_v411.z.record(import_v411.z.string(), WorkflowStepInputSchema).optional(),
|
|
6620
6834
|
// Conditional execution
|
|
6621
|
-
condition:
|
|
6835
|
+
condition: import_v411.z.string().optional(),
|
|
6622
6836
|
// Retry configuration
|
|
6623
|
-
retry:
|
|
6624
|
-
attempts:
|
|
6625
|
-
backoff:
|
|
6837
|
+
retry: import_v411.z.object({
|
|
6838
|
+
attempts: import_v411.z.number().optional(),
|
|
6839
|
+
backoff: import_v411.z.enum(["linear", "exponential"]).optional()
|
|
6626
6840
|
}).optional(),
|
|
6627
6841
|
// Timeout
|
|
6628
|
-
timeout:
|
|
6629
|
-
});
|
|
6630
|
-
var WorkflowRuntimeSchema =
|
|
6631
|
-
durable:
|
|
6632
|
-
timeout:
|
|
6633
|
-
retry:
|
|
6634
|
-
attempts:
|
|
6635
|
-
backoff:
|
|
6842
|
+
timeout: import_v411.z.string().optional()
|
|
6843
|
+
});
|
|
6844
|
+
var WorkflowRuntimeSchema = import_v411.z.object({
|
|
6845
|
+
durable: import_v411.z.boolean().optional().default(true),
|
|
6846
|
+
timeout: import_v411.z.string().optional(),
|
|
6847
|
+
retry: import_v411.z.object({
|
|
6848
|
+
attempts: import_v411.z.number().optional(),
|
|
6849
|
+
backoff: import_v411.z.enum(["linear", "exponential"]).optional()
|
|
6636
6850
|
}).optional()
|
|
6637
6851
|
});
|
|
6638
|
-
var WorkflowYAMLSchema =
|
|
6852
|
+
var WorkflowYAMLSchema = import_v411.z.object({
|
|
6639
6853
|
// Schema version
|
|
6640
|
-
$schema:
|
|
6854
|
+
$schema: import_v411.z.string().optional(),
|
|
6641
6855
|
// Identity
|
|
6642
|
-
handle:
|
|
6643
|
-
name:
|
|
6644
|
-
version:
|
|
6645
|
-
description:
|
|
6856
|
+
handle: import_v411.z.string(),
|
|
6857
|
+
name: import_v411.z.string(),
|
|
6858
|
+
version: import_v411.z.string().optional(),
|
|
6859
|
+
description: import_v411.z.string().optional(),
|
|
6646
6860
|
// Inputs this workflow needs (portable, declared in YAML)
|
|
6647
|
-
inputs:
|
|
6861
|
+
inputs: import_v411.z.record(import_v411.z.string(), WorkflowInputSchema).optional(),
|
|
6648
6862
|
// Event subscriptions and conditions
|
|
6649
6863
|
events: EventsConfigSchema.optional(),
|
|
6650
6864
|
// Deterministic steps
|
|
6651
|
-
steps:
|
|
6865
|
+
steps: import_v411.z.record(import_v411.z.string(), WorkflowStepSchema),
|
|
6652
6866
|
// Runtime configuration
|
|
6653
6867
|
runtime: WorkflowRuntimeSchema.optional()
|
|
6654
6868
|
});
|
|
6655
|
-
var WorkflowMetadataSchema =
|
|
6656
|
-
handle:
|
|
6657
|
-
name:
|
|
6658
|
-
version:
|
|
6659
|
-
description:
|
|
6660
|
-
inputs:
|
|
6869
|
+
var WorkflowMetadataSchema = import_v411.z.object({
|
|
6870
|
+
handle: import_v411.z.string(),
|
|
6871
|
+
name: import_v411.z.string(),
|
|
6872
|
+
version: import_v411.z.string().optional(),
|
|
6873
|
+
description: import_v411.z.string().optional(),
|
|
6874
|
+
inputs: import_v411.z.record(import_v411.z.string(), WorkflowInputDefinitionSchema).optional(),
|
|
6661
6875
|
events: EventsConfigSchema.optional()
|
|
6662
6876
|
});
|
|
6663
|
-
var WorkflowExecutionStatusSchema =
|
|
6877
|
+
var WorkflowExecutionStatusSchema = import_v411.z.enum([
|
|
6664
6878
|
"PENDING",
|
|
6665
6879
|
"RUNNING",
|
|
6666
6880
|
"COMPLETED",
|
|
@@ -6668,14 +6882,14 @@ var WorkflowExecutionStatusSchema = import_v410.z.enum([
|
|
|
6668
6882
|
"CANCELLED",
|
|
6669
6883
|
"WAITING"
|
|
6670
6884
|
]);
|
|
6671
|
-
var WorkflowExecutionResultSchema =
|
|
6885
|
+
var WorkflowExecutionResultSchema = import_v411.z.object({
|
|
6672
6886
|
status: WorkflowExecutionStatusSchema,
|
|
6673
|
-
outputs:
|
|
6674
|
-
error:
|
|
6675
|
-
startedAt:
|
|
6676
|
-
completedAt:
|
|
6677
|
-
cancelledAt:
|
|
6678
|
-
cancelReason:
|
|
6887
|
+
outputs: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()).optional(),
|
|
6888
|
+
error: import_v411.z.string().optional(),
|
|
6889
|
+
startedAt: import_v411.z.string().datetime().optional(),
|
|
6890
|
+
completedAt: import_v411.z.string().datetime().optional(),
|
|
6891
|
+
cancelledAt: import_v411.z.string().datetime().optional(),
|
|
6892
|
+
cancelReason: import_v411.z.string().optional()
|
|
6679
6893
|
});
|
|
6680
6894
|
function defineWorkflowYAML(workflow) {
|
|
6681
6895
|
return WorkflowYAMLSchema.parse(workflow);
|
|
@@ -6753,8 +6967,8 @@ function getAssociationByModel(context, model) {
|
|
|
6753
6967
|
}
|
|
6754
6968
|
|
|
6755
6969
|
// src/memory/types.ts
|
|
6756
|
-
var
|
|
6757
|
-
var MemoryEntryTypeSchema =
|
|
6970
|
+
var import_v412 = require("zod/v4");
|
|
6971
|
+
var MemoryEntryTypeSchema = import_v412.z.enum([
|
|
6758
6972
|
"WORKING",
|
|
6759
6973
|
// Current conversation context
|
|
6760
6974
|
"OBSERVATION",
|
|
@@ -6764,80 +6978,80 @@ var MemoryEntryTypeSchema = import_v411.z.enum([
|
|
|
6764
6978
|
"SEMANTIC"
|
|
6765
6979
|
// Semantic memory for retrieval
|
|
6766
6980
|
]);
|
|
6767
|
-
var MemoryEntrySchema =
|
|
6768
|
-
id:
|
|
6981
|
+
var MemoryEntrySchema = import_v412.z.object({
|
|
6982
|
+
id: import_v412.z.string(),
|
|
6769
6983
|
type: MemoryEntryTypeSchema,
|
|
6770
|
-
key:
|
|
6771
|
-
value:
|
|
6772
|
-
metadata:
|
|
6773
|
-
expiresAt:
|
|
6774
|
-
createdAt:
|
|
6775
|
-
updatedAt:
|
|
6776
|
-
});
|
|
6777
|
-
var WorkingMemoryConfigSchema2 =
|
|
6778
|
-
strategy:
|
|
6779
|
-
maxTokens:
|
|
6780
|
-
summarizeAt:
|
|
6781
|
-
ttl:
|
|
6782
|
-
});
|
|
6783
|
-
var SemanticMemoryConfigSchema2 =
|
|
6784
|
-
enabled:
|
|
6785
|
-
topK:
|
|
6786
|
-
scope:
|
|
6787
|
-
minScore:
|
|
6788
|
-
});
|
|
6789
|
-
var ExternalMemoryConfigSchema2 =
|
|
6790
|
-
namespace:
|
|
6791
|
-
ttl:
|
|
6792
|
-
});
|
|
6793
|
-
var MemoryConfigSchema =
|
|
6984
|
+
key: import_v412.z.string(),
|
|
6985
|
+
value: import_v412.z.unknown(),
|
|
6986
|
+
metadata: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).optional(),
|
|
6987
|
+
expiresAt: import_v412.z.string().datetime().optional(),
|
|
6988
|
+
createdAt: import_v412.z.string().datetime(),
|
|
6989
|
+
updatedAt: import_v412.z.string().datetime()
|
|
6990
|
+
});
|
|
6991
|
+
var WorkingMemoryConfigSchema2 = import_v412.z.object({
|
|
6992
|
+
strategy: import_v412.z.enum(["full", "rolling_summary", "sliding_window"]).default("rolling_summary"),
|
|
6993
|
+
maxTokens: import_v412.z.number().default(8e3),
|
|
6994
|
+
summarizeAt: import_v412.z.number().optional(),
|
|
6995
|
+
ttl: import_v412.z.string().optional()
|
|
6996
|
+
});
|
|
6997
|
+
var SemanticMemoryConfigSchema2 = import_v412.z.object({
|
|
6998
|
+
enabled: import_v412.z.boolean().default(false),
|
|
6999
|
+
topK: import_v412.z.number().default(5),
|
|
7000
|
+
scope: import_v412.z.enum(["thread", "instance", "workspace"]).default("thread"),
|
|
7001
|
+
minScore: import_v412.z.number().default(0.7)
|
|
7002
|
+
});
|
|
7003
|
+
var ExternalMemoryConfigSchema2 = import_v412.z.object({
|
|
7004
|
+
namespace: import_v412.z.string(),
|
|
7005
|
+
ttl: import_v412.z.string().optional()
|
|
7006
|
+
});
|
|
7007
|
+
var MemoryConfigSchema = import_v412.z.object({
|
|
6794
7008
|
working: WorkingMemoryConfigSchema2.optional(),
|
|
6795
7009
|
semantic: SemanticMemoryConfigSchema2.optional(),
|
|
6796
7010
|
external: ExternalMemoryConfigSchema2.optional(),
|
|
6797
|
-
persistent:
|
|
6798
|
-
namespace:
|
|
7011
|
+
persistent: import_v412.z.object({
|
|
7012
|
+
namespace: import_v412.z.string()
|
|
6799
7013
|
}).optional()
|
|
6800
7014
|
});
|
|
6801
|
-
var MemoryScopeSchema =
|
|
6802
|
-
threadId:
|
|
6803
|
-
participantId:
|
|
6804
|
-
agentId:
|
|
6805
|
-
workplaceId:
|
|
6806
|
-
namespace:
|
|
6807
|
-
});
|
|
6808
|
-
var MemoryQueryOptionsSchema =
|
|
6809
|
-
types:
|
|
6810
|
-
keys:
|
|
6811
|
-
limit:
|
|
6812
|
-
includeExpired:
|
|
6813
|
-
});
|
|
6814
|
-
var ConversationSummarySchema =
|
|
6815
|
-
summary:
|
|
6816
|
-
keyPoints:
|
|
6817
|
-
entities:
|
|
6818
|
-
name:
|
|
6819
|
-
type:
|
|
6820
|
-
relevance:
|
|
7015
|
+
var MemoryScopeSchema = import_v412.z.object({
|
|
7016
|
+
threadId: import_v412.z.string().optional(),
|
|
7017
|
+
participantId: import_v412.z.string().optional(),
|
|
7018
|
+
agentId: import_v412.z.string().optional(),
|
|
7019
|
+
workplaceId: import_v412.z.string().optional(),
|
|
7020
|
+
namespace: import_v412.z.string().optional()
|
|
7021
|
+
});
|
|
7022
|
+
var MemoryQueryOptionsSchema = import_v412.z.object({
|
|
7023
|
+
types: import_v412.z.array(MemoryEntryTypeSchema).optional(),
|
|
7024
|
+
keys: import_v412.z.array(import_v412.z.string()).optional(),
|
|
7025
|
+
limit: import_v412.z.number().default(100),
|
|
7026
|
+
includeExpired: import_v412.z.boolean().default(false)
|
|
7027
|
+
});
|
|
7028
|
+
var ConversationSummarySchema = import_v412.z.object({
|
|
7029
|
+
summary: import_v412.z.string(),
|
|
7030
|
+
keyPoints: import_v412.z.array(import_v412.z.string()),
|
|
7031
|
+
entities: import_v412.z.array(import_v412.z.object({
|
|
7032
|
+
name: import_v412.z.string(),
|
|
7033
|
+
type: import_v412.z.string(),
|
|
7034
|
+
relevance: import_v412.z.number()
|
|
6821
7035
|
})),
|
|
6822
|
-
lastMessageId:
|
|
6823
|
-
messageCount:
|
|
6824
|
-
tokenCount:
|
|
6825
|
-
createdAt:
|
|
6826
|
-
});
|
|
6827
|
-
var AgentObservationSchema =
|
|
6828
|
-
observation:
|
|
6829
|
-
confidence:
|
|
6830
|
-
source:
|
|
6831
|
-
context:
|
|
6832
|
-
createdAt:
|
|
6833
|
-
});
|
|
6834
|
-
var ExternalDataCacheSchema =
|
|
6835
|
-
source:
|
|
6836
|
-
endpoint:
|
|
6837
|
-
data:
|
|
6838
|
-
fetchedAt:
|
|
6839
|
-
expiresAt:
|
|
6840
|
-
metadata:
|
|
7036
|
+
lastMessageId: import_v412.z.string().optional(),
|
|
7037
|
+
messageCount: import_v412.z.number(),
|
|
7038
|
+
tokenCount: import_v412.z.number(),
|
|
7039
|
+
createdAt: import_v412.z.string().datetime()
|
|
7040
|
+
});
|
|
7041
|
+
var AgentObservationSchema = import_v412.z.object({
|
|
7042
|
+
observation: import_v412.z.string(),
|
|
7043
|
+
confidence: import_v412.z.number().min(0).max(1),
|
|
7044
|
+
source: import_v412.z.enum(["inference", "explicit", "tool_result"]),
|
|
7045
|
+
context: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).optional(),
|
|
7046
|
+
createdAt: import_v412.z.string().datetime()
|
|
7047
|
+
});
|
|
7048
|
+
var ExternalDataCacheSchema = import_v412.z.object({
|
|
7049
|
+
source: import_v412.z.string(),
|
|
7050
|
+
endpoint: import_v412.z.string().optional(),
|
|
7051
|
+
data: import_v412.z.unknown(),
|
|
7052
|
+
fetchedAt: import_v412.z.string().datetime(),
|
|
7053
|
+
expiresAt: import_v412.z.string().datetime().optional(),
|
|
7054
|
+
metadata: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).optional()
|
|
6841
7055
|
});
|
|
6842
7056
|
|
|
6843
7057
|
// src/memory/service.ts
|
|
@@ -7428,16 +7642,16 @@ function estimateTokens(agent, skills) {
|
|
|
7428
7642
|
}
|
|
7429
7643
|
|
|
7430
7644
|
// src/scheduling/types.ts
|
|
7431
|
-
var
|
|
7432
|
-
var TimeStampSchema =
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
hour:
|
|
7436
|
-
minute:
|
|
7437
|
-
second:
|
|
7645
|
+
var import_v413 = require("zod/v4");
|
|
7646
|
+
var TimeStampSchema = import_v413.z.union([
|
|
7647
|
+
import_v413.z.number().describe("Hour of day (0-23)"),
|
|
7648
|
+
import_v413.z.object({
|
|
7649
|
+
hour: import_v413.z.number(),
|
|
7650
|
+
minute: import_v413.z.number().optional().default(0),
|
|
7651
|
+
second: import_v413.z.number().optional().default(0)
|
|
7438
7652
|
})
|
|
7439
7653
|
]);
|
|
7440
|
-
var DayOfWeekSchema =
|
|
7654
|
+
var DayOfWeekSchema = import_v413.z.enum([
|
|
7441
7655
|
"monday",
|
|
7442
7656
|
"tuesday",
|
|
7443
7657
|
"wednesday",
|
|
@@ -7446,13 +7660,13 @@ var DayOfWeekSchema = import_v412.z.enum([
|
|
|
7446
7660
|
"saturday",
|
|
7447
7661
|
"sunday"
|
|
7448
7662
|
]);
|
|
7449
|
-
var TimeWindowSlotSchema =
|
|
7663
|
+
var TimeWindowSlotSchema = import_v413.z.object({
|
|
7450
7664
|
startTime: TimeStampSchema,
|
|
7451
7665
|
endTime: TimeStampSchema,
|
|
7452
|
-
days:
|
|
7453
|
-
timezone:
|
|
7666
|
+
days: import_v413.z.array(DayOfWeekSchema),
|
|
7667
|
+
timezone: import_v413.z.string().optional()
|
|
7454
7668
|
});
|
|
7455
|
-
var WaitUnitSchema =
|
|
7669
|
+
var WaitUnitSchema = import_v413.z.enum([
|
|
7456
7670
|
"second",
|
|
7457
7671
|
"seconds",
|
|
7458
7672
|
"minute",
|
|
@@ -7468,17 +7682,17 @@ var WaitUnitSchema = import_v412.z.enum([
|
|
|
7468
7682
|
"year",
|
|
7469
7683
|
"years"
|
|
7470
7684
|
]);
|
|
7471
|
-
var WaitInputRelativeSchema =
|
|
7472
|
-
mode:
|
|
7473
|
-
amount:
|
|
7685
|
+
var WaitInputRelativeSchema = import_v413.z.object({
|
|
7686
|
+
mode: import_v413.z.literal("relative"),
|
|
7687
|
+
amount: import_v413.z.number(),
|
|
7474
7688
|
unit: WaitUnitSchema,
|
|
7475
|
-
windows:
|
|
7689
|
+
windows: import_v413.z.array(TimeWindowSlotSchema).optional()
|
|
7476
7690
|
});
|
|
7477
|
-
var WaitInputAbsoluteSchema =
|
|
7478
|
-
mode:
|
|
7479
|
-
scheduleAt:
|
|
7691
|
+
var WaitInputAbsoluteSchema = import_v413.z.object({
|
|
7692
|
+
mode: import_v413.z.literal("absolute"),
|
|
7693
|
+
scheduleAt: import_v413.z.union([import_v413.z.string(), import_v413.z.number()])
|
|
7480
7694
|
});
|
|
7481
|
-
var WaitInputSchema =
|
|
7695
|
+
var WaitInputSchema = import_v413.z.union([
|
|
7482
7696
|
WaitInputRelativeSchema,
|
|
7483
7697
|
WaitInputAbsoluteSchema
|
|
7484
7698
|
]);
|
|
@@ -7788,8 +8002,62 @@ function isTimeInPolicy(date, policy) {
|
|
|
7788
8002
|
return false;
|
|
7789
8003
|
}
|
|
7790
8004
|
|
|
8005
|
+
// src/tools/sms/gsm7.ts
|
|
8006
|
+
var GSM7_BASIC = `@\xA3$\xA5\xE8\xE9\xF9\xEC\xF2\xC7
|
|
8007
|
+
\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`;
|
|
8008
|
+
var GSM7_EXTENDED = "^{}\\[~]|\u20AC";
|
|
8009
|
+
var GSM7_BASIC_SET = new Set(GSM7_BASIC.split(""));
|
|
8010
|
+
var GSM7_EXTENDED_SET = new Set(GSM7_EXTENDED.split(""));
|
|
8011
|
+
function toGsm7(value) {
|
|
8012
|
+
if (value === null || value === void 0) {
|
|
8013
|
+
return "";
|
|
8014
|
+
}
|
|
8015
|
+
const str = String(value);
|
|
8016
|
+
let result = "";
|
|
8017
|
+
for (const char of str) {
|
|
8018
|
+
if (GSM7_BASIC_SET.has(char) || GSM7_EXTENDED_SET.has(char)) {
|
|
8019
|
+
result += char;
|
|
8020
|
+
}
|
|
8021
|
+
}
|
|
8022
|
+
return result;
|
|
8023
|
+
}
|
|
8024
|
+
function isGsm7Character(char) {
|
|
8025
|
+
return GSM7_BASIC_SET.has(char) || GSM7_EXTENDED_SET.has(char);
|
|
8026
|
+
}
|
|
8027
|
+
function countGsm7Septets(text) {
|
|
8028
|
+
let septets = 0;
|
|
8029
|
+
for (const char of text) {
|
|
8030
|
+
septets += GSM7_EXTENDED_SET.has(char) ? 2 : 1;
|
|
8031
|
+
}
|
|
8032
|
+
return septets;
|
|
8033
|
+
}
|
|
8034
|
+
function estimateSmsSegments(text) {
|
|
8035
|
+
const normalized = text ?? "";
|
|
8036
|
+
const characters = [...normalized].length;
|
|
8037
|
+
if (characters === 0) {
|
|
8038
|
+
return { encoding: "GSM-7", characters: 0, septets: 0, segments: 0 };
|
|
8039
|
+
}
|
|
8040
|
+
const isGsm7 = [...normalized].every(isGsm7Character);
|
|
8041
|
+
if (isGsm7) {
|
|
8042
|
+
const septets = countGsm7Septets(normalized);
|
|
8043
|
+
const segments2 = septets <= 160 ? 1 : Math.ceil(septets / 153);
|
|
8044
|
+
return {
|
|
8045
|
+
encoding: "GSM-7",
|
|
8046
|
+
characters,
|
|
8047
|
+
septets,
|
|
8048
|
+
segments: segments2
|
|
8049
|
+
};
|
|
8050
|
+
}
|
|
8051
|
+
const segments = characters <= 70 ? 1 : Math.ceil(characters / 67);
|
|
8052
|
+
return {
|
|
8053
|
+
encoding: "UCS-2",
|
|
8054
|
+
characters,
|
|
8055
|
+
segments
|
|
8056
|
+
};
|
|
8057
|
+
}
|
|
8058
|
+
|
|
7791
8059
|
// src/index.ts
|
|
7792
|
-
var index_default = { z:
|
|
8060
|
+
var index_default = { z: import_v414.z };
|
|
7793
8061
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7794
8062
|
0 && (module.exports = {
|
|
7795
8063
|
AgentContextSchema,
|
|
@@ -7820,6 +8088,7 @@ var index_default = { z: import_v413.z };
|
|
|
7820
8088
|
CRMSchemaZ,
|
|
7821
8089
|
CardBlockDefinitionSchema,
|
|
7822
8090
|
CardBlockHeaderSchema,
|
|
8091
|
+
ChannelBatchCapabilitySchema,
|
|
7823
8092
|
ChannelCapabilitySchema,
|
|
7824
8093
|
ChannelCapabilityTypeSchema,
|
|
7825
8094
|
ChannelDefinitionSchema,
|
|
@@ -7846,6 +8115,8 @@ var index_default = { z: import_v413.z };
|
|
|
7846
8115
|
EnvSchemaSchema,
|
|
7847
8116
|
EnvVariableDefinitionSchema,
|
|
7848
8117
|
EnvVisibilitySchema,
|
|
8118
|
+
EstimationSchema,
|
|
8119
|
+
EstimationSkippedBreakdownSchema,
|
|
7849
8120
|
EventConditionsSchema,
|
|
7850
8121
|
EventSubscriptionSchema,
|
|
7851
8122
|
EventTypeSchema,
|
|
@@ -7887,6 +8158,13 @@ var index_default = { z: import_v413.z };
|
|
|
7887
8158
|
MemoryQueryOptionsSchema,
|
|
7888
8159
|
MemoryScopeSchema,
|
|
7889
8160
|
MemoryService,
|
|
8161
|
+
MessageBulkRecipientSchema,
|
|
8162
|
+
MessageBulkSendInputSchema,
|
|
8163
|
+
MessageBulkSendOutputSchema,
|
|
8164
|
+
MessageBulkStatusInputSchema,
|
|
8165
|
+
MessageBulkStatusMessageSchema,
|
|
8166
|
+
MessageBulkStatusOutputSchema,
|
|
8167
|
+
MessageBulkStatusStatsSchema,
|
|
7890
8168
|
MessageEventPayloadSchema,
|
|
7891
8169
|
MessageSendAttachmentSchema,
|
|
7892
8170
|
MessageSendChannelSchema,
|
|
@@ -7905,6 +8183,7 @@ var index_default = { z: import_v413.z };
|
|
|
7905
8183
|
ModelDependencySchema,
|
|
7906
8184
|
ModelFieldDefinitionSchema,
|
|
7907
8185
|
ModelMapperBlockDefinitionSchema,
|
|
8186
|
+
MoneyMinorRangeSchema,
|
|
7908
8187
|
NavigationBreadcrumbSchema,
|
|
7909
8188
|
NavigationConfigSchema,
|
|
7910
8189
|
NavigationItemSchema,
|
|
@@ -8008,15 +8287,18 @@ var index_default = { z: import_v413.z };
|
|
|
8008
8287
|
communicationChannel,
|
|
8009
8288
|
compileAgent,
|
|
8010
8289
|
compileWorkflow,
|
|
8290
|
+
computeSkewedExpectedMinorUnits,
|
|
8011
8291
|
configure,
|
|
8012
8292
|
createAuthError,
|
|
8013
8293
|
createConflictError,
|
|
8014
8294
|
createContextLogger,
|
|
8015
8295
|
createErrorResponse,
|
|
8296
|
+
createEstimation,
|
|
8016
8297
|
createExternalError,
|
|
8017
8298
|
createInMemoryService,
|
|
8018
8299
|
createInstanceClient,
|
|
8019
8300
|
createListResponse,
|
|
8301
|
+
createMoneyMinorRange,
|
|
8020
8302
|
createNotFoundError,
|
|
8021
8303
|
createPermissionError,
|
|
8022
8304
|
createQueueHandle,
|
|
@@ -8041,11 +8323,14 @@ var index_default = { z: import_v413.z };
|
|
|
8041
8323
|
defineSkill,
|
|
8042
8324
|
defineWorkflow,
|
|
8043
8325
|
defineWorkflowYAML,
|
|
8326
|
+
estimateSmsSegments,
|
|
8044
8327
|
evaluateCondition,
|
|
8045
8328
|
evaluateTemplate,
|
|
8046
8329
|
event,
|
|
8047
8330
|
file,
|
|
8048
8331
|
formatContextForPrompt,
|
|
8332
|
+
formatMoneyMinorEstimate,
|
|
8333
|
+
formatMoneyMinorRange,
|
|
8049
8334
|
formatSkillInstructions,
|
|
8050
8335
|
getAllEnvKeys,
|
|
8051
8336
|
getAssociationByModel,
|
|
@@ -8071,6 +8356,7 @@ var index_default = { z: import_v413.z };
|
|
|
8071
8356
|
isWorkflowDependency,
|
|
8072
8357
|
matchesTrigger,
|
|
8073
8358
|
parseCRMSchema,
|
|
8359
|
+
parseEstimationFromBilling,
|
|
8074
8360
|
queuedFetch,
|
|
8075
8361
|
queuedFetchResponse,
|
|
8076
8362
|
registerQueueConfig,
|
|
@@ -8084,6 +8370,7 @@ var index_default = { z: import_v413.z };
|
|
|
8084
8370
|
safeParseCRMSchema,
|
|
8085
8371
|
safeParseConfig,
|
|
8086
8372
|
server,
|
|
8373
|
+
toGsm7,
|
|
8087
8374
|
token,
|
|
8088
8375
|
validateCRMSchema,
|
|
8089
8376
|
validateSkillYAML,
|