import type { Delegation, DelegationResult, DelegationStatus } from "./types.js"; export interface DelegationLifecycleStateMachine { get(delegationId: string): Delegation | undefined; getAll?: () => Delegation[]; registerDelegation?: (delegation: Delegation, scheduleSafetyCeiling: boolean) => void; transition(delegationId: string, toStatus: DelegationStatus): boolean; transitionToTerminal?: (delegationId: string, toStatus: DelegationStatus, error?: string) => void; } /** Thin lifecycle adapter over DelegationStateMachine transitions. */ export declare class DelegationLifecycle { private readonly stateMachine; constructor(stateMachine: DelegationLifecycleStateMachine); /** * Register a newly prepared delegation before status transitions begin. * * @param delegation - Prepared delegation record created by the coordinator. * @param scheduleSafetyCeiling - When true, arm the 30-minute safety ceiling timer. */ register(delegation: Delegation, scheduleSafetyCeiling?: boolean): void; /** * Read a delegation record by ID from the lifecycle state owner. * * @param delegationId - Delegation identifier to look up. * @returns The matching delegation record, or undefined when unknown. */ getStatus(delegationId: string): Delegation | undefined; /** * List all known delegation records for manager/status-tool consumers. * * @returns Snapshot of records currently owned by the lifecycle state owner. */ list(): Delegation[]; /** * Return the child session associated with a delegation, when known. * * @param delegationId - Delegation identifier to inspect. * @returns The child session ID, or undefined when the delegation is unknown. */ getChildSessionId(delegationId: string): string | undefined; /** Transition a delegation and return its projected result. */ transition(delegationId: string, toStatus: DelegationStatus): DelegationResult; /** Returns true for terminal delegation states. */ isTerminal(status: DelegationStatus): boolean; /** Mark a delegation timed out. */ markTimeout(delegationId: string): DelegationResult; /** Mark a delegation aborted by the caller. */ markAborted(delegationId: string): DelegationResult; /** Mark a delegation cancelled by the caller. */ markCancelled(delegationId: string): DelegationResult; private transitionTerminal; private resultFor; } //# sourceMappingURL=lifecycle.d.ts.map