|
@@ -23,6 +23,7 @@ import {
|
|
|
MacOSScrollAccel,
|
|
MacOSScrollAccel,
|
|
|
type ScrollAcceleration,
|
|
type ScrollAcceleration,
|
|
|
TextAttributes,
|
|
TextAttributes,
|
|
|
|
|
+ RGBA,
|
|
|
} from "@opentui/core"
|
|
} from "@opentui/core"
|
|
|
import { Prompt, type PromptRef } from "@tui/component/prompt"
|
|
import { Prompt, type PromptRef } from "@tui/component/prompt"
|
|
|
import type { AssistantMessage, Part, ToolPart, UserMessage, TextPart, ReasoningPart } from "@opencode-ai/sdk/v2"
|
|
import type { AssistantMessage, Part, ToolPart, UserMessage, TextPart, ReasoningPart } from "@opencode-ai/sdk/v2"
|
|
@@ -1410,7 +1411,14 @@ function ToolTitle(props: { fallback: string; when: any; icon: string; children:
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function InlineTool(props: { icon: string; complete: any; pending: string; children: JSX.Element; part: ToolPart }) {
|
|
|
|
|
|
|
+function InlineTool(props: {
|
|
|
|
|
+ icon: string
|
|
|
|
|
+ iconColor?: RGBA
|
|
|
|
|
+ complete: any
|
|
|
|
|
+ pending: string
|
|
|
|
|
+ children: JSX.Element
|
|
|
|
|
+ part: ToolPart
|
|
|
|
|
+}) {
|
|
|
const [margin, setMargin] = createSignal(0)
|
|
const [margin, setMargin] = createSignal(0)
|
|
|
const { theme } = useTheme()
|
|
const { theme } = useTheme()
|
|
|
const ctx = use()
|
|
const ctx = use()
|
|
@@ -1461,7 +1469,7 @@ function InlineTool(props: { icon: string; complete: any; pending: string; child
|
|
|
>
|
|
>
|
|
|
<text paddingLeft={3} fg={fg()} attributes={denied() ? TextAttributes.STRIKETHROUGH : undefined}>
|
|
<text paddingLeft={3} fg={fg()} attributes={denied() ? TextAttributes.STRIKETHROUGH : undefined}>
|
|
|
<Show fallback={<>~ {props.pending}</>} when={props.complete}>
|
|
<Show fallback={<>~ {props.pending}</>} when={props.complete}>
|
|
|
- <span style={{ bold: true }}>{props.icon}</span> {props.children}
|
|
|
|
|
|
|
+ <span style={{ fg: props.iconColor }}>{props.icon}</span> {props.children}
|
|
|
</Show>
|
|
</Show>
|
|
|
</text>
|
|
</text>
|
|
|
<Show when={error() && !denied()}>
|
|
<Show when={error() && !denied()}>
|
|
@@ -1644,8 +1652,10 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
|
|
const { theme } = useTheme()
|
|
const { theme } = useTheme()
|
|
|
const keybind = useKeybind()
|
|
const keybind = useKeybind()
|
|
|
const { navigate } = useRoute()
|
|
const { navigate } = useRoute()
|
|
|
|
|
+ const local = useLocal()
|
|
|
|
|
|
|
|
const current = createMemo(() => props.metadata.summary?.findLast((x) => x.state.status !== "pending"))
|
|
const current = createMemo(() => props.metadata.summary?.findLast((x) => x.state.status !== "pending"))
|
|
|
|
|
+ const color = createMemo(() => local.agent.color(props.input.subagent_type ?? "unknown"))
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<Switch>
|
|
<Switch>
|
|
@@ -1679,11 +1689,13 @@ function Task(props: ToolProps<typeof TaskTool>) {
|
|
|
<Match when={true}>
|
|
<Match when={true}>
|
|
|
<InlineTool
|
|
<InlineTool
|
|
|
icon="◉"
|
|
icon="◉"
|
|
|
|
|
+ iconColor={color()}
|
|
|
pending="Delegating..."
|
|
pending="Delegating..."
|
|
|
complete={props.input.subagent_type ?? props.input.description}
|
|
complete={props.input.subagent_type ?? props.input.description}
|
|
|
part={props.part}
|
|
part={props.part}
|
|
|
>
|
|
>
|
|
|
- {Locale.titlecase(props.input.subagent_type ?? "unknown")} Task "{props.input.description}"
|
|
|
|
|
|
|
+ <span style={{ fg: theme.text }}>{Locale.titlecase(props.input.subagent_type ?? "unknown")}</span> Task "
|
|
|
|
|
+ {props.input.description}"
|
|
|
</InlineTool>
|
|
</InlineTool>
|
|
|
</Match>
|
|
</Match>
|
|
|
</Switch>
|
|
</Switch>
|