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

Function decode_workflow_snapshot

atomic-cli/src/commands/rpc.rs:7159–7181  ·  view source on GitHub ↗
(
    response: pb::GetWorkflowSnapshotResponse,
)

Source from the content-addressed store, hash-verified

7157}
7158
7159fn decode_workflow_snapshot(
7160 response: pb::GetWorkflowSnapshotResponse,
7161) -> CliResult<atomic_repository::repository::WorkflowSnapshot> {
7162 if response.api_version != 1
7163 || response.generation != atomic_core::kg::KG_GENERATION
7164 || response.ontology_version != atomic_core::kg::ontology::VERSION_IRI
7165 {
7166 return Err(CliError::Internal(anyhow::anyhow!(
7167 "unsupported workflow snapshot API/generation/ontology"
7168 )));
7169 }
7170 Ok(atomic_repository::repository::WorkflowSnapshot {
7171 generation: response.generation,
7172 ontology_version: atomic_core::kg::ontology::VERSION_IRI,
7173 identity: response.identity,
7174 nodes: response.nodes.iter().map(kg_node_domain).collect(),
7175 edges: response
7176 .edges
7177 .iter()
7178 .map(kg_edge_domain)
7179 .collect::<CliResult<_>>()?,
7180 })
7181}
7182
7183/// Compose existing local/reactor read endpoints without opening redb client-side.
7184/// The selection itself runs purely over one consistent workflow snapshot.

Callers 2

workflow_snapshotFunction · 0.85
intent_graphFunction · 0.85

Calls 2

collectMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected