/** * Wikipedia Search Skill - Searches Wikipedia for article summaries. * * Tier 3 built-in skill: no external API key required. Uses the Wikipedia * REST API to fetch article summaries and extracts for any given topic. * Matches the Python SDK's `num_results` / `no_results_message` parity. */ import { SkillBase } from '../SkillBase.js'; import type { SkillToolDefinition, SkillPromptSection, SkillConfig, ParameterSchemaEntry } from '../SkillBase.js'; /** * Searches Wikipedia for article summaries and extracts. * * Tier 3 built-in skill with no external API key required. The configured * `num_results` drives how many articles are aggregated; `no_results_message` * customizes the fallback text (supports `{query}` interpolation). * * @example * ```ts * agent.addSkill('wikipedia_search', { num_results: 2 }); * ``` */ export declare class WikipediaSearchSkill extends SkillBase { static SKILL_NAME: string; static SKILL_DESCRIPTION: string; static SKILL_VERSION: string; static REQUIRED_PACKAGES: readonly string[]; static REQUIRED_ENV_VARS: readonly string[]; /** * Resolved `num_results` value (populated in `setup()`). * Public to mirror Python's `self.num_results` — accessible to subclasses * and external test code inspecting skill state. */ numResults: number; /** * Resolved `no_results_message` template (populated in `setup()`). * Protected to mirror Python's `self.no_results_message` public visibility * within the class hierarchy. */ protected noResultsMessage: string; static getParameterSchema(): Record; /** * Extract config values into instance state. Enforces `num_results >= 1` * (matching Python `skill.py:_setup` `max(1, ...)` floor). The schema's * `max: 5` handles the upper bound at validation time — no runtime clamp * here, so callers passing larger values get the raw value as in Python. */ setup(): Promise; /** @returns A `search_wiki` tool that fetches article summaries from Wikipedia. */ getTools(): SkillToolDefinition[]; /** * Search Wikipedia and return a formatted text summary. * * Mirrors the Python `search_wiki()` public entry point so the logic can be * tested and reused outside the SWAIG handler. Uses `num_results` to decide * how many articles to aggregate. * * @param query - Plain-text search term. * @returns Formatted text ready for display to the caller. */ searchWiki(query: string): Promise; /** * Fetch JSON with a 10-second timeout (matches Python `requests.get(..., timeout=10)`). * Returns `null` on HTTP error or network failure, logging the cause so * diagnostic signal isn't silently lost. */ private _fetchJson; /** Render the configured no-results message, substituting `{query}`. */ private _formatNoResults; /** @returns Prompt section describing Wikipedia search capabilities and usage guidance. */ protected _getPromptSections(): SkillPromptSection[]; } /** * Factory function for creating WikipediaSearchSkill instances. * @param config - Optional skill configuration. * @returns A new WikipediaSearchSkill instance. */ export declare function createSkill(config?: SkillConfig): WikipediaSearchSkill;