How flyingviet/cantrip works
Cantrip is a macOS keyboard-first launcher and AI-agent host, with Windows support and native, desktop, and browser clients for shared sessions. The main workflow is a user request entering the launcher or a client, reaching a host session and selected agent backend, then returning as a streamed answer or task result. Major branches include Cantrip Home, memory and council, extensions, and remote control. README statements establish most cross-platform and host relationships; sampled gateway excerpts show its API and transport path. Other unsampled implementation links are omitted.
Main entry points: ChatSession.swift Chat Session · Cantrip Remote Control API · SessionManager.swift Session Manager · LauncherView.swift Keyboard Launcher
Components 20
Mac Host
- Keyboard Launcher
Sources/Cantrip/LauncherView.swift - Session Manager
Sources/Cantrip/SessionManager.swift - Chat Session
Sources/Cantrip/ChatSession.swift - Agent Backends
Sources/Cantrip/Backends - Remote Control API
Sources/Cantrip
Gateway Client
- Gateway Workspace
Clients/CantripGatewayMac/windows/src/gateway/ui/App.tsx - Remote Session State
Clients/CantripGatewayMac/windows/src/gateway/state/remote.ts - Gateway API Client
Clients/CantripGatewayMac/windows/src/gateway/api/client.ts - Gateway Main Process
Clients/CantripGatewayMac/windows/src/main/main.ts - Gateway Transport
Clients/CantripGatewayMac/windows/src/main/transport.ts
Mobile Client
- Cantrip Agent
Clients/CantripIOS/Sources/ChatView.swift - Watch Voice Client
Clients/CantripIOS/Watch/CantripWatchClient.swift
Windows App
- Windows Launcher
windows/src/main/main.ts - Windows Home Client
windows/src/main/home/service.ts
Agent Capabilities
- Cantrip Home
Sources/Cantrip/CantripHome.swift - Memory and Council
Sources/Cantrip/MemoryStore.swift - Extensions and MCP
Sources/Cantrip/MCPManager.swift - Background Engine
Sources/Cantrip/BackgroundEngine.swift
Other components
- User
- Browser Remote
Connections 24
- User → Keyboard Launcher: invokes
README.md - Keyboard Launcher → Session Manager: starts sessions
- Session Manager → Chat Session: manages tabs
Sources/Cantrip/SessionManager.swift - Chat Session → Agent Backends: runs agent
README.md - Session Manager → Remote Control API: serves sessions
Sources/Cantrip/SessionManager.swift - User → Gateway Workspace: uses
README.md - Gateway Workspace → Remote Session State: renders workspace
Clients/CantripGatewayMac/windows/src/gateway/ui/App.tsx - Remote Session State → Gateway API Client: requests session data
Clients/CantripGatewayMac/windows/src/gateway/state/remote.ts - Gateway API Client → Gateway Main Process: sends API calls
Clients/CantripGatewayMac/windows/src/gateway/api/client.ts - Gateway Main Process → Gateway Transport: routes requests
Clients/CantripGatewayMac/windows/src/main/main.ts - Gateway Transport → Remote Control API: connects to host
README.md - User → Cantrip Agent: uses
README.md - Cantrip Agent → Remote Control API: controls sessions
README.md - User → Watch Voice Client: speaks requests
README.md - Watch Voice Client → Cantrip Home: talks to Home
README.md - User → Windows Launcher: uses
README.md - Windows Launcher → Agent Backends: runs supported agents
README.md - User → Windows Home Client: views Home
README.md - Windows Home Client → Remote Control API: reads paired host
README.md - Browser Remote → Remote Control API: controls remotely
README.md - Cantrip Home → Chat Session: hands off work
README.md - Chat Session → Memory and Council: uses context
README.md - Chat Session → Extensions and MCP: invokes tools
README.md - Background Engine → Chat Session: runs tabs
README.md