/**
 * HITL Slack adapter — Block Kit approval messages + HMAC-verified callback handler.
 *
 * Plan v6 §1.7: channels are transports; state lives in HITLPort (Postgres).
 * HMAC-SHA256 verification uses Slack signing secret (replay window: 5 min).
 *
 * @public
 */
import type { HITLPort, HITLRequest } from "../ports/hitl.js";
/** Slack channel config — webhook URL only (no bot token). */
export interface SlackChannelConfig {
    /** Slack Incoming Webhook URL. Never hardcoded — pass at runtime. */
    webhookUrl: string;
}
export interface SendHITLSlackOpts {
    channel: SlackChannelConfig;
    hitlPort: HITLPort;
    request: HITLRequest;
    /** Optional cost in USD for the Block Kit display. */
    costDisplayUsd?: number;
}
export interface SlackApprovalResult {
    approvalId: string;
    messageTs: string;
}
/**
 * Record a new HITL approval request and post a Block Kit message to Slack.
 * Returns the approvalId (=request.id) and the Slack message timestamp.
 */
export declare function sendHITLApprovalRequestSlack(opts: SendHITLSlackOpts): Promise<SlackApprovalResult>;
interface BlockKitOpts {
    agentSource: string;
    question: string;
    approvalId: string;
    costDisplay: string;
    payloadSummary: string;
    deadline: string;
}
/**
 * Build a Slack Block Kit structure for HITL approval.
 * Exported for snapshot testing.
 */
export declare function buildBlockKit(opts: BlockKitOpts): unknown[];
export interface SlackCallbackHandlerOpts {
    hitlPort: HITLPort;
    /** Slack signing secret. Never hardcoded — pass at runtime. */
    signingSecret: string;
}
/** Raw HTTP request shape — agnostic of HTTP framework. */
export interface RawRequest {
    rawBody: string;
    headers: Record<string, string | string[] | undefined>;
}
export interface HandlerResult {
    status: number;
    body: unknown;
}
/**
 * Create a Slack interactive-payload callback handler.
 *
 * Wire to: POST /slack/interactive
 * Verifies HMAC-SHA256 signature, parses payload, calls hitlPort.resolve().
 * Idempotent: duplicate payloads for the same approvalId are silently ignored
 * (HITLPort throws InvalidStateTransitionError on non-pending → we swallow it).
 */
export declare function createSlackCallbackHandler(opts: SlackCallbackHandlerOpts): (req: RawRequest) => Promise<HandlerResult>;
/**
 * Verify the X-Slack-Signature header using HMAC-SHA256.
 * Signature format: `v0=<hex>` over `v0:{timestamp}:{rawBody}`.
 * Rejects timestamps older than 5 minutes (replay protection).
 *
 * @public — exported for unit tests
 */
export declare function verifySlackSignature(rawBody: string, timestamp: string, signature: string, secret: string): boolean;
export {};
//# sourceMappingURL=slack.d.ts.map