definitions

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefinitionTypeAgent        = "agent"
	DefinitionTypeSkill        = "skill"
	DefinitionTypeTrigger      = "trigger"
	DefinitionTypeTaskTemplate = "task_template"
	DefinitionTypeMCPEndpoint  = "mcp_endpoint"
	DefinitionScopeGlobal      = "global"
	DefinitionScopeTeam        = "team"
	DefinitionScopeRepo        = "repo"
)

Variables

This section is empty.

Functions

func AgentIdentityName

func AgentIdentityName(content string) (string, error)

AgentIdentityName returns the managed Git identity reference declared by an agent definition. Validation is kept here so every definition consumer applies the same policy.

func AgentMcpEndpoints

func AgentMcpEndpoints(content string) ([]string, error)

AgentMcpEndpoints returns the MCP endpoint names declared by an agent definition's frontmatter. Returns nil if the agent declares no endpoints.

func ValidateAgentDefinition

func ValidateAgentDefinition(content string) error

func ValidateDefinitionContent

func ValidateDefinitionContent(definitionType, path, content string) error

Types

type AgentMetadata

type AgentMetadata struct {
	Description  string
	Provider     string
	Model        string
	Mode         string
	Identity     string
	McpEndpoints []string
}

AgentMetadata contains the user-facing fields from an agent definition.

func ParseAgentMetadata

func ParseAgentMetadata(content string) (AgentMetadata, error)

ParseAgentMetadata validates an agent definition and returns its frontmatter.

type Definition

type Definition struct {
	Type        string
	Name        string
	Scope       string
	TeamName    string
	Repo        string
	Path        string
	Content     string
	ContentHash string
}

type MCPEndpointAuth

type MCPEndpointAuth struct {
	Type     string `json:"type"`
	TokenEnv string `json:"token_env"`
}

type MCPEndpointDef

type MCPEndpointDef struct {
	Name      string            `json:"name"`
	Transport string            `json:"transport"`
	URL       string            `json:"url"`
	Headers   map[string]string `json:"headers,omitempty"`
	Auth      *MCPEndpointAuth  `json:"auth,omitempty"`
}

func ParseMCPEndpointYAML

func ParseMCPEndpointYAML(content string) (MCPEndpointDef, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func New

func New(repoURL, branch, cacheDir string) *Manager

func (*Manager) Branch

func (m *Manager) Branch() string

func (*Manager) CacheDir

func (m *Manager) CacheDir() string

func (*Manager) Catalog

func (m *Manager) Catalog() *modelcatalog.Catalog

func (*Manager) CatalogYAML

func (m *Manager) CatalogYAML() string

func (*Manager) HeadCommit

func (m *Manager) HeadCommit(ctx context.Context) (string, error)

func (*Manager) LoadModelCatalog

func (m *Manager) LoadModelCatalog() (*modelcatalog.Catalog, error)

func (*Manager) LoadModelCatalogYAML

func (m *Manager) LoadModelCatalogYAML() (*modelcatalog.Catalog, string, error)

func (*Manager) RepoURL

func (m *Manager) RepoURL() string

func (*Manager) ScanDefinitions

func (m *Manager) ScanDefinitions() ([]Definition, error)

func (*Manager) Sync

func (m *Manager) Sync(ctx context.Context) error

func (*Manager) SyncAndLoad

func (m *Manager) SyncAndLoad(ctx context.Context) error

type TriggerDef

type TriggerDef struct {
	Name        string
	Enabled     bool
	CronExpr    string
	TriggerType string
	TriggerCfg  string // JSON string for trigger_config column
	Prompt      string
	GitURL      string
	GitRef      string
	AgentImage  string
	Agent       string
	ProviderID  string
	ModelID     string
	VariantID   string
	Harness     string
	Skills      []string
	TimeoutSec  int
}

func ParseTriggerYAML

func ParseTriggerYAML(content string) (TriggerDef, error)

Jump to

Keyboard shortcuts

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