Skip to main content
Blitz
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

terminal.proto

Generated from proto/blitz/v1/terminal.proto by proto-gen-md-diagrams.

Imports

Import Description
google/protobuf/timestamp.proto

Options

Name Value Description
go_package github.com/retail-cortex/blitz/proto/blitz/v1

blitz.v1 Diagram

classDiagram
direction LR
%% Mermaid Diagram for package: blitz.v1

%% A terminal as the window lists it.

class TerminalInfo {
  + string id
  + string dir
  + string shell
  + google.protobuf.Timestamp started
  + bool exited
  + int32 exit_code
}

%% A terminal to start.

class OpenTerminalRequest {
  + string workspace
  + string dir
  + uint32 cols
  + uint32 rows
}

%% The terminal started.

class OpenTerminalResponse {
  + TerminalInfo terminal
}
OpenTerminalResponse --> `TerminalInfo`

%% A terminal's output to watch, from where the window has read.

class WatchTerminalRequest {
  + string workspace
  + string id
  + int64 from
}

%% A terminal's output, or its end.

class WatchTerminalResponse {
  + bytes data
  + int64 offset
  + int64 skipped
  + bool exited
  + int32 exit_code
}

%% Input for a terminal's shell.

class WriteTerminalRequest {
  + string workspace
  + string id
  + bytes data
}

%% The input was written.

class WriteTerminalResponse {
}

%% A terminal's new size, in characters.

class ResizeTerminalRequest {
  + string workspace
  + string id
  + uint32 cols
  + uint32 rows
}

%% The size was set.

class ResizeTerminalResponse {
}

%% The workspace whose terminals to list.

class ListTerminalsRequest {
  + string workspace
}

%% The workspace's terminals, oldest first.

class ListTerminalsResponse {
  + List~TerminalInfo~ terminals
}
ListTerminalsResponse --> `TerminalInfo`

%% A terminal to end.

class CloseTerminalRequest {
  + string workspace
  + string id
}

%% The terminal ended.

class CloseTerminalResponse {
}
class TerminalService {
  <<service>>
  +OpenTerminal(OpenTerminalRequest) OpenTerminalResponse
  +WatchTerminal(WatchTerminalRequest) Stream~WatchTerminalResponse~
  +WriteTerminal(WriteTerminalRequest) WriteTerminalResponse
  +ResizeTerminal(ResizeTerminalRequest) ResizeTerminalResponse
  +ListTerminals(ListTerminalsRequest) ListTerminalsResponse
  +CloseTerminal(CloseTerminalRequest) CloseTerminalResponse
}
TerminalService --> `OpenTerminalRequest`
TerminalService --> `OpenTerminalResponse`
TerminalService --> `WatchTerminalRequest`
TerminalService --o `WatchTerminalResponse` : server stream
TerminalService --> `WriteTerminalRequest`
TerminalService --> `WriteTerminalResponse`
TerminalService --> `ResizeTerminalRequest`
TerminalService --> `ResizeTerminalResponse`
TerminalService --> `ListTerminalsRequest`
TerminalService --> `ListTerminalsResponse`
TerminalService --> `CloseTerminalRequest`
TerminalService --> `CloseTerminalResponse`

Service: TerminalService

FQN: blitz.v1
TerminalService is the window's terminals (spec_062_terminal): the person's login shell in a pseudo-terminal, run by the service in the workspace, outside the agent's sandbox, and never seen by the agent. Output comes on a stream; input and sizes go by unary calls, since a browser can't stream to the service. Every request names its workspace by absolute directory. Errors carry an ErrorInfo detail: UNKNOWN_TERMINAL, TOO_MANY_TERMINALS, BAD_PATH, TERMINAL_UNSUPPORTED.

TerminalService Diagram

classDiagram
direction LR
class TerminalService {
  <<service>>
  +OpenTerminal(OpenTerminalRequest) OpenTerminalResponse
  +WatchTerminal(WatchTerminalRequest) Stream~WatchTerminalResponse~
  +WriteTerminal(WriteTerminalRequest) WriteTerminalResponse
  +ResizeTerminal(ResizeTerminalRequest) ResizeTerminalResponse
  +ListTerminals(ListTerminalsRequest) ListTerminalsResponse
  +CloseTerminal(CloseTerminalRequest) CloseTerminalResponse
}
TerminalService --> `OpenTerminalRequest`
TerminalService --> `OpenTerminalResponse`
TerminalService --> `WatchTerminalRequest`
TerminalService --o `WatchTerminalResponse` : server stream
TerminalService --> `WriteTerminalRequest`
TerminalService --> `WriteTerminalResponse`
TerminalService --> `ResizeTerminalRequest`
TerminalService --> `ResizeTerminalResponse`
TerminalService --> `ListTerminalsRequest`
TerminalService --> `ListTerminalsResponse`
TerminalService --> `CloseTerminalRequest`
TerminalService --> `CloseTerminalResponse`
Method Parameter (In) Parameter (Out) Description
OpenTerminal OpenTerminalRequest OpenTerminalResponse Starts a terminal in a folder of the workspace (TRM-10).
WatchTerminal WatchTerminalRequest Stream<WatchTerminalResponse> A terminal’s output from an offset, then as it comes, until its shell exits (TRM-12).
WriteTerminal WriteTerminalRequest WriteTerminalResponse Writes to a terminal’s input (TRM-13).
ResizeTerminal ResizeTerminalRequest ResizeTerminalResponse Sets a terminal’s size (TRM-11).
ListTerminals ListTerminalsRequest ListTerminalsResponse The workspace’s terminals, oldest first (TRM-14).
CloseTerminal CloseTerminalRequest CloseTerminalResponse Ends a terminal: its shell is hung up, then killed (TRM-03).

