Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)
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>
This commit is contained in:
53
akode-rs/code-mode-host/tests/support/host.rs
Normal file
53
akode-rs/code-mode-host/tests/support/host.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
use std::process::Stdio;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Context;
|
||||
use anyhow::Result;
|
||||
use tokio::io::AsyncBufReadExt;
|
||||
use tokio::io::BufReader;
|
||||
use tokio::process::Child;
|
||||
use tokio::process::Command;
|
||||
use tokio::time::timeout;
|
||||
|
||||
pub(crate) struct HostHarness {
|
||||
pub(crate) _child: Child,
|
||||
pub(crate) endpoint: String,
|
||||
}
|
||||
|
||||
impl HostHarness {
|
||||
pub(crate) async fn start(listen_url: &str) -> Result<Self> {
|
||||
let host_program = akode_utils_cargo_bin::cargo_bin("akode-code-mode-host")?;
|
||||
let mut child = Command::new(host_program)
|
||||
.args(["--listen", listen_url])
|
||||
.stdin(Stdio::null())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
.kill_on_drop(/*kill_on_drop*/ true)
|
||||
.spawn()
|
||||
.context("failed to start code-mode host")?;
|
||||
let stdout = child
|
||||
.stdout
|
||||
.take()
|
||||
.context("code-mode host stdout was not captured")?;
|
||||
let endpoint = timeout(
|
||||
Duration::from_secs(/*secs*/ 10),
|
||||
BufReader::new(stdout).lines().next_line(),
|
||||
)
|
||||
.await
|
||||
.context("timed out waiting for code-mode host endpoint")??
|
||||
.context("code-mode host exited before publishing its endpoint")?;
|
||||
let expected_scheme = if listen_url.starts_with("grpc://") {
|
||||
"http"
|
||||
} else {
|
||||
"ws"
|
||||
};
|
||||
if !endpoint.starts_with(&format!("{expected_scheme}://127.0.0.1:")) {
|
||||
anyhow::bail!("unexpected code-mode host endpoint `{endpoint}`");
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
_child: child,
|
||||
endpoint,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user