Documentation
¶
Overview ¶
Package actionregistry provides the canonical GitLab action catalog used by higher-level MCP tool surfaces.
Index ¶
- func DomainFromToolName(toolName string) string
- func ToActionMaps(catalog *Catalog) map[string]toolutil.ActionMap
- type Action
- type ActionID
- type Catalog
- func (c *Catalog) Action(id ActionID) (Action, bool)
- func (c *Catalog) ActionMaps() map[string]toolutil.ActionMap
- func (c *Catalog) Actions() []Action
- func (c *Catalog) AddAction(toolName string, action Action, groupOptions ...GroupOptions) error
- func (c *Catalog) AddGroup(group Group) error
- func (c *Catalog) Clone() *Catalog
- func (c *Catalog) CountActions() int
- func (c *Catalog) CountGroups() int
- func (c *Catalog) Filter(opts FilterOptions) *Catalog
- func (c *Catalog) FilterAllowedToolNames(toolNames []string) *Catalog
- func (c *Catalog) FilterExcludedTools(excludeTools []string) *Catalog
- func (c *Catalog) FilterReadOnlyGroups() *Catalog
- func (c *Catalog) Group(toolName string) (Group, bool)
- func (c *Catalog) Groups() []Group
- func (c *Catalog) Validate() error
- type FilterOptions
- type Group
- type GroupOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DomainFromToolName ¶
DomainFromToolName returns the canonical dynamic domain for a meta-tool name.
Types ¶
type Action ¶
type Action struct {
ID ActionID
ToolName string
Domain string
Name string
Route toolutil.ActionRoute
SchemaURI string
Aliases []string
Tags []string
ReadOnly bool
}
Action describes one executable GitLab action in the canonical catalog.
type ActionID ¶
type ActionID string
ActionID is the stable dynamic identifier for one GitLab action.
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog stores deterministic groups and action lookup indexes. A Catalog is intended to be mutated during single-threaded initialization and then shared read-only; concurrent mutation is not supported.
func FromActionMaps ¶
FromActionMaps converts legacy route maps into a canonical catalog.
func FromActionMapsWithError ¶
FromActionMapsWithError converts legacy route maps into a canonical catalog and reports invalid groups instead of panicking.
func (*Catalog) ActionMaps ¶
ActionMaps returns a defensive legacy route snapshot keyed by tool and action.
func (*Catalog) AddAction ¶
func (c *Catalog) AddAction(toolName string, action Action, groupOptions ...GroupOptions) error
AddAction adds one action to an existing or newly-created group. When the group does not exist, callers may provide GroupOptions so the synthesized group carries the same metadata as a normal catalog group.
func (*Catalog) CountActions ¶
CountActions returns the number of actions in the catalog.
func (*Catalog) CountGroups ¶
CountGroups returns the number of groups in the catalog.
func (*Catalog) Filter ¶
func (c *Catalog) Filter(opts FilterOptions) *Catalog
Filter applies all catalog-level filters in a deterministic order.
func (*Catalog) FilterAllowedToolNames ¶
FilterAllowedToolNames returns a cloned catalog with only explicitly allowed tools.
func (*Catalog) FilterExcludedTools ¶
FilterExcludedTools returns a cloned catalog without excluded tool groups.
func (*Catalog) FilterReadOnlyGroups ¶
FilterReadOnlyGroups returns a cloned catalog containing only read-only groups.
type FilterOptions ¶
FilterOptions describes catalog-level filtering inputs.
type Group ¶
type Group struct {
ToolName string
Description string
Icons []mcp.Icon
ReadOnly bool
FormatResult toolutil.FormatResultFunc
Actions map[string]Action
ActionOrder []string
}
Group describes all actions exposed through one logical meta-tool group.
func NewGroup ¶
func NewGroup(opts GroupOptions) Group
NewGroup creates an action group with initialized maps.
func (*Group) ActionsInOrder ¶
ActionsInOrder returns group actions in deterministic action-name order.
type GroupOptions ¶
type GroupOptions struct {
ToolName string
Description string
Icons []mcp.Icon
ReadOnly bool
FormatResult toolutil.FormatResultFunc
}
GroupOptions contains metadata for creating a catalog group.