@truss-harness/tui 0.1.0 → 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 +4 -0
  2. package/dist/bin.js +34 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -11,6 +11,10 @@ npm install -g @truss-harness/tui
11
11
  truss-tui
12
12
  ```
13
13
 
14
+ Run `truss-tui --help` for a non-interactive launch reference. Inside the TUI, press `?` for the complete keyboard-control reference.
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
+
14
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.
15
19
 
16
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";
@@ -14,6 +15,38 @@ import { resolveConfiguration } from "@truss-harness/cli/config";
14
15
  import { createClientRuntime } from "@truss-harness/cli/runtime";
15
16
  import { executeWorkspaceCommand, FileWorkspacePlanStore, workspaceCommandHelp } from "@truss-harness/runtime";
16
17
  import { buildFileTree, fuzzyFiles, syntaxTokens, wrapSyntaxTokens } from "./file-browser.js";
18
+ const tuiHelp = `${brand.productName} TUI
19
+
20
+ Full-screen terminal workspace for local coding models.
21
+
22
+ Usage:
23
+ ${brand.tuiCommand}
24
+
25
+ The TUI starts in the current workspace and reads the same configuration
26
+ profiles as ${brand.cliCommand}. Press ? inside the TUI for its complete
27
+ keyboard-control reference.
28
+ `;
29
+ if (process.argv.slice(2).some((argument) => argument === "--help" || argument === "-h")) {
30
+ process.stdout.write(tuiHelp);
31
+ process.exit(0);
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();
17
50
  const execFile = promisify(execFileCallback);
18
51
  const ignoredDirectories = new Set([".git", ".next", ".truss-harness", "node_modules", "dist", "coverage"]);
19
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.0",
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",