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

Method base_event

atomic-agent/src/hooks/agy.rs:203–218  ·  view source on GitHub ↗

Parse the common base fields and build a TurnEvent with the session ID and transcript path populated.

(
        &self,
        hook_type: HookType,
        conversation_id: Option<String>,
        transcript_path: Option<String>,
    )

Source from the content-addressed store, hash-verified

201 /// Parse the common base fields and build a TurnEvent with the session
202 /// ID and transcript path populated.
203 fn base_event(
204 &self,
205 hook_type: HookType,
206 conversation_id: Option<String>,
207 transcript_path: Option<String>,
208 ) -> TurnEvent {
209 let session_id = conversation_id
210 .filter(|s| !s.is_empty())
211 .unwrap_or_else(|| "unknown".to_string());
212
213 let mut event = TurnEvent::new(&session_id, hook_type);
214 if let Some(path) = transcript_path {
215 event = event.with_transcript_path(path);
216 }
217 event
218 }
219}
220
221// AgentHook Implementation

Callers 1

parse_eventMethod · 0.80

Calls 2

with_transcript_pathMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected