@webex/contact-center 3.12.0-next.147 → 3.12.0-next.149

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.
Files changed (82) hide show
  1. package/.sdd/manifest.json +4 -2
  2. package/ai-docs/CONTRACTS.md +2 -0
  3. package/dist/cc.js +3 -1
  4. package/dist/cc.js.map +1 -1
  5. package/dist/constants.js +10 -1
  6. package/dist/constants.js.map +1 -1
  7. package/dist/index.js +9 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/metrics/constants.js +9 -0
  10. package/dist/metrics/constants.js.map +1 -1
  11. package/dist/services/ApiAiAssistant.js +87 -10
  12. package/dist/services/ApiAiAssistant.js.map +1 -1
  13. package/dist/services/config/types.js +10 -4
  14. package/dist/services/config/types.js.map +1 -1
  15. package/dist/services/core/types.js.map +1 -1
  16. package/dist/services/task/Task.js +202 -1
  17. package/dist/services/task/Task.js.map +1 -1
  18. package/dist/services/task/TaskFactory.js +4 -4
  19. package/dist/services/task/TaskFactory.js.map +1 -1
  20. package/dist/services/task/TaskManager.js +113 -26
  21. package/dist/services/task/TaskManager.js.map +1 -1
  22. package/dist/services/task/TaskUtils.js +11 -1
  23. package/dist/services/task/TaskUtils.js.map +1 -1
  24. package/dist/services/task/constants.js +11 -2
  25. package/dist/services/task/constants.js.map +1 -1
  26. package/dist/services/task/digital/Digital.js +2 -2
  27. package/dist/services/task/digital/Digital.js.map +1 -1
  28. package/dist/services/task/types.js +31 -0
  29. package/dist/services/task/types.js.map +1 -1
  30. package/dist/services/task/voice/Voice.js +2 -2
  31. package/dist/services/task/voice/Voice.js.map +1 -1
  32. package/dist/services/task/voice/WebRTC.js +2 -2
  33. package/dist/services/task/voice/WebRTC.js.map +1 -1
  34. package/dist/types/constants.d.ts +9 -0
  35. package/dist/types/index.d.ts +4 -5
  36. package/dist/types/metrics/constants.d.ts +8 -0
  37. package/dist/types/services/ApiAiAssistant.d.ts +4 -2
  38. package/dist/types/services/config/types.d.ts +17 -7
  39. package/dist/types/services/task/Task.d.ts +15 -4
  40. package/dist/types/services/task/TaskFactory.d.ts +3 -2
  41. package/dist/types/services/task/TaskUtils.d.ts +6 -0
  42. package/dist/types/services/task/constants.d.ts +9 -0
  43. package/dist/types/services/task/digital/Digital.d.ts +3 -2
  44. package/dist/types/services/task/types.d.ts +109 -1
  45. package/dist/types/services/task/voice/Voice.d.ts +3 -2
  46. package/dist/types/services/task/voice/WebRTC.d.ts +3 -2
  47. package/dist/types/types.d.ts +10 -4
  48. package/dist/types.js +8 -4
  49. package/dist/types.js.map +1 -1
  50. package/dist/webex.js +1 -1
  51. package/package.json +3 -3
  52. package/src/cc.ts +4 -0
  53. package/src/constants.ts +12 -0
  54. package/src/index.ts +10 -2
  55. package/src/metrics/ai-docs/metrics-spec.md +12 -4
  56. package/src/metrics/constants.ts +10 -0
  57. package/src/services/ApiAiAssistant.ts +120 -12
  58. package/src/services/config/types.ts +10 -4
  59. package/src/services/core/types.ts +31 -1
  60. package/src/services/task/Task.ts +308 -5
  61. package/src/services/task/TaskFactory.ts +26 -5
  62. package/src/services/task/TaskManager.ts +148 -29
  63. package/src/services/task/TaskUtils.ts +13 -0
  64. package/src/services/task/ai-docs/task-spec.md +30 -5
  65. package/src/services/task/constants.ts +10 -0
  66. package/src/services/task/digital/Digital.ts +8 -3
  67. package/src/services/task/types.ts +139 -0
  68. package/src/services/task/voice/Voice.ts +8 -3
  69. package/src/services/task/voice/WebRTC.ts +6 -3
  70. package/src/types.ts +10 -4
  71. package/test/unit/fixtures/aiSummaryTestUtils.ts +40 -0
  72. package/test/unit/spec/cc.ts +1314 -32
  73. package/test/unit/spec/index.ts +881 -0
  74. package/test/unit/spec/services/ApiAiAssistant.ts +122 -6
  75. package/test/unit/spec/services/core/WebexRequest.ts +5 -6
  76. package/test/unit/spec/services/task/Task.ts +1988 -10
  77. package/test/unit/spec/services/task/TaskFactory.ts +17 -0
  78. package/test/unit/spec/services/task/TaskManager.ts +2327 -180
  79. package/test/unit/spec/services/task/TaskUtils.ts +72 -0
  80. package/test/unit/spec/services/task/voice/Voice.ts +353 -18
  81. package/umd/contact-center.min.js +2 -2
  82. package/umd/contact-center.min.js.map +1 -1
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["HTTP_METHODS","exports","GET","POST","PATCH","PUT","DELETE","LOGGING_LEVEL","LoginOption","AGENT_DN","EXTENSION","BROWSER","RealTimeAssistanceUserActionId","LIKE","DISLIKE","COPY","WELLNESS_BREAK_NOTIFICATION_ACTIONS","PROVIDE_WELLNESS_BREAK","SUGGEST_WELLNESS_BREAK","WELLNESS_BREAK_NOT_ALLOWED","WELLNESS_BREAK_USER_ACTIONS","REQUESTED","ACCEPTED","REJECTED","NO_RESPONSE","AIAssistantEventType","CUSTOM_EVENT","CTI_EVENT","AIAssistantEventName","GET_TRANSCRIPTS","GET_SUGGESTIONS","ADD_SUGGESTIONS_EXTRA_CONTEXT","GET_MID_CALL_SUMMARY","GET_POST_CALL_SUMMARY","MID_CALL_SUMMARY_RESPONSE","POST_CALL_SUMMARY_RESPONSE","SUGGESTED_RESPONSES_DIGITAL","SUGGESTED_RESPONSES_USER_ACTION","WELLNESS_BREAK_ACTION"],"sources":["types.ts"],"sourcesContent":["import {CallingClientConfig} from '@webex/calling';\nimport {\n SubmitBehavioralEvent,\n SubmitOperationalEvent,\n SubmitBusinessEvent,\n} from '@webex/internal-plugin-metrics/src/metrics.types';\nimport * as Agent from './services/agent/types';\nimport * as Contact from './services/task/types';\nimport {\n AIFeatureFlags,\n Entity,\n Profile,\n CreateUserPreferenceRequest,\n UpdateUserPreferenceRequest,\n} from './services/config/types';\nimport {PaginatedResponse, BaseSearchParams} from './utils/PageCache';\n\n/**\n * Generic type for converting a const enum object into a union type of its values.\n * @template T The enum object type\n * @internal\n * @ignore\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * HTTP methods supported by WebexRequest.\n * @enum {string}\n * @public\n * @example\n * const method: HTTP_METHODS = HTTP_METHODS.GET;\n * @ignore\n */\nexport const HTTP_METHODS = {\n /** HTTP GET method for retrieving data */\n GET: 'GET',\n /** HTTP POST method for creating resources */\n POST: 'POST',\n /** HTTP PATCH method for partial updates */\n PATCH: 'PATCH',\n /** HTTP PUT method for complete updates */\n PUT: 'PUT',\n /** HTTP DELETE method for removing resources */\n DELETE: 'DELETE',\n} as const;\n\n/**\n * Union type of HTTP methods.\n * @public\n * @example\n * function makeRequest(method: HTTP_METHODS) { ... }\n * @ignore\n */\nexport type HTTP_METHODS = Enum<typeof HTTP_METHODS>;\n\n/**\n * Payload for making requests to Webex APIs.\n * @public\n * @example\n * const payload: WebexRequestPayload = {\n * service: 'identity',\n * resource: '/users',\n * method: HTTP_METHODS.GET\n * };\n * @ignore\n */\nexport type WebexRequestPayload = {\n /** Service name to target */\n service?: string;\n /** Resource path within the service */\n resource?: string;\n /** HTTP method to use */\n method?: HTTP_METHODS;\n /** Full URI if not using service/resource pattern */\n uri?: string;\n /** Whether to add authorization header */\n addAuthHeader?: boolean;\n /** Custom headers to include in request */\n headers?: {\n [key: string]: string | null;\n };\n /** Request body data */\n body?: object;\n /** Expected response status code */\n statusCode?: number;\n /** Whether to parse response as JSON */\n json?: boolean;\n};\n\n/**\n * Event listener function type.\n * @internal\n * @ignore\n */\ntype Listener = (e: string, data?: unknown) => void;\n\n/**\n * Mercury event handler callback.\n * @internal\n * @ignore\n */\ntype MercuryEventHandler = (data?: unknown) => void;\n\n/**\n * Event listener removal function type.\n * @internal\n * @ignore\n */\ntype ListenerOff = (e: string, handler?: MercuryEventHandler) => void;\n\n/**\n * Service host configuration.\n * @internal\n * @ignore\n */\ntype ServiceHost = {\n /** Host URL/domain for the service */\n host: string;\n /** Time-to-live in seconds */\n ttl: number;\n /** Priority level for load balancing (lower is higher priority) */\n priority: number;\n /** Unique identifier for this host */\n id: string;\n /** Whether this is the home cluster for the user */\n homeCluster?: boolean;\n};\n\n/**\n * Configuration options for the Contact Center Plugin.\n * @interface CCPluginConfig\n * @public\n * @example\n * const config: CCPluginConfig = {\n * allowMultiLogin: true,\n * allowAutomatedRelogin: false,\n * clientType: 'browser',\n * isKeepAliveEnabled: true,\n * force: false,\n * metrics: { clientName: 'myClient', clientType: 'browser' },\n * logging: { enable: true, verboseEvents: false },\n * callingClientConfig: { ... }\n * };\n */\nexport interface CCPluginConfig {\n /** Whether to allow multiple logins from different devices */\n allowMultiLogin: boolean;\n /** Whether to automatically attempt relogin on connection loss */\n allowAutomatedRelogin: boolean;\n /** The type of client making the connection */\n clientType: string;\n /** Whether to enable keep-alive messages */\n isKeepAliveEnabled: boolean;\n /** Whether to force registration */\n force: boolean;\n /** Metrics configuration */\n metrics: {\n /** Name of the client for metrics */\n clientName: string;\n /** Type of client for metrics */\n clientType: string;\n };\n /** Logging configuration */\n logging: {\n /** Whether to enable logging */\n enable: boolean;\n /** Whether to log verbose events */\n verboseEvents: boolean;\n };\n /** Configuration for the calling client */\n callingClientConfig: CallingClientConfig;\n /** Whether to skip Mobius/WebRTC registration for browser login flows */\n disableWebRTCRegistration?: boolean;\n /** Whether wxApp Better Together (telephony REST + usersub) is enabled at init (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n}\n\n/**\n * Logger interface for standardized logging throughout the plugin.\n * @public\n * @example\n * logger.log('This is a log message');\n * logger.error('This is an error message');\n * @ignore\n */\nexport type Logger = {\n /** Log general messages */\n log: (payload: string) => void;\n /** Log error messages */\n error: (payload: string) => void;\n /** Log warning messages */\n warn: (payload: string) => void;\n /** Log informational messages */\n info: (payload: string) => void;\n /** Log detailed trace messages */\n trace: (payload: string) => void;\n /** Log debug messages */\n debug: (payload: string) => void;\n};\n\n/**\n * Contextual information for log entries.\n * @public\n * @ignore\n */\nexport interface LogContext {\n /** Module name where the log originated */\n module?: string;\n /** Method name where the log originated */\n method?: string;\n interactionId?: string;\n trackingId?: string;\n /** Additional structured data to include in logs */\n data?: Record<string, any>;\n /** Error object to include in logs */\n error?: Error | unknown;\n}\n\n/**\n * Available logging severity levels.\n * @enum {string}\n * @public\n * @example\n * const level: LOGGING_LEVEL = LOGGING_LEVEL.error;\n * @ignore\n */\nexport enum LOGGING_LEVEL {\n /** Critical failures that require immediate attention */\n error = 'ERROR',\n /** Important issues that don't prevent the system from working */\n warn = 'WARN',\n /** General informational logs */\n log = 'LOG',\n /** Detailed information about system operation */\n info = 'INFO',\n /** Highly detailed diagnostic information */\n trace = 'TRACE',\n}\n\n/**\n * Metadata for log uploads.\n * @public\n * @example\n * const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };\n * @ignore\n */\nexport type LogsMetaData = {\n /** Optional feedback ID to associate with logs */\n feedbackId?: string;\n /** Optional correlation ID to track related operations */\n correlationId?: string;\n};\n\n/**\n * Response from uploading logs to the server.\n * @public\n * @example\n * const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };\n */\nexport type UploadLogsResponse = {\n /** Tracking ID for the upload request */\n trackingid?: string;\n /** URL where the logs can be accessed */\n url?: string;\n /** ID of the user who uploaded logs */\n userId?: string;\n /** Feedback ID associated with the logs */\n feedbackId?: string;\n /** Correlation ID for tracking related operations */\n correlationId?: string;\n};\n\n/**\n * Internal Webex SDK interfaces needed for plugin integration.\n * @internal\n * @ignore\n */\ninterface IWebexInternal {\n /** Mercury service for real-time messaging */\n mercury: {\n /** Register an event listener */\n on: Listener;\n /** Remove an event listener */\n off: ListenerOff;\n /** Establish a connection to the Mercury service */\n connect: () => Promise<void>;\n /** Disconnect from the Mercury service */\n disconnect: () => Promise<void>;\n /** Whether Mercury is currently connected */\n connected: boolean;\n /** Whether Mercury is in the process of connecting */\n connecting: boolean;\n };\n /** Device information */\n device: {\n /** Current WDM URL */\n url: string;\n /** Current user's ID */\n userId: string;\n /** Current organization ID */\n orgId: string;\n /** Device version */\n version: string;\n /** Calling behavior configuration */\n callingBehavior: string;\n /** Whether the device is registered with WDM */\n registered?: boolean;\n /** Register the device with WDM */\n register?: () => Promise<void>;\n /** Unregister the device from WDM */\n unregister?: () => Promise<void>;\n };\n /** Presence service */\n presence: unknown;\n /** Services discovery and management */\n services: {\n /** Get a service URL by name */\n get: (service: string) => string;\n /** Wait for service catalog to be loaded */\n waitForCatalog: (service: string) => Promise<void>;\n /** Check if current environment is INT (integration) */\n isIntegrationEnvironment: () => boolean;\n /** Host catalog for service discovery */\n _hostCatalog: Record<string, ServiceHost[]>;\n /** Service URLs cache */\n _serviceUrls: {\n /** Mobius calling service */\n mobius: string;\n /** Identity service */\n identity: string;\n /** Janus media server */\n janus: string;\n /** WDM (WebEx Device Management) service */\n wdm: string;\n /** BroadWorks IDP proxy service */\n broadworksIdpProxy: string;\n /** Hydra API service */\n hydra: string;\n /** Mercury API service */\n mercuryApi: string;\n /** UC Management gateway service */\n 'ucmgmt-gateway': string;\n /** Contacts service */\n contactsService: string;\n };\n };\n /** Metrics collection services */\n newMetrics: {\n /** Submit behavioral events (user actions) */\n submitBehavioralEvent: SubmitBehavioralEvent;\n /** Submit operational events (system operations) */\n submitOperationalEvent: SubmitOperationalEvent;\n /** Submit business events (business outcomes) */\n submitBusinessEvent: SubmitBusinessEvent;\n };\n /** Support functionality */\n support: {\n /** Submit logs to server */\n submitLogs: (\n metaData: LogsMetaData,\n logs: string,\n options: {\n /** Whether to submit full logs or just differences */\n type: 'diff' | 'full';\n }\n ) => Promise<UploadLogsResponse>;\n };\n}\n\n/**\n * Interface representing the WebexSDK core functionality.\n * @interface WebexSDK\n * @public\n * @example\n * const sdk: WebexSDK = ...;\n * sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });\n * @ignore\n */\nexport interface WebexSDK {\n /** Version of the WebexSDK */\n version: string;\n /** Whether the SDK can authorize requests */\n canAuthorize: boolean;\n /** Credentials management */\n credentials: {\n /** Get the user token for authentication */\n getUserToken: () => Promise<string>;\n /** Get the organization ID */\n getOrgId: () => string;\n };\n /** Whether the SDK is ready for use */\n ready: boolean;\n /** Make a request to the Webex APIs */\n request: <T>(payload: WebexRequestPayload) => Promise<T>;\n /** Register a one-time event handler */\n once: (event: string, callBack: () => void) => void;\n /** Internal plugins and services */\n internal: IWebexInternal;\n /** Logger instance */\n logger: Logger;\n}\n\n/**\n * An interface for the `ContactCenter` class.\n * The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.\n * @public\n * @example\n * const cc: IContactCenter = ...;\n * cc.register().then(profile => { ... });\n * @ignore\n */\nexport interface IContactCenter {\n /**\n * Initialize the CC SDK by setting up the contact center mercury connection.\n * This establishes WebSocket connectivity for real-time communication.\n *\n * @returns A Promise that resolves to the agent's profile upon successful registration\n * @public\n * @example\n * cc.register().then(profile => { ... });\n */\n register(): Promise<Profile>;\n\n /** Returns the system-managed WellbeingBreak idle code for the registered session. */\n getWellbeingBreakIdleCode(): Promise<Entity>;\n}\n\n/**\n * Generic HTTP response structure.\n * @public\n * @example\n * const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };\n * @ignore\n */\nexport interface IHttpResponse {\n /** Response body content */\n body: any;\n /** HTTP status code */\n statusCode: number;\n /** HTTP method used for the request */\n method: string;\n /** Response headers */\n headers: Headers;\n /** Request URL */\n url: string;\n}\n\n/**\n * Supported login options for agent authentication.\n * @public\n * @example\n * const option: LoginOption = LoginOption.AGENT_DN;\n * @ignore\n */\nexport const LoginOption = {\n /** Login using agent's direct number */\n AGENT_DN: 'AGENT_DN',\n /** Login using an extension number */\n EXTENSION: 'EXTENSION',\n /** Login using browser WebRTC capabilities */\n BROWSER: 'BROWSER',\n} as const;\n\n/**\n * Union type of login options.\n * @public\n * @example\n * function login(option: LoginOption) { ... }\n * @ignore\n */\nexport type LoginOption = Enum<typeof LoginOption>;\n\n/**\n * Request payload for subscribing to the contact center websocket.\n * @public\n * @example\n * const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };\n * @ignore\n */\nexport type SubscribeRequest = {\n /** Whether to force connection even if another exists */\n force: boolean;\n /** Whether to send keepalive messages */\n isKeepAliveEnabled: boolean;\n /** Type of client connecting */\n clientType: string;\n /** Whether to allow login from multiple devices */\n allowMultiLogin: boolean;\n};\n\n/**\n * Represents the response from getListOfTeams method.\n * Teams are groups of agents that can be managed together.\n * @public\n * @example\n * const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };\n * @ignore\n */\nexport type Team = {\n /**\n * Unique identifier of the team.\n */\n id: string;\n\n /**\n * Display name of the team.\n */\n name: string;\n\n /**\n * Associated desktop layout ID for the team.\n * Controls how the agent desktop is displayed for team members.\n */\n desktopLayoutId?: string;\n};\n\n/**\n * Represents the request to perform agent login.\n * @public\n * @example\n * const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };\n */\nexport type AgentLogin = {\n /**\n * A dialNumber field contains the number to dial such as a route point or extension.\n * Required for AGENT_DN and EXTENSION login options.\n */\n dialNumber?: string;\n\n /**\n * The unique ID representing a team of users.\n * The agent must belong to this team.\n */\n teamId: string;\n\n /**\n * The loginOption field specifies the type of login method.\n * Controls how calls are delivered to the agent.\n */\n loginOption: LoginOption;\n};\n\n/**\n * Represents the request to update agent profile settings.\n * @public\n * @example\n * const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };\n */\nexport type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;\n\n/**\n * Union type for all possible request body types.\n * @internal\n * @ignore\n */\nexport type RequestBody =\n | SubscribeRequest\n | Agent.Logout\n | Agent.UserStationLogin\n | Agent.StateChange\n | Agent.BuddyAgents\n | Contact.HoldResumePayload\n | Contact.ResumeRecordingPayload\n | Contact.ConsultPayload\n | Contact.ConsultEndAPIPayload // API Payload accepts only QueueId wheres SDK API allows more params\n | Contact.TransferPayLoad\n | Contact.ConsultTransferPayLoad\n | Contact.cancelCtq\n | Contact.WrapupPayLoad\n | Contact.DialerPayload\n | Contact.PreviewContactPayload\n | CreateUserPreferenceRequest\n | UpdateUserPreferenceRequest;\n\n/**\n * Represents the options to fetch buddy agents for the logged in agent.\n * Buddy agents are other agents who can be consulted or transferred to.\n * @public\n * @example\n * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };\n */\nexport type BuddyAgents = {\n /**\n * The media type channel to filter buddy agents. Defaults to telephony when omitted.\n */\n mediaType?: 'telephony' | 'chat' | 'social' | 'email';\n\n /**\n * Optional filter for agent state.\n * If specified, returns only agents in that state.\n * If omitted, returns both available and idle agents.\n */\n state?: 'Available' | 'Idle';\n\n /**\n * Applies the default state policy for the operation. An explicit state takes precedence.\n */\n action?: 'Consult' | 'Transfer';\n};\n\n/**\n * Holds the configuration flags for the Agent.\n * These flags determine the availability of certain features in the Agent UI.\n * @internal\n */\nexport type ConfigFlags = {\n isEndTaskEnabled: boolean;\n isEndConsultEnabled: boolean;\n webRtcEnabled: boolean;\n autoWrapup: boolean;\n aiFeature?: AIFeatureFlags;\n /** Agent-profile policy used to derive task consult/transfer destination controls. */\n consultTransfer?: Contact.ConsultTransferDestinationConfig;\n /**\n * Optional toggle to globally enable/disable recording controls.\n * Falls back to backend hints when omitted.\n */\n isRecordingEnabled?: boolean;\n /** Whether wxApp thick-client answer controls/APIs are enabled (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n /** Read-only observability: live usersub answer-calls-on-wxcc state for wxApp offer diagnostics. */\n getWxAppUsersubPublished?: () => boolean;\n};\n\n/**\n\n * Generic error structure for Contact Center SDK errors.\n * Contains detailed information about the error context.\n * @public\n * @example\n * const err: GenericError = new Error('Failed');\n * err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };\n * @ignore\n */\nexport interface GenericError extends Error {\n /** Structured details about the error */\n details: {\n /** Error type identifier */\n type: string;\n /** Organization ID where the error occurred */\n orgId: string;\n /** Unique tracking ID for the error */\n trackingId: string;\n /** Additional error context data */\n data: Record<string, any>;\n };\n}\n\n/**\n * Response type for station login operations.\n * Either a success response with agent details or an error.\n * @public\n * @example\n * function handleLogin(resp: StationLoginResponse) { ... }\n */\nexport type StationLoginResponse = Agent.StationLoginSuccessResponse | Error;\n\n/**\n * Response type for station logout operations.\n * Either a success response with logout details or an error.\n * @public\n * @example\n * function handleLogout(resp: StationLogoutResponse) { ... }\n */\nexport type StationLogoutResponse = Agent.LogoutSuccess | Error;\n\n/**\n * Response type for station relogin operations.\n * Either a success response with relogin details or an error.\n * @public\n * @example\n * function handleReLogin(resp: StationReLoginResponse) { ... }\n * @ignore\n */\nexport type StationReLoginResponse = Agent.ReloginSuccess | Error;\n\n/**\n * Response type for agent state change operations.\n * Either a success response with state change details or an error.\n * @public\n * @example\n * function handleStateChange(resp: SetStateResponse) { ... }\n * @ignore\n */\nexport type SetStateResponse = Agent.StateChangeSuccess | Error;\n\n/**\n * AddressBook types\n */\nexport interface AddressBookEntry {\n id: string;\n organizationId?: string;\n version?: number;\n name: string;\n number: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;\n\nexport interface AddressBookEntrySearchParams extends BaseSearchParams {\n addressBookId?: string;\n}\n\n/**\n * EntryPointRecord types\n */\nexport interface EntryPointRecord {\n id: string;\n name: string;\n /** Dialled number mapped to this entry point when included in the list response. */\n number?: string;\n description?: string;\n type?: string;\n isActive?: boolean;\n orgId?: string;\n createdAt?: string;\n updatedAt?: string;\n settings?: Record<string, any>;\n}\n\nexport type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;\nexport type EntryPointSearchParams = BaseSearchParams;\n\n/**\n * Queue types\n */\nexport interface QueueSkillRequirement {\n organizationId?: string;\n id?: string;\n version?: number;\n skillId: string;\n skillName?: string;\n skillType?: string;\n condition: string;\n skillValue: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport interface QueueAgent {\n id: string;\n ciUserId?: string;\n}\n\nexport interface AgentGroup {\n teamId: string;\n}\n\nexport interface CallDistributionGroup {\n agentGroups: AgentGroup[];\n order: number;\n duration?: number;\n}\n\nexport interface AssistantSkillMapping {\n assistantSkillId?: string;\n assistantSkillUpdatedTime?: number;\n}\n\n/**\n * Configuration for a contact service queue\n * @public\n */\nexport interface ContactServiceQueue {\n /** Organization ID */\n organizationId?: string;\n /** Unique identifier for the queue */\n id?: string;\n /** Version of the queue */\n version?: number;\n /** Name of the Contact Service Queue */\n name: string;\n /** Description of the queue */\n description?: string;\n /** Queue type (INBOUND, OUTBOUND) */\n queueType: 'INBOUND' | 'OUTBOUND';\n /** Whether to check agent availability */\n checkAgentAvailability: boolean;\n /** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */\n channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';\n /** Social channel type for SOCIAL_CHANNEL channelType */\n socialChannelType?:\n | 'MESSAGEBIRD'\n | 'MESSENGER'\n | 'WHATSAPP'\n | 'APPLE_BUSINESS_CHAT'\n | 'GOOGLE_BUSINESS_MESSAGES';\n /** Service level threshold in seconds */\n serviceLevelThreshold: number;\n /** Maximum number of simultaneous contacts */\n maxActiveContacts: number;\n /** Maximum time in queue in seconds */\n maxTimeInQueue: number;\n /** Default music in queue media file ID */\n defaultMusicInQueueMediaFileId: string;\n /** Timezone for routing strategies */\n timezone?: string;\n /** Whether the queue is active */\n active: boolean;\n /** Whether outdial campaign is enabled */\n outdialCampaignEnabled?: boolean;\n /** Whether monitoring is permitted */\n monitoringPermitted: boolean;\n /** Whether parking is permitted */\n parkingPermitted: boolean;\n /** Whether recording is permitted */\n recordingPermitted: boolean;\n /** Whether recording all calls is permitted */\n recordingAllCallsPermitted: boolean;\n /** Whether pausing recording is permitted */\n pauseRecordingPermitted: boolean;\n /** Recording pause duration in seconds */\n recordingPauseDuration?: number;\n /** Control flow script URL */\n controlFlowScriptUrl: string;\n /** IVR requeue URL */\n ivrRequeueUrl: string;\n /** Overflow number for telephony */\n overflowNumber?: string;\n /** Vendor ID */\n vendorId?: string;\n /** Routing type */\n routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';\n /** Skills-based routing type */\n skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';\n /** Queue routing type */\n queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';\n /** Queue skill requirements */\n queueSkillRequirements?: QueueSkillRequirement[];\n /** List of agents for agent-based queue */\n agents?: QueueAgent[];\n /** Call distribution groups */\n callDistributionGroups: CallDistributionGroup[];\n /** XSP version */\n xspVersion?: string;\n /** Subscription ID */\n subscriptionId?: string;\n /** Assistant skill mapping */\n assistantSkill?: AssistantSkillMapping;\n /** Whether this is a system default queue */\n systemDefault?: boolean;\n /** User who last updated agents list */\n agentsLastUpdatedByUserName?: string;\n /** Email of user who last updated agents list */\n agentsLastUpdatedByUserEmailPrefix?: string;\n /** When agents list was last updated */\n agentsLastUpdatedTime?: number;\n /** Creation timestamp in epoch millis */\n createdTime?: number;\n /** Last updated timestamp in epoch millis */\n lastUpdatedTime?: number;\n}\n\nexport type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;\n\nexport interface ContactServiceQueueSearchParams extends BaseSearchParams {\n desktopProfileFilter?: boolean;\n provisioningView?: boolean;\n singleObjectResponse?: boolean;\n}\n\n/**\n * Response type for buddy agents query operations.\n * Either a success response with list of buddy agents or an error.\n * @public\n * @example\n * function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }\n */\nexport type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;\n\n/**\n * Response type for device type update operations.\n * Either a success response with update confirmation or an error.\n * @public\n * @example\n * function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }\n */\nexport type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;\n\n/**\n * Supported transcript control actions for AI Assistant events.\n * @public\n * @example\n * const action: TranscriptAction = 'START';\n * @ignore\n */\nexport type TranscriptAction = 'START' | 'STOP';\n\n/**\n * Parameters used to request AI Assistant real-time assistance.\n * @public\n * @example\n * const params: RealTimeAssistanceParams = {\n * interactionId: 'interaction-123',\n * context: 'Need help with credit card payment due date',\n * };\n */\nexport type RealTimeAssistanceParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier for which assistance should be generated */\n interactionId: string;\n /** Optional additional context that should refine the assistance */\n context?: string;\n /** Optional language code for assistance (for example, 'en'). Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Supported user actions on an AI Assistant real-time assistance adaptive card.\n * @public\n */\nexport const RealTimeAssistanceUserActionId = {\n /** User liked the real-time assistance response */\n LIKE: 'likeButton',\n /** User disliked the real-time assistance response */\n DISLIKE: 'dislikeButton',\n /** User copied the real-time assistance response */\n COPY: 'copyButton',\n} as const;\n\n/**\n * Union type of supported real-time assistance user actions.\n * @public\n */\nexport type RealTimeAssistanceUserActionId = Enum<typeof RealTimeAssistanceUserActionId>;\n\n/**\n * Parameters used to send user action feedback for a real-time assistance adaptive card.\n * @public\n * @example\n * const params: RealTimeAssistanceUserActionParams = {\n * agentId: 'agent-123',\n * interactionId: 'interaction-123',\n * adaptiveCardId: 'adaptive-card-123',\n * actionId: RealTimeAssistanceUserActionId.LIKE,\n * };\n */\nexport type RealTimeAssistanceUserActionParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier associated with the real-time assistance response */\n interactionId: string;\n /** Adaptive card identifier from the real-time assistance payload */\n adaptiveCardId: string;\n /** User action performed on the adaptive card */\n actionId: RealTimeAssistanceUserActionId;\n /** Optional language code. Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Wellness notification actions delivered by the Contact Center notification service.\n * @public\n */\nexport const WELLNESS_BREAK_NOTIFICATION_ACTIONS = {\n PROVIDE_WELLNESS_BREAK: 'PROVIDE_WELLNESS_BREAK',\n SUGGEST_WELLNESS_BREAK: 'SUGGEST_WELLNESS_BREAK',\n WELLNESS_BREAK_NOT_ALLOWED: 'WELLNESS_BREAK_NOT_ALLOWED',\n} as const;\n\n/** Union of supported wellness notification actions. @public */\nexport type WellnessBreakNotificationAction = Enum<typeof WELLNESS_BREAK_NOTIFICATION_ACTIONS>;\n\n/**\n * Agent actions accepted by the wellness action API.\n * @public\n */\nexport const WELLNESS_BREAK_USER_ACTIONS = {\n REQUESTED: 'REQUESTED',\n ACCEPTED: 'ACCEPTED',\n REJECTED: 'REJECTED',\n NO_RESPONSE: 'NO_RESPONSE',\n} as const;\n\n/** Union of supported wellness action API values. @public */\nexport type WellnessBreakUserAction = Enum<typeof WELLNESS_BREAK_USER_ACTIONS>;\n\n/**\n * Validated, agent-scoped wellness notification emitted by Contact Center.\n * @public\n */\nexport interface WellnessBreakEvent {\n /** Agent identifier */\n agentId: string;\n /** Organization identifier */\n orgId: string;\n /** Session identifier supplied by the notification; it may differ from the consumer's active session */\n agentSessionId: string;\n /** Backend wellness action */\n actionEvent: WellnessBreakNotificationAction;\n /** Optional untrusted plain-text message supplied by the backend */\n actionText?: string;\n /** Optional normalized interaction diagnostic */\n interactionId?: string;\n /** Notification diagnostic only; never an action-request correlation identifier */\n trackingId?: string;\n}\n\n/**\n * Parameters for responding to a backend-provided wellness offer.\n * @public\n */\nexport interface RespondToWellnessBreakParams {\n /** Agent response; REQUESTED is available only through requestWellnessBreak */\n action: Exclude<WellnessBreakUserAction, typeof WELLNESS_BREAK_USER_ACTIONS.REQUESTED>;\n}\n\n/**\n * Supported AI Assistant event categories.\n * @public\n * @example\n * const eventType: AIAssistantEventType = AIAssistantEventType.CUSTOM_EVENT;\n * @ignore\n */\nexport const AIAssistantEventType = {\n /** Custom AI Assistant event */\n CUSTOM_EVENT: 'CUSTOM_EVENT',\n /** CTI-backed AI Assistant event */\n CTI_EVENT: 'CTI_EVENT',\n} as const;\n\n/**\n * Union type of AI Assistant event categories.\n * @public\n * @example\n * function send(type: AIAssistantEventType) { ... }\n * @ignore\n */\nexport type AIAssistantEventType = Enum<typeof AIAssistantEventType>;\n\n/**\n * Supported AI Assistant event names.\n * @public\n * @example\n * const name: AIAssistantEventName = AIAssistantEventName.GET_TRANSCRIPTS;\n * @ignore\n */\nexport const AIAssistantEventName = {\n /** Request transcript streaming for an interaction */\n GET_TRANSCRIPTS: 'GET_TRANSCRIPTS',\n /** Request a suggested response for an interaction */\n GET_SUGGESTIONS: 'GET_SUGGESTIONS',\n /** Add extra context to refine a suggested response */\n ADD_SUGGESTIONS_EXTRA_CONTEXT: 'ADD_SUGGESTIONS_EXTRA_CONTEXT',\n /** Request mid-call summary generation */\n GET_MID_CALL_SUMMARY: 'GET_MID_CALL_SUMMARY',\n /** Request post-call summary generation */\n GET_POST_CALL_SUMMARY: 'GET_POST_CALL_SUMMARY',\n /** Mid-call summary response event */\n MID_CALL_SUMMARY_RESPONSE: 'MID_CALL_SUMMARY_RESPONSE',\n /** Post-call summary response event */\n POST_CALL_SUMMARY_RESPONSE: 'POST_CALL_SUMMARY_RESPONSE',\n /** Suggested digital response event */\n SUGGESTED_RESPONSES_DIGITAL: 'SUGGESTED_RESPONSES_DIGITAL',\n /** User action on a suggested response adaptive card */\n SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION',\n /** Agent Wellness Break request/response action */\n WELLNESS_BREAK_ACTION: 'WellnessBreakAction',\n} as const;\n\n/**\n * Union type of AI Assistant event names.\n * @public\n * @example\n * function handle(name: AIAssistantEventName) { ... }\n * @ignore\n */\nexport type AIAssistantEventName = Enum<typeof AIAssistantEventName>;\n\n/**\n * A single transcript message entry returned by AI Assistant APIs.\n * @public\n * @example\n * const message: TranscriptMessage = { role: 'AGENT', content: 'Hello', messageId: '1', publishTimestamp: Date.now() };\n *\n */\nexport type TranscriptMessage = {\n /** Speaker role for this message */\n role: string;\n /** Transcript chunk content */\n content: string;\n /** Unique message identifier */\n messageId: string;\n /** Message publish timestamp (epoch milliseconds) */\n publishTimestamp: number;\n};\n\n/**\n * Response payload for historic transcripts API.\n * @public\n * @example\n * const resp: HistoricTranscriptsResponse = { orgId: 'org', agentId: 'agent', conversationId: null, interactionId: 'int', source: 'AI', data: [] };\n *\n */\nexport type HistoricTranscriptsResponse = {\n /** Organization identifier */\n orgId: string;\n /** Agent identifier */\n agentId: string;\n /** Conversation identifier when available */\n conversationId: string | null;\n /** Interaction identifier */\n interactionId: string;\n /** Data source identifier */\n source: string;\n /** Transcript messages */\n data: TranscriptMessage[];\n};\n"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1B;EACAE,GAAG,EAAE,KAAK;EACV;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,MAAM,EAAE;AACV,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYC,aAAa,GAAAN,OAAA,CAAAM,aAAA,0BAAbA,aAAa;EACvB;EADUA,aAAa;EAGvB;EAHUA,aAAa;EAKvB;EALUA,aAAa;EAOvB;EAPUA,aAAa;EASvB;EATUA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAazB;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AA6FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG;EACzB;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,SAAS,EAAE,WAAW;EACtB;EACAC,OAAO,EAAE;AACX,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;;AAkBA;AACA;AACA;;AAkCA;AACA;AACA;AACA;;AAmGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACO,MAAMC,8BAA8B,GAAAX,OAAA,CAAAW,8BAAA,GAAG;EAC5C;EACAC,IAAI,EAAE,YAAY;EAClB;EACAC,OAAO,EAAE,eAAe;EACxB;EACAC,IAAI,EAAE;AACR,CAAU;;AAEV;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACO,MAAMC,mCAAmC,GAAAf,OAAA,CAAAe,mCAAA,GAAG;EACjDC,sBAAsB,EAAE,wBAAwB;EAChDC,sBAAsB,EAAE,wBAAwB;EAChDC,0BAA0B,EAAE;AAC9B,CAAU;;AAEV;;AAGA;AACA;AACA;AACA;AACO,MAAMC,2BAA2B,GAAAnB,OAAA,CAAAmB,2BAAA,GAAG;EACzCC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE,UAAU;EACpBC,WAAW,EAAE;AACf,CAAU;;AAEV;;AAGA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,GAAAxB,OAAA,CAAAwB,oBAAA,GAAG;EAClC;EACAC,YAAY,EAAE,cAAc;EAC5B;EACAC,SAAS,EAAE;AACb,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,GAAA3B,OAAA,CAAA2B,oBAAA,GAAG;EAClC;EACAC,eAAe,EAAE,iBAAiB;EAClC;EACAC,eAAe,EAAE,iBAAiB;EAClC;EACAC,6BAA6B,EAAE,+BAA+B;EAC9D;EACAC,oBAAoB,EAAE,sBAAsB;EAC5C;EACAC,qBAAqB,EAAE,uBAAuB;EAC9C;EACAC,yBAAyB,EAAE,2BAA2B;EACtD;EACAC,0BAA0B,EAAE,4BAA4B;EACxD;EACAC,2BAA2B,EAAE,6BAA6B;EAC1D;EACAC,+BAA+B,EAAE,iCAAiC;EAClE;EACAC,qBAAqB,EAAE;AACzB,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["HTTP_METHODS","exports","GET","POST","PATCH","PUT","DELETE","LOGGING_LEVEL","LoginOption","AGENT_DN","EXTENSION","BROWSER","RealTimeAssistanceUserActionId","LIKE","DISLIKE","COPY","WELLNESS_BREAK_NOTIFICATION_ACTIONS","PROVIDE_WELLNESS_BREAK","SUGGEST_WELLNESS_BREAK","WELLNESS_BREAK_NOT_ALLOWED","WELLNESS_BREAK_USER_ACTIONS","REQUESTED","ACCEPTED","REJECTED","NO_RESPONSE","AIAssistantEventType","CUSTOM_EVENT","CTI_EVENT","AIAssistantEventName","GET_TRANSCRIPTS","GET_SUGGESTIONS","ADD_SUGGESTIONS_EXTRA_CONTEXT","GET_POST_CALL_SUMMARY","GET_MID_CALL_CONSULT_SUMMARY","GET_MID_CALL_TRANSFER_SUMMARY","POST_CALL_SUMMARY_RESPONSE","MID_CALL_CONSULT_SUMMARY_RESPONSE","MID_CALL_TRANSFER_SUMMARY_RESPONSE","SUGGESTED_RESPONSES_DIGITAL","SUGGESTED_RESPONSES_USER_ACTION","WELLNESS_BREAK_ACTION"],"sources":["types.ts"],"sourcesContent":["import {CallingClientConfig} from '@webex/calling';\nimport {\n SubmitBehavioralEvent,\n SubmitOperationalEvent,\n SubmitBusinessEvent,\n} from '@webex/internal-plugin-metrics/src/metrics.types';\nimport * as Agent from './services/agent/types';\nimport * as Contact from './services/task/types';\nimport {\n AIFeatureFlags,\n Entity,\n Profile,\n CreateUserPreferenceRequest,\n UpdateUserPreferenceRequest,\n} from './services/config/types';\nimport {PaginatedResponse, BaseSearchParams} from './utils/PageCache';\n\n/**\n * Generic type for converting a const enum object into a union type of its values.\n * @template T The enum object type\n * @internal\n * @ignore\n */\ntype Enum<T extends Record<string, unknown>> = T[keyof T];\n\n/**\n * HTTP methods supported by WebexRequest.\n * @enum {string}\n * @public\n * @example\n * const method: HTTP_METHODS = HTTP_METHODS.GET;\n * @ignore\n */\nexport const HTTP_METHODS = {\n /** HTTP GET method for retrieving data */\n GET: 'GET',\n /** HTTP POST method for creating resources */\n POST: 'POST',\n /** HTTP PATCH method for partial updates */\n PATCH: 'PATCH',\n /** HTTP PUT method for complete updates */\n PUT: 'PUT',\n /** HTTP DELETE method for removing resources */\n DELETE: 'DELETE',\n} as const;\n\n/**\n * Union type of HTTP methods.\n * @public\n * @example\n * function makeRequest(method: HTTP_METHODS) { ... }\n * @ignore\n */\nexport type HTTP_METHODS = Enum<typeof HTTP_METHODS>;\n\n/**\n * Payload for making requests to Webex APIs.\n * @public\n * @example\n * const payload: WebexRequestPayload = {\n * service: 'identity',\n * resource: '/users',\n * method: HTTP_METHODS.GET\n * };\n * @ignore\n */\nexport type WebexRequestPayload = {\n /** Service name to target */\n service?: string;\n /** Resource path within the service */\n resource?: string;\n /** HTTP method to use */\n method?: HTTP_METHODS;\n /** Full URI if not using service/resource pattern */\n uri?: string;\n /** Whether to add authorization header */\n addAuthHeader?: boolean;\n /** Request timeout in milliseconds */\n timeout?: number;\n /** Custom headers to include in request */\n headers?: {\n [key: string]: string | null;\n };\n /** Request body data */\n body?: object;\n /** Expected response status code */\n statusCode?: number;\n /** Whether to parse response as JSON */\n json?: boolean;\n};\n\n/**\n * Event listener function type.\n * @internal\n * @ignore\n */\ntype Listener = (e: string, data?: unknown) => void;\n\n/**\n * Mercury event handler callback.\n * @internal\n * @ignore\n */\ntype MercuryEventHandler = (data?: unknown) => void;\n\n/**\n * Event listener removal function type.\n * @internal\n * @ignore\n */\ntype ListenerOff = (e: string, handler?: MercuryEventHandler) => void;\n\n/**\n * Service host configuration.\n * @internal\n * @ignore\n */\ntype ServiceHost = {\n /** Host URL/domain for the service */\n host: string;\n /** Time-to-live in seconds */\n ttl: number;\n /** Priority level for load balancing (lower is higher priority) */\n priority: number;\n /** Unique identifier for this host */\n id: string;\n /** Whether this is the home cluster for the user */\n homeCluster?: boolean;\n};\n\n/**\n * Configuration options for the Contact Center Plugin.\n * @interface CCPluginConfig\n * @public\n * @example\n * const config: CCPluginConfig = {\n * allowMultiLogin: true,\n * allowAutomatedRelogin: false,\n * clientType: 'browser',\n * isKeepAliveEnabled: true,\n * force: false,\n * metrics: { clientName: 'myClient', clientType: 'browser' },\n * logging: { enable: true, verboseEvents: false },\n * callingClientConfig: { ... }\n * };\n */\nexport interface CCPluginConfig {\n /** Whether to allow multiple logins from different devices */\n allowMultiLogin: boolean;\n /** Whether to automatically attempt relogin on connection loss */\n allowAutomatedRelogin: boolean;\n /** The type of client making the connection */\n clientType: string;\n /** Whether to enable keep-alive messages */\n isKeepAliveEnabled: boolean;\n /** Whether to force registration */\n force: boolean;\n /** Metrics configuration */\n metrics: {\n /** Name of the client for metrics */\n clientName: string;\n /** Type of client for metrics */\n clientType: string;\n };\n /** Logging configuration */\n logging: {\n /** Whether to enable logging */\n enable: boolean;\n /** Whether to log verbose events */\n verboseEvents: boolean;\n };\n /** Configuration for the calling client */\n callingClientConfig: CallingClientConfig;\n /** Whether to skip Mobius/WebRTC registration for browser login flows */\n disableWebRTCRegistration?: boolean;\n /** Whether wxApp Better Together (telephony REST + usersub) is enabled at init (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n}\n\n/**\n * Logger interface for standardized logging throughout the plugin.\n * @public\n * @example\n * logger.log('This is a log message');\n * logger.error('This is an error message');\n * @ignore\n */\nexport type Logger = {\n /** Log general messages */\n log: (payload: string) => void;\n /** Log error messages */\n error: (payload: string) => void;\n /** Log warning messages */\n warn: (payload: string) => void;\n /** Log informational messages */\n info: (payload: string) => void;\n /** Log detailed trace messages */\n trace: (payload: string) => void;\n /** Log debug messages */\n debug: (payload: string) => void;\n};\n\n/**\n * Contextual information for log entries.\n * @public\n * @ignore\n */\nexport interface LogContext {\n /** Module name where the log originated */\n module?: string;\n /** Method name where the log originated */\n method?: string;\n interactionId?: string;\n trackingId?: string;\n /** Additional structured data to include in logs */\n data?: Record<string, any>;\n /** Error object to include in logs */\n error?: Error | unknown;\n}\n\n/**\n * Available logging severity levels.\n * @enum {string}\n * @public\n * @example\n * const level: LOGGING_LEVEL = LOGGING_LEVEL.error;\n * @ignore\n */\nexport enum LOGGING_LEVEL {\n /** Critical failures that require immediate attention */\n error = 'ERROR',\n /** Important issues that don't prevent the system from working */\n warn = 'WARN',\n /** General informational logs */\n log = 'LOG',\n /** Detailed information about system operation */\n info = 'INFO',\n /** Highly detailed diagnostic information */\n trace = 'TRACE',\n}\n\n/**\n * Metadata for log uploads.\n * @public\n * @example\n * const meta: LogsMetaData = { feedbackId: 'fb123', correlationId: 'corr456' };\n * @ignore\n */\nexport type LogsMetaData = {\n /** Optional feedback ID to associate with logs */\n feedbackId?: string;\n /** Optional correlation ID to track related operations */\n correlationId?: string;\n};\n\n/**\n * Response from uploading logs to the server.\n * @public\n * @example\n * const response: UploadLogsResponse = { trackingid: 'track123', url: 'https://...', userId: 'user1' };\n */\nexport type UploadLogsResponse = {\n /** Tracking ID for the upload request */\n trackingid?: string;\n /** URL where the logs can be accessed */\n url?: string;\n /** ID of the user who uploaded logs */\n userId?: string;\n /** Feedback ID associated with the logs */\n feedbackId?: string;\n /** Correlation ID for tracking related operations */\n correlationId?: string;\n};\n\n/**\n * Internal Webex SDK interfaces needed for plugin integration.\n * @internal\n * @ignore\n */\ninterface IWebexInternal {\n /** Mercury service for real-time messaging */\n mercury: {\n /** Register an event listener */\n on: Listener;\n /** Remove an event listener */\n off: ListenerOff;\n /** Establish a connection to the Mercury service */\n connect: () => Promise<void>;\n /** Disconnect from the Mercury service */\n disconnect: () => Promise<void>;\n /** Whether Mercury is currently connected */\n connected: boolean;\n /** Whether Mercury is in the process of connecting */\n connecting: boolean;\n };\n /** Device information */\n device: {\n /** Current WDM URL */\n url: string;\n /** Current user's ID */\n userId: string;\n /** Current organization ID */\n orgId: string;\n /** Device version */\n version: string;\n /** Calling behavior configuration */\n callingBehavior: string;\n /** Whether the device is registered with WDM */\n registered?: boolean;\n /** Register the device with WDM */\n register?: () => Promise<void>;\n /** Unregister the device from WDM */\n unregister?: () => Promise<void>;\n };\n /** Presence service */\n presence: unknown;\n /** Services discovery and management */\n services: {\n /** Get a service URL by name */\n get: (service: string) => string;\n /** Wait for service catalog to be loaded */\n waitForCatalog: (service: string) => Promise<void>;\n /** Check if current environment is INT (integration) */\n isIntegrationEnvironment: () => boolean;\n /** Host catalog for service discovery */\n _hostCatalog: Record<string, ServiceHost[]>;\n /** Service URLs cache */\n _serviceUrls: {\n /** Mobius calling service */\n mobius: string;\n /** Identity service */\n identity: string;\n /** Janus media server */\n janus: string;\n /** WDM (WebEx Device Management) service */\n wdm: string;\n /** BroadWorks IDP proxy service */\n broadworksIdpProxy: string;\n /** Hydra API service */\n hydra: string;\n /** Mercury API service */\n mercuryApi: string;\n /** UC Management gateway service */\n 'ucmgmt-gateway': string;\n /** Contacts service */\n contactsService: string;\n };\n };\n /** Metrics collection services */\n newMetrics: {\n /** Submit behavioral events (user actions) */\n submitBehavioralEvent: SubmitBehavioralEvent;\n /** Submit operational events (system operations) */\n submitOperationalEvent: SubmitOperationalEvent;\n /** Submit business events (business outcomes) */\n submitBusinessEvent: SubmitBusinessEvent;\n };\n /** Support functionality */\n support: {\n /** Submit logs to server */\n submitLogs: (\n metaData: LogsMetaData,\n logs: string,\n options: {\n /** Whether to submit full logs or just differences */\n type: 'diff' | 'full';\n }\n ) => Promise<UploadLogsResponse>;\n };\n}\n\n/**\n * Interface representing the WebexSDK core functionality.\n * @interface WebexSDK\n * @public\n * @example\n * const sdk: WebexSDK = ...;\n * sdk.request({ service: 'identity', resource: '/users', method: HTTP_METHODS.GET });\n * @ignore\n */\nexport interface WebexSDK {\n /** Version of the WebexSDK */\n version: string;\n /** Whether the SDK can authorize requests */\n canAuthorize: boolean;\n /** Credentials management */\n credentials: {\n /** Get the user token for authentication */\n getUserToken: () => Promise<string>;\n /** Get the organization ID */\n getOrgId: () => string;\n };\n /** Whether the SDK is ready for use */\n ready: boolean;\n /** Make a request to the Webex APIs */\n request: <T>(payload: WebexRequestPayload) => Promise<T>;\n /** Register a one-time event handler */\n once: (event: string, callBack: () => void) => void;\n /** Internal plugins and services */\n internal: IWebexInternal;\n /** Logger instance */\n logger: Logger;\n}\n\n/**\n * An interface for the `ContactCenter` class.\n * The `ContactCenter` package is designed to provide a set of APIs to perform various operations for the Agent flow within Webex Contact Center.\n * @public\n * @example\n * const cc: IContactCenter = ...;\n * cc.register().then(profile => { ... });\n * @ignore\n */\nexport interface IContactCenter {\n /**\n * Initialize the CC SDK by setting up the contact center mercury connection.\n * This establishes WebSocket connectivity for real-time communication.\n *\n * @returns A Promise that resolves to the agent's profile upon successful registration\n * @public\n * @example\n * cc.register().then(profile => { ... });\n */\n register(): Promise<Profile>;\n\n /** Returns the system-managed WellbeingBreak idle code for the registered session. */\n getWellbeingBreakIdleCode(): Promise<Entity>;\n}\n\n/**\n * Generic HTTP response structure.\n * @public\n * @example\n * const response: IHttpResponse = { body: {}, statusCode: 200, method: 'GET', headers: {}, url: '...' };\n * @ignore\n */\nexport interface IHttpResponse {\n /** Response body content */\n body: any;\n /** HTTP status code */\n statusCode: number;\n /** HTTP method used for the request */\n method: string;\n /** Response headers */\n headers: Headers;\n /** Request URL */\n url: string;\n}\n\n/**\n * Supported login options for agent authentication.\n * @public\n * @example\n * const option: LoginOption = LoginOption.AGENT_DN;\n * @ignore\n */\nexport const LoginOption = {\n /** Login using agent's direct number */\n AGENT_DN: 'AGENT_DN',\n /** Login using an extension number */\n EXTENSION: 'EXTENSION',\n /** Login using browser WebRTC capabilities */\n BROWSER: 'BROWSER',\n} as const;\n\n/**\n * Union type of login options.\n * @public\n * @example\n * function login(option: LoginOption) { ... }\n * @ignore\n */\nexport type LoginOption = Enum<typeof LoginOption>;\n\n/**\n * Request payload for subscribing to the contact center websocket.\n * @public\n * @example\n * const req: SubscribeRequest = { force: true, isKeepAliveEnabled: true, clientType: 'browser', allowMultiLogin: false };\n * @ignore\n */\nexport type SubscribeRequest = {\n /** Whether to force connection even if another exists */\n force: boolean;\n /** Whether to send keepalive messages */\n isKeepAliveEnabled: boolean;\n /** Type of client connecting */\n clientType: string;\n /** Whether to allow login from multiple devices */\n allowMultiLogin: boolean;\n};\n\n/**\n * Represents the response from getListOfTeams method.\n * Teams are groups of agents that can be managed together.\n * @public\n * @example\n * const team: Team = { id: 'team1', name: 'Support', desktopLayoutId: 'layout1' };\n * @ignore\n */\nexport type Team = {\n /**\n * Unique identifier of the team.\n */\n id: string;\n\n /**\n * Display name of the team.\n */\n name: string;\n\n /**\n * Associated desktop layout ID for the team.\n * Controls how the agent desktop is displayed for team members.\n */\n desktopLayoutId?: string;\n};\n\n/**\n * Represents the request to perform agent login.\n * @public\n * @example\n * const login: AgentLogin = { dialNumber: '1234', teamId: 'team1', loginOption: LoginOption.AGENT_DN };\n */\nexport type AgentLogin = {\n /**\n * A dialNumber field contains the number to dial such as a route point or extension.\n * Required for AGENT_DN and EXTENSION login options.\n */\n dialNumber?: string;\n\n /**\n * The unique ID representing a team of users.\n * The agent must belong to this team.\n */\n teamId: string;\n\n /**\n * The loginOption field specifies the type of login method.\n * Controls how calls are delivered to the agent.\n */\n loginOption: LoginOption;\n};\n\n/**\n * Represents the request to update agent profile settings.\n * @public\n * @example\n * const update: AgentProfileUpdate = { loginOption: LoginOption.BROWSER, dialNumber: '5678' };\n */\nexport type AgentProfileUpdate = Pick<AgentLogin, 'loginOption' | 'dialNumber' | 'teamId'>;\n\n/**\n * Union type for all possible request body types.\n * @internal\n * @ignore\n */\nexport type RequestBody =\n | SubscribeRequest\n | Agent.Logout\n | Agent.UserStationLogin\n | Agent.StateChange\n | Agent.BuddyAgents\n | Contact.HoldResumePayload\n | Contact.ResumeRecordingPayload\n | Contact.ConsultPayload\n | Contact.ConsultEndAPIPayload // API Payload accepts only QueueId wheres SDK API allows more params\n | Contact.TransferPayLoad\n | Contact.ConsultTransferPayLoad\n | Contact.cancelCtq\n | Contact.WrapupPayLoad\n | Contact.DialerPayload\n | Contact.PreviewContactPayload\n | CreateUserPreferenceRequest\n | UpdateUserPreferenceRequest;\n\n/**\n * Represents the options to fetch buddy agents for the logged in agent.\n * Buddy agents are other agents who can be consulted or transferred to.\n * @public\n * @example\n * const opts: BuddyAgents = { mediaType: 'telephony', state: 'Available' };\n */\nexport type BuddyAgents = {\n /**\n * The media type channel to filter buddy agents. Defaults to telephony when omitted.\n */\n mediaType?: 'telephony' | 'chat' | 'social' | 'email';\n\n /**\n * Optional filter for agent state.\n * If specified, returns only agents in that state.\n * If omitted, returns both available and idle agents.\n */\n state?: 'Available' | 'Idle';\n\n /**\n * Applies the default state policy for the operation. An explicit state takes precedence.\n */\n action?: 'Consult' | 'Transfer';\n};\n\n/**\n * Holds the configuration flags for the Agent.\n * These flags determine the availability of certain features in the Agent UI.\n * @internal\n */\nexport type ConfigFlags = {\n isEndTaskEnabled: boolean;\n isEndConsultEnabled: boolean;\n webRtcEnabled: boolean;\n autoWrapup: boolean;\n aiFeature?: AIFeatureFlags;\n /** Agent-profile policy used to derive task consult/transfer destination controls. */\n consultTransfer?: Contact.ConsultTransferDestinationConfig;\n /**\n * Optional toggle to globally enable/disable recording controls.\n * Falls back to backend hints when omitted.\n */\n isRecordingEnabled?: boolean;\n /** Whether wxApp thick-client answer controls/APIs are enabled (WXCC-6026) */\n enableWxBetterTogether?: boolean;\n /** Read-only observability: live usersub answer-calls-on-wxcc state for wxApp offer diagnostics. */\n getWxAppUsersubPublished?: () => boolean;\n};\n\n/**\n\n * Generic error structure for Contact Center SDK errors.\n * Contains detailed information about the error context.\n * @public\n * @example\n * const err: GenericError = new Error('Failed');\n * err.details = { type: 'ERR', orgId: 'org1', trackingId: 'track1', data: {} };\n * @ignore\n */\nexport interface GenericError extends Error {\n /** Structured details about the error */\n details: {\n /** Error type identifier */\n type: string;\n /** Organization ID where the error occurred */\n orgId: string;\n /** Unique tracking ID for the error */\n trackingId: string;\n /** Additional error context data */\n data: Record<string, any>;\n };\n}\n\n/**\n * Response type for station login operations.\n * Either a success response with agent details or an error.\n * @public\n * @example\n * function handleLogin(resp: StationLoginResponse) { ... }\n */\nexport type StationLoginResponse = Agent.StationLoginSuccessResponse | Error;\n\n/**\n * Response type for station logout operations.\n * Either a success response with logout details or an error.\n * @public\n * @example\n * function handleLogout(resp: StationLogoutResponse) { ... }\n */\nexport type StationLogoutResponse = Agent.LogoutSuccess | Error;\n\n/**\n * Response type for station relogin operations.\n * Either a success response with relogin details or an error.\n * @public\n * @example\n * function handleReLogin(resp: StationReLoginResponse) { ... }\n * @ignore\n */\nexport type StationReLoginResponse = Agent.ReloginSuccess | Error;\n\n/**\n * Response type for agent state change operations.\n * Either a success response with state change details or an error.\n * @public\n * @example\n * function handleStateChange(resp: SetStateResponse) { ... }\n * @ignore\n */\nexport type SetStateResponse = Agent.StateChangeSuccess | Error;\n\n/**\n * AddressBook types\n */\nexport interface AddressBookEntry {\n id: string;\n organizationId?: string;\n version?: number;\n name: string;\n number: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport type AddressBookEntriesResponse = PaginatedResponse<AddressBookEntry>;\n\nexport interface AddressBookEntrySearchParams extends BaseSearchParams {\n addressBookId?: string;\n}\n\n/**\n * EntryPointRecord types\n */\nexport interface EntryPointRecord {\n id: string;\n name: string;\n /** Dialled number mapped to this entry point when included in the list response. */\n number?: string;\n description?: string;\n type?: string;\n isActive?: boolean;\n orgId?: string;\n createdAt?: string;\n updatedAt?: string;\n settings?: Record<string, any>;\n}\n\nexport type EntryPointListResponse = PaginatedResponse<EntryPointRecord>;\nexport type EntryPointSearchParams = BaseSearchParams;\n\n/**\n * Queue types\n */\nexport interface QueueSkillRequirement {\n organizationId?: string;\n id?: string;\n version?: number;\n skillId: string;\n skillName?: string;\n skillType?: string;\n condition: string;\n skillValue: string;\n createdTime?: number;\n lastUpdatedTime?: number;\n}\n\nexport interface QueueAgent {\n id: string;\n ciUserId?: string;\n}\n\nexport interface AgentGroup {\n teamId: string;\n}\n\nexport interface CallDistributionGroup {\n agentGroups: AgentGroup[];\n order: number;\n duration?: number;\n}\n\nexport interface AssistantSkillMapping {\n assistantSkillId?: string;\n assistantSkillUpdatedTime?: number;\n}\n\n/**\n * Configuration for a contact service queue\n * @public\n */\nexport interface ContactServiceQueue {\n /** Organization ID */\n organizationId?: string;\n /** Unique identifier for the queue */\n id?: string;\n /** Version of the queue */\n version?: number;\n /** Name of the Contact Service Queue */\n name: string;\n /** Description of the queue */\n description?: string;\n /** Queue type (INBOUND, OUTBOUND) */\n queueType: 'INBOUND' | 'OUTBOUND';\n /** Whether to check agent availability */\n checkAgentAvailability: boolean;\n /** Channel type (TELEPHONY, EMAIL, SOCIAL_CHANNEL, CHAT, etc.) */\n channelType: 'TELEPHONY' | 'EMAIL' | 'FAX' | 'CHAT' | 'VIDEO' | 'OTHERS' | 'SOCIAL_CHANNEL';\n /** Social channel type for SOCIAL_CHANNEL channelType */\n socialChannelType?:\n | 'MESSAGEBIRD'\n | 'MESSENGER'\n | 'WHATSAPP'\n | 'APPLE_BUSINESS_CHAT'\n | 'GOOGLE_BUSINESS_MESSAGES';\n /** Service level threshold in seconds */\n serviceLevelThreshold: number;\n /** Maximum number of simultaneous contacts */\n maxActiveContacts: number;\n /** Maximum time in queue in seconds */\n maxTimeInQueue: number;\n /** Default music in queue media file ID */\n defaultMusicInQueueMediaFileId: string;\n /** Timezone for routing strategies */\n timezone?: string;\n /** Whether the queue is active */\n active: boolean;\n /** Whether outdial campaign is enabled */\n outdialCampaignEnabled?: boolean;\n /** Whether monitoring is permitted */\n monitoringPermitted: boolean;\n /** Whether parking is permitted */\n parkingPermitted: boolean;\n /** Whether recording is permitted */\n recordingPermitted: boolean;\n /** Whether recording all calls is permitted */\n recordingAllCallsPermitted: boolean;\n /** Whether pausing recording is permitted */\n pauseRecordingPermitted: boolean;\n /** Recording pause duration in seconds */\n recordingPauseDuration?: number;\n /** Control flow script URL */\n controlFlowScriptUrl: string;\n /** IVR requeue URL */\n ivrRequeueUrl: string;\n /** Overflow number for telephony */\n overflowNumber?: string;\n /** Vendor ID */\n vendorId?: string;\n /** Routing type */\n routingType: 'LONGEST_AVAILABLE_AGENT' | 'SKILLS_BASED' | 'CIRCULAR' | 'LINEAR';\n /** Skills-based routing type */\n skillBasedRoutingType?: 'LONGEST_AVAILABLE_AGENT' | 'BEST_AVAILABLE_AGENT';\n /** Queue routing type */\n queueRoutingType: 'TEAM_BASED' | 'SKILL_BASED' | 'AGENT_BASED';\n /** Queue skill requirements */\n queueSkillRequirements?: QueueSkillRequirement[];\n /** List of agents for agent-based queue */\n agents?: QueueAgent[];\n /** Call distribution groups */\n callDistributionGroups: CallDistributionGroup[];\n /** XSP version */\n xspVersion?: string;\n /** Subscription ID */\n subscriptionId?: string;\n /** Assistant skill mapping */\n assistantSkill?: AssistantSkillMapping;\n /** Whether this is a system default queue */\n systemDefault?: boolean;\n /** User who last updated agents list */\n agentsLastUpdatedByUserName?: string;\n /** Email of user who last updated agents list */\n agentsLastUpdatedByUserEmailPrefix?: string;\n /** When agents list was last updated */\n agentsLastUpdatedTime?: number;\n /** Creation timestamp in epoch millis */\n createdTime?: number;\n /** Last updated timestamp in epoch millis */\n lastUpdatedTime?: number;\n}\n\nexport type ContactServiceQueuesResponse = PaginatedResponse<ContactServiceQueue>;\n\nexport interface ContactServiceQueueSearchParams extends BaseSearchParams {\n desktopProfileFilter?: boolean;\n provisioningView?: boolean;\n singleObjectResponse?: boolean;\n}\n\n/**\n * Response type for buddy agents query operations.\n * Either a success response with list of buddy agents or an error.\n * @public\n * @example\n * function handleBuddyAgents(resp: BuddyAgentsResponse) { ... }\n */\nexport type BuddyAgentsResponse = Agent.BuddyAgentsSuccess | Error;\n\n/**\n * Response type for device type update operations.\n * Either a success response with update confirmation or an error.\n * @public\n * @example\n * function handleUpdateDeviceType(resp: UpdateDeviceTypeResponse) { ... }\n */\nexport type UpdateDeviceTypeResponse = Agent.DeviceTypeUpdateSuccess | Error;\n\n/**\n * Supported transcript control actions for AI Assistant events.\n * @public\n * @example\n * const action: TranscriptAction = 'START';\n * @ignore\n */\nexport type TranscriptAction = 'START' | 'STOP';\n\n/**\n * Parameters used to request AI Assistant real-time assistance.\n * @public\n * @example\n * const params: RealTimeAssistanceParams = {\n * interactionId: 'interaction-123',\n * context: 'Need help with credit card payment due date',\n * };\n */\nexport type RealTimeAssistanceParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier for which assistance should be generated */\n interactionId: string;\n /** Optional additional context that should refine the assistance */\n context?: string;\n /** Optional language code for assistance (for example, 'en'). Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Supported user actions on an AI Assistant real-time assistance adaptive card.\n * @public\n */\nexport const RealTimeAssistanceUserActionId = {\n /** User liked the real-time assistance response */\n LIKE: 'likeButton',\n /** User disliked the real-time assistance response */\n DISLIKE: 'dislikeButton',\n /** User copied the real-time assistance response */\n COPY: 'copyButton',\n} as const;\n\n/**\n * Union type of supported real-time assistance user actions.\n * @public\n */\nexport type RealTimeAssistanceUserActionId = Enum<typeof RealTimeAssistanceUserActionId>;\n\n/**\n * Parameters used to send user action feedback for a real-time assistance adaptive card.\n * @public\n * @example\n * const params: RealTimeAssistanceUserActionParams = {\n * agentId: 'agent-123',\n * interactionId: 'interaction-123',\n * adaptiveCardId: 'adaptive-card-123',\n * actionId: RealTimeAssistanceUserActionId.LIKE,\n * };\n */\nexport type RealTimeAssistanceUserActionParams = {\n /** Agent identifier */\n agentId: string;\n /** Interaction identifier associated with the real-time assistance response */\n interactionId: string;\n /** Adaptive card identifier from the real-time assistance payload */\n adaptiveCardId: string;\n /** User action performed on the adaptive card */\n actionId: RealTimeAssistanceUserActionId;\n /** Optional language code. Defaults to 'en'. */\n languageCode?: string;\n};\n\n/**\n * Wellness notification actions delivered by the Contact Center notification service.\n * @public\n */\nexport const WELLNESS_BREAK_NOTIFICATION_ACTIONS = {\n PROVIDE_WELLNESS_BREAK: 'PROVIDE_WELLNESS_BREAK',\n SUGGEST_WELLNESS_BREAK: 'SUGGEST_WELLNESS_BREAK',\n WELLNESS_BREAK_NOT_ALLOWED: 'WELLNESS_BREAK_NOT_ALLOWED',\n} as const;\n\n/** Union of supported wellness notification actions. @public */\nexport type WellnessBreakNotificationAction = Enum<typeof WELLNESS_BREAK_NOTIFICATION_ACTIONS>;\n\n/**\n * Agent actions accepted by the wellness action API.\n * @public\n */\nexport const WELLNESS_BREAK_USER_ACTIONS = {\n REQUESTED: 'REQUESTED',\n ACCEPTED: 'ACCEPTED',\n REJECTED: 'REJECTED',\n NO_RESPONSE: 'NO_RESPONSE',\n} as const;\n\n/** Union of supported wellness action API values. @public */\nexport type WellnessBreakUserAction = Enum<typeof WELLNESS_BREAK_USER_ACTIONS>;\n\n/**\n * Validated, agent-scoped wellness notification emitted by Contact Center.\n * @public\n */\nexport interface WellnessBreakEvent {\n /** Agent identifier */\n agentId: string;\n /** Organization identifier */\n orgId: string;\n /** Session identifier supplied by the notification; it may differ from the consumer's active session */\n agentSessionId: string;\n /** Backend wellness action */\n actionEvent: WellnessBreakNotificationAction;\n /** Optional untrusted plain-text message supplied by the backend */\n actionText?: string;\n /** Optional normalized interaction diagnostic */\n interactionId?: string;\n /** Notification diagnostic only; never an action-request correlation identifier */\n trackingId?: string;\n}\n\n/**\n * Parameters for responding to a backend-provided wellness offer.\n * @public\n */\nexport interface RespondToWellnessBreakParams {\n /** Agent response; REQUESTED is available only through requestWellnessBreak */\n action: Exclude<WellnessBreakUserAction, typeof WELLNESS_BREAK_USER_ACTIONS.REQUESTED>;\n}\n\n/**\n * Supported AI Assistant event categories.\n * @public\n * @example\n * const eventType: AIAssistantEventType = AIAssistantEventType.CUSTOM_EVENT;\n * @ignore\n */\nexport const AIAssistantEventType = {\n /** Custom AI Assistant event */\n CUSTOM_EVENT: 'CUSTOM_EVENT',\n /** CTI-backed AI Assistant event */\n CTI_EVENT: 'CTI_EVENT',\n} as const;\n\n/**\n * Union type of AI Assistant event categories.\n * @public\n * @example\n * function send(type: AIAssistantEventType) { ... }\n * @ignore\n */\nexport type AIAssistantEventType = Enum<typeof AIAssistantEventType>;\n\n/**\n * Supported AI Assistant event names.\n * @public\n * @example\n * const name: AIAssistantEventName = AIAssistantEventName.GET_TRANSCRIPTS;\n * @ignore\n */\nexport const AIAssistantEventName = {\n /** Request transcript streaming for an interaction */\n GET_TRANSCRIPTS: 'GET_TRANSCRIPTS',\n /** Request a suggested response for an interaction */\n GET_SUGGESTIONS: 'GET_SUGGESTIONS',\n /** Add extra context to refine a suggested response */\n ADD_SUGGESTIONS_EXTRA_CONTEXT: 'ADD_SUGGESTIONS_EXTRA_CONTEXT',\n /** Request post-call summary generation */\n GET_POST_CALL_SUMMARY: 'GET_POST_CALL_SUMMARY',\n /** Request consult mid-call summary generation */\n GET_MID_CALL_CONSULT_SUMMARY: 'GET_MID_CALL_CONSULT_SUMMARY',\n /** Request transfer mid-call summary generation */\n GET_MID_CALL_TRANSFER_SUMMARY: 'GET_MID_CALL_TRANSFER_SUMMARY',\n /** Post-call summary response event */\n POST_CALL_SUMMARY_RESPONSE: 'POST_CALL_SUMMARY_RESPONSE',\n /** Consult mid-call summary response event */\n MID_CALL_CONSULT_SUMMARY_RESPONSE: 'MID_CALL_CONSULT_SUMMARY_RESPONSE',\n /** Transfer mid-call summary response event */\n MID_CALL_TRANSFER_SUMMARY_RESPONSE: 'MID_CALL_TRANSFER_SUMMARY_RESPONSE',\n /** Suggested digital response event */\n SUGGESTED_RESPONSES_DIGITAL: 'SUGGESTED_RESPONSES_DIGITAL',\n /** User action on a suggested response adaptive card */\n SUGGESTED_RESPONSES_USER_ACTION: 'SUGGESTED_RESPONSES_USER_ACTION',\n /** Agent Wellness Break request/response action */\n WELLNESS_BREAK_ACTION: 'WellnessBreakAction',\n} as const;\n\n/**\n * Union type of AI Assistant event names.\n * @public\n * @example\n * function handle(name: AIAssistantEventName) { ... }\n * @ignore\n */\nexport type AIAssistantEventName = Enum<typeof AIAssistantEventName>;\n\n/**\n * A single transcript message entry returned by AI Assistant APIs.\n * @public\n * @example\n * const message: TranscriptMessage = { role: 'AGENT', content: 'Hello', messageId: '1', publishTimestamp: Date.now() };\n *\n */\nexport type TranscriptMessage = {\n /** Speaker role for this message */\n role: string;\n /** Transcript chunk content */\n content: string;\n /** Unique message identifier */\n messageId: string;\n /** Message publish timestamp (epoch milliseconds) */\n publishTimestamp: number;\n};\n\n/**\n * Response payload for historic transcripts API.\n * @public\n * @example\n * const resp: HistoricTranscriptsResponse = { orgId: 'org', agentId: 'agent', conversationId: null, interactionId: 'int', source: 'AI', data: [] };\n *\n */\nexport type HistoricTranscriptsResponse = {\n /** Organization identifier */\n orgId: string;\n /** Agent identifier */\n agentId: string;\n /** Conversation identifier when available */\n conversationId: string | null;\n /** Interaction identifier */\n interactionId: string;\n /** Data source identifier */\n source: string;\n /** Transcript messages */\n data: TranscriptMessage[];\n};\n"],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1B;EACAE,GAAG,EAAE,KAAK;EACV;EACAC,IAAI,EAAE,MAAM;EACZ;EACAC,KAAK,EAAE,OAAO;EACd;EACAC,GAAG,EAAE,KAAK;EACV;EACAC,MAAM,EAAE;AACV,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0BA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAQYC,aAAa,GAAAN,OAAA,CAAAM,aAAA,0BAAbA,aAAa;EACvB;EADUA,aAAa;EAGvB;EAHUA,aAAa;EAKvB;EALUA,aAAa;EAOvB;EAPUA,aAAa;EASvB;EATUA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAazB;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AA6FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,GAAAP,OAAA,CAAAO,WAAA,GAAG;EACzB;EACAC,QAAQ,EAAE,UAAU;EACpB;EACAC,SAAS,EAAE,WAAW;EACtB;EACAC,OAAO,EAAE;AACX,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;;AAkBA;AACA;AACA;;AAkCA;AACA;AACA;AACA;;AAmGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACO,MAAMC,8BAA8B,GAAAX,OAAA,CAAAW,8BAAA,GAAG;EAC5C;EACAC,IAAI,EAAE,YAAY;EAClB;EACAC,OAAO,EAAE,eAAe;EACxB;EACAC,IAAI,EAAE;AACR,CAAU;;AAEV;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACO,MAAMC,mCAAmC,GAAAf,OAAA,CAAAe,mCAAA,GAAG;EACjDC,sBAAsB,EAAE,wBAAwB;EAChDC,sBAAsB,EAAE,wBAAwB;EAChDC,0BAA0B,EAAE;AAC9B,CAAU;;AAEV;;AAGA;AACA;AACA;AACA;AACO,MAAMC,2BAA2B,GAAAnB,OAAA,CAAAmB,2BAAA,GAAG;EACzCC,SAAS,EAAE,WAAW;EACtBC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE,UAAU;EACpBC,WAAW,EAAE;AACf,CAAU;;AAEV;;AAGA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,GAAAxB,OAAA,CAAAwB,oBAAA,GAAG;EAClC;EACAC,YAAY,EAAE,cAAc;EAC5B;EACAC,SAAS,EAAE;AACb,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,GAAA3B,OAAA,CAAA2B,oBAAA,GAAG;EAClC;EACAC,eAAe,EAAE,iBAAiB;EAClC;EACAC,eAAe,EAAE,iBAAiB;EAClC;EACAC,6BAA6B,EAAE,+BAA+B;EAC9D;EACAC,qBAAqB,EAAE,uBAAuB;EAC9C;EACAC,4BAA4B,EAAE,8BAA8B;EAC5D;EACAC,6BAA6B,EAAE,+BAA+B;EAC9D;EACAC,0BAA0B,EAAE,4BAA4B;EACxD;EACAC,iCAAiC,EAAE,mCAAmC;EACtE;EACAC,kCAAkC,EAAE,oCAAoC;EACxE;EACAC,2BAA2B,EAAE,6BAA6B;EAC1D;EACAC,+BAA+B,EAAE,iCAAiC;EAClE;EACAC,qBAAqB,EAAE;AACzB,CAAU;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
package/dist/webex.js CHANGED
@@ -43,7 +43,7 @@ if (!global.Buffer) {
43
43
  */
44
44
  const Webex = _webexCore.default.extend({
45
45
  webex: true,
46
- version: `3.12.0-next.147`
46
+ version: `3.12.0-next.149`
47
47
  });
48
48
 
49
49
  // The standalone UMD bundle exports the Webex constructor as its default value. Attach the
package/package.json CHANGED
@@ -47,9 +47,9 @@
47
47
  "dependencies": {
48
48
  "@types/platform": "1.3.4",
49
49
  "@webex/calling": "3.12.0-next.113",
50
- "@webex/internal-plugin-mercury": "3.12.0-next.62",
50
+ "@webex/internal-plugin-mercury": "3.12.0-next.61",
51
51
  "@webex/internal-plugin-metrics": "3.12.0-next.55",
52
- "@webex/internal-plugin-support": "3.12.0-next.69",
52
+ "@webex/internal-plugin-support": "3.12.0-next.70",
53
53
  "@webex/plugin-authorization": "3.12.0-next.57",
54
54
  "@webex/plugin-logger": "3.12.0-next.56",
55
55
  "@webex/webex-core": "3.12.0-next.57",
@@ -84,5 +84,5 @@
84
84
  "typedoc": "^0.25.0",
85
85
  "typescript": "5.4.5"
86
86
  },
87
- "version": "3.12.0-next.147"
87
+ "version": "3.12.0-next.149"
88
88
  }
package/src/cc.ts CHANGED
@@ -808,6 +808,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
808
808
  METRIC_EVENT_NAMES.WEBSOCKET_DEREGISTER_FAIL,
809
809
  ]);
810
810
 
811
+ this.taskManager.clearAISummaryState();
811
812
  this.taskManager.off(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);
812
813
  this.taskManager.off(TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);
813
814
  this.taskManager.off(TASK_EVENTS.TASK_MULTI_LOGIN_HYDRATE, this.handleTaskMultiLoginHydrate);
@@ -1025,6 +1026,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1025
1026
  // TODO: Make profile a singleton to make it available throughout app/sdk so we dont need to inject info everywhere
1026
1027
  this.taskManager.setWrapupData(this.agentConfig.wrapUpData);
1027
1028
  this.taskManager.setAgentId(this.agentConfig.agentId);
1029
+ this.taskManager.setAgentName(this.agentConfig.agentName);
1028
1030
  this.taskManager.setWebRtcEnabled(this.agentConfig.webRtcEnabled);
1029
1031
  this.apiAIAssistant.setAIFeatureFlags(this.agentConfig.aiFeature);
1030
1032
  this.wellbeingBreakIdleCode = undefined;
@@ -1038,6 +1040,8 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1038
1040
  if (
1039
1041
  this.agentConfig.aiFeature?.realtimeTranscripts?.enable ||
1040
1042
  this.agentConfig.aiFeature?.suggestedResponses?.enable ||
1043
+ this.agentConfig.aiFeature?.generatedSummaries?.wrapUpSummariesEnabled === true ||
1044
+ this.agentConfig.aiFeature?.generatedSummaries?.consultTransferSummariesEnabled === true ||
1041
1045
  this.agentConfig.isWellnessBreakEnabled
1042
1046
  ) {
1043
1047
  LoggerProxy.info('Connecting to RTD websocket', {
package/src/constants.ts CHANGED
@@ -82,3 +82,15 @@ export const METHODS = {
82
82
  GET_CALL_DETAILS_ON_WEBEX: 'getCallDetailsOnWebex',
83
83
  ENSURE_WXAPP_MERCURY_CONNECTED: 'ensureWxAppMercuryConnected',
84
84
  };
85
+
86
+ export const AI_SUMMARY_ERROR_CODES = {
87
+ POST_CALL_SUMMARY_DISABLED: 'POST_CALL_SUMMARY_DISABLED',
88
+ MID_CALL_SUMMARY_DISABLED: 'MID_CALL_SUMMARY_DISABLED',
89
+ AI_ASSISTANT_BASE_URL_NOT_AVAILABLE: 'AI_ASSISTANT_BASE_URL_NOT_AVAILABLE',
90
+ POST_CALL_SUMMARY_TIMEOUT: 'POST_CALL_SUMMARY_TIMEOUT',
91
+ MID_CALL_SUMMARY_TIMEOUT: 'MID_CALL_SUMMARY_TIMEOUT',
92
+ } as const;
93
+
94
+ export const AI_SUMMARY_INVALID_RESPONSE_PAYLOAD = 'AI_SUMMARY_INVALID_RESPONSE_PAYLOAD';
95
+
96
+ export const AI_ASSISTANT_CLIENT_TYPE = 'WxCC' as const;
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ import ContactCenter from './cc';
4
4
 
5
5
  /**
6
6
  * @module ContactCenterModule
7
- * /
7
+ */
8
8
 
9
9
  // Core exports
10
10
  /**
@@ -28,6 +28,7 @@ export {default as Task} from './services/task/Task';
28
28
  // API exports (AddressBook is public, EntryPoint and Queue are accessed via cc wrappers)
29
29
  export {default as AddressBook} from './services/AddressBook';
30
30
  export {default as ApiAIAssistant} from './services/ApiAiAssistant';
31
+ export {AI_SUMMARY_ERROR_CODES} from './constants';
31
32
  export {default as UserPreference} from './services/UserPreference';
32
33
 
33
34
  /** Agent Wellness Break notification and action wire values. */
@@ -64,7 +65,7 @@ export {AGENT_EVENTS} from './services/agent/types';
64
65
  export type {AGENT_EVENTS as AgentEvents} from './services/agent/types';
65
66
 
66
67
  /**
67
- * Contact Center Task Events
68
+ * Contact Center task, realtime, and AI Assistant events
68
69
  * @enum {string}
69
70
  * @category Enums
70
71
  */
@@ -159,6 +160,13 @@ export type {
159
160
  TaskUILeg,
160
161
  TaskUIControls,
161
162
  TaskUIControlState,
163
+ AISummaryAction,
164
+ AISummaryFeedback,
165
+ AISummaryState,
166
+ AISummarySections,
167
+ AISummary,
168
+ AISummaryFeatureEnablement,
169
+ AISummaryResponse,
162
170
  } from './services/task/types';
163
171
 
164
172
  /** UI controls utilities */
@@ -378,11 +378,11 @@ Special events (no success/failure pair):
378
378
 
379
379
  - `WXAPP_SESSION_SKIPPED` — has behavioral taxonomy (`wxcc_sdk.user.webex_together_session_init.ignore`)
380
380
 
381
- Of the 113 defined metric names, 97 have behavioral taxonomy and 16 do not. Events **without** an `eventTaxonomyMap` entry are the original eight `AI_ASSISTANT_*` names, the three Agent Wellness Break `AI_ASSISTANT_WELLNESS_*` names, the two `WELLBEING_BREAK_IDLE_CODE_FETCH_*` names, plus `WEBSOCKET_DEREGISTER_SUCCESS`, `WEBSOCKET_DEREGISTER_FAIL`, and `WEBSOCKET_EVENT_RECEIVED`. The Agent Wellness Break names are intentionally operational-only and therefore have no `eventTaxonomyMap` entries.
381
+ Of the 121 defined metric names, 97 have behavioral taxonomy and 24 do not. The unmapped names are the eight original `AI_ASSISTANT_*` names, three Agent Wellness Break `AI_ASSISTANT_WELLNESS_*` names, two `WELLBEING_BREAK_IDLE_CODE_FETCH_*` names, eight `AI_SUMMARY_*` names, and three WebSocket names (`WEBSOCKET_DEREGISTER_SUCCESS`, `WEBSOCKET_DEREGISTER_FAIL`, and `WEBSOCKET_EVENT_RECEIVED`). Agent Wellness Break and AI summary metrics are intentionally operational-only.
382
382
 
383
383
  ### Complete METRIC_EVENT_NAMES catalog
384
384
 
385
- This table contains all 113 names from `src/metrics/constants.ts`; taxonomy presence is checked against `src/metrics/behavioral-events.ts`: 97 mapped and 16 unmapped.
385
+ This table contains all 121 names from `src/metrics/constants.ts`; taxonomy presence is checked against `src/metrics/behavioral-events.ts`: 97 mapped and 24 unmapped.
386
386
 
387
387
  | Constant | Emitted name | Behavioral taxonomy? |
388
388
  |---|---|---|
@@ -491,6 +491,14 @@ This table contains all 113 names from `src/metrics/constants.ts`; taxonomy pres
491
491
  | `AI_ASSISTANT_WELLNESS_EVENT_INVALID` | `AI Assistant Wellness Event Invalid` | no |
492
492
  | `WELLBEING_BREAK_IDLE_CODE_FETCH_SUCCESS` | `Wellbeing Break Idle Code Fetch Success` | no |
493
493
  | `WELLBEING_BREAK_IDLE_CODE_FETCH_FAILED` | `Wellbeing Break Idle Code Fetch Failed` | no |
494
+ | `AI_SUMMARY_GET_POST_CALL_SUCCESS` | `Post Call Summary Get Success` | no |
495
+ | `AI_SUMMARY_GET_POST_CALL_FAILED` | `Post Call Summary Get Failed` | no |
496
+ | `AI_SUMMARY_GET_MID_CALL_SUCCESS` | `Mid Call Summary Get Success` | no |
497
+ | `AI_SUMMARY_GET_MID_CALL_FAILED` | `Mid Call Summary Get Failed` | no |
498
+ | `AI_SUMMARY_POST_CALL_RESPONSE_SUCCESS` | `Post Call Summary Response Success` | no |
499
+ | `AI_SUMMARY_POST_CALL_RESPONSE_FAILED` | `Post Call Summary Response Failed` | no |
500
+ | `AI_SUMMARY_MID_CALL_RESPONSE_SUCCESS` | `Mid Call Summary Response Success` | no |
501
+ | `AI_SUMMARY_MID_CALL_RESPONSE_FAILED` | `Mid Call Summary Response Failed` | no |
494
502
  | `USER_PREFERENCE_GET_SUCCESS` | `User Preference Get Success` | yes |
495
503
  | `USER_PREFERENCE_GET_FAILED` | `User Preference Get Failed` | yes |
496
504
  | `USER_PREFERENCE_CREATE_SUCCESS` | `User Preference Create Success` | yes |
@@ -871,7 +879,7 @@ stateDiagram-v2
871
879
  - **metricsDisabled**: When `true`, `timeEvent` and all `track*` methods return early, and `clearPendingEvents()` empties all queues.
872
880
 
873
881
  ## Pitfalls
874
- - `METRIC_EVENT_NAMES` and `eventTaxonomyMap` are different inventories: 20 defined names intentionally have no behavioral taxonomy.
882
+ - `METRIC_EVENT_NAMES` and `eventTaxonomyMap` are different inventories: 24 defined names intentionally have no behavioral taxonomy.
875
883
  - `setMetricsDisabled(true)` clears pending queues but does not create a delivery receipt; callers must not infer that previously submitted events were accepted.
876
884
  - Submission helpers hand events to `webex.internal.newMetrics` without a module-level retry/requeue policy, so telemetry must remain non-blocking and non-authoritative.
877
885
 
@@ -932,7 +940,7 @@ Use `test/unit/spec/metrics/MetricsManager.ts` for readiness queues, timing/trac
932
940
  | Behavior / Requirement | Existing test evidence | Gap |
933
941
  |---|---|---|
934
942
  | `METRICS-R-001` | `test/unit/spec/metrics/MetricsManager.ts` | Add a catalog parity assertion if constants change. |
935
- | `METRICS-R-002` | `test/unit/spec/metrics/behavioral-events.ts` | Keep explicit coverage for all 20 unmapped names. |
943
+ | `METRICS-R-002` | `test/unit/spec/metrics/behavioral-events.ts` | Keep explicit coverage for all 24 unmapped names. |
936
944
  | `METRICS-R-003` | `test/unit/spec/metrics/MetricsManager.ts` | None. |
937
945
  | `METRICS-R-004` | `test/unit/spec/metrics/MetricsManager.ts` | None. |
938
946
  | `METRICS-R-005` | `test/unit/spec/metrics/MetricsManager.ts` | Authentication ownership is verified indirectly through the host metrics client. |
@@ -210,6 +210,16 @@ export const METRIC_EVENT_NAMES = {
210
210
  WELLBEING_BREAK_IDLE_CODE_FETCH_SUCCESS: 'Wellbeing Break Idle Code Fetch Success',
211
211
  WELLBEING_BREAK_IDLE_CODE_FETCH_FAILED: 'Wellbeing Break Idle Code Fetch Failed',
212
212
 
213
+ // AI summary events
214
+ AI_SUMMARY_GET_POST_CALL_SUCCESS: 'Post Call Summary Get Success',
215
+ AI_SUMMARY_GET_POST_CALL_FAILED: 'Post Call Summary Get Failed',
216
+ AI_SUMMARY_GET_MID_CALL_SUCCESS: 'Mid Call Summary Get Success',
217
+ AI_SUMMARY_GET_MID_CALL_FAILED: 'Mid Call Summary Get Failed',
218
+ AI_SUMMARY_POST_CALL_RESPONSE_SUCCESS: 'Post Call Summary Response Success',
219
+ AI_SUMMARY_POST_CALL_RESPONSE_FAILED: 'Post Call Summary Response Failed',
220
+ AI_SUMMARY_MID_CALL_RESPONSE_SUCCESS: 'Mid Call Summary Response Success',
221
+ AI_SUMMARY_MID_CALL_RESPONSE_FAILED: 'Mid Call Summary Response Failed',
222
+
213
223
  // User Preference API Events
214
224
  USER_PREFERENCE_GET_SUCCESS: 'User Preference Get Success',
215
225
  USER_PREFERENCE_GET_FAILED: 'User Preference Get Failed',
@@ -2,7 +2,7 @@ import {v4 as uuidv4} from 'uuid';
2
2
  import LoggerProxy from '../logger-proxy';
3
3
  import MetricsManager from '../metrics/MetricsManager';
4
4
  import {METRIC_EVENT_NAMES} from '../metrics/constants';
5
- import {CC_FILE, METHODS} from '../constants';
5
+ import {AI_SUMMARY_ERROR_CODES, CC_FILE, METHODS} from '../constants';
6
6
  import {
7
7
  HTTP_METHODS,
8
8
  WebexSDK,
@@ -18,6 +18,7 @@ import {
18
18
  GenericError,
19
19
  } from '../types';
20
20
  import {getErrorDetails} from './core/Utils';
21
+ import type {PendingRtdRequest, RtdRequestOptions} from './core/types';
21
22
  import {
22
23
  AI_ASSISTANT_BASE_URL_TEMPLATE,
23
24
  AI_ASSISTANT_ENV_MAP,
@@ -39,7 +40,9 @@ type WellnessBreakContextProvider = () => {
39
40
  export class ApiAIAssistant {
40
41
  private webex: WebexSDK;
41
42
  private metricsManager: MetricsManager;
42
- private aiFeature: AIFeatureFlags;
43
+ /** @internal Current AI flags from the agent configuration. */
44
+ public aiFeature: AIFeatureFlags;
45
+ private pendingRtdRequests = new Map<string, PendingRtdRequest<unknown>>();
43
46
  private readonly wellnessContextProvider?: WellnessBreakContextProvider;
44
47
 
45
48
  private createWellnessError(reason: string): GenericError {
@@ -197,7 +200,7 @@ export class ApiAIAssistant {
197
200
 
198
201
  if (!wccApiGatewayUrl) {
199
202
  const {error: detailedError} = getErrorDetails(
200
- new Error('AI_ASSISTANT_BASE_URL_NOT_AVAILABLE'),
203
+ new Error(AI_SUMMARY_ERROR_CODES.AI_ASSISTANT_BASE_URL_NOT_AVAILABLE),
201
204
  METHODS.GET_BASE_URL,
202
205
  CC_FILE
203
206
  );
@@ -212,9 +215,10 @@ export class ApiAIAssistant {
212
215
  }
213
216
 
214
217
  const resolvedEnv = AI_ASSISTANT_ENV_MAP[hostname];
218
+
215
219
  if (!resolvedEnv) {
216
220
  const {error: detailedError} = getErrorDetails(
217
- new Error('AI_ASSISTANT_BASE_URL_NOT_AVAILABLE'),
221
+ new Error(AI_SUMMARY_ERROR_CODES.AI_ASSISTANT_BASE_URL_NOT_AVAILABLE),
218
222
  METHODS.GET_BASE_URL,
219
223
  CC_FILE
220
224
  );
@@ -224,6 +228,105 @@ export class ApiAIAssistant {
224
228
  return AI_ASSISTANT_BASE_URL_TEMPLATE.replace('%s', resolvedEnv);
225
229
  }
226
230
 
231
+ private static getRtdRequestKey(rtdEventType: string, correlationId: string): string {
232
+ return JSON.stringify([rtdEventType, correlationId]);
233
+ }
234
+
235
+ private removeRtdRequest<T>(
236
+ rtdEventType: string,
237
+ correlationId: string,
238
+ settle?: (request: PendingRtdRequest<T>) => void
239
+ ): PendingRtdRequest<T> | undefined {
240
+ const key = ApiAIAssistant.getRtdRequestKey(rtdEventType, correlationId);
241
+ const request = this.pendingRtdRequests.get(key) as PendingRtdRequest<T> | undefined;
242
+
243
+ if (!request) {
244
+ return undefined;
245
+ }
246
+
247
+ if (request.timeoutId) {
248
+ clearTimeout(request.timeoutId);
249
+ }
250
+
251
+ settle?.(request);
252
+ this.pendingRtdRequests.delete(key);
253
+
254
+ return request;
255
+ }
256
+
257
+ /** Sends an AI event and waits for its matching RTD response. @internal */
258
+ public async requestAndWaitForRtd<T>(options: RtdRequestOptions): Promise<T> {
259
+ const key = ApiAIAssistant.getRtdRequestKey(options.rtdEventType, options.correlationId);
260
+ let resolveResult: (payload: T) => void = () => undefined;
261
+ let rejectResult: (error: Error) => void = () => undefined;
262
+ const result = new Promise<T>((resolve, reject) => {
263
+ resolveResult = resolve;
264
+ rejectResult = reject;
265
+ });
266
+ const previousRequest = this.pendingRtdRequests.get(key);
267
+ if (previousRequest?.timeoutId) {
268
+ clearTimeout(previousRequest.timeoutId);
269
+ }
270
+ const request: PendingRtdRequest<T> = {
271
+ correlationId: options.correlationId,
272
+ rtdEventType: options.rtdEventType,
273
+ resolve: resolveResult,
274
+ reject: rejectResult,
275
+ };
276
+
277
+ request.timeoutId = setTimeout(() => {
278
+ this.removeRtdRequest<T>(options.rtdEventType, options.correlationId, (currentRequest) => {
279
+ currentRequest.reject(options.createTimeoutError());
280
+ });
281
+ }, options.timeoutMs);
282
+ this.pendingRtdRequests.set(key, request as PendingRtdRequest<unknown>);
283
+ const publishTimestamp = options.publishTimestamp ?? Date.now();
284
+ const acknowledgement = Promise.resolve()
285
+ .then(() =>
286
+ this.sendEvent(
287
+ options.agentId,
288
+ options.interactionId,
289
+ options.eventType,
290
+ options.eventName,
291
+ options.eventMetaData,
292
+ undefined,
293
+ undefined,
294
+ publishTimestamp,
295
+ options.timeout
296
+ )
297
+ )
298
+ .catch((error) => {
299
+ this.removeRtdRequest(options.rtdEventType, options.correlationId);
300
+ throw error;
301
+ });
302
+
303
+ const [payload] = await Promise.all([result, acknowledgement]);
304
+
305
+ return payload;
306
+ }
307
+
308
+ /** Resolves a pending request from a parsed RTD event. @internal */
309
+ public resolveFromRtdEvent<T>(
310
+ rtdEventType: string,
311
+ correlationId: string,
312
+ payload: T
313
+ ): 'resolved' | 'not-found' {
314
+ const request = this.removeRtdRequest<T>(rtdEventType, correlationId, (currentRequest) => {
315
+ currentRequest.resolve(payload);
316
+ });
317
+
318
+ return request ? 'resolved' : 'not-found';
319
+ }
320
+
321
+ /** Clears pending RTD requests when the RTD lifecycle ends. @internal */
322
+ public clearAllRtdRequests(): void {
323
+ Array.from(this.pendingRtdRequests.values()).forEach((request) => {
324
+ this.removeRtdRequest(request.rtdEventType, request.correlationId, (currentRequest) => {
325
+ currentRequest.reject(new Error('RTD request cleared'));
326
+ });
327
+ });
328
+ }
329
+
227
330
  /**
228
331
  * Sends an event to the AI Assistant service.
229
332
  * @param agentId - agent identifier
@@ -241,7 +344,9 @@ export class ApiAIAssistant {
241
344
  eventName: AIAssistantEventName,
242
345
  eventMetaData?: Record<string, unknown>,
243
346
  languageCode?: string,
244
- trackingId?: string
347
+ trackingId?: string,
348
+ publishTimestamp?: number,
349
+ timeout?: number
245
350
  ): Promise<Record<string, unknown>> {
246
351
  LoggerProxy.info('Sending event', {
247
352
  module: CC_FILE,
@@ -257,23 +362,26 @@ export class ApiAIAssistant {
257
362
  try {
258
363
  const baseUrl = this.getBaseUrl();
259
364
  const orgId = this.webex.credentials.getOrgId();
365
+ const data = {
366
+ ...eventMetaData,
367
+ interactionId,
368
+ actionTimeStamp: String(Date.now()),
369
+ languageCode,
370
+ trackingId,
371
+ };
260
372
  const response = (await this.webex.request({
261
373
  uri: `${baseUrl}${AI_ASSISTANT_API_URLS.EVENT}`,
262
374
  method: HTTP_METHODS.POST,
263
375
  addAuthHeader: true,
376
+ ...(timeout !== undefined ? {timeout} : {}),
264
377
  body: {
265
378
  agentId,
266
379
  orgId,
267
380
  eventType,
268
381
  eventName,
382
+ ...(publishTimestamp !== undefined ? {publishTimestamp} : {}),
269
383
  eventDetails: {
270
- data: {
271
- ...eventMetaData,
272
- interactionId,
273
- actionTimeStamp: String(Date.now()),
274
- languageCode,
275
- trackingId,
276
- },
384
+ data,
277
385
  },
278
386
  },
279
387
  })) as IHttpResponse;
@@ -11,7 +11,9 @@ type Enum<T extends Record<string, unknown>> = T[keyof T];
11
11
  export type CollaborationAccess = Enum<typeof COLLABORATION_ACCESS>;
12
12
 
13
13
  /**
14
- * Events emitted on task objects
14
+ * Contact Center backend and realtime event types.
15
+ *
16
+ * Includes task lifecycle, transcript, suggested-response, and AI summary events.
15
17
  * @enum {string}
16
18
  * @private
17
19
  * @ignore
@@ -141,10 +143,14 @@ export const CC_TASK_EVENTS = {
141
143
  SUGGESTED_RESPONSE: 'SUGGESTED_RESPONSE',
142
144
  /** Event emitted when backend acknowledges it is listening for more context */
143
145
  SUGGESTED_RESPONSE_ACKNOWLEDGE: 'SUGGESTED_RESPONSE_ACKNOWLEDGE',
144
- /** Event emitted when a mid-call summary is available */
145
- MID_CALL_SUMMARY: 'MID_CALL_SUMMARY',
146
- /** Event emitted when a post-call summary is available */
146
+ /** Event received when a post-call summary is available through realtime delivery */
147
147
  POST_CALL_SUMMARY: 'POST_CALL_SUMMARY',
148
+ /** Event received when a mid-call summary is available through realtime delivery */
149
+ MID_CALL_SUMMARY: 'MID_CALL_SUMMARY',
150
+ /** Event received when AI-summary feature enablement is available through realtime delivery */
151
+ FEATURE_ENABLEMENT: 'FEATURE_ENABLEMENT',
152
+ /** Event received when a subsequent agent receives a mid-call summary */
153
+ MID_CALL_SUMMARY_RESPONSE_SUBSEQUENT_AGENT: 'MID_CALL_SUMMARY_RESPONSE_SUBSEQUENT_AGENT',
148
154
  } as const;
149
155
 
150
156
  /**
@@ -1,4 +1,10 @@
1
- import {HTTP_METHODS, RequestBody, WebexRequestPayload} from '../../types';
1
+ import {
2
+ AIAssistantEventName,
3
+ AIAssistantEventType,
4
+ HTTP_METHODS,
5
+ RequestBody,
6
+ WebexRequestPayload,
7
+ } from '../../types';
2
8
  import * as Err from './Err';
3
9
  import {Msg} from './GlobalTypes';
4
10
 
@@ -48,3 +54,27 @@ export type ConfEmpty<TRes, TErr> = () => Req<TRes, TErr>;
48
54
  export type Res<TRes, TReq> = (p: TReq, cbRes?: CbRes<TRes>) => Promise<TRes>;
49
55
  export type ResEmpty<TRes> = (cbRes?: CbRes<TRes>) => Promise<TRes>;
50
56
  export type CbRes<TRes> = (res: any) => void | TRes;
57
+
58
+ /** @internal Pending request completed by a correlated RTD response. */
59
+ export type PendingRtdRequest<T> = {
60
+ correlationId: string;
61
+ rtdEventType: string;
62
+ timeoutId?: ReturnType<typeof setTimeout>;
63
+ resolve: (payload: T) => void;
64
+ reject: (error: Error) => void;
65
+ };
66
+
67
+ /** @internal Request configuration for an event completed by an RTD response. */
68
+ export type RtdRequestOptions = Readonly<{
69
+ correlationId: string;
70
+ rtdEventType: string;
71
+ timeoutMs: number;
72
+ createTimeoutError: () => Error;
73
+ agentId: string;
74
+ interactionId: string;
75
+ eventType: AIAssistantEventType;
76
+ eventName: AIAssistantEventName;
77
+ eventMetaData?: Record<string, unknown>;
78
+ publishTimestamp?: number;
79
+ timeout?: number;
80
+ }>;