| 340 | |
| 341 | // Helper to log search outcome |
| 342 | function logSearchOutcome( |
| 343 | matches: string[], |
| 344 | queryType: 'select' | 'keyword', |
| 345 | ): void { |
| 346 | logEvent('tengu_tool_search_outcome', { |
| 347 | query: |
| 348 | query as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 349 | queryType: |
| 350 | queryType as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 351 | matchCount: matches.length, |
| 352 | totalDeferredTools: deferredTools.length, |
| 353 | maxResults: max_results, |
| 354 | hasMatches: matches.length > 0, |
| 355 | }) |
| 356 | } |
| 357 | |
| 358 | // Check for select: prefix — direct tool selection. |
| 359 | // Supports comma-separated multi-select: `select:A,B,C`. |