> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeus.agentspro.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Zeus iOS Application

Zeus iOS brings AI Agent capabilities to your iPhone and iPad, built natively with SwiftUI.

## Overview

The iOS app provides a full-featured mobile experience with five main tabs:

| Tab            | Description                                    |
| -------------- | ---------------------------------------------- |
| **Sessions**   | View and manage AI conversation sessions       |
| **Chat**       | Real-time AI conversation with SSE streaming   |
| **Skills**     | Browse available agent skills                  |
| **Automation** | Manage scheduled tasks and automated workflows |
| **Me**         | Account settings, preferences, and profile     |

## Tech Stack

| Layer         | Technology                                             |
| ------------- | ------------------------------------------------------ |
| **Framework** | SwiftUI (iOS 16+)                                      |
| **Auth**      | WebView-based login + Keychain token storage           |
| **Streaming** | SSE (Server-Sent Events) for real-time agent responses |
| **State**     | ObservableObject + @StateObject pattern                |

## Architecture

```mermaid theme={null}
flowchart TD
    A["iOS App\nSwiftUI\nKeychain · SSE"]
    B["Zeus Web API\nNext.js API Routes\nAuth · Sessions · Skills"]
    C["AI Backend\nFastAPI\nAgent · SSE Streaming"]
    A -->|"HTTPS"| B
    A -->|"SSE Stream"| C
```

## Features

### Authentication

* Web-based auth flow via WKWebView (email/password, OAuth)
* Token management via iOS Keychain (secure storage)
* Dual-token mechanism: accessToken (1h) + refreshToken (30d)
* Automatic token refresh before expiry
* Navigation interception for seamless WebView-to-native auth handoff

### Sessions

* View conversation history with session list
* Create new sessions
* Resume previous conversations
* Cross-platform session sync with Web and Desktop

### Chat

* Real-time SSE streaming for agent responses
* Tool call display with structured results
* Voice input support

### Skills

* Browse all available agent skills
* View skill details, descriptions, and tags

### Automation

* View and manage scheduled tasks
* Monitor task execution status and history
* Push notifications for task completion

### Settings

* Account management (profile, email)
* Server configuration
* Legal pages (Terms of Service, Privacy Policy)

## Directory Structure

```
apps/ios/src/
├── app/
│   ├── api/                      # API clients
│   │   ├── MainAPI.swift          # Base API infrastructure
│   │   ├── AuthAPI.swift          # Authentication
│   │   ├── AgentAPI.swift         # Agent SSE streaming
│   │   ├── SandboxAPI.swift       # Sandbox management
│   │   ├── SessionAPI.swift       # Session management
│   │   ├── ScheduledTaskAPI.swift # Scheduled tasks
│   │   └── SkillAPI.swift         # Skills
│   └── pages/                    # Page views
│       ├── MainView.swift         # Entry + Tab navigation
│       ├── AuthView.swift         # Login (WebView)
│       ├── SessionView.swift      # Session list
│       ├── ChatView.swift         # Chat conversation
│       ├── AutomationView.swift   # Scheduled tasks
│       ├── SkillsView.swift       # Skills list
│       └── MeView.swift           # Profile & Settings
├── components/                   # Reusable SwiftUI components
├── db/
│   ├── schema/                   # Data structures (API mapping)
│   └── model/                    # CRUD operations (Keychain)
├── i18n/                         # Internationalization
│   └── Localizable.xcstrings     # Localized strings
├── lib/
│   ├── message-handler/          # SSE message processing
│   │   ├── MessageHandler.swift
│   │   ├── MessageHandler+Text.swift
│   │   ├── MessageHandler+ToolCall.swift
│   │   └── MessageHandler+ToolResult.swift
│   └── types/                    # Local types and enums
│       ├── AuthTypes.swift
│       ├── ChatTypes.swift
│       └── ToolIconTypes.swift
└── store/                        # State management
    ├── WorkspaceState.swift
    └── SpeechRecorder.swift
```

## System Requirements

* iOS 16.0 or later
* iPhone or iPad
