aKode: comando akode update e avviso di nuova versione

- Nuovo crate akode-update: legge l'ultima release dal repository Gitea
  configurato ([update] repo_url, predefinito git.difonzo.net/andrea/aKode;
  404 = nessun aggiornamento), confronta la semver, scarica
  akode-<versione>-<target>.tar.gz solo dallo stesso host, verifica lo
  SHA-256 e sostituisce il binario in modo atomico tenendo akode.old
  (nel layout a pacchetto aggiorna anche akode-package.json o l'intero
  pacchetto).
- `akode update [--check]` con messaggi in italiano; mai installazioni
  automatiche.
- TUI: controllo in background all'avvio al massimo ogni 24 h
  (update-check.json in AKODE_HOME), avviso su una riga, disattivabile con
  [update] check_on_startup = false.
- Rimossi il prompt di aggiornamento e le azioni npm/brew/installer di
  OpenAI ormai inutilizzati; il doctor mostra sorgente e ultimo controllo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 14:56:25 +01:00
parent 25de1e70dc
commit 9494b768dd
37 changed files with 1485 additions and 1209 deletions

View File

@@ -7246,6 +7246,21 @@
},
"type": "object"
},
"UpdateConfigToml": {
"additionalProperties": false,
"description": "`[update]`: where `akode update` looks for releases and whether the TUI checks on startup.",
"properties": {
"check_on_startup": {
"description": "When `false`, the TUI never checks for a newer release on startup. Defaults to `true`.",
"type": "boolean"
},
"repo_url": {
"description": "Gitea repository URL (`https://host/owner/repo`) whose latest release is checked. Defaults to the public aKode repository.",
"type": "string"
}
},
"type": "object"
},
"UpdatePlanToolConfig": {
"additionalProperties": false,
"properties": {
@@ -8767,6 +8782,14 @@
],
"description": "Collection of settings that are specific to the TUI."
},
"update": {
"allOf": [
{
"$ref": "#/definitions/UpdateConfigToml"
}
],
"description": "Release source and startup check for `akode update`."
},
"web_search": {
"allOf": [
{

View File

@@ -1271,6 +1271,13 @@ pub struct Config {
/// Defaults to `true`.
pub check_for_update_on_startup: bool,
/// Gitea repository checked by `akode update` (`[update] repo_url`).
pub update_repo_url: String,
/// Whether the TUI checks for a newer aKode release on startup
/// (`[update] check_on_startup`, also off when `check_for_update_on_startup = false`).
pub update_check_on_startup: bool,
/// When true, disables burst-paste detection for typed input entirely.
/// All characters are inserted as they are received, and no buffering
/// or placeholder replacement will occur for fast keypress bursts.
@@ -4823,6 +4830,17 @@ impl Config {
active_project,
notices,
check_for_update_on_startup,
update_repo_url: cfg
.update
.as_ref()
.and_then(|update| update.repo_url.clone())
.unwrap_or_else(|| akode_config::types::DEFAULT_UPDATE_REPO_URL.to_string()),
update_check_on_startup: check_for_update_on_startup
&& cfg
.update
.as_ref()
.and_then(|update| update.check_on_startup)
.unwrap_or(true),
disable_paste_burst: cfg
.tui
.as_ref()