Documentation
¶
Overview ¶
Package offer is the shape of an MCP server a persistent built-in comes with: an offered server, named in the built-in's own Go value rather than its manifest, so the manifest's contract is unchanged. Each one is an entry of the agent's roster, switched, agreed to and receipted as a server the person added is, on by default only when it needs nothing the person must give it; one that needs a stored secret or a git host account waits, off, until the person sets that up.
Index ¶
- Constants
- func CheckAll(servers []Server, id func(manifest.MCPServer) string) error
- func CheckImageServers(servers []ImageServer) error
- func CheckMailProviders(providers []MailProvider, servers []ImageServer) error
- type GitHost
- type ImageServer
- type ImageSwitch
- type MailProvider
- type Server
- type Suggestion
Constants ¶
const AccountSecretPrefix = "AGENTRY_GIT_ACCOUNT_"
AccountSecretPrefix begins the secret slot an account-bound server is given its account's token in, one a server of each account: a prefix the runner sets alone, which a server the person adds may not declare, so no other server can be given the token.
Variables ¶
This section is empty.
Functions ¶
func CheckAll ¶
CheckAll refuses a built-in's offered servers when one is refused, when two are the same server, or when two are given the same account secret.
func CheckImageServers ¶
func CheckImageServers(servers []ImageServer) error
CheckImageServers refuses a built-in's image servers when one is refused, or when two share a key.
func CheckMailProviders ¶
func CheckMailProviders(providers []MailProvider, servers []ImageServer) error
CheckMailProviders refuses a built-in's mail providers when one has no key of the right shape or no name, when two share a key, or when an image server it names is not one of servers or is two providers'.
Types ¶
type GitHost ¶
GitHost is one of the agent's git host accounts as a built-in draws an offer for it: its host (host[:port], lower case) and its kind ("github", "gitlab", "gitea" or "git").
type ImageServer ¶
type ImageServer struct {
// Key names it: its roster entry is server:<Key>, its volume ends
// -<Key>.
Key string
// Name is how the roster names it ("Google Workspace (gog)").
Name string
// Image is the pinned image (repository@sha256:…), the policy's.
Image string
// Command is what the image's own entrypoint is given, before the
// switches' arguments.
Command []string
// Env is its plain configuration.
Env map[string]string
// Egress are the hosts it reaches, each host or host:port, and no other.
Egress []string
// Secrets are the secret slots it is given, filled by the runner from
// the keychain (Slots), never the person's stored secrets.
Secrets []string
// VolumeTarget is where its volume is mounted.
VolumeTarget string
// Switches widen it, each an entry of the roster off by default and
// agreed to on its own.
Switches []ImageSwitch
// Note is what its consent sentence adds after what it reaches.
Note string
// SignIn is what to do before it can be given: until the person has
// signed it in, it waits.
SignIn string
// AccountEnv is the variable the server is told the signed-in account
// in; empty for none.
AccountEnv string
// Profiles, when set, are the arguments the server is given after its
// command for each combination of switches on, keyed by the switches'
// keys in their order joined with "+" ("" for none on), in place of
// each switch adding its own: for a server whose wider grant is a
// different argument rather than one more. Every combination the
// switches' requirements allow has one.
Profiles map[string][]string
// ClientEnv and TenantEnv are the variables the server is told the
// person's own OAuth client and its sign-in's tenant in, as the sign-in
// recorded them; empty for none.
ClientEnv, TenantEnv string
// SignoffArg is the argument the server is given the person's signoff
// for sent mail with, when they set one; empty for a server with none.
SignoffArg string
}
ImageServer is a server a built-in offers that is no npm or PyPI package and no remote address: a program in an image the CLI pins, started with a fixed command. It is a built-in's alone, never a QuickAgent's, since the registry's review of a release does not reach an image. It keeps its own state on a volume of the agent's that reaches this server alone, and it waits, off, until the person has signed it in.
func (ImageServer) Args ¶
func (s ImageServer) Args(on func(key string) bool) []string
Args is the server's command with the arguments of the switches on (by key) added, in the switches' order, or, for a server with Profiles, with the arguments of that combination; a switch whose requirement is off is left out.
func (ImageServer) Check ¶
func (s ImageServer) Check() error
Check refuses an image server a built-in may not offer: one with no key, name or sign-in, an image not pinned by digest, no command, a host it reaches that is not a host name, a volume target that is not an absolute path, a switch that is not one or that requires one the server lacks.
type ImageSwitch ¶
type ImageSwitch struct {
// Key names it: its roster entry is server:<server key>:<Key>.
Key string
// Name is how the roster names it ("Allow changes").
Name string
// Line is its consent sentence.
Line string
// Args are added to the server's command, in the switches' order.
Args []string
// Requires is the key of another switch of the server this one is
// given with alone; empty for none.
Requires string
// SignedFor says the switch is given only when the server's sign-in
// asked for what it needs (a scope a read-only sign-in leaves out).
SignedFor bool
}
ImageSwitch is one widening of an image server: arguments added to its command while the switch is on, with the server.
type MailProvider ¶
type MailProvider struct {
// Key names it in the agent's configuration (google, microsoft,
// fastmail).
Key string
// Name is how it is shown ("Google").
Name string
// ImageServers are the keys of the built-in's image servers that are
// this provider's.
ImageServers []string
}
MailProvider is one service whose mail and calendar a built-in reaches through servers it offers: image servers it names, or offered servers that name it (Server.MailProvider). The person enables the providers they use: a disabled provider's servers are not on the agent's roster and go to no segment, and what it was set up with (its sign-in, its volume, its token) is kept, so enabling it again needs no new set-up.
type Server ¶
type Server struct {
// Name is how the roster names it ("Weather (Open-Meteo)").
Name string
// Server is the server, as a manifest declares one: an npm or PyPI
// package at an exact version, or a remote address.
Server manifest.MCPServer
// Writes, when set, is the same server with its changes allowed (a
// remote's read-write address): a switch of the entry of its own,
// off by default, chooses it.
Writes *manifest.MCPServer
// On is its default: true only when Secret and Account are empty.
On bool
// Secret is the stored secret it needs, one of the secrets Server
// declares: until the person stores it and has it on, the server
// waits for it.
Secret string
// Account is the git host whose account's token the server is given,
// in the one secret it declares, which begins AccountSecretPrefix:
// until the agent has an account there and has it on, the server waits
// for it.
Account string
// SearchKey, with Secret, is a web search provider the runner policy
// may name (webSearch.provider): while the agent stores no secret
// named Secret, the key the person keeps for that provider's web
// search stands in for it, given to this server alone.
SearchKey string
// SecretFlag, with Secret, is the configure flag that keeps it (with
// its own checks), named in place of agentry agent secret set when the
// server waits for it.
SecretFlag string
// Note is what its consent sentence adds after what it reaches: the
// provider's terms, what it is sent.
Note string
// MailProvider is the key of the mail provider it is (MailProvider):
// while that provider is disabled it is not on the roster; empty for
// a server that is no provider's.
MailProvider string
}
Server is one server a built-in offers.
func BraveSearch ¶
func BraveSearch() Server
BraveSearch is web search with Brave, offered to either agent: off until the person stores their own Brave Search API key for it, or keeps one for Brave web search on this computer.
func (Server) Check ¶
Check refuses a server a built-in may not offer (what a QuickAgent may not declare at all, the manifest's validation refuses):
- a package that reaches any host ("*"), or none it names;
- a remote that names hosts beside its own;
- a default of on for one that needs a secret or an account;
- a secret it needs and does not declare;
- an account server that does not declare exactly one secret, beginning AccountSecretPrefix;
- a Writes that is another server.
type Suggestion ¶
type Suggestion struct {
// Key is how the person names it to add it ("weather").
Key string
// Name is how it is listed ("Weather (Open-Meteo)").
Name string
// Server is the server, as a manifest declares one.
Server manifest.MCPServer
// Note is what its sentence adds once added: whose terms apply, what
// it is sent.
Note string
}
Suggestion is a server a built-in suggests rather than offers: not on its roster until the person adds it, in one step, as a server of their own, with its install and agreement as for any server they add. Removing it takes it off the roster; it stays suggested. A suggestion is for a server whose terms or reach suit a person's own choice, not a default: one whose rules may not be shipped, or whose free service asks that a product not send its users there.
func (Suggestion) Check ¶
func (s Suggestion) Check() error
Check refuses a suggestion a built-in may not make: one with no key or name, or that reaches any host or none it names, as an offered server.