alterlab-mcp-server 1.8.0 → 1.10.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 (68) hide show
  1. package/README.md +68 -26
  2. package/dist/client.d.ts +2 -1
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +7 -4
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.js +2 -2
  7. package/dist/errors.js.map +1 -1
  8. package/dist/format.d.ts +5 -1
  9. package/dist/format.d.ts.map +1 -1
  10. package/dist/format.js +48 -0
  11. package/dist/format.js.map +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/tools/batch.d.ts +1213 -17
  16. package/dist/tools/batch.d.ts.map +1 -1
  17. package/dist/tools/batch.js +121 -33
  18. package/dist/tools/batch.js.map +1 -1
  19. package/dist/tools/common.d.ts +313 -0
  20. package/dist/tools/common.d.ts.map +1 -0
  21. package/dist/tools/common.js +336 -0
  22. package/dist/tools/common.js.map +1 -0
  23. package/dist/tools/crawl.d.ts +135 -18
  24. package/dist/tools/crawl.d.ts.map +1 -1
  25. package/dist/tools/crawl.js +141 -56
  26. package/dist/tools/crawl.js.map +1 -1
  27. package/dist/tools/estimate.d.ts +20 -5
  28. package/dist/tools/estimate.d.ts.map +1 -1
  29. package/dist/tools/estimate.js +25 -34
  30. package/dist/tools/estimate.js.map +1 -1
  31. package/dist/tools/extract.d.ts +4 -4
  32. package/dist/tools/extract.d.ts.map +1 -1
  33. package/dist/tools/extract.js +2 -0
  34. package/dist/tools/extract.js.map +1 -1
  35. package/dist/tools/job.d.ts +13 -0
  36. package/dist/tools/job.d.ts.map +1 -0
  37. package/dist/tools/job.js +62 -0
  38. package/dist/tools/job.js.map +1 -0
  39. package/dist/tools/map.d.ts.map +1 -1
  40. package/dist/tools/map.js +4 -1
  41. package/dist/tools/map.js.map +1 -1
  42. package/dist/tools/scrape.d.ts +362 -59
  43. package/dist/tools/scrape.d.ts.map +1 -1
  44. package/dist/tools/scrape.js +176 -215
  45. package/dist/tools/scrape.js.map +1 -1
  46. package/dist/tools/screenshot.d.ts +33 -0
  47. package/dist/tools/screenshot.d.ts.map +1 -1
  48. package/dist/tools/screenshot.js +46 -5
  49. package/dist/tools/screenshot.js.map +1 -1
  50. package/dist/tools/search.d.ts +8 -5
  51. package/dist/tools/search.d.ts.map +1 -1
  52. package/dist/tools/search.js +13 -5
  53. package/dist/tools/search.js.map +1 -1
  54. package/dist/tools/sessions.d.ts +180 -12
  55. package/dist/tools/sessions.d.ts.map +1 -1
  56. package/dist/tools/sessions.js +75 -21
  57. package/dist/tools/sessions.js.map +1 -1
  58. package/dist/tools/simple_batch.d.ts +3 -3
  59. package/dist/tools/simple_batch.d.ts.map +1 -1
  60. package/dist/tools/simple_batch.js +5 -4
  61. package/dist/tools/simple_batch.js.map +1 -1
  62. package/dist/tools/usage.js +9 -18
  63. package/dist/tools/usage.js.map +1 -1
  64. package/dist/types.d.ts +170 -52
  65. package/dist/types.d.ts.map +1 -1
  66. package/dist/types.js.map +1 -1
  67. package/package.json +5 -3
  68. package/server.json +15 -6
