pi-web-providers 2.5.0 โ†’ 3.1.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 +79 -29
  2. package/dist/index.js +2897 -845
  3. package/package.json +11 -10
package/README.md CHANGED
@@ -14,7 +14,7 @@ not as a replacement for source inspection or deeper research.
14
14
 
15
15
  ## โœจ Features
16
16
 
17
- - **Multiple providers**: Claude, Cloudflare, Codex, Exa, Firecrawl,
17
+ - **Multiple providers**: Brave, Claude, Cloudflare, Codex, Exa, Firecrawl,
18
18
  Gemini, Linkup, Ollama, OpenAI, Perplexity, Parallel, Serper,
19
19
  [Tavily](https://tavily.com), Valyu
20
20
  - **Provider-aware tool options**: pi only exposes the provider settings that
@@ -27,13 +27,13 @@ not as a replacement for source inspection or deeper research.
27
27
  extraction from `web_search` results in the background and reuse the cached
28
28
  pages later for faster follow-up reads
29
29
 
30
- ## ๐Ÿ“ฆ Install
30
+ ## ๐Ÿš€ Installation
31
31
 
32
- ```bash
32
+ ```sh
33
33
  pi install npm:pi-web-providers
34
34
  ```
35
35
 
36
- ## โš™๏ธ Configure
36
+ ## โš™๏ธ Configuration
37
37
 
38
38
  Run:
39
39
 
@@ -46,6 +46,12 @@ settings UI mirrors the three sections below: tools, providers, and settings.
46
46
 
47
47
  Each tool can be routed to any compatible provider:
48
48
 
49
+ Provider credentials can be literal values, environment variable names, or
50
+ `!command` references. pi-web-providers resolves those secrets lazily on the
51
+ first matching tool use, not when a session starts. This avoids startup delays
52
+ from password-manager commands such as `op`; missing or failing secrets are
53
+ reported when the tool is actually called.
54
+
49
55
  **Built-in local providers**
50
56
 
51
57
  | Provider | search | contents | answer | research | Auth |
@@ -57,6 +63,7 @@ Each tool can be routed to any compatible provider:
57
63
 
58
64
  | Provider | search | contents | answer | research | Auth |
59
65
  | -------------- | :----: | :------: | :----: | :------: | ------------------------------------------------ |
66
+ | **Brave** | โœ” | | โœ” | โœ” | `BRAVE_SEARCH_API_KEY` / `BRAVE_ANSWERS_API_KEY` |
60
67
  | **Cloudflare** | | โœ” | | | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` |
61
68
  | **Exa** | โœ” | โœ” | โœ” | โœ” | `EXA_API_KEY` |
62
69
  | **Firecrawl** | โœ” | โœ” | | | `FIRECRAWL_API_KEY` |
@@ -142,6 +149,8 @@ investigations.
142
149
  When you ask more than one question, the response is grouped into per-question
143
150
  sections. Batch related questions when the answers belong together; split them
144
151
  into sibling calls when earlier independent answers can unblock the next step.
152
+ Collapsed results show a short answer preview; expand the tool result to read the
153
+ full answer.
145
154
 
146
155
  <details>
147
156
  <summary><strong>Parameters and behavior</strong></summary>
@@ -187,6 +196,44 @@ report under `.pi/artifacts/research/`.
187
196
 
188
197
  The built-in providers below integrate with official SDKs or documented APIs.
189
198
 
199
+ <details>
200
+ <summary><strong>Brave</strong></summary>
201
+
202
+ - API: Brave Search API and Brave Answers API
203
+ - Supports `web_search` via Web Search, plus optional `llm_context`, `news`, `videos`, `images`, and `places` search modes
204
+ - Supports `web_answer` and `web_research` via Brave Answers streaming chat completions
205
+ - Uses the Answers API replacement for Brave's deprecated Summarizer API; answer and research search controls are sent through `web_search_options`
206
+ - Exposes the Answers `model` option (`brave` or `brave-pro`) for answer and research calls
207
+ - `web_contents` stays routed to URL-fetch providers; Brave LLM Context is query-based retrieval and is exposed as a search mode instead
208
+ - Brave Answers may require a different key or plan than Brave Search
209
+
210
+ **Setup**
211
+
212
+ ```json
213
+ {
214
+ "tools": {
215
+ "search": "brave",
216
+ "answer": "brave",
217
+ "research": "brave"
218
+ },
219
+ "providers": {
220
+ "brave": {
221
+ "credentials": {
222
+ "search": "BRAVE_SEARCH_API_KEY",
223
+ "answers": "BRAVE_ANSWERS_API_KEY"
224
+ }
225
+ }
226
+ }
227
+ }
228
+ ```
229
+
230
+ Use `providers.brave.options.search.mode` or per-call search options to select
231
+ `llm_context`, `news`, `videos`, `images`, or `places`. Places details and
232
+ descriptions are opt-in because they can add calls, latency, and place-specific
233
+ semantics.
234
+
235
+ </details>
236
+
190
237
  <details>
191
238
  <summary><strong>Claude</strong></summary>
192
239
 
@@ -224,7 +271,9 @@ The built-in providers below integrate with official SDKs or documented APIs.
224
271
  },
225
272
  "providers": {
226
273
  "cloudflare": {
227
- "apiToken": "CLOUDFLARE_API_TOKEN",
274
+ "credentials": {
275
+ "api": "CLOUDFLARE_API_TOKEN"
276
+ },
228
277
  "accountId": "CLOUDFLARE_ACCOUNT_ID"
229
278
  }
230
279
  }
@@ -273,6 +322,10 @@ scope, or account ID is usually wrong.
273
322
  `location`, `timeout`, and `scrapeOptions`
274
323
  - Exposes contents options such as `formats`, `onlyMainContent`, `includeTags`,
275
324
  `excludeTags`, `waitFor`, `headers`, `location`, `mobile`, and `proxy`
325
+ - Optional `baseUrl` overrides are supported for self-hosted Firecrawl
326
+ instances, proxies, and testing. API keys are required for Firecrawl Cloud,
327
+ but can be omitted for self-hosted endpoints that do not enforce
328
+ authentication.
276
329
 
277
330
  </details>
278
331
 
@@ -328,7 +381,9 @@ Minimal config:
328
381
  },
329
382
  "providers": {
330
383
  "ollama": {
331
- "apiKey": "OLLAMA_API_KEY"
384
+ "credentials": {
385
+ "api": "OLLAMA_API_KEY"
386
+ }
332
387
  }
333
388
  }
334
389
  }
@@ -368,7 +423,9 @@ Minimal config:
368
423
  },
369
424
  "providers": {
370
425
  "openai": {
371
- "apiKey": "OPENAI_API_KEY",
426
+ "credentials": {
427
+ "api": "OPENAI_API_KEY"
428
+ },
372
429
  "options": {
373
430
  "search": {
374
431
  "model": "gpt-4.1"
@@ -422,9 +479,15 @@ call.
422
479
  <summary><strong>Serper</strong></summary>
423
480
 
424
481
  - API: Serper HTTP API
425
- - Supports `web_search` via Serper's Google search endpoint
426
- - Good fit for fast, straightforward Google-style organic search results
427
- - Exposes search options `gl`, `hl`, `location`, `page`, and `autocorrect`
482
+ - Supports `web_search` via Serper's Google endpoints for web, image, video,
483
+ places, maps, reviews, news, shopping, product reviews, Lens, Scholar,
484
+ patents, autocomplete, and webpage results
485
+ - Good fit for fast, straightforward Google-style search results
486
+ - Exposes search options `mode`, `gl`, `hl`, `location`, `page`, `tbs`,
487
+ `autocorrect`, and mode-specific fields such as `url`, `ll`, `placeId`,
488
+ `cid`, `fid`, `productId`, `nextPageToken`, and webpage include flags.
489
+ Reviews mode uses the top-level query when no place identifier is provided.
490
+ `includeMarkdown` defaults to `true` for webpage scraping
428
491
  - Preserves rich metadata from Serper responses, including ranking position,
429
492
  sitelinks, attributes, and top-level response context such as
430
493
  `knowledgeGraph`, `answerBox`, `peopleAlsoAsk`, and `relatedSearches`
@@ -439,7 +502,9 @@ Minimal config:
439
502
  },
440
503
  "providers": {
441
504
  "serper": {
442
- "apiKey": "SERPER_API_KEY"
505
+ "credentials": {
506
+ "api": "SERPER_API_KEY"
507
+ }
443
508
  }
444
509
  }
445
510
  }
@@ -575,27 +640,12 @@ providers unless overridden in a provider's own `settings` block:
575
640
  | `retryDelayMs` | `2000` | Initial delay before retrying |
576
641
  | `researchTimeoutMs` | `1800000` | Maximum total time for an async `web_research` job (30 min) |
577
642
 
578
- ## ๐Ÿ”Ž Live smoke tests
579
-
580
- Use the opt-in live smoke runner to validate the configured providers with the
581
- same config-resolution and execution path the extension uses at runtime:
582
-
583
- ```bash
584
- npm run smoke:live
585
- ```
586
-
587
- Optional filters:
643
+ ## ๐Ÿงน Uninstall
588
644
 
589
- ```bash
590
- npm run smoke:live -- --provider gemini
591
- npm run smoke:live -- --tool contents
592
- npm run smoke:live -- --include-research
645
+ ```sh
646
+ pi remove npm:pi-web-providers
593
647
  ```
594
648
 
595
- The default run exercises `search`, `contents`, and `answer`. Research probes
596
- are excluded unless you pass `--include-research`, because they are slower and
597
- may incur higher provider cost.
598
-
599
649
  ## ๐Ÿ“„ License
600
650
 
601
651
  [MIT](LICENSE)