/**
 * Sync factor — Node worker thread.
 *
 * Hosts the entire network/sync backend (`ImapManager`: IMAP + Gmail sync,
 * body prefetch, the outbox SMTP/IMAP-append drain, IDLE) on its OWN thread,
 * with its OWN write connection to the SQLite file. The main thread keeps the
 * IPC pump and fast local reads (read-worker); it drives this worker through
 * a proxy (`sync-worker-client.ts`) and receives ImapManager's events back
 * over the bus.
 *
 * **Why.** Until now sync ran on the main event loop. A hung Dovecot FETCH, a
 * 30 MB body pull, a dead-network reconnect storm, a 5-minute outbox hang —
 * any of them froze the main loop, which starved the IPC relay, so clicks and
 * the message list timed out even though the read-worker had the answer ready.
 * On its own thread, sync can stall or thrash forever and the UI never feels
 * it (Bob 2026-06-13: "shouldn't it be a worker for any such operation").
 *
 * **DB.** Opens with `{skipMigrations:true}` — main built the schema before we
 * spawned. WAL + busy_timeout let this writer and the main thread's
 * local-first writer coexist; the read-worker reads concurrently.
 *
 * **RPC.** One generic handler: the proxy sends `{method, args}` and we invoke
 * `imapManager[method](...args)`. Return values must be structured-clone-safe
 * (they are — JSON-ish status objects, tokens, bodies-as-strings). Methods
 * that hand back live objects (createPublicClient) are NOT called this way;
 * the service uses dedicated server-side folder-op methods instead.
 *
 * **Events.** We wrap `imapManager.emit` to also `bus.publish("sync:event")`,
 * so every event ImapManager/Reconciler raise on this thread reaches the main
 * proxy, which re-emits them locally for bin's WebView forwarders.
 */
export {};
//# sourceMappingURL=sync-worker.d.ts.map