add reminder ops to the in-agent socket protocol (#2635 inc 1)
This commit is contained in:
parent
94a172cba3
commit
18d21237bf
1 changed files with 30 additions and 7 deletions
|
|
@ -1,14 +1,15 @@
|
||||||
//! Wire types for the *in-agent* socket, served by the hive-agent harness
|
//! Wire types for the *in-agent* socket, served by the hive-agent harness
|
||||||
//! to the in-container producers (matrix / bash MCP daemons) and
|
//! to the in-container producers (matrix / bash MCP daemons) and
|
||||||
//! `forge_notify`. Currently carries the loose-ends-v2 *todo* op family;
|
//! `forge_notify`. Carries the loose-ends-v2 *todo* op family plus the
|
||||||
//! more in-agent request families may be added over time (the socket is
|
//! harness-local *reminder* op family (#2635 increment 1); more in-agent
|
||||||
//! deliberately named for the agent, not the todos).
|
//! request families may be added over time (the socket is deliberately
|
||||||
|
//! named for the agent, not the todos).
|
||||||
//!
|
//!
|
||||||
//! Distinct from `hive-core-agent-sock`, the *host*-served core↔agent
|
//! Distinct from `hive-core-agent-sock`, the *host*-served core↔agent
|
||||||
//! protocol on `/run/hive/mcp.sock`: this socket never leaves the
|
//! protocol on `/run/hive/mcp.sock`: this socket never leaves the
|
||||||
//! container. The harness owns the todo store locally and signals its own
|
//! container. The harness owns the todo + reminder stores locally and
|
||||||
//! turn loop directly, so hive-c0re is not in the todo path — no broker
|
//! signals its own turn loop directly, so hive-c0re is not in either path —
|
||||||
//! round-trip, no long-poll, no marker files.
|
//! no broker round-trip, no long-poll, no marker files.
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
|
@ -58,6 +59,25 @@ pub enum Request {
|
||||||
},
|
},
|
||||||
/// The agent marks one of its own todos done, by id.
|
/// The agent marks one of its own todos done, by id.
|
||||||
MarkTodoDone { id: i64 },
|
MarkTodoDone { id: i64 },
|
||||||
|
/// Schedule a reminder that fires into this agent's own turn loop at
|
||||||
|
/// `timing` (harness-local — no broker round-trip). Same semantics as
|
||||||
|
/// the old broker `Remind` request. `file_path`, when set, is where the
|
||||||
|
/// harness persists an over-cap body instead of inlining it.
|
||||||
|
StoreReminder {
|
||||||
|
message: String,
|
||||||
|
timing: hive_sh4re::ReminderTiming,
|
||||||
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
|
file_path: Option<String>,
|
||||||
|
},
|
||||||
|
/// List this agent's pending reminders (single-agent scope — unlike
|
||||||
|
/// the old broker query, there's no cross-agent `agent` filter here).
|
||||||
|
ListReminders,
|
||||||
|
/// Cancel one of this agent's own pending reminders by id, before it
|
||||||
|
/// fires.
|
||||||
|
CancelReminder { id: i64 },
|
||||||
|
/// This agent's pending-reminder count — used by the pre-`remind` cap
|
||||||
|
/// check and the harness's own turn-stats sink.
|
||||||
|
CountPendingReminders,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A response on the in-agent socket. Serialised with a `kind` tag,
|
/// A response on the in-agent socket. Serialised with a `kind` tag,
|
||||||
|
|
@ -69,8 +89,11 @@ pub enum Response {
|
||||||
Ok,
|
Ok,
|
||||||
/// Op succeeded and touched `count` rows (clear / mark-done).
|
/// Op succeeded and touched `count` rows (clear / mark-done).
|
||||||
Acked { count: u64 },
|
Acked { count: u64 },
|
||||||
/// `ListTodos` result.
|
/// `ListTodos` / `ListReminders` result (the latter wraps each row as
|
||||||
|
/// [`LooseEnd::Reminder`]).
|
||||||
LooseEnds { loose_ends: Vec<LooseEnd> },
|
LooseEnds { loose_ends: Vec<LooseEnd> },
|
||||||
|
/// `CountPendingReminders` result.
|
||||||
|
PendingRemindersCount { count: u64 },
|
||||||
/// Op failed; `message` is operator-facing.
|
/// Op failed; `message` is operator-facing.
|
||||||
Err { message: String },
|
Err { message: String },
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue