From e9b95dfd19b5046ffd633e6ce2dfd87e504a372b Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 28 Jun 2026 21:43:56 -0500 Subject: [PATCH] fix(docker): include apps/shared in dashboard image build The shared websocket package is a web file: dependency but was excluded by .dockerignore and never copied into the Docker build context. Also fix tsc -b errors: expose buildWsUrl on api and drop the GatewayClient state getter that conflicted with the shared base class. --- .dockerignore | 6 +++++- Dockerfile | 4 ++++ web/src/lib/api.ts | 1 + web/src/lib/gatewayClient.ts | 4 ---- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index a5b50068f02..ec3d52f8141 100644 --- a/.dockerignore +++ b/.dockerignore @@ -66,8 +66,12 @@ runtime/ # ---------- Not needed inside the Docker image ---------- -# Desktop app source (Tauri/Electron); never installed in the container +# Desktop app source (Tauri/Electron); never installed in the container. +# apps/shared is the dashboard↔desktop websocket helper and is linked from +# web/package.json as a file: workspace dep — keep it in the build context. apps/ +!apps/shared/ +!apps/shared/** # Test suite — not shipped in production images tests/ diff --git a/Dockerfile b/Dockerfile index 6a5f5f1eef5..6f957f77967 100644 --- a/Dockerfile +++ b/Dockerfile @@ -119,6 +119,9 @@ COPY package.json package-lock.json ./ COPY web/package.json web/ COPY ui-tui/package.json ui-tui/ COPY ui-tui/packages/hermes-ink/ ui-tui/packages/hermes-ink/ +# apps/shared/ is copied IN FULL because web/package.json references it as a +# `file:` workspace dependency (same pattern as hermes-ink above). +COPY apps/shared/ apps/shared/ # `npm_config_install_links=false` forces npm to install `file:` deps as # symlinks instead of copies. This is the default since npm 10+, which is @@ -184,6 +187,7 @@ RUN uv sync --frozen --no-install-project --extra all --extra messaging --extra # invalidate the (relatively slow) web + ui-tui build layer. COPY web/ web/ COPY ui-tui/ ui-tui/ +COPY apps/shared/ apps/shared/ RUN cd web && npm run build && \ cd ../ui-tui && npm run build diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts index 81643f3ac5c..db347997271 100644 --- a/web/src/lib/api.ts +++ b/web/src/lib/api.ts @@ -315,6 +315,7 @@ function appendProfileParam(url: string, profile?: string): string { } export const api = { + buildWsUrl, getStatus: () => fetchJSON("/api/status"), /** * Identity probe for the dashboard auth gate (Phase 7). diff --git a/web/src/lib/gatewayClient.ts b/web/src/lib/gatewayClient.ts index 325c8cd2bd1..d5ef547ab77 100644 --- a/web/src/lib/gatewayClient.ts +++ b/web/src/lib/gatewayClient.ts @@ -35,10 +35,6 @@ export class GatewayClient extends JsonRpcGatewayClient { }); } - get state(): ConnectionState { - return this.connectionState; - } - async connect(token?: string): Promise { if (this.connectionState === "open" || this.connectionState === "connecting") { return;