pi-pocket 0.28.0-beta.9 → 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 +1 -1
- package/docs/extensions/reference/api-versions.md +4 -0
- 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/features.md +1 -1
- package/docs/map.md +47 -42
- package/docs/systemd.md +2 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/server/design/system.ts +7 -0
- package/src/server/main.ts +15 -0
- package/types/pocket.d.ts +1 -1
- package/web/browser-panel.js +13 -25
- package/web/extension-ui.js +15 -1
- package/web/files-panel.js +13 -24
- package/web/history.js +1 -4
- package/web/person-storage.js +60 -2
- package/web/running-board.js +3 -2
- package/web/session-cache.js +26 -2
- package/web/sessions.js +501 -207
- package/web/store.js +3 -0
- package/web/style.css +111 -32
- package/web/transcript.js +158 -15
- package/web/ui.js +100 -24
- 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
|
@@ -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
|
|
|
@@ -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 |
|
|
@@ -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/features.md
CHANGED
|
@@ -31,7 +31,7 @@ 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.
|
package/docs/map.md
CHANGED
|
@@ -57,46 +57,48 @@ A module split into parts keeps its name for the part others import, with the re
|
|
|
57
57
|
|
|
58
58
|
### What people ask of Pi
|
|
59
59
|
|
|
60
|
-
| File
|
|
61
|
-
|
|
|
62
|
-
| `commands.ts`
|
|
63
|
-
| `resend.ts`
|
|
64
|
-
| `extension-commands.ts`
|
|
65
|
-
| `subagent-runs.ts`
|
|
66
|
-
| `shell.ts`
|
|
67
|
-
| `background.ts`
|
|
68
|
-
| `schedules.ts`, `when.ts`
|
|
69
|
-
| `goals.ts`
|
|
70
|
-
| `titles.ts`
|
|
71
|
-
| `prompts.ts`
|
|
72
|
-
| `pi-sessions.ts`
|
|
73
|
-
| `skills.ts`
|
|
74
|
-
| `model-images.ts`
|
|
75
|
-
| `heic.ts`
|
|
76
|
-
| `models.ts`
|
|
77
|
-
| `model-facts.ts`
|
|
78
|
-
| `project-model.ts`
|
|
79
|
-
| `model-names.ts`
|
|
80
|
-
| `running.ts`
|
|
81
|
-
| `pip.ts`
|
|
82
|
-
| `compaction.ts`
|
|
83
|
-
| `pip-compact.ts`
|
|
84
|
-
| `watches.ts`
|
|
85
|
-
| `hooks.ts`
|
|
86
|
-
| `repo-watches.ts`
|
|
87
|
-
| `github.ts`
|
|
88
|
-
| `memory.ts`
|
|
89
|
-
| `folder-favorites.ts`
|
|
90
|
-
| `share.ts`
|
|
91
|
-
| `public-links.ts`
|
|
92
|
-
| `hidden.ts`
|
|
93
|
-
| `extension-points.ts`
|
|
94
|
-
| `app-events.ts`
|
|
95
|
-
| `extension-settings.ts`
|
|
96
|
-
| `artifact-state.ts`
|
|
97
|
-
| `reveal.ts`
|
|
98
|
-
| `extension-sessions.ts`
|
|
99
|
-
| `
|
|
60
|
+
| File | Owns |
|
|
61
|
+
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| `commands.ts` | What people ask of Pi: sessions, messages (with skills, templates, and mentioned files expanded), forks and resends, model and folder, reset, instructions, plan mode, goals, schedules, worktrees, notes Pi is told |
|
|
63
|
+
| `resend.ts` | A message sent again: the task made with its fork that sends it |
|
|
64
|
+
| `extension-commands.ts` | Extensions' commands run: who may, a durable task per run that a retry finds and a restart never runs again, cards, and stopping |
|
|
65
|
+
| `subagent-runs.ts` | How a subagent's run ended, in the words its record keeps: for the subagent tool's reports, and for what a person's message to a failed subagent came to |
|
|
66
|
+
| `shell.ts` | `!` and `!!` commands: a background task per command that runs it and writes a `pocket.shell` entry; a restart cuts it off rather than running it again |
|
|
67
|
+
| `background.ts` | Background tasks: commands Pi runs detached, each watched by a durable task until it ends, and their ends go to Pi as one message, steered into the run in flight |
|
|
68
|
+
| `schedules.ts`, `when.ts` | Scheduled messages (a durable task) and their time grammar |
|
|
69
|
+
| `goals.ts` | "Done when" checks |
|
|
70
|
+
| `titles.ts` | A short title for a session with a long first message, or one that runs a skill or prompt template, from the session's own model |
|
|
71
|
+
| `prompts.ts` | Pi's prompt templates as slash commands, and `/skill:name` expanded |
|
|
72
|
+
| `pi-sessions.ts` | Pi's sessions from the terminal (`~/.pi/agent/sessions/`), read and never written: listing them, and one as a new session's history, with Pi's own context of it (compactions, context edits); `commands.continuePiSession` makes the session |
|
|
73
|
+
| `skills.ts` | Which skills a session's folder has, from where Pi's CLI looks and in its order, with Pi's project trust; the system prompt and `/skill:name` both use it. Reads and saves the owner's answer to "trust this project?" |
|
|
74
|
+
| `model-images.ts` | Attached images (HEIC made JPEG) made small enough for the model, with a note when it differs, started as each upload ends so a message that sends them finds them ready |
|
|
75
|
+
| `heic.ts` | A HEIC or HEIF photo as JPEG in a worker (`heic-worker.ts`; `heic-convert.d.ts` types the library), one at a time, with time, memory, and pixel limits |
|
|
76
|
+
| `models.ts` | The models people can pick (marked for Pi’s enabledModels scope and when their sign-in needs renewing), the one a conversation runs with, finding one by name, and the thinking levels |
|
|
77
|
+
| `model-facts.ts` | One short line per model of the owner's list for subagents (thinking, context window, price, which is the session's own) for the `subagent` and `team` prompt sections |
|
|
78
|
+
| `project-model.ts` | Trusted project model/thinking defaults and fresh global-only settings read for each new session, validation, and safe errors; no resource paths or per-project run policy |
|
|
79
|
+
| `model-names.ts` | Which models a text names, word by word: PiP passes or names a model only when its person named it |
|
|
80
|
+
| `running.ts` | Running now, from Pi Durable's task graph, and the Running now board's data (`runningBoard`): the sessions at work with their model and spend, every scheduled message with its next times and whether it is held |
|
|
81
|
+
| `pip.ts` | PiP, the owner's assistant: its conversation (made on first open, kept out of the session list), what its tools do as its person, and the follows (a durable task each) that report to it when a session's run ends |
|
|
82
|
+
| `compaction.ts` | When a session's context is compacted: Pi's compaction settings for Pi Durable, with each model's own values (`compaction.modelOverrides`) |
|
|
83
|
+
| `pip-compact.ts` | PiP's context kept small: when it compacts itself, and its own summaries, written with what came from outside left out and counted in its spend |
|
|
84
|
+
| `watches.ts` | A session's PR watch: the durable task that looks at the PR with `gh` and tells Pi about failed checks, conflicts, and comments that count |
|
|
85
|
+
| `hooks.ts` | Creates, edits, and removes webhooks. Checks each post's secret or GitHub signature, then sends the post to Pi as a message from the hook's creator. |
|
|
86
|
+
| `repo-watches.ts` | Repository watches: PiP's standing orders on a GitHub repository, and the durable task that looks at it and tells PiP or a session what happened |
|
|
87
|
+
| `github.ts` | GitHub through `gh`: running it unattended, repository and PR names in every form, and whether `gh`'s account can push to a repository |
|
|
88
|
+
| `memory.ts` | Memory: lessons Pi keeps across sessions, each for a project (a repository with its worktrees, or a folder) or everywhere; the lessons in force for a session, and people's view, writes, and approvals |
|
|
89
|
+
| `folder-favorites.ts` | Each person's favorite folders (`/api/folder-favorites`): starring and unstarring one in a transaction, and each person's list sent only to their own tabs |
|
|
90
|
+
| `share.ts` | Artifact shares (`/api/c/:id/shares`): publishing one artifact version, or the newest, to anyone with a link, ending it, and what a published token shows now (needs no sign-in); only people who see every session publish or end one A published bundle's files are served by `http/artifact-assets.ts`. |
|
|
91
|
+
| `public-links.ts` | Extension modules' public links (`web.links`): made, listed, and ended for their own module only, each closing at its time or after its uses; a use counts before the page handler runs and comes back when the page refuses the post (needs no sign-in) |
|
|
92
|
+
| `hidden.ts` | Values extensions hide (`host.hide`) from command output as it streams and from every tool's result, and the variables they add to each command (`host.commandEnv`), both through the environment each conversation's commands run in (`wrapEnv`) |
|
|
93
|
+
| `extension-points.ts` | `host.ask`, an extension's question on an approval card whose typed values go to the asker alone, and `host.browser`, a session's page for extensions with `fill` and controls as data, but no script |
|
|
94
|
+
| `app-events.ts` | What happens in the app, for extensions (`host.on`): sessions made, renamed, and archived, messages people send to Pi, and runs that start and end, each after its commit; PiP sends none |
|
|
95
|
+
| `extension-settings.ts` | Settings modules declare (`web.settings`): their fields checked as the module loads, the owner's values checked before config.json keeps them, and what browsers see (never a secret's value) |
|
|
96
|
+
| `artifact-state.ts` | What an artifact's page saves for each person (`/api/c/:id/artifact-state/:artifact`): one JSON value per artifact, person, and session, up to 16 KB, with a schema label that makes older values read as none, and a limit on saves; not in Pi's context, and a fork starts with none |
|
|
97
|
+
| `reveal.ts` | Ctrl+click on a path (`/api/c/:id/reveal`, the owner's): shows it in the file manager of the machine the server runs on, selected in its folder (FileManager1 over D-Bus, else `xdg-open`; `open -R`; `explorer /select,`) |
|
|
98
|
+
| `extension-sessions.ts` | Ordinary sessions an extension starts (`ExtensionSessions`, `host.sessions` as `SessionsApi` in `host.ts`): a top-level session, like New session, for the person Pi works for in the source, with its model and thinking written in that same commit and its first message sent once; the call's record is an item of `LinkedSessionCallsDoc`, written in the commit that makes the session (since 0.28.0) |
|
|
99
|
+
| `entry-presentation.ts` | How a module asks the transcript to show an input it sends (`web.presentEntry`): one line that opens to the text, live while the module is on; nothing is stored (since 0.28.0) |
|
|
100
|
+
| `extension-pi-ai-compat.ts` | The `@earendil-works/pi-ai` that drop-ins get: pi-ai plus TypeBox's `Type` and a `StringEnum`, which pi-ai's main entry dropped in Pi 1.5 (since 0.28.0) |
|
|
101
|
+
| `linked-sessions.ts` | Linked sessions (`LinkedSessions`, `host.linkedSessions` as `LinkedSessionsApi` in `host.ts`): starting a session from another and sending its first message, with a record of the call that makes a repeat find the first; the addresses each session knows its linked ones by; messages between them, sent once, as the person Pi works for, through `Commands.submit`; stopping a run and archiving a session of the team (`stop`, `archive`, since 0.28.0); and a team's bounds (one level; since 0.19.0, no count of sessions or messages) |
|
|
100
102
|
|
|
101
103
|
### Workspace providers
|
|
102
104
|
|
|
@@ -215,12 +217,14 @@ Plain ES modules, loaded as they are. `math.js` finds Markdown math delimiters;
|
|
|
215
217
|
| `back.js` | The back stack: routes and the layers over them (sheets, the drawer, panels that cover the screen, a file over the tree) as history entries, so back closes what opened last; `useBack`, `pushRoute` (with state kept on the entry, read with `routeState`), `popRoute` (back to the route a route was opened over, keeping the layers still open), `goHome`, the list put under a conversation opened straight away, taps let go that land on what just slid in |
|
|
216
218
|
| `gestures.js` | Touch gestures, each following its own finger by its identifier, passive where they can be: sheets dragged down and the drawer dragged left to close (`useDragToClose`); on phones, swipes on the conversation (right back, left Files), in Files (right back), and up from the message box (the places); a swipe in from the left edge goes back in an iPhone's home screen app |
|
|
217
219
|
| `app.js` | Layout (tiled windows, and the subagents board in the conversation's place), top bar (with what changed, from `diff.js`), notices, keyboard shortcuts, routing |
|
|
218
|
-
| `transcript.js` | The conversation as turns: messages, Pi's replies with message times arranged in the reply slot, its thinking and tool calls folded into groups that open into a timeline, extensions' command cards, approvals, the live line (and Pi's thinking above it), breadcrumbs (and `linked-sessions.js`, the links between linked sessions); a message from a linked session shows as its own card (`LinkedMessage`), without its routing words, named after its session from the view's `linkedPeers`
|
|
220
|
+
| `transcript.js` | The conversation as turns: messages, Pi's replies with message times arranged in the reply slot, its thinking and tool calls folded into groups that open into a timeline, extensions' command cards, approvals, the live line (and Pi's thinking above it), breadcrumbs (and `linked-sessions.js`, the links between linked sessions); a message from a linked session shows as its own card (`LinkedMessage`), without its routing words, named after its session from the view's `linkedPeers`. Unsent picks and typed answers on a Pi asks card (never a secret field's) are kept per person through `person-storage.js`, by session and by ask (its id and its call, or when it asked), until Send, Decline, the card leaving, or sign-out; one that ended unseen goes when a card in that session next shows with the server's view of it. |
|
|
219
221
|
| `turns.js` | How the transcript reads a conversation, without drawing it: answers split into runs of words and groups of calls, and each inline call (`artifact` with `inline: true`, or an old `artifact_inline`: `isInlineCall`) as an `inline` item between them (`itemsOf`), a group in a line (`summarize`, with extensions' own tools as `extension-ui.js` gives them: `setCallSummary`), and what a call came to from what its tool printed. No imports, so Node tests it |
|
|
220
222
|
| `calls.js` | A tool call in one line, for the transcript's timeline and peek tiles; extensions' own tools as `extension-ui.js` gives them (`setCallDescriber`) |
|
|
221
223
|
| `slots.js` | Slots: the top bar's buttons, the status line's items, the places, the message box's left buttons, and the actions under answers as named items, the app's own (`defineItem`) and extensions' (`fromExtensions`), in one order: defaults, `before`/`after`, extensions' `pocket.arrange`, then the person's own choices (`prefs().layout`, Appearance → Layout) |
|
|
222
224
|
| `composer.js` | Message box, chips, the queue, plan and goal bars, `@` file suggestions, `!` commands, ↑ and Ctrl+R history, long-paste placeholders, the mic (`voice.js`), a subagent's way back to its session, the status line under it (kept to one row) |
|
|
223
225
|
| `quote-reply.js`, `quote-text.js` | Reply to a passage: the Reply and Ask PiP buttons by a selection in one of Pi's replies, and the quote lines (cut at 1,500 characters) that go before the message |
|
|
226
|
+
| `entry-presentation.js` | How this browser shows an input a module presents (`pocket.entryPresentation`): open, folded, or hidden, kept in this browser |
|
|
227
|
+
| `user-search.js` | What Find searches in a person's message: its presented label and summary, then the text written |
|
|
224
228
|
| `subagents.js` | The subagents bar above the message box: each subagent's state, what it was asked, and what it does now (its peek, through `useOnScreen` in `peeks.js`); Stop, open, put away. Its states and times (`stateOf`, `elapsed`, `ordered`) and failures dealt with (`unresolved`, `dismiss`, `seeFailure`) serve the board too |
|
|
225
229
|
| `agent-now.js` | What a subagent does this moment, from its peek (`nowDoing`): the call it waits to allow, the call it runs, or its words; the subagents bar, the board, and peek tiles all say it |
|
|
226
230
|
| `agent-tile.js` | A subagent at work as a sub-tile (`AgentTile`): its state square, name, state, and what it does now; a click picks it, a double click (or double tap) opens it. Peek tiles nest them, and the board shows them under a session's row |
|
|
@@ -234,12 +238,13 @@ Plain ES modules, loaded as they are. `math.js` finds Markdown math delimiters;
|
|
|
234
238
|
| `commands.js` | Slash commands (the app's own, and extensions'), and prompt templates |
|
|
235
239
|
| `trust.js` | Project trust: the bar that asks the owner whether to trust a session's project for its own skills and its `.pi/settings.json` model defaults, and the sheet (`/trust`, the menu) that shows and changes the answer |
|
|
236
240
|
| `sheets.js` | Which sheet is open, the component that shows it, and the nested-sheet back action supplied to `Sheet` through `SheetBack` |
|
|
237
|
-
| `sheets/*.js` | One sheet (or a few close ones) each: the model and branch pickers, folder, extensions, providers, people and invites, the file viewer (`FileView`, which the Files tile shows too), find, spend, all artifacts (`all-artifacts.js`: every session's artifacts from `GET /api/artifacts`, `PocketApp.artifactOverview`), schedules, webhooks, memory (the lessons Pi keeps, with the menu's hint), worktree, Pi's terminal sessions, appearance, shortcuts, the menu, a session's actions, the extension gallery (`gallery.js`: browsing, an entry, its source, an update, sharing; `galleryAvailable`), with the artifact viewer's **Open in Design** button (`viewers.js`)
|
|
241
|
+
| `sheets/*.js` | One sheet (or a few close ones) each: the model and branch pickers, folder, extensions, providers, people and invites, the file viewer (`FileView`, which the Files tile shows too), find, spend, all artifacts (`all-artifacts.js`: every session's artifacts from `GET /api/artifacts`, `PocketApp.artifactOverview`), a background task's output as it runs (`background.js`), schedules, webhooks, memory (the lessons Pi keeps, with the menu's hint), worktree, Pi's terminal sessions, appearance, shortcuts, the menu, a session's actions, the extension gallery (`gallery.js`: browsing, an entry, its source, an update, sharing; `galleryAvailable`), with the artifact viewer's **Open in Design** button (`viewers.js`) |
|
|
238
242
|
| `peeks.js` | Peek tiles: their switches (the top bar's and the rail's), which sessions get one and in what order (working, waiting, with subagents at work, finished, or pinned), the column and the strip, each tile's subagents at work (the first few as rows, the rest counted, opening the board at them) and their own peeks, the watch list |
|
|
239
243
|
| `seen.js` | What this browser has seen: when it last looked at each session (`markSeen`), which runs ended since (`finishedUnseen`), and the server's clock (`fromServer`). Peek tiles and the session list's squares read it; the list also puts looks back (`seenSnapshot`, `restoreSeen`) when it undoes marking sessions read |
|
|
240
244
|
| `clock.js` | The server's clock as a tab knows it, without the DOM: how far it is ahead of this browser's, fitted to what each hello proves, so a hello handled late (a tab woken from the background) moves no time shown |
|
|
241
245
|
| `text-hash.js` | A short fingerprint of a string, the same in the browser and on the server, which imports it: a tab names with it what it kept of a session (`have`), and the server checks it (`Room.push`) |
|
|
242
246
|
| `session-cache.js` | The sessions a browser keeps on the device (IndexedDB) for all its tabs: saved, read, and dropped by size, the one used longest ago first; `store.js` decides what goes in and checks what comes out |
|
|
247
|
+
| `session-tabs.js`, `tab-order.js` | Session tabs (Appearance): the strip of segments above the top bar, and which sessions it shows and each one's state (`tab-order.js`, no imports) |
|
|
243
248
|
| `chat.js` | People panel: presence roster, take-turns shortcut, chat bubbles, pins, notes; the chat sheet |
|
|
244
249
|
| `notes-drafts.js` | An unsaved edit of a session's notes, and the revision it started from, kept per person through `person-storage.js` until Save, Cancel, or Use theirs, and cleared at sign-out. |
|
|
245
250
|
| `avatar.js` | People's avatars (their picture, else initials) and colors, and folders' colors |
|
package/docs/systemd.md
CHANGED
|
@@ -24,6 +24,8 @@ The access mode also needs its own tools:
|
|
|
24
24
|
- `tailscale`: Tailscale connected (`tailscale up`). Listens on the Tailscale address only.
|
|
25
25
|
- `tailscale-serve`: Tailscale 1.52 or newer, `tailscaled` running, HTTPS certificates enabled in the tailnet, and the service user as its operator (`sudo tailscale set --operator=pi-pocket`, unless the service runs as root). The launcher adds the mapping and removes one it made. It also removes one that a crashed run made, which it knows by its receipt (`serve-mount.json` in the data folder). When it cannot, a start in another mode on that port stops and says how to free it, as the mapping would keep the app on the tailnet. A mapping with no receipt, such as one you made yourself, is left where it is: free it by hand with `tailscale serve --https=443 --set-path=/ off` if you need to.
|
|
26
26
|
|
|
27
|
+
The unit starts after `tailscaled` but does not start it, as the other modes do not need it: for `tailscale` and `tailscale-serve`, keep `tailscaled` enabled.
|
|
28
|
+
|
|
27
29
|
Provider sign-in does not need a terminal: sign in from the app's Providers sheet after the first start.
|
|
28
30
|
|
|
29
31
|
## Install
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-pocket",
|
|
3
|
-
"version": "0.28.0
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-pocket",
|
|
9
|
-
"version": "0.28.0
|
|
9
|
+
"version": "0.28.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@earendil-works/chord": "1.5.0",
|
package/package.json
CHANGED
|
@@ -535,6 +535,13 @@ export function designSystemTool(): ToolRegistration {
|
|
|
535
535
|
});
|
|
536
536
|
|
|
537
537
|
if (args.apply !== true) {
|
|
538
|
+
// An apply of a scan with no style files is refused below: do not offer one.
|
|
539
|
+
if (scan.files.length === 0) {
|
|
540
|
+
return text(
|
|
541
|
+
`${report}\n\nNothing was saved. The scan read no style files in ${path}, so an apply would be refused: point path at the folder with the project's styles.`,
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
538
545
|
const call = JSON.stringify({
|
|
539
546
|
action: "resync",
|
|
540
547
|
apply: true,
|
package/src/server/main.ts
CHANGED
|
@@ -35,6 +35,7 @@ function parseArgs(argv: string[]) {
|
|
|
35
35
|
cwd: process.cwd(),
|
|
36
36
|
data: dataDir(),
|
|
37
37
|
rotateToken: false,
|
|
38
|
+
keepAliveSeconds: Number(process.env.PI_POCKET_KEEPALIVE_SECONDS?.trim() || 5),
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
for (let index = 0; index < argv.length; index++) {
|
|
@@ -74,6 +75,16 @@ function parseArgs(argv: string[]) {
|
|
|
74
75
|
throw new Error("--port must be a number");
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
if (
|
|
79
|
+
!Number.isInteger(options.keepAliveSeconds) ||
|
|
80
|
+
options.keepAliveSeconds < 1 ||
|
|
81
|
+
options.keepAliveSeconds > 3600
|
|
82
|
+
) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
"PI_POCKET_KEEPALIVE_SECONDS must be a whole number of seconds from 1 to 3600",
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
77
88
|
return options;
|
|
78
89
|
}
|
|
79
90
|
|
|
@@ -163,6 +174,10 @@ const server = createServer((request, response) => {
|
|
|
163
174
|
// and long polls are GET requests without a body, so their time on the connection does not count.
|
|
164
175
|
server.requestTimeout = 15 * 60_000;
|
|
165
176
|
server.headersTimeout = 60_000;
|
|
177
|
+
// How long an idle connection stays open for its next request: Node's 5 seconds by default. A reverse proxy
|
|
178
|
+
// that keeps idle connections longer can send a request on one as it closes here, and answers with a 502.
|
|
179
|
+
// The timeouts above count from a request's first byte, not from the idle time before it.
|
|
180
|
+
server.keepAliveTimeout = options.keepAliveSeconds * 1000;
|
|
166
181
|
|
|
167
182
|
// Take the port before opening the database: opening resumes interrupted work, which must not start in a process
|
|
168
183
|
// that then exits because it cannot serve.
|
package/types/pocket.d.ts
CHANGED
|
@@ -1014,7 +1014,7 @@ export interface LinkedSession {
|
|
|
1014
1014
|
* A human-facing linked session that the authenticated person can see.
|
|
1015
1015
|
* @since 0.16.0
|
|
1016
1016
|
*/
|
|
1017
|
-
export interface HumanLinkedSession extends LinkedSession {
|
|
1017
|
+
export interface HumanLinkedSession extends Omit<LinkedSession, "failed"> {
|
|
1018
1018
|
/**
|
|
1019
1019
|
* Its id, for pocket.openConversation. Other metadata keeps LinkedSession's audience rules.
|
|
1020
1020
|
* @since 0.16.0
|
package/web/browser-panel.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
toggleBrowser,
|
|
15
15
|
} from "./browser.js";
|
|
16
16
|
import { api, attempt, canSteer, notify, panelsBeside, store } from "./store.js";
|
|
17
|
-
import { APPLE, html, Icon, Spinner } from "./ui.js";
|
|
17
|
+
import { APPLE, dragWidth, html, Icon, Spinner } from "./ui.js";
|
|
18
18
|
|
|
19
19
|
const WIDTH_KEY = "pocket.browserWidth";
|
|
20
20
|
|
|
@@ -660,31 +660,19 @@ function ResizeEdge() {
|
|
|
660
660
|
}
|
|
661
661
|
|
|
662
662
|
event.preventDefault();
|
|
663
|
-
const
|
|
664
|
-
const right =
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const stop = () => {
|
|
675
|
-
root.classList.remove("resizing");
|
|
676
|
-
removeEventListener("pointermove", move);
|
|
677
|
-
removeEventListener("pointerup", stop);
|
|
678
|
-
removeEventListener("pointercancel", stop);
|
|
679
|
-
|
|
680
|
-
if (width > 0) {
|
|
663
|
+
const panel = event.currentTarget.parentElement;
|
|
664
|
+
const right = panel.getBoundingClientRect().right;
|
|
665
|
+
|
|
666
|
+
dragWidth(event, {
|
|
667
|
+
element: panel,
|
|
668
|
+
property: "flex-basis",
|
|
669
|
+
widthAt: (each) =>
|
|
670
|
+
Math.round(Math.min(innerWidth - 420, Math.max(360, right - each.clientX))),
|
|
671
|
+
done: (width) => {
|
|
672
|
+
document.documentElement.style.setProperty("--browser-w", `${width}px`);
|
|
681
673
|
localStorage.setItem(WIDTH_KEY, String(width));
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
|
|
685
|
-
addEventListener("pointermove", move);
|
|
686
|
-
addEventListener("pointerup", stop);
|
|
687
|
-
addEventListener("pointercancel", stop);
|
|
674
|
+
},
|
|
675
|
+
});
|
|
688
676
|
};
|
|
689
677
|
|
|
690
678
|
const reset = () => {
|
package/web/extension-ui.js
CHANGED
|
@@ -2030,9 +2030,19 @@ function cutText(text, max) {
|
|
|
2030
2030
|
: characters.join("");
|
|
2031
2031
|
}
|
|
2032
2032
|
|
|
2033
|
+
/** Chips stay valid until the server replaces the session or an extension changes what it adds, as words do. */
|
|
2034
|
+
const cachedChips = new WeakMap();
|
|
2035
|
+
|
|
2033
2036
|
/** The chips that extensions put on a session's row: `{ key, label, title, run }`, `run` only for one that does something. */
|
|
2034
2037
|
export function sessionChips(session) {
|
|
2035
|
-
|
|
2038
|
+
const revision = store.state.extensionsRev;
|
|
2039
|
+
const cached = cachedChips.get(session);
|
|
2040
|
+
|
|
2041
|
+
if (cached?.revision === revision) {
|
|
2042
|
+
return cached.chips;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
const chips = added("sessionChips").flatMap(({ record, spec }) => {
|
|
2036
2046
|
const chips = drawCall(record, spec.chips, session, [], "sessionChips.chips");
|
|
2037
2047
|
|
|
2038
2048
|
if (!Array.isArray(chips)) {
|
|
@@ -2052,6 +2062,10 @@ export function sessionChips(session) {
|
|
|
2052
2062
|
: undefined,
|
|
2053
2063
|
}));
|
|
2054
2064
|
});
|
|
2065
|
+
|
|
2066
|
+
cachedChips.set(session, { revision, chips });
|
|
2067
|
+
|
|
2068
|
+
return chips;
|
|
2055
2069
|
}
|
|
2056
2070
|
|
|
2057
2071
|
/** Words stay valid until the server replaces the session or an extension changes what it adds. */
|
package/web/files-panel.js
CHANGED
|
@@ -10,6 +10,7 @@ import { loadFiles, suggestFiles } from "./files.js";
|
|
|
10
10
|
import { FileView } from "./sheets/file.js";
|
|
11
11
|
import { actions, canSteer, closePeople, panelsBeside, store } from "./store.js";
|
|
12
12
|
import {
|
|
13
|
+
dragWidth,
|
|
13
14
|
html,
|
|
14
15
|
Icon,
|
|
15
16
|
Loader,
|
|
@@ -246,31 +247,19 @@ function ResizeEdge() {
|
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
event.preventDefault();
|
|
249
|
-
const
|
|
250
|
-
const right =
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const stop = () => {
|
|
261
|
-
root.classList.remove("resizing");
|
|
262
|
-
removeEventListener("pointermove", move);
|
|
263
|
-
removeEventListener("pointerup", stop);
|
|
264
|
-
removeEventListener("pointercancel", stop);
|
|
265
|
-
|
|
266
|
-
if (width > 0) {
|
|
250
|
+
const tile = event.currentTarget.parentElement;
|
|
251
|
+
const right = tile.getBoundingClientRect().right;
|
|
252
|
+
|
|
253
|
+
dragWidth(event, {
|
|
254
|
+
element: tile,
|
|
255
|
+
property: "flex-basis",
|
|
256
|
+
widthAt: (each) =>
|
|
257
|
+
Math.round(Math.min(innerWidth - 420, Math.max(320, right - each.clientX))),
|
|
258
|
+
done: (width) => {
|
|
259
|
+
document.documentElement.style.setProperty("--files-w", `${width}px`);
|
|
267
260
|
localStorage.setItem(WIDTH_KEY, String(width));
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
addEventListener("pointermove", move);
|
|
272
|
-
addEventListener("pointerup", stop);
|
|
273
|
-
addEventListener("pointercancel", stop);
|
|
261
|
+
},
|
|
262
|
+
});
|
|
274
263
|
};
|
|
275
264
|
|
|
276
265
|
const reset = () => {
|