feat: add reusable terminal helix visualizer module#21
Conversation
|
Ran the gates locally -- couple small things before merging:
mypy is clean, all 23 tests pass. Should be a quick fix. |
|
Fixed both items — removed the unused |
CalebisGross
left a comment
There was a problem hiding this comment.
Gates pass, code is clean. Ship it.
|
Nit: _COLOR_MAP in helix_visualizer.py duplicates the ANSI constants from terminal.py. Could consolidate into a single lookup, but not a big deal. |
|
Consolidated |
|
Nice, that's the good stuff. |
Extract and generalize the demo helix visualizer from examples/05_deep_research_live/ into a proper SDK module at src/felix_agent_sdk/visualization/. The new module provides: - terminal.py: ANSI color primitives, cursor control, progress bars - helix_visualizer.py: HelixVisualizer class with agent registration, live update, sidebar panel, phase boundaries, and team confidence - AgentDisplayState dataclass for per-agent rendering state - Exported via top-level __init__.py as HelixVisualizer Includes 23 unit tests covering registration, update, rendering, NO_COLOR support, context manager, and dimension customization. All 686 tests pass, ruff clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Addresses review feedback from @CalebisGross: - Remove unused `import os` in test file (ruff F401) - Apply `ruff format` to helix_visualizer.py and test file Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move the colour-name → ANSI-code mapping from helix_visualizer.py into terminal.py as COLOR_MAP, eliminating duplicated constants. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
65f5965 to
00e4501
Compare
Wire the HelixVisualizer into all four features that landed on dev/phase-2: - Event bus: attach_event_bus() auto-registers agents on AGENT_SPAWNED, updates progress on AGENT_POSITION_UPDATED, marks DONE/FAILED - Streaming: VisualizerStreamHandler shows live token count in sidebar - Spawning: set_monitor() displays confidence trend and spawn recommendation in the footer - CLI: felix run --visualize / -V flag for live helix during workflows 31 visualizer tests pass (23 existing + 8 new). 823 total tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Updated — visualizer now integrates with all four dev/phase-2 features:
Rebased on latest |
Summary
src/felix_agent_sdk/visualization/module withHelixVisualizerfor real-time ASCII rendering of agents progressing down the helixexamples/05_deep_research_live/into a reusable SDK componentregister_agent()→update()→render()withlive()context manager for terminal cleanupWhat it does
Renders a terminal-based helix showing agent positions, phase boundaries (exploration/analysis/synthesis), animated backbone, per-agent sidebar with confidence bars, and team confidence footer. Works on Windows (pure ANSI, no curses). Respects
NO_COLOR/FORCE_COLORenv vars.Files
visualization/__init__.pyHelixVisualizer,AgentDisplayStatevisualization/terminal.pyvisualization/helix_visualizer.pytests/unit/test_helix_visualizer.py__init__.pyHelixVisualizerto top-level exportsUsage
Test plan
pytest tests/unit/test_helix_visualizer.py -v— 23 tests passpytest tests/ -v— 686 total pass, no regressionsruff check src/felix_agent_sdk/visualization/— clean🤖 Generated with Claude Code