assistant_daemon 0.1.0

Daemon program for providing many features.
global [generator.rust.file = "src/generated.rs"]
global [generator.rust.uses = ("anyhow::Result")]
global [generator.rust.no_error_type = true]
global [generator.rust.async = true]
global [generator.rust.async_trait = true]


struct Feature {
    status: bool
}

struct Config {
    settings: FeatureSettings
    features: Features
    // global settings
    run_at_start_up?: bool
    detect_lidchange?: bool
}

struct Features {
    wp: Feature
}

struct FeatureSettings {
    wp: WpSetting
    sshpm: SshpmSetting



}

struct WpSetting {
    // Resolution: 3840(4k), 1920, 1366 
    res_w?: u32

    // market: en-US
    mkt?: string
}

struct SshpmSetting {
    // local port mappings
    lpmappings?: SshLocalPortMapping[]
}

struct SshLocalPortMapping {
    local_port: u32
    jump_host: string
    jump_host_port?: u32
    jump_host_user?: string
    jump_host_pwd?: string
    target_host: string
    target_host_user?: string
    target_host_pwd?: string
    target_host_port?: u32
    auto_connect?: bool
    auto_reconnect?: bool

    // target and jump host are sharing the same password
    same_pwd?: bool
}


usecase feature {
    toggleFeature {
        in {
            feature: string
        }

        out {
            status: bool
        }
    }

    getFeatures {
        out {
            features: Features
        }
    }

    getFeatureStatus {
        in {
            feature: string
        }
        out {
            status: bool
        }
    }

    updateConfig {
        in {
            config: Config
        }

        out {
            config: Config
        }
    }

    getConfig {
        out {
            config: Config
        }
    }
}

// Wallpaper usecase
// feature is automatically refresh wallpaper
usecase wallpaper {

   getWallpaper {
      in {
        res_w: u32
        mkt: string
      }
      out {
        id: string
        data: string
      }
   }

   setWallpaper {
        in {
            id: string
        }
   }
}

// SSH port mapping usecase
usecase sshpm {

}