(
options: { executionFacts?: ToolExecutionFacts; shell?: ShellPlan } = {},
)
| 121 | } |
| 122 | |
| 123 | export function buildLocalForegroundBashTool( |
| 124 | options: { executionFacts?: ToolExecutionFacts; shell?: ShellPlan } = {}, |
| 125 | ): MakaTool { |
| 126 | const shell = options.shell ?? defaultShellPlan(); |
| 127 | return buildForegroundBashTool({ |
| 128 | description: |
| 129 | withShellGuidance('Run a shell command in the session cwd.', shell) + |
| 130 | ' Subject to permission policy.', |
| 131 | ...(options.executionFacts ? { executionFacts: options.executionFacts } : {}), |
| 132 | defaultTimeoutMs: () => 120_000, |
| 133 | execute: async ({ command, cwd, timeoutMs, ctx }) => |
| 134 | runShellWithBoundedTail(command, { |
| 135 | cwd, |
| 136 | timeoutMs: timeoutMs ?? 120_000, |
| 137 | abortSignal: ctx.abortSignal, |
| 138 | emitOutput: ctx.emitOutput, |
| 139 | shell, |
| 140 | }), |
| 141 | }); |
| 142 | } |
| 143 | |
| 144 | export function buildManagedBashTool( |
| 145 | shellRuns: ShellRunLauncher, |
no test coverage detected