loom-agent 1.2.0 → 1.2.3

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Loom Code
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/loom-code?style=flat&color=blue)](https://npmjs.com/loom-code)
3
+ [![npm version](https://img.shields.io/npm/v/loom-code?style=flat&color=blue)](https://www.npmjs.com/package/loom-agent)
4
4
  [![License: MIT](https://img.shields.io/npm/l/loom-code?style=flat&color=green)](LICENSE)
5
5
  [![Platform: Win/Mac/Linux](https://img.shields.io/badge/terminal-Win%20%7C%20Mac%20%7C%20Linux-orange)](#)
6
6
 
@@ -430,4 +430,4 @@ Then add it in `src/providers/index.js` under `PROVIDERS`.
430
430
 
431
431
  ## License
432
432
 
433
- MIT
433
+ MIT
package/bin/loom-tui.js CHANGED
@@ -26,13 +26,18 @@ function findBun() {
26
26
  return null;
27
27
  }
28
28
 
29
- const entry = path.join(__dirname, '..', 'src', 'tui-open.tsx');
29
+ const entry = path.join(__dirname, '..', 'src', 'tui-bootstrap.js');
30
+ // Start bun from the package root so it discovers our bunfig.toml/tsconfig.json
31
+ // (Solid JSX preloader); the user's real cwd rides along in LOOM_START_CWD and
32
+ // is restored by the bootstrap shim before app code runs.
33
+ const pkgRoot = path.join(__dirname, '..');
34
+ process.env.LOOM_START_CWD = process.cwd();
30
35
  const bun = findBun();
31
36
 
32
37
  if (bun) {
33
38
  const result = spawnSync(bun, ['run', entry, ...process.argv.slice(2)], {
34
39
  stdio: 'inherit',
35
- cwd: process.cwd(),
40
+ cwd: pkgRoot,
36
41
  env: process.env,
37
42
  });
38
43
  process.exit(result.status ?? 0);
package/bunfig.toml ADDED
@@ -0,0 +1 @@
1
+ preload = ["@opentui/solid/preload"]
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "loom-agent",
3
- "version": "1.2.0",
4
- "repository": { "type": "git", "url": "git+https://github.com/toshalkumbhar8979-design/loomcode.git" },
3
+ "version": "1.2.3",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/toshalkumbhar8979-design/loomcode.git"
7
+ },
5
8
  "homepage": "https://github.com/toshalkumbhar8979-design/loomcode#readme",
6
- "bugs": { "url": "https://github.com/toshalkumbhar8979-design/loomcode/issues" },
9
+ "bugs": {
10
+ "url": "https://github.com/toshalkumbhar8979-design/loomcode/issues"
11
+ },
7
12
  "description": "Loom Code — AI-powered coding agent for the terminal. Multi-provider support including NVIDIA. OpenTUI interface.",
8
13
  "main": "src/index.js",
9
14
  "bin": {
@@ -59,6 +64,8 @@
59
64
  "typescript": "^5.7.3"
60
65
  },
61
66
  "files": [
67
+ "bunfig.toml",
68
+ "tsconfig.json",
62
69
  "bin/loom.js",
63
70
  "bin/loom-tui.js",
64
71
  "src/**/*.js",
package/src/core/cli.js CHANGED
@@ -560,12 +560,17 @@ if (args.includes('--help') || args.includes('-h')) {
560
560
  const tuiEntry = path.join(__dirname, '..', 'tui-open.tsx');
561
561
  if (bunPath && fs.existsSync(tuiEntry)) {
562
562
  const { spawnSync } = require('child_process');
563
+ // Start bun from the package root so it discovers bunfig.toml /
564
+ // tsconfig.json (Solid JSX preloader) even for global installs;
565
+ // LOOM_START_CWD restores the user's project dir in tui-bootstrap.js.
566
+ const pkgRoot = path.join(__dirname, '..', '..');
567
+ process.env.LOOM_START_CWD = process.cwd();
563
568
  const tuiArgs = [tuiEntry];
564
569
  if (sessionId) tuiArgs.push('-s', sessionId);
565
570
  if (autoMode) tuiArgs.push('--auto');
566
571
  const prompt = promptArgs.join(' ');
567
572
  if (prompt) tuiArgs.push(...prompt.split(/\s+/));
568
- process.exit(spawnSync(bunPath, tuiArgs, { stdio: 'inherit', env: process.env }).status ?? 0);
573
+ process.exit(spawnSync(bunPath, tuiArgs, { stdio: 'inherit', cwd: pkgRoot, env: process.env }).status ?? 0);
569
574
  }
570
575
  console.error('[loom] bun not found — full TUI requires bun (https://bun.sh/). Falling back to line-mode REPL.');
571
576
  console.error('[loom] Use --basic to skip this warning.\n');
@@ -0,0 +1,12 @@
1
+ // Bootstrap shim for globally-installed launches.
2
+ //
3
+ // Bun only discovers bunfig.toml / tsconfig.json by walking UP from its
4
+ // working directory. When installed via npm the package lives outside the
5
+ // user's project tree, so launchers start bun from the PACKAGE root (where
6
+ // those files ship) and hand the real project directory through
7
+ // LOOM_START_CWD. This file must stay import-free so the chdir happens
8
+ // before any Loom module (which may read cwd at import time) executes.
9
+ if (process.env.LOOM_START_CWD) {
10
+ try { process.chdir(process.env.LOOM_START_CWD); } catch {}
11
+ }
12
+ await import("./tui-open.tsx");
package/tsconfig.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["ESNext"],
4
+ "target": "ESNext",
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowImportingTsExtensions": true,
8
+ "jsx": "preserve",
9
+ "jsxImportSource": "@opentui/solid",
10
+ "strict": false,
11
+ "skipLibCheck": true,
12
+ "noEmit": true,
13
+ "types": ["bun-types"],
14
+ "esModuleInterop": true,
15
+ "allowSyntheticDefaultImports": true,
16
+ "resolveJsonModule": true,
17
+ "allowJs": true,
18
+ "baseUrl": ".",
19
+ "paths": {
20
+ "~/*": ["src/*"]
21
+ }
22
+ },
23
+ "include": ["src/**/*", "src/tui/**/*"]
24
+ }