workspacesdk

package
v2.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CoderChatIDHeader is the HTTP header containing the current
	// chat ID. Set by coderd on agentconn requests originating
	// from chatd.
	CoderChatIDHeader = "Coder-Chat-Id"
	// CoderAncestorChatIDsHeader is the HTTP header containing a
	// JSON array of ancestor chat UUIDs.
	CoderAncestorChatIDsHeader = "Coder-Ancestor-Chat-Ids"
)
View Source
const (
	// DefaultMaxFileSize is the default maximum file size (1 MB).
	DefaultMaxFileSize int64 = 1 << 20
	// DefaultMaxLineBytes is the default per-line truncation threshold.
	DefaultMaxLineBytes int64 = 1024
	// DefaultMaxResponseLines is the default max lines per response.
	DefaultMaxResponseLines int64 = 2000
	// DefaultMaxResponseBytes is the default max response size (32 KB).
	DefaultMaxResponseBytes int64 = 32768
)
View Source
const (
	// DesktopNativeWidth is the default native desktop width in pixels used for
	// computer-use desktop sessions.
	DesktopNativeWidth = 1920
	// DesktopNativeHeight is the default native desktop height in pixels used for
	// computer-use desktop sessions.
	DesktopNativeHeight = 1080
)
View Source
const (
	AgentSSHPort             = tailnet.WorkspaceAgentSSHPort
	AgentStandardSSHPort     = tailnet.WorkspaceAgentStandardSSHPort
	AgentReconnectingPTYPort = tailnet.WorkspaceAgentReconnectingPTYPort
	AgentSpeedtestPort       = tailnet.WorkspaceAgentSpeedtestPort
	// AgentHTTPAPIServerPort serves a HTTP server with endpoints for e.g.
	// gathering agent statistics.
	AgentHTTPAPIServerPort = 4

	// AgentMinimumListeningPort is the minimum port that the listening-ports
	// endpoint will return to the client, and the minimum port that is accepted
	// by the proxy applications endpoint. Coder consumes ports 1-4 at the
	// moment, and we reserve some extra ports for future use. Port 9 and up are
	// available for the user.
	//
	// This is not enforced in the CLI intentionally as we don't really care
	// *that* much. The user could bypass this in the CLI by using SSH instead
	// anyways.
	AgentMinimumListeningPort = 9
)
View Source
const (
	AgentAPIMismatchMessage = "Unknown or unsupported API version"

	CoordinateAPIInvalidResumeToken = "Invalid resume token"
)
View Source
const MaxRecordingSize = 100 << 20 // 100 MB

MaxRecordingSize is the largest desktop recording (in bytes) that will be accepted. Used by both the agent-side stop handler and the server-side storage pipeline.

Variables

View Source
var AgentIgnoredListeningPorts = map[uint16]struct{}{
	0: {},

	1: {},
	2: {},
	3: {},
	4: {},
	5: {},
	6: {},
	7: {},
	8: {},

	20: {},
	21: {},

	22: {},

	23: {},

	25: {},

	53: {},

	110: {},

	143: {},

	179: {},

	389: {},
	636: {},

	465: {},

	587: {},

	989: {},
	990: {},

	993: {},

	995: {},

	3306: {},

	3389: {},

	5432: {},

	27017: {},
	27018: {},
	27019: {},
	28017: {},
}

AgentIgnoredListeningPorts contains a list of ports to ignore when looking for running applications inside a workspace. We want to ignore non-HTTP servers, so we pre-populate this list with common ports that are not HTTP servers.

This is implemented as a map for fast lookup.

View Source
var ErrSkipClose = xerrors.New("skip tailnet close")

Functions

func ExistsViaCoderConnect added in v2.22.0

func ExistsViaCoderConnect(ctx context.Context, hostname string) (bool, error)

ExistsViaCoderConnect checks if the given hostname exists via Coder Connect. This doesn't guarantee the workspace is actually reachable, if, for example, its agent is unhealthy, but rather that Coder Connect knows about the workspace and advertises the hostname via DNS.

func ParseSkillFrontmatter added in v2.32.0

func ParseSkillFrontmatter(content string) (name, description, body string, err error)

ParseSkillFrontmatter extracts name, description, and the remaining body from a skill meta file. The expected format is YAML-ish frontmatter delimited by "---" lines:

---
name: my-skill
description: Does a thing
---
Body text here...

func WithTestOnlyCoderContextResolver added in v2.22.0

