diff --git a/scripts/codesign-mac-app.sh b/scripts/codesign-mac-app.sh index 798aa45d2..ed895272e 100755 --- a/scripts/codesign-mac-app.sh +++ b/scripts/codesign-mac-app.sh @@ -214,19 +214,6 @@ if [ -f "$APP_BUNDLE/Contents/MacOS/Clawdbot" ]; then echo "Signing main binary"; sign_item "$APP_BUNDLE/Contents/MacOS/Clawdbot" "$APP_ENTITLEMENTS" fi -# Sign bundled gateway payload (native addons, libvips dylibs) -if [ -d "$APP_BUNDLE/Contents/Resources/Relay" ]; then - find "$APP_BUNDLE/Contents/Resources/Relay" -type f \( -name "*.node" -o -name "*.dylib" \) -print0 | while IFS= read -r -d '' f; do - echo "Signing gateway payload: $f"; sign_item "$f" "$ENT_TMP_BASE" - done - if [ -f "$APP_BUNDLE/Contents/Resources/Relay/node" ]; then - echo "Signing embedded node"; sign_item "$APP_BUNDLE/Contents/Resources/Relay/node" "$ENT_TMP_RUNTIME" - fi - if [ -f "$APP_BUNDLE/Contents/Resources/Relay/clawdbot" ]; then - echo "Signing embedded relay wrapper"; sign_plain_item "$APP_BUNDLE/Contents/Resources/Relay/clawdbot" - fi -fi - # Sign Sparkle deeply if present SPARKLE="$APP_BUNDLE/Contents/Frameworks/Sparkle.framework" if [ -d "$SPARKLE" ]; then diff --git a/src/gateway/control-ui.ts b/src/gateway/control-ui.ts index 6810f5520..e1e31e639 100644 --- a/src/gateway/control-ui.ts +++ b/src/gateway/control-ui.ts @@ -29,7 +29,7 @@ function resolveControlUiRoot(): string | null { } })(); const candidates = [ - // Packaged relay: Resources/Relay/control-ui + // Packaged app: control-ui lives alongside the executable. execDir ? path.resolve(execDir, "control-ui") : null, // Running from dist: dist/gateway/control-ui.js -> dist/control-ui path.resolve(here, "../control-ui"), diff --git a/src/infra/path-env.test.ts b/src/infra/path-env.test.ts index 14bc985e0..548fd3c3f 100644 --- a/src/infra/path-env.test.ts +++ b/src/infra/path-env.test.ts @@ -7,12 +7,12 @@ import { describe, expect, it } from "vitest"; import { ensureClawdbotCliOnPath } from "./path-env.js"; describe("ensureClawdbotCliOnPath", () => { - it("prepends the bundled Relay dir when a sibling clawdbot exists", async () => { + it("prepends the bundled app bin dir when a sibling clawdbot exists", async () => { const tmp = await fs.mkdtemp(path.join(os.tmpdir(), "clawdbot-path-")); try { - const relayDir = path.join(tmp, "Relay"); - await fs.mkdir(relayDir, { recursive: true }); - const cliPath = path.join(relayDir, "clawdbot"); + const appBinDir = path.join(tmp, "AppBin"); + await fs.mkdir(appBinDir, { recursive: true }); + const cliPath = path.join(appBinDir, "clawdbot"); await fs.writeFile(cliPath, "#!/bin/sh\necho ok\n", "utf-8"); await fs.chmod(cliPath, 0o755); @@ -28,7 +28,7 @@ describe("ensureClawdbotCliOnPath", () => { platform: "darwin", }); const updated = process.env.PATH ?? ""; - expect(updated.split(path.delimiter)[0]).toBe(relayDir); + expect(updated.split(path.delimiter)[0]).toBe(appBinDir); } finally { process.env.PATH = originalPath; if (originalFlag === undefined) delete process.env.CLAWDBOT_PATH_BOOTSTRAPPED; @@ -65,11 +65,11 @@ describe("ensureClawdbotCliOnPath", () => { const originalFlag = process.env.CLAWDBOT_PATH_BOOTSTRAPPED; const originalMiseDataDir = process.env.MISE_DATA_DIR; try { - const relayDir = path.join(tmp, "Relay"); - await fs.mkdir(relayDir, { recursive: true }); - const relayCli = path.join(relayDir, "clawdbot"); - await fs.writeFile(relayCli, "#!/bin/sh\necho ok\n", "utf-8"); - await fs.chmod(relayCli, 0o755); + const appBinDir = path.join(tmp, "AppBin"); + await fs.mkdir(appBinDir, { recursive: true }); + const appCli = path.join(appBinDir, "clawdbot"); + await fs.writeFile(appCli, "#!/bin/sh\necho ok\n", "utf-8"); + await fs.chmod(appCli, 0o755); const localBinDir = path.join(tmp, "node_modules", ".bin"); await fs.mkdir(localBinDir, { recursive: true }); @@ -85,7 +85,7 @@ describe("ensureClawdbotCliOnPath", () => { delete process.env.CLAWDBOT_PATH_BOOTSTRAPPED; ensureClawdbotCliOnPath({ - execPath: relayCli, + execPath: appCli, cwd: tmp, homeDir: tmp, platform: "darwin", @@ -93,11 +93,11 @@ describe("ensureClawdbotCliOnPath", () => { const updated = process.env.PATH ?? ""; const parts = updated.split(path.delimiter); - const relayIndex = parts.indexOf(relayDir); + const appBinIndex = parts.indexOf(appBinDir); const localIndex = parts.indexOf(localBinDir); const shimsIndex = parts.indexOf(shimsDir); - expect(relayIndex).toBeGreaterThanOrEqual(0); - expect(localIndex).toBeGreaterThan(relayIndex); + expect(appBinIndex).toBeGreaterThanOrEqual(0); + expect(localIndex).toBeGreaterThan(appBinIndex); expect(shimsIndex).toBeGreaterThan(localIndex); } finally { process.env.PATH = originalPath; diff --git a/src/infra/path-env.ts b/src/infra/path-env.ts index c372bee40..7adac38be 100644 --- a/src/infra/path-env.ts +++ b/src/infra/path-env.ts @@ -55,7 +55,7 @@ function candidateBinDirs(opts: EnsureClawdbotPathOpts): string[] { const candidates: string[] = []; - // Bundled macOS app: `clawdbot` lives in the Relay dir (process.execPath). + // Bundled macOS app: `clawdbot` lives next to the executable (process.execPath). try { const execDir = path.dirname(execPath); const siblingClawdbot = path.join(execDir, "clawdbot");