tycono 0.3.14-beta.11 → 0.3.14-beta.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tycono",
3
- "version": "0.3.14-beta.11",
3
+ "version": "0.3.14-beta.13",
4
4
  "description": "Build an AI company. Watch them work.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -383,83 +383,88 @@ const PanelModeInner: React.FC<PanelModeProps> = ({
383
383
 
384
384
  const leftWidth = 28;
385
385
  const termCols = process.stdout.columns || 120;
386
-
387
- // === RADICAL FIX: render entire Panel as ONE pre-formatted Text ===
388
- // yoga-layout OOMs on 245+ column terminals with nested Box layout.
389
- // Solution: build the entire screen as a string, render as single <Text>.
390
-
391
- const buildScreen = (): string => {
392
- const rightWidth = Math.max(40, termCols - leftWidth - 3);
393
- const lines: string[] = [];
394
-
395
- // Header
396
- const waveTitle = `W${focusedWaveIndex} ${focusedWave?.directive?.slice(0, leftWidth - 6) || '(idle)'}`;
397
- const tabBar = ['Stream', 'Docs', 'Info'].map(t =>
398
- t.toLowerCase() === rightTab ? `[${t}]` : ` ${t} `
399
- ).join(' ');
400
- lines.push(`${waveTitle.padEnd(leftWidth)} \u2502 ${tabBar}`);
401
-
402
- // Sessions count
403
- if (waveSessionCount > 0) {
404
- lines.push(`${(waveSessionCount + ' sessions').padEnd(leftWidth)} \u2502`);
405
- }
406
-
407
- // OrgTree (left) + Stream (right) side by side
408
- const ceoIcon = waveScopedStatuses['ceo'] === 'working' ? '\u25CF' : waveScopedStatuses['ceo'] === 'done' ? '\u2713' : '\u25CB';
409
- const treeLines = [`\u2500\u2500 Org Tree \u2500\u2500`, `${ceoIcon} CEO`];
410
- const flatEntries = flattenTreeForText(waveScopedTree);
411
- treeLines.push(...flatEntries);
412
-
413
- // Stream lines (right side)
414
- const streamLines: string[] = [];
415
- if (rightTab === 'stream') {
416
- const maxEv = Math.min(termHeight - 8, 20);
417
- const visible = (selectedRoleId ? events.filter(e => e.roleId === selectedRoleId) : events).slice(-maxEv);
418
- for (const ev of visible) {
419
- const line = eventToOneLiner(ev);
420
- if (line) streamLines.push(line.slice(0, rightWidth));
421
- }
422
- if (streamLines.length === 0) {
423
- streamLines.push(waveId ? 'Waiting for events...' : 'No active stream.');
424
- }
425
- } else if (rightTab === 'info') {
426
- streamLines.push(`Wave: ${focusedWave?.waveId ?? 'none'}`);
427
- streamLines.push(`Directive: ${focusedWave?.directive || '(idle)'}`);
428
- streamLines.push(`Sessions: ${waveSessionCount}`);
429
- streamLines.push(`SSE events: ${events.length}`);
430
- } else {
431
- streamLines.push('(Docs tab — press h/l to switch)');
386
+ const rightWidth = Math.max(40, termCols - leftWidth - 3);
387
+
388
+ // === Build panel as line arrays, render each line as <Text> ===
389
+ // yoga-layout OOMs with nested Box on 245+ columns.
390
+ // Solution: flat list of <Text> elements (1 yoga node per line, no nesting)
391
+
392
+ // Left: OrgTree
393
+ const ceoIcon = waveScopedStatuses['ceo'] === 'working' ? '\u25CF' : waveScopedStatuses['ceo'] === 'done' ? '\u2713' : '\u25CB';
394
+ const treeLines = [`${ceoIcon} CEO`, ...flattenTreeForText(waveScopedTree)];
395
+
396
+ // Right: Stream/Info content
397
+ const rightLines: string[] = [];
398
+ if (rightTab === 'stream') {
399
+ const maxEv = Math.min(termHeight - 8, 20);
400
+ const visible = (selectedRoleId ? events.filter(e => e.roleId === selectedRoleId) : events).slice(-maxEv);
401
+ for (const ev of visible) {
402
+ const line = eventToOneLiner(ev);
403
+ if (line) rightLines.push(line.slice(0, rightWidth));
432
404
  }
405
+ if (rightLines.length === 0) rightLines.push(waveId ? 'Waiting for events...' : 'No active stream.');
406
+ } else if (rightTab === 'info') {
407
+ rightLines.push(`Wave: ${focusedWave?.waveId ?? 'none'}`);
408
+ if (wavePreset) rightLines.push(`Preset: ${wavePreset}`);
409
+ rightLines.push(`Directive: ${focusedWave?.directive?.slice(0, 60) || '(idle)'}`);
410
+ rightLines.push(`Sessions: ${waveSessionCount} Events: ${events.length}`);
411
+ } else {
412
+ rightLines.push('Docs tab (h/l to switch)');
413
+ }
433
414
 
434
- // Merge left + right
435
- const maxLines = Math.max(treeLines.length, streamLines.length);
436
- for (let i = 0; i < maxLines; i++) {
437
- const left = (treeLines[i] ?? '').padEnd(leftWidth);
438
- const right = streamLines[i] ?? '';
439
- lines.push(`${left} \u2502 ${right}`);
440
- }
415
+ // Merge into display lines
416
+ const maxRows = Math.max(treeLines.length, rightLines.length);
417
+ const mergedLines: Array<{ left: string; right: string }> = [];
418
+ for (let i = 0; i < maxRows; i++) {
419
+ mergedLines.push({
420
+ left: (treeLines[i] ?? '').padEnd(leftWidth).slice(0, leftWidth),
421
+ right: (rightLines[i] ?? ''),
422
+ });
423
+ }
441
424
 
442
- // Wave tabs
443
- if (waves.length > 1) {
444
- const waveTabs = waves.map((w, i) =>
445
- w.waveId === focusedWaveId ? `[${i + 1}]` : ` ${i + 1} `
446
- ).join(' ');
447
- lines.push('');
448
- lines.push(waveTabs);
449
- }
425
+ // Tab bar
426
+ const tabLabels = ['Stream', 'Docs', 'Info'];
427
+ const tabBar = tabLabels.map(t => t.toLowerCase() === rightTab ? `[${t}]` : ` ${t} `).join(' ');
450
428
 
451
- return lines.join('\n');
452
- };
429
+ // Wave tabs
430
+ const waveTabs = waves.length > 1
431
+ ? waves.map((w, i) => w.waveId === focusedWaveId ? `[${i + 1}]` : ` ${i + 1} `).join(' ')
432
+ : '';
453
433
 
454
- // Render entire panel as single Text to avoid yoga OOM
455
- const screen = buildScreen();
434
+ // Separator line
435
+ const sep = '\u2500'.repeat(termCols);
456
436
 
457
437
  return (
458
438
  <Box flexDirection="column">
459
- <Text wrap="truncate">{screen}</Text>
460
- <Text color="gray" dimColor>
461
- [h/l] tab [j/k] role {waves.length > 1 ? '[1-9] wave ' : ''}[Esc] command
439
+ {/* Header: wave title │ tabs */}
440
+ <Text>
441
+ <Text color="green" bold>{'W' + focusedWaveIndex}</Text>
442
+ <Text color="white">{' ' + (focusedWave?.directive?.slice(0, 40) || '(idle)')}</Text>
443
+ <Text color="gray">{' \u2502 '}</Text>
444
+ <Text color="cyan" bold>{tabBar}</Text>
445
+ <Text color="gray">{' ' + (waveSessionCount > 0 ? waveSessionCount + ' sessions' : '')}</Text>
462
446
  </Text>
447
+ <Text color="gray">{sep}</Text>
448
+
449
+ {/* Merged: OrgTree (left) │ Stream (right) */}
450
+ {mergedLines.map((line, i) => (
451
+ <Text key={i}>
452
+ <Text color={line.left.includes('\u25CF') ? 'green' : line.left.includes('\u2713') ? 'cyan' : 'white'}>{line.left}</Text>
453
+ <Text color="gray">{' \u2502 '}</Text>
454
+ <Text color="white">{line.right}</Text>
455
+ </Text>
456
+ ))}
457
+
458
+ {/* Separator + wave tabs + footer */}
459
+ <Text color="gray">{sep}</Text>
460
+ {waveTabs ? (
461
+ <Text>
462
+ <Text color="gray">{waveTabs + ' '}</Text>
463
+ <Text color="gray" dimColor>{'[h/l] tab [j/k] role [1-9] wave [Esc] back'}</Text>
464
+ </Text>
465
+ ) : (
466
+ <Text color="gray" dimColor>{'[h/l] tab [j/k] role [Esc] back'}</Text>
467
+ )}
463
468
  </Box>
464
469
  );
465
470
  };