# aniruddha96/vizier-agent architecture

> Architecture diagram of the GitHub repository aniruddha96/vizier-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aniruddha96/vizier-agent
- Repository: https://github.com/aniruddha96/vizier-agent

## Overview

##### Main Components

a) Core Components:
- VizierDB (External System)
- Local Editor Interface
- File Watching System
- State Management System
- Directory Management System
- Stub Server Interface

b) Platform-Specific Components:
- Windows Editor Launcher
- Linux Editor Launcher
- Mac Editor Launcher

##### Component Relationships

a) Data Flow:
- VizierDB ↔ VizierBackendClient
- Stub Server ↔ VizierStubServerClient
- FileWatcher ↔ Local Files
- EditorLauncher ↔ Local Editor Instance

b) Dependencies:
- State Handler → FileWatcher
- EditorLauncher → Platform-specific implementations
- DirectoryInitializer → File System

##### Specific Implementation Details

Key architectural elements:

- VizierDB         |

- ↕

- VizierBackendClient |

- ↕

- Core Agent                 |

- StateHandler  |←→| FileWatcher     |   |

- DirInitializer|    | EditorLauncher |   |

- ↙     ↓     ↘     |

- Windows    | |Linux      | |Mac        | |
- Launcher   | |Launcher   | |Launcher   | |

- ↕

- Local File System   |

##### Additional Elements

- Configuration Components (mypy.ini, setup.cfg)
- Installation Paths for different platforms
- Error handling flows
- Startup sequence

##### Important Notes

- Separation between platform-independent and platform-specific code
- Event-driven nature of the file watching system
- State management flow
- Configuration file locations and their purpose
- Initialization sequence

##### Technical Details to Emphasize

- Java 8 runtime environment
- Python integration points (mypy)
- Cross-platform compatibility
- File system interaction points
- API integration points

Remember to emphasize the event-driven nature of the system, as it responds to both VizierDB requests and local file changes. The state management system plays a crucial role in coordinating these interactions, so its central position in the architecture should be clearly visible.

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Systems
    VizierDB[VizierDB]:::external
    StubServer[Stub Server]:::external

    %% Core Components
    subgraph CoreAgent["Core Agent Components"]
        VizierBackendClient["VizierDB Client"]:::core
        VizierStubClient["Stub Server Client"]:::core
        StateHandler["State Management"]:::core
        FileWatcher["File Watcher"]:::core
        DirInit["Directory Initializer"]:::core
        EditorLauncher["Editor Launcher Interface"]:::core
        MainApp["Main Application"]:::core
        Config["Constants & Config"]:::core
    end

    %% Platform-Specific Components
    subgraph PlatformLaunchers["Platform-Specific Components"]
        WindowsLauncher["Windows Launcher"]:::platform
        LinuxLauncher["Linux Launcher"]:::platform
        MacLauncher["Mac Launcher"]:::platform
    end

    %% Platform-Specific Installers
    subgraph Installers["Installation Components"]
        WindowsInstaller["Windows Installer"]:::installer
        MacInstaller["Mac Installer"]:::installer
        UbuntuInstaller["Ubuntu Installer"]:::installer
    end

    %% File System Layer
    FileSystem["Local File System"]:::filesystem
    LocalEditor["Local Editor Instance"]:::external

    %% Relationships
    VizierDB <--> VizierBackendClient
    StubServer <--> VizierStubClient
    StateHandler --> FileWatcher
    StateHandler --> DirInit
    FileWatcher --> FileSystem
    DirInit --> FileSystem
    
    EditorLauncher --> WindowsLauncher
    EditorLauncher --> LinuxLauncher
    EditorLauncher --> MacLauncher
    
    WindowsLauncher --> LocalEditor
    LinuxLauncher --> LocalEditor
    MacLauncher --> LocalEditor

    MainApp --> StateHandler
    MainApp --> VizierBackendClient
    MainApp --> VizierStubClient
    Config --> MainApp

    %% Click Events
    click VizierBackendClient "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/client/VizierBackendClient.java"
    click FileWatcher "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/agent/filewatcher/FileWatcher.java"
    click StateHandler "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/state/StateHandler.java"
    click DirInit "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/directory/DirectoryInitializer.java"
    click VizierStubClient "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/stub/client/VizierStubServerClient.java"
    click EditorLauncher "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/agent/editor/EditorLauncher.java"
    click WindowsLauncher "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/agent/editor/impl/WindowsEditorLauncher.java"
    click LinuxLauncher "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/agent/editor/impl/LinuxEditorLauncher.java"
    click MacLauncher "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/agent/editor/impl/MacEditorLauncher.java"
    click WindowsInstaller "https://github.com/aniruddha96/vizier-agent/tree/main/windows_installer"
    click MacInstaller "https://github.com/aniruddha96/vizier-agent/tree/main/mac_installer"
    click UbuntuInstaller "https://github.com/aniruddha96/vizier-agent/blob/main/ubuntu_agent_installer.sh"
    click Config "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/constants/VizierAgentConstants.java"
    click MainApp "https://github.com/aniruddha96/vizier-agent/blob/main/src/main/java/com/vizier/VizierAgent2Application.java"

    %% Styles
    classDef external fill:#gray,stroke:#333,stroke-width:2px
    classDef core fill:#blue,stroke:#333,stroke-width:2px
    classDef platform fill:#green,stroke:#333,stroke-width:2px
    classDef installer fill:#purple,stroke:#333,stroke-width:2px
    classDef filesystem fill:#orange,stroke:#333,stroke-width:2px
```
