дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-03 16:51:16 +02:00
Agents can be signed in from the IDE: Sign In... in Settings > Agents > Agent Setup and on a sign-in error in the chat opens a dialog running the agent's own login flow (copilot login, codex login, claude, an ACP terminal-auth method) in an IDE-managed PTY with the real program and arguments, no shell quoting. The Settings window's boot provides the embedded terminal, so the dialog works there without importing the terminal feature. Sign-in clears a failed model-catalog cooldown and refreshes the agent's models. Copilot's login runs with ambient GitHub token variables cleared, and copied login hints quote paths with spaces. A test pins that every built-in login hint yields the arguments Sign In runs. Co-authored-by: dengliu <[email protected]>
50 рядки
2.3 KiB
TypeScript
50 рядки
2.3 KiB
TypeScript
import type { ComponentType } from "react";
|
|
import { activateSettingsPages as agentsPages } from "./features/agents/settingsPages";
|
|
import { installLocaleSync } from "./features/app/locale";
|
|
import { activateSettingsPages as databasePages } from "./features/database/settingsPages";
|
|
import { activateSettingsPages as githubPages } from "./features/github/settingsPages";
|
|
import { activateSettingsPages as pluginsPages } from "./features/plugins/settingsPages";
|
|
import { activate as projectTrust } from "./features/project-trust";
|
|
import { activateSettingsWindow } from "./features/settings/settingsWindow";
|
|
import { SettingsWindow } from "./features/settings/window/SettingsWindow";
|
|
import { activateSettingsPages as templatesPages } from "./features/templates/settingsPages";
|
|
import { activateSettingsPages as todoPages } from "./features/todo/settingsPages";
|
|
import { activateSettingsPages as toolsPages } from "./features/tools/settingsPages";
|
|
import { activateSettingsPages as vcsPages } from "./features/vcs/settingsPages";
|
|
import { activateSettingsPages as vimPages } from "./features/vim/settingsPages";
|
|
import { activateList } from "./windowBoot";
|
|
import { provideEmbeddedTerminal } from "./workbench/contributions";
|
|
|
|
/** The embedded terminal of the agents' Sign In dialog, loaded on first use. */
|
|
function embeddedTerminal(): () => void {
|
|
provideEmbeddedTerminal(async (host, options) =>
|
|
(await import("./features/terminal/loader"))
|
|
.loadTerminalRuntime()
|
|
.then((rt) => rt.createEmbeddedTerminal(host, options)),
|
|
);
|
|
return () => provideEmbeddedTerminal(undefined);
|
|
}
|
|
|
|
/**
|
|
* Native Settings window of project window `parent`: only the settings pages
|
|
* (no workbench, project services, CodeMirror editors or tool windows).
|
|
*/
|
|
export function bootSettingsWindow(parent: string): ComponentType {
|
|
activateList("settings pages", [
|
|
["project-trust", projectTrust],
|
|
["locale", installLocaleSync],
|
|
["settings", () => activateSettingsWindow(parent)],
|
|
["templates", templatesPages],
|
|
["todo", todoPages],
|
|
["plugins", pluginsPages],
|
|
["tools", toolsPages],
|
|
["agents", agentsPages],
|
|
["terminal", embeddedTerminal],
|
|
["vim", vimPages],
|
|
["vcs", vcsPages],
|
|
["github", githubPages],
|
|
["database", databasePages],
|
|
]);
|
|
return SettingsWindow;
|
|
}
|