Documentation
¶
Overview ¶
Package mcpserver defines the digest, breaking_changes, outdated, drift and resolve tools and the upgrade_review prompt of `relgap mcp`. The tools never start a process, and they read only the directories inside the server's roots.
Index ¶
Constants ¶
const Name = "relgap"
Name is the server_info name.
Variables ¶
var ErrOutsideRoots = errors.New("outside the server's roots")
ErrOutsideRoots is returned for a directory argument outside the server's roots.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
Digest func(ctx context.Context, a DigestArgs) (*report.ToolDigest, error)
Outdated func(ctx context.Context, root, base string) (*report.Outdated, []render.Error, error)
Drift func(ctx context.Context, a DriftArgs) (*report.Drift, []render.Error, error)
Resolve func(ctx context.Context, name string) (*registry.Resolution, error)
}
Backend runs the pipelines of the CLI commands. Errors make the call fail; the returned render.Error lists say what a partial result misses.
type DigestArgs ¶
type DigestArgs struct {
Tool, From, To string
Line string // empty means the tool's registry line
IncludePrereleases bool
MinConfidence *float64 // nil means the config's policy.min_confidence
Kinds []classify.Kind // empty means every kind
}
DigestArgs says what one digest covers.
type DriftArgs ¶
type DriftArgs struct {
Roots, Tools []string
Latest bool
IgnoreConstraints bool
Base string // name repositories relative to this directory
}
DriftArgs says what a drift report covers. Roots are checked against the server's roots.
type NoExec ¶
type NoExec struct{}
NoExec refuses to start any command, as if none were installed. With it, the registry uses its embedded mise snapshot and the scanner walks directories instead of asking git.
type Options ¶
type Options struct {
Version string // relgap's version, for server_info and envelopes
Logger *slog.Logger
Clock func() time.Time
MaxBytes int // see [mcpkit.Options]
Roots []string // directories tool paths must be in; empty means the client's roots
Cwd string // the root when neither Roots nor the client name one
Backend Backend
}
Options configures New.