pi-web-providers 2.0.0 β†’ 2.2.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.
Files changed (3) hide show
  1. package/README.md +82 -52
  2. package/dist/index.js +2899 -15224
  3. package/package.json +24 -19
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # 🌍 pi-web-providers
2
2
 
3
3
  A _meta_ web extension for [pi](https://pi.dev) that routes search, content
4
- extraction, answers, and research through configurable per-tool providers.
4
+ extraction, answers, and research through configurable per-tool providers, with
5
+ explicit provider-specific option schemas for each managed tool.
5
6
 
6
7
  ## Why?
7
8
 
@@ -13,7 +14,9 @@ off entirely.
13
14
  ## ✨ Features
14
15
 
15
16
  - **Multiple providers**: Claude, Cloudflare, Codex, Exa, Firecrawl,
16
- Gemini, Perplexity, Parallel, [Tavily](https://tavily.com), Valyu
17
+ Gemini, Linkup, Perplexity, Parallel, [Tavily](https://tavily.com), Valyu
18
+ - **Explicit provider option schemas**: the registered tool schema exposes the
19
+ supported `options.provider` fields for the selected provider
17
20
  - **Batched search and answers**: run several related queries in a single
18
21
  `web_search` or `web_answer` call and get grouped results back in one response
19
22
  - **Async contents prefetch**: optionally start background `web_contents`
@@ -46,6 +49,7 @@ Each tool can be routed to any compatible provider:
46
49
  | **Exa** | βœ” | βœ” | βœ” | βœ” | `EXA_API_KEY` |
47
50
  | **Firecrawl** | βœ” | βœ” | | | `FIRECRAWL_API_KEY` |
48
51
  | **Gemini** | βœ” | | βœ” | βœ” | `GOOGLE_API_KEY` |
52
+ | **Linkup** | βœ” | βœ” | | | `LINKUP_API_KEY` |
49
53
  | **Perplexity** | βœ” | | βœ” | βœ” | `PERPLEXITY_API_KEY` |
50
54
  | **Parallel** | βœ” | βœ” | | | `PARALLEL_API_KEY` |
51
55
  | **Tavily** | βœ” | βœ” | | | `TAVILY_API_KEY` |
@@ -77,17 +81,18 @@ results should arrive as soon as they are ready.
77
81
  <details>
78
82
  <summary><strong>Parameters and behavior</strong></summary>
79
83
 
80
- | Parameter | Type | Default | Description |
81
- | ------------ | -------- | -------- | -------------------------------------------------------------- |
82
- | `queries` | string[] | required | One or more search queries to run (max 10) |
83
- | `maxResults` | integer | `5` | Result count per query, clamped to `1–20` |
84
- | `options` | object | β€” | Provider-specific search options and local `prefetch` settings |
84
+ | Parameter | Type | Default | Description |
85
+ | ------------ | -------- | -------- | ------------------------------------------------------------------------------------------ |
86
+ | `queries` | string[] | required | One or more search queries to run (max 10) |
87
+ | `maxResults` | integer | `5` | Result count per query, clamped to `1–20` |
88
+ | `options` | object | β€” | `provider` settings exposed by the selected provider schema, plus local `runtime` settings |
85
89
 
86
- `web_search.options.prefetch` is local-only and not forwarded into the provider
87
- SDK. It accepts `provider`, `maxUrls`, `ttlMs`, and `contentsOptions`, and
88
- starts a background page-extraction workflow only when `prefetch.provider` is
89
- set. `/web-providers` can also persist default search prefetch settings under
90
- `settings.search`.
90
+ `web_search.options.runtime.prefetch` is local-only and is not forwarded to the
91
+ provider SDK. It accepts `provider`, `maxUrls`, and `ttlMs`, and starts a
92
+ background page-extraction workflow only when `prefetch.provider` is set.
93
+ `/web-providers` can also persist default search prefetch settings under
94
+ `settings.search`. Per-call retry and timeout overrides also live under
95
+ `web_search.options.runtime`.
91
96
 
92
97
  </details>
93
98
 
@@ -101,10 +106,10 @@ each page can be acted on independently.
101
106
  <details>
102
107
  <summary><strong>Parameters and behavior</strong></summary>
103
108
 
104
- | Parameter | Type | Default | Description |
105
- | --------- | -------- | -------- | ------------------------------------ |
106
- | `urls` | string[] | required | One or more URLs to extract |
107
- | `options` | object | β€” | Provider-specific extraction options |
109
+ | Parameter | Type | Default | Description |
110
+ | --------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------- |
111
+ | `urls` | string[] | required | One or more URLs to extract |
112
+ | `options` | object | β€” | `provider` extraction settings exposed by the selected provider schema, plus optional local `runtime` overrides |
108
113
 
109
114
  `web_contents` reuses any matching cached pages already present in the local
110
115
  in-memory cacheβ€”whether they came from prefetch or an earlier readβ€”and only
@@ -122,10 +127,10 @@ calls when earlier independent answers can unblock the next step.
122
127
  <details>
123
128
  <summary><strong>Parameters and behavior</strong></summary>
124
129
 
125
- | Parameter | Type | Default | Description |
126
- | --------- | -------- | -------- | ---------------------------------------------------- |
127
- | `queries` | string[] | required | One or more questions to answer in one call (max 10) |
128
- | `options` | object | β€” | Provider-specific options |
130
+ | Parameter | Type | Default | Description |
131
+ | --------- | -------- | -------- | ---------------------------------------------------------------------------------------------------- |
132
+ | `queries` | string[] | required | One or more questions to answer in one call (max 10) |
133
+ | `options` | object | β€” | `provider` settings exposed by the selected provider schema, plus optional local `runtime` overrides |
129
134
 
130
135
  Responses are grouped into per-question sections when more than one question is
131
136
  provided.
@@ -142,15 +147,15 @@ saved report path.
142
147
  <details>
143
148
  <summary><strong>Parameters and behavior</strong></summary>
144
149
 
145
- | Parameter | Type | Default | Description |
146
- | --------- | ------ | -------- | -------------------------- |
147
- | `input` | string | required | Research brief or question |
148
- | `options` | object | β€” | Provider-specific options |
150
+ | Parameter | Type | Default | Description |
151
+ | --------- | ------ | -------- | ----------------------------------------------------------------------------- |
152
+ | `input` | string | required | Research brief or question |
153
+ | `options` | object | β€” | Provider-specific `provider` settings exposed by the selected provider schema |
149
154
 
150
- `options` are provider-specific. Equivalent concepts can use
151
- different field names across SDKsβ€”for example Perplexity uses `country`, Exa
152
- uses `userLocation`, and Valyu uses `countryCode`. Runtime `options` override
153
- provider config, but managed tool inputs and tool wiring stay fixed.
155
+ `options.provider` is provider-specific. Equivalent concepts can use different
156
+ field names across SDKsβ€”for example Perplexity uses `country`, Exa uses
157
+ `userLocation`, and Valyu uses `countryCode`. Unlike the other managed tools,
158
+ `web_research` does not support per-call `options.runtime` overrides.
154
159
 
155
160
  Unlike the other managed tools, `web_research` does not accept local timeout,
156
161
  retry, polling, or resume controls. Research has one opinionated execution
@@ -169,8 +174,8 @@ The built-in providers below are thin adapters around official SDKs.
169
174
  - SDK: `@anthropic-ai/claude-agent-sdk`
170
175
  - Uses Claude Code's built-in `WebSearch` and `WebFetch` tools behind a
171
176
  structured JSON adapter
172
- - Supports request-shaping `options` such as `model`, `thinking`, `effort`, and
173
- `maxTurns`
177
+ - Exposes `model`, `thinking`, `effort`, `maxThinkingTokens`, `maxTurns`, and
178
+ `maxBudgetUsd` as provider options for search and answer calls
174
179
  - Great for search plus grounded answers if you already use Claude Code locally
175
180
 
176
181
  </details>
@@ -183,8 +188,7 @@ The built-in providers below are thin adapters around official SDKs.
183
188
  endpoint
184
189
  - Good for JavaScript-heavy pages that need a real browser render before
185
190
  extraction
186
- - Supports provider-specific markdown options such as `gotoOptions`,
187
- `waitForSelector`, `waitForTimeout`, `cacheTTL`, and request filtering
191
+ - Exposes `gotoOptions.waitUntil` as the provider-specific contents option
188
192
 
189
193
  **Setup**
190
194
 
@@ -219,8 +223,8 @@ scope, or account ID is usually wrong.
219
223
 
220
224
  - SDK: `@openai/codex-sdk`
221
225
  - Runs in read-only mode with web search enabled
222
- - Supports request-shaping `web_search.options` such as `model`,
223
- `modelReasoningEffort`, and `webSearchMode`
226
+ - Exposes `model`, `modelReasoningEffort`, and `webSearchMode` as provider
227
+ options for `web_search`
224
228
  - Best if you already use the local Codex CLI and auth flow
225
229
 
226
230
  </details>
@@ -233,6 +237,11 @@ scope, or account ID is usually wrong.
233
237
  - `web_research` is exposed through pi's async research workflow
234
238
  - Neural, keyword, hybrid, and deep-research search modes
235
239
  - Inline text-content extraction on search results
240
+ - Exposes search options such as `category`, `type`, date filters,
241
+ `includeDomains`, `excludeDomains`, `userLocation`, and `contents`
242
+ - Persisted Exa defaults are scoped under `providers.exa.options.search`
243
+ - `web_contents`, `web_answer`, and `web_research` currently use fixed adapter
244
+ behavior with no extra per-call provider options
236
245
 
237
246
  </details>
238
247
 
@@ -243,11 +252,10 @@ scope, or account ID is usually wrong.
243
252
  - Supports `web_search` and `web_contents`
244
253
  - Search can optionally include Firecrawl scrape-backed result enrichment
245
254
  - Contents extraction uses Firecrawl scrape with markdown-first defaults
246
- - Supports provider-specific `options.search` such as `sources`, `categories`,
255
+ - Exposes search options such as `lang`, `country`, `sources`, `categories`,
247
256
  `location`, `timeout`, and `scrapeOptions`
248
- - Supports provider-specific `options.scrape` such as `formats`,
249
- `onlyMainContent`, `waitFor`, `headers`, `location`, `mobile`, `proxy`, and
250
- cache controls
257
+ - Exposes contents options such as `formats`, `onlyMainContent`, `includeTags`,
258
+ `excludeTags`, `waitFor`, `headers`, `location`, `mobile`, and `proxy`
251
259
 
252
260
  </details>
253
261
 
@@ -259,8 +267,22 @@ scope, or account ID is usually wrong.
259
267
  - `web_research` is exposed through pi's async research workflow
260
268
  - Google Search grounding for answers
261
269
  - Deep-research agents via Google's Gemini API
262
- - Supports provider-specific request options such as `model`, `config`,
263
- `generation_config`, and `agent_config` depending on the tool
270
+ - Exposes `model` and `generation_config` for search, `model` and `config`
271
+ for answers, and `agent_config`, `store`, `response_format`,
272
+ `response_modalities`, `system_instruction`, and `tools` for research
273
+
274
+ </details>
275
+
276
+ <details>
277
+ <summary><strong>Linkup</strong></summary>
278
+
279
+ - SDK: `linkup-sdk`
280
+ - Supports `web_search` via Linkup Search with fixed `searchResults` output
281
+ - Supports `web_contents` via Linkup Fetch and always returns markdown
282
+ - Exposes search options `depth`, `includeImages`, `includeDomains`,
283
+ `excludeDomains`, `fromDate`, and `toDate`
284
+ - Exposes contents options `renderJs`, `includeRawHtml`, and `extractImages`
285
+ - Good fit for a simple search-plus-markdown setup without extra provider wiring
264
286
 
265
287
  </details>
266
288
 
@@ -272,8 +294,9 @@ scope, or account ID is usually wrong.
272
294
  - `web_research` is exposed through pi's async research workflow
273
295
  - Uses Perplexity Search for `web_search`
274
296
  - Uses Sonar for `web_answer` and `sonar-deep-research` for `web_research`
275
- - Supports provider-specific `web_search.options` such as `country`,
276
- `search_mode`, `search_domain_filter`, and `search_recency_filter`
297
+ - Exposes search options `country`, `search_mode`,
298
+ `search_domain_filter`, and `search_recency_filter`
299
+ - Exposes `model` for answer and research calls
277
300
 
278
301
  </details>
279
302
 
@@ -283,7 +306,8 @@ scope, or account ID is usually wrong.
283
306
  - SDK: `parallel-web`
284
307
  - Agentic and one-shot search modes
285
308
  - Page content extraction with excerpt and full-content toggles
286
- - Supports provider-specific search and extraction options from the Parallel SDK
309
+ - Exposes search option `mode`
310
+ - Exposes contents options `excerpts` and `full_content`
287
311
 
288
312
  </details>
289
313
 
@@ -294,12 +318,11 @@ scope, or account ID is usually wrong.
294
318
  - Supports `web_search` via Tavily Search
295
319
  - Supports `web_contents` via Tavily Extract
296
320
  - Good for pairing LLM-oriented web search with lightweight page extraction
297
- - Supports provider-specific `options.search` such as `searchDepth`, `topic`,
298
- `timeRange`, `includeRawContent`, `includeDomains`, `excludeDomains`,
299
- `country`, `exactMatch`, and `includeFavicon`
300
- - Supports provider-specific `options.extract` such as `extractDepth`,
301
- `format`, `includeImages`, `query`, `chunksPerSource`, and
302
- `includeFavicon`
321
+ - Exposes search options `topic`, `searchDepth`, `timeRange`, `country`,
322
+ `exactMatch`, `includeAnswer`, `includeRawContent`, `includeImages`,
323
+ `includeFavicon`, `includeDomains`, `excludeDomains`, and `days`
324
+ - Exposes contents options `extractDepth`, `format`, `includeImages`, `query`,
325
+ `chunksPerSource`, and `includeFavicon`
303
326
 
304
327
  </details>
305
328
 
@@ -310,9 +333,12 @@ scope, or account ID is usually wrong.
310
333
  - Supports `web_search`, `web_contents`, `web_answer`, and `web_research`
311
334
  - `web_research` is exposed through pi's async research workflow
312
335
  - Web, proprietary, and news search types
313
- - Supports provider-specific options such as `countryCode`, `responseLength`, and
314
- search/source filters
315
- - Configurable response length for answers and research
336
+ - Exposes search options `searchType`, `responseLength`, and `countryCode`
337
+ - Exposes answer and research options `responseLength` and `countryCode`
338
+ - Persisted Valyu defaults are scoped under `providers.valyu.options.search`,
339
+ `providers.valyu.options.answer`, and `providers.valyu.options.research`
340
+ - `web_contents` currently uses fixed adapter behavior with no extra per-call
341
+ provider options
316
342
 
317
343
  </details>
318
344
 
@@ -322,6 +348,10 @@ The `custom` provider lets you bring your own wrapper command for any
322
348
  managed tool. Each capability can point at a different local command under
323
349
  `providers["custom"].options`.
324
350
 
351
+ `custom` does not expose standard per-call `options.provider` fields. Put
352
+ provider-specific behavior in the wrapper configuration or in the wrapper
353
+ implementation.
354
+
325
355
  The repo includes actual wrapper examples under
326
356
  [`examples/custom/wrappers/`](examples/custom/wrappers/). They are
327
357
  small bash scripts that use `jq` for JSON handling. Each one uses a different