Skip to content

feat(tui): markdown rendering, bordered panels, banner, and powershell tool - #1

Merged
buchenberg merged 2 commits into
mainfrom
chore/charm-v2-upgrade
Jul 13, 2026
Merged

feat(tui): markdown rendering, bordered panels, banner, and powershell tool#1
buchenberg merged 2 commits into
mainfrom
chore/charm-v2-upgrade

Conversation

@buchenberg

Copy link
Copy Markdown
Owner

Summary

TUI improvements, shared banner package, and PowerShell tool support.

TUI

  • Fix cursor not visible (offset Y to input line, fix layout overflow)
  • Fix response doubling (clear streaming state before AddMessage)
  • Add animated spinner using bubbles/v2/spinner (MiniDot)
  • Render assistant messages through glamour v2 (terminal markdown)
  • Wrap assistant responses in lipgloss rounded-border panels
  • Add ctrl+y to copy last response as markdown (OSC52 clipboard)
  • Add blank line between user questions and assistant responses

Banner

  • New internal/banner package with shared figlet+lolcat banner
  • Uses figlet-go for ASCII art, lolcat rainbow coloring (vendored algorithm)
  • Subtitles: LOCAL-FIRST ::: VENDOR-FREE ::: STANDARDS OVER REINVENTION and For agents by agents
  • Both CLI and TUI use the same banner (replaces old ASCII box art)
  • Respects NO_COLOR environment variable

Tools

  • Add PowerShellTool (tries pwsh first, falls back to powershell)
  • Uses -NoProfile -NonInteractive for clean execution
  • Shares timeout, output truncation, and dangerous-command guards with BashTool

Dependencies added

  • charm.land/glamour/v2 v2.0.1 (markdown rendering)
  • github.com/lsferreira42/figlet-go v0.0.2-beta (ASCII art)

@buchenberg
buchenberg force-pushed the chore/charm-v2-upgrade branch from ef39608 to b8aa942 Compare July 13, 2026 16:59
…l tool

TUI improvements:
- Fix cursor not visible (offset Y to input line, fix layout overflow)
- Fix response doubling (clear streaming state before AddMessage)
- Add animated spinner using bubbles/v2/spinner (MiniDot)
- Render assistant messages through glamour v2 (terminal markdown)
- Wrap assistant responses in lipgloss rounded-border panels
- Add ctrl+y to copy last response as markdown (OSC52 clipboard)
- Add blank line between user questions and assistant responses
- Add copyStyle for copy icon hint inside panels

Banner:
- New internal/banner package with shared figlet+lolcat banner
- Uses figlet-go for ASCII art, lolcat rainbow coloring (vendored)
- Subtitles: LOCAL-FIRST ::: VENDOR-FREE ::: STANDARDS OVER REINVENTION
  and For agents by agents
- Both CLI and TUI use the same banner (replaces old ASCII box)
- Respects NO_COLOR environment variable

Tools:
- Add PowerShellTool (tries pwsh, falls back to powershell)
- Uses -NoProfile -NonInteractive for clean execution
- Shares timeout, output truncation, and dangerous-command guards

Dependencies added:
- charm.land/glamour/v2 v2.0.1 (markdown rendering)
- github.com/lsferreira42/figlet-go v0.0.2-beta (ASCII art)
@buchenberg
buchenberg force-pushed the chore/charm-v2-upgrade branch from b8aa942 to a5081fc Compare July 13, 2026 17:16
@buchenberg
buchenberg merged commit 5f8d24e into main Jul 13, 2026
8 checks passed
@buchenberg
buchenberg deleted the chore/charm-v2-upgrade branch July 19, 2026 07:04
buchenberg added a commit that referenced this pull request Aug 4, 2026
… (P0 #1)

Split the ~70-field Loop struct into:
- LoopConfig: 32 immutable config fields (Model, MaxIterations, ContextWindow, etc.)
- LoopState: 14 mutable runtime fields (Messages, TotalTokens, etc.)
- Loop: ~28 dependency/internals (Provider, Registry, CtxMgr, Persister, etc.)

Renamed options.LoopConfig -> AgentConfig and WithLoopConfig -> WithAgentConfig
to avoid collision with the new LoopConfig sub-struct type.

Addresses ARCHITECTURE-REVIEW.md P0 #1 'Refactor Loop struct into composed types.'
buchenberg added a commit that referenced this pull request Aug 4, 2026
…#131)

* refactor: complete CtxMgr/Persister/Hooks migration, remove deprecated Loop fields

* refactor: decompose Loop struct into LoopConfig + LoopState sub-types (P0 #1)

Split the ~70-field Loop struct into:
- LoopConfig: 32 immutable config fields (Model, MaxIterations, ContextWindow, etc.)
- LoopState: 14 mutable runtime fields (Messages, TotalTokens, etc.)
- Loop: ~28 dependency/internals (Provider, Registry, CtxMgr, Persister, etc.)

Renamed options.LoopConfig -> AgentConfig and WithLoopConfig -> WithAgentConfig
to avoid collision with the new LoopConfig sub-struct type.

Addresses ARCHITECTURE-REVIEW.md P0 #1 'Refactor Loop struct into composed types.'

* refactor: decompose runMiddleware into logical helpers (P0 #2)

Extracted 7 focused methods from the ~320-line runMiddleware:
- publishDone / teardown: deferred cleanup (broker, persister, hooks)
- initMessages: conversation initialization and session-start hooks
- buildTurnRequest: PrepareStep middleware + request construction + MaxTurns
- guardContextBeforeCall: pre-flight compaction + payload guard
- recordTurnSpanAttrs: OTel span attribute population
- executeToolPhase: tool truncation, execution, conflict detection, PostTool

runMiddleware reduced from ~320 lines to ~180 lines with clear delegation.

* refactor: clarify turn vs iteration naming (P1 #4)

Renamed across all packages:
- MaxIterations -> MaxLoopCycles (hard limit on total loop cycles)
- MaxTurns -> MaxToolTurns (when tools are stripped)
- WrapUpAhead -> WrapUpThreshold (wrap-up notice threshold)
- WrapUpTurns -> WrapUpThreshold (config yaml alias)
- injectWrapUp -> injectWrapUpNotice

YAML tags preserved for backward compat ('max_iterations', 'max_turns',
'wrap_up_turns' remain unchanged).

Touches: agent, config, pipeline, tools, subagent, cmd/yaah packages.

* docs: update ARCHITECTURE-REVIEW with implementation status

* fix: gofmt cmd/yaah/agent_frame.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant