MCPcopy Create free account
hub / github.com/c4pt0r/pie / parse

Method parse

crates/coding-agent/src/hooks.rs:583–598  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

581
582impl HookEvent {
583 fn parse(s: &str) -> Option<Self> {
584 match s {
585 "agent_start" => Some(Self::AgentStart),
586 "agent_end" => Some(Self::AgentEnd),
587 "turn_start" => Some(Self::TurnStart),
588 "turn_end" => Some(Self::TurnEnd),
589 "message_start" => Some(Self::MessageStart),
590 "message_update" => Some(Self::MessageUpdate),
591 "message_end" => Some(Self::MessageEnd),
592 "tool_start" => Some(Self::ToolStart),
593 "tool_update" => Some(Self::ToolUpdate),
594 "tool_end" => Some(Self::ToolEnd),
595 "compaction" => Some(Self::Compaction),
596 _ => None,
597 }
598 }
599
600 fn as_str(self) -> &'static str {
601 match self {

Callers 6

handleAgentMessageMethod · 0.45
hub.test.mjsFile · 0.45
parse_thinkingFunction · 0.45
runMethod · 0.45
read_framedFunction · 0.45
content_lengthFunction · 0.45

Calls

no outgoing calls

Tested by 1

content_lengthFunction · 0.36