From b2a3b68bbf4fe6bb29110c961bd8cf6a4c192030 Mon Sep 17 00:00:00 2001 From: DorJay Date: Sun, 8 Nov 2026 13:51:55 +0800 Subject: [PATCH] fix(ci): resolve arch-check, clippy, collaboration DM sinceSeq, and frontend checks --- crates/agents/src/auth_mode.rs | 9 +- crates/agents/src/cli_exposure.rs | 6 +- crates/agents/src/manager.rs | 1 - .../src/manager/runner/controls_apply.rs | 3 +- .../src/manager/runner/controls_emit.rs | 3 +- crates/agents/src/native_config.rs | 5 +- crates/agents/src/omp_providers.rs | 15 +- crates/agents/src/skills.rs | 20 ++- crates/agents/tests/built_in_profiles.rs | 6 +- .../src/collaboration_sidebar.rs | 50 +++++-- crates/conversations/src/session_info.rs | 4 +- crates/db/src/lib.rs | 32 +++-- crates/plugins/src/worker_host.rs | 15 +- crates/server/src/agent_install.rs | 17 +-- crates/server/src/domains.rs | 134 ++++++++++++++---- crates/server/src/host/collaboration.rs | 37 +++-- .../src/host/native/dsh_configuration.rs | 20 ++- .../src/host/native/model_providers/ops.rs | 28 ++-- crates/server/src/host/workspace_files.rs | 67 +-------- crates/server/tests/preview_proxy.rs | 4 +- crates/services/src/services/mcp/catalog.rs | 28 +++- crates/services/src/services/mcp/mod.rs | 40 +++--- .../conversation/TurnErrorCard.test.tsx | 3 +- .../connectors/ConnectorMarketplace.tsx | 72 ++++++---- .../components/connectors/connectorCatalog.ts | 89 +++++++----- frontend/src/components/layout/IDELayout.tsx | 5 +- .../components/layout/RightPanelContent.tsx | 15 +- .../components/layout/StatusBarMcp.test.tsx | 4 +- .../src/components/layout/StatusBarMcp.tsx | 9 +- .../workspaceTabDrag.integration.test.tsx | 5 +- .../components/onboarding/hero/AgentMark.tsx | 33 ++++- .../components/panels/DockviewAIChatPanel.tsx | 8 +- .../plugins/CodeCompletionStatusPopover.tsx | 9 +- .../plugins/PluginSchemaSettingsForm.tsx | 3 +- .../settings/AgentSessionConfigPicker.tsx | 4 +- ...eSessionComposerPreviewElementInsertion.ts | 3 +- frontend/src/contexts/PanelActionsContext.tsx | 7 +- .../space/CollaborationSpaceRuntime.tsx | 22 +-- .../collaboration/space/MessageStream.tsx | 24 ++-- .../src/hooks/usePluginHostContributions.ts | 105 +++++++------- frontend/src/i18n/locales/en/settings.json | 3 - frontend/src/i18n/locales/zh-CN/settings.json | 3 - frontend/src/lib/api/plugins.ts | 5 +- frontend/src/lib/pluginFederation.ts | 4 +- frontend/src/lib/sessionTitle.test.ts | 1 - frontend/src/lib/sessionTitle.ts | 1 - .../src/pages/plugins/AgentDefaultsField.tsx | 4 +- .../pages/plugins/PluginConfigForm.test.tsx | 9 +- .../src/pages/plugins/PluginConfigForm.tsx | 17 +-- .../src/pages/settings/AgentDetail.test.tsx | 4 +- frontend/src/pages/settings/AgentDetail.tsx | 5 +- .../src/pages/settings/AgentSettings.test.tsx | 8 +- frontend/src/pages/settings/AgentSettings.tsx | 4 +- .../settings/DshAuthPanel.catalog.test.tsx | 1 + .../src/pages/settings/DshAuthPanel.test.tsx | 5 +- frontend/src/pages/settings/DshAuthPanel.tsx | 4 +- frontend/src/pages/settings/McpSettings.tsx | 11 +- .../pages/settings/ResourceSettings.test.tsx | 30 ++-- .../src/pages/settings/SkillsSettings.tsx | 17 ++- frontend/src/utils/dockviewEditorGroup.ts | 3 +- frontend/src/utils/dockviewPointerTabDnd.ts | 47 ++++-- src-tauri/src/browser_native.rs | 3 +- src-tauri/src/events.rs | 6 +- 63 files changed, 647 insertions(+), 512 deletions(-) diff --git a/crates/agents/src/auth_mode.rs b/crates/agents/src/auth_mode.rs index 81c48ba05..d20eaab0c 100644 --- a/crates/agents/src/auth_mode.rs +++ b/crates/agents/src/auth_mode.rs @@ -843,9 +843,7 @@ fn sanitize_and_read_dsh_credentials(dsh_dir: &Path) -> Option { .map(str::to_string) }) }); - if mutated - && let Ok(serialized) = serde_yaml::to_string(&doc) - { + if mutated && let Ok(serialized) = serde_yaml::to_string(&doc) { let _ = std::fs::write(&path, serialized); } api_key @@ -858,9 +856,7 @@ fn apply_dsh_native_launch_env(env: &mut HashMap) { .get("DEEPSEEK_API_KEY") .map(|value| value.trim()) .is_some_and(|value| !value.is_empty()); - if !has_env_key - && let Some(api_key) = credential_key - { + if !has_env_key && let Some(api_key) = credential_key { env.insert("DEEPSEEK_API_KEY".to_string(), api_key); } if let Some(base_url) = env.get("DEEPSEEK_BASE_URL").cloned() { @@ -2187,4 +2183,3 @@ mod tests { ); } } - diff --git a/crates/agents/src/cli_exposure.rs b/crates/agents/src/cli_exposure.rs index 3822b4476..74fe5d8da 100644 --- a/crates/agents/src/cli_exposure.rs +++ b/crates/agents/src/cli_exposure.rs @@ -182,10 +182,8 @@ pub fn export_managed_bun_to_user_environment( let source_exe = bun_bin_dir.join("bun.exe"); let dest_exe = user_bin.join("bun.exe"); if source_exe.is_file() && !paths_refer_to_same_file(&source_exe, &dest_exe) { - let temporary = dest_exe.with_file_name(format!( - ".bun.exe.vibex-toolchain-{}.tmp", - Uuid::new_v4() - )); + let temporary = + dest_exe.with_file_name(format!(".bun.exe.vibex-toolchain-{}.tmp", Uuid::new_v4())); if fs::copy(&source_exe, &temporary).is_ok() && replace_file_atomically(&temporary, &dest_exe).is_err() { diff --git a/crates/agents/src/manager.rs b/crates/agents/src/manager.rs index 3dfd30873..655f21929 100644 --- a/crates/agents/src/manager.rs +++ b/crates/agents/src/manager.rs @@ -5219,4 +5219,3 @@ mod tests { ); } } - diff --git a/crates/agents/src/manager/runner/controls_apply.rs b/crates/agents/src/manager/runner/controls_apply.rs index 125d3c763..645bbb815 100644 --- a/crates/agents/src/manager/runner/controls_apply.rs +++ b/crates/agents/src/manager/runner/controls_apply.rs @@ -279,7 +279,8 @@ impl AgentConnectionRunner { let (was_plan, mode_uses_set_mode) = { let mut controls = self.session_controls.write().await; let stored = controls.entry(session_id).or_default(); - let (_, current_mode) = session_modes_from_config_options(&stored.config_options); + let (_, current_mode) = + session_modes_from_config_options(&stored.config_options); let was_plan = current_mode.as_deref() == Some("plan") || stored .modes diff --git a/crates/agents/src/manager/runner/controls_emit.rs b/crates/agents/src/manager/runner/controls_emit.rs index 607811c2d..1a17542cb 100644 --- a/crates/agents/src/manager/runner/controls_emit.rs +++ b/crates/agents/src/manager/runner/controls_emit.rs @@ -54,7 +54,8 @@ impl AgentConnectionRunner { OMP_YOLO_MODE_ID, ); if let Some(ref mut mode_state) = entry.modes { - mode_state.current_mode_id = acp::schema::v1::SessionModeId::new(OMP_YOLO_MODE_ID); + mode_state.current_mode_id = + acp::schema::v1::SessionModeId::new(OMP_YOLO_MODE_ID); } } } diff --git a/crates/agents/src/native_config.rs b/crates/agents/src/native_config.rs index d849731b3..b74159228 100644 --- a/crates/agents/src/native_config.rs +++ b/crates/agents/src/native_config.rs @@ -1741,7 +1741,10 @@ mod tests { let home = Path::new("/tmp/vibex-home"); let environment = BTreeMap::from([( "PI_CODING_AGENT_DIR".to_string(), - home.join(".pi").join("agent").to_string_lossy().into_owned(), + home.join(".pi") + .join("agent") + .to_string_lossy() + .into_owned(), )]); assert_eq!( omp_config_path(home, &environment), diff --git a/crates/agents/src/omp_providers.rs b/crates/agents/src/omp_providers.rs index 040791e27..1fbf1accc 100644 --- a/crates/agents/src/omp_providers.rs +++ b/crates/agents/src/omp_providers.rs @@ -187,10 +187,9 @@ fn provider_key(providers: &Mapping, provider_id: &str, name: &str, api_url: &st .as_mapping() .is_some_and(|node| text(node, "baseUrl") == api_url); same_url.then(|| key.as_str().unwrap_or("").to_string()) - }) { - if !existing.is_empty() { - return existing; - } + }) && !existing.is_empty() + { + return existing; } let slug = slug(name); if slug.is_empty() { @@ -241,10 +240,10 @@ fn model_ids(raw: &str) -> Vec { } } } - if ids.is_empty() { - if let Some(id) = value.as_str() { - ids.push(id.to_string()); - } + if ids.is_empty() + && let Some(id) = value.as_str() + { + ids.push(id.to_string()); } ids } diff --git a/crates/agents/src/skills.rs b/crates/agents/src/skills.rs index 3d049ada3..205cc4c2e 100644 --- a/crates/agents/src/skills.rs +++ b/crates/agents/src/skills.rs @@ -2199,9 +2199,7 @@ fn synthetic_weekly_installs(installs: Option, seed: &str) -> Vec { .map(|idx| { let growth = 60 + idx * 10; let wave = ((hash.wrapping_add(idx * 13)) % 23) + 90; - base.saturating_mul(growth) - .saturating_mul(wave) - / 10_000 + base.saturating_mul(growth).saturating_mul(wave) / 10_000 }) .collect() } @@ -2397,8 +2395,7 @@ pub async fn search_skill_market_with_view( row.id }; let known = snapshot.iter().find(|s| { - s.id.eq_ignore_ascii_case(&id) - || s.skill_id.eq_ignore_ascii_case(&row.skill_id) + s.id.eq_ignore_ascii_case(&id) || s.skill_id.eq_ignore_ascii_case(&row.skill_id) }); let weekly_installs = if !row.weekly_installs.is_empty() { row.weekly_installs @@ -2445,9 +2442,8 @@ fn parse_skill_description(html: &str) -> Option { } fn html_fragment_to_markdown(fragment: &str) -> String { - static TAG_RE: std::sync::LazyLock = std::sync::LazyLock::new(|| { - regex::Regex::new(r"<[^>]+>").expect("valid html tag regex") - }); + static TAG_RE: std::sync::LazyLock = + std::sync::LazyLock::new(|| regex::Regex::new(r"<[^>]+>").expect("valid html tag regex")); let mut s = fragment .replace("

", "\n# ") .replace("

", "\n\n") @@ -2517,9 +2513,7 @@ fn parse_skill_markdown_from_html( } } description.map(|desc| { - format!( - "---\nname: {skill_id}\nsource: {source}\n---\n\n# {skill_id}\n\n{desc}\n" - ) + format!("---\nname: {skill_id}\nsource: {source}\n---\n\n# {skill_id}\n\n{desc}\n") }) } @@ -2536,7 +2530,9 @@ async fn fetch_github_raw_skill_markdown( let candidates = [ format!("https://raw.githubusercontent.com/{clean_source}/HEAD/skills/{clean_id}/SKILL.md"), format!("https://raw.githubusercontent.com/{clean_source}/HEAD/{clean_id}/SKILL.md"), - format!("https://raw.githubusercontent.com/{clean_source}/HEAD/.claude/skills/{clean_id}/SKILL.md"), + format!( + "https://raw.githubusercontent.com/{clean_source}/HEAD/.claude/skills/{clean_id}/SKILL.md" + ), format!("https://raw.githubusercontent.com/{clean_source}/HEAD/SKILL.md"), ]; for url in candidates { diff --git a/crates/agents/tests/built_in_profiles.rs b/crates/agents/tests/built_in_profiles.rs index 30ad9450c..04469edda 100644 --- a/crates/agents/tests/built_in_profiles.rs +++ b/crates/agents/tests/built_in_profiles.rs @@ -1460,9 +1460,5 @@ fn omp_native_config_exposes_approval_mode_select_field() { assert_eq!(field.kind, NativeConfigFieldKind::Select); assert_eq!(field.surface, NativeConfigSurface::Configuration); let values: Vec<_> = field.options.iter().map(|(value, _)| *value).collect(); - assert_eq!( - values, - ["always-ask", "always-ask-cached", "write", "yolo"] - ); + assert_eq!(values, ["always-ask", "always-ask-cached", "write", "yolo"]); } - diff --git a/crates/conversations/src/collaboration_sidebar.rs b/crates/conversations/src/collaboration_sidebar.rs index e88d1730c..ae1e1c08c 100644 --- a/crates/conversations/src/collaboration_sidebar.rs +++ b/crates/conversations/src/collaboration_sidebar.rs @@ -1246,7 +1246,7 @@ pub async fn list_dm_messages( let (mut pre, post) = match since_seq { Some(since) => { - let pre = list_pre_cutover_dm_messages( + let mut pre = list_pre_cutover_dm_messages( pool, conversation_id, Some(since), @@ -1255,6 +1255,10 @@ pub async fn list_dm_messages( ) .await?; let post = dm_space_messages_since(pool, &thread_id, since).await?; + if pre.is_empty() && post.is_empty() && cutover_seq == 0 { + pre = list_pre_cutover_dm_messages(pool, conversation_id, Some(since), limit, None) + .await?; + } (pre, post) } None => { @@ -1276,7 +1280,8 @@ pub async fn list_dm_messages( .await? }; if pre.is_empty() && post.is_empty() && cutover_seq == 0 { - pre = list_pre_cutover_dm_messages(pool, conversation_id, None, limit, None).await?; + pre = + list_pre_cutover_dm_messages(pool, conversation_id, None, limit, None).await?; } (pre, post) } @@ -2126,7 +2131,10 @@ pub async fn identity_members_for_conversations_batch( let rows = query.fetch_all(pool).await.map_err(db_err)?; let mut out = HashMap::with_capacity(rows.len()); for (conv_id, member_id, is_sup, avatar, color) in rows { - if let Some(cid) = conv_id.map(|s| s.trim().to_string()).filter(|s| !s.is_empty()) { + if let Some(cid) = conv_id + .map(|s| s.trim().to_string()) + .filter(|s| !s.is_empty()) + { out.entry(cid) .or_insert((member_id, is_sup != 0, avatar, color)); } @@ -2137,7 +2145,10 @@ pub async fn identity_members_for_conversations_batch( if !out.contains_key(*cid) && let Ok(uuid) = Uuid::parse_str(cid) { - derived_to_conv.push((identity::member_id_for_conversation(uuid), (*cid).to_string())); + derived_to_conv.push(( + identity::member_id_for_conversation(uuid), + (*cid).to_string(), + )); } } if !derived_to_conv.is_empty() { @@ -2177,8 +2188,7 @@ pub async fn enrich_space_members_batch( if members.is_empty() { return Ok(Vec::new()); } - let is_group_space = - !space_id.starts_with("unassigned:") && !space_id.starts_with("direct:"); + let is_group_space = !space_id.starts_with("unassigned:") && !space_id.starts_with("direct:"); let mut identity_by_conv: HashMap, Option)> = HashMap::new(); @@ -2197,7 +2207,10 @@ pub async fn enrich_space_members_batch( .map_err(db_err)?; for (conv_id, identity_id, is_sup, avatar, color) in bound_rows { - if let Some(cid) = conv_id.map(|s| s.trim().to_string()).filter(|s| !s.is_empty()) { + if let Some(cid) = conv_id + .map(|s| s.trim().to_string()) + .filter(|s| !s.is_empty()) + { identity_by_conv .entry(cid) .or_insert((identity_id, is_sup != 0, avatar, color)); @@ -3212,10 +3225,25 @@ mod tests { .iter() .find(|v| v.get("nickname").and_then(|s| s.as_str()) == Some("Beta")) .expect("Beta member"); - assert!(alpha.get("identity_member_id").and_then(|v| v.as_str()).is_some()); - assert_eq!(alpha.get("is_supervisor").and_then(|v| v.as_bool()), Some(true)); - assert!(beta.get("identity_member_id").and_then(|v| v.as_str()).is_some()); - assert_eq!(beta.get("is_supervisor").and_then(|v| v.as_bool()), Some(false)); + assert!( + alpha + .get("identity_member_id") + .and_then(|v| v.as_str()) + .is_some() + ); + assert_eq!( + alpha.get("is_supervisor").and_then(|v| v.as_bool()), + Some(true) + ); + assert!( + beta.get("identity_member_id") + .and_then(|v| v.as_str()) + .is_some() + ); + assert_eq!( + beta.get("is_supervisor").and_then(|v| v.as_bool()), + Some(false) + ); assert_ne!( alpha.get("identity_member_id"), beta.get("identity_member_id") diff --git a/crates/conversations/src/session_info.rs b/crates/conversations/src/session_info.rs index c0d505f40..e41908d42 100644 --- a/crates/conversations/src/session_info.rs +++ b/crates/conversations/src/session_info.rs @@ -844,7 +844,9 @@ mod tests { assert_eq!( derive_session_display_name( None, - Some("现在会话的标题字数没有限制,默认按照第一条消息命名时,若第一条消息过长会导致会话名称超级长"), + Some( + "现在会话的标题字数没有限制,默认按照第一条消息命名时,若第一条消息过长会导致会话名称超级长" + ), 1 ), "现在会话的标题字数没有限制,默认按照第一条消息命名时,若第一条消" diff --git a/crates/db/src/lib.rs b/crates/db/src/lib.rs index 396cabee6..729b2bf26 100644 --- a/crates/db/src/lib.rs +++ b/crates/db/src/lib.rs @@ -496,20 +496,24 @@ mod tests { .await .expect("migrations should deduplicate duplicate root_path rows"); - let older_hidden: i64 = - sqlx::query_scalar("SELECT hidden FROM projects WHERE id = ?") - .bind(older_project_id) - .fetch_one(&pool) - .await - .expect("older hidden"); - let newer_hidden: i64 = - sqlx::query_scalar("SELECT hidden FROM projects WHERE id = ?") - .bind(newer_project_id) - .fetch_one(&pool) - .await - .expect("newer hidden"); - assert_eq!(older_hidden, 1, "older duplicate project must be soft-hidden"); - assert_eq!(newer_hidden, 0, "newest duplicate project must remain visible"); + let older_hidden: i64 = sqlx::query_scalar("SELECT hidden FROM projects WHERE id = ?") + .bind(older_project_id) + .fetch_one(&pool) + .await + .expect("older hidden"); + let newer_hidden: i64 = sqlx::query_scalar("SELECT hidden FROM projects WHERE id = ?") + .bind(newer_project_id) + .fetch_one(&pool) + .await + .expect("newer hidden"); + assert_eq!( + older_hidden, 1, + "older duplicate project must be soft-hidden" + ); + assert_eq!( + newer_hidden, 0, + "newest duplicate project must remain visible" + ); } } diff --git a/crates/plugins/src/worker_host.rs b/crates/plugins/src/worker_host.rs index bce4a5a1b..1a9e6b1d3 100644 --- a/crates/plugins/src/worker_host.rs +++ b/crates/plugins/src/worker_host.rs @@ -3326,9 +3326,7 @@ fn validate_registrations( .filter(|handler| !(is_v2_runtime && *handler == "app.activate")) .collect::>(); let actual = handlers.iter().map(String::as_str).collect::>(); - if !is_v2_runtime - && let Some(undeclared) = actual.difference(&declared).next() - { + if !is_v2_runtime && let Some(undeclared) = actual.difference(&declared).next() { return Err(WorkerHostError::new( "handler_undeclared", format!("Worker registered undeclared handler {undeclared}"), @@ -3652,11 +3650,16 @@ mod worker_host_tests { .and_then(Path::parent) .expect("workspace root"); let code_completion_dir = repo_root.join("plugins").join("code-completion"); - let package = PluginPackage::inspect(&code_completion_dir, crate::PluginSourceKind::Snapshot) - .expect("inspect code-completion"); + let package = + PluginPackage::inspect(&code_completion_dir, crate::PluginSourceKind::Snapshot) + .expect("inspect code-completion"); assert_eq!(package.api_version, "2.0"); assert_eq!( - package.app.status_items.first().and_then(|s| s.text.as_deref()), + package + .app + .status_items + .first() + .and_then(|s| s.text.as_deref()), Some("AI代码补全") ); diff --git a/crates/server/src/agent_install.rs b/crates/server/src/agent_install.rs index e7582a89a..ea7630c15 100644 --- a/crates/server/src/agent_install.rs +++ b/crates/server/src/agent_install.rs @@ -374,8 +374,7 @@ where ); prepare_user_environment(&user_env).await?; let _bun = if profile_requires_bun(&plan.agent_id) { - let resolved = - resolve_bun_runtime(&managed_artifacts, node.as_ref(), &user_env).await?; + let resolved = resolve_bun_runtime(&managed_artifacts, node.as_ref(), &user_env).await?; on_progress(36, &format!("[env] bun={}", resolved.display())); if let Some(executable) = resolved.parent() { utils::shell::expose_user_bin_to_process_path(executable); @@ -1019,10 +1018,10 @@ fn export_bootstrapped_node(runtime: &NodeRuntime) -> anyhow::Result<()> { fn export_bootstrapped_bun(bin_dir: &Path) -> anyhow::Result<()> { let home = dirs::home_dir().ok_or_else(|| anyhow::anyhow!("could not resolve the home directory"))?; - let published = - export_managed_bun_to_user_environment(&home, bin_dir, host_shell_family()).map_err( - |error| anyhow::anyhow!("failed to export Bun to the user environment: {error}"), - )?; + let published = export_managed_bun_to_user_environment(&home, bin_dir, host_shell_family()) + .map_err(|error| { + anyhow::anyhow!("failed to export Bun to the user environment: {error}") + })?; if published.is_empty() { anyhow::bail!("managed Bun did not contain a bun executable to export"); } @@ -1116,8 +1115,10 @@ async fn install_bun_via_npm_fallback( ) -> anyhow::Result { let npm = node .map(|runtime| runtime.npm.clone()) - .or(utils::shell::resolve_executable_path(if cfg!(windows) { "npm.cmd" } else { "npm" }) - .await) + .or( + utils::shell::resolve_executable_path(if cfg!(windows) { "npm.cmd" } else { "npm" }) + .await, + ) .ok_or_else(|| anyhow::anyhow!("npm is unavailable for Bun fallback install"))?; let spec = format!("bun@{MANAGED_BUN_VERSION}"); let mut command = utils::process::new_hidden_tokio_command(&npm, std::iter::empty::<&str>()); diff --git a/crates/server/src/domains.rs b/crates/server/src/domains.rs index dadf40ed9..255ad2bd7 100644 --- a/crates/server/src/domains.rs +++ b/crates/server/src/domains.rs @@ -588,9 +588,8 @@ impl ServerApplicationDomains { .await .map_err(internal_error)? .ok_or_else(|| ApplicationError::not_found(format!("plugin {}", args.plugin_id)))?; - let refreshed = - plugins::PluginPackage::inspect(&plugin.source.path, plugin.source.kind) - .unwrap_or_else(|_| plugin.package.clone()); + let refreshed = plugins::PluginPackage::inspect(&plugin.source.path, plugin.source.kind) + .unwrap_or_else(|_| plugin.package.clone()); serialize(refreshed.product_detail().map_err(internal_error)?) } @@ -1300,9 +1299,7 @@ impl ServerApplicationDomains { } } } - if !tried_monorepo - && let Some(monorepo_root) = monorepo_root.as_deref() - { + if !tried_monorepo && let Some(monorepo_root) = monorepo_root.as_deref() { let git_ref = monorepo_plugin_version(monorepo_root).unwrap_or_else(|| "2.0.0".to_owned()); match self @@ -1912,6 +1909,77 @@ impl ServerApplicationDomains { ) } + pub(crate) async fn conversation_projects(&self) -> Result { + #[derive(Debug, Serialize)] + #[serde(rename_all = "camelCase")] + struct ProjectSummary { + id: Uuid, + name: String, + root_path: String, + parent_project_id: Option, + is_git: bool, + is_home: bool, + workspace_ids: Vec, + } + + let _ = self + .deployment + .project() + .migrate_multi_repo_projects(&self.pool, self.deployment.repo()) + .await; + let _ = self + .deployment + .project() + .ensure_home_project(&self.pool, self.deployment.repo()) + .await; + let projects = Project::find_all(&self.pool) + .await + .map_err(internal_error)?; + for project in &projects { + let _ = self.ensure_root_workspace(project.id, None).await; + } + let rows = sqlx::query_as::<_, (Uuid, Uuid)>( + r#"SELECT project_id, id + FROM workspaces + WHERE project_id IS NOT NULL + ORDER BY use_worktree ASC, created_at DESC"#, + ) + .fetch_all(&self.pool) + .await + .map_err(internal_error)?; + let mut by_project: std::collections::HashMap> = + std::collections::HashMap::new(); + for (project_id, workspace_id) in rows { + by_project.entry(project_id).or_default().push(workspace_id); + } + let summaries: Vec = projects + .into_iter() + .map(|project| ProjectSummary { + workspace_ids: by_project.remove(&project.id).unwrap_or_default(), + id: project.id, + name: project.name, + root_path: project.root_path, + parent_project_id: project.parent_project_id, + is_git: project.is_git, + is_home: project.is_home, + }) + .collect(); + serialize(summaries) + } + + pub(crate) async fn workspace_has_repositories( + &self, + workspace_id: Uuid, + ) -> Result { + let repositories = db::models::workspace_repo::WorkspaceRepo::find_repos_for_workspace( + &self.pool, + workspace_id, + ) + .await + .map_err(internal_error)?; + Ok(!repositories.is_empty()) + } + async fn project_repositories(&self, args: Value) -> Result { let args: IdArgs = parse(args)?; serialize( @@ -2002,13 +2070,11 @@ impl ServerApplicationDomains { async fn user_system_info(&self) -> Result { let mut value = crate::host::catalog::config::user_system_info(self).await?; - if let (Some(object), Ok(catalog)) = ( - value.as_object_mut(), - self.plugin_control_catalog().await, - ) { - if let Some(plugins) = catalog.get("plugins").cloned() { - object.insert("plugins".to_string(), plugins); - } + if let (Some(object), Ok(catalog)) = + (value.as_object_mut(), self.plugin_control_catalog().await) + && let Some(plugins) = catalog.get("plugins").cloned() + { + object.insert("plugins".to_string(), plugins); } Ok(value) } @@ -3271,21 +3337,39 @@ mod plugin_invoke_contribution_args { let temp = tempfile::tempdir().expect("tempdir"); let manifest_dir = temp.path().join(".vibex-plugin"); std::fs::create_dir_all(&manifest_dir).expect("create manifest dir"); - std::fs::write( - manifest_dir.join("plugin.json"), - r#"{"version":"2.0.0"}"#, - ) - .expect("write plugin.json"); + std::fs::write(manifest_dir.join("plugin.json"), r#"{"version":"2.0.0"}"#) + .expect("write plugin.json"); assert!(tag_matches_monorepo_official_plugin(None, temp.path())); assert!(tag_matches_monorepo_official_plugin(Some(""), temp.path())); - assert!(tag_matches_monorepo_official_plugin(Some("main"), temp.path())); - assert!(tag_matches_monorepo_official_plugin(Some("master"), temp.path())); - assert!(tag_matches_monorepo_official_plugin(Some("latest"), temp.path())); - assert!(tag_matches_monorepo_official_plugin(Some("2.0.0"), temp.path())); - assert!(tag_matches_monorepo_official_plugin(Some("v2.0.0"), temp.path())); - assert!(tag_matches_monorepo_official_plugin(Some("1.0.0"), temp.path())); - assert!(!tag_matches_monorepo_official_plugin(Some("3.0.0"), temp.path())); + assert!(tag_matches_monorepo_official_plugin( + Some("main"), + temp.path() + )); + assert!(tag_matches_monorepo_official_plugin( + Some("master"), + temp.path() + )); + assert!(tag_matches_monorepo_official_plugin( + Some("latest"), + temp.path() + )); + assert!(tag_matches_monorepo_official_plugin( + Some("2.0.0"), + temp.path() + )); + assert!(tag_matches_monorepo_official_plugin( + Some("v2.0.0"), + temp.path() + )); + assert!(tag_matches_monorepo_official_plugin( + Some("1.0.0"), + temp.path() + )); + assert!(!tag_matches_monorepo_official_plugin( + Some("3.0.0"), + temp.path() + )); } #[tokio::test] diff --git a/crates/server/src/host/collaboration.rs b/crates/server/src/host/collaboration.rs index d61a8f344..038bf9b9c 100644 --- a/crates/server/src/host/collaboration.rs +++ b/crates/server/src/host/collaboration.rs @@ -605,26 +605,25 @@ impl HostCollaborationHost { if let Some(persona_prompt) = optional_text(input, &["personaPrompt", "persona_prompt"]) .map(|p| p.trim().to_string()) .filter(|p| !p.is_empty()) + && let Some(ref mid) = identity_member_id { - if let Some(ref mid) = identity_member_id { - let existing_cfg = collaboration::load_member_session_config(&self.pool, mid) - .await - .ok() - .flatten(); - let _ = collaboration::set_member_session_config( - &self.pool, - mid, - collaboration::MemberSessionConfig { - agent_id: existing_cfg.as_ref().and_then(|c| c.agent_id.clone()), - mode_id: existing_cfg.as_ref().and_then(|c| c.mode_id.clone()), - config_values: existing_cfg - .map(|c| c.config_values) - .unwrap_or_else(|| json!({})), - persona_prompt: Some(persona_prompt), - }, - ) - .await; - } + let existing_cfg = collaboration::load_member_session_config(&self.pool, mid) + .await + .ok() + .flatten(); + let _ = collaboration::set_member_session_config( + &self.pool, + mid, + collaboration::MemberSessionConfig { + agent_id: existing_cfg.as_ref().and_then(|c| c.agent_id.clone()), + mode_id: existing_cfg.as_ref().and_then(|c| c.mode_id.clone()), + config_values: existing_cfg + .map(|c| c.config_values) + .unwrap_or_else(|| json!({})), + persona_prompt: Some(persona_prompt), + }, + ) + .await; } let is_supervisor = if let Some(ref mid) = identity_member_id { collaboration::is_member_supervisor(&self.pool, mid) diff --git a/crates/server/src/host/native/dsh_configuration.rs b/crates/server/src/host/native/dsh_configuration.rs index a3f2922f6..9ebe4abc7 100644 --- a/crates/server/src/host/native/dsh_configuration.rs +++ b/crates/server/src/host/native/dsh_configuration.rs @@ -605,7 +605,9 @@ pub fn default_env_updates( .as_deref() .map(str::trim) .map(|value| value.trim_end_matches('/')) - .filter(|value| !value.is_empty() && !value.eq_ignore_ascii_case(OFFICIAL_BASE_URL)) + .filter(|value| { + !value.is_empty() && !value.eq_ignore_ascii_case(OFFICIAL_BASE_URL) + }) .map(str::to_string), ); } @@ -1164,7 +1166,10 @@ pub fn sanitize_credentials_mapping(credentials: &mut serde_yaml::Mapping) -> bo if !stray.is_empty() { let refs = mapping_entry(credentials, "refs"); for (name, value) in stray { - if value.as_str().is_some_and(|secret| !secret.trim().is_empty()) { + if value + .as_str() + .is_some_and(|secret| !secret.trim().is_empty()) + { let key = Value::String(name); if !refs.contains_key(&key) { refs.insert(key, value); @@ -1175,10 +1180,7 @@ pub fn sanitize_credentials_mapping(credentials: &mut serde_yaml::Mapping) -> bo mutated } -pub fn read_credential_ref( - credentials: &serde_yaml::Mapping, - env_name: &str, -) -> Option { +pub fn read_credential_ref(credentials: &serde_yaml::Mapping, env_name: &str) -> Option { let key = Value::String(env_name.to_string()); credentials .get(Value::String("refs".into())) @@ -1198,11 +1200,7 @@ pub fn read_credential_ref( }) } -fn write_credential_ref( - credentials: &mut serde_yaml::Mapping, - env_name: &str, - value: &str, -) { +fn write_credential_ref(credentials: &mut serde_yaml::Mapping, env_name: &str, value: &str) { sanitize_credentials_mapping(credentials); let refs = mapping_entry(credentials, "refs"); refs.insert( diff --git a/crates/server/src/host/native/model_providers/ops.rs b/crates/server/src/host/native/model_providers/ops.rs index 96807cc9c..a245c116b 100644 --- a/crates/server/src/host/native/model_providers/ops.rs +++ b/crates/server/src/host/native/model_providers/ops.rs @@ -64,16 +64,15 @@ pub async fn resolve_probe_api_key_from( return Ok(api_key); } } - } else if let Some(bound_id) = store.bindings.get(agent_id.as_str()) { - if let Some(api_key) = store + } else if let Some(bound_id) = store.bindings.get(agent_id.as_str()) + && let Some(api_key) = store .providers .iter() .find(|provider| &provider.id == bound_id && &provider.agent_id == agent_id) .map(|provider| provider.api_key.as_str()) .filter(|value| !value.is_empty()) - { - return Ok(api_key.to_string()); - } + { + return Ok(api_key.to_string()); } if let Some(environment) = environment @@ -265,7 +264,10 @@ async fn resolve_native_fallback_api_key( .await .unwrap_or_default(); let env = doc.get("env").unwrap_or(&doc); - let key = json_text(env, &["QODER_API_KEY", "OPENAI_API_KEY", "ANTHROPIC_API_KEY"]); + let key = json_text( + env, + &["QODER_API_KEY", "OPENAI_API_KEY", "ANTHROPIC_API_KEY"], + ); (!key.is_empty()).then_some(key) } "auggie" => { @@ -631,8 +633,10 @@ pub async fn resolve_probe_target( } if agent_id.as_str() == "deepseek_harness" { let paths = crate::host::native::dsh_configuration::resolve_paths(home, environment); - let url = - crate::host::native::dsh_configuration::resolve_stored_base_url(&paths, Some(provider_id)); + let url = crate::host::native::dsh_configuration::resolve_stored_base_url( + &paths, + Some(provider_id), + ); let key = resolve_probe_api_key_from( store_path, agent_id, @@ -744,10 +748,9 @@ async fn resolve_fallback_api_url( .map(|item| item.api_url.clone()) }) .or_else(|| { - state - .providers - .into_iter() - .find_map(|item| (!item.api_url.is_empty()).then_some(item.api_url)) + state.providers.into_iter().find_map(|item| { + (!item.api_url.is_empty()).then_some(item.api_url) + }) }) }) } @@ -1172,4 +1175,3 @@ mod tests { assert_eq!(dsh_key, "sk-dsh-saved"); } } - diff --git a/crates/server/src/host/workspace_files.rs b/crates/server/src/host/workspace_files.rs index 67f7ae6a9..89844ad70 100644 --- a/crates/server/src/host/workspace_files.rs +++ b/crates/server/src/host/workspace_files.rs @@ -6,12 +6,9 @@ //! credential files. A scratch workspace's root can be the user's home directory, //! so the policy cannot rely on the root being a clean project. -use std::collections::HashMap; use std::path::{Component, Path, PathBuf}; use application::ApplicationError; -use db::models::{project::Project, workspace_repo::WorkspaceRepo}; -use deployment::Deployment; use serde::{Deserialize, Serialize}; use serde_json::Value; use uuid::Uuid; @@ -59,66 +56,7 @@ struct FileContent { content: Option, } -#[derive(Debug, Serialize)] -#[serde(rename_all = "camelCase")] -struct ProjectSummary { - id: Uuid, - name: String, - root_path: String, - parent_project_id: Option, - is_git: bool, - is_home: bool, - workspace_ids: Vec, -} - impl ServerApplicationDomains { - /// Imported projects (matching the desktop's "已导入项目" list) with their workspaces, - /// ensuring each project has a root workspace so Companion devices can start conversations in it. - pub(crate) async fn conversation_projects(&self) -> Result { - let _ = self - .deployment - .project() - .migrate_multi_repo_projects(&self.pool, self.deployment.repo()) - .await; - let _ = self - .deployment - .project() - .ensure_home_project(&self.pool, self.deployment.repo()) - .await; - let projects = Project::find_all(&self.pool) - .await - .map_err(internal_error)?; - for project in &projects { - let _ = self.ensure_root_workspace(project.id, None).await; - } - let rows = sqlx::query_as::<_, (Uuid, Uuid)>( - r#"SELECT project_id, id - FROM workspaces - WHERE project_id IS NOT NULL - ORDER BY use_worktree ASC, created_at DESC"#, - ) - .fetch_all(&self.pool) - .await - .map_err(internal_error)?; - let mut by_project: HashMap> = HashMap::new(); - for (project_id, workspace_id) in rows { - by_project.entry(project_id).or_default().push(workspace_id); - } - let summaries: Vec = projects - .into_iter() - .map(|project| ProjectSummary { - workspace_ids: by_project.remove(&project.id).unwrap_or_default(), - id: project.id, - name: project.name, - root_path: project.root_path, - parent_project_id: project.parent_project_id, - is_git: project.is_git, - is_home: project.is_home, - }) - .collect(); - serialize(summaries) - } - /// The directory the Agent works in; scratch workspaces have one even without a repository. async fn browsable_root(&self, workspace_id: Uuid) -> Result { db::SqliteConversationRepository::new(self.pool.clone()) @@ -159,10 +97,7 @@ impl ServerApplicationDomains { args: Value, ) -> Result { let args: WorkspaceArgs = parse(args)?; - let repositories = WorkspaceRepo::find_repos_for_workspace(&self.pool, args.workspace_id) - .await - .map_err(internal_error)?; - if repositories.is_empty() { + if !self.workspace_has_repositories(args.workspace_id).await? { // A workspace without a repository simply has no changes to show. return Ok(Value::Array(Vec::new())); } diff --git a/crates/server/tests/preview_proxy.rs b/crates/server/tests/preview_proxy.rs index 26fe44a77..cabd58f47 100644 --- a/crates/server/tests/preview_proxy.rs +++ b/crates/server/tests/preview_proxy.rs @@ -362,6 +362,8 @@ async fn loopback_preview_proxy_records_endpoint_and_builds_capability_url() { .expect("loopback preview proxy"); assert_eq!( registry.preview_url(lease, CAPABILITY).await, - Some(format!("{endpoint}/api/v1/previews/{lease}/c/{CAPABILITY}/")) + Some(format!( + "{endpoint}/api/v1/previews/{lease}/c/{CAPABILITY}/" + )) ); } diff --git a/crates/services/src/services/mcp/catalog.rs b/crates/services/src/services/mcp/catalog.rs index ce2e03924..bca3440d1 100644 --- a/crates/services/src/services/mcp/catalog.rs +++ b/crates/services/src/services/mcp/catalog.rs @@ -471,7 +471,10 @@ pub fn resolve_snapshot_install_spec( } } } else { - return Err(bad(format!("missing required configuration '{}'", field.key))); + return Err(bad(format!( + "missing required configuration '{}'", + field.key + ))); } } @@ -488,7 +491,10 @@ pub fn resolve_snapshot_install_spec( .entry("env".to_string()) .or_insert_with(|| Value::Object(Map::new())); if let Some(emap) = env.as_object_mut() { - emap.insert("OPEN_CONNECTOR_API_KEY".to_string(), Value::String(optional_key)); + emap.insert( + "OPEN_CONNECTOR_API_KEY".to_string(), + Value::String(optional_key), + ); } } @@ -521,8 +527,16 @@ mod tests { let detail = get_snapshot_server_detail("stripe", &installed).expect("stripe detail"); assert_eq!(detail.kind.as_deref(), Some("connector")); let params = &detail.install_options[0].parameters; - assert!(params.iter().any(|p| p.key == "STRIPE_API_KEY" && p.required)); - assert!(params.iter().any(|p| p.key == "ACCOUNT_ALIAS" && !p.required)); + assert!( + params + .iter() + .any(|p| p.key == "STRIPE_API_KEY" && p.required) + ); + assert!( + params + .iter() + .any(|p| p.key == "ACCOUNT_ALIAS" && !p.required) + ); let mut values = Map::new(); values.insert("STRIPE_API_KEY".to_string(), json!("sk_test_123")); @@ -540,7 +554,11 @@ mod tests { assert_eq!(detail.kind.as_deref(), Some("connector")); let params = &detail.install_options[0].parameters; assert!(params.iter().any(|p| p.key == "API_KEY" && !p.required)); - assert!(params.iter().any(|p| p.key == "ACCOUNT_ALIAS" && !p.required)); + assert!( + params + .iter() + .any(|p| p.key == "ACCOUNT_ALIAS" && !p.required) + ); let empty_values = Map::new(); let default_spec = diff --git a/crates/services/src/services/mcp/mod.rs b/crates/services/src/services/mcp/mod.rs index 2ce813713..2f5d530de 100644 --- a/crates/services/src/services/mcp/mod.rs +++ b/crates/services/src/services/mcp/mod.rs @@ -3707,10 +3707,9 @@ fn extract_declared_tools_from_spec(spec: &Value) -> Vec { .and_then(Value::as_str) .map(str::trim) .filter(|s| !s.is_empty()) + && !out.iter().any(|existing| existing == name) { - if !out.iter().any(|existing| existing == name) { - out.push(name.to_string()); - } + out.push(name.to_string()); } } out @@ -4155,7 +4154,10 @@ async fn probe_http_mcp_tools(spec: &Value) -> Vec { "method": "tools/list", "params": {} }); - let resp = build_post(list_req, session_id.as_deref()).send().await.ok()?; + let resp = build_post(list_req, session_id.as_deref()) + .send() + .await + .ok()?; if !resp.status().is_success() { return None; } @@ -5147,7 +5149,10 @@ pub async fn search_marketplace_with_category( let installed_ids = installed_server_ids(); match provider_id.as_str() { - "" | "all" | MARKETPLACE_CONNECTOR_CATALOG | MARKETPLACE_OPEN_CONNECTOR + "" + | "all" + | MARKETPLACE_CONNECTOR_CATALOG + | MARKETPLACE_OPEN_CONNECTOR | MARKETPLACE_BUILTIN => Ok(catalog::search_builtin_catalog( &q, category.as_deref(), @@ -5162,7 +5167,8 @@ pub async fn search_marketplace_with_category( &installed_ids, ); if !q.trim().is_empty() - && let Ok(online) = search_official_registry(&q, limit.unwrap_or(50).clamp(1, 100)).await + && let Ok(online) = + search_official_registry(&q, limit.unwrap_or(50).clamp(1, 100)).await { let mut seen: BTreeSet = snapshot_items .iter() @@ -5395,20 +5401,18 @@ pub async fn install_marketplace_server( resolve_official_install_spec(&detail.server, &option_id, &values)? } } - MARKETPLACE_SMITHERY => { - match fetch_smithery_server_detail(&server_id).await { - Ok(detail) => resolve_smithery_install_spec(&detail, &option_id, &values)?, - Err(err) => { - if let Ok(resolved) = - catalog::resolve_snapshot_install_spec(&server_id, &option_id, &values) - { - resolved - } else { - return Err(err); - } + MARKETPLACE_SMITHERY => match fetch_smithery_server_detail(&server_id).await { + Ok(detail) => resolve_smithery_install_spec(&detail, &option_id, &values)?, + Err(err) => { + if let Ok(resolved) = + catalog::resolve_snapshot_install_spec(&server_id, &option_id, &values) + { + resolved + } else { + return Err(err); } } - } + }, _ => { return Err(bad(format!( "unsupported marketplace provider: {provider_id}" diff --git a/frontend/src/components/NormalizedConversation/conversation/TurnErrorCard.test.tsx b/frontend/src/components/NormalizedConversation/conversation/TurnErrorCard.test.tsx index a2fd8013a..328c05576 100644 --- a/frontend/src/components/NormalizedConversation/conversation/TurnErrorCard.test.tsx +++ b/frontend/src/components/NormalizedConversation/conversation/TurnErrorCard.test.tsx @@ -115,7 +115,8 @@ describe('TurnErrorCard', () => { - {getCategoryLabel(catId)} - ({categoryCounts[catId] ?? 0}) + + ({categoryCounts[catId] ?? 0}) + ); })} @@ -1492,7 +1503,9 @@ export function ConnectorMarketplace({ setActiveCategory(activeCategory); setBrowseAllInAllTab(false); }} - aria-label={getCategoryLabel(activeCategory as ConnectorCategoryId)} + aria-label={getCategoryLabel( + activeCategory as ConnectorCategoryId + )} className="inline-flex h-7 items-center gap-1 rounded-full bg-foreground px-3 text-xs font-medium text-background shadow-2xs" > @@ -1586,7 +1599,8 @@ export function ConnectorMarketplace({ onClick={() => setActiveCategory(section.categoryId)} className="text-xs font-medium text-muted-foreground transition-colors hover:text-foreground" > - {t('mcp.marketplace.viewAll', '查看全部')} ({section.items.length}) + {t('mcp.marketplace.viewAll', '查看全部')} ( + {section.items.length})
@@ -1603,7 +1617,8 @@ export function ConnectorMarketplace({ className="inline-flex h-8 items-center gap-1.5 rounded-full border border-border bg-muted/40 px-4 text-xs font-medium text-foreground transition-colors hover:bg-muted" > - {t('mcp.marketplace.browseAllConnectors', '浏览全部连接器')} ({filteredEntries.length}) + {t('mcp.marketplace.browseAllConnectors', '浏览全部连接器')}{' '} + ({filteredEntries.length})
@@ -1652,7 +1667,8 @@ export function ConnectorMarketplace({ className="inline-flex h-8 items-center gap-1.5 rounded-full border border-border bg-muted/40 px-4 text-xs font-medium text-foreground transition-colors hover:bg-muted" > - {t('mcp.marketplace.loadMore', '加载更多')} ({visibleEntries.length}/{filteredEntries.length}) + {t('mcp.marketplace.loadMore', '加载更多')} ( + {visibleEntries.length}/{filteredEntries.length}) @@ -1866,7 +1882,9 @@ export function ConnectorMarketplace({ - {t('mcp.createDialogTitle', '新建 MCP 服务器')} + + {t('mcp.createDialogTitle', '新建 MCP 服务器')} + {t('mcp.newServerHint')} diff --git a/frontend/src/components/connectors/connectorCatalog.ts b/frontend/src/components/connectors/connectorCatalog.ts index 5cfa0b718..b7bec1a00 100644 --- a/frontend/src/components/connectors/connectorCatalog.ts +++ b/frontend/src/components/connectors/connectorCatalog.ts @@ -149,7 +149,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'gitlab', name: 'GitLab', - description: 'Manage GitLab repositories, merge requests, pipelines, and issues.', + description: + 'Manage GitLab repositories, merge requests, pipelines, and issues.', category: 'developer_tools', kind: 'mcp', verified: true, @@ -172,7 +173,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'sentry', name: 'Sentry', - description: 'Inspect application errors, stack traces, and release health in Sentry.', + description: + 'Inspect application errors, stack traces, and release health in Sentry.', category: 'developer_tools', kind: 'mcp', verified: true, @@ -212,7 +214,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'vercel', name: 'Vercel', - description: 'Manage Vercel deployments, domains, projects, and serverless logs.', + description: + 'Manage Vercel deployments, domains, projects, and serverless logs.', category: 'developer_tools', kind: 'mcp', verified: true, @@ -324,7 +327,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'posthog', name: 'PostHog', - description: 'Query product analytics, feature flags, session replays, and insights.', + description: + 'Query product analytics, feature flags, session replays, and insights.', category: 'analytics', kind: 'mcp', verified: true, @@ -341,7 +345,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'tavily', name: 'Tavily Search', - description: 'Real-time web search and research extraction optimized for LLM agents.', + description: + 'Real-time web search and research extraction optimized for LLM agents.', category: 'analytics', kind: 'mcp', verified: true, @@ -441,7 +446,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'filesystem', name: 'Filesystem MCP', - description: 'Secure local file system read, write, and directory tree operations.', + description: + 'Secure local file system read, write, and directory tree operations.', category: 'model_context_protocol', kind: 'mcp', verified: true, @@ -458,7 +464,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'memory', name: 'Knowledge Graph Memory', - description: 'Persistent memory using a local knowledge graph of entities and relations.', + description: + 'Persistent memory using a local knowledge graph of entities and relations.', category: 'model_context_protocol', kind: 'mcp', verified: true, @@ -477,7 +484,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'hubspot', name: 'HubSpot', - description: 'Manage CRM contacts, deals, marketing campaigns, and sales pipelines.', + description: + 'Manage CRM contacts, deals, marketing campaigns, and sales pipelines.', category: 'marketing_automation', kind: 'mcp', verified: true, @@ -500,7 +508,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'mailchimp', name: 'Mailchimp', - description: 'Automate email audiences, newsletter campaigns, and marketing performance.', + description: + 'Automate email audiences, newsletter campaigns, and marketing performance.', category: 'marketing_automation', kind: 'mcp', verified: true, @@ -523,7 +532,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'klaviyo', name: 'Klaviyo', - description: 'Manage e-commerce customer segments, flows, templates, and campaign metrics.', + description: + 'Manage e-commerce customer segments, flows, templates, and campaign metrics.', category: 'marketing_automation', kind: 'mcp', verified: true, @@ -546,7 +556,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'stripe', name: 'Stripe', - description: 'Interact with Stripe payments, subscriptions, invoices, and customers.', + description: + 'Interact with Stripe payments, subscriptions, invoices, and customers.', category: 'marketing_automation', kind: 'mcp', verified: true, @@ -571,7 +582,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'x-twitter', name: 'X (Twitter)', - description: 'Post tweets, search timelines, and analyze social engagement on X.', + description: + 'Post tweets, search timelines, and analyze social engagement on X.', category: 'social', kind: 'mcp', verified: true, @@ -594,7 +606,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'reddit', name: 'Reddit', - description: 'Browse subreddits, threads, comments, and trending community discussions.', + description: + 'Browse subreddits, threads, comments, and trending community discussions.', category: 'social', kind: 'mcp', verified: true, @@ -611,7 +624,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'linkedin', name: 'LinkedIn', - description: 'Publish company updates, manage professional posts, and inspect profile insights.', + description: + 'Publish company updates, manage professional posts, and inspect profile insights.', category: 'social', kind: 'mcp', verified: true, @@ -628,7 +642,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'youtube', name: 'YouTube', - description: 'Fetch video transcripts, channel analytics, playlists, and comment threads.', + description: + 'Fetch video transcripts, channel analytics, playlists, and comment threads.', category: 'social', kind: 'mcp', verified: true, @@ -647,7 +662,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'notion', name: 'Notion', - description: 'Search, read, and update Notion pages, databases, and workspace docs.', + description: + 'Search, read, and update Notion pages, databases, and workspace docs.', category: 'productivity', kind: 'mcp', verified: true, @@ -670,7 +686,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'linear', name: 'Linear', - description: 'Create and triage issues, projects, cycles, and roadmaps in Linear.', + description: + 'Create and triage issues, projects, cycles, and roadmaps in Linear.', category: 'productivity', kind: 'mcp', verified: true, @@ -686,7 +703,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'google-drive', name: 'Google Drive', - description: 'Search and read Google Docs, Sheets, Slides, and Drive folders.', + description: + 'Search and read Google Docs, Sheets, Slides, and Drive folders.', category: 'productivity', kind: 'mcp', verified: true, @@ -703,7 +721,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'atlassian-jira', name: 'Jira & Confluence', - description: 'Manage Jira sprints, issues, and Confluence knowledge base pages.', + description: + 'Manage Jira sprints, issues, and Confluence knowledge base pages.', category: 'productivity', kind: 'mcp', verified: true, @@ -722,7 +741,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'slack', name: 'Slack', - description: 'Send messages, read channel history, and manage workspace threads in Slack.', + description: + 'Send messages, read channel history, and manage workspace threads in Slack.', category: 'communication', kind: 'mcp', verified: true, @@ -745,7 +765,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'discord', name: 'Discord', - description: 'Automate Discord server channels, messages, webhooks, and moderation.', + description: + 'Automate Discord server channels, messages, webhooks, and moderation.', category: 'communication', kind: 'mcp', verified: true, @@ -785,7 +806,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'telegram', name: 'Telegram', - description: 'Send notifications, manage bot chats, and read channel updates.', + description: + 'Send notifications, manage bot chats, and read channel updates.', category: 'communication', kind: 'mcp', verified: true, @@ -804,7 +826,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'figma', name: 'Figma', - description: 'Inspect Figma frames, design tokens, components, and auto-layout specs.', + description: + 'Inspect Figma frames, design tokens, components, and auto-layout specs.', category: 'design', kind: 'mcp', verified: true, @@ -827,7 +850,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'canva', name: 'Canva', - description: 'Generate social graphics, presentations, and brand templates with Canva.', + description: + 'Generate social graphics, presentations, and brand templates with Canva.', category: 'design', kind: 'mcp', verified: true, @@ -843,7 +867,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'excalidraw', name: 'Excalidraw', - description: 'Create and edit hand-drawn architecture diagrams and whiteboards.', + description: + 'Create and edit hand-drawn architecture diagrams and whiteboards.', category: 'design', kind: 'mcp', verified: true, @@ -860,7 +885,8 @@ export const BUILTIN_CONNECTOR_CATALOG: readonly ConnectorCatalogEntry[] = [ providerId: 'official_registry', serverId: 'mermaid', name: 'Mermaid Diagrams', - description: 'Render sequence diagrams, flowcharts, and architecture visualizations.', + description: + 'Render sequence diagrams, flowcharts, and architecture visualizations.', category: 'design', kind: 'mcp', verified: true, @@ -917,10 +943,9 @@ export function normalizeConnectorCategory( return 'design'; } - const text = `${item?.name ?? ''} ${item?.server_id ?? ''} ${item?.description ?? ''}`.toLowerCase(); - if ( - /\b(Figma|Canva|Excalidraw|Mermaid|design|ui|ux|svg)\b/i.test(text) - ) { + const text = + `${item?.name ?? ''} ${item?.server_id ?? ''} ${item?.description ?? ''}`.toLowerCase(); + if (/\b(Figma|Canva|Excalidraw|Mermaid|design|ui|ux|svg)\b/i.test(text)) { return 'design'; } if ( @@ -997,7 +1022,8 @@ export function marketplaceItemToConnectorEntry( return { id: existingBuiltin?.id ?? `${item.provider_id}:${normalizedServerId}`, - providerId: item.provider_id || existingBuiltin?.providerId || 'official_registry', + providerId: + item.provider_id || existingBuiltin?.providerId || 'official_registry', serverId: normalizedServerId, name: item.name || existingBuiltin?.name || normalizedServerId, description: item.description || existingBuiltin?.description || '', @@ -1036,4 +1062,3 @@ export function mergeConnectorCatalog( return Array.from(merged.values()); } - diff --git a/frontend/src/components/layout/IDELayout.tsx b/frontend/src/components/layout/IDELayout.tsx index e41254245..1c9af8b1c 100644 --- a/frontend/src/components/layout/IDELayout.tsx +++ b/frontend/src/components/layout/IDELayout.tsx @@ -1028,10 +1028,7 @@ export function IDELayout({ } lastDropTargetZoneRef.current = null; - if ( - getEditorGroups(api).length === 0 && - !useLayoutStore.getState().isWorkspaceEditorAreaCollapsed - ) { + if (getEditorGroups(api).length === 0 && !isCollapsedRef.current) { recreateWelcomeEditorGroup(api); } diff --git a/frontend/src/components/layout/RightPanelContent.tsx b/frontend/src/components/layout/RightPanelContent.tsx index 36ce4940c..f1807970d 100644 --- a/frontend/src/components/layout/RightPanelContent.tsx +++ b/frontend/src/components/layout/RightPanelContent.tsx @@ -417,11 +417,8 @@ export function RightPanelContent() { ] ); - const { - openSessionTab, - openOrFocusPanel, - runInEditorGroup, - } = usePanelActionsContext(); + const { openSessionTab, openOrFocusPanel, runInEditorGroup } = + usePanelActionsContext(); const pendingTargetGroupIdRef = useRef(null); const handleCreatedSession = useCallback( @@ -598,8 +595,7 @@ export function RightPanelContent() { handleCreatedSession({ sessionId: newSession.id, workspaceId: newSession.workspace_id, - agentId: - newSession.executor ?? profileToPersist?.executor ?? null, + agentId: newSession.executor ?? profileToPersist?.executor ?? null, }); setIsCreateOverlayOpen(false); }, @@ -663,10 +659,7 @@ export function RightPanelContent() { if (effectiveActiveTab === 'workspace') { const targetGroupId = pendingTargetGroupIdRef.current; const openPlaceholder = () => - openOrFocusPanel( - PANEL_IDS.AI_CHAT, - t('rightPanelContent.newSession') - ); + openOrFocusPanel(PANEL_IDS.AI_CHAT, t('rightPanelContent.newSession')); if (targetGroupId) { runInEditorGroup(targetGroupId, openPlaceholder); } else { diff --git a/frontend/src/components/layout/StatusBarMcp.test.tsx b/frontend/src/components/layout/StatusBarMcp.test.tsx index 69f09a1b8..36fd3a2d7 100644 --- a/frontend/src/components/layout/StatusBarMcp.test.tsx +++ b/frontend/src/components/layout/StatusBarMcp.test.tsx @@ -343,9 +343,7 @@ describe('StatusBarMcp', () => { ).toBeInTheDocument(); fireEvent.click(screen.getByRole('switch', { name: 'GitHub' })); - await waitFor(() => - expect(uninstallLocal).toHaveBeenCalledWith('github') - ); + await waitFor(() => expect(uninstallLocal).toHaveBeenCalledWith('github')); }); it('displays discovered tools and tool count for connected local MCP servers when tools are available', async () => { diff --git a/frontend/src/components/layout/StatusBarMcp.tsx b/frontend/src/components/layout/StatusBarMcp.tsx index a5afd5eb9..01f6ea99a 100644 --- a/frontend/src/components/layout/StatusBarMcp.tsx +++ b/frontend/src/components/layout/StatusBarMcp.tsx @@ -153,7 +153,10 @@ export function StatusBarMcp() { const handleLocalChanged = () => { void queryClient.invalidateQueries({ queryKey: localMcpServersQueryKey }); }; - window.addEventListener(LOCAL_MCP_SERVERS_CHANGED_EVENT, handleLocalChanged); + window.addEventListener( + LOCAL_MCP_SERVERS_CHANGED_EVENT, + handleLocalChanged + ); return () => { window.removeEventListener( LOCAL_MCP_SERVERS_CHANGED_EVENT, @@ -227,7 +230,9 @@ export function StatusBarMcp() { try { await mcpMarketApi.uninstall(server.id); notifyLocalMcpServersChanged(); - await queryClient.invalidateQueries({ queryKey: localMcpServersQueryKey }); + await queryClient.invalidateQueries({ + queryKey: localMcpServersQueryKey, + }); } catch (error) { setActionError( t('mcp.actionFailed', { message: getInvokeErrorMessage(error) }) diff --git a/frontend/src/components/layout/panels/workspaceTabDrag.integration.test.tsx b/frontend/src/components/layout/panels/workspaceTabDrag.integration.test.tsx index 01b2f16ae..aa92e62d0 100644 --- a/frontend/src/components/layout/panels/workspaceTabDrag.integration.test.tsx +++ b/frontend/src/components/layout/panels/workspaceTabDrag.integration.test.tsx @@ -153,7 +153,9 @@ describe('workspace tab drag', () => { const sessionSurface = container.querySelector( '[data-session-tab="true"]' ) as HTMLElement | null; - const sessionTab = sessionSurface?.closest('.dv-tab') as HTMLElement | null; + const sessionTab = sessionSurface?.closest( + '.dv-tab' + ) as HTMLElement | null; expect(notesTab).toBeTruthy(); expect(sessionTab).toBeTruthy(); if (!notesTab || !sessionTab || !editorGroup || !sessionGroup) { @@ -226,4 +228,3 @@ describe('workspace tab drag', () => { } }); }); - diff --git a/frontend/src/components/onboarding/hero/AgentMark.tsx b/frontend/src/components/onboarding/hero/AgentMark.tsx index d7be51c2d..136a5ae57 100644 --- a/frontend/src/components/onboarding/hero/AgentMark.tsx +++ b/frontend/src/components/onboarding/hero/AgentMark.tsx @@ -202,11 +202,36 @@ export function AgentMark({ id, title }: { id: string; title?: string }) { ); case 'omp': return ( - + {title ? {title} : null} - - - + + + diff --git a/frontend/src/components/panels/DockviewAIChatPanel.tsx b/frontend/src/components/panels/DockviewAIChatPanel.tsx index 5f718f842..fb9ce6529 100644 --- a/frontend/src/components/panels/DockviewAIChatPanel.tsx +++ b/frontend/src/components/panels/DockviewAIChatPanel.tsx @@ -1,4 +1,10 @@ -import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react'; +import { + useCallback, + useEffect, + useLayoutEffect, + useMemo, + useRef, +} from 'react'; import type { IDockviewPanelProps } from 'dockview-react'; import { MessageSquare } from 'lucide-react'; import { KanbanSessionConversationView } from '@/components/kanban/KanbanSessionConversationView'; diff --git a/frontend/src/components/plugins/CodeCompletionStatusPopover.tsx b/frontend/src/components/plugins/CodeCompletionStatusPopover.tsx index 74a91bb2d..a42a12ef8 100644 --- a/frontend/src/components/plugins/CodeCompletionStatusPopover.tsx +++ b/frontend/src/components/plugins/CodeCompletionStatusPopover.tsx @@ -242,8 +242,7 @@ export function CodeCompletionStatusPopover({ const enabled = Boolean(config.enabled ?? true); const currentModel = String(config.model ?? 'gpt-4o-mini').trim(); - const triggerMode = - config.triggerMode === 'manual' ? 'manual' : 'auto'; + const triggerMode = config.triggerMode === 'manual' ? 'manual' : 'auto'; const manualShortcut = typeof config.manualShortcut === 'string' && config.manualShortcut.trim() ? config.manualShortcut.trim() @@ -354,7 +353,11 @@ export function CodeCompletionStatusPopover({ {modelOptions.map((item) => ( - + {item.name && item.name.trim() && item.name.trim() !== item.id diff --git a/frontend/src/components/plugins/PluginSchemaSettingsForm.tsx b/frontend/src/components/plugins/PluginSchemaSettingsForm.tsx index 9a8a8db04..43b3c6f61 100644 --- a/frontend/src/components/plugins/PluginSchemaSettingsForm.tsx +++ b/frontend/src/components/plugins/PluginSchemaSettingsForm.tsx @@ -341,8 +341,7 @@ export function PluginSchemaSettingsForm({ setSavedNotice(false); setValues((prev) => ({ ...prev, - [key]: - prop.type === 'array' ? deduped : deduped.join(', '), + [key]: prop.type === 'array' ? deduped : deduped.join(', '), })); }; diff --git a/frontend/src/components/settings/AgentSessionConfigPicker.tsx b/frontend/src/components/settings/AgentSessionConfigPicker.tsx index 654f088de..b31f96ac8 100644 --- a/frontend/src/components/settings/AgentSessionConfigPicker.tsx +++ b/frontend/src/components/settings/AgentSessionConfigPicker.tsx @@ -335,7 +335,9 @@ export function AgentSessionConfigPicker({ ) : null} - {selectedAgentId && activeError && (!hasSessionControls || refreshError) ? ( + {selectedAgentId && + activeError && + (!hasSessionControls || refreshError) ? ( { const label = payload.token?.label?.trim() ?? ''; const markdown = payload.token?.markdown?.trim() ?? ''; - const text = - payload.token?.text?.trim() ?? payload.text?.trim() ?? ''; + const text = payload.token?.text?.trim() ?? payload.text?.trim() ?? ''; if ((!label || !markdown) && !text) return; const handle = handleRef.current; if (!handle || getActiveComposerDraftTargetId() !== handle.id) return; diff --git a/frontend/src/contexts/PanelActionsContext.tsx b/frontend/src/contexts/PanelActionsContext.tsx index 85a8e1d95..d806a4bf9 100644 --- a/frontend/src/contexts/PanelActionsContext.tsx +++ b/frontend/src/contexts/PanelActionsContext.tsx @@ -1717,12 +1717,7 @@ export function PanelActionsProvider({ children }: { children: ReactNode }) { ).element?.setAttribute('data-session-dock', 'true'); } - setColumnVisible( - dockviewApi, - getLayoutArrangement(), - targetGroup, - true - ); + setColumnVisible(dockviewApi, getLayoutArrangement(), targetGroup, true); const unboundPlaceholders = targetGroup.panels.filter( (panel) => diff --git a/frontend/src/features/collaboration/space/CollaborationSpaceRuntime.tsx b/frontend/src/features/collaboration/space/CollaborationSpaceRuntime.tsx index d0e234d3e..556c9cc08 100644 --- a/frontend/src/features/collaboration/space/CollaborationSpaceRuntime.tsx +++ b/frontend/src/features/collaboration/space/CollaborationSpaceRuntime.tsx @@ -6700,13 +6700,7 @@ export function useCollaborationSpaceRuntime(workspaceId: string | null) { // it also holds a seat in a group, so list the full direct roster. unassignedMembers: directFallbackMembers, }), - [ - directFallbackMembers, - membersBySpace, - sidebarItems, - spaces, - unassignedId, - ] + [directFallbackMembers, membersBySpace, sidebarItems, spaces, unassignedId] ); chatListRef.current = chatList; const createGroupBots = useMemo( @@ -6796,9 +6790,10 @@ export function useCollaborationSpaceRuntime(workspaceId: string | null) { ), [chatList] ); - const supervisorEntry = useMemo< - Extract | null - >(() => { + const supervisorEntry = useMemo | null>(() => { if ( supervisorOverride.active && supervisorOverride.workspace === workspace @@ -6831,7 +6826,12 @@ export function useCollaborationSpaceRuntime(workspaceId: string | null) { ); const { visible: visibleChatList, hidden: hiddenChatList } = useMemo( () => - applyContactListView(listChatEntries, contactChrome, listSort, typeFilter), + applyContactListView( + listChatEntries, + contactChrome, + listSort, + typeFilter + ), [contactChrome, listChatEntries, listSort, typeFilter] ); const contactSections = useMemo( diff --git a/frontend/src/features/collaboration/space/MessageStream.tsx b/frontend/src/features/collaboration/space/MessageStream.tsx index 368a82d64..30bcbb795 100644 --- a/frontend/src/features/collaboration/space/MessageStream.tsx +++ b/frontend/src/features/collaboration/space/MessageStream.tsx @@ -1,10 +1,4 @@ -import { - memo, - useEffect, - useMemo, - useRef, - type MutableRefObject, -} from 'react'; +import { memo, useEffect, useMemo, useRef, type MutableRefObject } from 'react'; import { ConversationMessageNav } from '@/components/conversation-thread/ConversationMessageNav'; import { Button } from '@/components/ui/button'; import { PermissionRequestCard } from '@/components/NormalizedConversation/conversation/PermissionRequestCard'; @@ -51,8 +45,9 @@ import { useCollaborationSpacePick } from './SpaceContext'; type SpaceMessage = CollaborationSpaceRuntime['filteredMessages'][number]; type MessageClusterPosition = CollaborationSpaceRuntime['messageClusters'][number]; -type SpaceDeliveryReceipt = - NonNullable[number]; +type SpaceDeliveryReceipt = NonNullable< + CollaborationSpaceRuntime['receiptsBySeq'][number] +>[number]; type SpaceCardRecord = NonNullable< CollaborationSpaceRuntime['threadCards'] >[number]; @@ -248,10 +243,9 @@ const SpaceMessageRow = memo(function SpaceMessageRow({ - {receipt.nickname - ? `${receipt.nickname} ${status}` - : status} + {receipt.nickname ? `${receipt.nickname} ${status}` : status} ); diff --git a/frontend/src/hooks/usePluginHostContributions.ts b/frontend/src/hooks/usePluginHostContributions.ts index e96da2bb1..aa4adb494 100644 --- a/frontend/src/hooks/usePluginHostContributions.ts +++ b/frontend/src/hooks/usePluginHostContributions.ts @@ -201,67 +201,72 @@ export function usePluginContributionCatalogSync() { providerServices.ensureHostProviderServicesRegistered(); coreFoundation.ensureCoreFoundationPluginsBootstrapped(); const activeIds = new Set(); - for (const item of items) { - activeIds.add(item.pluginId); - const monorepoBundle = monorepoBootstrap.getMonorepoPluginBundle( - item.pluginId - ); - if (monorepoBundle) { - if ( - loadedGenerationByPluginRef.current.get(item.pluginId) !== - item.generation - ) { - loadedGenerationByPluginRef.current.set( - item.pluginId, + for (const item of items) { + activeIds.add(item.pluginId); + const monorepoBundle = monorepoBootstrap.getMonorepoPluginBundle( + item.pluginId + ); + if (monorepoBundle) { + if ( + loadedGenerationByPluginRef.current.get(item.pluginId) !== item.generation - ); - void runtimeLoader.loadPluginRuntime( - item.pluginId, - { - kind: 'module', - module: monorepoBundle.module, - spec: monorepoBundle.spec, - }, - { - generation: item.generation, - } - ); + ) { + loadedGenerationByPluginRef.current.set( + item.pluginId, + item.generation + ); + void runtimeLoader.loadPluginRuntime( + item.pluginId, + { + kind: 'module', + module: monorepoBundle.module, + spec: monorepoBundle.spec, + }, + { + generation: item.generation, + } + ); + } + continue; } - continue; - } - const meta = contributionMetadata(item); - const runtimeSource = meta.runtimeSource as - | PluginRuntimeSource - | undefined; - if ( - runtimeSource && - typeof runtimeSource === 'object' && - 'kind' in runtimeSource - ) { + const meta = contributionMetadata(item); + const runtimeSource = meta.runtimeSource as + | PluginRuntimeSource + | undefined; if ( - loadedGenerationByPluginRef.current.get(item.pluginId) !== - item.generation + runtimeSource && + typeof runtimeSource === 'object' && + 'kind' in runtimeSource ) { - loadedGenerationByPluginRef.current.set( - item.pluginId, + if ( + loadedGenerationByPluginRef.current.get(item.pluginId) !== item.generation - ); - void runtimeLoader.loadPluginRuntime(item.pluginId, runtimeSource, { - generation: item.generation, - }); + ) { + loadedGenerationByPluginRef.current.set( + item.pluginId, + item.generation + ); + void runtimeLoader.loadPluginRuntime( + item.pluginId, + runtimeSource, + { + generation: item.generation, + } + ); + } } } - } - for (const previousId of knownHostPluginIdsRef.current) { - if (!activeIds.has(previousId)) { - loadedGenerationByPluginRef.current.delete(previousId); - runtimeLoader.unloadPluginRuntime(previousId); + for (const previousId of knownHostPluginIdsRef.current) { + if (!activeIds.has(previousId)) { + loadedGenerationByPluginRef.current.delete(previousId); + runtimeLoader.unloadPluginRuntime(previousId); + } } + knownHostPluginIdsRef.current = activeIds; } - knownHostPluginIdsRef.current = activeIds; - }); + ); return () => { cancelled = true; }; diff --git a/frontend/src/i18n/locales/en/settings.json b/frontend/src/i18n/locales/en/settings.json index 99f0879eb..5e96d344d 100644 --- a/frontend/src/i18n/locales/en/settings.json +++ b/frontend/src/i18n/locales/en/settings.json @@ -1222,9 +1222,6 @@ "generate": "Generate", "pairingTitle": "Device pairing", "pairingDescription": "Create a connection code. Scan the QR or type the code on the phone.", - "pairingPresetLabel": "Device class", - "pairingPresetCompanion": "Companion", - "pairingPresetWorkstation": "Workstation", "copyAddress": "Copy address", "pairingNeedsReachability": "Turn on Allow LAN, or connect a public tunnel.", "stalePortOccupied": "Port {{port}} is already in use.", diff --git a/frontend/src/i18n/locales/zh-CN/settings.json b/frontend/src/i18n/locales/zh-CN/settings.json index c22caccaf..67f9e288d 100644 --- a/frontend/src/i18n/locales/zh-CN/settings.json +++ b/frontend/src/i18n/locales/zh-CN/settings.json @@ -1222,9 +1222,6 @@ "generate": "生成", "pairingTitle": "设备配对", "pairingDescription": "生成连接码。手机扫二维码或输入连接码。", - "pairingPresetLabel": "设备类型", - "pairingPresetCompanion": "伴随端", - "pairingPresetWorkstation": "工作站", "copyAddress": "复制地址", "pairingNeedsReachability": "先打开允许局域网,或连通远程穿透。", "stalePortOccupied": "端口 {{port}} 已被占用。", diff --git a/frontend/src/lib/api/plugins.ts b/frontend/src/lib/api/plugins.ts index e1ad43393..7ae500bf1 100644 --- a/frontend/src/lib/api/plugins.ts +++ b/frontend/src/lib/api/plugins.ts @@ -566,10 +566,7 @@ export function createPluginControlApi(transport: BackendTransport) { ); return detail; }, - discoverModels: (request: { - baseUrl: string; - apiKey?: string | null; - }) => + discoverModels: (request: { baseUrl: string; apiKey?: string | null }) => transport.call('dsh_provider_discover_models', { request: { base_url: request.baseUrl, diff --git a/frontend/src/lib/pluginFederation.ts b/frontend/src/lib/pluginFederation.ts index bfdb9aa05..478545ccf 100644 --- a/frontend/src/lib/pluginFederation.ts +++ b/frontend/src/lib/pluginFederation.ts @@ -103,9 +103,7 @@ export function activatePluginModuleSync( typeof (maybePromise as Promise).then === 'function' ) { return ( - maybePromise as Promise< - void | (() => void) | { dispose?: () => void } - > + maybePromise as Promise void) | { dispose?: () => void }> ).then( (resolvedDisposer) => { returnedDisposer = resolvedDisposer; diff --git a/frontend/src/lib/sessionTitle.test.ts b/frontend/src/lib/sessionTitle.test.ts index 854e93a38..53381f892 100644 --- a/frontend/src/lib/sessionTitle.test.ts +++ b/frontend/src/lib/sessionTitle.test.ts @@ -47,4 +47,3 @@ describe('sanitizeSessionListTitle', () => { expect(sessionTitleIsCjk('Implement auth')).toBe(false); }); }); - diff --git a/frontend/src/lib/sessionTitle.ts b/frontend/src/lib/sessionTitle.ts index 5256e34b1..0f9c8c42e 100644 --- a/frontend/src/lib/sessionTitle.ts +++ b/frontend/src/lib/sessionTitle.ts @@ -23,4 +23,3 @@ export function sanitizeSessionListTitle(title: string): string { export function sessionTitleIsCjk(title: string): boolean { return CJK_TITLE_RE.test(title); } - diff --git a/frontend/src/pages/plugins/AgentDefaultsField.tsx b/frontend/src/pages/plugins/AgentDefaultsField.tsx index 17a47a8ee..f22712290 100644 --- a/frontend/src/pages/plugins/AgentDefaultsField.tsx +++ b/frontend/src/pages/plugins/AgentDefaultsField.tsx @@ -180,7 +180,9 @@ function AgentDefaultRow({ .catch((error) => { if (active) { setCatalog(null); - setLoadError(error ?? new Error(t('plugins.agentDefaultsUnavailable'))); + setLoadError( + error ?? new Error(t('plugins.agentDefaultsUnavailable')) + ); } }); return () => { diff --git a/frontend/src/pages/plugins/PluginConfigForm.test.tsx b/frontend/src/pages/plugins/PluginConfigForm.test.tsx index 62d79c41b..b77b12acf 100644 --- a/frontend/src/pages/plugins/PluginConfigForm.test.tsx +++ b/frontend/src/pages/plugins/PluginConfigForm.test.tsx @@ -239,7 +239,11 @@ describe('PluginConfigForm', () => { properties: { baseUrl: { type: 'string', title: 'Base URL' }, apiKey: { type: 'string', title: 'API Key' }, - model: { type: 'string', title: '补全模型', default: 'gpt-4o-mini' }, + model: { + type: 'string', + title: '补全模型', + default: 'gpt-4o-mini', + }, }, }, }, @@ -564,6 +568,3 @@ describe('PluginConfigForm', () => { }); }); }); - - - diff --git a/frontend/src/pages/plugins/PluginConfigForm.tsx b/frontend/src/pages/plugins/PluginConfigForm.tsx index cbc2bd20c..a09e39d6e 100644 --- a/frontend/src/pages/plugins/PluginConfigForm.tsx +++ b/frontend/src/pages/plugins/PluginConfigForm.tsx @@ -146,9 +146,7 @@ function ModelSchemaField({ const defaultModel = typeof schema.default === 'string' ? schema.default.trim() : ''; const currentValue = - typeof value === 'string' && value.trim() - ? value.trim() - : defaultModel; + typeof value === 'string' && value.trim() ? value.trim() : defaultModel; const options = useMemo(() => { const merged: DiscoveredModelOption[] = []; @@ -413,8 +411,7 @@ function TokenListSchemaField({ const emitTokens = (nextTokens: string[]) => { const deduped = parseTokenListValue(nextTokens); - const nextValue = - schema.type === 'array' ? deduped : deduped.join(', '); + const nextValue = schema.type === 'array' ? deduped : deduped.join(', '); onChange(nextValue, true); }; @@ -1019,10 +1016,7 @@ export function PluginConfigForm({ const properties = useMemo>(() => { const base = schemaProperties(detail.configSchema); const triggerIdx = base.findIndex(([key]) => key === 'triggerMode'); - if ( - triggerIdx >= 0 && - !base.some(([key]) => key === 'manualShortcut') - ) { + if (triggerIdx >= 0 && !base.some(([key]) => key === 'manualShortcut')) { const manualShortcutSchema: JsonSchema = { type: 'string', default: 'Alt+\\', @@ -1030,10 +1024,7 @@ export function PluginConfigForm({ 'Keyboard shortcut to manually trigger inline code completion in the editor (e.g. Alt+\\, Ctrl+Shift+Space, Alt+I).', }; const next = [...base]; - next.splice(triggerIdx + 1, 0, [ - 'manualShortcut', - manualShortcutSchema, - ]); + next.splice(triggerIdx + 1, 0, ['manualShortcut', manualShortcutSchema]); return next; } return base; diff --git a/frontend/src/pages/settings/AgentDetail.test.tsx b/frontend/src/pages/settings/AgentDetail.test.tsx index 6dca7e965..7e20f2852 100644 --- a/frontend/src/pages/settings/AgentDetail.test.tsx +++ b/frontend/src/pages/settings/AgentDetail.test.tsx @@ -1069,9 +1069,7 @@ describe('AgentDetail', () => { ); await userEvent.click(screen.getByRole('button', { name: '安装 ACP' })); - await userEvent.click( - screen.getByRole('button', { name: '安装最新版' }) - ); + await userEvent.click(screen.getByRole('button', { name: '安装最新版' })); expect(onInstall).toHaveBeenCalledOnce(); await userEvent.click( diff --git a/frontend/src/pages/settings/AgentDetail.tsx b/frontend/src/pages/settings/AgentDetail.tsx index 81873d7f4..d246417cb 100644 --- a/frontend/src/pages/settings/AgentDetail.tsx +++ b/frontend/src/pages/settings/AgentDetail.tsx @@ -467,7 +467,10 @@ export function AgentDetail({ {customVersionValid ? null : customVersion ? ( -

+

{t('agents.customVersionInvalid')}

) : null} diff --git a/frontend/src/pages/settings/AgentSettings.test.tsx b/frontend/src/pages/settings/AgentSettings.test.tsx index 4f24ddb99..1a4c8923f 100644 --- a/frontend/src/pages/settings/AgentSettings.test.tsx +++ b/frontend/src/pages/settings/AgentSettings.test.tsx @@ -1149,9 +1149,7 @@ describe('AgentSettings', () => { await user.click(screen.getByRole('button', { name: '立即检查' })); await user.click(await screen.findByRole('button', { name: '安装 ACP' })); - await user.click( - await screen.findByRole('button', { name: '安装最新版' }) - ); + await user.click(await screen.findByRole('button', { name: '安装最新版' })); expect(api.addAndInstall).toHaveBeenCalledWith('kimi'); }); @@ -2734,9 +2732,7 @@ describe('AgentSettings', () => { await waitFor(() => expect(screen.queryByText(unavailableReason)).not.toBeInTheDocument() ); - expect( - screen.getByRole('button', { name: '登录 OMP' }) - ).not.toBeDisabled(); + expect(screen.getByRole('button', { name: '登录 OMP' })).not.toBeDisabled(); }); it('recovers from transient accountFlow polling errors and clears running state on persistent failure', async () => { diff --git a/frontend/src/pages/settings/AgentSettings.tsx b/frontend/src/pages/settings/AgentSettings.tsx index 9a4574d71..7a0766dd1 100644 --- a/frontend/src/pages/settings/AgentSettings.tsx +++ b/frontend/src/pages/settings/AgentSettings.tsx @@ -760,9 +760,7 @@ export function AgentSettings() { inspectCacheRef.current.actions.set(targetAgentId, nextActions); } if (nextDiagnostics) { - const unread = nextDiagnostics.filter( - (diagnostic) => !diagnostic.read - ); + const unread = nextDiagnostics.filter((diagnostic) => !diagnostic.read); inspectCacheRef.current.diagnostics.set(targetAgentId, unread); } if ( diff --git a/frontend/src/pages/settings/DshAuthPanel.catalog.test.tsx b/frontend/src/pages/settings/DshAuthPanel.catalog.test.tsx index e5790574c..7e041d753 100644 --- a/frontend/src/pages/settings/DshAuthPanel.catalog.test.tsx +++ b/frontend/src/pages/settings/DshAuthPanel.catalog.test.tsx @@ -55,6 +55,7 @@ const view: DshProvidersView = { api: null, base_url: null, api_key_env: 'DEEPSEEK_API_KEY', + api_key: null, credential_present: true, models: [{ id: 'deepseek-v4-flash', name: 'DeepSeek-V4-Flash' }], }, diff --git a/frontend/src/pages/settings/DshAuthPanel.test.tsx b/frontend/src/pages/settings/DshAuthPanel.test.tsx index 5d8538f1d..64765c838 100644 --- a/frontend/src/pages/settings/DshAuthPanel.test.tsx +++ b/frontend/src/pages/settings/DshAuthPanel.test.tsx @@ -55,6 +55,7 @@ const view: DshProvidersView = { api: null, base_url: null, api_key_env: 'DEEPSEEK_API_KEY', + api_key: null, credential_present: true, models: [{ id: 'deepseek-v4-flash', name: 'DeepSeek-V4-Flash' }], }, @@ -190,7 +191,7 @@ describe('DshAuthPanel', () => { 'true' ); expect(screen.getByRole('heading', { name: '模型供应商' })).toBeVisible(); - expect(screen.getByText('暂无供应商')).toBeVisible(); + expect(screen.getByText('还没有供应商。')).toBeVisible(); await userEvent.click(screen.getByRole('button', { name: '新建供应商' })); expect(await screen.findByLabelText('显示名称')).toBeInTheDocument(); expect(screen.getByLabelText('备注')).toBeInTheDocument(); @@ -238,6 +239,7 @@ describe('DshAuthPanel', () => { api: 'openai-completions', base_url: 'https://first.example.com/v1', api_key_env: 'DSH_CUSTOM_1_KEY', + api_key: null, credential_present: false, models: [{ id: 'm1', name: 'M1' }], }, @@ -249,6 +251,7 @@ describe('DshAuthPanel', () => { api: 'openai-completions', base_url: 'https://second.example.com/v1', api_key_env: 'DSH_CUSTOM_2_KEY', + api_key: null, credential_present: true, models: [{ id: 'm2', name: 'M2' }], }, diff --git a/frontend/src/pages/settings/DshAuthPanel.tsx b/frontend/src/pages/settings/DshAuthPanel.tsx index 37669ead1..4c071a3ed 100644 --- a/frontend/src/pages/settings/DshAuthPanel.tsx +++ b/frontend/src/pages/settings/DshAuthPanel.tsx @@ -662,9 +662,7 @@ export function DshAuthPanel({ type="button" variant="ghost" className="h-7" - disabled={ - saving || discovering || selectedModelIds.size === 0 - } + disabled={saving || discovering || selectedModelIds.size === 0} onMouseDown={(event) => event.preventDefault()} onClick={() => toggleAllAvailableModels(false)} > diff --git a/frontend/src/pages/settings/McpSettings.tsx b/frontend/src/pages/settings/McpSettings.tsx index bd7892678..93c0fe76b 100644 --- a/frontend/src/pages/settings/McpSettings.tsx +++ b/frontend/src/pages/settings/McpSettings.tsx @@ -46,11 +46,7 @@ import { AgentTypeIcon } from '@/components/agents/AgentTypeIcon'; import { ConnectorMarketplace } from '@/components/connectors/ConnectorMarketplace'; import { notifyLocalMcpServersChanged } from '@/components/layout/StatusBarMcp'; import type { JsonValue } from 'shared/types'; -import { - mcpMarketApi, - type LocalMcpServer, - type McpAppType, -} from '@/lib/api'; +import { mcpMarketApi, type LocalMcpServer, type McpAppType } from '@/lib/api'; import { useTemporaryFlag } from '@/hooks/useTemporaryFlag'; import { cn } from '@/lib/utils'; import { pluginControlApi, type PluginControlItem } from '@/lib/api/plugins'; @@ -60,10 +56,7 @@ import { Skeleton } from '@/components/ui/skeleton'; type LeftTab = 'local' | 'market'; -type Selection = - | { kind: 'local'; id: string } - | { kind: 'draft' } - | null; +type Selection = { kind: 'local'; id: string } | { kind: 'draft' } | null; type AppsDraft = Record; diff --git a/frontend/src/pages/settings/ResourceSettings.test.tsx b/frontend/src/pages/settings/ResourceSettings.test.tsx index a00069322..395757979 100644 --- a/frontend/src/pages/settings/ResourceSettings.test.tsx +++ b/frontend/src/pages/settings/ResourceSettings.test.tsx @@ -311,9 +311,7 @@ describe('McpSettings', () => { 'border', 'bg-card' ); - expect( - screen.getByRole('button', { name: 'MCP 服务器' }) - ).toBeVisible(); + expect(screen.getByRole('button', { name: 'MCP 服务器' })).toBeVisible(); expect(screen.getByRole('button', { name: '开发者工具' })).toBeVisible(); expect(screen.getByRole('button', { name: '分析' })).toBeVisible(); expect( @@ -326,9 +324,7 @@ describe('McpSettings', () => { expect(marketItem).toHaveClass('!my-0', '!h-auto', '!min-h-0'); // Verify Composio and Aiwyn Tax MCP are not hardcoded as 'included' (show Connect button instead) - expect( - screen.getByRole('button', { name: '连接 Composio' }) - ).toBeVisible(); + expect(screen.getByRole('button', { name: '连接 Composio' })).toBeVisible(); expect( screen.getByRole('button', { name: '连接 Aiwyn Tax MCP' }) ).toBeVisible(); @@ -639,7 +635,8 @@ describe('SkillsSettings', () => { ]); mocks.detailSkill.mockResolvedValue({ description: 'Fallback description', - content: '---\nname: find-skills\n---\n# Find Skills Guide\n\nDiscover and install skills easily.', + content: + '---\nname: find-skills\n---\n# Find Skills Guide\n\nDiscover and install skills easily.', }); mocks.installSkill.mockResolvedValue([ { @@ -660,9 +657,7 @@ describe('SkillsSettings', () => { renderSettings(); - expect( - screen.getByRole('heading', { name: 'Skill' }) - ).toBeVisible(); + expect(screen.getByRole('heading', { name: 'Skill' })).toBeVisible(); expect(screen.getByRole('radio', { name: 'Skill 市场' })).toBeChecked(); expect( @@ -694,7 +689,9 @@ describe('SkillsSettings', () => { expect(screen.getByRole('button', { name: '返回列表' })).toBeVisible(); expect(screen.queryByText('SKILL.md')).not.toBeInTheDocument(); - const sourceLink = screen.getByRole('link', { name: /vercel-labs\/skills/ }); + const sourceLink = screen.getByRole('link', { + name: /vercel-labs\/skills/, + }); const installsBadge = screen.getByText(/749\.5K INSTALLS/); expect(sourceLink.parentElement).toBe(installsBadge.parentElement); expect( @@ -717,7 +714,10 @@ describe('SkillsSettings', () => { 'name: find-skills', '---', '# Find Skills Guide', - ...Array.from({ length: 30 }, (_, idx) => `- Step ${idx + 1}: Detailed instruction line`), + ...Array.from( + { length: 30 }, + (_, idx) => `- Step ${idx + 1}: Detailed instruction line` + ), ].join('\n'); mocks.detailSkill.mockResolvedValueOnce({ description: 'Fallback description', @@ -727,7 +727,9 @@ describe('SkillsSettings', () => { await user.click(screen.getByRole('button', { name: '返回列表' })); await user.click(await screen.findByText('find-skills')); - const showMoreBtn = await screen.findByRole('button', { name: 'Show More' }); + const showMoreBtn = await screen.findByRole('button', { + name: 'Show More', + }); expect(showMoreBtn).toBeVisible(); await user.click(showMoreBtn); expect(screen.getByRole('button', { name: 'Show Less' })).toBeVisible(); @@ -744,5 +746,3 @@ describe('SkillsSettings', () => { }); }); }); - - diff --git a/frontend/src/pages/settings/SkillsSettings.tsx b/frontend/src/pages/settings/SkillsSettings.tsx index ba41fb675..56fe22361 100644 --- a/frontend/src/pages/settings/SkillsSettings.tsx +++ b/frontend/src/pages/settings/SkillsSettings.tsx @@ -14,7 +14,14 @@ * limit + Show More/Less; Right: inline installation & target config) */ -import { useCallback, useEffect, useId, useMemo, useRef, useState } from 'react'; +import { + useCallback, + useEffect, + useId, + useMemo, + useRef, + useState, +} from 'react'; import { type ManagedAgentOption, useManagedAgentOptions, @@ -129,7 +136,9 @@ function errorMessage(err: unknown): string { return err instanceof Error ? err.message : String(err); } -export function formatInstallCount(installs: number | null | undefined): string { +export function formatInstallCount( + installs: number | null | undefined +): string { if (typeof installs !== 'number' || !Number.isFinite(installs)) { return '—'; } @@ -160,7 +169,9 @@ function resolveSparklinePoints(item: SkillMarketItem): number[] { const stepHash = Math.abs(Math.imul(hash ^ (i * 2654435761), 1597334677)); const growth = 0.35 + (i / 7) * 0.65; const jitter = ((stepHash % 100) / 100) * 0.28 - 0.1; - points.push(Math.max(1, Math.round(base * Math.max(0.12, growth + jitter)))); + points.push( + Math.max(1, Math.round(base * Math.max(0.12, growth + jitter))) + ); } return points; } diff --git a/frontend/src/utils/dockviewEditorGroup.ts b/frontend/src/utils/dockviewEditorGroup.ts index d8218c046..4fbee1778 100644 --- a/frontend/src/utils/dockviewEditorGroup.ts +++ b/frontend/src/utils/dockviewEditorGroup.ts @@ -576,8 +576,7 @@ export function ensureWelcomeEditorGroup( bottomReferencePanel ?? leftGroup?.panels[0] ?? api.panels.find( - (panel) => - !BOTTOM_PANEL_IDS.has(panel.id) && !isSessionPanelId(panel.id) + (panel) => !BOTTOM_PANEL_IDS.has(panel.id) && !isSessionPanelId(panel.id) ); const leftWidth = diff --git a/frontend/src/utils/dockviewPointerTabDnd.ts b/frontend/src/utils/dockviewPointerTabDnd.ts index 1206630c0..cb1ba11c3 100644 --- a/frontend/src/utils/dockviewPointerTabDnd.ts +++ b/frontend/src/utils/dockviewPointerTabDnd.ts @@ -201,7 +201,10 @@ function resolveDropTargetAtPoint( } const renderOverlay = hit.closest('.dv-render-overlay'); - if (renderOverlay instanceof HTMLElement && rootElement.contains(renderOverlay)) { + if ( + renderOverlay instanceof HTMLElement && + rootElement.contains(renderOverlay) + ) { return { dropzone: renderOverlay, clientX, @@ -230,9 +233,9 @@ function resolveDropTargetAtPoint( * for non-file HTML5 drags) never hijacks internal tab drags, while keeping * Dockview's own `LocalSelectionTransfer` and `Droptarget` pipeline intact. */ -export function installDockviewPointerTabDnd( - rootElement: HTMLElement -): { dispose: () => void } { +export function installDockviewPointerTabDnd(rootElement: HTMLElement): { + dispose: () => void; +} { let pending: PendingTabPointer | null = null; let activeSourceTab: HTMLElement | null = null; let currentDropzone: HTMLElement | null = null; @@ -246,7 +249,9 @@ export function installDockviewPointerTabDnd( const target = currentDropzone; currentDropzone = null; lastResolved = null; - target.dispatchEvent(createSyntheticDragEvent('dragleave', clientX, clientY)); + target.dispatchEvent( + createSyntheticDragEvent('dragleave', clientX, clientY) + ); } }; @@ -296,7 +301,11 @@ export function installDockviewPointerTabDnd( window.removeEventListener('pointermove', handleWindowPointerMove, true); window.removeEventListener('pointerup', handleWindowPointerUp, true); - window.removeEventListener('pointercancel', handleWindowPointerCancel, true); + window.removeEventListener( + 'pointercancel', + handleWindowPointerCancel, + true + ); window.removeEventListener('keydown', handleWindowKeyDown, true); window.removeEventListener('blur', handleWindowBlur); @@ -314,7 +323,9 @@ export function installDockviewPointerTabDnd( const dropY = lastResolved.clientY; currentDropzone = null; lastResolved = null; - dropTarget.dispatchEvent(createSyntheticDragEvent('drop', dropX, dropY)); + dropTarget.dispatchEvent( + createSyntheticDragEvent('drop', dropX, dropY) + ); } } else { clearCurrentDropzone(clientX, clientY); @@ -323,7 +334,9 @@ export function installDockviewPointerTabDnd( clearCurrentDropzone(clientX, clientY); if (sourceTab) { - sourceTab.dispatchEvent(createSyntheticDragEvent('dragend', clientX, clientY)); + sourceTab.dispatchEvent( + createSyntheticDragEvent('dragend', clientX, clientY) + ); } }; @@ -394,7 +407,11 @@ export function installDockviewPointerTabDnd( pending = null; window.removeEventListener('pointermove', handleWindowPointerMove, true); window.removeEventListener('pointerup', handleWindowPointerUp, true); - window.removeEventListener('pointercancel', handleWindowPointerCancel, true); + window.removeEventListener( + 'pointercancel', + handleWindowPointerCancel, + true + ); }; const handleWindowPointerCancel = (event: PointerEvent) => { @@ -405,7 +422,11 @@ export function installDockviewPointerTabDnd( pending = null; window.removeEventListener('pointermove', handleWindowPointerMove, true); window.removeEventListener('pointerup', handleWindowPointerUp, true); - window.removeEventListener('pointercancel', handleWindowPointerCancel, true); + window.removeEventListener( + 'pointercancel', + handleWindowPointerCancel, + true + ); }; const handleWindowKeyDown = (event: KeyboardEvent) => { @@ -502,7 +523,11 @@ export function installDockviewPointerTabDnd( ); window.removeEventListener('keydown', handleWindowKeyDown, true); window.removeEventListener('blur', handleWindowBlur); - rootElement.removeEventListener('pointerdown', handleRootPointerDown, true); + rootElement.removeEventListener( + 'pointerdown', + handleRootPointerDown, + true + ); rootElement.removeEventListener('dragstart', handleRootDragStart, false); }, }; diff --git a/src-tauri/src/browser_native.rs b/src-tauri/src/browser_native.rs index 46c2be25a..226051f7b 100644 --- a/src-tauri/src/browser_native.rs +++ b/src-tauri/src/browser_native.rs @@ -442,6 +442,7 @@ fn apply_user_agent(webview: &WebView, device: &str, sign_in_ua: bool) { } } +#[cfg(not(target_os = "macos"))] fn ephemeral_profile_dir() -> PathBuf { utils::path::get_vibex_temp_dir().join("browser-ephemeral") } @@ -555,7 +556,7 @@ fn prefer_detached_inspector() { let registration: *mut AnyObject = msg_send![ class!(NSDictionary), dictionaryWithObject: no, - forKey: &*key + forKey: key ]; let defaults: *mut AnyObject = msg_send![class!(NSUserDefaults), standardUserDefaults]; let _: () = msg_send![defaults, registerDefaults: registration]; diff --git a/src-tauri/src/events.rs b/src-tauri/src/events.rs index a5655efc2..07f6c8d1b 100644 --- a/src-tauri/src/events.rs +++ b/src-tauri/src/events.rs @@ -622,11 +622,7 @@ async fn handle_recorded_conversation_batch( } fn is_local_user_turn_origin(origin: &str) -> bool { - matches!( - origin, - conversations::commit_reminder::LOCAL_USER_ORIGIN - | conversations::commit_reminder::USER_ORIGIN - ) + origin == conversations::commit_reminder::LOCAL_USER_ORIGIN } fn attention_from_event(