DashboardBackend class abstract interface

The capability port the DashboardApp drives.

It hides all dart:io, networking and credential-storage details behind a small, testable surface: the CLI provides a real implementation over ClientRuntime + CredentialStore; tests provide a scripted fake.

Two operations — resumeSession and peekSession — take over the real terminal (raw stdin/stdout) to run a live interactive session or paint a captured screen. The app releases the terminal (leaves the alt-screen and stops rendering) around those calls, so the implementation may use the real terminal directly and surface its own errors there.

Properties

connectedHub String?
The Hub URL of the active connection, or null when not connected.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Whether the active connection is currently live (authenticated + open).
no setter
principal Principal?
The authenticated principal of the active connection, or null.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addGitCredential(String nodeId, {required String host, String? pat, String? username, String? password}) Future<DashboardActionResult>
Adds/overwrites the caller's own git credential for host on nodeId. Provide either pat (HTTPS token) or username+password.
aiConfig({AiProviderKind? provider, String? model, String? plannerModel, String? executorModel, String? explainerModel, String? apiKey, AgentMode? mode, String? language, String? baseUrl, int? maxSteps}) Future<void>
Writes AI settings to ~/.omnyshell/ai.yaml. A non-null empty string clears that field back to its default; null leaves it untouched.
aiDescribe() Future<AiConfigDescription>
Reads the resolved AI configuration (key masked / status only).
aiTest() Future<List<AiModelCheck>>
Validates the configured key and models with live provider requests.
authSnapshot() Future<AuthSnapshot>
Reads the persisted auth state (default Hub + saved logins).
close() Future<void>
Closes the active connection and releases resources.
closeTunnel(String tunnelRef) Future<DashboardActionResult>
Closes the caller's tunnel named by tunnelRef (id or unambiguous prefix).
connect(String hubUrl) Future<Principal?>
Connects to hubUrl using the saved session for it, making it the active connection. Returns the authenticated principal, or throws on failure.
detachSession(String nodeId, String sessionRef, {Duration? timeout}) Future<DashboardActionResult>
Detaches an active session (leaving it alive) named by sessionRef.
diffFile(String mountId, String path) Future<FileDiff>
Shows how path differs between local and node for mountId.
killSession(String nodeId, String sessionRef) Future<DashboardActionResult>
Terminates a session (running or detached) named by sessionRef.
listGitCredentials(String nodeId) Future<List<DriveCredentialEntry>>
Lists the caller's own git credentials on nodeId (secrets masked).
listMounts() Future<List<MountRecord>>
Lists active mounts and their sync state.
listNodes() Future<List<NodeDescriptor>>
Lists nodes visible to the active connection.
listSessions(String nodeId) Future<List<DetachedSessionInfo>>
Lists the caller's sessions (active + detached) on nodeId.
listTunnels() Future<List<TunnelInfo>>
Lists the caller's active tunnels held by the Hub.
login(LoginRequest req) Future<Principal?>
Validates req with a real handshake, persists it as the default login, and makes it the active connection. Returns the principal, or throws.
logout(String hubUrl) Future<void>
Removes the saved login for hubUrl. If it is the active connection, the connection is closed.
mountConflicts(String mountId, {bool includeDiffs = false}) Future<DriveChanges>
Lists the files that differ between local and node for mountId.
mountDirectory({required String localDir, required String target, String? name, bool rw = false, bool initialSync = true, List<String> include = const [], List<String> exclude = const []}) Future<MountRecord>
Mounts local directory localDir onto target (<node>:<remote-path>).
mountGit({required String url, required String target, String? name, String? branch, int? depth, bool rw = false}) Future<MountRecord>
Mounts git repository url onto target (<node>:<remote-path>).
newSession(String nodeId) Future<void>
Opens a new interactive shell on nodeId, taking over the terminal until the session detaches or exits.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openTunnel({required String nodeId, required int targetPort, int? publicPort, bool local = false, bool secure = false}) Future<DashboardActionResult>
Opens a tunnel exposing nodeId's targetPort (or, when local, this machine's port) on a public Hub port. A local tunnel keeps serving in the background over the dashboard's live connection — no terminal takeover.
peekSession(String nodeId, String sessionRef) Future<void>
Paints sessionRef's captured screen to the terminal without attaching, then waits for a keypress before returning.
remount(String mountId) Future<MountRecord>
Re-establishes the mount mountId after a node restart.
removeGitCredential(String nodeId, {required String host}) Future<DashboardActionResult>
Removes the caller's own git credential for host on nodeId.
resolveFile(String mountId, String path, {required String strategy}) Future<FileResolveOutcome>
Resolves a single conflicted path in mountId with strategy (accept-local / accept-origin).
resolveMount(String mountId, {required String strategy}) Future<SyncOutcome>
Resolves a conflicted mount mountId with strategy (accept-local / accept-origin / reclone).
resumeSession(String nodeId, String sessionRef) Future<void>
Resumes sessionRef on nodeId as a live interactive session, taking over the terminal until the session detaches or exits.
syncMount(String mountId, {DriveSyncDirection direction = DriveSyncDirection.auto}) Future<SyncOutcome>
Synchronizes the mount mountId once in direction.
toString() String
A string representation of this object.
inherited
unmount(String mountId, {bool syncFirst = false, bool keepRemote = true}) Future<DashboardActionResult>
Tears down the mount mountId.
watchMount(String mountId) Future<void>
Live auto-syncs the mount mountId until interrupted (Ctrl-C). Takes over the terminal — the app calls this with the terminal released.

Operators

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