create-claude-workspace 1.1.128 → 1.1.129
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/dist/scripts/lib/tui.mjs +19 -3
- package/package.json +1 -1
package/dist/scripts/lib/tui.mjs
CHANGED
|
@@ -62,8 +62,12 @@ export class TUI {
|
|
|
62
62
|
constructor(logFile, interactive = false) {
|
|
63
63
|
this.logFile = logFile;
|
|
64
64
|
this.interactive = interactive && process.stdin.isTTY === true;
|
|
65
|
-
if (this.interactive)
|
|
65
|
+
if (this.interactive) {
|
|
66
66
|
this.setupInput();
|
|
67
|
+
// Initial status bar + input prompt
|
|
68
|
+
this.renderStatusBar();
|
|
69
|
+
this.printInputPrompt('');
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
// ─── Input handling (interactive only) ───
|
|
69
73
|
setupInput() {
|
|
@@ -120,10 +124,12 @@ export class TUI {
|
|
|
120
124
|
isPaused() { return this.paused_; }
|
|
121
125
|
// ─── Output ───
|
|
122
126
|
out(formatted, raw) {
|
|
123
|
-
// Clear input line if interactive, then print, then restore prompt
|
|
124
127
|
if (this.interactive) {
|
|
125
|
-
|
|
128
|
+
// Move up 2 lines (status + input), clear them, print log, redraw
|
|
129
|
+
process.stdout.write('\x1b[2K\r'); // clear input line
|
|
130
|
+
process.stdout.write('\x1b[A\x1b[2K\r'); // move up, clear status line
|
|
126
131
|
console.log(formatted);
|
|
132
|
+
this.renderStatusBar();
|
|
127
133
|
this.printInputPrompt(this.inputBuf);
|
|
128
134
|
}
|
|
129
135
|
else {
|
|
@@ -137,6 +143,16 @@ export class TUI {
|
|
|
137
143
|
catch { /* */ }
|
|
138
144
|
}
|
|
139
145
|
}
|
|
146
|
+
renderStatusBar() {
|
|
147
|
+
const elapsed = this.loopStart ? fmtDur(Date.now() - this.loopStart) : '—';
|
|
148
|
+
const iterElapsed = this.iterStart_ ? fmtDur(Date.now() - this.iterStart_) : '—';
|
|
149
|
+
const pct = this.maxIter > 0 ? Math.round((this.iteration_ / this.maxIter) * 100) : 0;
|
|
150
|
+
const tok = fmtTok(this.tokens_.input + this.tokens_.output);
|
|
151
|
+
const taskInfo = this.taskName_ ? ` │ ${a.fg.cyan}${trunc(this.taskName_, 30)}${a.reset}` : '';
|
|
152
|
+
const pauseLabel = this.paused_ ? ` │ ${a.fg.yellow}⏸ PAUSED${a.reset}` : '';
|
|
153
|
+
const line = ` ${a.fg.gray}${elapsed}${a.reset} │ Iter ${this.iteration_}/${this.maxIter} ${bar(pct, 10)} │ ${iterElapsed} │ ${a.fg.cyan}${this.tools}${a.reset} tools │ ${a.fg.yellow}${tok}${a.reset} tok${taskInfo}${pauseLabel}`;
|
|
154
|
+
process.stdout.write(`${a.bg.gray}${line}${' '.repeat(Math.max(0, (process.stdout.columns || 80) - strip(line).length))}${a.reset}\n`);
|
|
155
|
+
}
|
|
140
156
|
fileOnly(msg) {
|
|
141
157
|
if (this.logFile) {
|
|
142
158
|
try {
|