skedyul 1.7.29 → 1.7.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp +1 -1
- package/dist/cli/api/index.d.ts +3 -0
- package/dist/cli/api/index.js +49 -0
- package/dist/cli/api/playground.d.ts +92 -0
- package/dist/cli/index.js +234 -2
- package/dist/config/types/entity.d.ts +23 -0
- package/dist/esm/index.mjs +438 -339
- package/dist/index.d.ts +2 -2
- package/dist/index.js +443 -339
- package/dist/schemas/agent-schema-v3.d.ts +3 -0
- package/dist/schemas/agent-schema-v3.js +56 -1
- package/dist/schemas/agent-schema-v3.mjs +56 -1
- package/dist/schemas/agent-schema.d.ts +12 -12
- package/dist/schemas/crm-schema.d.ts +16 -16
- package/dist/schemas.d.ts +226 -20
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/types.d.ts +176 -0
- package/dist/skills/types.js +57 -1
- package/dist/skills/types.mjs +53 -1
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -321,9 +321,235 @@ function isRuntimeWebhookContext(ctx) {
|
|
|
321
321
|
// src/schemas.ts
|
|
322
322
|
import { z as z8 } from "zod/v4";
|
|
323
323
|
|
|
324
|
-
// src/
|
|
324
|
+
// src/skills/types.ts
|
|
325
325
|
import { z as z3 } from "zod/v4";
|
|
326
|
-
var
|
|
326
|
+
var SKILL_SCHEMA_VERSION = "https://skedyul.com/schemas/skill/v1";
|
|
327
|
+
var SKILL_SCHEMA_VERSION_V2 = "https://skedyul.com/schemas/skill/v2";
|
|
328
|
+
var SkillSourceSchema = z3.enum(["BUILTIN", "S3", "APP", "EXTERNAL"]);
|
|
329
|
+
var SkillToolRequirementSchema = z3.object({
|
|
330
|
+
requires: z3.array(z3.string()).optional(),
|
|
331
|
+
provides: z3.array(z3.string()).optional()
|
|
332
|
+
});
|
|
333
|
+
var SkillToolSandboxSchema = z3.object({
|
|
334
|
+
mock: z3.unknown().optional()
|
|
335
|
+
});
|
|
336
|
+
var ToolConstraintsSchema = z3.object({
|
|
337
|
+
maxCallsPerRun: z3.number().optional(),
|
|
338
|
+
idempotent: z3.boolean().optional(),
|
|
339
|
+
restricted: z3.boolean().optional(),
|
|
340
|
+
tags: z3.array(z3.string()).optional()
|
|
341
|
+
});
|
|
342
|
+
var SkillToolDefinitionSchema = z3.object({
|
|
343
|
+
tool: z3.string(),
|
|
344
|
+
description: z3.string().optional(),
|
|
345
|
+
overrides: z3.record(z3.string(), z3.unknown()).optional(),
|
|
346
|
+
sandbox: SkillToolSandboxSchema.optional(),
|
|
347
|
+
requiresApproval: z3.boolean().optional(),
|
|
348
|
+
constraints: ToolConstraintsSchema.optional()
|
|
349
|
+
});
|
|
350
|
+
var SkillToolsSchema = z3.union([
|
|
351
|
+
SkillToolRequirementSchema,
|
|
352
|
+
z3.array(SkillToolDefinitionSchema)
|
|
353
|
+
]);
|
|
354
|
+
var SkillExampleSchema = z3.object({
|
|
355
|
+
context: z3.string().optional(),
|
|
356
|
+
input: z3.string(),
|
|
357
|
+
reasoning: z3.string().optional(),
|
|
358
|
+
output: z3.string(),
|
|
359
|
+
tool_call: z3.string().optional()
|
|
360
|
+
});
|
|
361
|
+
var CRMModelFieldRequirementsSchema = z3.object({
|
|
362
|
+
required: z3.array(z3.string()).optional(),
|
|
363
|
+
recommended: z3.array(z3.string()).optional()
|
|
364
|
+
});
|
|
365
|
+
var CRMContextSchema = z3.object({
|
|
366
|
+
models: z3.record(z3.string(), CRMModelFieldRequirementsSchema)
|
|
367
|
+
});
|
|
368
|
+
var EntityOperationSchema = z3.enum(["get", "list", "update", "create", "delete"]);
|
|
369
|
+
var EntityPoliciesSchema = z3.record(
|
|
370
|
+
z3.string(),
|
|
371
|
+
// entity handle (e.g., "member", "booking")
|
|
372
|
+
z3.array(EntityOperationSchema)
|
|
373
|
+
// allowed operations
|
|
374
|
+
);
|
|
375
|
+
var EvaluatorPreconditionsSchema = z3.object({
|
|
376
|
+
toolSucceeded: z3.boolean().optional(),
|
|
377
|
+
anyWrittenFields: z3.array(z3.string()).optional(),
|
|
378
|
+
noneOfWrittenFields: z3.array(z3.string()).optional(),
|
|
379
|
+
crm: z3.array(
|
|
380
|
+
z3.object({
|
|
381
|
+
field: z3.string(),
|
|
382
|
+
op: z3.enum(["eq", "in", "empty", "notEmpty"]),
|
|
383
|
+
value: z3.unknown().optional()
|
|
384
|
+
})
|
|
385
|
+
).optional(),
|
|
386
|
+
skillsLoaded: z3.array(z3.string()).optional(),
|
|
387
|
+
skillsNotLoaded: z3.array(z3.string()).optional()
|
|
388
|
+
});
|
|
389
|
+
var SkillEvaluatorSchema = z3.object({
|
|
390
|
+
name: z3.string(),
|
|
391
|
+
description: z3.string().optional(),
|
|
392
|
+
target: z3.enum(["message", "tool", "entity"]),
|
|
393
|
+
selector: z3.string().optional(),
|
|
394
|
+
criteria: z3.string(),
|
|
395
|
+
passThreshold: z3.number().optional(),
|
|
396
|
+
checks: z3.object({
|
|
397
|
+
requiredArgs: z3.array(z3.string()).optional(),
|
|
398
|
+
forbiddenArgValues: z3.record(z3.string(), z3.array(z3.unknown())).optional()
|
|
399
|
+
}).optional(),
|
|
400
|
+
preconditions: EvaluatorPreconditionsSchema.optional()
|
|
401
|
+
});
|
|
402
|
+
var SkillYAMLSchema = z3.object({
|
|
403
|
+
// Schema version
|
|
404
|
+
$schema: z3.string().optional(),
|
|
405
|
+
// Identity
|
|
406
|
+
handle: z3.string(),
|
|
407
|
+
name: z3.string(),
|
|
408
|
+
version: z3.string().optional(),
|
|
409
|
+
description: z3.string().optional(),
|
|
410
|
+
// Instructions injected into agent system prompt
|
|
411
|
+
instructions: z3.string(),
|
|
412
|
+
// Entity policies - declares which entity operations this skill needs
|
|
413
|
+
// At runtime, these are resolved to CRM tools via AppCrmMap
|
|
414
|
+
entityPolicies: EntityPoliciesSchema.optional(),
|
|
415
|
+
// Tool configuration - supports both v1 and v2 formats
|
|
416
|
+
// Use for non-entity tools (MCP tools, system tools)
|
|
417
|
+
tools: SkillToolsSchema.optional(),
|
|
418
|
+
// CRM context - specifies which models/fields to include in schema
|
|
419
|
+
crmContext: CRMContextSchema.optional(),
|
|
420
|
+
ownedFields: z3.array(z3.string()).optional(),
|
|
421
|
+
// Quality evaluators owned by this skill
|
|
422
|
+
evaluators: z3.array(SkillEvaluatorSchema).optional(),
|
|
423
|
+
// Few-shot examples
|
|
424
|
+
examples: z3.array(SkillExampleSchema).optional()
|
|
425
|
+
});
|
|
426
|
+
var SkillYAMLV2Schema = z3.object({
|
|
427
|
+
$schema: z3.literal(SKILL_SCHEMA_VERSION_V2).optional(),
|
|
428
|
+
handle: z3.string(),
|
|
429
|
+
name: z3.string(),
|
|
430
|
+
version: z3.string().optional(),
|
|
431
|
+
description: z3.string().optional(),
|
|
432
|
+
instructions: z3.string(),
|
|
433
|
+
entityPolicies: EntityPoliciesSchema.optional(),
|
|
434
|
+
tools: z3.array(SkillToolDefinitionSchema).optional(),
|
|
435
|
+
crmContext: CRMContextSchema.optional(),
|
|
436
|
+
ownedFields: z3.array(z3.string()).optional(),
|
|
437
|
+
evaluators: z3.array(SkillEvaluatorSchema).optional(),
|
|
438
|
+
examples: z3.array(SkillExampleSchema).optional()
|
|
439
|
+
});
|
|
440
|
+
var SkillVersionWeightSchema = z3.object({
|
|
441
|
+
version: z3.number(),
|
|
442
|
+
weight: z3.number()
|
|
443
|
+
});
|
|
444
|
+
var SkillRefSchema = z3.union([
|
|
445
|
+
z3.string(),
|
|
446
|
+
// Just handle - uses latest published version
|
|
447
|
+
z3.object({
|
|
448
|
+
skill: z3.string(),
|
|
449
|
+
description: z3.string().optional(),
|
|
450
|
+
// For AI SDK Agent Skills discovery
|
|
451
|
+
/**
|
|
452
|
+
* @deprecated Ignored. The agent must call system:skill:load each turn.
|
|
453
|
+
* Kept so existing agent YAML still validates.
|
|
454
|
+
*/
|
|
455
|
+
alwaysLoad: z3.boolean().optional(),
|
|
456
|
+
// Version selection (pick one):
|
|
457
|
+
version: z3.number().optional(),
|
|
458
|
+
// Pin to specific version number
|
|
459
|
+
versions: z3.array(SkillVersionWeightSchema).optional(),
|
|
460
|
+
// A/B testing weights
|
|
461
|
+
// Legacy support:
|
|
462
|
+
instructions: z3.string().optional(),
|
|
463
|
+
// Inline instructions (deprecated)
|
|
464
|
+
enabled: z3.boolean().optional()
|
|
465
|
+
})
|
|
466
|
+
]);
|
|
467
|
+
var SkillMetadataSchema = z3.object({
|
|
468
|
+
id: z3.string(),
|
|
469
|
+
handle: z3.string(),
|
|
470
|
+
name: z3.string(),
|
|
471
|
+
version: z3.string().optional(),
|
|
472
|
+
description: z3.string().optional(),
|
|
473
|
+
source: SkillSourceSchema,
|
|
474
|
+
s3Key: z3.string().optional(),
|
|
475
|
+
appVersionId: z3.string().optional(),
|
|
476
|
+
workplaceId: z3.string().optional(),
|
|
477
|
+
createdAt: z3.string().datetime().optional(),
|
|
478
|
+
updatedAt: z3.string().datetime().optional()
|
|
479
|
+
});
|
|
480
|
+
var ResolvedSkillSchema = z3.object({
|
|
481
|
+
handle: z3.string(),
|
|
482
|
+
name: z3.string(),
|
|
483
|
+
instructions: z3.string().optional(),
|
|
484
|
+
description: z3.string().optional(),
|
|
485
|
+
tools: z3.array(z3.string()).optional(),
|
|
486
|
+
examples: z3.array(SkillExampleSchema).optional()
|
|
487
|
+
});
|
|
488
|
+
var LoadedSkillSchema = z3.object({
|
|
489
|
+
handle: z3.string(),
|
|
490
|
+
name: z3.string(),
|
|
491
|
+
instructions: z3.string().optional(),
|
|
492
|
+
description: z3.string().optional(),
|
|
493
|
+
entityPolicies: EntityPoliciesSchema.optional(),
|
|
494
|
+
tools: z3.array(SkillToolDefinitionSchema).optional(),
|
|
495
|
+
examples: z3.array(SkillExampleSchema).optional()
|
|
496
|
+
});
|
|
497
|
+
function isV2SkillTools(tools) {
|
|
498
|
+
if (!tools) return false;
|
|
499
|
+
return Array.isArray(tools);
|
|
500
|
+
}
|
|
501
|
+
function getSkillToolNames(tools) {
|
|
502
|
+
if (!tools) return [];
|
|
503
|
+
if (isV2SkillTools(tools)) {
|
|
504
|
+
return tools.map((t) => t.tool);
|
|
505
|
+
}
|
|
506
|
+
return tools.requires || [];
|
|
507
|
+
}
|
|
508
|
+
function defineSkill(skill) {
|
|
509
|
+
return SkillYAMLSchema.parse(skill);
|
|
510
|
+
}
|
|
511
|
+
function validateSkillYAML(skill) {
|
|
512
|
+
const result = SkillYAMLSchema.safeParse(skill);
|
|
513
|
+
if (result.success) {
|
|
514
|
+
return { success: true, data: result.data };
|
|
515
|
+
}
|
|
516
|
+
return { success: false, error: result.error };
|
|
517
|
+
}
|
|
518
|
+
function formatSkillInstructions(skills) {
|
|
519
|
+
if (skills.length === 0) return "";
|
|
520
|
+
const sections = skills.map((skill) => {
|
|
521
|
+
if (!skill.instructions) {
|
|
522
|
+
return `## ${skill.name}
|
|
523
|
+
|
|
524
|
+
${skill.description || "No description available."}`;
|
|
525
|
+
}
|
|
526
|
+
let section = `## ${skill.name}
|
|
527
|
+
|
|
528
|
+
${skill.instructions}`;
|
|
529
|
+
if (skill.examples && skill.examples.length > 0) {
|
|
530
|
+
section += "\n\n### Examples\n";
|
|
531
|
+
for (const example of skill.examples) {
|
|
532
|
+
section += `
|
|
533
|
+
**Input:** ${example.input}
|
|
534
|
+
`;
|
|
535
|
+
if (example.reasoning) {
|
|
536
|
+
section += `**Reasoning:** ${example.reasoning}
|
|
537
|
+
`;
|
|
538
|
+
}
|
|
539
|
+
section += `**Output:** ${example.output}
|
|
540
|
+
`;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return section;
|
|
544
|
+
});
|
|
545
|
+
return `# Skills
|
|
546
|
+
|
|
547
|
+
${sections.join("\n\n---\n\n")}`;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// src/schemas/crm-schema.ts
|
|
551
|
+
import { z as z4 } from "zod/v4";
|
|
552
|
+
var CRMFieldTypeSchema = z4.enum([
|
|
327
553
|
"string",
|
|
328
554
|
"long_string",
|
|
329
555
|
"number",
|
|
@@ -335,51 +561,51 @@ var CRMFieldTypeSchema = z3.enum([
|
|
|
335
561
|
"image",
|
|
336
562
|
"object"
|
|
337
563
|
]);
|
|
338
|
-
var CRMFieldRequirementSchema =
|
|
564
|
+
var CRMFieldRequirementSchema = z4.enum([
|
|
339
565
|
"optional",
|
|
340
566
|
"on_create",
|
|
341
567
|
"required"
|
|
342
568
|
]);
|
|
343
|
-
var CRMFieldOptionSchema =
|
|
344
|
-
label:
|
|
345
|
-
value:
|
|
346
|
-
color:
|
|
347
|
-
});
|
|
348
|
-
var CRMFieldDefinitionObjectSchema =
|
|
349
|
-
options:
|
|
350
|
-
limitChoices:
|
|
351
|
-
minLength:
|
|
352
|
-
maxLength:
|
|
353
|
-
min:
|
|
354
|
-
max:
|
|
355
|
-
pattern:
|
|
356
|
-
});
|
|
357
|
-
var CRMFieldDefinitionSchema =
|
|
358
|
-
|
|
569
|
+
var CRMFieldOptionSchema = z4.object({
|
|
570
|
+
label: z4.string(),
|
|
571
|
+
value: z4.string(),
|
|
572
|
+
color: z4.string().optional()
|
|
573
|
+
});
|
|
574
|
+
var CRMFieldDefinitionObjectSchema = z4.object({
|
|
575
|
+
options: z4.array(CRMFieldOptionSchema).optional(),
|
|
576
|
+
limitChoices: z4.number().optional(),
|
|
577
|
+
minLength: z4.number().optional(),
|
|
578
|
+
maxLength: z4.number().optional(),
|
|
579
|
+
min: z4.number().optional(),
|
|
580
|
+
max: z4.number().optional(),
|
|
581
|
+
pattern: z4.string().optional()
|
|
582
|
+
});
|
|
583
|
+
var CRMFieldDefinitionSchema = z4.union([
|
|
584
|
+
z4.string(),
|
|
359
585
|
CRMFieldDefinitionObjectSchema
|
|
360
586
|
]);
|
|
361
|
-
var CRMFieldAppearanceSchemaZ =
|
|
362
|
-
leftIcon:
|
|
363
|
-
rightIcon:
|
|
364
|
-
placeholder:
|
|
365
|
-
helpText:
|
|
366
|
-
});
|
|
367
|
-
var CRMFieldAiMetaSchemaZ =
|
|
368
|
-
description:
|
|
369
|
-
mutability:
|
|
370
|
-
});
|
|
371
|
-
var CRMFieldSchemaZ =
|
|
372
|
-
handle:
|
|
373
|
-
label:
|
|
587
|
+
var CRMFieldAppearanceSchemaZ = z4.object({
|
|
588
|
+
leftIcon: z4.string().optional(),
|
|
589
|
+
rightIcon: z4.string().optional(),
|
|
590
|
+
placeholder: z4.string().optional(),
|
|
591
|
+
helpText: z4.string().optional()
|
|
592
|
+
});
|
|
593
|
+
var CRMFieldAiMetaSchemaZ = z4.object({
|
|
594
|
+
description: z4.string().optional(),
|
|
595
|
+
mutability: z4.enum(["always", "restricted", "create_only", "immutable"]).optional()
|
|
596
|
+
});
|
|
597
|
+
var CRMFieldSchemaZ = z4.object({
|
|
598
|
+
handle: z4.string().regex(/^[a-z][a-z0-9_]*$/, "Handle must be lowercase alphanumeric with underscores, starting with a letter"),
|
|
599
|
+
label: z4.string().min(1, "Label is required"),
|
|
374
600
|
type: CRMFieldTypeSchema,
|
|
375
601
|
/** Field description - explains what the field is for (metadata, not UI) */
|
|
376
|
-
description:
|
|
602
|
+
description: z4.string().optional(),
|
|
377
603
|
/** Field appearance - UI presentation settings */
|
|
378
604
|
appearance: CRMFieldAppearanceSchemaZ.optional(),
|
|
379
605
|
requirement: CRMFieldRequirementSchema.optional(),
|
|
380
|
-
unique:
|
|
381
|
-
list:
|
|
382
|
-
default:
|
|
606
|
+
unique: z4.boolean().optional(),
|
|
607
|
+
list: z4.boolean().optional(),
|
|
608
|
+
default: z4.unknown().optional(),
|
|
383
609
|
definition: CRMFieldDefinitionSchema.optional(),
|
|
384
610
|
/** AI metadata - description and mutability hints for agents */
|
|
385
611
|
aiMeta: CRMFieldAiMetaSchemaZ.optional(),
|
|
@@ -387,96 +613,96 @@ var CRMFieldSchemaZ = z3.object({
|
|
|
387
613
|
* Workplace-scoped field section handle (visualization helper).
|
|
388
614
|
* Find-or-create on apply; display name is derived from the handle on create.
|
|
389
615
|
*/
|
|
390
|
-
section:
|
|
391
|
-
});
|
|
392
|
-
var CRMModelSchemaZ =
|
|
393
|
-
handle:
|
|
394
|
-
name:
|
|
395
|
-
namePlural:
|
|
396
|
-
labelTemplate:
|
|
397
|
-
description:
|
|
398
|
-
icon:
|
|
399
|
-
fields:
|
|
400
|
-
});
|
|
401
|
-
var CRMCardinalitySchema =
|
|
616
|
+
section: z4.string().regex(/^[a-z][a-z0-9_-]*$/, "Section handle must be lowercase alphanumeric with underscores/hyphens, starting with a letter").optional()
|
|
617
|
+
});
|
|
618
|
+
var CRMModelSchemaZ = z4.object({
|
|
619
|
+
handle: z4.string().regex(/^[a-z][a-z0-9_]*$/, "Handle must be lowercase alphanumeric with underscores, starting with a letter"),
|
|
620
|
+
name: z4.string().min(1, "Name is required"),
|
|
621
|
+
namePlural: z4.string().optional(),
|
|
622
|
+
labelTemplate: z4.string().optional(),
|
|
623
|
+
description: z4.string().optional(),
|
|
624
|
+
icon: z4.string().optional(),
|
|
625
|
+
fields: z4.array(CRMFieldSchemaZ)
|
|
626
|
+
});
|
|
627
|
+
var CRMCardinalitySchema = z4.enum([
|
|
402
628
|
"one_to_one",
|
|
403
629
|
"one_to_many",
|
|
404
630
|
"many_to_one",
|
|
405
631
|
"many_to_many"
|
|
406
632
|
]);
|
|
407
|
-
var CRMOnDeleteSchema =
|
|
633
|
+
var CRMOnDeleteSchema = z4.enum([
|
|
408
634
|
"none",
|
|
409
635
|
"cascade",
|
|
410
636
|
"restrict",
|
|
411
637
|
"set_null"
|
|
412
638
|
]);
|
|
413
|
-
var CRMRelationshipLinkSchema =
|
|
414
|
-
model:
|
|
415
|
-
field:
|
|
416
|
-
label:
|
|
639
|
+
var CRMRelationshipLinkSchema = z4.object({
|
|
640
|
+
model: z4.string(),
|
|
641
|
+
field: z4.string(),
|
|
642
|
+
label: z4.string()
|
|
417
643
|
});
|
|
418
|
-
var CRMRelationshipSchemaZ =
|
|
644
|
+
var CRMRelationshipSchemaZ = z4.object({
|
|
419
645
|
source: CRMRelationshipLinkSchema,
|
|
420
646
|
target: CRMRelationshipLinkSchema,
|
|
421
647
|
cardinality: CRMCardinalitySchema,
|
|
422
648
|
onDelete: CRMOnDeleteSchema.optional()
|
|
423
649
|
});
|
|
424
|
-
var CRMBlockTypeSchema =
|
|
650
|
+
var CRMBlockTypeSchema = z4.enum([
|
|
425
651
|
"spreadsheet",
|
|
426
652
|
"form",
|
|
427
653
|
"card",
|
|
428
654
|
"metric",
|
|
429
655
|
"kanban"
|
|
430
656
|
]);
|
|
431
|
-
var CRMBlockSchemaZ =
|
|
657
|
+
var CRMBlockSchemaZ = z4.object({
|
|
432
658
|
type: CRMBlockTypeSchema,
|
|
433
|
-
title:
|
|
434
|
-
config:
|
|
435
|
-
default:
|
|
659
|
+
title: z4.string().optional(),
|
|
660
|
+
config: z4.unknown().optional(),
|
|
661
|
+
default: z4.boolean().optional()
|
|
436
662
|
});
|
|
437
|
-
var CRMPageTypeSchema =
|
|
438
|
-
var CRMPageSchemaZ =
|
|
439
|
-
path:
|
|
663
|
+
var CRMPageTypeSchema = z4.enum(["list", "instance"]);
|
|
664
|
+
var CRMPageSchemaZ = z4.object({
|
|
665
|
+
path: z4.string(),
|
|
440
666
|
type: CRMPageTypeSchema,
|
|
441
|
-
title:
|
|
442
|
-
icon:
|
|
443
|
-
modelHandle:
|
|
444
|
-
parentPath:
|
|
445
|
-
isDefault:
|
|
446
|
-
visibility:
|
|
447
|
-
baseQuery:
|
|
448
|
-
blocks:
|
|
449
|
-
});
|
|
450
|
-
var CRMNavigationNodeBaseSchemaZ =
|
|
451
|
-
label:
|
|
452
|
-
icon:
|
|
453
|
-
path:
|
|
454
|
-
kind:
|
|
455
|
-
sortIndex:
|
|
456
|
-
});
|
|
457
|
-
var CRMNavigationItemSchemaZ =
|
|
667
|
+
title: z4.string(),
|
|
668
|
+
icon: z4.string().optional(),
|
|
669
|
+
modelHandle: z4.string(),
|
|
670
|
+
parentPath: z4.string().optional(),
|
|
671
|
+
isDefault: z4.boolean().optional(),
|
|
672
|
+
visibility: z4.enum(["team", "private"]).optional(),
|
|
673
|
+
baseQuery: z4.unknown().optional(),
|
|
674
|
+
blocks: z4.array(CRMBlockSchemaZ).optional()
|
|
675
|
+
});
|
|
676
|
+
var CRMNavigationNodeBaseSchemaZ = z4.object({
|
|
677
|
+
label: z4.string(),
|
|
678
|
+
icon: z4.string().optional(),
|
|
679
|
+
path: z4.string().optional(),
|
|
680
|
+
kind: z4.enum(["section", "group"]).optional(),
|
|
681
|
+
sortIndex: z4.number().optional()
|
|
682
|
+
});
|
|
683
|
+
var CRMNavigationItemSchemaZ = z4.lazy(
|
|
458
684
|
() => CRMNavigationNodeBaseSchemaZ.extend({
|
|
459
|
-
children:
|
|
685
|
+
children: z4.array(CRMNavigationItemSchemaZ).optional()
|
|
460
686
|
})
|
|
461
687
|
);
|
|
462
|
-
var CRMNavigationSchemaZ =
|
|
463
|
-
sidebar:
|
|
688
|
+
var CRMNavigationSchemaZ = z4.object({
|
|
689
|
+
sidebar: z4.array(CRMNavigationItemSchemaZ).optional()
|
|
464
690
|
});
|
|
465
|
-
var CRMSchemaZ =
|
|
691
|
+
var CRMSchemaZ = z4.object({
|
|
466
692
|
/** Schema format version for future compatibility */
|
|
467
|
-
$schema:
|
|
693
|
+
$schema: z4.literal("https://skedyul.com/schemas/crm/v1").optional(),
|
|
468
694
|
/** Schema name for identification */
|
|
469
|
-
name:
|
|
695
|
+
name: z4.string().min(1, "Name is required"),
|
|
470
696
|
/** Optional description */
|
|
471
|
-
description:
|
|
697
|
+
description: z4.string().optional(),
|
|
472
698
|
/** Schema version (semver) */
|
|
473
|
-
version:
|
|
699
|
+
version: z4.string().optional(),
|
|
474
700
|
/** Model definitions */
|
|
475
|
-
models:
|
|
701
|
+
models: z4.array(CRMModelSchemaZ),
|
|
476
702
|
/** Relationship definitions */
|
|
477
|
-
relationships:
|
|
703
|
+
relationships: z4.array(CRMRelationshipSchemaZ).optional(),
|
|
478
704
|
/** Page definitions */
|
|
479
|
-
pages:
|
|
705
|
+
pages: z4.array(CRMPageSchemaZ).optional(),
|
|
480
706
|
/** Navigation definitions */
|
|
481
707
|
navigation: CRMNavigationSchemaZ.optional()
|
|
482
708
|
});
|
|
@@ -506,8 +732,8 @@ function safeParseCRMSchema(data) {
|
|
|
506
732
|
import { z as z7 } from "zod/v4";
|
|
507
733
|
|
|
508
734
|
// src/events/types.ts
|
|
509
|
-
import { z as
|
|
510
|
-
var ThreadEventTypeSchema =
|
|
735
|
+
import { z as z5 } from "zod/v4";
|
|
736
|
+
var ThreadEventTypeSchema = z5.enum([
|
|
511
737
|
// Message events
|
|
512
738
|
"thread.message.received",
|
|
513
739
|
"thread.message.sent",
|
|
@@ -530,73 +756,73 @@ var ThreadEventTypeSchema = z4.enum([
|
|
|
530
756
|
// Signal events
|
|
531
757
|
"thread.signal.created"
|
|
532
758
|
]);
|
|
533
|
-
var CustomEventTypeSchema =
|
|
759
|
+
var CustomEventTypeSchema = z5.string().regex(/^custom\.[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$/, {
|
|
534
760
|
message: "Custom event type must match pattern: custom.{namespace}.{event}"
|
|
535
761
|
});
|
|
536
|
-
var EventTypeSchema =
|
|
537
|
-
var ParticipantKindSchema =
|
|
538
|
-
var BaseEventPayloadSchema =
|
|
539
|
-
threadId:
|
|
540
|
-
workplaceId:
|
|
541
|
-
timestamp:
|
|
762
|
+
var EventTypeSchema = z5.union([ThreadEventTypeSchema, CustomEventTypeSchema]);
|
|
763
|
+
var ParticipantKindSchema = z5.enum(["CONTACT", "MEMBER", "AGENT", "WORKFLOW"]);
|
|
764
|
+
var BaseEventPayloadSchema = z5.object({
|
|
765
|
+
threadId: z5.string(),
|
|
766
|
+
workplaceId: z5.string(),
|
|
767
|
+
timestamp: z5.string().datetime().optional()
|
|
542
768
|
});
|
|
543
769
|
var MessageEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
544
|
-
message:
|
|
545
|
-
id:
|
|
546
|
-
content:
|
|
547
|
-
senderId:
|
|
770
|
+
message: z5.object({
|
|
771
|
+
id: z5.string(),
|
|
772
|
+
content: z5.string(),
|
|
773
|
+
senderId: z5.string().optional()
|
|
548
774
|
}),
|
|
549
|
-
participant:
|
|
550
|
-
id:
|
|
775
|
+
participant: z5.object({
|
|
776
|
+
id: z5.string(),
|
|
551
777
|
kind: ParticipantKindSchema,
|
|
552
|
-
displayName:
|
|
778
|
+
displayName: z5.string().optional()
|
|
553
779
|
}).optional(),
|
|
554
|
-
isFirstMessage:
|
|
555
|
-
messageCount:
|
|
780
|
+
isFirstMessage: z5.boolean().optional(),
|
|
781
|
+
messageCount: z5.number().optional()
|
|
556
782
|
});
|
|
557
783
|
var ParticipantEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
558
|
-
participant:
|
|
559
|
-
id:
|
|
784
|
+
participant: z5.object({
|
|
785
|
+
id: z5.string(),
|
|
560
786
|
kind: ParticipantKindSchema,
|
|
561
|
-
displayName:
|
|
562
|
-
contactId:
|
|
563
|
-
memberId:
|
|
564
|
-
agentId:
|
|
565
|
-
workflowId:
|
|
787
|
+
displayName: z5.string().optional(),
|
|
788
|
+
contactId: z5.string().optional(),
|
|
789
|
+
memberId: z5.string().optional(),
|
|
790
|
+
agentId: z5.string().optional(),
|
|
791
|
+
workflowId: z5.string().optional()
|
|
566
792
|
})
|
|
567
793
|
});
|
|
568
794
|
var ContextChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
569
|
-
context:
|
|
570
|
-
handle:
|
|
571
|
-
model:
|
|
572
|
-
instanceId:
|
|
795
|
+
context: z5.object({
|
|
796
|
+
handle: z5.string(),
|
|
797
|
+
model: z5.string(),
|
|
798
|
+
instanceId: z5.string()
|
|
573
799
|
}),
|
|
574
|
-
change:
|
|
575
|
-
field:
|
|
576
|
-
oldValue:
|
|
577
|
-
newValue:
|
|
800
|
+
change: z5.object({
|
|
801
|
+
field: z5.string().optional(),
|
|
802
|
+
oldValue: z5.unknown().optional(),
|
|
803
|
+
newValue: z5.unknown().optional()
|
|
578
804
|
}).optional()
|
|
579
805
|
});
|
|
580
806
|
var StatusChangedPayloadSchema = BaseEventPayloadSchema.extend({
|
|
581
|
-
oldStatus:
|
|
582
|
-
newStatus:
|
|
807
|
+
oldStatus: z5.string(),
|
|
808
|
+
newStatus: z5.string()
|
|
583
809
|
});
|
|
584
810
|
var ScheduledEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
585
|
-
scheduledEventId:
|
|
586
|
-
reason:
|
|
587
|
-
context:
|
|
811
|
+
scheduledEventId: z5.string(),
|
|
812
|
+
reason: z5.string().optional(),
|
|
813
|
+
context: z5.record(z5.string(), z5.unknown()).optional()
|
|
588
814
|
});
|
|
589
815
|
var AgentWorkflowEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
590
|
-
agentId:
|
|
591
|
-
workflowId:
|
|
592
|
-
workflowRunId:
|
|
593
|
-
outputs:
|
|
594
|
-
error:
|
|
816
|
+
agentId: z5.string().optional(),
|
|
817
|
+
workflowId: z5.string().optional(),
|
|
818
|
+
workflowRunId: z5.string().optional(),
|
|
819
|
+
outputs: z5.record(z5.string(), z5.unknown()).optional(),
|
|
820
|
+
error: z5.string().optional()
|
|
595
821
|
});
|
|
596
822
|
var CustomEventPayloadSchema = BaseEventPayloadSchema.extend({
|
|
597
|
-
data:
|
|
823
|
+
data: z5.record(z5.string(), z5.unknown()).optional()
|
|
598
824
|
});
|
|
599
|
-
var ThreadEventPayloadSchema =
|
|
825
|
+
var ThreadEventPayloadSchema = z5.union([
|
|
600
826
|
MessageEventPayloadSchema,
|
|
601
827
|
ParticipantEventPayloadSchema,
|
|
602
828
|
ContextChangedPayloadSchema,
|
|
@@ -605,218 +831,40 @@ var ThreadEventPayloadSchema = z4.union([
|
|
|
605
831
|
AgentWorkflowEventPayloadSchema,
|
|
606
832
|
CustomEventPayloadSchema
|
|
607
833
|
]);
|
|
608
|
-
var ThreadEventSchema =
|
|
609
|
-
id:
|
|
610
|
-
threadId:
|
|
834
|
+
var ThreadEventSchema = z5.object({
|
|
835
|
+
id: z5.string(),
|
|
836
|
+
threadId: z5.string(),
|
|
611
837
|
type: EventTypeSchema,
|
|
612
838
|
payload: ThreadEventPayloadSchema,
|
|
613
|
-
emittedBy:
|
|
614
|
-
createdAt:
|
|
839
|
+
emittedBy: z5.string().optional(),
|
|
840
|
+
createdAt: z5.string().datetime()
|
|
615
841
|
});
|
|
616
|
-
var CreateThreadEventInputSchema =
|
|
617
|
-
threadId:
|
|
842
|
+
var CreateThreadEventInputSchema = z5.object({
|
|
843
|
+
threadId: z5.string(),
|
|
618
844
|
type: EventTypeSchema,
|
|
619
|
-
payload:
|
|
620
|
-
emittedBy:
|
|
845
|
+
payload: z5.record(z5.string(), z5.unknown()),
|
|
846
|
+
emittedBy: z5.string().optional()
|
|
621
847
|
});
|
|
622
|
-
var EventSubscriptionSchema =
|
|
623
|
-
subscribes:
|
|
624
|
-
condition:
|
|
625
|
-
cancels:
|
|
626
|
-
cancelCondition:
|
|
848
|
+
var EventSubscriptionSchema = z5.object({
|
|
849
|
+
subscribes: z5.array(EventTypeSchema),
|
|
850
|
+
condition: z5.string().optional(),
|
|
851
|
+
cancels: z5.array(EventTypeSchema).optional(),
|
|
852
|
+
cancelCondition: z5.string().optional()
|
|
627
853
|
});
|
|
628
|
-
var EventWaitSchema =
|
|
854
|
+
var EventWaitSchema = z5.object({
|
|
629
855
|
event: EventTypeSchema,
|
|
630
|
-
timeout:
|
|
631
|
-
onTimeout:
|
|
856
|
+
timeout: z5.string().optional(),
|
|
857
|
+
onTimeout: z5.string().optional()
|
|
632
858
|
});
|
|
633
|
-
var EventsConfigSchema =
|
|
634
|
-
subscribes:
|
|
635
|
-
condition:
|
|
636
|
-
emits:
|
|
637
|
-
waits:
|
|
638
|
-
cancels:
|
|
639
|
-
cancelCondition:
|
|
859
|
+
var EventsConfigSchema = z5.object({
|
|
860
|
+
subscribes: z5.array(EventTypeSchema).optional(),
|
|
861
|
+
condition: z5.string().optional(),
|
|
862
|
+
emits: z5.array(EventTypeSchema).optional(),
|
|
863
|
+
waits: z5.array(EventWaitSchema).optional(),
|
|
864
|
+
cancels: z5.array(EventTypeSchema).optional(),
|
|
865
|
+
cancelCondition: z5.string().optional()
|
|
640
866
|
});
|
|
641
867
|
|
|
642
|
-
// src/skills/types.ts
|
|
643
|
-
import { z as z5 } from "zod/v4";
|
|
644
|
-
var SKILL_SCHEMA_VERSION = "https://skedyul.com/schemas/skill/v1";
|
|
645
|
-
var SKILL_SCHEMA_VERSION_V2 = "https://skedyul.com/schemas/skill/v2";
|
|
646
|
-
var SkillSourceSchema = z5.enum(["BUILTIN", "S3", "APP", "EXTERNAL"]);
|
|
647
|
-
var SkillToolRequirementSchema = z5.object({
|
|
648
|
-
requires: z5.array(z5.string()).optional(),
|
|
649
|
-
provides: z5.array(z5.string()).optional()
|
|
650
|
-
});
|
|
651
|
-
var SkillToolSandboxSchema = z5.object({
|
|
652
|
-
mock: z5.unknown().optional()
|
|
653
|
-
});
|
|
654
|
-
var ToolConstraintsSchema = z5.object({
|
|
655
|
-
maxCallsPerRun: z5.number().optional(),
|
|
656
|
-
idempotent: z5.boolean().optional(),
|
|
657
|
-
restricted: z5.boolean().optional(),
|
|
658
|
-
tags: z5.array(z5.string()).optional()
|
|
659
|
-
});
|
|
660
|
-
var SkillToolDefinitionSchema = z5.object({
|
|
661
|
-
tool: z5.string(),
|
|
662
|
-
description: z5.string().optional(),
|
|
663
|
-
overrides: z5.record(z5.string(), z5.unknown()).optional(),
|
|
664
|
-
sandbox: SkillToolSandboxSchema.optional(),
|
|
665
|
-
requiresApproval: z5.boolean().optional(),
|
|
666
|
-
constraints: ToolConstraintsSchema.optional()
|
|
667
|
-
});
|
|
668
|
-
var SkillToolsSchema = z5.union([
|
|
669
|
-
SkillToolRequirementSchema,
|
|
670
|
-
z5.array(SkillToolDefinitionSchema)
|
|
671
|
-
]);
|
|
672
|
-
var SkillExampleSchema = z5.object({
|
|
673
|
-
context: z5.string().optional(),
|
|
674
|
-
input: z5.string(),
|
|
675
|
-
reasoning: z5.string().optional(),
|
|
676
|
-
output: z5.string(),
|
|
677
|
-
tool_call: z5.string().optional()
|
|
678
|
-
});
|
|
679
|
-
var CRMModelFieldRequirementsSchema = z5.object({
|
|
680
|
-
required: z5.array(z5.string()).optional(),
|
|
681
|
-
recommended: z5.array(z5.string()).optional()
|
|
682
|
-
});
|
|
683
|
-
var CRMContextSchema = z5.object({
|
|
684
|
-
models: z5.record(z5.string(), CRMModelFieldRequirementsSchema)
|
|
685
|
-
});
|
|
686
|
-
var SkillYAMLSchema = z5.object({
|
|
687
|
-
// Schema version
|
|
688
|
-
$schema: z5.string().optional(),
|
|
689
|
-
// Identity
|
|
690
|
-
handle: z5.string(),
|
|
691
|
-
name: z5.string(),
|
|
692
|
-
version: z5.string().optional(),
|
|
693
|
-
description: z5.string().optional(),
|
|
694
|
-
// Instructions injected into agent system prompt
|
|
695
|
-
instructions: z5.string(),
|
|
696
|
-
// Tool configuration - supports both v1 and v2 formats
|
|
697
|
-
tools: SkillToolsSchema.optional(),
|
|
698
|
-
// CRM context - specifies which models/fields to include in schema
|
|
699
|
-
crmContext: CRMContextSchema.optional(),
|
|
700
|
-
// Few-shot examples
|
|
701
|
-
examples: z5.array(SkillExampleSchema).optional()
|
|
702
|
-
});
|
|
703
|
-
var SkillYAMLV2Schema = z5.object({
|
|
704
|
-
$schema: z5.literal(SKILL_SCHEMA_VERSION_V2).optional(),
|
|
705
|
-
handle: z5.string(),
|
|
706
|
-
name: z5.string(),
|
|
707
|
-
version: z5.string().optional(),
|
|
708
|
-
description: z5.string().optional(),
|
|
709
|
-
instructions: z5.string(),
|
|
710
|
-
tools: z5.array(SkillToolDefinitionSchema).optional(),
|
|
711
|
-
crmContext: CRMContextSchema.optional(),
|
|
712
|
-
examples: z5.array(SkillExampleSchema).optional()
|
|
713
|
-
});
|
|
714
|
-
var SkillVersionWeightSchema = z5.object({
|
|
715
|
-
version: z5.number(),
|
|
716
|
-
weight: z5.number()
|
|
717
|
-
});
|
|
718
|
-
var SkillRefSchema = z5.union([
|
|
719
|
-
z5.string(),
|
|
720
|
-
// Just handle - uses latest published version
|
|
721
|
-
z5.object({
|
|
722
|
-
skill: z5.string(),
|
|
723
|
-
description: z5.string().optional(),
|
|
724
|
-
// For AI SDK Agent Skills discovery
|
|
725
|
-
/** Auto-inject this skill's instructions and tools on every agent turn */
|
|
726
|
-
alwaysLoad: z5.boolean().optional(),
|
|
727
|
-
// Version selection (pick one):
|
|
728
|
-
version: z5.number().optional(),
|
|
729
|
-
// Pin to specific version number
|
|
730
|
-
versions: z5.array(SkillVersionWeightSchema).optional(),
|
|
731
|
-
// A/B testing weights
|
|
732
|
-
// Legacy support:
|
|
733
|
-
instructions: z5.string().optional(),
|
|
734
|
-
// Inline instructions (deprecated)
|
|
735
|
-
enabled: z5.boolean().optional()
|
|
736
|
-
})
|
|
737
|
-
]);
|
|
738
|
-
var SkillMetadataSchema = z5.object({
|
|
739
|
-
id: z5.string(),
|
|
740
|
-
handle: z5.string(),
|
|
741
|
-
name: z5.string(),
|
|
742
|
-
version: z5.string().optional(),
|
|
743
|
-
description: z5.string().optional(),
|
|
744
|
-
source: SkillSourceSchema,
|
|
745
|
-
s3Key: z5.string().optional(),
|
|
746
|
-
appVersionId: z5.string().optional(),
|
|
747
|
-
workplaceId: z5.string().optional(),
|
|
748
|
-
createdAt: z5.string().datetime().optional(),
|
|
749
|
-
updatedAt: z5.string().datetime().optional()
|
|
750
|
-
});
|
|
751
|
-
var ResolvedSkillSchema = z5.object({
|
|
752
|
-
handle: z5.string(),
|
|
753
|
-
name: z5.string(),
|
|
754
|
-
instructions: z5.string().optional(),
|
|
755
|
-
description: z5.string().optional(),
|
|
756
|
-
tools: z5.array(z5.string()).optional(),
|
|
757
|
-
examples: z5.array(SkillExampleSchema).optional()
|
|
758
|
-
});
|
|
759
|
-
var LoadedSkillSchema = z5.object({
|
|
760
|
-
handle: z5.string(),
|
|
761
|
-
name: z5.string(),
|
|
762
|
-
instructions: z5.string().optional(),
|
|
763
|
-
description: z5.string().optional(),
|
|
764
|
-
tools: z5.array(SkillToolDefinitionSchema).optional(),
|
|
765
|
-
examples: z5.array(SkillExampleSchema).optional()
|
|
766
|
-
});
|
|
767
|
-
function isV2SkillTools(tools) {
|
|
768
|
-
if (!tools) return false;
|
|
769
|
-
return Array.isArray(tools);
|
|
770
|
-
}
|
|
771
|
-
function getSkillToolNames(tools) {
|
|
772
|
-
if (!tools) return [];
|
|
773
|
-
if (isV2SkillTools(tools)) {
|
|
774
|
-
return tools.map((t) => t.tool);
|
|
775
|
-
}
|
|
776
|
-
return tools.requires || [];
|
|
777
|
-
}
|
|
778
|
-
function defineSkill(skill) {
|
|
779
|
-
return SkillYAMLSchema.parse(skill);
|
|
780
|
-
}
|
|
781
|
-
function validateSkillYAML(skill) {
|
|
782
|
-
const result = SkillYAMLSchema.safeParse(skill);
|
|
783
|
-
if (result.success) {
|
|
784
|
-
return { success: true, data: result.data };
|
|
785
|
-
}
|
|
786
|
-
return { success: false, error: result.error };
|
|
787
|
-
}
|
|
788
|
-
function formatSkillInstructions(skills) {
|
|
789
|
-
if (skills.length === 0) return "";
|
|
790
|
-
const sections = skills.map((skill) => {
|
|
791
|
-
if (!skill.instructions) {
|
|
792
|
-
return `## ${skill.name}
|
|
793
|
-
|
|
794
|
-
${skill.description || "No description available."}`;
|
|
795
|
-
}
|
|
796
|
-
let section = `## ${skill.name}
|
|
797
|
-
|
|
798
|
-
${skill.instructions}`;
|
|
799
|
-
if (skill.examples && skill.examples.length > 0) {
|
|
800
|
-
section += "\n\n### Examples\n";
|
|
801
|
-
for (const example of skill.examples) {
|
|
802
|
-
section += `
|
|
803
|
-
**Input:** ${example.input}
|
|
804
|
-
`;
|
|
805
|
-
if (example.reasoning) {
|
|
806
|
-
section += `**Reasoning:** ${example.reasoning}
|
|
807
|
-
`;
|
|
808
|
-
}
|
|
809
|
-
section += `**Output:** ${example.output}
|
|
810
|
-
`;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
return section;
|
|
814
|
-
});
|
|
815
|
-
return `# Skills
|
|
816
|
-
|
|
817
|
-
${sections.join("\n\n---\n\n")}`;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
868
|
// src/context/types.ts
|
|
821
869
|
import { z as z6 } from "zod/v4";
|
|
822
870
|
var CRMContextSchema2 = z6.object({
|
|
@@ -1063,6 +1111,13 @@ var ResponsesBehaviorConfigSchema = z7.object({
|
|
|
1063
1111
|
* @default false
|
|
1064
1112
|
*/
|
|
1065
1113
|
allowSchedule: z7.boolean().optional(),
|
|
1114
|
+
/**
|
|
1115
|
+
* Whether the agent may skip sending when no reply is warranted.
|
|
1116
|
+
* Platform injects silence rules and exposes system:message:skip.
|
|
1117
|
+
* An explicit skip satisfies requireFinal. Off by default.
|
|
1118
|
+
* @default false
|
|
1119
|
+
*/
|
|
1120
|
+
allowSilent: z7.boolean().optional(),
|
|
1066
1121
|
/**
|
|
1067
1122
|
* Message splitting configuration.
|
|
1068
1123
|
* Controls whether and how the agent splits responses into multiple messages.
|
|
@@ -1369,6 +1424,22 @@ var EntityCrmMapDefaultsSchema = z8.object({
|
|
|
1369
1424
|
var EntityRuntimeToolsSchema = z8.object({
|
|
1370
1425
|
calendarWindowPull: z8.string().min(1).optional()
|
|
1371
1426
|
});
|
|
1427
|
+
var EntitySaveInteractionSchema = z8.object({
|
|
1428
|
+
handle: z8.string(),
|
|
1429
|
+
when: z8.object({
|
|
1430
|
+
onCreate: z8.boolean().optional(),
|
|
1431
|
+
onUpdate: z8.boolean().optional(),
|
|
1432
|
+
fieldsChanged: z8.array(z8.string()).optional(),
|
|
1433
|
+
relationshipsChanged: z8.array(z8.string()).optional()
|
|
1434
|
+
}),
|
|
1435
|
+
dialog: z8.object({
|
|
1436
|
+
title: z8.string(),
|
|
1437
|
+
message: z8.string(),
|
|
1438
|
+
severity: z8.enum(["warning", "info"]).optional(),
|
|
1439
|
+
fields: z8.array(z8.string()),
|
|
1440
|
+
defaults: z8.record(z8.string(), z8.string()).optional()
|
|
1441
|
+
})
|
|
1442
|
+
});
|
|
1372
1443
|
var EntityDefinitionSchema = z8.object({
|
|
1373
1444
|
handle: z8.string(),
|
|
1374
1445
|
label: z8.string(),
|
|
@@ -1378,7 +1449,8 @@ var EntityDefinitionSchema = z8.object({
|
|
|
1378
1449
|
contextFields: z8.array(EntityFieldDefinitionSchema).optional(),
|
|
1379
1450
|
relationships: z8.array(EntityRelationshipDefinitionSchema).optional(),
|
|
1380
1451
|
crmMapDefaults: EntityCrmMapDefaultsSchema.optional(),
|
|
1381
|
-
tools: EntityRuntimeToolsSchema.optional()
|
|
1452
|
+
tools: EntityRuntimeToolsSchema.optional(),
|
|
1453
|
+
saveInteractions: z8.array(EntitySaveInteractionSchema).optional()
|
|
1382
1454
|
});
|
|
1383
1455
|
var RelationshipCardinalitySchema = z8.enum([
|
|
1384
1456
|
"ONE_TO_ONE",
|
|
@@ -1995,6 +2067,26 @@ var BatchOperationDefinitionSchema = z8.object({
|
|
|
1995
2067
|
pageSize: z8.number().int().positive().optional(),
|
|
1996
2068
|
icon: z8.string().optional()
|
|
1997
2069
|
});
|
|
2070
|
+
var ProvisionSkillDefinitionSchema = z8.object({
|
|
2071
|
+
/** Unique identifier for the skill */
|
|
2072
|
+
handle: z8.string(),
|
|
2073
|
+
/** Display name */
|
|
2074
|
+
name: z8.string(),
|
|
2075
|
+
/** Short description for skill discovery */
|
|
2076
|
+
description: z8.string().optional(),
|
|
2077
|
+
/** Full instructions injected into agent context when skill is loaded */
|
|
2078
|
+
instructions: z8.string(),
|
|
2079
|
+
/** Entity policies - declares which entity operations this skill needs */
|
|
2080
|
+
entityPolicies: EntityPoliciesSchema.optional(),
|
|
2081
|
+
/** Additional tools (MCP, system) not covered by entity policies */
|
|
2082
|
+
tools: z8.array(SkillToolDefinitionSchema).optional(),
|
|
2083
|
+
/** CRM context - specifies which model fields to include in schema */
|
|
2084
|
+
crmContext: z8.object({
|
|
2085
|
+
models: z8.record(z8.string(), CRMModelFieldRequirementsSchema)
|
|
2086
|
+
}).optional(),
|
|
2087
|
+
/** Few-shot examples for the skill */
|
|
2088
|
+
examples: z8.array(SkillExampleSchema).optional()
|
|
2089
|
+
});
|
|
1998
2090
|
var ProvisionConfigSchema = z8.object({
|
|
1999
2091
|
env: EnvSchemaSchema.optional(),
|
|
2000
2092
|
/** INTERNAL model definitions for data shared across installs */
|
|
@@ -2011,7 +2103,9 @@ var ProvisionConfigSchema = z8.object({
|
|
|
2011
2103
|
/** Install setup checklist steps (opt-in) */
|
|
2012
2104
|
setup: z8.array(SetupStepDefinitionSchema).optional(),
|
|
2013
2105
|
/** Batch operations for imports, syncs, and long-running tasks */
|
|
2014
|
-
batchOperations: z8.array(BatchOperationDefinitionSchema).optional()
|
|
2106
|
+
batchOperations: z8.array(BatchOperationDefinitionSchema).optional(),
|
|
2107
|
+
/** Skills provided by this app */
|
|
2108
|
+
skills: z8.array(ProvisionSkillDefinitionSchema).optional()
|
|
2015
2109
|
});
|
|
2016
2110
|
var SkedyulConfigSchema = z8.object({
|
|
2017
2111
|
name: z8.string(),
|
|
@@ -8963,8 +9057,11 @@ export {
|
|
|
8963
9057
|
EntityCrmMapDefaultsSchema,
|
|
8964
9058
|
EntityDefinitionSchema,
|
|
8965
9059
|
EntityFieldDefinitionSchema,
|
|
9060
|
+
EntityOperationSchema,
|
|
9061
|
+
EntityPoliciesSchema,
|
|
8966
9062
|
EntityRelationshipDefinitionSchema,
|
|
8967
9063
|
EntityRuntimeToolsSchema,
|
|
9064
|
+
EntitySaveInteractionSchema,
|
|
8968
9065
|
EnvSchemaSchema,
|
|
8969
9066
|
EnvVariableDefinitionSchema,
|
|
8970
9067
|
EnvVisibilitySchema,
|
|
@@ -9063,6 +9160,7 @@ export {
|
|
|
9063
9160
|
ParticipantEventPayloadSchema,
|
|
9064
9161
|
ParticipantKindSchema,
|
|
9065
9162
|
ProvisionConfigSchema,
|
|
9163
|
+
ProvisionSkillDefinitionSchema,
|
|
9066
9164
|
QueueContextError,
|
|
9067
9165
|
QueueNotFoundError,
|
|
9068
9166
|
QueuedFetchExhaustedError,
|
|
@@ -9089,6 +9187,7 @@ export {
|
|
|
9089
9187
|
SetupStepDefinitionSchema,
|
|
9090
9188
|
SetupStepKindSchema,
|
|
9091
9189
|
SkedyulConfigSchema,
|
|
9190
|
+
SkillEvaluatorSchema,
|
|
9092
9191
|
SkillExampleSchema,
|
|
9093
9192
|
SkillMetadataSchema,
|
|
9094
9193
|
SkillRefSchema,
|