@chainingintention/pi-web-cn 1.202607.3 → 1.202607.5

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 (89) hide show
  1. package/README.md +9 -3
  2. package/dist/client/assets/{CodeViewer-CGV4uBeZ.js → CodeViewer-CfZodNYb.js} +1 -1
  3. package/dist/client/assets/{TerminalPanel-CeJN9p9P.js → TerminalPanel-eua763mA.js} +1 -1
  4. package/dist/client/assets/{UnifiedDiffViewer-BSzsWx-m.js → UnifiedDiffViewer-C9-QeGMj.js} +1 -1
  5. package/dist/client/assets/{index-BA1zmHnv.js → index-BiFWXoRZ.js} +767 -486
  6. package/dist/client/index.html +2 -2
  7. package/dist/client/manifest.webmanifest +1 -1
  8. package/dist/docker/piWebDockerCommandPlan.js +211 -0
  9. package/dist/docker/piWebDockerCommandPlan.js.map +1 -0
  10. package/dist/pi-web-plugins/updates/pi-web-plugin.js +15 -5
  11. package/dist/pi-web-plugins/updates/updatesLogic.js +37 -5
  12. package/dist/pi-web-plugins/workspace-tasks/workspaceTasksClient.js +6 -1
  13. package/dist/piWebVersionReport.js +4 -0
  14. package/dist/piWebVersionReport.js.map +1 -1
  15. package/dist/plugin-api.d.ts +3 -1
  16. package/dist/server/app.js +24 -16
  17. package/dist/server/app.js.map +1 -1
  18. package/dist/server/configRoutes.js +109 -2
  19. package/dist/server/configRoutes.js.map +1 -1
  20. package/dist/server/gitRoutes.js +3 -16
  21. package/dist/server/gitRoutes.js.map +1 -1
  22. package/dist/server/httpSessions.js +34 -0
  23. package/dist/server/httpSessions.js.map +1 -0
  24. package/dist/server/machines/machineProxyRoutes.js +64 -11
  25. package/dist/server/machines/machineProxyRoutes.js.map +1 -1
  26. package/dist/server/machines/machineService.js +4 -26
  27. package/dist/server/machines/machineService.js.map +1 -1
  28. package/dist/server/managementEmbed.js +8 -40
  29. package/dist/server/managementEmbed.js.map +1 -1
  30. package/dist/server/normalAuth.js +90 -30
  31. package/dist/server/normalAuth.js.map +1 -1
  32. package/dist/server/piPackageRoutes.js +87 -0
  33. package/dist/server/piPackageRoutes.js.map +1 -0
  34. package/dist/server/piPackageService.js +69 -0
  35. package/dist/server/piPackageService.js.map +1 -0
  36. package/dist/server/piWebPluginService.js +43 -8
  37. package/dist/server/piWebPluginService.js.map +1 -1
  38. package/dist/server/piWebStatus.js +71 -2
  39. package/dist/server/piWebStatus.js.map +1 -1
  40. package/dist/server/requestLogging.js +47 -0
  41. package/dist/server/requestLogging.js.map +1 -0
  42. package/dist/server/sessiond/sessionProxyRoutes.js +1 -6
  43. package/dist/server/sessiond/sessionProxyRoutes.js.map +1 -1
  44. package/dist/server/sessiond.js +2 -1
  45. package/dist/server/sessiond.js.map +1 -1
  46. package/dist/server/sessions/builtinCommands.js +1 -1
  47. package/dist/server/sessions/builtinCommands.js.map +1 -1
  48. package/dist/server/sessions/piSessionService.js +39 -2
  49. package/dist/server/sessions/piSessionService.js.map +1 -1
  50. package/dist/server/sessions/sessionCleanup.js +1 -13
  51. package/dist/server/sessions/sessionCleanup.js.map +1 -1
  52. package/dist/server/sessions/sessionCommandService.js +16 -0
  53. package/dist/server/sessions/sessionCommandService.js.map +1 -1
  54. package/dist/server/sessions/sessionNameGenerator.js +27 -44
  55. package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
  56. package/dist/server/sessions/sessionUiEvents.js +2 -29
  57. package/dist/server/sessions/sessionUiEvents.js.map +1 -1
  58. package/dist/server/sessions/subsessionTranscript.js +1 -29
  59. package/dist/server/sessions/subsessionTranscript.js.map +1 -1
  60. package/dist/server/sessions/toolSummary.js +37 -0
  61. package/dist/server/sessions/toolSummary.js.map +1 -0
  62. package/dist/server/terminalProxyRoutes.js +3 -11
  63. package/dist/server/terminalProxyRoutes.js.map +1 -1
  64. package/dist/server/workspaceExplorerRoutes.js +8 -41
  65. package/dist/server/workspaceExplorerRoutes.js.map +1 -1
  66. package/dist/server/workspaces/fileSuggestions.js +7 -3
  67. package/dist/server/workspaces/fileSuggestions.js.map +1 -1
  68. package/dist/server/workspaces/workspaceContext.js +3 -0
  69. package/dist/server/workspaces/workspaceContext.js.map +1 -1
  70. package/dist/server/workspaces/workspaceDeletionRoutes.js +1 -6
  71. package/dist/server/workspaces/workspaceDeletionRoutes.js.map +1 -1
  72. package/dist/server/workspaces/workspaceRouteContext.js +13 -0
  73. package/dist/server/workspaces/workspaceRouteContext.js.map +1 -0
  74. package/dist/shared/activity.js +0 -15
  75. package/dist/shared/activity.js.map +1 -1
  76. package/dist/shared/apiTypes.d.ts +39 -17
  77. package/dist/shared/apiTypes.js +3 -0
  78. package/dist/shared/apiTypes.js.map +1 -1
  79. package/dist/shared/capabilities.js +27 -2
  80. package/dist/shared/capabilities.js.map +1 -1
  81. package/dist/shared/federatedRoutes.js +8 -1
  82. package/dist/shared/federatedRoutes.js.map +1 -1
  83. package/dist/shared/piWebStatusParsing.js +20 -8
  84. package/dist/shared/piWebStatusParsing.js.map +1 -1
  85. package/docs/config.md +21 -12
  86. package/docs/plugins.md +28 -14
  87. package/package.json +7 -8
  88. package/dist/server/workspaces/fileUploadService.js +0 -43
  89. package/dist/server/workspaces/fileUploadService.js.map +0 -1
