Files
moltbot/src/web-search/runtime-types.ts
2026-04-11 10:43:22 +01:00

38 lines
1.1 KiB
TypeScript

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";
type WebSearchConfig = NonNullable<OpenClawConfig["tools"]>["web"] extends infer Web
? Web extends { search?: infer Search }
? Search
: undefined
: undefined;
export type ResolveWebSearchDefinitionParams = {
config?: OpenClawConfig;
sandboxed?: boolean;
runtimeWebSearch?: RuntimeWebSearchMetadata;
providerId?: string;
preferRuntimeProviders?: boolean;
};
export type RunWebSearchParams = ResolveWebSearchDefinitionParams & {
args: Record<string, unknown>;
};
export type RunWebSearchResult = {
provider: string;
result: Record<string, unknown>;
};
export type ListWebSearchProvidersParams = {
config?: OpenClawConfig;
};
export type RuntimeWebSearchProviderEntry = PluginWebSearchProviderEntry;
export type RuntimeWebSearchToolDefinition = WebSearchProviderToolDefinition;
export type RuntimeWebSearchConfig = WebSearchConfig;