initial commit

This commit is contained in:
2026-03-22 03:21:45 +02:00
commit 897fea9f4e
15431 changed files with 2548840 additions and 0 deletions

1
node_modules/jibo/lib/asr/asr-service.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},r=function(){function e(e,r){for(var n in r){var t=r[n];t.configurable=!0,t.value&&(t.writable=!0)}Object.defineProperties(e,r)}return function(r,n,t){return n&&e(r.prototype,n),t&&e(r,t),r}}(),n=function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},t=e(require("./asr-vars")),i=e(require("./audio-action")),o=e(require("./speaker-action")),s=e(require("./audio-source")),a=e(require("./recognizer")),c=e(require("./speaker-recognizer")),u=e(require("./end-of-speech-recognizer")),l=e(require("./cloud-recognizer")),g=e(require("./listener")),h=function(){function e(){n(this,e),this.isInitialized=!1,this.msgs=[]}return r(e,{Recognizer:{get:function(){return a}},EndOfSpeechRecognizer:{get:function(){return u}},CloudRecognizer:{get:function(){return l}},SpeakerRecognizer:{get:function(){return c}},init:{value:function(e,r){var n=this;try{this.socketUrl="ws:"+e.host+":"+e.port+"/port",this.audioUrl="http://"+e.host+":"+e.port+"/audio_source",this.asrInterfaceUrl="http://"+e.host+":"+e.port+"/asr_interface",this.speakerInterfaceUrl="http://"+e.host+":"+e.port+"/spkr_id_interface",this.socket=new WebSocket(this.socketUrl),this.loggingEnabled=!1,this.socket.onerror=function(){console.warn("error connecting to server")},this.socket.onmessage=function(e){var r=JSON.parse(e.data);for(n.msgs.push(r);!n.paused&&n.msgs.length;)n.processNextMessage()},this.alsaSource=new s(this.audioUrl),this.alsaSource.init(function(e){e&&console.warn(e),n.isInitialized=!0,r()})}catch(t){console.warn(t)}}},pause:{value:function(){this.paused=!0}},resume:{value:function(){for(this.paused=!1;this.msgs.length;)this.processNextMessage()}},processNextMessage:{value:function(){this.processMessage(this.msgs.shift())}},processMessage:{value:function(e){this.loggingEnabled&&(console.log("----------------------"),console.log(e));var r=t.idToAction[e.task_id],n=t.idToRecognizer[e.simple_recog_name];return"normal"!==e.status?void("error"===e.status&&r?(console.warn("ASR Service returned error response. Check ASR debug"),r.emit("error",e.message)):"received"===e.status&&this.loggingEnabled&&console.log("received ASR message")):"Speaker ID TD"===e.simple_recog_name?void r.emit("speakerid",e):e.final_simple?n?void n.onResult(e):void console.warn("Could not find recognizer with name "+e.simple_recog_name):e.final_composite?(r||console.warn("Could not find action with name "+e.task_id),r.emit("finished"),void r.clear()):void(e.utterances&&e.utterances.length>0&&n&&n.onIncremental&&n.onIncremental(e))}},createWavSource:{value:function(e){return this.wavSource=new s(this.audioUrl,e),this.wavSource}},createWavAction:{value:function(){var e=new i(this.asrInterfaceUrl);return this.wavSource.link(e),e}},createAudioAction:{value:function(){var e=new i(this.asrInterfaceUrl);return this.alsaSource.link(e),e}},createSpeakerAction:{value:function(){var e=new o(this.speakerInterfaceUrl);return this.alsaSource.link(e),e}},setLogging:{value:function(e){this.loggingEnabled=e}},createListener:{value:function(e,r){return new g(e,r)}}}),e}(),f=new h;module.exports=f;

1
node_modules/jibo/lib/asr/asr-vars.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";module.exports={idToAction:{},idToRecognizer:{},idToAudioSource:{}};

1
node_modules/jibo/lib/asr/audio-action.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=function(){function t(t,e){for(var i in e){var r=e[i];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(t,e)}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}(),i=function c(t,e,i){var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:c(o,e,i)}if("value"in r&&r.writable)return r.value;var n=r.get;if(void 0!==n)return n.call(i)},r=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=t(require("uuid")),a=t(require("./asr-vars")),s=require("events").EventEmitter,u=function(t){function s(t){o(this,s),i(Object.getPrototypeOf(s.prototype),"constructor",this).call(this),this.httpInterface=t,this.id="action-"+n.v4(),a.idToAction[this.id]=this,this.isCleared=!1}return r(s,t),e(s,{setAudioSourceId:{value:function(t){this.audioSourceId=t}},start:{value:function(t){if(!this.isCleared){var e={action:"init_and_start",task:t,task_id:this.id,audio_source_id:this.audioSourceId};e=JSON.stringify(e);var i=new XMLHttpRequest;i.open("POST",this.httpInterface,!0),i.send(e)}}},stop:{value:function(){if(!this.isCleared){var t=new XMLHttpRequest,e={action:"stop",task:"",task_id:this.id,audio_source_id:this.audioSourceId};e=JSON.stringify(e),t.open("POST",this.httpInterface,!0),t.send(e)}}},clear:{value:function(){if(!this.isCleared){delete a.idToAction[this.id],this.isCleared=!0;var t=new XMLHttpRequest,e={action:"clear",task:"",task_id:this.id,audio_source_id:this.audioSourceId};e=JSON.stringify(e),t.open("POST",this.httpInterface,!0),t.send(e)}}}}),s}(s);module.exports=u;

