Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(storage): update storage trait usage in importers

Steven Enamakeld61bb69a869d
diff --git a/crates/openhuman-core/src/storage/host_importers.rs b/crates/openhuman-core/src/storage/host_importers.rs
index c496540ea4..aea5f1a06f 100644
--- a/crates/openhuman-core/src/storage/host_importers.rs
+++ b/crates/openhuman-core/src/storage/host_importers.rs
@@ -8,12 +8,12 @@
//! importers are. Each is idempotent and drops its v1 collection once moved,
//! so a finished move costs one collection listing.
-use tinystoragedrivers::{ScopedStorage, StorageError};
+use tinystoragedrivers::{Storage, StorageError};
/// Runs every host importer over `scoped`. Returns `(importer, error)` for each
/// one that failed; the others still ran, and a failed one is retried at the
/// next boot.
-pub(super) async fn run(scoped: &ScopedStorage) -> Vec<(&'static str, StorageError)> {
+pub(super) async fn run(scoped: &Storage) -> Vec<(&'static str, StorageError)> {
let mut failed = Vec::new();
if let Err(error) = crate::integrations::composio::migrate_legacy_state(scoped).await {
failed.push(("composio_state_to_kv", error));
diff --git a/crates/openhuman-core/src/storage/import/snapshot.rs b/crates/openhuman-core/src/storage/import/snapshot.rs
index f2563c1ee1..f74c1dbb59 100644
--- a/crates/openhuman-core/src/storage/import/snapshot.rs
+++ b/crates/openhuman-core/src/storage/import/snapshot.rs
@@ -71,7 +71,8 @@ impl Snapshot {
///
/// When the copy cannot be opened with the SQLite driver or read.
pub fn driver_docs(&self, collections: fn() -> Vec<CollectionSpec>) -> Result<Vec<Record>> {
- use tinystoragedrivers::{DocumentStoreExt, Query, StorageBackend};
+ use crate::storage::DocumentStoreExt;
+ use tinystoragedrivers::{Query, StorageBackend};
let storage = tinystoragedrivers::sqlite::SqliteStorage::open(&self.db)
.with_context(|| format!("open the copy {}", self.db.display()))?;
diff --git a/crates/openhuman-core/src/storage/import_state.rs b/crates/openhuman-core/src/storage/import_state.rs
index db28f7fdca..01a9b0ec04 100644
--- a/crates/openhuman-core/src/storage/import_state.rs
+++ b/crates/openhuman-core/src/storage/import_state.rs
@@ -4,16 +4,17 @@
//! collection is deliberately separate from Tiny Storage Drivers' schemas:
//! the host owns importer names, completion records, and claim policy.
-use std::sync::Arc;
use std::time::{Duration, Instant};
use anyhow::Result;
use serde::{Deserialize, Serialize};
use tinystoragedrivers::{
- CollectionSpec, DocumentStore, DocumentStoreExt, ErrorKind, ExpectedDocument, Precondition,
- ReadCheck, Storage, StorageError, Versioned, WriteOp,
+ CollectionSpec, ErrorKind, ExpectedDocument, Precondition, ReadCheck, Storage, StorageError,
+ Versioned, WriteOp,
};
+use tinystoragedrivers_api::DocumentStore;
+use super::DocumentStoreExt;
use super::documents::Repo;
/// How long a claim blocks other processes before it can be taken over.