create-claude-workspace 2.1.5 → 2.1.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/dist/scheduler/index.mjs
CHANGED
|
@@ -254,6 +254,7 @@ export async function runScheduler(opts) {
|
|
|
254
254
|
process.on('SIGTERM', cleanup);
|
|
255
255
|
// ─── Loop ───
|
|
256
256
|
for (let i = state.iteration; i < opts.maxIterations && !stopping; i++) {
|
|
257
|
+
tui.setIteration(i + 1, opts.maxIterations);
|
|
257
258
|
appendEvent(opts.projectDir, createEvent('health_check', { detail: `Iteration ${i + 1}` }));
|
|
258
259
|
try {
|
|
259
260
|
const workDone = await runIteration({
|
|
@@ -293,6 +294,7 @@ export async function runScheduler(opts) {
|
|
|
293
294
|
await sleep(opts.cooldown, stoppingRef);
|
|
294
295
|
}
|
|
295
296
|
writeState(opts.projectDir, state);
|
|
297
|
+
tui.iterationEnd();
|
|
296
298
|
// Pause support
|
|
297
299
|
while (tui.isPaused() && !stopping) {
|
|
298
300
|
await sleep(1000, stoppingRef);
|
|
@@ -381,7 +381,8 @@ export class TUI {
|
|
|
381
381
|
const model = input.model || '';
|
|
382
382
|
const desc = input.description || input.prompt || '';
|
|
383
383
|
const col = ANSI_COLORS[agentColor(type)] || '';
|
|
384
|
-
this.
|
|
384
|
+
// Don't push to agent stack — this is a sub-agent inside the SDK session.
|
|
385
|
+
// Our external spawn lifecycle is managed by onSpawnStart/onSpawnEnd callbacks.
|
|
385
386
|
this.log(` ${pre}${time} ${icon} ${col}${BOLD}${type}${RESET}${model ? ` ${ANSI_COLORS.gray}(${model})${RESET}` : ''} ${ANSI_COLORS.gray}${desc}${RESET}`, `AGENT: ${type} ${model} — ${desc}`);
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
@@ -441,7 +442,9 @@ export class TUI {
|
|
|
441
442
|
}
|
|
442
443
|
if (msg.subtype === 'task_notification') {
|
|
443
444
|
const status = msg.status || '';
|
|
444
|
-
|
|
445
|
+
// Don't pop agent stack here — SDK task_notification is about sub-agents inside the session.
|
|
446
|
+
// Our external spawn lifecycle is managed by onSpawnStart/onSpawnEnd callbacks.
|
|
447
|
+
const name = this.state.agents.length > 0 ? this.state.agents[this.state.agents.length - 1] : 'agent';
|
|
445
448
|
const col = ANSI_COLORS[agentColor(name)] || '';
|
|
446
449
|
const icon = status === 'completed' ? `${ANSI_COLORS.green}✓` : `${ANSI_COLORS.red}✗`;
|
|
447
450
|
const detail = msg.summary ? ` ${ANSI_COLORS.gray}${msg.summary}${RESET}` : '';
|
|
@@ -461,7 +464,16 @@ export class TUI {
|
|
|
461
464
|
if (msg.session_id)
|
|
462
465
|
this.fileOnly(`SESSION: ${msg.session_id}`);
|
|
463
466
|
}
|
|
464
|
-
pushAgent(name) {
|
|
467
|
+
pushAgent(name) {
|
|
468
|
+
this.state.agents.push(name);
|
|
469
|
+
if (!this.interactive) {
|
|
470
|
+
const elapsed = fmtDur(Date.now() - this.state.loopStart);
|
|
471
|
+
const iterTime = this.state.iterStart ? fmtDur(Date.now() - this.state.iterStart) : '—';
|
|
472
|
+
const tok = fmtTok(this.state.tokensIn + this.state.tokensOut);
|
|
473
|
+
const col = ANSI_COLORS[agentColor(name)] || '';
|
|
474
|
+
this.log(` ${ANSI_COLORS.gray}──── ${elapsed} │ iter ${iterTime} │ ${this.state.tools} tools │ ${tok} tok │ ${col}${BOLD}${name}${RESET}${ANSI_COLORS.gray} ────${RESET}`);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
465
477
|
popAgent() { if (this.state.agents.length > 1)
|
|
466
478
|
this.state.agents.pop(); }
|
|
467
479
|
resetAgentStack() { this.state.agents = this.topAgent ? [this.topAgent] : []; }
|