import { AgentManager } from '../tools/agent/index.js'; import { type ConversationGateConfigReader } from '../agents/conversation-gate.js'; import type { ModelIdCandidate } from '../providers/model-id-resolution.js'; import { DaemonSurfaceActionHelper } from './surface-actions.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: }` 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[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; /** The live registry's model candidates, enables bare model id resolution in routing overrides. */ readonly modelCandidates?: (() => readonly ModelIdCandidate[]) | undefined; /** * The surface helper holding the conversation-first gate's dependencies. A * follow-up in a shared session is the SAME message class the ingress gate * guards, so it gets the same treatment: conversation is answered with the * chain suppressed, and a work-shaped follow-up is PROPOSED over the channel * it arrived on (a Response, reported here as "no agent started"). * * Absent, an embedder that has not wired the gate, still fails closed via * `continuationChainOptions` below. A continuation never opens a chain just * because nobody installed a gate. */ readonly surfaceActionHelper?: Pick | undefined; /** Reads `conversationGate.*` so both halves of the gate obey one configuration. */ readonly configReader?: ConversationGateConfigReader | undefined; }): void; //# sourceMappingURL=facade-composition.d.ts.map