Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
46 lines
1.3 KiB
Rust
46 lines
1.3 KiB
Rust
//! Observe the local session lock for one explicit realtime call, including its transport retries.
|
|
//!
|
|
//! Setup takes an initial snapshot before audio starts. Dropping the returned future unregisters
|
|
//! observation; there are no detached tasks or threads. Polling requires the TUI runtime to run.
|
|
|
|
use std::future::Future;
|
|
use std::pin::Pin;
|
|
|
|
#[cfg(target_os = "linux")]
|
|
mod linux;
|
|
#[cfg(target_os = "macos")]
|
|
mod macos;
|
|
#[cfg(windows)]
|
|
mod windows;
|
|
|
|
#[cfg(target_os = "macos")]
|
|
use macos::is_locked;
|
|
#[cfg(windows)]
|
|
use windows::is_locked;
|
|
|
|
pub(crate) type Activation = Pin<Box<dyn Future<Output = anyhow::Result<()>> + Send>>;
|
|
|
|
pub(crate) async fn observe() -> anyhow::Result<Activation> {
|
|
#[cfg(target_os = "linux")]
|
|
return linux::observe().await;
|
|
|
|
#[cfg(any(target_os = "macos", windows))]
|
|
{
|
|
let initially_locked = is_locked()?;
|
|
Ok(Box::pin(async move {
|
|
if initially_locked {
|
|
return Ok(());
|
|
}
|
|
loop {
|
|
tokio::time::sleep(std::time::Duration::from_millis(250)).await;
|
|
if is_locked()? {
|
|
return Ok(());
|
|
}
|
|
}
|
|
}))
|
|
}
|
|
|
|
#[cfg(not(any(target_os = "linux", target_os = "macos", windows)))]
|
|
Ok(Box::pin(std::future::pending()))
|
|
}
|