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

Method base_event

atomic-agent/src/hooks/agy.rs:733–748  ·  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

731 /// Parse the common base fields and build a TurnEvent with the session
732 /// ID and transcript path populated.
733 fn base_event(
734 &self,
735 hook_type: HookType,
736 conversation_id: Option<String>,
737 transcript_path: Option<String>,
738 ) -> TurnEvent {
739 let session_id = conversation_id
740 .filter(|s| !s.is_empty())
741 .unwrap_or_else(|| "unknown".to_string());
742
743 let mut event = TurnEvent::new(&session_id, hook_type);
744 if let Some(path) = transcript_path {
745 event = event.with_transcript_path(path);
746 }
747 event
748 }
749
750 /// Remove the Atomic hook group from a legacy project-level
751 /// `.agents/hooks.json`, if one exists from an older Atomic release.

Callers 1

parse_eventMethod · 0.80

Calls 2

with_transcript_pathMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected