import { PersistentStore } from '@pellux/goodvibes-sdk/platform/state/persistent-store';
import { RouteBindingManager } from '../channels/index.js';
import type { AutomationRouteBinding } from '@pellux/goodvibes-sdk/platform/automation/routes';
import type { SharedSessionCompletion, SharedSessionContinuationRunner, SharedSessionInputRecord } from '@pellux/goodvibes-sdk/platform/control-plane/session-intents';
import type { FindSharedSessionOptions, SharedSessionMessage, SharedSessionParticipant, SharedSessionRecord, SharedSessionSubmission, SteerSharedSessionMessageInput, SubmitSharedSessionMessageInput } from '@pellux/goodvibes-sdk/platform/control-plane/session-types';
import { type SharedSessionAgentStatusProvider, type SharedSessionEventPublisher, type SharedSessionMessageSender, type SharedSessionStoreSnapshot } from '@pellux/goodvibes-sdk/platform/control-plane/session-broker-internals';
export declare class SharedSessionBroker {
    private readonly store;
    private readonly routeBindings;
    private readonly agentStatusProvider;
    private readonly messageSender;
    private readonly sessions;
    private readonly messages;
    private readonly inputs;
    private eventPublisher;
    private continuationRunner;
    private loaded;
    constructor(config: {
        readonly store?: PersistentStore<SharedSessionStoreSnapshot>;
        readonly storePath?: string;
        readonly routeBindings: RouteBindingManager;
        readonly agentStatusProvider: SharedSessionAgentStatusProvider;
        readonly messageSender: SharedSessionMessageSender;
    });
    setEventPublisher(publisher: SharedSessionEventPublisher | null): void;
    setContinuationRunner(runner: SharedSessionContinuationRunner | null): void;
    start(): Promise<void>;
    listSessions(limit?: number): SharedSessionRecord[];
    getSession(sessionId: string): SharedSessionRecord | null;
    findPreferredSession(options?: FindSharedSessionOptions): Promise<SharedSessionRecord | null>;
    ensureSession(input?: {
        readonly sessionId?: string;
        readonly title?: string;
        readonly metadata?: Record<string, unknown>;
        readonly routeBinding?: AutomationRouteBinding;
        readonly participant?: SharedSessionParticipant;
    }): Promise<SharedSessionRecord>;
    getMessages(sessionId: string, limit?: number): SharedSessionMessage[];
    getInputs(sessionId: string, limit?: number): SharedSessionInputRecord[];
    createSession(input?: {
        readonly id?: string;
        readonly title?: string;
        readonly metadata?: Record<string, unknown>;
        readonly routeBinding?: AutomationRouteBinding;
        readonly participant?: SharedSessionParticipant;
    }): Promise<SharedSessionRecord>;
    closeSession(sessionId: string): Promise<SharedSessionRecord | null>;
    reopenSession(sessionId: string): Promise<SharedSessionRecord | null>;
    bindAgent(sessionId: string, agentId: string): Promise<SharedSessionRecord | null>;
    submitMessage(input: SubmitSharedSessionMessageInput): Promise<SharedSessionSubmission>;
    steerMessage(input: SteerSharedSessionMessageInput): Promise<SharedSessionSubmission>;
    followUpMessage(input: SubmitSharedSessionMessageInput): Promise<SharedSessionSubmission>;
    appendSystemMessage(sessionId: string, body: string, metadata?: Record<string, unknown>): Promise<SharedSessionMessage | null>;
    completeAgent(sessionId: string, agentId: string, body: string, metadata?: Record<string, unknown>): Promise<SharedSessionCompletion | null>;
    cancelInput(sessionId: string, inputId: string): Promise<SharedSessionInputRecord | null>;
    rebindRoute(bindingId: string, sessionId: string): Promise<SharedSessionRecord | null>;
    private appendMessage;
    private attachParticipantAndRoute;
    private resolveActiveAgentId;
    private resolveBinding;
    private buildContinuationTask;
    private persist;
    private publishUpdate;
    private publishInputLifecycleEvent;
    private handleIntent;
    private recordInput;
    private updateInput;
    private claimNextQueuedInput;
    private finalizeAgentInputs;
    private runQueuedFollowUp;
    private refreshPendingInputCount;
}
//# sourceMappingURL=session-broker.d.ts.map