loom-agent 1.2.3 → 1.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loom-agent",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/toshalkumbhar8979-design/loomcode.git"
package/src/core/cli.js CHANGED
@@ -557,7 +557,7 @@ if (args.includes('--help') || args.includes('-h')) {
557
557
  if (canRaw) {
558
558
  // Launch new OpenTUI TUI via bun
559
559
  const bunPath = findBun();
560
- const tuiEntry = path.join(__dirname, '..', 'tui-open.tsx');
560
+ const tuiEntry = path.join(__dirname, '..', 'tui-bootstrap.js');
561
561
  if (bunPath && fs.existsSync(tuiEntry)) {
562
562
  const { spawnSync } = require('child_process');
563
563
  // Start bun from the package root so it discovers bunfig.toml /
package/src/tui/App.tsx CHANGED
@@ -1505,6 +1505,7 @@ export function App(props: { initialPrompt?: string; resumeSession?: string; aut
1505
1505
  _skillDoneOff = on("turn:end", function(d: any) {
1506
1506
  if (d?.skills?.length) showToast("skill handled: " + d.skills.join(", "), "ok");
1507
1507
  });
1508
+ (globalThis as any).__loomTrace?.("onMount-done");
1508
1509
  });
1509
1510
  onCleanup(function() { persistUi(); if (_skillToastOff) _skillToastOff(); if (_skillDoneOff) _skillDoneOff(); });
1510
1511
 
@@ -6,7 +6,35 @@
6
6
  // those files ship) and hand the real project directory through
7
7
  // LOOM_START_CWD. This file must stay import-free so the chdir happens
8
8
  // before any Loom module (which may read cwd at import time) executes.
9
+ const fs = require("fs");
10
+ const os = require("os");
11
+ const path = require("path");
12
+
9
13
  if (process.env.LOOM_START_CWD) {
10
14
  try { process.chdir(process.env.LOOM_START_CWD); } catch {}
11
15
  }
16
+
17
+ // Crash black-box: OpenTUI swallows post-render errors, leaving users stuck
18
+ // on the splash with no clue why. Persist every uncaught failure to disk so
19
+ // a frozen TUI can be diagnosed after the fact.
20
+ const crashPath = () => path.join(os.homedir(), ".loom", "tui-crash.log");
21
+ function record(kind, err) {
22
+ try {
23
+ fs.mkdirSync(path.dirname(crashPath()), { recursive: true });
24
+ fs.appendFileSync(
25
+ crashPath(),
26
+ `[${new Date().toISOString()}] ${kind}: ${(err && (err.stack || err.message)) || String(err)}\n`
27
+ );
28
+ } catch {}
29
+ }
30
+ process.on("uncaughtException", (e) => { record("uncaughtException", e); });
31
+ process.on("unhandledRejection", (r) => { record("unhandledRejection", r); });
32
+
33
+ record("boot", new Error(
34
+ `argv=${JSON.stringify(process.argv.slice(1))} cwd=${process.cwd()} ` +
35
+ `startCwd=${process.env.LOOM_START_CWD || "-"} bun=${process.version} ` +
36
+ `node=${process.versions.node || "-"} platform=${process.platform}`
37
+ ));
38
+ if (process.env.LOOM_TUI_TRACE) globalThis.__loomTrace = record;
39
+
12
40
  await import("./tui-open.tsx");
package/src/tui-open.tsx CHANGED
@@ -8,7 +8,7 @@ import { defaultMcpInstall } from "./core/plugin-cmd.js";
8
8
  const args = process.argv.slice(2);
9
9
 
10
10
  if (args.includes("--version") || args.includes("-v")) {
11
- console.log("loom-code v1.2.0");
11
+ console.log(`loom-code v${import.meta.require("../package.json").version}`);
12
12
  process.exit(0);
13
13
  }
14
14
 
@@ -30,7 +30,11 @@ const sessionId = sIdx !== -1 ? args[sIdx + 1] : null;
30
30
  const autoMode = args.includes("--auto") || args.includes("-a");
31
31
  const initialPrompt = args.filter((a, i) => !a.startsWith("-") && (sIdx === -1 || i !== sIdx + 1)).join(" ");
32
32
 
33
- defaultMcpInstall();
33
+ try {
34
+ defaultMcpInstall();
35
+ } catch (e) {
36
+ globalThis.__loomTrace?.("mcp-install-failed", e);
37
+ }
34
38
 
35
39
  if (printMode) {
36
40
  const { Session } = require("./core/session.js");
@@ -43,9 +47,11 @@ if (printMode) {
43
47
  process.exit(resp.type === "error" ? 1 : 0);
44
48
  }
45
49
 
50
+ globalThis.__loomTrace?.("render-start");
46
51
  render(() => <App initialPrompt={initialPrompt} resumeSession={sessionId} autoMode={autoMode} />, {
47
52
  targetFps: 60,
48
53
  useMouse: true,
49
54
  autoFocus: true,
50
55
  exitOnCtrlC: false,
51
56
  });
57
+ globalThis.__loomTrace?.("render-returned");