Files
imeai-aKode/akode-rs/tui/src/update_action.rs
andrea.difonzo f29b17c288 Rimosso il sistema di aggiornamento upstream: nessun update verso terzi (B)
Parte "sicurezza" di 9494b768 (senza il nuovo `akode update`, che e' una funzione di aKode):
- via il sottocomando `update`, il prompt di aggiornamento, il riquadro "Update available",
  la cache delle versioni e le azioni npm/pnpm/bun/brew/installer che eseguivano
  curl https://chatgpt.com/codex/install.sh (e il .ps1) o installavano @openai/codex;
- UpdateAction resta con la sola sostituzione del pacchetto del daemon locale;
- test rimossi solo perche' il codice che verificavano non c'e' piu'
  (risoluzione Windows del comando di update, parsing di `update`, update dei pacchetti
  fuori dal progetto).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 12:45:54 +01:00

26 lines
847 B
Rust

/// Update action the CLI should perform after the TUI exits.
///
/// aKode updates itself with `akode update`; the only action requested from the TUI is the
/// daemon package replacement chosen in the daemon menu.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum UpdateAction {
/// Replace the local daemon after restoring the terminal.
Daemon(DaemonUpdateSource),
}
/// Package source explicitly selected by the user in the daemon menu.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DaemonUpdateSource {
PublicStable,
ThisCli,
}
impl DaemonUpdateSource {
pub fn command_args(self) -> &'static [&'static str] {
match self {
Self::PublicStable => &["app-server", "daemon", "update"],
Self::ThisCli => &["app-server", "daemon", "update", "--from-cli", "--yes"],
}
}
}