{"_id":"@bcuev/pi-web-research","_rev":"3-5a694217c1f909d625e574c4852527df","name":"@bcuev/pi-web-research","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@bcuev/pi-web-research","version":"1.0.0","keywords":["pi-package","pi-extension"],"author":{"name":"Bryan Cuevas"},"license":"MIT","_id":"@bcuev/pi-web-research@1.0.0","maintainers":[{"name":"bcuev","email":"bcuevas001@gmail.com"}],"homepage":"https://github.com/bcuev/pi-web-research#readme","bugs":{"url":"https://github.com/bcuev/pi-web-research/issues"},"pi":{"prompts":["./prompts"],"extensions":["./extensions"]},"dist":{"shasum":"23686191247273d3727e075065a33ed021968941","tarball":"https://registry.npmjs.org/@bcuev/pi-web-research/-/pi-web-research-1.0.0.tgz","fileCount":14,"integrity":"sha512-GYHud4/AFKubOMbw7Tiv1+2buVTlr0mFiMIdEKn7/lfRc3R8V+1ROlBwzQk18WS28f2YDZzebrba57b+17Vgyw==","signatures":[{"sig":"MEQCIBl+zSS/M6/v2hXT/jJTj4XacxUH4iyz19pOOpuZQKIEAiBjYCPhLyk+kv+XhmKxnCpoToWC6fbnAihRW+niiq8slw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29155},"main":"./extensions/index.ts","type":"module","gitHead":"33b709fb2236b9a15020d2c0607ae0e355746d23","scripts":{"test":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"bcuev","email":"bcuevas001@gmail.com"},"repository":{"url":"git+https://github.com/bcuev/pi-web-research.git","type":"git"},"_npmVersion":"10.9.3","description":"Autonomous web research tools for Pi — web search and focused page extraction","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@sinclair/typebox":"^0.34.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.7","typescript":"^6.0.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-web-research_1.0.0_1779773249941_0.9955358589156145","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bcuev/pi-web-research","version":"1.0.1","keywords":["pi-package","pi-extension"],"author":{"name":"Bryan Cuevas"},"license":"MIT","_id":"@bcuev/pi-web-research@1.0.1","maintainers":[{"name":"bcuev","email":"bcuevas001@gmail.com"}],"homepage":"https://github.com/bcuev/pi-web-research#readme","bugs":{"url":"https://github.com/bcuev/pi-web-research/issues"},"pi":{"prompts":["./prompts"],"extensions":["./extensions"]},"dist":{"shasum":"d9a59b4d54b0505f2cca01d6a60a52197fa69120","tarball":"https://registry.npmjs.org/@bcuev/pi-web-research/-/pi-web-research-1.0.1.tgz","fileCount":9,"integrity":"sha512-TtRGmKodloOhIn/lVXts1BVwDXhj9+ZIE9FXRlL1B2mhLJPK5jxyaIBECoGdeNha3mbEVyc0I2tT2i5mtQm+oQ==","signatures":[{"sig":"MEQCIDDDAyMSLcsh9ABbj9Ai4xKvlaSDogrrzA/DWaXb7PdAAiB4W3pRQ29z28xozOLVYfZ6RD0EyhOvwyNwOk/kV2TWAA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20266},"main":"./extensions/index.ts","type":"module","gitHead":"22f6c413d158b0aa6a6f2197dc7a211d39e88b65","scripts":{"test":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"bcuev","email":"bcuevas001@gmail.com"},"repository":{"url":"git+https://github.com/bcuev/pi-web-research.git","type":"git"},"_npmVersion":"10.9.3","description":"Autonomous web research tools for Pi — web search and focused page extraction","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@sinclair/typebox":"^0.34.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.7","typescript":"^6.0.3"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-web-research_1.0.1_1779773842937_0.7129524070745625","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bcuev/pi-web-research","version":"1.0.2","description":"Web search and page extraction tools for Pi — add web search and focused page extraction to your coding agent sessions","keywords":["pi-package","pi-extension"],"type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/bcuev/pi-web-research.git"},"author":{"name":"Bryan Cuevas"},"main":"./extensions/index.ts","scripts":{"test":"vitest run","typecheck":"tsc --noEmit"},"pi":{"extensions":["./extensions"],"prompts":["./prompts"]},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"devDependencies":{"typescript":"^6.0.3","vitest":"^4.1.7"},"dependencies":{"@sinclair/typebox":"^0.34.0","cheerio":"^1.2.0"},"_id":"@bcuev/pi-web-research@1.0.2","gitHead":"c46d0737be4d8627ecc50249d98077aad0244636","bugs":{"url":"https://github.com/bcuev/pi-web-research/issues"},"homepage":"https://github.com/bcuev/pi-web-research#readme","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-E3TZY2kLkhM2m36mv4AHRlEKzhcmOcrvYxNHv6gJ8wjxNdtjCh4IYMv4NI3YOjOwhv9zglC6n9AeCF5IeFcr3Q==","shasum":"d43f2c6196d7e0060fb80835feb1450adc3e53cd","tarball":"https://registry.npmjs.org/@bcuev/pi-web-research/-/pi-web-research-1.0.2.tgz","fileCount":10,"unpackedSize":23148,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBdml3mIqCRweMHNMwQhWzqRsBMv/f+JFqONL1QFhjXtAiEA7EQETAvh2/ZP6OkVK98rFfdkzo3o6lySUogjfbnUXsQ="}]},"_npmUser":{"name":"bcuev","email":"bcuevas001@gmail.com"},"directories":{},"maintainers":[{"name":"bcuev","email":"bcuevas001@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-web-research_1.0.2_1780031833672_0.792283324568648"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-26T05:27:29.785Z","modified":"2026-05-29T05:17:13.967Z","1.0.0":"2026-05-26T05:27:30.101Z","1.0.1":"2026-05-26T05:37:23.072Z","1.0.2":"2026-05-29T05:17:13.850Z"},"bugs":{"url":"https://github.com/bcuev/pi-web-research/issues"},"author":{"name":"Bryan Cuevas"},"license":"MIT","homepage":"https://github.com/bcuev/pi-web-research#readme","keywords":["pi-package","pi-extension"],"repository":{"type":"git","url":"git+https://github.com/bcuev/pi-web-research.git"},"description":"Web search and page extraction tools for Pi — add web search and focused page extraction to your coding agent sessions","maintainers":[{"name":"bcuev","email":"bcuevas001@gmail.com"}],"readme":"# pi-web-research\n\nWeb search and page extraction tools for [Pi](https://pi.dev).\n\n## Why I built this\n\nI used Claude's web research when I needed context on a topic. Questions like \"best onboarding practices for iOS apps\" or \"how do I set up Swift Testing with async support\" — I'd get sources back, then pull the relevant pieces into a dev plan or notes.\n\nWhen I started using Pi for daily coding, that capability was missing. I didn't want to copy-paste search results into chat. I wanted the agent to handle the research: run parallel searches, evaluate what it finds, scope to authoritative domains when needed, and surface only what matters.\n\nThis extension adds `web_search` and `web_fetch` to Pi, along with a prompt template that guides that workflow.\n\nOther tools I tried had too much overhead — complex configs, nested skills, features I never used. I just needed web research to work.\n\n## Tools\n\n| Tool | Purpose |\n|------|---------|\n| `web_search` | Search the web via [Brave Search API](https://brave.com/search/api) and return ranked results |\n| `web_fetch` | Fetch a URL, strip HTML, and extract content relevant to a specific prompt |\n\n## Examples\n\n**Research a specific technical topic:**\n\n> \"How do I migrate from XCTest to Swift Testing?\"\n\nPi runs parallel searches, fetches the most relevant guide, and returns a summary with key steps and source links.\n\n**Check current best practices:**\n\n> \"What are the recommended error handling patterns for Swift concurrency?\"\n\nUseful when documentation is scattered across blog posts, WWDC videos, and release notes.\n\n**Evaluate a library before adoption:**\n\n> \"Is SwiftData production-ready? What are people saying about it in production apps?\"\n\nPi searches for recent experience reports, fetches a few, and surfaces common issues and workarounds.\n\n## Install\n\nInstall from npm (simplest):\n\n```bash\npi install @bcuev/pi-web-research\n```\n\nOr install directly from GitHub:\n\n```bash\npi install git:github.com/bcuev/pi-web-research\n```\n\nOr clone and install locally:\n\n```bash\ngit clone https://github.com/bcuev/pi-web-research.git\ncd pi-web-research\npi install .\n```\n\n## Setup\n\nSign up for a [Brave Search API key](https://brave.com/search/api), then export it in your shell:\n\n```bash\nexport BRAVE_API_KEY=<your-key>\n```\n\n## Features\n\n- **Search via Brave API** — rate-limit errors include retry-after headers\n- **Caching** — 15-minute TTL on raw and extracted content so you don't re-fetch the same page in a session\n- **Content-type guards** — only extracts from `text/*`, JSON, XML, and XHTML; rejects binary or unknown types\n- **HTTPS → HTTP redirect guard** — blocks cross-origin downgrades before reading the response body\n- **Truncation** — truncates large results to fit context limits using Pi's built-in `truncateHead`\n- **Timeouts** — 30-second network timeouts via `AbortSignal`; respects Pi's cancellation\n\n## Prompt template\n\nThe `research.md` prompt template tells Pi to:\n1. Run 2 parallel broad searches\n2. Evaluate quality before falling back to domain-scoped searches\n3. Summarize findings with citations\n\n## Requirements\n\n- Pi ≥ 0.70.0\n- Node.js ≥ 20\n- `BRAVE_API_KEY` environment variable\n\n## License\n\nMIT\n","readmeFilename":"README.md"}