Allow to change the agents name + Workspace files
Rolling release / release (push) Successful in 8m2s
Rolling release / release (push) Successful in 8m2s
This commit is contained in:
+9
-2
@@ -21,7 +21,8 @@ import { PortalInputBackend } from '../computer-use/portal-input.js';
|
||||
import { ComputerActuator } from '../computer-use/actuator.js';
|
||||
import { RuntimeTelemetry } from './telemetry.js';
|
||||
import { StateRecovery } from './recovery.js';
|
||||
import { spokenReply } from '../skills/voice-prompt.js';
|
||||
import { spokenReply, voiceSystemPrompt } from '../skills/voice-prompt.js';
|
||||
import { ensureAgentWorkspace, applyAssistantName, normalizeAssistantName } from './agent-workspace.js';
|
||||
|
||||
export class JarvisDaemon extends EventEmitter {
|
||||
constructor() {
|
||||
@@ -29,6 +30,7 @@ export class JarvisDaemon extends EventEmitter {
|
||||
this.recovery = new StateRecovery(); const restored = this.recovery.load(); this.state = restored.state; this.mode = restored.mode;
|
||||
this.settings = voiceSettings();
|
||||
this.startupSettings = this.settings;
|
||||
this.workspace = ensureAgentWorkspace({ name: this.settings.assistantName });
|
||||
this.voice = new VoiceStateMachine({ idleMs: this.settings.idleMinutes * 60_000 });
|
||||
this.scheduler = new QvacScheduler({ concurrency: 1 });
|
||||
this.audit = new ComputerAudit();
|
||||
@@ -41,7 +43,7 @@ export class JarvisDaemon extends EventEmitter {
|
||||
framebuffer: { capture: (output) => this.input.captureFrame(output) },
|
||||
});
|
||||
this.actuator = new ComputerActuator({ session: this.computer, input: this.input, find: ({ ref }) => this.observer.lastTree.filter((node) => node.ref === ref), atspiAction: (target, action) => this.observer.atspi.action(target, action), highlight: async (target, action) => this.emit('ComputerHighlight', JSON.stringify({ rect: target?.rect || null, label: `${action} ${target?.name || ''}` })) , audit: this.audit });
|
||||
this.harness = new HarnessBridge({ cwd: process.cwd(), computer: this.computer, observer: this.observer, actuator: this.actuator, fsAccess: this.settings.fsAccess });
|
||||
this.harness = new HarnessBridge({ cwd: this.workspace, computer: this.computer, observer: this.observer, actuator: this.actuator, fsAccess: this.settings.fsAccess });
|
||||
this.log = new PrivacyLog();
|
||||
this.locked = false;
|
||||
this.lastReply = '';
|
||||
@@ -234,6 +236,11 @@ export class JarvisDaemon extends EventEmitter {
|
||||
this.voiceLoop = null;
|
||||
this.settings = next;
|
||||
this.voice.idleMs = next.idleMinutes * 60_000;
|
||||
const who = applyAssistantName(this.workspace, next.assistantName);
|
||||
if (who !== normalizeAssistantName(previous.assistantName)) {
|
||||
this.harness.options.system = voiceSystemPrompt(who);
|
||||
await this.harness.resetContext();
|
||||
}
|
||||
if (['computerMode', 'computerSteps', 'computerGrantMinutes'].some(key => next[key] !== previous[key])) this.computerRevoke();
|
||||
Object.assign(this.computer, { mode: next.computerMode, stepsMax: next.computerSteps, grantMinutes: next.computerGrantMinutes });
|
||||
Object.assign(this.observer.normalizer, { maxLongEdge: next.screenshotMaxEdge, quality: next.screenshotQuality });
|
||||
|
||||
Reference in New Issue
Block a user