This commit is contained in:
2026-09-11 14:32:35 -04:00
parent b2269d58da
commit aba185d80a
8 changed files with 112 additions and 14 deletions
+2 -1
View File
@@ -6,11 +6,12 @@ import { createQvacTools } from '../skills/qvac-tools.js';
import { VOICE_SYSTEM_PROMPT, parseHudSidecar } from '../skills/voice-prompt.js';
import { createComputerObserveTools } from '../skills/computer-observe.js';
import { createComputerActTools } from '../skills/computer-act.js';
import { createPhase9Tools } from '../skills/phase9-tools.js';
export class HarnessBridge extends EventEmitter {
constructor({ cwd = process.cwd(), model = 'qwen3.5-4b', tools = [], computer, observer, actuator, permissionMode = 'ask' } = {}) {
super();
this.options = { cwd, model, tools: [...createRuntimeTools({ computer }), ...createPhase2Tools({ cwd, computer }), ...createComputerObserveTools({ computer, observer }), ...createComputerActTools({ actuator }), ...createQvacTools(), ...tools], permissionMode, origin: 'jarvis-qvac', system: VOICE_SYSTEM_PROMPT };
this.options = { cwd, model, tools: [...createRuntimeTools({ computer }), ...createPhase2Tools({ cwd, computer }), ...createComputerObserveTools({ computer, observer }), ...createComputerActTools({ actuator }), ...createQvacTools(), ...createPhase9Tools(), ...tools], permissionMode, origin: 'jarvis-qvac', system: VOICE_SYSTEM_PROMPT };
this.session = null;
}
+1 -1
View File
@@ -61,7 +61,7 @@ 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 }); }
runtimeStatus() { return JSON.stringify({ local: true, qvac: qvacStatus(), scheduler: this.scheduler.status(), computer: this.computer.status(), voice: this.voiceLoop?.metrics?.snapshot?.() || null, 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) })); }
+3 -3
View File
@@ -121,7 +121,7 @@ export async function cancelQvacRequest({ requestId, modelId, kind } = {}) {
if (!requestId && !modelId) throw new Error('requestId or modelId is required');
const sdk = await Agent.engine.ensureInit();
if (typeof sdk.cancel !== 'function') throw new Error('QVAC runtime does not expose cancel()');
await sdk.cancel(requestId ? { requestId } : { modelId, kind });
await withQvacMaster(() => sdk.cancel(requestId ? { requestId } : { modelId, kind }));
}
export async function suspendQvac() {
@@ -142,12 +142,12 @@ export async function qvacRuntimeState() {
return sdk.state();
}
const MASTER_CALLS = new Set(['assessModelFit', 'getSystemResources', 'state', 'heartbeat', 'downloadAsset']);
const MASTER_CALLS = new Set(['assessModelFit', 'getSystemResources', 'state', 'heartbeat', 'downloadAsset', 'cancel', 'embed', 'batchCompletion', 'ragIngest', 'ragChunk', 'ragSaveEmbeddings', 'ragSearch', 'ragReindex', 'ragDeleteEmbeddings', 'ragListWorkspaces', 'ragCloseWorkspace', 'ragDeleteWorkspace', 'translate', 'ocr', 'classify', 'diffusion', 'video', 'audioGen', 'transcribe', 'textToSpeech', 'finetune', 'bciTranscribe', 'vla', 'worldCreateScene', 'worldStep', 'modelRegistryList', 'modelRegistrySearch', 'modelRegistryGetModel']);
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();
if (typeof sdk[method] !== 'function') throw new Error(`QVAC SDK does not expose ${method}()`);
return input === undefined ? sdk[method]() : sdk[method](input);
return withQvacMaster(() => input === undefined ? sdk[method]() : Array.isArray(input) ? sdk[method](...input) : sdk[method](input));
}
export function qvacStatus() {