initial commit
This commit is contained in:
2
node_modules/jibo/.npmignore
generated
vendored
Normal file
2
node_modules/jibo/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
gulpfile.js
|
||||
.gitignore
|
||||
8
node_modules/jibo/.syncignore
generated
vendored
Normal file
8
node_modules/jibo/.syncignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
.git
|
||||
.gitignore
|
||||
.idea
|
||||
.bin
|
||||
.DS_Store
|
||||
node_module/jibo-gulp
|
||||
node_module/gulp
|
||||
node_module/should
|
||||
3
node_modules/jibo/LICENSE.txt
generated
vendored
Normal file
3
node_modules/jibo/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Copyright © 2015 Jibo, Inc. All rights reserved.
|
||||
|
||||
See www.jibo.com/legal/copyright for additional attributions.
|
||||
1
node_modules/jibo/lib/api/animate.js
generated
vendored
Normal file
1
node_modules/jibo/lib/api/animate.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function e(e){u.createAnimationUtilities=function(){return console.log("Warning: createAnimationUtilities() is deprecated. Access anim utils via jibo.animate."),e},e.createAnimationUtilities=function(){return e},e.createAnimationBuilderFromKeysPath=function(i,n,t){m(function(o,r){s(A.parse(i).dir,function(o,a){l.keysToAnimObjectAsync(i,function(i){function o(e,i,n){var t=d.getPath(n.file);d.startAudio(t,a===r?"":a)}function u(){c.off("playAudio",o),c.off("STOPPED",u)}var c=e.createAnimationBuilderFromData(i,n);c.on("play-audio",o),c.on("STOPPED",u),t(c)})})})},e.MODALITY_NAME=u.MODALITY_NAME,e.trajectory=u.trajectory,e.AnimationEventType=u.AnimationEventType,e.LookatEventType=u.LookatEventType,e.THREE=f}function i(){var e=c.createRobotRenderer;c.robotInfo=v,c.timeline=y,c.createRobotRenderer=function(i,n,t){e(v,i,n,function(e){null!==e?(o.connectRenderer(y,e),t&&t(null,e)):t&&t("Renderer creation failed")})}}var n=function(e){return e&&e.__esModule?e["default"]:e},t=require("animation-utilities"),o=t.TimelineBuilder,r=t.RobotInfo,a=t.JiboConfig,u=t.animate,c=t.visualize,f=t.THREE,l=n(require("jibo-keyframes")),d=n(require("../audio-helper")),s=n(require("../get-base-directory")),m=n(require("../get-project-root")),A=n(require("path")),v=void 0,y=void 0;module.exports=function(n,t){var u=new a;r.createInfo(u,function(r){o.createTimeline(r,function(o){v=r,y=o,n.init(y,v),e(n),i(),t()})})};
|
||||
1
node_modules/jibo/lib/asr/asr-service.js
generated
vendored
Normal file
1
node_modules/jibo/lib/asr/asr-service.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/asr-vars.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";module.exports={idToAction:{},idToRecognizer:{},idToAudioSource:{}};
|
||||
1
node_modules/jibo/lib/asr/audio-action.js
generated
vendored
Normal file
1
node_modules/jibo/lib/asr/audio-action.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/audio-source.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/cloud-recognizer.js
generated
vendored
Normal 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;
|
||||
1
node_modules/jibo/lib/asr/end-of-speech-recognizer.js
generated
vendored
Normal file
1
node_modules/jibo/lib/asr/end-of-speech-recognizer.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/enroll.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";
|
||||
1
node_modules/jibo/lib/asr/listener.js
generated
vendored
Normal file
1
node_modules/jibo/lib/asr/listener.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/recognizer.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/resource-base.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/speaker-action.js
generated
vendored
Normal 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
1
node_modules/jibo/lib/asr/speaker-recognizer.js
generated
vendored
Normal 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;
|
||||
1
node_modules/jibo/lib/audio-helper.js
generated
vendored
Normal file
1
node_modules/jibo/lib/audio-helper.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function t(t){var e=t.split("://");return t=1==e.length?u.join("audio",t):e[0]+"://audio/"+e[1]}function e(t,e,r){var u=new Audio;return n(t,e,function(t){u.src=t,u.autoplay=!0,u.controls=!1,r&&u.addEventListener("ended",r)}),u}var r=function(t){return t&&t.__esModule?t["default"]:t},u=r(require("path")),n=r(require("./get-asset-uri"));module.exports={getPath:t,startAudio:e};
|
||||
1
node_modules/jibo/lib/behavior-emitter.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behavior-emitter.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=require("events").EventEmitter;module.exports=new e;
|
||||
1
node_modules/jibo/lib/behaviors/base/case.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/case.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),r=require("../../bt/base"),o=r.createDecorator;module.exports=o({constructor:function(t){this.conditional=t},start:function(){return this.conditional()},stop:function(){},update:function(t){return t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/execute-script-async.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/execute-script-async.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),s=require("../../bt/base"),i=s.Status,u=s.createBehavior;module.exports=u({constructor:function(t){this.func=t,this.status=i.INVALID},start:function(){return this.status=i.IN_PROGRESS,this.func(this.onSucceed.bind(this),this.onFail.bind(this)),!0},onSucceed:function(){this.status=i.SUCCEEDED},onFail:function(){this.status=i.FAILED},stop:function(){},update:function(){return this.status}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/execute-script.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/execute-script.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),r=require("../../bt/base"),e=r.Status,u=r.createBehavior;module.exports=u({constructor:function(t){this.func=t},start:function(){return this.func(),!0},stop:function(){},update:function(){return e.SUCCEEDED}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/fail-on-condition.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/fail-on-condition.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),i=require("../../bt/base"),o=i.Status,n=i.createDecorator;module.exports=n({constructor:function(t,i){this.init=t,this.conditional=i},start:function(){return this.init(),this.conditional()?!1:!0},stop:function(){},update:function(t){return this.conditional()?o.FAILED:t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/null.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/null.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),r=require("../../bt/base"),e=r.Status,u=r.createBehavior;module.exports=u({constructor:function(){},start:function(){return!0},stop:function(){},update:function(){return e.IN_PROGRESS}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/parallel.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/parallel.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var r=require("../../bt/factory"),t=require("../../bt/base"),e=t.Status,i=t.createBehavior;module.exports=i({constructor:function(r,t){this.succeedOnOne=r,this.children=t||[]},start:function(){if(0===this.children.length)return!1;var r=!1;this.runChildren=[];for(var t=0;t<this.children.length;t++){var e=this.children[t];e.start()?this.runChildren.push(e):r=!0}if(this.activeChildren=this.runChildren.length,r){for(var t=0;t<this.runChildren.length;t++)this.runChildren[t].stop();return!1}return!0},stop:function(){for(var r=0;r<this.runChildren.length;r++)this.runChildren[r]&&this.runChildren[r].stop()},update:function(){for(var r=!1,t=0;t<this.runChildren.length;t++)if(this.runChildren[t]){var i=this.runChildren[t],n=i.update();if(n===e.SUCCEEDED){if(this.succeedOnOne)return this.stop(),e.SUCCEEDED;i.stop(),delete this.runChildren[t],this.activeChildren--}else if(n===e.FAILED)r=!0;else if(n===e.PAUSED)return e.IN_PROGRESS}return r?e.FAILED:0===this.activeChildren?e.SUCCEEDED:e.IN_PROGRESS}}),r.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/random.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/random.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),r=require("../../bt/base"),e=r.Status,i=r.createBehavior;module.exports=i({constructor:function(t){this.children=t||[],this.current=-1},start:function(){if(0===this.children.length)return!1;this.current=Math.round(Math.random()*(this.children.length-1));var t=this.children[this.current].start();return this.current=t?this.current:-1,t},stop:function(){-1!==this.current&&this.current<this.children.length&&(this.children[this.current].stop(),this.current=-1)},update:function(){var t=this.children[this.current].update();return t===e.PAUSED?e.IN_PROGRESS:t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/sequence.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/sequence.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),r=require("../../bt/base"),e=r.Status,i=r.createBehavior;module.exports=i({constructor:function(t){this.children=t||[],this.current=-1},start:function(){if(0===this.children.length)return!0;this.current=0;var t=this.children[this.current].start();return this.current=t?this.current:-1,t},stop:function(){-1!==this.current&&this.current<this.children.length&&(this.current=-1)},update:function(){if(-1!==this.current&&this.current<this.children.length){var t=this.children[this.current].update();if(t===e.SUCCEEDED)return this.current++,this.current<this.children.length?this.children[this.current].start()?e.IN_PROGRESS:e.FAILED:e.SUCCEEDED;if(t===e.IN_PROGRESS||t==e.PAUSED)return e.IN_PROGRESS}else if(0===this.children.length)return e.SUCCEEDED;return e.FAILED}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/start-on-condition.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/start-on-condition.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),i=require("../../bt/base"),r=i.Status,o=i.createDecorator;module.exports=o({constructor:function(t,i){this.init=t,this.conditional=i,this.didStart=!1},start:function(){return this.init(),this.didStart=!1,this.conditional()?(this.didStart=!0,!0):r.WAIT},stop:function(){},update:function(t){return this.didStart?t:this.conditional()?(this.didStart=!0,!0):r.WAIT}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/succeed-on-condition.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/succeed-on-condition.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),i=require("../../bt/base"),r=i.Status,o=i.createDecorator;module.exports=o({constructor:function(t,i){this.init=t,this.conditional=i},start:function(){return this.init(),!0},stop:function(){},update:function(t){return this.conditional()?r.SUCCEEDED:t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/succeed-on-event.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/succeed-on-event.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),e=require("../../bt/base"),n=e.Status,i=e.createDecorator;module.exports=i({constructor:function(t,e){this.event=t,this.onEvent=e,this.onEventBind=this._onEvent.bind(this)},start:function(){return this.getEmitter().once(this.event,this.onEventBind),this.status=n.IN_PROGRESS,!0},stop:function(){this.getEmitter().removeListener(this.event,this.onEventBind)},_onEvent:function(){this.onEvent.apply(null,arguments),this.status=n.SUCCEEDED},update:function(t){return this.status===n.SUCCEEDED?n.SUCCEEDED:t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/switch.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/switch.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),r=require("../../bt/base"),e=r.Status,i=r.createBehavior;module.exports=i({constructor:function(t){this.children=t||[],this.current=-1},start:function(){return 0===this.children.length?!1:(this.current=0,this.findStart())},findStart:function(){for(var t=!1;!t&&this.current<this.children.length;)t=this.children[this.current].start(),t||this.current++;return!0},stop:function(){this.current=-1},update:function(){if(-1!==this.current&&this.current<this.children.length){var t=this.children[this.current].update();return t===e.FAILED?(this.current++,this.current>=this.children.length||!this.findStart()?e.SUCCEEDED:e.IN_PROGRESS):t===e.PAUSED?e.IN_PROGRESS:t}return e.SUCCEEDED}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/timeout-fail.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/timeout-fail.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),e=require("../../bt/base"),r=e.Status,i=e.createDecorator;module.exports=i({constructor:function(t){this.timeout=t},start:function(){return this.startTime=(new Date).getTime(),!0},stop:function(){},update:function(t){var e=(new Date).getTime()-this.startTime;return e>this.timeout?(this.getBehavior().stop(),r.FAILED):t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/timeout-js.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/timeout-js.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),e=require("../../bt/base"),r=e.Status,i=e.createBehavior,u=require("./timeout-succeed"),s=require("./null");module.exports=i({constructor:function(t){this.func=t},start:function(){return this.status=r.IN_PROGRESS,this.behavior=s("").setDecorators([u("",this.func())]),this.behavior.start()},stop:function(){this.behavior.stop()},update:function(){return this.behavior.update()}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/timeout-succeed-js.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/timeout-succeed-js.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),e=require("../../bt/base"),i=e.Status,r=e.createDecorator;module.exports=r({constructor:function(t){this.getTimeout=t},start:function(){return this.startTime=(new Date).getTime(),this.timeout=this.getTimeout(),!0},stop:function(){},update:function(t){var e=(new Date).getTime()-this.startTime;return e>this.timeout?i.SUCCEEDED:t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/timeout-succeed.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/timeout-succeed.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),e=require("../../bt/base"),r=e.Status,i=e.createDecorator;module.exports=i({constructor:function(t){this.timeout=t},start:function(){return this.startTime=(new Date).getTime(),!0},stop:function(){},update:function(t){var e=(new Date).getTime()-this.startTime;return e>this.timeout?r.SUCCEEDED:t}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/base/while-condition.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/base/while-condition.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../../bt/factory"),i=require("../../bt/base"),o=i.Status,n=i.createDecorator;module.exports=n({constructor:function(t,i){this.init=t,this.conditional=i,this.doInit=!0},start:function(){return this.doInit&&(this.init(),this.doInit=!1),!0},stop:function(){},update:function(t){return t===o.SUCCEEDED&&this.conditional()?this.getBehavior().start()?o.IN_PROGRESS:o.FAILED:(this.doInit=t!==o.IN_PROGRESS,t)}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/blink.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/blink.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../main").animate,r=require("../bt/main"),u=r.Status,a=r.createBehavior,e=r.factory;module.exports=a({constructor:function(){this.status=u.INVALID},start:function(){return this.status=u.SUCCEEDED,t.blink(),!0},stop:function(){},update:function(){return this.status}}),e.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/listen-embedded.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/listen-embedded.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=require("../bt/main"),s=e.Status,r=e.createBehavior,u=e.factory,i=e.behaviors,o=i.Null,a=t(require("./succeed-on-embedded")),h=r({constructor:function(t,e){this.rule=t,this.onResult=e,this.status=s.INVALID},start:function(){return this.status=s.IN_PROGRESS,this.behavior=o("").setDecorators([a("",this.rule,this.onResult)]),this.behavior.start()},stop:function(){this.behavior.stop()},update:function(){return this.behavior.update()}});h.Rules={HEY_JIBO:"hey_jibo"},module.exports=h,u.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/listen-js.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/listen-js.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=require("../bt/main"),i=e.createBehavior,s=e.factory,o=e.behaviors,r=o.Null,u=t(require("./succeed-on-listen-js"));module.exports=i({constructor:function(t,e,i){this.getOptions=t,this.getRule=e,this.onResult=i},start:function(){return this.behavior=r("").setDecorators([u("",this.getOptions,this.getRule,this.onResult)]),this.behavior.start()},stop:function(){this.behavior.stop()},update:function(){return this.behavior.update()}}),s.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/listen.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/listen.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=require("../bt/main"),s=e.Status,i=e.createBehavior,r=e.factory,o=e.behaviors,u=o.Null,a=t(require("./succeed-on-listen"));module.exports=i({constructor:function(t,e,i){this.getOptions=t,this.rule=e,this.onResult=i,this.status=s.INVALID},start:function(){return this.status=s.IN_PROGRESS,this.behavior=u("").setDecorators([a("",this.getOptions,this.rule,this.onResult)]),this.behavior.start()},stop:function(){this.behavior.stop()},update:function(){return this.behavior.update()}}),r.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/look-at.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/look-at.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../main").animate,i=require("../bt/main"),e=i.Status,s=i.createBehavior,o=i.factory,n=require("animation-utilities").THREE;module.exports=s({constructor:function(t,i,s){this.getTarget=t,this.isContinous=void 0===i?!1:i,this.config=s,this.status=e.INVALID,this.threeVec=new n.Vector3(0,0,0)},start:function(){this.status=e.IN_PROGRESS,this.builder=t.createLookatBuilder(),this.onStoppedBind=this.onStopped.bind(this),this.builder.on("STOPPED",this.onStoppedBind),this.builder.setContinuousMode(this.isContinous),void 0!==this.config&&this.config(this.builder);var i=this.getTarget();return this.threeVec.set(i.x,i.y,i.z),this.lookAtInstance=this.builder.startLookat(this.threeVec),!0},onStopped:function(){this.status=e.SUCCEEDED},stop:function(){this.lookAtInstance&&this.lookAtInstance.stop()},update:function(){if(this.isContinous&&void 0!==this.lookAtInstance){var t=this.getTarget();this.threeVec.set(t.x,t.y,t.z),this.lookAtInstance.updateTarget(this.threeVec)}return this.status}}),o.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/play-animation.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/play-animation.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},i=require("../main").animate,n=require("../bt/main"),e=n.Status,s=n.createBehavior,a=n.factory,o=t(require("path")),r=t(require("../get-asset-uri")),u=t(require("../behavior-emitter"));module.exports=s({constructor:function(t,i){var n=t.split("://");t=1==n.length?o.join("animations",t):n[0]+"://animations/"+n[1],this.path=t,this.config=i,this.status=e.INVALID,this.onEventBind=this.onEvent.bind(this)},start:function(){var t=this;return this.status=e.IN_PROGRESS,r(this.path,this.getAssetPack(),function(n,s){i.createAnimationBuilderFromKeysPath(n,s,function(i){t.builder=i,t.builder?(i.on("STOPPED",function(){t.status=e.SUCCEEDED}),i.on("EVENT",t.onEventBind),t.config&&t.config(i),t.instance=i.play()):t.status=e.FAILED})}),!0},stop:function(){this.builder&&(this.builder.off("EVENT",this.onEventBind),this.instance.stop())},update:function(){return this.status},onEvent:function(t,i,n){u.emit(n.eventName,i,n.payload)}}),a.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/play-audio.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/play-audio.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},s=require("../bt/main"),i=s.Status,u=s.createBehavior,e=s.factory,o=t(require("../audio-helper"));module.exports=u({constructor:function(t){this.path=o.getPath(t),this.status=i.INVALID},start:function(){return this.status=i.IN_PROGRESS,this.audio=o.startAudio(this.path,this.getAssetPack(),this.onAudioStopped.bind(this)),!0},onAudioStopped:function(){this.status=i.SUCCEEDED},stop:function(){this.audio.pause()},update:function(){return this.status}}),e.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/read-barcode.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/read-barcode.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},r=require("../bt/main"),e=r.Status,s=r.createBehavior,u=r.factory,o=t(require("../lps-service"));module.exports=s({constructor:function(t){this.status=e.INVALID,this.onBarcode=t},start:function(){var t=this;return this.status=e.IN_PROGRESS,o.readBarcode(function(r,s){t.onBarcode(r,s),t.status=e.SUCCEEDED}),!0},stop:function(){},update:function(){return this.status}}),u.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/start-on-anim-event.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/start-on-anim-event.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=require("../bt/main"),n=e.Status,i=e.createDecorator,r=e.factory,o=t(require("../behavior-emitter"));module.exports=i({constructor:function(t,e){this.eventName=t,this.onReceived=e,this.didStart=!1,this.onEventBind=this.onEvent.bind(this)},start:function(){return this.didStart=!1,0!==this.eventName.length&&o.on(this.eventName,this.onEventBind),n.WAIT},onEvent:function(t,e){this.onReceived&&this.onReceived(t,e),this.didStart=!0,o.removeListener(this.eventName,this.onEventBind)},stop:function(){0!==this.eventName.length&&o.removeListener(this.eventName,this.onEventBind)},update:function(t){return this.didStart?t:n.WAIT}}),r.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/start-on-event.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/start-on-event.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../bt/factory"),e=require("../bt/base"),n=e.Status,i=e.createDecorator;module.exports=i({constructor:function(t,e){this.event=t,this.onEvent=e,this.onEventBind=this._onEvent.bind(this)},start:function(){return this.getEmitter().once(this.event,this.onEventBind),this.didStart=!1,n.WAIT},_onEvent:function(){this.onEvent.apply(null,arguments),this.didStart=!0},stop:function(){this.getEmitter().removeListener(this.event,this.onEventBind)},update:function(t){return this.didStart?t:n.WAIT}}),t.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/subtree-js.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/subtree-js.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},e=require("../bt/main"),s=e.Status,u=e.createBehavior,r=e.factory,a=t(require("./subtree"));module.exports=u({constructor:function(t,e,u){this.getFileName=t,this.getNotepad=e,this.setResult=u,this.status=s.INVALID},start:function(){var t=this;return this.status=s.IN_PROGRESS,this.getFileName(function(e){t.subtree=a(t.getName(),e,t.getNotepad,t.setResult),t.subtree.blackboard=t.getBlackboard(),t.status=t.subtree.start()?s.IN_PROGRESS:s.FAILED}),!0},stop:function(){this.subtree.stop()},update:function(){return this.subtree.update()}}),r.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/subtree.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/subtree.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},s=require("../bt/main"),e=s.Status,r=s.createBehavior,a=s.factory,o=t(require("path")),i=t(require("../get-asset-uri"));module.exports=r({constructor:function(t,s,e){var r=t.split("://");1==r.length?t=o.join("behaviors",t):(t=r[0]+"://behaviors/"+r[1],this.assetPack=r[0]),this.path=t,this.getNotepad=s,this.setResult=e},start:function(){var t=this;return this.status=e.IN_PROGRESS,i(this.path,this.getAssetPack(),function(s){var r={notepad:t.getNotepad()};t.assetPack&&(r.assetPack=t.assetPack),r.blackboard=t.getBlackboard(),t.root=a.create(s,r),t.status=t.root.start()?t.status:e.FAILED}),!0},stop:function(){this.root&&this.root.stop()},update:function(){if(this.status===e.FAILED)return this.root&&this.root.stop(),this.status;if(void 0===this.root)return this.status;var t=this.root.update();return t===e.SUCCEEDED&&this.setResult(this.root.result),t}}),a.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/succeed-on-embedded.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/succeed-on-embedded.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../bt/main"),e=t.Status,s=t.createDecorator,i=t.factory,r=require("../main").asr,n=require("events").EventEmitter,o=s({constructor:function(t,s){this.rule=t,this.onResult=s,this.emitter=new n,this.status=e.INVALID},start:function(){var t=this;if(this.status=e.IN_PROGRESS,!r.isInitialized)return console.warn("Running listen without ASR service"),!0;var s={};return s.embeddedOnly=!0,this.listener=r.createListener(s,this.rule),this.listener.start(),this.listener.on("embedded",function(s,i){t.emitter.emit("hey-jibo",s,i),t.listener.removeAllListeners(),t.status=e.SUCCEEDED}),this.listener.on("error",function(e){t.emitter.emit("error",e)}),this.listener.on("finished",function(){t.listener.removeAllListeners(),t.status=e.SUCCEEDED}),this.onResult(this.emitter),this.status=e.IN_PROGRESS,!0},stop:function(){this.emitter.removeAllListeners(),this.listener.removeAllListeners()},update:function(t){return this.status===e.IN_PROGRESS?t:this.status}});o.Rules={HEY_JIBO:"hey_jibo"},module.exports=o,i.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/succeed-on-listen-js.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/succeed-on-listen-js.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=require("../bt/main"),e=t.Status,i=t.createDecorator,n=t.factory,s=require("../main").asr,r=require("events").EventEmitter;module.exports=i({constructor:function(t,i,n){this.getOptions=t,this.getRule=i,this.onResult=n,this.status=e.INVALID},start:function(){var t=this,i=this.getOptions();return this.status=e.IN_PROGRESS,s.isInitialized?(this.emitter=new r,this.getRule(function(n){t.listener=s.createListener(i,n),t.listener.start(),t.listener.on("cloud",function(e,i){t.emitter.emit("cloud",e,i)}),t.listener.on("incremental",function(e){t.emitter.emit("incremental",e,function(){t.listener.stop()})}),t.listener.on("embedded",function(e,i){t.emitter.emit("hey-jibo",e,i)}),t.listener.on("end",function(){t.emitter.emit("end")}),t.listener.on("error",function(e){t.emitter.emit("error",e)}),t.listener.on("finished",function(){t.listener.removeAllListeners(),t.status=e.SUCCEEDED}),t.onResult(t.emitter),t.status=e.IN_PROGRESS}),!0):(console.warn("Running listen without ASR service"),!0)},stop:function(){this.emitter&&(this.emitter.removeAllListeners(),this.emitter=void 0),this.listener&&(this.listener.removeAllListeners(),this.listener.action.stop(),this.listener.action.clear(),this.listener=void 0)},update:function(t){return this.status===e.IN_PROGRESS?t:this.status}}),n.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/succeed-on-listen.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/succeed-on-listen.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},r=require("../bt/main"),e=r.Status,o=r.createDecorator,s=r.factory,i=t(require("./succeed-on-listen-js")),u=t(require("../get-project-root")),a=t(require("fs")),n=t(require("path"));module.exports=o({constructor:function(t,r,o){this.getOptions=t,this.rulePath=r,this.onResult=o,this.status=e.INVALID},start:function(){var t=this;this.status=e.IN_PROGRESS;var r=function(r){u(function(e){var o=n.join(e,"rules",t.rulePath);a.readFile(o,"utf8",function(t,e){t&&console.error("Rule file does not exist: "+o),r(e)})})};return this.decorator=i("",this.getOptions,r,this.onResult),this.decorator.start()},stop:function(){this.decorator&&this.decorator.stop(),this.decorator=void 0},update:function(t){if(this.decorator){var r=this.decorator.update(t);return r===e.SUCCEEDED&&(this.decorator=void 0),r}return this.status}}),s.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/take-photo.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/take-photo.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},r=require("../bt/main"),o=r.Status,e=r.createBehavior,s=r.factory,u=t(require("../lps-service"));module.exports=e({constructor:function(t,r){var e=this;this.status=o.INVALID,this.type=t,this.onPhotoWrapper=function(t,s){r(t,s),e.status=o.SUCCEEDED}},start:function(){var t=this;return this.status=o.IN_PROGRESS,u.takePhoto(this.type,function(r,e){return r?(t.onPhotoWrapper(r,null),void(t.status=o.SUCCEEDED)):void t.onPhotoWrapper(null,e)}),!0},stop:function(){},update:function(){return this.status}}),s.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/text-to-speech-js.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/text-to-speech-js.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},s=require("../bt/main"),e=s.Status,o=s.createBehavior,r=s.factory,n=t(require("../tts-service.js"));module.exports=o({constructor:function(t,s){var o=this;this.status=e.INVALID,this.getWords=t,this.onWordWrapper=function(t){s(t),"STOP"===t.status&&(o.status=e.SUCCEEDED)},this.onSpeakingStopped=function(){o.status=e.SUCCEEDED}},start:function(){var t=this;return this.status=e.IN_PROGRESS,this.getWords(function(s){n.speak(s,function(s){return s?(console.log("tts.speak() error: "+s),void(t.status=e.SUCCEEDED)):void 0})}),n.on("word",this.onWordWrapper),n.on("stopped",this.onSpeakingStopped),!0},cleanup:function(){n.removeListener("stopped",this.onSpeakingStopped),n.removeListener("word",this.onWordWrapper)},stop:function(){this.cleanup()},update:function(){return this.status!==e.IN_PROGRESS&&this.cleanup(),this.status}}),r.addBehavior(module);
|
||||
1
node_modules/jibo/lib/behaviors/text-to-speech.js
generated
vendored
Normal file
1
node_modules/jibo/lib/behaviors/text-to-speech.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var t=function(t){return t&&t.__esModule?t["default"]:t},s=require("../bt/main"),e=s.Status,o=s.createBehavior,r=s.factory,n=t(require("../tts-service.js"));module.exports=o({constructor:function(t,s){var o=this;this.status=e.INVALID,this.words=t,this.onWordWrapper=function(t){s(t),"STOP"===t.status&&(o.status=e.SUCCEEDED)},this.onSpeakingStopped=function(){o.status=e.SUCCEEDED}},start:function(){var t=this;return this.status=e.IN_PROGRESS,n.speak(this.words,function(s){return s?(console.log("tts.speak() error: "+s),void(t.status=e.SUCCEEDED)):void 0}),n.on("word",this.onWordWrapper),n.on("stopped",this.onSpeakingStopped),!0},cleanup:function(){n.removeListener("stopped",this.onSpeakingStopped),n.removeListener("word",this.onWordWrapper)},stop:function(){this.cleanup()},update:function(){return this.status!==e.IN_PROGRESS&&this.cleanup(),this.status}}),r.addBehavior(module);
|
||||
1
node_modules/jibo/lib/bt/base.js
generated
vendored
Normal file
1
node_modules/jibo/lib/bt/base.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function t(t){var r;r=t.hasOwnProperty("constructor")?t.constructor:function(){};for(var s=Object.keys(t),e=0;e<s.length;e++){var i=s[e];"constructor"!==i&&(r.prototype[i]=t[i])}var a=function(){var t=Array.prototype.slice.call(arguments),s=t.shift(),e=Object.create(r.prototype);return r.apply(e,t),new o(s,e)};return a.getConstructor=function(){return r},a.getPrototype=function(){return r.prototype},a}function r(t){var r;r=t.hasOwnProperty("constructor")?t.constructor:function(){};for(var o=Object.keys(t),e=0;e<o.length;e++){var i=o[e];"constructor"!==i&&(r.prototype[i]=t[i])}var a=function(){var t=Array.prototype.slice.call(arguments),o=t.shift(),e=Object.create(r.prototype);return r.apply(e,t),new s(o,e)};return a.getConstructor=function(){return r},a.getPrototype=function(){return r.prototype},a}function s(t,r){var s=this;this.name=t,this.decorator=r,this.status=e.INVALID,this.decorator.getAssetPack=function(){return s.assetPack?s.assetPack:""},this.decorator.getEmitter=function(){return s.emitter},this.decorator.getBlackboard=function(){return s.blackboard},this.decorator.getName=function(){return t}}function o(t,r){var s=this;this.name=t,this.behavior=r,this.status=e.INVALID,this.behavior.getAssetPack=function(){return s.assetPack?s.assetPack:""},this.behavior.getEmitter=function(){return s.emitter},this.behavior.getBlackboard=function(){return s.blackboard},this.behavior.getName=function(){return t},this.behavior.getStatus=function(){return s.status}}var e={SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",INTERRUPTED:"INTERRUPTED",IN_PROGRESS:"IN_PROGRESS",INVALID:"INVALID",PAUSED:"PAUSED",WAIT:"WAIT"};s.prototype={start:function(){var t=this.decorator.start();return t?(this.status=e.IN_PROGRESS,t):(this.status=e.FAILED,t)},stop:function(){this.status=e.INTERRUPTED,this.decorator.stop()},update:function(t){return this.status=this.decorator.update(t),this.status}},o.prototype={setChildren:function(t){for(var r=0;r<t.length;r++)t.parent=this;this.behavior.children=t},setDecorators:function(t){this.decorators=t;for(var r=function(t){return function(){return t}}(this),s=0;s<this.decorators.length;s++)this.decorators[s].decorator.getBehavior=r;return this},start:function(){if(this.status===e.IN_PROGRESS)return!1;var t;if(this.waitDecorators=[],this.waitDecoratorsLength=0,this.decorators)for(var r=0;r<this.decorators.length;r++)if(t=this.decorators[r].start(),t===e.WAIT)this.waitDecorators.push(this.decorators[r]),this.waitDecoratorsLength++;else if(!t)return this.status=e.FAILED,this.stop(),!1;return 0===this.waitDecorators.length?(t=this.behavior.start(),this.status=t?e.IN_PROGRESS:e.FAILED,t||this.stop(),t):(this.status=e.IN_PROGRESS,!0)},stop:function(){this.decorators&&this.decorators.forEach(function(t){t.status===e.IN_PROGRESS&&t.stop()}),this.behavior.children&&this.behavior.children.forEach(function(t){t.status===e.IN_PROGRESS&&t.stop()}),this.status===e.IN_PROGRESS&&(this.status=e.INTERRUPTED,this.behavior.stop())},pause:function(){this.previousStatus=this.status,this.status=e.PAUSED},unpause:function(){this.status=this.previousStatus},update:function(){var t,r=0;if(this.waitDecoratorsLength>0){for(r=0;r<this.waitDecorators.length;r++)this.waitDecorators[r]&&(t=this.waitDecorators[r].update(this.status),t!==e.WAIT&&(this.waitDecoratorsLength--,this.waitDecorators[r]=null));if(0!==this.waitDecoratorsLength)return e.IN_PROGRESS;var s=this.behavior.start();this.status=s?e.IN_PROGRESS:e.FAILED,s||this.stop()}if(this.status===e.PAUSED){if(t=this.status,this.decorators)for(r=0;r<this.decorators.length;r++)if(t=this.decorators[r].update(this.status),t!==e.IN_PROGRESS)return this.stop(),t;return this.status}if(this.status===e.IN_PROGRESS){var o=this.behavior.update();if(o!==e.IN_PROGRESS&&(this.status=o,this.stop()),this.decorators)for(r=0;r<this.decorators.length;r++)if(o=this.decorators[r].update(this.status),o!==e.IN_PROGRESS)return this.stop(),this.status=o,this.status;return this.status}return this.status===e.SUCCEEDED?e.SUCCEEDED:e.FAILED}},module.exports.Status=e,module.exports.createBehavior=t,module.exports.createDecorator=r;
|
||||
1
node_modules/jibo/lib/bt/blackboard.js
generated
vendored
Normal file
1
node_modules/jibo/lib/bt/blackboard.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";module.exports={};
|
||||
1
node_modules/jibo/lib/bt/factory.js
generated
vendored
Normal file
1
node_modules/jibo/lib/bt/factory.js
generated
vendored
Normal 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 a=t[r];a.configurable=!0,a.value&&(a.writable=!0)}Object.defineProperties(e,t)}return function(t,r,a){return r&&e(t.prototype,r),a&&e(t,a),t}}(),r=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},a=e(require("pascal-case")),o=e(require("path")),s=require("events").EventEmitter,i=e(require("./blackboard")),n=e(require("callsite")),u=function(){function e(t,a,o,s,i){r(this,e),this.root=t,this.blackboard=a,this.notepad=o,this.result=s,this.emitter=i}return t(e,{status:{get:function(){return this.root.status}},start:{value:function(){return this.root.start()}},stop:{value:function(){this.root.stop()}},pause:{value:function(){this.root.pause()}},unpause:{value:function(){this.root.unpause()}},update:{value:function(){return this.root.update()}}}),e}(),c=function(){function e(){r(this,e),this.behaviors={}}return t(e,{addBehavior:{value:function(e,t){t=t||"";var r=a(o.parse(e.filename).name);this.behaviors[t+"-"+r]=e.exports,0===t.length&&(this.behaviors["core-"+r]=e.exports)}},create:{value:function(e){var t=void 0===arguments[1]?{}:arguments[1],r=void 0;if(e=e.substr(0,e.lastIndexOf(o.parse(e).ext)),o.isAbsolute(e))r=e;else{var a=n()[1].getFileName();r=o.join(a,"..",e)}var c=void 0;try{c=require(r)}catch(l){throw new Error(e+" is not a valid behavior tree")}var h=t.blackboard||i,v=t.notepad||{},d={},f=new s,p=c(h,v,d,f),b={},g=void 0,k=void 0,m=void 0,w=void 0,y=Object.keys(p),q="";for(g=0;g<y.length;g++){w=y[g],m=p[w],q=m["asset-pack"]||"","core"===m["asset-pack"]&&(q="");var x=this.behaviors[q+"-"+m["class"]];if(!x)throw new Error("The behavior "+m["class"]+" is not registered with the behavior factory");var E=m.args?[m.name].concat(m.args):[m.name];b[w]=x.apply(null,E),b[w].emitter=f,b[w].blackboard=h,t.assetPack&&(b[w].assetPack=t.assetPack)}var j={};for(g=0;g<y.length;g++)if(w=y[g],m=p[w],m.parent||(j[m.id]=!0),m.skipped)delete j[m.id];else{var O=b[m.id];if(m.children){var P=[];for(k=0;k<m.children.length;k++){var C=m.children[k],T=b[C];p[C].skipped||(T.parent=O,P.push(T))}O.setChildren(P)}if(m.decorators){var _=[];for(k=0;k<m.decorators.length;k++){var A=b[m.decorators[k]];delete j[m.decorators[k]],p[m.decorators[k]].skipped||_.push(A)}_.length>0&&O.setDecorators(_)}}var B=b[Object.keys(j)[0]];return new u(B,i,v,d,f)}}}),e}();module.exports=new c;
|
||||
1
node_modules/jibo/lib/bt/main.js
generated
vendored
Normal file
1
node_modules/jibo/lib/bt/main.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";module.exports.createBehavior=require("./base").createBehavior,module.exports.createDecorator=require("./base").createDecorator,module.exports.factory=require("./factory"),module.exports.Status=require("./base").Status,module.exports.behaviors={},module.exports.behaviors.TimeoutSucceed=require("../behaviors/base/timeout-succeed"),module.exports.behaviors.TimeoutSucceedJS=require("../behaviors/base/timeout-succeed-js"),module.exports.behaviors.TimeoutJS=require("../behaviors/base/timeout-js"),module.exports.behaviors.TimeoutFail=require("../behaviors/base/timeout-fail"),module.exports.behaviors.FailOnCondition=require("../behaviors/base/fail-on-condition"),module.exports.behaviors.SucceedOnCondition=require("../behaviors/base/succeed-on-condition"),module.exports.behaviors.WhileCondition=require("../behaviors/base/while-condition"),module.exports.behaviors.ExecuteScript=require("../behaviors/base/execute-script"),module.exports.behaviors.Null=require("../behaviors/base/null"),module.exports.behaviors.Sequence=require("../behaviors/base/sequence"),module.exports.behaviors.Parallel=require("../behaviors/base/parallel"),module.exports.behaviors.Random=require("../behaviors/base/random"),module.exports.behaviors.Switch=require("../behaviors/base/switch"),module.exports.behaviors.Case=require("../behaviors/base/case"),module.exports.behaviors.ExecuteScriptAsync=require("../behaviors/base/execute-script-async"),module.exports.behaviors.StartOnCondition=require("../behaviors/base/start-on-condition"),module.exports.behaviors.SucceedOnEvent=require("../behaviors/base/succeed-on-event"),module.exports.addAllBehaviors=function(){module.exports.behaviors.Blink=require("../behaviors/blink"),module.exports.behaviors.Listen=require("../behaviors/listen"),module.exports.behaviors.LookAt=require("../behaviors/look-at"),module.exports.behaviors.PlayAnimation=require("../behaviors/play-animation"),module.exports.behaviors.PlayAudio=require("../behaviors/play-audio"),module.exports.behaviors.StartOnEvent=require("../behaviors/start-on-event"),module.exports.behaviors.StartOnAnimEvent=require("../behaviors/start-on-anim-event"),module.exports.behaviors.Subtree=require("../behaviors/subtree"),module.exports.behaviors.SubtreeJs=require("../behaviors/subtree-js"),module.exports.behaviors.SucceedOnListen=require("../behaviors/succeed-on-listen"),module.exports.behaviors.TextToSpeech=require("../behaviors/text-to-speech"),module.exports.behaviors.TextToSpeechJs=require("../behaviors/text-to-speech-js"),module.exports.behaviors.TakePhoto=require("../behaviors/take-photo"),module.exports.behaviors.ListenEmbedded=require("../behaviors/listen-embedded"),module.exports.behaviors.SucceedOnEmbedded=require("../behaviors/succeed-on-embedded"),module.exports.behaviors.ReadBarcode=require("../behaviors/read-barcode"),module.exports.behaviors.ListenJs=require("../behaviors/listen-js"),module.exports.behaviors.SucceedOnListenJs=require("../behaviors/succeed-on-listen-js")};
|
||||
1
node_modules/jibo/lib/get-asset-uri.js
generated
vendored
Normal file
1
node_modules/jibo/lib/get-asset-uri.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},r=e(require("path")),n=e(require("./get-project-root"));module.exports=function(e,o,i){var t=e.split("://");if(o&&o.length>0){var u=r.join(require.resolve(o+"/package.json"),".."),a=e,l=r.join(u,a);i(l,u)}else if(1==t.length)!function(){var o=e;n(function(e){var n=r.join(e,o);i(n,e)})}();else if(2===t.length||o){var a=t[1],s=t[0],u=r.join(require.resolve(s+"/package.json"),".."),l=r.join(u,a);i(l,u)}};
|
||||
1
node_modules/jibo/lib/get-base-directory.js
generated
vendored
Normal file
1
node_modules/jibo/lib/get-base-directory.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},r=e(require("path")),n=e(require("fs")),u=function(e,a){n.readdir(e,function(n,o){for(var t=!1,i=0;i<o.length;i++)"package.json"===r.parse(o[i]).base&&(t=!0,a(e,require(r.join(e,o[i])).name));t||u(r.resolve(e,".."),a)})};module.exports=u;
|
||||
1
node_modules/jibo/lib/get-project-root.js
generated
vendored
Normal file
1
node_modules/jibo/lib/get-project-root.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(e){return e&&e.__esModule?e["default"]:e},r=e(require("path")),t=e(require("./get-base-directory")),a=void 0;module.exports=function(e){if(a)e(a);else{for(var i=module;i.parent;)i=i.parent;var u=r.parse(i.filename).dir;t(u,e)}};
|
||||
1
node_modules/jibo/lib/lps-service.js
generated
vendored
Normal file
1
node_modules/jibo/lib/lps-service.js
generated
vendored
Normal 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 o=e[i];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(t,e)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=t(require("async")),a={DEBUG:0,PREVIEW:1,FULL:2},s=function(){function t(){i(this,t),this.lps={},this.lps.motionData={cameras:[],entities:[]},this.lps.audioData={entities:[]},this.PhotoType=a}return e(t,{getMotionData:{value:function(){return console.warn("DEPRECATED! Please use specific visual entity APIs (getClosestVisualEntity/getVisualEntityById)."),this.lps.motionData}},getClosestVisualEntity:{value:function(){var t=void 0;return void 0!==this.lps.motionData&&void 0!==this.lps.motionData.entities&&this.lps.motionData.entities.length>0&&(t=this.lps.motionData.entities[0]),t}},getVisualEntityById:{value:function(t){for(var e=void 0,i=0;i<this.lps.motionData.entities.length;i++){var o=this.lps.motionData.entities[i];if(o&&o.id===t){e=o;break}}return e}},getClosestAudibleEntity:{value:function(){var t=void 0;return void 0!==this.lps.audioData&&void 0!==this.lps.audioData.entities&&this.lps.audioData.entities.length>0&&(t=this.lps.audioData.entities[0]),t}},getAudibleEntityById:{value:function(t){for(var e=void 0,i=0;i<this.lps.audioData.entities.length;i++){var o=this.lps.audioData.entities[i];if(o&&o.id===t){e=o;break}}return e}},readBarcode:{value:function(t){if(void 0===this.httpUrl)return void t("Barcode service is not initialized",null);var e=new XMLHttpRequest;e.open("GET",this.httpUrl+"/barcode",!0),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status)if(e.response){var i=JSON.parse(e.response);t(null,i.barcodes)}else t("No data received from barcode service",null);else 4==e.readyState&&404==e.status&&t("Barcode service is unavailable",null)},e.send()}},takePhoto:{value:function(t,e){var i=this;if(void 0===this.httpUrl)return void e("Photo service is not initialized",null);(t<this.PhotoType.DEBUG||t>this.PhotoType.FULL)&&(t=this.PhotoType.FULL);var o={camera:0,type:t},a=this.httpUrl+"/photo";!function(){var t=new XMLHttpRequest;t.open("POST",a,!0),t.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.setRequestHeader("Accept","*/*"),t.onreadystatechange=function(){if(4==t.readyState)if(200===t.status)if(t.response){var o=JSON.parse(t.response);i._getPhoto(o.id,e)}else e("No data received from photo service",null);else 404==t.status&&e("Photo service unavailable",null)},t.send(JSON.stringify(o))}()}},_getPhoto:{value:function(t,e){var i=this.httpUrl+"/photo?id="+t;e(null,i)}},init:{value:function(t,e){this.lpsServiceUrl="ws:"+t.host+":"+t.port,this.httpUrl="http://"+t.host+":"+t.port,o.parallel([this._createMotionSocket.bind(this),this._createAudioSocket.bind(this)],e)}},_createMotionSocket:{value:function(t){var e=this;this.motionSocket=new WebSocket(this.lpsServiceUrl+"/visual_awareness"),this.motionSocket.onerror=function(){console.error("Error opening visual awareness socket at "+e.lpsServiceUrl+"/visual_awareness")},this.motionSocket.onmessage=function(t){e.lps.motionData=JSON.parse(t.data)},t()}},_createAudioSocket:{value:function(t){var e=this;this.audioSocket=new WebSocket(this.lpsServiceUrl+"/audible_awareness"),this.audioSocket.onerror=function(){console.error("Error opening audible awareness socket at "+e.lpsServiceUrl+"/audible_awareness")},this.audioSocket.onmessage=function(t){e.lps.audioData=JSON.parse(t.data)},t()}}}),t}();module.exports=new s;
|
||||
1
node_modules/jibo/lib/main.js
generated
vendored
Normal file
1
node_modules/jibo/lib/main.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var GLOBAL="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:window;function n(n){if(p.existsSync(n)){var t=require(n);if(t.jibo&&"asset-pack"===t.jibo.type){var i=f.resolve(f.parse(n).dir,t.main);return require(i)}}}function t(n){var t=void 0,i=void 0;d.series([function(n){g.on("set-registry-host",function(i){"string"==typeof i||i instanceof String?t=i:(t=i.registryHost,i.token&&(A.token=i.token,console.warn("Session Token = "+A.token))),n()})},function(n){var e=new XMLHttpRequest;e.timeout=2e3,e.onreadystatechange=function(){4===e.readyState&&200===e.status?(i=JSON.parse(e.responseText),i.records&&(i=i.records,i.sort(function(n,t){return"system-manager"===n.name?-1:"system-manager"===t.name?1:-1})),n()):4===e.readyState&&0===e.status&&n("Could not find registry service at "+t)},e.open("GET",t,!0),e.send(null)},function(){var t=[];i.forEach(function(n){var i=k[n.name];"system-manager"===n.name&&(i=k.systemManager),i&&t.push(function(t){i(n,t)})}),d.parallel(t,function(t,i){t?(console.error("Error: "+t),n(t)):n(null,i)})}],function(t,i){t?(console.error("Error: "+t),n(t)):n(null,i)}),g.send("get-registry-host")}function i(n){m(O.animate,n)}function e(n){if(GLOBAL.isInitializing||GLOBAL.isInitialized)throw new Error("Jibo Singleton may only be initialized once.");GLOBAL.isInitializing=!0,d.series({initAnimate:i,initNetwork:t},function(t){if(t){var i='<div style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:999999;background:#a7a7a7;text-align:center;">';i+='<span style="position:absolute;top:250px;left:0px;font-size:44px;font-weight:bold;font-family:Arial;color:#c50000;padding:20px;">'+t+"</span>",i+="</div>",document.body.innerHTML+=i,n(t)}else y.addAllBehaviors(),GLOBAL.isInitialized=!0,n()})}function r(n){return"function"!=typeof n?new Promise(function(n,t){e(function(i){i?t(i):n()})}):void e(n)}var o=function(n){return n&&n.__esModule?n["default"]:n},s=require("animation-utilities"),a=s.body,u=s.LEDOutput,c=s.animate,l=s.visualize,f=o(require("path")),p=o(require("fs")),d=o(require("async")),g=o(require("ipc")),m=o(require("./api/animate")),y=o(require("./bt/main")),v=o(require("./lps-service")),L=o(require("./tts-service")),b=o(require("./nli-service")),q=o(require("./asr/asr-service")),h=o(require("./non-motion-bs")),S=o(require("./system-manager")),A=o(require("./session-manager")),O={init:r,requireAssetPack:n,animate:c.createAnimationUtilities(),visualize:l,asr:q,bt:y,nlu:b,systemManager:S,lps:v,tts:L,bodySettings:h};GLOBAL.jibo||(GLOBAL.jibo=O,GLOBAL.isInitialized=!1,GLOBAL.isInitializing=!1);var k={tts:function(n,t){L.init(n,t)},lps:function(n,t){v.init(n,t)},body:function(n){var t=function(t,i){return n.apply(this,arguments)};return t.toString=function(){return n.toString()},t}(function(n,t){var i="ws:"+n.host+":"+n.port,e=new a.BodyPosVelOutput(l.timeline.getClock(),l.robotInfo,i,!0,33);l.timeline.addOutput(e,null);var r=new u(l.timeline.getClock(),l.robotInfo,i,!0,33);l.timeline.addOutput(r,null),h.init(n,t)}),nlu:function(n){var t=function(t,i){return n.apply(this,arguments)};return t.toString=function(){return n.toString()},t}(function(n,t){b.init(n,t)}),asr:function(n){var t=function(t,i){return n.apply(this,arguments)};return t.toString=function(){return n.toString()},t}(function(n,t){q.init(n,t)}),systemManager:function(n){var t=function(t,i){return n.apply(this,arguments)};return t.toString=function(){return n.toString()},t}(function(n,t){S.init(n,t)})};module.exports=GLOBAL.jibo;
|
||||
1
node_modules/jibo/lib/nli-service.js
generated
vendored
Normal file
1
node_modules/jibo/lib/nli-service.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e=function(){function e(e,t){for(var n in t){var o=t[n];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(e,t)}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),t=function l(e,t,n){var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var s=Object.getPrototypeOf(e);return null===s?void 0:l(s,t,n)}if("value"in o&&o.writable)return o.value;var r=o.get;if(void 0!==r)return r.call(n)},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)},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s=require("events").EventEmitter,r=function(s){function r(){o(this,r),t(Object.getPrototypeOf(r.prototype),"constructor",this).call(this)}return n(r,s),e(r,{init:{value:function(e,t){this.httpInterface="http://"+e.host+":"+e.port,this.loggingEnabled=!1,t()}},compile:{value:function(e,t){var n=this,o={REQ_TYPE:"COMPILE",REQ_CONTENT:{RULE_STRING:e}},s=new XMLHttpRequest;o=JSON.stringify(o),s.open("POST",this.httpInterface+"/nlu_interface",!0),s.onreadystatechange=function(){if(4==s.readyState&&200==s.status){var e=JSON.parse(s.response);if(n.loggingEnabled&&(console.log("request.response"),console.log(s.response)),"OK"===e.Status){var o=e.URI;t(null,o)}else"ERROR"===e.Status&&t(e.Message)}else 4==s.readyState&&0===s.status&&t("NLU Service is unavailable")},this.loggingEnabled&&(console.log("body"),console.log(o)),s.send(o)}},parseFromRule:{value:function(e,t,n){var o=this;t=t.toLowerCase();var s={REQ_TYPE:"PARSE_FROM_TEXT",REQ_CONTENT:{RULE_STRING:e,TXT_STRING:t}},r=new XMLHttpRequest;s=JSON.stringify(s),r.open("POST",this.httpInterface+"/nlu_interface",!0),r.onreadystatechange=function(){if(4==r.readyState&&200==r.status){var e=JSON.parse(r.response);if(o.loggingEnabled&&(console.log("request.response"),console.log(r.response)),"OK"===e.Status){var s=e.Result.length>0?e.Result[0]:{Input:t};n(null,s)}else"ERROR"===e.Status&&n(e.Message)}else 4==r.readyState&&0===r.status&&n("NLU Service is unavailable")},this.loggingEnabled&&(console.log("body"),console.log(s)),r.send(s)}},parseFromURI:{value:function(e,t,n){var o=this;t=t.toLowerCase();var s={REQ_TYPE:"PARSE_FROM_URI",REQ_CONTENT:{URI:e,TXT_STRING:t}},r=new XMLHttpRequest;s=JSON.stringify(s),r.open("POST",this.httpInterface+"/nlu_interface",!0),r.onreadystatechange=function(){if(4==r.readyState&&200==r.status){var e=JSON.parse(r.response);if(o.loggingEnabled&&(console.log("request.response"),console.log(r.response)),"OK"===e.Status){var s=e.Result.length>0?e.Result[0]:{Input:t};n(null,s)}else"ERROR"===e.Status&&n(e.Message)}else 4==r.readyState&&0===r.status&&n("NLU Service is unavailable")},this.loggingEnabled&&(console.log("body"),console.log(s)),r.send(s)}},setLogging:{value:function(e){this.loggingEnabled=e}},parseFromFile:{value:function(){}}}),r}(s),a=new r;module.exports=a;
|
||||
1
node_modules/jibo/lib/non-motion-bs.js
generated
vendored
Normal file
1
node_modules/jibo/lib/non-motion-bs.js
generated
vendored
Normal 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 s in e){var o=e[s];o.configurable=!0,o.value&&(o.writable=!0)}Object.defineProperties(t,e)}return function(e,s,o){return s&&t(e.prototype,s),o&&t(e,o),e}}(),s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},o=t(require("async")),r=function(){function t(){s(this,t),this.bs={},this.bs.miscState={ts:[],main_board_temp:0,cpu_temp:0,intake_temp:0,exhaust_temp:0,neck_motor_temp:0,torso_motor_temp:0,pelvis_motor_temp:0},this.bs.touchState={ts:[],touched:!1,pad_state:[0,0,0,0,0,0],changed:[0,0,0,0,0,0]},this.bs.powerState={ts:[],source:"",vsys:0,battery:{id:0,cycles:0,capacity:0,max_capacity:0,charge_rate:0,temp:0}}}return e(t,{init:{value:function(t,e){this.httpInterface="http://"+t.host+":"+t.port,this.socketUrl="ws:"+t.host+":"+t.port,o.parallel([this.createMiscSocket.bind(this),this.createTouchSocket.bind(this),this.createPowerSocket.bind(this)],e)}},getBatteryTemperature:{value:function(){return this.bs.powerState.battery.temp}},getBatteryLevel:{value:function(){return this.bs.powerState.battery.capacity/this.bs.powerState.battery.max_capacity*100}},getSystemVoltage:{value:function(){return this.bs.powerState.vsys}},isBatteryCharging:{value:function(){return"EXTERNAL"===this.bs.powerState.source}},getMainBoardTemperature:{value:function(){return this.bs.miscState.main_board_temp}},getCPUTemperature:{value:function(){return this.bs.miscState.cpu_temp}},getFanSpeed:{value:function(t){this._getSystemSetting("fan_speed",t)}},getBacklight:{value:function(t){this._getSystemSetting("lcd_backlight",t)}},_getSystemSetting:{value:function(t,e){if(void 0===this.httpInterface)return void e("Body Service is not available",null);var s=new XMLHttpRequest;s.open("GET",this.httpInterface+"/settings",!0),s.onreadystatechange=function(){if(4==s.readyState&&200==s.status)if(s.response){var o=JSON.parse(s.response);e(null,o[t])}else e("No data received from body service",null);else 4==s.readyState&&404==s.status&&e("Body service is unavailable",null)},s.send()}},setBacklight:{value:function(t,e){var s=this;if(0>t||t>1){var o="Backlight brightness value of "+t+" is out of range [0.0 - 1.0].";return void e(o)}this.getFanSpeed(function(o,r){o?e(o):!function(){var o={lcd_backlight:t,fan_speed:r},a=new XMLHttpRequest,n=s.httpInterface+"/settings";a.open("POST",n,!0),a.onreadystatechange=function(){4==a.readyState&&(204==a.status?e(null):404==a.status?e("Body service is unavailable"):400===a.status&&e("Bad request sent to "+n))},a.send(JSON.stringify(o))}()})}},createMiscSocket:{value:function(t){var e=this;this.MiscSocket=new WebSocket(this.socketUrl+"/misc"),this.MiscSocket.onerror=function(){console.error("Error opening misc state socket at "+e.socketUrl+"/misc")},this.MiscSocket.onmessage=function(t){e.bs.miscState=JSON.parse(t.data)},t()}},createTouchSocket:{value:function(t){var e=this;this.TouchSocket=new WebSocket(this.socketUrl+"/touch"),this.TouchSocket.onerror=function(){console.error("Error opening touch state socket at "+e.socketUrl+"/touch")},this.TouchSocket.onmessage=function(t){e.bs.touchState=JSON.parse(t.data)},t()}},createPowerSocket:{value:function(t){var e=this;this.PowerSocket=new WebSocket(this.socketUrl+"/power"),this.PowerSocket.onerror=function(){console.error("Error opening power state socket at "+e.socketUrl+"/power")},this.PowerSocket.onmessage=function(t){e.bs.powerState=JSON.parse(t.data)},t()}}}),t}();module.exports=new r;
|
||||
1
node_modules/jibo/lib/session-manager.js
generated
vendored
Normal file
1
node_modules/jibo/lib/session-manager.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var e={token:"abcdef"};module.exports=e;
|
||||
1
node_modules/jibo/lib/system-manager.js
generated
vendored
Normal file
1
node_modules/jibo/lib/system-manager.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/jibo/lib/tts-service.js
generated
vendored
Normal file
1
node_modules/jibo/lib/tts-service.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/jibo/lib/utils/utils.js
generated
vendored
Normal file
1
node_modules/jibo/lib/utils/utils.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";module.exports={getOptionsAndCallback:function(o,t){var e={},i=void 0;return void 0===o&&void 0===t?e={}:"object"==typeof o&&void 0===t?e=o:"function"==typeof o&&void 0===t?i=o:"object"==typeof o&&"function"==typeof t&&(e=o,i=t),{options:e,callback:i}}};
|
||||
21
node_modules/jibo/package.json
generated
vendored
Normal file
21
node_modules/jibo/package.json
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "jibo",
|
||||
"version": "0.9.2",
|
||||
"description": "jibo api",
|
||||
"platform": ">=0.7.0",
|
||||
"main": "lib/main.js",
|
||||
"scripts": {
|
||||
"test": "gulp test"
|
||||
},
|
||||
"dependencies": {
|
||||
"animation-utilities": "0.2.14",
|
||||
"async": "^1.5.2",
|
||||
"callsite": "^1.0.0",
|
||||
"jibo-keyframes": "0.4.5",
|
||||
"pascal-case": "^1.1.1",
|
||||
"semver": "^5.0.3",
|
||||
"uuid": "^2.0.1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "SEE LICENSE IN LICENSE.txt"
|
||||
}
|
||||
189
node_modules/jibo/schema/schema-base.json
generated
vendored
Normal file
189
node_modules/jibo/schema/schema-base.json
generated
vendored
Normal file
@@ -0,0 +1,189 @@
|
||||
{
|
||||
"TimeoutSucceed": {
|
||||
"description": "Forces a behavior to succeed after a given number of milliseconds.",
|
||||
"type": "decorator",
|
||||
"args": ["int"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getTimeout",
|
||||
"description": "Enter the number of milliseconds until forced success."
|
||||
}
|
||||
]
|
||||
},
|
||||
"TimeoutSucceedJs": {
|
||||
"description": "Uses JavaScript to force a behavior to succeed after a given number of milliseconds.",
|
||||
"type": "decorator",
|
||||
"args": ["Function"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getTimeout",
|
||||
"description": "Return the number of milliseconds until forced success.",
|
||||
"defaultValue": "() => {\n return 0;\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"TimeoutJs": {
|
||||
"description": "Succeeds after a given number of dynamically-calculated milliseconds.",
|
||||
"type": "leaf",
|
||||
"args": ["Function"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getTimeout",
|
||||
"description": "Return the number of milliseconds until forced success.",
|
||||
"defaultValue": "() => {\n return 0;\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"TimeoutFail": {
|
||||
"description": "Forces a behavior to fail after a given number of milliseconds.",
|
||||
"type": "decorator",
|
||||
"args": ["int"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getTimeout",
|
||||
"description": "Enter the number of milliseconds until forced failure."
|
||||
}
|
||||
]
|
||||
},
|
||||
"FailOnCondition": {
|
||||
"description": "Forces a behavior to fail if specified condition returns false.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "initVars",
|
||||
"description": "Initialize optional variables for the condition below."
|
||||
},
|
||||
{
|
||||
"field": "condition",
|
||||
"description": "Return true when you want behavior to fail."
|
||||
}
|
||||
]
|
||||
},
|
||||
"Case": {
|
||||
"description": "Use under Switch statements to specify when a behavior should execute and when it should fail.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "condition",
|
||||
"description": "Return false for conditions under which behavior should fail."
|
||||
}
|
||||
]
|
||||
},
|
||||
"SucceedOnCondition": {
|
||||
"description": "Forces a behavor to succeed if its conditional function returns true.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "initVars",
|
||||
"description": "Initialize optional variables for the condition below."
|
||||
},
|
||||
{
|
||||
"field": "condition",
|
||||
"description": "Return true when you want behavior to succeed."
|
||||
}
|
||||
]
|
||||
},
|
||||
"StartOnCondition": {
|
||||
"description": "Prevents a behavior from starting until its conditional function returns true.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "initVars",
|
||||
"description": "Initialize optional variables for the condition below."
|
||||
},
|
||||
{
|
||||
"field": "condition",
|
||||
"description": "Return true when you want component to start."
|
||||
}
|
||||
]
|
||||
},
|
||||
"WhileCondition": {
|
||||
"description": "Repeats a behavior until its conditional function returns false.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "initVars",
|
||||
"description": "Initialize optional variables for the condition below."
|
||||
},
|
||||
{
|
||||
"field": "condition",
|
||||
"description": "Repeat behavior as long as condition return true.",
|
||||
"defaultValue": "() => {\n return true;\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ExecuteScript": {
|
||||
"description": "Synchronously executes arbitrary JavaScript. Use ExecuteScriptAsync for asynchronous calls.",
|
||||
"type": "leaf",
|
||||
"args": ["Function"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "execScript",
|
||||
"description": "Enter function that will execute once and then succeed."
|
||||
}
|
||||
]
|
||||
},
|
||||
"ExecuteScriptAsync": {
|
||||
"description": "Asynchronously executes arbitrary JavaScript. Will not succeed until the callback is called.",
|
||||
"type": "leaf",
|
||||
"args": ["Function"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "execScript",
|
||||
"description": "Behavior will succeed when succeed is called, fail when fail is called.",
|
||||
"defaultValue": "(succeed, fail) => {\n succeed();\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Null": {
|
||||
"description": "This behavior never succeeds or fails. It will remain 'in progress' indefinitely. It must be decorated in order to succeed or fail.",
|
||||
"type": "leaf",
|
||||
"args": []
|
||||
},
|
||||
"Sequence": {
|
||||
"description": "This behavior plays its children in order from top to bottom. If one child fails, this behavior will fail. If all its children succeed ,this behavor will succeed.",
|
||||
"type": "composite",
|
||||
"args": []
|
||||
},
|
||||
"Parallel": {
|
||||
"description": "This behavior starts all of its children at the same time. This behavior will return success by default when all of its children have succeeded, or, if told to succeed on one, will succeed upon success of any child.",
|
||||
"type": "composite",
|
||||
"args": ["boolean"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "succeedOnOne",
|
||||
"description": "Set to True to force parallel to succeed as soon as one of its children succeeds.",
|
||||
"defaultValue": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"Switch": {
|
||||
"description": "Attempts to execute its children in order from top to bottom until one child succeeds. This behavior always succeeds regardless of whether any children succeed. Use this behavior with Case decorators for branching.",
|
||||
"type": "composite",
|
||||
"args": []
|
||||
},
|
||||
"Random": {
|
||||
"description": "Chooses one of its children randomly. Succeeds if that child succeeds and fails otherwise.",
|
||||
"type": "composite",
|
||||
"args": []
|
||||
}
|
||||
}
|
||||
414
node_modules/jibo/schema/schema.json
generated
vendored
Normal file
414
node_modules/jibo/schema/schema.json
generated
vendored
Normal file
@@ -0,0 +1,414 @@
|
||||
{
|
||||
"Subtree": {
|
||||
"description": "Executes a behavior tree (.bt) as a single behavior and returns the status of the subtree.",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"Subtree",
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "fileName",
|
||||
"description": "Select a subtree.",
|
||||
"defaultValue": "null"
|
||||
},
|
||||
{
|
||||
"field": "getNotepad",
|
||||
"description": "Enter optional information to return an object that will be this tree's notepad.",
|
||||
"defaultValue": "() => {\n return {};\n}"
|
||||
},
|
||||
{
|
||||
"field": "setResult",
|
||||
"description": "Enter optional code that will be called with the subtree's results with the subtree is done.",
|
||||
"defaultValue": "(treeResult) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SubtreeJs": {
|
||||
"description": "Dynamically executes a behavior tree (.bt) as a single behavior. This behavior returns the status of the subtree.",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getFilename",
|
||||
"description": "Specify a subtree.",
|
||||
"defaultValue": "(callback) => {\n}"
|
||||
},
|
||||
{
|
||||
"field": "getNotepad",
|
||||
"description": "Enter optional information to return an object that will be this tree's notepad.",
|
||||
"defaultValue": "() => {\n return {};\n}"
|
||||
},
|
||||
{
|
||||
"field": "setResult",
|
||||
"description": "Enter optional code that will be called with the subtree's results with the subtree is done.",
|
||||
"defaultValue": "(treeResult) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"PlayAnimation": {
|
||||
"description": "Plays an animation file (.keys). Succeeds when the animation is finished.",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"Animation",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "fileName",
|
||||
"description": "Select the animation file to play.",
|
||||
"defaultValue": "null"
|
||||
},
|
||||
{
|
||||
"field": "animModifier",
|
||||
"description": "Enter optional code to modify the animation's playback.",
|
||||
"defaultValue": "(animation) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"PlayAudio": {
|
||||
"description": "Plays a single audio source. The audio format is any format supported by HTML5 audio. Succeeds when the audio file is finished playing",
|
||||
"type": "leaf",
|
||||
"args": ["Audio"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "path",
|
||||
"description": "Enter the audio file path.",
|
||||
"defaultValue": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"LookAt": {
|
||||
"description": "Creates body and eye animations for looking at a point in 3D space",
|
||||
"type": "leaf",
|
||||
"args": ["Function",
|
||||
"boolean",
|
||||
"Function"],
|
||||
"meta": [
|
||||
{
|
||||
"field": "target",
|
||||
"description": "Return the x, y, and z coordinates Jibo should look at.",
|
||||
"defaultValue": "() => {\n return {x: 0, y: 0, z: 0};\n}"
|
||||
},
|
||||
{
|
||||
"field": "lookAtMode",
|
||||
"description": "True for continuous mode look at. False for single-shot look at.",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"field": "lookAtModifier",
|
||||
"description": "Enter optional code to modify the lookAt behavior.",
|
||||
"defaultValue": "(lookAt) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Blink": {
|
||||
"description": "Animates Jibo's eye to blink once.",
|
||||
"type": "leaf",
|
||||
"args": [],
|
||||
"meta": []
|
||||
},
|
||||
"TextToSpeech": {
|
||||
"description": "Creates speech output for Jibo.",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"SSML",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "words",
|
||||
"description": "Enter text for Jibo to say. Takes plain text or SSML markup.",
|
||||
"defaultValue": "Hello"
|
||||
},
|
||||
{
|
||||
"field": "onWord",
|
||||
"description" : "Enter optional code to execute each time Jibo says a single word.",
|
||||
"defaultValue": "(word) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"TextToSpeechJs": {
|
||||
"description": "Dynamically creates speech output for Jibo.",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getWords",
|
||||
"description": "Return what you want Jibo to say.",
|
||||
"defaultValue": "(callback) => {\n callback('Hello');\n}"
|
||||
},
|
||||
{
|
||||
"field": "onWord",
|
||||
"description": "Enter optional code to execute each time Jibo says a single word.",
|
||||
"defaultValue": "(word) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"StartOnAnimEvent": {
|
||||
"description": "Prevents the behavior it's decorating from starting until a specified event is received from an animation.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"string",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "eventName",
|
||||
"description": "Specify the event name (set on the animation's Event Layer) on which the animation should start."
|
||||
},
|
||||
{
|
||||
"field": "onReceived",
|
||||
"description": "Enter optional code to execute after the event is received but before the behavior starts.",
|
||||
"defaultValue": "(animFileName, payload) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"StartOnEvent": {
|
||||
"description": "Prevents behavior it's decorating from starting until specified event is received from the global emitter.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"string",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "eventName",
|
||||
"description": "Specify the event name you want to listen for the component to start."
|
||||
},
|
||||
{
|
||||
"field": "onReceived",
|
||||
"description": "This function is called after the event was received but before the component starts.",
|
||||
"defaultValue": "() => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SucceedOnEvent": {
|
||||
"description": "Forces the behavior it's decorating to succeed when an event is received from the global emitter.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"string",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "eventName",
|
||||
"description": "Specify the event name you want to listen for the component to start."
|
||||
},
|
||||
{
|
||||
"field": "onReceived",
|
||||
"description": "This function is called after the event was received along with any payload.",
|
||||
"defaultValue": "() => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SucceedOnEmbedded": {
|
||||
"description": "Succeeds a behavior upon hearing a built-in listening rule.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
["enum",
|
||||
{
|
||||
"label": "Hey Jibo",
|
||||
"display": "Hey Jibo",
|
||||
"value": "hey_jibo"
|
||||
}
|
||||
],
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "ruleName",
|
||||
"description": "Specify the name of the embedded rule you want to listen for (hey_jibo).",
|
||||
"defaultValue": "hey_jibo"
|
||||
},
|
||||
{
|
||||
"field": "getListener",
|
||||
"description": "(listener), event emitter for hey-jibo (asr, spkr) and error events.",
|
||||
"defaultValue": "(listener) => {\n\tlistener.on('hey-jibo', (asrResult, speakerIds) => {\n\n\t});\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ListenEmbedded": {
|
||||
"description": "Listens only for an embedded rule (hey_jibo)",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
["enum",
|
||||
{
|
||||
"label": "Hey Jibo",
|
||||
"display": "Hey Jibo",
|
||||
"value": "hey_jibo"
|
||||
}
|
||||
],
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "ruleName",
|
||||
"description": "Specify the name of the embedded rule you want to listen for (hey_jibo).",
|
||||
"defaultValue": "hey_jibo"
|
||||
},
|
||||
{
|
||||
"field": "getListener",
|
||||
"description": "(listener), event emitter for hey-jibo (asr, spkr) and error events.",
|
||||
"defaultValue": "(listener) => {\n\tlistener.on('hey-jibo', (asrResult, speakerIds) => {\n\n\t});\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Listen": {
|
||||
"description": "Tells Jibo to listen for auditory input using Natural Language Understanding (NLU).",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"Function",
|
||||
"Rule",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getOptions",
|
||||
"description": "Set the dictionary of options that will be returned for the listening task.",
|
||||
"defaultValue": "() => {\n let options = {\n heyJibo: false,\n detectEnd: false,\n incremental: false,\n authenticateSpeaker: ''\n }\n return options;\n}"
|
||||
},
|
||||
{
|
||||
"field": "ruleFile",
|
||||
"description": "Specify the file path for the rule to use to parse Listen results.",
|
||||
"defaultValue": "null"
|
||||
},
|
||||
{
|
||||
"field": "getListener",
|
||||
"description": "Enter code to execute when Jibo has heard input. (listener), event emitter for hey-jibo (asr, spkr) and timeout() events.",
|
||||
"defaultValue": "(listener) => {\n listener.on('cloud', (asrResult, speakerIds) => {\n\n });\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SucceedOnListen": {
|
||||
"description": "Succeeds a behavior upon hearing a custom Natural Language Understand (NLU) rule.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"Function",
|
||||
"Rule",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getOptions",
|
||||
"description": "Set the dictionary of options that will be returned for the listening task.",
|
||||
"defaultValue": "() => {\n let options = {\n heyJibo: false,\n detectEnd: false,\n incremental: false,\n authenticateSpeaker: ''\n }\n return options;\n}"
|
||||
},
|
||||
{
|
||||
"field": "ruleFile",
|
||||
"description": "Specify the file path for the rule to use to parse Listen results.",
|
||||
"defaultValue": "null"
|
||||
},
|
||||
{
|
||||
"field": "getListener",
|
||||
"description": "Enter code to execute when Jibo has heard input. (listener), event emitter for hey-jibo (asr, spkr) and timeout() events.",
|
||||
"defaultValue": "(listener) => {\n listener.on('cloud', (asrResult, speakerIds) => {\n\n });\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ListenJs": {
|
||||
"description": "Tells Jibo to listen for auditory input using Natural Language Understanding (NLU).",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getOptions",
|
||||
"description": "Set the dictionary of options that will be returned for the listening task.",
|
||||
"defaultValue": "() => {\n let options = {\n heyJibo: false,\n detectEnd: false,\n incremental: false,\n authenticateSpeaker: ''\n }\n return options;\n}"
|
||||
},
|
||||
{
|
||||
"field": "getRule",
|
||||
"description": "Pass a custom listening rule into the callback.",
|
||||
"defaultValue": "(callback) => {\n callback(\"TopRule = $* Hello World $*;\");\n}"
|
||||
},
|
||||
{
|
||||
"field": "getListener",
|
||||
"description": "Enter code to execute when Jibo has heard input. (listener), event emitter for cloud (asr, spkr), hey-jibo (asr, spkr), timeout (), incremental (asr, stop()), and end-of-speech() results.",
|
||||
"defaultValue": "(listener) => {\n listener.on('cloud', (asrResult, speakerIds) => {\n\n });\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SucceedOnListenJs": {
|
||||
"description": "Succeeds a behavior upon hearing a custom Natural Language Understand (NLU) rule.",
|
||||
"type": "decorator",
|
||||
"args": [
|
||||
"Function",
|
||||
"Function",
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "getOptions",
|
||||
"description": "Set the dictionary of options that will be returned for the listening task.",
|
||||
"defaultValue": "() => {\n let options = {\n heyJibo: false,\n detectEnd: false,\n incremental: false,\n authenticateSpeaker: ''\n }\n return options;\n}"
|
||||
},
|
||||
{
|
||||
"field": "getRule",
|
||||
"description": "Pass a custom listening rule into the callback.",
|
||||
"defaultValue": "() => {\n callback(\"TopRule = $* Hello World $*;\");\n}"
|
||||
},
|
||||
{
|
||||
"field": "getListener",
|
||||
"description": "Enter code to execute when Jibo has heard input. (listener), event emitter for cloud (asr, spkr), hey-jibo (asr, spkr), timeout (), incremental (asr, stop()), and end-of-speech() results.",
|
||||
"defaultValue": "(listener) => {\n listener.on('cloud', (asrResult, speakerIds) => {\n\n });\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"TakePhoto": {
|
||||
"description": "Attempts to take a photo and return the image url in the onPhoto callback",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
["enum",
|
||||
{
|
||||
"label": "Preview (640x360)",
|
||||
"display": "Preview",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"label": "Full (1280x720)",
|
||||
"display": "Full",
|
||||
"value": 2
|
||||
}
|
||||
],
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "photoRes",
|
||||
"description": "Specify the resolution of the photo you want to take. 1 for Preview (640x360) or 2 for Full (1280x720)",
|
||||
"defaultValue": 2
|
||||
},
|
||||
{
|
||||
"field": "onPhoto",
|
||||
"description" : "Set optional code to execute after the photo is taken. If successful, returns imageUrl; otherwise, returns error.",
|
||||
"defaultValue": "(error, imageUrl) => {\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ReadBarcode": {
|
||||
"description": "Attempts to read a barcode or QRcode and returns the barcode data",
|
||||
"type": "leaf",
|
||||
"args": [
|
||||
"Function"
|
||||
],
|
||||
"meta": [
|
||||
{
|
||||
"field": "onBarcode",
|
||||
"description" : "Enter the code that will be called when the barcode is read. If successful, returns barcode/QRcode data; otherwise, returns error.",
|
||||
"defaultValue": "(error, data) => {\n}"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user