PRD-38.0: Widget Architecture Master Plan
Executive Summary
The Vision: "Widgets as Universal Interface"
Current State → Target State
Aspect
Current
Phase 1
Phase 4+
Phase Overview
Core Architecture
Widget Component Model
Widget Registry
Tool-to-Widget Mapping
State Management
Workspace Store (Zustand)
File Structure
Phase 1-3: Internal Widgets (in main repo)
Phase 4+: External SDK (separate repo)
Dependencies & Libraries
Recommended Libraries by Phase
Phase
Library
Purpose
License
Already in Stack (Reuse)
Library
Current Use
Widget Use
API Contracts
Widget Data Endpoint (Backend)
Streaming Events (Tool → Widget)
Success Metrics
Phase 1 Metrics
Phase 2 Metrics
Phase 3 Metrics
Phase 4 Metrics
Phase 5 Metrics
Risk Mitigation
Risk
Impact
Mitigation
Risk Mitigation Details
R1: Performance Degradation with Many Widgets
R2: Breaking Existing Chat UX
R3: SDK Bundle Size Too Large
R4: External Widget Security
R5: State Sync Complexity (Elevated to High)
Related Documents
Appendix: Open Source Inspirations
Dashboard/Workspace
Embeddable Widgets
Component Libraries
PreviousPRD-37: SaaS Foundation - Authentication, Workspaces & BillingNextPRD-38.1: Widget-Ready Chatbot Workspace
Last updated

