# Core Agent Abstractions
# Decision: Keep the loop logic DB-agnostic via traits (EventEmitter, MessageStore, ToolExecutor)
# Decision: Use async_trait for trait definitions to support async operations
# Decision: Tool types and domain entities are defined here (runtime types)
# Decision: Domain entities (Agent, Session, LlmProvider, etc.) are in core for shared use by API and worker
# Decision: Use OpenAI Protocol as the base for LLM Provider abstractions

[package]
name = "everruns-core"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
documentation = "https://docs.rs/everruns-core"
description = "Core agent abstractions for Everruns - agent loop, events, tools, LLM providers"
readme = "README.md"

[dependencies]
# Core dependencies
everruns-config = { path = "../config", version = "0.8.34" }
anyhow.workspace = true
thiserror.workspace = true
async-trait.workspace = true

# Async runtime
# Note: "rt" is needed for tokio::spawn in event listener isolation
tokio = { workspace = true, features = ["sync", "rt", "process", "time"] }
futures.workspace = true

# Serialization
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true

# UUID and time
uuid.workspace = true
chrono.workspace = true
rand.workspace = true

# Tracing
tracing.workspace = true
tracing-subscriber.workspace = true

# OpenTelemetry
opentelemetry.workspace = true
opentelemetry_sdk.workspace = true
opentelemetry-otlp.workspace = true
tracing-opentelemetry.workspace = true

# Encoding
base64.workspace = true
sha2.workspace = true

# Regex for argument substitution
regex.workspace = true

# Text diff rendering for edit_file previews
similar = "2"

# URL parsing
url = "2"

# Web fetching
fetchkit = { version = "=0.2.0", features = ["bot-auth"] }

# Ed25519 key derivation (bot-auth public key registration)
ed25519-dalek = { version = "2", features = ["rand_core"] }

# Virtual bash interpreter
bashkit = { version = "0.6.0", features = ["jq"] }

# Tree-sitter for structural outlines (EVE-248)
tree-sitter = { version = "0.24", optional = true }
tree-sitter-rust = { version = "0.23", optional = true }
tree-sitter-typescript = { version = "0.23", optional = true }
tree-sitter-python = { version = "0.23", optional = true }

# TLS crypto provider (must be installed before any rustls usage)
rustls.workspace = true

# OpenAPI schema generation (optional, enabled by everruns-server)
utoipa = { workspace = true, optional = true }

# Database (optional, for TypedId sqlx support)
sqlx = { workspace = true, optional = true }

# Note: This crate has NO dependency on storage/contracts - it's purely runtime abstractions
# Tool types are defined locally in this crate

# OpenAI Protocol provider
# Note: We need "default" features for system proxy detection from environment variables
reqwest = { workspace = true, features = ["json", "stream", "rustls", "blocking"] }
eventsource-stream = "0.2"

# Plugin system for external integrations
inventory.workspace = true

# LLM simulation for testing
llmsim = "0.3.0"

# OpenUI component definitions and prompt generator
everruns-openui = { path = "../openui", version = "0.8.34", optional = true }

# A2UI component catalog and prompt generator
everruns-a2ui = { path = "../a2ui", version = "0.8.34", optional = true }

# A2A outbound agent delegation
a2a.workspace = true
a2a-client.workspace = true

# Compile-time directory embedding for virtual mounts (platform docs)
include_dir = { version = "0.7", optional = true }

[features]
default = ["llm-tests"]
embedded-platform-docs = ["dep:include_dir"]
openapi = ["utoipa"]
sqlx = ["dep:sqlx"]
tree-sitter-outlines = ["dep:tree-sitter", "dep:tree-sitter-rust", "dep:tree-sitter-typescript", "dep:tree-sitter-python"]
ui-capabilities = ["dep:everruns-openui", "dep:everruns-a2ui"]
llm-tests = []  # LLM integration tests (requires API keys)

[dev-dependencies]
tokio = { workspace = true, features = ["full", "test-util"] }
tracing-subscriber.workspace = true
wiremock = "0.6"
# Snapshot testing for contract tests
insta = { version = "1.40", features = ["json", "redactions"] }
a2a-server.workspace = true
axum.workspace = true
