Skip to main content

Crate graphrt_bundle

Crate graphrt_bundle 

Source
Expand description

§graphrt-bundle

A bundle (.grt) is one portable file holding everything a workflow needs to run on any graphrt host — the CLI, graphrt serve, or a phone through graphrt-ffi: the workflow document(s), WebAssembly plugins, knowledge-base configuration and data, a providers file without secrets, and assets.

A bundle is a zip archive with a bundle.json manifest listing the SHA-256 of every file. Hosts check every hash when opening a bundle, and can require an Ed25519 signature (bundle.sig) from a trusted key, so a bundle exported by a builder platform is verifiable wherever it lands.

use graphrt_bundle::{Bundle, OpenOptions};

let bytes = std::fs::read("app.grt")?;
let bundle = Bundle::open(&bytes, &OpenOptions::default())?;
let workflow = bundle.workflow(None)?;

Secrets never travel in a bundle: providers files with inline keys are rejected, and environment variables are only declared (names), never stored.

Structs§

Bundle
An opened, fully verified bundle held in memory.
BundleBuilder
Assembles a bundle.
BundleManifest
Bundle manifest.
BundleSignature
Contents of bundle.sig.
BundledPlugin
A plugin shipped in the bundle.
CompatReport
Result of Bundle::check.
KeyPair
A generated signing key pair, hex encoded.
OpenOptions
Options for Bundle::open.
PluginRef
A plugin shipped in the bundle (under plugins/<name>/).
Requires
What a host needs to run the bundle.
WasmLimits
Limits applied to every guest call. Operators set these; workflow documents cannot raise them.

Enums§

BundleError
Error building, opening or verifying a bundle.

Constants§

BUNDLE_FORMAT_VERSION
Current bundle format version.
MANIFEST_PATH
Path of the manifest inside the archive.
SIGNATURE_PATH
Path of the optional signature inside the archive.

Functions§

check_no_inline_secrets
Fail when value contains an inline credential: a non-empty string under a secret-looking key (api_key, token, password, an Authorization header…) that is not an environment reference (${VAR}). Keys ending in _env name a variable and are allowed. what names the file in the error message.
generate_keypair
Generate a new Ed25519 key pair from the operating system’s random source.
parse_public_key
Parse a hex public key.
sha256_hex
Hex-encoded SHA-256 of bytes.
sign_bundle
Return a copy of bundle (archive bytes) signed with secret_key (hex seed). Any previous signature is replaced. The bundle is fully verified first.