Download codex-rs/core/src/context/subagent_notification.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/core/src/context/subagent_notification.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/core/src/context/subagent_notification.rs
-
curl -L -o subagent_notification.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/core/src/context/subagent_notification.rs
1.19 kB
| use codex_protocol::models::ContentItemKind; | |
| use codex_protocol::protocol::AgentStatus; | |
| use super::ContextualUserFragment; | |
| pub(crate) struct SubagentNotification { | |
| pub(crate) agent_reference: String, | |
| pub(crate) status: AgentStatus, | |
| } | |
| impl SubagentNotification { | |
| pub(crate) fn new(agent_reference: impl Into<String>, status: AgentStatus) -> Self { | |
| Self { | |
| agent_reference: agent_reference.into(), | |
| status, | |
| } | |
| } | |
| } | |
| impl ContextualUserFragment for SubagentNotification { | |
| fn content_kind(&self) -> ContentItemKind { | |
| ContentItemKind("multi_agent.subagent_notification".to_string()) | |
| } | |
| fn role(&self) -> &'static str { | |
| "user" | |
| } | |
| fn markers(&self) -> (&'static str, &'static str) { | |
| Self::type_markers() | |
| } | |
| fn type_markers() -> (&'static str, &'static str) { | |
| ("<subagent_notification>", "</subagent_notification>") | |
| } | |
| fn body(&self) -> String { | |
| format!( | |
| "\n{}\n", | |
| serde_json::json!({ | |
| "agent_path": &self.agent_reference, | |
| "status": &self.status, | |
| }) | |
| ) | |
| } | |
| } | |