/** * Native Runner * Runs processes directly using Node.js spawn (the original behavior) */ import type { Runner, RunnerType, RunnerStartOptions, RunnerStartResult, RunnerStopOptions, RunnerLogOptions, RunnerStatus, PersistedRunnerState } from './types.js'; export declare class NativeRunner implements Runner { readonly type: RunnerType; private id; private command; private cwd; private process; private pid; private port; private startedAt; /** OS-reported start time of `pid`, to detect a recycled pid. */ private pidStartedAt; private logCursor; private global; constructor(id: string); /** * Set whether this runner uses global storage */ setGlobal(global: boolean): void; /** * Restore state from persisted data (for recovery) */ restore(data: PersistedRunnerState): void; private getLogDir; private getStdoutLogPath; private getStderrLogPath; private ensureLogDir; /** * PROCESS IDENTITY * * `kill(pid, 0)` only answers "is some process wearing this number", which * is not the same question. A dev server that crashed leaves its pid behind * in servers.json, and once the OS recycles that number the dead server * reads as running: it gets recovered instead of restarted, autoRun never * fires, and `server list` reports a corpse as live. * * So a pid recovered from disk is only trusted when the OS still reports the * same start time for it. An unreadable start time on either side cannot * disprove anything, so it counts as alive - the cost of being wrong that way * is a server we decline to touch, rather than one we wrongly declare dead. */ private isProcessRunning; private detectPortFromLine; start(options: RunnerStartOptions): Promise; stop(options?: RunnerStopOptions): Promise; isRunning(): Promise; getStatus(): Promise; getLogs(options?: RunnerLogOptions): Promise; private countFileLines; detectPort(): Promise; cleanup(): Promise; /** * Initialize cursor to end of file (for recovered servers) */ initializeCursorToEOF(): Promise; /** * Clear log files */ clearLogs(): Promise<{ logDir: string; stdoutPath: string; stderrPath: string; }>; /** * Get log access info */ getLogAccess(): { type: 'file'; logDir: string; stdoutPath: string; stderrPath: string; }; /** * Get log stats for status line */ getLogStats(): { newStdout: number; newStderr: number; }; /** Getters for state persistence */ getId(): string; getCommand(): string; getCwd(): string; getPid(): number; getPidStartedAt(): string; getPort(): number | null; getStartedAt(): Date | null; /** Setters for port (when detected externally) */ setPort(port: number): void; } //# sourceMappingURL=native-runner.d.ts.map