diff --git a/hive-c0re/src/agent_server.rs b/hive-c0re/src/agent_server.rs index 564b150..f77f953 100644 --- a/hive-c0re/src/agent_server.rs +++ b/hive-c0re/src/agent_server.rs @@ -188,5 +188,16 @@ async fn dispatch(req: &AgentRequest, agent: &str, coord: &Arc) -> }, } } + AgentRequest::Remind { + message, + timing, + file_path, + } => { + // TODO: submit to reminder scheduler + // For now, return a stub response + AgentResponse::Err { + message: "remind not yet implemented".to_owned(), + } + } } } diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 2035fe4..ed81051 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -169,6 +169,17 @@ pub struct InboxRow { pub at: i64, } +/// Reminder timing: either relative (wait N seconds) or absolute (at unix +/// timestamp). +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "timing_type", rename_all = "snake_case")] +pub enum ReminderTiming { + /// Remind after this many seconds from now. + InSeconds { seconds: u64 }, + /// Remind at this unix timestamp (seconds since epoch). + At { unix_timestamp: i64 }, +} + /// Requests on a per-agent socket. The agent's identity is the socket /// it came in on; `Send.from` is filled in by the server, not the client. #[derive(Debug, Clone, Serialize, Deserialize)] @@ -218,6 +229,18 @@ pub enum AgentRequest { #[serde(default)] ttl_seconds: Option, }, + /// Schedule a reminder message to be delivered to this agent at a + /// future time. The reminder lands in the agent's inbox as an auto-sent + /// message from `"reminder"`. Use for agent follow-ups (e.g. check task + /// status, retry failed operation). Message length is limited; pass + /// `file_path` to store in a file and get a path-reference message + /// instead. + Remind { + message: String, + timing: ReminderTiming, + #[serde(default)] + file_path: Option, + }, } /// Responses on a per-agent socket.