loom-agent 1.2.15 → 1.2.17
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 +10 -4
- package/bin/loom-tui.js +7 -4
- package/package.json +1 -1
- package/src/core/cli.js +1 -4
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
|
+
[__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
|
+
[__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
|
);
|
package/package.json
CHANGED
package/src/core/cli.js
CHANGED
|
@@ -579,10 +579,7 @@ if (args.includes('--help') || args.includes('-h')) {
|
|
|
579
579
|
process.env.LOOM_START_CWD = process.cwd();
|
|
580
580
|
process.env.LOOM_BIN_NAME = "loom";
|
|
581
581
|
process.env.BUN_CONFIG = path.join(pkgRoot, "bunfig.toml");
|
|
582
|
-
|
|
583
|
-
// bin/loom-tui.js) — without it the SSR build loads and the TUI
|
|
584
|
-
// renders one static frame then never updates.
|
|
585
|
-
const tuiArgs = ["--conditions=browser", tuiEntry];
|
|
582
|
+
const tuiArgs = [tuiEntry];
|
|
586
583
|
if (sessionId) tuiArgs.push('-s', sessionId);
|
|
587
584
|
if (autoMode) tuiArgs.push('--auto');
|
|
588
585
|
const prompt = promptArgs.join(' ');
|