Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Introduce tool feed states & UI refactor

8 months ago

a02b4c4
Authored
mweinbach3/7/2026, 1:59:34 AM
Add explicit tool feed states and approval metadata, improve tool resolution, and refactor UI components.

- Add ToolFeedState and ToolApprovalMetadata types and update FeedItem to include state and optional approval metadata.
- Implement latestToolKeyByTurnAndName tracking and resolveToolItem logic to reconcile synthetic/evolving tool keys across stream updates.
- Handle new model stream update kinds and transitions: input-streaming, input-available, approval-requested, output-available/error/denied; create synthetic feed items for approval requests and preserve args/state across key migrations.
- Refactor prompt input into smaller forwardRef components (PromptInputRoot/Form/Body/Footer/Tools/Textarea/Submit), introduce PromptInputStatus and update ChatView to use the new pieces and props.
- Update many UI primitives: add data-slot/data-size/data-variant attributes, consolidate utility imports to '@/lib/utils', adjust icon sizing via data-icon/size classes, and improve button/select/checkbox/card/dialog/select/textarea styles and accessibility.
- Add apps/desktop/components.json and alias '@' in electron.vite.config.ts to map to app src.
- Minor style variables and other small fixes; add new src/utils/coworkHome.ts and update tests to match behavior changes.

These changes centralize tool state handling for richer UI feedback and streamline component APIs for consistent styling and automation.

Parentbdb46ee

38 files changed
  • apps/desktop/components.json+21−0
  • apps/desktop/electron.vite.config.ts+1−0
  • apps/desktop/src/app/store.feedMapping.ts+150−34
  • apps/desktop/src/app/types.ts+15−1
  • apps/desktop/src/components/ai-elements/conversation.tsx+5−2
  • apps/desktop/src/components/ai-elements/prompt-input.tsx+71−52
  • apps/desktop/src/components/ai-elements/reasoning.tsx+2−2
apps/desktop/src/components/ai-elements/tool.tsx
+47
−27
  • apps/desktop/src/components/ui/badge.tsx+2−2
  • apps/desktop/src/components/ui/button.tsx+16−8
  • apps/desktop/src/components/ui/card.tsx+12−8
  • apps/desktop/src/components/ui/checkbox.tsx+5−4
  • apps/desktop/src/components/ui/dialog.tsx+13−8
  • apps/desktop/src/components/ui/input.tsx+2−1
  • apps/desktop/src/components/ui/select.tsx+29−16
  • apps/desktop/src/components/ui/textarea.tsx+2−1
  • apps/desktop/src/styles.css+2−0
  • apps/desktop/src/ui/ChatView.tsx+38−29
  • apps/desktop/src/ui/chat/toolCards/ToolCard.tsx+34−6
  • apps/desktop/src/ui/chat/toolCards/legacyToolLogs.ts+7−6
  • apps/desktop/src/ui/chat/toolCards/toolCardFormatting.ts+28−10
  • apps/desktop/test/legacy-tool-logs.test.ts+1−1
  • apps/desktop/test/protocol-v2-events.test.ts+12−3
  • apps/desktop/test/tool-card-formatting.test.ts+3−3
  • apps/desktop/tsconfig.json+1−0
  • docs/harness/runbook.md+1−0
  • scripts/run_raw_agent_loops.ts+50−5
  • src/config.ts+2−4
  • src/mcp/configPaths.ts+2−2
  • src/providers/catalog.ts+1−1
  • src/providers/modelAdapter.ts+2−4
  • src/runtime/piRuntime.ts+2−8
  • src/server/session/SessionRuntimeSupport.ts+2−3
  • src/tools/grep.ts+2−2
  • src/utils/coworkHome.ts+11−0
  • tasks/lessons.md+1−0
  • tasks/todo.md+67−0
  • test/session.test.ts+1−1