agentsight 0.2.7

eBPF-based observability for AI agent sessions, prompts, process trees, files, network activity, and token usage.
// SPDX-License-Identifier: MIT
// Copyright (c) 2026 eunomia-bpf org.

use crate::framework::core::Event;
use async_trait::async_trait;
use futures::stream::Stream;
use std::pin::Pin;

/// Type alias for event streams
pub type EventStream = Pin<Box<dyn Stream<Item = Event> + Send>>;

/// Type alias for errors that can be sent between threads
pub type RunnerError = Box<dyn std::error::Error + Send + Sync>;

/// Base trait for all runners that collect observability data
#[async_trait]
pub trait Runner: Send + Sync {
    /// Run the data collection and return a stream of events
    async fn run(&mut self) -> Result<EventStream, RunnerError>;

    /// Add an analyzer to this runner's processing chain
    fn add_analyzer(self, analyzer: Box<dyn crate::framework::analyzers::Analyzer>) -> Self
    where
        Self: Sized;
}

pub mod agent; // Add agent runner for flexible composition
pub mod common;
#[cfg(test)]
pub mod fake; // Test-only fake runner (compiled only for tests)
pub mod process;
pub mod ssl;
pub mod stdio;
pub mod system; // Add system runner for CPU and memory monitoring

pub use agent::AgentRunner; // Export AgentRunner
#[cfg(test)]
pub use fake::FakeRunner; // Export FakeRunner (tests only)
pub use process::ProcessRunner;
pub use ssl::SslRunner;
pub use stdio::StdioRunner;
pub use system::SystemRunner; // Export SystemRunner