Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotConnected = errors.New("browser broker not reachable — is the gateway running with existing-Chrome configured?")
ErrNotConnected is returned by a Client call when the socket itself is unreachable (no gateway running, or existing-Chrome never set up) — the caller's job is to fail closed on this, never to fall back to ephemeral.
Functions ¶
func SocketPath ¶
SocketPath is the well-known location of the gateway-owned existing-Chrome broker socket — shared between the gateway (which Serves it) and any process that dials it as a Client, including a autonomous agent's delegated worker running as a standalone `memcode run` job, not just inside the gateway. Its absence (no gateway running) is exactly the fail-closed signal existing-Chrome delegation must respect — see ErrNotConnected.
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func (*Broker) Authenticate ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to a gateway-owned Server over its Unix socket. A delegated worker is a separate OS process from the gateway (see jobs.SpawnWithSpec), so it cannot hold the *Broker* itself — this is how it reaches the SAME broker the gateway owns to get an exclusive existing-Chrome lease.
func NewClient ¶
NewClient does not itself verify the socket is reachable — call Acquire and handle ErrNotConnected; that is the fail-closed path callers must take.
func (*Client) Acquire ¶
Acquire requests exclusive existing-Chrome mutation rights for (agentID, runID). Callers MUST fail closed on error — no ephemeral-browser fallback.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server exposes a Broker over a permission-protected local Unix socket, so a process OTHER than the one holding the *Broker* (a delegated worker, a separate OS process spawned via jobs.SpawnWithSpec) can Acquire/Release/ OwnPage/CanMutate against the SAME broker instance the gateway owns. The broker itself must stay a single, long-lived, in-process object — cloning it per connection would defeat its whole purpose (one lease, one owner, at a time, for the user's ONE real Chrome).
The socket is created with 0600 permissions inside a 0700 directory (see gwconfig.Dir), so only the user who started the gateway can reach it — that ownership check is the "permission-protected" half of the design doc's "gateway-owned broker and permission-protected local socket".