anyclaw-sdk-service 0.2.1

SDK for building anyclaw service extensions
Documentation
// LIMITATION: No std::env::var in service binaries
// Config flows through the initialize handshake (ServiceInitializeParams.options),
// not through environment variables. Service binaries must NOT read config
// from std::env::var because: (1) the supervisor controls the subprocess environment,
// (2) env vars set on the subprocess are visible in /proc/<pid>/environ, and
// (3) the initialize handshake provides a typed, validated config path.
// See also: AGENTS.md §Anti-Patterns

//! Service SDK for anyclaw.
//!
//! Provides the [`Service`] trait for building infrastructure service extensions
//! and [`ServiceHarness`] for JSON-RPC stdio framing and method dispatch.
//!
//! # Stability
//!
//! This crate is **unstable** — APIs may change between releases.
//! Enums marked `#[non_exhaustive]` will have new variants added; match arms must include `_`.
#![warn(missing_docs)]

/// Error types for service SDK operations.
pub mod error;
/// JSON-RPC stdio harness that drives a [`Service`] implementation.
// D-03 boundary: initialize params/result contain service-defined options and installation data.
#[allow(clippy::disallowed_types)]
pub mod harness;
// D-03 boundary: JSON-RPC wire types use serde_json::Value for extensible params/result/data.
#[allow(clippy::disallowed_types)]
mod jsonrpc;
/// The [`Service`] trait that service authors implement.
// D-03 boundary: handle_unknown params/return are Value — unknown methods have no schema
#[allow(clippy::disallowed_types)]
pub mod trait_def;
/// Types for the service initialize handshake and health reporting.
// D-03 boundary: options and installation values are service-defined, no fixed schema.
#[allow(clippy::disallowed_types)]
pub mod types;

pub use error::ServiceSdkError;
pub use harness::ServiceHarness;
pub use trait_def::Service;
pub use types::*;