From 1c40259480df0849e15d15edff9f406a0eabc2af Mon Sep 17 00:00:00 2001 From: Arjun <6592213+arkml@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:48:12 +0530 Subject: [PATCH] completely remove brave --- .../src/application/assistant/skills/index.ts | 8 +- .../core/src/application/lib/builtin-tools.ts | 100 +----------------- 2 files changed, 2 insertions(+), 106 deletions(-) diff --git a/apps/x/packages/core/src/application/assistant/skills/index.ts b/apps/x/packages/core/src/application/assistant/skills/index.ts index 742bd148..44774d6e 100644 --- a/apps/x/packages/core/src/application/assistant/skills/index.ts +++ b/apps/x/packages/core/src/application/assistant/skills/index.ts @@ -10,7 +10,7 @@ import organizeFilesSkill from "./organize-files/skill.js"; import slackSkill from "./slack/skill.js"; import backgroundAgentsSkill from "./background-agents/skill.js"; import createPresentationsSkill from "./create-presentations/skill.js"; -// import webSearchSkill from "./web-search/skill.js"; + import appNavigationSkill from "./app-navigation/skill.js"; const CURRENT_DIR = path.dirname(fileURLToPath(import.meta.url)); @@ -84,12 +84,6 @@ const definitions: SkillDefinition[] = [ summary: "Discovering, executing, and integrating MCP tools. Use this to check what external capabilities are available and execute MCP tools on behalf of users.", content: mcpIntegrationSkill, }, - // { - // id: "web-search", - // title: "Web Search", - // summary: "Searching the web or researching a topic. Guidance on when to use web-search vs research-search, and how many searches to do.", - // content: webSearchSkill, - // }, { id: "deletion-guardrails", title: "Deletion Guardrails", diff --git a/apps/x/packages/core/src/application/lib/builtin-tools.ts b/apps/x/packages/core/src/application/lib/builtin-tools.ts index b13661f2..069cf7ef 100644 --- a/apps/x/packages/core/src/application/lib/builtin-tools.ts +++ b/apps/x/packages/core/src/application/lib/builtin-tools.ts @@ -1026,105 +1026,7 @@ export const BuiltinTools: z.infer = { }, // ============================================================================ - // Brave Search (disabled — replaced by Exa-based web-search below) - // ============================================================================ - - 'brave-search-disabled': { - description: 'Search the web using Brave Search. Returns web results with titles, URLs, and descriptions.', - inputSchema: z.object({ - query: z.string().describe('The search query'), - count: z.number().optional().describe('Number of results to return (default: 5, max: 20)'), - freshness: z.string().optional().describe('Filter by freshness: pd (past day), pw (past week), pm (past month), py (past year)'), - }), - isAvailable: async () => false, - execute: async ({ query, count, freshness }: { query: string; count?: number; freshness?: string }) => { - try { - const resultCount = Math.min(Math.max(count || 5, 1), 20); - const params = new URLSearchParams({ - q: query, - count: String(resultCount), - }); - if (freshness) { - params.set('freshness', freshness); - } - - let response: Response; - - if (await isSignedIn()) { - // Use proxy - const accessToken = await getAccessToken(); - response = await fetch(`${API_URL}/v1/search/brave?${params.toString()}`, { - headers: { - 'Authorization': `Bearer ${accessToken}`, - 'Accept': 'application/json', - }, - }); - } else { - // Read API key from config - const braveConfigPath = path.join(WorkDir, 'config', 'brave-search.json'); - - let apiKey: string; - try { - const raw = await fs.readFile(braveConfigPath, 'utf8'); - const config = JSON.parse(raw); - apiKey = config.apiKey; - } catch { - return { - success: false, - error: 'Brave Search API key not configured. Create ~/.rowboat/config/brave-search.json with { "apiKey": "" }', - }; - } - - if (!apiKey) { - return { - success: false, - error: 'Brave Search API key is empty. Set "apiKey" in ~/.rowboat/config/brave-search.json', - }; - } - - response = await fetch(`https://api.search.brave.com/res/v1/web/search?${params.toString()}`, { - headers: { - 'X-Subscription-Token': apiKey, - 'Accept': 'application/json', - }, - }); - } - - if (!response.ok) { - const body = await response.text(); - return { - success: false, - error: `Brave Search API error (${response.status}): ${body}`, - }; - } - - const data = await response.json() as { - web?: { results?: Array<{ title?: string; url?: string; description?: string }> }; - }; - - const results = (data.web?.results || []).map((r: { title?: string; url?: string; description?: string }) => ({ - title: r.title || '', - url: r.url || '', - description: r.description || '', - })); - - return { - success: true, - query, - results, - count: results.length, - }; - } catch (error) { - return { - success: false, - error: error instanceof Error ? error.message : 'Unknown error', - }; - } - }, - }, - - // ============================================================================ - // Web Search (Exa Search API) — renamed from research-search + // Web Search (Exa Search API) // ============================================================================ 'web-search': {