export function isSessionEntry(value) {
    if (typeof value !== "object" || value === null) {
        return false;
    }
    const entry = value;
    if (typeof entry.id !== "string" ||
        (entry.parentId !== null && typeof entry.parentId !== "string") ||
        typeof entry.createdAt !== "string") {
        return false;
    }
    switch (entry.kind) {
        case "user":
        case "assistant":
            return typeof entry.text === "string";
        case "tool_call":
            return typeof entry.tool === "string" && typeof entry.intentId === "string";
        case "tool_result":
            return typeof entry.intentId === "string";
        case "compaction":
            return (typeof entry.summary === "string" &&
                Array.isArray(entry.droppedIds) &&
                Array.isArray(entry.readFiles) &&
                Array.isArray(entry.modifiedFiles));
        case "branch_summary":
            return typeof entry.fromEntryId === "string" && typeof entry.summary === "string";
        case "fork_marker":
            return typeof entry.fromEntryId === "string";
        default:
            return false;
    }
}
