@webex/contact-center 3.12.0-next.9 → 3.12.0-task-refactor.2

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 (200) hide show
  1. package/AGENTS.md +438 -0
  2. package/ai-docs/README.md +131 -0
  3. package/ai-docs/RULES.md +455 -0
  4. package/ai-docs/patterns/event-driven-patterns.md +485 -0
  5. package/ai-docs/patterns/testing-patterns.md +480 -0
  6. package/ai-docs/patterns/typescript-patterns.md +365 -0
  7. package/ai-docs/templates/README.md +102 -0
  8. package/ai-docs/templates/documentation/create-agents-md.md +240 -0
  9. package/ai-docs/templates/documentation/create-architecture-md.md +295 -0
  10. package/ai-docs/templates/existing-service/bug-fix.md +254 -0
  11. package/ai-docs/templates/existing-service/feature-enhancement.md +450 -0
  12. package/ai-docs/templates/new-method/00-master.md +80 -0
  13. package/ai-docs/templates/new-method/01-requirements.md +232 -0
  14. package/ai-docs/templates/new-method/02-implementation.md +295 -0
  15. package/ai-docs/templates/new-method/03-tests.md +201 -0
  16. package/ai-docs/templates/new-method/04-validation.md +141 -0
  17. package/ai-docs/templates/new-service/00-master.md +109 -0
  18. package/ai-docs/templates/new-service/01-pre-questions.md +159 -0
  19. package/ai-docs/templates/new-service/02-code-generation.md +346 -0
  20. package/ai-docs/templates/new-service/03-integration.md +178 -0
  21. package/ai-docs/templates/new-service/04-test-generation.md +205 -0
  22. package/ai-docs/templates/new-service/05-validation.md +145 -0
  23. package/dist/cc.js +65 -123
  24. package/dist/cc.js.map +1 -1
  25. package/dist/constants.js +13 -2
  26. package/dist/constants.js.map +1 -1
  27. package/dist/index.js +13 -5
  28. package/dist/index.js.map +1 -1
  29. package/dist/metrics/behavioral-events.js +26 -13
  30. package/dist/metrics/behavioral-events.js.map +1 -1
  31. package/dist/metrics/constants.js +7 -6
  32. package/dist/metrics/constants.js.map +1 -1
  33. package/dist/services/ApiAiAssistant.js +0 -3
  34. package/dist/services/ApiAiAssistant.js.map +1 -1
  35. package/dist/services/config/Util.js +2 -3
  36. package/dist/services/config/Util.js.map +1 -1
  37. package/dist/services/config/types.js +16 -14
  38. package/dist/services/config/types.js.map +1 -1
  39. package/dist/services/constants.js +0 -1
  40. package/dist/services/constants.js.map +1 -1
  41. package/dist/services/core/Err.js.map +1 -1
  42. package/dist/services/core/Utils.js +79 -55
  43. package/dist/services/core/Utils.js.map +1 -1
  44. package/dist/services/core/aqm-reqs.js +17 -92
  45. package/dist/services/core/aqm-reqs.js.map +1 -1
  46. package/dist/services/core/websocket/WebSocketManager.js +5 -25
  47. package/dist/services/core/websocket/WebSocketManager.js.map +1 -1
  48. package/dist/services/core/websocket/types.js.map +1 -1
  49. package/dist/services/index.js +1 -2
  50. package/dist/services/index.js.map +1 -1
  51. package/dist/services/task/Task.js +644 -0
  52. package/dist/services/task/Task.js.map +1 -0
  53. package/dist/services/task/TaskFactory.js +45 -0
  54. package/dist/services/task/TaskFactory.js.map +1 -0
  55. package/dist/services/task/TaskManager.js +570 -535
  56. package/dist/services/task/TaskManager.js.map +1 -1
  57. package/dist/services/task/TaskUtils.js +132 -28
  58. package/dist/services/task/TaskUtils.js.map +1 -1
  59. package/dist/services/task/constants.js +7 -6
  60. package/dist/services/task/constants.js.map +1 -1
  61. package/dist/services/task/dialer.js +0 -51
  62. package/dist/services/task/dialer.js.map +1 -1
  63. package/dist/services/task/digital/Digital.js +77 -0
  64. package/dist/services/task/digital/Digital.js.map +1 -0
  65. package/dist/services/task/state-machine/TaskStateMachine.js +634 -0
  66. package/dist/services/task/state-machine/TaskStateMachine.js.map +1 -0
  67. package/dist/services/task/state-machine/actions.js +372 -0
  68. package/dist/services/task/state-machine/actions.js.map +1 -0
  69. package/dist/services/task/state-machine/constants.js +139 -0
  70. package/dist/services/task/state-machine/constants.js.map +1 -0
  71. package/dist/services/task/state-machine/guards.js +263 -0
  72. package/dist/services/task/state-machine/guards.js.map +1 -0
  73. package/dist/services/task/state-machine/index.js +53 -0
  74. package/dist/services/task/state-machine/index.js.map +1 -0
  75. package/dist/services/task/state-machine/types.js +54 -0
  76. package/dist/services/task/state-machine/types.js.map +1 -0
  77. package/dist/services/task/state-machine/uiControlsComputer.js +377 -0
  78. package/dist/services/task/state-machine/uiControlsComputer.js.map +1 -0
  79. package/dist/services/task/taskDataNormalizer.js +99 -0
  80. package/dist/services/task/taskDataNormalizer.js.map +1 -0
  81. package/dist/services/task/types.js +157 -18
  82. package/dist/services/task/types.js.map +1 -1
  83. package/dist/services/task/voice/Voice.js +1031 -0
  84. package/dist/services/task/voice/Voice.js.map +1 -0
  85. package/dist/services/task/voice/WebRTC.js +149 -0
  86. package/dist/services/task/voice/WebRTC.js.map +1 -0
  87. package/dist/types/cc.d.ts +4 -33
  88. package/dist/types/constants.d.ts +13 -2
  89. package/dist/types/index.d.ts +11 -5
  90. package/dist/types/metrics/constants.d.ts +5 -3
  91. package/dist/types/services/ApiAiAssistant.d.ts +1 -1
  92. package/dist/types/services/config/types.d.ts +97 -25
  93. package/dist/types/services/core/Err.d.ts +0 -2
  94. package/dist/types/services/core/Utils.d.ts +25 -23
  95. package/dist/types/services/core/aqm-reqs.d.ts +0 -49
  96. package/dist/types/services/core/websocket/WebSocketManager.d.ts +1 -1
  97. package/dist/types/services/core/websocket/connection-service.d.ts +0 -1
  98. package/dist/types/services/core/websocket/types.d.ts +1 -1
  99. package/dist/types/services/index.d.ts +1 -1
  100. package/dist/types/services/task/Task.d.ts +146 -0
  101. package/dist/types/services/task/TaskFactory.d.ts +12 -0
  102. package/dist/types/services/task/TaskUtils.d.ts +39 -8
  103. package/dist/types/services/task/constants.d.ts +5 -4
  104. package/dist/types/services/task/dialer.d.ts +0 -15
  105. package/dist/types/services/task/digital/Digital.d.ts +22 -0
  106. package/dist/types/services/task/state-machine/TaskStateMachine.d.ts +906 -0
  107. package/dist/types/services/task/state-machine/actions.d.ts +8 -0
  108. package/dist/types/services/task/state-machine/constants.d.ts +91 -0
  109. package/dist/types/services/task/state-machine/guards.d.ts +78 -0
  110. package/dist/types/services/task/state-machine/index.d.ts +13 -0
  111. package/dist/types/services/task/state-machine/types.d.ts +256 -0
  112. package/dist/types/services/task/state-machine/uiControlsComputer.d.ts +9 -0
  113. package/dist/types/services/task/taskDataNormalizer.d.ts +10 -0
  114. package/dist/types/services/task/types.d.ts +539 -88
  115. package/dist/types/services/task/voice/Voice.d.ts +183 -0
  116. package/dist/types/services/task/voice/WebRTC.d.ts +53 -0
  117. package/dist/types/types.d.ts +68 -0
  118. package/dist/types/webex.d.ts +1 -0
  119. package/dist/types.js +70 -0
  120. package/dist/types.js.map +1 -1
  121. package/dist/webex.js +14 -2
  122. package/dist/webex.js.map +1 -1
  123. package/package.json +14 -11
  124. package/src/cc.ts +91 -177
  125. package/src/constants.ts +13 -2
  126. package/src/index.ts +14 -5
  127. package/src/metrics/ai-docs/AGENTS.md +348 -0
  128. package/src/metrics/ai-docs/ARCHITECTURE.md +336 -0
  129. package/src/metrics/behavioral-events.ts +28 -14
  130. package/src/metrics/constants.ts +7 -8
  131. package/src/services/ApiAiAssistant.ts +2 -4
  132. package/src/services/agent/ai-docs/AGENTS.md +238 -0
  133. package/src/services/agent/ai-docs/ARCHITECTURE.md +302 -0
  134. package/src/services/ai-docs/AGENTS.md +384 -0
  135. package/src/services/config/Util.ts +2 -3
  136. package/src/services/config/ai-docs/AGENTS.md +253 -0
  137. package/src/services/config/ai-docs/ARCHITECTURE.md +424 -0
  138. package/src/services/config/types.ts +108 -20
  139. package/src/services/constants.ts +0 -1
  140. package/src/services/core/Err.ts +0 -1
  141. package/src/services/core/Utils.ts +90 -67
  142. package/src/services/core/ai-docs/AGENTS.md +379 -0
  143. package/src/services/core/ai-docs/ARCHITECTURE.md +696 -0
  144. package/src/services/core/aqm-reqs.ts +22 -100
  145. package/src/services/core/websocket/WebSocketManager.ts +4 -23
  146. package/src/services/core/websocket/types.ts +1 -1
  147. package/src/services/index.ts +1 -2
  148. package/src/services/task/Task.ts +785 -0
  149. package/src/services/task/TaskFactory.ts +55 -0
  150. package/src/services/task/TaskManager.ts +579 -633
  151. package/src/services/task/TaskUtils.ts +175 -31
  152. package/src/services/task/ai-docs/AGENTS.md +448 -0
  153. package/src/services/task/ai-docs/ARCHITECTURE.md +573 -0
  154. package/src/services/task/constants.ts +5 -4
  155. package/src/services/task/dialer.ts +1 -56
  156. package/src/services/task/digital/Digital.ts +95 -0
  157. package/src/services/task/state-machine/TaskStateMachine.ts +793 -0
  158. package/src/services/task/state-machine/actions.ts +422 -0
  159. package/src/services/task/state-machine/ai-docs/AGENTS.md +495 -0
  160. package/src/services/task/state-machine/ai-docs/ARCHITECTURE.md +1135 -0
  161. package/src/services/task/state-machine/constants.ts +150 -0
  162. package/src/services/task/state-machine/guards.ts +303 -0
  163. package/src/services/task/state-machine/index.ts +28 -0
  164. package/src/services/task/state-machine/types.ts +228 -0
  165. package/src/services/task/state-machine/uiControlsComputer.ts +542 -0
  166. package/src/services/task/taskDataNormalizer.ts +137 -0
  167. package/src/services/task/types.ts +641 -95
  168. package/src/services/task/voice/Voice.ts +1255 -0
  169. package/src/services/task/voice/WebRTC.ts +187 -0
  170. package/src/types.ts +88 -5
  171. package/src/utils/AGENTS.md +276 -0
  172. package/src/webex.js +2 -0
  173. package/test/unit/spec/cc.ts +59 -142
  174. package/test/unit/spec/logger-proxy.ts +70 -0
  175. package/test/unit/spec/services/ApiAiAssistant.ts +17 -0
  176. package/test/unit/spec/services/config/index.ts +26 -55
  177. package/test/unit/spec/services/core/Utils.ts +103 -52
  178. package/test/unit/spec/services/core/websocket/WebSocketManager.ts +48 -112
  179. package/test/unit/spec/services/core/websocket/connection-service.ts +5 -4
  180. package/test/unit/spec/services/task/AutoWrapup.ts +63 -0
  181. package/test/unit/spec/services/task/Task.ts +416 -0
  182. package/test/unit/spec/services/task/TaskFactory.ts +62 -0
  183. package/test/unit/spec/services/task/TaskManager.ts +781 -1735
  184. package/test/unit/spec/services/task/TaskUtils.ts +125 -0
  185. package/test/unit/spec/services/task/dialer.ts +112 -198
  186. package/test/unit/spec/services/task/digital/Digital.ts +105 -0
  187. package/test/unit/spec/services/task/state-machine/TaskStateMachine.ts +473 -0
  188. package/test/unit/spec/services/task/state-machine/guards.ts +288 -0
  189. package/test/unit/spec/services/task/state-machine/types.ts +18 -0
  190. package/test/unit/spec/services/task/state-machine/uiControlsComputer.ts +147 -0
  191. package/test/unit/spec/services/task/taskTestUtils.ts +87 -0
  192. package/test/unit/spec/services/task/voice/Voice.ts +587 -0
  193. package/test/unit/spec/services/task/voice/WebRTC.ts +242 -0
  194. package/umd/contact-center.min.js +2 -2
  195. package/umd/contact-center.min.js.map +1 -1
  196. package/dist/services/task/index.js +0 -1525
  197. package/dist/services/task/index.js.map +0 -1
  198. package/dist/types/services/task/index.d.ts +0 -650
  199. package/src/services/task/index.ts +0 -1801
  200. package/test/unit/spec/services/task/index.ts +0 -2184
