pi-pocket 0.28.0-beta.8 → 0.28.0
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/README.md +1 -1
- package/contrib/systemd/pi-pocket@.service +1 -1
- package/docs/architecture.md +10 -4
- package/docs/extensions/commands.md +1 -1
- package/docs/extensions/reference/api-versions.md +4 -0
- package/docs/extensions/reference/limits.md +1 -1
- package/docs/extensions/reference/theme-surface.md +1 -1
- package/docs/extensions/reference/web.md +1 -1
- package/docs/extensions/themes.md +1 -0
- package/docs/extensions/tools.md +1 -1
- package/docs/features.md +12 -12
- package/docs/map.md +53 -46
- package/docs/systemd.md +2 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/server/design/scan-fig.ts +49 -7
- package/src/server/design/system.ts +7 -0
- package/src/server/extension-commands.ts +11 -5
- package/src/server/extensions/prompt.ts +1 -0
- package/src/server/main.ts +15 -0
- package/types/pocket.d.ts +1 -1
- package/web/app.js +34 -4
- package/web/back.js +29 -6
- package/web/browser-panel.js +13 -25
- package/web/browser.js +3 -10
- package/web/chat.js +41 -30
- package/web/composer.js +308 -118
- package/web/extension-ui.js +15 -7
- package/web/files-panel.js +16 -41
- package/web/history.js +1 -4
- package/web/launcher.js +2 -1
- package/web/notes-drafts.js +129 -0
- package/web/panel-layout.js +140 -0
- package/web/peeks.js +12 -14
- package/web/person-storage.js +84 -2
- package/web/pip.js +316 -110
- package/web/quote-reply.js +2 -5
- package/web/running-board.js +3 -2
- package/web/session-cache.js +26 -2
- package/web/session-tabs.js +4 -3
- package/web/sessions.js +515 -215
- package/web/sheets/appearance.js +23 -0
- package/web/sheets/memory.js +41 -2
- package/web/store.js +356 -48
- package/web/style.css +135 -34
- package/web/theme.js +5 -0
- package/web/transcript.js +158 -15
- package/web/ui.js +100 -24
- package/web/voice.js +4 -2
- package/web/window-controls.js +7 -4
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ Choose a mode in the launcher, or pass `--access`:
|
|
|
84
84
|
|
|
85
85
|
`tailscale-serve` needs the `tailscale` command on your `PATH`, signed in, with MagicDNS and HTTPS certificates enabled in the tailnet, and, when the launcher does not run as root, that user as tailscaled's operator (`sudo tailscale set --operator=$USER`). It serves port 443 at the machine's tailnet name, and a server restart keeps the address. When the launcher quits it takes down the mount it made; one it found already in place is left where it is. Without the command the launcher says so and stops rather than falling back to this device only when nobody is there to pick another mode. `--host` cannot be combined with it: serve always listens on `127.0.0.1` and lets tailscaled reach it. For another tunnel (ngrok), choose `local` and point it at port 8787.
|
|
86
86
|
|
|
87
|
-
Other options: `--port` (8787), `--cwd`, `--data` (`~/.pi-pocket`), `--host`, and `-y` to reuse the last access choice. `--host` overrides the address a named mode would listen on, and one launcher runs per data folder (a second one says which pid holds it). `npm start -- --help` lists them all. `PI_POCKET_BROWSER` and `PI_POCKET_BROWSER_ARGS` pick the built-in browser and its flags when Chromium or Chrome is not found by itself. `PI_POCKET_PROMPT_DATE=1` puts today's date in Pi's system prompt; it is left out by default, so the prompt cache does not start over when the date changes. `PI_POCKET_SESSION_CACHE=off` keeps browsers from saving the sessions they open on the device (IndexedDB), so that they keep them in each tab's memory only; it is on by default. `PI_POCKET_CACHE_KEEPER=off` turns off the prompt cache keeper, which keeps a model's prompt cache warm while a run waits on a tool call ([features](docs/features.md)).
|
|
87
|
+
Other options: `--port` (8787), `--cwd`, `--data` (`~/.pi-pocket`), `--host`, and `-y` to reuse the last access choice. `--host` overrides the address a named mode would listen on, and one launcher runs per data folder (a second one says which pid holds it). `npm start -- --help` lists them all. `PI_POCKET_BROWSER` and `PI_POCKET_BROWSER_ARGS` pick the built-in browser and its flags when Chromium or Chrome is not found by itself. `PI_POCKET_PROMPT_DATE=1` puts today's date in Pi's system prompt; it is left out by default, so the prompt cache does not start over when the date changes. `PI_POCKET_SESSION_CACHE=off` keeps browsers from saving the sessions they open on the device (IndexedDB), so that they keep them in each tab's memory only; it is on by default. `PI_POCKET_CACHE_KEEPER=off` turns off the prompt cache keeper, which keeps a model's prompt cache warm while a run waits on a tool call ([features](docs/features.md)). `PI_POCKET_KEEPALIVE_SECONDS` (default `5`, from `1` to `3600`) is how long the server keeps an idle connection open for its next request. Behind a reverse proxy of your own (Caddy, nginx, a load balancer), set it above the proxy's idle timeout, or set the proxy's below it: otherwise the proxy can send a request on a connection as the server closes it, and answers with a 502. Caddy keeps idle connections for 2 minutes by default, so `PI_POCKET_KEEPALIVE_SECONDS=125`, or `keepalive 4s` in Caddy's `transport http` block.
|
|
88
88
|
|
|
89
89
|
> [!WARNING]
|
|
90
90
|
> Anyone who can steer a session can make Pi run commands on this machine, as you. That reaches your files, Pi Pocket's own settings and tokens, and its code. Invite only people you would trust at your keyboard. View-only users cannot make Pi act. [SECURITY.md](SECURITY.md) says what is protected and what is not.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[Unit]
|
|
4
4
|
Description=Pi Pocket (%i access)
|
|
5
5
|
Documentation=https://github.com/TannerMidd/pi-pocket/blob/main/docs/systemd.md
|
|
6
|
-
Wants=network-online.target
|
|
6
|
+
Wants=network-online.target
|
|
7
7
|
After=network-online.target tailscaled.service
|
|
8
8
|
|
|
9
9
|
[Service]
|
package/docs/architecture.md
CHANGED
|
@@ -82,7 +82,7 @@ Subagents leave Agent Teams out of every subagent (`extensions/subagents.ts`), e
|
|
|
82
82
|
|
|
83
83
|
PiP (`pip.ts`) is a conversation with a `pip` mark in its session entry, which `sessions()` leaves out of every list. The harness settings select every installed extension but PiP's (`pocket-pip`) by default; PiP's conversation stores its own selection (`PIP_EXTENSIONS`, without bash, write, or edit), which `ensure` sets again each time it opens, so PiP's tools reach no other conversation. Its tools act through `Commands` and `Schedules` as PiP's person, with that person's checks, so `canSee` keeps every PiP from everyone but its person: anyone who could write to it would act as them. Its messages to sessions are once per tool call (a request id hashed from the call's key), and each follow leaves a mark in its list (`FollowsDoc`) when it reports or is stopped, so a replayed call neither sends nor follows twice. A tab's PiP panel is a second client in PiP's room (`setPip`), whose `view` events reach the tab as `pipview`; `watching` counts it, so PiP's answers push nothing while it shows.
|
|
84
84
|
|
|
85
|
-
PiP's header model chip opens the existing picker with its own conversation ID and live view, not the session behind it. Its `pipPanel` configure request uses `Commands.configure`, checks private PiP ownership, and checks `LiveDoc.run` and compactions in the same commit as the model/thinking write. It leaves `lastModel` alone. Ordinary configure requests, including
|
|
85
|
+
PiP's header model chip opens the existing picker with its own conversation ID and live view, not the session behind it. Its `pipPanel` configure request uses `Commands.configure`, checks private PiP ownership, and checks `LiveDoc.run` and compactions in the same commit as the model/thinking write. It leaves `lastModel` alone. Ordinary configure requests, including PiP opened as a board, retain their behavior.
|
|
86
86
|
|
|
87
87
|
## Work from outside the app
|
|
88
88
|
|
|
@@ -196,7 +196,7 @@ A tab of protocol 6 keeps the sessions it leaves (`keptViews` in `web/store.js`:
|
|
|
196
196
|
|
|
197
197
|
The browser also keeps those sessions on the device (`web/session-cache.js`, IndexedDB), for every tab of it: about 100 MB of JSON in all (`DEVICE_CHARS`), the session used longest ago dropped first. A session saved there shows at once after a reload, a tab the system closed in the background, or a restart of a server with the same build, and a tab opens a session its memory no longer holds from there in a moment. A tab that starts reads the ones used last back into its memory while it is idle, as many as its memory keeps, so that going to them after a reload is as quick as before it. A tab saves a session there as it leaves it, and the one it shows a few seconds after it last changed and as the page goes to the background. Each record names its build and whose it is (a fingerprint of the person's id, role, and shared sessions): a tab uses only one of its server's build and of the person signed in with the same rights, and the server checks `have` as for one from memory. What the device kept goes when the tab forgets what it kept (above), on sign-out, and, per session, when the server says it is missing. `PI_POCKET_SESSION_CACHE=off` keeps sessions off devices (`hello.server.deviceCache` false): tabs keep them in memory only, and drop what their browser kept on the device.
|
|
198
198
|
|
|
199
|
-
Browser drafts use `web/person-storage.js`: `pocket.person.<person>:…` keys, readable after `/api/me` or an event-stream hello identifies the person. An account signal invalidates answers already on their way, including at startup. Sign-out stops the device cache and attachments before the server request; after it finishes, it clears this storage, changes `pocket.person`, broadcasts the account change, and goes to `/`. Other tabs stop their cache on the early `pocket.signedOut` signal, but reload only on the completed account change. On Back, a cover checks `/api/me` before reconnecting; the same person keeps the document and drafts. Each check has a 10 s timeout; failures retry with backoff up to 30 s, or at once with Retry.
|
|
199
|
+
Browser drafts, and the panel each session last showed (`pocket.person.<person>:layouts`; the tab's copy in `sessionStorage` names its person too), use `web/person-storage.js`: `pocket.person.<person>:…` keys, readable after `/api/me` or an event-stream hello identifies the person. An account signal invalidates answers already on their way, including at startup. Sign-out stops the device cache and attachments before the server request; after it finishes, it clears this storage, changes `pocket.person`, broadcasts the account change, and goes to `/`. Other tabs stop their cache on the early `pocket.signedOut` signal, but reload only on the completed account change. On Back, a cover checks `/api/me` before reconnecting; the same person keeps the document and drafts. Each check has a 10 s timeout; failures retry with backoff up to 30 s, or at once with Retry.
|
|
200
200
|
|
|
201
201
|
A tab whose server says it can (`hello.server.switches`) goes to another session on the connection it has: `POST /api/switch` with the connection id its `hello` carried, the session (`c`, none for the list), what it kept of it (`have`, as above), and a number (`seq`) that grows with each switch, so the server drops one that arrives after a newer one (`PocketApp.switchTo`). The server takes the tab out of the old session's room, answers `switched` with that number, and sends the new session as a new connection gets it (`#enter`): its view, chat, notes, and browser. A connection opened anew sent its person's profile, the session list, and PiP's state again, and its person left the app and came back in every other tab's list of who is here, and the session showed "connecting" until all of it came. Until `switched` comes, the tab drops events about a session (its view, chat, notes, people, browser, and missing): the server sent those of the session it left before it heard of the switch. A view or `missing` of another session than the one shown is dropped too. A switch the server cannot take (the connection closed, or the server started again) opens a new connection, which names the session, as before; a server without `switches` gets that too.
|
|
202
202
|
|
|
@@ -277,7 +277,7 @@ Plain ES modules, served as they are, with no build. Editing a file under `web/`
|
|
|
277
277
|
|
|
278
278
|
**Loading order matters.** `store.js` is the root, and a few modules do work when they load (listed in [map.md](map.md#web-web-preact-and-htm-no-build)). `theme.js` must load before anything that reads `prefs()` as it loads. `store.set` calls subscribers in the order they subscribed. When moving code between modules, keep both orders. `back.js` sits under `store.js` and imports nothing of the app's, so anything may use it.
|
|
279
279
|
|
|
280
|
-
**Drawing while an answer streams (`app.js`, `ui.js`).** Every `store.set` draws the app again from the top, once per microtask; components read `store.state` as they draw. A streaming answer changes `view` (or PiP's `pipView`) several times a second, and the chat, people, and the connection change too, so what is big and reads little of the store is wrapped in `drawnFor(keys, component)`, which draws it again only when one of `keys` changes: the session list and the rail (`LIST_KEYS`, `RAIL_KEYS` in `sessions.js`). Its keys must name every key it reads as it draws, and every key that the functions it calls read (`prefs()` reads `appearance`, `canSteer()` reads `me`, `isPinned` reads `pinned`); a key left out shows stale data until another change draws it. `store.set({})` still draws it. Inside the list, each row is memoized (`memo`, compared by its props): the list works out what a row shows and passes it, the row reads nothing of the store, and a minute tick (`useMinute
|
|
280
|
+
**Drawing while an answer streams (`app.js`, `ui.js`).** Every `store.set` draws the app again from the top, once per microtask; components read `store.state` as they draw. A streaming answer changes `view` (or PiP's `pipView`) several times a second, and the chat, people, and the connection change too, so what is big and reads little of the store is wrapped in `drawnFor(keys, component)`, which draws it again only when one of `keys` changes: the session list and the rail (`LIST_KEYS`, `RAIL_KEYS` in `sessions.js`). Its keys must name every key it reads as it draws, and every key that the functions it calls read (`prefs()` reads `appearance`, `canSteer()` reads `me`, `isPinned` reads `pinned`); a key left out shows stale data until another change draws it. `store.set({})` still draws it. Inside the list, each row is memoized (`memo`, compared by its props): the list works out what a row shows and passes it, the row reads nothing of the store, and its time ago (`ago`), a minute tick (`useMinute`, only for a row that shows a call's age or a limit's time), and `extensionsRev` draw rows again as their times and extensions' chips change. A press on a row is the row's own state, so it draws that row alone. Hundreds of rows make every restyle and layout costly: a row out of sight is neither (`content-visibility: auto`), a drag of a window's edge sets that window's width only (`dragWidth`), and nothing sets a variable on the page's root, or a class there that `*` matches, at each move or press, as every element would be styled again. They make drawing them costly too: as the list's rows change wholly (it opens, another tab, a search starts or ends), it draws a screenful at once and the rest a few dozen at each frame (`firstRows`, `ROWS_PER_FRAME`), opening (or another tab) scrolled down to where it was; a search's matches past the screenful wait until the typing pauses. The list keeps each row's element from its last draw (`drawnRows`) and gives it again while the row's session and place and what all rows read are as they were, so Preact passes over it. A search keeps the list's own groups as they were, out of sight (`Kept`, `.kept`, `content-visibility: hidden`), and draws its matches beside them, so its end shows them again at once; the browser marks what matched (`::highlight(session-search)`, `searchMarks`), and a key draws again only the rows that come and go. The server sends `hello`, the session list, and the people again on each connect: their handlers keep what is the same (`kept` in `store.js`), and set nothing when nothing changed, so a reconnect draws only what changed. The server's clock in `hello` (`server.now`) is no change: it goes to `serverClockOffset()`. On narrow screens the sidebar and the home screen's splash are not drawn, and on touch screens rows draw no hover buttons (`WIDE`, `NO_HOVER` in `ui.js`, the same queries as `style.css`; a change draws the app again). Markdown still growing (`cache={false}`) is drawn block by block (`liveBlocks`): each top-level block keeps its HTML from the update before unless its text changed, so an update parses, sanitizes, and colors only the last block. The blocks are found again in the whole text each time, so a later line that changes an earlier block shows; a reference link defined in another block shows as written until the text is whole, and an HTML block with a blank line inside it shows split until then.
|
|
281
281
|
|
|
282
282
|
**Themes (`themes.ts`, `theme.js`).** The page has three cascade layers, declared in `index.html`: `pocket` (`style.css`, imported into it, and extensions' stylesheets, which `pocket.style()` imports into it after), `palette` (the colors' variables, a `<style>` that `theme.js` writes), and `theme` (a theme folder's stylesheets). A later layer wins whatever the specificity, and an earlier layer's `!important` wins over a later one's, so a theme overrides the app's rules but not its reduced motion. Inline values beat every layer: only what a person sets (the text size, dragged widths, the desktop's wallpaper) is inline, never a palette. A stylesheet added outside the layers (a `<link>`) would beat the app and the theme alike.
|
|
283
283
|
|
|
@@ -301,7 +301,13 @@ What a browser shows is its person's choice of theme (`look`) and colors (`theme
|
|
|
301
301
|
|
|
302
302
|
**PiP chat (`pip.js`, `pip-attachments.js`).** The panel's uploads, submits, image thumbnails, and Markdown image paths use its own conversation ID, never the session behind it. The browser-only attachment draft outlives panel mounts, scopes itself to account and PiP ID, and holds upload identities and submit tokens so late callbacks cannot restore removed files or clear newer drafts. Unknown authentication or conversation IDs during reconnect are not a scope change. Files survive closing and reopening the panel, not a page reload; text keeps its existing local-storage draft. The normal upload and submit endpoints retain their size, file-access, and image-capability checks; PiP does not choose another model for an attachment. Opening the pending-memory sheet uses the private PiP ID even on Home. Panel cleanup restores focus only if it is still in the outgoing panel or on the body, not when a destination sheet already took it.
|
|
303
303
|
|
|
304
|
-
**
|
|
304
|
+
**A session's send on its way (`composer.js`).** The box keeps no send of its own: `onTheWay` holds each conversation's message, `!` command, or command on its way (`beginSend`, `endSend`), so a box shown again meanwhile holds it read only and cannot send it twice. Its words and files stay in the draft until it went, and meanwhile its words are all the draft holds: what comes for the box waits until it ended: an insert in the store, and a queued message taken back (Edit) in the person's storage (`keepBack`), which a box of its conversation takes once no send is on its way there, also after a reload or a move. One taken back during a send waits until that send ended (`endSend`), or, in another tab or after a reload, until its request id is gone: before, the box's words may go again with that id. Once it went, the draft empties (unless another tab wrote it since), and a file added meanwhile stays. A failure leaves them, and gives the quote back (`giveBackQuote`). Every send of the box that the server runs (a message or template, a `!` command, an extension's command) has one request id for its conversation and exact message (`requestFor`: its kind, words, and files, and its quote when it has one, since a reload loses the quote), kept with the draft in the person's storage until it went. Sent again before, from a box shown again or after a reload (no answer came, or one that does not say: a 5xx, or one that `answered` in `store.js` cannot read), it reuses that id, and the server gives back the first submission, task, or run (`Commands.submit`, `ShellRequestsDoc`, `CommandRequestsDoc`). A 4xx refusal keeps the id: the server stored nothing for it, and a first send that went may be behind it. A 2xx (also an extension's command that ran and failed) ends the id, and so does a change of the words in the box (`edit`): the same words then are a new request, and run again. Sign-out clears it with the draft.
|
|
305
|
+
|
|
306
|
+
**Shared notes drafts (`notes-drafts.js`, `chat.js`).** `personStorage` keeps `{ text, base }` per person and conversation; sign-out clears it and an account change clears the helper's memory. The original revision survives reload, so newer shared saves still require **Use theirs** or **Keep mine**. Blocked or full storage keeps edits in memory with a reload warning. Save, Cancel, and **Use theirs** remove the saved edit or its last stored value after a failed write, never a newer draft from another tab. Failed cleanup shows a warning. A pending save locks its original draft across panel mounts; the textarea stays focused and read-only.
|
|
307
|
+
|
|
308
|
+
**PiP's place (`pip.js`, Appearance → PiP).** Floating, `openPip` sets `pipOpen` (and `OPEN_KEY`, and tells the server, which sends `pipview` only while it is on), as before. With `pip: "board"`, PiP is its own conversation opened as a session is: `openPip` gets PiP's id (asking the server once, with no `pipview`, when the tab does not know it) and calls `navigate`, clearing the drawer, page, and launcher, and the sheet unless the setting's own sheet moved it. `pipBoard()` is true while the route is PiP's conversation (`showsPip`, as its view says, or PiP's id once known) with no board or page over it; `pipShown()` (either place) drives the rail button, the unread mark, and `togglePip`. The session's top bar gets a fixed `core:pip-close` × while `pipBoard()`. The route it was opened over is kept on PiP's history entry (`navigate(id, { over })` → `pushRoute`, read back into `store.state.over` on each route), so it holds through back and forward and a reload; `closePip` goes back there with `navigate(id, { back: true })` (`popRoute`, `back.js`), which steps history back past PiP's entry, so none is left for back to open again, and keeps a sheet still open (Appearance) over that route; or home when the entry has none (the address typed). While a route is `over` a session, `openId()` (not `conversationId`) is the session the list, the folded rail, the tabs, peek tiles, the launcher, and Alt+arrows treat as open, so the one under PiP stays marked, as under Running now. PiP has one message box: on its board the session's place draws PiP's own `Composer` (`PipBoardBox`, with the messages that wait over it and the status line under it) instead of the session composer, on the same `composerDraft` (words, files, the send on its way), so a move changes nothing in it. Text for PiP (`openPip(text)`) goes into it as `pipDraft`, in either place; on the board it also takes what `insertIntoComposer` puts in that place's box (`takeInsert`, which gives each insert to one box). PiP's quote (Ask PiP, or Reply on its board) is one, `pipQuote`, over that box, while the session's own Reply quote (`replyQuote`), the only one the session composer shows, waits under the board as long as `openId()` stays that session. A send takes its quote out of its box as it starts (`dropQuote`, by identity) and gives it back if it fails and nothing took its place (`giveBackQuote`), so no box offers a quote on its way. A board open waits for the tab to know its person and connection, and opens nothing if the person went elsewhere or chose Floating meanwhile. Another board, page, or session simply takes the route. A store subscriber moves PiP when the setting changes, after the change reaches every listener and only if the setting is still the same: to the board it closes the floating panel and navigates; to the corner it navigates away first, then opens the panel; `PipHost` draws nothing while `pipBoard()`, so never both places. A floating `pipOpen` kept across a reload is dropped when the setting says Board. PiP turned off in Extensions closes the board, as it closes the panel; PiP's conversation keeps no panel layout (`followLayout`, `store.js`), so it opens again as PiP, not under a panel left open. The panel no longer has an **Open as a conversation** button: Board is that view. Its **Pending memories** strip (`PendingMemories`, `sheets/memory.js`) shows in both places, only while something waits (or a restart is needed to list them): PiP's box draws it, in both places.
|
|
309
|
+
|
|
310
|
+
**PiP resize (`pip-window.js`).** Resize uses pointer capture on the same edge/corner zones for mouse and touch, at widths of 768px and above, for the floating window only. The preferred size is local to the account/browser; CSS clamps it to the viewport without overwriting it.
|
|
305
311
|
|
|
306
312
|
**Extensions hub (`sheets/gallery.js`).** For owners with the gallery on, Extensions and the gallery share Discover, Installed, and Updates. The hub keeps one listing for its cards and embedded detail; `ExtensionsContent` supplies built-in and local module controls. Its list and entry sheet routes retain the same component so phone Back preserves search. Trail keys do not depend on whether the gallery is enabled: turning it off falls back to standalone management without adding another Back step. Source and update reviews stay separate sheets; updates still bind approval to the displayed pin and enabled state.
|
|
307
313
|
|
|
@@ -63,7 +63,7 @@ The handler runs with the owner's rights, as all of the module does. A conversat
|
|
|
63
63
|
|
|
64
64
|
Each run is a durable task, kept by the person who ran it, the session, and the request's id.
|
|
65
65
|
|
|
66
|
-
- When a reply gets lost, the same text sent again from the same
|
|
66
|
+
- When a reply gets lost, the same text sent again from the same browser, also after a reload, finds the first run, and gets its result. The handler runs one time. Pi Pocket keeps the ids of a person's recent runs only ([limits](reference/limits.md#commands)).
|
|
67
67
|
- A restart of the server never runs a handler again. The person hears that it was stopped, because it can have done a part of its work.
|
|
68
68
|
- Menu → **Running now** shows a command while it runs, and can stop it. People who steer stop conversation commands; the owner stops global commands.
|
|
69
69
|
- To stop a run aborts `ctx.signal`. It does not undo what the handler did. A stop just after the handler wrote its card leaves the card, and the run says that it was stopped.
|
|
@@ -94,3 +94,7 @@ Each member in the reference has its own Since line. These parts came together:
|
|
|
94
94
|
| Read-only conversation and descendant usage: `ConversationWebRequest.conversationUsage` (experimental) | 0.28.0 |
|
|
95
95
|
| How a run stopped: `outcome` and `failure` on `run.ended`, and `failed` on a linked session (experimental) | 0.28.0 |
|
|
96
96
|
| `host.sessions.start` (experimental) | 0.28.0 |
|
|
97
|
+
| Workspace providers: `host.registerWorkspaceProvider`, `host.cwdOf`, and `WebRequest.createSession` (experimental) | 0.28.0 |
|
|
98
|
+
| Presented inputs: `web.presentEntry` and `pocket.entryPresentation` (experimental) | 0.28.0 |
|
|
99
|
+
| Fenced blocks and inline math: `pocket.fence` and `pocket.mathInline` (experimental) | 0.28.0 |
|
|
100
|
+
| `answers` from `linkedSessions.send` (experimental) | 0.28.0 |
|
|
@@ -144,7 +144,7 @@ All the numbers that limit a module, in one place. Each group links to the guide
|
|
|
144
144
|
- **A toast's message:** cut to 500 characters.
|
|
145
145
|
- **A card:** Pi Pocket keeps the last 30,000 characters.
|
|
146
146
|
- **Runs of one person:** 4 at the same time, in all sessions together. Pi Pocket refuses a fifth run until one ends.
|
|
147
|
-
- **Kept requests:** Pi Pocket keeps the request ids of the last 100 finished runs of each person in each session. The same text sent again from the same
|
|
147
|
+
- **Kept requests:** Pi Pocket keeps the request ids of the last 100 finished runs of each person in each session. The same text sent again from the same browser finds the first run only while its id is kept.
|
|
148
148
|
|
|
149
149
|
## Cleanups
|
|
150
150
|
|
|
@@ -88,7 +88,7 @@ Read them; a theme cannot change them, as they are each person's choice in Appea
|
|
|
88
88
|
| Token | What |
|
|
89
89
|
| ---------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
90
90
|
| `--text-size` | The conversation's text size, 10 to 32 px (13 to 17 before 0.20.0) |
|
|
91
|
-
| `--sidebar-w` | The open sidebar's width, as dragged
|
|
91
|
+
| `--sidebar-w` | The open sidebar's width, as dragged (set as the drag ends) |
|
|
92
92
|
| `--transcript-width`, `--composer-width` | Only with Width set to Wide or Full: then they are inline, and win over the theme's |
|
|
93
93
|
|
|
94
94
|
## Parts
|
|
@@ -140,6 +140,7 @@ Use the tokens and parts in [the reference](reference/theme-surface.md). The app
|
|
|
140
140
|
- **Light and dark.** The colors decide the mode. `<html data-mode="light">` is set for a light palette, so write `:root[data-mode="light"] { … }` for what differs.
|
|
141
141
|
- **Phones.** Below 700 px wide is the phone layout. The sidebar shows from 960 px.
|
|
142
142
|
- **States.** Session rows and tool calls say their state in `data-state`, and the open session's row has `aria-current="page"` on its button: `[data-part="session-row"]:has([aria-current="page"])`.
|
|
143
|
+
- **Session rows.** A row out of sight is not drawn (`content-visibility: auto`), so each row clips what it draws to its own box: a shadow or a mark of yours that runs past a row's edge is cut there. Draw inside the row, or give it room with padding. What a search matched in a row is a highlight, `::highlight(session-search)` (color, background, text decoration), not an element.
|
|
143
144
|
- **Text, not words.** Never select on what an element says (`[aria-label="Send"]`, `[title=…]`): the app's words change, and will come in other languages. Put no words in `content:`.
|
|
144
145
|
- **Right to left.** Prefer `margin-inline-start` to `margin-left`, and so on.
|
|
145
146
|
- **Order.** `order` and `flex-direction: row-reverse` move what shows, not the order keys reach it. Move whole regions, not parts of a reading flow. The app reads where the sidebar and the drawer are: a sidebar a theme puts on the right gets its resize handle on its left edge, and a drawer on the right closes with a swipe to the right. Other panels (Files, Browser, PiP) and phones' bottom sheets keep their place and their gestures: keep them where they are.
|
package/docs/extensions/tools.md
CHANGED
|
@@ -27,7 +27,7 @@ export default function createMyWords() {
|
|
|
27
27
|
|
|
28
28
|
- `name` must be different from the name of each other tool ([Names](reference/names.md)). Use a prefix of your own.
|
|
29
29
|
- `description` and `parameters` go to the model with each request. Keep them short and exact.
|
|
30
|
-
- `deferred: true` keeps a tool out of the requests until Pi loads it with `tool_search`, which only the Tool search module offers: while it is off, Pi cannot load the tool. Use it for a tool that few conversations need, or for a large set of tools. `test/prompt-budget.test.ts` keeps Pi Pocket's own prompt and tools
|
|
30
|
+
- `deferred: true` keeps a tool out of the requests until Pi loads it with `tool_search`, which only the Tool search module offers: while it is off, Pi cannot load the tool. Use it for a tool that few conversations need, or for a large set of tools. `test/prompt-budget.test.ts` keeps Pi Pocket's own prompt and tools under 14,000 characters (about 5,000 tokens) in a plain session, a guard against growth by accident: a rule that makes the work better is worth its tokens.
|
|
31
31
|
- `parameters` is a JSON Schema object. Build it with the builders of `@earendil-works/pi-schema`: `obj`, `str`, `num`, `int`, `bool`, `arr`, `union`, and `opt` for a property that can be left out. `obj` makes a closed object (`additionalProperties: false`); `obj(properties, { open: true })` lets other properties through. Pi Durable checks the arguments against the schema before `execute` runs. Since Pi 1.5 (Pi Pocket 0.28.0), pi-schema does the check, and the model gets its messages, such as `- path: missing`. A drop-in written before can keep TypeBox's `Type` from `@earendil-works/pi-ai` ([API versions](reference/api-versions.md)).
|
|
32
32
|
- `execute(args, api, context)` does the work.
|
|
33
33
|
|
package/docs/features.md
CHANGED
|
@@ -6,7 +6,7 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
6
6
|
- **Themes.** A theme changes the app's look and layout without a change to its code: a folder of CSS, fonts, images, and optional colors (`docs/extensions/themes.md`). Appearance has a **Theme** row above **Colors**: **Pocket**, the app's own look; **Lantern**, a calm, warm dark theme that comes with the app, made for reading for hours (warm brown-grey with warm off-white text and a muted amber accent, one readable column of about 72 characters, tool calls as one quiet line until opened, and your messages set off by a quiet amber bar instead of cards); and each theme folder. A theme stays when the colors change; one with colors of its own brings them when you choose it. The owner can **Duplicate** the theme or the colors in use into a folder of their own (in the data folder's `themes/`), **Edit with Pi** (a session in the theme's folder, with a message ready that names the guide), and **Remove** one (its folder moves to `themes/.removed/`). Under them, the owner picks the theme's fonts under **Fonts for** _its name_: **Text font** (Geist, Inter, System Sans, JetBrains Mono, Fira Code, IBM Plex Mono, Iosevka, or System Mono), **Code font** (one of the monospace ones), and **Ligatures** (**Theme's own** goes back to the theme's own setting), with a preview; each choice is saved into the theme, so everyone who uses it gets it. A theme that comes with the app shows its fonts, with **Duplicate to change**. Each save shows at once in every tab that uses the theme, without a reload, and a reload never flashes the app's own look. A theme loads only its own files; one that breaks a rule keeps its last good version, and the owner is told what and where. Each person chooses for each browser, guests too, and the owner can make the theme and colors in use the default for browsers that have not chosen. The launcher's Themes and `/theme <name>` choose themes as well as colors. A theme can bring a pair of palettes, dark and light, that follows the system's setting. Safe mode (`?noext=1`) loads no theme.
|
|
7
7
|
- **Omarchy colors.** All of Omarchy's themes, from Tokyo Night and Gruvbox to Rosé Pine and the light ones, drawn from each theme's own `colors.toml`, in soft tiles: rounded windows and controls on 1px hairlines, soft shadows only on what floats, Geist for words and JetBrains Mono for code, paths, and numbers, with JetBrains Mono's own italic and the Nerd Fonts icons that prompts and tools print (bundled in `web/fonts/`, with Inter, Fira Code, IBM Plex Mono, and Iosevka for themes to name; `web/fonts/SOURCES.md` says where each came from); light themes too. Menu → **Appearance** (or the **Theme** tile, the launcher, or `/theme gruvbox`) picks one under **Colors**, as well as a theme folder's `colors.toml` (any Omarchy theme folder dropped into `themes/` shows there); the mini-desktop cards in Appearance preview a theme on hover or keyboard focus, and leaving without choosing restores the saved theme. The new look grows as a circle from where you tapped. **Desktop** follows the Omarchy theme of the machine Pi Pocket runs on: change your desktop's theme and the app follows within seconds, optionally with your wallpaper in the gaps.
|
|
8
8
|
- **Sheets and controls.** Sheets have a 56px title bar on wide screens, a back chevron when opened from another sheet, grouped inset lists, round toggles, and segmented settings. On phones they keep their bottom-sheet grip and drag-to-close gesture. Text sheets have Cancel and the main action together at the bottom; all existing keyboard and back flows stay available. Buttons, fields, and search share the same rounded controls across the app.
|
|
9
|
-
- **Tiled windows and motion.** On wide screens the sidebar and the session are Hyprland windows, softened: 8px gaps, rounded corners on a hairline, and a soft accent ring on the one under the mouse. Motion uses Omarchy's Hyprland curves: windows pop in at 87%, sheets and popovers rise a little as they fade in, and leave quickly, new messages slide in, and notices count down until they go. While Pi works, the conversation shows what it does; elsewhere a working session's square steps around and a small dot pulses (both hold still with reduced motion). Appearance can turn tiling off (no gaps, square corners, no ring), reduce motion (or follow the system's setting), choose Fluid motion (sheets, menus, the launcher, and notices arrive on a spring and leave quickly, over a frosted scrim; what they hold, and a tool group's first steps, follow a step apart; a message sent lifts off from the message box; each new paragraph of Pi's answer fades in, and its caret breathes; a pressed button springs back; and folding the sidebar morphs the windows into place; Width and tiling change at once, as they are set from a sheet or the launcher, which morphs skip; Auto never picks it), change the conversation's text size (13, 15, 17, or 20, or any size from 10 to 32 px typed in, in half pixels), set the width (Comfortable, which grows with a wide window, Wide, or Full: how much of the window the conversation and the message box take, per browser; phones stay as they are; a reply's code block with long lines grows past the column, centered on it, where plain text and Markdown wrap in the column, and a wide table grows toward the window's edge), set the density (Comfortable, Compact, or Tight: less room between turns, inside message cards and activity groups, between the conversation's lines, in the session list's rows, around the message box and the status line, in sheets and their lists, and in the top bar, while font sizes stay and rows on a touch screen stay a thumb tall), show Pi's thinking while it works, and show the reply speed under the message box.
|
|
9
|
+
- **Tiled windows and motion.** On wide screens the sidebar and the session are Hyprland windows, softened: 8px gaps, rounded corners on a hairline, and a soft accent ring on the one under the mouse. Motion uses Omarchy's Hyprland curves: windows pop in at 87%, sheets and popovers rise a little as they fade in, and leave quickly, new messages slide in, and notices count down until they go. While Pi works, the conversation shows what it does; elsewhere a working session's square steps around and a small dot pulses (both hold still with reduced motion). Appearance can turn tiling off (no gaps, square corners, no ring), reduce motion (or follow the system's setting), choose Fluid motion (sheets, menus, the launcher, and notices arrive on a spring and leave quickly, over a frosted scrim; what they hold, and a tool group's first steps, follow a step apart; a message sent lifts off from the message box; each new paragraph of Pi's answer fades in, and its caret breathes; a pressed button springs back; and folding the sidebar morphs the windows into place; Width and tiling change at once, as they are set from a sheet or the launcher, which morphs skip; Auto never picks it), change the conversation's text size (13, 15, 17, or 20, or any size from 10 to 32 px typed in, in half pixels), set the width (Comfortable, which grows with a wide window, Wide, or Full: how much of the window the conversation and the message box take, per browser; phones stay as they are; a reply's code block with long lines grows past the column, centered on it, where plain text and Markdown wrap in the column, and a wide table grows toward the window's edge), set the density (Comfortable, Compact, or Tight: less room between turns, inside message cards and activity groups, between the conversation's lines, in the session list's rows, around the message box and the status line, in sheets and their lists, and in the top bar, while font sizes stay and rows on a touch screen stay a thumb tall), choose where PiP opens (**PiP**: Floating, a window in the corner or a phone's sheet, or Board, its conversation in the session's place), show Pi's thinking while it works, and show the reply speed under the message box.
|
|
10
10
|
- **The sidebar.** A rail and the session list beside it. The rail holds Pi (which goes to the home screen), Sessions (which folds the sidebar to numbered sessions and unfolds it again, as Ctrl/⌘+B does), the tools (Peek tiles, where the server has them, lit while they are on; Running now, with how many sessions work; the subagents board, with how many subagents work or wait, and a red mark when one waits for you or failed and nobody has dealt with it yet; People; Providers, for the owner; Theme), and you. The list has Priority, Recent, Folders, and Archived (an icon) in a segmented switch; sessions grouped by day or by folder, in groups that fold; and pinned sessions on top (per browser). **Priority** (since 0.27.0) groups sessions by what they ask of you, not by when they ran, and has no Pinned group: pinned sessions go by their state. **Needs you** holds sessions with a call waiting for approval (the longest wait first), then failed runs not seen yet, then sessions with failed subagents nobody dealt with; its tab and the rail's Sessions button carry a warning-colored count of them, and its head offers **Dismiss N failed** when more than one failed. **Ready to read** holds sessions that finished since this browser looked, that are marked unread, or that have new chat (newest first; **Mark all read** in its head, and a button on a row's hover). **Working** holds sessions where Pi or its subagents work, a background command runs, or a request waits for a provider's limit (a clock pill says when it clears). **Quiet** holds the rest, folded at first. Each row is one line. A call's row has a **Review** button, which opens the call in the row (one at a time): the tool and its whole command, why the guard asks, and how long ago, with Deny and Allow. Allow shows only when the command is whole in the row (80 characters, one line), as on a peek tile; otherwise Deny and Open. An extension's question can be declined from its row, or opened to be answered where it waits, a person who may not allow what Pi did for someone else cannot allow it, and only people who can steer answer. After an answer the next call opens by itself with the focus on its Review, and the answered row glows in the group it moves to; an answer cannot be undone, and says so in a notice without Undo. A failed run's row has a ✕ that dismisses it (the run counts as seen, like opening it) and a failed subagent's ✕ deals with it, as the subagents board does; Dismiss and Mark all read say so in a notice that undoes them, except a subagent's dealt-with failure. The open session's row stays in its group while it is open, though opening it reads it, and moves when another session opens. Needs you shows six rows and a **Show N more** button. A search lists the matches, as on the other tabs. The tab a browser starts on is the one it kept (Recent when it kept none). Each session is one line: a square in its folder's color whose shape says where the session is (stepping quadrants while Pi or its subagents work, two bars while a call waits for you, a cross when its run failed, solid when it finished since this browser last had it open or is marked unread, and hollow once read or never run), its title (semibold with new chat, when marked unread, or when open, and the open one on the accent's soft fill), and on the right a small pill with ⑂ and how many subagents work there (or failed with nobody dealing with it yet, in red), who else is there, a pulsing dot while Pi works or a "needs you" pill while a call waits for you, a dot for new chat (or for a session this browser marked unread), and how long ago; its folder and model are in its tooltip. Hover a row to archive, pin, or mark it unread; on a touch screen, hold a finger on it (the row shows the press, and moving the finger scrolls instead) for a sheet of its actions; with a mouse, right-click a row for the same actions in a small menu at the pointer (Shift+right-click keeps the browser's own menu, and Ctrl+click on a Mac still selects). They are: open it in a new tab, copy its link or its folder's path, rename it, fork it (a new session with its whole history, through Pi's latest finished reply), start a new session in its folder, share it (an invite to only that session), pin or unpin it, move a pinned one to the top or bottom of the pins, mark it unread or read, extensions' actions, select it, and archive or unarchive it. Pinned sessions keep the order they were pinned in, or moved to. Marks are per browser, like pins (a session's square counts as read here when this browser opens it, or has it open in sight as its run ends; a failed run's cross stays until its next run starts, and a restart forgets it), and opening the session clears its mark; the session's menu marks the open one unread and goes back to the list. A session that another one started (Agent Teams) shows under it, with a branch line to it, as deep as they go (up to three steps of indent, so a phone's list keeps its room), and the numbers (Alt+1…9, the folded rail) follow the tree; a pinned one stays among the pins, and in Folders one in another folder stays in that folder's group. A session with linked sessions under it has a pill on its right with how many and a chevron: a tap folds them away under it, and again shows them; a fold holds in that browser across reloads, a folded row shows a dot when one under it waits for you or failed, and a search shows every match, folded or not. Someone who cannot see the session that started one sees it as a session of its own. A session moves up the list when it is renamed, gets a message, or Pi starts work there for any other reason (a scheduled message, a subagent's report, a message sent again after a restart), so the one that ran last is on top. Archiving says so in a notice that undoes it. Ctrl/⌘+click selects sessions, Ctrl/⌘+drag selects every row it passes (the list scrolls at its edges), and Shift+click selects a run; on a touch screen, after **Select**, taps select more rows or let them go. A bar under the list archives, unarchives, or pins them, and Esc (or back, after Select) lets go. Archiving does not move a session in the list, so one brought back returns to where it was. Drag its edge to resize the list (to 40% of the screen at most), or fold the sidebar to the rail with numbered sessions, like Waybar's workspaces. Appearance → **Switch sessions with → Tabs** (off until you turn it on, in each browser) also puts the first nine of those sessions in a strip of segments above the top bar, each in its folder's color: the open one fills, one that works pulses, one that waits for you shows in the warning color, and a tap opens it (the open session takes the ninth place when it is further down the list). Choosing Tabs folds the sidebar to its rail, and Sidebar unfolds it; Ctrl/⌘+B still folds and unfolds it either way. On a phone the strip is the bars alone, and the top bar names the open session. A rail with more buttons than room (a short window, many extensions' buttons) scrolls as a whole, and its numbered sessions on their own, up to a third of the window; each fades the edge where more is. On phones the drawer and the list with no session open have the same rail. On wide screens with no session open, the home screen shows a fastfetch-style summary, buttons for a new session, the launcher, and Appearance, and the sessions to jump back into.
|
|
11
11
|
- **Your own layout.** Appearance → **Top bar buttons**, **Status line items**, **Places**, **Message box buttons**, and **Under Pi's answers** list what shows in each place, the app's own and extensions' alike: a switch shows or hides each one, arrows move it, and **Reset** goes back to the defaults. The menu, More under an answer, Lancet Guard, and the connection's warning always show. Saved in each browser, so a phone and a desktop can differ. Extensions can arrange these too (`pocket.arrange`), and what you choose wins.
|
|
12
12
|
- **Peek tiles.** Off until you turn them on: the menu's **Peeks** tile, Alt+P, `/peek`, the launcher, or Appearance switches them on or off in one step, and so do the rail's **Peek tiles** button and the tiles button in the top bar, which shows wherever its pane is 480px wide or more (while off, it has a dot when another session waits for you). Then other sessions' live work shows beside the one you are in: one tile per session that is working, waiting for an approval, has subagents at work, finished since this browser last had it open, or is pinned, plus the one you just left. Each is a card with the session's folder square, title, and path, its last three lines (what was asked, what Pi said, its tool calls and how they went, each in two lines at most, with a mark for who or what said it), the subagents at work there, and a footer with its state in words; it changes at most once a second, and only its square moves while the session works. Its subagents at work get a line each: the state square, the name, and what it does this moment (the call it runs, the one it waits to allow, or its words), from its own peek; a tap opens it. Those waiting for an approval come first, and a tile shows three at most (the strip one), so it stays a glance however many work: **N more** opens the subagents board at the first one left out. A subagent's call waiting on its session's tile says which subagent asks, and in the column the footer says when only subagents keep the session working or waiting ("3 subagents working"). Click a tile to open its session; the one you leave takes its place, so the tiles stay put. Allow or deny a waiting call right on its tile, which shows the whole command and why the guard asks; a command that does not show whole offers Open instead of Allow, which goes to the conversation it waits in. The ✓ on a finished one marks it seen. On wide screens the tiles are a column that slides in where People and the Browser panel dock when neither is open, with **▲/▼ N need you** at its edge for waiting tiles out of view; narrower screens (and wide ones with a panel open) get a strip under the top bar that swipes sideways. Only the tiles on screen are live: once scrolling settles, the tab tells the server which, and the rest keep their last lines (their marks stay current from the session list); a tab in the background keeps none live, and with tiles off nothing is sent at all. Peeking is not being there: it does not show you in the session's people.
|
|
@@ -15,12 +15,12 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
15
15
|
- **Keyboard.** Alt+1…9 jumps to a session (hold Alt to see the numbers), Alt+↑/↓ goes to the previous or next one, Alt+N starts a new one (where Ctrl/⌘+1…9 starts it in a favorite folder), Alt+B opens or closes the browser, Alt+E the Files tile, Alt+T turns Show thinking on or off, Alt+V starts or stops dictation, and `?` lists every shortcut. On a computer, a session opens with the caret in its message box, ready to type; on a touch screen it waits for a tap, so the keyboard does not cover the conversation, and on a Mac a session opened with Alt+1…9 or Alt+↑/↓ leaves the box alone, so the next Alt shortcut still works (Option types characters in a box).
|
|
16
16
|
- **The conversation.** A column of turns, made for phones. Your messages are cards with the sender's avatar (the accent for yours, the sender's color for someone else's), who sent each and when; Pi's replies are plain prose at Appearance's text size, streamed as they come (lists keep a quiet marker column; code, tables, and rich blocks are rounded cards). The **Message time** item under completed replies shows the time, with the date for earlier days, and can be hidden or moved in Appearance → Layout. What Pi does between its words, its thinking and tool calls, folds into one line that says what it did and for how long ("Thought, searched, read 2 files, ran 1 command · 18s"), and opens, as a card, into a timeline: a line per call with a circle for how it went (✓ done, × failed or denied, ! waiting for an approval, a spinner while it runs, ⑂ for a subagent, ✦ for a thought) and what it came to (lines added and removed, lines read, matches, tests passed, an exit code, "needs approval"), and tapped, its input and output, with the diff viewer's diffs for edits (line numbers, syntax colors, and the words that changed) and bash's live output. The newest turn's groups are open and earlier ones closed, unless Appearance's **Keep activity folded** (off by default) keeps them on their line until you open one; a thought alone still follows Show thinking. An approval is a card at the end of its turn (the command, the reason, Deny and Allow; once answered, the call's line says who allowed or denied it), and while Pi works one line, a pulsing dot with the state in the accent (the warning color while it waits for an approval), says what it does (thinking, working, waiting for an approval, retrying) and for how long. With **Show thinking** on in Appearance (or Alt+T, or the launcher), the current thought shows above that line as it streams, and the thoughts in the conversation show their words once written (a thought alone in its group opens, and one on a timeline opens its step). A chevron before the line's dot folds the live thought away, and again brings it back. Alt+T shows a short on/off notice, even while Pi is idle. During tool calls the latest thought stays; a new response clears it until the model shares new thinking. Models that share none say so, rather than showing an old thought as current. A fold holds in that session, also over a reload, until you open it again; the setting is off until you turn it on, in each browser, and while it is off or folded the live thought is neither selected nor drawn. The reading area follows new words until you scroll up in it, and follows again for each new thought. While Pi works, **Steer**, **Queue**, or **Interrupt** beside the model chip says whether a message steers the run, waits for it to end, or stops the run at once (the tool call too, as Stop does, which also withdraws what waits in the queue) and is sent after; Interrupt goes back to Steer after one use, or when Pi stops before it was used, while Steer and Queue stay as chosen; Ctrl/⌘+Enter sends a message the other way while Pi works (queued when Steer is chosen, steering when Queue is) and leaves the choice as it was, and on Interrupt or with nothing running it sends as Enter does (since 0.28.0); queued messages can be withdrawn, and your own, tapped open, can go back into the message box to change (**Edit**: its words above what you were typing, on a line of their own, with its files), move to Queue or Steer until Pi reads it, or go now as an Interrupt (a second tap confirms; `CONFIRM_INTERRUPT` in `web/composer.js` turns that off), with these buttons in a quiet row at its right (since 0.28.0): that stops the run and sends only that message, while every other queued message, from everyone, stays queued in its order with its sender and mode (a restart in between loses or repeats none), and so do subagents' reports; with take turns on, moving one to Steer or Interrupt waits for your turn at the wheel, as sending does; Stop (or Esc twice) stops the run. A run stopped in the middle of a tool call ends with a "Stopped." line under its card. A session you go back to shows at once where you were in it, as this browser tab kept it, and what came while you were away rises in: at the bottom the conversation glides up to it, and scrolled up the row you read stays where it is. With Appearance's **Wait for updates** (off by default), a session that changed while you were away shows only once its updates have come (or after 2.5 seconds). Scrolled up, a round button above the end of the message box goes back down to the newest message.
|
|
17
17
|
- **Getting around on a phone, with one hand.** Back (the swipe, Android's back button, the browser's) goes back to where you were: it closes what opened last (a sheet, the menu's next sheet back to the menu, a file back to the Files tree, back to Changes when the file was opened from there, the Files tile or the Browser panel, the drawer) before it leaves the session, and leaving goes to the session before or to the list, scrolled and searched as you left it. A session opened straight away (a link, a notification) has the list under it, so back does not leave the app. What you use most is a thumb's reach from the bottom edge: the button beside the message box (or a swipe up from it) opens the places, a short sheet of big tiles (Files, Changes, Browser, Artifacts, Chat, Find, Branch, Peeks) with the session menu below them. On the conversation, swipe left for Files and right to go back; in Files, swipe right to go back. Each swipe shows a mark that lights when letting go will act. The top bar leads back to the list (counting other sessions that wait for an approval) and keeps only the buttons with something to say. Every control is a thumb's size on a touch screen (small ones, such as a code block's Copy or a reply's Pin, keep their look and take a wider tap); a tap anywhere on the message box, off its one line of text, still goes to the text; a quick second tap does not land on whatever just slid in under it; tables in replies scroll sideways instead of crushing their columns; a diff's header keeps the file's name on a line of its own on a phone; and the command a peek tile asks about opens its session when tapped. The Files tile and the browser slide in as screens of their own and slide away on back, a file slides in over the tree, and the browser's tools sit on their own row under the address. Drag a sheet down, or the drawer left, to close it. In an iPhone home screen app, which has no back gesture of its own, swipe in from the left edge to go back.
|
|
18
|
-
- **Reply to a passage.** Select words in one of Pi's replies, on a phone or a desktop, and a **Reply** button appears by the selection (below it on a touch screen, where the system's menu sits above). It puts the passage in a quote strip above the message box (tap × to drop it); the next message goes to Pi with the passage first as a Markdown quote (up to 1,500 characters), and shows in the conversation as a quote block above your words. With PiP on, PiP's orb (**Ask PiP**) sits beside **Reply** in the same pill: it opens PiP with the passage in a quote strip over its box, ready to type; your message goes with the passage quoted first, and shows with it as a quote block. PiP also gets, unseen by people, which session the passage came from (its number, title, and folder: `about` on the submit request, a `<pocket-context>` part after the message that no view or resend shows), so it can read that session for more. In Appearance, **Reply to a passage** and **Ask PiP about a passage** (both on by default) each turn their own button off in that browser; with both off, nothing shows.
|
|
18
|
+
- **Reply to a passage.** Select words in one of Pi's replies, on a phone or a desktop, and a **Reply** button appears by the selection (below it on a touch screen, where the system's menu sits above). It puts the passage in a quote strip above the message box (tap × to drop it); the next message goes to Pi with the passage first as a Markdown quote (up to 1,500 characters), and shows in the conversation as a quote block above your words. With PiP on, PiP's orb (**Ask PiP**) sits beside **Reply** in the same pill: it opens PiP with the passage in a quote strip over its box, ready to type (as a board, Appearance → PiP → Board, the quote strip of the board's message box); your message goes with the passage quoted first, and shows with it as a quote block. PiP also gets, unseen by people, which session the passage came from (its number, title, and folder: `about` on the submit request, a `<pocket-context>` part after the message that no view or resend shows), so it can read that session for more. In Appearance, **Reply to a passage** and **Ask PiP about a passage** (both on by default) each turn their own button off in that browser; with both off, nothing shows.
|
|
19
19
|
- **Forks.** Tap Pi's reply → More → **Fork from here**: a new session with everything up to that reply, which then goes its own way. Tap one of your messages to **edit it and send it again**, or send any message again, to the same model or another one (a retry). Each makes a new session that forks just before the message; the original stays as it is. A fork gets its own chat (with the pins of what it inherited), a link back to where it came from, and optionally a git worktree of its own.
|
|
20
20
|
- **A new context.** Menu → **New context** (or `/reset [note]`): Pi starts fresh and no longer sees the messages so far, while everyone still does. An optional handoff note carries over what matters.
|
|
21
21
|
- **Instructions for Pi.** Menu → **Instructions for Pi** (or `/instructions …`): ground rules Pi gets with every message in this session, such as "use pnpm, not npm". Everyone in the session can see them.
|
|
22
22
|
- **Memory.** Short lessons Pi keeps across sessions: how to build and test a project, a gotcha it hit, a convention, a preference someone stated. Pi proposes one with its `memory` tool (one or two sentences each, never secrets) only when a person asks for it, or when Pi is sure that it will help in many later sessions, never for a one-off detail, and proposes fixing or forgetting one that turns out wrong; the owner approves. What Pi reads (a web page, a post, a comment, a file) could talk it into a "lesson" that would reach every later session, so nothing Pi saves, changes, or forgets counts until the owner says: **Approve** and **Discard** show right under Pi's memory call, with the words that wait and where they would apply (this project, or everywhere: every session and PiP), and in the sheet. Approve approves only what you saw: if Pi changed it since, the app says so and shows the new words. Lessons and project names are kept on one line, without invisible characters, so Pi reads only what the owner saw. A change or forgetting Pi proposes leaves the lesson as it was until then. Lessons you add yourself count at once. Each is for this project or for everywhere: a project's lessons reach every later session in the same repository, its worktrees included (or the same folder, outside a repository), and everywhere's reach every session and PiP. Menu → **Memory** (its hint says how many apply here and everywhere) lists them in those two groups, each with who saved it and a link to the session it came from (when you may see it), with Edit and Forget; type one in to add it by hand, for this project or everywhere, or use `/remember run the tests with make check` or **Remember…** on a message. A guest's lessons wait for the owner too, and a guest's change to one in force is a proposal they can withdraw. What waits shows at the top of the owner's sheet; the menu's hint says how many. Lessons waiting take no room from the approved ones, and a person (or Pi for them) may have 20 waiting at most. Only the owner, or whoever saved a lesson, changes or forgets it; viewers only read. A project keeps 40 lessons and everywhere 30; past that, forget one first. Changes show as lines in the chat. Turn it off in Extensions.
|
|
23
|
-
- **A lean prompt.** A new session gets only the tools most conversations use. `browser`, `subagent`, `background`, `schedule`, `watch_pr`, `ask_someone`, and the design tools wait, and so do their prompt sections; the prompt lists them with a line each, and Pi loads one with `tool_search` when a task needs it. On a model whose provider takes tool changes in the messages (Claude 4.8 and 5, and later), the tool joins the list and stays for the conversation; on any other, Pi calls it from a `codemode` script, so the tool list and the prompt cache never change. Long guides, such as the design guide and the page-to-app messages of artifacts, are files that Pi reads when it needs them. Turn the **Tool search** module off in Menu → Extensions to offer every tool every time. A test keeps Pi Pocket's own part of a plain session's prompt
|
|
23
|
+
- **A lean prompt.** A new session gets only the tools most conversations use. `browser`, `subagent`, `background`, `schedule`, `watch_pr`, `ask_someone`, and the design tools wait, and so do their prompt sections; the prompt lists them with a line each, and Pi loads one with `tool_search` when a task needs it. On a model whose provider takes tool changes in the messages (Claude 4.8 and 5, and later), the tool joins the list and stays for the conversation; on any other, Pi calls it from a `codemode` script, so the tool list and the prompt cache never change. Long guides, such as the design guide and the page-to-app messages of artifacts, are files that Pi reads when it needs them. Turn the **Tool search** module off in Menu → Extensions to offer every tool every time. A test keeps Pi Pocket's own part of a plain session's prompt under 14,000 characters (about 5,000 tokens: schemas and this prose run at about 2.75 characters a token), so it does not grow by accident.
|
|
24
24
|
- **Plan mode.** The **Plan** chip by the message box (or `/plan`): Pi reads files, runs read-only commands, and uses tools their extensions mark read-only, then proposes a plan; writing, editing, and other commands are blocked. Subagents inherit plan mode and explore under the same restrictions. **Approve plan** turns plan mode off and tells Pi to go ahead; it waits until Pi has answered since plan mode went on.
|
|
25
25
|
- **Scheduled messages.** `/schedule in 2h check the deploy`, `/schedule tomorrow 9am …`, or `/schedule every weekday 8:00 summarize CI`, or Menu → **Scheduled messages**: Pi gets the message at its time, in this device's time zone, even with nobody watching, and the people in the session get the usual "Pi finished" notification. Pi can schedule its own follow-ups with its `schedule` tool. Each schedule is a durable task: a restart while it waits keeps waiting, one after its time sends at once, and none is ever sent twice. A schedule is cancelled, with a line in the chat saying why, once its person can no longer steer the session or a spend limit is reached. Limits (settable since 0.24.0): a session holds 50 schedules, a message 4000 characters, a repeat comes at most every 10 minutes (a short repeat can cost money in model calls), and `in …` reaches 366 days ahead. The owner changes each in Menu → Extensions, under Scheduled messages; a change applies at once, to new schedules only. Archiving a session that has repeating schedules says how many keep running there, with a tap to see them, and its Schedules sheet marks it as archived; nothing stops or moves (since 0.28.0).
|
|
26
26
|
- **Done when.** `/until npm test`: after each of Pi's answers, the check runs in the session's folder; while it fails, Pi gets the end of its output and keeps going, for five checks at most. A bar above the message box shows how it stands. With Lancet Guard on, the check must be a command the guard allows outright. In plan mode the check waits until the plan is approved, and past a spend limit Pi stops going on. A check cut off by a server restart is not run again, as it may have done part of its work: Pi hears so, and its next answer is checked.
|
|
@@ -31,11 +31,11 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
31
31
|
- **A person's role and the page's scroll, for extensions.** Since 0.27.0, two experimental members. `host.roleOf(personId)` gives a person's role (`owner`, `guest`, or `viewer`), or `undefined` for an id that is not a person here. It reads the role that core already uses, so a module that guards owner-only things can ask whether Pi works for the owner (`host.requesterOf` gives the id). The snapshot of `host.browser` has a `scroll` field, `{ y, viewport, height }` in CSS pixels, the same numbers that Pi's `browser` tool shows as "scrolled 0 of 800px". See [Writing extensions](extensions/host.md).
|
|
32
32
|
- **Folded inputs.** An extension can send a message the conversation shows as one line: a short label, and a summary when the message has one. Tap the line to read the message. Tap the message for its sheet, where **Show**, **Fold**, and **Hide** choose how every input of that kind shows in this browser: as a message, as the line (the usual choice), or hidden until Find jumps to it. A hidden message still starts its turn. An extension's browser code can pick one for you until you choose. The queue shows the same line. Export keeps the whole message in a folded block. Find searches the label, the summary, and the whole message, however long; Copy text copies all of it. An input the extension stored as its own kind is not a message you can send again. Peek tiles and PiP show the one line. The model still reads the whole message. Since 0.28.0.
|
|
33
33
|
- **Drafts on a shared browser.** Message drafts, folded pastes, and uploaded files stay with the person signed in, across reloads and Back. Signing out clears them and resets other open tabs; theme and layout stay as they were. On Back, a cover checks who is signed in; Retry checks again if the server cannot be reached. Old unscoped drafts are discarded. PiP keeps text across reloads, but its files only while the page stays open.
|
|
34
|
-
- **What you sent before.** ↑ in the message box goes back through what you sent from this browser in the current session (↓ comes forward, then back to your draft), and Ctrl+R searches it. The browser keeps up to 200 entries per person across sessions, with duplicates removed only within your session. Signing out clears this history;
|
|
34
|
+
- **What you sent before.** ↑ in the message box goes back through what you sent from this browser in the current session (↓ comes forward, then back to your draft), and Ctrl+R searches it. The browser keeps up to 200 entries per person across sessions, with duplicates removed only within your session. Signing out clears this history. What 0.27 kept moves to its person the first time 0.28 opens signed in as them (a sign-out before that clears it); older unscoped history is discarded.
|
|
35
35
|
- **Dictation.** The mic beside Send, in the message box and in PiP's, dictates with the browser's own speech recognition, in the language the browser is set to. Words show in the box as they are heard and stay once the browser settles on them: at the caret while the box has the focus, after its text when it does not, with a space where they meet; words typed meanwhile stay too, and a phrase still being heard when you type or move the caret elsewhere finishes where it is, the next one going to the caret. It never sends by itself: tap the mic again (or Alt+V, which dictates into PiP's box while PiP is open, else into the session's) to stop, read it over, and send. Sending, leaving the session, closing PiP, or switching away from the tab stops it as well. What was heard is kept as a draft, like typing. While it listens the mic takes the accent, with a ring that breathes (still, with reduced motion), and the box says "Listening…". On a phone while Pi works, the mic takes Send's place until there is something to send. It needs a browser with the Web Speech API: Chrome, which sends the audio to Google's servers to recognise it, and Safari, on iOS too; where there is none (Firefox), the mic does not show. Browsers give a page the microphone only over https or on localhost, as Pi Pocket is served through the Cloudflare Tunnel, Tailscale Serve, or on this device. A blocked microphone, silence, a missing microphone, or no network says so in a notice.
|
|
36
36
|
- **Long pastes.** Pasting more than 20 lines puts a placeholder such as `[Pasted text #1 · 240 lines]` in the box; the message goes out with the text in its place.
|
|
37
37
|
- **Files at a tap.** Inline code paths in Pi's replies (`src/app.ts`, `app.ts:42`), Markdown links to local paths (such as `[config](/etc/app/web.env)`), file mentions in messages, read/write/edit cards, and Changes open a viewer: text with line numbers and syntax colors (Markdown rendered too), images, and folders to browse, with **@ Mention** to put the file in the message box. While the Files tile is open, they open there instead of in a sheet. Opening a file that is already shown reads it again, so after an edit the viewer shows the new text; the old text stays on screen until the new text arrives. Someone invited to one session sees its folder only, and only the owner opens Pi's own folder and Pi Pocket's data. For the owner, Ctrl+click (⌘+click on a Mac) on such a path, or on a row in the Files tile, shows it in the file manager of the machine Pi Pocket runs on (Files, Dolphin, Finder, Explorer), selected in its folder; so does the folder button in the viewer, with a mouse. It opens on that machine, not on the device you click from.
|
|
38
|
-
- **Files tile.** Menu → **Files** (or Alt+E, `/files`, or the launcher; the folder button in the top bar, where the pane has room) shows the session's folder beside the conversation on wide screens, where the Browser and People panels dock (one of the three at a time), and full screen on phones. Its bar has a switch between **Files** and **Changes** (with the count of changes), the folder's path, and close. **Files** is a tree of the folder that opens as you go (changed files carry an M, A, or D, folders holding changes a dot, and arrow keys move through it), a **Go to file** box that matches across the whole folder as the `@` menu does, and the file you pick, beside the tree when the tile is wide enough (600px) and in its place when not. **Changes** is the review below. Drag the tile's edge to resize it. Esc closes a file open over the tree, and then the tile where it covers the conversation, as back does.
|
|
38
|
+
- **Files tile.** Menu → **Files** (or Alt+E, `/files`, or the launcher; the folder button in the top bar, where the pane has room) shows the session's folder beside the conversation on wide screens, where the Browser and People panels dock (one of the three at a time), and full screen on phones. Each session remembers which panel it showed (Files and its tab, Browser, People, or an extension's, such as Design): going back to it, reloading, or opening it in another tab of the same device shows that panel again; PiP's floating panel stays as it is across sessions, and PiP as a board opens with no panel beside it. Its bar has a switch between **Files** and **Changes** (with the count of changes), the folder's path, and close. **Files** is a tree of the folder that opens as you go (changed files carry an M, A, or D, folders holding changes a dot, and arrow keys move through it), a **Go to file** box that matches across the whole folder as the `@` menu does, and the file you pick, beside the tree when the tile is wide enough (600px) and in its place when not. **Changes** is the review below. Drag the tile's edge to resize it. Esc closes a file open over the tree, and then the tile where it covers the conversation, as back does.
|
|
39
39
|
- **Find in session.** Ctrl/⌘+F, `/find`, or Menu → **Find in session**: every message, command, and note in the session, earlier history included, newest first; tap one to jump to it.
|
|
40
40
|
- **Stop with Esc.** Esc twice stops Pi while it works.
|
|
41
41
|
- **Session titles.** A session is named after its first message; a long first message, or one that runs a skill or prompt template (`/skill:name`, `/review …`), gets a short title written by the session's own model (its cost counts as the session's), unless someone renamed it first. A command's title is written from what it sends, not only its name. A reply that is no title, such as a model thinking aloud or one cut off at its length limit, leaves the first message's.
|
|
@@ -59,7 +59,7 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
59
59
|
- **Working together.** The top bar shows who else is in the session (an avatar with a mark that greys when their tab is in the background, and how many more), and "Alex is writing to Pi…" warns before two people steer at once. The **People** panel opens beside the conversation on wide screens, where it takes the Browser panel's place, and as a sheet on phones. Its header counts the people here; the roster shows their online or away state, typing, and role. A **Take turns** card starts or turns off shared driving with the same permissions as the menu. It has:
|
|
60
60
|
- **Chat** for the people in the session, which Pi does not see. Your messages are right-aligned accent bubbles; other people's are left-aligned, with their name and time above. Quotes sit above the bubble, and the pill-shaped message box keeps a dismissible quote strip. The latest pin stays above the chat. Type `@` to mention someone (they get a notice wherever they are), tap **Discuss** under a reply of Pi's to quote it, and tap a chat message to **Send to Pi**, pin, or copy it. Changes show up here as activity lines ("Alex stopped the run", "Tanner switched the model to …", "Alex allowed the bash call: …"), and as a notice to everyone else in the session.
|
|
61
61
|
- **Pinned** replies and chat messages.
|
|
62
|
-
- **Notes**: one shared page per session. Saving over someone else's newer save asks first.
|
|
62
|
+
- **Notes**: one shared page per session. This browser keeps your unfinished edit for your account and session through tab or panel changes, switching sessions, and reloads. Signing out clears it. Save, Cancel, or **Use theirs** clears that edit, not a newer draft from another browser tab. Saving over someone else's newer save still asks first, including after you return to a draft. If browser storage is blocked or full, the draft stays until a reload and a warning asks you to save first.
|
|
63
63
|
- Under Pi's answers: emoji reactions, **Discuss**, and **Pin**. Queued messages show who queued them. Approved or denied tool calls show who decided.
|
|
64
64
|
- **Take turns.** Menu → **Take turns**: one person drives and only they send to Pi or change its settings. Others tap **Ask to drive**, the driver hands over, and anyone can take the wheel when the driver has left (the owner always can). Anyone who can steer can still stop a run.
|
|
65
65
|
- **Roles and invites.** An invite can let someone **steer** or make them **view only** (they read, react, and chat, but cannot send to Pi, approve, or upload). It can cover **every session** or **only this session**, and lasts 15 minutes, an hour, a day, or a week (**Expires after**); either way it works once, and a restart keeps it. Changing what the sheet's invite grants, or how long it lasts, ends the one it showed; **New invite** makes another and leaves the one before working. Only the owner can make an owner invite (**Sign in as me (owner)**): it makes no one new, but signs the device in with the owner's token, so it has full control, works once, and always expires in 15 minutes; rotating the owner token (`--rotate-token`) signs out every device signed in that way, and ends owner invites not yet used. Menu → **People** lists everyone, who is online, and when the others were last here. The owner can change what each person may do or remove them. The session list shows who is in each session, and a dot marks new chat messages.
|
|
@@ -90,11 +90,11 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
90
90
|
- **Waiting out provider limits.** When a provider's limit stops a run (a 429 or an overload, a Claude or ChatGPT usage window, a model's cap), Pi Pocket waits for it to clear and goes on by itself, instead of failing. It waits until the reset time the provider gave (or, with none, tries again at growing intervals), then sends one request to find out; if that gets an answer, the sessions waiting on the same limit go on, one at a time. The live line says what Pi waits for, when it tries next, and when the limit resets, with **Retry now**; **Stop** or **Interrupt** end the wait at once, and a message you send meanwhile waits in the queue as always. The session's square is a hollow square with a dot, also on peek tiles, and a subagent's row says it waits. One push goes out when a wait of ten minutes or more begins (Menu → **Notifications** → **Waiting for a limit**). It survives a restart. The owner sets the longest wait (**Wait for a limit** in the Providers sheet: Off, 1, 6, 12, or 24 hours; default 6): what waits is any reset time within that longest wait, load with no time given (an ordinary 429 or an overload), which is tried again at growing intervals for up to 30 minutes, and, since 0.24.0, a plan's usage limit with no time given (OpenAI subscription sharing, Z.ai, MiniMax, OpenCode Go), which is tried again about every 15 minutes, up to the longest wait, counted from the first failure across restarts. What fails the run at once, with the reset in the message where there is one: a window of days (Claude's 7-day window, a Codex window of over 300 minutes), a reset after the longest wait, a usage limit that names a window of days (daily, weekly, monthly), with or without a reset time, and a sign-in that expired or billing. Retry now sends one try each 30 seconds. It never picks another model. Since 0.21.0.
|
|
91
91
|
- **Prompt cache keeper.** On by default; `PI_POCKET_CACHE_KEEPER=off` turns it off. While a run waits on a tool call, Pi Pocket replays the last request that ended in a tool call, with `maxTokens` 1, at 90% of the cache's lifetime or 10 seconds early, whichever is sooner. It does so only when the expected savings are more than the cost. It keeps the 5-minute cache only: no idle warming, no 1h cache, no request with `cacheRetention` none, and no Anthropic thinking set by a token budget. It stops on a real cached request, when the run ends (PiP's too), on an error, at shutdown, or after 30 minutes. A warm request does not wait for a provider limit. Its usage counts in `pi.usage` and in the spend of the person and session that were paying when it started, and spend limits are checked before each warm. A restart drops the warm timers and does not replay warm requests.
|
|
92
92
|
- **Background subagents.** The `subagent` tool spawns named subagents that work in their own conversations while you keep talking. Since 0.28.0 the tool waits for tool search, as `browser` does, so a session that starts none does not pay for its prompt. On a model without tool changes in the messages (all but Claude 4.8 and 5, and later), Pi then starts subagents from a codemode script: the conversation shows each start as a line of that script, without the subagent's card, and the subagents board still opens each one. Pi writes its tasks for subagents in the language of the person it works for, in ASD-STE100 (Simplified Technical English) when it is English (since 0.19.0; in other languages since 0.28.0), and asks for their reports in that language too. Since 0.20.0, Pi's instructions say when to start one (independent parts of the work, a long or noisy job whose result alone matters, a review or second opinion before it calls work done, or when you ask for subagents or parallel work), when to do the work itself (one or two tool calls, work that needs the conversation), and what a brief holds (the goal, paths, what is known, limits, and the report wanted: answer first, then evidence); the result of a start tells Pi to carry on with its own part. Linked sessions (Agent Teams) get the same kind of guidance: they suit long or separate jobs that you may want to follow, and subagents suit short helpers. Open one to watch it or talk to it. Its answer goes back to the main agent at its next pause (after a tool call; when it is idle, after a moment, so answers that finish together go together); answers that arrive meanwhile wait together and go as one message, shown as a card each, so many subagents cost the main agent one extra turn at most, and wait in its queue as one row: one that arrives while that row waits joins it. A subagent that fails says why, and one that is stopped says so, to the main agent too, so it does not wait for an answer; a message sent to it while it worked, which its failed run never took, is withdrawn, and the main agent is told to send it again. A subagent thinks at the session's level unless Pi names another, of any height, such as a cheap model at its highest (a level its model lacks becomes the nearest lower one it has, or its lowest, and the main agent is told), with an optional tool list. Pi picks no model on its own: until the owner allows models for subagents (**Subagent models** in the Providers sheet), a subagent runs on its session's model, and the subagent tool offers none and refuses one Pi names. Once some are allowed, a subagent runs only on those: with no model named, on the session's model when that is allowed, else Pi must name an allowed one (the refusal lists them, and its instructions show each model's thinking, context window, and price where known, with a line on matching the model to the work); one that is not allowed is refused, as is one whose sign-in expired, with word to tell you rather than pick another. A subagent on a model the owner does not allow (any longer), the session's own included, gets no more work; a level raised by hand in its conversation stays as work is sent. One whose model or provider failed (an expired sign-in, a model that is gone or refused, a quota or rate limit) says so with its model, on its card and in a notice, and the main agent is told to stop and tell you, never to start it again on another model. A subagent's status line shows what the subagent itself cost, with no limit: the limit is its session's (since 0.28.0).
|
|
93
|
-
- **PiP.** The owner's assistant, "Pi in Pocket", over every screen. It stays out of the way until called: Alt+A, the rail's orb, the PiP tile in the places, the launcher, or `/pip` (`/pip what needs me?` asks at once); a small mark shows in the corner only while it works or has something new. It opens as a rounded, shadowed window anchored 16px from the bottom right corner on wide screens (on a short screen it is shorter, never over a session's top bar; on a screen narrower than about 1600 px it covers the right end of a session's message box until it closes) and a sheet from the bottom on phones, over whatever is open, which stays as it was; Esc, back, or a swipe down closes it. PiP looks after the other sessions: it lists and reads them, starts sessions (in a folder, a worktree, with a model) and messages them, stops and archives them, schedules messages there, watches your GitHub repositories and pull requests and acts on what happens there (see Watch a repository), starts sessions in a repository by name (its checkout, or a clone), and follows runs until they end, when a report comes back to it and it says in a line what came of it: pushed as a notification when you are not looking (instead of the session's own "Pi finished", which is held back only while PiP is on, not held back by a spend limit, and following that run, and for a minute after its report), which opens PiP over whatever the app shows. A request to do hands-on work authorizes PiP to start or message the session it needs; you do not have to say “start a session.” PiP delegates to that session's tools instead of refusing because its own tools cannot edit files or run commands. PiP's model and new sessions' default model are separate: if a worker has no model, choose one in that session. Menu → Default model sets the model for future sessions. It is dependable before fast: it acts on a session (messages, stops, archives, follows its run, schedules there, or watches its PR) only after it looked at it in the last 15 minutes (read it, started it, or had a report from it), its tools say how a session stands after they act, and it says what it checked and what it did not; tasks it sends that touch code ask for the checks and tests. It never picks a model: which one is yours to say, as below. A session's last answer comes to PiP, in a report or a read, in parts of up to 12,000 characters; when it is cut, a note after the fence says how many characters are left, and PiP's `session_read` tool takes `answerFrom` (a character) to read the rest of that answer, part by part. What sessions say reaches PiP fenced as data, never as instructions, and what sessions, guests, or GitHub named (titles, waiting calls, scheduled messages, PR titles) comes on one line, quoted, as data too. It makes at most 60 messages, follows, schedules, and watches (its reminders to itself included; a schedule it could not make does not count), and starts at most 20 sessions, an hour (counted since the server started). It can deny a call waiting for approval, never allow one. When one of its own calls waits for approval, the panel says so, and **Review** opens its conversation, where it can be allowed. What it sends shows as sent through PiP for you; it reads files but changes none and runs no commands, handing hands-on work to sessions. It writes what other agents read (its messages to sessions, scheduled messages, and the instructions of its watches) in its person's language: ASD-STE100 (Simplified Technical English), at about 80% adherence, when it is English (since 0.19.0), the same short, plain style in another (since 0.28.0), so a session it worked in reads in your language; it asks each session to answer it in the same language and style, and a session answers a message that came through PiP (scheduled ones too) in the language of that message. PiP's answers to you stay as they were. Your messages are accent bubbles, and one you send while it works shows at once, dimmed, with when PiP reads it (at its next pause, or when it finishes for a queued one) and **Withdraw**, until PiP takes it; completed steps have small green checks, and reports are rounded cards that expand to show more. Its replies link the sessions they name; **
|
|
94
|
-
- **Resize.** At widths of 768px and above, drag PiP's left edge, top edge, or top-left corner to resize it, with the bottom-right corner fixed. The same zones are finger-sized on touch screens. Its size is remembered for each account in this browser and fits back inside the viewport when it shrinks. Phones use a bottom sheet with rounded top corners and a grabber; the model, context meter, and all
|
|
95
|
-
- **Choose PiP's model.** Tap the model chip in PiP's header to use the existing model and thinking picker for PiP alone, from Home or over a session. The chip and picker choices are disabled while PiP works. Saving also checks that PiP is idle. This header path does not change the last picked model for new sessions;
|
|
96
|
-
- **Files and images in chat.** Pick files with the attach button, paste files or images from the clipboard, or drop them into PiP's message box. Remove attachments before sending; upload status shows while they are saved. You can send files with text or on their own. They belong to PiP's conversation, not the session behind the panel. Images have previews and open full screen; other files show their names. As in normal chat, supported images go directly to an image-capable model and other files are given as saved paths. PiP does not choose a different model for you. Draft attachments stay when you close and reopen the panel.
|
|
97
|
-
- **Pending memories.** The **Pending memories** strip above PiP's
|
|
93
|
+
- **PiP.** The owner's assistant, "Pi in Pocket", over every screen. It stays out of the way until called: Alt+A, the rail's orb, the PiP tile in the places, the launcher, or `/pip` (`/pip what needs me?` asks at once); a small mark shows in the corner only while it works or has something new. It opens as a rounded, shadowed window anchored 16px from the bottom right corner on wide screens (on a short screen it is shorter, never over a session's top bar; on a screen narrower than about 1600 px it covers the right end of a session's message box until it closes) and a sheet from the bottom on phones, over whatever is open, which stays as it was; Esc, back, or a swipe down closes it. Appearance → **PiP → Board** (Floating is the default, per browser) opens PiP's own conversation in the session's place instead, as a session: its top bar with the model, its menu, every step, and a × at the end of the bar, with PiP's own message box at the session's width (the panel's box, without a session box's slash commands, @ mentions, ↑ history, or Steer and Interrupt). The sidebar stays, the rail's orb shows it open, and every way in opens it there; back, its ×, or the orb again gives the place back to what was there (home after a notification's link), and Running now, the subagents board, an extension's page, or another session simply take its place. Changing the setting while PiP shows moves it to the new place. PiP has one message box, so a move changes nothing in it: the same words, files, passage to ask about (Ask PiP), and message on its way show in both places. PiP looks after the other sessions: it lists and reads them, starts sessions (in a folder, a worktree, with a model) and messages them, stops and archives them, schedules messages there, watches your GitHub repositories and pull requests and acts on what happens there (see Watch a repository), starts sessions in a repository by name (its checkout, or a clone), and follows runs until they end, when a report comes back to it and it says in a line what came of it: pushed as a notification when you are not looking (instead of the session's own "Pi finished", which is held back only while PiP is on, not held back by a spend limit, and following that run, and for a minute after its report), which opens PiP over whatever the app shows. A request to do hands-on work authorizes PiP to start or message the session it needs; you do not have to say “start a session.” PiP delegates to that session's tools instead of refusing because its own tools cannot edit files or run commands. PiP's model and new sessions' default model are separate: if a worker has no model, choose one in that session. Menu → Default model sets the model for future sessions. It is dependable before fast: it acts on a session (messages, stops, archives, follows its run, schedules there, or watches its PR) only after it looked at it in the last 15 minutes (read it, started it, or had a report from it), its tools say how a session stands after they act, and it says what it checked and what it did not; tasks it sends that touch code ask for the checks and tests. It never picks a model: which one is yours to say, as below. A session's last answer comes to PiP, in a report or a read, in parts of up to 12,000 characters; when it is cut, a note after the fence says how many characters are left, and PiP's `session_read` tool takes `answerFrom` (a character) to read the rest of that answer, part by part. What sessions say reaches PiP fenced as data, never as instructions, and what sessions, guests, or GitHub named (titles, waiting calls, scheduled messages, PR titles) comes on one line, quoted, as data too. It makes at most 60 messages, follows, schedules, and watches (its reminders to itself included; a schedule it could not make does not count), and starts at most 20 sessions, an hour (counted since the server started). It can deny a call waiting for approval, never allow one. When one of its own calls waits for approval, the panel says so, and **Review** opens its conversation, where it can be allowed. What it sends shows as sent through PiP for you; it reads files but changes none and runs no commands, handing hands-on work to sessions. It writes what other agents read (its messages to sessions, scheduled messages, and the instructions of its watches) in its person's language: ASD-STE100 (Simplified Technical English), at about 80% adherence, when it is English (since 0.19.0), the same short, plain style in another (since 0.28.0), so a session it worked in reads in your language; it asks each session to answer it in the same language and style, and a session answers a message that came through PiP (scheduled ones too) in the language of that message. PiP's answers to you stay as they were. Your messages are accent bubbles, and one you send while it works shows at once, dimmed, with when PiP reads it (at its next pause, or when it finishes for a queued one) and **Withdraw**, until PiP takes it; completed steps have small green checks, and reports are rounded cards that expand to show more. Its replies link the sessions they name; **Board** (above) shows every step, and **Start fresh** gives it a new context. The panel's header measures context against PiP's compaction limit, capped at the model's context window (or just that window with **As sessions do**), and follows changes in Extensions; **Compact** there (or `/compact`, or `/compact` with what to keep in mind, typed to PiP) turns its older messages into a short summary, the newest few kept as they are; and by default it compacts when a session would, at Pi's own thresholds (since 0.22.0; before, above 60k tokens). To keep it smaller, the owner picks 40k, 60k, or 100k in Extensions under PiP (`pipCompactAt` in `~/.pi-pocket/config.json`): then it compacts itself once idle above that, and waits for 8k tokens more before it does again, while a session's thresholds stay as a backstop during a long run. An owner who chose a limit before keeps it. PiP's summary is its own: written from its conversation with what sessions said, webhooks' posts, GitHub's events, and what files and scripts gave back left out, so none of their words come back as PiP's notes; it keeps its person's preferences, what is still open, and what it follows and watches, which live on the server and carry on as they were. A summary that cannot be written leaves the context as it was: Compact's notice says why, and after one of PiP's own that failed it waits 30 minutes, or 8k tokens more, before it tries again. A summary costs a request, counted in PiP's spend. It is a conversation of its own, kept out of the session list and out of everyone else's reach (nobody else can open it or write to it), and durable like the rest: follows outlive a restart. Its cost shows in its person's Spend sheet, and its follows in Running now. Turn it off in Extensions: it stops what it was doing (a compaction too), takes no messages, its own conversation's box included, and meanwhile its follows' reports and its own scheduled messages wait, webhooks to it answer 503, and repository watches to it hold what they found, all going on once it is back. PiP follows its owner's standing instructions in `pip.md` in the data folder (since 0.28.0, [customizing.md](customizing.md#pips-instructions)).
|
|
94
|
+
- **Resize.** At widths of 768px and above, drag PiP's left edge, top edge, or top-left corner to resize it, with the bottom-right corner fixed. The same zones are finger-sized on touch screens. Its size is remembered for each account in this browser and fits back inside the viewport when it shrinks. Phones use a bottom sheet with rounded top corners and a grabber; the model, context meter, and all three header actions stay available.
|
|
95
|
+
- **Choose PiP's model.** Tap the model chip in PiP's header to use the existing model and thinking picker for PiP alone, from Home or over a session. The chip and picker choices are disabled while PiP works. Saving also checks that PiP is idle. This header path does not change the last picked model for new sessions; as a board, the top bar's model keeps a session's behavior. With no model, the welcome offers **Choose a model to use these suggestions**, which opens the same picker. Suggestions that send at once wait for a model; those that put text in the box stay usable, and choosing a model keeps the suggestions visible.
|
|
96
|
+
- **Files and images in chat.** Pick files with the attach button, paste files or images from the clipboard, or drop them into PiP's message box. Remove attachments before sending; upload status shows while they are saved. You can send files with text or on their own. They belong to PiP's conversation, not the session behind the panel. Images have previews and open full screen; other files show their names. As in normal chat, supported images go directly to an image-capable model and other files are given as saved paths. PiP does not choose a different model for you. Draft attachments stay when you close and reopen the panel, or move PiP to the other place.
|
|
97
|
+
- **Pending memories.** The **Pending memories** strip above PiP's message box (in the floating panel, and above its box when PiP opens as a board) shows how many lessons wait for your approval across all projects and everywhere; with none waiting it does not show. Tap it for the approval list, a sheet as tall as the Memory sheet; **Menu → Memory** in a session lists that project's lessons and the ones to approve there. Open it from any screen, including Home, to approve or discard new lessons and proposed edits or forgetting. Each says where it applies; approval still checks that the words match what you saw. This queue is the owner's only. Pi and guests cannot use it to approve lessons or reach another project's memory.
|
|
98
98
|
- **It never picks a model.** It starts a session on one, or names one in a task, only when you named that model yourself, and not one whose sign-in expired:
|
|
99
99
|
- in your own words to it, in its current context, with the whole name in one message. A name beside Chinese, Japanese or Korean text needs no extra spaces. A short name of two characters, like "K3", counts only with its family's name in the same message, "Kiwi's K3": alone, it reads as an ordinary code. A whole model name or id of two characters needs its provider in that message too: "o3 on openai", not just "o3".
|
|
100
100
|
- or in the instructions of the webhooks and watches to it that you set up. A watch PiP set up, a webhook's post, a watch's event, or what a session wrote does not count.
|
|
@@ -126,7 +126,7 @@ The full tour. For setup, see the [README](../README.md).
|
|
|
126
126
|
- **Updates.** Menu → **Update Pi Pocket** (or the launcher) shows the running version, the newest release with its notes, and **Update to … and restart**; a notice says once when a new version is out. The owner's alone. Under the version, the sheet shows the checkout's branch and commit, **installed with npm (global)**, **installed with npm (local)**, or **run with npx**. For npm installs, Pi Pocket asks the npm registry's `latest` tag for the newest published version 2 minutes after the server starts and every 6 hours after, and GitHub for that version's release notes (`PI_POCKET_UPDATES_REPO` names another repository). A git checkout asks GitHub for the newest release (or the repository's version tags, without notes) and downloads its commit into the checkout under a ref of its own, `refs/pocket-update/target`. An update from a git checkout needs a checkout that the server's user can write, run by the launcher (`npm start`), with no changes that are not committed and no commits the release lacks, and a Node.js the release runs on; the sheet says which of these stands in the way, and an ignored file of yours where the release has a file stops it too. It installs the release's packages beside the checkout first (`npm ci` in `.pocket-update/staging/`, only when the lock file names other packages), stops loading edited files, puts the packages in place, moves the branch forward to the release's commit (a detached checkout moves detached), and restarts. **A global npm install** updates from the app too, when the server's user can write the folder that holds the package and the launcher runs the server: Pi Pocket installs the exact published version into a staging folder beside the package, swaps it in place of the running copy, and restarts, with the copy before kept next to it. If the machine stops at the very moment of the swap, `pi-pocket` may not start: `npm install -g pi-pocket` puts it back. A **local** npm install (in a project's `node_modules`) and a copy **run with npx** do not update from the app: the sheet lists what stands in the way, with the server's hint of what to run instead (`npm install pi-pocket@latest` in the project, or `npx pi-pocket@latest`), and the update button stays off. The owner runs the command and restarts. Running work continues through a restart, but a tool call the restart cuts off comes back as interrupted, and the sheet says when Pi works. When the new version does not start, the launcher puts the files before back and starts that (a git checkout puts the commit and packages back; a global npm install swaps the kept copy back, with no network), and the sheet and a notice say what happened; after the next look the sheet offers that version again, for the owner to try again. A release whose notes have a `[!WARNING]` or `[!CAUTION]` alert needs a tick that you read it, and is not undone by itself, since it may change data one way; so does a release whose notes Pi Pocket could not read because GitHub did not answer (the registry or the tag gave the version, with no notes), since they may have such an alert: read them on GitHub. Under Menu → Extensions → Installed → **Pi Pocket updates**: **Look for new versions** (on), **Install new versions by themselves** (off), and **Beta updates** (off). **Beta updates** (since 0.27.0) also offers pre-releases, tagged `vX.Y.Z-beta.N` (GitHub releases marked as pre-release; npm's `beta` dist-tag): a git checkout takes the highest version among GitHub's non-draft releases (or the beta tags, when GitHub does not answer), and an npm install the newer of the `latest` and `beta` dist-tags. A beta is marked **Beta** in the sheet, the menu hint, and the notice, and its caution says that it may have bugs. With the setting off nothing changes: only stable releases are offered, a beta is never offered, and a running beta still gets the next stable release (`0.27.0` is newer than `0.27.0-beta.N`, and `0.27.0-beta.2` is newer than `0.27.0-beta.1`) but never an older one. Turning it off drops a beta found before. An install by itself also takes a beta, when both settings are on. A server from before 0.27.0 needs a restart (menu → Restart server) for the setting to work. An install by itself waits until no session has worked for 10 minutes, and again after its packages install; it never takes a release with a warning or without notes, or one that failed before (did not start, or did not install). A launcher started before this feature restarts but does not go back, and cannot update a global npm install at all (the sheet says so): quit Pi Pocket and start it again once.
|
|
127
127
|
- **OpenAI-compatible endpoints.** The owner adds an endpoint from the **OpenAI Compatible** row of the Providers list (**Add**; searching "ollama", "local", or "custom" finds it): a name, a base URL (`http://localhost:1234/v1`), and an API key, or **No key** for a local server. **Find models** asks the endpoint's `GET /models` and lists what it has, each with a checkbox; a model ID can also be typed by hand, and either way it is added. **Save** writes the endpoint into Pi's `~/.pi/agent/models.json` (made, with `~/.pi/agent/`, when missing) and keeps the key in Pi's sign-ins (`auth.json`), so its models show in the model menu at once, with no restart. Each endpoint is a row of the list like any provider, with **Edit** (an empty key keeps the saved one; models can be found again with the saved key, at the same address only) and **Remove** (which removes its key too). Pi Pocket rewrites `models.json` only when it is plain JSON that Pi accepts, and keeps the fields that it does not set; a file with comments or trailing commas is left alone, with a message.
|
|
128
128
|
- **Refresh models.** The owner can tap **Refresh models** in the menu (under App) or the Providers sheet (the refresh button beside the Subagent models heading), or run **Refresh models** from the Ctrl/⌘+K launcher. The same controls work on phones. Refresh reloads `models.json` and Pi’s sign-ins, and asks configured providers for fresh catalogs. The menu's row says when it is refreshing, and a notice gives the added and removed model counts, without closing the menu; the Providers sheet also shows the errors for individual providers. All connected tabs receive the updated list. Healthy providers finish independently of slow ones; each provider has an eight-second limit. Running sessions keep their chosen models. A local model must be configured in `models.json` or registered by a Pocket-compatible extension: refresh does not load regular Pi CLI extensions or discover arbitrary local servers.
|
|
129
|
-
- **Uploads.** In normal chat and PiP, attach files with the picker, paste files or images, or drop them into the message box. Files are saved on the server for the conversation you send to and their paths are given to the agent; supported images also go straight to models that accept them. That includes HEIC and HEIF photos (from an iPhone, say), which the server converts to JPEG for the model in a worker, one photo at a time, with limits of 30 seconds and 64 million pixels (a photo that big needs about 1 GB of memory while it converts), so a broken or huge photo gets a notice and does not hold up the server; the original stays in the session's uploads. When the image the model gets differs from the file, its line in the message says so: the format when it changes (`[Image: shown to you as JPEG.]`, always for a HEIC photo), and, in the words of Pi's `read` tool, the original size, the shown size, and the multiplier when it is made smaller. An image that does not change gets no note. A sent HEIC photo shows in the chat and in PiP as the JPEG the model got; when the model did not get one (a model without images, or a failed conversion), or when Pi Pocket cannot be sure which image is the photo's (the message names an image with `@`, or another attached image failed), it shows as a file. An image starts to be made ready for the model as soon as it uploads, so a send seldom waits for it. In a session's message box (not PiP's), attached files stay across a reload, as the draft does, and leave with your sign-out; while a message is on its way, the box dims and holds what it sends, and if the send fails, it is all there to send again.
|
|
129
|
+
- **Uploads.** In normal chat and PiP, attach files with the picker, paste files or images, or drop them into the message box. Files are saved on the server for the conversation you send to and their paths are given to the agent; supported images also go straight to models that accept them. That includes HEIC and HEIF photos (from an iPhone, say), which the server converts to JPEG for the model in a worker, one photo at a time, with limits of 30 seconds and 64 million pixels (a photo that big needs about 1 GB of memory while it converts), so a broken or huge photo gets a notice and does not hold up the server; the original stays in the session's uploads. When the image the model gets differs from the file, its line in the message says so: the format when it changes (`[Image: shown to you as JPEG.]`, always for a HEIC photo), and, in the words of Pi's `read` tool, the original size, the shown size, and the multiplier when it is made smaller. An image that does not change gets no note. A sent HEIC photo shows in the chat and in PiP as the JPEG the model got; when the model did not get one (a model without images, or a failed conversion), or when Pi Pocket cannot be sure which image is the photo's (the message names an image with `@`, or another attached image failed), it shows as a file. An image starts to be made ready for the model as soon as it uploads, so a send seldom waits for it. In a session's message box (not PiP's), attached files stay across a reload, as the draft does, and leave with your sign-out; while a message is on its way, the box dims and holds what it sends, its words, files, and quote, which no key, dictation, or × changes until it went (in PiP's box too, which empties as it sends), also when it shows again meanwhile (you went to another place and came back), so it cannot go twice; text sent to the box meanwhile (Send to Pi) goes in once it went or failed, and so does a queued message taken back with Edit, kept meanwhile in the browser, also through a reload or a move; the same words and files sent again after a lost answer, also after a reload, find the message that went instead of making a second; once you change them, or after an answer that said it was refused or failed, they go again; if the send fails, it is all there to send again, with its quote.
|
|
130
130
|
- **Code in your messages.** In a message you send, `` `code` `` and a fence of ` ``` ` lines show as code, the way Pi's replies show it, colored when the fence names a language (` ```js `). A span closes with as many backticks as opened it, a fence's lines stand on their own, and a stray or unclosed one stays text. Nothing else is formatted: `*`, `#`, lists, and spacing stay as typed, and @mentions outside code stay buttons. Only the display changes: Pi, exports, and ↑ get the message as written.
|
|
131
131
|
- **Rich replies.** Code blocks in Pi's replies show their language and a Copy button, with syntax colors for the common languages (no dependencies, so it works offline), and a block of more than 40 lines folds until you ask for the rest. Some show more than code, with the code a tab away: an `html` block (or a reply that is a whole page) is previewed as a page, inline, with its scripts off and nothing loaded from anywhere; **▶ Run** runs its scripts in the artifacts' sandbox, where it can reach the internet but not the app; an `svg` block is drawn as an image (tap it for full screen); and a `diff` or `patch` block opens in the diff viewer. While Pi is still writing, they show as code. Write cards color the file they write, and the file viewer previews `.html` files the same way, with Run. **Cards in the reply.** An `artifact` call with `inline: true` (an `artifact_inline` call, in a session from before 0.28.0) shows as a card in the reply, as the `html` block above with the artifact's name and version in its bar, an **Open** button for the artifact viewer at that version, and the same Preview/Code and Run/Stop; a failed, denied, or stopped call shows as a step with its reason instead. The result records the version its call made, so each card keeps showing its own: an update by Pi adds a new card, and earlier cards, in this session and a fork, do not change. A card's page is read from the artifact's own address, so whoever can see the session sees the card, a viewer and someone invited to this session alone included, and each can Run it. Once run, its page gets what an artifact's does: a follow-up for the message box (a notice for a viewer) and saved state under the artifact's id, shared with the viewer. A preview grows to fit the page, up to 1200 px, and a running page up to 900 px, then scrolls inside. On a phone the bar takes two lines. A viewer already open on an older version stays on it and offers "latest is vN" after an update. Only a call Pi makes itself is a card: one made inside a codemode script is one of its nested calls, and in PiP's panel the call is a line among its steps.
|
|
132
132
|
- **Images inline.** Attached images show as thumbnails (also in the composer before you send). When Pi writes `` with a path on the server (absolute, `~/…`, or relative to the session's folder), the image shows in its reply. Images a tool returns and SVG artifacts show inline too; an image Pi reads with `read` (often one you just sent) shows only when its call is opened, so it is not on screen twice. Tap any image to see it full screen. Only real image files are shown: the server checks a file's bytes, not just its name.
|