@jmfederico/pi-web 1.202606.6 → 1.202607.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.
Files changed (103) hide show
  1. package/README.md +87 -293
  2. package/dist/cli.js +25 -7
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/assets/CodeViewer-tXF3UTsY.js +4 -0
  5. package/dist/client/assets/TerminalPanel-D_ihiWAt.js +187 -0
  6. package/dist/client/assets/UnifiedDiffViewer-BziirXBJ.js +39 -0
  7. package/dist/client/assets/index-Brfk1lwl.js +2950 -0
  8. package/dist/client/assets/vendor-editor-core-vUi74DnD.js +12 -0
  9. package/dist/client/assets/vendor-editor-languages-DoaXUodB.js +46 -0
  10. package/dist/client/assets/vendor-editor-legacy-CYBnW6ZU.js +1 -0
  11. package/dist/client/assets/vendor-terminal-BrP-ENHg.css +1 -0
  12. package/dist/client/assets/vendor-terminal-D8k4UKM2.js +35 -0
  13. package/dist/client/index.html +6 -3
  14. package/dist/config.js +33 -1
  15. package/dist/config.js.map +1 -1
  16. package/dist/docker/piWebDockerCommandPlan.js +211 -0
  17. package/dist/docker/piWebDockerCommandPlan.js.map +1 -0
  18. package/dist/pi-web-plugins/updates/pi-web-plugin.js +15 -5
  19. package/dist/pi-web-plugins/updates/updatesLogic.js +37 -5
  20. package/dist/piWebVersionReport.js +4 -0
  21. package/dist/piWebVersionReport.js.map +1 -1
  22. package/dist/plugin-api.d.ts +30 -2
  23. package/dist/server/app.js +32 -5
  24. package/dist/server/app.js.map +1 -1
  25. package/dist/server/browserMessageProjection.js +56 -0
  26. package/dist/server/browserMessageProjection.js.map +1 -0
  27. package/dist/server/configRoutes.js +112 -2
  28. package/dist/server/configRoutes.js.map +1 -1
  29. package/dist/server/machines/machineClient.js +51 -13
  30. package/dist/server/machines/machineClient.js.map +1 -1
  31. package/dist/server/machines/machineProxyRoutes.js +72 -4
  32. package/dist/server/machines/machineProxyRoutes.js.map +1 -1
  33. package/dist/server/machines/machineService.js +4 -26
  34. package/dist/server/machines/machineService.js.map +1 -1
  35. package/dist/server/piPackageRoutes.js +87 -0
  36. package/dist/server/piPackageRoutes.js.map +1 -0
  37. package/dist/server/piPackageService.js +69 -0
  38. package/dist/server/piPackageService.js.map +1 -0
  39. package/dist/server/piWebPluginService.js +43 -8
  40. package/dist/server/piWebPluginService.js.map +1 -1
  41. package/dist/server/piWebStatus.js +57 -0
  42. package/dist/server/piWebStatus.js.map +1 -1
  43. package/dist/server/realtime/sessionEventHub.js +2 -1
  44. package/dist/server/realtime/sessionEventHub.js.map +1 -1
  45. package/dist/server/sessions/attachmentService.js +69 -11
  46. package/dist/server/sessions/attachmentService.js.map +1 -1
  47. package/dist/server/sessions/builtinCommands.js +1 -1
  48. package/dist/server/sessions/builtinCommands.js.map +1 -1
  49. package/dist/server/sessions/piSessionManagerGateway.js +20 -2
  50. package/dist/server/sessions/piSessionManagerGateway.js.map +1 -1
  51. package/dist/server/sessions/piSessionService.js +905 -73
  52. package/dist/server/sessions/piSessionService.js.map +1 -1
  53. package/dist/server/sessions/sessionArchiveStore.js +51 -22
  54. package/dist/server/sessions/sessionArchiveStore.js.map +1 -1
  55. package/dist/server/sessions/sessionCleanup.js +157 -0
  56. package/dist/server/sessions/sessionCleanup.js.map +1 -0
  57. package/dist/server/sessions/sessionCommandService.js +16 -0
  58. package/dist/server/sessions/sessionCommandService.js.map +1 -1
  59. package/dist/server/sessions/sessionNameGenerator.js +27 -44
  60. package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
  61. package/dist/server/sessions/sessionRoutes.js +55 -1
  62. package/dist/server/sessions/sessionRoutes.js.map +1 -1
  63. package/dist/server/sessions/spawnSessionTool.js +9 -4
  64. package/dist/server/sessions/spawnSessionTool.js.map +1 -1
  65. package/dist/server/sessions/spawnSubsessionTool.js +28 -18
  66. package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
  67. package/dist/server/workspaceExplorerRoutes.js +55 -3
  68. package/dist/server/workspaceExplorerRoutes.js.map +1 -1
  69. package/dist/server/workspaces/fileContentService.js +112 -1
  70. package/dist/server/workspaces/fileContentService.js.map +1 -1
  71. package/dist/server/workspaces/fileSuggestions.js +7 -3
  72. package/dist/server/workspaces/fileSuggestions.js.map +1 -1
  73. package/dist/server/workspaces/pathSafety.js +16 -1
  74. package/dist/server/workspaces/pathSafety.js.map +1 -1
  75. package/dist/server/workspaces/projectPiWebConfig.js +6 -1
  76. package/dist/server/workspaces/projectPiWebConfig.js.map +1 -1
  77. package/dist/shared/activity.js +0 -15
  78. package/dist/shared/activity.js.map +1 -1
  79. package/dist/shared/apiTypes.d.ts +146 -7
  80. package/dist/shared/apiTypes.js +5 -0
  81. package/dist/shared/apiTypes.js.map +1 -1
  82. package/dist/shared/capabilities.js +29 -2
  83. package/dist/shared/capabilities.js.map +1 -1
  84. package/dist/shared/federatedRoutes.js +15 -0
  85. package/dist/shared/federatedRoutes.js.map +1 -1
  86. package/dist/shared/piWebStatusParsing.js +20 -8
  87. package/dist/shared/piWebStatusParsing.js.map +1 -1
  88. package/dist/shared/promptAttachments.js +30 -11
  89. package/dist/shared/promptAttachments.js.map +1 -1
  90. package/dist/shared/thinkingLevels.d.ts +1 -1
  91. package/dist/shared/thinkingLevels.js +1 -1
  92. package/dist/shared/thinkingLevels.js.map +1 -1
  93. package/docs/config.md +62 -14
  94. package/docs/plugins.md +155 -17
  95. package/package.json +35 -31
  96. package/dist/client/assets/CodeViewer-Bv8l_MFi.js +0 -4
  97. package/dist/client/assets/TerminalPanel-BZKsaE9s.js +0 -126
  98. package/dist/client/assets/index-C9oPLpm7.js +0 -2408
  99. package/dist/client/assets/vendor-editor-core-Bc1A7SO7.js +0 -12
  100. package/dist/client/assets/vendor-editor-languages-D0CnB2js.js +0 -26
  101. package/dist/client/assets/vendor-editor-legacy-B4QLsWF8.js +0 -1
  102. package/dist/client/assets/vendor-terminal-DDGTF8rc.css +0 -1
  103. package/dist/client/assets/vendor-terminal-DjQ08hXu.js +0 -16
