Skip to content

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

feat(tinyhumans): add session management and Windows TLS support

Steven Enamakelf5b3bb502e27
diff --git a/crates/openhuman-tinyhumans/Cargo.toml b/crates/openhuman-tinyhumans/Cargo.toml
index b95adef864..a25ef7bccc 100644
--- a/crates/openhuman-tinyhumans/Cargo.toml
+++ b/crates/openhuman-tinyhumans/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "openhuman-tinyhumans"
-description = "OpenHuman embed runtime wired to the hosted TinyHumans backend through the tinyhumans-sdk"
+description = "OpenHuman on the hosted TinyHumans backend: the SDK-backed transport, an embed runtime that boots connected, and the host-side login/session owner"
version.workspace = true
edition.workspace = true
license.workspace = true
@@ -48,13 +48,24 @@ openhuman-core = { path = "../openhuman-core", package = "openhuman", default-fe
tinyhumans-sdk = { path = "../../vendor/tinyhumans-sdk", default-features = false }
anyhow = "1"
async-trait = "0.1"
+chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
log = "0.4"
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
-tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "time"] }
+tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread", "sync", "time"] }
+url = "2"
+
+[target.'cfg(target_os = "windows")'.dependencies]
+# Windows honours the OS certificate store through schannel so corporate
+# TLS-inspecting proxies keep working — the session client builds its HTTP
+# client through the core's `util::tls::tls_client_builder`, which needs the
+# `native-tls` backend compiled in.
+reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls", "native-tls"] }
[dev-dependencies]
+axum = "0.8"
tempfile = "3"
+tokio = { version = "1", features = ["macros", "rt-multi-thread", "net", "sync", "time"] }
wiremock = "0.6"
diff --git a/crates/openhuman-tinyhumans/src/lib.rs b/crates/openhuman-tinyhumans/src/lib.rs
index 23ffe48a31..b575c69145 100644
--- a/crates/openhuman-tinyhumans/src/lib.rs
+++ b/crates/openhuman-tinyhumans/src/lib.rs
@@ -7,9 +7,11 @@
//! runs without any TinyHumans connection.
//! - `openhuman-embed` is the library facade over the core.
//! - **this crate** implements the port with the vendored `tinyhumans-sdk`
-//! ([`SdkBackendTransport`]), installs it into a process ([`install`]) and
+//! ([`SdkBackendTransport`]), installs it into a process ([`install`]),
//! offers a [`RuntimeBuilder`] that boots an embed runtime already
-//! connected.
+//! connected, and owns the host-side **login and backend session**
+//! ([`session`]: [`SessionManager`], [`SessionClient`], [`CoreLink`]) — the
+//! core only ever *takes* a credential.
//!
//! ```no_run
//! # async fn demo() -> anyhow::Result<()> {
@@ -35,9 +37,21 @@ pub use openhuman_embed as embed;
mod install;
pub mod jwt;
mod runtime;
+pub mod session;
pub mod transport;
pub use install::{install, is_installed, InstallError, InstallOptions};
+pub use session::{
+ cache::{CachedUser, CurrentUserCache},
+ client::{ClientHeaders, FetchMeError, SessionClient, SessionClientError},
+ credential::{
+ decode_jwt_exp, jwt_is_live, user_id_from_jwt_claims, user_id_from_profile_payload,
+ Credential, CredentialKind,
+ },
+ identity,
+ link::{self, CoreAuthState, CoreLink},
+ manager::{SessionError, SessionEvent, SessionManager, SessionState},
+};
pub use openhuman_embed::{
BackendRequest, BackendTransport, BackendTransportError, TransportProfile,
};