Skip to content

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

feat(inbound): add settings module for inbound configuration

Steven Enamakela5ef4ad0fd5c
diff --git a/Cargo.lock b/Cargo.lock
index 4b954fb4a8..c27fc5aa9c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5459,6 +5459,7 @@ dependencies = [
"tinycomputer-bus",
"tinyconnectors-bus",
"tinydocs-bus",
+ "tinyeventqueues-bus",
"tinyflows",
"tinyflows-bus",
"tinyflows-catalog",
@@ -9102,6 +9103,15 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "tinyeventqueues-bus"
+version = "0.1.1"
+dependencies = [
+ "serde",
+ "serde_json",
+ "tinystoragedrivers-core",
+]
+
[[package]]
name = "tinyflows"
version = "0.8.23"
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rs
index 5f2afa33c2..1bc1377bce 100644
--- a/crates/openhuman-core/src/core/all.rs
+++ b/crates/openhuman-core/src/core/all.rs
@@ -342,6 +342,14 @@ fn build_registered_controllers() -> Vec<GroupedController> {
DomainGroup::Flows,
crate::flows::all_flows_registered_controllers(),
);
+ // Inbound event queues: depths, dead letters, redrive (`[components]
+ // eventqueues`; the handlers answer COMPONENT_DISABLED when it is off).
+ #[cfg(feature = "inbound-queues")]
+ push(
+ &mut controllers,
+ DomainGroup::Automation,
+ crate::inbound::all_inbound_registered_controllers(),
+ );
// Proactive task ingestion from external tools (github/notion/linear/clickup)
push(
&mut controllers,
@@ -789,6 +797,9 @@ pub fn namespace_description(namespace: &str) -> Option<&'static str> {
"Connectivity diagnostics for the local sidecar, listening port, and backend Socket.IO state.",
),
"cron" => Some("Manage scheduled jobs and run history."),
+ "inbound" => Some(
+ "Inbound event queues: depths and outcome counts, dead letters and redrive.",
+ ),
"flows" => Some("Create, store, and run automation workflows."),
"dashboard" => {
Some("Operator-facing dashboard aggregations: per-model health comparison rows.")
diff --git a/crates/openhuman-core/src/inbound/mod.rs b/crates/openhuman-core/src/inbound/mod.rs
index e587bb828c..58c67ec528 100644
--- a/crates/openhuman-core/src/inbound/mod.rs
+++ b/crates/openhuman-core/src/inbound/mod.rs
@@ -35,4 +35,5 @@ pub use schemas::{
all_controller_schemas as all_inbound_controller_schemas,
all_registered_controllers as all_inbound_registered_controllers,
};
-pub use settings::{active, module_config, queue_grant};
+pub(crate) use settings::queue_grant;
+pub use settings::{active, module_config};
diff --git a/crates/openhuman-core/src/inbound/settings.rs b/crates/openhuman-core/src/inbound/settings.rs
index e60576c1fc..d02cb2ab30 100644
--- a/crates/openhuman-core/src/inbound/settings.rs
+++ b/crates/openhuman-core/src/inbound/settings.rs
@@ -157,7 +157,7 @@ pub fn module_config(config: &Config) -> Value {
/// The queues the storage host grants the module: the manifest it was
/// configured with and where they live.
#[must_use]
-pub fn queue_grant() -> Option<QueueGrant> {
+pub(crate) fn queue_grant() -> Option<QueueGrant> {
let resolved = current();
Some(QueueGrant {
manifest: Arc::clone(&resolved.manifest),
diff --git a/crates/openhuman-core/src/modules/ops.rs b/crates/openhuman-core/src/modules/ops.rs
index 4a83048f3a..38a16f9b03 100644
--- a/crates/openhuman-core/src/modules/ops.rs
+++ b/crates/openhuman-core/src/modules/ops.rs
@@ -295,6 +295,12 @@ fn module_config(config: &Config, id: &str) -> serde_json::Value {
if id == super::desktop::MODULE_ID {
return super::desktop::module_config(config);
}
+ // The queue manifest and pipeline the inbound event queues run; the
+ // storage host declares the same manifest on the module's scope.
+ #[cfg(feature = "inbound-queues")]
+ if id == super::event_queues::MODULE_ID {
+ return crate::inbound::module_config(config);
+ }
if id == super::connectors::MODULE_ID {
// The connector module takes its route and credential from here and
// reads one from nowhere else. A configuration that cannot be built —
diff --git a/crates/openhuman-core/src/modules/runtime.rs b/crates/openhuman-core/src/modules/runtime.rs
index bf04ae50b5..5a5fd67975 100644
--- a/crates/openhuman-core/src/modules/runtime.rs
+++ b/crates/openhuman-core/src/modules/runtime.rs
@@ -115,6 +115,16 @@ async fn install_callbacks(runtime: &'static ModuleRuntime) -> tinybus::Result<(
}
#[cfg(feature = "web3")]
super::wallet_host::install(connection).await?;
+ // Deliver / ClassifySalience for the inbound event queues; with the
+ // component off the module never loads, so nothing would call them.
+ #[cfg(feature = "inbound-queues")]
+ {
+ if host.components().eventqueues {
+ crate::inbound::host::install(connection).await?;
+ } else {
+ tracing::debug!("[modules] eventqueues component off; inbound Host not served");
+ }
+ }
Ok(())
}