diff --git a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx index 9181e0f1..c1d394b3 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/sidebar-tsx/SidebarChat.tsx @@ -28,7 +28,7 @@ import { WarningBox } from '../void-settings-tsx/WarningBox.js'; import { getModelSelectionState, getModelCapabilities } from '../../../../common/modelCapabilities.js'; import { AlertTriangle, ChevronRight, Dot, Pencil, X } from 'lucide-react'; import { ChatMessage, StagingSelectionItem, ToolMessage, ToolRequestApproval } from '../../../../common/chatThreadServiceTypes.js'; -import { ToolCallParams, ToolName, ToolNameWithApproval } from '../../../../common/toolsServiceTypes.js'; +import { ResolveReason, ToolCallParams, ToolName, ToolNameWithApproval } from '../../../../common/toolsServiceTypes.js'; import { getLanguageFromModel } from '../../../../common/helpers/getLanguage.js'; import { dirname } from '../../../../../../../base/common/resources.js'; import { useApplyButtonHTML } from '../markdown/ApplyBlockHoverButtons.js'; @@ -1143,21 +1143,6 @@ const ListableToolItem = ({ name, onClick, isSmall, className, showDot }: { name } -const EditToolChildren = ({ uri, changeDescription }: { uri: URI, changeDescription: string }) => { - const accessor = useAccessor() - const commandService = accessor.get('ICommandService') - return - { commandService.executeCommand('vscode.open', uri, { preview: true }) }} - /> -
- -
-
-} const EditToolApplyButton = ({ changeDescription, applyBoxId, uri }: { changeDescription: string, applyBoxId: string, uri: URI }) => { const { statusIndicatorHTML, buttonsHTML } = useApplyButtonHTML({ codeStr: changeDescription, applyBoxId, uri }) return
@@ -1167,6 +1152,51 @@ const EditToolApplyButton = ({ changeDescription, applyBoxId, uri }: { changeDes } +const EditToolChildren = ({ uri, changeDescription }: { uri: URI, changeDescription: string }) => { + const accessor = useAccessor() + const commandService = accessor.get('ICommandService') + return + { commandService.executeCommand('vscode.open', uri, { preview: true }) }} + /> +
+
+ +
+
+
+} +const TerminalToolChildren = ({ command, terminalId, result, resolveReason }: { command: string, terminalId: string, result: string, resolveReason: ResolveReason }) => { + const accessor = useAccessor() + const terminalToolsService = accessor.get('ITerminalToolService') + + const resultStr = resolveReason.type === 'done' ? (resolveReason.exitCode !== 0 ? `\nError: exit code ${resolveReason.exitCode}` : null) + : resolveReason.type === 'bgtask' ? null : + resolveReason.type === 'timeout' ? `\n(partial results; request timed out)` : + resolveReason.type === 'toofull' ? `\n(truncated)` + : null + + return + terminalToolsService.openTerminal(terminalId)} + /> +
+
+ {resolveReason.type === 'bgtask' ? 'Result so far:\n' : null} + {result} + {resultStr} +
+
+
+} + + const toolNameToComponent: { [T in ToolName]: { requestWrapper: T extends ToolNameWithApproval ? ((props: { toolRequest: ToolRequestApproval }) => React.ReactNode) : null, resultWrapper: (props: { toolMessage: ToolMessage, messageIdx: number }) => React.ReactNode, @@ -1222,6 +1252,7 @@ const toolNameToComponent: { [T in ToolName]: { : {value.children.map((child, i) => ( { commandService.executeCommand('workbench.view.explorer'); explorerService.select(child.uri, true); @@ -1262,6 +1293,7 @@ const toolNameToComponent: { [T in ToolName]: { : {value.uris.map((uri, i) => ( { commandService.executeCommand('vscode.open', uri, { preview: true }) }} />))} {value.hasNextPage && @@ -1300,6 +1332,7 @@ const toolNameToComponent: { [T in ToolName]: { : {value.uris.map((uri, i) => ( { commandService.executeCommand('vscode.open', uri, { preview: true }) }} />))} {value.hasNextPage && @@ -1504,23 +1537,12 @@ const toolNameToComponent: { [T in ToolName]: { const { command } = toolMessage.result.params const { terminalId, resolveReason, result } = toolMessage.result.value - componentParams.children =
-
terminalToolsService.openTerminal(terminalId)} - >$ {command}
- -
- - {resolveReason.type === 'bgtask' ? 'Result so far:\n' : null} - {result} - {resolveReason.type === 'done' ? (resolveReason.exitCode !== 0 ? `\nError: exit code ${resolveReason.exitCode}` : null) - : resolveReason.type === 'bgtask' ? null : - resolveReason.type === 'timeout' ? `\n(partial results; request timed out)` : - resolveReason.type === 'toofull' ? `\n(truncated)` - : null - } -
+ componentParams.children = if (resolveReason.type === 'bgtask') componentParams.desc2 = '(background task)'