Documentation
¶
Overview ¶
Package client connects agents to a sailwright-gateway on the same machine or through a mounted agent directory in a devcontainer. Explicit endpoint and token settings take precedence over discovery; mounted container credentials take precedence over the current user's local gateway.
Index ¶
Constants ¶
const ( EnvURL = "SAILWRIGHT_GATEWAY_URL" EnvToken = "SAILWRIGHT_GATEWAY_TOKEN" EnvDir = "SAILWRIGHT_GATEWAY_DIR" DefaultDir = "/run/sailwright-gateway" DefaultTCPURL = "http://host.docker.internal:7391/mcp" LocalTCPURL = "http://127.0.0.1:7391/mcp" UserDirName = ".sailwright-gateway" )
Environment variables and defaults used for discovery.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect(ctx context.Context, endpoint Endpoint, impl *mcp.Implementation) (*mcp.ClientSession, error)
Connect opens an MCP client session to the gateway.
Types ¶
type Bridge ¶
Bridge serves the gateway's tools over another MCP transport (usually stdio), so any agent harness that can start a command can use the gateway. Tool calls are forwarded unchanged; the gateway enforces its policy as usual.
type Endpoint ¶
type Endpoint struct {
// URL is the HTTP endpoint; for socket endpoints it is a placeholder host.
URL string
// Socket is the Unix socket path, if the gateway is reached over a socket.
Socket string
Token string
// Source explains how the endpoint was found.
Source string
}
Endpoint is a resolved gateway address plus token.
func Discover ¶
Discover resolves the gateway from explicit settings, the container mount, or the current user's agent directory. Credentials always belong to the selected directory, so discovering a local gateway cannot replace a mounted host token.
func (Endpoint) HTTPClient ¶
HTTPClient returns an HTTP client that reaches the endpoint and sends the token.