DetachedSessionInfo class

A user-facing view of a detached session living in a node's in-memory registry, as returned by the list API and relayed through the Hub.

It carries no live PTY/shell handles — only metadata safe to cross the wire. Ownership is identified by ownerUserId (the authenticated principal id); the node filters listings by owner before they ever leave the node.

Annotations
  • @immutable

Constructors

DetachedSessionInfo({required String sessionId, required String shortId, required String nodeId, required String ownerUserId, required SessionMode mode, required DateTime createdAt, required SessionState state, DateTime? detachedAt, DateTime? expiresAt, String? currentCommand, String? currentCwd})
Creates a detached-session view.
const

Properties

createdAt → DateTime
When the session was first opened.
final
currentCommand → String?
The current foreground command running in the session, or null when the shell is at its prompt or it could not be determined.
final
currentCwd → String?
The session's current working directory, or null when it could not be determined.
final
detachedAt → DateTime?
When the session was detached, or null if it is still attached.
final
expiresAt → DateTime?
When the session expires and is cleaned up, or null for indefinite.
final
hashCode → int
The hash code for this object.
no setterinherited
mode → SessionMode
The session mode (always shell for detachable interactive sessions).
final
nodeId → String
The node that owns the session.
final
ownerUserId → String
The authenticated principal that owns the session.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessionId → String
The full, cryptographically-secure session id.
final
shortId → String
A short, display-only handle derived from sessionId. Resume/kill accept any unambiguous prefix of sessionId (the short id being one such).
final
state → SessionState
The session lifecycle state (typically SessionState.detached).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Encodes this info to a JSON map.
toString() → String
A string representation of this object.
inherited
withLiveState({String? command, String? cwd}) → DetachedSessionInfo
A copy of this info with the live currentCommand/currentCwd filled in.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, dynamic> d) → DetachedSessionInfo
Decodes a DetachedSessionInfo from a JSON map.