import { type ModelProfileErrorCode, type ModelProfileErrorDetails } from "../config/model-profile-contract"; export type SdkStartupPhase = "registration" | "startup"; export type SdkStartupReason = "disabled" | "ineligible" | "factory_absent" | "runner_absent" | "admission_timeout" | "pending" | "failed"; export interface SdkStartupFailure { phase: SdkStartupPhase; reason: SdkStartupReason; message: string; code?: ModelProfileErrorCode; details?: ModelProfileErrorDetails; } export type SdkStartupResult = { status: "started"; } | { status: "failed"; failure: SdkStartupFailure; }; /** Internal symbols for lifecycle-only SDK startup construction and bus wiring. */ export declare const lifecycleStartupCapabilityOption: unique symbol; /** * Internal option carrying the startup budget for ACP lifecycle MCP launches. * Only set when the lifecycle request actually supplies `mcpServers`, so the * longer ceiling never leaks to ordinary CLI/SDK `mcpConfigPath` consumers. */ export declare const lifecycleMcpStartupTimeoutOption: unique symbol; export declare function attachLifecycleStartupCapability(api: object, capability: SdkStartupCapability): void; export declare function lifecycleStartupCapabilityForApi(api: object): SdkStartupCapability | undefined; export interface SdkStartupRollbackResult { endpointGeneration: number | null; fenced: boolean; runtimeRemoved: boolean; hostStopped: boolean; brokerRegistrationReleased: boolean; } /** Internal lifecycle-only proof recorder. Fields become true only after their operation completes. */ export declare class SdkStartupRollbackTracker { #private; get generation(): number | undefined; get result(): SdkStartupRollbackResult; recordGeneration(generation: number): void; recordAbsent(): void; recordStop(generation: number, result: Pick): void; } /** Redact untrusted startup errors before they cross the lifecycle boundary. */ export declare function sanitizeSdkStartupMessage(value: unknown, knownSecrets?: Iterable): string; /** Convert every lifecycle bootstrap outcome to the public, bounded failure shape. */ export declare function normalizeSdkStartupFailure(phase: SdkStartupPhase, reason: SdkStartupReason, error?: unknown, knownSecrets?: Iterable): SdkStartupFailure; /** Session-owned, exactly-once lifecycle bootstrap completion. */ export declare class SdkStartupCapability { #private; readonly rollback?: SdkStartupRollbackTracker | undefined; readonly readiness: "immediate" | "deferred"; get cancelled(): boolean; cancel(): void; /** * The broker-issued, session-scoped readiness intent this child was launched * with. It is carried on the capability rather than read from the ambient * environment so bus wiring can never mistake an inherited process-global * flag for a broker-managed preparation. */ constructor(rollback?: SdkStartupRollbackTracker | undefined, readiness?: "immediate" | "deferred"); normalizeFailure(phase: SdkStartupPhase, reason: SdkStartupReason, error?: unknown): SdkStartupFailure; get result(): SdkStartupResult | undefined; get promise(): Promise; settleStarted(): SdkStartupResult; settleFailure(failure: SdkStartupFailure): SdkStartupResult; }