# ikarosgit/ikrs-workspace architecture

> Architecture diagram of the GitHub repository ikarosgit/ikrs-workspace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ikarosgit/ikrs-workspace
- Repository: https://github.com/ikarosgit/ikrs-workspace

## Overview

1. **Product boundary**
   - IKAROS Workspace is a cross-platform desktop app built with **Tauri 2 + React 19 + TypeScript** on the outside, and **Rust** on the inside.
   - The app is primarily a local operator console for consultants: chat with Claude, manage client context, sync workspace data, and surface productivity/manager visibility.

2. **Frontend shell and user surfaces**
   - The React app is organized around a small set of major views: **Chat, Calendar, Inbox, Notes, Tasks, Files, Settings**.
   - The layout layer (`SideRail`, `Toolbar`, `StatusBar`, `EngagementSwitcher`) frames those views, while feature components handle task drawers, email compose, meeting prep, heartbeat status, and session details.

3. **Client state and orchestration in the UI**
   - Application state is concentrated in Zustand stores such as `claudeStore`, `taskStore`, `engagementStore`, `mcpStore`, `uiStore`, and `costLedgerStore`.
   - Hooks like `useClaudeStream`, `useWorkspaceSession`, `useCalendar`, `useGmail`, and `useDrive` bridge the UI to backend commands and long-lived session state.
   - This makes the frontend mostly a coordinator and renderer, not the source of truth for integrations.

4. **Tauri backend as the integration boundary**
   - The Rust side is the real control plane: it exposes Tauri commands for **calendar sync, Gmail sync, Drive sync, notes sync, task watching, vault access, OAuth, credentials, heartbeat, and memory operations**.
   - The command layer is what the React app actually invokes; it encapsulates OS access, process spawning, file operations, and networked auth flows.
   - This is the main boundary between the user-facing UI and all external systems.

5. **Embedded Claude subsystem**
   - Claude Code is not embedded as a library; it is spawned as a **subprocess per engagement**.
   - The Rust `claude` module family handles **binary resolution, auth, session management, MCP config generation, registry tracking, stream parsing, and command execution**.
   - The frontend talks to this subsystem through streaming hooks and stores, while the backend manages the lifecycle and wiring.

6. **MCP and engagement-specific tools**
   - Each engagement gets its own generated **MCP configuration** so Claude can reach the right toolset for that client.
   - The tool boundary includes **Gmail, Google Calendar, Google Drive, and Obsidian**, with per-engagement isolation rather than a single global integration context.
   - This is the key architectural choice that lets one desktop app serve multiple client workspaces safely.

7. **Authentication and token handling**
   - There are two distinct identity layers:
     - **IKAROS identity** via **Firebase** for app/workspace identity and cross-device metadata.
     - **Per-engagement Google OAuth** using **PKCE**, designed as a public desktop client flow.
   - Tokens are protected by the **OS keychain** on the desktop side, with a Firestore-based token cache/sync path used for multi-device or migration scenarios.
   - The auth code is split across `oauth`, `token_cache`, `token_refresh`, `redirect_server`, `identity_server`, and related modules.

8. **Storage and sync boundaries**
   - **Firestore** is the remote metadata plane: app state, cross-device sync, and schema-backed records.
   - The **local filesystem** holds Obsidian vaults and other workspace files.
   - The repo also includes `operations/` content, which acts like local working memory for prompts, identity, recent context, and right-hand automation.

9. **Heartbeat and background automation**
   - There is a second subsystem named **heartbeat** in `heartbeat/`, implemented as a separate Python package with scripts, tests, and **systemd** units for VM deployment.
   - That service collects signals from sources like **Gmail, Calendar, Vault, Firestore tokens, and state**, then dispatches outputs to destinations such as **Firestore, Telegram, audit logs, and secrets**.
   - This is the autonomous/background side of the system, distinct from the interactive desktop app, and it feeds the “right-hand” style workflows.

10. **Desktop automation and assistant workflows**
   - The app includes a memory/skills layer on the Rust and React sides (`skills`, `memory_cmd`, `briefing`, `task-parser`, `mcp-utils`) that supports structured assistant actions, not just freeform chat.
   - The UI exposes this through task boards, skill status panels, and chat session controls, making the assistant feel like an operational workspace rather than a plain chat client.

11. **Operational and release infrastructure**
   - The repository is built for **macOS first**, with Windows/Linux supported, and includes ad-hoc signing for local use plus Tauri updater signing for release readiness.
   - CI enforces architectural governance through documentation checks, tests, and release/security workflows.
   - The repo is heavily doc-driven: `docs/ECOSYSTEM.md` is the canonical architecture reference, and phase/spec docs track the evolution of each subsystem.

