@bacnh85/pi-web 0.5.5 → 0.5.7
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 +12 -0
- package/README.md +4 -0
- package/extensions/index.ts +38 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.7 (2026-08-05)
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
- Patch version bump for release sync and package documentation update.
|
|
8
|
+
|
|
3
9
|
All notable changes to `pi-web` will be documented in this file.
|
|
4
10
|
|
|
11
|
+
## 0.5.6 (2026-08-01)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **Portable instructions:** pi-web now self-injects its backend-selection routing guidance via a gated `before_agent_start` hook (fires only when a `web_*` tool is active). This guidance previously lived in the global `~/.pi/agent/AGENTS.md`; moving it here makes it travel with the package and carry zero overhead when pi-web is absent. Per-tool `promptGuidelines` are unchanged.
|
|
16
|
+
|
|
5
17
|
## 0.5.5 (2026-07-30)
|
|
6
18
|
|
|
7
19
|
### Improvements
|
package/README.md
CHANGED
|
@@ -37,6 +37,10 @@ Variables:
|
|
|
37
37
|
|
|
38
38
|
Secrets are never printed; `web_status` reports only presence/source.
|
|
39
39
|
|
|
40
|
+
### Always-on routing guidance
|
|
41
|
+
|
|
42
|
+
When any `web_*` tool is active, pi-web injects a condensed backend-selection protocol (SearXNG → Brave → Firecrawl ordering, Firecrawl precision/scrape caveats, source-citation rule) into the system prompt via a `before_agent_start` hook. This travels with the package — no edits to `~/.pi/agent/AGENTS.md` are required — and carries zero overhead when pi-web is not loaded.
|
|
43
|
+
|
|
40
44
|
## Tools
|
|
41
45
|
|
|
42
46
|
### `web_search` — Unified search
|
package/extensions/index.ts
CHANGED
|
@@ -48,6 +48,35 @@ const crawl4aiControlSchema = {
|
|
|
48
48
|
crawl4ai_api_token: Type.Optional(Type.String({ description: "Override $CRAWL4AI_API_TOKEN." })),
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
// ---------------------------------------------------------------------------
|
|
52
|
+
// Always-on routing guidance (injected only when a web_* tool is active)
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
|
|
55
|
+
// Portable home for the pi-web backend-selection protocol. Previously forced
|
|
56
|
+
// always-on via ~/.pi/agent/AGENTS.md; now self-injected by this extension so
|
|
57
|
+
// the guidance travels with the package and disappears when pi-web is absent.
|
|
58
|
+
const WEB_ROUTING_GUIDANCE = `## Web Tool Routing (pi-web)
|
|
59
|
+
|
|
60
|
+
The pi-web extension provides 7 unified tools that auto-select the best backend:
|
|
61
|
+
|
|
62
|
+
- **\`web_search\`** — Search the web (auto: SearXNG → Brave → Firecrawl). Use
|
|
63
|
+
\`backend\` for explicit control, \`engines\` for SearXNG tuning.
|
|
64
|
+
- **\`web_extract\`** — Extract readable content from a URL (auto: static JSDOM
|
|
65
|
+
→ dynamic Firecrawl → full Crawl4AI). Use \`mode\` for explicit control.
|
|
66
|
+
- **\`web_map\`** — Discover URLs from a site (Firecrawl Map).
|
|
67
|
+
- **\`web_crawl\`** — Crawl multiple pages. \`mode: "light"\` (Firecrawl) or
|
|
68
|
+
\`mode: "full"\` (Crawl4AI).
|
|
69
|
+
- **\`web_screenshot\`** / **\`web_pdf\`** — Visual/page capture (Crawl4AI).
|
|
70
|
+
- **\`web_status\`** — Check provider configuration and server health.
|
|
71
|
+
|
|
72
|
+
Backend selection rules:
|
|
73
|
+
|
|
74
|
+
- Firecrawl Search has poor semantic accuracy on domain-specific queries; prefer
|
|
75
|
+
SearXNG or Brave for precision (force via \`backend\`).
|
|
76
|
+
- Firecrawl Scrape fails on bot-protected sites (e.g. Ansible docs); Crawl4AI
|
|
77
|
+
handles those (force via \`mode: "full"\`).
|
|
78
|
+
- Always cite source URLs when web results materially support an answer.`;
|
|
79
|
+
|
|
51
80
|
|
|
52
81
|
// ---------------------------------------------------------------------------
|
|
53
82
|
// Extension entry point
|
|
@@ -414,4 +443,13 @@ export default function piWebExtension(pi: ExtensionAPI) {
|
|
|
414
443
|
},
|
|
415
444
|
});
|
|
416
445
|
|
|
446
|
+
// ── Always-on routing guidance ──────────────────────────────────────────
|
|
447
|
+
// Inject the backend-selection protocol only when a web_* tool is actually
|
|
448
|
+
// active, so recon agents / sessions without pi-web carry zero overhead.
|
|
449
|
+
pi.on("before_agent_start", async (event) => {
|
|
450
|
+
const active = event.systemPromptOptions?.selectedTools ?? [];
|
|
451
|
+
if (!active.some((t) => t.startsWith("web_"))) return;
|
|
452
|
+
return { systemPrompt: `${event.systemPrompt}\n\n${WEB_ROUTING_GUIDANCE}` };
|
|
453
|
+
});
|
|
454
|
+
|
|
417
455
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bacnh85/pi-web",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Pi extension for web search, page extraction, Firecrawl scraping/crawling, and Crawl4AI headless browser crawling.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://github.com/bacnh85/pi-extensions
|
|
10
|
+
"homepage": "https://github.com/bacnh85/pi-extensions/tree/main/pi-web",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "git+https://github.com/bacnh85/pi-extensions.git",
|