How sqfcyily/deva works
Deva is a local-first desktop AI agent: users work through chat, where the main role can use tools, coordinate members or subagents, and return deliverables. The desktop renderer communicates through the preload boundary with main-process services; local conversation state and scheduled tasks are persisted separately. Documented branches include model providers, browser and workspace tools, memory, skills/MCP, Git, and remote phone access through Feishu or Telegram. The README supports the product workflow; unsampled implementations are represented by their listed paths, and uncertain wiring is omitted.
Main entry points: agent-loop.ts Agent loop · chat.tsx Chat state · chat.ts Chat service · chat-store.ts Conversation store
Components 24
Desktop experience
- Chat interface
apps/desktop/src/renderer/src/redesign/Conversation.tsx - Chat state
apps/desktop/src/renderer/src/store/chat.tsx - IPC bridge
apps/desktop/src/preload/index.ts
Agent runtime
- Main process
apps/desktop/src/main/index.ts - Chat service
apps/desktop/src/main/services/chat.ts - Agent loop
apps/desktop/src/main/services/agent-loop.ts - Model providers
apps/desktop/src/main/services/provider.ts - Subagents
apps/desktop/src/main/services/subagents.ts - Team members
apps/desktop/src/main/services/members.ts
Local state
- Conversation store
apps/desktop/src/main/services/chat-store.ts - Checkpoints
apps/desktop/src/main/services/checkpoints.ts - Configuration
apps/desktop/src/main/services/config.ts - Scheduled tasks
apps/desktop/src/main/services/tasks.ts
Agent capabilities
- Workspace tools
apps/desktop/src/main/services/workspace.ts - Built-in browser
apps/desktop/src/main/services/browser/host.ts - Skills and MCP
apps/desktop/src/main/services/skills.ts - Memory
apps/desktop/src/main/services/memory.ts - Git operations
apps/desktop/src/main/services/git.ts
Remote access
- Mobile client
apps/desktop/src/mobile/App.tsx - Remote server
apps/desktop/src/main/services/remote/web/server.ts - Remote protocol
apps/desktop/src/shared/remote-web.ts - Relay service
apps/relay-node/src/relay.ts - Feishu / Telegram
apps/desktop/src/main/services/remote/hub.ts
Other components
- User
Connections 24
- User → Chat interface: requests work
README.md - Chat interface → Chat state: sends messages
- Chat state → IPC bridge: invokes chat API
apps/desktop/src/renderer/src/store/chat.tsx - Main process → Chat service: registers service
apps/desktop/src/main/index.ts - Chat service → Conversation store: loads conversations
- Chat service → Agent loop: starts agent run
- Agent loop → Model providers: requests model output
- Agent loop → Subagents: delegates subtasks
- Agent loop → Team members: coordinates members
- Agent loop → Workspace tools: uses tools
- Agent loop → Built-in browser: uses browser
- Agent loop → Skills and MCP: uses extensions
- Agent loop → Memory: uses memory
- Agent loop → Git operations: uses Git tools
- Chat service → Checkpoints: supports rewind
- Scheduled tasks → Conversation store: binds task sessions
apps/desktop/src/main/services/chat-store.ts - User → Mobile client: continues on phone
README.md - Mobile client → Remote protocol: exchanges frames
apps/desktop/src/mobile/App.tsx - Remote server → Remote protocol: implements protocol
apps/desktop/src/main/services/remote/web/server.ts - Remote server → Conversation store: serves chat history
- User → Feishu / Telegram: messages remotely
README.md - User → Relay service: connects remotely
- Chat state → Scheduled tasks: mirrors task state
- Chat state → Configuration: reads preferences