ok
This commit is contained in:
parent
39088e1a1e
commit
f1547de528
57 changed files with 311 additions and 295 deletions
|
|
@ -271,7 +271,7 @@ export type ToolInfo = {
|
|||
subtitle?: string
|
||||
}
|
||||
|
||||
const SHELL = new Set(["bash", "pwsh", "powershell"])
|
||||
const SHELL = new Set(["shell"])
|
||||
|
||||
function agentTitle(i18n: UiI18n, type?: string) {
|
||||
if (!type) return i18n.t("ui.tool.agent.default")
|
||||
|
|
@ -1822,7 +1822,7 @@ ToolRegistry.register({
|
|||
})
|
||||
|
||||
ToolRegistry.register({
|
||||
name: "bash",
|
||||
name: "shell",
|
||||
render(props) {
|
||||
const i18n = useI18n()
|
||||
const pending = () => props.status === "pending" || props.status === "running"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Interactive playground for animating the Shell tool subtitle ("submessage") in t
|
|||
|
||||
### Production component path
|
||||
- Trigger layout: \`packages/ui/src/components/basic-tool.tsx\`
|
||||
- Bash tool subtitle source: \`packages/ui/src/components/message-part.tsx\` (tool: \`bash\`, \`trigger.subtitle\`)
|
||||
- Shell tool subtitle source: \`packages/ui/src/components/message-part.tsx\` (tool: \`shell\`, \`trigger.subtitle\`)
|
||||
|
||||
### What this playground tunes
|
||||
- Width reveal (spring-driven pixel width via \`useSpring\`)
|
||||
|
|
|
|||
|
|
@ -315,8 +315,8 @@ const TOOL_SAMPLES = {
|
|||
title: "Found 2 matches",
|
||||
metadata: {},
|
||||
},
|
||||
bash: {
|
||||
tool: "bash",
|
||||
shell: {
|
||||
tool: "shell",
|
||||
input: { command: "bun test --filter session", description: "Run session tests" },
|
||||
output:
|
||||
"bun test v1.3.11\n\n✓ session-turn.test.tsx (3 tests) 45ms\n✓ message-part.test.tsx (7 tests) 120ms\n\nTest Suites: 2 passed, 2 total\nTests: 10 passed, 10 total\nTime: 0.89s",
|
||||
|
|
@ -1309,7 +1309,7 @@ function Playground() {
|
|||
toolPart(TOOL_SAMPLES.glob),
|
||||
toolPart(TOOL_SAMPLES.grep),
|
||||
toolPart(TOOL_SAMPLES.edit),
|
||||
toolPart(TOOL_SAMPLES.bash),
|
||||
toolPart(TOOL_SAMPLES.shell),
|
||||
textPart(MARKDOWN_SAMPLES.mixed),
|
||||
])
|
||||
}
|
||||
|
|
@ -1332,7 +1332,7 @@ function Playground() {
|
|||
toolPart(TOOL_SAMPLES.glob),
|
||||
toolPart(TOOL_SAMPLES.grep),
|
||||
toolPart(TOOL_SAMPLES.edit),
|
||||
toolPart(TOOL_SAMPLES.bash),
|
||||
toolPart(TOOL_SAMPLES.shell),
|
||||
textPart(MARKDOWN_SAMPLES.blockquote),
|
||||
])
|
||||
addContextGroupTurn()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ const docs = `### Overview
|
|||
Tool call failure summary styled like a tool trigger.
|
||||
|
||||
### API
|
||||
- Required: \`tool\` (tool id, e.g. apply_patch, bash)
|
||||
- Required: \`tool\` (tool id, e.g. apply_patch, shell)
|
||||
- Required: \`error\` (error string)
|
||||
|
||||
### Behavior
|
||||
|
|
@ -19,8 +19,8 @@ const samples = [
|
|||
"apply_patch verification failed: Failed to find expected lines in /Users/davidhill/Documents/Local/opencode/packages/ui/src/components/session-turn.tsx",
|
||||
},
|
||||
{
|
||||
tool: "bash",
|
||||
error: "bash Command failed: exit code 1: bun test --watch",
|
||||
tool: "shell",
|
||||
error: "shell Command failed: exit code 1: bun test --watch",
|
||||
},
|
||||
{
|
||||
tool: "read",
|
||||
|
|
@ -72,7 +72,7 @@ export default {
|
|||
argTypes: {
|
||||
tool: {
|
||||
control: "select",
|
||||
options: ["apply_patch", "bash", "read", "glob", "grep", "webfetch", "websearch", "codesearch", "question"],
|
||||
options: ["apply_patch", "shell", "read", "glob", "grep", "webfetch", "websearch", "codesearch", "question"],
|
||||
},
|
||||
error: {
|
||||
control: "text",
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ export function ToolErrorCard(props: ToolErrorCardProps) {
|
|||
webfetch: "ui.tool.webfetch",
|
||||
websearch: "ui.tool.websearch",
|
||||
codesearch: "ui.tool.codesearch",
|
||||
shell: "ui.tool.shell",
|
||||
bash: "ui.tool.shell",
|
||||
apply_patch: "ui.tool.patch",
|
||||
question: "ui.tool.questions",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue