Merge pull request #36 from continuedev/tool-permissions
update version to 1.3.2 and improve terminal command output display
This commit is contained in:
commit
6683e8dcae
1 changed files with 31 additions and 4 deletions
|
|
@ -42,6 +42,36 @@ const ToolResultSummary: React.FC<ToolResultSummaryProps> = ({
|
|||
}
|
||||
}
|
||||
|
||||
// Handle terminal command output specially
|
||||
if (toolName === "run_terminal_command") {
|
||||
const isStderr = content.startsWith("Stderr:");
|
||||
const actualOutput = isStderr ? content.slice(7).trim() : content;
|
||||
const outputLines = actualOutput.split("\n").length;
|
||||
|
||||
if (outputLines <= 16) {
|
||||
// Show actual output for 16 lines or fewer
|
||||
return (
|
||||
<Box flexDirection="column">
|
||||
<Box>
|
||||
<Text color="gray">⎿ </Text>
|
||||
<Text color="gray"> Terminal output:</Text>
|
||||
</Box>
|
||||
<Box paddingLeft={2}>
|
||||
<Text color={isStderr ? "red" : "white"}>{actualOutput}</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
} else {
|
||||
// Show summary for more than 16 lines
|
||||
return (
|
||||
<Box>
|
||||
<Text color="gray">⎿ </Text>
|
||||
<Text color="gray"> Command output ({outputLines} lines)</Text>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle all other cases with text summary
|
||||
const getSummary = () => {
|
||||
// Convert absolute paths to relative paths from workspace root
|
||||
|
|
@ -74,9 +104,6 @@ const ToolResultSummary: React.FC<ToolResultSummaryProps> = ({
|
|||
case "search_code":
|
||||
return `Found ${lines} ${lines === 1 ? "match" : "matches"}`;
|
||||
|
||||
case "run_terminal_command":
|
||||
return `Command output (${lines} lines)`;
|
||||
|
||||
case "view_diff":
|
||||
return `Diff output (${lines} lines)`;
|
||||
|
||||
|
|
@ -100,4 +127,4 @@ const ToolResultSummary: React.FC<ToolResultSummaryProps> = ({
|
|||
);
|
||||
};
|
||||
|
||||
export default ToolResultSummary;
|
||||
export default ToolResultSummary;
|
||||
Loading…
Add table
Reference in a new issue