@pi-chamber/web 1.0.0 → 1.0.2-rc.1

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 (78) hide show
  1. package/README.md +3 -1
  2. package/bin/cli.js +7 -32
  3. package/bin/dev-server.js +185 -0
  4. package/bin/dev-server.test.js +252 -0
  5. package/bin/lib/DOCUMENTATION.md +19 -0
  6. package/bin/lib/cli-startup.js +9 -1
  7. package/bin/lib/cli-startup.test.js +30 -0
  8. package/bin/lib/commands-serve.js +9 -5
  9. package/bin/lib/server-runtime.js +6 -0
  10. package/bin/lib/server-runtime.test.js +313 -0
  11. package/dist/assets/{DiagramView-CbSxUe1D.js → DiagramView-GUJij-1P.js} +1 -1
  12. package/dist/assets/{DiffView-VyBf4ilo.js → DiffView-BZ487Bhh.js} +1 -1
  13. package/dist/assets/{FileSaveConflictDialog-BCvbQ234.js → FileSaveConflictDialog-Ci6WdSiS.js} +1 -1
  14. package/dist/assets/{FilesView-DasA5EU2.js → FilesView-DBiWEo71.js} +1 -1
  15. package/dist/assets/{GitView-DU3mOECp.js → GitView-DVyhqN5s.js} +3 -3
  16. package/dist/assets/{JsonTreeView-xZiWDwua.js → JsonTreeView-BaU7aAUq.js} +1 -1
  17. package/dist/assets/{MarkdownRendererImpl-BBwdI2OF.js → MarkdownRendererImpl-6NBJLtEr.js} +1 -1
  18. package/dist/assets/{PatchDiff-BhKm_JPT.js → PatchDiff-CvptevA2.js} +1 -1
  19. package/dist/assets/{SessionSwitcherContent-DTGSP_RB.js → SessionSwitcherContent-Cqp5FVCP.js} +1 -1
  20. package/dist/assets/{SessionSwitcherDropdown-CedOB-xC.js → SessionSwitcherDropdown-CRVJU16x.js} +2 -2
  21. package/dist/assets/{SessionUnreadDot-CZSNKram.js → SessionUnreadDot-CsFxImPI.js} +1 -1
  22. package/dist/assets/SettingsView-ppaIrPry.js +2 -0
  23. package/dist/assets/{SettingsWindow-y33YrpBE.js → SettingsWindow-geMUhnxd.js} +1 -1
  24. package/dist/assets/{ToolOutputDialog-JqIXJWAH.js → ToolOutputDialog-BLGl2mNt.js} +1 -1
  25. package/dist/assets/{ToolPartDiffPreview-CRi_33jE.js → ToolPartDiffPreview-BVeL1IuE.js} +1 -1
  26. package/dist/assets/{VirtualizedFileDiff-ehLQSR5W.js → VirtualizedFileDiff-9kAZ96se.js} +1 -1
  27. package/dist/assets/{collapsible-Vypq-nMP.js → collapsible-BencOwkW.js} +1 -1
  28. package/dist/assets/{computeVirtualFileMetrics-BTfrj_fR.js → computeVirtualFileMetrics-C8vH0vcM.js} +1 -1
  29. package/dist/assets/{contextFileOpenGuard-Dl6mFfD1.js → contextFileOpenGuard-B6e3cTcl.js} +1 -1
  30. package/dist/assets/{gitStatusPredicates-LAsJAhCL.js → gitStatusPredicates-B6w5GMNU.js} +1 -1
  31. package/dist/assets/{index-OveFsNBm.js → index-BifnX1Mp.js} +1 -1
  32. package/dist/assets/{index-DvNeSFO9.js → index-CpSdU-d4.js} +7 -7
  33. package/dist/assets/index-Dwz16owi.css +1 -0
  34. package/dist/assets/{isDiffPlainText-CNZohQ4q.js → isDiffPlainText-BepQ1JHv.js} +1 -1
  35. package/dist/assets/{isFilePlainText-Dz8UubRT.js → isFilePlainText-CA1KFaTm.js} +1 -1
  36. package/dist/assets/{main-BsDkATRV.js → main-TzeSIx1W.js} +3 -3
  37. package/dist/assets/{main-C393Ywhx.js → main-dhVDQIHu.js} +2 -2
  38. package/dist/assets/{markdownCore-Bz9-Y75q.js → markdownCore-BztwD2c9.js} +1 -1
  39. package/dist/assets/{miniChat-CWEerp3c.js → miniChat-smqdx0Y7.js} +2 -2
  40. package/dist/assets/{mobile-YxV9KcxF.js → mobile-BV-WCEiE.js} +2 -2
  41. package/dist/assets/{renderElectronMiniChatApp-GrLmBQRb.js → renderElectronMiniChatApp-DKmb9oa7.js} +2 -2
  42. package/dist/assets/renderMobileApp-D3dtjeaE.js +11 -0
  43. package/dist/assets/runtimeEndpointReset-C1EENUlq.js +53 -0
  44. package/dist/assets/{runtimeSurface-DUXw4-oa.js → runtimeSurface-Bm6cRkok.js} +1 -1
  45. package/dist/assets/{useAppFontEffects-ad-lZJ6o.js → useAppFontEffects-Dq7xKVjh.js} +77 -77
  46. package/dist/assets/{useFilesViewSearch-C4oOHPml.js → useFilesViewSearch-Bvlo7C3a.js} +1 -1
  47. package/dist/assets/{usePushVisibilityBeacon-xd8Q10cI.js → usePushVisibilityBeacon-BY4xtozp.js} +1 -1
  48. package/dist/assets/{useSwitcherItems-B6VC7tug.js → useSwitcherItems-CkE242zK.js} +1 -1
  49. package/dist/assets/{vendor-codemirror-language-data-B4j3gkaT.js → vendor-codemirror-language-data-Bv6kN79m.js} +2 -2
  50. package/dist/assets/{web-components-B0RFakat.js → web-components-CCiRgoOw.js} +1 -1
  51. package/dist/index.html +4 -4
  52. package/dist/mini-chat.html +3 -3
  53. package/dist/mobile.html +3 -3
  54. package/package.json +8 -3
  55. package/server/index.js +48 -6
  56. package/server/lib/notifications/DOCUMENTATION.md +39 -0
  57. package/server/lib/notifications/delivery-runtime.js +314 -0
  58. package/server/lib/notifications/delivery-runtime.test.js +85 -0
  59. package/server/lib/notifications/pi-notification-watcher.js +154 -0
  60. package/server/lib/notifications/pi-notification-watcher.test.js +84 -0
  61. package/server/lib/notifications/routes.js +74 -0
  62. package/server/lib/package-manager.js +3 -2
  63. package/server/lib/package-manager.test.js +7 -2
  64. package/server/lib/pi/routes.test.js +24 -0
  65. package/server/lib/pi/session-daemon/DOCUMENTATION.md +1 -0
  66. package/server/lib/pi/session-daemon/pi-runtime-smoke.test.js +466 -0
  67. package/server/lib/pi/ui-settings-store.js +15 -2
  68. package/server/lib/pi/ui-settings-store.test.js +47 -1
  69. package/server/lib/server/core-routes.js +18 -0
  70. package/server/lib/server/linux-distribution.js +47 -0
  71. package/server/lib/server/linux-distribution.test.js +22 -0
  72. package/server/lib/server/runtime-requirements.js +193 -0
  73. package/server/lib/server/runtime-requirements.test.js +295 -0
  74. package/server/lib/server/tunnel-service.DOCUMENTATION.md +1 -1
  75. package/dist/assets/SettingsView-B5nmu8x4.js +0 -2
  76. package/dist/assets/index-BXX8l7mM.css +0 -1
  77. package/dist/assets/renderMobileApp-C29wquBe.js +0 -11
  78. package/dist/assets/runtimeEndpointReset-DHARMv9w.js +0 -53
@@ -0,0 +1,154 @@
1
+ const notificationPayload = (event, kind, title) => ({
2
+ title: kind === 'error' ? 'Work failed' : 'Work completed',
3
+ body: title || 'Open PiChamber to review the session.',
4
+ tag: `pichamber:${kind}:${event.sessionId}:${event.sequence}`,
5
+ data: {
6
+ type: kind,
7
+ sessionId: event.sessionId,
8
+ ...(event.directory ? { directory: event.directory } : {}),
9
+ url: `/?session=${encodeURIComponent(event.sessionId)}`,
10
+ },
11
+ });
12
+
13
+ export const createPiNotificationTracker = ({ emit }) => {
14
+ const activeSessions = new Set();
15
+ const titleBySession = new Map();
16
+
17
+ const settle = (event, kind) => {
18
+ if (!activeSessions.delete(event.sessionId)) return;
19
+ emit(notificationPayload(event, kind, titleBySession.get(event.sessionId)));
20
+ };
21
+
22
+ const accept = (event) => {
23
+ if (!event || typeof event.sessionId !== 'string') return;
24
+ if (event.name === 'session.snapshot') {
25
+ const snapshot = event.payload?.snapshot;
26
+ if (typeof snapshot?.title === 'string' && snapshot.title.trim()) {
27
+ titleBySession.set(event.sessionId, snapshot.title.trim());
28
+ }
29
+ const active = snapshot?.isStreaming === true
30
+ || snapshot?.lifecycle === 'busy'
31
+ || snapshot?.lifecycle === 'retry';
32
+ if (active) activeSessions.add(event.sessionId);
33
+ else activeSessions.delete(event.sessionId);
34
+ return;
35
+ }
36
+ if (event.name === 'session.updated' && typeof event.payload?.title === 'string') {
37
+ titleBySession.set(event.sessionId, event.payload.title.trim());
38
+ return;
39
+ }
40
+ if (event.name === 'session.deleted') {
41
+ activeSessions.delete(event.sessionId);
42
+ titleBySession.delete(event.sessionId);
43
+ return;
44
+ }
45
+ if (event.name === 'assistant.message.start') {
46
+ activeSessions.add(event.sessionId);
47
+ return;
48
+ }
49
+ if (event.name === 'session.lifecycle') {
50
+ if (event.payload?.state === 'busy' || event.payload?.state === 'retry') {
51
+ activeSessions.add(event.sessionId);
52
+ } else if (event.payload?.state === 'idle') {
53
+ settle(event, 'completion');
54
+ } else if (event.payload?.state === 'error') {
55
+ settle(event, 'error');
56
+ }
57
+ return;
58
+ }
59
+ if (event.name === 'session.error') {
60
+ settle(event, 'error');
61
+ return;
62
+ }
63
+ if (event.name === 'session.interrupted') activeSessions.delete(event.sessionId);
64
+ };
65
+
66
+ return { accept };
67
+ };
68
+
69
+ export const createPiNotificationWatcher = ({
70
+ supervisor,
71
+ uiSettingsStore,
72
+ delivery,
73
+ retryMs = 1_000,
74
+ deliveryTimeoutMs = 15_000,
75
+ }) => {
76
+ let stopped = false;
77
+ let closeSubscription = null;
78
+ let retryTimer = null;
79
+ let fromSequence;
80
+ let streamEpoch;
81
+ let deliveryChain = Promise.resolve();
82
+
83
+ const tracker = createPiNotificationTracker({
84
+ emit: (payload) => {
85
+ deliveryChain = deliveryChain.then(async () => {
86
+ const settings = await uiSettingsStore.read();
87
+ if (settings.nativeNotificationsEnabled !== true) return;
88
+ if (payload.data.type === 'completion' && settings.notifyOnCompletion === false) return;
89
+ if (payload.data.type === 'error' && settings.notifyOnError === false) return;
90
+ let timeoutId;
91
+ const timeout = new Promise((_, reject) => {
92
+ timeoutId = setTimeout(() => reject(new Error('Notification delivery timed out')), deliveryTimeoutMs);
93
+ timeoutId.unref?.();
94
+ });
95
+ try {
96
+ await Promise.race([
97
+ delivery.send({
98
+ ...payload,
99
+ kind: payload.data.type,
100
+ sessionId: payload.data.sessionId,
101
+ directory: payload.data.directory,
102
+ requireHidden: settings.notificationMode !== 'always',
103
+ }),
104
+ timeout,
105
+ ]);
106
+ } finally {
107
+ clearTimeout(timeoutId);
108
+ }
109
+ }).catch((error) => {
110
+ console.warn(`[Notifications] delivery failed: ${error?.message ?? 'unknown error'}`);
111
+ });
112
+ },
113
+ });
114
+
115
+ const scheduleReconnect = () => {
116
+ if (stopped || retryTimer) return;
117
+ closeSubscription?.();
118
+ closeSubscription = null;
119
+ retryTimer = setTimeout(() => {
120
+ retryTimer = null;
121
+ void connect();
122
+ }, retryMs);
123
+ };
124
+
125
+ const connect = async () => {
126
+ if (stopped) return;
127
+ try {
128
+ closeSubscription?.();
129
+ closeSubscription = await supervisor.subscribe({
130
+ ...(Number.isSafeInteger(fromSequence) && streamEpoch ? { fromSequence, streamEpoch } : {}),
131
+ onEvent: (event) => {
132
+ if (typeof event.streamEpoch === 'string') streamEpoch = event.streamEpoch;
133
+ if (Number.isSafeInteger(event.sequence)) fromSequence = event.sequence;
134
+ tracker.accept(event);
135
+ },
136
+ onError: scheduleReconnect,
137
+ });
138
+ } catch {
139
+ scheduleReconnect();
140
+ }
141
+ };
142
+
143
+ return {
144
+ start: connect,
145
+ stop: async () => {
146
+ stopped = true;
147
+ if (retryTimer) clearTimeout(retryTimer);
148
+ retryTimer = null;
149
+ closeSubscription?.();
150
+ closeSubscription = null;
151
+ await deliveryChain;
152
+ },
153
+ };
154
+ };
@@ -0,0 +1,84 @@
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ import { createPiNotificationTracker, createPiNotificationWatcher } from './pi-notification-watcher.js';
4
+
5
+ const event = (name, sequence, payload = {}, sessionId = 'session-1') => ({
6
+ protocolVersion: 1,
7
+ kind: 'event',
8
+ name,
9
+ sequence,
10
+ streamEpoch: 'epoch-1',
11
+ sessionId,
12
+ directory: '/repo',
13
+ payload,
14
+ });
15
+
16
+ describe('Pi notification tracker', () => {
17
+ it('notifies once when active work completes', () => {
18
+ const notifications = [];
19
+ const tracker = createPiNotificationTracker({ emit: (payload) => notifications.push(payload) });
20
+
21
+ tracker.accept(event('session.lifecycle', 1, { state: 'busy' }));
22
+ tracker.accept(event('assistant.message.start', 2, { messageId: 'm1' }));
23
+ tracker.accept(event('session.lifecycle', 3, { state: 'idle' }));
24
+ tracker.accept(event('session.lifecycle', 4, { state: 'idle' }));
25
+
26
+ expect(notifications).toEqual([expect.objectContaining({
27
+ title: 'Work completed',
28
+ tag: 'pichamber:completion:session-1:3',
29
+ })]);
30
+ });
31
+
32
+ it('collapses message and lifecycle error boundaries into one notification', () => {
33
+ const notifications = [];
34
+ const tracker = createPiNotificationTracker({ emit: (payload) => notifications.push(payload) });
35
+
36
+ tracker.accept(event('session.lifecycle', 1, { state: 'busy' }));
37
+ tracker.accept(event('session.error', 2, { code: 'ASSISTANT_ERROR', message: 'limit reached' }));
38
+ tracker.accept(event('session.lifecycle', 3, { state: 'error' }));
39
+
40
+ expect(notifications).toHaveLength(1);
41
+ expect(notifications[0]).toEqual(expect.objectContaining({
42
+ title: 'Work failed',
43
+ tag: 'pichamber:error:session-1:2',
44
+ }));
45
+ });
46
+
47
+ it('does not notify for interrupted work or settled bootstrap snapshots', () => {
48
+ const notifications = [];
49
+ const tracker = createPiNotificationTracker({ emit: (payload) => notifications.push(payload) });
50
+
51
+ tracker.accept(event('session.snapshot', 1, { snapshot: { lifecycle: 'idle', isStreaming: false } }));
52
+ tracker.accept(event('session.lifecycle', 2, { state: 'busy' }));
53
+ tracker.accept(event('session.interrupted', 3, { reason: 'user-abort', streaming: true }));
54
+ tracker.accept(event('session.lifecycle', 4, { state: 'idle' }));
55
+
56
+ expect(notifications).toEqual([]);
57
+ });
58
+
59
+ it('closes a failed subscription before reconnecting', async () => {
60
+ const closes = [];
61
+ const subscriptions = [];
62
+ const supervisor = {
63
+ subscribe: async (options) => {
64
+ subscriptions.push(options);
65
+ const close = () => closes.push(subscriptions.length);
66
+ return close;
67
+ },
68
+ };
69
+ const watcher = createPiNotificationWatcher({
70
+ supervisor,
71
+ uiSettingsStore: { read: async () => ({}) },
72
+ delivery: { send: async () => undefined },
73
+ retryMs: 1,
74
+ });
75
+
76
+ await watcher.start();
77
+ subscriptions[0].onError(new Error('disconnected'));
78
+ await new Promise((resolve) => setTimeout(resolve, 10));
79
+
80
+ expect(subscriptions).toHaveLength(2);
81
+ expect(closes).toEqual([1]);
82
+ await watcher.stop();
83
+ });
84
+ });
@@ -0,0 +1,74 @@
1
+ const text = (value, maxLength) => {
2
+ if (typeof value !== 'string') return '';
3
+ const trimmed = value.trim();
4
+ return trimmed.length > 0 && trimmed.length <= maxLength ? trimmed : '';
5
+ };
6
+
7
+ export const registerNotificationRoutes = (app, { uiAuthController, delivery }) => {
8
+ const clientId = (req, res) => uiAuthController.ensureSessionToken(req, res);
9
+
10
+ app.get('/api/push/vapid-public-key', async (_req, res) => {
11
+ try {
12
+ const keys = await delivery.getOrCreateVapidKeys();
13
+ res.json({ publicKey: keys.publicKey });
14
+ } catch {
15
+ res.status(500).json({ error: 'Push notifications are unavailable' });
16
+ }
17
+ });
18
+
19
+ app.post('/api/push/subscribe', async (req, res) => {
20
+ const id = await clientId(req, res);
21
+ if (!id) return;
22
+ const endpoint = text(req.body?.endpoint, 4096);
23
+ const p256dh = text(req.body?.keys?.p256dh, 1024);
24
+ const auth = text(req.body?.keys?.auth, 1024);
25
+ if (!endpoint || !p256dh || !auth) return res.status(400).json({ error: 'Invalid push subscription' });
26
+ await delivery.addWebSubscription(id, {
27
+ endpoint,
28
+ p256dh,
29
+ auth,
30
+ platform: text(req.body?.platform, 32) || undefined,
31
+ });
32
+ res.json({ ok: true });
33
+ });
34
+
35
+ app.delete('/api/push/subscribe', async (req, res) => {
36
+ const id = await clientId(req, res);
37
+ if (!id) return;
38
+ const endpoint = text(req.body?.endpoint, 4096);
39
+ if (!endpoint) return res.status(400).json({ error: 'Invalid push subscription' });
40
+ await delivery.removeWebSubscription(id, endpoint);
41
+ res.json({ ok: true });
42
+ });
43
+
44
+ app.post('/api/push/apns-token', async (req, res) => {
45
+ const id = await clientId(req, res);
46
+ if (!id) return;
47
+ const token = text(req.body?.token, 4096);
48
+ const platform = req.body?.platform === 'android' ? 'android' : 'ios';
49
+ const environment = req.body?.environment === 'sandbox' ? 'sandbox' : 'production';
50
+ if (!token) return res.status(400).json({ error: 'Invalid native push token' });
51
+ try {
52
+ await delivery.addNativeToken(id, { token, platform, environment });
53
+ res.json({ ok: true });
54
+ } catch {
55
+ res.status(502).json({ error: 'Native push registration failed' });
56
+ }
57
+ });
58
+
59
+ app.delete('/api/push/apns-token', async (req, res) => {
60
+ const id = await clientId(req, res);
61
+ if (!id) return;
62
+ const token = text(req.body?.token, 4096);
63
+ if (!token) return res.status(400).json({ error: 'Invalid native push token' });
64
+ await delivery.removeNativeToken(id, token);
65
+ res.json({ ok: true });
66
+ });
67
+
68
+ app.post('/api/push/visibility', async (req, res) => {
69
+ const id = await clientId(req, res);
70
+ if (!id) return;
71
+ delivery.updateVisibility(id, req.body?.visible === true, text(req.body?.platform, 32) || undefined);
72
+ res.json({ ok: true });
73
+ });
74
+ };
@@ -558,7 +558,8 @@ export function getUpdateCapability(options = {}) {
558
558
  return {
559
559
  supported: false,
560
560
  code: 'DOCKER_DEPLOYMENT',
561
- error: 'PiChamber is running in a container and cannot replace its own image. Pull or build the newer image with your deployment tool, then recreate the container.',
561
+ error: 'PiChamber is running in a container and cannot replace its own image. In the directory with your compose file, pull the newer image and recreate the container. Config, sessions, SSH keys, and workspaces persist in the mounted volumes.',
562
+ commands: ['docker compose pull', 'docker compose up -d'],
562
563
  };
563
564
  }
