import type { Agent } from "@/stores/session-store"; export type CloseAgentTabPolicy = { kind: "archive-on-close" } | { kind: "layout-only" }; export function resolveCloseAgentTabPolicy( agent: Pick | null | undefined, ): CloseAgentTabPolicy { if (agent?.parentAgentId) { return { kind: "layout-only" }; } return { kind: "archive-on-close" }; }