@webex/internal-plugin-llm 3.0.0-beta.8 → 3.0.0-bnr.0

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/README.md CHANGED
@@ -22,14 +22,13 @@ npm install --save @webex/internal-plugin-llm
22
22
  ## Usage
23
23
 
24
24
  ```js
25
-
26
25
  import '@webex/internal-plugin-llm';
27
26
 
28
27
  import WebexCore from '@webex/webex-core';
29
28
 
30
29
  const webex = new WebexCore();
31
30
  // locusUrl is got from meeting.locusInfo.url;
32
- // datachannelUrl is got from meeting.locusInfo.info.datachannelUrl;
31
+ // datachannelUrl is got from meeting.locusInfo.info.datachannelUrl;
33
32
  webex.internal.llm.registerAndConnect(locusUrl, datachannelUrl);
34
33
 
35
34
  // Checks if LLM is connected
package/dist/constants.js CHANGED
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
-
9
7
  exports.LLM = void 0;
10
8
  // eslint-disable-next-line import/prefer-default-export
11
9
  var LLM = 'llm';
@@ -1 +1 @@
1
- {"version":3,"names":["LLM"],"sources":["constants.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const LLM = 'llm';\n"],"mappings":";;;;;;;;;AAAA;AACO,IAAMA,GAAG,GAAG,KAAZ"}
1
+ {"version":3,"names":["LLM"],"sources":["constants.ts"],"sourcesContent":["// eslint-disable-next-line import/prefer-default-export\nexport const LLM = 'llm';\n"],"mappings":";;;;;;;AAAA;AACO,IAAMA,GAAG,GAAG,KAAK;AAAC"}
package/dist/index.js CHANGED
@@ -1,32 +1,22 @@
1
1
  "use strict";
2
2
 
3
3
  var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
4
-
5
4
  var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
6
-
7
5
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
8
-
9
6
  var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
10
-
11
7
  _Object$defineProperty(exports, "__esModule", {
12
8
  value: true
13
9
  });
14
-
15
10
  _Object$defineProperty(exports, "default", {
16
11
  enumerable: true,
17
12
  get: function get() {
18
13
  return _llm.default;
19
14
  }
20
15
  });
21
-
22
16
  var WebexCore = _interopRequireWildcard(require("@webex/webex-core"));
23
-
24
17
  var _llm = _interopRequireWildcard(require("./llm"));
25
-
26
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
-
28
19
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
-
30
20
  WebexCore.registerInternalPlugin('llm', _llm.default, {
31
21
  config: _llm.config
32
22
  });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["WebexCore","registerInternalPlugin","LLMChannel","config"],"sources":["index.ts"],"sourcesContent":["import * as WebexCore from '@webex/webex-core';\nimport LLMChannel, {config} from './llm';\n\nWebexCore.registerInternalPlugin('llm', LLMChannel, {\n config,\n});\n\nexport {default} from './llm';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEAA,SAAS,CAACC,sBAAV,CAAiC,KAAjC,EAAwCC,YAAxC,EAAoD;EAClDC,MAAM,EAANA;AADkD,CAApD"}
1
+ {"version":3,"names":["WebexCore","registerInternalPlugin","LLMChannel","config"],"sources":["index.ts"],"sourcesContent":["import * as WebexCore from '@webex/webex-core';\nimport LLMChannel, {config} from './llm';\n\nWebexCore.registerInternalPlugin('llm', LLMChannel, {\n config,\n});\n\nexport {default} from './llm';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AAAyC;AAAA;AAEzCA,SAAS,CAACC,sBAAsB,CAAC,KAAK,EAAEC,YAAU,EAAE;EAClDC,MAAM,EAANA;AACF,CAAC,CAAC"}
@@ -0,0 +1,68 @@
1
+ declare interface ILLMChannel {
2
+ registerAndConnect: (locusUrl: string, datachannelUrl: string) => Promise<void>;
3
+ isConnected: () => boolean;
4
+ getBinding: () => string;
5
+ getLocusUrl: () => string;
6
+ disconnectLLM: () => Promise<void>;
7
+ }
8
+
9
+ /**
10
+ * LLMChannel to provide socket connections
11
+ */
12
+ declare class LLMChannel extends LLMChannel_base implements ILLMChannel {
13
+ namespace: string;
14
+ /**
15
+ * If the LLM plugin has been registered and listening
16
+ * @instance
17
+ * @type {Boolean}
18
+ * @public
19
+ */
20
+ private registered;
21
+ private webSocketUrl?;
22
+ private binding?;
23
+ private locusUrl?;
24
+ /**
25
+ * Initializes the LLM Plugin
26
+ * @constructor
27
+ * @public
28
+ */
29
+ constructor(...args: any[]);
30
+ /**
31
+ * Register to the websocket
32
+ * @param {string} llmSocketUrl
33
+ * @returns {Promise<void>}
34
+ */
35
+ private register;
36
+ /**
37
+ * Register and connect to the websocket
38
+ * @param {string} locusUrl
39
+ * @param {string} datachannelUrl
40
+ * @returns {Promise<void>}
41
+ */
42
+ registerAndConnect: (locusUrl: string, datachannelUrl: string) => Promise<void>;
43
+ /**
44
+ * Tells if LLM socket is connected
45
+ * @returns {boolean} isRegistered
46
+ */
47
+ isConnected: () => boolean;
48
+ /**
49
+ * Tells if LLM socket is connected
50
+ * @returns {bool} isRegistered
51
+ */
52
+ getBinding: () => string;
53
+ /**
54
+ * Get Locus URL for the connection
55
+ * @returns {string} locus Url
56
+ */
57
+ getLocusUrl: () => string;
58
+ /**
59
+ * Disconnects websocket connection
60
+ * @returns {Promise<void>}
61
+ */
62
+ disconnectLLM: () => Promise<void>;
63
+ }
64
+ export default LLMChannel;
65
+
66
+ declare const LLMChannel_base: any;
67
+
68
+ export { }
package/dist/llm.js CHANGED
@@ -1,41 +1,23 @@
1
1
  "use strict";
2
2
 
3
3
  var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
-
5
4
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
6
-
7
5
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
8
-
9
6
  _Object$defineProperty(exports, "__esModule", {
10
7
  value: true
11
8
  });
12
-
13
9
  exports.default = exports.config = void 0;
14
-
15
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
16
-
17
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
18
-
19
12
  var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
20
-
21
13
  var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
22
-
23
14
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
24
-
25
15
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
26
-
27
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
28
-
29
17
  var _internalPluginMercury = _interopRequireDefault(require("@webex/internal-plugin-mercury"));
30
-
31
- var _pluginMeetings = require("@webex/plugin-meetings");
32
-
33
18
  var _constants = require("./constants");
34
-
35
19
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
36
-
37
20
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
38
-
39
21
  var config = {
40
22
  llm: {
41
23
  /**
@@ -43,25 +25,21 @@ var config = {
43
25
  * @type {number}
44
26
  */
45
27
  pingInterval: process.env.MERCURY_PING_INTERVAL || 15000,
46
-
47
28
  /**
48
29
  * Milliseconds to wait for a pong before declaring the connection dead
49
30
  * @type {number}
50
31
  */
51
32
  pongTimeout: process.env.MERCURY_PONG_TIMEOUT || 14000,
52
-
53
33
  /**
54
34
  * Maximum milliseconds between connection attempts
55
35
  * @type {Number}
56
36
  */
57
37
  backoffTimeMax: process.env.MERCURY_BACKOFF_TIME_MAX || 32000,
58
-
59
38
  /**
60
39
  * Initial milliseconds between connection attempts
61
40
  * @type {Number}
62
41
  */
63
42
  backoffTimeReset: process.env.MERCURY_BACKOFF_TIME_RESET || 1000,
64
-
65
43
  /**
66
44
  * Milliseconds to wait for a close frame before declaring the socket dead and
67
45
  * discarding it
@@ -70,17 +48,14 @@ var config = {
70
48
  forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000
71
49
  }
72
50
  };
51
+
73
52
  /**
74
53
  * LLMChannel to provide socket connections
75
54
  */
76
-
77
55
  exports.config = config;
78
-
79
56
  var LLMChannel = /*#__PURE__*/function (_ref) {
80
57
  (0, _inherits2.default)(LLMChannel, _ref);
81
-
82
58
  var _super = _createSuper(LLMChannel);
83
-
84
59
  /**
85
60
  * If the LLM plugin has been registered and listening
86
61
  * @instance
@@ -95,13 +70,10 @@ var LLMChannel = /*#__PURE__*/function (_ref) {
95
70
  */
96
71
  function LLMChannel() {
97
72
  var _this;
98
-
99
73
  (0, _classCallCheck2.default)(this, LLMChannel);
100
-
101
74
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
102
75
  args[_key] = arguments[_key];
103
76
  }
104
-
105
77
  // eslint-disable-next-line constructor-super
106
78
  _this = _super.call.apply(_super, [this].concat(args));
107
79
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "namespace", _constants.LLM);
@@ -117,8 +89,7 @@ var LLMChannel = /*#__PURE__*/function (_ref) {
117
89
  _this.webSocketUrl = res.body.webSocketUrl;
118
90
  _this.binding = res.body.binding;
119
91
  }).catch(function (error) {
120
- _pluginMeetings.LoggerProxy.logger.error("Error connecting to websocket: ".concat(error));
121
-
92
+ _this.logger.error("Error connecting to websocket: ".concat(error));
122
93
  throw error;
123
94
  });
124
95
  });
@@ -126,7 +97,6 @@ var LLMChannel = /*#__PURE__*/function (_ref) {
126
97
  return _this.register(datachannelUrl).then(function () {
127
98
  if (!locusUrl || !datachannelUrl) return undefined;
128
99
  _this.locusUrl = locusUrl;
129
-
130
100
  _this.connect(_this.webSocketUrl).then(function () {
131
101
  _this.registered = true;
132
102
  });
@@ -152,15 +122,13 @@ var LLMChannel = /*#__PURE__*/function (_ref) {
152
122
  _this.registered = false;
153
123
  return _this;
154
124
  }
125
+
155
126
  /**
156
127
  * Register to the websocket
157
128
  * @param {string} llmSocketUrl
158
129
  * @returns {Promise<void>}
159
130
  */
160
-
161
-
162
131
  return (0, _createClass2.default)(LLMChannel);
163
132
  }(_internalPluginMercury.default);
164
-
165
133
  exports.default = LLMChannel;
166
134
  //# sourceMappingURL=llm.js.map
package/dist/llm.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["config","llm","pingInterval","process","env","MERCURY_PING_INTERVAL","pongTimeout","MERCURY_PONG_TIMEOUT","backoffTimeMax","MERCURY_BACKOFF_TIME_MAX","backoffTimeReset","MERCURY_BACKOFF_TIME_RESET","forceCloseDelay","MERCURY_FORCE_CLOSE_DELAY","LLMChannel","args","LLM","llmSocketUrl","request","method","url","then","res","webSocketUrl","body","binding","catch","error","LoggerProxy","logger","locusUrl","datachannelUrl","register","undefined","connect","registered","disconnect","Mercury"],"sources":["llm.ts"],"sourcesContent":["import Mercury from '@webex/internal-plugin-mercury';\nimport {LoggerProxy} from '@webex/plugin-meetings';\n\nimport {LLM} from './constants';\n// eslint-disable-next-line no-unused-vars\nimport {ILLMChannel} from './llm.types';\n\nexport const config = {\n llm: {\n /**\n * Milliseconds between pings sent up the socket\n * @type {number}\n */\n pingInterval: process.env.MERCURY_PING_INTERVAL || 15000,\n /**\n * Milliseconds to wait for a pong before declaring the connection dead\n * @type {number}\n */\n pongTimeout: process.env.MERCURY_PONG_TIMEOUT || 14000,\n /**\n * Maximum milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeMax: process.env.MERCURY_BACKOFF_TIME_MAX || 32000,\n /**\n * Initial milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeReset: process.env.MERCURY_BACKOFF_TIME_RESET || 1000,\n /**\n * Milliseconds to wait for a close frame before declaring the socket dead and\n * discarding it\n * @type {[type]}\n */\n forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000,\n },\n};\n\n/**\n * LLMChannel to provide socket connections\n */\nexport default class LLMChannel extends (Mercury as any) implements ILLMChannel {\n namespace = LLM;\n\n /**\n * If the LLM plugin has been registered and listening\n * @instance\n * @type {Boolean}\n * @public\n */\n private registered: boolean = false;\n\n private webSocketUrl?: string;\n\n private binding?: string;\n\n private locusUrl?: string;\n\n /**\n * Initializes the LLM Plugin\n * @constructor\n * @public\n */\n constructor(...args) {\n // eslint-disable-next-line constructor-super\n super(...args);\n\n this.registered = false;\n }\n\n /**\n * Register to the websocket\n * @param {string} llmSocketUrl\n * @returns {Promise<void>}\n */\n private register = (llmSocketUrl: string): Promise<void> =>\n this.request({\n method: 'POST',\n url: llmSocketUrl,\n })\n .then((res: {body: {webSocketUrl: string; binding: string}}) => {\n this.webSocketUrl = res.body.webSocketUrl;\n this.binding = res.body.binding;\n })\n .catch((error: any) => {\n LoggerProxy.logger.error(`Error connecting to websocket: ${error}`);\n throw error;\n });\n\n /**\n * Register and connect to the websocket\n * @param {string} locusUrl\n * @param {string} datachannelUrl\n * @returns {Promise<void>}\n */\n public registerAndConnect = (locusUrl: string, datachannelUrl: string): Promise<void> =>\n this.register(datachannelUrl).then(() => {\n if (!locusUrl || !datachannelUrl) return undefined;\n this.locusUrl = locusUrl;\n this.connect(this.webSocketUrl).then(() => {\n this.registered = true;\n });\n });\n\n /**\n * Tells if LLM socket is connected\n * @returns {boolean} isRegistered\n */\n public isConnected = (): boolean => this.registered;\n\n /**\n * Tells if LLM socket is connected\n * @returns {bool} isRegistered\n */\n public getBinding = (): string => this.binding;\n\n /**\n * Get Locus URL for the connection\n * @returns {string} locus Url\n */\n public getLocusUrl = (): string => this.locusUrl;\n\n /**\n * Disconnects websocket connection\n * @returns {Promise<void>}\n */\n public disconnectLLM = (): Promise<void> =>\n this.disconnect().then(() => {\n this.registered = false;\n this.locusUrl = undefined;\n this.binding = undefined;\n this.webSocketUrl = undefined;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAIO,IAAMA,MAAM,GAAG;EACpBC,GAAG,EAAE;IACH;AACJ;AACA;AACA;IACIC,YAAY,EAAEC,OAAO,CAACC,GAAR,CAAYC,qBAAZ,IAAqC,KALhD;;IAMH;AACJ;AACA;AACA;IACIC,WAAW,EAAEH,OAAO,CAACC,GAAR,CAAYG,oBAAZ,IAAoC,KAV9C;;IAWH;AACJ;AACA;AACA;IACIC,cAAc,EAAEL,OAAO,CAACC,GAAR,CAAYK,wBAAZ,IAAwC,KAfrD;;IAgBH;AACJ;AACA;AACA;IACIC,gBAAgB,EAAEP,OAAO,CAACC,GAAR,CAAYO,0BAAZ,IAA0C,IApBzD;;IAqBH;AACJ;AACA;AACA;AACA;IACIC,eAAe,EAAET,OAAO,CAACC,GAAR,CAAYS,yBAAZ,IAAyC;EA1BvD;AADe,CAAf;AA+BP;AACA;AACA;;;;IACqBC,U;;;;;EAGnB;AACF;AACA;AACA;AACA;AACA;;EASE;AACF;AACA;AACA;AACA;EACE,sBAAqB;IAAA;;IAAA;;IAAA,kCAANC,IAAM;MAANA,IAAM;IAAA;;IACnB;IACA,gDAASA,IAAT;IAFmB,wFArBTC,cAqBS;IAAA,yFAbS,KAaT;IAAA;IAAA;IAAA;IAAA,uFAYF,UAACC,YAAD;MAAA,OACjB,MAAKC,OAAL,CAAa;QACXC,MAAM,EAAE,MADG;QAEXC,GAAG,EAAEH;MAFM,CAAb,EAIGI,IAJH,CAIQ,UAACC,GAAD,EAA0D;QAC9D,MAAKC,YAAL,GAAoBD,GAAG,CAACE,IAAJ,CAASD,YAA7B;QACA,MAAKE,OAAL,GAAeH,GAAG,CAACE,IAAJ,CAASC,OAAxB;MACD,CAPH,EAQGC,KARH,CAQS,UAACC,KAAD,EAAgB;QACrBC,2BAAA,CAAYC,MAAZ,CAAmBF,KAAnB,0CAA2DA,KAA3D;;QACA,MAAMA,KAAN;MACD,CAXH,CADiB;IAAA,CAZE;IAAA,iGAgCO,UAACG,QAAD,EAAmBC,cAAnB;MAAA,OAC1B,MAAKC,QAAL,CAAcD,cAAd,EAA8BV,IAA9B,CAAmC,YAAM;QACvC,IAAI,CAACS,QAAD,IAAa,CAACC,cAAlB,EAAkC,OAAOE,SAAP;QAClC,MAAKH,QAAL,GAAgBA,QAAhB;;QACA,MAAKI,OAAL,CAAa,MAAKX,YAAlB,EAAgCF,IAAhC,CAAqC,YAAM;UACzC,MAAKc,UAAL,GAAkB,IAAlB;QACD,CAFD;MAGD,CAND,CAD0B;IAAA,CAhCP;IAAA,0FA6CA;MAAA,OAAe,MAAKA,UAApB;IAAA,CA7CA;IAAA,yFAmDD;MAAA,OAAc,MAAKV,OAAnB;IAAA,CAnDC;IAAA,0FAyDA;MAAA,OAAc,MAAKK,QAAnB;IAAA,CAzDA;IAAA,4FA+DE;MAAA,OACrB,MAAKM,UAAL,GAAkBf,IAAlB,CAAuB,YAAM;QAC3B,MAAKc,UAAL,GAAkB,KAAlB;QACA,MAAKL,QAAL,GAAgBG,SAAhB;QACA,MAAKR,OAAL,GAAeQ,SAAf;QACA,MAAKV,YAAL,GAAoBU,SAApB;MACD,CALD,CADqB;IAAA,CA/DF;IAInB,MAAKE,UAAL,GAAkB,KAAlB;IAJmB;EAKpB;EAED;AACF;AACA;AACA;AACA;;;;EAjCyCE,8B"}
1
+ {"version":3,"names":["config","llm","pingInterval","process","env","MERCURY_PING_INTERVAL","pongTimeout","MERCURY_PONG_TIMEOUT","backoffTimeMax","MERCURY_BACKOFF_TIME_MAX","backoffTimeReset","MERCURY_BACKOFF_TIME_RESET","forceCloseDelay","MERCURY_FORCE_CLOSE_DELAY","LLMChannel","args","LLM","llmSocketUrl","request","method","url","then","res","webSocketUrl","body","binding","catch","error","logger","locusUrl","datachannelUrl","register","undefined","connect","registered","disconnect","Mercury"],"sources":["llm.ts"],"sourcesContent":["/* eslint-disable consistent-return */\n\nimport Mercury from '@webex/internal-plugin-mercury';\n\nimport {LLM} from './constants';\n// eslint-disable-next-line no-unused-vars\nimport {ILLMChannel} from './llm.types';\n\nexport const config = {\n llm: {\n /**\n * Milliseconds between pings sent up the socket\n * @type {number}\n */\n pingInterval: process.env.MERCURY_PING_INTERVAL || 15000,\n /**\n * Milliseconds to wait for a pong before declaring the connection dead\n * @type {number}\n */\n pongTimeout: process.env.MERCURY_PONG_TIMEOUT || 14000,\n /**\n * Maximum milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeMax: process.env.MERCURY_BACKOFF_TIME_MAX || 32000,\n /**\n * Initial milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeReset: process.env.MERCURY_BACKOFF_TIME_RESET || 1000,\n /**\n * Milliseconds to wait for a close frame before declaring the socket dead and\n * discarding it\n * @type {[type]}\n */\n forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000,\n },\n};\n\n/**\n * LLMChannel to provide socket connections\n */\nexport default class LLMChannel extends (Mercury as any) implements ILLMChannel {\n namespace = LLM;\n\n /**\n * If the LLM plugin has been registered and listening\n * @instance\n * @type {Boolean}\n * @public\n */\n private registered = false;\n\n private webSocketUrl?: string;\n\n private binding?: string;\n\n private locusUrl?: string;\n\n /**\n * Initializes the LLM Plugin\n * @constructor\n * @public\n */\n constructor(...args) {\n // eslint-disable-next-line constructor-super\n super(...args);\n\n this.registered = false;\n }\n\n /**\n * Register to the websocket\n * @param {string} llmSocketUrl\n * @returns {Promise<void>}\n */\n private register = (llmSocketUrl: string): Promise<void> =>\n this.request({\n method: 'POST',\n url: llmSocketUrl,\n })\n .then((res: {body: {webSocketUrl: string; binding: string}}) => {\n this.webSocketUrl = res.body.webSocketUrl;\n this.binding = res.body.binding;\n })\n .catch((error: any) => {\n this.logger.error(`Error connecting to websocket: ${error}`);\n throw error;\n });\n\n /**\n * Register and connect to the websocket\n * @param {string} locusUrl\n * @param {string} datachannelUrl\n * @returns {Promise<void>}\n */\n public registerAndConnect = (locusUrl: string, datachannelUrl: string): Promise<void> =>\n this.register(datachannelUrl).then(() => {\n if (!locusUrl || !datachannelUrl) return undefined;\n this.locusUrl = locusUrl;\n this.connect(this.webSocketUrl).then(() => {\n this.registered = true;\n });\n });\n\n /**\n * Tells if LLM socket is connected\n * @returns {boolean} isRegistered\n */\n public isConnected = (): boolean => this.registered;\n\n /**\n * Tells if LLM socket is connected\n * @returns {bool} isRegistered\n */\n public getBinding = (): string => this.binding;\n\n /**\n * Get Locus URL for the connection\n * @returns {string} locus Url\n */\n public getLocusUrl = (): string => this.locusUrl;\n\n /**\n * Disconnects websocket connection\n * @returns {Promise<void>}\n */\n public disconnectLLM = (): Promise<void> =>\n this.disconnect().then(() => {\n this.registered = false;\n this.locusUrl = undefined;\n this.binding = undefined;\n this.webSocketUrl = undefined;\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA;AAEA;AAAgC;AAAA;AAIzB,IAAMA,MAAM,GAAG;EACpBC,GAAG,EAAE;IACH;AACJ;AACA;AACA;IACIC,YAAY,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAI,KAAK;IACxD;AACJ;AACA;AACA;IACIC,WAAW,EAAEH,OAAO,CAACC,GAAG,CAACG,oBAAoB,IAAI,KAAK;IACtD;AACJ;AACA;AACA;IACIC,cAAc,EAAEL,OAAO,CAACC,GAAG,CAACK,wBAAwB,IAAI,KAAK;IAC7D;AACJ;AACA;AACA;IACIC,gBAAgB,EAAEP,OAAO,CAACC,GAAG,CAACO,0BAA0B,IAAI,IAAI;IAChE;AACJ;AACA;AACA;AACA;IACIC,eAAe,EAAET,OAAO,CAACC,GAAG,CAACS,yBAAyB,IAAI;EAC5D;AACF,CAAC;;AAED;AACA;AACA;AAFA;AAAA,IAGqBC,UAAU;EAAA;EAAA;EAG7B;AACF;AACA;AACA;AACA;AACA;;EASE;AACF;AACA;AACA;AACA;EACE,sBAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB;IACA,gDAASA,IAAI;IAAE,wFAvBLC,cAAG;IAAA,yFAQM,KAAK;IAAA;IAAA;IAAA;IAAA,uFAyBP,UAACC,YAAoB;MAAA,OACtC,MAAKC,OAAO,CAAC;QACXC,MAAM,EAAE,MAAM;QACdC,GAAG,EAAEH;MACP,CAAC,CAAC,CACCI,IAAI,CAAC,UAACC,GAAoD,EAAK;QAC9D,MAAKC,YAAY,GAAGD,GAAG,CAACE,IAAI,CAACD,YAAY;QACzC,MAAKE,OAAO,GAAGH,GAAG,CAACE,IAAI,CAACC,OAAO;MACjC,CAAC,CAAC,CACDC,KAAK,CAAC,UAACC,KAAU,EAAK;QACrB,MAAKC,MAAM,CAACD,KAAK,0CAAmCA,KAAK,EAAG;QAC5D,MAAMA,KAAK;MACb,CAAC,CAAC;IAAA;IAAA,iGAQsB,UAACE,QAAgB,EAAEC,cAAsB;MAAA,OACnE,MAAKC,QAAQ,CAACD,cAAc,CAAC,CAACT,IAAI,CAAC,YAAM;QACvC,IAAI,CAACQ,QAAQ,IAAI,CAACC,cAAc,EAAE,OAAOE,SAAS;QAClD,MAAKH,QAAQ,GAAGA,QAAQ;QACxB,MAAKI,OAAO,CAAC,MAAKV,YAAY,CAAC,CAACF,IAAI,CAAC,YAAM;UACzC,MAAKa,UAAU,GAAG,IAAI;QACxB,CAAC,CAAC;MACJ,CAAC,CAAC;IAAA;IAAA,0FAMiB;MAAA,OAAe,MAAKA,UAAU;IAAA;IAAA,yFAM/B;MAAA,OAAc,MAAKT,OAAO;IAAA;IAAA,0FAMzB;MAAA,OAAc,MAAKI,QAAQ;IAAA;IAAA,4FAMzB;MAAA,OACrB,MAAKM,UAAU,EAAE,CAACd,IAAI,CAAC,YAAM;QAC3B,MAAKa,UAAU,GAAG,KAAK;QACvB,MAAKL,QAAQ,GAAGG,SAAS;QACzB,MAAKP,OAAO,GAAGO,SAAS;QACxB,MAAKT,YAAY,GAAGS,SAAS;MAC/B,CAAC,CAAC;IAAA;IAjEF,MAAKE,UAAU,GAAG,KAAK;IAAC;EAC1B;;EAEA;AACF;AACA;AACA;AACA;EAJE;AAAA,EA7BuCE,8BAAO;AAAA"}
package/dist/llm.types.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
-
5
4
  _Object$defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["llm.types.ts"],"sourcesContent":["\ninterface ILLMChannel{\n registerAndConnect: (locusUrl:string, datachannelUrl:string) => Promise<void>;\n isConnected: () => boolean;\n getBinding: () => string;\n getLocusUrl: () => string;\n disconnectLLM: () => Promise<void>;\n}\n// eslint-disable-next-line import/prefer-default-export\nexport {ILLMChannel};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["llm.types.ts"],"sourcesContent":["interface ILLMChannel {\n registerAndConnect: (locusUrl: string, datachannelUrl: string) => Promise<void>;\n isConnected: () => boolean;\n getBinding: () => string;\n getLocusUrl: () => string;\n disconnectLLM: () => Promise<void>;\n}\n// eslint-disable-next-line import/prefer-default-export\nexport type {ILLMChannel};\n"],"mappings":""}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.34.4"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1 @@
1
+ export declare const LLM = "llm";
@@ -0,0 +1 @@
1
+ export { default } from './llm';
@@ -0,0 +1,88 @@
1
+ import { ILLMChannel } from './llm.types';
2
+ export declare const config: {
3
+ llm: {
4
+ /**
5
+ * Milliseconds between pings sent up the socket
6
+ * @type {number}
7
+ */
8
+ pingInterval: string | number;
9
+ /**
10
+ * Milliseconds to wait for a pong before declaring the connection dead
11
+ * @type {number}
12
+ */
13
+ pongTimeout: string | number;
14
+ /**
15
+ * Maximum milliseconds between connection attempts
16
+ * @type {Number}
17
+ */
18
+ backoffTimeMax: string | number;
19
+ /**
20
+ * Initial milliseconds between connection attempts
21
+ * @type {Number}
22
+ */
23
+ backoffTimeReset: string | number;
24
+ /**
25
+ * Milliseconds to wait for a close frame before declaring the socket dead and
26
+ * discarding it
27
+ * @type {[type]}
28
+ */
29
+ forceCloseDelay: string | number;
30
+ };
31
+ };
32
+ declare const LLMChannel_base: any;
33
+ /**
34
+ * LLMChannel to provide socket connections
35
+ */
36
+ export default class LLMChannel extends LLMChannel_base implements ILLMChannel {
37
+ namespace: string;
38
+ /**
39
+ * If the LLM plugin has been registered and listening
40
+ * @instance
41
+ * @type {Boolean}
42
+ * @public
43
+ */
44
+ private registered;
45
+ private webSocketUrl?;
46
+ private binding?;
47
+ private locusUrl?;
48
+ /**
49
+ * Initializes the LLM Plugin
50
+ * @constructor
51
+ * @public
52
+ */
53
+ constructor(...args: any[]);
54
+ /**
55
+ * Register to the websocket
56
+ * @param {string} llmSocketUrl
57
+ * @returns {Promise<void>}
58
+ */
59
+ private register;
60
+ /**
61
+ * Register and connect to the websocket
62
+ * @param {string} locusUrl
63
+ * @param {string} datachannelUrl
64
+ * @returns {Promise<void>}
65
+ */
66
+ registerAndConnect: (locusUrl: string, datachannelUrl: string) => Promise<void>;
67
+ /**
68
+ * Tells if LLM socket is connected
69
+ * @returns {boolean} isRegistered
70
+ */
71
+ isConnected: () => boolean;
72
+ /**
73
+ * Tells if LLM socket is connected
74
+ * @returns {bool} isRegistered
75
+ */
76
+ getBinding: () => string;
77
+ /**
78
+ * Get Locus URL for the connection
79
+ * @returns {string} locus Url
80
+ */
81
+ getLocusUrl: () => string;
82
+ /**
83
+ * Disconnects websocket connection
84
+ * @returns {Promise<void>}
85
+ */
86
+ disconnectLLM: () => Promise<void>;
87
+ }
88
+ export {};
@@ -0,0 +1,8 @@
1
+ interface ILLMChannel {
2
+ registerAndConnect: (locusUrl: string, datachannelUrl: string) => Promise<void>;
3
+ isConnected: () => boolean;
4
+ getBinding: () => string;
5
+ getLocusUrl: () => string;
6
+ disconnectLLM: () => Promise<void>;
7
+ }
8
+ export type { ILLMChannel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/internal-plugin-llm",
3
- "version": "3.0.0-beta.8",
3
+ "version": "3.0.0-bnr.0",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "main": "dist/index.js",
@@ -14,8 +14,8 @@
14
14
  "node": ">=16"
15
15
  },
16
16
  "dependencies": {
17
- "@webex/internal-plugin-llm": "3.0.0-beta.8",
18
- "@webex/internal-plugin-mercury": "3.0.0-beta.8"
17
+ "@webex/internal-plugin-llm": "3.0.0-bnr.0",
18
+ "@webex/internal-plugin-mercury": "3.0.0-bnr.0"
19
19
  },
20
20
  "browserify": {
21
21
  "transform": [
@@ -24,8 +24,8 @@
24
24
  ]
25
25
  },
26
26
  "devDependencies": {
27
- "@webex/test-helper-chai": "3.0.0-beta.8",
28
- "@webex/test-helper-mock-webex": "3.0.0-beta.8",
27
+ "@webex/test-helper-chai": "3.0.0-bnr.0",
28
+ "@webex/test-helper-mock-webex": "3.0.0-bnr.0",
29
29
  "sinon": "^9.2.4"
30
30
  }
31
31
  }
package/src/llm.ts CHANGED
@@ -1,5 +1,6 @@
1
+ /* eslint-disable consistent-return */
2
+
1
3
  import Mercury from '@webex/internal-plugin-mercury';
2
- import {LoggerProxy} from '@webex/plugin-meetings';
3
4
 
4
5
  import {LLM} from './constants';
5
6
  // eslint-disable-next-line no-unused-vars
@@ -48,7 +49,7 @@ export default class LLMChannel extends (Mercury as any) implements ILLMChannel
48
49
  * @type {Boolean}
49
50
  * @public
50
51
  */
51
- private registered: boolean = false;
52
+ private registered = false;
52
53
 
53
54
  private webSocketUrl?: string;
54
55
 
@@ -83,7 +84,7 @@ export default class LLMChannel extends (Mercury as any) implements ILLMChannel
83
84
  this.binding = res.body.binding;
84
85
  })
85
86
  .catch((error: any) => {
86
- LoggerProxy.logger.error(`Error connecting to websocket: ${error}`);
87
+ this.logger.error(`Error connecting to websocket: ${error}`);
87
88
  throw error;
88
89
  });
89
90
 
package/src/llm.types.ts CHANGED
@@ -1,10 +1,9 @@
1
-
2
- interface ILLMChannel{
3
- registerAndConnect: (locusUrl:string, datachannelUrl:string) => Promise<void>;
4
- isConnected: () => boolean;
5
- getBinding: () => string;
6
- getLocusUrl: () => string;
7
- disconnectLLM: () => Promise<void>;
1
+ interface ILLMChannel {
2
+ registerAndConnect: (locusUrl: string, datachannelUrl: string) => Promise<void>;
3
+ isConnected: () => boolean;
4
+ getBinding: () => string;
5
+ getLocusUrl: () => string;
6
+ disconnectLLM: () => Promise<void>;
8
7
  }
9
8
  // eslint-disable-next-line import/prefer-default-export
10
- export {ILLMChannel};
9
+ export type {ILLMChannel};