@@ -0,0 +1,336 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ADVANCED_KEYS = exports.advancedShape = exports.sectionFilterSchema = exports.actionSchema = exports.costControlsSchema = exports.locationSchema = exports.FORMATS_DESCRIPTION = exports.crawlFormatEnum = exports.allFormatEnum = exports.contentTypeEnum = exports.modeEnum = exports.extractionProviderEnum = exports.batchExtractionProfileEnum = exports.extractionProfileEnum = exports.tierEnum = void 0;
4
+ exports.compact = compact;
5
+ exports.pickAdvanced = pickAdvanced;
6
+ const zod_1 = require("zod");
7
+ /**
8
+ * Zod building blocks shared by several tools. Enum values, bounds and field
9
+ * names mirror the AlterLab OpenAPI request schemas; the schema-parity test
10
+ * (test/schema-parity.test.mjs) fails when they drift from spec/request-schemas.json.
11
+ */
12
+ exports.tierEnum = zod_1.z.enum(["1", "2", "3", "3.5", "4"]);
13
+ exports.extractionProfileEnum = zod_1.z.enum([
14
+ "auto",
15
+ "product",
16
+ "article",
17
+ "job_posting",
18
+ "faq",
19
+ "recipe",
20
+ "event",
21
+ "ecommerce_homepage",
22
+ "directory_listing",
23
+ ]);
24
+ /** Batch-level extraction_profile only accepts the original seven profiles. */
25
+ exports.batchExtractionProfileEnum = zod_1.z.enum([
26
+ "auto",
27
+ "product",
28
+ "article",
29
+ "job_posting",
30
+ "faq",
31
+ "recipe",
32
+ "event",
33
+ ]);
34
+ exports.extractionProviderEnum = zod_1.z.enum([
35
+ "openai",
36
+ "anthropic",
37
+ "openrouter",
38
+ "groq",
39
+ ]);
40
+ exports.modeEnum = zod_1.z.enum(["auto", "html", "js", "pdf", "ocr"]);
41
+ exports.contentTypeEnum = zod_1.z.enum([
42
+ "application/json",
43
+ "application/x-www-form-urlencoded",
44
+ "text/plain",
45
+ "application/graphql",
46
+ ]);
47
+ /** Output formats accepted by scrape, extract, batch items and estimate. */
48
+ exports.allFormatEnum = zod_1.z.enum([
49
+ "text",
50
+ "json",
51
+ "json_v2",
52
+ "html",
53
+ "markdown",
54
+ "rag",
55
+ "content",
56
+ "raw",
57
+ ]);
58
+ /** Output formats accepted by crawl and search (no "raw"). */
59
+ exports.crawlFormatEnum = zod_1.z.enum([
60
+ "text",
61
+ "json",
62
+ "json_v2",
63
+ "html",
64
+ "markdown",
65
+ "rag",
66
+ "content",
67
+ ]);
68
+ exports.FORMATS_DESCRIPTION = "'markdown' is best for LLM consumption. " +
69
+ "'json_v2' returns a structured section tree (headings + content blocks). " +
70
+ "'rag' returns chunked text optimized for retrieval-augmented generation. " +
71
+ "'raw' returns the raw response body without extraction. " +
72
+ "'content' returns body_markdown + content_hash + images + links for AI/KB pipelines.";
73
+ exports.locationSchema = zod_1.z
74
+ .object({
75
+ country: zod_1.z
76
+ .string()
77
+ .length(2)
78
+ .optional()
79
+ .describe("ISO 3166-1 alpha-2 country code for geo-targeting (e.g., 'US', 'DE', 'JP'). " +
80
+ "Routes request through a proxy in the specified country."),
81
+ language: zod_1.z
82
+ .string()
83
+ .min(2)
84
+ .max(5)
85
+ .optional()
86
+ .describe("ISO 639-1 language code (e.g., 'en', 'de', 'ja'). " +
87
+ "Sets the Accept-Language header and browser locale."),
88
+ })
89
+ .describe("Geo-targeting parameters for localized content scraping. " +
90
+ "Controls proxy country routing, Accept-Language header, and browser locale.");
91
+ exports.costControlsSchema = zod_1.z
92
+ .object({
93
+ force_tier: exports.tierEnum
94
+ .optional()
95
+ .describe("Pin execution to this exact tier, bypassing escalation " +
96
+ "(1=curl $0.0002, 2=http $0.0003, 3=stealth $0.002, 3.5=lightjs $0.0025, 4=browser $0.004). " +
97
+ "Use to guarantee a specific engine is used regardless of site difficulty."),
98
+ max_tier: exports.tierEnum
99
+ .optional()
100
+ .describe("Cap automatic escalation at this tier. Scrape will not escalate beyond it even if lower tiers fail. " +
101
+ "Cannot exceed force_tier when both are set. " +
102
+ "Combining render_js=true with a max_tier below 4 is rejected (render_js forces tier 4)."),
103
+ max_credits: zod_1.z
104
+ .number()
105
+ .positive()
106
+ .optional()
107
+ .describe("Hard spending cap for this request in credits. Request fails if cost would exceed this."),
108
+ prefer_cost: zod_1.z
109
+ .boolean()
110
+ .optional()
111
+ .describe("Optimize for cost — try cheaper tiers first, accept lower success probability."),
112
+ prefer_speed: zod_1.z
113
+ .boolean()
114
+ .optional()
115
+ .describe("Optimize for speed — skip to the most reliable tier for this domain."),
116
+ fail_fast: zod_1.z
117
+ .boolean()
118
+ .optional()
119
+ .describe("Return error instead of escalating to more expensive tiers on failure."),
120
+ time_budget: zod_1.z
121
+ .number()
122
+ .min(5)
123
+ .max(300)
124
+ .optional()
125
+ .describe("Total wall-clock budget in seconds for the entire tier escalation sequence (5–300s). " +
126
+ "Escalation stops when remaining budget is insufficient for the next tier attempt."),
127
+ })
128
+ .describe("Fine-grained cost and tier controls. Use to cap spending, pin a tier, or trade off cost vs speed.");
129
+ const waitAction = zod_1.z.object({
130
+ type: zod_1.z.literal("wait"),
131
+ milliseconds: zod_1.z.number().int().min(100).max(30000).optional(),
132
+ selector: zod_1.z.string().max(500).optional().describe("CSS selector to wait for visibility"),
133
+ });
134
+ const waitForAction = zod_1.z.object({
135
+ type: zod_1.z.literal("wait_for"),
136
+ selector: zod_1.z.string().max(500),
137
+ timeout: zod_1.z.number().int().min(1000).max(30000).optional().describe("Timeout in ms (default 10000)"),
138
+ });
139
+ const clickAction = zod_1.z.object({
140
+ type: zod_1.z.literal("click"),
141
+ selector: zod_1.z.string().max(500),
142
+ });
143
+ const fillAction = zod_1.z.object({
144
+ type: zod_1.z.literal("fill"),
145
+ selector: zod_1.z.string().max(500),
146
+ value: zod_1.z.string().max(5000),
147
+ });
148
+ const pressAction = zod_1.z.object({
149
+ type: zod_1.z.literal("press"),
150
+ key: zod_1.z.string().max(50).describe("Key to press, e.g. 'Enter', 'Tab', 'Escape'"),
151
+ });
152
+ const scrollAction = zod_1.z.object({
153
+ type: zod_1.z.literal("scroll"),
154
+ direction: zod_1.z.enum(["down", "up"]).optional(),
155
+ amount: zod_1.z.number().int().min(1).max(20).optional().describe("Viewport heights to scroll"),
156
+ });
157
+ const infiniteScrollAction = zod_1.z.object({
158
+ type: zod_1.z.literal("infinite_scroll"),
159
+ max_scrolls: zod_1.z.number().int().min(1).max(50).optional(),
160
+ delay: zod_1.z.number().int().min(200).max(5000).optional().describe("Delay between scrolls in ms"),
161
+ end_selector: zod_1.z.string().max(500).optional().describe("Stop scrolling when this selector appears"),
162
+ });
163
+ const screenshotAction = zod_1.z.object({
164
+ type: zod_1.z.literal("screenshot"),
165
+ full_page: zod_1.z.boolean().optional(),
166
+ });
167
+ const evaluateAction = zod_1.z.object({
168
+ type: zod_1.z.literal("evaluate"),
169
+ script: zod_1.z
170
+ .string()
171
+ .max(5120)
172
+ .describe("JavaScript to run in the page (max 5120 chars). Network APIs (fetch, XMLHttpRequest, WebSocket) " +
173
+ "and dynamic code execution (eval, Function) are blocked."),
174
+ });
175
+ exports.actionSchema = zod_1.z.discriminatedUnion("type", [
176
+ waitAction,
177
+ waitForAction,
178
+ clickAction,
179
+ fillAction,
180
+ pressAction,
181
+ scrollAction,
182
+ infiniteScrollAction,
183
+ screenshotAction,
184
+ evaluateAction,
185
+ ]);
186
+ exports.sectionFilterSchema = zod_1.z.object({
187
+ min_content_blocks: zod_1.z.number().int().min(0).optional(),
188
+ exclude_content_types: zod_1.z.array(zod_1.z.string()).optional(),
189
+ content_only: zod_1.z.boolean().optional(),
190
+ });
191
+ /**
192
+ * Fields of the API's `advanced` object for scrape requests. scrape spreads
193
+ * these as flat tool parameters; batch items nest them under `advanced`.
194
+ * `markdown` is intentionally absent: it is derived from `formats`.
195
+ * `screenshot` is the top-level scrape field the API promotes into advanced.
196
+ */
197
+ exports.advancedShape = {
198
+ render_js: zod_1.z
199
+ .union([zod_1.z.boolean(), zod_1.z.literal("auto")])
200
+ .optional()
201
+ .describe("Render JavaScript using a headless browser (forces Tier 4 minimum, $0.004/req — no separate add-on charge). " +
202
+ "Required for JS-heavy sites. Set to 'auto' for smart detection (probes each page, " +
203
+ "only renders JS-heavy pages with a browser — saves 30-60% on mixed sites)."),
204
+ use_proxy: zod_1.z
205
+ .boolean()
206
+ .optional()
207
+ .describe("Route through AlterLab's premium proxy (+$0.0002). Helps bypass geo-restrictions and anti-bot"),
208
+ use_own_proxy: zod_1.z
209
+ .boolean()
210
+ .optional()
211
+ .describe("Use your own proxy integration (bring-your-own-proxy) instead of the system proxy. " +
212
+ "BYOP requests get a 20% discount on the tier price."),
213
+ use_system_proxy: zod_1.z
214
+ .boolean()
215
+ .optional()
216
+ .describe("Override your default proxy integration and use AlterLab's system proxy for this request."),
217
+ proxy_integration_id: zod_1.z
218
+ .string()
219
+ .optional()
220
+ .describe("Specific proxy integration ID to use (requires use_own_proxy=true)"),
221
+ proxy_country: zod_1.z
222
+ .string()
223
+ .optional()
224
+ .describe("ISO country code for proxy geo-targeting (e.g., 'US', 'DE'). Requires use_proxy=true"),
225
+ wait_condition: zod_1.z
226
+ .string()
227
+ .optional()
228
+ .describe("Wait condition for JS rendering: domcontentloaded, networkidle or load"),
229
+ remove_cookie_banners: zod_1.z
230
+ .boolean()
231
+ .optional()
232
+ .describe("Remove cookie consent banners from HTML before content extraction (free; the API default is true)"),
233
+ include_iframes: zod_1.z
234
+ .boolean()
235
+ .optional()
236
+ .describe("Inline iframe content into the main document (free, requires render_js). " +
237
+ "Same-origin iframes are read directly; cross-origin iframes are marked but not fetched."),
238
+ flatten_shadow_dom: zod_1.z
239
+ .boolean()
240
+ .optional()
241
+ .describe("Flatten Shadow DOM roots into regular DOM for extraction (free, requires render_js)."),
242
+ skip_tls_verification: zod_1.z
243
+ .boolean()
244
+ .optional()
245
+ .describe("TLS certificate verification for the target. Omit (recommended): certificates are verified, and if " +
246
+ "the site's own certificate is invalid (expired, self-signed, wrong hostname, incomplete chain) " +
247
+ "the page is still fetched without verification. true skips verification from the start. " +
248
+ "false always requires a valid certificate, so sites with an invalid certificate fail."),
249
+ block_images: zod_1.z
250
+ .boolean()
251
+ .optional()
252
+ .describe("Block image downloads during browser rendering. " +
253
+ "Reduces proxy bandwidth and speeds up scrapes. Only effective with render_js=true."),
254
+ scroll_to_load: zod_1.z
255
+ .boolean()
256
+ .optional()
257
+ .describe("Scroll page to trigger lazy-loaded content (requires render_js). " +
258
+ "Performs explicit viewport-height scrolls to load dynamic content. Adds ~2-3s latency."),
259
+ scroll_count: zod_1.z
260
+ .number()
261
+ .int()
262
+ .min(1)
263
+ .max(10)
264
+ .optional()
265
+ .describe("Number of scroll iterations when scroll_to_load is enabled (1-10, API default 3)"),
266
+ generate_pdf: zod_1.z
267
+ .boolean()
268
+ .optional()
269
+ .describe("Generate a PDF of the rendered page (+$0.0004, requires render_js)"),
270
+ ocr: zod_1.z
271
+ .boolean()
272
+ .optional()
273
+ .describe("Extract text from images using OCR (+$0.001)"),
274
+ section_filter: exports.sectionFilterSchema
275
+ .optional()
276
+ .describe("Filter for the json_v2 section tree. Only applies when 'json_v2' is in formats."),
277
+ session_id: zod_1.z
278
+ .string()
279
+ .uuid()
280
+ .optional()
281
+ .describe("UUID of a stored session for authenticated scraping. " +
282
+ "Use alterlab_list_sessions to find available sessions. " +
283
+ "The session's cookies will be injected into the request."),
284
+ cookies: zod_1.z
285
+ .record(zod_1.z.string(), zod_1.z.string())
286
+ .optional()
287
+ .describe("Inline cookies as key-value pairs for authenticated scraping " +
288
+ '(e.g., {"session_token": "abc123"}). ' +
289
+ "Use this for one-off requests; use session_id for reusable sessions."),
290
+ session_headers: zod_1.z
291
+ .record(zod_1.z.string(), zod_1.z.string())
292
+ .optional()
293
+ .describe("Inline auth headers sent to the target (e.g. Authorization: Bearer ...). " +
294
+ "Merged with the stored session's headers when session_id is also set."),
295
+ sticky_session: zod_1.z
296
+ .string()
297
+ .max(128)
298
+ .optional()
299
+ .describe("Sticky-session handle. Scrapes that pass the same value reuse the cookie jar captured on the first " +
300
+ "call and, best-effort, the same exit IP (~10 min). Alphanumeric, '-' and '_' only. " +
301
+ "Requires a paid plan (growth tier or above)."),
302
+ sticky_session_ttl: zod_1.z
303
+ .number()
304
+ .int()
305
+ .min(300)
306
+ .max(7200)
307
+ .optional()
308
+ .describe("Sticky-session cookie-jar lifetime in seconds (300-7200, API default 1800). " +
309
+ "Ignored unless sticky_session is set."),
310
+ actions: zod_1.z
311
+ .array(exports.actionSchema)
312
+ .max(20)
313
+ .optional()
314
+ .describe("Browser automation actions run in order after page load (max 20, requires render_js=true). " +
315
+ "Failed actions are skipped without aborting the sequence. Results are returned in action_results. " +
316
+ "Each action has a 'type': wait, wait_for, click, fill, press, scroll, infinite_scroll, screenshot, evaluate."),
317
+ };
318
+ /** Drop undefined keys so optional tool params are not serialised as null/undefined. */
319
+ function compact(obj) {
320
+ const out = {};
321
+ for (const [k, v] of Object.entries(obj)) {
322
+ if (v !== undefined)
323
+ out[k] = v;
324
+ }
325
+ return out;
326
+ }
327
+ function pickAdvanced(params, keys) {
328
+ const out = {};
329
+ for (const k of keys) {
330
+ if (params[k] !== undefined)
331
+ out[k] = params[k];
332
+ }
333
+ return out;
334
+ }
335
+ exports.ADVANCED_KEYS = Object.keys(exports.advancedShape);
336
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/tools/common.ts"],"names":[],"mappings":";;;AAqYA,0BAMC;AAED,oCASC;AAtZD,6BAAwB;AAExB;;;;GAIG;AAEU,QAAA,QAAQ,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AAE/C,QAAA,qBAAqB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC1C,MAAM;IACN,SAAS;IACT,SAAS;IACT,aAAa;IACb,KAAK;IACL,QAAQ;IACR,OAAO;IACP,oBAAoB;IACpB,mBAAmB;CACpB,CAAC,CAAC;AAEH,+EAA+E;AAClE,QAAA,0BAA0B,GAAG,OAAC,CAAC,IAAI,CAAC;IAC/C,MAAM;IACN,SAAS;IACT,SAAS;IACT,aAAa;IACb,KAAK;IACL,QAAQ;IACR,OAAO;CACR,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC3C,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,MAAM;CACP,CAAC,CAAC;AAEU,QAAA,QAAQ,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAExD,QAAA,eAAe,GAAG,OAAC,CAAC,IAAI,CAAC;IACpC,kBAAkB;IAClB,mCAAmC;IACnC,YAAY;IACZ,qBAAqB;CACtB,CAAC,CAAC;AAEH,4EAA4E;AAC/D,QAAA,aAAa,GAAG,OAAC,CAAC,IAAI,CAAC;IAClC,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C,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,qGAAqG;QACnG,qFAAqF;QACrF,8CAA8C,CACjD;IACH,kBAAkB,EAAE,OAAC;SAClB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,GAAG,CAAC;SACR,GAAG,CAAC,IAAI,CAAC;SACT,QAAQ,EAAE;SACV,QAAQ,CACP,8EAA8E;QAC5E,uCAAuC,CAC1C;IACH,OAAO,EAAE,OAAC;SACP,KAAK,CAAC,oBAAY,CAAC;SACnB,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CACP,6FAA6F;QAC3F,oGAAoG;QACpG,8GAA8G,CACjH;CACJ,CAAC;AAEF,wFAAwF;AACxF,SAAgB,OAAO,CAAoC,GAAM;IAC/D,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,GAAiB,CAAC;AAC3B,CAAC;AAED,SAAgB,YAAY,CAC1B,MAAS,EACT,IAAuB;IAEvB,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,qBAAa,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
3
  import type { AlterLabClient } from "../client.js";
