UNPKG

@hotmeshio/hotmesh

Version:

Permanent-Memory Workflows & AI Agents

50 lines (49 loc) 1.95 kB
import { ILogger } from '../../../logger'; import { PostgresClientType } from '../../../../types/postgres'; import { StreamConfig, StreamStats } from '../../../../types/stream'; import { ProviderClient } from '../../../../types/provider'; /** * Get statistics for a specific stream. * Returns message count and other metrics. */ export declare function getStreamStats(client: PostgresClientType & ProviderClient, tableName: string, streamName: string, logger: ILogger): Promise<StreamStats>; /** * Get the depth (message count) for a specific stream. */ export declare function getStreamDepth(client: PostgresClientType & ProviderClient, tableName: string, streamName: string, logger: ILogger): Promise<number>; /** * Get depths for multiple streams in a single query. * More efficient than calling getStreamDepth multiple times. */ export declare function getStreamDepths(client: PostgresClientType & ProviderClient, tableName: string, streamNames: { stream: string; }[], logger: ILogger): Promise<{ stream: string; depth: number; }[]>; /** * Trim (soft delete) messages from a stream based on age or count. * Returns the number of messages expired. */ export declare function trimStream(client: PostgresClientType & ProviderClient, tableName: string, streamName: string, options: { maxLen?: number; maxAge?: number; exactLimit?: boolean; }, logger: ILogger): Promise<number>; /** * Check if notifications are enabled for the provider. */ export declare function isNotificationsEnabled(config?: StreamConfig): boolean; /** * Get provider-specific feature flags and capabilities. */ export declare function getProviderSpecificFeatures(config?: StreamConfig): { supportsBatching: boolean; supportsDeadLetterQueue: boolean; supportsOrdering: boolean; supportsTrimming: boolean; supportsRetry: boolean; supportsNotifications: boolean; maxMessageSize: number; maxBatchSize: number; };