@mondaydotcomorg/atp-runtime
Version:
Runtime SDK injected into sandbox for Agent Tool Protocol
39 lines • 1.27 kB
TypeScript
import type { CacheBackend, CacheConfig } from './types';
/**
* In-memory cache implementation using node-cache
*/
export declare class MemoryCacheBackend implements CacheBackend {
private cache;
constructor(config?: {
maxKeys?: number;
defaultTTL?: number;
checkPeriod?: number;
});
get<T>(key: string): Promise<T | null>;
set(key: string, value: unknown, ttl?: number): Promise<void>;
delete(key: string): Promise<void>;
has(key: string): Promise<boolean>;
clear(): Promise<void>;
}
/**
* Redis cache implementation (lazy-loaded only if configured)
*/
export declare class RedisCacheBackend implements CacheBackend {
private client;
private connected;
constructor(config: NonNullable<CacheConfig['redis']>);
get<T>(key: string): Promise<T | null>;
set(key: string, value: unknown, ttl?: number): Promise<void>;
delete(key: string): Promise<void>;
has(key: string): Promise<boolean>;
clear(): Promise<void>;
}
/**
* Initializes the cache system with configuration
*/
export declare function initializeCache(config: CacheConfig): void;
/**
* Get the current cache backend
*/
export declare function getCacheBackend(): CacheBackend;
//# sourceMappingURL=backends.d.ts.map