webfox 4.2.1 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/adapter-RL7JNB22.js +183 -0
- package/dist/{adapter-A7LV6L55.js → adapter-VW4FMMJC.js} +1 -1
- package/dist/application-types.d.ts +1 -0
- package/dist/chunk-4SX4TI7A.js +244 -0
- package/dist/{chunk-SGHBA2PZ.js → chunk-5H6OAJCS.js} +11 -4
- package/dist/{chunk-QRHDXM2L.js → chunk-BTWECET5.js} +1 -1
- package/dist/{chunk-WVHMWLKU.js → chunk-GPACLYNT.js} +1 -0
- package/dist/{chunk-TJWQTB6W.js → chunk-VYMIR35R.js} +140 -236
- package/dist/cli.js +7 -5
- package/dist/config.schema.json +196 -0
- package/dist/domain.d.ts +1 -1
- package/dist/index.js +6 -4
- package/dist/pi.js +12 -6
- package/dist/providers/contract.d.ts +1 -0
- package/dist/providers/definition.d.ts +4 -0
- package/dist/providers/registry.d.ts +1 -0
- package/dist/providers/serpbase/adapter.d.ts +5 -0
- package/dist/providers/serpbase/definition.d.ts +1 -0
- package/dist/providers/serpbase/types.d.ts +37 -0
- package/docs/provider.md +102 -0
- package/package.json +1 -1
|
@@ -1,144 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CAPABILITIES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GPACLYNT.js";
|
|
4
4
|
import {
|
|
5
5
|
WebfoxError
|
|
6
6
|
} from "./chunk-U4BLULLV.js";
|
|
7
7
|
|
|
8
|
-
//
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"webfox",
|
|
28
|
-
"web-cli",
|
|
29
|
-
"typescript-library",
|
|
30
|
-
"pi-package",
|
|
31
|
-
"pi-extension",
|
|
32
|
-
"coding-agent",
|
|
33
|
-
"web-search",
|
|
34
|
-
"web-contents",
|
|
35
|
-
"web-answer",
|
|
36
|
-
"web-research",
|
|
37
|
-
"provider-routing",
|
|
38
|
-
"brave",
|
|
39
|
-
"cloudflare",
|
|
40
|
-
"custom",
|
|
41
|
-
"exa",
|
|
42
|
-
"firecrawl",
|
|
43
|
-
"gemini",
|
|
44
|
-
"linkup",
|
|
45
|
-
"ollama",
|
|
46
|
-
"openai",
|
|
47
|
-
"parallel",
|
|
48
|
-
"perplexity",
|
|
49
|
-
"serper",
|
|
50
|
-
"tavily",
|
|
51
|
-
"valyu"
|
|
52
|
-
],
|
|
53
|
-
author: "mavam",
|
|
54
|
-
license: "MIT",
|
|
55
|
-
repository: {
|
|
56
|
-
type: "git",
|
|
57
|
-
url: "git+https://github.com/mavam/webfox.git"
|
|
58
|
-
},
|
|
59
|
-
engines: {
|
|
60
|
-
node: ">=22.0.0"
|
|
61
|
-
},
|
|
62
|
-
publishConfig: {
|
|
63
|
-
access: "public"
|
|
64
|
-
},
|
|
65
|
-
pi: {
|
|
66
|
-
extensions: [
|
|
67
|
-
"./dist/pi.js"
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
bin: {
|
|
71
|
-
web: "./dist/cli.js"
|
|
72
|
-
},
|
|
73
|
-
main: "./dist/index.js",
|
|
74
|
-
types: "./dist/index.d.ts",
|
|
75
|
-
exports: {
|
|
76
|
-
".": {
|
|
77
|
-
types: "./dist/index.d.ts",
|
|
78
|
-
import: "./dist/index.js"
|
|
79
|
-
},
|
|
80
|
-
"./pi": {
|
|
81
|
-
types: "./dist/pi.d.ts",
|
|
82
|
-
import: "./dist/pi.js"
|
|
83
|
-
},
|
|
84
|
-
"./config.schema.json": "./dist/config.schema.json"
|
|
85
|
-
},
|
|
86
|
-
scripts: {
|
|
87
|
-
build: "rm -rf dist && esbuild index=src/index.ts cli=src/cli.ts pi=src/pi.ts generate-schema=scripts/generate-schema.ts --bundle --splitting --format=esm --platform=node --target=node22 --packages=external --outdir=dist && node dist/generate-schema.js && biome format --write src/config.schema.json >&2 && rm dist/generate-schema.js && tsc --project tsconfig.build.json && cp src/config.schema.json dist/config.schema.json && chmod +x dist/cli.js",
|
|
88
|
-
prepare: "npm run build",
|
|
89
|
-
prepack: "npm run build",
|
|
90
|
-
check: "tsc --noEmit",
|
|
91
|
-
format: "biome format --write .",
|
|
92
|
-
"format:check": "biome format .",
|
|
93
|
-
"smoke:live": "npm run build && node scripts/live-smoke.mjs",
|
|
94
|
-
"smoke:package": "node scripts/package-smoke.mjs",
|
|
95
|
-
test: "vitest run",
|
|
96
|
-
"test:watch": "vitest"
|
|
97
|
-
},
|
|
98
|
-
dependencies: {
|
|
99
|
-
"@mendable/firecrawl-js": "^4.38.0",
|
|
100
|
-
"@perplexity-ai/perplexity_ai": "^0.38.5",
|
|
101
|
-
"@tavily/core": "^0.7.9",
|
|
102
|
-
cloudflare: "^7.1.0",
|
|
103
|
-
commander: "^14.0.3",
|
|
104
|
-
"exa-js": "^2.19.0",
|
|
105
|
-
"linkup-sdk": "^3.6.0",
|
|
106
|
-
openai: "^7.10.0",
|
|
107
|
-
"parallel-web": "^1.3.3",
|
|
108
|
-
picocolors: "^1.1.1",
|
|
109
|
-
typebox: "^1.3.6",
|
|
110
|
-
"valyu-js": "^2.10.1",
|
|
111
|
-
yaml: "^2.9.0"
|
|
112
|
-
},
|
|
113
|
-
devDependencies: {
|
|
114
|
-
"@biomejs/biome": "^2.5.4",
|
|
115
|
-
"@earendil-works/pi-ai": "^0.85.1",
|
|
116
|
-
"@earendil-works/pi-coding-agent": "^0.85.1",
|
|
117
|
-
"@earendil-works/pi-tui": "^0.85.1",
|
|
118
|
-
"@types/node": "^26.1.1",
|
|
119
|
-
esbuild: "^0.28.1",
|
|
120
|
-
typescript: "^7.0.2",
|
|
121
|
-
vitest: "^4.1.10"
|
|
122
|
-
},
|
|
123
|
-
peerDependencies: {
|
|
124
|
-
"@earendil-works/pi-coding-agent": "*",
|
|
125
|
-
"@earendil-works/pi-tui": "*"
|
|
126
|
-
},
|
|
127
|
-
peerDependenciesMeta: {
|
|
128
|
-
"@earendil-works/pi-coding-agent": {
|
|
129
|
-
optional: true
|
|
130
|
-
},
|
|
131
|
-
"@earendil-works/pi-tui": {
|
|
132
|
-
optional: true
|
|
133
|
-
}
|
|
8
|
+
// src/providers/serpbase/types.ts
|
|
9
|
+
var SERPBASE_MODES = {
|
|
10
|
+
search: {
|
|
11
|
+
path: "search",
|
|
12
|
+
result: "organic",
|
|
13
|
+
options: ["hl", "gl", "page", "device"]
|
|
14
|
+
},
|
|
15
|
+
images: { path: "images", result: "images", options: ["hl", "gl", "page"] },
|
|
16
|
+
news: { path: "news", result: "news", options: ["hl", "gl", "page"] },
|
|
17
|
+
videos: { path: "videos", result: "videos", options: ["hl", "gl", "page"] },
|
|
18
|
+
maps: {
|
|
19
|
+
path: "maps/search",
|
|
20
|
+
result: "places",
|
|
21
|
+
options: ["hl", "gl", "page", "lat", "lng", "zoom"]
|
|
22
|
+
},
|
|
23
|
+
"maps-detail": {
|
|
24
|
+
path: "maps/detail",
|
|
25
|
+
result: "place",
|
|
26
|
+
options: ["hl", "gl"]
|
|
134
27
|
}
|
|
135
28
|
};
|
|
136
29
|
|
|
137
|
-
// src/package-metadata.ts
|
|
138
|
-
var PACKAGE_NAME = package_default.name;
|
|
139
|
-
var PACKAGE_VERSION = package_default.version;
|
|
140
|
-
var CONFIG_SCHEMA_URL = `https://unpkg.com/${PACKAGE_NAME}@latest/dist/config.schema.json`;
|
|
141
|
-
|
|
142
30
|
// src/configuration/planning.ts
|
|
143
31
|
import { Check, Errors } from "typebox/value";
|
|
144
32
|
|
|
@@ -745,7 +633,7 @@ var customProvider = defineProvider({
|
|
|
745
633
|
retrySafe: false
|
|
746
634
|
}
|
|
747
635
|
},
|
|
748
|
-
load: async () => (await import("./adapter-
|
|
636
|
+
load: async () => (await import("./adapter-VW4FMMJC.js")).adapter
|
|
749
637
|
});
|
|
750
638
|
|
|
751
639
|
// src/providers/exa/definition.ts
|
|
@@ -1984,6 +1872,107 @@ var perplexityProvider = defineProvider({
|
|
|
1984
1872
|
load: async () => (await import("./adapter-NEXSOHGT.js")).adapter
|
|
1985
1873
|
});
|
|
1986
1874
|
|
|
1875
|
+
// src/providers/serpbase/definition.ts
|
|
1876
|
+
var serpbaseProvider = defineProvider({
|
|
1877
|
+
id: "serpbase",
|
|
1878
|
+
label: "SerpBase",
|
|
1879
|
+
docsUrl: "https://serpbase.dev/docs",
|
|
1880
|
+
local: false,
|
|
1881
|
+
credentials: [{ name: "api", environmentVariable: "SERPBASE_API_KEY" }],
|
|
1882
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
1883
|
+
defaults: {
|
|
1884
|
+
search: { mode: "search", hl: "en", gl: "us", page: 1, device: "default" }
|
|
1885
|
+
},
|
|
1886
|
+
credentialDefaults: {},
|
|
1887
|
+
capabilities: {
|
|
1888
|
+
search: {
|
|
1889
|
+
defaultTimeoutMs: 12e4,
|
|
1890
|
+
modeOptionKeys: Object.fromEntries(
|
|
1891
|
+
Object.entries(SERPBASE_MODES).map(([mode, definition]) => [
|
|
1892
|
+
mode,
|
|
1893
|
+
definition.options
|
|
1894
|
+
])
|
|
1895
|
+
),
|
|
1896
|
+
options: {
|
|
1897
|
+
type: "object",
|
|
1898
|
+
properties: {
|
|
1899
|
+
mode: {
|
|
1900
|
+
type: "string",
|
|
1901
|
+
enum: Object.keys(SERPBASE_MODES),
|
|
1902
|
+
description: "Google endpoint: 'search' (default) for organic results, 'images' for visual references, 'news' for journalism, 'videos' for clips/tutorials, 'maps' for businesses/places, or 'maps-detail' for place enrichment. In maps-detail, each queries entry must be a feature_id returned by maps (0x...:0x...), not search text."
|
|
1903
|
+
},
|
|
1904
|
+
hl: {
|
|
1905
|
+
type: "string",
|
|
1906
|
+
minLength: 1,
|
|
1907
|
+
description: "Google results language code (for example 'en')."
|
|
1908
|
+
},
|
|
1909
|
+
gl: {
|
|
1910
|
+
type: "string",
|
|
1911
|
+
minLength: 1,
|
|
1912
|
+
description: "Google results country code (for example 'us')."
|
|
1913
|
+
},
|
|
1914
|
+
page: {
|
|
1915
|
+
type: "integer",
|
|
1916
|
+
minimum: 1,
|
|
1917
|
+
description: "1-based results page (default 1). Not accepted in maps-detail. Only this page is fetched; maxResults limits the returned results, not the upstream page size."
|
|
1918
|
+
},
|
|
1919
|
+
device: {
|
|
1920
|
+
type: "string",
|
|
1921
|
+
enum: ["default", "pc", "mobile"],
|
|
1922
|
+
description: "Only for search mode: 'default' (default) for automatic routing, 'pc' for desktop, or 'mobile'."
|
|
1923
|
+
},
|
|
1924
|
+
lat: {
|
|
1925
|
+
type: "number",
|
|
1926
|
+
minimum: -90,
|
|
1927
|
+
maximum: 90,
|
|
1928
|
+
description: "Maps mode only: map center latitude. Requires lng."
|
|
1929
|
+
},
|
|
1930
|
+
lng: {
|
|
1931
|
+
type: "number",
|
|
1932
|
+
minimum: -180,
|
|
1933
|
+
maximum: 180,
|
|
1934
|
+
description: "Maps mode only: map center longitude. Requires lat."
|
|
1935
|
+
},
|
|
1936
|
+
zoom: {
|
|
1937
|
+
type: "integer",
|
|
1938
|
+
minimum: 1,
|
|
1939
|
+
maximum: 21,
|
|
1940
|
+
description: "Maps mode only: zoom level, 1\u201321. Requires lat and lng; defaults to 14 when coordinates are supplied."
|
|
1941
|
+
}
|
|
1942
|
+
},
|
|
1943
|
+
// Flat properties keep CLI flags discoverable. Each branch prohibits
|
|
1944
|
+
// fields for other modes; missing discriminators allow partial overrides.
|
|
1945
|
+
anyOf: Object.entries(SERPBASE_MODES).map(([mode, definition]) => ({
|
|
1946
|
+
properties: {
|
|
1947
|
+
mode: { enum: [mode] },
|
|
1948
|
+
...Object.fromEntries(
|
|
1949
|
+
["page", "device", "lat", "lng", "zoom"].filter(
|
|
1950
|
+
(key) => !definition.options.includes(key)
|
|
1951
|
+
).map((key) => [key, false])
|
|
1952
|
+
)
|
|
1953
|
+
},
|
|
1954
|
+
...mode === "maps" ? {
|
|
1955
|
+
anyOf: [
|
|
1956
|
+
{ properties: { lat: false, lng: false, zoom: false } },
|
|
1957
|
+
{ required: ["lat", "lng"] }
|
|
1958
|
+
]
|
|
1959
|
+
} : {}
|
|
1960
|
+
})),
|
|
1961
|
+
description: "SerpBase Google search modes. In maps-detail, queries contains feature IDs instead of search text. Unknown or mode-incompatible options are rejected. Changing mode drops incompatible inherited defaults, not explicitly supplied options."
|
|
1962
|
+
},
|
|
1963
|
+
promptGuidelines: [
|
|
1964
|
+
"Use options.mode to choose SerpBase search (organic), images (visual references), news (journalism), videos (clips/tutorials), or maps (businesses/places).",
|
|
1965
|
+
"To enrich a place, first use mode maps, then call the same web_search tool with mode maps-detail and the returned feature_id strings in queries. Do not substitute names, place_id, CID, or Maps URLs for feature_id.",
|
|
1966
|
+
"Use lat and lng together to center a maps search; zoom requires both. Device selection applies only to organic search, and maps-detail accepts only hl and gl alongside mode.",
|
|
1967
|
+
"Each query fetches one page or one place. maxResults only trims locally; request additional pages explicitly. Requests, including retries, may incur charges.",
|
|
1968
|
+
"Image results include image and source-page URLs, not image contents. News/video times are upstream text, not verified timestamps. Maps hours and contact fields are shown only when returned."
|
|
1969
|
+
],
|
|
1970
|
+
retrySafe: true
|
|
1971
|
+
}
|
|
1972
|
+
},
|
|
1973
|
+
load: async () => (await import("./adapter-RL7JNB22.js")).adapter
|
|
1974
|
+
});
|
|
1975
|
+
|
|
1987
1976
|
// src/providers/serper/definition.ts
|
|
1988
1977
|
var serperProvider = defineProvider({
|
|
1989
1978
|
id: "serper",
|
|
@@ -2991,6 +2980,7 @@ var providers = {
|
|
|
2991
2980
|
openai: openaiProvider,
|
|
2992
2981
|
parallel: parallelProvider,
|
|
2993
2982
|
perplexity: perplexityProvider,
|
|
2983
|
+
serpbase: serpbaseProvider,
|
|
2994
2984
|
serper: serperProvider,
|
|
2995
2985
|
tavily: tavilyProvider,
|
|
2996
2986
|
valyu: valyuProvider,
|
|
@@ -3071,8 +3061,19 @@ function optionSchema(definition, capability, mode = "request") {
|
|
|
3071
3061
|
return result;
|
|
3072
3062
|
}
|
|
3073
3063
|
function effectiveOptions(config, definition, capability, options = {}, mode = "request") {
|
|
3074
|
-
const
|
|
3075
|
-
|
|
3064
|
+
const modes = definition.capabilities[capability]?.modeOptionKeys;
|
|
3065
|
+
const merge = (base, override) => {
|
|
3066
|
+
const inherited = { ...base };
|
|
3067
|
+
if (modes && typeof override.mode === "string" && override.mode !== base.mode && Object.hasOwn(modes, override.mode)) {
|
|
3068
|
+
const allowed = modes[override.mode];
|
|
3069
|
+
for (const key of new Set(Object.values(modes).flat())) {
|
|
3070
|
+
if (!allowed.includes(key)) delete inherited[key];
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
return deepMerge(inherited, override);
|
|
3074
|
+
};
|
|
3075
|
+
const result = merge(
|
|
3076
|
+
merge(
|
|
3076
3077
|
definition.defaults[capability] ?? {},
|
|
3077
3078
|
config.providers?.[definition.id]?.options?.[capability] ?? {}
|
|
3078
3079
|
),
|
|
@@ -3133,110 +3134,13 @@ function isObject(value) {
|
|
|
3133
3134
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
3134
3135
|
}
|
|
3135
3136
|
|
|
3136
|
-
// src/configuration/schema.ts
|
|
3137
|
-
var text = { type: "string", minLength: 1 };
|
|
3138
|
-
var object = (properties) => ({
|
|
3139
|
-
type: "object",
|
|
3140
|
-
additionalProperties: false,
|
|
3141
|
-
properties
|
|
3142
|
-
});
|
|
3143
|
-
var source = {
|
|
3144
|
-
oneOf: ["env", "value", "command"].map((key) => ({
|
|
3145
|
-
...object({
|
|
3146
|
-
[key]: key === "command" ? { type: "array", minItems: 1, items: text } : text
|
|
3147
|
-
}),
|
|
3148
|
-
required: [key]
|
|
3149
|
-
}))
|
|
3150
|
-
};
|
|
3151
|
-
var sourceMap = { type: "object", additionalProperties: source };
|
|
3152
|
-
var command = {
|
|
3153
|
-
...object({
|
|
3154
|
-
argv: { type: "array", minItems: 1, items: text },
|
|
3155
|
-
cwd: text,
|
|
3156
|
-
env: sourceMap
|
|
3157
|
-
}),
|
|
3158
|
-
required: ["argv"]
|
|
3159
|
-
};
|
|
3160
|
-
var positive = { type: "integer", minimum: 1 };
|
|
3161
|
-
var timeout = { ...positive, maximum: 2147483647 };
|
|
3162
|
-
var fields = {
|
|
3163
|
-
credentials: sourceMap,
|
|
3164
|
-
baseUrl: text,
|
|
3165
|
-
accountId: source,
|
|
3166
|
-
commands: object(
|
|
3167
|
-
Object.fromEntries(CAPABILITIES.map((capability) => [capability, command]))
|
|
3168
|
-
)
|
|
3169
|
-
};
|
|
3170
|
-
var configurationSchema = {
|
|
3171
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
3172
|
-
$id: CONFIG_SCHEMA_URL,
|
|
3173
|
-
title: "webfox configuration",
|
|
3174
|
-
...object({
|
|
3175
|
-
$schema: text,
|
|
3176
|
-
defaults: object(
|
|
3177
|
-
Object.fromEntries(
|
|
3178
|
-
CAPABILITIES.map((capability) => [
|
|
3179
|
-
capability,
|
|
3180
|
-
object({
|
|
3181
|
-
provider: {
|
|
3182
|
-
enum: Object.values(providers).filter((provider) => provider.capabilities[capability]).map((provider) => provider.id)
|
|
3183
|
-
},
|
|
3184
|
-
...capability === "search" ? { maxResults: positive } : {}
|
|
3185
|
-
})
|
|
3186
|
-
])
|
|
3187
|
-
)
|
|
3188
|
-
),
|
|
3189
|
-
execution: object({
|
|
3190
|
-
timeoutMs: timeout,
|
|
3191
|
-
researchTimeoutMs: timeout,
|
|
3192
|
-
retries: { type: "integer", minimum: 0 },
|
|
3193
|
-
retryDelayMs: { type: "integer", minimum: 0 },
|
|
3194
|
-
concurrency: positive
|
|
3195
|
-
}),
|
|
3196
|
-
providers: object(
|
|
3197
|
-
Object.fromEntries(
|
|
3198
|
-
Object.values(providers).map((provider) => [
|
|
3199
|
-
provider.id,
|
|
3200
|
-
object(
|
|
3201
|
-
Object.fromEntries(
|
|
3202
|
-
provider.fields.map((field) => [
|
|
3203
|
-
field,
|
|
3204
|
-
field === "options" ? object(
|
|
3205
|
-
Object.fromEntries(
|
|
3206
|
-
CAPABILITIES.filter(
|
|
3207
|
-
(capability) => provider.capabilities[capability]
|
|
3208
|
-
).map((capability) => [
|
|
3209
|
-
capability,
|
|
3210
|
-
optionSchema(provider, capability, "defaults") ?? {
|
|
3211
|
-
type: "object",
|
|
3212
|
-
additionalProperties: provider.id === "custom"
|
|
3213
|
-
}
|
|
3214
|
-
])
|
|
3215
|
-
)
|
|
3216
|
-
) : field === "credentials" ? object(
|
|
3217
|
-
Object.fromEntries(
|
|
3218
|
-
provider.credentials.map((credential) => [
|
|
3219
|
-
credential.name,
|
|
3220
|
-
source
|
|
3221
|
-
])
|
|
3222
|
-
)
|
|
3223
|
-
) : fields[field]
|
|
3224
|
-
])
|
|
3225
|
-
)
|
|
3226
|
-
)
|
|
3227
|
-
])
|
|
3228
|
-
)
|
|
3229
|
-
)
|
|
3230
|
-
})
|
|
3231
|
-
};
|
|
3232
|
-
|
|
3233
3137
|
export {
|
|
3234
|
-
|
|
3235
|
-
CONFIG_SCHEMA_URL,
|
|
3236
|
-
providers,
|
|
3138
|
+
SERPBASE_MODES,
|
|
3237
3139
|
selectProvider,
|
|
3238
3140
|
optionSchema,
|
|
3239
3141
|
effectiveOptions,
|
|
3142
|
+
validateOptions,
|
|
3240
3143
|
validateConfiguredOptions,
|
|
3241
|
-
|
|
3144
|
+
serpbaseProvider,
|
|
3145
|
+
providers
|
|
3242
3146
|
};
|
package/dist/cli.js
CHANGED
|
@@ -4,24 +4,26 @@ import {
|
|
|
4
4
|
} from "./chunk-I2UIACY3.js";
|
|
5
5
|
import {
|
|
6
6
|
renderTextDocument
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BTWECET5.js";
|
|
8
8
|
import {
|
|
9
9
|
createWebfox,
|
|
10
10
|
loadConfig,
|
|
11
11
|
redactConfig,
|
|
12
12
|
resolveConfigPath,
|
|
13
13
|
setCapabilityDefault
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5H6OAJCS.js";
|
|
15
15
|
import "./chunk-WCTOYZVB.js";
|
|
16
16
|
import {
|
|
17
|
-
PACKAGE_VERSION
|
|
17
|
+
PACKAGE_VERSION
|
|
18
|
+
} from "./chunk-4SX4TI7A.js";
|
|
19
|
+
import {
|
|
18
20
|
validateConfiguredOptions
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VYMIR35R.js";
|
|
20
22
|
import "./chunk-ZVTVERW5.js";
|
|
21
23
|
import {
|
|
22
24
|
CAPABILITIES,
|
|
23
25
|
PROVIDER_IDS
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GPACLYNT.js";
|
|
25
27
|
import {
|
|
26
28
|
WebfoxError
|
|
27
29
|
} from "./chunk-U4BLULLV.js";
|
package/dist/config.schema.json
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"openai",
|
|
29
29
|
"parallel",
|
|
30
30
|
"perplexity",
|
|
31
|
+
"serpbase",
|
|
31
32
|
"serper",
|
|
32
33
|
"tavily",
|
|
33
34
|
"valyu",
|
|
@@ -3294,6 +3295,201 @@
|
|
|
3294
3295
|
}
|
|
3295
3296
|
}
|
|
3296
3297
|
},
|
|
3298
|
+
"serpbase": {
|
|
3299
|
+
"type": "object",
|
|
3300
|
+
"additionalProperties": false,
|
|
3301
|
+
"properties": {
|
|
3302
|
+
"credentials": {
|
|
3303
|
+
"type": "object",
|
|
3304
|
+
"additionalProperties": false,
|
|
3305
|
+
"properties": {
|
|
3306
|
+
"api": {
|
|
3307
|
+
"oneOf": [
|
|
3308
|
+
{
|
|
3309
|
+
"type": "object",
|
|
3310
|
+
"additionalProperties": false,
|
|
3311
|
+
"properties": {
|
|
3312
|
+
"env": {
|
|
3313
|
+
"type": "string",
|
|
3314
|
+
"minLength": 1
|
|
3315
|
+
}
|
|
3316
|
+
},
|
|
3317
|
+
"required": ["env"]
|
|
3318
|
+
},
|
|
3319
|
+
{
|
|
3320
|
+
"type": "object",
|
|
3321
|
+
"additionalProperties": false,
|
|
3322
|
+
"properties": {
|
|
3323
|
+
"value": {
|
|
3324
|
+
"type": "string",
|
|
3325
|
+
"minLength": 1
|
|
3326
|
+
}
|
|
3327
|
+
},
|
|
3328
|
+
"required": ["value"]
|
|
3329
|
+
},
|
|
3330
|
+
{
|
|
3331
|
+
"type": "object",
|
|
3332
|
+
"additionalProperties": false,
|
|
3333
|
+
"properties": {
|
|
3334
|
+
"command": {
|
|
3335
|
+
"type": "array",
|
|
3336
|
+
"minItems": 1,
|
|
3337
|
+
"items": {
|
|
3338
|
+
"type": "string",
|
|
3339
|
+
"minLength": 1
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
},
|
|
3343
|
+
"required": ["command"]
|
|
3344
|
+
}
|
|
3345
|
+
]
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3348
|
+
},
|
|
3349
|
+
"baseUrl": {
|
|
3350
|
+
"type": "string",
|
|
3351
|
+
"minLength": 1
|
|
3352
|
+
},
|
|
3353
|
+
"options": {
|
|
3354
|
+
"type": "object",
|
|
3355
|
+
"additionalProperties": false,
|
|
3356
|
+
"properties": {
|
|
3357
|
+
"search": {
|
|
3358
|
+
"type": "object",
|
|
3359
|
+
"properties": {
|
|
3360
|
+
"mode": {
|
|
3361
|
+
"type": "string",
|
|
3362
|
+
"enum": [
|
|
3363
|
+
"search",
|
|
3364
|
+
"images",
|
|
3365
|
+
"news",
|
|
3366
|
+
"videos",
|
|
3367
|
+
"maps",
|
|
3368
|
+
"maps-detail"
|
|
3369
|
+
],
|
|
3370
|
+
"description": "Google endpoint: 'search' (default) for organic results, 'images' for visual references, 'news' for journalism, 'videos' for clips/tutorials, 'maps' for businesses/places, or 'maps-detail' for place enrichment. In maps-detail, each queries entry must be a feature_id returned by maps (0x...:0x...), not search text."
|
|
3371
|
+
},
|
|
3372
|
+
"hl": {
|
|
3373
|
+
"type": "string",
|
|
3374
|
+
"minLength": 1,
|
|
3375
|
+
"description": "Google results language code (for example 'en')."
|
|
3376
|
+
},
|
|
3377
|
+
"gl": {
|
|
3378
|
+
"type": "string",
|
|
3379
|
+
"minLength": 1,
|
|
3380
|
+
"description": "Google results country code (for example 'us')."
|
|
3381
|
+
},
|
|
3382
|
+
"page": {
|
|
3383
|
+
"type": "integer",
|
|
3384
|
+
"minimum": 1,
|
|
3385
|
+
"description": "1-based results page (default 1). Not accepted in maps-detail. Only this page is fetched; maxResults limits the returned results, not the upstream page size."
|
|
3386
|
+
},
|
|
3387
|
+
"device": {
|
|
3388
|
+
"type": "string",
|
|
3389
|
+
"enum": ["default", "pc", "mobile"],
|
|
3390
|
+
"description": "Only for search mode: 'default' (default) for automatic routing, 'pc' for desktop, or 'mobile'."
|
|
3391
|
+
},
|
|
3392
|
+
"lat": {
|
|
3393
|
+
"type": "number",
|
|
3394
|
+
"minimum": -90,
|
|
3395
|
+
"maximum": 90,
|
|
3396
|
+
"description": "Maps mode only: map center latitude. Requires lng."
|
|
3397
|
+
},
|
|
3398
|
+
"lng": {
|
|
3399
|
+
"type": "number",
|
|
3400
|
+
"minimum": -180,
|
|
3401
|
+
"maximum": 180,
|
|
3402
|
+
"description": "Maps mode only: map center longitude. Requires lat."
|
|
3403
|
+
},
|
|
3404
|
+
"zoom": {
|
|
3405
|
+
"type": "integer",
|
|
3406
|
+
"minimum": 1,
|
|
3407
|
+
"maximum": 21,
|
|
3408
|
+
"description": "Maps mode only: zoom level, 1–21. Requires lat and lng; defaults to 14 when coordinates are supplied."
|
|
3409
|
+
}
|
|
3410
|
+
},
|
|
3411
|
+
"anyOf": [
|
|
3412
|
+
{
|
|
3413
|
+
"properties": {
|
|
3414
|
+
"mode": {
|
|
3415
|
+
"enum": ["search"]
|
|
3416
|
+
},
|
|
3417
|
+
"lat": false,
|
|
3418
|
+
"lng": false,
|
|
3419
|
+
"zoom": false
|
|
3420
|
+
}
|
|
3421
|
+
},
|
|
3422
|
+
{
|
|
3423
|
+
"properties": {
|
|
3424
|
+
"mode": {
|
|
3425
|
+
"enum": ["images"]
|
|
3426
|
+
},
|
|
3427
|
+
"device": false,
|
|
3428
|
+
"lat": false,
|
|
3429
|
+
"lng": false,
|
|
3430
|
+
"zoom": false
|
|
3431
|
+
}
|
|
3432
|
+
},
|
|
3433
|
+
{
|
|
3434
|
+
"properties": {
|
|
3435
|
+
"mode": {
|
|
3436
|
+
"enum": ["news"]
|
|
3437
|
+
},
|
|
3438
|
+
"device": false,
|
|
3439
|
+
"lat": false,
|
|
3440
|
+
"lng": false,
|
|
3441
|
+
"zoom": false
|
|
3442
|
+
}
|
|
3443
|
+
},
|
|
3444
|
+
{
|
|
3445
|
+
"properties": {
|
|
3446
|
+
"mode": {
|
|
3447
|
+
"enum": ["videos"]
|
|
3448
|
+
},
|
|
3449
|
+
"device": false,
|
|
3450
|
+
"lat": false,
|
|
3451
|
+
"lng": false,
|
|
3452
|
+
"zoom": false
|
|
3453
|
+
}
|
|
3454
|
+
},
|
|
3455
|
+
{
|
|
3456
|
+
"properties": {
|
|
3457
|
+
"mode": {
|
|
3458
|
+
"enum": ["maps"]
|
|
3459
|
+
},
|
|
3460
|
+
"device": false
|
|
3461
|
+
},
|
|
3462
|
+
"anyOf": [
|
|
3463
|
+
{
|
|
3464
|
+
"properties": {
|
|
3465
|
+
"lat": false,
|
|
3466
|
+
"lng": false,
|
|
3467
|
+
"zoom": false
|
|
3468
|
+
}
|
|
3469
|
+
},
|
|
3470
|
+
{}
|
|
3471
|
+
]
|
|
3472
|
+
},
|
|
3473
|
+
{
|
|
3474
|
+
"properties": {
|
|
3475
|
+
"mode": {
|
|
3476
|
+
"enum": ["maps-detail"]
|
|
3477
|
+
},
|
|
3478
|
+
"page": false,
|
|
3479
|
+
"device": false,
|
|
3480
|
+
"lat": false,
|
|
3481
|
+
"lng": false,
|
|
3482
|
+
"zoom": false
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
],
|
|
3486
|
+
"description": "SerpBase Google search modes. In maps-detail, queries contains feature IDs instead of search text. Unknown or mode-incompatible options are rejected. Changing mode drops incompatible inherited defaults, not explicitly supplied options.",
|
|
3487
|
+
"additionalProperties": false
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
},
|
|
3297
3493
|
"serper": {
|
|
3298
3494
|
"type": "object",
|
|
3299
3495
|
"additionalProperties": false,
|
package/dist/domain.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const CAPABILITIES: readonly ["search", "contents", "answer", "research"];
|
|
2
2
|
export type Capability = (typeof CAPABILITIES)[number];
|
|
3
|
-
export declare const PROVIDER_IDS: readonly ["brave", "cloudflare", "custom", "exa", "firecrawl", "gemini", "linkup", "ollama", "openai", "parallel", "perplexity", "serper", "tavily", "valyu", "youcom"];
|
|
3
|
+
export declare const PROVIDER_IDS: readonly ["brave", "cloudflare", "custom", "exa", "firecrawl", "gemini", "linkup", "ollama", "openai", "parallel", "perplexity", "serpbase", "serper", "tavily", "valyu", "youcom"];
|
|
4
4
|
export type ProviderId = (typeof PROVIDER_IDS)[number];
|
|
5
5
|
export declare const WEBFOX_ERROR_CODES: readonly ["INVALID_CONFIG", "INVALID_INPUT", "PROVIDER_UNAVAILABLE", "PROVIDER_FAILURE", "PARTIAL_BATCH", "TIMEOUT", "CANCELLED"];
|
|
6
6
|
export type WebfoxErrorCode = (typeof WEBFOX_ERROR_CODES)[number];
|