#![cfg(all(feature = "comms", feature = "memory"))]
use serde::{Deserialize, Serialize};
use crate::mcp::types_governance::ProposalRecord;
use crate::mcp::types_memory::MemoryRecord;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum GovernanceOp {
ProposalsList {
kind_bytes: Vec<u8>,
limit: u32,
scan_cap: u32,
cursor: Option<Vec<u8>>,
},
ProposalReject {
id: String,
},
ProposalsMineApply {
candidates: Vec<(String, ProposalRecord)>,
},
ProposalGet {
id: String,
},
ProposalPromote {
proposal_id: String,
memory_key: String,
record: MemoryRecord,
},
AuditScan {
vis_byte: u8,
owner: String,
key: Option<String>,
from_archive: bool,
limit: u32,
scan_cap: u32,
},
AuditPersist {
mutations: Vec<AuditMutation>,
},
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AuditMutation {
pub vis_byte: u8,
pub owner: String,
pub key: String,
pub record: MemoryRecord,
pub archive: bool,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum GovernanceOutcome {
ProposalsListed {
items: Vec<(String, ProposalRecord)>,
truncated: bool,
next_cursor: Option<Vec<u8>>,
},
Rejected,
Mined {
count: u32,
},
Proposal(Option<ProposalRecord>),
Promoted,
AuditScanned {
items: Vec<(String, Vec<u8>)>,
},
AuditPersisted,
}