package/dist/webex.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_merge","_interopRequireDefault","require","_webexCore","_safeBuffer","_webexConfig","e","__esModule","default","global","Buffer","Webex","WebexCore","extend","webex","version","init","attrs","config","merge","_default","exports"],"sources":["webex.js"],"sourcesContent":["import merge from 'lodash/merge';\nimport WebexCore from '@webex/webex-core';\nimport {Buffer} from 'safe-buffer';\nimport '@webex/plugin-authorization';\nimport '@webex/internal-plugin-mercury';\nimport '@webex/plugin-logger';\nimport '@webex/internal-plugin-support';\n\nimport './index';\n\nimport config from './webex-config';\n\n/**\n * Ensures global Buffer is defined, which is required for SDK functionality in some environments.\n * @ignore\n */\nif (!global.Buffer) {\n global.Buffer = Buffer;\n}\n\n/**\n * Webex SDK class extended from the core SDK.\n * Includes custom configuration and plugin registration for CC (Contact Center) use cases.\n * @ignore\n */\nconst Webex = WebexCore.extend({\n webex: true,\n version: PACKAGE_VERSION,\n});\n\n/**\n * Initializes a new Webex instance with merged configuration.\n *\n * @param {Object} [attrs={}] - Initialization attributes.\n * @param {Object} [attrs.config] - Optional custom config to override defaults.\n * @param {Object} [attrs.config.logger] - Logging configuration.\n * @param {string} [attrs.config.logger.level='info'] - Logging level (e.g., 'debug', 'info').\n * @param {string} [attrs.config.logger.bufferLogLevel='log'] - Log buffering level for log uploads.\n * @param {Object} [attrs.config.cc] - Contact Center (CC) specific configurations.\n * @param {boolean} [attrs.config.cc.allowMultiLogin=false] - Whether to allow multiple logins.\n * @param {boolean} [attrs.config.cc.allowAutomatedRelogin=true] - Whether to allow automated re-login.\n * @param {string} [attrs.config.cc.clientType='WebexCCSDK'] - Type of the client.\n * @param {boolean} [attrs.config.cc.isKeepAliveEnabled=false] - Whether to enable keep-alive functionality.\n * @param {boolean} [attrs.config.cc.force=true] - Whether to force specific CC configurations.\n * @param {Object} [attrs.config.cc.metrics] - Metrics configuration for CC.\n * @param {string} [attrs.config.cc.metrics.clientName='WEBEX_JS_SDK'] - Metrics client name.\n * @param {string} [attrs.config.cc.metrics.clientType='WebexCCSDK'] - Metrics client type.\n * @returns {Webex} A new Webex instance.\n *\n * @see {@link https://developer.webex.com/meeting/docs/sdks/webex-meetings-sdk-web-quickstart#webex-object-attribute-reference} - Webex Object Attribute Reference for SDK Configuration.\n *\n * This configuration merges the default `webex-config` with any custom configuration provided as `attrs.config`.\n * The merged configuration governs various SDK behaviors, such as authorization, logging, and CC-specific settings.\n *\n * @example <caption>Basic Usage</caption>\n * import Webex from '@webex/contact-center';\n *\n * // Initialize Webex SDK with default configuration\n * const webex = Webex.init();\n *\n * @example <caption>Custom Configuration</caption>\n * import Webex from '@webex/contact-center';\n *\n * const customConfig = {\n * logger: {\n * level: 'debug', // Enable debug logging\n * bufferLogLevel: 'log', // Used for upload logs\n * },\n * credentials: {\n * client_id: 'your-client-id', // Replace with your Webex application's client ID\n * client_secret: 'your-client-secret', // Replace with your Webex application's client secret\n * redirect_uri: 'https://your-redirect-uri', // Replace with your app's redirect URI\n * },\n * cc: {\n * allowMultiLogin: false, // Disallow multiple logins\n * allowAutomatedRelogin: true, // Enable automated re-login\n * clientType: 'WebexCCSDK', // Specify the Contact Center client type\n * isKeepAliveEnabled: false, // Disable keep-alive functionality\n * force: true, // Force CC-specific configurations\n * metrics: {\n * clientName: 'WEBEX_JS_SDK', // Metrics client name\n * clientType: 'WebexCCSDK', // Metrics client type\n * },\n * },\n * };\n *\n * // Initialize Webex SDK with custom configuration\n * const webex = Webex.init({ config: customConfig });\n */\nWebex.init = function init(attrs = {}) {\n attrs.config = merge({}, config, attrs.config);\n\n return new Webex(attrs);\n};\n\nexport default Webex;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEAA,OAAA;AAEA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC;AACA;AACA;AACA;AACA,IAAI,CAACG,MAAM,CAACC,MAAM,EAAE;EAClBD,MAAM,CAACC,MAAM,GAAGA,kBAAM;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAGC,kBAAS,CAACC,MAAM,CAAC;EAC7BC,KAAK,EAAE,IAAI;EACXC,OAAO;AACT,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAJ,KAAK,CAACK,IAAI,GAAG,SAASA,IAAIA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAE;EACrCA,KAAK,CAACC,MAAM,GAAG,IAAAC,cAAK,EAAC,CAAC,CAAC,EAAED,oBAAM,EAAED,KAAK,CAACC,MAAM,CAAC;EAE9C,OAAO,IAAIP,KAAK,CAACM,KAAK,CAAC;AACzB,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAb,OAAA,GAEaG,KAAK","ignoreList":[]}
1
+ {"version":3,"names":["_merge","_interopRequireDefault","require","_webexCore","_safeBuffer","_index","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_webexConfig","e","__esModule","default","global","Buffer","Webex","WebexCore","extend","webex","version","init","attrs","config","merge","_default"],"sources":["webex.js"],"sourcesContent":["import merge from 'lodash/merge';\nimport WebexCore from '@webex/webex-core';\nimport {Buffer} from 'safe-buffer';\nimport '@webex/plugin-authorization';\nimport '@webex/internal-plugin-mercury';\nimport '@webex/plugin-logger';\nimport '@webex/internal-plugin-support';\n\nimport './index';\n\nimport config from './webex-config';\n\nexport * from './index';\n\n/**\n * Ensures global Buffer is defined, which is required for SDK functionality in some environments.\n * @ignore\n */\nif (!global.Buffer) {\n global.Buffer = Buffer;\n}\n\n/**\n * Webex SDK class extended from the core SDK.\n * Includes custom configuration and plugin registration for CC (Contact Center) use cases.\n * @ignore\n */\nconst Webex = WebexCore.extend({\n webex: true,\n version: PACKAGE_VERSION,\n});\n\n/**\n * Initializes a new Webex instance with merged configuration.\n *\n * @param {Object} [attrs={}] - Initialization attributes.\n * @param {Object} [attrs.config] - Optional custom config to override defaults.\n * @param {Object} [attrs.config.logger] - Logging configuration.\n * @param {string} [attrs.config.logger.level='info'] - Logging level (e.g., 'debug', 'info').\n * @param {string} [attrs.config.logger.bufferLogLevel='log'] - Log buffering level for log uploads.\n * @param {Object} [attrs.config.cc] - Contact Center (CC) specific configurations.\n * @param {boolean} [attrs.config.cc.allowMultiLogin=false] - Whether to allow multiple logins.\n * @param {boolean} [attrs.config.cc.allowAutomatedRelogin=true] - Whether to allow automated re-login.\n * @param {string} [attrs.config.cc.clientType='WebexCCSDK'] - Type of the client.\n * @param {boolean} [attrs.config.cc.isKeepAliveEnabled=false] - Whether to enable keep-alive functionality.\n * @param {boolean} [attrs.config.cc.force=true] - Whether to force specific CC configurations.\n * @param {Object} [attrs.config.cc.metrics] - Metrics configuration for CC.\n * @param {string} [attrs.config.cc.metrics.clientName='WEBEX_JS_SDK'] - Metrics client name.\n * @param {string} [attrs.config.cc.metrics.clientType='WebexCCSDK'] - Metrics client type.\n * @returns {Webex} A new Webex instance.\n *\n * @see {@link https://developer.webex.com/meeting/docs/sdks/webex-meetings-sdk-web-quickstart#webex-object-attribute-reference} - Webex Object Attribute Reference for SDK Configuration.\n *\n * This configuration merges the default `webex-config` with any custom configuration provided as `attrs.config`.\n * The merged configuration governs various SDK behaviors, such as authorization, logging, and CC-specific settings.\n *\n * @example <caption>Basic Usage</caption>\n * import Webex from '@webex/contact-center';\n *\n * // Initialize Webex SDK with default configuration\n * const webex = Webex.init();\n *\n * @example <caption>Custom Configuration</caption>\n * import Webex from '@webex/contact-center';\n *\n * const customConfig = {\n * logger: {\n * level: 'debug', // Enable debug logging\n * bufferLogLevel: 'log', // Used for upload logs\n * },\n * credentials: {\n * client_id: 'your-client-id', // Replace with your Webex application's client ID\n * client_secret: 'your-client-secret', // Replace with your Webex application's client secret\n * redirect_uri: 'https://your-redirect-uri', // Replace with your app's redirect URI\n * },\n * cc: {\n * allowMultiLogin: false, // Disallow multiple logins\n * allowAutomatedRelogin: true, // Enable automated re-login\n * clientType: 'WebexCCSDK', // Specify the Contact Center client type\n * isKeepAliveEnabled: false, // Disable keep-alive functionality\n * force: true, // Force CC-specific configurations\n * metrics: {\n * clientName: 'WEBEX_JS_SDK', // Metrics client name\n * clientType: 'WebexCCSDK', // Metrics client type\n * },\n * },\n * };\n *\n * // Initialize Webex SDK with custom configuration\n * const webex = Webex.init({ config: customConfig });\n */\nWebex.init = function init(attrs = {}) {\n attrs.config = merge({}, config, attrs.config);\n\n return new Webex(attrs);\n};\n\nexport default Webex;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAIAI,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAFA,IAAAS,YAAA,GAAAjB,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAkB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIpC;AACA;AACA;AACA;AACA,IAAI,CAACG,MAAM,CAACC,MAAM,EAAE;EAClBD,MAAM,CAACC,MAAM,GAAGA,kBAAM;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAGC,kBAAS,CAACC,MAAM,CAAC;EAC7BC,KAAK,EAAE,IAAI;EACXC,OAAO;AACT,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAJ,KAAK,CAACK,IAAI,GAAG,SAASA,IAAIA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAE;EACrCA,KAAK,CAACC,MAAM,GAAG,IAAAC,cAAK,EAAC,CAAC,CAAC,EAAED,oBAAM,EAAED,KAAK,CAACC,MAAM,CAAC;EAE9C,OAAO,IAAIP,KAAK,CAACM,KAAK,CAAC;AACzB,CAAC;AAAC,IAAAG,QAAA,GAAAnB,OAAA,CAAAO,OAAA,GAEaG,KAAK","ignoreList":[]}
package/package.json CHANGED
@@ -45,15 +45,17 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@types/platform": "1.3.4",
48
- "@webex/calling": "3.12.0-next.8",
49
- "@webex/internal-plugin-mercury": "3.12.0-next.2",
50
- "@webex/internal-plugin-metrics": "3.12.0-next.2",
51
- "@webex/internal-plugin-support": "3.12.0-next.2",
52
- "@webex/plugin-authorization": "3.12.0-next.2",
53
- "@webex/plugin-logger": "3.12.0-next.2",
54
- "@webex/webex-core": "3.12.0-next.2",
48
+ "@webex/calling": "3.12.0-task-refactor.1",
49
+ "@webex/internal-plugin-mercury": "3.12.0-task-refactor.1",
50
+ "@webex/internal-plugin-metrics": "3.12.0-task-refactor.1",
51
+ "@webex/internal-plugin-support": "3.12.0-task-refactor.1",
52
+ "@webex/plugin-authorization": "3.12.0-task-refactor.1",
53
+ "@webex/plugin-logger": "3.12.0-task-refactor.1",
54
+ "@webex/webex-core": "3.12.0-task-refactor.1",
55
55
  "jest-html-reporters": "3.0.11",
56
- "lodash": "^4.17.21"
56
+ "lodash": "^4.17.21",
57
+ "uuid": "^3.3.2",
58
+ "xstate": "5.24.0"
57
59
  },
