The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: files changed crates/openhuman-core/src/desktop/notifications/store_import.rs,crates/openhuma
Steven Enamakel8ae9664a2acb
diff --git a/crates/openhuman-core/src/desktop/notifications/store_import.rs b/crates/openhuman-core/src/desktop/notifications/store_import.rsindex b8f811e945..de455a2e14 100644--- a/crates/openhuman-core/src/desktop/notifications/store_import.rs+++ b/crates/openhuman-core/src/desktop/notifications/store_import.rs@@ -24,7 +24,7 @@ use super::super::store_documents::{core_id, to_doc, CORE, LOCAL_WORKSPACE, NOTIFICATIONS, SETTINGS,};use crate::config::Config;-use crate::storage::local::{table_exists, ImportDoc};+use crate::storage::import::{table_exists, ImportDoc};/// The legacy tables this import retires.pub(crate) const TABLES: &[&str] = &[diff --git a/crates/openhuman-core/src/integrations/task_sources/store_import.rs b/crates/openhuman-core/src/integrations/task_sources/store_import.rsindex 3b95d0a75d..3587850f52 100644--- a/crates/openhuman-core/src/integrations/task_sources/store_import.rs+++ b/crates/openhuman-core/src/integrations/task_sources/store_import.rs@@ -15,7 +15,7 @@ use serde_json::{json, Map, Value};use super::super::store_documents::{ingested_id, to_doc, INGESTED, SOURCES};use crate::config::Config;-use crate::storage::local::{table_exists, ImportDoc};+use crate::storage::import::{table_exists, ImportDoc};/// The legacy tables this import retires.pub(crate) const TABLES: &[&str] = &["task_sources", "ingested_tasks"];diff --git a/crates/openhuman-core/src/security/approval/store_import.rs b/crates/openhuman-core/src/security/approval/store_import.rsindex 4af709c277..a1e19f4c6b 100644--- a/crates/openhuman-core/src/security/approval/store_import.rs+++ b/crates/openhuman-core/src/security/approval/store_import.rs@@ -17,7 +17,7 @@ use serde_json::{json, Map, Value};use super::super::store_documents::{expiry_key, rfc3339, trust_id, APPROVALS, FLOW_TRUST};use crate::config::Config;-use crate::storage::local::{table_exists, ImportDoc};+use crate::storage::import::{table_exists, ImportDoc};/// The legacy tables this import retires.pub(crate) const TABLES: &[&str] = &["pending_approvals", "flow_tool_trust"];diff --git a/crates/openhuman-core/src/security/devices/store_import.rs b/crates/openhuman-core/src/security/devices/store_import.rsindex 0dcd8cc7f2..6f52aa7cb5 100644--- a/crates/openhuman-core/src/security/devices/store_import.rs+++ b/crates/openhuman-core/src/security/devices/store_import.rs@@ -12,7 +12,7 @@ use serde_json::{json, Value};use super::super::store_documents::DEVICES;use crate::config::Config;-use crate::storage::local::{table_exists, ImportDoc};+use crate::storage::import::{table_exists, ImportDoc};/// The legacy tables this import retires.pub(crate) const TABLES: &[&str] = &["paired_devices"];diff --git a/crates/openhuman-core/src/storage/import/mod.rs b/crates/openhuman-core/src/storage/import/mod.rsindex 279aae4119..0c28bd23cd 100644--- a/crates/openhuman-core/src/storage/import/mod.rs+++ b/crates/openhuman-core/src/storage/import/mod.rs@@ -50,12 +50,38 @@ use sha2::Digest;use tinystoragedrivers::{CollectionSpec, ErrorKind, Precondition};use super::documents::Repo;-use super::local::ImportDoc;+use super::rusqlite;+use rusqlite::Connection;+use serde_json::Value;use super::{block_on, Scope, StorageBackend};use crate::config::Config;pub use snapshot::Snapshot;+/// One legacy row as a document of the new layout.+#[derive(Debug, Clone, PartialEq)]+pub struct ImportDoc {+ /// The collection the store keeps it in.+ pub collection: &'static str,+ /// The document id.+ pub id: String,+ /// The document body.+ pub doc: Value,+}++/// Whether `table` exists on `conn`.+///+/// # Errors+///+/// When the catalog cannot be read.+pub fn table_exists(conn: &Connection, table: &str) -> rusqlite::Result<bool> {+ conn.query_row(+ "SELECT EXISTS(SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?1)",+ [table],+ |row| row.get(0),+ )+}+/// One record to write: a legacy row, or a driver document, in the shape the/// installed backend expects.#[derive(Debug, Clone, PartialEq)]