web

package
v0.245.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScreenActionTakeOver = "take_over"
	ScreenActionHandBack = "hand_back"
)

The screen control actions a person's POST carries.

View Source
const Path = "/terminal/"

Path is where the daemon's binding listener serves the terminal.

View Source
const ScreenPath = "/screen/"

ScreenPath is where the daemon's binding listener serves a session's latest screen frame: GET ScreenPath?id=<session> with the binding token as a bearer, and POST ScreenPath?id=<session> to take the screen over, drive it or hand it back with the same bearer.

Variables

This section is empty.

Functions

func URL added in v0.244.0

func URL(binding config.Binding, token string) string

URL is where a browser on this machine opens the terminal, carrying the token the page sends in its init frame.

Types

type Screen added in v0.244.0

type Screen struct {
	Token       string
	ClientCerts bool
	Frame       func(ctx context.Context, sessionID string) (*agentdomain.Frame, error)
	Control     func(ctx context.Context, sessionID, action string) (*ScreenOutcome, error)
	Input       func(ctx context.Context, sessionID string, input json.RawMessage) (*ScreenOutcome, error)
}

Screen serves the latest screen frame of a session's worker as an image, for the web terminal's live view, and its take-over: the control action and the person's inputs while held. Frame asks the daemon for it wherever the session runs. Control and Input relay to the same worker, the input as the raw JSON of the worker's ScreenInput contract, which the worker validates.

func (*Screen) ServeHTTP added in v0.244.0

func (s *Screen) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ScreenOutcome added in v0.245.0

type ScreenOutcome struct {
	Held  bool
	Error string
}

ScreenOutcome is the worker's answer to a screen control or input call: the screen's held state after it and what failed, if it came to that.

type Terminal added in v0.244.0

type Terminal struct {
	Token       string
	ClientCerts bool
	Command     func(sessionID string) *exec.Cmd
	// contains filtered or unexported fields
}

Terminal serves the browser terminal under Path on the daemon's binding listener: the xterm page, and one PTY per socket running Command on a session id of the tab's own, which the tab learns from the init reply. A token matching Token, or a verified client certificate when ClientCerts is set, authorizes a socket.

func (*Terminal) ServeHTTP added in v0.244.0

func (t *Terminal) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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