import type { AgentExecutionResult, RuntimeSpawnRequest, RuntimeSpawnResult } from '../dispatch/types.js'; import type { DurableStateAdapter } from '../durable/file-journal.js'; import type { DurableJournalSecurity } from '../durable/types.js'; import type { Clock } from '../knowledge/types.js'; import type { ProjectStore } from '../project-store/types.js'; import { type DurableOutboxDeliverySummary, type DurableOutboxHandler } from '../state-machine/outbox.js'; export interface DurableAgentApplicationOptions { readonly installRoot: string; readonly rawBundle: unknown; readonly repoRoot: string; readonly projectStore: ProjectStore; readonly clock: Clock; readonly spawn: (request: RuntimeSpawnRequest) => Promise; readonly trustedOutbox: { readonly handler: DurableOutboxHandler; readonly ownerId: string; }; readonly journalSecurity: DurableJournalSecurity; } export interface DurableAgentApplication { execute(rawCommand: unknown, trustedHostContext: unknown): Promise; drainPendingOutbox(): Promise; doctor(): Promise<{ readonly recoveryStatus: 'clean' | 'snapshot_rebuilt' | 'tail_recovered' | 'failed'; readonly throughSequence?: number; }>; } /** Production composition. Raw adapters and mutation stores never cross this boundary. */ export declare function composeDurableAgentApplication(adapter: DurableStateAdapter, options: DurableAgentApplicationOptions): DurableAgentApplication;