Skip to main content

Crate arqen

Crate arqen 

Source
Expand description

§Arqen

Backend infrastructure for agent-ready applications.

Arqen provides a complete backend toolkit including:

  • HTTP services and route composition (feature: http-server)
  • Provider-neutral storage contracts and adapters (http-client)
  • Typed agent tools and manifest generation
  • Durable job workers with graceful shutdown
  • Structured application logging (feature: logging)

§Quick Start

use arqen::http::{create_router, start_server};
use std::net::SocketAddr;

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
    arqen::run(async {
        let addr: SocketAddr = "127.0.0.1:8888".parse()?;
        let router = create_router();
        start_server(addr, router).await?;
        Ok(())
    })
}

Re-exports§

pub use agent::AgentManifest;
pub use agent::EndpointMetadata;
pub use agent::JobMetadata;
pub use agent::ToolContext;
pub use agent::ToolEffect;
pub use agent::ToolHandler;
pub use agent::ToolMetadata;
pub use agent::ToolOutcome;
pub use agent::ToolRegistry;
pub use config::AppConfig;
pub use config::AuthConfig;
pub use config::CliOverrides;
pub use config::ConfigError;
pub use config::HealthConfig;
pub use config::LogFormat;
pub use config::LoggingConfig;
pub use config::Secret;
pub use config::ServerConfig;
pub use config::StorageConfig;
pub use config::StorageMode;
pub use config::ThingdSyncMode;
pub use config::WorkerConfig;
pub use context::RequestContext;
pub use core::AppError;
pub use core::ErrorKind;
pub use jobs::JobConfig;
pub use jobs::JobHandler;
pub use jobs::JobWorker;
pub use jobs::Worker;
pub use module::LifecycleHook;
pub use module::Module;
pub use module::ModuleBuilder;
pub use module::ModuleContext;
pub use module::ModuleError;
pub use module::ModuleGraphError;
pub use module::ModuleHealth;
pub use observability::CacheMetric;
pub use observability::JobMetric;
pub use observability::MetricsSink;
pub use observability::NoopMetricsSink;
pub use observability::RequestMetric;
pub use observability::SharedMetricsSink;
pub use observability::StorageMetric;
pub use observability::SyncMetric;
pub use scheduler::Schedule;
pub use scheduler::ScheduleEvent;
pub use scheduler::ScheduleIntervalOptions;
pub use scheduler::ScheduleOnceOptions;
pub use scheduler::ScheduleOptions;
pub use scheduler::ScheduleStatus;
pub use scheduler::Scheduler;
pub use scheduler::SchedulerError;
pub use scheduler::SchedulerStats;
pub use state::AppState;
pub use state::AppStateBuilder;
pub use thingd::BootstrapPolicy;
pub use thingd::CachePolicy;
pub use thingd::CachingThingdBackend;
pub use thingd::MemoryThingdBackend;
pub use thingd::ScopeSubject;
pub use thingd::ScopedThingdBackend;
pub use thingd::StorageFactory;
pub use thingd::StorageScope;
pub use thingd::ThingdBackend;
pub use thingd::retry_bootstrap;
pub use thingd::seed_with_retry;
pub use auth::AuthContext;
pub use auth::AuthError;
pub use auth::Authentication;
pub use health::HealthCheck;
pub use health::HealthRegistry;
pub use health::HealthReport;
pub use health::HealthStatus;
pub use health::ProbeType;
pub use health::ThingdSyncHealth;
pub use observability::MetricsReport;
pub use observability::RequestMetrics;
pub use validation::FieldError;
pub use validation::Validate;
pub use validation::Validated;
pub use validation::ValidationErrors;
pub use http::AuthGuard;
pub use http::Authenticated;
pub use http::HttpCachePolicy;
pub use http::HttpModule;
pub use http::MiddlewareContext;
pub use http::MiddlewareHook;
pub use http::RequireAuth;
pub use http::auth_middleware;
pub use http::builtin_routes;
pub use http::create_router;
pub use http::create_router_with_state;
pub use http::create_router_with_state_and_routes;
pub use http::jsonl_response;
pub use http::merge_module_routes;
pub use http::nest_routes;
pub use http::optional_auth_middleware;
pub use http::require_auth_middleware;

Modules§

agent
app
Convenience application wrapper for Arqen.
auth
Authentication module for Arqen.
config
Configuration module for Arqen.
context
Typed request identity shared by handlers, repositories, jobs, and logs.
core
health
Health and readiness module for Arqen.
http
jobs
module
Module composition for Arqen.
observability
Observability module for Arqen.
openapi
OpenAPI documentation module for Arqen.
prelude
Ergonomic re-exports for common Arqen types.
scheduler
Durable, Thingd-backed scheduling for Arqen applications.
schema
.thingd schema validation and stable hash reporting.
state
Application state module for Arqen.
thingd
validation
Request validation module for Arqen.

Macros§

register_tool

Functions§

run
Run an Arqen application without exposing the runtime implementation in the application’s entry point.

Attribute Macros§

async_trait
Attribute macro for implementing Arqen’s asynchronous extension traits. The macro is re-exported so applications do not need a direct dependency on Arqen’s async implementation details.