//#region src/gateway/server-shutdown.runtime.ts
async function prepareGatewayShutdownRuntime() {
	const [{ createGatewayCloseHandler, drainActiveSessionsForShutdown, runGatewayClosePrelude }, { runGlobalGatewayStopSafely }, { flushPendingSessionsChangedEvents }, { closeMcpLoopbackServer }, { stopTaskRegistryMaintenance }, { markRestartAbortedMainSessions }, { disposeAllBundleLspRuntimes }, { drainRetainedOpenAiEmbeddingProviders }, { stopGmailWatcher }, { disposeAllCodeModeRuns }, { closeProviderTransportDispatcherPool }, { clearActivePluginRegistry, prepareActivePluginRegistryShutdown }] = await Promise.all([
		import("./server-close.runtime.js"),
		import("./plugins/hook-runner-global.js"),
		import("./session-change-event-Z07dU-Xe.js"),
		import("./mcp-http-IqnaAxAm.js"),
		import("./task-registry.maintenance-DNDsk-jx.js"),
		import("./main-session-restart-recovery-tKcU544C.js"),
		import("./agent-bundle-lsp-runtime-Czkzz-fZ.js"),
		import("./embeddings-http-B5ybpj8X.js"),
		import("./gmail-watcher-CxpY5JhE.js"),
		import("./code-mode-state-CLkPKe1h.js"),
		import("./provider-transport-dispatcher-pool-1Z_iVThj.js"),
		import("./runtime-BNIpfeWG.js")
	]);
	await prepareActivePluginRegistryShutdown();
	return {
		createGatewayCloseHandler,
		drainActiveSessionsForShutdown,
		runGatewayClosePrelude,
		runGlobalGatewayStopSafely,
		flushPendingSessionsChangedEvents,
		closeMcpLoopbackServer,
		stopTaskRegistryMaintenance,
		markRestartAbortedMainSessions,
		disposeAllBundleLspRuntimes,
		drainRetainedOpenAiEmbeddingProviders,
		stopGmailWatcher,
		disposeAllCodeModeRuns,
		closeProviderTransportDispatcherPool,
		clearActivePluginRegistry
	};
}
//#endregion
export { prepareGatewayShutdownRuntime };
