Documentation
¶
Index ¶
- func AllRulePaths(baseDir, homeDir string) []string
- func AllTaskSearchPaths(baseDir, homeDir string) []string
- func DownloadedRulePaths(dir string) []string
- func DownloadedTaskSearchPaths(dir string) []string
- func ParseMarkdownFile(path string, frontmatter any) (string, error)
- type Context
- type FrontMatter
- type Markdown
- type Option
- type Params
- type Result
- type Selectors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllRulePaths ¶
AllRulePaths returns the standard search paths for rule files baseDir is the working directory to resolve relative paths from
func AllTaskSearchPaths ¶
AllTaskSearchPaths returns the standard search paths for task files baseDir is the working directory to resolve relative paths from
func DownloadedRulePaths ¶
DownloadedRulePaths returns the search paths for rule files in downloaded directories
func DownloadedTaskSearchPaths ¶
DownloadedTaskSearchPaths returns the search paths for task files in downloaded directories
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context holds the configuration and state for assembling coding context
type FrontMatter ¶
FrontMatter represents parsed YAML frontmatter from markdown files
type Markdown ¶
type Markdown struct {
Path string // Path to the markdown file
FrontMatter FrontMatter // Parsed YAML frontmatter
Content string // Expanded content of the markdown
Tokens int // Estimated token count
}
Markdown represents a markdown file with frontmatter and content
func (*Markdown) BootstrapPath ¶
BootstrapPath returns the path to the bootstrap script for this markdown file, if it exists. Returns empty string if the path is empty.
type Option ¶
type Option func(*Context)
Option is a functional option for configuring a Context
func WithEmitTaskFrontmatter ¶
WithEmitTaskFrontmatter enables task frontmatter emission
func WithRemotePaths ¶
WithRemotePaths sets the remote paths
func WithSelectors ¶
WithSelectors sets the selectors
type Params ¶
Params is a map of parameter key-value pairs for template substitution
type Result ¶
type Result struct {
Rules []Markdown // List of included rule files
Task Markdown // Task file with frontmatter and content
}
Result holds the assembled context from running a task
type Selectors ¶
Selectors stores selector key-value pairs where values are stored in inner maps Multiple values for the same key use OR logic (match any value in the inner map) Each value can be represented exactly once per key
func (*Selectors) GetValue ¶
GetValue returns true if the given value exists in the inner map for the given key. Returns false if the key doesn't exist or the value is not present.
func (*Selectors) MatchesIncludes ¶
func (includes *Selectors) MatchesIncludes(frontmatter FrontMatter) bool
MatchesIncludes returns true if the frontmatter matches all include selectors If a key doesn't exist in frontmatter, it's allowed Multiple values for the same key use OR logic (matches if frontmatter value is in the inner map)