From 6e0fee6cb3bede49b08899e03a123ecd00aa9b46 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Thu, 19 Jun 2025 16:13:28 +0000 Subject: [PATCH] fix(llm): resolve tool lint errors --- .../src/services/llm/tools/smart_retry_tool.ts | 17 ++++++++++++----- .../src/services/llm/tools/tool_interfaces.ts | 6 ++++++ .../services/llm/tools/unified_search_tool.ts | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/apps/server/src/services/llm/tools/smart_retry_tool.ts b/apps/server/src/services/llm/tools/smart_retry_tool.ts index e6c0342f0..fa40a9e0d 100644 --- a/apps/server/src/services/llm/tools/smart_retry_tool.ts +++ b/apps/server/src/services/llm/tools/smart_retry_tool.ts @@ -60,7 +60,7 @@ export class SmartRetryTool implements ToolHandler { */ private generateBroaderTerms(query: string): string[] { const terms = query.toLowerCase().split(/\s+/); - const broader = []; + const broader: string[] = []; // Single words from multi-word queries if (terms.length > 1) { @@ -103,7 +103,7 @@ export class SmartRetryTool implements ToolHandler { 'report': ['summary', 'document', 'findings', 'results'] }; - const synonyms = []; + const synonyms: string[] = []; const queryLower = query.toLowerCase(); for (const [word, syns] of Object.entries(synonymMap)) { @@ -131,7 +131,7 @@ export class SmartRetryTool implements ToolHandler { 'notes': ['meeting notes', 'research notes', 'project notes'] }; - const narrower = []; + const narrower: string[] = []; const queryLower = query.toLowerCase(); for (const [broad, narrowTerms] of Object.entries(narrowerMap)) { @@ -155,7 +155,7 @@ export class SmartRetryTool implements ToolHandler { 'meeting': ['agenda', 'minutes', 'action items', 'participants'] }; - const related = []; + const related: string[] = []; const queryLower = query.toLowerCase(); for (const [concept, relatedTerms] of Object.entries(relatedMap)) { @@ -237,7 +237,14 @@ export class SmartRetryTool implements ToolHandler { } // Try each alternative - const results = []; + const results: Array<{ + query: string; + success: boolean; + count?: number; + result?: any; + message?: string; + error?: string; + }> = []; let successfulSearches = 0; let totalResults = 0; diff --git a/apps/server/src/services/llm/tools/tool_interfaces.ts b/apps/server/src/services/llm/tools/tool_interfaces.ts index ec90df67f..9bd249c3c 100644 --- a/apps/server/src/services/llm/tools/tool_interfaces.ts +++ b/apps/server/src/services/llm/tools/tool_interfaces.ts @@ -34,6 +34,12 @@ export interface ToolParameter { type: string; description: string; enum?: string[]; + default?: any; + minimum?: number; + maximum?: number; + minItems?: number; + maxItems?: number; + properties?: Record; items?: ToolParameter | { type: string; properties?: Record; diff --git a/apps/server/src/services/llm/tools/unified_search_tool.ts b/apps/server/src/services/llm/tools/unified_search_tool.ts index 46f9214fa..220c2b25e 100644 --- a/apps/server/src/services/llm/tools/unified_search_tool.ts +++ b/apps/server/src/services/llm/tools/unified_search_tool.ts @@ -37,7 +37,7 @@ export const unifiedSearchToolDefinition: Tool = { }, filters: { type: 'object', - description: 'Optional filters', + description: 'Optional filters for search', properties: { parentNoteId: { type: 'string',