package/docs/config.md CHANGED
@@ -11,7 +11,9 @@ PI WEB uses two config files:
11
11
  - **Global PI WEB config:** `$PI_WEB_CONFIG`, or `$XDG_CONFIG_HOME/pi-web/config.json`, or `~/.config/pi-web/config.json`.
12
12
  - **Project-local PI WEB config:** `<project>/.pi-web/config.json` for commit-able project settings.
13
13
 
14
- Each PI WEB machine has its own config. When using Fleet/machine federation, edit a remote machine's config by opening that machine directly or changing files on that machine.
14
+ Each PI WEB machine has its own config. When using Fleet/machine federation, Settings uses the selected machine for config that affects work running there: session daemon tools, PI WEB plugin enablement, external path access, and upload defaults. Gateway/browser-only settings stay local to the gateway: keyboard shortcuts, remote machine registry/tokens, and gateway host/port/allowed-hosts. Remote servers that do not advertise selected-machine settings support report those settings as unavailable instead of silently falling back to the gateway.
15
+
16
+ Pi package settings are separate from PI WEB config. They live in Pi's package-manager settings on the target machine and are managed by Pi (`pi install`, `pi remove`, `pi update`) or **Settings → Pi packages**. In a federated setup, **Settings → Pi packages** targets the currently selected machine. The PI WEB `plugins` config key only enables or disables discovered PI WEB browser plugins on the machine whose config you are editing; it does not install, remove, or update Pi packages.
15
17
 
16
18
  If you installed services with a custom config path, rerun `pi-web install --config /path/to/config.json` after changing that path or after upgrading from a version that only applied the custom path to the web service. This regenerates service files so the web/API and session daemon use the same `PI_WEB_CONFIG`.
17
19
 
