/** * Factory for creating skill HTTP cache instances. * * @module skill/cache/skill-http-cache.factory */ import type { FrontMcpLogger } from '../../common/index.js'; import { type SkillHttpCache } from './skill-http-cache.js'; /** * Redis configuration options for the cache. * * Supports 'redis' (uses ioredis under the hood) and 'vercel-kv' providers. */ export interface SkillHttpCacheRedisOptions { /** Redis provider type */ provider: 'redis' | 'vercel-kv' | '@vercel/kv'; /** Redis host */ host?: string; /** Redis port */ port?: number; /** Redis password */ password?: string; /** Redis database number */ db?: number; } /** * Options for creating a skill HTTP cache. */ export interface SkillHttpCacheOptions { /** * Redis configuration for distributed caching. * If not provided, falls back to memory cache. */ redis?: SkillHttpCacheRedisOptions; /** * Cache TTL in milliseconds. * @default 60000 (1 minute) */ ttlMs?: number; /** * Key prefix for Redis cache. * @default 'frontmcp:skills:cache:' */ keyPrefix?: string; /** * Optional logger for cache operations. */ logger?: FrontMcpLogger; } /** * Result of creating a skill HTTP cache. */ export interface SkillHttpCacheResult { /** The cache instance */ cache: SkillHttpCache; /** The cache type that was created */ type: 'memory' | 'redis'; } /** * Create a skill HTTP cache from configuration. * * If Redis configuration is provided, creates a Redis-backed cache. * Otherwise, falls back to an in-memory cache. * * @param options - Cache configuration * @returns Cache instance and type * * @example Memory cache (default) * ```typescript * const { cache, type } = await createSkillHttpCache({ ttlMs: 30000 }); * // type === 'memory' * ``` * * @example Redis cache * ```typescript * const { cache, type } = await createSkillHttpCache({ * redis: { provider: 'redis', host: 'localhost', port: 6379 }, * ttlMs: 60000, * }); * // type === 'redis' * ``` */ export declare function createSkillHttpCache(options?: SkillHttpCacheOptions): Promise; //# sourceMappingURL=skill-http-cache.factory.d.ts.map