infrastructure

package
v0.262.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircularScreenshotBuffer

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

CircularScreenshotBuffer implements a thread-safe ring buffer for screenshots with optional disk persistence

func NewCircularScreenshotBuffer

func NewCircularScreenshotBuffer(maxSize int, tempDir string, sessionID string) (*CircularScreenshotBuffer, error)

NewCircularScreenshotBuffer creates a new circular buffer for screenshots

func (*CircularScreenshotBuffer) Add

func (b *CircularScreenshotBuffer) Add(screenshot *agentdomain.Frame) error

Add adds a new screenshot to the buffer, evicting the oldest when it is full. A screenshot that shows what the latest one shows is not stored again, so a screen that stands still keeps its frame and that frame's id.

func (*CircularScreenshotBuffer) Cleanup

func (b *CircularScreenshotBuffer) Cleanup() error

Cleanup removes the temp directory and all screenshots

func (*CircularScreenshotBuffer) Count

func (b *CircularScreenshotBuffer) Count() int

Count returns the current number of screenshots in the buffer

func (*CircularScreenshotBuffer) GetLatest

func (b *CircularScreenshotBuffer) GetLatest() (*agentdomain.Frame, error)

GetLatest returns the most recent screenshot

func (*CircularScreenshotBuffer) GetRecent

func (b *CircularScreenshotBuffer) GetRecent(limit int) []*agentdomain.Frame

GetRecent returns the N most recent screenshots

type ScreenshotServer

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

ScreenshotServer provides an HTTP API for screenshot streaming. While a person holds the screen it captures faster and right after each input, so the view they drive follows what they do.

func NewScreenshotServer

func NewScreenshotServer(cfg *config.Config, imageService agentdomain.ImageService, sessionID string) *ScreenshotServer

NewScreenshotServer creates a new screenshot server

func (*ScreenshotServer) GetLatestFrame

func (s *ScreenshotServer) GetLatestFrame() (*agentdomain.Frame, error)

GetLatestFrame retrieves the latest screenshot from the buffer, after the frame a person's input owes when one is on its way.

func (*ScreenshotServer) HoldChanged added in v0.253.0

func (s *ScreenshotServer) HoldChanged(held bool)

HoldChanged switches the capture pace as a person takes the screen or hands it back, without waiting out the interval in force.

func (*ScreenshotServer) InputLanded added in v0.253.0

func (s *ScreenshotServer) InputLanded()

InputLanded owes readers a frame captured after the input, and captures it.

func (*ScreenshotServer) Port

func (s *ScreenshotServer) Port() int

Port returns the port the server is listening on

func (*ScreenshotServer) Start

func (s *ScreenshotServer) Start() error

Start starts the HTTP server and background capture loop

func (*ScreenshotServer) Stop

func (s *ScreenshotServer) Stop() error

Stop stops the HTTP server and capture loop. It releases the lock before Shutdown, which waits for in-flight handlers that take the read lock.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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