func WithTestOnlyCoderContextResolver(ctx context.Context, r Resolver) context.Context

Types

type AgentConn

type AgentConn interface {
	TailnetConn() *tailnet.Conn
	SetExtraHeaders(h http.Header)

	AwaitReachable(ctx context.Context) bool
	CallMCPTool(ctx context.Context, req CallMCPToolRequest) (CallMCPToolResponse, error)
	Close() error
	ContextConfig(ctx context.Context) (ContextConfigResponse, error)
	DebugLogs(ctx context.Context) ([]byte, error)
	DebugMagicsock(ctx context.Context) ([]byte, error)
	DebugManifest(ctx context.Context) ([]byte, error)
	DialContext(ctx context.Context, network string, addr string) (net.Conn, error)
	GetPeerDiagnostics() tailnet.PeerDiagnostics
	ListContainers(ctx context.Context) (codersdk.WorkspaceAgentListContainersResponse, error)
	ListMCPTools(ctx context.Context) (ListMCPToolsResponse, error)
	ListProcesses(ctx context.Context) (ListProcessesResponse, error)
	ListeningPorts(ctx context.Context) (codersdk.WorkspaceAgentListeningPortsResponse, error)
	Netcheck(ctx context.Context) (healthsdk.AgentNetcheckReport, error)
	Ping(ctx context.Context) (time.Duration, bool, *ipnstate.PingResult, error)
	ProcessOutput(ctx context.Context, id string, opts *ProcessOutputOptions) (ProcessOutputResponse, error)
	PrometheusMetrics(ctx context.Context) ([]byte, error)
	ReconnectingPTY(ctx context.Context, id uuid.UUID, height uint16, width uint16, command string, initOpts ...AgentReconnectingPTYInitOption) (net.Conn, error)
	DeleteDevcontainer(ctx context.Context, devcontainerID string) error
	RecreateDevcontainer(ctx context.Context, devcontainerID string) (codersdk.Response, error)
	SignalProcess(ctx context.Context, id string, signal string) error
	StartProcess(ctx context.Context, req StartProcessRequest) (StartProcessResponse, error)
	LS(ctx context.Context, path string, req LSRequest) (LSResponse, error)
	ReadFile(ctx context.Context, path string, offset, limit int64) (io.ReadCloser, string, error)
	ReadFileLines(ctx context.Context, path string, offset, limit int64, limits ReadFileLinesLimits) (ReadFileLinesResponse, error)
	WriteFile(ctx context.Context, path string, reader io.Reader) error
	EditFiles(ctx context.Context, edits FileEditRequest) error
	SSH(ctx context.Context) (*gonet.TCPConn, error)
	SSHClient(ctx context.Context) (*ssh.Client, error)
	SSHClientOnPort(ctx context.Context, port uint16) (*ssh.Client, error)
	SSHOnPort(ctx context.Context, port uint16) (*gonet.TCPConn, error)
	Speedtest(ctx context.Context, direction speedtest.Direction, duration time.Duration) ([]speedtest.Result, error)
	WatchContainers(ctx context.Context, logger slog.Logger) (<-chan codersdk.WorkspaceAgentListContainersResponse, io.Closer, error)
	WatchGit(ctx context.Context, logger slog.Logger, chatID uuid.UUID) (*wsjson.Stream[codersdk.WorkspaceAgentGitServerMessage, codersdk.WorkspaceAgentGitClientMessage], error)
	ConnectDesktopVNC(ctx context.Context) (net.Conn, error)
	ExecuteDesktopAction(ctx context.Context, action DesktopAction) (DesktopActionResponse, error)
	StartDesktopRecording(ctx context.Context, req StartDesktopRecordingRequest) error
	StopDesktopRecording(ctx context.Context, req StopDesktopRecordingRequest) (io.ReadCloser, error)
}

AgentConn represents a connection to a workspace agent. @typescript-ignore AgentConn

func NewAgentConn

func NewAgentConn(conn *tailnet.Conn, opts AgentConnOptions) AgentConn

NewAgentConn creates a new WorkspaceAgentConn. `conn` may be unique to the WorkspaceAgentConn, or it may be shared in the case of coderd. If the conn is shared and closing it is undesirable, you may return ErrNoClose from opts.CloseFunc. This will ensure the underlying conn is not closed.

type AgentConnOptions

type AgentConnOptions struct {
	AgentID   uuid.UUID
	CloseFunc func() error
}

