Skip to content

Commit accbfbf

Browse files
chore(cecli): pin dev-integration — mirror tool execute output to UI
Cherry-pick 3a84e9f37 (upstream PR cecli-dev/cecli#573). Tool cards show collapsible output for all tools with multiple result chunks. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fd9ee40 commit accbfbf

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

cecli

Submodule cecli updated 58 files

src/components/chat/ToolInvocationCard.tsx

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface ToolInvocationCardProps {
2323

2424
export function ToolInvocationCard({ group, onDismiss }: ToolInvocationCardProps) {
2525
const [showOutput, setShowOutput] = useState(false)
26-
const isCommandTool = /^(command|ls)$/i.test(group.toolName)
26+
const hasExtraOutput = group.results.length > 1
2727
const borderColor = group.failed ? 'error.main' : 'divider'
2828
const headerColor = group.failed ? 'error.main' : 'primary.main'
2929

@@ -105,8 +105,8 @@ export function ToolInvocationCard({ group, onDismiss }: ToolInvocationCardProps
105105
>
106106
{group.results[0]}
107107
</Typography>
108-
{/* Remaining results: collapsible for Command, inline for everything else */}
109-
{group.results.length > 1 && isCommandTool ? (
108+
{/* Remaining results: collapsible when there is more than one chunk */}
109+
{hasExtraOutput ? (
110110
<>
111111
<Box
112112
onClick={() => setShowOutput((v) => !v)}
@@ -120,7 +120,8 @@ export function ToolInvocationCard({ group, onDismiss }: ToolInvocationCardProps
120120
}}
121121
/>
122122
<Typography variant="caption" color="text.secondary">
123-
{showOutput ? 'Hide output' : 'Show output'} ({group.results.length - 1} line{group.results.length - 1 !== 1 ? 's' : ''})
123+
{showOutput ? 'Hide output' : 'Show output'} ({group.results.length - 1} chunk
124+
{group.results.length - 1 !== 1 ? 's' : ''})
124125
</Typography>
125126
</Box>
126127
<Collapse in={showOutput}>
@@ -142,21 +143,6 @@ export function ToolInvocationCard({ group, onDismiss }: ToolInvocationCardProps
142143
</Typography>
143144
</Collapse>
144145
</>
145-
) : group.results.length > 1 ? (
146-
<Typography
147-
component="pre"
148-
variant="body2"
149-
sx={{
150-
m: 0,
151-
mt: 0.5,
152-
whiteSpace: 'pre-wrap',
153-
overflowX: 'auto',
154-
color: 'text.primary',
155-
fontSize: '0.75rem',
156-
}}
157-
>
158-
{group.results.slice(1).join('\n')}
159-
</Typography>
160146
) : null}
161147
</>
162148
)}

0 commit comments

Comments
 (0)