Skip to content

Pi Pocket 0.26.0

Latest

Choose a tag to compare

@TannerMidd TannerMidd released this 27 Oct 23:05
5e13a8b

Pi Pocket gets Design mode: a canvas beside the chat where you point at a design, comment, edit, tweak, and export. An npm install now updates itself from the app, and long tool calls stop costing a fresh prompt cache.

Important

To update: a git checkout: Menu → Update Pi Pocket. A global npm install on 0.25.0: run npm install -g pi-pocket@latest once by hand. Then, either way, quit Pi Pocket and start it again once, so the launcher can roll back npm updates. Details under Updating.

Highlights

  • Design mode. A canvas beside the chat where you point at a part of a design, comment, edit text, tweak it live, compare versions, and export. Pi checks its own work first.
  • npm installs update from the app. Menu → Update Pi Pocket installs the newest version npm has, restarts, and goes back to the version before by itself if the new one does not start.
  • The prompt cache stays warm during long tool calls. A Claude session waiting on a slow command no longer pays to write its whole prompt cache again when the command ends. Fixes #180 (by @Haichiu)
  • Artifacts can carry files. Images, fonts, styles, scripts, data, and more pages load in the viewer, in an inline card, in an artifact's own tab, and in a shared link.

New

  • Design mode. Pi's HTML designs (prototypes, screens, one-pagers, slide decks) open on a canvas beside the chat, at phone, tablet, and desktop sizes. Open it from the rail, the places, Open in Design in the artifact viewer, or /design-open.
    • Comment: tap an element, write a note, and it becomes a pin. Comments are shared with the session and last across restarts. Send to Pi puts them all in your message box.
    • Edit text in the page itself, and Tweaks: sliders, colors, and switches that change the design live, kept for each person. Pi writes the changes into a new version when you ask.
    • Versions: a timeline, side-by-side compare, and Go back to this one, which makes a new version without asking Pi.
  • Variations and decks. Variations of one design show as a grid, and Use this one tells Pi which to carry on. A deck gets a slide strip and a full-screen present mode.
  • Pi checks its designs. Before it replies, Pi renders a design at phone and desktop sizes in a private browser and fixes the errors it finds. The browser you watch stays out of it.
  • Export. PNG, PDF, PowerPoint (for decks), and an HTML zip, saved in the session's exports/ folder and downloaded from the canvas. PowerPoint slides are images, with the slide text as notes.
  • Project design systems. Pi reads a codebase or brand files you point at, writes the rules to .pi/design-system.md in the session's folder, and follows them in later designs.
  • Bundles for artifacts. An artifact version can hold up to 200 files, 5 MB each and 20 MB in all. A new version keeps the files of the last one. Pages can link to each other, and a shared link serves the files too. Old artifacts work as they did.
  • In-app updates for global npm installs (npm install -g pi-pocket).
    • The newest version comes from npm itself, so the app never offers a release npm does not have yet. The notes still come from GitHub.
    • The new version is downloaded next to the running one first, then swapped in, so a failed download changes nothing.
    • If the new version does not start, the launcher puts the old one back without the network.
    • Same rules as a git update: the owner's alone, a confirmation for notes that warn, no update while Pi works, and the optional automatic updates.
  • Prompt cache warming. While a run waits on a tool call, Pi Pocket refreshes the model's prompt cache just before it expires, when that costs less than writing it again.
    • Each refresh counts in the session's usage and spend, and nobody past a spend limit gets one.
    • It stops when the run ends, after 30 minutes, or when the prompt would no longer match the cache.
    • On by default. PI_POCKET_CACHE_KEEPER=off turns it off. (#180, by @Haichiu)
  • Keep activity folded. A switch in Appearance → Conversation keeps Pi's thinking and tool calls on their one line until you open them, also while Pi works. Off by default. (#175, by @Haichiu)
  • The update sheet says how Pi Pocket was installed: a git checkout, an npm install (global or local), or npx. A local install and npx show the command to run instead of the button.

Improved

  • Subagents work in plan mode. Pi can send subagents to explore while it plans. They follow plan mode too: they read, and writes stay blocked until you approve. (#181, by @piromagnus)
  • The date is out of the system prompt by default, so a session that runs past midnight keeps its prompt cache. PI_POCKET_PROMPT_DATE=1 puts it back, as the local date. PiP keeps its date. Fixes #178 (#179, by @Haichiu)
  • The sign-in link follows --host. A server started on another loopback address, or on localhost, now prints and opens a link that works.
  • The folded sidebar marks sessions with background tasks with a dashed line under their number.
  • Background task times read "10m 00s", as the rest of the app writes them.

Fixed

  • One bad compaction setting no longer resets the others. An invalid value in Pi's compaction settings used to drop all of them, which turned compaction back on even when it was off.
  • The background count after a restart. With the Background tasks extension off, a task whose process had died no longer counts as running.
  • A warning late in long release notes now counts, so such a release still asks first and is not rolled back by itself.

Known limits

  • The static preview of an inline card shows no bundle files until you tap Run.
  • The inspector adds about 36 KB to each HTML artifact page.
  • A second page inside the frame, or a page that navigates itself, has no bridge. Comments, edits, and tweaks go quiet there.
  • Shadow DOM and nested iframes cannot be picked.
  • A comment shows only on the version it was made on.
  • There is no Canva export.

For theme and extension authors

  • Artifact tools. artifact and artifact_inline take assets, removeAssets, group, and kind (page or deck). ArtifactVersion has an optional assets map, and ArtifactMeta has optional group and kind. Assets are stored once for each content hash in the new pocket.artifact-asset documents. (experimental)
  • New built-in tools and module. design_preview, design_export, and design_system belong to the design module. A drop-in cannot use these names. Plan mode allows design_preview, and now subagent; a subagent started in plan mode starts in it.
  • New stored kind. pocket.design-comments holds a design's comments, each person's tweaks, and the versions made by going back.
  • Routes. POST /api/x/design/c/:conversation/export writes an export and answers { path, relative, name, size }; Take turns holds it. The core route GET /api/c/:id/download?path=<relative> streams a file of the session folder as an attachment for the people that the file viewer lets read it. /pub/<token>/<name> serves a shared bundle's files, and src/server/http/public.ts is gone.
  • Asset addresses. A private page reaches its assets through a signed address that lasts 12 hours. It permits only the version's files.
  • The bridge. The app sends pocket-inspect, pocket-edit-text, pocket-tweak-set, pocket-highlight, and pocket-goto to the page. The page answers with pocket-picked, pocket-text-edited, pocket-tweaks, and pocket-deck, only from the inspector, and the app checks each one. web/artifact-bridge.js exports useArtifactBridge, attachBridge, sendToFrame, checkPageMessage, and checkAppMessage. (experimental)
  • Page markup. data-pid names an element. <script type="application/json" id="pocket-tweaks"> declares up to 40 knobs; a name that starts with -- sets that CSS custom property, and any other name fires pocket:tweak on window. A deck is <meta name="pocket-kind" content="deck"> with <section class="slide"> slides at 1920×1080, or the size in <meta name="pocket-slide-size" content="WxH">. (experimental)
  • pocket.pip.ask(text, { send }) gives the person's PiP a message from a browser module: a draft in PiP's box by default, or sent at once right after the person's tap. Without PiP it answers { ok: false }. Fixes #176 (reported by @piromagnus) (experimental)
  • host.updates status has a new installKind field: git, npm-global, npm-local, npx, or unknown.
  • New class has-background on a folded rail session tile (.ws) that runs background tasks.

Updating

  1. A git checkout: Menu → Update Pi Pocket, or pull and restart.
  2. A global npm install on 0.25.0: run npm install -g pi-pocket@latest. From 0.26.0 on, the app updates it.
  3. Then, once: quit Pi Pocket (q in its terminal, or stop its service) and start it again, so the launcher that runs it can roll back an npm update. Until then, the update sheet of an npm install says so.

The update sheet for npm installs needs write access to npm's global folder. A system install that needed sudo keeps showing the command to run.

How this release was checked
  • Code review in 7 rounds. The final round split Design and the whole release into 5 areas (bundles, the bridge, the workspace, the agent side, release hygiene), then fresh reviewers checked every fix. They found 1 blocker and 6 major bugs across the release, all fixed with a test that fails on the old code.
  • npm updates end to end through a private npm registry: an update from the sheet, a broken version rolled back with no network, a release that warns, an automatic update, and local, npx, read-only, and real 0.25.0 launcher installs.
  • Live tests on isolated copies: Design end to end as owner, viewer, and with Take turns, at 320 to 1920 px; bundles in the viewer, inline cards, own tabs, and shared links; the design tools and exports (opened in LibreOffice); and the core flows.
  • A real-model pass with Claude Haiku 5.5: tools, a design made and checked by Pi, a tweak written back, and cache warming during a long tool call. Type check, lint, format, and 898 tests pass.
  • PR #181 (subagents in plan mode) came in after the live tests, with its own tests and a fresh review of how plan mode reaches subagents.
  • Not tested: PowerPoint and Keynote, Safari and real phones, Windows and macOS, pnpm, yarn, and Volta installs, and a power loss in the instant that the two package folders swap (npm install -g pi-pocket restores it).

Thanks to @Haichiu for cache warming, the prompt date fix, and Keep activity folded, and to @piromagnus for subagents in plan mode and for asking for a PiP API.

Full changes: v0.25.0...v0.26.0