import { i as OpenClawConfig } from "./types.openclaw-Dkap9jPv.js"; import { Ko as WebSearchCredentialResolutionSource, Qo as WebSearchProviderToolExecutionContext, Xo as WebSearchProviderSetupContext, Yo as WebSearchProviderPlugin, Zo as WebSearchProviderToolDefinition } from "./types-VTSyQW4p.js"; import { C as readPositiveIntegerParam, D as readStringParam, S as readNumberParam, T as readStringArrayParam, g as jsonResult, x as readNonNegativeIntegerParam } from "./common-BdhtzyVj.js"; import { s as wrapWebContent } from "./external-content-BpqxkZzw.js"; import { a as normalizeCacheKey, c as resolveCacheTtlMs, f as writeCache, g as withTrustedWebToolsEndpoint, l as resolvePositiveTimeoutSeconds, m as withSelfHostedWebToolsEndpoint, n as DEFAULT_CACHE_TTL_MINUTES, o as readCache, r as DEFAULT_TIMEOUT_SECONDS, s as readResponseText, u as resolveTimeoutSeconds } from "./web-shared-Df0ay1Wq.js"; import { i as markdownToText, o as truncateText } from "./web-fetch-utils-aKuNAzRg.js"; import { t as formatCliCommand } from "./command-format-d2gWtZzp.js"; import { t as enablePluginInConfig } from "./enable-DpqJCHOl.js"; import { a as setProviderWebSearchPluginConfigValue, i as resolveProviderWebSearchPluginConfig, n as getTopLevelCredentialValue, o as setScopedCredentialValue, r as mergeScopedSearchConfig, s as setTopLevelCredentialValue, t as getScopedCredentialValue } from "./web-search-provider-config-7g8LkA1K.js"; //#region src/agents/tools/web-search-citation-redirect.d.ts /** * Resolve a citation redirect URL to its final destination using a HEAD request. * Returns the original URL if resolution fails or times out. */ declare function resolveCitationRedirectUrl(url: string): Promise; //#endregion //#region src/agents/tools/web-search-provider-common.d.ts type SearchConfigRecord = (NonNullable["web"] extends infer Web ? Web extends { search?: infer Search; } ? Search : never : never) & Record; declare const DEFAULT_SEARCH_COUNT = 5; declare const MAX_SEARCH_COUNT = 10; declare function resolveSearchTimeoutSeconds(searchConfig?: SearchConfigRecord): number; declare function resolveSearchCacheTtlMs(searchConfig?: SearchConfigRecord): number; declare function resolveSearchCount(value: unknown, fallback: number): number; declare function readConfiguredSecretString(value: unknown, path: string): string | undefined; declare function readProviderEnvValue(envVars: string[]): string | undefined; declare function withTrustedWebSearchEndpoint(params: { url: string; timeoutSeconds: number; init: RequestInit; signal?: AbortSignal; }, run: (response: Response) => Promise): Promise; declare function withSelfHostedWebSearchEndpoint(params: { url: string; timeoutSeconds: number; init: RequestInit; signal?: AbortSignal; }, run: (response: Response) => Promise): Promise; declare function postTrustedWebToolsJson(params: { url: string; timeoutSeconds: number; apiKey: string; body: Record; errorLabel: string; maxErrorBytes?: number; extraHeaders?: Record; signal?: AbortSignal; }, parseResponse: (response: Response) => Promise): Promise; declare function throwWebSearchApiError(res: Response, providerLabel: string): Promise; declare function resolveSiteName(url: string | undefined): string | undefined; declare const FRESHNESS_TO_RECENCY: Record; declare function isoToPerplexityDate(iso: string): string | undefined; declare function normalizeToIsoDate(value: string): string | undefined; declare function parseIsoDateRange(params: { rawDateAfter?: string; rawDateBefore?: string; invalidDateAfterMessage: string; invalidDateBeforeMessage: string; invalidDateRangeMessage: string; docs?: string; }): { dateAfter?: string; dateBefore?: string; } | { error: "invalid_date" | "invalid_date_range"; message: string; docs: string; }; declare function normalizeFreshness(value: string | undefined, provider: "brave" | "perplexity"): string | undefined; declare function readCachedSearchPayload(cacheKey: string): Record | undefined; declare function buildSearchCacheKey(parts: Array): string; declare function writeCachedSearchPayload(cacheKey: string, payload: Record, ttlMs: number): void; declare function buildUnsupportedSearchFilterResponse(params: Record, provider: string, docs?: string): { error: string; message: string; docs: string; } | undefined; //#endregion //#region src/agents/tools/web-search-provider-credentials.d.ts declare function resolveWebSearchProviderCredential(params: { credentialValue: unknown; path: string; envVars: string[]; }): string | undefined; //#endregion //#region src/plugin-sdk/provider-web-search.d.ts /** * @deprecated Implement provider-owned `createTool(...)` directly on the * returned WebSearchProviderPlugin instead of routing through core. */ declare function createPluginBackedWebSearchProvider(provider: WebSearchProviderPlugin): WebSearchProviderPlugin; //#endregion export { DEFAULT_CACHE_TTL_MINUTES, DEFAULT_SEARCH_COUNT, DEFAULT_TIMEOUT_SECONDS, FRESHNESS_TO_RECENCY, MAX_SEARCH_COUNT, type SearchConfigRecord, type WebSearchCredentialResolutionSource, type WebSearchProviderPlugin, type WebSearchProviderSetupContext, type WebSearchProviderToolDefinition, type WebSearchProviderToolExecutionContext, buildSearchCacheKey, buildUnsupportedSearchFilterResponse, createPluginBackedWebSearchProvider, enablePluginInConfig, formatCliCommand, getScopedCredentialValue, getTopLevelCredentialValue, isoToPerplexityDate, jsonResult, markdownToText, mergeScopedSearchConfig, normalizeCacheKey, normalizeFreshness, normalizeToIsoDate, parseIsoDateRange, postTrustedWebToolsJson, readCache, readCachedSearchPayload, readConfiguredSecretString, readNonNegativeIntegerParam, readNumberParam, readPositiveIntegerParam, readProviderEnvValue, readResponseText, readStringArrayParam, readStringParam, resolveCacheTtlMs, resolveCitationRedirectUrl, resolvePositiveTimeoutSeconds, resolveProviderWebSearchPluginConfig, resolveSearchCacheTtlMs, resolveSearchCount, resolveSearchTimeoutSeconds, resolveSiteName, resolveTimeoutSeconds, resolveWebSearchProviderCredential, setProviderWebSearchPluginConfigValue, setScopedCredentialValue, setTopLevelCredentialValue, throwWebSearchApiError, truncateText, withSelfHostedWebSearchEndpoint, withSelfHostedWebToolsEndpoint, withTrustedWebSearchEndpoint, withTrustedWebToolsEndpoint, wrapWebContent, writeCache, writeCachedSearchPayload };