From d694047cb5d64dd933fb8c3d2e072ee8e07f2672 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 18 Jun 2026 18:40:12 +0800 Subject: [PATCH] refactor(core): remove unused internal exports --- ...erate-bundled-provider-auth-env-vars.d.mts | 17 -------- src/cli/plugin-registry-loader.ts | 5 --- src/llm/utils/oauth/index.ts | 42 ------------------- src/web-search/runtime-types.ts | 2 - 4 files changed, 66 deletions(-) delete mode 100644 scripts/generate-bundled-provider-auth-env-vars.d.mts diff --git a/scripts/generate-bundled-provider-auth-env-vars.d.mts b/scripts/generate-bundled-provider-auth-env-vars.d.mts deleted file mode 100644 index d5e189e743ac..000000000000 --- a/scripts/generate-bundled-provider-auth-env-vars.d.mts +++ /dev/null @@ -1,17 +0,0 @@ -export function collectBundledProviderAuthEnvVars(params?: { - repoRoot?: string; -}): Record; - -export function renderBundledProviderAuthEnvVarModule( - entries: Record, -): string; - -export function writeBundledProviderAuthEnvVarModule(params?: { - repoRoot?: string; - outputPath?: string; - check?: boolean; -}): { - changed: boolean; - wrote: boolean; - outputPath: string; -}; diff --git a/src/cli/plugin-registry-loader.ts b/src/cli/plugin-registry-loader.ts index 05b89b768666..6154c0a3b254 100644 --- a/src/cli/plugin-registry-loader.ts +++ b/src/cli/plugin-registry-loader.ts @@ -10,11 +10,6 @@ function loadPluginRegistryModule() { return pluginRegistryModuleLoader.load(); } -/** Plugin registry loading scope selected by command policy. */ -export type CliPluginRegistryLoadPolicy = { - scope: CliPluginRegistryScope; -}; - /** Load the CLI plugin registry and optionally route activation logs to stderr. */ export async function ensureCliPluginRegistryLoaded(params: { scope: CliPluginRegistryScope; diff --git a/src/llm/utils/oauth/index.ts b/src/llm/utils/oauth/index.ts index d8786807163d..bb21d4cebf84 100644 --- a/src/llm/utils/oauth/index.ts +++ b/src/llm/utils/oauth/index.ts @@ -36,7 +36,6 @@ import { openaiCodexOAuthProvider } from "./openai-chatgpt.js"; import type { OAuthCredentials, OAuthProviderId, - OAuthProviderInfo, OAuthProviderInterface, } from "./types.js"; @@ -64,21 +63,6 @@ export function registerOAuthProvider(provider: OAuthProviderInterface): void { oauthProviderRegistry.set(provider.id, provider); } -/** - * Unregister an OAuth provider. - * - * If the provider is built-in, restores the built-in implementation. - * Custom providers are removed completely. - */ -export function unregisterOAuthProvider(id: string): void { - const builtInProvider = BUILT_IN_OAUTH_PROVIDERS.find((provider) => provider.id === id); - if (builtInProvider) { - oauthProviderRegistry.set(id, builtInProvider); - return; - } - oauthProviderRegistry.delete(id); -} - /** * Reset OAuth providers to built-ins. */ @@ -96,36 +80,10 @@ export function getOAuthProviders(): OAuthProviderInterface[] { return Array.from(oauthProviderRegistry.values()); } -/** - * @deprecated Use getOAuthProviders() which returns OAuthProviderInterface[] - */ -export function getOAuthProviderInfoList(): OAuthProviderInfo[] { - return getOAuthProviders().map((p) => ({ - id: p.id, - name: p.name, - available: true, - })); -} - // ============================================================================ // High-level API (uses provider registry) // ============================================================================ -/** - * Refresh token for unknown OAuth provider. - * @deprecated Use getOAuthProvider(id).refreshToken() instead - */ -export async function refreshOAuthToken( - providerId: OAuthProviderId, - credentials: OAuthCredentials, -): Promise { - const provider = getOAuthProvider(providerId); - if (!provider) { - throw new Error(`Unknown OAuth provider: ${providerId}`); - } - return provider.refreshToken(credentials); -} - /** * Get API key for a provider from OAuth credentials. * Automatically refreshes expired tokens. diff --git a/src/web-search/runtime-types.ts b/src/web-search/runtime-types.ts index 051128d0f522..eec9fdcf62df 100644 --- a/src/web-search/runtime-types.ts +++ b/src/web-search/runtime-types.ts @@ -2,7 +2,6 @@ import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { PluginWebSearchProviderEntry, - WebSearchProviderToolDefinition, } from "../plugins/web-provider-types.js"; import type { RuntimeWebSearchMetadata } from "../secrets/runtime-web-tools.types.js"; @@ -43,5 +42,4 @@ export type ListWebSearchProvidersParams = { }; export type RuntimeWebSearchProviderEntry = PluginWebSearchProviderEntry; -export type RuntimeWebSearchToolDefinition = WebSearchProviderToolDefinition; export type RuntimeWebSearchConfig = WebSearchConfig;