Skip to content
API reference

computer

Import
import * as api from "@fungi.computer/oyster/computer";
Kind Export Description
type alias ComputerTerminalSelection Current host admission for the Computer captured when the terminal opened.
type alias ComputerTerminalAccess Host admission on connection and lease renewal; unleased input rechecks it.
type alias ComputerTerminalConnect Host transport construction; the shared protocol owns PTY session identity.
type alias ComputerTerminalHostOptions Host policy and browser lifetime surrounding the retained PTY protocol.
type alias ComputerTerminalHost Terminal operations and lifetime for one admitted App window.
constant ComputerTerminalHost Construct the shared terminal owner with host policy and transport edges.
constant computerSlots Computer routes supplied by the host; execution stays in the Computer runtime.

ComputerTerminalSelectiontype alias

Section titled “ComputerTerminalSelection”
Signature
type ComputerTerminalSelection = Readonly<{
computerId: string | null;
terminalUrl: string | null;
}>;

Current host admission for the Computer captured when the terminal opened.


ComputerTerminalAccesstype alias

Section titled “ComputerTerminalAccess”
Signature
type ComputerTerminalAccess = (
signal,
) => Promise<ComputerTerminalSelection> & object;

Host admission on connection and lease renewal; unleased input rechecks it.

Name Type Description
leaseExpiresAt()? () => number | null Current admission deadline, when the host uses expiring leases.

ComputerTerminalConnecttype alias

Section titled “ComputerTerminalConnect”
Signature
type ComputerTerminalConnect = (terminalUrl, input) => WebSocket;

Host transport construction; the shared protocol owns PTY session identity.

Parameter Type
terminalUrl string
input ComputerTerminalSize & Readonly<{ session: string; }>

WebSocket


ComputerTerminalHostOptionstype alias

Section titled “ComputerTerminalHostOptions”
Signature
type ComputerTerminalHostOptions = Readonly<{
terminalUrl: string;
computerId: string | null;
hostWindow: Readonly<{
setTimeout: (callback, delayMs) => number;
clearTimeout: (timer) => void;
}>;
ensureAccess: ComputerTerminalAccess;
connect: ComputerTerminalConnect;
mountSignal: AbortSignal | undefined;
}>;

Host policy and browser lifetime surrounding the retained PTY protocol.


ComputerTerminalHosttype alias

Section titled “ComputerTerminalHost”
Signature
type ComputerTerminalHost = object;

Terminal operations and lifetime for one admitted App window.

Signature
open(size): Promise<AppComputerTerminal>;

Open an admitted PTY and retain its session across transport reconnects.

Parameter Type
size ComputerTerminalSize

Promise<AppComputerTerminal>

Signature
dispose: void;

Close every terminal when the App window’s host lifetime ends.

void

ComputerTerminalHostconstant

Section titled “ComputerTerminalHost”
Signature
ComputerTerminalHost: (options) => ComputerTerminalHost;

Construct the shared terminal owner with host policy and transport edges.

Construct the shared terminal owner with host policy and transport edges.

Parameter Type
options ComputerTerminalHostOptions

ComputerTerminalHost


computerSlotsconstant

Section titled “computerSlots”
Signature
const computerSlots: object;

Computer routes supplied by the host; execution stays in the Computer runtime.

Name Type Default value
ports object -
ports.id string computerPorts.id
ports.version number computerPorts.version
ports.base "/computer/" "/computer/"
ports.methods object -
ports.methods.list object -
ports.methods.list.kind "json" "json"
ports.methods.list.method "GET" "GET"
ports.methods.list.path "ports" "ports"
ports.methods.expose object -
ports.methods.expose.kind "json" "json"
ports.methods.expose.method "POST" "POST"
ports.methods.expose.path "ports/expose" "ports/expose"
ports.methods.unexpose object -
ports.methods.unexpose.kind "json" "json"
ports.methods.unexpose.method "POST" "POST"
ports.methods.unexpose.path "ports/unexpose" "ports/unexpose"
processes object -
processes.id string computerProcesses.id
processes.version number computerProcesses.version
processes.base "/computer/" "/computer/"
processes.methods object -
processes.methods.start object -
processes.methods.start.kind "json" "json"
processes.methods.start.method "POST" "POST"
processes.methods.start.path "processes/start" "processes/start"
processes.methods.list object -
processes.methods.list.kind "json" "json"
processes.methods.list.method "GET" "GET"
processes.methods.list.path "processes" "processes"
processes.methods.kill object -
processes.methods.kill.kind "json" "json"
processes.methods.kill.method "POST" "POST"
processes.methods.kill.path "processes/kill" "processes/kill"
terminal object -
terminal.id string computerTerminal.id
terminal.version number computerTerminal.version
terminal.base "/computer/" "/computer/"
terminal.methods object -
terminal.methods.open object -
terminal.methods.open.kind "transport" "transport"
terminal.methods.open.method "GET" "GET"
terminal.methods.open.path "terminal" "terminal"