silence startup notify + dynamic status bar - Remove startup notification about companion extension - Remove static 'Chrome bridge :17318' status bar entry - Add updateChromeStatus() helper: shows green dot + 'Chrome Bridge' only when authorized, clears otherwise - Call from session_start, authorizeFor, revokeHandler
Dani Bednarski 49581958+DaniBedz@users.noreply.github.com
Sat, 16 May 2026 21:04:50 +1000
1 files changed,
11 insertions(+),
8 deletions(-)
M
extensions/chrome-profile-bridge/index.ts
→
extensions/chrome-profile-bridge/index.ts
@@ -486,6 +486,14 @@ throw new Error("Chrome control locked. Ask the user to run /chrome authorize before using chrome_* tools.");
} }; + const updateChromeStatus = (ctx: ExtensionContext): void => { + if (chromeControlAuthorized()) { + ctx.ui.setStatus("chrome", ctx.ui.theme.fg("success", "●") + " Chrome Bridge"); + } else { + ctx.ui.setStatus("chrome", undefined); + } + }; + const authorizedBridgeSend = (action: string, params: Record<string, unknown>, timeoutMs = DEFAULT_TIMEOUT_MS, signal?: AbortSignal): Promise<unknown> => { requireChromeControlAuthorized(); return bridge.send(action, params, timeoutMs, signal);@@ -507,14 +515,7 @@ };
pi.on("session_start", async (_event, ctx) => { await bridge.start(); - const status = bridge.status(); - ctx.ui.setStatus("chrome", `Chrome bridge :${DEFAULT_PORT}`); - ctx.ui.notify( - status.mode === "client" - ? `pi-chrome connected (sharing the Chrome connection an earlier pi session opened). Run /chrome authorize before using chrome_* tools.` - : `pi-chrome is ready and waiting for the Chrome companion to connect. Run /chrome onboard to install it, then /chrome authorize to allow chrome_* tools.`, - "info", - ); + updateChromeStatus(ctx); }); pi.on("session_shutdown", () => {@@ -650,6 +651,7 @@ return;
} chromeAuthorizedUntil = until; ctx.ui.notify(`Chrome control authorized for ${label}.`, "info"); + updateChromeStatus(ctx); }; const parseAuthorizeArg = (arg: string): { label: string; until: number | "indefinite" } | undefined => {@@ -672,6 +674,7 @@
const revokeHandler = (ctx: ExtensionContext) => { chromeAuthorizedUntil = undefined; ctx.ui.notify("Chrome control locked. Run /chrome authorize to allow chrome_* tools again.", "info"); + updateChromeStatus(ctx); }; const onboardHandler = async (ctx: ExtensionContext) => {