/** * RecCall JavaScript SDK * Official SDK for Node.js and browser environments * Provides a clean API wrapper around RecCall REST API endpoints */ export interface ReccallSDKConfig { /** * Base URL for the RecCall API server * Default: http://localhost:3000/api/reccall */ baseUrl?: string; /** * API key or authentication token (optional) * Can be set via RECCALL_API_KEY environment variable */ apiKey?: string; /** * Custom fetch function (for Node.js or custom implementations) */ fetch?: typeof fetch; /** * Request timeout in milliseconds * Default: 30000 (30 seconds) */ timeout?: number; } export interface Shortcut { id: string; context: string; createdAt?: string; updatedAt?: string; } export interface Context { id: string; name: string; content: string; type: 'static' | 'dynamic' | 'hybrid'; source: 'local' | 'global' | 'remote'; description?: string; tags?: string[]; category?: string; createdAt: string; updatedAt: string; usageCount?: number; lastUsedAt?: string; } export interface CreateStaticContextParams { name: string; content: string; source: 'local' | 'global'; tags?: string[]; category?: string; description?: string; repository?: string; } export interface CreateDynamicContextParams { name: string; messages: Array<{ role: 'user' | 'assistant'; content: string; timestamp?: Date | string; }>; source: 'local' | 'global'; tags?: string[]; } export interface ContextSearchFilters { source?: 'local' | 'global' | 'remote' | 'all'; type?: 'static' | 'dynamic' | 'hybrid' | 'all'; } export interface Stats { shortcutsCount: number; contextsCount?: number; cacheStats: { size: number; hitRate: number; }; repositoryStats: { enabled: boolean; }; } /** * RecCall JavaScript SDK * * @example * ```typescript * import { ReccallSDK } from 'reccall/sdk'; * * const client = new ReccallSDK({ * baseUrl: 'http://localhost:3000/api/reccall', * apiKey: 'your-api-key' * }); * * // Create a context * const context = await client.createContext({ * name: 'react-patterns', * content: 'Always use TypeScript...', * source: 'global' * }); * * // Search contexts * const results = await client.searchContexts('React'); * ``` */ export declare class ReccallSDK { private baseUrl; private apiKey; private fetchFn; private timeout; constructor(config?: ReccallSDKConfig); /** * Get Node.js fetch (for server-side usage) */ private getNodeFetch; /** * Make HTTP request with timeout and error handling */ private request; /** * List all shortcuts */ listShortcuts(): Promise; /** * Get a specific shortcut by ID */ getShortcut(id: string): Promise; /** * Create a new shortcut */ createShortcut(id: string, context: string): Promise; /** * Update an existing shortcut */ updateShortcut(id: string, context: string): Promise; /** * Delete a shortcut */ deleteShortcut(id: string): Promise; /** * Search shortcuts by query */ searchShortcuts(query: string): Promise; /** * Purge all shortcuts */ purgeShortcuts(): Promise; /** * Create a static context */ createContext(params: CreateStaticContextParams): Promise; /** * Create a dynamic context from conversation */ createContextFromConversation(params: CreateDynamicContextParams): Promise; /** * Get a context by ID or name */ getContext(identifier: string): Promise; /** * List all contexts with optional filters */ listContexts(filters?: ContextSearchFilters): Promise; /** * Search contexts by query with optional filters */ searchContexts(query: string, filters?: ContextSearchFilters): Promise; /** * Update a context */ updateContext(id: string, updates: Partial): Promise; /** * Delete a context */ deleteContext(id: string): Promise; /** * Get context statistics */ getContextStats(contextId: string): Promise<{ usageCount: number; lastUsedAt?: string; createdAt: string; updatedAt: string; }>; /** * Get engine statistics */ getStats(): Promise; /** * Health check */ healthCheck(): Promise<{ status: string; timestamp: string; }>; } export default function createReccallSDK(config?: ReccallSDKConfig): ReccallSDK; //# sourceMappingURL=index.d.ts.map