+11
-4
@@ -10,11 +10,11 @@ import { CameraSession } from '../computer-use/camera-session.js';
|
||||
import { PortalCamera } from '../computer-use/portal-camera.js';
|
||||
import { VoiceStateMachine } from './voice-state.js';
|
||||
import { QvacScheduler } from './qvac-scheduler.js';
|
||||
import { cancelQvac, closeQvac, resumeQvac, suspendQvac, callQvac, cancelQvacRequest, qvacStatus } from './qvac-master.js';
|
||||
import { cancelQvac, closeQvac, resumeQvac, suspendQvac, callQvac, cancelQvacRequest, qvacStatus, applyAgentInference } from './qvac-master.js';
|
||||
import { PrivacyLog } from './privacy-log.js';
|
||||
import { VoiceLoop } from './voice-loop.js';
|
||||
import { QvacVoiceAdapter } from './voice-adapters.js';
|
||||
import { voiceSettings } from './voice-settings.js';
|
||||
import { voiceSettings, SETTINGS_FIELDS } from './voice-settings.js';
|
||||
import { createWakeEngine } from './wake-engine.js';
|
||||
import { DesktopObserver } from '../computer-use/observer.js';
|
||||
import { QvacPerception } from './perception.js';
|
||||
@@ -26,6 +26,7 @@ import { RuntimeTelemetry } from './telemetry.js';
|
||||
import { StateRecovery } from './recovery.js';
|
||||
import { spokenReply } from '../skills/voice-prompt.js';
|
||||
import { ensureAgentWorkspace, applyAssistantName, applyAssistantPrompt, normalizeAssistantName } from './agent-workspace.js';
|
||||
import { publicSettings } from '../apps/gnome-extension/[email protected]/settings-values.js';
|
||||
|
||||
function chunkText(ev) {
|
||||
if (ev == null) return '';
|
||||
@@ -38,6 +39,7 @@ export class JarvisDaemon extends EventEmitter {
|
||||
super();
|
||||
this.recovery = new StateRecovery(); const restored = this.recovery.load(); this.state = restored.state; this.mode = restored.mode;
|
||||
this.settings = voiceSettings();
|
||||
applyAgentInference(this.settings);
|
||||
this.startupSettings = this.settings;
|
||||
this.workspace = ensureAgentWorkspace({ name: this.settings.assistantName, prompt: this.settings.assistantPrompt });
|
||||
this.voice = new VoiceStateMachine({ idleMs: this.settings.idleMinutes * 60_000 });
|
||||
@@ -302,6 +304,11 @@ export class JarvisDaemon extends EventEmitter {
|
||||
await this.voiceLoop?.stop?.();
|
||||
this.voiceLoop = null;
|
||||
this.settings = next;
|
||||
const inference = applyAgentInference(next);
|
||||
await inference.release;
|
||||
if (next.agentInference !== previous.agentInference || next.groqModel !== previous.groqModel) {
|
||||
await this.harness.resetContext();
|
||||
}
|
||||
this.voice.idleMs = next.idleMinutes * 60_000;
|
||||
const who = applyAssistantName(this.workspace, next.assistantName);
|
||||
applyAssistantPrompt(this.workspace, next.assistantPrompt);
|
||||
@@ -318,7 +325,7 @@ export class JarvisDaemon extends EventEmitter {
|
||||
Object.assign(this.webcamNormalizer, { maxLongEdge: next.webcamMaxEdge, quality: next.screenshotQuality });
|
||||
await this.startVoice();
|
||||
this.voice.cancel(); this.setState('ARMED');
|
||||
return JSON.stringify({ applied: true, voice: this.voiceLoop.status, environmentOverrides: ['JARVIS_TTS_MODEL', 'JARVIS_ASR_MODEL', 'JARVIS_WAKE_COMMAND', 'JARVIS_QVAC_MODEL'].filter(key => process.env[key]), restartRequired: ['chatModel', 'modelProfile', 'maxTurns', 'maxShellCalls', 'maxToolRounds', 'fsAccess'].filter(key => next[key] !== this.startupSettings[key]) });
|
||||
return JSON.stringify({ applied: true, voice: this.voiceLoop.status, environmentOverrides: ['JARVIS_TTS_MODEL', 'JARVIS_ASR_MODEL', 'JARVIS_WAKE_COMMAND', 'JARVIS_QVAC_MODEL', 'GROQ_API_KEY', 'JARVIS_GROQ_API_KEY'].filter(key => process.env[key]), restartRequired: ['chatModel', 'modelProfile', 'maxTurns', 'maxShellCalls', 'maxToolRounds', 'fsAccess'].filter(key => next[key] !== this.startupSettings[key]) });
|
||||
}
|
||||
async previewVoice(text) {
|
||||
if (this.locked) throw new Error('Unlock the desktop to preview a voice');
|
||||
@@ -365,7 +372,7 @@ export class JarvisDaemon extends EventEmitter {
|
||||
this.setState('ARMED');
|
||||
}
|
||||
}
|
||||
runtimeStatus() { return JSON.stringify({ local: true, qvac: qvacStatus(), scheduler: this.scheduler.status(), scheduler_metrics: this.scheduler.metrics(), telemetry: this.telemetry.snapshot(), settings: this.settings, computer: this.computer.status(), camera: this.camera.status(), voice: this.voiceLoop ? { ...this.voiceLoop.metrics.snapshot(), ...this.voiceLoop.status, muted: this.muted } : { muted: this.muted }, muted: this.muted, p2p: { enabled: process.env.JARVIS_P2P_ENABLE === '1', inference: false, memorySync: false } }); }
|
||||
runtimeStatus() { return JSON.stringify({ local: !this.settings.agentInference || this.settings.agentInference === 'local', agentInference: this.settings.agentInference || 'local', qvac: qvacStatus(), scheduler: this.scheduler.status(), scheduler_metrics: this.scheduler.metrics(), telemetry: this.telemetry.snapshot(), settings: publicSettings(this.settings, SETTINGS_FIELDS), computer: this.computer.status(), camera: this.camera.status(), voice: this.voiceLoop ? { ...this.voiceLoop.metrics.snapshot(), ...this.voiceLoop.status, muted: this.muted } : { muted: this.muted }, muted: this.muted, p2p: { enabled: process.env.JARVIS_P2P_ENABLE === '1', inference: false, memorySync: false } }); }
|
||||
async assessModelFit(model) { return JSON.stringify(await callQvac('assessModelFit', { modelSrc: String(model) })); }
|
||||
async downloadModel(model) { return JSON.stringify(await callQvac('downloadAsset', { modelSrc: String(model) })); }
|
||||
async cancelModel(model) { return JSON.stringify(await cancelQvacRequest({ modelId: String(model) })); }
|
||||
|
||||
Reference in New Issue
Block a user