feat(sdk,plugins): API publique d'accès fichiers/workspace + analyse structure (#124,#129)

This commit is contained in:
2026-08-02 13:34:54 +02:00
parent 033e9a86d5
commit dce61ae1aa
27 changed files with 5895 additions and 94 deletions

View File

@ -9,7 +9,9 @@
use async_trait::async_trait;
use tokio::process::Command;
use domain::ports::{ExitStatus, Output, ProcessError, ProcessSpawner, SpawnSpec};
use domain::ports::{
EnvironmentReader, ExitStatus, Output, ProcessError, ProcessSpawner, SpawnSpec,
};
/// Process spawner backed by the local OS via `tokio::process::Command`.
#[derive(Debug, Default, Clone, Copy)]
@ -23,6 +25,24 @@ impl LocalProcessSpawner {
}
}
/// Environment reader backed by the local process environment.
#[derive(Debug, Default, Clone, Copy)]
pub struct LocalEnvironmentReader;
impl LocalEnvironmentReader {
/// Creates a new [`LocalEnvironmentReader`].
#[must_use]
pub const fn new() -> Self {
Self
}
}
impl EnvironmentReader for LocalEnvironmentReader {
fn get(&self, name: &str) -> Option<String> {
std::env::var(name).ok()
}
}
#[async_trait]
impl ProcessSpawner for LocalProcessSpawner {
async fn run(&self, spec: SpawnSpec) -> Result<Output, ProcessError> {