@typescript-ignore AgentConnOptions

type AgentConnectionInfo

type AgentConnectionInfo struct {
	DERPMap                  *tailcfg.DERPMap `json:"derp_map"`
	DERPForceWebSockets      bool             `json:"derp_force_websockets"`
	DisableDirectConnections bool             `json:"disable_direct_connections"`
	HostnameSuffix           string           `json:"hostname_suffix,omitempty"`
}

AgentConnectionInfo returns required information for establishing a connection with a workspace. @typescript-ignore AgentConnectionInfo

type AgentReconnectingPTYInit

type AgentReconnectingPTYInit struct {
	ID      uuid.UUID
	Height  uint16
	Width   uint16
	Command string
	// Container, if set, will attempt to exec into a running container visible to the agent.
	// This should be a unique container ID (implementation-dependent).
	Container string
	// ContainerUser, if set, will set the target user when execing into a container.
	// This can be a username or UID, depending on the underlying implementation.
	// This is ignored if Container is not set.
	ContainerUser string

	BackendType string
}

AgentReconnectingPTYInit initializes a new reconnecting PTY session. @typescript-ignore AgentReconnectingPTYInit

type AgentReconnectingPTYInitOption added in v2.21.0

type AgentReconnectingPTYInitOption func(*AgentReconnectingPTYInit)

AgentReconnectingPTYInitOption is a functional option for AgentReconnectingPTYInit.

func AgentReconnectingPTYInitWithContainer added in v2.21.0

func AgentReconnectingPTYInitWithContainer(container, containerUser string) AgentReconnectingPTYInitOption

AgentReconnectingPTYInitWithContainer sets the container and container user for the reconnecting PTY session.

type CallMCPToolRequest added in v2.32.0

type CallMCPToolRequest struct {
	// ToolName is the prefixed tool name (e.g. "github__create_issue").
	ToolName string `json:"tool_name"`
	// Arguments is the tool input as key-value pairs.
	Arguments map[string]any `json:"arguments"`
}

CallMCPToolRequest is the request body for proxying an MCP tool call through the workspace agent.

type CallMCPToolResponse added in v2.32.0

type CallMCPToolResponse struct {
	Content []MCPToolContent `json:"content"`
	IsError bool             `json:"is_error"`
}

CallMCPToolResponse is the response from a proxied MCP tool call.

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c *codersdk.Client) *Client

func (*Client) AgentConnectionInfo

func (c *Client) AgentConnectionInfo(ctx context.Context, agentID uuid.UUID) (AgentConnectionInfo, error)

func (*Client) AgentConnectionInfoGeneric

func (c *Client) AgentConnectionInfoGeneric(ctx context.Context) (AgentConnectionInfo, error)

func (*Client) AgentReconnectingPTY

func (c *Client) AgentReconnectingPTY(ctx context.Context, opts WorkspaceAgentReconnectingPTYOpts) (net.Conn, error)

AgentReconnectingPTY spawns a PTY that reconnects using the token provided. It communicates using `agent.ReconnectingPTYRequest` marshaled as JSON. Responses are PTY output that can be rendered.

func (*Client) DialAgent

func (c *Client) DialAgent(dialCtx context.Context, agentID uuid.UUID, options *DialAgentOptions) (agentConn AgentConn, err error)

func (*Client) IsCoderConnectRunning added in v2.22.0

func (c *Client) IsCoderConnectRunning(ctx context.Context, o CoderConnectQueryOptions) (bool, error)

IsCoderConnectRunning checks if Coder Connect (OS level tunnel to workspaces) is running on the system. If you already know the hostname suffix your deployment uses, you can pass it in the CoderConnectQueryOptions to avoid an API call to AgentConnectionInfoGeneric.

func (*Client) RewriteDERPMap added in v2.25.0

func (c *Client) RewriteDERPMap(derpMap *tailcfg.DERPMap)

RewriteDERPMap rewrites the DERP map to use the configured access URL of the client as the "embedded relay" access URL.

See tailnet.RewriteDERPMapDefaultRelay for more details on why this is necessary.

type CoderConnectQueryOptions added in v2.22.0

type CoderConnectQueryOptions struct {
	HostnameSuffix string
}

type ContextConfigResponse added in v2.32.0

type ContextConfigResponse struct {
	Parts []codersdk.ChatMessagePart `json:"parts"`
}

