feat: bind all tools to LLM with runtime options injection - #46
Merged
Conversation
…y pattern - Add factory function (createXxxTool) to every tool module that captures runtime options via closure before @tool decoration - Refactor buildToolConfig to use TOOL_FACTORIES map, passing all runtime options: allowedPaths, maxReadSize, registry, conversationsDir, safety, timeout, memoryLimit - Pass sandbox paths, safety config, and timeout from index.js to buildToolConfig - Remove ALL_TOOLS backward-compatibility map and stub createToolWithRuntimeOptions - 100% line coverage on tools/index.js, 751 tests passing
…Custom engines - Removed Exa, Firecrawl, Tavily, and Parallel (DuckDuckGo HTML) - Added DuckDuckGo (free, no key), Google (free, HTML scrape), Bing (BING_API_KEY), SearXNG (SEARXNG_URL), and Custom - Custom engine supports: url, method, body, headers, result fields, api_key, queryKey, titleField, urlField, descriptionField - Updated tests and coverage for new engines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces the previous web search backends (Exa, Firecrawl, Tavily, Parallel) with a new set of free or low-cost search engines. This dramatically expands search capabilities without requiring paid API keys.
New built-in engines (priority order):
{{query}},{{apiKey}}), optional request body/headers, configurable response parsing fieldsBING_API_KEYenvironment variable (https://dev.bing.com)SEARXNG_URLenv var pointing to a self-hosted SearXNG instanceEnvironment variable configuration:
CUSTOM_SEARCH_URL{{query}}templateCUSTOM_SEARCH_METHODCUSTOM_SEARCH_BODY{{query}}/{{apiKey}}templatesCUSTOM_SEARCH_HEADERSCUSTOM_SEARCH_QUERY_KEYorCUSTOM_RESULT_KEYCUSTOM_TITLE_FIELDCUSTOM_URL_FIELDCUSTOM_DESCRIPTION_FIELDCUSTOM_API_KEYBING_API_KEYSEARXNG_URLType of Change
Testing
tests/unit/tools_web.test.jsto cover all new backends: Bing, SearXNG, Custom, DuckDuckGotests/unit/tools_web_full.test.js(309 tests for old engines)Coverage
tools/index.jsChecklist
npm run lintpasses