import { AgentManager } from '../tools/agent/index.js';
import type { CompanionLLMProvider } from '../companion/companion-chat-manager.js';
import type { ProviderRegistry } from '../providers/registry.js';
import type { DaemonConfig } from './types.js';
export type { ResolvedDaemonFacadeRuntime, DaemonFacadeCollaborators, CreateDaemonFacadeCollaboratorsOptions, } from './facade-types.js';
import type { ResolvedDaemonFacadeRuntime, DaemonFacadeCollaborators, CreateDaemonFacadeCollaboratorsOptions } from './facade-types.js';
/**
 * Creates the CompanionLLMProvider adapter that bridges the daemon's
 * ProviderRegistry (chat-based) to the queue-driven async-generator interface
 * expected by CompanionChatManager.
 *
 * Extracted for testability: the adapter can be unit-tested in isolation
 * without constructing a full daemon facade.
 *
 * Error handling:
 * - If no provider is configured or the model is unavailable, the adapter
 *   immediately yields `{ type: 'error', error: 'No provider available ...' }`
 *   and returns. This is a graceful degradation — the companion chat session
 *   receives a structured error rather than an unhandled exception.
 * - If the underlying provider.chat() rejects mid-stream, the error is
 *   caught in the `.catch()` handler and surfaced as a final
 *   `{ type: 'error', error: <message> }` chunk after all buffered deltas
 *   have been yielded. The generator never throws; callers always receive
 *   a terminal chunk.
 */
export declare function createCompanionProviderAdapter(providerRegistry: ProviderRegistry): CompanionLLMProvider;
export declare function resolveDaemonFacadeRuntime(config: DaemonConfig): ResolvedDaemonFacadeRuntime;
export declare function createDaemonFacadeCollaborators(options: CreateDaemonFacadeCollaboratorsOptions): DaemonFacadeCollaborators;
export declare function configureDaemonSessionContinuation(options: {
    readonly sessionBroker: import('../control-plane/index.js').SharedSessionBroker;
    readonly trySpawnAgent: (input: Parameters<AgentManager['spawn']>[0], logLabel?: string, sessionId?: string) => import('../tools/agent/index.js').AgentRecord | Response;
    readonly queueSurfaceReplyFromBinding: (binding: import('../automation/routes.js').AutomationRouteBinding | undefined, input: {
        readonly agentId: string;
        readonly task: string;
        readonly agentTask?: string | undefined;
        readonly workflowChainId?: string | undefined;
        readonly sessionId?: string | undefined;
    }) => void;
}): void;
//# sourceMappingURL=facade-composition.d.ts.map