//#region extensions/matrix/src/matrix/device-health.ts
const KLAW_DEVICE_NAME_PREFIX = "Klaw ";
function isKlawManagedMatrixDevice(displayName) {
	return displayName?.startsWith(KLAW_DEVICE_NAME_PREFIX) === true;
}
function summarizeMatrixDeviceHealth(devices) {
	const currentDeviceId = devices.find((device) => device.current)?.deviceId ?? null;
	const openClawDevices = devices.filter((device) => isKlawManagedMatrixDevice(device.displayName));
	return {
		currentDeviceId,
		staleKlawDevices: openClawDevices.filter((device) => !device.current),
		currentKlawDevices: openClawDevices.filter((device) => device.current)
	};
}
//#endregion
export { summarizeMatrixDeviceHealth as n, isKlawManagedMatrixDevice as t };