ContextConfigResponse is the response from the agent's context configuration endpoint. Contains pre-read instruction file contents and discovered skill metadata as chat message parts.

type DesktopAction added in v2.32.0

type DesktopAction struct {
	Action          string  `json:"action"`
	Coordinate      *[2]int `json:"coordinate,omitempty"`
	StartCoordinate *[2]int `json:"start_coordinate,omitempty"`
	Text            *string `json:"text,omitempty"`
	Duration        *int    `json:"duration,omitempty"`
	ScrollAmount    *int    `json:"scroll_amount,omitempty"`
	ScrollDirection *string `json:"scroll_direction,omitempty"`
	// ScaledWidth and ScaledHeight carry the declared model-facing desktop
	// geometry used for screenshot sizing and coordinate mapping.
	ScaledWidth  *int `json:"scaled_width,omitempty"`
	ScaledHeight *int `json:"scaled_height,omitempty"`
}

DesktopAction is the request body for the desktop action endpoint.

type DesktopActionResponse added in v2.32.0

type DesktopActionResponse struct {
	Output           string `json:"output,omitempty"`
	ScreenshotData   string `json:"screenshot_data,omitempty"`
	ScreenshotWidth  int    `json:"screenshot_width,omitempty"`
	ScreenshotHeight int    `json:"screenshot_height,omitempty"`
}

DesktopActionResponse is the response from the desktop action endpoint.

type DesktopGeometry added in v2.32.0

type DesktopGeometry struct {
	NativeWidth    int
	NativeHeight   int
	DeclaredWidth  int
	DeclaredHeight int
}

DesktopGeometry describes the native workspace desktop and the declared model-facing geometry used for screenshots and coordinates.

func DefaultDesktopGeometry added in v2.32.0

func DefaultDesktopGeometry() DesktopGeometry

DefaultDesktopGeometry returns the default native desktop geometry together with the declared model-facing geometry derived from it.

func NewDesktopGeometry added in v2.32.0

func NewDesktopGeometry(nativeWidth, nativeHeight int) DesktopGeometry

NewDesktopGeometry derives a declared model-facing geometry from the native desktop size.

func NewDesktopGeometryWithDeclared added in v2.32.0

func NewDesktopGeometryWithDeclared(
	nativeWidth,
	nativeHeight,
	declaredWidth,
	declaredHeight int,
) DesktopGeometry

NewDesktopGeometryWithDeclared returns a geometry that preserves the native desktop size while using the provided declared model-facing dimensions.

func (DesktopGeometry) DeclaredPointToNative added in v2.32.0

func (g DesktopGeometry) DeclaredPointToNative(x, y int) (nativeX, nativeY int)

DeclaredPointToNative maps a point from declared model-facing coordinates to native desktop coordinates using the existing pixel-center truncation rule.

func (DesktopGeometry) NativePointToDeclared added in v2.32.0

func (g DesktopGeometry) NativePointToDeclared(x, y int) (declaredX, declaredY int)

NativePointToDeclared maps a point from native desktop coordinates to the declared model-facing coordinate space using the same truncating transform.

type DialAgentOptions

type DialAgentOptions struct {
	Logger slog.Logger
	// BlockEndpoints forced a direct connection through DERP. The Client may
	// have DisableDirect set which will override this value.
	BlockEndpoints bool
	// CaptureHook is a callback that captures Disco packets and packets sent
	// into the tailnet tunnel.
	CaptureHook capture.Callback
	// Whether the client will send network telemetry events.
	// Enable instead of Disable so it's initialized to false (in tests).
	EnableTelemetry bool
}

@typescript-ignore DialAgentOptions

type FileEdit added in v2.27.0

type FileEdit struct {
	Search     string `json:"search"`
	Replace    string `json:"replace"`
	ReplaceAll bool   `json:"replace_all,omitempty"`
}

type FileEditRequest added in v2.27.0

type FileEditRequest struct {
	Files []FileEdits `json:"files"`
}

type FileEdits added in v2.27.0

type FileEdits struct {
	Path  string     `json:"path"`
	Edits []FileEdit `json:"edits"`
}

type LSFile added in v2.27.0

type LSFile struct {
	Name string `json:"name"`
	// e.g. "C:\\Users\\coder\\hello.txt"
	//      "/home/coder/hello.txt"
	AbsolutePathString string `json:"absolute_path_string"`
	IsDir              bool   `json:"is_dir"`
}

type LSRelativity added in v2.27.0

