From 30cf3a6787ee6ab937e40bde7553959b9af287ba Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 23 Feb 2026 09:17:48 -0500 Subject: [PATCH] Rename coding-agent-loop crate to agent Co-Authored-By: Claude Opus 4.6 --- Cargo.lock | 56 ++++++++----------- .../{coding-agent-loop => agent}/Cargo.toml | 2 +- crates/{coding-agent-loop => agent}/README.md | 8 +-- .../src/config.rs | 0 .../{coding-agent-loop => agent}/src/error.rs | 0 .../{coding-agent-loop => agent}/src/event.rs | 0 .../src/execution_env.rs | 0 .../src/history.rs | 0 .../{coding-agent-loop => agent}/src/lib.rs | 0 .../src/local_env.rs | 0 .../src/loop_detection.rs | 0 .../src/profiles/anthropic.rs | 0 .../src/profiles/gemini.rs | 0 .../src/profiles/mod.rs | 0 .../src/profiles/openai.rs | 0 .../src/project_docs.rs | 0 .../src/provider_profile.rs | 0 .../src/session.rs | 0 .../src/subagent.rs | 0 .../src/test_support.rs | 0 .../src/tool_registry.rs | 0 .../{coding-agent-loop => agent}/src/tools.rs | 0 .../src/truncation.rs | 0 .../{coding-agent-loop => agent}/src/types.rs | 0 crates/attractor/Cargo.toml | 2 +- crates/attractor/src/cli/backend.rs | 4 +- docs/spec-structure.md | 6 +- docs/specs/README.md | 2 +- docs/specs/attractor-spec.md | 2 +- 29 files changed, 35 insertions(+), 47 deletions(-) rename crates/{coding-agent-loop => agent}/Cargo.toml (96%) rename crates/{coding-agent-loop => agent}/README.md (98%) rename crates/{coding-agent-loop => agent}/src/config.rs (100%) rename crates/{coding-agent-loop => agent}/src/error.rs (100%) rename crates/{coding-agent-loop => agent}/src/event.rs (100%) rename crates/{coding-agent-loop => agent}/src/execution_env.rs (100%) rename crates/{coding-agent-loop => agent}/src/history.rs (100%) rename crates/{coding-agent-loop => agent}/src/lib.rs (100%) rename crates/{coding-agent-loop => agent}/src/local_env.rs (100%) rename crates/{coding-agent-loop => agent}/src/loop_detection.rs (100%) rename crates/{coding-agent-loop => agent}/src/profiles/anthropic.rs (100%) rename crates/{coding-agent-loop => agent}/src/profiles/gemini.rs (100%) rename crates/{coding-agent-loop => agent}/src/profiles/mod.rs (100%) rename crates/{coding-agent-loop => agent}/src/profiles/openai.rs (100%) rename crates/{coding-agent-loop => agent}/src/project_docs.rs (100%) rename crates/{coding-agent-loop => agent}/src/provider_profile.rs (100%) rename crates/{coding-agent-loop => agent}/src/session.rs (100%) rename crates/{coding-agent-loop => agent}/src/subagent.rs (100%) rename crates/{coding-agent-loop => agent}/src/test_support.rs (100%) rename crates/{coding-agent-loop => agent}/src/tool_registry.rs (100%) rename crates/{coding-agent-loop => agent}/src/tools.rs (100%) rename crates/{coding-agent-loop => agent}/src/truncation.rs (100%) rename crates/{coding-agent-loop => agent}/src/types.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 6032e71c6..b8d25cf7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,24 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "agent" +version = "0.1.0" +dependencies = [ + "async-trait", + "chrono", + "futures", + "glob", + "jsonschema", + "libc", + "serde", + "serde_json", + "thiserror 2.0.18", + "tokio", + "unified-llm", + "uuid", +] + [[package]] name = "ahash" version = "0.8.12" @@ -132,12 +150,12 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" name = "attractor" version = "0.1.0" dependencies = [ + "agent", "anyhow", "async-trait", "axum", "chrono", "clap", - "coding-agent-loop", "dotenvy", "futures", "http-body-util", @@ -383,24 +401,6 @@ dependencies = [ "cc", ] -[[package]] -name = "coding-agent-loop" -version = "0.1.0" -dependencies = [ - "async-trait", - "chrono", - "futures", - "glob", - "jsonschema", - "libc", - "serde", - "serde_json", - "thiserror 2.0.18", - "tokio", - "unified-llm", - "uuid", -] - [[package]] name = "colorchoice" version = "1.0.4" @@ -2303,12 +2303,15 @@ name = "unified-llm" version = "0.1.0" dependencies = [ "anyhow", + "assert_cmd", "async-trait", "base64", "bytes", + "clap", "dotenvy", "futures", "http", + "predicates", "rand", "reqwest 0.12.28", "serde", @@ -2320,21 +2323,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "unified-llm-cli" -version = "0.1.0" -dependencies = [ - "anyhow", - "assert_cmd", - "clap", - "dotenvy", - "futures", - "predicates", - "serde_json", - "tokio", - "unified-llm", -] - [[package]] name = "untrusted" version = "0.9.0" diff --git a/crates/coding-agent-loop/Cargo.toml b/crates/agent/Cargo.toml similarity index 96% rename from crates/coding-agent-loop/Cargo.toml rename to crates/agent/Cargo.toml index 45812e73f..1bbfd422d 100644 --- a/crates/coding-agent-loop/Cargo.toml +++ b/crates/agent/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "coding-agent-loop" +name = "agent" edition.workspace = true version.workspace = true license.workspace = true diff --git a/crates/coding-agent-loop/README.md b/crates/agent/README.md similarity index 98% rename from crates/coding-agent-loop/README.md rename to crates/agent/README.md index ab1f2a084..33657f713 100644 --- a/crates/coding-agent-loop/README.md +++ b/crates/agent/README.md @@ -1,4 +1,4 @@ -# coding-agent-loop +# agent A programmable agentic loop for building coding agents. This crate provides the core session management, tool execution, and LLM interaction loop used to power interactive coding assistants. @@ -114,7 +114,7 @@ pub struct SessionConfig { ## Usage ```rust -use coding_agent_loop::{ +use agent::{ AnthropicProfile, LocalExecutionEnvironment, Session, SessionConfig, }; use std::path::PathBuf; @@ -183,7 +183,7 @@ abort_flag.store(true, std::sync::atomic::Ordering::SeqCst); Register additional tools via the profile's `ToolRegistry`: ```rust -use coding_agent_loop::tool_registry::{RegisteredTool, ToolExecutor}; +use agent::tool_registry::{RegisteredTool, ToolExecutor}; use unified_llm::types::ToolDefinition; use std::sync::Arc; @@ -216,7 +216,7 @@ profile.tool_registry_mut().register(custom_tool); Spawn child sessions for delegated tasks: ```rust -use coding_agent_loop::subagent::SubAgentManager; +use agent::subagent::SubAgentManager; let mut profile = AnthropicProfile::new("claude-sonnet-4-20250514"); let manager = Arc::new(tokio::sync::Mutex::new(SubAgentManager::new(3))); diff --git a/crates/coding-agent-loop/src/config.rs b/crates/agent/src/config.rs similarity index 100% rename from crates/coding-agent-loop/src/config.rs rename to crates/agent/src/config.rs diff --git a/crates/coding-agent-loop/src/error.rs b/crates/agent/src/error.rs similarity index 100% rename from crates/coding-agent-loop/src/error.rs rename to crates/agent/src/error.rs diff --git a/crates/coding-agent-loop/src/event.rs b/crates/agent/src/event.rs similarity index 100% rename from crates/coding-agent-loop/src/event.rs rename to crates/agent/src/event.rs diff --git a/crates/coding-agent-loop/src/execution_env.rs b/crates/agent/src/execution_env.rs similarity index 100% rename from crates/coding-agent-loop/src/execution_env.rs rename to crates/agent/src/execution_env.rs diff --git a/crates/coding-agent-loop/src/history.rs b/crates/agent/src/history.rs similarity index 100% rename from crates/coding-agent-loop/src/history.rs rename to crates/agent/src/history.rs diff --git a/crates/coding-agent-loop/src/lib.rs b/crates/agent/src/lib.rs similarity index 100% rename from crates/coding-agent-loop/src/lib.rs rename to crates/agent/src/lib.rs diff --git a/crates/coding-agent-loop/src/local_env.rs b/crates/agent/src/local_env.rs similarity index 100% rename from crates/coding-agent-loop/src/local_env.rs rename to crates/agent/src/local_env.rs diff --git a/crates/coding-agent-loop/src/loop_detection.rs b/crates/agent/src/loop_detection.rs similarity index 100% rename from crates/coding-agent-loop/src/loop_detection.rs rename to crates/agent/src/loop_detection.rs diff --git a/crates/coding-agent-loop/src/profiles/anthropic.rs b/crates/agent/src/profiles/anthropic.rs similarity index 100% rename from crates/coding-agent-loop/src/profiles/anthropic.rs rename to crates/agent/src/profiles/anthropic.rs diff --git a/crates/coding-agent-loop/src/profiles/gemini.rs b/crates/agent/src/profiles/gemini.rs similarity index 100% rename from crates/coding-agent-loop/src/profiles/gemini.rs rename to crates/agent/src/profiles/gemini.rs diff --git a/crates/coding-agent-loop/src/profiles/mod.rs b/crates/agent/src/profiles/mod.rs similarity index 100% rename from crates/coding-agent-loop/src/profiles/mod.rs rename to crates/agent/src/profiles/mod.rs diff --git a/crates/coding-agent-loop/src/profiles/openai.rs b/crates/agent/src/profiles/openai.rs similarity index 100% rename from crates/coding-agent-loop/src/profiles/openai.rs rename to crates/agent/src/profiles/openai.rs diff --git a/crates/coding-agent-loop/src/project_docs.rs b/crates/agent/src/project_docs.rs similarity index 100% rename from crates/coding-agent-loop/src/project_docs.rs rename to crates/agent/src/project_docs.rs diff --git a/crates/coding-agent-loop/src/provider_profile.rs b/crates/agent/src/provider_profile.rs similarity index 100% rename from crates/coding-agent-loop/src/provider_profile.rs rename to crates/agent/src/provider_profile.rs diff --git a/crates/coding-agent-loop/src/session.rs b/crates/agent/src/session.rs similarity index 100% rename from crates/coding-agent-loop/src/session.rs rename to crates/agent/src/session.rs diff --git a/crates/coding-agent-loop/src/subagent.rs b/crates/agent/src/subagent.rs similarity index 100% rename from crates/coding-agent-loop/src/subagent.rs rename to crates/agent/src/subagent.rs diff --git a/crates/coding-agent-loop/src/test_support.rs b/crates/agent/src/test_support.rs similarity index 100% rename from crates/coding-agent-loop/src/test_support.rs rename to crates/agent/src/test_support.rs diff --git a/crates/coding-agent-loop/src/tool_registry.rs b/crates/agent/src/tool_registry.rs similarity index 100% rename from crates/coding-agent-loop/src/tool_registry.rs rename to crates/agent/src/tool_registry.rs diff --git a/crates/coding-agent-loop/src/tools.rs b/crates/agent/src/tools.rs similarity index 100% rename from crates/coding-agent-loop/src/tools.rs rename to crates/agent/src/tools.rs diff --git a/crates/coding-agent-loop/src/truncation.rs b/crates/agent/src/truncation.rs similarity index 100% rename from crates/coding-agent-loop/src/truncation.rs rename to crates/agent/src/truncation.rs diff --git a/crates/coding-agent-loop/src/types.rs b/crates/agent/src/types.rs similarity index 100% rename from crates/coding-agent-loop/src/types.rs rename to crates/agent/src/types.rs diff --git a/crates/attractor/Cargo.toml b/crates/attractor/Cargo.toml index 1a043cd9a..66ded992f 100644 --- a/crates/attractor/Cargo.toml +++ b/crates/attractor/Cargo.toml @@ -21,7 +21,7 @@ server = ["axum", "tower", "tokio-stream"] clap.workspace = true anyhow.workspace = true dotenvy.workspace = true -coding-agent-loop = { path = "../coding-agent-loop" } +agent = { path = "../agent" } unified-llm = { path = "../unified-llm" } thiserror.workspace = true serde.workspace = true diff --git a/crates/attractor/src/cli/backend.rs b/crates/attractor/src/cli/backend.rs index 5c00bbb00..bfddd581a 100644 --- a/crates/attractor/src/cli/backend.rs +++ b/crates/attractor/src/cli/backend.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use async_trait::async_trait; -use coding_agent_loop::{ +use agent::{ AnthropicProfile, GeminiProfile, LocalExecutionEnvironment, OpenAiProfile, ProviderProfile, Session, SessionConfig, Turn, }; @@ -14,7 +14,7 @@ use crate::error::AttractorError; use crate::graph::Node; use crate::handler::codergen::{CodergenBackend, CodergenResult}; -/// LLM backend that delegates to a `coding-agent-loop` Session per invocation. +/// LLM backend that delegates to an `agent` Session per invocation. pub struct AgentBackend { model: String, provider: Option, diff --git a/docs/spec-structure.md b/docs/spec-structure.md index 4d9c5e3b3..ddd565fe6 100644 --- a/docs/spec-structure.md +++ b/docs/spec-structure.md @@ -1,6 +1,6 @@ # Spec Format Reference -Common format shared by `specs/unified-llm-spec.md`, `specs/coding-agent-loop-spec.md`, and `specs/attractor-spec.md`. +Common format shared by `specs/unified-llm-spec.md`, `specs/coding-agent-loop-spec.md` (agent crate), and `specs/attractor-spec.md`. --- @@ -38,7 +38,7 @@ An ASCII art box diagram showing the layers/components and how they connect. All ### 4.5 Relationship to Companion Specs -When the spec depends on another (coding-agent-loop depends on unified-llm; attractor depends on coding-agent-loop), it states this explicitly with the types it imports and how the layering works. +When the spec depends on another (agent depends on unified-llm; attractor depends on agent), it states this explicitly with the types it imports and how the layering works. ## 5. Core Technical Sections @@ -79,7 +79,7 @@ When a non-obvious choice is made, it's explained inline with **bold "Why..." qu ## 6. Out of Scope / Nice-to-Haves (optional) -A section explicitly listing features that are *intentionally excluded*, with an explanation of why each is out of scope and where in the architecture it could be added later. Prevents scope creep and signals extensibility points. (Present in coding-agent-loop-spec; not all specs include this.) +A section explicitly listing features that are *intentionally excluded*, with an explanation of why each is out of scope and where in the architecture it could be added later. Prevents scope creep and signals extensibility points. (Present in the agent spec; not all specs include this.) ## 7. Definition of Done diff --git a/docs/specs/README.md b/docs/specs/README.md index 83e35fcee..50b578930 100644 --- a/docs/specs/README.md +++ b/docs/specs/README.md @@ -7,7 +7,7 @@ Although bringing your own agentic loop and unified LLM SDK is not required to b ## Specs - [Attractor Specification](./attractor-spec.md) -- [Coding Agent Loop Specification](./coding-agent-loop-spec.md) +- [Agent Specification](./coding-agent-loop-spec.md) - [Unified LLM Client Specification](./unified-llm-spec.md) ## Building Attractor diff --git a/docs/specs/attractor-spec.md b/docs/specs/attractor-spec.md index 6b01db86b..58584362c 100644 --- a/docs/specs/attractor-spec.md +++ b/docs/specs/attractor-spec.md @@ -55,7 +55,7 @@ For reference on DOT syntax, see the Graphviz DOT language specification: https: Attractor defines the orchestration layer: graph definition, traversal, state management, and extensibility. It does NOT require any specific LLM integration. The codergen handler (Section 4.5) needs a way to call an LLM and get a response -- how you provide that is up to you. -The codergen handler takes a backend that conforms to the `CodergenBackend` interface (Section 4.5). What that backend does internally is entirely up to the implementor -- use the companion [Coding Agent Loop](./coding-agent-loop-spec.md) and [Unified LLM Client](./unified-llm-spec.md) specs, spawn CLI agents (Claude Code, Codex, Gemini CLI) in subprocesses, run agents in tmux panes with a manager attaching to them, call an LLM API directly, or anything else. The pipeline definition (the DOT file) does not change regardless of backend choice. +The codergen handler takes a backend that conforms to the `CodergenBackend` interface (Section 4.5). What that backend does internally is entirely up to the implementor -- use the companion [Agent](./coding-agent-loop-spec.md) and [Unified LLM Client](./unified-llm-spec.md) specs, spawn CLI agents (Claude Code, Codex, Gemini CLI) in subprocesses, run agents in tmux panes with a manager attaching to them, call an LLM API directly, or anything else. The pipeline definition (the DOT file) does not change regardless of backend choice. Attractor pipelines are driven by an event stream (Section 9.6). TUI, web, and IDE frontends consume events and submit human-in-the-loop answers. The pipeline engine is headless; the presentation layer is separate.