Skip to main content

statespace_server/
lib.rs

1//! HTTP server for Statespace tool execution.
2//!
3//! Serves markdown files with frontmatter-defined tools, validates commands,
4//! and executes them in a sandboxed environment.
5//!
6//! ```rust,ignore
7//! use statespace_server::{ServerConfig, build_router, initialize_templates};
8//!
9//! let config = ServerConfig::new(PathBuf::from("./toolsite"));
10//! initialize_templates(&config.content_root).await?;
11//! let router = build_router(&config)?;
12//! ```
13
14pub mod content;
15pub mod error;
16pub mod init;
17pub mod semantics;
18pub mod server;
19pub mod templates;
20
21pub use statespace_tool_runtime::{
22    ActionRequest, ActionResponse, BuiltinTool, ExecutionLimits, FileInfo, Frontmatter, HttpMethod,
23    ToolExecutor, ToolOutput, ToolPart, ToolSpec, expand_placeholders, is_valid_tool_call,
24    parse_frontmatter, validate_command_with_specs,
25};
26
27pub use content::{ContentResolver, LocalContentResolver};
28pub use error::{Error, Result};
29pub use init::initialize_templates;
30pub use server::{ServerConfig, ServerState, build_router};
31pub use templates::{AGENTS_MD, FAVICON_SVG};