loom-agent 1.2.17 → 1.2.19

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 CHANGED
@@ -4,10 +4,12 @@
4
4
  const path = require("path");
5
5
  const { spawnSync } = require("child_process");
6
6
 
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.
7
+ // Bun discovers bunfig.toml ONLY from its starting cwd, and the Solid JSX
8
+ // plugin ONLY works when loaded through that bunfig preload phase runtime
9
+ // registration from another cwd silently no-ops (proven). So unless bun is
10
+ // ALREADY sitting in the package root, respawn it there once. The user's
11
+ // real directory rides along in LOOM_START_CWD and is restored by
12
+ // tui-open.tsx after its imports finish loading.
11
13
  const pkgRoot = path.join(__dirname, "..");
12
14
  const underBun = typeof Bun !== "undefined" && !!process.versions.bun;
13
15
  const inPkgRoot = path.resolve(process.cwd()) === path.resolve(pkgRoot);
@@ -37,4 +39,4 @@ process.title = "loom-code";
37
39
  console.error(err && err.message ? err.message : String(err));
38
40
  process.exit(1);
39
41
  }
40
- })();
42
+ })();
package/bin/loom-tui.js CHANGED
@@ -1,30 +1,30 @@
1
- #!/usr/bin/env bun
2
- // npm invokes bin targets through Node on Windows, so re-launch under Bun
3
- // when this file was not started by Bun itself.
4
- const path = require("path");
5
- const { spawnSync } = require("child_process");
6
-
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) {
12
- const result = spawnSync(
13
- process.platform === "win32" ? "bun.exe" : "bun",
14
- [__filename, ...process.argv.slice(2)],
15
- {
16
- stdio: "inherit",
17
- cwd: pkgRoot,
18
- env: { ...process.env, LOOM_START_CWD: process.env.LOOM_START_CWD || process.cwd() },
19
- windowsHide: false,
20
- }
21
- );
22
- if (result.error) {
23
- console.error("[loom] Bun is required for the TUI. Install it from https://bun.sh/");
24
- process.exit(1);
25
- }
26
- process.exit(result.status == null ? 1 : result.status);
27
- }
28
-
29
- require("../src/tui-preload.js");
30
- (async () => { await import("../src/tui-open.tsx"); })();
1
+ #!/usr/bin/env bun
2
+ // npm invokes bin targets through Node on Windows, so re-launch under Bun
3
+ // when this file was not started by Bun itself.
4
+ const path = require("path");
5
+ const { spawnSync } = require("child_process");
6
+
7
+ // Respawn from the package root so bunfig.toml's preload chain (Solid JSX
8
+ // transform) loads natively — see bin/loom-bun.js.
9
+ const pkgRoot = path.join(__dirname, "..");
10
+ const underBun = typeof Bun !== "undefined" && !!process.versions.bun;
11
+ const inPkgRoot = path.resolve(process.cwd()) === path.resolve(pkgRoot);
12
+ if (!underBun || !inPkgRoot) {
13
+ const result = spawnSync(
14
+ process.platform === "win32" ? "bun.exe" : "bun",
15
+ [__filename, ...process.argv.slice(2)],
16
+ {
17
+ stdio: "inherit",
18
+ cwd: pkgRoot,
19
+ env: { ...process.env, LOOM_START_CWD: process.env.LOOM_START_CWD || process.cwd() },
20
+ windowsHide: false,
21
+ }
22
+ );
23
+ if (result.error) {
24
+ console.error("[loom] Bun is required for the TUI. Install it from https://bun.sh/");
25
+ process.exit(1);
26
+ }
27
+ process.exit(result.status == null ? 1 : result.status);
28
+ }
29
+
30
+ (async () => { await import("../src/tui-open.tsx"); })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loom-agent",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/toshalkumbhar8979-design/loomcode.git"