@@ -43,6 +43,7 @@ app/src/
4343├── components/ # Reusable UI components
4444│ ├── ui/ # Generic Shadcn primitives (button, card, dialog, accordion, etc.)
4545│ ├── ai-elements/ # Conversation, Message, PromptInput components
46+ │ ├── AgentIsland/ # 3D agent bar (React Three Fiber)
4647│ ├── AgentSettings/ # AgentConfigModal
4748│ ├── Board/ # PyramidBoard, Block, BlockModal
4849│ ├── Chat/ # (reserved for future chat components)
@@ -439,3 +440,39 @@ agents, sessions — writes via Admin SDK (bypasses rules)
4394405. **Global context**: Workspace-level context aggregation injected into every AI interaction.
4404416. **Workspace isolation**: All entities scoped by userId + workspaceId. Workspace deletion cascades.
4414427. **Shadcn UI**: All primitives from Radix via Shadcn. Custom components compose these primitives.
443+
444+ ---
445+
446+ ## Agent Island (3D Agent Bar)
447+
448+ Global floating bar at center-bottom of all authenticated pages displaying workspace agents as interactive 3D characters.
449+
450+ ### Component Tree
451+ ` ` `
452+ AuthenticatedLayout
453+ └── AgentIsland (fixed bottom - center , glassmorphism )
454+ └── React .lazy → AgentCharacter × N
455+ └── < Canvas > (R3F )
456+ └── AgentModel (GLTF + animation cycling )
457+ ` ` `
458+
459+ ### Files
460+ | File | Purpose |
461+ |------|---------|
462+ | ` components / AgentIsland / AgentIsland .tsx ` | Container: glassmorphism bar, lazy loading, route-based visibility |
463+ | ` components / AgentIsland / AgentCharacter .tsx ` | Per-agent 3D Canvas with GLTF model and animation cycling |
464+ | ` components / AgentIsland / useAgentIslandAgents .ts ` | Hook: fetches agents via ` getAgents (workspaceId )` |
465+
466+ ### 3D Stack
467+ - **@react-three/fiber**: React renderer for Three.js
468+ - **@react-three/drei**: ` useGLTF ` (GLTF/Draco loading), ` useAnimations ` (clip management)
469+ - **Model**: ` public / agents / gm .gltf ` — shared model for all agents (Draco-compressed)
470+ - **Animations**: ` idle ` , ` walk ` , ` happy ` , ` sad ` , ` standing_jump ` , ` jump_run ` , ` running `
471+
472+ ### Behavior
473+ - Each agent rendered as a separate ` <Canvas >` with transparent background
474+ - Characters overflow above the island container (upper body/head sticks out)
475+ - Animation cycle: ` idle ` → ` walk ` → ` happy ` with crossfade, staggered per agent
476+ - Click navigates to ` / ai - chat `
477+ - Hidden on ` / ai - chat ` page, max 6 visible agents with "+N" overflow badge
478+ - Lazy-loaded to keep Three.js out of the initial JS bundle
0 commit comments