@thegitai/cli 1.0.0-preview.19 → 1.0.0-preview.20
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.
|
@@ -3,6 +3,7 @@ import { singleLinePreview, truncate } from '../../utils.js';
|
|
|
3
3
|
import { formatClientTokenUsage } from '../repl.js';
|
|
4
4
|
import { renderFormattedBodyLines, renderPreformattedBodyLines, } from './markdown-render.js';
|
|
5
5
|
import { displayWidth, line, padToWidth, plainLine, sliceToWidth, span, wrapText, } from './text.js';
|
|
6
|
+
import { isDarkTerminalBackground, mutedColor, mutedStyle } from './terminal-theme.js';
|
|
6
7
|
import { buildUserInputOverlayLines, } from './user-input.js';
|
|
7
8
|
const WORKING_CLOCK_ICON = '◷';
|
|
8
9
|
const BRAILLE_SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴'];
|
|
@@ -87,7 +88,7 @@ function splitComposerInput(input, cursor, width) {
|
|
|
87
88
|
function buildComposerInputLines(input, cursor, promptLabel, placeholder, width) {
|
|
88
89
|
if (!input) {
|
|
89
90
|
return [
|
|
90
|
-
line(span(promptLabel, { color: 'cyan' }), span(' ', { inverse: true }), span(placeholder, { color:
|
|
91
|
+
line(span(promptLabel, { color: 'cyan' }), span(' ', { inverse: true }), span(placeholder, { color: mutedColor() })),
|
|
91
92
|
];
|
|
92
93
|
}
|
|
93
94
|
const labelWidth = promptLabel.length;
|
|
@@ -277,14 +278,16 @@ function todoInProgressGlyph(progressTick) {
|
|
|
277
278
|
function todoItemLine(item, width, progressTick = null) {
|
|
278
279
|
const text = fitLine(item.text, Math.max(8, width - 5));
|
|
279
280
|
if (item.status === 'completed') {
|
|
280
|
-
return line(span(' ✔ ', { color: 'green' }), span(text,
|
|
281
|
+
return line(span(' ✔ ', { color: 'green' }), span(text, mutedStyle()));
|
|
281
282
|
}
|
|
282
283
|
if (item.status === 'in_progress') {
|
|
283
284
|
return line(span(` ${todoInProgressGlyph(progressTick)} `, {
|
|
284
285
|
color: TODO_IN_PROGRESS_COLOR,
|
|
285
286
|
}), span(text, { color: TODO_IN_PROGRESS_COLOR, bold: true }));
|
|
286
287
|
}
|
|
287
|
-
return line(span(' ○ ', { color:
|
|
288
|
+
return line(span(' ○ ', { color: mutedColor() }), isDarkTerminalBackground()
|
|
289
|
+
? span(text, { color: mutedColor() })
|
|
290
|
+
: span(text));
|
|
288
291
|
}
|
|
289
292
|
const TURN_MESSAGE_PANEL_MAX_ROWS = 6;
|
|
290
293
|
const TURN_MESSAGE_LABEL = {
|
|
@@ -335,7 +338,7 @@ export function renderTodoListLines(items, width, { header = false, progressTick
|
|
|
335
338
|
return [];
|
|
336
339
|
const lines = [];
|
|
337
340
|
if (header) {
|
|
338
|
-
lines.push(line(span('To-dos', { color: 'cyan', bold: true }), span(` · ${formatTodoProgress(items)}`, { color:
|
|
341
|
+
lines.push(line(span('To-dos', { color: 'cyan', bold: true }), span(` · ${formatTodoProgress(items)}`, { color: mutedColor() })));
|
|
339
342
|
}
|
|
340
343
|
const itemRowBudget = TODO_PANEL_MAX_ROWS - (header ? 1 : 0);
|
|
341
344
|
let collapsedDone = 0;
|
|
@@ -349,7 +352,7 @@ export function renderTodoListLines(items, width, { header = false, progressTick
|
|
|
349
352
|
collapsedDone = Math.min(over, leadingDone);
|
|
350
353
|
}
|
|
351
354
|
if (collapsedDone > 0) {
|
|
352
|
-
lines.push(line(span(' ✔ ', { color: 'green' }), span(`${collapsedDone} completed`,
|
|
355
|
+
lines.push(line(span(' ✔ ', { color: 'green' }), span(`${collapsedDone} completed`, mutedStyle())));
|
|
353
356
|
}
|
|
354
357
|
const remaining = items.slice(collapsedDone);
|
|
355
358
|
const budget = itemRowBudget - (collapsedDone > 0 ? 1 : 0);
|
|
@@ -358,10 +361,7 @@ export function renderTodoListLines(items, width, { header = false, progressTick
|
|
|
358
361
|
lines.push(todoItemLine(item, width, progressTick));
|
|
359
362
|
}
|
|
360
363
|
if (remaining.length > visible.length) {
|
|
361
|
-
lines.push(plainLine(` … +${remaining.length - visible.length} more`,
|
|
362
|
-
color: 'gray',
|
|
363
|
-
dim: true,
|
|
364
|
-
}));
|
|
364
|
+
lines.push(plainLine(` … +${remaining.length - visible.length} more`, mutedStyle()));
|
|
365
365
|
}
|
|
366
366
|
return lines;
|
|
367
367
|
}
|
|
@@ -527,9 +527,10 @@ function composerFooterLines(state) {
|
|
|
527
527
|
: 'Enter sends • Shift+Tab mode • Ctrl+V image • Esc cancel turn • Ctrl+C clears / quits';
|
|
528
528
|
const agentLabel = agentModeLabel(state.agentMode).padEnd(AGENT_MODE_LABEL_WIDTH);
|
|
529
529
|
const tokenUsageText = state.tokenUsage || formatClientTokenUsage(null);
|
|
530
|
+
const footerMuted = mutedStyle();
|
|
530
531
|
const footerSpans = [
|
|
531
|
-
span(helperText,
|
|
532
|
-
span(' '.repeat(Math.max(1, 8)),
|
|
532
|
+
span(helperText, footerMuted),
|
|
533
|
+
span(' '.repeat(Math.max(1, 8)), footerMuted),
|
|
533
534
|
span(agentLabel, {
|
|
534
535
|
color: state.agentMode === 'plan' ? 'yellow' : 'cyan',
|
|
535
536
|
}),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function isDarkTerminalBackground(env = process.env) {
|
|
2
|
+
const raw = String(env.COLORFGBG ?? '').trim();
|
|
3
|
+
if (!raw)
|
|
4
|
+
return false;
|
|
5
|
+
const parts = raw
|
|
6
|
+
.split(/[;:]/)
|
|
7
|
+
.map((part) => part.trim())
|
|
8
|
+
.filter(Boolean);
|
|
9
|
+
const bgToken = parts[parts.length - 1];
|
|
10
|
+
if (!bgToken)
|
|
11
|
+
return false;
|
|
12
|
+
const bg = Number(bgToken);
|
|
13
|
+
if (!Number.isFinite(bg))
|
|
14
|
+
return false;
|
|
15
|
+
return bg >= 0 && bg < 7;
|
|
16
|
+
}
|
|
17
|
+
export function mutedStyle(env = process.env) {
|
|
18
|
+
if (isDarkTerminalBackground(env)) {
|
|
19
|
+
return { color: 'ansi256(247)' };
|
|
20
|
+
}
|
|
21
|
+
return { color: 'gray' };
|
|
22
|
+
}
|
|
23
|
+
export function mutedColor(env = process.env) {
|
|
24
|
+
if (isDarkTerminalBackground(env)) {
|
|
25
|
+
return 'ansi256(247)';
|
|
26
|
+
}
|
|
27
|
+
return 'gray';
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegitai/cli",
|
|
3
|
-
"version": "1.0.0-preview.
|
|
3
|
+
"version": "1.0.0-preview.20",
|
|
4
4
|
"description": "TheGitAI is an AI coding agent for your terminal. It indexes your repository, writes and edits files, runs commands, and builds features with you.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"@lydell/node-pty-linux-x64": "1.1.0",
|
|
38
38
|
"@lydell/node-pty-win32-arm64": "1.1.0",
|
|
39
39
|
"@lydell/node-pty-win32-x64": "1.1.0",
|
|
40
|
-
"@thegitai/tui-darwin-arm64": "1.0.0-preview.
|
|
41
|
-
"@thegitai/tui-darwin-x64": "1.0.0-preview.
|
|
42
|
-
"@thegitai/tui-linux-x64": "1.0.0-preview.
|
|
43
|
-
"@thegitai/tui-win32-x64": "1.0.0-preview.
|
|
40
|
+
"@thegitai/tui-darwin-arm64": "1.0.0-preview.20",
|
|
41
|
+
"@thegitai/tui-darwin-x64": "1.0.0-preview.20",
|
|
42
|
+
"@thegitai/tui-linux-x64": "1.0.0-preview.20",
|
|
43
|
+
"@thegitai/tui-win32-x64": "1.0.0-preview.20",
|
|
44
44
|
"@vscode/ripgrep": "1.18.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|