pi-webapp 0.1.27 → 0.1.29

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/docs/desktop.md CHANGED
@@ -140,9 +140,53 @@ Actual signed replacement still needs signed old/new applications and separate
140
140
  release QA; unit tests and ad-hoc smoke do not certify it. Existing desktop builds
141
141
  without this updater need one manual upgrade. Public signing/notarization remains
142
142
  separately authorized; the wrapper does not discover certificates automatically.
143
- Desktop-managed backends reject the Web/npm update and restart paths,
144
- so the UI cannot overwrite the bundled runtime. A desktop window attached to an
145
- existing npm-managed backend preserves that backend's original update behavior.
143
+ ### Business-package updates (independent of the desktop shell)
144
+
145
+ Capable desktop shells set `PI_WEBAPP_DESKTOP_PACKAGE_UPDATES=1`. In these shells,
146
+ **Settings → App updates → Update and restart** uses npm to update `pi-webapp`,
147
+ just like the browser launcher. This does **not** replace Electron, standalone
148
+ Node, app icons or any files inside `pi.app`. Those still use the desktop installer
149
+ channel above. Settings and About show the running business-package version
150
+ separately from the desktop shell version/build.
151
+
152
+ - An exact npm release is installed into a fresh private directory under
153
+ `~/.pi/agent/pi-web/releases/<version>-<unique-id>/`. npm integrity checking and
154
+ engine requirements apply; dependency lifecycle scripts remain disabled.
155
+ - The currently tested Pi SDK pair is explicitly pinned. The exact matching
156
+ `node-pty` payload is copied from the current runtime and tested with the same
157
+ standalone Node using an interactive PTY probe. A changed native dependency,
158
+ incompatible Node engine or failed probe aborts the update before selection;
159
+ these may require a new shell installer. No compiler or new SDK is silently installed.
160
+ - A separate `desktop-update.json` selects the desktop business package, with one
161
+ previous selection for rollback; the npm launcher's `update.json` is untouched.
162
+ The shell validates the selected path, package identity and files before launch.
163
+ On a failed startup, it tries the previous selection, then its bundled fallback.
164
+ - Updating is blocked while any retained chat is running or any terminal is open.
165
+ New mutations are locked during download/restart, so another browser cannot
166
+ start work while the update is being installed. Finish tasks and close terminals
167
+ first; do not update silently during an active session.
168
+ - A supervised restart preserves the authenticated loopback address, allowing both
169
+ desktop and browser to reconnect. The shell follows only its authenticated desktop
170
+ successor for shutdown ownership; merely attaching to a shared service never claims it.
171
+ - Shell/backend compatibility uses `package.json`'s `piWebappDesktopProtocol` plus an
172
+ explicitly versioned desktop protocol in launcher state and the authenticated
173
+ version response, not equal npm versions. An incompatible package is rejected
174
+ before it is selected.
175
+ Unknown protocols are rejected; older unmarked services retain their existing
176
+ exact-version/legacy checks. Breaking that protocol requires a shell update.
177
+
178
+ **Migration:** published build 8/9 shells do not advertise this capability and must
179
+ be replaced once with build 10 or a newer capable desktop shell. Build 10 can attach
180
+ to genuine npm 0.1.26/0.1.27 services with bridge-v1 metadata but no desktop protocol
181
+ marker: it verifies their exact known identity, then probes authenticated session and
182
+ initial event-snapshot schemas using GET only. It never stops or claims that service;
183
+ existing chats and terminals survive the attachment. Unknown versions/protocols still
184
+ fail closed. Once all work is idle, use the existing Web update UI to move that npm
185
+ service to a protocol-marked release. All four native release jobs verify this
186
+ migration against the genuine npm 0.1.27 package before publication. Updating npm alone
187
+ cannot add it to an already installed shell. Older shells continue to reject npm
188
+ updates rather than accidentally modifying their bundled runtime. A desktop window
189
+ attached to an existing npm-managed backend preserves that backend's update behavior.
146
190
 
