create-claude-workspace 1.1.125 → 1.1.127
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
CHANGED
|
@@ -47,6 +47,7 @@ export class TUI {
|
|
|
47
47
|
onHotkey = null;
|
|
48
48
|
paused_ = false;
|
|
49
49
|
// Stats
|
|
50
|
+
loopStart = Date.now();
|
|
50
51
|
iteration_ = 0;
|
|
51
52
|
maxIter = 0;
|
|
52
53
|
taskName_ = '';
|
|
@@ -56,6 +57,7 @@ export class TUI {
|
|
|
56
57
|
tokens_ = { input: 0, output: 0 };
|
|
57
58
|
iterStart_ = 0;
|
|
58
59
|
agents = [];
|
|
60
|
+
lastModel_ = '';
|
|
59
61
|
constructor(logFile, interactive = false) {
|
|
60
62
|
this.logFile = logFile;
|
|
61
63
|
this.interactive = interactive && process.stdin.isTTY === true;
|
|
@@ -166,8 +168,9 @@ export class TUI {
|
|
|
166
168
|
this.tokens_ = { input: 0, output: 0 };
|
|
167
169
|
this.agents = [];
|
|
168
170
|
const pct = Math.round((i / max) * 100);
|
|
171
|
+
const elapsed = fmtDur(Date.now() - this.loopStart);
|
|
169
172
|
this.out('');
|
|
170
|
-
this.out(` ${a.bold}${a.fg.white}━━━ Iteration ${i}/${max} ${bar(pct, 20)} ${pct}% ━━━${a.reset}`);
|
|
173
|
+
this.out(` ${a.bold}${a.fg.white}━━━ Iteration ${i}/${max} ${bar(pct, 20)} ${pct}% ${a.fg.gray}│ ${elapsed} elapsed${a.fg.white} ━━━${a.reset}`);
|
|
171
174
|
if (this.taskName_) {
|
|
172
175
|
const tPct = this.tasksTotal_ > 0 ? Math.round((this.tasksDone_ / this.tasksTotal_) * 100) : 0;
|
|
173
176
|
this.out(` ${a.fg.cyan}📋 ${this.taskName_}${a.reset} ${a.fg.gray}(${this.tasksDone_}/${this.tasksTotal_} tasks ${bar(tPct, 10)} ${tPct}%)${a.reset}`);
|
|
@@ -180,10 +183,11 @@ export class TUI {
|
|
|
180
183
|
this.tasksTotal_ = total;
|
|
181
184
|
}
|
|
182
185
|
iterationEnd() {
|
|
183
|
-
const
|
|
186
|
+
const iterElapsed = fmtDur(Date.now() - this.iterStart_);
|
|
187
|
+
const totalElapsed = fmtDur(Date.now() - this.loopStart);
|
|
184
188
|
const tok = fmtTok(this.tokens_.input + this.tokens_.output);
|
|
185
189
|
this.out('');
|
|
186
|
-
this.out(` ${a.fg.gray}━━━━ ${
|
|
190
|
+
this.out(` ${a.fg.gray}━━━━ ${iterElapsed} (iter) │ ${totalElapsed} (total) │ ${this.tools} tools │ ${tok} tokens ━━━━${a.reset}`);
|
|
187
191
|
}
|
|
188
192
|
// ─── SDK message handler ───
|
|
189
193
|
handleMessage(message) {
|
|
@@ -210,6 +214,11 @@ export class TUI {
|
|
|
210
214
|
this.tokens_.input += msg.message.usage.input_tokens || 0;
|
|
211
215
|
this.tokens_.output += msg.message.usage.output_tokens || 0;
|
|
212
216
|
}
|
|
217
|
+
// Show model from message if available
|
|
218
|
+
const model = msg.message?.model;
|
|
219
|
+
if (model && !this.lastModel_) {
|
|
220
|
+
this.lastModel_ = model;
|
|
221
|
+
}
|
|
213
222
|
for (const block of content) {
|
|
214
223
|
if (block.type === 'text' && block.text?.trim()) {
|
|
215
224
|
this.out(`${this.indent()}${a.fg.white}${trunc(block.text, 300)}${a.reset}`, `TEXT: ${trunc(block.text, 300)}`);
|
|
@@ -281,9 +290,12 @@ export class TUI {
|
|
|
281
290
|
}
|
|
282
291
|
}
|
|
283
292
|
onSystem(msg) {
|
|
284
|
-
//
|
|
285
|
-
if (
|
|
286
|
-
|
|
293
|
+
// Init message — show model, agents, version
|
|
294
|
+
if (msg.subtype === 'init') {
|
|
295
|
+
const model = msg.model || 'unknown';
|
|
296
|
+
const agents = msg.agents?.length ? msg.agents.join(', ') : 'none';
|
|
297
|
+
const ver = msg.claude_code_version || '';
|
|
298
|
+
this.out(` ${a.fg.gray}${ts()}${a.reset} ${a.fg.cyan}⚙${a.reset} Claude Code ${ver} │ Model: ${a.bold}${model}${a.reset} │ Agents: ${a.fg.cyan}${agents}${a.reset}`);
|
|
287
299
|
if (msg.tools?.length) {
|
|
288
300
|
this.out(` ${a.fg.gray} Tools: ${msg.tools.join(', ')}${a.reset}`);
|
|
289
301
|
}
|
|
@@ -291,13 +303,19 @@ export class TUI {
|
|
|
291
303
|
}
|
|
292
304
|
if (msg.subtype === 'task_started') {
|
|
293
305
|
const desc = msg.description || '';
|
|
294
|
-
|
|
306
|
+
const taskType = msg.task_type || '';
|
|
307
|
+
const col = agentColor(desc);
|
|
308
|
+
this.agents.push(desc);
|
|
309
|
+
this.out(` ${a.fg.gray}${ts()}${a.reset} 🤖 ${col}${a.bold}${desc}${a.reset}${taskType ? ` ${a.fg.gray}(${taskType})${a.reset}` : ''}`, `AGENT_START: ${desc} ${taskType}`);
|
|
295
310
|
return;
|
|
296
311
|
}
|
|
297
312
|
if (msg.subtype === 'task_notification') {
|
|
298
313
|
const status = msg.status || '';
|
|
299
314
|
const icon = status === 'completed' ? `${a.fg.green}✓` : `${a.fg.red}✗`;
|
|
300
|
-
|
|
315
|
+
const summary = msg.summary ? ` ${a.fg.gray}${trunc(msg.summary, 80)}${a.reset}` : '';
|
|
316
|
+
if (this.agents.length > 0)
|
|
317
|
+
this.agents.pop();
|
|
318
|
+
this.out(` ${a.fg.gray}${ts()}${a.reset} ${icon}${a.reset} Agent ${status}${summary}`, `AGENT_END: ${status} ${msg.summary || ''}`);
|
|
301
319
|
return;
|
|
302
320
|
}
|
|
303
321
|
if (msg.subtype === 'task_progress' && msg.description) {
|
|
@@ -38,6 +38,9 @@ fi
|
|
|
38
38
|
chown claude:claude /home/claude
|
|
39
39
|
chown -R claude:claude /home/claude/.claude 2>/dev/null || true
|
|
40
40
|
|
|
41
|
+
# Fix git "dubious ownership" — /project is mounted from host with different uid
|
|
42
|
+
git config --global --add safe.directory /project
|
|
43
|
+
|
|
41
44
|
# Git platform auth — configure gh/glab + git credentials from env vars if set
|
|
42
45
|
if [[ -n "${GH_TOKEN:-}" ]]; then
|
|
43
46
|
echo "GH_TOKEN detected — GitHub CLI authenticated."
|