Documentation
¶
Overview ¶
Package central is the local beekeeper's client of the central instance: beekeeper serve behind muster, called as the person through muster's call_tool. The person signs in once per installation (muster auth login --context); each call takes the endpoint from the muster context and the bearer from muster auth token, and keeps neither.
There is no local copy of what the central instance holds: a call that does not reach it fails with Unreachable, and the caller refuses the verb.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls the central instance's tools.
func (*Client) Call ¶
Call calls the central instance's tool with args and decodes its structured result into v (nil: none wanted). It returns the tool's text. A refusal is *Refused; a call without the instance's answer is *Unreachable, naming the stage that timed out and its deadline. Each call connects afresh: a stalled connection of an earlier call is never reused.
func (*Client) Listen ¶ added in v0.150.0
func (c *Client) Listen(ctx context.Context, uris []string, ready func(), updated func(uri string)) error
Listen subscribes to uris through muster's subscriptions/listen (MCP 2026-07-28) as the person and blocks until ctx ends (nil) or the stream does (*Unreachable, or *Refused when the subscription is refused). ready is called each time the subscription is acknowledged, updated with the URI of each notifications/resources/updated. Establishment through the first acknowledgment is bound by the call timeout; the acknowledged stream lasts until ctx ends or the stream does.
type Refused ¶
type Refused struct {
Message string
// Usage marks a call the central instance found malformed: a name it
// does not know, an argument missing.
Usage bool
}
Refused is the central instance's refusal: a lease held, a name it does not know, an action that is another person's.
type Unreachable ¶
type Unreachable struct {
Context string
Reason string
// Sent marks a tool call that went out unanswered: the central
// instance may have acted on it.
Sent bool
// Missing is the tool the instance answered that it does not serve: it
// was reached, and nothing ran.
Missing string
}
Unreachable is a call that could not obtain the central instance's answer: muster's context or sign-in, the network, muster, or beekeeper serve behind it.
func (*Unreachable) Error ¶
func (e *Unreachable) Error() string
Directories
¶
| Path | Synopsis |
|---|---|
|
Package centraltest gives a test a muster in front of a beekeeper serve: its call_tool forwards x_<server>_<tool> to the backend with the caller's bearer and wraps the result as muster does, its subscriptions/listen streams take the updates the test relays, and a muster binary that names its endpoint and prints a token.
|
Package centraltest gives a test a muster in front of a beekeeper serve: its call_tool forwards x_<server>_<tool> to the backend with the caller's bearer and wraps the result as muster does, its subscriptions/listen streams take the updates the test relays, and a muster binary that names its endpoint and prints a token. |