mcp-researchpowerpack 3.9.4 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +116 -208
  2. package/dist/index.js +280 -337
  3. package/dist/index.js.map +7 -1
  4. package/dist/mcp-use.json +7 -0
  5. package/dist/src/clients/reddit.js +278 -0
  6. package/dist/src/clients/reddit.js.map +7 -0
  7. package/dist/src/clients/scraper.js +326 -0
  8. package/dist/src/clients/scraper.js.map +7 -0
  9. package/dist/src/clients/search.js +217 -0
  10. package/dist/src/clients/search.js.map +7 -0
  11. package/dist/src/config/index.js +138 -0
  12. package/dist/src/config/index.js.map +7 -0
  13. package/dist/src/prompts/deep-research.js +41 -0
  14. package/dist/src/prompts/deep-research.js.map +7 -0
  15. package/dist/src/prompts/reddit-sentiment.js +47 -0
  16. package/dist/src/prompts/reddit-sentiment.js.map +7 -0
  17. package/dist/src/schemas/reddit.js +21 -0
  18. package/dist/src/schemas/reddit.js.map +7 -0
  19. package/dist/src/schemas/scrape-links.js +26 -0
  20. package/dist/src/schemas/scrape-links.js.map +7 -0
  21. package/dist/src/schemas/start-research.js +17 -0
  22. package/dist/src/schemas/start-research.js.map +7 -0
  23. package/dist/src/schemas/web-search.js +53 -0
  24. package/dist/src/schemas/web-search.js.map +7 -0
  25. package/dist/src/services/llm-processor.js +675 -0
  26. package/dist/src/services/llm-processor.js.map +7 -0
  27. package/dist/src/services/markdown-cleaner.js +62 -0
  28. package/dist/src/services/markdown-cleaner.js.map +7 -0
  29. package/dist/src/services/workflow-state.js +116 -0
  30. package/dist/src/services/workflow-state.js.map +7 -0
  31. package/dist/src/tools/mcp-helpers.js +50 -0
  32. package/dist/src/tools/mcp-helpers.js.map +7 -0
  33. package/dist/src/tools/reddit.js +277 -0
  34. package/dist/src/tools/reddit.js.map +7 -0
  35. package/dist/src/tools/registry.js +18 -0
  36. package/dist/src/tools/registry.js.map +7 -0
  37. package/dist/src/tools/scrape.js +334 -0
  38. package/dist/src/tools/scrape.js.map +7 -0
  39. package/dist/src/tools/search.js +423 -0
  40. package/dist/src/tools/search.js.map +7 -0
  41. package/dist/src/tools/start-research.js +199 -0
  42. package/dist/src/tools/start-research.js.map +7 -0
  43. package/dist/src/tools/utils.js +29 -0
  44. package/dist/src/tools/utils.js.map +7 -0
  45. package/dist/src/utils/bootstrap-guard.js +27 -0
  46. package/dist/src/utils/bootstrap-guard.js.map +7 -0
  47. package/dist/src/utils/concurrency.js +62 -0
  48. package/dist/src/utils/concurrency.js.map +7 -0
  49. package/dist/src/utils/content-extractor.js +61 -0
  50. package/dist/src/utils/content-extractor.js.map +7 -0
  51. package/dist/src/utils/errors.js +211 -0
  52. package/dist/src/utils/errors.js.map +7 -0
  53. package/dist/src/utils/logger.js +25 -0
  54. package/dist/src/utils/logger.js.map +7 -0
  55. package/dist/src/utils/markdown-formatter.js +15 -0
  56. package/dist/src/utils/markdown-formatter.js.map +7 -0
  57. package/dist/src/utils/reddit-keyword-guard.js +29 -0
  58. package/dist/src/utils/reddit-keyword-guard.js.map +7 -0
  59. package/dist/src/utils/response.js +81 -0
  60. package/dist/src/utils/response.js.map +7 -0
  61. package/dist/src/utils/retry.js +13 -0
  62. package/dist/src/utils/retry.js.map +7 -0
  63. package/dist/src/utils/sanitize.js +10 -0
  64. package/dist/src/utils/sanitize.js.map +7 -0
  65. package/dist/src/utils/source-type.js +41 -0
  66. package/dist/src/utils/source-type.js.map +7 -0
  67. package/dist/src/utils/url-aggregator.js +227 -0
  68. package/dist/src/utils/url-aggregator.js.map +7 -0
  69. package/dist/src/utils/workflow-key.js +14 -0
  70. package/dist/src/utils/workflow-key.js.map +7 -0
  71. package/dist/src/version.js +32 -0
  72. package/dist/src/version.js.map +7 -0
  73. package/package.json +33 -28
  74. package/dist/clients/reddit.d.ts +0 -69
  75. package/dist/clients/reddit.d.ts.map +0 -1
  76. package/dist/clients/reddit.js +0 -369
  77. package/dist/clients/reddit.js.map +0 -1
  78. package/dist/clients/research.d.ts +0 -67
  79. package/dist/clients/research.d.ts.map +0 -1
  80. package/dist/clients/research.js +0 -290
  81. package/dist/clients/research.js.map +0 -1
  82. package/dist/clients/scraper.d.ts +0 -72
  83. package/dist/clients/scraper.d.ts.map +0 -1
  84. package/dist/clients/scraper.js +0 -338
  85. package/dist/clients/scraper.js.map +0 -1
  86. package/dist/clients/search.d.ts +0 -57
  87. package/dist/clients/search.d.ts.map +0 -1
  88. package/dist/clients/search.js +0 -223
  89. package/dist/clients/search.js.map +0 -1
  90. package/dist/config/index.d.ts +0 -78
  91. package/dist/config/index.d.ts.map +0 -1
  92. package/dist/config/index.js +0 -201
  93. package/dist/config/index.js.map +0 -1
  94. package/dist/config/loader.d.ts +0 -40
  95. package/dist/config/loader.d.ts.map +0 -1
  96. package/dist/config/loader.js +0 -322
  97. package/dist/config/loader.js.map +0 -1
  98. package/dist/config/types.d.ts +0 -81
  99. package/dist/config/types.d.ts.map +0 -1
  100. package/dist/config/types.js +0 -6
  101. package/dist/config/types.js.map +0 -1
  102. package/dist/config/yaml/tools.yaml +0 -146
  103. package/dist/index.d.ts +0 -7
  104. package/dist/index.d.ts.map +0 -1
  105. package/dist/schemas/deep-research.d.ts +0 -64
  106. package/dist/schemas/deep-research.d.ts.map +0 -1
  107. package/dist/schemas/deep-research.js +0 -224
  108. package/dist/schemas/deep-research.js.map +0 -1
  109. package/dist/schemas/scrape-links.d.ts +0 -32
  110. package/dist/schemas/scrape-links.d.ts.map +0 -1
  111. package/dist/schemas/scrape-links.js +0 -34
  112. package/dist/schemas/scrape-links.js.map +0 -1
  113. package/dist/schemas/web-search.d.ts +0 -22
  114. package/dist/schemas/web-search.d.ts.map +0 -1
  115. package/dist/schemas/web-search.js +0 -21
  116. package/dist/schemas/web-search.js.map +0 -1
  117. package/dist/services/file-attachment.d.ts +0 -30
  118. package/dist/services/file-attachment.d.ts.map +0 -1
  119. package/dist/services/file-attachment.js +0 -207
  120. package/dist/services/file-attachment.js.map +0 -1
  121. package/dist/services/llm-processor.d.ts +0 -29
  122. package/dist/services/llm-processor.d.ts.map +0 -1
  123. package/dist/services/llm-processor.js +0 -244
  124. package/dist/services/llm-processor.js.map +0 -1
  125. package/dist/services/markdown-cleaner.d.ts +0 -8
  126. package/dist/services/markdown-cleaner.d.ts.map +0 -1
  127. package/dist/services/markdown-cleaner.js +0 -74
  128. package/dist/services/markdown-cleaner.js.map +0 -1
  129. package/dist/tools/definitions.d.ts +0 -16
  130. package/dist/tools/definitions.d.ts.map +0 -1
  131. package/dist/tools/definitions.js +0 -17
  132. package/dist/tools/definitions.js.map +0 -1
  133. package/dist/tools/reddit.d.ts +0 -14
  134. package/dist/tools/reddit.d.ts.map +0 -1
  135. package/dist/tools/reddit.js +0 -265
  136. package/dist/tools/reddit.js.map +0 -1
  137. package/dist/tools/registry.d.ts +0 -71
  138. package/dist/tools/registry.d.ts.map +0 -1
  139. package/dist/tools/registry.js +0 -252
  140. package/dist/tools/registry.js.map +0 -1
  141. package/dist/tools/research.d.ts +0 -14
  142. package/dist/tools/research.d.ts.map +0 -1
  143. package/dist/tools/research.js +0 -196
  144. package/dist/tools/research.js.map +0 -1
  145. package/dist/tools/scrape.d.ts +0 -14
  146. package/dist/tools/scrape.d.ts.map +0 -1
  147. package/dist/tools/scrape.js +0 -234
  148. package/dist/tools/scrape.js.map +0 -1
  149. package/dist/tools/search.d.ts +0 -10
  150. package/dist/tools/search.d.ts.map +0 -1
  151. package/dist/tools/search.js +0 -158
  152. package/dist/tools/search.js.map +0 -1
  153. package/dist/tools/utils.d.ts +0 -105
  154. package/dist/tools/utils.d.ts.map +0 -1
  155. package/dist/tools/utils.js +0 -159
  156. package/dist/tools/utils.js.map +0 -1
  157. package/dist/utils/concurrency.d.ts +0 -28
  158. package/dist/utils/concurrency.d.ts.map +0 -1
  159. package/dist/utils/concurrency.js +0 -92
  160. package/dist/utils/concurrency.js.map +0 -1
  161. package/dist/utils/errors.d.ts +0 -95
  162. package/dist/utils/errors.d.ts.map +0 -1
  163. package/dist/utils/errors.js +0 -390
  164. package/dist/utils/errors.js.map +0 -1
  165. package/dist/utils/logger.d.ts +0 -39
  166. package/dist/utils/logger.d.ts.map +0 -1
  167. package/dist/utils/logger.js +0 -57
  168. package/dist/utils/logger.js.map +0 -1
  169. package/dist/utils/markdown-formatter.d.ts +0 -5
  170. package/dist/utils/markdown-formatter.d.ts.map +0 -1
  171. package/dist/utils/markdown-formatter.js +0 -15
  172. package/dist/utils/markdown-formatter.js.map +0 -1
  173. package/dist/utils/response.d.ts +0 -93
  174. package/dist/utils/response.d.ts.map +0 -1
  175. package/dist/utils/response.js +0 -170
  176. package/dist/utils/response.js.map +0 -1
  177. package/dist/utils/retry.d.ts +0 -43
  178. package/dist/utils/retry.d.ts.map +0 -1
  179. package/dist/utils/retry.js +0 -57
  180. package/dist/utils/retry.js.map +0 -1
  181. package/dist/utils/url-aggregator.d.ts +0 -90
  182. package/dist/utils/url-aggregator.d.ts.map +0 -1
  183. package/dist/utils/url-aggregator.js +0 -538
  184. package/dist/utils/url-aggregator.js.map +0 -1
  185. package/dist/version.d.ts +0 -29
  186. package/dist/version.d.ts.map +0 -1
  187. package/dist/version.js +0 -55
  188. package/dist/version.js.map +0 -1
