@ssk_dev/pi-web-access-lean

Lean Pi web access extension with full features: 153 initial tokens (94.6% fewer than current upstream).

Packages

Package details

extension

Install @ssk_dev/pi-web-access-lean from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@ssk_dev/pi-web-access-lean
Package
@ssk_dev/pi-web-access-lean
Version
0.42.2
Published
Oct 20, 2026
Downloads
1,182/mo · 295/wk
Author
ssk_dev
License
MIT
Types
extension
Size
21.7 KB
Dependencies
1 dependency · 4 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@ssk_dev/pi-web-access-lean

Token benchmark: Lean 153, upstream pi-web-access@0.42.0 2,853 — 94.6% fewer.

See my full setup for Pi

简体中文

A lightweight Pi wrapper for pi-web-access. It preserves the full upstream web search and browsing engine while compressing four separate tools into a single, compact tool schema.

Context Footprint Benchmark

With only this extension enabled, its recurring model-facing initialization contribution is:

Variant Tool and prompt contribution Total
Lean @ssk_dev/pi-web-access-lean@0.42.2 web_access (153) 153
Upstream pi-web-access@0.42.0 web_search (962) + source_check (648) + fetch_content (801) + get_search_content (442) 2,853

This saves 2,700 tokens (94.6%). Measured with Pi 1.3.0 in separate temporary processes with empty working directories and configuration. Built-in tools, skills, context files, session history, user messages, unrelated extensions, runtime UI, and slash commands are excluded; before_agent_start additions are included. Tokens are a fixed character-proxy estimate using ceil(characters / 4), not provider tokenizer billing.

Core Features

  • Full upstream capabilities: Web search, result pagination, source verification, and page fetching all work as intended.
  • Unified tool interface: Consolidates web_search, source_check, fetch_content, and get_search_content under one web_access tool.
  • Direct local PDF extraction: Supports fetching local PDF documents directly (op: "fetch" with paths such as R:/doc.pdf, Windows paths, and file:///...), which is blocked in upstream by SSRF guards. Extracted Markdown is saved locally with page and character counts.
  • Minimal prompt overhead: Everyday operations use concise string inputs. Detailed schemas and advanced parameters stay out of the prompt until queried via help.

Installation

pi install npm:@ssk_dev/pi-web-access-lean

Do not load this alongside another pi-web-access wrapper to avoid duplicate tool registrations.

Usage

The model interacts with a single tool:

web_access
op Purpose input
search Search the web Query string
check Check a claim or source Claim string
fetch Fetch a URL or local PDF URL or local PDF path
get Continue a stored result Response ID
help Show full parameters Operation name

Simple example:

{ "op": "search", "input": "Pi coding agent extensions" }

For batch or advanced parameters, pass a JSON object encoded as the input string. Use help only when you need the complete upstream schema.

Mistakes are tolerated: an omitted op is inferred from unambiguous fields (responseId, url/urls, claim, query/queries, or a bare URL/PDF path vs. plain text), an object input is stringified, and upstream fields placed at the top level are merged into input (a field that disagrees with input is rejected with an error, never silently dropped).

Versions

Upstream runtime is pinned to pi-web-access@0.42.0.

Development

npm ci
npm run check

License

MIT. This project wraps the MIT-licensed pi-web-access.