import { i as OpenClawConfig } from "./types.openclaw-CpnoYlBx.js"; import { Gs as WebSearchProviderPlugin, Hs as WebSearchCredentialResolutionSource, Js as WebSearchProviderToolExecutionContext, Ks as WebSearchProviderSetupContext, qs as WebSearchProviderToolDefinition } from "./types-BftTUA7h.js"; import { C as readPositiveIntegerParam, D as readStringParam, S as readNumberParam, T as readStringArrayParam, g as jsonResult, x as readNonNegativeIntegerParam } from "./common-BQld_MGZ.js"; import { s as wrapWebContent } from "./external-content-74dsV8Q3.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-BA33fpFU.js"; import { i as markdownToText, o as truncateText } from "./web-fetch-utils-Cx-FHkJu.js"; import { t as formatCliCommand } from "./command-format-CUz7-yqH.js"; import { t as enablePluginInConfig } from "./enable-mOEvyYhy.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-LWHQvYQB.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; type WebSearchFreshnessProvider = "brave" | "perplexity"; type WebSearchRecencyFreshness = "day" | "week" | "month" | "year"; type ParsedWebSearchFreshness = Provider extends "perplexity" ? WebSearchRecencyFreshness : string; declare const FRESHNESS_TO_RECENCY: Record; declare function isoToPerplexityDate(iso: string): string | undefined; /** Accepts ISO dates plus Perplexity `M/D/YYYY` dates and returns canonical ISO dates. */ declare function normalizeToIsoDate(value: string): string | undefined; /** Parses optional date range filters and returns provider-facing validation errors. */ 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; }; /** Converts shared freshness names into provider-specific Brave or Perplexity values. */ declare function normalizeFreshness(value: string | undefined, provider: WebSearchFreshnessProvider): string | undefined; /** Parses freshness/date filters while rejecting combinations providers cannot express safely. */ declare function parseWebSearchTimeFilters(params: { rawFreshness?: string; rawDateAfter?: string; rawDateBefore?: string; freshnessProvider: Provider; invalidFreshnessMessage: string; invalidDateAfterMessage: string; invalidDateBeforeMessage: string; invalidDateRangeMessage: string; conflictingTimeFiltersMessage?: string; docs?: string; }): { freshness?: ParsedWebSearchFreshness; dateAfter?: string; dateBefore?: string; } | { error: "invalid_freshness" | "invalid_date" | "invalid_date_range" | "conflicting_time_filters"; message: string; docs: string; }; /** Reads a search cache payload and marks it so provider responses can disclose cache hits. */ declare function readCachedSearchPayload(cacheKey: string): Record | undefined; /** Builds a normalized cache key from provider-specific search dimensions. */ declare function buildSearchCacheKey(parts: Array): string; /** Stores one provider search payload with its provider-selected TTL. */ 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 /** * Resolves web-search provider credentials from config values, secret refs, or * provider-specific environment variables. */ /** Returns the first usable credential for a web-search provider. */ 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, parseWebSearchTimeFilters, 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 };