Install
Install with PiG
pig install npm:@ssk_dev/pi-web-access-leanInstall with Pi
pi install npm:@ssk_dev/pi-web-access-leanPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.48.0 (README.md). PiG does not review it.
pi-web-access-lean
Search, check and fetch the web from Pi, through one small tool.
简体中文 · Full setup: My Lean Pi Setup
A lean version of pi-web-access. It runs the upstream 0.48.0 engine as-is and folds its four tools into one web_access tool with a short schema.
Install
pi install npm:@ssk_dev/pi-web-access-lean
Requires Pi >=0.84.1 and Node.js >=22.19.0. Don't install it alongside upstream or another pi-web-access wrapper, or the tools get registered twice.
Compared with upstream
Kept: web search, result pagination, source checking and page fetching, all from upstream's engine.
Trimmed:
web_search,source_check,fetch_contentandget_search_contentbecome oneweb_accesstool.- Everyday calls take a plain string
input; full schemas and advanced parameters stay out of the prompt until the model asks withhelp.
Added:
- Local PDFs:
op: "fetch"reads local PDF files (R:/doc.pdf, Windows paths,file:///...and relative paths), which upstream's SSRF guard blocks. The extracted Markdown is saved locally with page and character counts. - Forgiving arguments: a missing
opis inferred from unambiguous fields (responseId,url/urls,claim,query/queries, or a bare URL/PDF path versus plain text). An objectinputis serialized, and upstream fields placed at the top level are merged intoinput; a field that disagrees withinputis rejected, never silently dropped.
Usage
The model sees one tool, web_access:
op | Purpose | input |
|---|---|---|
search | Search the web | Query |
check | Check a claim or source | Claim |
fetch | Fetch a URL or local PDF | URL or PDF path |
get | Continue a stored result | Response ID |
help | Show full parameters | Operation name |
{ "op": "search", "input": "Pi coding agent extensions" }
For batches or advanced parameters, pass a JSON object encoded as the input string.
Token comparison
With only this extension enabled, what the model reads on every turn:
| Variant | Breakdown | Total |
|---|---|---|
Lean @ssk_dev/pi-web-access-lean@0.48.0 | web_access (153) | 153 |
Upstream pi-web-access@0.48.0 | web_search (338) + source_check (225) + fetch_content (372) + get_search_content (230) | 1,165 |
Method: Pi 1.4.0, each variant measured in its own temporary process with an empty working directory and configuration. Built-in tools, skills, context files, session history, user messages, other extensions, runtime UI and slash commands are not counted; before_agent_start additions are. Tokens are estimated as ceil(characters / 4), not billed tokens.
Development
npm ci
npm run check
License
MIT. The runtime comes from pi-web-access (MIT).