pi-web-providers 2.1.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.
- package/README.md +70 -55
- package/dist/index.js +2709 -15259
- package/package.json +7 -4
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
|
|
|
@@ -14,6 +15,8 @@ off entirely.
|
|
|
14
15
|
|
|
15
16
|
- **Multiple providers**: Claude, Cloudflare, Codex, Exa, Firecrawl,
|
|
16
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`
|
|
@@ -78,17 +81,18 @@ results should arrive as soon as they are ready.
|
|
|
78
81
|
<details>
|
|
79
82
|
<summary><strong>Parameters and behavior</strong></summary>
|
|
80
83
|
|
|
81
|
-
| Parameter | Type | Default | Description
|
|
82
|
-
| ------------ | -------- | -------- |
|
|
83
|
-
| `queries` | string[] | required | One or more search queries to run (max 10)
|
|
84
|
-
| `maxResults` | integer | `5` | Result count per query, clamped to `1–20`
|
|
85
|
-
| `options` | object | — |
|
|
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 |
|
|
86
89
|
|
|
87
|
-
`web_search.options.prefetch` is local-only and not forwarded
|
|
88
|
-
SDK. It accepts `provider`, `maxUrls`, `ttlMs`, and
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
`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`.
|
|
92
96
|
|
|
93
97
|
</details>
|
|
94
98
|
|
|
@@ -102,10 +106,10 @@ each page can be acted on independently.
|
|
|
102
106
|
<details>
|
|
103
107
|
<summary><strong>Parameters and behavior</strong></summary>
|
|
104
108
|
|
|
105
|
-
| Parameter | Type | Default | Description
|
|
106
|
-
| --------- | -------- | -------- |
|
|
107
|
-
| `urls` | string[] | required | One or more URLs to extract
|
|
108
|
-
| `options` | object | — |
|
|
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 |
|
|
109
113
|
|
|
110
114
|
`web_contents` reuses any matching cached pages already present in the local
|
|
111
115
|
in-memory cache—whether they came from prefetch or an earlier read—and only
|
|
@@ -123,10 +127,10 @@ calls when earlier independent answers can unblock the next step.
|
|
|
123
127
|
<details>
|
|
124
128
|
<summary><strong>Parameters and behavior</strong></summary>
|
|
125
129
|
|
|
126
|
-
| Parameter | Type | Default | Description
|
|
127
|
-
| --------- | -------- | -------- |
|
|
128
|
-
| `queries` | string[] | required | One or more questions to answer in one call (max 10)
|
|
129
|
-
| `options` | object | — |
|
|
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 |
|
|
130
134
|
|
|
131
135
|
Responses are grouped into per-question sections when more than one question is
|
|
132
136
|
provided.
|
|
@@ -143,15 +147,15 @@ saved report path.
|
|
|
143
147
|
<details>
|
|
144
148
|
<summary><strong>Parameters and behavior</strong></summary>
|
|
145
149
|
|
|
146
|
-
| Parameter | Type | Default | Description
|
|
147
|
-
| --------- | ------ | -------- |
|
|
148
|
-
| `input` | string | required | Research brief or question
|
|
149
|
-
| `options` | object | — | Provider-specific
|
|
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 |
|
|
150
154
|
|
|
151
|
-
`options`
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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.
|
|
155
159
|
|
|
156
160
|
Unlike the other managed tools, `web_research` does not accept local timeout,
|
|
157
161
|
retry, polling, or resume controls. Research has one opinionated execution
|
|
@@ -170,8 +174,8 @@ The built-in providers below are thin adapters around official SDKs.
|
|
|
170
174
|
- SDK: `@anthropic-ai/claude-agent-sdk`
|
|
171
175
|
- Uses Claude Code's built-in `WebSearch` and `WebFetch` tools behind a
|
|
172
176
|
structured JSON adapter
|
|
173
|
-
-
|
|
174
|
-
`
|
|
177
|
+
- Exposes `model`, `thinking`, `effort`, `maxThinkingTokens`, `maxTurns`, and
|
|
178
|
+
`maxBudgetUsd` as provider options for search and answer calls
|
|
175
179
|
- Great for search plus grounded answers if you already use Claude Code locally
|
|
176
180
|
|
|
177
181
|
</details>
|
|
@@ -184,8 +188,7 @@ The built-in providers below are thin adapters around official SDKs.
|
|
|
184
188
|
endpoint
|
|
185
189
|
- Good for JavaScript-heavy pages that need a real browser render before
|
|
186
190
|
extraction
|
|
187
|
-
-
|
|
188
|
-
`waitForSelector`, `waitForTimeout`, `cacheTTL`, and request filtering
|
|
191
|
+
- Exposes `gotoOptions.waitUntil` as the provider-specific contents option
|
|
189
192
|
|
|
190
193
|
**Setup**
|
|
191
194
|
|
|
@@ -220,8 +223,8 @@ scope, or account ID is usually wrong.
|
|
|
220
223
|
|
|
221
224
|
- SDK: `@openai/codex-sdk`
|
|
222
225
|
- Runs in read-only mode with web search enabled
|
|
223
|
-
-
|
|
224
|
-
|
|
226
|
+
- Exposes `model`, `modelReasoningEffort`, and `webSearchMode` as provider
|
|
227
|
+
options for `web_search`
|
|
225
228
|
- Best if you already use the local Codex CLI and auth flow
|
|
226
229
|
|
|
227
230
|
</details>
|
|
@@ -234,6 +237,11 @@ scope, or account ID is usually wrong.
|
|
|
234
237
|
- `web_research` is exposed through pi's async research workflow
|
|
235
238
|
- Neural, keyword, hybrid, and deep-research search modes
|
|
236
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
|
|
237
245
|
|
|
238
246
|
</details>
|
|
239
247
|
|
|
@@ -244,11 +252,10 @@ scope, or account ID is usually wrong.
|
|
|
244
252
|
- Supports `web_search` and `web_contents`
|
|
245
253
|
- Search can optionally include Firecrawl scrape-backed result enrichment
|
|
246
254
|
- Contents extraction uses Firecrawl scrape with markdown-first defaults
|
|
247
|
-
-
|
|
255
|
+
- Exposes search options such as `lang`, `country`, `sources`, `categories`,
|
|
248
256
|
`location`, `timeout`, and `scrapeOptions`
|
|
249
|
-
-
|
|
250
|
-
`
|
|
251
|
-
cache controls
|
|
257
|
+
- Exposes contents options such as `formats`, `onlyMainContent`, `includeTags`,
|
|
258
|
+
`excludeTags`, `waitFor`, `headers`, `location`, `mobile`, and `proxy`
|
|
252
259
|
|
|
253
260
|
</details>
|
|
254
261
|
|
|
@@ -260,8 +267,9 @@ scope, or account ID is usually wrong.
|
|
|
260
267
|
- `web_research` is exposed through pi's async research workflow
|
|
261
268
|
- Google Search grounding for answers
|
|
262
269
|
- Deep-research agents via Google's Gemini API
|
|
263
|
-
-
|
|
264
|
-
|
|
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
|
|
265
273
|
|
|
266
274
|
</details>
|
|
267
275
|
|
|
@@ -271,10 +279,9 @@ scope, or account ID is usually wrong.
|
|
|
271
279
|
- SDK: `linkup-sdk`
|
|
272
280
|
- Supports `web_search` via Linkup Search with fixed `searchResults` output
|
|
273
281
|
- Supports `web_contents` via Linkup Fetch and always returns markdown
|
|
274
|
-
-
|
|
275
|
-
|
|
276
|
-
-
|
|
277
|
-
`includeRawHtml`, and `extractImages`
|
|
282
|
+
- Exposes search options `depth`, `includeImages`, `includeDomains`,
|
|
283
|
+
`excludeDomains`, `fromDate`, and `toDate`
|
|
284
|
+
- Exposes contents options `renderJs`, `includeRawHtml`, and `extractImages`
|
|
278
285
|
- Good fit for a simple search-plus-markdown setup without extra provider wiring
|
|
279
286
|
|
|
280
287
|
</details>
|
|
@@ -287,8 +294,9 @@ scope, or account ID is usually wrong.
|
|
|
287
294
|
- `web_research` is exposed through pi's async research workflow
|
|
288
295
|
- Uses Perplexity Search for `web_search`
|
|
289
296
|
- Uses Sonar for `web_answer` and `sonar-deep-research` for `web_research`
|
|
290
|
-
-
|
|
291
|
-
`
|
|
297
|
+
- Exposes search options `country`, `search_mode`,
|
|
298
|
+
`search_domain_filter`, and `search_recency_filter`
|
|
299
|
+
- Exposes `model` for answer and research calls
|
|
292
300
|
|
|
293
301
|
</details>
|
|
294
302
|
|
|
@@ -298,7 +306,8 @@ scope, or account ID is usually wrong.
|
|
|
298
306
|
- SDK: `parallel-web`
|
|
299
307
|
- Agentic and one-shot search modes
|
|
300
308
|
- Page content extraction with excerpt and full-content toggles
|
|
301
|
-
-
|
|
309
|
+
- Exposes search option `mode`
|
|
310
|
+
- Exposes contents options `excerpts` and `full_content`
|
|
302
311
|
|
|
303
312
|
</details>
|
|
304
313
|
|
|
@@ -309,12 +318,11 @@ scope, or account ID is usually wrong.
|
|
|
309
318
|
- Supports `web_search` via Tavily Search
|
|
310
319
|
- Supports `web_contents` via Tavily Extract
|
|
311
320
|
- Good for pairing LLM-oriented web search with lightweight page extraction
|
|
312
|
-
-
|
|
313
|
-
`
|
|
314
|
-
`
|
|
315
|
-
-
|
|
316
|
-
`
|
|
317
|
-
`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`
|
|
318
326
|
|
|
319
327
|
</details>
|
|
320
328
|
|
|
@@ -325,9 +333,12 @@ scope, or account ID is usually wrong.
|
|
|
325
333
|
- Supports `web_search`, `web_contents`, `web_answer`, and `web_research`
|
|
326
334
|
- `web_research` is exposed through pi's async research workflow
|
|
327
335
|
- Web, proprietary, and news search types
|
|
328
|
-
-
|
|
329
|
-
|
|
330
|
-
-
|
|
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
|
|
331
342
|
|
|
332
343
|
</details>
|
|
333
344
|
|
|
@@ -337,6 +348,10 @@ The `custom` provider lets you bring your own wrapper command for any
|
|
|
337
348
|
managed tool. Each capability can point at a different local command under
|
|
338
349
|
`providers["custom"].options`.
|
|
339
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
|
+
|
|
340
355
|
The repo includes actual wrapper examples under
|
|
341
356
|
[`examples/custom/wrappers/`](examples/custom/wrappers/). They are
|
|
342
357
|
small bash scripts that use `jq` for JSON handling. Each one uses a different
|