uneeq-js 3.0.16-preview.8 → 3.0.16-preview.9
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/index.js +33 -11
- package/dist/session.d.ts +0 -1
- package/dist/uneeq.d.ts +4 -1
- package/dist/webrtc-data-channel/DataChannelActionType.d.ts +3 -1
- package/dist/webrtc-data-channel/SpeakRequest.d.ts +7 -0
- package/dist/webrtc-data-channel/messages/CameraAnchor.d.ts +12 -0
- package/dist/webrtc-data-channel/{chat-prompt.d.ts → messages/ChatPrompt.d.ts} +2 -2
- package/dist/webrtc-data-channel/messages/SpeakRequest.d.ts +7 -0
- package/package.json +1 -1
- package/dist/lib/logConfig.d.ts +0 -5
- package/dist/types/DataChannelMessage.d.ts +0 -5
- package/dist/webrtc-data-channel/data-channel-action-type.d.ts +0 -3
- package/dist/webrtc-data-channel/data-channel-action.d.ts +0 -5
- package/dist/webrtc-data-channel/data-channel-message.d.ts +0 -4
package/dist/index.js
CHANGED
|
@@ -409,7 +409,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
409
409
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
410
410
|
|
|
411
411
|
"use strict";
|
|
412
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Session: () => (/* binding */ Session)\n/* harmony export */ });\n/* harmony import */ var _signaling__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./signaling */ \"./src/signaling.ts\");\n/* harmony import */ var _types_UneeqMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types/UneeqMessages */ \"./src/types/UneeqMessages.ts\");\n/* harmony import */ var _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types/SignalingEvents */ \"./src/types/SignalingEvents.ts\");\n/* harmony import */ var _speech_recognition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./speech-recognition */ \"./src/speech-recognition.ts\");\n/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/dist/esm5/internal/Subject.js\");\n/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/dist/esm5/internal/operators/filter.js\");\n/* harmony import */ var _lib_api_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/api/api */ \"./src/lib/api/api.ts\");\n/* harmony import */ var
|
|
412
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Session: () => (/* binding */ Session)\n/* harmony export */ });\n/* harmony import */ var _signaling__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./signaling */ \"./src/signaling.ts\");\n/* harmony import */ var _types_UneeqMessages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types/UneeqMessages */ \"./src/types/UneeqMessages.ts\");\n/* harmony import */ var _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types/SignalingEvents */ \"./src/types/SignalingEvents.ts\");\n/* harmony import */ var _speech_recognition__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./speech-recognition */ \"./src/speech-recognition.ts\");\n/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/dist/esm5/internal/Subject.js\");\n/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/dist/esm5/internal/operators/filter.js\");\n/* harmony import */ var _lib_api_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/api/api */ \"./src/lib/api/api.ts\");\n/* harmony import */ var _webrtc_data_channel_messages_ChatPrompt__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./webrtc-data-channel/messages/ChatPrompt */ \"./src/webrtc-data-channel/messages/ChatPrompt.ts\");\n\n\n\n\n\n\n\nclass Session {\n constructor(config) {\n this.config = config;\n this.messages = new rxjs__WEBPACK_IMPORTED_MODULE_6__.Subject();\n }\n createSession() {\n _lib_api_api__WEBPACK_IMPORTED_MODULE_4__.API.createSession(this.config)\n .then(data => { this.handleCreateSession(data); })\n .catch((err) => {\n console.error('Could not start session:', err);\n });\n }\n handleCreateSession(sessionData) {\n this.id = sessionData.sessionId;\n this.jwt = sessionData.token;\n console.log('Uneeq session created with id: ' + this.id);\n // setup a socket to session-service\n const socketUrl = (this.config.connectionUrl + `/v1/ws/session?sessionId=${this.id}`).replace('http://', 'ws://').replace('https://', 'wss://');\n this.signaling = new _signaling__WEBPACK_IMPORTED_MODULE_0__.Signaling(socketUrl, this.config.videoContainerElement);\n this.signaling.messages.subscribe((e) => { this.signalingEventHandler(e); });\n }\n signalingEventHandler(e) {\n var _a, _b, _c, _d;\n switch (e.type) {\n case _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_2__.SignalingEventType.VideoInitialised: {\n console.log('Session: video is initialised', this.signaling);\n (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.messageHandler) === null || _b === void 0 ? void 0 : _b.call(_a, new _types_UneeqMessages__WEBPACK_IMPORTED_MODULE_1__.SessionLiveMessage());\n (_c = this.signaling) === null || _c === void 0 ? void 0 : _c.socketSend({\n type: 'client-video-initialised',\n value: 'The web clients video connection has been established.'\n });\n if (this.config.enableMicrophone) {\n (_d = this.speechRec) === null || _d === void 0 ? void 0 : _d.setEnableMicrophone(true);\n }\n break;\n }\n case _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_2__.SignalingEventType.SesssionStarted: {\n // no op / to do\n break;\n }\n default:\n }\n }\n initSpeechRecognition(jwt) {\n var _a;\n console.log('Initialising speech recognition with jwt: ', jwt);\n this.speechRec = new _speech_recognition__WEBPACK_IMPORTED_MODULE_3__.SpeechRecognition({\n apiUrl: this.config.speechRecognitionUrl,\n hintPhrases: (_a = this.config.speechRecognitionHintPhrases) !== null && _a !== void 0 ? _a : '',\n jwtToken: jwt,\n locales: 'en-US',\n messages: this.messages,\n sessionId: this.id,\n assetBasePath: this.config.assetBasePath\n });\n this.messages.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_7__.filter)((uneeqMessage) => uneeqMessage.uneeqMessageType === _types_UneeqMessages__WEBPACK_IMPORTED_MODULE_1__.UneeqMessageType.SpeechTranscription)).subscribe((uneeqMessage) => {\n var _a;\n const msg = uneeqMessage;\n if (msg.speechTranscription.final) {\n (_a = this.signaling) === null || _a === void 0 ? void 0 : _a.dataSend(new _webrtc_data_channel_messages_ChatPrompt__WEBPACK_IMPORTED_MODULE_5__.ChatPrompt(msg.speechTranscription.transcript));\n }\n });\n this.speechRec.setEnableMicrophone(true);\n }\n}\n\n\n//# sourceURL=webpack://Uneeq/./src/session.ts?");
|
|
413
413
|
|
|
414
414
|
/***/ }),
|
|
415
415
|
|
|
@@ -420,7 +420,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
420
420
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
421
421
|
|
|
422
422
|
"use strict";
|
|
423
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Signaling: () => (/* binding */ Signaling)\n/* harmony export */ });\n/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/dist/esm5/internal/ReplaySubject.js\");\n/* harmony import */ var _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @epicgames-ps/lib-pixelstreamingfrontend-ue5.3 */ \"./node_modules/@epicgames-ps/lib-pixelstreamingfrontend-ue5.3/dist/lib-pixelstreamingfrontend.esm.js\");\n/* harmony import */ var _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types/SignalingEvents */ \"./src/types/SignalingEvents.ts\");\n\n\n\nclass Signaling {\n constructor(connectionUrl, videoContainerElement) {\n this.connectionUrl = connectionUrl;\n this.videoContainerElement = videoContainerElement;\n this.messages = new rxjs__WEBPACK_IMPORTED_MODULE_1__.ReplaySubject();\n this.init();\n }\n init() {\n console.log('Connecting to Signaling Server: ' + this.connectionUrl);\n if (!this.videoContainerElement) {\n // Create a container element and add it to the page.\n this.videoContainerElement = document.createElement('div');\n this.videoContainerElement.id = 'uneeqVideoContainerElement';\n document.body.appendChild(this.videoContainerElement);\n }\n // Create a config object\n const config = new _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.Config({\n initialSettings: {\n AutoConnect: false,\n ss: this.connectionUrl,\n StartVideoMuted: false,\n HoveringMouse: false,\n WaitForStreamer: true,\n MaxReconnectAttempts: 1,\n OfferToReceive: true\n }\n });\n // Create a Native DOM delegate instance that implements the Delegate interface class\n this.stream = new _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.PixelStreaming(config, {\n videoElementParent: this.videoContainerElement\n });\n // Create a buildSignalingUrl method to handle both OfferToReceive (BrowserSendOffer) and custom query params\n const buildSignalingUrl = function () {\n let signallingServerUrl = config.getTextSettingValue(_epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.TextParameters.SignallingServerUrl);\n if (config.isFlagEnabled(_epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.Flags.BrowserSendOffer)) {\n signallingServerUrl += (signallingServerUrl.includes('?') ? '&' : '?') + _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.Flags.BrowserSendOffer + '=true';\n }\n return signallingServerUrl;\n };\n // Override PixelStreaming's WebRtcPlayerController's buildSignalingUrl with our own\n this.stream.setSignallingUrlBuilder(buildSignalingUrl);\n // Connect to the signaling server now that url is ready\n this.stream.connect();\n this.addHandlers();\n // mock that we got a session jwt\n this.messages.next(new _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_0__.SessionStarted('fake-jwt'));\n }\n addHandlers() {\n var _a, _b;\n // Add a custom handler for messages received on socket\n (_a = this.stream) === null || _a === void 0 ? void 0 : _a.webSocketController.webSocket.addEventListener('message', (e) => { this.customWebSocketMessageHandler(e); });\n // Add handler for VideoInitialized message\n (_b = this.stream) === null || _b === void 0 ? void 0 : _b.addEventListener('videoInitialized', () => {\n this.messages.next(new _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_0__.VideoInitialised());\n document.body.classList.add('uneeq-streaming-live');\n });\n }\n customWebSocketMessageHandler(e) {\n console.log('Signaling: Got socket message', e);\n }\n socketSend(msg) {\n var _a, _b;\n console.log('Signaling: Sending socket message', msg);\n (_b = (_a = this.stream) === null || _a === void 0 ? void 0 : _a.webSocketController) === null || _b === void 0 ? void 0 : _b.webSocket.send(JSON.stringify(msg));\n }\n dataSend(data) {\n var _a;\n console.log('Signaling: Sending data channel message', data);\n (_a = this.stream) === null || _a === void 0 ? void 0 : _a.emitUIInteraction(
|
|
423
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Signaling: () => (/* binding */ Signaling)\n/* harmony export */ });\n/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ \"./node_modules/rxjs/dist/esm5/internal/ReplaySubject.js\");\n/* harmony import */ var _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @epicgames-ps/lib-pixelstreamingfrontend-ue5.3 */ \"./node_modules/@epicgames-ps/lib-pixelstreamingfrontend-ue5.3/dist/lib-pixelstreamingfrontend.esm.js\");\n/* harmony import */ var _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types/SignalingEvents */ \"./src/types/SignalingEvents.ts\");\n\n\n\nclass Signaling {\n constructor(connectionUrl, videoContainerElement) {\n this.connectionUrl = connectionUrl;\n this.videoContainerElement = videoContainerElement;\n this.messages = new rxjs__WEBPACK_IMPORTED_MODULE_1__.ReplaySubject();\n this.init();\n }\n init() {\n console.log('Connecting to Signaling Server: ' + this.connectionUrl);\n if (!this.videoContainerElement) {\n // Create a container element and add it to the page.\n this.videoContainerElement = document.createElement('div');\n this.videoContainerElement.id = 'uneeqVideoContainerElement';\n document.body.appendChild(this.videoContainerElement);\n }\n // Create a config object\n const config = new _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.Config({\n initialSettings: {\n AutoConnect: false,\n ss: this.connectionUrl,\n StartVideoMuted: false,\n HoveringMouse: false,\n WaitForStreamer: true,\n MaxReconnectAttempts: 1,\n OfferToReceive: true\n }\n });\n // Create a Native DOM delegate instance that implements the Delegate interface class\n this.stream = new _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.PixelStreaming(config, {\n videoElementParent: this.videoContainerElement\n });\n // Create a buildSignalingUrl method to handle both OfferToReceive (BrowserSendOffer) and custom query params\n const buildSignalingUrl = function () {\n let signallingServerUrl = config.getTextSettingValue(_epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.TextParameters.SignallingServerUrl);\n if (config.isFlagEnabled(_epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.Flags.BrowserSendOffer)) {\n signallingServerUrl += (signallingServerUrl.includes('?') ? '&' : '?') + _epicgames_ps_lib_pixelstreamingfrontend_ue5_3__WEBPACK_IMPORTED_MODULE_2__.Flags.BrowserSendOffer + '=true';\n }\n return signallingServerUrl;\n };\n // Override PixelStreaming's WebRtcPlayerController's buildSignalingUrl with our own\n this.stream.setSignallingUrlBuilder(buildSignalingUrl);\n // Connect to the signaling server now that url is ready\n this.stream.connect();\n this.addHandlers();\n // mock that we got a session jwt\n this.messages.next(new _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_0__.SessionStarted('fake-jwt'));\n }\n addHandlers() {\n var _a, _b;\n // Add a custom handler for messages received on socket\n (_a = this.stream) === null || _a === void 0 ? void 0 : _a.webSocketController.webSocket.addEventListener('message', (e) => { this.customWebSocketMessageHandler(e); });\n // Add handler for VideoInitialized message\n (_b = this.stream) === null || _b === void 0 ? void 0 : _b.addEventListener('videoInitialized', () => {\n this.messages.next(new _types_SignalingEvents__WEBPACK_IMPORTED_MODULE_0__.VideoInitialised());\n document.body.classList.add('uneeq-streaming-live');\n });\n }\n customWebSocketMessageHandler(e) {\n console.log('Signaling: Got socket message', e);\n }\n socketSend(msg) {\n var _a, _b;\n console.log('Signaling: Sending socket message', msg);\n (_b = (_a = this.stream) === null || _a === void 0 ? void 0 : _a.webSocketController) === null || _b === void 0 ? void 0 : _b.webSocket.send(JSON.stringify(msg));\n }\n dataSend(data) {\n var _a;\n console.log('Signaling: Sending data channel message', JSON.stringify(data));\n (_a = this.stream) === null || _a === void 0 ? void 0 : _a.emitUIInteraction(data);\n }\n}\n\n\n//# sourceURL=webpack://Uneeq/./src/signaling.ts?");
|
|
424
424
|
|
|
425
425
|
/***/ }),
|
|
426
426
|
|
|
@@ -486,29 +486,51 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
486
486
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
487
487
|
|
|
488
488
|
"use strict";
|
|
489
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Uneeq: () => (/* binding */ Uneeq)\n/* harmony export */ });\n/* harmony import */ var _lib_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/logger */ \"./src/lib/logger.ts\");\n/* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./session */ \"./src/session.ts\");\n\n\nclass Uneeq {\n constructor(config) {\n var _a;\n this.config = config;\n _lib_logger__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setLevel((_a = config.logLevel) !== null && _a !== void 0 ? _a : 'info');\n }\n init() {\n _lib_logger__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('Initializing Uneeq with config:', this.config);\n this.session = new _session__WEBPACK_IMPORTED_MODULE_1__.Session(this.config);\n this.session.createSession();\n }\n sendChatPrompt(
|
|
489
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Uneeq: () => (/* binding */ Uneeq)\n/* harmony export */ });\n/* harmony import */ var _lib_logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/logger */ \"./src/lib/logger.ts\");\n/* harmony import */ var _session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./session */ \"./src/session.ts\");\n/* harmony import */ var _webrtc_data_channel_messages_ChatPrompt__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./webrtc-data-channel/messages/ChatPrompt */ \"./src/webrtc-data-channel/messages/ChatPrompt.ts\");\n/* harmony import */ var _webrtc_data_channel_messages_SpeakRequest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./webrtc-data-channel/messages/SpeakRequest */ \"./src/webrtc-data-channel/messages/SpeakRequest.ts\");\n/* harmony import */ var _webrtc_data_channel_messages_CameraAnchor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./webrtc-data-channel/messages/CameraAnchor */ \"./src/webrtc-data-channel/messages/CameraAnchor.ts\");\n\n\n\n\n\nclass Uneeq {\n constructor(config) {\n var _a;\n this.config = config;\n _lib_logger__WEBPACK_IMPORTED_MODULE_0__[\"default\"].setLevel((_a = config.logLevel) !== null && _a !== void 0 ? _a : 'info');\n }\n init() {\n _lib_logger__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('Initializing Uneeq with config:', this.config);\n this.session = new _session__WEBPACK_IMPORTED_MODULE_1__.Session(this.config);\n this.session.createSession();\n }\n sendChatPrompt(chatPrompt) {\n var _a, _b;\n (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.signaling) === null || _b === void 0 ? void 0 : _b.dataSend(new _webrtc_data_channel_messages_ChatPrompt__WEBPACK_IMPORTED_MODULE_2__.ChatPrompt(chatPrompt));\n }\n sendSpeak(speech) {\n var _a, _b;\n (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.signaling) === null || _b === void 0 ? void 0 : _b.dataSend(new _webrtc_data_channel_messages_SpeakRequest__WEBPACK_IMPORTED_MODULE_3__.Speak(speech));\n }\n sendCameraAnchor(position) {\n var _a, _b;\n (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.signaling) === null || _b === void 0 ? void 0 : _b.dataSend(new _webrtc_data_channel_messages_CameraAnchor__WEBPACK_IMPORTED_MODULE_4__.CameraAnchor(position));\n }\n endSession() {\n // TODO\n }\n unmuteDigitalHuman() {\n // TODO\n }\n stopSpeaking() {\n // TODO\n }\n setCustomChatMetadata() {\n // TODO\n }\n enableMicrophone(enable = true) {\n var _a, _b;\n (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.speechRec) === null || _b === void 0 ? void 0 : _b.setEnableMicrophone(enable);\n }\n pauseSpeechRecognition() {\n var _a, _b;\n (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.speechRec) === null || _b === void 0 ? void 0 : _b.pause();\n }\n resumeSpeechRecognition() {\n var _a, _b;\n (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.speechRec) === null || _b === void 0 ? void 0 : _b.resume();\n }\n}\n\n\n//# sourceURL=webpack://Uneeq/./src/uneeq.ts?");
|
|
490
490
|
|
|
491
491
|
/***/ }),
|
|
492
492
|
|
|
493
|
-
/***/ "./src/webrtc-data-channel/
|
|
494
|
-
|
|
495
|
-
!*** ./src/webrtc-data-channel/
|
|
496
|
-
|
|
493
|
+
/***/ "./src/webrtc-data-channel/DataChannelActionType.ts":
|
|
494
|
+
/*!**********************************************************!*\
|
|
495
|
+
!*** ./src/webrtc-data-channel/DataChannelActionType.ts ***!
|
|
496
|
+
\**********************************************************/
|
|
497
497
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
498
498
|
|
|
499
499
|
"use strict";
|
|
500
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */
|
|
500
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DataChannelActionType: () => (/* binding */ DataChannelActionType)\n/* harmony export */ });\nvar DataChannelActionType;\n(function (DataChannelActionType) {\n DataChannelActionType[\"ChatPrompt\"] = \"chat_prompt\";\n DataChannelActionType[\"Speak\"] = \"speak\";\n DataChannelActionType[\"Jarvis\"] = \"jarvis\";\n})(DataChannelActionType || (DataChannelActionType = {}));\n\n\n//# sourceURL=webpack://Uneeq/./src/webrtc-data-channel/DataChannelActionType.ts?");
|
|
501
501
|
|
|
502
502
|
/***/ }),
|
|
503
503
|
|
|
504
|
-
/***/ "./src/webrtc-data-channel/
|
|
504
|
+
/***/ "./src/webrtc-data-channel/messages/CameraAnchor.ts":
|
|
505
505
|
/*!**********************************************************!*\
|
|
506
|
-
!*** ./src/webrtc-data-channel/
|
|
506
|
+
!*** ./src/webrtc-data-channel/messages/CameraAnchor.ts ***!
|
|
507
|
+
\**********************************************************/
|
|
508
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
509
|
+
|
|
510
|
+
"use strict";
|
|
511
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CameraAnchor: () => (/* binding */ CameraAnchor),\n/* harmony export */ CameraAnchorPosition: () => (/* binding */ CameraAnchorPosition)\n/* harmony export */ });\n/* harmony import */ var _DataChannelActionType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../DataChannelActionType */ \"./src/webrtc-data-channel/DataChannelActionType.ts\");\n\nvar CameraAnchorPosition;\n(function (CameraAnchorPosition) {\n CameraAnchorPosition[\"Left\"] = \"left\";\n CameraAnchorPosition[\"Right\"] = \"right\";\n CameraAnchorPosition[\"Center\"] = \"center\";\n})(CameraAnchorPosition || (CameraAnchorPosition = {}));\nclass CameraAnchor {\n constructor(position) {\n this.position = position;\n }\n toJSON() {\n const action = {\n action: _DataChannelActionType__WEBPACK_IMPORTED_MODULE_0__.DataChannelActionType.Jarvis,\n data: {\n event_type: \"camera_to_anchor\",\n data: {\n position: this.position\n }\n }\n };\n return action;\n }\n}\n\n\n//# sourceURL=webpack://Uneeq/./src/webrtc-data-channel/messages/CameraAnchor.ts?");
|
|
512
|
+
|
|
513
|
+
/***/ }),
|
|
514
|
+
|
|
515
|
+
/***/ "./src/webrtc-data-channel/messages/ChatPrompt.ts":
|
|
516
|
+
/*!********************************************************!*\
|
|
517
|
+
!*** ./src/webrtc-data-channel/messages/ChatPrompt.ts ***!
|
|
518
|
+
\********************************************************/
|
|
519
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
520
|
+
|
|
521
|
+
"use strict";
|
|
522
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ChatPrompt: () => (/* binding */ ChatPrompt)\n/* harmony export */ });\n/* harmony import */ var _DataChannelActionType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../DataChannelActionType */ \"./src/webrtc-data-channel/DataChannelActionType.ts\");\n\nclass ChatPrompt {\n constructor(prompt) {\n this.prompt = prompt;\n }\n toJSON() {\n const action = {\n action: _DataChannelActionType__WEBPACK_IMPORTED_MODULE_0__.DataChannelActionType.ChatPrompt,\n data: {\n prompt: this.prompt,\n metadata: '' // TODO\n }\n };\n return action;\n }\n}\n\n\n//# sourceURL=webpack://Uneeq/./src/webrtc-data-channel/messages/ChatPrompt.ts?");
|
|
523
|
+
|
|
524
|
+
/***/ }),
|
|
525
|
+
|
|
526
|
+
/***/ "./src/webrtc-data-channel/messages/SpeakRequest.ts":
|
|
527
|
+
/*!**********************************************************!*\
|
|
528
|
+
!*** ./src/webrtc-data-channel/messages/SpeakRequest.ts ***!
|
|
507
529
|
\**********************************************************/
|
|
508
530
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
509
531
|
|
|
510
532
|
"use strict";
|
|
511
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */
|
|
533
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Speak: () => (/* binding */ Speak)\n/* harmony export */ });\n/* harmony import */ var _DataChannelActionType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../DataChannelActionType */ \"./src/webrtc-data-channel/DataChannelActionType.ts\");\n\nclass Speak {\n constructor(prompt) {\n this.prompt = prompt;\n }\n toJSON() {\n const action = {\n action: _DataChannelActionType__WEBPACK_IMPORTED_MODULE_0__.DataChannelActionType.Speak,\n data: {\n prompt: this.prompt\n }\n };\n return action;\n }\n}\n\n\n//# sourceURL=webpack://Uneeq/./src/webrtc-data-channel/messages/SpeakRequest.ts?");
|
|
512
534
|
|
|
513
535
|
/***/ }),
|
|
514
536
|
|
package/dist/session.d.ts
CHANGED
package/dist/uneeq.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type UneeqConfig } from "./types/UneeqConfig";
|
|
2
|
+
import { type CameraAnchorPosition } from "./webrtc-data-channel/messages/CameraAnchor";
|
|
2
3
|
export declare class Uneeq {
|
|
3
4
|
private readonly config;
|
|
4
5
|
private session?;
|
|
5
6
|
constructor(config: UneeqConfig);
|
|
6
7
|
init(): void;
|
|
7
|
-
sendChatPrompt(
|
|
8
|
+
sendChatPrompt(chatPrompt: string): void;
|
|
9
|
+
sendSpeak(speech: string): void;
|
|
10
|
+
sendCameraAnchor(position: CameraAnchorPosition): void;
|
|
8
11
|
endSession(): void;
|
|
9
12
|
unmuteDigitalHuman(): void;
|
|
10
13
|
stopSpeaking(): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DataChannelAction } from "./DataChannelAction";
|
|
2
|
+
import { type DataChannelMessage } from "./DataChannelMessage";
|
|
3
|
+
export declare class Speak implements DataChannelMessage {
|
|
4
|
+
private readonly prompt;
|
|
5
|
+
constructor(prompt: string);
|
|
6
|
+
toJSON(): DataChannelAction;
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DataChannelAction } from "../DataChannelAction";
|
|
2
|
+
import { type DataChannelMessage } from "../DataChannelMessage";
|
|
3
|
+
export declare enum CameraAnchorPosition {
|
|
4
|
+
Left = "left",
|
|
5
|
+
Right = "right",
|
|
6
|
+
Center = "center"
|
|
7
|
+
}
|
|
8
|
+
export declare class CameraAnchor implements DataChannelMessage {
|
|
9
|
+
private readonly position;
|
|
10
|
+
constructor(position: CameraAnchorPosition);
|
|
11
|
+
toJSON(): DataChannelAction;
|
|
12
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type DataChannelAction } from "
|
|
2
|
-
import { type DataChannelMessage } from "
|
|
1
|
+
import { type DataChannelAction } from "../DataChannelAction";
|
|
2
|
+
import { type DataChannelMessage } from "../DataChannelMessage";
|
|
3
3
|
export declare class ChatPrompt implements DataChannelMessage {
|
|
4
4
|
private readonly prompt;
|
|
5
5
|
constructor(prompt: string);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DataChannelAction } from "../DataChannelAction";
|
|
2
|
+
import { type DataChannelMessage } from "../DataChannelMessage";
|
|
3
|
+
export declare class Speak implements DataChannelMessage {
|
|
4
|
+
private readonly prompt;
|
|
5
|
+
constructor(prompt: string);
|
|
6
|
+
toJSON(): DataChannelAction;
|
|
7
|
+
}
|
package/package.json
CHANGED
package/dist/lib/logConfig.d.ts
DELETED