Crate pywatt_sdk

Source

Re-exports§

pub use ipc_types::Announce as ModuleAnnounce;
pub use ipc_types::AnnounceBlob;
pub use ipc_types::ClientRequest;
pub use ipc_types::Endpoint as AnnouncedEndpoint;
pub use ipc_types::EndpointAnnounce;
pub use ipc_types::GetSecretRequest;
pub use ipc_types::Init as OrchestratorInit;
pub use ipc_types::InitBlob;
pub use ipc_types::ListenAddress;
pub use ipc_types::ModuleToOrchestrator;
pub use ipc_types::OrchestratorToModule;
pub use ipc_types::RotatedNotification;
pub use ipc_types::RotationAckRequest;
pub use ipc_types::SecretValueResponse;
pub use ipc_types::ServerResponse;
pub use typed_secret::Secret;
pub use typed_secret::TypedSecretError;
pub use typed_secret::get_typed_secret;
pub use crate::secret_client::register_for_redaction;
pub use crate::secret_client::register_secret_for_redaction;
pub use model_manager::ModelManager;

Modules§

build
Module exposing build information constants.
ipc_types
model_manager
prelude
Prelude module, exposing the most commonly used items.
secret_client
secret_provider
typed_secret

Macros§

instrument_secret_op
Creates an instrumented span for secret provider operations. Use this macro to wrap secret provider operations with proper tracing.
json_println
A convenience macro for writing to JsonStdout
safe_log
Log macro that redacts sensitive information before logging
stderr
A convenience macro for writing to stderr

Structs§

AppState
Shared application state for a PyWatt module.
ModuleBuilder
Builder pattern for bootstrapping PyWatt modules.

Enums§

AnnounceError
Errors that may occur when serializing or sending announcement
BootstrapError
Errors that may occur during bootstrap initialization.
Error
Unified error type for the SDK
InitError
Errors that may occur while reading the initial handshake from stdin.
ServeError
Errors that may occur during server bootstrap and run.

Functions§

announce_from_router
bootstrap_module
Bootstraps a PyWatt module with handshake, secret init, announcement, and IPC.
eprint_json
Print JSON to stderr.
eprint_pretty_json
Print pretty JSON to stderr.
get_module_secret_client
Create a new SecretClient for the module, wired to stdin/stdout for IPC
get_secret
Retrieve a secret by key from the orchestrator, registering it for redaction
get_secrets
Retrieve multiple secrets by key, registering each for redaction.
init_module
Initialize stderr logging with JSON format and secret redaction.
print_json
Print JSON to stdout.
print_pretty_json
Print pretty JSON to stdout.
process_ipc_messages
Processes runtime IPC messages from the orchestrator over stdin.
read_init
Read the Init message sent by the orchestrator over stdin.
send_announce
Send the module’s announcement blob to the orchestrator via stdout.
serve_module
Bootstraps and serves a PyWatt module with Axum router in one step.
subscribe_secret_rotations
Subscribe to secret rotations for the given keys. The on_rotate callback will be invoked for each rotated key with the new value.

Type Aliases§

Result
Convenience result alias