147
191
  ### Upgrading from the former “Pi Webapp” app
148
192
 
@@ -259,8 +303,10 @@ The existing launcher state directory and exclusive lock are reused under
259
303
  `~/.pi/agent/pi-web/` (or `PI_CODING_AGENT_DIR`). Model credentials and Pi sessions
260
304
  stay in Pi's existing data directory, not inside the application bundle.
261
305
 
262
- - The desktop checks a live launcher's bridge version, exact app version, token
263
- and authenticated version endpoint before attaching. The released **0.1.19**
306
+ - The desktop checks a live launcher's bridge version, token and authenticated
307
+ desktop protocol before attaching. Marked compatible backends may run a different
308
+ business-package version; unmarked backends require the exact app version except
309
+ the explicitly probed npm 0.1.26/0.1.27 migration allowlist. The released **0.1.19**
264
310
  Web launcher predates these metadata fields: when they are absent, the desktop
265
311
  also checks the authenticated session schema (v1) and the initial NDJSON
266
312
  snapshot event before attaching. This is a narrow, tested legacy allowlist,
@@ -357,9 +403,10 @@ lockfile updates, authentication/plugin/session regressions, native PTY checks,
357
403
  and packaged desktop/Web smoke tests before publishing a new installer.
358
404
 
359
405
  Do not replace the signed/packaged runtime in place or install `latest` on every
360
- startup. Upgrade it deliberately through a new tested desktop build, recording
361
- the exact Pi version in `desktop-release.json` and release notes. This preserves
362
- reproducibility and prevents silently changing a user's running tasks.
406
+ startup. Bundled Node/Pi upgrades still require a new tested desktop build, recording
407
+ the exact Pi version in `desktop-release.json` and release notes. Business-package
408
+ updates are opt-in, installed outside the bundle, and retain the current tested SDK
409
+ pair and native PTY. This prevents silently changing a user's running tasks.
363
410
 
364
411
  ## Updating runtime dependencies
365
412
 
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "pi-webapp",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "type": "module",
5
+ "piWebappDesktopProtocol": 1,
5
6
  "description": "A browser interface for Pi with live chat, workspaces, models, and attachments",
6
7
  "repository": {
7
8
  "type": "git",
@@ -15,7 +16,7 @@
15
16
  "pi-webapp": "./bin/pi-webapp.mjs"
16
17
  },
17
18
  "pi": {
18
- "image": "https://cdn.jsdelivr.net/npm/pi-webapp@0.1.27/assets/cover-webapp.png",
19
+ "image": "https://cdn.jsdelivr.net/npm/pi-webapp@0.1.29/assets/cover-webapp.png",
19
20
  "extensions": [
20
21
  "./dist/extension.js"
21
22
  ]
@@ -24,6 +25,8 @@
24
25
  "assets/cover-webapp.png",
25
26
  "assets/readme",
26
27
  "bin",
28
+ "desktop/managed-release.mjs",
29
+ "desktop/check-pty.cjs",
27
30
  "dist",
28
31
  "web/dist",
29
32
  "README.md",
@@ -122,13 +122,13 @@
122
122
  "isDynamicEntry": true
123
123
  },
124
124
  "../../node_modules/@shikijs/langs/dist/graphql.mjs": {
125
- "file": "assets/graphql-CM8br3eP.js",
125
+ "file": "assets/graphql-y8zqvm7I.js",
126
126
  "name": "graphql",
127
127
  "src": "../../node_modules/@shikijs/langs/dist/graphql.mjs",
128
128
  "isDynamicEntry": true,
129
129
  "imports": [
130
130
  "_javascript-D_ijBMSX.js",
131
- "_app-DGAHiflJ.js",
131
+ "_app-B6KN89oD.js",
132
132
  "index.html"
133
133
  ]
134
134
  },
@@ -161,12 +161,12 @@
161
161
  ]
162
162
  },
