Switched to original server implementation & included server shim

This commit is contained in:
2026-03-20 03:32:49 +02:00
parent 268cee305e
commit 93bd8db6bb
59 changed files with 13392 additions and 16 deletions

View File

@@ -26,6 +26,14 @@
"good evening"
],
"suppressWakeGreetings": true,
"jetstreamOfflineFallbackEnabled": true,
"jetstreamInjectOnHjHeard": true,
"aiForwardingOnlyAllowedSkills": true,
"aiForwardingAllowedSkills": ["@be/main-menu", "@be/idle"],
"followupEnabled": true,
"followupDelayMs": 250
}

File diff suppressed because it is too large Load Diff

View File

@@ -27,6 +27,26 @@ function strIncludes(s, needle) {
return (typeof s === 'string') && (s.indexOf(needle) !== -1);
}
function getResourcePathString(resourcePath) {
try {
if (!resourcePath) return '';
if (typeof resourcePath === 'string') return resourcePath;
if (typeof resourcePath === 'object') {
return String(resourcePath.id || resourcePath.src || resourcePath.path || '');
}
return String(resourcePath);
} catch (e) {
return '';
}
}
function isGreetingAnimationResource(p) {
if (!p) return false;
// Example observed:
// /opt/jibo/Jibo/Skills/@be/be/node_modules/jibo-anim-db-animations/animations/greetings-goodbyes/greetings/greetings_06.keys
return strIncludes(p, 'animations/greetings-goodbyes/greetings/') || strIncludes(p, 'greetings-goodbyes/greetings/greetings_');
}
// Optional UDP logger (Python logd). Safe fallback if unavailable.
let robotLogger = null;
try {
@@ -578,6 +598,21 @@ function patchLoader(jibo, skillsRoot) {
jibo.loader.load = function(resourcePath, callback) {
// Log all resource loads to see what's happening
log('>>> jibo.loader.load called with:', resourcePath);
// Suppress wake greeting animations while the AI bridge is actively listening.
// (AI bridge sets global.__AI_BRIDGE_LISTENING during ASR capture.)
try {
const p = getResourcePathString(resourcePath);
if (global.__AI_BRIDGE_LISTENING && isGreetingAnimationResource(p)) {
warn('suppressing greeting animation load while listening:', p);
if (callback) {
try { callback(new Error('suppressed greeting while listening')); } catch (e) {}
}
return;
}
} catch (e) {
// ignore
}
// Check if this is loading a dynamic submenu
if (resourcePath && strStartsWith(resourcePath, 'dynamic-submenu-')) {

View File

@@ -441,7 +441,20 @@ class GQAModule extends ServiceProvider_1.ServiceProvider {
this.assetPack = assetPack;
this.skillRoot = assetPack.rootPath;
this.names = require((this.skillRoot || './') + '/assets/names.json');
this.gqaService = new JSC.GQA();
const env = (typeof process !== 'undefined' && process && process.env) ? process.env : {};
const hubHost = env.JIBO_HUB_SHIM_HOST || env.HUB_SHIM_HOST || env.JIBO_HUB_HOST || '';
const endpoint = env.JIBO_GQA_ENDPOINT || env.GQA_ENDPOINT || (hubHost ? `http://${hubHost}:8080` : 'http://127.0.0.1:8080');
const region = env.JIBO_GQA_REGION || env.AWS_REGION || 'local';
const accessKeyId = env.JIBO_GQA_AKID || 'local';
const secretAccessKey = env.JIBO_GQA_SECRET || 'local';
const sslEnabled = /^https:/i.test(String(endpoint));
this.gqaService = new JSC.GQA({
region,
endpoint,
sslEnabled,
credentials: new JSC.Credentials(accessKeyId, secretAccessKey),
maxRetries: 0,
});
this.log = chitchat.log.createChild('GQAModule');
}
getServiceNLResponse(question, intent, interrogative, looper, doTimeStampLogging) {