Magi System Architecture Overview

Core Components

1. Magi.CLI (https://github.com/bobbyhiddn/Magi.CLI)

2. Magi.Spells (https://github.com/bobbyhiddn/Magi.Spells)

3. Magi.Chamber (https://github.com/bobbyhiddn/Magi.Chamber)

Deployment System

1. Zero-Trust Update Flow

2. Self-Hosting Options

Data Flow

1. Spell Updates

Developer → Magi.Spells → GitHub Actions → Chamber Webhook → Deployment

2. Spell Distribution

CLI ponder → Chamber API → Local .orb Cache → Installation → Execution

3. Development Flow

Local Development → Magi.Spells PR → Automated Tests → Merge → 
Chamber Webhook → Submodule Update → Auto-deploy

Local Environment

1. Configuration

2. Caching System

3. Development

Security

1. Zero-Trust Model

2. Deployment Security

3. User Security

Future Considerations

1. Planned Features

2. Scalability

3. Community

System Requirements

1. Server

2. Client

Diagram

sequenceDiagram
    participant Dev as Developer
    participant Spells as Magi.Spells
    participant Actions as GitHub Actions
    participant Chamber as Magi.Chamber
    participant CLI as Magi.CLI

    %% Update Flow Section
    note over Dev,CLI: <b>Complete Update Flow</b>

    Dev->>+Spells: Push changes
    Spells->>+Actions: Trigger workflow
    Actions->>+Chamber: POST /webhook with HMAC
    Chamber->>Chamber: Verify signature
    Chamber->>Spells: Git submodule update
    Chamber->>Chamber: Deploy changes

    %% Distribution Section
    note over CLI,Chamber: <b>Spell Distribution</b>

    CLI->>Chamber: GET /manifest
    Chamber-->>CLI: Return manifest with hashes

    alt New/Updated Spells Available
        CLI->>Chamber: GET /spells/<name>
        Chamber-->>CLI: Return spell source
        CLI->>CLI: Extract requirements
        CLI->>CLI: Prompt for install
        CLI->>CLI: Save to .orb cache
        CLI->>CLI: Install if approved
    else Spells Current
        CLI->>CLI: Use cached version
    end

    %% Security Sections
    note right of Chamber: <b>Security: Chamber</b>
    note right of Chamber:  HMAC verification
    note right of Chamber:  Hash validation
    note right of Chamber:  Automated sync

    note right of CLI: <b>Security: CLI</b>
    note right of CLI:  Dependency approval
    note right of CLI:  Hash verification
    note right of CLI:  Cache management