package/README.md CHANGED
@@ -1,170 +1,58 @@
1
- # PI WEB — web UI for Pi Coding Agent
1
+ # PI WEB
2
2
 
3
3
  [![CI](https://github.com/jmfederico/pi-web/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jmfederico/pi-web/actions/workflows/ci.yml)
4
4
  [![npm version](https://img.shields.io/npm/v/@jmfederico/pi-web)](https://www.npmjs.com/package/@jmfederico/pi-web)
5
5
  [![Node.js](https://img.shields.io/node/v/@jmfederico/pi-web)](package.json)
6
6
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
- [![Pi Coding Agent](https://img.shields.io/badge/Pi-Coding%20Agent-6f42c1)](https://github.com/earendil-works/pi/tree/main/packages/coding-agent)
8
7
 
9
- Website: <https://pi-web.dev/>
8
+ **PI WEB is a web UI for [Pi Coding Agent](https://github.com/earendil-works/pi/tree/main/packages/coding-agent) that keeps agent sessions running in real workspaces on your machine or server.**
10
9
 
11
- ![PI WEB](docs/assets/pi-web-banner.png)
12
-
13
- **Run Pi Coding Agent from a web UI, keep sessions alive in real workspaces, and supervise them from any device.**
14
-
15
- PI WEB is a web UI for [Pi Coding Agent](https://github.com/earendil-works/pi/tree/main/packages/coding-agent) that keeps agent sessions running on your own machine or server. Add your repositories once, open project workspaces and git worktrees, start sessions inside them, and come back later without losing the work. Your browser becomes the cockpit; your server becomes the persistent development environment. Start on your laptop, check in from your phone, and continue from an iPad or another machine whenever that is the device you have at hand.
16
-
17
- ![PI WEB desktop screenshot showing an agent-created pi-web.dev screenshot selected in the file preview](docs/assets/pi-web-desktop.png)
18
-
19
- <p align="center">
20
- <img src="docs/assets/pi-web-tablet.png" alt="PI WEB tablet screenshot" width="58%" />
21
- <img src="docs/assets/pi-web-mobile.png" alt="PI WEB mobile chat screenshot" width="28%" />
22
- </p>
23
-
24
- With PI WEB you can:
25
-
26
- - launch and supervise multiple coding-agent sessions in parallel;
27
- - keep sessions running when your browser disconnects or the UI restarts;
28
- - organize agent work by project, workspace, branch, experiment, or review;
29
- - use git worktrees to isolate concurrent features and fixes;
30
- - chat with Pi Coding Agent through a realtime web UI;
31
- - move fluidly between laptop, phone, tablet, and desktop without moving the development environment;
32
- - turn any server, desktop, or remote dev box into an agent-first development hub.
33
-
34
- ## Why use PI WEB?
35
-
36
- Agentic development works best when agents are not trapped inside a single local terminal. They need stable environments, access to real repositories, and room to work across branches and tasks. Humans need the opposite: a clear place to supervise, redirect, review, and decide.
37
-
38
- PI WEB connects those two worlds. The work stays in the server-side environment while you move between devices: laptop for deep focus, phone for a quick check-in, tablet for review, desktop when you are back at a desk. It is not trying to recreate the old desktop IDE in a browser; it is a control surface for persistent, parallel, human-in-the-loop agent work.
39
-
40
- ### Is PI WEB a Pi web UI?
41
-
42
- Yes. PI WEB is a Pi web UI for running and supervising Pi Coding Agent sessions from a browser. Unlike simple session viewers, PI WEB is built around persistent server-side workspaces, long-running session daemons, git worktrees, remote machines, and multi-device supervision.
43
-
44
- ## Core model
45
-
46
- PI WEB organizes work into four levels:
47
-
48
- ```text
49
- Machine a local or remote PI WEB runtime endpoint
50
- Project a folder on that machine
51
- Workspace a git worktree, or the project folder for non-git projects
52
- Session a chat with Pi Coding Agent running inside a workspace
53
- ```
54
-
55
- This maps naturally to real development work:
56
-
57
- - select the local machine or another registered PI WEB runtime;
58
- - add a project once on the selected machine;
59
- - use worktrees to separate branches, features, experiments, and reviews;
60
- - start one or more agent sessions inside each workspace;
61
- - leave sessions running even when the browser disconnects or the UI restarts.
62
-
63
- ## Features
64
-
65
- - Add and list local or remote PI WEB machines from the action palette.
66
- - Proxy remote projects, workspaces, files, git state, sessions, and terminals through the currently opened PI WEB server.
67
- - Add and list server-side projects.
68
- - Discover git worktrees automatically with `git worktree list --porcelain`.
69
- - Support non-git folders as single-workspace projects.
70
- - Start, resume, archive, and restore Pi sessions per workspace.
71
- - Chat with Pi Coding Agent through realtime WebSocket events.
72
- - Keep active agent runtimes alive across browser disconnects and web/API restarts.
73
- - Explicitly stop or abort active session work.
74
- - View live session status: streaming, compaction, bash activity, token usage, cost, model, and context usage.
75
- - Send prompts, shell input, and supported commands through the Pi SDK path.
76
- - Reuse your existing Pi auth and model configuration from `~/.pi/agent`.
77
- - Extend the UI with trusted plugins that add actions, workspace panels, and workspace-label metadata. See [Plugin API](docs/plugins.md) for LLM-friendly plugin-building docs.
78
-
79
- ## Architecture
80
-
81
- PI WEB uses a split-process architecture so agent runtimes are not owned by the browser-facing dev server. Under the hood, it acts as a browser-based control plane for sessions, workspaces, files, terminals, and trusted remote machines.
82
-
83
- ```text
84
- Browser UI
85
- │
86
- ▼
87
- Fastify Web/API process
88
- │ HTTP + WebSocket proxy
89
- ▼
90
- Session daemon
91
- │
92
- ▼
93
- Pi Coding Agent SDK
94
- ```
95
-
96
- ### Session daemon
97
-
98
- The session daemon owns active Pi session runtimes. It is intended to be long-lived so sessions can survive browser disconnects and web/API restarts.
99
-
100
- ### Web/API/UI server
101
-
102
- The web process serves the API and browser UI. In development it can autoreload freely while active sessions continue running in the daemon.
103
-
104
- ## State model
10
+ Run agents where your code, tools, credentials, and build caches live. Supervise them from any browser.
105
11
 
106
- PI WEB keeps its own state intentionally small:
12
+ Website and docs: <https://pi-web.dev/>
107
13
 
108
- - Machines: `~/.pi-web/machines.json` stores only opt-in remote machine records; the local machine is synthesized.
109
- - Projects: `~/.pi-web/projects.json`
110
- - Workspaces: discovered from git worktrees, not stored
111
- - Sessions and chat history: Pi's default JSONL session storage on the selected machine
112
- - Active session runtimes and WebSockets: memory in each selected machine's session daemon
113
-
114
- ## Machine federation
115
-
116
- The Machines section lets one PI WEB instance act as a gateway to other PI WEB runtimes. Register a remote machine from **Actions → Add Machine** with the remote PI WEB base URL, for example a URL reachable over NetBird, Tailscale, WireGuard, an SSH tunnel, or a trusted reverse proxy. The browser continues talking to the local PI WEB origin; project, workspace, file, git, session, activity, and terminal HTTP/WebSocket traffic is proxied server-to-server. See the [Fleet guide](https://pi-web.dev/machines) for setup, trust model, and troubleshooting details.
117
-
118
- Remote model-provider credentials and OAuth state stay on the target machine. API-key provider configuration can be proxied, but OAuth login should be completed by opening the remote PI WEB directly. Register remote machines only when you trust the endpoint and the network path: adding a machine gives this PI WEB server permission to contact that URL with the optional bearer token you configured.
119
-
120
- ## Plugins
14
+ ![PI WEB](docs/assets/pi-web-banner.png)
121
15
 
122
- PI WEB production installs can load trusted local UI plugins without rebuilding PI WEB. Plugins are browser-side ES modules that can add action-palette actions, workspace panels, and workspace-label metadata, using documented context helpers for workspace files and terminals. They do not run in the session daemon and are not sandboxed.
16
+ ![PI WEB desktop screenshot](docs/assets/pi-web-desktop.png)
123
17
 
124
- The supported package shape is intentionally singular: `piWeb.plugins` entries with explicit `id` and `module` plus optional `machineSpecific` metadata, and a browser module that exports `{ apiVersion: 1, name, activate }`. The bundled `pi-web-plugins/info` TypeScript source is the canonical minimal real example, `pi-web-plugins/updates` demonstrates a dynamic status panel, and built-in [Workspace Tasks](docs/plugins.md#workspace-tasks) adds a workspace tab for running configured shell commands in PI WEB terminals.
18
+ ## Why PI WEB?
125
19
 
126
- A useful prompt for AI agents:
20
+ Agentic development works better when the work environment is persistent.
127
21
 
128
- ```text
129
- Build a PI WEB plugin for this project. Goal: <describe the UI behavior>.
130
- Before coding, read https://pi-web.dev/plugins and https://pi-web.dev/plugins.md.
131
- Create it under ~/.pi-web/plugins/<plugin-id> using the documented PI WEB v1 plugin API.
132
- Validate with /pi-web-plugins/manifest.json and explain reload/debug steps.
133
- Do not modify PI WEB itself.
134
- ```
22
+ PI WEB lets you:
135
23
 
136
- Manage discovered plugins in **Settings → Plugins** or with the top-level `plugins` config key. Plugins are enabled by default; set `plugins.<plugin-id>.enabled` to `false` and reload the browser tab to prevent PI WEB from importing that plugin.
24
+ - keep Pi Coding Agent sessions alive after browser disconnects;
25
+ - run agents inside real repositories and git worktrees;
26
+ - supervise multiple sessions in parallel;
27
+ - switch between laptop, phone, tablet, and desktop;
28
+ - use a server, workstation, or remote dev box as your agent runtime;
29
+ - manage projects, workspaces, files, terminals, sessions, and remote machines from one web UI.
137
30
 
138
- Reload the browser tab after adding or editing a plugin. If `PI_WEB_DATA_DIR` is set, use `$PI_WEB_DATA_DIR/plugins` instead of `~/.pi-web/plugins`. Check discovery with:
31
+ Your browser is the control surface. The work stays where it can keep running.
139
32
 
140
- ```bash
141
- curl http://127.0.0.1:8504/pi-web-plugins/manifest.json
142
- ```
33
+ ## Quick start
143
34
 
144
- See the full [Plugin API](docs/plugins.md) for contribution types, package metadata, and troubleshooting.
35
+ Requirements:
145
36
 
146
- ## Install
37
+ - Node.js 22 or newer
38
+ - npm
39
+ - Pi Coding Agent configured for your user
40
+ - git and the development tools your agents need
147
41
 
148
- Recommended install uses npm plus native per-user services.
42
+ Install and start PI WEB as per-user services:
149
43
 
150
44
  ```bash
151
45
  npm install -g @jmfederico/pi-web
152
46
  pi-web install
47
+ pi-web doctor
153
48
  ```
154
49
 
155
- On Linux servers, `loginctl enable-linger` is optional but recommended so the user systemd manager starts at boot and continues running after logout:
50
+ Then open:
156
51
 
157
- ```bash
158
- sudo loginctl enable-linger "$USER"
159
- loginctl show-user "$USER" -p Linger
52
+ ```text
53
+ http://127.0.0.1:8504
160
54
  ```
161
55
 
162
- This writes and starts PI WEB's session daemon and web/API user services. The native user-service backend is selected automatically.
163
-
164
- The generated services run through your detected login shell (`bash`, `zsh`, or `fish` with `-lc`) so they see a shell environment similar to running `pi` from your terminal.
165
-
166
- Open <http://127.0.0.1:8504>.
167
-
168
56
  Useful commands:
169
57
 
170
58
  ```bash
@@ -176,212 +64,118 @@ pi-web version
176
64
  pi-web uninstall
177
65
  ```
178
66
 
179
- Use `pi-web version` to compare the installed package version with the versions reported by the running Web/UI and session daemon services.
180
-
181
- One-line install is also available for users who prefer it:
182
-
183
- ```bash
184
- curl -fsSL https://raw.githubusercontent.com/jmfederico/pi-web/main/install.sh | sh
185
- ```
186
-
187
- PI WEB is also published as a Pi package. Installing it through Pi exposes a `/pi-web` command inside Pi:
67
+ For more install options, including one-line install, Pi package install, WSL/manual usage, and remote access, see the [installation guide](https://pi-web.dev/install).
188
68
 
189
- ```bash
190
- pi install npm:@jmfederico/pi-web
191
- ```
69
+ ## Core model
192
70
 
193
- Then in Pi:
71
+ PI WEB organizes work like this:
194
72
 
195
73
  ```text
196
- /pi-web install
197
- /pi-web status
198
- /pi-web logs
199
- /pi-web restart
200
- /pi-web doctor
201
- /pi-web version
202
- ```
203
-
204
- The Pi command is a convenience wrapper around the same service installer. When installed this way, the service installer can use PI WEB's package-local server entrypoints, so `pi-web-server` and `pi-web-sessiond` do not need to be on your shell `PATH`. `/pi-web logs` shows the last 100 service log lines; use `pi-web logs` in a shell when you want to follow logs continuously.
205
-
206
- Advanced users may run the binaries however they prefer:
207
-
208
- ```bash
209
- pi-web-sessiond
210
- PI_WEB_PORT=8504 pi-web-server
211
- ```
212
-
213
- ## Development quick start
214
-
215
- ```bash
216
- npm install
217
- npm run dev
74
+ Machine a local or remote PI WEB runtime endpoint
75
+ Project a folder on that machine
76
+ Workspace a git worktree, or the project folder for non-git projects
77
+ Session a Pi Coding Agent chat running inside a workspace
218
78
  ```
219
79
 
220
- Open the Vite URL, usually <http://localhost:8505>.
80
+ A typical flow:
221
81
 
222
- During development, the static marketing/docs site is also served by the Vite dev server at <http://localhost:8505/site/>.
82
+ 1. Add a project.
83
+ 2. Choose a workspace or git worktree.
84
+ 3. Start a session.
85
+ 4. Let the agent work.
86
+ 5. Come back later from any browser.
223
87
 
224
- For the recommended split development setup, run these in separate terminals:
88
+ ## Remote-first development
225
89
 
226
- ```bash
227
- npm run dev:sessiond
228
- npm run dev:web
229
- npm run dev:client
230
- ```
90
+ PI WEB is designed for remote AI-driven development.
231
91
 
232
- Or install the split development setup as native per-user services from the checkout:
92
+ Instead of tying agent work to your laptop session, run PI WEB on a machine that stays available: a server, desktop, cloud VM, home lab machine, or remote dev box.
233
93
 
234
- ```bash
235
- pi-web install --dev
236
- ```
94
+ Use a private network, SSH tunnel, trusted reverse proxy, or federated PI WEB machine setup when accessing it remotely.
237
95
 
238
- `pi-web install --dev` writes the session daemon plus a UI development service using the native user-service backend. `pi-web uninstall` removes both production and development service files; no uninstall flags are needed.
96
+ Read more: [Remote-first development](https://pi-web.dev/remote-first)
239
97
 
240
- `dev:web` also watches bundled plugin TypeScript and rebuilds the browser-loaded plugin JavaScript under `dist/pi-web-plugins/`. You can restart `dev:web` or `dev:client` without stopping active Pi sessions.
98
+ ## Machines and fleets
241
99
 
242
- ## Production-style run from a checkout
100
+ PI WEB can register other PI WEB runtimes as remote machines. One browser-facing PI WEB instance can proxy projects, files, git state, sessions, terminals, activity, Pi package management, and selected-machine settings from trusted remote machines.
243
101
 
244
- ```bash
245
- npm run build
246
- npm run start:sessiond
247
- PI_WEB_PORT=8504 npm start
248
- ```
102
+ When a remote machine is selected, Settings tabs label their target. Pi packages, PI WEB plugin enablement, session daemon toggles, external file access, and upload defaults target the selected machine. Gateway/server settings such as host, port, allowed hosts, registered machines/tokens, and keyboard shortcuts stay local to the gateway/browser.
249
103
 
250
- ## Packaging and publishing
104
+ Read more: [Fleet and machines guide](https://pi-web.dev/machines)
251
105
 
252
- ```bash
253
- npm run verify
254
- npm run pack:dry
255
- npm publish --access public
256
- ```
106
+ ## Plugins
257
107
 
258
- `prepack` builds `dist/` and bundled plugin JavaScript before npm creates the tarball, and `prepublishOnly` runs verification before publishing. Releases can also be published by the GitHub Actions npm workflow when a GitHub release is published.
108
+ PI WEB supports trusted browser-side PI WEB plugins that can add actions, workspace panels, and workspace metadata.
259
109
 
260
- PI WEB uses a single-line CalVer-inspired npm version: `MAJOR.YYYYMM.SEQUENCE`, for example `1.202605.1`. The major number signals breaking-change eras; the middle number is the release month; the final number increments for additional releases in that month. Older major eras may be deprecated rather than maintained in parallel.
110
+ Pi packages are managed separately through Pi's package manager or **Settings → Pi packages**. In a federated setup, the Pi packages panel targets the selected machine and labels where installs, updates, or removals will run. Use **Settings → PI WEB plugins** to enable or disable discovered browser plugins on the selected machine.
261
111
 
262
- PI WEB declares `@earendil-works/pi-coding-agent` as a peer dependency (`>=0.78.0 <1`) and a development dependency for local builds. This keeps published installs flexible: npm 7+ installs the peer automatically, and users can upgrade the Pi package within the compatible range without PI WEB pinning a separate copy.
112
+ After installing, updating, or removing a Pi package, type `/reload` in each idle PI WEB session on that machine to refresh Pi runtime resources such as extensions, skills, prompt templates, themes, and context/system prompt files. Reload the browser page separately for newly discovered or changed PI WEB plugins.
263
113
 
114
+ Read more: [Plugin API](https://pi-web.dev/plugins)
264
115
 
265
116
  ## Configuration
266
117
 
267
- Global PI WEB config lives at `$PI_WEB_CONFIG`, or `$XDG_CONFIG_HOME/pi-web/config.json`, or `~/.config/pi-web/config.json`. Project-local core config lives at `<project>/.pi-web/config.json`.
268
-
269
- See the full [Configuration reference](docs/config.md) for config-file precedence, project-local config, external path access, session daemon settings, plugins, shortcuts, upload limits, and environment variables.
270
-
271
- The web server defaults to `127.0.0.1:8504`. Set `PI_WEB_HOST=0.0.0.0` only when you intentionally want to bind directly on all interfaces behind a trusted network, firewall, or authenticated proxy.
272
-
273
- The session daemon defaults to a private Unix socket at:
118
+ Global config lives at:
274
119
 
275
120
  ```text
276
- ~/.pi-web/sessiond.sock
121
+ $PI_WEB_CONFIG
122
+ ~/.config/pi-web/config.json
277
123
  ```
278
124
 
279
- Common config keys:
280
-
281
- - `host` / `port` — web/API bind address. Environment overrides: `PI_WEB_HOST`, `PI_WEB_PORT` / `PORT`.
282
- - `pathAccess.allowedPaths` — external filesystem roots that PI WEB may list/read through the file explorer and absolute `@` path completions. Absolute paths are denied by default.
283
- - `maxUploadBytes` — maximum accepted request body size. Defaults to 64 MB. Environment override: `PI_WEB_MAX_UPLOAD_BYTES`.
284
- - `spawnSessions` — enable the `spawn_session` tool. Defaults to `true`. Environment override: `PI_WEB_SPAWN_SESSIONS`.
285
- - `subsessions` — beta tracked-subsession tools (`spawn_subsession`, `list_subsessions`, `check_subsession`, `read_subsession`). Defaults to `false`, requires `spawnSessions`, and requires a session daemon restart after changes. Environment override: `PI_WEB_SUBSESSIONS`.
286
- - `plugins` — plugin enablement/settings. Reload the browser after changing plugin enablement.
287
- - `shortcuts` — keyboard shortcut overrides; use `null` to disable an action shortcut.
288
-
289
- Operational environment variables:
125
+ Project-local PI WEB config lives at:
290
126
 
291
- - `PI_WEB_CONFIG` — path to the global config JSON file.
292
- - `PI_WEB_DATA_DIR` — PI WEB-managed data directory. Defaults to `~/.pi-web`.
293
- - `PI_WEB_SESSIOND_SOCKET` — Unix socket path used by both the daemon and web process when `PI_WEB_SESSIOND_URL` is not set. Defaults to `$PI_WEB_DATA_DIR/sessiond.sock`.
294
- - `PI_WEB_SESSIOND_PORT` — optional TCP port for the daemon. If unset, the daemon listens on the Unix socket instead.
295
- - `PI_WEB_SESSIOND_HOST` — daemon TCP bind host when `PI_WEB_SESSIOND_PORT` is set. Defaults to `127.0.0.1`.
296
- - `PI_WEB_SESSIOND_URL` — daemon URL used by the web process when connecting over TCP, for example `http://127.0.0.1:3001`. If you set `PI_WEB_SESSIOND_PORT`, set this for the web process too.
297
- - `PI_WEB_PROJECTS_FILE` — optional override for the projects storage JSON file. Defaults to `$PI_WEB_DATA_DIR/projects.json`.
298
- - `PI_WEB_MACHINES_FILE` — optional override for the remote machine registry JSON file. Defaults to `$PI_WEB_DATA_DIR/machines.json`.
299
- - `PI_CODING_AGENT_SESSION_DIR` — Pi session storage directory. PI WEB follows the same session-location priority as Pi for web sessions: this environment variable, then `sessionDir` in Pi settings for the selected workspace, then Pi's default session directory.
300
- - `PI_CODING_AGENT_DIR` — Pi agent config directory. PI WEB uses this for Pi auth, settings, resources, and default session storage, matching Pi's own configuration layout.
301
-
302
- ## Development services
303
-
304
- `pi-web install --dev` creates a practical local setup with two native per-user services:
305
-
306
- - `pi-web-sessiond` runs `npm run start:sessiond` from the checkout without autoreload.
307
- - `pi-web-ui-dev` runs `npm run dev:web` and `npm run dev:client` for API reloads, bundled plugin rebuilds, and Vite HMR.
127
+ ```text
128
+ <project>/.pi-web/config.json
129
+ ```
308
130
 
309
- Under the hood, the native backends are systemd user services and LaunchAgents. For reference, an equivalent systemd setup looks like:
131
+ Common configuration includes host/port, path access, uploads, PI WEB plugin enablement, shortcuts, and session daemon options. In Settings, machine-affecting config targets the selected machine; gateway host/port/allowed-hosts, remote machine registration, tokens, and keyboard shortcuts stay local.
310
132
 
311
- ```ini
312
- # ~/.config/systemd/user/pi-web-sessiond.service
313
- [Unit]
314
- Description=PI WEB session daemon
133
+ Read more: [Configuration reference](https://pi-web.dev/config)
315
134
 
316
- [Service]
317
- Type=simple
318
- WorkingDirectory=/srv/dev/pi-web
319
- ExecStart=/bin/bash -lc 'exec npm run start:sessiond'
320
- Restart=no
135
+ ## Development
321
136
 
322
- [Install]
323
- WantedBy=default.target
324
- ```
325
-
326
- ```ini
327
- # ~/.config/systemd/user/pi-web-ui-dev.service
328
- [Unit]
329
- Description=PI WEB UI dev server
330
- After=pi-web-sessiond.service
331
- Wants=pi-web-sessiond.service
332
-
333
- [Service]
334
- Type=simple
335
- WorkingDirectory=/srv/dev/pi-web
336
- ExecStart=/bin/bash -lc 'trap "kill 0" EXIT; npm run dev:web & npm run dev:client & wait'
337
- Restart=no
338
-
339
- [Install]
340
- WantedBy=default.target
341
- ```
342
-
343
- On Linux servers, enable persistent user services so the user systemd manager starts at boot and remains running after logout:
137
+ Clone the repository and run:
344
138
 
345
139
  ```bash
346
- sudo loginctl enable-linger "$USER"
347
- loginctl show-user "$USER" -p Linger
140
+ npm install
141
+ npm run dev
348
142
  ```
349
143
 
350
- Install or refresh the development services with:
144
+ Open the Vite URL, usually:
351
145
 
352
- ```bash
353
- pi-web install --dev
146
+ ```text
147
+ http://localhost:8505
354
148
  ```
355
149
 
356
- Useful logs:
150
+ For the split development setup:
357
151
 
358
152
  ```bash
359
- pi-web logs
153
+ npm run dev:sessiond
154
+ npm run dev:web
155
+ npm run dev:client
360
156
  ```
361
157
 
362
- If code affecting the session daemon changes, restart it manually:
158
+ Validate changes with:
363
159
 
364
160
  ```bash
365
- pi-web restart
161
+ npm run verify
366
162
  ```
367
163
 
368
- ## Current limitations
369
-
370
- - Assumes trusted users and trusted server paths.
371
- - Not a sandbox, permission model, or secure multi-tenant platform.
372
- - Some Pi TUI slash-command behavior is not yet represented exactly in the web UI.
373
- - Workspaces are discovered from existing git worktrees; UI-driven worktree management is a natural next step.
164
+ ## Security model
374
165
 
375
- ## Vision
166
+ PI WEB assumes trusted users, trusted repositories, and trusted server paths.
376
167
 
377
- PI WEB is the beginning of an agent-first development environment:
168
+ It is not a sandbox, permission system, or multi-tenant platform. Do not expose it directly to the public internet without a trusted network, firewall, VPN, SSH tunnel, or authenticated reverse proxy.
378
169
 
379
- - agents run persistently on servers;
380
- - humans connect through the browser;
381
- - work is organized by projects, workspaces, and sessions;
382
- - the UI grows around the needs of agentic development rather than the habits of local IDEs.
170
+ ## Documentation
383
171
 
384
- The goal is simple: make it practical to run more development remotely, in parallel, with agents as first-class participants and humans focused on direction, judgment, and review.
172
+ - [Website](https://pi-web.dev/)
173
+ - [Install](https://pi-web.dev/install)
174
+ - [Remote-first development](https://pi-web.dev/remote-first)
175
+ - [Machines / fleet](https://pi-web.dev/machines)
176
+ - [Configuration](https://pi-web.dev/config)
177
+ - [Plugins](https://pi-web.dev/plugins)
178
+ - [FAQ](https://pi-web.dev/faq)
385
179
 
386
180
  ## License
387
181
 
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawnSync } from "node:child_process";
3
- import { existsSync, readFileSync } from "node:fs";
3
+ import { existsSync, readFileSync, realpathSync } from "node:fs";
4
4
  import { mkdir, rm, writeFile } from "node:fs/promises";
5
5
  import { homedir, userInfo } from "node:os";
6
6
  import { basename, dirname, join, resolve } from "node:path";
@@ -775,8 +775,12 @@ function systemdUserServiceShellCommand(command, cwd) {
775
775
  function commandCheck(command) {
776
776
  return `command -v ${command}`;
777
777
  }
778
- function commandWithVersionCheck(command) {
779
- return `${commandCheck(command)} && (${command} --version 2>&1 || true)`;
778
+ export function commandWithVersionCheck(command) {
779
+ const found = commandCheck(command);
780
+ if (detectServiceShell().name === "fish") {
781
+ return `${found} && begin; ${command} --version 2>&1 || true; end`;
782
+ }
783
+ return `${found} && (${command} --version 2>&1 || true)`;
780
784
  }
781
785
  function nodeVersionCheck() {
782
786
  return [
@@ -967,8 +971,22 @@ async function main() {
967
971
  else
968
972
  throw new Error(`Unknown command: ${command}`);
969
973
  }
970
- main().catch((error) => {
971
- console.error(error instanceof Error ? error.message : String(error));
972
- process.exit(1);
973
- });
974
+ export function isCliEntrypoint(entrypoint = process.argv[1], modulePath = fileURLToPath(import.meta.url)) {
975
+ if (entrypoint === undefined)
976
+ return false;
977
+ if (entrypoint === modulePath)
978
+ return true;
979
+ try {
980
+ return realpathSync(entrypoint) === realpathSync(modulePath);
981
+ }
982
+ catch {
983
+ return false;
984
+ }
985
+ }
986
+ if (isCliEntrypoint()) {
987
+ main().catch((error) => {
988
+ console.error(error instanceof Error ? error.message : String(error));
989
+ process.exit(1);
990
+ });
991
+ }
974
992
  //# sourceMappingURL=cli.js.map