diff --git a/Cargo.lock b/Cargo.lock index 2efa32cfcaf..6b8af974616 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9594,7 +9594,7 @@ dependencies = [ [[package]] name = "tinycomputer" -version = "0.17.0" +version = "0.18.0" dependencies = [ "getrandom 0.4.3", "serde", @@ -9613,7 +9613,7 @@ dependencies = [ [[package]] name = "tinycomputer-accessibility" -version = "0.17.0" +version = "0.18.0" dependencies = [ "arboard", "command-group", @@ -9628,7 +9628,7 @@ dependencies = [ [[package]] name = "tinycomputer-browser" -version = "0.17.0" +version = "0.18.0" dependencies = [ "agent-browser", "base64 0.22.1", @@ -9647,7 +9647,7 @@ dependencies = [ [[package]] name = "tinycomputer-bus" -version = "0.17.0" +version = "0.18.0" dependencies = [ "base64 0.22.1", "serde", @@ -9657,7 +9657,7 @@ dependencies = [ [[package]] name = "tinycomputer-core" -version = "0.17.0" +version = "0.18.0" dependencies = [ "serde", "serde_json", @@ -9669,7 +9669,7 @@ dependencies = [ [[package]] name = "tinycomputer-cursor" -version = "0.17.0" +version = "0.18.0" dependencies = [ "getrandom 0.4.3", "serde", @@ -9679,7 +9679,7 @@ dependencies = [ [[package]] name = "tinycomputer-desktop" -version = "0.17.0" +version = "0.18.0" dependencies = [ "agent-desktop-core", "agent-desktop-linux", @@ -9694,7 +9694,7 @@ dependencies = [ [[package]] name = "tinycomputer-engine" -version = "0.17.0" +version = "0.18.0" dependencies = [ "getrandom 0.4.3", "image", diff --git a/crates/openhuman-app/Cargo.lock b/crates/openhuman-app/Cargo.lock index 6e6ce9b68c8..ecea2761eda 100644 --- a/crates/openhuman-app/Cargo.lock +++ b/crates/openhuman-app/Cargo.lock @@ -7901,7 +7901,7 @@ dependencies = [ [[package]] name = "tinycomputer-bus" -version = "0.17.0" +version = "0.18.0" dependencies = [ "base64 0.22.1", "serde", diff --git a/crates/openhuman-core/src/config/ops/computer.rs b/crates/openhuman-core/src/config/ops/computer.rs index 2b8eff88290..98f4dc1456e 100644 --- a/crates/openhuman-core/src/config/ops/computer.rs +++ b/crates/openhuman-core/src/config/ops/computer.rs @@ -17,6 +17,7 @@ pub struct ComputerSettingsPatch { pub rescue_model: Option, pub max_rescues: Option, pub captcha_solver: Option, + pub captcha_provider: Option, pub captcha_model: Option, pub max_captcha_attempts: Option, } @@ -38,6 +39,19 @@ fn parse_decision_model(raw: &str) -> Result { } } +/// The captcha solver's Jev provider in its wire spelling; empty restores +/// the default (`type_safe`). +fn parse_captcha_provider(raw: &str) -> Result, String> { + match raw.trim().to_ascii_lowercase().replace('-', "_").as_str() { + "" => Ok(None), + "type_safe" | "typesafe" => Ok(Some("type_safe".into())), + "surplus" => Ok(Some("surplus".into())), + other => Err(format!( + "Unsupported captcha provider '{other}'. Use type_safe or surplus" + )), + } +} + fn model_id(raw: String) -> Result, String> { let value = raw.trim(); if value.is_empty() { @@ -76,6 +90,9 @@ pub fn patched( if let Some(enabled) = update.captcha_solver { computer.captcha_solver = enabled; } + if let Some(raw) = update.captcha_provider { + computer.captcha_provider = parse_captcha_provider(&raw)?; + } if let Some(raw) = update.captcha_model { computer.captcha_model = model_id(raw)?; } @@ -101,6 +118,7 @@ pub async fn apply_computer_settings( rescue_model = ?config.computer.rescue_model, max_rescues = ?config.computer.max_rescues, captcha_solver = config.computer.captcha_solver, + captcha_provider = ?config.computer.captcha_provider, captcha_model = ?config.computer.captcha_model, max_captcha_attempts = ?config.computer.max_captcha_attempts, "[config] computer settings updated" diff --git a/crates/openhuman-core/src/config/ops/computer_tests.rs b/crates/openhuman-core/src/config/ops/computer_tests.rs index ac36862f481..7a459298e7d 100644 --- a/crates/openhuman-core/src/config/ops/computer_tests.rs +++ b/crates/openhuman-core/src/config/ops/computer_tests.rs @@ -109,3 +109,43 @@ fn patch_turns_the_captcha_solver_on_with_its_model_and_attempts() { assert_eq!(next.max_captcha_attempts, Some(4)); assert!(!ComputerConfig::default().captcha_solver, "off by default"); } + +#[test] +fn patch_selects_the_captcha_provider() { + let base = ComputerConfig::default(); + for (raw, stored) in [ + ("surplus", Some("surplus")), + (" Surplus ", Some("surplus")), + ("type_safe", Some("type_safe")), + ("Type-Safe", Some("type_safe")), + ("typesafe", Some("type_safe")), + (" ", None), + ] { + let next = patched( + &base, + ComputerSettingsPatch { + captcha_provider: Some(raw.into()), + ..ComputerSettingsPatch::default() + }, + ) + .unwrap(); + assert_eq!(next.captcha_provider.as_deref(), stored, "{raw:?}"); + } +} + +#[test] +fn an_unknown_captcha_provider_is_refused_with_the_accepted_values() { + let error = patched( + &ComputerConfig::default(), + ComputerSettingsPatch { + captcha_provider: Some("open_router".into()), + ..ComputerSettingsPatch::default() + }, + ) + .unwrap_err(); + assert!(error.contains("open_router"), "{error}"); + assert!( + error.contains("type_safe") && error.contains("surplus"), + "{error}" + ); +} diff --git a/crates/openhuman-core/src/config/schema/computer.rs b/crates/openhuman-core/src/config/schema/computer.rs index f7e2ff9122c..e77d0f96c49 100644 --- a/crates/openhuman-core/src/config/schema/computer.rs +++ b/crates/openhuman-core/src/config/schema/computer.rs @@ -46,11 +46,17 @@ pub struct ComputerConfig { /// `None` keeps the module's default (5, also its maximum). pub max_rescues: Option, /// Let a browser task try a captcha or "verify you are human" check with - /// Jev's image questions before it asks a person. Needs a TypeSafe key - /// (the `typesafe` credential or `TYPESAFE_API_KEY`). Off by default. + /// Jev's image questions before it asks a person. Needs a key for the + /// [`captcha_provider`](Self::captcha_provider): TypeSafe (the `typesafe` + /// credential or `TYPESAFE_API_KEY`) or Surplus (the `surplus` credential + /// or `SURPLUS_API_KEY`). Off by default. pub captcha_solver: bool, + /// Where the captcha solver's Jev runs: `type_safe` (TypeSafe's own API) + /// or `surplus` (Surplus Intelligence). `None` means `type_safe`. + pub captcha_provider: Option, /// The image-reading Jev model the captcha solver asks. `None` keeps the - /// module's default (`jev-preview`). + /// module's default for the provider (`jev-preview` on TypeSafe, + /// `jev-1.14` on Surplus). pub captcha_model: Option, /// Image challenges one try may submit before the task asks a person; /// `None` keeps the module's default (3). At most 10. diff --git a/crates/openhuman-core/src/config/schema/computer_tests.rs b/crates/openhuman-core/src/config/schema/computer_tests.rs index 1b805287369..c8f86ac59b9 100644 --- a/crates/openhuman-core/src/config/schema/computer_tests.rs +++ b/crates/openhuman-core/src/config/schema/computer_tests.rs @@ -27,3 +27,15 @@ fn parses_every_decision_model_and_rescue_settings() { } assert!(toml::from_str::("decision_model = \"jet\"").is_err()); } + +#[test] +fn the_captcha_provider_defaults_to_absent_and_round_trips() { + assert_eq!(ComputerConfig::default().captcha_provider, None); + let config: ComputerConfig = + toml::from_str("captcha_solver = true\ncaptcha_provider = \"surplus\"").unwrap(); + assert_eq!(config.captcha_provider.as_deref(), Some("surplus")); + let saved = toml::to_string(&config).unwrap(); + assert!(saved.contains("captcha_provider = \"surplus\""), "{saved}"); + let reloaded: ComputerConfig = toml::from_str(&saved).unwrap(); + assert_eq!(reloaded, config); +} diff --git a/crates/openhuman-core/src/config/schemas/controllers.rs b/crates/openhuman-core/src/config/schemas/controllers.rs index 0e6c0331545..5338656723e 100644 --- a/crates/openhuman-core/src/config/schemas/controllers.rs +++ b/crates/openhuman-core/src/config/schemas/controllers.rs @@ -12,6 +12,8 @@ mod workspace; pub use registry::{all_controller_schemas, all_registered_controllers}; +#[cfg(test)] +use agent::handle_update_computer_settings; #[cfg(test)] pub(super) use agent::{handle_get_autonomy_settings, handle_update_autonomy_settings}; #[cfg(test)] diff --git a/crates/openhuman-core/src/config/schemas/controllers/agent.rs b/crates/openhuman-core/src/config/schemas/controllers/agent.rs index b465b741ee2..8608ea04901 100644 --- a/crates/openhuman-core/src/config/schemas/controllers/agent.rs +++ b/crates/openhuman-core/src/config/schemas/controllers/agent.rs @@ -146,6 +146,7 @@ pub(super) fn handle_update_computer_settings( rescue_model: update.rescue_model, max_rescues: update.max_rescues, captcha_solver: update.captcha_solver, + captcha_provider: update.captcha_provider, captcha_model: update.captcha_model, max_captcha_attempts: update.max_captcha_attempts, }; diff --git a/crates/openhuman-core/src/config/schemas/controllers_tests.rs b/crates/openhuman-core/src/config/schemas/controllers_tests.rs index 69f68d9ec98..4403725dfa8 100644 --- a/crates/openhuman-core/src/config/schemas/controllers_tests.rs +++ b/crates/openhuman-core/src/config/schemas/controllers_tests.rs @@ -31,3 +31,28 @@ async fn handle_get_data_paths_scopes_to_explicit_user_id() { } // ── platform slug validation (finding #6) ─────────────────── + +// ── update_computer_settings captcha provider ──────────────── + +#[tokio::test] +async fn update_computer_settings_saves_the_captcha_provider() { + let dir = tempfile::tempdir().unwrap(); + let mut config = crate::config::Config::default(); + config.config_path = dir.path().join("config.toml"); + config.workspace_dir = dir.path().join("workspace"); + let ctx = DispatchCtx::new(crate::core::runtime::CoreContext::for_inspection(config)); + let mut params = Map::new(); + params.insert("captcha_solver".into(), Value::Bool(true)); + params.insert("captcha_provider".into(), Value::String("surplus".into())); + handle_update_computer_settings(ctx, params).await.unwrap(); + let saved = std::fs::read_to_string(dir.path().join("config.toml")).unwrap(); + assert!(saved.contains("captcha_provider = \"surplus\""), "{saved}"); + + let schema = super::super::schema_defs::schemas("update_computer_settings"); + let field = schema + .inputs + .iter() + .find(|field| field.name == "captcha_provider") + .expect("captcha_provider schema input"); + assert!(field.comment.contains("type_safe") && field.comment.contains("surplus")); +} diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rs index 64caeb782dc..c8caa55c922 100644 --- a/crates/openhuman-core/src/config/schemas/helpers.rs +++ b/crates/openhuman-core/src/config/schemas/helpers.rs @@ -115,6 +115,7 @@ pub(super) struct ComputerSettingsUpdate { pub(super) rescue_model: Option, pub(super) max_rescues: Option, pub(super) captcha_solver: Option, + pub(super) captcha_provider: Option, pub(super) captcha_model: Option, pub(super) max_captcha_attempts: Option, } diff --git a/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs b/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs index d3624a828ef..10a0cb99da8 100644 --- a/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs +++ b/crates/openhuman-core/src/config/schemas/schema_defs/agent.rs @@ -204,11 +204,15 @@ pub(super) fn lookup(function: &str) -> Option { ), optional_bool( "captcha_solver", - "Let browser tasks try a captcha with Jev's image questions before asking a person; needs a TypeSafe key.", + "Let browser tasks try a captcha with Jev's image questions before asking a person; needs a key for the captcha provider.", + ), + optional_string( + "captcha_provider", + "Captcha solver's Jev provider: type_safe (TYPESAFE_API_KEY) or surplus (SURPLUS_API_KEY); empty restores type_safe.", ), optional_string( "captcha_model", - "Image-reading Jev model for the captcha solver; empty restores the module default (jev-preview).", + "Image-reading Jev model for the captcha solver; empty restores the provider's default (jev-preview on type_safe, jev-1.14 on surplus).", ), optional_number( "max_captcha_attempts", diff --git a/crates/openhuman-core/src/modules/computer_config.rs b/crates/openhuman-core/src/modules/computer_config.rs index b19ceff8c56..f014bdd533a 100644 --- a/crates/openhuman-core/src/modules/computer_config.rs +++ b/crates/openhuman-core/src/modules/computer_config.rs @@ -10,7 +10,8 @@ //! TinyHumans proxy when signed in, else the user's OpenRouter key. //! - `browser` — the Chrome executable the user picked, if any. //! - `captcha` — the captcha solver's image-reading Jev route, on TypeSafe -//! with the user's TypeSafe key, when `[computer] captcha_solver` is on. +//! or Surplus (`[computer] captcha_provider`) with the user's key for it, +//! when `[computer] captcha_solver` is on. //! - `trace_path` — where desktop commands are traced, when tracing is on. #[cfg(unix)] @@ -68,19 +69,41 @@ async fn jev(config: &Config, hosted: Option<&str>) -> Option { } } -/// The captcha solver's section: TypeSafe's own Jev route (the one that -/// takes images), the chosen image model and attempt bound. `None` when the -/// solver is off or there is no TypeSafe key. +/// The captcha solver's section: the chosen provider's Jev route (one that +/// takes images) with its key, the chosen image model and attempt bound. +/// `None` when the solver is off, the provider is unknown, or there is no key +/// for it. async fn captcha(config: &Config) -> Option { let computer = &config.computer; if !computer.captcha_solver { return None; } - let Some(api_key) = provider_key(config, "typesafe", "TYPESAFE_API_KEY").await else { - tracing::debug!("[computer] captcha_solver is on but no TypeSafe key is configured"); + let provider = computer + .captcha_provider + .as_deref() + .map(str::trim) + .filter(|provider| !provider.is_empty()) + .unwrap_or("type_safe"); + let (slug, env) = match provider { + "type_safe" => ("typesafe", "TYPESAFE_API_KEY"), + "surplus" => ("surplus", "SURPLUS_API_KEY"), + other => { + tracing::warn!( + captcha_provider = other, + "[computer] captcha_solver is on but captcha_provider is unknown; use type_safe or surplus" + ); + return None; + } + }; + let Some(api_key) = provider_key(config, slug, env).await else { + tracing::debug!( + captcha_provider = provider, + "[computer] captcha_solver is on but no {provider} key is configured" + ); return None; }; - let mut jev = json!({ "api_key": api_key, "provider": "type_safe" }); + tracing::debug!("[computer] captcha solver provider={provider}"); + let mut jev = json!({ "api_key": api_key, "provider": provider }); if let Some(model) = computer .captcha_model .as_deref() diff --git a/crates/openhuman-core/src/modules/computer_config_tests.rs b/crates/openhuman-core/src/modules/computer_config_tests.rs index 49e2c81b06b..169cf126d35 100644 --- a/crates/openhuman-core/src/modules/computer_config_tests.rs +++ b/crates/openhuman-core/src/modules/computer_config_tests.rs @@ -248,3 +248,65 @@ async fn the_captcha_solver_without_a_key_is_left_out() { assert!(module_config(&config).await.get("captcha").is_none()); } } + +#[tokio::test] +async fn the_captcha_solver_on_surplus_uses_the_surplus_key() { + let dir = tempfile::tempdir().unwrap(); + let mut config = config_in(dir.path()); + store(&config, "typesafe", "ts-test-key").await; + store(&config, "surplus", "sp-test-key").await; + config.computer.captcha_solver = true; + config.computer.captcha_provider = Some("surplus".into()); + let value = module_config(&config).await; + assert_eq!(value["captcha"]["jev"]["provider"], "surplus"); + assert_eq!(value["captcha"]["jev"]["api_key"], "sp-test-key"); + assert!( + value["captcha"]["jev"].get("model").is_none(), + "the module picks Surplus's default model" + ); + assert!(value["captcha"].get("max_attempts").is_none()); + + config.computer.captcha_model = Some("jev-1.14".into()); + config.computer.max_captcha_attempts = Some(2); + let value = module_config(&config).await; + assert_eq!(value["captcha"]["jev"]["model"], "jev-1.14"); + assert_eq!(value["captcha"]["max_attempts"], 2); +} + +#[tokio::test] +async fn an_explicit_type_safe_captcha_provider_matches_the_default() { + let dir = tempfile::tempdir().unwrap(); + let mut config = config_in(dir.path()); + store(&config, "typesafe", "ts-test-key").await; + config.computer.captcha_solver = true; + config.computer.captcha_model = Some("jev-preview".into()); + let default = module_config(&config).await["captcha"].clone(); + config.computer.captcha_provider = Some("type_safe".into()); + assert_eq!(module_config(&config).await["captcha"], default); + assert_eq!(default["jev"]["provider"], "type_safe"); +} + +#[tokio::test] +async fn the_captcha_solver_on_surplus_without_a_surplus_key_is_left_out() { + let dir = tempfile::tempdir().unwrap(); + let mut config = config_in(dir.path()); + store(&config, "typesafe", "ts-test-key").await; + config.computer.captcha_solver = true; + config.computer.captcha_provider = Some("surplus".into()); + if std::env::var("SURPLUS_API_KEY").is_err() { + assert!( + module_config(&config).await.get("captcha").is_none(), + "a TypeSafe key is never sent to Surplus" + ); + } +} + +#[tokio::test] +async fn an_unknown_captcha_provider_sends_no_captcha_section() { + let dir = tempfile::tempdir().unwrap(); + let mut config = config_in(dir.path()); + store(&config, "typesafe", "ts-test-key").await; + config.computer.captcha_solver = true; + config.computer.captcha_provider = Some("open_router".into()); + assert!(module_config(&config).await.get("captcha").is_none()); +} diff --git a/crates/openhuman-core/src/modules/registry/records_computer.rs b/crates/openhuman-core/src/modules/registry/records_computer.rs index 4ba985cc5a8..01f2ec1534a 100644 --- a/crates/openhuman-core/src/modules/registry/records_computer.rs +++ b/crates/openhuman-core/src/modules/registry/records_computer.rs @@ -8,112 +8,112 @@ pub(crate) const TINYCOMPUTER: ModuleRecord = ModuleRecord { description: "Permission-aware desktop and browser observation and control", bus_name: names::INTERFACE, object_path: names::OBJECT_PATH, - version: "0.17.0", - release_url: "https://github.com/tinyhumansai/tinycomputer/releases/tag/v0.17.0", + version: "0.18.0", + release_url: "https://github.com/tinyhumansai/tinycomputer/releases/tag/v0.18.0", // All seventeen published archives were checked against checksum.toml // and GitHub asset digests before pinning. Linux permission probes are // part of the shipped voice surface alongside macOS and Windows. assets: &[ PlatformAsset { host_key: "archlinux-arm64", - archive: "tinycomputer-0.17.0-archlinux-arm64.tar.gz", - sha256: "8c6faf95e445844f0623170bd91e6694432ad156ad0d4f227298f54fb3cda953", + archive: "tinycomputer-0.18.0-archlinux-arm64.tar.gz", + sha256: "32ed1e7d7eb3ed93496752d3342bb28b02d302e2425a3bfa3d3c65b8b306060f", library_sha256: None, }, PlatformAsset { host_key: "archlinux-x86_64", - archive: "tinycomputer-0.17.0-archlinux-x86_64.tar.gz", - sha256: "d651abff22ef46a6dc1599ed44dd3f1dc7e64b6a3071a0cd121fd07c3dbaba49", + archive: "tinycomputer-0.18.0-archlinux-x86_64.tar.gz", + sha256: "6ba9df62f52ab4f23552ed2e12ff0bbabc16d7d076a20589c6be646f175bf735", library_sha256: None, }, PlatformAsset { host_key: "fedora-43-arm64", - archive: "tinycomputer-0.17.0-fedora-43-arm64.tar.gz", - sha256: "4ee6c92a197fe6e040e580be4ffda170f04db0af4ba90a42fc3699130ddd7fd3", + archive: "tinycomputer-0.18.0-fedora-43-arm64.tar.gz", + sha256: "9252d5f7dc27297f71a0187b57fe82fc17595b38937bda0a242700e54db52757", library_sha256: None, }, PlatformAsset { host_key: "fedora-43-x86_64", - archive: "tinycomputer-0.17.0-fedora-43-x86_64.tar.gz", - sha256: "d2206a7e9420758703b1356463192e3725404886b9e31ffed9580068464ce2cd", + archive: "tinycomputer-0.18.0-fedora-43-x86_64.tar.gz", + sha256: "c634e7380ae1dddd04cdd45b0ef8e84dea7e15c0be4dcddf5ad2157fcfb86252", library_sha256: None, }, PlatformAsset { host_key: "fedora-44-arm64", - archive: "tinycomputer-0.17.0-fedora-44-arm64.tar.gz", - sha256: "8f979c0cd4bf36e2f8a18f5b69b719ebc525fe2ce555fe3c62d83839092f6817", + archive: "tinycomputer-0.18.0-fedora-44-arm64.tar.gz", + sha256: "acf92a651670614ccefaadd104b7d0e1701eb82fb838abd4ab5a05fbc6684a51", library_sha256: None, }, PlatformAsset { host_key: "fedora-44-x86_64", - archive: "tinycomputer-0.17.0-fedora-44-x86_64.tar.gz", - sha256: "566c6c86005d12bcd0614332fb4305a5ffe5e474d0717bfb33e49addb2114843", + archive: "tinycomputer-0.18.0-fedora-44-x86_64.tar.gz", + sha256: "a1ce13fd3c6b9e99730c92e3bf2c4edf41bcc4dd7f4259ced9417f0f1107fc39", library_sha256: None, }, PlatformAsset { host_key: "macos-15-arm64", - archive: "tinycomputer-0.17.0-macos-15-arm64.tar.gz", - sha256: "843cd1ba0ca027ba2d7f24a88e1d292d859036b86b6ff2b8d825d70a8d4a60bf", + archive: "tinycomputer-0.18.0-macos-15-arm64.tar.gz", + sha256: "99a078dd03d3d444e51fcb7c12d3554929b0f6a8c9acb6b3cfb9d7f49040cf35", library_sha256: None, }, PlatformAsset { host_key: "macos-15-x86_64", - archive: "tinycomputer-0.17.0-macos-15-x86_64.tar.gz", - sha256: "7a1ef72f514a26b14e66f6659cd137e49dd7e0e0cf08ae95b5b34a33c01b97cc", + archive: "tinycomputer-0.18.0-macos-15-x86_64.tar.gz", + sha256: "eda9edca053a42fb82e06ba5a2a8b3dd873bc3e8d3d1be86a032787350b8a6dd", library_sha256: None, }, PlatformAsset { host_key: "macos-26-arm64", - archive: "tinycomputer-0.17.0-macos-26-arm64.tar.gz", - sha256: "fd06962d4966081da42a1393d6166c2ac1823ad76b55b251d5a5670b40b9477f", + archive: "tinycomputer-0.18.0-macos-26-arm64.tar.gz", + sha256: "06b3fbdc70520ecf8bc131f67bc5c7104af06a54bcb989b379ce3cd39491073f", library_sha256: None, }, PlatformAsset { host_key: "macos-26-x86_64", - archive: "tinycomputer-0.17.0-macos-26-x86_64.tar.gz", - sha256: "873d1bc009b1b585b9f2a07bd07cc4d8e75c9b9c7104e328f09ab2547035be37", + archive: "tinycomputer-0.18.0-macos-26-x86_64.tar.gz", + sha256: "69d20c98997cbed3a0198076b1a3ccea127959585b2245abcd130c9de19567b1", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-22.04-arm64", - archive: "tinycomputer-0.17.0-ubuntu-22.04-arm64.tar.gz", - sha256: "9d4ed58f67a962473faf20698dd8a83a67bebf2bdbf935d5c7bf2c29b577f8db", + archive: "tinycomputer-0.18.0-ubuntu-22.04-arm64.tar.gz", + sha256: "0e752ce55fe488e5372242a064857ed9e2733f6be11b223a179e40aa8003bc1e", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-22.04-x86_64", - archive: "tinycomputer-0.17.0-ubuntu-22.04-x86_64.tar.gz", - sha256: "d2fb8b6f8846104c8d6d56caf65a6cf9e3a4837f677b2be5f7b1f4eaba1c792a", + archive: "tinycomputer-0.18.0-ubuntu-22.04-x86_64.tar.gz", + sha256: "976fdcb8e3406886bad35a6743ab56783989db67d9ab22669b04033397cadeae", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-24.04-arm64", - archive: "tinycomputer-0.17.0-ubuntu-24.04-arm64.tar.gz", - sha256: "89cb31bbd797f7373504b91708f13d79dc594c3ddf4061967915a9471a5f7287", + archive: "tinycomputer-0.18.0-ubuntu-24.04-arm64.tar.gz", + sha256: "ec20f09440218efe9f29080f59fcf9dba94a25fe3532d53580204b57059937be", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-24.04-x86_64", - archive: "tinycomputer-0.17.0-ubuntu-24.04-x86_64.tar.gz", - sha256: "ae63415bedbc1321d99a4f9938b0c338bfa753b0800d1b0aa495d2025e3fe1cd", + archive: "tinycomputer-0.18.0-ubuntu-24.04-x86_64.tar.gz", + sha256: "6cb3141cb850f308fc63ecb441e18cd727b26591f59c379fe317c5a2d13e95ec", library_sha256: None, }, PlatformAsset { host_key: "windows-11-arm64", - archive: "tinycomputer-0.17.0-windows-11-arm64.zip", - sha256: "e2f1a0d8e504ca1eb3499e8c6469e5a3a7ebaabaf6d9f3b4f693acd59d6dc0b3", + archive: "tinycomputer-0.18.0-windows-11-arm64.zip", + sha256: "f3046dfea2ed3e048ec46acf2511c40262c210c564335e496aa7d418d27deb9b", library_sha256: None, }, PlatformAsset { host_key: "windows-2022-x86_64", - archive: "tinycomputer-0.17.0-windows-2022-x86_64.zip", - sha256: "cd1363608db6085a317a70ff3c41e9c62ebebf3cf319e6be26a4c54708e54c74", + archive: "tinycomputer-0.18.0-windows-2022-x86_64.zip", + sha256: "5915fd327a657dfd47f1402bcb21006e3e3a72d41cab176aac7614d9cfb20d12", library_sha256: None, }, PlatformAsset { host_key: "windows-2025-x86_64", - archive: "tinycomputer-0.17.0-windows-2025-x86_64.zip", - sha256: "1a73781bf83c78cb5dc6a785d971508a8441a0adeabf5b403581d7d6e7adbf5b", + archive: "tinycomputer-0.18.0-windows-2025-x86_64.zip", + sha256: "a170cd5f27eb0db06a0852b045a29f9e205c87e6c69df929174972f1f2e04d9c", library_sha256: None, }, ], diff --git a/crates/openhuman-core/src/modules/registry_computer_release_tests.rs b/crates/openhuman-core/src/modules/registry_computer_release_tests.rs index 357a96635a0..c64e6c918d1 100644 --- a/crates/openhuman-core/src/modules/registry_computer_release_tests.rs +++ b/crates/openhuman-core/src/modules/registry_computer_release_tests.rs @@ -5,8 +5,8 @@ fn tinycomputer_registry_matches_bus_contract_and_published_release() { let desktop = find("tinycomputer").expect("compiled computer module"); assert_eq!(desktop.bus_name, tinycomputer_bus::names::INTERFACE); assert_eq!(desktop.object_path, tinycomputer_bus::names::OBJECT_PATH); - assert_eq!(desktop.version, "0.17.0"); - assert_eq!(tinycomputer_bus::CONTRACT_VERSION, (3, 2)); + assert_eq!(desktop.version, "0.18.0"); + assert_eq!(tinycomputer_bus::CONTRACT_VERSION, (3, 3)); let mut actual = desktop .assets @@ -16,88 +16,88 @@ fn tinycomputer_registry_matches_bus_contract_and_published_release() { let mut published = [ ( "archlinux-arm64", - "tinycomputer-0.17.0-archlinux-arm64.tar.gz", - "8c6faf95e445844f0623170bd91e6694432ad156ad0d4f227298f54fb3cda953", + "tinycomputer-0.18.0-archlinux-arm64.tar.gz", + "32ed1e7d7eb3ed93496752d3342bb28b02d302e2425a3bfa3d3c65b8b306060f", ), ( "archlinux-x86_64", - "tinycomputer-0.17.0-archlinux-x86_64.tar.gz", - "d651abff22ef46a6dc1599ed44dd3f1dc7e64b6a3071a0cd121fd07c3dbaba49", + "tinycomputer-0.18.0-archlinux-x86_64.tar.gz", + "6ba9df62f52ab4f23552ed2e12ff0bbabc16d7d076a20589c6be646f175bf735", ), ( "fedora-43-arm64", - "tinycomputer-0.17.0-fedora-43-arm64.tar.gz", - "4ee6c92a197fe6e040e580be4ffda170f04db0af4ba90a42fc3699130ddd7fd3", + "tinycomputer-0.18.0-fedora-43-arm64.tar.gz", + "9252d5f7dc27297f71a0187b57fe82fc17595b38937bda0a242700e54db52757", ), ( "fedora-43-x86_64", - "tinycomputer-0.17.0-fedora-43-x86_64.tar.gz", - "d2206a7e9420758703b1356463192e3725404886b9e31ffed9580068464ce2cd", + "tinycomputer-0.18.0-fedora-43-x86_64.tar.gz", + "c634e7380ae1dddd04cdd45b0ef8e84dea7e15c0be4dcddf5ad2157fcfb86252", ), ( "fedora-44-arm64", - "tinycomputer-0.17.0-fedora-44-arm64.tar.gz", - "8f979c0cd4bf36e2f8a18f5b69b719ebc525fe2ce555fe3c62d83839092f6817", + "tinycomputer-0.18.0-fedora-44-arm64.tar.gz", + "acf92a651670614ccefaadd104b7d0e1701eb82fb838abd4ab5a05fbc6684a51", ), ( "fedora-44-x86_64", - "tinycomputer-0.17.0-fedora-44-x86_64.tar.gz", - "566c6c86005d12bcd0614332fb4305a5ffe5e474d0717bfb33e49addb2114843", + "tinycomputer-0.18.0-fedora-44-x86_64.tar.gz", + "a1ce13fd3c6b9e99730c92e3bf2c4edf41bcc4dd7f4259ced9417f0f1107fc39", ), ( "macos-15-arm64", - "tinycomputer-0.17.0-macos-15-arm64.tar.gz", - "843cd1ba0ca027ba2d7f24a88e1d292d859036b86b6ff2b8d825d70a8d4a60bf", + "tinycomputer-0.18.0-macos-15-arm64.tar.gz", + "99a078dd03d3d444e51fcb7c12d3554929b0f6a8c9acb6b3cfb9d7f49040cf35", ), ( "macos-15-x86_64", - "tinycomputer-0.17.0-macos-15-x86_64.tar.gz", - "7a1ef72f514a26b14e66f6659cd137e49dd7e0e0cf08ae95b5b34a33c01b97cc", + "tinycomputer-0.18.0-macos-15-x86_64.tar.gz", + "eda9edca053a42fb82e06ba5a2a8b3dd873bc3e8d3d1be86a032787350b8a6dd", ), ( "macos-26-arm64", - "tinycomputer-0.17.0-macos-26-arm64.tar.gz", - "fd06962d4966081da42a1393d6166c2ac1823ad76b55b251d5a5670b40b9477f", + "tinycomputer-0.18.0-macos-26-arm64.tar.gz", + "06b3fbdc70520ecf8bc131f67bc5c7104af06a54bcb989b379ce3cd39491073f", ), ( "macos-26-x86_64", - "tinycomputer-0.17.0-macos-26-x86_64.tar.gz", - "873d1bc009b1b585b9f2a07bd07cc4d8e75c9b9c7104e328f09ab2547035be37", + "tinycomputer-0.18.0-macos-26-x86_64.tar.gz", + "69d20c98997cbed3a0198076b1a3ccea127959585b2245abcd130c9de19567b1", ), ( "ubuntu-22.04-arm64", - "tinycomputer-0.17.0-ubuntu-22.04-arm64.tar.gz", - "9d4ed58f67a962473faf20698dd8a83a67bebf2bdbf935d5c7bf2c29b577f8db", + "tinycomputer-0.18.0-ubuntu-22.04-arm64.tar.gz", + "0e752ce55fe488e5372242a064857ed9e2733f6be11b223a179e40aa8003bc1e", ), ( "ubuntu-22.04-x86_64", - "tinycomputer-0.17.0-ubuntu-22.04-x86_64.tar.gz", - "d2fb8b6f8846104c8d6d56caf65a6cf9e3a4837f677b2be5f7b1f4eaba1c792a", + "tinycomputer-0.18.0-ubuntu-22.04-x86_64.tar.gz", + "976fdcb8e3406886bad35a6743ab56783989db67d9ab22669b04033397cadeae", ), ( "ubuntu-24.04-arm64", - "tinycomputer-0.17.0-ubuntu-24.04-arm64.tar.gz", - "89cb31bbd797f7373504b91708f13d79dc594c3ddf4061967915a9471a5f7287", + "tinycomputer-0.18.0-ubuntu-24.04-arm64.tar.gz", + "ec20f09440218efe9f29080f59fcf9dba94a25fe3532d53580204b57059937be", ), ( "ubuntu-24.04-x86_64", - "tinycomputer-0.17.0-ubuntu-24.04-x86_64.tar.gz", - "ae63415bedbc1321d99a4f9938b0c338bfa753b0800d1b0aa495d2025e3fe1cd", + "tinycomputer-0.18.0-ubuntu-24.04-x86_64.tar.gz", + "6cb3141cb850f308fc63ecb441e18cd727b26591f59c379fe317c5a2d13e95ec", ), ( "windows-11-arm64", - "tinycomputer-0.17.0-windows-11-arm64.zip", - "e2f1a0d8e504ca1eb3499e8c6469e5a3a7ebaabaf6d9f3b4f693acd59d6dc0b3", + "tinycomputer-0.18.0-windows-11-arm64.zip", + "f3046dfea2ed3e048ec46acf2511c40262c210c564335e496aa7d418d27deb9b", ), ( "windows-2022-x86_64", - "tinycomputer-0.17.0-windows-2022-x86_64.zip", - "cd1363608db6085a317a70ff3c41e9c62ebebf3cf319e6be26a4c54708e54c74", + "tinycomputer-0.18.0-windows-2022-x86_64.zip", + "5915fd327a657dfd47f1402bcb21006e3e3a72d41cab176aac7614d9cfb20d12", ), ( "windows-2025-x86_64", - "tinycomputer-0.17.0-windows-2025-x86_64.zip", - "1a73781bf83c78cb5dc6a785d971508a8441a0adeabf5b403581d7d6e7adbf5b", + "tinycomputer-0.18.0-windows-2025-x86_64.zip", + "a170cd5f27eb0db06a0852b045a29f9e205c87e6c69df929174972f1f2e04d9c", ), ]; assert_eq!(desktop.assets.len(), published.len()); diff --git a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs index 58e621005ce..606d4db3fb3 100644 --- a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs +++ b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs @@ -102,7 +102,7 @@ Capability { privacy: Some(CapabilityPrivacy { leaves_device: true, data_kind: PrivacyDataKind::Raw, - destinations: &["Visited websites", "OpenRouter, OpenHuman backend, OpenJev or Sage for task decisions"], + destinations: &["Visited websites", "OpenRouter, OpenHuman backend, OpenJev or Sage for task decisions", "TypeSafe or Surplus Intelligence for captcha images, only when the captcha solver is on (captcha_provider)"], }), }, Capability { diff --git a/docs/gitbooks/en/developing/jev.md b/docs/gitbooks/en/developing/jev.md index 0280b2953dc..c6a1c1b7604 100644 --- a/docs/gitbooks/en/developing/jev.md +++ b/docs/gitbooks/en/developing/jev.md @@ -48,7 +48,7 @@ If the process has no usable embedding provider, `TinyHumansJevRanker` declines `crates/openhuman-core/src/modules/browser_task.rs` hands browser tasks to TinyComputer's task members (`StartTask`, then `AwaitTask` until the task pauses or finishes). Tasks stay on the browser surface and the allowed websites. -The decision model is set in `[computer] decision_model`: Jev (through the hosted proxy when signed in, or your OpenRouter key), OpenJev or Sage. A failed step goes to the rescue model (`[computer] rescue_model`, up to `max_rescues` times) before the task fails. With `[computer] captcha_solver = true` and a TypeSafe key (`typesafe` credential or `TYPESAFE_API_KEY`), a captcha or "verify you are human" check is first tried with Jev's image questions (`captcha_model`, default `jev-preview`; `max_captcha_attempts`, default 3); only if that fails does the task pause as `needs_human`. An irreversible step pauses as `needs_approval`. The browser tool holds it behind a one-use token, and only `confirm_pending`, through the host approval gate, answers `ContinueTask`. +The decision model is set in `[computer] decision_model`: Jev (through the hosted proxy when signed in, or your OpenRouter key), OpenJev or Sage. A failed step goes to the rescue model (`[computer] rescue_model`, up to `max_rescues` times) before the task fails. With `[computer] captcha_solver = true` and a key for the captcha provider, a captcha or "verify you are human" check is first tried with Jev's image questions; only if that fails does the task pause as `needs_human`. `captcha_provider` picks where those questions go: `type_safe` (the default; `typesafe` credential or `TYPESAFE_API_KEY`) or `surplus` (Surplus Intelligence; `surplus` credential or `SURPLUS_API_KEY`). Any other value is refused by `config.update_computer_settings`, and a hand-edited unknown value leaves the solver off. `captcha_model` picks the image model (default `jev-preview` on TypeSafe, `jev-1.14` on Surplus) and `max_captcha_attempts` the image challenges per try (default 3, at most 10). An irreversible step pauses as `needs_approval`. The browser tool holds it behind a one-use token, and only `confirm_pending`, through the host approval gate, answers `ContinueTask`. The TinyComputer module keeps what finished browser tasks learned, per site, through the host's `SiteMemoryHost` interface (`crates/openhuman-core/src/modules/site_memory_host.rs` stores it in `/state/computer/sites/`). `StartTask.site` makes the module load that and hand it to the task on the same site: diff --git a/vendor/tinycomputer b/vendor/tinycomputer index 253a0a41c2c..54aea142427 160000 --- a/vendor/tinycomputer +++ b/vendor/tinycomputer @@ -1 +1 @@ -Subproject commit 253a0a41c2c4f647f3273d7bad1804b244aa5178 +Subproject commit 54aea142427d384aa38301c10d24038a1010acca