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
feat(tui): add session state and controls to the terminal UI
Steven Enamakel161d7f83eebd
diff --git a/crates/openhuman-tui/src/app.rs b/crates/openhuman-tui/src/app.rsindex 85b51eda9b..6a187a4c44 100644--- a/crates/openhuman-tui/src/app.rs+++ b/crates/openhuman-tui/src/app.rs@@ -22,9 +22,9 @@ use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyEventKind, KeyModifieruse serde_json::json;use tokio::sync::broadcast;-use openhuman_core::core::runtime::CoreRuntime;-use openhuman_core::web_chat;-use openhuman_core::web_chat::WebChannelEvent;+use openhuman_rpc::embed::chat_surface as web_chat;+use openhuman_rpc::embed::chat_surface::WebChannelEvent;+use openhuman_rpc::embed::CoreRuntime;use super::cockpit::{array_at, row_from_value, Overlay, OverlayKind, OverlayRow, PendingApproval, PendingPlanReview,diff --git a/crates/openhuman-tui/src/controls.rs b/crates/openhuman-tui/src/controls.rsindex dd592c9da4..4a8c2f3623 100644--- a/crates/openhuman-tui/src/controls.rs+++ b/crates/openhuman-tui/src/controls.rs@@ -6,7 +6,7 @@ use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};use serde_json::json;use zeroize::Zeroize;-use openhuman_core::core::runtime::CoreRuntime;+use openhuman_rpc::embed::CoreRuntime;use super::ui_state::{ConfigKey, SettingsAction, UiState};diff --git a/crates/openhuman-tui/src/lib.rs b/crates/openhuman-tui/src/lib.rsindex 04a3f38cc2..ba6e6065de 100644--- a/crates/openhuman-tui/src/lib.rs+++ b/crates/openhuman-tui/src/lib.rs@@ -5,7 +5,7 @@//! agent/skill/MCP/artifact views, Git review, and a multiline composer.//! Chat uses the **same `web_chat` surface** the desktop app drives (`openhuman.channel_web_chat` ///! `openhuman.channel_web_cancel` +-//! [`web_chat::subscribe_web_channel_events`](openhuman_core::web_chat::subscribe_web_channel_events)).+//! [`web_chat::subscribe_web_channel_events`](openhuman_rpc::embed::chat_surface::subscribe_web_channel_events)).//! It boots the core in-process — no HTTP, no sockets — via//! `CoreBuilder::new(HostKind::Cli).domains(DomainSet::full()).services(ServiceSet::none())`//! and streams a live transcript in the terminal.diff --git a/crates/openhuman-tui/src/render.rs b/crates/openhuman-tui/src/render.rsindex 7e789f1833..09d59cb9f1 100644--- a/crates/openhuman-tui/src/render.rs+++ b/crates/openhuman-tui/src/render.rs@@ -81,7 +81,7 @@ fn draw_chat(frame: &mut Frame, area: Rect, state: &TranscriptState, ui: &UiStat}fn draw_logs(frame: &mut Frame, area: Rect, ui: &UiState) {- let lines = openhuman_core::core::logging::tui_log_lines();+ let lines = openhuman_rpc::embed::process::tui_log_lines();let text = if lines.is_empty() {Text::from("Core logs will appear here as OpenHuman starts.")} else {diff --git a/crates/openhuman-tui/src/runner_tests.rs b/crates/openhuman-tui/src/runner_tests.rsindex 085df170f1..bc59cdc902 100644--- a/crates/openhuman-tui/src/runner_tests.rs+++ b/crates/openhuman-tui/src/runner_tests.rs@@ -67,17 +67,17 @@ fn tui_invokes_use_canonical_registered_rpc_method_names() {"openhuman.auth_get_state",// Session ownership lives in `openhuman-tinyhumans`; these are the// credential RPCs its `CoreLink` drives through the in-process link.- openhuman_tinyhumans::link::AUTH_GET_STATE,- openhuman_tinyhumans::link::AUTH_GET_SESSION_TOKEN,- openhuman_tinyhumans::link::AUTH_SET_CREDENTIAL,- openhuman_tinyhumans::link::AUTH_CLEAR_CREDENTIAL,- openhuman_tinyhumans::link::CONFIG_RESOLVE_API_URL,+ openhuman_rpc::tinyhumans::link::AUTH_GET_STATE,+ openhuman_rpc::tinyhumans::link::AUTH_GET_SESSION_TOKEN,+ openhuman_rpc::tinyhumans::link::AUTH_SET_CREDENTIAL,+ openhuman_rpc::tinyhumans::link::AUTH_CLEAR_CREDENTIAL,+ openhuman_rpc::tinyhumans::link::CONFIG_RESOLVE_API_URL,];methods.push("openhuman.skills_list");methods.push("openhuman.mcp_clients_installed_list");for method in methods {assert!(- openhuman_core::core::all::schema_for_rpc_method(method).is_some(),+ openhuman_rpc::embed::schema_for_rpc_method(method).is_some(),"TUI invokes `{method}`, but it is not a registered RPC method — \the tabbed terminal UI would fail with `unknown method: {method}`");diff --git a/crates/openhuman-tui/src/session.rs b/crates/openhuman-tui/src/session.rsindex 02cc6b1676..85cb0089a7 100644--- a/crates/openhuman-tui/src/session.rs+++ b/crates/openhuman-tui/src/session.rs@@ -6,8 +6,8 @@use std::sync::{Arc, OnceLock};use async_trait::async_trait;-use openhuman_core::core::runtime::CoreRuntime;-use openhuman_tinyhumans::{ClientHeaders, CoreLink, SessionManager};+use openhuman_rpc::embed::CoreRuntime;+use openhuman_rpc::tinyhumans::{ClientHeaders, CoreLink, SessionManager};/// `CoreLink` over `CoreRuntime::invoke` — no HTTP, no bearer.pub struct InProcessLink(pub Arc<CoreRuntime>);@@ -30,7 +30,7 @@ static MANAGER: OnceLock<Arc<SessionManager<InProcessLink>>> = OnceLock::new();/// same manager regardless of the handle they pass.pub fn session_manager(runtime: &Arc<CoreRuntime>) -> Arc<SessionManager<InProcessLink>> {Arc::clone(MANAGER.get_or_init(|| {- let headers = ClientHeaders::new(openhuman_tinyhumans::product_identity().as_str())+ let headers = ClientHeaders::new(openhuman_rpc::tinyhumans::product_identity().as_str()).with_core_version(env!("CARGO_PKG_VERSION"));SessionManager::new(Arc::new(InProcessLink(Arc::clone(runtime))), headers)}))diff --git a/crates/openhuman-tui/src/state.rs b/crates/openhuman-tui/src/state.rsindex 57708d3670..8ac5fcf912 100644--- a/crates/openhuman-tui/src/state.rs+++ b/crates/openhuman-tui/src/state.rs@@ -10,7 +10,7 @@//! into the transcript. Events for a different `client_id` are ignored, so a//! process-wide broadcast bus can be drained safely.-use openhuman_core::web_chat::WebChannelEvent;+use openhuman_rpc::embed::chat_surface::WebChannelEvent;/// The kind of a transcript entry — drives colour / prefix in the renderer.#[derive(Debug, Clone, Copy, PartialEq, Eq)]