loom-agent 1.2.5 → 1.2.6

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-tui.js CHANGED
@@ -32,6 +32,7 @@ const entry = path.join(__dirname, '..', 'src', 'tui-bootstrap.js');
32
32
  // is restored by the bootstrap shim before app code runs.
33
33
  const pkgRoot = path.join(__dirname, '..');
34
34
  process.env.LOOM_START_CWD = process.cwd();
35
+ process.env.LOOM_BIN_NAME = "loom";
35
36
  const bun = findBun();
36
37
 
37
38
  if (bun) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loom-agent",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/toshalkumbhar8979-design/loomcode.git"
package/src/core/cli.js CHANGED
@@ -565,6 +565,7 @@ if (args.includes('--help') || args.includes('-h')) {
565
565
  // LOOM_START_CWD restores the user's project dir in tui-bootstrap.js.
566
566
  const pkgRoot = path.join(__dirname, '..', '..');
567
567
  process.env.LOOM_START_CWD = process.cwd();
568
+ process.env.LOOM_BIN_NAME = "loom";
568
569
  const tuiArgs = [tuiEntry];
569
570
  if (sessionId) tuiArgs.push('-s', sessionId);
570
571
  if (autoMode) tuiArgs.push('--auto');
package/src/tui/App.tsx CHANGED
@@ -87,7 +87,8 @@ export function App(props: { initialPrompt?: string; resumeSession?: string; aut
87
87
  setTimeout(function() {
88
88
  console.log("");
89
89
  console.log(LOOM_LOGO.join("\n"));
90
- console.log(" resume: loomcode -s " + sessionId);
90
+ const binName = process.env.LOOM_BIN_NAME || "loom";
91
+ console.log(" resume: " + binName + " -s " + sessionId);
91
92
  console.log("");
92
93
  process.exit(code);
93
94
  }, 150);
@@ -7,9 +7,6 @@ export function SplashScreen() {
7
7
  const ui = palette("loom");
8
8
 
9
9
  return (
10
- // Centered like opencode: the whole block (logo + status + chatbox)
11
- // floats mid-screen and grows symmetrically around its center as the
12
- // chatbox lines up.
13
10
  <box flexDirection="column" flexGrow={1} alignItems="center" justifyContent="center" backgroundColor={ui.bg}>
14
11
  <box flexGrow={1} />
15
12
 
@@ -14,6 +14,22 @@ if (process.env.LOOM_START_CWD) {
14
14
  try { process.chdir(process.env.LOOM_START_CWD); } catch {}
15
15
  }
16
16
 
17
+ // Windows consoles default to a legacy codepage where the box-drawing /
18
+ // block glyphs used across the TUI render as "?" garbage, and VT input
19
+ // sequences (arrows, ctrl combos, bracketed paste) may never arrive. Switch
20
+ // both console CPs to UTF-8 before anything renders or reads stdin.
21
+ if (process.platform === "win32") {
22
+ try {
23
+ const { dlopen } = require("bun:ffi");
24
+ const k32 = dlopen("kernel32.dll", {
25
+ SetConsoleOutputCP: { args: ["uint"], returns: "int" },
26
+ SetConsoleCP: { args: ["uint"], returns: "int" },
27
+ });
28
+ k32.symbols.SetConsoleOutputCP(65001);
29
+ k32.symbols.SetConsoleCP(65001);
30
+ } catch {}
31
+ }
32
+
17
33
  // Crash black-box: OpenTUI swallows post-render errors, leaving users stuck
18
34
  // on the splash with no clue why. Persist every uncaught failure to disk so
19
35
  // a frozen TUI can be diagnosed after the fact.
package/src/tui-open.tsx CHANGED
@@ -7,6 +7,21 @@ import { defaultMcpInstall } from "./core/plugin-cmd.js";
7
7
 
8
8
  const args = process.argv.slice(2);
9
9
 
10
+ // Windows: switch both console codepages to UTF-8 so the box-drawing logo
11
+ // and VT input sequences work even when launched without the bootstrap
12
+ // shim (bun run src/tui-open.tsx). No-op elsewhere / if FFI is unavailable.
13
+ if (process.platform === "win32") {
14
+ try {
15
+ const { dlopen } = require("bun:ffi");
16
+ const k32 = dlopen("kernel32.dll", {
17
+ SetConsoleOutputCP: { args: ["uint"], returns: "int" },
18
+ SetConsoleCP: { args: ["uint"], returns: "int" },
19
+ });
20
+ k32.symbols.SetConsoleOutputCP(65001);
21
+ k32.symbols.SetConsoleCP(65001);
22
+ } catch {}
23
+ }
24
+
10
25
  if (args.includes("--version") || args.includes("-v")) {
11
26
  console.log(`loom-code v${import.meta.require("../package.json").version}`);
12
27
  process.exit(0);