Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveName ¶
ResolveName picks the peer name in this order:
- $INTERCOM_NAME if non-empty.
- The basename of the current working directory.
Returns an error if neither yields a valid peer name.
Types ¶
type Config ¶
type Config struct {
// Name is the peer name. If empty, ResolveName is used.
Name string
// Version is reported to both the MCP client and broker. Required.
Version string
// SocketPath is the broker's Unix socket. Required.
SocketPath string
// BrokerBin is the path to the binary used to auto-spawn the broker.
// If empty, os.Executable() is used.
BrokerBin string
// Stdin/Stdout: where MCP frames flow. Defaults to os.Stdin/os.Stdout.
Stdin io.Reader
Stdout io.Writer
// Logger sinks structured logs. Defaults to slog on stderr.
Logger *slog.Logger
}
Config configures Run.
type InvalidNameError ¶
type InvalidNameError struct {
Name string
Source string // human-readable origin: "INTERCOM_NAME", "cwd basename", ""
}
InvalidNameError describes a peer name that didn't pass validation.
func (*InvalidNameError) Error ¶
func (e *InvalidNameError) Error() string
Click to show internal directories.
Click to hide internal directories.