@posthog/wizard 2.37.0 → 2.38.0

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.
Files changed (94) hide show
  1. package/dist/{add-mcp-server-to-clients-CNn9br9l.js → add-mcp-server-to-clients-CeoyDLC-.js} +5 -5
  2. package/dist/{add-mcp-server-to-clients-CNn9br9l.js.map → add-mcp-server-to-clients-CeoyDLC-.js.map} +1 -1
  3. package/dist/{agent-interface-D8jnkEnB.js → agent-interface-BAodys0H.js} +66 -1118
  4. package/dist/agent-interface-BAodys0H.js.map +1 -0
  5. package/dist/{agent-runner-BxIYcxmA.js → agent-runner-BMuJP8fb.js} +2569 -1648
  6. package/dist/agent-runner-BMuJP8fb.js.map +1 -0
  7. package/dist/{analytics-Du8Z_3oX.js → analytics-CvIK_07d.js} +3 -2
  8. package/dist/{analytics-Du8Z_3oX.js.map → analytics-CvIK_07d.js.map} +1 -1
  9. package/dist/{api-BqKMQVhj.js → api-CyA47qug.js} +3 -3
  10. package/dist/{api-BqKMQVhj.js.map → api-CyA47qug.js.map} +1 -1
  11. package/dist/bin.js +64 -50
  12. package/dist/bin.js.map +1 -1
  13. package/dist/{ci-install-UlWb3u5t.js → ci-install-C_o0Q7Fg.js} +4 -4
  14. package/dist/{ci-install-UlWb3u5t.js.map → ci-install-C_o0Q7Fg.js.map} +1 -1
  15. package/dist/{debug-B4AH8Ahp.js → debug-BhGq9rn9.js} +1 -1
  16. package/dist/{debug-CZwmzyDx.js → debug-CgdI7Rd-.js} +55 -3
  17. package/dist/debug-CgdI7Rd-.js.map +1 -0
  18. package/dist/{defaults-UswXMiTx.js → defaults-b2Bo9Wid.js} +1 -1
  19. package/dist/{defaults-UswXMiTx.js.map → defaults-b2Bo9Wid.js.map} +1 -1
  20. package/dist/{env-api-key-Db-mNPK2.js → env-api-key-Bezg_uXQ.js} +1 -1
  21. package/dist/{env-api-key-Db-mNPK2.js.map → env-api-key-Bezg_uXQ.js.map} +1 -1
  22. package/dist/{environment-BRXwshJO.js → environment-v22_Genm.js} +3 -3
  23. package/dist/{environment-BRXwshJO.js.map → environment-v22_Genm.js.map} +1 -1
  24. package/dist/{file-utils-D6CWLaOm.js → file-utils-Gvc2Ysa_.js} +2 -2
  25. package/dist/{file-utils-D6CWLaOm.js.map → file-utils-Gvc2Ysa_.js.map} +1 -1
  26. package/dist/{headless-ui-DvkogF0b.js → headless-ui-BtBcuxOj.js} +2 -2
  27. package/dist/{headless-ui-DvkogF0b.js.map → headless-ui-BtBcuxOj.js.map} +1 -1
  28. package/dist/{host-resolution-DrOzdKdY.js → host-resolution-CUjt6efz.js} +3 -3
  29. package/dist/{host-resolution-DrOzdKdY.js.map → host-resolution-CUjt6efz.js.map} +1 -1
  30. package/dist/{interactive-CXL8oJwb.js → interactive-CRdgBMxk.js} +2 -2
  31. package/dist/{interactive-CXL8oJwb.js.map → interactive-CRdgBMxk.js.map} +1 -1
  32. package/dist/mcp-XWzcKTeK.js +108 -0
  33. package/dist/mcp-XWzcKTeK.js.map +1 -0
  34. package/dist/{mcp-prompt-streaming-Dumivcgi.js → mcp-prompt-streaming-DeC85Icy.js} +5 -5
  35. package/dist/mcp-prompt-streaming-DeC85Icy.js.map +1 -0
  36. package/dist/{non-interactive-BI5b25U7.js → non-interactive-B-Ku4EOx.js} +2 -2
  37. package/dist/{non-interactive-BI5b25U7.js.map → non-interactive-B-Ku4EOx.js.map} +1 -1
  38. package/dist/{package-manager-9nhQBKAy.js → package-manager-Dj6dTKlK.js} +2 -2
  39. package/dist/{package-manager-9nhQBKAy.js.map → package-manager-Dj6dTKlK.js.map} +1 -1
  40. package/dist/{playground-DDYYs2ub.js → playground-CmKFAlCE.js} +783 -7
  41. package/dist/playground-CmKFAlCE.js.map +1 -0
  42. package/dist/{posthog-BrLFkaji.js → posthog-Dnl6wsYc.js} +1 -1
  43. package/dist/{posthog-BrLFkaji.js.map → posthog-Dnl6wsYc.js.map} +1 -1
  44. package/dist/{posthog-integration-Cx4RvC7E.js → posthog-integration-CcJWXPDa.js} +18 -17
  45. package/dist/posthog-integration-CcJWXPDa.js.map +1 -0
  46. package/dist/{provisioning-PosLaOt4.js → provisioning-BIuAPRcH.js} +4 -4
  47. package/dist/{provisioning-PosLaOt4.js.map → provisioning-BIuAPRcH.js.map} +1 -1
  48. package/dist/{registry-B43CNAAx.js → registry-ByrVTIE9.js} +4 -4
  49. package/dist/{registry-B43CNAAx.js.map → registry-ByrVTIE9.js.map} +1 -1
  50. package/dist/security-uSP4HiC0.js +431 -0
  51. package/dist/security-uSP4HiC0.js.map +1 -0
  52. package/dist/{setup-utils-CR8X8Fmf.js → setup-utils-DhmigSLO.js} +192 -20
  53. package/dist/setup-utils-DhmigSLO.js.map +1 -0
  54. package/dist/{start-tui-DeewAqJg.js → start-tui-DKHnPg5a.js} +63 -38
  55. package/dist/start-tui-DKHnPg5a.js.map +1 -0
  56. package/dist/{steps-CPvI-2Ms.js → steps-BBzIrOMY.js} +7 -7
  57. package/dist/{steps-CPvI-2Ms.js.map → steps-BBzIrOMY.js.map} +1 -1
  58. package/dist/{store-0uzey9Am.js → store-BV1a-8Wp.js} +68 -6
  59. package/dist/store-BV1a-8Wp.js.map +1 -0
  60. package/dist/subagent-fP1QmYBX.js +108 -0
  61. package/dist/subagent-fP1QmYBX.js.map +1 -0
  62. package/dist/{task-stream-DkbGqxZv.js → task-stream-C6s7qUCE.js} +3 -3
  63. package/dist/{task-stream-DkbGqxZv.js.map → task-stream-C6s7qUCE.js.map} +1 -1
  64. package/dist/tasks-YFkqfEio.js +112 -0
  65. package/dist/tasks-YFkqfEio.js.map +1 -0
  66. package/dist/{telemetry-DJNpvkYP.js → telemetry-wOdXbZLp.js} +3 -3
  67. package/dist/{telemetry-DJNpvkYP.js.map → telemetry-wOdXbZLp.js.map} +1 -1
  68. package/dist/{terminal-Bd6q58zn.js → terminal-IAHPQoAT.js} +143 -793
  69. package/dist/terminal-IAHPQoAT.js.map +1 -0
  70. package/dist/tools-DdzmiBKF.js +122 -0
  71. package/dist/tools-DdzmiBKF.js.map +1 -0
  72. package/dist/{urls-B1a2v93j.js → urls-BR7jQgQp.js} +2 -2
  73. package/dist/{urls-B1a2v93j.js.map → urls-BR7jQgQp.js.map} +1 -1
  74. package/dist/{wizard-abort-BG8VNOI9.js → wizard-abort-bulz-_og.js} +4 -4
  75. package/dist/{wizard-abort-BG8VNOI9.js.map → wizard-abort-bulz-_og.js.map} +1 -1
  76. package/dist/{wizard-abort-DyAGpw-u.js → wizard-abort-lbH6n2WG.js} +1 -1
  77. package/dist/{wizard-session-xzqycI7i.js → wizard-session-B1ZM4OBv.js} +1 -1
  78. package/dist/{wizard-session-CqihOtk3.js → wizard-session-DWeUEncV.js} +4 -1
  79. package/dist/wizard-session-DWeUEncV.js.map +1 -0
  80. package/dist/wizard-tools-CGrE1O_b.js +1107 -0
  81. package/dist/wizard-tools-CGrE1O_b.js.map +1 -0
  82. package/dist/wizard-ui-WZ48rUgr.js.map +1 -1
  83. package/package.json +7 -2
  84. package/dist/agent-interface-D8jnkEnB.js.map +0 -1
  85. package/dist/agent-runner-BxIYcxmA.js.map +0 -1
  86. package/dist/debug-CZwmzyDx.js.map +0 -1
  87. package/dist/mcp-prompt-streaming-Dumivcgi.js.map +0 -1
  88. package/dist/playground-DDYYs2ub.js.map +0 -1
  89. package/dist/posthog-integration-Cx4RvC7E.js.map +0 -1
  90. package/dist/setup-utils-CR8X8Fmf.js.map +0 -1
  91. package/dist/start-tui-DeewAqJg.js.map +0 -1
  92. package/dist/store-0uzey9Am.js.map +0 -1
  93. package/dist/terminal-Bd6q58zn.js.map +0 -1
  94. package/dist/wizard-session-CqihOtk3.js.map +0 -1
