/** * @fileoverview Off-loads BLS observation mirror sync into a separate OS process. * * The observation harvest writes rows synchronously to SQLite (both `bun:sqlite` * and `better-sqlite3` are synchronous drivers). Running those writes on the * server's event loop blocks every concurrent tool call for the duration of the * page flush. This module spawns the sync in a child process via * `process.execPath`; WAL lets the server's reader connection keep serving * throughout. See issue #26. * * Dual role: * - Imported by `src/index.ts` for {@link runObservationsSubprocess} — the * parent spawn helper the in-process HTTP cron calls. * - Run directly (` dist/services/bls-observations/subprocess.js`) * as the child entry point — the bottom guard runs one refresh and exits. * * @module services/bls-observations/subprocess */ import type { MirrorLogger } from '@cyanheads/mcp-ts-core/mirror'; /** * Spawn one mirror sync in a child process and resolve when it exits. * Never rejects — a failed harvest is logged and swallowed so a cron tick * can't crash the server. A no-op (with a warning) when a sync is already running. */ export declare function runObservationsSubprocess(opts: { timeoutMs?: number; log: MirrorLogger; }): Promise; /** True when the subprocess module is currently running a sync (parent side). */ export declare function isObservationsSyncRunning(): boolean; //# sourceMappingURL=subprocess.d.ts.map