From c454f7ac0db4d08287bc912e98ab40e7f723548b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 1 Jan 2026 18:30:16 +0100 Subject: [PATCH] fix: detect bun relay assets --- CHANGELOG.md | 1 + package.json | 4 ++++ .../@mariozechner__pi-coding-agent@0.30.2.patch | 17 +++++++++++++++++ pnpm-lock.yaml | 7 +++++-- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 patches/@mariozechner__pi-coding-agent@0.30.2.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 1916e7b83..d2957bfd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - macOS: prioritize main bundle for device resources to prevent crash (#73) — thanks @petter-b - Chat UI: clear composer input immediately and allow clear while editing to prevent duplicate sends (#72) — thanks @hrdwdmrbl - Restart: use systemd on Linux (and report actual restart method) instead of always launchctl. +- Gateway relay: detect Bun binaries via execPath to resolve packaged assets on macOS. - Docs: add manual OAuth setup for remote/headless deployments (#67) — thanks @wstock - Docs/agent tools: clarify that browser `wait` should be avoided by default and used only in exceptional cases. - Browser tools: `upload` supports auto-click refs, direct `inputRef`/`element` file inputs, and emits input/change after `setFiles` so JS-heavy sites pick up attachments. diff --git a/package.json b/package.json index a06cde53e..ed36668e5 100644 --- a/package.json +++ b/package.json @@ -131,6 +131,10 @@ "pnpm": { "overrides": { "@sinclair/typebox": "0.34.45" + }, + "patchedDependencies": { + "@mariozechner/pi-ai": "patches/@mariozechner__pi-ai.patch", + "@mariozechner/pi-coding-agent@0.30.2": "patches/@mariozechner__pi-coding-agent@0.30.2.patch" } }, "vitest": { diff --git a/patches/@mariozechner__pi-coding-agent@0.30.2.patch b/patches/@mariozechner__pi-coding-agent@0.30.2.patch new file mode 100644 index 000000000..a56be808a --- /dev/null +++ b/patches/@mariozechner__pi-coding-agent@0.30.2.patch @@ -0,0 +1,17 @@ +diff --git a/dist/config.js b/dist/config.js +index 7caa66d2676933b102431ec8d92c571eb9d6d82c..77103b9d9573e56c26014c8c7c918e1f853afcdc 100644 +--- a/dist/config.js ++++ b/dist/config.js +@@ -10,8 +10,11 @@ const __dirname = dirname(__filename); + /** + * Detect if we're running as a Bun compiled binary. + * Bun binaries have import.meta.url containing "$bunfs", "~BUN", or "%7EBUN" (Bun's virtual filesystem path) ++ * Some packaging workflows keep import.meta.url as a file:// path, so fall back to execPath next to package.json. + */ +-export const isBunBinary = import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN"); ++const bunBinaryByUrl = import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN"); ++const bunBinaryByExecPath = existsSync(join(dirname(process.execPath), "package.json")); ++export const isBunBinary = bunBinaryByUrl || bunBinaryByExecPath; + // ============================================================================= + // Package Asset Paths (shipped with executable) + // ============================================================================= diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb83906b8..3d711b26e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ patchedDependencies: '@mariozechner/pi-ai': hash: bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832 path: patches/@mariozechner__pi-ai.patch + '@mariozechner/pi-coding-agent@0.30.2': + hash: d0d5ffa1bfda8a0f9d14a5e73a074014346d3edbdb2ffc91444d3be5119f5745 + path: patches/@mariozechner__pi-coding-agent@0.30.2.patch importers: @@ -33,7 +36,7 @@ importers: version: 0.30.2(patch_hash=bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832)(ws@8.18.3)(zod@4.2.1) '@mariozechner/pi-coding-agent': specifier: ^0.30.2 - version: 0.30.2(ws@8.18.3)(zod@4.2.1) + version: 0.30.2(patch_hash=d0d5ffa1bfda8a0f9d14a5e73a074014346d3edbdb2ffc91444d3be5119f5745)(ws@8.18.3)(zod@4.2.1) '@sinclair/typebox': specifier: 0.34.45 version: 0.34.45 @@ -3503,7 +3506,7 @@ snapshots: - ws - zod - '@mariozechner/pi-coding-agent@0.30.2(ws@8.18.3)(zod@4.2.1)': + '@mariozechner/pi-coding-agent@0.30.2(patch_hash=d0d5ffa1bfda8a0f9d14a5e73a074014346d3edbdb2ffc91444d3be5119f5745)(ws@8.18.3)(zod@4.2.1)': dependencies: '@mariozechner/pi-agent-core': 0.30.2(ws@8.18.3)(zod@4.2.1) '@mariozechner/pi-ai': 0.30.2(patch_hash=bf3e904ebaad236b8c3bb48c7d1150a1463735e783acaab6d15d6cd381b43832)(ws@8.18.3)(zod@4.2.1)