terminal.proto
Generated from proto/blitz/v1/terminal.proto by proto-gen-md-diagrams.
| Import | Description |
|---|---|
| google/protobuf/timestamp.proto |
| Name | Value | Description |
|---|---|---|
| go_package | github.com/retail-cortex/blitz/proto/blitz/v1 |
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`
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.
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). |
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
}
classDiagram
direction LR
%% A terminal to start.
class OpenTerminalRequest {
+ string workspace
+ string dir
+ uint32 cols
+ uint32 rows
}
classDiagram
direction LR
%% The terminal started.
class OpenTerminalResponse {
+ TerminalInfo terminal
}
OpenTerminalResponse --> `TerminalInfo`
classDiagram
direction LR
%% A terminal's output to watch, from where the window has read.
class WatchTerminalRequest {
+ string workspace
+ string id
+ int64 from
}
classDiagram
direction LR
%% A terminal's output, or its end.
class WatchTerminalResponse {
+ bytes data
+ int64 offset
+ int64 skipped
+ bool exited
+ int32 exit_code
}
classDiagram
direction LR
%% Input for a terminal's shell.
class WriteTerminalRequest {
+ string workspace
+ string id
+ bytes data
}
classDiagram
direction LR
%% The input was written.
class WriteTerminalResponse {
}
classDiagram
direction LR
%% A terminal's new size, in characters.
class ResizeTerminalRequest {
+ string workspace
+ string id
+ uint32 cols
+ uint32 rows
}
classDiagram
direction LR
%% The size was set.
class ResizeTerminalResponse {
}
classDiagram
direction LR
%% The workspace whose terminals to list.
class ListTerminalsRequest {
+ string workspace
}
classDiagram
direction LR
%% The workspace's terminals, oldest first.
class ListTerminalsResponse {
+ List~TerminalInfo~ terminals
}
ListTerminalsResponse --> `TerminalInfo`
classDiagram
direction LR
%% A terminal to end.
class CloseTerminalRequest {
+ string workspace
+ string id
}
classDiagram
direction LR
%% The terminal ended.
class CloseTerminalResponse {
}
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 |
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 |
FQN: blitz.v1.OpenTerminalResponse
The terminal started.
| Field | Ordinal | Type | Label | Description |
|---|---|---|---|---|
| terminal | 1 | TerminalInfo |
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. |
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 |
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. |
FQN: blitz.v1.WriteTerminalResponse
The input was written.
| Field | Ordinal | Type | Label | Description |
|---|
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 |
FQN: blitz.v1.ResizeTerminalResponse
The size was set.
| Field | Ordinal | Type | Label | Description |
|---|
FQN: blitz.v1.ListTerminalsRequest
The workspace whose terminals to list.
| Field | Ordinal | Type | Label | Description |
|---|---|---|---|---|
| workspace | 1 | string |
FQN: blitz.v1.ListTerminalsResponse
The workspace's terminals, oldest first.
| Field | Ordinal | Type | Label | Description |
|---|---|---|---|---|
| terminals | 1 | TerminalInfo | Repeated |
FQN: blitz.v1.CloseTerminalRequest
A terminal to end.
| Field | Ordinal | Type | Label | Description |
|---|---|---|---|---|
| workspace | 1 | string | ||
| id | 2 | string |
FQN: blitz.v1.CloseTerminalResponse
The terminal ended.
| Field | Ordinal | Type | Label | Description |
|---|