Centralize agent mode colors in constant

remove all hardcoded colors for agent modes in the cli and web dirs and centralize them in the AGENT_MODES const

I'll help you remove hardcoded colors for agent modes and centralize them. Let me start by exploring the codebase.

Explored 1 search
Searched codebase
Explored 2 searches

Let me look at the current agent-modes.ts and the CLI color functions:

Explored 2 files

Now let me search for the getAgentModeColor function:

Explored 2 searches

Let me look at the getAgentModeColor function and the animated-orb files:

Explored 3 files

Now I see the issue clearly. The getAgentModeColor function in cli/src/tui/app.ts has hardcoded colors that don't match the centralized colors in agent-modes.ts. Let me check if there are other places:

Explored 2 searches

Let me search for agent mode color references in the web:

Explored 2 searches

Now let me look at voice-orb to see if there are hardcoded colors there:

Explored 1 file

Perfect! I found the hardcoded colors. Now let me create a plan:

  1. Add color exports to agent-modes.ts for modes that don't have them yet
  2. Fix the getAgentModeColor function in cli/src/tui/app.ts to use the centralized colors
  3. Fix the voice-orb.svelte to use agent mode specs instead of hardcoded colors

Let me start:

Edited agent-modes.ts
+7

Now update the mode definitions to use these constants:

Edited agent-modes.ts
+6
-8

Now let's create a helper function to get colors from agent mode spec and update the CLI:

Edited agent-modes.ts
+21

Now let's fix the CLI getAgentModeColor function:

Explored 1 file

I need to check what import I need to add to cli/src/tui/app.ts:

Explored 1 file, 1 search

Now I need to add the new function to the imports:

Edited app.ts
+4
-1

Now let's update the getAgentModeColor function:

Edited app.ts
+2
-7

Now let's update the web voice-orb.svelte component to use the centralized colors:

Edited voice-orb.svelte
+26
-14

Now I need to update the places where voice-orb is used to pass agentMode instead of colorMode. Let me find them:

Explored 2 searches

Let me check these files to see where the colorMode prop needs to be replaced:

Explored 3 files

Now I need to check thread-status to understand how agentMode is passed:

Explored 1 file

Now I understand the refactoring needed. I need to:

  1. Change the colorMode prop to agentMode in audio-recorder, voice-recording-modal, and voice-orb
  2. Update thread-status to pass agentMode instead of colorMode

Let me do this systematically:

Edited audio-recorder.svelte
+6
-4
Editing voice-recording-modal.svelte

Let me check the full context:

Explored 1 file
Edited voice-recording-modal.svelte
+4
-3

Now let's update thread-status to pass agentMode instead of colorMode:

Edited thread-status.svelte
+1
-5

Perfect! Now let me check if there are any imports we need to clean up in voice-orb.svelte:

Edited voice-orb.svelte
-6

Now let me verify the code is correct by checking for any diagnostics:

Explored 3 files

Excellent! Now let's verify the builds pass:

Great! Now check web and server:

Perfect! Now let me run a quick sanity check to find any remaining hardcoded colors I might have missed:

Explored 2 searches

Let me fix the storybook file:

Explored 2 files
Edited laser-sweep-overlay.story.ts
+9
-4

Now let me verify everything compiles:

Let me verify there are no remaining hardcoded colors:

Those are just build artifacts, which is fine. Let me check the actual source files:

Perfect! Let me run a final build and test:

There's an unused function. Let me remove it:

Explored 1 file, 1 search
Edited app.ts
-16

Perfect! Let me run tests to make sure everything works:

Great! 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

2. cli/src/tui/app.ts

  • Updated imports to include getAgentModeColors
  • Simplified getAgentModeColor() function to use centralized colors via getAgentModeColors()
  • 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_COLOR and GOLD_COLOR

4. Web Components:

All checks pass ✓