wiil-core-js 0.0.82
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/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/core/account/index.d.ts +7 -0
- package/dist/core/account/index.js +23 -0
- package/dist/core/account/organization.schema.d.ts +118 -0
- package/dist/core/account/organization.schema.js +91 -0
- package/dist/core/account/project.schema.d.ts +121 -0
- package/dist/core/account/project.schema.js +102 -0
- package/dist/core/account/supported-business-verticals.d.ts +8 -0
- package/dist/core/account/supported-business-verticals.js +23 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.d.ts +115 -0
- package/dist/core/assistant-setups/assistant-setup-result.schema.js +17 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.d.ts +61 -0
- package/dist/core/assistant-setups/base-assistant-setup.schema.js +29 -0
- package/dist/core/assistant-setups/index.d.ts +4 -0
- package/dist/core/assistant-setups/index.js +21 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.d.ts +63 -0
- package/dist/core/assistant-setups/phone-assistant-setup.schema.js +14 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.d.ts +56 -0
- package/dist/core/assistant-setups/web-assitant-setup.schema.js +17 -0
- package/dist/core/base.schema.d.ts +34 -0
- package/dist/core/base.schema.js +36 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.d.ts +63 -0
- package/dist/core/business-mgt/appointment-additional-info.schema.js +53 -0
- package/dist/core/business-mgt/appointment-field-config.schema.d.ts +251 -0
- package/dist/core/business-mgt/appointment-field-config.schema.js +49 -0
- package/dist/core/business-mgt/bookings.shared.schema.d.ts +47 -0
- package/dist/core/business-mgt/bookings.shared.schema.js +60 -0
- package/dist/core/business-mgt/business-location.schema.d.ts +327 -0
- package/dist/core/business-mgt/business-location.schema.js +176 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.d.ts +87 -0
- package/dist/core/business-mgt/customer-management/customer-group.schema.js +53 -0
- package/dist/core/business-mgt/customer-management/customer.schema.d.ts +156 -0
- package/dist/core/business-mgt/customer-management/customer.schema.js +93 -0
- package/dist/core/business-mgt/customer-management/index.d.ts +7 -0
- package/dist/core/business-mgt/customer-management/index.js +23 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.d.ts +112 -0
- package/dist/core/business-mgt/customer-management/shipping-address.schema.js +79 -0
- package/dist/core/business-mgt/customer.schema.d.ts +111 -0
- package/dist/core/business-mgt/customer.schema.js +73 -0
- package/dist/core/business-mgt/discount-rule.schema.d.ts +183 -0
- package/dist/core/business-mgt/discount-rule.schema.js +108 -0
- package/dist/core/business-mgt/index.d.ts +16 -0
- package/dist/core/business-mgt/index.js +38 -0
- package/dist/core/business-mgt/menu-config.schema.d.ts +165 -0
- package/dist/core/business-mgt/menu-config.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/index.d.ts +11 -0
- package/dist/core/business-mgt/menu-management/index.js +27 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.d.ts +386 -0
- package/dist/core/business-mgt/menu-management/menu-catalog.schema.js +58 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.d.ts +301 -0
- package/dist/core/business-mgt/menu-management/menu-config.schema.js +169 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.d.ts +143 -0
- package/dist/core/business-mgt/menu-management/menu-item-variant.schema.js +86 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.d.ts +239 -0
- package/dist/core/business-mgt/menu-management/menu-pricing-rule.schema.js +117 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.d.ts +420 -0
- package/dist/core/business-mgt/menu-management/menu-set.schema.js +283 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.d.ts +654 -0
- package/dist/core/business-mgt/menu-management/menu.order.schema.js +204 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.d.ts +585 -0
- package/dist/core/business-mgt/menu-management/modifier.schema.js +341 -0
- package/dist/core/business-mgt/menu.order.schema.d.ts +335 -0
- package/dist/core/business-mgt/menu.order.schema.js +149 -0
- package/dist/core/business-mgt/order.schema.d.ts +222 -0
- package/dist/core/business-mgt/order.schema.js +205 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.d.ts +56 -0
- package/dist/core/business-mgt/pricing-rule.shared.schema.js +68 -0
- package/dist/core/business-mgt/product-config.schema.d.ts +177 -0
- package/dist/core/business-mgt/product-config.schema.js +106 -0
- package/dist/core/business-mgt/product-management/index.d.ts +12 -0
- package/dist/core/business-mgt/product-management/index.js +28 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.d.ts +54 -0
- package/dist/core/business-mgt/product-management/product-axis-binding.schema.js +54 -0
- package/dist/core/business-mgt/product-management/product-config.schema.d.ts +1042 -0
- package/dist/core/business-mgt/product-management/product-config.schema.js +392 -0
- package/dist/core/business-mgt/product-management/product-display.schema.d.ts +548 -0
- package/dist/core/business-mgt/product-management/product-display.schema.js +80 -0
- package/dist/core/business-mgt/product-management/product-order.schema.d.ts +493 -0
- package/dist/core/business-mgt/product-management/product-order.schema.js +158 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.d.ts +167 -0
- package/dist/core/business-mgt/product-management/product-pricing-rule.schema.js +68 -0
- package/dist/core/business-mgt/product-management/product-set.schema.d.ts +488 -0
- package/dist/core/business-mgt/product-management/product-set.schema.js +273 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.d.ts +156 -0
- package/dist/core/business-mgt/product-management/product-variant-axis.schema.js +98 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.d.ts +219 -0
- package/dist/core/business-mgt/product-management/product-variant.schema.js +130 -0
- package/dist/core/business-mgt/product-order.schema.d.ts +326 -0
- package/dist/core/business-mgt/product-order.schema.js +153 -0
- package/dist/core/business-mgt/property-config.schema.d.ts +621 -0
- package/dist/core/business-mgt/property-config.schema.js +224 -0
- package/dist/core/business-mgt/property-inquiry.schema.d.ts +222 -0
- package/dist/core/business-mgt/property-inquiry.schema.js +112 -0
- package/dist/core/business-mgt/property-management/index.d.ts +6 -0
- package/dist/core/business-mgt/property-management/index.js +22 -0
- package/dist/core/business-mgt/property-management/property-config.schema.d.ts +1306 -0
- package/dist/core/business-mgt/property-management/property-config.schema.js +367 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.d.ts +254 -0
- package/dist/core/business-mgt/property-management/property-inquiry.schema.js +131 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.d.ts +3 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/index.js +19 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.d.ts +139 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-rental-assignment.schema.js +90 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-room-assignment.schema.js +70 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.d.ts +104 -0
- package/dist/core/business-mgt/reservation-mgt/assignment/reservation-table-assignment.schema.js +72 -0
- package/dist/core/business-mgt/reservation-mgt/index.d.ts +14 -0
- package/dist/core/business-mgt/reservation-mgt/index.js +31 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.d.ts +180 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-floor-plan-definition.schema.js +75 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.d.ts +91 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-maintenance-block.schema.js +57 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.d.ts +334 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-rental.schema.js +179 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.d.ts +195 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-room.schema.js +106 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.d.ts +402 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-section.schema.js +198 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.d.ts +229 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-settings.schema.js +127 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.d.ts +382 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-slot-query.schema.js +322 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.d.ts +123 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table-layout.schema.js +83 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.d.ts +167 -0
- package/dist/core/business-mgt/reservation-mgt/reservation-table.schema.js +84 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.d.ts +0 -0
- package/dist/core/business-mgt/reservation-mgt/reservation.schema.js +153 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.d.ts +4 -0
- package/dist/core/business-mgt/reservation-mgt/resource/index.js +20 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.d.ts +157 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-category.schema.js +76 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.d.ts +137 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource-instance.schema.js +94 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.d.ts +713 -0
- package/dist/core/business-mgt/reservation-mgt/resource/reservation-resource.schema.js +363 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.d.ts +151 -0
- package/dist/core/business-mgt/reservation-mgt/resource/resource-versioning.schema.js +147 -0
- package/dist/core/business-mgt/reservation-resource.schema.d.ts +154 -0
- package/dist/core/business-mgt/reservation-resource.schema.js +100 -0
- package/dist/core/business-mgt/reservation.schema.d.ts +119 -0
- package/dist/core/business-mgt/reservation.schema.js +89 -0
- package/dist/core/business-mgt/service-appointment.schema.d.ts +105 -0
- package/dist/core/business-mgt/service-appointment.schema.js +69 -0
- package/dist/core/business-mgt/service-config.schema.d.ts +453 -0
- package/dist/core/business-mgt/service-config.schema.js +102 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.d.ts +110 -0
- package/dist/core/business-mgt/service-management/appointment-additional-info.schema.js +78 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.d.ts +304 -0
- package/dist/core/business-mgt/service-management/appointment-field-config.schema.js +75 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.d.ts +1226 -0
- package/dist/core/business-mgt/service-management/business-service-config.schema.js +317 -0
- package/dist/core/business-mgt/service-management/index.d.ts +13 -0
- package/dist/core/business-mgt/service-management/index.js +29 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.d.ts +531 -0
- package/dist/core/business-mgt/service-management/service-appointment.schema.js +116 -0
- package/dist/core/business-mgt/service-management/service-person.schema.d.ts +122 -0
- package/dist/core/business-mgt/service-management/service-person.schema.js +66 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.d.ts +221 -0
- package/dist/core/business-mgt/service-management/service-pricing-rule.schema.js +118 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-provider.schema.js +54 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.d.ts +90 -0
- package/dist/core/business-mgt/service-management/service-slot-query.schema.js +113 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.d.ts +121 -0
- package/dist/core/business-mgt/service-management/service-time-off.schema.js +95 -0
- package/dist/core/business-mgt/service-person.schema.d.ts +43 -0
- package/dist/core/business-mgt/service-person.schema.js +38 -0
- package/dist/core/business-mgt/tax-rule.schema.d.ts +161 -0
- package/dist/core/business-mgt/tax-rule.schema.js +90 -0
- package/dist/core/conversation/conversation-config.schema.d.ts +644 -0
- package/dist/core/conversation/conversation-config.schema.js +351 -0
- package/dist/core/conversation/conversation-message.schema.d.ts +307 -0
- package/dist/core/conversation/conversation-message.schema.js +275 -0
- package/dist/core/conversation/index.d.ts +12 -0
- package/dist/core/conversation/index.js +28 -0
- package/dist/core/conversation/outbound-call.schema.d.ts +209 -0
- package/dist/core/conversation/outbound-call.schema.js +116 -0
- package/dist/core/conversation/outbound-email.schema.d.ts +338 -0
- package/dist/core/conversation/outbound-email.schema.js +150 -0
- package/dist/core/conversation/outbound-sms.schema.d.ts +163 -0
- package/dist/core/conversation/outbound-sms.schema.js +85 -0
- package/dist/core/conversation/outbound-template.schema.d.ts +375 -0
- package/dist/core/conversation/outbound-template.schema.js +160 -0
- package/dist/core/conversation/translation-config.schema.d.ts +92 -0
- package/dist/core/conversation/translation-config.schema.js +88 -0
- package/dist/core/conversation/translation-conversation.schema.d.ts +469 -0
- package/dist/core/conversation/translation-conversation.schema.js +175 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +30 -0
- package/dist/core/service-configuration/agent-config.schema.d.ts +236 -0
- package/dist/core/service-configuration/agent-config.schema.js +152 -0
- package/dist/core/service-configuration/base-agent-setup.d.ts +147 -0
- package/dist/core/service-configuration/base-agent-setup.js +123 -0
- package/dist/core/service-configuration/call-transfer-config.schema.d.ts +60 -0
- package/dist/core/service-configuration/call-transfer-config.schema.js +53 -0
- package/dist/core/service-configuration/deployment-config.schema.d.ts +522 -0
- package/dist/core/service-configuration/deployment-config.schema.js +271 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.d.ts +130 -0
- package/dist/core/service-configuration/dynamic_setup/base-agent-setup.js +110 -0
- package/dist/core/service-configuration/dynamic_setup/index.d.ts +10 -0
- package/dist/core/service-configuration/dynamic_setup/index.js +26 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.d.ts +111 -0
- package/dist/core/service-configuration/dynamic_setup/phone-agent-setup.js +56 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.d.ts +113 -0
- package/dist/core/service-configuration/dynamic_setup/web-agent-setup.js +55 -0
- package/dist/core/service-configuration/index.d.ts +17 -0
- package/dist/core/service-configuration/index.js +33 -0
- package/dist/core/service-configuration/instruction-config.schema.d.ts +183 -0
- package/dist/core/service-configuration/instruction-config.schema.js +139 -0
- package/dist/core/service-configuration/interaction-channels.schema.d.ts +469 -0
- package/dist/core/service-configuration/interaction-channels.schema.js +390 -0
- package/dist/core/service-configuration/knowledge.schema.d.ts +107 -0
- package/dist/core/service-configuration/knowledge.schema.js +106 -0
- package/dist/core/service-configuration/phone-config.schema.d.ts +206 -0
- package/dist/core/service-configuration/phone-config.schema.js +121 -0
- package/dist/core/service-configuration/phone-number.schema.d.ts +236 -0
- package/dist/core/service-configuration/phone-number.schema.js +211 -0
- package/dist/core/service-configuration/provisioning-config.d.ts +429 -0
- package/dist/core/service-configuration/provisioning-config.js +307 -0
- package/dist/core/service-configuration/support-llm.d.ts +95 -0
- package/dist/core/service-configuration/support-llm.js +76 -0
- package/dist/core/service-configuration/voice-language.schema.d.ts +200 -0
- package/dist/core/service-configuration/voice-language.schema.js +166 -0
- package/dist/core/type-definitions/account-definitions.d.ts +82 -0
- package/dist/core/type-definitions/account-definitions.js +88 -0
- package/dist/core/type-definitions/business-definitions.d.ts +394 -0
- package/dist/core/type-definitions/business-definitions.js +447 -0
- package/dist/core/type-definitions/conversation.type.definition.d.ts +223 -0
- package/dist/core/type-definitions/conversation.type.definition.js +236 -0
- package/dist/core/type-definitions/display-order.d.ts +154 -0
- package/dist/core/type-definitions/display-order.js +154 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.d.ts +165 -0
- package/dist/core/type-definitions/dynamic-fields/field-definition.schema.js +97 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.d.ts +49 -0
- package/dist/core/type-definitions/dynamic-fields/field-types.js +104 -0
- package/dist/core/type-definitions/dynamic-fields/index.d.ts +9 -0
- package/dist/core/type-definitions/dynamic-fields/index.js +25 -0
- package/dist/core/type-definitions/index.d.ts +10 -0
- package/dist/core/type-definitions/index.js +26 -0
- package/dist/core/type-definitions/knowledge-definitions.d.ts +30 -0
- package/dist/core/type-definitions/knowledge-definitions.js +37 -0
- package/dist/core/type-definitions/service-config.definitions.d.ts +112 -0
- package/dist/core/type-definitions/service-config.definitions.js +135 -0
- package/dist/core/validators/channel-validation.d.ts +19 -0
- package/dist/core/validators/channel-validation.js +40 -0
- package/dist/core/validators/index.d.ts +5 -0
- package/dist/core/validators/index.js +21 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +24 -0
- package/dist/request/index.d.ts +5 -0
- package/dist/request/index.js +21 -0
- package/dist/request/models/index.d.ts +6 -0
- package/dist/request/models/index.js +22 -0
- package/dist/request/models/paginated-quest.schema.d.ts +33 -0
- package/dist/request/models/paginated-quest.schema.js +35 -0
- package/dist/request/models/paginated-result.schema.d.ts +124 -0
- package/dist/request/models/paginated-result.schema.js +94 -0
- package/package.json +43 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UpdateDynamicPhoneAgentSchema = exports.DynamicPhoneAgentSetupResultSchema = exports.DynamicPhoneAgentSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_agent_setup_1 = require("../base-agent-setup");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Phone agent setup schemas for AI assistant configuration.
|
|
11
|
+
* @module service-configuration/dynamic_setup/phone-agent-setup
|
|
12
|
+
*
|
|
13
|
+
* Provides schemas for configuring AI assistants deployed on phone/telephony channels.
|
|
14
|
+
* Extends the base agent setup with phone-specific settings like phone configuration,
|
|
15
|
+
* test numbers, and required voice interaction configurations (STT/TTS).
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Phone agent setup schema.
|
|
19
|
+
*
|
|
20
|
+
* @typedef {Object} DynamicPhoneAgentSetup
|
|
21
|
+
* @property {string} [phoneConfigurationId] - ID of the phone configuration
|
|
22
|
+
* @property {string} [testPhoneNumber] - Phone number for testing
|
|
23
|
+
* @property {Object} [sttConfiguration] - Speech-to-text configuration (required for voice)
|
|
24
|
+
* @property {Object} [ttsConfiguration] - Text-to-speech configuration (required for voice)
|
|
25
|
+
*/
|
|
26
|
+
exports.DynamicPhoneAgentSchema = base_agent_setup_1.DynamicBaseAgentSetupSchema.safeExtend({
|
|
27
|
+
phoneConfigurationId: zod_1.default.string().nullable().optional().describe("ID of the phone configuration to use for this assistant, defining telephony settings and integrations"),
|
|
28
|
+
testPhoneNumber: zod_1.default.string().nullable().optional().describe("Optional phone number to use for testing the phone assistant setup, if applicable"),
|
|
29
|
+
sttConfiguration: base_agent_setup_1.DynamicSTTModelConfigurationSchema.nullable().optional().describe("Speech-to-text model configuration for the phone assistant, if using voice interactions"),
|
|
30
|
+
ttsConfiguration: base_agent_setup_1.DynamicTTSModelConfigurationSchema.nullable().optional().describe("Text-to-speech model configuration for the phone assistant, if using voice interactions"),
|
|
31
|
+
}).refine((data) => {
|
|
32
|
+
const hasSTT = data.sttConfiguration !== null && data.sttConfiguration !== undefined;
|
|
33
|
+
const hasTTS = data.ttsConfiguration !== null && data.ttsConfiguration !== undefined;
|
|
34
|
+
return hasSTT === hasTTS;
|
|
35
|
+
}, { message: "Both sttConfiguration and ttsConfiguration must be provided together, or neither" }).describe("Schema for setting up a phone AI assistant with optional chain configuration capabilities");
|
|
36
|
+
/**
|
|
37
|
+
* Phone agent setup result schema.
|
|
38
|
+
*
|
|
39
|
+
* @typedef {Object} DynamicPhoneAgentSetupResult
|
|
40
|
+
* @property {boolean} success - Whether the setup was successful
|
|
41
|
+
* @property {string} agentConfigurationId - ID of the created agent configuration
|
|
42
|
+
* @property {string} instructionConfigurationId - ID of the created instruction configuration
|
|
43
|
+
* @property {string} phoneNumber - Phone number associated with the configuration
|
|
44
|
+
*/
|
|
45
|
+
exports.DynamicPhoneAgentSetupResultSchema = base_agent_setup_1.DynamicAgentSetupResultSchema.safeExtend({
|
|
46
|
+
phoneNumber: zod_1.default.string().nullable().optional().describe("Phone number associated with the phone configuration used for this assistant"),
|
|
47
|
+
}).describe("Schema for the result of creating or setting up a new phone AI assistant with dynamic setup");
|
|
48
|
+
/**
|
|
49
|
+
* Schema for updating an existing phone agent configuration.
|
|
50
|
+
* All fields are optional except id.
|
|
51
|
+
*/
|
|
52
|
+
exports.UpdateDynamicPhoneAgentSchema = exports.DynamicPhoneAgentSchema.partial().extend({
|
|
53
|
+
id: zod_1.default.string().describe("ID of the existing phone agent configuration to update"),
|
|
54
|
+
}).omit({
|
|
55
|
+
phoneConfigurationId: true, // Phone configuration cannot be changed after creation
|
|
56
|
+
}).describe("Schema for updating a phone AI assistant configuration, allowing partial updates to phone-specific fields");
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { OttCommunicationType } from "../../type-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Web agent setup schemas for AI assistant configuration.
|
|
5
|
+
* @module service-configuration/dynamic_setup/web-agent-setup
|
|
6
|
+
*
|
|
7
|
+
* Provides schemas for configuring AI assistants deployed on web channels.
|
|
8
|
+
* Extends the base agent setup with web-specific settings like website URL,
|
|
9
|
+
* communication type, and optional voice interaction configurations.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Web agent setup schema.
|
|
13
|
+
*
|
|
14
|
+
* @typedef {Object} DynamicWebAgentSetup
|
|
15
|
+
* @property {string} websiteUrl - URL of the website for this assistant
|
|
16
|
+
* @property {OttCommunicationType} [communicationType] - Communication method (text, voice, unified)
|
|
17
|
+
* @property {Object} [sttConfiguration] - Speech-to-text configuration for voice
|
|
18
|
+
* @property {Object} [ttsConfiguration] - Text-to-speech configuration for voice
|
|
19
|
+
*/
|
|
20
|
+
export declare const DynamicWebAgentSchema: z.ZodObject<{
|
|
21
|
+
assistantName: z.ZodString;
|
|
22
|
+
instructionConfigurationId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
role_template_identifier: z.ZodOptional<z.ZodEnum<typeof import("../../type-definitions").AgentRoleTemplateIdentifier>>;
|
|
24
|
+
capabilities: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../../type-definitions").BusinessSupportServices>>>>;
|
|
25
|
+
knowledgeSourceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
textKnowledgeSource: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
content: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
language: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
32
|
+
providerType: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof import("../../type-definitions").SupportedProprietor>>>;
|
|
33
|
+
providerModelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
websiteUrl: z.ZodString;
|
|
35
|
+
communicationType: z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof OttCommunicationType>>>;
|
|
36
|
+
sttConfiguration: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
37
|
+
providerType: z.ZodEnum<typeof import("../../type-definitions").SupportedProprietor>;
|
|
38
|
+
providerModelId: z.ZodString;
|
|
39
|
+
languageId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
40
|
+
}, z.core.$strip>>>;
|
|
41
|
+
ttsConfiguration: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
42
|
+
providerType: z.ZodEnum<typeof import("../../type-definitions").SupportedProprietor>;
|
|
43
|
+
providerModelId: z.ZodString;
|
|
44
|
+
languageId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
45
|
+
voiceId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
/**
|
|
49
|
+
* Web agent setup result schema.
|
|
50
|
+
*
|
|
51
|
+
* @typedef {Object} DynamicWebAgentSetupResult
|
|
52
|
+
* @property {boolean} success - Whether the setup was successful
|
|
53
|
+
* @property {string} agentConfigurationId - ID of the created agent configuration
|
|
54
|
+
* @property {string} instructionConfigurationId - ID of the created instruction configuration
|
|
55
|
+
* @property {string[]} integrationSnippets - Code snippets for deploying the web assistant
|
|
56
|
+
*/
|
|
57
|
+
export declare const DynamicWebAgentSetupResultSchema: z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
processingState: z.ZodObject<{
|
|
62
|
+
status: z.ZodEnum<{
|
|
63
|
+
pending: "pending";
|
|
64
|
+
completed: "completed";
|
|
65
|
+
failed: "failed";
|
|
66
|
+
in_progress: "in_progress";
|
|
67
|
+
}>;
|
|
68
|
+
progressPercentage: z.ZodNumber;
|
|
69
|
+
message: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
success: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
72
|
+
agentConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
instructionConfigurationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
75
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
76
|
+
integrationSnippets: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
/**
|
|
79
|
+
* Schema for updating an existing web agent configuration.
|
|
80
|
+
* All fields are optional except id.
|
|
81
|
+
*/
|
|
82
|
+
export declare const UpdateDynamicWebAgentSchema: z.ZodObject<{
|
|
83
|
+
assistantName: z.ZodOptional<z.ZodString>;
|
|
84
|
+
instructionConfigurationId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
85
|
+
role_template_identifier: z.ZodOptional<z.ZodOptional<z.ZodEnum<typeof import("../../type-definitions").AgentRoleTemplateIdentifier>>>;
|
|
86
|
+
capabilities: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../../type-definitions").BusinessSupportServices>>>>>;
|
|
87
|
+
knowledgeSourceIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
88
|
+
textKnowledgeSource: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
89
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
content: z.ZodString;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
language: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
93
|
+
voice: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
94
|
+
providerType: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof import("../../type-definitions").SupportedProprietor>>>>;
|
|
95
|
+
providerModelId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
96
|
+
websiteUrl: z.ZodOptional<z.ZodString>;
|
|
97
|
+
communicationType: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof OttCommunicationType>>>>;
|
|
98
|
+
sttConfiguration: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
99
|
+
providerType: z.ZodEnum<typeof import("../../type-definitions").SupportedProprietor>;
|
|
100
|
+
providerModelId: z.ZodString;
|
|
101
|
+
languageId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
102
|
+
}, z.core.$strip>>>>;
|
|
103
|
+
ttsConfiguration: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
104
|
+
providerType: z.ZodEnum<typeof import("../../type-definitions").SupportedProprietor>;
|
|
105
|
+
providerModelId: z.ZodString;
|
|
106
|
+
languageId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
107
|
+
voiceId: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>>>>;
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type DynamicWebAgentSetup = z.infer<typeof DynamicWebAgentSchema>;
|
|
112
|
+
export type UpdateDynamicWebAgent = z.infer<typeof UpdateDynamicWebAgentSchema>;
|
|
113
|
+
export type DynamicWebAgentSetupResult = z.infer<typeof DynamicWebAgentSetupResultSchema>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UpdateDynamicWebAgentSchema = exports.DynamicWebAgentSetupResultSchema = exports.DynamicWebAgentSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const base_agent_setup_1 = require("../base-agent-setup");
|
|
9
|
+
const type_definitions_1 = require("../../type-definitions");
|
|
10
|
+
/**
|
|
11
|
+
* @fileoverview Web agent setup schemas for AI assistant configuration.
|
|
12
|
+
* @module service-configuration/dynamic_setup/web-agent-setup
|
|
13
|
+
*
|
|
14
|
+
* Provides schemas for configuring AI assistants deployed on web channels.
|
|
15
|
+
* Extends the base agent setup with web-specific settings like website URL,
|
|
16
|
+
* communication type, and optional voice interaction configurations.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Web agent setup schema.
|
|
20
|
+
*
|
|
21
|
+
* @typedef {Object} DynamicWebAgentSetup
|
|
22
|
+
* @property {string} websiteUrl - URL of the website for this assistant
|
|
23
|
+
* @property {OttCommunicationType} [communicationType] - Communication method (text, voice, unified)
|
|
24
|
+
* @property {Object} [sttConfiguration] - Speech-to-text configuration for voice
|
|
25
|
+
* @property {Object} [ttsConfiguration] - Text-to-speech configuration for voice
|
|
26
|
+
*/
|
|
27
|
+
exports.DynamicWebAgentSchema = base_agent_setup_1.DynamicBaseAgentSetupSchema.safeExtend({
|
|
28
|
+
websiteUrl: zod_1.default.string().describe("URL of the website to use for this assistant, defining web-specific settings and integrations"),
|
|
29
|
+
communicationType: zod_1.default.enum(type_definitions_1.OttCommunicationType).optional().default(type_definitions_1.OttCommunicationType.UNIFIED).describe("Type of over-the-top communication method for the web channel. options: text, voice, unified"),
|
|
30
|
+
sttConfiguration: base_agent_setup_1.DynamicSTTModelConfigurationSchema.nullable().optional().describe("Speech-to-text model configuration for the web assistant, if using voice interactions"),
|
|
31
|
+
ttsConfiguration: base_agent_setup_1.DynamicTTSModelConfigurationSchema.nullable().optional().describe("Text-to-speech model configuration for the web assistant, if using voice interactions"),
|
|
32
|
+
}).refine((data) => {
|
|
33
|
+
const hasSTT = data.sttConfiguration !== null && data.sttConfiguration !== undefined;
|
|
34
|
+
const hasTTS = data.ttsConfiguration !== null && data.ttsConfiguration !== undefined;
|
|
35
|
+
return hasSTT === hasTTS;
|
|
36
|
+
}, { message: "Both sttConfiguration and ttsConfiguration must be provided together, or neither" }).describe("Schema for setting up a web AI assistant with optional chain configuration capabilities");
|
|
37
|
+
/**
|
|
38
|
+
* Web agent setup result schema.
|
|
39
|
+
*
|
|
40
|
+
* @typedef {Object} DynamicWebAgentSetupResult
|
|
41
|
+
* @property {boolean} success - Whether the setup was successful
|
|
42
|
+
* @property {string} agentConfigurationId - ID of the created agent configuration
|
|
43
|
+
* @property {string} instructionConfigurationId - ID of the created instruction configuration
|
|
44
|
+
* @property {string[]} integrationSnippets - Code snippets for deploying the web assistant
|
|
45
|
+
*/
|
|
46
|
+
exports.DynamicWebAgentSetupResultSchema = base_agent_setup_1.DynamicAgentSetupResultSchema.safeExtend({
|
|
47
|
+
integrationSnippets: zod_1.default.array(zod_1.default.string()).nullable().optional().describe("List of code snippets or integration details for deploying the web assistant on the specified website, if applicable"),
|
|
48
|
+
}).describe("Schema for the result of creating or setting up a new web AI assistant with dynamic setup");
|
|
49
|
+
/**
|
|
50
|
+
* Schema for updating an existing web agent configuration.
|
|
51
|
+
* All fields are optional except id.
|
|
52
|
+
*/
|
|
53
|
+
exports.UpdateDynamicWebAgentSchema = exports.DynamicWebAgentSchema.partial().extend({
|
|
54
|
+
id: zod_1.default.string().describe("ID of the existing web agent configuration to update"),
|
|
55
|
+
}).describe("Schema for updating a web AI assistant configuration, allowing partial updates to web-specific fields");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Central export point for all service configuration schemas.
|
|
3
|
+
* @module service-configuration
|
|
4
|
+
*/
|
|
5
|
+
export * from './agent-config.schema';
|
|
6
|
+
export * from './base-agent-setup';
|
|
7
|
+
export * from './call-transfer-config.schema';
|
|
8
|
+
export * from './deployment-config.schema';
|
|
9
|
+
export * from './instruction-config.schema';
|
|
10
|
+
export * from './interaction-channels.schema';
|
|
11
|
+
export * from './knowledge.schema';
|
|
12
|
+
export * from './phone-config.schema';
|
|
13
|
+
export * from './phone-number.schema';
|
|
14
|
+
export * from './provisioning-config';
|
|
15
|
+
export * from './support-llm';
|
|
16
|
+
export * from './voice-language.schema';
|
|
17
|
+
export * from './dynamic_setup';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Central export point for all service configuration schemas.
|
|
4
|
+
* @module service-configuration
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
__exportStar(require("./agent-config.schema"), exports);
|
|
22
|
+
__exportStar(require("./base-agent-setup"), exports);
|
|
23
|
+
__exportStar(require("./call-transfer-config.schema"), exports);
|
|
24
|
+
__exportStar(require("./deployment-config.schema"), exports);
|
|
25
|
+
__exportStar(require("./instruction-config.schema"), exports);
|
|
26
|
+
__exportStar(require("./interaction-channels.schema"), exports);
|
|
27
|
+
__exportStar(require("./knowledge.schema"), exports);
|
|
28
|
+
__exportStar(require("./phone-config.schema"), exports);
|
|
29
|
+
__exportStar(require("./phone-number.schema"), exports);
|
|
30
|
+
__exportStar(require("./provisioning-config"), exports);
|
|
31
|
+
__exportStar(require("./support-llm"), exports);
|
|
32
|
+
__exportStar(require("./voice-language.schema"), exports);
|
|
33
|
+
__exportStar(require("./dynamic_setup"), exports);
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BusinessSupportServices } from "../type-definitions/account-definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Instruction configuration schema definitions.
|
|
5
|
+
*
|
|
6
|
+
* The Instruction Configuration is the heart of agent behaviour in the Service Configuration architecture.
|
|
7
|
+
* It contains the prompts, guidelines, and contextual instructions that fundamentally define how agents
|
|
8
|
+
* operate during conversations.
|
|
9
|
+
*
|
|
10
|
+
* @module service-configuration/instruction-config
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Zod schema for Instruction Configuration validation.
|
|
14
|
+
*
|
|
15
|
+
* The Instruction Configuration is the heart of agent behaviour in the Service Configuration architecture.
|
|
16
|
+
* It contains the prompts, guidelines, and contextual instructions that fundamentally define how an agent
|
|
17
|
+
* operates during conversations. A single Instruction Configuration can be associated with multiple Agent
|
|
18
|
+
* Configurations (1:N relationship), allowing consistent behavioral guidelines across different agent types.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* **Architecture Context:**
|
|
22
|
+
* - **Central Role**: The Instruction Configuration is the core element that shapes agent behavior
|
|
23
|
+
* - **Relationship**: 1:N with Agent Configurations - one instruction set can govern multiple agents
|
|
24
|
+
* - **Reusability**: Designed to be reused across multiple deployments
|
|
25
|
+
* - **Managed By**: Service Configuration (lifecycle management)
|
|
26
|
+
* - **Used By**: Deployment Configurations reference instruction sets for agent behavior
|
|
27
|
+
*
|
|
28
|
+
* **Example Use Case:**
|
|
29
|
+
* A "Customer Service Guidelines" instruction set might govern both a "Sales Agent" and a "Support Agent",
|
|
30
|
+
* ensuring uniform tone and compliance while each agent maintains its specialized capabilities.
|
|
31
|
+
*
|
|
32
|
+
* @typedef {Object} InstructionConfigurationProperties
|
|
33
|
+
* @property {string} id - Unique identifier for the instruction configuration
|
|
34
|
+
* @property {string} instructionName - System-readable name, typically auto-generated based on role (e.g., 'customer-support-agent')
|
|
35
|
+
* @property {string} role - The role or persona the agent should adopt (e.g., 'Customer Support Specialist', 'Sales Representative')
|
|
36
|
+
* @property {string} introductionMessage - Initial greeting message presented to users when starting a conversation
|
|
37
|
+
* @property {string} instructions - Detailed instructions that guide agent behavior, responses, conversation flow, and decision-making processes
|
|
38
|
+
* @property {string} guardrails - Safety and behavioral constraints the agent must follow, including compliance rules, forbidden topics, and ethical guidelines
|
|
39
|
+
* @property {string[]} [requiredSkills] - Specific skills or capabilities required for this instruction set (e.g., 'appointment_booking', 'order_management')
|
|
40
|
+
* @property {Record<string, any>} [validationRules] - Custom validation rules for input/output processing to ensure response quality and format compliance
|
|
41
|
+
* @property {string} [serviceId] - ID of the service this instruction configuration is associated with for organizational purposes
|
|
42
|
+
* @property {BusinessSupportServices[]} [supportedServices=[]] - Platform business services (tools) enabled for this agent, such as appointment management or order processing
|
|
43
|
+
* @property {string[]} [tools] - Tool identifiers the agent can use with this instruction set for extended capabilities
|
|
44
|
+
* @property {boolean} [isTemplate=false] - Whether this is a reusable template for creating other instruction configurations
|
|
45
|
+
* @property {boolean} isPrimary - Whether this is the primary system instruction configuration template used as a baseline
|
|
46
|
+
* @property {Record<string, any>} [metadata] - Additional metadata for the instruction configuration, such as version info or custom attributes
|
|
47
|
+
* @property {string[]} [knowledgeSourceIds=[]] - Array of IDs referencing knowledge sources that provide context and information for this instruction set
|
|
48
|
+
* @property {number} [createdAt] - Unix timestamp (milliseconds) when the configuration was created
|
|
49
|
+
* @property {number} [updatedAt] - Unix timestamp (milliseconds) when the configuration was last updated
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const instructionConfig: InstructionConfiguration = {
|
|
54
|
+
* id: '123*',
|
|
55
|
+
* instructionName: 'customer-support-agent',
|
|
56
|
+
* role: 'Customer Support Specialist',
|
|
57
|
+
* introductionMessage: 'Hello! How can I help you today?',
|
|
58
|
+
* instructions: 'You are a helpful customer support agent...',
|
|
59
|
+
* guardrails: 'Never share sensitive customer data...',
|
|
60
|
+
* supportedServices: [BusinessSupportServices.APPOINTMENT_MANAGEMENT],
|
|
61
|
+
* knowledgeSourceIds: ['789*'],
|
|
62
|
+
* isTemplate: false,
|
|
63
|
+
* isPrimary: false,
|
|
64
|
+
* createdAt: Date.now(),
|
|
65
|
+
* updatedAt: Date.now()
|
|
66
|
+
* };
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare const InstructionConfigurationSchema: z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
instructionName: z.ZodString;
|
|
74
|
+
role: z.ZodString;
|
|
75
|
+
introductionMessage: z.ZodString;
|
|
76
|
+
instructions: z.ZodString;
|
|
77
|
+
guardrails: z.ZodString;
|
|
78
|
+
requiredSkills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
|
+
validationRules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
80
|
+
serviceId: z.ZodOptional<z.ZodString>;
|
|
81
|
+
supportedServices: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<typeof BusinessSupportServices>>>>;
|
|
82
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
isTemplate: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
84
|
+
isPrimary: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
86
|
+
knowledgeSourceIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
/**
|
|
89
|
+
* Type definition for Instruction Configuration.
|
|
90
|
+
*
|
|
91
|
+
* Represents a complete instruction configuration including all metadata,
|
|
92
|
+
* behavioral guidelines, and knowledge sources.
|
|
93
|
+
*/
|
|
94
|
+
export type InstructionConfiguration = z.infer<typeof InstructionConfigurationSchema>;
|
|
95
|
+
/**
|
|
96
|
+
* Zod schema for creating a new instruction configuration.
|
|
97
|
+
*
|
|
98
|
+
* Omits auto-generated fields (id, timestamps) that are populated by the system.
|
|
99
|
+
*
|
|
100
|
+
* @remarks
|
|
101
|
+
* This schema enforces required fields for instruction creation while excluding
|
|
102
|
+
* fields that are automatically generated by the system.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* const newInstruction: CreateInstructionConfiguration = {
|
|
107
|
+
* instructionName: 'sales-agent',
|
|
108
|
+
* role: 'Sales Representative',
|
|
109
|
+
* introductionMessage: 'Hi! I can help you find the perfect solution.',
|
|
110
|
+
* instructions: 'You are a knowledgeable sales agent...',
|
|
111
|
+
* guardrails: 'Always be honest about product capabilities...',
|
|
112
|
+
* supportedServices: [BusinessSupportServices.PRODUCT_ORDER_MANAGEMENT],
|
|
113
|
+
* knowledgeSourceIds: ['123*'],
|
|
114
|
+
* isTemplate: false,
|
|
115
|
+
* isPrimary: false
|
|
116
|
+
* };
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare const CreateInstructionConfigurationSchema: z.ZodObject<{
|
|
120
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
121
|
+
knowledgeSourceIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
122
|
+
instructionName: z.ZodString;
|
|
123
|
+
role: z.ZodString;
|
|
124
|
+
introductionMessage: z.ZodString;
|
|
125
|
+
instructions: z.ZodString;
|
|
126
|
+
guardrails: z.ZodString;
|
|
127
|
+
requiredSkills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
|
+
validationRules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
129
|
+
serviceId: z.ZodOptional<z.ZodString>;
|
|
130
|
+
supportedServices: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<typeof BusinessSupportServices>>>>;
|
|
131
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
132
|
+
isTemplate: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
133
|
+
isPrimary: z.ZodDefault<z.ZodBoolean>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
/**
|
|
136
|
+
* Type definition for creating a new instruction configuration.
|
|
137
|
+
*
|
|
138
|
+
* Represents the payload required to create a new instruction configuration,
|
|
139
|
+
* excluding system-generated fields.
|
|
140
|
+
*/
|
|
141
|
+
export type CreateInstructionConfiguration = z.infer<typeof CreateInstructionConfigurationSchema>;
|
|
142
|
+
/**
|
|
143
|
+
* Zod schema for updating an existing instruction configuration.
|
|
144
|
+
*
|
|
145
|
+
* All fields from CreateInstructionConfigurationSchema are optional (partial),
|
|
146
|
+
* with the id field required to identify the configuration to update.
|
|
147
|
+
*
|
|
148
|
+
* @remarks
|
|
149
|
+
* Supports partial updates - only include the fields you want to modify.
|
|
150
|
+
* The id field is mandatory to specify which instruction configuration to update.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* const updateInstruction: UpdateInstructionConfiguration = {
|
|
155
|
+
* id: '123*',
|
|
156
|
+
* introductionMessage: 'Hello! How may I assist you today?',
|
|
157
|
+
* guardrails: 'Updated safety guidelines...'
|
|
158
|
+
* };
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare const UpdateInstructionConfigurationSchema: z.ZodObject<{
|
|
162
|
+
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
163
|
+
knowledgeSourceIds: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>>;
|
|
164
|
+
instructionName: z.ZodOptional<z.ZodString>;
|
|
165
|
+
role: z.ZodOptional<z.ZodString>;
|
|
166
|
+
introductionMessage: z.ZodOptional<z.ZodString>;
|
|
167
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
168
|
+
guardrails: z.ZodOptional<z.ZodString>;
|
|
169
|
+
requiredSkills: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
170
|
+
validationRules: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
171
|
+
serviceId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
172
|
+
supportedServices: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<typeof BusinessSupportServices>>>>>;
|
|
173
|
+
tools: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
174
|
+
isTemplate: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
175
|
+
isPrimary: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
176
|
+
id: z.ZodString;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
/**
|
|
179
|
+
* Type definition for updating an existing instruction configuration.
|
|
180
|
+
*
|
|
181
|
+
* Represents a partial update payload with required id field.
|
|
182
|
+
*/
|
|
183
|
+
export type UpdateInstructionConfiguration = z.infer<typeof UpdateInstructionConfigurationSchema>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateInstructionConfigurationSchema = exports.CreateInstructionConfigurationSchema = exports.InstructionConfigurationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../base.schema");
|
|
6
|
+
const account_definitions_1 = require("../type-definitions/account-definitions");
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview Instruction configuration schema definitions.
|
|
9
|
+
*
|
|
10
|
+
* The Instruction Configuration is the heart of agent behaviour in the Service Configuration architecture.
|
|
11
|
+
* It contains the prompts, guidelines, and contextual instructions that fundamentally define how agents
|
|
12
|
+
* operate during conversations.
|
|
13
|
+
*
|
|
14
|
+
* @module service-configuration/instruction-config
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Zod schema for Instruction Configuration validation.
|
|
18
|
+
*
|
|
19
|
+
* The Instruction Configuration is the heart of agent behaviour in the Service Configuration architecture.
|
|
20
|
+
* It contains the prompts, guidelines, and contextual instructions that fundamentally define how an agent
|
|
21
|
+
* operates during conversations. A single Instruction Configuration can be associated with multiple Agent
|
|
22
|
+
* Configurations (1:N relationship), allowing consistent behavioral guidelines across different agent types.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* **Architecture Context:**
|
|
26
|
+
* - **Central Role**: The Instruction Configuration is the core element that shapes agent behavior
|
|
27
|
+
* - **Relationship**: 1:N with Agent Configurations - one instruction set can govern multiple agents
|
|
28
|
+
* - **Reusability**: Designed to be reused across multiple deployments
|
|
29
|
+
* - **Managed By**: Service Configuration (lifecycle management)
|
|
30
|
+
* - **Used By**: Deployment Configurations reference instruction sets for agent behavior
|
|
31
|
+
*
|
|
32
|
+
* **Example Use Case:**
|
|
33
|
+
* A "Customer Service Guidelines" instruction set might govern both a "Sales Agent" and a "Support Agent",
|
|
34
|
+
* ensuring uniform tone and compliance while each agent maintains its specialized capabilities.
|
|
35
|
+
*
|
|
36
|
+
* @typedef {Object} InstructionConfigurationProperties
|
|
37
|
+
* @property {string} id - Unique identifier for the instruction configuration
|
|
38
|
+
* @property {string} instructionName - System-readable name, typically auto-generated based on role (e.g., 'customer-support-agent')
|
|
39
|
+
* @property {string} role - The role or persona the agent should adopt (e.g., 'Customer Support Specialist', 'Sales Representative')
|
|
40
|
+
* @property {string} introductionMessage - Initial greeting message presented to users when starting a conversation
|
|
41
|
+
* @property {string} instructions - Detailed instructions that guide agent behavior, responses, conversation flow, and decision-making processes
|
|
42
|
+
* @property {string} guardrails - Safety and behavioral constraints the agent must follow, including compliance rules, forbidden topics, and ethical guidelines
|
|
43
|
+
* @property {string[]} [requiredSkills] - Specific skills or capabilities required for this instruction set (e.g., 'appointment_booking', 'order_management')
|
|
44
|
+
* @property {Record<string, any>} [validationRules] - Custom validation rules for input/output processing to ensure response quality and format compliance
|
|
45
|
+
* @property {string} [serviceId] - ID of the service this instruction configuration is associated with for organizational purposes
|
|
46
|
+
* @property {BusinessSupportServices[]} [supportedServices=[]] - Platform business services (tools) enabled for this agent, such as appointment management or order processing
|
|
47
|
+
* @property {string[]} [tools] - Tool identifiers the agent can use with this instruction set for extended capabilities
|
|
48
|
+
* @property {boolean} [isTemplate=false] - Whether this is a reusable template for creating other instruction configurations
|
|
49
|
+
* @property {boolean} isPrimary - Whether this is the primary system instruction configuration template used as a baseline
|
|
50
|
+
* @property {Record<string, any>} [metadata] - Additional metadata for the instruction configuration, such as version info or custom attributes
|
|
51
|
+
* @property {string[]} [knowledgeSourceIds=[]] - Array of IDs referencing knowledge sources that provide context and information for this instruction set
|
|
52
|
+
* @property {number} [createdAt] - Unix timestamp (milliseconds) when the configuration was created
|
|
53
|
+
* @property {number} [updatedAt] - Unix timestamp (milliseconds) when the configuration was last updated
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const instructionConfig: InstructionConfiguration = {
|
|
58
|
+
* id: '123*',
|
|
59
|
+
* instructionName: 'customer-support-agent',
|
|
60
|
+
* role: 'Customer Support Specialist',
|
|
61
|
+
* introductionMessage: 'Hello! How can I help you today?',
|
|
62
|
+
* instructions: 'You are a helpful customer support agent...',
|
|
63
|
+
* guardrails: 'Never share sensitive customer data...',
|
|
64
|
+
* supportedServices: [BusinessSupportServices.APPOINTMENT_MANAGEMENT],
|
|
65
|
+
* knowledgeSourceIds: ['789*'],
|
|
66
|
+
* isTemplate: false,
|
|
67
|
+
* isPrimary: false,
|
|
68
|
+
* createdAt: Date.now(),
|
|
69
|
+
* updatedAt: Date.now()
|
|
70
|
+
* };
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
exports.InstructionConfigurationSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
74
|
+
instructionName: zod_1.z.string().describe("System-readable name for the instruction configuration, typically auto-generated based on the role (e.g., 'customer-support-agent', 'sales-representative')"),
|
|
75
|
+
role: zod_1.z.string().describe("The role or persona the agent should adopt during conversations (e.g., 'Customer Support Specialist', 'Sales Representative', 'Technical Advisor')"),
|
|
76
|
+
introductionMessage: zod_1.z.string().describe("Initial greeting message presented to users when starting a conversation with the agent"),
|
|
77
|
+
instructions: zod_1.z.string().describe("Detailed instructions that fundamentally define how the agent operates, including behavioral guidelines, conversation flow, response patterns, and decision-making processes"),
|
|
78
|
+
guardrails: zod_1.z.string().describe("Safety and behavioral constraints the agent must strictly follow, including compliance rules, forbidden topics, ethical guidelines, and escalation criteria"),
|
|
79
|
+
requiredSkills: zod_1.z.array(zod_1.z.string()).optional().describe("Specific skills or capabilities required for this instruction set (e.g., 'appointment_booking', 'order_management', 'technical_troubleshooting')"),
|
|
80
|
+
validationRules: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Custom validation rules for input/output processing to ensure response quality, format compliance, and data integrity"),
|
|
81
|
+
serviceId: zod_1.z.string().optional().describe("ID of the parent service this instruction configuration is associated with for organizational and access control purposes"),
|
|
82
|
+
supportedServices: zod_1.z.array(zod_1.z.enum(account_definitions_1.BusinessSupportServices)).optional().default([]).describe("Array of platform business services (tools) enabled for this agent, such as appointment management, order processing, or payment handling"),
|
|
83
|
+
tools: zod_1.z.array(zod_1.z.string()).optional().describe("Array of tool identifiers the agent can use with this instruction set for extended capabilities and integrations"),
|
|
84
|
+
isTemplate: zod_1.z.boolean().optional().default(false).describe("Whether this instruction configuration is a reusable template that can be used as a baseline for creating other instruction configurations"),
|
|
85
|
+
isPrimary: zod_1.z.boolean().default(false).describe("Whether this is the primary system instruction configuration template used as the default baseline for new instruction configurations"),
|
|
86
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Additional metadata for the instruction configuration, such as version information, tags, custom attributes, or categorization data"),
|
|
87
|
+
knowledgeSourceIds: zod_1.z.array(zod_1.z.string()).optional().default([]).describe("Array of IDs referencing knowledge sources that provide contextual information, documentation, and domain knowledge for this instruction set (1:N relationship with Knowledge Sources)"),
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Zod schema for creating a new instruction configuration.
|
|
91
|
+
*
|
|
92
|
+
* Omits auto-generated fields (id, timestamps) that are populated by the system.
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* This schema enforces required fields for instruction creation while excluding
|
|
96
|
+
* fields that are automatically generated by the system.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const newInstruction: CreateInstructionConfiguration = {
|
|
101
|
+
* instructionName: 'sales-agent',
|
|
102
|
+
* role: 'Sales Representative',
|
|
103
|
+
* introductionMessage: 'Hi! I can help you find the perfect solution.',
|
|
104
|
+
* instructions: 'You are a knowledgeable sales agent...',
|
|
105
|
+
* guardrails: 'Always be honest about product capabilities...',
|
|
106
|
+
* supportedServices: [BusinessSupportServices.PRODUCT_ORDER_MANAGEMENT],
|
|
107
|
+
* knowledgeSourceIds: ['123*'],
|
|
108
|
+
* isTemplate: false,
|
|
109
|
+
* isPrimary: false
|
|
110
|
+
* };
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
exports.CreateInstructionConfigurationSchema = exports.InstructionConfigurationSchema.omit({
|
|
114
|
+
id: true,
|
|
115
|
+
createdAt: true,
|
|
116
|
+
updatedAt: true,
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Zod schema for updating an existing instruction configuration.
|
|
120
|
+
*
|
|
121
|
+
* All fields from CreateInstructionConfigurationSchema are optional (partial),
|
|
122
|
+
* with the id field required to identify the configuration to update.
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* Supports partial updates - only include the fields you want to modify.
|
|
126
|
+
* The id field is mandatory to specify which instruction configuration to update.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* const updateInstruction: UpdateInstructionConfiguration = {
|
|
131
|
+
* id: '123*',
|
|
132
|
+
* introductionMessage: 'Hello! How may I assist you today?',
|
|
133
|
+
* guardrails: 'Updated safety guidelines...'
|
|
134
|
+
* };
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
exports.UpdateInstructionConfigurationSchema = exports.CreateInstructionConfigurationSchema.partial().safeExtend({
|
|
138
|
+
id: zod_1.z.string(),
|
|
139
|
+
});
|