export type SessionType = 'TMUX' | 'WEZTERM' | 'ZELLIJ' | 'SSH' | 'TERMINAL' | 'SCRIPT' | 'CUSTOM'; /** Target machine kind an agent is installed on. */ export type TargetType = 'DIRECT' | 'SSH' | 'RDP' | 'VNC'; /** * How the Sessions grid/list views cluster sessions. `none` renders a * flat list (legacy behaviour); the rest partition by a derived key. */ export type SessionsGroupBy = 'none' | 'agent' | 'target' | 'vibe' | 'status' | 'type'; /** * The machine an agent runs on, surfaced inline on a session so the * operator can see/group/filter by target without a second query. */ export interface SessionTarget { id: string; name: string; type: TargetType; status: string; host?: string | null; port?: number | null; } export type SessionStatus = 'PENDING' | 'STARTING' | 'RUNNING' | 'STOPPING' | 'STOPPED' | 'ERROR' | 'TERMINATED'; export interface Session { id: string; workspaceId: string; vibeId: string | null; agentId: string | null; /** * Agent profile this session targets. Defaults to "default". * Persisted on Session.profile at create time so every agent-bound * call routes through /api/profiles//... */ profile?: string; name: string; type: SessionType; status: SessionStatus; command: string | null; workingDirectory: string | null; environmentVariables: Record; autoStart: boolean; providerSessionName?: string; providerWindowName?: string; pid: number | null; exitCode: number | null; lastOutput: string | null; ttydUrl?: string | null; metadata: Record; createdAt: string; updatedAt: string; vibe?: { id: string; name: string; }; agent?: { id: string; name: string; hostname?: string | null; platform?: string | null; tunnelUrl?: string | null; tunnelStatus?: string | null; isActive?: boolean; lastHeartbeat?: string | null; /** The machine this agent (and therefore this session) runs on. */ target?: SessionTarget | null; }; } export interface SessionFilter { workspaceId?: string; vibeId?: string; agentId?: string; type?: SessionType; status?: SessionStatus; search?: string; } export interface CreateSessionInput { workspaceId: string; vibeId?: string; agentId?: string; name: string; type: SessionType; command?: string; workingDirectory?: string; environmentVariables?: Record; autoStart?: boolean; providerSessionName?: string; providerWindowName?: string; /** Provider-native session name to attach to (tmux/wezterm/zellij). */ externalSessionName?: string; metadata?: Record; } export interface UpdateSessionInput { name?: string; command?: string; workingDirectory?: string; environmentVariables?: Record; autoStart?: boolean; metadata?: Record; }