webfox 0.0.0-test.0 → 4.0.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/LICENSE +21 -0
- package/README.md +256 -3
- package/assets/webfox-lockup-dark.png +0 -0
- package/assets/webfox-lockup.png +0 -0
- package/dist/adapter-2YBFCBCZ.js +161 -0
- package/dist/adapter-67TIISDW.js +753 -0
- package/dist/adapter-AB7LKV7N.js +324 -0
- package/dist/adapter-AUYLTDPM.js +73 -0
- package/dist/adapter-HITGYUXN.js +494 -0
- package/dist/adapter-HPTMLH75.js +334 -0
- package/dist/adapter-I6OUKBZQ.js +492 -0
- package/dist/adapter-ISZQTZDP.js +166 -0
- package/dist/adapter-MAG7X663.js +230 -0
- package/dist/adapter-NEXSOHGT.js +232 -0
- package/dist/adapter-PADXKW43.js +162 -0
- package/dist/adapter-SDQX2533.js +123 -0
- package/dist/adapter-UAZNLDSS.js +237 -0
- package/dist/adapter-XBAQSK7I.js +282 -0
- package/dist/application-types.d.ts +34 -0
- package/dist/application.d.ts +2 -0
- package/dist/chunk-EF4VMDZL.js +85 -0
- package/dist/chunk-G2YAQEET.js +38 -0
- package/dist/chunk-I2UIACY3.js +12 -0
- package/dist/chunk-L425U55P.js +3051 -0
- package/dist/chunk-QRHDXM2L.js +31 -0
- package/dist/chunk-SMF5ALX7.js +762 -0
- package/dist/chunk-U4BLULLV.js +52 -0
- package/dist/chunk-WCTOYZVB.js +85 -0
- package/dist/chunk-X6ZBIHZC.js +21 -0
- package/dist/chunk-YZXM4U2C.js +21 -0
- package/dist/chunk-ZVTVERW5.js +20 -0
- package/dist/cli.js +641 -0
- package/dist/config.schema.json +4270 -0
- package/dist/configuration/defaults.d.ts +3 -0
- package/dist/configuration/file.d.ts +17 -0
- package/dist/configuration/options-schema.d.ts +2 -0
- package/dist/configuration/planning.d.ts +10 -0
- package/dist/configuration/schema.d.ts +9 -0
- package/dist/configuration/types.d.ts +37 -0
- package/dist/contents.d.ts +19 -0
- package/dist/domain.d.ts +89 -0
- package/dist/errors.d.ts +17 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +38 -0
- package/dist/package-metadata.d.ts +3 -0
- package/dist/pi-keybindings.d.ts +1 -0
- package/dist/pi-params.d.ts +3 -0
- package/dist/pi-render.d.ts +50 -0
- package/dist/pi-search-render.d.ts +4 -0
- package/dist/pi-text.d.ts +4 -0
- package/dist/pi-validation.d.ts +4 -0
- package/dist/pi.d.ts +2 -0
- package/dist/pi.js +563 -0
- package/dist/providers/brave/adapter.d.ts +7 -0
- package/dist/providers/brave/definition.d.ts +1 -0
- package/dist/providers/brave/types.d.ts +4 -0
- package/dist/providers/cli-json.d.ts +9 -0
- package/dist/providers/cloudflare/adapter.d.ts +5 -0
- package/dist/providers/cloudflare/definition.d.ts +1 -0
- package/dist/providers/cloudflare/types.d.ts +4 -0
- package/dist/providers/contract.d.ts +88 -0
- package/dist/providers/custom/adapter.d.ts +9 -0
- package/dist/providers/custom/definition.d.ts +1 -0
- package/dist/providers/custom/types.d.ts +9 -0
- package/dist/providers/definition.d.ts +32 -0
- package/dist/providers/exa/adapter.d.ts +8 -0
- package/dist/providers/exa/definition.d.ts +1 -0
- package/dist/providers/exa/types.d.ts +4 -0
- package/dist/providers/firecrawl/adapter.d.ts +7 -0
- package/dist/providers/firecrawl/definition.d.ts +1 -0
- package/dist/providers/firecrawl/types.d.ts +4 -0
- package/dist/providers/gemini/adapter.d.ts +14 -0
- package/dist/providers/gemini/definition.d.ts +1 -0
- package/dist/providers/gemini/types.d.ts +3 -0
- package/dist/providers/linkup/adapter.d.ts +7 -0
- package/dist/providers/linkup/definition.d.ts +1 -0
- package/dist/providers/linkup/types.d.ts +4 -0
- package/dist/providers/metadata.d.ts +15 -0
- package/dist/providers/ollama/adapter.d.ts +6 -0
- package/dist/providers/ollama/definition.d.ts +1 -0
- package/dist/providers/ollama/types.d.ts +4 -0
- package/dist/providers/openai/adapter.d.ts +7 -0
- package/dist/providers/openai/definition.d.ts +1 -0
- package/dist/providers/openai/types.d.ts +28 -0
- package/dist/providers/parallel/adapter.d.ts +6 -0
- package/dist/providers/parallel/definition.d.ts +1 -0
- package/dist/providers/parallel/types.d.ts +4 -0
- package/dist/providers/perplexity/adapter.d.ts +7 -0
- package/dist/providers/perplexity/definition.d.ts +1 -0
- package/dist/providers/perplexity/types.d.ts +4 -0
- package/dist/providers/registry.d.ts +16 -0
- package/dist/providers/serper/adapter.d.ts +5 -0
- package/dist/providers/serper/definition.d.ts +1 -0
- package/dist/providers/serper/types.d.ts +21 -0
- package/dist/providers/shared.d.ts +4 -0
- package/dist/providers/tavily/adapter.d.ts +6 -0
- package/dist/providers/tavily/definition.d.ts +1 -0
- package/dist/providers/tavily/types.d.ts +4 -0
- package/dist/providers/valyu/adapter.d.ts +8 -0
- package/dist/providers/valyu/definition.d.ts +1 -0
- package/dist/providers/valyu/types.d.ts +4 -0
- package/dist/render.d.ts +5 -0
- package/dist/runtime/credentials.d.ts +15 -0
- package/dist/runtime/duration.d.ts +2 -0
- package/dist/runtime/execute.d.ts +20 -0
- package/dist/runtime/lifecycle.d.ts +8 -0
- package/dist/runtime/outward.d.ts +11 -0
- package/dist/runtime/polling.d.ts +13 -0
- package/dist/runtime/process.d.ts +4 -0
- package/docs/cli-experience.md +177 -0
- package/docs/provider.md +177 -0
- package/docs/reference.md +181 -0
- package/example-config.yaml +36 -0
- package/examples/custom/README.md +57 -0
- package/examples/custom/provider.mjs +54 -0
- package/examples/custom/webfox.json +18 -0
- package/package.json +122 -8
- package/index.js +0 -2
|
@@ -0,0 +1,3051 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CAPABILITIES
|
|
3
|
+
} from "./chunk-G2YAQEET.js";
|
|
4
|
+
import {
|
|
5
|
+
WebfoxError
|
|
6
|
+
} from "./chunk-U4BLULLV.js";
|
|
7
|
+
|
|
8
|
+
// package.json
|
|
9
|
+
var package_default = {
|
|
10
|
+
name: "webfox",
|
|
11
|
+
version: "4.0.0",
|
|
12
|
+
description: "Search the web, extract pages, get grounded answers, and run deep research with the web CLI, a TypeScript library, and a pi extension. Bring your own providers and API keys.",
|
|
13
|
+
type: "module",
|
|
14
|
+
files: [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"assets/webfox-lockup.png",
|
|
18
|
+
"assets/webfox-lockup-dark.png",
|
|
19
|
+
"docs/cli-experience.md",
|
|
20
|
+
"docs/provider.md",
|
|
21
|
+
"docs/reference.md",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"example-config.yaml",
|
|
24
|
+
"examples"
|
|
25
|
+
],
|
|
26
|
+
keywords: [
|
|
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
|
+
"@google/genai": "^2.21.0",
|
|
100
|
+
"@mendable/firecrawl-js": "^4.38.0",
|
|
101
|
+
"@perplexity-ai/perplexity_ai": "^0.38.5",
|
|
102
|
+
"@tavily/core": "^0.7.9",
|
|
103
|
+
cloudflare: "^7.1.0",
|
|
104
|
+
commander: "^14.0.3",
|
|
105
|
+
"exa-js": "^2.19.0",
|
|
106
|
+
"linkup-sdk": "^3.6.0",
|
|
107
|
+
openai: "^7.10.0",
|
|
108
|
+
"parallel-web": "^1.3.3",
|
|
109
|
+
picocolors: "^1.1.1",
|
|
110
|
+
typebox: "^1.3.6",
|
|
111
|
+
"valyu-js": "^2.10.1",
|
|
112
|
+
yaml: "^2.9.0"
|
|
113
|
+
},
|
|
114
|
+
devDependencies: {
|
|
115
|
+
"@biomejs/biome": "^2.5.4",
|
|
116
|
+
"@earendil-works/pi-ai": "^0.85.1",
|
|
117
|
+
"@earendil-works/pi-coding-agent": "^0.85.1",
|
|
118
|
+
"@earendil-works/pi-tui": "^0.85.1",
|
|
119
|
+
"@types/node": "^26.1.1",
|
|
120
|
+
esbuild: "^0.28.1",
|
|
121
|
+
typescript: "^7.0.2",
|
|
122
|
+
vitest: "^4.1.10"
|
|
123
|
+
},
|
|
124
|
+
peerDependencies: {
|
|
125
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
126
|
+
"@earendil-works/pi-tui": "*"
|
|
127
|
+
},
|
|
128
|
+
peerDependenciesMeta: {
|
|
129
|
+
"@earendil-works/pi-coding-agent": {
|
|
130
|
+
optional: true
|
|
131
|
+
},
|
|
132
|
+
"@earendil-works/pi-tui": {
|
|
133
|
+
optional: true
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// src/package-metadata.ts
|
|
139
|
+
var PACKAGE_NAME = package_default.name;
|
|
140
|
+
var PACKAGE_VERSION = package_default.version;
|
|
141
|
+
var CONFIG_SCHEMA_URL = `https://unpkg.com/${PACKAGE_NAME}@${PACKAGE_VERSION}/dist/config.schema.json`;
|
|
142
|
+
|
|
143
|
+
// src/configuration/planning.ts
|
|
144
|
+
import { Check, Errors } from "typebox/value";
|
|
145
|
+
|
|
146
|
+
// src/providers/definition.ts
|
|
147
|
+
function defineProvider(definition) {
|
|
148
|
+
return freeze(definition);
|
|
149
|
+
}
|
|
150
|
+
function freeze(value) {
|
|
151
|
+
if (value && typeof value === "object") {
|
|
152
|
+
Object.freeze(value);
|
|
153
|
+
for (const child of Object.values(value)) freeze(child);
|
|
154
|
+
}
|
|
155
|
+
return value;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// src/providers/brave/definition.ts
|
|
159
|
+
var braveProvider = defineProvider({
|
|
160
|
+
id: "brave",
|
|
161
|
+
label: "Brave",
|
|
162
|
+
docsUrl: "https://api-dashboard.search.brave.com/app/documentation",
|
|
163
|
+
local: false,
|
|
164
|
+
credentials: [
|
|
165
|
+
{
|
|
166
|
+
name: "search",
|
|
167
|
+
environmentVariable: "BRAVE_SEARCH_API_KEY",
|
|
168
|
+
capabilities: ["search"]
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "answers",
|
|
172
|
+
environmentVariable: "BRAVE_ANSWERS_API_KEY",
|
|
173
|
+
capabilities: ["answer", "research"]
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
177
|
+
defaults: {},
|
|
178
|
+
credentialDefaults: {},
|
|
179
|
+
capabilities: {
|
|
180
|
+
search: {
|
|
181
|
+
options: {
|
|
182
|
+
type: "object",
|
|
183
|
+
properties: {
|
|
184
|
+
mode: {
|
|
185
|
+
enum: ["web", "llm_context", "news", "videos", "images", "places"],
|
|
186
|
+
description: "Brave search mode. Use 'news' for recent journalism or current events, 'videos' for clips/tutorials, 'images' for visual references, 'places' for local businesses, venues, cafes, restaurants, hotels, shops, or near/in-location searches, and 'llm_context' for retrieval context."
|
|
187
|
+
},
|
|
188
|
+
common: {
|
|
189
|
+
type: "object",
|
|
190
|
+
properties: {
|
|
191
|
+
country: {
|
|
192
|
+
type: "string",
|
|
193
|
+
description: "Country code used to localize Brave results, for example 'US'."
|
|
194
|
+
},
|
|
195
|
+
search_lang: {
|
|
196
|
+
type: "string",
|
|
197
|
+
description: "Content language for Brave results, for example 'en'."
|
|
198
|
+
},
|
|
199
|
+
ui_lang: {
|
|
200
|
+
type: "string",
|
|
201
|
+
description: "UI language for response metadata, for example 'en-US'."
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
description: "Common Brave query options merged into the selected mode's options."
|
|
205
|
+
},
|
|
206
|
+
web: {
|
|
207
|
+
type: "object",
|
|
208
|
+
properties: {
|
|
209
|
+
country: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Country code used to localize Brave results, for example 'US'."
|
|
212
|
+
},
|
|
213
|
+
search_lang: {
|
|
214
|
+
type: "string",
|
|
215
|
+
description: "Content language for Brave results, for example 'en'."
|
|
216
|
+
},
|
|
217
|
+
ui_lang: {
|
|
218
|
+
type: "string",
|
|
219
|
+
description: "UI language for response metadata, for example 'en-US'."
|
|
220
|
+
},
|
|
221
|
+
freshness: {
|
|
222
|
+
type: "string",
|
|
223
|
+
description: "Freshness filter such as 'pd' (24h), 'pw' (7d), 'pm' (31d), 'py' (year), or a Brave date range."
|
|
224
|
+
},
|
|
225
|
+
safesearch: {
|
|
226
|
+
enum: ["off", "moderate", "strict"],
|
|
227
|
+
description: "Safe-search filtering level."
|
|
228
|
+
},
|
|
229
|
+
spellcheck: {
|
|
230
|
+
type: "boolean",
|
|
231
|
+
description: "Whether Brave may spellcheck the query."
|
|
232
|
+
},
|
|
233
|
+
goggles: {
|
|
234
|
+
type: "string",
|
|
235
|
+
description: "Brave Goggles URL or inline definition."
|
|
236
|
+
},
|
|
237
|
+
extra_snippets: {
|
|
238
|
+
type: "boolean",
|
|
239
|
+
description: "Whether to ask Brave for extra snippets."
|
|
240
|
+
},
|
|
241
|
+
offset: {
|
|
242
|
+
type: "integer",
|
|
243
|
+
minimum: 0,
|
|
244
|
+
description: "Brave result page offset for paginated requests."
|
|
245
|
+
},
|
|
246
|
+
enable_rich_callback: {
|
|
247
|
+
type: "boolean",
|
|
248
|
+
description: "Whether to enable Brave rich callback metadata."
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
description: "Options for Brave Web Search mode."
|
|
252
|
+
},
|
|
253
|
+
llmContext: {
|
|
254
|
+
type: "object",
|
|
255
|
+
properties: {
|
|
256
|
+
count: {
|
|
257
|
+
type: "integer",
|
|
258
|
+
minimum: 1,
|
|
259
|
+
maximum: 50,
|
|
260
|
+
description: "Mode-specific result count override. Prefer top-level maxResults unless Brave-specific pagination is needed."
|
|
261
|
+
},
|
|
262
|
+
maximum_number_of_urls: {
|
|
263
|
+
type: "integer",
|
|
264
|
+
minimum: 1,
|
|
265
|
+
description: "Maximum source URLs."
|
|
266
|
+
},
|
|
267
|
+
maximum_number_of_tokens: {
|
|
268
|
+
type: "integer",
|
|
269
|
+
minimum: 1,
|
|
270
|
+
description: "Maximum context tokens."
|
|
271
|
+
},
|
|
272
|
+
maximum_number_of_snippets: {
|
|
273
|
+
type: "integer",
|
|
274
|
+
minimum: 1,
|
|
275
|
+
description: "Maximum snippets."
|
|
276
|
+
},
|
|
277
|
+
maximum_number_of_tokens_per_url: {
|
|
278
|
+
type: "integer",
|
|
279
|
+
minimum: 1,
|
|
280
|
+
description: "Maximum context tokens per URL."
|
|
281
|
+
},
|
|
282
|
+
maximum_number_of_snippets_per_url: {
|
|
283
|
+
type: "integer",
|
|
284
|
+
minimum: 1,
|
|
285
|
+
description: "Maximum snippets per URL."
|
|
286
|
+
},
|
|
287
|
+
context_threshold_mode: {
|
|
288
|
+
type: "string",
|
|
289
|
+
description: "Brave LLM Context threshold mode."
|
|
290
|
+
},
|
|
291
|
+
enable_local: {
|
|
292
|
+
type: "boolean",
|
|
293
|
+
description: "Whether to include local results."
|
|
294
|
+
},
|
|
295
|
+
enable_source_metadata: {
|
|
296
|
+
type: "boolean",
|
|
297
|
+
description: "Whether to include source metadata in grounding."
|
|
298
|
+
},
|
|
299
|
+
country: {
|
|
300
|
+
type: "string",
|
|
301
|
+
description: "Country code used to localize Brave results, for example 'US'."
|
|
302
|
+
},
|
|
303
|
+
search_lang: {
|
|
304
|
+
type: "string",
|
|
305
|
+
description: "Content language for Brave results, for example 'en'."
|
|
306
|
+
},
|
|
307
|
+
ui_lang: {
|
|
308
|
+
type: "string",
|
|
309
|
+
description: "UI language for response metadata, for example 'en-US'."
|
|
310
|
+
},
|
|
311
|
+
freshness: {
|
|
312
|
+
type: "string",
|
|
313
|
+
description: "Freshness filter such as 'pd' (24h), 'pw' (7d), 'pm' (31d), 'py' (year), or a Brave date range."
|
|
314
|
+
},
|
|
315
|
+
safesearch: {
|
|
316
|
+
enum: ["off", "moderate", "strict"],
|
|
317
|
+
description: "Safe-search filtering level."
|
|
318
|
+
},
|
|
319
|
+
spellcheck: {
|
|
320
|
+
type: "boolean",
|
|
321
|
+
description: "Whether Brave may spellcheck the query."
|
|
322
|
+
},
|
|
323
|
+
goggles: {
|
|
324
|
+
type: "string",
|
|
325
|
+
description: "Brave Goggles URL or inline definition."
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
description: "Options for Brave LLM Context mode."
|
|
329
|
+
},
|
|
330
|
+
news: {
|
|
331
|
+
type: "object",
|
|
332
|
+
properties: {
|
|
333
|
+
country: {
|
|
334
|
+
type: "string",
|
|
335
|
+
description: "Country code used to localize Brave results, for example 'US'."
|
|
336
|
+
},
|
|
337
|
+
search_lang: {
|
|
338
|
+
type: "string",
|
|
339
|
+
description: "Content language for Brave results, for example 'en'."
|
|
340
|
+
},
|
|
341
|
+
ui_lang: {
|
|
342
|
+
type: "string",
|
|
343
|
+
description: "UI language for response metadata, for example 'en-US'."
|
|
344
|
+
},
|
|
345
|
+
freshness: {
|
|
346
|
+
type: "string",
|
|
347
|
+
description: "Freshness filter such as 'pd' (24h), 'pw' (7d), 'pm' (31d), 'py' (year), or a Brave date range."
|
|
348
|
+
},
|
|
349
|
+
safesearch: {
|
|
350
|
+
enum: ["off", "moderate", "strict"],
|
|
351
|
+
description: "Safe-search filtering level."
|
|
352
|
+
},
|
|
353
|
+
spellcheck: {
|
|
354
|
+
type: "boolean",
|
|
355
|
+
description: "Whether Brave may spellcheck the query."
|
|
356
|
+
},
|
|
357
|
+
goggles: {
|
|
358
|
+
type: "string",
|
|
359
|
+
description: "Brave Goggles URL or inline definition."
|
|
360
|
+
},
|
|
361
|
+
extra_snippets: {
|
|
362
|
+
type: "boolean",
|
|
363
|
+
description: "Whether to ask Brave for extra snippets."
|
|
364
|
+
},
|
|
365
|
+
offset: {
|
|
366
|
+
type: "integer",
|
|
367
|
+
minimum: 0,
|
|
368
|
+
description: "Brave result page offset for paginated requests."
|
|
369
|
+
},
|
|
370
|
+
count: {
|
|
371
|
+
type: "integer",
|
|
372
|
+
minimum: 1,
|
|
373
|
+
maximum: 50,
|
|
374
|
+
description: "Mode-specific result count override. Prefer top-level maxResults unless Brave-specific pagination is needed."
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
description: "Options for Brave News Search mode."
|
|
378
|
+
},
|
|
379
|
+
videos: {
|
|
380
|
+
type: "object",
|
|
381
|
+
properties: {
|
|
382
|
+
country: {
|
|
383
|
+
type: "string",
|
|
384
|
+
description: "Country code used to localize Brave results, for example 'US'."
|
|
385
|
+
},
|
|
386
|
+
search_lang: {
|
|
387
|
+
type: "string",
|
|
388
|
+
description: "Content language for Brave results, for example 'en'."
|
|
389
|
+
},
|
|
390
|
+
ui_lang: {
|
|
391
|
+
type: "string",
|
|
392
|
+
description: "UI language for response metadata, for example 'en-US'."
|
|
393
|
+
},
|
|
394
|
+
freshness: {
|
|
395
|
+
type: "string",
|
|
396
|
+
description: "Freshness filter such as 'pd' (24h), 'pw' (7d), 'pm' (31d), 'py' (year), or a Brave date range."
|
|
397
|
+
},
|
|
398
|
+
safesearch: {
|
|
399
|
+
enum: ["off", "moderate", "strict"],
|
|
400
|
+
description: "Safe-search filtering level."
|
|
401
|
+
},
|
|
402
|
+
spellcheck: {
|
|
403
|
+
type: "boolean",
|
|
404
|
+
description: "Whether Brave may spellcheck the query."
|
|
405
|
+
},
|
|
406
|
+
offset: {
|
|
407
|
+
type: "integer",
|
|
408
|
+
minimum: 0,
|
|
409
|
+
description: "Brave result page offset for paginated requests."
|
|
410
|
+
},
|
|
411
|
+
count: {
|
|
412
|
+
type: "integer",
|
|
413
|
+
minimum: 1,
|
|
414
|
+
maximum: 50,
|
|
415
|
+
description: "Mode-specific result count override. Prefer top-level maxResults unless Brave-specific pagination is needed."
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
description: "Options for Brave Video Search mode."
|
|
419
|
+
},
|
|
420
|
+
images: {
|
|
421
|
+
type: "object",
|
|
422
|
+
properties: {
|
|
423
|
+
country: {
|
|
424
|
+
type: "string",
|
|
425
|
+
description: "Country code used to localize Brave results, for example 'US'."
|
|
426
|
+
},
|
|
427
|
+
search_lang: {
|
|
428
|
+
type: "string",
|
|
429
|
+
description: "Content language for Brave results, for example 'en'."
|
|
430
|
+
},
|
|
431
|
+
ui_lang: {
|
|
432
|
+
type: "string",
|
|
433
|
+
description: "UI language for response metadata, for example 'en-US'."
|
|
434
|
+
},
|
|
435
|
+
safesearch: {
|
|
436
|
+
enum: ["off", "moderate", "strict"],
|
|
437
|
+
description: "Safe-search filtering level."
|
|
438
|
+
},
|
|
439
|
+
spellcheck: {
|
|
440
|
+
type: "boolean",
|
|
441
|
+
description: "Whether Brave may spellcheck the query."
|
|
442
|
+
},
|
|
443
|
+
count: {
|
|
444
|
+
type: "integer",
|
|
445
|
+
minimum: 1,
|
|
446
|
+
maximum: 50,
|
|
447
|
+
description: "Mode-specific result count override. Prefer top-level maxResults unless Brave-specific pagination is needed."
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
description: "Options for Brave Image Search mode."
|
|
451
|
+
},
|
|
452
|
+
places: {
|
|
453
|
+
type: "object",
|
|
454
|
+
properties: {
|
|
455
|
+
country: {
|
|
456
|
+
type: "string",
|
|
457
|
+
description: "Country code used to localize Brave results, for example 'US'."
|
|
458
|
+
},
|
|
459
|
+
search_lang: {
|
|
460
|
+
type: "string",
|
|
461
|
+
description: "Content language for Brave results, for example 'en'."
|
|
462
|
+
},
|
|
463
|
+
ui_lang: {
|
|
464
|
+
type: "string",
|
|
465
|
+
description: "UI language for response metadata, for example 'en-US'."
|
|
466
|
+
},
|
|
467
|
+
latitude: {
|
|
468
|
+
type: "number",
|
|
469
|
+
description: "Latitude for local place search."
|
|
470
|
+
},
|
|
471
|
+
longitude: {
|
|
472
|
+
type: "number",
|
|
473
|
+
description: "Longitude for local place search."
|
|
474
|
+
},
|
|
475
|
+
location: {
|
|
476
|
+
type: "string",
|
|
477
|
+
description: "Human-readable local search location, e.g. 'Eppendorf, Hamburg, Germany'. Use with mode='places' for neighborhood or near-me style searches."
|
|
478
|
+
},
|
|
479
|
+
radius: {
|
|
480
|
+
type: "number",
|
|
481
|
+
description: "Local search radius."
|
|
482
|
+
},
|
|
483
|
+
units: {
|
|
484
|
+
type: "string",
|
|
485
|
+
description: "Distance units for local search."
|
|
486
|
+
},
|
|
487
|
+
safesearch: {
|
|
488
|
+
enum: ["off", "moderate", "strict"],
|
|
489
|
+
description: "Safe-search filtering level."
|
|
490
|
+
},
|
|
491
|
+
spellcheck: {
|
|
492
|
+
type: "boolean",
|
|
493
|
+
description: "Whether Brave may spellcheck the query."
|
|
494
|
+
},
|
|
495
|
+
geoloc: {
|
|
496
|
+
type: "string",
|
|
497
|
+
description: "Optional geolocation token used to refine results."
|
|
498
|
+
},
|
|
499
|
+
count: {
|
|
500
|
+
type: "integer",
|
|
501
|
+
minimum: 1,
|
|
502
|
+
maximum: 50,
|
|
503
|
+
description: "Mode-specific result count override. Prefer top-level maxResults unless Brave-specific pagination is needed."
|
|
504
|
+
},
|
|
505
|
+
includeDetails: {
|
|
506
|
+
type: "boolean",
|
|
507
|
+
description: "Places mode only. Fetch detailed POI metadata when the task needs contact info, opening hours, ratings/review counts, photos, profiles, or richer address/distance data. Leave off for simple place listings to avoid extra latency and quota usage."
|
|
508
|
+
},
|
|
509
|
+
includeDescriptions: {
|
|
510
|
+
type: "boolean",
|
|
511
|
+
description: "Places mode only. Fetch AI-generated POI descriptions when the task needs qualitative summaries or short explanations of places. Leave off for simple nearby/place listing queries to avoid extra latency and quota usage."
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
description: "Options for Brave Local Place Search mode."
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
description: "Brave search options."
|
|
518
|
+
},
|
|
519
|
+
promptGuidelines: [
|
|
520
|
+
"Use Brave places mode for direct point-of-interest listings such as restaurants, cafes, hotels, shops, landmarks, or venues.",
|
|
521
|
+
"Prefer Brave places mode over llm_context when the user asks for nearby businesses or wants names, addresses, ratings, opening hours, categories, or contact details.",
|
|
522
|
+
"In Brave places mode, set places.includeDetails when the task needs POI attributes beyond the basic result list, such as contact info, opening hours, ratings/review counts, photos, profiles, or richer address/distance metadata.",
|
|
523
|
+
"In Brave places mode, set places.includeDescriptions when the task needs qualitative summaries or short explanations of places. Leave it off for simple nearby/place listing queries to avoid extra latency and quota usage.",
|
|
524
|
+
"Use Brave llm_context mode when the agent needs extracted source context for reasoning, synthesis, RAG-style grounding, or source-material collection.",
|
|
525
|
+
"In Brave llm_context mode, set llmContext.enable_local=true for local or near-me queries where POI/map grounding may be useful."
|
|
526
|
+
],
|
|
527
|
+
retrySafe: true
|
|
528
|
+
},
|
|
529
|
+
answer: {
|
|
530
|
+
options: {
|
|
531
|
+
type: "object",
|
|
532
|
+
properties: {
|
|
533
|
+
model: {
|
|
534
|
+
enum: ["brave", "brave-pro"],
|
|
535
|
+
description: "Brave Answers model. Defaults to 'brave'."
|
|
536
|
+
},
|
|
537
|
+
country: {
|
|
538
|
+
type: "string"
|
|
539
|
+
},
|
|
540
|
+
language: {
|
|
541
|
+
type: "string"
|
|
542
|
+
},
|
|
543
|
+
safesearch: {
|
|
544
|
+
enum: ["off", "moderate", "strict"],
|
|
545
|
+
description: "Safe-search filtering level."
|
|
546
|
+
},
|
|
547
|
+
enable_citations: {
|
|
548
|
+
type: "boolean"
|
|
549
|
+
},
|
|
550
|
+
enable_entities: {
|
|
551
|
+
type: "boolean"
|
|
552
|
+
},
|
|
553
|
+
max_completion_tokens: {
|
|
554
|
+
type: "integer",
|
|
555
|
+
minimum: 1
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
description: "Brave answer options."
|
|
559
|
+
},
|
|
560
|
+
retrySafe: false
|
|
561
|
+
},
|
|
562
|
+
research: {
|
|
563
|
+
options: {
|
|
564
|
+
type: "object",
|
|
565
|
+
properties: {
|
|
566
|
+
model: {
|
|
567
|
+
enum: ["brave", "brave-pro"],
|
|
568
|
+
description: "Brave Answers model. Defaults to 'brave'."
|
|
569
|
+
},
|
|
570
|
+
country: {
|
|
571
|
+
type: "string"
|
|
572
|
+
},
|
|
573
|
+
language: {
|
|
574
|
+
type: "string"
|
|
575
|
+
},
|
|
576
|
+
safesearch: {
|
|
577
|
+
enum: ["off", "moderate", "strict"],
|
|
578
|
+
description: "Safe-search filtering level."
|
|
579
|
+
},
|
|
580
|
+
enable_entities: {
|
|
581
|
+
type: "boolean"
|
|
582
|
+
},
|
|
583
|
+
enable_citations: {
|
|
584
|
+
type: "boolean",
|
|
585
|
+
description: "Accepted for compatibility but forced to false for Brave research mode."
|
|
586
|
+
},
|
|
587
|
+
max_completion_tokens: {
|
|
588
|
+
type: "integer",
|
|
589
|
+
minimum: 1
|
|
590
|
+
},
|
|
591
|
+
research_allow_thinking: {
|
|
592
|
+
type: "boolean"
|
|
593
|
+
},
|
|
594
|
+
research_maximum_number_of_tokens_per_query: {
|
|
595
|
+
type: "integer",
|
|
596
|
+
minimum: 1
|
|
597
|
+
},
|
|
598
|
+
research_maximum_number_of_queries: {
|
|
599
|
+
type: "integer",
|
|
600
|
+
minimum: 1
|
|
601
|
+
},
|
|
602
|
+
research_maximum_number_of_iterations: {
|
|
603
|
+
type: "integer",
|
|
604
|
+
minimum: 1
|
|
605
|
+
},
|
|
606
|
+
research_maximum_number_of_seconds: {
|
|
607
|
+
type: "integer",
|
|
608
|
+
minimum: 1
|
|
609
|
+
},
|
|
610
|
+
research_maximum_number_of_results_per_query: {
|
|
611
|
+
type: "integer",
|
|
612
|
+
minimum: 1
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
description: "Brave research options."
|
|
616
|
+
},
|
|
617
|
+
retrySafe: false
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
load: async () => (await import("./adapter-67TIISDW.js")).adapter
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
// src/providers/cloudflare/definition.ts
|
|
624
|
+
var cloudflareProvider = defineProvider({
|
|
625
|
+
id: "cloudflare",
|
|
626
|
+
label: "Cloudflare",
|
|
627
|
+
docsUrl: "https://developers.cloudflare.com/browser-rendering/",
|
|
628
|
+
local: false,
|
|
629
|
+
credentials: [
|
|
630
|
+
{
|
|
631
|
+
name: "api",
|
|
632
|
+
environmentVariable: "CLOUDFLARE_API_TOKEN"
|
|
633
|
+
}
|
|
634
|
+
],
|
|
635
|
+
fields: ["credentials", "accountId", "options"],
|
|
636
|
+
defaults: {
|
|
637
|
+
contents: {
|
|
638
|
+
gotoOptions: {
|
|
639
|
+
waitUntil: "networkidle0"
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
credentialDefaults: {
|
|
644
|
+
accountId: {
|
|
645
|
+
env: "CLOUDFLARE_ACCOUNT_ID"
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
capabilities: {
|
|
649
|
+
contents: {
|
|
650
|
+
options: {
|
|
651
|
+
type: "object",
|
|
652
|
+
properties: {
|
|
653
|
+
cacheTTL: {
|
|
654
|
+
type: "number",
|
|
655
|
+
minimum: 0,
|
|
656
|
+
description: "Cache lifetime in seconds; 0 disables caching."
|
|
657
|
+
},
|
|
658
|
+
actionTimeout: {
|
|
659
|
+
type: "number",
|
|
660
|
+
minimum: 0,
|
|
661
|
+
description: "Post-navigation action timeout in milliseconds."
|
|
662
|
+
},
|
|
663
|
+
waitForTimeout: {
|
|
664
|
+
type: "number",
|
|
665
|
+
minimum: 0,
|
|
666
|
+
description: "Milliseconds to wait before extraction."
|
|
667
|
+
},
|
|
668
|
+
waitForSelector: {
|
|
669
|
+
type: "object",
|
|
670
|
+
required: ["selector"],
|
|
671
|
+
properties: {
|
|
672
|
+
selector: { type: "string", minLength: 1 },
|
|
673
|
+
timeout: { type: "number", minimum: 0 },
|
|
674
|
+
visible: { type: "boolean", const: true },
|
|
675
|
+
hidden: { type: "boolean", const: true }
|
|
676
|
+
},
|
|
677
|
+
description: "Wait for a page element."
|
|
678
|
+
},
|
|
679
|
+
userAgent: { type: "string", description: "Browser user agent." },
|
|
680
|
+
setJavaScriptEnabled: {
|
|
681
|
+
type: "boolean",
|
|
682
|
+
description: "Enable page JavaScript."
|
|
683
|
+
},
|
|
684
|
+
gotoOptions: {
|
|
685
|
+
type: "object",
|
|
686
|
+
properties: {
|
|
687
|
+
timeout: {
|
|
688
|
+
type: "number",
|
|
689
|
+
minimum: 0,
|
|
690
|
+
description: "Navigation timeout in milliseconds."
|
|
691
|
+
},
|
|
692
|
+
waitUntil: {
|
|
693
|
+
anyOf: [
|
|
694
|
+
{
|
|
695
|
+
type: "string",
|
|
696
|
+
const: "load"
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
type: "string",
|
|
700
|
+
const: "domcontentloaded"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
type: "string",
|
|
704
|
+
const: "networkidle0"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
type: "string",
|
|
708
|
+
const: "networkidle2"
|
|
709
|
+
}
|
|
710
|
+
],
|
|
711
|
+
description: "When to consider navigation complete."
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
description: "Navigation options."
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
description: "Cloudflare Browser Rendering options."
|
|
718
|
+
},
|
|
719
|
+
retrySafe: true
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
load: async () => (await import("./adapter-AUYLTDPM.js")).adapter
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
// src/providers/custom/definition.ts
|
|
726
|
+
var customProvider = defineProvider({
|
|
727
|
+
id: "custom",
|
|
728
|
+
label: "Custom",
|
|
729
|
+
docsUrl: "https://github.com/mavam/pi-web-providers/blob/main/docs/provider.md#custom",
|
|
730
|
+
local: true,
|
|
731
|
+
credentials: [],
|
|
732
|
+
fields: ["commands", "options"],
|
|
733
|
+
defaults: {},
|
|
734
|
+
credentialDefaults: {},
|
|
735
|
+
capabilities: {
|
|
736
|
+
search: {
|
|
737
|
+
retrySafe: true
|
|
738
|
+
},
|
|
739
|
+
contents: {
|
|
740
|
+
retrySafe: true
|
|
741
|
+
},
|
|
742
|
+
answer: {
|
|
743
|
+
retrySafe: false
|
|
744
|
+
},
|
|
745
|
+
research: {
|
|
746
|
+
retrySafe: false
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
load: async () => (await import("./adapter-MAG7X663.js")).adapter
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
// src/providers/exa/definition.ts
|
|
753
|
+
var exaProvider = defineProvider({
|
|
754
|
+
id: "exa",
|
|
755
|
+
label: "Exa",
|
|
756
|
+
docsUrl: "https://exa.ai/docs/sdks/typescript-sdk-specification",
|
|
757
|
+
local: false,
|
|
758
|
+
credentials: [
|
|
759
|
+
{
|
|
760
|
+
name: "api",
|
|
761
|
+
environmentVariable: "EXA_API_KEY"
|
|
762
|
+
}
|
|
763
|
+
],
|
|
764
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
765
|
+
defaults: {
|
|
766
|
+
search: {
|
|
767
|
+
type: "auto",
|
|
768
|
+
contents: {
|
|
769
|
+
text: true
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
credentialDefaults: {},
|
|
774
|
+
capabilities: {
|
|
775
|
+
search: {
|
|
776
|
+
options: {
|
|
777
|
+
type: "object",
|
|
778
|
+
properties: {
|
|
779
|
+
type: {
|
|
780
|
+
anyOf: [
|
|
781
|
+
{
|
|
782
|
+
type: "string",
|
|
783
|
+
const: "keyword"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
type: "string",
|
|
787
|
+
const: "neural"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
type: "string",
|
|
791
|
+
const: "auto"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
type: "string",
|
|
795
|
+
const: "hybrid"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
type: "string",
|
|
799
|
+
const: "fast"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
type: "string",
|
|
803
|
+
const: "instant"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
type: "string",
|
|
807
|
+
const: "deep-lite"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
type: "string",
|
|
811
|
+
const: "deep"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
type: "string",
|
|
815
|
+
const: "deep-reasoning"
|
|
816
|
+
}
|
|
817
|
+
],
|
|
818
|
+
description: "Exa search mode."
|
|
819
|
+
},
|
|
820
|
+
category: {
|
|
821
|
+
type: "string",
|
|
822
|
+
description: "Filter by category (e.g., 'company', 'research paper')."
|
|
823
|
+
},
|
|
824
|
+
includeDomains: {
|
|
825
|
+
type: "array",
|
|
826
|
+
items: {
|
|
827
|
+
type: "string"
|
|
828
|
+
},
|
|
829
|
+
description: "Restrict results to these domains."
|
|
830
|
+
},
|
|
831
|
+
excludeDomains: {
|
|
832
|
+
type: "array",
|
|
833
|
+
items: {
|
|
834
|
+
type: "string"
|
|
835
|
+
},
|
|
836
|
+
description: "Exclude these domains."
|
|
837
|
+
},
|
|
838
|
+
startPublishedDate: {
|
|
839
|
+
type: "string",
|
|
840
|
+
description: "ISO date string for earliest publish date."
|
|
841
|
+
},
|
|
842
|
+
endPublishedDate: {
|
|
843
|
+
type: "string",
|
|
844
|
+
description: "ISO date string for latest publish date."
|
|
845
|
+
},
|
|
846
|
+
includeText: {
|
|
847
|
+
type: "array",
|
|
848
|
+
items: {
|
|
849
|
+
type: "string"
|
|
850
|
+
},
|
|
851
|
+
description: "Require result page text to contain these terms. Exa currently supports one short phrase."
|
|
852
|
+
},
|
|
853
|
+
excludeText: {
|
|
854
|
+
type: "array",
|
|
855
|
+
items: {
|
|
856
|
+
type: "string"
|
|
857
|
+
},
|
|
858
|
+
description: "Require result page text not to contain these terms. Exa currently supports one short phrase."
|
|
859
|
+
},
|
|
860
|
+
systemPrompt: {
|
|
861
|
+
type: "string",
|
|
862
|
+
description: "Additional Exa instructions for deep search source selection and synthesis."
|
|
863
|
+
},
|
|
864
|
+
additionalQueries: {
|
|
865
|
+
type: "array",
|
|
866
|
+
items: {
|
|
867
|
+
type: "string"
|
|
868
|
+
},
|
|
869
|
+
maxItems: 5,
|
|
870
|
+
description: "Alternative query formulations for Exa deep search variants."
|
|
871
|
+
},
|
|
872
|
+
userLocation: {
|
|
873
|
+
type: "string",
|
|
874
|
+
description: "Two-letter ISO country code for the user location, such as 'US'."
|
|
875
|
+
},
|
|
876
|
+
contents: {
|
|
877
|
+
type: "object",
|
|
878
|
+
properties: {
|
|
879
|
+
text: {
|
|
880
|
+
anyOf: [
|
|
881
|
+
{
|
|
882
|
+
type: "boolean"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
type: "object",
|
|
886
|
+
properties: {
|
|
887
|
+
maxCharacters: {
|
|
888
|
+
type: "integer",
|
|
889
|
+
minimum: 1,
|
|
890
|
+
description: "Maximum text characters per result."
|
|
891
|
+
},
|
|
892
|
+
includeHtmlTags: {
|
|
893
|
+
type: "boolean",
|
|
894
|
+
description: "Include HTML tags in returned text."
|
|
895
|
+
},
|
|
896
|
+
verbosity: {
|
|
897
|
+
anyOf: [
|
|
898
|
+
{
|
|
899
|
+
type: "string",
|
|
900
|
+
const: "compact"
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
type: "string",
|
|
904
|
+
const: "standard"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
type: "string",
|
|
908
|
+
const: "full"
|
|
909
|
+
}
|
|
910
|
+
],
|
|
911
|
+
description: "Verbosity level for returned text."
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
additionalProperties: false
|
|
915
|
+
}
|
|
916
|
+
],
|
|
917
|
+
description: "Include text content."
|
|
918
|
+
},
|
|
919
|
+
highlights: {
|
|
920
|
+
anyOf: [
|
|
921
|
+
{
|
|
922
|
+
type: "boolean"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
type: "object",
|
|
926
|
+
properties: {
|
|
927
|
+
query: {
|
|
928
|
+
type: "string",
|
|
929
|
+
description: "Query to use for highlights."
|
|
930
|
+
},
|
|
931
|
+
maxCharacters: {
|
|
932
|
+
type: "integer",
|
|
933
|
+
minimum: 1,
|
|
934
|
+
description: "Maximum highlight characters."
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
additionalProperties: false
|
|
938
|
+
}
|
|
939
|
+
],
|
|
940
|
+
description: "Include highlighted excerpts."
|
|
941
|
+
},
|
|
942
|
+
summary: {
|
|
943
|
+
anyOf: [
|
|
944
|
+
{
|
|
945
|
+
type: "boolean"
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
type: "object",
|
|
949
|
+
properties: {
|
|
950
|
+
query: {
|
|
951
|
+
type: "string",
|
|
952
|
+
description: "Query to guide summary generation."
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
additionalProperties: false
|
|
956
|
+
}
|
|
957
|
+
],
|
|
958
|
+
description: "Include AI-generated summary."
|
|
959
|
+
},
|
|
960
|
+
livecrawlTimeout: {
|
|
961
|
+
type: "integer",
|
|
962
|
+
minimum: 1,
|
|
963
|
+
maximum: 9e4,
|
|
964
|
+
description: "Content-fetch timeout in milliseconds (1\u201390000). Does not select a freshness policy."
|
|
965
|
+
},
|
|
966
|
+
maxAgeHours: {
|
|
967
|
+
type: "integer",
|
|
968
|
+
minimum: -1,
|
|
969
|
+
maximum: 720,
|
|
970
|
+
description: "Content freshness in whole hours: 0 fetches fresh, -1 uses cache only, 1\u2013720 bounds cache age. Omit for fallback fetching. Set only inside options.contents; do not also send deprecated livecrawl."
|
|
971
|
+
},
|
|
972
|
+
filterEmptyResults: {
|
|
973
|
+
type: "boolean",
|
|
974
|
+
description: "Filter results with no contents."
|
|
975
|
+
},
|
|
976
|
+
subpages: {
|
|
977
|
+
type: "integer",
|
|
978
|
+
minimum: 0,
|
|
979
|
+
description: "Number of subpages to return for each result."
|
|
980
|
+
},
|
|
981
|
+
subpageTarget: {
|
|
982
|
+
anyOf: [
|
|
983
|
+
{
|
|
984
|
+
type: "string"
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
type: "array",
|
|
988
|
+
items: {
|
|
989
|
+
type: "string"
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
description: "Text used to match/rank returned subpages."
|
|
994
|
+
},
|
|
995
|
+
extras: {
|
|
996
|
+
type: "object",
|
|
997
|
+
properties: {
|
|
998
|
+
links: {
|
|
999
|
+
type: "integer",
|
|
1000
|
+
minimum: 0,
|
|
1001
|
+
description: "Number of page links to include."
|
|
1002
|
+
},
|
|
1003
|
+
imageLinks: {
|
|
1004
|
+
type: "integer",
|
|
1005
|
+
minimum: 0,
|
|
1006
|
+
description: "Number of image links to include."
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
additionalProperties: false
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
additionalProperties: false,
|
|
1013
|
+
description: "Content extraction and freshness controls. Put text, highlights, summary, maxAgeHours, and livecrawlTimeout here, not directly in options."
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
description: "Exa search options."
|
|
1017
|
+
},
|
|
1018
|
+
promptGuidelines: [
|
|
1019
|
+
"Use Exa's neural/auto search modes for semantic source discovery where exact keywords are uncertain; use keyword mode when exact terms, names, or identifiers matter.",
|
|
1020
|
+
"Use Exa category filters such as 'research paper' or 'company' when the user asks for a specific source type.",
|
|
1021
|
+
"Set includeDomains or excludeDomains when the task names preferred sources, requires primary sources, or needs noisy domains filtered out.",
|
|
1022
|
+
"For fresh Exa search content, use options.contents.maxAgeHours=0; for cache-only retrieval use -1. Never put maxAgeHours at the top level of options.",
|
|
1023
|
+
"Do not send deprecated livecrawl, even alongside maxAgeHours. Remove livecrawl rather than moving it into contents. Exa ignores startCrawlDate/endCrawlDate; use startPublishedDate/endPublishedDate to filter publication dates, not cache freshness.",
|
|
1024
|
+
"Use includeText/excludeText for short required or forbidden phrases in page text.",
|
|
1025
|
+
"Request contents.text, contents.highlights, or contents.summary only when snippets are insufficient and richer source context is needed directly in search results."
|
|
1026
|
+
],
|
|
1027
|
+
retrySafe: true
|
|
1028
|
+
},
|
|
1029
|
+
contents: {
|
|
1030
|
+
retrySafe: true
|
|
1031
|
+
},
|
|
1032
|
+
answer: {
|
|
1033
|
+
retrySafe: false
|
|
1034
|
+
},
|
|
1035
|
+
research: {
|
|
1036
|
+
retrySafe: false
|
|
1037
|
+
}
|
|
1038
|
+
},
|
|
1039
|
+
load: async () => (await import("./adapter-PADXKW43.js")).adapter
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
// src/providers/firecrawl/definition.ts
|
|
1043
|
+
var strings = { type: "array", items: { type: "string" } };
|
|
1044
|
+
var formats = {
|
|
1045
|
+
type: "array",
|
|
1046
|
+
items: {
|
|
1047
|
+
type: "string",
|
|
1048
|
+
enum: [
|
|
1049
|
+
"markdown",
|
|
1050
|
+
"html",
|
|
1051
|
+
"rawHtml",
|
|
1052
|
+
"links",
|
|
1053
|
+
"images",
|
|
1054
|
+
"screenshot",
|
|
1055
|
+
"summary",
|
|
1056
|
+
"json",
|
|
1057
|
+
"attributes",
|
|
1058
|
+
"changeTracking"
|
|
1059
|
+
]
|
|
1060
|
+
},
|
|
1061
|
+
description: "Output formats for scraping."
|
|
1062
|
+
};
|
|
1063
|
+
var scrapeProperties = {
|
|
1064
|
+
timeout: {
|
|
1065
|
+
type: "integer",
|
|
1066
|
+
minimum: 1,
|
|
1067
|
+
description: "Request timeout in milliseconds."
|
|
1068
|
+
},
|
|
1069
|
+
onlyMainContent: {
|
|
1070
|
+
type: "boolean",
|
|
1071
|
+
description: "Extract only the main content."
|
|
1072
|
+
},
|
|
1073
|
+
includeTags: { ...strings, description: "CSS selectors to include." },
|
|
1074
|
+
excludeTags: { ...strings, description: "CSS selectors to exclude." },
|
|
1075
|
+
waitFor: {
|
|
1076
|
+
type: "integer",
|
|
1077
|
+
minimum: 0,
|
|
1078
|
+
description: "Milliseconds to wait before scraping."
|
|
1079
|
+
},
|
|
1080
|
+
headers: {
|
|
1081
|
+
type: "object",
|
|
1082
|
+
patternProperties: { "^.*$": { type: "string" } },
|
|
1083
|
+
description: "Headers to send when scraping."
|
|
1084
|
+
},
|
|
1085
|
+
location: {
|
|
1086
|
+
type: "object",
|
|
1087
|
+
properties: {
|
|
1088
|
+
country: { type: "string", description: "Country code." },
|
|
1089
|
+
languages: { ...strings, description: "Preferred languages." }
|
|
1090
|
+
},
|
|
1091
|
+
description: "Scrape location; unlike search location, this is an object."
|
|
1092
|
+
},
|
|
1093
|
+
mobile: { type: "boolean", description: "Use a mobile browser profile." },
|
|
1094
|
+
proxy: {
|
|
1095
|
+
type: "string",
|
|
1096
|
+
description: "Proxy mode supported by your Firecrawl deployment."
|
|
1097
|
+
},
|
|
1098
|
+
fastMode: { type: "boolean", description: "Use Firecrawl fast mode." },
|
|
1099
|
+
blockAds: { type: "boolean", description: "Block ads while scraping." },
|
|
1100
|
+
removeBase64Images: {
|
|
1101
|
+
type: "boolean",
|
|
1102
|
+
description: "Remove base64 image data from output."
|
|
1103
|
+
},
|
|
1104
|
+
redactPII: {
|
|
1105
|
+
anyOf: [
|
|
1106
|
+
{ type: "boolean" },
|
|
1107
|
+
{
|
|
1108
|
+
type: "object",
|
|
1109
|
+
properties: {
|
|
1110
|
+
entities: {
|
|
1111
|
+
type: "array",
|
|
1112
|
+
items: {
|
|
1113
|
+
type: "string",
|
|
1114
|
+
enum: [
|
|
1115
|
+
"PERSON",
|
|
1116
|
+
"EMAIL",
|
|
1117
|
+
"PHONE",
|
|
1118
|
+
"LOCATION",
|
|
1119
|
+
"FINANCIAL",
|
|
1120
|
+
"SECRET"
|
|
1121
|
+
]
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
mode: { type: "string", enum: ["accurate", "aggressive", "fast"] }
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
],
|
|
1128
|
+
description: "Redact personal or sensitive data from output."
|
|
1129
|
+
},
|
|
1130
|
+
maxAge: {
|
|
1131
|
+
type: "number",
|
|
1132
|
+
minimum: 0,
|
|
1133
|
+
description: "Maximum cached scrape age in milliseconds; 0 bypasses reuse."
|
|
1134
|
+
},
|
|
1135
|
+
minAge: {
|
|
1136
|
+
type: "number",
|
|
1137
|
+
minimum: 0,
|
|
1138
|
+
description: "Minimum cached scrape age in milliseconds."
|
|
1139
|
+
},
|
|
1140
|
+
storeInCache: {
|
|
1141
|
+
type: "boolean",
|
|
1142
|
+
description: "Store the scrape result in cache."
|
|
1143
|
+
},
|
|
1144
|
+
skipTlsVerification: {
|
|
1145
|
+
type: "boolean",
|
|
1146
|
+
description: "Skip TLS certificate verification."
|
|
1147
|
+
}
|
|
1148
|
+
};
|
|
1149
|
+
var firecrawlProvider = defineProvider({
|
|
1150
|
+
id: "firecrawl",
|
|
1151
|
+
label: "Firecrawl",
|
|
1152
|
+
docsUrl: "https://docs.firecrawl.dev/sdks/node",
|
|
1153
|
+
local: false,
|
|
1154
|
+
credentials: [
|
|
1155
|
+
{ name: "api", environmentVariable: "FIRECRAWL_API_KEY", optional: true }
|
|
1156
|
+
],
|
|
1157
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
1158
|
+
defaults: { contents: { formats: ["markdown"], onlyMainContent: true } },
|
|
1159
|
+
credentialDefaults: {},
|
|
1160
|
+
capabilities: {
|
|
1161
|
+
search: {
|
|
1162
|
+
options: {
|
|
1163
|
+
type: "object",
|
|
1164
|
+
properties: {
|
|
1165
|
+
sources: {
|
|
1166
|
+
type: "array",
|
|
1167
|
+
items: { type: "string", enum: ["web", "news", "images"] },
|
|
1168
|
+
description: "Search source groups."
|
|
1169
|
+
},
|
|
1170
|
+
categories: {
|
|
1171
|
+
type: "array",
|
|
1172
|
+
items: {
|
|
1173
|
+
type: "string",
|
|
1174
|
+
enum: ["github", "research", "pdf", "developer"]
|
|
1175
|
+
},
|
|
1176
|
+
description: "Search categories."
|
|
1177
|
+
},
|
|
1178
|
+
includeDomains: {
|
|
1179
|
+
...strings,
|
|
1180
|
+
description: "Restrict results to these domains."
|
|
1181
|
+
},
|
|
1182
|
+
excludeDomains: { ...strings, description: "Exclude these domains." },
|
|
1183
|
+
tbs: {
|
|
1184
|
+
type: "string",
|
|
1185
|
+
description: "Google-style time-based search filter."
|
|
1186
|
+
},
|
|
1187
|
+
ignoreInvalidURLs: {
|
|
1188
|
+
type: "boolean",
|
|
1189
|
+
description: "Ignore invalid result URLs."
|
|
1190
|
+
},
|
|
1191
|
+
location: {
|
|
1192
|
+
type: "string",
|
|
1193
|
+
description: "Search location, for example 'Berlin, Germany'. Not a scrape location object."
|
|
1194
|
+
},
|
|
1195
|
+
timeout: scrapeProperties.timeout,
|
|
1196
|
+
highlights: {
|
|
1197
|
+
type: "boolean",
|
|
1198
|
+
description: "Generate query-relevant highlights."
|
|
1199
|
+
},
|
|
1200
|
+
scrapeOptions: {
|
|
1201
|
+
type: "object",
|
|
1202
|
+
properties: { formats, ...scrapeProperties },
|
|
1203
|
+
description: "Options for scraping each search result."
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
description: "Firecrawl search options."
|
|
1207
|
+
},
|
|
1208
|
+
promptGuidelines: [
|
|
1209
|
+
"Use Firecrawl search when results should also include scraped page content through scrapeOptions.",
|
|
1210
|
+
"Set options.scrapeOptions.formats=['markdown'] and options.scrapeOptions.onlyMainContent=true for extracted page context.",
|
|
1211
|
+
"Use includeDomains/excludeDomains for source constraints. Use location as a string for local search; scraping uses a separate location object with country and languages.",
|
|
1212
|
+
"Prefer web_contents after search when only a small set of known URLs needs full extraction."
|
|
1213
|
+
],
|
|
1214
|
+
retrySafe: true
|
|
1215
|
+
},
|
|
1216
|
+
contents: {
|
|
1217
|
+
options: {
|
|
1218
|
+
type: "object",
|
|
1219
|
+
properties: { formats, ...scrapeProperties },
|
|
1220
|
+
description: "Firecrawl scrape options."
|
|
1221
|
+
},
|
|
1222
|
+
retrySafe: true
|
|
1223
|
+
},
|
|
1224
|
+
answer: {
|
|
1225
|
+
options: {
|
|
1226
|
+
type: "object",
|
|
1227
|
+
required: ["url"],
|
|
1228
|
+
properties: {
|
|
1229
|
+
url: {
|
|
1230
|
+
type: "string",
|
|
1231
|
+
minLength: 1,
|
|
1232
|
+
description: "URL of the page to ask about."
|
|
1233
|
+
},
|
|
1234
|
+
...scrapeProperties
|
|
1235
|
+
},
|
|
1236
|
+
description: "Firecrawl page-question options. The URL is required; the question comes from the web_answer query."
|
|
1237
|
+
},
|
|
1238
|
+
promptGuidelines: [
|
|
1239
|
+
"Firecrawl web_answer is page-scoped: set options.url to the specific page URL to ask about.",
|
|
1240
|
+
"Do not use Firecrawl web_answer for general multi-source answers; use web_search plus web_contents or web_research instead."
|
|
1241
|
+
],
|
|
1242
|
+
retrySafe: false
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
load: async () => (await import("./adapter-XBAQSK7I.js")).adapter
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
// src/providers/gemini/definition.ts
|
|
1249
|
+
var geminiProvider = defineProvider({
|
|
1250
|
+
id: "gemini",
|
|
1251
|
+
label: "Gemini",
|
|
1252
|
+
docsUrl: "https://github.com/googleapis/js-genai",
|
|
1253
|
+
local: false,
|
|
1254
|
+
credentials: [
|
|
1255
|
+
{
|
|
1256
|
+
name: "api",
|
|
1257
|
+
environmentVariable: "GOOGLE_API_KEY"
|
|
1258
|
+
}
|
|
1259
|
+
],
|
|
1260
|
+
fields: ["credentials", "options"],
|
|
1261
|
+
defaults: {
|
|
1262
|
+
answer: {
|
|
1263
|
+
model: "gemini-3.8-flash"
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
credentialDefaults: {},
|
|
1267
|
+
capabilities: {
|
|
1268
|
+
answer: {
|
|
1269
|
+
options: {
|
|
1270
|
+
type: "object",
|
|
1271
|
+
properties: {
|
|
1272
|
+
model: {
|
|
1273
|
+
type: "string",
|
|
1274
|
+
description: "Gemini model for answers (defaults to 'gemini-3.8-flash')."
|
|
1275
|
+
},
|
|
1276
|
+
config: {
|
|
1277
|
+
type: "object",
|
|
1278
|
+
properties: {
|
|
1279
|
+
thinkingConfig: {
|
|
1280
|
+
type: "object",
|
|
1281
|
+
properties: {
|
|
1282
|
+
thinkingLevel: {
|
|
1283
|
+
type: "string",
|
|
1284
|
+
enum: ["MINIMAL", "LOW", "MEDIUM", "HIGH"],
|
|
1285
|
+
description: "Model-specific thinking depth."
|
|
1286
|
+
},
|
|
1287
|
+
thinkingBudget: {
|
|
1288
|
+
type: "integer",
|
|
1289
|
+
minimum: -1,
|
|
1290
|
+
description: "Legacy thinking budget; -1 automatic, 0 disabled. Not supported by newer models that require thinkingLevel."
|
|
1291
|
+
},
|
|
1292
|
+
includeThoughts: {
|
|
1293
|
+
type: "boolean",
|
|
1294
|
+
description: "Include available thought summaries."
|
|
1295
|
+
}
|
|
1296
|
+
},
|
|
1297
|
+
description: "Generate-content thinking settings; choose controls supported by the selected model."
|
|
1298
|
+
},
|
|
1299
|
+
labels: {
|
|
1300
|
+
type: "object",
|
|
1301
|
+
patternProperties: {
|
|
1302
|
+
"^.*$": {
|
|
1303
|
+
type: "string"
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
description: "Request labels to attach to the Gemini call."
|
|
1307
|
+
},
|
|
1308
|
+
temperature: {
|
|
1309
|
+
type: "number",
|
|
1310
|
+
description: "Sampling temperature."
|
|
1311
|
+
},
|
|
1312
|
+
topP: {
|
|
1313
|
+
type: "number",
|
|
1314
|
+
description: "Top-p sampling value."
|
|
1315
|
+
},
|
|
1316
|
+
topK: {
|
|
1317
|
+
type: "integer",
|
|
1318
|
+
minimum: 0,
|
|
1319
|
+
description: "Top-k sampling value."
|
|
1320
|
+
},
|
|
1321
|
+
candidateCount: {
|
|
1322
|
+
type: "integer",
|
|
1323
|
+
minimum: 1,
|
|
1324
|
+
description: "Number of candidates to generate."
|
|
1325
|
+
},
|
|
1326
|
+
maxOutputTokens: {
|
|
1327
|
+
type: "integer",
|
|
1328
|
+
minimum: 1,
|
|
1329
|
+
description: "Maximum output tokens."
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
description: "Gemini generate-content config overrides."
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
description: "Gemini answer options."
|
|
1336
|
+
},
|
|
1337
|
+
retrySafe: false
|
|
1338
|
+
},
|
|
1339
|
+
research: {
|
|
1340
|
+
options: {
|
|
1341
|
+
type: "object",
|
|
1342
|
+
properties: {
|
|
1343
|
+
agent_config: {
|
|
1344
|
+
type: "object",
|
|
1345
|
+
properties: {
|
|
1346
|
+
thinking_summaries: {
|
|
1347
|
+
anyOf: [
|
|
1348
|
+
{
|
|
1349
|
+
type: "string",
|
|
1350
|
+
const: "auto"
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
type: "string",
|
|
1354
|
+
const: "none"
|
|
1355
|
+
}
|
|
1356
|
+
],
|
|
1357
|
+
description: "Whether to include thought summaries in the response."
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
additionalProperties: false,
|
|
1361
|
+
description: "Safe Gemini deep-research agent configuration. The provider adds the required type field."
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
additionalProperties: false,
|
|
1365
|
+
description: "Gemini research options."
|
|
1366
|
+
},
|
|
1367
|
+
retrySafe: false
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
load: async () => (await import("./adapter-AB7LKV7N.js")).adapter
|
|
1371
|
+
});
|
|
1372
|
+
|
|
1373
|
+
// src/providers/linkup/definition.ts
|
|
1374
|
+
var linkupProvider = defineProvider({
|
|
1375
|
+
id: "linkup",
|
|
1376
|
+
label: "Linkup",
|
|
1377
|
+
docsUrl: "https://docs.linkup.so/pages/sdk/js/js",
|
|
1378
|
+
local: false,
|
|
1379
|
+
credentials: [
|
|
1380
|
+
{
|
|
1381
|
+
name: "api",
|
|
1382
|
+
environmentVariable: "LINKUP_API_KEY"
|
|
1383
|
+
}
|
|
1384
|
+
],
|
|
1385
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
1386
|
+
defaults: {},
|
|
1387
|
+
credentialDefaults: {},
|
|
1388
|
+
capabilities: {
|
|
1389
|
+
search: {
|
|
1390
|
+
options: {
|
|
1391
|
+
type: "object",
|
|
1392
|
+
properties: {
|
|
1393
|
+
depth: {
|
|
1394
|
+
anyOf: [
|
|
1395
|
+
{
|
|
1396
|
+
type: "string",
|
|
1397
|
+
const: "standard"
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
type: "string",
|
|
1401
|
+
const: "deep"
|
|
1402
|
+
}
|
|
1403
|
+
],
|
|
1404
|
+
description: "Search depth. 'deep' is slower but more thorough."
|
|
1405
|
+
},
|
|
1406
|
+
includeImages: {
|
|
1407
|
+
type: "boolean",
|
|
1408
|
+
description: "Include images in search results."
|
|
1409
|
+
},
|
|
1410
|
+
includeDomains: {
|
|
1411
|
+
type: "array",
|
|
1412
|
+
items: {
|
|
1413
|
+
type: "string"
|
|
1414
|
+
},
|
|
1415
|
+
description: "Restrict results to these domains."
|
|
1416
|
+
},
|
|
1417
|
+
excludeDomains: {
|
|
1418
|
+
type: "array",
|
|
1419
|
+
items: {
|
|
1420
|
+
type: "string"
|
|
1421
|
+
},
|
|
1422
|
+
description: "Exclude these domains."
|
|
1423
|
+
},
|
|
1424
|
+
fromDate: {
|
|
1425
|
+
type: "string",
|
|
1426
|
+
description: "ISO date string for earliest result date."
|
|
1427
|
+
},
|
|
1428
|
+
toDate: {
|
|
1429
|
+
type: "string",
|
|
1430
|
+
description: "ISO date string for latest result date."
|
|
1431
|
+
}
|
|
1432
|
+
},
|
|
1433
|
+
description: "Linkup search options."
|
|
1434
|
+
},
|
|
1435
|
+
promptGuidelines: [
|
|
1436
|
+
"Use Linkup depth='deep' for exploratory or high-recall source discovery, and 'standard' for quick direct searches.",
|
|
1437
|
+
"Use includeDomains or excludeDomains when the user names source constraints or when limiting the search space improves precision.",
|
|
1438
|
+
"Use fromDate and toDate when the user asks for recent, historical, or bounded-by-date results.",
|
|
1439
|
+
"Enable includeImages only when images are directly useful; otherwise keep search focused on textual source discovery."
|
|
1440
|
+
],
|
|
1441
|
+
retrySafe: true
|
|
1442
|
+
},
|
|
1443
|
+
contents: {
|
|
1444
|
+
options: {
|
|
1445
|
+
type: "object",
|
|
1446
|
+
properties: {
|
|
1447
|
+
mode: {
|
|
1448
|
+
type: "string",
|
|
1449
|
+
enum: ["standard", "pro"],
|
|
1450
|
+
description: "Fetch strategy; pro improves retrieval of difficult pages."
|
|
1451
|
+
},
|
|
1452
|
+
includeRawContent: {
|
|
1453
|
+
type: "boolean",
|
|
1454
|
+
description: "Include raw page content and its content type."
|
|
1455
|
+
},
|
|
1456
|
+
renderJs: {
|
|
1457
|
+
type: "boolean",
|
|
1458
|
+
description: "Render JavaScript before extracting content."
|
|
1459
|
+
},
|
|
1460
|
+
includeRawHtml: {
|
|
1461
|
+
type: "boolean",
|
|
1462
|
+
deprecated: true,
|
|
1463
|
+
description: "Legacy raw HTML output. Prefer includeRawContent."
|
|
1464
|
+
},
|
|
1465
|
+
extractImages: {
|
|
1466
|
+
type: "boolean",
|
|
1467
|
+
description: "Extract images from the page."
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
description: "Linkup fetch options."
|
|
1471
|
+
},
|
|
1472
|
+
retrySafe: true
|
|
1473
|
+
},
|
|
1474
|
+
research: {
|
|
1475
|
+
options: {
|
|
1476
|
+
type: "object",
|
|
1477
|
+
properties: {
|
|
1478
|
+
outputType: {
|
|
1479
|
+
anyOf: [
|
|
1480
|
+
{
|
|
1481
|
+
type: "string",
|
|
1482
|
+
const: "sourcedAnswer"
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
type: "string",
|
|
1486
|
+
const: "structured"
|
|
1487
|
+
}
|
|
1488
|
+
],
|
|
1489
|
+
description: "Research output type. Defaults to 'sourcedAnswer' unless structuredOutputSchema is provided."
|
|
1490
|
+
},
|
|
1491
|
+
mode: {
|
|
1492
|
+
anyOf: [
|
|
1493
|
+
{
|
|
1494
|
+
type: "string",
|
|
1495
|
+
const: "answer"
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
type: "string",
|
|
1499
|
+
const: "auto"
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
type: "string",
|
|
1503
|
+
const: "investigate"
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
type: "string",
|
|
1507
|
+
const: "research"
|
|
1508
|
+
}
|
|
1509
|
+
],
|
|
1510
|
+
description: "Research mode. Use 'answer' for precise verified answers, 'investigate' for focused deep dives, 'research' for broad reports, or omit/auto to let Linkup classify the task."
|
|
1511
|
+
},
|
|
1512
|
+
reasoningDepth: {
|
|
1513
|
+
anyOf: [
|
|
1514
|
+
{
|
|
1515
|
+
type: "string",
|
|
1516
|
+
const: "S"
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
type: "string",
|
|
1520
|
+
const: "M"
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
type: "string",
|
|
1524
|
+
const: "L"
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
type: "string",
|
|
1528
|
+
const: "XL"
|
|
1529
|
+
}
|
|
1530
|
+
],
|
|
1531
|
+
description: "Reasoning depth. Higher values trade latency for more thorough investigation."
|
|
1532
|
+
},
|
|
1533
|
+
includeDomains: {
|
|
1534
|
+
type: "array",
|
|
1535
|
+
items: {
|
|
1536
|
+
type: "string"
|
|
1537
|
+
},
|
|
1538
|
+
description: "Restrict research to these domains."
|
|
1539
|
+
},
|
|
1540
|
+
excludeDomains: {
|
|
1541
|
+
type: "array",
|
|
1542
|
+
items: {
|
|
1543
|
+
type: "string"
|
|
1544
|
+
},
|
|
1545
|
+
description: "Exclude these domains."
|
|
1546
|
+
},
|
|
1547
|
+
fromDate: {
|
|
1548
|
+
type: "string",
|
|
1549
|
+
description: "ISO date string for earliest result date."
|
|
1550
|
+
},
|
|
1551
|
+
toDate: {
|
|
1552
|
+
type: "string",
|
|
1553
|
+
description: "ISO date string for latest result date."
|
|
1554
|
+
},
|
|
1555
|
+
structuredOutputSchema: {
|
|
1556
|
+
type: "object",
|
|
1557
|
+
patternProperties: {
|
|
1558
|
+
"^.*$": {}
|
|
1559
|
+
},
|
|
1560
|
+
description: "JSON schema object required when outputType is 'structured'."
|
|
1561
|
+
}
|
|
1562
|
+
},
|
|
1563
|
+
description: "Linkup research options."
|
|
1564
|
+
},
|
|
1565
|
+
retrySafe: false
|
|
1566
|
+
}
|
|
1567
|
+
},
|
|
1568
|
+
load: async () => (await import("./adapter-HPTMLH75.js")).adapter
|
|
1569
|
+
});
|
|
1570
|
+
|
|
1571
|
+
// src/providers/ollama/definition.ts
|
|
1572
|
+
var ollamaProvider = defineProvider({
|
|
1573
|
+
id: "ollama",
|
|
1574
|
+
label: "Ollama",
|
|
1575
|
+
docsUrl: "https://docs.ollama.com/capabilities/web-search",
|
|
1576
|
+
local: false,
|
|
1577
|
+
credentials: [
|
|
1578
|
+
{
|
|
1579
|
+
name: "api",
|
|
1580
|
+
environmentVariable: "OLLAMA_API_KEY"
|
|
1581
|
+
}
|
|
1582
|
+
],
|
|
1583
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
1584
|
+
defaults: {},
|
|
1585
|
+
credentialDefaults: {},
|
|
1586
|
+
capabilities: {
|
|
1587
|
+
search: {
|
|
1588
|
+
limits: {
|
|
1589
|
+
maxResults: 10
|
|
1590
|
+
},
|
|
1591
|
+
retrySafe: true
|
|
1592
|
+
},
|
|
1593
|
+
contents: {
|
|
1594
|
+
retrySafe: true
|
|
1595
|
+
}
|
|
1596
|
+
},
|
|
1597
|
+
load: async () => (await import("./adapter-ISZQTZDP.js")).adapter
|
|
1598
|
+
});
|
|
1599
|
+
|
|
1600
|
+
// src/providers/openai/definition.ts
|
|
1601
|
+
var controls = {
|
|
1602
|
+
model: {
|
|
1603
|
+
type: "string",
|
|
1604
|
+
description: "OpenAI model override. Tool and reasoning support depends on the model."
|
|
1605
|
+
},
|
|
1606
|
+
instructions: {
|
|
1607
|
+
type: "string",
|
|
1608
|
+
description: "Instructions for the answer and source selection."
|
|
1609
|
+
},
|
|
1610
|
+
reasoning: {
|
|
1611
|
+
type: "object",
|
|
1612
|
+
properties: {
|
|
1613
|
+
effort: {
|
|
1614
|
+
type: "string",
|
|
1615
|
+
enum: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
1616
|
+
description: "Use a level supported by the model; some levels do not support web search."
|
|
1617
|
+
}
|
|
1618
|
+
},
|
|
1619
|
+
description: "Model reasoning controls."
|
|
1620
|
+
},
|
|
1621
|
+
max_output_tokens: {
|
|
1622
|
+
type: "integer",
|
|
1623
|
+
minimum: 1,
|
|
1624
|
+
description: "Maximum generated tokens, including reasoning."
|
|
1625
|
+
},
|
|
1626
|
+
searchContextSize: {
|
|
1627
|
+
type: "string",
|
|
1628
|
+
enum: ["low", "medium", "high"],
|
|
1629
|
+
description: "Amount of web search context."
|
|
1630
|
+
},
|
|
1631
|
+
allowedDomains: {
|
|
1632
|
+
type: "array",
|
|
1633
|
+
maxItems: 100,
|
|
1634
|
+
items: { type: "string" },
|
|
1635
|
+
description: "Restrict search to these domains."
|
|
1636
|
+
},
|
|
1637
|
+
externalWebAccess: {
|
|
1638
|
+
type: "boolean",
|
|
1639
|
+
description: "Allow live fetching; false uses cached/indexed content only."
|
|
1640
|
+
}
|
|
1641
|
+
};
|
|
1642
|
+
var userLocation = {
|
|
1643
|
+
type: "object",
|
|
1644
|
+
properties: {
|
|
1645
|
+
city: { type: "string" },
|
|
1646
|
+
country: { type: "string" },
|
|
1647
|
+
region: { type: "string" },
|
|
1648
|
+
timezone: { type: "string" }
|
|
1649
|
+
},
|
|
1650
|
+
description: "Approximate location. Not supported by deep research models."
|
|
1651
|
+
};
|
|
1652
|
+
var openaiProvider = defineProvider({
|
|
1653
|
+
id: "openai",
|
|
1654
|
+
label: "OpenAI",
|
|
1655
|
+
docsUrl: "https://developers.openai.com/api/docs/guides/tools-web-search",
|
|
1656
|
+
local: false,
|
|
1657
|
+
credentials: [{ name: "api", environmentVariable: "OPENAI_API_KEY" }],
|
|
1658
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
1659
|
+
defaults: {
|
|
1660
|
+
search: { model: "gpt-4.1" },
|
|
1661
|
+
answer: { model: "gpt-4.1" },
|
|
1662
|
+
research: { model: "o4-mini-deep-research" }
|
|
1663
|
+
},
|
|
1664
|
+
credentialDefaults: {},
|
|
1665
|
+
capabilities: {
|
|
1666
|
+
search: {
|
|
1667
|
+
options: {
|
|
1668
|
+
type: "object",
|
|
1669
|
+
properties: { ...controls, userLocation },
|
|
1670
|
+
description: "OpenAI search options."
|
|
1671
|
+
},
|
|
1672
|
+
promptGuidelines: [
|
|
1673
|
+
"Use OpenAI web search for model-mediated source discovery.",
|
|
1674
|
+
"Use instructions for explicit source-selection needs and allowedDomains for domain restrictions.",
|
|
1675
|
+
"Use searchContextSize='high' only when richer context is needed. Set externalWebAccess=false only when cached results are acceptable.",
|
|
1676
|
+
"Reasoning levels depend on the model; gpt-5 minimal reasoning does not support web search. Do not send reasoning for models that do not support it.",
|
|
1677
|
+
"Prefer web_contents to inspect selected primary sources."
|
|
1678
|
+
],
|
|
1679
|
+
retrySafe: true
|
|
1680
|
+
},
|
|
1681
|
+
answer: {
|
|
1682
|
+
options: {
|
|
1683
|
+
type: "object",
|
|
1684
|
+
properties: { ...controls, userLocation },
|
|
1685
|
+
description: "OpenAI answer options."
|
|
1686
|
+
},
|
|
1687
|
+
retrySafe: false
|
|
1688
|
+
},
|
|
1689
|
+
research: {
|
|
1690
|
+
options: {
|
|
1691
|
+
type: "object",
|
|
1692
|
+
properties: {
|
|
1693
|
+
...controls,
|
|
1694
|
+
max_tool_calls: {
|
|
1695
|
+
type: "integer",
|
|
1696
|
+
minimum: 1,
|
|
1697
|
+
description: "Maximum built-in tool calls during research."
|
|
1698
|
+
}
|
|
1699
|
+
},
|
|
1700
|
+
description: "OpenAI research options. Deep research models do not support userLocation."
|
|
1701
|
+
},
|
|
1702
|
+
retrySafe: false
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
load: async () => (await import("./adapter-HITGYUXN.js")).adapter
|
|
1706
|
+
});
|
|
1707
|
+
|
|
1708
|
+
// src/providers/parallel/definition.ts
|
|
1709
|
+
var fetchPolicy = {
|
|
1710
|
+
type: "object",
|
|
1711
|
+
properties: {
|
|
1712
|
+
max_age_seconds: {
|
|
1713
|
+
type: "number",
|
|
1714
|
+
minimum: 600,
|
|
1715
|
+
description: "Cache age threshold for live fetching, in seconds."
|
|
1716
|
+
},
|
|
1717
|
+
timeout_seconds: {
|
|
1718
|
+
type: "number",
|
|
1719
|
+
exclusiveMinimum: 0,
|
|
1720
|
+
description: "Live fetch timeout in seconds."
|
|
1721
|
+
},
|
|
1722
|
+
disable_cache_fallback: {
|
|
1723
|
+
type: "boolean",
|
|
1724
|
+
description: "Fail instead of falling back to stale content."
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
var excerptSettings = {
|
|
1729
|
+
type: "object",
|
|
1730
|
+
properties: {
|
|
1731
|
+
max_chars_per_result: { type: "integer", minimum: 0 }
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
var sourcePolicy = {
|
|
1735
|
+
type: "object",
|
|
1736
|
+
properties: {
|
|
1737
|
+
include_domains: {
|
|
1738
|
+
type: "array",
|
|
1739
|
+
maxItems: 200,
|
|
1740
|
+
items: { type: "string" }
|
|
1741
|
+
},
|
|
1742
|
+
exclude_domains: {
|
|
1743
|
+
type: "array",
|
|
1744
|
+
maxItems: 200,
|
|
1745
|
+
items: { type: "string" }
|
|
1746
|
+
},
|
|
1747
|
+
after_date: {
|
|
1748
|
+
type: "string",
|
|
1749
|
+
description: "Earliest publication date (YYYY-MM-DD)."
|
|
1750
|
+
}
|
|
1751
|
+
},
|
|
1752
|
+
description: "Source constraints; include and exclude lists may contain at most 200 domains combined."
|
|
1753
|
+
};
|
|
1754
|
+
var commonProperties = {
|
|
1755
|
+
objective: {
|
|
1756
|
+
type: "string",
|
|
1757
|
+
description: "Underlying question or goal guiding retrieval."
|
|
1758
|
+
},
|
|
1759
|
+
max_chars_total: {
|
|
1760
|
+
type: "integer",
|
|
1761
|
+
minimum: 1,
|
|
1762
|
+
description: "Total excerpt character budget."
|
|
1763
|
+
},
|
|
1764
|
+
client_model: { type: "string", description: "Model consuming the results." },
|
|
1765
|
+
session_id: {
|
|
1766
|
+
type: "string",
|
|
1767
|
+
description: "Session ID for related search and extraction calls."
|
|
1768
|
+
}
|
|
1769
|
+
};
|
|
1770
|
+
var parallelProvider = defineProvider({
|
|
1771
|
+
id: "parallel",
|
|
1772
|
+
label: "Parallel",
|
|
1773
|
+
docsUrl: "https://github.com/parallel-web/parallel-sdk-typescript",
|
|
1774
|
+
local: false,
|
|
1775
|
+
credentials: [
|
|
1776
|
+
{
|
|
1777
|
+
name: "api",
|
|
1778
|
+
environmentVariable: "PARALLEL_API_KEY"
|
|
1779
|
+
}
|
|
1780
|
+
],
|
|
1781
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
1782
|
+
defaults: {
|
|
1783
|
+
search: {
|
|
1784
|
+
mode: "advanced"
|
|
1785
|
+
},
|
|
1786
|
+
contents: {
|
|
1787
|
+
excerpts: false,
|
|
1788
|
+
full_content: true
|
|
1789
|
+
}
|
|
1790
|
+
},
|
|
1791
|
+
credentialDefaults: {},
|
|
1792
|
+
capabilities: {
|
|
1793
|
+
search: {
|
|
1794
|
+
options: {
|
|
1795
|
+
type: "object",
|
|
1796
|
+
properties: {
|
|
1797
|
+
...commonProperties,
|
|
1798
|
+
advanced_settings: {
|
|
1799
|
+
type: "object",
|
|
1800
|
+
properties: {
|
|
1801
|
+
excerpt_settings: excerptSettings,
|
|
1802
|
+
fetch_policy: fetchPolicy,
|
|
1803
|
+
source_policy: sourcePolicy,
|
|
1804
|
+
location: {
|
|
1805
|
+
type: "string",
|
|
1806
|
+
description: "Two-letter country code."
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
description: "Advanced retrieval settings. Result count comes from maxResults."
|
|
1810
|
+
},
|
|
1811
|
+
mode: {
|
|
1812
|
+
anyOf: [
|
|
1813
|
+
{
|
|
1814
|
+
type: "string",
|
|
1815
|
+
const: "advanced"
|
|
1816
|
+
},
|
|
1817
|
+
{
|
|
1818
|
+
type: "string",
|
|
1819
|
+
const: "basic"
|
|
1820
|
+
},
|
|
1821
|
+
{ type: "string", const: "turbo" },
|
|
1822
|
+
{ type: "string", const: "fast" }
|
|
1823
|
+
],
|
|
1824
|
+
description: "Parallel search mode. Use 'advanced' for higher quality, 'basic' for lower latency, or 'turbo' for the fastest responses."
|
|
1825
|
+
}
|
|
1826
|
+
},
|
|
1827
|
+
description: "Parallel search options."
|
|
1828
|
+
},
|
|
1829
|
+
promptGuidelines: [
|
|
1830
|
+
"Use Parallel mode='advanced' for exploratory, ambiguous, or multi-hop source discovery where the provider should plan the search.",
|
|
1831
|
+
"Use Parallel mode='basic' for direct factual lookups and simple source finding where low latency is preferred.",
|
|
1832
|
+
"Use Parallel mode='turbo' only when fastest responses matter more than recall or depth.",
|
|
1833
|
+
"Prefer web_contents with Parallel extraction when a URL set is already known and the task needs full page content rather than more source discovery."
|
|
1834
|
+
],
|
|
1835
|
+
retrySafe: true
|
|
1836
|
+
},
|
|
1837
|
+
contents: {
|
|
1838
|
+
options: {
|
|
1839
|
+
type: "object",
|
|
1840
|
+
properties: {
|
|
1841
|
+
...commonProperties,
|
|
1842
|
+
advanced_settings: {
|
|
1843
|
+
type: "object",
|
|
1844
|
+
properties: {
|
|
1845
|
+
excerpt_settings: excerptSettings,
|
|
1846
|
+
fetch_policy: fetchPolicy
|
|
1847
|
+
},
|
|
1848
|
+
description: "Advanced extraction settings."
|
|
1849
|
+
},
|
|
1850
|
+
excerpts: {
|
|
1851
|
+
type: "boolean",
|
|
1852
|
+
description: "Include excerpts in extraction results."
|
|
1853
|
+
},
|
|
1854
|
+
full_content: {
|
|
1855
|
+
type: "boolean",
|
|
1856
|
+
description: "Include full page content in extraction results."
|
|
1857
|
+
}
|
|
1858
|
+
},
|
|
1859
|
+
description: "Parallel extract options."
|
|
1860
|
+
},
|
|
1861
|
+
retrySafe: true
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
load: async () => (await import("./adapter-2YBFCBCZ.js")).adapter
|
|
1865
|
+
});
|
|
1866
|
+
|
|
1867
|
+
// src/providers/perplexity/definition.ts
|
|
1868
|
+
var searchControls = {
|
|
1869
|
+
country: { type: "string", description: "Two-letter country hint." },
|
|
1870
|
+
search_mode: {
|
|
1871
|
+
type: "string",
|
|
1872
|
+
enum: ["web", "academic", "sec"],
|
|
1873
|
+
description: "Search source pool."
|
|
1874
|
+
},
|
|
1875
|
+
search_domain_filter: {
|
|
1876
|
+
type: "array",
|
|
1877
|
+
items: { type: "string" },
|
|
1878
|
+
description: "Domain filters; prefix excluded domains with '-'."
|
|
1879
|
+
},
|
|
1880
|
+
search_language_filter: {
|
|
1881
|
+
type: "array",
|
|
1882
|
+
items: { type: "string" },
|
|
1883
|
+
description: "Result languages."
|
|
1884
|
+
},
|
|
1885
|
+
search_recency_filter: {
|
|
1886
|
+
type: "string",
|
|
1887
|
+
enum: ["hour", "day", "week", "month", "year"],
|
|
1888
|
+
description: "Result recency."
|
|
1889
|
+
},
|
|
1890
|
+
search_after_date_filter: {
|
|
1891
|
+
type: "string",
|
|
1892
|
+
description: "Earliest publication date (MM/DD/YYYY)."
|
|
1893
|
+
},
|
|
1894
|
+
search_before_date_filter: {
|
|
1895
|
+
type: "string",
|
|
1896
|
+
description: "Latest publication date (MM/DD/YYYY)."
|
|
1897
|
+
},
|
|
1898
|
+
last_updated_after_filter: {
|
|
1899
|
+
type: "string",
|
|
1900
|
+
description: "Earliest update date (MM/DD/YYYY)."
|
|
1901
|
+
},
|
|
1902
|
+
last_updated_before_filter: {
|
|
1903
|
+
type: "string",
|
|
1904
|
+
description: "Latest update date (MM/DD/YYYY)."
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
var contextSize = {
|
|
1908
|
+
type: "string",
|
|
1909
|
+
enum: ["low", "medium", "high"],
|
|
1910
|
+
description: "Amount of search context."
|
|
1911
|
+
};
|
|
1912
|
+
var chatOptions = {
|
|
1913
|
+
type: "object",
|
|
1914
|
+
properties: {
|
|
1915
|
+
...searchControls,
|
|
1916
|
+
model: { type: "string", description: "Perplexity model override." },
|
|
1917
|
+
max_tokens: {
|
|
1918
|
+
type: "integer",
|
|
1919
|
+
minimum: 1,
|
|
1920
|
+
description: "Maximum generated tokens."
|
|
1921
|
+
},
|
|
1922
|
+
reasoning_effort: {
|
|
1923
|
+
type: "string",
|
|
1924
|
+
enum: ["minimal", "low", "medium", "high"],
|
|
1925
|
+
description: "Reasoning effort, where supported by the selected model."
|
|
1926
|
+
},
|
|
1927
|
+
temperature: {
|
|
1928
|
+
type: "number",
|
|
1929
|
+
minimum: 0,
|
|
1930
|
+
maximum: 2,
|
|
1931
|
+
description: "Sampling temperature, where supported by the model."
|
|
1932
|
+
},
|
|
1933
|
+
web_search_options: {
|
|
1934
|
+
type: "object",
|
|
1935
|
+
properties: {
|
|
1936
|
+
search_context_size: contextSize
|
|
1937
|
+
},
|
|
1938
|
+
description: "Sonar web retrieval controls; distinct from standalone search options."
|
|
1939
|
+
}
|
|
1940
|
+
},
|
|
1941
|
+
description: "Perplexity grounded generation options."
|
|
1942
|
+
};
|
|
1943
|
+
var perplexityProvider = defineProvider({
|
|
1944
|
+
id: "perplexity",
|
|
1945
|
+
label: "Perplexity",
|
|
1946
|
+
docsUrl: "https://docs.perplexity.ai/docs/sdk/overview",
|
|
1947
|
+
local: false,
|
|
1948
|
+
credentials: [{ name: "api", environmentVariable: "PERPLEXITY_API_KEY" }],
|
|
1949
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
1950
|
+
defaults: {
|
|
1951
|
+
answer: { model: "sonar" },
|
|
1952
|
+
research: { model: "sonar-deep-research" }
|
|
1953
|
+
},
|
|
1954
|
+
credentialDefaults: {},
|
|
1955
|
+
capabilities: {
|
|
1956
|
+
search: {
|
|
1957
|
+
options: {
|
|
1958
|
+
type: "object",
|
|
1959
|
+
properties: {
|
|
1960
|
+
...searchControls,
|
|
1961
|
+
search_context_size: contextSize,
|
|
1962
|
+
max_tokens: {
|
|
1963
|
+
type: "integer",
|
|
1964
|
+
minimum: 1,
|
|
1965
|
+
description: "Total search content token budget."
|
|
1966
|
+
},
|
|
1967
|
+
max_tokens_per_page: {
|
|
1968
|
+
type: "integer",
|
|
1969
|
+
minimum: 1,
|
|
1970
|
+
description: "Per-page content token budget."
|
|
1971
|
+
}
|
|
1972
|
+
},
|
|
1973
|
+
description: "Perplexity search options."
|
|
1974
|
+
},
|
|
1975
|
+
promptGuidelines: [
|
|
1976
|
+
"Use Perplexity search for concise source retrieval, not synthesized answers.",
|
|
1977
|
+
"Use search_recency_filter for freshness and search_domain_filter for domain-scoped retrieval.",
|
|
1978
|
+
"Use web_answer or web_research with Perplexity when synthesis is needed. Search content budgets are not generation budgets."
|
|
1979
|
+
],
|
|
1980
|
+
retrySafe: true
|
|
1981
|
+
},
|
|
1982
|
+
answer: { options: chatOptions, retrySafe: false },
|
|
1983
|
+
research: { options: chatOptions, retrySafe: false }
|
|
1984
|
+
},
|
|
1985
|
+
load: async () => (await import("./adapter-NEXSOHGT.js")).adapter
|
|
1986
|
+
});
|
|
1987
|
+
|
|
1988
|
+
// src/providers/serper/definition.ts
|
|
1989
|
+
var serperProvider = defineProvider({
|
|
1990
|
+
id: "serper",
|
|
1991
|
+
label: "Serper",
|
|
1992
|
+
docsUrl: "https://serper.dev/",
|
|
1993
|
+
local: false,
|
|
1994
|
+
credentials: [
|
|
1995
|
+
{
|
|
1996
|
+
name: "api",
|
|
1997
|
+
environmentVariable: "SERPER_API_KEY"
|
|
1998
|
+
}
|
|
1999
|
+
],
|
|
2000
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
2001
|
+
defaults: {
|
|
2002
|
+
search: {
|
|
2003
|
+
includeMarkdown: true
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
2006
|
+
credentialDefaults: {},
|
|
2007
|
+
capabilities: {
|
|
2008
|
+
search: {
|
|
2009
|
+
options: {
|
|
2010
|
+
type: "object",
|
|
2011
|
+
properties: {
|
|
2012
|
+
mode: {
|
|
2013
|
+
enum: [
|
|
2014
|
+
"search",
|
|
2015
|
+
"images",
|
|
2016
|
+
"videos",
|
|
2017
|
+
"places",
|
|
2018
|
+
"maps",
|
|
2019
|
+
"reviews",
|
|
2020
|
+
"news",
|
|
2021
|
+
"shopping",
|
|
2022
|
+
"product-reviews",
|
|
2023
|
+
"lens",
|
|
2024
|
+
"scholar",
|
|
2025
|
+
"patents",
|
|
2026
|
+
"autocomplete",
|
|
2027
|
+
"webpage"
|
|
2028
|
+
],
|
|
2029
|
+
description: "Serper search type. Use 'search' for web results, 'news' for recent journalism/current events, 'images' for visual references, 'videos' for clips/tutorials, 'places' or 'maps' for local businesses/venues, 'reviews' for Google business reviews by place ID/CID/FID or query, 'shopping' for products, 'product-reviews' for product reviews, 'lens' for reverse image search, 'scholar' for scholarly articles, 'patents' for patents, 'autocomplete' for suggestions, and 'webpage' to scrape a URL."
|
|
2030
|
+
},
|
|
2031
|
+
gl: {
|
|
2032
|
+
type: "string",
|
|
2033
|
+
description: "Country code hint for Google results (for example 'us')."
|
|
2034
|
+
},
|
|
2035
|
+
hl: {
|
|
2036
|
+
type: "string",
|
|
2037
|
+
description: "Language code hint for Google results (for example 'en')."
|
|
2038
|
+
},
|
|
2039
|
+
location: {
|
|
2040
|
+
type: "string",
|
|
2041
|
+
description: "Geographic location hint for Google results."
|
|
2042
|
+
},
|
|
2043
|
+
page: {
|
|
2044
|
+
type: "integer",
|
|
2045
|
+
minimum: 1,
|
|
2046
|
+
description: "1-based results page to request from Serper."
|
|
2047
|
+
},
|
|
2048
|
+
tbs: {
|
|
2049
|
+
type: "string",
|
|
2050
|
+
description: "Google time/date or vertical-specific filter string passed through to Serper, for example 'qdr:d' for past day."
|
|
2051
|
+
},
|
|
2052
|
+
autocorrect: {
|
|
2053
|
+
type: "boolean",
|
|
2054
|
+
description: "Enable or disable Serper query autocorrection."
|
|
2055
|
+
},
|
|
2056
|
+
url: {
|
|
2057
|
+
type: "string",
|
|
2058
|
+
description: "URL for modes that need one: image URL for 'lens', or page URL for 'webpage'. Defaults to the query string when omitted."
|
|
2059
|
+
},
|
|
2060
|
+
ll: {
|
|
2061
|
+
type: "string",
|
|
2062
|
+
description: "Google Maps latitude/longitude/zoom hint, for example '@40.6973709,-74.1444871,11z'."
|
|
2063
|
+
},
|
|
2064
|
+
placeId: {
|
|
2065
|
+
type: "string",
|
|
2066
|
+
description: "Google place ID for maps or reviews."
|
|
2067
|
+
},
|
|
2068
|
+
cid: {
|
|
2069
|
+
type: "string",
|
|
2070
|
+
description: "Google CID for maps or reviews."
|
|
2071
|
+
},
|
|
2072
|
+
fid: {
|
|
2073
|
+
type: "string",
|
|
2074
|
+
description: "Google FID for reviews."
|
|
2075
|
+
},
|
|
2076
|
+
sortBy: {
|
|
2077
|
+
type: "string",
|
|
2078
|
+
description: "Review sort order for reviews mode."
|
|
2079
|
+
},
|
|
2080
|
+
topicId: {
|
|
2081
|
+
type: "string",
|
|
2082
|
+
description: "Review topic ID for reviews mode."
|
|
2083
|
+
},
|
|
2084
|
+
productId: {
|
|
2085
|
+
type: "string",
|
|
2086
|
+
description: "Google product ID for product-reviews mode. Defaults to the query string when omitted."
|
|
2087
|
+
},
|
|
2088
|
+
nextPageToken: {
|
|
2089
|
+
type: "string",
|
|
2090
|
+
description: "Pagination token for reviews or product-reviews modes."
|
|
2091
|
+
},
|
|
2092
|
+
includeMarkdown: {
|
|
2093
|
+
type: "boolean",
|
|
2094
|
+
default: true,
|
|
2095
|
+
description: "Include Markdown content in webpage mode. Defaults to true."
|
|
2096
|
+
},
|
|
2097
|
+
includeImages: {
|
|
2098
|
+
type: "boolean",
|
|
2099
|
+
description: "Include image metadata in webpage mode."
|
|
2100
|
+
},
|
|
2101
|
+
includeLinks: {
|
|
2102
|
+
type: "boolean",
|
|
2103
|
+
description: "Include link metadata in webpage mode."
|
|
2104
|
+
},
|
|
2105
|
+
includeVideos: {
|
|
2106
|
+
type: "boolean",
|
|
2107
|
+
description: "Include video metadata in webpage mode."
|
|
2108
|
+
}
|
|
2109
|
+
},
|
|
2110
|
+
description: "Serper search options."
|
|
2111
|
+
},
|
|
2112
|
+
promptGuidelines: [
|
|
2113
|
+
"Use Serper news mode for recent journalism, current events, announcements, or time-sensitive reporting.",
|
|
2114
|
+
"Use Serper images or videos mode when the user asks for visual references, screenshots, diagrams, clips, tutorials, or media results.",
|
|
2115
|
+
"Use Serper places or maps mode for local businesses, venues, addresses, ratings, phone numbers, opening details, or nearby/in-location searches.",
|
|
2116
|
+
"Use Serper reviews mode when the task needs Google business reviews. Prefer cid, fid, or placeId from a maps or places result when available; otherwise use the search query as the place identifier.",
|
|
2117
|
+
"Use Serper shopping mode for product listings, prices, merchants, offers, or purchase comparisons, and use product-reviews mode when the task needs reviews for a known product ID.",
|
|
2118
|
+
"Use Serper scholar mode for academic papers and patents mode for patent searches.",
|
|
2119
|
+
"Use Serper autocomplete mode when the task is to discover search suggestions or query completions rather than source pages.",
|
|
2120
|
+
"Use Serper lens mode for reverse image search with an image URL, and use webpage mode to scrape a specific URL. Webpage mode includes Markdown by default."
|
|
2121
|
+
],
|
|
2122
|
+
retrySafe: true
|
|
2123
|
+
}
|
|
2124
|
+
},
|
|
2125
|
+
load: async () => (await import("./adapter-I6OUKBZQ.js")).adapter
|
|
2126
|
+
});
|
|
2127
|
+
|
|
2128
|
+
// src/providers/tavily/definition.ts
|
|
2129
|
+
var tavilyProvider = defineProvider({
|
|
2130
|
+
id: "tavily",
|
|
2131
|
+
label: "Tavily",
|
|
2132
|
+
docsUrl: "https://docs.tavily.com/sdk/javascript/reference",
|
|
2133
|
+
local: false,
|
|
2134
|
+
credentials: [
|
|
2135
|
+
{
|
|
2136
|
+
name: "api",
|
|
2137
|
+
environmentVariable: "TAVILY_API_KEY"
|
|
2138
|
+
}
|
|
2139
|
+
],
|
|
2140
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
2141
|
+
defaults: {
|
|
2142
|
+
search: {
|
|
2143
|
+
includeFavicon: true
|
|
2144
|
+
},
|
|
2145
|
+
contents: {
|
|
2146
|
+
format: "markdown",
|
|
2147
|
+
includeFavicon: true
|
|
2148
|
+
}
|
|
2149
|
+
},
|
|
2150
|
+
credentialDefaults: {},
|
|
2151
|
+
capabilities: {
|
|
2152
|
+
search: {
|
|
2153
|
+
options: {
|
|
2154
|
+
type: "object",
|
|
2155
|
+
properties: {
|
|
2156
|
+
topic: {
|
|
2157
|
+
anyOf: [
|
|
2158
|
+
{
|
|
2159
|
+
type: "string",
|
|
2160
|
+
const: "general"
|
|
2161
|
+
},
|
|
2162
|
+
{
|
|
2163
|
+
type: "string",
|
|
2164
|
+
const: "news"
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
type: "string",
|
|
2168
|
+
const: "finance"
|
|
2169
|
+
}
|
|
2170
|
+
],
|
|
2171
|
+
description: "Category of the search query. Use 'news' for recent journalism or current events, 'finance' for markets or company financial data, and 'general' for broad web search."
|
|
2172
|
+
},
|
|
2173
|
+
searchDepth: {
|
|
2174
|
+
anyOf: [
|
|
2175
|
+
{
|
|
2176
|
+
type: "string",
|
|
2177
|
+
const: "basic"
|
|
2178
|
+
},
|
|
2179
|
+
{ type: "string", const: "advanced" },
|
|
2180
|
+
{ type: "string", const: "fast" },
|
|
2181
|
+
{ type: "string", const: "ultra-fast" }
|
|
2182
|
+
],
|
|
2183
|
+
description: "Depth of the search. 'advanced' is slower but more thorough."
|
|
2184
|
+
},
|
|
2185
|
+
timeRange: {
|
|
2186
|
+
type: "string",
|
|
2187
|
+
enum: ["year", "month", "week", "day", "y", "m", "w", "d"],
|
|
2188
|
+
description: "Named time range filter."
|
|
2189
|
+
},
|
|
2190
|
+
startDate: {
|
|
2191
|
+
type: "string",
|
|
2192
|
+
description: "Earliest result date (YYYY-MM-DD)."
|
|
2193
|
+
},
|
|
2194
|
+
endDate: {
|
|
2195
|
+
type: "string",
|
|
2196
|
+
description: "Latest result date (YYYY-MM-DD)."
|
|
2197
|
+
},
|
|
2198
|
+
chunksPerSource: {
|
|
2199
|
+
type: "integer",
|
|
2200
|
+
minimum: 1,
|
|
2201
|
+
maximum: 3,
|
|
2202
|
+
description: "Chunks per source for advanced search."
|
|
2203
|
+
},
|
|
2204
|
+
autoParameters: {
|
|
2205
|
+
type: "boolean",
|
|
2206
|
+
description: "Let Tavily choose retrieval parameters; may increase cost."
|
|
2207
|
+
},
|
|
2208
|
+
country: {
|
|
2209
|
+
type: "string",
|
|
2210
|
+
description: "Country hint for search results."
|
|
2211
|
+
},
|
|
2212
|
+
exactMatch: {
|
|
2213
|
+
type: "boolean",
|
|
2214
|
+
description: "Prefer exact matches."
|
|
2215
|
+
},
|
|
2216
|
+
includeAnswer: {
|
|
2217
|
+
anyOf: [
|
|
2218
|
+
{ type: "boolean" },
|
|
2219
|
+
{ type: "string", enum: ["basic", "advanced"] }
|
|
2220
|
+
],
|
|
2221
|
+
description: "Include a short AI-generated answer."
|
|
2222
|
+
},
|
|
2223
|
+
includeRawContent: {
|
|
2224
|
+
anyOf: [
|
|
2225
|
+
{ type: "boolean", const: false },
|
|
2226
|
+
{ type: "string", enum: ["markdown", "text"] }
|
|
2227
|
+
],
|
|
2228
|
+
description: "Return raw page content as markdown or text, or disable it with false."
|
|
2229
|
+
},
|
|
2230
|
+
includeImages: {
|
|
2231
|
+
type: "boolean",
|
|
2232
|
+
description: "Include related images."
|
|
2233
|
+
},
|
|
2234
|
+
includeFavicon: {
|
|
2235
|
+
type: "boolean",
|
|
2236
|
+
description: "Include favicon URLs."
|
|
2237
|
+
},
|
|
2238
|
+
includeDomains: {
|
|
2239
|
+
type: "array",
|
|
2240
|
+
items: {
|
|
2241
|
+
type: "string"
|
|
2242
|
+
},
|
|
2243
|
+
description: "Restrict results to these domains."
|
|
2244
|
+
},
|
|
2245
|
+
excludeDomains: {
|
|
2246
|
+
type: "array",
|
|
2247
|
+
items: {
|
|
2248
|
+
type: "string"
|
|
2249
|
+
},
|
|
2250
|
+
description: "Exclude these domains from results."
|
|
2251
|
+
},
|
|
2252
|
+
days: {
|
|
2253
|
+
type: "integer",
|
|
2254
|
+
minimum: 1,
|
|
2255
|
+
description: "Limit results to the last N days."
|
|
2256
|
+
}
|
|
2257
|
+
},
|
|
2258
|
+
description: "Tavily search options."
|
|
2259
|
+
},
|
|
2260
|
+
promptGuidelines: [
|
|
2261
|
+
"Use Tavily topic='news' for recent journalism or current events and topic='finance' for market or company-finance research; otherwise leave topic as general.",
|
|
2262
|
+
"Use searchDepth='advanced' for broader or higher-recall source discovery, and 'basic' for quick direct lookups.",
|
|
2263
|
+
"Set timeRange, days, or country when the user asks for freshness, recency, or geography-specific results.",
|
|
2264
|
+
"Set includeRawContent or includeAnswer only when the search response itself should carry more context; prefer web_contents for selected source inspection."
|
|
2265
|
+
],
|
|
2266
|
+
retrySafe: true
|
|
2267
|
+
},
|
|
2268
|
+
contents: {
|
|
2269
|
+
options: {
|
|
2270
|
+
type: "object",
|
|
2271
|
+
properties: {
|
|
2272
|
+
extractDepth: {
|
|
2273
|
+
type: "string",
|
|
2274
|
+
enum: ["basic", "advanced"],
|
|
2275
|
+
description: "Depth setting for extraction."
|
|
2276
|
+
},
|
|
2277
|
+
timeout: {
|
|
2278
|
+
type: "number",
|
|
2279
|
+
minimum: 1,
|
|
2280
|
+
maximum: 60,
|
|
2281
|
+
description: "Extraction timeout in seconds."
|
|
2282
|
+
},
|
|
2283
|
+
format: {
|
|
2284
|
+
anyOf: [
|
|
2285
|
+
{
|
|
2286
|
+
type: "string",
|
|
2287
|
+
const: "markdown"
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
type: "string",
|
|
2291
|
+
const: "text"
|
|
2292
|
+
}
|
|
2293
|
+
],
|
|
2294
|
+
description: "Output format for extracted content."
|
|
2295
|
+
},
|
|
2296
|
+
includeImages: {
|
|
2297
|
+
type: "boolean",
|
|
2298
|
+
description: "Include extracted images."
|
|
2299
|
+
},
|
|
2300
|
+
query: {
|
|
2301
|
+
type: "string",
|
|
2302
|
+
description: "Optional query to focus extraction."
|
|
2303
|
+
},
|
|
2304
|
+
chunksPerSource: {
|
|
2305
|
+
type: "integer",
|
|
2306
|
+
minimum: 1,
|
|
2307
|
+
maximum: 5,
|
|
2308
|
+
description: "Maximum chunks per source (1\u20135). Used with query."
|
|
2309
|
+
},
|
|
2310
|
+
includeFavicon: {
|
|
2311
|
+
type: "boolean",
|
|
2312
|
+
description: "Include favicon URLs."
|
|
2313
|
+
}
|
|
2314
|
+
},
|
|
2315
|
+
description: "Tavily extract options."
|
|
2316
|
+
},
|
|
2317
|
+
retrySafe: true
|
|
2318
|
+
}
|
|
2319
|
+
},
|
|
2320
|
+
load: async () => (await import("./adapter-SDQX2533.js")).adapter
|
|
2321
|
+
});
|
|
2322
|
+
|
|
2323
|
+
// src/providers/valyu/definition.ts
|
|
2324
|
+
var toolControl = {
|
|
2325
|
+
anyOf: [
|
|
2326
|
+
{ type: "boolean" },
|
|
2327
|
+
{
|
|
2328
|
+
type: "object",
|
|
2329
|
+
properties: {
|
|
2330
|
+
enabled: { type: "boolean" },
|
|
2331
|
+
max_calls: {
|
|
2332
|
+
type: "integer",
|
|
2333
|
+
minimum: 0,
|
|
2334
|
+
description: "Lower the tool's call limit; 0 disables it."
|
|
2335
|
+
}
|
|
2336
|
+
},
|
|
2337
|
+
additionalProperties: false
|
|
2338
|
+
}
|
|
2339
|
+
]
|
|
2340
|
+
};
|
|
2341
|
+
var valyuProvider = defineProvider({
|
|
2342
|
+
id: "valyu",
|
|
2343
|
+
label: "Valyu",
|
|
2344
|
+
docsUrl: "https://docs.valyu.ai/sdk/typescript-sdk",
|
|
2345
|
+
local: false,
|
|
2346
|
+
credentials: [
|
|
2347
|
+
{
|
|
2348
|
+
name: "api",
|
|
2349
|
+
environmentVariable: "VALYU_API_KEY"
|
|
2350
|
+
}
|
|
2351
|
+
],
|
|
2352
|
+
fields: ["credentials", "baseUrl", "options"],
|
|
2353
|
+
defaults: {
|
|
2354
|
+
search: {
|
|
2355
|
+
searchType: "all",
|
|
2356
|
+
responseLength: "short"
|
|
2357
|
+
}
|
|
2358
|
+
},
|
|
2359
|
+
credentialDefaults: {},
|
|
2360
|
+
capabilities: {
|
|
2361
|
+
search: {
|
|
2362
|
+
options: {
|
|
2363
|
+
type: "object",
|
|
2364
|
+
properties: {
|
|
2365
|
+
searchType: {
|
|
2366
|
+
anyOf: [
|
|
2367
|
+
{
|
|
2368
|
+
type: "string",
|
|
2369
|
+
const: "all"
|
|
2370
|
+
},
|
|
2371
|
+
{
|
|
2372
|
+
type: "string",
|
|
2373
|
+
const: "web"
|
|
2374
|
+
},
|
|
2375
|
+
{
|
|
2376
|
+
type: "string",
|
|
2377
|
+
const: "proprietary"
|
|
2378
|
+
},
|
|
2379
|
+
{
|
|
2380
|
+
type: "string",
|
|
2381
|
+
const: "news"
|
|
2382
|
+
}
|
|
2383
|
+
],
|
|
2384
|
+
description: "Valyu search type. Use 'news' for recent journalism or current events, 'web' for public web results, 'proprietary' for Valyu proprietary sources, and 'all' when both public and proprietary sources are useful."
|
|
2385
|
+
},
|
|
2386
|
+
responseLength: {
|
|
2387
|
+
anyOf: [
|
|
2388
|
+
{
|
|
2389
|
+
type: "string",
|
|
2390
|
+
const: "short"
|
|
2391
|
+
},
|
|
2392
|
+
{
|
|
2393
|
+
type: "string",
|
|
2394
|
+
const: "medium"
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
type: "string",
|
|
2398
|
+
const: "large"
|
|
2399
|
+
},
|
|
2400
|
+
{
|
|
2401
|
+
type: "string",
|
|
2402
|
+
const: "max"
|
|
2403
|
+
}
|
|
2404
|
+
],
|
|
2405
|
+
description: "Response length."
|
|
2406
|
+
},
|
|
2407
|
+
countryCode: {
|
|
2408
|
+
type: "string",
|
|
2409
|
+
description: "Country code to scope search results."
|
|
2410
|
+
},
|
|
2411
|
+
maxPrice: {
|
|
2412
|
+
type: "number",
|
|
2413
|
+
minimum: 0,
|
|
2414
|
+
description: "Maximum price per thousand characters (CPM)."
|
|
2415
|
+
},
|
|
2416
|
+
relevanceThreshold: {
|
|
2417
|
+
type: "number",
|
|
2418
|
+
minimum: 0,
|
|
2419
|
+
maximum: 1,
|
|
2420
|
+
description: "Minimum result relevance score."
|
|
2421
|
+
},
|
|
2422
|
+
includedSources: {
|
|
2423
|
+
type: "array",
|
|
2424
|
+
items: {
|
|
2425
|
+
type: "string"
|
|
2426
|
+
},
|
|
2427
|
+
description: "Restrict retrieval to these Valyu sources."
|
|
2428
|
+
},
|
|
2429
|
+
excludeSources: {
|
|
2430
|
+
type: "array",
|
|
2431
|
+
items: {
|
|
2432
|
+
type: "string"
|
|
2433
|
+
},
|
|
2434
|
+
description: "Exclude these Valyu sources."
|
|
2435
|
+
},
|
|
2436
|
+
sourceBiases: {
|
|
2437
|
+
type: "object",
|
|
2438
|
+
patternProperties: {
|
|
2439
|
+
"^.*$": {
|
|
2440
|
+
type: "number"
|
|
2441
|
+
}
|
|
2442
|
+
},
|
|
2443
|
+
description: "Per-source relevance bias weights."
|
|
2444
|
+
},
|
|
2445
|
+
category: {
|
|
2446
|
+
type: "string",
|
|
2447
|
+
description: "Valyu source category to search."
|
|
2448
|
+
},
|
|
2449
|
+
startDate: {
|
|
2450
|
+
type: "string",
|
|
2451
|
+
description: "ISO date string for earliest result date."
|
|
2452
|
+
},
|
|
2453
|
+
endDate: {
|
|
2454
|
+
type: "string",
|
|
2455
|
+
description: "ISO date string for latest result date."
|
|
2456
|
+
},
|
|
2457
|
+
historicalCache: {
|
|
2458
|
+
type: "boolean",
|
|
2459
|
+
description: "Allow Valyu historical cache usage when supported."
|
|
2460
|
+
},
|
|
2461
|
+
fastMode: {
|
|
2462
|
+
type: "boolean",
|
|
2463
|
+
description: "Use Valyu fast mode when lower latency is preferred."
|
|
2464
|
+
},
|
|
2465
|
+
urlOnly: {
|
|
2466
|
+
type: "boolean",
|
|
2467
|
+
description: "Return URL-focused results with less content."
|
|
2468
|
+
},
|
|
2469
|
+
instructions: {
|
|
2470
|
+
type: "string",
|
|
2471
|
+
description: "Provider instructions for retrieval and result selection."
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2474
|
+
description: "Valyu search options."
|
|
2475
|
+
},
|
|
2476
|
+
promptGuidelines: [
|
|
2477
|
+
"Use Valyu searchType='news' for recent journalism or current events, 'web' for public web results, and 'proprietary' when proprietary Valyu sources are required.",
|
|
2478
|
+
"Use includedSources, excludeSources, category, or source biases from configuration when the user asks for source-specific retrieval.",
|
|
2479
|
+
"Use startDate/endDate and countryCode when the task requires temporal or geographic scoping.",
|
|
2480
|
+
"Set responseLength higher only when search results need richer inline context; otherwise prefer concise results and follow up with web_contents."
|
|
2481
|
+
],
|
|
2482
|
+
retrySafe: true
|
|
2483
|
+
},
|
|
2484
|
+
contents: {
|
|
2485
|
+
options: {
|
|
2486
|
+
type: "object",
|
|
2487
|
+
properties: {
|
|
2488
|
+
summary: {
|
|
2489
|
+
anyOf: [
|
|
2490
|
+
{
|
|
2491
|
+
type: "boolean"
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
type: "string"
|
|
2495
|
+
},
|
|
2496
|
+
{
|
|
2497
|
+
type: "object",
|
|
2498
|
+
patternProperties: {
|
|
2499
|
+
"^.*$": {}
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
],
|
|
2503
|
+
description: "Whether to include a summary, or instructions for the summary."
|
|
2504
|
+
},
|
|
2505
|
+
extractEffort: {
|
|
2506
|
+
anyOf: [
|
|
2507
|
+
{
|
|
2508
|
+
type: "string",
|
|
2509
|
+
const: "normal"
|
|
2510
|
+
},
|
|
2511
|
+
{
|
|
2512
|
+
type: "string",
|
|
2513
|
+
const: "high"
|
|
2514
|
+
},
|
|
2515
|
+
{
|
|
2516
|
+
type: "string",
|
|
2517
|
+
const: "auto"
|
|
2518
|
+
}
|
|
2519
|
+
],
|
|
2520
|
+
description: "Extraction effort. Use 'high' for difficult pages and 'normal' for faster extraction."
|
|
2521
|
+
},
|
|
2522
|
+
responseLength: {
|
|
2523
|
+
anyOf: [
|
|
2524
|
+
{
|
|
2525
|
+
anyOf: [
|
|
2526
|
+
{
|
|
2527
|
+
type: "string",
|
|
2528
|
+
const: "short"
|
|
2529
|
+
},
|
|
2530
|
+
{
|
|
2531
|
+
type: "string",
|
|
2532
|
+
const: "medium"
|
|
2533
|
+
},
|
|
2534
|
+
{
|
|
2535
|
+
type: "string",
|
|
2536
|
+
const: "large"
|
|
2537
|
+
},
|
|
2538
|
+
{
|
|
2539
|
+
type: "string",
|
|
2540
|
+
const: "max"
|
|
2541
|
+
}
|
|
2542
|
+
]
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
type: "number",
|
|
2546
|
+
minimum: 0
|
|
2547
|
+
}
|
|
2548
|
+
],
|
|
2549
|
+
description: "Content response length."
|
|
2550
|
+
},
|
|
2551
|
+
maxPriceDollars: {
|
|
2552
|
+
type: "number",
|
|
2553
|
+
minimum: 0,
|
|
2554
|
+
description: "Maximum extraction cost in USD."
|
|
2555
|
+
},
|
|
2556
|
+
screenshot: {
|
|
2557
|
+
type: "boolean",
|
|
2558
|
+
description: "Include screenshot capture when supported."
|
|
2559
|
+
},
|
|
2560
|
+
startDate: {
|
|
2561
|
+
type: "string",
|
|
2562
|
+
description: "ISO date string for earliest content date."
|
|
2563
|
+
},
|
|
2564
|
+
endDate: {
|
|
2565
|
+
type: "string",
|
|
2566
|
+
description: "ISO date string for latest content date."
|
|
2567
|
+
},
|
|
2568
|
+
historicalCache: {
|
|
2569
|
+
type: "boolean",
|
|
2570
|
+
description: "Allow Valyu historical cache usage when supported."
|
|
2571
|
+
}
|
|
2572
|
+
},
|
|
2573
|
+
description: "Valyu contents options."
|
|
2574
|
+
},
|
|
2575
|
+
retrySafe: false
|
|
2576
|
+
},
|
|
2577
|
+
answer: {
|
|
2578
|
+
options: {
|
|
2579
|
+
type: "object",
|
|
2580
|
+
properties: {
|
|
2581
|
+
structuredOutput: {
|
|
2582
|
+
type: "object",
|
|
2583
|
+
patternProperties: {
|
|
2584
|
+
"^.*$": {}
|
|
2585
|
+
},
|
|
2586
|
+
description: "JSON schema-like structured output specification."
|
|
2587
|
+
},
|
|
2588
|
+
systemInstructions: {
|
|
2589
|
+
type: "string",
|
|
2590
|
+
description: "System instructions that guide Valyu answer generation."
|
|
2591
|
+
},
|
|
2592
|
+
searchType: {
|
|
2593
|
+
anyOf: [
|
|
2594
|
+
{
|
|
2595
|
+
type: "string",
|
|
2596
|
+
const: "all"
|
|
2597
|
+
},
|
|
2598
|
+
{
|
|
2599
|
+
type: "string",
|
|
2600
|
+
const: "web"
|
|
2601
|
+
},
|
|
2602
|
+
{
|
|
2603
|
+
type: "string",
|
|
2604
|
+
const: "proprietary"
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
type: "string",
|
|
2608
|
+
const: "news"
|
|
2609
|
+
}
|
|
2610
|
+
],
|
|
2611
|
+
description: "Valyu search type for answer grounding."
|
|
2612
|
+
},
|
|
2613
|
+
dataMaxPrice: {
|
|
2614
|
+
type: "number",
|
|
2615
|
+
minimum: 0,
|
|
2616
|
+
description: "Maximum data retrieval price for answer grounding."
|
|
2617
|
+
},
|
|
2618
|
+
countryCode: {
|
|
2619
|
+
type: "string",
|
|
2620
|
+
description: "Country code to scope answer results."
|
|
2621
|
+
},
|
|
2622
|
+
includedSources: {
|
|
2623
|
+
type: "array",
|
|
2624
|
+
items: {
|
|
2625
|
+
type: "string"
|
|
2626
|
+
},
|
|
2627
|
+
description: "Restrict answer grounding to these Valyu sources."
|
|
2628
|
+
},
|
|
2629
|
+
excludedSources: {
|
|
2630
|
+
type: "array",
|
|
2631
|
+
items: {
|
|
2632
|
+
type: "string"
|
|
2633
|
+
},
|
|
2634
|
+
description: "Exclude these Valyu sources from answer grounding."
|
|
2635
|
+
},
|
|
2636
|
+
startDate: {
|
|
2637
|
+
type: "string",
|
|
2638
|
+
description: "ISO date string for earliest source date."
|
|
2639
|
+
},
|
|
2640
|
+
endDate: {
|
|
2641
|
+
type: "string",
|
|
2642
|
+
description: "ISO date string for latest source date."
|
|
2643
|
+
},
|
|
2644
|
+
fastMode: {
|
|
2645
|
+
type: "boolean",
|
|
2646
|
+
description: "Use Valyu fast mode when lower latency is preferred."
|
|
2647
|
+
}
|
|
2648
|
+
},
|
|
2649
|
+
description: "Valyu answer options."
|
|
2650
|
+
},
|
|
2651
|
+
retrySafe: false
|
|
2652
|
+
},
|
|
2653
|
+
research: {
|
|
2654
|
+
options: {
|
|
2655
|
+
type: "object",
|
|
2656
|
+
properties: {
|
|
2657
|
+
mode: {
|
|
2658
|
+
anyOf: [
|
|
2659
|
+
{
|
|
2660
|
+
type: "string",
|
|
2661
|
+
const: "fast"
|
|
2662
|
+
},
|
|
2663
|
+
{
|
|
2664
|
+
type: "string",
|
|
2665
|
+
const: "standard"
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
type: "string",
|
|
2669
|
+
const: "lite"
|
|
2670
|
+
},
|
|
2671
|
+
{
|
|
2672
|
+
type: "string",
|
|
2673
|
+
const: "heavy"
|
|
2674
|
+
},
|
|
2675
|
+
{
|
|
2676
|
+
type: "string",
|
|
2677
|
+
const: "max"
|
|
2678
|
+
}
|
|
2679
|
+
],
|
|
2680
|
+
description: "Valyu deep research mode."
|
|
2681
|
+
},
|
|
2682
|
+
outputFormats: {
|
|
2683
|
+
type: "array",
|
|
2684
|
+
items: {
|
|
2685
|
+
anyOf: [
|
|
2686
|
+
{
|
|
2687
|
+
anyOf: [
|
|
2688
|
+
{
|
|
2689
|
+
type: "string",
|
|
2690
|
+
const: "markdown"
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
type: "string",
|
|
2694
|
+
const: "pdf"
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
type: "string",
|
|
2698
|
+
const: "toon"
|
|
2699
|
+
}
|
|
2700
|
+
]
|
|
2701
|
+
},
|
|
2702
|
+
{
|
|
2703
|
+
type: "object",
|
|
2704
|
+
patternProperties: {
|
|
2705
|
+
"^.*$": {}
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
]
|
|
2709
|
+
},
|
|
2710
|
+
description: "Requested Valyu research output formats."
|
|
2711
|
+
},
|
|
2712
|
+
search: {
|
|
2713
|
+
type: "object",
|
|
2714
|
+
properties: {
|
|
2715
|
+
searchType: {
|
|
2716
|
+
anyOf: [
|
|
2717
|
+
{
|
|
2718
|
+
type: "string",
|
|
2719
|
+
const: "all"
|
|
2720
|
+
},
|
|
2721
|
+
{
|
|
2722
|
+
type: "string",
|
|
2723
|
+
const: "web"
|
|
2724
|
+
},
|
|
2725
|
+
{
|
|
2726
|
+
type: "string",
|
|
2727
|
+
const: "proprietary"
|
|
2728
|
+
}
|
|
2729
|
+
],
|
|
2730
|
+
description: "Valyu source pool for research."
|
|
2731
|
+
},
|
|
2732
|
+
includedSources: {
|
|
2733
|
+
type: "array",
|
|
2734
|
+
items: {
|
|
2735
|
+
type: "string"
|
|
2736
|
+
}
|
|
2737
|
+
},
|
|
2738
|
+
excludedSources: {
|
|
2739
|
+
type: "array",
|
|
2740
|
+
items: {
|
|
2741
|
+
type: "string"
|
|
2742
|
+
}
|
|
2743
|
+
},
|
|
2744
|
+
sourceBiases: {
|
|
2745
|
+
type: "object",
|
|
2746
|
+
patternProperties: {
|
|
2747
|
+
"^.*$": {
|
|
2748
|
+
type: "number"
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
},
|
|
2752
|
+
startDate: {
|
|
2753
|
+
type: "string"
|
|
2754
|
+
},
|
|
2755
|
+
endDate: {
|
|
2756
|
+
type: "string"
|
|
2757
|
+
},
|
|
2758
|
+
historicalCache: {
|
|
2759
|
+
type: "boolean"
|
|
2760
|
+
},
|
|
2761
|
+
category: {
|
|
2762
|
+
type: "string"
|
|
2763
|
+
},
|
|
2764
|
+
countryCode: {
|
|
2765
|
+
type: "string"
|
|
2766
|
+
}
|
|
2767
|
+
},
|
|
2768
|
+
additionalProperties: false,
|
|
2769
|
+
description: "Valyu deep research search configuration."
|
|
2770
|
+
},
|
|
2771
|
+
tools: {
|
|
2772
|
+
type: "object",
|
|
2773
|
+
properties: {
|
|
2774
|
+
code_execution: toolControl,
|
|
2775
|
+
screenshots: toolControl,
|
|
2776
|
+
browser_use: toolControl,
|
|
2777
|
+
charts: toolControl
|
|
2778
|
+
},
|
|
2779
|
+
additionalProperties: false,
|
|
2780
|
+
description: "Valyu deep research tool configuration."
|
|
2781
|
+
}
|
|
2782
|
+
},
|
|
2783
|
+
description: "Valyu research options."
|
|
2784
|
+
},
|
|
2785
|
+
retrySafe: false
|
|
2786
|
+
}
|
|
2787
|
+
},
|
|
2788
|
+
load: async () => (await import("./adapter-UAZNLDSS.js")).adapter
|
|
2789
|
+
});
|
|
2790
|
+
|
|
2791
|
+
// src/providers/registry.ts
|
|
2792
|
+
var providers = {
|
|
2793
|
+
brave: braveProvider,
|
|
2794
|
+
cloudflare: cloudflareProvider,
|
|
2795
|
+
custom: customProvider,
|
|
2796
|
+
exa: exaProvider,
|
|
2797
|
+
firecrawl: firecrawlProvider,
|
|
2798
|
+
gemini: geminiProvider,
|
|
2799
|
+
linkup: linkupProvider,
|
|
2800
|
+
ollama: ollamaProvider,
|
|
2801
|
+
openai: openaiProvider,
|
|
2802
|
+
parallel: parallelProvider,
|
|
2803
|
+
perplexity: perplexityProvider,
|
|
2804
|
+
serper: serperProvider,
|
|
2805
|
+
tavily: tavilyProvider,
|
|
2806
|
+
valyu: valyuProvider
|
|
2807
|
+
};
|
|
2808
|
+
|
|
2809
|
+
// src/configuration/options-schema.ts
|
|
2810
|
+
function buildOptionSchema(providerSchema) {
|
|
2811
|
+
if (!providerSchema || Object.keys(providerSchema.properties).length === 0) {
|
|
2812
|
+
return void 0;
|
|
2813
|
+
}
|
|
2814
|
+
return closeObjectSchemas(providerSchema);
|
|
2815
|
+
}
|
|
2816
|
+
function closeObjectSchemas(schema) {
|
|
2817
|
+
if (!isSchemaRecord(schema)) {
|
|
2818
|
+
return schema;
|
|
2819
|
+
}
|
|
2820
|
+
const properties = isSchemaRecord(schema.properties) ? Object.fromEntries(
|
|
2821
|
+
Object.entries(schema.properties).map(([key, value]) => [
|
|
2822
|
+
key,
|
|
2823
|
+
closeObjectSchemas(value)
|
|
2824
|
+
])
|
|
2825
|
+
) : schema.properties;
|
|
2826
|
+
const items = isSchemaRecord(schema.items) ? closeObjectSchemas(schema.items) : Array.isArray(schema.items) ? schema.items.map((item) => closeObjectSchemas(item)) : schema.items;
|
|
2827
|
+
return {
|
|
2828
|
+
...schema,
|
|
2829
|
+
...properties ? { properties } : {},
|
|
2830
|
+
...items ? { items } : {},
|
|
2831
|
+
...mapSchemaArray(schema, "anyOf"),
|
|
2832
|
+
...mapSchemaArray(schema, "oneOf"),
|
|
2833
|
+
...mapSchemaArray(schema, "allOf"),
|
|
2834
|
+
...schema.type === "object" && isSchemaRecord(schema.properties) ? { additionalProperties: false } : {}
|
|
2835
|
+
};
|
|
2836
|
+
}
|
|
2837
|
+
function mapSchemaArray(schema, key) {
|
|
2838
|
+
const value = schema[key];
|
|
2839
|
+
return Array.isArray(value) ? { [key]: value.map((entry) => closeObjectSchemas(entry)) } : {};
|
|
2840
|
+
}
|
|
2841
|
+
function isSchemaRecord(value) {
|
|
2842
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
// src/configuration/planning.ts
|
|
2846
|
+
function selectProvider(config, capability, requested) {
|
|
2847
|
+
const id = requested ?? config.defaults?.[capability]?.provider;
|
|
2848
|
+
const example = capability === "contents" ? "tavily" : capability === "research" ? "gemini" : "brave";
|
|
2849
|
+
if (!id)
|
|
2850
|
+
throw new WebfoxError(
|
|
2851
|
+
"PROVIDER_UNAVAILABLE",
|
|
2852
|
+
`No ${capability} provider selected.
|
|
2853
|
+
|
|
2854
|
+
Run with --provider ${example}, or save a default:
|
|
2855
|
+
web config default ${capability} ${example}
|
|
2856
|
+
|
|
2857
|
+
See available providers: web providers`
|
|
2858
|
+
);
|
|
2859
|
+
const definition = Object.hasOwn(providers, id) ? providers[id] : void 0;
|
|
2860
|
+
if (!definition?.capabilities[capability])
|
|
2861
|
+
throw new WebfoxError(
|
|
2862
|
+
"PROVIDER_UNAVAILABLE",
|
|
2863
|
+
`Provider '${id}' does not support ${capability}. See available providers: web providers`
|
|
2864
|
+
);
|
|
2865
|
+
return definition;
|
|
2866
|
+
}
|
|
2867
|
+
function optionSchema(definition, capability, mode = "request") {
|
|
2868
|
+
const schema = definition.capabilities[capability]?.options;
|
|
2869
|
+
if (!schema) return void 0;
|
|
2870
|
+
const result = buildOptionSchema(schema);
|
|
2871
|
+
if (mode === "defaults") {
|
|
2872
|
+
const partial = (value) => {
|
|
2873
|
+
if (!value || typeof value !== "object") return;
|
|
2874
|
+
if ("required" in value && Array.isArray(value.required))
|
|
2875
|
+
delete value.required;
|
|
2876
|
+
for (const child of Object.values(value)) partial(child);
|
|
2877
|
+
};
|
|
2878
|
+
partial(result);
|
|
2879
|
+
}
|
|
2880
|
+
return result;
|
|
2881
|
+
}
|
|
2882
|
+
function effectiveOptions(config, definition, capability, options = {}, mode = "request") {
|
|
2883
|
+
const result = deepMerge(
|
|
2884
|
+
deepMerge(
|
|
2885
|
+
definition.defaults[capability] ?? {},
|
|
2886
|
+
config.providers?.[definition.id]?.options?.[capability] ?? {}
|
|
2887
|
+
),
|
|
2888
|
+
options
|
|
2889
|
+
);
|
|
2890
|
+
validateOptions(definition, capability, result, mode);
|
|
2891
|
+
return result;
|
|
2892
|
+
}
|
|
2893
|
+
function validateOptions(definition, capability, options, mode = "request") {
|
|
2894
|
+
if (!definition.capabilities[capability])
|
|
2895
|
+
throw new WebfoxError(
|
|
2896
|
+
"INVALID_INPUT",
|
|
2897
|
+
`${definition.id} does not support ${capability}`
|
|
2898
|
+
);
|
|
2899
|
+
const schema = optionSchema(definition, capability, mode);
|
|
2900
|
+
if (!schema) {
|
|
2901
|
+
if (definition.id !== "custom" && Object.keys(options).length)
|
|
2902
|
+
throw new WebfoxError(
|
|
2903
|
+
"INVALID_INPUT",
|
|
2904
|
+
`${definition.id} ${capability} does not accept provider options`
|
|
2905
|
+
);
|
|
2906
|
+
return;
|
|
2907
|
+
}
|
|
2908
|
+
if (!Check(schema, options)) {
|
|
2909
|
+
const detail = Errors(schema, options).slice(0, 3).map((error) => `${error.instancePath || "options"}: ${error.message}`).join("; ");
|
|
2910
|
+
throw new WebfoxError(
|
|
2911
|
+
"INVALID_INPUT",
|
|
2912
|
+
`Invalid ${definition.id} ${capability} options: ${detail}`
|
|
2913
|
+
);
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
function validateConfiguredOptions(config) {
|
|
2917
|
+
try {
|
|
2918
|
+
for (const [id, stored] of Object.entries(config.providers ?? {})) {
|
|
2919
|
+
const definition = providers[id];
|
|
2920
|
+
for (const capability of CAPABILITIES) {
|
|
2921
|
+
const options = stored.options?.[capability];
|
|
2922
|
+
if (options)
|
|
2923
|
+
validateOptions(definition, capability, options, "defaults");
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
} catch (error) {
|
|
2927
|
+
if (error instanceof WebfoxError)
|
|
2928
|
+
throw new WebfoxError("INVALID_CONFIG", error.message);
|
|
2929
|
+
throw error;
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
function deepMerge(base, override) {
|
|
2933
|
+
const result = structuredClone(base);
|
|
2934
|
+
for (const [key, value] of Object.entries(override)) {
|
|
2935
|
+
if (["__proto__", "constructor", "prototype"].includes(key))
|
|
2936
|
+
throw new WebfoxError("INVALID_INPUT", `Unsafe option key: ${key}`);
|
|
2937
|
+
result[key] = isObject(result[key]) && isObject(value) ? deepMerge(result[key], value) : structuredClone(value);
|
|
2938
|
+
}
|
|
2939
|
+
return result;
|
|
2940
|
+
}
|
|
2941
|
+
function isObject(value) {
|
|
2942
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
// src/configuration/schema.ts
|
|
2946
|
+
var text = { type: "string", minLength: 1 };
|
|
2947
|
+
var object = (properties) => ({
|
|
2948
|
+
type: "object",
|
|
2949
|
+
additionalProperties: false,
|
|
2950
|
+
properties
|
|
2951
|
+
});
|
|
2952
|
+
var source = {
|
|
2953
|
+
oneOf: ["env", "value", "command"].map((key) => ({
|
|
2954
|
+
...object({
|
|
2955
|
+
[key]: key === "command" ? { type: "array", minItems: 1, items: text } : text
|
|
2956
|
+
}),
|
|
2957
|
+
required: [key]
|
|
2958
|
+
}))
|
|
2959
|
+
};
|
|
2960
|
+
var sourceMap = { type: "object", additionalProperties: source };
|
|
2961
|
+
var command = {
|
|
2962
|
+
...object({
|
|
2963
|
+
argv: { type: "array", minItems: 1, items: text },
|
|
2964
|
+
cwd: text,
|
|
2965
|
+
env: sourceMap
|
|
2966
|
+
}),
|
|
2967
|
+
required: ["argv"]
|
|
2968
|
+
};
|
|
2969
|
+
var positive = { type: "integer", minimum: 1 };
|
|
2970
|
+
var timeout = { ...positive, maximum: 2147483647 };
|
|
2971
|
+
var fields = {
|
|
2972
|
+
credentials: sourceMap,
|
|
2973
|
+
baseUrl: text,
|
|
2974
|
+
accountId: source,
|
|
2975
|
+
commands: object(
|
|
2976
|
+
Object.fromEntries(CAPABILITIES.map((capability) => [capability, command]))
|
|
2977
|
+
)
|
|
2978
|
+
};
|
|
2979
|
+
var configurationSchema = {
|
|
2980
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
2981
|
+
$id: CONFIG_SCHEMA_URL,
|
|
2982
|
+
title: "webfox configuration",
|
|
2983
|
+
...object({
|
|
2984
|
+
$schema: text,
|
|
2985
|
+
defaults: object(
|
|
2986
|
+
Object.fromEntries(
|
|
2987
|
+
CAPABILITIES.map((capability) => [
|
|
2988
|
+
capability,
|
|
2989
|
+
object({
|
|
2990
|
+
provider: {
|
|
2991
|
+
enum: Object.values(providers).filter((provider) => provider.capabilities[capability]).map((provider) => provider.id)
|
|
2992
|
+
},
|
|
2993
|
+
...capability === "search" ? { maxResults: positive } : {}
|
|
2994
|
+
})
|
|
2995
|
+
])
|
|
2996
|
+
)
|
|
2997
|
+
),
|
|
2998
|
+
execution: object({
|
|
2999
|
+
timeoutMs: timeout,
|
|
3000
|
+
researchTimeoutMs: timeout,
|
|
3001
|
+
retries: { type: "integer", minimum: 0 },
|
|
3002
|
+
retryDelayMs: { type: "integer", minimum: 0 },
|
|
3003
|
+
concurrency: positive
|
|
3004
|
+
}),
|
|
3005
|
+
providers: object(
|
|
3006
|
+
Object.fromEntries(
|
|
3007
|
+
Object.values(providers).map((provider) => [
|
|
3008
|
+
provider.id,
|
|
3009
|
+
object(
|
|
3010
|
+
Object.fromEntries(
|
|
3011
|
+
provider.fields.map((field) => [
|
|
3012
|
+
field,
|
|
3013
|
+
field === "options" ? object(
|
|
3014
|
+
Object.fromEntries(
|
|
3015
|
+
CAPABILITIES.filter(
|
|
3016
|
+
(capability) => provider.capabilities[capability]
|
|
3017
|
+
).map((capability) => [
|
|
3018
|
+
capability,
|
|
3019
|
+
optionSchema(provider, capability, "defaults") ?? {
|
|
3020
|
+
type: "object",
|
|
3021
|
+
additionalProperties: provider.id === "custom"
|
|
3022
|
+
}
|
|
3023
|
+
])
|
|
3024
|
+
)
|
|
3025
|
+
) : field === "credentials" ? object(
|
|
3026
|
+
Object.fromEntries(
|
|
3027
|
+
provider.credentials.map((credential) => [
|
|
3028
|
+
credential.name,
|
|
3029
|
+
source
|
|
3030
|
+
])
|
|
3031
|
+
)
|
|
3032
|
+
) : fields[field]
|
|
3033
|
+
])
|
|
3034
|
+
)
|
|
3035
|
+
)
|
|
3036
|
+
])
|
|
3037
|
+
)
|
|
3038
|
+
)
|
|
3039
|
+
})
|
|
3040
|
+
};
|
|
3041
|
+
|
|
3042
|
+
export {
|
|
3043
|
+
PACKAGE_VERSION,
|
|
3044
|
+
CONFIG_SCHEMA_URL,
|
|
3045
|
+
providers,
|
|
3046
|
+
selectProvider,
|
|
3047
|
+
optionSchema,
|
|
3048
|
+
effectiveOptions,
|
|
3049
|
+
validateConfiguredOptions,
|
|
3050
|
+
configurationSchema
|
|
3051
|
+
};
|