import { Mr as validateSessionsCompactionListParams } from "./src-CwDR-7yt.js";
import { n as resolveRequestedSessionAgentId } from "./session-request-agent-D346KCgp.js";
import { r as listSessionCompactionCheckpoints } from "./session-compaction-checkpoints-_qZZrIV3.js";
import { t as assertValidParams } from "./validation-1fbJ5g3d.js";
import { i as loadAccessorSessionEntryForGatewayTarget, s as requireSessionKey } from "./sessions-shared-DB--c8h8.js";
//#region src/gateway/server-methods/sessions-compaction-queries.ts
const sessionCheckpointQueryHandlers = { "sessions.compaction.list": ({ params, respond, context }) => {
	if (!assertValidParams(params, validateSessionsCompactionListParams, "sessions.compaction.list", respond)) return;
	const p = params;
	const key = requireSessionKey(p.key, respond);
	if (!key) return;
	const cfg = context.getRuntimeConfig();
	const requestedAgent = resolveRequestedSessionAgentId(cfg, key, p.agentId);
	if (!requestedAgent.ok) {
		respond(false, void 0, requestedAgent.error);
		return;
	}
	const { entry, canonicalKey } = loadAccessorSessionEntryForGatewayTarget({
		key,
		cfg,
		agentId: requestedAgent.agentId
	});
	respond(true, {
		ok: true,
		key: canonicalKey,
		checkpoints: listSessionCompactionCheckpoints(entry)
	}, void 0);
} };
//#endregion
export { sessionCheckpointQueryHandlers };