@@ -29,12 +31,13 @@ Environment overrides include `PI_WEB_HOST`, `PI_WEB_PORT` / `PORT`, `PI_WEB_ALL
29
31
 
30
32
  Process restarts depend on the key:
31
33
 
32
- - `host` / `port`: restart the web/API service or process.
33
- - `maxUploadBytes`: restart both the web/API process and the session daemon.
34
- - `spawnSessions` / `subsessions`: restart the session daemon.
34
+ - `host` / `port`: restart the gateway web/API service or process.
35
+ - `maxUploadBytes`: restart both the web/API process and the session daemon on that machine.
36
+ - `spawnSessions` / `subsessions`: restart the session daemon on that machine.
35
37
  - `pathAccess`: applies on the next request; existing file views may need a browser refresh.
36
38
  - `uploads.defaultFolder`: applies to newly opened Files upload dialogs and new direct drag/drop batches after config/workspace refresh.
37
- - `plugins`: reload the browser tab after changing plugin enablement.
39
+ - `plugins`: reload the browser tab after changing PI WEB plugin enablement.
40
+ - Pi package install/remove/update: not a PI WEB config key; after a mutation, type `/reload` in each idle PI WEB session on the target machine to refresh Pi runtime resources such as extensions, skills, prompt templates, themes, and context/system prompt files as supported by Pi. Reload the browser page separately for PI WEB browser plugin changes. A routine session daemon restart is not required.
38
41
  - `shortcuts`: saved settings apply in the browser after config refresh/save.
39
42
 
40
43
  ## Global config example
@@ -88,7 +91,7 @@ Plugins may own separate project files, such as `.pi-web/tasks.json` for the bui
88
91
 
89
92
  ## Configuration matrix
90
93
 
91
- Rows with JSON key `—` are runtime-only environment variables, not config-file keys.
94
+ Rows with JSON key `—` are runtime-only environment variables, not config-file keys. `Global` means machine-global. In Settings, selected-machine-safe global keys (`pathAccess`, `uploads`, `maxUploadBytes`, `spawnSessions`, `subsessions`, and `plugins`) are edited for the selected machine; gateway host/port/allowed-hosts, keyboard shortcuts, and machine registry/tokens stay local.
92
95
 
93
96
  | Config | JSON key | Env var | Scope | Project-local behavior | Applies / restart |
94
97
  | --- | --- | --- | --- | --- | --- |
@@ -98,9 +101,9 @@ Rows with JSON key `—` are runtime-only environment variables, not config-file
98
101
  | Dev-server allowed hosts | `allowedHosts` | `PI_WEB_ALLOWED_HOSTS` | Global | Not supported locally | Restart dev web/UI |
99
102
  | External filesystem roots | `pathAccess.allowedPaths` | — | Global + project | **Merges**: global roots first, then project roots; duplicates removed | Next file request; refresh existing views if needed |
100
103
  | Manual file upload default folder | `uploads.defaultFolder` | — | Global + project | **Overrides**: project value wins for workspaces in that project; otherwise global/default applies | New Upload dialogs and direct drag/drop batches after config/workspace refresh |
101
- | Upload/body limit | `maxUploadBytes` | `PI_WEB_MAX_UPLOAD_BYTES` | Global | Not supported locally | Restart web/API and session daemon |
102
- | Agent can spawn sessions | `spawnSessions` | `PI_WEB_SPAWN_SESSIONS` | Global/session daemon | Not supported locally | Restart session daemon |
103
- | Tracked subsessions (beta) | `subsessions` | `PI_WEB_SUBSESSIONS` | Global/session daemon | Not supported locally; also requires `spawnSessions` | Restart session daemon |
104
+ | Upload/body limit | `maxUploadBytes` | `PI_WEB_MAX_UPLOAD_BYTES` | Global | Not supported locally | Restart web/API and session daemon on that machine |
105
+ | Agent can spawn sessions | `spawnSessions` | `PI_WEB_SPAWN_SESSIONS` | Global/session daemon | Not supported locally | Restart session daemon on that machine |
106
+ | Tracked subsessions (beta) | `subsessions` | `PI_WEB_SUBSESSIONS` | Global/session daemon | Not supported locally; also requires `spawnSessions` | Restart session daemon on that machine |
104
107
  | Plugin enablement/settings | `plugins.<id>.enabled`, `plugins.<id>.settings` | — | Global | Not core local config; plugins may read their own project files | Reload browser tab |
105
108
  | Keyboard shortcuts | `shortcuts.<actionId>` | — | Global | Not supported locally | Applies after settings save/config refresh |
106
109
  | Project config version | `version` | — | Project | Project-local only; must be `1` when present | Next project-config read |
@@ -133,6 +136,8 @@ Accepted root forms:
133
136
 
134
137
  When an absolute request is served, PI WEB expands `~`, canonicalizes the configured roots with `realpath`, requires roots to be existing directories, and rejects symlink escapes outside the allowed roots.
135
138
 
139
+ In **Settings → General**, external filesystem roots are saved on the selected machine. Gateway host, port, and allowed-hosts fields stay on the gateway config.
140
+
136
141
  This is not a sandbox for the underlying Pi Coding Agent or your OS user. It only controls PI WEB UI/API file exposure outside a workspace.
137
142
 
138
143
  ### Manual upload defaults
@@ -156,9 +161,9 @@ The value must be a non-empty workspace-relative folder. PI WEB normalizes repea
156
161
 
157
162
  Manual uploads use the workspace file-write path: paths stay workspace-relative, parent folder creation is enabled by default, and overwrite is disabled by default. Direct drag/drop always keeps `overwrite` off; the review dialog lets you explicitly enable overwrite when needed. Browser-owned XHR progress is shown per batch/file, conflicts and errors stay visible in the upload progress UI, and the final file-write response is the source of truth.
158
163
 
159
- For machine federation, current remote PI WEB servers return `workspace.effectiveConfig.uploads.defaultFolder` on the existing workspace-list response. Older remote servers can omit that optional field without breaking clients; the Files panel falls back to the global/default upload folder.
164
+ For machine federation, Settings saves the global upload default on the selected machine. Current remote PI WEB servers also return `workspace.effectiveConfig.uploads.defaultFolder` on the existing workspace-list response. Older remote servers can omit that optional field without breaking clients; the Files panel falls back to the global/default upload folder.
160
165
 
161
- The per-request size limit is still controlled by `maxUploadBytes` / `PI_WEB_MAX_UPLOAD_BYTES`.
166
+ The per-request size limit is still controlled by `maxUploadBytes` / `PI_WEB_MAX_UPLOAD_BYTES` on the machine serving the upload.
162
167
 
163
168
  ### Session daemon tools
164
169
 
@@ -168,9 +173,13 @@ The per-request size limit is still controlled by `maxUploadBytes` / `PI_WEB_MAX
168
173
 
