import { ServerProcessRegistry } from "./processes.js"; export type WorkflowServerOptions = { /** Retained for callers; the server itself is global to the state database. */ cwd?: string; runnerId?: string; databasePath?: string; registry?: ServerProcessRegistry; piArgs?: string[]; env?: Record; claimPollMs?: number; /** Combined capacity for workflow and resource-manager execution workers. */ maxWorkers?: number; serverLeaseMs?: number; serverRenewMs?: number; runClaimLeaseMs?: number; runnerEntryPath?: string; runnerStartupTimeoutMs?: number; resourceRunnerEntryPath?: string; channelAdapterEntryPath?: string; onLog?: (message: string) => void; }; /** Global package-owned server. It writes state and supervises code-only runners. */ export declare class WorkflowServer { private readonly options; private readonly serverId; private readonly databasePath; private readonly stateDirectory; private readonly socketPath; private readonly lockPath; private readonly state; private readonly serverState; private readonly recovery; private readonly queue; private readonly decisions; private readonly channelEffects; private readonly runStore; private readonly views; private readonly registry; private readonly activeRuns; private readonly runnerDescendants; private readonly activeResourceManagers; private readonly activeChannels; private readonly controlClaims; private readonly activationTasks; private readonly maintenanceCommands; private readonly pendingRunClaims; private readonly blockedRuns; private readonly pendingTerminalMessageReconciliations; private readonly sessionCoordinators; private readonly sockets; private readonly connections; private server; private claim; private heartbeatTimer; private pollTimer; private viewTimer; private stopping; private started; private schedulerActive; private preferResourceManager; private readonly maxWorkers; private decisionTimeoutActive; private decisionChannelConfig; private decisionChannelError; private channelReloading; private automaticStatePruneTask; private automaticStatePruneTimer; private automaticStatePruneScheduled; private automaticStatePruneDue; private lastAutomaticStatePruneAt; private nextAutomaticStatePruneAttemptAt; private nextTerminalMessageReconciliationAt; constructor(options?: WorkflowServerOptions); get endpoint(): string; private get runClaimLeaseMs(); start(): Promise; stop(): Promise; private closeServer; private recoverPreviousServer; private startTimers; private listen; private handleConnection; private detachSessionCoordinators; private handleClientRequest; private executeMaintenanceCommand; private addSubscription; private sessionCoordinatorView; private requireSessionCoordinator; private requireSessionCommand; private reportWorkflowBranch; private reportWorkflowTurn; private applyWorkflowTurnEnd; private reconcileSubmissionReminders; private publishViews; private publishConnection; private submitInteractionAndWait; private handleRequest; private executeOperation; private restartRun; private queueSessionFollowUp; private removeSessionFollowUp; private changeSessionWorkflowSettings; private recordSessionBatch; private executeResourceManagerOperation; private statusReceipt; private activeRunnerContentHashes; private requestAutomaticStatePrune; private resumeAutomaticStatePruneIfDue; private startAutomaticStatePrune; private runAutomaticStatePrune; private scheduleAutomaticStatePruneTimer; private automaticStatePruneCanContinue; private waitForAutomaticStatePrune; private stateStatusReceipt; private answerCheckpoint; private answerDecision; private acceptDecisionAnswer; private scheduleInteractionResume; private startRun; private publishInteractionUpdate; private submitInteraction; private decisionChannelStatus; private markApplyingChannelEffectsAmbiguous; private recoverDecisionChannel; private reloadDecisionChannels; private startDecisionChannel; private ensureChannelResource; private handleChannelExit; private handleChannelMessage; private applyChannelMessage; private nextChannelCommand; private ensureApplyingChannelEffect; private recordChannelEffectResult; private confirmedChannelMessageReferences; private saveChannelCursor; private channelCursor; private channelEventExists; private recordChannelEvent; private recordChannelMutation; private recordChannelResourceMutation; private channelRevision; private claimResourceManagerOne; private activateResourceManager; private handleResourceRunnerMessage; private resourceManagerWorkflowScheduler; private changeResourceManagerWorkflowSettings; private ensureResourceManagerWorkflow; private finishResourceManagerSuccess; private finishResourceManagerFailure; private expireTimedOutDecision; private claimExpiredInteraction; private markPendingStart; private clearPendingStart; private executionWorkerCount; private claimOne; private claimEligibleRun; private activateRun; private activateRunNow; private handleRunnerMessage; private handleFreshRunnerMessage; private handleRunnerProcessOperation; private reapRunnerDescendants; private acceptRunnerInteraction; private rejectRunnerInteraction; private requireRunnerInteraction; private settleRejectedInteraction; private enqueueRunnerNotification; private parkForInteraction; private prepareInteractionResume; private applyLifecycleProjection; private ensureTerminalWorkflowMessage; private tryEnsureTerminalWorkflowMessage; private terminalWorkflowMessageRequired; private terminalWorkflowMessageMissing; private discoverMissingTerminalWorkflowMessages; private scheduleTerminalWorkflowMessageReconciliation; private reconcilePendingTerminalWorkflowMessages; private terminalAncestorOutcomes; private completeResourceManagerWorkflow; private commitActivePause; private recoverRunnerExit; private releaseLock; private log; }