import { type RelaycastMessagingOptions } from './relaycast-client.js';
import type { RelayActionInvocation, RelayActionInvocationAck, RelayCompleteInvocationInput, RelayAgent, RelayAgentPresence, RelayAgentRegistration, RelayChannel, RelayChannelMember, RelayChannelReadStatus, RelayCapability, RelayCreateChannelInput, RelayCreateGroupDirectMessageInput, RelayCreateInboundWebhookInput, RelayCreateSubscriptionInput, RelayCreateWebhookInput, RelayDeliveryResult, RelayEventSubscription, RelayInboundWebhook, RelaySubscribeInput, RelayWebhookSubscription, RelayGroupDirectConversation, RelayRegisterCapabilityInput, RelayWebhook, RelayWorkspaceInfo, RelayWorkspaceFleetNodesConfig, InboxAckInput, InboxDeferInput, InboxFailInput, InboxItem, InboxListInput, InboxListResult, InboxMarkReadInput, InboxSubscribeInput, RelayInbox, RelayListAgentsOptions, RelayListChannelsOptions, RelayListNodesOptions, RelayListDirectMessagesInput, RelayMessage, RelayMessageListOptions, RelayMessageReaction, RelayMessagingCapabilities, RelayMessagingClient, RelayMessagingEventMap, RelayNode, RelayReadReceipt, RelayRegisterAgentInput, RelayReplyMessageInput, RelaySearchResult, RelaySendChannelMessageInput, RelaySendDirectMessageInput, RelaySendGroupDirectMessageInput, RelaySpawnPlacementAck, RelaySpawnPlacementInput, RelayThread, RelayTrigger, RelayTriggerInput, RelayUpdateAgentInput, RelayUpdateChannelInput } from './types.js';
export { RelayPlacementError } from './relaycast-placement.js';
export type { RelaycastMessagingOptions } from './relaycast-client.js';
export declare class RelaycastMessagingClient implements RelayMessagingClient {
    readonly capabilities: RelayMessagingCapabilities;
    private readonly relaycast;
    private readonly agentClient?;
    private readonly selfNodeName?;
    private readonly placementTtlMs;
    private readonly maxQueuedPlacements;
    private readonly placementLog?;
    private queuedPlacements;
    private readonly eventHandlers;
    private eventUnsubscribe?;
    constructor(options: RelaycastMessagingOptions);
    readonly agents: {
        list: (options?: RelayListAgentsOptions) => Promise<RelayAgent[]>;
        get: (name: string) => Promise<RelayAgent>;
        register: (input: RelayRegisterAgentInput) => Promise<RelayAgentRegistration>;
        registerOrRotate: (input: RelayRegisterAgentInput) => Promise<RelayAgentRegistration>;
        me: () => Promise<RelayAgent>;
        update: (name: string, input: RelayUpdateAgentInput) => Promise<RelayAgent>;
        delete: (name: string) => Promise<void>;
        presence: () => Promise<RelayAgentPresence[]>;
    };
    readonly channels: {
        list: (options?: RelayListChannelsOptions) => Promise<RelayChannel[]>;
        get: (name: string) => Promise<RelayChannel>;
        create: (input: RelayCreateChannelInput) => Promise<RelayChannel>;
        update: (name: string, input: RelayUpdateChannelInput) => Promise<RelayChannel>;
        archive: (name: string) => Promise<void>;
        join: (name: string) => Promise<void>;
        leave: (name: string) => Promise<void>;
        invite: (channel: string, agent: string) => Promise<void>;
        members: (name: string) => Promise<RelayChannelMember[]>;
        mute: (name: string) => Promise<void>;
        unmute: (name: string) => Promise<void>;
    };
    readonly messages: {
        send: (input: RelaySendChannelMessageInput) => Promise<RelayMessage>;
        list: (channel: string, options?: RelayMessageListOptions) => Promise<RelayMessage[]>;
        get: (id: string) => Promise<RelayMessage>;
        reply: (input: RelayReplyMessageInput) => Promise<RelayMessage>;
        direct: (input: RelaySendDirectMessageInput) => Promise<RelayMessage>;
        groupDirect: (input: RelaySendGroupDirectMessageInput) => Promise<RelayMessage>;
        createGroupDirect: (input: RelayCreateGroupDirectMessageInput) => Promise<RelayGroupDirectConversation>;
        listDirect: (input: RelayListDirectMessagesInput) => Promise<RelayMessage[]>;
        markRead: (messageId: string) => Promise<RelayReadReceipt>;
        readers: (messageId: string) => Promise<RelayReadReceipt[]>;
        readStatus: (channel: string) => Promise<RelayChannelReadStatus[]>;
        reactions: (messageId: string) => Promise<RelayMessageReaction[]>;
        react: (messageId: string, emoji: string) => Promise<RelayMessageReaction>;
        unreact: (messageId: string, emoji: string) => Promise<void>;
        search: (query: string, options?: {
            channel?: string;
            from?: string;
            limit?: number;
            before?: string;
            after?: string;
        }) => Promise<RelaySearchResult[]>;
    };
    readonly threads: {
        get: (messageId: string, options?: RelayMessageListOptions) => Promise<RelayThread>;
        reply: (input: RelayReplyMessageInput) => Promise<RelayMessage>;
    };
    readonly inbox: {
        get: (options?: {
            limit?: number;
        }) => Promise<RelayInbox>;
        /**
         * List durable deliveries queued for the authenticated agent. The
         * relaycast ledger replays non-terminal items (accepted + deferred) in
         * FIFO order with the message payload embedded. The underlying API has no
         * cursor, so `nextCursor` is never set and `before`/`after` are ignored.
         */
        list: (input?: InboxListInput) => Promise<InboxListResult>;
        /**
         * Stream durable deliveries: seed from the non-terminal queue, then push
         * items announced by `delivery.accepted` WebSocket events, deduplicated by
         * delivery id. Falls back to an empty stream without an agent client.
         */
        subscribe: (input?: InboxSubscribeInput) => AsyncIterable<InboxItem>;
        ack: (input: InboxAckInput) => Promise<RelayDeliveryResult>;
        fail: (input: InboxFailInput) => Promise<RelayDeliveryResult>;
        defer: (input: InboxDeferInput) => Promise<RelayDeliveryResult>;
        markRead: (input: InboxMarkReadInput) => Promise<RelayDeliveryResult>;
    };
    readonly events: {
        connect: () => void;
        disconnect: () => Promise<void>;
        subscribe: (channels: string[]) => void;
        unsubscribe: (channels: string[]) => void;
        on: <K extends keyof RelayMessagingEventMap>(event: K, handler: (...args: RelayMessagingEventMap[K]) => void | Promise<void>) => (() => void);
    };
    /**
     * Durable delivery transitions keyed by the relaycast delivery id (the
     * `InboxItem.id` returned by `inbox.list`/`inbox.subscribe`). Transitions
     * are idempotent on the server.
     */
    readonly deliveries: {
        ack: (deliveryId: string) => Promise<RelayDeliveryResult>;
        fail: (deliveryId: string, reason?: string) => Promise<RelayDeliveryResult>;
        defer: (deliveryId: string, deferUntil?: string) => Promise<RelayDeliveryResult>;
    };
    readonly integrations: {
        webhooks: {
            create: (input: RelayCreateWebhookInput) => Promise<RelayWebhook>;
            list: () => Promise<RelayWebhook[]>;
            delete: (id: string) => Promise<void>;
            trigger: (id: string, payload?: Record<string, unknown>) => Promise<unknown>;
        };
        subscriptions: {
            create: (input: RelayCreateSubscriptionInput) => Promise<RelayEventSubscription>;
            list: () => Promise<RelayEventSubscription[]>;
            get: (id: string) => Promise<RelayEventSubscription>;
            delete: (id: string) => Promise<void>;
        };
    };
    readonly webhooks: {
        createInbound: (input: RelayCreateInboundWebhookInput) => Promise<RelayInboundWebhook>;
        subscribe: (input: RelaySubscribeInput) => Promise<RelayWebhookSubscription>;
        list: () => Promise<RelayInboundWebhook[]>;
        delete: (webhookId: string) => Promise<void>;
        subscriptions: () => Promise<RelayWebhookSubscription[]>;
        unsubscribe: (id: string) => Promise<void>;
    };
    readonly commands: {
        register: (input: RelayRegisterCapabilityInput) => Promise<RelayCapability>;
        list: () => Promise<RelayCapability[]>;
        delete: (command: string) => Promise<void>;
        available: () => boolean;
        agentScoped: () => boolean;
        invoke: (name: string, input?: Record<string, unknown>) => Promise<RelayActionInvocationAck>;
        getInvocation: (name: string, invocationId: string) => Promise<RelayActionInvocation>;
        completeInvocation: (name: string, invocationId: string, data: RelayCompleteInvocationInput) => Promise<RelayActionInvocation>;
    };
    readonly nodes: {
        list: (options?: RelayListNodesOptions) => Promise<RelayNode[]>;
        get: (name: string) => Promise<RelayNode | null>;
    };
    readonly placement: {
        spawn: (input: RelaySpawnPlacementInput) => Promise<RelaySpawnPlacementAck>;
    };
    readonly triggers: {
        list: () => Promise<RelayTrigger[]>;
        create: (input: RelayTriggerInput) => Promise<RelayTrigger>;
        update: (id: string, input: Partial<RelayTriggerInput>) => Promise<RelayTrigger>;
        delete: (id: string) => Promise<void>;
    };
    readonly workspace: {
        info: () => Promise<RelayWorkspaceInfo>;
        fleetNodes: {
            get: () => Promise<RelayWorkspaceFleetNodesConfig>;
            set: (enabled: boolean) => Promise<RelayWorkspaceFleetNodesConfig>;
            inherit: () => Promise<RelayWorkspaceFleetNodesConfig>;
        };
    };
    private resolvePlacementNode;
    private selectPlacementNode;
    private nodeHasCapability;
    private nodeMapsRepo;
    private reconcilePlacement;
    private logPlacement;
    private requireWebhooks;
    private requireSubscriptions;
    private requireActions;
    private requireNodes;
    private requireTriggers;
    private requireWorkspaceFleetNodes;
    private requireAgentActions;
    private requireAgentClient;
    private requireWorkspaceDmMessages;
    /**
     * The durable delivery API of the agent client, when present. Requires an
     * agent-scoped client built from `@relaycast/sdk` 2.5+ (or a compatible
     * injected `agentClient`).
     */
    private deliverySurface;
    private createInboxSubscription;
    private emptyInboxSubscription;
    private unsupportedInboxDelivery;
    private normalizeDirectResponse;
    private addEventListener;
    private emitEvent;
}
//# sourceMappingURL=relaycast.d.ts.map