a3s-code-core 3.3.0

A3S Code Core - Embeddable AI agent library with tool execution
Documentation

A3S Code Core Library

Harness-driven runtime for coding agents.

Agent and AgentSession are the primary 2.0 API. Lower-level session runtime state is internal; persistence data flows through store::SessionData.

Quick Start

use a3s_code_core::{Agent, AgentEvent};

# async fn run() -> anyhow::Result<()> {
// From an ACL-compatible config file path (.acl)
let agent = Agent::new("agent.acl").await?;

// Create a workspace-bound session
let session = agent.session("/my-project", None)?;

// Non-streaming
let result = session.send("What files handle auth?", None).await?;
println!("{}", result.text);

// Streaming (AgentEvent is #[non_exhaustive])
let (mut rx, _handle) = session.stream("Refactor auth", None).await?;
while let Some(event) = rx.recv().await {
    match event {
        AgentEvent::TextDelta { text } => print!("{text}"),
        AgentEvent::End { .. } => break,
        _ => {} // required: #[non_exhaustive]
    }
}
# Ok(())
# }

Disposable Workers

use a3s_code_core::{Agent, SessionOptions, WorkerAgentSpec};

# async fn run() -> anyhow::Result<()> {
let agent = Agent::new("agent.acl").await?;
let frontend = WorkerAgentSpec::implementer(
    "frontend-cow",
    "Small verified frontend fixes",
)
.with_model_ref("openai/gpt-4o")
.with_max_steps(24);

let session = agent.session(
    "/my-project",
    Some(SessionOptions::new().with_worker_agent(frontend)),
)?;
# Ok(())
# }

Architecture

Agent (config-driven facade)
  +-- AgentSession (workspace-bound execution API)
      +-- internal turn runner
      +-- ContextAssembler / ContextProvider
      +-- ToolSelector
      +-- ToolExecutor
      +-- ProgramExecutor (PTC)
      +-- SkillRegistry
      +-- Permission / confirmation
      +-- Trace / artifacts / verification evidence

Advanced infrastructure:
  +-- optional lane queues for explicit external/hybrid dispatch