Documentation
¶
Overview ¶
Package hostedagentrefs resolves the portable references a hosted agent template uses to name MCP servers and skills.
A template is written once and synced into many installations, so it cannot name things by the IDs those installations generate. It names them by something stable instead -- the source they came from, and their key within it -- and this resolves that to whatever the local ID happens to be.
References are resolved where they are used, not rewritten into the stored template at sync time. A template naming a server that is not installed therefore syncs, appears, and is reported unavailable with the reason; installing the server later makes it work with no resync and no edit. Sync rewriting would instead fail the whole source over one reference and freeze the answer.
Index ¶
- Constants
- func IsReference(value string) bool
- func ResolveMCP(ctx context.Context, client kclient.Client, namespace, ref string) (string, error)
- func ResolveSkill(ctx context.Context, client kclient.Client, namespace, ref string) (string, error)
- func Split(ref string) (source, key string, ok bool)
- type Resolver
Constants ¶
const Separator = "::"
Separator divides the source from the key within it. It matches what the MCP catalog already reserves and validates entry keys against, so a reference written here is the same string that catalog builds internally.
Variables ¶
This section is empty.
Functions ¶
func IsReference ¶
IsReference reports whether a value is a portable reference rather than an ID. Anything without the separator is passed through untouched, so templates and agents that name IDs directly keep working.
func ResolveMCP ¶
ResolveMCP turns "<source>::<entryKey>" into the local catalog entry ID.
The source is a catalog's URL without its scheme, which is how the MCP catalog itself identifies a source, and the key is the entry key that catalog supplies. An entry key is unique only within its source, so both halves are required.
func ResolveSkill ¶
func ResolveSkill(ctx context.Context, client kclient.Client, namespace, ref string) (string, error)
ResolveSkill turns "<repoURL>::<relativePath>" into the local skill ID.
The path rather than the skill's name: a path is unique within a repository by construction, whereas two skills in different directories may share a name.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves many references, remembering what failed.
Callers want both halves: the IDs that did resolve, so an agent gets what it can have, and the references that did not, so it can be said why the agent is incomplete.