Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
diff --git a/dist/src/binary.js b/dist/src/binary.js
index ee181aef5007e4bf34a49479c089ca30f73a320b..327e2c55c83cc4c50d396a3109190ef10af75ca7 100644
--- a/dist/src/binary.js
+++ b/dist/src/binary.js
@@ -7,7 +7,7 @@
*/
import { existsSync, readFileSync } from "node:fs";
import { createRequire } from "node:module";
-import { dirname, join } from "node:path";
+import { dirname, join, sep } from "node:path";
import { fileURLToPath } from "node:url";
import { getLibFilename, getNpmPackageName } from "./platform.js";
/**
@@ -46,6 +46,16 @@ function getPackageDir() {
// Fallback: assume we're one level deep in src/
return dirname(currentDir);
}
+function resolveUnpackedAsarPath(binaryPath) {
+ const pathSegments = binaryPath.split(sep);
+ const asarIndex = pathSegments.findLastIndex((segment) => segment.endsWith(".asar"));
+ if (asarIndex === -1) {
+ return binaryPath;
+ }
+ pathSegments[asarIndex] = `${pathSegments[asarIndex]}.unpacked`;
+ const unpackedPath = pathSegments.join(sep);
+ return existsSync(unpackedPath) ? unpackedPath : binaryPath;
+}
/**
* Check if the binary exists in any known location
*/
@@ -69,7 +77,7 @@ function resolveFromNpmPackage() {
const packageDir = dirname(packageJsonPath);
const binaryPath = join(packageDir, getLibFilename());
if (existsSync(binaryPath)) {
- return binaryPath;
+ return resolveUnpackedAsarPath(binaryPath);
}
}
catch {