import type { JsonValue } from "@berry/api"; import { code, type ToolRenderer, type ToolView } from "@berry/api/web.ts"; import * as j from "@char/justin"; import { ansiOutput } from "./ansi-view.ts"; const argsOf = j.validation.compile( j.obj({ command: j.optional(j.string), timeout: j.optional(j.number) }), ); const outputOf = j.validation.compile(j.obj({ output: j.string })); const rawOutputOf = j.validation.compile(j.obj({ rawOutput: j.string })); const exitCodeOf = j.validation.compile(j.obj({ exitCode: j.number })); export function bashView(language = "bash"): ToolView { const prompt =
; const rendered =