diff --git a/docs/interactive-capabilities/capabilities.json b/docs/interactive-capabilities/capabilities.json index 3c7bfee1b3..a1bc43edff 100644 --- a/docs/interactive-capabilities/capabilities.json +++ b/docs/interactive-capabilities/capabilities.json @@ -4,7 +4,7 @@ "title": "OpenBitFun Playbook", "origin": "https://playbook.openbitfun.com", "source": "src/shared/interactive-capabilities/catalog.json", - "digest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3", + "digest": "0917ed10617abd8b8c0aa33e872ae7f43f849df66d8181e62390d3ae42f94335", "ownerDigest": "3cc6d7d869b2c90c2161494a854b5ff7eb72ea69a1a28e40ccd42065fb3382e2", "searchAcceptance": [ { @@ -31228,6 +31228,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "搜索服务", "API Key", "自定义端点" @@ -31238,6 +31239,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "search provider", "API key", "custom endpoint" @@ -31255,13 +31257,13 @@ "items": [ { "id": "provider", - "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "control": { "kind": "open", "reasonCode": "unstructuredInteraction", - "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", - "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." + "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", + "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." } }, { @@ -31332,6 +31334,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "搜索服务", "API Key", "自定义端点", @@ -31345,8 +31348,8 @@ "Switch the WebSearch runtime provider", "Store device credentials encrypted on the execution host", "Configure and inspect OpenBitFun Search HTTP Protocol v1", - "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "为 OpenBitFun Search HTTP Protocol 配置端点、认证方式和受限凭据 Header", "Configure the endpoint, authentication mode, and restricted credential header for OpenBitFun Search HTTP Protocol", "查看当前执行主机的凭据状态,并保存、替换或清除 API Key/Secret", diff --git a/docs/interactive-capabilities/capabilities/setting.tools.web-search.md b/docs/interactive-capabilities/capabilities/setting.tools.web-search.md index 58833b771e..dee36daa06 100644 --- a/docs/interactive-capabilities/capabilities/setting.tools.web-search.md +++ b/docs/interactive-capabilities/capabilities/setting.tools.web-search.md @@ -17,8 +17,8 @@ Choose the search provider used by the WebSearch tool at runtime and configure c ## 完整功能清单 / Everything included -- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务 - - Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider +- **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务 + - Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider - **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 为 OpenBitFun Search HTTP Protocol 配置端点、认证方式和受限凭据 Header - Configure the endpoint, authentication mode, and restricted credential header for OpenBitFun Search HTTP Protocol - **智能体可定位入口,需交互完成 / Agent opens; interaction required** · 查看当前执行主机的凭据状态,并保存、替换或清除 API Key/Secret diff --git a/docs/interactive-capabilities/technical/product-control-open-audit.json b/docs/interactive-capabilities/technical/product-control-open-audit.json index cd61df7f2a..4377f9ef5e 100644 --- a/docs/interactive-capabilities/technical/product-control-open-audit.json +++ b/docs/interactive-capabilities/technical/product-control-open-audit.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "generatedFrom": "src/shared/interactive-capabilities/catalog.json", - "catalogDigest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3", + "catalogDigest": "0917ed10617abd8b8c0aa33e872ae7f43f849df66d8181e62390d3ae42f94335", "count": 205, "reasonCounts": { "externalAuth": 4, @@ -3166,11 +3166,11 @@ { "capabilityId": "setting.tools.web-search", "itemId": "provider", - "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "reasonCode": "unstructuredInteraction", - "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", - "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation.", + "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", + "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation.", "presentationTarget": { "kind": "settings", "pageId": "tools.webSearch" diff --git a/docs/interactive-capabilities/technical/tauri-command-map.json b/docs/interactive-capabilities/technical/tauri-command-map.json index b12f13a00d..7cd8c99028 100644 --- a/docs/interactive-capabilities/technical/tauri-command-map.json +++ b/docs/interactive-capabilities/technical/tauri-command-map.json @@ -1,7 +1,7 @@ { "schemaVersion": 2, "generatedFrom": "src/shared/interactive-capabilities/catalog.json", - "catalogDigest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3", + "catalogDigest": "0917ed10617abd8b8c0aa33e872ae7f43f849df66d8181e62390d3ae42f94335", "commandCount": 709, "coverage": { "commandCount": 709, diff --git a/src/crates/assembly/core/src/service/web_search.rs b/src/crates/assembly/core/src/service/web_search.rs index 1f7dcad3e4..d54321857b 100644 --- a/src/crates/assembly/core/src/service/web_search.rs +++ b/src/crates/assembly/core/src/service/web_search.rs @@ -10,8 +10,8 @@ use openbitfun_runtime_ports::{ }; use openbitfun_services_core::credential_vault::CredentialVault; use openbitfun_services_integrations::web_tools::{ - DeepSeekSearchProvider, ExaSearchApiProvider, FreeExaMcpProvider, OpenBitFunSearchHttpAuth, - OpenBitFunSearchHttpProvider, TavilySearchProvider, + DeepSeekSearchProvider, ExaSearchApiProvider, FreeExaMcpProvider, KeenableSearchProvider, + OpenBitFunSearchHttpAuth, OpenBitFunSearchHttpProvider, TavilySearchProvider, }; use serde::{Deserialize, Serialize}; use std::path::Path; @@ -97,19 +97,28 @@ fn credential_entry_id(credential_id: &str) -> OpenBitFunResult<&str> { } async fn read_credential(vault: &CredentialVault, credential_id: &str) -> OpenBitFunResult { - let credential_id = credential_entry_id(credential_id)?; - let bytes = vault - .get(credential_id) - .await - .map_err(|error| { - OpenBitFunError::config(format!("Failed to read WebSearch credential: {error}")) - })? + read_optional_credential(vault, credential_id) + .await? .ok_or_else(|| { OpenBitFunError::config( "WebSearch credential is not configured on this device".to_string(), ) - })?; + }) +} + +async fn read_optional_credential( + vault: &CredentialVault, + credential_id: &str, +) -> OpenBitFunResult> { + let credential_id = credential_entry_id(credential_id)?; + let Some(bytes) = vault.get(credential_id).await.map_err(|error| { + OpenBitFunError::config(format!("Failed to read WebSearch credential: {error}")) + })? + else { + return Ok(None); + }; String::from_utf8(bytes) + .map(Some) .map_err(|_| OpenBitFunError::config("WebSearch credential is not valid UTF-8".to_string())) } @@ -143,6 +152,14 @@ async fn resolve_provider(config: &WebSearchConfig) -> Arc) } + WebSearchProviderId::KEENABLE => { + // Keenable works without a key; a saved key only lifts rate limits. + let vault = credential_vault()?; + let api_key = + read_optional_credential(&vault, &config.providers.keenable.credential_id) + .await?; + Ok(Arc::new(KeenableSearchProvider::new(api_key)) as Arc) + } WebSearchProviderId::OPENBITFUN_SEARCH_HTTP => { let http = &config.providers.openbitfun_search_http; if http.endpoint.trim().is_empty() { @@ -249,6 +266,7 @@ fn credential_id_for_provider<'a>( } WebSearchProviderId::TAVILY => Ok(config.providers.tavily.credential_id.as_str()), WebSearchProviderId::DEEPSEEK => Ok(config.providers.deepseek.credential_id.as_str()), + WebSearchProviderId::KEENABLE => Ok(config.providers.keenable.credential_id.as_str()), WebSearchProviderId::OPENBITFUN_SEARCH_HTTP => { if matches!( config.providers.openbitfun_search_http.auth.mode.trim(), @@ -487,6 +505,7 @@ mod tests { for provider in [ WebSearchProviderId::EXA_SEARCH_API, WebSearchProviderId::DEEPSEEK, + WebSearchProviderId::KEENABLE, ] { let credential_id = credential_id_for_provider(&config, provider).expect("Search API credential id"); @@ -521,6 +540,36 @@ mod tests { } } + #[tokio::test] + async fn optional_credential_is_absent_until_saved() { + std::fs::create_dir_all("E:/tmp").expect("E:/tmp should be available for tests"); + let directory = Builder::new() + .prefix("openbitfun-web-search-vault-optional-") + .tempdir_in("E:/tmp") + .expect("create WebSearch test directory"); + let vault = credential_vault_in(directory.path()); + let config = WebSearchConfig::default(); + let credential_id = credential_id_for_provider(&config, WebSearchProviderId::KEENABLE) + .expect("Keenable credential id"); + + assert_eq!( + read_optional_credential(&vault, credential_id) + .await + .expect("read absent optional credential"), + None + ); + store_credential(&vault, credential_id, "keenable-test-key") + .await + .expect("save credential"); + assert_eq!( + read_optional_credential(&vault, credential_id) + .await + .expect("read saved optional credential") + .as_deref(), + Some("keenable-test-key") + ); + } + #[tokio::test] async fn credential_helpers_normalize_entry_id_without_changing_secret() { std::fs::create_dir_all("E:/tmp").expect("E:/tmp should be available for tests"); diff --git a/src/crates/contracts/config-contracts/src/types.rs b/src/crates/contracts/config-contracts/src/types.rs index d2bb52959e..87a33735cb 100644 --- a/src/crates/contracts/config-contracts/src/types.rs +++ b/src/crates/contracts/config-contracts/src/types.rs @@ -1396,6 +1396,10 @@ fn default_deepseek_credential_id() -> String { "deepseek-search-api".to_string() } +fn default_keenable_credential_id() -> String { + "keenable-search-api".to_string() +} + fn default_openbitfun_search_http_credential_id() -> String { "openbitfun-search-http".to_string() } @@ -1430,6 +1434,7 @@ pub struct WebSearchProviderConfigs { pub exa_search_api: WebSearchCredentialProviderConfig, pub tavily: WebSearchCredentialProviderConfig, pub deepseek: WebSearchCredentialProviderConfig, + pub keenable: WebSearchCredentialProviderConfig, pub openbitfun_search_http: OpenBitFunSearchHttpConfig, #[serde(flatten)] pub unknown: serde_json::Map, @@ -1450,6 +1455,10 @@ impl Default for WebSearchProviderConfigs { credential_id: default_deepseek_credential_id(), unknown: serde_json::Map::new(), }, + keenable: WebSearchCredentialProviderConfig { + credential_id: default_keenable_credential_id(), + unknown: serde_json::Map::new(), + }, openbitfun_search_http: OpenBitFunSearchHttpConfig::default(), unknown: serde_json::Map::new(), } @@ -4560,6 +4569,10 @@ mod tests { config.web_search.providers.deepseek.credential_id, "deepseek-search-api" ); + assert_eq!( + config.web_search.providers.keenable.credential_id, + "keenable-search-api" + ); assert_eq!( config.web_search.providers.exa_search_api.credential_id, "exa-search-api" @@ -4598,6 +4611,38 @@ mod tests { assert_eq!(restored, config); } + #[test] + fn web_search_keenable_config_preserves_legacy_payload_and_unknown_options() { + let legacy = serde_json::json!({ + "provider": "deepseek", + "providers": {"deepseek": {"credentialId": "existing-deepseek"}}, + "selectionRevision": 3 + }); + let mut config: WebSearchConfig = serde_json::from_value(legacy.clone()).unwrap(); + assert_eq!( + config.providers.keenable.credential_id, + "keenable-search-api" + ); + let round_trip = serde_json::to_value(&config).unwrap(); + assert_eq!(round_trip["provider"], legacy["provider"]); + assert_eq!( + round_trip["providers"]["deepseek"], + legacy["providers"]["deepseek"] + ); + assert_eq!(round_trip["selectionRevision"], legacy["selectionRevision"]); + + config.provider = "keenable".to_string(); + config.providers.keenable.credential_id = "custom-keenable-ref".to_string(); + config + .providers + .keenable + .unknown + .insert("futureOption".to_string(), serde_json::json!(true)); + let restored: WebSearchConfig = + serde_json::from_value(serde_json::to_value(&config).unwrap()).unwrap(); + assert_eq!(restored, config); + } + #[test] fn web_search_config_preserves_unknown_provider_and_fields() { let config: WebSearchConfig = serde_json::from_value(serde_json::json!({ diff --git a/src/crates/contracts/product-domains/src/generated/product-control-catalog.json b/src/crates/contracts/product-domains/src/generated/product-control-catalog.json index e4e34d37ca..5522b27fbb 100644 --- a/src/crates/contracts/product-domains/src/generated/product-control-catalog.json +++ b/src/crates/contracts/product-domains/src/generated/product-control-catalog.json @@ -4,7 +4,7 @@ "title": "OpenBitFun Playbook", "origin": "https://playbook.openbitfun.com", "source": "src/shared/interactive-capabilities/catalog.json", - "digest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3", + "digest": "0917ed10617abd8b8c0aa33e872ae7f43f849df66d8181e62390d3ae42f94335", "ownerDigest": "3cc6d7d869b2c90c2161494a854b5ff7eb72ea69a1a28e40ccd42065fb3382e2", "searchAcceptance": [ { @@ -31696,6 +31696,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "搜索服务", "API Key", "自定义端点" @@ -31706,6 +31707,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "search provider", "API key", "custom endpoint" @@ -31723,13 +31725,13 @@ "items": [ { "id": "provider", - "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "control": { "kind": "open", "reasonCode": "unstructuredInteraction", - "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", - "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." + "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", + "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." } }, { @@ -31800,6 +31802,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "搜索服务", "API Key", "自定义端点", @@ -31813,8 +31816,8 @@ "Switch the WebSearch runtime provider", "Store device credentials encrypted on the execution host", "Configure and inspect OpenBitFun Search HTTP Protocol v1", - "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "为 OpenBitFun Search HTTP Protocol 配置端点、认证方式和受限凭据 Header", "Configure the endpoint, authentication mode, and restricted credential header for OpenBitFun Search HTTP Protocol", "查看当前执行主机的凭据状态,并保存、替换或清除 API Key/Secret", diff --git a/src/crates/contracts/runtime-ports/src/web_search.rs b/src/crates/contracts/runtime-ports/src/web_search.rs index 441f7b207f..4512e3fc21 100644 --- a/src/crates/contracts/runtime-ports/src/web_search.rs +++ b/src/crates/contracts/runtime-ports/src/web_search.rs @@ -15,6 +15,7 @@ impl WebSearchProviderId { pub const EXA_SEARCH_API: &'static str = "exa_search_api"; pub const TAVILY: &'static str = "tavily"; pub const DEEPSEEK: &'static str = "deepseek"; + pub const KEENABLE: &'static str = "keenable"; pub const OPENBITFUN_SEARCH_HTTP: &'static str = "openbitfun_search_http"; pub fn new(value: impl Into) -> Self { diff --git a/src/crates/services/services-integrations/src/web_tools.rs b/src/crates/services/services-integrations/src/web_tools.rs index e0502ca369..5090caac46 100644 --- a/src/crates/services/services-integrations/src/web_tools.rs +++ b/src/crates/services/services-integrations/src/web_tools.rs @@ -2,11 +2,13 @@ mod deepseek; mod exa_search_api; +mod keenable; mod openbitfun_search_http; mod tavily; pub use deepseek::DeepSeekSearchProvider; pub use exa_search_api::ExaSearchApiProvider; +pub use keenable::KeenableSearchProvider; pub use openbitfun_search_http::{OpenBitFunSearchHttpAuth, OpenBitFunSearchHttpProvider}; pub use tavily::TavilySearchProvider; @@ -991,6 +993,155 @@ mod tests { } } + #[tokio::test] + async fn keenable_without_key_uses_public_endpoint_and_app_title() { + let (endpoint, request_task) = serve_once(json_response( + r#"{"query":"rust async","results":[{"title":" One ","url":"https://example.com/one","description":"","snippet":"ignored","published_at":"2026-06-01T00:00:00Z","acquired_at":"2026-06-02T00:00:00Z"},{"title":"Duplicate","url":"https://example.com/one"},{"title":"Unsafe","url":"file:///tmp/private"},{"title":"Two","url":"https://example.com/two","published_at":1780000000},{"title":"Three","url":"https://example.com/three"}]}"#, + )) + .await; + let base_url = endpoint.trim_end_matches("/search"); + let response = KeenableSearchProvider::with_base_url(None, base_url) + .search(WebSearchRequest { + query: "rust async".to_string(), + max_results: 2, + }) + .await + .expect("Keenable fixture search should succeed"); + let request = request_task.await.expect("Keenable fixture request task"); + let request_lower = request.to_ascii_lowercase(); + assert!(request.starts_with("POST /v1/search/public HTTP/1.1")); + assert!(request_lower.contains("x-keenable-title: openbitfun\r\n")); + assert!(!request_lower.contains("x-api-key")); + assert!(!request_lower.contains("authorization")); + assert!(request.ends_with(r#"{"query":"rust async","max_results":2}"#)); + assert_eq!(response.provider.as_str(), "keenable"); + assert_eq!(response.results.len(), 2); + assert_eq!(response.results[0].title, "One"); + assert_eq!( + response.results[0].published_at.as_deref(), + Some("2026-06-01T00:00:00+00:00") + ); + assert!(response.results[0].author.is_none()); + assert_eq!(response.results[1].title, "Two"); + assert!(response.results[1].published_at.is_none()); + } + + #[tokio::test] + async fn keenable_sends_saved_key_to_keyed_endpoint_and_ignores_blank_key() { + for (key, path, sends_key) in [ + (Some(" kn-secret "), "/v1/search", true), + (Some(" "), "/v1/search/public", false), + ] { + let (endpoint, request_task) = serve_once(json_response( + r#"{"results":[{"title":"One","url":"https://example.com/one"}]}"#, + )) + .await; + let base_url = endpoint.trim_end_matches("/search"); + let response = KeenableSearchProvider::with_base_url(key.map(str::to_string), base_url) + .search(WebSearchRequest { + query: "query".to_string(), + max_results: 1, + }) + .await + .expect("Keenable fixture search should succeed"); + let request = request_task.await.expect("Keenable fixture request task"); + let request_lower = request.to_ascii_lowercase(); + assert!(request.starts_with(&format!("POST {path} HTTP/1.1"))); + assert_eq!( + request_lower.contains("x-api-key: kn-secret\r\n"), + sends_key + ); + assert!(request_lower.contains("x-keenable-title: openbitfun\r\n")); + assert_eq!(response.results.len(), 1); + } + } + + #[tokio::test] + async fn keenable_rejects_invalid_requests_before_network_io() { + for (query, max_results) in [ + (" ".to_string(), 1), + ("query".to_string(), 0), + ("query".to_string(), 21), + ] { + let error = KeenableSearchProvider::with_base_url(None, "http://127.0.0.1:0") + .search(WebSearchRequest { query, max_results }) + .await + .expect_err("invalid input must fail before connecting"); + assert_eq!(error.provider.as_str(), "keenable"); + assert_eq!(error.kind, WebSearchErrorKind::InvalidRequest); + } + } + + #[tokio::test] + async fn keenable_distinguishes_empty_results_from_invalid_responses() { + for (body, expected) in [ + (r#"{"query":"query","results":[]}"#, None), + (r#"{}"#, Some(WebSearchErrorKind::InvalidResponse)), + ( + r#"{"results":null}"#, + Some(WebSearchErrorKind::InvalidResponse), + ), + ( + r#"{"results":[{"title":"Unsafe","url":"file:///tmp/private"}]}"#, + Some(WebSearchErrorKind::InvalidResponse), + ), + ("not JSON", Some(WebSearchErrorKind::InvalidResponse)), + ] { + let (endpoint, request_task) = serve_once(json_response(body)).await; + let response = + KeenableSearchProvider::with_base_url(None, endpoint.trim_end_matches("/search")) + .search(WebSearchRequest { + query: "query".to_string(), + max_results: 1, + }) + .await; + request_task + .await + .expect("Keenable response fixture request task"); + if let Some(kind) = expected { + assert_eq!( + response.expect_err("malformed response must fail").kind, + kind + ); + } else { + assert!(response + .expect("empty results are valid") + .results + .is_empty()); + } + } + } + + #[tokio::test] + async fn keenable_maps_http_errors_and_retry_after() { + for (status, expected) in [ + (400, WebSearchErrorKind::InvalidRequest), + (401, WebSearchErrorKind::Authentication), + (429, WebSearchErrorKind::RateLimited), + (503, WebSearchErrorKind::ProviderUnavailable), + ] { + let body = r#"{"error":"Missing app identifier","message":"X-Keenable-Title header is required for token-less requests"}"#; + let (endpoint, request_task) = serve_once(format!( + "HTTP/1.1 {status} Error\r\nContent-Type: application/json\r\nRetry-After: 7\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}", body.len() + )).await; + let error = + KeenableSearchProvider::with_base_url(None, endpoint.trim_end_matches("/search")) + .search(WebSearchRequest { + query: "query".to_string(), + max_results: 1, + }) + .await + .expect_err("provider error must fail"); + request_task + .await + .expect("Keenable error fixture request task"); + assert_eq!(error.provider.as_str(), "keenable"); + assert_eq!(error.kind, expected); + assert_eq!(error.message, "Missing app identifier"); + assert_eq!(error.retry_after_seconds, Some(7)); + } + } + #[tokio::test] async fn openbitfun_http_protocol_uses_v1_media_type_and_camel_case_body() { let response_body = r#"{"results":[{"title":"One","url":"https://example.com/one","publishedAt":"2026-08-30T00:00:00Z","author":"A"}]}"#; diff --git a/src/crates/services/services-integrations/src/web_tools/keenable.rs b/src/crates/services/services-integrations/src/web_tools/keenable.rs new file mode 100644 index 0000000000..3209ef13a6 --- /dev/null +++ b/src/crates/services/services-integrations/src/web_tools/keenable.rs @@ -0,0 +1,130 @@ +use super::{ + classify_http_status, normalize_results, read_bounded_body, search_client, transport_error, + validate_search_request, +}; +use async_trait::async_trait; +use openbitfun_runtime_ports::{ + WebSearchError, WebSearchErrorKind, WebSearchProvider, WebSearchProviderId, WebSearchRequest, + WebSearchResponse, WebSearchResult, +}; +use serde::{Deserialize, Serialize}; + +const KEENABLE_API_BASE_URL: &str = "https://api.keenable.ai"; +const KEENABLE_SEARCH_TIMEOUT_SECS: u64 = 60; +const KEENABLE_APP_TITLE: &str = "OpenBitFun"; + +/// Keenable Search API. It works without a key through the public endpoint; +/// a saved key is sent to the keyed endpoint and only lifts rate limits. +pub struct KeenableSearchProvider { + api_key: Option, + base_url: String, +} + +impl KeenableSearchProvider { + pub fn new(api_key: Option) -> Self { + Self { + api_key, + base_url: KEENABLE_API_BASE_URL.to_string(), + } + } + + #[cfg(test)] + pub(super) fn with_base_url(api_key: Option, base_url: impl Into) -> Self { + Self { + api_key, + base_url: base_url.into(), + } + } +} + +#[derive(Serialize)] +struct KeenableRequest<'a> { + query: &'a str, + max_results: u32, +} + +#[derive(Deserialize)] +struct KeenableResponse { + results: Vec, +} + +#[derive(Deserialize)] +struct KeenableResult { + #[serde(default)] + title: String, + #[serde(default)] + url: String, + #[serde(default)] + published_at: Option, +} + +#[async_trait] +impl WebSearchProvider for KeenableSearchProvider { + fn id(&self) -> WebSearchProviderId { + WebSearchProviderId::new(WebSearchProviderId::KEENABLE) + } + + async fn search(&self, request: WebSearchRequest) -> Result { + let provider = self.id(); + validate_search_request(provider.clone(), &request)?; + let api_key = self + .api_key + .as_deref() + .map(str::trim) + .filter(|key| !key.is_empty()); + let base_url = self.base_url.trim_end_matches('/'); + let endpoint = match api_key { + Some(_) => format!("{base_url}/v1/search"), + None => format!("{base_url}/v1/search/public"), + }; + let client = search_client(provider.clone(), KEENABLE_SEARCH_TIMEOUT_SECS)?; + let mut builder = client + .post(endpoint) + .header("X-Keenable-Title", KEENABLE_APP_TITLE); + if let Some(api_key) = api_key { + builder = builder.header("X-API-Key", api_key); + } + let response = builder + .json(&KeenableRequest { + query: &request.query, + max_results: request.max_results, + }) + .send() + .await + .map_err(|error| { + transport_error( + provider.clone(), + "Failed to call Keenable Search API", + error, + ) + })?; + let (status, headers, body) = read_bounded_body(response, provider.clone()).await?; + if !status.is_success() { + return Err(classify_http_status(provider, status, &headers, &body)); + } + let response: KeenableResponse = serde_json::from_slice(&body).map_err(|error| { + WebSearchError::new( + provider.clone(), + WebSearchErrorKind::InvalidResponse, + format!("Failed to parse Keenable response: {error}"), + ) + })?; + let raw_results = response + .results + .into_iter() + .map(|result| WebSearchResult { + title: result.title, + url: result.url, + // WebSearch exposes source metadata; WebFetch retrieves page content. + published_at: result + .published_at + .as_ref() + .and_then(serde_json::Value::as_str) + .map(str::to_string), + author: None, + }) + .collect(); + let results = normalize_results(provider.clone(), raw_results, request.max_results)?; + Ok(WebSearchResponse { provider, results }) + } +} diff --git a/src/shared/interactive-capabilities/catalog.json b/src/shared/interactive-capabilities/catalog.json index 85a33b42c2..49ae9c4f05 100644 --- a/src/shared/interactive-capabilities/catalog.json +++ b/src/shared/interactive-capabilities/catalog.json @@ -8993,6 +8993,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "搜索服务", "API Key", "自定义端点" @@ -9003,6 +9004,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "search provider", "API key", "custom endpoint" @@ -9020,13 +9022,13 @@ "items": [ { "id": "provider", - "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "control": { "kind": "open", "reasonCode": "unstructuredInteraction", - "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", - "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." + "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", + "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." }, "evidence": [ "source:src/web-ui/src/locales/zh-CN/settings/web-search.json#providers" diff --git a/src/web-ui/src/app/global-search/generated/interactive-capabilities.json b/src/web-ui/src/app/global-search/generated/interactive-capabilities.json index 3c7bfee1b3..a1bc43edff 100644 --- a/src/web-ui/src/app/global-search/generated/interactive-capabilities.json +++ b/src/web-ui/src/app/global-search/generated/interactive-capabilities.json @@ -4,7 +4,7 @@ "title": "OpenBitFun Playbook", "origin": "https://playbook.openbitfun.com", "source": "src/shared/interactive-capabilities/catalog.json", - "digest": "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3", + "digest": "0917ed10617abd8b8c0aa33e872ae7f43f849df66d8181e62390d3ae42f94335", "ownerDigest": "3cc6d7d869b2c90c2161494a854b5ff7eb72ea69a1a28e40ccd42065fb3382e2", "searchAcceptance": [ { @@ -31228,6 +31228,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "搜索服务", "API Key", "自定义端点" @@ -31238,6 +31239,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "search provider", "API key", "custom endpoint" @@ -31255,13 +31257,13 @@ "items": [ { "id": "provider", - "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "titleZh": "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "titleEn": "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "control": { "kind": "open", "reasonCode": "unstructuredInteraction", - "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", - "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." + "reasonZh": "“在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务”与各服务的配置状态相关,目前没有一个能安全完成选择、检查和保存整个流程的单一结构化 Command;智能体会打开精确设置入口,由用户确认配置。", + "reasonEn": "“Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider” depends on provider-specific configuration state, and no single structured Command can safely complete selection, validation, and saving; the Agent opens the exact settings entry for user confirmation." } }, { @@ -31332,6 +31334,7 @@ "Exa", "Tavily", "DeepSeek", + "Keenable", "搜索服务", "API Key", "自定义端点", @@ -31345,8 +31348,8 @@ "Switch the WebSearch runtime provider", "Store device credentials encrypted on the execution host", "Configure and inspect OpenBitFun Search HTTP Protocol v1", - "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", - "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, or OpenBitFun Search HTTP Protocol as the runtime provider", + "在免费 Exa MCP、Exa Search API、Tavily、DeepSeek、Keenable 与 OpenBitFun Search HTTP Protocol 之间选择运行时服务", + "Choose free Exa MCP, Exa Search API, Tavily, DeepSeek, Keenable, or OpenBitFun Search HTTP Protocol as the runtime provider", "为 OpenBitFun Search HTTP Protocol 配置端点、认证方式和受限凭据 Header", "Configure the endpoint, authentication mode, and restricted credential header for OpenBitFun Search HTTP Protocol", "查看当前执行主机的凭据状态,并保存、替换或清除 API Key/Secret", diff --git a/src/web-ui/src/app/scenes/settings/pages/tools/WebSearchSettingsPage.tsx b/src/web-ui/src/app/scenes/settings/pages/tools/WebSearchSettingsPage.tsx index 1d8abcc46e..98eee4b7f4 100644 --- a/src/web-ui/src/app/scenes/settings/pages/tools/WebSearchSettingsPage.tsx +++ b/src/web-ui/src/app/scenes/settings/pages/tools/WebSearchSettingsPage.tsx @@ -17,7 +17,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' const log = createLogger('WebSearchSettings'); -type ProviderId = 'exa_mcp_free' | 'exa_search_api' | 'tavily' | 'deepseek' | 'openbitfun_search_http'; +type ProviderId = 'exa_mcp_free' | 'exa_search_api' | 'tavily' | 'deepseek' | 'keenable' | 'openbitfun_search_http'; type HttpAuthMode = 'none' | 'bearer' | 'header'; interface CredentialProviderConfig extends Record { @@ -41,6 +41,7 @@ interface WebSearchConfig extends Record { exa_search_api: CredentialProviderConfig; tavily: CredentialProviderConfig; deepseek: CredentialProviderConfig; + keenable: CredentialProviderConfig; openbitfun_search_http: OpenBitFunHttpConfig; [key: string]: unknown; }; @@ -52,6 +53,7 @@ const DEFAULT_CONFIG: WebSearchConfig = { exa_search_api: { credentialId: 'exa-search-api' }, tavily: { credentialId: 'tavily-search-api' }, deepseek: { credentialId: 'deepseek-search-api' }, + keenable: { credentialId: 'keenable-search-api' }, openbitfun_search_http: { endpoint: '', auth: { @@ -124,6 +126,9 @@ function normalizeConfig(value: unknown): WebSearchConfig { const rawDeepSeek = rawProviders.deepseek && typeof rawProviders.deepseek === 'object' ? rawProviders.deepseek as Partial : {}; + const rawKeenable = rawProviders.keenable && typeof rawProviders.keenable === 'object' + ? rawProviders.keenable as Partial + : {}; const rawAuth = rawHttp.auth && typeof rawHttp.auth === 'object' ? rawHttp.auth as Partial : {}; @@ -146,6 +151,10 @@ function normalizeConfig(value: unknown): WebSearchConfig { ...DEFAULT_CONFIG.providers.deepseek, ...rawDeepSeek, }, + keenable: { + ...DEFAULT_CONFIG.providers.keenable, + ...rawKeenable, + }, openbitfun_search_http: { ...DEFAULT_CONFIG.providers.openbitfun_search_http, ...rawHttp, @@ -197,6 +206,11 @@ const WebSearchSettingsPage: React.FC = () => { label: t('providers.deepseek'), description: t('providerDescriptions.deepseek'), }, + { + value: 'keenable', + label: t('providers.keenable'), + description: t('providerDescriptions.keenable'), + }, { value: 'openbitfun_search_http', label: t('providers.openbitfunSearchHttp'), @@ -219,6 +233,9 @@ const WebSearchSettingsPage: React.FC = () => { || selectedProvider === 'tavily' || selectedProvider === 'deepseek' || (selectedProvider === 'openbitfun_search_http' && !['', 'none'].includes(httpConfig.auth.mode)); + // Keenable searches without a key; a saved key only raises its rate limits. + const credentialOptional = selectedProvider === 'keenable'; + const credentialSupported = credentialRequired || credentialOptional; const refreshCredentialStatus = useCallback(async (provider: string, required: boolean) => { const requestId = ++credentialStatusRequestIdRef.current; @@ -270,10 +287,10 @@ const WebSearchSettingsPage: React.FC = () => { }, [loadConfiguration]); useEffect(() => { - void refreshCredentialStatus(selectedProvider, credentialRequired); + void refreshCredentialStatus(selectedProvider, credentialSupported); setCredential(''); setDraftMessage(null); - }, [credentialRequired, refreshCredentialStatus, selectedProvider]); + }, [credentialSupported, refreshCredentialStatus, selectedProvider]); const saveConfiguration = useCallback(async (showSuccess: boolean) => { await configAPI.setConfig('ai.web_search', config); @@ -291,7 +308,7 @@ const WebSearchSettingsPage: React.FC = () => { setSaving(true); try { await saveConfiguration(true); - await refreshCredentialStatus(selectedProvider, credentialRequired); + await refreshCredentialStatus(selectedProvider, credentialSupported); return true; } catch (error) { log.error('Failed to save WebSearch settings', error); @@ -301,7 +318,7 @@ const WebSearchSettingsPage: React.FC = () => { mutationBusyRef.current = false; setSaving(false); } - }, [credentialRequired, refreshCredentialStatus, saveConfiguration, selectedProvider, t]); + }, [credentialSupported, refreshCredentialStatus, saveConfiguration, selectedProvider, t]); const handleSaveCredential = useCallback(async (): Promise => { if (!credential.trim()) { @@ -553,11 +570,15 @@ const WebSearchSettingsPage: React.FC = () => { ) : null} - {credentialRequired ? ( + {credentialSupported ? (
- {credentialConfigured ? t('status.configured') : t('status.missing')} + + {credentialConfigured + ? t('status.configured') + : credentialOptional ? t('status.optionalMissing') : t('status.missing')} + diff --git a/src/web-ui/src/app/scenes/settings/settingsRegistry.ts b/src/web-ui/src/app/scenes/settings/settingsRegistry.ts index f096255f12..ed4d3aa3a1 100644 --- a/src/web-ui/src/app/scenes/settings/settingsRegistry.ts +++ b/src/web-ui/src/app/scenes/settings/settingsRegistry.ts @@ -345,7 +345,7 @@ export const SETTINGS_PAGE_MANIFESTS: readonly SettingsPageManifest[] = [ categoryId: 'tools', labelKey: 'navigation.pages.webSearch.label', descriptionKey: 'navigation.pages.webSearch.description', - keywords: ['web search', 'exa', 'tavily', 'deepseek', 'http', 'provider', 'api key'], + keywords: ['web search', 'exa', 'tavily', 'deepseek', 'keenable', 'http', 'provider', 'api key'], namespaces: ['settings/web-search'], searchPhrases: [ phrase('settings/web-search', 'title'), diff --git a/src/web-ui/src/infrastructure/api/generated/productControl.ts b/src/web-ui/src/infrastructure/api/generated/productControl.ts index 58c4082ee3..d62c9303a8 100644 --- a/src/web-ui/src/infrastructure/api/generated/productControl.ts +++ b/src/web-ui/src/infrastructure/api/generated/productControl.ts @@ -1,5 +1,5 @@ // Generated by scripts/generate-interactive-capabilities.mjs; do not edit. -export const PRODUCT_CONTROL_GRAPH_DIGEST = "6ae2eeaa19e6342f9dcf7ff33b7c0fa94547ee1c02fc1835f6f4471caab6fbb3" as const; +export const PRODUCT_CONTROL_GRAPH_DIGEST = "0917ed10617abd8b8c0aa33e872ae7f43f849df66d8181e62390d3ae42f94335" as const; export type ProductControlCapabilityId = "feature.ai-assistant" | "feature.agents" | "feature.personal-assistants" | "feature.projects" | "feature.files-editor" | "feature.terminal" | "feature.git" | "feature.code-review" | "feature.browser" | "feature.computer-use" | "feature.skills" | "feature.miniapps" | "feature.canvas" | "feature.tasks-automation" | "feature.insights" | "feature.ecosystem-compatibility" | "feature.remote-workspaces" | "feature.remote-connect" | "feature.detached-dispatch" | "feature.pages" | "feature.voice-input" | "feature.desktop-pet" | "feature.desktop-cards" | "setting.application.general" | "setting.application.appearance" | "setting.application.pet" | "setting.application.input" | "setting.application.shortcuts" | "setting.application.development" | "setting.ai.models" | "setting.ai.memory" | "setting.workspace.session" | "setting.workspace.worktrees" | "setting.tools.execution" | "setting.application.terminal" | "setting.tools.desktop-control" | "setting.tools.browser-control" | "setting.tools.automation" | "setting.tools.web-search" | "setting.tools.mcp" | "setting.tools.acp" | "setting.data.usage" | "setting.data.archived" | "setting.data.diagnostics"; diff --git a/src/web-ui/src/infrastructure/api/service-api/ConfigAPI.test.ts b/src/web-ui/src/infrastructure/api/service-api/ConfigAPI.test.ts index f7bc22aa48..084b8caee1 100644 --- a/src/web-ui/src/infrastructure/api/service-api/ConfigAPI.test.ts +++ b/src/web-ui/src/infrastructure/api/service-api/ConfigAPI.test.ts @@ -107,7 +107,7 @@ describe('ConfigAPI batch config reads', () => { }); }); - it.each(['tavily', 'deepseek'])('keeps %s WebSearch credentials on the dedicated secret commands', async (provider) => { + it.each(['tavily', 'deepseek', 'keenable'])('keeps %s WebSearch credentials on the dedicated secret commands', async (provider) => { invokeMock .mockResolvedValueOnce({ provider, configured: false }) .mockResolvedValueOnce({ provider, configured: true }) diff --git a/src/web-ui/src/locales/en-US/settings/web-search.json b/src/web-ui/src/locales/en-US/settings/web-search.json index bb05ac5655..b40b82dcf2 100644 --- a/src/web-ui/src/locales/en-US/settings/web-search.json +++ b/src/web-ui/src/locales/en-US/settings/web-search.json @@ -6,6 +6,7 @@ "exaSearchApi": "Exa Search API", "tavily": "Tavily Search API", "deepseek": "DeepSeek Search API", + "keenable": "Keenable Search API", "openbitfunSearchHttp": "Custom HTTP service" }, "providerDescriptions": { @@ -13,6 +14,7 @@ "exaSearchApi": "Requires an Exa API key; enter and save it below", "tavily": "Requires a Tavily API key; enter and save it below", "deepseek": "Requires a DeepSeek API key; enter and save it below", + "keenable": "No API key needed; optionally save a Keenable API key below for higher rate limits", "openbitfunSearchHttp": "Connect a self-hosted or internal search service with its address and required authentication" }, "auth": { @@ -73,7 +75,8 @@ }, "status": { "configured": "Configured on the execution host", - "missing": "Credentials missing on the execution host" + "missing": "Credentials missing on the execution host", + "optionalMissing": "No key saved; searches use the free keyless tier" }, "protocol": { "request": { diff --git a/src/web-ui/src/locales/zh-CN/settings/web-search.json b/src/web-ui/src/locales/zh-CN/settings/web-search.json index 158a7e39f5..6b9aeb00e6 100644 --- a/src/web-ui/src/locales/zh-CN/settings/web-search.json +++ b/src/web-ui/src/locales/zh-CN/settings/web-search.json @@ -6,6 +6,7 @@ "exaSearchApi": "Exa Search API", "tavily": "Tavily Search API", "deepseek": "DeepSeek Search API", + "keenable": "Keenable Search API", "openbitfunSearchHttp": "自定义 HTTP 服务" }, "providerDescriptions": { @@ -13,6 +14,7 @@ "exaSearchApi": "需要 Exa API Key,在下方填写并保存", "tavily": "需要 Tavily API Key,在下方填写并保存", "deepseek": "需要 DeepSeek API Key,在下方填写并保存", + "keenable": "无需 API Key;可在下方保存 Keenable API Key 以提高速率限制", "openbitfunSearchHttp": "接入自建或企业内部搜索服务,需填写服务地址并按需配置认证" }, "auth": { @@ -73,7 +75,8 @@ }, "status": { "configured": "执行主机已配置", - "missing": "执行主机缺少凭据" + "missing": "执行主机缺少凭据", + "optionalMissing": "未保存 Key,搜索使用免费的免 Key 额度" }, "protocol": { "request": { diff --git a/src/web-ui/src/locales/zh-TW/settings/web-search.json b/src/web-ui/src/locales/zh-TW/settings/web-search.json index 24fac7e567..3f8d076d4a 100644 --- a/src/web-ui/src/locales/zh-TW/settings/web-search.json +++ b/src/web-ui/src/locales/zh-TW/settings/web-search.json @@ -6,6 +6,7 @@ "exaSearchApi": "Exa Search API", "tavily": "Tavily Search API", "deepseek": "DeepSeek Search API", + "keenable": "Keenable Search API", "openbitfunSearchHttp": "自訂 HTTP 服務" }, "providerDescriptions": { @@ -13,6 +14,7 @@ "exaSearchApi": "需要 Exa API Key,在下方填寫並儲存", "tavily": "需要 Tavily API Key,在下方填寫並儲存", "deepseek": "需要 DeepSeek API Key,在下方填寫並儲存", + "keenable": "無需 API Key;可在下方儲存 Keenable API Key 以提高速率限制", "openbitfunSearchHttp": "接入自建或企業內部搜尋服務,需填寫服務位址並按需設定驗證" }, "auth": { @@ -73,7 +75,8 @@ }, "status": { "configured": "執行主機已設定", - "missing": "執行主機缺少憑證" + "missing": "執行主機缺少憑證", + "optionalMissing": "未儲存 Key,搜尋使用免費的免 Key 額度" }, "protocol": { "request": {