564
565
 
@@ -1027,7 +1028,7 @@ export async function launchUpdateCommand(options = {}) {
1027
1028
  if (isContainer) {
1028
1029
  return {
1029
1030
  success: false,
1030
- error: 'Docker deployments must be updated by deploying a new container image.',
1031
+ error: 'Docker deployments must be updated by pulling a new image and recreating the container.',
1031
1032
  };
1032
1033
  }
1033
1034
 
@@ -501,9 +501,11 @@ describe('update capability reporting', () => {
501
501
  };
502
502
 
503
503
  it('gives deployment-specific instructions for containers and source checkouts', () => {
504
- expect(getUpdateCapability({ isContainer: true })).toMatchObject({
504
+ expect(getUpdateCapability({ isContainer: true })).toEqual({
505
505
  supported: false,
506
506
  code: 'DOCKER_DEPLOYMENT',
507
+ error: 'PiChamber is running in a container and cannot replace its own image. In the directory with your compose file, pull the newer image and recreate the container. Config, sessions, SSH keys, and workspaces persist in the mounted volumes.',
508
+ commands: ['docker compose pull', 'docker compose up -d'],
507
509
  });
508
510
  expect(getUpdateCapability({
509
511
  isContainer: false,
@@ -674,7 +676,10 @@ describe('launchUpdateCommand', () => {
674
676
  });
675
677
 
676
678
  it('refuses container replacement without creating a job', async () => {
677
- await expect(launchUpdateCommand({ isContainer: true })).resolves.toMatchObject({ success: false });
679
+ await expect(launchUpdateCommand({ isContainer: true })).resolves.toEqual({
680
+ success: false,
681
+ error: 'Docker deployments must be updated by pulling a new image and recreating the container.',
682
+ });
678
683
  });
679
684
  });
680
685
 
@@ -233,6 +233,30 @@ describe('Pi runtime route', () => {
233
233
  });
234
234
  });
235
235
 
236
+ it('returns compose pull commands when the server is a Docker deployment', async () => {
237
+ const app = express();
238
+ registerPiRuntimeRoutes(app, {
239
+ getPiSessionDaemonRuntime: () => null,
240
+ updateCapabilityResolver: () => ({
241
+ supported: false,
242
+ code: 'DOCKER_DEPLOYMENT',
243
+ error: 'Pull the newer image and recreate the container.',
244
+ commands: ['docker compose pull', 'docker compose up -d'],
245
+ }),
246
+ updateLauncher: () => { throw new Error('must not run'); },
247
+ });
248
+ server = await listen(app);
249
+
250
+ const response = await fetch(`http://127.0.0.1:${server.address().port}/api/pi/update-install`, { method: 'POST' });
251
+ expect(response.status).toBe(409);
252
+ await expect(response.json()).resolves.toEqual({
253
+ success: false,
254
+ code: 'DOCKER_DEPLOYMENT',
255
+ error: 'Pull the newer image and recreate the container.',
256
+ commands: ['docker compose pull', 'docker compose up -d'],
257
+ });
258
+ });
259
+
236
260
  it('generates a task name with the configured small model without exposing model details', async () => {
237
261
  const calls = [];
238
262
  const app = express();
@@ -61,5 +61,6 @@ The 0.84.1 → 0.85.1 upgrade retains the public session runtime/services API an
61
61
  - `session-daemon-extensions.e2e.test.js` exercises real extension loading, commands, dialogs, GUI projection, reload, and session disposal.
62
62
  - `supervisor.test.js` covers authenticated replacement of a daemon from an older PiChamber build. Normal versioned releases must retain that replacement behavior. Same-version, same-path manual dependency replacement is not a release upgrade and requires stopping the old server/daemon before restarting.
63
63
  - The SDK CLI bin moved to `dist/bundle/cli.js`; the detached daemon already resolves `package.json`'s `bin.pi` rather than hardcoding the old location.
64
+ - `pi-runtime-smoke.test.js` checks the pinned SDK and foreground backend in real subprocesses with disposable dirs. It checks the SDK import with pinned version parity, bundled `bin.pi --help`, credential-free `rpc get_state` to success, and a credential-free foreground `serve --foreground --api-only` that polls `/api/pi/runtime` to ready and checks parent and daemon `execPath`. It is not provider E2E. It defaults to `process.execPath` and accepts an absolute override in `PICHAMBER_TEST_RUNTIME`. See `packages/web/bin/lib/DOCUMENTATION.md` for runtime rules and CI matrix.
64
65
 
65
66
  The new bundled OpenCode catalog removes `deepseek-v4-flash-free`. SDK remote catalogs still merge additively with bundled models, so this upgrade fixes that stale entry, not general upstream deletion propagation. Explicit user-defined models with the same ID remain supported. Do not clear users' `models.json` or `models-store.json` to apply an upgrade.