mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 20:17:45 +00:00
fix(websearch): update config.yaml comments to match CLI implementation
- Update WebSearch section comments in unified-config-loader.ts - Remove outdated MCP references (web-search-prime, brave, tavily, customMcp) - Add accurate CLI provider info (Gemini CLI FREE, Grok CLI paid) - Add GrokWebSearchConfig type to unified-config-types.ts - Update PUT /api/websearch route to handle both gemini and grok Old comments listed MCP-based providers that were never implemented. New comments accurately reflect the CLI-based WebSearch implementation.
This commit is contained in:
@@ -261,19 +261,17 @@ function generateYamlWithComments(config: UnifiedConfig): string {
|
||||
// WebSearch section
|
||||
if (config.websearch) {
|
||||
lines.push('# ----------------------------------------------------------------------------');
|
||||
lines.push('# WebSearch: Provider configuration for third-party profiles');
|
||||
lines.push('# WebSearch: CLI-based web search for third-party profiles');
|
||||
lines.push('# Dashboard (`ccs config`) is the source of truth for provider selection.');
|
||||
lines.push('#');
|
||||
lines.push('# enabled: Master switch - auto-disables when no providers enabled');
|
||||
lines.push('# mode: sequential (try in order) | parallel (merge all results)');
|
||||
lines.push('# Third-party providers (gemini, codex, agy, etc.) do not have access to');
|
||||
lines.push("# Anthropic's WebSearch tool. These CLI tools provide fallback web search.");
|
||||
lines.push('#');
|
||||
lines.push('# providers:');
|
||||
lines.push('# gemini: Uses Gemini CLI with google_web_search tool');
|
||||
lines.push('# web-search-prime: HTTP MCP endpoint (z.ai subscription)');
|
||||
lines.push('# brave: Brave Search API (requires BRAVE_API_KEY)');
|
||||
lines.push('# tavily: Tavily Search API (requires TAVILY_API_KEY)');
|
||||
lines.push('# gemini: Gemini CLI (FREE) - npm i -g @google/gemini-cli');
|
||||
lines.push('# grok: Grok CLI (paid) - npm i -g @vibe-kit/grok-cli (needs GROK_API_KEY)');
|
||||
lines.push('#');
|
||||
lines.push('# customMcp: User-defined MCP servers (BYOM - Bring Your Own MCP)');
|
||||
lines.push('# enabled: Master switch - auto-disables when no providers enabled');
|
||||
lines.push('# ----------------------------------------------------------------------------');
|
||||
lines.push(
|
||||
yaml
|
||||
|
||||
@@ -111,22 +111,30 @@ export interface GeminiWebSearchConfig {
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grok CLI WebSearch configuration.
|
||||
*/
|
||||
export interface GrokWebSearchConfig {
|
||||
/** Enable Grok CLI for WebSearch (default: false - requires GROK_API_KEY) */
|
||||
enabled?: boolean;
|
||||
/** Timeout in seconds (default: 55) */
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* WebSearch providers configuration.
|
||||
* Currently supports Gemini CLI only.
|
||||
* Future: opencode, grok-cli, etc.
|
||||
* Currently supports Gemini CLI and Grok CLI.
|
||||
*/
|
||||
export interface WebSearchProvidersConfig {
|
||||
/** Gemini CLI - uses google_web_search tool */
|
||||
/** Gemini CLI - uses google_web_search tool (FREE tier: 1000 req/day) */
|
||||
gemini?: GeminiWebSearchConfig;
|
||||
// Future CLI tools can be added here:
|
||||
// opencode?: { enabled?: boolean; model?: string; };
|
||||
// grok?: { enabled?: boolean; };
|
||||
/** Grok CLI - xAI web search (requires GROK_API_KEY) */
|
||||
grok?: GrokWebSearchConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* WebSearch configuration.
|
||||
* Uses CLI tools (Gemini CLI) to provide WebSearch for third-party profiles.
|
||||
* Uses CLI tools (Gemini CLI, Grok CLI) to provide WebSearch for third-party profiles.
|
||||
* Third-party providers don't have server-side WebSearch access.
|
||||
*/
|
||||
export interface WebSearchConfig {
|
||||
|
||||
@@ -1466,7 +1466,7 @@ apiRoutes.put('/websearch', (req: Request, res: Response): void => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Merge updates - simple structure (Gemini CLI only for now)
|
||||
// Merge updates - supports Gemini CLI and Grok CLI
|
||||
existingConfig.websearch = {
|
||||
enabled: enabled ?? existingConfig.websearch?.enabled ?? true,
|
||||
providers: providers
|
||||
@@ -1481,6 +1481,14 @@ apiRoutes.put('/websearch', (req: Request, res: Response): void => {
|
||||
existingConfig.websearch?.providers?.gemini?.timeout ??
|
||||
55,
|
||||
},
|
||||
grok: {
|
||||
enabled:
|
||||
providers.grok?.enabled ??
|
||||
existingConfig.websearch?.providers?.grok?.enabled ??
|
||||
false,
|
||||
timeout:
|
||||
providers.grok?.timeout ?? existingConfig.websearch?.providers?.grok?.timeout ?? 55,
|
||||
},
|
||||
}
|
||||
: existingConfig.websearch?.providers,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user