@chainingintention/pi-web-cn 1.202606.24 → 1.202606.26
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 +84 -277
- package/dist/cli.js +31 -11
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/CodeViewer-CEaJIjgA.js +4 -0
- package/dist/client/assets/{TerminalPanel-DR8I9BBO.js → TerminalPanel-BdMJbtLB.js} +1 -1
- package/dist/client/assets/UnifiedDiffViewer-Dkgg-4fh.js +34 -0
- package/dist/client/assets/index-iRSp25EB.js +2735 -0
- package/dist/client/assets/{vendor-editor-core-Bc1A7SO7.js → vendor-editor-core-C7aWiQy0.js} +2 -2
- package/dist/client/assets/{vendor-editor-languages-D0CnB2js.js → vendor-editor-languages-EW34FfVy.js} +1 -1
- package/dist/client/index.html +6 -3
- package/dist/config.js +9 -1
- package/dist/config.js.map +1 -1
- package/dist/plugin-api.d.ts +30 -2
- package/dist/server/app.js +35 -17
- package/dist/server/app.js.map +1 -1
- package/dist/server/gitRoutes.js +1 -1
- package/dist/server/gitRoutes.js.map +1 -1
- package/dist/server/machines/machineClient.js +33 -5
- package/dist/server/machines/machineClient.js.map +1 -1
- package/dist/server/machines/machineProxyRoutes.js +18 -3
- package/dist/server/machines/machineProxyRoutes.js.map +1 -1
- package/dist/server/managementEmbed.js +42 -22
- package/dist/server/managementEmbed.js.map +1 -1
- package/dist/server/sessiond/sessionProxyRoutes.js +1 -1
- package/dist/server/sessiond/sessionProxyRoutes.js.map +1 -1
- package/dist/server/sessiond.js +2 -2
- package/dist/server/sessiond.js.map +1 -1
- package/dist/server/sessions/attachmentService.js +68 -10
- package/dist/server/sessions/attachmentService.js.map +1 -1
- package/dist/server/sessions/authProviderOptions.js +1 -5
- package/dist/server/sessions/authProviderOptions.js.map +1 -1
- package/dist/server/sessions/piSessionManagerGateway.js +20 -2
- package/dist/server/sessions/piSessionManagerGateway.js.map +1 -1
- package/dist/server/sessions/piSessionService.js +515 -51
- package/dist/server/sessions/piSessionService.js.map +1 -1
- package/dist/server/sessions/sessionCleanup.js +157 -0
- package/dist/server/sessions/sessionCleanup.js.map +1 -0
- package/dist/server/sessions/sessionNameGenerator.js +39 -2
- package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
- package/dist/server/sessions/sessionRoutes.js +17 -0
- package/dist/server/sessions/sessionRoutes.js.map +1 -1
- package/dist/server/sessions/spawnSessionTool.js +7 -2
- package/dist/server/sessions/spawnSessionTool.js.map +1 -1
- package/dist/server/sessions/spawnSubsessionTool.js +14 -4
- package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
- package/dist/server/workspaceExplorerRoutes.js +74 -24
- package/dist/server/workspaceExplorerRoutes.js.map +1 -1
- package/dist/server/workspaces/effectivePathAccess.js +27 -0
- package/dist/server/workspaces/effectivePathAccess.js.map +1 -0
- package/dist/server/workspaces/fileContentService.js +118 -7
- package/dist/server/workspaces/fileContentService.js.map +1 -1
- package/dist/server/workspaces/fileOperationService.js +1 -19
- package/dist/server/workspaces/fileOperationService.js.map +1 -1
- package/dist/server/workspaces/fileSuggestions.js +311 -23
- package/dist/server/workspaces/fileSuggestions.js.map +1 -1
- package/dist/server/workspaces/fileTreeService.js +16 -7
- package/dist/server/workspaces/fileTreeService.js.map +1 -1
- package/dist/server/workspaces/imagePreviewService.js +5 -5
- package/dist/server/workspaces/imagePreviewService.js.map +1 -1
- package/dist/server/workspaces/pathAccessPolicy.js +90 -0
- package/dist/server/workspaces/pathAccessPolicy.js.map +1 -0
- package/dist/server/workspaces/pathSafety.js +19 -10
- package/dist/server/workspaces/pathSafety.js.map +1 -1
- package/dist/server/workspaces/projectPiWebConfig.js +61 -0
- package/dist/server/workspaces/projectPiWebConfig.js.map +1 -0
- package/dist/server/workspaces/workspaceDeletionRoutes.js +1 -1
- package/dist/server/workspaces/workspaceDeletionRoutes.js.map +1 -1
- package/dist/shared/apiTypes.d.ts +89 -6
- package/dist/shared/apiTypes.js +2 -0
- package/dist/shared/apiTypes.js.map +1 -1
- package/dist/shared/capabilities.js +4 -2
- package/dist/shared/capabilities.js.map +1 -1
- package/dist/shared/federatedRoutes.js +6 -1
- package/dist/shared/federatedRoutes.js.map +1 -1
- package/dist/shared/piWebConfigParsing.js +44 -3
- package/dist/shared/piWebConfigParsing.js.map +1 -1
- package/dist/shared/promptAttachments.js +30 -11
- package/dist/shared/promptAttachments.js.map +1 -1
- package/docs/assets/pi-web-desktop.png +0 -0
- package/docs/assets/pi-web-mobile.png +0 -0
- package/docs/assets/pi-web-tablet.png +0 -0
- package/docs/config.md +203 -0
- package/docs/plugins.md +128 -4
- package/package.json +3 -1
- package/dist/client/assets/CodeViewer-DA68s2LY.js +0 -4
- package/dist/client/assets/index-Bjpa_x8C.js +0 -2354
- package/docs/assets/pi-web-demo.gif +0 -0
- package/docs/assets/pi-web-demo.webm +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# PI WEB
|
|
1
|
+
# PI WEB
|
|
2
2
|
|
|
3
3
|
This fork is a translation plan for PI WEB. Its goal is to translate the plugin's displayed content into Chinese while preserving the upstream functionality.
|
|
4
4
|
|
|
@@ -6,162 +6,55 @@ This fork is a translation plan for PI WEB. Its goal is to translate the plugin'
|
|
|
6
6
|
[](https://www.npmjs.com/package/@chainingintention/pi-web-cn)
|
|
7
7
|
[](package.json)
|
|
8
8
|
[](LICENSE)
|
|
9
|
-
[](https://github.com/earendil-works/pi/tree/main/packages/coding-agent)
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
**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.**
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
**Run Pi Coding Agent from a web UI, keep sessions alive in real workspaces, and supervise them from any device.**
|
|
16
|
-
|
|
17
|
-
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.
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
With PI WEB you can:
|
|
22
|
-
|
|
23
|
-
- launch and supervise multiple coding-agent sessions in parallel;
|
|
24
|
-
- keep sessions running when your browser disconnects or the UI restarts;
|
|
25
|
-
- organize agent work by project, workspace, branch, experiment, or review;
|
|
26
|
-
- use git worktrees to isolate concurrent features and fixes;
|
|
27
|
-
- chat with Pi Coding Agent through a realtime web UI;
|
|
28
|
-
- move fluidly between laptop, phone, tablet, and desktop without moving the development environment;
|
|
29
|
-
- turn any server, desktop, or remote dev box into an agent-first development hub.
|
|
30
|
-
|
|
31
|
-
## Why use PI WEB?
|
|
12
|
+
Run agents where your code, tools, credentials, and build caches live. Supervise them from any browser.
|
|
32
13
|
|
|
33
|
-
|
|
14
|
+
Website and docs: <https://pi-web.dev/>
|
|
34
15
|
|
|
35
|
-
PI WEB
|
|
36
|
-
|
|
37
|
-
### Is PI WEB a Pi web UI?
|
|
38
|
-
|
|
39
|
-
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.
|
|
40
|
-
|
|
41
|
-
## Core model
|
|
42
|
-
|
|
43
|
-
PI WEB organizes work into four levels:
|
|
44
|
-
|
|
45
|
-
```text
|
|
46
|
-
Machine a local or remote PI WEB runtime endpoint
|
|
47
|
-
Project a folder on that machine
|
|
48
|
-
Workspace a git worktree, or the project folder for non-git projects
|
|
49
|
-
Session a chat with Pi Coding Agent running inside a workspace
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
This maps naturally to real development work:
|
|
53
|
-
|
|
54
|
-
- select the local machine or another registered PI WEB runtime;
|
|
55
|
-
- add a project once on the selected machine;
|
|
56
|
-
- use worktrees to separate branches, features, experiments, and reviews;
|
|
57
|
-
- start one or more agent sessions inside each workspace;
|
|
58
|
-
- leave sessions running even when the browser disconnects or the UI restarts.
|
|
59
|
-
|
|
60
|
-
## Features
|
|
61
|
-
|
|
62
|
-
- Add and list local or remote PI WEB machines from the action palette.
|
|
63
|
-
- Proxy remote projects, workspaces, files, git state, sessions, and terminals through the currently opened PI WEB server.
|
|
64
|
-
- Add and list server-side projects.
|
|
65
|
-
- Discover git worktrees automatically with `git worktree list --porcelain`.
|
|
66
|
-
- Support non-git folders as single-workspace projects.
|
|
67
|
-
- Start, resume, archive, and restore Pi sessions per workspace.
|
|
68
|
-
- Chat with Pi Coding Agent through realtime WebSocket events.
|
|
69
|
-
- Keep active agent runtimes alive across browser disconnects and web/API restarts.
|
|
70
|
-
- Explicitly stop or abort active session work.
|
|
71
|
-
- View live session status: streaming, compaction, bash activity, token usage, cost, model, and context usage.
|
|
72
|
-
- Send prompts, shell input, and supported commands through the Pi SDK path.
|
|
73
|
-
- Reuse your existing Pi auth and model configuration from `~/.pi/agent`.
|
|
74
|
-
- 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.
|
|
75
|
-
|
|
76
|
-
## Architecture
|
|
77
|
-
|
|
78
|
-
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.
|
|
79
|
-
|
|
80
|
-
```text
|
|
81
|
-
Browser UI
|
|
82
|
-
│
|
|
83
|
-
▼
|
|
84
|
-
Fastify Web/API process
|
|
85
|
-
│ HTTP + WebSocket proxy
|
|
86
|
-
▼
|
|
87
|
-
Session daemon
|
|
88
|
-
│
|
|
89
|
-
▼
|
|
90
|
-
Pi Coding Agent SDK
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Session daemon
|
|
94
|
-
|
|
95
|
-
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.
|
|
96
|
-
|
|
97
|
-
### Web/API/UI server
|
|
98
|
-
|
|
99
|
-
The web process serves the API and browser UI. In development it can autoreload freely while active sessions continue running in the daemon.
|
|
100
|
-
|
|
101
|
-
## State model
|
|
102
|
-
|
|
103
|
-
PI WEB keeps its own state intentionally small:
|
|
104
|
-
|
|
105
|
-
- Machines: `~/.pi-web/machines.json` stores only opt-in remote machine records; the local machine is synthesized.
|
|
106
|
-
- Projects: `~/.pi-web/projects.json`
|
|
107
|
-
- Workspaces: discovered from git worktrees, not stored
|
|
108
|
-
- Sessions and chat history: Pi's default JSONL session storage on the selected machine
|
|
109
|
-
- Active session runtimes and WebSockets: memory in each selected machine's session daemon
|
|
110
|
-
|
|
111
|
-
## Machine federation
|
|
112
|
-
|
|
113
|
-
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.
|
|
114
|
-
|
|
115
|
-
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.
|
|
116
|
-
|
|
117
|
-
## Plugins
|
|
16
|
+

|
|
118
17
|
|
|
119
|
-
PI WEB
|
|
18
|
+

|
|
120
19
|
|
|
121
|
-
|
|
20
|
+
## Why PI WEB?
|
|
122
21
|
|
|
123
|
-
|
|
22
|
+
Agentic development works better when the work environment is persistent.
|
|
124
23
|
|
|
125
|
-
|
|
126
|
-
Build a PI WEB plugin for this project. Goal: <describe the UI behavior>.
|
|
127
|
-
Before coding, read https://pi-web.dev/plugins and https://pi-web.dev/plugins.md.
|
|
128
|
-
Create it under ~/.pi-web/plugins/<plugin-id> using the documented PI WEB v1 plugin API.
|
|
129
|
-
Validate with /pi-web-plugins/manifest.json and explain reload/debug steps.
|
|
130
|
-
Do not modify PI WEB itself.
|
|
131
|
-
```
|
|
24
|
+
PI WEB lets you:
|
|
132
25
|
|
|
133
|
-
|
|
26
|
+
- keep Pi Coding Agent sessions alive after browser disconnects;
|
|
27
|
+
- run agents inside real repositories and git worktrees;
|
|
28
|
+
- supervise multiple sessions in parallel;
|
|
29
|
+
- switch between laptop, phone, tablet, and desktop;
|
|
30
|
+
- use a server, workstation, or remote dev box as your agent runtime;
|
|
31
|
+
- manage projects, workspaces, files, terminals, sessions, and remote machines from one web UI.
|
|
134
32
|
|
|
135
|
-
|
|
33
|
+
Your browser is the control surface. The work stays where it can keep running.
|
|
136
34
|
|
|
137
|
-
|
|
138
|
-
curl http://127.0.0.1:8504/pi-web-plugins/manifest.json
|
|
139
|
-
```
|
|
35
|
+
## Quick start
|
|
140
36
|
|
|
141
|
-
|
|
37
|
+
Requirements:
|
|
142
38
|
|
|
143
|
-
|
|
39
|
+
- Node.js 22 or newer
|
|
40
|
+
- npm
|
|
41
|
+
- Pi Coding Agent configured for your user
|
|
42
|
+
- git and the development tools your agents need
|
|
144
43
|
|
|
145
|
-
|
|
44
|
+
Install and start PI WEB as per-user services:
|
|
146
45
|
|
|
147
46
|
```bash
|
|
148
47
|
npm install -g @chainingintention/pi-web-cn
|
|
149
48
|
pi-web install
|
|
49
|
+
pi-web doctor
|
|
150
50
|
```
|
|
151
51
|
|
|
152
|
-
|
|
52
|
+
Then open:
|
|
153
53
|
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
loginctl show-user "$USER" -p Linger
|
|
54
|
+
```text
|
|
55
|
+
http://127.0.0.1:8504
|
|
157
56
|
```
|
|
158
57
|
|
|
159
|
-
This writes and starts PI WEB's session daemon and web/API user services. The native user-service backend is selected automatically.
|
|
160
|
-
|
|
161
|
-
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.
|
|
162
|
-
|
|
163
|
-
Open <http://127.0.0.1:8504>.
|
|
164
|
-
|
|
165
58
|
Useful commands:
|
|
166
59
|
|
|
167
60
|
```bash
|
|
@@ -173,198 +66,112 @@ pi-web version
|
|
|
173
66
|
pi-web uninstall
|
|
174
67
|
```
|
|
175
68
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
One-line install is also available for users who prefer it:
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
curl -fsSL https://raw.githubusercontent.com/jmfederico/pi-web/main/install.sh | sh
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
PI WEB is also published as a Pi package. Installing it through Pi exposes a `/pi-web` command inside Pi:
|
|
69
|
+
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).
|
|
185
70
|
|
|
186
|
-
|
|
187
|
-
pi install npm:@chainingintention/pi-web-cn
|
|
188
|
-
```
|
|
71
|
+
## Core model
|
|
189
72
|
|
|
190
|
-
|
|
73
|
+
PI WEB organizes work like this:
|
|
191
74
|
|
|
192
75
|
```text
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
/pi-web doctor
|
|
198
|
-
/pi-web version
|
|
76
|
+
Machine a local or remote PI WEB runtime endpoint
|
|
77
|
+
Project a folder on that machine
|
|
78
|
+
Workspace a git worktree, or the project folder for non-git projects
|
|
79
|
+
Session a Pi Coding Agent chat running inside a workspace
|
|
199
80
|
```
|
|
200
81
|
|
|
201
|
-
|
|
82
|
+
A typical flow:
|
|
202
83
|
|
|
203
|
-
|
|
84
|
+
1. Add a project.
|
|
85
|
+
2. Choose a workspace or git worktree.
|
|
86
|
+
3. Start a session.
|
|
87
|
+
4. Let the agent work.
|
|
88
|
+
5. Come back later from any browser.
|
|
204
89
|
|
|
205
|
-
|
|
206
|
-
pi-web-sessiond
|
|
207
|
-
PI_WEB_PORT=8504 pi-web-server
|
|
208
|
-
```
|
|
90
|
+
## Remote-first development
|
|
209
91
|
|
|
210
|
-
|
|
92
|
+
PI WEB is designed for remote AI-driven development.
|
|
211
93
|
|
|
212
|
-
|
|
213
|
-
npm install
|
|
214
|
-
npm run dev
|
|
215
|
-
```
|
|
94
|
+
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.
|
|
216
95
|
|
|
217
|
-
|
|
96
|
+
Use a private network, SSH tunnel, trusted reverse proxy, or federated PI WEB machine setup when accessing it remotely.
|
|
218
97
|
|
|
219
|
-
|
|
98
|
+
Read more: [Remote-first development](https://pi-web.dev/remote-first)
|
|
220
99
|
|
|
221
|
-
|
|
100
|
+
## Machines and fleets
|
|
222
101
|
|
|
223
|
-
|
|
224
|
-
npm run dev:sessiond
|
|
225
|
-
npm run dev:web
|
|
226
|
-
npm run dev:client
|
|
227
|
-
```
|
|
102
|
+
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, and activity from trusted remote machines.
|
|
228
103
|
|
|
229
|
-
|
|
104
|
+
Read more: [Fleet and machines guide](https://pi-web.dev/machines)
|
|
230
105
|
|
|
231
|
-
|
|
232
|
-
pi-web install --dev
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
`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.
|
|
106
|
+
## Plugins
|
|
236
107
|
|
|
237
|
-
|
|
108
|
+
PI WEB supports trusted local browser-side plugins that can add actions, workspace panels, and workspace metadata.
|
|
238
109
|
|
|
239
|
-
|
|
110
|
+
Read more: [Plugin API](https://pi-web.dev/plugins)
|
|
240
111
|
|
|
241
|
-
|
|
242
|
-
npm run build
|
|
243
|
-
npm run start:sessiond
|
|
244
|
-
PI_WEB_PORT=8504 npm start
|
|
245
|
-
```
|
|
112
|
+
## Configuration
|
|
246
113
|
|
|
247
|
-
|
|
114
|
+
Global config lives at:
|
|
248
115
|
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
npm publish --access public
|
|
116
|
+
```text
|
|
117
|
+
$PI_WEB_CONFIG
|
|
118
|
+
~/.config/pi-web/config.json
|
|
253
119
|
```
|
|
254
120
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
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.
|
|
258
|
-
|
|
259
|
-
PI WEB declares `@earendil-works/pi-coding-agent` as a peer dependency (`>=0.74.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.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
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.
|
|
263
|
-
|
|
264
|
-
The session daemon defaults to a private Unix socket at:
|
|
121
|
+
Project-local PI WEB config lives at:
|
|
265
122
|
|
|
266
123
|
```text
|
|
267
|
-
|
|
124
|
+
<project>/.pi-web/config.json
|
|
268
125
|
```
|
|
269
126
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
- `PI_WEB_PORT` / `PORT` — web server port. Defaults to `8504`.
|
|
273
|
-
- `PI_WEB_HOST` — web server bind host. Defaults to `127.0.0.1`.
|
|
274
|
-
- `PI_WEB_DATA_DIR` — PI WEB data directory. Defaults to `~/.pi-web`.
|
|
275
|
-
- `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`.
|
|
276
|
-
- `PI_WEB_SESSIOND_PORT` — optional TCP port for the daemon. If unset, the daemon listens on the Unix socket instead.
|
|
277
|
-
- `PI_WEB_SESSIOND_HOST` — daemon TCP bind host when `PI_WEB_SESSIOND_PORT` is set. Defaults to `127.0.0.1`.
|
|
278
|
-
- `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.
|
|
279
|
-
- `PI_WEB_PROJECTS_FILE` — optional override for the projects storage JSON file. Defaults to `$PI_WEB_DATA_DIR/projects.json`.
|
|
280
|
-
- `PI_WEB_MACHINES_FILE` — optional override for the remote machine registry JSON file. Defaults to `$PI_WEB_DATA_DIR/machines.json`.
|
|
281
|
-
- `PI_WEB_MAX_UPLOAD_BYTES` — maximum accepted HTTP request body size in bytes (covers pasted/attached images). Defaults to 64 MB. Also configurable as `maxUploadBytes` in `config.json`.
|
|
282
|
-
- `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.
|
|
283
|
-
- `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.
|
|
284
|
-
|
|
285
|
-
## Development services
|
|
286
|
-
|
|
287
|
-
`pi-web install --dev` creates a practical local setup with two native per-user services:
|
|
288
|
-
|
|
289
|
-
- `pi-web-sessiond` runs `npm run start:sessiond` from the checkout without autoreload.
|
|
290
|
-
- `pi-web-ui-dev` runs `npm run dev:web` and `npm run dev:client` for API reloads, bundled plugin rebuilds, and Vite HMR.
|
|
291
|
-
|
|
292
|
-
Under the hood, the native backends are systemd user services and LaunchAgents. For reference, an equivalent systemd setup looks like:
|
|
293
|
-
|
|
294
|
-
```ini
|
|
295
|
-
# ~/.config/systemd/user/pi-web-sessiond.service
|
|
296
|
-
[Unit]
|
|
297
|
-
Description=PI WEB session daemon
|
|
298
|
-
|
|
299
|
-
[Service]
|
|
300
|
-
Type=simple
|
|
301
|
-
WorkingDirectory=/srv/dev/pi-web
|
|
302
|
-
ExecStart=/bin/bash -lc 'exec npm run start:sessiond'
|
|
303
|
-
Restart=no
|
|
127
|
+
Common configuration includes host/port, path access, uploads, plugins, shortcuts, and session daemon options.
|
|
304
128
|
|
|
305
|
-
[
|
|
306
|
-
WantedBy=default.target
|
|
307
|
-
```
|
|
129
|
+
Read more: [Configuration reference](https://pi-web.dev/config)
|
|
308
130
|
|
|
309
|
-
|
|
310
|
-
# ~/.config/systemd/user/pi-web-ui-dev.service
|
|
311
|
-
[Unit]
|
|
312
|
-
Description=PI WEB UI dev server
|
|
313
|
-
After=pi-web-sessiond.service
|
|
314
|
-
Wants=pi-web-sessiond.service
|
|
315
|
-
|
|
316
|
-
[Service]
|
|
317
|
-
Type=simple
|
|
318
|
-
WorkingDirectory=/srv/dev/pi-web
|
|
319
|
-
ExecStart=/bin/bash -lc 'trap "kill 0" EXIT; npm run dev:web & npm run dev:client & wait'
|
|
320
|
-
Restart=no
|
|
321
|
-
|
|
322
|
-
[Install]
|
|
323
|
-
WantedBy=default.target
|
|
324
|
-
```
|
|
131
|
+
## Development
|
|
325
132
|
|
|
326
|
-
|
|
133
|
+
Clone the repository and run:
|
|
327
134
|
|
|
328
135
|
```bash
|
|
329
|
-
|
|
330
|
-
|
|
136
|
+
npm install
|
|
137
|
+
npm run dev
|
|
331
138
|
```
|
|
332
139
|
|
|
333
|
-
|
|
140
|
+
Open the Vite URL, usually:
|
|
334
141
|
|
|
335
|
-
```
|
|
336
|
-
|
|
142
|
+
```text
|
|
143
|
+
http://localhost:8505
|
|
337
144
|
```
|
|
338
145
|
|
|
339
|
-
|
|
146
|
+
For the split development setup:
|
|
340
147
|
|
|
341
148
|
```bash
|
|
342
|
-
|
|
149
|
+
npm run dev:sessiond
|
|
150
|
+
npm run dev:web
|
|
151
|
+
npm run dev:client
|
|
343
152
|
```
|
|
344
153
|
|
|
345
|
-
|
|
154
|
+
Validate changes with:
|
|
346
155
|
|
|
347
156
|
```bash
|
|
348
|
-
|
|
157
|
+
npm run verify
|
|
349
158
|
```
|
|
350
159
|
|
|
351
|
-
##
|
|
352
|
-
|
|
353
|
-
- Assumes trusted users and trusted server paths.
|
|
354
|
-
- Not a sandbox, permission model, or secure multi-tenant platform.
|
|
355
|
-
- Some Pi TUI slash-command behavior is not yet represented exactly in the web UI.
|
|
356
|
-
- Workspaces are discovered from existing git worktrees; UI-driven worktree management is a natural next step.
|
|
160
|
+
## Security model
|
|
357
161
|
|
|
358
|
-
|
|
162
|
+
PI WEB assumes trusted users, trusted repositories, and trusted server paths.
|
|
359
163
|
|
|
360
|
-
|
|
164
|
+
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.
|
|
361
165
|
|
|
362
|
-
|
|
363
|
-
- humans connect through the browser;
|
|
364
|
-
- work is organized by projects, workspaces, and sessions;
|
|
365
|
-
- the UI grows around the needs of agentic development rather than the habits of local IDEs.
|
|
166
|
+
## Documentation
|
|
366
167
|
|
|
367
|
-
|
|
168
|
+
- [Website](https://pi-web.dev/)
|
|
169
|
+
- [Install](https://pi-web.dev/install)
|
|
170
|
+
- [Remote-first development](https://pi-web.dev/remote-first)
|
|
171
|
+
- [Machines / fleet](https://pi-web.dev/machines)
|
|
172
|
+
- [Configuration](https://pi-web.dev/config)
|
|
173
|
+
- [Plugins](https://pi-web.dev/plugins)
|
|
174
|
+
- [FAQ](https://pi-web.dev/faq)
|
|
368
175
|
|
|
369
176
|
## License
|
|
370
177
|
|
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";
|
|
@@ -303,20 +303,21 @@ function restartOrder(refs) {
|
|
|
303
303
|
return orderServiceRefs(refs, restartServiceOrder);
|
|
304
304
|
}
|
|
305
305
|
function productionServiceDefinitions(options, configPath, executables) {
|
|
306
|
+
const environment = configEnvironment(options, configPath);
|
|
306
307
|
return [
|
|
307
308
|
{
|
|
308
309
|
...serviceRefs.sessiond,
|
|
309
310
|
description: "PI WEB session daemon",
|
|
310
311
|
shellCommand: `exec ${executables.sessiond.command}`,
|
|
311
312
|
restart: "on-failure",
|
|
312
|
-
environment
|
|
313
|
+
environment,
|
|
313
314
|
},
|
|
314
315
|
{
|
|
315
316
|
...serviceRefs.web,
|
|
316
317
|
description: "PI WEB server",
|
|
317
318
|
shellCommand: `exec ${executables.web.command}`,
|
|
318
319
|
restart: "on-failure",
|
|
319
|
-
environment
|
|
320
|
+
environment,
|
|
320
321
|
after: ["sessiond"],
|
|
321
322
|
wants: ["sessiond"],
|
|
322
323
|
},
|
|
@@ -343,13 +344,14 @@ function validateDevCheckout(root) {
|
|
|
343
344
|
throw new Error(`Development mode requires missing npm scripts: ${missing.join(", ")}.`);
|
|
344
345
|
}
|
|
345
346
|
function devServiceDefinitions(options, configPath, root) {
|
|
347
|
+
const environment = configEnvironment(options, configPath);
|
|
346
348
|
return [
|
|
347
349
|
{
|
|
348
350
|
...serviceRefs.sessiond,
|
|
349
351
|
description: "PI WEB session daemon (dev)",
|
|
350
352
|
shellCommand: "exec npm run start:sessiond",
|
|
351
353
|
restart: "never",
|
|
352
|
-
environment
|
|
354
|
+
environment,
|
|
353
355
|
workingDirectory: root,
|
|
354
356
|
},
|
|
355
357
|
{
|
|
@@ -357,7 +359,7 @@ function devServiceDefinitions(options, configPath, root) {
|
|
|
357
359
|
description: "PI WEB UI dev server",
|
|
358
360
|
shellCommand: `exec /usr/bin/env bash -c ${serviceShellQuote('trap "kill 0" EXIT; npm run dev:web & npm run dev:client & wait')}`,
|
|
359
361
|
restart: "never",
|
|
360
|
-
environment
|
|
362
|
+
environment,
|
|
361
363
|
after: ["sessiond"],
|
|
362
364
|
wants: ["sessiond"],
|
|
363
365
|
workingDirectory: root,
|
|
@@ -773,8 +775,12 @@ function systemdUserServiceShellCommand(command, cwd) {
|
|
|
773
775
|
function commandCheck(command) {
|
|
774
776
|
return `command -v ${command}`;
|
|
775
777
|
}
|
|
776
|
-
function commandWithVersionCheck(command) {
|
|
777
|
-
|
|
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)`;
|
|
778
784
|
}
|
|
779
785
|
function nodeVersionCheck() {
|
|
780
786
|
return [
|
|
@@ -965,8 +971,22 @@ async function main() {
|
|
|
965
971
|
else
|
|
966
972
|
throw new Error(`Unknown command: ${command}`);
|
|
967
973
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
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
|
+
}
|
|
972
992
|
//# sourceMappingURL=cli.js.map
|