58
60
  "devDependencies": {
59
61
  "@babel/core": "^7.22.11",
@@ -65,7 +67,8 @@
65
67
  "@webex/eslint-config-legacy": "0.0.0",
66
68
  "@webex/jest-config-legacy": "0.0.0",
67
69
  "@webex/legacy-tools": "0.0.0",
68
- "@webex/test-helper-mock-webex": "3.11.0-next.1",
70
+ "@webex/test-helper-mock-webex": "3.12.0-task-refactor.1",
71
+ "@xstate/inspect": "^0.8.0",
69
72
  "eslint": "^8.24.0",
70
73
  "eslint-config-airbnb-base": "15.0.0",
71
74
  "eslint-config-prettier": "8.3.0",
@@ -78,7 +81,7 @@
78
81
  "jest-junit": "13.0.0",
79
82
  "prettier": "2.5.1",
80
83
  "typedoc": "^0.25.0",
81
- "typescript": "4.9.5"
84
+ "typescript": "5.4.5"
82
85
  },
83
- "version": "3.12.0-next.9"
86
+ "version": "3.12.0-task-refactor.2"
84
87
  }
package/src/cc.ts CHANGED
@@ -25,6 +25,7 @@ import {
25
25
  UploadLogsResponse,
26
26
  UpdateDeviceTypeResponse,
27
27
  GenericError,
28
+ ConfigFlags,
28
29
  } from './types';
