pub struct NotificationEntry {Show 13 fields
pub id: String,
pub goal_id: String,
pub session_id: String,
pub notification_type: String,
pub priority: String,
pub message: String,
pub created_at: String,
pub delivered_at: Option<String>,
pub attempts: i32,
pub expires_at: Option<String>,
pub task_id: Option<String>,
pub action_token: Option<String>,
pub untrusted: bool,
}Fields§
§id: String§goal_id: String§session_id: String§notification_type: String“completed”, “failed”, “escalation”, “progress”, “stalled”, “evergreen_alert”, “token_alert”
priority: String“critical” (persist indefinitely) or “status_update” (expire after 24h)
message: String§created_at: String§delivered_at: Option<String>§attempts: i32§expires_at: Option<String>When this notification expires (None = never, for critical notifications)
task_id: Option<String>Optional durable work item associated with this notification.
action_token: Option<String>Opaque token reserved for channel-native actions.
untrusted: boolThe message carries content someone other than the owner wrote (a tainted child’s result): delivering it into the session taints the turn that records it.
Implementations§
Source§impl NotificationEntry
impl NotificationEntry
pub const DEFAULT_QUIET_HOURS_START: u32 = 22
pub const DEFAULT_QUIET_HOURS_END: u32 = 7
Sourcepub fn new(
goal_id: &str,
session_id: &str,
notification_type: &str,
message: &str,
) -> Self
pub fn new( goal_id: &str, session_id: &str, notification_type: &str, message: &str, ) -> Self
Create a new notification entry.
Sourcepub fn with_untrusted(self, untrusted: bool) -> Self
pub fn with_untrusted(self, untrusted: bool) -> Self
Mark the message as carrying untrusted content.
pub fn with_task(self, task_id: &str) -> Self
Sourcepub fn interrupts_quiet_hours(&self) -> bool
pub fn interrupts_quiet_hours(&self) -> bool
Whether this notification represents a condition that genuinely needs immediate owner attention instead of routine autonomous handling.
pub fn should_deliver_at_local_hour(&self, hour: u32) -> bool
pub fn routine_delivery_allowed_at_local_hour(hour: u32) -> bool
Trait Implementations§
Source§impl Clone for NotificationEntry
impl Clone for NotificationEntry
Source§impl Debug for NotificationEntry
impl Debug for NotificationEntry
Source§impl<'de> Deserialize<'de> for NotificationEntry
impl<'de> Deserialize<'de> for NotificationEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for NotificationEntry
impl Freeze for NotificationEntry
impl Move for NotificationEntry
impl RefUnwindSafe for NotificationEntry
impl Send for NotificationEntry
impl Sync for NotificationEntry
impl Unpin for NotificationEntry
impl UnsafeUnpin for NotificationEntry
impl UnwindSafe for NotificationEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more