# suryaprakashrachamalla/aifeista architecture

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

- Interactive diagram: https://gitdiagram.com/suryaprakashrachamalla/aifeista
- Repository: https://github.com/suryaprakashrachamalla/aifeista

## Overview

Carnival is a desktop workspace for supervising AI coding agents and related workflows. The primary journey is to open a Studio, start an Act in a chosen mode, supervise agents and their tools, and inspect the resulting work; other major capabilities include live studio worlds, workspace tools and routines, remote handoff, interface mods, and a voice-and-pointer companion. README statements support the product-level links; source excerpts support selected internal calls. Several subsystems are represented by their enclosing directories because their implementation was not sampled.

Main entry points: [`crates/layer1-adapters/src/agent_manager.rs`](https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer1-adapters/src/agent_manager.rs) (Agent manager), [`companion/leanring-buddy/CompanionManager.swift`](https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/CompanionManager.swift) (Voice companion), [`runtime/apps/desktop/src/main.ts`](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/main.ts) (Desktop shell), [`runtime/packages/core/tools/src/pipeline.ts`](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/core/tools/src/pipeline.ts) (Orchestration modes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop workspace"]
  node_shell["Desktop shell<br/>[main.ts]"]
  node_backend["Backend lifecycle"]
  node_profile["Workspace profile<br/>[project-manager.ts]"]
  node_locale["Localization<br/>[locale.ts]"]
  node_update["Update coordination"]
  node_updateui["Update window"]
end

subgraph group_agents["Agent execution"]
  node_agentmanager["Agent manager<br/>[agent_manager.rs]"]
  node_orchestration["Orchestration modes<br/>[pipeline.ts]"]
  node_toolcontracts["Tool contracts<br/>[contracts.ts]"]
  node_schema["Tool schemas<br/>[json-schema.ts]"]
  node_remote["Remote handoff<br/>[remote_handoff.rs]"]
end

subgraph group_runtime["Runtime capabilities"]
  node_studio["Studios and Acts"]
  node_worlds["Studio worlds"]
  node_workspace["Workspace tools"]
  node_routines["Routines"]
  node_plugins["Plugins and mods<br/>[engine.ts]"]
end

subgraph group_safety["Persistence and safety"]
  node_timeline[("Session timeline")]
  node_sandbox["Sandbox and guards<br/>[lib.rs]"]
  node_watchdog["Adapter watchdog<br/>[lib.rs]"]
end

subgraph group_companion["Voice companion"]
  node_companion["Voice companion"]
  node_dictation["Speech capture"]
  node_panel["Companion panel"]
  node_screen["Screen capture"]
  node_pointer["Window positioning"]
  node_speechservice["Apple speech"]
end

node_user(("User"))
node_voiceuser(("Mac user"))

node_user -->|"opens and operates"| node_shell
node_shell -->|"starts backend"| node_backend
node_backend -->|"prepares profile"| node_profile
node_user -->|"starts an Act"| node_studio
node_studio -->|"runs agents"| node_agentmanager
node_agentmanager -.->|"invokes tools"| node_orchestration
node_orchestration -->|"uses contracts"| node_toolcontracts
node_orchestration -->|"validates schemas"| node_schema
node_agentmanager -->|"drives live scenes"| node_worlds
node_agentmanager -->|"uses workspace tools"| node_workspace
node_user -->|"schedules prompts"| node_routines
node_user -->|"reshapes interface"| node_plugins
node_agentmanager -->|"dispatches remote work"| node_remote
node_remote -->|"returns reviewable patch"| node_agentmanager
node_agentmanager -->|"persists sessions"| node_timeline
node_agentmanager -->|"runs within boundaries"| node_sandbox
node_sandbox -.->|"supports safe swaps"| node_watchdog
node_user -->|"holds push to talk"| node_companion
node_companion -->|"starts dictation"| node_dictation
node_dictation -->|"uses provider"| node_speechservice
node_companion -->|"presents controls"| node_panel
node_companion -->|"captures screen"| node_screen
node_companion -->|"positions overlay"| node_pointer
node_voiceuser -->|"asks aloud"| node_companion
node_shell -->|"resolves locale"| node_locale
node_shell -.->|"coordinates updates"| node_update
node_update -.->|"presents update"| node_updateui

click node_shell "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/main.ts"
click node_backend "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/backend-controller.ts"
click node_profile "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/project-manager.ts"
click node_locale "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/locale.ts"
click node_update "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/update-coordinator.ts"
click node_updateui "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/mandatory-update-window.ts"
click node_studio "https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/apps/desktop/src"
click node_agentmanager "https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer1-adapters/src/agent_manager.rs"
click node_orchestration "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/core/tools/src/pipeline.ts"
click node_toolcontracts "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/core/tools/src/contracts.ts"
click node_schema "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/core/tools/src/json-schema.ts"
click node_worlds "https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/apps/web/src"
click node_workspace "https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/packages"
click node_routines "https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/packages/schedule/schedule/src"
click node_plugins "https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/experimental/claude-code-mods/src/engine.ts"
click node_remote "https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer1-adapters/src/remote_handoff.rs"
click node_timeline "https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/packages/experimental/timeline/src"
click node_sandbox "https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer0-sandbox/src/lib.rs"
click node_watchdog "https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer0-watchdog/src/lib.rs"
click node_companion "https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/CompanionManager.swift"
click node_dictation "https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/BuddyDictationManager.swift"
click node_panel "https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/CompanionPanelView.swift"
click node_screen "https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/CompanionScreenCaptureUtility.swift"
click node_pointer "https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/WindowPositionManager.swift"
click node_speechservice "https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/AppleSpeechTranscriptionProvider.swift"

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_shell,node_backend,node_profile,node_locale,node_update,node_updateui,node_user,node_voiceuser toneBlue
class node_agentmanager,node_orchestration,node_toolcontracts,node_schema,node_remote toneAmber
class node_studio,node_worlds,node_workspace,node_routines,node_plugins toneMint
class node_timeline,node_sandbox,node_watchdog toneRose
class node_companion,node_dictation,node_panel,node_screen,node_pointer,node_speechservice toneIndigo
```

## Components

### Desktop workspace

- [Desktop shell](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/main.ts): `runtime/apps/desktop/src/main.ts`
- [Backend lifecycle](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/backend-controller.ts): `runtime/apps/desktop/src/backend-controller.ts`
- [Workspace profile](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/project-manager.ts): `runtime/apps/desktop/src/project-manager.ts`
- [Localization](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/locale.ts): `runtime/apps/desktop/src/locale.ts`
- [Update coordination](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/update-coordinator.ts): `runtime/apps/desktop/src/update-coordinator.ts`
- [Update window](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/apps/desktop/src/mandatory-update-window.ts): `runtime/apps/desktop/src/mandatory-update-window.ts`

### Agent execution

- [Agent manager](https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer1-adapters/src/agent_manager.rs): `crates/layer1-adapters/src/agent_manager.rs`
- [Orchestration modes](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/core/tools/src/pipeline.ts): `runtime/packages/core/tools/src/pipeline.ts`
- [Tool contracts](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/core/tools/src/contracts.ts): `runtime/packages/core/tools/src/contracts.ts`
- [Tool schemas](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/core/tools/src/json-schema.ts): `runtime/packages/core/tools/src/json-schema.ts`
- [Remote handoff](https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer1-adapters/src/remote_handoff.rs): `crates/layer1-adapters/src/remote_handoff.rs`

### Runtime capabilities

- [Studios and Acts](https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/apps/desktop/src): `runtime/apps/desktop/src`
- [Studio worlds](https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/apps/web/src): `runtime/apps/web/src`
- [Workspace tools](https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/packages): `runtime/packages`
- [Routines](https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/packages/schedule/schedule/src): `runtime/packages/schedule/schedule/src`
- [Plugins and mods](https://github.com/suryaprakashrachamalla/aifeista/blob/main/runtime/packages/experimental/claude-code-mods/src/engine.ts): `runtime/packages/experimental/claude-code-mods/src/engine.ts`

### Persistence and safety

- [Session timeline](https://github.com/suryaprakashrachamalla/aifeista/tree/main/runtime/packages/experimental/timeline/src): `runtime/packages/experimental/timeline/src`
- [Sandbox and guards](https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer0-sandbox/src/lib.rs): `crates/layer0-sandbox/src/lib.rs`
- [Adapter watchdog](https://github.com/suryaprakashrachamalla/aifeista/blob/main/crates/layer0-watchdog/src/lib.rs): `crates/layer0-watchdog/src/lib.rs`

### Voice companion

- [Voice companion](https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/CompanionManager.swift): `companion/leanring-buddy/CompanionManager.swift`
- [Speech capture](https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/BuddyDictationManager.swift): `companion/leanring-buddy/BuddyDictationManager.swift`
- [Companion panel](https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/CompanionPanelView.swift): `companion/leanring-buddy/CompanionPanelView.swift`
- [Screen capture](https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/CompanionScreenCaptureUtility.swift): `companion/leanring-buddy/CompanionScreenCaptureUtility.swift`
- [Window positioning](https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/WindowPositionManager.swift): `companion/leanring-buddy/WindowPositionManager.swift`
- [Apple speech](https://github.com/suryaprakashrachamalla/aifeista/blob/main/companion/leanring-buddy/AppleSpeechTranscriptionProvider.swift): `companion/leanring-buddy/AppleSpeechTranscriptionProvider.swift`

### Other components

- **User**
- **Mac user**

## Connections

- User → Desktop shell: opens and operates
- Desktop shell → Backend lifecycle: starts backend (evidence: `runtime/apps/desktop/src/main.ts`)
- Backend lifecycle → Workspace profile: prepares profile (evidence: `runtime/apps/desktop/src/backend-controller.ts`)
- User → Studios and Acts: starts an Act
- Studios and Acts → Agent manager: runs agents
- Agent manager → Orchestration modes: invokes tools
- Orchestration modes → Tool contracts: uses contracts (evidence: `runtime/packages/core/tools/src/pipeline.ts`)
- Orchestration modes → Tool schemas: validates schemas (evidence: `runtime/packages/core/tools/src/pipeline.ts`)
- Agent manager → Studio worlds: drives live scenes
- Agent manager → Workspace tools: uses workspace tools
- User → Routines: schedules prompts
- User → Plugins and mods: reshapes interface
- Agent manager → Remote handoff: dispatches remote work
- Remote handoff → Agent manager: returns reviewable patch
- Agent manager → Session timeline: persists sessions
- Agent manager → Sandbox and guards: runs within boundaries
- Sandbox and guards → Adapter watchdog: supports safe swaps
- User → Voice companion: holds push to talk
- Voice companion → Speech capture: starts dictation (evidence: `companion/leanring-buddy/CompanionManager.swift`)
- Speech capture → Apple speech: uses provider (evidence: `companion/leanring-buddy/BuddyDictationManager.swift`)
- Voice companion → Companion panel: presents controls (evidence: `companion/leanring-buddy/CompanionPanelView.swift`)
- Voice companion → Screen capture: captures screen (evidence: `companion/leanring-buddy/CompanionManager.swift`)
- Voice companion → Window positioning: positions overlay (evidence: `companion/leanring-buddy/CompanionManager.swift`)
- Mac user → Voice companion: asks aloud
- Desktop shell → Localization: resolves locale (evidence: `runtime/apps/desktop/src/main.ts`)
- Desktop shell → Update coordination: coordinates updates (evidence: `runtime/apps/desktop/src/main.ts`)
- Update coordination → Update window: presents update
