import type { DappEngineStatus, DappEngineSystemDeclaration, DappEngineSystemReference } from './dappEngineModel.ts'; import type { DappLaunch } from './dappLaunch.ts'; import type { DappSessionWorkBinding, DappSessionWorkOwner } from './dappSession.ts'; export interface DappEngineSystemLaunchContext { readonly dappId: string; readonly declaration: DappEngineSystemDeclaration; readonly engineInstanceId: string; readonly hostSessionId: string; readonly launchId: string; } /** Trusted host binding; actual provider and actor factories remain in host adapters. */ export interface DappEngineSystemLauncher { readonly launchId: string; readonly systemId: string; launch(context: DappEngineSystemLaunchContext): DappLaunch; } export interface LaunchDappEngineOptions { readonly configuration: unknown; readonly engineInstanceId: string; readonly hostSessionId: string; readonly systems: readonly DappEngineSystemLauncher[]; } export interface ReplaceDappEngineSystemOptions { readonly launcher: DappEngineSystemLauncher; readonly profileId: string; readonly reference: DappEngineSystemReference; } /** Ownership facade only. No child ports, providers or locators escape through it. */ export interface DappEngineSession { bindSystemWork(reference: DappEngineSystemReference, create: () => DappSessionWorkOwner): DappSessionWorkBinding; replaceSystem(options: ReplaceDappEngineSystemOptions): Promise; status(): DappEngineStatus; stop(): Promise; whenStopped(): Promise; whenTerminal(): Promise; } export type DappEngineLaunchResult = { readonly outcome: 'ready'; readonly session: DappEngineSession; } | { readonly cause: unknown; readonly outcome: 'failed'; } | { readonly outcome: 'stopped'; }; export interface DappEngineLaunch { readonly outcome: Promise; /** Unavailable until configuration and launcher identity validation succeeds. */ status(): DappEngineStatus | undefined; stop(): Promise; whenReady(): Promise; whenStopped(): Promise; whenTerminal(): Promise; } export declare class DappEngineLifecycleError extends Error { readonly code: string; readonly systemId?: string; constructor(code: string, cause?: unknown, systemId?: string); } export declare function launchDappEngine(options: LaunchDappEngineOptions): DappEngineLaunch; //# sourceMappingURL=dappEngine.d.ts.map