@webex/contact-center 3.12.0-llmrefactor.12 → 3.12.0-llmrefactor.14
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/.sdd/manifest.json +6 -5
- package/ai-docs/CONTRACTS.md +8 -0
- package/ai-docs/SERVICE_STATE.md +4 -0
- package/ai-docs/contact-center-spec.md +26 -3
- package/ai-docs/features/contact-owner-change-refactor.md +78 -0
- package/dist/cc.js +202 -9
- package/dist/cc.js.map +1 -1
- package/dist/constants.js +5 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/dist/metrics/behavioral-events.js +6 -0
- package/dist/metrics/behavioral-events.js.map +1 -1
- package/dist/metrics/constants.js +6 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/services/AnswerCallOnWebexService.js +4 -4
- package/dist/services/AnswerCallOnWebexService.js.map +1 -1
- package/dist/services/ApiAiAssistant.js +116 -1
- package/dist/services/ApiAiAssistant.js.map +1 -1
- package/dist/services/WebexCrossClientService.js +5 -2
- package/dist/services/WebexCrossClientService.js.map +1 -1
- package/dist/services/WxAppTelephonyMercurySync.js +6 -3
- package/dist/services/WxAppTelephonyMercurySync.js.map +1 -1
- package/dist/services/config/Util.js +5 -1
- package/dist/services/config/Util.js.map +1 -1
- package/dist/services/config/constants.js +10 -1
- package/dist/services/config/constants.js.map +1 -1
- package/dist/services/config/index.js +51 -0
- package/dist/services/config/index.js.map +1 -1
- package/dist/services/config/types.js +4 -3
- package/dist/services/config/types.js.map +1 -1
- package/dist/services/core/Utils.js +5 -1
- package/dist/services/core/Utils.js.map +1 -1
- package/dist/services/task/TaskFactory.js +1 -0
- package/dist/services/task/TaskFactory.js.map +1 -1
- package/dist/services/task/TaskManager.js +50 -58
- package/dist/services/task/TaskManager.js.map +1 -1
- package/dist/services/task/types.js.map +1 -1
- package/dist/services/task/voice/Voice.js +63 -44
- package/dist/services/task/voice/Voice.js.map +1 -1
- package/dist/services/task/voice/wxAppOfferObservability.js +145 -0
- package/dist/services/task/voice/wxAppOfferObservability.js.map +1 -0
- package/dist/services/task/voice/wxAppVoiceMethods.js +52 -11
- package/dist/services/task/voice/wxAppVoiceMethods.js.map +1 -1
- package/dist/services/wxAppDiagnosticLogging.js +50 -13
- package/dist/services/wxAppDiagnosticLogging.js.map +1 -1
- package/dist/types/cc.d.ts +21 -1
- package/dist/types/constants.d.ts +4 -0
- package/dist/types/index.d.ts +11 -1
- package/dist/types/metrics/constants.d.ts +6 -0
- package/dist/types/services/ApiAiAssistant.d.ts +35 -2
- package/dist/types/services/config/constants.d.ts +5 -0
- package/dist/types/services/config/types.d.ts +15 -2
- package/dist/types/services/core/Utils.d.ts +2 -0
- package/dist/types/services/task/types.d.ts +2 -0
- package/dist/types/services/task/voice/Voice.d.ts +15 -2
- package/dist/types/services/task/voice/wxAppOfferObservability.d.ts +39 -0
- package/dist/types/services/task/voice/wxAppVoiceMethods.d.ts +19 -6
- package/dist/types/services/wxAppDiagnosticLogging.d.ts +12 -0
- package/dist/types/types.d.ts +56 -1
- package/dist/types.js +39 -2
- package/dist/types.js.map +1 -1
- package/dist/webex.js +9 -1
- package/dist/webex.js.map +1 -1
- package/package.json +9 -9
- package/src/cc.ts +294 -25
- package/src/constants.ts +4 -0
- package/src/index.ts +11 -0
- package/src/metrics/ai-docs/metrics-spec.md +61 -20
- package/src/metrics/behavioral-events.ts +6 -0
- package/src/metrics/constants.ts +6 -0
- package/src/services/AnswerCallOnWebexService.ts +4 -4
- package/src/services/ApiAiAssistant.ts +153 -1
- package/src/services/WebexCrossClientService.ts +7 -2
- package/src/services/WxAppTelephonyMercurySync.ts +3 -3
- package/src/services/ai-docs/services-spec.md +11 -3
- package/src/services/config/Util.ts +6 -0
- package/src/services/config/ai-docs/config-spec.md +14 -3
- package/src/services/config/constants.ts +12 -0
- package/src/services/config/index.ts +65 -0
- package/src/services/config/types.ts +13 -2
- package/src/services/core/Utils.ts +4 -0
- package/src/services/task/TaskFactory.ts +1 -0
- package/src/services/task/TaskManager.ts +85 -87
- package/src/services/task/ai-docs/task-spec.md +7 -3
- package/src/services/task/types.ts +16 -0
- package/src/services/task/voice/Voice.ts +74 -52
- package/src/services/task/voice/wxAppOfferObservability.ts +204 -0
- package/src/services/task/voice/wxAppVoiceMethods.ts +83 -24
- package/src/services/wxAppDiagnosticLogging.ts +135 -23
- package/src/types.ts +65 -0
- package/src/webex.js +8 -0
- package/test/unit/spec/cc.ts +469 -19
- package/test/unit/spec/services/ApiAiAssistant.ts +134 -2
- package/test/unit/spec/services/WebexCrossClientService.ts +45 -3
- package/test/unit/spec/services/WxAppTelephonyMercurySync.ts +1 -1
- package/test/unit/spec/services/config/Util.ts +44 -0
- package/test/unit/spec/services/config/index.ts +68 -0
- package/test/unit/spec/services/task/TaskManager.ts +214 -3
- package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +33 -0
- package/test/unit/spec/services/task/voice/Voice.ts +10 -51
- package/test/unit/spec/services/task/voice/wxAppOfferObservability.ts +361 -0
- package/test/unit/spec/services/task/voice/wxAppVoiceMethods.ts +121 -5
- package/test/unit/spec/services/wxAppDiagnosticLogging.ts +44 -8
- package/test/unit/spec/wellnessSampleUtils.ts +288 -0
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","e","__esModule","default","WXAPP_LOG_FEATURE","exports","WXAPP_LOG_PREFIX","callIdSuffix","callId","undefined","length","slice","logWxApp","message","method","data","LoggerProxy","info","module","feature","logWxAppError","error","logWxAppSessionReadiness","params","event","enableWxBetterTogether","loginOption","wxAppHooksApplied","usersubPublished","mercurySubscribed","telephonyTaskType","skipReason","deriveWxAppAcceptReason","isWxAppInboundOffer","isWxAppOutdialOffer","wxAppAcceptInFlight","wxAppAnswerPending","isWebrtc","isOutdial","hasDeviceCallId","logWxAppOfferDecision","interactionId","acceptVisible","acceptEnabled","acceptReason","wxAppParticipantDeviceType","logWxAppTelephonyAction","payload","action","phase","trackingId","httpStatus","failureReason","logWxAppValidationFailure","reason","logWxAppMercuryMuteSync","muted","dropReason"],"sources":["wxAppDiagnosticLogging.ts"],"sourcesContent":["import LoggerProxy from '../logger-proxy';\n\nexport const WXAPP_LOG_FEATURE = 'wxApp';\nexport const WXAPP_LOG_PREFIX = '[CC wxApp]';\n\nexport type WxAppAcceptReason =\n | 'wxApp_offer_ready'\n | 'wxApp_answer_pending'\n | 'wxApp_accept_in_flight'\n | 'extension_non_wxApp_offer'\n | 'browser_webrtc_offer'\n | 'outdial_auto_answer';\n\nexport type WxAppSessionSkipReason =\n | 'unsupported_browser_login'\n | 'flag_disabled'\n | 'mercury_subscribe_failed'\n | 'publish_failed';\n\nexport type WxAppTelephonyAction = 'accept' | 'decline' | 'mute' | 'dtmf';\nexport type WxAppTelephonyPhase = 'started' | 'success' | 'failed';\n\ntype WxAppLogData = Record<string, string | boolean | number | undefined>;\n\n/** Last 8 chars of callId for correlation without logging full id. */\nexport function callIdSuffix(callId: string | null | undefined): string | undefined {\n if (!callId) {\n return undefined;\n }\n\n return callId.length <= 8 ? callId : callId.slice(-8);\n}\n\nfunction logWxApp(message: string, method: string, data: WxAppLogData): void {\n LoggerProxy.info(`${WXAPP_LOG_PREFIX} ${message}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nfunction logWxAppError(message: string, method: string, data: WxAppLogData): void {\n LoggerProxy.error(`${WXAPP_LOG_PREFIX} ${message}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nexport function logWxAppSessionReadiness(params: {\n enableWxBetterTogether: boolean;\n loginOption: string | undefined;\n wxAppHooksApplied: boolean;\n usersubPublished: boolean;\n mercurySubscribed: boolean;\n telephonyTaskType: 'Voice' | 'WebRTC' | 'unknown';\n skipReason?: WxAppSessionSkipReason;\n}): void {\n logWxApp('session readiness', 'logWxAppSessionReadiness', {\n event: 'session_readiness',\n enableWxBetterTogether: params.enableWxBetterTogether,\n loginOption: params.loginOption,\n wxAppHooksApplied: params.wxAppHooksApplied,\n usersubPublished: params.usersubPublished,\n mercurySubscribed: params.mercurySubscribed,\n telephonyTaskType: params.telephonyTaskType,\n skipReason: params.skipReason,\n });\n}\n\nexport function deriveWxAppAcceptReason(params: {\n isWxAppInboundOffer: boolean;\n isWxAppOutdialOffer: boolean;\n isWebrtc: boolean;\n isOutdial: boolean;\n wxAppAcceptInFlight: boolean;\n wxAppAnswerPending: boolean;\n enableWxBetterTogether: boolean;\n hasDeviceCallId: boolean;\n}): WxAppAcceptReason {\n if (params.isWxAppInboundOffer || params.isWxAppOutdialOffer) {\n if (params.wxAppAcceptInFlight) {\n return 'wxApp_accept_in_flight';\n }\n if (params.wxAppAnswerPending) {\n return 'wxApp_answer_pending';\n }\n\n return 'wxApp_offer_ready';\n }\n\n if (params.isWebrtc && !params.isOutdial) {\n return 'browser_webrtc_offer';\n }\n\n if (params.isOutdial) {\n return 'outdial_auto_answer';\n }\n\n if (params.enableWxBetterTogether && !params.hasDeviceCallId) {\n return 'extension_non_wxApp_offer';\n }\n\n return 'extension_non_wxApp_offer';\n}\n\nexport function logWxAppOfferDecision(params: {\n interactionId: string;\n acceptVisible: boolean;\n acceptEnabled: boolean;\n acceptReason: WxAppAcceptReason;\n wxAppParticipantDeviceType?: string;\n hasDeviceCallId: boolean;\n}): void {\n logWxApp('offer decision', 'logWxAppOfferDecision', {\n event: 'offer_decision',\n interactionId: params.interactionId,\n acceptVisible: params.acceptVisible,\n acceptEnabled: params.acceptEnabled,\n acceptReason: params.acceptReason,\n wxAppParticipantDeviceType: params.wxAppParticipantDeviceType,\n hasDeviceCallId: params.hasDeviceCallId,\n });\n}\n\nexport function logWxAppTelephonyAction(params: {\n action: WxAppTelephonyAction;\n phase: WxAppTelephonyPhase;\n interactionId?: string;\n trackingId?: string;\n httpStatus?: number | string;\n failureReason?: string;\n}): void {\n const payload: WxAppLogData = {\n event: 'telephony_action',\n action: params.action,\n phase: params.phase,\n interactionId: params.interactionId,\n trackingId: params.trackingId,\n httpStatus: params.httpStatus,\n failureReason: params.failureReason,\n };\n\n if (params.phase === 'failed') {\n logWxAppError(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload);\n } else {\n logWxApp(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload);\n }\n}\n\nexport function logWxAppValidationFailure(reason: string, interactionId?: string): void {\n logWxAppError('validation failed', 'logWxAppValidationFailure', {\n event: 'validation_failed',\n reason,\n interactionId,\n });\n}\n\nexport function logWxAppMercuryMuteSync(params: {\n phase: 'received' | 'applied' | 'dropped';\n muted?: boolean;\n callIdSuffix?: string;\n interactionId?: string;\n dropReason?: string;\n}): void {\n logWxApp(`mercury mute sync ${params.phase}`, 'logWxAppMercuryMuteSync', {\n event: 'mercury_mute_sync',\n phase: params.phase,\n muted: params.muted,\n callIdSuffix: params.callIdSuffix,\n interactionId: params.interactionId,\n dropReason: params.dropReason,\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnC,MAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,OAAO;AACjC,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,YAAY;AAqB5C;AACO,SAASC,YAAYA,CAACC,MAAiC,EAAsB;EAClF,IAAI,CAACA,MAAM,EAAE;IACX,OAAOC,SAAS;EAClB;EAEA,OAAOD,MAAM,CAACE,MAAM,IAAI,CAAC,GAAGF,MAAM,GAAGA,MAAM,CAACG,KAAK,CAAC,CAAC,CAAC,CAAC;AACvD;AAEA,SAASC,QAAQA,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QAAQ,CAAC,aAAaW,MAAM,CAACyB,MAAM,IAAIzB,MAAM,CAAC0B,KAAK,EAAE,EAAE,yBAAyB,EAAEF,OAAO,CAAC;EAC5F;AACF;AAEO,SAASM,yBAAyBA,CAACC,MAAc,EAAEb,aAAsB,EAAQ;EACtFrB,aAAa,CAAC,mBAAmB,EAAE,2BAA2B,EAAE;IAC9DI,KAAK,EAAE,mBAAmB;IAC1B8B,MAAM;IACNb;EACF,CAAC,CAAC;AACJ;AAEO,SAASc,uBAAuBA,CAAChC,MAMvC,EAAQ;EACPX,QAAQ,CAAC,qBAAqBW,MAAM,CAAC0B,KAAK,EAAE,EAAE,yBAAyB,EAAE;IACvEzB,KAAK,EAAE,mBAAmB;IAC1ByB,KAAK,EAAE1B,MAAM,CAAC0B,KAAK;IACnBO,KAAK,EAAEjC,MAAM,CAACiC,KAAK;IACnBjD,YAAY,EAAEgB,MAAM,CAAChB,YAAY;IACjCkC,aAAa,EAAElB,MAAM,CAACkB,aAAa;IACnCgB,UAAU,EAAElC,MAAM,CAACkC;EACrB,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_loggerProxy","_interopRequireDefault","require","e","__esModule","default","WXAPP_LOG_FEATURE","exports","WXAPP_LOG_PREFIX","callIdSuffix","callId","undefined","length","slice","formatLogSuffix","data","keys","entries","map","key","Object","filter","parts","value","String","join","logWxApp","message","method","suffixKeys","suffix","LoggerProxy","log","module","feature","logWxAppWarn","warn","logWxAppError","error","logWxAppSessionReadiness","params","event","enableWxBetterTogether","loginOption","wxAppHooksApplied","usersubPublished","mercurySubscribed","telephonyTaskType","skipReason","deriveWxAppAcceptReason","isWxAppInboundOffer","isWxAppOutdialOffer","wxAppAcceptInFlight","wxAppAnswerPending","isWebrtc","isOutdial","hasDeviceCallId","logWxAppOfferDecision","interactionId","acceptVisible","acceptEnabled","acceptReason","wxAppParticipantDeviceType","hasDeviceId","logWxAppOfferParticipantMismatch","participantDeviceType","logWxAppTelephonyAction","payload","action","phase","trackingId","httpStatus","failureReason","logWxAppValidationFailure","reason","logWxAppMercuryMuteSync","muted","dropReason"],"sources":["wxAppDiagnosticLogging.ts"],"sourcesContent":["import LoggerProxy from '../logger-proxy';\n\nexport const WXAPP_LOG_FEATURE = 'wxApp';\nexport const WXAPP_LOG_PREFIX = '[CC wxApp]';\n\nexport type WxAppAcceptReason =\n | 'wxApp_offer_ready'\n | 'wxApp_answer_pending'\n | 'wxApp_accept_in_flight'\n | 'extension_non_wxApp_offer'\n | 'browser_webrtc_offer'\n | 'outdial_auto_answer';\n\nexport type WxAppSessionSkipReason =\n | 'unsupported_browser_login'\n | 'flag_disabled'\n | 'mercury_subscribe_failed'\n | 'publish_failed';\n\nexport type WxAppTelephonyAction = 'accept' | 'decline' | 'mute' | 'dtmf';\nexport type WxAppTelephonyPhase = 'started' | 'success' | 'failed';\n\ntype WxAppLogData = Record<string, string | boolean | number | undefined>;\n\n/** Last 8 chars of callId for correlation without logging full id. */\nexport function callIdSuffix(callId: string | null | undefined): string | undefined {\n if (!callId) {\n return undefined;\n }\n\n return callId.length <= 8 ? callId : callId.slice(-8);\n}\n\nfunction formatLogSuffix(data: WxAppLogData, keys?: string[]): string {\n const entries = keys\n ? keys.map((key) => [key, data[key]] as const)\n : Object.entries(data).filter(([key]) => key !== 'feature' && key !== 'event');\n\n const parts = entries\n .filter(([, value]) => value !== undefined && value !== null && value !== '')\n .map(([key, value]) => `${key}=${String(value)}`);\n\n return parts.length > 0 ? ` ${parts.join(' ')}` : '';\n}\n\nfunction logWxApp(\n message: string,\n method: string,\n data: WxAppLogData,\n suffixKeys?: string[]\n): void {\n const suffix = formatLogSuffix(data, suffixKeys);\n LoggerProxy.log(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nfunction logWxAppWarn(\n message: string,\n method: string,\n data: WxAppLogData,\n suffixKeys?: string[]\n): void {\n const suffix = formatLogSuffix(data, suffixKeys);\n LoggerProxy.warn(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nfunction logWxAppError(\n message: string,\n method: string,\n data: WxAppLogData,\n suffixKeys?: string[]\n): void {\n const suffix = formatLogSuffix(data, suffixKeys);\n LoggerProxy.error(`${WXAPP_LOG_PREFIX} ${message}${suffix}`, {\n module: 'wxAppDiagnosticLogging',\n method,\n data: {feature: WXAPP_LOG_FEATURE, ...data},\n });\n}\n\nexport function logWxAppSessionReadiness(params: {\n enableWxBetterTogether: boolean;\n loginOption: string | undefined;\n wxAppHooksApplied: boolean;\n usersubPublished: boolean;\n mercurySubscribed: boolean;\n telephonyTaskType: 'Voice' | 'WebRTC' | 'unknown';\n skipReason?: WxAppSessionSkipReason;\n}): void {\n const data: WxAppLogData = {\n event: 'session_readiness',\n enableWxBetterTogether: params.enableWxBetterTogether,\n loginOption: params.loginOption,\n wxAppHooksApplied: params.wxAppHooksApplied,\n usersubPublished: params.usersubPublished,\n mercurySubscribed: params.mercurySubscribed,\n telephonyTaskType: params.telephonyTaskType,\n skipReason: params.skipReason,\n };\n\n logWxApp('session readiness', 'logWxAppSessionReadiness', data, [\n 'usersubPublished',\n 'mercurySubscribed',\n 'loginOption',\n 'enableWxBetterTogether',\n 'telephonyTaskType',\n 'skipReason',\n ]);\n}\n\nexport function deriveWxAppAcceptReason(params: {\n isWxAppInboundOffer: boolean;\n isWxAppOutdialOffer: boolean;\n isWebrtc: boolean;\n isOutdial: boolean;\n wxAppAcceptInFlight: boolean;\n wxAppAnswerPending: boolean;\n enableWxBetterTogether: boolean;\n hasDeviceCallId: boolean;\n}): WxAppAcceptReason {\n if (params.isWxAppInboundOffer || params.isWxAppOutdialOffer) {\n if (params.wxAppAcceptInFlight) {\n return 'wxApp_accept_in_flight';\n }\n if (params.wxAppAnswerPending) {\n return 'wxApp_answer_pending';\n }\n\n return 'wxApp_offer_ready';\n }\n\n if (params.isWebrtc && !params.isOutdial) {\n return 'browser_webrtc_offer';\n }\n\n if (params.isOutdial) {\n return 'outdial_auto_answer';\n }\n\n if (params.enableWxBetterTogether && !params.hasDeviceCallId) {\n return 'extension_non_wxApp_offer';\n }\n\n return 'extension_non_wxApp_offer';\n}\n\nexport function logWxAppOfferDecision(params: {\n interactionId: string;\n acceptVisible: boolean;\n acceptEnabled: boolean;\n acceptReason: WxAppAcceptReason;\n wxAppParticipantDeviceType?: string;\n hasDeviceCallId: boolean;\n hasDeviceId?: boolean;\n usersubPublished?: boolean;\n}): void {\n const data: WxAppLogData = {\n event: 'offer_decision',\n interactionId: params.interactionId,\n acceptVisible: params.acceptVisible,\n acceptEnabled: params.acceptEnabled,\n acceptReason: params.acceptReason,\n wxAppParticipantDeviceType: params.wxAppParticipantDeviceType,\n hasDeviceCallId: params.hasDeviceCallId,\n hasDeviceId: params.hasDeviceId,\n usersubPublished: params.usersubPublished,\n };\n\n logWxApp('offer decision', 'logWxAppOfferDecision', data, [\n 'acceptReason',\n 'hasDeviceCallId',\n 'hasDeviceId',\n 'usersubPublished',\n 'interactionId',\n 'acceptVisible',\n 'acceptEnabled',\n ]);\n}\n\nexport function logWxAppOfferParticipantMismatch(params: {\n interactionId: string;\n usersubPublished: boolean;\n hasDeviceCallId: boolean;\n hasDeviceId: boolean;\n participantDeviceType?: string;\n acceptVisible: boolean;\n acceptEnabled: boolean;\n acceptReason: WxAppAcceptReason;\n}): void {\n const data: WxAppLogData = {\n event: 'participant_fields_mismatch',\n interactionId: params.interactionId,\n usersubPublished: params.usersubPublished,\n hasDeviceCallId: params.hasDeviceCallId,\n hasDeviceId: params.hasDeviceId,\n participantDeviceType: params.participantDeviceType ?? 'missing',\n acceptVisible: params.acceptVisible,\n acceptEnabled: params.acceptEnabled,\n acceptReason: params.acceptReason,\n };\n\n logWxAppWarn('participant fields mismatch', 'logWxAppOfferParticipantMismatch', data, [\n 'usersubPublished',\n 'hasDeviceCallId',\n 'hasDeviceId',\n 'acceptReason',\n 'interactionId',\n 'participantDeviceType',\n ]);\n}\n\nexport function logWxAppTelephonyAction(params: {\n action: WxAppTelephonyAction;\n phase: WxAppTelephonyPhase;\n interactionId?: string;\n trackingId?: string;\n httpStatus?: number | string;\n failureReason?: string;\n}): void {\n const payload: WxAppLogData = {\n event: 'telephony_action',\n action: params.action,\n phase: params.phase,\n interactionId: params.interactionId,\n trackingId: params.trackingId,\n httpStatus: params.httpStatus,\n failureReason: params.failureReason,\n };\n\n if (params.phase === 'failed') {\n logWxAppError(\n `telephony ${params.action} ${params.phase}`,\n 'logWxAppTelephonyAction',\n payload,\n ['interactionId', 'trackingId', 'httpStatus', 'failureReason']\n );\n } else {\n logWxApp(`telephony ${params.action} ${params.phase}`, 'logWxAppTelephonyAction', payload, [\n 'interactionId',\n 'action',\n 'phase',\n ]);\n }\n}\n\nexport function logWxAppValidationFailure(reason: string, interactionId?: string): void {\n logWxAppError(\n 'validation failed',\n 'logWxAppValidationFailure',\n {\n event: 'validation_failed',\n reason,\n interactionId,\n },\n ['reason', 'interactionId']\n );\n}\n\nexport function logWxAppMercuryMuteSync(params: {\n phase: 'received' | 'applied' | 'dropped';\n muted?: boolean;\n callIdSuffix?: string;\n interactionId?: string;\n dropReason?: string;\n}): void {\n logWxApp(\n `mercury mute sync ${params.phase}`,\n 'logWxAppMercuryMuteSync',\n {\n event: 'mercury_mute_sync',\n phase: params.phase,\n muted: params.muted,\n callIdSuffix: params.callIdSuffix,\n interactionId: params.interactionId,\n dropReason: params.dropReason,\n },\n ['phase', 'muted', 'callIdSuffix', 'interactionId', 'dropReason']\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnC,MAAMG,iBA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AAC4B,MAAM,IAAI5B,MAAM,CAAC6B,KAAK,EAAE,EAC5C,yBAAyB,EACzBF,OAAO,EACP,CAAC,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAC/D,CAAC;EACH,CAAC,MAAM;IACLzC,QAAQ,CAAC,aAAac,MAAM,CAAC4B,MAAM,IAAI5B,MAAM,CAAC6B,KAAK,EAAE,EAAE,yBAAyB,EAAEF,OAAO,EAAE,CACzF,eAAe,EACf,QAAQ,EACR,OAAO,CACR,CAAC;EACJ;AACF;AAEO,SAASM,yBAAyBA,CAACC,MAAc,EAAEhB,aAAsB,EAAQ;EACtFrB,aAAa,CACX,mBAAmB,EACnB,2BAA2B,EAC3B;IACEI,KAAK,EAAE,mBAAmB;IAC1BiC,MAAM;IACNhB;EACF,CAAC,EACD,CAAC,QAAQ,EAAE,eAAe,CAC5B,CAAC;AACH;AAEO,SAASiB,uBAAuBA,CAACnC,MAMvC,EAAQ;EACPd,QAAQ,CACN,qBAAqBc,MAAM,CAAC6B,KAAK,EAAE,EACnC,yBAAyB,EACzB;IACE5B,KAAK,EAAE,mBAAmB;IAC1B4B,KAAK,EAAE7B,MAAM,CAAC6B,KAAK;IACnBO,KAAK,EAAEpC,MAAM,CAACoC,KAAK;IACnBnE,YAAY,EAAE+B,MAAM,CAAC/B,YAAY;IACjCiD,aAAa,EAAElB,MAAM,CAACkB,aAAa;IACnCmB,UAAU,EAAErC,MAAM,CAACqC;EACrB,CAAC,EACD,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,CAClE,CAAC;AACH","ignoreList":[]}
|
package/dist/types/cc.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { WebexPlugin } from '@webex/webex-core';
|
|
|
9
9
|
import { SetStateResponse, IContactCenter, AgentLogin, AgentProfileUpdate, StationLoginResponse, StationLogoutResponse, BuddyAgentsResponse, BuddyAgents, UploadLogsResponse, UpdateDeviceTypeResponse } from './types';
|
|
10
10
|
import LoggerProxy from './logger-proxy';
|
|
11
11
|
import { StateChange, Logout } from './services/agent/types';
|
|
12
|
-
import { Profile, OutdialAniEntriesResponse, OutdialAniParams } from './services/config/types';
|
|
12
|
+
import { Profile, OutdialAniEntriesResponse, OutdialAniParams, Entity } from './services/config/types';
|
|
13
13
|
import { TaskResponse, PreviewContactPayload } from './services/task/types';
|
|
14
14
|
import { AddressBook } from './services/AddressBook';
|
|
15
15
|
import { Queue } from './services/Queue';
|
|
@@ -213,6 +213,13 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
213
213
|
* @private
|
|
214
214
|
*/
|
|
215
215
|
private metricsManager;
|
|
216
|
+
/** Current login/relogin session used for agent-scoped wellness validation. */
|
|
217
|
+
private currentAgentSessionId?;
|
|
218
|
+
/** Registered-session cache for the system WellbeingBreak idle code. */
|
|
219
|
+
private wellbeingBreakIdleCode?;
|
|
220
|
+
/** Registration generation that owns the wellness idle-code cache and in-flight lookups. */
|
|
221
|
+
private wellnessRegistrationGeneration;
|
|
222
|
+
private updateWellnessSession;
|
|
216
223
|
/**
|
|
217
224
|
* API instance for managing Webex Contact Center entry points
|
|
218
225
|
* Provides functionality to fetch entry points with caching support
|
|
@@ -354,6 +361,9 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
354
361
|
* @param {ITask} task The campaign reservation task
|
|
355
362
|
*/
|
|
356
363
|
private handleCampaignPreviewReservation;
|
|
364
|
+
private trackInvalidWellnessEvent;
|
|
365
|
+
private normalizeWellnessBreakEvent;
|
|
366
|
+
private handleWellnessBreakWebsocketPayload;
|
|
357
367
|
private handleRTDWebsocketMessage;
|
|
358
368
|
/**
|
|
359
369
|
* Sets up event listeners for incoming tasks and task hydration
|
|
@@ -577,6 +587,16 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
|
|
|
577
587
|
* ```
|
|
578
588
|
*/
|
|
579
589
|
setAgentState(data: StateChange): Promise<SetStateResponse>;
|
|
590
|
+
/**
|
|
591
|
+
* Returns the system-managed `WellbeingBreak` idle code for the current registration.
|
|
592
|
+
* The value is fetched outside Desktop Profile filtering and cached until deregistration.
|
|
593
|
+
* @returns The normalized system idle-code entity
|
|
594
|
+
* @throws Structured Contact Center error when wellness is disabled or the code is unavailable
|
|
595
|
+
* @example
|
|
596
|
+
* const idleCode = await webex.cc.getWellbeingBreakIdleCode();
|
|
597
|
+
* @public
|
|
598
|
+
*/
|
|
599
|
+
getWellbeingBreakIdleCode(): Promise<Entity>;
|
|
580
600
|
/**
|
|
581
601
|
* Processes incoming websocket messages and emits corresponding events
|
|
582
602
|
* Handles various event types including agent state changes, login events,
|
|
@@ -7,6 +7,7 @@ export declare const LOG_PREFIX = "PLUGIN_CC";
|
|
|
7
7
|
export declare const WEB_CALLING_SERVICE_FILE = "WebCallingService";
|
|
8
8
|
export declare const CONFIG_FILE_NAME = "config-index";
|
|
9
9
|
export declare const CC_FILE = "cc";
|
|
10
|
+
export declare const WELLNESS_BREAK_HANDLER = "Wellness_Break_Handler";
|
|
10
11
|
export declare const CONNECTION_SERVICE_FILE = "connection-service";
|
|
11
12
|
export declare const WEB_SOCKET_MANAGER_FILE = "WebSocketManager";
|
|
12
13
|
export declare const AQM_REQS_FILE = "aqm-reqs";
|
|
@@ -66,6 +67,9 @@ export declare const METHODS: {
|
|
|
66
67
|
GET_REAL_TIME_ASSISTANCE: string;
|
|
67
68
|
SEND_REAL_TIME_ASSISTANCE_USER_ACTION: string;
|
|
68
69
|
FETCH_HISTORIC_TRANSCRIPTS: string;
|
|
70
|
+
REQUEST_WELLNESS_BREAK: string;
|
|
71
|
+
RESPOND_TO_WELLNESS_BREAK: string;
|
|
72
|
+
GET_WELLBEING_BREAK_IDLE_CODE: string;
|
|
69
73
|
SET_MANAGE_WEBEX_CALLING_IN_WXCC: string;
|
|
70
74
|
IS_WX_BETTER_TOGETHER_ENABLED: string;
|
|
71
75
|
SYNC_WXAPP_MUTE_FROM_MERCURY: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export { default as Task } from './services/task/Task';
|
|
|
22
22
|
export { default as AddressBook } from './services/AddressBook';
|
|
23
23
|
export { default as ApiAIAssistant } from './services/ApiAiAssistant';
|
|
24
24
|
export { default as UserPreference } from './services/UserPreference';
|
|
25
|
+
/** Agent Wellness Break notification and action wire values. */
|
|
26
|
+
export { WELLNESS_BREAK_NOTIFICATION_ACTIONS, WELLNESS_BREAK_USER_ACTIONS } from './types';
|
|
25
27
|
/** EntryPoint API types */
|
|
26
28
|
export type { EntryPointRecord, EntryPointListResponse, EntryPointSearchParams, AddressBookEntry, AddressBookEntriesResponse, AddressBookEntrySearchParams, ContactServiceQueuesResponse, ContactServiceQueueSearchParams, ContactServiceQueue, } from './types';
|
|
27
29
|
/**
|
|
@@ -90,7 +92,15 @@ UpdateDeviceTypeResponse,
|
|
|
90
92
|
/** Generic error interface */
|
|
91
93
|
GenericError,
|
|
92
94
|
/** Set state response */
|
|
93
|
-
SetStateResponse,
|
|
95
|
+
SetStateResponse,
|
|
96
|
+
/** Wellness notification action */
|
|
97
|
+
WellnessBreakNotificationAction,
|
|
98
|
+
/** Wellness action API value */
|
|
99
|
+
WellnessBreakUserAction,
|
|
100
|
+
/** Validated agent-scoped wellness notification */
|
|
101
|
+
WellnessBreakEvent,
|
|
102
|
+
/** Wellness offer-response parameters */
|
|
103
|
+
RespondToWellnessBreakParams, } from './types';
|
|
94
104
|
/** Task related types */
|
|
95
105
|
export type { AgentContact,
|
|
96
106
|
/** Event emitter contract for task consumers (no @types/node needed) */
|
|
@@ -145,6 +145,7 @@ export declare const METRIC_EVENT_NAMES: {
|
|
|
145
145
|
readonly WXAPP_USERSUB_PUBLISH_FAILED: "WxApp Usersub Publish Failed";
|
|
146
146
|
readonly WXAPP_MERCURY_SUBSCRIBE_SUCCESS: "WxApp Mercury Subscribe Success";
|
|
147
147
|
readonly WXAPP_MERCURY_SUBSCRIBE_FAILED: "WxApp Mercury Subscribe Failed";
|
|
148
|
+
readonly WXAPP_OFFER_PARTICIPANT_FIELDS_MISSING: "WxApp Offer Participant Fields Missing";
|
|
148
149
|
readonly UPLOAD_LOGS_SUCCESS: "Upload Logs Success";
|
|
149
150
|
readonly UPLOAD_LOGS_FAILED: "Upload Logs Failed";
|
|
150
151
|
readonly WEBSOCKET_DEREGISTER_SUCCESS: "Websocket Deregister Success";
|
|
@@ -174,6 +175,11 @@ export declare const METRIC_EVENT_NAMES: {
|
|
|
174
175
|
readonly AI_ASSISTANT_SEND_REAL_TIME_ASSISTANCE_USER_ACTION_FAILED: "AI Assistant Send Real Time Assistance User Action Failed";
|
|
175
176
|
readonly AI_ASSISTANT_FETCH_HISTORIC_TRANSCRIPTS_SUCCESS: "AI Assistant Fetch Historic Transcripts Success";
|
|
176
177
|
readonly AI_ASSISTANT_FETCH_HISTORIC_TRANSCRIPTS_FAILED: "AI Assistant Fetch Historic Transcripts Failed";
|
|
178
|
+
readonly AI_ASSISTANT_WELLNESS_ACTION_ACCEPTED: "AI Assistant Wellness Action Accepted";
|
|
179
|
+
readonly AI_ASSISTANT_WELLNESS_ACTION_FAILED: "AI Assistant Wellness Action Failed";
|
|
180
|
+
readonly AI_ASSISTANT_WELLNESS_EVENT_INVALID: "AI Assistant Wellness Event Invalid";
|
|
181
|
+
readonly WELLBEING_BREAK_IDLE_CODE_FETCH_SUCCESS: "Wellbeing Break Idle Code Fetch Success";
|
|
182
|
+
readonly WELLBEING_BREAK_IDLE_CODE_FETCH_FAILED: "Wellbeing Break Idle Code Fetch Failed";
|
|
177
183
|
readonly USER_PREFERENCE_GET_SUCCESS: "User Preference Get Success";
|
|
178
184
|
readonly USER_PREFERENCE_GET_FAILED: "User Preference Get Failed";
|
|
179
185
|
readonly USER_PREFERENCE_CREATE_SUCCESS: "User Preference Create Success";
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { WebexSDK, AIAssistantEventType, AIAssistantEventName, HistoricTranscriptsResponse, RealTimeAssistanceParams, RealTimeAssistanceUserActionParams } from '../types';
|
|
1
|
+
import { WebexSDK, AIAssistantEventType, AIAssistantEventName, HistoricTranscriptsResponse, RealTimeAssistanceParams, RealTimeAssistanceUserActionParams, RespondToWellnessBreakParams } from '../types';
|
|
2
2
|
import { AIFeatureFlags } from './config/types';
|
|
3
|
+
type WellnessBreakContextProvider = () => {
|
|
4
|
+
isWellnessBreakEnabled: boolean;
|
|
5
|
+
agentId?: string;
|
|
6
|
+
agentSessionId?: string;
|
|
7
|
+
};
|
|
3
8
|
/**
|
|
4
9
|
* ApiAIAssistant provides AI Assistant APIs for transcript controls.
|
|
5
10
|
* @public
|
|
@@ -8,8 +13,36 @@ export declare class ApiAIAssistant {
|
|
|
8
13
|
private webex;
|
|
9
14
|
private metricsManager;
|
|
10
15
|
private aiFeature;
|
|
11
|
-
|
|
16
|
+
private readonly wellnessContextProvider?;
|
|
17
|
+
private createWellnessError;
|
|
18
|
+
constructor(webex: WebexSDK, wellnessContextProvider?: WellnessBreakContextProvider);
|
|
12
19
|
setAIFeatureFlags(aiFeature: AIFeatureFlags): void;
|
|
20
|
+
private sendWellnessBreakAction;
|
|
21
|
+
/**
|
|
22
|
+
* Requests an Agent Wellness Break.
|
|
23
|
+
* The promise resolves when the HTTP request is accepted with status 202; the later
|
|
24
|
+
* approval or denial is delivered independently through a wellness notification.
|
|
25
|
+
* @returns A promise that resolves with no value after HTTP acceptance
|
|
26
|
+
* @throws Structured Contact Center error when disabled, stale, invalid, or delivery fails
|
|
27
|
+
* @example
|
|
28
|
+
* await webex.cc.apiAIAssistant.requestWellnessBreak();
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
requestWellnessBreak(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Responds to a backend-provided Agent Wellness Break offer.
|
|
34
|
+
* The promise resolves when the HTTP request is accepted with status 202 and does not
|
|
35
|
+
* wait for a WebSocket completion event.
|
|
36
|
+
* @param params - ACCEPTED, REJECTED, or NO_RESPONSE
|
|
37
|
+
* @returns A promise that resolves with no value after HTTP acceptance
|
|
38
|
+
* @throws Structured Contact Center error when disabled, stale, invalid, or delivery fails
|
|
39
|
+
* @example
|
|
40
|
+
* await webex.cc.apiAIAssistant.respondToWellnessBreak({
|
|
41
|
+
* action: WELLNESS_BREAK_USER_ACTIONS.ACCEPTED,
|
|
42
|
+
* });
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
respondToWellnessBreak(params: RespondToWellnessBreakParams): Promise<void>;
|
|
13
46
|
private getBaseUrl;
|
|
14
47
|
/**
|
|
15
48
|
* Sends an event to the AI Assistant service.
|
|
@@ -28,6 +28,8 @@ export declare const AGENT_STATE_AVAILABLE_ID = "0";
|
|
|
28
28
|
* @ignore
|
|
29
29
|
*/
|
|
30
30
|
export declare const AGENT_STATE_AVAILABLE = "Available";
|
|
31
|
+
/** System idle-code name reserved for Agent Wellness Break. */
|
|
32
|
+
export declare const WELLBEING_BREAK_IDLE_CODE = "WellbeingBreak";
|
|
31
33
|
/**
|
|
32
34
|
* Description for the 'Available' agent state.
|
|
33
35
|
* @type {string}
|
|
@@ -58,6 +60,7 @@ export declare const METHODS: {
|
|
|
58
60
|
GET_URL_MAPPING: string;
|
|
59
61
|
GET_DIAL_PLAN_DATA: string;
|
|
60
62
|
GET_AI_FEATURE_FLAGS: string;
|
|
63
|
+
GET_WELLBEING_BREAK_IDLE_CODE: string;
|
|
61
64
|
GET_QUEUES: string;
|
|
62
65
|
PARSE_AGENT_CONFIGS: string;
|
|
63
66
|
GET_URL_MAPPING_UTIL: string;
|
|
@@ -135,6 +138,8 @@ export declare const endPointMap: {
|
|
|
135
138
|
* @ignore
|
|
136
139
|
*/
|
|
137
140
|
listAuxCodes: (orgId: string, page: number, pageSize: number, filter: string[], attributes: string[]) => string;
|
|
141
|
+
/** Lists system idle codes without applying the agent Desktop Profile filter. */
|
|
142
|
+
systemIdleCodes: (orgId: string, page: number, pageSize: number) => string;
|
|
138
143
|
/**
|
|
139
144
|
* Gets the endpoint for organization info.
|
|
140
145
|
* @param orgId - Organization ID.
|
|
@@ -141,8 +141,7 @@ export declare const CC_TASK_EVENTS: {
|
|
|
141
141
|
/**
|
|
142
142
|
* Events emitted on Contact Center agent operations
|
|
143
143
|
* @enum {string}
|
|
144
|
-
* @
|
|
145
|
-
* @ignore
|
|
144
|
+
* @public
|
|
146
145
|
*/
|
|
147
146
|
export declare const CC_AGENT_EVENTS: {
|
|
148
147
|
/** Welcome event when agent connects to websocket/backend */
|
|
@@ -181,6 +180,8 @@ export declare const CC_AGENT_EVENTS: {
|
|
|
181
180
|
readonly AGENT_BUDDY_AGENTS_RETRIEVE_FAILED: "BuddyAgentsRetrieveFailed";
|
|
182
181
|
/** Event emitted when contact is reserved for agent */
|
|
183
182
|
readonly AGENT_CONTACT_RESERVED: "AgentContactReserved";
|
|
183
|
+
/** Agent-level Agent Wellness Break notification */
|
|
184
|
+
readonly WELLNESS_BREAK: "WellnessBreak";
|
|
184
185
|
};
|
|
185
186
|
/**
|
|
186
187
|
* Combined Contact Center events including both agent and task events
|
|
@@ -352,6 +353,8 @@ export declare const CC_EVENTS: {
|
|
|
352
353
|
readonly AGENT_BUDDY_AGENTS_RETRIEVE_FAILED: "BuddyAgentsRetrieveFailed";
|
|
353
354
|
/** Event emitted when contact is reserved for agent */
|
|
354
355
|
readonly AGENT_CONTACT_RESERVED: "AgentContactReserved";
|
|
356
|
+
/** Agent-level Agent Wellness Break notification */
|
|
357
|
+
readonly WELLNESS_BREAK: "WellnessBreak";
|
|
355
358
|
};
|
|
356
359
|
/**
|
|
357
360
|
* Event data received when agent connects to the system
|
|
@@ -800,6 +803,8 @@ export type OrgSettings = {
|
|
|
800
803
|
maskSensitiveData: boolean;
|
|
801
804
|
/** Whether campaign manager features are enabled */
|
|
802
805
|
campaignManagerEnabled: boolean;
|
|
806
|
+
/** Number of AI Assistant licenses assigned to the organization */
|
|
807
|
+
aiAssistantQuantity?: number | null;
|
|
803
808
|
};
|
|
804
809
|
/**
|
|
805
810
|
* Contact center site configuration information
|
|
@@ -1266,6 +1271,8 @@ export type Profile = {
|
|
|
1266
1271
|
maskSensitiveData?: boolean;
|
|
1267
1272
|
/** Whether agent is currently logged in */
|
|
1268
1273
|
isAgentLoggedIn?: boolean;
|
|
1274
|
+
/** Active station session after a successful registered relogin. */
|
|
1275
|
+
agentSessionId?: string;
|
|
1269
1276
|
/** Last auxiliary code ID used for state change */
|
|
1270
1277
|
lastStateAuxCodeId?: string;
|
|
1271
1278
|
/** Timestamp of last state change */
|
|
@@ -1274,6 +1281,12 @@ export type Profile = {
|
|
|
1274
1281
|
lastIdleCodeChangeTimestamp?: number;
|
|
1275
1282
|
/** AI feature flags resolved from organization config */
|
|
1276
1283
|
aiFeature?: AIFeatureFlags;
|
|
1284
|
+
/**
|
|
1285
|
+
* Whether Agent Wellness Break is effectively enabled for this profile.
|
|
1286
|
+
* This combines the organization wellbeing configuration with AI Assistant licensing;
|
|
1287
|
+
* Server-side rollout remains enforced by the backend configuration and notification delivery.
|
|
1288
|
+
*/
|
|
1289
|
+
isWellnessBreakEnabled?: boolean;
|
|
1277
1290
|
};
|
|
1278
1291
|
/**
|
|
1279
1292
|
* Contact distribution group configuration for routing logic
|
|
@@ -3,6 +3,8 @@ import { LoginOption, WebexRequestPayload } from '../../types';
|
|
|
3
3
|
import { Failure, AugmentedError } from './GlobalTypes';
|
|
4
4
|
import { ConsultConferenceData, consultConferencePayloadData, ConsultTransferDestinationType, TaskData, Interaction } from '../task/types';
|
|
5
5
|
import { DialPlan } from '../config/types';
|
|
6
|
+
/** Returns whether a value is a non-null object with string keys. */
|
|
7
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
6
8
|
/**
|
|
7
9
|
* Strips characters defined in the dial plan entry from the input string.
|
|
8
10
|
*
|
|
@@ -1846,6 +1846,8 @@ export type VoiceUIControlOptions = {
|
|
|
1846
1846
|
enableWxBetterTogether?: boolean;
|
|
1847
1847
|
consultTransferConfig?: ConsultTransferDestinationConfig;
|
|
1848
1848
|
answerCallOnWebexService?: import('../AnswerCallOnWebexService').default;
|
|
1849
|
+
/** Read-only observability: whether usersub answer-calls-on-wxcc is active this session. */
|
|
1850
|
+
getUsersubPublished?: () => boolean;
|
|
1849
1851
|
};
|
|
1850
1852
|
/**
|
|
1851
1853
|
* Participant information for UI display
|
|
@@ -14,7 +14,9 @@ export default class Voice extends Task implements IVoice {
|
|
|
14
14
|
private wxAppMuteSyncInFlight?;
|
|
15
15
|
private wxAppMuteToggleTail;
|
|
16
16
|
private wxAppDtmfTail;
|
|
17
|
-
|
|
17
|
+
/** Lazy — `super()` may call `updateUiControls` before field initializers run. */
|
|
18
|
+
private wxAppOfferObservability;
|
|
19
|
+
private getUsersubPublished?;
|
|
18
20
|
constructor(contact: ReturnType<typeof routingContact>, data: TaskData, callOptions?: VoiceUIControlOptions, wrapupData?: WrapupData, agentId?: string);
|
|
19
21
|
private getWxAppVoiceDependencies;
|
|
20
22
|
/** @deprecated Use {@link Voice.getWxAppVoiceDependencies} */
|
|
@@ -24,8 +26,18 @@ export default class Voice extends Task implements IVoice {
|
|
|
24
26
|
private setWxAppAnswerPending;
|
|
25
27
|
private setWxAppAcceptInFlight;
|
|
26
28
|
setEnableWxBetterTogether(enabled: boolean): void;
|
|
29
|
+
private getOrCreateWxAppOfferObservability;
|
|
27
30
|
protected updateUiControls(forceEmit?: boolean): void;
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Re-run OFFERED wxApp diagnostics without emitting UI controls.
|
|
33
|
+
* Used after usersub publish so a pre-publish offer can schedule mismatch grace.
|
|
34
|
+
*/
|
|
35
|
+
refreshWxAppOfferObservability(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Cancel pending participant-mismatch grace timer. Observability only.
|
|
38
|
+
*/
|
|
39
|
+
disposeWxAppOfferObservability(): void;
|
|
40
|
+
private getWxAppOfferObservabilityContext;
|
|
29
41
|
applyWxAppMuteStateFromSync(incomingCallId: string, muted: boolean): void;
|
|
30
42
|
getWxAppMuted(): boolean;
|
|
31
43
|
private static delay;
|
|
@@ -40,6 +52,7 @@ export default class Voice extends Task implements IVoice {
|
|
|
40
52
|
getWebexCallingCallId(): string | null;
|
|
41
53
|
private createWxAppLifecycle;
|
|
42
54
|
private getStateMachineSnapshot;
|
|
55
|
+
private getWxAppAcceptReasonForMetrics;
|
|
43
56
|
/**
|
|
44
57
|
* Accepts the task. Routes to wxApp telephony answer when `enableWxBetterTogether` and wxApp offer.
|
|
45
58
|
*/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import MetricsManager from '../../../metrics/MetricsManager';
|
|
2
|
+
import { TaskState } from '../state-machine';
|
|
3
|
+
import { VoiceVariant } from '../types';
|
|
4
|
+
import { WxAppVoiceDependencies } from './wxAppVoiceMethods';
|
|
5
|
+
/** Defer mismatch WARN/metric so transient WS ordering gaps (~200–300 ms) do not false-alarm. */
|
|
6
|
+
export declare const WXAPP_PARTICIPANT_MISMATCH_GRACE_MS = 500;
|
|
7
|
+
export type WxAppOfferObservabilityContext = {
|
|
8
|
+
getInteractionId: () => string;
|
|
9
|
+
getTaskState: () => TaskState | undefined;
|
|
10
|
+
getAcceptControl: () => {
|
|
11
|
+
isVisible: boolean;
|
|
12
|
+
isEnabled: boolean;
|
|
13
|
+
} | undefined;
|
|
14
|
+
getVoiceVariant: () => VoiceVariant;
|
|
15
|
+
isOutdial: () => boolean;
|
|
16
|
+
isWxAppInboundOffer: () => boolean;
|
|
17
|
+
isWxAppCallingOffer: () => boolean;
|
|
18
|
+
getWxAppAcceptInFlight: () => boolean;
|
|
19
|
+
getWxAppAnswerPending: () => boolean;
|
|
20
|
+
getEnableWxBetterTogether: () => boolean;
|
|
21
|
+
getUsersubPublished: () => boolean;
|
|
22
|
+
getWxAppVoiceDependencies: () => WxAppVoiceDependencies;
|
|
23
|
+
getMetricsManager: () => MetricsManager;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* OFFERED-state wxApp offer diagnostics: acceptReason logging and deferred participant mismatch.
|
|
27
|
+
* Invoked from Voice.updateUiControls — observability only.
|
|
28
|
+
*/
|
|
29
|
+
export declare class WxAppOfferObservability {
|
|
30
|
+
private lastLoggedWxAppAcceptReason?;
|
|
31
|
+
private lastLoggedWxAppParticipantMismatch;
|
|
32
|
+
private wxAppParticipantMismatchGraceTimer?;
|
|
33
|
+
private disposed;
|
|
34
|
+
handleUiControlsUpdate(ctx: WxAppOfferObservabilityContext): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
private cancelGraceTimer;
|
|
37
|
+
private scheduleGraceTimer;
|
|
38
|
+
private emitParticipantMismatchIfStillNeeded;
|
|
39
|
+
}
|
|
@@ -3,6 +3,7 @@ import { TaskData, TaskToggleMuteOptions, TaskTransmitDtmfOptions } from '../typ
|
|
|
3
3
|
import { TaskState } from '../state-machine';
|
|
4
4
|
import MetricsManager from '../../../metrics/MetricsManager';
|
|
5
5
|
import { WebexCallingDeviceDetails } from '../WebexCallingUtils';
|
|
6
|
+
import { type WxAppAcceptReason } from '../../wxAppDiagnosticLogging';
|
|
6
7
|
export type WxAppVoiceDependencies = {
|
|
7
8
|
enableWxBetterTogether: boolean;
|
|
8
9
|
answerCallOnWebexService?: AnswerCallOnWebexService;
|
|
@@ -12,6 +13,14 @@ export type WxAppVoiceDependencies = {
|
|
|
12
13
|
getTaskState: () => TaskState | undefined;
|
|
13
14
|
getWxAppMuted: () => boolean;
|
|
14
15
|
setWxAppMuted: (muted: boolean) => void;
|
|
16
|
+
/** Read-only observability: whether usersub answer-calls-on-wxcc is active this session. */
|
|
17
|
+
getUsersubPublished?: () => boolean;
|
|
18
|
+
};
|
|
19
|
+
export type WxAppParticipantDiagnostics = {
|
|
20
|
+
participantDeviceType?: string;
|
|
21
|
+
hasDeviceCallId: boolean;
|
|
22
|
+
hasDeviceId: boolean;
|
|
23
|
+
hasValidWxAppParticipant: boolean;
|
|
15
24
|
};
|
|
16
25
|
/** @deprecated Use {@link WxAppVoiceDependencies} */
|
|
17
26
|
export type WxAppVoiceDeps = WxAppVoiceDependencies;
|
|
@@ -22,6 +31,7 @@ export type WxAppVoiceLifecycle = {
|
|
|
22
31
|
syncWxAppMuteFromCallDetails: () => Promise<boolean | undefined>;
|
|
23
32
|
mapWxAppVoiceError: (error: unknown, method: string) => never;
|
|
24
33
|
};
|
|
34
|
+
export declare function getWxAppParticipantDiagnostics(deps: WxAppVoiceDependencies): WxAppParticipantDiagnostics;
|
|
25
35
|
export declare function getCallingDeviceDetails(deps: WxAppVoiceDependencies): WebexCallingDeviceDetails | undefined;
|
|
26
36
|
export declare function isWebexAppCallingOffer(deps: WxAppVoiceDependencies): boolean;
|
|
27
37
|
/** Inbound wxApp offer only — outdial decline uses CC routing, not telephony reject. */
|
|
@@ -43,13 +53,16 @@ export declare function transmitDtmfOnWebex(deps: WxAppVoiceDependencies, option
|
|
|
43
53
|
dtmf: string;
|
|
44
54
|
lineOwnerId?: string;
|
|
45
55
|
}): Promise<void>;
|
|
46
|
-
export
|
|
47
|
-
lineOwnerId?: string;
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
export declare function runWxAppReject(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: {
|
|
56
|
+
export type WxAppAcceptRejectOptions = {
|
|
50
57
|
lineOwnerId?: string;
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
acceptReason?: WxAppAcceptReason;
|
|
59
|
+
};
|
|
60
|
+
export declare function runWxAppAccept(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: WxAppAcceptRejectOptions): Promise<void>;
|
|
61
|
+
export declare function runWxAppReject(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: WxAppAcceptRejectOptions): Promise<void>;
|
|
62
|
+
export type WxAppOutdialDeclineOptions = {
|
|
63
|
+
acceptReason?: WxAppAcceptReason;
|
|
64
|
+
};
|
|
65
|
+
export declare function runWxAppOutdialDecline<T>(deps: WxAppVoiceDependencies, executeCancel: () => Promise<T>, options?: WxAppOutdialDeclineOptions): Promise<T>;
|
|
53
66
|
export declare function runWxAppToggleMute(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options?: TaskToggleMuteOptions): Promise<void>;
|
|
54
67
|
export declare function runWxAppTransmitDtmf(deps: WxAppVoiceDependencies, lifecycle: WxAppVoiceLifecycle, options: TaskTransmitDtmfOptions): Promise<void>;
|
|
55
68
|
export declare function mapWxAppVoiceError(error: unknown, method: string, module: string): never;
|
|
@@ -32,6 +32,18 @@ export declare function logWxAppOfferDecision(params: {
|
|
|
32
32
|
acceptReason: WxAppAcceptReason;
|
|
33
33
|
wxAppParticipantDeviceType?: string;
|
|
34
34
|
hasDeviceCallId: boolean;
|
|
35
|
+
hasDeviceId?: boolean;
|
|
36
|
+
usersubPublished?: boolean;
|
|
37
|
+
}): void;
|
|
38
|
+
export declare function logWxAppOfferParticipantMismatch(params: {
|
|
39
|
+
interactionId: string;
|
|
40
|
+
usersubPublished: boolean;
|
|
41
|
+
hasDeviceCallId: boolean;
|
|
42
|
+
hasDeviceId: boolean;
|
|
43
|
+
participantDeviceType?: string;
|
|
44
|
+
acceptVisible: boolean;
|
|
45
|
+
acceptEnabled: boolean;
|
|
46
|
+
acceptReason: WxAppAcceptReason;
|
|
35
47
|
}): void;
|
|
36
48
|
export declare function logWxAppTelephonyAction(params: {
|
|
37
49
|
action: WxAppTelephonyAction;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CallingClientConfig } from '@webex/calling';
|
|
2
2
|
import * as Agent from './services/agent/types';
|
|
3
|
-
import { Profile } from './services/config/types';
|
|
3
|
+
import { Entity, Profile } from './services/config/types';
|
|
4
4
|
import { PaginatedResponse, BaseSearchParams } from './utils/PageCache';
|
|
5
5
|
/**
|
|
6
6
|
* HTTP methods supported by WebexRequest.
|
|
@@ -253,6 +253,8 @@ export interface IContactCenter {
|
|
|
253
253
|
* cc.register().then(profile => { ... });
|
|
254
254
|
*/
|
|
255
255
|
register(): Promise<Profile>;
|
|
256
|
+
/** Returns the system-managed WellbeingBreak idle code for the registered session. */
|
|
257
|
+
getWellbeingBreakIdleCode(): Promise<Entity>;
|
|
256
258
|
}
|
|
257
259
|
/**
|
|
258
260
|
* Generic HTTP response structure.
|
|
@@ -688,6 +690,57 @@ export type RealTimeAssistanceUserActionParams = {
|
|
|
688
690
|
/** Optional language code. Defaults to 'en'. */
|
|
689
691
|
languageCode?: string;
|
|
690
692
|
};
|
|
693
|
+
/**
|
|
694
|
+
* Wellness notification actions delivered by the Contact Center notification service.
|
|
695
|
+
* @public
|
|
696
|
+
*/
|
|
697
|
+
export declare const WELLNESS_BREAK_NOTIFICATION_ACTIONS: {
|
|
698
|
+
readonly PROVIDE_WELLNESS_BREAK: "PROVIDE_WELLNESS_BREAK";
|
|
699
|
+
readonly SUGGEST_WELLNESS_BREAK: "SUGGEST_WELLNESS_BREAK";
|
|
700
|
+
readonly WELLNESS_BREAK_NOT_ALLOWED: "WELLNESS_BREAK_NOT_ALLOWED";
|
|
701
|
+
};
|
|
702
|
+
/** Union of supported wellness notification actions. @public */
|
|
703
|
+
export type WellnessBreakNotificationAction = Enum<typeof WELLNESS_BREAK_NOTIFICATION_ACTIONS>;
|
|
704
|
+
/**
|
|
705
|
+
* Agent actions accepted by the wellness action API.
|
|
706
|
+
* @public
|
|
707
|
+
*/
|
|
708
|
+
export declare const WELLNESS_BREAK_USER_ACTIONS: {
|
|
709
|
+
readonly REQUESTED: "REQUESTED";
|
|
710
|
+
readonly ACCEPTED: "ACCEPTED";
|
|
711
|
+
readonly REJECTED: "REJECTED";
|
|
712
|
+
readonly NO_RESPONSE: "NO_RESPONSE";
|
|
713
|
+
};
|
|
714
|
+
/** Union of supported wellness action API values. @public */
|
|
715
|
+
export type WellnessBreakUserAction = Enum<typeof WELLNESS_BREAK_USER_ACTIONS>;
|
|
716
|
+
/**
|
|
717
|
+
* Validated, agent-scoped wellness notification emitted by Contact Center.
|
|
718
|
+
* @public
|
|
719
|
+
*/
|
|
720
|
+
export interface WellnessBreakEvent {
|
|
721
|
+
/** Agent identifier */
|
|
722
|
+
agentId: string;
|
|
723
|
+
/** Organization identifier */
|
|
724
|
+
orgId: string;
|
|
725
|
+
/** Session identifier supplied by the notification; it may differ from the consumer's active session */
|
|
726
|
+
agentSessionId: string;
|
|
727
|
+
/** Backend wellness action */
|
|
728
|
+
actionEvent: WellnessBreakNotificationAction;
|
|
729
|
+
/** Optional untrusted plain-text message supplied by the backend */
|
|
730
|
+
actionText?: string;
|
|
731
|
+
/** Optional normalized interaction diagnostic */
|
|
732
|
+
interactionId?: string;
|
|
733
|
+
/** Notification diagnostic only; never an action-request correlation identifier */
|
|
734
|
+
trackingId?: string;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Parameters for responding to a backend-provided wellness offer.
|
|
738
|
+
* @public
|
|
739
|
+
*/
|
|
740
|
+
export interface RespondToWellnessBreakParams {
|
|
741
|
+
/** Agent response; REQUESTED is available only through requestWellnessBreak */
|
|
742
|
+
action: Exclude<WellnessBreakUserAction, typeof WELLNESS_BREAK_USER_ACTIONS.REQUESTED>;
|
|
743
|
+
}
|
|
691
744
|
/**
|
|
692
745
|
* Supported AI Assistant event categories.
|
|
693
746
|
* @public
|
|
@@ -735,6 +788,8 @@ export declare const AIAssistantEventName: {
|
|
|
735
788
|
readonly SUGGESTED_RESPONSES_DIGITAL: "SUGGESTED_RESPONSES_DIGITAL";
|
|
736
789
|
/** User action on a suggested response adaptive card */
|
|
737
790
|
readonly SUGGESTED_RESPONSES_USER_ACTION: "SUGGESTED_RESPONSES_USER_ACTION";
|
|
791
|
+
/** Agent Wellness Break request/response action */
|
|
792
|
+
readonly WELLNESS_BREAK_ACTION: "WellnessBreakAction";
|
|
738
793
|
};
|
|
739
794
|
/**
|
|
740
795
|
* Union type of AI Assistant event names.
|
package/dist/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.RealTimeAssistanceUserActionId = exports.LoginOption = exports.LOGGING_LEVEL = exports.HTTP_METHODS = exports.AIAssistantEventType = exports.AIAssistantEventName = void 0;
|
|
6
|
+
exports.WELLNESS_BREAK_USER_ACTIONS = exports.WELLNESS_BREAK_NOTIFICATION_ACTIONS = exports.RealTimeAssistanceUserActionId = exports.LoginOption = exports.LOGGING_LEVEL = exports.HTTP_METHODS = exports.AIAssistantEventType = exports.AIAssistantEventName = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Generic type for converting a const enum object into a union type of its values.
|
|
9
9
|
* @template T The enum object type
|
|
@@ -372,6 +372,41 @@ const RealTimeAssistanceUserActionId = exports.RealTimeAssistanceUserActionId =
|
|
|
372
372
|
* };
|
|
373
373
|
*/
|
|
374
374
|
|
|
375
|
+
/**
|
|
376
|
+
* Wellness notification actions delivered by the Contact Center notification service.
|
|
377
|
+
* @public
|
|
378
|
+
*/
|
|
379
|
+
const WELLNESS_BREAK_NOTIFICATION_ACTIONS = exports.WELLNESS_BREAK_NOTIFICATION_ACTIONS = {
|
|
380
|
+
PROVIDE_WELLNESS_BREAK: 'PROVIDE_WELLNESS_BREAK',
|
|
381
|
+
SUGGEST_WELLNESS_BREAK: 'SUGGEST_WELLNESS_BREAK',
|
|
382
|
+
WELLNESS_BREAK_NOT_ALLOWED: 'WELLNESS_BREAK_NOT_ALLOWED'
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/** Union of supported wellness notification actions. @public */
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Agent actions accepted by the wellness action API.
|
|
389
|
+
* @public
|
|
390
|
+
*/
|
|
391
|
+
const WELLNESS_BREAK_USER_ACTIONS = exports.WELLNESS_BREAK_USER_ACTIONS = {
|
|
392
|
+
REQUESTED: 'REQUESTED',
|
|
393
|
+
ACCEPTED: 'ACCEPTED',
|
|
394
|
+
REJECTED: 'REJECTED',
|
|
395
|
+
NO_RESPONSE: 'NO_RESPONSE'
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
/** Union of supported wellness action API values. @public */
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Validated, agent-scoped wellness notification emitted by Contact Center.
|
|
402
|
+
* @public
|
|
403
|
+
*/
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Parameters for responding to a backend-provided wellness offer.
|
|
407
|
+
* @public
|
|
408
|
+
*/
|
|
409
|
+
|
|
375
410
|
/**
|
|
376
411
|
* Supported AI Assistant event categories.
|
|
377
412
|
* @public
|
|
@@ -419,7 +454,9 @@ const AIAssistantEventName = exports.AIAssistantEventName = {
|
|
|
419
454
|
/** Suggested digital response event */
|
|
420
455
|
SUGGESTED_RESPONSES_DIGITAL: 'SUGGESTED_RESPONSES_DIGITAL',
|
|
421
456
|
/** User action on a suggested response adaptive card */
|
|
422
|
-
SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION'
|
|
457
|
+
SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION',
|
|
458
|
+
/** Agent Wellness Break request/response action */
|
|
459
|
+
WELLNESS_BREAK_ACTION: 'WellnessBreakAction'
|
|
423
460
|
};
|
|
424
461
|
|
|
425
462
|
/**
|