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

ShellHost

interface

What a shell reaches beyond itself that is kept per generation of this module: the listeners told of its ups and downs, and login.ts's memory of refused passwords. (The resource registry it is held in is the runtime's, the same object for every generation.) Across a hot push a held shell outlives the module instance that made it; the successor adopts it (shellFor) and hands it the successor's host, so its drops reach the listeners of the generation that keeps the machine connected, and a password saved there (forgetRefusal) is one it may sign in with again.

API

@Interface("@prismshadow/penguin-server#ShellHost")
export abstract class ShellHost {
  abstract changed(machineAddress: string, up: boolean): void;
  abstract signInFor(
      target: RemoteTarget,
    ): Promise<{ ok: true; signIn: SignIn } | { ok: false; detail: string }>;
  abstract noteSignIn(target: RemoteTarget, signIn: SignIn, said: string): boolean;
}

Members (3)

changed

changed(machineAddress: string, up: boolean): void
@parammachineAddressstring
@paramupboolean
@returnsvoid

signInFor

signInFor(target: RemoteTarget): Promise<{ ok: true; signIn: SignIn } | { ok: false; detail: string }>
@paramtargetRemoteTarget
@returnsPromise<{ ok: true; signIn: SignIn } | { ok: false; detail: string }>

noteSignIn

noteSignIn(target: RemoteTarget, signIn: SignIn, said: string): boolean
@paramtargetRemoteTarget
@paramsignInSignIn
@paramsaidstring
@returnsboolean