type LSRelativity string
const (
	LSRelativityRoot LSRelativity = "root"
	LSRelativityHome LSRelativity = "home"
)

type LSRequest added in v2.27.0

type LSRequest struct {
	// e.g. [], ["repos", "coder"],
	Path []string `json:"path"`
	// Whether the supplied path is relative to the user's home directory,
	// or the root directory.
	Relativity LSRelativity `json:"relativity"`
}

type LSResponse added in v2.27.0

type LSResponse struct {
	AbsolutePath []string `json:"absolute_path"`
	// Returned so clients can display the full path to the user, and
	// copy it to configure file sync
	// e.g. Windows: "C:\\Users\\coder"
	//      Linux: "/home/coder"
	AbsolutePathString string   `json:"absolute_path_string"`
	Contents           []LSFile `json:"contents"`
}

type ListMCPToolsResponse added in v2.32.0

type ListMCPToolsResponse struct {
	Tools []MCPToolInfo `json:"tools"`
}

ListMCPToolsResponse is the response from the agent's MCP tool discovery endpoint.

type ListProcessesResponse added in v2.32.0

type ListProcessesResponse struct {
	Processes []ProcessInfo `json:"processes"`
}

ListProcessesResponse contains information about tracked processes on the workspace agent.

type MCPToolContent added in v2.32.0

type MCPToolContent struct {
	Type      string `json:"type"` // "text", "image", "audio", "resource"
	Text      string `json:"text,omitempty"`
	Data      string `json:"data,omitempty"` // base64 for binary
	MediaType string `json:"media_type,omitempty"`
}

MCPToolContent is a single content block in an MCP tool response.

type MCPToolInfo added in v2.32.0

type MCPToolInfo struct {
	// ServerName is the key from .mcp.json (e.g. "github").
	ServerName string `json:"server_name"`
	// Name is the prefixed tool name: "serverName__toolName".
	Name string `json:"name"`
	// Description is the tool's human-readable description.
	Description string `json:"description"`
	// Schema is the JSON Schema for the tool's input parameters.
	Schema map[string]any `json:"schema"`
	// Required lists required parameter names.
	Required []string `json:"required"`
}

MCPToolInfo describes a single tool discovered from an MCP server configured in the workspace's .mcp.json file.

type ProcessInfo added in v2.32.0

type ProcessInfo struct {
	ID         string `json:"id"`
	Command    string `json:"command"`
	WorkDir    string `json:"workdir,omitempty"`
	Background bool   `json:"background"`
	Running    bool   `json:"running"`
	ExitCode   *int   `json:"exit_code,omitempty"`
	StartedAt  int64  `json:"started_at_unix"`
	ExitedAt   *int64 `json:"exited_at_unix,omitempty"`
}

ProcessInfo describes a tracked process on the agent.

type ProcessOutputOptions added in v2.32.0

type ProcessOutputOptions struct {
	// Wait enables blocking mode. When true, the request
	// blocks until the process exits or the context expires.
	Wait bool
}

ProcessOutputOptions configures blocking behavior for process output retrieval.

type ProcessOutputResponse added in v2.32.0

type ProcessOutputResponse struct {
	Output    string             `json:"output"`
	Truncated *ProcessTruncation `json:"truncated,omitempty"`
	Running   bool               `json:"running"`
	ExitCode  *int               `json:"exit_code,omitempty"`
}

ProcessOutputResponse contains the output of a process.

type ProcessTruncation added in v2.32.0

type ProcessTruncation struct {
	OriginalBytes int    `json:"original_bytes"`
	RetainedBytes int    `json:"retained_bytes"`
	OmittedBytes  int    `json:"omitted_bytes"`
	Strategy      string `json:"strategy"`
}

ProcessTruncation describes how process output was truncated.

type ReadFileLinesLimits added in v2.32.0

type ReadFileLinesLimits struct {
	// MaxFileSize is the maximum file size (in bytes) that will be opened.
	MaxFileSize int64
	// MaxLineBytes is the per-line byte cap before truncation.
	MaxLineBytes int
	// MaxResponseLines is the maximum number of lines in a single response.
	MaxResponseLines int
	// MaxResponseBytes is the maximum total bytes of formatted output.
	MaxResponseBytes int
}

ReadFileLinesLimits contains configurable safety limits for the line-based file reader. These are sent as query parameters so callers can tune them without requiring an agent redeployment.

func DefaultReadFileLinesLimits added in v2.32.0

