loom-agent 1.2.15 → 1.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/loom-bun.js +9 -3
- package/bin/loom-tui.js +6 -3
- package/package.json +1 -1
package/bin/loom-bun.js
CHANGED
|
@@ -4,15 +4,21 @@
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const { spawnSync } = require("child_process");
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// Bun discovers bunfig.toml ONLY from its starting cwd. npm's cmd-shim runs
|
|
8
|
+
// this file under bun directly with the USER's cwd, so unless we are already
|
|
9
|
+
// sitting in the package root we must respawn from there — otherwise the
|
|
10
|
+
// Solid JSX preload never loads and the TUI dies on react/jsx-dev-runtime.
|
|
11
|
+
const pkgRoot = path.join(__dirname, "..");
|
|
12
|
+
const underBun = typeof Bun !== "undefined" && !!process.versions.bun;
|
|
13
|
+
const inPkgRoot = path.resolve(process.cwd()) === path.resolve(pkgRoot);
|
|
14
|
+
if (!underBun || !inPkgRoot) {
|
|
9
15
|
const result = spawnSync(
|
|
10
16
|
process.platform === "win32" ? "bun.exe" : "bun",
|
|
11
17
|
["--conditions=browser", __filename, ...process.argv.slice(2)],
|
|
12
18
|
{
|
|
13
19
|
stdio: "inherit",
|
|
14
20
|
cwd: pkgRoot,
|
|
15
|
-
env: { ...process.env, LOOM_START_CWD: process.cwd() },
|
|
21
|
+
env: { ...process.env, LOOM_START_CWD: process.env.LOOM_START_CWD || process.cwd() },
|
|
16
22
|
windowsHide: false,
|
|
17
23
|
}
|
|
18
24
|
);
|
package/bin/loom-tui.js
CHANGED
|
@@ -4,15 +4,18 @@
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const { spawnSync } = require("child_process");
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// Bun discovers bunfig.toml ONLY from its starting cwd (see bin/loom-bun.js).
|
|
8
|
+
const pkgRoot = path.join(__dirname, "..");
|
|
9
|
+
const underBun = typeof Bun !== "undefined" && !!process.versions.bun;
|
|
10
|
+
const inPkgRoot = path.resolve(process.cwd()) === path.resolve(pkgRoot);
|
|
11
|
+
if (!underBun || !inPkgRoot) {
|
|
9
12
|
const result = spawnSync(
|
|
10
13
|
process.platform === "win32" ? "bun.exe" : "bun",
|
|
11
14
|
["--conditions=browser", __filename, ...process.argv.slice(2)],
|
|
12
15
|
{
|
|
13
16
|
stdio: "inherit",
|
|
14
17
|
cwd: pkgRoot,
|
|
15
|
-
env: { ...process.env, LOOM_START_CWD: process.cwd() },
|
|
18
|
+
env: { ...process.env, LOOM_START_CWD: process.env.LOOM_START_CWD || process.cwd() },
|
|
16
19
|
windowsHide: false,
|
|
17
20
|
}
|
|
18
21
|
);
|