No description
| extensions | ||
| tests | ||
| .gitignore | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
pi-agent-web-session
Pi package that starts a small local web UI for Pi.
On startup it opens a random localhost port and shows the URL in Pi:
Pi Web Session iniciado: http://127.0.0.1:52341/?token=...
Runtime communication uses a WebSocket after the initial HTML/vendor asset load.
Features
- Random free port on startup using
listen(0). - Local-only server bound to
127.0.0.1. - Per-session token in the URL.
- Persistent local web server across Pi session switches.
- Session sidebar for switching, renaming, and deleting past sessions in the same directory.
- Real-time timeline in the browser over WebSocket.
- Renders messages as Markdown using
markedand sanitizes HTML withDOMPurify. - Shows assistant streaming updates.
- Hides thinking and tool-use details by default behind expandable blocks.
- Shows tool execution start/update/end events collapsed by default.
- Send prompts from the browser.
- Send with
Ctrl+Enter/Cmd+Enter. - Queue messages as
steerorfollowUpwhile Pi is busy. - Abort current work from the browser.
/webcommand to show/control the server.
Install / test locally
From this folder:
npm install
npm run typecheck
npm test
pi -e ./extensions/web.ts
Or install as a Pi package:
pi install ./
Commands
/web Show the current URL
/web url Show the current URL
/web status Show the current URL
/web start Start the server if stopped
/web restart Restart with a new random port/token
/web stop Stop the server
Flag
Enabled by default. Disable for one run with:
pi --no-web-session
Security
The server is intentionally bound to 127.0.0.1 and requires a random token. Do not expose it publicly unless you add stronger authentication.