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

Function query_search

atomic-cli/src/commands/rpc.rs:1694–1740  ·  view source on GitHub ↗

`atomic memory show` over GetVaultEntry — every form. The wire carries the lift inputs (the stored entry) plus the RAW attestation sources, so the CLI runs its EXISTING bridge code unchanged over wire-carried inputs and projects with the same render the local body uses — byte-parity for the canonical JSON-LD projection and the `atomic vault query search` over QueryGraph (KgSearch) — every form: th

(args: &super::query::QueryNodes)

Source from the content-addressed store, hash-verified

1692/// before ranking/pool limits) and `--pool` names the retention budget. The plain
1693/// render reads the same kind/id/summary columns.
1694pub fn query_search(args: &super::query::QueryNodes) -> CliResult<bool> {
1695 let Some(session) = Service::open()? else {
1696 return Ok(false);
1697 };
1698 let request = pb::QueryGraphRequest {
1699 repository: Some(session.reference.clone()),
1700 limit: args.limit as u32,
1701 query: Some(pb::query_graph_request::Query::KgSearch(
1702 pb::KgSearchQuery {
1703 query: args.query.clone(),
1704 kind: args.kind.clone(),
1705 pool: args.pool.map(|pool| pool as u32),
1706 },
1707 )),
1708 view: None,
1709 };
1710 let response = session.query_graph(request)?;
1711 let nodes = response
1712 .nodes
1713 .iter()
1714 .map(kg_node_domain)
1715 .collect::<Vec<_>>();
1716 if args.json {
1717 println!("{}", serde_json::to_string_pretty(&nodes).unwrap());
1718 return Ok(true);
1719 }
1720 if nodes.is_empty() {
1721 println!("No results.");
1722 return Ok(true);
1723 }
1724 for node in &nodes {
1725 let summary = node.summary.as_deref().unwrap_or("");
1726 let summary_display = if summary.is_empty() {
1727 String::new()
1728 } else {
1729 format!(" {}", super::query::truncate_display(summary, 60))
1730 };
1731 println!(
1732 " [{}] {}{}",
1733 atomic_core::kg::ontology::compact(node.primary_type()),
1734 node.id,
1735 summary_display
1736 );
1737 }
1738 println!("\n{} result(s).", nodes.len());
1739 Ok(true)
1740}
1741
1742/// freeform body.
1743pub fn memory_show(args: &super::memory::show::MemoryShow) -> CliResult<bool> {

Callers 1

runMethod · 0.85

Calls 5

openFunction · 0.85
cloneMethod · 0.45
query_graphMethod · 0.45
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected