ai_env 0.1.3

Detect AI coding agent information from the environment.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::api::{self_id, AiAgent, AiEnvironment};
use crate::detect_network_policy;

// Replit (Agent / workspace) — sets REPL_ID. This marks the Replit
// environment, which may be human-driven as well as agent-driven.
pub fn create_environment() -> AiEnvironment {
    AiEnvironment {
        agent: AiAgent::Replit,
        env_prefix: Some("REPL_".into()),
        id: self_id(),
        network: detect_network_policy(AiAgent::Replit),
        sandboxed: false,
        session_id: None,
    }
}