How xinthedark/raycast-g4f works
Main System Components
a) User Interface Layer
• Raycast Commands (represented by the various .jsx files in src/)
• Preferences Interface (src/components/preferences/)
b) Core Application Layer
• AI Chat System (src/aiChat.jsx)
• Message Handling (src/classes/message.js)
• Custom Commands System (src/customAICommands.jsx)
c) Provider Layer
• Provider Management (src/api/providers.js)
• Individual AI Providers (src/api/Providers/)
• Custom API Integration (src/api/Providers/special/)
d) Infrastructure Layer
• Storage System (src/api/storage.js)
• Update System (src/checkForUpdates.jsx)
• Configuration Management (src/config/)
Component Relationships
a) Data Flow
• User Input → Commands → Provider Layer
• Provider Layer → Message Processing → UI Display
• Storage System ↔ Chat History
• Configuration ↔ All Layers
b) Integration Points
• Custom API Integration → Provider Layer
• Web Search Tools → Provider Layer
• File Upload System → Provider Layer
Technical Details
• Node.js/React foundation
• API integration points
• Storage mechanisms
• Update pathways
• Configuration flow
Implementation Notes
• The modular provider system
• The extension's privacy-focused architecture
• The separation between UI and business logic
• The extensibility of the custom commands system