UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

43 lines 2.04 kB
/** * @fileoverview Application initialization and global error handling setup. * * This module configures comprehensive error handling for the Node.js application, * including unhandled promise rejections, uncaught exceptions, and graceful * shutdown handling for various system signals. */ /** * Installs global error handlers that crash the process on unhandled errors. * * **This must only be called when running as a standalone server** (i.e. from * the CLI entry point), never when the library is imported by external * consumers. Registering process-wide exit handlers from a library hijacks the * host application's error handling and can kill test runners or other * long-lived processes unexpectedly. */ export declare function installCrashHandlers(): void; /** * Installs SIGTERM/SIGINT handlers that drain any in-flight file uploads * (bounded by {@link SHUTDOWN_FLUSH_TIMEOUT_MS}) before exiting cleanly. * * **Intended primarily as a developer / CLI fallback.** In production the * desktop app drives shutdown explicitly: it queries * `GET /api/uploads/status`, surfaces the count to the user, and either * (a) waits for the worker to drain on its own and then terminates the * backend, or (b) terminates immediately on user request. In that path * these handlers may not fire at all — terminations from the host are * what they are. * * For `node dist/main.js` runs (developers, integration tests), Ctrl+C * still benefits from a graceful drain so test artefacts don't pile up * as `.uploading.<token>` markers. * * Same constraint as {@link installCrashHandlers}: only call this when * running as a standalone server, never when imported as a library — * process-wide signal handlers would hijack the host. * * Uploads that don't complete within the timeout stay on disk as * `.uploading.<token>` markers; another Studio process will reclaim them * once the claim goes stale (5 min default). */ export declare function installShutdownHandlers(): void; //# sourceMappingURL=init.d.ts.map