loom-agent 1.2.4 → 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 +1 -1
- package/src/tui/App.tsx +1 -0
- package/src/tui-bootstrap.js +28 -0
- package/src/tui-open.tsx +7 -1
package/package.json
CHANGED
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
|
|
package/src/tui-bootstrap.js
CHANGED
|
@@ -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
|
@@ -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
|
-
|
|
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");
|