# Brain Studio Files Tab - Full COSMO IDE v2 Integration

## What COSMO IDE v2 Actually Is:
- Full Cursor web clone
- Monaco editor with diff viewer
- AI function calling (read, edit, create, delete files)
- Semantic codebase search
- Edit queue with approve/reject
- Conversation management
- Streaming responses with tool visualization
- EVERYTHING

## What I'm Copying (NO dumbing down):

### From /path/to/cosmo-ide:

1. **public/index.html** (7,613 lines)
   - FULL IDE HTML structure
   - Monaco editor integration
   - AI chat panel
   - All modals and overlays

2. **public/css/styles.css** (777 lines)
   - Complete IDE styling

3. **server/ai-handler.js** (1,136 lines)
   - Function calling with streaming
   - SSE events
   - Tool execution

4. **server/tools.js** (1,577 lines)
   - All tool definitions
   - Tool executors

5. **public/js/** modules
   - ai-chat.js
   - file-tree.js  
   - editor.js
   - edit-queue.js

## Strategy:
Copy the ENTIRE COSMO IDE v2 as the Files tab.
Minimal adaptations:
- Root path = brain directory
- Title = brain name
- That's it

NO features removed. FULL IDE.
