@webex/internal-plugin-ai-assistant 3.11.0-next.3 → 3.11.0-next.4

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.
@@ -81,16 +81,14 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
81
81
  * @memberof AIAssistant
82
82
  */
83
83
  unregister: function unregister() {
84
- var _this2 = this;
85
84
  if (!this.registered) {
86
85
  this.logger.info('AI assistant->unregister#INFO, AI assistant plugin already unregistered');
87
86
  return _promise.default.resolve();
88
87
  }
89
88
  this.stopListeningForEvents();
90
- return this.webex.internal.mercury.disconnect().then(function () {
91
- _this2.trigger(_constants.AI_ASSISTANT_UNREGISTERED);
92
- _this2.registered = false;
93
- });
89
+ this.trigger(_constants.AI_ASSISTANT_UNREGISTERED);
90
+ this.registered = false;
91
+ return _promise.default.resolve();
94
92
  },
95
93
  /**
96
94
  * registers for Assistant API events through mercury
@@ -98,9 +96,9 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
98
96
  * @private
99
97
  */
100
98
  listenForEvents: function listenForEvents() {
101
- var _this3 = this;
99
+ var _this2 = this;
102
100
  this.webex.internal.mercury.on(_constants.ASSISTANT_API_RESPONSE_EVENT, function (envelope) {
103
- _this3._handleEvent(envelope.data);
101
+ _this2._handleEvent(envelope.data);
104
102
  });
105
103
  },
106
104
  /**
@@ -143,7 +141,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
143
141
  * @returns {Promise} resolves once decryption is complete
144
142
  */
145
143
  _decryptContent: function _decryptContent(responseContent) {
146
- var _this4 = this;
144
+ var _this3 = this;
147
145
  return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
148
146
  var _t;
149
147
  return _regenerator.default.wrap(function (_context) {
@@ -154,33 +152,33 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
154
152
  break;
155
153
  case 1:
156
154
  _context.next = 2;
157
- return (0, _utils.decryptMessage)(responseContent, _this4.webex);
155
+ return (0, _utils.decryptMessage)(responseContent, _this3.webex);
158
156
  case 2:
159
157
  return _context.abrupt("continue", 13);
160
158
  case 3:
161
159
  _context.next = 4;
162
- return (0, _utils.decryptCitedAnswer)(responseContent, _this4.webex);
160
+ return (0, _utils.decryptCitedAnswer)(responseContent, _this3.webex);
163
161
  case 4:
164
162
  return _context.abrupt("continue", 13);
165
163
  case 5:
166
164
  _context.next = 6;
167
- return (0, _utils.decryptScheduleMeeting)(responseContent, _this4.webex);
165
+ return (0, _utils.decryptScheduleMeeting)(responseContent, _this3.webex);
168
166
  case 6:
169
167
  return _context.abrupt("continue", 13);
170
168
  case 7:
171
169
  return _context.abrupt("continue", 13);
172
170
  case 8:
173
171
  _context.next = 9;
174
- return (0, _utils.decryptToolUse)(responseContent, _this4.webex);
172
+ return (0, _utils.decryptToolUse)(responseContent, _this3.webex);
175
173
  case 9:
176
174
  return _context.abrupt("continue", 13);
177
175
  case 10:
178
176
  _context.next = 11;
179
- return (0, _utils.decryptWorkspace)(responseContent, _this4.webex);
177
+ return (0, _utils.decryptWorkspace)(responseContent, _this3.webex);
180
178
  case 11:
181
179
  return _context.abrupt("continue", 13);
182
180
  case 12:
183
- _this4.logger.error("AI assistant->_decryptContent#ERROR, Unknown response content name: ".concat(responseContent.name));
181
+ _this3.logger.error("AI assistant->_decryptContent#ERROR, Unknown response content name: ".concat(responseContent.name));
184
182
  case 13:
185
183
  case "end":
186
184
  return _context.stop();
@@ -196,7 +194,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
196
194
  * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName
197
195
  */
198
196
  _request: function _request(options) {
199
- var _this5 = this;
197
+ var _this4 = this;
200
198
  var resource = options.resource,
201
199
  params = options.params;
202
200
  var timeout = this.config.requestTimeout;
@@ -207,15 +205,15 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
207
205
  // eslint-disable-next-line no-async-promise-executor
208
206
  return new _promise.default(function (resolve, reject) {
209
207
  var timer = new _commonTimers.Timer(function () {
210
- _this5.stopListening(_this5, eventName);
211
- _this5.trigger(streamEventName, {
208
+ _this4.stopListening(_this4, eventName);
209
+ _this4.trigger(streamEventName, {
212
210
  requestId: requestId,
213
211
  finished: true,
214
212
  errorMessage: _constants.AI_ASSISTANT_ERRORS.AI_ASSISTANT_TIMEOUT,
215
213
  errorCode: _constants.AI_ASSISTANT_ERROR_CODES.AI_ASSISTANT_TIMEOUT
216
214
  });
217
215
  }, timeout);
218
- _this5.listenTo(_this5, eventName, /*#__PURE__*/function () {
216
+ _this4.listenTo(_this4, eventName, /*#__PURE__*/function () {
219
217
  var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(data) {
220
218
  var resultData, errorMessage, errorCode, responseType, decryptErrorMessage, _t2;
221
219
  return _regenerator.default.wrap(function (_context2) {
@@ -228,7 +226,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
228
226
  responseType = (0, _lodash.get)(data, 'responseType');
229
227
  if (data.finished) {
230
228
  timer.cancel();
231
- _this5.stopListening(_this5, eventName);
229
+ _this4.stopListening(_this4, eventName);
232
230
  }
233
231
  _context2.prev = 1;
234
232
  if (errorCode) {
@@ -236,7 +234,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
236
234
  break;
237
235
  }
238
236
  _context2.next = 2;
239
- return _this5._decryptContent(resultData);
237
+ return _this4._decryptContent(resultData);
240
238
  case 2:
241
239
  _context2.next = 4;
242
240
  break;
@@ -245,7 +243,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
245
243
  _t2 = _context2["catch"](1);
246
244
  decryptErrorMessage = _t2.message;
247
245
  case 4:
248
- _this5.trigger(streamEventName, (0, _lodash.merge)({}, data.response, {
246
+ _this4.trigger(streamEventName, (0, _lodash.merge)({}, data.response, {
249
247
  responseType: responseType,
250
248
  requestId: requestId,
251
249
  finished: data.finished,
@@ -262,7 +260,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
262
260
  return _ref.apply(this, arguments);
263
261
  };
264
262
  }());
265
- _this5.webex.request({
263
+ _this4.webex.request({
266
264
  service: _constants.AI_ASSISTANT_SERVICE_NAME,
267
265
  resource: resource,
268
266
  method: 'POST',
@@ -300,7 +298,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
300
298
  * @memberof AIAssistant
301
299
  */
302
300
  makeAiAssistantRequest: function makeAiAssistantRequest(options) {
303
- var _this6 = this;
301
+ var _this5 = this;
304
302
  return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
305
303
  var value, content;
306
304
  return _regenerator.default.wrap(function (_context3) {
@@ -312,7 +310,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
312
310
  break;
313
311
  }
314
312
  _context3.next = 1;
315
- return _this6._encryptData({
313
+ return _this5._encryptData({
316
314
  text: options.contentValue,
317
315
  encryptionKeyUrl: options.encryptionKeyUrl
318
316
  });
@@ -330,7 +328,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
330
328
  if (options.parameters) {
331
329
  content.parameters = options.parameters;
332
330
  }
333
- return _context3.abrupt("return", _this6._request(_objectSpread({
331
+ return _context3.abrupt("return", _this5._request(_objectSpread({
334
332
  resource: options.sessionId ? "sessions/".concat(options.sessionId, "/messages") : 'sessions/messages',
335
333
  params: _objectSpread(_objectSpread({
336
334
  async: 'chunked',
@@ -427,7 +425,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
427
425
  * @returns {Promise<string>} returns a promise that resolves with the encrypted text
428
426
  */
429
427
  _encryptData: function _encryptData(_ref3) {
430
- var _this7 = this;
428
+ var _this6 = this;
431
429
  return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
432
430
  var text, encryptionKeyUrl, result;
433
431
  return _regenerator.default.wrap(function (_context4) {
@@ -435,7 +433,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
435
433
  case 0:
436
434
  text = _ref3.text, encryptionKeyUrl = _ref3.encryptionKeyUrl;
437
435
  _context4.next = 1;
438
- return _this7.webex.internal.encryption.encryptText(encryptionKeyUrl, text);
436
+ return _this6.webex.internal.encryption.encryptText(encryptionKeyUrl, text);
439
437
  case 1:
440
438
  result = _context4.sent;
441
439
  return _context4.abrupt("return", result);
@@ -468,7 +466,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
468
466
  contentValue: options.question
469
467
  }));
470
468
  },
471
- version: "3.11.0-next.3"
469
+ version: "3.11.0-next.4"
472
470
  });
473
471
  var _default = exports.default = AIAssistant;
474
472
  //# sourceMappingURL=ai-assistant.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_uuid","_interopRequireDefault","require","_webexCore","_lodash","_commonTimers","_constants","_utils","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","AIAssistant","WebexPlugin","extend","namespace","registered","initialize","_len","args","Array","_key","_apply","prototype","register","_this","webex","canAuthorize","logger","error","_promise","reject","Error","info","resolve","internal","mercury","connect","then","listenForEvents","trigger","AI_ASSISTANT_REGISTERED","catch","concat","message","unregister","_this2","stopListeningForEvents","disconnect","AI_ASSISTANT_UNREGISTERED","_this3","on","ASSISTANT_API_RESPONSE_EVENT","envelope","_handleEvent","data","off","_getResultEventName","requestId","AI_ASSISTANT_RESULT","_getStreamEventName","AI_ASSISTANT_STREAM","clientRequestId","_decryptContent","responseContent","_this4","_asyncToGenerator2","_regenerator","mark","_callee","_t","wrap","_context","prev","next","name","RESPONSE_NAMES","MESSAGE","CITED_ANSWER","SCHEDULE_MEETING","TOOL_RESULT","TOOL_USE","WORKSPACE","decryptMessage","abrupt","decryptCitedAnswer","decryptScheduleMeeting","decryptToolUse","decryptWorkspace","stop","_request","options","_this5","resource","params","timeout","config","requestTimeout","uuid","v4","eventName","streamEventName","timer","Timer","stopListening","finished","errorMessage","AI_ASSISTANT_ERRORS","AI_ASSISTANT_TIMEOUT","errorCode","AI_ASSISTANT_ERROR_CODES","listenTo","_ref","_callee2","resultData","responseType","decryptErrorMessage","_t2","_context2","reset","get","cancel","merge","response","_x","request","service","AI_ASSISTANT_SERVICE_NAME","method","contentType","body","_ref2","start","makeAiAssistantRequest","_this6","_callee3","value","content","_context3","contentValue","_encryptData","text","encryptionKeyUrl","sent","context","resources","contextResources","type","parameters","sessionId","async","locale","entryPoint","assistant","summarizeMeeting","CONTENT_TYPES","ACTION","ACTION_TYPES","SUMMARIZE_FOR_ME","id","meetingInstanceId","CONTEXT_RESOURCE_TYPES","MEETING","url","meetingSite","lastMinutes","wasMyNameMentioned","WAS_MY_NAME_MENTIONED","showAllActionItems","SHOW_ALL_ACTION_ITEMS","_ref3","_this7","_callee4","result","_context4","encryption","encryptText","askMeAnything","question","version","_default","exports"],"sources":["ai-assistant.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2022 Cisco Systems, Inc. See LICENSE file.\n */\nimport uuid from 'uuid';\nimport {WebexPlugin} from '@webex/webex-core';\nimport '@webex/internal-plugin-mercury';\nimport {get, merge} from 'lodash';\nimport {Timer} from '@webex/common-timers';\n\nimport {\n AiAssistantRequestOptions,\n RequestOptions,\n RequestResponse,\n SummarizeMeetingOptions,\n} from './types';\nimport {\n AI_ASSISTANT_ERROR_CODES,\n AI_ASSISTANT_ERRORS,\n AI_ASSISTANT_REGISTERED,\n AI_ASSISTANT_RESULT,\n AI_ASSISTANT_STREAM,\n AI_ASSISTANT_UNREGISTERED,\n AI_ASSISTANT_SERVICE_NAME,\n ASSISTANT_API_RESPONSE_EVENT,\n ACTION_TYPES,\n CONTENT_TYPES,\n CONTEXT_RESOURCE_TYPES,\n RESPONSE_NAMES,\n} from './constants';\nimport {\n decryptCitedAnswer,\n decryptMessage,\n decryptScheduleMeeting,\n decryptToolUse,\n decryptWorkspace,\n} from './utils';\n\nconst AIAssistant = WebexPlugin.extend({\n namespace: 'AIAssistant',\n\n /**\n * registered value indicating events registration is successful\n * @instance\n * @type {Boolean}\n * @memberof AIAssistant\n */\n registered: false,\n\n /**\n * Initializer\n * @private\n * @param {Object} attrs\n * @param {Object} options\n * @returns {undefined}\n */\n initialize(...args) {\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n },\n\n /**\n * Explicitly sets up the AI assistant plugin by connecting to mercury, and listening for AI assistant events.\n * @returns {Promise}\n * @public\n * @memberof AIAssistant\n */\n register() {\n if (!this.webex.canAuthorize) {\n this.logger.error('AI assistant->register#ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n if (this.registered) {\n this.logger.info('AI assistant->register#INFO, AI assistant plugin already registered');\n\n return Promise.resolve();\n }\n\n return this.webex.internal.mercury\n .connect()\n .then(() => {\n this.listenForEvents();\n this.trigger(AI_ASSISTANT_REGISTERED);\n this.registered = true;\n })\n .catch((error) => {\n this.logger.error(`AI assistant->register#ERROR, Unable to register, ${error.message}`);\n\n return Promise.reject(error);\n });\n },\n\n /**\n * Explicitly tears down the AI assistant plugin by disconnecting from mercury, and stops listening to AI assistant events\n * @returns {Promise}\n * @public\n * @memberof AIAssistant\n */\n unregister() {\n if (!this.registered) {\n this.logger.info('AI assistant->unregister#INFO, AI assistant plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n return this.webex.internal.mercury.disconnect().then(() => {\n this.trigger(AI_ASSISTANT_UNREGISTERED);\n this.registered = false;\n });\n },\n\n /**\n * registers for Assistant API events through mercury\n * @returns {undefined}\n * @private\n */\n listenForEvents() {\n this.webex.internal.mercury.on(ASSISTANT_API_RESPONSE_EVENT, (envelope) => {\n this._handleEvent(envelope.data);\n });\n },\n\n /**\n * unregisteres all the Assistant API events from mercury\n * @returns {undefined}\n * @private\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off(ASSISTANT_API_RESPONSE_EVENT);\n },\n\n /**\n * constructs the event name based on request id\n * This is used by the plugin to listen for the result of a particular request\n * @param {UUID} requestId the id of the request\n * @returns {string}\n */\n _getResultEventName(requestId: string) {\n return `${AI_ASSISTANT_RESULT}:${requestId}`;\n },\n\n /**\n * constructs the stream event name based on request id\n * This is used by the consumer to listen for the stream (i.e. the data) of a particular request\n * @param {UUID} requestId the id of the request\n * @returns {string}\n */\n _getStreamEventName(requestId: string) {\n return `${AI_ASSISTANT_STREAM}:${requestId}`;\n },\n\n /**\n * Takes incoming data and triggers correct events\n * @param {Object} data the event data\n * @returns {undefined}\n */\n _handleEvent(data) {\n this.trigger(this._getResultEventName(data.clientRequestId), data);\n },\n\n /**\n * Decrypts the response content in place\n * @param {any} responseContent the content object from the assistant-api response\n * @returns {Promise} resolves once decryption is complete\n */\n async _decryptContent(responseContent) {\n switch (responseContent.name) {\n case RESPONSE_NAMES.MESSAGE: {\n await decryptMessage(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.CITED_ANSWER: {\n await decryptCitedAnswer(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.SCHEDULE_MEETING: {\n await decryptScheduleMeeting(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.TOOL_RESULT: {\n // No encrypted content in tool_result\n break;\n }\n case RESPONSE_NAMES.TOOL_USE: {\n await decryptToolUse(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.WORKSPACE: {\n await decryptWorkspace(responseContent, this.webex);\n break;\n }\n default:\n this.logger.error(\n `AI assistant->_decryptContent#ERROR, Unknown response content name: ${responseContent.name}`\n );\n }\n },\n\n /**\n * Makes the request to the AI assistant service\n * @param {Object} options\n * @param {string} options.resource the URL to query\n * @param {Mixed} options.params additional params for the body of the request\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n _request(options: RequestOptions): Promise<RequestResponse> {\n const {resource, params} = options;\n\n const timeout = this.config.requestTimeout;\n const requestId = options.requestId || uuid.v4();\n const eventName = this._getResultEventName(requestId);\n const streamEventName = this._getStreamEventName(requestId);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise((resolve, reject) => {\n const timer = new Timer(() => {\n this.stopListening(this, eventName);\n this.trigger(streamEventName, {\n requestId,\n finished: true,\n errorMessage: AI_ASSISTANT_ERRORS.AI_ASSISTANT_TIMEOUT,\n errorCode: AI_ASSISTANT_ERROR_CODES.AI_ASSISTANT_TIMEOUT,\n });\n }, timeout);\n\n this.listenTo(this, eventName, async (data) => {\n timer.reset();\n const resultData = get(data, 'response.content', {});\n const errorMessage = get(data, 'response.errorMessage');\n const errorCode = get(data, 'response.errorCode');\n const responseType = get(data, 'responseType');\n\n if (data.finished) {\n timer.cancel();\n this.stopListening(this, eventName);\n }\n\n let decryptErrorMessage;\n\n try {\n if (!errorCode) {\n await this._decryptContent(resultData);\n }\n } catch (decryptError) {\n decryptErrorMessage = decryptError.message;\n }\n\n this.trigger(\n streamEventName,\n merge({}, data.response, {\n responseType,\n requestId,\n finished: data.finished,\n errorMessage: errorMessage || decryptErrorMessage,\n errorCode,\n })\n );\n });\n\n this.webex\n .request({\n service: AI_ASSISTANT_SERVICE_NAME,\n resource,\n method: 'POST',\n contentType: 'application/json',\n body: {clientRequestId: requestId, ...params},\n })\n .then(({body}) => {\n resolve({...body, requestId, streamEventName});\n })\n .catch((error) => {\n reject(error);\n });\n\n timer.start();\n });\n },\n\n /**\n * Common method to make AI assistant requests for meeting analysis\n * @param {Object} options\n * @param {string} options.contextResources array of context resources to include in the request\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.contentType the type of content ('action' or 'message')\n * @param {string} options.contentValue the value to use (action name or message text)\n * @param {Object} options.parameters optional parameters to include in the request (for action type only)\n * @param {Object} options.assistant optional parameter to specify the assistant to use\n * @param {Object} options.locale optional locale to use for the request, defaults to 'en_US'\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @param {string} options.entryPoint optional entryPoint to use for this request\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n * @public\n * @memberof AIAssistant\n */\n async makeAiAssistantRequest(options: AiAssistantRequestOptions): Promise<RequestResponse> {\n let value = options.contentValue;\n\n if (options.contentType === 'message') {\n value = await this._encryptData({\n text: options.contentValue,\n encryptionKeyUrl: options.encryptionKeyUrl,\n });\n }\n\n const content: any = {\n context: {\n resources: options.contextResources,\n },\n encryptionKeyUrl: options.encryptionKeyUrl,\n type: options.contentType,\n value,\n };\n\n if (options.parameters) {\n content.parameters = options.parameters;\n }\n\n return this._request({\n resource: options.sessionId ? `sessions/${options.sessionId}/messages` : 'sessions/messages',\n params: {\n async: 'chunked',\n locale: options.locale || 'en_US',\n content,\n ...(options.entryPoint ? {entryPoint: options.entryPoint} : {}),\n ...(options.assistant ? {assistant: options.assistant} : {}),\n },\n ...(options.requestId ? {requestId: options.requestId} : {}),\n });\n },\n\n /**\n * Returns the summary of a meeting\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {number} options.lastMinutes Optional number of minutes to summarize from the end of the meeting. If not included, summarizes from the start.\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n summarizeMeeting(options: SummarizeMeetingOptions): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contentType: CONTENT_TYPES.ACTION,\n contentValue: ACTION_TYPES.SUMMARIZE_FOR_ME,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n ...(options.lastMinutes ? {parameters: {lastMinutes: options.lastMinutes}} : {}),\n });\n },\n\n /**\n * Checks if the user's name was mentioned in a meeting\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n wasMyNameMentioned(options: SummarizeMeetingOptions): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n contentType: CONTENT_TYPES.ACTION,\n contentValue: ACTION_TYPES.WAS_MY_NAME_MENTIONED,\n });\n },\n\n /**\n * Returns all action items from a meeting\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n showAllActionItems(options: SummarizeMeetingOptions): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n contentType: CONTENT_TYPES.ACTION,\n contentValue: ACTION_TYPES.SHOW_ALL_ACTION_ITEMS,\n });\n },\n\n /**\n * Helper method to encrypt text using the encryption key URL\n * @param {Object} options\n * @param {string} options.text the text to encrypt\n * @param {string} options.encryptionKeyUrl the encryption key URL to use for encryption\n * @returns {Promise<string>} returns a promise that resolves with the encrypted text\n */\n async _encryptData({text, encryptionKeyUrl}) {\n const result = await this.webex.internal.encryption.encryptText(encryptionKeyUrl, text);\n\n return result;\n },\n\n /**\n * Ask any question about the meeting content\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.question the question to ask about the meeting content\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n askMeAnything(options: SummarizeMeetingOptions & {question: string}): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n contentType: CONTENT_TYPES.MESSAGE,\n contentValue: options.question,\n });\n },\n});\n\nexport default AIAssistant;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACAA,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAQA,IAAAI,UAAA,GAAAJ,OAAA;AAcA,IAAAK,MAAA,GAAAL,OAAA;AAMiB,SAAAM,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,CAAAO,IAAA,CAAAC,KAAA,CAAAR,CAAA,EAAAG,CAAA,YAAAH,CAAA;AAAA,SAAAS,cAAAX,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAW,SAAA,CAAAC,MAAA,EAAA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AED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,aAAa,WAAbA,aAAaA,CAACtF,OAAqD,EAA4B;IAC7F,OAAO,IAAI,CAAC0C,sBAAsB,CAAAnI,aAAA,CAAAA,aAAA,KAC7ByF,OAAO;MACVuD,gBAAgB,EAAE,CAChB;QACEa,EAAE,EAAEpE,OAAO,CAACqE,iBAAiB;QAC7Bb,IAAI,EAAEc,iCAAsB,CAACC,OAAO;QACpCC,GAAG,EAAExE,OAAO,CAACyE;MACf,CAAC,CACF;MACDnC,WAAW,EAAE0B,wBAAa,CAAC9E,OAAO;MAClC8D,YAAY,EAAEhD,OAAO,CAACuF;IAAQ,EAC/B,CAAC;EACJ,CAAC;EAAAC,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7K,OAAA,GAEYI,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_uuid","_interopRequireDefault","require","_webexCore","_lodash","_commonTimers","_constants","_utils","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","AIAssistant","WebexPlugin","extend","namespace","registered","initialize","_len","args","Array","_key","_apply","prototype","register","_this","webex","canAuthorize","logger","error","_promise","reject","Error","info","resolve","internal","mercury","connect","then","listenForEvents","trigger","AI_ASSISTANT_REGISTERED","catch","concat","message","unregister","stopListeningForEvents","AI_ASSISTANT_UNREGISTERED","_this2","on","ASSISTANT_API_RESPONSE_EVENT","envelope","_handleEvent","data","off","_getResultEventName","requestId","AI_ASSISTANT_RESULT","_getStreamEventName","AI_ASSISTANT_STREAM","clientRequestId","_decryptContent","responseContent","_this3","_asyncToGenerator2","_regenerator","mark","_callee","_t","wrap","_context","prev","next","name","RESPONSE_NAMES","MESSAGE","CITED_ANSWER","SCHEDULE_MEETING","TOOL_RESULT","TOOL_USE","WORKSPACE","decryptMessage","abrupt","decryptCitedAnswer","decryptScheduleMeeting","decryptToolUse","decryptWorkspace","stop","_request","options","_this4","resource","params","timeout","config","requestTimeout","uuid","v4","eventName","streamEventName","timer","Timer","stopListening","finished","errorMessage","AI_ASSISTANT_ERRORS","AI_ASSISTANT_TIMEOUT","errorCode","AI_ASSISTANT_ERROR_CODES","listenTo","_ref","_callee2","resultData","responseType","decryptErrorMessage","_t2","_context2","reset","get","cancel","merge","response","_x","request","service","AI_ASSISTANT_SERVICE_NAME","method","contentType","body","_ref2","start","makeAiAssistantRequest","_this5","_callee3","value","content","_context3","contentValue","_encryptData","text","encryptionKeyUrl","sent","context","resources","contextResources","type","parameters","sessionId","async","locale","entryPoint","assistant","summarizeMeeting","CONTENT_TYPES","ACTION","ACTION_TYPES","SUMMARIZE_FOR_ME","id","meetingInstanceId","CONTEXT_RESOURCE_TYPES","MEETING","url","meetingSite","lastMinutes","wasMyNameMentioned","WAS_MY_NAME_MENTIONED","showAllActionItems","SHOW_ALL_ACTION_ITEMS","_ref3","_this6","_callee4","result","_context4","encryption","encryptText","askMeAnything","question","version","_default","exports"],"sources":["ai-assistant.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2022 Cisco Systems, Inc. See LICENSE file.\n */\nimport uuid from 'uuid';\nimport {WebexPlugin} from '@webex/webex-core';\nimport '@webex/internal-plugin-mercury';\nimport {get, merge} from 'lodash';\nimport {Timer} from '@webex/common-timers';\n\nimport {\n AiAssistantRequestOptions,\n RequestOptions,\n RequestResponse,\n SummarizeMeetingOptions,\n} from './types';\nimport {\n AI_ASSISTANT_ERROR_CODES,\n AI_ASSISTANT_ERRORS,\n AI_ASSISTANT_REGISTERED,\n AI_ASSISTANT_RESULT,\n AI_ASSISTANT_STREAM,\n AI_ASSISTANT_UNREGISTERED,\n AI_ASSISTANT_SERVICE_NAME,\n ASSISTANT_API_RESPONSE_EVENT,\n ACTION_TYPES,\n CONTENT_TYPES,\n CONTEXT_RESOURCE_TYPES,\n RESPONSE_NAMES,\n} from './constants';\nimport {\n decryptCitedAnswer,\n decryptMessage,\n decryptScheduleMeeting,\n decryptToolUse,\n decryptWorkspace,\n} from './utils';\n\nconst AIAssistant = WebexPlugin.extend({\n namespace: 'AIAssistant',\n\n /**\n * registered value indicating events registration is successful\n * @instance\n * @type {Boolean}\n * @memberof AIAssistant\n */\n registered: false,\n\n /**\n * Initializer\n * @private\n * @param {Object} attrs\n * @param {Object} options\n * @returns {undefined}\n */\n initialize(...args) {\n Reflect.apply(WebexPlugin.prototype.initialize, this, args);\n },\n\n /**\n * Explicitly sets up the AI assistant plugin by connecting to mercury, and listening for AI assistant events.\n * @returns {Promise}\n * @public\n * @memberof AIAssistant\n */\n register() {\n if (!this.webex.canAuthorize) {\n this.logger.error('AI assistant->register#ERROR, Unable to register, SDK cannot authorize');\n\n return Promise.reject(new Error('SDK cannot authorize'));\n }\n\n if (this.registered) {\n this.logger.info('AI assistant->register#INFO, AI assistant plugin already registered');\n\n return Promise.resolve();\n }\n\n return this.webex.internal.mercury\n .connect()\n .then(() => {\n this.listenForEvents();\n this.trigger(AI_ASSISTANT_REGISTERED);\n this.registered = true;\n })\n .catch((error) => {\n this.logger.error(`AI assistant->register#ERROR, Unable to register, ${error.message}`);\n\n return Promise.reject(error);\n });\n },\n\n /**\n * Explicitly tears down the AI assistant plugin by disconnecting from mercury, and stops listening to AI assistant events\n * @returns {Promise}\n * @public\n * @memberof AIAssistant\n */\n unregister() {\n if (!this.registered) {\n this.logger.info('AI assistant->unregister#INFO, AI assistant plugin already unregistered');\n\n return Promise.resolve();\n }\n\n this.stopListeningForEvents();\n\n this.trigger(AI_ASSISTANT_UNREGISTERED);\n this.registered = false;\n\n return Promise.resolve();\n },\n\n /**\n * registers for Assistant API events through mercury\n * @returns {undefined}\n * @private\n */\n listenForEvents() {\n this.webex.internal.mercury.on(ASSISTANT_API_RESPONSE_EVENT, (envelope) => {\n this._handleEvent(envelope.data);\n });\n },\n\n /**\n * unregisteres all the Assistant API events from mercury\n * @returns {undefined}\n * @private\n */\n stopListeningForEvents() {\n this.webex.internal.mercury.off(ASSISTANT_API_RESPONSE_EVENT);\n },\n\n /**\n * constructs the event name based on request id\n * This is used by the plugin to listen for the result of a particular request\n * @param {UUID} requestId the id of the request\n * @returns {string}\n */\n _getResultEventName(requestId: string) {\n return `${AI_ASSISTANT_RESULT}:${requestId}`;\n },\n\n /**\n * constructs the stream event name based on request id\n * This is used by the consumer to listen for the stream (i.e. the data) of a particular request\n * @param {UUID} requestId the id of the request\n * @returns {string}\n */\n _getStreamEventName(requestId: string) {\n return `${AI_ASSISTANT_STREAM}:${requestId}`;\n },\n\n /**\n * Takes incoming data and triggers correct events\n * @param {Object} data the event data\n * @returns {undefined}\n */\n _handleEvent(data) {\n this.trigger(this._getResultEventName(data.clientRequestId), data);\n },\n\n /**\n * Decrypts the response content in place\n * @param {any} responseContent the content object from the assistant-api response\n * @returns {Promise} resolves once decryption is complete\n */\n async _decryptContent(responseContent) {\n switch (responseContent.name) {\n case RESPONSE_NAMES.MESSAGE: {\n await decryptMessage(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.CITED_ANSWER: {\n await decryptCitedAnswer(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.SCHEDULE_MEETING: {\n await decryptScheduleMeeting(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.TOOL_RESULT: {\n // No encrypted content in tool_result\n break;\n }\n case RESPONSE_NAMES.TOOL_USE: {\n await decryptToolUse(responseContent, this.webex);\n break;\n }\n case RESPONSE_NAMES.WORKSPACE: {\n await decryptWorkspace(responseContent, this.webex);\n break;\n }\n default:\n this.logger.error(\n `AI assistant->_decryptContent#ERROR, Unknown response content name: ${responseContent.name}`\n );\n }\n },\n\n /**\n * Makes the request to the AI assistant service\n * @param {Object} options\n * @param {string} options.resource the URL to query\n * @param {Mixed} options.params additional params for the body of the request\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n _request(options: RequestOptions): Promise<RequestResponse> {\n const {resource, params} = options;\n\n const timeout = this.config.requestTimeout;\n const requestId = options.requestId || uuid.v4();\n const eventName = this._getResultEventName(requestId);\n const streamEventName = this._getStreamEventName(requestId);\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise((resolve, reject) => {\n const timer = new Timer(() => {\n this.stopListening(this, eventName);\n this.trigger(streamEventName, {\n requestId,\n finished: true,\n errorMessage: AI_ASSISTANT_ERRORS.AI_ASSISTANT_TIMEOUT,\n errorCode: AI_ASSISTANT_ERROR_CODES.AI_ASSISTANT_TIMEOUT,\n });\n }, timeout);\n\n this.listenTo(this, eventName, async (data) => {\n timer.reset();\n const resultData = get(data, 'response.content', {});\n const errorMessage = get(data, 'response.errorMessage');\n const errorCode = get(data, 'response.errorCode');\n const responseType = get(data, 'responseType');\n\n if (data.finished) {\n timer.cancel();\n this.stopListening(this, eventName);\n }\n\n let decryptErrorMessage;\n\n try {\n if (!errorCode) {\n await this._decryptContent(resultData);\n }\n } catch (decryptError) {\n decryptErrorMessage = decryptError.message;\n }\n\n this.trigger(\n streamEventName,\n merge({}, data.response, {\n responseType,\n requestId,\n finished: data.finished,\n errorMessage: errorMessage || decryptErrorMessage,\n errorCode,\n })\n );\n });\n\n this.webex\n .request({\n service: AI_ASSISTANT_SERVICE_NAME,\n resource,\n method: 'POST',\n contentType: 'application/json',\n body: {clientRequestId: requestId, ...params},\n })\n .then(({body}) => {\n resolve({...body, requestId, streamEventName});\n })\n .catch((error) => {\n reject(error);\n });\n\n timer.start();\n });\n },\n\n /**\n * Common method to make AI assistant requests for meeting analysis\n * @param {Object} options\n * @param {string} options.contextResources array of context resources to include in the request\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.contentType the type of content ('action' or 'message')\n * @param {string} options.contentValue the value to use (action name or message text)\n * @param {Object} options.parameters optional parameters to include in the request (for action type only)\n * @param {Object} options.assistant optional parameter to specify the assistant to use\n * @param {Object} options.locale optional locale to use for the request, defaults to 'en_US'\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @param {string} options.entryPoint optional entryPoint to use for this request\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n * @public\n * @memberof AIAssistant\n */\n async makeAiAssistantRequest(options: AiAssistantRequestOptions): Promise<RequestResponse> {\n let value = options.contentValue;\n\n if (options.contentType === 'message') {\n value = await this._encryptData({\n text: options.contentValue,\n encryptionKeyUrl: options.encryptionKeyUrl,\n });\n }\n\n const content: any = {\n context: {\n resources: options.contextResources,\n },\n encryptionKeyUrl: options.encryptionKeyUrl,\n type: options.contentType,\n value,\n };\n\n if (options.parameters) {\n content.parameters = options.parameters;\n }\n\n return this._request({\n resource: options.sessionId ? `sessions/${options.sessionId}/messages` : 'sessions/messages',\n params: {\n async: 'chunked',\n locale: options.locale || 'en_US',\n content,\n ...(options.entryPoint ? {entryPoint: options.entryPoint} : {}),\n ...(options.assistant ? {assistant: options.assistant} : {}),\n },\n ...(options.requestId ? {requestId: options.requestId} : {}),\n });\n },\n\n /**\n * Returns the summary of a meeting\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {number} options.lastMinutes Optional number of minutes to summarize from the end of the meeting. If not included, summarizes from the start.\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n summarizeMeeting(options: SummarizeMeetingOptions): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contentType: CONTENT_TYPES.ACTION,\n contentValue: ACTION_TYPES.SUMMARIZE_FOR_ME,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n ...(options.lastMinutes ? {parameters: {lastMinutes: options.lastMinutes}} : {}),\n });\n },\n\n /**\n * Checks if the user's name was mentioned in a meeting\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n wasMyNameMentioned(options: SummarizeMeetingOptions): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n contentType: CONTENT_TYPES.ACTION,\n contentValue: ACTION_TYPES.WAS_MY_NAME_MENTIONED,\n });\n },\n\n /**\n * Returns all action items from a meeting\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n showAllActionItems(options: SummarizeMeetingOptions): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n contentType: CONTENT_TYPES.ACTION,\n contentValue: ACTION_TYPES.SHOW_ALL_ACTION_ITEMS,\n });\n },\n\n /**\n * Helper method to encrypt text using the encryption key URL\n * @param {Object} options\n * @param {string} options.text the text to encrypt\n * @param {string} options.encryptionKeyUrl the encryption key URL to use for encryption\n * @returns {Promise<string>} returns a promise that resolves with the encrypted text\n */\n async _encryptData({text, encryptionKeyUrl}) {\n const result = await this.webex.internal.encryption.encryptText(encryptionKeyUrl, text);\n\n return result;\n },\n\n /**\n * Ask any question about the meeting content\n * @param {Object} options\n * @param {string} options.meetingInstanceId the meeting instance ID for the meeting from locus\n * @param {string} options.meetingSite the name.webex.com site for the meeting\n * @param {string} options.sessionId the session ID for subsequent requests, not required for the first request\n * @param {string} options.encryptionKeyUrl the encryption key URL for this meeting summary\n * @param {string} options.question the question to ask about the meeting content\n * @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated\n * @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName\n */\n askMeAnything(options: SummarizeMeetingOptions & {question: string}): Promise<RequestResponse> {\n return this.makeAiAssistantRequest({\n ...options,\n contextResources: [\n {\n id: options.meetingInstanceId,\n type: CONTEXT_RESOURCE_TYPES.MEETING,\n url: options.meetingSite,\n },\n ],\n contentType: CONTENT_TYPES.MESSAGE,\n contentValue: options.question,\n });\n },\n});\n\nexport default AIAssistant;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACAA,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAQA,IAAAI,UAAA,GAAAJ,OAAA;AAcA,IAAAK,MAAA,GAAAL,OAAA;AAMiB,SAAAM,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,CAAA,GAAAD,6BAAA,CAAAJ,CAAA,GAAAC,CAAA,KAAAI,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAL,CAAA,WAAAM,gCAAA,CAAAP,CAAA,EAAAC,CAAA,EAAAO,UAAA,OAAAN,CAAA,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,SAAA,CAAArF,IAAA;QAAA;MAAA,GAAAmF,QAAA;IAAA;EACf,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEK,aAAa,WAAbA,aAAaA,CAACtF,OAAqD,EAA4B;IAC7F,OAAO,IAAI,CAAC0C,sBAAsB,CAAAjI,aAAA,CAAAA,aAAA,KAC7BuF,OAAO;MACVuD,gBAAgB,EAAE,CAChB;QACEa,EAAE,EAAEpE,OAAO,CAACqE,iBAAiB;QAC7Bb,IAAI,EAAEc,iCAAsB,CAACC,OAAO;QACpCC,GAAG,EAAExE,OAAO,CAACyE;MACf,CAAC,CACF;MACDnC,WAAW,EAAE0B,wBAAa,CAAC9E,OAAO;MAClC8D,YAAY,EAAEhD,OAAO,CAACuF;IAAQ,EAC/B,CAAC;EACJ,CAAC;EAAAC,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3K,OAAA,GAEYI,WAAW","ignoreList":[]}
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "test:style": "eslint ./src/**/*.*",
50
50
  "test:unit": "webex-legacy-tools test --unit --runner jest"
51
51
  },
52
- "version": "3.11.0-next.3"
52
+ "version": "3.11.0-next.4"
53
53
  }
@@ -105,10 +105,10 @@ const AIAssistant = WebexPlugin.extend({
105
105
 
106
106
  this.stopListeningForEvents();
107
107
 
108
- return this.webex.internal.mercury.disconnect().then(() => {
109
- this.trigger(AI_ASSISTANT_UNREGISTERED);
110
- this.registered = false;
111
- });
108
+ this.trigger(AI_ASSISTANT_UNREGISTERED);
109
+ this.registered = false;
110
+
111
+ return Promise.resolve();
112
112
  },
113
113
 
114
114
  /**
@@ -16,7 +16,12 @@ import {
16
16
  AI_ASSISTANT_ERROR_CODES,
17
17
  AI_ASSISTANT_ERRORS,
18
18
  } from '@webex/internal-plugin-ai-assistant/src/constants';
19
- import {jsonResponse, messageResponse, workspaceResponse, scheduleMeetingResponse} from '../data/messages';
19
+ import {
20
+ jsonResponse,
21
+ messageResponse,
22
+ workspaceResponse,
23
+ scheduleMeetingResponse,
24
+ } from '../data/messages';
20
25
 
21
26
  const waitForAsync = () =>
22
27
  new Promise<void>((resolve) =>
@@ -130,7 +135,6 @@ describe('plugin-ai-assistant', () => {
130
135
  const result = await webex.internal.aiAssistant.unregister();
131
136
 
132
137
  expect(result).to.be.undefined;
133
- assert.callCount(webex.internal.mercury.disconnect, 0);
134
138
  assert.equal(webex.internal.aiAssistant.registered, false);
135
139
  });
136
140
  });
@@ -332,9 +336,7 @@ describe('plugin-ai-assistant', () => {
332
336
  responseType: 'thought',
333
337
  };
334
338
  expect(triggerSpy.getCall(1).args[0]).to.deep.equal('aiassistant:stream:test-request-id');
335
- expect(triggerSpy.getCall(1).args[1]).to.deep.equal(
336
- expectedResult
337
- );
339
+ expect(triggerSpy.getCall(1).args[1]).to.deep.equal(expectedResult);
338
340
 
339
341
  triggerSpy.resetHistory();
340
342
 
@@ -443,7 +445,8 @@ describe('plugin-ai-assistant', () => {
443
445
  type: 'json',
444
446
  encryptionKeyUrl: 'kms://kms-us.wbx2.com/keys/9565506d-78b1-4742-b0fd-63719748282e',
445
447
  value: {
446
- value: 'decrypted-with-kms://kms-us.wbx2.com/keys/9565506d-78b1-4742-b0fd-63719748282e-json_3_encrypted_value',
448
+ value:
449
+ 'decrypted-with-kms://kms-us.wbx2.com/keys/9565506d-78b1-4742-b0fd-63719748282e-json_3_encrypted_value',
447
450
  type: 'markdown',
448
451
  },
449
452
  },
@@ -574,12 +577,10 @@ describe('plugin-ai-assistant', () => {
574
577
  // Update the clientRequestId to match the test setup
575
578
  const firstEvent = cloneDeep(workspaceResponse[0]);
576
579
  firstEvent.clientRequestId = 'test-request-id';
577
-
580
+
578
581
  await webex.internal.aiAssistant._handleEvent(firstEvent);
579
582
 
580
- expect(triggerSpy.getCall(0).args[0]).to.equal(
581
- `aiassistant:result:test-request-id`
582
- );
583
+ expect(triggerSpy.getCall(0).args[0]).to.equal(`aiassistant:result:test-request-id`);
583
584
 
584
585
  await waitForAsync();
585
586
 
@@ -594,7 +595,7 @@ describe('plugin-ai-assistant', () => {
594
595
  // second event is another workspace chunk with an encrypted value
595
596
  const secondEvent = cloneDeep(workspaceResponse[1]);
596
597
  secondEvent.clientRequestId = 'test-request-id';
597
-
598
+
598
599
  await webex.internal.aiAssistant._handleEvent(secondEvent);
599
600
 
600
601
  expectedResult = set(
@@ -604,7 +605,7 @@ describe('plugin-ai-assistant', () => {
604
605
  );
605
606
 
606
607
  expect(triggerSpy.getCall(2).args[1]).to.deep.equal(expectedResult);
607
- });
608
+ });
608
609
 
609
610
  it('handles a schedule meeting response', async () => {
610
611
  const triggerSpy = sinon.spy(webex.internal.aiAssistant, 'trigger');
@@ -620,30 +621,28 @@ describe('plugin-ai-assistant', () => {
620
621
  // Handle schedule meeting event with encrypted fields
621
622
  const event = cloneDeep(scheduleMeetingResponse[0]);
622
623
  event.clientRequestId = 'test-request-id';
623
-
624
+
624
625
  await webex.internal.aiAssistant._handleEvent(event);
625
626
 
626
- expect(triggerSpy.getCall(0).args[0]).to.equal(
627
- `aiassistant:result:test-request-id`
628
- );
627
+ expect(triggerSpy.getCall(0).args[0]).to.equal(`aiassistant:result:test-request-id`);
629
628
 
630
629
  await waitForAsync();
631
630
 
632
631
  // Verify all encrypted fields were decrypted
633
632
  const expectedResult = cloneDeep(event);
634
- expectedResult.response.content.parameters.commentary =
633
+ expectedResult.response.content.parameters.commentary =
635
634
  'decrypted-with-kms://kms-cisco.wbx2.com/keys/dd6053f0-a1b3-428d-8104-317527d73630-schedule_meeting_encrypted_commentary';
636
- expectedResult.response.content.value.results.data.attendees[0].email =
635
+ expectedResult.response.content.value.results.data.attendees[0].email =
637
636
  'decrypted-with-kms://kms-cisco.wbx2.com/keys/dd6053f0-a1b3-428d-8104-317527d73630-schedule_meeting_encrypted_email_0';
638
- expectedResult.response.content.value.results.data.attendees[1].email =
637
+ expectedResult.response.content.value.results.data.attendees[1].email =
639
638
  'decrypted-with-kms://kms-cisco.wbx2.com/keys/dd6053f0-a1b3-428d-8104-317527d73630-schedule_meeting_encrypted_email_1';
640
- expectedResult.response.content.value.results.data.title =
639
+ expectedResult.response.content.value.results.data.title =
641
640
  'decrypted-with-kms://kms-cisco.wbx2.com/keys/dd6053f0-a1b3-428d-8104-317527d73630-schedule_meeting_encrypted_title';
642
- expectedResult.response.content.value.results.data.description =
641
+ expectedResult.response.content.value.results.data.description =
643
642
  'decrypted-with-kms://kms-cisco.wbx2.com/keys/dd6053f0-a1b3-428d-8104-317527d73630-schedule_meeting_encrypted_description';
644
- expectedResult.response.content.value.results.data.inScopeReply =
643
+ expectedResult.response.content.value.results.data.inScopeReply =
645
644
  'decrypted-with-kms://kms-cisco.wbx2.com/keys/dd6053f0-a1b3-428d-8104-317527d73630-schedule_meeting_encrypted_inScopeReply';
646
- expectedResult.response.content.value.results.data.meetingLink =
645
+ expectedResult.response.content.value.results.data.meetingLink =
647
646
  'decrypted-with-kms://kms-cisco.wbx2.com/keys/dd6053f0-a1b3-428d-8104-317527d73630-schedule_meeting_encrypted_meetingLink';
648
647
 
649
648
  expect(triggerSpy.getCall(0).args[1]).to.deep.equal(expectedResult);
@@ -830,7 +829,8 @@ describe('plugin-ai-assistant', () => {
830
829
  id: 'test-message-id',
831
830
  url: 'https://assistant-api-a.wbx2.com:443/assistant-api/api/v1/sessions/test-session-id/messages/test-message-id',
832
831
  sessionId: 'test-session-id',
833
- sessionUrl: 'https://assistant-api-a.wbx2.com:443/assistant-api/api/v1/sessions/test-session-id',
832
+ sessionUrl:
833
+ 'https://assistant-api-a.wbx2.com:443/assistant-api/api/v1/sessions/test-session-id',
834
834
  creatorId: 'test-creator-id',
835
835
  createdAt: '2025-08-05T02:11:12.361Z',
836
836
  },
@@ -867,7 +867,7 @@ describe('plugin-ai-assistant', () => {
867
867
  // Verify the request was made correctly
868
868
  expect(webex.request.calledOnce).to.be.true;
869
869
  const requestArgs = webex.request.getCall(0).args[0];
870
-
870
+
871
871
  expect(requestArgs.service).to.equal('assistant-api');
872
872
  expect(requestArgs.resource).to.equal('sessions/test-session-id/messages');
873
873
  expect(requestArgs.method).to.equal('POST');
@@ -901,7 +901,8 @@ describe('plugin-ai-assistant', () => {
901
901
  id: 'test-message-id',
902
902
  url: 'https://assistant-api-a.wbx2.com:443/assistant-api/api/v1/sessions/test-session-id/messages/test-message-id',
903
903
  sessionId: 'test-session-id',
904
- sessionUrl: 'https://assistant-api-a.wbx2.com:443/assistant-api/api/v1/sessions/test-session-id',
904
+ sessionUrl:
905
+ 'https://assistant-api-a.wbx2.com:443/assistant-api/api/v1/sessions/test-session-id',
905
906
  creatorId: 'test-creator-id',
906
907
  createdAt: '2025-08-05T02:11:12.361Z',
907
908
  requestId: 'custom-request-id',
@@ -1003,7 +1004,7 @@ describe('plugin-ai-assistant', () => {
1003
1004
  // Should use the UUID stub
1004
1005
  expect(result.requestId).to.equal('test-request-id');
1005
1006
  expect(result.streamEventName).to.equal('aiassistant:stream:test-request-id');
1006
-
1007
+
1007
1008
  const requestArgs = webex.request.getCall(0).args[0];
1008
1009
  expect(requestArgs.body.clientRequestId).to.equal('test-request-id');
1009
1010
  });
@@ -1065,9 +1066,9 @@ describe('plugin-ai-assistant', () => {
1065
1066
  contentValue: 'test_action',
1066
1067
  };
1067
1068
 
1068
- await expect(
1069
- webex.internal.aiAssistant.makeAiAssistantRequest(options)
1070
- ).to.be.rejectedWith('Network error');
1069
+ await expect(webex.internal.aiAssistant.makeAiAssistantRequest(options)).to.be.rejectedWith(
1070
+ 'Network error'
1071
+ );
1071
1072
  });
1072
1073
 
1073
1074
  it('starts timer when making a request', async () => {
@@ -1087,7 +1088,7 @@ describe('plugin-ai-assistant', () => {
1087
1088
 
1088
1089
  it('handles timeout when no streaming response comes back', async () => {
1089
1090
  const triggerSpy = sinon.spy(webex.internal.aiAssistant, 'trigger');
1090
-
1091
+
1091
1092
  const options = {
1092
1093
  sessionId: 'test-session-id',
1093
1094
  encryptionKeyUrl: 'test-key-url',
@@ -1105,10 +1106,13 @@ describe('plugin-ai-assistant', () => {
1105
1106
 
1106
1107
  // Should trigger timeout event on the stream
1107
1108
  expect(triggerSpy.calledWith('aiassistant:stream:test-request-id')).to.be.true;
1108
- const timeoutCall = triggerSpy.getCalls().find(call =>
1109
- call.args[0] === 'aiassistant:stream:test-request-id' &&
1110
- call.args[1].errorMessage === AI_ASSISTANT_ERRORS.AI_ASSISTANT_TIMEOUT
1111
- );
1109
+ const timeoutCall = triggerSpy
1110
+ .getCalls()
1111
+ .find(
1112
+ (call) =>
1113
+ call.args[0] === 'aiassistant:stream:test-request-id' &&
1114
+ call.args[1].errorMessage === AI_ASSISTANT_ERRORS.AI_ASSISTANT_TIMEOUT
1115
+ );
1112
1116
  expect(timeoutCall).to.exist;
1113
1117
  expect(timeoutCall.args[1]).to.deep.include({
1114
1118
  requestId: 'test-request-id',
@@ -1121,7 +1125,7 @@ describe('plugin-ai-assistant', () => {
1121
1125
  it('resets timer when streaming responses are received', async () => {
1122
1126
  const timerResetSpy = sinon.spy(Timer.prototype, 'reset');
1123
1127
  const timerCancelSpy = sinon.spy(Timer.prototype, 'cancel');
1124
-
1128
+
1125
1129
  const options = {
1126
1130
  sessionId: 'test-session-id',
1127
1131
  encryptionKeyUrl: 'test-key-url',