@opencraw/mcp 0.1.43 → 0.1.45
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/dist/index.esm.js +19 -5
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
-
import { readRecordsFile, diffRecords, memorySink,
|
|
3
|
+
import { readRecordsFile, diffRecords, memorySink, fileSink, createCrawler, RecipeSet, RecipeValidationError, RecipeBindingError, parseOutputRecipe, parseInputRecipe, bindRecipeSet } from '@opencraw/core';
|
|
4
4
|
import { diffReport, readRecipeFiles, probeUrl, loadForRun, loadPlugins, resolveAccess } from '@opencraw/cli';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
@@ -173,7 +173,7 @@ const RECORD_CAP = 50;
|
|
|
173
173
|
/** Input schema for the `run` tool. */
|
|
174
174
|
const runInputShape = {
|
|
175
175
|
...recipeSourceShape,
|
|
176
|
-
out: z.string().optional().describe('Write records to this
|
|
176
|
+
out: z.string().optional().describe('Write records to this file instead of returning them inline; its extension is the format: .jsonl, .json, .csv, .xlsx, .yml/.yaml, .html or .pdf (any other extension is an error). Use for a crawl expected to produce more than a handful of records.'),
|
|
177
177
|
append: z.boolean().optional().describe('Keep what "out" holds and add to it; each line carries _key. Needs "out".'),
|
|
178
178
|
resume: z.boolean().optional().describe('Skip records "out" already has. Needs "append".'),
|
|
179
179
|
only: z.array(z.string()).optional().describe('Run only these input recipe ids.'),
|
|
@@ -216,9 +216,23 @@ async function runTool(args) {
|
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
218
|
let crawler;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
let sink;
|
|
220
|
+
try {
|
|
221
|
+
sink = args.dryRun === true || args.out === undefined ? memorySink() : fileSink(args.out, {
|
|
222
|
+
append: args.append,
|
|
223
|
+
browser: {
|
|
224
|
+
executablePath: args.browserPath ?? process.env.OPENCRAW_CHROMIUM
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
} catch (error) {
|
|
228
|
+
return {
|
|
229
|
+
content: [{
|
|
230
|
+
type: 'text',
|
|
231
|
+
text: error instanceof Error ? error.message : String(error)
|
|
232
|
+
}],
|
|
233
|
+
isError: true
|
|
234
|
+
};
|
|
235
|
+
}
|
|
222
236
|
try {
|
|
223
237
|
const pluginsFile = serverFile('OPENCRAW_PLUGINS') ?? serverFile('OPENCRAW_HOOKS');
|
|
224
238
|
const plugins = pluginsFile === undefined ? undefined : await loadPlugins(pluginsFile);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencraw/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"!**/*.js.map"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@opencraw/core": "^0.1.
|
|
28
|
-
"@opencraw/cli": "^0.1.
|
|
27
|
+
"@opencraw/core": "^0.1.41",
|
|
28
|
+
"@opencraw/cli": "^0.1.45",
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
30
30
|
"playwright": "^1.63.0",
|
|
31
31
|
"zod": "^4.6.5"
|