palladius / palladius/antigravity-ruby-sdk
Refactor step-log TUI into lib/antigravity/tui.rb
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 0
- Forks
- 0
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
Summary
The hooks-based step-log TUI pattern (permanent lines for tool calls, dynamic status line with timer, colored states, tool elapsed time) is currently duplicated in:
examples/08_e2e_telegram_bot.rbexamples/09_e2e_nanobanana.rb
It should live in the SDK as a reusable module.
Proposed API
# Option A: constructor flag
agent = Antigravity::Agent.new(tui: :step_log)
# Option B: explicit attachment
Antigravity::TUI::StepLog.attach(agent)
# Option C: block-based
agent.with_tui(:step_log) do
agent.ask("hello")
end
What the TUI does
- Step log -- permanent lines for significant WS events (tool calls, state changes, errors, first text delta)
- Dynamic status line -- overwrites in-place with
\r\e[K, shows:🏃 running 🔧 tool_name 42s 💭💭 ⏳45s 7↕ - Tool elapsed time -- tracks per-tool start time, logs
⏱️ run_command(...) [67s]on completion - Colored state -- green=running, gray=idle, red=error/cancel
- Background ticker -- Thread ticks every 1s so timer updates even without WS traffic
- ensure cleanup -- deactivates ticker and clears status line after
askreturns
Files to create
lib/antigravity/tui.rb--Antigravity::TUI::StepLogclasslib/antigravity/tui/step_log.rb-- if we want a directory structure- Extract from
examples/09_e2e_nanobanana.rb(the reference implementation)
Dependencies
- Requires the hooks system (
Antigravity::Hookswithon/emit) - Uses
:ws_messageevent fromconversation.rb
Priority
P3 -- nice to have, current examples work fine with inline code.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reference implementation in examples/09_e2e_nanobanana.rb, then compare the duplicated pattern in examples/08_e2e_telegram_bot.rb. Read the Antigravity::Hooks on/emit system and the :ws_message flow in conversation.rb before choosing among the proposed APIs. Done means the behavior lives in lib/antigravity/tui.rb or lib/antigravity/tui/step_log.rb and both examples can use the reusable TUI with ticker cleanup after ask returns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100