mode

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateMode

func ValidateMode(mode *Config) error

ValidateMode validates the contents of a Config

Types

type Config

type Config struct {
	Slug               string
	Name               string
	GroupsRaw          []GroupEntry       // Raw data from frontmatter
	GroupsParsed       []ParsedGroupEntry // Parsed and validated groups
	RoleDefinition     string             // From frontmatter
	CustomInstructions *string            // Content of the Markdown body (if not empty)
	FilePath           string             // Path to the source Markdown file
	Source             string             // Original source path from frontmatter
}

Config represents the complete data for a custom mode

func ParseModeFile

func ParseModeFile(filePath string) (*Config, error)

ParseModeFile parses a specified Markdown file and returns a Config

type GroupEntry

type GroupEntry interface{}

GroupEntry represents either a simple group name (string) or a [string, GroupOptions] tuple Using interface{} for flexibility, requires custom parsing after frontmatter parsing

type GroupOptions

type GroupOptions struct {
	FileRegex   *string `yaml:"fileRegex,omitempty" json:"fileRegex,omitempty"`
	Description *string `yaml:"description,omitempty" json:"description,omitempty"`
}

GroupOptions defines options for tool groups (like file access restrictions)

type Metadata

type Metadata struct {
	Name           string       `yaml:"name" json:"name"`
	Groups         []GroupEntry `yaml:"groups" json:"groups"` // Requires custom parsing after initial parse
	RoleDefinition string       `yaml:"roleDefinition" json:"roleDefinition"`
	Source         string       `yaml:"source,omitempty" json:"source,omitempty"`
}

Metadata represents data parsed from frontmatter

type ParsedGroupEntry

type ParsedGroupEntry struct {
	Name    string
	Options *GroupOptions
}

ParsedGroupEntry represents a validated group entry

func ParseGroupEntries

func ParseGroupEntries(rawGroups []GroupEntry) ([]ParsedGroupEntry, error)

ParseGroupEntries parses and validates raw GroupEntry slices

Jump to

Keyboard shortcuts

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