1
node_modules/jibo/lib/asr/audio-source.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=function(){function t(t,e){for(var i in e){var a=e[i];a.configurable=!0,a.value&&(a.writable=!0)}Object.defineProperties(t,e)}return function(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}}(),i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=t(require("uuid")),s=t(require("./asr-vars")),r=function(){function t(e,r){i(this,t);var n="alsa";Array.isArray(r)&&r.length>0?n="wav":"string"==typeof r&&(n="wav",r=[r]),this.id="source-"+a.v4(),s.idToAudioSource[this.id]=this,this.source=n,this.wavFiles=r||[],this.audioUrl=e}return e(t,{init:{value:function(t){var e={action:"start",audio_source_id:this.id,audio_source:this.source,wav_files:this.wavFiles};e=JSON.stringify(e);var i=new XMLHttpRequest;i.open("POST",this.audioUrl,!0),i.onreadystatechange=function(){4!=i.readyState||204!=i.status&&200!=i.status?4==i.readyState&&0===i.status&&t("Could not create audio channel"):t()},i.send(e)}},destroy:{value:function(t){var e={action:"stop",audio_source_id:this.id,audio_source:this.source,wav_files:[]};e=JSON.stringify(e);var i=new XMLHttpRequest;i.open("POST",this.audioUrl,!0),i.onreadystatechange=function(){4!=i.readyState||204!=i.status&&200!=i.status?4==i.readyState&&0===i.status&&t("Could not destroy audio channel"):t()},i.send(e)}},link:{value:function(t){t.setAudioSourceId(this.id)}}}),t}();module.exports=r;

