nex-code 0.3.4 → 0.3.7

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/cli/ui.js DELETED
@@ -1,93 +0,0 @@
1
- /**
2
- * cli/ui.js — ANSI Colors, Banner, and Terminal Utilities
3
- * Rich terminal output with markdown rendering support
4
- */
5
-
6
- const C = {
7
- reset: '\x1b[0m',
8
- bold: '\x1b[1m',
9
- dim: '\x1b[2m',
10
- white: '\x1b[37m',
11
- red: '\x1b[31m',
12
- green: '\x1b[32m',
13
- yellow: '\x1b[33m',
14
- blue: '\x1b[34m',
15
- magenta: '\x1b[35m',
16
- cyan: '\x1b[36m',
17
- gray: '\x1b[90m',
18
- bgRed: '\x1b[41m',
19
- bgGreen: '\x1b[42m',
20
- brightCyan: '\x1b[96m',
21
- brightMagenta: '\x1b[95m',
22
- brightBlue: '\x1b[94m',
23
- };
24
-
25
- function colorLine(text, rgb) {
26
- // Color all visible chars in a line with a single RGB color
27
- return [...text].map(ch => {
28
- if (ch === ' ') return ch;
29
- return `\x1b[38;2;${rgb[0]};${rgb[1]};${rgb[2]}m${ch}`;
30
- }).join('') + C.reset;
31
- }
32
-
33
- function lerpColor(stops, t) {
34
- const seg = (stops.length - 1) * t;
35
- const i = Math.min(Math.floor(seg), stops.length - 2);
36
- const f = seg - i;
37
- return [
38
- Math.round(stops[i][0] + (stops[i + 1][0] - stops[i][0]) * f),
39
- Math.round(stops[i][1] + (stops[i + 1][1] - stops[i][1]) * f),
40
- Math.round(stops[i][2] + (stops[i + 1][2] - stops[i][2]) * f),
41
- ];
42
- }
43
-
44
- function banner(modelName, cwd, opts = {}) {
45
- const B = C.bold;
46
- const d = C.dim;
47
- const r = C.reset;
48
-
49
- const raw = [
50
- '███╗ ██╗███████╗██╗ ██╗ ━ ██████╗ ██████╗ ██████╗ ███████╗',
51
- '████╗ ██║██╔════╝╚██╗██╔╝ ━ ██╔════╝██╔═══██╗██╔══██╗██╔════╝',
52
- '██╔██╗ ██║█████╗ ╚███╔╝ ━ ██║ ██║ ██║██║ ██║█████╗',
53
- '██║╚██╗██║██╔══╝ ██╔██╗ ━ ██║ ██║ ██║██║ ██║██╔══╝',
54
- '██║ ╚████║███████╗██╔╝ ██╗ ━ ╚██████╗╚██████╔╝██████╔╝███████╗',
55
- '╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ━ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝',
56
- ];
57
-
58
- // Vertical gradient: Ice — White → Cyan → Deep Blue
59
- const stops = [[220, 240, 255], [80, 200, 255], [40, 100, 220]];
60
- const logo = raw.map((line, i) => {
61
- const t = i / (raw.length - 1 || 1);
62
- return colorLine(line, lerpColor(stops, t));
63
- }).join('\n');
64
-
65
- const yoloTag = opts.yolo ? ` ${B}${C.yellow}⚡ YOLO${r}` : '';
66
-
67
- console.log(`
68
- ${logo}
69
- ${d}Agentic Coding CLI v${require('../package.json').version}${r}
70
- ${d}Model: ${modelName}${r} ${d}· /help${r}${yoloTag}
71
- `);
72
- }
73
-
74
- // Re-exports from spinner.js and format.js for backward compatibility
75
- const { Spinner, MultiProgress, TaskProgress, setActiveTaskProgress, getActiveTaskProgress, cleanupTerminal } = require('./spinner');
76
- const { formatToolCall, formatResult, getToolSpinnerText, formatToolSummary } = require('./format');
77
-
78
- module.exports = {
79
- C,
80
- banner,
81
- // Re-exported from spinner.js
82
- Spinner,
83
- MultiProgress,
84
- TaskProgress,
85
- setActiveTaskProgress,
86
- getActiveTaskProgress,
87
- cleanupTerminal,
88
- // Re-exported from format.js
89
- formatToolCall,
90
- formatResult,
91
- getToolSpinnerText,
92
- formatToolSummary,
93
- };