export function createComputerActTools({ actuator } = {}) { const call = (method) => async (args) => { if (!actuator) throw new Error('computer-use actuator is unavailable'); return actuator[method](args); }; return [ ['cu_act', 'Run a named AT-SPI action on a semantic ref. Desktop grant required; do not paste the result JSON to the user.', { ref: { type: 'string' }, action: { type: 'string' } }, 'act'], ['cu_click', 'Click a control. Prefer a tree ref from cu_observe or cu_find; coordinates are the fallback. Desktop grant required.', { ref: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' }, button: { type: 'string' } }, 'click'], ['cu_double_click', 'Double-click a control or coordinate.', { ref: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' } }, 'doubleClick'], ['cu_right_click', 'Right-click a control or coordinate.', { ref: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' } }, 'rightClick'], ['cu_hover', 'Move the pointer to a control or coordinate.', { ref: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' } }, 'hover'], ['cu_scroll', 'Scroll at a control or coordinate.', { ref: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' }, dy: { type: 'number' }, dx: { type: 'number' } }, 'scroll'], ['cu_drag', 'Drag between semantic refs or coordinates.', { from: { type: 'object', properties: { ref: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' } } }, to: { type: 'object', properties: { ref: { type: 'string' }, x: { type: 'number' }, y: { type: 'number' } } } }, 'drag'], ['cu_type', 'Click the target if given, then type Unicode. Use a text, entry, or document ref from cu_find. Desktop grant required.', { text: { type: 'string' }, ref: { type: 'string' }, submit: { type: 'boolean' } }, 'type'], ['cu_key', 'Send a keyboard combination such as enter, ctrl+l, or alt+tab.', { combo: { type: 'string' } }, 'key'], ].map(([name, description, properties, method]) => ({ name, permission: 'read', description, parameters: { type: 'object', properties }, execute: call(method) })); }