pi-chrome 0.2.0 → 0.2.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.
@@ -218,7 +218,12 @@ class ChromeProfileBridge {
218
218
  body: JSON.stringify({ action, params, timeoutMs }),
219
219
  signal: controller.signal,
220
220
  });
221
- const payload = (await response.json()) as { ok: boolean; result?: unknown; error?: string };
221
+ const payload = (await response.json().catch(() => ({}))) as { ok?: boolean; result?: unknown; error?: string };
222
+ if (response.status === 404) {
223
+ throw new Error(
224
+ "A running Pi session owns the Chrome bridge but is using an older pi-chrome without multi-session support. Restart that Pi session after `pi update`, then retry.",
225
+ );
226
+ }
222
227
  if (!response.ok || !payload.ok) throw new Error(payload.error ?? `Chrome bridge owner HTTP ${response.status}`);
223
228
  return payload.result;
224
229
  } catch (error) {
@@ -346,8 +351,8 @@ If chrome_* tools time out, ask the user to run /chrome-onboard, then load the b
346
351
  : "Chrome profile bridge connected",
347
352
  "info",
348
353
  );
349
- } catch {
350
- ctx.ui.notify("Chrome bridge health check timed out. Run /chrome-onboard to connect Chrome.", "warning");
354
+ } catch (error) {
355
+ ctx.ui.notify(`Chrome bridge health check failed: ${(error as Error).message}`, "warning");
351
356
  }
352
357
  },
353
358
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-chrome",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Control your existing authenticated Chrome profile from one or more Pi sessions with tabs, snapshots, clicks, typing, JS evaluation, waits, and screenshots.",
5
5
  "keywords": [
6
6
  "pi-package",