import type { SlackConfigurationProbeResult, SlackDiagnosticProvider, SlackMessageSearchResult, SlackOneShotTestResult, SlackPostedMessage, SlackProviderClient, SlackSocketEnvelope } from "./slack-provider"; export type SlackProviderErrorCode = "connection" | "protocol" | "web_api" | "rate_limited"; /** A Slack transport failure whose fields are safe to surface without credentials. */ export declare class SlackProviderError extends Error { readonly code: SlackProviderErrorCode; readonly operation: string; readonly status?: number | undefined; readonly retryAfterMs?: number | undefined; /** The server may have accepted the request before its response became unusable. */ readonly mayHaveBeenAccepted: boolean; readonly retryable: boolean; constructor(code: SlackProviderErrorCode, operation: string, status?: number | undefined, retryAfterMs?: number | undefined, /** The server may have accepted the request before its response became unusable. */ mayHaveBeenAccepted?: boolean); } export interface SlackWebSocket { readonly readyState: number; onopen: ((event: Event) => void) | null; onmessage: ((event: MessageEvent) => void) | null; onclose: ((event: CloseEvent) => void) | null; onerror: ((event: Event) => void) | null; send(data: string): void; close(): void; } export interface SlackLiveProviderOptions { appToken: string; botToken: string; fetch?: (input: string, init?: RequestInit) => Promise; webSocket?: (url: string) => SlackWebSocket; now?: () => number; sleep?: (milliseconds: number, signal?: AbortSignal) => Promise; reconnectDelayMs?: number; maxRateLimitRetries?: number; maxRetryAfterMs?: number; activityTimeoutMs?: number; } /** * Production Socket Mode and Web API client. It keeps all connection state in * memory and deliberately never maintains a Slack cursor. */ export declare class SlackLiveProvider implements SlackProviderClient, SlackDiagnosticProvider { #private; get transportHealthy(): boolean; constructor(options: SlackLiveProviderOptions); probeConfiguration(signal?: AbortSignal): Promise; sendOneShotTest(input: { channel: string; message: string; idempotencyKey: string; signal?: AbortSignal; }): Promise; start(onEnvelope: (envelope: SlackSocketEnvelope) => void | Promise): Promise; stop(): Promise; ack(envelopeId: string): Promise; postMessage(input: { channel: string; text: string; threadTs?: string; clientMsgId: string; signal?: AbortSignal; }): Promise; findMessageByClientMsgId(input: { channel: string; clientMsgId: string; threadTs?: string; signal?: AbortSignal; }): Promise; /** * Confirm that `ts` addresses a real message in `channel`. Slack answers * `conversations.replies` with the addressed message first; a timestamp that * is unknown, deleted, or lives in another channel produces a Web API error * instead, which surfaces as a `SlackProviderError` the caller treats as an * unverified root. */ findMessageByTimestamp(input: { channel: string; ts: string; }): Promise; }