/** Discord interaction types (subset used here) */
export declare const DiscordInteractionType: {
    readonly Ping: 1;
    readonly ApplicationCommand: 2;
    readonly MessageComponent: 3;
    readonly ApplicationCommandAutocomplete: 4;
    readonly ModalSubmit: 5;
};
/** Discord interaction response types */
export declare const DiscordInteractionResponseType: {
    readonly Pong: 1;
    readonly ChannelMessageWithSource: 4;
    readonly DeferredChannelMessageWithSource: 5;
    readonly DeferredUpdateMessage: 6;
};
export interface DiscordInteraction {
    id: string;
    type: number;
    applicationId: string;
    token: string;
    guildId?: string;
    channelId?: string;
    userId: string;
    commandName?: string;
    commandOptions?: Array<{
        name: string;
        value: unknown;
    }>;
    raw: Record<string, unknown>;
}
export interface DiscordOAuthAuthorizeOptions {
    readonly clientId: string;
    readonly redirectUri?: string;
    readonly scopes?: readonly string[];
    readonly permissions?: string;
    readonly guildId?: string;
    readonly disableGuildSelect?: boolean;
    readonly state?: string;
}
export interface DiscordApplicationCommandOption {
    readonly type: number;
    readonly name: string;
    readonly description: string;
    readonly required?: boolean;
}
export interface DiscordApplicationCommand {
    readonly id?: string;
    readonly application_id?: string;
    readonly guild_id?: string;
    readonly name: string;
    readonly description: string;
    readonly type?: number;
    readonly options?: readonly DiscordApplicationCommandOption[];
    readonly default_member_permissions?: string | null;
    readonly dm_permission?: boolean;
}
export interface DiscordGatewayBotResponse {
    readonly url: string;
    readonly shards: number;
    readonly session_start_limit?: Record<string, unknown>;
}
export interface DiscordGatewayDispatch {
    readonly op: number;
    readonly t?: string;
    readonly s?: number;
    readonly d?: Record<string, unknown> | null;
}
export interface DiscordGatewayClientOptions {
    readonly token: string;
    readonly integration: DiscordIntegration;
    readonly intents?: number;
    readonly gatewayUrl?: string;
    readonly onDispatch: (dispatch: DiscordGatewayDispatch, client: DiscordGatewayClient) => void | Promise<void>;
    readonly WebSocketImpl?: typeof WebSocket;
}
export declare const DiscordGatewayOpcode: {
    readonly Dispatch: 0;
    readonly Heartbeat: 1;
    readonly Identify: 2;
    readonly Hello: 10;
    readonly HeartbeatAck: 11;
};
export declare const DiscordGatewayIntent: {
    readonly Guilds: number;
    readonly GuildMessages: number;
    readonly DirectMessages: number;
    readonly MessageContent: number;
};
/**
 * DiscordIntegration — handles inbound interaction verification/parsing and
 * outbound message posting for Discord slash commands and webhooks.
 *
 * Env vars:
 *   DISCORD_WEBHOOK_URL   — webhook URL for outbound posting
 *   DISCORD_BOT_TOKEN     — bot token for Discord API calls
 *   DISCORD_PUBLIC_KEY    — Ed25519 public key for interaction verification
 */
export declare class DiscordIntegration {
    private webhookUrl?;
    private botToken?;
    constructor(webhookUrl?: string | undefined, botToken?: string | undefined);
    static buildOAuthAuthorizeUrl(options: DiscordOAuthAuthorizeOptions): string;
    static buildGoodVibesCommand(): DiscordApplicationCommand;
    getGatewayBot(token?: string | undefined): Promise<DiscordGatewayBotResponse>;
    getCurrentBotUser(token?: string | undefined): Promise<Record<string, unknown>>;
    listGuildChannels(guildId: string, token?: string | undefined): Promise<Array<Record<string, unknown>>>;
    listGuildMembers(guildId: string, options?: {
        readonly token?: string;
        readonly limit?: number;
        readonly after?: string;
    }): Promise<Array<Record<string, unknown>>>;
    registerGlobalCommand(applicationId: string, command: DiscordApplicationCommand, token?: string | undefined): Promise<DiscordApplicationCommand>;
    registerGuildCommand(applicationId: string, guildId: string, command: DiscordApplicationCommand, token?: string | undefined): Promise<DiscordApplicationCommand>;
    bulkOverwriteGuildCommands(applicationId: string, guildId: string, commands: readonly DiscordApplicationCommand[], token?: string | undefined): Promise<DiscordApplicationCommand[]>;
    /**
     * Verify an inbound Discord interaction using Ed25519.
     * Discord signs: timestamp + body with the application's public key.
     */
    verifySignature(body: string, signature: string, timestamp: string, publicKey: string): Promise<boolean>;
    /**
     * Parse an inbound Discord interaction payload into a typed DiscordInteraction.
     */
    parseInteraction(body: Record<string, unknown>): DiscordInteraction;
    /**
     * Post a message via Discord webhook URL.
     */
    postWebhook(content: string, embeds?: unknown[], url?: string): Promise<void>;
    /**
     * Post a message to a channel via the Discord Bot API.
     * Requires DISCORD_BOT_TOKEN.
     */
    postMessage(channelId: string, content: string, embeds?: unknown[]): Promise<void>;
    /**
     * Respond to an interaction via the Discord interactions endpoint.
     * Use this to send the deferred acknowledgment or a follow-up.
     */
    respondToInteraction(interactionId: string, interactionToken: string, type: number, data?: Record<string, unknown>): Promise<void>;
    /**
     * Edit the original deferred interaction response (follow-up).
     */
    editOriginalResponse(applicationId: string, interactionToken: string, content: string, embeds?: unknown[]): Promise<void>;
    private apiFetch;
    /**
     * Format an agent result as a Discord embed object.
     */
    formatAgentResult(agentId: string, task: string, result: string): unknown;
    /**
     * Format a session summary as a Discord embed object.
     */
    formatSessionSummary(sessionId: string, messageCount: number, tokensUsed: number): unknown;
    private hexToBytes;
    private validateSnowflake;
}
export declare class DiscordGatewayClient {
    private readonly options;
    private socket;
    private heartbeat;
    private sequence;
    private started;
    private readonly WebSocketImpl;
    constructor(options: DiscordGatewayClientOptions);
    start(): Promise<DiscordGatewayBotResponse>;
    stop(): void;
    send(op: number, d: unknown): void;
    get isStarted(): boolean;
    private handleMessage;
    private identify;
    private startHeartbeat;
    private cleanup;
}
//# sourceMappingURL=discord.d.ts.map