agentmux_srv_core/backend/
prompt_events.rs1use serde::Serialize;
10
11pub const EVENT_SENSITIVE_PENDING: &str = "sensitive:pending";
12pub const EVENT_SENSITIVE_CLEARED: &str = "sensitive:cleared";
13pub const EVENT_AGENT_NOTICE: &str = "agent:notice";
14pub const EVENT_AGENT_GRANTS: &str = "agent:grants";
15pub const EVENT_PANE_CONFIRM: &str = "pane:confirm";
16
17#[derive(Clone, Debug, Serialize, PartialEq, Eq, ts_rs::TS)]
19#[ts(export, export_to = "../../../frontend/types/rpc/")]
20pub struct SensitiveView {
21 pub request_id: String,
22 pub op: String,
23 pub summary: String,
25 pub cancel_label: String,
27 pub now_label: String,
28 pub requester: String,
30 #[serde(skip_serializing_if = "Option::is_none")]
32 #[ts(optional)]
33 pub approver: Option<String>,
34 #[ts(type = "number")]
35 pub deadline_ms: i64,
36 #[ts(type = "number")]
39 pub opened_ms: i64,
40 #[ts(type = r#""pending" | "vetoed" | "cancelled" | "proceeding" | "done" | "failed""#)]
42 pub status: &'static str,
43 #[serde(skip_serializing_if = "Option::is_none")]
44 #[ts(optional)]
45 pub error: Option<String>,
46}
47
48#[derive(Clone, Debug, Serialize, ts_rs::TS)]
50#[ts(export, export_to = "../../../frontend/types/rpc/")]
51pub struct SensitiveClearedEvent {
52 pub request_id: String,
53 pub outcome: String,
54}
55
56#[derive(Clone, Debug, Serialize, PartialEq, Eq, ts_rs::TS)]
59#[ts(export, export_to = "../../../frontend/types/rpc/")]
60pub struct NoticeView {
61 pub id: String,
62 #[ts(type = r#""spawn" | "ssh" | "google" | "memory" | "github" | "aws""#)]
65 pub kind: &'static str,
66 pub block_id: String,
67 pub agent: String,
68 pub headline: String,
69 pub body: String,
70 pub quote: String,
72 pub always_label: String,
74 #[ts(type = "number")]
76 pub deadline_ms: i64,
77 #[ts(type = "number")]
78 pub opened_ms: i64,
79 #[ts(type = r#""pending" | "line" | "cleared""#)]
80 pub status: &'static str,
81 pub outcome: String,
83}
84
85#[derive(Clone, Debug, Serialize, PartialEq, Eq, ts_rs::TS)]
87#[ts(export, export_to = "../../../frontend/types/rpc/")]
88pub struct GrantsEvent {
89 #[ts(type = r#""spawn" | "google" | "memory""#)]
90 pub topic: &'static str,
91 pub agents: Vec<String>,
92}
93
94#[derive(Clone, Debug, Serialize, PartialEq, Eq, ts_rs::TS)]
96#[ts(export, export_to = "../../../frontend/types/rpc/")]
97pub struct PaneConfirmView {
98 pub id: String,
99 pub block_id: String,
100 pub title: String,
101 pub message: String,
102 pub ok_label: String,
103 pub cancel_label: String,
104 pub destructive: bool,
105 pub checkbox: String,
107 #[ts(type = "number")]
109 pub deadline_ms: i64,
110 #[ts(type = r#""pending" | "cleared""#)]
111 pub status: &'static str,
112}