skedyul 1.5.2 → 1.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +18 -7
- package/dist/config/queue-config.d.ts +4 -0
- package/dist/config/types/channel.d.ts +2 -0
- package/dist/dedicated/server.js +16 -6
- package/dist/esm/index.mjs +1303 -1090
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1316 -1090
- package/dist/ratelimit/context.d.ts +4 -2
- package/dist/schemas.d.ts +48 -0
- package/dist/server/utils/schema.d.ts +3 -3
- package/dist/server.js +16 -6
- package/dist/serverless/server.mjs +16 -6
- package/dist/tools/sms/gsm7.d.ts +11 -0
- package/dist/types/estimation.d.ts +74 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/tool.d.ts +27 -2
- package/package.json +9 -3
package/dist/index.js
CHANGED
|
@@ -84,6 +84,7 @@ __export(index_exports, {
|
|
|
84
84
|
EnvSchemaSchema: () => EnvSchemaSchema,
|
|
85
85
|
EnvVariableDefinitionSchema: () => EnvVariableDefinitionSchema,
|
|
86
86
|
EnvVisibilitySchema: () => EnvVisibilitySchema,
|
|
87
|
+
EstimationSchema: () => EstimationSchema,
|
|
87
88
|
EventConditionsSchema: () => EventConditionsSchema,
|
|
88
89
|
EventSubscriptionSchema: () => EventSubscriptionSchema,
|
|
89
90
|
EventTypeSchema: () => EventTypeSchema,
|
|
@@ -125,6 +126,9 @@ __export(index_exports, {
|
|
|
125
126
|
MemoryQueryOptionsSchema: () => MemoryQueryOptionsSchema,
|
|
126
127
|
MemoryScopeSchema: () => MemoryScopeSchema,
|
|
127
128
|
MemoryService: () => MemoryService,
|
|
129
|
+
MessageBulkRecipientSchema: () => MessageBulkRecipientSchema,
|
|
130
|
+
MessageBulkSendInputSchema: () => MessageBulkSendInputSchema,
|
|
131
|
+
MessageBulkSendOutputSchema: () => MessageBulkSendOutputSchema,
|
|
128
132
|
MessageEventPayloadSchema: () => MessageEventPayloadSchema,
|
|
129
133
|
MessageSendAttachmentSchema: () => MessageSendAttachmentSchema,
|
|
130
134
|
MessageSendChannelSchema: () => MessageSendChannelSchema,
|
|
@@ -143,6 +147,7 @@ __export(index_exports, {
|
|
|
143
147
|
ModelDependencySchema: () => ModelDependencySchema,
|
|
144
148
|
ModelFieldDefinitionSchema: () => ModelFieldDefinitionSchema,
|
|
145
149
|
ModelMapperBlockDefinitionSchema: () => ModelMapperBlockDefinitionSchema,
|
|
150
|
+
MoneyMinorRangeSchema: () => MoneyMinorRangeSchema,
|
|
146
151
|
NavigationBreadcrumbSchema: () => NavigationBreadcrumbSchema,
|
|
147
152
|
NavigationConfigSchema: () => NavigationConfigSchema,
|
|
148
153
|
NavigationItemSchema: () => NavigationItemSchema,
|
|
@@ -246,15 +251,18 @@ __export(index_exports, {
|
|
|
246
251
|
communicationChannel: () => communicationChannel,
|
|
247
252
|
compileAgent: () => compileAgent,
|
|
248
253
|
compileWorkflow: () => compileWorkflow,
|
|
254
|
+
computeSkewedExpectedMinorUnits: () => computeSkewedExpectedMinorUnits,
|
|
249
255
|
configure: () => configure,
|
|
250
256
|
createAuthError: () => createAuthError,
|
|
251
257
|
createConflictError: () => createConflictError,
|
|
252
258
|
createContextLogger: () => createContextLogger,
|
|
253
259
|
createErrorResponse: () => createErrorResponse,
|
|
260
|
+
createEstimation: () => createEstimation,
|
|
254
261
|
createExternalError: () => createExternalError,
|
|
255
262
|
createInMemoryService: () => createInMemoryService,
|
|
256
263
|
createInstanceClient: () => createInstanceClient,
|
|
257
264
|
createListResponse: () => createListResponse,
|
|
265
|
+
createMoneyMinorRange: () => createMoneyMinorRange,
|
|
258
266
|
createNotFoundError: () => createNotFoundError,
|
|
259
267
|
createPermissionError: () => createPermissionError,
|
|
260
268
|
createQueueHandle: () => createQueueHandle,
|
|
@@ -280,11 +288,14 @@ __export(index_exports, {
|
|
|
280
288
|
defineSkill: () => defineSkill,
|
|
281
289
|
defineWorkflow: () => defineWorkflow,
|
|
282
290
|
defineWorkflowYAML: () => defineWorkflowYAML,
|
|
291
|
+
estimateSmsSegments: () => estimateSmsSegments,
|
|
283
292
|
evaluateCondition: () => evaluateCondition,
|
|
284
293
|
evaluateTemplate: () => evaluateTemplate,
|
|
285
294
|
event: () => event,
|
|
286
295
|
file: () => file,
|
|
287
296
|
formatContextForPrompt: () => formatContextForPrompt,
|
|
297
|
+
formatMoneyMinorEstimate: () => formatMoneyMinorEstimate,
|
|
298
|
+
formatMoneyMinorRange: () => formatMoneyMinorRange,
|
|
288
299
|
formatSkillInstructions: () => formatSkillInstructions,
|
|
289
300
|
getAllEnvKeys: () => getAllEnvKeys,
|
|
290
301
|
getAssociationByModel: () => getAssociationByModel,
|
|
@@ -310,6 +321,7 @@ __export(index_exports, {
|
|
|
310
321
|
isWorkflowDependency: () => isWorkflowDependency,
|
|
311
322
|
matchesTrigger: () => matchesTrigger,
|
|
312
323
|
parseCRMSchema: () => parseCRMSchema,
|
|
324
|
+
parseEstimationFromBilling: () => parseEstimationFromBilling,
|
|
313
325
|
queuedFetch: () => queuedFetch,
|
|
314
326
|
queuedFetchResponse: () => queuedFetchResponse,
|
|
315
327
|
registerQueueConfig: () => registerQueueConfig,
|
|
@@ -323,16 +335,17 @@ __export(index_exports, {
|
|
|
323
335
|
safeParseCRMSchema: () => safeParseCRMSchema,
|
|
324
336
|
safeParseConfig: () => safeParseConfig,
|
|
325
337
|
server: () => server,
|
|
338
|
+
toGsm7: () => toGsm7,
|
|
326
339
|
token: () => token,
|
|
327
340
|
validateCRMSchema: () => validateCRMSchema,
|
|
328
341
|
validateSkillYAML: () => validateSkillYAML,
|
|
329
342
|
validateWorkflowYAML: () => validateWorkflowYAML,
|
|
330
343
|
webhook: () => webhook,
|
|
331
344
|
workplace: () => workplace,
|
|
332
|
-
z: () =>
|
|
345
|
+
z: () => import_v414.z
|
|
333
346
|
});
|
|
334
347
|
module.exports = __toCommonJS(index_exports);
|
|
335
|
-
var
|
|
348
|
+
var import_v414 = require("zod/v4");
|
|
336
349
|
|
|
337
350
|
// src/types/invocation.ts
|
|
338
351
|
function createToolCallContext(params) {
|
|
@@ -387,12 +400,110 @@ function isCronContext(ctx) {
|
|
|
387
400
|
return ctx.trigger === "cron";
|
|
388
401
|
}
|
|
389
402
|
|
|
390
|
-
// src/types/
|
|
403
|
+
// src/types/estimation.ts
|
|
391
404
|
var import_v4 = require("zod/v4");
|
|
392
|
-
var
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
405
|
+
var MoneyMinorRangeSchema = import_v4.z.object({
|
|
406
|
+
currency: import_v4.z.string().min(3).max(3),
|
|
407
|
+
minorUnitsLow: import_v4.z.number().int().nonnegative(),
|
|
408
|
+
minorUnitsHigh: import_v4.z.number().int().nonnegative(),
|
|
409
|
+
minorUnitsExpected: import_v4.z.number().int().nonnegative().optional()
|
|
410
|
+
});
|
|
411
|
+
var EstimationSchema = import_v4.z.object({
|
|
412
|
+
deliverableCount: import_v4.z.number().int().nonnegative(),
|
|
413
|
+
skippedCount: import_v4.z.number().int().nonnegative().optional(),
|
|
414
|
+
cost: MoneyMinorRangeSchema.optional()
|
|
415
|
+
});
|
|
416
|
+
function createMoneyMinorRange(params) {
|
|
417
|
+
return {
|
|
418
|
+
currency: params.currency,
|
|
419
|
+
minorUnitsLow: params.minorUnitsLow,
|
|
420
|
+
minorUnitsHigh: params.minorUnitsHigh,
|
|
421
|
+
...params.minorUnitsExpected !== void 0 ? { minorUnitsExpected: params.minorUnitsExpected } : {}
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
function createEstimation(params) {
|
|
425
|
+
return {
|
|
426
|
+
deliverableCount: params.deliverableCount,
|
|
427
|
+
...params.skippedCount !== void 0 ? { skippedCount: params.skippedCount } : {},
|
|
428
|
+
...params.cost ? { cost: params.cost } : {}
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
function computeSkewedExpectedMinorUnits(range) {
|
|
432
|
+
if (range.minorUnitsExpected !== void 0) {
|
|
433
|
+
return range.minorUnitsExpected;
|
|
434
|
+
}
|
|
435
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
436
|
+
return range.minorUnitsLow;
|
|
437
|
+
}
|
|
438
|
+
return Math.round(0.8 * range.minorUnitsLow + 0.2 * range.minorUnitsHigh);
|
|
439
|
+
}
|
|
440
|
+
function formatMoneyMinorRange(range, locale) {
|
|
441
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
442
|
+
style: "currency",
|
|
443
|
+
currency: range.currency
|
|
444
|
+
});
|
|
445
|
+
const low = formatter.format(range.minorUnitsLow / 100);
|
|
446
|
+
const high = formatter.format(range.minorUnitsHigh / 100);
|
|
447
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
448
|
+
return low;
|
|
449
|
+
}
|
|
450
|
+
return `${low} \u2013 ${high}`;
|
|
451
|
+
}
|
|
452
|
+
function formatMoneyMinorEstimate(range, options) {
|
|
453
|
+
const formatter = new Intl.NumberFormat(options?.locale, {
|
|
454
|
+
style: "currency",
|
|
455
|
+
currency: range.currency
|
|
456
|
+
});
|
|
457
|
+
const maxSpreadRatio = options?.maxSpreadRatio ?? 3;
|
|
458
|
+
const spreadRatio = range.minorUnitsLow > 0 ? range.minorUnitsHigh / range.minorUnitsLow : 1;
|
|
459
|
+
if (spreadRatio > maxSpreadRatio) {
|
|
460
|
+
return formatMoneyMinorRange(range, options?.locale);
|
|
461
|
+
}
|
|
462
|
+
const expectedMinorUnits = options?.expectedMinorUnits ?? computeSkewedExpectedMinorUnits(range);
|
|
463
|
+
const expected = formatter.format(expectedMinorUnits / 100);
|
|
464
|
+
if (range.minorUnitsLow === range.minorUnitsHigh) {
|
|
465
|
+
return expected;
|
|
466
|
+
}
|
|
467
|
+
return `~${expected}`;
|
|
468
|
+
}
|
|
469
|
+
function parseEstimationFromBilling(billing) {
|
|
470
|
+
if (!billing || typeof billing !== "object") {
|
|
471
|
+
return void 0;
|
|
472
|
+
}
|
|
473
|
+
const record2 = billing;
|
|
474
|
+
const nested = record2.estimation;
|
|
475
|
+
if (nested && typeof nested === "object") {
|
|
476
|
+
const parsed = EstimationSchema.safeParse(nested);
|
|
477
|
+
if (parsed.success) {
|
|
478
|
+
return parsed.data;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
const currency = typeof record2.currency === "string" && record2.currency.trim() !== "" ? record2.currency : void 0;
|
|
482
|
+
const minorUnitsLow = typeof record2.minorUnitsLow === "number" ? record2.minorUnitsLow : typeof record2.costCentsLow === "number" ? record2.costCentsLow : void 0;
|
|
483
|
+
const minorUnitsHigh = typeof record2.minorUnitsHigh === "number" ? record2.minorUnitsHigh : typeof record2.costCentsHigh === "number" ? record2.costCentsHigh : void 0;
|
|
484
|
+
const minorUnitsExpected = typeof record2.minorUnitsExpected === "number" ? record2.minorUnitsExpected : typeof record2.costCentsExpected === "number" ? record2.costCentsExpected : void 0;
|
|
485
|
+
const deliverableCount = typeof record2.deliverableCount === "number" ? record2.deliverableCount : void 0;
|
|
486
|
+
if (deliverableCount === void 0 || minorUnitsLow === void 0 || minorUnitsHigh === void 0 || !currency) {
|
|
487
|
+
return void 0;
|
|
488
|
+
}
|
|
489
|
+
return createEstimation({
|
|
490
|
+
deliverableCount,
|
|
491
|
+
skippedCount: typeof record2.skippedCount === "number" ? record2.skippedCount : void 0,
|
|
492
|
+
cost: createMoneyMinorRange({
|
|
493
|
+
currency,
|
|
494
|
+
minorUnitsLow,
|
|
495
|
+
minorUnitsHigh,
|
|
496
|
+
...minorUnitsExpected !== void 0 ? { minorUnitsExpected } : {}
|
|
497
|
+
})
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// src/types/tool.ts
|
|
502
|
+
var import_v42 = require("zod/v4");
|
|
503
|
+
var ToolResponseMetaSchema = import_v42.z.object({
|
|
504
|
+
success: import_v42.z.boolean(),
|
|
505
|
+
message: import_v42.z.string(),
|
|
506
|
+
toolName: import_v42.z.string()
|
|
396
507
|
});
|
|
397
508
|
|
|
398
509
|
// src/types/tool-response.ts
|
|
@@ -533,11 +644,11 @@ function isRuntimeWebhookContext(ctx) {
|
|
|
533
644
|
}
|
|
534
645
|
|
|
535
646
|
// src/schemas.ts
|
|
536
|
-
var
|
|
647
|
+
var import_v48 = require("zod/v4");
|
|
537
648
|
|
|
538
649
|
// src/schemas/crm-schema.ts
|
|
539
|
-
var
|
|
540
|
-
var CRMFieldTypeSchema =
|
|
650
|
+
var import_v43 = require("zod/v4");
|
|
651
|
+
var CRMFieldTypeSchema = import_v43.z.enum([
|
|
541
652
|
"string",
|
|
542
653
|
"long_string",
|
|
543
654
|
"number",
|
|
@@ -549,125 +660,125 @@ var CRMFieldTypeSchema = import_v42.z.enum([
|
|
|
549
660
|
"image",
|
|
550
661
|
"object"
|
|
551
662
|
]);
|
|
552
|
-
var CRMFieldRequirementSchema =
|
|
663
|
+
var CRMFieldRequirementSchema = import_v43.z.enum([
|
|
553
664
|
"optional",
|
|
554
665
|
"on_create",
|
|
555
666
|
"required"
|
|
556
667
|
]);
|
|
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
|
-
|
|
668
|
+
var CRMFieldOptionSchema = import_v43.z.object({
|
|
669
|
+
label: import_v43.z.string(),
|
|
670
|
+
value: import_v43.z.string(),
|
|
671
|
+
color: import_v43.z.string().optional()
|
|
672
|
+
});
|
|
673
|
+
var CRMFieldDefinitionObjectSchema = import_v43.z.object({
|
|
674
|
+
options: import_v43.z.array(CRMFieldOptionSchema).optional(),
|
|
675
|
+
limitChoices: import_v43.z.number().optional(),
|
|
676
|
+
minLength: import_v43.z.number().optional(),
|
|
677
|
+
maxLength: import_v43.z.number().optional(),
|
|
678
|
+
min: import_v43.z.number().optional(),
|
|
679
|
+
max: import_v43.z.number().optional(),
|
|
680
|
+
pattern: import_v43.z.string().optional()
|
|
681
|
+
});
|
|
682
|
+
var CRMFieldDefinitionSchema = import_v43.z.union([
|
|
683
|
+
import_v43.z.string(),
|
|
573
684
|
CRMFieldDefinitionObjectSchema
|
|
574
685
|
]);
|
|
575
|
-
var CRMFieldAppearanceSchemaZ =
|
|
576
|
-
leftIcon:
|
|
577
|
-
rightIcon:
|
|
578
|
-
placeholder:
|
|
579
|
-
helpText:
|
|
580
|
-
});
|
|
581
|
-
var CRMFieldSchemaZ =
|
|
582
|
-
handle:
|
|
583
|
-
label:
|
|
686
|
+
var CRMFieldAppearanceSchemaZ = import_v43.z.object({
|
|
687
|
+
leftIcon: import_v43.z.string().optional(),
|
|
688
|
+
rightIcon: import_v43.z.string().optional(),
|
|
689
|
+
placeholder: import_v43.z.string().optional(),
|
|
690
|
+
helpText: import_v43.z.string().optional()
|
|
691
|
+
});
|
|
692
|
+
var CRMFieldSchemaZ = import_v43.z.object({
|
|
693
|
+
handle: import_v43.z.string().regex(/^[a-z][a-z0-9_]*$/, "Handle must be lowercase alphanumeric with underscores, starting with a letter"),
|
|
694
|
+
label: import_v43.z.string().min(1, "Label is required"),
|
|
584
695
|
type: CRMFieldTypeSchema,
|
|
585
696
|
/** Field description - explains what the field is for (metadata, not UI) */
|
|
586
|
-
description:
|
|
697
|
+
description: import_v43.z.string().optional(),
|
|
587
698
|
/** Field appearance - UI presentation settings */
|
|
588
699
|
appearance: CRMFieldAppearanceSchemaZ.optional(),
|
|
589
700
|
requirement: CRMFieldRequirementSchema.optional(),
|
|
590
|
-
unique:
|
|
591
|
-
list:
|
|
592
|
-
default:
|
|
701
|
+
unique: import_v43.z.boolean().optional(),
|
|
702
|
+
list: import_v43.z.boolean().optional(),
|
|
703
|
+
default: import_v43.z.unknown().optional(),
|
|
593
704
|
definition: CRMFieldDefinitionSchema.optional()
|
|
594
705
|
});
|
|
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 =
|
|
706
|
+
var CRMModelSchemaZ = 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
|
+
name: import_v43.z.string().min(1, "Name is required"),
|
|
709
|
+
namePlural: import_v43.z.string().optional(),
|
|
710
|
+
labelTemplate: import_v43.z.string().optional(),
|
|
711
|
+
description: import_v43.z.string().optional(),
|
|
712
|
+
icon: import_v43.z.string().optional(),
|
|
713
|
+
fields: import_v43.z.array(CRMFieldSchemaZ)
|
|
714
|
+
});
|
|
715
|
+
var CRMCardinalitySchema = import_v43.z.enum(["one_to_one", "one_to_many"]);
|
|
716
|
+
var CRMOnDeleteSchema = import_v43.z.enum(["none", "cascade", "restrict"]);
|
|
717
|
+
var CRMRelationshipLinkSchema = import_v43.z.object({
|
|
718
|
+
model: import_v43.z.string(),
|
|
719
|
+
field: import_v43.z.string(),
|
|
720
|
+
label: import_v43.z.string()
|
|
721
|
+
});
|
|
722
|
+
var CRMRelationshipSchemaZ = import_v43.z.object({
|
|
612
723
|
source: CRMRelationshipLinkSchema,
|
|
613
724
|
target: CRMRelationshipLinkSchema,
|
|
614
725
|
cardinality: CRMCardinalitySchema,
|
|
615
726
|
onDelete: CRMOnDeleteSchema.optional()
|
|
616
727
|
});
|
|
617
|
-
var CRMBlockTypeSchema =
|
|
728
|
+
var CRMBlockTypeSchema = import_v43.z.enum([
|
|
618
729
|
"spreadsheet",
|
|
619
730
|
"form",
|
|
620
731
|
"card",
|
|
621
732
|
"metric",
|
|
622
733
|
"kanban"
|
|
623
734
|
]);
|
|
624
|
-
var CRMBlockSchemaZ =
|
|
735
|
+
var CRMBlockSchemaZ = import_v43.z.object({
|
|
625
736
|
type: CRMBlockTypeSchema,
|
|
626
|
-
title:
|
|
627
|
-
config:
|
|
628
|
-
default:
|
|
737
|
+
title: import_v43.z.string().optional(),
|
|
738
|
+
config: import_v43.z.unknown().optional(),
|
|
739
|
+
default: import_v43.z.boolean().optional()
|
|
629
740
|
});
|
|
630
|
-
var CRMPageTypeSchema =
|
|
631
|
-
var CRMPageSchemaZ =
|
|
632
|
-
path:
|
|
741
|
+
var CRMPageTypeSchema = import_v43.z.enum(["list", "instance"]);
|
|
742
|
+
var CRMPageSchemaZ = import_v43.z.object({
|
|
743
|
+
path: import_v43.z.string(),
|
|
633
744
|
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 =
|
|
745
|
+
title: import_v43.z.string(),
|
|
746
|
+
icon: import_v43.z.string().optional(),
|
|
747
|
+
modelHandle: import_v43.z.string(),
|
|
748
|
+
parentPath: import_v43.z.string().optional(),
|
|
749
|
+
baseQuery: import_v43.z.unknown().optional(),
|
|
750
|
+
blocks: import_v43.z.array(CRMBlockSchemaZ).optional()
|
|
751
|
+
});
|
|
752
|
+
var CRMNavigationNodeBaseSchemaZ = import_v43.z.object({
|
|
753
|
+
label: import_v43.z.string(),
|
|
754
|
+
icon: import_v43.z.string().optional(),
|
|
755
|
+
path: import_v43.z.string().optional(),
|
|
756
|
+
kind: import_v43.z.enum(["section", "group"]).optional(),
|
|
757
|
+
sortIndex: import_v43.z.number().optional()
|
|
758
|
+
});
|
|
759
|
+
var CRMNavigationItemSchemaZ = import_v43.z.lazy(
|
|
649
760
|
() => CRMNavigationNodeBaseSchemaZ.extend({
|
|
650
|
-
children:
|
|
761
|
+
children: import_v43.z.array(CRMNavigationItemSchemaZ).optional()
|
|
651
762
|
})
|
|
652
763
|
);
|
|
653
|
-
var CRMNavigationSchemaZ =
|
|
654
|
-
sidebar:
|
|
764
|
+
var CRMNavigationSchemaZ = import_v43.z.object({
|
|
765
|
+
sidebar: import_v43.z.array(CRMNavigationItemSchemaZ).optional()
|
|
655
766
|
});
|
|
656
|
-
var CRMSchemaZ =
|
|
767
|
+
var CRMSchemaZ = import_v43.z.object({
|
|
657
768
|
/** Schema format version for future compatibility */
|
|
658
|
-
$schema:
|
|
769
|
+
$schema: import_v43.z.literal("https://skedyul.com/schemas/crm/v1").optional(),
|
|
659
770
|
/** Schema name for identification */
|
|
660
|
-
name:
|
|
771
|
+
name: import_v43.z.string().min(1, "Name is required"),
|
|
661
772
|
/** Optional description */
|
|
662
|
-
description:
|
|
773
|
+
description: import_v43.z.string().optional(),
|
|
663
774
|
/** Schema version (semver) */
|
|
664
|
-
version:
|
|
775
|
+
version: import_v43.z.string().optional(),
|
|
665
776
|
/** Model definitions */
|
|
666
|
-
models:
|
|
777
|
+
models: import_v43.z.array(CRMModelSchemaZ),
|
|
667
778
|
/** Relationship definitions */
|
|
668
|
-
relationships:
|
|
779
|
+
relationships: import_v43.z.array(CRMRelationshipSchemaZ).optional(),
|
|
669
780
|
/** Page definitions */
|
|
670
|
-
pages:
|
|
781
|
+
pages: import_v43.z.array(CRMPageSchemaZ).optional(),
|
|
671
782
|
/** Navigation definitions */
|
|
672
783
|
navigation: CRMNavigationSchemaZ.optional()
|
|
673
784
|
});
|
|
@@ -694,11 +805,11 @@ function safeParseCRMSchema(data) {
|
|
|
694
805
|
}
|
|
695
806
|
|
|
696
807
|
// src/schemas/agent-schema-v3.ts
|
|
697
|
-
var
|
|
808
|
+
var import_v47 = require("zod/v4");
|
|
698
809
|
|
|
699
810
|
// src/events/types.ts
|
|
700
|
-
var
|
|
701
|
-
var ThreadEventTypeSchema =
|
|
811
|
+
var import_v44 = require("zod/v4");
|
|
812
|
+
var ThreadEventTypeSchema = import_v44.z.enum([
|
|
702
813
|
// Message events
|
|
703
814
|
"thread.message.received",
|
|
704
815
|
"thread.message.sent",
|
|
@@ -720,73 +831,73 @@ var ThreadEventTypeSchema = import_v43.z.enum([
|
|
|
720
831
|
// Signal events
|
|
721
832
|
"thread.signal.created"
|
|
722
833
|
]);
|
|
723
|
-
var CustomEventTypeSchema =
|
|
834
|
+
var CustomEventTypeSchema = import_v44.z.string().regex(/^custom\.[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$/, {
|
|
724
835
|
message: "Custom event type must match pattern: custom.{namespace}.{event}"
|
|
725
836
|
});
|
|
726
|
-
var EventTypeSchema =
|
|
727
|
-
var ParticipantKindSchema =
|
|
728
|
-
var BaseEventPayloadSchema =
|
|
729
|
-
threadId:
|
|
730
|
-
workplaceId:
|
|
731
|
-
timestamp:
|
|
837
|
+
var EventTypeSchema = import_v44.z.union([ThreadEventTypeSchema, CustomEventTypeSchema]);
|
|
838
|
+
var ParticipantKindSchema = import_v44.z.enum(["CONTACT", "MEMBER", "AGENT", "WORKFLOW"]);
|
|
839
|
+
var BaseEventPayloadSchema = import_v44.z.object({
|
|
840
|
+
threadId: import_v44.z.string(),
|
|
841
|
+
workplaceId: import_v44.z.string(),
|
|
842
|
+
timestamp: import_v44.z.string().datetime().optional()
|
|
732
843
|
});
|
|
733
844
|
var MessageEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
734
|
-
message:
|
|
735
|
-
id:
|
|
736
|
-
content:
|
|
737
|
-
senderId:
|
|
845
|
+
message: import_v44.z.object({
|
|
846
|
+
id: import_v44.z.string(),
|
|
847
|
+
content: import_v44.z.string(),
|
|
848
|
+
senderId: import_v44.z.string().optional()
|
|
738
849
|
}),
|
|
739
|
-
participant:
|
|
740
|
-
id:
|
|
850
|
+
participant: import_v44.z.object({
|
|
851
|
+
id: import_v44.z.string(),
|
|
741
852
|
kind: ParticipantKindSchema,
|
|
742
|
-
displayName:
|
|
853
|
+
displayName: import_v44.z.string().optional()
|
|
743
854
|
}).optional(),
|
|
744
|
-
isFirstMessage:
|
|
745
|
-
messageCount:
|
|
855
|
+
isFirstMessage: import_v44.z.boolean().optional(),
|
|
856
|
+
messageCount: import_v44.z.number().optional()
|
|
746
857
|
});
|
|
747
858
|
var ParticipantEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
748
|
-
participant:
|
|
749
|
-
id:
|
|
859
|
+
participant: import_v44.z.object({
|
|
860
|
+
id: import_v44.z.string(),
|
|
750
861
|
kind: ParticipantKindSchema,
|
|
751
|
-
displayName:
|
|
752
|
-
contactId:
|
|
753
|
-
memberId:
|
|
754
|
-
agentId:
|
|
755
|
-
workflowId:
|
|
862
|
+
displayName: import_v44.z.string().optional(),
|
|
863
|
+
contactId: import_v44.z.string().optional(),
|
|
864
|
+
memberId: import_v44.z.string().optional(),
|
|
865
|
+
agentId: import_v44.z.string().optional(),
|
|
866
|
+
workflowId: import_v44.z.string().optional()
|
|
756
867
|
})
|
|
757
868
|
});
|
|
758
869
|
var ContextChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
759
|
-
context:
|
|
760
|
-
handle:
|
|
761
|
-
model:
|
|
762
|
-
instanceId:
|
|
870
|
+
context: import_v44.z.object({
|
|
871
|
+
handle: import_v44.z.string(),
|
|
872
|
+
model: import_v44.z.string(),
|
|
873
|
+
instanceId: import_v44.z.string()
|
|
763
874
|
}),
|
|
764
|
-
change:
|
|
765
|
-
field:
|
|
766
|
-
oldValue:
|
|
767
|
-
newValue:
|
|
875
|
+
change: import_v44.z.object({
|
|
876
|
+
field: import_v44.z.string().optional(),
|
|
877
|
+
oldValue: import_v44.z.unknown().optional(),
|
|
878
|
+
newValue: import_v44.z.unknown().optional()
|
|
768
879
|
}).optional()
|
|
769
880
|
});
|
|
770
881
|
var StatusChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
771
|
-
oldStatus:
|
|
772
|
-
newStatus:
|
|
882
|
+
oldStatus: import_v44.z.string(),
|
|
883
|
+
newStatus: import_v44.z.string()
|
|
773
884
|
});
|
|
774
885
|
var ScheduledEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
775
|
-
scheduledEventId:
|
|
776
|
-
reason:
|
|
777
|
-
context:
|
|
886
|
+
scheduledEventId: import_v44.z.string(),
|
|
887
|
+
reason: import_v44.z.string().optional(),
|
|
888
|
+
context: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).optional()
|
|
778
889
|
});
|
|
779
890
|
var AgentWorkflowEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
780
|
-
agentId:
|
|
781
|
-
workflowId:
|
|
782
|
-
workflowRunId:
|
|
783
|
-
outputs:
|
|
784
|
-
error:
|
|
891
|
+
agentId: import_v44.z.string().optional(),
|
|
892
|
+
workflowId: import_v44.z.string().optional(),
|
|
893
|
+
workflowRunId: import_v44.z.string().optional(),
|
|
894
|
+
outputs: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).optional(),
|
|
895
|
+
error: import_v44.z.string().optional()
|
|
785
896
|
});
|
|
786
897
|
var CustomEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
787
|
-
data:
|
|
898
|
+
data: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()).optional()
|
|
788
899
|
});
|
|
789
|
-
var ThreadEventPayloadSchema =
|
|
900
|
+
var ThreadEventPayloadSchema = import_v44.z.union([
|
|
790
901
|
MessageEventPayloadSchema,
|
|
791
902
|
ParticipantEventPayloadSchema,
|
|
792
903
|
ContextChangedPayloadSchema,
|
|
@@ -795,164 +906,164 @@ var ThreadEventPayloadSchema = import_v43.z.union([
|
|
|
795
906
|
AgentWorkflowEventPayloadSchema,
|
|
796
907
|
CustomEventPayloadSchema
|
|
797
908
|
]);
|
|
798
|
-
var ThreadEventSchema =
|
|
799
|
-
id:
|
|
800
|
-
threadId:
|
|
909
|
+
var ThreadEventSchema = import_v44.z.object({
|
|
910
|
+
id: import_v44.z.string(),
|
|
911
|
+
threadId: import_v44.z.string(),
|
|
801
912
|
type: EventTypeSchema,
|
|
802
913
|
payload: ThreadEventPayloadSchema,
|
|
803
|
-
emittedBy:
|
|
804
|
-
createdAt:
|
|
914
|
+
emittedBy: import_v44.z.string().optional(),
|
|
915
|
+
createdAt: import_v44.z.string().datetime()
|
|
805
916
|
});
|
|
806
|
-
var CreateThreadEventInputSchema =
|
|
807
|
-
threadId:
|
|
917
|
+
var CreateThreadEventInputSchema = import_v44.z.object({
|
|
918
|
+
threadId: import_v44.z.string(),
|
|
808
919
|
type: EventTypeSchema,
|
|
809
|
-
payload:
|
|
810
|
-
emittedBy:
|
|
920
|
+
payload: import_v44.z.record(import_v44.z.string(), import_v44.z.unknown()),
|
|
921
|
+
emittedBy: import_v44.z.string().optional()
|
|
811
922
|
});
|
|
812
|
-
var EventSubscriptionSchema =
|
|
813
|
-
subscribes:
|
|
814
|
-
condition:
|
|
815
|
-
cancels:
|
|
816
|
-
cancelCondition:
|
|
923
|
+
var EventSubscriptionSchema = import_v44.z.object({
|
|
924
|
+
subscribes: import_v44.z.array(EventTypeSchema),
|
|
925
|
+
condition: import_v44.z.string().optional(),
|
|
926
|
+
cancels: import_v44.z.array(EventTypeSchema).optional(),
|
|
927
|
+
cancelCondition: import_v44.z.string().optional()
|
|
817
928
|
});
|
|
818
|
-
var EventWaitSchema =
|
|
929
|
+
var EventWaitSchema = import_v44.z.object({
|
|
819
930
|
event: EventTypeSchema,
|
|
820
|
-
timeout:
|
|
821
|
-
onTimeout:
|
|
931
|
+
timeout: import_v44.z.string().optional(),
|
|
932
|
+
onTimeout: import_v44.z.string().optional()
|
|
822
933
|
});
|
|
823
|
-
var EventsConfigSchema =
|
|
824
|
-
subscribes:
|
|
825
|
-
condition:
|
|
826
|
-
emits:
|
|
827
|
-
waits:
|
|
828
|
-
cancels:
|
|
829
|
-
cancelCondition:
|
|
934
|
+
var EventsConfigSchema = import_v44.z.object({
|
|
935
|
+
subscribes: import_v44.z.array(EventTypeSchema).optional(),
|
|
936
|
+
condition: import_v44.z.string().optional(),
|
|
937
|
+
emits: import_v44.z.array(EventTypeSchema).optional(),
|
|
938
|
+
waits: import_v44.z.array(EventWaitSchema).optional(),
|
|
939
|
+
cancels: import_v44.z.array(EventTypeSchema).optional(),
|
|
940
|
+
cancelCondition: import_v44.z.string().optional()
|
|
830
941
|
});
|
|
831
942
|
|
|
832
943
|
// src/skills/types.ts
|
|
833
|
-
var
|
|
944
|
+
var import_v45 = require("zod/v4");
|
|
834
945
|
var SKILL_SCHEMA_VERSION = "https://skedyul.com/schemas/skill/v1";
|
|
835
946
|
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:
|
|
947
|
+
var SkillSourceSchema = import_v45.z.enum(["BUILTIN", "S3", "APP", "EXTERNAL"]);
|
|
948
|
+
var SkillToolRequirementSchema = import_v45.z.object({
|
|
949
|
+
requires: import_v45.z.array(import_v45.z.string()).optional(),
|
|
950
|
+
provides: import_v45.z.array(import_v45.z.string()).optional()
|
|
951
|
+
});
|
|
952
|
+
var SkillToolSandboxSchema = import_v45.z.object({
|
|
953
|
+
mock: import_v45.z.unknown().optional()
|
|
954
|
+
});
|
|
955
|
+
var ToolConstraintsSchema = import_v45.z.object({
|
|
956
|
+
maxCallsPerRun: import_v45.z.number().optional(),
|
|
957
|
+
idempotent: import_v45.z.boolean().optional(),
|
|
958
|
+
restricted: import_v45.z.boolean().optional(),
|
|
959
|
+
tags: import_v45.z.array(import_v45.z.string()).optional()
|
|
960
|
+
});
|
|
961
|
+
var SkillToolDefinitionSchema = import_v45.z.object({
|
|
962
|
+
tool: import_v45.z.string(),
|
|
963
|
+
description: import_v45.z.string().optional(),
|
|
964
|
+
overrides: import_v45.z.record(import_v45.z.string(), import_v45.z.unknown()).optional(),
|
|
854
965
|
sandbox: SkillToolSandboxSchema.optional(),
|
|
855
|
-
requiresApproval:
|
|
966
|
+
requiresApproval: import_v45.z.boolean().optional(),
|
|
856
967
|
constraints: ToolConstraintsSchema.optional()
|
|
857
968
|
});
|
|
858
|
-
var SkillToolsSchema =
|
|
969
|
+
var SkillToolsSchema = import_v45.z.union([
|
|
859
970
|
SkillToolRequirementSchema,
|
|
860
|
-
|
|
971
|
+
import_v45.z.array(SkillToolDefinitionSchema)
|
|
861
972
|
]);
|
|
862
|
-
var SkillExampleSchema =
|
|
863
|
-
context:
|
|
864
|
-
input:
|
|
865
|
-
reasoning:
|
|
866
|
-
output:
|
|
867
|
-
tool_call:
|
|
973
|
+
var SkillExampleSchema = import_v45.z.object({
|
|
974
|
+
context: import_v45.z.string().optional(),
|
|
975
|
+
input: import_v45.z.string(),
|
|
976
|
+
reasoning: import_v45.z.string().optional(),
|
|
977
|
+
output: import_v45.z.string(),
|
|
978
|
+
tool_call: import_v45.z.string().optional()
|
|
868
979
|
});
|
|
869
|
-
var CRMModelFieldRequirementsSchema =
|
|
870
|
-
required:
|
|
871
|
-
recommended:
|
|
980
|
+
var CRMModelFieldRequirementsSchema = import_v45.z.object({
|
|
981
|
+
required: import_v45.z.array(import_v45.z.string()).optional(),
|
|
982
|
+
recommended: import_v45.z.array(import_v45.z.string()).optional()
|
|
872
983
|
});
|
|
873
|
-
var CRMContextSchema =
|
|
874
|
-
models:
|
|
984
|
+
var CRMContextSchema = import_v45.z.object({
|
|
985
|
+
models: import_v45.z.record(import_v45.z.string(), CRMModelFieldRequirementsSchema)
|
|
875
986
|
});
|
|
876
|
-
var SkillYAMLSchema =
|
|
987
|
+
var SkillYAMLSchema = import_v45.z.object({
|
|
877
988
|
// Schema version
|
|
878
|
-
$schema:
|
|
989
|
+
$schema: import_v45.z.string().optional(),
|
|
879
990
|
// Identity
|
|
880
|
-
handle:
|
|
881
|
-
name:
|
|
882
|
-
version:
|
|
883
|
-
description:
|
|
991
|
+
handle: import_v45.z.string(),
|
|
992
|
+
name: import_v45.z.string(),
|
|
993
|
+
version: import_v45.z.string().optional(),
|
|
994
|
+
description: import_v45.z.string().optional(),
|
|
884
995
|
// Instructions injected into agent system prompt
|
|
885
|
-
instructions:
|
|
996
|
+
instructions: import_v45.z.string(),
|
|
886
997
|
// Tool configuration - supports both v1 and v2 formats
|
|
887
998
|
tools: SkillToolsSchema.optional(),
|
|
888
999
|
// CRM context - specifies which models/fields to include in schema
|
|
889
1000
|
crmContext: CRMContextSchema.optional(),
|
|
890
1001
|
// Few-shot examples
|
|
891
|
-
examples:
|
|
892
|
-
});
|
|
893
|
-
var SkillYAMLV2Schema =
|
|
894
|
-
$schema:
|
|
895
|
-
handle:
|
|
896
|
-
name:
|
|
897
|
-
version:
|
|
898
|
-
description:
|
|
899
|
-
instructions:
|
|
900
|
-
tools:
|
|
1002
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
1003
|
+
});
|
|
1004
|
+
var SkillYAMLV2Schema = import_v45.z.object({
|
|
1005
|
+
$schema: import_v45.z.literal(SKILL_SCHEMA_VERSION_V2).optional(),
|
|
1006
|
+
handle: import_v45.z.string(),
|
|
1007
|
+
name: import_v45.z.string(),
|
|
1008
|
+
version: import_v45.z.string().optional(),
|
|
1009
|
+
description: import_v45.z.string().optional(),
|
|
1010
|
+
instructions: import_v45.z.string(),
|
|
1011
|
+
tools: import_v45.z.array(SkillToolDefinitionSchema).optional(),
|
|
901
1012
|
crmContext: CRMContextSchema.optional(),
|
|
902
|
-
examples:
|
|
1013
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
903
1014
|
});
|
|
904
|
-
var SkillVersionWeightSchema =
|
|
905
|
-
version:
|
|
906
|
-
weight:
|
|
1015
|
+
var SkillVersionWeightSchema = import_v45.z.object({
|
|
1016
|
+
version: import_v45.z.number(),
|
|
1017
|
+
weight: import_v45.z.number()
|
|
907
1018
|
});
|
|
908
|
-
var SkillRefSchema =
|
|
909
|
-
|
|
1019
|
+
var SkillRefSchema = import_v45.z.union([
|
|
1020
|
+
import_v45.z.string(),
|
|
910
1021
|
// Just handle - uses latest published version
|
|
911
|
-
|
|
912
|
-
skill:
|
|
913
|
-
description:
|
|
1022
|
+
import_v45.z.object({
|
|
1023
|
+
skill: import_v45.z.string(),
|
|
1024
|
+
description: import_v45.z.string().optional(),
|
|
914
1025
|
// For AI SDK Agent Skills discovery
|
|
915
1026
|
/** Auto-inject this skill's instructions and tools on every agent turn */
|
|
916
|
-
alwaysLoad:
|
|
1027
|
+
alwaysLoad: import_v45.z.boolean().optional(),
|
|
917
1028
|
// Version selection (pick one):
|
|
918
|
-
version:
|
|
1029
|
+
version: import_v45.z.number().optional(),
|
|
919
1030
|
// Pin to specific version number
|
|
920
|
-
versions:
|
|
1031
|
+
versions: import_v45.z.array(SkillVersionWeightSchema).optional(),
|
|
921
1032
|
// A/B testing weights
|
|
922
1033
|
// Legacy support:
|
|
923
|
-
instructions:
|
|
1034
|
+
instructions: import_v45.z.string().optional(),
|
|
924
1035
|
// Inline instructions (deprecated)
|
|
925
|
-
enabled:
|
|
1036
|
+
enabled: import_v45.z.boolean().optional()
|
|
926
1037
|
})
|
|
927
1038
|
]);
|
|
928
|
-
var SkillMetadataSchema =
|
|
929
|
-
id:
|
|
930
|
-
handle:
|
|
931
|
-
name:
|
|
932
|
-
version:
|
|
933
|
-
description:
|
|
1039
|
+
var SkillMetadataSchema = import_v45.z.object({
|
|
1040
|
+
id: import_v45.z.string(),
|
|
1041
|
+
handle: import_v45.z.string(),
|
|
1042
|
+
name: import_v45.z.string(),
|
|
1043
|
+
version: import_v45.z.string().optional(),
|
|
1044
|
+
description: import_v45.z.string().optional(),
|
|
934
1045
|
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:
|
|
1046
|
+
s3Key: import_v45.z.string().optional(),
|
|
1047
|
+
appVersionId: import_v45.z.string().optional(),
|
|
1048
|
+
workplaceId: import_v45.z.string().optional(),
|
|
1049
|
+
createdAt: import_v45.z.string().datetime().optional(),
|
|
1050
|
+
updatedAt: import_v45.z.string().datetime().optional()
|
|
1051
|
+
});
|
|
1052
|
+
var ResolvedSkillSchema = import_v45.z.object({
|
|
1053
|
+
handle: import_v45.z.string(),
|
|
1054
|
+
name: import_v45.z.string(),
|
|
1055
|
+
instructions: import_v45.z.string().optional(),
|
|
1056
|
+
description: import_v45.z.string().optional(),
|
|
1057
|
+
tools: import_v45.z.array(import_v45.z.string()).optional(),
|
|
1058
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
1059
|
+
});
|
|
1060
|
+
var LoadedSkillSchema = import_v45.z.object({
|
|
1061
|
+
handle: import_v45.z.string(),
|
|
1062
|
+
name: import_v45.z.string(),
|
|
1063
|
+
instructions: import_v45.z.string().optional(),
|
|
1064
|
+
description: import_v45.z.string().optional(),
|
|
1065
|
+
tools: import_v45.z.array(SkillToolDefinitionSchema).optional(),
|
|
1066
|
+
examples: import_v45.z.array(SkillExampleSchema).optional()
|
|
956
1067
|
});
|
|
957
1068
|
function isV2SkillTools(tools) {
|
|
958
1069
|
if (!tools) return false;
|
|
@@ -1008,182 +1119,182 @@ ${sections.join("\n\n---\n\n")}`;
|
|
|
1008
1119
|
}
|
|
1009
1120
|
|
|
1010
1121
|
// src/context/types.ts
|
|
1011
|
-
var
|
|
1012
|
-
var CRMContextSchema2 =
|
|
1013
|
-
model:
|
|
1014
|
-
instanceId:
|
|
1015
|
-
data:
|
|
1122
|
+
var import_v46 = require("zod/v4");
|
|
1123
|
+
var CRMContextSchema2 = import_v46.z.object({
|
|
1124
|
+
model: import_v46.z.string(),
|
|
1125
|
+
instanceId: import_v46.z.string(),
|
|
1126
|
+
data: import_v46.z.record(import_v46.z.string(), import_v46.z.unknown())
|
|
1016
1127
|
});
|
|
1017
|
-
var SenderContextSchema =
|
|
1128
|
+
var SenderContextSchema = import_v46.z.object({
|
|
1018
1129
|
kind: ParticipantKindSchema,
|
|
1019
|
-
displayName:
|
|
1020
|
-
email:
|
|
1021
|
-
role:
|
|
1022
|
-
permissions:
|
|
1130
|
+
displayName: import_v46.z.string().optional(),
|
|
1131
|
+
email: import_v46.z.string().optional(),
|
|
1132
|
+
role: import_v46.z.string().optional(),
|
|
1133
|
+
permissions: import_v46.z.array(import_v46.z.string()).optional(),
|
|
1023
1134
|
crm: CRMContextSchema2.optional()
|
|
1024
1135
|
});
|
|
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:
|
|
1136
|
+
var ThreadContextItemSchema = import_v46.z.object({
|
|
1137
|
+
handle: import_v46.z.string(),
|
|
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()).optional()
|
|
1141
|
+
});
|
|
1142
|
+
var ThreadInfoSchema = import_v46.z.object({
|
|
1143
|
+
id: import_v46.z.string(),
|
|
1144
|
+
title: import_v46.z.string().optional(),
|
|
1145
|
+
status: import_v46.z.string().optional(),
|
|
1146
|
+
kind: import_v46.z.string().optional()
|
|
1147
|
+
});
|
|
1148
|
+
var SubscriptionSchema = import_v46.z.object({
|
|
1149
|
+
identifierValue: import_v46.z.string(),
|
|
1150
|
+
channelHandle: import_v46.z.string().optional()
|
|
1151
|
+
});
|
|
1152
|
+
var AssociationSchema = import_v46.z.object({
|
|
1153
|
+
id: import_v46.z.string().optional(),
|
|
1154
|
+
data: import_v46.z.record(import_v46.z.string(), import_v46.z.unknown())
|
|
1155
|
+
});
|
|
1156
|
+
var ContactSchema = import_v46.z.object({
|
|
1157
|
+
id: import_v46.z.string().optional(),
|
|
1158
|
+
name: import_v46.z.string().optional(),
|
|
1048
1159
|
subscription: SubscriptionSchema.optional(),
|
|
1049
|
-
associations:
|
|
1160
|
+
associations: import_v46.z.record(import_v46.z.string(), AssociationSchema).optional()
|
|
1050
1161
|
});
|
|
1051
|
-
var AgentSenderContextSchema =
|
|
1052
|
-
kind:
|
|
1053
|
-
displayName:
|
|
1054
|
-
role:
|
|
1055
|
-
permissions:
|
|
1162
|
+
var AgentSenderContextSchema = import_v46.z.object({
|
|
1163
|
+
kind: import_v46.z.enum(["contact", "member"]),
|
|
1164
|
+
displayName: import_v46.z.string().optional(),
|
|
1165
|
+
role: import_v46.z.string().optional(),
|
|
1166
|
+
permissions: import_v46.z.array(import_v46.z.string()).optional(),
|
|
1056
1167
|
contact: ContactSchema.optional()
|
|
1057
1168
|
});
|
|
1058
|
-
var AgentThreadContextSchema =
|
|
1059
|
-
handle:
|
|
1060
|
-
model:
|
|
1061
|
-
data:
|
|
1169
|
+
var AgentThreadContextSchema = import_v46.z.object({
|
|
1170
|
+
handle: import_v46.z.string(),
|
|
1171
|
+
model: import_v46.z.string(),
|
|
1172
|
+
data: import_v46.z.record(import_v46.z.string(), import_v46.z.unknown())
|
|
1062
1173
|
});
|
|
1063
|
-
var AgentContextSchema =
|
|
1174
|
+
var AgentContextSchema = import_v46.z.object({
|
|
1064
1175
|
sender: AgentSenderContextSchema,
|
|
1065
|
-
contexts:
|
|
1176
|
+
contexts: import_v46.z.array(AgentThreadContextSchema).optional()
|
|
1066
1177
|
});
|
|
1067
|
-
var ContextIssueSeveritySchema =
|
|
1068
|
-
var ContextIssueTypeSchema =
|
|
1178
|
+
var ContextIssueSeveritySchema = import_v46.z.enum(["ERROR", "WARNING"]);
|
|
1179
|
+
var ContextIssueTypeSchema = import_v46.z.enum([
|
|
1069
1180
|
"MISSING_ROUTING_PARTICIPANT",
|
|
1070
1181
|
"MISSING_ASSOCIATION",
|
|
1071
1182
|
"MISSING_REQUIRED_FIELD",
|
|
1072
1183
|
"MISSING_RECOMMENDED_FIELD"
|
|
1073
1184
|
]);
|
|
1074
|
-
var ContextIssueSchema =
|
|
1185
|
+
var ContextIssueSchema = import_v46.z.object({
|
|
1075
1186
|
type: ContextIssueTypeSchema,
|
|
1076
1187
|
severity: ContextIssueSeveritySchema,
|
|
1077
|
-
model:
|
|
1078
|
-
field:
|
|
1079
|
-
message:
|
|
1080
|
-
suggestion:
|
|
1188
|
+
model: import_v46.z.string().optional(),
|
|
1189
|
+
field: import_v46.z.string().optional(),
|
|
1190
|
+
message: import_v46.z.string(),
|
|
1191
|
+
suggestion: import_v46.z.string().optional()
|
|
1081
1192
|
});
|
|
1082
|
-
var ContextValidationResultSchema =
|
|
1083
|
-
valid:
|
|
1084
|
-
degraded:
|
|
1085
|
-
issues:
|
|
1193
|
+
var ContextValidationResultSchema = import_v46.z.object({
|
|
1194
|
+
valid: import_v46.z.boolean(),
|
|
1195
|
+
degraded: import_v46.z.boolean(),
|
|
1196
|
+
issues: import_v46.z.array(ContextIssueSchema)
|
|
1086
1197
|
});
|
|
1087
1198
|
var MockSenderContextSchema = AgentSenderContextSchema;
|
|
1088
1199
|
var MockThreadContextSchema = AgentThreadContextSchema;
|
|
1089
1200
|
var MockContextSchema = AgentContextSchema;
|
|
1090
|
-
var SandboxConfigSchema =
|
|
1091
|
-
enabled:
|
|
1201
|
+
var SandboxConfigSchema = import_v46.z.object({
|
|
1202
|
+
enabled: import_v46.z.boolean().optional(),
|
|
1092
1203
|
/** @deprecated Use 'context' instead of 'mockContext' */
|
|
1093
1204
|
mockContext: AgentContextSchema.optional(),
|
|
1094
1205
|
context: AgentContextSchema.optional()
|
|
1095
1206
|
});
|
|
1096
1207
|
|
|
1097
1208
|
// 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:
|
|
1209
|
+
var PersonaVoiceFormatV3Schema = import_v47.z.object({
|
|
1210
|
+
maxChars: import_v47.z.number().optional(),
|
|
1211
|
+
noEmojis: import_v47.z.boolean().optional(),
|
|
1212
|
+
noHyphens: import_v47.z.boolean().optional(),
|
|
1213
|
+
noBulletPoints: import_v47.z.boolean().optional(),
|
|
1214
|
+
maxQuestionsPerMessage: import_v47.z.number().optional(),
|
|
1215
|
+
noSignOffs: import_v47.z.boolean().optional()
|
|
1216
|
+
});
|
|
1217
|
+
var PersonaVoiceV3Schema = import_v47.z.object({
|
|
1218
|
+
style: import_v47.z.string(),
|
|
1108
1219
|
format: PersonaVoiceFormatV3Schema.optional()
|
|
1109
1220
|
});
|
|
1110
|
-
var PersonaV3Schema =
|
|
1111
|
-
name:
|
|
1221
|
+
var PersonaV3Schema = import_v47.z.object({
|
|
1222
|
+
name: import_v47.z.string(),
|
|
1112
1223
|
voice: PersonaVoiceV3Schema
|
|
1113
1224
|
});
|
|
1114
|
-
var ToolApprovalConfigSchema =
|
|
1115
|
-
required:
|
|
1116
|
-
requiredIf:
|
|
1225
|
+
var ToolApprovalConfigSchema = import_v47.z.object({
|
|
1226
|
+
required: import_v47.z.boolean().optional(),
|
|
1227
|
+
requiredIf: import_v47.z.array(import_v47.z.string()).optional()
|
|
1117
1228
|
});
|
|
1118
|
-
var ToolSandboxConfigSchema =
|
|
1119
|
-
mock:
|
|
1229
|
+
var ToolSandboxConfigSchema = import_v47.z.object({
|
|
1230
|
+
mock: import_v47.z.unknown().optional()
|
|
1120
1231
|
});
|
|
1121
|
-
var ToolRefV3Schema =
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
tool:
|
|
1125
|
-
description:
|
|
1232
|
+
var ToolRefV3Schema = import_v47.z.union([
|
|
1233
|
+
import_v47.z.string(),
|
|
1234
|
+
import_v47.z.object({
|
|
1235
|
+
tool: import_v47.z.string(),
|
|
1236
|
+
description: import_v47.z.string().optional(),
|
|
1126
1237
|
approval: ToolApprovalConfigSchema.optional(),
|
|
1127
1238
|
sandbox: ToolSandboxConfigSchema.optional(),
|
|
1128
|
-
overrides:
|
|
1239
|
+
overrides: import_v47.z.record(import_v47.z.string(), import_v47.z.unknown()).optional()
|
|
1129
1240
|
})
|
|
1130
1241
|
]);
|
|
1131
|
-
var AgentToolRefSchema =
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
tool:
|
|
1135
|
-
description:
|
|
1242
|
+
var AgentToolRefSchema = import_v47.z.union([
|
|
1243
|
+
import_v47.z.string(),
|
|
1244
|
+
import_v47.z.object({
|
|
1245
|
+
tool: import_v47.z.string(),
|
|
1246
|
+
description: import_v47.z.string().optional()
|
|
1136
1247
|
})
|
|
1137
1248
|
]);
|
|
1138
|
-
var WorkingMemoryConfigSchema =
|
|
1139
|
-
strategy:
|
|
1140
|
-
maxTokens:
|
|
1141
|
-
summarizeAt:
|
|
1249
|
+
var WorkingMemoryConfigSchema = import_v47.z.object({
|
|
1250
|
+
strategy: import_v47.z.enum(["full", "rolling_summary", "sliding_window"]).optional(),
|
|
1251
|
+
maxTokens: import_v47.z.number().optional(),
|
|
1252
|
+
summarizeAt: import_v47.z.number().optional()
|
|
1142
1253
|
});
|
|
1143
|
-
var ExternalMemoryConfigSchema =
|
|
1144
|
-
enabled:
|
|
1145
|
-
ttl:
|
|
1254
|
+
var ExternalMemoryConfigSchema = import_v47.z.object({
|
|
1255
|
+
enabled: import_v47.z.boolean().optional(),
|
|
1256
|
+
ttl: import_v47.z.string().optional()
|
|
1146
1257
|
});
|
|
1147
|
-
var SemanticMemoryConfigSchema =
|
|
1148
|
-
enabled:
|
|
1149
|
-
topK:
|
|
1150
|
-
scope:
|
|
1258
|
+
var SemanticMemoryConfigSchema = import_v47.z.object({
|
|
1259
|
+
enabled: import_v47.z.boolean().optional(),
|
|
1260
|
+
topK: import_v47.z.number().optional(),
|
|
1261
|
+
scope: import_v47.z.enum(["thread", "instance", "workspace"]).optional()
|
|
1151
1262
|
});
|
|
1152
|
-
var MemoryConfigV3Schema =
|
|
1263
|
+
var MemoryConfigV3Schema = import_v47.z.object({
|
|
1153
1264
|
working: WorkingMemoryConfigSchema.optional(),
|
|
1154
|
-
persistent:
|
|
1155
|
-
namespace:
|
|
1265
|
+
persistent: import_v47.z.object({
|
|
1266
|
+
namespace: import_v47.z.string().optional()
|
|
1156
1267
|
}).optional(),
|
|
1157
1268
|
external: ExternalMemoryConfigSchema.optional(),
|
|
1158
1269
|
semantic: SemanticMemoryConfigSchema.optional()
|
|
1159
1270
|
});
|
|
1160
|
-
var RequiresApprovalPolicySchema =
|
|
1161
|
-
requiresApproval:
|
|
1271
|
+
var RequiresApprovalPolicySchema = import_v47.z.object({
|
|
1272
|
+
requiresApproval: import_v47.z.boolean().optional()
|
|
1162
1273
|
});
|
|
1163
|
-
var PoliciesConfigV3Schema =
|
|
1164
|
-
messages:
|
|
1274
|
+
var PoliciesConfigV3Schema = import_v47.z.object({
|
|
1275
|
+
messages: import_v47.z.object({
|
|
1165
1276
|
send: RequiresApprovalPolicySchema.optional(),
|
|
1166
1277
|
schedule: RequiresApprovalPolicySchema.optional()
|
|
1167
1278
|
}).optional(),
|
|
1168
|
-
tools:
|
|
1169
|
-
externalRequiresApproval:
|
|
1170
|
-
systemRequiresApproval:
|
|
1279
|
+
tools: import_v47.z.object({
|
|
1280
|
+
externalRequiresApproval: import_v47.z.boolean().optional(),
|
|
1281
|
+
systemRequiresApproval: import_v47.z.boolean().optional()
|
|
1171
1282
|
}).optional()
|
|
1172
1283
|
});
|
|
1173
|
-
var RuntimeConfigV3Schema =
|
|
1284
|
+
var RuntimeConfigV3Schema = import_v47.z.object({
|
|
1174
1285
|
/** LLM model identifier for reasoning (e.g., "google/gemini-3.1-flash-lite") */
|
|
1175
|
-
model:
|
|
1286
|
+
model: import_v47.z.string().optional(),
|
|
1176
1287
|
/** LLM model for persona transformation (e.g., "openai/gpt-5-nano") */
|
|
1177
|
-
personaModel:
|
|
1288
|
+
personaModel: import_v47.z.string().optional()
|
|
1178
1289
|
});
|
|
1179
|
-
var TimeWindowTimeStampSchema =
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
hour:
|
|
1183
|
-
minute:
|
|
1290
|
+
var TimeWindowTimeStampSchema = import_v47.z.union([
|
|
1291
|
+
import_v47.z.number().describe("Hour of day (0-23)"),
|
|
1292
|
+
import_v47.z.object({
|
|
1293
|
+
hour: import_v47.z.number(),
|
|
1294
|
+
minute: import_v47.z.number().optional().default(0)
|
|
1184
1295
|
})
|
|
1185
1296
|
]);
|
|
1186
|
-
var TimeWindowDayOfWeekSchema =
|
|
1297
|
+
var TimeWindowDayOfWeekSchema = import_v47.z.enum([
|
|
1187
1298
|
"monday",
|
|
1188
1299
|
"tuesday",
|
|
1189
1300
|
"wednesday",
|
|
@@ -1192,47 +1303,47 @@ var TimeWindowDayOfWeekSchema = import_v46.z.enum([
|
|
|
1192
1303
|
"saturday",
|
|
1193
1304
|
"sunday"
|
|
1194
1305
|
]);
|
|
1195
|
-
var TimeWindowSlotAgentSchema =
|
|
1306
|
+
var TimeWindowSlotAgentSchema = import_v47.z.object({
|
|
1196
1307
|
startTime: TimeWindowTimeStampSchema,
|
|
1197
1308
|
endTime: TimeWindowTimeStampSchema,
|
|
1198
|
-
days:
|
|
1309
|
+
days: import_v47.z.array(TimeWindowDayOfWeekSchema)
|
|
1199
1310
|
});
|
|
1200
|
-
var ResponseModeSchema =
|
|
1311
|
+
var ResponseModeSchema = import_v47.z.enum([
|
|
1201
1312
|
"immediate",
|
|
1202
1313
|
"ack_and_schedule",
|
|
1203
1314
|
"schedule_only"
|
|
1204
1315
|
]);
|
|
1205
|
-
var TimeWindowBehaviorSchema =
|
|
1316
|
+
var TimeWindowBehaviorSchema = import_v47.z.object({
|
|
1206
1317
|
/** How to handle responses in this window */
|
|
1207
1318
|
responseMode: ResponseModeSchema,
|
|
1208
1319
|
/** Prompt injection for this time context */
|
|
1209
|
-
prompt:
|
|
1320
|
+
prompt: import_v47.z.string().optional().describe("Prompt injection for this time context"),
|
|
1210
1321
|
/** Window to schedule responses for (when responseMode is ack_and_schedule or schedule_only) */
|
|
1211
|
-
scheduleFor:
|
|
1322
|
+
scheduleFor: import_v47.z.string().optional().describe("Window name to schedule responses for")
|
|
1212
1323
|
});
|
|
1213
|
-
var TimeWindowPolicySchema =
|
|
1324
|
+
var TimeWindowPolicySchema = import_v47.z.object({
|
|
1214
1325
|
/** IANA timezone for the window (e.g., "Australia/Sydney") */
|
|
1215
|
-
timezone:
|
|
1326
|
+
timezone: import_v47.z.string().describe('IANA timezone, e.g., "Australia/Sydney"'),
|
|
1216
1327
|
/** Time slots when this window is active */
|
|
1217
|
-
windows:
|
|
1328
|
+
windows: import_v47.z.array(TimeWindowSlotAgentSchema),
|
|
1218
1329
|
/** Behavior for this window (optional - defaults to immediate response) */
|
|
1219
1330
|
behavior: TimeWindowBehaviorSchema.optional()
|
|
1220
1331
|
});
|
|
1221
|
-
var TimeWindowPoliciesSchema =
|
|
1332
|
+
var TimeWindowPoliciesSchema = import_v47.z.record(import_v47.z.string(), TimeWindowPolicySchema);
|
|
1222
1333
|
var TimeWindowDefaultSchema = TimeWindowBehaviorSchema.describe(
|
|
1223
1334
|
"Fallback behavior when no time window matches"
|
|
1224
1335
|
);
|
|
1225
|
-
var ResponsesBehaviorConfigSchema =
|
|
1336
|
+
var ResponsesBehaviorConfigSchema = import_v47.z.object({
|
|
1226
1337
|
/**
|
|
1227
1338
|
* Maximum immediate messages per agent run (acks, progress updates).
|
|
1228
1339
|
* @default 1
|
|
1229
1340
|
*/
|
|
1230
|
-
maxImmediate:
|
|
1341
|
+
maxImmediate: import_v47.z.number().optional(),
|
|
1231
1342
|
/**
|
|
1232
1343
|
* Maximum scheduled messages per agent run (follow-ups via sendAt).
|
|
1233
1344
|
* @default 2
|
|
1234
1345
|
*/
|
|
1235
|
-
maxScheduled:
|
|
1346
|
+
maxScheduled: import_v47.z.number().optional(),
|
|
1236
1347
|
/**
|
|
1237
1348
|
* Maximum intermediate messages per agent run.
|
|
1238
1349
|
* Intermediate = progress updates, acknowledgments before task completion.
|
|
@@ -1240,74 +1351,74 @@ var ResponsesBehaviorConfigSchema = import_v46.z.object({
|
|
|
1240
1351
|
* @deprecated Use maxImmediate instead
|
|
1241
1352
|
* @default 2
|
|
1242
1353
|
*/
|
|
1243
|
-
maxIntermediate:
|
|
1354
|
+
maxIntermediate: import_v47.z.number().optional(),
|
|
1244
1355
|
/**
|
|
1245
1356
|
* Whether a final message is required before the run completes.
|
|
1246
1357
|
* If true and no final message is sent, the run fails.
|
|
1247
1358
|
* @default true
|
|
1248
1359
|
*/
|
|
1249
|
-
requireFinal:
|
|
1360
|
+
requireFinal: import_v47.z.boolean().optional(),
|
|
1250
1361
|
/**
|
|
1251
1362
|
* Whether the agent can schedule messages for future delivery.
|
|
1252
1363
|
* Scheduled messages typically require approval.
|
|
1253
1364
|
* @default false
|
|
1254
1365
|
*/
|
|
1255
|
-
allowSchedule:
|
|
1366
|
+
allowSchedule: import_v47.z.boolean().optional(),
|
|
1256
1367
|
/**
|
|
1257
1368
|
* Message splitting configuration.
|
|
1258
1369
|
* Controls whether and how the agent splits responses into multiple messages.
|
|
1259
1370
|
*/
|
|
1260
|
-
messageSplitting:
|
|
1371
|
+
messageSplitting: import_v47.z.object({
|
|
1261
1372
|
/**
|
|
1262
1373
|
* Whether to allow natural message splitting.
|
|
1263
1374
|
* When true, the agent may split responses into multiple messages
|
|
1264
1375
|
* when it improves conversational flow.
|
|
1265
1376
|
*/
|
|
1266
|
-
enabled:
|
|
1377
|
+
enabled: import_v47.z.boolean(),
|
|
1267
1378
|
/**
|
|
1268
1379
|
* Custom prompt to override the default message splitting guidance.
|
|
1269
1380
|
* If not provided, uses sensible defaults for when to split vs. keep together.
|
|
1270
1381
|
*/
|
|
1271
|
-
prompt:
|
|
1382
|
+
prompt: import_v47.z.string().optional()
|
|
1272
1383
|
}).optional()
|
|
1273
1384
|
});
|
|
1274
|
-
var SchedulingDelaySchema =
|
|
1385
|
+
var SchedulingDelaySchema = import_v47.z.object({
|
|
1275
1386
|
/** Time unit amount */
|
|
1276
|
-
amount:
|
|
1387
|
+
amount: import_v47.z.number(),
|
|
1277
1388
|
/** Time unit (e.g., "week", "weeks", "day", "days", "month", "months") */
|
|
1278
|
-
unit:
|
|
1389
|
+
unit: import_v47.z.string(),
|
|
1279
1390
|
/** Optional time window to constrain the delay */
|
|
1280
|
-
timeWindow:
|
|
1391
|
+
timeWindow: import_v47.z.string().optional()
|
|
1281
1392
|
});
|
|
1282
|
-
var SchedulingPatternSchema =
|
|
1393
|
+
var SchedulingPatternSchema = import_v47.z.object({
|
|
1283
1394
|
/** Trigger name for this pattern */
|
|
1284
|
-
trigger:
|
|
1395
|
+
trigger: import_v47.z.string(),
|
|
1285
1396
|
/** Human-readable description of when this pattern applies */
|
|
1286
|
-
description:
|
|
1397
|
+
description: import_v47.z.string().optional(),
|
|
1287
1398
|
/** Example user phrases that match this pattern */
|
|
1288
|
-
examples:
|
|
1399
|
+
examples: import_v47.z.array(import_v47.z.string()).optional(),
|
|
1289
1400
|
/** Default delay for this pattern */
|
|
1290
1401
|
defaultDelay: SchedulingDelaySchema.optional()
|
|
1291
1402
|
});
|
|
1292
|
-
var SchedulingBehaviorConfigSchema =
|
|
1403
|
+
var SchedulingBehaviorConfigSchema = import_v47.z.object({
|
|
1293
1404
|
/**
|
|
1294
1405
|
* Patterns that trigger scheduling suggestions.
|
|
1295
1406
|
* The agent uses these to know when to add sendAt to messages.
|
|
1296
1407
|
*/
|
|
1297
|
-
patterns:
|
|
1408
|
+
patterns: import_v47.z.array(SchedulingPatternSchema).optional(),
|
|
1298
1409
|
/**
|
|
1299
1410
|
* Default settings for scheduled messages.
|
|
1300
1411
|
*/
|
|
1301
|
-
defaults:
|
|
1412
|
+
defaults: import_v47.z.object({
|
|
1302
1413
|
/** Cancel scheduled message if user replies before send time (default: true) */
|
|
1303
|
-
cancelOnActivity:
|
|
1414
|
+
cancelOnActivity: import_v47.z.boolean().optional(),
|
|
1304
1415
|
/** Whether scheduled messages require approval (default: true) */
|
|
1305
|
-
requiresApproval:
|
|
1416
|
+
requiresApproval: import_v47.z.boolean().optional(),
|
|
1306
1417
|
/** Default time window policy to constrain all scheduled messages */
|
|
1307
|
-
timeWindow:
|
|
1418
|
+
timeWindow: import_v47.z.string().optional().describe("Time window policy name for scheduled messages")
|
|
1308
1419
|
}).optional()
|
|
1309
1420
|
});
|
|
1310
|
-
var BehaviorConfigV3Schema =
|
|
1421
|
+
var BehaviorConfigV3Schema = import_v47.z.object({
|
|
1311
1422
|
/**
|
|
1312
1423
|
* Response behavior - controls message sending via tool calls.
|
|
1313
1424
|
* When configured, agents must explicitly call system:message:send
|
|
@@ -1320,32 +1431,32 @@ var BehaviorConfigV3Schema = import_v46.z.object({
|
|
|
1320
1431
|
*/
|
|
1321
1432
|
scheduling: SchedulingBehaviorConfigSchema.optional()
|
|
1322
1433
|
});
|
|
1323
|
-
var PromptsConfigV3Schema =
|
|
1434
|
+
var PromptsConfigV3Schema = import_v47.z.object({
|
|
1324
1435
|
/** Main system prompt with workflow instructions */
|
|
1325
|
-
system:
|
|
1436
|
+
system: import_v47.z.string().optional(),
|
|
1326
1437
|
/** Injected during second pass when skills were loaded but tools not used */
|
|
1327
|
-
recovery:
|
|
1438
|
+
recovery: import_v47.z.string().optional(),
|
|
1328
1439
|
/** Injected during follow-up passes when context needs updating */
|
|
1329
|
-
followUp:
|
|
1440
|
+
followUp: import_v47.z.string().optional(),
|
|
1330
1441
|
/** Thread list title generation (system + user template with {{var}} placeholders) */
|
|
1331
|
-
titleEnrichment:
|
|
1332
|
-
system:
|
|
1333
|
-
user:
|
|
1442
|
+
titleEnrichment: import_v47.z.object({
|
|
1443
|
+
system: import_v47.z.string().optional(),
|
|
1444
|
+
user: import_v47.z.string().optional()
|
|
1334
1445
|
}).optional()
|
|
1335
1446
|
});
|
|
1336
|
-
var AgentYAMLV3Schema =
|
|
1337
|
-
$schema:
|
|
1338
|
-
handle:
|
|
1339
|
-
name:
|
|
1340
|
-
version:
|
|
1341
|
-
description:
|
|
1447
|
+
var AgentYAMLV3Schema = import_v47.z.object({
|
|
1448
|
+
$schema: import_v47.z.string().optional(),
|
|
1449
|
+
handle: import_v47.z.string(),
|
|
1450
|
+
name: import_v47.z.string(),
|
|
1451
|
+
version: import_v47.z.string().optional(),
|
|
1452
|
+
description: import_v47.z.string().optional(),
|
|
1342
1453
|
// Persona - Who the agent is
|
|
1343
1454
|
persona: PersonaV3Schema.optional(),
|
|
1344
1455
|
// Skills - What the agent knows how to do (skills own their tools)
|
|
1345
|
-
skills:
|
|
1456
|
+
skills: import_v47.z.array(SkillRefSchema).optional(),
|
|
1346
1457
|
// Tools - Always-available tools before any skill loads
|
|
1347
1458
|
// Examples: system:settings:business_information:get
|
|
1348
|
-
tools:
|
|
1459
|
+
tools: import_v47.z.array(AgentToolRefSchema).optional(),
|
|
1349
1460
|
/**
|
|
1350
1461
|
* Events - When the agent activates
|
|
1351
1462
|
* @deprecated Not yet implemented - this is a planned feature for event-driven agents.
|
|
@@ -1378,21 +1489,21 @@ var AgentYAMLV3Schema = import_v46.z.object({
|
|
|
1378
1489
|
});
|
|
1379
1490
|
|
|
1380
1491
|
// src/schemas.ts
|
|
1381
|
-
var EnvVisibilitySchema =
|
|
1382
|
-
var EnvVariableDefinitionSchema =
|
|
1383
|
-
label:
|
|
1384
|
-
required:
|
|
1492
|
+
var EnvVisibilitySchema = import_v48.z.enum(["visible", "encrypted"]);
|
|
1493
|
+
var EnvVariableDefinitionSchema = import_v48.z.object({
|
|
1494
|
+
label: import_v48.z.string(),
|
|
1495
|
+
required: import_v48.z.boolean().optional(),
|
|
1385
1496
|
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 =
|
|
1497
|
+
default: import_v48.z.string().optional(),
|
|
1498
|
+
description: import_v48.z.string().optional(),
|
|
1499
|
+
placeholder: import_v48.z.string().optional()
|
|
1500
|
+
});
|
|
1501
|
+
var EnvSchemaSchema = import_v48.z.record(import_v48.z.string(), EnvVariableDefinitionSchema);
|
|
1502
|
+
var ComputeLayerTypeSchema = import_v48.z.enum(["serverless", "dedicated"]);
|
|
1503
|
+
var FieldOwnerSchema = import_v48.z.enum(["APP", "SHARED"]);
|
|
1504
|
+
var PrimitiveSchema = import_v48.z.union([import_v48.z.string(), import_v48.z.number(), import_v48.z.boolean()]);
|
|
1505
|
+
var PrimitiveOrArraySchema = import_v48.z.union([PrimitiveSchema, import_v48.z.array(PrimitiveSchema)]);
|
|
1506
|
+
var FilterOperatorSchema = import_v48.z.enum([
|
|
1396
1507
|
"eq",
|
|
1397
1508
|
"neq",
|
|
1398
1509
|
"gt",
|
|
@@ -1410,7 +1521,7 @@ var FilterOperatorSchema = import_v47.z.enum([
|
|
|
1410
1521
|
"isEmpty",
|
|
1411
1522
|
"isNotEmpty"
|
|
1412
1523
|
]);
|
|
1413
|
-
var FilterConditionSchema =
|
|
1524
|
+
var FilterConditionSchema = import_v48.z.object({
|
|
1414
1525
|
eq: PrimitiveOrArraySchema,
|
|
1415
1526
|
neq: PrimitiveOrArraySchema,
|
|
1416
1527
|
gt: PrimitiveOrArraySchema,
|
|
@@ -1428,27 +1539,27 @@ var FilterConditionSchema = import_v47.z.object({
|
|
|
1428
1539
|
isEmpty: PrimitiveOrArraySchema,
|
|
1429
1540
|
isNotEmpty: PrimitiveOrArraySchema
|
|
1430
1541
|
}).partial();
|
|
1431
|
-
var StructuredFilterSchema =
|
|
1432
|
-
|
|
1542
|
+
var StructuredFilterSchema = import_v48.z.record(
|
|
1543
|
+
import_v48.z.string(),
|
|
1433
1544
|
FilterConditionSchema
|
|
1434
1545
|
);
|
|
1435
|
-
var ModelDependencySchema =
|
|
1436
|
-
model:
|
|
1437
|
-
fields:
|
|
1546
|
+
var ModelDependencySchema = import_v48.z.object({
|
|
1547
|
+
model: import_v48.z.string(),
|
|
1548
|
+
fields: import_v48.z.array(import_v48.z.string()).optional(),
|
|
1438
1549
|
where: StructuredFilterSchema.optional()
|
|
1439
1550
|
});
|
|
1440
|
-
var ChannelDependencySchema =
|
|
1441
|
-
channel:
|
|
1551
|
+
var ChannelDependencySchema = import_v48.z.object({
|
|
1552
|
+
channel: import_v48.z.string()
|
|
1442
1553
|
});
|
|
1443
|
-
var WorkflowDependencySchema =
|
|
1444
|
-
workflow:
|
|
1554
|
+
var WorkflowDependencySchema = import_v48.z.object({
|
|
1555
|
+
workflow: import_v48.z.string()
|
|
1445
1556
|
});
|
|
1446
|
-
var ResourceDependencySchema =
|
|
1557
|
+
var ResourceDependencySchema = import_v48.z.union([
|
|
1447
1558
|
ModelDependencySchema,
|
|
1448
1559
|
ChannelDependencySchema,
|
|
1449
1560
|
WorkflowDependencySchema
|
|
1450
1561
|
]);
|
|
1451
|
-
var FieldDataTypeSchema =
|
|
1562
|
+
var FieldDataTypeSchema = import_v48.z.enum([
|
|
1452
1563
|
"LONG_STRING",
|
|
1453
1564
|
"STRING",
|
|
1454
1565
|
"NUMBER",
|
|
@@ -1461,74 +1572,74 @@ var FieldDataTypeSchema = import_v47.z.enum([
|
|
|
1461
1572
|
"RELATION",
|
|
1462
1573
|
"OBJECT"
|
|
1463
1574
|
]);
|
|
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:
|
|
1575
|
+
var FieldOptionSchema = import_v48.z.object({
|
|
1576
|
+
label: import_v48.z.string(),
|
|
1577
|
+
value: import_v48.z.string(),
|
|
1578
|
+
color: import_v48.z.string().optional()
|
|
1579
|
+
});
|
|
1580
|
+
var InlineFieldDefinitionSchema = import_v48.z.object({
|
|
1581
|
+
limitChoices: import_v48.z.number().optional(),
|
|
1582
|
+
options: import_v48.z.array(FieldOptionSchema).optional(),
|
|
1583
|
+
minLength: import_v48.z.number().optional(),
|
|
1584
|
+
maxLength: import_v48.z.number().optional(),
|
|
1585
|
+
min: import_v48.z.number().optional(),
|
|
1586
|
+
max: import_v48.z.number().optional(),
|
|
1587
|
+
relatedModel: import_v48.z.string().optional(),
|
|
1588
|
+
pattern: import_v48.z.string().optional()
|
|
1589
|
+
});
|
|
1590
|
+
var AppFieldVisibilitySchema = import_v48.z.object({
|
|
1591
|
+
data: import_v48.z.boolean().optional(),
|
|
1592
|
+
list: import_v48.z.boolean().optional(),
|
|
1593
|
+
filters: import_v48.z.boolean().optional()
|
|
1594
|
+
});
|
|
1595
|
+
var FieldRequirementTypeSchema = import_v48.z.enum(["optional", "on_create", "required"]);
|
|
1596
|
+
var ModelFieldDefinitionSchema = import_v48.z.object({
|
|
1597
|
+
handle: import_v48.z.string(),
|
|
1598
|
+
label: import_v48.z.string(),
|
|
1488
1599
|
type: FieldDataTypeSchema.optional(),
|
|
1489
|
-
definition:
|
|
1600
|
+
definition: import_v48.z.union([InlineFieldDefinitionSchema, import_v48.z.string()]).optional(),
|
|
1490
1601
|
/** Field requirement type: 'optional', 'on_create', or 'required' */
|
|
1491
1602
|
requirement: FieldRequirementTypeSchema.optional(),
|
|
1492
1603
|
/** @deprecated Use `requirement` instead */
|
|
1493
|
-
required:
|
|
1494
|
-
unique:
|
|
1495
|
-
system:
|
|
1496
|
-
isList:
|
|
1497
|
-
defaultValue:
|
|
1498
|
-
description:
|
|
1604
|
+
required: import_v48.z.boolean().optional(),
|
|
1605
|
+
unique: import_v48.z.boolean().optional(),
|
|
1606
|
+
system: import_v48.z.boolean().optional(),
|
|
1607
|
+
isList: import_v48.z.boolean().optional(),
|
|
1608
|
+
defaultValue: import_v48.z.object({ value: import_v48.z.unknown() }).optional(),
|
|
1609
|
+
description: import_v48.z.string().optional(),
|
|
1499
1610
|
visibility: AppFieldVisibilitySchema.optional(),
|
|
1500
1611
|
owner: FieldOwnerSchema.optional()
|
|
1501
1612
|
});
|
|
1502
|
-
var ModelDefinitionSchema =
|
|
1503
|
-
handle:
|
|
1504
|
-
name:
|
|
1505
|
-
namePlural:
|
|
1506
|
-
labelTemplate:
|
|
1507
|
-
description:
|
|
1508
|
-
fields:
|
|
1509
|
-
requires:
|
|
1510
|
-
addDefaultPages:
|
|
1511
|
-
addNavigation:
|
|
1613
|
+
var ModelDefinitionSchema = import_v48.z.object({
|
|
1614
|
+
handle: import_v48.z.string(),
|
|
1615
|
+
name: import_v48.z.string(),
|
|
1616
|
+
namePlural: import_v48.z.string().optional(),
|
|
1617
|
+
labelTemplate: import_v48.z.string().optional(),
|
|
1618
|
+
description: import_v48.z.string().optional(),
|
|
1619
|
+
fields: import_v48.z.array(ModelFieldDefinitionSchema),
|
|
1620
|
+
requires: import_v48.z.array(ResourceDependencySchema).optional(),
|
|
1621
|
+
addDefaultPages: import_v48.z.boolean().optional(),
|
|
1622
|
+
addNavigation: import_v48.z.boolean().optional(),
|
|
1512
1623
|
/** Root path for developer resource UI (e.g., '/access_requests'). Links internal model to a provision.pages entry. */
|
|
1513
|
-
page:
|
|
1624
|
+
page: import_v48.z.string().optional()
|
|
1514
1625
|
});
|
|
1515
|
-
var RelationshipCardinalitySchema =
|
|
1626
|
+
var RelationshipCardinalitySchema = import_v48.z.enum([
|
|
1516
1627
|
"ONE_TO_ONE",
|
|
1517
1628
|
"ONE_TO_MANY"
|
|
1518
1629
|
]);
|
|
1519
|
-
var OnDeleteBehaviorSchema =
|
|
1520
|
-
var RelationshipLinkSchema =
|
|
1521
|
-
model:
|
|
1522
|
-
field:
|
|
1523
|
-
label:
|
|
1630
|
+
var OnDeleteBehaviorSchema = import_v48.z.enum(["NONE", "CASCADE", "RESTRICT"]);
|
|
1631
|
+
var RelationshipLinkSchema = import_v48.z.object({
|
|
1632
|
+
model: import_v48.z.string(),
|
|
1633
|
+
field: import_v48.z.string(),
|
|
1634
|
+
label: import_v48.z.string()
|
|
1524
1635
|
});
|
|
1525
|
-
var RelationshipDefinitionSchema =
|
|
1636
|
+
var RelationshipDefinitionSchema = import_v48.z.object({
|
|
1526
1637
|
source: RelationshipLinkSchema,
|
|
1527
1638
|
target: RelationshipLinkSchema,
|
|
1528
1639
|
cardinality: RelationshipCardinalitySchema,
|
|
1529
1640
|
onDelete: OnDeleteBehaviorSchema.default("NONE")
|
|
1530
1641
|
});
|
|
1531
|
-
var ChannelCapabilityTypeSchema =
|
|
1642
|
+
var ChannelCapabilityTypeSchema = import_v48.z.enum([
|
|
1532
1643
|
"messaging",
|
|
1533
1644
|
// Text-based: SMS, WhatsApp, Messenger, DMs
|
|
1534
1645
|
"voice",
|
|
@@ -1536,323 +1647,325 @@ var ChannelCapabilityTypeSchema = import_v47.z.enum([
|
|
|
1536
1647
|
"video"
|
|
1537
1648
|
// Video calls (future)
|
|
1538
1649
|
]);
|
|
1539
|
-
var ChannelCapabilitySchema =
|
|
1540
|
-
label:
|
|
1650
|
+
var ChannelCapabilitySchema = import_v48.z.object({
|
|
1651
|
+
label: import_v48.z.string(),
|
|
1541
1652
|
// Display name: "SMS", "WhatsApp Messages"
|
|
1542
|
-
icon:
|
|
1653
|
+
icon: import_v48.z.string().optional(),
|
|
1543
1654
|
// Lucide icon name
|
|
1544
|
-
receive:
|
|
1655
|
+
receive: import_v48.z.string().optional(),
|
|
1545
1656
|
// Inbound webhook handler
|
|
1546
|
-
send:
|
|
1657
|
+
send: import_v48.z.string().optional(),
|
|
1547
1658
|
// Outbound tool handle
|
|
1659
|
+
send_batch: import_v48.z.string().optional()
|
|
1660
|
+
// Batch outbound tool handle
|
|
1548
1661
|
});
|
|
1549
|
-
var ChannelFieldDefinitionSchema =
|
|
1550
|
-
handle:
|
|
1551
|
-
label:
|
|
1662
|
+
var ChannelFieldDefinitionSchema = import_v48.z.object({
|
|
1663
|
+
handle: import_v48.z.string(),
|
|
1664
|
+
label: import_v48.z.string(),
|
|
1552
1665
|
/** Field definition reference or inline definition */
|
|
1553
|
-
definition:
|
|
1666
|
+
definition: import_v48.z.union([InlineFieldDefinitionSchema, import_v48.z.string()]).optional(),
|
|
1554
1667
|
/** Marks this field as the identifier field for the channel */
|
|
1555
|
-
identifier:
|
|
1668
|
+
identifier: import_v48.z.boolean().optional(),
|
|
1556
1669
|
/** Whether this field is required */
|
|
1557
|
-
required:
|
|
1670
|
+
required: import_v48.z.boolean().optional(),
|
|
1558
1671
|
/** Default value when creating a new field */
|
|
1559
|
-
defaultValue:
|
|
1672
|
+
defaultValue: import_v48.z.object({ value: import_v48.z.unknown() }).passthrough().optional(),
|
|
1560
1673
|
/** Visibility settings for the field */
|
|
1561
|
-
visibility:
|
|
1562
|
-
data:
|
|
1563
|
-
list:
|
|
1564
|
-
filters:
|
|
1674
|
+
visibility: import_v48.z.object({
|
|
1675
|
+
data: import_v48.z.boolean().optional(),
|
|
1676
|
+
list: import_v48.z.boolean().optional(),
|
|
1677
|
+
filters: import_v48.z.boolean().optional()
|
|
1565
1678
|
}).passthrough().optional(),
|
|
1566
1679
|
/** Permission settings for the field */
|
|
1567
|
-
permissions:
|
|
1568
|
-
read:
|
|
1569
|
-
write:
|
|
1680
|
+
permissions: import_v48.z.object({
|
|
1681
|
+
read: import_v48.z.boolean().optional(),
|
|
1682
|
+
write: import_v48.z.boolean().optional()
|
|
1570
1683
|
}).passthrough().optional()
|
|
1571
1684
|
}).passthrough();
|
|
1572
|
-
var ChannelDefinitionSchema =
|
|
1573
|
-
handle:
|
|
1574
|
-
label:
|
|
1575
|
-
icon:
|
|
1685
|
+
var ChannelDefinitionSchema = import_v48.z.object({
|
|
1686
|
+
handle: import_v48.z.string(),
|
|
1687
|
+
label: import_v48.z.string(),
|
|
1688
|
+
icon: import_v48.z.string().optional(),
|
|
1576
1689
|
/** Array of field definitions for this channel. One field must have identifier: true. */
|
|
1577
|
-
fields:
|
|
1690
|
+
fields: import_v48.z.array(ChannelFieldDefinitionSchema),
|
|
1578
1691
|
// Capabilities keyed by standard type (messaging, voice, video) - all optional
|
|
1579
|
-
capabilities:
|
|
1692
|
+
capabilities: import_v48.z.object({
|
|
1580
1693
|
messaging: ChannelCapabilitySchema.optional(),
|
|
1581
1694
|
voice: ChannelCapabilitySchema.optional(),
|
|
1582
1695
|
video: ChannelCapabilitySchema.optional()
|
|
1583
1696
|
})
|
|
1584
1697
|
});
|
|
1585
|
-
var WorkflowActionInputSchema =
|
|
1586
|
-
key:
|
|
1587
|
-
label:
|
|
1588
|
-
fieldRef:
|
|
1589
|
-
fieldHandle:
|
|
1590
|
-
entityHandle:
|
|
1698
|
+
var WorkflowActionInputSchema = import_v48.z.object({
|
|
1699
|
+
key: import_v48.z.string(),
|
|
1700
|
+
label: import_v48.z.string(),
|
|
1701
|
+
fieldRef: import_v48.z.object({
|
|
1702
|
+
fieldHandle: import_v48.z.string(),
|
|
1703
|
+
entityHandle: import_v48.z.string()
|
|
1591
1704
|
}).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:
|
|
1705
|
+
template: import_v48.z.string().optional()
|
|
1706
|
+
});
|
|
1707
|
+
var WorkflowActionSchema = import_v48.z.object({
|
|
1708
|
+
label: import_v48.z.string(),
|
|
1709
|
+
handle: import_v48.z.string(),
|
|
1710
|
+
batch: import_v48.z.boolean().optional(),
|
|
1711
|
+
entityHandle: import_v48.z.string().optional(),
|
|
1712
|
+
inputs: import_v48.z.array(WorkflowActionInputSchema).optional()
|
|
1713
|
+
});
|
|
1714
|
+
var WorkflowDefinitionSchema = import_v48.z.object({
|
|
1715
|
+
path: import_v48.z.string(),
|
|
1716
|
+
label: import_v48.z.string().optional(),
|
|
1717
|
+
handle: import_v48.z.string().optional(),
|
|
1718
|
+
requires: import_v48.z.array(ResourceDependencySchema).optional(),
|
|
1719
|
+
actions: import_v48.z.array(WorkflowActionSchema)
|
|
1720
|
+
});
|
|
1721
|
+
var PageTypeSchema = import_v48.z.enum(["INSTANCE", "LIST"]);
|
|
1722
|
+
var PageBlockTypeSchema = import_v48.z.enum(["form", "spreadsheet", "kanban", "calendar", "link", "list", "card"]);
|
|
1723
|
+
var PageFieldTypeSchema = import_v48.z.enum(["STRING", "FILE", "NUMBER", "DATE", "BOOLEAN", "SELECT", "FORM", "RELATIONSHIP"]);
|
|
1724
|
+
var PageFieldSourceSchema = import_v48.z.object({
|
|
1725
|
+
model: import_v48.z.string(),
|
|
1726
|
+
field: import_v48.z.string()
|
|
1727
|
+
});
|
|
1728
|
+
var PageFormHeaderSchema = import_v48.z.object({
|
|
1729
|
+
title: import_v48.z.string(),
|
|
1730
|
+
description: import_v48.z.string().optional()
|
|
1731
|
+
});
|
|
1732
|
+
var PageActionDefinitionSchema = import_v48.z.object({
|
|
1733
|
+
handle: import_v48.z.string(),
|
|
1734
|
+
label: import_v48.z.string(),
|
|
1735
|
+
handler: import_v48.z.string().optional(),
|
|
1736
|
+
href: import_v48.z.string().optional(),
|
|
1737
|
+
icon: import_v48.z.string().optional(),
|
|
1738
|
+
variant: import_v48.z.enum(["primary", "secondary", "destructive", "outline"]).optional(),
|
|
1739
|
+
isDisabled: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional(),
|
|
1740
|
+
isHidden: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional()
|
|
1628
1741
|
}).refine((data) => Boolean(data.handler || data.href), {
|
|
1629
1742
|
message: "Page action requires handler or href"
|
|
1630
1743
|
});
|
|
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:
|
|
1744
|
+
var FormV2StylePropsSchema = import_v48.z.object({
|
|
1745
|
+
id: import_v48.z.string(),
|
|
1746
|
+
row: import_v48.z.number(),
|
|
1747
|
+
col: import_v48.z.number(),
|
|
1748
|
+
className: import_v48.z.string().optional(),
|
|
1749
|
+
hidden: import_v48.z.boolean().optional()
|
|
1750
|
+
});
|
|
1751
|
+
var FieldSettingButtonPropsSchema = import_v48.z.object({
|
|
1752
|
+
label: import_v48.z.string(),
|
|
1753
|
+
variant: import_v48.z.enum(["default", "destructive", "outline", "secondary", "ghost", "link"]).optional(),
|
|
1754
|
+
size: import_v48.z.enum(["default", "sm", "lg", "icon"]).optional(),
|
|
1755
|
+
isLoading: import_v48.z.boolean().optional(),
|
|
1643
1756
|
/** Can be boolean or Liquid template string that resolves to boolean */
|
|
1644
|
-
isDisabled:
|
|
1645
|
-
leftIcon:
|
|
1757
|
+
isDisabled: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional(),
|
|
1758
|
+
leftIcon: import_v48.z.string().optional()
|
|
1646
1759
|
});
|
|
1647
|
-
var RelationshipExtensionSchema =
|
|
1648
|
-
model:
|
|
1760
|
+
var RelationshipExtensionSchema = import_v48.z.object({
|
|
1761
|
+
model: import_v48.z.string()
|
|
1649
1762
|
});
|
|
1650
|
-
var FormLayoutColumnDefinitionSchema =
|
|
1651
|
-
field:
|
|
1652
|
-
colSpan:
|
|
1653
|
-
dataType:
|
|
1654
|
-
subQuery:
|
|
1763
|
+
var FormLayoutColumnDefinitionSchema = import_v48.z.object({
|
|
1764
|
+
field: import_v48.z.string(),
|
|
1765
|
+
colSpan: import_v48.z.number(),
|
|
1766
|
+
dataType: import_v48.z.string().optional(),
|
|
1767
|
+
subQuery: import_v48.z.unknown().optional()
|
|
1655
1768
|
});
|
|
1656
|
-
var FormLayoutRowDefinitionSchema =
|
|
1657
|
-
columns:
|
|
1769
|
+
var FormLayoutRowDefinitionSchema = import_v48.z.object({
|
|
1770
|
+
columns: import_v48.z.array(FormLayoutColumnDefinitionSchema)
|
|
1658
1771
|
});
|
|
1659
|
-
var FormLayoutConfigDefinitionSchema =
|
|
1660
|
-
type:
|
|
1661
|
-
rows:
|
|
1772
|
+
var FormLayoutConfigDefinitionSchema = import_v48.z.object({
|
|
1773
|
+
type: import_v48.z.literal("form"),
|
|
1774
|
+
rows: import_v48.z.array(FormLayoutRowDefinitionSchema)
|
|
1662
1775
|
});
|
|
1663
1776
|
var InputComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1664
|
-
component:
|
|
1665
|
-
props:
|
|
1666
|
-
label:
|
|
1667
|
-
placeholder:
|
|
1668
|
-
helpText:
|
|
1669
|
-
type:
|
|
1670
|
-
required:
|
|
1671
|
-
disabled:
|
|
1672
|
-
value:
|
|
1777
|
+
component: import_v48.z.literal("Input"),
|
|
1778
|
+
props: import_v48.z.object({
|
|
1779
|
+
label: import_v48.z.string().optional(),
|
|
1780
|
+
placeholder: import_v48.z.string().optional(),
|
|
1781
|
+
helpText: import_v48.z.string().optional(),
|
|
1782
|
+
type: import_v48.z.enum(["text", "number", "email", "password", "tel", "url", "hidden"]).optional(),
|
|
1783
|
+
required: import_v48.z.boolean().optional(),
|
|
1784
|
+
disabled: import_v48.z.boolean().optional(),
|
|
1785
|
+
value: import_v48.z.union([import_v48.z.string(), import_v48.z.number()]).optional()
|
|
1673
1786
|
})
|
|
1674
1787
|
});
|
|
1675
1788
|
var TextareaComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1676
|
-
component:
|
|
1677
|
-
props:
|
|
1678
|
-
label:
|
|
1679
|
-
placeholder:
|
|
1680
|
-
helpText:
|
|
1681
|
-
required:
|
|
1682
|
-
disabled:
|
|
1683
|
-
value:
|
|
1789
|
+
component: import_v48.z.literal("Textarea"),
|
|
1790
|
+
props: import_v48.z.object({
|
|
1791
|
+
label: import_v48.z.string().optional(),
|
|
1792
|
+
placeholder: import_v48.z.string().optional(),
|
|
1793
|
+
helpText: import_v48.z.string().optional(),
|
|
1794
|
+
required: import_v48.z.boolean().optional(),
|
|
1795
|
+
disabled: import_v48.z.boolean().optional(),
|
|
1796
|
+
value: import_v48.z.string().optional()
|
|
1684
1797
|
})
|
|
1685
1798
|
});
|
|
1686
1799
|
var SelectComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1687
|
-
component:
|
|
1688
|
-
props:
|
|
1689
|
-
label:
|
|
1690
|
-
placeholder:
|
|
1691
|
-
helpText:
|
|
1800
|
+
component: import_v48.z.literal("Select"),
|
|
1801
|
+
props: import_v48.z.object({
|
|
1802
|
+
label: import_v48.z.string().optional(),
|
|
1803
|
+
placeholder: import_v48.z.string().optional(),
|
|
1804
|
+
helpText: import_v48.z.string().optional(),
|
|
1692
1805
|
/** Static items array (will be populated by iterable if using dynamic items) */
|
|
1693
|
-
items:
|
|
1694
|
-
value:
|
|
1695
|
-
isDisabled:
|
|
1696
|
-
required:
|
|
1806
|
+
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(),
|
|
1807
|
+
value: import_v48.z.string().optional(),
|
|
1808
|
+
isDisabled: import_v48.z.boolean().optional(),
|
|
1809
|
+
required: import_v48.z.boolean().optional()
|
|
1697
1810
|
}),
|
|
1698
1811
|
relationship: RelationshipExtensionSchema.optional(),
|
|
1699
1812
|
/** For dynamic items using iterable pattern (e.g., 'system.models') */
|
|
1700
|
-
iterable:
|
|
1813
|
+
iterable: import_v48.z.string().optional(),
|
|
1701
1814
|
/** Template for each item in the iterable */
|
|
1702
|
-
itemTemplate:
|
|
1703
|
-
value:
|
|
1704
|
-
label:
|
|
1815
|
+
itemTemplate: import_v48.z.object({
|
|
1816
|
+
value: import_v48.z.string(),
|
|
1817
|
+
label: import_v48.z.string()
|
|
1705
1818
|
}).optional()
|
|
1706
1819
|
});
|
|
1707
1820
|
var ComboboxComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1708
|
-
component:
|
|
1709
|
-
props:
|
|
1710
|
-
label:
|
|
1711
|
-
placeholder:
|
|
1712
|
-
helpText:
|
|
1713
|
-
items:
|
|
1714
|
-
value:
|
|
1821
|
+
component: import_v48.z.literal("Combobox"),
|
|
1822
|
+
props: import_v48.z.object({
|
|
1823
|
+
label: import_v48.z.string().optional(),
|
|
1824
|
+
placeholder: import_v48.z.string().optional(),
|
|
1825
|
+
helpText: import_v48.z.string().optional(),
|
|
1826
|
+
items: import_v48.z.array(import_v48.z.object({ value: import_v48.z.string(), label: import_v48.z.string() })).optional(),
|
|
1827
|
+
value: import_v48.z.string().optional()
|
|
1715
1828
|
}),
|
|
1716
1829
|
relationship: RelationshipExtensionSchema.optional()
|
|
1717
1830
|
});
|
|
1718
1831
|
var CheckboxComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1719
|
-
component:
|
|
1720
|
-
props:
|
|
1721
|
-
label:
|
|
1722
|
-
helpText:
|
|
1723
|
-
checked:
|
|
1724
|
-
disabled:
|
|
1832
|
+
component: import_v48.z.literal("Checkbox"),
|
|
1833
|
+
props: import_v48.z.object({
|
|
1834
|
+
label: import_v48.z.string().optional(),
|
|
1835
|
+
helpText: import_v48.z.string().optional(),
|
|
1836
|
+
checked: import_v48.z.boolean().optional(),
|
|
1837
|
+
disabled: import_v48.z.boolean().optional()
|
|
1725
1838
|
})
|
|
1726
1839
|
});
|
|
1727
1840
|
var DatePickerComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1728
|
-
component:
|
|
1729
|
-
props:
|
|
1730
|
-
label:
|
|
1731
|
-
helpText:
|
|
1732
|
-
value:
|
|
1733
|
-
disabled:
|
|
1841
|
+
component: import_v48.z.literal("DatePicker"),
|
|
1842
|
+
props: import_v48.z.object({
|
|
1843
|
+
label: import_v48.z.string().optional(),
|
|
1844
|
+
helpText: import_v48.z.string().optional(),
|
|
1845
|
+
value: import_v48.z.union([import_v48.z.string(), import_v48.z.date()]).optional(),
|
|
1846
|
+
disabled: import_v48.z.boolean().optional()
|
|
1734
1847
|
})
|
|
1735
1848
|
});
|
|
1736
1849
|
var TimePickerComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1737
|
-
component:
|
|
1738
|
-
props:
|
|
1739
|
-
label:
|
|
1740
|
-
helpText:
|
|
1741
|
-
value:
|
|
1742
|
-
disabled:
|
|
1850
|
+
component: import_v48.z.literal("TimePicker"),
|
|
1851
|
+
props: import_v48.z.object({
|
|
1852
|
+
label: import_v48.z.string().optional(),
|
|
1853
|
+
helpText: import_v48.z.string().optional(),
|
|
1854
|
+
value: import_v48.z.string().optional(),
|
|
1855
|
+
disabled: import_v48.z.boolean().optional()
|
|
1743
1856
|
})
|
|
1744
1857
|
});
|
|
1745
1858
|
var ImageSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1746
|
-
component:
|
|
1747
|
-
props:
|
|
1748
|
-
label:
|
|
1749
|
-
description:
|
|
1750
|
-
helpText:
|
|
1751
|
-
accept:
|
|
1859
|
+
component: import_v48.z.literal("ImageSetting"),
|
|
1860
|
+
props: import_v48.z.object({
|
|
1861
|
+
label: import_v48.z.string().optional(),
|
|
1862
|
+
description: import_v48.z.string().optional(),
|
|
1863
|
+
helpText: import_v48.z.string().optional(),
|
|
1864
|
+
accept: import_v48.z.string().optional()
|
|
1752
1865
|
})
|
|
1753
1866
|
});
|
|
1754
1867
|
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:
|
|
1868
|
+
component: import_v48.z.literal("FileSetting"),
|
|
1869
|
+
props: import_v48.z.object({
|
|
1870
|
+
label: import_v48.z.string().optional(),
|
|
1871
|
+
description: import_v48.z.string().optional(),
|
|
1872
|
+
helpText: import_v48.z.string().optional(),
|
|
1873
|
+
accept: import_v48.z.string().optional(),
|
|
1874
|
+
required: import_v48.z.boolean().optional(),
|
|
1875
|
+
button: import_v48.z.object({
|
|
1876
|
+
label: import_v48.z.string().optional(),
|
|
1877
|
+
variant: import_v48.z.enum(["default", "outline", "ghost", "link"]).optional(),
|
|
1878
|
+
size: import_v48.z.enum(["sm", "md", "lg"]).optional()
|
|
1766
1879
|
}).optional()
|
|
1767
1880
|
})
|
|
1768
1881
|
});
|
|
1769
|
-
var ListItemTemplateSchema =
|
|
1770
|
-
component:
|
|
1771
|
-
span:
|
|
1772
|
-
mdSpan:
|
|
1773
|
-
lgSpan:
|
|
1774
|
-
props:
|
|
1882
|
+
var ListItemTemplateSchema = import_v48.z.object({
|
|
1883
|
+
component: import_v48.z.string(),
|
|
1884
|
+
span: import_v48.z.number().optional(),
|
|
1885
|
+
mdSpan: import_v48.z.number().optional(),
|
|
1886
|
+
lgSpan: import_v48.z.number().optional(),
|
|
1887
|
+
props: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown())
|
|
1775
1888
|
});
|
|
1776
1889
|
var ListComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1777
|
-
component:
|
|
1778
|
-
props:
|
|
1779
|
-
title:
|
|
1780
|
-
items:
|
|
1781
|
-
id:
|
|
1782
|
-
label:
|
|
1783
|
-
description:
|
|
1890
|
+
component: import_v48.z.literal("List"),
|
|
1891
|
+
props: import_v48.z.object({
|
|
1892
|
+
title: import_v48.z.string().optional(),
|
|
1893
|
+
items: import_v48.z.array(import_v48.z.object({
|
|
1894
|
+
id: import_v48.z.string(),
|
|
1895
|
+
label: import_v48.z.string(),
|
|
1896
|
+
description: import_v48.z.string().optional()
|
|
1784
1897
|
})).optional(),
|
|
1785
|
-
emptyMessage:
|
|
1898
|
+
emptyMessage: import_v48.z.string().optional()
|
|
1786
1899
|
}),
|
|
1787
|
-
model:
|
|
1788
|
-
labelField:
|
|
1789
|
-
descriptionField:
|
|
1790
|
-
icon:
|
|
1900
|
+
model: import_v48.z.string().optional(),
|
|
1901
|
+
labelField: import_v48.z.string().optional(),
|
|
1902
|
+
descriptionField: import_v48.z.string().optional(),
|
|
1903
|
+
icon: import_v48.z.string().optional(),
|
|
1791
1904
|
/** Context variable name to iterate over (e.g., 'phone_numbers') */
|
|
1792
|
-
iterable:
|
|
1905
|
+
iterable: import_v48.z.string().optional(),
|
|
1793
1906
|
/** Template for each item - use {{ item.xyz }} for field values */
|
|
1794
1907
|
itemTemplate: ListItemTemplateSchema.optional()
|
|
1795
1908
|
});
|
|
1796
1909
|
var EmptyFormComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1797
|
-
component:
|
|
1798
|
-
props:
|
|
1799
|
-
title:
|
|
1800
|
-
description:
|
|
1801
|
-
icon:
|
|
1910
|
+
component: import_v48.z.literal("EmptyForm"),
|
|
1911
|
+
props: import_v48.z.object({
|
|
1912
|
+
title: import_v48.z.string().optional(),
|
|
1913
|
+
description: import_v48.z.string().optional(),
|
|
1914
|
+
icon: import_v48.z.string().optional()
|
|
1802
1915
|
})
|
|
1803
1916
|
});
|
|
1804
1917
|
var AlertComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1805
|
-
component:
|
|
1806
|
-
props:
|
|
1807
|
-
title:
|
|
1808
|
-
description:
|
|
1809
|
-
icon:
|
|
1810
|
-
variant:
|
|
1918
|
+
component: import_v48.z.literal("Alert"),
|
|
1919
|
+
props: import_v48.z.object({
|
|
1920
|
+
title: import_v48.z.string(),
|
|
1921
|
+
description: import_v48.z.string(),
|
|
1922
|
+
icon: import_v48.z.string().optional(),
|
|
1923
|
+
variant: import_v48.z.enum(["default", "destructive"]).optional()
|
|
1811
1924
|
})
|
|
1812
1925
|
});
|
|
1813
1926
|
var EventWiringPanelComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1814
|
-
component:
|
|
1815
|
-
props:
|
|
1816
|
-
eventTypes:
|
|
1817
|
-
|
|
1818
|
-
type:
|
|
1819
|
-
label:
|
|
1820
|
-
glofoxType:
|
|
1821
|
-
description:
|
|
1822
|
-
icon:
|
|
1927
|
+
component: import_v48.z.literal("EventWiringPanel"),
|
|
1928
|
+
props: import_v48.z.object({
|
|
1929
|
+
eventTypes: import_v48.z.array(
|
|
1930
|
+
import_v48.z.object({
|
|
1931
|
+
type: import_v48.z.string(),
|
|
1932
|
+
label: import_v48.z.string(),
|
|
1933
|
+
glofoxType: import_v48.z.string().optional(),
|
|
1934
|
+
description: import_v48.z.string().optional(),
|
|
1935
|
+
icon: import_v48.z.string().optional()
|
|
1823
1936
|
})
|
|
1824
1937
|
),
|
|
1825
|
-
recommendedWorkflowHandle:
|
|
1938
|
+
recommendedWorkflowHandle: import_v48.z.string().optional()
|
|
1826
1939
|
})
|
|
1827
1940
|
});
|
|
1828
|
-
var ModalFormDefinitionSchema =
|
|
1941
|
+
var ModalFormDefinitionSchema = import_v48.z.object({
|
|
1829
1942
|
header: PageFormHeaderSchema,
|
|
1830
|
-
handler:
|
|
1943
|
+
handler: import_v48.z.string(),
|
|
1831
1944
|
/** Named dialog template to use instead of inline fields */
|
|
1832
|
-
template:
|
|
1945
|
+
template: import_v48.z.string().optional(),
|
|
1833
1946
|
/** Template-specific params to pass to the dialog */
|
|
1834
|
-
templateParams:
|
|
1947
|
+
templateParams: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional(),
|
|
1835
1948
|
/** Inline field definitions (used when template is not specified) */
|
|
1836
|
-
fields:
|
|
1949
|
+
fields: import_v48.z.lazy(() => import_v48.z.array(FormV2ComponentDefinitionSchema)).optional(),
|
|
1837
1950
|
layout: FormLayoutConfigDefinitionSchema.optional(),
|
|
1838
|
-
actions:
|
|
1951
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional()
|
|
1839
1952
|
});
|
|
1840
1953
|
var FieldSettingComponentDefinitionSchema = FormV2StylePropsSchema.extend({
|
|
1841
|
-
component:
|
|
1842
|
-
props:
|
|
1843
|
-
label:
|
|
1844
|
-
description:
|
|
1845
|
-
helpText:
|
|
1846
|
-
mode:
|
|
1954
|
+
component: import_v48.z.literal("FieldSetting"),
|
|
1955
|
+
props: import_v48.z.object({
|
|
1956
|
+
label: import_v48.z.string(),
|
|
1957
|
+
description: import_v48.z.string().optional(),
|
|
1958
|
+
helpText: import_v48.z.string().optional(),
|
|
1959
|
+
mode: import_v48.z.enum(["field", "setting"]).optional(),
|
|
1847
1960
|
/** Status indicator - can be literal or Liquid template */
|
|
1848
|
-
status:
|
|
1961
|
+
status: import_v48.z.string().optional(),
|
|
1849
1962
|
/** Text to display alongside status badge - can be Liquid template */
|
|
1850
|
-
statusText:
|
|
1963
|
+
statusText: import_v48.z.string().optional(),
|
|
1851
1964
|
button: FieldSettingButtonPropsSchema
|
|
1852
1965
|
}),
|
|
1853
1966
|
modalForm: ModalFormDefinitionSchema.optional()
|
|
1854
1967
|
});
|
|
1855
|
-
var FormV2ComponentDefinitionSchema =
|
|
1968
|
+
var FormV2ComponentDefinitionSchema = import_v48.z.discriminatedUnion("component", [
|
|
1856
1969
|
InputComponentDefinitionSchema,
|
|
1857
1970
|
TextareaComponentDefinitionSchema,
|
|
1858
1971
|
SelectComponentDefinitionSchema,
|
|
@@ -1868,82 +1981,82 @@ var FormV2ComponentDefinitionSchema = import_v47.z.discriminatedUnion("component
|
|
|
1868
1981
|
AlertComponentDefinitionSchema,
|
|
1869
1982
|
EventWiringPanelComponentDefinitionSchema
|
|
1870
1983
|
]);
|
|
1871
|
-
var FormV2PropsDefinitionSchema =
|
|
1872
|
-
formVersion:
|
|
1873
|
-
id:
|
|
1874
|
-
fields:
|
|
1984
|
+
var FormV2PropsDefinitionSchema = import_v48.z.object({
|
|
1985
|
+
formVersion: import_v48.z.literal("v2"),
|
|
1986
|
+
id: import_v48.z.string().optional(),
|
|
1987
|
+
fields: import_v48.z.array(FormV2ComponentDefinitionSchema),
|
|
1875
1988
|
layout: FormLayoutConfigDefinitionSchema,
|
|
1876
1989
|
/** Optional actions that trigger MCP tool calls */
|
|
1877
|
-
actions:
|
|
1990
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional()
|
|
1878
1991
|
});
|
|
1879
|
-
var CardBlockHeaderSchema =
|
|
1880
|
-
title:
|
|
1881
|
-
description:
|
|
1882
|
-
descriptionHref:
|
|
1992
|
+
var CardBlockHeaderSchema = import_v48.z.object({
|
|
1993
|
+
title: import_v48.z.string(),
|
|
1994
|
+
description: import_v48.z.string().optional(),
|
|
1995
|
+
descriptionHref: import_v48.z.string().optional()
|
|
1883
1996
|
});
|
|
1884
|
-
var CardBlockDefinitionSchema =
|
|
1885
|
-
type:
|
|
1886
|
-
restructurable:
|
|
1997
|
+
var CardBlockDefinitionSchema = import_v48.z.object({
|
|
1998
|
+
type: import_v48.z.literal("card"),
|
|
1999
|
+
restructurable: import_v48.z.boolean().optional(),
|
|
1887
2000
|
header: CardBlockHeaderSchema.optional(),
|
|
1888
2001
|
form: FormV2PropsDefinitionSchema,
|
|
1889
|
-
actions:
|
|
1890
|
-
secondaryActions:
|
|
1891
|
-
primaryActions:
|
|
2002
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional(),
|
|
2003
|
+
secondaryActions: import_v48.z.array(PageActionDefinitionSchema).optional(),
|
|
2004
|
+
primaryActions: import_v48.z.array(PageActionDefinitionSchema).optional()
|
|
1892
2005
|
});
|
|
1893
|
-
var PageFieldDefinitionBaseSchema =
|
|
1894
|
-
handle:
|
|
2006
|
+
var PageFieldDefinitionBaseSchema = import_v48.z.object({
|
|
2007
|
+
handle: import_v48.z.string(),
|
|
1895
2008
|
type: PageFieldTypeSchema,
|
|
1896
|
-
label:
|
|
1897
|
-
description:
|
|
1898
|
-
required:
|
|
1899
|
-
handler:
|
|
2009
|
+
label: import_v48.z.string(),
|
|
2010
|
+
description: import_v48.z.string().optional(),
|
|
2011
|
+
required: import_v48.z.boolean().optional(),
|
|
2012
|
+
handler: import_v48.z.string().optional(),
|
|
1900
2013
|
source: PageFieldSourceSchema.optional(),
|
|
1901
|
-
options:
|
|
1902
|
-
accept:
|
|
1903
|
-
model:
|
|
2014
|
+
options: import_v48.z.array(import_v48.z.object({ value: import_v48.z.string(), label: import_v48.z.string() })).optional(),
|
|
2015
|
+
accept: import_v48.z.string().optional(),
|
|
2016
|
+
model: import_v48.z.string().optional()
|
|
1904
2017
|
});
|
|
1905
2018
|
var PageFieldDefinitionSchema = PageFieldDefinitionBaseSchema.extend({
|
|
1906
2019
|
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:
|
|
2020
|
+
fields: import_v48.z.lazy(() => import_v48.z.array(PageFieldDefinitionSchema)).optional(),
|
|
2021
|
+
actions: import_v48.z.lazy(() => import_v48.z.array(PageActionDefinitionSchema)).optional()
|
|
2022
|
+
});
|
|
2023
|
+
var LegacyFormBlockDefinitionSchema = import_v48.z.object({
|
|
2024
|
+
type: import_v48.z.enum(["form", "spreadsheet", "kanban", "calendar", "link"]),
|
|
2025
|
+
title: import_v48.z.string().optional(),
|
|
2026
|
+
fields: import_v48.z.array(PageFieldDefinitionSchema).optional(),
|
|
2027
|
+
readonly: import_v48.z.boolean().optional()
|
|
2028
|
+
});
|
|
2029
|
+
var ListBlockDefinitionSchema = import_v48.z.object({
|
|
2030
|
+
type: import_v48.z.literal("list"),
|
|
2031
|
+
title: import_v48.z.string().optional(),
|
|
2032
|
+
model: import_v48.z.string(),
|
|
2033
|
+
labelField: import_v48.z.string().optional(),
|
|
2034
|
+
descriptionField: import_v48.z.string().optional(),
|
|
2035
|
+
icon: import_v48.z.string().optional(),
|
|
2036
|
+
emptyMessage: import_v48.z.string().optional()
|
|
2037
|
+
});
|
|
2038
|
+
var ModelMapperBlockDefinitionSchema = import_v48.z.object({
|
|
2039
|
+
type: import_v48.z.literal("model_mapper"),
|
|
1927
2040
|
/** The SHARED model handle from install config (e.g., "client", "patient") */
|
|
1928
|
-
model:
|
|
2041
|
+
model: import_v48.z.string()
|
|
1929
2042
|
});
|
|
1930
|
-
var PageBlockDefinitionSchema =
|
|
2043
|
+
var PageBlockDefinitionSchema = import_v48.z.union([
|
|
1931
2044
|
CardBlockDefinitionSchema,
|
|
1932
2045
|
LegacyFormBlockDefinitionSchema,
|
|
1933
2046
|
ListBlockDefinitionSchema,
|
|
1934
2047
|
ModelMapperBlockDefinitionSchema
|
|
1935
2048
|
]);
|
|
1936
|
-
var PageContextModeSchema =
|
|
1937
|
-
var PageContextFiltersSchema =
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
2049
|
+
var PageContextModeSchema = import_v48.z.enum(["first", "many", "count", "all"]).transform((val) => val === "all" ? "many" : val);
|
|
2050
|
+
var PageContextFiltersSchema = import_v48.z.record(
|
|
2051
|
+
import_v48.z.string(),
|
|
2052
|
+
import_v48.z.record(
|
|
2053
|
+
import_v48.z.string(),
|
|
2054
|
+
import_v48.z.union([PrimitiveSchema, import_v48.z.array(PrimitiveSchema), import_v48.z.string()])
|
|
1942
2055
|
)
|
|
1943
2056
|
);
|
|
1944
|
-
var PageContextItemDefinitionSchema =
|
|
2057
|
+
var PageContextItemDefinitionSchema = import_v48.z.object({
|
|
1945
2058
|
/** Model handle to fetch data from */
|
|
1946
|
-
model:
|
|
2059
|
+
model: import_v48.z.string(),
|
|
1947
2060
|
/** Fetch mode: 'first' returns single object, 'many' returns array, 'count' returns number */
|
|
1948
2061
|
mode: PageContextModeSchema,
|
|
1949
2062
|
/**
|
|
@@ -1953,69 +2066,69 @@ var PageContextItemDefinitionSchema = import_v47.z.object({
|
|
|
1953
2066
|
*/
|
|
1954
2067
|
filters: PageContextFiltersSchema.optional(),
|
|
1955
2068
|
/** Optional limit for 'many' mode */
|
|
1956
|
-
limit:
|
|
2069
|
+
limit: import_v48.z.number().optional()
|
|
1957
2070
|
});
|
|
1958
|
-
var PageContextToolItemDefinitionSchema =
|
|
2071
|
+
var PageContextToolItemDefinitionSchema = import_v48.z.object({
|
|
1959
2072
|
/** Tool name to invoke for fetching context data */
|
|
1960
|
-
tool:
|
|
2073
|
+
tool: import_v48.z.string()
|
|
1961
2074
|
});
|
|
1962
|
-
var PageContextDefinitionSchema =
|
|
1963
|
-
|
|
1964
|
-
|
|
2075
|
+
var PageContextDefinitionSchema = import_v48.z.record(
|
|
2076
|
+
import_v48.z.string(),
|
|
2077
|
+
import_v48.z.union([PageContextItemDefinitionSchema, PageContextToolItemDefinitionSchema])
|
|
1965
2078
|
);
|
|
1966
|
-
var PageInstanceFilterSchema =
|
|
1967
|
-
model:
|
|
1968
|
-
where:
|
|
2079
|
+
var PageInstanceFilterSchema = import_v48.z.object({
|
|
2080
|
+
model: import_v48.z.string(),
|
|
2081
|
+
where: import_v48.z.record(import_v48.z.string(), import_v48.z.unknown()).optional()
|
|
1969
2082
|
});
|
|
1970
|
-
var NavigationItemSchema =
|
|
2083
|
+
var NavigationItemSchema = import_v48.z.object({
|
|
1971
2084
|
/** Display label (supports Liquid templates) */
|
|
1972
|
-
label:
|
|
2085
|
+
label: import_v48.z.string(),
|
|
1973
2086
|
/** URL href (supports Liquid templates with path_params and context) */
|
|
1974
|
-
href:
|
|
2087
|
+
href: import_v48.z.string(),
|
|
1975
2088
|
/** Optional icon name */
|
|
1976
|
-
icon:
|
|
2089
|
+
icon: import_v48.z.string().optional(),
|
|
1977
2090
|
/** When true, item is omitted from rendered navigation (supports Liquid templates) */
|
|
1978
|
-
hidden:
|
|
2091
|
+
hidden: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string()]).optional()
|
|
1979
2092
|
});
|
|
1980
|
-
var NavigationSectionSchema =
|
|
2093
|
+
var NavigationSectionSchema = import_v48.z.object({
|
|
1981
2094
|
/** Section title (supports Liquid templates) */
|
|
1982
|
-
title:
|
|
2095
|
+
title: import_v48.z.string().optional(),
|
|
1983
2096
|
/** Navigation items in this section */
|
|
1984
|
-
items:
|
|
2097
|
+
items: import_v48.z.array(NavigationItemSchema)
|
|
1985
2098
|
});
|
|
1986
|
-
var NavigationSidebarSchema =
|
|
2099
|
+
var NavigationSidebarSchema = import_v48.z.object({
|
|
1987
2100
|
/** Sections to display in the sidebar */
|
|
1988
|
-
sections:
|
|
2101
|
+
sections: import_v48.z.array(NavigationSectionSchema)
|
|
1989
2102
|
});
|
|
1990
|
-
var BreadcrumbItemSchema =
|
|
2103
|
+
var BreadcrumbItemSchema = import_v48.z.object({
|
|
1991
2104
|
/** Display label (supports Liquid templates) */
|
|
1992
|
-
label:
|
|
2105
|
+
label: import_v48.z.string(),
|
|
1993
2106
|
/** Optional href - if not provided, item is not clickable */
|
|
1994
|
-
href:
|
|
2107
|
+
href: import_v48.z.string().optional()
|
|
1995
2108
|
});
|
|
1996
|
-
var NavigationBreadcrumbSchema =
|
|
2109
|
+
var NavigationBreadcrumbSchema = import_v48.z.object({
|
|
1997
2110
|
/** Breadcrumb items from left to right */
|
|
1998
|
-
items:
|
|
2111
|
+
items: import_v48.z.array(BreadcrumbItemSchema)
|
|
1999
2112
|
});
|
|
2000
|
-
var NavigationConfigSchema =
|
|
2113
|
+
var NavigationConfigSchema = import_v48.z.object({
|
|
2001
2114
|
/** Sidebar navigation */
|
|
2002
2115
|
sidebar: NavigationSidebarSchema.optional(),
|
|
2003
2116
|
/** Breadcrumb navigation */
|
|
2004
2117
|
breadcrumb: NavigationBreadcrumbSchema.optional()
|
|
2005
2118
|
});
|
|
2006
|
-
var PageAudienceSchema =
|
|
2007
|
-
var PageDefinitionSchema =
|
|
2119
|
+
var PageAudienceSchema = import_v48.z.enum(["install", "developer", "both"]);
|
|
2120
|
+
var PageDefinitionSchema = import_v48.z.object({
|
|
2008
2121
|
/** Unique identifier within the app (snake_case) */
|
|
2009
|
-
handle:
|
|
2122
|
+
handle: import_v48.z.string().optional(),
|
|
2010
2123
|
/** Human-readable display name */
|
|
2011
|
-
label:
|
|
2124
|
+
label: import_v48.z.string(),
|
|
2012
2125
|
/** Optional description for documentation/UI */
|
|
2013
|
-
description:
|
|
2126
|
+
description: import_v48.z.string().optional(),
|
|
2014
2127
|
type: PageTypeSchema,
|
|
2015
2128
|
/** URL path for this page (e.g., '/phone-numbers' or '/phone-numbers/[id]' for dynamic segments) */
|
|
2016
|
-
path:
|
|
2129
|
+
path: import_v48.z.string(),
|
|
2017
2130
|
/** When true, this page is the default landing page for the app installation */
|
|
2018
|
-
default:
|
|
2131
|
+
default: import_v48.z.boolean().optional(),
|
|
2019
2132
|
/**
|
|
2020
2133
|
* Page audience:
|
|
2021
2134
|
* - 'install': Visible only to app installers (default)
|
|
@@ -2029,115 +2142,134 @@ var PageDefinitionSchema = import_v47.z.object({
|
|
|
2029
2142
|
* - string: Liquid template that evaluates to true/false
|
|
2030
2143
|
* - NavigationConfigSchema: full navigation override for this page (replaces base navigation)
|
|
2031
2144
|
*/
|
|
2032
|
-
navigation:
|
|
2033
|
-
blocks:
|
|
2034
|
-
actions:
|
|
2145
|
+
navigation: import_v48.z.union([import_v48.z.boolean(), import_v48.z.string(), NavigationConfigSchema]).optional().default(true),
|
|
2146
|
+
blocks: import_v48.z.array(PageBlockDefinitionSchema),
|
|
2147
|
+
actions: import_v48.z.array(PageActionDefinitionSchema).optional(),
|
|
2035
2148
|
/** Context data to load for Liquid templates. appInstallationId filtering is automatic. */
|
|
2036
2149
|
context: PageContextDefinitionSchema.optional(),
|
|
2037
2150
|
/** @deprecated Use context instead */
|
|
2038
2151
|
filter: PageInstanceFilterSchema.optional()
|
|
2039
2152
|
});
|
|
2040
|
-
var WebhookHttpMethodSchema =
|
|
2041
|
-
var WebhookTypeSchema =
|
|
2042
|
-
var WebhookHandlerDefinitionSchema =
|
|
2043
|
-
description:
|
|
2044
|
-
methods:
|
|
2153
|
+
var WebhookHttpMethodSchema = import_v48.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]);
|
|
2154
|
+
var WebhookTypeSchema = import_v48.z.enum(["WEBHOOK", "CALLBACK"]);
|
|
2155
|
+
var WebhookHandlerDefinitionSchema = import_v48.z.object({
|
|
2156
|
+
description: import_v48.z.string().optional(),
|
|
2157
|
+
methods: import_v48.z.array(WebhookHttpMethodSchema).optional(),
|
|
2045
2158
|
/** Invocation type: WEBHOOK (fire-and-forget) or CALLBACK (waits for response). Defaults to WEBHOOK. */
|
|
2046
2159
|
type: WebhookTypeSchema.optional(),
|
|
2047
|
-
handler:
|
|
2160
|
+
handler: import_v48.z.unknown()
|
|
2048
2161
|
});
|
|
2049
|
-
var WebhooksSchema =
|
|
2050
|
-
var AgentDefinitionSchema =
|
|
2162
|
+
var WebhooksSchema = import_v48.z.record(import_v48.z.string(), WebhookHandlerDefinitionSchema);
|
|
2163
|
+
var AgentDefinitionSchema = import_v48.z.object({
|
|
2051
2164
|
/** Unique identifier within the app (used for upserts) */
|
|
2052
|
-
handle:
|
|
2165
|
+
handle: import_v48.z.string().regex(/^[a-z0-9_-]+$/, "Handle must be lowercase alphanumeric with dashes/underscores"),
|
|
2053
2166
|
/** Display name */
|
|
2054
|
-
name:
|
|
2167
|
+
name: import_v48.z.string().min(1),
|
|
2055
2168
|
/** Description of what the agent does */
|
|
2056
|
-
description:
|
|
2169
|
+
description: import_v48.z.string(),
|
|
2057
2170
|
/** System prompt (static, no templating) */
|
|
2058
|
-
system:
|
|
2171
|
+
system: import_v48.z.string(),
|
|
2059
2172
|
/** Tool names to bind (can be empty for orchestrator agents) */
|
|
2060
|
-
tools:
|
|
2173
|
+
tools: import_v48.z.array(import_v48.z.string()),
|
|
2061
2174
|
/** Optional LLM model override */
|
|
2062
|
-
llmModelId:
|
|
2175
|
+
llmModelId: import_v48.z.string().optional(),
|
|
2063
2176
|
/** Parent agent that can call this agent ('composer' or another agent handle) */
|
|
2064
|
-
parentAgent:
|
|
2177
|
+
parentAgent: import_v48.z.string().optional()
|
|
2065
2178
|
});
|
|
2066
|
-
var InstallConfigSchema =
|
|
2179
|
+
var InstallConfigSchema = import_v48.z.object({
|
|
2067
2180
|
env: EnvSchemaSchema.optional(),
|
|
2068
2181
|
/** SHARED model definitions (mapped to user's existing data during installation) */
|
|
2069
|
-
models:
|
|
2182
|
+
models: import_v48.z.array(ModelDefinitionSchema).optional(),
|
|
2070
2183
|
/** Relationship definitions between SHARED models */
|
|
2071
|
-
relationships:
|
|
2184
|
+
relationships: import_v48.z.array(RelationshipDefinitionSchema).optional()
|
|
2072
2185
|
});
|
|
2073
|
-
var ProvisionConfigSchema =
|
|
2186
|
+
var ProvisionConfigSchema = import_v48.z.object({
|
|
2074
2187
|
env: EnvSchemaSchema.optional(),
|
|
2075
2188
|
/** INTERNAL model definitions (app-owned, not visible to users) */
|
|
2076
|
-
models:
|
|
2189
|
+
models: import_v48.z.array(ModelDefinitionSchema).optional(),
|
|
2077
2190
|
/** Relationship definitions between INTERNAL models */
|
|
2078
|
-
relationships:
|
|
2079
|
-
channels:
|
|
2080
|
-
workflows:
|
|
2191
|
+
relationships: import_v48.z.array(RelationshipDefinitionSchema).optional(),
|
|
2192
|
+
channels: import_v48.z.array(ChannelDefinitionSchema).optional(),
|
|
2193
|
+
workflows: import_v48.z.array(WorkflowDefinitionSchema).optional(),
|
|
2081
2194
|
/** Base navigation configuration for all pages (can be overridden per page) */
|
|
2082
2195
|
navigation: NavigationConfigSchema.optional(),
|
|
2083
|
-
pages:
|
|
2196
|
+
pages: import_v48.z.array(PageDefinitionSchema).optional()
|
|
2084
2197
|
});
|
|
2085
|
-
var SkedyulConfigSchema =
|
|
2086
|
-
name:
|
|
2087
|
-
version:
|
|
2088
|
-
description:
|
|
2198
|
+
var SkedyulConfigSchema = import_v48.z.object({
|
|
2199
|
+
name: import_v48.z.string(),
|
|
2200
|
+
version: import_v48.z.string().optional(),
|
|
2201
|
+
description: import_v48.z.string().optional(),
|
|
2089
2202
|
computeLayer: ComputeLayerTypeSchema.optional(),
|
|
2090
|
-
tools:
|
|
2091
|
-
webhooks:
|
|
2092
|
-
provision:
|
|
2093
|
-
agents:
|
|
2203
|
+
tools: import_v48.z.unknown().optional(),
|
|
2204
|
+
webhooks: import_v48.z.unknown().optional(),
|
|
2205
|
+
provision: import_v48.z.union([ProvisionConfigSchema, import_v48.z.unknown()]).optional(),
|
|
2206
|
+
agents: import_v48.z.array(AgentDefinitionSchema).optional()
|
|
2094
2207
|
});
|
|
2095
2208
|
function safeParseConfig(data) {
|
|
2096
2209
|
const result = SkedyulConfigSchema.safeParse(data);
|
|
2097
2210
|
return result.success ? result.data : null;
|
|
2098
2211
|
}
|
|
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 =
|
|
2212
|
+
var MessageSendChannelSchema = import_v48.z.object({
|
|
2213
|
+
id: import_v48.z.string(),
|
|
2214
|
+
handle: import_v48.z.string(),
|
|
2215
|
+
identifierValue: import_v48.z.string()
|
|
2216
|
+
});
|
|
2217
|
+
var MessageSendSubscriptionSchema = import_v48.z.object({
|
|
2218
|
+
id: import_v48.z.string(),
|
|
2219
|
+
identifierValue: import_v48.z.string()
|
|
2220
|
+
});
|
|
2221
|
+
var MessageSendContactSchema = import_v48.z.object({
|
|
2222
|
+
id: import_v48.z.string(),
|
|
2223
|
+
name: import_v48.z.string().optional()
|
|
2224
|
+
});
|
|
2225
|
+
var MessageSendRecipientSchema = import_v48.z.object({
|
|
2226
|
+
address: import_v48.z.string(),
|
|
2227
|
+
name: import_v48.z.string().optional(),
|
|
2228
|
+
participantId: import_v48.z.string().optional(),
|
|
2229
|
+
contactId: import_v48.z.string().optional()
|
|
2230
|
+
});
|
|
2231
|
+
var MessageSendAttachmentSchema = import_v48.z.object({
|
|
2232
|
+
filename: import_v48.z.string(),
|
|
2233
|
+
url: import_v48.z.string(),
|
|
2234
|
+
mimeType: import_v48.z.string(),
|
|
2235
|
+
size: import_v48.z.number()
|
|
2236
|
+
});
|
|
2237
|
+
var MessageSendMessageSchema = import_v48.z.object({
|
|
2238
|
+
id: import_v48.z.string(),
|
|
2239
|
+
content: import_v48.z.string(),
|
|
2240
|
+
contentRaw: import_v48.z.string().optional(),
|
|
2241
|
+
title: import_v48.z.string().optional(),
|
|
2242
|
+
attachments: import_v48.z.array(MessageSendAttachmentSchema).optional()
|
|
2243
|
+
});
|
|
2244
|
+
var MessageSendInputSchema = import_v48.z.object({
|
|
2132
2245
|
channel: MessageSendChannelSchema,
|
|
2133
2246
|
subscription: MessageSendSubscriptionSchema.optional(),
|
|
2134
2247
|
contact: MessageSendContactSchema.optional(),
|
|
2135
2248
|
recipient: MessageSendRecipientSchema.optional(),
|
|
2136
2249
|
message: MessageSendMessageSchema
|
|
2137
2250
|
});
|
|
2138
|
-
var MessageSendOutputSchema =
|
|
2139
|
-
status:
|
|
2140
|
-
remoteId:
|
|
2251
|
+
var MessageSendOutputSchema = import_v48.z.object({
|
|
2252
|
+
status: import_v48.z.enum(["sent", "queued", "failed"]),
|
|
2253
|
+
remoteId: import_v48.z.string().optional()
|
|
2254
|
+
});
|
|
2255
|
+
var MessageBulkRecipientSchema = import_v48.z.object({
|
|
2256
|
+
address: import_v48.z.string(),
|
|
2257
|
+
renderedBody: import_v48.z.string(),
|
|
2258
|
+
instanceId: import_v48.z.string().optional(),
|
|
2259
|
+
threadId: import_v48.z.string().optional(),
|
|
2260
|
+
messageId: import_v48.z.string().optional(),
|
|
2261
|
+
contactId: import_v48.z.string().optional()
|
|
2262
|
+
});
|
|
2263
|
+
var MessageBulkSendInputSchema = import_v48.z.object({
|
|
2264
|
+
channel: MessageSendChannelSchema,
|
|
2265
|
+
recipients: import_v48.z.array(MessageBulkRecipientSchema).min(1).max(1e4),
|
|
2266
|
+
schedule: import_v48.z.object({ at: import_v48.z.string() }).optional()
|
|
2267
|
+
});
|
|
2268
|
+
var MessageBulkSendOutputSchema = import_v48.z.object({
|
|
2269
|
+
status: import_v48.z.enum(["accepted", "failed"]),
|
|
2270
|
+
operationId: import_v48.z.string().optional(),
|
|
2271
|
+
acceptedCount: import_v48.z.number().int().nonnegative(),
|
|
2272
|
+
rejectedCount: import_v48.z.number().int().nonnegative().optional()
|
|
2141
2273
|
});
|
|
2142
2274
|
function isModelDependency(dep) {
|
|
2143
2275
|
return "model" in dep;
|
|
@@ -2151,7 +2283,7 @@ function isWorkflowDependency(dep) {
|
|
|
2151
2283
|
|
|
2152
2284
|
// src/server/index.ts
|
|
2153
2285
|
var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
2154
|
-
var
|
|
2286
|
+
var z11 = __toESM(require("zod"));
|
|
2155
2287
|
|
|
2156
2288
|
// src/core/service.ts
|
|
2157
2289
|
var CoreApiService = class {
|
|
@@ -2260,17 +2392,20 @@ function getQueueConfigWithRetry(queueName) {
|
|
|
2260
2392
|
}
|
|
2261
2393
|
|
|
2262
2394
|
// src/server/utils/schema.ts
|
|
2263
|
-
var
|
|
2395
|
+
var z9 = __toESM(require("zod"));
|
|
2264
2396
|
function normalizeBilling(billing) {
|
|
2265
|
-
if (!billing || typeof billing
|
|
2397
|
+
if (!billing || typeof billing !== "object") {
|
|
2266
2398
|
return { credits: 0 };
|
|
2267
2399
|
}
|
|
2400
|
+
if (typeof billing.credits !== "number") {
|
|
2401
|
+
return { ...billing, credits: 0 };
|
|
2402
|
+
}
|
|
2268
2403
|
return billing;
|
|
2269
2404
|
}
|
|
2270
2405
|
function toJsonSchema(schema) {
|
|
2271
2406
|
if (!schema) return void 0;
|
|
2272
2407
|
try {
|
|
2273
|
-
return
|
|
2408
|
+
return z9.toJSONSchema(schema, {
|
|
2274
2409
|
unrepresentable: "any"
|
|
2275
2410
|
// Handle z.date(), z.bigint() etc gracefully
|
|
2276
2411
|
});
|
|
@@ -2281,12 +2416,12 @@ function toJsonSchema(schema) {
|
|
|
2281
2416
|
}
|
|
2282
2417
|
function isToolSchemaWithJson(schema) {
|
|
2283
2418
|
return Boolean(
|
|
2284
|
-
schema && typeof schema === "object" && "zod" in schema && schema.zod instanceof
|
|
2419
|
+
schema && typeof schema === "object" && "zod" in schema && schema.zod instanceof z9.ZodType
|
|
2285
2420
|
);
|
|
2286
2421
|
}
|
|
2287
2422
|
function getZodSchema(schema) {
|
|
2288
2423
|
if (!schema) return void 0;
|
|
2289
|
-
if (schema instanceof
|
|
2424
|
+
if (schema instanceof z9.ZodType) {
|
|
2290
2425
|
return schema;
|
|
2291
2426
|
}
|
|
2292
2427
|
if (isToolSchemaWithJson(schema)) {
|
|
@@ -2433,7 +2568,7 @@ function buildToolCallErrorOutput(result) {
|
|
|
2433
2568
|
|
|
2434
2569
|
// src/core/client.ts
|
|
2435
2570
|
var import_async_hooks = require("async_hooks");
|
|
2436
|
-
var
|
|
2571
|
+
var import_v49 = require("zod/v4");
|
|
2437
2572
|
var requestConfigStorage = new import_async_hooks.AsyncLocalStorage();
|
|
2438
2573
|
var globalConfig = {
|
|
2439
2574
|
baseUrl: process.env.SKEDYUL_API_URL ?? process.env.SKEDYUL_NODE_URL ?? "",
|
|
@@ -3413,7 +3548,7 @@ var resource = {
|
|
|
3413
3548
|
}
|
|
3414
3549
|
};
|
|
3415
3550
|
function zodSchemaToJsonSchema(schema) {
|
|
3416
|
-
return
|
|
3551
|
+
return import_v49.z.toJSONSchema(schema);
|
|
3417
3552
|
}
|
|
3418
3553
|
var ai = {
|
|
3419
3554
|
/**
|
|
@@ -3639,10 +3774,27 @@ function getActiveQueuedOperation() {
|
|
|
3639
3774
|
function getActiveQueuedOperationStack() {
|
|
3640
3775
|
return activeOperationStackStorage.getStore() ?? [];
|
|
3641
3776
|
}
|
|
3642
|
-
function
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3777
|
+
function getActiveMutexQueueNames() {
|
|
3778
|
+
const names = /* @__PURE__ */ new Set();
|
|
3779
|
+
for (const operation of getActiveQueuedOperationStack()) {
|
|
3780
|
+
if (operation.lease === null) {
|
|
3781
|
+
continue;
|
|
3782
|
+
}
|
|
3783
|
+
const config = getQueueConfigWithRetry(operation.resolved.name);
|
|
3784
|
+
if (config?.mutex === true) {
|
|
3785
|
+
names.add(operation.resolved.name);
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
return [...names];
|
|
3789
|
+
}
|
|
3790
|
+
function shouldSkipNestedAcquire(queueName) {
|
|
3791
|
+
for (const mutexQueueName of getActiveMutexQueueNames()) {
|
|
3792
|
+
const config = getQueueConfigWithRetry(mutexQueueName);
|
|
3793
|
+
if (config?.suppressesQueues?.includes(queueName)) {
|
|
3794
|
+
return true;
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
return false;
|
|
3646
3798
|
}
|
|
3647
3799
|
function setActiveQueuedOperationLease(lease) {
|
|
3648
3800
|
const op = activeOperationStorage.getStore();
|
|
@@ -3879,6 +4031,7 @@ function buildToolMetadata(registry) {
|
|
|
3879
4031
|
const timeout = typeof rawTimeout === "number" && rawTimeout > 0 ? rawTimeout : 1e4;
|
|
3880
4032
|
const retries = typeof rawRetries === "number" && rawRetries >= 1 ? rawRetries : 1;
|
|
3881
4033
|
const queueTouchPoints = tool.queueTouchPoints ?? toolConfig.queueTouchPoints;
|
|
4034
|
+
const rateLimitHandoff = tool.rateLimitHandoff ?? toolConfig.rateLimitHandoff;
|
|
3882
4035
|
return {
|
|
3883
4036
|
name: tool.name,
|
|
3884
4037
|
displayName: tool.label || tool.name,
|
|
@@ -3889,11 +4042,13 @@ function buildToolMetadata(registry) {
|
|
|
3889
4042
|
timeout,
|
|
3890
4043
|
retries,
|
|
3891
4044
|
queueTouchPoints,
|
|
4045
|
+
rateLimitHandoff,
|
|
3892
4046
|
config: {
|
|
3893
4047
|
timeout,
|
|
3894
4048
|
retries,
|
|
3895
4049
|
completionHints: toolConfig.completionHints,
|
|
3896
|
-
queueTouchPoints
|
|
4050
|
+
queueTouchPoints,
|
|
4051
|
+
rateLimitHandoff
|
|
3897
4052
|
}
|
|
3898
4053
|
};
|
|
3899
4054
|
});
|
|
@@ -3935,7 +4090,8 @@ function createCallToolHandler(registry, state, onMaxRequests) {
|
|
|
3935
4090
|
}
|
|
3936
4091
|
const fn = tool.handler;
|
|
3937
4092
|
const args = toolArgsInput ?? {};
|
|
3938
|
-
const
|
|
4093
|
+
const rawContextForMode = args.context ?? {};
|
|
4094
|
+
const estimateMode = args.estimate === true || rawContextForMode.mode === "estimate";
|
|
3939
4095
|
if (!estimateMode) {
|
|
3940
4096
|
state.incrementRequestCount();
|
|
3941
4097
|
if (state.shouldShutdown()) {
|
|
@@ -4422,7 +4578,8 @@ function serializeConfig(config) {
|
|
|
4422
4578
|
// Read timeout/retries from top-level first, then fallback to config
|
|
4423
4579
|
timeout: tool.timeout ?? tool.config?.timeout,
|
|
4424
4580
|
retries: tool.retries ?? tool.config?.retries,
|
|
4425
|
-
queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints
|
|
4581
|
+
queueTouchPoints: tool.queueTouchPoints ?? tool.config?.queueTouchPoints,
|
|
4582
|
+
rateLimitHandoff: tool.rateLimitHandoff ?? tool.config?.rateLimitHandoff
|
|
4426
4583
|
})) : [],
|
|
4427
4584
|
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
4428
4585
|
name: w.name,
|
|
@@ -5117,11 +5274,12 @@ async function handleMcpRoute(req, ctx) {
|
|
|
5117
5274
|
async function handleMcpToolsCall(params, id, ctx) {
|
|
5118
5275
|
const toolName = params?.name;
|
|
5119
5276
|
const rawArgs = params?.arguments ?? {};
|
|
5120
|
-
const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs;
|
|
5277
|
+
const hasSkedyulFormat = "inputs" in rawArgs || "env" in rawArgs || "context" in rawArgs || "invocation" in rawArgs || "estimate" in rawArgs;
|
|
5121
5278
|
const toolInputs = hasSkedyulFormat ? rawArgs.inputs ?? {} : rawArgs;
|
|
5122
5279
|
const toolContext = hasSkedyulFormat ? rawArgs.context : void 0;
|
|
5123
5280
|
const toolEnv = hasSkedyulFormat ? rawArgs.env : void 0;
|
|
5124
5281
|
const toolInvocation = hasSkedyulFormat ? rawArgs.invocation : void 0;
|
|
5282
|
+
const estimate = hasSkedyulFormat && rawArgs.estimate === true;
|
|
5125
5283
|
const found = findToolInRegistry(ctx.registry, toolName);
|
|
5126
5284
|
if (!found) {
|
|
5127
5285
|
return {
|
|
@@ -5146,7 +5304,8 @@ async function handleMcpToolsCall(params, id, ctx) {
|
|
|
5146
5304
|
inputs: validatedInputs,
|
|
5147
5305
|
context: toolContext,
|
|
5148
5306
|
env: toolEnv,
|
|
5149
|
-
invocation: toolInvocation
|
|
5307
|
+
invocation: toolInvocation,
|
|
5308
|
+
estimate
|
|
5150
5309
|
});
|
|
5151
5310
|
let result;
|
|
5152
5311
|
const isFailure2 = isToolCallFailure(toolResult);
|
|
@@ -5604,12 +5763,12 @@ function createSkedyulServer(config) {
|
|
|
5604
5763
|
const toolDisplayName = tool.label || toolName;
|
|
5605
5764
|
const inputZodSchema = getZodSchema(tool.inputSchema);
|
|
5606
5765
|
const outputZodSchema = getZodSchema(tool.outputSchema);
|
|
5607
|
-
const wrappedInputSchema =
|
|
5608
|
-
inputs: inputZodSchema ??
|
|
5609
|
-
context:
|
|
5610
|
-
env:
|
|
5611
|
-
invocation:
|
|
5612
|
-
estimate:
|
|
5766
|
+
const wrappedInputSchema = z11.object({
|
|
5767
|
+
inputs: inputZodSchema ?? z11.record(z11.string(), z11.unknown()).optional(),
|
|
5768
|
+
context: z11.record(z11.string(), z11.unknown()).optional(),
|
|
5769
|
+
env: z11.record(z11.string(), z11.string()).optional(),
|
|
5770
|
+
invocation: z11.record(z11.string(), z11.unknown()).optional(),
|
|
5771
|
+
estimate: z11.boolean().optional()
|
|
5613
5772
|
}).passthrough();
|
|
5614
5773
|
mcpServer.registerTool(
|
|
5615
5774
|
toolName,
|
|
@@ -6318,7 +6477,7 @@ async function executeWithRetries(operation, maxRetries) {
|
|
|
6318
6477
|
operation.resolved.queueKey,
|
|
6319
6478
|
rateLimitCtx
|
|
6320
6479
|
);
|
|
6321
|
-
if (operation.resolved.name
|
|
6480
|
+
if (shouldSkipNestedAcquire(operation.resolved.name)) {
|
|
6322
6481
|
return operation.fn();
|
|
6323
6482
|
}
|
|
6324
6483
|
if (preAcquired) {
|
|
@@ -6422,86 +6581,86 @@ async function queuedFetchResponse(queueInput, url, init) {
|
|
|
6422
6581
|
}
|
|
6423
6582
|
|
|
6424
6583
|
// src/triggers/types.ts
|
|
6425
|
-
var
|
|
6426
|
-
var CRMDataSchema =
|
|
6427
|
-
model:
|
|
6428
|
-
instanceId:
|
|
6429
|
-
data:
|
|
6584
|
+
var import_v410 = require("zod/v4");
|
|
6585
|
+
var CRMDataSchema = import_v410.z.object({
|
|
6586
|
+
model: import_v410.z.string(),
|
|
6587
|
+
instanceId: import_v410.z.string(),
|
|
6588
|
+
data: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown())
|
|
6430
6589
|
});
|
|
6431
|
-
var SenderContextSchema2 =
|
|
6590
|
+
var SenderContextSchema2 = import_v410.z.object({
|
|
6432
6591
|
kind: ParticipantKindSchema,
|
|
6433
|
-
displayName:
|
|
6592
|
+
displayName: import_v410.z.string().optional(),
|
|
6434
6593
|
crm: CRMDataSchema.optional()
|
|
6435
6594
|
});
|
|
6436
|
-
var ThreadContextItemSchema2 =
|
|
6437
|
-
handle:
|
|
6438
|
-
model:
|
|
6439
|
-
instanceId:
|
|
6440
|
-
data:
|
|
6595
|
+
var ThreadContextItemSchema2 = import_v410.z.object({
|
|
6596
|
+
handle: import_v410.z.string(),
|
|
6597
|
+
model: import_v410.z.string(),
|
|
6598
|
+
instanceId: import_v410.z.string(),
|
|
6599
|
+
data: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional()
|
|
6441
6600
|
});
|
|
6442
|
-
var ParticipantContextSchema =
|
|
6443
|
-
id:
|
|
6601
|
+
var ParticipantContextSchema = import_v410.z.object({
|
|
6602
|
+
id: import_v410.z.string(),
|
|
6444
6603
|
kind: ParticipantKindSchema,
|
|
6445
|
-
displayName:
|
|
6446
|
-
contactId:
|
|
6447
|
-
memberId:
|
|
6448
|
-
agentId:
|
|
6449
|
-
workflowId:
|
|
6604
|
+
displayName: import_v410.z.string().optional(),
|
|
6605
|
+
contactId: import_v410.z.string().optional(),
|
|
6606
|
+
memberId: import_v410.z.string().optional(),
|
|
6607
|
+
agentId: import_v410.z.string().optional(),
|
|
6608
|
+
workflowId: import_v410.z.string().optional()
|
|
6450
6609
|
});
|
|
6451
|
-
var TriggerContextSchema =
|
|
6610
|
+
var TriggerContextSchema = import_v410.z.object({
|
|
6452
6611
|
// The event that triggered this
|
|
6453
|
-
event:
|
|
6612
|
+
event: import_v410.z.object({
|
|
6454
6613
|
type: EventTypeSchema,
|
|
6455
|
-
payload:
|
|
6614
|
+
payload: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()),
|
|
6456
6615
|
participant: ParticipantContextSchema.optional()
|
|
6457
6616
|
}),
|
|
6458
6617
|
// Thread information
|
|
6459
|
-
thread:
|
|
6460
|
-
id:
|
|
6461
|
-
title:
|
|
6462
|
-
status:
|
|
6618
|
+
thread: import_v410.z.object({
|
|
6619
|
+
id: import_v410.z.string(),
|
|
6620
|
+
title: import_v410.z.string().optional(),
|
|
6621
|
+
status: import_v410.z.string().optional(),
|
|
6463
6622
|
sender: SenderContextSchema2.optional(),
|
|
6464
|
-
context:
|
|
6465
|
-
participants:
|
|
6623
|
+
context: import_v410.z.record(import_v410.z.string(), CRMDataSchema).optional(),
|
|
6624
|
+
participants: import_v410.z.array(ParticipantContextSchema).optional()
|
|
6466
6625
|
}),
|
|
6467
6626
|
// Workplace info
|
|
6468
|
-
workplace:
|
|
6469
|
-
id:
|
|
6470
|
-
name:
|
|
6471
|
-
settings:
|
|
6627
|
+
workplace: import_v410.z.object({
|
|
6628
|
+
id: import_v410.z.string(),
|
|
6629
|
+
name: import_v410.z.string().optional(),
|
|
6630
|
+
settings: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional()
|
|
6472
6631
|
})
|
|
6473
6632
|
});
|
|
6474
|
-
var InputMappingSchema =
|
|
6475
|
-
var EventConditionsSchema =
|
|
6476
|
-
var TriggerConfigSchema =
|
|
6477
|
-
id:
|
|
6478
|
-
workflowId:
|
|
6479
|
-
workflowVersionId:
|
|
6480
|
-
workplaceId:
|
|
6481
|
-
handle:
|
|
6633
|
+
var InputMappingSchema = import_v410.z.record(import_v410.z.string(), import_v410.z.string());
|
|
6634
|
+
var EventConditionsSchema = import_v410.z.record(import_v410.z.string(), import_v410.z.string());
|
|
6635
|
+
var TriggerConfigSchema = import_v410.z.object({
|
|
6636
|
+
id: import_v410.z.string(),
|
|
6637
|
+
workflowId: import_v410.z.string(),
|
|
6638
|
+
workflowVersionId: import_v410.z.string().optional(),
|
|
6639
|
+
workplaceId: import_v410.z.string(),
|
|
6640
|
+
handle: import_v410.z.string(),
|
|
6482
6641
|
// Input mappings: how to resolve workflow inputs from thread context
|
|
6483
6642
|
inputMappings: InputMappingSchema.optional(),
|
|
6484
6643
|
// Event conditions: additional workplace-specific conditions
|
|
6485
6644
|
eventConditions: EventConditionsSchema.optional(),
|
|
6486
6645
|
// Workplace-specific config overrides
|
|
6487
|
-
config:
|
|
6646
|
+
config: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional(),
|
|
6488
6647
|
// Trigger type and status
|
|
6489
|
-
type:
|
|
6490
|
-
isEnabled:
|
|
6648
|
+
type: import_v410.z.string().optional(),
|
|
6649
|
+
isEnabled: import_v410.z.boolean().optional()
|
|
6491
6650
|
});
|
|
6492
|
-
var ResolvedTriggerSchema =
|
|
6651
|
+
var ResolvedTriggerSchema = import_v410.z.object({
|
|
6493
6652
|
trigger: TriggerConfigSchema,
|
|
6494
|
-
workflow:
|
|
6495
|
-
id:
|
|
6496
|
-
handle:
|
|
6497
|
-
name:
|
|
6498
|
-
inputs:
|
|
6499
|
-
events:
|
|
6500
|
-
subscribes:
|
|
6501
|
-
condition:
|
|
6653
|
+
workflow: import_v410.z.object({
|
|
6654
|
+
id: import_v410.z.string(),
|
|
6655
|
+
handle: import_v410.z.string(),
|
|
6656
|
+
name: import_v410.z.string().optional(),
|
|
6657
|
+
inputs: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()).optional(),
|
|
6658
|
+
events: import_v410.z.object({
|
|
6659
|
+
subscribes: import_v410.z.array(EventTypeSchema).optional(),
|
|
6660
|
+
condition: import_v410.z.string().optional()
|
|
6502
6661
|
}).optional()
|
|
6503
6662
|
}),
|
|
6504
|
-
inputs:
|
|
6663
|
+
inputs: import_v410.z.record(import_v410.z.string(), import_v410.z.unknown()),
|
|
6505
6664
|
context: TriggerContextSchema
|
|
6506
6665
|
});
|
|
6507
6666
|
var TriggerResolutionError = class extends Error {
|
|
@@ -6512,13 +6671,13 @@ var TriggerResolutionError = class extends Error {
|
|
|
6512
6671
|
this.name = "TriggerResolutionError";
|
|
6513
6672
|
}
|
|
6514
6673
|
};
|
|
6515
|
-
var WorkflowInputDefinitionSchema =
|
|
6516
|
-
type:
|
|
6517
|
-
required:
|
|
6518
|
-
description:
|
|
6519
|
-
default:
|
|
6674
|
+
var WorkflowInputDefinitionSchema = import_v410.z.object({
|
|
6675
|
+
type: import_v410.z.string(),
|
|
6676
|
+
required: import_v410.z.boolean().optional(),
|
|
6677
|
+
description: import_v410.z.string().optional(),
|
|
6678
|
+
default: import_v410.z.unknown().optional()
|
|
6520
6679
|
});
|
|
6521
|
-
var WorkflowInputSchemaSchema =
|
|
6680
|
+
var WorkflowInputSchemaSchema = import_v410.z.record(import_v410.z.string(), WorkflowInputDefinitionSchema);
|
|
6522
6681
|
|
|
6523
6682
|
// src/triggers/resolver.ts
|
|
6524
6683
|
function evaluateTemplate(template, context) {
|
|
@@ -6600,67 +6759,67 @@ function matchesTrigger(trigger, eventType, context) {
|
|
|
6600
6759
|
}
|
|
6601
6760
|
|
|
6602
6761
|
// src/workflows/types.ts
|
|
6603
|
-
var
|
|
6762
|
+
var import_v411 = require("zod/v4");
|
|
6604
6763
|
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 =
|
|
6764
|
+
var WorkflowInputSchema = import_v411.z.object({
|
|
6765
|
+
type: import_v411.z.string(),
|
|
6766
|
+
required: import_v411.z.boolean().optional().default(false),
|
|
6767
|
+
description: import_v411.z.string().optional(),
|
|
6768
|
+
default: import_v411.z.unknown().optional()
|
|
6769
|
+
});
|
|
6770
|
+
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())]);
|
|
6771
|
+
var WorkflowStepSchema = import_v411.z.object({
|
|
6613
6772
|
// Service and command
|
|
6614
|
-
service:
|
|
6615
|
-
cmd:
|
|
6773
|
+
service: import_v411.z.string(),
|
|
6774
|
+
cmd: import_v411.z.string(),
|
|
6616
6775
|
// Dependencies
|
|
6617
|
-
needs:
|
|
6776
|
+
needs: import_v411.z.array(import_v411.z.string()).optional(),
|
|
6618
6777
|
// Inputs (Liquid templates supported)
|
|
6619
|
-
inputs:
|
|
6778
|
+
inputs: import_v411.z.record(import_v411.z.string(), WorkflowStepInputSchema).optional(),
|
|
6620
6779
|
// Conditional execution
|
|
6621
|
-
condition:
|
|
6780
|
+
condition: import_v411.z.string().optional(),
|
|
6622
6781
|
// Retry configuration
|
|
6623
|
-
retry:
|
|
6624
|
-
attempts:
|
|
6625
|
-
backoff:
|
|
6782
|
+
retry: import_v411.z.object({
|
|
6783
|
+
attempts: import_v411.z.number().optional(),
|
|
6784
|
+
backoff: import_v411.z.enum(["linear", "exponential"]).optional()
|
|
6626
6785
|
}).optional(),
|
|
6627
6786
|
// Timeout
|
|
6628
|
-
timeout:
|
|
6629
|
-
});
|
|
6630
|
-
var WorkflowRuntimeSchema =
|
|
6631
|
-
durable:
|
|
6632
|
-
timeout:
|
|
6633
|
-
retry:
|
|
6634
|
-
attempts:
|
|
6635
|
-
backoff:
|
|
6787
|
+
timeout: import_v411.z.string().optional()
|
|
6788
|
+
});
|
|
6789
|
+
var WorkflowRuntimeSchema = import_v411.z.object({
|
|
6790
|
+
durable: import_v411.z.boolean().optional().default(true),
|
|
6791
|
+
timeout: import_v411.z.string().optional(),
|
|
6792
|
+
retry: import_v411.z.object({
|
|
6793
|
+
attempts: import_v411.z.number().optional(),
|
|
6794
|
+
backoff: import_v411.z.enum(["linear", "exponential"]).optional()
|
|
6636
6795
|
}).optional()
|
|
6637
6796
|
});
|
|
6638
|
-
var WorkflowYAMLSchema =
|
|
6797
|
+
var WorkflowYAMLSchema = import_v411.z.object({
|
|
6639
6798
|
// Schema version
|
|
6640
|
-
$schema:
|
|
6799
|
+
$schema: import_v411.z.string().optional(),
|
|
6641
6800
|
// Identity
|
|
6642
|
-
handle:
|
|
6643
|
-
name:
|
|
6644
|
-
version:
|
|
6645
|
-
description:
|
|
6801
|
+
handle: import_v411.z.string(),
|
|
6802
|
+
name: import_v411.z.string(),
|
|
6803
|
+
version: import_v411.z.string().optional(),
|
|
6804
|
+
description: import_v411.z.string().optional(),
|
|
6646
6805
|
// Inputs this workflow needs (portable, declared in YAML)
|
|
6647
|
-
inputs:
|
|
6806
|
+
inputs: import_v411.z.record(import_v411.z.string(), WorkflowInputSchema).optional(),
|
|
6648
6807
|
// Event subscriptions and conditions
|
|
6649
6808
|
events: EventsConfigSchema.optional(),
|
|
6650
6809
|
// Deterministic steps
|
|
6651
|
-
steps:
|
|
6810
|
+
steps: import_v411.z.record(import_v411.z.string(), WorkflowStepSchema),
|
|
6652
6811
|
// Runtime configuration
|
|
6653
6812
|
runtime: WorkflowRuntimeSchema.optional()
|
|
6654
6813
|
});
|
|
6655
|
-
var WorkflowMetadataSchema =
|
|
6656
|
-
handle:
|
|
6657
|
-
name:
|
|
6658
|
-
version:
|
|
6659
|
-
description:
|
|
6660
|
-
inputs:
|
|
6814
|
+
var WorkflowMetadataSchema = import_v411.z.object({
|
|
6815
|
+
handle: import_v411.z.string(),
|
|
6816
|
+
name: import_v411.z.string(),
|
|
6817
|
+
version: import_v411.z.string().optional(),
|
|
6818
|
+
description: import_v411.z.string().optional(),
|
|
6819
|
+
inputs: import_v411.z.record(import_v411.z.string(), WorkflowInputDefinitionSchema).optional(),
|
|
6661
6820
|
events: EventsConfigSchema.optional()
|
|
6662
6821
|
});
|
|
6663
|
-
var WorkflowExecutionStatusSchema =
|
|
6822
|
+
var WorkflowExecutionStatusSchema = import_v411.z.enum([
|
|
6664
6823
|
"PENDING",
|
|
6665
6824
|
"RUNNING",
|
|
6666
6825
|
"COMPLETED",
|
|
@@ -6668,14 +6827,14 @@ var WorkflowExecutionStatusSchema = import_v410.z.enum([
|
|
|
6668
6827
|
"CANCELLED",
|
|
6669
6828
|
"WAITING"
|
|
6670
6829
|
]);
|
|
6671
|
-
var WorkflowExecutionResultSchema =
|
|
6830
|
+
var WorkflowExecutionResultSchema = import_v411.z.object({
|
|
6672
6831
|
status: WorkflowExecutionStatusSchema,
|
|
6673
|
-
outputs:
|
|
6674
|
-
error:
|
|
6675
|
-
startedAt:
|
|
6676
|
-
completedAt:
|
|
6677
|
-
cancelledAt:
|
|
6678
|
-
cancelReason:
|
|
6832
|
+
outputs: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()).optional(),
|
|
6833
|
+
error: import_v411.z.string().optional(),
|
|
6834
|
+
startedAt: import_v411.z.string().datetime().optional(),
|
|
6835
|
+
completedAt: import_v411.z.string().datetime().optional(),
|
|
6836
|
+
cancelledAt: import_v411.z.string().datetime().optional(),
|
|
6837
|
+
cancelReason: import_v411.z.string().optional()
|
|
6679
6838
|
});
|
|
6680
6839
|
function defineWorkflowYAML(workflow) {
|
|
6681
6840
|
return WorkflowYAMLSchema.parse(workflow);
|
|
@@ -6753,8 +6912,8 @@ function getAssociationByModel(context, model) {
|
|
|
6753
6912
|
}
|
|
6754
6913
|
|
|
6755
6914
|
// src/memory/types.ts
|
|
6756
|
-
var
|
|
6757
|
-
var MemoryEntryTypeSchema =
|
|
6915
|
+
var import_v412 = require("zod/v4");
|
|
6916
|
+
var MemoryEntryTypeSchema = import_v412.z.enum([
|
|
6758
6917
|
"WORKING",
|
|
6759
6918
|
// Current conversation context
|
|
6760
6919
|
"OBSERVATION",
|
|
@@ -6764,80 +6923,80 @@ var MemoryEntryTypeSchema = import_v411.z.enum([
|
|
|
6764
6923
|
"SEMANTIC"
|
|
6765
6924
|
// Semantic memory for retrieval
|
|
6766
6925
|
]);
|
|
6767
|
-
var MemoryEntrySchema =
|
|
6768
|
-
id:
|
|
6926
|
+
var MemoryEntrySchema = import_v412.z.object({
|
|
6927
|
+
id: import_v412.z.string(),
|
|
6769
6928
|
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 =
|
|
6929
|
+
key: import_v412.z.string(),
|
|
6930
|
+
value: import_v412.z.unknown(),
|
|
6931
|
+
metadata: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).optional(),
|
|
6932
|
+
expiresAt: import_v412.z.string().datetime().optional(),
|
|
6933
|
+
createdAt: import_v412.z.string().datetime(),
|
|
6934
|
+
updatedAt: import_v412.z.string().datetime()
|
|
6935
|
+
});
|
|
6936
|
+
var WorkingMemoryConfigSchema2 = import_v412.z.object({
|
|
6937
|
+
strategy: import_v412.z.enum(["full", "rolling_summary", "sliding_window"]).default("rolling_summary"),
|
|
6938
|
+
maxTokens: import_v412.z.number().default(8e3),
|
|
6939
|
+
summarizeAt: import_v412.z.number().optional(),
|
|
6940
|
+
ttl: import_v412.z.string().optional()
|
|
6941
|
+
});
|
|
6942
|
+
var SemanticMemoryConfigSchema2 = import_v412.z.object({
|
|
6943
|
+
enabled: import_v412.z.boolean().default(false),
|
|
6944
|
+
topK: import_v412.z.number().default(5),
|
|
6945
|
+
scope: import_v412.z.enum(["thread", "instance", "workspace"]).default("thread"),
|
|
6946
|
+
minScore: import_v412.z.number().default(0.7)
|
|
6947
|
+
});
|
|
6948
|
+
var ExternalMemoryConfigSchema2 = import_v412.z.object({
|
|
6949
|
+
namespace: import_v412.z.string(),
|
|
6950
|
+
ttl: import_v412.z.string().optional()
|
|
6951
|
+
});
|
|
6952
|
+
var MemoryConfigSchema = import_v412.z.object({
|
|
6794
6953
|
working: WorkingMemoryConfigSchema2.optional(),
|
|
6795
6954
|
semantic: SemanticMemoryConfigSchema2.optional(),
|
|
6796
6955
|
external: ExternalMemoryConfigSchema2.optional(),
|
|
6797
|
-
persistent:
|
|
6798
|
-
namespace:
|
|
6956
|
+
persistent: import_v412.z.object({
|
|
6957
|
+
namespace: import_v412.z.string()
|
|
6799
6958
|
}).optional()
|
|
6800
6959
|
});
|
|
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:
|
|
6960
|
+
var MemoryScopeSchema = import_v412.z.object({
|
|
6961
|
+
threadId: import_v412.z.string().optional(),
|
|
6962
|
+
participantId: import_v412.z.string().optional(),
|
|
6963
|
+
agentId: import_v412.z.string().optional(),
|
|
6964
|
+
workplaceId: import_v412.z.string().optional(),
|
|
6965
|
+
namespace: import_v412.z.string().optional()
|
|
6966
|
+
});
|
|
6967
|
+
var MemoryQueryOptionsSchema = import_v412.z.object({
|
|
6968
|
+
types: import_v412.z.array(MemoryEntryTypeSchema).optional(),
|
|
6969
|
+
keys: import_v412.z.array(import_v412.z.string()).optional(),
|
|
6970
|
+
limit: import_v412.z.number().default(100),
|
|
6971
|
+
includeExpired: import_v412.z.boolean().default(false)
|
|
6972
|
+
});
|
|
6973
|
+
var ConversationSummarySchema = import_v412.z.object({
|
|
6974
|
+
summary: import_v412.z.string(),
|
|
6975
|
+
keyPoints: import_v412.z.array(import_v412.z.string()),
|
|
6976
|
+
entities: import_v412.z.array(import_v412.z.object({
|
|
6977
|
+
name: import_v412.z.string(),
|
|
6978
|
+
type: import_v412.z.string(),
|
|
6979
|
+
relevance: import_v412.z.number()
|
|
6821
6980
|
})),
|
|
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:
|
|
6981
|
+
lastMessageId: import_v412.z.string().optional(),
|
|
6982
|
+
messageCount: import_v412.z.number(),
|
|
6983
|
+
tokenCount: import_v412.z.number(),
|
|
6984
|
+
createdAt: import_v412.z.string().datetime()
|
|
6985
|
+
});
|
|
6986
|
+
var AgentObservationSchema = import_v412.z.object({
|
|
6987
|
+
observation: import_v412.z.string(),
|
|
6988
|
+
confidence: import_v412.z.number().min(0).max(1),
|
|
6989
|
+
source: import_v412.z.enum(["inference", "explicit", "tool_result"]),
|
|
6990
|
+
context: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).optional(),
|
|
6991
|
+
createdAt: import_v412.z.string().datetime()
|
|
6992
|
+
});
|
|
6993
|
+
var ExternalDataCacheSchema = import_v412.z.object({
|
|
6994
|
+
source: import_v412.z.string(),
|
|
6995
|
+
endpoint: import_v412.z.string().optional(),
|
|
6996
|
+
data: import_v412.z.unknown(),
|
|
6997
|
+
fetchedAt: import_v412.z.string().datetime(),
|
|
6998
|
+
expiresAt: import_v412.z.string().datetime().optional(),
|
|
6999
|
+
metadata: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).optional()
|
|
6841
7000
|
});
|
|
6842
7001
|
|
|
6843
7002
|
// src/memory/service.ts
|
|
@@ -7428,16 +7587,16 @@ function estimateTokens(agent, skills) {
|
|
|
7428
7587
|
}
|
|
7429
7588
|
|
|
7430
7589
|
// src/scheduling/types.ts
|
|
7431
|
-
var
|
|
7432
|
-
var TimeStampSchema =
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
hour:
|
|
7436
|
-
minute:
|
|
7437
|
-
second:
|
|
7590
|
+
var import_v413 = require("zod/v4");
|
|
7591
|
+
var TimeStampSchema = import_v413.z.union([
|
|
7592
|
+
import_v413.z.number().describe("Hour of day (0-23)"),
|
|
7593
|
+
import_v413.z.object({
|
|
7594
|
+
hour: import_v413.z.number(),
|
|
7595
|
+
minute: import_v413.z.number().optional().default(0),
|
|
7596
|
+
second: import_v413.z.number().optional().default(0)
|
|
7438
7597
|
})
|
|
7439
7598
|
]);
|
|
7440
|
-
var DayOfWeekSchema =
|
|
7599
|
+
var DayOfWeekSchema = import_v413.z.enum([
|
|
7441
7600
|
"monday",
|
|
7442
7601
|
"tuesday",
|
|
7443
7602
|
"wednesday",
|
|
@@ -7446,13 +7605,13 @@ var DayOfWeekSchema = import_v412.z.enum([
|
|
|
7446
7605
|
"saturday",
|
|
7447
7606
|
"sunday"
|
|
7448
7607
|
]);
|
|
7449
|
-
var TimeWindowSlotSchema =
|
|
7608
|
+
var TimeWindowSlotSchema = import_v413.z.object({
|
|
7450
7609
|
startTime: TimeStampSchema,
|
|
7451
7610
|
endTime: TimeStampSchema,
|
|
7452
|
-
days:
|
|
7453
|
-
timezone:
|
|
7611
|
+
days: import_v413.z.array(DayOfWeekSchema),
|
|
7612
|
+
timezone: import_v413.z.string().optional()
|
|
7454
7613
|
});
|
|
7455
|
-
var WaitUnitSchema =
|
|
7614
|
+
var WaitUnitSchema = import_v413.z.enum([
|
|
7456
7615
|
"second",
|
|
7457
7616
|
"seconds",
|
|
7458
7617
|
"minute",
|
|
@@ -7468,17 +7627,17 @@ var WaitUnitSchema = import_v412.z.enum([
|
|
|
7468
7627
|
"year",
|
|
7469
7628
|
"years"
|
|
7470
7629
|
]);
|
|
7471
|
-
var WaitInputRelativeSchema =
|
|
7472
|
-
mode:
|
|
7473
|
-
amount:
|
|
7630
|
+
var WaitInputRelativeSchema = import_v413.z.object({
|
|
7631
|
+
mode: import_v413.z.literal("relative"),
|
|
7632
|
+
amount: import_v413.z.number(),
|
|
7474
7633
|
unit: WaitUnitSchema,
|
|
7475
|
-
windows:
|
|
7634
|
+
windows: import_v413.z.array(TimeWindowSlotSchema).optional()
|
|
7476
7635
|
});
|
|
7477
|
-
var WaitInputAbsoluteSchema =
|
|
7478
|
-
mode:
|
|
7479
|
-
scheduleAt:
|
|
7636
|
+
var WaitInputAbsoluteSchema = import_v413.z.object({
|
|
7637
|
+
mode: import_v413.z.literal("absolute"),
|
|
7638
|
+
scheduleAt: import_v413.z.union([import_v413.z.string(), import_v413.z.number()])
|
|
7480
7639
|
});
|
|
7481
|
-
var WaitInputSchema =
|
|
7640
|
+
var WaitInputSchema = import_v413.z.union([
|
|
7482
7641
|
WaitInputRelativeSchema,
|
|
7483
7642
|
WaitInputAbsoluteSchema
|
|
7484
7643
|
]);
|
|
@@ -7788,8 +7947,62 @@ function isTimeInPolicy(date, policy) {
|
|
|
7788
7947
|
return false;
|
|
7789
7948
|
}
|
|
7790
7949
|
|
|
7950
|
+
// src/tools/sms/gsm7.ts
|
|
7951
|
+
var GSM7_BASIC = `@\xA3$\xA5\xE8\xE9\xF9\xEC\xF2\xC7
|
|
7952
|
+
\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`;
|
|
7953
|
+
var GSM7_EXTENDED = "^{}\\[~]|\u20AC";
|
|
7954
|
+
var GSM7_BASIC_SET = new Set(GSM7_BASIC.split(""));
|
|
7955
|
+
var GSM7_EXTENDED_SET = new Set(GSM7_EXTENDED.split(""));
|
|
7956
|
+
function toGsm7(value) {
|
|
7957
|
+
if (value === null || value === void 0) {
|
|
7958
|
+
return "";
|
|
7959
|
+
}
|
|
7960
|
+
const str = String(value);
|
|
7961
|
+
let result = "";
|
|
7962
|
+
for (const char of str) {
|
|
7963
|
+
if (GSM7_BASIC_SET.has(char) || GSM7_EXTENDED_SET.has(char)) {
|
|
7964
|
+
result += char;
|
|
7965
|
+
}
|
|
7966
|
+
}
|
|
7967
|
+
return result;
|
|
7968
|
+
}
|
|
7969
|
+
function isGsm7Character(char) {
|
|
7970
|
+
return GSM7_BASIC_SET.has(char) || GSM7_EXTENDED_SET.has(char);
|
|
7971
|
+
}
|
|
7972
|
+
function countGsm7Septets(text) {
|
|
7973
|
+
let septets = 0;
|
|
7974
|
+
for (const char of text) {
|
|
7975
|
+
septets += GSM7_EXTENDED_SET.has(char) ? 2 : 1;
|
|
7976
|
+
}
|
|
7977
|
+
return septets;
|
|
7978
|
+
}
|
|
7979
|
+
function estimateSmsSegments(text) {
|
|
7980
|
+
const normalized = text ?? "";
|
|
7981
|
+
const characters = [...normalized].length;
|
|
7982
|
+
if (characters === 0) {
|
|
7983
|
+
return { encoding: "GSM-7", characters: 0, septets: 0, segments: 0 };
|
|
7984
|
+
}
|
|
7985
|
+
const isGsm7 = [...normalized].every(isGsm7Character);
|
|
7986
|
+
if (isGsm7) {
|
|
7987
|
+
const septets = countGsm7Septets(normalized);
|
|
7988
|
+
const segments2 = septets <= 160 ? 1 : Math.ceil(septets / 153);
|
|
7989
|
+
return {
|
|
7990
|
+
encoding: "GSM-7",
|
|
7991
|
+
characters,
|
|
7992
|
+
septets,
|
|
7993
|
+
segments: segments2
|
|
7994
|
+
};
|
|
7995
|
+
}
|
|
7996
|
+
const segments = characters <= 70 ? 1 : Math.ceil(characters / 67);
|
|
7997
|
+
return {
|
|
7998
|
+
encoding: "UCS-2",
|
|
7999
|
+
characters,
|
|
8000
|
+
segments
|
|
8001
|
+
};
|
|
8002
|
+
}
|
|
8003
|
+
|
|
7791
8004
|
// src/index.ts
|
|
7792
|
-
var index_default = { z:
|
|
8005
|
+
var index_default = { z: import_v414.z };
|
|
7793
8006
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7794
8007
|
0 && (module.exports = {
|
|
7795
8008
|
AgentContextSchema,
|
|
@@ -7846,6 +8059,7 @@ var index_default = { z: import_v413.z };
|
|
|
7846
8059
|
EnvSchemaSchema,
|
|
7847
8060
|
EnvVariableDefinitionSchema,
|
|
7848
8061
|
EnvVisibilitySchema,
|
|
8062
|
+
EstimationSchema,
|
|
7849
8063
|
EventConditionsSchema,
|
|
7850
8064
|
EventSubscriptionSchema,
|
|
7851
8065
|
EventTypeSchema,
|
|
@@ -7887,6 +8101,9 @@ var index_default = { z: import_v413.z };
|
|
|
7887
8101
|
MemoryQueryOptionsSchema,
|
|
7888
8102
|
MemoryScopeSchema,
|
|
7889
8103
|
MemoryService,
|
|
8104
|
+
MessageBulkRecipientSchema,
|
|
8105
|
+
MessageBulkSendInputSchema,
|
|
8106
|
+
MessageBulkSendOutputSchema,
|
|
7890
8107
|
MessageEventPayloadSchema,
|
|
7891
8108
|
MessageSendAttachmentSchema,
|
|
7892
8109
|
MessageSendChannelSchema,
|
|
@@ -7905,6 +8122,7 @@ var index_default = { z: import_v413.z };
|
|
|
7905
8122
|
ModelDependencySchema,
|
|
7906
8123
|
ModelFieldDefinitionSchema,
|
|
7907
8124
|
ModelMapperBlockDefinitionSchema,
|
|
8125
|
+
MoneyMinorRangeSchema,
|
|
7908
8126
|
NavigationBreadcrumbSchema,
|
|
7909
8127
|
NavigationConfigSchema,
|
|
7910
8128
|
NavigationItemSchema,
|
|
@@ -8008,15 +8226,18 @@ var index_default = { z: import_v413.z };
|
|
|
8008
8226
|
communicationChannel,
|
|
8009
8227
|
compileAgent,
|
|
8010
8228
|
compileWorkflow,
|
|
8229
|
+
computeSkewedExpectedMinorUnits,
|
|
8011
8230
|
configure,
|
|
8012
8231
|
createAuthError,
|
|
8013
8232
|
createConflictError,
|
|
8014
8233
|
createContextLogger,
|
|
8015
8234
|
createErrorResponse,
|
|
8235
|
+
createEstimation,
|
|
8016
8236
|
createExternalError,
|
|
8017
8237
|
createInMemoryService,
|
|
8018
8238
|
createInstanceClient,
|
|
8019
8239
|
createListResponse,
|
|
8240
|
+
createMoneyMinorRange,
|
|
8020
8241
|
createNotFoundError,
|
|
8021
8242
|
createPermissionError,
|
|
8022
8243
|
createQueueHandle,
|
|
@@ -8041,11 +8262,14 @@ var index_default = { z: import_v413.z };
|
|
|
8041
8262
|
defineSkill,
|
|
8042
8263
|
defineWorkflow,
|
|
8043
8264
|
defineWorkflowYAML,
|
|
8265
|
+
estimateSmsSegments,
|
|
8044
8266
|
evaluateCondition,
|
|
8045
8267
|
evaluateTemplate,
|
|
8046
8268
|
event,
|
|
8047
8269
|
file,
|
|
8048
8270
|
formatContextForPrompt,
|
|
8271
|
+
formatMoneyMinorEstimate,
|
|
8272
|
+
formatMoneyMinorRange,
|
|
8049
8273
|
formatSkillInstructions,
|
|
8050
8274
|
getAllEnvKeys,
|
|
8051
8275
|
getAssociationByModel,
|
|
@@ -8071,6 +8295,7 @@ var index_default = { z: import_v413.z };
|
|
|
8071
8295
|
isWorkflowDependency,
|
|
8072
8296
|
matchesTrigger,
|
|
8073
8297
|
parseCRMSchema,
|
|
8298
|
+
parseEstimationFromBilling,
|
|
8074
8299
|
queuedFetch,
|
|
8075
8300
|
queuedFetchResponse,
|
|
8076
8301
|
registerQueueConfig,
|
|
@@ -8084,6 +8309,7 @@ var index_default = { z: import_v413.z };
|
|
|
8084
8309
|
safeParseCRMSchema,
|
|
8085
8310
|
safeParseConfig,
|
|
8086
8311
|
server,
|
|
8312
|
+
toGsm7,
|
|
8087
8313
|
token,
|
|
8088
8314
|
validateCRMSchema,
|
|
8089
8315
|
validateSkillYAML,
|