/** * Discord bot — sends session updates to a channel, relays user replies back. * Auto-reconnects on disconnect. Rate-limited sends to avoid Discord 429s. */ import { EventEmitter } from 'node:events'; export interface DiscordConfig { token: string; channelId: string; allowedUserIds?: string[]; } /** * Is this Discord user ID allowed to send commands? * * Current contract (matches README): an empty or missing `allowedUserIds` * list means **anyone** in the channel is allowed. That's a footgun — a * user forgetting to set the field opens the bot to any channel member — * but changing the default is a breaking change. Exported so the * behavior can be pinned by a unit test; also so callers can audit * "what would happen" without triggering a Discord round-trip. */ export declare function isAllowed(allowedUserIds: string[] | undefined, authorId: string): boolean; export declare class DiscordBot extends EventEmitter { private client; private channel; private config; private ready; private reconnecting; private sendQueue; private sending; constructor(config: DiscordConfig); private scheduleReconnect; start(): Promise; stop(): Promise; /** Queue a message — rate-limited, auto-retries on failure. */ send(content: string): Promise; private drainQueue; /** Send a formatted session update. */ sendSessionUpdate(opts: { type: string; sessionId: string; project?: string; content?: string; }): Promise; }