remove all hardcoded colors for agent modes in the cli and web dirs and centralize them in the AGENT_MODES const
Centralize agent mode colors in constant
Quinn
Slack • @sqs
1y agoGreat! Tests pass. Now let me create a summary of what was done:
Summary
I successfully removed all hardcoded colors for agent modes from the CLI and web directories and centralized them in the AGENT_MODES const. Here's what was changed:
Changes Made:
1. core/src/inference/agent-modes.ts
- Added new color constant exports for all agent modes:
DARK_BLUE_COLOR,BRIGHT_BLUE_COLOR(free mode)DARK_ORANGE_COLOR,GOLD_COLOR(rush mode)ROYAL_PURPLE_COLOR,ROYAL_BLUE_COLOR(plan mode)
- Updated mode definitions to use constants instead of inline hex values
- Created new
getAgentModeColors()function to retrieve colors from agent mode specs
- Updated imports to include
getAgentModeColors - Simplified
getAgentModeColor()function to use centralized colors viagetAgentModeColors() - Removed unused
hashStringToColor()function
3. cli/src/tui/storybook/laser-sweep-overlay.story.ts
- Imported centralized color constants
- Updated story colors to use
NEON_GREEK_COLORandGOLD_COLOR
4. Web Components:
- voice-orb.svelte: Refactored from
colorModeprop toagentMode, now usesgetAgentModeColors() - audio-recorder.svelte: Changed prop from
colorModetoagentMode - voice-recording-modal.svelte: Changed prop from
colorModetoagentMode - thread-status.svelte: Simplified to pass
agentModedirectly instead of computingcolorMode
All checks pass ✓