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,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateTranslationServiceLogSchema = exports.CreateTranslationServiceLogSchema = exports.TranslationServiceLogSchema = exports.UpdateTranslationParticipantSchema = exports.CreateTranslationParticipantSchema = exports.TranslationParticipantSchema = exports.TranslationMessageSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../base.schema");
|
|
6
|
+
const conversation_config_schema_1 = require("./conversation-config.schema");
|
|
7
|
+
const type_definitions_1 = require("../type-definitions");
|
|
8
|
+
/**
|
|
9
|
+
* @fileoverview Translation conversation schema definitions for real-time translation services.
|
|
10
|
+
*
|
|
11
|
+
* Translation conversations manage the lifecycle, participants, and message history of real-time language
|
|
12
|
+
* translation sessions. Tracks individual translation messages, participant metadata, session duration,
|
|
13
|
+
* and conversation status for multilingual communication across language barriers.
|
|
14
|
+
*
|
|
15
|
+
* @module conversation/translation-conversation
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Translation message schema - represents one translation interaction.
|
|
19
|
+
*
|
|
20
|
+
* Individual translation message capturing the complete translation pipeline from speaker's original speech
|
|
21
|
+
* to translated output for the listener. Tracks both source and target text, languages, participants, and
|
|
22
|
+
* the provisioning chain used for STT → Translation → TTS processing.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* **Architecture Context:**
|
|
26
|
+
* - **Used In**: TranslationServiceLog.transcribedConversationLog array
|
|
27
|
+
* - **Processing Pipeline**: Speaker audio → STT (originalText) → Translation (translatedText) → TTS → Target participant
|
|
28
|
+
* - **Provisioning**: References ProvisioningConfigChain with isTranslation=true
|
|
29
|
+
* - **Bidirectional**: Each spoken utterance creates messages for both participants in their languages
|
|
30
|
+
*
|
|
31
|
+
* **Translation Flow:**
|
|
32
|
+
* 1. Participant A speaks in Language A → captured as audio
|
|
33
|
+
* 2. STT transcribes audio → originalText in Language A
|
|
34
|
+
* 3. Translation model translates → translatedText in Language B
|
|
35
|
+
* 4. TTS synthesizes translatedText → audio for Participant B
|
|
36
|
+
* 5. TranslationMessage stored with both texts, languages, and metadata
|
|
37
|
+
*
|
|
38
|
+
* **Metadata Examples:**
|
|
39
|
+
* - audio_url: URL to original audio recording
|
|
40
|
+
* - confidence_score: STT transcription confidence (0-1)
|
|
41
|
+
* - processing_time_ms: Total pipeline latency
|
|
42
|
+
* - translation_model: LLM model used for translation
|
|
43
|
+
*/
|
|
44
|
+
exports.TranslationMessageSchema = zod_1.z.object({
|
|
45
|
+
messageId: zod_1.z.string().describe("Unique identifier for this translation message (typically UUID) used for message ordering, deduplication, and reference tracking"),
|
|
46
|
+
speakerParticipantId: zod_1.z.string().describe("ID of the participant who spoke this message in their original language (references TranslationParticipant)"),
|
|
47
|
+
targetParticipantId: zod_1.z.string().describe("ID of the participant who will receive the translated message in their language (references TranslationParticipant)"),
|
|
48
|
+
originalText: zod_1.z.string().optional().describe("Transcribed text from the speaker in their original language as output by STT model (e.g., 'Hello, how are you?' from English speaker)"),
|
|
49
|
+
translatedText: zod_1.z.string().optional().describe("Translated text in the target participant's language as output by translation model (e.g., 'Hola, ¿cómo estás?' for Spanish listener)"),
|
|
50
|
+
originalLanguage: base_schema_1.LanguageCodeSchema.describe("ISO 639-1 language code of the original spoken message matching the speaker's native language (e.g., 'en-US', 'es-ES', 'fr-FR')"),
|
|
51
|
+
targetLanguage: base_schema_1.LanguageCodeSchema.describe("ISO 639-1 language code for the translation output matching the target participant's native language (e.g., 'ja-JP', 'de-DE', 'zh-CN')"),
|
|
52
|
+
provisioningConfigId: zod_1.z.string().describe("ID of the provisioning configuration chain that processed this translation including STT, translation LLM, and TTS models (references ProvisioningConfigChain with isTranslation=true)"),
|
|
53
|
+
timestamp: zod_1.z.number().describe("Unix timestamp in milliseconds when this message was processed through the translation pipeline, used for message ordering and latency analysis"),
|
|
54
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Additional metadata as key-value pairs including audio recording URLs, STT confidence scores, processing times, translation model details, or quality metrics"),
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Translation participant schema.
|
|
58
|
+
*
|
|
59
|
+
* Represents an individual participant in a translation session including their language preferences,
|
|
60
|
+
* authentication credentials, role, and message history. Participants can be anchors (session initiators)
|
|
61
|
+
* or secondary participants joining the translation conversation.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* **Architecture Context:**
|
|
65
|
+
* - **Extends**: BaseModelSchema with participant-specific fields
|
|
66
|
+
* - **Relationship to Session**: N:1 - Multiple participants in one translation session
|
|
67
|
+
* - **Referenced By**: TranslationMessage via speakerParticipantId and targetParticipantId
|
|
68
|
+
* - **Access Control**: participantToken authenticates WebRTC connections
|
|
69
|
+
*
|
|
70
|
+
* **Participant Roles:**
|
|
71
|
+
* - **Anchor (isAnchor=true)**: Session initiator, typically the customer or primary caller
|
|
72
|
+
* - **Secondary (isAnchor=false)**: Joining participant, typically agent or secondary caller
|
|
73
|
+
*
|
|
74
|
+
* **Message Storage:**
|
|
75
|
+
* - transcriptions: Translation messages where this participant is either speaker or target
|
|
76
|
+
* - participantTranscribedLogs: Full conversation messages for audit and quality review
|
|
77
|
+
*
|
|
78
|
+
* **Integration:**
|
|
79
|
+
* - partnerParticipantRecordId links to external systems (CRM, HR, contact databases)
|
|
80
|
+
* - Enables unified participant profiles across multiple sessions
|
|
81
|
+
*/
|
|
82
|
+
exports.TranslationParticipantSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
83
|
+
translationServiceLogId: zod_1.z.string().optional().describe("ID of the translation service log this participant belongs to (N:1 relationship, references TranslationServiceLog)"),
|
|
84
|
+
partnerParticipantRecordId: zod_1.z.string().optional().describe("External partner or system participant record ID for integration with CRM, HR systems, or contact databases enabling unified participant profiles"),
|
|
85
|
+
name: zod_1.z.string().optional().describe("Human-readable name of the participant for display in UI and logs (e.g., 'John Smith', 'Customer Support Agent')"),
|
|
86
|
+
isAnchor: zod_1.z.boolean().default(false).describe("Flag indicating if this participant is the anchor/initiator of the session (true for session starter, false for joining participants)"),
|
|
87
|
+
nativeLanguage: zod_1.z.string().min(2).max(5).describe("ISO 639-1 language code of the participant's native spoken language (2-5 characters, e.g., 'en', 'en-US', 'es-MX') used for translation direction"),
|
|
88
|
+
participantAccessId: zod_1.z.number().describe("Unique numeric identifier for the participant used for WebRTC connection authentication and audio stream routing"),
|
|
89
|
+
participantToken: zod_1.z.string().describe("Authentication token for the participant's WebRTC connection, short-lived credential for secure session access (expires after session)"),
|
|
90
|
+
transcriptions: zod_1.z.array(exports.TranslationMessageSchema).optional().describe("Array of translation messages where this participant is either the speaker or target, populated for participant-specific message history views"),
|
|
91
|
+
participantTranscribedLogs: zod_1.z.array(conversation_config_schema_1.ConversationMessageSchema).optional().describe("Array of full conversation messages for this participant including both original and translated content for comprehensive audit logs and quality review")
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Schema for creating a new translation participant.
|
|
95
|
+
* Omits auto-generated fields.
|
|
96
|
+
*/
|
|
97
|
+
exports.CreateTranslationParticipantSchema = exports.TranslationParticipantSchema.omit({
|
|
98
|
+
id: true,
|
|
99
|
+
createdAt: true,
|
|
100
|
+
updatedAt: true,
|
|
101
|
+
});
|
|
102
|
+
/**
|
|
103
|
+
* Schema for updating an existing translation participant.
|
|
104
|
+
* All fields are optional except id.
|
|
105
|
+
*/
|
|
106
|
+
exports.UpdateTranslationParticipantSchema = exports.CreateTranslationParticipantSchema.partial().safeExtend({
|
|
107
|
+
id: zod_1.z.string(),
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Translation service log schema.
|
|
111
|
+
*
|
|
112
|
+
* Complete record of a translation session including participant information, session metadata, message
|
|
113
|
+
* history, and operational status. Primary entity for managing and tracking real-time translation services
|
|
114
|
+
* across organizations and projects.
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* **Architecture Context:**
|
|
118
|
+
* - **Extends**: BaseModelSchema with translation session-specific fields
|
|
119
|
+
* - **Relationship to Participants**: 1:N - One session has multiple participants
|
|
120
|
+
* - **Relationship to Messages**: 1:N - One session contains multiple translation messages
|
|
121
|
+
* - **Scoped To**: Organization and optionally Project for multi-tenant isolation
|
|
122
|
+
*
|
|
123
|
+
* **Translation Directions:**
|
|
124
|
+
* - **BIDIRECTIONAL**: Both participants receive translations (A→B and B→A simultaneously)
|
|
125
|
+
* - **UNIDIRECTIONAL**: Only one direction of translation (e.g., customer to agent only)
|
|
126
|
+
*
|
|
127
|
+
* **Session Lifecycle:**
|
|
128
|
+
* - **ACTIVE**: Translation session in progress with real-time audio streaming
|
|
129
|
+
* - **COMPLETED**: Session successfully concluded, participants disconnected
|
|
130
|
+
* - **FAILED**: Session encountered errors (connection lost, processing failures)
|
|
131
|
+
* - **ABANDONED**: Session abandoned by participants before completion
|
|
132
|
+
*
|
|
133
|
+
* **Message Logging:**
|
|
134
|
+
* - transcribedConversationLog: Central message array for session-level history
|
|
135
|
+
* - logTranscriptionInParticipantRecords: Controls whether messages also stored per-participant
|
|
136
|
+
* - Enables both session-wide and participant-specific message retrieval
|
|
137
|
+
*
|
|
138
|
+
* **Use Cases:**
|
|
139
|
+
* - Multilingual customer support call tracking
|
|
140
|
+
* - International business meeting transcripts
|
|
141
|
+
* - Cross-border service interaction logs
|
|
142
|
+
* - Quality assurance and compliance auditing
|
|
143
|
+
*/
|
|
144
|
+
exports.TranslationServiceLogSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
145
|
+
organization_id: zod_1.z.string().describe("ID of the organization requesting the translation service for multi-tenant isolation, billing attribution, and access control"),
|
|
146
|
+
project_id: zod_1.z.string().optional().describe("Optional ID of the project associated with the translation service for organizational grouping, reporting, and project-specific analytics (references Project)"),
|
|
147
|
+
partner_initiator_id: zod_1.z.string().describe("Unique identifier for the initiator participant from external partner systems for cross-platform tracking and CRM integration"),
|
|
148
|
+
partner_session_id: zod_1.z.string().optional().describe("Optional external session ID for tracking the translation session in partner systems, enables correlation with external call/meeting records"),
|
|
149
|
+
sdrtn_id: zod_1.z.string().optional().describe("SDRTN (Session Description and Real-Time Networking) identifier for WebRTC connections enabling low-latency peer-to-peer audio streaming between participants"),
|
|
150
|
+
translationConfigId: zod_1.z.string().optional().nullable().describe("ID of the translation configuration chain to use for this service including STT, translation LLM, and TTS models (references ProvisioningConfigChain with isTranslation=true)"),
|
|
151
|
+
participants: zod_1.z.array(zod_1.z.string()).optional().describe("Array of participant IDs involved in this translation session (references TranslationParticipant records, typically 2 for standard sessions, more for conference scenarios)"),
|
|
152
|
+
durationInSeconds: zod_1.z.number().nonnegative().optional().default(60).describe("Duration of the translation session in seconds for billing calculations, analytics reporting, and session quality metrics (default: 60 for minimum billing)"),
|
|
153
|
+
status: zod_1.z.enum(type_definitions_1.ConversationStatus).default(type_definitions_1.ConversationStatus.ACTIVE).describe("Current operational status of the translation session (ACTIVE: in progress, COMPLETED: concluded, FAILED: errors, ABANDONED: participants disconnected prematurely)"),
|
|
154
|
+
direction: zod_1.z.enum(type_definitions_1.TranslationDirection).default(type_definitions_1.TranslationDirection.BIDIRECTIONAL).describe("Translation direction mode (BIDIRECTIONAL: both participants receive translations simultaneously, UNIDIRECTIONAL: one-way translation only for specific use cases)"),
|
|
155
|
+
transcribedConversationLog: zod_1.z.array(exports.TranslationMessageSchema).optional().describe("Array of translation messages capturing the complete conversation history with original and translated text for both participants, used for session playback and audit"),
|
|
156
|
+
logTranscriptionInParticipantRecords: zod_1.z.boolean().default(false).describe("Flag controlling whether translation messages are also stored in individual participant records (true for participant-specific history, false for session-only storage to reduce duplication)"),
|
|
157
|
+
translationSummary: zod_1.z.string().optional().describe("Optional AI-generated summary of the translation session including key discussion points, outcomes, and quality assessment for reporting and analytics"),
|
|
158
|
+
created_day: zod_1.z.string().optional().describe("The day the translation session was created in YYYY-MM-DD ISO format for daily aggregation queries, analytics partitioning, and billing period grouping"),
|
|
159
|
+
});
|
|
160
|
+
/**
|
|
161
|
+
* Schema for creating a new translation service log.
|
|
162
|
+
* Omits auto-generated fields.
|
|
163
|
+
*/
|
|
164
|
+
exports.CreateTranslationServiceLogSchema = exports.TranslationServiceLogSchema.omit({
|
|
165
|
+
id: true,
|
|
166
|
+
createdAt: true,
|
|
167
|
+
updatedAt: true,
|
|
168
|
+
});
|
|
169
|
+
/**
|
|
170
|
+
* Schema for updating an existing translation service log.
|
|
171
|
+
* All fields are optional except id.
|
|
172
|
+
*/
|
|
173
|
+
exports.UpdateTranslationServiceLogSchema = exports.CreateTranslationServiceLogSchema.partial().safeExtend({
|
|
174
|
+
id: zod_1.z.string(),
|
|
175
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Central export point for all core schemas and utilities.
|
|
3
|
+
* @module core
|
|
4
|
+
*/
|
|
5
|
+
export * from './base.schema';
|
|
6
|
+
export * from './account';
|
|
7
|
+
export * from './assistant-setups';
|
|
8
|
+
export * from './business-mgt';
|
|
9
|
+
export * from './conversation';
|
|
10
|
+
export * from './service-configuration';
|
|
11
|
+
export * from './type-definitions';
|
|
12
|
+
export * from './validators';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Central export point for all core schemas and utilities.
|
|
4
|
+
* @module core
|
|
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
|
+
// Base schemas
|
|
22
|
+
__exportStar(require("./base.schema"), exports);
|
|
23
|
+
// Module exports
|
|
24
|
+
__exportStar(require("./account"), exports);
|
|
25
|
+
__exportStar(require("./assistant-setups"), exports);
|
|
26
|
+
__exportStar(require("./business-mgt"), exports);
|
|
27
|
+
__exportStar(require("./conversation"), exports);
|
|
28
|
+
__exportStar(require("./service-configuration"), exports);
|
|
29
|
+
__exportStar(require("./type-definitions"), exports);
|
|
30
|
+
__exportStar(require("./validators"), exports);
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AssistantType, LLMType } from "../type-definitions/service-config.definitions";
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Agent configuration schema definitions.
|
|
5
|
+
*
|
|
6
|
+
* Agent Configurations define the core behavior, capabilities, and personality of AI agents.
|
|
7
|
+
* They reference LLM models and instruction configurations, and can be reused across multiple
|
|
8
|
+
* deployments. The Instruction Configuration (1:N relationship) governs agent behavior.
|
|
9
|
+
*
|
|
10
|
+
* @module service-configuration/agent-config
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Zod schema for Agent Configuration validation.
|
|
14
|
+
*
|
|
15
|
+
* Agent Configurations define the core behavior, capabilities, and personality of AI agents in the
|
|
16
|
+
* Service Configuration architecture. They are designed to be reusable across multiple deployments,
|
|
17
|
+
* with each agent governed by an Instruction Configuration (1:N relationship). Multiple Agent
|
|
18
|
+
* Configurations can share the same Instruction Configuration for consistent behavioral guidelines.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* **Architecture Context:**
|
|
22
|
+
* - **Managed By**: Service Configuration (lifecycle management)
|
|
23
|
+
* - **Used By**: Deployment Configurations (N:1 - multiple deployments can use the same agent)
|
|
24
|
+
* - **Associated With**: Instruction Configuration (1:N - one instruction set can govern multiple agents)
|
|
25
|
+
* - **References**: Wiil Support Model Registry (via modelId)
|
|
26
|
+
* - **Reusability**: Designed to be reused across multiple deployments with different channels
|
|
27
|
+
*
|
|
28
|
+
* **Configuration Layers:**
|
|
29
|
+
* - **Agent Configuration**: Defines capabilities, model, and operational mode
|
|
30
|
+
* - **Instruction Configuration**: Defines behavioral guidelines and conversation flow
|
|
31
|
+
* - Together they create a complete agent persona
|
|
32
|
+
*
|
|
33
|
+
* @typedef {Object} AgentConfigurationProperties
|
|
34
|
+
* @property {string} id - Unique identifier for the agent configuration
|
|
35
|
+
* @property {string} modelId - Identifier of the LLM model from Wiil Support Registry (e.g., '2323*', 'EYUW&*EU@H$#'). References WiilSupportModel.modelId
|
|
36
|
+
* @property {string} name - Personal name for the AI agent (max 30 characters) (e.g., 'Sarah', 'James')
|
|
37
|
+
* @property {LLMType} defaultFunctionState - Default operational mode (TEXT, VOICE, MULTI_MODE) (default: MULTI_MODE)
|
|
38
|
+
* @property {boolean} [usesWiilSupportModel=true] - Whether this agent uses Wiil's supported model registry
|
|
39
|
+
* @property {Record<string, any>} [requiredModelConfig] - Additional model parameters (e.g., { voiceId: 'adam', languageId: 'en-US' })
|
|
40
|
+
* @property {boolean} [useCustomModel=false] - Whether to opt out of platform default model configurations and only use the specified modelId and requiredModelConfig
|
|
41
|
+
* @property {string|null} [textProcessingModelId] - Specific model ID to use for text processing, if different from the main modelId
|
|
42
|
+
* @property {string} instructionConfigurationId - ID of the instruction configuration providing behavioral guidelines (N:1)
|
|
43
|
+
* @property {AssistantType} assistantType - Channel specialization type (GENERAL, WEB, PHONE, etc.) (default: GENERAL)
|
|
44
|
+
* @property {CallTransferConfig[]} [call_transfer_config=[]] - Call transfer configurations for phone deployments
|
|
45
|
+
* @property {Record<string, any>} [metadata] - Additional metadata for organization and filtering
|
|
46
|
+
* @property {WiilSupportModel | null} [model] - Auto-populated model information from registry
|
|
47
|
+
* @property {number} [createdAt] - Unix timestamp (milliseconds) when created
|
|
48
|
+
* @property {number} [updatedAt] - Unix timestamp (milliseconds) when last updated
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const agentConfig: AgentConfiguration = {
|
|
53
|
+
* id: '123*',
|
|
54
|
+
* modelId: 'YUSI21217J1',
|
|
55
|
+
* name: 'Sarah',
|
|
56
|
+
* defaultFunctionState: LLMType.MULTI_MODE,
|
|
57
|
+
* usesWiilSupportModel: true,
|
|
58
|
+
* instructionConfigurationId: '456*',
|
|
59
|
+
* assistantType: AssistantType.PHONE,
|
|
60
|
+
* call_transfer_config: [
|
|
61
|
+
* {
|
|
62
|
+
* transfer_number: '+15551234567',
|
|
63
|
+
* transfer_type: 'warm',
|
|
64
|
+
* transfer_conditions: ['billing support', 'escalate']
|
|
65
|
+
* }
|
|
66
|
+
* ],
|
|
67
|
+
* metadata: { department: 'support' },
|
|
68
|
+
* createdAt: Date.now(),
|
|
69
|
+
* updatedAt: Date.now()
|
|
70
|
+
* };
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare const AgentConfigurationSchema: z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
updatedAt: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
modelId: z.ZodString;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
defaultFunctionState: z.ZodDefault<z.ZodEnum<typeof LLMType>>;
|
|
80
|
+
usesWiilSupportModel: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
81
|
+
requiredModelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
82
|
+
useCustomModel: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
83
|
+
textProcessingModelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
instructionConfigurationId: z.ZodString;
|
|
85
|
+
assistantType: z.ZodDefault<z.ZodEnum<typeof AssistantType>>;
|
|
86
|
+
call_transfer_config: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
87
|
+
transfer_number: z.ZodString;
|
|
88
|
+
transfer_type: z.ZodDefault<z.ZodEnum<{
|
|
89
|
+
blind: "blind";
|
|
90
|
+
warm: "warm";
|
|
91
|
+
}>>;
|
|
92
|
+
transfer_conditions: z.ZodArray<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>>>>;
|
|
94
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
95
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
96
|
+
modelId: z.ZodString;
|
|
97
|
+
proprietor: z.ZodEnum<typeof import("../type-definitions/service-config.definitions").SupportedProprietor>;
|
|
98
|
+
name: z.ZodString;
|
|
99
|
+
provider_model_id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
description: z.ZodString;
|
|
101
|
+
type: z.ZodEnum<typeof LLMType>;
|
|
102
|
+
discontinued: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
103
|
+
supportedVoices: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
voiceId: z.ZodString;
|
|
105
|
+
name: z.ZodString;
|
|
106
|
+
description: z.ZodString;
|
|
107
|
+
gender: z.ZodEnum<{
|
|
108
|
+
neutral: "neutral";
|
|
109
|
+
male: "male";
|
|
110
|
+
female: "female";
|
|
111
|
+
}>;
|
|
112
|
+
language: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
113
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
114
|
+
}, z.core.$strip>>>>;
|
|
115
|
+
supportLanguages: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
116
|
+
languageId: z.ZodString;
|
|
117
|
+
name: z.ZodString;
|
|
118
|
+
code: z.ZodString;
|
|
119
|
+
isDefault: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
120
|
+
isExperimental: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
121
|
+
}, z.core.$strip>>>>;
|
|
122
|
+
}, z.core.$strip>>>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
/**
|
|
125
|
+
* Type definition for Agent Configuration.
|
|
126
|
+
*
|
|
127
|
+
* Represents a complete agent configuration including all metadata,
|
|
128
|
+
* model settings, and operational parameters.
|
|
129
|
+
*/
|
|
130
|
+
export type AgentConfiguration = z.infer<typeof AgentConfigurationSchema>;
|
|
131
|
+
/**
|
|
132
|
+
* Zod schema for creating a new agent configuration.
|
|
133
|
+
*
|
|
134
|
+
* Omits auto-generated fields (id, timestamps, model) that are
|
|
135
|
+
* populated by the system during creation.
|
|
136
|
+
*
|
|
137
|
+
* @remarks
|
|
138
|
+
* This schema enforces required fields for agent creation while excluding
|
|
139
|
+
* fields that are automatically generated by the database or system.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* const newAgent: CreateAgentConfiguration = {
|
|
144
|
+
* modelId: 'gpt-4-turbo',
|
|
145
|
+
* name: 'James',
|
|
146
|
+
* defaultFunctionState: LLMType.MULTI_MODE,
|
|
147
|
+
* usesWiilSupportModel: true,
|
|
148
|
+
* instructionConfigurationId: '789*',
|
|
149
|
+
* assistantType: AssistantType.WEB,
|
|
150
|
+
* requiredModelConfig: {
|
|
151
|
+
* voiceId: 'rachel',
|
|
152
|
+
* languageId: 'en-US'
|
|
153
|
+
* },
|
|
154
|
+
* call_transfer_config: [],
|
|
155
|
+
* metadata: { team: 'sales' }
|
|
156
|
+
* };
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
export declare const CreateAgentConfigurationSchema: z.ZodObject<{
|
|
160
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
161
|
+
name: z.ZodString;
|
|
162
|
+
modelId: z.ZodString;
|
|
163
|
+
defaultFunctionState: z.ZodDefault<z.ZodEnum<typeof LLMType>>;
|
|
164
|
+
usesWiilSupportModel: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
165
|
+
requiredModelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
166
|
+
useCustomModel: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
167
|
+
textProcessingModelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
instructionConfigurationId: z.ZodString;
|
|
169
|
+
assistantType: z.ZodDefault<z.ZodEnum<typeof AssistantType>>;
|
|
170
|
+
call_transfer_config: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
|
+
transfer_number: z.ZodString;
|
|
172
|
+
transfer_type: z.ZodDefault<z.ZodEnum<{
|
|
173
|
+
blind: "blind";
|
|
174
|
+
warm: "warm";
|
|
175
|
+
}>>;
|
|
176
|
+
transfer_conditions: z.ZodArray<z.ZodString>;
|
|
177
|
+
}, z.core.$strip>>>>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
/**
|
|
180
|
+
* Type definition for creating a new agent configuration.
|
|
181
|
+
*
|
|
182
|
+
* Represents the payload required to create a new agent, excluding
|
|
183
|
+
* system-generated fields.
|
|
184
|
+
*/
|
|
185
|
+
export type CreateAgentConfiguration = z.infer<typeof CreateAgentConfigurationSchema>;
|
|
186
|
+
/**
|
|
187
|
+
* Zod schema for updating an existing agent configuration.
|
|
188
|
+
*
|
|
189
|
+
* All fields from CreateAgentConfigurationSchema are optional (partial),
|
|
190
|
+
* with the id field required to identify the configuration to update.
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* Supports partial updates - only include the fields you want to modify.
|
|
194
|
+
* The id field is mandatory to specify which agent configuration to update.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* const updatePayload: UpdateAgentConfiguration = {
|
|
199
|
+
* id: '123*',
|
|
200
|
+
* name: 'Alex',
|
|
201
|
+
* metadata: { team: 'enterprise-sales' }
|
|
202
|
+
* };
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
export declare const UpdateAgentConfigurationSchema: z.ZodObject<{
|
|
206
|
+
metadata: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
207
|
+
name: z.ZodOptional<z.ZodString>;
|
|
208
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
209
|
+
defaultFunctionState: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof LLMType>>>;
|
|
210
|
+
usesWiilSupportModel: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
211
|
+
requiredModelConfig: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
212
|
+
useCustomModel: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
213
|
+
textProcessingModelId: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
214
|
+
instructionConfigurationId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
assistantType: z.ZodOptional<z.ZodDefault<z.ZodEnum<typeof AssistantType>>>;
|
|
216
|
+
call_transfer_config: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
217
|
+
transfer_number: z.ZodString;
|
|
218
|
+
transfer_type: z.ZodDefault<z.ZodEnum<{
|
|
219
|
+
blind: "blind";
|
|
220
|
+
warm: "warm";
|
|
221
|
+
}>>;
|
|
222
|
+
transfer_conditions: z.ZodArray<z.ZodString>;
|
|
223
|
+
}, z.core.$strip>>>>>;
|
|
224
|
+
id: z.ZodString;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
/**
|
|
227
|
+
* Type definition for updating an existing agent configuration.
|
|
228
|
+
*
|
|
229
|
+
* Represents a partial update payload with required id field.
|
|
230
|
+
*/
|
|
231
|
+
export type UpdateAgentConfiguration = z.infer<typeof UpdateAgentConfigurationSchema>;
|
|
232
|
+
export declare const AgentConfigurationDeleteRequestSchema: z.ZodObject<{
|
|
233
|
+
id: z.ZodString;
|
|
234
|
+
deletePhoneConfig: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
export type AgentConfigurationDeleteRequest = z.infer<typeof AgentConfigurationDeleteRequestSchema>;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentConfigurationDeleteRequestSchema = exports.UpdateAgentConfigurationSchema = exports.CreateAgentConfigurationSchema = exports.AgentConfigurationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const base_schema_1 = require("../base.schema");
|
|
6
|
+
const support_llm_1 = require("./support-llm");
|
|
7
|
+
const service_config_definitions_1 = require("../type-definitions/service-config.definitions");
|
|
8
|
+
const call_transfer_config_schema_1 = require("./call-transfer-config.schema");
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Agent configuration schema definitions.
|
|
11
|
+
*
|
|
12
|
+
* Agent Configurations define the core behavior, capabilities, and personality of AI agents.
|
|
13
|
+
* They reference LLM models and instruction configurations, and can be reused across multiple
|
|
14
|
+
* deployments. The Instruction Configuration (1:N relationship) governs agent behavior.
|
|
15
|
+
*
|
|
16
|
+
* @module service-configuration/agent-config
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Zod schema for Agent Configuration validation.
|
|
20
|
+
*
|
|
21
|
+
* Agent Configurations define the core behavior, capabilities, and personality of AI agents in the
|
|
22
|
+
* Service Configuration architecture. They are designed to be reusable across multiple deployments,
|
|
23
|
+
* with each agent governed by an Instruction Configuration (1:N relationship). Multiple Agent
|
|
24
|
+
* Configurations can share the same Instruction Configuration for consistent behavioral guidelines.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* **Architecture Context:**
|
|
28
|
+
* - **Managed By**: Service Configuration (lifecycle management)
|
|
29
|
+
* - **Used By**: Deployment Configurations (N:1 - multiple deployments can use the same agent)
|
|
30
|
+
* - **Associated With**: Instruction Configuration (1:N - one instruction set can govern multiple agents)
|
|
31
|
+
* - **References**: Wiil Support Model Registry (via modelId)
|
|
32
|
+
* - **Reusability**: Designed to be reused across multiple deployments with different channels
|
|
33
|
+
*
|
|
34
|
+
* **Configuration Layers:**
|
|
35
|
+
* - **Agent Configuration**: Defines capabilities, model, and operational mode
|
|
36
|
+
* - **Instruction Configuration**: Defines behavioral guidelines and conversation flow
|
|
37
|
+
* - Together they create a complete agent persona
|
|
38
|
+
*
|
|
39
|
+
* @typedef {Object} AgentConfigurationProperties
|
|
40
|
+
* @property {string} id - Unique identifier for the agent configuration
|
|
41
|
+
* @property {string} modelId - Identifier of the LLM model from Wiil Support Registry (e.g., '2323*', 'EYUW&*EU@H$#'). References WiilSupportModel.modelId
|
|
42
|
+
* @property {string} name - Personal name for the AI agent (max 30 characters) (e.g., 'Sarah', 'James')
|
|
43
|
+
* @property {LLMType} defaultFunctionState - Default operational mode (TEXT, VOICE, MULTI_MODE) (default: MULTI_MODE)
|
|
44
|
+
* @property {boolean} [usesWiilSupportModel=true] - Whether this agent uses Wiil's supported model registry
|
|
45
|
+
* @property {Record<string, any>} [requiredModelConfig] - Additional model parameters (e.g., { voiceId: 'adam', languageId: 'en-US' })
|
|
46
|
+
* @property {boolean} [useCustomModel=false] - Whether to opt out of platform default model configurations and only use the specified modelId and requiredModelConfig
|
|
47
|
+
* @property {string|null} [textProcessingModelId] - Specific model ID to use for text processing, if different from the main modelId
|
|
48
|
+
* @property {string} instructionConfigurationId - ID of the instruction configuration providing behavioral guidelines (N:1)
|
|
49
|
+
* @property {AssistantType} assistantType - Channel specialization type (GENERAL, WEB, PHONE, etc.) (default: GENERAL)
|
|
50
|
+
* @property {CallTransferConfig[]} [call_transfer_config=[]] - Call transfer configurations for phone deployments
|
|
51
|
+
* @property {Record<string, any>} [metadata] - Additional metadata for organization and filtering
|
|
52
|
+
* @property {WiilSupportModel | null} [model] - Auto-populated model information from registry
|
|
53
|
+
* @property {number} [createdAt] - Unix timestamp (milliseconds) when created
|
|
54
|
+
* @property {number} [updatedAt] - Unix timestamp (milliseconds) when last updated
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const agentConfig: AgentConfiguration = {
|
|
59
|
+
* id: '123*',
|
|
60
|
+
* modelId: 'YUSI21217J1',
|
|
61
|
+
* name: 'Sarah',
|
|
62
|
+
* defaultFunctionState: LLMType.MULTI_MODE,
|
|
63
|
+
* usesWiilSupportModel: true,
|
|
64
|
+
* instructionConfigurationId: '456*',
|
|
65
|
+
* assistantType: AssistantType.PHONE,
|
|
66
|
+
* call_transfer_config: [
|
|
67
|
+
* {
|
|
68
|
+
* transfer_number: '+15551234567',
|
|
69
|
+
* transfer_type: 'warm',
|
|
70
|
+
* transfer_conditions: ['billing support', 'escalate']
|
|
71
|
+
* }
|
|
72
|
+
* ],
|
|
73
|
+
* metadata: { department: 'support' },
|
|
74
|
+
* createdAt: Date.now(),
|
|
75
|
+
* updatedAt: Date.now()
|
|
76
|
+
* };
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
exports.AgentConfigurationSchema = base_schema_1.BaseModelSchema.safeExtend({
|
|
80
|
+
modelId: zod_1.z.string().describe("Identifier of the LLM model from Wiil Support Registry to power this agent (e.g., 'YUSI21217J1', 'EYUW&*EU@H$#'). References WiilSupportModel.modelId"),
|
|
81
|
+
name: zod_1.z.string().max(30).describe("Personal name for the AI agent used in conversations (e.g., 'Sarah', 'James', 'Alex')"),
|
|
82
|
+
defaultFunctionState: zod_1.z.enum(service_config_definitions_1.LLMType).default(service_config_definitions_1.LLMType.MULTI_MODE).describe("Default operational mode (TEXT for text-only, VOICE for speech, MULTI_MODE for combined text/voice capabilities)"),
|
|
83
|
+
usesWiilSupportModel: zod_1.z.boolean().optional().default(true).describe("Whether this agent uses a model from Wiil's curated registry (true) or a custom external model (false)"),
|
|
84
|
+
requiredModelConfig: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Model-specific configuration parameters as key-value pairs (e.g., { voiceId: 'adam', languageId: 'en-US', temperature: 0.7 })"),
|
|
85
|
+
useCustomModel: zod_1.z.boolean().optional().default(false).describe("Whether to opt out of platform default model configurations and only use the specified modelId and requiredModelConfig"),
|
|
86
|
+
textProcessingModelId: zod_1.z.string().nullable().optional().describe("Specific model ID to use for text processing, if different from the main modelId"),
|
|
87
|
+
instructionConfigurationId: zod_1.z.string().describe("ID of the Instruction Configuration providing behavioral guidelines and conversation patterns. Multiple agents can share the same instruction configuration (N:1)"),
|
|
88
|
+
assistantType: zod_1.z.enum(service_config_definitions_1.AssistantType).default(service_config_definitions_1.AssistantType.GENERAL).describe("Channel specialization type for optimization (GENERAL for multi-channel, WEB for browser, PHONE for telephony, EMAIL for email)"),
|
|
89
|
+
call_transfer_config: zod_1.z.array(call_transfer_config_schema_1.CallTransferConfigSchema).optional().default([]).describe("Array of call transfer configurations for phone deployments, defining transfer destinations and conditions for escalation"),
|
|
90
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional().describe("Additional metadata for organization including tags, categories, department, or custom attributes for filtering and reporting"),
|
|
91
|
+
model: support_llm_1.WiilSupportModelSchema.nullable().optional().describe("Complete model information auto-populated from Wiil registry (includes provider, voices, languages). Null if not loaded or custom model"),
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Zod schema for creating a new agent configuration.
|
|
95
|
+
*
|
|
96
|
+
* Omits auto-generated fields (id, timestamps, model) that are
|
|
97
|
+
* populated by the system during creation.
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* This schema enforces required fields for agent creation while excluding
|
|
101
|
+
* fields that are automatically generated by the database or system.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const newAgent: CreateAgentConfiguration = {
|
|
106
|
+
* modelId: 'gpt-4-turbo',
|
|
107
|
+
* name: 'James',
|
|
108
|
+
* defaultFunctionState: LLMType.MULTI_MODE,
|
|
109
|
+
* usesWiilSupportModel: true,
|
|
110
|
+
* instructionConfigurationId: '789*',
|
|
111
|
+
* assistantType: AssistantType.WEB,
|
|
112
|
+
* requiredModelConfig: {
|
|
113
|
+
* voiceId: 'rachel',
|
|
114
|
+
* languageId: 'en-US'
|
|
115
|
+
* },
|
|
116
|
+
* call_transfer_config: [],
|
|
117
|
+
* metadata: { team: 'sales' }
|
|
118
|
+
* };
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
exports.CreateAgentConfigurationSchema = exports.AgentConfigurationSchema.omit({
|
|
122
|
+
id: true,
|
|
123
|
+
createdAt: true,
|
|
124
|
+
updatedAt: true,
|
|
125
|
+
model: true,
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* Zod schema for updating an existing agent configuration.
|
|
129
|
+
*
|
|
130
|
+
* All fields from CreateAgentConfigurationSchema are optional (partial),
|
|
131
|
+
* with the id field required to identify the configuration to update.
|
|
132
|
+
*
|
|
133
|
+
* @remarks
|
|
134
|
+
* Supports partial updates - only include the fields you want to modify.
|
|
135
|
+
* The id field is mandatory to specify which agent configuration to update.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* const updatePayload: UpdateAgentConfiguration = {
|
|
140
|
+
* id: '123*',
|
|
141
|
+
* name: 'Alex',
|
|
142
|
+
* metadata: { team: 'enterprise-sales' }
|
|
143
|
+
* };
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
exports.UpdateAgentConfigurationSchema = exports.CreateAgentConfigurationSchema.partial().safeExtend({
|
|
147
|
+
id: zod_1.z.string(),
|
|
148
|
+
});
|
|
149
|
+
exports.AgentConfigurationDeleteRequestSchema = zod_1.z.object({
|
|
150
|
+
id: zod_1.z.string().describe("Unique identifier of the agent configuration to delete"),
|
|
151
|
+
deletePhoneConfig: zod_1.z.boolean().optional().default(true).describe("Whether to also delete associated phone configurations"),
|
|
152
|
+
});
|