#!/usr/bin/env node
import { EventEmitter } from 'events';
import { SessionHostEndpoint, SessionHostRegistry, SessionHostRequest, SessionHostResponse } from '@adhdev/session-host-core';

interface SessionHostServerOptions {
    endpoint?: SessionHostEndpoint;
    appName?: string;
}
declare class SessionHostServer extends EventEmitter {
    readonly endpoint: SessionHostEndpoint;
    readonly registry: SessionHostRegistry;
    private runtimes;
    private readonly storage;
    private ipcServer;
    private sockets;
    private persistTimers;
    constructor(options?: SessionHostServerOptions);
    start(): Promise<void>;
    stop(): Promise<void>;
    handleRequest(request: SessionHostRequest): Promise<SessionHostResponse>;
    private requireRuntime;
    private getAttachedClient;
    private emitEvent;
    private handleIncomingRequest;
    private schedulePersist;
    private persistNow;
    flushAllPersistence(): void;
    private restorePersistedRuntimes;
    private buildPayloadFromRecord;
    private startRuntime;
}

export { SessionHostServer, type SessionHostServerOptions };
