interface RunOptions extends Record { autoMerge?: unknown; closeIssue?: unknown; docker?: unknown; mergeQueue?: unknown; pr?: unknown; prBase?: unknown; prBody?: unknown; ship?: unknown; worktree?: unknown; } interface DetachedSetupParams { clusterId: string; pid?: number; storageDir?: string; logPath?: string | null; worktree?: unknown; runOptions?: RunOptions; cwd?: string; } interface ClusterIdentityParams { clusterId: string; storageDir?: string; } interface SetupFailureParams extends ClusterIdentityParams { error: unknown; logPath?: string | null; } interface ResumePatchParams extends ClusterIdentityParams { daemonPid: number; } interface RegistrationWaitParams extends ClusterIdentityParams { timeoutMs?: number; pollMs?: number; daemonPid?: number; logPath?: string | null; } interface OwnershipWaitParams extends ResumePatchParams { timeoutMs?: number; pollMs?: number; } declare function getClustersFilePath(storageDir?: string | null): string; declare function resolveWaitTimeoutMs(waitTimeoutSeconds: unknown): number; declare function isClusterRegistered(clusterId: string, storageDir?: string): boolean; declare function registerDetachedSetupCluster({ clusterId, pid, storageDir, logPath, worktree, runOptions, cwd, }: DetachedSetupParams): Promise; declare function removeDetachedSetupCluster({ clusterId, storageDir, }: ClusterIdentityParams): Promise; declare function markDetachedSetupFailed({ clusterId, storageDir, error, logPath, }: SetupFailureParams): Promise; declare function waitForClusterRegistration({ clusterId, timeoutMs, pollMs, storageDir, daemonPid, logPath, }: RegistrationWaitParams): Promise<{ ready: true; elapsedMs: number; }>; /** * Atomically claim the right to resume-daemon an existing cluster record. * Ownership for the handoff is tracked separately from cluster.pid/state so * orchestrator.resume() can still perform its own eligibility check. */ declare function patchDetachedResumeCluster({ clusterId, daemonPid, storageDir, }: ResumePatchParams): Promise; /** * Undo a resume handoff that did not complete so a dead daemon cannot leave * the cluster stuck in a running state. */ declare function revertDetachedResumeCluster({ clusterId, storageDir, error, }: SetupFailureParams): Promise; declare function getRegisteredResumeDaemonPid(clusterId: string, storageDir?: string): number | null; /** * Daemon-side half of the resume handoff: wait until the registry shows this * process's PID as resumeDaemonPid before touching the cluster. */ declare function waitForResumeOwnership({ clusterId, daemonPid, storageDir, timeoutMs, pollMs, }: OwnershipWaitParams): Promise; declare const _default: { DEFAULT_WAIT_TIMEOUT_SECONDS: number; getClustersFilePath: typeof getClustersFilePath; getRegisteredResumeDaemonPid: typeof getRegisteredResumeDaemonPid; isClusterRegistered: typeof isClusterRegistered; isProcessAlive: (pid: unknown) => boolean; markDetachedSetupFailed: typeof markDetachedSetupFailed; patchDetachedResumeCluster: typeof patchDetachedResumeCluster; registerDetachedSetupCluster: typeof registerDetachedSetupCluster; removeDetachedSetupCluster: typeof removeDetachedSetupCluster; resolveWaitTimeoutMs: typeof resolveWaitTimeoutMs; revertDetachedResumeCluster: typeof revertDetachedResumeCluster; waitForClusterRegistration: typeof waitForClusterRegistration; waitForResumeOwnership: typeof waitForResumeOwnership; }; export = _default;