refactor(plugins): localize provider internals (#101425)

This commit is contained in:
Vincent Koc
2026-07-06 23:50:12 -07:00
committed by GitHub
parent 8c0b3a784a
commit 9cf5079e56
4 changed files with 10 additions and 10 deletions

View File

@@ -9,10 +9,10 @@ import {
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
/** Canonical config path for the Brave Search API key. */
export const BRAVE_CREDENTIAL_PATH = "plugins.entries.brave.config.webSearch.apiKey";
const BRAVE_CREDENTIAL_PATH = "plugins.entries.brave.config.webSearch.apiKey";
/** Resolve legacy top-level Brave credentials from old web-search config. */
export function resolveLegacyTopLevelBraveCredential(
function resolveLegacyTopLevelBraveCredential(
config: unknown,
): { path: string; value: unknown } | undefined {
if (!isRecord(config)) {
@@ -39,7 +39,7 @@ function resolveBraveWebSearchPluginConfig(config: unknown): Record<string, unkn
}
/** Resolve Brave credentials from current plugin config or legacy fallback. */
export function resolveConfiguredBraveCredential(config: unknown): unknown {
function resolveConfiguredBraveCredential(config: unknown): unknown {
return (
resolveBraveWebSearchPluginConfig(config)?.apiKey ??
resolveLegacyTopLevelBraveCredential(config)?.value

View File

@@ -70,7 +70,7 @@ interface DeepInfraAgentModelEntry {
metadata: DeepInfraAgentModelMetadata | null;
}
export type DeepInfraSurface = "chat" | "vlm" | "embed" | "image-gen" | "video-gen" | "tts" | "stt";
type DeepInfraSurface = "chat" | "vlm" | "embed" | "image-gen" | "video-gen" | "tts" | "stt";
export interface DeepInfraSurfaceModel {
id: string;
@@ -85,7 +85,7 @@ export interface DeepInfraSurfaceModel {
defaultIterations?: number;
}
export interface DeepInfraDiscoveredCatalog {
interface DeepInfraDiscoveredCatalog {
chat: DeepInfraSurfaceModel[];
vlm: DeepInfraSurfaceModel[];
embed: DeepInfraSurfaceModel[];

View File

@@ -72,7 +72,7 @@ async function readFirecrawlJsonResponse(
return await readProviderJsonResponse<Record<string, unknown>>(response, label, opts);
}
export type FirecrawlSearchParams = {
type FirecrawlSearchParams = {
cfg?: OpenClawConfig;
query: string;
count?: number;
@@ -82,7 +82,7 @@ export type FirecrawlSearchParams = {
scrapeResults?: boolean;
};
export type FirecrawlScrapeParams = {
type FirecrawlScrapeParams = {
cfg?: OpenClawConfig;
url: string;
extractMode: "markdown" | "text";

View File

@@ -5,10 +5,10 @@ import {
type WebSearchProviderPlugin,
} from "openclaw/plugin-sdk/provider-web-search-contract";
export const FIRECRAWL_CREDENTIAL_PATH = "plugins.entries.firecrawl.config.webSearch.apiKey";
export const FIRECRAWL_FETCH_CREDENTIAL_PATH = "plugins.entries.firecrawl.config.webFetch.apiKey";
const FIRECRAWL_CREDENTIAL_PATH = "plugins.entries.firecrawl.config.webSearch.apiKey";
const FIRECRAWL_FETCH_CREDENTIAL_PATH = "plugins.entries.firecrawl.config.webFetch.apiKey";
export function getConfiguredFirecrawlFetchCredentialFallback(config?: {
function getConfiguredFirecrawlFetchCredentialFallback(config?: {
plugins?: { entries?: { firecrawl?: { config?: unknown } } };
}) {
const apiKey = (