oira666_pi-web-search 0.0.1 → 0.0.2

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 CHANGED
@@ -1,48 +1,54 @@
1
- # oira666_pi-web-search
2
-
3
- Provider-native web search for [pi](https://github.com/earendil-works/pi-coding-agent), across the currently selected Google Gemini, OpenAI, or Anthropic model, plus Gemini-only URL Context analysis.
4
-
5
- ## Tools
6
-
7
- ### `web_search`
8
-
9
- Search the web using your currently selected model. Automatically picks the right provider API:
10
-
11
- | Provider | API |
12
- |---|---|
13
- | Google Gemini | Grounding with Google Search |
14
- | OpenAI | Responses API web search, including pi's `openai-codex` OAuth Responses backend |
15
- | Anthropic | Messages API web search, including Claude Code OAuth subscription tokens |
16
-
17
- Supports passing up to 20 additional URLs to analyze alongside the query.
18
-
19
- ### `url_context`
20
-
21
- Gemini-only. Analyze up to 20 public URLs — web pages, documents, images, and YouTube videos. Uses Gemini's native URL Context retrieval with verified metadata.
22
-
23
- When using `google-generative-ai`, YouTube URLs are passed as `file_data` for native video understanding.
24
-
25
- ## Install
26
-
27
- ```bash
28
- pi install npm:oira666_pi-web-search
29
- ```
30
-
31
- ## Usage
32
-
33
- No extra config needed. Select a supported provider/model in pi and the tools use the currently selected session model.
34
-
35
- The extension does not switch models or fall back to another configured model. If the currently selected model does not support provider-native web search, `web_search` is automatically removed from active tools. `url_context` is automatically removed from active tools when using a non-Gemini model.
36
-
37
- ## Test
38
-
39
- ```bash
40
- cp .env.example .env # edit with your models
41
- npm test # unit tests
42
- npm run test:real:web-search
43
- npm run test:real:url-context
44
- ```
45
-
46
- ## License
47
-
48
- MIT
1
+ # oira666_pi-web-search
2
+
3
+ Provider-native web search for [pi](https://github.com/earendil-works/pi-coding-agent), across the currently selected Google Gemini, OpenAI, or Anthropic model, plus Gemini-only URL Context analysis.
4
+
5
+ ## Tools
6
+
7
+ ### `web_search`
8
+
9
+ Search the web using your currently selected model. Automatically picks the right provider API:
10
+
11
+ | Provider | API |
12
+ |---|---|
13
+ | Google Gemini | Grounding with Google Search |
14
+ | OpenAI | Responses API web search, including pi's `openai-codex` OAuth Responses backend |
15
+ | Anthropic | Messages API web search, including Claude Code OAuth subscription tokens |
16
+
17
+ Supports passing up to 20 additional URLs to analyze alongside the query.
18
+
19
+ ### `url_context`
20
+
21
+ Gemini-only. Analyze up to 20 public URLs — web pages, documents, images, and YouTube videos. Uses Gemini's native URL Context retrieval with verified metadata.
22
+
23
+ When using `google-generative-ai`, YouTube URLs are passed as `file_data` for native video understanding.
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ pi install npm:oira666_pi-web-search
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ No extra config needed. Select a supported provider/model in pi and the tools use the currently selected session model.
34
+
35
+ The extension does not switch models or fall back to another configured model. If the currently selected model does not support provider-native web search, `web_search` is automatically removed from active tools. `url_context` is automatically removed from active tools when using a non-Gemini model.
36
+
37
+ ## Test
38
+
39
+ ```bash
40
+ cp .env.example .env # edit with your models
41
+ npm test # deterministic intent/parser tests
42
+ npm run check # SDK type validation
43
+ npm run test:e2e # installed global Pi: transport/lifecycle + live native search
44
+ npm run test:real:web-search
45
+ npm run test:real:url-context
46
+ ```
47
+
48
+ `test:e2e` requires `PI_EVERGREEN_PI_BIN` pointing to the installed global Pi executable. It never installs a runtime or silently skips live coverage. Model selection honors `PI_EVERGREEN_E2E_PROVIDER` (default `openai`), `PI_EVERGREEN_E2E_MODEL` (default `gpt-6-luna`), and `PI_EVERGREEN_E2E_REASONING` (default `medium`). The live check uses normal Pi provider authentication; tests do not read credential files. It makes a small native-search request, which may incur provider search charges.
49
+
50
+ The deterministic CLI checks use isolated configuration and harmless credentials against a local HTTP/SSE server, explicitly loading `src/index.ts`. They compare actual transport requests with public request-hook observations, inspect persisted tool details, and cover retries, compaction, model changes, resume, new sessions, explicit tool disabling, and fresh Anthropic OAuth prompt identity across turns. Anthropic/Google/Codex service behavior beyond these fixtures still needs provider-specific live checks (`test:real:*`).
51
+
52
+ ## License
53
+
54
+ MIT
package/package.json CHANGED
@@ -1,56 +1,58 @@
1
- {
2
- "name": "oira666_pi-web-search",
3
- "version": "0.0.1",
4
- "description": "Provider-native web search for pi across Google Gemini, OpenAI, and Anthropic, plus Gemini URL Context",
5
- "type": "module",
6
- "main": "src/index.ts",
7
- "keywords": [
8
- "pi",
9
- "pi-extension",
10
- "pi-package",
11
- "web-search",
12
- "gemini",
13
- "google",
14
- "openai",
15
- "anthropic",
16
- "url-context",
17
- "url-analysis",
18
- "youtube"
19
- ],
20
- "author": "oira666",
21
- "license": "MIT",
22
- "repository": {
23
- "type": "git",
24
- "url": "git+https://github.com/gee666/pi-web-search.git"
25
- },
26
- "bugs": {
27
- "url": "https://github.com/gee666/pi-web-search/issues"
28
- },
29
- "homepage": "https://github.com/gee666/pi-web-search#readme",
30
- "files": [
31
- "src",
32
- "README.md"
33
- ],
34
- "scripts": {
35
- "test": "node --test tests/*.test.mjs",
36
- "test:real:web-search": "node tests/real-web-search.mjs",
37
- "test:real:url-context": "node tests/real-url-context.mjs"
38
- },
39
- "devDependencies": {
40
- "@earendil-works/pi-ai": "^0.75.4",
41
- "@earendil-works/pi-coding-agent": "^0.75.4",
42
- "@types/node": "^25.9.1",
43
- "typebox": "^1.1.38",
44
- "typescript": "^6.0.3"
45
- },
46
- "pi": {
47
- "extensions": [
48
- "./src/index.ts"
49
- ]
50
- },
51
- "peerDependencies": {
52
- "@earendil-works/pi-ai": "*",
53
- "@earendil-works/pi-coding-agent": "*",
54
- "typebox": "*"
55
- }
56
- }
1
+ {
2
+ "name": "oira666_pi-web-search",
3
+ "version": "0.0.2",
4
+ "description": "Provider-native web search for pi across Google Gemini, OpenAI, and Anthropic, plus Gemini URL Context",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "keywords": [
8
+ "pi",
9
+ "pi-extension",
10
+ "pi-package",
11
+ "web-search",
12
+ "gemini",
13
+ "google",
14
+ "openai",
15
+ "anthropic",
16
+ "url-context",
17
+ "url-analysis",
18
+ "youtube"
19
+ ],
20
+ "author": "oira666",
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/gee666/pi-web-search.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/gee666/pi-web-search/issues"
28
+ },
29
+ "homepage": "https://github.com/gee666/pi-web-search#readme",
30
+ "files": [
31
+ "src",
32
+ "README.md"
33
+ ],
34
+ "scripts": {
35
+ "test": "node --test tests/*.test.mjs",
36
+ "check": "tsc --noEmit",
37
+ "test:e2e": "node --test tests/*.e2e.mjs",
38
+ "test:real:web-search": "node tests/real-web-search.mjs",
39
+ "test:real:url-context": "node tests/real-url-context.mjs"
40
+ },
41
+ "devDependencies": {
42
+ "@earendil-works/pi-ai": "^0.75.4",
43
+ "@earendil-works/pi-coding-agent": "^0.75.4",
44
+ "@types/node": "^25.9.1",
45
+ "typebox": "^1.1.38",
46
+ "typescript": "^6.0.3"
47
+ },
48
+ "pi": {
49
+ "extensions": [
50
+ "./src/index.ts"
51
+ ]
52
+ },
53
+ "peerDependencies": {
54
+ "@earendil-works/pi-ai": "*",
55
+ "@earendil-works/pi-coding-agent": "*",
56
+ "typebox": "*"
57
+ }
58
+ }