@coopah/bentley-tool-exec
v0.3.0
Published
Shell command execution tool for Bentley agents
Readme
@coopah/bentley-tool-exec
Shell command execution tool for Bentley agents. Runs commands in a sandboxed environment with an allowlist of permitted commands and configurable timeouts.
Install
pnpm add @coopah/bentley-tool-execDependencies
@coopah/bentley-coreai^6.0.116zod^4.3.6
Usage
import { createBentley } from "@coopah/bentley-core";
import { bentleyExecPlugin } from "@coopah/bentley-tool-exec";
const bentley = createBentley({
plugins: [
bentleyExecPlugin({
allowedCommands: ["ls", "cat", "grep", "find", "echo", "date"],
timeoutMs: 10_000,
}),
],
});API
bentleyExecPlugin(config?)—BentleyPluginthat registers the shell execution toolcreateExecTool(config?)— Low-level Vercel AI tool factory
Configuration
interface ExecToolConfig {
allowedCommands?: string[]; // Default: ["ls", "cat", "head", "tail", "wc", "grep", "find", "echo", "date", "whoami"]
timeoutMs?: number; // Default: 30000
}Tool Schema
// Input
{
command: string; // Command to execute (must be in allowlist)
args?: string[]; // Command arguments
timeout?: number; // Per-call timeout override (ms)
}
// Output
{ stdout: string; stderr: string }
// or on error:
{ error: string; code: number }Related Packages
| Package | Role |
|---------|------|
| @coopah/bentley-core | Core runtime (required) |
| @coopah/bentley-tool-web-search | Web search tool |
| @coopah/bentley-tool-browser | Browser automation tool |
License
MIT