163
163
  "../../node_modules/@shikijs/langs/dist/http.mjs": {
164
- "file": "assets/http-Dl6CKe_K.js",
164
+ "file": "assets/http-RvN4shOP.js",
165
165
  "name": "http",
166
166
  "src": "../../node_modules/@shikijs/langs/dist/http.mjs",
167
167
  "isDynamicEntry": true,
168
168
  "imports": [
169
- "_app-DGAHiflJ.js",
169
+ "_app-B6KN89oD.js",
170
170
  "../../node_modules/@shikijs/langs/dist/xml.mjs",
171
171
  "../../node_modules/@shikijs/langs/dist/graphql.mjs",
172
172
  "index.html",
@@ -275,7 +275,7 @@
275
275
  ]
276
276
  },
277
277
  "../../node_modules/@shikijs/langs/dist/php.mjs": {
278
- "file": "assets/php-Bk_hkz6U.js",
278
+ "file": "assets/php-DYEaTBiJ.js",
279
279
  "name": "php",
280
280
  "src": "../../node_modules/@shikijs/langs/dist/php.mjs",
281
281
  "isDynamicEntry": true,
@@ -284,7 +284,7 @@
284
284
  "../../node_modules/@shikijs/langs/dist/xml.mjs",
285
285
  "../../node_modules/@shikijs/langs/dist/sql.mjs",
286
286
  "_javascript-D_ijBMSX.js",
287
- "_app-DGAHiflJ.js",
287
+ "_app-B6KN89oD.js",
288
288
  "../../node_modules/@shikijs/langs/dist/css.mjs",
289
289
  "../../node_modules/@shikijs/langs/dist/java.mjs",
290
290
  "index.html"
@@ -315,7 +315,7 @@
315
315
  "isDynamicEntry": true
316
316
  },
317
317
  "../../node_modules/@shikijs/langs/dist/rst.mjs": {
318
- "file": "assets/rst-L1NMAHRS.js",
318
+ "file": "assets/rst-GflBTkRB.js",
319
319
  "name": "rst",
320
320
  "src": "../../node_modules/@shikijs/langs/dist/rst.mjs",
321
321
  "isDynamicEntry": true,
@@ -324,7 +324,7 @@
324
324
  "../../node_modules/@shikijs/langs/dist/cpp.mjs",
325
325
  "../../node_modules/@shikijs/langs/dist/python.mjs",
326
326
  "_javascript-D_ijBMSX.js",
327
- "_app-DGAHiflJ.js",
327
+ "_app-B6KN89oD.js",
328
328
  "../../node_modules/@shikijs/langs/dist/yaml.mjs",
329
329
  "../../node_modules/@shikijs/langs/dist/cmake.mjs",
330
330
  "../../node_modules/@shikijs/langs/dist/ruby.mjs",
@@ -340,7 +340,7 @@
340
340
  ]
341
341
  },
342
342
  "../../node_modules/@shikijs/langs/dist/ruby.mjs": {
343
- "file": "assets/ruby-CT2Et3Md.js",
343
+ "file": "assets/ruby-h9QEI4Un.js",
344
344
  "name": "ruby",
345
345
  "src": "../../node_modules/@shikijs/langs/dist/ruby.mjs",
346
346
  "isDynamicEntry": true,
@@ -353,7 +353,7 @@
353
353
  "../../node_modules/@shikijs/langs/dist/graphql.mjs",
354
354
  "../../node_modules/@shikijs/langs/dist/cpp.mjs",
355
355
  "../../node_modules/@shikijs/langs/dist/c.mjs",
356
- "_app-DGAHiflJ.js",
356
+ "_app-B6KN89oD.js",
357
357
  "../../node_modules/@shikijs/langs/dist/lua.mjs",
358
358
  "../../node_modules/@shikijs/langs/dist/yaml.mjs",
359
359
  "../../node_modules/@shikijs/langs/dist/java.mjs",
@@ -388,13 +388,13 @@
388
388
  "isDynamicEntry": true
389
389
  },
