@xberg-io/crawlberg-wasm 1.2.1 → 1.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xberg-io/crawlberg-wasm",
3
- "version": "1.2.1",
3
+ "version": "1.3.2",
4
4
  "private": false,
5
5
  "description": "High-performance web crawling engine",
6
6
  "license": "MIT",
@@ -13,15 +13,19 @@
13
13
  "access": "public"
14
14
  },
15
15
  "type": "module",
16
- "files": [
17
- "pkg",
18
- "*.wasm",
19
- "*.d.ts",
20
- "README.md"
21
- ],
16
+ "files": ["pkg", "*.wasm", "*.d.ts", "README.md"],
22
17
  "main": "pkg/nodejs/crawlberg_wasm.js",
23
18
  "module": "pkg/web/crawlberg_wasm.js",
24
19
  "types": "pkg/nodejs/crawlberg_wasm.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./pkg/nodejs/crawlberg_wasm.d.ts",
23
+ "browser": "./pkg/web/crawlberg_wasm.js",
24
+ "import": "./pkg/nodejs/crawlberg_wasm.js",
25
+ "require": "./pkg/nodejs/crawlberg_wasm.js",
26
+ "default": "./pkg/nodejs/crawlberg_wasm.js"
27
+ }
28
+ },
25
29
  "engines": {
26
30
  "node": ">= 22"
27
31
  },
@@ -267,6 +267,13 @@ export class WasmContentConfig {
267
267
  wrapWidth: number;
268
268
  }
269
269
 
270
+ /**
271
+ * Content filter applied to each crawled page before it reaches the result.
272
+ */
273
+ export enum WasmContentFilterKind {
274
+ Bm25 = 0,
275
+ }
276
+
270
277
  /**
271
278
  * Information about an HTTP cookie received from a response.
272
279
  */
