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>
26 lines
847 B
Rust
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"],
|
|
}
|
|
}
|
|
}
|