loom-agent 1.2.25 → 1.2.27

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
@@ -2,6 +2,7 @@
2
2
  // npm invokes bin targets through Node on Windows, so re-launch under Bun
3
3
  // when this file was not started by Bun itself.
4
4
  const path = require("path");
5
+ const fs = require("fs");
5
6
  const { spawnSync } = require("child_process");
6
7
 
7
8
  // Bun discovers bunfig.toml ONLY from its starting cwd, and the Solid JSX
@@ -12,8 +13,7 @@ const { spawnSync } = require("child_process");
12
13
  // tui-open.tsx after its imports finish loading.
13
14
  const pkgRoot = path.join(__dirname, "..");
14
15
  const underBun = typeof Bun !== "undefined" && !!process.versions.bun;
15
- const inPkgRoot = path.resolve(process.cwd()) === path.resolve(pkgRoot);
16
- if (!underBun || !inPkgRoot) {
16
+ if (!underBun) {
17
17
  const result = spawnSync(
18
18
  process.platform === "win32" ? "bun.exe" : "bun",
19
19
  [__filename, ...process.argv.slice(2)],
@@ -33,9 +33,25 @@ if (!underBun || !inPkgRoot) {
33
33
  process.title = "loom-code";
34
34
  (async () => {
35
35
  try {
36
+ // The npm bin entry bypasses src/index.js, so load dotenv here for both
37
+ // the package environment and the project from which `loom` was run.
38
+ const dotenv = require("dotenv");
39
+ dotenv.config({ path: path.join(__dirname, "..", ".env") });
40
+ const startCwd = process.env.LOOM_START_CWD || process.cwd();
41
+ const projectEnv = path.join(startCwd, ".env");
42
+ if (fs.existsSync(projectEnv)) dotenv.config({ path: projectEnv, override: false });
36
43
  // The npm global shim can start Bun outside the package directory, so do
37
44
  // not depend on bunfig.toml discovery for Windows console setup.
38
45
  await import("../src/tui-preload.js");
46
+ const args = process.argv.slice(2);
47
+ const coreMode = args.includes("--basic") || args.includes("-p") || args.includes("--print")
48
+ || args.includes("--help") || args.includes("-h") || args.includes("--version") || args.includes("-v")
49
+ || ["acp", "web", "attach", "graph"].includes(args[0]);
50
+ if (!coreMode) {
51
+ await import("@opentui/solid/preload");
52
+ await import("../src/tui-open.tsx");
53
+ return;
54
+ }
39
55
  const { main } = require("../src/core/cli.js");
40
56
  await main();
41
57
  } catch (err) {
package/bin/loom-tui.js CHANGED
@@ -8,8 +8,7 @@ const { spawnSync } = require("child_process");
8
8
  // transform) loads natively — see bin/loom-bun.js.
9
9
  const pkgRoot = path.join(__dirname, "..");
10
10
  const underBun = typeof Bun !== "undefined" && !!process.versions.bun;
11
- const inPkgRoot = path.resolve(process.cwd()) === path.resolve(pkgRoot);
12
- if (!underBun || !inPkgRoot) {
11
+ if (!underBun) {
13
12
  const result = spawnSync(
14
13
  process.platform === "win32" ? "bun.exe" : "bun",
15
14
  [__filename, ...process.argv.slice(2)],
@@ -29,5 +28,6 @@ if (!underBun || !inPkgRoot) {
29
28
 
30
29
  (async () => {
31
30
  await import("../src/tui-preload.js");
31
+ await import("@opentui/solid/preload");
32
32
  await import("../src/tui-open.tsx");
33
33
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loom-agent",
3
- "version": "1.2.25",
3
+ "version": "1.2.27",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/toshalkumbhar8979-design/loomcode.git"
package/src/core/cli.js CHANGED
@@ -38,7 +38,7 @@ class LoomCLI {
38
38
  terminal: true,
39
39
  });
40
40
  console.log(LOOM_BASE);
41
- console.log(`\n Loom Code v1.2.25 — AI Coding Agent for the terminal`);
41
+ console.log(`\n Loom Code v1.2.27 — AI Coding Agent for the terminal`);
42
42
  console.log(` Press Ctrl+C or ESC to interrupt | /help for commands\n`);
43
43
 
44
44
  process.stdin.on('keypress', (str, key) => {