Initial commit — jibo-cli v3.0.7 with bundled node_modules

This commit is contained in:
pasketti
2026-04-05 18:40:18 -04:00
commit b2569b4ce4
10488 changed files with 1631271 additions and 0 deletions

61
node_modules/skills-service-manager/startup/index.js generated vendored Normal file
View File

@@ -0,0 +1,61 @@
'use strict';
//first add the robot's global module search path to the global paths
require('module').globalPaths.push('/usr/lib/node_modules/');
const spawn = require('child_process').spawn;
const ipcRenderer = require('electron').ipcRenderer;
const path = require('path');
const GetConfig = require('../lib/skills-service-manager').default.GetConfig;
const StartupView = require('./startup-view');
const view = new StartupView();
function postSemaphore() {
ipcRenderer.once('set-pid', function(sender, pid) {
const child = spawn('node', [path.join(__dirname, 'semaphore.js'), pid], {
env: {
NODE_PATH: '/usr/lib/node_modules/'
}
});
function onData(data) {
console.info(data.toString());
}
child.stdout.on('data', onData);
child.stderr.on('data', onData);
child.on('exit', function(code) {
console.log('semaphore exited with code', code);
});
});
ipcRenderer.send('get-pid');
}
const getter = new GetConfig();
getter.getConfig(function(error, configPath, mode) {
view.mode = mode;
if (error) {
postSemaphore();
view.complete(error);
return console.error('Could not get config path: ', error);
}
try {
const config = require(configPath);
const Factory = require('../lib/skills-service-manager').default.Factory;
const factory = new Factory(config, path.join(__dirname, '..'), mode);
factory.init(function(error) {
if (error) {
view.complete(error);
console.error('Factory initialization failed:', error);
}
else {
view.complete();
}
postSemaphore();
});
}
catch(error) {
view.complete(error);
console.error('Error. Maybe in identified mode?', error);
postSemaphore();
}
});

View File

@@ -0,0 +1,5 @@
var sem = require('node-semaphore');
var pid = process.argv[2];
console.log('SEMAPHORE', 'pid', pid);
var s = sem.Semaphore('/jibo-startup-' + pid + '.event');
s.post();

View File

@@ -0,0 +1,57 @@
'use strict';
/**
* Wraps the GUI
* @class StartupView
*/
class StartupView {
constructor() {
const $ = document.querySelector.bind(document); // poor-mans jquery
this._parent = $('#view-screen');
this._content = $('#view-content');
this._message = $('#view-message');
this._mode = 'normal';
}
/**
* Current developer mode, "developer", "int-developer", "normal"
* @name mode
* @type {String}
*/
set mode(mode) {
if (mode !== 'developer' && mode !== 'int-developer') {
// handle other modes like oobe, normal, etc
mode = 'normal';
}
this._mode = mode;
}
/**
* Show the result
* @method complete
* @param {Error|String} [err] If an error was generated
*/
complete(error) {
this.replace(this._parent, 'mode-empty', 'mode-' + this._mode);
if (error) {
this.replace(this._content, 'status-loading', 'status-error');
this._message.innerHTML = 'Failed startup: ' + error;
return;
}
this.replace(this._content, 'status-loading', 'status-success');
this._message.innerHTML = 'Waiting for skill to begin...';
}
/**
* Simple class name find and replace
* @method replace
* @param {HTMLElement} node
* @param {String} find
* @param {String} replace
*/
replace(node, find, replace) {
node.className = node.className.replace(find, replace);
}
}
module.exports = StartupView;

112
node_modules/skills-service-manager/startup/startup.css generated vendored Normal file
View File

@@ -0,0 +1,112 @@
body {
background-color:#000;
color:#fff;
margin: 0;
overflow: hidden;
font-family:'Proxima Nova Light', sans-serif;
font-size:1em;
-webkit-user-select: none;
user-select:none;
}
.center {
position:absolute;
top:50%;
left:50%;
transform:translate(-50%, -50%);
text-align: center;
}
#view-content {
width:60em;
}
.mode-normal #view-content,
.mode-empty h1,
.mode-empty h2,
.status-loading h1,
.status-loading h2 {
display:none;
}
.mode-developer,
.mode-int-developer {
animation-duration: 3s;
animation-fill-mode: both;
animation-name: fadeIn;
}
.mode-developer .int-developer,
.mode-int-developer .developer {
display:none;
}
.status-success .error,
.status-error .success {
display:none;
}
.icon {
margin-right:0.2em;
width:0.7em;
height:0.7em;
}
.icon-loading {
fill:#fff;
width:100px;
height:100px;
animation: spin 1s steps(8) infinite;
}
.status-success .icon-loading,
.status-error .icon-loading {
display:none;
}
.icon-success {
fill:#5fb34e;
}
.icon-error {
fill:#de3030;
}
#view-screen {
width: 1280px;
height: 720px;
}
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes spin {
from {
transform: rotate(0deg);
} to {
transform: rotate(360deg);
}
}
#view-screen h1 {
font-family:'Proxima Nova Soft', sans-serif;
font-weight: bold;
font-size:6em;
margin:0 0 0.5em;
line-height: 1.0;
width:100%;
}
#view-screen h2 {
font-size:2.6em;
margin:0;
letter-spacing:0.15em;
color:#999;
text-transform: uppercase;
}