@@ -14,14 +14,15 @@ import Foundation
1414enum BridgeToolId : String , CaseIterable {
1515 case readFile = " vscode_read_file "
1616 case writeFile = " vscode_write_file "
17- case listFiles = " vscode_list_files "
17+ case listDirectory = " vscode_list_directory "
18+ case listFilesLegacy = " vscode_list_files "
1819 case runTerminal = " vscode_run_terminal "
1920
2021 var displayName : String {
2122 switch self {
2223 case . readFile: return " Read File (VS Code) "
2324 case . writeFile: return " Write File (VS Code) "
24- case . listFiles : return " List Files (VS Code) "
25+ case . listDirectory , . listFilesLegacy : return " List Directory (VS Code) "
2526 case . runTerminal: return " Run Terminal (VS Code) "
2627 }
2728 }
@@ -32,7 +33,7 @@ enum BridgeToolId: String, CaseIterable {
3233 return " Read the contents of a file from the connected VS Code workspace "
3334 case . writeFile:
3435 return " Write or create a file in the connected VS Code workspace "
35- case . listFiles :
36+ case . listDirectory , . listFilesLegacy :
3637 return " List files and directories in the connected VS Code workspace "
3738 case . runTerminal:
3839 return " Execute a terminal command in the connected VS Code workspace "
@@ -43,7 +44,7 @@ enum BridgeToolId: String, CaseIterable {
4344 switch self {
4445 case . readFile: return " doc.text.magnifyingglass "
4546 case . writeFile: return " doc.badge.plus "
46- case . listFiles : return " folder.badge.gearshape "
47+ case . listDirectory , . listFilesLegacy : return " folder.badge.gearshape "
4748 case . runTerminal: return " terminal "
4849 }
4950 }
@@ -52,7 +53,7 @@ enum BridgeToolId: String, CaseIterable {
5253 /// All VS Code bridge tools require approval since they access external workspace
5354 var requiresApproval : Bool {
5455 switch self {
55- case . readFile, . listFiles :
56+ case . readFile, . listDirectory , . listFilesLegacy :
5657 return true // Even read-only needs approval for VS Code access
5758 case . writeFile, . runTerminal:
5859 return true // Mutations require approval
@@ -62,7 +63,7 @@ enum BridgeToolId: String, CaseIterable {
6263 /// Risk level for approval UI
6364 var riskLevel : String {
6465 switch self {
65- case . readFile, . listFiles : return " low "
66+ case . readFile, . listDirectory , . listFilesLegacy : return " low "
6667 case . writeFile: return " medium "
6768 case . runTerminal: return " high "
6869 }
@@ -73,7 +74,7 @@ enum BridgeToolId: String, CaseIterable {
7374 switch self {
7475 case . readFile: return . fileRead
7576 case . writeFile: return . fileWrite
76- case . listFiles : return . fileList
77+ case . listDirectory , . listFilesLegacy : return . fileList
7778 case . runTerminal: return . terminalRun
7879 }
7980 }
@@ -97,6 +98,15 @@ extension BridgeToolId {
9798 Read the contents of a file from the workspace.
9899 ```tool_request
99100 { " tool " : " vscode_read_file " , " query " : " path/to/file.ts " }
101+ ```
102+
103+ ### vscode_list_directory
104+ List directory contents from the workspace.
105+ ```tool_request
106+ { " tool " : " vscode_list_directory " , " query " : " . " }
107+ ```
108+
109+ Legacy compatibility note: `vscode_list_files` may still appear in older prompts, but prefer `vscode_list_directory`.
100110 """
101111 }
102112}
0 commit comments