mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(core): remove unused internal exports
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
export function collectBundledProviderAuthEnvVars(params?: {
|
||||
repoRoot?: string;
|
||||
}): Record<string, readonly string[]>;
|
||||
|
||||
export function renderBundledProviderAuthEnvVarModule(
|
||||
entries: Record<string, readonly string[]>,
|
||||
): string;
|
||||
|
||||
export function writeBundledProviderAuthEnvVarModule(params?: {
|
||||
repoRoot?: string;
|
||||
outputPath?: string;
|
||||
check?: boolean;
|
||||
}): {
|
||||
changed: boolean;
|
||||
wrote: boolean;
|
||||
outputPath: string;
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
@@ -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<OAuthCredentials> {
|
||||
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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user