/** * @unbrowser/core - SDK Introspection * * Self-describing capabilities for LLM discovery. * Call these methods to understand what the SDK can do. * * @module introspection * @packageDocumentation */ /** * Description of an SDK method for LLM discovery. * * @description * Every public method in the SDK has a MethodInfo that describes: * - What the method does * - Required and optional parameters * - Return type * - Example usage * * LLMs can use this to understand how to call each method correctly. */ export interface MethodInfo { /** * Method name as it appears on the client. */ name: string; /** * Human-readable description of what the method does. */ description: string; /** * Detailed explanation with context. */ details: string; /** * Parameter definitions. */ parameters: ParameterInfo[]; /** * Return type description. */ returns: { type: string; description: string; }; /** * Example code showing how to use the method. */ example: string; /** * Related methods that might be useful. */ related?: string[]; /** * Common use cases for this method. */ useCases?: string[]; } /** * Description of a method parameter. */ export interface ParameterInfo { /** * Parameter name. */ name: string; /** * TypeScript type of the parameter. */ type: string; /** * Whether the parameter is required. */ required: boolean; /** * Description of what the parameter does. */ description: string; /** * Default value if optional. */ default?: string; /** * Example values for this parameter. */ examples?: string[]; } /** * Overall SDK capability summary. * * @description * High-level overview of what the SDK can do, organized by category. * Use this to understand the SDK's capabilities at a glance. */ export interface SDKCapabilities { /** * SDK package name. */ name: string; /** * Current SDK version. */ version: string; /** * Brief description of the SDK. */ description: string; /** * Capabilities organized by category. */ categories: Array<{ name: string; description: string; methods: string[]; }>; /** * Quick start guide. */ quickStart: string; /** * Link to full documentation. */ docsUrl: string; } /** * Complete method catalog for the UnbrowserClient. * * @description * This catalog describes every public method on the UnbrowserClient. * LLMs can use this to discover and understand available functionality. */ export declare const METHOD_CATALOG: Record; /** * Get SDK capabilities summary. * * @description * Returns a high-level overview of what the SDK can do. * Use this to understand the SDK before diving into specific methods. * * @example * ```typescript * const caps = getCapabilities(); * console.log(caps.description); * for (const cat of caps.categories) { * console.log(`${cat.name}: ${cat.methods.join(', ')}`); * } * ``` */ export declare function getCapabilities(): SDKCapabilities; /** * Get information about a specific method. * * @description * Returns detailed information about a method including parameters, * return type, examples, and related methods. * * @example * ```typescript * const info = getMethodInfo('browse'); * console.log(info?.description); * console.log(info?.example); * ``` */ export declare function getMethodInfo(methodName: string): MethodInfo | undefined; /** * List all available methods. * * @description * Returns an array of all method names available on the client. * * @example * ```typescript * const methods = listMethods(); * for (const name of methods) { * const info = getMethodInfo(name); * console.log(`${name}: ${info?.description}`); * } * ``` */ export declare function listMethods(): string[]; /** * Search for methods matching a query. * * @description * Searches method names, descriptions, and use cases for matching terms. * Useful for finding the right method for a task. * * @example * ```typescript * const results = searchMethods('extract content'); * for (const { method, relevance } of results) { * console.log(`${method}: ${relevance}`); * } * ``` */ export declare function searchMethods(query: string): Array<{ method: string; relevance: 'high' | 'medium' | 'low'; }>; /** * Get example code for a use case. * * @description * Returns example code for common use cases. * * @example * ```typescript * const example = getExampleFor('scrape product pages'); * console.log(example); * ``` */ export declare function getExampleFor(useCase: string): string | undefined; /** * Generate llms.txt content for the SDK. * * @description * Creates an llms.txt file following the specification at llmstxt.org. * This provides LLMs with a curated view of the SDK documentation. * * @see https://llmstxt.org/ */ export declare function generateLlmsTxt(): string; //# sourceMappingURL=introspection.d.ts.map