import { A as ProcessStateSchema, C as RestartingProcessOptionsSchema, D as ProcessDefinition, E as LazyProcess, M as logger, O as ProcessDefinitionSchema, S as RestartingProcessOptions, T as RestartingProcessStateSchema, _ as CrashLoopConfig, a as TaskListState, b as RestartPolicySchema, c as CronProcess, d as CronProcessState, f as CronProcessStateSchema, g as BackoffStrategySchema, h as BackoffStrategy, i as TaskList, j as Logger, k as ProcessState, l as CronProcessOptions, m as RetryConfigSchema, n as NamedProcessDefinitionSchema, o as TaskState, p as RetryConfig, r as TaskEntry, s as TaskStateSchema, t as NamedProcessDefinition, u as CronProcessOptionsSchema, v as CrashLoopConfigSchema, w as RestartingProcessState, x as RestartingProcess, y as RestartPolicy } from "./task-list-zO8UZG5r.mjs"; import * as v from "valibot"; //#region src/manager.d.ts declare const ManagerConfigSchema: v.ObjectSchema<{ readonly http: v.OptionalSchema, undefined>; readonly port: v.OptionalSchema, undefined>; readonly authToken: v.OptionalSchema, undefined>; }, undefined>, undefined>; readonly cwd: v.OptionalSchema, undefined>; readonly logDir: v.OptionalSchema, undefined>; readonly env: v.OptionalSchema, v.StringSchema, undefined>, undefined>; readonly envFiles: v.OptionalSchema, v.StringSchema, undefined>, undefined>; readonly tasks: v.OptionalSchema; readonly definition: 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>; readonly envFile: v.OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; readonly crons: v.OptionalSchema; readonly definition: 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>; readonly options: v.ObjectSchema<{ readonly schedule: v.StringSchema; readonly retry: v.OptionalSchema; readonly delayMs: v.OptionalSchema, undefined>; }, undefined>, undefined>; readonly runOnStart: v.OptionalSchema, undefined>; }, undefined>; readonly envFile: v.OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; readonly processes: v.OptionalSchema; readonly definition: 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>; readonly options: v.OptionalSchema; 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>, undefined>; readonly envFile: v.OptionalSchema, undefined>; readonly envReloadDelay: v.OptionalSchema, v.BooleanSchema, v.LiteralSchema<"immediately", undefined>], undefined>, undefined>; }, undefined>, undefined>, undefined>; }, undefined>; type ManagerConfig = v.InferOutput; //#endregion //#region src/env-manager.d.ts type EnvChangeCallback = (changedKeys: string[]) => void; interface EnvManagerConfig { /** * Directory to search for .env files * Defaults to process.cwd() */ cwd?: string; /** * Explicit env file paths to load * Key is the identifier (e.g., "global", "app1") * Value is the file path relative to cwd or absolute */ files?: Record; /** * Enable file watching for env files * Defaults to false */ watch?: boolean; } declare class EnvManager { private env; private cwd; private watchEnabled; private watchers; private fileToKeys; private changeCallbacks; private reloadDebounceTimers; constructor(config?: EnvManagerConfig); registerFile(key: string, filePath: string): void; getEnvForKey(key: string): Record; /** * Load .env and .env.* files from the cwd */ private loadEnvFilesFromCwd; /** * Load a single env file and store it in the map */ private loadEnvFile; /** * Watch a file for changes */ private watchFile; /** * Handle file change with debouncing */ private handleFileChange; /** * Reload a file and notify callbacks */ private reloadFile; /** * Register a callback to be called when env files change * Returns a function to unregister the callback */ onChange(callback: EnvChangeCallback): () => void; /** * Stop watching all files and cleanup */ dispose(): void; /** * Get environment variables for a specific process * Merges global env with process-specific env * Process-specific env variables override global ones */ getEnvVars(processKey?: string): Record; /** * Get all loaded env maps (for debugging/inspection) */ getAllEnv(): ReadonlyMap>; } //#endregion //#region src/index.d.ts declare function defineConfig(config: ManagerConfig): { http?: { host?: string | undefined; port?: number | undefined; authToken?: string | undefined; } | undefined; cwd?: string | undefined; logDir?: string | undefined; env?: { [x: string]: string; } | undefined; envFiles?: { [x: string]: string; } | undefined; tasks?: { name: string; definition: { command: string; args?: string[] | undefined; cwd?: string | undefined; env?: { [x: string]: string; } | undefined; }; envFile?: string | undefined; }[] | undefined; crons?: { name: string; definition: { command: string; args?: string[] | undefined; cwd?: string | undefined; env?: { [x: string]: string; } | undefined; }; options: { schedule: string; retry?: { maxRetries: number; delayMs?: number | undefined; } | undefined; runOnStart?: boolean | undefined; }; envFile?: string | undefined; }[] | undefined; processes?: { name: string; definition: { command: string; args?: string[] | undefined; cwd?: string | undefined; env?: { [x: string]: string; } | undefined; }; options?: { restartPolicy: "always" | "on-failure" | "never" | "unless-stopped" | "on-success"; backoff?: { type: "fixed"; delayMs: number; } | { type: "exponential"; initialDelayMs: number; maxDelayMs: number; multiplier?: number | undefined; } | undefined; crashLoop?: { maxRestarts: number; windowMs: number; backoffMs: number; } | undefined; minUptimeMs?: number | undefined; maxTotalRestarts?: number | undefined; } | undefined; envFile?: string | undefined; envReloadDelay?: number | boolean | "immediately" | undefined; }[] | undefined; }; //#endregion export { BackoffStrategy, BackoffStrategySchema, CrashLoopConfig, CrashLoopConfigSchema, CronProcess, CronProcessOptions, CronProcessOptionsSchema, CronProcessState, CronProcessStateSchema, EnvChangeCallback, EnvManager, EnvManagerConfig, LazyProcess, Logger, NamedProcessDefinition, NamedProcessDefinitionSchema, ProcessDefinition, ProcessDefinitionSchema, ProcessState, ProcessStateSchema, RestartPolicy, RestartPolicySchema, RestartingProcess, RestartingProcessOptions, RestartingProcessOptionsSchema, RestartingProcessState, RestartingProcessStateSchema, RetryConfig, RetryConfigSchema, TaskEntry, TaskList, TaskListState, TaskState, TaskStateSchema, defineConfig, logger }; //# sourceMappingURL=index.d.mts.map