From ff3337feed8b53832d9ddadaa4b61d374473ce1d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 8 Dec 2025 14:07:10 +0000 Subject: [PATCH] Webchat: resolve static root in packaged app --- src/webchat/server.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/webchat/server.ts b/src/webchat/server.ts index 32ee934b2..906403b39 100644 --- a/src/webchat/server.ts +++ b/src/webchat/server.ts @@ -26,7 +26,14 @@ let state: WebChatServerState | null = null; function resolveWebRoot() { const here = path.dirname(fileURLToPath(import.meta.url)); - // repo-relative: apps/macos/Sources/Clawdis/Resources/WebChat + + // 1) Packaged app: resources live next to the relay bundle at + // Contents/Resources/WebChat. The relay binary runs from + // Contents/Resources/Relay/bun, so walk up one and check. + const packagedRoot = path.resolve(path.dirname(process.execPath), "../WebChat"); + if (fs.existsSync(packagedRoot)) return packagedRoot; + + // 2) Dev / source checkout: repo-relative path. return path.resolve(here, "../../apps/macos/Sources/Clawdis/Resources/WebChat"); }