Updates
This commit is contained in:
+4
-3
@@ -3,6 +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';
|
||||
|
||||
export class JarvisDaemon extends EventEmitter {
|
||||
constructor() {
|
||||
@@ -17,8 +18,8 @@ export class JarvisDaemon extends EventEmitter {
|
||||
}
|
||||
|
||||
setState(state) { this.state = state; this.emit('StateChanged', state); }
|
||||
arm() { this.voice.wake(); this.setState('LISTENING'); }
|
||||
sleep() { this.voice.sleep(); this.setState('SLEEPING'); }
|
||||
async arm() { await resumeQvac().catch(() => {}); this.voice.wake(); this.setState('LISTENING'); }
|
||||
async sleep() { this.voice.sleep(); this.setState('SLEEPING'); await suspendQvac().catch((error) => this.emit('Error', 'QVAC_SUSPEND', error.message)); }
|
||||
say(text) { this.emit('Reply', String(text)); }
|
||||
async ask(text) {
|
||||
this.voice.utterance(); this.setState('THINKING');
|
||||
@@ -29,7 +30,7 @@ export class JarvisDaemon extends EventEmitter {
|
||||
this.emit('Error', 'QVAC', error.message); this.voice.cancel(); this.setState('ARMED'); throw error;
|
||||
}
|
||||
}
|
||||
cancel() { this.harness.cancel(); this.scheduler.cancelQueued((job) => job.lane === 'voice'); this.computer.revoke(); this.voice.cancel(); this.setState('ARMED'); }
|
||||
cancel() { this.harness.cancel(); this.scheduler.cancelQueued((job) => job.lane === 'voice'); this.computer.revoke(); this.voice.cancel(); this.setState('ARMED'); cancelQvac().catch((error) => this.emit('Error', 'QVAC_CANCEL', error.message)); }
|
||||
computerGrant(persist = false) { const result = this.computer.grant({ persist }); this.emit('ComputerStep', JSON.stringify({ action: 'grant', ...result })); return result; }
|
||||
computerRevoke() { this.computer.revoke(); this.emit('ComputerStep', JSON.stringify({ action: 'revoke' })); }
|
||||
async close() { this.computerRevoke(); await this.harness.close(); }
|
||||
|
||||
Reference in New Issue
Block a user