func DefaultReadFileLinesLimits() ReadFileLinesLimits

DefaultReadFileLinesLimits returns the default limits.

type ReadFileLinesResponse added in v2.32.0

type ReadFileLinesResponse struct {
	Success    bool   `json:"success"`
	FileSize   int64  `json:"file_size,omitempty"`
	TotalLines int    `json:"total_lines,omitempty"`
	LinesRead  int    `json:"lines_read,omitempty"`
	Content    string `json:"content,omitempty"`
	Error      string `json:"error,omitempty"`
}

ReadFileLinesResponse is the response from the line-based file reader.

type ReconnectingPTYRequest

type ReconnectingPTYRequest struct {
	Data   string `json:"data,omitempty"`
	Height uint16 `json:"height,omitempty"`
	Width  uint16 `json:"width,omitempty"`
}

ReconnectingPTYRequest is sent from the client to the server to pipe data to a PTY. @typescript-ignore ReconnectingPTYRequest

type Resolver added in v2.22.0

type Resolver interface {
	LookupIP(ctx context.Context, network, host string) ([]net.IP, error)
}

type SignalProcessRequest added in v2.32.0

type SignalProcessRequest struct {
	Signal string `json:"signal"`
}

SignalProcessRequest is the request body for signaling a process on the workspace agent.

type StartDesktopRecordingRequest added in v2.32.0

type StartDesktopRecordingRequest struct {
	RecordingID string `json:"recording_id"`
}

StartDesktopRecordingRequest is the request body for starting a desktop recording session.

type StartProcessRequest added in v2.32.0

type StartProcessRequest struct {
	Command    string            `json:"command"`
	WorkDir    string            `json:"workdir,omitempty"`
	Env        map[string]string `json:"env,omitempty"`
	Background bool              `json:"background,omitempty"`
}

StartProcessRequest is the request body for starting a process on the workspace agent.

type StartProcessResponse added in v2.32.0

type StartProcessResponse struct {
	ID      string `json:"id"`
	Started bool   `json:"started"`
}

StartProcessResponse is returned when a process is started.

type StopDesktopRecordingRequest added in v2.32.0

type StopDesktopRecordingRequest struct {
	RecordingID string `json:"recording_id"`
}

StopDesktopRecordingRequest is the request body for stopping a desktop recording session.

type WebsocketDialer added in v2.18.0

type WebsocketDialer struct {
	// contains filtered or unexported fields
}

func NewWebsocketDialer added in v2.18.0

func NewWebsocketDialer(
	logger slog.Logger, u *url.URL, websocketOptions *websocket.DialOptions,
	dialerOptions ...WebsocketDialerOption,
) *WebsocketDialer

func (*WebsocketDialer) Connected added in v2.18.0

func (w *WebsocketDialer) Connected() <-chan error

func (*WebsocketDialer) Dial added in v2.18.0

type WebsocketDialerOption added in v2.18.0

type WebsocketDialerOption func(*WebsocketDialer)

func WithWorkspaceUpdates added in v2.18.0

func WithWorkspaceUpdates(req *proto.WorkspaceUpdatesRequest) WebsocketDialerOption

type WorkspaceAgentReconnectingPTYOpts

type WorkspaceAgentReconnectingPTYOpts struct {
	AgentID   uuid.UUID
	Reconnect uuid.UUID
	Width     uint16
	Height    uint16
	Command   string

	// SignedToken is an optional signed token from the
	// issue-reconnecting-pty-signed-token endpoint. If set, the session token
	// on the client will not be sent.
	SignedToken string

	// Experimental: Container, if set, will attempt to exec into a running container
	// visible to the agent. This should be a unique container ID
	// (implementation-dependent).
	// ContainerUser is the user as which to exec into the container.
	// NOTE: This feature is currently experimental and is currently "opt-in".
	// In order to use this feature, the agent must have the environment variable
	// CODER_AGENT_DEVCONTAINERS_ENABLE set to "true".
	Container     string
	ContainerUser string

	// BackendType is the type of backend to use for the PTY. If not set, the
	// workspace agent will attempt to determine the preferred backend type.
	// Supported values are "screen" and "buffered".
	BackendType string
}

@typescript-ignore:WorkspaceAgentReconnectingPTYOpts

Directories

Path Synopsis
Package agentconnmock is a generated GoMock package.
Package agentconnmock is a generated GoMock package.

Jump to

Keyboard shortcuts

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