@prismshadow/penguin-library-machine · library/machine/src/transport/ssh-session.ts:202

MachineSession

interface

A session as a successor calls it: EVERY member it uses on a shell another generation made, which is everything this module calls on a shell. retarget and adopt are part of it so that a build whose sessions cannot be told a new password or a new host has a different shape and is never adopted — its sessions are closed with their group and the machines held afresh.

API

@Interface("@prismshadow/penguin-server#MachineSession")
export abstract class MachineSession {
  abstract hold(): void;
  abstract held(): boolean;
  abstract retarget(target: RemoteTarget): void;
  abstract adopt(host: ShellHost): void;
  abstract run(command: string, opts?: ShellRunOptions): Promise<ShellResult>;
  abstract session(): ShellSession | null;
  abstract close(): void;
}

Members (7)

hold

hold(): void
@returnsvoid

held

held(): boolean
@returnsboolean

retarget

retarget(target: RemoteTarget): void

The latest caller's word on how to reach the machine; read when the next session opens.

@paramtargetRemoteTarget
@returnsvoid

adopt

adopt(host: ShellHost): void

From here on, reports to and signs in through host: the generation that keeps it.

@paramhostShellHost
@returnsvoid

run

run(command: string, opts?: ShellRunOptions): Promise<ShellResult>
@paramcommandstring
@paramopts?ShellRunOptions
@returnsPromise<ShellResult>

session

session(): ShellSession | null
@returnsShellSession | null

close

close(): void
@returnsvoid