4
+ import type { CrawlRequest } from "../types.js";
4
5
  export declare const crawlSchema: z.ZodObject<{
5
6
  url: z.ZodString;
6
7
  max_pages: z.ZodDefault<z.ZodNumber>;
@@ -9,20 +10,78 @@ export declare const crawlSchema: z.ZodObject<{
9
10
  exclude_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
10
11
  sitemap: z.ZodDefault<z.ZodEnum<["include", "skip", "only"]>>;
11
12
  sitemap_path: z.ZodOptional<z.ZodString>;
12
- formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["text", "json", "json_v2", "html", "markdown"]>, "many">>;
13
+ budget: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
14
+ priority: z.ZodOptional<z.ZodObject<{
15
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
+ boost_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
+ demote_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ keywords?: string[] | undefined;
20
+ boost_patterns?: string[] | undefined;
21
+ demote_patterns?: string[] | undefined;
22
+ }, {
23
+ keywords?: string[] | undefined;
24
+ boost_patterns?: string[] | undefined;
25
+ demote_patterns?: string[] | undefined;
26
+ }>>;
27
+ formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["text", "json", "json_v2", "html", "markdown", "rag", "content"]>, "many">>;
28
+ extraction: z.ZodOptional<z.ZodLiteral<"auto">>;
13
29
  extraction_schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14
- extraction_profile: z.ZodOptional<z.ZodEnum<["auto", "product", "article", "job_posting", "faq", "recipe", "event"]>>;
15
- headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
30
+ extraction_profile: z.ZodOptional<z.ZodEnum<["auto", "product", "article", "job_posting", "faq", "recipe", "event", "ecommerce_homepage", "directory_listing"]>>;
31
+ extraction_template: z.ZodOptional<z.ZodEnum<["auto", "product", "article", "job_posting", "faq", "recipe", "event", "ecommerce_homepage", "directory_listing"]>>;
32
+ extraction_provider: z.ZodOptional<z.ZodEnum<["openai", "anthropic", "openrouter", "groq"]>>;
16
33
  extraction_model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
- render_js: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"auto">]>>;
18
- use_proxy: z.ZodDefault<z.ZodBoolean>;
34
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
19
35
  max_concurrency: z.ZodDefault<z.ZodNumber>;
20
36
  respect_robots: z.ZodDefault<z.ZodBoolean>;
21
37
  include_subdomains: z.ZodDefault<z.ZodBoolean>;
22
- block_images: z.ZodDefault<z.ZodBoolean>;
38
+ change_tracking: z.ZodOptional<z.ZodObject<{
39
+ enabled: z.ZodOptional<z.ZodBoolean>;
40
+ tracking_id: z.ZodOptional<z.ZodString>;
41
+ mode: z.ZodOptional<z.ZodEnum<["content", "structured"]>>;
42
+ include_diff: z.ZodOptional<z.ZodBoolean>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ mode?: "content" | "structured" | undefined;
45
+ enabled?: boolean | undefined;
46
+ tracking_id?: string | undefined;
47
+ include_diff?: boolean | undefined;
48
+ }, {
49
+ mode?: "content" | "structured" | undefined;
50
+ enabled?: boolean | undefined;
51
+ tracking_id?: string | undefined;
52
+ include_diff?: boolean | undefined;
53
+ }>>;
54
+ render_js: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"auto">]>>;
55
+ screenshot: z.ZodOptional<z.ZodBoolean>;
56
+ use_proxy: z.ZodOptional<z.ZodBoolean>;
23
57
  wait_for: z.ZodOptional<z.ZodString>;
