# Oracle OS Workspace Composer — Goal Document

## Owner's Requirements (verbatim)
- AI should NOT say it's an AI — it acts as Kai Coder, a coding agent
- Must be able to execute coding tasks: write, edit, run code
- File diffs (red/green +/- like Cursor Composer) in the editor
- Plan Mode & Agent Mode buttons (placeholder for now, built soon)
- File explorer (left): tree view, upload files/folders, branches out
- Editor (center): open file tabs, diff view showing changes
- Console/Debug (bottom): terminal output, debug info
- Chat (right): Composer chat with Kai Coder
- All panels resizable (drag to adjust)
- Upload file/image goes to Explorer (left), NOT in chat area
- Session persistence: local-save first (survives internet outage), persisted to server
- Chat history: view previous sessions/chats
- Page reload recovery: don't lose state on refresh

## Current State (v9.10.457)
Already built in `oracle-os/shell/desktop.js` + `oracle-antigravity.js`:
- Activity bar (left icons): Explorer, Search, Preview, Chat toggle, Terminal toggle
- Explorer sidebar with file tree + upload files/folders
- Editor with tab bar + code view
- Preview pane (iframe) for HTML sites
- Terminal/Console bottom panel with Run/Stop
- Composer chat (right panel) with AI providers
- Split resizers (vertical + horizontal)
- Workspace state snapshotting

## Issues to Fix
1. **System prompt** — AI identifies as "a synced AI" and talks about Oracle Database.
   Fix: rewrite SYNCED_AI_SKILL_EXCERPT to be a coding agent persona.
2. **Diff view** — no red/green inline diff. Need CodeMirror or custom diff renderer.
3. **Session persistence** — drafts save to localStorage but full chat history doesn't persist.
4. **Chat history sidebar** — no way to view previous conversations.
5. **Plan/Agent mode** — no UI for switching modes yet.

## Priority Order
1. Fix system prompt (immediate — makes the AI useful)
2. Session/chat persistence (saves user work)
3. Chat history viewer
4. Diff view in editor
5. Plan/Agent mode toggle (placeholder)

## Files
- `oracle-os/shell/desktop.js` — IDE layout + window manager
- `oracle-antigravity.js` — agSend, chat, file handling, tool display
- `tools/oracle-discord/shared/workspace-ai-links.mjs` — system prompt, provider routing
- `tools/oracle-discord/command-center-server.mjs` — /api/workspace/composer/stream
