Updates
This commit is contained in:
@@ -85,6 +85,14 @@ export async function qvacRuntimeState() {
|
||||
return sdk.state();
|
||||
}
|
||||
|
||||
const MASTER_CALLS = new Set(['assessModelFit', 'getSystemResources', 'state', 'heartbeat']);
|
||||
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);
|
||||
}
|
||||
|
||||
export function qvacStatus() {
|
||||
return { ...QVAC_MASTER, owners: ownerCount, loaded: Agent.engine.getLoaded() };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user