create-claude-workspace 1.1.126 → 1.1.128
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
|
@@ -57,6 +57,8 @@ export class TUI {
|
|
|
57
57
|
tokens_ = { input: 0, output: 0 };
|
|
58
58
|
iterStart_ = 0;
|
|
59
59
|
agents = [];
|
|
60
|
+
lastModel_ = '';
|
|
61
|
+
inputBuf = '';
|
|
60
62
|
constructor(logFile, interactive = false) {
|
|
61
63
|
this.logFile = logFile;
|
|
62
64
|
this.interactive = interactive && process.stdin.isTTY === true;
|
|
@@ -69,7 +71,6 @@ export class TUI {
|
|
|
69
71
|
return;
|
|
70
72
|
process.stdin.setRawMode(true);
|
|
71
73
|
process.stdin.resume();
|
|
72
|
-
let buf = '';
|
|
73
74
|
process.stdin.on('data', (data) => {
|
|
74
75
|
const key = data.toString();
|
|
75
76
|
if (key === '\x03') {
|
|
@@ -86,21 +87,21 @@ export class TUI {
|
|
|
86
87
|
return;
|
|
87
88
|
} // Ctrl+S
|
|
88
89
|
if (key === '\r' || key === '\n') {
|
|
89
|
-
if (
|
|
90
|
-
this.onInput?.(
|
|
90
|
+
if (this.inputBuf.trim()) {
|
|
91
|
+
this.onInput?.(this.inputBuf.trim());
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
-
this.printInputPrompt(
|
|
93
|
+
this.inputBuf = '';
|
|
94
|
+
this.printInputPrompt(this.inputBuf);
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
97
|
if (key === '\x7f' || key === '\b') {
|
|
97
|
-
|
|
98
|
-
this.printInputPrompt(
|
|
98
|
+
this.inputBuf = this.inputBuf.slice(0, -1);
|
|
99
|
+
this.printInputPrompt(this.inputBuf);
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
102
|
if (key.length === 1 && key >= ' ') {
|
|
102
|
-
|
|
103
|
-
this.printInputPrompt(
|
|
103
|
+
this.inputBuf += key;
|
|
104
|
+
this.printInputPrompt(this.inputBuf);
|
|
104
105
|
}
|
|
105
106
|
});
|
|
106
107
|
}
|
|
@@ -123,7 +124,7 @@ export class TUI {
|
|
|
123
124
|
if (this.interactive) {
|
|
124
125
|
process.stdout.write('\r\x1b[2K');
|
|
125
126
|
console.log(formatted);
|
|
126
|
-
this.printInputPrompt(
|
|
127
|
+
this.printInputPrompt(this.inputBuf);
|
|
127
128
|
}
|
|
128
129
|
else {
|
|
129
130
|
console.log(formatted);
|
|
@@ -213,6 +214,11 @@ export class TUI {
|
|
|
213
214
|
this.tokens_.input += msg.message.usage.input_tokens || 0;
|
|
214
215
|
this.tokens_.output += msg.message.usage.output_tokens || 0;
|
|
215
216
|
}
|
|
217
|
+
// Show model from message if available
|
|
218
|
+
const model = msg.message?.model;
|
|
219
|
+
if (model && !this.lastModel_) {
|
|
220
|
+
this.lastModel_ = model;
|
|
221
|
+
}
|
|
216
222
|
for (const block of content) {
|
|
217
223
|
if (block.type === 'text' && block.text?.trim()) {
|
|
218
224
|
this.out(`${this.indent()}${a.fg.white}${trunc(block.text, 300)}${a.reset}`, `TEXT: ${trunc(block.text, 300)}`);
|
|
@@ -284,9 +290,12 @@ export class TUI {
|
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
292
|
onSystem(msg) {
|
|
287
|
-
//
|
|
288
|
-
if (
|
|
289
|
-
|
|
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}`);
|
|
290
299
|
if (msg.tools?.length) {
|
|
291
300
|
this.out(` ${a.fg.gray} Tools: ${msg.tools.join(', ')}${a.reset}`);
|
|
292
301
|
}
|
|
@@ -294,13 +303,19 @@ export class TUI {
|
|
|
294
303
|
}
|
|
295
304
|
if (msg.subtype === 'task_started') {
|
|
296
305
|
const desc = msg.description || '';
|
|
297
|
-
|
|
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}`);
|
|
298
310
|
return;
|
|
299
311
|
}
|
|
300
312
|
if (msg.subtype === 'task_notification') {
|
|
301
313
|
const status = msg.status || '';
|
|
302
314
|
const icon = status === 'completed' ? `${a.fg.green}✓` : `${a.fg.red}✗`;
|
|
303
|
-
|
|
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 || ''}`);
|
|
304
319
|
return;
|
|
305
320
|
}
|
|
306
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."
|