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
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML Configuration Loader
|
|
3
|
+
* Loads tools.yaml and generates MCP-compatible tool definitions
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync } from 'fs';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import { dirname, join } from 'path';
|
|
8
|
+
import { parse as parseYaml } from 'yaml';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
11
|
+
// Get directory of this file for relative YAML path
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = dirname(__filename);
|
|
14
|
+
// Cached YAML config - loaded once, reused for all subsequent calls
|
|
15
|
+
let cachedYamlConfig = null;
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// YAML to Zod Schema Conversion
|
|
18
|
+
// ============================================================================
|
|
19
|
+
/**
|
|
20
|
+
* Convert YAML validation rules to Zod string schema
|
|
21
|
+
*/
|
|
22
|
+
function applyStringValidation(schema, validation) {
|
|
23
|
+
if (!validation)
|
|
24
|
+
return schema;
|
|
25
|
+
let result = schema;
|
|
26
|
+
if (validation.minLength !== undefined)
|
|
27
|
+
result = result.min(validation.minLength);
|
|
28
|
+
if (validation.maxLength !== undefined)
|
|
29
|
+
result = result.max(validation.maxLength);
|
|
30
|
+
if (validation.pattern)
|
|
31
|
+
result = result.regex(new RegExp(validation.pattern));
|
|
32
|
+
if (validation.format === 'uri')
|
|
33
|
+
result = result.url();
|
|
34
|
+
if (validation.format === 'email')
|
|
35
|
+
result = result.email();
|
|
36
|
+
if (validation.format === 'uuid')
|
|
37
|
+
result = result.uuid();
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Convert YAML validation rules to Zod number schema
|
|
42
|
+
*/
|
|
43
|
+
function applyNumberValidation(schema, validation) {
|
|
44
|
+
if (!validation)
|
|
45
|
+
return schema;
|
|
46
|
+
let result = schema;
|
|
47
|
+
if (validation.min !== undefined)
|
|
48
|
+
result = result.min(validation.min);
|
|
49
|
+
if (validation.max !== undefined)
|
|
50
|
+
result = result.max(validation.max);
|
|
51
|
+
if (validation.int)
|
|
52
|
+
result = result.int();
|
|
53
|
+
if (validation.positive)
|
|
54
|
+
result = result.positive();
|
|
55
|
+
if (validation.negative)
|
|
56
|
+
result = result.negative();
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Convert YAML validation rules to Zod array schema
|
|
61
|
+
*/
|
|
62
|
+
function applyArrayValidation(schema, validation) {
|
|
63
|
+
if (!validation)
|
|
64
|
+
return schema;
|
|
65
|
+
let result = schema;
|
|
66
|
+
if (validation.minItems !== undefined)
|
|
67
|
+
result = result.min(validation.minItems);
|
|
68
|
+
if (validation.maxItems !== undefined)
|
|
69
|
+
result = result.max(validation.maxItems);
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Recursively convert YAML parameter to Zod schema
|
|
74
|
+
*/
|
|
75
|
+
function yamlParamToZod(param) {
|
|
76
|
+
let schema;
|
|
77
|
+
switch (param.type) {
|
|
78
|
+
case 'string': {
|
|
79
|
+
let strSchema = z.string();
|
|
80
|
+
strSchema = applyStringValidation(strSchema, param.validation);
|
|
81
|
+
if (param.description)
|
|
82
|
+
strSchema = strSchema.describe(param.description);
|
|
83
|
+
schema = strSchema;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case 'number': {
|
|
87
|
+
let numSchema = z.number();
|
|
88
|
+
numSchema = applyNumberValidation(numSchema, param.validation);
|
|
89
|
+
if (param.description)
|
|
90
|
+
numSchema = numSchema.describe(param.description);
|
|
91
|
+
schema = numSchema;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case 'boolean': {
|
|
95
|
+
let boolSchema = z.boolean();
|
|
96
|
+
if (param.description)
|
|
97
|
+
boolSchema = boolSchema.describe(param.description);
|
|
98
|
+
schema = boolSchema;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case 'array': {
|
|
102
|
+
if (!param.items) {
|
|
103
|
+
throw new Error('Array parameter must have items definition');
|
|
104
|
+
}
|
|
105
|
+
const itemSchema = yamlParamToZod(param.items);
|
|
106
|
+
let arrSchema = z.array(itemSchema);
|
|
107
|
+
arrSchema = applyArrayValidation(arrSchema, param.validation);
|
|
108
|
+
if (param.description)
|
|
109
|
+
arrSchema = arrSchema.describe(param.description);
|
|
110
|
+
schema = arrSchema;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
case 'object': {
|
|
114
|
+
if (!param.properties) {
|
|
115
|
+
throw new Error('Object parameter must have properties definition');
|
|
116
|
+
}
|
|
117
|
+
const shape = {};
|
|
118
|
+
for (const [key, propDef] of Object.entries(param.properties)) {
|
|
119
|
+
let propSchema = yamlParamToZod(propDef);
|
|
120
|
+
if (propDef.required === false) {
|
|
121
|
+
propSchema = propSchema.optional();
|
|
122
|
+
}
|
|
123
|
+
shape[key] = propSchema;
|
|
124
|
+
}
|
|
125
|
+
let objSchema = z.object(shape);
|
|
126
|
+
if (param.description)
|
|
127
|
+
objSchema = objSchema.describe(param.description);
|
|
128
|
+
schema = objSchema;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
default:
|
|
132
|
+
throw new Error(`Unknown parameter type: ${param.type}`);
|
|
133
|
+
}
|
|
134
|
+
// Apply optional/default
|
|
135
|
+
if (param.required === false && param.default !== undefined) {
|
|
136
|
+
schema = schema.default(param.default);
|
|
137
|
+
}
|
|
138
|
+
else if (param.required === false) {
|
|
139
|
+
schema = schema.optional();
|
|
140
|
+
}
|
|
141
|
+
return schema;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Convert YAML parameters to Zod object schema
|
|
145
|
+
*/
|
|
146
|
+
function yamlParamsToZodSchema(params) {
|
|
147
|
+
const shape = {};
|
|
148
|
+
for (const [key, param] of Object.entries(params)) {
|
|
149
|
+
let schema = yamlParamToZod(param);
|
|
150
|
+
// Note: required is handled in yamlParamToZod via optional()
|
|
151
|
+
shape[key] = schema;
|
|
152
|
+
}
|
|
153
|
+
return z.object(shape);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Convert Zod schema to JSON Schema for MCP inputSchema
|
|
157
|
+
*/
|
|
158
|
+
function zodToMcpInputSchema(schema) {
|
|
159
|
+
const jsonSchema = zodToJsonSchema(schema, { $refStrategy: 'none' });
|
|
160
|
+
// Extract properties and required from JSON Schema
|
|
161
|
+
if (typeof jsonSchema === 'object' && jsonSchema !== null) {
|
|
162
|
+
const obj = jsonSchema;
|
|
163
|
+
return {
|
|
164
|
+
type: 'object',
|
|
165
|
+
properties: obj.properties || {},
|
|
166
|
+
required: obj.required,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
return { type: 'object', properties: {} };
|
|
170
|
+
}
|
|
171
|
+
// ============================================================================
|
|
172
|
+
// Tool Loading
|
|
173
|
+
// ============================================================================
|
|
174
|
+
/**
|
|
175
|
+
* Load and parse tools.yaml
|
|
176
|
+
*/
|
|
177
|
+
export function loadYamlConfig() {
|
|
178
|
+
if (cachedYamlConfig)
|
|
179
|
+
return cachedYamlConfig;
|
|
180
|
+
const yamlPath = join(__dirname, 'yaml', 'tools.yaml');
|
|
181
|
+
const yamlContent = readFileSync(yamlPath, 'utf8');
|
|
182
|
+
cachedYamlConfig = parseYaml(yamlContent);
|
|
183
|
+
return cachedYamlConfig;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Convert a single YAML tool config to MCP Tool
|
|
187
|
+
* For tools with inline parameters only
|
|
188
|
+
*/
|
|
189
|
+
function yamlToolToMcpTool(toolConfig) {
|
|
190
|
+
if (!toolConfig.parameters) {
|
|
191
|
+
throw new Error(`Tool ${toolConfig.name} must have parameters or useZodSchema`);
|
|
192
|
+
}
|
|
193
|
+
const zodSchema = yamlParamsToZodSchema(toolConfig.parameters);
|
|
194
|
+
const inputSchema = zodToMcpInputSchema(zodSchema);
|
|
195
|
+
return {
|
|
196
|
+
name: toolConfig.name,
|
|
197
|
+
description: toolConfig.description.trim(),
|
|
198
|
+
inputSchema,
|
|
199
|
+
category: toolConfig.category,
|
|
200
|
+
capability: toolConfig.capability,
|
|
201
|
+
useZodSchema: false,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Create placeholder for tools using existing Zod schemas
|
|
206
|
+
* These will be enriched with actual schemas at runtime
|
|
207
|
+
*/
|
|
208
|
+
function createZodSchemaPlaceholder(toolConfig) {
|
|
209
|
+
return {
|
|
210
|
+
name: toolConfig.name,
|
|
211
|
+
description: toolConfig.description.trim(),
|
|
212
|
+
inputSchema: { type: 'object', properties: {} }, // Placeholder
|
|
213
|
+
category: toolConfig.category,
|
|
214
|
+
capability: toolConfig.capability,
|
|
215
|
+
useZodSchema: true,
|
|
216
|
+
zodSchemaRef: toolConfig.zodSchemaRef,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Load all tools from YAML configuration
|
|
221
|
+
*/
|
|
222
|
+
export function loadToolsFromYaml() {
|
|
223
|
+
const config = loadYamlConfig();
|
|
224
|
+
return config.tools.map((toolConfig) => {
|
|
225
|
+
if (toolConfig.useZodSchema) {
|
|
226
|
+
// Tool uses existing Zod schema - return placeholder
|
|
227
|
+
return createZodSchemaPlaceholder(toolConfig);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
// Tool has inline parameters - generate schema from YAML
|
|
231
|
+
return yamlToolToMcpTool(toolConfig);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get tool configuration by name
|
|
237
|
+
*/
|
|
238
|
+
export function getToolConfig(name) {
|
|
239
|
+
const config = loadYamlConfig();
|
|
240
|
+
return config.tools.find((t) => t.name === name);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get schema descriptions for a tool (for injecting into existing Zod schemas)
|
|
244
|
+
*/
|
|
245
|
+
export function getSchemaDescriptions(name) {
|
|
246
|
+
const tool = getToolConfig(name);
|
|
247
|
+
return tool?.schemaDescriptions;
|
|
248
|
+
}
|
|
249
|
+
// ============================================================================
|
|
250
|
+
// Zod Schema Registry (for tools using existing schemas)
|
|
251
|
+
// ============================================================================
|
|
252
|
+
import { deepResearchParamsSchema } from '../schemas/deep-research.js';
|
|
253
|
+
import { scrapeLinksParamsSchema } from '../schemas/scrape-links.js';
|
|
254
|
+
import { webSearchParamsSchema } from '../schemas/web-search.js';
|
|
255
|
+
/**
|
|
256
|
+
* Registry of existing Zod schemas for complex tools
|
|
257
|
+
*/
|
|
258
|
+
const zodSchemaRegistry = {
|
|
259
|
+
deepResearchParamsSchema,
|
|
260
|
+
scrapeLinksParamsSchema,
|
|
261
|
+
webSearchParamsSchema,
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Get Zod schema by reference name
|
|
265
|
+
*/
|
|
266
|
+
export function getZodSchemaByRef(ref) {
|
|
267
|
+
return zodSchemaRegistry[ref];
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Generate complete MCP tools list with all schemas resolved
|
|
271
|
+
*/
|
|
272
|
+
export function generateMcpTools() {
|
|
273
|
+
const loadedTools = loadToolsFromYaml();
|
|
274
|
+
return loadedTools.map((tool) => {
|
|
275
|
+
if (tool.useZodSchema && tool.zodSchemaRef) {
|
|
276
|
+
// Resolve the actual Zod schema
|
|
277
|
+
const schema = getZodSchemaByRef(tool.zodSchemaRef);
|
|
278
|
+
if (!schema) {
|
|
279
|
+
console.error(`[Loader] Schema not found: ${tool.zodSchemaRef}`);
|
|
280
|
+
return {
|
|
281
|
+
name: tool.name,
|
|
282
|
+
description: tool.description,
|
|
283
|
+
inputSchema: { type: 'object', properties: {} },
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
const inputSchema = zodToMcpInputSchema(schema);
|
|
287
|
+
return {
|
|
288
|
+
name: tool.name,
|
|
289
|
+
description: tool.description,
|
|
290
|
+
inputSchema,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
// Tool already has generated inputSchema
|
|
294
|
+
return {
|
|
295
|
+
name: tool.name,
|
|
296
|
+
description: tool.description,
|
|
297
|
+
inputSchema: tool.inputSchema,
|
|
298
|
+
};
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
// ============================================================================
|
|
302
|
+
// Exports
|
|
303
|
+
// ============================================================================
|
|
304
|
+
export { yamlParamsToZodSchema, yamlParamToZod };
|
|
305
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config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CAAC;IAExC,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9B,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAC3C,gCAAgC;YAChC,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACpD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,CAAC,KAAK,CAAC,8BAA8B,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;gBACjE,OAAO;oBACL,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,WAAW,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE,UAAU,EAAE,EAAE,EAAE;iBACzD,CAAC;YACJ,CAAC;YAED,MAAM,WAAW,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAChD,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,WAAW;aACZ,CAAC;QACJ,CAAC;QAED,yCAAyC;QACzC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript interfaces for YAML tool configuration
|
|
3
|
+
* Matches structure defined in yaml/tools.yaml
|
|
4
|
+
*/
|
|
5
|
+
import type { Capabilities } from './index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Validation rules for parameters
|
|
8
|
+
*/
|
|
9
|
+
export interface YamlValidation {
|
|
10
|
+
minLength?: number;
|
|
11
|
+
maxLength?: number;
|
|
12
|
+
pattern?: string;
|
|
13
|
+
format?: 'uri' | 'email' | 'uuid';
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
int?: boolean;
|
|
17
|
+
positive?: boolean;
|
|
18
|
+
negative?: boolean;
|
|
19
|
+
minItems?: number;
|
|
20
|
+
maxItems?: number;
|
|
21
|
+
nonempty?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parameter definition in YAML
|
|
25
|
+
*/
|
|
26
|
+
export interface YamlParameter {
|
|
27
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
28
|
+
required?: boolean;
|
|
29
|
+
default?: unknown;
|
|
30
|
+
description?: string;
|
|
31
|
+
validation?: YamlValidation;
|
|
32
|
+
items?: YamlParameter;
|
|
33
|
+
properties?: Record<string, YamlParameter>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Tool definition in YAML
|
|
37
|
+
*/
|
|
38
|
+
export interface YamlToolConfig {
|
|
39
|
+
name: string;
|
|
40
|
+
category?: string;
|
|
41
|
+
capability?: keyof Capabilities;
|
|
42
|
+
description: string;
|
|
43
|
+
parameters?: Record<string, YamlParameter>;
|
|
44
|
+
useZodSchema?: boolean;
|
|
45
|
+
zodSchemaRef?: string;
|
|
46
|
+
schemaDescriptions?: Record<string, string>;
|
|
47
|
+
limits?: Record<string, string | number | boolean>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Root YAML configuration structure
|
|
51
|
+
*/
|
|
52
|
+
export interface YamlConfig {
|
|
53
|
+
version: string;
|
|
54
|
+
metadata: {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
tools: YamlToolConfig[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* MCP Tool definition (matches SDK)
|
|
62
|
+
*/
|
|
63
|
+
export interface McpTool {
|
|
64
|
+
name: string;
|
|
65
|
+
description: string;
|
|
66
|
+
inputSchema: {
|
|
67
|
+
type: 'object';
|
|
68
|
+
properties: Record<string, unknown>;
|
|
69
|
+
required?: string[];
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Loaded tool with additional metadata
|
|
74
|
+
*/
|
|
75
|
+
export interface LoadedTool extends McpTool {
|
|
76
|
+
category?: string;
|
|
77
|
+
capability?: keyof Capabilities;
|
|
78
|
+
useZodSchema?: boolean;
|
|
79
|
+
zodSchemaRef?: string;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAE7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;IAGlC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EA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AU,CAAC,EAAE,MAAM,YAAY,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Research Powerpack MCP - Tool Configuration
|
|
2
|
+
# Optimized for LLM consumption - <1K tokens total
|
|
3
|
+
version: "1.0"
|
|
4
|
+
|
|
5
|
+
metadata:
|
|
6
|
+
name: "research-powerpack-mcp"
|
|
7
|
+
description: "Parallel research tools with AI extraction"
|
|
8
|
+
|
|
9
|
+
# CORE PRINCIPLES (ALL TOOLS)
|
|
10
|
+
shared:
|
|
11
|
+
philosophy: "MAXIMIZE inputs for parallel processing - NO time penalty for more items! More diverse inputs = better coverage = higher quality. Each input MUST target DIFFERENT angle - NO overlap/duplicates. ALWAYS use sequentialthinking between tool calls."
|
|
12
|
+
|
|
13
|
+
workflow: |
|
|
14
|
+
MANDATORY: THINK first (plan strategy) → EXECUTE with MAX diversity (use recommended counts) → THINK after (evaluate: what's missing? new angles discovered? gaps in coverage?) → ITERATE if needed (refine based on findings) → SYNTHESIZE final output.
|
|
15
|
+
KEY INSIGHT: First research pass usually incomplete - reveals what you SHOULD have asked! Results are feedback - use them to ask better questions next iteration.
|
|
16
|
+
|
|
17
|
+
iteration_triggers: "Iterate when: Results mention concepts you didn't research | Answers raise NEW questions | Initial scope too narrow | Related topics discovered you should explore"
|
|
18
|
+
|
|
19
|
+
tools:
|
|
20
|
+
- name: search_reddit
|
|
21
|
+
category: reddit
|
|
22
|
+
capability: search
|
|
23
|
+
limits: {min_queries: 10, max_queries: 50, recommended: 20}
|
|
24
|
+
|
|
25
|
+
description: |
|
|
26
|
+
MIN 10 queries, REC 20+ (10q=100 results, 20q=200 results). Each query MUST target DIFFERENT angle - NO overlap! 10 categories: 1) direct topic 2) recommendations (best/top) 3) specific tools/repos/names 4) comparisons (vs) 5) alternatives 6) subreddit targeting (r/macapps, r/opensource) 7) problems/issues/crashes 8) year-specific (2024/2025) 9) features 10) dev/GitHub/electron. Operators: intitle:, "exact", OR, -exclude. Using 1-3 queries wastes parallel power. Auto adds site:reddit.com.
|
|
27
|
+
|
|
28
|
+
parameters:
|
|
29
|
+
queries:
|
|
30
|
+
type: array
|
|
31
|
+
required: true
|
|
32
|
+
items: {type: string}
|
|
33
|
+
validation: {minItems: 10, maxItems: 50}
|
|
34
|
+
description: "10-50 diverse queries. Each targets different angle: direct|best|tools|vs|alternative|r/sub|issues|2024|features|GitHub. NO overlap."
|
|
35
|
+
date_after:
|
|
36
|
+
type: string
|
|
37
|
+
required: false
|
|
38
|
+
description: "Filter after date (YYYY-MM-DD)"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
- name: get_reddit_post
|
|
42
|
+
category: reddit
|
|
43
|
+
capability: reddit
|
|
44
|
+
limits: {min_urls: 2, max_urls: 50, recommended: 20, default_max_comments: 1000}
|
|
45
|
+
extraction_suffix: "Extract key insights: consensus, recommendations with reasoning, contrasting views, real experiences, technical details. Be comprehensive + concise, prioritize actionable info."
|
|
46
|
+
|
|
47
|
+
description: |
|
|
48
|
+
MIN 2 URLs, REC 10-20+. Auto comment budget: 1000 total (2 posts=500 each deep, 10=100 balanced, 20=50 broad coverage). Comments have BEST insights - always fetch_comments=true unless only need titles. use_llm=true for AI extraction (pennies, needs OPENROUTER_API_KEY) - synthesizes consensus, filters noise. Mix subreddits for diverse perspectives. Using 2-5 posts = narrow, missing consensus. 20-30 posts = comprehensive.
|
|
49
|
+
|
|
50
|
+
parameters:
|
|
51
|
+
urls:
|
|
52
|
+
type: array
|
|
53
|
+
required: true
|
|
54
|
+
items: {type: string}
|
|
55
|
+
validation: {minItems: 2, maxItems: 50}
|
|
56
|
+
description: "2-50 Reddit URLs. More = broader consensus. Get from search_reddit."
|
|
57
|
+
fetch_comments:
|
|
58
|
+
type: boolean
|
|
59
|
+
required: false
|
|
60
|
+
default: true
|
|
61
|
+
description: "Fetch comments (true recommended - best insights in comments)"
|
|
62
|
+
max_comments:
|
|
63
|
+
type: number
|
|
64
|
+
required: false
|
|
65
|
+
default: 100
|
|
66
|
+
description: "Override auto allocation. Leave empty for smart allocation."
|
|
67
|
+
use_llm:
|
|
68
|
+
type: boolean
|
|
69
|
+
required: false
|
|
70
|
+
default: false
|
|
71
|
+
description: "AI extraction (recommended). Extracts insights, consensus, filters noise. Needs OPENROUTER_API_KEY."
|
|
72
|
+
what_to_extract:
|
|
73
|
+
type: string
|
|
74
|
+
required: false
|
|
75
|
+
description: "Extraction instructions for AI. Be specific: 'Extract recommendations for X with pros/cons'. More specific = better quality."
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
- name: deep_research
|
|
79
|
+
category: research
|
|
80
|
+
capability: deepResearch
|
|
81
|
+
useZodSchema: true
|
|
82
|
+
zodSchemaRef: "deepResearchParamsSchema"
|
|
83
|
+
limits: {min_questions: 1, max_questions: 10, recommended: 5, min_length: 200, min_specific: 2}
|
|
84
|
+
|
|
85
|
+
description: |
|
|
86
|
+
MIN 2, REC 5-10 questions parallel. 32K tokens distributed (2q=16K/each deep, 5q=6.4K balanced, 10q=3.2K comprehensive). MANDATORY template per question:
|
|
87
|
+
"🎯 WHAT I NEED: [clear goal]
|
|
88
|
+
🤔 WHY: [decision/problem]
|
|
89
|
+
📚 WHAT I KNOW: [current understanding - so research fills gaps not basics]
|
|
90
|
+
🔧 HOW I'LL USE: [implementation/debugging/architecture]
|
|
91
|
+
❓ SPECIFIC QUESTIONS: 1) [q1] 2) [q2] 3) [q3]
|
|
92
|
+
🌐 PRIORITY SOURCES: [optional - docs/sites]
|
|
93
|
+
⚡ FOCUS: [optional - performance/security]"
|
|
94
|
+
ATTACH FILES for code Qs (bugs/perf/refactor/review/architecture) - MANDATORY or research is generic/unhelpful. Using 1-2 Qs wastes parallel capacity. First pass incomplete - iterate based on findings.
|
|
95
|
+
|
|
96
|
+
schemaDescriptions:
|
|
97
|
+
questions: "2-10 structured questions following template above. Each MUST cover different angle of topic. Attach files for ANY code-related Q (bugs/errors/perf/refactoring/review/architecture) - without code context, research is generic/useless."
|
|
98
|
+
file_attachments: "MANDATORY for code Qs: bugs→failing code, perf→slow code, refactor→current implementation, review→code to review, architecture→relevant modules. Format: {path: '/absolute/path', description: 'What file is, why relevant, focus areas, known issues', start_line?, end_line?}. Thorough description critical."
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
- name: scrape_links
|
|
102
|
+
category: scrape
|
|
103
|
+
capability: scraping
|
|
104
|
+
useZodSchema: true
|
|
105
|
+
zodSchemaRef: "scrapeLinksParamsSchema"
|
|
106
|
+
limits: {min_urls: 1, max_urls: 50, recommended: 5, min_extract_len: 50, min_targets: 3}
|
|
107
|
+
extraction_suffix: "MUST: Comprehensive extraction, high info density, no verbosity, satisfy scope, NEVER hallucinate, only extract grounded info from document. No confirmation messages."
|
|
108
|
+
|
|
109
|
+
description: |
|
|
110
|
+
REC 3-5 URLs. ALWAYS use_llm=true - AI extraction is this tool's superpower! use_llm=false gives raw HTML (messy, hours manual parsing). use_llm=true: auto-filters nav/ads/footers, extracts ONLY what you specify, handles complex structures, returns clean ready-to-use content, costs pennies (~$0.01/10 pages) vs hours work. 32K tokens (3=10K each, 5=6K, 10=3K, 50=640). Formula: "Extract [t1] | [t2] | [t3] | [t4] | [t5] with focus on [a1], [a2], [a3]". Min 3 targets with | separator, be specific (pricing tiers not pricing), aim 5-10 targets. Templates: Product (pricing|features|reviews|specs|integrations|support), Tech Docs (endpoints|auth|limits|errors|examples|schemas), Competitive (features|pricing|customers|USPs|stack|testimonials).
|
|
111
|
+
|
|
112
|
+
schemaDescriptions:
|
|
113
|
+
urls: "1-50 URLs (3-5 recommended). More URLs = broader coverage, fewer tokens/URL."
|
|
114
|
+
timeout: "Timeout per URL (5-120s, default 30)"
|
|
115
|
+
use_llm: "ALWAYS SET TRUE (default false but override it). AI extraction is tool's superpower - auto-filters nav/ads/footers, extracts ONLY your specified targets, returns clean structured content ready to use. Raw HTML (use_llm=false) is messy noise requiring hours parsing. Cost: ~$0.001/page (pennies). Needs OPENROUTER_API_KEY."
|
|
116
|
+
what_to_extract: "REQUIRED when use_llm=true. Formula: 'Extract [target1] | [target2] | [target3] | [target4] | [target5] with focus on [aspect1], [aspect2], [aspect3]'. Min 50 chars, min 3 targets with | separator. Be super specific (pricing tiers not pricing, API rate limits not API info). Aim 5-10 targets. Act like detailed LLM instruction. More specific targets = higher extraction quality. Include 'with focus on' to prioritize aspects."
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
- name: web_search
|
|
120
|
+
category: search
|
|
121
|
+
capability: search
|
|
122
|
+
useZodSchema: true
|
|
123
|
+
zodSchemaRef: "webSearchParamsSchema"
|
|
124
|
+
limits: {min_keywords: 3, max_keywords: 100, recommended: 7}
|
|
125
|
+
|
|
126
|
+
description: |
|
|
127
|
+
MIN 3, REC 5-7 keywords parallel Google search. 10 results/keyword (3=30 results, 7=70, 100=1000). Each keyword = separate search - MUST be diverse angles! 7 perspectives: 1) broad [topic] 2) specific/technical [topic]+[term] 3) problems [topic] issues/debugging 4) best practices [topic] 2024/2025 5) comparison [A] vs [B] OR 6) tutorial/guide 7) advanced patterns/architecture. Operators: site:domain.com (target GitHub/StackOverflow/docs), "exact phrase", -exclude, filetype:pdf, OR. Examples: "PostgreSQL" site:github.com stars:>1000, "Docker OOM" site:stackoverflow.com. CRITICAL: Search only gives URLs - MUST follow with scrape_links to get actual content! Workflow: search → think → scrape_links (MANDATORY) → think → iterate → synthesize. Using 1-2 keywords wastes parallel power.
|
|
128
|
+
|
|
129
|
+
schemaDescriptions:
|
|
130
|
+
keywords: "3-100 diverse keywords (5-7 rec). Each separate Google search parallel. 7 angles: broad | technical | problems | best practices+year | vs/OR | tutorial | patterns. Operators: site:, \"exact\", -exclude, filetype:, OR."
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
|