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 041cebfe..bad585f8 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 @@ -658,6 +658,7 @@ type ToolHeaderParams = { numResults?: number; hasNextPage?: boolean; children?: React.ReactNode; + bottomChildren?: React.ReactNode; onClick?: () => void; isOpen?: boolean, } @@ -1723,7 +1724,10 @@ const toolNameToComponent: { [T in ToolName]: { resultWrapper: ResultWrapper, // add children if (toolMessage.type !== 'tool_error') { - const { params } = toolMessage + const { params, result } = toolMessage + + // componentParams.bottomChildren = + componentParams.children = { const acceptRejectButtons =
void }) => { +export const VoidButtonBgDarken = ({ children, disabled, onClick, className }: { children: React.ReactNode; disabled?: boolean; onClick: () => void; className?: string }) => { return } diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx index 860ee06b..29bc9106 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx @@ -19,6 +19,7 @@ import { WarningBox } from './WarningBox.js' import { os } from '../../../../common/helpers/systemInfo.js' import { IconLoading, IconX } from '../sidebar-tsx/SidebarChat.js' import { getModelCapabilities, getProviderCapabilities, ollamaRecommendedModels, VoidStaticModelInfo } from '../../../../common/modelCapabilities.js' +import VoidImage from './VoidImage.js' const ButtonLeftTextRightOption = ({ text, leftButton }: { text: string, leftButton?: React.ReactNode }) => { @@ -544,7 +545,10 @@ export const FeaturesTab = () => { {/*

{`Instructions:`}

*/} {/*

{`Void can access any model that you host locally. We automatically detect your local models by default.`}

*/}

{`Void can access any model that you host locally. We automatically detect your local models by default.`}

- {ollamaSetupInstructions} + +
+ {ollamaSetupInstructions} +
@@ -805,7 +809,7 @@ const transferTheseFilesOfOS = (os: 'mac' | 'windows' | 'linux' | null, fromEdit } -const OneClickSwitchButton = ({ fromEditor = 'VS Code' }: { fromEditor?: TransferEditorType }) => { +const OneClickSwitchButton = ({ fromEditor = 'VS Code', className = '' }: { fromEditor?: TransferEditorType, className?: string }) => { const accessor = useAccessor() const fileService = accessor.get('IFileService') @@ -866,7 +870,7 @@ const OneClickSwitchButton = ({ fromEditor = 'VS Code' }: { fromEditor?: Transfe } return <> - + {transferState.type === 'done' ? `Transfer from ${fromEditor}` : transferState.type === 'loading' ? Transferring : transferState.type === 'justfinished' ? @@ -889,10 +893,10 @@ const GeneralTab = () => {

One-Click Switch

{`Transfer your settings from another editor to Void in one click.`}

-
- - - +
+ + +
@@ -903,29 +907,29 @@ const GeneralTab = () => {

{`IDE settings, keyboard settings, and theme customization.`}

- { commandService.executeCommand('workbench.action.openSettings') }}> + { commandService.executeCommand('workbench.action.openSettings') }}> General Settings
- { commandService.executeCommand('workbench.action.openGlobalKeybindings') }}> + { commandService.executeCommand('workbench.action.openGlobalKeybindings') }}> Keyboard Settings
- { commandService.executeCommand('workbench.action.selectTheme') }}> + { commandService.executeCommand('workbench.action.selectTheme') }}> Theme Settings
- { nativeHostService.showItemInFolder(environmentService.logsHome.fsPath) }}> + { nativeHostService.showItemInFolder(environmentService.logsHome.fsPath) }}> Open Logs
-
+

AI Instructions

{`Instructions to include on all AI requests.`}

@@ -943,7 +947,7 @@ export const Settings = () => { const [tab, setTab] = useState('models') - const deleteme = true + const deleteme = false if (deleteme) { return
@@ -964,10 +968,10 @@ export const Settings = () => { {/* tabs */}
- -
@@ -1100,7 +1104,7 @@ const PreviousButton = ({ onClick, ...props }: { onClick: () => void } & React.B } -const ollamaSetupInstructions =
+const ollamaSetupInstructions =
@@ -1420,12 +1424,12 @@ const VoidOnboarding = () => { // TODO add a description next to the skip button saying (you can always restart the onboarding in Settings) const contentOfIdx: { [pageIndex: number]: React.ReactNode } = { 0:
- - Welcome to Void + +
Welcome to Void
+ - Image
- Void Logo +
diff --git a/src/vs/workbench/contrib/void/browser/toolsService.ts b/src/vs/workbench/contrib/void/browser/toolsService.ts index 51282bf7..83249778 100644 --- a/src/vs/workbench/contrib/void/browser/toolsService.ts +++ b/src/vs/workbench/contrib/void/browser/toolsService.ts @@ -8,7 +8,7 @@ import { QueryBuilder } from '../../../services/search/common/queryBuilder.js' import { ISearchService } from '../../../services/search/common/search.js' import { IEditCodeService } from './editCodeServiceInterface.js' import { ITerminalToolService } from './terminalToolService.js' -import { ToolCallParams, ToolResultType } from '../common/toolsServiceTypes.js' +import { LintErrorItem, ToolCallParams, ToolResultType } from '../common/toolsServiceTypes.js' import { IVoidModelService } from '../common/voidModelService.js' import { EndOfLinePreference } from '../../../../editor/common/model.js' import { basename } from '../../../../base/common/path.js' @@ -359,13 +359,18 @@ export class ToolsService implements IToolsService { const lintErrorsPromise = applyDonePromise.then(async () => { await timeout(500) - const lintErrorsStr = this.markerService - .read({ resource: uri }) - .map(l => l.message) - .join('\n') - if (!lintErrorsStr) return { lintErrorsStr: null } - return { lintErrorsStr } + const lintErrors = this.markerService + .read({ resource: uri }) + .map(l => ({ + code: typeof l.code === 'string' ? l.code : l.code?.value || '', + message: l.message, + startLineNumber: l.startLineNumber, + endLineNumber: l.endLineNumber, + } satisfies LintErrorItem)) + + if (!lintErrors.length) return { lintErrors: null } + return { lintErrors, } }) return { result: lintErrorsPromise, interruptTool } @@ -379,6 +384,8 @@ export class ToolsService implements IToolsService { const nextPageStr = (hasNextPage: boolean) => hasNextPage ? '\n\n(more on next page...)' : '' + const lintErrorsStr = (lintErrors: LintErrorItem[]) => lintErrors.map((e, i) => `Error ${i + 1}:\nLines Affected: ${e.startLineNumber}-${e.endLineNumber}\nError message:${e.message}`).join('\n\n') + // given to the LLM after the call this.stringOfResult = { read_file: (params, result) => { @@ -405,8 +412,10 @@ export class ToolsService implements IToolsService { return `URI ${params.uri.fsPath} successfully deleted.` }, edit_file: (params, result) => { - const additionalStr = result.lintErrorsStr ? `Lint errors found after change:\n${result.lintErrorsStr}.\nIf this is related to a change made while calling this tool, you might want to fix the error.` : `No lint errors found.` - return `Change successfully made to ${params.uri.fsPath}. ${additionalStr}` + + const additionalStr = result.lintErrors ? `Lint errors found after change:\n${lintErrorsStr(result.lintErrors)}.\nIf this is related to a change made while calling this tool, you might want to fix the error.` : `No lint errors found.` + + return `Change successfully made to ${params.uri.fsPath}.${additionalStr}` }, run_terminal_command: (params, result) => { const { diff --git a/src/vs/workbench/contrib/void/common/chatThreadServiceTypes.ts b/src/vs/workbench/contrib/void/common/chatThreadServiceTypes.ts index 8ebaf213..18df3709 100644 --- a/src/vs/workbench/contrib/void/common/chatThreadServiceTypes.ts +++ b/src/vs/workbench/contrib/void/common/chatThreadServiceTypes.ts @@ -21,7 +21,7 @@ export type ToolMessage = { | { type: 'running_now', result: null, name: T, params: ToolCallParams[T], } | { type: 'tool_error', result: string, name: T, params: ToolCallParams[T], } // error when tool was running - | { type: 'success', result: ToolResultType[T], name: T, params: ToolCallParams[T], } + | { type: 'success', result: Awaited, name: T, params: ToolCallParams[T], } | { type: 'rejected', result: null, name: T, params: ToolCallParams[T], } ) // user rejected diff --git a/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts b/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts index b1a402b5..f8fe0951 100644 --- a/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts +++ b/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts @@ -5,6 +5,8 @@ import { ToolName } from './prompt/prompts.js'; export type TerminalResolveReason = { type: 'toofull' | 'timeout' | 'bgtask' } | { type: 'done', exitCode: number } +export type LintErrorItem = { code: string, message: string, startLineNumber: number, endLineNumber: number } + // Partial of IFileStat export type ShallowDirectoryItem = { uri: URI; @@ -42,7 +44,7 @@ export type ToolResultType = { 'search_pathnames_only': { uris: URI[], hasNextPage: boolean }, 'search_files': { uris: URI[], hasNextPage: boolean }, // --- - 'edit_file': Promise<{ lintErrorsStr: string | null }>, + 'edit_file': Promise<{ lintErrors: LintErrorItem[] | null }>, 'create_file_or_folder': {}, 'delete_file_or_folder': {}, 'run_terminal_command': { terminalId: string, didCreateTerminal: boolean, result: string; resolveReason: TerminalResolveReason; },