Documentation
¶
Overview ¶
Package settingsmcp is the tools of magpie's settings MCP server (gateway.SettingsMCPPath, `magpie mcp settings`): how magpie is set up, read with no key, token or sign-in in it, and the changes the Agents page's model pickers and Settings › Models make, through the same saves (agent.Pick, settingsapi.Apply), as `magpie <agent> <model>` and `magpie settings set` make them.
What it never does: read or write a key, token, cookie or proxy password; add, remove, sign in or out of a provider or account; move a subscription; change a gateway key or a routing group; connect an agent to magpie or take it out. Those stay in the window and the CLI, where the user sees what they do.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Hidden = []string{"proxy", "pluginProxy", "updateProxy", "otel", "redactWords"}
Hidden are the settings whose values are never read here: a proxy's address may carry its password, OpenTelemetry's headers a token, and the words to mask are the user's secrets by design.
var Writable = map[string]string{
"replyModel": "how a reply names the model that wrote it",
"retryAfterCap": "the most seconds a Retry-After passed on to an agent says, unset to pass it as it is",
"vision": "the model that describes an image to a model that can't see: a model id, \"off\", or empty for magpie's pick",
"visionEffort": "how hard the image recognition model thinks, empty for the least it has",
"imageGen": "the model an image request that names none is drawn with: a model id, \"off\", or empty for magpie's pick",
"videoGen": "the model a video request that names none is made with, empty for magpie's pick",
"imageTimeout": "minutes a vendor is given to draw an image, 0 for the default",
"imageResolution": "the resolution an image is drawn at when the request names no size, empty for the model's own",
"classifyTimeout": "seconds a routing group's classifier is given, 0 for the default",
"groupSink": "whether a routing group sends a request on past a member that is busy, for groups that say nothing of their own",
"groupFirstToken": "seconds a group member may take to its first token, 0 to wait, for groups that say nothing of their own",
"groupPatience": "seconds a request is kept while every member of a group is busy, 0 for the default, -1 for off",
"searcher": "the provider or model a model that can't search the web is searched for with, \"off\" for search APIs only, empty for magpie's pick",
"searcherThen": "the searchers tried next, in order, when the first fails",
"searcherEffort": "how hard the searcher's model thinks, empty for none",
"searchFirst": "what is searched with first when both a provider and a search API can",
}
Writable are the settings set_setting changes, each with what it is: Settings › Models' choices, which the gateway reads on each request and which need nothing of the window's (its Dock, fonts, tray menu, alerts and update checks follow the others). Every other setting of settingsapi.Keys is read only here.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
ID string `json:"id"`
Name string `json:"name"`
Wired bool `json:"connected"`
// Fields are the agent's model and effort fields, with what each is
// set to ("" is the agent's default) and whether set_agent_model
// changes it
Fields []AgentField `json:"fields,omitempty"`
}
Agent is an agent found on this computer.
type AgentField ¶
type Config ¶
type Config struct {
Agents []Agent `json:"agents"`
Providers []Provider `json:"providers"`
Groups []Group `json:"groups"`
// Unread is why the providers couldn't be read, when they couldn't
Unread string `json:"unread,omitempty"`
}
Config is get_config's answer.
type Group ¶
type Group struct {
ID string `json:"id"`
Name string `json:"name"`
Note string `json:"note,omitempty"`
Members []string `json:"members"`
Routing string `json:"routing,omitempty"`
Affinity string `json:"affinity,omitempty"`
Rules int `json:"rules,omitempty"`
}
Group is a routing group.
type Model ¶
type Model struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Efforts []string `json:"efforts,omitempty"`
Context int `json:"context,omitempty"`
Images bool `json:"images,omitempty"`
Group bool `json:"group,omitempty"`
}
Model is one model list_models gives.
type Models ¶
type Models struct {
Models []Model `json:"models"`
// More is how many more matched than were given
More int `json:"more,omitempty"`
}
Models is list_models' answer.
type Provider ¶
type Provider struct {
ID string `json:"id"`
Name string `json:"name"`
Kind string `json:"kind"` // subscription, preset or custom
Host string `json:"host,omitempty"`
Off bool `json:"off,omitempty"`
Accounts int `json:"accounts"`
Models int `json:"models"`
Fallback []string `json:"fallback,omitempty"`
Routing string `json:"routing,omitempty"`
Problem string `json:"problem,omitempty"`
}
Provider is a provider or subscription, with no key, token, header or account name of it.
type Setting ¶
type Setting struct {
Key string `json:"key"`
Type string `json:"type"`
Value any `json:"value"`
Default any `json:"default,omitempty"`
Choices []string `json:"choices,omitempty"`
Writable bool `json:"writable"`
What string `json:"what,omitempty"`
}
Setting is one setting list_settings gives.