/** * Agent visibility helpers (BOFF-6394). * * An agent is private to whoever added it unless they share it with the * workspace. `visibility` is the authority — NOT `ownerUserId`, which a shared * agent still records so the UI can say who owns the machine. The pre-BOFF-6394 * shape of this check (`ownerUserId == null` means shared) is wrong under the * new model: it reads a shared-but-owned agent as personal. * * Backend counterpart: `wspace-vibecontrols-svc` `services/agent-access.ts`. * Keep the two in step — the backend is the enforcement point, this is only * what the UI renders. */ /** Visibility values the API returns. Mirrors the `AgentVisibility` enum. */ export type AgentVisibility = 'PRIVATE' | 'WORKSPACE'; /** The projection every visibility decision needs. */ export interface AgentVisibilitySubject { ownerUserId?: string | null; visibility?: AgentVisibility | null; } /** * Is this agent shared with the whole workspace? * * Agents that predate the visibility column, and any surface still fetching * without it, fall back to the legacy reading (no owner = shared) so an older * cached payload never renders a shared build box as somebody's private laptop. */ export declare function isWorkspaceAgent(agent: AgentVisibilitySubject): boolean; /** Is this agent private to the current user? */ export declare function isMyPrivateAgent(agent: AgentVisibilitySubject, currentUserId?: string | null): boolean; /** Is this someone else's private agent — visible only because we own the row? */ export declare function isOtherUsersPrivateAgent(agent: AgentVisibilitySubject, currentUserId?: string | null): boolean; /** * May the current user flip this agent's visibility? Only the owner may, and an * ownerless legacy agent may be claimed by anyone. The backend enforces the * same rule; this just avoids offering a control that would fail. */ export declare function canChangeAgentVisibility(agent: AgentVisibilitySubject, currentUserId?: string | null): boolean; /** The visibility to switch to when the user toggles the control. */ export declare function nextAgentVisibility(agent: AgentVisibilitySubject): AgentVisibility;