@prismshadow/penguin-library-machine · library/machine/src/terminal-relay.ts:242

RemoteTerminals

interface

RemoteTerminals: the mechanism TerminalRelay implements. The terminal manager asks it for an id it does not hold, and the platform offers it every socket before serving a local pty.

API

@Interface("@prismshadow/penguin-server#RemoteTerminals")
export abstract class RemoteTerminals {
  abstract get(id: string): RelayTerminal | undefined;
  abstract attach(
      ws: WsSocket,
      session: RelayTerminal,
      url: URL,
      log: (line: string) => void,
    ): boolean;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use
@Provideprovided by
@Useconsumed by (1)

Members (2)

get

get(id: string): RelayTerminal | undefined

The reference a remote id names, in the shape the runtime's owner check reads; undefined for a local id.

@paramidstring
@returnsRelayTerminal | undefined

attach

attach(ws: WsSocket, session: RelayTerminal, url: URL, log: (line: string) => void): boolean

Joins a viewer's socket to the machine's stream when session is a remote reference. False for a local pty, which the caller then serves itself.

@paramwsWsSocket
@paramsessionRelayTerminal
@paramurlURL
@paramlog(line: string) => void
@returnsboolean