Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import type { ApplyPatchTool } from "@/tool/apply_patch"
import type { WebFetchTool } from "@/tool/webfetch"
import type { TaskTool } from "@/tool/task"
import type { QuestionTool } from "@/tool/question"
import type { SkillTool } from "@/tool/skill"
import { useKeyboard, useRenderer, useTerminalDimensions, type JSX } from "@opentui/solid"
import { useSDK } from "@tui/context/sdk"
import { useCommandDialog } from "@tui/component/dialog-command"
Expand Down Expand Up @@ -1447,6 +1448,9 @@ function ToolPart(props: { last: boolean; part: ToolPart; message: AssistantMess
<Match when={props.part.tool === "question"}>
<Question {...toolprops} />
</Match>
<Match when={props.part.tool === "skill"}>
<Skill {...toolprops} />
</Match>
<Match when={true}>
<GenericTool {...toolprops} />
</Match>
Expand Down Expand Up @@ -1797,7 +1801,7 @@ function Task(props: ToolProps<typeof TaskTool>) {

return (
<Switch>
<Match when={props.metadata.summary?.length}>
<Match when={props.input.description || props.input.subagent_type}>
<BlockTool
title={"# " + Locale.titlecase(props.input.subagent_type ?? "unknown") + " Task"}
onClick={
Expand All @@ -1809,7 +1813,7 @@ function Task(props: ToolProps<typeof TaskTool>) {
>
<box>
<text style={{ fg: theme.textMuted }}>
{props.input.description} ({props.metadata.summary?.length} toolcalls)
{props.input.description} ({props.metadata.summary?.length ?? 0} toolcalls)
</text>
<Show when={current()}>
<text style={{ fg: current()!.state.status === "error" ? theme.error : theme.textMuted }}>
Expand All @@ -1818,22 +1822,17 @@ function Task(props: ToolProps<typeof TaskTool>) {
</text>
</Show>
</box>
<text fg={theme.text}>
{keybind.print("session_child_cycle")}
<span style={{ fg: theme.textMuted }}> view subagents</span>
</text>
<Show when={props.metadata.sessionId}>
<text fg={theme.text}>
{keybind.print("session_child_cycle")}
<span style={{ fg: theme.textMuted }}> view subagents</span>
</text>
</Show>
</BlockTool>
</Match>
<Match when={true}>
<InlineTool
icon="◉"
iconColor={color()}
pending="Delegating..."
complete={props.input.subagent_type ?? props.input.description}
part={props.part}
>
<span style={{ fg: theme.text }}>{Locale.titlecase(props.input.subagent_type ?? "unknown")}</span> Task "
{props.input.description}"
<InlineTool icon="#" pending="Delegating..." complete={props.input.subagent_type} part={props.part}>
{props.input.subagent_type} Task {props.input.description}
</InlineTool>
</Match>
</Switch>
Expand Down Expand Up @@ -2038,6 +2037,14 @@ function Question(props: ToolProps<typeof QuestionTool>) {
)
}

function Skill(props: ToolProps<typeof SkillTool>) {
return (
<InlineTool icon="→" pending="Loading skill..." complete={props.input.name} part={props.part}>
Skill "{props.input.name}"
</InlineTool>
)
}

function normalizePath(input?: string) {
if (!input) return ""
if (path.isAbsolute(input)) {
Expand Down
Loading