mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(plugins): remove setup browser facade
This commit is contained in:
@@ -69,11 +69,14 @@ vi.mock("../plugins/provider-auth-helpers.js", () => ({
|
||||
|
||||
const isRemoteEnvironment = vi.hoisted(() => vi.fn(() => false));
|
||||
const openUrl = vi.hoisted(() => vi.fn(async () => {}));
|
||||
vi.mock("../plugins/setup-browser.js", () => ({
|
||||
isRemoteEnvironment,
|
||||
vi.mock("../infra/browser-open.js", () => ({
|
||||
openUrl,
|
||||
}));
|
||||
|
||||
vi.mock("../infra/remote-env.js", () => ({
|
||||
isRemoteEnvironment,
|
||||
}));
|
||||
|
||||
const createVpsAwareOAuthHandlers = vi.hoisted(() => vi.fn());
|
||||
vi.mock("../plugins/provider-oauth-flow.js", () => ({
|
||||
createVpsAwareOAuthHandlers,
|
||||
|
||||
@@ -95,11 +95,14 @@ vi.mock("../agents/workspace.js", () => ({
|
||||
resolveDefaultAgentWorkspaceDir: () => "/tmp/openclaw-workspace",
|
||||
}));
|
||||
|
||||
vi.mock("../plugins/setup-browser.js", () => ({
|
||||
isRemoteEnvironment: () => false,
|
||||
vi.mock("../infra/browser-open.js", () => ({
|
||||
openUrl: vi.fn(async () => {}),
|
||||
}));
|
||||
|
||||
vi.mock("../infra/remote-env.js", () => ({
|
||||
isRemoteEnvironment: () => false,
|
||||
}));
|
||||
|
||||
vi.mock("../plugins/provider-oauth-flow.js", () => ({
|
||||
createVpsAwareOAuthHandlers: vi.fn(),
|
||||
}));
|
||||
|
||||
@@ -10,6 +10,8 @@ import { formatLiteralProviderPrefixedModelRef } from "../agents/model-ref-share
|
||||
import { resolveDefaultAgentWorkspaceDir } from "../agents/workspace.js";
|
||||
import { normalizeAgentModelRefForConfig } from "../config/model-input.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { openUrl } from "../infra/browser-open.js";
|
||||
import { isRemoteEnvironment } from "../infra/remote-env.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { t } from "../wizard/i18n/index.js";
|
||||
import type { WizardPrompter } from "../wizard/prompts.js";
|
||||
@@ -27,7 +29,6 @@ import {
|
||||
import { applyAuthProfileConfig } from "./provider-auth-helpers.js";
|
||||
import { resolveProviderInstallCatalogEntry } from "./provider-install-catalog.js";
|
||||
import { createVpsAwareOAuthHandlers } from "./provider-oauth-flow.js";
|
||||
import { isRemoteEnvironment, openUrl } from "./setup-browser.js";
|
||||
import type { ProviderAuthMethod, ProviderAuthOptionBag, ProviderPlugin } from "./types.js";
|
||||
|
||||
type UpsertAuthProfileParams = Parameters<typeof upsertAuthProfileWithLock>[0];
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
/** Opens URLs for plugin setup flows. */
|
||||
export { openUrl } from "../infra/browser-open.js";
|
||||
/** Detects whether plugin setup is running in a remote/VPS environment. */
|
||||
export { isRemoteEnvironment } from "../infra/remote-env.js";
|
||||
Reference in New Issue
Block a user