mcp-researchpowerpack 3.6.9
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.
- package/README.md +635 -0
- package/dist/clients/reddit.d.ts +74 -0
- package/dist/clients/reddit.d.ts.map +1 -0
- package/dist/clients/reddit.js +305 -0
- package/dist/clients/reddit.js.map +1 -0
- package/dist/clients/research.d.ts +67 -0
- package/dist/clients/research.d.ts.map +1 -0
- package/dist/clients/research.js +252 -0
- package/dist/clients/research.js.map +1 -0
- package/dist/clients/scraper.d.ts +71 -0
- package/dist/clients/scraper.d.ts.map +1 -0
- package/dist/clients/scraper.js +321 -0
- package/dist/clients/scraper.js.map +1 -0
- package/dist/clients/search.d.ts +62 -0
- package/dist/clients/search.d.ts.map +1 -0
- package/dist/clients/search.js +219 -0
- package/dist/clients/search.js.map +1 -0
- package/dist/config/index.d.ts +62 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +142 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +40 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +305 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/types.d.ts +81 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +6 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/yaml/tools.yaml +130 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +271 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/deep-research.d.ts +64 -0
- package/dist/schemas/deep-research.d.ts.map +1 -0
- package/dist/schemas/deep-research.js +224 -0
- package/dist/schemas/deep-research.js.map +1 -0
- package/dist/schemas/scrape-links.d.ts +32 -0
- package/dist/schemas/scrape-links.d.ts.map +1 -0
- package/dist/schemas/scrape-links.js +34 -0
- package/dist/schemas/scrape-links.js.map +1 -0
- package/dist/schemas/web-search.d.ts +22 -0
- package/dist/schemas/web-search.d.ts.map +1 -0
- package/dist/schemas/web-search.js +21 -0
- package/dist/schemas/web-search.js.map +1 -0
- package/dist/services/file-attachment.d.ts +30 -0
- package/dist/services/file-attachment.d.ts.map +1 -0
- package/dist/services/file-attachment.js +199 -0
- package/dist/services/file-attachment.js.map +1 -0
- package/dist/services/llm-processor.d.ts +27 -0
- package/dist/services/llm-processor.d.ts.map +1 -0
- package/dist/services/llm-processor.js +179 -0
- package/dist/services/llm-processor.js.map +1 -0
- package/dist/services/markdown-cleaner.d.ts +8 -0
- package/dist/services/markdown-cleaner.d.ts.map +1 -0
- package/dist/services/markdown-cleaner.js +44 -0
- package/dist/services/markdown-cleaner.js.map +1 -0
- package/dist/tools/definitions.d.ts +16 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +17 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/reddit.d.ts +14 -0
- package/dist/tools/reddit.d.ts.map +1 -0
- package/dist/tools/reddit.js +213 -0
- package/dist/tools/reddit.js.map +1 -0
- package/dist/tools/registry.d.ts +71 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +242 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/research.d.ts +14 -0
- package/dist/tools/research.d.ts.map +1 -0
- package/dist/tools/research.js +194 -0
- package/dist/tools/research.js.map +1 -0
- package/dist/tools/scrape.d.ts +14 -0
- package/dist/tools/scrape.d.ts.map +1 -0
- package/dist/tools/scrape.js +201 -0
- package/dist/tools/scrape.js.map +1 -0
- package/dist/tools/search.d.ts +10 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +137 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/utils.d.ts +105 -0
- package/dist/tools/utils.d.ts.map +1 -0
- package/dist/tools/utils.js +159 -0
- package/dist/tools/utils.js.map +1 -0
- package/dist/utils/concurrency.d.ts +29 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/concurrency.js +73 -0
- package/dist/utils/concurrency.js.map +1 -0
- package/dist/utils/errors.d.ts +77 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +335 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +39 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +57 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown-formatter.d.ts +5 -0
- package/dist/utils/markdown-formatter.d.ts.map +1 -0
- package/dist/utils/markdown-formatter.js +15 -0
- package/dist/utils/markdown-formatter.js.map +1 -0
- package/dist/utils/response.d.ts +88 -0
- package/dist/utils/response.d.ts.map +1 -0
- package/dist/utils/response.js +151 -0
- package/dist/utils/response.js.map +1 -0
- package/dist/utils/url-aggregator.d.ts +90 -0
- package/dist/utils/url-aggregator.d.ts.map +1 -0
- package/dist/utils/url-aggregator.js +502 -0
- package/dist/utils/url-aggregator.js.map +1 -0
- package/dist/version.d.ts +30 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +60 -0
- package/dist/version.js.map +1 -0
- package/dist/worker.d.ts +17 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +53 -0
- package/dist/worker.js.map +1 -0
- package/package.json +73 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Research Powerpack MCP Server
|
|
4
|
+
* Implements robust error handling - server NEVER crashes on tool failures
|
|
5
|
+
*/
|
|
6
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
7
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
8
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
9
|
+
import { TOOLS } from './tools/definitions.js';
|
|
10
|
+
import { executeTool, getToolCapabilities } from './tools/registry.js';
|
|
11
|
+
import { classifyError, createToolErrorFromStructured } from './utils/errors.js';
|
|
12
|
+
import { SERVER, getCapabilities } from './config/index.js';
|
|
13
|
+
import { initLogger } from './utils/logger.js';
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// Capability Detection (uses registry for tool capability mapping)
|
|
16
|
+
// ============================================================================
|
|
17
|
+
const capabilities = getCapabilities();
|
|
18
|
+
const { enabled: enabledTools, disabled: disabledTools } = getToolCapabilities();
|
|
19
|
+
if (enabledTools.length > 0) {
|
|
20
|
+
console.error(`✅ Enabled tools: ${enabledTools.join(', ')}`);
|
|
21
|
+
}
|
|
22
|
+
if (disabledTools.length > 0) {
|
|
23
|
+
console.error(`⚠️ Disabled tools (missing ENV): ${disabledTools.join(', ')}`);
|
|
24
|
+
}
|
|
25
|
+
if (capabilities.scraping && !capabilities.llmExtraction) {
|
|
26
|
+
console.error(`ℹ️ scrape_links: AI extraction (use_llm) disabled - set OPENROUTER_API_KEY to enable`);
|
|
27
|
+
}
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Server Setup
|
|
30
|
+
// ============================================================================
|
|
31
|
+
const server = new Server({ name: SERVER.NAME, version: SERVER.VERSION }, { capabilities: { tools: {}, logging: {} } });
|
|
32
|
+
initLogger(server);
|
|
33
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
34
|
+
/**
|
|
35
|
+
* Tool execution handler - uses registry pattern for clean routing
|
|
36
|
+
* All capability checks, validation, and error handling are in executeTool
|
|
37
|
+
*/
|
|
38
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
39
|
+
const { name, arguments: args } = request.params;
|
|
40
|
+
try {
|
|
41
|
+
// All routing handled by registry - no more if/else blocks!
|
|
42
|
+
return await executeTool(name, args, capabilities);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
// McpError propagates to client as protocol error
|
|
46
|
+
if (error instanceof McpError) {
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
// Unexpected error - format as tool error
|
|
50
|
+
const structuredError = classifyError(error);
|
|
51
|
+
console.error(`[MCP Server] Tool "${name}" error:`, {
|
|
52
|
+
code: structuredError.code,
|
|
53
|
+
message: structuredError.message,
|
|
54
|
+
retryable: structuredError.retryable,
|
|
55
|
+
});
|
|
56
|
+
return createToolErrorFromStructured(structuredError);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
// ============================================================================
|
|
60
|
+
// Global Error Handlers - MUST EXIT on fatal errors per Node.js best practices
|
|
61
|
+
// See: https://nodejs.org/api/process.html#warning-using-uncaughtexception-correctly
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// Track shutdown state to prevent double shutdown
|
|
64
|
+
let isShuttingDown = false;
|
|
65
|
+
/**
|
|
66
|
+
* Graceful shutdown handler - closes server and exits
|
|
67
|
+
* @param exitCode - Exit code (0 for clean shutdown, 1 for error)
|
|
68
|
+
*/
|
|
69
|
+
async function gracefulShutdown(exitCode) {
|
|
70
|
+
if (isShuttingDown)
|
|
71
|
+
return;
|
|
72
|
+
isShuttingDown = true;
|
|
73
|
+
try {
|
|
74
|
+
await server.close();
|
|
75
|
+
console.error(`[MCP Server] Server closed at ${new Date().toISOString()}`);
|
|
76
|
+
}
|
|
77
|
+
catch (closeError) {
|
|
78
|
+
console.error('[MCP Server] Error closing server:', closeError);
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
process.exit(exitCode);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Safely extract error information without triggering another exception
|
|
86
|
+
* Prevents infinite loops when error objects have problematic getters
|
|
87
|
+
*/
|
|
88
|
+
function safeErrorString(error) {
|
|
89
|
+
try {
|
|
90
|
+
if (error instanceof Error) {
|
|
91
|
+
// Try to get message and stack safely
|
|
92
|
+
const message = String(error.message || 'Unknown error');
|
|
93
|
+
try {
|
|
94
|
+
const stack = String(error.stack || '');
|
|
95
|
+
if (!stack) {
|
|
96
|
+
return message;
|
|
97
|
+
}
|
|
98
|
+
// Avoid duplicating the message when the stack already includes it
|
|
99
|
+
return stack.includes(message) ? stack : `${message}\n${stack}`;
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return message; // Stack serialization failed, just return message
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return String(error);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Even String() can fail on some objects
|
|
109
|
+
return '[Error: Unable to serialize error object]';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Handle uncaught exceptions - MUST EXIT per Node.js docs
|
|
113
|
+
// The VM is in an unstable state after uncaught exception
|
|
114
|
+
process.on('uncaughtException', (error) => {
|
|
115
|
+
try {
|
|
116
|
+
console.error(`[MCP Server] FATAL uncaughtException at ${new Date().toISOString()}:`);
|
|
117
|
+
console.error(safeErrorString(error));
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// Even logging failed - just exit
|
|
121
|
+
console.error('[MCP Server] FATAL uncaughtException (unable to log details)');
|
|
122
|
+
}
|
|
123
|
+
gracefulShutdown(1);
|
|
124
|
+
});
|
|
125
|
+
// Handle unhandled promise rejections - MUST EXIT (Node v15+ behavior)
|
|
126
|
+
// Suppressing this risks memory leaks and corrupted state
|
|
127
|
+
process.on('unhandledRejection', (reason) => {
|
|
128
|
+
try {
|
|
129
|
+
const error = classifyError(reason);
|
|
130
|
+
console.error(`[MCP Server] FATAL unhandledRejection at ${new Date().toISOString()}:`);
|
|
131
|
+
console.error(` Message: ${error.message}`);
|
|
132
|
+
console.error(` Code: ${error.code}`);
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
// classifyError or logging failed, use safeErrorString as fallback
|
|
136
|
+
console.error('[MCP Server] FATAL unhandledRejection (unable to classify error):');
|
|
137
|
+
console.error(safeErrorString(reason));
|
|
138
|
+
}
|
|
139
|
+
gracefulShutdown(1);
|
|
140
|
+
});
|
|
141
|
+
// Handle SIGTERM gracefully (Docker/Kubernetes stop signal)
|
|
142
|
+
process.on('SIGTERM', () => {
|
|
143
|
+
console.error(`[MCP Server] Received SIGTERM at ${new Date().toISOString()}, shutting down gracefully`);
|
|
144
|
+
gracefulShutdown(0);
|
|
145
|
+
});
|
|
146
|
+
// Handle SIGINT gracefully (Ctrl+C) - use once() to prevent double-fire
|
|
147
|
+
process.once('SIGINT', () => {
|
|
148
|
+
console.error(`[MCP Server] Received SIGINT at ${new Date().toISOString()}, shutting down gracefully`);
|
|
149
|
+
gracefulShutdown(0);
|
|
150
|
+
});
|
|
151
|
+
// ============================================================================
|
|
152
|
+
// Stdin disconnect detection
|
|
153
|
+
// The MCP SDK's StdioServerTransport does NOT listen for stdin 'close'/'end'.
|
|
154
|
+
// When the parent process disconnects (closes the pipe), stdin emits these
|
|
155
|
+
// events but nobody handles them — Node.js keeps polling the dead fd at 100%
|
|
156
|
+
// CPU. We fix this by detecting the disconnect and exiting cleanly.
|
|
157
|
+
// ============================================================================
|
|
158
|
+
process.stdin.on('close', () => {
|
|
159
|
+
console.error(`[MCP Server] stdin closed (parent disconnected) at ${new Date().toISOString()}, shutting down`);
|
|
160
|
+
gracefulShutdown(0);
|
|
161
|
+
});
|
|
162
|
+
process.stdin.on('end', () => {
|
|
163
|
+
console.error(`[MCP Server] stdin ended (parent disconnected) at ${new Date().toISOString()}, shutting down`);
|
|
164
|
+
gracefulShutdown(0);
|
|
165
|
+
});
|
|
166
|
+
// Also handle stdout errors (broken pipe when parent is gone)
|
|
167
|
+
process.stdout.on('error', (err) => {
|
|
168
|
+
if (err.code === 'EPIPE' || err.code === 'ERR_STREAM_DESTROYED') {
|
|
169
|
+
console.error(`[MCP Server] stdout broken pipe at ${new Date().toISOString()}, shutting down`);
|
|
170
|
+
gracefulShutdown(0);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
// ============================================================================
|
|
174
|
+
// Start Server — STDIO (default) or HTTP Streamable (MCP_TRANSPORT=http)
|
|
175
|
+
// ============================================================================
|
|
176
|
+
const transportMode = (process.env.MCP_TRANSPORT || 'stdio').toLowerCase();
|
|
177
|
+
if (transportMode === 'http') {
|
|
178
|
+
// HTTP Streamable transport — stateful sessions over HTTP
|
|
179
|
+
const { StreamableHTTPServerTransport } = await import('@modelcontextprotocol/sdk/server/streamableHttp.js');
|
|
180
|
+
const { createServer: createHttpServer } = await import('node:http');
|
|
181
|
+
const { randomUUID } = await import('node:crypto');
|
|
182
|
+
const PORT = parseInt(process.env.MCP_PORT || '3000', 10);
|
|
183
|
+
// Map of session ID → transport for multi-session support
|
|
184
|
+
const sessions = new Map();
|
|
185
|
+
const httpServer = createHttpServer(async (req, res) => {
|
|
186
|
+
const url = new URL(req.url || '/', `http://localhost:${PORT}`);
|
|
187
|
+
// Health check
|
|
188
|
+
if (url.pathname === '/health') {
|
|
189
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
190
|
+
res.end(JSON.stringify({ status: 'ok', name: SERVER.NAME, version: SERVER.VERSION }));
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
// MCP endpoint
|
|
194
|
+
if (url.pathname === '/mcp') {
|
|
195
|
+
// Handle DELETE — session termination
|
|
196
|
+
if (req.method === 'DELETE') {
|
|
197
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
198
|
+
if (sessionId && sessions.has(sessionId)) {
|
|
199
|
+
const transport = sessions.get(sessionId);
|
|
200
|
+
await transport.handleRequest(req, res);
|
|
201
|
+
sessions.delete(sessionId);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
res.writeHead(404).end('Session not found');
|
|
205
|
+
}
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
// For GET/POST — find existing session or create new one
|
|
209
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
210
|
+
if (sessionId && sessions.has(sessionId)) {
|
|
211
|
+
// Existing session
|
|
212
|
+
await sessions.get(sessionId).handleRequest(req, res);
|
|
213
|
+
}
|
|
214
|
+
else if (!sessionId && req.method === 'POST') {
|
|
215
|
+
// New session (initialization)
|
|
216
|
+
const transport = new StreamableHTTPServerTransport({
|
|
217
|
+
sessionIdGenerator: () => randomUUID(),
|
|
218
|
+
onsessioninitialized: (id) => {
|
|
219
|
+
sessions.set(id, transport);
|
|
220
|
+
console.error(`[HTTP] Session ${id} initialized`);
|
|
221
|
+
},
|
|
222
|
+
onsessionclosed: (id) => {
|
|
223
|
+
sessions.delete(id);
|
|
224
|
+
console.error(`[HTTP] Session ${id} closed`);
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
// Each new transport needs its own server instance connected
|
|
228
|
+
const sessionServer = new Server({ name: SERVER.NAME, version: SERVER.VERSION }, { capabilities: { tools: {}, logging: {} } });
|
|
229
|
+
initLogger(sessionServer);
|
|
230
|
+
sessionServer.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
231
|
+
sessionServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
232
|
+
const { name, arguments: args } = request.params;
|
|
233
|
+
try {
|
|
234
|
+
return await executeTool(name, args, capabilities);
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
if (error instanceof McpError)
|
|
238
|
+
throw error;
|
|
239
|
+
const structuredError = classifyError(error);
|
|
240
|
+
console.error(`[HTTP] Tool "${name}" error:`, structuredError.message);
|
|
241
|
+
return createToolErrorFromStructured(structuredError);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
await sessionServer.connect(transport);
|
|
245
|
+
await transport.handleRequest(req, res);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
res.writeHead(400).end('Bad request — missing session ID');
|
|
249
|
+
}
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
res.writeHead(404).end('Not found');
|
|
253
|
+
});
|
|
254
|
+
httpServer.listen(PORT, () => {
|
|
255
|
+
console.error(`🚀 ${SERVER.NAME} v${SERVER.VERSION} listening on http://localhost:${PORT}/mcp`);
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
// STDIO transport (default)
|
|
260
|
+
const transport = new StdioServerTransport();
|
|
261
|
+
try {
|
|
262
|
+
server.connect(transport);
|
|
263
|
+
console.error(`🚀 ${SERVER.NAME} v${SERVER.VERSION} ready (stdio)`);
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
const err = classifyError(error);
|
|
267
|
+
console.error(`[MCP Server] Failed to start: ${err.message}`);
|
|
268
|
+
process.exit(1);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAE7G,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,+EAA+E;AAC/E,mEAAmE;AACnE,+EAA+E;AAE/E,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;AACvC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,mBAAmB,EAAE,CAAC;AAEjF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,KAAK,CAAC,oBAAoB,YAAY,CAAC,IAAI,CAAC,IAAI,CAA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AC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep research schema - batch research with dynamic token allocation
|
|
3
|
+
* Enhanced with comprehensive prompting for bugs, programming questions, and general research
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const deepResearchParamsSchema: z.ZodObject<{
|
|
7
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
8
|
+
question: z.ZodString;
|
|
9
|
+
file_attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
path: z.ZodString;
|
|
11
|
+
start_line: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
end_line: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
path: string;
|
|
16
|
+
start_line?: number | undefined;
|
|
17
|
+
end_line?: number | undefined;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
path: string;
|
|
21
|
+
start_line?: number | undefined;
|
|
22
|
+
end_line?: number | undefined;
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
}>, "many">>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
question: string;
|
|
27
|
+
file_attachments?: {
|
|
28
|
+
path: string;
|
|
29
|
+
start_line?: number | undefined;
|
|
30
|
+
end_line?: number | undefined;
|
|
31
|
+
description?: string | undefined;
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
question: string;
|
|
35
|
+
file_attachments?: {
|
|
36
|
+
path: string;
|
|
37
|
+
start_line?: number | undefined;
|
|
38
|
+
end_line?: number | undefined;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
}[] | undefined;
|
|
41
|
+
}>, "many">;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
questions: {
|
|
44
|
+
question: string;
|
|
45
|
+
file_attachments?: {
|
|
46
|
+
path: string;
|
|
47
|
+
start_line?: number | undefined;
|
|
48
|
+
end_line?: number | undefined;
|
|
49
|
+
description?: string | undefined;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
}, {
|
|
53
|
+
questions: {
|
|
54
|
+
question: string;
|
|
55
|
+
file_attachments?: {
|
|
56
|
+
path: string;
|
|
57
|
+
start_line?: number | undefined;
|
|
58
|
+
end_line?: number | undefined;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
}[];
|
|
62
|
+
}>;
|
|
63
|
+
export type DeepResearchParams = z.infer<typeof deepResearchParamsSchema>;
|
|
64
|
+
//# sourceMappingURL=deep-research.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-research.d.ts","sourceRoot":"","sources":["../../src/schemas/deep-research.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4OxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoC,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep research schema - batch research with dynamic token allocation
|
|
3
|
+
* Enhanced with comprehensive prompting for bugs, programming questions, and general research
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
// File attachment schema with comprehensive descriptions to guide LLM usage
|
|
7
|
+
const fileAttachmentSchema = z.object({
|
|
8
|
+
path: z
|
|
9
|
+
.string({ required_error: 'deep_research: File path is required' })
|
|
10
|
+
.min(1, { message: 'deep_research: File path cannot be empty' })
|
|
11
|
+
.describe(`**[REQUIRED] Absolute file path to attach.**
|
|
12
|
+
|
|
13
|
+
⚠️ **YOU MUST USE ABSOLUTE PATHS** - e.g., "/Users/john/project/src/utils/auth.ts" NOT "src/utils/auth.ts"
|
|
14
|
+
|
|
15
|
+
The file will be read from the filesystem and included as context for the research question. This is CRITICAL for:
|
|
16
|
+
- Bug investigations (attach the failing code)
|
|
17
|
+
- Code reviews (attach the code to review)
|
|
18
|
+
- Refactoring questions (attach current implementation)
|
|
19
|
+
- Architecture decisions (attach relevant modules)
|
|
20
|
+
- Performance issues (attach the slow code path)
|
|
21
|
+
|
|
22
|
+
**IMPORTANT:** Always use the full absolute path as shown in your IDE or terminal.`),
|
|
23
|
+
start_line: z
|
|
24
|
+
.number({ invalid_type_error: 'deep_research: start_line must be a number' })
|
|
25
|
+
.int({ message: 'deep_research: start_line must be an integer' })
|
|
26
|
+
.positive({ message: 'deep_research: start_line must be a positive integer (1-indexed)' })
|
|
27
|
+
.optional()
|
|
28
|
+
.describe(`**[OPTIONAL] Start line number (1-indexed).**
|
|
29
|
+
|
|
30
|
+
Use this to focus on a specific section of a large file. If omitted, reads from line 1.
|
|
31
|
+
Example: start_line=50 with end_line=100 reads lines 50-100 only.`),
|
|
32
|
+
end_line: z
|
|
33
|
+
.number({ invalid_type_error: 'deep_research: end_line must be a number' })
|
|
34
|
+
.int({ message: 'deep_research: end_line must be an integer' })
|
|
35
|
+
.positive({ message: 'deep_research: end_line must be a positive integer (1-indexed)' })
|
|
36
|
+
.optional()
|
|
37
|
+
.describe(`**[OPTIONAL] End line number (1-indexed).**
|
|
38
|
+
|
|
39
|
+
Use this to limit the scope to relevant code sections. If omitted, reads to end of file.
|
|
40
|
+
For large files (>500 lines), consider specifying a range to focus the research.`),
|
|
41
|
+
description: z
|
|
42
|
+
.string()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe(`**[HIGHLY RECOMMENDED] Comprehensive description of why this file is attached and what to focus on.**
|
|
45
|
+
|
|
46
|
+
⚠️ **THIS IS CRITICAL FOR EFFECTIVE RESEARCH.** Write a detailed description explaining:
|
|
47
|
+
|
|
48
|
+
1. **What this file is:** "This is the main authentication middleware that handles JWT validation"
|
|
49
|
+
2. **Why it's relevant:** "The bug occurs when tokens expire during long-running requests"
|
|
50
|
+
3. **What to focus on:** "Pay attention to the refreshToken() function on lines 45-80"
|
|
51
|
+
4. **Known issues/context:** "We suspect the race condition happens in the async validation"
|
|
52
|
+
5. **Related files:** "This interacts with /src/services/token-service.ts for token refresh"
|
|
53
|
+
|
|
54
|
+
**GOOD EXAMPLE:**
|
|
55
|
+
"This is our Redis caching layer (cache-service.ts). The bug manifests as stale data being returned after cache invalidation. Focus on the invalidatePattern() method (lines 120-150) and how it interacts with the pub/sub mechanism. We're using Redis Cluster and suspect the issue is related to cross-node invalidation timing."
|
|
56
|
+
|
|
57
|
+
**BAD EXAMPLE:**
|
|
58
|
+
"cache file" ← Too vague, research will be unfocused`),
|
|
59
|
+
});
|
|
60
|
+
// Research question schema with structured template guidance
|
|
61
|
+
const researchQuestionSchema = z.object({
|
|
62
|
+
question: z
|
|
63
|
+
.string({ required_error: 'deep_research: Question is required' })
|
|
64
|
+
.min(10, { message: 'deep_research: Question must be at least 10 characters' })
|
|
65
|
+
.describe(`**[REQUIRED] Your research question - MUST follow this structured template:**
|
|
66
|
+
|
|
67
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
📋 **STRUCTURED QUESTION TEMPLATE** (You MUST use this format)
|
|
69
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
70
|
+
|
|
71
|
+
**1. 🎯 WHAT I NEED:**
|
|
72
|
+
[Clearly state what you're trying to achieve, solve, or understand]
|
|
73
|
+
|
|
74
|
+
**2. 🤔 WHY I'M RESEARCHING THIS:**
|
|
75
|
+
[Explain the context - what decision does this inform? What problem are you solving?]
|
|
76
|
+
|
|
77
|
+
**3. 📚 WHAT I ALREADY KNOW:**
|
|
78
|
+
[Share your current understanding so research fills gaps, not repeats basics]
|
|
79
|
+
|
|
80
|
+
**4. 🔧 HOW I PLAN TO USE THIS:**
|
|
81
|
+
[Describe the practical application - implementation, debugging, architecture, etc.]
|
|
82
|
+
|
|
83
|
+
**5. ❓ SPECIFIC QUESTIONS (2-5):**
|
|
84
|
+
- Question 1: [Specific, pointed question]
|
|
85
|
+
- Question 2: [Another specific question]
|
|
86
|
+
- Question 3: [etc.]
|
|
87
|
+
|
|
88
|
+
**6. 🌐 PRIORITY SOURCES (optional):**
|
|
89
|
+
[Sites/docs to prioritize: "Prefer official React docs, GitHub issues, Stack Overflow"]
|
|
90
|
+
|
|
91
|
+
**7. ⚡ PRIORITY INFO (optional):**
|
|
92
|
+
[What matters most: "Focus on performance implications" or "Prioritize security best practices"]
|
|
93
|
+
|
|
94
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
95
|
+
|
|
96
|
+
**EXAMPLE FOR BUG INVESTIGATION:**
|
|
97
|
+
"🎯 WHAT I NEED: Debug why our WebSocket connections drop after exactly 60 seconds of inactivity.
|
|
98
|
+
|
|
99
|
+
🤔 WHY: Production users are losing real-time updates, causing data sync issues and support tickets.
|
|
100
|
+
|
|
101
|
+
📚 WHAT I KNOW: We use Socket.io v4.6 with Redis adapter. The 60s timeout suggests a proxy/load balancer issue, but we've checked nginx configs.
|
|
102
|
+
|
|
103
|
+
🔧 HOW I'LL USE THIS: Implement the fix in our connection-manager.ts (attached) and update our deployment configs.
|
|
104
|
+
|
|
105
|
+
❓ SPECIFIC QUESTIONS:
|
|
106
|
+
1. What are common causes of exactly 60-second WebSocket timeouts?
|
|
107
|
+
2. How should Socket.io heartbeat/ping intervals be configured to prevent this?
|
|
108
|
+
3. Are there AWS ALB-specific settings we need to consider?
|
|
109
|
+
4. How do other production apps handle WebSocket keep-alive?
|
|
110
|
+
|
|
111
|
+
🌐 PRIORITY: Socket.io official docs, AWS documentation, GitHub issues with similar problems
|
|
112
|
+
|
|
113
|
+
⚡ FOCUS: Production-ready solutions, not development workarounds"
|
|
114
|
+
|
|
115
|
+
**EXAMPLE FOR ARCHITECTURE RESEARCH:**
|
|
116
|
+
"🎯 WHAT I NEED: Best practices for implementing CQRS pattern with Event Sourcing in Node.js/TypeScript.
|
|
117
|
+
|
|
118
|
+
🤔 WHY: Our monolithic API is hitting scaling limits. We need to separate read/write paths for our order processing system.
|
|
119
|
+
|
|
120
|
+
📚 WHAT I KNOW: Familiar with basic event-driven architecture, used RabbitMQ before. New to full CQRS/ES implementation.
|
|
121
|
+
|
|
122
|
+
🔧 HOW I'LL USE THIS: Design the new order-service architecture, select appropriate libraries, plan migration strategy.
|
|
123
|
+
|
|
124
|
+
❓ SPECIFIC QUESTIONS:
|
|
125
|
+
1. What are the recommended Node.js libraries for CQRS/ES? (Pros/cons of each)
|
|
126
|
+
2. How should we handle eventual consistency in read models?
|
|
127
|
+
3. What's the best event store for our scale (~10k events/day)?
|
|
128
|
+
4. How do we handle schema evolution for events over time?
|
|
129
|
+
5. What are common pitfalls teams encounter when adopting CQRS/ES?
|
|
130
|
+
|
|
131
|
+
🌐 PRIORITY: Microsoft docs (they coined CQRS), Martin Fowler, real-world case studies
|
|
132
|
+
|
|
133
|
+
⚡ FOCUS: Production patterns, not theoretical explanations. Include code examples."`),
|
|
134
|
+
file_attachments: z
|
|
135
|
+
.array(fileAttachmentSchema)
|
|
136
|
+
.optional()
|
|
137
|
+
.describe(`**[CRITICAL FOR BUGS/CODE QUESTIONS] File attachments to include as research context.**
|
|
138
|
+
|
|
139
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
140
|
+
⚠️ **YOU MUST ATTACH FILES WHEN:**
|
|
141
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
142
|
+
|
|
143
|
+
✅ **MANDATORY file attachment scenarios:**
|
|
144
|
+
- 🐛 **Bug investigation** → Attach the buggy code file(s)
|
|
145
|
+
- 🔍 **Code review** → Attach the code to be reviewed
|
|
146
|
+
- ♻️ **Refactoring** → Attach current implementation
|
|
147
|
+
- 🏗️ **Architecture questions about YOUR code** → Attach relevant modules
|
|
148
|
+
- ⚡ **Performance issues** → Attach the slow code paths
|
|
149
|
+
- 🔒 **Security review** → Attach the security-sensitive code
|
|
150
|
+
- 🧪 **Testing questions** → Attach both the code AND test files
|
|
151
|
+
- 🔗 **Integration issues** → Attach files from both sides of the integration
|
|
152
|
+
|
|
153
|
+
❌ **File attachments NOT needed for:**
|
|
154
|
+
- General concept questions ("What is CQRS?")
|
|
155
|
+
- Technology comparisons ("React vs Vue")
|
|
156
|
+
- Best practices research (unless about your specific code)
|
|
157
|
+
- Documentation lookups
|
|
158
|
+
|
|
159
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
160
|
+
📎 **HOW TO ATTACH FILES:**
|
|
161
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
162
|
+
|
|
163
|
+
**Each attachment requires:**
|
|
164
|
+
1. \`path\` (REQUIRED): **Absolute path** like "/Users/dev/project/src/auth.ts"
|
|
165
|
+
2. \`start_line\` (optional): Focus on specific section
|
|
166
|
+
3. \`end_line\` (optional): Limit scope for large files
|
|
167
|
+
4. \`description\` (HIGHLY RECOMMENDED): Explain what this file is and why it matters
|
|
168
|
+
|
|
169
|
+
**EXAMPLE - Bug with multiple related files:**
|
|
170
|
+
\`\`\`json
|
|
171
|
+
{
|
|
172
|
+
"question": "🎯 WHAT I NEED: Fix the race condition in our order processing...",
|
|
173
|
+
"file_attachments": [
|
|
174
|
+
{
|
|
175
|
+
"path": "/Users/dev/ecommerce/src/services/order-processor.ts",
|
|
176
|
+
"description": "Main order processing service. The race condition occurs in processOrder() when two requests hit simultaneously. Lines 45-120 contain the critical section."
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"path": "/Users/dev/ecommerce/src/repositories/inventory-repo.ts",
|
|
180
|
+
"start_line": 30,
|
|
181
|
+
"end_line": 80,
|
|
182
|
+
"description": "Inventory repository - the decrementStock() method (lines 30-80) is called by order-processor and we suspect it's not properly locked."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"path": "/Users/dev/ecommerce/src/utils/db-transaction.ts",
|
|
186
|
+
"description": "Our transaction wrapper utility. Need to verify if it properly handles concurrent transactions."
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
\`\`\`
|
|
191
|
+
|
|
192
|
+
**Attach as many files as needed for complete context - there is no limit!**`),
|
|
193
|
+
});
|
|
194
|
+
// Shape object for external consumers who need individual field schemas
|
|
195
|
+
const deepResearchParamsShape = {
|
|
196
|
+
questions: z
|
|
197
|
+
.array(researchQuestionSchema, {
|
|
198
|
+
required_error: 'deep_research: Questions array is required',
|
|
199
|
+
invalid_type_error: 'deep_research: Questions must be an array'
|
|
200
|
+
})
|
|
201
|
+
.min(1, { message: 'deep_research: At least 1 question is required (recommend 2-7 for optimal depth)' })
|
|
202
|
+
.max(10, { message: 'deep_research: Maximum 10 questions allowed per batch' })
|
|
203
|
+
.describe(`**Batch deep research (2-10 questions) with dynamic token allocation.**
|
|
204
|
+
|
|
205
|
+
**TOKEN BUDGET:** 32,000 tokens distributed across all questions:
|
|
206
|
+
- 2 questions: 16,000 tokens/question (deep dive)
|
|
207
|
+
- 5 questions: 6,400 tokens/question (balanced)
|
|
208
|
+
- 10 questions: 3,200 tokens/question (rapid multi-topic)
|
|
209
|
+
|
|
210
|
+
**WHEN TO USE:**
|
|
211
|
+
- Need multi-perspective analysis on related topics
|
|
212
|
+
- Researching a domain from multiple angles
|
|
213
|
+
- Validating understanding across different aspects
|
|
214
|
+
- Comparing approaches/technologies side-by-side
|
|
215
|
+
|
|
216
|
+
**EACH QUESTION SHOULD INCLUDE:**
|
|
217
|
+
- Topic & context (what decision it informs)
|
|
218
|
+
- Your current understanding (to fill gaps)
|
|
219
|
+
- Specific sub-questions (2-5 per topic)
|
|
220
|
+
|
|
221
|
+
**USE:** Maximize question count for comprehensive coverage. All questions run in parallel. Group related questions for coherent research.`),
|
|
222
|
+
};
|
|
223
|
+
export const deepResearchParamsSchema = z.object(deepResearchParamsShape);
|
|
224
|
+
//# sourceMappingURL=deep-research.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deep-research.js","sourceRoot":"","sources":["../../src/schemas/deep-research.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4EAA4E;AAC5E,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC;SACJ,MAAM,CAAC,EAAE,cAAc,EAAE,sCAAsC,EAAE,CAAC;SAClE,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;SAC/D,QAAQ,CACP;;;;;;;;;;;mFAW6E,CAC9E;IACH,UAAU,EAAE,CAAC;SACV,MAAM,CAAC,EAAE,kBAAkB,EAAE,4CAA4C,EAAE,CAAC;SAC5E,GAAG,CAAC,EAAE,OAAO,EAAE,8CAA8C,EAAE,CAAC;SAChE,QAAQ,CAAC,EAAE,OAAO,EAAE,kEAAkE,EAAE,CAAC;SACzF,QAAQ,EAAE;SACV,QAAQ,CACP;;;kEAG4D,CAC7D;IACH,QAAQ,EAAE,CAAC;SACR,MAAM,CAAC,EAAE,kBAAkB,EAAE,0CAA0C,EAAE,CAAC;SAC1E,GAAG,CAAC,EAAE,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uB,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const scrapeLinksParamsSchema: z.ZodObject<{
|
|
3
|
+
urls: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
4
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
use_llm: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
what_to_extract: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
urls: string[];
|
|
9
|
+
timeout: number;
|
|
10
|
+
use_llm: boolean;
|
|
11
|
+
what_to_extract?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
urls: string[];
|
|
14
|
+
timeout?: number | undefined;
|
|
15
|
+
use_llm?: boolean | undefined;
|
|
16
|
+
what_to_extract?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export type ScrapeLinksParams = z.infer<typeof scrapeLinksParamsSchema>;
|
|
19
|
+
export interface ScrapeLinksOutput {
|
|
20
|
+
content: string;
|
|
21
|
+
metadata: {
|
|
22
|
+
total_urls: number;
|
|
23
|
+
successful: number;
|
|
24
|
+
failed: number;
|
|
25
|
+
total_credits: number;
|
|
26
|
+
execution_time_ms: number;
|
|
27
|
+
tokens_per_url?: number;
|
|
28
|
+
total_token_budget?: number;
|
|
29
|
+
batches_processed?: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=scrape-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrape-links.d.ts","sourceRoot":"","sources":["../../src/schemas/scrape-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsCxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAAmC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAGxE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// URL schema with protocol validation
|
|
3
|
+
const urlSchema = z
|
|
4
|
+
.string({ required_error: 'scrape_links: URL is required' })
|
|
5
|
+
.url({ message: 'scrape_links: Invalid URL format' })
|
|
6
|
+
.refine(url => url.startsWith('http://') || url.startsWith('https://'), { message: 'scrape_links: URL must use http:// or https:// protocol' });
|
|
7
|
+
// Input schema for scrape_links tool
|
|
8
|
+
const scrapeLinksParamsShape = {
|
|
9
|
+
urls: z
|
|
10
|
+
.array(urlSchema, {
|
|
11
|
+
required_error: 'scrape_links: URLs array is required',
|
|
12
|
+
invalid_type_error: 'scrape_links: URLs must be an array'
|
|
13
|
+
})
|
|
14
|
+
.min(1, { message: 'scrape_links: At least 1 URL is required' })
|
|
15
|
+
.max(50, { message: 'scrape_links: Maximum 50 URLs allowed per request' })
|
|
16
|
+
.describe('URLs to scrape (1-50). Recommend 3-5 URLs for balanced depth/breadth. More URLs = broader coverage but fewer tokens per URL. 3 URLs: ~10K tokens each (deep); 10 URLs: ~3K tokens each (balanced); 50 URLs: ~640 tokens each (scan).'),
|
|
17
|
+
timeout: z
|
|
18
|
+
.number({ invalid_type_error: 'scrape_links: Timeout must be a number' })
|
|
19
|
+
.min(5, { message: 'scrape_links: Timeout must be at least 5 seconds' })
|
|
20
|
+
.max(120, { message: 'scrape_links: Timeout cannot exceed 120 seconds' })
|
|
21
|
+
.default(30)
|
|
22
|
+
.describe('Timeout in seconds for each URL'),
|
|
23
|
+
use_llm: z
|
|
24
|
+
.boolean({ invalid_type_error: 'scrape_links: use_llm must be a boolean' })
|
|
25
|
+
.default(false)
|
|
26
|
+
.describe('Enable AI processing for content extraction (requires OPENROUTER_API_KEY)'),
|
|
27
|
+
what_to_extract: z
|
|
28
|
+
.string()
|
|
29
|
+
.max(1000, { message: 'scrape_links: Extraction instructions too long (max 1000 characters)' })
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Specific content extraction instructions for AI. Will be enhanced with conciseness suffix automatically.'),
|
|
32
|
+
};
|
|
33
|
+
export const scrapeLinksParamsSchema = z.object(scrapeLinksParamsShape);
|
|
34
|
+
//# sourceMappingURL=scrape-links.js.map
|