24
58
  timeout: z.ZodOptional<z.ZodNumber>;
59
+ delay: z.ZodOptional<z.ZodNumber>;
60
+ depth_strategy: z.ZodOptional<z.ZodEnum<["eager", "sequential"]>>;
25
61
  webhook_url: z.ZodOptional<z.ZodString>;
62
+ webhook: z.ZodOptional<z.ZodObject<{
63
+ url: z.ZodString;
64
+ events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
65
+ secret: z.ZodOptional<z.ZodString>;
66
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
67
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ url: string;
70
+ headers?: Record<string, string> | undefined;
71
+ events?: string[] | undefined;
72
+ secret?: string | undefined;
73
+ metadata?: Record<string, unknown> | undefined;
74
+ }, {
75
+ url: string;
76
+ headers?: Record<string, string> | undefined;
77
+ events?: string[] | undefined;
78
+ secret?: string | undefined;
79
+ metadata?: Record<string, unknown> | undefined;
80
+ }>>;
81
+ storage: z.ZodOptional<z.ZodEnum<["redis", "s3", "r2"]>>;
82
+ cache: z.ZodOptional<z.ZodBoolean>;
83
+ cache_ttl: z.ZodOptional<z.ZodNumber>;
84
+ force_refresh: z.ZodOptional<z.ZodBoolean>;
26
85
  cost_controls: z.ZodOptional<z.ZodObject<{
27
86
  max_credits: z.ZodOptional<z.ZodNumber>;
28
87
  max_tier: z.ZodOptional<z.ZodEnum<["1", "2", "3", "3.5", "4"]>>;
@@ -38,9 +97,6 @@ export declare const crawlSchema: z.ZodObject<{
38
97
  }>>;
39
98
  }, "strip", z.ZodTypeAny, {
40
99
  url: string;
41
- render_js: boolean | "auto";
42
- use_proxy: boolean;
43
- block_images: boolean;
44
100
  max_pages: number;
45
101
  max_depth: number;
46
102
  sitemap: "include" | "skip" | "only";
@@ -49,49 +105,110 @@ export declare const crawlSchema: z.ZodObject<{
49
105
  include_subdomains: boolean;
50
106
  headers?: Record<string, string> | undefined;
51
107
  timeout?: number | undefined;
52
- formats?: ("text" | "html" | "json" | "json_v2" | "markdown")[] | undefined;
108
+ priority?: {
109
+ keywords?: string[] | undefined;
110
+ boost_patterns?: string[] | undefined;
111
+ demote_patterns?: string[] | undefined;
112
+ } | undefined;
113
+ wait_for?: string | undefined;
114
+ delay?: number | undefined;
115
+ screenshot?: boolean | undefined;
116
+ formats?: ("content" | "text" | "json" | "json_v2" | "html" | "markdown" | "rag")[] | undefined;
53
117
  extraction_schema?: Record<string, unknown> | undefined;
54
118
  extraction_model?: string | null | undefined;
55
- extraction_profile?: "auto" | "product" | "article" | "job_posting" | "faq" | "recipe" | "event" | undefined;
56
- wait_for?: string | undefined;
119
+ extraction_provider?: "openai" | "anthropic" | "openrouter" | "groq" | undefined;
120
+ extraction_profile?: "auto" | "product" | "article" | "job_posting" | "faq" | "recipe" | "event" | "ecommerce_homepage" | "directory_listing" | undefined;
121
+ extraction_template?: "auto" | "product" | "article" | "job_posting" | "faq" | "recipe" | "event" | "ecommerce_homepage" | "directory_listing" | undefined;
122
+ cache?: boolean | undefined;
123
+ cache_ttl?: number | undefined;
124
+ force_refresh?: boolean | undefined;
57
125
  cost_controls?: {
58
126
  force_tier?: "1" | "2" | "3" | "3.5" | "4" | undefined;
59
127
  max_tier?: "1" | "2" | "3" | "3.5" | "4" | undefined;
60
128
  max_credits?: number | undefined;
61
129
  } | undefined;
130
+ render_js?: boolean | "auto" | undefined;
131
+ use_proxy?: boolean | undefined;
62
132
  include_patterns?: string[] | undefined;
63
133
  exclude_patterns?: string[] | undefined;
64
134
  sitemap_path?: string | undefined;
135
+ budget?: Record<string, number> | undefined;
136
+ extraction?: "auto" | undefined;
137
+ change_tracking?: {
138
+ mode?: "content" | "structured" | undefined;
139
+ enabled?: boolean | undefined;
140
+ tracking_id?: string | undefined;
141
+ include_diff?: boolean | undefined;
142
+ } | undefined;
143
+ depth_strategy?: "eager" | "sequential" | undefined;
65
144
  webhook_url?: string | undefined;
145
+ webhook?: {
146
+ url: string;
147
+ headers?: Record<string, string> | undefined;
148
+ events?: string[] | undefined;
149
+ secret?: string | undefined;
150
+ metadata?: Record<string, unknown> | undefined;
151
+ } | undefined;
152
+ storage?: "redis" | "s3" | "r2" | undefined;
66
153
  }, {
67
154
  url: string;
68
155
  headers?: Record<string, string> | undefined;
69
156
  timeout?: number | undefined;
70
- formats?: ("text" | "html" | "json" | "json_v2" | "markdown")[] | undefined;
157
+ priority?: {
158
+ keywords?: string[] | undefined;
159
+ boost_patterns?: string[] | undefined;
160
+ demote_patterns?: string[] | undefined;
161
+ } | undefined;
162
+ wait_for?: string | undefined;
163
+ delay?: number | undefined;
164
+ screenshot?: boolean | undefined;
165
+ formats?: ("content" | "text" | "json" | "json_v2" | "html" | "markdown" | "rag")[] | undefined;
71
166
  extraction_schema?: Record<string, unknown> | undefined;
72
167
  extraction_model?: string | null | undefined;
73
- extraction_profile?: "auto" | "product" | "article" | "job_posting" | "faq" | "recipe" | "event" | undefined;
74
- render_js?: boolean | "auto" | undefined;
75
- use_proxy?: boolean | undefined;
76
- wait_for?: string | undefined;
77
- block_images?: boolean | undefined;
168
+ extraction_provider?: "openai" | "anthropic" | "openrouter" | "groq" | undefined;
169
+ extraction_profile?: "auto" | "product" | "article" | "job_posting" | "faq" | "recipe" | "event" | "ecommerce_homepage" | "directory_listing" | undefined;
170
+ extraction_template?: "auto" | "product" | "article" | "job_posting" | "faq" | "recipe" | "event" | "ecommerce_homepage" | "directory_listing" | undefined;
171
+ cache?: boolean | undefined;
172
+ cache_ttl?: number | undefined;
173
+ force_refresh?: boolean | undefined;
78
174
  cost_controls?: {
79
175
  force_tier?: "1" | "2" | "3" | "3.5" | "4" | undefined;
80
176
  max_tier?: "1" | "2" | "3" | "3.5" | "4" | undefined;
81
177
  max_credits?: number | undefined;
82
178
  } | undefined;
179
+ render_js?: boolean | "auto" | undefined;
180
+ use_proxy?: boolean | undefined;
83
181
  max_pages?: number | undefined;
84
182
  max_depth?: number | undefined;
85
183
  include_patterns?: string[] | undefined;
86
184
  exclude_patterns?: string[] | undefined;
87
185
  sitemap?: "include" | "skip" | "only" | undefined;
88
186
  sitemap_path?: string | undefined;
187
+ budget?: Record<string, number> | undefined;
188
+ extraction?: "auto" | undefined;
89
189
  max_concurrency?: number | undefined;
90
190
  respect_robots?: boolean | undefined;
91
191
  include_subdomains?: boolean | undefined;
192
+ change_tracking?: {
193
+ mode?: "content" | "structured" | undefined;
194
+ enabled?: boolean | undefined;
195
+ tracking_id?: string | undefined;
196
+ include_diff?: boolean | undefined;
197
+ } | undefined;
198
+ depth_strategy?: "eager" | "sequential" | undefined;
92
199
  webhook_url?: string | undefined;
200
+ webhook?: {
201
+ url: string;
202
+ headers?: Record<string, string> | undefined;
203
+ events?: string[] | undefined;
204
+ secret?: string | undefined;
205
+ metadata?: Record<string, unknown> | undefined;
206
+ } | undefined;
207
+ storage?: "redis" | "s3" | "r2" | undefined;
93
208
  }>;
94
209
  export declare const crawlDescription: string;
210
+ /** Translate flat crawl tool parameters into the API's CrawlRequest. Exported for tests. */
211
+ export declare function buildCrawlRequest(params: z.infer<typeof crawlSchema>): CrawlRequest;
95
212
  export declare function handleCrawl(client: AlterLabClient, params: z.infer<typeof crawlSchema>): Promise<CallToolResult>;
96
213
  export declare const crawlStatusSchema: z.ZodObject<{
97
214
  crawl_id: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"crawl.d.ts","sourceRoot":"","sources":["../../src/tools/crawl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAmCnD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HtB,CAAC;AAEH,eAAO,MAAM,gBAAgB,QAW+D,CAAC;AAE7F,wBAAsB,WAAW,CAC/B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,GAClC,OAAO,CAAC,cAAc,CAAC,CAmD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