@@ -1,234 +0,0 @@
1
- /**
2
- * Scrape Links Tool Handler
3
- * Implements robust error handling that NEVER crashes the MCP server
4
- */
5
- import { ScraperClient } from '../clients/scraper.js';
6
- import { MarkdownCleaner } from '../services/markdown-cleaner.js';
7
- import { createLLMProcessor, processContentWithLLM } from '../services/llm-processor.js';
8
- import { removeMetaTags } from '../utils/markdown-formatter.js';
9
- import { SCRAPER } from '../config/index.js';
10
- import { getToolConfig } from '../config/loader.js';
11
- import { classifyError } from '../utils/errors.js';
12
- import { pMap } from '../utils/concurrency.js';
13
- import { mcpLog, formatSuccess, formatError, formatBatchHeader, formatDuration, TOKEN_BUDGETS, calculateTokenAllocation, } from './utils.js';
14
- // Module-level singleton - MarkdownCleaner is stateless
15
- const markdownCleaner = new MarkdownCleaner();
16
- // Get extraction prefix+suffix from YAML config (fallback to hardcoded)
17
- function getExtractionPrefix() {
18
- const config = getToolConfig('scrape_links');
19
- const prefix = config?.limits?.extraction_prefix;
20
- return typeof prefix === 'string' ? prefix : SCRAPER.EXTRACTION_PREFIX;
21
- }
22
- function getExtractionSuffix() {
23
- const config = getToolConfig('scrape_links');
24
- const suffix = config?.limits?.extraction_suffix;
25
- return typeof suffix === 'string' ? suffix : SCRAPER.EXTRACTION_SUFFIX;
26
- }
27
- function enhanceExtractionInstruction(instruction) {
28
- const base = instruction || 'Extract the main content and key information from this page.';
29
- return `${getExtractionPrefix()}\n\n${base}\n\n${getExtractionSuffix()}`;
30
- }
31
- // --- Helpers ---
32
- function createScrapeErrorResponse(code, message, startTime, totalUrls, retryable = false, alternatives) {
33
- return {
34
- content: formatError({
35
- code,
36
- message,
37
- retryable,
38
- toolName: 'scrape_links',
39
- howToFix: code === 'NO_URLS' ? ['Provide at least one valid URL'] : undefined,
40
- alternatives,
41
- }),
42
- structuredContent: {
43
- content: message,
44
- metadata: {
45
- total_urls: totalUrls,
46
- successful: 0,
47
- failed: totalUrls,
48
- total_credits: 0,
49
- execution_time_ms: Date.now() - startTime,
50
- },
51
- },
52
- };
53
- }
54
- function validateAndPartitionUrls(urls) {
55
- const validUrls = [];
56
- const invalidUrls = [];
57
- for (const url of urls) {
58
- try {
59
- new URL(url);
60
- validUrls.push(url);
61
- }
62
- catch {
63
- invalidUrls.push(url);
64
- }
65
- }
66
- return { validUrls, invalidUrls };
67
- }
68
- function initializeScrapeClients() {
69
- const client = new ScraperClient();
70
- const llmProcessor = createLLMProcessor();
71
- return { client, llmProcessor };
72
- }
73
- function processScrapeResults(results, invalidUrls) {
74
- const successItems = [];
75
- const failedContents = [];
76
- let successful = 0;
77
- let failed = 0;
78
- let totalCredits = 0;
79
- for (const invalidUrl of invalidUrls) {
80
- failed++;
81
- failedContents.push(`## ${invalidUrl}\n\n❌ Invalid URL format`);
82
- }
83
- for (let i = 0; i < results.length; i++) {
84
- const result = results[i];
85
- if (!result) {
86
- failed++;
87
- failedContents.push(`## Unknown URL\n\n❌ No result returned`);
88
- continue;
89
- }
90
- mcpLog('debug', `[${i + 1}/${results.length}] Processing ${result.url}`, 'scrape');
91
- if (result.error || result.statusCode < 200 || result.statusCode >= 300) {
92
- failed++;
93
- const errorMsg = result.error?.message || result.content || `HTTP ${result.statusCode}`;
94
- failedContents.push(`## ${result.url}\n\n❌ Failed to scrape: ${errorMsg}`);
95
- mcpLog('warning', `[${i + 1}/${results.length}] Failed: ${errorMsg}`, 'scrape');
96
- continue;
97
- }
98
- successful++;
99
- totalCredits += result.credits;
100
- let content;
101
- try {
102
- content = markdownCleaner.processContent(result.content);
103
- }
104
- catch {
105
- content = result.content;
106
- }
107
- successItems.push({ url: result.url, content, index: i });
108
- }
109
- return { successItems, failedContents, metrics: { successful, failed, totalCredits } };
110
- }
111
- async function processItemsWithLlm(successItems, params, enhancedInstruction, tokensPerUrl, llmProcessor) {
112
- let llmErrors = 0;
113
- if (!params.use_llm || !llmProcessor || successItems.length === 0) {
114
- return { items: successItems, llmErrors };
115
- }
116
- mcpLog('info', `Starting parallel LLM extraction for ${successItems.length} pages (concurrency: 3)`, 'scrape');
117
- const llmResults = await pMap(successItems, async (item) => {
118
- mcpLog('debug', `LLM extracting ${item.url} (${tokensPerUrl} tokens)...`, 'scrape');
119
- const llmResult = await processContentWithLLM(item.content, { use_llm: params.use_llm, what_to_extract: enhancedInstruction, max_tokens: tokensPerUrl }, llmProcessor);
120
- if (llmResult.processed) {
121
- mcpLog('debug', `LLM extraction complete for ${item.url}`, 'scrape');
122
- return { ...item, content: llmResult.content };
123
- }
124
- llmErrors++;
125
- mcpLog('warning', `LLM extraction skipped for ${item.url}: ${llmResult.error || 'unknown reason'}`, 'scrape');
126
- return item;
127
- }, 3);
128
- return { items: llmResults, llmErrors };
129
- }
130
- function assembleContentEntries(successItems, failedContents) {
131
- const contents = [...failedContents];
132
- for (const item of successItems) {
133
- let content = item.content;
134
- try {
135
- content = removeMetaTags(content);
136
- }
137
- catch {
138
- // Use content as-is
139
- }
140
- contents.push(`## ${item.url}\n\n${content}`);
141
- }
142
- return contents;
143
- }
144
- function buildScrapeNextSteps(metrics) {
145
- return [
146
- metrics.successful > 0 ? 'FOLLOW LINKS: If scraped content references other URLs/docs/sources, scrape those too: scrape_links(urls=[...extracted URLs...], use_llm=true)' : null,
147
- metrics.successful > 0 ? 'VERIFY: web_search(keywords=["claim from scraped content", "topic official source", "topic benchmark data"]) — cross-check extracted claims' : null,
148
- metrics.successful > 0 ? 'COMMUNITY: search_reddit(queries=["topic experiences", "topic recommendations", "topic issues"]) — if topic warrants community perspective' : null,
149
- metrics.successful > 0 ? 'SYNTHESIZE (only after verifying + community check): deep_research(questions=[{question: "Based on scraped data and verification..."}])' : null,
150
- metrics.failed > 0 ? `Retry failed URLs with longer timeout: scrape_links(urls=[...], timeout=60)` : null,
151
- ].filter(Boolean);
152
- }
153
- function buildScrapeMetadata(params, metrics, tokensPerUrl, totalBatches, executionTime) {
154
- return {
155
- total_urls: params.urls.length,
156
- successful: metrics.successful,
157
- failed: metrics.failed,
158
- total_credits: metrics.totalCredits,
159
- execution_time_ms: executionTime,
160
- tokens_per_url: tokensPerUrl,
161
- total_token_budget: TOKEN_BUDGETS.SCRAPER,
162
- batches_processed: totalBatches,
163
- };
164
- }
165
- function buildScrapeResponse(params, contents, metrics, tokensPerUrl, totalBatches, llmErrors, executionTime) {
166
- const batchHeader = formatBatchHeader({
167
- title: `Scraped Content (${params.urls.length} URLs)`,
168
- totalItems: params.urls.length,
169
- successful: metrics.successful,
170
- failed: metrics.failed,
171
- tokensPerItem: tokensPerUrl,
172
- batches: totalBatches,
173
- extras: {
174
- 'Credits used': metrics.totalCredits,
175
- ...(llmErrors > 0 ? { 'LLM extraction failures': llmErrors } : {}),
176
- },
177
- });
178
- const formattedContent = formatSuccess({
179
- title: 'Scraping Complete',
180
- summary: batchHeader,
181
- data: contents.join('\n\n---\n\n'),
182
- nextSteps: buildScrapeNextSteps(metrics),
183
- metadata: {
184
- 'Execution time': formatDuration(executionTime),
185
- 'Token budget': TOKEN_BUDGETS.SCRAPER.toLocaleString(),
186
- },
187
- });
188
- const metadata = buildScrapeMetadata(params, metrics, tokensPerUrl, totalBatches, executionTime);
189
- return { content: formattedContent, structuredContent: { content: formattedContent, metadata } };
190
- }
191
- /**
192
- * Handle scrape links request
193
- * NEVER throws - always returns a valid response with content and metadata
194
- */
195
- export async function handleScrapeLinks(params) {
196
- const startTime = Date.now();
197
- if (!params.urls || params.urls.length === 0) {
198
- return createScrapeErrorResponse('NO_URLS', 'No URLs provided', startTime, params.urls?.length || 0);
199
- }
200
- const { validUrls, invalidUrls } = validateAndPartitionUrls(params.urls);
201
- if (validUrls.length === 0) {
202
- return createScrapeErrorResponse('INVALID_URLS', `All ${params.urls.length} URLs are invalid`, startTime, params.urls.length, false, [
203
- 'web_search(keywords=["topic documentation", "topic guide"]) — search for valid URLs first, then scrape the results',
204
- 'search_reddit(queries=["topic recommendations"]) — find discussion URLs to scrape instead',
205
- ]);
206
- }
207
- const tokensPerUrl = calculateTokenAllocation(validUrls.length, TOKEN_BUDGETS.SCRAPER);
208
- const totalBatches = Math.ceil(validUrls.length / SCRAPER.BATCH_SIZE);
209
- mcpLog('info', `Starting scrape: ${validUrls.length} URL(s), ${tokensPerUrl} tokens/URL, ${totalBatches} batch(es)`, 'scrape');
210
- let clients;
211
- try {
212
- clients = initializeScrapeClients();
213
- }
214
- catch (error) {
215
- const err = classifyError(error);
216
- return createScrapeErrorResponse('CLIENT_INIT_FAILED', `Failed to initialize scraper: ${err.message}`, startTime, params.urls.length, false, [
217
- 'web_search(keywords=["topic key findings", "topic summary", "topic overview"]) — search for information instead of scraping',
218
- 'search_reddit(queries=["topic discussion", "topic recommendations"]) — get community insights as an alternative',
219
- 'deep_research(questions=[{question: "Summarize the key information from [topic/URLs]"}]) — use AI research to gather equivalent information',
220
- ]);
221
- }
222
- const enhancedInstruction = params.use_llm
223
- ? enhanceExtractionInstruction(params.what_to_extract)
224
- : undefined;
225
- const results = await clients.client.scrapeMultiple(validUrls, { timeout: params.timeout });
226
- mcpLog('info', `Scraping complete. Processing ${results.length} results...`, 'scrape');
227
- const { successItems, failedContents, metrics } = processScrapeResults(results, invalidUrls);
228
- const { items: processedItems, llmErrors } = await processItemsWithLlm(successItems, params, enhancedInstruction, tokensPerUrl, clients.llmProcessor);
229
- const contents = assembleContentEntries(processedItems, failedContents);
230
- const executionTime = Date.now() - startTime;
231
- mcpLog('info', `Completed: ${metrics.successful} successful, ${metrics.failed} failed, ${metrics.totalCredits} credits used`, 'scrape');
232
- return buildScrapeResponse(params, contents, metrics, tokensPerUrl, totalBatches, llmErrors, executionTime);
233
- }
234
- //# sourceMappingURL=scrape.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scrape.js","sourceRoot":"","sources":["../../src/tools/scrape.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAEpB,wDAAwD;AACxD,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAE9C,wEAAwE;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AE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AAC9G,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Web Search Tool Handler
3
- * NEVER throws - always returns structured response for graceful degradation
4
- */
5
- import type { WebSearchParams, WebSearchOutput } from '../schemas/web-search.js';
6
- export declare function handleWebSearch(params: WebSearchParams): Promise<{
7
- content: string;
8
- structuredContent: WebSearchOutput;
9
- }>;
10
- //# sourceMappingURL=search.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAkOjF,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,eAAe,CAAA;CAAE,CAAC,CAwBlE"}
@@ -1,158 +0,0 @@
1
- /**
2
- * Web Search Tool Handler
3
- * NEVER throws - always returns structured response for graceful degradation
4
- */
5
- import { SearchClient } from '../clients/search.js';
6
- import { aggregateAndRank, buildUrlLookup, lookupUrl, generateEnhancedOutput, markConsensus, } from '../utils/url-aggregator.js';
7
- import { CTR_WEIGHTS } from '../config/index.js';
8
- import { classifyError } from '../utils/errors.js';
9
- import { mcpLog, formatError, formatDuration, } from './utils.js';
10
- function getPositionScore(position) {
11
- if (position >= 1 && position <= 10) {
12
- return CTR_WEIGHTS[position] ?? 0;
13
- }
14
- return Math.max(0, 10 - (position - 10) * 0.5);
15
- }
16
- // --- Helpers ---
17
- async function executeSearches(keywords) {
18
- const client = new SearchClient();
19
- return client.searchMultiple(keywords);
20
- }
21
- function processAndRankResults(response) {
22
- const aggregation = aggregateAndRank(response.searches, 5);
23
- const urlLookup = buildUrlLookup(aggregation.rankedUrls);
24
- const consensusUrls = aggregation.rankedUrls.filter(url => url.frequency >= aggregation.frequencyThreshold);
25
- return { aggregation, urlLookup, consensusUrls };
26
- }
27
- function buildConsensusSection(consensusUrls, keywords, aggregation) {
28
- if (consensusUrls.length > 0) {
29
- return generateEnhancedOutput(consensusUrls, keywords, aggregation.totalUniqueUrls, aggregation.frequencyThreshold, aggregation.thresholdNote) + '\n---\n\n';
30
- }
31
- return `## The Perfect Search Results (Aggregated from ${keywords.length} Queries)\n\n` +
32
- `> *No high-consensus URLs found across searches. Results may be highly diverse.*\n\n---\n\n`;
33
- }
34
- function formatSearchResultEntry(result, position, urlLookup) {
35
- const positionScore = getPositionScore(position);
36
- const rankedUrl = lookupUrl(result.link, urlLookup);
37
- const frequency = rankedUrl?.frequency ?? 1;
38
- const consensusMark = markConsensus(frequency);
39
- const consensusInfo = rankedUrl
40
- ? `${consensusMark} (${frequency} searches)`
41
- : `${consensusMark} (1 search)`;
42
- let entry = `${position}. **[${result.title}](${result.link})** — Position ${position} | Score: ${positionScore.toFixed(1)} | Consensus: ${consensusInfo}\n`;
43
- if (result.snippet) {
44
- let snippet = result.snippet;
45
- if (snippet.length > 150)
46
- snippet = snippet.substring(0, 147) + '...';
47
- entry += result.date
48
- ? ` - *${result.date}* — ${snippet}\n`
49
- : ` - ${snippet}\n`;
50
- }
51
- entry += '\n';
52
- return entry;
53
- }
54
- function buildPerQuerySection(response, urlLookup) {
55
- const MAX_QUERIES_SHOWN = 15;
56
- const MAX_RESULTS_PER_QUERY = response.totalKeywords > 10 ? 5 : 10;
57
- const queriesToShow = response.searches.slice(0, MAX_QUERIES_SHOWN);
58
- const queriesOmitted = response.searches.length - queriesToShow.length;
59
- let markdown = `## 📊 Full Search Results by Query`;
60
- if (queriesOmitted > 0) {
61
- markdown += ` (showing ${queriesToShow.length} of ${response.searches.length})`;
62
- }
63
- markdown += `\n\n`;
64
- let totalResults = 0;
65
- queriesToShow.forEach((search, index) => {
66
- markdown += `### Query ${index + 1}: "${search.keyword}"\n\n`;
67
- search.results.slice(0, MAX_RESULTS_PER_QUERY).forEach((result, resultIndex) => {
68
- markdown += formatSearchResultEntry(result, resultIndex + 1, urlLookup);
69
- totalResults++;
70
- });
71
- if (search.related && search.related.length > 0) {
72
- const relatedSuggestions = search.related
73
- .slice(0, 5)
74
- .map((r) => `\`${r}\``)
75
- .join(', ');
76
- markdown += `*Related:* ${relatedSuggestions}\n\n`;
77
- }
78
- if (index < queriesToShow.length - 1)
79
- markdown += `---\n\n`;
80
- });
81
- if (queriesOmitted > 0) {
82
- markdown += `\n---\n\n> *${queriesOmitted} additional queries not shown. Consensus URLs above include all ${response.searches.length} queries.*\n`;
83
- }
84
- return { markdown, totalResults };
85
- }
86
- function buildSearchNextSteps(consensusUrls, rankedUrls) {
87
- const topConsensusUrls = consensusUrls.length > 0
88
- ? consensusUrls.slice(0, 5).map(u => `"${u.url}"`).join(', ')
89
- : rankedUrls.slice(0, 5).map(u => `"${u.url}"`).join(', ');
90
- return [
91
- `MUST DO: scrape_links(urls=[${topConsensusUrls}], use_llm=true, what_to_extract="Extract key findings | recommendations | data | evidence | comparisons") — searching only gives URLs, scraping gets the actual content`,
92
- 'COMMUNITY CHECK: search_reddit(queries=["topic recommendations", "topic best 2025", "topic vs alternatives"]) — get real user experiences',
93
- 'ITERATE: If results are insufficient, search again with different keywords from "Related" suggestions above',
94
- 'SYNTHESIZE (only after scraping + Reddit): deep_research(questions=[{question: "Based on scraped content and community feedback..."}])',
95
- ];
96
- }
97
- function formatSearchOutput(consensusSection, perQuerySection, nextSteps, totalResults, aggregation, consensusUrlCount, executionTime, totalKeywords) {
98
- let markdown = consensusSection + perQuerySection;
99
- markdown += '\n\n---\n\n**Next Steps (DO ALL — research is a loop, not a single call):**\n';
100
- nextSteps.forEach((step, i) => { markdown += `${i + 1}. ${step}\n`; });
101
- markdown += `\n---\n*${formatDuration(executionTime)} | ${aggregation.totalUniqueUrls} unique URLs | ${consensusUrlCount} consensus*`;
102
- const metadata = {
103
- total_keywords: totalKeywords,
104
- total_results: totalResults,
105
- execution_time_ms: executionTime,
106
- total_unique_urls: aggregation.totalUniqueUrls,
107
- consensus_url_count: consensusUrlCount,
108
- frequency_threshold: aggregation.frequencyThreshold,
109
- };
110
- return { content: markdown, structuredContent: { content: markdown, metadata } };
111
- }
112
- function buildWebSearchError(error, params, startTime) {
113
- const structuredError = classifyError(error);
114
- const executionTime = Date.now() - startTime;
115
- mcpLog('error', `web_search: ${structuredError.message}`, 'search');
116
- const errorContent = formatError({
117
- code: structuredError.code,
118
- message: structuredError.message,
119
- retryable: structuredError.retryable,
120
- toolName: 'web_search',
121
- howToFix: ['Verify SERPER_API_KEY is set correctly'],
122
- alternatives: [
123
- 'search_reddit(queries=["topic recommendations", "topic best practices", "topic vs alternatives"]) — Reddit search uses the same API but may work; also provides community perspective',
124
- 'deep_research(questions=[{question: "What are the key findings, best practices, and recommendations for [topic]?"}]) — uses OpenRouter API (different key), not affected by this error',
125
- 'scrape_links(urls=[...any URLs you already have...], use_llm=true) — if you have URLs from prior steps, scrape them now instead of searching',
126
- ],
127
- });
128
- return {
129
- content: errorContent,
130
- structuredContent: {
131
- content: errorContent,
132
- metadata: {
133
- total_keywords: params.keywords.length,
134
- total_results: 0,
135
- execution_time_ms: executionTime,
136
- errorCode: structuredError.code,
137
- },
138
- },
139
- };
140
- }
141
- export async function handleWebSearch(params) {
142
- const startTime = Date.now();
143
- try {
144
- mcpLog('info', `Searching for ${params.keywords.length} keyword(s)`, 'search');
145
- const response = await executeSearches(params.keywords);
146
- const { aggregation, urlLookup, consensusUrls } = processAndRankResults(response);
147
- const consensusSection = buildConsensusSection(consensusUrls, params.keywords, aggregation);
148
- const { markdown: perQuerySection, totalResults } = buildPerQuerySection(response, urlLookup);
149
- const executionTime = Date.now() - startTime;
150
- mcpLog('info', `Search completed: ${totalResults} results, ${aggregation.totalUniqueUrls} unique URLs, ${consensusUrls.length} consensus`, 'search');
151
- const nextSteps = buildSearchNextSteps(consensusUrls, aggregation.rankedUrls);
152
- return formatSearchOutput(consensusSection, perQuerySection, nextSteps, totalResults, aggregation, consensusUrls.length, executionTime, response.totalKeywords);
153
- }
154
- catch (error) {
155
- return buildWebSearchError(error, params, startTime);
156
- }
157
- }
158
- //# sourceMappingURL=search.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAA0C,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EACL,MAAM,EAEN,WAAW,EACX,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,SAAS,gBAAgB,CAAC,QAAgB;IACxC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;AACjD,CAAC;AAgBD,kBAAkB;AAElB,KAAK,UAAU,eAAe,CAAC,QAAkB;IAC/C,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAwB;IAKrD,MAAM,WAAW,GAAG,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,cAAc,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,WAAW,CAA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AAG,SAAS,CAAC;QAC7C,MAAM,CAAC,MAAM,EAAE,qBAAqB,YAAY,aAAa,WAAW,CAAC,eAAe,iBAAiB,aAAa,CAAC,MAAM,YAAY,EAAE,QAAQ,CAAC,CAAC;QAErJ,MAAM,SAAS,GAAG,oBAAoB,CAAC,aAAa,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;QAE9E,OAAO,kBAAkB,CACvB,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAC1D,WAAW,EAAE,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC,aAAa,CACzE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
@@ -1,105 +0,0 @@
1
- /**
2
- * Shared Tool Utilities
3
- * Extracted from individual handlers to eliminate duplication
4
- */
5
- export { mcpLog, safeLog as safeLogSimple, createToolLogger, type LogLevel, type ToolLogger as SimpleToolLogger, } from '../utils/logger.js';
6
- export { formatSuccess, formatError, formatBatchHeader, formatList, formatDuration, truncateText, type SuccessOptions, type ErrorOptions, type BatchHeaderOptions, type ListItem, } from '../utils/response.js';
7
- /**
8
- * Centralized token budgets for all tools
9
- */
10
- export declare const TOKEN_BUDGETS: {
11
- /** Deep research total budget */
12
- readonly RESEARCH: 32000;
13
- /** Web scraper total budget */
14
- readonly SCRAPER: 32000;
15
- /** Reddit comment budget per batch */
16
- readonly REDDIT_COMMENTS: 1000;
17
- };
18
- /**
19
- * Logger function type used by tools
20
- */
21
- export type ToolLogger = (level: 'info' | 'error' | 'debug', message: string, sessionId: string) => Promise<void>;
22
- /**
23
- * Standard tool options passed to handlers
24
- */
25
- export interface ToolOptions {
26
- readonly sessionId?: string;
27
- readonly logger?: ToolLogger;
28
- }
29
- /**
30
- * Safe logger wrapper - NEVER throws
31
- * Logs to provided logger or falls back to console.error
32
- *
33
- * @param logger - Optional logger function
34
- * @param sessionId - Session ID for logging context
35
- * @param level - Log level
36
- * @param message - Message to log
37
- * @param toolName - Name of the tool for prefixing
38
- */
39
- export declare function safeLog(logger: ToolLogger | undefined, sessionId: string | undefined, level: 'info' | 'error' | 'debug', message: string, toolName: string): Promise<void>;
40
- /**
41
- * Calculate token allocation for batch operations
42
- * Distributes a fixed budget across multiple items
43
- *
44
- * @param count - Number of items to distribute budget across
45
- * @param budget - Total token budget
46
- * @returns Tokens per item
47
- */
48
- export declare function calculateTokenAllocation(count: number, budget: number): number;
49
- /**
50
- * Format retry hint based on error retryability
51
- *
52
- * @param retryable - Whether the error is retryable
53
- * @returns Hint string or empty string
54
- */
55
- export declare function formatRetryHint(retryable: boolean): string;
56
- /**
57
- * Create a standard error markdown response
58
- *
59
- * @param toolName - Name of the tool that errored
60
- * @param errorCode - Error code
61
- * @param message - Error message
62
- * @param retryable - Whether error is retryable
63
- * @param tip - Optional tip for resolution
64
- * @returns Formatted markdown error string
65
- */
66
- export declare function formatToolError(toolName: string, errorCode: string, message: string, retryable: boolean, tip?: string): string;
67
- /**
68
- * Validate that a value is a non-empty array
69
- *
70
- * @param value - Value to check
71
- * @param fieldName - Field name for error message
72
- * @returns Error message or undefined if valid
73
- */
74
- export declare function validateNonEmptyArray(value: unknown, fieldName: string): string | undefined;
75
- /**
76
- * Validate array length is within bounds
77
- *
78
- * @param arr - Array to check
79
- * @param min - Minimum length
80
- * @param max - Maximum length
81
- * @param fieldName - Field name for error message
82
- * @returns Error message or undefined if valid
83
- */
84
- export declare function validateArrayBounds(arr: unknown[], min: number, max: number, fieldName: string): string | undefined;
85
- /**
86
- * Build standard header for batch operation results
87
- *
88
- * @param title - Title of the results section
89
- * @param count - Number of items processed
90
- * @param tokensPerItem - Tokens allocated per item
91
- * @param totalBudget - Total token budget
92
- * @returns Formatted header string
93
- */
94
- export declare function buildBatchHeader(title: string, count: number, tokensPerItem: number, totalBudget: number): string;
95
- /**
96
- * Build status line for batch results
97
- *
98
- * @param successful - Number of successful items
99
- * @param failed - Number of failed items
100
- * @param batches - Number of batches processed
101
- * @param extras - Optional extra status items
102
- * @returns Formatted status line
103
- */
104
- export declare function buildStatusLine(successful: number, failed: number, batches: number, extras?: string[]): string;
105
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,MAAM,EACN,OAAO,IAAI,aAAa,EACxB,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,UAAU,IAAI,gBAAgB,GACpC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,GACd,MAAM,sBAAsB,CAAC;AAM9B;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,iCAAiC;;IAEjC,+BAA+B;;IAE/B,sCAAsC;;CAE9B,CAAC;AAMX;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CACvB,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,EACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;CAC9B;AAMD;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAC3B,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,EACjC,OAAO,EAAE,MAAM,EACf,QAAQ,EAA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