Enha: remove window tools if no vision
This commit is contained in:
@@ -362,6 +362,5 @@ func pwDrag(args map[string]string) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
logger = logger.With("component", "browser")
|
|
||||||
checkPlaywright()
|
checkPlaywright()
|
||||||
}
|
}
|
||||||
|
|||||||
19
tools.go
19
tools.go
@@ -1376,7 +1376,26 @@ var fnMap = map[string]fnSig{
|
|||||||
"pw_drag": pwDrag,
|
"pw_drag": pwDrag,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func removeWindowToolsFromBaseTools() {
|
||||||
|
windowToolNames := map[string]bool{
|
||||||
|
"list_windows": true,
|
||||||
|
"capture_window": true,
|
||||||
|
"capture_window_and_view": true,
|
||||||
|
}
|
||||||
|
var filtered []models.Tool
|
||||||
|
for _, tool := range baseTools {
|
||||||
|
if !windowToolNames[tool.Function.Name] {
|
||||||
|
filtered = append(filtered, tool)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
baseTools = filtered
|
||||||
|
delete(fnMap, "list_windows")
|
||||||
|
delete(fnMap, "capture_window")
|
||||||
|
delete(fnMap, "capture_window_and_view")
|
||||||
|
}
|
||||||
|
|
||||||
func registerWindowTools() {
|
func registerWindowTools() {
|
||||||
|
removeWindowToolsFromBaseTools()
|
||||||
if windowToolsAvailable {
|
if windowToolsAvailable {
|
||||||
fnMap["list_windows"] = listWindows
|
fnMap["list_windows"] = listWindows
|
||||||
fnMap["capture_window"] = captureWindow
|
fnMap["capture_window"] = captureWindow
|
||||||
|
|||||||
1
tui.go
1
tui.go
@@ -860,6 +860,7 @@ func init() {
|
|||||||
if event.Key() == tcell.KeyCtrlK {
|
if event.Key() == tcell.KeyCtrlK {
|
||||||
// add message from tools
|
// add message from tools
|
||||||
cfg.ToolUse = !cfg.ToolUse
|
cfg.ToolUse = !cfg.ToolUse
|
||||||
|
UpdateToolCapabilities()
|
||||||
updateStatusLine()
|
updateStatusLine()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user