Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,8 @@ cython_debug/
.ai_slop/
# Ignore obsolete agent_nodes directory
src/agent_nodes/
checkpoints/
checkpoints/

# TreeAgent graph cache (keep directory structure only)
.treeagent_cache/graphs/*
!.treeagent_cache/graphs/.gitkeep
Empty file.
41 changes: 41 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[workspace]
members = [
"crates/treeagent",
"crates/treeagentc",
"crates/treeagent-runtime",
"crates/treeagent-model",
]
resolver = "2"

[workspace.package]
authors = ["TreeAgent Developers"]
edition = "2021"
license = "MIT"
version = "0.1.0"

[workspace.dependencies]
anyhow = "1.0"
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
.PHONY: swe-sanity swe-one
.PHONY: swe-build swe-check swe-test swe-sanity swe-one
INSTANCE ?= sympy__sympy-20590
DATASET ?= princeton-nlp/SWE-bench_Lite

swe-build:
cargo build --workspace

swe-check:
cargo check --workspace

swe-test:
cargo test --workspace

swe-sanity:
python -m pip install -q swebench
treeagent-swebench sanity --dataset $(DATASET) --instance-id $(INSTANCE) --namespace ''
Expand Down
9 changes: 9 additions & 0 deletions crates/treeagent-model/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "treeagent-model"
authors.workspace = true
edition.workspace = true
license.workspace = true
version.workspace = true

[dependencies]
anyhow.workspace = true
25 changes: 25 additions & 0 deletions crates/treeagent-model/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct GraphSpec {
name: String,
}

impl GraphSpec {
pub fn new(name: impl Into<String>) -> Self {
Self { name: name.into() }
}

pub fn name(&self) -> &str {
&self.name
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn stores_name() {
let spec = GraphSpec::new("example");
assert_eq!(spec.name(), "example");
}
}
10 changes: 10 additions & 0 deletions crates/treeagent-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "treeagent-runtime"
authors.workspace = true
edition.workspace = true
license.workspace = true
version.workspace = true

[dependencies]
anyhow.workspace = true
treeagent-model = { path = "../treeagent-model" }
35 changes: 35 additions & 0 deletions crates/treeagent-runtime/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
use treeagent_model::GraphSpec;

#[derive(Debug, Default, Clone)]
pub struct WorkspaceRuntime {
graph_spec: GraphSpec,
}

impl WorkspaceRuntime {
pub fn new(name: impl Into<String>) -> Self {
Self {
graph_spec: GraphSpec::new(name),
}
}

pub fn summary(&self) -> String {
format!("TreeAgent runtime initialized for graph '{}'", self.graph_spec.name())
}

pub fn print_summary(&self) -> anyhow::Result<()> {
println!("{}", self.summary());
Ok(())
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn summary_mentions_runtime() {
let runtime = WorkspaceRuntime::new("demo");
let summary = runtime.summary();
assert!(summary.contains("TreeAgent runtime initialized for graph 'demo'"));
}
}
11 changes: 11 additions & 0 deletions crates/treeagent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "treeagent"
authors.workspace = true
edition.workspace = true
license.workspace = true
version.workspace = true

[dependencies]
anyhow.workspace = true
treeagent-runtime = { path = "../treeagent-runtime" }
treeagent-model = { path = "../treeagent-model" }
20 changes: 20 additions & 0 deletions crates/treeagent/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use treeagent_runtime::WorkspaceRuntime;

fn main() {
let runtime = WorkspaceRuntime::default();
runtime
.print_summary()
.expect("failed to start the TreeAgent runtime");
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn runtime_runs() {
let runtime = WorkspaceRuntime::default();
let summary = runtime.summary();
assert!(summary.contains("TreeAgent runtime"));
}
}
10 changes: 10 additions & 0 deletions crates/treeagentc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "treeagentc"
authors.workspace = true
edition.workspace = true
license.workspace = true
version.workspace = true

[dependencies]
anyhow.workspace = true
treeagent-model = { path = "../treeagent-model" }
17 changes: 17 additions & 0 deletions crates/treeagentc/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use treeagent_model::GraphSpec;

fn main() {
let spec = GraphSpec::new("client");
println!("treeagentc targeting graph: {}", spec.name());
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn client_initializes_graph_spec() {
let spec = GraphSpec::new("client-spec");
assert_eq!(spec.name(), "client-spec");
}
}
18 changes: 18 additions & 0 deletions scripts/dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT_DIR"

COMMAND=${1:-help}
case "$COMMAND" in
build)
cargo build --workspace ;;
test)
cargo test --workspace ;;
check)
cargo check --workspace ;;
help|*)
echo "Usage: $0 {build|test|check}" >&2
exit 1 ;;
esac
Empty file added templates/graph-runner/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions templates/graph-runner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Graph runner templates

This directory is reserved for graph runner code generation templates used by the Rust workspace. Add renderer-specific template files here to drive code generation workflows.