mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-08 19:23:58 +00:00
refactor(plugins): localize provider internals (#101425)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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[];
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user