import type { ExecutionWorkspace } from "./types/workspace-runtime.js"; type ExecutionWorkspaceGuardTarget = Pick; const CLOSED_EXECUTION_WORKSPACE_STATUSES = new Set(["archived", "cleanup_failed"]); export function isClosedIsolatedExecutionWorkspace( workspace: Pick | null | undefined, ): boolean { if (!workspace) return false; if (workspace.mode !== "isolated_workspace") return false; return workspace.closedAt != null || CLOSED_EXECUTION_WORKSPACE_STATUSES.has(workspace.status); } export function getClosedIsolatedExecutionWorkspaceMessage( workspace: Pick, ): string { return `This issue is linked to the closed workspace "${workspace.name}". Move it to an open workspace before adding comments or resuming work.`; }