#[cfg(feature = "import")]
pub mod openclaw;
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct ImportOptions {
pub openclaw_path: PathBuf,
pub dry_run: bool,
pub re_embed: bool,
pub user_id: String,
}
#[derive(Debug, Clone, Default)]
pub struct ImportStats {
pub documents: usize,
pub chunks: usize,
pub conversations: usize,
pub messages: usize,
pub settings: usize,
pub secrets: usize,
pub skipped: usize,
pub re_embed_queued: usize,
}
impl ImportStats {
pub fn is_empty(&self) -> bool {
self.documents == 0
&& self.chunks == 0
&& self.conversations == 0
&& self.messages == 0
&& self.settings == 0
&& self.secrets == 0
}
pub fn total_imported(&self) -> usize {
self.documents
+ self.chunks
+ self.conversations
+ self.messages
+ self.settings
+ self.secrets
}
}
#[derive(Debug, thiserror::Error)]
pub enum ImportError {
#[error("OpenClaw not found at {path}: {reason}")]
NotFound { path: PathBuf, reason: String },
#[error("JSON5 parse error: {0}")]
ConfigParse(String),
#[error("SQLite error: {0}")]
Sqlite(String),
#[error("Database error: {0}")]
Database(String),
#[error("Workspace error: {0}")]
Workspace(String),
#[error("Secret error: {0}")]
Secret(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Invalid UTF-8: {0}")]
InvalidUtf8(String),
}