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

Function show_session_detail

atomic-cli/src/commands/session.rs:232–263  ·  view source on GitHub ↗
(repo: &Repository, session_id: &str, json: bool)

Source from the content-addressed store, hash-verified

230}
231
232fn show_session_detail(repo: &Repository, session_id: &str, json: bool) -> CliResult<()> {
233 let (record, turns) = repo
234 .get_session_ledger(session_id)
235 .map_err(CliError::Repository)?
236 .ok_or_else(|| CliError::VaultEntityNotFound {
237 kind: "session",
238 id: session_id.to_string(),
239 // No hint: there is no session-listing command to point at, and the
240 // id comes from the caller's own ledger rather than something a
241 // user would create on demand.
242 hint: None,
243 })?;
244
245 // The routed pieces the render needs: turn→intent resolution and the
246 // session manifest data.
247 let turn_intents = build_turn_intent_map(repo, session_id);
248 let head = repo.get_session_head(session_id).ok().flatten();
249 let (parent_manifest, fork_turn) = head
250 .as_ref()
251 .and_then(|h| repo.get_session_manifest(h).ok().flatten())
252 .map(|manifest| (manifest.parent_session, manifest.fork_turn))
253 .unwrap_or((None, None));
254 render_session_detail(
255 record,
256 turns,
257 turn_intents,
258 head,
259 parent_manifest,
260 fork_turn,
261 json,
262 )
263}
264
265/// The detail render, over the gathered data — the repository path and the
266/// routed path (GetSession's ledger bundle + turn intents + manifest data)

Callers 1

runMethod · 0.85

Calls 7

build_turn_intent_mapFunction · 0.85
render_session_detailFunction · 0.85
get_session_ledgerMethod · 0.80
as_refMethod · 0.80
okMethod · 0.45
get_session_headMethod · 0.45
get_session_manifestMethod · 0.45

Tested by

no test coverage detected