169
174
  Tracked subsessions let an agent delegate work to child sessions, get notified when children stop working, and inspect their transcripts.
170
175
 
176
+ In **Settings → Session daemon**, these keys are saved on the selected machine. Restart the session daemon on that machine after changing them.
177
+
171
178
  ### Plugin config
172
179
 
173
- Plugins are enabled by default. Set `plugins.<id>.enabled` to `false` to remove a plugin from `/pi-web-plugins/manifest.json` before the browser imports it.
180
+ The `plugins` key is only for PI WEB browser plugin enablement/settings on the machine whose config you are editing. It does not install, remove, or update Pi packages; use **Settings → Pi packages** or Pi's package manager for package operations. In a federated setup, **Settings → PI WEB plugins** and **Settings → Pi packages** both target the currently selected machine, and each panel labels where changes will be saved or run.
181
+
182
+ Plugins are enabled by default. Set `plugins.<id>.enabled` to `false` to remove a plugin from that machine's `/pi-web-plugins/manifest.json` before the browser imports it. Settings lists discovered plugins from the selected machine, including disabled entries exposed by that machine.
174
183
 
175
184
  ```json
176
185
  {
package/docs/plugins.md CHANGED
@@ -13,6 +13,18 @@ Plugins can currently:
13
13
 
14
14
  They do **not** run in the session daemon, do not get a server-side hook API, and are not sandboxed.
15
15
 
16
+ ## Pi packages vs PI WEB plugins
17
+
18
+ **Pi packages** are packages managed by Pi (`pi install`, `pi remove`, `pi update`). A Pi package can provide extensions, skills, prompt templates, themes, context/system prompt files, and/or PI WEB browser plugins. Many Pi packages do not include a PI WEB plugin.
19
+
20
+ **PI WEB plugins** are browser-side PI WEB UI modules discovered from bundled, local, dev, and installed Pi-package sources. Enabling or disabling a PI WEB plugin is a PI WEB config task; installing, removing, or updating a Pi package is a Pi package-manager task.
21
+
22
+ Use **Settings → Pi packages** to view configured Pi packages or install/remove/update a package. Enter only the package source, such as `npm:@scope/package`, a git/URL source, or a local path. PI WEB uses Pi's default package location, equivalent to `pi install <source>`, and does not ask for an install location.
23
+
24
+ When machine federation is enabled, **Settings → Pi packages** targets the currently selected machine. The panel labels whether changes will run on the local/gateway machine or on a selected remote PI WEB machine. If an older or unavailable remote PI WEB server does not expose package-management routes, PI WEB reports the package management operation as unsupported or unavailable instead of silently falling back to the gateway.
25
+
26
+ Use **Settings → PI WEB plugins** to enable or disable discovered PI WEB browser plugins before the browser imports them. In a federated setup, this plugin enablement surface targets the currently selected machine and labels where changes are saved. If an older or unavailable remote PI WEB server does not advertise selected-machine settings support, PI WEB reports the plugin settings as unsupported or unavailable instead of silently falling back to the gateway. After installing, removing, or updating a Pi package, type `/reload` in each idle PI WEB session on the target machine to refresh Pi runtime resources such as extensions, skills, prompt templates, themes, and context/system prompt files as supported by Pi. Reload the browser page separately for newly discovered or changed PI WEB browser plugins. A routine session daemon restart is not required.
27
+
16
28
  ## Trust model
17
29
 
18
30
  Plugins run as JavaScript in the browser app. Treat them as trusted code:
@@ -140,7 +152,7 @@ When [machine federation](https://pi-web.dev/machines) is enabled, PI WEB also l
140
152
  - remote theme contributions are ignored for now because themes are app-wide;
141
153
  - mixed PI WEB versions across federated machines are best-effort and not guaranteed compatible.
142
154
 
143
- Remote plugin enablement is controlled by the remote machine's PI WEB plugin config. To edit or disable a remote machine plugin, open that machine directly or update its config file.
155
+ Remote plugin enablement is controlled by the remote machine's PI WEB plugin config. To edit or disable a remote machine plugin, select that machine and use **Settings → PI WEB plugins** when the remote server exposes selected-machine settings, or open that machine directly/update its config file.
144
156
 
145
157
  Plugin package metadata may set `machineSpecific: true` when the plugin's meaning is tied to the selected PI WEB machine:
146
158
 
@@ -155,9 +167,11 @@ const url = new URL("./asset.json", import.meta.url);
155
167
 
156
168
  If a remote plugin constructs absolute asset URLs, it should use the `pluginId` from `activate()` because PI WEB gives remote plugins a gateway-scoped runtime id. Hard-coded `/pi-web-plugins/<original-id>/...` URLs may point at the gateway instead of the remote machine.
157
169
 
158
- ## Manage plugins
170
+ ## Manage PI WEB plugins
171
+
172
+ Open **Settings → PI WEB plugins** to review discovered bundled, local, dev, and Pi package plugins for the selected PI WEB machine. When the local machine is selected, this is the gateway plugin list; when a remote machine is selected, the list comes from that remote PI WEB server and includes disabled discovered plugins it exposes. PI WEB can disable any discovered selected-machine plugin before the browser imports it. Core app contributions such as the built-in command palette, base workspace tools, and themes are not managed through this plugin list.
159
173
 
160
- Open **Settings → Plugins** to review discovered bundled, local, dev, and Pi package plugins for the PI WEB gateway you opened. PI WEB can disable any discovered gateway plugin before the browser imports it. Core app contributions such as the built-in command palette, base workspace tools, and themes are not managed through this plugin list.
174
+ This surface is only for PI WEB plugin enablement. To install, remove, or update Pi packages that may provide plugins or other Pi resources, use **Settings → Pi packages**. In a federated setup, both the Pi packages panel and the PI WEB plugins panel target the selected machine; plugin enablement still writes the PI WEB `plugins` config key rather than changing Pi package-manager settings.
161
175
 
162
176
  Plugin preferences are stored under the top-level `plugins` config key in the PI WEB config file:
163
177
 
@@ -183,14 +197,14 @@ After changing plugin enablement, reload the PI WEB browser tab. Already-loaded
183
197
 
184
198
  PI WEB ships core, discoverable plugins in the main `@chainingintention/pi-web-cn` npm package. No separate `pi install` step is required: update PI WEB, reload the browser tab, and the bundled plugins appear in `/pi-web-plugins/manifest.json`.
185
199
 
186
- Built-in plugins can be managed from **Settings → Plugins** or with the top-level `plugins` config key.
200
+ Built-in plugins can be managed from **Settings → PI WEB plugins** or with the top-level `plugins` config key.
187
201
 
188
202
  ### Updates
189
203
 
190
204
  **Plugin id:** `updates`
191
205
  **What it does:** adds a conditional **Updates** workspace tab with PI WEB update, restart, and installed-service guidance.
192
206
 
193
- Updates is enabled by default. It declares `machineSpecific: true` so the gateway Updates tab only appears for the local machine; while a remote machine is selected, that remote machine's Updates plugin is used if available. To hide it, disable `updates` in **Settings → Plugins** or set:
207
+ Updates is enabled by default. It declares `machineSpecific: true` so the gateway Updates tab only appears for the local machine; while a remote machine is selected, that remote machine's Updates plugin is used if available. To hide it, disable `updates` in **Settings → PI WEB plugins** or set:
194
208
 
195
209
  ```json
196
210
  {
@@ -206,7 +220,7 @@ Updates is enabled by default. It declares `machineSpecific: true` so the gatewa
206
220
  **Config file:** `.pi-web/tasks.json`
207
221
  **What it does:** adds a **Tasks** workspace tab for running configured shell commands in dedicated PI WEB terminals.
208
222
 
209
- Workspace Tasks is enabled by default. To hide it, disable `workspace-tasks` in **Settings → Plugins** or set:
223
+ Workspace Tasks is enabled by default. To hide it, disable `workspace-tasks` in **Settings → PI WEB plugins** or set:
210
224
 
211
225
  ```json
212
226
  {
@@ -223,11 +237,11 @@ Configure workspace tasks in `.pi-web/tasks.json`:
223
237
  "version": 1,
224
238
  "tasks": [
225
239
  {
226
- "id": "docker.start",
227
- "title": "Start Docker",
228
- "group": "Docker",
229
- "description": "Start the local Docker Compose environment.",
230
- "command": "./docker/scripts/docker-compose-dev up -d"
240
+ "id": "app.start",
241
+ "title": "Start app",
242
+ "group": "Development",
243
+ "description": "Start the local development server.",
244
+ "command": "npm run dev"
231
245
  },
232
246
  {
233
247
  "id": "db.reset",
@@ -273,7 +287,7 @@ PI WEB builds the gateway `/pi-web-plugins/manifest.json` from these sources:
273
287
 
274
288
  Entries may be real directories or symlinks. This is the recommended development workflow.
275
289
 
276
- 3. Installed Pi packages that expose PI WEB plugin metadata. Pi packages may be user or project scoped.
290
+ 3. Installed Pi packages that expose PI WEB plugin metadata. Pi packages may be user or project scoped. Installing/removing/updating Pi packages is done from **Settings → Pi packages** (or Pi's package manager), not from the PI WEB plugin enable/disable list.
277
291
 
278
292
  Remote machines expose their own manifests through the gateway at `/api/machines/<machine-id>/pi-web-plugins/manifest.json`. Those plugin modules are rewritten to gateway-scoped asset URLs and registered under machine-scoped runtime ids so duplicate plugin ids on different machines do not collide.
279
293
 
@@ -746,7 +760,7 @@ Labels should use the same helper through a plugin-owned cache because `items()`
746
760
  const envCache = new Map();
747
761
 
748
762
  function envKey(machine, workspace) {
749
- return `${machine.id}:${workspace.id}:docker/development.be-go.local.env`;
763
+ return `${machine.id}:${workspace.id}:.env.local`;
750
764
  }
751
765
 
752
766
  function loadEnvLabel(context) {
@@ -756,7 +770,7 @@ function loadEnvLabel(context) {
756
770
 
757
771
  const pending = { status: "loading", label: undefined };
758
772
  envCache.set(key, pending);
759
- context.files.readFile("docker/development.be-go.local.env")
773
+ context.files.readFile(".env.local")
760
774
  .then((file) => {
761
775
  pending.status = "ready";
762
776
  pending.label = file.content.match(/^DEV_URL=(.+)$/m)?.[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainingintention/pi-web-cn",
3
- "version": "1.202607.3",
3
+ "version": "1.202607.5",
4
4
  "description": "Remote web UI and browser control plane for persistent Pi Coding Agent sessions.",
5
5
  "license": "MIT",
6
6
  "author": "Federico Jaramillo Martinez",
@@ -64,7 +64,6 @@
64
64
  "@codemirror/legacy-modes": "^6.5.2",
65
65
  "@codemirror/state": "^6.6.0",
66
66
  "@codemirror/view": "^6.42.1",
67
- "@fastify/multipart": "^10.0.0",
68
67
  "@fastify/static": "^9.1.3",
69
68
  "@fastify/websocket": "^11.2.0",
70
69
  "@xterm/addon-fit": "^0.11.0",
@@ -79,9 +78,9 @@
79
78
  },
80
79
  "devDependencies": {
81
80
  "@changesets/cli": "^2.31.0",
82
- "@earendil-works/pi-agent-core": "^0.79.1",
83
- "@earendil-works/pi-ai": "^0.79.1",
84
- "@earendil-works/pi-coding-agent": "^0.79.1",
81
+ "@earendil-works/pi-agent-core": "^0.80.3",
82
+ "@earendil-works/pi-ai": "^0.80.3",
83
+ "@earendil-works/pi-coding-agent": "^0.80.3",
85
84
  "@eslint/js": "^10.0.1",
86
85
  "@types/node": "^24.10.1",
87
86
  "@types/ws": "^8.18.1",
@@ -110,9 +109,9 @@
110
109
  "homepage": "https://github.com/nayuto-wakusei/pi-web-ChineseTranslation#readme",
111
110
  "packageManager": "npm@11.11.0",
112
111
  "peerDependencies": {
113
- "@earendil-works/pi-agent-core": ">=0.78.0 <1",
114
- "@earendil-works/pi-ai": ">=0.78.0 <1",
115
- "@earendil-works/pi-coding-agent": ">=0.78.0 <1"
112
+ "@earendil-works/pi-agent-core": ">=0.80.0 <1",
113
+ "@earendil-works/pi-ai": ">=0.80.0 <1",
114
+ "@earendil-works/pi-coding-agent": ">=0.80.0 <1"
116
115
  },
117
116
  "keywords": [
118
117
  "pi-package",
@@ -1,43 +0,0 @@
1
- import { createWriteStream } from "node:fs";
2
- import { randomUUID } from "node:crypto";
3
- import { rename, rm, stat, writeFile } from "node:fs/promises";
4
- import { dirname, join } from "node:path";
5
- import { pipeline } from "node:stream/promises";
6
- import { resolveParentInsideWorkspace } from "./pathSafety.js";
7
- export async function uploadWorkspaceFile(rootPath, input) {
8
- if (!isWorkspaceUploadInput(input))
9
- throw new Error("Upload body must include path and contentBase64");
10
- if (!isBase64Content(input.contentBase64))
11
- throw new Error("contentBase64 must be valid base64");
12
- const { target, relativePath } = await resolveParentInsideWorkspace(rootPath, input.path);
13
- const buffer = Buffer.from(input.contentBase64, "base64");
14
- await writeFile(target, buffer);
15
- const s = await stat(target);
16
- return { path: relativePath, size: s.size, modifiedAt: s.mtime.toISOString() };
17
- }
18
- export async function uploadWorkspaceFileStream(rootPath, path, stream) {
19
- if (path === undefined || path === "")
20
- throw new Error("Upload body must include path and file");
21
- const { target, relativePath } = await resolveParentInsideWorkspace(rootPath, path);
22
- const tempTarget = join(dirname(target), `${relativePath.split("/").pop() ?? "upload"}.${randomUUID()}.uploading`);
23
- try {
24
- await pipeline(stream, createWriteStream(tempTarget));
25
- await rename(tempTarget, target);
26
- }
27
- catch (error) {
28
- await rm(tempTarget, { force: true }).catch(() => undefined);
29
- throw error;
30
- }
31
- const s = await stat(target);
32
- return { path: relativePath, size: s.size, modifiedAt: s.mtime.toISOString() };
33
- }
34
- function isWorkspaceUploadInput(input) {
35
- return typeof input === "object"
36
- && input !== null
37
- && typeof Reflect.get(input, "path") === "string"
38
- && typeof Reflect.get(input, "contentBase64") === "string";
39
- }
40
- function isBase64Content(value) {
41
- return value === "" || /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/u.test(value);
42
- }
43
- //# sourceMappingURL=fileUploadService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fileUploadService.js","sourceRoot":"","sources":["../../../src/server/workspaces/fileUploadService.ts"],"names":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