import { type EngineerEnvelope, type EngineerButtonValue, type SlackBlock } from './contract.js'; /** * Socket Mode plumbing for the customer-engineer Slack app. Credentials * (xoxb/xapp) come from GET /engineer/daemon/credentials at connect time and * live in memory only — this module never persists them. */ export interface ChannelMessageEvent { user?: string; bot_id?: string; channel?: string; ts?: string; thread_ts?: string; text?: string; metadata?: { event_type?: string; event_payload?: Record; }; subtype?: string; } export interface BlockActionPayload { type?: string; user?: { id?: string; }; channel?: { id?: string; }; message?: { ts?: string; text?: string; }; actions?: Array<{ action_id?: string; value?: string; }>; } export interface EngineerSlackHandle { botUserId: string; channelId: string; start(): Promise; stop(): Promise; /** Post an envelope with metadata + standard blocks (+ Accept/Decline row). */ postEnvelope(envelope: EngineerEnvelope, opts?: { buttons?: EngineerButtonValue; threadTs?: string; }): Promise<{ ts?: string; }>; /** Replace a previously posted button message with a decision line. */ updateMessage(ts: string, text: string, blocks?: SlackBlock[]): Promise; /** Read a thread's replies (conversations.replies) to see the other bot's in-thread messages. */ readThread(threadTs: string): Promise; onChannelMessage(cb: (event: ChannelMessageEvent) => void): void; onBlockAction(cb: (actionId: string, payload: BlockActionPayload) => void): void; onDisconnect(cb: () => void): void; } export interface CreateSlackHandleOptions { botToken: string; appToken: string; channelId: string; botUserId: string; } export declare function createSlackHandle(opts: CreateSlackHandleOptions): EngineerSlackHandle; //# sourceMappingURL=slack.d.ts.map