This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user