|
@@ -1447,10 +1447,11 @@ function InlineTool(props: { icon: string; complete: any; pending: string; child
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function BlockTool(props: { title: string; children: JSX.Element; onClick?: () => void }) {
|
|
|
|
|
|
|
+function BlockTool(props: { title: string; children: JSX.Element; onClick?: () => void; part?: ToolPart }) {
|
|
|
const { theme } = useTheme()
|
|
const { theme } = useTheme()
|
|
|
const renderer = useRenderer()
|
|
const renderer = useRenderer()
|
|
|
const [hover, setHover] = createSignal(false)
|
|
const [hover, setHover] = createSignal(false)
|
|
|
|
|
+ const error = createMemo(() => (props.part?.state.status === "error" ? props.part.state.error : undefined))
|
|
|
return (
|
|
return (
|
|
|
<box
|
|
<box
|
|
|
border={["left"]}
|
|
border={["left"]}
|
|
@@ -1473,6 +1474,9 @@ function BlockTool(props: { title: string; children: JSX.Element; onClick?: () =
|
|
|
{props.title}
|
|
{props.title}
|
|
|
</text>
|
|
</text>
|
|
|
{props.children}
|
|
{props.children}
|
|
|
|
|
+ <Show when={error()}>
|
|
|
|
|
+ <text fg={theme.error}>{error()}</text>
|
|
|
|
|
+ </Show>
|
|
|
</box>
|
|
</box>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -1483,7 +1487,7 @@ function Bash(props: ToolProps<typeof BashTool>) {
|
|
|
return (
|
|
return (
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Match when={props.metadata.output !== undefined}>
|
|
<Match when={props.metadata.output !== undefined}>
|
|
|
- <BlockTool title={"# " + (props.input.description ?? "Shell")}>
|
|
|
|
|
|
|
+ <BlockTool title={"# " + (props.input.description ?? "Shell")} part={props.part}>
|
|
|
<box gap={1}>
|
|
<box gap={1}>
|
|
|
<text fg={theme.text}>$ {props.input.command}</text>
|
|
<text fg={theme.text}>$ {props.input.command}</text>
|
|
|
<text fg={theme.text}>{output()}</text>
|
|
<text fg={theme.text}>{output()}</text>
|
|
@@ -1514,7 +1518,7 @@ function Write(props: ToolProps<typeof WriteTool>) {
|
|
|
return (
|
|
return (
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Match when={props.metadata.diagnostics !== undefined}>
|
|
<Match when={props.metadata.diagnostics !== undefined}>
|
|
|
- <BlockTool title={"# Wrote " + normalizePath(props.input.filePath!)}>
|
|
|
|
|
|
|
+ <BlockTool title={"# Wrote " + normalizePath(props.input.filePath!)} part={props.part}>
|
|
|
<line_number fg={theme.textMuted} minWidth={3} paddingRight={1}>
|
|
<line_number fg={theme.textMuted} minWidth={3} paddingRight={1}>
|
|
|
<code
|
|
<code
|
|
|
conceal={false}
|
|
conceal={false}
|
|
@@ -1629,6 +1633,7 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
|
|
? () => navigate({ type: "session", sessionID: props.metadata.sessionId! })
|
|
? () => navigate({ type: "session", sessionID: props.metadata.sessionId! })
|
|
|
: undefined
|
|
: undefined
|
|
|
}
|
|
}
|
|
|
|
|
+ part={props.part}
|
|
|
>
|
|
>
|
|
|
<box>
|
|
<box>
|
|
|
<text style={{ fg: theme.textMuted }}>
|
|
<text style={{ fg: theme.textMuted }}>
|
|
@@ -1685,7 +1690,7 @@ function Edit(props: ToolProps<typeof EditTool>) {
|
|
|
return (
|
|
return (
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Match when={props.metadata.diff !== undefined}>
|
|
<Match when={props.metadata.diff !== undefined}>
|
|
|
- <BlockTool title={"← Edit " + normalizePath(props.input.filePath!)}>
|
|
|
|
|
|
|
+ <BlockTool title={"← Edit " + normalizePath(props.input.filePath!)} part={props.part}>
|
|
|
<box paddingLeft={1}>
|
|
<box paddingLeft={1}>
|
|
|
<diff
|
|
<diff
|
|
|
diff={diffContent()}
|
|
diff={diffContent()}
|
|
@@ -1735,7 +1740,7 @@ function Patch(props: ToolProps<typeof PatchTool>) {
|
|
|
return (
|
|
return (
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Match when={props.output !== undefined}>
|
|
<Match when={props.output !== undefined}>
|
|
|
- <BlockTool title="# Patch">
|
|
|
|
|
|
|
+ <BlockTool title="# Patch" part={props.part}>
|
|
|
<box>
|
|
<box>
|
|
|
<text fg={theme.text}>{props.output?.trim()}</text>
|
|
<text fg={theme.text}>{props.output?.trim()}</text>
|
|
|
</box>
|
|
</box>
|
|
@@ -1754,7 +1759,7 @@ function TodoWrite(props: ToolProps<typeof TodoWriteTool>) {
|
|
|
return (
|
|
return (
|
|
|
<Switch>
|
|
<Switch>
|
|
|
<Match when={props.metadata.todos?.length}>
|
|
<Match when={props.metadata.todos?.length}>
|
|
|
- <BlockTool title="# Todos">
|
|
|
|
|
|
|
+ <BlockTool title="# Todos" part={props.part}>
|
|
|
<box>
|
|
<box>
|
|
|
<For each={props.input.todos ?? []}>
|
|
<For each={props.input.todos ?? []}>
|
|
|
{(todo) => <TodoItem status={todo.status} content={todo.content} />}
|
|
{(todo) => <TodoItem status={todo.status} content={todo.content} />}
|