390
390
  "../../node_modules/@shikijs/langs/dist/svelte.mjs": {
391
- "file": "assets/svelte-gqLIvd6P.js",
391
+ "file": "assets/svelte-Dnn1bF1c.js",
392
392
  "name": "svelte",
393
393
  "src": "../../node_modules/@shikijs/langs/dist/svelte.mjs",
394
394
  "isDynamicEntry": true,
395
395
  "imports": [
396
396
  "_javascript-D_ijBMSX.js",
397
- "_app-DGAHiflJ.js",
397
+ "_app-B6KN89oD.js",
398
398
  "../../node_modules/@shikijs/langs/dist/css.mjs",
399
399
  "index.html"
400
400
  ]
@@ -430,14 +430,14 @@
430
430
  "isDynamicEntry": true
431
431
  },
432
432
  "../../node_modules/@shikijs/langs/dist/vue.mjs": {
433
- "file": "assets/vue-9dlEQDyH.js",
433
+ "file": "assets/vue-VJMQoCXf.js",
434
434
  "name": "vue",
435
435
  "src": "../../node_modules/@shikijs/langs/dist/vue.mjs",
436
436
  "isDynamicEntry": true,
437
437
  "imports": [
438
438
  "../../node_modules/@shikijs/langs/dist/css.mjs",
439
439
  "_javascript-D_ijBMSX.js",
440
- "_app-DGAHiflJ.js",
440
+ "_app-B6KN89oD.js",
441
441
  "../../node_modules/@shikijs/langs/dist/html.mjs",
442
442
  "_html-derivative-C2Epw9Yg.js",
443
443
  "index.html"
@@ -704,37 +704,37 @@
704
704
  ]
705
705
  },
706
706
  "../../src/plugins/builtin/files/client/plugin.tsx": {
707
- "file": "assets/plugin-BPPaJeXM.js",
707
+ "file": "assets/plugin-CWZjNBTB.js",
708
708
  "name": "plugin",
709
709
  "src": "../../src/plugins/builtin/files/client/plugin.tsx",
710
710
  "isDynamicEntry": true,
711
711
  "imports": [
712
- "_app-DGAHiflJ.js",
712
+ "_app-B6KN89oD.js",
713
713
  "index.html"
714
714
  ]
715
715
  },
716
716
  "../../src/plugins/builtin/git/client/plugin.tsx": {
717
- "file": "assets/plugin-C7GyvZv1.js",
717
+ "file": "assets/plugin-Ct_K82sD.js",
718
718
  "name": "plugin",
719
719
  "src": "../../src/plugins/builtin/git/client/plugin.tsx",
720
720
  "isDynamicEntry": true,
721
721
  "imports": [
722
- "_app-DGAHiflJ.js",
722
+ "_app-B6KN89oD.js",
723
723
  "index.html"
724
724
  ]
725
725
  },
726
726
  "../../src/plugins/builtin/terminal/client/plugin.tsx": {
727
- "file": "assets/plugin-BBQh2TKb.js",
727
+ "file": "assets/plugin-DPe686Yq.js",
728
728
  "name": "plugin",
729
729
  "src": "../../src/plugins/builtin/terminal/client/plugin.tsx",
730
730
  "isDynamicEntry": true,
731
731
  "imports": [
732
- "_app-DGAHiflJ.js",
732
+ "_app-B6KN89oD.js",
733
733
  "index.html"
734
734
  ]
735
735
  },
736
- "_app-DGAHiflJ.js": {
737
- "file": "assets/app-DGAHiflJ.js",
736
+ "_app-B6KN89oD.js": {
737
+ "file": "assets/app-B6KN89oD.js",
738
738
  "name": "app",
739
739
  "isDynamicEntry": true,
740
740
  "imports": [
@@ -882,7 +882,7 @@
882
882
  "isEntry": true,
883
883
  "dynamicImports": [
884
884
  "../../src/host/client/telemetry-client.ts",
885
- "_app-DGAHiflJ.js"
885
+ "_app-B6KN89oD.js"
886
886
  ]
887
887
  },
888
888
  "style.css": {