export interface RoleDepsProbe { env: NodeJS.ProcessEnv; /** The pinned SDK loads without an install. */ sdkPresent: () => boolean; /** Installs and verifies the pinned SDK. */ install: () => Promise; } export type RoleDepsResult = { status: 'present' | 'installed' | 'not-needed' | 'in-role' | 'disabled'; } | { status: 'failed'; error: string; }; export declare const defaultRoleDepsProbe: (env?: NodeJS.ProcessEnv) => RoleDepsProbe; /** How long a failed install is reported without retrying: every session * start would otherwise spawn npm again (offline, each waits out the fetch * timeout), and a role can cause session starts. */ export declare const ROLE_DEPS_RETRY_MS: number; /** The longest a session start waits for an install; the install goes on in * the background and the next session start finds it. */ export declare const ROLE_DEPS_WAIT_MS: number; /** Per-process install state. Tests pass a fresh one. */ export interface RoleDepsState { done?: RoleDepsResult; inFlight?: Promise; failed?: { at: number; result: RoleDepsResult; }; now: () => number; } export declare const newRoleDepsState: (now?: () => number) => RoleDepsState; /** Makes sure the SDK a role running `runtime` may need is installed. Never * throws: a failure is returned, and the role then fails with the * operator's command. Synchronous when there is nothing to install, or once * it is installed, so a session start does not yield for it. One install at * a time per process; after a failure the same failure is returned for * ROLE_DEPS_RETRY_MS. `probe` and `state` are for tests. */ export declare function ensureRoleDeps(runtime: string, probe?: RoleDepsProbe, state?: RoleDepsState): RoleDepsResult | Promise; /** Waits for `pending` until the session is aborted or `ms` pass; the * install itself is not cancelled. */ export declare function waitRoleDeps(pending: Promise, signal: AbortSignal, ms?: number): Promise; /** The audit line for an install the host just did. */ export declare const roleDepsInstalled: () => string; /** The audit line for a failed install. */ export declare const roleDepsFailure: (error: string) => string; /** The audit event for a session start's install result, if it needs one. */ export declare function roleDepsAudit(r: RoleDepsResult): { reason: string; msg: string; } | undefined; //# sourceMappingURL=role-deps.d.ts.map