import { init_string_coerce, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "../utils/string-coerce.js";
//#region src/session/reset-type.ts
init_string_coerce();
const GROUP_SESSION_MARKERS = [":group:", ":channel:"];
function isThreadSessionKey(sessionKey) {
	return (sessionKey ?? "").trim().includes(":thread:");
}
function resolveSessionResetType(params) {
	if (params.isThread || isThreadSessionKey(params.sessionKey)) return "thread";
	if (params.isGroup) return "group";
	const normalized = normalizeLowercaseStringOrEmpty(params.sessionKey);
	if (GROUP_SESSION_MARKERS.some((marker) => normalized.includes(marker))) return "group";
	return "direct";
}
function resolveChannelResetConfig(params) {
	const resetByChannel = params.sessionCfg?.resetByChannel;
	if (!resetByChannel) return;
	const key = normalizeOptionalLowercaseString(params.channel);
	if (!key) return;
	return resetByChannel[key];
}
//#endregion
export { isThreadSessionKey, resolveChannelResetConfig, resolveSessionResetType };

//# sourceMappingURL=reset-type.js.map