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

Function decode_workflow_snapshot

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

Source from the content-addressed store, hash-verified

7116}
7117
7118fn decode_workflow_snapshot(
7119 response: pb::GetWorkflowSnapshotResponse,
7120) -> CliResult<atomic_repository::repository::WorkflowSnapshot> {
7121 if response.api_version != 1
7122 || response.generation != atomic_core::kg::KG_GENERATION
7123 || response.ontology_version != atomic_core::kg::ontology::VERSION_IRI
7124 {
7125 return Err(CliError::Internal(anyhow::anyhow!(
7126 "unsupported workflow snapshot API/generation/ontology"
7127 )));
7128 }
7129 Ok(atomic_repository::repository::WorkflowSnapshot {
7130 generation: response.generation,
7131 ontology_version: atomic_core::kg::ontology::VERSION_IRI,
7132 identity: response.identity,
7133 nodes: response.nodes.iter().map(kg_node_domain).collect(),
7134 edges: response
7135 .edges
7136 .iter()
7137 .map(kg_edge_domain)
7138 .collect::<CliResult<_>>()?,
7139 })
7140}
7141
7142/// Compose existing local/reactor read endpoints without opening redb client-side.
7143/// 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