import type { DaemonConfig, DaemonDangerConfig } from './types.js';
/**
 * DaemonServer — HTTP task server, disabled by default.
 *
 * Enable via: danger.daemon = true in config.
 * All routes require Bearer token auth (set via enable()).
 * POST /task    — submit a task; returns agentId.
 * GET  /task/:id — returns agent status.
 * GET  /status  — server health check.
 */
export declare class DaemonServer {
    private config;
    private enabled;
    private server;
    private port;
    private host;
    private agentManager;
    private readonly runtimeServices;
    private readonly integrationHelpers;
    private configManager;
    private authToken;
    private userAuth;
    private githubWebhookSecret;
    private automationManager;
    private runtimeBus;
    private readonly runtimeStore;
    private readonly runtimeDispatch;
    private readonly controlPlaneGateway;
    private readonly gatewayMethods;
    private readonly sessionBroker;
    private readonly approvalBroker;
    private readonly routeBindings;
    private readonly deliveryManager;
    private readonly surfaceRegistry;
    private readonly channelPolicy;
    private readonly channelPlugins;
    private readonly channelReplyPipeline;
    private readonly providerRuntime;
    private readonly builtinChannels;
    private readonly watcherRegistry;
    private readonly platformServiceManager;
    private readonly distributedRuntime;
    private readonly voiceService;
    private readonly webSearchService;
    private readonly knowledgeService;
    private readonly knowledgeGraphqlService;
    private readonly mediaProviders;
    private readonly multimodalService;
    private readonly artifactStore;
    private readonly serviceRegistry;
    private readonly serveFactory;
    private readonly pendingSurfaceReplies;
    private readonly controlPlaneHelper;
    private readonly surfaceDeliveryHelper;
    private readonly surfaceActionHelper;
    private readonly transportEventsHelper;
    private readonly httpRouter;
    private replyPoller;
    private readonly companionChatManager;
    private agentTaskAdapter;
    private agentTaskAdapterUnsub;
    private tlsState;
    private approvalBrokerUnsubscribe;
    /** Unsubscribe from controlPlane config key watchers; cleared on stop(). */
    private _configWatchUnsub;
    /** True while a config-driven restart is in progress — prevents re-entrancy. */
    private _restarting;
    /** Awaitable promise for the active restart cycle; null when idle. */
    private _restartingPromise;
    /** True if a config change arrived while _restarting was set; triggers a second cycle. */
    private _restartDirty;
    constructor(config?: DaemonConfig);
    listRecentControlPlaneEvents(limit?: number): readonly import('../control-plane/gateway.js').ControlPlaneRecentEvent[];
    /**
     * Enable the daemon. Requires danger.daemon = true in config.
     * The provided token is used to authenticate all incoming requests.
     * Returns true if enabled, false if the config forbids it.
     */
    enable(dangerConfig: DaemonDangerConfig, token?: string): boolean;
    /**
     * Start the daemon. Refuses to start if not explicitly enabled.
     */
    start(): Promise<void>;
    /**
     * Stop the daemon server.
     *
     * Services are stopped in reverse start order. Each service stop is raced
     * against a 10-second timeout so a hung service cannot block the full
     * shutdown sequence.
     */
    /**
     * Wait for any in-progress config-driven restart to settle.
     * Callers that change config mid-flight and need to know when the server
     * has rebounded should await this before inspecting state.
     */
    waitForRestart(): Promise<void>;
    stop(): Promise<void>;
    /**
     * Subscribe to controlPlane binding keys and restart the server on change.
     * Called once from start() after the server is up. Clears itself on stop().
     */
    private _attachControlPlaneConfigWatcher;
    /**
     * Returns true if the server is currently running.
     */
    get isRunning(): boolean;
    private extractAuthToken;
    private checkAuth;
    private requireAuthenticatedSession;
    private requireAdmin;
    private requireRemotePeer;
    private describeAuthenticatedPrincipal;
    private getGrantedGatewayScopes;
    private validateGatewayInvocation;
    private tryUpgradeControlPlaneWebSocket;
    private handleControlPlaneWebSocketOpen;
    private handleControlPlaneWebSocketMessage;
    private handleControlPlaneWebSocketClose;
    private invokeWebSocketControlPlaneCall;
    private invokeGatewayMethodCall;
    private handleRequest;
    private dispatchApiRoutes;
    private parseJsonBody;
    private parseOptionalJsonBody;
    private parseJsonText;
    private recordApiResponse;
    private handleApprovalAction;
    private trySpawnAgent;
    private syncSpawnedAgentTask;
    private syncFinishedAgentTask;
    private surfaceDeliveryEnabled;
    private pollPendingSurfaceReplies;
    private trustProxyEnabled;
    private signWebhookPayload;
}
//# sourceMappingURL=facade.d.ts.map