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<()> {
let agent = Agent::new("agent.acl").await?;
let session = agent.session("/my-project", None)?;
let result = session.send("What files handle auth?", None).await?;
println!("{}", result.text);
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,
_ => {} }
}
# 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