MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / new

Method new

atomic-agent/src/integrations/receipt.rs:100–118  ·  view source on GitHub ↗

Create a receipt for a just-completed install.

(
        agent: &str,
        version: &str,
        cli_version: &str,
        source: &str,
        files: Vec<ReceiptFile>,
        settings: Vec<ReceiptSettings>,
    )

Source from the content-addressed store, hash-verified

98impl Receipt {
99 /// Create a receipt for a just-completed install.
100 pub fn new(
101 agent: &str,
102 version: &str,
103 cli_version: &str,
104 source: &str,
105 files: Vec<ReceiptFile>,
106 settings: Vec<ReceiptSettings>,
107 ) -> Self {
108 Self {
109 schema: RECEIPT_SCHEMA,
110 agent: agent.to_string(),
111 version: version.to_string(),
112 cli_version: cli_version.to_string(),
113 installed_at: chrono::Utc::now().to_rfc3339(),
114 source: source.to_string(),
115 files,
116 settings,
117 }
118 }
119
120 /// Persist the receipt under `~/.atomic/integrations/<agent>/`.
121 pub fn save(&self) -> AgentResult<PathBuf> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected