/** * Minimal structural view of the {@link import("./server.js").ServerDeps} * handles that {@link shutdownStdioDeps} touches. Declared locally (rather than * importing `ServerDeps`) so this module stays dependency-free and free of any * import cycle with the restricted server-registration module. `ServerDeps` * structurally satisfies this shape, so `startServer` passes its `deps` directly. */ export interface StdioShutdownDeps { vault: { persistentCacheEnabled: boolean; saveDiskCache(): Promise; }; ftsIndex?: { close(): void; } | null; watcher?: { close(): Promise; } | null; watcherEmbedDb?: { close(): void; } | null; } /** * v3.10.0-rc.19 (audit M3) — single graceful-shutdown teardown for the stdio * transport, mirroring {@link import("./http-transport.js").shutdownHttpServer}'s * ordering. Closes the watcher (async chokidar) + its embed-db handle, flushes * the persistent disk cache, then closes the fts5 index — **awaiting each async * step** so a fast cache flush can't race ahead and let `process.exit` kill the * others mid-flight. * * Pre-rc.19, stdio mode registered three separate SIGINT/SIGTERM handlers * (flush / watcher / fts) and the flush handler called `process.exit(0)` the * moment its `saveDiskCache` resolved — racing the (async) `watcher.close()`. * * Best-effort: a throw/rejection in any one step is swallowed so the remaining * steps still run (a watcher that fails to close must not block the cache flush * or the fts checkpoint). Cache-flush failures are surfaced on stderr because * losing the persistent cache silently would degrade the next cold start. */ export declare function shutdownStdioDeps(deps: StdioShutdownDeps): Promise; //# sourceMappingURL=shutdown.d.ts.map