pi-pocket 0.27.0 → 0.28.0-beta.2
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 +11 -8
- package/docs/architecture.md +9 -1
- package/docs/customizing.md +16 -2
- package/docs/docker.md +2 -0
- package/docs/examples/quiet-note.js +21 -0
- package/docs/examples/quiet-note.ts +73 -0
- package/docs/extensions/app.md +1 -0
- package/docs/extensions/policies/api-stability.md +3 -0
- package/docs/extensions/reference/limits.md +11 -0
- package/docs/extensions/reference/pocket.md +22 -1
- package/docs/extensions/reference/theme-surface.md +12 -0
- package/docs/extensions/reference/web.md +36 -2
- package/docs/extensions.md +2 -0
- package/docs/features.md +20 -16
- package/docs/map.md +24 -12
- package/docs/systemd.md +1 -1
- package/npm-shrinkwrap.json +3163 -0
- package/package.json +3 -2
- package/src/launcher/access.ts +75 -4
- package/src/launcher/main.ts +303 -60
- package/src/launcher/options.ts +8 -5
- package/src/launcher/serve.ts +677 -0
- package/src/server/app.ts +223 -14
- package/src/server/avatars.ts +54 -0
- package/src/server/background.ts +214 -42
- package/src/server/build.ts +53 -0
- package/src/server/commands.ts +28 -33
- package/src/server/config.ts +9 -1
- package/src/server/docs.ts +8 -1
- package/src/server/entry-presentation.ts +275 -0
- package/src/server/export.ts +26 -3
- package/src/server/extension-web.ts +113 -8
- package/src/server/extensions/pip.ts +57 -2
- package/src/server/host.ts +21 -3
- package/src/server/http/api.ts +106 -6
- package/src/server/http/assets.ts +9 -1
- package/src/server/http/conversation-routes.ts +61 -0
- package/src/server/http/events.ts +19 -0
- package/src/server/http/icon-route.ts +196 -0
- package/src/server/http.ts +41 -2
- package/src/server/icon-mask.ts +33 -0
- package/src/server/icon-render.ts +149 -0
- package/src/server/icon-store.ts +57 -0
- package/src/server/model-images.ts +124 -0
- package/src/server/pip.ts +30 -6
- package/src/server/projection.ts +127 -32
- package/src/server/room.ts +171 -8
- package/src/server/running.ts +307 -2
- package/src/server/schedules.ts +5 -0
- package/src/server/skills.ts +99 -8
- package/src/server/spend.ts +5 -0
- package/src/server/transcripts.ts +28 -3
- package/src/server/when.ts +25 -11
- package/types/pocket.d.ts +53 -2
- package/web/app-icon.js +149 -0
- package/web/app.js +12 -8
- package/web/avatar.js +46 -2
- package/web/composer.js +107 -15
- package/web/entry-presentation.js +264 -0
- package/web/extension-ui.js +18 -0
- package/web/fingerprint.d.ts +2 -0
- package/web/fingerprint.js +21 -0
- package/web/launcher.js +15 -3
- package/web/model-favorites.js +27 -0
- package/web/peeks.js +11 -3
- package/web/pip.js +7 -1
- package/web/running-board.js +1197 -0
- package/web/session-cache.js +144 -0
- package/web/session-tabs.js +58 -0
- package/web/sessions.js +51 -12
- package/web/sheets/all-artifacts.js +104 -0
- package/web/sheets/appearance.js +45 -0
- package/web/sheets/background.js +228 -0
- package/web/sheets/find.js +61 -7
- package/web/sheets/folder.js +43 -4
- package/web/sheets/menu.js +3 -1
- package/web/sheets/message.js +80 -15
- package/web/sheets/model.js +39 -3
- package/web/sheets/people.js +35 -1
- package/web/sheets/providers.js +80 -26
- package/web/sheets/schedules.js +4 -1
- package/web/sheets/shortcuts.js +1 -0
- package/web/sheets/text.js +2 -0
- package/web/sheets.js +11 -4
- package/web/store.js +837 -27
- package/web/style.css +1928 -166
- package/web/subagents-board.js +3 -2
- package/web/tab-order.js +34 -0
- package/web/theme-surface.js +7 -0
- package/web/theme.js +15 -0
- package/web/transcript.js +588 -57
- package/web/user-search.js +6 -0
- package/web/sheets/running.js +0 -130
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-pocket",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0-beta.2",
|
|
4
4
|
"description": "A durable, multiplayer, mobile-first web app for Pi agents, built on Pi Durable",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi",
|
|
@@ -64,12 +64,13 @@
|
|
|
64
64
|
"htm": "^3.1.1",
|
|
65
65
|
"jiti": "2.7.0",
|
|
66
66
|
"marked": "^18.1.1",
|
|
67
|
+
"minimatch": "10.2.6",
|
|
67
68
|
"preact": "^11.0.2",
|
|
68
69
|
"qrcode": "^1.5.4",
|
|
69
70
|
"undici": "8.12.3"
|
|
70
71
|
},
|
|
71
72
|
"overrides": {
|
|
72
|
-
"undici": "
|
|
73
|
+
"undici": "$undici"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@stylistic/eslint-plugin": "5.10.0",
|
package/src/launcher/access.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// How other devices reach Pi Pocket: this device only, the local network, a Cloudflare quick tunnel,
|
|
1
|
+
// How other devices reach Pi Pocket: this device only, the local network, a Cloudflare quick tunnel,
|
|
2
|
+
// Tailscale, or Tailscale Serve.
|
|
2
3
|
import { type ChildProcess, spawn, spawnSync } from "node:child_process";
|
|
3
4
|
import { once } from "node:events";
|
|
4
5
|
import {
|
|
@@ -15,14 +16,21 @@ import { networkInterfaces } from "node:os";
|
|
|
15
16
|
import { delimiter, join } from "node:path";
|
|
16
17
|
import { createInterface } from "node:readline";
|
|
17
18
|
|
|
18
|
-
export type AccessMode = "local" | "lan" | "cloudflare" | "tailscale";
|
|
19
|
-
export const ACCESS_MODES: readonly AccessMode[] = [
|
|
19
|
+
export type AccessMode = "local" | "lan" | "cloudflare" | "tailscale" | "tailscale-serve";
|
|
20
|
+
export const ACCESS_MODES: readonly AccessMode[] = [
|
|
21
|
+
"local",
|
|
22
|
+
"lan",
|
|
23
|
+
"cloudflare",
|
|
24
|
+
"tailscale",
|
|
25
|
+
"tailscale-serve",
|
|
26
|
+
];
|
|
20
27
|
|
|
21
28
|
export const ACCESS_LABELS: Record<AccessMode, string> = {
|
|
22
29
|
local: "This device only",
|
|
23
30
|
lan: "Local network",
|
|
24
31
|
cloudflare: "Cloudflare Tunnel",
|
|
25
32
|
tailscale: "Tailscale",
|
|
33
|
+
"tailscale-serve": "Tailscale Serve",
|
|
26
34
|
};
|
|
27
35
|
|
|
28
36
|
export function isAccessMode(value: string | undefined): value is AccessMode {
|
|
@@ -61,7 +69,8 @@ export function tailscaleAddress(): string | undefined {
|
|
|
61
69
|
|
|
62
70
|
/**
|
|
63
71
|
* The address the server listens on. A tunnel reaches it on this machine, so only the local network mode opens it to
|
|
64
|
-
* other machines directly, and Tailscale opens it to the tailnet only.
|
|
72
|
+
* other machines directly, and Tailscale opens it to the tailnet only. Tailscale Serve is a tunnel as well: tailscaled
|
|
73
|
+
* proxies the tailnet to loopback, so nothing binds the tailnet address for it as Tailscale mode does.
|
|
65
74
|
*/
|
|
66
75
|
export function bindHost(mode: AccessMode): string {
|
|
67
76
|
if (mode === "lan") {
|
|
@@ -75,6 +84,11 @@ export function bindHost(mode: AccessMode): string {
|
|
|
75
84
|
return "127.0.0.1";
|
|
76
85
|
}
|
|
77
86
|
|
|
87
|
+
/** Where the server listens: `--host` when it is given, with any mode, as in 0.27; else the mode's own address. */
|
|
88
|
+
export function listenHost(mode: AccessMode | "custom", host: string | undefined): string {
|
|
89
|
+
return host ?? (mode === "custom" ? "127.0.0.1" : bindHost(mode));
|
|
90
|
+
}
|
|
91
|
+
|
|
78
92
|
// ─── Choosing a mode ────────────────────────────────────────────────────
|
|
79
93
|
|
|
80
94
|
export interface AccessChoice {
|
|
@@ -156,6 +170,63 @@ export function findCloudflared(dataDir: string): string | undefined {
|
|
|
156
170
|
return findExecutable("cloudflared", [join(dataDir, "bin")]);
|
|
157
171
|
}
|
|
158
172
|
|
|
173
|
+
// ─── Tailscale Serve ────────────────────────────────────────────────────
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* tailscale from PATH. Pi Pocket neither ships nor downloads Tailscale, so it has to be installed already, and only
|
|
177
|
+
* PATH is searched: the data folder never holds a copy.
|
|
178
|
+
*/
|
|
179
|
+
export function findTailscale(): string | undefined {
|
|
180
|
+
return findExecutable("tailscale", []);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export const TAILSCALE_MISSING_MESSAGE =
|
|
184
|
+
'Tailscale Serve needs the tailscale command, and it is not on PATH.\nInstall it: macOS "brew install tailscale" (the App Store app keeps its command in the bundle, not on PATH) · Linux "curl -fsSL https://tailscale.com/install.sh | sh" · Windows "winget install Tailscale.Tailscale".\nOr pick another access mode: --access local|lan|cloudflare|tailscale.';
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Whether the start has to stop because `tailscale-serve` needs the missing tailscale and nobody is there to choose
|
|
188
|
+
* another mode: `--access tailscale-serve` or PI_POCKET_ACCESS asked for it, or it is the saved choice and no terminal
|
|
189
|
+
* can ask. It never falls back to `local` on its own, because the user would believe they are on their tailnet while
|
|
190
|
+
* they are not, and it leaves the saved choice alone so the next start works once Tailscale is installed.
|
|
191
|
+
*/
|
|
192
|
+
export function serveWithoutTailscale(request: {
|
|
193
|
+
given: AccessMode | undefined;
|
|
194
|
+
saved: AccessMode | undefined;
|
|
195
|
+
ask: boolean;
|
|
196
|
+
}): boolean {
|
|
197
|
+
if (request.given === "tailscale-serve") {
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return request.given === undefined && request.saved === "tailscale-serve" && !request.ask;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Whether the start stops for the missing `tailscale-serve` tailscale, `--host` aside: `--host` means the launcher
|
|
206
|
+
* listens where it is told and never uses serve, so a saved serve choice must not refuse to start there. An explicit
|
|
207
|
+
* `--access tailscale-serve` together with `--host` never arrives here; `main` refuses that pair before choosing.
|
|
208
|
+
*/
|
|
209
|
+
export function serveBailOut(request: {
|
|
210
|
+
access: AccessMode | undefined;
|
|
211
|
+
saved: AccessMode | undefined;
|
|
212
|
+
host: string | undefined;
|
|
213
|
+
ask: boolean;
|
|
214
|
+
}): boolean {
|
|
215
|
+
return (
|
|
216
|
+
request.host === undefined &&
|
|
217
|
+
serveWithoutTailscale({ given: request.access, saved: request.saved, ask: request.ask })
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The loopback ports that a mount left by an earlier run of this launcher could point at: the port its receipt names.
|
|
223
|
+
* None without a receipt, and none for `tailscale-serve` itself, whose mount prepareServe() mounted or adopted for this
|
|
224
|
+
* run's port.
|
|
225
|
+
*/
|
|
226
|
+
export function staleServePorts(mode: AccessMode | "custom", owned: number | undefined): number[] {
|
|
227
|
+
return mode === "tailscale-serve" || owned === undefined ? [] : [owned];
|
|
228
|
+
}
|
|
229
|
+
|
|
159
230
|
/** Where to get cloudflared on this platform: a release binary the launcher can download, or how to install it. */
|
|
160
231
|
export function cloudflaredSource(): { url: string } | { install: string } {
|
|
161
232
|
const arch = (
|