@truss-harness/tui 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/dist/bin.js +19 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -13,6 +13,8 @@ truss-tui
13
13
 
14
14
  Run `truss-tui --help` for a non-interactive launch reference. Inside the TUI, press `?` for the complete keyboard-control reference.
15
15
 
16
+ On Windows, use PowerShell or Windows Terminal. When launching from Git Bash, Truss automatically uses Git for Windows' `winpty` bridge when available; `winpty truss-tui` is the manual fallback.
17
+
16
18
  The TUI reads the same `.truss-harness/config.json` profiles as `@truss-harness/cli`, or lets you select a detected Ollama, LM Studio, llama.cpp, or custom compatible endpoint at startup.
17
19
 
18
20
  Configured MCP stdio servers are connected when an Agent session starts, and their connection status appears in the Terminal pane. Plan mode loads only servers explicitly marked `readOnly`. Run `truss-cli config path` to locate the shared user and workspace configuration files.
package/dist/bin.js CHANGED
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { spawn } from "node:child_process";
3
+ import { spawn, spawnSync } from "node:child_process";
4
4
  import { execFile as execFileCallback } from "node:child_process";
5
5
  import { readdir, readFile } from "node:fs/promises";
6
6
  import { join, relative } from "node:path";
7
7
  import { cwd } from "node:process";
8
8
  import { promisify } from "node:util";
9
+ import { fileURLToPath } from "node:url";
9
10
  import { Box, render, Text, useApp, useInput } from "ink";
10
11
  import { useEffect, useMemo, useRef, useState } from "react";
11
12
  import { detectLocalEndpoints, listLocalModels } from "@truss-harness/provider-openai-compatible";
@@ -29,6 +30,23 @@ if (process.argv.slice(2).some((argument) => argument === "--help" || argument =
29
30
  process.stdout.write(tuiHelp);
30
31
  process.exit(0);
31
32
  }
33
+ function ensureInteractiveTerminal() {
34
+ if (process.stdin.isTTY && typeof process.stdin.setRawMode === "function")
35
+ return;
36
+ // Git Bash exposes a pipe to Node for some console programs. winpty creates
37
+ // the Windows console bridge Ink needs for keyboard input.
38
+ if (process.platform === "win32" && process.env.MSYSTEM && process.env.TRUSS_TUI_WINPTY !== "1") {
39
+ const result = spawnSync("winpty", [process.execPath, fileURLToPath(import.meta.url), ...process.argv.slice(2)], {
40
+ stdio: "inherit",
41
+ env: { ...process.env, TRUSS_TUI_WINPTY: "1" }
42
+ });
43
+ if (!result.error)
44
+ process.exit(result.status ?? 1);
45
+ }
46
+ process.stderr.write(brand.productName + " TUI needs an interactive terminal with raw keyboard input. Open PowerShell or Windows Terminal and run " + brand.tuiCommand + ", or run winpty " + brand.tuiCommand + " from Git Bash.\n");
47
+ process.exit(1);
48
+ }
49
+ ensureInteractiveTerminal();
32
50
  const execFile = promisify(execFileCallback);
33
51
  const ignoredDirectories = new Set([".git", ".next", ".truss-harness", "node_modules", "dist", "coverage"]);
34
52
  const focusOrder = ["files", "editor", "chat", "terminal"];
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@truss-harness/tui",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Interactive terminal client for Truss.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "truss-tui": "./dist/bin.js"
7
+ "truss-tui": "dist/bin.js"
8
8
  },
9
9
  "scripts": {
10
10
  "build": "tsc -b",