/** * Core interfaces for RecCall engine */ import type { Shortcut, ShortcutId, Recipe, RepositoryManifest, ValidationResult, CacheEntry, CoreConfig, PlatformContext, PlatformCapabilities, RepositoryUrl } from '../types.js'; export type { Shortcut, ShortcutId, Recipe, RepositoryManifest, ValidationResult, CacheEntry, CoreConfig, PlatformContext, PlatformCapabilities, RepositoryUrl }; /** * Context storage interface for CRUD operations on shortcuts */ export interface IContextStorage { /** * Record a new shortcut */ record(shortcut: ShortcutId, context: string, options?: Record): Promise; /** * Retrieve a shortcut by ID */ get(shortcut: ShortcutId): Promise; /** * List all shortcuts */ list(): Promise; /** * Update an existing shortcut */ update(shortcut: ShortcutId, context: string, options?: Record): Promise; /** * Delete a shortcut */ delete(shortcut: ShortcutId): Promise; /** * Purge all shortcuts */ purge(): Promise; /** * Check if a shortcut exists */ exists(shortcut: ShortcutId): Promise; /** * Get shortcuts by category */ getByCategory(category: string): Promise; } /** * Repository client interface for fetching recipes from remote sources */ export interface IRepositoryClient { /** * Fetch manifest from repository */ fetchManifest(repoUrl: RepositoryUrl): Promise; /** * Fetch a specific recipe */ fetchRecipe(repoUrl: RepositoryUrl, recipeFile: string): Promise; /** * Fetch all recipes from repository */ fetchAllRecipes(repoUrl: RepositoryUrl): Promise; /** * Search recipes in repository */ searchRecipes(repoUrl: RepositoryUrl, query: string): Promise; /** * Install a recipe from repository */ installRecipe(repoUrl: RepositoryUrl, shortcut: ShortcutId): Promise; /** * Validate repository URL */ validateRepository(repoUrl: RepositoryUrl): Promise; } /** * Cache manager interface for TTL-based caching */ export interface ICacheManager { /** * Get cached data */ get(key: string): Promise; /** * Set cached data with TTL */ set(key: string, data: T, ttl?: number): Promise; /** * Delete cached data */ delete(key: string): Promise; /** * Clear all cache */ clear(): Promise; /** * Check if key exists in cache */ has(key: string): Promise; /** * Get cache statistics */ getStats(): Promise<{ size: number; hitRate: number; missRate: number; }>; } /** * Recipe validator interface */ export interface IRecipeValidator { /** * Validate recipe format and content */ validate(recipe: Recipe): ValidationResult; /** * Validate shortcut ID format */ validateShortcutId(shortcut: string): ValidationResult; /** * Validate context content */ validateContext(context: string): ValidationResult; /** * Sanitize recipe data */ sanitize(recipe: Recipe): Recipe; } /** * Platform adapter interface for platform-specific integrations */ export interface IPlatformAdapter { /** * Platform identifier */ readonly platform: string; /** * Platform capabilities */ readonly capabilities: PlatformCapabilities; /** * Initialize the adapter */ initialize(context: PlatformContext): Promise; /** * Record a shortcut (platform-specific UI) */ recordShortcut(): Promise<{ shortcut: ShortcutId; context: string; } | null>; /** * Call a shortcut (platform-specific execution) */ callShortcut(shortcut: ShortcutId): Promise; /** * List shortcuts (platform-specific display) */ listShortcuts(): Promise; /** * Update a shortcut (platform-specific UI) */ updateShortcut(shortcut: ShortcutId): Promise<{ context: string; } | null>; /** * Delete a shortcut (platform-specific confirmation) */ deleteShortcut(shortcut: ShortcutId): Promise; /** * Purge all shortcuts (platform-specific confirmation) */ purgeShortcuts(): Promise; /** * Handle errors in platform-specific way */ handleError(error: Error): void; /** * Show success message in platform-specific way */ showSuccess(message: string): void; /** * Show warning message in platform-specific way */ showWarning(message: string): void; /** * Show info message in platform-specific way */ showInfo(message: string): void; } /** * Core engine interface */ export interface ICoreEngine { /** * Initialize the engine */ initialize(config?: Partial): Promise; /** * Record a shortcut */ record(shortcut: ShortcutId, context: string): Promise; /** * Call a shortcut */ call(shortcut: ShortcutId): Promise; /** * List all shortcuts */ list(): Promise; /** * Update a shortcut */ update(shortcut: ShortcutId, context: string): Promise; /** * Delete a shortcut */ delete(shortcut: ShortcutId): Promise; /** * Purge all shortcuts */ purge(): Promise; /** * Search shortcuts */ search(query: string): Promise; /** * Install recipe from repository */ installRecipe(repoUrl: RepositoryUrl, shortcut: ShortcutId): Promise; /** * List available recipes from repository */ listRecipes(repoUrl?: RepositoryUrl): Promise; /** * Search recipes in repository */ searchRecipes(query: string, repoUrl?: RepositoryUrl): Promise; /** * Reload starter pack */ reloadStarterPack(): Promise; /** * Get engine statistics */ getStats(): Promise<{ shortcutsCount: number; cacheStats: any; repositoryStats: any; }>; /** * Shutdown the engine */ shutdown(): Promise; } //# sourceMappingURL=interfaces.d.ts.map