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

Method resolve_body

atomic-cli/src/commands/intent/update.rs:138–151  ·  view source on GitHub ↗

Resolve the body override: inline `--body` or `--body-stdin`. Shared by the local body and the service-layer hook — reading the client's stdin is client-side by design, so the routed path resolves the body with this SAME code and sends it on the wire.

(&self)

Source from the content-addressed store, hash-verified

136 /// client's stdin is client-side by design, so the routed path resolves
137 /// the body with this SAME code and sends it on the wire.
138 pub(crate) fn resolve_body(&self) -> CliResult<Option<String>> {
139 if let Some(ref body) = self.body {
140 return Ok(Some(body.clone()));
141 }
142 if self.body_stdin {
143 use std::io::Read;
144 let mut content = String::new();
145 std::io::stdin()
146 .read_to_string(&mut content)
147 .map_err(CliError::Io)?;
148 return Ok(Some(content));
149 }
150 Ok(None)
151 }
152}
153
154/// Resolve only context supplied by this invocation. Never choose a session by

Callers 2

intent_updateFunction · 0.80
runMethod · 0.80

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected