import type { ChildProcess } from 'node:child_process'; import type { CodexSetupIntent } from './codexSetupAdmission.js'; export interface CodexBootstrapHostInput { intent: Readonly; workspace: string; signal: AbortSignal; /** The owning native host requalifies its binding, package and source policy. */ current(): Promise; dryRun?: boolean; } export interface BootstrapHostScope { signal: AbortSignal; current(): Promise; assert(): Promise; close(): void; step(operation: () => Promise): Promise; } export declare function prepareCodexBootstrapHost(input: CodexBootstrapHostInput): { intent: Readonly; flags: Map; scope: BootstrapHostScope; }; /** Closed descendants retain the closed scope, never a legacy unscoped fallback. */ export declare function currentBootstrapHostScope(): BootstrapHostScope | undefined; /** Read the original private preparation without entering a nested context. */ export declare function inspectCodexBootstrapHostPreparation(scope: BootstrapHostScope): Promise<{ scope: BootstrapHostScope; intent: Readonly; flags: Map; }>; /** Capture this caller's fresh spawn before any asynchronous post-effect check. * Capturing cleanup remains necessary if cancellation occurred inside spawn. */ export declare function captureBootstrapHostChild(scope: BootstrapHostScope, child: ChildProcess): void; /** Only the original native owner drains captured handles. No raw PID, service * inventory or legacy unscoped authority is used for withdrawal cleanup. */ export declare function drainBootstrapHostChildren(scope: BootstrapHostScope): Promise; export declare function assertBootstrapHostSource(workspace: string, fingerprint: string): Promise; export declare function runCodexBootstrapHost(input: CodexBootstrapHostInput, operation: (prepared: ReturnType) => Promise): Promise; /** Borrow the original native owner's lifetime; never mint a replacement scope. * The owner, not this continuation, remains responsible for closing it. */ export declare function runCodexBootstrapHostScope(scope: BootstrapHostScope, operation: (prepared: ReturnType) => Promise): Promise; //# sourceMappingURL=bootstrapHostScope.d.ts.map