Skip to content

[Linux] Data models — Manifest, AgentVariant, Settings #131

@2witstudios

Description

@2witstudios

Overview

Implement Rust data models that mirror the ppg-cli TypeScript manifest types exactly, plus agent variant definitions and app settings.

Models to Implement

manifest.rs

Mirror src/types/manifest.ts:

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Manifest {
    pub version: u32,
    #[serde(rename = "projectRoot")]
    pub project_root: String,
    #[serde(rename = "sessionName")]
    pub session_name: String,
    pub worktrees: HashMap<String, WorktreeEntry>,
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "updatedAt")]
    pub updated_at: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorktreeEntry {
    pub id: String,
    pub name: String,
    pub path: String,
    pub branch: String,
    #[serde(rename = "baseBranch")]
    pub base_branch: String,
    pub status: WorktreeStatus,
    #[serde(rename = "tmuxWindow")]
    pub tmux_window: String,
    #[serde(rename = "prUrl")]
    pub pr_url: Option<String>,
    pub agents: HashMap<String, AgentEntry>,
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "mergedAt")]
    pub merged_at: Option<String>,
}

// ... AgentEntry, AgentStatus, WorktreeStatus enums

agent_variant.rs

Mirror PPG CLI/PPG CLI/AgentVariant.swift:

  • Claude: claude --dangerously-skip-permissions, positional arg prompt
  • Codex: codex --full-auto, positional arg prompt
  • OpenCode: opencode, send-keys prompt delivery
  • Terminal: shell session, send-keys
  • Worktree: no prompt delivery

settings.rs

Mirror PPG CLI/PPG CLI/AppSettingsManager.swift:

  • refresh_interval: f64 (default 2.0s)
  • terminal_font: String (default "Monospace")
  • terminal_font_size: f64 (default 13.0)
  • shell: String (default "/bin/zsh")
  • history_limit: u32 (default 50000)
  • appearance: AppearanceMode (System/Light/Dark)
  • Persisted to XDG config dir (~/.config/ppg-desktop/settings.json)

Acceptance Criteria

  • All models deserialize correctly from ppg manifest JSON
  • Unit tests verify round-trip serialization
  • AgentStatus and WorktreeStatus enums handle all variants including aliases (idle→running, exited→completed, gone→lost)
  • Settings load/save to XDG config directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions