protocol

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FrameJSON   byte = 0x01 // JSON control message
	FrameBinary byte = 0x02 // Raw binary data (file content, tar, stdin/stdout)
	FramePing   byte = 0x03 // Ping/pong (payload: 0x00 = ping, 0x01 = pong)
)

Frame types for the daemon ↔ agent binary protocol.

View Source
const (
	PingRequest  byte = 0x00
	PingResponse byte = 0x01
)

Ping/pong payload values.

View Source
const (
	// Filesystem
	OpFsRead     = "fs.read"
	OpFsWrite    = "fs.write"
	OpFsList     = "fs.list"
	OpFsStat     = "fs.stat"
	OpFsRemove   = "fs.remove"
	OpFsRename   = "fs.rename"
	OpFsMkdir    = "fs.mkdir"
	OpFsUpload   = "fs.upload"
	OpFsDownload = "fs.download"

	// Process
	OpProcessExec   = "process.exec"
	OpProcessStream = "process.stream"
	OpProcessSpawn  = "process.spawn"
	OpProcessPty    = "process.pty"
	OpProcessResize = "process.resize"

	// Streaming process output notifications
	OpProcessOutput = "process.output"
	OpProcessDone   = "process.done"

	// Environment
	OpEnvGet    = "env.get"
	OpEnvSet    = "env.set"
	OpEnvDelete = "env.delete"
	OpEnvList   = "env.list"

	// Network
	OpNetFetch = "net.fetch"

	// Template
	OpTemplateSave = "template.save"

	// Session
	OpSessionResumed      = "session.resumed"
	OpSessionReplaced     = "session.replaced"
	OpSessionNegotiateE2E = "session.negotiate_e2e"
)

Operation names for the sandbox API.

View Source
const ChunkSize = 1 * 1024 * 1024

ChunkSize is the size of each chunk for chunked file transfers (1MB). Files larger than this are split into multiple binary frames.

View Source
const ChunkThreshold = 1 * 1024 * 1024

ChunkThreshold is the file size above which chunked transfer is used.

View Source
const MaxFrameSize = 10 * 1024 * 1024

MaxFrameSize is the maximum allowed frame payload size (10MB). Frames exceeding this limit cause an immediate connection close.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	JSONRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params,omitempty"`
}

Notification is a JSON-RPC 2.0 notification (no ID).

type RPCError

type RPCError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

RPCError is a JSON-RPC 2.0 error object.

type Request

type Request struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      int         `json:"id"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params,omitempty"`
}

Request is a JSON-RPC 2.0 request.

type Response

type Response struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      int         `json:"id"`
	Result  interface{} `json:"result,omitempty"`
	Error   *RPCError   `json:"error,omitempty"`
}

Response is a JSON-RPC 2.0 response.

Directories

Path Synopsis
Package crypto provides X25519 key exchange and AES-256-GCM encryption for end-to-end encrypted communication between SDK clients and guest agents.
Package crypto provides X25519 key exchange and AES-256-GCM encryption for end-to-end encrypted communication between SDK clients and guest agents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL