@openclaw/firecrawl-plugin 2026.7.2-beta.2 → 2026.7.2-beta.4
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 +1 -1
- package/dist/{firecrawl-client-CPw_AuJR.js → firecrawl-client-DZohiNQK.js} +22 -51
- package/dist/{firecrawl-fetch-provider-D6Rj8lqo.js → firecrawl-fetch-provider-DXmd_5yB.js} +2 -2
- package/dist/{firecrawl-fetch-provider-shared-BQUWpKAv.js → firecrawl-fetch-provider-shared-BhzfHFkE.js} +1 -1
- package/dist/{firecrawl-free-search-provider-E4DXHcwh.js → firecrawl-free-search-provider-D_QqmJGK.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/web-fetch-contract-api.js +1 -1
- package/dist/web-fetch-provider.js +1 -1
- package/dist/web-search-provider.js +1 -1
- package/node_modules/typebox/build/compile/validator.d.mts +1 -4
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +5 -2
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +29 -32
- package/npm-shrinkwrap.json +6 -6
- package/openclaw.plugin.json +0 -3
- package/package.json +5 -5
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as runFirecrawlScrape } from "./firecrawl-client-
|
|
1
|
+
import { n as runFirecrawlScrape } from "./firecrawl-client-DZohiNQK.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) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readProviderJsonObjectResponse } from "openclaw/plugin-sdk/provider-http";
|
|
2
2
|
import { DEFAULT_CACHE_TTL_MINUTES, markdownToText, normalizeCacheKey, readCache, readResponseText, resolveCacheTtlMs, resolvePositiveTimeoutSeconds, truncateText, withSelfHostedWebToolsEndpoint, withStrictWebToolsEndpoint, writeCache } from "openclaw/plugin-sdk/provider-web-fetch";
|
|
3
3
|
import { normalizeSecretInput, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
4
4
|
import { wrapExternalContent, wrapWebContent } from "openclaw/plugin-sdk/security-runtime";
|
|
@@ -21,33 +21,13 @@ const DEFAULT_FIRECRAWL_SEARCH_TIMEOUT_SECONDS = 30;
|
|
|
21
21
|
const DEFAULT_FIRECRAWL_SCRAPE_TIMEOUT_SECONDS = 60;
|
|
22
22
|
const DEFAULT_FIRECRAWL_MAX_AGE_MS = 1728e5;
|
|
23
23
|
const FIRECRAWL_API_KEY_ENV_VAR = "FIRECRAWL_API_KEY";
|
|
24
|
-
function resolveSearchConfig(cfg) {
|
|
25
|
-
const search = cfg?.tools?.web?.search;
|
|
26
|
-
if (!search || typeof search !== "object") return;
|
|
27
|
-
return search;
|
|
28
|
-
}
|
|
29
|
-
function resolveFetchConfig(cfg) {
|
|
30
|
-
const fetch = cfg?.tools?.web?.fetch;
|
|
31
|
-
if (!fetch || typeof fetch !== "object") return;
|
|
32
|
-
return fetch;
|
|
33
|
-
}
|
|
34
24
|
function resolveFirecrawlSearchConfig(cfg) {
|
|
35
25
|
const pluginWebSearch = (cfg?.plugins?.entries?.firecrawl?.config)?.webSearch;
|
|
36
26
|
if (pluginWebSearch && typeof pluginWebSearch === "object" && !Array.isArray(pluginWebSearch)) return pluginWebSearch;
|
|
37
|
-
const search = resolveSearchConfig(cfg);
|
|
38
|
-
if (!search || typeof search !== "object") return;
|
|
39
|
-
const firecrawl = "firecrawl" in search ? search.firecrawl : void 0;
|
|
40
|
-
if (!firecrawl || typeof firecrawl !== "object") return;
|
|
41
|
-
return firecrawl;
|
|
42
27
|
}
|
|
43
28
|
function resolveFirecrawlFetchConfig(cfg) {
|
|
44
29
|
const pluginWebFetch = (cfg?.plugins?.entries?.firecrawl?.config)?.webFetch;
|
|
45
30
|
if (pluginWebFetch && typeof pluginWebFetch === "object" && !Array.isArray(pluginWebFetch)) return pluginWebFetch;
|
|
46
|
-
const fetch = resolveFetchConfig(cfg);
|
|
47
|
-
if (!fetch || typeof fetch !== "object") return;
|
|
48
|
-
const firecrawl = "firecrawl" in fetch ? fetch.firecrawl : void 0;
|
|
49
|
-
if (!firecrawl || typeof firecrawl !== "object") return;
|
|
50
|
-
return firecrawl;
|
|
51
31
|
}
|
|
52
32
|
function resolveConfiguredSecret(value, path, cfg) {
|
|
53
33
|
const resolved = resolveSecretInputString({
|
|
@@ -81,25 +61,13 @@ function resolveConfiguredSecret(value, path, cfg) {
|
|
|
81
61
|
function resolveFirecrawlApiKey(cfg) {
|
|
82
62
|
const pluginConfig = cfg?.plugins?.entries?.firecrawl?.config;
|
|
83
63
|
const search = resolveFirecrawlSearchConfig(cfg);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
value: search?.apiKey,
|
|
92
|
-
path: "plugins.entries.firecrawl.config.webSearch.apiKey"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
value: search?.apiKey,
|
|
96
|
-
path: "tools.web.search.firecrawl.apiKey"
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
value: fetch?.apiKey,
|
|
100
|
-
path: "tools.web.fetch.firecrawl.apiKey"
|
|
101
|
-
}
|
|
102
|
-
];
|
|
64
|
+
const configuredCandidates = [{
|
|
65
|
+
value: pluginConfig?.webFetch?.apiKey,
|
|
66
|
+
path: "plugins.entries.firecrawl.config.webFetch.apiKey"
|
|
67
|
+
}, {
|
|
68
|
+
value: search?.apiKey,
|
|
69
|
+
path: "plugins.entries.firecrawl.config.webSearch.apiKey"
|
|
70
|
+
}];
|
|
103
71
|
let blockedConfiguredSecret = false;
|
|
104
72
|
for (const candidate of configuredCandidates) {
|
|
105
73
|
const resolved = resolveConfiguredSecret(candidate.value, candidate.path, cfg);
|
|
@@ -151,7 +119,7 @@ const ALLOWED_FIRECRAWL_HOSTS = /* @__PURE__ */ new Set(["api.firecrawl.dev"]);
|
|
|
151
119
|
const FIRECRAWL_SELF_HOSTED_PRIVATE_ERROR = "Firecrawl custom baseUrl must target a private or internal self-hosted endpoint.";
|
|
152
120
|
const FIRECRAWL_HTTP_PRIVATE_ERROR = "Firecrawl HTTP baseUrl must target a private or internal self-hosted endpoint. Use https:// for public hosts.";
|
|
153
121
|
async function readFirecrawlJsonResponse(response, label, opts) {
|
|
154
|
-
return await
|
|
122
|
+
return await readProviderJsonObjectResponse(response, label, opts);
|
|
155
123
|
}
|
|
156
124
|
function assertFirecrawlScrapeTargetAllowed(url) {
|
|
157
125
|
let parsed;
|
|
@@ -395,14 +363,20 @@ function parseFirecrawlScrapePayload(params) {
|
|
|
395
363
|
source: "web_fetch",
|
|
396
364
|
includeWarning: false
|
|
397
365
|
});
|
|
366
|
+
const status = typeof metadata?.statusCode === "number" && metadata.statusCode || typeof data.statusCode === "number" && data.statusCode || void 0;
|
|
367
|
+
const title = typeof metadata?.title === "string" && metadata.title ? wrapExternalContent(metadata.title, {
|
|
368
|
+
source: "web_fetch",
|
|
369
|
+
includeWarning: false
|
|
370
|
+
}) : void 0;
|
|
371
|
+
const warning = typeof params.payload.warning === "string" && params.payload.warning ? wrapExternalContent(params.payload.warning, {
|
|
372
|
+
source: "web_fetch",
|
|
373
|
+
includeWarning: false
|
|
374
|
+
}) : void 0;
|
|
398
375
|
return {
|
|
399
376
|
url: params.url,
|
|
400
377
|
finalUrl: typeof metadata?.sourceURL === "string" && metadata.sourceURL || typeof data.url === "string" && data.url || params.url,
|
|
401
|
-
status
|
|
402
|
-
title
|
|
403
|
-
source: "web_fetch",
|
|
404
|
-
includeWarning: false
|
|
405
|
-
}) : void 0,
|
|
378
|
+
...status !== void 0 ? { status } : {},
|
|
379
|
+
...title ? { title } : {},
|
|
406
380
|
extractor: "firecrawl",
|
|
407
381
|
extractMode: params.extractMode,
|
|
408
382
|
externalContent: {
|
|
@@ -412,12 +386,9 @@ function parseFirecrawlScrapePayload(params) {
|
|
|
412
386
|
},
|
|
413
387
|
truncated: truncated.truncated,
|
|
414
388
|
rawLength: rawText.length,
|
|
415
|
-
|
|
389
|
+
length: wrappedText.length,
|
|
416
390
|
text: wrappedText,
|
|
417
|
-
warning
|
|
418
|
-
source: "web_fetch",
|
|
419
|
-
includeWarning: false
|
|
420
|
-
}) : void 0
|
|
391
|
+
...warning ? { warning } : {}
|
|
421
392
|
};
|
|
422
393
|
}
|
|
423
394
|
async function runFirecrawlScrape(params) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as FIRECRAWL_WEB_FETCH_PROVIDER_SHARED } from "./firecrawl-fetch-provider-shared-
|
|
1
|
+
import { t as FIRECRAWL_WEB_FETCH_PROVIDER_SHARED } from "./firecrawl-fetch-provider-shared-BhzfHFkE.js";
|
|
2
2
|
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
3
3
|
import { enablePluginInConfig } from "openclaw/plugin-sdk/provider-web-fetch-contract";
|
|
4
4
|
//#region extensions/firecrawl/src/firecrawl-fetch-provider.ts
|
|
5
5
|
let firecrawlClientModulePromise;
|
|
6
6
|
function loadFirecrawlClientModule() {
|
|
7
|
-
firecrawlClientModulePromise ??= import("./firecrawl-client-
|
|
7
|
+
firecrawlClientModulePromise ??= import("./firecrawl-client-DZohiNQK.js").then((n) => n.t);
|
|
8
8
|
return firecrawlClientModulePromise;
|
|
9
9
|
}
|
|
10
10
|
function createFirecrawlWebFetchProvider() {
|
|
@@ -18,7 +18,7 @@ const FIRECRAWL_WEB_FETCH_PROVIDER_SHARED = {
|
|
|
18
18
|
docsUrl: "https://docs.firecrawl.dev",
|
|
19
19
|
autoDetectOrder: 50,
|
|
20
20
|
credentialPath: "plugins.entries.firecrawl.config.webFetch.apiKey",
|
|
21
|
-
inactiveSecretPaths: ["plugins.entries.firecrawl.config.webFetch.apiKey"
|
|
21
|
+
inactiveSecretPaths: ["plugins.entries.firecrawl.config.webFetch.apiKey"],
|
|
22
22
|
getCredentialValue: (fetchConfig) => {
|
|
23
23
|
if (!fetchConfig || typeof fetchConfig !== "object") return;
|
|
24
24
|
const legacy = fetchConfig.firecrawl;
|
|
@@ -2,7 +2,7 @@ import { buildFirecrawlFreeWebSearchProviderBase, buildFirecrawlWebSearchProvide
|
|
|
2
2
|
import { readPositiveIntegerParam } from "openclaw/plugin-sdk/param-readers";
|
|
3
3
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
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-DZohiNQK.js").then((n) => n.t));
|
|
6
6
|
const GenericFirecrawlSearchSchema = {
|
|
7
7
|
type: "object",
|
|
8
8
|
properties: {
|
|
@@ -43,7 +43,7 @@ function createFirecrawlWebSearchProvider() {
|
|
|
43
43
|
//#region extensions/firecrawl/src/firecrawl-free-search-provider.ts
|
|
44
44
|
let firecrawlClientModulePromise;
|
|
45
45
|
function loadFirecrawlClientModule() {
|
|
46
|
-
firecrawlClientModulePromise ??= import("./firecrawl-client-
|
|
46
|
+
firecrawlClientModulePromise ??= import("./firecrawl-client-DZohiNQK.js").then((n) => n.t);
|
|
47
47
|
return firecrawlClientModulePromise;
|
|
48
48
|
}
|
|
49
49
|
function createFirecrawlFreeWebSearchProvider() {
|
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-DZohiNQK.js";
|
|
2
|
+
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-DXmd_5yB.js";
|
|
3
|
+
import { n as createFirecrawlWebSearchProvider, t as createFirecrawlFreeWebSearchProvider } from "./firecrawl-free-search-provider-D_QqmJGK.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,4 +1,4 @@
|
|
|
1
|
-
import { t as FIRECRAWL_WEB_FETCH_PROVIDER_SHARED } from "./firecrawl-fetch-provider-shared-
|
|
1
|
+
import { t as FIRECRAWL_WEB_FETCH_PROVIDER_SHARED } from "./firecrawl-fetch-provider-shared-BhzfHFkE.js";
|
|
2
2
|
import { enablePluginInConfig } from "openclaw/plugin-sdk/provider-web-fetch-contract";
|
|
3
3
|
//#region extensions/firecrawl/web-fetch-contract-api.ts
|
|
4
4
|
function createFirecrawlWebFetchProvider() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-
|
|
1
|
+
import { t as createFirecrawlWebFetchProvider } from "./firecrawl-fetch-provider-DXmd_5yB.js";
|
|
2
2
|
export { createFirecrawlWebFetchProvider };
|
|
@@ -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-D_QqmJGK.js";
|
|
2
2
|
export { createFirecrawlFreeWebSearchProvider, createFirecrawlWebSearchProvider };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { type TLocalizedValidationError } from '../error/index.mjs';
|
|
2
2
|
import { type StaticDecode, type StaticEncode, type TProperties, type TSchema } from '../type/index.mjs';
|
|
3
|
-
import { BuildResult, EvaluateResult } from '../schema/index.mjs';
|
|
4
3
|
export declare class Validator<Context extends TProperties = TProperties, Type extends TSchema = TSchema, Encode extends unknown = StaticEncode<Type, Context>, Decode extends unknown = StaticDecode<Type, Context>> {
|
|
5
4
|
private readonly hasCodec;
|
|
6
5
|
private readonly buildResult;
|
|
7
6
|
private readonly evaluateResult;
|
|
8
|
-
/** Constructs a Validator
|
|
7
|
+
/** Constructs a Validator. */
|
|
9
8
|
constructor(context: Context, type: Type);
|
|
10
|
-
/** Constructs a Validator with the given arguments. */
|
|
11
|
-
constructor(hasCodec: boolean, buildResult: BuildResult, evaluateResult: EvaluateResult);
|
|
12
9
|
/** Returns true if this Validator is using JIT acceleration. */
|
|
13
10
|
IsAccelerated(): boolean;
|
|
14
11
|
/** Returns the Context for this validator. */
|
|
@@ -61,5 +61,5 @@ export declare function Keys(value: Record<PropertyKey, unknown>): string[];
|
|
|
61
61
|
export declare function Symbols(value: Record<PropertyKey, unknown>): symbol[];
|
|
62
62
|
/** Returns the property values for the given object via `Object.values()` */
|
|
63
63
|
export declare function Values(value: Record<PropertyKey, unknown>): unknown[];
|
|
64
|
-
/**
|
|
64
|
+
/** Returns true if left and right values are structurally equal */
|
|
65
65
|
export declare function IsDeepEqual(left: unknown, right: unknown): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
1
2
|
import * as String from './string.mjs';
|
|
2
3
|
// --------------------------------------------------------------------------
|
|
3
4
|
// Guards
|
|
@@ -203,7 +204,9 @@ function DeepEqualArray(left, right) {
|
|
|
203
204
|
return IsArray(right) && IsEqual(left.length, right.length) &&
|
|
204
205
|
left.every((_, index) => IsDeepEqual(left[index], right[index]));
|
|
205
206
|
}
|
|
206
|
-
/**
|
|
207
|
+
/** Returns true if left and right values are structurally equal */
|
|
207
208
|
export function IsDeepEqual(left, right) {
|
|
208
|
-
return (IsArray(left) ? DeepEqualArray(left, right) :
|
|
209
|
+
return (IsArray(left) ? DeepEqualArray(left, right) :
|
|
210
|
+
IsObject(left) ? DeepEqualObject(left, right) :
|
|
211
|
+
IsEqual(left, right));
|
|
209
212
|
}
|
|
@@ -5,6 +5,18 @@ function IsBetween(value, min, max) {
|
|
|
5
5
|
return value >= min && value <= max;
|
|
6
6
|
}
|
|
7
7
|
// --------------------------------------------------------------------------
|
|
8
|
+
// IsZeroWidthJoiner
|
|
9
|
+
// --------------------------------------------------------------------------
|
|
10
|
+
function IsZeroWidthJoiner(value) {
|
|
11
|
+
return (value === 0x200D);
|
|
12
|
+
}
|
|
13
|
+
// --------------------------------------------------------------------------
|
|
14
|
+
// IsHighSurrogate
|
|
15
|
+
// --------------------------------------------------------------------------
|
|
16
|
+
function IsHighSurrogate(value) {
|
|
17
|
+
return IsBetween(value, 0xD800, 0xDBFF);
|
|
18
|
+
}
|
|
19
|
+
// --------------------------------------------------------------------------
|
|
8
20
|
// IsRegionalIndicator
|
|
9
21
|
// --------------------------------------------------------------------------
|
|
10
22
|
function IsRegionalIndicator(value) {
|
|
@@ -72,10 +84,10 @@ function NextGraphemeClusterIndex(value, clusterStart) {
|
|
|
72
84
|
// IsGraphemeCodePoint
|
|
73
85
|
// --------------------------------------------------------------------------
|
|
74
86
|
function IsGraphemeCodePoint(value) {
|
|
75
|
-
return (
|
|
76
|
-
|
|
77
|
-
(value
|
|
78
|
-
|
|
87
|
+
return (IsHighSurrogate(value) ||
|
|
88
|
+
IsCombiningMark(value) ||
|
|
89
|
+
IsVariationSelector(value) ||
|
|
90
|
+
IsZeroWidthJoiner(value));
|
|
79
91
|
}
|
|
80
92
|
// --------------------------------------------------------------------------
|
|
81
93
|
// GraphemeCount
|
|
@@ -1,47 +1,66 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import * as Schema from '../types/index.mjs';
|
|
3
2
|
import { Hashing } from '../../system/hashing/index.mjs';
|
|
4
3
|
import { EmitGuard as E } from '../../guard/index.mjs';
|
|
5
4
|
import { BuildSchema } from './schema.mjs';
|
|
6
|
-
const
|
|
5
|
+
const index = [0];
|
|
6
|
+
const names = new Map;
|
|
7
|
+
const funcs = new Map();
|
|
8
|
+
// ------------------------------------------------------------------
|
|
9
|
+
// CreateName
|
|
10
|
+
// ------------------------------------------------------------------
|
|
11
|
+
function NextName() {
|
|
12
|
+
return Hashing.Hash(index[0]++);
|
|
13
|
+
}
|
|
14
|
+
function CreateName(schema, href) {
|
|
15
|
+
if (!names.has(schema))
|
|
16
|
+
names.set(schema, new Map());
|
|
17
|
+
const hrefs = names.get(schema);
|
|
18
|
+
if (hrefs.has(href))
|
|
19
|
+
return hrefs.get(href);
|
|
20
|
+
const name = NextName();
|
|
21
|
+
hrefs.set(href, name);
|
|
22
|
+
return name;
|
|
23
|
+
}
|
|
7
24
|
// ------------------------------------------------------------------
|
|
8
25
|
// CreateCallExpression
|
|
9
26
|
// ------------------------------------------------------------------
|
|
10
|
-
function CreateCallExpression(context, _schema,
|
|
27
|
+
function CreateCallExpression(context, _schema, name, value) {
|
|
11
28
|
return context.UseUnevaluated()
|
|
12
|
-
? E.Call(`check_${
|
|
13
|
-
: E.Call(`check_${
|
|
29
|
+
? E.Call(`check_${name}`, ['context', value])
|
|
30
|
+
: E.Call(`check_${name}`, [value]);
|
|
14
31
|
}
|
|
15
32
|
// ------------------------------------------------------------------
|
|
16
33
|
// CreateFunctionExpression
|
|
17
34
|
// ------------------------------------------------------------------
|
|
18
|
-
function CreateFunctionExpression(stack, context, schema,
|
|
35
|
+
function CreateFunctionExpression(stack, context, schema, name) {
|
|
19
36
|
const expression = BuildSchema(stack, context, schema, 'value');
|
|
20
37
|
return context.UseUnevaluated()
|
|
21
|
-
? E.ConstDeclaration(`check_${
|
|
22
|
-
: E.ConstDeclaration(`check_${
|
|
38
|
+
? E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['context', 'value'], expression))
|
|
39
|
+
: E.ConstDeclaration(`check_${name}`, E.ArrowFunction(['value'], expression));
|
|
23
40
|
}
|
|
24
41
|
// ------------------------------------------------------------------
|
|
25
42
|
// ResetFunctions
|
|
26
43
|
// ------------------------------------------------------------------
|
|
27
44
|
export function ResetFunctions() {
|
|
28
|
-
|
|
45
|
+
index[0] = 0;
|
|
46
|
+
names.clear();
|
|
47
|
+
funcs.clear();
|
|
29
48
|
}
|
|
30
49
|
// ------------------------------------------------------------------
|
|
31
50
|
// GetFunctions
|
|
32
51
|
// ------------------------------------------------------------------
|
|
33
52
|
export function GetFunctions() {
|
|
34
|
-
return [...
|
|
53
|
+
return [...funcs.values()];
|
|
35
54
|
}
|
|
36
55
|
// ------------------------------------------------------------------
|
|
37
56
|
// CreateFunction
|
|
38
57
|
// ------------------------------------------------------------------
|
|
39
58
|
export function CreateFunction(stack, context, schema, value) {
|
|
40
|
-
const
|
|
41
|
-
const call = CreateCallExpression(context, schema,
|
|
42
|
-
if (
|
|
59
|
+
const name = CreateName(schema, stack.BaseURL().href);
|
|
60
|
+
const call = CreateCallExpression(context, schema, name, value);
|
|
61
|
+
if (funcs.has(name))
|
|
43
62
|
return call;
|
|
44
|
-
|
|
45
|
-
|
|
63
|
+
funcs.set(name, '');
|
|
64
|
+
funcs.set(name, CreateFunctionExpression(stack, context, schema, name));
|
|
46
65
|
return call;
|
|
47
66
|
}
|
|
@@ -9,3 +9,8 @@ export declare function ReadonlyObjectDeferred<Type extends TSchema>(type: Type,
|
|
|
9
9
|
export type TReadonlyObject<Type extends TSchema> = (TReadonlyObjectAction<Type>);
|
|
10
10
|
/** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */
|
|
11
11
|
export declare function ReadonlyObject<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReadonlyObject<Type>;
|
|
12
|
+
/**
|
|
13
|
+
* This type has been renamed to ReadonlyObject.
|
|
14
|
+
* @deprecated
|
|
15
|
+
*/
|
|
16
|
+
export declare const ReadonlyType: typeof ReadonlyObject;
|
|
@@ -9,3 +9,11 @@ export function ReadonlyObjectDeferred(type, options = {}) {
|
|
|
9
9
|
export function ReadonlyObject(type, options = {}) {
|
|
10
10
|
return ReadonlyObjectAction(type, options);
|
|
11
11
|
}
|
|
12
|
+
// ------------------------------------------------------------------
|
|
13
|
+
// Alias
|
|
14
|
+
// ------------------------------------------------------------------
|
|
15
|
+
/**
|
|
16
|
+
* This type has been renamed to ReadonlyObject.
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
19
|
+
export const ReadonlyType = ReadonlyObject;
|
|
@@ -19,7 +19,7 @@ export { Omit, type TOmit, type TOmitDeferred } from './type/action/omit.mjs';
|
|
|
19
19
|
export { Parameters, type TParameters, type TParametersDeferred } from './type/action/parameters.mjs';
|
|
20
20
|
export { Partial, type TPartial, type TPartialDeferred } from './type/action/partial.mjs';
|
|
21
21
|
export { Pick, type TPick, type TPickDeferred } from './type/action/pick.mjs';
|
|
22
|
-
export { ReadonlyObject, type TReadonlyObject, type TReadonlyObjectDeferred } from './type/action/readonly_object.mjs';
|
|
22
|
+
export { ReadonlyObject, ReadonlyType, type TReadonlyObject, type TReadonlyObjectDeferred } from './type/action/readonly_object.mjs';
|
|
23
23
|
export { Required, type TRequired, type TRequiredDeferred } from './type/action/required.mjs';
|
|
24
24
|
export { ReturnType, type TReturnType, type TReturnTypeDeferred } from './type/action/return_type.mjs';
|
|
25
25
|
export { type TUncapitalize, type TUncapitalizeDeferred, Uncapitalize } from './type/action/uncapitalize.mjs';
|
|
@@ -31,7 +31,7 @@ export { Omit } from './type/action/omit.mjs';
|
|
|
31
31
|
export { Parameters } from './type/action/parameters.mjs';
|
|
32
32
|
export { Partial } from './type/action/partial.mjs';
|
|
33
33
|
export { Pick } from './type/action/pick.mjs';
|
|
34
|
-
export { ReadonlyObject } from './type/action/readonly_object.mjs';
|
|
34
|
+
export { ReadonlyObject, ReadonlyType } from './type/action/readonly_object.mjs';
|
|
35
35
|
export { Required } from './type/action/required.mjs';
|
|
36
36
|
export { ReturnType } from './type/action/return_type.mjs';
|
|
37
37
|
export { Uncapitalize } from './type/action/uncapitalize.mjs';
|
|
@@ -111,27 +111,24 @@ type User = Type.Static<typeof User> // type User = {
|
|
|
111
111
|
|
|
112
112
|
## Script
|
|
113
113
|
|
|
114
|
-
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play/?target=99&module=7#code/
|
|
115
|
-
|
|
116
|
-
TypeBox includes a syntax engine that can transform TypeScript declarations into JSON Schema. The engine is a full syntactic frontend to Type.* and supports many advanced type-level constructs such as Conditional, Mapped, Indexed, Infer, Generics, Distributed types and more. This feature is implemented symmetrically at runtime and statically via TypeScript Template Literal types.
|
|
117
|
-
|
|
118
|
-
Syntax highlighting is available via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sinclairzx81.typebox-script)
|
|
114
|
+
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFkIATAVwBtVKBjCAOwDO8BgEMYACzgBeREQB0AZW5RgYGAAoABpThxCaOADVU3GNABM0uAG84ZAFxw+rEMVRQANHCSPnr93AAvjp6REYmZlAAzFa2Dk4ubp7evonuXgBeqf5QQSH66Mam0AAssXbZSV4+CTmZlelwAO4NucGaAJTUdHAAIqhofMyofMIsHFy8gvC2DKgCkoFWyGiKyqoaohJemrr5YcawqGSxIbqQAsAwwPyORZElHmdO0CAi7HcR0FFPurqsADdPsUoOYQsFdAU4ABxVA4VAwKBIU5-OAA9zXbjzT5HMgAbQAur8-sAhsAsQJWoTwfsDFt3MB3ii-iJXMARjBgQ9ibpmMAMBhWAJUFzSjy4AI0NwOCIoKKoCUaZCwnMFszdABzOEgBFIxyw+GIpDit4wBnvRz0lTvGmdbr0ABKrFGoHQDtQGE4phufEoqvEcjA2DQsHZAjkWsNSMDwYxYbk6NDFLkV1QIHDQYgIeu80DEEu134MazcdzZD98wDmez8cjOqNxZrucTmNzqfTjdL4b4r3endDZYrC37OfDdd1SBH8Zb5LbZo71a7ckBU8H-tX4dN5vYG7kfIFQtQu-L68XA83Ym3u9ZxHZo2PQ6rsfPci31p3Z9HcklJhlUAftD0AoMBiOScAAJJ8Bg7gjFilCCnw3r8HAUAjMMUDqDqCyOCsR7AaB3AADwFBAGCMJWAB8HQ2CEWEBuODYzhSeIAAwEnmBY+nI5a6HREbahOCZxsxbFyD2UBvDuPFwHxDHRkx8ysexK7SXxb6Mju+6CsK3G0ZWr6Xu+cg3neMC6bx+nqX2P7Suwsq6YEQA) | [Example 2](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFkIATAVwBtVKA7AQxFQBnMLwDG6BrxgALOAG9KcOKjKRYcURG6D4ANVSiY0AExwAvIiIA6APLEAVgZgAKOXDIAuS2isA5ViDEqFDOAJQANHBIXsg+-oHBYXAAvqGKyqrQ8Jraek7QAMzm3qi2Dk6u7jHW8UEhEVHVcQF1YZEAXk2ltYmhKWlKKmrZWjpw+obQACzFsaV2joaVniV+Lb2R0as99R1dawm7cADu+ztJqZTJ1HRwACKoaNzMqNzwTGyclDlj+rAqs2sCwqCiUkEEwBgwC0XkkMisEyMUCm4XS3GgIF47FhUmkCPyUAKqKUrAAbjj4YiTFc0j94ABxVA4VAwKBIQE+YFLUFwUnBKHiQT7ACCUCgvCQzj+MBUEXSwGewEFIrFEuccwOrVCaUudMYUmCwCxHPm5W56X4xGArxgFLxVORxLgzGAGAwrEEqDt+MmjvSwgMHF4UG9DqmNO+o3eQlkFg1XJcPIA5kyBKytozmemnZiZVAjdj9XmCxHaPQAEqsN6gdDl1AYTiGaHcSgMGNWMDYNCwa2CKwprNsjtd-m9qx8nuCqyQ1AgPudiDdqFCDsQCFQrTDxejldkVvthdLscDtNDw87vsTgUrmdzrdHlfoqCY9j3i9WPdtwR4889lcnlkzxHP9L1HKdb3nYDlz7Mk3xAj992-ODoKsXNDSxZCxxdN0PVKX8UM-A8oLHND8ww-Cx0ta03kw3dEJ-YiV1IgtaL7ANRCDKBWIQss4AAZRgKQlTgABJbgMGCV5xEod1uCbLQ4CgV4XhCARv32AShNEAAeQg0AgDBGBjAA+PoeTUvEAPTccwKEABtAAGABdVd12bBClAs-tU0ApAbMneznKsJ8Xw8uAvKsocryVQKXNgvdPPbZiMOw91PTCrzktfKibQypKDTI192M4hDkiAA) | [Challenge](test/typescript/readme.md)
|
|
119
115
|
|
|
116
|
+
TypeBox includes a runtime scripting engine that can transform TypeScript definitions into JSON Schema. The engine is implemented symmetrically at runtime and inside TypeScript's type system. It supports many programmable type-level constructs such as Conditional, Mapped, Indexed, Generic, Distributive Conditional, and more. The engine is designed for TypeScript 7 but is supported in TypeScript 5 and above.
|
|
120
117
|
|
|
121
118
|
### Example
|
|
122
119
|
|
|
123
|
-
|
|
120
|
+
Syntax highlighting is available via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sinclairzx81.typebox-script)
|
|
124
121
|
|
|
125
122
|
```typescript
|
|
126
123
|
// Module
|
|
127
124
|
const Math = Type.Script(`
|
|
128
125
|
type Vector2 = { x: number, y: number }
|
|
129
|
-
type Vector3 =
|
|
130
|
-
type Vector4 =
|
|
126
|
+
type Vector3 = { x: number, y: number, z: number }
|
|
127
|
+
type Vector4 = { x: number, y: number, z: number, w: number }
|
|
131
128
|
`)
|
|
132
129
|
|
|
133
130
|
// Dependent Module
|
|
134
|
-
const { Mesh } = Type.Script(
|
|
131
|
+
const { Mesh } = Type.Script(Math, `
|
|
135
132
|
type Vertex = {
|
|
136
133
|
position: Vector4,
|
|
137
134
|
normal: Vector3,
|
|
@@ -298,29 +295,29 @@ The following table shows compile performance for various JSON Schema structures
|
|
|
298
295
|
┌──────────────────────┬─────────────┬─────────────┐
|
|
299
296
|
│ Compile │ TB1X │ AJV8 │
|
|
300
297
|
├──────────────────────┼─────────────┼─────────────┤
|
|
301
|
-
│ Boolean │
|
|
302
|
-
│ Number │
|
|
303
|
-
│ String │
|
|
304
|
-
│ Null │
|
|
305
|
-
│ Literal_String │
|
|
306
|
-
│ Literal_Number │
|
|
307
|
-
│ Literal_Boolean │
|
|
308
|
-
│ Pattern │
|
|
309
|
-
│ Object_Open │
|
|
310
|
-
│ Object_Close │
|
|
311
|
-
│ Object_Vector3 │
|
|
312
|
-
│ Object_Basis3 │
|
|
313
|
-
│ Intersect_And │
|
|
314
|
-
│ Intersect_Structural │
|
|
315
|
-
│ Union_Or │
|
|
316
|
-
│ Union_Structural │
|
|
317
|
-
│ Tuple_Values │
|
|
318
|
-
│ Tuple_Objects │
|
|
319
|
-
│ Array_Numbers_4 │
|
|
320
|
-
│ Array_Numbers_8 │
|
|
321
|
-
│ Array_Numbers_16 │
|
|
322
|
-
│ Array_Objects_Open │
|
|
323
|
-
│ Array_Objects_Close │
|
|
298
|
+
│ Boolean │ 39.7K ops/s │ 6.8K ops/s │
|
|
299
|
+
│ Number │ 86.2K ops/s │ 7.5K ops/s │
|
|
300
|
+
│ String │ 82.6K ops/s │ 8.2K ops/s │
|
|
301
|
+
│ Null │ 62K ops/s │ 7.3K ops/s │
|
|
302
|
+
│ Literal_String │ 72.1K ops/s │ 5.7K ops/s │
|
|
303
|
+
│ Literal_Number │ 72.7K ops/s │ 6.9K ops/s │
|
|
304
|
+
│ Literal_Boolean │ 80.9K ops/s │ 7K ops/s │
|
|
305
|
+
│ Pattern │ 38.7K ops/s │ 5.7K ops/s │
|
|
306
|
+
│ Object_Open │ 16.3K ops/s │ 1.3K ops/s │
|
|
307
|
+
│ Object_Close │ 15.7K ops/s │ 952 ops/s │
|
|
308
|
+
│ Object_Vector3 │ 40.2K ops/s │ 3.2K ops/s │
|
|
309
|
+
│ Object_Basis3 │ 16.1K ops/s │ 834 ops/s │
|
|
310
|
+
│ Intersect_And │ 45.7K ops/s │ 3.5K ops/s │
|
|
311
|
+
│ Intersect_Structural │ 21K ops/s │ 1.6K ops/s │
|
|
312
|
+
│ Union_Or │ 45.1K ops/s │ 3.4K ops/s │
|
|
313
|
+
│ Union_Structural │ 27.6K ops/s │ 2K ops/s │
|
|
314
|
+
│ Tuple_Values │ 14.7K ops/s │ 2K ops/s │
|
|
315
|
+
│ Tuple_Objects │ 3.7K ops/s │ 380 ops/s │
|
|
316
|
+
│ Array_Numbers_4 │ 73.6K ops/s │ 4.3K ops/s │
|
|
317
|
+
│ Array_Numbers_8 │ 50.9K ops/s │ 3.8K ops/s │
|
|
318
|
+
│ Array_Numbers_16 │ 85K ops/s │ 3.9K ops/s │
|
|
319
|
+
│ Array_Objects_Open │ 18.9K ops/s │ 789 ops/s │
|
|
320
|
+
│ Array_Objects_Close │ 17.9K ops/s │ 909 ops/s │
|
|
324
321
|
└──────────────────────┴─────────────┴─────────────┘
|
|
325
322
|
```
|
|
326
323
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/firecrawl-plugin",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/firecrawl-plugin",
|
|
9
|
-
"version": "2026.7.2-beta.
|
|
9
|
+
"version": "2026.7.2-beta.4",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"typebox": "1.3.
|
|
11
|
+
"typebox": "1.3.6"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"node_modules/typebox": {
|
|
15
|
-
"version": "1.3.
|
|
16
|
-
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.3.
|
|
17
|
-
"integrity": "sha512-
|
|
15
|
+
"version": "1.3.6",
|
|
16
|
+
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.3.6.tgz",
|
|
17
|
+
"integrity": "sha512-Sc8RA0NCMEFmApHNU9ZMzqcpQj46She44J8ffpLM/bdhLNUZKq7DJumcLcsFx1gRmDfQPgCgOmFFJ7rcnfWNyA==",
|
|
18
18
|
"license": "MIT"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -38,9 +38,6 @@
|
|
|
38
38
|
"webSearchProviders": ["firecrawl", "firecrawl-free"],
|
|
39
39
|
"tools": ["firecrawl_search", "firecrawl_scrape"]
|
|
40
40
|
},
|
|
41
|
-
"configContracts": {
|
|
42
|
-
"compatibilityRuntimePaths": ["tools.web.search.apiKey"]
|
|
43
|
-
},
|
|
44
41
|
"configSchema": {
|
|
45
42
|
"type": "object",
|
|
46
43
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/firecrawl-plugin",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.4",
|
|
4
4
|
"description": "OpenClaw Firecrawl plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"typebox": "1.3.
|
|
11
|
+
"typebox": "1.3.6"
|
|
12
12
|
},
|
|
13
13
|
"openclaw": {
|
|
14
14
|
"extensions": [
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"minHostVersion": ">=2026.6.8"
|
|
22
22
|
},
|
|
23
23
|
"compat": {
|
|
24
|
-
"pluginApi": ">=2026.7.2-beta.
|
|
24
|
+
"pluginApi": ">=2026.7.2-beta.4"
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
|
-
"openclawVersion": "2026.7.2-beta.
|
|
27
|
+
"openclawVersion": "2026.7.2-beta.4",
|
|
28
28
|
"bundledDist": false
|
|
29
29
|
},
|
|
30
30
|
"release": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"openclaw": ">=2026.7.2-beta.
|
|
45
|
+
"openclaw": ">=2026.7.2-beta.4"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"openclaw": {
|