How skaplanofficial/raycast-promptlab works
Main Components
a. Core Components:
• User Interface Layer (Raycast Extension Interface)
• Command Management System
• Chat System
• Model Management System
• Placeholder System
• Action Scripts Engine
• Storage System
b. External Integrations:
• AI Model Endpoints (Raycast AI, Custom endpoints)
• File System Integration
• AppleScript/JXA Runtime
• Command Store
UI Layer
• Main entry points: Chat Interface, Command Interface, Model Management Interface
• To their respective controllers/handlers
Business Logic Layer
• Command Processing System
• Placeholder Resolution System
• Chat Management
• Model Management
• Action Script Execution
Integration Layer
• File System Handlers
• Script Execution Engine
• API Clients
• Storage Handlers
Specific Implementation Details
• Blue rectangles for UI components (/src/components/)
• Green rectangles for core business logic (/src/lib/)
• Yellow diamonds for external integrations
• Purple rectangles for storage systems
• Orange ovals for script handlers
Data Flow Representation
• Command execution flow
• Placeholder resolution process
• Chat message flow
• Model API communication
• File system interactions
• Action script execution path
Key Architectural Patterns to Highlight
• Component-based architecture (evident from the React components structure)
• Service-oriented design (separate services for different functionalities)
• Event-driven architecture (for handling user interactions and script execution)
• Plugin architecture (for custom placeholders and commands)
Detailed Component Breakdown
Core Systems:
Commands System
• Command Creation
• Command Execution
• Command Storage
• Command Sharing
Placeholder System
• Built-in Placeholders
• Custom Placeholders
• Placeholder Resolution
Chat System
• Chat Management
• Context Management
• History Management
• Statistics
Model System
• Model Configuration
• Model Execution
• Response Processing
Implementation Notes
• The modular nature of the codebase
• Clear separation of concerns
• Extensibility points for custom functionality
• Integration points with Raycast and external services