12. **How to draw the architecture**
   - A good diagram should show:
     - **React UI** on the left,
     - **Tauri/Rust command layer** in the middle,
     - **Claude subprocess + MCP tool layer** as one branch,
     - **OAuth/keychain/Firestore/OS filesystem** as external dependencies,
     - and a separate **heartbeat VM service** as an asynchronous background system.
   - The central theme is: **desktop orchestration + embedded agent runtime + per-engagement integrations + remote metadata sync**.

Main entry points: [`src-tauri/src/commands`](https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/commands) (Command API), [`src/App.tsx`](https://github.com/ikarosgit/ikrs-workspace/blob/main/src/App.tsx) (UI shell), [`src-tauri/src/commands/vault.rs`](https://github.com/ikarosgit/ikrs-workspace/blob/main/src-tauri/src/commands/vault.rs) (Sync + storage), [`heartbeat/src/heartbeat/outputs`](https://github.com/ikarosgit/ikrs-workspace/tree/main/heartbeat/src/heartbeat/outputs) (Signal outputs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_ui_shell["UI shell<br/>React desktop shell<br/>[App.tsx]"]
  node_layout_frame["Layout frame<br/>Shell layout"]
  node_feature_views["Work views<br/>Workspace views"]
  node_ui_state["UI stores<br/>Zustand state"]
  node_ui_hooks["Bridge hooks<br/>React hooks"]
  node_assistant_panels["Assistant panels<br/>Feature widgets"]
  node_react_bridge["Bridge libs<br/>Frontend integration"]
end

subgraph group_backend["Rust backend"]
  node_command_api["Command API<br/>Tauri commands"]
  node_claude_runtime["Claude runtime<br/>Subprocess orchestration"]
  node_mcp_wiring["MCP wiring<br/>Tool config<br/>[mcp_config.rs]"]
  node_oauth_identity["Auth layer<br/>OAuth + identity"]
  node_sync_storage["Sync + storage<br/>Filesystem/remote sync<br/>[vault.rs]"]
  node_skills_memory["Skills + memory<br/>Assistant workflow layer"]
end

subgraph group_heartbeat["Heartbeat service"]
  node_heartbeat_app["Heartbeat app<br/>Python service"]
  node_heartbeat_signals["Signal collectors<br/>Heartbeat inputs"]
  node_heartbeat_outputs["Signal outputs<br/>Heartbeat outputs"]
end

subgraph group_ops["Operations memory"]
  node_workspace_files["Workspace files<br/>Local content"]
end

subgraph group_external["External systems"]
  node_firebase_firestore[("Firebase/Firestore<br/>Remote metadata")]
  node_google_apis[("Google APIs<br/>Workspace integrations")]
  node_os_boundaries["OS boundaries<br/>Desktop platform"]
end

node_ui_shell -->|"frames"| node_layout_frame
node_ui_shell -->|"routes to"| node_feature_views
node_ui_shell -->|"reads state"| node_ui_state
node_ui_shell -->|"uses hooks"| node_ui_hooks
node_feature_views -->|"shows panels"| node_assistant_panels
node_ui_hooks -->|"calls"| node_react_bridge
node_react_bridge -->|"invokes"| node_command_api
node_ui_state -->|"streams"| node_claude_runtime
node_command_api -->|"controls"| node_claude_runtime
node_claude_runtime -->|"loads tools"| node_mcp_wiring
node_mcp_wiring -->|"binds to"| node_google_apis
node_command_api -->|"authenticates"| node_oauth_identity
node_oauth_identity -->|"syncs identity"| node_firebase_firestore
node_oauth_identity -->|"uses keychain"| node_os_boundaries
node_command_api -->|"syncs data"| node_sync_storage
node_sync_storage -->|"writes metadata"| node_firebase_firestore
node_sync_storage -->|"syncs services"| node_google_apis
node_sync_storage -->|"accesses files"| node_os_boundaries
node_command_api -->|"executes"| node_skills_memory
node_skills_memory -->|"reads/writes"| node_workspace_files
node_heartbeat_app -->|"collects"| node_heartbeat_signals
node_heartbeat_app -->|"dispatches"| node_heartbeat_outputs
node_heartbeat_signals -->|"reads"| node_google_apis
node_heartbeat_signals -->|"reads tokens"| node_firebase_firestore
node_heartbeat_outputs -->|"publishes"| node_firebase_firestore
node_heartbeat_outputs -->|"uses secrets"| node_os_boundaries
node_heartbeat_outputs -->|"logs context"| node_workspace_files

click node_ui_shell "https://github.com/ikarosgit/ikrs-workspace/blob/main/src/App.tsx"
click node_layout_frame "https://github.com/ikarosgit/ikrs-workspace/tree/main/src/components/layout"
click node_feature_views "https://github.com/ikarosgit/ikrs-workspace/tree/main/src/views"
click node_ui_state "https://github.com/ikarosgit/ikrs-workspace/tree/main/src/stores"
click node_ui_hooks "https://github.com/ikarosgit/ikrs-workspace/tree/main/src/hooks"
click node_assistant_panels "https://github.com/ikarosgit/ikrs-workspace/tree/main/src/components"
click node_command_api "https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/commands"
click node_claude_runtime "https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/claude"
click node_mcp_wiring "https://github.com/ikarosgit/ikrs-workspace/blob/main/src-tauri/src/claude/mcp_config.rs"
click node_oauth_identity "https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/oauth"
click node_sync_storage "https://github.com/ikarosgit/ikrs-workspace/blob/main/src-tauri/src/commands/vault.rs"
click node_skills_memory "https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/skills"
click node_react_bridge "https://github.com/ikarosgit/ikrs-workspace/tree/main/src/lib"
click node_workspace_files "https://github.com/ikarosgit/ikrs-workspace/tree/main/operations"
click node_heartbeat_app "https://github.com/ikarosgit/ikrs-workspace/tree/main/heartbeat/src/heartbeat"
click node_heartbeat_signals "https://github.com/ikarosgit/ikrs-workspace/tree/main/heartbeat/src/heartbeat/signals"
click node_heartbeat_outputs "https://github.com/ikarosgit/ikrs-workspace/tree/main/heartbeat/src/heartbeat/outputs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui_shell,node_layout_frame,node_feature_views,node_ui_state,node_ui_hooks,node_assistant_panels,node_react_bridge toneBlue
class node_command_api,node_claude_runtime,node_mcp_wiring,node_oauth_identity,node_sync_storage,node_skills_memory toneAmber
class node_heartbeat_app,node_heartbeat_signals,node_heartbeat_outputs toneMint
class node_workspace_files toneRose
class node_firebase_firestore,node_google_apis,node_os_boundaries toneIndigo
```

## Components

### Desktop app

Tauri + React workspace for interactive consultant operations.

- [UI shell](https://github.com/ikarosgit/ikrs-workspace/blob/main/src/App.tsx): React desktop shell · App routing, layout, and major views for chat, calendar, inbox, notes, tasks, files, and settings. · `src/App.tsx`
- [Layout frame](https://github.com/ikarosgit/ikrs-workspace/tree/main/src/components/layout): Shell layout · Side rail, toolbar, status bar, engagement switcher, and related framing components. · `src/components/layout`
- [Work views](https://github.com/ikarosgit/ikrs-workspace/tree/main/src/views): Workspace views · Primary user surfaces for chat, calendar, inbox, notes, tasks, and files. · `src/views`
- [UI stores](https://github.com/ikarosgit/ikrs-workspace/tree/main/src/stores): Zustand state · Client-side orchestration stores for Claude, tasks, engagements, MCP, UI, and cost ledger state. · `src/stores`
- [Bridge hooks](https://github.com/ikarosgit/ikrs-workspace/tree/main/src/hooks): React hooks · Hooks that connect the UI to backend commands and session streams. · `src/hooks`
- [Assistant panels](https://github.com/ikarosgit/ikrs-workspace/tree/main/src/components): Feature widgets · Session details, tool activity, task drawers, compose flows, skill status, and heartbeat status panels. · `src/components`
- [Bridge libs](https://github.com/ikarosgit/ikrs-workspace/tree/main/src/lib): Frontend integration · Frontend command wrappers, Firebase client, Firestore token helpers, MCP utilities, schemas, and briefing helpers. · `src/lib`

### Rust backend

Command layer, Claude runtime, auth, storage, and sync boundaries.

- [Command API](https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/commands): Tauri commands · Desktop command boundary for sync, vault, OAuth, heartbeat, memory, and task watching operations. · `src-tauri/src/commands`
- [Claude runtime](https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/claude): Subprocess orchestration · Spawns and manages Claude Code per engagement, including auth, sessions, registry, parsing, and execution. · `src-tauri/src/claude`
- [MCP wiring](https://github.com/ikarosgit/ikrs-workspace/blob/main/src-tauri/src/claude/mcp_config.rs): Tool config · Generates per-engagement MCP configuration and tool access for external integrations. · `src-tauri/src/claude/mcp_config.rs`
- [Auth layer](https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/oauth): OAuth + identity · PKCE OAuth, redirect handling, identity server, token cache, refresh, and keychain-adjacent token flow. · `src-tauri/src/oauth`
- [Sync + storage](https://github.com/ikarosgit/ikrs-workspace/blob/main/src-tauri/src/commands/vault.rs): Filesystem/remote sync · Workspace data boundaries for notes, files, vault access, Firestore metadata, and credential handling. · `src-tauri/src/commands/vault.rs`
- [Skills + memory](https://github.com/ikarosgit/ikrs-workspace/tree/main/src-tauri/src/skills): Assistant workflow layer · Structured assistant actions, memory commands, briefing, task parsing, and skill scaffolding/sync. · `src-tauri/src/skills`

### Heartbeat service

Separate Python background system for autonomous signal collection and dispatch.

- [Heartbeat app](https://github.com/ikarosgit/ikrs-workspace/tree/main/heartbeat/src/heartbeat): Python service · Separate autonomous background package with collector, tick loop, outputs, and deployment scripts. · `heartbeat/src/heartbeat`
- [Signal collectors](https://github.com/ikarosgit/ikrs-workspace/tree/main/heartbeat/src/heartbeat/signals): Heartbeat inputs · Collects signals from Gmail, Calendar, Vault, Firestore tokens, Google auth, and state. · `heartbeat/src/heartbeat/signals`
- [Signal outputs](https://github.com/ikarosgit/ikrs-workspace/tree/main/heartbeat/src/heartbeat/outputs): Heartbeat outputs · Dispatches actions to Firestore, Telegram, audit logs, and secrets destinations. · `heartbeat/src/heartbeat/outputs`

### Operations memory

Local working memory, prompts, and right-hand automation content.

- [Workspace files](https://github.com/ikarosgit/ikrs-workspace/tree/main/operations): Local content · Operations memory, prompts, drafts, and right-hand material used as local working context. · `operations`

### External systems

Remote services and local OS boundaries used by the workspace.

- **Firebase/Firestore**: Remote metadata · IKAROS identity, workspace metadata, schema-backed records, and cross-device sync plane.
- **Google APIs**: Workspace integrations · Calendar, Gmail, Drive, and OAuth-backed per-engagement Google services.
- **OS boundaries**: Desktop platform · Keychain, filesystem, subprocesses, systemd, and desktop OS capabilities used by the app.

## Connections

- UI shell → Layout frame: frames · The shell composes the shared layout chrome around all major views.
- UI shell → Work views: routes to · Routes user interaction into the main workspace views.
- UI shell → UI stores: reads state · Views are driven by client stores for engagement, tasks, Claude, and UI state.
- UI shell → Bridge hooks: uses hooks · The shell and views use hooks to connect to backend commands and streaming session state.
- Work views → Assistant panels: shows panels · Views expose task drawers, session details, compose flows, skill status, and heartbeat status.
- Bridge hooks → Bridge libs: calls · Hooks delegate to frontend wrappers around Tauri commands and shared helpers.
- Bridge libs → Command API: invokes · Frontend integration ultimately calls into the Rust command boundary.
- UI stores → Claude runtime: streams · Claude-related stores track session state, streaming output, and engagement context.
- Command API → Claude runtime: controls · The command layer launches and manages the embedded Claude subprocesses.
- Claude runtime → MCP wiring: loads tools · Claude sessions receive generated per-engagement MCP configuration.
- MCP wiring → Google APIs: binds to · MCP toolsets expose Gmail, Calendar, Drive, and other client integrations.
- Command API → Auth layer: authenticates · Commands expose OAuth and identity flows to the desktop app.
- Auth layer → Firebase/Firestore: syncs identity · IKAROS identity and token cache paths rely on Firebase and Firestore.
- Auth layer → OS boundaries: uses keychain · Tokens are protected through OS-specific secure storage and local redirect servers.
- Command API → Sync + storage: syncs data · The Rust backend handles calendar, Gmail, Drive, notes, vault, credentials, and task watching.
- Sync + storage → Firebase/Firestore: writes metadata · Remote metadata and cross-device records are stored in Firestore.
- Sync + storage → Google APIs: syncs services · Workspace sync flows reach Google Calendar, Gmail, and Drive.
- Sync + storage → OS boundaries: accesses files · Vault and local workspace file operations use the desktop filesystem.
- Command API → Skills + memory: executes · The backend exposes memory and skill-oriented commands for assistant workflows.
- Skills + memory → Workspace files: reads/writes · Structured memory and right-hand content live in the operations workspace.
- Heartbeat app → Signal collectors: collects · The background service gathers signals from external sources and local state.
- Heartbeat app → Signal outputs: dispatches · Collected signals are turned into outputs and side effects.
- Signal collectors → Google APIs: reads · Heartbeat can inspect Gmail and Calendar sources through Google integrations.
- Signal collectors → Firebase/Firestore: reads tokens · Token and state signals are pulled from Firestore-backed storage.
- Signal outputs → Firebase/Firestore: publishes · Outputs may be written back to Firestore for sync and auditability.
- Signal outputs → OS boundaries: uses secrets · The service can write logs, secrets, and integrate with systemd-managed deployment.
- Signal outputs → Workspace files: logs context · Audit and right-hand artifacts connect the autonomous service back to local working memory.
