UNPKG

@bestdefense/bd-agent

Version:

An AI-powered coding assistant CLI that connects to AWS Bedrock

55 lines 1.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shellTools = void 0; const child_process_1 = require("child_process"); const util_1 = require("util"); const execAsync = (0, util_1.promisify)(child_process_1.exec); exports.shellTools = [ { name: 'run_command', description: 'Execute a shell command', input_schema: { type: 'object', properties: { command: { type: 'string', description: 'The command to execute' }, cwd: { type: 'string', description: 'Working directory for the command (optional)' }, timeout: { type: 'number', description: 'Command timeout in milliseconds (default: 30000)' } }, required: ['command'] }, execute: async ({ command, cwd, timeout = 30000 }) => { try { const options = { cwd: cwd || process.cwd(), timeout }; const { stdout, stderr } = await execAsync(command, options); return { success: true, stdout: stdout || '', stderr: stderr || '', command }; } catch (error) { return { success: false, error: error.message, stdout: error.stdout || '', stderr: error.stderr || '', command }; } } } ]; //# sourceMappingURL=shell.js.map