1
node_modules/jibo/lib/asr/cloud-recognizer.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=function(){function t(t,e){for(var r in e){var n=e[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),r=function s(t,e,r){var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var i=Object.getPrototypeOf(t);return null===i?void 0:s(i,e,r)}if("value"in n&&n.writable)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},n=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=t(require("./recognizer")),l=t(require("../nli-service")),u={INVALID:0,COMPILING:1,COMPILE_FAILED:2,COMPILE_SUCCEEDED:3},o=function(t){function a(t,e){i(this,a),e=e?e:{},e.path="nuance_curlmulti",r(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,e),this.rule=t,this.handle=null,this.status=u.INVALID,this.callbacks=[],this.type="cloud",this.rule&&this.compile(function(){})}return n(a,t),e(a,{callCallbacks:{value:function(t){this.callbacks.forEach(function(e){e(t)}),this.callbacks.length=0}},compile:{value:function(t){var e=this;this.callbacks.push(t),this.status===u.INVALID?(this.status=u.COMPILING,l.compile(this.rule,function(t,r){t?(e.status=u.COMPILE_FAILED,console.warn(t),e.callCallbacks("error")):(e.status=u.COMPILE_SUCCEEDED,e.handle=r,e.callCallbacks())})):this.status===u.COMPILE_FAILED?this.callCallbacks("error"):this.status===u.COMPILE_SUCCEEDED&&this.callCallbacks()}},onResult:{value:function(t){var e=this,r=require("../main").asr;r.pause();var n=t.utterances[0].utterance;this.rule?this.compile(function(t){var i=t?l.parseFromRule.bind(l):l.parseFromURI.bind(l),a=t?e.rule:e.handle;i(a,n,function(t,n){t?e.emit("error",t):e.emit("result",n),r.resume()})}):(this.emit("result",{Input:n}),r.resume())}},onIncremental:{value:function(t){var e=this,r=t.utterances[0].utterance;this.rule?this.compile(function(t){var n=t?l.parseFromRule.bind(l):l.parseFromURI.bind(l),i=t?e.rule:e.handle;n(i,r,function(t,r){t?e.emit("error",t):e.emit("incremental",r)})}):this.emit("inremental",{Input:r})}}}),a}(a);module.exports=o;

View File

@@ -0,0 +1 @@
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=function(){function t(t,e){for(var r in e){var o=e[r];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(t,e)}return function(e,r,o){return r&&t(e.prototype,r),o&&t(e,o),e}}(),r=function c(t,e,r){var o=Object.getOwnPropertyDescriptor(t,e);if(void 0===o){var n=Object.getPrototypeOf(t);return null===n?void 0:c(n,e,r)}if("value"in o&&o.writable)return o.value;var i=o.get;if(void 0!==i)return i.call(r)},o=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=t(require("./recognizer")),u=function(t){function i(t){n(this,i),t=t||{},t.path="sensory_speech_detector",r(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,t),this.type="eos"}return o(i,t),e(i,{onResult:{value:function(t){"normal"===t.status&&this.emit("result",t)}}}),i}(i);module.exports=u;

1
node_modules/jibo/lib/asr/enroll.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";

1
node_modules/jibo/lib/asr/listener.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var e=function(){function e(e,t){for(var i in t){var r=t[i];r.configurable=!0,r.value&&(r.writable=!0)}Object.defineProperties(e,t)}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),t=function o(e,t,i){var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var s=Object.getPrototypeOf(e);return null===s?void 0:o(s,t,i)}if("value"in r&&r.writable)return r.value;var n=r.get;if(void 0!==n)return n.call(i)},i=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=require("events").EventEmitter,n=function(s){function n(e,i){r(this,n),t(Object.getPrototypeOf(n.prototype),"constructor",this).call(this),this.options=e,this.rule=i,this.status="INVALID"}return i(n,s),e(n,{onFinished:{value:function(){this.emit("finished"),this.status="SUCCEEDED",this.removeAllListeners(),this.action.stop(),this.action.clear()}},heyJiboResult:{value:function(){this.heyJiboPhrase&&this.tdSpeakerResult&&this.emit("embedded",this.heyJiboPhrase,this.tdSpeakerResult)}},cloudResult:{value:function(){this.asrResult&&this.tiSpeakerResult&&this.emit("cloud",this.asrResult,this.tiSpeakerResult)}},addCloudRecognizer:{value:function(e){var t=this,i=new this.asr.CloudRecognizer(this.rule,e);return i.on("result",function(e){t.asrResult=e,t.cloudResult(),i.removeAllListeners("result")}),i.on("error",function(e){t.emit("error",e)}),e.incremental&&i.on("incremental",function(e){t.emit("incremental",e)}),""+i.pack()}},addHeyJibo:{value:function(){var e=this,t="",i=new this.asr.Recognizer({path:"hey_jibo"});return i.on("result",function(t){e.heyJiboPhrase=t,e.heyJiboResult(),i.removeAllListeners("result")}),t=this.tdReco?"("+i.pack()+" * "+this.tdReco.pack()+")":""+i.pack(),"("+t+")"}},addSpeakerRecognizers:{value:function(){var e=this;return this.tiReco=new this.asr.SpeakerRecognizer({authTI:!0}),this.tiReco.on("result",function(t){e.tiSpeakerResult=t,e.cloudResult(),e.tiReco.removeAllListeners("result")}),"("+this.tiReco.pack()+")"}},addEOSRecognizer:{value:function(){var e=this,t=new this.asr.EndOfSpeechRecognizer({});return t.on("result",function(){e.emit("end"),t.removeAllListeners("result")}),""+t.pack()}},start:{value:function(){var e=this;if(this.asr=require("../main").asr,"IN_PROGRESS"===this.status)return this.emit("error","cannot restart; listener is currently in progress."),!1;this.status="IN_PROGRESS",this.tiSpeakerResult=!1,this.tdSpeakerResult=!1,this.action=this.asr.createAudioAction(),this.action.on("finished",function(){e.onFinished()}),this.action.on("speakerid",function(t){var i=t.speaker_ids,r=t.speaker_idstatus;e.tdSpeakerResult={speakerIds:i,speakerIdStatus:r},e.heyJiboResult()}),this.action.on("error",function(t){e.emit("error",t)});var t=void 0;if(this.options.embeddedOnly)t=this.addHeyJibo();else{t=this.addCloudRecognizer(this.options,this.rule);var i=this.addSpeakerRecognizers(t);if(t="("+i+" * "+t+")",this.options.detectEnd){var r=this.addEOSRecognizer();t="("+r+" | "+t+")"}if(this.options.heyJibo){var s=this.addHeyJibo();t="("+s+" * "+t+")"}}return this.action.start(t),!0}},stop:{value:function(){this.onFinished()}}}),n}(s);module.exports=n;

1
node_modules/jibo/lib/asr/recognizer.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=function(){function e(e,t){for(var r in t){var i=t[r];i.configurable=!0,i.value&&(i.writable=!0)}Object.defineProperties(e,t)}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),r=function p(e,t,r){var i=Object.getOwnPropertyDescriptor(e,t);if(void 0===i){var n=Object.getPrototypeOf(e);return null===n?void 0:p(n,t,r)}if("value"in i&&i.writable)return i.value;var a=i.get;if(void 0!==a)return a.call(r)},i=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=e(require("uuid")),s=e(require("./asr-vars")),u=e(require("./resource-base")),o=require("events").EventEmitter,c=function(e){function o(e){n(this,o),r(Object.getPrototypeOf(o.prototype),"constructor",this).call(this),this.name=a.v4(),e=e||{},this.bargein=e.bargein||!0,this.incremental=e.incremental||!1,this.timeout=0,this.authenticateSpeaker=e.authenticateSpeaker||"",this.speakerId=!0,this.nbest=e.nbest||1,e.path?this.path=u+e.path:this.path=u+"nuance_curlmulti";var t=this.path.split("/");this.name=t[t.length-1]+"-"+this.name,s.idToRecognizer[this.name]=this}return i(o,e),t(o,{setPath:{value:function(e){this.path=u+e}},toString:{value:function(){return this.pack()}},pack:{value:function(){var e={name:this.name,path:this.path,bargein:this.bargein,nbest:this.nbest,speaker_name:this.authenticateSpeaker,speaker_id:this.speakerId,incremental:this.incremental};return e=JSON.stringify(e)}},onResult:{value:function(e){if(e.utterances&&e.utterances.length>0){var t={speaker_ids:e.speaker_ids,speaker_idstatus:e.speaker_idstatus};this.emit("result",e.utterances[0],t)}else{var t={speaker_ids:e.speaker_ids,speaker_idstatus:e.speaker_idstatus};this.emit("result","",t)}}}}),o}(o);module.exports=c;

1
node_modules/jibo/lib/asr/resource-base.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";module.exports="/usr/share/jibo/asrservice/sharedresources/";

1
node_modules/jibo/lib/asr/speaker-action.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},t=function(){function e(e,t){for(var r in t){var n=t[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(e,t)}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),r=function c(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var i=Object.getPrototypeOf(e);return null===i?void 0:c(i,t,r)}if("value"in n&&n.writable)return n.value;var o=n.get;if(void 0!==o)return o.call(r)},n=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.__proto__=t)},i=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},o=e(require("uuid")),u=e(require("./asr-vars")),a=require("events").EventEmitter,s=function(e){function a(e){i(this,a),r(Object.getPrototypeOf(a.prototype),"constructor",this).call(this),this.httpInterface=e,this.id="spkr-action-"+o.v4(),u.idToAction[this.id]=this}return n(a,e),t(a,{setAudioSourceId:{value:function(e){this.audioSourceId=e}},deleteSpeaker:{value:function(){var e=void 0===arguments[0]?"":arguments[0],t=void 0===arguments[1]?"Text-Dependent":arguments[1],r=new XMLHttpRequest,n={action:"delete",task_id:this.id,spkr_id_type:t,speaker_name:e};n=JSON.stringify(n),r.open("POST",this.httpInterface,!0),r.send(n)}},listSpeakers:{value:function(){var e=void 0===arguments[0]?"":arguments[0],t=void 0===arguments[1]?"Text-Dependent":arguments[1],r=new XMLHttpRequest,n={action:"list",task_id:this.id,spkr_id_type:t,speaker_name:e};n=JSON.stringify(n),r.open("POST",this.httpInterface,!0),r.send(n)}}}),a}(a);module.exports=s;

