import { z } from "zod"; import type { BoardwalkTool } from "./types.js"; /** * Logical secret name this tool depends on (the org/stage prefix is applied by * the resolver — see the file header). Surfaced via `secretsRequired` so the * sandbox can scope secret access declaratively without the value ever entering * the tool's input. */ export declare const TAVILY_SECRET_NAME = "tavily/api-key"; export declare const webSearchInput: z.ZodObject<{ query: z.ZodString; max_results: z.ZodOptional; include_content: z.ZodOptional; search_depth: z.ZodOptional>; }, z.core.$strip>; export type WebSearchInput = z.infer; declare const webSearchResult: z.ZodObject<{ title: z.ZodString; url: z.ZodString; snippet: z.ZodString; content: z.ZodOptional; score: z.ZodOptional; }, z.core.$strip>; export type WebSearchResult = z.infer; declare const webSearchOutput: z.ZodObject<{ kind: z.ZodLiteral<"web_search">; humanSummary: z.ZodString; data: z.ZodObject<{ query: z.ZodString; results: z.ZodArray; score: z.ZodOptional; }, z.core.$strip>>; answer: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>; export type WebSearchOutput = z.infer; export interface WebSearchDeps { /** Returns the Tavily API key. Cached at the caller (one resolve per cold start). */ resolveApiKey: () => Promise; fetchImpl?: typeof fetch; } export declare function makeWebSearchTool(deps: WebSearchDeps): BoardwalkTool; /** * Broker-backed web_search for the runner (the Runner Credential Broker model): identical name/schemas/behavior * to {@link makeWebSearchTool}, but the Tavily call runs in the broker (which holds the platform key) * — the runner just forwards the query, so it needs NO Tavily secret (`secretsRequired: []`). Wired on * the worker when the control plane is on; the direct tool above is the pre-broker/local path. */ export declare function makeBrokerWebSearchTool(deps: { search: (input: WebSearchInput) => Promise; }): BoardwalkTool; /** * Drop near-duplicate results from the same hostname, keeping the first (highest-ranked, since * Tavily returns by relevance). The agent shouldn't pay tokens for three hits off one site. A * result whose URL won't parse is kept (we can't classify it, so we don't drop it). Exported for * unit testing. */ export declare function dedupeByDomain(results: WebSearchResult[]): WebSearchResult[]; export {};