@@ -290,7 +297,7 @@ export class WasmCrawlConfig {
290
297
  free(): void;
291
298
  [Symbol.dispose](): void;
292
299
  static default(): WasmCrawlConfig;
293
- constructor(respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: any[] | null, browser?: WasmBrowserConfig | null, userAgents?: string[] | null, captureScreenshot?: boolean | null, followDocumentUrls?: boolean | null, downloadDocuments?: boolean | null, documentMimeTypes?: string[] | null, saveBrowserProfile?: boolean | null, ssrf?: WasmSsrfPolicy | null, maxDepth?: number | null, maxPages?: number | null, maxLinksPerPage?: number | null, maxConcurrent?: number | null, userAgent?: string | null, rateLimitMs?: bigint | null, auth?: any | null, maxBodySize?: number | null, mapLimit?: number | null, mapSearch?: string | null, maxAssetSize?: number | null, proxy?: WasmProxyConfig | null, documentUrlDepth?: number | null, documentMaxSize?: number | null, documentOutputDir?: string | null, documentContentEncoding?: WasmDocumentContentEncoding | null, warcOutput?: string | null, browserProfile?: string | null, ssrfDenyPrivateExplicit?: boolean | null);
300
+ constructor(crawlStrategy?: WasmCrawlStrategyKind | null, respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: any[] | null, browser?: WasmBrowserConfig | null, userAgents?: string[] | null, captureScreenshot?: boolean | null, followDocumentUrls?: boolean | null, downloadDocuments?: boolean | null, documentMimeTypes?: string[] | null, saveBrowserProfile?: boolean | null, ssrf?: WasmSsrfPolicy | null, maxDepth?: number | null, maxPages?: number | null, maxLinksPerPage?: number | null, maxConcurrent?: number | null, contentFilter?: WasmContentFilterKind | null, bm25Query?: string | null, bm25Threshold?: number | null, userAgent?: string | null, rateLimitMs?: bigint | null, auth?: any | null, maxBodySize?: number | null, mapLimit?: number | null, mapSearch?: string | null, maxAssetSize?: number | null, proxy?: WasmProxyConfig | null, documentUrlDepth?: number | null, documentMaxSize?: number | null, documentOutputDir?: string | null, documentContentEncoding?: WasmDocumentContentEncoding | null, warcOutput?: string | null, browserProfile?: string | null, ssrfDenyPrivateExplicit?: boolean | null);
294
301
  /**
295
302
  * Validate the configuration, returning an error if any values are invalid.
296
303
  */
@@ -299,12 +306,20 @@ export class WasmCrawlConfig {
299
306
  assetTypes: string[];
300
307
  get auth(): any | undefined;
301
308
  set auth(value: any | null | undefined);
309
+ get bm25Query(): string | undefined;
310
+ set bm25Query(value: string | null | undefined);
311
+ get bm25Threshold(): number | undefined;
312
+ set bm25Threshold(value: number | null | undefined);
302
313
  browser: WasmBrowserConfig;
303
314
  get browserProfile(): string | undefined;
304
315
  set browserProfile(value: string | null | undefined);
305
316
  captureScreenshot: boolean;
306
317
  content: WasmContentConfig;
318
+ get contentFilter(): string | undefined;
319
+ set contentFilter(value: WasmContentFilterKind | null | undefined);
307
320
  cookiesEnabled: boolean;
321
+ get crawlStrategy(): string;
322
+ set crawlStrategy(value: WasmCrawlStrategyKind);
308
323
  customHeaders: any;
309
324
  get documentContentEncoding(): string | undefined;
310
325
  set documentContentEncoding(value: WasmDocumentContentEncoding | null | undefined);
@@ -438,6 +453,20 @@ export class WasmCrawlResult {
438
453
  wasSkipped: boolean;
439
454
  }
440
455
 
456
+ /**
457
+ * Traversal order for a crawl.
458
+ *
459
+ * Selects both the queue discipline and the selection strategy, because global order is a
460
+ * property of the frontier: the engine hands its bounded selection window to the strategy, so
461
+ * a strategy alone can only reorder URLs that have already been dequeued.
462
+ */
463
+ export enum WasmCrawlStrategyKind {
464
+ Bfs = 0,
465
+ Dfs = 1,
466
+ BestFirst = 2,
467
+ Adaptive = 3,
468
+ }
469
+
441
470
  /**
442
471
  * Opt-in encoding applied to a downloaded document's bytes for callers who need the
443
472
  * content available in a serializable field rather than reading it from disk.
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./crawlberg_wasm_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
  wasm.__wbindgen_start();
7
7
  export {
8
- WasmActionResult, WasmArticleMetadata, WasmAssetCategory, WasmAuthConfig, WasmBatchCrawlResult, WasmBatchCrawlResults, WasmBatchScrapeResult, WasmBatchScrapeResults, WasmBrowserBackend, WasmBrowserConfig, WasmBrowserExtras, WasmBrowserMode, WasmBrowserWait, WasmCitationReference, WasmCitationResult, WasmContentConfig, WasmCookieInfo, WasmCrawlConfig, WasmCrawlEngineHandle, WasmCrawlPageResult, WasmCrawlResult, WasmDocumentContentEncoding, WasmDownloadedAsset, WasmDownloadedDocument, WasmExtractionMeta, WasmFaviconInfo, WasmFeedInfo, WasmFeedType, WasmHeadingInfo, WasmHostMatcher, WasmHreflangEntry, WasmImageInfo, WasmImageSource, WasmInteractionResult, WasmJsonLdEntry, WasmLinkInfo, WasmLinkType, WasmMapResult, WasmMarkdownResult, WasmPageAction, WasmPageMetadata, WasmProxyConfig, WasmResponseMeta, WasmScrapeResult, WasmScrollDirection, WasmSitemapUrl, WasmSsrfPolicy, batchCrawl, batchScrape, crawl, createEngine, generateCitations, interact, mapUrls, scrape
8
+ WasmActionResult, WasmArticleMetadata, WasmAssetCategory, WasmAuthConfig, WasmBatchCrawlResult, WasmBatchCrawlResults, WasmBatchScrapeResult, WasmBatchScrapeResults, WasmBrowserBackend, WasmBrowserConfig, WasmBrowserExtras, WasmBrowserMode, WasmBrowserWait, WasmCitationReference, WasmCitationResult, WasmContentConfig, WasmContentFilterKind, WasmCookieInfo, WasmCrawlConfig, WasmCrawlEngineHandle, WasmCrawlPageResult, WasmCrawlResult, WasmCrawlStrategyKind, WasmDocumentContentEncoding, WasmDownloadedAsset, WasmDownloadedDocument, WasmExtractionMeta, WasmFaviconInfo, WasmFeedInfo, WasmFeedType, WasmHeadingInfo, WasmHostMatcher, WasmHreflangEntry, WasmImageInfo, WasmImageSource, WasmInteractionResult, WasmJsonLdEntry, WasmLinkInfo, WasmLinkType, WasmMapResult, WasmMarkdownResult, WasmPageAction, WasmPageMetadata, WasmProxyConfig, WasmResponseMeta, WasmScrapeResult, WasmScrollDirection, WasmSitemapUrl, WasmSsrfPolicy, batchCrawl, batchScrape, crawl, createEngine, generateCitations, interact, mapUrls, scrape
9
9
  } from "./crawlberg_wasm_bg.js";
@@ -1766,6 +1766,14 @@ export class WasmContentConfig {
1766
1766
  }
1767
1767
  if (Symbol.dispose) WasmContentConfig.prototype[Symbol.dispose] = WasmContentConfig.prototype.free;
1768
1768
 
1769
+ /**
1770
+ * Content filter applied to each crawled page before it reaches the result.
1771
+ * @enum {0}
1772
+ */
1773
+ export const WasmContentFilterKind = Object.freeze({
1774
+ Bm25: 0, "0": "Bm25",
1775
+ });
1776
+
1769
1777
  /**
1770
1778
  * Information about an HTTP cookie received from a response.
1771
1779
  */
@@ -1951,6 +1959,25 @@ export class WasmCrawlConfig {
1951
1959
  const ret = wasm.wasmcrawlconfig_auth(this.__wbg_ptr);
1952
1960
  return ret;
1953
1961
  }
1962
+ /**
1963
+ * @returns {string | undefined}
1964
+ */
1965
+ get bm25Query() {
1966
+ const ret = wasm.wasmcrawlconfig_bm25Query(this.__wbg_ptr);
1967
+ let v1;
1968
+ if (ret[0] !== 0) {
1969
+ v1 = getStringFromWasm0(ret[0], ret[1]);
1970
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1971
+ }
1972
+ return v1;
1973
+ }
1974
+ /**
1975
+ * @returns {number | undefined}
1976
+ */
1977
+ get bm25Threshold() {
1978
+ const ret = wasm.wasmcrawlconfig_bm25Threshold(this.__wbg_ptr);
1979
+ return ret[0] === 0 ? undefined : ret[1];
1980
+ }
1954
1981
  /**
1955
1982
  * @returns {WasmBrowserConfig}
1956
1983
  */
@@ -1984,6 +2011,18 @@ export class WasmCrawlConfig {
1984
2011
  const ret = wasm.wasmcrawlconfig_content(this.__wbg_ptr);
1985
2012
  return WasmContentConfig.__wrap(ret);
1986
2013
  }
2014
+ /**
2015
+ * @returns {string | undefined}
2016
+ */
2017
+ get contentFilter() {
2018
+ const ret = wasm.wasmcrawlconfig_contentFilter(this.__wbg_ptr);
2019
+ let v1;
2020
+ if (ret[0] !== 0) {
2021
+ v1 = getStringFromWasm0(ret[0], ret[1]);
2022
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2023
+ }
2024
+ return v1;
2025
+ }
1987
2026
  /**
1988
2027
  * @returns {boolean}
1989
2028
  */
@@ -1991,6 +2030,21 @@ export class WasmCrawlConfig {
1991
2030
  const ret = wasm.wasmcrawlconfig_cookiesEnabled(this.__wbg_ptr);
1992
2031
  return ret !== 0;
1993
2032
  }
2033
+ /**
2034
+ * @returns {string}
2035
+ */
2036
+ get crawlStrategy() {
2037
+ let deferred1_0;
2038
+ let deferred1_1;
2039
+ try {
2040
+ const ret = wasm.wasmcrawlconfig_crawlStrategy(this.__wbg_ptr);
2041
+ deferred1_0 = ret[0];
2042
+ deferred1_1 = ret[1];
2043
+ return getStringFromWasm0(ret[0], ret[1]);
2044
+ } finally {
2045
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2046
+ }
2047
+ }
1994
2048
  /**
1995
2049
  * @returns {any}
1996
2050
  */
@@ -2160,6 +2214,7 @@ export class WasmCrawlConfig {
2160
2214
  return ret >>> 0;
2161
2215
  }
2162
2216
  /**
2217
+ * @param {WasmCrawlStrategyKind | null} [crawlStrategy]
2163
2218
  * @param {boolean | null} [respectRobotsTxt]
2164
2219
  * @param {boolean | null} [softHttpErrors]
2165
2220
  * @param {boolean | null} [stayOnDomain]
@@ -2188,6 +2243,9 @@ export class WasmCrawlConfig {
2188
2243
  * @param {number | null} [maxPages]
2189
2244
  * @param {number | null} [maxLinksPerPage]
2190
2245
  * @param {number | null} [maxConcurrent]
2246
+ * @param {WasmContentFilterKind | null} [contentFilter]
2247
+ * @param {string | null} [bm25Query]
2248
+ * @param {number | null} [bm25Threshold]
2191
2249
  * @param {string | null} [userAgent]
2192
2250
  * @param {bigint | null} [rateLimitMs]
2193
2251
  * @param {any | null} [auth]
@@ -2204,7 +2262,7 @@ export class WasmCrawlConfig {
2204
2262
  * @param {string | null} [browserProfile]
2205
2263
  * @param {boolean | null} [ssrfDenyPrivateExplicit]
2206
2264
  */
2207
- constructor(respectRobotsTxt, softHttpErrors, stayOnDomain, allowSubdomains, includePaths, excludePaths, customHeaders, requestTimeout, maxRedirects, retryCount, retryCodes, cookiesEnabled, removeTags, content, downloadAssets, assetTypes, browser, userAgents, captureScreenshot, followDocumentUrls, downloadDocuments, documentMimeTypes, saveBrowserProfile, ssrf, maxDepth, maxPages, maxLinksPerPage, maxConcurrent, userAgent, rateLimitMs, auth, maxBodySize, mapLimit, mapSearch, maxAssetSize, proxy, documentUrlDepth, documentMaxSize, documentOutputDir, documentContentEncoding, warcOutput, browserProfile, ssrfDenyPrivateExplicit) {
2265
+ constructor(crawlStrategy, respectRobotsTxt, softHttpErrors, stayOnDomain, allowSubdomains, includePaths, excludePaths, customHeaders, requestTimeout, maxRedirects, retryCount, retryCodes, cookiesEnabled, removeTags, content, downloadAssets, assetTypes, browser, userAgents, captureScreenshot, followDocumentUrls, downloadDocuments, documentMimeTypes, saveBrowserProfile, ssrf, maxDepth, maxPages, maxLinksPerPage, maxConcurrent, contentFilter, bm25Query, bm25Threshold, userAgent, rateLimitMs, auth, maxBodySize, mapLimit, mapSearch, maxAssetSize, proxy, documentUrlDepth, documentMaxSize, documentOutputDir, documentContentEncoding, warcOutput, browserProfile, ssrfDenyPrivateExplicit) {
2208
2266
  var ptr0 = isLikeNone(includePaths) ? 0 : passArrayJsValueToWasm0(includePaths, wasm.__wbindgen_malloc);
2209
2267
  var len0 = WASM_VECTOR_LEN;
2210
2268
  var ptr1 = isLikeNone(excludePaths) ? 0 : passArrayJsValueToWasm0(excludePaths, wasm.__wbindgen_malloc);
@@ -2234,22 +2292,24 @@ export class WasmCrawlConfig {
2234
2292
  _assertClass(ssrf, WasmSsrfPolicy);
2235
2293
  ptr9 = ssrf.__destroy_into_raw();
2236
2294
  }
2237
- var ptr10 = isLikeNone(userAgent) ? 0 : passStringToWasm0(userAgent, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2295
+ var ptr10 = isLikeNone(bm25Query) ? 0 : passStringToWasm0(bm25Query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2238
2296
  var len10 = WASM_VECTOR_LEN;
2239
- var ptr11 = isLikeNone(mapSearch) ? 0 : passStringToWasm0(mapSearch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2297
+ var ptr11 = isLikeNone(userAgent) ? 0 : passStringToWasm0(userAgent, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2240
2298
  var len11 = WASM_VECTOR_LEN;
2241
- let ptr12 = 0;
2299
+ var ptr12 = isLikeNone(mapSearch) ? 0 : passStringToWasm0(mapSearch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2300
+ var len12 = WASM_VECTOR_LEN;
2301
+ let ptr13 = 0;
2242
2302
  if (!isLikeNone(proxy)) {
2243
2303
  _assertClass(proxy, WasmProxyConfig);
2244
- ptr12 = proxy.__destroy_into_raw();
2304
+ ptr13 = proxy.__destroy_into_raw();
2245
2305
  }
2246
- var ptr13 = isLikeNone(documentOutputDir) ? 0 : passStringToWasm0(documentOutputDir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2247
- var len13 = WASM_VECTOR_LEN;
2248
- var ptr14 = isLikeNone(warcOutput) ? 0 : passStringToWasm0(warcOutput, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2306
+ var ptr14 = isLikeNone(documentOutputDir) ? 0 : passStringToWasm0(documentOutputDir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2249
2307
  var len14 = WASM_VECTOR_LEN;
2250
- var ptr15 = isLikeNone(browserProfile) ? 0 : passStringToWasm0(browserProfile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2308
+ var ptr15 = isLikeNone(warcOutput) ? 0 : passStringToWasm0(warcOutput, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2251
2309
  var len15 = WASM_VECTOR_LEN;
2252
- const ret = wasm.wasmcrawlconfig_new(isLikeNone(respectRobotsTxt) ? 0xFFFFFF : respectRobotsTxt ? 1 : 0, isLikeNone(softHttpErrors) ? 0xFFFFFF : softHttpErrors ? 1 : 0, isLikeNone(stayOnDomain) ? 0xFFFFFF : stayOnDomain ? 1 : 0, isLikeNone(allowSubdomains) ? 0xFFFFFF : allowSubdomains ? 1 : 0, ptr0, len0, ptr1, len1, isLikeNone(customHeaders) ? 0 : addToExternrefTable0(customHeaders), !isLikeNone(requestTimeout), isLikeNone(requestTimeout) ? BigInt(0) : requestTimeout, isLikeNone(maxRedirects) ? Number.MAX_SAFE_INTEGER : (maxRedirects) >>> 0, isLikeNone(retryCount) ? Number.MAX_SAFE_INTEGER : (retryCount) >>> 0, ptr2, len2, isLikeNone(cookiesEnabled) ? 0xFFFFFF : cookiesEnabled ? 1 : 0, ptr3, len3, ptr4, isLikeNone(downloadAssets) ? 0xFFFFFF : downloadAssets ? 1 : 0, ptr5, len5, ptr6, ptr7, len7, isLikeNone(captureScreenshot) ? 0xFFFFFF : captureScreenshot ? 1 : 0, isLikeNone(followDocumentUrls) ? 0xFFFFFF : followDocumentUrls ? 1 : 0, isLikeNone(downloadDocuments) ? 0xFFFFFF : downloadDocuments ? 1 : 0, ptr8, len8, isLikeNone(saveBrowserProfile) ? 0xFFFFFF : saveBrowserProfile ? 1 : 0, ptr9, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, isLikeNone(maxPages) ? Number.MAX_SAFE_INTEGER : (maxPages) >>> 0, isLikeNone(maxLinksPerPage) ? Number.MAX_SAFE_INTEGER : (maxLinksPerPage) >>> 0, isLikeNone(maxConcurrent) ? Number.MAX_SAFE_INTEGER : (maxConcurrent) >>> 0, ptr10, len10, !isLikeNone(rateLimitMs), isLikeNone(rateLimitMs) ? BigInt(0) : rateLimitMs, isLikeNone(auth) ? 0 : addToExternrefTable0(auth), isLikeNone(maxBodySize) ? Number.MAX_SAFE_INTEGER : (maxBodySize) >>> 0, isLikeNone(mapLimit) ? Number.MAX_SAFE_INTEGER : (mapLimit) >>> 0, ptr11, len11, isLikeNone(maxAssetSize) ? Number.MAX_SAFE_INTEGER : (maxAssetSize) >>> 0, ptr12, isLikeNone(documentUrlDepth) ? Number.MAX_SAFE_INTEGER : (documentUrlDepth) >>> 0, isLikeNone(documentMaxSize) ? Number.MAX_SAFE_INTEGER : (documentMaxSize) >>> 0, ptr13, len13, isLikeNone(documentContentEncoding) ? 1 : documentContentEncoding, ptr14, len14, ptr15, len15, isLikeNone(ssrfDenyPrivateExplicit) ? 0xFFFFFF : ssrfDenyPrivateExplicit ? 1 : 0);
2310
+ var ptr16 = isLikeNone(browserProfile) ? 0 : passStringToWasm0(browserProfile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2311
+ var len16 = WASM_VECTOR_LEN;
2312
+ const ret = wasm.wasmcrawlconfig_new(isLikeNone(crawlStrategy) ? 4 : crawlStrategy, isLikeNone(respectRobotsTxt) ? 0xFFFFFF : respectRobotsTxt ? 1 : 0, isLikeNone(softHttpErrors) ? 0xFFFFFF : softHttpErrors ? 1 : 0, isLikeNone(stayOnDomain) ? 0xFFFFFF : stayOnDomain ? 1 : 0, isLikeNone(allowSubdomains) ? 0xFFFFFF : allowSubdomains ? 1 : 0, ptr0, len0, ptr1, len1, isLikeNone(customHeaders) ? 0 : addToExternrefTable0(customHeaders), !isLikeNone(requestTimeout), isLikeNone(requestTimeout) ? BigInt(0) : requestTimeout, isLikeNone(maxRedirects) ? Number.MAX_SAFE_INTEGER : (maxRedirects) >>> 0, isLikeNone(retryCount) ? Number.MAX_SAFE_INTEGER : (retryCount) >>> 0, ptr2, len2, isLikeNone(cookiesEnabled) ? 0xFFFFFF : cookiesEnabled ? 1 : 0, ptr3, len3, ptr4, isLikeNone(downloadAssets) ? 0xFFFFFF : downloadAssets ? 1 : 0, ptr5, len5, ptr6, ptr7, len7, isLikeNone(captureScreenshot) ? 0xFFFFFF : captureScreenshot ? 1 : 0, isLikeNone(followDocumentUrls) ? 0xFFFFFF : followDocumentUrls ? 1 : 0, isLikeNone(downloadDocuments) ? 0xFFFFFF : downloadDocuments ? 1 : 0, ptr8, len8, isLikeNone(saveBrowserProfile) ? 0xFFFFFF : saveBrowserProfile ? 1 : 0, ptr9, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, isLikeNone(maxPages) ? Number.MAX_SAFE_INTEGER : (maxPages) >>> 0, isLikeNone(maxLinksPerPage) ? Number.MAX_SAFE_INTEGER : (maxLinksPerPage) >>> 0, isLikeNone(maxConcurrent) ? Number.MAX_SAFE_INTEGER : (maxConcurrent) >>> 0, isLikeNone(contentFilter) ? 1 : contentFilter, ptr10, len10, !isLikeNone(bm25Threshold), isLikeNone(bm25Threshold) ? 0 : bm25Threshold, ptr11, len11, !isLikeNone(rateLimitMs), isLikeNone(rateLimitMs) ? BigInt(0) : rateLimitMs, isLikeNone(auth) ? 0 : addToExternrefTable0(auth), isLikeNone(maxBodySize) ? Number.MAX_SAFE_INTEGER : (maxBodySize) >>> 0, isLikeNone(mapLimit) ? Number.MAX_SAFE_INTEGER : (mapLimit) >>> 0, ptr12, len12, isLikeNone(maxAssetSize) ? Number.MAX_SAFE_INTEGER : (maxAssetSize) >>> 0, ptr13, isLikeNone(documentUrlDepth) ? Number.MAX_SAFE_INTEGER : (documentUrlDepth) >>> 0, isLikeNone(documentMaxSize) ? Number.MAX_SAFE_INTEGER : (documentMaxSize) >>> 0, ptr14, len14, isLikeNone(documentContentEncoding) ? 1 : documentContentEncoding, ptr15, len15, ptr16, len16, isLikeNone(ssrfDenyPrivateExplicit) ? 0xFFFFFF : ssrfDenyPrivateExplicit ? 1 : 0);
2253
2313
  this.__wbg_ptr = ret;
2254
2314
  WasmCrawlConfigFinalization.register(this, this.__wbg_ptr, this);
2255
2315
  return this;
@@ -2334,6 +2394,20 @@ export class WasmCrawlConfig {
2334
2394
  set auth(value) {
2335
2395
  wasm.wasmcrawlconfig_set_auth(this.__wbg_ptr, isLikeNone(value) ? 0 : addToExternrefTable0(value));
2336
2396
  }
2397
+ /**
2398
+ * @param {string | null} [value]
2399
+ */
2400
+ set bm25Query(value) {
2401
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2402
+ var len0 = WASM_VECTOR_LEN;
2403
+ wasm.wasmcrawlconfig_set_bm25Query(this.__wbg_ptr, ptr0, len0);
2404
+ }
2405
+ /**
2406
+ * @param {number | null} [value]
2407
+ */
2408
+ set bm25Threshold(value) {
2409
+ wasm.wasmcrawlconfig_set_bm25Threshold(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
2410
+ }
2337
2411
  /**
2338
2412
  * @param {WasmBrowserConfig} value
2339
2413
  */
@@ -2364,12 +2438,24 @@ export class WasmCrawlConfig {
2364
2438
  var ptr0 = value.__destroy_into_raw();
2365
2439
  wasm.wasmcrawlconfig_set_content(this.__wbg_ptr, ptr0);
2366
2440
  }
2441
+ /**
2442
+ * @param {WasmContentFilterKind | null} [value]
2443
+ */
2444
+ set contentFilter(value) {
2445
+ wasm.wasmcrawlconfig_set_contentFilter(this.__wbg_ptr, isLikeNone(value) ? 1 : value);
2446
+ }
2367
2447
  /**
2368
2448
  * @param {boolean} value
2369
2449
  */
2370
2450
  set cookiesEnabled(value) {
2371
2451
  wasm.wasmcrawlconfig_set_cookiesEnabled(this.__wbg_ptr, value);
2372
2452
  }
2453
+ /**
2454
+ * @param {WasmCrawlStrategyKind} value
2455
+ */
2456
+ set crawlStrategy(value) {
2457
+ wasm.wasmcrawlconfig_set_crawlStrategy(this.__wbg_ptr, value);
2458
+ }
2373
2459
  /**
2374
2460
  * @param {any} value
2375
2461
  */
@@ -3360,6 +3446,21 @@ export class WasmCrawlResult {
3360
3446
  }
3361
3447
  if (Symbol.dispose) WasmCrawlResult.prototype[Symbol.dispose] = WasmCrawlResult.prototype.free;
3362
3448
 
3449
+ /**
3450
+ * Traversal order for a crawl.
3451
+ *
3452
+ * Selects both the queue discipline and the selection strategy, because global order is a
3453
+ * property of the frontier: the engine hands its bounded selection window to the strategy, so
3454
+ * a strategy alone can only reorder URLs that have already been dequeued.
3455
+ * @enum {0 | 1 | 2 | 3}
3456
+ */
3457
+ export const WasmCrawlStrategyKind = Object.freeze({
3458
+ Bfs: 0, "0": "Bfs",
3459
+ Dfs: 1, "1": "Dfs",
3460
+ BestFirst: 2, "2": "BestFirst",
3461
+ Adaptive: 3, "3": "Adaptive",
3462
+ });
3463
+
3363
3464
  /**
3364
3465
  * Opt-in encoding applied to a downloaded document's bytes for callers who need the
3365
3466
  * content available in a serializable field rather than reading it from disk.
@@ -7951,7 +8052,7 @@ export function __wbg_new_typed_cceaf62d8d95e9f2(arg0, arg1) {
7951
8052
  const a = state0.a;
7952
8053
  state0.a = 0;
7953
8054
  try {
7954
- return wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d(a, state0.b, arg0, arg1);
8055
+ return wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3(a, state0.b, arg0, arg1);
7955
8056
  } finally {
7956
8057
  state0.a = a;
7957
8058
  }
@@ -7974,10 +8075,18 @@ export function __wbg_next_8f26b64fa5e9f64b(arg0) {
7974
8075
  const ret = arg0.next;
7975
8076
  return ret;
7976
8077
  }
8078
+ export function __wbg_now_e7c6795a7f81e10f(arg0) {
8079
+ const ret = arg0.now();
8080
+ return ret;
8081
+ }
7977
8082
  export function __wbg_parse_1cc93481b0865939() { return handleError(function (arg0, arg1) {
7978
8083
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
7979
8084
  return ret;
7980
8085
  }, arguments); }
8086
+ export function __wbg_performance_3fcf6e32a7e1ed0a(arg0) {
8087
+ const ret = arg0.performance;
8088
+ return ret;
8089
+ }
7981
8090
  export function __wbg_prototypesetcall_de8e0d9553586985(arg0, arg1, arg2) {
7982
8091
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
7983
8092
  }
@@ -8231,13 +8340,13 @@ export function __wbg_wasmsitemapurl_unwrap(arg0) {
8231
8340
  return ret;
8232
8341
  }
8233
8342
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
8234
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 992, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
8235
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97);
8343
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1069, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
8344
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43);
8236
8345
  return ret;
8237
8346
  }
8238
8347
  export function __wbindgen_cast_0000000000000002(arg0, arg1) {
8239
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 882, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8240
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65);
8348
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 954, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8349
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f);
8241
8350
  return ret;
8242
8351
  }
8243
8352
  export function __wbindgen_cast_0000000000000003(arg0) {
@@ -8269,19 +8378,19 @@ export function __wbindgen_init_externref_table() {
8269
8378
  table.set(offset + 2, true);
8270
8379
  table.set(offset + 3, false);
8271
8380
  }
8272
- function wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65(arg0, arg1) {
8273
- wasm.wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65(arg0, arg1);
8381
+ function wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f(arg0, arg1) {
8382
+ wasm.wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f(arg0, arg1);
8274
8383
  }
8275
8384
 
8276
- function wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97(arg0, arg1, arg2) {
8277
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97(arg0, arg1, arg2);
8385
+ function wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43(arg0, arg1, arg2) {
8386
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43(arg0, arg1, arg2);
8278
8387
  if (ret[1]) {
8279
8388
  throw takeFromExternrefTable0(ret[0]);
8280
8389
  }
8281
8390
  }
8282
8391
 
8283
- function wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d(arg0, arg1, arg2, arg3) {
8284
- wasm.wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d(arg0, arg1, arg2, arg3);
8392
+ function wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3(arg0, arg1, arg2, arg3) {
8393
+ wasm.wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3(arg0, arg1, arg2, arg3);
8285
8394
  }
8286
8395
 
8287
8396
 
Binary file
@@ -203,11 +203,15 @@ export const wasmcookieinfo_value: (a: number) => [number, number];
203
203
  export const wasmcrawlconfig_allowSubdomains: (a: number) => number;
204
204
  export const wasmcrawlconfig_assetTypes: (a: number) => [number, number];
205
205
  export const wasmcrawlconfig_auth: (a: number) => any;
206
+ export const wasmcrawlconfig_bm25Query: (a: number) => [number, number];
207
+ export const wasmcrawlconfig_bm25Threshold: (a: number) => [number, number];
206
208
  export const wasmcrawlconfig_browser: (a: number) => number;
207
209
  export const wasmcrawlconfig_browserProfile: (a: number) => [number, number];
208
210
  export const wasmcrawlconfig_captureScreenshot: (a: number) => number;
209
211
  export const wasmcrawlconfig_content: (a: number) => number;
212
+ export const wasmcrawlconfig_contentFilter: (a: number) => [number, number];
210
213
  export const wasmcrawlconfig_cookiesEnabled: (a: number) => number;
214
+ export const wasmcrawlconfig_crawlStrategy: (a: number) => [number, number];
211
215
  export const wasmcrawlconfig_customHeaders: (a: number) => any;
212
216
  export const wasmcrawlconfig_default: () => number;
213
217
  export const wasmcrawlconfig_documentContentEncoding: (a: number) => [number, number];
@@ -229,8 +233,9 @@ export const wasmcrawlconfig_maxDepth: (a: number) => number;
229
233
  export const wasmcrawlconfig_maxLinksPerPage: (a: number) => number;
230
234
  export const wasmcrawlconfig_maxPages: (a: number) => number;
231
235
  export const wasmcrawlconfig_maxRedirects: (a: number) => number;
232
- export const wasmcrawlconfig_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: bigint, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: bigint, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: number, v1: number, w1: number, x1: number, y1: number, z1: number, a2: number, b2: number, c2: number, d2: number, e2: number) => number;
236
+ export const wasmcrawlconfig_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: bigint, u1: number, v1: number, w1: number, x1: number, y1: number, z1: number, a2: number, b2: number, c2: number, d2: number, e2: number, f2: number, g2: number, h2: number, i2: number, j2: number, k2: number) => number;
233
237
  export const wasmcrawlconfig_proxy: (a: number) => number;
238
+ export const wasmcrawlconfig_rateLimitMs: (a: number) => [number, bigint];
234
239
  export const wasmcrawlconfig_removeTags: (a: number) => [number, number];
235
240
  export const wasmcrawlconfig_respectRobotsTxt: (a: number) => number;
236
241
  export const wasmcrawlconfig_retryCodes: (a: number) => [number, number];
@@ -239,11 +244,15 @@ export const wasmcrawlconfig_saveBrowserProfile: (a: number) => number;
239
244
  export const wasmcrawlconfig_set_allowSubdomains: (a: number, b: number) => void;
240
245
  export const wasmcrawlconfig_set_assetTypes: (a: number, b: number, c: number) => void;
241
246
  export const wasmcrawlconfig_set_auth: (a: number, b: number) => void;
247
+ export const wasmcrawlconfig_set_bm25Query: (a: number, b: number, c: number) => void;
248
+ export const wasmcrawlconfig_set_bm25Threshold: (a: number, b: number, c: number) => void;
242
249
  export const wasmcrawlconfig_set_browser: (a: number, b: number) => void;
243
250
  export const wasmcrawlconfig_set_browserProfile: (a: number, b: number, c: number) => void;
244
251
  export const wasmcrawlconfig_set_captureScreenshot: (a: number, b: number) => void;
245
252
  export const wasmcrawlconfig_set_content: (a: number, b: number) => void;
253
+ export const wasmcrawlconfig_set_contentFilter: (a: number, b: number) => void;
246
254
  export const wasmcrawlconfig_set_cookiesEnabled: (a: number, b: number) => void;
255
+ export const wasmcrawlconfig_set_crawlStrategy: (a: number, b: number) => void;
247
256
  export const wasmcrawlconfig_set_customHeaders: (a: number, b: any) => void;
248
257
  export const wasmcrawlconfig_set_documentContentEncoding: (a: number, b: number) => void;
249
258
  export const wasmcrawlconfig_set_documentMaxSize: (a: number, b: number) => void;
@@ -265,6 +274,7 @@ export const wasmcrawlconfig_set_maxLinksPerPage: (a: number, b: number) => void
265
274
  export const wasmcrawlconfig_set_maxPages: (a: number, b: number) => void;
266
275
  export const wasmcrawlconfig_set_maxRedirects: (a: number, b: number) => void;
267
276
  export const wasmcrawlconfig_set_proxy: (a: number, b: number) => void;
277
+ export const wasmcrawlconfig_set_rateLimitMs: (a: number, b: number, c: bigint) => void;
268
278
  export const wasmcrawlconfig_set_removeTags: (a: number, b: number, c: number) => void;
269
279
  export const wasmcrawlconfig_set_respectRobotsTxt: (a: number, b: number) => void;
270
280
  export const wasmcrawlconfig_set_retryCodes: (a: number, b: number, c: number) => void;
@@ -381,14 +391,10 @@ export const wasmdownloadeddocument_size: (a: number) => number;
381
391
  export const wasmdownloadeddocument_truncated: (a: number) => number;
382
392
  export const wasmdownloadeddocument_url: (a: number) => [number, number];
383
393
  export const wasmextractionmeta_chunksProcessed: (a: number) => number;
384
- export const wasmextractionmeta_completionTokens: (a: number) => [number, bigint];
385
- export const wasmextractionmeta_cost: (a: number) => [number, number];
386
394
  export const wasmextractionmeta_default: () => number;
387
395
  export const wasmextractionmeta_model: (a: number) => [number, number];
388
396
  export const wasmextractionmeta_new: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: bigint, h: number, i: number) => number;
389
397
  export const wasmextractionmeta_set_chunksProcessed: (a: number, b: number) => void;
390
- export const wasmextractionmeta_set_completionTokens: (a: number, b: number, c: bigint) => void;
391
- export const wasmextractionmeta_set_cost: (a: number, b: number, c: number) => void;
392
398
  export const wasmextractionmeta_set_model: (a: number, b: number, c: number) => void;
393
399
  export const wasmfaviconinfo_mimeType: (a: number) => [number, number];
394
400
  export const wasmfaviconinfo_rel: (a: number) => [number, number];
@@ -682,11 +688,13 @@ export const wasmssrfpolicy_set_allowlist: (a: number, b: any) => void;
682
688
  export const wasmssrfpolicy_set_denyPrivate: (a: number, b: number) => void;
683
689
  export const wasmssrfpolicy_set_maxRedirects: (a: number, b: number) => void;
684
690
  export const wasmhostmatcher_new: () => number;
685
- export const wasmcrawlconfig_set_rateLimitMs: (a: number, b: number, c: bigint) => void;
691
+ export const wasmcrawlconfig_set_requestTimeout: (a: number, b: number, c: bigint) => void;
692
+ export const wasmextractionmeta_set_completionTokens: (a: number, b: number, c: bigint) => void;
686
693
  export const wasmextractionmeta_set_promptTokens: (a: number, b: number, c: bigint) => void;
687
694
  export const wasmpageaction_set_milliseconds: (a: number, b: number, c: bigint) => void;
688
- export const wasmcrawlconfig_rateLimitMs: (a: number) => [number, bigint];
689
695
  export const wasmcrawlconfig_requestTimeout: (a: number) => [number, bigint];
696
+ export const wasmextractionmeta_completionTokens: (a: number) => [number, bigint];
697
+ export const wasmextractionmeta_cost: (a: number) => [number, number];
690
698
  export const wasmextractionmeta_promptTokens: (a: number) => [number, bigint];
691
699
  export const wasmpageaction_amount: (a: number) => [number, bigint];
692
700
  export const wasmpageaction_milliseconds: (a: number) => [number, bigint];
@@ -708,13 +716,13 @@ export const wasmimageinfo_width: (a: number) => number;
708
716
  export const wasmpagemetadata_wordCount: (a: number) => number;
709
717
  export const wasmlinkinfo_nofollow: (a: number) => number;
710
718
  export const wasmauthconfig_new: () => number;
711
- export const wasmcrawlconfig_set_requestTimeout: (a: number, b: number, c: bigint) => void;
719
+ export const wasmextractionmeta_set_cost: (a: number, b: number, c: number) => void;
712
720
  export const wasmpageaction_set_amount: (a: number, b: number, c: bigint) => void;
713
721
  export const wasmscraperesult_set_crawlDelay: (a: number, b: number, c: bigint) => void;
714
722
  export const wasmpageaction_new: () => number;
715
- export const wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97: (a: number, b: number, c: any) => [number, number];
716
- export const wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d: (a: number, b: number, c: any, d: any) => void;
717
- export const wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65: (a: number, b: number) => void;
723
+ export const wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43: (a: number, b: number, c: any) => [number, number];
724
+ export const wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3: (a: number, b: number, c: any, d: any) => void;
725
+ export const wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f: (a: number, b: number) => void;
718
726
  export const __wbindgen_malloc: (a: number, b: number) => number;
719
727
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
720
728
  export const __wbindgen_exn_store: (a: number) => void;
@@ -2,7 +2,7 @@
2
2
  "name": "crawlberg-wasm",
3
3
  "type": "module",
4
4
  "description": "High-performance web crawling engine",
5
- "version": "1.2.1",
5
+ "version": "1.3.2",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -267,6 +267,13 @@ export class WasmContentConfig {
267
267
  wrapWidth: number;
268
268
  }
269
269
 
270
+ /**
271
+ * Content filter applied to each crawled page before it reaches the result.
272
+ */
273
+ export enum WasmContentFilterKind {
274
+ Bm25 = 0,
275
+ }
276
+
270
277
  /**
271
278
  * Information about an HTTP cookie received from a response.
272
279
  */
@@ -290,7 +297,7 @@ export class WasmCrawlConfig {
290
297
  free(): void;
291
298
  [Symbol.dispose](): void;
292
299
  static default(): WasmCrawlConfig;
293
- constructor(respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: any[] | null, browser?: WasmBrowserConfig | null, userAgents?: string[] | null, captureScreenshot?: boolean | null, followDocumentUrls?: boolean | null, downloadDocuments?: boolean | null, documentMimeTypes?: string[] | null, saveBrowserProfile?: boolean | null, ssrf?: WasmSsrfPolicy | null, maxDepth?: number | null, maxPages?: number | null, maxLinksPerPage?: number | null, maxConcurrent?: number | null, userAgent?: string | null, rateLimitMs?: bigint | null, auth?: any | null, maxBodySize?: number | null, mapLimit?: number | null, mapSearch?: string | null, maxAssetSize?: number | null, proxy?: WasmProxyConfig | null, documentUrlDepth?: number | null, documentMaxSize?: number | null, documentOutputDir?: string | null, documentContentEncoding?: WasmDocumentContentEncoding | null, warcOutput?: string | null, browserProfile?: string | null, ssrfDenyPrivateExplicit?: boolean | null);
300
+ constructor(crawlStrategy?: WasmCrawlStrategyKind | null, respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: any[] | null, browser?: WasmBrowserConfig | null, userAgents?: string[] | null, captureScreenshot?: boolean | null, followDocumentUrls?: boolean | null, downloadDocuments?: boolean | null, documentMimeTypes?: string[] | null, saveBrowserProfile?: boolean | null, ssrf?: WasmSsrfPolicy | null, maxDepth?: number | null, maxPages?: number | null, maxLinksPerPage?: number | null, maxConcurrent?: number | null, contentFilter?: WasmContentFilterKind | null, bm25Query?: string | null, bm25Threshold?: number | null, userAgent?: string | null, rateLimitMs?: bigint | null, auth?: any | null, maxBodySize?: number | null, mapLimit?: number | null, mapSearch?: string | null, maxAssetSize?: number | null, proxy?: WasmProxyConfig | null, documentUrlDepth?: number | null, documentMaxSize?: number | null, documentOutputDir?: string | null, documentContentEncoding?: WasmDocumentContentEncoding | null, warcOutput?: string | null, browserProfile?: string | null, ssrfDenyPrivateExplicit?: boolean | null);
294
301
  /**
295
302
  * Validate the configuration, returning an error if any values are invalid.
296
303
  */
@@ -299,12 +306,20 @@ export class WasmCrawlConfig {
299
306
  assetTypes: string[];
300
307
  get auth(): any | undefined;
301
308
  set auth(value: any | null | undefined);
309
+ get bm25Query(): string | undefined;
310
+ set bm25Query(value: string | null | undefined);
311
+ get bm25Threshold(): number | undefined;
312
+ set bm25Threshold(value: number | null | undefined);
302
313
  browser: WasmBrowserConfig;
303
314
  get browserProfile(): string | undefined;
304
315
  set browserProfile(value: string | null | undefined);
305
316
  captureScreenshot: boolean;
306
317
  content: WasmContentConfig;
318
+ get contentFilter(): string | undefined;
319
+ set contentFilter(value: WasmContentFilterKind | null | undefined);
307
320
  cookiesEnabled: boolean;
321
+ get crawlStrategy(): string;
322
+ set crawlStrategy(value: WasmCrawlStrategyKind);
308
323
  customHeaders: any;
309
324
  get documentContentEncoding(): string | undefined;
310
325
  set documentContentEncoding(value: WasmDocumentContentEncoding | null | undefined);
@@ -438,6 +453,20 @@ export class WasmCrawlResult {
438
453
  wasSkipped: boolean;
439
454
  }
440
455
 
456
+ /**
457
+ * Traversal order for a crawl.
458
+ *
459
+ * Selects both the queue discipline and the selection strategy, because global order is a
460
+ * property of the frontier: the engine hands its bounded selection window to the strategy, so
461
+ * a strategy alone can only reorder URLs that have already been dequeued.
462
+ */
463
+ export enum WasmCrawlStrategyKind {
464
+ Bfs = 0,
465
+ Dfs = 1,
466
+ BestFirst = 2,
467
+ Adaptive = 3,
468
+ }
469
+
441
470
  /**
442
471
  * Opt-in encoding applied to a downloaded document's bytes for callers who need the
443
472
  * content available in a serializable field rather than reading it from disk.