29
30
  import {
30
31
  READY,
@@ -55,13 +56,7 @@ import {
55
56
  import {ConnectionLostDetails} from './services/core/websocket/types';
56
57
  import TaskManager from './services/task/TaskManager';
57
58
  import WebCallingService from './services/WebCallingService';
58
- import {
59
- ITask,
60
- TASK_EVENTS,
61
- TaskResponse,
62
- DialerPayload,
63
- PreviewContactPayload,
64
- } from './services/task/types';
59
+ import {ITask, TASK_EVENTS, TaskResponse, DialerPayload} from './services/task/types';
65
60
  import MetricsManager from './metrics/MetricsManager';
66
61
  import {METRIC_EVENT_NAMES} from './metrics/constants';
67
62
  import {Failure} from './services/core/GlobalTypes';
@@ -126,7 +121,6 @@ import type {
126
121
  * - `task:established` - Task/call has been connected
127
122
  * - `task:ended` - Task/call has ended
128
123
  * - `task:error` - An error occurred during task handling
129
- * - `task:campaignPreviewReservation` - Campaign preview contact offered to agent
130
124
  *
131
125
  * @public
132
126
  *
@@ -325,7 +319,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
325
319
  * });
326
320
  * ```
327
321
  */
328
- private queue: Queue;
322
+ public queue: Queue;
329
323
 
330
324
  /**
331
325
  * API instance for AI Assistant operations such as transcript controls.
@@ -378,7 +372,8 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
378
372
  this.apiAIAssistant,
379
373
  this.services.contact,
380
374
  this.webCallingService,
381
- this.services.webSocketManager
375
+ this.services.webSocketManager,
376
+ this.services.rtdWebSocketManager
382
377
  );
383
378
  this.incomingTaskListener();
384
379
 
@@ -421,20 +416,6 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
421
416
  this.trigger(TASK_EVENTS.TASK_MERGED, task);
422
417
  };
423
418
 
424
- /**
425
- * Handles campaign preview reservation events when a contact is offered to the agent
426
- * @private
427
- * @param {ITask} task The campaign reservation task
428
- */
429
- private handleCampaignPreviewReservation = (task: ITask) => {
430
- // @ts-ignore
431
- this.trigger(TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION, task);
432
- };
433
-
434
- private handleRTDWebsocketMessage = (payload: string) => {
435
- this.taskManager.handleRealtimeWebsocketEvent(payload);
436
- };
437
-
438
419
  /**
439
420
  * Sets up event listeners for incoming tasks and task hydration
440
421
  * Subscribes to task events from the task manager
@@ -444,10 +425,6 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
444
425
  this.taskManager.on(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);
445
426
  this.taskManager.on(TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);
446
427
  this.taskManager.on(TASK_EVENTS.TASK_MERGED, this.handleTaskMerged);
447
- this.taskManager.on(
448
- TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION,
449
- this.handleCampaignPreviewReservation
450
- );
451
428
  }
452
429
 
453
430
  /**
@@ -576,10 +553,6 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
576
553
 
577
554
  this.taskManager.off(TASK_EVENTS.TASK_INCOMING, this.handleIncomingTask);
578
555
  this.taskManager.off(TASK_EVENTS.TASK_HYDRATE, this.handleTaskHydrate);
579
- this.taskManager.off(
580
- TASK_EVENTS.TASK_CAMPAIGN_PREVIEW_RESERVATION,
581
- this.handleCampaignPreviewReservation
582
- );
583
556
  this.taskManager.unregisterIncomingCallEvent();
584
557
 
585
558
  this.services.webSocketManager.off('message', this.handleWebsocketMessage);
@@ -606,9 +579,8 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
606
579
  if (!this.services.webSocketManager.isSocketClosed) {
607
580
  this.services.webSocketManager.close(false, 'Unregistering the SDK');
608
581
  }
609
-
610
582
  if (this.services.rtdWebSocketManager && !this.services.rtdWebSocketManager.isSocketClosed) {
611
- this.services.rtdWebSocketManager.close(false, 'Unregistering the RTD websocket');
583
+ this.services.rtdWebSocketManager.close(false, 'Unregistering the SDK');
612
584
  }
613
585
 
614
586
  // Clear any cached agent configuration
@@ -735,77 +707,92 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
735
707
  module: CC_FILE,
736
708
  method: METHODS.CONNECT_WEBSOCKET,
737
709
  });
738
-
739
710
  try {
740
- const data = (await this.services.webSocketManager.initWebSocket({
741
- body: this.getConnectionConfig(),
742
- resource: SUBSCRIBE_API,
743
- })) as WelcomeEvent;
744
-
745
- const agentId = data.agentId;
746
- const orgId = this.$webex.credentials.getOrgId();
747
- this.agentConfig = await this.services.config.getAgentConfig(orgId, agentId);
748
-
749
- LoggerProxy.log(`Agent config is fetched successfully`, {
750
- module: CC_FILE,
751
- method: METHODS.CONNECT_WEBSOCKET,
752
- });
753
-
754
- // TODO: Make profile a singleton to make it available throughout app/sdk so we dont need to inject info everywhere
755
- this.taskManager.setWrapupData(this.agentConfig.wrapUpData);
756
- this.taskManager.setAgentId(this.agentConfig.agentId);
757
- this.taskManager.setWebRtcEnabled(this.agentConfig.webRtcEnabled);
758
- this.apiAIAssistant.setAIFeatureFlags(this.agentConfig.aiFeature);
759
-
760
- if (this.agentConfig.aiFeature?.realtimeTranscripts?.enable) {
761
- LoggerProxy.info('Connecting to RTD websocket', {
762
- module: CC_FILE,
763
- method: METHODS.CONNECT_WEBSOCKET,
764
- });
765
-
766
- await this.services.rtdWebSocketManager
767
- .initWebSocket({
768
- body: this.getConnectionConfig(),
769
- resource: RTD_SUBSCRIBE_API,
770
- })
771
- .then(() => {
772
- LoggerProxy.log('RTD websocket connected successfully', {
773
- module: CC_FILE,
774
- method: METHODS.CONNECT_WEBSOCKET,
775
- });
776
- this.services.rtdWebSocketManager.on('message', this.handleRTDWebsocketMessage);
777
- })
778
- .catch((error) => {
779
- LoggerProxy.error(`Error during RTD websocket setup: ${error}`, {
780
- module: CC_FILE,
781
- method: METHODS.CONNECT_WEBSOCKET,
782
- });
783
- });
784
- }
785
-
786
- if (
787
- this.agentConfig.webRtcEnabled &&
788
- this.agentConfig.loginVoiceOptions.includes(LoginOption.BROWSER)
789
- ) {
790
- try {
791
- await this.$webex.internal.mercury.connect();
792
- LoggerProxy.log('Authentication: webex.internal.mercury.connect successful', {
711
+ return this.services.webSocketManager
712
+ .initWebSocket({
713
+ body: this.getConnectionConfig(),
714
+ resource: SUBSCRIBE_API,
715
+ })
716
+ .then(async (data: WelcomeEvent) => {
717
+ const agentId = data.agentId;
718
+ const orgId = this.$webex.credentials.getOrgId();
719
+ this.agentConfig = await this.services.config.getAgentConfig(orgId, agentId);
720
+ LoggerProxy.log(`Agent config is fetched successfully`, {
793
721
  module: CC_FILE,
794
722
  method: METHODS.CONNECT_WEBSOCKET,
795
723
  });
796
- } catch (error) {
797
- LoggerProxy.error(`Error occurred during mercury.connect() ${error}`, {
798
- module: CC_FILE,
799
- method: METHODS.CONNECT_WEBSOCKET,
800
- });
801
- }
802
- }
803
724
 
804
- if (this.$config && this.$config.allowAutomatedRelogin) {
805
- await this.silentRelogin();
806
- }
725
+ const configFlags: ConfigFlags = {
726
+ isEndTaskEnabled: this.agentConfig.isEndTaskEnabled,
727
+ isEndConsultEnabled: this.agentConfig.isEndConsultEnabled,
728
+ webRtcEnabled: this.agentConfig.webRtcEnabled,
729
+ autoWrapup: this.agentConfig.wrapUpData?.wrapUpProps?.autoWrapup ?? false,
730
+ aiFeature: this.agentConfig.aiFeature,
731
+ };
732
+ this.taskManager.setConfigFlags(configFlags);
733
+ // TODO: Make profile a singleton to make it available throughout app/sdk so we dont need to inject info everywhere
734
+ this.taskManager.setWrapupData(this.agentConfig.wrapUpData);
735
+ this.taskManager.setAgentId(this.agentConfig.agentId);
736
+ this.taskManager.setWebRtcEnabled(this.agentConfig.webRtcEnabled);
737
+ this.apiAIAssistant.setAIFeatureFlags(this.agentConfig.aiFeature);
738
+ /**
739
+ * TODO: We need to re-check this condition if this websocket is only for realtime transcripts
740
+ * or other AI Assistant features will also use the same.
741
+ * If the latter is true, we need to update this condition.
742
+ */
743
+ if (this.agentConfig.aiFeature?.realtimeTranscripts?.enable) {
744
+ LoggerProxy.info('Connecting to RTD websocket', {
745
+ module: CC_FILE,
746
+ method: METHODS.CONNECT_WEBSOCKET,
747
+ });
807
748
 
808
- return this.agentConfig;
749
+ this.services.rtdWebSocketManager
750
+ .initWebSocket({
751
+ body: this.getConnectionConfig(),
752
+ resource: RTD_SUBSCRIBE_API,
753
+ })
754
+ .then(() => {
755
+ LoggerProxy.log('RTD websocket connected successfully', {
756
+ module: CC_FILE,
757
+ method: METHODS.CONNECT_WEBSOCKET,
758
+ });
759
+ this.services.rtdWebSocketManager.on('message', this.handleRTDWebsocketMessage);
760
+ })
761
+ .catch((error) => {
762
+ LoggerProxy.error(`Error connecting to RTD websocket ${error}`, {
763
+ module: CC_FILE,
764
+ method: METHODS.CONNECT_WEBSOCKET,
765
+ });
766
+ });
767
+ }
768
+ if (
769
+ this.agentConfig.webRtcEnabled &&
770
+ this.agentConfig.loginVoiceOptions.includes(LoginOption.BROWSER)
771
+ ) {
772
+ this.$webex.internal.mercury
773
+ .connect()
774
+ .then(() => {
775
+ LoggerProxy.log('Authentication: webex.internal.mercury.connect successful', {
776
+ module: CC_FILE,
777
+ method: METHODS.CONNECT_WEBSOCKET,
778
+ });
779
+ })
780
+ .catch((error) => {
781
+ LoggerProxy.error(`Error occurred during mercury.connect() ${error}`, {
782
+ module: CC_FILE,
783
+ method: METHODS.CONNECT_WEBSOCKET,
784
+ });
785
+ });
786
+ }
787
+ if (this.$config && this.$config.allowAutomatedRelogin) {
788
+ await this.silentRelogin();
789
+ }
790
+
791
+ return this.agentConfig;
792
+ })
793
+ .catch((error) => {
794
+ throw error;
795
+ });
809
796
  } catch (error) {
810
797
  LoggerProxy.error(`Error during register: ${error}`, {
811
798
  module: CC_FILE,
@@ -855,11 +842,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
855
842
  METRIC_EVENT_NAMES.STATION_LOGIN_FAILED,
856
843
  ]);
857
844
 
858
- const dialPlanEntries = this.agentConfig?.dialPlan?.dialPlanEntity ?? [];
859
- if (
860
- data.loginOption === LoginOption.AGENT_DN &&
861
- !isValidDialNumber(data.dialNumber, dialPlanEntries)
862
- ) {
845
+ if (data.loginOption === LoginOption.AGENT_DN && !isValidDialNumber(data.dialNumber)) {
863
846
  const error = new Error('INVALID_DIAL_NUMBER');
864
847
  // @ts-ignore - adding custom key to the error object
865
848
  error.details = {data: {reason: 'INVALID_DIAL_NUMBER'}} as Failure;
@@ -1246,6 +1229,10 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1246
1229
  }
1247
1230
  };
1248
1231
 
1232
+ private handleRTDWebsocketMessage = (event: string) => {
1233
+ this.taskManager.handleRealtimeWebsocketEvent(event);
1234
+ };
1235
+
1249
1236
  /**
1250
1237
  * Initializes event listeners for the Contact Center service
1251
1238
  * Sets up handlers for connection state changes and other core events
@@ -1583,79 +1570,6 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter
1583
1570
  }
1584
1571
  }
1585
1572
 
1586
- /**
1587
- * Accepts a campaign preview contact, initiating the outbound call.
1588
- *
1589
- * When a campaign manager reserves a contact for an agent, the agent receives an
1590
- * `AgentOfferCampaignReservation` event. The agent can then accept the preview contact
1591
- * to initiate the outbound call.
1592
- *
1593
- * @param {PreviewContactPayload} payload - The preview contact payload containing interactionId and campaignId (campaign name, not UUID).
1594
- * @returns {Promise<TaskResponse>} Promise resolving with agent contact on success.
1595
- * @throws {Error} If the operation fails (network error, customer unavailable, etc.)
1596
- *
1597
- * @example
1598
- * ```typescript
1599
- * webex.cc.on('task:campaignPreviewReservation', async (task) => {
1600
- * const { interactionId } = task.data;
1601
- * // campaignId is the campaign name (e.g. "MyCampaign"), not a UUID
1602
- * const campaignId = task.data.interaction.callProcessingDetails.campaignId;
1603
- *
1604
- * const result = await webex.cc.acceptPreviewContact({ interactionId, campaignId });
1605
- * });
1606
- * ```
1607
- */
1608
- public async acceptPreviewContact(payload: PreviewContactPayload): Promise<TaskResponse> {
1609
- LoggerProxy.info('Accepting campaign preview contact', {
1610
- module: CC_FILE,
1611
- method: METHODS.ACCEPT_PREVIEW_CONTACT,
1612
- });
1613
- try {
1614
- this.metricsManager.timeEvent([
1615
- METRIC_EVENT_NAMES.CAMPAIGN_PREVIEW_ACCEPT_SUCCESS,
1616
- METRIC_EVENT_NAMES.CAMPAIGN_PREVIEW_ACCEPT_FAILED,
1617
- ]);
1618
-
1619
- const result = await this.services.dialer.acceptPreviewContact({data: payload});
1620
-
1621
- this.metricsManager.trackEvent(
1622
- METRIC_EVENT_NAMES.CAMPAIGN_PREVIEW_ACCEPT_SUCCESS,
1623
- {
1624
- ...MetricsManager.getCommonTrackingFieldForAQMResponse(result),
1625
- interactionId: payload.interactionId,
1626
- campaignId: payload.campaignId,
1627
- },
1628
- ['behavioral', 'business', 'operational']
1629
- );
1630
-
1631
- LoggerProxy.log('Campaign preview contact accepted successfully', {
1632
- module: CC_FILE,
1633
- method: METHODS.ACCEPT_PREVIEW_CONTACT,
1634
- trackingId: result.trackingId,
1635
- interactionId: payload.interactionId,
1636
- });
1637
-
1638
- return result;
1639
- } catch (error) {
1640
- const failure = error.details as Failure;
1641
- this.metricsManager.trackEvent(
1642
- METRIC_EVENT_NAMES.CAMPAIGN_PREVIEW_ACCEPT_FAILED,
1643
- {
1644
- ...MetricsManager.getCommonTrackingFieldForAQMResponseFailed(failure),
1645
- interactionId: payload.interactionId,
1646
- campaignId: payload.campaignId,
1647
- },
1648
- ['behavioral', 'business', 'operational']
1649
- );
1650
- const {error: detailedError} = getErrorDetails(
1651
- error,
1652
- METHODS.ACCEPT_PREVIEW_CONTACT,
1653
- CC_FILE
1654
- );
1655
- throw detailedError;
1656
- }
1657
- }
1658
-
1659
1573
  /**
1660
1574
  * Fetches outdial ANI (Automatic Number Identification) entries for an outdial ANI ID.
1661
1575
  *
package/src/constants.ts CHANGED
@@ -42,14 +42,25 @@ export const METHODS = {
42
42
  HANDLE_DEVICE_TYPE: 'handleDeviceType',
43
43
  START_OUTDIAL: 'startOutdial',
44
44
  GET_QUEUES: 'getQueues',
45
- GET_OUTDIAL_ANI_ENTRIES: 'getOutdialAniEntries',
46
45
  UPLOAD_LOGS: 'uploadLogs',
47
46
  UPDATE_AGENT_PROFILE: 'updateAgentProfile',
48
47
  GET_DEVICE_ID: 'getDeviceId',
49
48
  HANDLE_INCOMING_TASK: 'handleIncomingTask',
50
49
  HANDLE_TASK_HYDRATE: 'handleTaskHydrate',
51
50
  INCOMING_TASK_LISTENER: 'incomingTaskListener',
52
- ACCEPT_PREVIEW_CONTACT: 'acceptPreviewContact',
51
+ ACCEPT: 'accept',
52
+ REJECT: 'decline',
53
+ HOLD: 'hold',
54
+ RESUME: 'resume',
55
+ HOLD_RESUME: 'holdResume',
56
+ TRANSFER_CALL: 'transfer',
57
+ CONSULT_TRANSFER: 'consultTransfer',
58
+ CONSULT_CONFERENCE: 'consultConference',
59
+ EXIT_CONFERENCE: 'exitConference',
60
+ TRANSFER_CONFERENCE: 'transferConference',
61
+ TOGGLE_MUTE: 'toggleMute',
62
+ COMPLETE_TRANSFER: 'completeTransfer',
63
+ GET_OUTDIAL_ANI_ENTRIES: 'getOutdialAniEntries',
53
64
  GET_BASE_URL: 'getBaseUrl',
54
65
  SEND_EVENT: 'sendEvent',
55
66
  FETCH_HISTORIC_TRANSCRIPTS: 'fetchHistoricTranscripts',
package/src/index.ts CHANGED
@@ -13,18 +13,17 @@ import ContactCenter from './cc';
13
13
  */
14
14
  export {default as ContactCenter} from './cc';
15
15
 
16
- // Service exports
17
16
  /**
18
- * Task class represents a contact center task that can be managed by an agent
17
+ * Agent routing service for Contact Center operations
19
18
  * @category Services
20
19
  */
21
- export {default as Task} from './services/task';
20
+ export {default as routingAgent} from './services/agent';
22
21
 
23
22
  /**
24
- * Agent routing service for Contact Center operations
23
+ * Task class represents a contact center task that can be managed by an agent
25
24
  * @category Services
26
25
  */
27
- export {default as routingAgent} from './services/agent';
26
+ export {default as Task} from './services/task/Task';
28
27
 
29
28
  // API exports (AddressBook is public, EntryPoint and Queue are accessed via cc wrappers)
30
29
  export {default as AddressBook} from './services/AddressBook';
@@ -125,6 +124,8 @@ export type {
125
124
  /** Task related types */
126
125
  export type {
127
126
  AgentContact,
127
+ /** Event emitter contract for task consumers (no @types/node needed) */
128
+ IEventEmitter,
128
129
  /** Task interface */
129
130
  ITask,
130
131
  Interaction,
@@ -139,8 +140,16 @@ export type {
139
140
  TransferPayLoad,
140
141
  ResumeRecordingPayload,
141
142
  WrapupPayLoad,
143
+ /** UI control types for task buttons */
144
+ InteractionUIControls,
145
+ TaskUILeg,
146
+ TaskUIControls,
147
+ TaskUIControlState,
142
148
  } from './services/task/types';
143
149
 
150
+ /** UI controls utilities */
151
+ export {getDefaultUIControls} from './services/task/state-machine/uiControlsComputer';
152
+
144
153
  /** Agent related types */
145
154
  export type {
146
155
  /** State change interface */