Documentation
¶
Index ¶
- func CreateAllSkillTools(repo skill.Repository, executor Executor) []tool.Tool
- func CreateSkillTools(repo skill.Repository, executor Executor) []tool.Tool
- func LoadSkillsFromConfig(ctx context.Context, roots []string, additionalRepos ...skill.Repository) ([]tool.Tool, error)
- func NewListSkillsTool(repo skill.Repository) tool.Tool
- func NewSkillLoadTool(repo skill.Repository) tool.Tool
- func NewSkillRunTool(repo skill.Repository, executor Executor) tool.Tool
- type AddSkillRequest
- type CompositeRepository
- type ExecuteRequest
- type ExecuteResponse
- type Executor
- type ExecutorConfig
- type ISkillWriter
- type ListSkillsRequest
- type ListSkillsResponse
- type ListSkillsTool
- type LocalExecutor
- type MutableRepository
- func (r *MutableRepository) Add(req AddSkillRequest) error
- func (r *MutableRepository) Count() int
- func (r *MutableRepository) Delete(name string) error
- func (r *MutableRepository) Exists(name string) bool
- func (r *MutableRepository) Get(name string) (*skill.Skill, error)
- func (r *MutableRepository) Path(name string) (string, error)
- func (r *MutableRepository) Summaries() []skill.Summary
- func (r *MutableRepository) Update(req AddSkillRequest) error
- type SkillLoadRequest
- type SkillLoadResponse
- type SkillLoadTool
- type SkillRunRequest
- type SkillRunResponse
- type SkillRunTool
- type SkillSummary
- type ToolProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAllSkillTools ¶
func CreateAllSkillTools(repo skill.Repository, executor Executor) []tool.Tool
CreateAllSkillTools creates all skill tools including list, load, and run. This function exists to provide a convenient way to create all skill tools at once. Without this function, callers would need to create each tool separately.
func CreateSkillTools ¶
func CreateSkillTools(repo skill.Repository, executor Executor) []tool.Tool
CreateSkillTools creates both skill_load and skill_run tools. This function exists to provide a convenient way to create both skill tools at once. Without this function, callers would need to create each tool separately.
func LoadSkillsFromConfig ¶
func LoadSkillsFromConfig(ctx context.Context, roots []string, additionalRepos ...skill.Repository) ([]tool.Tool, error)
LoadSkillsFromConfig loads skills from the configuration. This function exists to initialize the skills system based on the Genie configuration. Without this function, we could not load skills from the config file. It supports multiple skills roots including local paths and remote HTTPS URLs. It also accepts additional repositories (like an MCP PromptRepository) to be merged.
func NewListSkillsTool ¶
func NewListSkillsTool(repo skill.Repository) tool.Tool
NewListSkillsTool creates a new ListSkillsTool. This function exists to initialize the list_skills tool with a repository. Without this function, we could not create the list_skills tool.
func NewSkillLoadTool ¶
func NewSkillLoadTool(repo skill.Repository) tool.Tool
NewSkillLoadTool creates a new SkillLoadTool. This function exists to initialize the skill_load tool with a repository. Without this function, we could not create the skill_load tool.
func NewSkillRunTool ¶
func NewSkillRunTool(repo skill.Repository, executor Executor) tool.Tool
NewSkillRunTool creates a new SkillRunTool. This function exists to initialize the skill_run tool with a repository and executor. Without this function, we could not create the skill_run tool.
Types ¶
type AddSkillRequest ¶
type AddSkillRequest struct {
// Name is the skill identifier (lowercase alphanumeric + hyphens/underscores).
Name string
// Description is a one-line summary of the skill.
Description string
// Instructions is the markdown body of the SKILL.md file.
Instructions string
// Scripts maps filename to plain-text content (Python, bash, etc.).
// These are written with executable permissions.
Scripts map[string]string
// Docs maps filename to base64-encoded binary content (PDF, docx, xlsx, pptx, etc.).
// Content is decoded before writing. For plain text docs, use raw text (not base64).
Docs map[string]string
}
AddSkillRequest contains all parameters needed to create a new skill.
type CompositeRepository ¶
type CompositeRepository struct {
// contains filtered or unexported fields
}
CompositeRepository merges multiple skill repositories into a single source. This allows Genie to expose local filesystem scripts alongside remote MCP Prompts.
func NewCompositeRepository ¶
func NewCompositeRepository(repos ...skill.Repository) *CompositeRepository
NewCompositeRepository creates a new repository that cascades across the given repos.
func (*CompositeRepository) Get ¶
func (c *CompositeRepository) Get(name string) (*skill.Skill, error)
Get iterates through the repositories and returns the first matching Skill.
func (*CompositeRepository) Path ¶
func (c *CompositeRepository) Path(name string) (string, error)
Path iterates through the repositories and returns the first successful Path resolution.
func (*CompositeRepository) Summaries ¶
func (c *CompositeRepository) Summaries() []skill.Summary
Summaries returns the merged and sorted list of skill summaries from all underlying repositories.
type ExecuteRequest ¶
type ExecuteRequest struct {
SkillPath string // Absolute path to skill directory
ScriptPath string // Relative path to script within skill
Args []string // Command-line arguments for script
InputFiles map[string]string // Input files (name -> content)
Environment map[string]string // Additional environment variables
Timeout time.Duration // Execution timeout (0 = use default)
}
ExecuteRequest contains parameters for script execution. This struct exists to encapsulate all execution parameters in one place. Without this struct, Execute() would have many individual parameters.
type ExecuteResponse ¶
type ExecuteResponse struct {
Output string // Combined stdout/stderr
Error string // Error message if execution failed
ExitCode int // Script exit code
OutputFiles map[string]string // Output files (name -> content)
}
ExecuteResponse contains the results of script execution. This struct exists to return all execution results in one place. Without this struct, Execute() would need multiple return values.
type Executor ¶
type Executor interface {
Execute(ctx context.Context, req ExecuteRequest) (ExecuteResponse, error)
}
Executor executes skill scripts. This interface exists to abstract script execution and enable testing with fake implementations. Without this interface, we would be tightly coupled to local script execution.
type ExecutorConfig ¶
type ExecutorConfig struct {
// MaxWorkspaceSize is the maximum total size of workspace files in bytes.
// 0 means unlimited. Default: 100MB
MaxWorkspaceSize int64
// MaxOutputFileSize is the maximum size of a single output file in bytes.
// 0 means unlimited. Default: 10MB
MaxOutputFileSize int64
// DefaultTimeout is the default execution timeout if not specified in request.
// 0 means no default timeout. Default: 5 minutes
DefaultTimeout time.Duration
}
ExecutorConfig contains configuration for the executor. This struct exists to provide configurable resource limits. Without this struct, we couldn't control resource usage.
func DefaultExecutorConfig ¶
func DefaultExecutorConfig() ExecutorConfig
DefaultExecutorConfig returns sensible default configuration.
type ISkillWriter ¶
type ISkillWriter interface {
// Add creates a new skill on disk and updates the in-memory index.
Add(req AddSkillRequest) error
// Update overwrites an existing skill's content on disk.
Update(req AddSkillRequest) error
// Exists returns true if a skill with the given name already exists.
Exists(name string) bool
}
ISkillWriter is the subset of MutableRepository that consumers need for writing skills. Using this interface (rather than the concrete *MutableRepository) makes callers easy to unit-test with fakes.
type ListSkillsRequest ¶
type ListSkillsRequest struct {
}
ListSkillsRequest is the request for list_skills. This struct exists to define the input schema for the list_skills tool. Without this struct, the tool would not have a proper schema.
type ListSkillsResponse ¶
type ListSkillsResponse struct {
Skills []SkillSummary `json:"skills"`
Count int `json:"count"`
}
ListSkillsResponse is the response for list_skills. This struct exists to return the list of available skills. Without this struct, we could not return structured skill summaries.
func (ListSkillsResponse) MarshalJSON ¶
func (r ListSkillsResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements custom JSON marshaling for tool responses. This is needed because the trpc-agent-go function tool expects JSON responses.
type ListSkillsTool ¶
type ListSkillsTool struct {
// contains filtered or unexported fields
}
ListSkillsTool provides a tool for listing available skills. This struct exists to enable agents to discover what skills are available. Without this struct, agents would not know which skills they can use.
type LocalExecutor ¶
type LocalExecutor struct {
// contains filtered or unexported fields
}
LocalExecutor implements Executor for local script execution. This struct exists to provide local script execution with workspace isolation. Without this struct, we would not be able to execute skills locally.
func NewLocalExecutor ¶
func NewLocalExecutor(baseWorkDir string) *LocalExecutor
NewLocalExecutor creates a new LocalExecutor with default configuration. This function exists to initialize the executor with a base workspace directory. Without this function, we could not create executor instances.
func NewLocalExecutorWithConfig ¶
func NewLocalExecutorWithConfig(baseWorkDir string, config ExecutorConfig) *LocalExecutor
NewLocalExecutorWithConfig creates a new LocalExecutor with custom configuration. This function exists to allow customization of resource limits. Without this function, users could not configure executor behavior.
func (*LocalExecutor) Execute ¶
func (e *LocalExecutor) Execute(ctx context.Context, req ExecuteRequest) (ExecuteResponse, error)
Execute implements Executor. This method exists to execute skill scripts with proper workspace isolation and cleanup. Without this method, we could not run skill scripts.
type MutableRepository ¶
type MutableRepository struct {
// contains filtered or unexported fields
}
MutableRepository implements skill.Repository backed by a writable directory. Unlike FSRepository (which scans once at startup), this repository maintains an in-memory index that is updated when Add() is called, making new skills immediately discoverable without a pod restart.
func NewMutableRepository ¶
func NewMutableRepository(baseDir string, maxSkills int) (*MutableRepository, error)
NewMutableRepository creates a MutableRepository rooted at baseDir. It scans the directory for any existing skills (from prior runs).
func (*MutableRepository) Add ¶
func (r *MutableRepository) Add(req AddSkillRequest) error
Add creates a new skill on disk and updates the in-memory index.
func (*MutableRepository) Count ¶
func (r *MutableRepository) Count() int
Count returns the number of skills in the repository.
func (*MutableRepository) Delete ¶
func (r *MutableRepository) Delete(name string) error
Delete removes a skill from disk and the in-memory index.
func (*MutableRepository) Exists ¶
func (r *MutableRepository) Exists(name string) bool
Exists returns true if a skill with the given name already exists.
func (*MutableRepository) Get ¶
func (r *MutableRepository) Get(name string) (*skill.Skill, error)
Get returns a full skill by name.
func (*MutableRepository) Path ¶
func (r *MutableRepository) Path(name string) (string, error)
Path returns the directory path that contains the given skill.
func (*MutableRepository) Summaries ¶
func (r *MutableRepository) Summaries() []skill.Summary
Summaries returns all available skill summaries.
func (*MutableRepository) Update ¶
func (r *MutableRepository) Update(req AddSkillRequest) error
Update overwrites an existing skill's content on disk. The old scripts/ and docs/ directories are removed and replaced.
type SkillLoadRequest ¶
type SkillLoadRequest struct {
SkillName string `json:"skill_name" jsonschema:"description=Name of the skill to load,required"`
}
SkillLoadRequest is the request for skill_load. This struct exists to define the input schema for the skill_load tool. Without this struct, agents would not know how to call the tool.
type SkillLoadResponse ¶
type SkillLoadResponse struct {
Name string `json:"name"`
Description string `json:"description"`
Instructions string `json:"instructions"`
Documents []string `json:"documents,omitempty"`
Error string `json:"error,omitempty"`
}
SkillLoadResponse is the response for skill_load. This struct exists to return skill instructions to the agent. Without this struct, we could not return structured skill information.
func (SkillLoadResponse) MarshalJSON ¶
func (r SkillLoadResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements custom JSON marshaling for tool responses. This is needed because the trpc-agent-go function tool expects JSON responses.
type SkillLoadTool ¶
type SkillLoadTool struct {
// contains filtered or unexported fields
}
SkillLoadTool provides the skill_load tool for loading skill instructions. This struct exists to enable agents to discover and load skill instructions. Without this struct, agents could not access skill documentation.
type SkillRunRequest ¶
type SkillRunRequest struct {
SkillName string `json:"skill_name" jsonschema:"description=Name of the skill to run,required"`
ScriptPath string `` /* 129-byte string literal not displayed */
Args []string `json:"args,omitempty" jsonschema:"description=Arguments to pass to the script"`
InputFiles map[string]string `json:"input_files,omitempty" jsonschema:"description=Map of filename to content for input files"`
Environment map[string]string `json:"environment,omitempty" jsonschema:"description=Additional environment variables"`
}
SkillRunRequest is the request for skill_run. This struct exists to define the input schema for the skill_run tool. Without this struct, agents would not know how to call the tool.
type SkillRunResponse ¶
type SkillRunResponse struct {
Output string `json:"output"`
Error string `json:"error,omitempty"`
ExitCode int `json:"exit_code"`
OutputFiles map[string]string `json:"output_files,omitempty"`
}
SkillRunResponse is the response for skill_run. This struct exists to return execution results to the agent. Without this struct, we could not return structured execution results.
func (SkillRunResponse) MarshalJSON ¶
func (r SkillRunResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements custom JSON marshaling for tool responses. This is needed because the trpc-agent-go function tool expects JSON responses.
type SkillRunTool ¶
type SkillRunTool struct {
// contains filtered or unexported fields
}
SkillRunTool provides the skill_run tool for executing skills. This struct exists to enable agents to execute skill scripts. Without this struct, agents could not run skills.
type SkillSummary ¶
SkillSummary represents a skill summary in the list response. This is an alias for skill.Summary from trpc-agent-go.
type ToolProvider ¶
type ToolProvider struct {
// contains filtered or unexported fields
}
ToolProvider wraps a skill repository and executor and satisfies the tools.ToolProviders interface so skill tools can be passed directly to tools.NewRegistry. Without this, skill tool construction would be inlined in the registry.
func NewToolProvider ¶
func NewToolProvider(repo skill.Repository, executor Executor) *ToolProvider
NewToolProvider creates a ToolProvider for skills tools. Callers are responsible for creating the repository and executor.