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
21 changes: 18 additions & 3 deletions backend/Cargo.lock

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

2 changes: 1 addition & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["erato", "mock-llm-server", "mock-mcp-server", "rmcp-sse"]
members = ["erato", "erato_config", "mock-llm-server", "mock-mcp-server", "rmcp-sse"]

[profile.dev]
split-debuginfo = "packed"
Expand Down
5 changes: 2 additions & 3 deletions backend/erato/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ name = "record-chat-provider-reqwest"
path = "./src/record_chat_provider_reqwest.rs"

[dependencies]
erato_config = { path = "../erato_config" }

# Dependencies: Server
axum = { version = "0.8.4", features = ["macros", "ws"] }
axum-extra = { version = "0.10.1", features = ["typed-header", "multipart"] }
Expand Down Expand Up @@ -50,7 +52,6 @@ aes-gcm-siv = "0.11.1"
hmac = "0.13.0"
jsonwebtoken = "10.4.0"
regorus = "0.5.0"
secrecy = "0.10.3"
sha2 = "0.11.0"

# Dependencies: Async runtime
Expand Down Expand Up @@ -105,10 +106,8 @@ graph-rs-sdk = { version = "3.0", default-features = false, features = ["rustls-
regex = "1.12.3"
rand = "0.9.4"
base64 = "0.22.1"
facet = "0.44.3"
# Newtype utility
synonym = "0.1.5"
config = "0.15.6"
toml_edit = "0.23.10"
dotenv-flow = "0.16.2"
handlebars = "6"
Expand Down
2 changes: 1 addition & 1 deletion backend/erato/src/gen_config_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::fs;
use std::process;

use erato::config_reference::{generate_config_reference, validate_config_reference};
use erato_config::config_reference::{generate_config_reference, validate_config_reference};

fn main() {
let args: Vec<String> = std::env::args().collect();
Expand Down
8 changes: 4 additions & 4 deletions backend/erato/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use server::router::MainRouterApiDoc;
use crate::server::router::MAIN_ROUTER_DOC;

pub mod actors;
pub mod config;
pub mod config_facet_attrs;
pub mod config_reference;
pub use erato_config::config;
pub use erato_config::config_facet_attrs;
pub use erato_config::config_reference;
pub mod db;
pub mod frontend_environment;
pub mod metrics;
Expand All @@ -21,7 +21,7 @@ pub mod profiling;
pub mod query_metrics;
pub mod server;
pub mod services;
pub mod startup_log;
pub use erato_config::startup_log;
pub mod state;
pub mod telemetry;
pub mod translation_po;
Expand Down
2 changes: 1 addition & 1 deletion backend/erato/src/services/client_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use serde_json::{Value, json};

/// Name of the synthetic tool offered to the model when the active action
/// facet declares `client_actions`.
pub const CLIENT_ACTION_TOOL_NAME: &str = "propose_client_action";
pub use erato_config::config::CLIENT_ACTION_TOOL_NAME;

/// Build the synthetic client-action tool with an enum-constrained input
/// schema, so the model can only select one of the configured actions.
Expand Down
2 changes: 1 addition & 1 deletion backend/erato/tests/integration_tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::test_utils::hermetic_app_config;
use crate::{MIGRATOR, test_app_state};
use erato::config::{
use erato_config::config::{
AppConfig, FileTypeDetectionMode, GenerationConfig, ModelReasoningEffort, ModelVerbosity,
PromptSourceSpecification, RuntimeConfigurationConfig, ServerConfig, SharepointAllDrivesSource,
};
Expand Down
19 changes: 19 additions & 0 deletions backend/erato_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "erato_config"
version = "0.6.2"
description = "Shared configuration representation and loading for Erato"
license = "AGPL-3.0-or-later"
edition = "2024"

[dependencies]
base64 = "0.22.1"
config = "0.15.6"
eyre = "0.6.12"
facet = "0.44.3"
regex = "1.12.3"
secrecy = "0.10.3"
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.138"
tracing = "0.1.41"
utoipa = { version = "5.3.1", features = ["uuid", "chrono"] }
url = "2.5.8"
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ use utoipa::ToSchema;
use crate::config_facet_attrs as erato_config;
use crate::startup_log;

/// Name reserved for the synthetic client-action tool exposed by the backend.
pub const CLIENT_ACTION_TOOL_NAME: &str = "propose_client_action";

const DEFAULT_PROMPT_OPTIMIZER_PROMPT: &str = r#"
You are Lyra, a master-level AI prompt optimization specialist.
Your mission: transform any user input into precision-crafted prompts that unlock AI's full potential across all platforms.
Expand Down Expand Up @@ -1014,7 +1017,7 @@ impl AppConfig {
tool.name
);
}
if name == crate::services::client_actions::CLIENT_ACTION_TOOL_NAME {
if name == CLIENT_ACTION_TOOL_NAME {
panic!("Client tool named '{}' is reserved.", name);
}
let namespace = tool.namespace_or_default();
Expand All @@ -1038,7 +1041,7 @@ impl AppConfig {
.chars()
.all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-'))
{
crate::startup_log::warn_preinit(format!(
startup_log::warn_preinit(format!(
"Client tool name '{}' does not match ^[a-zA-Z0-9_-]{{1,64}}$; \
OpenAI/Azure and Anthropic reject such tool names at request time.",
name
Expand Down
6 changes: 6 additions & 0 deletions backend/erato_config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! Shared Erato configuration types, loading, validation, and reference metadata.

pub mod config;
pub mod config_facet_attrs;
pub mod config_reference;
pub mod startup_log;
Loading