Skip to main content

Crate ready_set_sdk

Crate ready_set_sdk 

Source
Expand description

§ready-set-sdk

Shared conventions and helpers for ready-set plugins.

The SDK is the typed Rust mirror of the contracts under docs/contracts/. Plugins are not required to use the SDK — any binary on PATH can be a plugin — but using it makes plugins consistent with first-party tools and saves writing the same boilerplate.

§What lives here

  • context: per-invocation state (Context), populated from the READY_SET_* env contract.
  • capability: product capability descriptors and lifecycle reports.
  • output: human/JSON output formatting (Output).
  • exit_code: documented process exit codes (ExitCode).
  • change_log: append-only JSONL change log for reversibility.
  • describe: __describe subcommand support.
  • manifest: plugin manifest sidecar parsing.
  • sandbox: per-platform sandbox trait (no-op stubs in v0.1.0).
  • config: .ready-set.toml loader.
  • fs: filesystem helpers (atomic writes, hashing).
  • dispatch: cross-plugin dispatch helper.
  • logging: tracing setup honoring the env contract.
  • error: SDK-wide error type.

§Minimal plugin shape

use ready_set_sdk::prelude::*;
use ready_set_sdk::describe::{Describe, Stability, Platform};

fn describe() -> Describe {
    Describe {
        description: "Example plugin".into(),
        version: "0.1.0".parse().unwrap(),
        stability: Stability::Experimental,
        min_dispatcher_version: "0.1.0".parse().unwrap(),
        platforms: vec![Platform::Linux, Platform::Macos, Platform::Windows],
        requires_cargo_workspace: false,
        capabilities: Vec::new(),
    }
}

fn main() -> std::process::ExitCode {
    let descr = describe();
    if let Some(code) = descr.handle_arg0_describe(std::env::args_os()) {
        return code.into();
    }
    let ctx = Context::from_env();
    let mut out = Output::for_context(&ctx, std::io::stdout());
    out.human("hello world");
    ExitCode::Ok.into()
}

Re-exports§

pub use capability::CapabilityAction;
pub use capability::CapabilityActionKind;
pub use capability::CapabilityDescriptor;
pub use capability::CapabilityId;
pub use capability::CapabilityRelevance;
pub use capability::CapabilityReport;
pub use capability::CapabilityRunReport;
pub use capability::CapabilityState;
pub use capability::CapabilityVerb;
pub use capability::NextAction;
pub use capability::ProviderId;
pub use capability::RunStatus;
pub use context::Context;
pub use error::Error;
pub use error::Result;
pub use exit_code::ExitCode;
pub use lifecycle::LifecycleRequest;
pub use lifecycle::LifecycleRequestError;
pub use lifecycle::parse_lifecycle_request;
pub use output::Output;
pub use output::OutputMode;

Modules§

capability
Capability lifecycle contract types.
change_log
Change-log records for reversibility.
config
.ready-set.toml loading.
context
Per-invocation context populated from the dispatcher env contract.
describe
__describe subcommand support.
dispatch
Helpers for one plugin to dispatch to another via the ready-set core.
error
Error and result types used throughout the SDK.
exit_code
Documented process exit codes.
fs
Filesystem helpers used by both the dispatcher and plugins.
lifecycle
Lifecycle protocol helpers for provider plugins.
logging
tracing setup honoring the dispatcher env contract.
manifest
Plugin manifest sidecar parsing.
output
Output formatting helpers shared by every plugin.
prelude
Convenient re-exports for plugin authors.
sandbox
Sandbox abstraction for plugins.