Commit Graph

7 Commits

Author SHA1 Message Date
Michael Bleigh 9e03476e03 feat(cli): support 'notice' format and refine declarative tool rendering
Key enhancements:
- Updated `UpdateTopicTool` to provide declarative 'notice' display info, using dynamic
  descriptions for high-fidelity output.
- Refined `ToolGroupDisplay` to 'hoist' notice-format tools to the top of the group.
- Implemented conditional boxing in `ToolGroupDisplay`: borders are now suppressed in
  compact mode, matching the standard CLI view.
- Added support for `resultSummary` rendering at the bottom of text results in boxed mode.
- Improved `useAgentStream` to wait for turn completion before pushing tools to history,
  ensuring all notices for a turn are correctly grouped and hoisted together.
- Fixed margin and border logic to handle seamless transitions between notices and tool boxes.
2026-04-12 16:20:27 -07:00
Michael Bleigh 45eababfd8 feat(cli): refactor tool rendering to declarative ToolDisplay system
This change completes the transition of the interactive agent session (`useAgentStream`)
to a declarative-first tool rendering system.

Key changes:
- Reverted experimental `ToolDisplay` logic from legacy UI components (`DenseToolMessage`, etc.)
  to establish a clean baseline.
- Introduced `HistoryItemToolDisplayGroup` and `ToolGroupDisplay` component in CLI.
- Added `display` property to `ToolCallRequestInfo` to carry declarative UI info natively.
- Populated tool request display information at the source (`Turn.ts` and `Scheduler.ts`)
  using dynamic descriptions from tool invocations.
- Updated `useAgentStream` to emit the new history item type, providing a standalone
  rendering path for interactive sessions.
- Ensured tool descriptions are updated when arguments are modified during confirmation.
2026-04-12 11:46:18 -07:00
Michael Bleigh 410e675837 revert: remove invasive ToolDisplay logic from legacy UI components 2026-04-11 19:04:36 -07:00
Michael Bleigh 43f93c3cde fix(ui): resolve rebase conflicts and type errors for ToolDisplay 2026-04-10 20:18:51 -07:00
Michael Bleigh fae963ff0e fix(core,cli): handle structured tool display properly and prevent metadata overwrite
This addresses PR feedback by:
- Creating a `renderDisplayDiff` utility to render `DisplayDiff` objects.
- Creating a `displayContentToString` utility to safely extract text from any `DisplayContent`.
- Updating non-interactive CLI to use `displayContentToString` to avoid data loss on non-text output.
- Updating `useAgentStream` to use `displayContentToString` to avoid stale UI state for non-text output.
- Shallow merging the `display` object in `useAgentStream` rather than replacing it, preventing loss of display metadata.
2026-04-10 11:42:37 -07:00
Michael Bleigh 7f7e69e6c6 feat(agent): implement tool-controlled display protocol (Steps 2-3) 2026-04-10 11:00:49 -07:00
Michael Bleigh e406856343 feat(cli): implement useAgentStream hook (#24292)
Co-authored-by: Adam Weidman <adamfweidman@gmail.com>
Co-authored-by: Adam Weidman <adamfweidman@google.com>
2026-04-09 19:06:27 +00:00