diff --git a/crates/ide-core/src/settings.rs b/crates/ide-core/src/settings.rs index f6bc1b6f52..89921b7cc5 100644 --- a/crates/ide-core/src/settings.rs +++ b/crates/ide-core/src/settings.rs @@ -61,7 +61,7 @@ pub struct Settings { pub cmake: CMakeSettings, /// Settings › Agents. pub agents: AgentSettings, - /// Tools › MCP Server (global only). + /// Agents › MCP Server (global only). pub mcp_server: McpServerSettings, /// Plugin settings (`[contributes.settings]`): plugin id → its values by key. #[specta(type = BTreeMap>)] @@ -154,7 +154,7 @@ pub enum WhileRunning { Steer, } -/// Tools › MCP Server: agents use the IDE's built-in tools. +/// Agents › MCP Server: agents use the IDE's built-in tools. #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, Type)] #[serde(default, rename_all = "camelCase")] pub struct McpServerSettings { diff --git a/crates/ide-mcp/src/stdio.rs b/crates/ide-mcp/src/stdio.rs index ba1141afda..01f8a99309 100644 --- a/crates/ide-mcp/src/stdio.rs +++ b/crates/ide-mcp/src/stdio.rs @@ -105,7 +105,7 @@ fn requests(message: &Value) -> Vec { async fn post(discovery: &Path, project: &Path, message: &Value, scope: &str) -> Result<(StatusCode, Bytes), String> { let not_running = || { format!( - "OpenIDEA's MCP server is not running. Start OpenIDEA, open {} in it, and turn on Settings › Tools › MCP Server", + "OpenIDEA's MCP server is not running. Start OpenIDEA, open {} in it, and turn on Settings › Agents › MCP Server", project.display() ) }; diff --git a/e2e/settingsPaneLayout.spec.ts b/e2e/settingsPaneLayout.spec.ts index 964ae99f1e..2b93ede840 100644 --- a/e2e/settingsPaneLayout.spec.ts +++ b/e2e/settingsPaneLayout.spec.ts @@ -5,14 +5,14 @@ for (const [id, selector] of [ ["editor.inspections", "[class*='split'] > [class*='details']"], ["languages.servers", "[class*='body'] > [class*='details']"], ["plugins", "[class*='body'] > [class*='details']"], - ["tools.agents", "section[aria-label='Codex executable']"], + ["agents", "section[aria-label='Codex']"], ]) { test(`${id} keeps its details usable beside the list`, async ({ workbench: page }) => { await page.keyboard.press("Meta+,"); const dialog = page.getByRole("dialog", { name: "Settings", exact: true }); await expect(dialog).toBeVisible(); await page.evaluate(async (id) => { - if (id === "tools.agents") { + if (id === "agents") { const path = "/src/features/agents/registry.ts"; const { tauriCommands } = await import(/* @vite-ignore */ path); tauriCommands.providers = async () => [ diff --git a/src-tauri/src/commands/mcp.rs b/src-tauri/src/commands/mcp.rs index 5f30d329cd..c10ed45dc0 100644 --- a/src-tauri/src/commands/mcp.rs +++ b/src-tauri/src/commands/mcp.rs @@ -1,4 +1,4 @@ -//! Tools › MCP Server: runs `ide_mcp::McpServer` over built-in host tools +//! Agents › MCP Server: runs `ide_mcp::McpServer` over built-in host tools //! while `mcpServer.enabled` is on, and reports where it listens. use crate::state::AppState; @@ -63,7 +63,7 @@ pub fn stop(state: &AppState) { } } -/// What Settings › Tools › MCP Server shows. +/// What Settings › Agents › MCP Server shows. #[derive(Serialize, Type)] #[serde(rename_all = "camelCase")] pub struct McpServerStatus { diff --git a/src-tauri/src/state.rs b/src-tauri/src/state.rs index a9de324d5f..225ea3a461 100644 --- a/src-tauri/src/state.rs +++ b/src-tauri/src/state.rs @@ -21,7 +21,7 @@ pub struct AppState { pub plugins: Arc, /// The built-in web server (Open In › Browser, the editor's browser bar). pub web: ide_web::WebServer, - /// Tools › MCP Server: built-in IDE tools for agents. + /// Agents › MCP Server: built-in IDE tools for agents. pub mcp: crate::commands::mcp::McpService, /// Credential prompts of `ssh` / `git` child processes (`None` if it failed to start). pub askpass: Option, diff --git a/src/bindings.ts b/src/bindings.ts index aef5e596bc..ba97b1c842 100644 --- a/src/bindings.ts +++ b/src/bindings.ts @@ -6015,13 +6015,13 @@ export type MavenSettings = { activeProfiles?: string, }; -/** Tools › MCP Server: agents use the IDE's built-in tools. */ +/** Agents › MCP Server: agents use the IDE's built-in tools. */ export type McpServerSettings = { /** Serve the tools on 127.0.0.1 while the IDE runs. */ enabled?: boolean, }; -/** What Settings › Tools › MCP Server shows. */ +/** What Settings › Agents › MCP Server shows. */ export type McpServerStatus = { running: boolean, /** Why it isn't running though turned on. */ @@ -8061,7 +8061,7 @@ export type Settings_Deserialize = { cmake?: CMakeSettings_Deserialize, /** Settings › Agents. */ agents?: AgentSettings, - /** Tools › MCP Server (global only). */ + /** Agents › MCP Server (global only). */ mcpServer?: McpServerSettings, /** Plugin settings (`[contributes.settings]`): plugin id → its values by key. */ plugins?: { [key in string]: { [key in string]: unknown } }, @@ -8123,7 +8123,7 @@ export type Settings_Serialize = { cmake: CMakeSettings_Serialize, /** Settings › Agents. */ agents: AgentSettings, - /** Tools › MCP Server (global only). */ + /** Agents › MCP Server (global only). */ mcpServer: McpServerSettings, /** Plugin settings (`[contributes.settings]`): plugin id → its values by key. */ plugins: { [key in string]: { [key in string]: unknown } }, diff --git a/src/features/agents/BuiltinAgents.module.css b/src/features/agents/AgentList.module.css similarity index 74% rename from src/features/agents/BuiltinAgents.module.css rename to src/features/agents/AgentList.module.css index 6a8001bb46..0f500fdea4 100644 --- a/src/features/agents/BuiltinAgents.module.css +++ b/src/features/agents/AgentList.module.css @@ -8,10 +8,25 @@ overflow: hidden; } .master { - flex: 0 0 300px; - padding: 6px; + display: flex; + flex: 0 0 260px; + flex-direction: column; + min-height: 0; border-right: 1px solid var(--border); } +/* IntelliJ's list toolbar: add / remove above the list. */ +.toolbar { + display: flex; + align-items: center; + gap: 2px; + padding: 2px 4px; + border-bottom: 1px solid var(--border); +} +.list { + flex: 1; + min-height: 0; + padding: 6px; +} .agentRow { display: flex; align-items: center; @@ -121,3 +136,24 @@ color: var(--danger); white-space: pre-wrap; } + +.update { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-2); + margin: 0 0 12px 28px; + color: var(--fg-secondary); +} +.defaults { + display: grid; + grid-template-columns: max-content minmax(180px, 280px); + align-items: center; + gap: 6px 12px; +} +.defaults > .hint { + grid-column: 1 / -1; +} +.defaultLabel { + color: var(--fg); +} diff --git a/src/features/agents/AgentList.tsx b/src/features/agents/AgentList.tsx new file mode 100644 index 0000000000..7896052ada --- /dev/null +++ b/src/features/agents/AgentList.tsx @@ -0,0 +1,458 @@ +/** + * Settings › Agents: every agent this machine can run (built in, installed from the ACP + * Registry, or defined in an agent file) beside the selected one's status, the settings + * its new tasks start with, and how it is launched. Launch edits are staged until Apply. + */ +import { useCallback, useEffect, useState } from "react"; +import type { AgentConfigOption, AgentProvider, RequestId } from "@/bindings"; +import { isCancelled, nextRequestId } from "@/platform/ipc"; +import { tx, useTxTemplate } from "@/platform/i18n"; +import clsx from "clsx"; +import { Button, Dialog, Icon, IconButton, Input, List, ProgressBar, Select, Spinner, T } from "@/ui"; +import { useSettingsForm } from "@/workbench/contributions"; +import { confirm } from "@/workbench/messages"; +import { providerIcon } from "./model"; +import type { CommandsBackend, RegistryBackend } from "./registry"; +import { RegistryList } from "./RegistryList"; +import styles from "./AgentList.module.css"; + +const errorText = (e: unknown) => (e instanceof Error ? e.message : String(e)); + +/** What the agent needs, if anything, as a trailing tag in the list. */ +export function agentStatus(agent: AgentProvider): { label: string; tone: "muted" | "accent" | "warning" } | null { + if (agent.source.kind === "registry" && agent.source.update) return { label: "Update", tone: "accent" }; + if (agent.commandOverridden || agent.source.kind === "custom") return { label: "Custom", tone: "accent" }; + if (!agent.installed) return { label: "Not found", tone: "muted" }; + return null; +} + +function Status({ agent }: { agent: AgentProvider }) { + const status = agentStatus(agent); + if (!status) return null; + return ( + + {status.label} + + ); +} + +export function AgentList({ + backend, + registry, + onChanged, +}: { + backend: CommandsBackend; + registry: RegistryBackend; + onChanged?: () => void; +}) { + const [agents, setAgents] = useState(null); + const [error, setError] = useState(null); + const [selected, setSelected] = useState(null); + const [adding, setAdding] = useState(false); + const [removing, setRemoving] = useState(false); + useEffect(() => { + let live = true; + backend.providers().then( + (list) => live && setAgents(list), + (e: unknown) => live && setError(errorText(e)), + ); + return () => { + live = false; + }; + }, [backend]); + const refresh = useCallback(async () => { + setAgents(await backend.providers()); + }, [backend]); + const changed = useCallback(() => { + void refresh().catch((e: unknown) => setError(errorText(e))); + onChanged?.(); + }, [refresh, onChanged]); + if (error) + return ( +

+ {error} +

+ ); + if (!agents) return ; + const index = Math.max( + 0, + agents.findIndex((a) => a.id === selected), + ); + const agent = agents[index]; + const remove = async () => { + if (!agent || agent.source.kind !== "registry") return; + if ( + !(await confirm({ + title: tx`Remove ${agent.name}`, + message: tx`Remove ${agent.name} from this computer? Its tasks stay, but can't continue until it is installed again.`, + ok: tx("Remove"), + })) + ) + return; + setRemoving(true); + try { + await registry.remove(agent.id); + setSelected(null); + changed(); + } catch (e) { + setError(errorText(e)); + } finally { + setRemoving(false); + } + }; + return ( +
+
+
+ setAdding(true)} /> + void remove()} + /> +
+ p.id} + activeIndex={index} + onActiveChange={(i) => setSelected(agents[i]?.id ?? null)} + rowHeight={32} + aria-label={tx("Agents")} + renderItem={(p) => ( +
+ + {p.name} +
+ )} + /> +
+ {agent && ( +
+ )} + setAdding(false)} + title="Add Agent" + width={640} + resizable="both" + buttons={[{ label: "Done", role: "cancel" }]} + > + + +
+ ); +} + +function Details({ + agent, + backend, + registry, + refresh, + onChanged, +}: { + agent: AgentProvider; + backend: CommandsBackend; + registry: RegistryBackend; + refresh: () => Promise; + onChanged?: () => void; +}) { + const form = useSettingsForm(); + const base = agent.commandOverridden ? agent.program : ""; + const { value, current, set, saving } = form.useExternal(`agents.${agent.id}.command`, base, async (draft) => { + const command = draft.trim() || null; + await backend.set(agent.id, command); + await refresh(); + onChanged?.(); + return command === agent.defaultProgram ? "" : (command ?? ""); + }); + const envBase = formatEnv(agent.env); + const env = form.useExternal(`agents.${agent.id}.env`, envBase, async (draft) => { + const parsed = parseEnv(draft); + await backend.setEnv(agent.id, parsed); + await refresh(); + onChanged?.(); + return formatEnv(parsed); + }); + const [error, setError] = useState(null); + // An edit can have been staged by a previous page instance. Its Apply callback + // refreshes that instance; the mounted one follows the newly applied value too. + useEffect(() => { + if (!saving && current !== base) { + void refresh().catch((e: unknown) => setError(e instanceof Error ? e.message : String(e))); + } + }, [base, current, saving, refresh]); + const launch = [agent.defaultProgram, ...agent.defaultArgs].join(" "); + const status = + agent.source.kind === "registry" + ? tx`ACP Registry · ${agent.source.version}` + : agent.source.kind === "custom" + ? tx("Agent file") + : agent.commandOverridden + ? tx("Custom executable") + : agent.installed + ? tx("Found on PATH") + : tx("Not found on PATH"); + return ( +
+
+ +

{agent.name}

+
+
+ + {status} + · + + {launch} + +
+ {agent.source.kind === "registry" && agent.source.update && ( + + )} + {agent.loginHint && ( + <> +

+ Sign in +

+

+ +

+ + )} +

+ New tasks start with +

+ +

+ Launch +

+ {agent.commandEditable ? ( + <> + +
+ set(e.target.value)} + /> + { + try { + const path = await backend.chooseExecutable(tx`Select ${agent.name}`, value); + if (path) set(path); + setError(null); + } catch (e) { + setError(e instanceof Error ? e.message : String(e)); + } + }} + /> + {value && set("")} />} +
+

+ Leave empty to find the executable on PATH. Changes apply to new sessions. +

+ + ) : ( +

+ {agent.commandReadOnlyReason === "packageRunner" ? ( + This agent runs through a package runner (npm or uv) and has no executable to choose. + ) : agent.commandReadOnlyReason === "registry" ? ( + This agent is installed from the ACP Registry, which launches it. + ) : ( + This agent is configured in its agent file. + )} +

+ )} + {agent.commandReadOnlyReason !== "registry" && agent.commandReadOnlyReason !== "customAgent" && ( + <> + +
+ env.set(e.target.value)} + /> +
+

+ Passed to the agent process, replacing variables of the same name. Changes apply to new sessions. +

+ + )} + {error && ( +

+ {error} +

+ )} +
+ ); +} + +/** `NAME=value` pairs separated by `;` or new lines. */ +function parseEnv(text: string): Record { + const env: Record = {}; + for (const raw of text.split(/[;\n]/)) { + const pair = raw.trim(); + if (!pair) continue; + const eq = pair.indexOf("="); + const key = eq < 0 ? "" : pair.slice(0, eq).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)) throw new Error(tx`Expected NAME=value: ${pair}`); + env[key] = pair.slice(eq + 1).trim(); + } + return env; +} + +const formatEnv = (env: Record) => + Object.entries(env) + .map(([k, v]) => `${k}=${v}`) + .join("; "); + +/** Login hints are plain text with optional backtick-delimited command spans. */ +function LoginHint({ text }: { text: string }) { + const translate = useTxTemplate(); + return translate(text) + .split(/(`[^`]+`)/g) + .map((part, i) => (i % 2 === 1 ? {part.slice(1, -1)} : part)); +} + +/** Updates an agent installed from the ACP Registry, with its progress. */ +function RegistryUpdate({ + agent, + version, + registry, + refresh, +}: { + agent: AgentProvider; + version: string; + registry: RegistryBackend; + refresh: () => Promise; +}) { + const [job, setJob] = useState<{ request: RequestId; fraction: number | null; message: string } | null>(null); + const [error, setError] = useState(null); + const update = () => { + const request = nextRequestId(); + setError(null); + setJob({ request, fraction: null, message: tx`Installing ${agent.name} ${version}…` }); + registry + .install(agent.id, request, (e) => + setJob((j) => + j && j.request === request + ? e.type === "progress" + ? { ...j, fraction: e.fraction, message: e.message } + : { ...j, message: e.text } + : j, + ), + ) + .then(refresh) + .catch((e: unknown) => !isCancelled(e) && setError(errorText(e))) + .finally(() => setJob(null)); + }; + return ( +
+ {job ? ( + <> + + {job.message} + + + ) : ( + <> + {tx`${version} is available`} + + + )} + {error && ( +

+ {error} +

+ )} +
+ ); +} + +/** The options a new task of `agent` starts with: each the agent's own default unless chosen. */ +export function defaultOptions(agent: AgentProvider, chosen: Record): AgentConfigOption[] { + const base = agent.config.filter((o) => o.category !== "thought_level" && o.values.length > 1); + const modelOption = base.find((o) => o.category === "model"); + const model = (modelOption && chosen[modelOption.id]) || modelOption?.current; + const levels = (model && agent.thoughtLevels?.[model]) || []; + return [...base, ...levels.filter((o) => o.values.length > 1)]; +} + +function AgentDefaults({ agent }: { agent: AgentProvider }) { + const form = useSettingsForm(); + const all = (form.useValue("agents.defaults") ?? {}) as Record>; + const chosen = all[agent.id] ?? {}; + const options = defaultOptions(agent, chosen); + if (!options.length) + return ( +

+ The agent's models and modes can be chosen here after its first session. +

+ ); + const choose = (id: string, value: string) => { + const { [id]: _, ...rest } = chosen; + const next = value ? { ...rest, [id]: value } : rest; + const { [agent.id]: __, ...others } = all; + form.set("agents.defaults", Object.keys(next).length ? { ...others, [agent.id]: next } : others); + }; + return ( +
+ {options.map((o) => { + const fallback = o.values.find((v) => v.value === o.current)?.name; + return ( +
+ + set(e.target.value)} - /> - { - try { - const path = await backend.chooseExecutable(tx`Select ${agent.name}`, value); - if (path) set(path); - setError(null); - } catch (e) { - setError(e instanceof Error ? e.message : String(e)); - } - }} - /> - {value && set("")} />} -
-

- Leave empty to find the executable on PATH. Changes apply to new sessions. -

- - ) : ( -

- {agent.commandReadOnlyReason === "packageRunner" ? ( - This agent runs through a package runner (npm or uv) and has no executable to choose. - ) : agent.commandReadOnlyReason === "registry" ? ( - This agent is installed from the ACP Registry. Manage its installation in the ACP Registry tab. - ) : ( - This agent is configured in its agent file. - )} -

- )} - {agent.commandReadOnlyReason !== "registry" && agent.commandReadOnlyReason !== "customAgent" && ( - <> - -
- env.set(e.target.value)} - /> -
-

- Passed to the agent process, replacing variables of the same name. Changes apply to new sessions. -

- - )} - {agent.loginHint && ( - <> -

- Sign in -

-

- -

- - )} - {error && ( -

- {error} -

- )} - - ); -} - -/** `NAME=value` pairs separated by `;` or new lines. */ -function parseEnv(text: string): Record { - const env: Record = {}; - for (const raw of text.split(/[;\n]/)) { - const pair = raw.trim(); - if (!pair) continue; - const eq = pair.indexOf("="); - const key = eq < 0 ? "" : pair.slice(0, eq).trim(); - if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)) throw new Error(tx`Expected NAME=value: ${pair}`); - env[key] = pair.slice(eq + 1).trim(); - } - return env; -} - -const formatEnv = (env: Record) => - Object.entries(env) - .map(([k, v]) => `${k}=${v}`) - .join("; "); - -/** Login hints are plain text with optional backtick-delimited command spans. */ -function LoginHint({ text }: { text: string }) { - const translate = useTxTemplate(); - return translate(text) - .split(/(`[^`]+`)/g) - .map((part, i) => (i % 2 === 1 ? {part.slice(1, -1)} : part)); -} diff --git a/src/features/agents/HomeEditor.tsx b/src/features/agents/HomeEditor.tsx index bbc206d17d..80f6a2a11e 100644 --- a/src/features/agents/HomeEditor.tsx +++ b/src/features/agents/HomeEditor.tsx @@ -26,6 +26,7 @@ import { useAgentCommands, useAgents, } from "./store"; +import { useAgentSettings } from "./agentSettings"; import styles from "./Home.module.css"; export function HomeEditor({ docked = false }: { docked?: boolean; input?: EditorInput }) { @@ -95,7 +96,8 @@ export function HomeEditor({ docked = false }: { docked?: boolean; input?: Edito .catch((e: unknown) => setError(e instanceof Error ? e.message : String(e))) .finally(() => setStarting(false)); }; - const config = draftConfig(provider, draft); + const defaults = useAgentSettings().defaults; + const config = draftConfig(provider, draft, (provider && defaults[provider.id]) || {}); return (
diff --git a/src/features/agents/RegistryList.tsx b/src/features/agents/RegistryList.tsx new file mode 100644 index 0000000000..e22a78fb0a --- /dev/null +++ b/src/features/agents/RegistryList.tsx @@ -0,0 +1,305 @@ +/** + * Agents of the ACP Registry this machine can run, with Install / Update / Remove (in + * Settings › Agents › Add Agent). + * Installs run in the background with progress, and keep running after the page closes + * (as a background task of the project windows); the page then shows them as installing. + */ +import { useEffect, useMemo, useState } from "react"; +import type { AgentRegistry, RegistryAgent, RequestId } from "@/bindings"; +import { isCancelled, nextRequestId } from "@/platform/ipc"; +import { tx } from "@/platform/i18n"; +import { openExternalUrl } from "@/platform/openUrl"; +import { Badge, Button, Icon, ProgressBar, SearchField, Spinner, T } from "@/ui"; +import { confirm } from "@/workbench/messages"; +import { providerIcon } from "./model"; +import { + DISTRIBUTION_LABEL, + afterInstall, + afterRemove, + matchesQuery, + rowActions, + sortAgents, + type RegistryBackend, +} from "./registry"; +import styles from "./AgentRegistry.module.css"; + +const errorText = (e: unknown) => (e instanceof Error ? e.message : String(e)); + +/** How often the page checks on installs it did not start. */ +const BACKGROUND_POLL_MS = 1500; + +interface Job { + id: string; + fraction: number | null; + message: string; +} + +interface PageJob extends Job { + request: RequestId; +} + +/** An install started before the page opened; its progress shows in the background tasks. */ +const backgroundJob = (agent: RegistryAgent): Job => ({ + id: agent.id, + fraction: null, + message: tx`Installing ${agent.name} in the background…`, +}); + +export function RegistryList({ backend, onChanged }: { backend: RegistryBackend; onChanged?: () => void }) { + const [registry, setRegistry] = useState(null); + const [loadError, setLoadError] = useState(null); + const [query, setQuery] = useState(""); + const [job, setJob] = useState(null); + const [removing, setRemoving] = useState(null); + const [errors, setErrors] = useState>({}); + + useEffect(() => { + const request = nextRequestId(); + let live = true; + backend + .list(request) + .then((r) => live && setRegistry(r)) + .catch((e: unknown) => live && !isCancelled(e) && setLoadError(errorText(e))); + return () => { + live = false; + backend.cancel(request); + }; + }, [backend]); + + // Installs started before the page opened: follow them until they end. + const background = registry?.agents.some((a) => a.installing) ?? false; + useEffect(() => { + if (!background) return; + let live = true; + let request: RequestId | null = null; + const timer = setInterval(() => { + if (request != null) return; + const r = (request = nextRequestId()); + backend + .list(r) + .then((next) => { + if (!live) return; + setRegistry(next); + if (!next.agents.some((a) => a.installing)) onChanged?.(); + }) + .catch(() => {}) + .finally(() => { + if (request === r) request = null; + }); + }, BACKGROUND_POLL_MS); + return () => { + live = false; + clearInterval(timer); + if (request != null) backend.cancel(request); + }; + }, [backend, background, onChanged]); + + const agents = useMemo( + () => sortAgents((registry?.agents ?? []).filter((a) => matchesQuery(a, query))), + [registry, query], + ); + const busy = job != null || removing != null || background; + + const setError = (id: string, error: string | null) => + setErrors((all) => { + const { [id]: _, ...rest } = all; + return error ? { ...rest, [id]: error } : rest; + }); + + const install = async (agent: RegistryAgent) => { + if ( + agent.noChecksum && + !(await confirm({ + title: tx`Install ${agent.name}`, + message: tx`${agent.name} provides no checksum for its download, so the downloaded file cannot be verified. Install it anyway?`, + ok: tx("Install"), + icon: "warning", + })) + ) + return; + const request = nextRequestId(); + setError(agent.id, null); + setJob({ id: agent.id, request, fraction: null, message: tx`Installing ${agent.name} ${agent.version}…` }); + backend + .install(agent.id, request, (e) => + setJob((j) => + j && j.request === request + ? e.type === "progress" + ? { ...j, fraction: e.fraction, message: e.message } + : { ...j, message: e.text } + : j, + ), + ) + .then(() => { + setRegistry((r) => r && { ...r, agents: afterInstall(r.agents, agent.id) }); + onChanged?.(); + }) + .catch((e: unknown) => !isCancelled(e) && setError(agent.id, errorText(e))) + .finally(() => setJob(null)); + }; + + const remove = (agent: RegistryAgent) => { + setError(agent.id, null); + setRemoving(agent.id); + backend + .remove(agent.id) + .then(() => { + setRegistry((r) => r && { ...r, agents: afterRemove(r.agents, agent.id) }); + onChanged?.(); + }) + .catch((e: unknown) => setError(agent.id, errorText(e))) + .finally(() => setRemoving(null)); + }; + + return ( +
+ +

+ + Agents in the ACP Registry are third-party software. They run on this computer with your permissions and can + read and change your files. Install only agents you trust. + +

+ {registry?.warning && ( +

+ {registry.warning} +

+ )} +
+ {loadError ? ( +

+ {tx`Cannot load the ACP Registry: ${loadError}`} +

+ ) : !registry ? ( +
+ + Loading the ACP Registry… +
+ ) : agents.length === 0 ? ( +

+ {query ? No agents match : The registry has no agents for this system} +

+ ) : ( +
    + {agents.map((agent) => ( + void install(agent)} + onRemove={() => remove(agent)} + onCancel={job?.id === agent.id ? () => backend.cancel(job.request) : undefined} + /> + ))} +
+ )} +
+
+ ); +} + +function AgentRow({ + agent, + job, + removing, + disabled, + error, + onInstall, + onRemove, + onCancel, +}: { + agent: RegistryAgent; + job: Job | null; + removing: boolean; + disabled: boolean; + error: string | null; + onInstall: () => void; + onRemove: () => void; + /** Absent for an install this page did not start (stop it from the background tasks). */ + onCancel?: () => void; +}) { + const actions = rowActions(agent); + const titleId = `agent-${agent.id}`; + return ( +
  • +
    +
    + + + {agent.name} + + {agent.installed ?? agent.version} + {agent.distribution && {DISTRIBUTION_LABEL[agent.distribution]}} + {agent.noChecksum && {tx("No checksum provided")}} + {actions.update && {tx`${agent.version} available`}} + {agent.installed != null && !actions.update && {tx("Installed")}} +
    + {agent.description &&

    {agent.description}

    } +
    + {agent.authors.length > 0 && {agent.authors.join(", ")}} + {agent.license && {agent.license}} + {agent.repository && } + {agent.website && agent.website !== agent.repository && } +
    + {job && ( +
    + + {job.message} +
    + )} + {error && ( +

    + {error} +

    + )} +
    +
    + {job ? ( + onCancel && ( + + ) + ) : ( + <> + {actions.install && ( + + )} + {actions.update && ( + + )} + {actions.remove && ( + + )} + + )} +
    +
  • + ); +} + +function ExternalLink({ url, label }: { url: string; label: string }) { + // Links come from the registry: web pages only. + if (!/^https?:\/\//i.test(url)) return null; + return ( + + ); +} diff --git a/src/features/agents/SessionEditor.tsx b/src/features/agents/SessionEditor.tsx index b27c5983b0..0f49925c0e 100644 --- a/src/features/agents/SessionEditor.tsx +++ b/src/features/agents/SessionEditor.tsx @@ -366,7 +366,7 @@ function SessionStatus({ /** * Context use, usage limits and cost (when the agent reports them) and the time spent on - * the task, each as Settings › Tools › Agents › Chat allows. + * the task, each as Settings › Agents › Chat allows. */ function Meters({ task, entries }: { task: AgentTask; entries: AgentEntry[] | null }) { const tx = useTx(); diff --git a/src/features/agents/agentRegistry.test.tsx b/src/features/agents/agentRegistry.test.tsx index 734cc62175..8755ed2012 100644 --- a/src/features/agents/agentRegistry.test.tsx +++ b/src/features/agents/agentRegistry.test.tsx @@ -11,6 +11,7 @@ import { useSettingsFormFor } from "@/features/settings/components/context"; import { closeSettings, openSettings, selectPage } from "@/features/settings/model/staging"; import { SettingsDialog } from "@/features/settings/dialog/SettingsDialog"; import { REGISTRY_PAGE } from "./model"; +import { RegistryList } from "./RegistryList"; import type { ComponentProps } from "react"; function AgentRegistryPage(props: ComponentProps) { @@ -176,16 +177,12 @@ describe("agent picker", () => { }); }); -describe("Agents settings page", () => { - const renderRegistry = (...args: Parameters) => { - const result = render(...args); - fireEvent.click(screen.getByRole("tab", { name: "ACP Registry" })); - return result; - }; +describe("Add Agent: the ACP Registry", () => { + const renderRegistry = render; it("shows the built-in Copilot name and icon in its registry row", async () => { const backend = new FakeBackend(); backend.registry = { agents: [agent({ id: "copilot", name: "GitHub Copilot" })], warning: null }; - renderRegistry(); + renderRegistry(); const copilot = await screen.findByRole("listitem", { name: "GitHub Copilot" }); const expected = document.createElement("div"); expected.innerHTML = iconMarkup("agent-copilot")!; @@ -195,7 +192,7 @@ describe("Agents settings page", () => { it("lists registry agents, says they are third-party, and searches them", async () => { const backend = new FakeBackend(); - renderRegistry(); + renderRegistry(); await waitFor(() => expect(row("Amp")).toBeInTheDocument()); expect(screen.getByText(/third-party software/)).toBeInTheDocument(); expect(within(row("Amp")).getByRole("button", { name: "Install" })).toBeEnabled(); @@ -214,7 +211,7 @@ describe("Agents settings page", () => { it("installs with progress, then reports the change", async () => { const backend = new FakeBackend(); const onChanged = vi.fn(); - renderRegistry(); + renderRegistry(); await waitFor(() => expect(row("Amp")).toBeInTheDocument()); fireEvent.click(within(row("Amp")).getByRole("button", { name: "Install" })); expect(backend.installs).toEqual(["amp-acp"]); @@ -235,7 +232,7 @@ describe("Agents settings page", () => { backend.registry = { agents: [{ ...AMP, noChecksum: true }], warning: null }; renderRegistry( <> - + , ); @@ -259,7 +256,7 @@ describe("Agents settings page", () => { const backend = new FakeBackend(); renderRegistry( <> - + , ); @@ -272,7 +269,7 @@ describe("Agents settings page", () => { it("shows why an install failed, cancels one on Cancel, and leaves it running when the page closes", async () => { const backend = new FakeBackend(); - const { unmount } = renderRegistry(); + const { unmount } = renderRegistry(); await waitFor(() => expect(row("Cline")).toBeInTheDocument()); fireEvent.click(within(row("Cline")).getByRole("button", { name: "Update" })); await act(async () => backend.fail(new IpcError({ kind: "unavailable", message: "npm is required" }))); @@ -296,7 +293,7 @@ describe("Agents settings page", () => { const backend = new FakeBackend(); const onChanged = vi.fn(); backend.registry = { agents: [{ ...AMP, installing: true }, CLINE], warning: null }; - renderRegistry(); + renderRegistry(); await waitFor(() => expect(row("Amp")).toBeInTheDocument()); expect(within(row("Amp")).getByText("Installing Amp in the background…")).toBeInTheDocument(); // It is stopped from the background tasks, and nothing else starts meanwhile. @@ -314,7 +311,7 @@ describe("Agents settings page", () => { it("removes an installed agent", async () => { const backend = new FakeBackend(); const onChanged = vi.fn(); - renderRegistry(); + renderRegistry(); await waitFor(() => expect(row("fast-agent")).toBeInTheDocument()); fireEvent.click(within(row("fast-agent")).getByRole("button", { name: "Remove" })); await waitFor(() => expect(within(row("fast-agent")).getByRole("button", { name: "Install" })).toBeEnabled()); @@ -325,12 +322,12 @@ describe("Agents settings page", () => { it("falls back to the saved list with a warning, and reports a registry it cannot load", async () => { const backend = new FakeBackend(); backend.registry = { agents: AGENTS, warning: "Could not reach the ACP Registry" }; - const { unmount } = renderRegistry(); + const { unmount } = renderRegistry(); await waitFor(() => expect(screen.getByRole("status")).toHaveTextContent("Could not reach the ACP Registry")); unmount(); backend.list.mockRejectedValueOnce(new IpcError({ kind: "io", message: "offline" })); - renderRegistry(); + renderRegistry(); await waitFor(() => expect(screen.getByRole("alert")).toHaveTextContent("Cannot load the ACP Registry: offline")); }); }); @@ -397,12 +394,12 @@ describe("Built-in executable overrides", () => { component: () => , }); render(); - return screen.findByRole("region", { name: "Claude Code executable" }); + return screen.findByRole("region", { name: "Claude Code" }); }; const apply = () => screen.getByRole("button", { name: "Apply" }); const field = () => screen.getByRole("textbox", { name: "Executable" }); - it("follows locale changes in tabs and renders login commands as inline code", async () => { + it("follows locale changes and renders login commands as inline code", async () => { const commands = new FakeCommands(); commands.list = [ claudeProvider("claude"), @@ -424,14 +421,12 @@ describe("Built-in executable overrides", () => { await setLocale("zh"); }); expect(screen.getByRole("option", { name: "Codex 未找到" })).toBeInTheDocument(); - expect(screen.getByRole("tab", { name: "内置" })).toBeInTheDocument(); - expect(screen.getByRole("tab", { name: "ACP 注册表" })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "添加 Agent…" })).toBeInTheDocument(); await act(async () => { await setLocale("en"); }); expect(screen.getByRole("option", { name: "Codex Not found" })).toBeInTheDocument(); - expect(screen.getByRole("tab", { name: "Built-in" })).toBeInTheDocument(); - expect(screen.getByRole("tab", { name: "ACP Registry" })).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Add Agent…" })).toBeInTheDocument(); } finally { await act(async () => { await setLocale("en"); @@ -653,3 +648,93 @@ describe("Built-in executable overrides", () => { expect(commands.saved).toEqual([["claude", "/chosen/agent"]]); }); }); + +describe("the agent list", () => { + let dispose = () => {}; + beforeEach(() => openSettings(REGISTRY_PAGE)); + afterEach(() => { + closeSettings(); + dispose(); + }); + const open = async (commands: FakeCommands, backend = new FakeBackend()) => { + dispose = registerSettingsPage({ + id: REGISTRY_PAGE, + title: "Agents", + component: () => , + }); + render( + <> + + + , + ); + await screen.findByRole("region", { name: "Claude Code" }); + return backend; + }; + const model = { + id: "model", + name: "Model", + description: null, + category: "model", + current: "sonnet", + values: [ + { value: "sonnet", name: "Sonnet", description: null }, + { value: "opus", name: "Opus", description: null }, + ], + via: "option", + } as AgentProvider["config"][number]; + + it("lists registry agents beside the built-ins, updates one and removes it", async () => { + const commands = new FakeCommands(); + commands.list = [ + claudeProvider("claude"), + { + ...claudeProvider("cline"), + id: "cline", + name: "Cline", + commandEditable: false, + commandReadOnlyReason: "registry", + source: { kind: "registry", version: "3.0.70", update: "3.0.74" }, + }, + ]; + const backend = await open(commands); + fireEvent.mouseDown(screen.getByRole("option", { name: "Cline Update" })); + const details = await screen.findByRole("region", { name: "Cline" }); + expect(within(details).getByText("ACP Registry · 3.0.70")).toBeInTheDocument(); + fireEvent.click(within(details).getByRole("button", { name: "Update" })); + expect(backend.installs).toEqual(["cline"]); + await act(async () => backend.finish()); + fireEvent.click(screen.getByRole("button", { name: "Remove" })); + const dialog = await screen.findByRole("dialog", { name: "Remove Cline" }); + fireEvent.click(within(dialog).getByRole("button", { name: "Remove" })); + await waitFor(() => expect(backend.removed).toEqual(["cline"])); + }); + + it("adds agents from the ACP Registry in a dialog", async () => { + const commands = new FakeCommands(); + commands.list = [claudeProvider("claude")]; + await open(commands); + expect(screen.getByRole("button", { name: "Remove" })).toBeDisabled(); + fireEvent.click(screen.getByRole("button", { name: "Add Agent…" })); + const dialog = await screen.findByRole("dialog", { name: "Add Agent" }); + await waitFor(() => expect(within(dialog).getByRole("listitem", { name: "Amp" })).toBeInTheDocument()); + }); + + it("stages the settings new tasks start with", async () => { + const commands = new FakeCommands(); + commands.list = [{ ...claudeProvider("claude"), config: [model] }]; + await open(commands); + const select = screen.getByRole("button", { name: "Model" }); + expect(select).toHaveTextContent("Agent's default (Sonnet)"); + fireEvent.click(select); + fireEvent.click(await screen.findByRole("option", { name: "Opus" })); + expect(screen.getByRole("button", { name: "Model" })).toHaveTextContent("Opus"); + }); + + it("says when an agent's settings aren't known yet", async () => { + const commands = new FakeCommands(); + commands.list = [claudeProvider("claude")]; + await open(commands); + expect(screen.getByText(/after its first session/)).toBeInTheDocument(); + }); +}); diff --git a/src/features/agents/agents.test.ts b/src/features/agents/agents.test.ts index 94051d6dca..7d84e1404a 100644 --- a/src/features/agents/agents.test.ts +++ b/src/features/agents/agents.test.ts @@ -453,3 +453,30 @@ describe("typed path references", () => { expect(resolveTyped("C:\\r", "../../x")).toBe("C:/x"); }); }); + +describe("new task defaults", () => { + it("start a draft with the agent's defaults until the draft picks", async () => { + const { draftConfig } = await import("./store"); + const option = (id: string, current: string, values: string[]) => + ({ + id, + name: id, + description: null, + category: id, + current, + values: values.map((value) => ({ value, name: value, description: null })), + via: "option", + }) as AgentConfigOption; + const provider = { + id: "claude", + config: [option("model", "sonnet", ["sonnet", "opus"]), option("mode", "default", ["default", "plan"])], + } as unknown as Parameters[0]; + const draft = { provider: "claude", config: {}, isolation: "local", base: null } as unknown as Parameters< + typeof draftConfig + >[1]; + const current = (d: typeof draft, defaults: Record) => + draftConfig(provider, d, defaults).map((o) => o.current); + expect(current(draft, { model: "opus", mode: "nope" })).toEqual(["opus", "default"]); + expect(current({ ...draft, config: { model: "sonnet" } }, { model: "opus" })).toEqual(["sonnet", "default"]); + }); +}); diff --git a/src/features/agents/index.ts b/src/features/agents/index.ts index b8237c6a33..429974c224 100644 --- a/src/features/agents/index.ts +++ b/src/features/agents/index.ts @@ -27,13 +27,13 @@ import { TaskStatusMark } from "./TaskStatusMark"; import { taskActions } from "./taskActions"; import { replyActions } from "./replyActions"; -/** Settings › Tools › Agents (also used by the Settings window). */ +/** Settings › Agents (also used by the Settings window). */ export function activateSettingsPages(): () => void { return registerSettingsPage({ id: REGISTRY_PAGE, title: "Agents", - group: "Tools", - order: 500, + // After Languages & Frameworks, before Tools. + order: 450, keywords: ["agent", "acp", "registry", "install", "update", "coding agent"], component: lazyComponent(() => import("./AgentRegistryPage").then((m) => m.AgentRegistryPage)), }); diff --git a/src/features/agents/model.ts b/src/features/agents/model.ts index 4f9f285b67..a7ba4b2e05 100644 --- a/src/features/agents/model.ts +++ b/src/features/agents/model.ts @@ -7,8 +7,8 @@ export const HOME_KEY = "agent:new"; export const TOOL_WINDOW = "agents"; /** MIME of a dragged agent task (a tree row or the docked conversation bar): the payload is the task id. */ export const TASK_DRAG = "application/x-openidea-agent-task"; -/** Settings › Tools › Agents: the ACP Registry. */ -export const REGISTRY_PAGE = "tools.agents"; +/** Settings › Agents: the agents this machine runs. */ +export const REGISTRY_PAGE = "agents"; export const sessionKey = (task: string) => `agent:${task}`; diff --git a/src/features/agents/store.ts b/src/features/agents/store.ts index d71111762d..4e2ae894e2 100644 --- a/src/features/agents/store.ts +++ b/src/features/agents/store.ts @@ -157,12 +157,23 @@ export function updateDraft(patch: Partial) { save(DRAFT_KEY, draft); } -/** Config for the selected model, with only supported draft choices applied. */ -export function draftConfig(provider: AgentProvider | undefined, draft: Draft): AgentConfigOption[] { +/** What Settings › Agents says new tasks of `provider` start with, by option id. */ +export const providerDefaults = (provider: string | undefined): Record => + (provider && useProject.getState().settings?.agents?.defaults?.[provider]) || {}; + +/** + * Config for the selected model, with only supported choices applied: the draft's, else + * the agent's defaults from Settings › Agents. + */ +export function draftConfig( + provider: AgentProvider | undefined, + draft: Draft, + defaults: Record = providerDefaults(provider?.id), +): AgentConfigOption[] { const config = (provider?.config ?? []) .filter((o) => o.category !== "thought_level") .map((o) => { - const choice = draft.config[o.id]; + const choice = draft.config[o.id] ?? defaults[o.id]; return { ...o, current: choice !== undefined && o.values.some((v) => v.value === choice) ? choice : o.current, @@ -172,7 +183,7 @@ export function draftConfig(provider: AgentProvider | undefined, draft: Draft): if (model) { config.push( ...(provider?.thoughtLevels?.[model] ?? []).map((o) => { - const choice = draft.thoughtLevels?.[model]?.[o.id]; + const choice = draft.thoughtLevels?.[model]?.[o.id] ?? defaults[o.id]; return { ...o, current: choice !== undefined && o.values.some((v) => v.value === choice) ? choice : o.current, @@ -629,7 +640,7 @@ export async function startTask( providers.find((p) => p.id === draft.provider), draft, ); - const defaults = bypassDefaults(options); + const defaults = { ...bypassDefaults(options), ...providerDefaults(draft.provider) }; const config = options.flatMap((o) => { const value = o.category === "model" || o.category === "thought_level" diff --git a/src/features/settings/pages/mcpServer.tsx b/src/features/settings/pages/mcpServer.tsx index a19ae2cd53..625fd946dd 100644 --- a/src/features/settings/pages/mcpServer.tsx +++ b/src/features/settings/pages/mcpServer.tsx @@ -114,10 +114,9 @@ function McpServerEndpoint() { } export const MCP_SERVER_PAGE: PageSpec = { - id: "tools.mcpServer", + id: "agents.mcpServer", title: "MCP Server", - group: "Tools", - order: 604, + order: 10, keywords: ["mcp", "model context protocol", "ai", "agent", "claude", "codex", "tools", "stdio"], sections: [ { diff --git a/src/features/settings/pages/tools.tsx b/src/features/settings/pages/tools.tsx index 6dad4fa2e8..17227232a9 100644 --- a/src/features/settings/pages/tools.tsx +++ b/src/features/settings/pages/tools.tsx @@ -27,6 +27,24 @@ import { tx } from "@/platform/i18n"; export const TOOLS_GROUP = "Tools"; +const SEND_KEY_OPTIONS = [ + { value: "enter", label: "Enter" }, + { value: "modEnter", label: "⌘Enter" }, +]; +const WHILE_RUNNING_OPTIONS = [ + { value: "queue", label: "Queues the message for after the turn" }, + { value: "steer", label: "Sends it into the turn" }, +]; +const TOOL_CALL_OPTIONS = [ + { value: "grouped", label: "Grouped by what they did" }, + { value: "each", label: "One per line" }, +]; +const THINKING_OPTIONS = [ + { value: "auto", label: "Open while it streams" }, + { value: "expanded", label: "Always open" }, + { value: "collapsed", label: "Folded" }, +]; + const L = WORKFLOW_LIMITS; const isMac = typeof navigator !== "undefined" && /Mac/i.test(navigator.platform || navigator.userAgent); @@ -630,13 +648,67 @@ export const TOOLS_PAGES: PageSpec[] = [ ], }, { - // Under Settings › Tools › Agents (the agents feature registers `tools.agents`). - id: "tools.agents.chat", + // Under Settings › Agents (the agents feature registers `agents`). + id: "agents.chat", title: "Chat", - group: TOOLS_GROUP, order: 0, - keywords: ["agent", "claude", "codex", "usage", "quota", "rate limit", "cost", "tokens", "meter"], + keywords: [ + "agent", + "claude", + "codex", + "usage", + "quota", + "rate limit", + "cost", + "tokens", + "meter", + "send", + "reasoning", + ], sections: [ + { + title: "Sending", + options: [ + { kind: "select", key: "agents.sendWith", label: "Send messages with", options: SEND_KEY_OPTIONS }, + { + kind: "select", + key: "agents.whileRunning", + label: "While the agent works, sending", + options: WHILE_RUNNING_OPTIONS, + hint: "The other way is a modifier away: ⌘↵ with Enter, ⌘⇧↵ with ⌘↵", + }, + ], + }, + { + title: "Conversation", + options: [ + { + kind: "toggle", + key: "agents.foldTurns", + label: "Fold a finished turn's work", + hint: "Reasoning and tool calls before the reply fold into one line under its message", + }, + { + kind: "select", + key: "agents.toolCalls", + label: "Tool calls", + options: TOOL_CALL_OPTIONS, + }, + { + kind: "select", + key: "agents.thinking", + label: "Reasoning", + options: THINKING_OPTIONS, + }, + { kind: "toggle", key: "agents.expandToolOutput", label: "Show tool output without opening it" }, + { + kind: "toggle", + key: "agents.smoothText", + label: "Reveal streaming text smoothly", + hint: "Text appears at a steady pace instead of in bursts", + }, + ], + }, { title: "Shown in the Task Header", options: [ diff --git a/src/platform/locales/text/en.json b/src/platform/locales/text/en.json index a63840f4ad..e4a8bf85c3 100644 --- a/src/platform/locales/text/en.json +++ b/src/platform/locales/text/en.json @@ -827,5 +827,37 @@ "1 changed file": "1 changed file", "{count} changed files": "{count} changed files", "Send into the agent's turn": "Send into the agent's turn", - "Queue a message for when the agent is done (⌘⇧↵ sends it now)": "Queue a message for when the agent is done (⌘⇧↵ sends it now)" + "Queue a message for when the agent is done (⌘⇧↵ sends it now)": "Queue a message for when the agent is done (⌘⇧↵ sends it now)", + "Remove {name} from this computer? Its tasks stay, but can't continue until it is installed again.": "Remove {name} from this computer? Its tasks stay, but can't continue until it is installed again.", + "Add Agent…": "Add Agent…", + "Add Agent": "Add Agent", + "ACP Registry · {version}": "ACP Registry · {version}", + "Agent file": "Agent file", + "New tasks start with": "New tasks start with", + "Launch": "Launch", + "This agent is installed from the ACP Registry, which launches it.": "This agent is installed from the ACP Registry, which launches it.", + "{version} is available": "{version} is available", + "The agent's models and modes can be chosen here after its first session.": "The agent's models and modes can be chosen here after its first session.", + "Agent's default ({fallback})": "Agent's default ({fallback})", + "Agent's default": "Agent's default", + "What you pick on the New Task page wins; these apply until then and after switching agents.": "What you pick on the New Task page wins; these apply until then and after switching agents.", + "⌘Enter": "⌘Enter", + "Queues the message for after the turn": "Queues the message for after the turn", + "Sends it into the turn": "Sends it into the turn", + "Grouped by what they did": "Grouped by what they did", + "One per line": "One per line", + "Open while it streams": "Open while it streams", + "Always open": "Always open", + "Folded": "Folded", + "Sending": "Sending", + "Send messages with": "Send messages with", + "While the agent works, sending": "While the agent works, sending", + "The other way is a modifier away: ⌘↵ with Enter, ⌘⇧↵ with ⌘↵": "The other way is a modifier away: ⌘↵ with Enter, ⌘⇧↵ with ⌘↵", + "Conversation": "Conversation", + "Fold a finished turn's work": "Fold a finished turn's work", + "Reasoning and tool calls before the reply fold into one line under its message": "Reasoning and tool calls before the reply fold into one line under its message", + "Tool calls": "Tool calls", + "Show tool output without opening it": "Show tool output without opening it", + "Reveal streaming text smoothly": "Reveal streaming text smoothly", + "Text appears at a steady pace instead of in bursts": "Text appears at a steady pace instead of in bursts" } diff --git a/src/platform/locales/text/es.json b/src/platform/locales/text/es.json index 5999bb7f1e..43fec7a769 100644 --- a/src/platform/locales/text/es.json +++ b/src/platform/locales/text/es.json @@ -22,11 +22,8 @@ "Go to original code at line {line}": "Ir al código original en la línea {line}", "Edited within moved code": "Editado dentro del código movido", "The language server JDK ({path}) must be a full JDK with jdk.compiler, jdk.jdi and jdk.unsupported for Java language support and debugging. jdtls needs JDK {version} or newer. Download JDK {version}, choose a full JDK in {setting}, or set it to Auto.": "El JDK del servidor de lenguaje ({path}) debe ser un JDK completo con jdk.compiler, jdk.jdi y jdk.unsupported para la compatibilidad con el lenguaje Java y la depuración. jdtls requiere JDK {version} o superior. Descarga JDK {version}, elige un JDK completo en {setting} o establécelo en Automático.", - "ACP Registry": "Registro ACP", "Apple's clangd does not run clang-tidy, so checks from .clang-tidy are not shown. Install clangd (LLVM) to get them.": "El clangd de Apple no ejecuta clang-tidy, por lo que las comprobaciones de .clang-tidy no se muestran. Instala clangd (LLVM) para obtenerlas.", "Auto-detect ({defaultProgram})": "Detectar automáticamente ({defaultProgram})", - "Built-in": "Integrado", - "Built-in agents": "Agentes integrados", "Custom executable": "Ejecutable personalizado", "Found on PATH": "Encontrado en PATH", "Launch command": "Comando de inicio", @@ -50,7 +47,6 @@ "Run `vibe` in a terminal and sign in.": "Ejecuta `vibe` en una terminal e inicia sesión.", "Sign in with the agent's own command line first.": "Inicia sesión primero con la línea de comandos del propio agente.", "This agent is configured in its agent file.": "Este agente se configura en su archivo de agente.", - "This agent is installed from the ACP Registry. Manage its installation in the ACP Registry tab.": "Este agente se instaló desde el Registro ACP. Administra su instalación en la pestaña Registro ACP.", "This agent runs through a package runner (npm or uv) and has no executable to choose.": "Este agente se ejecuta mediante un ejecutor de paquetes (npm o uv) y no tiene un ejecutable para elegir.", "Update to {latest}": "Actualizar a {latest}", "A newer version is available: {latest}": "Hay una versión más reciente disponible: {latest}", @@ -1686,7 +1682,6 @@ "oxfmt formatting timed out": "Se agotó el tiempo de espera al formatear con oxfmt", "{name} does not support selection formatting for this language; formatted the whole file": "{name} no admite el formato de selección para este lenguaje; se formateó todo el archivo", "Formatting timed out": "Se agotó el tiempo de espera de formato", - "{name} executable": "Ejecutable de {name}", "{name}: Node.js is required": "{name}: se requiere Node.js", "Formatter": "Formateador", "JSON with Comments": "JSON con comentarios", diff --git a/src/platform/locales/text/fr.json b/src/platform/locales/text/fr.json index ad97c2eec7..48a1ae1d4a 100644 --- a/src/platform/locales/text/fr.json +++ b/src/platform/locales/text/fr.json @@ -5486,19 +5486,14 @@ "'{expected}' expected": "'{expected}' attendu", "Unexpected token": "Jeton inattendu", "Syntax": "Syntaxe", - "Built-in": "Intégrés", - "ACP Registry": "Registre ACP", "Not found": "Introuvable", - "Built-in agents": "Agents intégrés", "Custom executable": "Exécutable personnalisé", "Found on PATH": "Trouvé dans le PATH", "Not found on PATH": "Introuvable dans le PATH", - "{name} executable": "Exécutable {name}", "Launch command": "Commande de lancement", "Auto-detect ({defaultProgram})": "Détection automatique ({defaultProgram})", "Leave empty to find the executable on PATH. Changes apply to new sessions.": "Laissez vide pour rechercher l'exécutable dans le PATH. Les modifications s'appliquent aux nouvelles sessions.", "This agent runs through a package runner (npm or uv) and has no executable to choose.": "Cet agent s'exécute via un lanceur de paquets (npm ou uv) et n'a pas d'exécutable à choisir.", - "This agent is installed from the ACP Registry. Manage its installation in the ACP Registry tab.": "Cet agent est installé depuis le registre ACP. Gérez son installation dans l'onglet Registre ACP.", "This agent is configured in its agent file.": "Cet agent est configuré dans son fichier d'agent.", "Sign in": "Se connecter", "What the session has cost so far, as the agent reports it": "Ce que la session a coûté jusqu'ici, tel que l'agent l'indique", diff --git a/src/platform/locales/text/ko.json b/src/platform/locales/text/ko.json index 9fb6a2fcdd..d9eb16766a 100644 --- a/src/platform/locales/text/ko.json +++ b/src/platform/locales/text/ko.json @@ -56,11 +56,8 @@ "Go to original code at line {line}": "{line}행의 원본 코드로 이동", "Edited within moved code": "이동된 코드 내에서 편집됨", "The language server JDK ({path}) must be a full JDK with jdk.compiler, jdk.jdi and jdk.unsupported for Java language support and debugging. jdtls needs JDK {version} or newer. Download JDK {version}, choose a full JDK in {setting}, or set it to Auto.": "언어 서버 JDK({path})는 Java 언어 지원 및 디버깅을 위해 jdk.compiler, jdk.jdi, jdk.unsupported를 포함한 전체 JDK여야 합니다. jdtls에는 JDK {version} 이상이 필요합니다. JDK {version}을(를) 다운로드하거나, {setting}에서 전체 JDK를 선택하거나, 자동으로 설정하세요.", - "ACP Registry": "ACP 레지스트리", "Apple's clangd does not run clang-tidy, so checks from .clang-tidy are not shown. Install clangd (LLVM) to get them.": "Apple의 clangd는 clang-tidy를 실행하지 않으므로 .clang-tidy의 검사가 표시되지 않습니다. 이 검사를 사용하려면 clangd(LLVM)를 설치하세요.", "Auto-detect ({defaultProgram})": "자동 감지({defaultProgram})", - "Built-in": "기본 제공", - "Built-in agents": "기본 제공 에이전트", "Custom executable": "사용자 지정 실행 파일", "Found on PATH": "PATH에서 찾음", "Launch command": "실행 명령", @@ -86,7 +83,6 @@ "Run `vibe` in a terminal and sign in.": "터미널에서 `vibe`를 실행하고 로그인하세요.", "Sign in with the agent's own command line first.": "먼저 에이전트 자체 명령줄에서 로그인하세요.", "This agent is configured in its agent file.": "이 에이전트는 에이전트 파일에서 구성됩니다.", - "This agent is installed from the ACP Registry. Manage its installation in the ACP Registry tab.": "이 에이전트는 ACP 레지스트리에서 설치되었습니다. 설치 관리는 ACP 레지스트리 탭에서 하세요.", "This agent runs through a package runner (npm or uv) and has no executable to choose.": "이 에이전트는 패키지 러너(npm 또는 uv)를 통해 실행되므로 선택할 실행 파일이 없습니다.", "Update to {latest}": "{latest}(으)로 업데이트", "A newer version is available: {latest}": "새 버전을 사용할 수 있습니다: {latest}", @@ -1742,7 +1738,6 @@ "Ruff configuration directory has no ruff.toml, .ruff.toml, or pyproject.toml with [tool.ruff]: {path}": "Ruff 구성 디렉터리에 ruff.toml, .ruff.toml 또는 [tool.ruff]가 있는 pyproject.toml이 없습니다: {path}", "{name} does not support selection formatting for this language; formatted the whole file": "{name}은(는) 이 언어의 선택 영역 서식 지정을 지원하지 않아 파일 전체의 서식을 지정했습니다", "Formatting timed out": "서식 지정 시간 초과", - "{name} executable": "{name} 실행 파일", "{name}: Node.js is required": "{name}: Node.js가 필요합니다", "Formatter": "서식 지정 도구", "JSON with Comments": "주석이 있는 JSON", diff --git a/src/platform/locales/text/pl.json b/src/platform/locales/text/pl.json index 4bbadc52ae..90c01da656 100644 --- a/src/platform/locales/text/pl.json +++ b/src/platform/locales/text/pl.json @@ -14,11 +14,8 @@ "Go to original code at line {line}": "Przejdź do oryginalnego kodu w wierszu {line}", "Edited within moved code": "Edytowano w obrębie przeniesionego kodu", "The language server JDK ({path}) must be a full JDK with jdk.compiler, jdk.jdi and jdk.unsupported for Java language support and debugging. jdtls needs JDK {version} or newer. Download JDK {version}, choose a full JDK in {setting}, or set it to Auto.": "JDK serwera językowego ({path}) musi być pełnym pakietem JDK zawierającym jdk.compiler, jdk.jdi oraz jdk.unsupported dla obsługi języka Java i debugowania. jdtls wymaga JDK w wersji {version} lub nowszej. Pobierz JDK {version}, wybierz pełne JDK w {setting} lub ustaw opcję Automatycznie.", - "ACP Registry": "Rejestr ACP", "Apple's clangd does not run clang-tidy, so checks from .clang-tidy are not shown. Install clangd (LLVM) to get them.": "Wersja clangd od Apple nie uruchamia clang-tidy, więc kontrole z .clang-tidy nie są wyświetlane. Zainstaluj clangd (LLVM), aby je uzyskać.", "Auto-detect ({defaultProgram})": "Wykryj automatycznie ({defaultProgram})", - "Built-in": "Wbudowane", - "Built-in agents": "Wbudowani agenci", "Custom executable": "Własny plik wykonywalny", "Found on PATH": "Znaleziono w PATH", "Launch command": "Polecenie uruchomienia", @@ -42,7 +39,6 @@ "Run `vibe` in a terminal and sign in.": "Uruchom `vibe` w terminalu i zaloguj się.", "Sign in with the agent's own command line first.": "Najpierw zaloguj się za pomocą własnego wiersza poleceń agenta.", "This agent is configured in its agent file.": "Ten agent jest skonfigurowany w swoim pliku agenta.", - "This agent is installed from the ACP Registry. Manage its installation in the ACP Registry tab.": "Ten agent został zainstalowany z Rejestru ACP. Zarządzaj jego instalacją w karcie Rejestr ACP.", "This agent runs through a package runner (npm or uv) and has no executable to choose.": "Ten agent uruchamia się poprzez narzędzie do uruchamiania pakietów (npm lub uv) i nie posiada pliku wykonywalnego do wyboru.", "Update to {latest}": "Zaktualizuj do {latest}", "A newer version is available: {latest}": "Dostępna jest nowsza wersja: {latest}", @@ -1676,7 +1672,6 @@ "oxfmt formatting timed out": "Przekroczono czas oczekiwania na formatowanie oxfmt", "{name} does not support selection formatting for this language; formatted the whole file": "{name} nie obsługuje formatowania zaznaczenia dla tego języka; przeformatowano cały plik", "Formatting timed out": "Przekroczono czas oczekiwania na formatowanie", - "{name} executable": "Plik wykonywalny {name}", "{name}: Node.js is required": "{name}: wymagane jest środowisko Node.js", "Formatter": "Formatowanie", "JSON with Comments": "JSON z komentarzami", diff --git a/src/platform/locales/text/pt.json b/src/platform/locales/text/pt.json index 288127792a..4346682b88 100644 --- a/src/platform/locales/text/pt.json +++ b/src/platform/locales/text/pt.json @@ -14,11 +14,8 @@ "Go to original code at line {line}": "Ir para o código original na linha {line}", "Edited within moved code": "Editado dentro do código movido", "The language server JDK ({path}) must be a full JDK with jdk.compiler, jdk.jdi and jdk.unsupported for Java language support and debugging. jdtls needs JDK {version} or newer. Download JDK {version}, choose a full JDK in {setting}, or set it to Auto.": "O JDK do servidor de linguagem ({path}) deve ser um JDK completo com jdk.compiler, jdk.jdi e jdk.unsupported para suporte à linguagem Java e depuração. O jdtls requer JDK {version} ou mais recente. Baixe o JDK {version}, escolha um JDK completo em {setting} ou defina como Automático.", - "ACP Registry": "Registro ACP", "Apple's clangd does not run clang-tidy, so checks from .clang-tidy are not shown. Install clangd (LLVM) to get them.": "O clangd da Apple não executa o clang-tidy, portanto as verificações do .clang-tidy não são exibidas. Instale o clangd (LLVM) para obtê-las.", "Auto-detect ({defaultProgram})": "Detectar automaticamente ({defaultProgram})", - "Built-in": "Integrado", - "Built-in agents": "Agentes integrados", "Custom executable": "Executável personalizado", "Found on PATH": "Encontrado no PATH", "Launch command": "Comando de inicialização", @@ -42,7 +39,6 @@ "Run `vibe` in a terminal and sign in.": "Execute `vibe` em um terminal e entre.", "Sign in with the agent's own command line first.": "Primeiro entre usando a linha de comando do próprio agente.", "This agent is configured in its agent file.": "Este agente é configurado em seu arquivo de agente.", - "This agent is installed from the ACP Registry. Manage its installation in the ACP Registry tab.": "Este agente foi instalado a partir do Registro ACP. Gerencie sua instalação na guia Registro ACP.", "This agent runs through a package runner (npm or uv) and has no executable to choose.": "Este agente é executado por meio de um executor de pacotes (npm ou uv) e não possui um executável para selecionar.", "Update to {latest}": "Atualizar para {latest}", "A newer version is available: {latest}": "Uma versão mais recente está disponível: {latest}", @@ -1676,7 +1672,6 @@ "oxfmt formatting timed out": "Tempo limite de formatação com oxfmt esgotado", "{name} does not support selection formatting for this language; formatted the whole file": "{name} não oferece suporte à formatação de seleção para esta linguagem; o arquivo inteiro foi formatado", "Formatting timed out": "Tempo limite de formatação esgotado", - "{name} executable": "Executável do {name}", "{name}: Node.js is required": "{name}: o Node.js é necessário", "Formatter": "Formatador", "JSON with Comments": "JSON com comentários", diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json index 2870ab2a13..7932f3d04d 100644 --- a/src/platform/locales/text/zh.json +++ b/src/platform/locales/text/zh.json @@ -179,11 +179,8 @@ "Go to original code at line {line}": "跳转到第 {line} 行的原始代码", "Edited within moved code": "移动代码中的修改", "The language server JDK ({path}) must be a full JDK with jdk.compiler, jdk.jdi and jdk.unsupported for Java language support and debugging. jdtls needs JDK {version} or newer. Download JDK {version}, choose a full JDK in {setting}, or set it to Auto.": "语言服务器 JDK({path})必须是包含 jdk.compiler、jdk.jdi 和 jdk.unsupported 的完整 JDK,才能支持 Java 语言功能和调试。jdtls 需要 JDK {version} 或更高版本。请下载 JDK {version},在 {setting} 中选择完整 JDK,或设为自动。", - "ACP Registry": "ACP 注册表", "Apple's clangd does not run clang-tidy, so checks from .clang-tidy are not shown. Install clangd (LLVM) to get them.": "Apple 的 clangd 不运行 clang-tidy,因此不会显示 .clang-tidy 中配置的检查。请安装 clangd(LLVM)以启用这些检查。", "Auto-detect ({defaultProgram})": "自动检测({defaultProgram})", - "Built-in": "内置", - "Built-in agents": "内置智能体", "Custom executable": "自定义可执行文件", "Found on PATH": "已在 PATH 中找到", "Launch command": "启动命令", @@ -209,7 +206,6 @@ "Run `vibe` in a terminal and sign in.": "在终端中运行 `vibe` 并登录。", "Sign in with the agent's own command line first.": "请先使用智能体自身的命令行登录。", "This agent is configured in its agent file.": "此智能体在其智能体文件中配置。", - "This agent is installed from the ACP Registry. Manage its installation in the ACP Registry tab.": "此智能体从 ACP 注册表安装。请在 ACP 注册表标签页管理其安装。", "This agent runs through a package runner (npm or uv) and has no executable to choose.": "此智能体通过包运行器(npm 或 uv)启动,无需选择可执行文件。", "Update to {latest}": "更新至 {latest}", "A newer version is available: {latest}": "有新版本可用:{latest}", @@ -2003,7 +1999,6 @@ "Ruff configuration directory has no ruff.toml, .ruff.toml, or pyproject.toml with [tool.ruff]: {path}": "Ruff 配置目录中没有 ruff.toml、.ruff.toml 或包含 [tool.ruff] 的 pyproject.toml:{path}", "{name} does not support selection formatting for this language; formatted the whole file": "{name} 不支持此语言的选区格式化,已格式化整个文件", "Formatting timed out": "格式化超时", - "{name} executable": "{name} 可执行文件", "{name}: Node.js is required": "{name}:需要 Node.js", "Formatter": "格式化工具", "JSON with Comments": "带注释的 JSON", @@ -7160,5 +7155,37 @@ "1 changed file": "改动 1 个文件", "{count} changed files": "改动 {count} 个文件", "Send into the agent's turn": "发送到当前回合", - "Queue a message for when the agent is done (⌘⇧↵ sends it now)": "排队一条消息,agent 做完后发送(⌘⇧↵ 立即发送)" + "Queue a message for when the agent is done (⌘⇧↵ sends it now)": "排队一条消息,agent 做完后发送(⌘⇧↵ 立即发送)", + "Remove {name} from this computer? Its tasks stay, but can't continue until it is installed again.": "从这台电脑移除 {name}?它的任务会保留,但在重新安装前无法继续。", + "Add Agent…": "添加 Agent…", + "Add Agent": "添加 Agent", + "ACP Registry · {version}": "ACP 注册表 · {version}", + "Agent file": "Agent 文件", + "New tasks start with": "新任务默认使用", + "Launch": "启动", + "This agent is installed from the ACP Registry, which launches it.": "此 agent 从 ACP 注册表安装,由注册表负责启动。", + "{version} is available": "{version} 可用", + "The agent's models and modes can be chosen here after its first session.": "agent 运行过一次会话后,才能在这里选择它的模型和模式。", + "Agent's default ({fallback})": "agent 默认({fallback})", + "Agent's default": "agent 默认", + "What you pick on the New Task page wins; these apply until then and after switching agents.": "以“新任务”页上的选择为准;在那之前,以及切换 agent 之后,使用这里的设置。", + "⌘Enter": "⌘Enter", + "Queues the message for after the turn": "排队,等本回合结束后发送", + "Sends it into the turn": "立即发送到当前回合", + "Grouped by what they did": "按操作类型合并", + "One per line": "每次调用一行", + "Open while it streams": "生成时展开", + "Always open": "始终展开", + "Folded": "折叠", + "Sending": "发送", + "Send messages with": "发送消息", + "While the agent works, sending": "agent 工作时发送", + "The other way is a modifier away: ⌘↵ with Enter, ⌘⇧↵ with ⌘↵": "另一种方式只差一个修饰键:用 Enter 发送时按 ⌘↵,用 ⌘↵ 发送时按 ⌘⇧↵", + "Conversation": "对话", + "Fold a finished turn's work": "折叠已完成回合的过程", + "Reasoning and tool calls before the reply fold into one line under its message": "回复之前的思考和工具调用折叠成一行,显示在对应消息下方", + "Tool calls": "工具调用", + "Show tool output without opening it": "默认展开工具输出", + "Reveal streaming text smoothly": "平滑显示生成中的文字", + "Text appears at a steady pace instead of in bursts": "文字匀速出现,而不是一段一段地跳出" }