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
refactor(core): make queue manifest types public
Steven Enamakel0801229c888a
diff --git a/crates/openhuman-core/src/modules/mod.rs b/crates/openhuman-core/src/modules/mod.rsindex 0d8434ac85..b941d95dbe 100644--- a/crates/openhuman-core/src/modules/mod.rs+++ b/crates/openhuman-core/src/modules/mod.rs@@ -118,7 +118,7 @@ mod storage_import_tinymcp;#[cfg(all(feature = "modules", feature = "web3", feature = "legacy-import"))]mod storage_import_tinywallet;#[cfg(feature = "modules")]-pub(crate) mod storage_queue_manifest;+pub mod storage_queue_manifest;pub mod tinybox;pub(crate) mod tinyflows;#[cfg(feature = "modules")]diff --git a/crates/openhuman-core/src/modules/storage_queue_manifest.rs b/crates/openhuman-core/src/modules/storage_queue_manifest.rsindex 8999e6689c..ac3ae749b0 100644--- a/crates/openhuman-core/src/modules/storage_queue_manifest.rs+++ b/crates/openhuman-core/src/modules/storage_queue_manifest.rs@@ -7,10 +7,14 @@ use std::collections::BTreeMap;use serde::{Deserialize, Serialize};use tinystoragedrivers_types::QueueSpec;-/// A validated version-1 queue manifest supplied by the host.+/// An opaque, validated version-1 queue manifest supplied by the host.+///+/// This type is public because it appears in the public `StorageGrant` and+/// inbound settings contracts. Its contents remain host-managed; construct it+/// through [`QueueManifest::from_json`] so validation cannot be bypassed.#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]#[serde(deny_unknown_fields)]-pub(crate) struct QueueManifest {+pub struct QueueManifest {#[serde(default, rename = "$schema", skip_serializing_if = "Option::is_none")]schema: Option<String>,version: u32,@@ -20,18 +24,18 @@ pub(crate) struct QueueManifest {/// Host policy for one queue.#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]#[serde(deny_unknown_fields)]-pub(crate) struct QueueDeclaration {- pub(crate) name: String,+pub struct QueueDeclaration {+ pub name: String,#[serde(default, skip_serializing_if = "String::is_empty")]- pub(crate) description: String,+ pub description: String,#[serde(default, skip_serializing_if = "Option::is_none")]- pub(crate) owner: Option<String>,+ pub owner: Option<String>,#[serde(default = "default_max_attempts")]- pub(crate) max_attempts: u32,+ pub max_attempts: u32,#[serde(default)]- pub(crate) dedupe_window_ms: u64,+ pub dedupe_window_ms: u64,#[serde(default, skip_serializing_if = "Option::is_none")]- pub(crate) visibility_ms: Option<u64>,+ pub visibility_ms: Option<u64>,}fn default_max_attempts() -> u32 {@@ -40,7 +44,7 @@ fn default_max_attempts() -> u32 {impl QueueDeclaration {/// The storage-port queue behavior declared by this host policy.- pub(crate) fn spec(&self) -> QueueSpec {+ pub fn spec(&self) -> QueueSpec {QueueSpec {max_attempts: self.max_attempts,dedupe_window_ms: self.dedupe_window_ms,@@ -50,7 +54,7 @@ impl QueueDeclaration {impl QueueManifest {/// Parse and validate a manifest. Unknown fields and names fail closed.- pub(crate) fn from_json(text: &str) -> Result<Self, String> {+ pub fn from_json(text: &str) -> Result<Self, String> {let mut manifest: Self = serde_json::from_str(text).map_err(|error| error.to_string())?;manifest.validate()?;manifest@@ -60,7 +64,7 @@ impl QueueManifest {}/// Validate a value assembled by host code.- pub(crate) fn validate(&self) -> Result<(), String> {+ pub fn validate(&self) -> Result<(), String> {if self.version != 1 {return Err(format!("unsupported queue manifest version {}",@@ -100,12 +104,12 @@ impl QueueManifest {}/// Look up a declaration by exact queue name.- pub(crate) fn get(&self, name: &str) -> Option<&QueueDeclaration> {+ pub fn get(&self, name: &str) -> Option<&QueueDeclaration> {self.queues.iter().find(|queue| queue.name == name)}/// Declarations for one-time host setup.- pub(crate) fn queues(&self) -> &[QueueDeclaration] {+ pub fn queues(&self) -> &[QueueDeclaration] {&self.queues}}diff --git a/crates/openhuman-core/src/storage/scope_move.rs b/crates/openhuman-core/src/storage/scope_move.rsindex 8055ee7277..365d41a70e 100644--- a/crates/openhuman-core/src/storage/scope_move.rs+++ b/crates/openhuman-core/src/storage/scope_move.rs@@ -15,6 +15,7 @@//! unsupported fidelity cases fail explicitly.use std::collections::HashSet;+use std::path::{Path, PathBuf};use std::sync::Arc;use anyhow::Context;@@ -24,9 +25,7 @@ use tinystoragedrivers_types::{Capability, CollectionSpec, ErrorKind, WriteOptiouse super::scope::{scope_for_agent, scope_for_profile, tenant_scope};use crate::storage::import::Record;-use crate::storage::{- DocumentStore, DocumentStoreExt, Precondition, Scope, StorageBackend, StorageError,-};+use crate::storage::{Precondition, Scope, StorageBackend, StorageError};/// The ids a hashed v1 scope can be matched against.#[derive(Debug, Default, Clone)]