import { r as createLazyRuntimeModule } from "./lazy-runtime-B-Fc-m0I.js";
import { _ as readStringParam, p as readPositiveIntegerParam } from "./common-Av78VkEK.js";
import "./param-readers-Csgiax7H.js";
import { t as createDuckDuckGoWebSearchProviderBase } from "./ddg-search-provider.shared-Bu-0QmNV.js";
//#region extensions/duckduckgo/src/ddg-search-provider.ts
const loadDuckDuckGoClientModule = createLazyRuntimeModule(() => import("./ddg-client-DFf8z803.js"));
const DuckDuckGoSearchSchema = {
	type: "object",
	properties: {
		query: {
			type: "string",
			description: "Search query string."
		},
		count: {
			type: "integer",
			description: "Number of results to return (1-10).",
			minimum: 1,
			maximum: 10
		},
		region: {
			type: "string",
			description: "Optional DuckDuckGo region code such as us-en, uk-en, or de-de."
		},
		safeSearch: {
			type: "string",
			description: "SafeSearch level: strict, moderate, or off."
		}
	},
	additionalProperties: false
};
function createDuckDuckGoWebSearchProvider() {
	return {
		...createDuckDuckGoWebSearchProviderBase(),
		createTool: (ctx) => ({
			description: "Search the web using DuckDuckGo. Returns titles, URLs, and snippets with no API key required.",
			parameters: DuckDuckGoSearchSchema,
			execute: async (args) => {
				const { runDuckDuckGoSearch } = await loadDuckDuckGoClientModule();
				return await runDuckDuckGoSearch({
					config: ctx.config,
					query: readStringParam(args, "query", { required: true }),
					count: readPositiveIntegerParam(args, "count", {
						max: 10,
						message: "count must be an integer from 1 to 10."
					}),
					region: readStringParam(args, "region"),
					safeSearch: readStringParam(args, "safeSearch")
				});
			}
		})
	};
}
//#endregion
export { createDuckDuckGoWebSearchProvider as t };
