From 41c700fe9ee91279536ed5f5fecebb3d24214169 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 6 Apr 2026 16:18:15 +0100 Subject: [PATCH] refactor(deadcode): remove command auth shims --- src/commands/auth-choice.apply.plugin-provider.runtime.ts | 1 - src/commands/auth-choice.apply.plugin-provider.test.ts | 8 ++++---- src/commands/auth-choice.apply.plugin-provider.ts | 1 - src/commands/auth-choice.test.ts | 6 +++--- .../onboard-non-interactive.provider-auth.test.ts | 2 +- src/commands/openai-codex-oauth.ts | 1 - src/commands/self-hosted-provider-setup.ts | 1 - src/commands/zai-endpoint-detect.test.ts | 2 +- src/commands/zai-endpoint-detect.ts | 1 - 9 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 src/commands/auth-choice.apply.plugin-provider.runtime.ts delete mode 100644 src/commands/auth-choice.apply.plugin-provider.ts delete mode 100644 src/commands/openai-codex-oauth.ts delete mode 100644 src/commands/self-hosted-provider-setup.ts delete mode 100644 src/commands/zai-endpoint-detect.ts diff --git a/src/commands/auth-choice.apply.plugin-provider.runtime.ts b/src/commands/auth-choice.apply.plugin-provider.runtime.ts deleted file mode 100644 index c1a54580ca7..00000000000 --- a/src/commands/auth-choice.apply.plugin-provider.runtime.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "../plugins/provider-auth-choice.runtime.js"; diff --git a/src/commands/auth-choice.apply.plugin-provider.test.ts b/src/commands/auth-choice.apply.plugin-provider.test.ts index 162cf130981..50fcb41db04 100644 --- a/src/commands/auth-choice.apply.plugin-provider.test.ts +++ b/src/commands/auth-choice.apply.plugin-provider.test.ts @@ -1,12 +1,12 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; -import type { ProviderPlugin } from "../plugins/types.js"; -import type { ProviderAuthMethod } from "../plugins/types.js"; -import type { ApplyAuthChoiceParams } from "./auth-choice.apply.js"; import { applyAuthChoiceLoadedPluginProvider, applyAuthChoicePluginProvider, runProviderPluginAuthMethod, -} from "./auth-choice.apply.plugin-provider.js"; +} from "../plugins/provider-auth-choice.js"; +import type { ProviderPlugin } from "../plugins/types.js"; +import type { ProviderAuthMethod } from "../plugins/types.js"; +import type { ApplyAuthChoiceParams } from "./auth-choice.apply.js"; const resolvePluginProviders = vi.hoisted(() => vi.fn<() => ProviderPlugin[]>(() => [])); const resolveProviderPluginChoice = vi.hoisted(() => diff --git a/src/commands/auth-choice.apply.plugin-provider.ts b/src/commands/auth-choice.apply.plugin-provider.ts deleted file mode 100644 index aa0f17e4e2f..00000000000 --- a/src/commands/auth-choice.apply.plugin-provider.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "../plugins/provider-auth-choice.js"; diff --git a/src/commands/auth-choice.test.ts b/src/commands/auth-choice.test.ts index a69d998c444..9b0a03e0032 100644 --- a/src/commands/auth-choice.test.ts +++ b/src/commands/auth-choice.test.ts @@ -21,7 +21,7 @@ import { setupAuthTestEnv, } from "./test-wizard-helpers.js"; -type DetectZaiEndpoint = typeof import("./zai-endpoint-detect.js").detectZaiEndpoint; +type DetectZaiEndpoint = typeof import("../plugins/provider-zai-endpoint.js").detectZaiEndpoint; const GOOGLE_GEMINI_DEFAULT_MODEL = "google/gemini-3.1-pro-preview"; const MINIMAX_CN_API_BASE_URL = "https://api.minimax.chat/v1"; @@ -31,7 +31,7 @@ const ZAI_CODING_CN_BASE_URL = "https://open.bigmodel.cn/api/coding/paas/v4"; const loginOpenAICodexOAuth = vi.hoisted(() => vi.fn<() => Promise>(async () => null), ); -vi.mock("./openai-codex-oauth.js", () => ({ +vi.mock("../plugins/provider-openai-codex-oauth.js", () => ({ loginOpenAICodexOAuth, })); @@ -47,7 +47,7 @@ vi.mock("../plugins/provider-auth-choice.runtime.js", async () => { }); const detectZaiEndpoint = vi.hoisted(() => vi.fn(async () => null)); -vi.mock("./zai-endpoint-detect.js", () => ({ +vi.mock("../plugins/provider-zai-endpoint.js", () => ({ detectZaiEndpoint, })); diff --git a/src/commands/onboard-non-interactive.provider-auth.test.ts b/src/commands/onboard-non-interactive.provider-auth.test.ts index 73f501ac16c..16ba360cdba 100644 --- a/src/commands/onboard-non-interactive.provider-auth.test.ts +++ b/src/commands/onboard-non-interactive.provider-auth.test.ts @@ -43,7 +43,7 @@ vi.mock("./onboard-non-interactive/local/auth-choice.plugin-providers.js", async import("../plugins/provider-api-key-auth.js"), import("../plugins/provider-api-key-auth.runtime.js"), import("../plugins/provider-self-hosted-setup.js"), - import("./zai-endpoint-detect.js"), + import("../plugins/provider-zai-endpoint.js"), ]); const ZAI_FALLBACKS = { diff --git a/src/commands/openai-codex-oauth.ts b/src/commands/openai-codex-oauth.ts deleted file mode 100644 index 0c5f098c41f..00000000000 --- a/src/commands/openai-codex-oauth.ts +++ /dev/null @@ -1 +0,0 @@ -export { loginOpenAICodexOAuth } from "../plugins/provider-openai-codex-oauth.js"; diff --git a/src/commands/self-hosted-provider-setup.ts b/src/commands/self-hosted-provider-setup.ts deleted file mode 100644 index 8d4e85fa8ff..00000000000 --- a/src/commands/self-hosted-provider-setup.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "../plugins/provider-self-hosted-setup.js"; diff --git a/src/commands/zai-endpoint-detect.test.ts b/src/commands/zai-endpoint-detect.test.ts index fea72b573ba..c6842fc4fa4 100644 --- a/src/commands/zai-endpoint-detect.test.ts +++ b/src/commands/zai-endpoint-detect.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import { detectZaiEndpoint } from "./zai-endpoint-detect.js"; +import { detectZaiEndpoint } from "../plugins/provider-zai-endpoint.js"; type FetchResponse = { status: number; body?: unknown }; diff --git a/src/commands/zai-endpoint-detect.ts b/src/commands/zai-endpoint-detect.ts deleted file mode 100644 index a3a53e1f5eb..00000000000 --- a/src/commands/zai-endpoint-detect.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "../plugins/provider-zai-endpoint.js";