template

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	Name            string   `yaml:"name"`
	Description     string   `yaml:"description"`
	Prompt          string   `yaml:"prompt"`
	Tools           []string `yaml:"tools"`
	DisallowedTools []string `yaml:"disallowed_tools"`
	Model           string   `yaml:"model"`
	PermissionMode  string   `yaml:"permission_mode"`
	Skills          []string `yaml:"skills"`
	Memory          string   `yaml:"memory"`
}

AgentConfig holds the agent-specific configuration for a template.

type Repository

type Repository interface {
	Create(ctx context.Context, t *Template) error
	Get(ctx context.Context, id string) (*Template, error)
	List(ctx context.Context, entityType string, limit, offset int) ([]*Template, int, error)
	Update(ctx context.Context, t *Template) error
	Delete(ctx context.Context, id string) error
	// FindByConfigName searches for a template by entity type and the name stored
	// inside the config (e.g., AgentConfig.Name, SkillConfig.Name).
	FindByConfigName(ctx context.Context, entityType, configName string) (*Template, error)
}

Repository provides data access for Template entities.

type ScriptConfig

type ScriptConfig struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Filename    string `yaml:"filename"`
	Content     string `yaml:"content"`
}

ScriptConfig holds the script-specific configuration for a template.

type Server

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

func NewServer

func NewServer(repo Repository, agentRepo agent.Repository, skillRepo skill.Repository, scriptRepo script.Repository) *Server

func (*Server) CreateFromTemplate

CreateFromTemplate instantiates a new entity in a project from a template. For agent templates, optionally creates dependent skills from their templates.

func (*Server) CreateTemplate

CreateTemplate creates a new template with direct config input.

func (*Server) DeleteTemplate

DeleteTemplate deletes a template by ID.

func (*Server) GetTemplate

GetTemplate retrieves a single template by ID.

func (*Server) ListTemplates

ListTemplates lists templates, optionally filtered by entity type.

func (*Server) SaveAsTemplate

SaveAsTemplate saves an existing entity as a reusable template. For agents, optionally includes referenced skills as dependent templates.

func (*Server) UpdateTemplate

UpdateTemplate updates an existing template.

type SkillConfig

type SkillConfig struct {
	Name                   string   `yaml:"name"`
	Description            string   `yaml:"description"`
	Content                string   `yaml:"content"`
	DisableModelInvocation bool     `yaml:"disable_model_invocation"`
	UserInvocable          bool     `yaml:"user_invocable"`
	AllowedTools           []string `yaml:"allowed_tools"`
	Model                  string   `yaml:"model"`
	Context                string   `yaml:"context"`
	Agent                  string   `yaml:"agent"`
	ArgumentHint           string   `yaml:"argument_hint"`
}

SkillConfig holds the skill-specific configuration for a template.

type Template

type Template struct {
	ID           string        `yaml:"id"`
	Name         string        `yaml:"name"`
	Description  string        `yaml:"description"`
	EntityType   string        `yaml:"entity_type"` // "agent", "skill", "script"
	AgentConfig  *AgentConfig  `yaml:"agent_config,omitempty"`
	SkillConfig  *SkillConfig  `yaml:"skill_config,omitempty"`
	ScriptConfig *ScriptConfig `yaml:"script_config,omitempty"`
	CreatedAt    time.Time     `yaml:"created_at"`
	UpdatedAt    time.Time     `yaml:"updated_at"`
}

Template represents a reusable snapshot of an Agent, Skill, or Script configuration. Templates are global (not project-scoped) and can be used across any project.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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