syntax = "proto3"; package sesh; service Seshd { // Sessions rpc StartSession (SeshStartRequest) returns (SeshStartResponse); rpc KillSession (SeshKillRequest) returns (SeshKillResponse); rpc ListSessions (SeshListRequest) returns (SeshListResponse); // Attach / Detach rpc AttachSession (SeshAttachRequest) returns (SeshAttachResponse); rpc DetachSession (SeshDetachRequest) returns (SeshDetachResponse); // Resize rpc ResizeSession (SeshResizeRequest) returns (SeshResizeResponse); // Server rpc ShutdownServer (ShutdownServerRequest) returns (ShutdownServerResponse); } service SeshCLI { rpc Detach (ClientDetachRequest) returns (ClientDetachResponse); } message ClientDetachRequest {} message ClientDetachResponse {} message SeshResizeRequest { oneof session { string name = 1; uint64 id = 2; } WinSize size = 3; } message SeshResizeResponse {} message SeshDetachRequest { oneof session { string name = 1; uint64 id = 2; } } message SeshDetachResponse { bool success = 1; } message WinSize { uint32 rows = 1; uint32 cols = 2; } message SeshAttachRequest { oneof session { string name = 1; uint64 id = 2; }; WinSize size = 3; } message SeshAttachResponse { string socket = 1; int32 pid = 2; string name = 3; string program = 4; } message ShutdownServerRequest {} message ShutdownServerResponse { bool success = 1; } message Var { string key = 1; string value = 2; } message SeshStartRequest { string name = 1; string program = 2; repeated string args = 3; WinSize size = 4; string pwd = 5; repeated Var env = 6; } message SeshStartResponse { string socket = 1; int32 pid = 2; string name = 3; string program = 4; } message SeshKillRequest { oneof session { string name = 1; uint64 id = 2; } } message SeshKillResponse { bool success = 1; } message SeshListRequest {} message SeshInfo { uint64 id = 1; string name = 2; string program = 3; string socket = 4; bool connected = 5; int64 start_time = 6; int64 attach_time = 7; int32 pid = 8; } message SeshListResponse { repeated SeshInfo sessions = 1; }