mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Add a few more read-only operations (#25)
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "roo-cline",
|
"name": "roo-cline",
|
||||||
"version": "2.1.4",
|
"version": "2.1.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "roo-cline",
|
"name": "roo-cline",
|
||||||
"version": "2.1.4",
|
"version": "2.1.5",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/bedrock-sdk": "^0.10.2",
|
"@anthropic-ai/bedrock-sdk": "^0.10.2",
|
||||||
"@anthropic-ai/sdk": "^0.26.0",
|
"@anthropic-ai/sdk": "^0.26.0",
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
"displayName": "Roo Cline",
|
"displayName": "Roo Cline",
|
||||||
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
|
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
|
||||||
"publisher": "RooVeterinaryInc",
|
"publisher": "RooVeterinaryInc",
|
||||||
"version": "2.1.4",
|
"version": "2.1.5",
|
||||||
"files": [
|
"files": [
|
||||||
"bin/roo-cline-2.1.4.vsix",
|
"bin/roo-cline-2.1.5.vsix",
|
||||||
"assets/icons/icon_Roo.png"
|
"assets/icons/icon_Roo.png"
|
||||||
],
|
],
|
||||||
"icon": "assets/icons/icon_Roo.png",
|
"icon": "assets/icons/icon_Roo.png",
|
||||||
|
|||||||
@@ -693,7 +693,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
|
|||||||
const lastMessage = messages.at(-1)
|
const lastMessage = messages.at(-1)
|
||||||
if (lastMessage?.type === "ask" && lastMessage.text) {
|
if (lastMessage?.type === "ask" && lastMessage.text) {
|
||||||
const tool = JSON.parse(lastMessage.text)
|
const tool = JSON.parse(lastMessage.text)
|
||||||
return ["readFile", "listFiles", "searchFiles"].includes(tool.tool)
|
return ["readFile", "listFiles", "listFilesTopLevel", "listFilesRecursive", "listCodeDefinitionNames", "searchFiles"].includes(tool.tool)
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,6 +125,31 @@ describe('ChatView', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should auto-approve all file listing tool types when alwaysAllowReadOnly is true', () => {
|
||||||
|
const fileListingTools = [
|
||||||
|
'readFile', 'listFiles', 'listFilesTopLevel',
|
||||||
|
'listFilesRecursive', 'listCodeDefinitionNames', 'searchFiles'
|
||||||
|
]
|
||||||
|
|
||||||
|
fileListingTools.forEach(tool => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
mockState.clineMessages = [
|
||||||
|
{
|
||||||
|
type: 'ask',
|
||||||
|
ask: 'tool',
|
||||||
|
text: JSON.stringify({ tool }),
|
||||||
|
ts: Date.now(),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
renderChatView()
|
||||||
|
|
||||||
|
expect(vscode.postMessage).toHaveBeenCalledWith({
|
||||||
|
type: 'askResponse',
|
||||||
|
askResponse: 'yesButtonClicked'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it('should auto-approve write tool actions when alwaysAllowWrite is true', () => {
|
it('should auto-approve write tool actions when alwaysAllowWrite is true', () => {
|
||||||
mockState.clineMessages = [
|
mockState.clineMessages = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user