computer
Import
Section titled “Import”import * as api from "@fungi.computer/oyster/computer";Exports
Section titled “Exports”| 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”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”type ComputerTerminalAccess = ( signal,) => Promise<ComputerTerminalSelection> & object;Host admission on connection and lease renewal; unleased input rechecks it.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
leaseExpiresAt()? |
() => number | null |
Current admission deadline, when the host uses expiring leases. |
ComputerTerminalConnecttype alias
Section titled “ComputerTerminalConnect”type ComputerTerminalConnect = (terminalUrl, input) => WebSocket;Host transport construction; the shared protocol owns PTY session identity.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
terminalUrl |
string |
input |
ComputerTerminalSize & Readonly<{ session: string; }> |
Returns
Section titled “Returns”WebSocket
ComputerTerminalHostOptionstype alias
Section titled “ComputerTerminalHostOptions”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”type ComputerTerminalHost = object;Terminal operations and lifetime for one admitted App window.
Methods
Section titled “Methods”open()
Section titled “open()”open(size): Promise<AppComputerTerminal>;Open an admitted PTY and retain its session across transport reconnects.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
size |
ComputerTerminalSize |
Returns
Section titled “Returns”Promise<AppComputerTerminal>
[dispose]()
Section titled “[dispose]()”dispose: void;Close every terminal when the App window’s host lifetime ends.
Returns
Section titled “Returns”void
ComputerTerminalHostconstant
Section titled “ComputerTerminalHost”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
ComputerTerminalHostOptions |
Returns
Section titled “Returns”computerSlotsconstant
Section titled “computerSlots”const computerSlots: object;Computer routes supplied by the host; execution stays in the Computer runtime.