@@ -1334,7 +1323,7 @@ const toolNameToComponent: { [T in ToolName]: {
:
{value.children.map((child, i) => ( {
commandService.executeCommand('vscode.open', child.uri, { preview: true })
// commandService.executeCommand('workbench.view.explorer'); // open in explorer folders view instead
@@ -1342,7 +1331,7 @@ const toolNameToComponent: { [T in ToolName]: {
}}
/>))}
{value.hasNextPage &&
-
+
}
}
@@ -1376,11 +1365,11 @@ const toolNameToComponent: { [T in ToolName]: {
:
{value.uris.map((uri, i) => ( { commandService.executeCommand('vscode.open', uri, { preview: true }) }}
/>))}
{value.hasNextPage &&
-
+
}
@@ -1415,11 +1404,11 @@ const toolNameToComponent: { [T in ToolName]: {
:
{value.uris.map((uri, i) => ( { commandService.executeCommand('vscode.open', uri, { preview: true }) }}
/>))}
{value.hasNextPage &&
-
+
}
@@ -1440,26 +1429,19 @@ const toolNameToComponent: { [T in ToolName]: {
const accessor = useAccessor()
const commandService = accessor.get('ICommandService')
const explorerService = accessor.get('IExplorerService')
- const title = toolNameToTitle[toolRequest.name].proposed
+ const title = toolNameToTitle[toolRequest.name].proposed(toolRequest.params.isFolder)
const desc1 = toolNameToDesc(toolRequest.name, toolRequest.params)
const icon = null
const isError = false
const componentParams: ToolHeaderParams = { title, desc1, isError, icon, }
- const { params } = toolRequest
-
- // TODO!!! would be cool to open up the lowest parent that exists
- // componentParams.onClick = () => {
- // // open the parent
- // }
-
return
},
resultWrapper: ({ toolMessage }) => {
const accessor = useAccessor()
const commandService = accessor.get('ICommandService')
- const title = toolNameToTitle[toolMessage.name].past
+ const title = toolNameToTitle[toolMessage.name].past(toolMessage.result.params?.isFolder ?? false)
const desc1 = toolNameToDesc(toolMessage.name, toolMessage.result.params)
const icon = null
@@ -1489,7 +1471,7 @@ const toolNameToComponent: { [T in ToolName]: {
requestWrapper: ({ toolRequest, }) => {
const accessor = useAccessor()
const commandService = accessor.get('ICommandService')
- const title = toolNameToTitle[toolRequest.name].proposed
+ const title = toolNameToTitle[toolRequest.name].proposed(toolRequest.params.isFolder)
const desc1 = toolNameToDesc(toolRequest.name, toolRequest.params)
const icon = null
@@ -1504,7 +1486,8 @@ const toolNameToComponent: { [T in ToolName]: {
resultWrapper: ({ toolMessage }) => {
const accessor = useAccessor()
const commandService = accessor.get('ICommandService')
- const title = toolMessage.result.type === 'success' ? toolNameToTitle[toolMessage.name].past : toolNameToTitle[toolMessage.name].proposed
+ const isFolder = toolMessage.result.params?.isFolder ?? false
+ const title = toolMessage.result.type === 'success' ? toolNameToTitle[toolMessage.name].past(isFolder) : toolNameToTitle[toolMessage.name].proposed(isFolder)
const desc1 = toolNameToDesc(toolMessage.name, toolMessage.result.params)
const icon = null
@@ -1626,12 +1609,26 @@ const toolNameToComponent: { [T in ToolName]: {
const { command } = toolMessage.result.params
const { terminalId, resolveReason, result } = toolMessage.result.value
- componentParams.children =
+ 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
+
+ componentParams.children =
+ terminalToolsService.openTerminal(terminalId)}
+ />
+
+ {resolveReason.type === 'bgtask' ? 'Result so far:\n' : null}
+ {result}
+ {resultStr}
+
+
+
if (resolveReason.type === 'bgtask')
componentParams.desc2 = '(background task)'
@@ -1683,7 +1680,7 @@ const ChatBubble = ({ chatMessage, isCommitted, messageIdx, isLast }: ChatBubble
}
else if (role === 'tool_request') {
const ToolRequestWrapper = toolNameToComponent[chatMessage.name].requestWrapper as React.FC<{ toolRequest: any }> // ts isnt smart enough...
- if (ToolRequestWrapper && isLast) { // if it's the last message
+ if (ToolRequestWrapper) { // && isLast // if it's the last message
return <>
diff --git a/src/vs/workbench/contrib/void/browser/toolsService.ts b/src/vs/workbench/contrib/void/browser/toolsService.ts
index e7461254..6abb6627 100644
--- a/src/vs/workbench/contrib/void/browser/toolsService.ts
+++ b/src/vs/workbench/contrib/void/browser/toolsService.ts
@@ -318,8 +318,11 @@ export class ToolsService implements IToolsService {
// ---
- create_uri: async ({ uri }) => {
- await fileService.createFile(uri)
+ create_uri: async ({ uri, isFolder }) => {
+ if (isFolder)
+ await fileService.createFolder(uri)
+ else
+ await fileService.createFile(uri)
return {}
},
diff --git a/src/vs/workbench/contrib/void/common/prompt/prompts.ts b/src/vs/workbench/contrib/void/common/prompt/prompts.ts
index d734be2f..aec37012 100644
--- a/src/vs/workbench/contrib/void/common/prompt/prompts.ts
+++ b/src/vs/workbench/contrib/void/common/prompt/prompts.ts
@@ -19,7 +19,7 @@ export const editToolDesc_toolDescription = `\
A high level description of the change you'd like to make in the file. This description will be handed to a dumber, faster model that will quickly apply the change.\
The model does not have ANY context except the file content and this description, so make sure to include all necessary information to make the change here.\
Typically the best description you can give is a code block of the form:\n${tripleTick[0]}\n// ... existing code ...\n{{change 1}}\n// ... existing code ...\n{{change2}}\n// ... existing code ...\n{{change 3}}\n...\n${tripleTick[1]}. \
-Wrap your output in triple ticks. Do NOT output the whole file here if possible, and try to write as LITTLE code as needed to describe the change.`
+Wrap all code in triple backticks. Do NOT output the whole file here if possible, and try to write as LITTLE code as needed to describe the change.`
diff --git a/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts b/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts
index e17f6cb5..d5eaca1e 100644
--- a/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts
+++ b/src/vs/workbench/contrib/void/common/toolsServiceTypes.ts
@@ -83,7 +83,7 @@ export const voidTools = {
create_uri: {
name: 'create_uri',
- description: `Creates a file or folder at the given path. To create a folder, ensure the path ends with a trailing slash. Fails gracefully if the file already exists. Missing ancestors in the path will be recursively created automatically.`,
+ description: `Create a file or folder at the given path. To create a folder, ensure the path ends with a trailing slash. Fails gracefully if the file already exists. Missing ancestors in the path will be recursively created automatically.`,
params: {
uri: { type: 'string', description: undefined },
},
@@ -92,7 +92,7 @@ export const voidTools = {
delete_uri: {
name: 'delete_uri',
- description: `Deletes the file or folder at the given path. Fails gracefully if the file or folder does not exist.`,
+ description: `Delete a file or folder at the given path. Fails gracefully if the file or folder does not exist.`,
params: {
uri: { type: 'string', description: undefined },
params: { type: 'string', description: 'Return -r here to delete this URI and all descendants (if applicable). Default is the empty string.' }