mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-24 23:10:56 +08:00
fix release assets and refresh lime branding
This commit is contained in:
@@ -2188,11 +2188,12 @@ impl WorkspaceSandboxedBashTool {
|
||||
config
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn quote_shell(value: &str) -> String {
|
||||
format!("'{}'", value.replace('\'', "'\"'\"'"))
|
||||
}
|
||||
|
||||
fn build_shell_command(&self, command: &str, context: &ToolContext) -> (String, Vec<String>) {
|
||||
fn build_shell_command(&self, command: &str, _context: &ToolContext) -> (String, Vec<String>) {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
return (
|
||||
@@ -2208,7 +2209,7 @@ impl WorkspaceSandboxedBashTool {
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
let working_dir = context.working_directory.to_string_lossy().to_string();
|
||||
let working_dir = _context.working_directory.to_string_lossy().to_string();
|
||||
let wrapped_command = format!("cd {} && {}", Self::quote_shell(&working_dir), command);
|
||||
("sh".to_string(), vec!["-lc".to_string(), wrapped_command])
|
||||
}
|
||||
|
||||
@@ -494,6 +494,7 @@ fn get_skill_key(app_type: &AppType, directory: &str) -> String {
|
||||
}
|
||||
|
||||
/// 解析指定应用的技能列表(供 dispatcher 等非 Tauri command 场景调用)
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn resolve_skills_for_app(
|
||||
db: &DbConnection,
|
||||
skill_service: &Arc<SkillService>,
|
||||
|
||||
@@ -936,6 +936,7 @@ pub async fn open_chrome_profile_window(
|
||||
.await
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn open_chrome_profile_window_global(
|
||||
app: AppHandle,
|
||||
app_state: AppState,
|
||||
@@ -1049,6 +1050,7 @@ async fn ensure_managed_chrome_profile_with_manager(
|
||||
Ok(session)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn ensure_managed_chrome_profile_global(
|
||||
profile_key: String,
|
||||
url: Option<String>,
|
||||
@@ -1064,6 +1066,7 @@ pub async fn get_chrome_profile_sessions(
|
||||
Ok(list_alive_profile_sessions(state.0.clone()).await)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_chrome_profile_sessions_global() -> Result<Vec<ChromeProfileSessionInfo>, String> {
|
||||
Ok(list_alive_profile_sessions(shared_chrome_profile_manager()).await)
|
||||
}
|
||||
@@ -1076,6 +1079,7 @@ pub async fn close_chrome_profile_session(
|
||||
close_chrome_profile_session_with_manager(state.0.clone(), profile_key).await
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn close_chrome_profile_session_global(profile_key: String) -> Result<bool, String> {
|
||||
close_chrome_profile_session_with_manager(shared_chrome_profile_manager(), profile_key).await
|
||||
}
|
||||
@@ -1128,6 +1132,7 @@ pub async fn get_chrome_bridge_endpoint_info(
|
||||
get_chrome_bridge_endpoint_info_with_state(app_state.inner().clone()).await
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_chrome_bridge_endpoint_info_global(
|
||||
app_state: AppState,
|
||||
) -> Result<ChromeBridgeEndpointInfo, String> {
|
||||
@@ -1161,6 +1166,7 @@ pub async fn get_chrome_bridge_status() -> Result<ChromeBridgeStatusSnapshot, St
|
||||
.await)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_chrome_bridge_status_global() -> Result<ChromeBridgeStatusSnapshot, String> {
|
||||
get_chrome_bridge_status().await
|
||||
}
|
||||
@@ -1181,6 +1187,7 @@ pub async fn get_browser_backend_policy() -> Result<BrowserBackendPolicy, String
|
||||
Ok(BROWSER_BACKEND_POLICY.read().await.clone())
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_browser_backend_policy_global() -> Result<BrowserBackendPolicy, String> {
|
||||
get_browser_backend_policy().await
|
||||
}
|
||||
@@ -1198,6 +1205,7 @@ pub async fn set_browser_backend_policy(
|
||||
Ok(normalized)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn set_browser_backend_policy_global(
|
||||
policy: BrowserBackendPolicy,
|
||||
) -> Result<BrowserBackendPolicy, String> {
|
||||
@@ -1274,6 +1282,7 @@ pub async fn get_browser_backends_status(
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_browser_backends_status_global() -> Result<BrowserBackendsStatusSnapshot, String> {
|
||||
let policy = BROWSER_BACKEND_POLICY.read().await.clone();
|
||||
let bridge_status = chrome_bridge::chrome_bridge_hub()
|
||||
@@ -1351,6 +1360,7 @@ pub async fn list_cdp_targets(
|
||||
.await
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn list_cdp_targets_global(
|
||||
request: ListCdpTargetsRequest,
|
||||
) -> Result<Vec<CdpTargetInfo>, String> {
|
||||
@@ -1379,6 +1389,7 @@ pub async fn open_cdp_session(
|
||||
.await
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn open_cdp_session_global(
|
||||
request: OpenCdpSessionRequest,
|
||||
) -> Result<CdpSessionState, String> {
|
||||
@@ -1407,6 +1418,7 @@ pub async fn close_cdp_session(request: BrowserSessionStateRequest) -> Result<bo
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn close_cdp_session_global(request: BrowserSessionStateRequest) -> Result<bool, String> {
|
||||
close_cdp_session(request).await
|
||||
}
|
||||
@@ -1425,6 +1437,7 @@ pub async fn start_browser_stream(
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn start_browser_stream_global(
|
||||
app: AppHandle,
|
||||
request: StartBrowserStreamRequest,
|
||||
@@ -1443,6 +1456,7 @@ pub async fn stop_browser_stream(
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn stop_browser_stream_global(
|
||||
request: StopBrowserStreamRequest,
|
||||
) -> Result<CdpSessionState, String> {
|
||||
@@ -1461,6 +1475,7 @@ pub async fn get_browser_session_state(
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_browser_session_state_global(
|
||||
db: DbConnection,
|
||||
request: BrowserSessionStateRequest,
|
||||
@@ -1484,6 +1499,7 @@ pub async fn take_over_browser_session(
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn take_over_browser_session_global(
|
||||
db: DbConnection,
|
||||
request: UpdateBrowserSessionControlRequest,
|
||||
@@ -1507,6 +1523,7 @@ pub async fn release_browser_session(
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn release_browser_session_global(
|
||||
db: DbConnection,
|
||||
request: UpdateBrowserSessionControlRequest,
|
||||
@@ -1530,6 +1547,7 @@ pub async fn resume_browser_session(
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn resume_browser_session_global(
|
||||
db: DbConnection,
|
||||
request: UpdateBrowserSessionControlRequest,
|
||||
@@ -1551,6 +1569,7 @@ pub async fn get_browser_event_buffer(
|
||||
Ok(EventBufferSnapshotResponse::from(snapshot))
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_browser_event_buffer_global(
|
||||
request: BrowserEventBufferRequest,
|
||||
) -> Result<EventBufferSnapshotResponse, String> {
|
||||
@@ -1597,6 +1616,7 @@ pub async fn get_browser_action_audit_logs(
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn get_browser_action_audit_logs_global(
|
||||
limit: Option<usize>,
|
||||
) -> Result<Vec<BrowserActionAuditRecord>, String> {
|
||||
@@ -1726,6 +1746,7 @@ pub async fn browser_execute_action_with_manager(
|
||||
}
|
||||
|
||||
/// 使用全局 profile manager 执行动作(供 Agent 工具复用)
|
||||
#[cfg_attr(any(test, not(debug_assertions)), allow(dead_code))]
|
||||
pub async fn browser_execute_action_global(
|
||||
request: BrowserActionRequest,
|
||||
) -> Result<BrowserActionResult, String> {
|
||||
|
||||
@@ -22,8 +22,6 @@ use serde_json::{json, Map, Value};
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::{HashSet, VecDeque};
|
||||
use std::ffi::OsString;
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::os::windows::process::CommandExt;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Stdio;
|
||||
use std::sync::{Arc, Mutex as StdMutex, OnceLock};
|
||||
@@ -55,6 +53,7 @@ const NPM_MIRROR_CN: &str = "https://registry.npmmirror.com";
|
||||
const NODE_MIN_VERSION: (u64, u64, u64) = (22, 12, 0);
|
||||
const OPENCLAW_PROGRESS_LOG_LIMIT: usize = 400;
|
||||
const OPENCLAW_INSTALLER_USER_AGENT: &str = "Lime-OpenClaw";
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
const OPENCLAW_TEMP_CARGO_CHECK_DIR: &str = "/tmp/lime-cargo-check";
|
||||
#[cfg(target_os = "windows")]
|
||||
const CREATE_NO_WINDOW: u32 = 0x08000000;
|
||||
@@ -546,7 +545,10 @@ impl OpenClawService {
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
self.ensure_dependency_ready(app, dependency).await
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
self.ensure_dependency_ready(app, dependency).await
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn cleanup_temp_artifacts(
|
||||
@@ -2772,6 +2774,7 @@ async fn trigger_macos_command_line_tools_install() -> Result<String, String> {
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
#[allow(dead_code)]
|
||||
async fn trigger_macos_command_line_tools_install() -> Result<String, String> {
|
||||
Err("当前平台不支持拉起 macOS 开发者工具安装器。".to_string())
|
||||
}
|
||||
@@ -3066,6 +3069,7 @@ async fn terminate_sysinfo_processes(system: &mut System, target_pids: &[Pid]) {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(target_os = "windows", allow(dead_code))]
|
||||
fn parse_lsof_listener_pids(output: &str) -> Vec<u32> {
|
||||
let mut pids = output
|
||||
.lines()
|
||||
@@ -3858,6 +3862,7 @@ fn shell_command_escape_for(platform: ShellPlatform, value: &str) -> String {
|
||||
core_shell_command_escape_for(platform, value)
|
||||
}
|
||||
|
||||
#[cfg_attr(target_os = "windows", allow(dead_code))]
|
||||
fn shell_command_escape(value: &str) -> String {
|
||||
shell_command_escape_for(current_shell_platform(), value)
|
||||
}
|
||||
@@ -3871,6 +3876,7 @@ fn shell_path_assignment_for(platform: ShellPlatform, binary_path: &str) -> Stri
|
||||
core_shell_path_assignment_for(platform, binary_path)
|
||||
}
|
||||
|
||||
#[cfg_attr(target_os = "windows", allow(dead_code))]
|
||||
fn shell_path_assignment(binary_path: &str) -> String {
|
||||
shell_path_assignment_for(current_shell_platform(), binary_path)
|
||||
}
|
||||
@@ -4828,6 +4834,7 @@ async fn read_binary_semver(path: &Path) -> Option<(u64, u64, u64)> {
|
||||
parse_semver(stdout.trim()).or_else(|| parse_semver(stderr.trim()))
|
||||
}
|
||||
|
||||
#[cfg_attr(not(test), allow(dead_code))]
|
||||
fn select_best_semver_candidate(
|
||||
candidates: Vec<(PathBuf, Option<(u64, u64, u64)>)>,
|
||||
) -> Option<PathBuf> {
|
||||
@@ -5912,10 +5919,6 @@ mod tests {
|
||||
/// 从 Windows 注册表读取最新的 PATH 环境变量并刷新当前进程
|
||||
#[cfg(target_os = "windows")]
|
||||
fn refresh_windows_path_from_registry() -> Result<(), String> {
|
||||
use std::ffi::OsStr;
|
||||
use std::os::windows::ffi::OsStrExt;
|
||||
use std::ptr;
|
||||
|
||||
unsafe {
|
||||
let mut combined_path = String::new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user