/** * Bounded LRU caches & lightweight durable markers for Slack runtime state. */ export declare class BoundedMap { private readonly maxSize; private readonly store; constructor(maxSize: number); get(key: K): V | undefined; has(key: K): boolean; set(key: K, value: V): void; delete(key: K): boolean; clear(): void; entries(): IterableIterator<[K, V]>; } export interface SlackUserProfile { id: string; name?: string; displayName?: string; realName?: string; title?: string; tz?: string; isBot?: boolean; fetchedAt: number; } export interface SlackChannelMeta { id: string; name?: string; channelType?: 'im' | 'mpim' | 'channel' | 'group'; topic?: string; purpose?: string; isPrivate?: boolean; fetchedAt: number; } export interface SlackThreadStarter { ts: string; user?: string; botId?: string; text: string; files?: Array>; fetchedAt: number; } export interface SlackAssistantContext { channelId?: string; teamId?: string; enterpriseId?: string | null; entities?: unknown[]; updatedAt: number; } export declare class SlackRuntimeCaches { readonly users: BoundedMap; readonly channels: BoundedMap; readonly dmChannelByUser: BoundedMap; readonly threadStarters: BoundedMap; /** Threads where this bot has posted at least once (`account:team:channel:threadTs`). */ readonly participatedThreads: BoundedMap; /** Threads whose root message was authored by this bot. */ readonly botAuthoredThreads: BoundedMap; /** Recent processed event IDs for Socket/HTTP dedupe. */ readonly seenEvents: BoundedMap; /** Assistant / Agent View active context per conversation (`account:channel:threadTs`). */ readonly assistantContext: BoundedMap; /** Detected Agent View markers keyed by `accountId:teamId:appId`. */ readonly agentViewApps: Set; /** Sliding-window timestamps for bot-to-bot loop protection keyed by `account:team:channel:threadTs`. */ private readonly botTurns; /** Ambient channel message buffer (`account:team:channel`). */ readonly ambientHistory: BoundedMap; /** Presence cooldown timestamps (`account:team:user`). */ readonly presenceCooldowns: BoundedMap; /** Last observed presence per user (`account:team:user`). */ readonly lastPresence: BoundedMap; private agentViewStorePath?; loadAgentViewMarkers(stateDir: string | undefined): void; markAgentViewApp(key: string): void; isAgentViewApp(key: string): boolean; markThreadParticipated(key: string): void; hasThreadParticipated(key: string): boolean; markBotAuthoredThread(key: string): void; isBotAuthoredThread(key: string): boolean; recordAmbientMessage(key: string, entry: { ts: string; user: string; text: string; }, maxEntries?: number): void; /** * Returns true if accepting this bot-authored turn stays within the loop protection budget. */ consumeBotLoopBudget(key: string, maxTurns: number, windowMs: number, now?: number): boolean; clear(): void; } export declare function scopeCacheKey(accountId: string, teamId: string | undefined, id: string): string;