pub struct Bundle { /* private fields */ }Expand description
An opened, fully verified bundle held in memory.
Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn open(bytes: &[u8], options: &OpenOptions) -> Result<Self, BundleError>
pub fn open(bytes: &[u8], options: &OpenOptions) -> Result<Self, BundleError>
Open a bundle from archive bytes: enforce archive limits, check every file against its SHA-256, reject unlisted files, and verify the signature.
Sourcepub fn open_path(
path: impl AsRef<Path>,
options: &OpenOptions,
) -> Result<Self, BundleError>
pub fn open_path( path: impl AsRef<Path>, options: &OpenOptions, ) -> Result<Self, BundleError>
Read and open a bundle file.
pub fn manifest(&self) -> &BundleManifest
Sourcepub fn manifest_bytes(&self) -> &[u8] ⓘ
pub fn manifest_bytes(&self) -> &[u8] ⓘ
Exact manifest bytes (what signatures cover).
Sourcepub fn signer(&self) -> Option<&str>
pub fn signer(&self) -> Option<&str>
Hex public key of the verified signer, if the bundle is signed.
Sourcepub fn paths(&self) -> impl Iterator<Item = &str>
pub fn paths(&self) -> impl Iterator<Item = &str>
Paths of every file (excluding manifest and signature).
Sourcepub fn workflow_text(&self, name: Option<&str>) -> Result<&str, BundleError>
pub fn workflow_text(&self, name: Option<&str>) -> Result<&str, BundleError>
Source text of a workflow (None = the entry workflow).
Sourcepub fn workflow(&self, name: Option<&str>) -> Result<Workflow, BundleError>
pub fn workflow(&self, name: Option<&str>) -> Result<Workflow, BundleError>
Parse a workflow (None = the entry workflow). name may be the stored path
or its file stem (support for workflows/support.yaml).
Sourcepub fn plugins(&self) -> Result<Vec<BundledPlugin>, BundleError>
pub fn plugins(&self) -> Result<Vec<BundledPlugin>, BundleError>
Every plugin shipped under plugins/<name>/.
Sourcepub fn wasm_plugins(&self) -> Result<Vec<BundledPlugin>, BundleError>
pub fn wasm_plugins(&self) -> Result<Vec<BundledPlugin>, BundleError>
WebAssembly plugins only (portable to every host, including phones).
Sourcepub fn knowledge_config(&self) -> Option<(&str, &str)>
pub fn knowledge_config(&self) -> Option<(&str, &str)>
Path and text of the knowledge-base config (knowledge/knowledge.{yaml,yml,json}).
Sourcepub fn providers_config(&self) -> Option<(&str, &str)>
pub fn providers_config(&self) -> Option<(&str, &str)>
Path and text of the providers file (providers.{yaml,yml,json}), which never holds secrets.
Sourcepub fn knowledge_config_at(
&self,
extracted: &Path,
) -> Option<Result<Value, BundleError>>
pub fn knowledge_config_at( &self, extracted: &Path, ) -> Option<Result<Value, BundleError>>
The knowledge-base config as JSON with every store path inside knowledge/
rewritten to its location under extracted (the directory passed to
Bundle::extract_to). None when the bundle has no knowledge config.
Sourcepub fn extract_to(&self, dir: &Path) -> Result<(), BundleError>
pub fn extract_to(&self, dir: &Path) -> Result<(), BundleError>
Write every file under dir (created if needed), preserving the layout.
Paths were validated on open, so nothing escapes dir.
Sourcepub fn check(&self, registry: &Registry) -> CompatReport
pub fn check(&self, registry: &Registry) -> CompatReport
Compare the bundle’s requirements with a host registry (after bundled plugins were registered) and this runtime’s version.
Source§impl Bundle
impl Bundle
Sourcepub fn register_wasm_plugins(
&self,
registry: &mut Registry,
limits: &WasmLimits,
) -> Result<Vec<String>, BundleError>
pub fn register_wasm_plugins( &self, registry: &mut Registry, limits: &WasmLimits, ) -> Result<Vec<String>, BundleError>
Load every bundled WebAssembly plugin and register its node kinds in
registry. Returns the registered kinds.
Kinds must start with <plugin name>., unless the plugin manifest sets
allow_unprefixed_kinds (then only plain names without . are allowed).
Kinds that already exist in registry are never replaced: a plugin whose
kinds are all registered already (e.g. the same plugin installed on the host)
is skipped, and a partial overlap is an error. Bundled plugins
never receive plaintext secrets: that requires host-side trust.
Non-WebAssembly plugins are ignored here; see Bundle::check.