diff options
| author | Dax <[email protected]> | 2026-01-31 22:59:46 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-31 22:59:46 -0500 |
| commit | 9b8b9e28e26598102f29220060892aeb657882af (patch) | |
| tree | b12f299fa2ababaed6dab6cfab5a9ef5dc201a3c | |
| parent | 2a56a1d6ef1b992aebcaec29fe2571ce61496c0e (diff) | |
| download | opencode-9b8b9e28e26598102f29220060892aeb657882af.tar.gz opencode-9b8b9e28e26598102f29220060892aeb657882af.zip | |
feat(tui): add UI for skill tool in session view (#11561)
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/routes/session/index.tsx | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx index 49bb40298..e5b3dc440 100644 --- a/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/routes/session/index.tsx @@ -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" @@ -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> @@ -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={ @@ -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 }}> @@ -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> @@ -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)) { |
