import z from 'zod';
const parameters = z.object({
    code: z.string().describe('Bash code to execute'),
    args: z.array(z.string()).nullable().describe('Arguments passed to the bash command')
});
export const executeBashTool = {
    name: 'sys:execute_bash',
    description: 'Execute a bash script and return the result.',
    parameters,
    needsApproval: true,
    async execute(rawArgs) {
        if (!window.child_process?.runBashScript) {
            throw new Error('child_process bridge is not available');
        }
        const args = parameters.parse(rawArgs);
        return window.child_process.runBashScript(args.code, args.args ?? undefined);
    },
};
