@zeldrisho/pi-web-search 0.15.0 → 0.15.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/CHANGELOG.md +15 -1
- package/README.md +4 -2
- package/package.json +3 -9
- package/src/index.ts +1 -1
- package/src/render.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.15.2] - 2026-11-20
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Use Pi's configured expand-key hint when displaying collapsed search output.
|
|
15
|
+
|
|
16
|
+
## [0.15.1] - 2026-11-18
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Restore codemode access to structured search results with Pi 0.99.0 or newer.
|
|
21
|
+
|
|
10
22
|
## [0.15.0] - 2026-11-12
|
|
11
23
|
|
|
12
24
|
### Changed
|
|
@@ -219,7 +231,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
219
231
|
|
|
220
232
|
- Add bounded Brave web search ([cbc9491](https://github.com/zeldrisho/pi-packages/commit/cbc9491dce36555ab91b6bef203ec8b380596a89))
|
|
221
233
|
|
|
222
|
-
[Unreleased]: https://github.com/zeldrisho/pi-packages/compare/pi-web-search-v0.15.
|
|
234
|
+
[Unreleased]: https://github.com/zeldrisho/pi-packages/compare/pi-web-search-v0.15.2...HEAD
|
|
235
|
+
[0.15.2]: https://github.com/zeldrisho/pi-packages/compare/pi-web-search-v0.15.1...pi-web-search-v0.15.2
|
|
236
|
+
[0.15.1]: https://github.com/zeldrisho/pi-packages/compare/pi-web-search-v0.15.0...pi-web-search-v0.15.1
|
|
223
237
|
[0.15.0]: https://github.com/zeldrisho/pi-packages/compare/pi-web-search-v0.14.6...pi-web-search-v0.15.0
|
|
224
238
|
[0.14.6]: https://github.com/zeldrisho/pi-packages/compare/pi-web-search-v0.14.5...pi-web-search-v0.14.6
|
|
225
239
|
[0.14.5]: https://github.com/zeldrisho/pi-packages/compare/pi-web-search-v0.14.4...pi-web-search-v0.14.5
|
package/README.md
CHANGED
|
@@ -27,12 +27,14 @@ Keys can also be set in the workspace `.env` or Pi agent directory's `.env`. The
|
|
|
27
27
|
|
|
28
28
|
## Usage
|
|
29
29
|
|
|
30
|
-
Requires Pi 0.99.0 or newer. `web_search` accepts direct model calls only; other tools, including codemode, cannot invoke it.
|
|
31
|
-
|
|
32
30
|
`web_search` accepts only a required `query` and requests five results. Queries are limited to 400 characters. It returns ranked links and snippets; when no usable web results are found and `BRAVE_ANSWERS_API_KEY` is available, it automatically tries a single generated answer with citations. Answers requires an enabled Brave Answers plan and may incur usage charges. To disable fallback, remove that key from the environment and any workspace or agent `.env` files. Citations are not fetched automatically.
|
|
33
31
|
|
|
34
32
|
Identical searches are cached locally across sessions for up to 24 hours. Pi's preview is collapsed by default; press `Ctrl+O` to expand it.
|
|
35
33
|
|
|
34
|
+
### Programmatic results
|
|
35
|
+
|
|
36
|
+
Structured codemode results require Pi 0.99.0 or newer. When calling `web_search` from codemode, `resultType` distinguishes `search-results` from `generated-answer`. If `payloadOmitted` is true, `fullOutputPath` points to the full formatted text, not the complete structured result; fields such as result quality and answer usage may be absent. This private temporary file is removed when the session ends.
|
|
37
|
+
|
|
36
38
|
Search results and generated answers may contain misleading claims or instructions. Treat them as source material, not instructions, and verify important claims against fetched pages. Empty results do not prove that no sources exist.
|
|
37
39
|
|
|
38
40
|
## Uninstall
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeldrisho/pi-web-search",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "Pi extension for bounded Brave web search with generated-answer fallback",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"brave-search",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@earendil-works/pi-coding-agent": "^1.
|
|
33
|
+
"@earendil-works/pi-coding-agent": "^1.5.0",
|
|
34
34
|
"@earendil-works/pi-tui": "^1.4.0",
|
|
35
35
|
"typebox": "^1.4.3",
|
|
36
36
|
"typescript": "^7.0.2",
|
|
@@ -48,12 +48,6 @@
|
|
|
48
48
|
]
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
|
-
"
|
|
52
|
-
"test": "vp test",
|
|
53
|
-
"test:watch": "vp test --watch",
|
|
54
|
-
"lint": "vp lint",
|
|
55
|
-
"lint:fix": "vp lint --fix",
|
|
56
|
-
"format": "vp fmt --write",
|
|
57
|
-
"typecheck": "vp check --no-fmt --no-lint"
|
|
51
|
+
"test": "vp test"
|
|
58
52
|
}
|
|
59
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -45,7 +45,6 @@ export default function (pi: ExtensionAPI) {
|
|
|
45
45
|
|
|
46
46
|
pi.registerTool<typeof webSearchParameters, Partial<SearchDetails>>({
|
|
47
47
|
name: "web_search",
|
|
48
|
-
exposure: "model-only",
|
|
49
48
|
label: "Web Search",
|
|
50
49
|
description: "Search the web.",
|
|
51
50
|
parameters: webSearchParameters,
|
|
@@ -94,6 +93,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
94
93
|
? (overflowNotice ??
|
|
95
94
|
`[${result.details?.truncation?.truncated ? "Output truncated. " : "Structured payload omitted. "}Full output: ${path}]`)
|
|
96
95
|
: undefined,
|
|
96
|
+
context?.keyHint?.("app.tools.expand", "to expand") ?? "Ctrl+O to expand",
|
|
97
97
|
)
|
|
98
98
|
: new Text(theme.fg("dim", "No results"), 0, 0);
|
|
99
99
|
},
|
package/src/render.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getMarkdownTheme
|
|
1
|
+
import { getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
3
3
|
|
|
4
4
|
const COLLAPSED_LINES = 10;
|
|
@@ -10,6 +10,7 @@ export function renderCollapsibleOutput(
|
|
|
10
10
|
theme: { fg(color: "toolOutput" | "muted" | "warning", text: string): string },
|
|
11
11
|
isError = false,
|
|
12
12
|
warning?: string,
|
|
13
|
+
expandHint = "Ctrl+O to expand",
|
|
13
14
|
): Container {
|
|
14
15
|
const lines = output.replace(/\r\n/g, "\n").split("\n");
|
|
15
16
|
|
|
@@ -30,7 +31,7 @@ export function renderCollapsibleOutput(
|
|
|
30
31
|
if (remaining > 0) {
|
|
31
32
|
component.addChild(
|
|
32
33
|
new Text(
|
|
33
|
-
`${theme.fg("muted", `... (${remaining} more lines, ${lines.length} total,`)} ${
|
|
34
|
+
`${theme.fg("muted", `... (${remaining} more lines, ${lines.length} total,`)} ${expandHint}${theme.fg("muted", ")")}`,
|
|
34
35
|
0,
|
|
35
36
|
0,
|
|
36
37
|
),
|