TerminalInfo Diagram

classDiagram
direction LR

%% A terminal as the window lists it.

class TerminalInfo {
  + string id
  + string dir
  + string shell
  + google.protobuf.Timestamp started
  + bool exited
  + int32 exit_code
}

OpenTerminalRequest Diagram

classDiagram
direction LR

%% A terminal to start.

class OpenTerminalRequest {
  + string workspace
  + string dir
  + uint32 cols
  + uint32 rows
}

OpenTerminalResponse Diagram

classDiagram
direction LR

%% The terminal started.

class OpenTerminalResponse {
  + TerminalInfo terminal
}
OpenTerminalResponse --> `TerminalInfo`

WatchTerminalRequest Diagram

classDiagram
direction LR

%% A terminal's output to watch, from where the window has read.

class WatchTerminalRequest {
  + string workspace
  + string id
  + int64 from
}

WatchTerminalResponse Diagram

classDiagram
direction LR

%% A terminal's output, or its end.

class WatchTerminalResponse {
  + bytes data
  + int64 offset
  + int64 skipped
  + bool exited
  + int32 exit_code
}

WriteTerminalRequest Diagram

classDiagram
direction LR

%% Input for a terminal's shell.

class WriteTerminalRequest {
  + string workspace
  + string id
  + bytes data
}

WriteTerminalResponse Diagram

classDiagram
direction LR

%% The input was written.

class WriteTerminalResponse {
}

ResizeTerminalRequest Diagram

classDiagram
direction LR

%% A terminal's new size, in characters.

class ResizeTerminalRequest {
  + string workspace
  + string id
  + uint32 cols
  + uint32 rows
}

ResizeTerminalResponse Diagram

classDiagram
direction LR

%% The size was set.

class ResizeTerminalResponse {
}

ListTerminalsRequest Diagram

classDiagram
direction LR

%% The workspace whose terminals to list.

class ListTerminalsRequest {
  + string workspace
}

ListTerminalsResponse Diagram

classDiagram
direction LR

%% The workspace's terminals, oldest first.

class ListTerminalsResponse {
  + List~TerminalInfo~ terminals
}
ListTerminalsResponse --> `TerminalInfo`

CloseTerminalRequest Diagram

classDiagram
direction LR

%% A terminal to end.

class CloseTerminalRequest {
  + string workspace
  + string id
}

CloseTerminalResponse Diagram

classDiagram
direction LR

%% The terminal ended.

class CloseTerminalResponse {
}

Message: TerminalInfo

FQN: blitz.v1.TerminalInfo
A terminal as the window lists it.
Field Ordinal Type Label Description
id 1 string
dir 2 string The folder it started in, relative to the workspace ("" for it).
shell 3 string The shell it runs.
started 4 google.protobuf.Timestamp
exited 5 bool Whether its shell has exited, and with what code.
exit_code 6 int32

Message: OpenTerminalRequest

FQN: blitz.v1.OpenTerminalRequest
A terminal to start.
Field Ordinal Type Label Description
workspace 1 string
dir 2 string A folder in the workspace, relative to it ("" for the workspace).
cols 3 uint32 Its size in characters; 0 for 80×24.
rows 4 uint32

Message: OpenTerminalResponse

FQN: blitz.v1.OpenTerminalResponse
The terminal started.
Field Ordinal Type Label Description
terminal 1 TerminalInfo

Message: WatchTerminalRequest

FQN: blitz.v1.WatchTerminalRequest
A terminal's output to watch, from where the window has read.
Field Ordinal Type Label Description
workspace 1 string
id 2 string
from 3 int64 Where the window has read up to, counted in bytes from the terminal’s start: 0 replays the scrollback.

Message: WatchTerminalResponse

FQN: blitz.v1.WatchTerminalResponse
A terminal's output, or its end.
Field Ordinal Type Label Description
data 1 bytes Output, ending at offset.
offset 2 int64
skipped 3 int64 Output before data that the scrollback no longer held.
exited 4 bool The shell exited (the stream’s last message), with its code.
exit_code 5 int32

Message: WriteTerminalRequest

FQN: blitz.v1.WriteTerminalRequest
Input for a terminal's shell.
Field Ordinal Type Label Description
workspace 1 string
id 2 string
data 3 bytes Keys or a paste, at most 64 KiB.

Message: WriteTerminalResponse

FQN: blitz.v1.WriteTerminalResponse
The input was written.
Field Ordinal Type Label Description

Message: ResizeTerminalRequest

FQN: blitz.v1.ResizeTerminalRequest
A terminal's new size, in characters.
Field Ordinal Type Label Description
workspace 1 string
id 2 string
cols 3 uint32
rows 4 uint32

Message: ResizeTerminalResponse

FQN: blitz.v1.ResizeTerminalResponse
The size was set.
Field Ordinal Type Label Description

Message: ListTerminalsRequest

FQN: blitz.v1.ListTerminalsRequest
The workspace whose terminals to list.
Field Ordinal Type Label Description
workspace 1 string

Message: ListTerminalsResponse

FQN: blitz.v1.ListTerminalsResponse
The workspace's terminals, oldest first.
Field Ordinal Type Label Description
terminals 1 TerminalInfo Repeated

Message: CloseTerminalRequest

FQN: blitz.v1.CloseTerminalRequest
A terminal to end.
Field Ordinal Type Label Description
workspace 1 string
id 2 string

Message: CloseTerminalResponse

FQN: blitz.v1.CloseTerminalResponse
The terminal ended.
Field Ordinal Type Label Description