feat: refactor bash tool with shell-aware prompts for bash, pwsh+powershell, and cmd (#20039)

This commit is contained in:
Luke Parker
2026-05-03 09:18:48 +10:00
committed by GitHub
parent 1986a6e817
commit 3f459819ba
14 changed files with 506 additions and 177 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
import { PlanExitTool } from "./plan"
import { Session } from "@/session/session"
import { QuestionTool } from "./question"
import { BashTool } from "./bash"
import { ShellTool } from "./shell"
import { EditTool } from "./edit"
import { GlobTool } from "./glob"
import { GrepTool } from "./grep"
@@ -106,7 +106,7 @@ export const layer: Layer.Layer<
const plan = yield* PlanExitTool
const webfetch = yield* WebFetchTool
const websearch = yield* WebSearchTool
const bash = yield* BashTool
const shell = yield* ShellTool
const globtool = yield* GlobTool
const writetool = yield* WriteTool
const edit = yield* EditTool
@@ -195,7 +195,7 @@ export const layer: Layer.Layer<
const tool = yield* Effect.all({
invalid: Tool.init(invalid),
bash: Tool.init(bash),
shell: Tool.init(shell),
read: Tool.init(read),
glob: Tool.init(globtool),
grep: Tool.init(greptool),
@@ -217,7 +217,7 @@ export const layer: Layer.Layer<
builtin: [
tool.invalid,
...(questionEnabled ? [tool.question] : []),
tool.bash,
tool.shell,
tool.read,
tool.glob,
tool.grep,