Files
jibo-cli/node_modules/skills-service-manager/lib/skills-main-process.js

9 lines
2.8 KiB
JavaScript

/**
* skills-service-manager - Skills Services Manager
* @version v4.0.6
* @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(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.skillsMainProcess=e()}}(function(){return function e(t,n,o){function i(r,c){if(!n[r]){if(!t[r]){var d="function"==typeof require&&require;if(!c&&d)return d(r,!0);if(s)return s(r,!0);var f=new Error("Cannot find module '"+r+"'");throw f.code="MODULE_NOT_FOUND",f}var h=n[r]={exports:{}};t[r][0].call(h.exports,function(e){var n=t[r][1][e];return i(n?n:e)},h,h.exports,e,t,n,o)}return n[r].exports}for(var s="function"==typeof require&&require,r=0;r<o.length;r++)i(o[r]);return i}({1:[function(e,t,n){"use strict";function o(e,t,n){return new c(e,t,n)}console.log("skills-main-process.ts");const i=e("electron"),s=e("../utils/Log");let r=s.createLog("ssm-skill-main-process");class c{constructor(e,t,n){this.registryHost=e,this.indexPath=t,this.context=n,this.onReady=this.onReady.bind(this),this.onInit=this.onInit.bind(this),this.onFinished=this.onFinished.bind(this),this.onGetContext=this.onGetContext.bind(this),this.onCrashed=this.onCrashed.bind(this),i.ipcMain.on("get-context",this.onGetContext),i.ipcMain.on("init-done",this.onInit),i.app.once("ready",this.onReady)}onCrashed(){r.error("Skill renderer process crashed. Restarting."),this.window.reload()}onReady(){r.info("App Ready",this.indexPath),this.window=new i.BrowserWindow({show:!1,x:0,y:0,width:c.WIDTH,height:c.HEIGHT,frame:!1}),this.window.webContents.on("crashed",this.onCrashed),this.window.loadURL("file://"+this.indexPath)}onFinished(){i.app.quit()}onInit(){this.window.show(),this.window.focus(),this.window.setPosition(0,0)}onGetContext(e){r.info("Get context called"),e.sender.send("set-context",{registryHost:this.registryHost,runMode:process.env.RUNMODE,token:"",context:this.context})}}c.WIDTH=1280,c.HEIGHT=721,Object.defineProperty(n,"__esModule",{value:!0}),n.default=o},{"../utils/Log":3,electron:void 0}],2:[function(e,t,n){"use strict";const o=e("./MainProcess");let i,s=process.argv[3],r=process.argv[4];if(6===process.argv.length)try{i=JSON.parse(process.argv[5])}catch(e){console.error("could not parse context",process.argv[5])}o.default(s,r,i)},{"./MainProcess":1}],3:[function(e,t,n){"use strict";function o(e,t){let n=new i(e);return n.toSyslog(),n}const i=e("jibo-log");n.createLog=o},{"jibo-log":void 0}]},{},[2])(2)});