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

Function explain_condensed_text

libatomic/src/daemon/services_agent.rs:4915–4959  ·  view source on GitHub ↗
(
    change: &atomic_core::change::Change,
    transcript_path: Option<&std::path::Path>,
    agent_name: &str,
    files_touched: &[String],
)

Source from the content-addressed store, hash-verified

4913/// then the session transcript file condensed on the fly.
4914#[allow(clippy::too_many_arguments)]
4915fn explain_condensed_text(
4916 change: &atomic_core::change::Change,
4917 transcript_path: Option<&std::path::Path>,
4918 agent_name: &str,
4919 files_touched: &[String],
4920) -> String {
4921 use atomic_agent::transcript;
4922 if let Some(unhashed) = transcript::extract_unhashed(change) {
4923 if !unhashed.condensed_text.is_empty() {
4924 return unhashed.condensed_text;
4925 }
4926 if !unhashed.condensed_transcript.is_empty() {
4927 let files: Vec<String> = unhashed
4928 .tools_used
4929 .iter()
4930 .flat_map(|tool| tool.files_affected.clone())
4931 .collect();
4932 return transcript::format_condensed(&unhashed.condensed_transcript, &files);
4933 }
4934 }
4935 if let Some(path) = transcript_path {
4936 if let Ok(raw) = std::fs::read(path) {
4937 let format = if agent_name.contains("gemini") {
4938 "json"
4939 } else {
4940 "jsonl"
4941 };
4942 let entries = transcript::condense_transcript(&raw, format);
4943 if entries.is_empty() {
4944 return String::new();
4945 }
4946 let files: Vec<String> = if !change.file_ops().is_empty() {
4947 change
4948 .file_ops()
4949 .iter()
4950 .map(|file_op| file_op.path().to_string())
4951 .collect()
4952 } else {
4953 files_touched.to_vec()
4954 };
4955 return transcript::format_condensed(&entries, &files);
4956 }
4957 }
4958 String::new()
4959}
4960
4961/// The local explain body's domain, in ONE blocking pass: the turn list
4962/// on the session's view, then per turn the transcript extraction, the

Callers 1

explain_turns_implFunction · 0.85

Calls 11

extract_unhashedFunction · 0.85
format_condensedFunction · 0.85
condense_transcriptFunction · 0.85
readFunction · 0.50
is_emptyMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
containsMethod · 0.45
file_opsMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected