diff --git a/src/cli/tui.ts b/src/cli/tui.ts index 8141bac..de513af 100644 --- a/src/cli/tui.ts +++ b/src/cli/tui.ts @@ -46,7 +46,7 @@ export function registerTuiCommand(program: Command): void { const { AnthropicClient, OpenAIClient, OllamaClient, LlamaCppClient, GitHubModelsClient, GeminiClient, BedrockClient, ModelRouter } = await import('../models/index.js'); const { MinimalTui, startFullscreenTui } = await import('../frontends/tui/index.js'); const { NativeAgent } = await import('../backends/index.js'); - const { ToolRegistry, ToolExecutor, allBuiltinTools } = await import('../tools/index.js'); + const { ToolRegistry, ToolExecutor, allBuiltinTools, createWebSearchTools, createProcessTools, ProcessManager } = await import('../tools/index.js'); const { HookEngine } = await import('../hooks/index.js'); const dataDir = resolve(homedir(), '.local/share/flynn'); @@ -122,6 +122,30 @@ export function registerTuiCommand(program: Command): void { for (const tool of allBuiltinTools) { toolRegistry.register(tool); } + + // Register web search tools if configured with credentials + if (config.web_search.api_key || config.web_search.endpoint) { + for (const tool of createWebSearchTools({ + provider: config.web_search.provider, + apiKey: config.web_search.api_key, + endpoint: config.web_search.endpoint, + maxResults: config.web_search.max_results, + })) { + toolRegistry.register(tool); + } + } + + // Initialize process manager and register process tools + const processManager = new ProcessManager({ + maxConcurrent: config.process.max_concurrent, + maxRuntimeMinutes: config.process.max_runtime_minutes, + bufferSize: config.process.buffer_size, + }); + + for (const tool of createProcessTools(processManager)) { + toolRegistry.register(tool); + } + const toolExecutor = new ToolExecutor(toolRegistry, hookEngine); const session = sessionManager.getSession('tui', 'local'); @@ -147,6 +171,7 @@ export function registerTuiCommand(program: Command): void { }); const cleanup = () => { + processManager.shutdown(); sessionStore.close(); };