use serde::{Deserialize, Serialize};
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemoryQueryParams {
pub agent_id: String,
#[serde(default)]
pub query: String,
#[serde(default)]
pub limit: usize,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemoryEntryWire {
pub id: String,
pub agent_id: String,
pub content: String,
#[serde(default)]
pub tags: Vec<String>,
#[serde(default)]
pub concept_tags: Vec<String>,
pub created_at: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub memory_type: Option<String>,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemoryQueryResponse {
pub entries: Vec<MemoryEntryWire>,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsListParams {
pub agent_id: String,
#[serde(default)]
pub tenant: String,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct SnapshotMetaWire {
pub id: String,
pub agent_id: String,
pub tenant: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
pub created_at_ms: i64,
pub bundle_path: String,
pub bundle_size_bytes: u64,
pub bundle_sha256: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub git_oid: Option<String>,
pub encrypted: bool,
pub redactions_applied: bool,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsListResponse {
pub snapshots: Vec<SnapshotMetaWire>,
#[serde(default)]
pub encryption_available: bool,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsDeleteParams {
pub agent_id: String,
#[serde(default)]
pub tenant: String,
pub id: String,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsDeleteResponse {
pub removed: bool,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsCreateParams {
pub agent_id: String,
#[serde(default)]
pub tenant: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(default)]
pub encrypt: bool,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsCreateResponse {
pub snapshot: SnapshotMetaWire,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsRestoreParams {
pub agent_id: String,
pub tenant: String,
pub snapshot_id: String,
#[serde(default)]
pub dry_run: bool,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct RestoreReportWire {
pub agent_id: String,
pub from_snapshot_id: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pre_snapshot_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub git_reset_oid: Option<String>,
pub sqlite_restored_dbs: Vec<String>,
pub state_files_restored: Vec<String>,
pub workers_restarted: bool,
pub dry_run: bool,
}
#[cfg_attr(feature = "ts-export", derive(ts_rs::TS), ts(export))]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemorySnapshotsRestoreResponse {
pub report: RestoreReportWire,
}