@webex/internal-plugin-ai-assistant 3.11.0 → 3.12.0-next.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.
- package/dist/ai-assistant.js +90 -57
- package/dist/ai-assistant.js.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.js +28 -2
- package/dist/utils.js.map +1 -1
- package/package.json +8 -8
- package/src/ai-assistant.ts +33 -5
- package/src/constants.ts +2 -0
- package/src/types.ts +2 -0
- package/src/utils.ts +12 -0
- package/test/unit/data/messages.ts +122 -21
- package/test/unit/spec/ai-assistant.ts +232 -43
package/dist/ai-assistant.js
CHANGED
|
@@ -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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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,12 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
98
96
|
* @private
|
|
99
97
|
*/
|
|
100
98
|
listenForEvents: function listenForEvents() {
|
|
101
|
-
var
|
|
99
|
+
var _this2 = this;
|
|
102
100
|
this.webex.internal.mercury.on(_constants.ASSISTANT_API_RESPONSE_EVENT, function (envelope) {
|
|
103
|
-
|
|
101
|
+
_this2._handleEvent(envelope.data);
|
|
102
|
+
});
|
|
103
|
+
this.webex.internal.mercury.on(_constants.ASSISTANT_API_ACTIVITY, function (envelope) {
|
|
104
|
+
_this2._handleAssistantActivity(envelope.data);
|
|
104
105
|
});
|
|
105
106
|
},
|
|
106
107
|
/**
|
|
@@ -110,6 +111,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
110
111
|
*/
|
|
111
112
|
stopListeningForEvents: function stopListeningForEvents() {
|
|
112
113
|
this.webex.internal.mercury.off(_constants.ASSISTANT_API_RESPONSE_EVENT);
|
|
114
|
+
this.webex.internal.mercury.off(_constants.ASSISTANT_API_ACTIVITY);
|
|
113
115
|
},
|
|
114
116
|
/**
|
|
115
117
|
* constructs the event name based on request id
|
|
@@ -137,6 +139,28 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
137
139
|
_handleEvent: function _handleEvent(data) {
|
|
138
140
|
this.trigger(this._getResultEventName(data.clientRequestId), data);
|
|
139
141
|
},
|
|
142
|
+
/**
|
|
143
|
+
* Handles an incoming activity event from the assistant API and triggers the correct event for consumers to listen to
|
|
144
|
+
* @param {Object} data the event data
|
|
145
|
+
* @returns {undefined}
|
|
146
|
+
*/
|
|
147
|
+
_handleAssistantActivity: function _handleAssistantActivity(data) {
|
|
148
|
+
var _this3 = this;
|
|
149
|
+
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
150
|
+
return _regenerator.default.wrap(function (_context) {
|
|
151
|
+
while (1) switch (_context.prev = _context.next) {
|
|
152
|
+
case 0:
|
|
153
|
+
_context.next = 1;
|
|
154
|
+
return (0, _utils.decryptAssistantActivity)(data.activity, _this3.webex);
|
|
155
|
+
case 1:
|
|
156
|
+
_this3.trigger(_constants.AI_ASSISTANT_ACTIVITY_RECEIVED, data);
|
|
157
|
+
case 2:
|
|
158
|
+
case "end":
|
|
159
|
+
return _context.stop();
|
|
160
|
+
}
|
|
161
|
+
}, _callee);
|
|
162
|
+
}))();
|
|
163
|
+
},
|
|
140
164
|
/**
|
|
141
165
|
* Decrypts the response content in place
|
|
142
166
|
* @param {any} responseContent the content object from the assistant-api response
|
|
@@ -144,48 +168,48 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
144
168
|
*/
|
|
145
169
|
_decryptContent: function _decryptContent(responseContent) {
|
|
146
170
|
var _this4 = this;
|
|
147
|
-
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
171
|
+
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
148
172
|
var _t;
|
|
149
|
-
return _regenerator.default.wrap(function (
|
|
150
|
-
while (1) switch (
|
|
173
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
174
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
151
175
|
case 0:
|
|
152
176
|
_t = responseContent.name;
|
|
153
|
-
|
|
177
|
+
_context2.next = _t === _constants.RESPONSE_NAMES.MESSAGE ? 1 : _t === _constants.RESPONSE_NAMES.CITED_ANSWER ? 3 : _t === _constants.RESPONSE_NAMES.SCHEDULE_MEETING ? 5 : _t === _constants.RESPONSE_NAMES.TOOL_RESULT ? 7 : _t === _constants.RESPONSE_NAMES.TOOL_USE ? 8 : _t === _constants.RESPONSE_NAMES.WORKSPACE ? 10 : 12;
|
|
154
178
|
break;
|
|
155
179
|
case 1:
|
|
156
|
-
|
|
180
|
+
_context2.next = 2;
|
|
157
181
|
return (0, _utils.decryptMessage)(responseContent, _this4.webex);
|
|
158
182
|
case 2:
|
|
159
|
-
return
|
|
183
|
+
return _context2.abrupt("continue", 13);
|
|
160
184
|
case 3:
|
|
161
|
-
|
|
185
|
+
_context2.next = 4;
|
|
162
186
|
return (0, _utils.decryptCitedAnswer)(responseContent, _this4.webex);
|
|
163
187
|
case 4:
|
|
164
|
-
return
|
|
188
|
+
return _context2.abrupt("continue", 13);
|
|
165
189
|
case 5:
|
|
166
|
-
|
|
190
|
+
_context2.next = 6;
|
|
167
191
|
return (0, _utils.decryptScheduleMeeting)(responseContent, _this4.webex);
|
|
168
192
|
case 6:
|
|
169
|
-
return
|
|
193
|
+
return _context2.abrupt("continue", 13);
|
|
170
194
|
case 7:
|
|
171
|
-
return
|
|
195
|
+
return _context2.abrupt("continue", 13);
|
|
172
196
|
case 8:
|
|
173
|
-
|
|
197
|
+
_context2.next = 9;
|
|
174
198
|
return (0, _utils.decryptToolUse)(responseContent, _this4.webex);
|
|
175
199
|
case 9:
|
|
176
|
-
return
|
|
200
|
+
return _context2.abrupt("continue", 13);
|
|
177
201
|
case 10:
|
|
178
|
-
|
|
202
|
+
_context2.next = 11;
|
|
179
203
|
return (0, _utils.decryptWorkspace)(responseContent, _this4.webex);
|
|
180
204
|
case 11:
|
|
181
|
-
return
|
|
205
|
+
return _context2.abrupt("continue", 13);
|
|
182
206
|
case 12:
|
|
183
207
|
_this4.logger.error("AI assistant->_decryptContent#ERROR, Unknown response content name: ".concat(responseContent.name));
|
|
184
208
|
case 13:
|
|
185
209
|
case "end":
|
|
186
|
-
return
|
|
210
|
+
return _context2.stop();
|
|
187
211
|
}
|
|
188
|
-
},
|
|
212
|
+
}, _callee2);
|
|
189
213
|
}))();
|
|
190
214
|
},
|
|
191
215
|
/**
|
|
@@ -198,7 +222,8 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
198
222
|
_request: function _request(options) {
|
|
199
223
|
var _this5 = this;
|
|
200
224
|
var resource = options.resource,
|
|
201
|
-
params = options.params
|
|
225
|
+
params = options.params,
|
|
226
|
+
headers = options.headers;
|
|
202
227
|
var timeout = this.config.requestTimeout;
|
|
203
228
|
var requestId = options.requestId || _uuid.default.v4();
|
|
204
229
|
var eventName = this._getResultEventName(requestId);
|
|
@@ -216,10 +241,10 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
216
241
|
});
|
|
217
242
|
}, timeout);
|
|
218
243
|
_this5.listenTo(_this5, eventName, /*#__PURE__*/function () {
|
|
219
|
-
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
244
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(data) {
|
|
220
245
|
var resultData, errorMessage, errorCode, responseType, decryptErrorMessage, _t2;
|
|
221
|
-
return _regenerator.default.wrap(function (
|
|
222
|
-
while (1) switch (
|
|
246
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
247
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
223
248
|
case 0:
|
|
224
249
|
timer.reset();
|
|
225
250
|
resultData = (0, _lodash.get)(data, 'response.content', {});
|
|
@@ -230,19 +255,19 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
230
255
|
timer.cancel();
|
|
231
256
|
_this5.stopListening(_this5, eventName);
|
|
232
257
|
}
|
|
233
|
-
|
|
258
|
+
_context3.prev = 1;
|
|
234
259
|
if (errorCode) {
|
|
235
|
-
|
|
260
|
+
_context3.next = 2;
|
|
236
261
|
break;
|
|
237
262
|
}
|
|
238
|
-
|
|
263
|
+
_context3.next = 2;
|
|
239
264
|
return _this5._decryptContent(resultData);
|
|
240
265
|
case 2:
|
|
241
|
-
|
|
266
|
+
_context3.next = 4;
|
|
242
267
|
break;
|
|
243
268
|
case 3:
|
|
244
|
-
|
|
245
|
-
_t2 =
|
|
269
|
+
_context3.prev = 3;
|
|
270
|
+
_t2 = _context3["catch"](1);
|
|
246
271
|
decryptErrorMessage = _t2.message;
|
|
247
272
|
case 4:
|
|
248
273
|
_this5.trigger(streamEventName, (0, _lodash.merge)({}, data.response, {
|
|
@@ -254,9 +279,9 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
254
279
|
}));
|
|
255
280
|
case 5:
|
|
256
281
|
case "end":
|
|
257
|
-
return
|
|
282
|
+
return _context3.stop();
|
|
258
283
|
}
|
|
259
|
-
},
|
|
284
|
+
}, _callee3, null, [[1, 3]]);
|
|
260
285
|
}));
|
|
261
286
|
return function (_x) {
|
|
262
287
|
return _ref.apply(this, arguments);
|
|
@@ -269,7 +294,8 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
269
294
|
contentType: 'application/json',
|
|
270
295
|
body: _objectSpread({
|
|
271
296
|
clientRequestId: requestId
|
|
272
|
-
}, params)
|
|
297
|
+
}, params),
|
|
298
|
+
headers: headers
|
|
273
299
|
}).then(function (_ref2) {
|
|
274
300
|
var body = _ref2.body;
|
|
275
301
|
resolve(_objectSpread(_objectSpread({}, body), {}, {
|
|
@@ -295,29 +321,30 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
295
321
|
* @param {Object} options.locale optional locale to use for the request, defaults to 'en_US'
|
|
296
322
|
* @param {string} options.requestId optional request ID to use for this request, if not provided a new UUID will be generated
|
|
297
323
|
* @param {string} options.entryPoint optional entryPoint to use for this request
|
|
324
|
+
* @param {string} options.renderProtocolVersion optional render protocol version to use for this request
|
|
298
325
|
* @returns {Promise<Object>} Resolves with an object containing the requestId, sessionId and streamEventName
|
|
299
326
|
* @public
|
|
300
327
|
* @memberof AIAssistant
|
|
301
328
|
*/
|
|
302
329
|
makeAiAssistantRequest: function makeAiAssistantRequest(options) {
|
|
303
330
|
var _this6 = this;
|
|
304
|
-
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
305
|
-
var value, content;
|
|
306
|
-
return _regenerator.default.wrap(function (
|
|
307
|
-
while (1) switch (
|
|
331
|
+
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
332
|
+
var value, content, headers;
|
|
333
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
334
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
308
335
|
case 0:
|
|
309
336
|
value = options.contentValue;
|
|
310
337
|
if (!(options.contentType === 'message')) {
|
|
311
|
-
|
|
338
|
+
_context4.next = 2;
|
|
312
339
|
break;
|
|
313
340
|
}
|
|
314
|
-
|
|
341
|
+
_context4.next = 1;
|
|
315
342
|
return _this6._encryptData({
|
|
316
343
|
text: options.contentValue,
|
|
317
344
|
encryptionKeyUrl: options.encryptionKeyUrl
|
|
318
345
|
});
|
|
319
346
|
case 1:
|
|
320
|
-
value =
|
|
347
|
+
value = _context4.sent;
|
|
321
348
|
case 2:
|
|
322
349
|
content = {
|
|
323
350
|
context: {
|
|
@@ -330,7 +357,11 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
330
357
|
if (options.parameters) {
|
|
331
358
|
content.parameters = options.parameters;
|
|
332
359
|
}
|
|
333
|
-
|
|
360
|
+
headers = {};
|
|
361
|
+
if (options.renderProtocolVersion) {
|
|
362
|
+
headers['AI-Assistant-Render-Protocol'] = options.renderProtocolVersion;
|
|
363
|
+
}
|
|
364
|
+
return _context4.abrupt("return", _this6._request(_objectSpread(_objectSpread({
|
|
334
365
|
resource: options.sessionId ? "sessions/".concat(options.sessionId, "/messages") : 'sessions/messages',
|
|
335
366
|
params: _objectSpread(_objectSpread({
|
|
336
367
|
async: 'chunked',
|
|
@@ -343,12 +374,14 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
343
374
|
} : {})
|
|
344
375
|
}, options.requestId ? {
|
|
345
376
|
requestId: options.requestId
|
|
346
|
-
} : {})
|
|
377
|
+
} : {}), {}, {
|
|
378
|
+
headers: headers
|
|
379
|
+
})));
|
|
347
380
|
case 3:
|
|
348
381
|
case "end":
|
|
349
|
-
return
|
|
382
|
+
return _context4.stop();
|
|
350
383
|
}
|
|
351
|
-
},
|
|
384
|
+
}, _callee4);
|
|
352
385
|
}))();
|
|
353
386
|
},
|
|
354
387
|
/**
|
|
@@ -428,22 +461,22 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
428
461
|
*/
|
|
429
462
|
_encryptData: function _encryptData(_ref3) {
|
|
430
463
|
var _this7 = this;
|
|
431
|
-
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
464
|
+
return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
432
465
|
var text, encryptionKeyUrl, result;
|
|
433
|
-
return _regenerator.default.wrap(function (
|
|
434
|
-
while (1) switch (
|
|
466
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
467
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
435
468
|
case 0:
|
|
436
469
|
text = _ref3.text, encryptionKeyUrl = _ref3.encryptionKeyUrl;
|
|
437
|
-
|
|
470
|
+
_context5.next = 1;
|
|
438
471
|
return _this7.webex.internal.encryption.encryptText(encryptionKeyUrl, text);
|
|
439
472
|
case 1:
|
|
440
|
-
result =
|
|
441
|
-
return
|
|
473
|
+
result = _context5.sent;
|
|
474
|
+
return _context5.abrupt("return", result);
|
|
442
475
|
case 2:
|
|
443
476
|
case "end":
|
|
444
|
-
return
|
|
477
|
+
return _context5.stop();
|
|
445
478
|
}
|
|
446
|
-
},
|
|
479
|
+
}, _callee5);
|
|
447
480
|
}))();
|
|
448
481
|
},
|
|
449
482
|
/**
|
|
@@ -468,7 +501,7 @@ var AIAssistant = _webexCore.WebexPlugin.extend({
|
|
|
468
501
|
contentValue: options.question
|
|
469
502
|
}));
|
|
470
503
|
},
|
|
471
|
-
version: "
|
|
504
|
+
version: "3.12.0-next.2"
|
|
472
505
|
});
|
|
473
506
|
var _default = exports.default = AIAssistant;
|
|
474
507
|
//# sourceMappingURL=ai-assistant.js.map
|
package/dist/ai-assistant.js.map
CHANGED
|
@@ -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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,EAAA+B,MAAA;MAAA,OAAA1G,YAAA,CAAA3D,OAAA,CAAA+D,IAAA,WAAAuG,SAAA;QAAA,kBAAAA,SAAA,CAAArG,IAAA,GAAAqG,SAAA,CAAApG,IAAA;UAAA;YAAzBmE,IAAI,GAAA6B,KAAA,CAAJ7B,IAAI,EAAEC,gBAAgB,GAAA4B,KAAA,CAAhB5B,gBAAgB;YAAAgC,SAAA,CAAApG,IAAA;YAAA,OACnBiG,MAAI,CAACjJ,KAAK,CAACS,QAAQ,CAAC4I,UAAU,CAACC,WAAW,CAAClC,gBAAgB,EAAED,IAAI,CAAC;UAAA;YAAjFgC,MAAM,GAAAC,SAAA,CAAA/B,IAAA;YAAA,OAAA+B,SAAA,CAAA1F,MAAA,WAELyF,MAAM;UAAA;UAAA;YAAA,OAAAC,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,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","ASSISTANT_API_ACTIVITY","_handleAssistantActivity","off","_getResultEventName","requestId","AI_ASSISTANT_RESULT","_getStreamEventName","AI_ASSISTANT_STREAM","clientRequestId","_this3","_asyncToGenerator2","_regenerator","mark","_callee","wrap","_context","prev","next","decryptAssistantActivity","activity","AI_ASSISTANT_ACTIVITY_RECEIVED","stop","_decryptContent","responseContent","_this4","_callee2","_t","_context2","name","RESPONSE_NAMES","MESSAGE","CITED_ANSWER","SCHEDULE_MEETING","TOOL_RESULT","TOOL_USE","WORKSPACE","decryptMessage","abrupt","decryptCitedAnswer","decryptScheduleMeeting","decryptToolUse","decryptWorkspace","_request","options","_this5","resource","params","headers","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","_callee3","resultData","responseType","decryptErrorMessage","_t2","_context3","reset","get","cancel","merge","response","_x","request","service","AI_ASSISTANT_SERVICE_NAME","method","contentType","body","_ref2","start","makeAiAssistantRequest","_this6","_callee4","value","content","_context4","contentValue","_encryptData","text","encryptionKeyUrl","sent","context","resources","contextResources","type","parameters","renderProtocolVersion","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","_callee5","result","_context5","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 ASSISTANT_API_ACTIVITY,\n ACTION_TYPES,\n CONTENT_TYPES,\n CONTEXT_RESOURCE_TYPES,\n RESPONSE_NAMES,\n AI_ASSISTANT_ACTIVITY_RECEIVED,\n} from './constants';\nimport {\n decryptAssistantActivity,\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 this.webex.internal.mercury.on(ASSISTANT_API_ACTIVITY, (envelope) => {\n this._handleAssistantActivity(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 this.webex.internal.mercury.off(ASSISTANT_API_ACTIVITY);\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 * Handles an incoming activity event from the assistant API and triggers the correct event for consumers to listen to\n * @param {Object} data the event data\n * @returns {undefined}\n */\n async _handleAssistantActivity(data) {\n await decryptAssistantActivity(data.activity, this.webex);\n\n this.trigger(AI_ASSISTANT_ACTIVITY_RECEIVED, 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, headers} = 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 headers,\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 * @param {string} options.renderProtocolVersion optional render protocol version 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 const headers = {};\n\n if (options.renderProtocolVersion) {\n headers['AI-Assistant-Render-Protocol'] = options.renderProtocolVersion;\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 headers,\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;AAgBA,IAAAK,MAAA,GAAAL,OAAA;AAOiB,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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A,aAAaA,CAACxF,OAAqD,EAA4B;IAC7F,OAAO,IAAI,CAAC2C,sBAAsB,CAAA1I,aAAA,CAAAA,aAAA,KAC7B+F,OAAO;MACVwD,gBAAgB,EAAE,CAChB;QACEc,EAAE,EAAEtE,OAAO,CAACuE,iBAAiB;QAC7Bd,IAAI,EAAEe,iCAAsB,CAACC,OAAO;QACpCC,GAAG,EAAE1E,OAAO,CAAC2E;MACf,CAAC,CACF;MACDpC,WAAW,EAAE2B,wBAAa,CAAC/E,OAAO;MAClC8D,YAAY,EAAEjD,OAAO,CAACyF;IAAQ,EAC/B,CAAC;EACJ,CAAC;EAAAC,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArL,OAAA,GAEYI,WAAW","ignoreList":[]}
|
package/dist/constants.js
CHANGED
|
@@ -4,12 +4,14 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
4
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.RESPONSE_NAMES = exports.CONTEXT_RESOURCE_TYPES = exports.CONTENT_TYPES = exports.ASSISTANT_API_RESPONSE_EVENT = exports.AI_ASSISTANT_UNREGISTERED = exports.AI_ASSISTANT_STREAM = exports.AI_ASSISTANT_SERVICE_NAME = exports.AI_ASSISTANT_RESULT = exports.AI_ASSISTANT_REGISTERED = exports.AI_ASSISTANT_ERROR_CODES = exports.AI_ASSISTANT_ERRORS = exports.ACTION_TYPES = void 0;
|
|
7
|
+
exports.RESPONSE_NAMES = exports.CONTEXT_RESOURCE_TYPES = exports.CONTENT_TYPES = exports.ASSISTANT_API_RESPONSE_EVENT = exports.ASSISTANT_API_ACTIVITY = exports.AI_ASSISTANT_UNREGISTERED = exports.AI_ASSISTANT_STREAM = exports.AI_ASSISTANT_SERVICE_NAME = exports.AI_ASSISTANT_RESULT = exports.AI_ASSISTANT_REGISTERED = exports.AI_ASSISTANT_ERROR_CODES = exports.AI_ASSISTANT_ERRORS = exports.AI_ASSISTANT_ACTIVITY_RECEIVED = exports.ACTION_TYPES = void 0;
|
|
8
8
|
var AI_ASSISTANT_REGISTERED = exports.AI_ASSISTANT_REGISTERED = 'aiassistant:registered';
|
|
9
9
|
var AI_ASSISTANT_UNREGISTERED = exports.AI_ASSISTANT_UNREGISTERED = 'aiassistant:unregistered';
|
|
10
10
|
var ASSISTANT_API_RESPONSE_EVENT = exports.ASSISTANT_API_RESPONSE_EVENT = 'event:assistant-api.response';
|
|
11
|
+
var ASSISTANT_API_ACTIVITY = exports.ASSISTANT_API_ACTIVITY = 'assistant-api.activity';
|
|
11
12
|
var AI_ASSISTANT_SERVICE_NAME = exports.AI_ASSISTANT_SERVICE_NAME = 'assistant-api';
|
|
12
13
|
var AI_ASSISTANT_RESULT = exports.AI_ASSISTANT_RESULT = 'aiassistant:result';
|
|
14
|
+
var AI_ASSISTANT_ACTIVITY_RECEIVED = exports.AI_ASSISTANT_ACTIVITY_RECEIVED = 'aiassistant:activityReceived';
|
|
13
15
|
var AI_ASSISTANT_STREAM = exports.AI_ASSISTANT_STREAM = 'aiassistant:stream';
|
|
14
16
|
var AI_ASSISTANT_ERRORS = exports.AI_ASSISTANT_ERRORS = /*#__PURE__*/function (AI_ASSISTANT_ERRORS) {
|
|
15
17
|
AI_ASSISTANT_ERRORS["NOT_ENOUGH_CONTENT"] = "NO_ENOUGH_MEETING_TRANSCRIPT";
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AI_ASSISTANT_REGISTERED","exports","AI_ASSISTANT_UNREGISTERED","ASSISTANT_API_RESPONSE_EVENT","AI_ASSISTANT_SERVICE_NAME","AI_ASSISTANT_RESULT","AI_ASSISTANT_STREAM","AI_ASSISTANT_ERRORS","AI_ASSISTANT_ERROR_CODES","ACTION_TYPES","CONTENT_TYPES","CONTEXT_RESOURCE_TYPES","RESPONSE_NAMES"],"sources":["constants.ts"],"sourcesContent":["export const AI_ASSISTANT_REGISTERED = 'aiassistant:registered';\nexport const AI_ASSISTANT_UNREGISTERED = 'aiassistant:unregistered';\nexport const ASSISTANT_API_RESPONSE_EVENT = 'event:assistant-api.response';\nexport const AI_ASSISTANT_SERVICE_NAME = 'assistant-api';\nexport const AI_ASSISTANT_RESULT = 'aiassistant:result';\nexport const AI_ASSISTANT_STREAM = 'aiassistant:stream';\n\nexport enum AI_ASSISTANT_ERRORS {\n NOT_ENOUGH_CONTENT = 'NO_ENOUGH_MEETING_TRANSCRIPT',\n TRANSCRIPT_AUTH_ERROR = 'TRANSCRIPT_AUTH_ERROR',\n AI_ASSISTANT_TIMEOUT = 'AI_ASSISTANT_TIMEOUT', // This one is generated by the plugin\n}\n\nexport enum AI_ASSISTANT_ERROR_CODES {\n AI_ASSISTANT_TIMEOUT = 9408, // This one is generated by the plugin\n NOT_ENOUGH_CONTENT = 204,\n FORBIDDEN = 403,\n LLM_TIMEOUT = 408,\n RATE_LIMIT = 429,\n GENERIC_ERROR = 10000,\n WAIT_PREVIOUS = 10001,\n EMPTY_SEARCH_RESULT = 10002,\n}\n\nexport enum ACTION_TYPES {\n SHOW_ALL_ACTION_ITEMS = 'SHOW_ALL_ACTION_ITEMS',\n WAS_MY_NAME_MENTIONED = 'WAS_MY_NAME_MENTIONED',\n SUMMARIZE_FOR_ME = 'SUMMARIZE_FOR_ME',\n}\n\nexport enum CONTENT_TYPES {\n ACTION = 'action',\n MESSAGE = 'message',\n}\n\nexport enum CONTEXT_RESOURCE_TYPES {\n MEETING = 'meeting',\n}\n\nexport enum RESPONSE_NAMES {\n TOOL_USE = 'tool_use',\n CITED_ANSWER = 'cited_answer',\n MESSAGE = 'message',\n TOOL_RESULT = 'tool_result',\n WORKSPACE = 'workspace',\n SCHEDULE_MEETING = 'schedule_meeting',\n}\n"],"mappings":";;;;;;;AAAO,IAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,wBAAwB;AACxD,IAAME,yBAAyB,GAAAD,OAAA,CAAAC,yBAAA,GAAG,0BAA0B;AAC5D,IAAMC,4BAA4B,GAAAF,OAAA,CAAAE,4BAAA,GAAG,8BAA8B;AACnE,IAAMC,
|
|
1
|
+
{"version":3,"names":["AI_ASSISTANT_REGISTERED","exports","AI_ASSISTANT_UNREGISTERED","ASSISTANT_API_RESPONSE_EVENT","ASSISTANT_API_ACTIVITY","AI_ASSISTANT_SERVICE_NAME","AI_ASSISTANT_RESULT","AI_ASSISTANT_ACTIVITY_RECEIVED","AI_ASSISTANT_STREAM","AI_ASSISTANT_ERRORS","AI_ASSISTANT_ERROR_CODES","ACTION_TYPES","CONTENT_TYPES","CONTEXT_RESOURCE_TYPES","RESPONSE_NAMES"],"sources":["constants.ts"],"sourcesContent":["export const AI_ASSISTANT_REGISTERED = 'aiassistant:registered';\nexport const AI_ASSISTANT_UNREGISTERED = 'aiassistant:unregistered';\nexport const ASSISTANT_API_RESPONSE_EVENT = 'event:assistant-api.response';\nexport const ASSISTANT_API_ACTIVITY = 'assistant-api.activity';\nexport const AI_ASSISTANT_SERVICE_NAME = 'assistant-api';\nexport const AI_ASSISTANT_RESULT = 'aiassistant:result';\nexport const AI_ASSISTANT_ACTIVITY_RECEIVED = 'aiassistant:activityReceived';\nexport const AI_ASSISTANT_STREAM = 'aiassistant:stream';\n\nexport enum AI_ASSISTANT_ERRORS {\n NOT_ENOUGH_CONTENT = 'NO_ENOUGH_MEETING_TRANSCRIPT',\n TRANSCRIPT_AUTH_ERROR = 'TRANSCRIPT_AUTH_ERROR',\n AI_ASSISTANT_TIMEOUT = 'AI_ASSISTANT_TIMEOUT', // This one is generated by the plugin\n}\n\nexport enum AI_ASSISTANT_ERROR_CODES {\n AI_ASSISTANT_TIMEOUT = 9408, // This one is generated by the plugin\n NOT_ENOUGH_CONTENT = 204,\n FORBIDDEN = 403,\n LLM_TIMEOUT = 408,\n RATE_LIMIT = 429,\n GENERIC_ERROR = 10000,\n WAIT_PREVIOUS = 10001,\n EMPTY_SEARCH_RESULT = 10002,\n}\n\nexport enum ACTION_TYPES {\n SHOW_ALL_ACTION_ITEMS = 'SHOW_ALL_ACTION_ITEMS',\n WAS_MY_NAME_MENTIONED = 'WAS_MY_NAME_MENTIONED',\n SUMMARIZE_FOR_ME = 'SUMMARIZE_FOR_ME',\n}\n\nexport enum CONTENT_TYPES {\n ACTION = 'action',\n MESSAGE = 'message',\n}\n\nexport enum CONTEXT_RESOURCE_TYPES {\n MEETING = 'meeting',\n}\n\nexport enum RESPONSE_NAMES {\n TOOL_USE = 'tool_use',\n CITED_ANSWER = 'cited_answer',\n MESSAGE = 'message',\n TOOL_RESULT = 'tool_result',\n WORKSPACE = 'workspace',\n SCHEDULE_MEETING = 'schedule_meeting',\n}\n"],"mappings":";;;;;;;AAAO,IAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,wBAAwB;AACxD,IAAME,yBAAyB,GAAAD,OAAA,CAAAC,yBAAA,GAAG,0BAA0B;AAC5D,IAAMC,4BAA4B,GAAAF,OAAA,CAAAE,4BAAA,GAAG,8BAA8B;AACnE,IAAMC,sBAAsB,GAAAH,OAAA,CAAAG,sBAAA,GAAG,wBAAwB;AACvD,IAAMC,yBAAyB,GAAAJ,OAAA,CAAAI,yBAAA,GAAG,eAAe;AACjD,IAAMC,mBAAmB,GAAAL,OAAA,CAAAK,mBAAA,GAAG,oBAAoB;AAChD,IAAMC,8BAA8B,GAAAN,OAAA,CAAAM,8BAAA,GAAG,8BAA8B;AACrE,IAAMC,mBAAmB,GAAAP,OAAA,CAAAO,mBAAA,GAAG,oBAAoB;AAAC,IAE5CC,mBAAmB,GAAAR,OAAA,CAAAQ,mBAAA,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB,mDAGkB;EAAA,OAHrCA,mBAAmB;AAAA;AAAA,IAMnBC,wBAAwB,GAAAT,OAAA,CAAAS,wBAAA,0BAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EACL;EADnBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAA,OAAxBA,wBAAwB;AAAA;AAAA,IAWxBC,YAAY,GAAAV,OAAA,CAAAU,YAAA,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAAA,IAMZC,aAAa,GAAAX,OAAA,CAAAW,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAAA,IAKbC,sBAAsB,GAAAZ,OAAA,CAAAY,sBAAA,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAAA,IAItBC,cAAc,GAAAb,OAAA,CAAAa,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface RequestResponse {\n sessionId: string;\n requestId: string;\n streamEventName: string;\n id: string;\n url: string;\n sessionUrl: string;\n creatorId: string;\n createdAt: string;\n}\n\nexport interface StreamEvent {\n message: string;\n requestId: string;\n finished: boolean;\n error: string | null;\n}\n\nexport interface RequestOptions {\n resource: string;\n dataPath: string;\n foundPath?: string;\n notFoundPath?: string;\n params?: Record<string, unknown>;\n requestId?: string;\n}\n\nexport interface ContextResource {\n id: string;\n type: string;\n url: string;\n}\n\nexport interface SummarizeMeetingOptions {\n assistant?: string;\n meetingInstanceId: string;\n meetingSite: string;\n sessionId: string;\n encryptionKeyUrl: string;\n lastMinutes?: number;\n requestId?: string;\n}\n\nexport interface AiAssistantRequestOptions {\n sessionId: string;\n encryptionKeyUrl: string;\n contextResources: ContextResource[];\n contentType: 'action' | 'message';\n contentValue: string;\n parameters?: any;\n assistant?: string;\n locale?: string;\n requestId?: string;\n entryPoint?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface RequestResponse {\n sessionId: string;\n requestId: string;\n streamEventName: string;\n id: string;\n url: string;\n sessionUrl: string;\n creatorId: string;\n createdAt: string;\n}\n\nexport interface StreamEvent {\n message: string;\n requestId: string;\n finished: boolean;\n error: string | null;\n}\n\nexport interface RequestOptions {\n resource: string;\n dataPath: string;\n foundPath?: string;\n notFoundPath?: string;\n params?: Record<string, unknown>;\n requestId?: string;\n headers?: Record<string, string>;\n}\n\nexport interface ContextResource {\n id: string;\n type: string;\n url: string;\n}\n\nexport interface SummarizeMeetingOptions {\n assistant?: string;\n meetingInstanceId: string;\n meetingSite: string;\n sessionId: string;\n encryptionKeyUrl: string;\n lastMinutes?: number;\n requestId?: string;\n}\n\nexport interface AiAssistantRequestOptions {\n sessionId: string;\n encryptionKeyUrl: string;\n contextResources: ContextResource[];\n contentType: 'action' | 'message';\n contentValue: string;\n parameters?: any;\n assistant?: string;\n locale?: string;\n requestId?: string;\n entryPoint?: string;\n renderProtocolVersion?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
|
|
|
5
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.decryptWorkspace = exports.decryptToolUse = exports.decryptScheduleMeeting = exports.decryptMessage = exports.decryptCitedAnswer = void 0;
|
|
8
|
+
exports.decryptWorkspace = exports.decryptToolUse = exports.decryptScheduleMeeting = exports.decryptMessage = exports.decryptCitedAnswer = exports.decryptAssistantActivity = void 0;
|
|
9
9
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
10
10
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
@@ -70,9 +70,18 @@ var decryptCitedAnswer = exports.decryptCitedAnswer = /*#__PURE__*/function () {
|
|
|
70
70
|
return decryptInPlace(data, "value.citations.".concat(index, ".name"), 'encryptionKeyUrl', webex);
|
|
71
71
|
}));
|
|
72
72
|
case 1:
|
|
73
|
+
if (!data.value.sources) {
|
|
74
|
+
_context3.next = 2;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
73
77
|
_context3.next = 2;
|
|
74
|
-
return
|
|
78
|
+
return _promise.default.all(data.value.sources.map(function (source, index) {
|
|
79
|
+
return decryptInPlace(data, "value.sources.".concat(index, ".name"), 'encryptionKeyUrl', webex);
|
|
80
|
+
}));
|
|
75
81
|
case 2:
|
|
82
|
+
_context3.next = 3;
|
|
83
|
+
return decryptInPlace(data, 'value.value', 'encryptionKeyUrl', webex);
|
|
84
|
+
case 3:
|
|
76
85
|
case "end":
|
|
77
86
|
return _context3.stop();
|
|
78
87
|
}
|
|
@@ -152,4 +161,21 @@ var decryptWorkspace = exports.decryptWorkspace = /*#__PURE__*/function () {
|
|
|
152
161
|
return _ref6.apply(this, arguments);
|
|
153
162
|
};
|
|
154
163
|
}();
|
|
164
|
+
var decryptAssistantActivity = exports.decryptAssistantActivity = /*#__PURE__*/function () {
|
|
165
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7(data, webex) {
|
|
166
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
167
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
168
|
+
case 0:
|
|
169
|
+
_context7.next = 1;
|
|
170
|
+
return decryptInPlace(data, 'content.value.message', 'encryptionKeyUrl', webex);
|
|
171
|
+
case 1:
|
|
172
|
+
case "end":
|
|
173
|
+
return _context7.stop();
|
|
174
|
+
}
|
|
175
|
+
}, _callee7);
|
|
176
|
+
}));
|
|
177
|
+
return function decryptAssistantActivity(_x13, _x14) {
|
|
178
|
+
return _ref7.apply(this, arguments);
|
|
179
|
+
};
|
|
180
|
+
}();
|
|
155
181
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lodash","require","decryptInPlace","_ref","_asyncToGenerator2","default","_regenerator","mark","_callee","item","valuePath","keyPath","webex","encryptedValue","encryptionKeyUrl","decryptedValue","wrap","_context","prev","next","get","abrupt","internal","encryption","decryptText","sent","set","stop","_x","_x2","_x3","_x4","apply","arguments","decryptToolUse","exports","_ref2","_callee2","data","_context2","_x5","_x6","decryptCitedAnswer","_ref3","_callee3","_context3","value","citations","_promise","all","map","citation","index","concat","_x7","_x8","decryptScheduleMeeting","_ref4","_callee4","_data$value","_data$value$results","meetingData","_context4","results","attendees","attendee","_x9","_x0","decryptMessage","_ref5","_callee5","_context5","_x1","_x10","decryptWorkspace","_ref6","_callee6","_context6","_x11","_x12"],"sources":["utils.ts"],"sourcesContent":["import {get, set} from 'lodash';\n\nconst decryptInPlace = async (item, valuePath, keyPath, webex) => {\n const encryptedValue = get(item, valuePath);\n const encryptionKeyUrl = get(item, keyPath);\n\n if (!encryptedValue || !encryptionKeyUrl) {\n return;\n }\n\n const decryptedValue = await webex.internal.encryption.decryptText(\n encryptionKeyUrl,\n encryptedValue\n );\n\n set(item, valuePath, decryptedValue);\n};\n\nexport const decryptToolUse = async (data, webex) => {\n await decryptInPlace(data, 'value.value', 'encryptionKeyUrl', webex);\n};\n\nexport const decryptCitedAnswer = async (data, webex) => {\n if (data.value.citations) {\n await Promise.all(\n data.value.citations.map((citation, index) => {\n return decryptInPlace(data, `value.citations.${index}.name`, 'encryptionKeyUrl', webex);\n })\n );\n }\n\n await decryptInPlace(data, 'value.value', 'encryptionKeyUrl', webex);\n};\nexport const decryptScheduleMeeting = async (data, webex) => {\n // Decrypt commentary in parameters\n await decryptInPlace(data, 'parameters.commentary', 'encryptionKeyUrl', webex);\n\n const meetingData = data.value?.results?.data;\n if (meetingData) {\n // Decrypt attendee emails\n if (meetingData.attendees) {\n await Promise.all(\n meetingData.attendees.map((attendee, index) => {\n return decryptInPlace(\n data,\n `value.results.data.attendees.${index}.email`,\n 'encryptionKeyUrl',\n webex\n );\n })\n );\n }\n\n // Decrypt other fields in the meeting data\n await Promise.all([\n decryptInPlace(data, 'value.results.data.title', 'encryptionKeyUrl', webex),\n decryptInPlace(data, 'value.results.data.inScopeReply', 'encryptionKeyUrl', webex),\n decryptInPlace(data, 'value.results.data.meetingLink', 'encryptionKeyUrl', webex),\n decryptInPlace(data, 'value.results.data.description', 'encryptionKeyUrl', webex),\n ]);\n }\n};\n\nexport const decryptMessage = async (data, webex) => {\n await decryptInPlace(data, 'value', 'encryptionKeyUrl', webex);\n};\n\nexport const decryptWorkspace = async (data, webex) => {\n await decryptInPlace(data, 'value.value', 'encryptionKeyUrl', webex);\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAMC,cAAc;EAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAC,OAAA,eAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAG,SAAAC,QAAOC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,KAAK;IAAA,IAAAC,cAAA,EAAAC,gBAAA,EAAAC,cAAA;IAAA,OAAAT,YAAA,CAAAD,OAAA,CAAAW,IAAA,WAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UACrDN,cAAc,GAAG,IAAAO,WAAG,EAACX,IAAI,EAAEC,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AA,OAAAC,SAAA;EAAA;AAAA,GAE1B;AAEM,IAAMS,kBAAkB,GAAAP,OAAA,CAAAO,kBAAA;EAAA,IAAAC,KAAA,OAAAvC,kBAAA,CAAAC,OAAA,eAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAG,SAAAqC,SAAON,IAAI,EAAE1B,KAAK;IAAA,OAAAN,YAAA,CAAAD,OAAA,CAAAW,IAAA,WAAA6B,SAAA;MAAA,kBAAAA,SAAA,CAAA3B,IAAA,GAAA2B,SAAA,CAAA1B,IAAA;QAAA;UAAA,KAC9CmB,IAAI,CAACQ,KAAK,CAACC,SAAS;YAAAF,SAAA,CAAA1B,IAAA;YAAA;UAAA;UAAA0B,SAAA,CAAA1B,IAAA;UAAA,OAChB6B,QAAA,CAAA3C,OAAA,CAAQ4C,GAAG,CACfX,IAAI,CAACQ,KAAK,CAACC,SAAS,CAACG,GAAG,CAAC,UAACC,QAAQ,EAAEC,KAAK,EAAK;YAC5C,OAAOlD,cAAc,CAACoC,IAAI,qBAAAe,MAAA,CAAqBD,KAAK,YAAS,kBAAkB,EAAExC,KAAK,CAAC;UACzF,CAAC,CACH,CAAC;QAAA;UAAAiC,SAAA,CAAA1B,IAAA;UAAA,OAGGjB,cAAc,CAACoC,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE1B,KAAK,CAAC;QAAA;QAAA;UAAA,OAAAiC,SAAA,CAAAlB,IAAA;MAAA;IAAA,GAAAiB,QAAA;EAAA,CACrE;EAAA,
|
|
1
|
+
{"version":3,"names":["_lodash","require","decryptInPlace","_ref","_asyncToGenerator2","default","_regenerator","mark","_callee","item","valuePath","keyPath","webex","encryptedValue","encryptionKeyUrl","decryptedValue","wrap","_context","prev","next","get","abrupt","internal","encryption","decryptText","sent","set","stop","_x","_x2","_x3","_x4","apply","arguments","decryptToolUse","exports","_ref2","_callee2","data","_context2","_x5","_x6","decryptCitedAnswer","_ref3","_callee3","_context3","value","citations","_promise","all","map","citation","index","concat","sources","source","_x7","_x8","decryptScheduleMeeting","_ref4","_callee4","_data$value","_data$value$results","meetingData","_context4","results","attendees","attendee","_x9","_x0","decryptMessage","_ref5","_callee5","_context5","_x1","_x10","decryptWorkspace","_ref6","_callee6","_context6","_x11","_x12","decryptAssistantActivity","_ref7","_callee7","_context7","_x13","_x14"],"sources":["utils.ts"],"sourcesContent":["import {get, set} from 'lodash';\n\nconst decryptInPlace = async (item, valuePath, keyPath, webex) => {\n const encryptedValue = get(item, valuePath);\n const encryptionKeyUrl = get(item, keyPath);\n\n if (!encryptedValue || !encryptionKeyUrl) {\n return;\n }\n\n const decryptedValue = await webex.internal.encryption.decryptText(\n encryptionKeyUrl,\n encryptedValue\n );\n\n set(item, valuePath, decryptedValue);\n};\n\nexport const decryptToolUse = async (data, webex) => {\n await decryptInPlace(data, 'value.value', 'encryptionKeyUrl', webex);\n};\n\nexport const decryptCitedAnswer = async (data, webex) => {\n if (data.value.citations) {\n await Promise.all(\n data.value.citations.map((citation, index) => {\n return decryptInPlace(data, `value.citations.${index}.name`, 'encryptionKeyUrl', webex);\n })\n );\n }\n\n if (data.value.sources) {\n await Promise.all(\n data.value.sources.map((source, index) => {\n return decryptInPlace(data, `value.sources.${index}.name`, 'encryptionKeyUrl', webex);\n })\n );\n }\n\n await decryptInPlace(data, 'value.value', 'encryptionKeyUrl', webex);\n};\nexport const decryptScheduleMeeting = async (data, webex) => {\n // Decrypt commentary in parameters\n await decryptInPlace(data, 'parameters.commentary', 'encryptionKeyUrl', webex);\n\n const meetingData = data.value?.results?.data;\n if (meetingData) {\n // Decrypt attendee emails\n if (meetingData.attendees) {\n await Promise.all(\n meetingData.attendees.map((attendee, index) => {\n return decryptInPlace(\n data,\n `value.results.data.attendees.${index}.email`,\n 'encryptionKeyUrl',\n webex\n );\n })\n );\n }\n\n // Decrypt other fields in the meeting data\n await Promise.all([\n decryptInPlace(data, 'value.results.data.title', 'encryptionKeyUrl', webex),\n decryptInPlace(data, 'value.results.data.inScopeReply', 'encryptionKeyUrl', webex),\n decryptInPlace(data, 'value.results.data.meetingLink', 'encryptionKeyUrl', webex),\n decryptInPlace(data, 'value.results.data.description', 'encryptionKeyUrl', webex),\n ]);\n }\n};\n\nexport const decryptMessage = async (data, webex) => {\n await decryptInPlace(data, 'value', 'encryptionKeyUrl', webex);\n};\n\nexport const decryptWorkspace = async (data, webex) => {\n await decryptInPlace(data, 'value.value', 'encryptionKeyUrl', webex);\n};\n\nexport const decryptAssistantActivity = async (data, webex) => {\n await decryptInPlace(data, 'content.value.message', 'encryptionKeyUrl', webex);\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAMC,cAAc;EAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAC,OAAA,eAAAC,YAAA,CAAAD,OAAA,CAAAE,IAAA,CAAG,SAAAC,QAAOC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,KAAK;IAAA,IAAAC,cAAA,EAAAC,gBAAA,EAAAC,cAAA;IAAA,OAAAT,YAAA,CAAAD,OAAA,CAAAW,IAAA,WAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UACrDN,cAAc,GAAG,IAAAO,WAAG,EAACX,IAAI,EAAEC,SAAS,CAAC;UACrCI,gBAAgB,GAAG,IAAAM,WAAG,EAACX,IAAI,EAAEE,OAAO,CAAC;UAAA,MAEvC,CAACE,cAAc,IAAI,CAACC,gBAAgB;YAAAG,QAAA,CAAAE,IAAA;YAAA;UAAA;UAAA,OAAAF,QAAA,CAAAI,MAAA;QAAA;UAAAJ,QAAA,CAAAE,IAAA;UAAA,OAIXP,KAAK,CAACU,QAAQ,CAACC,UAAU,CAACC,WAAW,CAChEV,gBAAgB,EAChBD,cACF,CAAC;QAAA;UAHKE,cAAc,GAAAE,QAAA,CAAAQ,IAAA;UAKpB,IAAAC,WAAG,EAACjB,IAAI,EAAEC,SAAS,EAAEK,cAAc,CAAC;QA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