aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 11:06:46 +01:00
parent df99318392
commit 86e7c72e5f
10383 changed files with 749164 additions and 749170 deletions

View File

@@ -0,0 +1,40 @@
//! Run an already prepared MXC request with inherited stdio and job ownership.
use anyhow::Context;
use anyhow::Result;
use anyhow::ensure;
use mxc_sdk::mxc_common::logger::Logger;
use mxc_sdk::mxc_common::logger::Mode;
use mxc_sdk::mxc_common::models::ExecutionRequest;
use mxc_sdk::mxc_common::sandbox_process::SandboxBackend;
use mxc_sdk::mxc_common::sandbox_process::StdioMode;
use mxc_sdk::process_container_common::base_container_runner::BaseContainerRunner;
// The ETW functions used by tracelogging are documented Advapi32 exports on
// both Windows toolchains; 1.2.3 leaves their import library to the application.
#[link(name = "advapi32")]
unsafe extern "system" {}
pub(super) fn launch(request: &ExecutionRequest) -> Result<i32> {
ensure!(
!request
.policy
.capabilities
.iter()
.any(|capability| capability.eq_ignore_ascii_case("permissiveLearningMode")),
"MXC native launch does not support permissiveLearningMode"
);
if !request.policy.denied_paths.is_empty() {
ensure!(
BaseContainerRunner::supports_native_denied_paths(),
"this Windows build cannot enforce native MXC deny paths"
);
}
let mut logger = Logger::new(Mode::Buffer);
let mut child = BaseContainerRunner::new()
.spawn(request, &mut logger, StdioMode::Inherit)
.map_err(|error| anyhow::anyhow!("{}", error.error_message))?;
// Do not publish the SDK diagnostic buffer: it may contain command or
// environment data. This wrapper emits only the resulting launch error.
child.wait().context("waiting for the MXC command")
}