agileflow 2.90.1 → 2.90.2
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/CHANGELOG.md +5 -0
- package/package.json +1 -1
- package/scripts/tui/simple-tui.js +48 -18
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -164,7 +164,8 @@ function pad(str, width, align = 'left') {
|
|
|
164
164
|
const s = String(str).slice(0, width);
|
|
165
165
|
const padding = width - s.length;
|
|
166
166
|
if (align === 'right') return ' '.repeat(padding) + s;
|
|
167
|
-
if (align === 'center')
|
|
167
|
+
if (align === 'center')
|
|
168
|
+
return ' '.repeat(Math.floor(padding / 2)) + s + ' '.repeat(Math.ceil(padding / 2));
|
|
168
169
|
return s + ' '.repeat(padding);
|
|
169
170
|
}
|
|
170
171
|
|
|
@@ -295,7 +296,9 @@ class SimpleTUI {
|
|
|
295
296
|
// Header
|
|
296
297
|
const title = ' AgileFlow TUI ';
|
|
297
298
|
const headerPadding = Math.floor((width - title.length) / 2);
|
|
298
|
-
output.push(
|
|
299
|
+
output.push(
|
|
300
|
+
`${ANSI.bgCyan}${ANSI.black}${'═'.repeat(headerPadding)}${ANSI.bold}${title}${ANSI.reset}${ANSI.bgCyan}${ANSI.black}${'═'.repeat(width - headerPadding - title.length)}${ANSI.reset}`
|
|
301
|
+
);
|
|
299
302
|
output.push('');
|
|
300
303
|
|
|
301
304
|
// Calculate panel widths
|
|
@@ -312,7 +315,9 @@ class SimpleTUI {
|
|
|
312
315
|
output.push(`${ANSI.cyan}${ANSI.bold}┌─ SESSIONS ─${'─'.repeat(leftWidth - 14)}┐${ANSI.reset}`);
|
|
313
316
|
|
|
314
317
|
if (sessions.length === 0) {
|
|
315
|
-
output.push(
|
|
318
|
+
output.push(
|
|
319
|
+
`${ANSI.cyan}│${ANSI.reset} ${ANSI.dim}No active sessions${ANSI.reset}${' '.repeat(leftWidth - 21)}${ANSI.cyan}│${ANSI.reset}`
|
|
320
|
+
);
|
|
316
321
|
} else {
|
|
317
322
|
for (const session of sessions.slice(0, 5)) {
|
|
318
323
|
const indicator = session.current ? `${ANSI.green}>` : ' ';
|
|
@@ -320,9 +325,15 @@ class SimpleTUI {
|
|
|
320
325
|
const branch = session.branch || 'unknown';
|
|
321
326
|
const story = session.story || 'none';
|
|
322
327
|
|
|
323
|
-
output.push(
|
|
324
|
-
|
|
325
|
-
|
|
328
|
+
output.push(
|
|
329
|
+
`${ANSI.cyan}│${ANSI.reset} ${indicator} ${ANSI.bold}${pad(name, leftWidth - 6)}${ANSI.reset}${ANSI.cyan}│${ANSI.reset}`
|
|
330
|
+
);
|
|
331
|
+
output.push(
|
|
332
|
+
`${ANSI.cyan}│${ANSI.reset} ${ANSI.dim}Branch:${ANSI.reset} ${ANSI.cyan}${pad(branch, leftWidth - 12)}${ANSI.reset}${ANSI.cyan}│${ANSI.reset}`
|
|
333
|
+
);
|
|
334
|
+
output.push(
|
|
335
|
+
`${ANSI.cyan}│${ANSI.reset} ${ANSI.dim}Story:${ANSI.reset} ${ANSI.yellow}${pad(story, leftWidth - 12)}${ANSI.reset}${ANSI.cyan}│${ANSI.reset}`
|
|
336
|
+
);
|
|
326
337
|
}
|
|
327
338
|
}
|
|
328
339
|
|
|
@@ -330,7 +341,9 @@ class SimpleTUI {
|
|
|
330
341
|
const usedRows = sessions.length === 0 ? 1 : Math.min(sessions.length, 5) * 3;
|
|
331
342
|
const remainingRows = Math.max(0, panelHeight - usedRows - 2);
|
|
332
343
|
for (let i = 0; i < remainingRows; i++) {
|
|
333
|
-
output.push(
|
|
344
|
+
output.push(
|
|
345
|
+
`${ANSI.cyan}│${ANSI.reset}${' '.repeat(leftWidth - 2)}${ANSI.cyan}│${ANSI.reset}`
|
|
346
|
+
);
|
|
334
347
|
}
|
|
335
348
|
|
|
336
349
|
output.push(`${ANSI.cyan}└${'─'.repeat(leftWidth - 2)}┘${ANSI.reset}`);
|
|
@@ -338,23 +351,34 @@ class SimpleTUI {
|
|
|
338
351
|
// Move cursor to right panel position and draw
|
|
339
352
|
// For simplicity, we'll draw the right panel below the left panel
|
|
340
353
|
output.push('');
|
|
341
|
-
output.push(
|
|
354
|
+
output.push(
|
|
355
|
+
`${ANSI.green}${ANSI.bold}┌─ AGENT OUTPUT ─${'─'.repeat(width - 19)}┐${ANSI.reset}`
|
|
356
|
+
);
|
|
342
357
|
|
|
343
358
|
if (agentEvents.length === 0 && this.messages.length === 0) {
|
|
344
|
-
output.push(
|
|
359
|
+
output.push(
|
|
360
|
+
`${ANSI.green}│${ANSI.reset} ${ANSI.dim}Waiting for agent activity...${ANSI.reset}${' '.repeat(width - 34)}${ANSI.green}│${ANSI.reset}`
|
|
361
|
+
);
|
|
345
362
|
} else {
|
|
346
363
|
// Show recent events
|
|
347
|
-
const allMessages = [
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
364
|
+
const allMessages = [
|
|
365
|
+
...agentEvents.map(e => ({
|
|
366
|
+
timestamp: e.timestamp ? new Date(e.timestamp).toLocaleTimeString() : '',
|
|
367
|
+
agent: e.agent || 'unknown',
|
|
368
|
+
message:
|
|
369
|
+
e.message ||
|
|
370
|
+
(e.event === 'iteration' ? `Iteration ${e.iter}` : e.event || JSON.stringify(e)),
|
|
371
|
+
})),
|
|
372
|
+
...this.messages,
|
|
373
|
+
].slice(-8);
|
|
352
374
|
|
|
353
375
|
for (const msg of allMessages) {
|
|
354
376
|
const line = `[${msg.timestamp}] [${ANSI.cyan}${msg.agent}${ANSI.reset}] ${msg.message}`;
|
|
355
377
|
const cleanLine = `[${msg.timestamp}] [${msg.agent}] ${msg.message}`;
|
|
356
378
|
const padding = width - cleanLine.length - 4;
|
|
357
|
-
output.push(
|
|
379
|
+
output.push(
|
|
380
|
+
`${ANSI.green}│${ANSI.reset} ${line}${' '.repeat(Math.max(0, padding))}${ANSI.green}│${ANSI.reset}`
|
|
381
|
+
);
|
|
358
382
|
}
|
|
359
383
|
}
|
|
360
384
|
|
|
@@ -363,13 +387,19 @@ class SimpleTUI {
|
|
|
363
387
|
// Loop status (if active)
|
|
364
388
|
if (loopStatus.active) {
|
|
365
389
|
output.push('');
|
|
366
|
-
const statusIcon = loopStatus.paused
|
|
367
|
-
|
|
390
|
+
const statusIcon = loopStatus.paused
|
|
391
|
+
? `${ANSI.yellow}||${ANSI.reset}`
|
|
392
|
+
: `${ANSI.green}>${ANSI.reset}`;
|
|
393
|
+
output.push(
|
|
394
|
+
`${statusIcon} ${ANSI.bold}Loop:${ANSI.reset} ${loopStatus.epic || 'unknown'} | Story: ${loopStatus.currentStory || 'none'} | ${progressBar(loopStatus.iteration, loopStatus.maxIterations, 15)}`
|
|
395
|
+
);
|
|
368
396
|
}
|
|
369
397
|
|
|
370
398
|
// Footer with key bindings
|
|
371
399
|
output.push('');
|
|
372
|
-
output.push(
|
|
400
|
+
output.push(
|
|
401
|
+
`${ANSI.dim}[Q]uit [S]tart [P]ause [R]esume [T]race [1-9]Sessions ${ANSI.reset}${ANSI.cyan}AgileFlow v2.90.0${ANSI.reset}`
|
|
402
|
+
);
|
|
373
403
|
|
|
374
404
|
// Output everything
|
|
375
405
|
process.stdout.write(output.join('\n'));
|