mur_common/bundle.rs
1//! Wire-format types shared between the GUI export pipeline (writer)
2//! and the GUI app's first-launch bootstrap (reader).
3//!
4//! Both halves of `mur agent export --format gui` need to agree on
5//! these structs byte-for-byte: the export pipeline writes
6//! `metadata.json` into the bundled resources, and the bootstrap
7//! reads it back. Keeping them in `mur-common` (the shared schema
8//! crate) is the only way to prevent silent drift if either side
9//! adds or renames a field.
10
11use serde::{Deserialize, Serialize};
12
13#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
14#[serde(rename_all = "snake_case")]
15pub enum BundleMode {
16 /// Recipient mints fresh identity on first launch (default; safe
17 /// for distribution).
18 Template,
19 /// Recipient inherits the source agent's identity. Currently
20 /// gated behind `MUR_ALLOW_UNSAFE_CLONE` because the rekey
21 /// ceremony is not yet wired.
22 Clone,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
26pub struct EmbeddedMetadata {
27 pub schema_version: u32,
28 pub agent_name: String,
29 pub display_name: String,
30 pub mode: BundleMode,
31 pub theme_default: String,
32 pub mur_version: String,
33}