README
Documentation for Sessions
Session 73: AI Apps Separation
Date: 2026-01-28 | Branch: editor2-session-72 → editor2-session-73
Overview
This session focuses on separating AI functionality from gograb-space into dedicated NX apps to reduce bundle size and enable embeddable AI features across multiple platforms.
Objectives
- Plan the separation of AI functionality into dedicated apps
- Design an embeddable architecture for cross-app and external embedding
- Create MVP validation approach before full migration
- Enable long-term vision: Chrome extension, external embedding, browser AI
Key Decisions
Architecture: Two-App Approach
| App | Purpose | Port |
|---|---|---|
| app-gograb-ai | User-facing AI assistant (embeddable) | 5300 |
| app-mcp-admin | Administrative AI center | 5301 |
Communication: Iframe + PostMessage
- Cross-app communication via
postMessage - Shadow drag element system for cross-iframe drag-drop
- Auth token forwarding via postMessage
MVP-First Approach
Duration: 10 days before any route migration
| Phase | Days | Focus |
|---|---|---|
| MVP 0.1 | 2 | Skeleton app + iframe embedding |
| MVP 0.2 | 2 | PostMessage bridge |
| MVP 0.3 | 3 | Cross-iframe drag-drop |
| MVP 0.4 | 2 | Auth token flow |
| MVP 0.5 | 1 | Performance profiling |
Risk Assessment
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Cross-iframe drag-drop issues | 30-40% | HIGH | Shadow drag element + fallbacks |
| Auth complications | 20-25% | HIGH | PostMessage tokens + cookie fallback |
| Performance degradation | 25-30% | MEDIUM | Lazy loading + iframe destruction |
| State sync race conditions | 35% | MEDIUM | Message acknowledgment protocol |
Overall Confidence: 70% (honest assessment requiring MVP validation)
Files Created
| File | Purpose |
|---|---|
| ai-apps-separation.plan.md | Comprehensive implementation plan |
Sub-Sessions
73.1 - Initial Planning
- Explored codebase (22 AI libraries, 30+ routes)
- Initial architecture design (85% confidence)
73.2 - Critical Analysis & MVP Design
- Genuine risk assessment
- MVP-first approach requirement
- Renamed app-mcp-dashboard → app-mcp-admin
- Revised confidence to 70%
73.3 - MVP Implementation (IN PROGRESS)
- Creating skeleton app-gograb-ai
- Creating ai-embeddable-bridge library
- Basic iframe embedding
Success Criteria
Bundle Size
- gograb-space: ~18MB → < 13MB (28% reduction)
- AI code in gograb-space: ~3MB → 0
Performance
- Panel open time: < 1s
- Drag-drop latency: < 100ms
- Memory overhead: < 150MB
Next Steps
Copy plan to documentation✅- Create skeleton
app-gograb-aiNX app - Create
ai-embeddable-bridgelibrary - Implement basic iframe embedding
- Test CORS and postMessage communication