1
node_modules/jibo/lib/asr/speaker-recognizer.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=function(){function t(t,e){for(var r in e){var n=e[r];n.configurable=!0,n.value&&(n.writable=!0)}Object.defineProperties(t,e)}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),r=function u(t,e,r){var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:u(o,e,r)}if("value"in n&&n.writable)return n.value;var i=n.get;if(void 0!==i)return i.call(r)},n=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},o=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=t(require("./recognizer")),a=function(t){function i(){var t=void 0===arguments[0]?{}:arguments[0];o(this,i),t.enrollTD?t.path="sensory_spkr_enroll_td":t.enrollTI?t.path="sensory_spkr_enroll_ti":t.authTD?t.path="sensory_spkr_id_td":t.authTI&&(t.path="sensory_spkr_id_ti"),r(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,t)}return n(i,t),e(i,{toString:{value:function(){return this.pack()}},pack:{value:function(){var t={name:this.name,path:this.path,bargein:this.bargein,nbest:this.nbest,speaker_name:this.authenticateSpeaker,incremental:this.incremental,audio_tail_length:1};return t=JSON.stringify(t)}},onResult:{value:function(t){var e={speakerIds:t.speaker_ids,speakerIdStatus:t.speaker_idstatus};this.emit("result",e)}}}),i}(i);module.exports=a;