pub struct BundleBuilder { /* private fields */ }Expand description
Assembles a bundle.
Implementations§
Source§impl BundleBuilder
impl BundleBuilder
Sourcepub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
New bundle named name at version.
pub fn description(self, description: impl Into<String>) -> Self
Sourcepub fn created_at(self, created_at: impl Into<String>) -> Self
pub fn created_at(self, created_at: impl Into<String>) -> Self
Fixed creation time (RFC 3339) for reproducible builds. Defaults to
$SOURCE_DATE_EPOCH when set, else the current time.
Sourcepub fn workflow(
self,
path: &str,
text: impl Into<String>,
) -> Result<Self, BundleError>
pub fn workflow( self, path: &str, text: impl Into<String>, ) -> Result<Self, BundleError>
Add a workflow document stored at path (e.g. workflow.yaml). The first
workflow added is the entry. The document must parse.
Sourcepub fn file(self, path: &str, bytes: Vec<u8>) -> Result<Self, BundleError>
pub fn file(self, path: &str, bytes: Vec<u8>) -> Result<Self, BundleError>
Add an arbitrary file (assets, data) at path.
Sourcepub fn include_dir(self, dir: &Path, prefix: &str) -> Result<Self, BundleError>
pub fn include_dir(self, dir: &Path, prefix: &str) -> Result<Self, BundleError>
Copy a directory under prefix/ (e.g. assets), skipping build output and VCS folders.
Sourcepub fn plugin_dir(self, dir: &Path) -> Result<Self, BundleError>
pub fn plugin_dir(self, dir: &Path) -> Result<Self, BundleError>
Add a plugin directory (with graphrt-plugin.json or .yaml) under
plugins/<name>/. The manifest is stored as JSON. WebAssembly plugins are
portable; process and http plugins are kept but flagged non-portable.
Sourcepub fn wasm_module(
self,
name: &str,
module: Vec<u8>,
) -> Result<Self, BundleError>
pub fn wasm_module( self, name: &str, module: Vec<u8>, ) -> Result<Self, BundleError>
Add a bare, self-describing WebAssembly module as plugin name (a manifest is
generated; its node kinds may be plain names).
Sourcepub fn providers(self, text: &str) -> Result<Self, BundleError>
pub fn providers(self, text: &str) -> Result<Self, BundleError>
Add a model providers file (YAML or JSON). Files with inline secrets are rejected.
Sourcepub fn knowledge(self, text: &str, base_dir: &Path) -> Result<Self, BundleError>
pub fn knowledge(self, text: &str, base_dir: &Path) -> Result<Self, BundleError>
Add a knowledge-base config (YAML or JSON). Stores whose path exists under
base_dir (memory JSON files, SQLite databases) are copied into
knowledge/ and the path rewritten, so a prebuilt index ships with the
bundle. Inline secrets are rejected, and so is a SQLite database whose
write-ahead log still holds commits (the copy would silently miss them).