browser

package
v0.7.39-dev.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package browser holds what the runner knows of the browser server, the gateway-launched container a release that declares capabilities.browser gets: Microsoft's @playwright/mcp on the agentry-browser image, driving a headless Chromium whose only route out is the run's browse proxy. The server is the vendor's; this package is its name, its tool allowlist, where its files are mounted and the arguments it starts with, so the compiler, the engine and the docker filter agree on them.

Index

Constants

View Source
const (
	// OutMount is the server's output folder and its working directory
	// (the image's WORKDIR): --output-dir, where a file the
	// server names itself lands, and the root it resolves a model-chosen
	// filename against. It is bound to the run's browser output folder,
	// read-write, and nothing else of the host's is.
	OutMount = "/out-browser"
	// ConfigMount is the server's --config file, read-only.
	ConfigMount = "/etc/agentry-run/browser.json"
	// SecretsMount is the --secrets dotenv file, read-only, for a line
	// that declares browser secrets.
	SecretsMount = "/run/agentry-run/browser-secrets.env"
	// Home is the server's home, a tmpfs the docker filter gives it
	// (the root file system is read-only).
	Home = "/home/browser"
	// ImageUser is the image's own user, which the server keeps where the
	// person's machine has no uid to give it (Windows).
	ImageUser = "10001:10001"
)

Where the server's files are, in its container.

View Source
const ProxyPort = 3128

ProxyPort is the browse proxy's port; the server's one allowHosts entry is the proxy's run-unique name on it.

View Source
const ServerName = "browser"

ServerName is the browser server's name in the gateway's catalog. A declared MCP server may not take it.

View Source
const ToolEvaluate = "browser_evaluate"

ToolEvaluate runs script in the page. It passes, except for a release whose browser may type secrets: with it the agent could read a typed value back transformed, past the server's exact-match redaction.

View Source
const Viewport = "1280x720"

Viewport is the page size the server opens at; browser_resize changes it (a phone's width, say).

Variables

This section is empty.

Functions

func Args

func Args(proxy string, secrets bool) []string

Args are the server's arguments after the image's entrypoint (node and the server's cli.js): headless, an isolated profile, Chromium, the testing and pdf capabilities, the browse proxy as its only route, its output folder, its config, and its secrets where the line declares any. proxy is the proxy's host name, a placeholder in a plan.

func Config

func Config() []byte

Config is the server's --config file: Chromium's own sandbox on (the server's default passes --no-sandbox), which the docker filter's seccomp profile lets run under runc.

func Tools

func Tools(secrets bool) []string

Tools is the allowlist for a browser, sorted: every core, testing and pdf tool, without browser_evaluate when the line declares secrets.

Types

type Site

type Site struct {
	// URL is the answer, as the agent reads it in intake.json.
	URL string
	// Host is its host, lower case, and Port its port where the answer
	// gave one ("" for the scheme's own).
	Host, Port string
}

Site is a site the person named for a run's browser (a url question in capabilities.browser.sites): where the browser starts, and the host and port the browse proxy admits for it.

func ParseSite

func ParseSite(answer string) (Site, error)

ParseSite reads a site answer: an http or https URL with a host, no user information, no fragment, at most 2,048 bytes. http is allowed because a site under test may be a staging server without TLS.

func (Site) ProxyEntry

func (s Site) ProxyEntry() string

ProxyEntry is the site as the browse proxy's --browse-sites takes it: host, or host:port where the answer named a port of its own.

Jump to

Keyboard shortcuts

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