relay

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 14 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

Overview

Package relay forwards one stdio MCP session to a running daemon.

It is a package of its own and not a file in internal/mcp, which is where ADR 0084 expected it: internal/daemon imports internal/mcp, so a relay that needs an Endpoint and a bearer header cannot live there without a cycle.

Index

Constants

This section is empty.

Variables

View Source
var ErrDaemonUnreachable = errors.New("relay: no daemon answered the published endpoint")

ErrDaemonUnreachable reports that no daemon answered where the endpoint file said one would. It is the caller's signal to serve in process instead, and it is deliberately distinct from every other failure here: a relay that could not start is a fallback, and a relay that started and refused is not.

View Source
var ErrVersionSkew = errors.New("relay: the daemon runs a different kivgraph release")

ErrVersionSkew reports a daemon running a different release from this process.

It is refused rather than repaired. The `.mcpb` bundle carries its own binary but takes `stateDirectory` from the configuration, so two installations share a daemon by construction -- and restarting it would take the graph away from whoever else is using it. This is the one failure this design adds that could not happen before, because before there were never two processes that could disagree.

Functions

func Reachable

func Reachable(ctx context.Context, endpoint daemon.Endpoint) error

Reachable answers whether a daemon is listening where the endpoint file says.

It is exported because only the caller can fall back: by the time Run has read the agent's handshake there is no in-process server left to hand it to. Run probes again for its own sake, so a caller that forgets still fails before touching stdio rather than after.

func Run

func Run(ctx context.Context, endpoint daemon.Endpoint) error

Run serves one MCP session by forwarding it to a running daemon, holding no graph of its own.

Neither the SDK's Server nor its Client appears. A Connection is Read, Write and Close of a jsonrpc.Message, so the relay needs no session state: messages cross opaque, and a tool added to the daemon reaches the agent without this file knowing it exists.

One message is not opaque, and it is the version check ADR 0084 decided on. See skewWatch.

Types

This section is empty.

Jump to

Keyboard shortcuts

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