Keep harness tools within registration limit
Rolling release / release (push) Successful in 12m20s

This commit is contained in:
2026-09-11 18:05:41 -04:00
parent 28150185dc
commit 354e25995a
3 changed files with 39 additions and 3 deletions
+30
View File
@@ -53,4 +53,34 @@ export function createPhase9Tools() {
return tools;
}
// The harness reserves 32 custom-tool slots. Keep the complete per-capability
// catalog available to callers, while exposing one gateway to the agent so
// every QVAC capability remains reachable without exceeding that limit.
export function createPhase9GatewayTool() {
const operations = [...specs.map(([name]) => name), 'job_cancel', 'p2p_status'];
return [{
name: 'qvac_capability',
permission: 'write',
description: `Run one local QVAC capability through the single master adapter. Operations: ${operations.join(', ')}.`,
parameters: {
type: 'object',
properties: {
operation: { type: 'string', enum: operations },
input: { type: 'object' },
},
required: ['operation'],
},
execute: async ({ operation, input = {} } = {}) => {
if (operation === 'p2p_status') return p2pStatus();
if (operation === 'job_cancel') return callQvac('cancel', input);
const spec = specs.find(([name]) => name === operation);
if (!spec) throw new Error(`unknown QVAC capability: ${operation}`);
const [, method] = spec;
if (method === 'modelRegistryGetModel') return resultShape(await callQvac(method, [input.registryPath || input.path, input.registrySource || input.source]));
if (method === 'ocr') { const result = await callQvac(method, input); return { blocks: await result.blocks }; }
return resultShape(await callQvac(method, input));
},
}];
}
export { specs as PHASE9_SPECS };