import * as v from "valibot"; //#region src/logger.d.ts type LoggerConfig = { name: string; stdout: boolean; logFile?: string; }; type LoggerInput = { name: string; stdout?: boolean; logFile?: string; }; declare const logger: (input: LoggerInput) => { info: (...args: any[]) => void; error: (...args: any[]) => void; warn: (...args: any[]) => void; debug: (...args: any[]) => void; child: (suffix: string, overrides?: Partial>) => /*elided*/any; }; type Logger = ReturnType; //#endregion //#region src/lazy-process.d.ts declare const ProcessDefinitionSchema: v.ObjectSchema<{ readonly command: v.StringSchema; readonly args: v.OptionalSchema, undefined>, undefined>; readonly cwd: v.OptionalSchema, undefined>; readonly env: v.OptionalSchema, v.StringSchema, undefined>, undefined>; }, undefined>; type ProcessDefinition = v.InferOutput; declare const ProcessStateSchema: v.PicklistSchema<["idle", "starting", "running", "stopping", "stopped", "error"], undefined>; type ProcessState = v.InferOutput; declare class LazyProcess { readonly name: string; private definition; private logger; private process; private _state; private outputLoopPromise; private donePromise; constructor(name: string, definition: ProcessDefinition, logger: Logger); get state(): ProcessState; start(): void; stop(timeout?: number): Promise; reset(): Promise; updateDefinition(definition: ProcessDefinition): void; waitForExit(): Promise; private logOutput; private waitForStop; } //#endregion //#region src/restarting-process.d.ts declare const RestartPolicySchema: v.PicklistSchema<["always", "on-failure", "never", "unless-stopped", "on-success"], undefined>; type RestartPolicy = v.InferOutput; declare const BackoffStrategySchema: v.UnionSchema<[v.ObjectSchema<{ readonly type: v.LiteralSchema<"fixed", undefined>; readonly delayMs: v.NumberSchema; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"exponential", undefined>; readonly initialDelayMs: v.NumberSchema; readonly maxDelayMs: v.NumberSchema; readonly multiplier: v.OptionalSchema, undefined>; }, undefined>], undefined>; type BackoffStrategy = v.InferOutput; declare const CrashLoopConfigSchema: v.ObjectSchema<{ readonly maxRestarts: v.NumberSchema; readonly windowMs: v.NumberSchema; readonly backoffMs: v.NumberSchema; }, undefined>; type CrashLoopConfig = v.InferOutput; declare const RestartingProcessOptionsSchema: v.ObjectSchema<{ readonly restartPolicy: v.PicklistSchema<["always", "on-failure", "never", "unless-stopped", "on-success"], undefined>; readonly backoff: v.OptionalSchema; readonly delayMs: v.NumberSchema; }, undefined>, v.ObjectSchema<{ readonly type: v.LiteralSchema<"exponential", undefined>; readonly initialDelayMs: v.NumberSchema; readonly maxDelayMs: v.NumberSchema; readonly multiplier: v.OptionalSchema, undefined>; }, undefined>], undefined>, undefined>; readonly crashLoop: v.OptionalSchema; readonly windowMs: v.NumberSchema; readonly backoffMs: v.NumberSchema; }, undefined>, undefined>; readonly minUptimeMs: v.OptionalSchema, undefined>; readonly maxTotalRestarts: v.OptionalSchema, undefined>; }, undefined>; type RestartingProcessOptions = v.InferOutput; declare const RestartingProcessStateSchema: v.PicklistSchema<["idle", "running", "restarting", "stopping", "stopped", "crash-loop-backoff", "max-restarts-reached"], undefined>; type RestartingProcessState = v.InferOutput; declare class RestartingProcess { readonly name: string; private lazyProcess; private definition; private options; private logger; private _state; private _restartCount; private restartTimestamps; private consecutiveFailures; private lastStartTime; private stopRequested; private pendingDelayTimeout; constructor(name: string, definition: ProcessDefinition, options: RestartingProcessOptions, logger: Logger); get state(): RestartingProcessState; get restarts(): number; start(): void; stop(timeout?: number): Promise; restart(force?: boolean): Promise; /** * Update process definition and optionally restart with new config */ reload(newDefinition: ProcessDefinition, restartImmediately?: boolean): Promise; /** * Update restart options */ updateOptions(newOptions: Partial): void; private resetCounters; private startProcess; private handleProcessExit; private shouldRestart; private isInCrashLoop; private calculateDelay; private scheduleRestart; private scheduleCrashLoopRecovery; private delay; } //#endregion //#region src/cron-process.d.ts declare const RetryConfigSchema: v.ObjectSchema<{ readonly maxRetries: v.NumberSchema; readonly delayMs: v.OptionalSchema, undefined>; }, undefined>; type RetryConfig = v.InferOutput; declare const CronProcessOptionsSchema: v.ObjectSchema<{ readonly schedule: v.StringSchema; readonly retry: v.OptionalSchema; readonly delayMs: v.OptionalSchema, undefined>; }, undefined>, undefined>; readonly runOnStart: v.OptionalSchema, undefined>; }, undefined>; type CronProcessOptions = v.InferOutput; declare const CronProcessStateSchema: v.PicklistSchema<["idle", "scheduled", "running", "retrying", "queued", "stopping", "stopped"], undefined>; type CronProcessState = v.InferOutput; declare class CronProcess { readonly name: string; private lazyProcess; private options; private logger; private cronJob; private _state; private _runCount; private _failCount; private currentRetryAttempt; private queuedRun; private stopRequested; private retryTimeout; constructor(name: string, definition: ProcessDefinition, options: CronProcessOptions, logger: Logger); get state(): CronProcessState; get runCount(): number; get failCount(): number; get nextRun(): Date | null; start(): void; stop(timeout?: number): Promise; trigger(): Promise; private onCronTick; private executeJob; private runJobWithRetry; private handleJobComplete; } //#endregion //#region src/task-list.d.ts declare const TaskStateSchema: v.PicklistSchema<["pending", "running", "completed", "failed", "skipped"], undefined>; type TaskState = v.InferOutput; declare const NamedProcessDefinitionSchema: v.ObjectSchema<{ readonly name: v.StringSchema; readonly process: v.ObjectSchema<{ readonly command: v.StringSchema; readonly args: v.OptionalSchema, undefined>, undefined>; readonly cwd: v.OptionalSchema, undefined>; readonly env: v.OptionalSchema, v.StringSchema, undefined>, undefined>; }, undefined>; }, undefined>; type NamedProcessDefinition = v.InferOutput; interface TaskEntry { id: string; processes: NamedProcessDefinition[]; state: TaskState; } type TaskListState = "idle" | "running" | "stopped"; declare class TaskList { readonly name: string; private _tasks; private _state; private logger; private logFileResolver?; private taskIdCounter; private runningProcesses; private stopRequested; private runLoopPromise; constructor(name: string, logger: Logger, initialTasks?: (NamedProcessDefinition | NamedProcessDefinition[])[], logFileResolver?: (processName: string) => string | undefined); get state(): TaskListState; get tasks(): ReadonlyArray; removeTaskByTarget(target: string | number): TaskEntry; /** * Add a single process or parallel processes as a new task * @returns The unique task ID */ addTask(task: NamedProcessDefinition | NamedProcessDefinition[]): string; /** * Begin executing pending tasks */ start(): void; /** * Wait until the TaskList becomes idle (all pending tasks completed) */ waitUntilIdle(): Promise; /** * Stop execution and mark remaining tasks as skipped */ stop(timeout?: number): Promise; private runLoop; private executeTask; private waitForProcess; } //#endregion export { ProcessStateSchema as A, RestartingProcessOptionsSchema as C, ProcessDefinition as D, LazyProcess as E, logger as M, ProcessDefinitionSchema as O, RestartingProcessOptions as S, RestartingProcessStateSchema as T, CrashLoopConfig as _, TaskListState as a, RestartPolicySchema as b, CronProcess as c, CronProcessState as d, CronProcessStateSchema as f, BackoffStrategySchema as g, BackoffStrategy as h, TaskList as i, Logger as j, ProcessState as k, CronProcessOptions as l, RetryConfigSchema as m, NamedProcessDefinitionSchema as n, TaskState as o, RetryConfig as p, TaskEntry as r, TaskStateSchema as s, NamedProcessDefinition as t, CronProcessOptionsSchema as u, CrashLoopConfigSchema as v, RestartingProcessState as w, RestartingProcess as x, RestartPolicy as y }; //# sourceMappingURL=task-list-zO8UZG5r.d.mts.map