Documentation
¶
Overview ¶
Package manager is the client of giantswarm-repo-manager, the MCP server behind muster that keeps the repository inventory and lands the team-file changes as the person. The repo commands reach it through the person's muster endpoint with the muster token of the keychain; every tool of the manager is one call here, and the tool's answer is printed as it came.
Index ¶
Constants ¶
const ( Server = "giantswarm-repo-manager" ToolPrefix = "x_" + Server + "_" )
Server is the manager's name in muster, and ToolPrefix what muster puts in front of every tool of an external server.
const ( ToolGetInfo = ToolPrefix + "get_info" ToolListRepositories = ToolPrefix + "list_repositories" ToolGetRepository = ToolPrefix + "get_repository" ToolRefreshRepository = ToolPrefix + "refresh_repository" ToolSweepInventory = ToolPrefix + "sweep_inventory" ToolValidateRepository = ToolPrefix + "validate_repository" ToolCreateRepository = ToolPrefix + "create_repository" ToolWatchRepository = ToolPrefix + "watch_repository" ToolAdoptRepository = ToolPrefix + "adopt_repository" ToolUpdateRepository = ToolPrefix + "update_repository" ToolTransferRepository = ToolPrefix + "transfer_repository" ToolSetLifecycle = ToolPrefix + "set_lifecycle" ToolApproveChange = ToolPrefix + "approve_change" ToolAlignRepository = ToolPrefix + "align_repository" // ToolAuthLogin is muster's own: the sign-in to one of its servers, // answering the URL the person opens once. ToolAuthLogin = "core_auth_login" )
The manager's tools, as muster exposes them.
Variables ¶
This section is empty.
Functions ¶
func IsAuthRequired ¶ added in v8.84.0
IsAuthRequired asserts authRequiredError: the endpoint refused the bearer (401 or 403); the person logs in to muster again.
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func IsTool ¶
IsTool asserts toolError: the manager answered with an error or an answer the client does not understand.
func IsUnreachable ¶
IsUnreachable asserts unreachableError: the endpoint did not answer, or not with MCP.
Types ¶
type Caller ¶ added in v8.84.0
type Caller interface {
Call(ctx context.Context, tool string, args map[string]any) (json.RawMessage, error)
}
Caller calls the manager's tools. Client satisfies it; a test fakes it.
type Client ¶
type Client struct {
// Endpoint is the muster MCP endpoint (https://muster.example/mcp).
Endpoint string
// Token is the person's bearer token for the endpoint; empty sends none.
Token string
// HTTPClient overrides the HTTP client; nil means one without a timeout
// of its own, bounded by the context of every call.
HTTPClient *http.Client
// Version is reported as the client's version in the handshake.
Version string
// contains filtered or unexported fields
}
Client calls giantswarm-repo-manager's tools through a muster endpoint over MCP's streamable HTTP transport. One Client is one MCP session: initialized on the first call, kept for the next.
func (*Client) Call ¶ added in v8.84.0
func (c *Client) Call(ctx context.Context, tool string, args map[string]any) (json.RawMessage, error)
Call calls tool with args and returns the result's payload: its structured content when the tool has one, else its first text content as raw bytes (JSON when the text is JSON, the text otherwise). A tool that answers an error is IsTool with the text; an endpoint that refuses the bearer is IsAuthRequired; one that does not answer is IsUnreachable.
type Record ¶
type Record struct {
// Repository is owner/name.
Repository string `json:"repository"`
// Team is the slug of the team file that declares it; empty when no file
// does.
Team string `json:"team,omitempty"`
// Setup is the engine's check result the inventory stores.
Setup *reconcile.Result `json:"setup,omitempty"`
// UpdatedAt is when the record was refreshed.
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
Record is one inventory record of giantswarm-repo-manager as `devctl repo status` reads it. The manager's tool schema is filled in by its own change; the client reads the fields below and ignores the rest, and a payload that is the set-up result itself is accepted as one too.