(query string, registry *ToolRegistry)
| 949 | t.sandboxManager.Configure(bashpkg.SandboxOptions{ |
| 950 | Backend: cfg.SandboxBackend, |
| 951 | WSLDistro: cfg.WSLSandboxDistro, |
| 952 | WSLInstallDir: cfg.WSLSandboxInstallDir, |
| 953 | WSLImageURL: cfg.WSLSandboxImageURL, |
| 954 | WSLImagePath: cfg.WSLSandboxImagePath, |
| 955 | WSLImageSHA256: cfg.WSLSandboxImageSHA256, |
| 956 | WSLAllowLocalFallback: cfg.WSLSandboxAllowLocalFallback, |
| 957 | }) |
| 958 | } |
| 959 | |
| 960 | func sandboxSetupDecision(execCtx ExecutionContext) string { |
| 961 | toolID := stringFromExecCtx(execCtx, "_tool_call_id") |
| 962 | if toolID == "" { |
| 963 | return "" |
| 964 | } |
| 965 | if decisions, ok := execCtx["_wsl_sandbox_setup_decisions"].(map[string]string); ok { |
| 966 | return decisions[toolID] |
| 967 | } |
| 968 | return "" |
| 969 | } |
| 970 | |
| 971 | type ToolSearchInput struct { |
| 972 | Query string `json:"query" jsonschema:"description=Search query. Use 'select:Name1,Name2' to load specific tools, '+prefix keyword' to filter by name prefix, or just keywords to search all available deferred tools."` |
| 973 | } |
| 974 | |
| 975 | type ToolSearchTool struct{ BaseTool } |
| 976 | |
| 977 | func NewToolSearchTool() *ToolSearchTool { |
| 978 | return &ToolSearchTool{BaseTool{Spec: ToolSpec{ |
| 979 | Name: "tool_search", |
| 980 | Description: "Search for and load tools that are not in the default tool list. Use this when you need a specific tool that isn't available.\n\nQuery syntax:\n \"select:Name1,Name2\" — directly load specific tools by exact name\n \"+prefix keyword\" — filter tools whose name starts with prefix, ranked by keyword relevance\n \"keyword1 keyword2\" — search all deferred tools by name and description\n\nAfter loading with select:, the tool becomes available for immediate use.", |
| 981 | InputPrototype: ToolSearchInput{}, |
| 982 | Aliases: []string{"search_tools"}, |
no test coverage detected