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

Function wire_items

atomic-cli/src/commands/vault/context.rs:795–815  ·  view source on GitHub ↗

Convert the wire's ranked ContextItems into the render's MemoryItems — the service layer's gather+rank already computed these; the renders are presentation (one render, two data sources).

(items: &[atomic_client::proto::ContextItem])

Source from the content-addressed store, hash-verified

793/// the service layer's gather+rank already computed these; the renders are
794/// presentation (one render, two data sources).
795pub(crate) fn wire_items(items: &[atomic_client::proto::ContextItem]) -> Vec<MemoryItem> {
796 items
797 .iter()
798 .map(|item| MemoryItem {
799 memory_id: item.memory_id.clone(),
800 kg_node_id: item.kg_node_id.clone(),
801 revision_hash: item.revision_hash.clone(),
802 content_hash: item.content_hash.clone(),
803 path: item.path.clone(),
804 name: item.name.clone(),
805 kind: item.kind.clone(),
806 status: item.status.clone(),
807 updated_at: item.updated_at.clone(),
808 introduced_by: item.introduced_by,
809 score: item.score,
810 why_matched: item.why_matched.clone(),
811 body: item.body.clone().unwrap_or_default(),
812 truncated: item.truncated,
813 })
814 .collect()
815}
816
817/// Render the prompt-ready markdown block. Empty input renders to an
818/// empty string so callers can prepend unconditionally.

Callers 1

vault_contextFunction · 0.85

Calls 3

collectMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected