hostedagentrefs

package
v0.26.0-alpha1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 6 Imported by: 0

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

View Source
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

func IsReference(value string) bool

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

func ResolveMCP(ctx context.Context, client kclient.Client, namespace, ref string) (string, error)

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.

func Split

func Split(ref string) (source, key string, ok bool)

Split divides a reference into its source and key.

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.

func New

func New(client kclient.Client, namespace string) *Resolver

func (*Resolver) MCPServers

func (r *Resolver) MCPServers(ctx context.Context, refs []string) (resolved []string, unresolved []string)

MCPServers resolves each reference, returning the resolved IDs and the references that named nothing installed here.

func (*Resolver) Skills

func (r *Resolver) Skills(ctx context.Context, refs []string) (resolved []string, unresolved []string)

Skills resolves each reference the same way.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL