pi-web-access 0.4.2 → 0.4.4
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 +10 -0
- package/README.md +1 -4
- package/index.ts +5 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.4.4] - 2026-02-01
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- Adapt execute signatures to pi v0.51.0: reorder signal, onUpdate, ctx parameters across all three tools
|
|
11
|
+
|
|
12
|
+
## [0.4.3] - 2026-01-27
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- Google API compatibility: Use `StringEnum` for `recencyFilter` to avoid unsupported `anyOf`/`const` JSON Schema patterns
|
|
16
|
+
|
|
7
17
|
## [0.4.2] - 2026-01-27
|
|
8
18
|
|
|
9
19
|
### Fixed
|
package/README.md
CHANGED
|
@@ -14,10 +14,7 @@ fetch_content({ url: "https://docs.example.com/guide" })
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
|
|
18
|
-
git clone https://github.com/nicobailon/pi-web-access ~/.pi/agent/extensions/pi-web-access
|
|
19
|
-
cd ~/.pi/agent/extensions/pi-web-access
|
|
20
|
-
npm install
|
|
17
|
+
pi install npm:pi-web-access
|
|
21
18
|
```
|
|
22
19
|
|
|
23
20
|
Add your Perplexity API key:
|
package/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
2
2
|
import { Key, Text, truncateToWidth } from "@mariozechner/pi-tui";
|
|
3
3
|
import { Type } from "@sinclair/typebox";
|
|
4
|
+
import { StringEnum } from "@mariozechner/pi-ai";
|
|
4
5
|
import { fetchAllContent, type ExtractedContent } from "./extract.js";
|
|
5
6
|
import { searchWithPerplexity, type SearchResult } from "./perplexity.js";
|
|
6
7
|
import {
|
|
@@ -166,14 +167,12 @@ export default function (pi: ExtensionAPI) {
|
|
|
166
167
|
numResults: Type.Optional(Type.Number({ description: "Results per query (default: 5, max: 20)" })),
|
|
167
168
|
includeContent: Type.Optional(Type.Boolean({ description: "Fetch full page content (async)" })),
|
|
168
169
|
recencyFilter: Type.Optional(
|
|
169
|
-
|
|
170
|
-
description: "Filter by recency",
|
|
171
|
-
}),
|
|
170
|
+
StringEnum(["day", "week", "month", "year"], { description: "Filter by recency" }),
|
|
172
171
|
),
|
|
173
172
|
domainFilter: Type.Optional(Type.Array(Type.String(), { description: "Limit to domains (prefix with - to exclude)" })),
|
|
174
173
|
}),
|
|
175
174
|
|
|
176
|
-
async execute(_toolCallId, params, onUpdate, _ctx
|
|
175
|
+
async execute(_toolCallId, params, signal, onUpdate, _ctx) {
|
|
177
176
|
const queryList = params.queries ?? (params.query ? [params.query] : []);
|
|
178
177
|
if (queryList.length === 0) {
|
|
179
178
|
return {
|
|
@@ -396,7 +395,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
396
395
|
urls: Type.Optional(Type.Array(Type.String(), { description: "Multiple URLs (parallel)" })),
|
|
397
396
|
}),
|
|
398
397
|
|
|
399
|
-
async execute(_toolCallId, params, onUpdate, _ctx
|
|
398
|
+
async execute(_toolCallId, params, signal, onUpdate, _ctx) {
|
|
400
399
|
const urlList = params.urls ?? (params.url ? [params.url] : []);
|
|
401
400
|
if (urlList.length === 0) {
|
|
402
401
|
return {
|
|
@@ -549,7 +548,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
549
548
|
urlIndex: Type.Optional(Type.Number({ description: "Get content for URL at index" })),
|
|
550
549
|
}),
|
|
551
550
|
|
|
552
|
-
async execute(_toolCallId, params, _onUpdate, _ctx
|
|
551
|
+
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
|
|
553
552
|
const data = getResult(params.responseId);
|
|
554
553
|
if (!data) {
|
|
555
554
|
return {
|