/** * jibo-cli - Command line interface, templates, simulator * @version v3.0.7 * @license Copyright (c) 2017, Jibo, Inc. All rights reserved. * All use of the Jibo SDK is subject to the Jibo SDK End User License Agreement (EULA) * distributed herewith. If you did not receive a copy of the EULA, you may view a * copy at https://developers.jibo.com/license. */ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.jiboCli=t()}}(function(){return function t(e,o,n){function r(s,a){if(!o[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=o[s]={exports:{}};e[s][0].call(c.exports,function(t){var o=e[s][1][t];return r(o?o:t)},c,c.exports,t,e,o,n)}return o[s].exports}for(var i="function"==typeof require&&require,s=0;s' to set a default.")):void o.fetchRobot(n,e)}):this.fetchRobot(t,e)},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{"../jibo-tools":25,colors:void 0,commander:void 0}],2:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.tools.robots.add(process.argv[2],process.argv[3],function(e){return e?t.error(e):void t.success(process.argv[2]+" success added.")})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],3:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(process.argv[2],"Fetching the buildroot version of %s.",function(e){t.tools.buildVersion(e,function(e,o){return e?t.error(e):void t.success(o)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],4:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(this.program.robot,null,function(e){t.tools.debug(e,null,function(e){return t.warn(e)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],5:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.parse=function(){this.program.option("-r, --robot ","Target robot").parse(process.argv)},e.prototype.exec=function(){var t=this;this.isRobotReachable(this.program.robot,"Attempting to delete a skill from %s. Press CTRL+C to cancel.",function(e){t.tools.validateSkillPath(t.program.args[0],function(o,n,r){return o?t.error(o):void t.tools.delSkill(e,r,function(e,o){return e?t.error(e):void t.success(o)})})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],6:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(process.argv[2],"Fetching storage space info for %s.",function(e){t.tools.diskSpace(e,function(e,o){return e?t.error(e):void t.success(o)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],7:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(process.argv[2],"Getting the volume of %s.",function(e){t.tools.volume.get(e,function(o,n){return o?t.error(o):void t.success(e.name+"'s volume is: "+n)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],8:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(process.argv[2],"Indexing %s.",function(e){t.tools.index(e,function(e,o){return e?t.error(e):void t.success(o)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],9:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=t("path"),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.parse=function(){this.program.description("Creates a jibo skeleton project.").option("-t, --type [package-type]","The type of project: 'behavior-template', 'asset-pack-template'\nDefault is 'behavior-template'",/^(behavior-template|asset-pack-template)$/i,"behavior-template").parse(process.argv)},e.prototype.exec=function(){var t=this,e=this._resolveSkillPath(this.program.args[0]);this.green("Creating package: "+e);var o=e.split(i.sep),n=o.length>0?o[o.length-1]:e;this.tools.packageGenerator(this.program.type,e,n,"",function(e){return e?t.error(e):void t.green("Done")})},e.prototype._resolveSkillPath=function(t){return"string"==typeof t?i.resolve(process.cwd(),i.normalize(t)):process.cwd()},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{"../command":1,path:void 0}],10:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(process.argv[2],"Powering off %s.",function(e){t.tools.powerOff(e,function(e,o){return e?t.error(e):void t.success(o)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],11:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(process.argv[2],"Rebooting %s.",function(e){t.tools.reboot(e,function(e,o){return e?t.error(e):void t.success(o)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],12:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.tools.robots.remove(process.argv[2],function(e){return e?t.error(e):void t.success(process.argv[2]+" success removed.")})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],13:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.tools.robots.list(function(e,o){return e?t.error(e):(0===o.length&&t.success("Your robot list is empty. To add a robot, run: \n\n jibo add-robot \n"),void t.tools.robots.getDefault(function(e,n){return e?t.error(e):(o.forEach(function(t){t.hasOwnProperty("network")&&delete t.network,t.name===n?t.name="* "+t.name:t.name=" "+t.name}),t.green("List of robots:"),t.printTable(o,{name:" "}),void t.success())}))})},e.prototype.printTable=function(t,e){function o(t){return"undefined"!=typeof e&&"undefined"!=typeof e[t]?e[t]:""}function n(t){var e;return e=t?Array(t+1).join(" "):""}var r,i,s,a={};if(0!==t.length){for(r in t[0])for(s=o(r)+r,a[r]=s.length,i=0;ia[r]&&(a[r]=t[i][r].length);var u=Array(6).join(" "),l="";for(r in t[0])s=o(r)+r,l+=s+n(a[r]-s.length)+u;for(console.log(l),i=0;i","Target robot").option("-v, --verbose","Output more information during command execution").option("-n, --nosync","If set, skip syncing").parse(process.argv)},e.prototype.exec=function(){var t=this;this.isRobotReachable(this.program.robot,"Attempting to run a skill on %s. Press CTRL+C to cancel.",function(e){t.tools.validateSkillPath(t.program.args[0],function(o,n,r){return o?t.error(o):void(t.program.nosync===!0?t._run(e,r):t.tools.sync.start(e,n,function(o,n){return o?t.error(o):(t.green(n),void t._run(e,r))}))})})},e.prototype._run=function(t,e){var o=this;this.green("Launching skill"),this.tools.run(t,e,function(t,e){return t?o.error(t):void o.success(e)})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],15:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.tools.robots.setDefault(process.argv[2],function(e){return e?t.error(e):void t.success(process.argv[2]+" is now the default robot.")})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],16:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.parse=function(){this.program.option("-r, --robot ","Target robot").parse(process.argv)},e.prototype.exec=function(){var t=this;this.isRobotReachable(this.program.robot,"Setting the volume of %s.",function(e){t.tools.volume.set(e,process.argv[2],function(o,n){return o?t.error(o):void t.success(e.name+"'s volume was successfully set to: "+n)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],17:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("child_process"),i=t("../command"),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.parse=function(){this.program.option("-r, --remote
","Run this as a remote simulation").parse(process.argv)},e.prototype.exec=function(){var t=this;this.tools.validateSkillPath(this.program.args[0],function(e,o,n){return e?t.error(e):void t.sim(o,n)})},e.prototype.sim=function(t,e){var o=this;r.exec("cd "+t,function(n){if(n)return o.error(n);o.green("Running skill named "+e+", located at "+t+". Press control+c to quit");var r=t+"/index.html";o.program.remote&&o.program.remote.length>0?o.tools.launcher.play(r,o.program.remote):o.tools.launcher.play(r)})},e}(i.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=s},{"../command":1,child_process:void 0}],18:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.exec=function(){var t=this;this.isRobotReachable(process.argv[2],"Attempting to stop skill running on %s.",function(e){t.tools.stop(e,function(e,o){return e?t.error(e):void t.success(o)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],19:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.parse=function(){this.program.option("-r, --robot ","Target robot").parse(process.argv)},e.prototype.exec=function(){var t=this;this.isRobotReachable(this.program.robot,"Attempting to sync a skill to %s. Press CTRL+C to cancel.",function(e){t.tools.sync.start(e,t.program.args[0],function(o,n){if(o)return t.error(o);n&&t.green(n);var r="Skill synced success to '"+e.name+"'. To launch the skill run: 'jibo run'";t.success(r)})})},e}(r.default);Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"../command":1}],20:[function(t,e,o){"use strict";var n=this&&this.__extends||function(t,e){function o(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)},r=t("../command"),i=t("cli-spinner").Spinner,s=t("ws-without-native"),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.parse=function(){this.program.option("-r, --robot ","Target robot").option("-f, --filter ","Optional filter for updates").parse(process.argv)},e.prototype.exec=function(){var t=this;this.isRobotReachable(this.program.robot,"Attempting to update %s.",function(e){t._robotInfo=e,t._spinner=new i("checking for updates... %s"),t._spinner.start(),t.tools.updateRobot.get(t._robotInfo,t.program.filter,function(e,o){if(t._spinner.stop(!0),e||!o||!o.data){var n=e;return!o&&t.program.filter&&(n="Unrecognized update filter"),t.error(n)}if(o.data&&0===o.data.length)return void t.red("No updates found");t.green(o.msg);var r=t.tools.updateRobot.getOTASocketUrl(t._robotInfo);t._otaSocket=new s(r),t._otaSocket.onerror=function(){console.log("Error opening ota download socket")},t._otaSocket.on("message",t._downloadStatus.bind(t)),t._downloadedIDs=[],t._updateIDs=[];for(var i=o.data.length,a=0;a ","Add a robot to my robot list."],["remove-robot","[robotName]","Remove a robot from my robot list."],["set-default-robot","[robotName]","Set the default robot to be used when a robot is not specified."],["update-robot","[--robot] [--filter]","Download and install available updates on a robot."],["sync","[skillPath] [--robot]","Sync a skill to a robot."],["run","[skillPath] [--robot] [--nosync] [--verbose]","Run a skill on a robot."],["delete","[skillPath] [--robot]","Delete a skill from a robot."],["debug","","[Deprecated.]"],["stop","[robotName]","Stop any skills currently running on a robot."],["diskspace","[robotName]","Display the amount of storage space on a robot."],["build-version","[robotName]","Display the buildroot version installed on a robot."],["set-volume"," [--robot]","Set the volume of a robot."],["get-volume","[robotName]","Display the current volume of a robot."],["index","[robotName]","Index a robot. (Required after powering robot on.)"],["reboot","[robotName]","Restart a robot."],["poweroff","[robotName]","Power off a robot."],["help","[command]","Display help for the specified command."],["-h"],["--help"],["help"],["-V"],["--version"]],this.rootPath=r.dirname(t),this.parse(),this.validate()}return e.prototype.parse=function(){var e=t(r.join(this.rootPath,"package.json")),o=n.version(e.version);this.knownSubCommands.forEach(function(t){1!==t.length&&(o=o.command(t[0]+" "+t[1],t[2]))}),o.parse(process.argv)},e.prototype.yellow=function(t){console.log(s.yellow(t))},e.prototype.validate=function(){var t,e=this;if(this.knownSubCommands.forEach(function(e){process.argv[2]===e[0]&&(t=!0)}),!t){var o=[],n=Number.MAX_SAFE_INTEGER;this.knownSubCommands.forEach(function(t){var e=t[0],r=process.argv[2],s=0;e.lengthr.length&&(s=e.length-r.length,e=r.slice(0,r.length)),s+=i(e,r),s0;l&&a.push("--remote",e);var c={ELECTRON_INTERNAL_RUN_AS_NODE:"0",RUNMODE:l?"REMOTELY":"SIMULATOR",NODE_PATH:""},d=process.env;d.hasOwnProperty("NODE_PATH_SIM")&&(d.hasOwnProperty("NODE_PATH")?c.NODE_PATH=d.NODE_PATH+":"+d.NODE_PATH_SIM:c.NODE_PATH=d.NODE_PATH_SIM),this.child=r.spawn(i.default(),a,{cwd:n,env:u.assign({},process.env,c)}),this.emit("start"),this.child.on("error",function(t){console.log(t)}),this.child.on("exit",this.onChildExit.bind(this))}},e.prototype.stop=function(){this.child&&(console.log("STOP"),this.child.on("error",function(t){console.log(t)}),this.child.kill())},e}(a.EventEmitter);Object.defineProperty(o,"__esModule",{value:!0}),o.default=new v},{"../get-electron-path":23,"../get-tools-path":24,"../robots/run":39,"../robots/stop":40,"../robots/sync":41,child_process:void 0,events:void 0,"jibo-sync":void 0,lodash:void 0,path:void 0}],27:[function(t,e,o){"use strict";function n(t,e){var o;return o=/__(?:(package-name)|([pP]ackageName)|(package_name))__/g,t.replace(o,e)}function r(t,e){var o;return o=/__(?:(display-name))__/g,t.replace(o,e)}function i(t){return t=t.replace(/-+|_+/g," "),t=t.replace(/\s+/g," ").trim(),t.replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})}function s(t,e){var o;return o=/__(?:(skill-page-title))__/g,t.replace(o,i(e))}function a(t,e,o,i,a){var p,f,h,v,m,b,y,g,_,w=d.default("templates",t);try{u.statSync(w)}catch(e){a("Template type "+t+" does not exist")}for(null===o&&(o=l.basename(e)),u.makeTreeSync(e),m=c.readdirSyncRecursive(w),y=[],h=0,v=m.length;h1)return void o("Volume must be in the range [0.0-1.0]. Was "+n+".",null);var r={volume:n};g(t,M,r,o)}function c(t,e){g(t,S,void 0,e)}function d(t,e){g(t,R,void 0,e)}function p(t,e){g(t,E,void 0,e)}function f(t,e){g(t,D,void 0,e)}function h(t,e,o){var n={dirName:e };g(t,A,n,o)}function v(t,e,o){var n={filter:e};g(t,I,n,o)}function m(t,e,o){var n={ids:e};g(t,C,n,function(t,e){return t||"failed"===e.status||e.error?o(t||e.reason||e.error):void o(null,e)})}function b(t){return"ws://"+t+":"+O+"/download-update"}function y(t,e,o){var n={ids:e};g(t,L,n,function(t,e){return t||"failed"===e.status||e.error?o(t||e.reason||e.error):void o(null,e)})}function g(t,e,o,n){var r=o?o:{};try{r=JSON.stringify(r)}catch(t){return void n("Attempting to send invalid data to dev shell. Request is not valid JSON",null)}var i={hostname:t,port:O,path:e,method:"POST",headers:{"Content-Type":"application/json"}},s=_.request(i,function(t){var e="";t.on("data",function(t){e+=t}),t.on("end",function(){var t=void 0;try{t=JSON.parse(e)}catch(t){return void n("Invalid request to dev shell. Request body is not valid JSON: "+e,null)}"ERROR"===t.Status?n(t.Message,null):n(null,t.Message)})});s.on("error",function(){n("Dev shell is not available on "+t,null)}),s.write(r),s.end()}var _=t("http"),w=t("jibo-sync"),O=8686,k=8989,j="/sync-skill",P="/run",x="/stop",S="/diskspace",R="/reboot",E="/poweroff",N="/version",D="/index",M="/setvolume",T="/getvolume",A="/delete-skill",I="/check-update",C="/download-update",L="/install-update";o.syncSkill=n,o.stopSync=r,o.runSkill=i,o.stopSkill=s,o.getBuildVersion=a,o.getVolume=u,o.setVolume=l,o.getDiskSpace=c,o.rebootRobot=d,o.powerOffRobot=p,o.indexRobot=f,o.deleteSkill=h,o.checkForUpdates=v,o.downloadUpdates=m,o.getOTASocketUrl=b,o.installUpdates=y},{http:void 0,"jibo-sync":void 0}],33:[function(t,e,o){"use strict";function n(t,e){r.getDiskSpace(t.ip,function(t,o){e(t,o)})}var r=t("./dev-shell");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./dev-shell":32}],34:[function(t,e,o){"use strict";function n(t,e){r.indexRobot(t.ip,function(t,o){e(t,o)})}var r=t("./dev-shell");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./dev-shell":32}],35:[function(t,e,o){"use strict";var n=t("child_process"),r={isRobotReachable:function(t,e){var o=!1,r="-t 10";"win32"===process.platform&&(r="-4");var i=n.spawn("ping",[r,t.ip],["pipe"]),s="";i.on("close",function(){o||(i.kill("SIGKILL"),e(null,!1),o=!0)}),i.on("exit",function(){o||(i.kill("SIGKILL"),e(null,!1),o=!0)}),i.stderr.on("data",function(t){if(s+=t.toString(),s.search("No route to host")!==-1||s.search("Host is down")!==-1)return void(o||(i.kill("SIGKILL"),e(null,!1),o=!0))});var a="";i.stdout.on("data",function(t){a+=t.toString();var n="bytes from";if("win32"===process.platform&&(n="bytes="),a.search(n)!==-1)return void(o||(i.kill("SIGKILL"),e(null,!0),o=!0))})}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{child_process:void 0}],36:[function(t,e,o){"use strict";function n(t,e){r.powerOffRobot(t.ip,function(t,o){e(t,o)})}var r=t("./dev-shell");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./dev-shell":32}],37:[function(t,e,o){"use strict";function n(t,e){r.rebootRobot(t.ip,function(t,o){e(t,o)})}var r=t("./dev-shell");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./dev-shell":32}],38:[function(t,e,o){"use strict";function n(t){var e=new i.default;e.load(function(o){return o?void t(o):void t(null,e)})}function r(t){return!!t}var i=t("./config"),s=t("lodash"),a={list:function(t){n(function(e,o){if(e)return void t(e);var n=o.get("robots");return Array.isArray(n)?void t(null,n):void t(null,[])})},add:function(t,e,o){n(function(n,i){if(n)return void o(n);if(!t||0===t.length)return void o(new Error("Robot's name must be at least one character long"));if(r(e)===!1)return void o(new Error("IP address is not a valid ("+e+")"));var a=i.get("robots");return"undefined"!=typeof a&&Array.isArray(a)!==!1||(a=[]),s.findIndex(a,function(e){return e.name===t})!==-1?void o(new Error("A robot with the name "+t+" already exists. Delete it first if you want to update it's information ")):(a.push({name:t,ip:e}),a.sort(function(t,e){return t>e}),i.set("robots",a),i.set("defaultRobot",t),void i.save(function(t){o(t)}))})},remove:function(t,e){console.log(""),n(function(o,n){if(o)return void e(o);if(!t||0===t.length)return void e(new Error("Robot's name must be at least one character long"));var r=n.get("robots");if("undefined"==typeof r||Array.isArray(r)===!1)return void e(new Error("There are no robots to delete"));var i=s.findIndex(r,function(e){return e.name===t});return i===-1?void e(new Error("No robot with the name "+t+" exists.")):(s.pullAt(r,i),n.set("robots",r),n.get("defaultRobot")===t&&n.set("defaultRobot",void 0),void n.save(function(t){e(t)}))})},setDefault:function(t,e){n(function(o,n){if(o)return void e(o);if(!t||0===t.length)return void e(new Error("Robot's name must be at least one character long"));var r=n.get("robots");return Array.isArray(r)===!1||s.findIndex(r,function(e){return e.name===t})===-1?void e(new Error(t+" doesn't exist in the list of robots. Run to 'jibo robot-list' to see the list of robots")):(n.set("defaultRobot",t),void n.save(function(t){e(t)}))})},getDefault:function(t){n(function(e,o){if(e)return void t(e);var n=o.get("defaultRobot");return"undefined"==typeof n?void t(null,null):void t(null,n)})},getInfo:function(t,e){return 0===t.length?void e(new Error("Robot's name must be at least one character long")):void this.list(function(o,n){if(o)return void e(o);var r=s.findIndex(n,function(e){return e.name===t});return r===-1?void e(new Error("No robot by the name "+t+" exists in the robot list")):void e(null,n[r])})}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=a},{"./config":29,lodash:void 0}],39:[function(t,e,o){"use strict";function n(t,e,o){r.runSkill(t.ip,e,function(t,e){o(t,e)})}var r=t("./dev-shell");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./dev-shell":32}],40:[function(t,e,o){"use strict";function n(t,e){r.stopSkill(t.ip,function(t,o){e(t,o)})}var r=t("./dev-shell");Object.defineProperty(o,"__esModule",{value:!0}),o.default=n},{"./dev-shell":32}],41:[function(t,e,o){"use strict";var n=t("./validate-skill-path"),r=t("./dev-shell"),i=function(){function t(){}return t.start=function(t,e,o){n.default(e,function(e,n,i){if(e)return void o(e,null);var s=!0;r.syncSkill(t.ip,n,i,s,function(t,e){o(t,e)})})},t.stop=function(t,e){r.stopSync(t.ip,function(t,o){e(t,o)})},t}();Object.defineProperty(o,"__esModule",{value:!0}),o.default=i},{"./dev-shell":32,"./validate-skill-path":43}],42:[function(t,e,o){"use strict";var n=t("./dev-shell"),r={get:function(t,e,o){n.checkForUpdates(t.ip,e,o)},download:function(t,e,o){n.downloadUpdates(t.ip,e,o)},install:function(t,e,o){n.installUpdates(t.ip,e,o)},getOTASocketUrl:function(t){return n.getOTASocketUrl(t.ip)}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./dev-shell":32}],43:[function(t,e,o){"use strict";function n(t){return"string"==typeof t?i.resolve(process.cwd(),t):process.cwd()}function r(t,e){t=n(t),s.lstat(t,function(o,n){return o?o.errno===-2?void e(new Error("No folder exists at "+t)):void e(o):n.isDirectory()===!1?void e(new Error(t+" is a file not a directory")):void s.readFile(i.resolve(t,"package.json"),"utf8",function(o,n){if(o)return o.errno===-2?void e(new Error("No 'package.json' exists at "+t+"/package.json")):void e(o);var r;try{r=JSON.parse(n)}catch(o){return void e(new Error("Error parsing skill's 'package.json' at "+t+"/package.json"))}if("string"!=typeof r.name&&0!==r.name.length)return void e(new Error('Skill hasn\'t properly set the "name" field in '+t+"/package.json"));var i=r.name;e(null,t,i)})})}var i=t("path"),s=t("fs");Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{fs:void 0,path:void 0}],44:[function(t,e,o){"use strict";var n=t("./dev-shell"),r={get:function(t,e){n.getVolume(t.ip,function(t,o){e(t,o)})},set:function(t,e,o){n.setVolume(t.ip,e,function(t,e){o(t,e)})}};Object.defineProperty(o,"__esModule",{value:!0}),o.default=r},{"./dev-shell":32}],45:[function(t,e,o){"use strict";var n=t("./jibo-tools");e.exports=n.default},{"./jibo-tools":25}]},{},[45])(45)});