@@ -1,14 +1,14 @@
1
- import { et as VERSION, l as WIZARD_LOG_FILE, y as getBlockingServiceKeys } from "./debug-CZwmzyDx.js";
1
+ import { ft as VERSION, l as WIZARD_LOG_FILE, y as getBlockingServiceKeys } from "./debug-CgdI7Rd-.js";
2
2
  import "./wizard-ui-WZ48rUgr.js";
3
- import "./wizard-session-CqihOtk3.js";
4
- import { m as Icons, p as Colors } from "./posthog-integration-Cx4RvC7E.js";
3
+ import "./wizard-session-DWeUEncV.js";
4
+ import { m as Icons, p as Colors } from "./posthog-integration-CcJWXPDa.js";
5
5
  import { a as ConfirmButton, f as getProgramConfig, t as PickerMenu, u as PROGRAM_REGISTRY, x as getContentBlocks } from "./bin.js";
6
- import { t as WizardStore } from "./store-0uzey9Am.js";
7
- import { A as ConfirmationInput, C as TabContainer, E as LogViewer, F as SplitView, I as CardLayout, N as ProgressList, P as LoadingBox, S as HNViewer, T as EventPlanViewer, _ as ServiceHealthList, b as LearnCard, c as AUDIT_AREA_SLIDES, d as McpSuggestedPromptsScreen, f as TAILORED_ROLES, j as GroupedPickerMenu, k as ModalOverlay, m as IssueTable, n as releaseTerminal, o as OutroScreen, p as McpScreen, r as AiOptInRequiredScreen, s as SlackConnectScreen, t as enterDarkTerminal, u as AuditChecksViewer, v as VisualizerTab, w as ScreenContainer, x as ContentSequencer, y as TipsCard } from "./terminal-Bd6q58zn.js";
6
+ import { t as WizardStore } from "./store-BV1a-8Wp.js";
7
+ import { A as ConfirmationInput, C as TabContainer, E as LogViewer, F as SplitView, I as CardLayout, N as ProgressList, P as LoadingBox, S as HNViewer, T as EventPlanViewer, b as LearnCard, c as SlackConnectScreen, d as AuditChecksViewer, f as McpSuggestedPromptsScreen, h as IssueTable, j as GroupedPickerMenu, k as ModalOverlay, l as AUDIT_AREA_SLIDES, m as McpScreen, n as releaseTerminal, o as OutroScreen, p as TAILORED_ROLES, r as AiOptInRequiredScreen, t as enterDarkTerminal, v as ServiceHealthList, w as ScreenContainer, x as ContentSequencer, y as TipsCard } from "./terminal-IAHPQoAT.js";
8
8
  import * as fs$1 from "fs";
9
9
  import * as path$1 from "path";
10
10
  import * as os from "os";
11
- import { Box, Text, render, useInput } from "ink";
11
+ import { Box, Text, measureElement, render, useInput } from "ink";
12
12
  import { createElement, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  //#region src/ui/tui/playground/demos/WelcomeDemo.tsx
@@ -422,6 +422,782 @@ const LogDemo = () => {
422
422
  });
423
423
  };
424
424
  //#endregion
