Documentation
¶
Index ¶
- func BindingForBuiltin(agent BuiltinAgent) model.AgentRuntimeBinding
- func BindingForCustom(agent model.CustomAgent, revisionID string) (model.AgentRuntimeBinding, error)
- func DefinitionEqual(a, b model.AgentRuntimeDefinition) bool
- func DefinitionReservationKey(definition model.AgentRuntimeDefinition) string
- func LegacyBindingForBuiltin(agent BuiltinAgent, identifier string) (model.AgentRuntimeBinding, error)
- func LegacyDefinition(command string) (model.AgentRuntimeDefinition, error)
- func RevisionForDefinition(definition model.AgentRuntimeDefinition) string
- func RuntimeKey(agentID, revision string) string
- func ValidateBuiltins() error
- type AgentCatalogRepository
- type BuiltinAgent
- type CustomMutation
- type Entry
- type HistoricalIdentifier
- type IdentifierKind
- type ResolvedAgent
- type Service
- func (s *Service) BuiltinRevisions(ctx context.Context, agentID string) ([]model.AgentRuntimeRevision, error)
- func (s *Service) Builtins() []BuiltinAgent
- func (s *Service) Custom(ctx context.Context) ([]model.CustomAgent, error)
- func (s *Service) DeletedItems(ctx context.Context) ([]model.AgentCatalogItem, error)
- func (s *Service) Find(ctx context.Context, agentID string) (Entry, bool, error)
- func (s *Service) List(ctx context.Context) ([]Entry, error)
- func (s *Service) ListItems(ctx context.Context) ([]model.AgentCatalogItem, error)
- func (s *Service) MutateCustom(ctx context.Context, mutate CustomMutation) ([]model.CustomAgent, error)
- func (s *Service) PruneUnreferencedBuiltinRevisions(ctx context.Context, referenced map[string]map[string]bool) ([]model.AgentRuntimeBinding, error)
- func (s *Service) PruneUnreferencedCustomRevisions(ctx context.Context, referenced map[string]map[string]bool) ([]model.AgentRuntimeBinding, error)
- func (s *Service) Resolve(ctx context.Context, identifier string) (ResolvedAgent, bool, error)
- func (s *Service) ResolveBinding(ctx context.Context, identifier, revision string) (model.AgentRuntimeBinding, bool, error)
- func (s *Service) ResolveDisplayInfos(ctx context.Context, ids []string) (map[string]model.AgentDisplayInfo, error)
- func (s *Service) ResolveLegacyBinding(ctx context.Context, identifier string) (model.AgentRuntimeBinding, bool, error)
- func (s *Service) SaveCustom(ctx context.Context, agents []model.CustomAgent) error
- func (s *Service) Validate(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindingForBuiltin ¶
func BindingForBuiltin(agent BuiltinAgent) model.AgentRuntimeBinding
func BindingForCustom ¶
func BindingForCustom(agent model.CustomAgent, revisionID string) (model.AgentRuntimeBinding, error)
func DefinitionEqual ¶
func DefinitionEqual(a, b model.AgentRuntimeDefinition) bool
func DefinitionReservationKey ¶
func DefinitionReservationKey(definition model.AgentRuntimeDefinition) string
func LegacyBindingForBuiltin ¶
func LegacyBindingForBuiltin(agent BuiltinAgent, identifier string) (model.AgentRuntimeBinding, error)
func LegacyDefinition ¶
func LegacyDefinition(command string) (model.AgentRuntimeDefinition, error)
LegacyDefinition is only used while migrating command-string sessions. New records always persist a structured definition and never pass through this parser.
func RevisionForDefinition ¶
func RevisionForDefinition(definition model.AgentRuntimeDefinition) string
func RuntimeKey ¶
func ValidateBuiltins ¶
func ValidateBuiltins() error
Types ¶
type AgentCatalogRepository ¶
type AgentCatalogRepository interface {
Load(ctx context.Context) (*model.AgentCatalogSnapshot, error)
Save(ctx context.Context, snapshot *model.AgentCatalogSnapshot) error
}
type BuiltinAgent ¶
type BuiltinAgent struct {
AgentID string
Bin string
ACPProgram string
ACPArgs []string
Command string
EnvKey string
CLIExecutableEnv string
HistoricalIdentifiers []HistoricalIdentifier
DisplayName string
IconURL string
SupportsHeadlessPrint bool
Deprecated bool
Install agentinstall.InstallSpec
}
BuiltinAgent is one built-in catalog entry. ACPProgram and ACPArgs are authoritative; Command remains the current legacy serialization consumed by runtime paths that have not moved to structured argv yet.
func BuiltinSnapshot ¶
func BuiltinSnapshot() []BuiltinAgent
func FindBuiltinByID ¶
func FindBuiltinByID(agentID string) (BuiltinAgent, bool)
func ResolveBuiltin ¶
func ResolveBuiltin(identifier string) (BuiltinAgent, bool)
func (BuiltinAgent) MigrationIdentifiers ¶
func (a BuiltinAgent) MigrationIdentifiers() []string
MigrationIdentifiers returns identifiers in deterministic migration priority: AgentID, current Bin, stable env key, current ACP command, then the explicitly ordered historical identifiers.
func (BuiltinAgent) RuntimeDefinition ¶
func (a BuiltinAgent) RuntimeDefinition() model.AgentRuntimeDefinition
type CustomMutation ¶
type CustomMutation func(current []model.CustomAgent) ([]model.CustomAgent, error)
type Entry ¶
type Entry struct {
Source model.AgentCatalogSource
Builtin *BuiltinAgent
Custom *model.CustomAgent
}
type HistoricalIdentifier ¶
type HistoricalIdentifier struct {
Kind IdentifierKind
Value string
}
type IdentifierKind ¶
type IdentifierKind string
const ( IdentifierKindBin IdentifierKind = "bin" IdentifierKindEnvKey IdentifierKind = "env_key" IdentifierKindACPCommand IdentifierKind = "acp_command" )
type ResolvedAgent ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) BuiltinRevisions ¶
func (*Service) Builtins ¶
func (s *Service) Builtins() []BuiltinAgent
Builtins returns the supported built-in entries in selector order.
func (*Service) DeletedItems ¶
func (*Service) MutateCustom ¶
func (s *Service) MutateCustom(ctx context.Context, mutate CustomMutation) ([]model.CustomAgent, error)
MutateCustom serializes the full load-validate-save transaction. Management handlers use this instead of a separate Custom + SaveCustom sequence so two concurrent operations cannot overwrite each other's catalog changes.
func (*Service) PruneUnreferencedBuiltinRevisions ¶
func (*Service) PruneUnreferencedCustomRevisions ¶
func (*Service) Resolve ¶
Resolve accepts a stable AgentID or a built-in migration identifier and returns the current runtime projection. New settings persist ResolvedAgent's AgentID; Command and Bin are resolved only at execution time.
func (*Service) ResolveBinding ¶
func (*Service) ResolveDisplayInfos ¶
func (s *Service) ResolveDisplayInfos(ctx context.Context, ids []string) (map[string]model.AgentDisplayInfo, error)
ResolveDisplayInfos resolves display info for historical Agent references (session serve commands, graph node snapshot agent types) against the retained catalog records. Each identifier resolves in this order:
- exact built-in AgentID hit → Deleted=false
- exact custom AgentID hit (any lifecycle) → Deleted = (lifecycle == deleted)
- built-in migration identifier (stable bin, env key, legacy serve command, explicitly ordered historical identifiers) → Deleted=false
- no match → absent from the result
The result is keyed by the input identifier as given, so callers look up whatever reference string they already hold; identical identifiers in the input resolve once. The custom catalog is loaded once regardless of how many ids are passed.
func (*Service) ResolveLegacyBinding ¶
func (*Service) SaveCustom ¶
SaveCustom atomically replaces the custom portion after validating the whole directory against built-in IDs and definitions. Management flows should perform their operation-specific validation first, then commit one complete snapshot through this method.