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, &config.base_url()).await?;
11//! let router = build_router(&config)?;
12//! ```
13
14pub mod content;
15pub mod error;
16pub mod init;
17pub mod server;
18pub mod templates;
19
20pub use statespace_tool_runtime::{
21    ActionRequest, ActionResponse, BuiltinTool, ExecutionLimits, FileInfo, Frontmatter, HttpMethod,
22    ToolExecutor, ToolOutput, ToolPart, ToolSpec, expand_placeholders, is_valid_tool_call,
23    parse_frontmatter, validate_command_with_specs,
24};
25
26pub use content::{ContentResolver, LocalContentResolver};
27pub use error::{Error, Result};
28pub use init::initialize_templates;
29pub use server::{ServerConfig, ServerState, build_router};
30pub use templates::{AGENTS_MD, FAVICON_SVG, render_index_html};