MCPcopy Create free account
hub / github.com/apache/maka / buildLocalForegroundBashTool

Function buildLocalForegroundBashTool

packages/runtime/src/shell-tools.ts:123–142  ·  view source on GitHub ↗
(
  options: { executionFacts?: ToolExecutionFacts; shell?: ShellPlan } = {},
)

Source from the content-addressed store, hash-verified

121}
122
123export 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
144export function buildManagedBashTool(
145 shellRuns: ShellRunLauncher,

Callers 1

Calls 4

defaultShellPlanFunction · 0.85
buildForegroundBashToolFunction · 0.85
withShellGuidanceFunction · 0.85
runShellWithBoundedTailFunction · 0.85

Tested by

no test coverage detected