@openclaw/firecrawl-plugin 2026.8.1-beta.3 → 2026.8.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/dist/api.js +12 -11
- package/dist/{firecrawl-client-mz7GIgb4.js → firecrawl-client-BPFpIblh.js} +15 -22
- package/dist/{firecrawl-fetch-provider-shared-DlD5WG_i.js → firecrawl-fetch-provider-CIpxLKLq.js} +36 -1
- package/dist/{firecrawl-free-search-provider-BnGTMs5x.js → firecrawl-free-search-provider-BEyEhOfR.js} +3 -7
- package/dist/index.js +3 -3
- package/dist/web-fetch-contract-api.js +2 -11
- package/dist/web-fetch-provider.js +1 -1
- package/dist/web-search-contract-api.js +2 -15
- package/dist/web-search-provider.js +1 -1
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/package.json +5 -5
- package/dist/firecrawl-fetch-provider-kMXMNJJw.js +0 -38
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
package/dist/api.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { n as runFirecrawlScrape } from "./firecrawl-client-
|
|
1
|
+
import { n as runFirecrawlScrape } from "./firecrawl-client-BPFpIblh.js";
|
|
2
2
|
import { readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/firecrawl/api.ts
|
|
4
4
|
async function fetchFirecrawlContent(params) {
|
|
5
|
+
const cfg = { plugins: { entries: { firecrawl: {
|
|
6
|
+
enabled: true,
|
|
7
|
+
config: { webFetch: {
|
|
8
|
+
apiKey: params.apiKey,
|
|
9
|
+
baseUrl: params.baseUrl,
|
|
10
|
+
onlyMainContent: params.onlyMainContent,
|
|
11
|
+
maxAgeMs: params.maxAgeMs,
|
|
12
|
+
timeoutSeconds: params.timeoutSeconds
|
|
13
|
+
} }
|
|
14
|
+
} } } };
|
|
5
15
|
const result = await runFirecrawlScrape({
|
|
6
|
-
cfg
|
|
7
|
-
enabled: true,
|
|
8
|
-
config: { webFetch: {
|
|
9
|
-
apiKey: params.apiKey,
|
|
10
|
-
baseUrl: params.baseUrl,
|
|
11
|
-
onlyMainContent: params.onlyMainContent,
|
|
12
|
-
maxAgeMs: params.maxAgeMs,
|
|
13
|
-
timeoutSeconds: params.timeoutSeconds
|
|
14
|
-
} }
|
|
15
|
-
} } } },
|
|
16
|
+
cfg,
|
|
16
17
|
url: params.url,
|
|
17
18
|
extractMode: params.extractMode,
|
|
18
19
|
maxChars: params.maxChars,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveSiteName } from "openclaw/plugin-sdk/provider-web-search";
|
|
1
2
|
import { parseFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
|
|
2
3
|
import { readProviderJsonObjectResponse } from "openclaw/plugin-sdk/provider-http";
|
|
3
4
|
import { DEFAULT_CACHE_TTL_MINUTES, markdownToText, normalizeCacheKey, readCache, readResponseText, resolveCacheTtlMs, resolvePositiveTimeoutSeconds, withSelfHostedWebToolsEndpoint, withStrictWebToolsEndpoint, writeCache } from "openclaw/plugin-sdk/provider-web-fetch";
|
|
@@ -76,7 +77,8 @@ function resolveFirecrawlMaxAgeMs(cfg, override) {
|
|
|
76
77
|
return DEFAULT_FIRECRAWL_MAX_AGE_MS;
|
|
77
78
|
}
|
|
78
79
|
function resolveFirecrawlScrapeTimeoutSeconds(cfg, override) {
|
|
79
|
-
|
|
80
|
+
const fetch = resolveFirecrawlFetchConfig(cfg);
|
|
81
|
+
return resolvePositiveTimeoutSeconds(override, resolvePositiveTimeoutSeconds(fetch?.timeoutSeconds, DEFAULT_FIRECRAWL_SCRAPE_TIMEOUT_SECONDS));
|
|
80
82
|
}
|
|
81
83
|
function resolveFirecrawlSearchTimeoutSeconds(override) {
|
|
82
84
|
return resolvePositiveTimeoutSeconds(override, DEFAULT_FIRECRAWL_SEARCH_TIMEOUT_SECONDS);
|
|
@@ -97,14 +99,11 @@ const FIRECRAWL_SEARCH_MAX_CONTENT_CHARS = 2e4;
|
|
|
97
99
|
const DEFAULT_SCRAPE_MAX_CHARS = 5e4;
|
|
98
100
|
const FIRECRAWL_SCRAPE_METADATA_MAX_CHARS = 4e3;
|
|
99
101
|
const FIRECRAWL_RESULT_URL_MAX_CHARS = 2048;
|
|
100
|
-
const FIRECRAWL_SCRAPE_RESPONSE_MAX_BYTES =
|
|
102
|
+
const FIRECRAWL_SCRAPE_RESPONSE_MAX_BYTES = 67108864;
|
|
101
103
|
const ALLOWED_FIRECRAWL_HOSTS = /* @__PURE__ */ new Set(["api.firecrawl.dev"]);
|
|
102
104
|
const FIRECRAWL_PUBLISHED_DATE_RE = /^\d{4}-\d{2}-\d{2}(?:[T ][\d:.+Z-]{0,20})?$/u;
|
|
103
105
|
const FIRECRAWL_SELF_HOSTED_PRIVATE_ERROR = "Firecrawl custom baseUrl must target a private or internal self-hosted endpoint.";
|
|
104
106
|
const FIRECRAWL_HTTP_PRIVATE_ERROR = "Firecrawl HTTP baseUrl must target a private or internal self-hosted endpoint. Use https:// for public hosts.";
|
|
105
|
-
async function readFirecrawlJsonResponse(response, label, opts) {
|
|
106
|
-
return await readProviderJsonObjectResponse(response, label, opts);
|
|
107
|
-
}
|
|
108
107
|
function assertFirecrawlScrapeTargetAllowed(url) {
|
|
109
108
|
let parsed;
|
|
110
109
|
try {
|
|
@@ -197,13 +196,6 @@ async function postFirecrawlJson(params, parse) {
|
|
|
197
196
|
params.signal?.throwIfAborted();
|
|
198
197
|
return result;
|
|
199
198
|
}
|
|
200
|
-
function resolveSiteName(urlRaw) {
|
|
201
|
-
try {
|
|
202
|
-
return new URL(urlRaw).hostname.replace(/^www\./, "") || void 0;
|
|
203
|
-
} catch {
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
199
|
function normalizeFirecrawlResultUrl(value) {
|
|
208
200
|
if (typeof value !== "string" || value.length > FIRECRAWL_RESULT_URL_MAX_CHARS) return;
|
|
209
201
|
try {
|
|
@@ -276,7 +268,7 @@ function resolveSearchItems(payload) {
|
|
|
276
268
|
description,
|
|
277
269
|
content,
|
|
278
270
|
published,
|
|
279
|
-
siteName: resolveSiteName(url)
|
|
271
|
+
siteName: resolveSiteName(url)?.replace(/^www\./, "")
|
|
280
272
|
});
|
|
281
273
|
}
|
|
282
274
|
return items;
|
|
@@ -346,7 +338,8 @@ async function runFirecrawlSearch(params) {
|
|
|
346
338
|
country,
|
|
347
339
|
scrapeResults
|
|
348
340
|
}));
|
|
349
|
-
const
|
|
341
|
+
const cacheTtlMs = resolveCacheTtlMs(params.cfg?.tools?.web?.search?.cacheTtlMinutes, DEFAULT_CACHE_TTL_MINUTES);
|
|
342
|
+
const cached = readCache(SEARCH_CACHE, cacheKey, cacheTtlMs);
|
|
350
343
|
if (cached) return {
|
|
351
344
|
...cached.value,
|
|
352
345
|
cached: true
|
|
@@ -374,9 +367,10 @@ async function runFirecrawlSearch(params) {
|
|
|
374
367
|
errorLabel: "Firecrawl Search",
|
|
375
368
|
...params.signal ? { signal: params.signal } : {}
|
|
376
369
|
}, async (response) => {
|
|
377
|
-
const payloadValue = await
|
|
370
|
+
const payloadValue = await readProviderJsonObjectResponse(response, "Firecrawl Search API error");
|
|
378
371
|
if (payloadValue.success === false) {
|
|
379
|
-
const
|
|
372
|
+
const error = typeof payloadValue.error === "string" ? payloadValue.error : typeof payloadValue.message === "string" ? payloadValue.message : "unknown error";
|
|
373
|
+
const safeError = wrapWebContent(truncateSanitizedExternalContent(error, 1e3).text, "web_search");
|
|
380
374
|
throw new Error(`Firecrawl Search API error: ${safeError}`);
|
|
381
375
|
}
|
|
382
376
|
return payloadValue;
|
|
@@ -388,7 +382,7 @@ async function runFirecrawlSearch(params) {
|
|
|
388
382
|
tookMs: Date.now() - start,
|
|
389
383
|
scrapeResults
|
|
390
384
|
});
|
|
391
|
-
writeCache(SEARCH_CACHE, cacheKey, result,
|
|
385
|
+
writeCache(SEARCH_CACHE, cacheKey, result, cacheTtlMs);
|
|
392
386
|
return result;
|
|
393
387
|
}
|
|
394
388
|
function resolveScrapeData(payload) {
|
|
@@ -476,12 +470,12 @@ async function runFirecrawlScrape(params) {
|
|
|
476
470
|
storeInCache
|
|
477
471
|
}
|
|
478
472
|
}, async (response) => {
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
481
|
-
const detail = typeof
|
|
473
|
+
const data = await readProviderJsonObjectResponse(response, "Firecrawl fetch failed", { maxBytes: FIRECRAWL_SCRAPE_RESPONSE_MAX_BYTES });
|
|
474
|
+
if (data.success === false) {
|
|
475
|
+
const detail = typeof data.error === "string" ? data.error : typeof data.message === "string" ? data.message : response.statusText;
|
|
482
476
|
throw new Error(`Firecrawl fetch failed (${response.status}): ${wrapWebContent(truncateSanitizedExternalContent(detail, FIRECRAWL_SCRAPE_METADATA_MAX_CHARS).text, "web_fetch")}`.trim());
|
|
483
477
|
}
|
|
484
|
-
return
|
|
478
|
+
return data;
|
|
485
479
|
}),
|
|
486
480
|
url: params.url,
|
|
487
481
|
extractMode: params.extractMode,
|
|
@@ -492,7 +486,6 @@ const testing = {
|
|
|
492
486
|
assertFirecrawlScrapeTargetAllowed,
|
|
493
487
|
parseFirecrawlScrapePayload,
|
|
494
488
|
postFirecrawlJson,
|
|
495
|
-
readFirecrawlJsonResponse,
|
|
496
489
|
resolveEndpoint,
|
|
497
490
|
resolveSearchItems
|
|
498
491
|
};
|
package/dist/{firecrawl-fetch-provider-shared-DlD5WG_i.js → firecrawl-fetch-provider-CIpxLKLq.js}
RENAMED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
2
|
+
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
3
|
+
import { enablePluginInConfig } from "openclaw/plugin-sdk/provider-web-fetch-contract";
|
|
1
4
|
//#region extensions/firecrawl/src/firecrawl-fetch-provider-shared.ts
|
|
2
5
|
function ensureRecord(target, key) {
|
|
3
6
|
const current = target[key];
|
|
@@ -47,4 +50,36 @@ const FIRECRAWL_WEB_FETCH_PROVIDER_SHARED = {
|
|
|
47
50
|
}
|
|
48
51
|
};
|
|
49
52
|
//#endregion
|
|
50
|
-
|
|
53
|
+
//#region extensions/firecrawl/src/firecrawl-fetch-provider.ts
|
|
54
|
+
const loadFirecrawlClientModule = createLazyRuntimeModule(() => import("./firecrawl-client-BPFpIblh.js").then((n) => n.t));
|
|
55
|
+
function createFirecrawlWebFetchProvider() {
|
|
56
|
+
return {
|
|
57
|
+
...FIRECRAWL_WEB_FETCH_PROVIDER_SHARED,
|
|
58
|
+
applySelectionConfig: (config) => enablePluginInConfig(config, "firecrawl").config,
|
|
59
|
+
createTool: ({ config }) => ({
|
|
60
|
+
description: "Fetch a page using Firecrawl.",
|
|
61
|
+
parameters: {},
|
|
62
|
+
execute: async (args, executionContext) => {
|
|
63
|
+
executionContext?.signal?.throwIfAborted();
|
|
64
|
+
const url = typeof args.url === "string" ? args.url : "";
|
|
65
|
+
const extractMode = args.extractMode === "text" ? "text" : "markdown";
|
|
66
|
+
const maxChars = readPositiveIntegerParam(args, "maxChars");
|
|
67
|
+
const proxy = args.proxy === "basic" || args.proxy === "stealth" || args.proxy === "auto" ? args.proxy : void 0;
|
|
68
|
+
const storeInCache = typeof args.storeInCache === "boolean" ? args.storeInCache : void 0;
|
|
69
|
+
const { runFirecrawlScrape } = await loadFirecrawlClientModule();
|
|
70
|
+
return await runFirecrawlScrape({
|
|
71
|
+
cfg: config,
|
|
72
|
+
url,
|
|
73
|
+
extractMode,
|
|
74
|
+
access: "keyless",
|
|
75
|
+
maxChars,
|
|
76
|
+
...executionContext?.signal ? { signal: executionContext.signal } : {},
|
|
77
|
+
...proxy ? { proxy } : {},
|
|
78
|
+
...storeInCache !== void 0 ? { storeInCache } : {}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { createFirecrawlWebFetchProvider as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { buildFirecrawlFreeWebSearchProviderBase, buildFirecrawlWebSearchProviderBase } from "./web-search-shared.js";
|
|
2
|
-
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
3
2
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
3
|
+
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
4
4
|
//#region extensions/firecrawl/src/firecrawl-search-provider.ts
|
|
5
|
-
const loadFirecrawlClientModule$1 = createLazyRuntimeModule(() => import("./firecrawl-client-
|
|
5
|
+
const loadFirecrawlClientModule$1 = createLazyRuntimeModule(() => import("./firecrawl-client-BPFpIblh.js").then((n) => n.t));
|
|
6
6
|
const GenericFirecrawlSearchSchema = {
|
|
7
7
|
type: "object",
|
|
8
8
|
properties: {
|
|
@@ -43,11 +43,7 @@ function createFirecrawlWebSearchProvider() {
|
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region extensions/firecrawl/src/firecrawl-free-search-provider.ts
|
|
46
|
-
|
|
47
|
-
function loadFirecrawlClientModule() {
|
|
48
|
-
firecrawlClientModulePromise ??= import("./firecrawl-client-mz7GIgb4.js").then((n) => n.t);
|
|
49
|
-
return firecrawlClientModulePromise;
|
|
50
|
-
}
|
|
46
|
+
const loadFirecrawlClientModule = createLazyRuntimeModule(() => import("./firecrawl-client-BPFpIblh.js").then((n) => n.t));
|
|
51
47
|
function createFirecrawlFreeWebSearchProvider() {
|
|
52
48
|
return {
|
|
53
49
|
...buildFirecrawlFreeWebSearchProviderBase(),
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as runFirecrawlScrape, r as runFirecrawlSearch } from "./firecrawl-client-
|
|
2
|
-
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-
|
|
3
|
-
import { n as createFirecrawlWebSearchProvider, t as createFirecrawlFreeWebSearchProvider } from "./firecrawl-free-search-provider-
|
|
1
|
+
import { n as runFirecrawlScrape, r as runFirecrawlSearch } from "./firecrawl-client-BPFpIblh.js";
|
|
2
|
+
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-CIpxLKLq.js";
|
|
3
|
+
import { n as createFirecrawlWebSearchProvider, t as createFirecrawlFreeWebSearchProvider } from "./firecrawl-free-search-provider-BEyEhOfR.js";
|
|
4
4
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
5
5
|
import { optionalStringEnum } from "openclaw/plugin-sdk/channel-actions";
|
|
6
6
|
import { jsonResult, readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/provider-web-search";
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import
|
|
3
|
-
//#region extensions/firecrawl/web-fetch-contract-api.ts
|
|
4
|
-
function createFirecrawlWebFetchProvider() {
|
|
5
|
-
return {
|
|
6
|
-
...FIRECRAWL_WEB_FETCH_PROVIDER_SHARED,
|
|
7
|
-
applySelectionConfig: (config) => enablePluginInConfig(config, "firecrawl").config,
|
|
8
|
-
createTool: () => null
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
1
|
+
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-CIpxLKLq.js";
|
|
2
|
+
import "./web-fetch-provider.js";
|
|
12
3
|
export { createFirecrawlWebFetchProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-
|
|
1
|
+
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-CIpxLKLq.js";
|
|
2
2
|
export { createFirecrawlWebFetchProvider };
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function createFirecrawlWebSearchProvider() {
|
|
4
|
-
return {
|
|
5
|
-
...buildFirecrawlWebSearchProviderBase(),
|
|
6
|
-
createTool: () => null
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
function createFirecrawlFreeWebSearchProvider() {
|
|
10
|
-
return {
|
|
11
|
-
...buildFirecrawlFreeWebSearchProviderBase(),
|
|
12
|
-
createTool: () => null
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
1
|
+
import { n as createFirecrawlWebSearchProvider, t as createFirecrawlFreeWebSearchProvider } from "./firecrawl-free-search-provider-BEyEhOfR.js";
|
|
2
|
+
import "./web-search-provider.js";
|
|
16
3
|
export { createFirecrawlFreeWebSearchProvider, createFirecrawlWebSearchProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createFirecrawlWebSearchProvider, t as createFirecrawlFreeWebSearchProvider } from "./firecrawl-free-search-provider-
|
|
1
|
+
import { n as createFirecrawlWebSearchProvider, t as createFirecrawlFreeWebSearchProvider } from "./firecrawl-free-search-provider-BEyEhOfR.js";
|
|
2
2
|
export { createFirecrawlFreeWebSearchProvider, createFirecrawlWebSearchProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns true if the value is a ISO8601 DateTime string
|
|
3
|
-
* @
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
4
4
|
* @example `2020-12-12T20:20:40+00:00`
|
|
5
5
|
*/
|
|
6
|
-
export declare function IsDateTime(value: string
|
|
6
|
+
export declare function IsDateTime(value: string): boolean;
|
|
@@ -2,10 +2,10 @@ import { IsDate } from './date.mjs';
|
|
|
2
2
|
import { IsTime } from './time.mjs';
|
|
3
3
|
/**
|
|
4
4
|
* Returns true if the value is a ISO8601 DateTime string
|
|
5
|
-
* @
|
|
5
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
6
6
|
* @example `2020-12-12T20:20:40+00:00`
|
|
7
7
|
*/
|
|
8
|
-
export function IsDateTime(value
|
|
8
|
+
export function IsDateTime(value) {
|
|
9
9
|
const dateTime = value.split(/T/i);
|
|
10
|
-
return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]
|
|
10
|
+
return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]);
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const Email = /^(
|
|
1
|
+
const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an Email
|
|
4
|
-
* @specification
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc5322
|
|
5
5
|
*/
|
|
6
6
|
export function IsEmail(value) {
|
|
7
7
|
return Email.test(value);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as Idna from './
|
|
1
|
+
import * as Idna from './idna/index.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is a valid hostname.
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc1123
|
|
@@ -6,13 +6,5 @@ import * as Idna from './_idna.mjs';
|
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
7
7
|
*/
|
|
8
8
|
export function IsHostname(value) {
|
|
9
|
-
|
|
10
|
-
return false;
|
|
11
|
-
if (value.charCodeAt(value.length - 1) === 46)
|
|
12
|
-
return false;
|
|
13
|
-
for (const label of value.split('.')) {
|
|
14
|
-
if (!Idna.IsLabel(label))
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
9
|
+
return Idna.IsHostname(value);
|
|
18
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const IdnEmail = /^(
|
|
1
|
+
const IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is an IdnEmail
|
|
4
|
-
* @specification
|
|
4
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc4952
|
|
5
5
|
*/
|
|
6
6
|
export function IsIdnEmail(value) {
|
|
7
|
-
return IdnEmail.test(value);
|
|
7
|
+
return IdnEmail.test(value.normalize('NFC'));
|
|
8
8
|
}
|
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
* @specification https://tools.ietf.org/html/rfc3490
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
6
|
+
* @specification https://tools.ietf.org/html/rfc5893
|
|
6
7
|
*/
|
|
7
8
|
export declare function IsIdnHostname(value: string): boolean;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Idna from './idna/index.mjs';
|
|
2
2
|
/**
|
|
3
3
|
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
4
4
|
* @specification https://tools.ietf.org/html/rfc3490
|
|
5
5
|
* @specification https://tools.ietf.org/html/rfc5891
|
|
6
6
|
* @specification https://tools.ietf.org/html/rfc5892
|
|
7
|
+
* @specification https://tools.ietf.org/html/rfc5893
|
|
7
8
|
*/
|
|
8
9
|
export function IsIdnHostname(value) {
|
|
9
|
-
|
|
10
|
-
return false;
|
|
11
|
-
const canonical = value.normalize('NFC').replace(/[\u002E\u3002\uFF0E\uFF61]/g, '.');
|
|
12
|
-
if (canonical.length > 253)
|
|
13
|
-
return false;
|
|
14
|
-
for (const label of canonical.split('.')) {
|
|
15
|
-
if (!IsIdnLabel(label))
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return true;
|
|
10
|
+
return Idna.IsIdnHostname(value);
|
|
19
11
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import * as FormatPuny from './puny.mjs';
|
|
3
|
+
import * as Pattern from '../pattern/pattern.mjs';
|
|
4
|
+
// ------------------------------------------------------------------
|
|
5
|
+
// LOCAL REGEX: Allowed Bidi classes per direction (RFC 5893)
|
|
6
|
+
// ------------------------------------------------------------------
|
|
7
|
+
const RE_RTL_ALLOWED = /^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/;
|
|
8
|
+
const RE_LTR_ALLOWED = /^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/;
|
|
9
|
+
const RE_RTL_CLASSES = /^(?:R|AL|AN)$/;
|
|
10
|
+
// ------------------------------------------------------------------
|
|
11
|
+
// HasBidiChars
|
|
12
|
+
//
|
|
13
|
+
// Decodes a punycode label to its Unicode form (if it is one) and
|
|
14
|
+
// checks whether the result is an RTL label per RFC 5893 §1.4.
|
|
15
|
+
// ------------------------------------------------------------------
|
|
16
|
+
export function HasBidiChars(value) {
|
|
17
|
+
if (FormatPuny.IsAcePrefixed(value)) {
|
|
18
|
+
try {
|
|
19
|
+
return HasRightToLeftCharacters(FormatPuny.Decode(value.slice(4).toLowerCase()));
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return HasRightToLeftCharacters(value);
|
|
26
|
+
}
|
|
27
|
+
// ------------------------------------------------------------------
|
|
28
|
+
// GetBidiClass
|
|
29
|
+
// ------------------------------------------------------------------
|
|
30
|
+
function GetBidiClass(codePoint) {
|
|
31
|
+
const char = String.fromCodePoint(codePoint);
|
|
32
|
+
return (Pattern.RE_EUROPEAN_NUMBER.test(char) ? 'EN' :
|
|
33
|
+
Pattern.RE_ARABIC_INDIC_DIGIT.test(char) ? 'AN' :
|
|
34
|
+
// Pattern.RE_EUROPEAN_SEPARATOR.test(char) ? 'ES' : // (no-spec-coverage)
|
|
35
|
+
// Pattern.RE_COMMON_SEPARATOR.test(char) ? 'CS' : // (no-spec-coverage)
|
|
36
|
+
Pattern.RE_MARK_NONSPACING.test(char) ? 'NSM' :
|
|
37
|
+
Pattern.RE_SCRIPT_HEBREW.test(char) ? 'R' :
|
|
38
|
+
Pattern.RE_SCRIPT_ARABIC_LETTER.test(char) ? 'AL' :
|
|
39
|
+
Pattern.RE_LETTER.test(char) ? 'L' :
|
|
40
|
+
'ON');
|
|
41
|
+
}
|
|
42
|
+
// ------------------------------------------------------------------
|
|
43
|
+
// HasRightToLeftCharacters
|
|
44
|
+
//
|
|
45
|
+
// Per RFC 5893 §1.4: "An RTL label is a label that contains at least
|
|
46
|
+
// one character of type R, AL, or AN." Used to determine whether a
|
|
47
|
+
// domain name is a "Bidi domain name" (RFC 5893 §1.4), in which case
|
|
48
|
+
// the Bidi Rule applies to every label in the domain.
|
|
49
|
+
// ------------------------------------------------------------------
|
|
50
|
+
export function HasRightToLeftCharacters(value) {
|
|
51
|
+
for (const ch of value)
|
|
52
|
+
if (RE_RTL_CLASSES.test(GetBidiClass(ch.codePointAt(0))))
|
|
53
|
+
return true;
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
// ------------------------------------------------------------------
|
|
57
|
+
// SatisfiesBidiRule
|
|
58
|
+
// ------------------------------------------------------------------
|
|
59
|
+
export function SatisfiesBidiRule(value) {
|
|
60
|
+
let isRtl = false;
|
|
61
|
+
let allowed = RE_LTR_ALLOWED;
|
|
62
|
+
let sawEN = false;
|
|
63
|
+
let sawAN = false;
|
|
64
|
+
let isFirst = true;
|
|
65
|
+
// let lastClass: string | null = null // (no-spec-coverage)
|
|
66
|
+
for (const ch of value) {
|
|
67
|
+
const bidiClass = GetBidiClass(ch.codePointAt(0));
|
|
68
|
+
if (isFirst) {
|
|
69
|
+
// 1. The first character must be a character with Bidi property L, R, or AL.
|
|
70
|
+
if (bidiClass !== 'L' && bidiClass !== 'R' && bidiClass !== 'AL')
|
|
71
|
+
return false;
|
|
72
|
+
isRtl = bidiClass === 'R' || bidiClass === 'AL';
|
|
73
|
+
allowed = isRtl ? RE_RTL_ALLOWED : RE_LTR_ALLOWED;
|
|
74
|
+
isFirst = false;
|
|
75
|
+
}
|
|
76
|
+
// 2 / 5. Only characters in the allowed set for this direction may appear.
|
|
77
|
+
if (!allowed.test(bidiClass))
|
|
78
|
+
return false;
|
|
79
|
+
if (bidiClass === 'EN')
|
|
80
|
+
sawEN = true;
|
|
81
|
+
else if (bidiClass === 'AN')
|
|
82
|
+
sawAN = true;
|
|
83
|
+
// if (bidiClass !== 'NSM') lastClass = bidiClass // (no-spec-coverage)
|
|
84
|
+
}
|
|
85
|
+
if (isRtl && sawEN && sawAN)
|
|
86
|
+
return false; // spec coverage path
|
|
87
|
+
// (no-spec-coverage)
|
|
88
|
+
// if (isRtl) {
|
|
89
|
+
// // 3. The end of the label must be R, AL, EN, or AN (ignoring trailing NSM).
|
|
90
|
+
// // if (lastClass !== 'R' && lastClass !== 'AL' && lastClass !== 'EN' && lastClass !== 'AN') return false
|
|
91
|
+
// // 4. If an EN is present, no AN may be present, and vice versa.
|
|
92
|
+
// if (sawEN && sawAN) return false
|
|
93
|
+
// } else {
|
|
94
|
+
// // 6. The end of the label must be L or EN (ignoring trailing NSM).
|
|
95
|
+
// // if (lastClass !== 'L' && lastClass !== 'EN') return false
|
|
96
|
+
// }
|
|
97
|
+
return true;
|
|
98
|
+
}
|