425
+ //#region src/ui/tui/hooks/useTick.ts
426
+ /**
427
+ * useTick — forces a re-render every `intervalMs`. Returns a monotonically
428
+ * increasing counter, which is rarely needed — most callers just want the
429
+ * re-render side effect.
430
+ */
431
+ function useTick(intervalMs) {
432
+ const [tick, setTick] = useState(0);
433
+ useEffect(() => {
434
+ const id = setInterval(() => setTick((t) => t + 1), intervalMs);
435
+ return () => clearInterval(id);
436
+ }, [intervalMs]);
437
+ return tick;
438
+ }
439
+ //#endregion
440
+ //#region src/ui/tui/components/visualizer/palette.ts
441
+ const VISUALIZER_PALETTE = {
442
+ fade: "#0E7A0E",
443
+ bright: "#7CFF7C",
444
+ mid: "#22D622",
445
+ head: "#E6FFE6",
446
+ book: [
447
+ "#22D622",
448
+ "#7CFF7C",
449
+ "#5BE05B",
450
+ "#A0F0A0",
451
+ "#36B536"
452
+ ],
453
+ deleteRed: "#D63B22",
454
+ upGreen: "#7CFF7C"
455
+ };
456
+ //#endregion
457
+ //#region src/ui/tui/components/visualizer/panel.tsx
458
+ /**
459
+ * Shared scaffolding for the phase visuals — Matrix-green color, common
460
+ * VisualProps shape, and the rounded `Panel` shell every visual sits in.
461
+ *
462
+ * Visuals each render their own grid then wrap it in `<Panel>` so phase
463
+ * transitions stay visually continuous.
464
+ */
465
+ const MATRIX_FADE = VISUALIZER_PALETTE.fade;
466
+ const Panel = ({ children }) => /* @__PURE__ */ jsx(Box, {
467
+ flexDirection: "column",
468
+ borderStyle: "round",
469
+ borderColor: MATRIX_FADE,
470
+ children
471
+ });
472
+ //#endregion
473
+ //#region src/ui/tui/components/visualizer/MatrixRain.tsx
474
+ /**
475
+ * MatrixRain — code-rain visual used for the codebase-scan phase.
476
+ *
477
+ * Independent of the phase orchestrator so it can be reused elsewhere
478
+ * (e.g. standalone in a demo). `bordered` toggles the rounded green frame.
479
+ */
480
+ const { head: MATRIX_HEAD, bright: MATRIX_BRIGHT, mid: MATRIX_MID } = VISUALIZER_PALETTE;
481
+ const DEFAULT_TICK_MS = 110;
482
+ const DEFAULT_MAX_TAIL = 7;
483
+ const RAIN_GLYPHS = "ヲァィゥェォャュョッアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン0123456789Z<>=*+:.";
484
+ function pickGlyph() {
485
+ return RAIN_GLYPHS[Math.floor(Math.random() * 73)];
486
+ }
487
+ function makeRainColumn(height, maxTail) {
488
+ return {
489
+ headY: -Math.random() * height,
490
+ speed: .3 + Math.random() * .9,
491
+ tail: 3 + Math.floor(Math.random() * (maxTail - 2)),
492
+ glyphs: /* @__PURE__ */ new Map(),
493
+ dormant: Math.floor(Math.random() * 18)
494
+ };
495
+ }
496
+ function tickRainColumn(col, height, maxTail) {
497
+ if (col.dormant > 0) return {
498
+ ...col,
499
+ dormant: col.dormant - 1
500
+ };
501
+ const next = col.headY + col.speed;
502
+ if (next > height + col.tail) return makeRainColumn(height, maxTail);
503
+ const glyphs = new Map(col.glyphs);
504
+ for (let y = Math.max(0, Math.ceil(col.headY)); y <= Math.min(Math.floor(next), height - 1); y++) glyphs.set(y, pickGlyph());
505
+ if (glyphs.size > 0 && Math.random() < .22) {
506
+ const keys = [...glyphs.keys()];
507
+ const k = keys[Math.floor(Math.random() * keys.length)];
508
+ glyphs.set(k, pickGlyph());
509
+ }
510
+ return {
511
+ ...col,
512
+ headY: next,
513
+ glyphs
514
+ };
515
+ }
516
+ const MatrixRain = ({ width, height, tickMs = DEFAULT_TICK_MS, maxTail = DEFAULT_MAX_TAIL, bordered = true }) => {
517
+ const columnsRef = useRef(Array.from({ length: width }, () => makeRainColumn(height, maxTail)));
518
+ const [, setTick] = useState(0);
519
+ useEffect(() => {
520
+ const interval = setInterval(() => {
521
+ columnsRef.current = columnsRef.current.map((c) => tickRainColumn(c, height, maxTail));
522
+ setTick((t) => t + 1);
523
+ }, tickMs);
524
+ return () => clearInterval(interval);
525
+ }, [
526
+ height,
527
+ maxTail,
528
+ tickMs
529
+ ]);
530
+ const columns = columnsRef.current;
531
+ const body = Array.from({ length: height }).map((_, y) => /* @__PURE__ */ jsx(Box, { children: columns.map((col, x) => {
532
+ const glyph = col.glyphs.get(y);
533
+ if (!glyph) return /* @__PURE__ */ jsx(Text, { children: " " }, x);
534
+ const dist = col.headY - y;
535
+ if (dist < 0 || dist > col.tail) return /* @__PURE__ */ jsx(Text, { children: " " }, x);
536
+ if (dist < 1) return /* @__PURE__ */ jsx(Text, {
537
+ bold: true,
538
+ color: MATRIX_HEAD,
539
+ children: glyph
540
+ }, x);
541
+ if (dist < 2) return /* @__PURE__ */ jsx(Text, {
542
+ color: MATRIX_BRIGHT,
543
+ children: glyph
544
+ }, x);
545
+ if (dist < col.tail * .55) return /* @__PURE__ */ jsx(Text, {
546
+ color: MATRIX_MID,
547
+ children: glyph
548
+ }, x);
549
+ return /* @__PURE__ */ jsx(Text, {
550
+ color: MATRIX_FADE,
551
+ dimColor: true,
552
+ children: glyph
553
+ }, x);
554
+ }) }, y));
555
+ if (!bordered) return /* @__PURE__ */ jsx(Box, {
556
+ flexDirection: "column",
557
+ children: body
558
+ });
559
+ return /* @__PURE__ */ jsx(Box, {
560
+ flexDirection: "column",
561
+ borderStyle: "round",
562
+ borderColor: MATRIX_FADE,
563
+ children: body
564
+ });
565
+ };
566
+ //#endregion
567
+ //#region src/ui/tui/components/visualizer/LibraryShelf.tsx
568
+ /**
569
+ * LibraryShelf — skill-selection phase.
570
+ *
571
+ * A row of book spines. One spine peels forward each cycle, the chosen
572
+ * title hovers next to it, then it slides home and the next one is picked.
573
+ */
574
+ const BOOK_LABELS = [
575
+ "nx",
576
+ "rt",
577
+ "sv",
578
+ "fl",
579
+ "jg",
580
+ "rb",
581
+ "go",
582
+ "dj",
583
+ "fa",
584
+ "lv",
585
+ "ts",
586
+ "py"
587
+ ];
588
+ const BOOK_COLORS = VISUALIZER_PALETTE.book;
589
+ const LibraryShelf = ({ width, height }) => {
590
+ const tick = useTick(380);
591
+ const bookCount = Math.min(Math.floor((width - 2) / 2), BOOK_LABELS.length);
592
+ const cyclePos = tick % (bookCount * 4);
593
+ const selectedIdx = Math.floor(cyclePos / 4);
594
+ const phase = cyclePos % 4;
595
+ const offset = phase === 0 ? 0 : phase === 1 ? 1 : phase === 2 ? 2 : 1;
596
+ const wobble = phase === 2 && tick % 2 === 0 ? 1 : 0;
597
+ const shelfY = Math.floor(height / 2) - 1;
598
+ const rows = Array.from({ length: height }, () => new Array(width).fill(" "));
599
+ for (let i = 0; i < bookCount; i++) {
600
+ const x = 1 + i * 2;
601
+ const isSelected = i === selectedIdx;
602
+ const shift = isSelected ? offset : 0;
603
+ const wob = isSelected && wobble ? -1 : 0;
604
+ if (x + shift >= width) continue;
605
+ rows[shelfY - 1][x + shift] = "█";
606
+ rows[shelfY][x + shift] = BOOK_LABELS[i][0];
607
+ rows[shelfY + 1][x + shift] = BOOK_LABELS[i][1];
608
+ rows[shelfY + 2 + wob]?.[x + shift] !== void 0 && (rows[shelfY + 2 + wob][x + shift] = "█");
609
+ }
610
+ const boardY = shelfY + 3;
611
+ if (boardY < height) for (let x = 0; x < width; x++) rows[boardY][x] = "─";
612
+ if (phase === 2) {
613
+ const labelStartX = 1 + selectedIdx * 2 + 4;
614
+ const labelText = BOOK_LABELS[selectedIdx] + "-app";
615
+ for (let c = 0; c < labelText.length && labelStartX + c < width; c++) rows[shelfY][labelStartX + c] = labelText[c];
616
+ if (labelStartX - 1 < width && labelStartX - 1 >= 0) rows[shelfY][labelStartX - 1] = "▶";
617
+ }
618
+ return /* @__PURE__ */ jsx(Panel, { children: rows.map((row, y) => /* @__PURE__ */ jsx(Box, { children: row.map((ch, x) => {
619
+ if (ch === " ") return /* @__PURE__ */ jsx(Text, { children: " " }, x);
620
+ if (ch === "─") return /* @__PURE__ */ jsx(Text, {
621
+ color: MATRIX_FADE,
622
+ dimColor: true,
623
+ children: "─"
624
+ }, x);
625
+ if (ch === "▶") return /* @__PURE__ */ jsx(Text, {
626
+ bold: true,
627
+ color: VISUALIZER_PALETTE.head,
628
+ children: "▶"
629
+ }, x);
630
+ const booksColor = BOOK_COLORS[(Math.floor((x - 1) / 2) + 17 * y) % BOOK_COLORS.length];
631
+ const isSel = x === 1 + selectedIdx * 2 + offset;
632
+ return /* @__PURE__ */ jsx(Text, {
633
+ bold: isSel,
634
+ color: isSel ? VISUALIZER_PALETTE.head : booksColor,
635
+ children: ch
636
+ }, x);
637
+ }) }, y)) });
638
+ };
639
+ //#endregion
640
+ //#region src/ui/tui/components/visualizer/CrateStack.tsx
641
+ /**
642
+ * CrateStack — dependency-install phase.
643
+ *
644
+ * Boxes drop from the top and stack at the bottom. Each new arrival lands
645
+ * with a tiny shake.
646
+ */
647
+ const PACKAGE_NAMES = [
648
+ "posthog-js",
649
+ "posthog-py",
650
+ "posthog-rb",
651
+ "posthog-go",
652
+ "posthog-node",
653
+ "react-ph",
654
+ "next-ph",
655
+ "svelte-ph",
656
+ "ph-mcp",
657
+ "ph-ai"
658
+ ];
659
+ const CRATE_W = Math.max(...PACKAGE_NAMES.map((n) => n.length)) + 2;
660
+ const CrateStack = ({ width, height }) => {
661
+ const tick = useTick(95);
662
+ const state = useRef({
663
+ stack: [],
664
+ falling: null,
665
+ spawnCooldown: 0
666
+ }).current;
667
+ const crateW = CRATE_W;
668
+ const crateH = 1;
669
+ const floorY = height - 1;
670
+ if (state.falling) {
671
+ state.falling.y += 1;
672
+ const collisionStackHeight = state.stack.filter((c) => Math.abs(c.x - state.falling.x) < crateW - 1).length * crateH;
673
+ if (state.falling.y >= floorY - collisionStackHeight) {
674
+ state.stack.push({
675
+ label: state.falling.label,
676
+ x: state.falling.x,
677
+ landedAt: tick
678
+ });
679
+ state.falling = null;
680
+ state.spawnCooldown = 3;
681
+ }
682
+ } else if (state.spawnCooldown > 0) state.spawnCooldown -= 1;
683
+ else if (state.stack.length < Math.floor(height / crateH) - 1) state.falling = {
684
+ label: PACKAGE_NAMES[Math.floor(Math.random() * PACKAGE_NAMES.length)],
685
+ x: 2 + Math.floor(Math.random() * Math.max(1, width - crateW - 4)),
686
+ y: -1
687
+ };
688
+ else if (tick % 20 === 0) state.stack = [];
689
+ const grid = Array.from({ length: height }, () => new Array(width).fill(" "));
690
+ const drawCrate = (cx, cy, label, shake) => {
691
+ const x = cx + shake;
692
+ if (cy < 0 || cy >= height) return;
693
+ const padded = `[${label.slice(0, crateW - 2)}]`.padEnd(crateW, " ");
694
+ for (let i = 0; i < crateW && x + i < width; i++) if (x + i >= 0) grid[cy][x + i] = padded[i];
695
+ };
696
+ state.stack.forEach((c, idx) => {
697
+ const cy = floorY - idx;
698
+ const shake = tick - c.landedAt === 0 ? 1 : tick - c.landedAt === 1 ? -1 : 0;
699
+ drawCrate(c.x, cy, c.label, shake);
700
+ });
701
+ if (state.falling) drawCrate(state.falling.x, state.falling.y, state.falling.label, 0);
702
+ return /* @__PURE__ */ jsx(Panel, { children: grid.map((row, y) => /* @__PURE__ */ jsx(Box, { children: row.map((ch, x) => {
703
+ if (ch === " ") return /* @__PURE__ */ jsx(Text, { children: " " }, x);
704
+ const isFalling = state.falling && y === state.falling.y && Math.abs(x - state.falling.x) < crateW;
705
+ return /* @__PURE__ */ jsx(Text, {
706
+ bold: isFalling,
707
+ color: isFalling ? VISUALIZER_PALETTE.head : VISUALIZER_PALETTE.mid,
708
+ children: ch
709
+ }, x);
710
+ }) }, y)) });
711
+ };
712
+ //#endregion
713
+ //#region src/ui/tui/components/visualizer/DiffCascade.tsx
714
+ /**
715
+ * DiffCascade — code-edits phase.
716
+ *
717
+ * + and - code lines scroll upward continuously. Occasional comment-rewrite
718
+ * gag: a "// hmm…" line appears, gets - struck out, then a + replaces it.
719
+ */
720
+ const CODE_SNIPPETS = [
721
+ "import posthog from 'posthog-js'",
722
+ "posthog.init(KEY, { host: HOST })",
723
+ "<PostHogProvider client={posthog}>",
724
+ " {children}",
725
+ "</PostHogProvider>",
726
+ "posthog.capture('page_viewed')",
727
+ "posthog.capture('signup_started')",
728
+ "posthog.identify(user.id, { email })",
729
+ "if (process.env.NODE_ENV !== 'test') posthog.init(KEY)",
730
+ "export const posthog = new PostHog(KEY)",
731
+ "// TODO: enable replay",
732
+ "window.posthog = posthog"
733
+ ];
734
+ const WHIMSY_COMMENTS = [
735
+ "// hmm — that should be a hook",
736
+ "// wait, refactor incoming",
737
+ "// posthog says hi"
738
+ ];
739
+ const DiffCascade = ({ width, height }) => {
740
+ const tick = useTick(280);
741
+ const linesRef = useRef([]);
742
+ if (linesRef.current.length === 0) for (let i = 0; i < height; i++) linesRef.current.push({
743
+ sign: Math.random() < .75 ? "+" : "-",
744
+ text: CODE_SNIPPETS[Math.floor(Math.random() * CODE_SNIPPETS.length)]
745
+ });
746
+ linesRef.current.shift();
747
+ const whimsy = tick % 23 === 0;
748
+ linesRef.current.push({
749
+ sign: whimsy ? "-" : Math.random() < .78 ? "+" : "-",
750
+ text: whimsy ? WHIMSY_COMMENTS[Math.floor(Math.random() * WHIMSY_COMMENTS.length)] : CODE_SNIPPETS[Math.floor(Math.random() * CODE_SNIPPETS.length)]
751
+ });
752
+ const lines = linesRef.current;
753
+ return /* @__PURE__ */ jsx(Panel, { children: Array.from({ length: height }).map((_, y) => {
754
+ const line = lines[y];
755
+ const cap = width - 2;
756
+ const text = `${line.sign} ${line.text}`.slice(0, cap);
757
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, {
758
+ color: line.sign === "+" ? VISUALIZER_PALETTE.mid : line.sign === "-" ? VISUALIZER_PALETTE.deleteRed : MATRIX_FADE,
759
+ children: text.padEnd(cap, " ")
760
+ }) }, y);
761
+ }) });
762
+ };
763
+ //#endregion
764
+ //#region src/ui/tui/components/visualizer/Tumblers.tsx
765
+ /**
766
+ * Tumblers — env-setup phase.
767
+ *
768
+ * Pins fall into a lock cylinder one by one; when all six align the bolt
769
+ * pulses green for a beat, then the cycle restarts.
770
+ */
771
+ const Tumblers = ({ width, height }) => {
772
+ const tick = useTick(80);
773
+ const pinCount = Math.min(Math.floor((width - 2) / 2), 6);
774
+ const state = useRef({
775
+ heights: new Array(pinCount).fill(0),
776
+ current: 0,
777
+ fallY: 0,
778
+ pulse: 0
779
+ }).current;
780
+ const cylinderTop = 1;
781
+ const cylinderBottom = height - 2;
782
+ const targetForPin = (i) => cylinderBottom - 1 - i % 3 - Math.floor(i / 2);
783
+ if (state.pulse > 0) {
784
+ state.pulse -= 1;
785
+ if (state.pulse === 0) {
786
+ state.heights = new Array(pinCount).fill(0);
787
+ state.current = 0;
788
+ state.fallY = 0;
789
+ }
790
+ } else if (state.current < pinCount) {
791
+ state.fallY += 1;
792
+ if (state.fallY >= targetForPin(state.current)) {
793
+ state.heights[state.current] = targetForPin(state.current);
794
+ state.current += 1;
795
+ state.fallY = cylinderTop;
796
+ }
797
+ } else state.pulse = 14;
798
+ const grid = Array.from({ length: height }, () => new Array(width).fill(" "));
799
+ for (let y = 0; y < height; y++) {
800
+ grid[y][0] = "│";
801
+ grid[y][width - 1] = "│";
802
+ }
803
+ for (let i = 0; i < pinCount; i++) {
804
+ const x = 1 + i * 2 + 1;
805
+ if (x < width) grid[0][x] = "▼";
806
+ }
807
+ for (let x = 1; x < width - 1; x++) grid[height - 1][x] = "─";
808
+ for (let i = 0; i < pinCount; i++) {
809
+ const pinX = 1 + i * 2 + 1;
810
+ if (pinX >= width) continue;
811
+ const top = state.heights[i] || cylinderTop;
812
+ for (let y = top; y <= cylinderBottom; y++) grid[y][pinX] = "█";
813
+ }
814
+ if (state.pulse === 0 && state.current < pinCount) {
815
+ const pinX = 1 + state.current * 2 + 1;
816
+ if (pinX < width) grid[state.fallY][pinX] = "█";
817
+ }
818
+ const pulsing = state.pulse > 0;
819
+ const pulseBright = pulsing && tick % 2 === 0;
820
+ return /* @__PURE__ */ jsx(Panel, { children: grid.map((row, y) => /* @__PURE__ */ jsx(Box, { children: row.map((ch, x) => {
821
+ if (ch === " ") return /* @__PURE__ */ jsx(Text, { children: " " }, x);
822
+ if (ch === "│" || ch === "─" || ch === "▼") return /* @__PURE__ */ jsx(Text, {
823
+ color: pulsing ? pulseBright ? VISUALIZER_PALETTE.bright : MATRIX_FADE : MATRIX_FADE,
824
+ dimColor: !pulsing,
825
+ children: ch
826
+ }, x);
827
+ const isFalling = state.pulse === 0 && state.current < pinCount && y === state.fallY && x === 1 + state.current * 2 + 1;
828
+ const color = pulsing ? pulseBright ? VISUALIZER_PALETTE.head : VISUALIZER_PALETTE.bright : isFalling ? VISUALIZER_PALETTE.head : VISUALIZER_PALETTE.mid;
829
+ return /* @__PURE__ */ jsx(Text, {
830
+ bold: pulsing || isFalling,
831
+ color,
832
+ children: ch
833
+ }, x);
834
+ }) }, y)) });
835
+ };
836
+ //#endregion
837
+ //#region src/ui/tui/components/visualizer/DashboardGrid.tsx
838
+ /**
839
+ * DashboardGrid — dashboards phase.
840
+ *
841
+ * 2×2 grid of mini-charts to evoke a real PostHog dashboard. When the area
842
+ * is too small, the layout collapses to 1×2 or 1×1 so something always
843
+ * renders.
844
+ */
845
+ const DASHBOARD_TILES = [
846
+ {
847
+ title: "Visitors",
848
+ kind: "bars"
849
+ },
850
+ {
851
+ title: "Sessions",
852
+ kind: "line"
853
+ },
854
+ {
855
+ title: "Revenue",
856
+ kind: "gauge"
857
+ },
858
+ {
859
+ title: "Errors",
860
+ kind: "pulse"
861
+ }
862
+ ];
863
+ const SPARK_GLYPHS = "▁▂▃▄▅▆▇█";
864
+ const DashboardGrid = ({ width, height }) => {
865
+ const tick = useTick(220);
866
+ const grid = Array.from({ length: height }, () => new Array(width).fill(" "));
867
+ const cols = width >= 22 ? 2 : 1;
868
+ const rows = height >= 7 ? 2 : 1;
869
+ const vSplit = cols === 2 ? Math.floor(width / 2) : -1;
870
+ const hSplit = rows === 2 ? Math.floor(height / 2) : -1;
871
+ if (vSplit >= 0) for (let y = 0; y < height; y++) grid[y][vSplit] = "│";
872
+ if (hSplit >= 0) {
873
+ for (let x = 0; x < width; x++) grid[hSplit][x] = "─";
874
+ if (vSplit >= 0) grid[hSplit][vSplit] = "┼";
875
+ }
876
+ const writeText = (x0, y0, maxW, text) => {
877
+ if (y0 < 0 || y0 >= height) return;
878
+ const slice = text.slice(0, Math.max(0, maxW));
879
+ for (let i = 0; i < slice.length; i++) if (x0 + i >= 0 && x0 + i < width) grid[y0][x0 + i] = slice[i];
880
+ };
881
+ for (let r = 0; r < rows; r++) for (let c = 0; c < cols; c++) {
882
+ const tile = DASHBOARD_TILES[r * cols + c];
883
+ const tileX = c === 0 ? 0 : vSplit + 1;
884
+ const tileY = r === 0 ? 0 : hSplit + 1;
885
+ const tileW = cols === 2 ? c === 0 ? vSplit : width - vSplit - 1 : width;
886
+ const tileH = rows === 2 ? r === 0 ? hSplit : height - hSplit - 1 : height;
887
+ const innerX = tileX;
888
+ const innerW = Math.max(1, tileW);
889
+ const titleY = tileY;
890
+ const valueY = tileY + tileH - 1;
891
+ const chartY0 = tileY + 1;
892
+ const chartY1 = Math.max(chartY0, valueY - 1);
893
+ const chartH = Math.max(1, chartY1 - chartY0 + 1);
894
+ const seed = (r * cols + c) * 13;
895
+ writeText(innerX, titleY, innerW, tile.title);
896
+ renderTile(grid, tile.kind, innerX, chartY0, innerW, chartH, tick, seed, width);
897
+ writeText(innerX, valueY, innerW, tileValue(tile.kind, tick, seed));
898
+ }
899
+ return /* @__PURE__ */ jsx(Panel, { children: grid.map((row, y) => /* @__PURE__ */ jsx(Box, { children: row.map((ch, x) => {
900
+ if (ch === " ") return /* @__PURE__ */ jsx(Text, { children: " " }, x);
901
+ if (ch === "│" || ch === "─" || ch === "┼") return /* @__PURE__ */ jsx(Text, {
902
+ color: MATRIX_FADE,
903
+ dimColor: true,
904
+ children: ch
905
+ }, x);
906
+ if (SPARK_GLYPHS.includes(ch) || ch === "█") return /* @__PURE__ */ jsx(Text, {
907
+ color: VISUALIZER_PALETTE.mid,
908
+ children: ch
909
+ }, x);
910
+ if (ch === "●" || ch === "∙" || ch === "·") {
911
+ const color = ch === "●" ? VISUALIZER_PALETTE.head : ch === "∙" ? VISUALIZER_PALETTE.bright : VISUALIZER_PALETTE.mid;
912
+ return /* @__PURE__ */ jsx(Text, {
913
+ bold: ch === "●",
914
+ color,
915
+ children: ch
916
+ }, x);
917
+ }
918
+ if (ch === "▲" || ch === "▼") return /* @__PURE__ */ jsx(Text, {
919
+ bold: true,
920
+ color: ch === "▲" ? VISUALIZER_PALETTE.upGreen : VISUALIZER_PALETTE.deleteRed,
921
+ children: ch
922
+ }, x);
923
+ return /* @__PURE__ */ jsx(Text, {
924
+ color: VISUALIZER_PALETTE.bright,
925
+ children: ch
926
+ }, x);
927
+ }) }, y)) });
928
+ };
929
+ function renderTile(grid, kind, x0, y0, w, h, tick, seed, gridW) {
930
+ const set = (x, y, ch) => {
931
+ if (y < 0 || y >= grid.length) return;
932
+ if (x < 0 || x >= gridW) return;
933
+ grid[y][x] = ch;
934
+ };
935
+ if (kind === "bars") for (let i = 0; i < w; i++) {
936
+ const t = tick * .18 + (i + seed) * .6;
937
+ const level = .55 + .35 * Math.sin(t) + .1 * Math.sin(t * 2.7);
938
+ const filled = Math.max(0, Math.min(h, Math.round(level * h)));
939
+ for (let j = 0; j < filled; j++) set(x0 + i, y0 + h - 1 - j, "█");
940
+ if (filled > 0 && filled < h) {
941
+ const frac = level * h - Math.floor(level * h);
942
+ const glyph = SPARK_GLYPHS[Math.floor(frac * 7)];
943
+ set(x0 + i, y0 + h - filled, glyph);
944
+ }
945
+ }
946
+ else if (kind === "line") {
947
+ const spikeAt = ((tick / 12 | 0) + seed) % Math.max(1, w);
948
+ for (let i = 0; i < w; i++) {
949
+ const norm = i / Math.max(1, w - 1);
950
+ const base = h - 1 - norm * (h - 1);
951
+ let yf = base + .6 * Math.sin(i * .7 + seed + tick * .05);
952
+ if (i === spikeAt) yf = Math.max(0, base - 1.5);
953
+ const y = Math.max(0, Math.min(h - 1, Math.round(yf)));
954
+ const dist = Math.abs(i - (w - 1));
955
+ const ch = dist === 0 ? "●" : dist < 3 ? "∙" : "·";
956
+ set(x0 + i, y0 + y, ch);
957
+ }
958
+ } else if (kind === "gauge") {
959
+ const cycle = (tick + seed) % 40;
960
+ const pct = cycle < 30 ? cycle / 30 : 1 - (cycle - 30) / 10;
961
+ const midY = y0 + Math.floor(h / 2);
962
+ const filled = Math.max(0, Math.min(w, Math.round(pct * w)));
963
+ for (let i = 0; i < w; i++) set(x0 + i, midY, i < filled ? "█" : "·");
964
+ } else if (kind === "pulse") for (let i = 0; i < w; i++) {
965
+ const t = (i + seed + Math.floor(tick / 3)) % 17;
966
+ let level;
967
+ if (t === 0) level = .9;
968
+ else if (t === 1 || t === 16) level = .5;
969
+ else level = .12 + .06 * Math.sin((i + tick) * .5);
970
+ const filled = Math.max(1, Math.min(h, Math.round(level * h)));
971
+ for (let j = 0; j < filled; j++) set(x0 + i, y0 + h - 1 - j, "█");
972
+ }
973
+ }
974
+ function tileValue(kind, tick, seed) {
975
+ const wave = .5 + .5 * Math.sin(tick * .05 + seed);
976
+ if (kind === "bars") return `${(Math.round(8e3 + wave * 6e3) / 1e3).toFixed(1)}k ▲`;
977
+ if (kind === "line") return `${(2 + wave * 4).toFixed(1)}% ▲`;
978
+ if (kind === "gauge") return `$${Math.round(20 + wave * 60)}k`;
979
+ return `${Math.round(1 + wave * 5)} ▼`;
980
+ }
981
+ //#endregion
982
+ //#region src/ui/tui/components/PhaseVisuals.tsx
983
+ /**
984
+ * Phase visuals — ambient ASCII visualizations of what the agent is currently
985
+ * doing. The active phase is derived from the in-progress task labels (best-
986
+ * effort heuristic). Each phase has its own component (under ./visualizer);
987
+ * the orchestrator `PhaseVisual` picks which one to render.
988
+ *
989
+ * Width and height are passed in from the parent so visuals adapt to the
990
+ * column they're placed in.
991
+ */
992
+ const PHASE_LABELS = {
993
+ ["codebase-scan"]: "Reading the Code",
994
+ ["skill-install"]: "Picking the Right Skill",
995
+ ["dep-install"]: "Installing Packages",
996
+ ["code-edits"]: "Editing Source",
997
+ ["env-setup"]: "Wiring Up Secrets",
998
+ ["dashboards"]: "Building Dashboards"
999
+ };
1000
+ /** Reads the active phase from the store. The agent loop pushes it in via
1001
+ * `getUI().setStage(...)` whenever a new tool fires. */
1002
+ function useAgentPhase(store) {
1003
+ useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
1004
+ return store.currentStage?.stage ?? "codebase-scan";
1005
+ }
1006
+ /**
1007
+ * VisualizerTab — Winamp-style fullscreen take on the phase visual.
1008
+ * "NOW PLAYING" header, centered visual, transport bar with elapsed time.
1009
+ *
1010
+ * Sizes itself off the *measured* container rather than the raw terminal so
1011
+ * the tab bar / hints / status panel above don't get pushed off-screen on
1012
+ * short terminals. When height runs out, chrome rows drop in order:
1013
+ * transport bar first, then track title, then the NOW PLAYING header.
1014
+ */
1015
+ const VisualizerTab = ({ store }) => {
1016
+ const phase = useAgentPhase(store);
1017
+ const containerRef = useRef(null);
1018
+ const [size, setSize] = useState({
1019
+ width: 0,
1020
+ height: 0
1021
+ });
1022
+ useEffect(() => {
1023
+ if (!containerRef.current) return;
1024
+ const m = measureElement(containerRef.current);
1025
+ if (m.width !== size.width || m.height !== size.height) setSize({
1026
+ width: m.width,
1027
+ height: m.height
1028
+ });
1029
+ }, [
1030
+ useTick(EQ_TICK_MS),
1031
+ size.width,
1032
+ size.height
1033
+ ]);
1034
+ const HEADER_ROWS = 2;
1035
+ const TITLE_ROWS = 2;
1036
+ const TRANSPORT_ROWS = 2;
1037
+ const BORDER_ROWS = 2;
1038
+ const MIN_VISUAL_H = 5;
1039
+ const availH = size.height;
1040
+ const availW = size.width;
1041
+ let chromeBudget = BORDER_ROWS + HEADER_ROWS + TITLE_ROWS + TRANSPORT_ROWS;
1042
+ let showHeader = true;
1043
+ let showTitle = true;
1044
+ let showTransport = true;
1045
+ if (availH > 0 && availH - chromeBudget < MIN_VISUAL_H) {
1046
+ showTransport = false;
1047
+ chromeBudget -= TRANSPORT_ROWS;
1048
+ }
1049
+ if (availH > 0 && availH - chromeBudget < MIN_VISUAL_H) {
1050
+ showTitle = false;
1051
+ chromeBudget -= TITLE_ROWS;
1052
+ }
1053
+ if (availH > 0 && availH - chromeBudget < MIN_VISUAL_H) {
1054
+ showHeader = false;
1055
+ chromeBudget -= HEADER_ROWS;
1056
+ }
1057
+ const visualH = availH > 0 ? Math.max(MIN_VISUAL_H, Math.min(18, availH - chromeBudget)) : MIN_VISUAL_H;
1058
+ const visualW = availW > 0 ? Math.max(20, Math.min(64, availW - 12)) : 40;
1059
+ const now = Date.now();
1060
+ const beatTimeMs = now - (store.currentStage?.startedAt ?? now);
1061
+ const timeStr = formatElapsed(Math.max(0, Math.floor(beatTimeMs / 1e3)));
1062
+ const equalizer = renderMiniEqualizer(beatTimeMs, useRef(new Array(EQ_BARS).fill(0)).current);
1063
+ return /* @__PURE__ */ jsxs(Box, {
1064
+ ref: containerRef,
1065
+ flexDirection: "column",
1066
+ flexGrow: 1,
1067
+ alignItems: "center",
1068
+ justifyContent: "center",
1069
+ overflow: "hidden",
1070
+ children: [
1071
+ showHeader && /* @__PURE__ */ jsxs(Box, {
1072
+ flexDirection: "row",
1073
+ marginBottom: 1,
1074
+ children: [
1075
+ /* @__PURE__ */ jsx(Text, {
1076
+ color: MATRIX_FADE,
1077
+ children: "┌─"
1078
+ }),
1079
+ /* @__PURE__ */ jsx(Text, {
1080
+ bold: true,
1081
+ color: VISUALIZER_PALETTE.bright,
1082
+ children: " ► NOW PLAYING "
1083
+ }),
1084
+ /* @__PURE__ */ jsx(Text, {
1085
+ color: MATRIX_FADE,
1086
+ children: "─┐"
1087
+ })
1088
+ ]
1089
+ }),
1090
+ showTitle && /* @__PURE__ */ jsx(Box, {
1091
+ marginBottom: 1,
1092
+ children: /* @__PURE__ */ jsxs(Text, {
1093
+ bold: true,
1094
+ color: VISUALIZER_PALETTE.head,
1095
+ children: [PHASE_LABELS[phase], " - PostHog"]
1096
+ })
1097
+ }),
1098
+ /* @__PURE__ */ jsx(PhaseBody, {
1099
+ phase,
1100
+ width: visualW,
1101
+ height: visualH
1102
+ }),
1103
+ showTransport && /* @__PURE__ */ jsxs(Box, {
1104
+ flexDirection: "row",
1105
+ marginTop: 1,
1106
+ gap: 2,
1107
+ children: [
1108
+ /* @__PURE__ */ jsxs(Text, {
1109
+ color: VISUALIZER_PALETTE.mid,
1110
+ children: [
1111
+ "[",
1112
+ timeStr,
1113
+ "]"
1114
+ ]
1115
+ }),
1116
+ /* @__PURE__ */ jsx(Text, {
1117
+ color: MATRIX_FADE,
1118
+ children: equalizer
1119
+ }),
1120
+ /* @__PURE__ */ jsx(Text, {
1121
+ color: VISUALIZER_PALETTE.mid,
1122
+ children: "WizardAmp"
1123
+ })
1124
+ ]
1125
+ })
1126
+ ]
1127
+ });
1128
+ };
1129
+ function formatElapsed(totalSec) {
1130
+ const m = Math.floor(totalSec / 60);
1131
+ const s = totalSec % 60;
1132
+ return `${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
1133
+ }
1134
+ const BEAT_MS = 60 / 120 * 1e3;
1135
+ const EQ_BARS = 12;
1136
+ const EQ_TICK_MS = 67;
1137
+ const EQ_FALL_PER_FRAME = .08;
1138
+ function pulse(t, periodMs, decay, phaseMs = 0) {
1139
+ const since = (t - phaseMs + periodMs * 100) % periodMs;
1140
+ return Math.exp(-decay * since / periodMs);
1141
+ }
1142
+ const EQ_GLYPHS = "▁▂▃▄▅▆▇█";
1143
+ function renderMiniEqualizer(beatTimeMs, levels) {
1144
+ const kick = pulse(beatTimeMs, BEAT_MS, 4);
1145
+ const bass = pulse(beatTimeMs, BEAT_MS, 1.5);
1146
+ const clap = pulse(beatTimeMs, BEAT_MS * 2, 5, BEAT_MS);
1147
+ const hat8 = pulse(beatTimeMs, BEAT_MS / 2, 8);
1148
+ const hat16 = pulse(beatTimeMs, BEAT_MS / 4, 12);
1149
+ const pad = .2 + .15 * Math.sin(2 * Math.PI * beatTimeMs / 4e3);
1150
+ const mix = [
1151
+ bass * .7 + kick * .5 + pad,
1152
+ bass * .6 + kick * .6 + pad * .9,
1153
+ bass * .4 + kick * .7 + pad * .8,
1154
+ kick * .6 + clap * .3 + pad * .7,
1155
+ kick * .4 + clap * .5 + pad * .7,
1156
+ clap * .7 + hat8 * .3 + pad * .6,
1157
+ clap * .6 + hat8 * .5 + pad * .5,
1158
+ hat8 * .7 + clap * .3 + pad * .5,
1159
+ hat8 * .5 + hat16 * .4 + pad * .4,
1160
+ hat8 * .4 + hat16 * .5 + pad * .4,
1161
+ hat16 * .6 + hat8 * .3 + pad * .3,
1162
+ hat16 * .7 + pad * .3
1163
+ ];
1164
+ let out = "";
1165
+ for (let i = 0; i < EQ_BARS; i++) {
1166
+ const target = Math.min(1, mix[i]);
1167
+ levels[i] = Math.max(target, levels[i] - EQ_FALL_PER_FRAME);
1168
+ out += EQ_GLYPHS[Math.floor(levels[i] * 7)];
1169
+ }
1170
+ return out;
1171
+ }
1172
+ const PhaseBody = ({ phase, width, height }) => {
1173
+ switch (phase) {
1174
+ case "codebase-scan": return /* @__PURE__ */ jsx(MatrixRain, {
1175
+ width,
1176
+ height
1177
+ });
1178
+ case "skill-install": return /* @__PURE__ */ jsx(LibraryShelf, {
1179
+ width,
1180
+ height
1181
+ });
1182
+ case "dep-install": return /* @__PURE__ */ jsx(CrateStack, {
1183
+ width,
1184
+ height
1185
+ });
1186
+ case "code-edits": return /* @__PURE__ */ jsx(DiffCascade, {
1187
+ width,
1188
+ height
1189
+ });
1190
+ case "env-setup": return /* @__PURE__ */ jsx(Tumblers, {
1191
+ width,
1192
+ height
1193
+ });
1194
+ case "dashboards": return /* @__PURE__ */ jsx(DashboardGrid, {
1195
+ width,
1196
+ height
1197
+ });
1198
+ }
1199
+ };
1200
+ //#endregion
425
1201
  //#region src/ui/tui/playground/demos/RunScreenDemo.tsx
426
1202
  /**
427
1203
  * RunScreenDemo — Playground demo for the agent run view.
@@ -2063,4 +2839,4 @@ function runPlayground() {
2063
2839
  //#endregion
2064
2840
  export { runPlayground };
2065
2841
 
2066
- //# sourceMappingURL=playground-DDYYs2ub.js.map
2842
+ //# sourceMappingURL=playground-CmKFAlCE.js.map