pub fn cmd_share(
db_path: &Path,
args: &ShareArgs,
out: &mut CliOutput<'_>,
) -> Result<()>Expand description
ai-memory share dispatch entry. Opens the DB at db_path, builds
the same JSON params bag the MCP tool consumes, and routes through
the shared [crate::mcp::tools::share::handle_share] substrate
primitive — guaranteeing the wire envelope is byte-equal across the
three surfaces.
§Errors
- The DB at
db_pathcannot be opened. - The substrate validation rejects the supplied
--memory-id/--target-agent(invalid format, source row not found, …). serde_json::to_stringcannot serialise the envelope (in practice never happens with the shapes used here).