дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-29 05:52:23 +02:00
Порівняти коміти
4
Коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
a6a30b8ef6 | ||
|
|
22af0931dd | ||
|
|
4af81625b1 | ||
|
|
f3d18c0eb8 |
No files matched your search
@@ -125,16 +125,16 @@ Tasks are saved per project and survive restarts. When the agent supports resumi
|
||||
|
||||
## Manage agents
|
||||
|
||||
**Settings › Tools › Agents** (also **More Agents…** in the agent picker) has two tabs:
|
||||
**Settings › Agents › Agent Setup** (also **More Agents…** in the agent picker) lists built-in agents and agents from the ACP Registry.
|
||||
|
||||
- **Built-in**: for each built-in agent, whether its executable was found on `PATH`, a field to point at a **Custom executable**, **Environment variables** for the agent process (written as `NAME=value; OTHER=value`; the values are kept in the OS credential store) and how to sign in. Changes apply to new sessions. When the agent is a global npm install (such as Claude Code, Codex or Gemini CLI), **Check for updates** compares it with npm's latest stable release and **Update to…** updates that installation.
|
||||
- **ACP Registry**: agents published in the [ACP Registry](https://agentclientprotocol.com). Search, **Install**, **Update** and **Remove**. Installed agents are kept in OpenIDEA's data directory; downloads are checked against the registry's SHA-256 when it provides one.
|
||||
|
||||
**Settings › Tools › Agents › Chat** chooses what the task header shows: **Context window usage**, **Time spent on the task**, **Usage limits** (when the agent reports them, such as Claude Code) and **Session cost**.
|
||||
**Settings › Agents › Chat** chooses what the task header shows: **Context window usage**, **Time spent on the task**, **Usage limits** (when the agent reports them, such as Claude Code) and **Session cost**.
|
||||
|
||||
### External MCP servers
|
||||
|
||||
**Settings › Agents › External MCP Servers** configures MCP servers across three persistent levels, while the composer's **MCP** picker (or `/mcp`) controls them per session:
|
||||
**Settings › Agents › MCP Connections** configures MCP servers across three persistent levels, while the composer's **MCP** picker (or `/mcp`) controls them per session:
|
||||
|
||||
- **Global (`User`)**: saved in `settings.toml` with environment variable and HTTP header values stored in the OS credential store, shared across projects and agents (or scoped to selected agents).
|
||||
- **Project (`Workspace`)**: saved in `.openidea/settings.toml`; entries with the same name override Global servers, and servers added outside OpenIDEA stay off until approved.
|
||||
|
||||
@@ -20,7 +20,7 @@ A file holds only the values that differ from the layer below. Tables merge key
|
||||
|
||||
Some settings are ignored in the project file: `mcpServer`, imported color schemes (`editor.customSchemes`) and `agents.newTaskApprovals` are global only. Project trust is never read from settings.
|
||||
|
||||
A project file can't loosen what coding agents may do: `agentSecurity.allowedCommands` and `agents.defaults` are global only, and `agentSecurity.blockedCommands` in a project adds to the global list rather than replacing it. An MCP server in the project's `agents.mcpServers` stays off until you turn it on in **Settings › Agents › External MCP Servers**, and again after its definition changes.
|
||||
A project file can't loosen what coding agents may do: `agentSecurity.allowedCommands` and `agents.defaults` are global only, and `agentSecurity.blockedCommands` in a project adds to the global list rather than replacing it. An MCP server in the project's `agents.mcpServers` stays off until you turn it on in **Settings › Agents › MCP Connections**, and again after its definition changes.
|
||||
|
||||
## File format
|
||||
|
||||
|
||||
@@ -125,16 +125,16 @@ agent 运行过一个任务后,新任务会以它自动批准所有操作的
|
||||
|
||||
## 管理 agent
|
||||
|
||||
**设置 › 工具 › 智能体**(也可以在 agent 选择器中点 **更多 Agent…**)有两个标签页:
|
||||
**设置 › 智能体 › 智能体配置**(也可以在 agent 选择器中点 **更多 Agent…**)列出了内置智能体和 ACP Registry 提供的智能体。
|
||||
|
||||
- **内置**:每个内置 agent 的可执行文件是否在 `PATH` 中找到、指定 **自定义可执行文件** 的输入框、传给 agent 进程的 **环境变量**(格式为 `NAME=value; OTHER=value`;这些值保存在系统凭据存储中)以及登录方式。改动对新会话生效。如果 agent 是 npm 全局安装(例如 Claude Code、Codex、Gemini CLI),**检查更新** 会与 npm 的最新稳定版比较,点击 **更新至…** 即可更新这份安装。
|
||||
- **ACP 注册表**:[ACP Registry](https://agentclientprotocol.com) 中发布的 agent,可以搜索、**安装**、**更新** 和 **移除**。安装的 agent 保存在 OpenIDEA 的数据目录中;注册表提供 SHA-256 时会校验下载内容。
|
||||
|
||||
**设置 › 工具 › 智能体 › 聊天** 决定任务标题栏显示哪些信息:**上下文窗口用量**、**任务耗时**、**用量限额**(agent 报告时,例如 Claude Code)和 **会话花费**。
|
||||
**设置 › 智能体 › 聊天** 决定任务标题栏显示哪些信息:**上下文窗口用量**、**任务耗时**、**用量限额**(agent 报告时,例如 Claude Code)和 **会话花费**。
|
||||
|
||||
### 外部 MCP 服务器
|
||||
|
||||
**设置 › 智能体 › 外部 MCP 服务器** 按三个持久层级管理 MCP 服务器,输入框底部的 **MCP** 选择器(或 `/mcp` 命令)则按单个会话控制它们:
|
||||
**设置 › 智能体 › MCP 连接** 按三个持久层级管理 MCP 服务器,输入框底部的 **MCP** 选择器(或 `/mcp` 命令)则按单个会话控制它们:
|
||||
|
||||
- **全局(`用户`)**:保存在 `settings.toml` 中,环境变量与 HTTP 请求头的值保存在系统凭据存储里,跨项目与各智能体共享(也可限定给选定的智能体)。
|
||||
- **项目(`工作区`)**:保存在 `.openidea/settings.toml` 中,同名服务器覆盖全局配置;在 OpenIDEA 外部写入的项目服务器在批准启用前保持关闭。
|
||||
|
||||
@@ -20,7 +20,7 @@ description: "OpenIDEA 的设置保存在哪里、全局文件与项目文件如
|
||||
|
||||
有些设置在项目文件中会被忽略:`mcpServer`、导入的配色方案(`editor.customSchemes`)和 `agents.newTaskApprovals` 只能全局配置。项目信任状态永远不会从设置文件中读取。
|
||||
|
||||
项目文件不能放宽编码智能体的权限:`agentSecurity.allowedCommands` 和 `agents.defaults` 只能全局配置;项目中的 `agentSecurity.blockedCommands` 会追加到全局列表中,而不是替换它。项目 `agents.mcpServers` 中的 MCP 服务器会保持关闭,直到你在 **设置 › 智能体 › 外部 MCP 服务器** 中将其开启;服务器定义改变后也需要重新开启。
|
||||
项目文件不能放宽编码智能体的权限:`agentSecurity.allowedCommands` 和 `agents.defaults` 只能全局配置;项目中的 `agentSecurity.blockedCommands` 会追加到全局列表中,而不是替换它。项目 `agents.mcpServers` 中的 MCP 服务器会保持关闭,直到你在 **设置 › 智能体 › MCP 连接** 中将其开启;服务器定义改变后也需要重新开启。
|
||||
|
||||
## 文件格式
|
||||
|
||||
|
||||
@@ -308,11 +308,15 @@ test("manages multi-level MCP servers in Settings and per-session overrides via
|
||||
await sessionPopup.getByRole("button", { name: "Reset" }).click();
|
||||
await expect(sessionPopup.getByRole("button", { name: "Reset" })).toHaveCount(0);
|
||||
|
||||
// 2. Jump directly from the session MCP popover's gear button to Settings › External MCP Servers.
|
||||
await sessionPopup.getByRole("button", { name: "External MCP Servers…" }).click();
|
||||
// 2. Jump directly from the session MCP popover's gear button to Settings › Agents › MCP Connections.
|
||||
await sessionPopup.getByRole("button", { name: "MCP Connections…", exact: true }).click();
|
||||
const settingsDialog = page.getByRole("dialog", { name: "Settings", exact: true });
|
||||
await expect(settingsDialog).toBeVisible();
|
||||
await expect(settingsDialog.getByRole("heading", { name: "External MCP Servers" })).toBeVisible();
|
||||
await expect(settingsDialog.getByRole("heading", { name: "MCP Connections", exact: true })).toBeVisible();
|
||||
await expect(settingsDialog.getByRole("treeitem", { name: "MCP Connections", exact: true })).toHaveAttribute(
|
||||
"aria-selected",
|
||||
"true",
|
||||
);
|
||||
|
||||
// Probe `github-mcp-server` and inspect discovered tools inside the expandable card.
|
||||
await settingsDialog.getByRole("button", { name: "Test github-mcp-server" }).click();
|
||||
@@ -321,7 +325,7 @@ test("manages multi-level MCP servers in Settings and per-session overrides via
|
||||
|
||||
if (screenshotDir) {
|
||||
await settingsDialog
|
||||
.getByRole("heading", { name: "External MCP Servers" })
|
||||
.getByRole("heading", { name: "MCP Connections", exact: true })
|
||||
.evaluate((el) => el.scrollIntoView({ block: "start" }));
|
||||
await settingsDialog.screenshot({ path: `${screenshotDir}/mcp-hub-levels.png` });
|
||||
await settingsDialog.getByRole("button", { name: "Add from JSON" }).click();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Settings › Agents › Coding Agents: one searchable list of every agent, those this machine can run first
|
||||
* Agent Setup lists every agent, with those this machine can run first
|
||||
* (built in, installed from the ACP Registry, or defined in an agent file), then those it
|
||||
* can install. The selected agent's page holds its actions, the settings its new tasks
|
||||
* start with, and how it is launched. Launch edits are staged until Apply; installs run in
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
* Settings › Tools › Agents › Command Permissions: whitelist (auto-approve)
|
||||
* and blacklist (auto-reject) command patterns evaluated on agent permission requests.
|
||||
* Command Rules defines the allow and block patterns for agent permission requests.
|
||||
*/
|
||||
import { useMemo, useState } from "react";
|
||||
import { tx } from "@/platform/i18n";
|
||||
@@ -47,7 +46,7 @@ export function AgentPolicyPage() {
|
||||
};
|
||||
|
||||
return (
|
||||
<section className={styles.body} aria-label="Command Permissions">
|
||||
<section className={styles.body} aria-label={tx("Command Rules")}>
|
||||
<p className={styles.notice}>
|
||||
<T>
|
||||
Allowed commands run without asking, with or without extra arguments. Blocked commands are always rejected,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Settings › Agents › Coding Agents. */
|
||||
/** Settings › Agents › Agent Setup. */
|
||||
import { AgentList } from "./AgentList";
|
||||
import { tauriCommands, tauriRegistry, type CommandsBackend, type RegistryBackend } from "./registry";
|
||||
import styles from "./AgentRegistry.module.css";
|
||||
|
||||
@@ -224,11 +224,12 @@
|
||||
flex: none;
|
||||
}
|
||||
|
||||
/* Import Sessions from Other Apps: filter above a fixed-height list, so the dialog doesn't grow. */
|
||||
/* Keep the import list height stable while filtering. */
|
||||
.chooser {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-3) var(--space-4) 0;
|
||||
}
|
||||
.chooserList {
|
||||
height: 312px;
|
||||
|
||||
@@ -281,8 +281,9 @@ describe("Agents docked view", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("lists Import Sessions from Other Apps in Find Action", () => {
|
||||
it("lists Import Sessions in Find Action", () => {
|
||||
const action = taskActions.find((a) => a.id === "agents.importSessions");
|
||||
expect(action?.title).toBe("Import Sessions…");
|
||||
expect(action?.hidden).toBeFalsy();
|
||||
expect(action?.when).toBe("projectOpen");
|
||||
act(() => void action?.run({} as never));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Import Sessions from Other Apps: pick sessions a scan found now, and import them as tasks. */
|
||||
/** Pick external sessions and import them as agent tasks. */
|
||||
import { useEffect, useId, useMemo, useRef, useState, type KeyboardEvent, type MouseEvent } from "react";
|
||||
import { Button, Dialog, Icon, List, SearchField, Spinner, T, listNavigate, rowSelectionMode, selectRow } from "@/ui";
|
||||
import { useRowHeight } from "@/ui/density";
|
||||
@@ -160,7 +160,7 @@ function ImportSessionsDialog() {
|
||||
<Dialog
|
||||
open
|
||||
onClose={close}
|
||||
title="Import Sessions from Other Apps"
|
||||
title="Import Sessions"
|
||||
width={560}
|
||||
footerStart={
|
||||
<span className={styles.chooserFooter}>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Per-session MCP picker for the New Task and Session composers: shows inherited IDE, Project,
|
||||
* Global, and Agent-Native CLI MCP servers, lets the user toggle servers for this session only,
|
||||
* reset session overrides, or jump to Settings › Agents › External MCP Servers.
|
||||
* reset session overrides, or jump to Settings › Agents › MCP Connections.
|
||||
*/
|
||||
import { useMemo, useState } from "react";
|
||||
import type { McpExternalSource, McpServer } from "@/bindings";
|
||||
@@ -110,7 +110,7 @@ export function McpPicker({
|
||||
}}
|
||||
triggerAriaLabel={tx("MCP servers")}
|
||||
popupTitle={tx("Session MCP Servers")}
|
||||
settingsTitle={tx("External MCP Servers…")}
|
||||
settingsTitle={tx("MCP Connections…")}
|
||||
settingsPage={MCP_PAGE}
|
||||
counts={{ active: resolved.activeCount, total: resolved.totalCount, overrides: resolved.overrideCount }}
|
||||
search={{ placeholder: tx("Filter MCP servers…"), ariaLabel: tx("Filter MCP servers"), shown: totalRows > 5 }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Settings › Agents › External MCP Servers: multi-level MCP management across Global (`settings.toml`
|
||||
* Settings › Agents › MCP Connections: multi-level MCP management across Global (`settings.toml`
|
||||
* + Keychain), Project (`.openidea/settings.toml`), and Agent CLI config directories
|
||||
* (`~/.copilot/mcp-config.json`, `~/.claude.json`, `~/.codex/config.toml`, `~/.cursor/mcp.json`,
|
||||
* `~/.gemini/settings.json`, `~/.jetbrains/mcp/mcp.json`, `.mcp.json`, `.vscode/mcp.json`), with
|
||||
@@ -535,7 +535,7 @@ export function McpServersPage({ backend = defaultMcpBackend }: { backend?: McpB
|
||||
<div className={page.page}>
|
||||
<div className={page.header}>
|
||||
<h2 className={page.title}>
|
||||
<T>External MCP Servers</T>
|
||||
<T>MCP Connections</T>
|
||||
</h2>
|
||||
<div className={page.headerActions}>
|
||||
<Button
|
||||
|
||||
@@ -202,6 +202,8 @@
|
||||
overflow-x: hidden;
|
||||
overflow-anchor: none;
|
||||
padding: var(--space-3);
|
||||
/* Room below the end that keeps the header of a section folded there in place (`Stream`). */
|
||||
padding-bottom: calc(var(--space-3) + var(--stream-slack, 0px));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-size: var(--agent-fs-ui, var(--fs-ui));
|
||||
|
||||
@@ -32,7 +32,7 @@ function FormWrapper({ children }: { children: ReactNode }) {
|
||||
return <SettingsFormContext.Provider value={form}>{children}</SettingsFormContext.Provider>;
|
||||
}
|
||||
|
||||
describe("Command Permissions sub-page", () => {
|
||||
describe("Command Rules sub-page", () => {
|
||||
it("registers under Agents group in settings", () => {
|
||||
const dispose = activateSettingsPages();
|
||||
try {
|
||||
@@ -40,7 +40,7 @@ describe("Command Permissions sub-page", () => {
|
||||
const agentsGroup = tree.find((n) => n.title === AGENTS_GROUP);
|
||||
expect(agentsGroup).toBeDefined();
|
||||
const policyNode = agentsGroup?.children.find((n) => n.key === POLICY_PAGE);
|
||||
expect(policyNode?.title).toBe("Command Permissions");
|
||||
expect(policyNode?.title).toBe("Command Rules");
|
||||
// A project's settings file can't decide what agents run without asking.
|
||||
expect(policyNode?.page?.projectScope).not.toBe(true);
|
||||
} finally {
|
||||
@@ -56,7 +56,7 @@ describe("Command Permissions sub-page", () => {
|
||||
</FormWrapper>,
|
||||
);
|
||||
|
||||
const policy = screen.getByRole("region", { name: "Command Permissions" });
|
||||
const policy = screen.getByRole("region", { name: "Command Rules" });
|
||||
expect(within(policy).getByText("rm -rf *")).toBeInTheDocument();
|
||||
|
||||
fireEvent.change(within(policy).getByRole("textbox", { name: "Allowed command pattern" }), {
|
||||
|
||||
@@ -313,7 +313,7 @@ export function activate(): () => void {
|
||||
{
|
||||
id: "agents.addAgent",
|
||||
title: "More Agents…",
|
||||
description: "Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.",
|
||||
description: "Install, update, or remove agents from the ACP Registry.",
|
||||
category: "Agents",
|
||||
icon: "plugin",
|
||||
keywords: ["agent", "acp", "registry", "install", "update"],
|
||||
@@ -321,12 +321,11 @@ export function activate(): () => void {
|
||||
},
|
||||
{
|
||||
id: "agents.mcpServers",
|
||||
title: "External MCP Servers…",
|
||||
description:
|
||||
"Opens Settings › Agents › External MCP Servers: configures the User and Workspace MCP servers coding agents use.",
|
||||
title: "MCP Connections…",
|
||||
description: "Configure the MCP servers that agents can use.",
|
||||
category: "Agents",
|
||||
icon: "settings",
|
||||
keywords: ["mcp", "model context protocol", "servers", "tools", "agent"],
|
||||
keywords: ["mcp", "model context protocol", "servers", "tools", "agent", "External MCP Servers"],
|
||||
run: () => void executeAction("file.settings", MCP_PAGE),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Shared MCP server model, multi-level inheritance resolution (IDE -> Project -> Global -> Agent CLI),
|
||||
* and reactive cache for Settings › Agents › External MCP Servers and the Composer MCP picker.
|
||||
* and reactive cache for Settings › Agents › MCP Connections and the Composer MCP picker.
|
||||
*/
|
||||
import { useEffect } from "react";
|
||||
import { create } from "zustand";
|
||||
|
||||
@@ -7,15 +7,15 @@ 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 › Agents › Coding Agents: the agents this machine runs. */
|
||||
/** Settings › Agents › Agent Setup. */
|
||||
export const REGISTRY_PAGE = "agents.list";
|
||||
/** The Settings folder holding the agent pages. */
|
||||
export const AGENTS_GROUP = "Agents";
|
||||
/** Settings › Agents › External MCP Servers: User and Workspace MCP configurations. */
|
||||
/** Settings › Agents › MCP Connections. */
|
||||
export const MCP_PAGE = "agents.mcpServers";
|
||||
/** Settings › Agents › Skills: every CLI's SKILL.md folders and their modes. */
|
||||
export const SKILLS_PAGE = "agents.skills";
|
||||
/** Settings › Agents › Command Permissions. */
|
||||
/** Settings › Agents › Command Rules. */
|
||||
export const POLICY_PAGE = "agents.policy";
|
||||
|
||||
export const sessionKey = (task: string) => `agent:${task}`;
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { AgentProvider } from "@/bindings";
|
||||
import type { tx as Tx } from "@/platform/i18n";
|
||||
import type { SelectOption } from "@/ui";
|
||||
|
||||
/** Picker entry that opens Settings › Tools › Agents instead of choosing an agent. */
|
||||
/** Picker entry that opens Settings › Agents › Agent Setup. */
|
||||
export const ADD_AGENT = "__addAgent__";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createContext, useContext, useLayoutEffect, useRef, useState, type ReactElement, type ReactNode } from "react";
|
||||
import { createContext, useContext, useRef, useState, type ReactElement, type ReactNode } from "react";
|
||||
import { flushSync } from "react-dom";
|
||||
|
||||
/** Set while Find in Conversation is open: folded sections render their content, so it is found. */
|
||||
export const FoldedContent = createContext(false);
|
||||
@@ -9,8 +10,8 @@ export const FoldedContent = createContext(false);
|
||||
*/
|
||||
export const OpenFolds = createContext<Map<string, boolean> | null>(null);
|
||||
|
||||
/** Scrolls a section the reader just opened into view (`Stream`). */
|
||||
export const RevealFold = createContext<((el: HTMLElement) => void) | null>(null);
|
||||
/** Puts a section's header back at `top` (viewport px) after the reader opened or closed it (`Stream`). */
|
||||
export const KeepFoldHeader = createContext<((header: HTMLElement, top: number) => void) | null>(null);
|
||||
|
||||
/**
|
||||
* A collapsed section that renders its content only once opened: most of a long conversation
|
||||
@@ -35,29 +36,38 @@ export function Fold({
|
||||
}) {
|
||||
const always = useContext(FoldedContent);
|
||||
const remembered = useContext(OpenFolds);
|
||||
const reveal = useContext(RevealFold);
|
||||
const keepHeader = useContext(KeepFoldHeader);
|
||||
const [expanded, setExpanded] = useState(() => !!open || !!defaultOpen || (!!id && !!remembered?.get(id)));
|
||||
const ref = useRef<HTMLDetailsElement>(null);
|
||||
const opened = useRef(false);
|
||||
// Once its content is laid out, so its height is known.
|
||||
useLayoutEffect(() => {
|
||||
if (!expanded || !opened.current) return;
|
||||
opened.current = false;
|
||||
if (ref.current) reveal?.(ref.current);
|
||||
}, [expanded, reveal]);
|
||||
const remember = (now: boolean) => {
|
||||
if (!id || !remembered) return;
|
||||
if (now) remembered.set(id, true);
|
||||
else remembered.delete(id);
|
||||
};
|
||||
return (
|
||||
<details
|
||||
ref={ref}
|
||||
className={className}
|
||||
open={open || ((!!id || defaultOpen) && expanded) || undefined}
|
||||
// Toggle here rather than natively: the content renders in the same frame, and the header
|
||||
// is put back where it was before anything paints.
|
||||
onClick={(e) => {
|
||||
const details = ref.current;
|
||||
const header = e.target instanceof Element ? e.target.closest("summary") : null;
|
||||
if (e.defaultPrevented || !details || !header || header.parentElement !== details) return;
|
||||
if ((e.target as Element).closest("a, button, input, select, textarea, label") !== null) return;
|
||||
e.preventDefault();
|
||||
const top = header.getBoundingClientRect().top;
|
||||
const now = !details.open;
|
||||
details.open = now;
|
||||
remember(now);
|
||||
flushSync(() => setExpanded(now));
|
||||
keepHeader?.(header, top);
|
||||
}}
|
||||
onToggle={(e) => {
|
||||
const now = e.currentTarget.open;
|
||||
opened.current = now;
|
||||
setExpanded(now);
|
||||
if (id && remembered) {
|
||||
if (now) remembered.set(id, true);
|
||||
else remembered.delete(id);
|
||||
}
|
||||
remember(now);
|
||||
}}
|
||||
>
|
||||
{summary}
|
||||
|
||||
@@ -49,7 +49,7 @@ import {
|
||||
type EntryRow,
|
||||
} from "./conversationRows";
|
||||
import { FindBar } from "./FindBar";
|
||||
import { OpenFolds, RevealFold } from "./Folds";
|
||||
import { KeepFoldHeader, OpenFolds } from "./Folds";
|
||||
import { Entry } from "./messages";
|
||||
import { ProcessRun, TurnFold } from "./ProcessRows";
|
||||
import { type QuestionAnswer } from "./QuestionForm";
|
||||
@@ -169,15 +169,31 @@ interface StreamProps {
|
||||
/** Entries rendered at a time when a conversation opens at its end. */
|
||||
const ENTRY_BATCH = 40;
|
||||
|
||||
function scrollsInside(target: EventTarget | null, root: HTMLElement): boolean {
|
||||
function scrollsY(el: Element): boolean {
|
||||
if (el.scrollHeight - el.clientHeight <= 1) return false;
|
||||
const overflow = getComputedStyle(el).overflowY;
|
||||
return overflow === "auto" || overflow === "scroll";
|
||||
}
|
||||
|
||||
/** The innermost container under `target` that scrolls vertically: a tool output, a run of calls, or `root`. */
|
||||
function scrollOwner(target: EventTarget | null, root: HTMLElement): HTMLElement {
|
||||
for (let el = target instanceof Element ? target : null; el && el !== root; el = el.parentElement) {
|
||||
if (el.scrollTop <= 0) continue;
|
||||
const overflow = getComputedStyle(el).overflowY;
|
||||
if (overflow === "auto" || overflow === "scroll") return true;
|
||||
if (el instanceof HTMLElement && scrollsY(el)) return el;
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
/** Whether a container inside `root` under `target` can still scroll up. */
|
||||
function scrollsUpInside(target: EventTarget | null, root: HTMLElement): boolean {
|
||||
for (let el = target instanceof Element ? target : null; el && el !== root; el = el.parentElement) {
|
||||
if (el.scrollTop > 0 && scrollsY(el)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** A wheel gesture's events arrive closer together than this; a pause starts a new one. */
|
||||
const WHEEL_GESTURE_MS = 150;
|
||||
|
||||
export function Stream({
|
||||
loadError,
|
||||
task,
|
||||
@@ -199,7 +215,7 @@ export function Stream({
|
||||
const restored = useRef(false);
|
||||
const previousLength = useRef(entries?.length ?? 0);
|
||||
/** Scrolled away from the end: offer one click back to the latest message. */
|
||||
const [away, setAway] = useState(() => positions.get(key)?.stick === false);
|
||||
const [away, setAway] = useState(false);
|
||||
// Opened at the end, the last entries come first and the earlier ones follow in batches:
|
||||
// reopening a long conversation paints at once. A kept offset needs them all.
|
||||
const [shown, setShown] = useState(() => (positions.get(key)?.stick === false ? Infinity : ENTRY_BATCH));
|
||||
@@ -223,15 +239,22 @@ export function Stream({
|
||||
const stopFollowing = useCallback(
|
||||
(target: EventTarget | null) => {
|
||||
const el = ref.current;
|
||||
if (!el || el.scrollHeight <= el.clientHeight || scrollsInside(target, el)) return;
|
||||
if (!el || el.scrollHeight <= el.clientHeight || scrollsUpInside(target, el)) return;
|
||||
scrollingUp.current = true;
|
||||
if (!position.current.stick) return;
|
||||
position.current = { top: el.scrollTop, stick: false };
|
||||
positions.set(key, position.current);
|
||||
setAway(true);
|
||||
},
|
||||
[key, positions],
|
||||
);
|
||||
const updateJumpVisibility = useCallback((el: HTMLElement) => {
|
||||
// An upward gesture releases following before anything moves. Only offer a jump
|
||||
// when there is actual content below the viewport, excluding the fold spacer.
|
||||
setAway(
|
||||
!position.current.stick &&
|
||||
el.scrollHeight - el.clientHeight - el.scrollTop > (parseFloat(getComputedStyle(el).paddingBottom) || 0) + 1,
|
||||
);
|
||||
}, []);
|
||||
// Earlier entries are prepended above the view: remember where the first painted row is
|
||||
// so the content stays put and the scrollbar doesn't jump under the pointer.
|
||||
const anchor = useRef<{ el: Element; top: number } | null>(null);
|
||||
@@ -285,11 +308,31 @@ export function Stream({
|
||||
const visible = useEditorShown();
|
||||
const { foldTurns, toolCalls, fitWindowWidth } = useAgentSettings();
|
||||
useOffscreenRows(ref, visible, !finding, fitWindowWidth, fontZoom);
|
||||
/**
|
||||
* Blank space after the conversation that lets a section folded near the end keep its header
|
||||
* in place. It is only ever what the view shows below the content: scrolling up or new rows
|
||||
* take it back without moving anything.
|
||||
*/
|
||||
const slack = useRef(0);
|
||||
const setSlack = useCallback((px: number) => {
|
||||
slack.current = px;
|
||||
if (px) ref.current?.style.setProperty("--stream-slack", `${px}px`);
|
||||
else ref.current?.style.removeProperty("--stream-slack");
|
||||
}, []);
|
||||
const trimSlack = useCallback(() => {
|
||||
const el = ref.current;
|
||||
if (!el || slack.current === 0) return;
|
||||
const content = el.scrollHeight - slack.current;
|
||||
const next = Math.max(0, Math.min(slack.current, Math.ceil(el.scrollTop + el.clientHeight - content)));
|
||||
if (next !== slack.current) setSlack(next);
|
||||
}, [setSlack]);
|
||||
/** A diagram that drew after the last streamed chunk grows the conversation: keep following. */
|
||||
const onDiagramDrawn = useCallback(() => {
|
||||
const el = ref.current;
|
||||
if (el && position.current.stick && !dragging.current) el.scrollTop = el.scrollHeight;
|
||||
}, []);
|
||||
if (!el) return;
|
||||
if (position.current.stick && !dragging.current) el.scrollTop = el.scrollHeight;
|
||||
updateJumpVisibility(el);
|
||||
}, [updateJumpVisibility]);
|
||||
useLayoutEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el || entries === null || !visible) return;
|
||||
@@ -314,10 +357,12 @@ export function Stream({
|
||||
useLayoutEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el || entries === null || !visible) return;
|
||||
trimSlack();
|
||||
if (position.current.stick) {
|
||||
if (!dragging.current) el.scrollTop = el.scrollHeight;
|
||||
} else if (!restored.current) el.scrollTop = position.current.top;
|
||||
restored.current = true;
|
||||
updateJumpVisibility(el);
|
||||
});
|
||||
useLayoutEffect(() => {
|
||||
// Prepending earlier entries moved the first painted row down: follow it, so the same
|
||||
@@ -328,52 +373,80 @@ export function Stream({
|
||||
anchor.current = null;
|
||||
if (position.current.stick || !from.el.isConnected) return;
|
||||
scroller.scrollTop += from.el.getBoundingClientRect().top - from.top;
|
||||
updateJumpVisibility(scroller);
|
||||
});
|
||||
useLayoutEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el) return;
|
||||
const observer = new ResizeObserver(() => {
|
||||
trimSlack();
|
||||
if (position.current.stick && !dragging.current) el.scrollTop = el.scrollHeight;
|
||||
updateJumpVisibility(el);
|
||||
});
|
||||
observer.observe(el);
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
if (restored.current) positions.set(key, { ...position.current, top: el.scrollTop });
|
||||
};
|
||||
}, [key, positions]);
|
||||
// How far the end was below the view when a section was toggled, before its content renders.
|
||||
const gapAtToggle = useRef(Infinity);
|
||||
}, [key, positions, trimSlack, updateJumpVisibility]);
|
||||
/**
|
||||
* The wheel scrolls the innermost container under the pointer, and only that one: a run of
|
||||
* calls from its headers, a tool output from its text, the conversation elsewhere. A container
|
||||
* at its edge doesn't hand the rest to the conversation; a gesture stays with the container
|
||||
* it started in.
|
||||
*/
|
||||
useEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el) return;
|
||||
const toggled = () => {
|
||||
gapAtToggle.current = el.scrollHeight - el.scrollTop - el.clientHeight;
|
||||
let gesture: { owner: HTMLElement; at: number } | null = null;
|
||||
const onWheel = (e: WheelEvent) => {
|
||||
if (e.defaultPrevented || e.ctrlKey || e.metaKey) return;
|
||||
if (e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
|
||||
const now = performance.now();
|
||||
const latched = gesture && now - gesture.at < WHEEL_GESTURE_MS && gesture.owner.isConnected;
|
||||
const owner = latched ? gesture!.owner : scrollOwner(e.target, el);
|
||||
gesture = { owner, at: now };
|
||||
if (owner !== el) {
|
||||
const room = e.deltaY < 0 ? owner.scrollTop : owner.scrollHeight - owner.clientHeight - owner.scrollTop;
|
||||
if (room <= 1) e.preventDefault();
|
||||
return;
|
||||
}
|
||||
markUserScroll();
|
||||
if (e.deltaY < 0) stopFollowing(e.target);
|
||||
else if (e.deltaY > 0) scrollingUp.current = false;
|
||||
};
|
||||
el.addEventListener("toggle", toggled, true);
|
||||
return () => el.removeEventListener("toggle", toggled, true);
|
||||
}, []);
|
||||
el.addEventListener("wheel", onWheel, { passive: false });
|
||||
return () => el.removeEventListener("wheel", onWheel);
|
||||
}, [markUserScroll, stopFollowing]);
|
||||
/**
|
||||
* An opened section grew the conversation below its header: with the end in view, stay at
|
||||
* it; otherwise bring what it shows into view. Either way its header stays on screen, and
|
||||
* following stops when that leaves the end out of view.
|
||||
* The reader opened or closed a section: put its header back where it was, in the run or
|
||||
* output that scrolls it and then in the conversation. Following stops when that leaves any
|
||||
* of the end out of view, so the next chunk doesn't pull the header away.
|
||||
*/
|
||||
const revealFold = useCallback(
|
||||
(fold: HTMLElement) => {
|
||||
const keepFoldHeader = useCallback(
|
||||
(header: HTMLElement, top: number) => {
|
||||
const el = ref.current;
|
||||
if (!el || dragging.current) return;
|
||||
const view = el.getBoundingClientRect();
|
||||
const box = fold.getBoundingClientRect();
|
||||
const atEnd = position.current.stick || gapAtToggle.current < 40;
|
||||
gapAtToggle.current = Infinity;
|
||||
const below = atEnd ? el.scrollHeight - el.scrollTop - el.clientHeight : box.bottom - view.bottom;
|
||||
if (below > 0) el.scrollTop += Math.max(0, Math.min(below, box.top - view.top));
|
||||
if (atEnd && el.scrollHeight - el.scrollTop - el.clientHeight >= 40) {
|
||||
if (!el?.contains(header)) return;
|
||||
// Opened, the section fills the room left by an earlier fold first.
|
||||
trimSlack();
|
||||
for (let s = header.parentElement; s; s = s.parentElement) {
|
||||
const moved = header.getBoundingClientRect().top - top;
|
||||
if (Math.abs(moved) < 1) break;
|
||||
if (s === el) {
|
||||
const short = Math.ceil(el.scrollTop + moved + el.clientHeight - el.scrollHeight);
|
||||
if (short > 0) setSlack(slack.current + short);
|
||||
el.scrollTop += moved;
|
||||
break;
|
||||
}
|
||||
if (scrollsY(s)) s.scrollTop += moved;
|
||||
}
|
||||
if (position.current.stick && el.scrollHeight - el.scrollTop - el.clientHeight >= 1) {
|
||||
position.current = { top: el.scrollTop, stick: false };
|
||||
positions.set(key, position.current);
|
||||
setAway(true);
|
||||
}
|
||||
updateJumpVisibility(el);
|
||||
},
|
||||
[key, positions],
|
||||
[key, positions, setSlack, trimSlack, updateJumpVisibility],
|
||||
);
|
||||
/** Back to the end of the stream; following resumes from there. */
|
||||
const jumpToLatest = useCallback(() => {
|
||||
@@ -454,7 +527,7 @@ export function Stream({
|
||||
);
|
||||
return (
|
||||
<OpenFolds.Provider value={openFolds}>
|
||||
<RevealFold.Provider value={revealFold}>
|
||||
<KeepFoldHeader.Provider value={keepFoldHeader}>
|
||||
<div className={styles.streamArea}>
|
||||
{finding && <FindBar streamRef={ref} focus={findFocus} onClose={onCloseFind} />}
|
||||
<div
|
||||
@@ -462,12 +535,6 @@ export function Stream({
|
||||
// The conversation is read and copied like a document; focusable so ⌘F reaches it.
|
||||
className={clsx(styles.stream, selectableText)}
|
||||
tabIndex={-1}
|
||||
onWheel={(e) => {
|
||||
if (e.defaultPrevented) return;
|
||||
markUserScroll();
|
||||
if (e.deltaY < 0 && !e.ctrlKey && !e.metaKey) stopFollowing(e.target);
|
||||
else if (e.deltaY > 0 && !e.ctrlKey && !e.metaKey) scrollingUp.current = false;
|
||||
}}
|
||||
onTouchStart={(e) => {
|
||||
touchY.current = e.touches.length === 1 ? e.touches[0]!.clientY : null;
|
||||
}}
|
||||
@@ -497,6 +564,7 @@ export function Stream({
|
||||
}}
|
||||
onScroll={(e) => {
|
||||
const el = e.currentTarget;
|
||||
trimSlack();
|
||||
const atEnd = el.scrollHeight - el.scrollTop - el.clientHeight < 40;
|
||||
const laidOut =
|
||||
el.scrollHeight !== seenHeight.current.content || el.clientHeight !== seenHeight.current.view;
|
||||
@@ -513,7 +581,7 @@ export function Stream({
|
||||
if (stick && !atEnd && !dragging.current) el.scrollTop = el.scrollHeight;
|
||||
position.current = { top: el.scrollTop, stick };
|
||||
positions.set(key, position.current);
|
||||
setAway(!position.current.stick);
|
||||
updateJumpVisibility(el);
|
||||
// Reached the top of what is painted: fetch the earlier entries, but only
|
||||
// once the drag has settled.
|
||||
if (loadTimer.current !== null) window.clearTimeout(loadTimer.current);
|
||||
@@ -586,7 +654,7 @@ export function Stream({
|
||||
</div>
|
||||
{away && !!entries?.length && <JumpToLatest onJump={jumpToLatest} />}
|
||||
</div>
|
||||
</RevealFold.Provider>
|
||||
</KeepFoldHeader.Provider>
|
||||
</OpenFolds.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -738,6 +738,31 @@ describe("the conversation selection", () => {
|
||||
});
|
||||
|
||||
describe("scrolling", () => {
|
||||
it("hides Jump to Latest while the end is visible even when following has stopped", async () => {
|
||||
render(<SessionEditor input={input("A")} />);
|
||||
await screen.findByText("Answer A");
|
||||
const el = stream();
|
||||
let height = 1000;
|
||||
Object.defineProperty(el, "scrollHeight", { configurable: true, get: () => height });
|
||||
Object.defineProperty(el, "clientHeight", { configurable: true, value: 400 });
|
||||
el.style.paddingBottom = "12px";
|
||||
el.scrollTop = 599.75;
|
||||
fireEvent.scroll(el);
|
||||
fireEvent.wheel(el, { deltaY: -2 });
|
||||
const jump = () => screen.queryByRole("button", { name: "Jump to Latest" });
|
||||
expect(jump()).toBeNull();
|
||||
el.scrollTop = 594;
|
||||
fireEvent.scroll(el);
|
||||
expect(jump()).toBeNull();
|
||||
el.scrollTop = 580;
|
||||
fireEvent.scroll(el);
|
||||
expect(jump()).toBeInTheDocument();
|
||||
// The end moves into view when content shrinks, without a downward gesture.
|
||||
height = 980;
|
||||
fireEvent.scroll(el);
|
||||
expect(jump()).toBeNull();
|
||||
});
|
||||
|
||||
it("returns to the end when the user sends a message while scrolled up", async () => {
|
||||
const reply = { type: "agent", text: "Initial reply" } as AgentEntry;
|
||||
useAgents.setState({ entries: new Map([["A", [reply]]]) });
|
||||
@@ -772,30 +797,26 @@ describe("scrolling", () => {
|
||||
expect(screen.queryByRole("button", { name: "Jump to Latest" })).toBeNull();
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: "stays at the end below it",
|
||||
top: 300,
|
||||
bottom: 360,
|
||||
scrolled: 60,
|
||||
away: false,
|
||||
},
|
||||
{
|
||||
name: "keeps its header on screen",
|
||||
top: 50,
|
||||
bottom: 900,
|
||||
scrolled: 50,
|
||||
away: true,
|
||||
},
|
||||
{
|
||||
name: "back at the end without following",
|
||||
top: 300,
|
||||
bottom: 360,
|
||||
scrolled: 60,
|
||||
away: false,
|
||||
released: true,
|
||||
},
|
||||
])("scrolls a section opened at the end into view: $name", async ({ top, bottom, scrolled, away, released }) => {
|
||||
/** A stream whose height follows its fold and whose offset is clamped like a browser's. */
|
||||
const foldingStream = (openHeight: number) => {
|
||||
const el = stream();
|
||||
const fold = el.querySelector("details")!;
|
||||
const slack = () => parseFloat(el.style.getPropertyValue("--stream-slack")) || 0;
|
||||
const height = () => (fold.children.length > 1 ? 1000 + openHeight : 1000) + slack();
|
||||
let top = 0;
|
||||
Object.defineProperty(el, "scrollHeight", { configurable: true, get: height });
|
||||
Object.defineProperty(el, "clientHeight", { configurable: true, value: 400 });
|
||||
Object.defineProperty(el, "scrollTop", {
|
||||
configurable: true,
|
||||
get: () => Math.max(0, Math.min(top, height() - 400)),
|
||||
set: (v: number) => {
|
||||
top = Math.max(0, Math.min(v, height() - 400));
|
||||
},
|
||||
});
|
||||
return { el, fold, summary: fold.querySelector("summary")!, slack };
|
||||
};
|
||||
|
||||
it("keeps the header of a section opened at the end in place and stops following", async () => {
|
||||
backend.entries.set("A", [
|
||||
{ type: "thought", text: "Weighing it" },
|
||||
{ type: "agent", text: "Answer A" },
|
||||
@@ -803,43 +824,79 @@ describe("scrolling", () => {
|
||||
useAgents.setState({ entries: new Map(backend.entries) });
|
||||
render(<SessionEditor input={input("A")} />);
|
||||
await screen.findByText("Answer A");
|
||||
const el = stream();
|
||||
Object.defineProperty(el, "scrollHeight", {
|
||||
configurable: true,
|
||||
value: 1000,
|
||||
});
|
||||
Object.defineProperty(el, "clientHeight", {
|
||||
configurable: true,
|
||||
value: 400,
|
||||
});
|
||||
el.getBoundingClientRect = () => ({ top: 0, bottom: 400 }) as DOMRect;
|
||||
const { el, summary } = foldingStream(500);
|
||||
summary.getBoundingClientRect = () => ({ top: 900 - el.scrollTop }) as DOMRect;
|
||||
el.scrollTop = 600;
|
||||
fireEvent.scroll(el);
|
||||
if (released) {
|
||||
fireEvent.wheel(el, { deltaY: -50 });
|
||||
el.scrollTop = 550;
|
||||
fireEvent.scroll(el);
|
||||
el.scrollTop = 600;
|
||||
fireEvent.scroll(el);
|
||||
expect(screen.getByRole("button", { name: "Jump to Latest" })).toBeInTheDocument();
|
||||
}
|
||||
const fold = stream().querySelector("details")!;
|
||||
fold.getBoundingClientRect = () => ({ top, bottom }) as DOMRect;
|
||||
// It grows once its content renders.
|
||||
Object.defineProperty(el, "scrollHeight", {
|
||||
configurable: true,
|
||||
get: () => (fold.children.length > 1 ? 1000 + bottom - top : 1000),
|
||||
});
|
||||
fireEvent.pointerDown(fold);
|
||||
fireEvent.pointerUp(fold);
|
||||
fold.open = true;
|
||||
act(() => {
|
||||
fireEvent(fold, new Event("toggle"));
|
||||
});
|
||||
expect(el.scrollTop).toBe(600 + scrolled);
|
||||
fireEvent.click(summary);
|
||||
expect(el.scrollTop).toBe(600);
|
||||
expect(screen.getByRole("button", { name: "Jump to Latest" })).toBeInTheDocument();
|
||||
act(() =>
|
||||
useAgents.setState({
|
||||
entries: new Map([["A", [...backend.entries.get("A")!, { type: "agent", text: "More" }]]]),
|
||||
}),
|
||||
);
|
||||
expect(el.scrollTop).toBe(600);
|
||||
});
|
||||
|
||||
it("keeps the header of a section closed at the end in place", async () => {
|
||||
backend.entries.set("A", [
|
||||
{ type: "thought", text: "Weighing it" },
|
||||
{ type: "agent", text: "Answer A" },
|
||||
]);
|
||||
useAgents.setState({ entries: new Map(backend.entries) });
|
||||
render(<SessionEditor input={input("A")} />);
|
||||
await screen.findByText("Answer A");
|
||||
const { el, fold, summary, slack } = foldingStream(500);
|
||||
summary.getBoundingClientRect = () => ({ top: 1200 - el.scrollTop }) as DOMRect;
|
||||
fireEvent.click(summary);
|
||||
expect(fold.open).toBe(true);
|
||||
el.scrollTop = 1100;
|
||||
fireEvent.scroll(el);
|
||||
// With the end out of view, the next chunk doesn't pull the reader away from the section.
|
||||
expect(screen.queryByRole("button", { name: "Jump to Latest" }) !== null).toBe(away);
|
||||
// Closing it would pull the end up to 600: room below keeps the header at 100.
|
||||
fireEvent.click(summary);
|
||||
expect(fold.open).toBe(false);
|
||||
expect(el.scrollTop).toBe(1100);
|
||||
expect(slack()).toBe(500);
|
||||
// Scrolling up takes the room back without moving the content.
|
||||
el.scrollTop = 1000;
|
||||
fireEvent.scroll(el);
|
||||
expect(slack()).toBe(400);
|
||||
expect(el.scrollTop).toBe(1000); // Opened again, the section fills that room first: nothing moves and no blank is left below.
|
||||
fireEvent.click(summary);
|
||||
expect(fold.open).toBe(true);
|
||||
expect(slack()).toBe(0);
|
||||
expect(el.scrollTop).toBe(1000);
|
||||
});
|
||||
|
||||
it("scrolls the innermost container under the wheel and never hands it to the conversation", () => {
|
||||
const transcript: AgentEntry[] = [tool("live", { status: "running", output: "Tool output" })];
|
||||
useAgents.setState({ entries: new Map([["A", transcript]]) });
|
||||
render(<SessionEditor input={input("A")} />);
|
||||
const el = stream();
|
||||
Object.defineProperty(el, "scrollHeight", { configurable: true, value: 1000 });
|
||||
Object.defineProperty(el, "clientHeight", { configurable: true, value: 400 });
|
||||
el.scrollTop = 600;
|
||||
fireEvent.scroll(el);
|
||||
const output = screen.getByText("Tool output");
|
||||
output.style.overflowY = "auto";
|
||||
Object.defineProperty(output, "scrollHeight", { configurable: true, value: 300 });
|
||||
Object.defineProperty(output, "clientHeight", { configurable: true, value: 100 });
|
||||
let now = 0;
|
||||
vi.spyOn(performance, "now").mockImplementation(() => now);
|
||||
// At its top, scrolling up over it stays with it.
|
||||
output.scrollTop = 0;
|
||||
expect(fireEvent.wheel(output, { deltaY: -4 })).toBe(false);
|
||||
now = 1000;
|
||||
output.scrollTop = 100;
|
||||
expect(fireEvent.wheel(output, { deltaY: -4 })).toBe(true);
|
||||
expect(screen.queryByRole("button", { name: "Jump to Latest" })).toBeNull();
|
||||
// A gesture that started in the conversation stays there when the output slides under it.
|
||||
now = 2000;
|
||||
expect(fireEvent.wheel(el, { deltaY: -4 })).toBe(true);
|
||||
now = 2050;
|
||||
output.scrollTop = 0;
|
||||
expect(fireEvent.wheel(output, { deltaY: -4 })).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps following when the view grows taller and the browser pulls the offset back", () => {
|
||||
@@ -989,6 +1046,8 @@ describe("scrolling", () => {
|
||||
value: 400,
|
||||
});
|
||||
output.style.overflowY = "auto";
|
||||
Object.defineProperty(output, "scrollHeight", { configurable: true, value: 300 });
|
||||
Object.defineProperty(output, "clientHeight", { configurable: true, value: 100 });
|
||||
output.scrollTop = 100;
|
||||
el.scrollTop = 600;
|
||||
fireEvent.scroll(el);
|
||||
@@ -2529,7 +2588,7 @@ describe("import sessions dialog", () => {
|
||||
backend.external = sessions;
|
||||
open();
|
||||
await listed("Login fix");
|
||||
expect(screen.getByRole("dialog", { name: "Import Sessions from Other Apps" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("dialog", { name: "Import Sessions" })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("imports the selected session and opens it", async () => {
|
||||
|
||||
@@ -2,24 +2,23 @@ import { lazyComponent } from "@/ui";
|
||||
import { registerSettingsPages } from "@/workbench/contributions";
|
||||
import { AGENTS_GROUP, MCP_PAGE, POLICY_PAGE, REGISTRY_PAGE, SKILLS_PAGE } from "./model";
|
||||
|
||||
/** Settings › Agents › Coding Agents, External MCP Servers, Skills, and Command Permissions (also used by the Settings window). */
|
||||
export function activateSettingsPages(): () => void {
|
||||
return registerSettingsPages([
|
||||
{
|
||||
id: REGISTRY_PAGE,
|
||||
title: "Coding Agents",
|
||||
title: "Agent Setup",
|
||||
group: AGENTS_GROUP,
|
||||
// First in Agents, which sits after Languages & Frameworks and before Tools.
|
||||
order: 450,
|
||||
keywords: ["agent", "acp", "registry", "install", "update", "coding agent"],
|
||||
keywords: ["agent", "acp", "registry", "install", "update", "Coding Agents"],
|
||||
component: lazyComponent(() => import("./AgentRegistryPage").then((m) => m.AgentRegistryPage)),
|
||||
},
|
||||
{
|
||||
id: MCP_PAGE,
|
||||
title: "External MCP Servers",
|
||||
title: "MCP Connections",
|
||||
group: AGENTS_GROUP,
|
||||
order: 475,
|
||||
keywords: ["mcp", "model context protocol", "servers", "tools", "agent"],
|
||||
keywords: ["mcp", "model context protocol", "servers", "tools", "agent", "External MCP Servers"],
|
||||
component: lazyComponent(() => import("./McpServersPage").then((m) => m.McpServersPage)),
|
||||
},
|
||||
{
|
||||
@@ -32,10 +31,10 @@ export function activateSettingsPages(): () => void {
|
||||
},
|
||||
{
|
||||
id: POLICY_PAGE,
|
||||
title: "Command Permissions",
|
||||
title: "Command Rules",
|
||||
group: AGENTS_GROUP,
|
||||
order: 490,
|
||||
keywords: ["agent", "policy", "security", "whitelist", "blacklist", "permission", "command", "exec"],
|
||||
keywords: ["agent", "policy", "security", "whitelist", "blacklist", "Command Permissions", "exec"],
|
||||
component: lazyComponent(() => import("./AgentPolicyPage").then((m) => m.AgentPolicyPage)),
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -136,7 +136,7 @@ interface AgentsState {
|
||||
external: ExternalSession[];
|
||||
/** Why the external sessions could not be listed. */
|
||||
externalError: string | null;
|
||||
/** The Import Sessions from Other Apps dialog is open. */
|
||||
/** The Import Sessions dialog is open. */
|
||||
importOpen: boolean;
|
||||
/** External sessions being imported (`provider:sessionId`), so none is imported twice. */
|
||||
importing: ReadonlySet<string>;
|
||||
|
||||
@@ -213,11 +213,11 @@ export function groupMenu(group: OrganizeGroup): MenuItem[] {
|
||||
export const taskActions: Action[] = [
|
||||
{
|
||||
id: "agents.importSessions",
|
||||
title: "Import Sessions from Other Apps…",
|
||||
title: "Import Sessions…",
|
||||
category: "Agents",
|
||||
icon: "download",
|
||||
when: "projectOpen",
|
||||
keywords: ["import", "claude", "codex", "history", "transcript"],
|
||||
keywords: ["import", "other apps", "claude", "codex", "history", "transcript"],
|
||||
run: showImportSessions,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
buildBranchRows,
|
||||
buildBranchTree,
|
||||
buildMergedBranchTree,
|
||||
mergedRefTooltip,
|
||||
filterBranchTree,
|
||||
isFavoriteBranch,
|
||||
preferredBranchRow,
|
||||
@@ -371,6 +372,22 @@ describe("buildMergedBranchTree", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("names each repository of a shared ref in its tooltip", () => {
|
||||
const tree = buildMergedBranchTree(
|
||||
[
|
||||
repo("/b", [b("dev", { upstream: "origin/dev" }), b("origin/dev", { remote: true })], ["v1"]),
|
||||
repo("/a", [b("dev"), b("origin/dev", { remote: true }), b("solo")], ["v1"]),
|
||||
],
|
||||
null,
|
||||
null,
|
||||
);
|
||||
const name = (root: string) => root.slice(1);
|
||||
expect(mergedRefTooltip(find(tree, "b:dev")!, name)).toBe("a: dev (no tracking branch)\nb: dev → origin/dev");
|
||||
expect(mergedRefTooltip(find(tree, "b:origin/dev")!, name)).toBe("a\nb");
|
||||
expect(mergedRefTooltip(find(tree, "t:v1")!, name)).toBe("a\nb");
|
||||
expect(mergedRefTooltip(find(tree, "b:solo")!, name)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("merges tags by name", () => {
|
||||
const tree = buildMergedBranchTree([repo("/a", [], ["v1"]), repo("/b", [], ["v1", "v2"])], null, null);
|
||||
expect(find(tree, "t:v1")?.repos).toEqual(["/a", "/b"]);
|
||||
|
||||
@@ -581,6 +581,24 @@ export function buildMergedBranchTree(
|
||||
return withRepos(buildBranchTree(branches, favorites, [...tagRoots.keys()]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tooltip of a merged-tree ref in several repositories: one line per repository, sorted by
|
||||
* name; a local branch also shows the branch it tracks there.
|
||||
*/
|
||||
export function mergedRefTooltip(n: BranchTreeNode, nameOf: (root: string) => string): string | undefined {
|
||||
if (!n.repos || n.repos.length < 2) return undefined;
|
||||
const local = n.branch && !n.branch.remote;
|
||||
return n.repos
|
||||
.map((root) => {
|
||||
const name = nameOf(root);
|
||||
if (!local) return name;
|
||||
const upstream = n.branchesByRoot?.get(root)?.upstream;
|
||||
return `${name}: ${n.ref} ${upstream ? `→ ${upstream}` : tx("(no tracking branch)")}`;
|
||||
})
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
/** Keys of the nodes on the way to branch `name` (to reveal it). */
|
||||
export function branchFolderKeys(nodes: readonly BranchTreeNode[], name: string): string[] {
|
||||
const walk = (list: readonly BranchTreeNode[]): string[] | null => {
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
buildRepositoryBranchTree,
|
||||
filterBranchTree,
|
||||
isFavoriteBranch,
|
||||
mergedRefTooltip,
|
||||
type BranchTreeNode,
|
||||
} from "../branches";
|
||||
import { branchMenu, inRepo, mergedBranchMenu, showTagContextMenu } from "../branchMenu";
|
||||
@@ -364,6 +365,7 @@ export function BranchesPanel() {
|
||||
: undefined;
|
||||
return branchDetail(n, availableRepositories.length, sync);
|
||||
}}
|
||||
getTooltip={(n) => mergedRefTooltip(n, (r) => repoName(branchRoots[r] ?? r))}
|
||||
selected={selected}
|
||||
onSelectionChange={(sel) => setSelected(sel)}
|
||||
onActivate={(n) => {
|
||||
|
||||
@@ -541,8 +541,7 @@
|
||||
"Rename Agent Task Group": "Rename Agent Task Group",
|
||||
"Remove Agent Task Group": "Remove Agent Task Group",
|
||||
"Import Sessions…": "Import Sessions…",
|
||||
"Import Sessions from Other Apps…": "Import Sessions from Other Apps…",
|
||||
"Import Sessions from Other Apps": "Import Sessions from Other Apps",
|
||||
"Import Sessions": "Import Sessions",
|
||||
"No sessions from other apps": "No sessions from other apps",
|
||||
"Already importing": "Already importing",
|
||||
"Filter sessions": "Filter sessions",
|
||||
@@ -1876,6 +1875,9 @@
|
||||
"An update for this agent is already running.": "An update for this agent is already running.",
|
||||
"This is not a global npm install OpenIDEA can update. Use its original installer.": "This is not a global npm install OpenIDEA can update. Use its original installer.",
|
||||
"Coding Agents": "Coding Agents",
|
||||
"Agent Setup": "Agent Setup",
|
||||
"Command Rules": "Command Rules",
|
||||
"Install, update, or remove agents from the ACP Registry.": "Install, update, or remove agents from the ACP Registry.",
|
||||
"Install coding agents and configure how they launch, chat and connect to the IDE.": "Install coding agents and configure how they launch, chat and connect to the IDE.",
|
||||
"Fork Agent Task": "Fork Agent Task",
|
||||
"Couldn't fork the task": "Couldn't fork the task",
|
||||
@@ -1941,6 +1943,7 @@
|
||||
"Copy Server Name": "Copy Server Name",
|
||||
"Delete Server": "Delete Server",
|
||||
"External MCP Servers": "External MCP Servers",
|
||||
"MCP Connections": "MCP Connections",
|
||||
"Import MCP servers from .mcp.json and .vscode/mcp.json": "Import MCP servers from .mcp.json and .vscode/mcp.json",
|
||||
"An open standard that lets AI use external tools and services. MCP servers provide tools for file operations, databases, APIs, and more.": "An open standard that lets AI use external tools and services. MCP servers provide tools for file operations, databases, APIs, and more.",
|
||||
"Learn more about MCP servers": "Learn more about MCP servers",
|
||||
@@ -1965,8 +1968,8 @@
|
||||
"sse (Server-Sent Events)": "sse (Server-Sent Events)",
|
||||
"One KEY=VALUE entry per line.": "One KEY=VALUE entry per line.",
|
||||
"One Header=Value entry per line.": "One Header=Value entry per line.",
|
||||
"External MCP Servers…": "External MCP Servers…",
|
||||
"Opens Settings › Agents › External MCP Servers: configures the User and Workspace MCP servers coding agents use.": "Opens Settings › Agents › External MCP Servers: configures the User and Workspace MCP servers coding agents use.",
|
||||
"MCP Connections…": "MCP Connections…",
|
||||
"Configure the MCP servers that agents can use.": "Configure the MCP servers that agents can use.",
|
||||
"No matching remote branches": "No matching remote branches",
|
||||
"Remote branches": "Remote branches",
|
||||
"Fetch tags": "Fetch tags",
|
||||
@@ -3463,6 +3466,7 @@
|
||||
"Rename branch {name} ({root})": "Rename branch {name} ({root})",
|
||||
"rename it back to {name}": "rename it back to {name}",
|
||||
"Unset upstream of {to} ({root})": "Unset upstream of {to} ({root})",
|
||||
"(no tracking branch)": "(no tracking branch)",
|
||||
"Group by Repository": "Group by Repository",
|
||||
"Diagnose with Agent": "Diagnose with Agent",
|
||||
"Adds a failed test's name, source location, expected and actual values and output to the agent message typed last, to review and send.": "Adds a failed test's name, source location, expected and actual values and output to the agent message typed last, to review and send.",
|
||||
|
||||
@@ -4844,7 +4844,7 @@
|
||||
"More Agents…": "Más agentes…",
|
||||
"More agents…": "Más agentes…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "Abre Configuración › Compilación, ejecución, despliegue › Maven",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "Abre Configuración › Herramientas › Agentes: instala, actualiza o elimina agentes del Registro ACP.",
|
||||
"Install, update, or remove agents from the ACP Registry.": "Instala, actualiza o elimina agentes del Registro ACP.",
|
||||
"Search agents": "Buscar agentes",
|
||||
"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.": "Los agentes en el Registro ACP son software de terceros. Se ejecutan en esta computadora con sus permisos y pueden leer y modificar sus archivos. Instale únicamente agentes en los que confíe.",
|
||||
"Cannot load the ACP Registry: {error}": "No se puede cargar el Registro ACP: {error}",
|
||||
|
||||
@@ -4699,7 +4699,7 @@
|
||||
"More Agents…": "Plus d'agents…",
|
||||
"More agents…": "Plus d'agents…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "Ouvre Paramètres › Build, exécution, déploiement › Maven",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "Ouvre Paramètres › Outils › Agents : installe, met à jour ou supprime des agents du registre ACP.",
|
||||
"Install, update, or remove agents from the ACP Registry.": "Installez, mettez à jour ou supprimez des agents du registre ACP.",
|
||||
"Search agents": "Rechercher des agents",
|
||||
"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.": "Les agents du registre ACP sont des logiciels tiers. Ils s'exécutent sur cet ordinateur avec vos autorisations et peuvent lire et modifier vos fichiers. N'installez que des agents de confiance.",
|
||||
"Cannot load the ACP Registry: {error}": "Impossible de charger le registre ACP : {error}",
|
||||
|
||||
@@ -4916,7 +4916,7 @@
|
||||
"More Agents…": "더 많은 에이전트…",
|
||||
"More agents…": "더 많은 에이전트…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "설정 › 빌드, 실행, 배포 › Maven을 엽니다",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "설정 › 도구 › 에이전트를 엽니다: ACP Registry에서 에이전트를 설치, 업데이트 또는 제거합니다.",
|
||||
"Install, update, or remove agents from the ACP Registry.": "ACP Registry에서 에이전트를 설치, 업데이트 또는 제거합니다.",
|
||||
"Search agents": "에이전트 검색",
|
||||
"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.": "ACP Registry의 에이전트는 서드파티 소프트웨어입니다. 이 컴퓨터에서 사용자 권한으로 실행되며 파일을 읽고 변경할 수 있습니다. 신뢰할 수 있는 에이전트만 설치하세요.",
|
||||
"Cannot load the ACP Registry: {error}": "ACP Registry를 로드할 수 없습니다: {error}",
|
||||
|
||||
@@ -4795,7 +4795,7 @@
|
||||
"More Agents…": "Więcej agentów…",
|
||||
"More agents…": "Więcej agentów…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "Otwiera Ustawienia › Budowanie, wykonanie, wdrożenie › Maven",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "Otwiera Ustawienia › Narzędzia › Agenci: instaluje, aktualizuje lub usuwa agentów z rejestru ACP Registry.",
|
||||
"Install, update, or remove agents from the ACP Registry.": "Instaluj, aktualizuj lub usuwaj agentów z rejestru ACP.",
|
||||
"Search agents": "Szukaj agentów",
|
||||
"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.": "Agenci w rejestrze ACP Registry są oprogramowaniem firm trzecich. Działają na tym komputerze z Twoimi uprawnieniami i mogą odczytywać oraz modyfikować Twoje pliki. Instaluj wyłącznie zaufanych agentów.",
|
||||
"Cannot load the ACP Registry: {error}": "Nie można wczytać rejestru ACP Registry: {error}",
|
||||
|
||||
@@ -4810,7 +4810,7 @@
|
||||
"More Agents…": "Mais agentes…",
|
||||
"More agents…": "Mais agentes…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "Abre Configurações › Build, Execução, Implantação › Maven",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "Abre Configurações › Ferramentas › Agentes: instala, atualiza ou remove agentes do Registro ACP.",
|
||||
"Install, update, or remove agents from the ACP Registry.": "Instale, atualize ou remova agentes do Registro ACP.",
|
||||
"Search agents": "Pesquisar agentes",
|
||||
"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.": "Os agentes no Registro ACP são softwares de terceiros. Eles são executados neste computador com suas permissões e podem ler e alterar seus arquivos. Instale apenas agentes em que você confia.",
|
||||
"Cannot load the ACP Registry: {error}": "Não é possível carregar o Registro ACP: {error}",
|
||||
|
||||
@@ -194,8 +194,7 @@
|
||||
"Rename Agent Task Group": "Ajan Görev Grubunu Yeniden Adlandır",
|
||||
"Remove Agent Task Group": "Ajan Görev Grubunu Kaldır",
|
||||
"Import Sessions…": "Oturumları İçe Aktar…",
|
||||
"Import Sessions from Other Apps…": "Diğer Uygulamalardan Oturumları İçe Aktar…",
|
||||
"Import Sessions from Other Apps": "Diğer Uygulamalardan Oturumları İçe Aktar",
|
||||
"Import Sessions": "Oturumları İçe Aktar",
|
||||
"No sessions from other apps": "Diğer uygulamalarda oturum bulunamadı",
|
||||
"Already importing": "İçe aktarma zaten sürüyor",
|
||||
"Filter sessions": "Oturumları filtrele",
|
||||
@@ -1388,6 +1387,7 @@
|
||||
"An update for this agent is already running.": "Bu ajan için bir güncelleme zaten sürüyor.",
|
||||
"This is not a global npm install OpenIDEA can update. Use its original installer.": "Bu, OpenIDEA'nın güncelleyebileceği genel bir npm kurulumu değil. Özgün yükleyicisini kullanın.",
|
||||
"Coding Agents": "Kodlama Ajanları",
|
||||
"Agent Setup": "Ajan Ayarları",
|
||||
"Install coding agents and configure how they launch, chat and connect to the IDE.": "Kodlama ajanlarını yükleyin ve başlatılma, sohbet etme ve IDE'ye bağlanma yöntemlerini yapılandırın.",
|
||||
"Fork Agent Task": "Ajan Görevinden Yeni Dal Oluştur",
|
||||
"Couldn't fork the task": "Görevden yeni dal oluşturulamadı",
|
||||
@@ -1447,6 +1447,7 @@
|
||||
"Copy Server Name": "Sunucu Adını Kopyala",
|
||||
"Delete Server": "Sunucuyu Sil",
|
||||
"External MCP Servers": "Harici MCP Sunucuları",
|
||||
"MCP Connections": "MCP Bağlantıları",
|
||||
"Import MCP servers from .mcp.json and .vscode/mcp.json": "MCP sunucularını .mcp.json ve .vscode/mcp.json dosyalarından içe aktar",
|
||||
"An open standard that lets AI use external tools and services. MCP servers provide tools for file operations, databases, APIs, and more.": "Yapay zekânın harici araç ve hizmetleri kullanmasını sağlayan açık bir standarttır. MCP sunucuları dosya işlemleri, veritabanları, API'ler ve daha fazlası için araçlar sunar.",
|
||||
"Learn more about MCP servers": "MCP sunucuları hakkında daha fazla bilgi",
|
||||
@@ -1466,8 +1467,8 @@
|
||||
"sse (Server-Sent Events)": "sse (Sunucu tarafından gönderilen olaylar)",
|
||||
"One KEY=VALUE entry per line.": "Her satıra bir KEY=VALUE girdisi yazın.",
|
||||
"One Header=Value entry per line.": "Her satıra bir Header=Value girdisi yazın.",
|
||||
"External MCP Servers…": "Harici MCP Sunucuları…",
|
||||
"Opens Settings › Agents › External MCP Servers: configures the User and Workspace MCP servers coding agents use.": "Ayarlar › Ajanlar › Harici MCP Sunucuları sayfasını açar; kodlama ajanlarının kullandığı Kullanıcı ve Çalışma Alanı MCP sunucularını yapılandırır.",
|
||||
"MCP Connections…": "MCP Bağlantıları…",
|
||||
"Configure the MCP servers that agents can use.": "Ajanların kullanabileceği MCP sunucularını yapılandırın.",
|
||||
"No matching remote branches": "Eşleşen uzak dal bulunamadı",
|
||||
"Remote branches": "Uzak dallar",
|
||||
"Branch name prefixes": "Dal adı önekleri",
|
||||
@@ -7519,7 +7520,7 @@
|
||||
"More Agents…": "Diğer Ajanlar…",
|
||||
"More agents…": "Diğer ajanlar…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "Ayarlar › Derleme, Yürütme, Dağıtım › Maven bölümünü açar",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "Ayarlar › Araçlar › Ajanlar bölümünü açar: ACP Kayıt Deposu'ndan ajanları yükler, günceller veya kaldırır.",
|
||||
"Install, update, or remove agents from the ACP Registry.": "ACP Kayıt Deposu'ndan ajanları yükleyin, güncelleyin veya kaldırın.",
|
||||
"Search agents": "Ajanları ara",
|
||||
"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.": "ACP Kayıt Deposu'ndaki ajanlar üçüncü taraf yazılımlardır. Bilgisayarınızda izinlerinizle çalışır, dosyalarınızı okuyup değiştirebilirler. Yalnızca güvendiğiniz ajanları yükleyin.",
|
||||
"Cannot load the ACP Registry: {error}": "ACP Kayıt Deposu yüklenemiyor: {error}",
|
||||
|
||||
@@ -599,6 +599,7 @@
|
||||
"Found on PATH": "已在 PATH 中找到",
|
||||
"Leave empty to find the executable on PATH. Changes apply to new sessions.": "留空以從 PATH 查詢可執行檔案。更改對新工作階段生效。",
|
||||
"Command Permissions": "命令權限",
|
||||
"Command Rules": "命令規則",
|
||||
"Allowed commands run without asking, with or without extra arguments. Blocked commands are always rejected, even if allowed, and support * and ? wildcards. Commands with substitutions, redirections or variable assignments always ask.": "允許的命令直接執行,無需確認,可帶額外引數。阻止的命令總會被拒絕,優先於允許清單,支援 * 和 ? 萬用字元。含命令取代、重定向或變數賦值的命令總會詢問。",
|
||||
"Allowed Commands": "允許的命令",
|
||||
"Blocked Commands": "阻止的命令",
|
||||
@@ -2788,8 +2789,7 @@
|
||||
"Session finished": "工作階段已結束",
|
||||
"Sessions from other apps": "來自其他應用的代理工作階段",
|
||||
"Import Sessions…": "匯入工作階段…",
|
||||
"Import Sessions from Other Apps…": "從其他應用匯入代理工作階段…",
|
||||
"Import Sessions from Other Apps": "從其他應用匯入代理工作階段",
|
||||
"Import Sessions": "匯入工作階段",
|
||||
"No sessions from other apps": "沒有來自其他應用的代理工作階段",
|
||||
"Already importing": "正在匯入",
|
||||
"Filter sessions": "篩選工作階段",
|
||||
@@ -5830,7 +5830,7 @@
|
||||
"More Agents…": "更多 Agent…",
|
||||
"More agents…": "更多 Agent…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "開啟 設定 › 建置、執行、部署 › Maven。",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "開啟 設定 › 工具 › Agents:從 ACP Registry 安裝、更新或移除 Agent。",
|
||||
"Install, update, or remove agents from the ACP Registry.": "從 ACP Registry 安裝、更新或移除代理。",
|
||||
"Search agents": "搜尋 Agent",
|
||||
"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.": "ACP Registry 中的 Agent 是第三方軟體。它們以你的權限在本機執行,可以讀取和修改你的檔案。請只安裝你信任的 Agent。",
|
||||
"Cannot load the ACP Registry: {error}": "無法載入 ACP Registry:{error}",
|
||||
@@ -7788,6 +7788,7 @@
|
||||
"An update for this agent is already running.": "此代理已有更新正在進行。",
|
||||
"This is not a global npm install OpenIDEA can update. Use its original installer.": "這不是 OpenIDEA 能更新的 npm 全域安裝。請使用原安裝工具更新。",
|
||||
"Coding Agents": "程式設計代理",
|
||||
"Agent Setup": "代理設定",
|
||||
"Install coding agents and configure how they launch, chat and connect to the IDE.": "安裝程式設計 Agent,並設定其啟動方式、聊天行為以及與 IDE 的連線。",
|
||||
"Fork Agent Task": "Fork Agent 任務",
|
||||
"Couldn't fork the task": "無法 Fork 任務",
|
||||
@@ -7863,6 +7864,7 @@
|
||||
"Copy Server Name": "複製伺服器名稱",
|
||||
"Delete Server": "刪除伺服器",
|
||||
"External MCP Servers": "外部 MCP 伺服器",
|
||||
"MCP Connections": "MCP 連線",
|
||||
"Import MCP servers from .mcp.json and .vscode/mcp.json": "從 .mcp.json 和 .vscode/mcp.json 匯入 MCP 伺服器",
|
||||
"An open standard that lets AI use external tools and services. MCP servers provide tools for file operations, databases, APIs, and more.": "一項允許 AI 使用外部工具和服務的開放標準。MCP 伺服器提供用於檔案操作、資料庫、API 等的工具。",
|
||||
"Learn more about MCP servers": "瞭解有關 MCP 伺服器的更多資訊",
|
||||
@@ -7883,8 +7885,8 @@
|
||||
"One KEY=VALUE entry per line.": "每行一個 KEY=VALUE 條目。",
|
||||
"One Header=Value entry per line.": "每行一個 Header=Value 條目。",
|
||||
"Maven project could not be configured": "無法設定 Maven 專案",
|
||||
"External MCP Servers…": "外部 MCP 伺服器…",
|
||||
"Opens Settings › Agents › External MCP Servers: configures the User and Workspace MCP servers coding agents use.": "開啟「設定 › 代理 › 外部 MCP 伺服器」:設定程式設計代理使用的使用者級和工作區級 MCP 伺服器。",
|
||||
"MCP Connections…": "MCP 連線…",
|
||||
"Configure the MCP servers that agents can use.": "設定代理可以使用的 MCP 伺服器。",
|
||||
"Type:": "型別:",
|
||||
"Command:": "命令:",
|
||||
"Arguments:": "引數:",
|
||||
|
||||
@@ -889,6 +889,7 @@
|
||||
"Found on PATH": "已在 PATH 中找到",
|
||||
"Leave empty to find the executable on PATH. Changes apply to new sessions.": "留空以从 PATH 查找可执行文件。更改对新会话生效。",
|
||||
"Command Permissions": "命令权限",
|
||||
"Command Rules": "命令规则",
|
||||
"Allowed commands run without asking, with or without extra arguments. Blocked commands are always rejected, even if allowed, and support * and ? wildcards. Commands with substitutions, redirections or variable assignments always ask.": "允许的命令直接运行,无需确认,可带额外参数。阻止的命令总会被拒绝,优先于允许列表,支持 * 和 ? 通配符。含命令替换、重定向或变量赋值的命令总会询问。",
|
||||
"Allowed Commands": "允许的命令",
|
||||
"Blocked Commands": "阻止的命令",
|
||||
@@ -3200,8 +3201,7 @@
|
||||
"Session finished": "会话已结束",
|
||||
"Sessions from other apps": "来自其他应用的智能体会话",
|
||||
"Import Sessions…": "导入会话…",
|
||||
"Import Sessions from Other Apps…": "从其他应用导入智能体会话…",
|
||||
"Import Sessions from Other Apps": "从其他应用导入智能体会话",
|
||||
"Import Sessions": "导入会话",
|
||||
"No sessions from other apps": "没有来自其他应用的智能体会话",
|
||||
"Already importing": "正在导入",
|
||||
"Filter sessions": "过滤会话",
|
||||
@@ -6215,6 +6215,7 @@
|
||||
"Show Branches": "显示分支",
|
||||
"Update Selected": "更新所选",
|
||||
"Navigate Log to Selected Branch": "在日志中导航到所选分支",
|
||||
"(no tracking branch)": "(无跟踪分支)",
|
||||
"Group by Repository": "按仓库分组",
|
||||
"Branch or tag": "分支或标签",
|
||||
"Filter branches and tags": "过滤分支和标签",
|
||||
@@ -6325,7 +6326,7 @@
|
||||
"More Agents…": "更多 Agent…",
|
||||
"More agents…": "更多 Agent…",
|
||||
"Opens Settings › Build, Execution, Deployment › Maven": "打开 设置 › 构建、执行、部署 › Maven。",
|
||||
"Opens Settings › Tools › Agents: installs, updates or removes agents from the ACP Registry.": "打开 设置 › 工具 › Agents:从 ACP Registry 安装、更新或移除 Agent。",
|
||||
"Install, update, or remove agents from the ACP Registry.": "从 ACP Registry 安装、更新或移除智能体。",
|
||||
"Search agents": "搜索 Agent",
|
||||
"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.": "ACP Registry 中的 Agent 是第三方软件。它们以你的权限在本机运行,可以读取和修改你的文件。请只安装你信任的 Agent。",
|
||||
"Cannot load the ACP Registry: {error}": "无法加载 ACP Registry:{error}",
|
||||
@@ -8309,6 +8310,7 @@
|
||||
"An update for this agent is already running.": "此智能体已有更新正在进行。",
|
||||
"This is not a global npm install OpenIDEA can update. Use its original installer.": "这不是 OpenIDEA 能更新的 npm 全局安装。请使用原安装工具更新。",
|
||||
"Coding Agents": "编程智能体",
|
||||
"Agent Setup": "智能体配置",
|
||||
"Install coding agents and configure how they launch, chat and connect to the IDE.": "安装编程 Agent,并配置其启动方式、聊天行为以及与 IDE 的连接。",
|
||||
"Fork Agent Task": "Fork Agent 任务",
|
||||
"Couldn't fork the task": "无法 Fork 任务",
|
||||
@@ -8384,6 +8386,7 @@
|
||||
"Copy Server Name": "复制服务器名称",
|
||||
"Delete Server": "删除服务器",
|
||||
"External MCP Servers": "外部 MCP 服务器",
|
||||
"MCP Connections": "MCP 连接",
|
||||
"Import MCP servers from .mcp.json and .vscode/mcp.json": "从 .mcp.json 和 .vscode/mcp.json 导入 MCP 服务器",
|
||||
"An open standard that lets AI use external tools and services. MCP servers provide tools for file operations, databases, APIs, and more.": "一项允许 AI 使用外部工具和服务的开放标准。MCP 服务器提供用于文件操作、数据库、API 等的工具。",
|
||||
"Learn more about MCP servers": "了解有关 MCP 服务器的更多信息",
|
||||
@@ -8404,8 +8407,8 @@
|
||||
"One KEY=VALUE entry per line.": "每行一个 KEY=VALUE 条目。",
|
||||
"One Header=Value entry per line.": "每行一个 Header=Value 条目。",
|
||||
"Maven project could not be configured": "无法配置 Maven 项目",
|
||||
"External MCP Servers…": "外部 MCP 服务器…",
|
||||
"Opens Settings › Agents › External MCP Servers: configures the User and Workspace MCP servers coding agents use.": "打开“设置 › 智能体 › 外部 MCP 服务器”:配置编程智能体使用的用户级和工作区级 MCP 服务器。",
|
||||
"MCP Connections…": "MCP 连接…",
|
||||
"Configure the MCP servers that agents can use.": "配置智能体可以使用的 MCP 服务器。",
|
||||
"Type:": "类型:",
|
||||
"Command:": "命令:",
|
||||
"Arguments:": "参数:",
|
||||
|
||||
Reference in new issue
Заблокувати користувача