import { n as requestSafeGatewayRestart, t as createSafeGatewayRestartPreflight } from "./restart-coordinator-AZbLSTYC.js";
//#region src/gateway/server-methods/restart.ts
function normalizeReason(value) {
	return typeof value === "string" && value.trim() ? value.trim().slice(0, 200) : void 0;
}
function normalizeSkipDeferral(value) {
	return value === true;
}
/** Gateway request handlers for safe restart coordination. */
const restartHandlers = {
	"gateway.restart.request": async ({ respond, params }) => {
		respond(true, requestSafeGatewayRestart({
			reason: normalizeReason(params.reason),
			delayMs: 0,
			skipDeferral: normalizeSkipDeferral(params.skipDeferral)
		}));
	},
	"gateway.restart.preflight": async ({ respond }) => {
		respond(true, createSafeGatewayRestartPreflight());
	}
};
//#endregion
export { restartHandlers };
