This commit is contained in:
2026-09-11 14:29:47 -04:00
parent b264c31b86
commit b2269d58da
9 changed files with 130 additions and 11 deletions
+10
View File
@@ -21,6 +21,11 @@ export async function serveOnSessionBus(daemon) {
ComputerGrant(persist) { daemon.computerGrant(persist); }
ComputerRevoke() { daemon.computerRevoke(); }
ComputerStatus() { return JSON.stringify(daemon.computer.status()); }
GetRuntimeStatus() { return daemon.runtimeStatus(); }
AssessModelFit(model) { return daemon.assessModelFit(model); }
DownloadModel(model) { return daemon.downloadModel(model); }
CancelModel(model) { return daemon.cancelModel(model); }
WipeComputerTraces() { return daemon.wipeComputerTraces(); }
ConfirmationRequired(tool, args, pattern) { this.emit('ConfirmationRequired', String(tool), String(args), String(pattern)); }
StateChanged(state) { this.emit('StateChanged', state); }
Reply(text) { this.emit('Reply', String(text)); }
@@ -51,6 +56,11 @@ export async function serveOnSessionBus(daemon) {
ComputerGrant: { inSignature: 'b', outSignature: '', method: 'ComputerGrant' },
ComputerRevoke: { inSignature: '', outSignature: '', method: 'ComputerRevoke' },
ComputerStatus: { inSignature: '', outSignature: 's', method: 'ComputerStatus' },
GetRuntimeStatus: { inSignature: '', outSignature: 's', method: 'GetRuntimeStatus' },
AssessModelFit: { inSignature: 's', outSignature: 's', method: 'AssessModelFit' },
DownloadModel: { inSignature: 's', outSignature: 's', method: 'DownloadModel' },
CancelModel: { inSignature: 's', outSignature: 's', method: 'CancelModel' },
WipeComputerTraces: { inSignature: '', outSignature: 'b', method: 'WipeComputerTraces' },
StateChanged: { signature: 's', signal: true },
Reply: { signature: 's', signal: true },
Token: { signature: 's', signal: true },
+6 -1
View File
@@ -3,7 +3,7 @@ import { HarnessBridge } from './harness-bridge.js';
import { ComputerUseSession } from '../computer-use/session.js';
import { VoiceStateMachine } from './voice-state.js';
import { QvacScheduler } from './qvac-scheduler.js';
import { cancelQvac, resumeQvac, suspendQvac } from './qvac-master.js';
import { cancelQvac, resumeQvac, suspendQvac, callQvac, cancelQvacRequest, qvacStatus } from './qvac-master.js';
import { PrivacyLog } from './privacy-log.js';
import { VoiceLoop } from './voice-loop.js';
import { QvacVoiceAdapter } from './voice-adapters.js';
@@ -61,6 +61,11 @@ export class JarvisDaemon extends EventEmitter {
try { await this.voiceLoop.start(); } catch (error) { this.voiceLoop = null; this.emit('Error', 'VOICE_UNAVAILABLE', error.message); throw error; }
}
setPushToTalk(pressed) { this.voiceLoop?.setPushToTalk(pressed); this.emit('PushToTalk', Boolean(pressed)); }
runtimeStatus() { return JSON.stringify({ local: true, qvac: qvacStatus(), scheduler: this.scheduler.status(), computer: this.computer.status(), voice: this.voiceLoop?.metrics?.snapshot?.() || null }); }
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) })); }
async wipeComputerTraces() { await this.audit.wipeTemp(); return true; }
handleLockScreen(locked) { this.locked = Boolean(locked); if (this.locked) { this.cancel(); this.setState('ARMED'); } this.emit('LockScreenChanged', this.locked); }
tickIdle() { if (!this.locked && this.voice.expireIdle() === 'SLEEPING' && this.state !== 'SLEEPING') this.sleep(); }
async close() { clearInterval(this._idleTimer); this.computerRevoke(); await this.voiceLoop?.stop?.(); await this.harness.close(); }
+1 -1
View File
@@ -142,7 +142,7 @@ export async function qvacRuntimeState() {
return sdk.state();
}
const MASTER_CALLS = new Set(['assessModelFit', 'getSystemResources', 'state', 'heartbeat']);
const MASTER_CALLS = new Set(['assessModelFit', 'getSystemResources', 'state', 'heartbeat', 'downloadAsset']);
export async function callQvac(method, input) {
if (!MASTER_CALLS.has(method)) throw new Error(`QVAC method is not exposed through the master: ${method}`);
const sdk = await Agent.engine.ensureInit();