Documentation
¶
Overview ¶
Package prompttemplate loads reusable, file-backed prompt macros.
Index ¶
- func IsExplicitInvocationText(text string) bool
- func Load(opts LoadOptions) (*Registry, []Diagnostic)
- func LoadFor(workspace string) (*Registry, []Diagnostic)
- func ParseArguments(value string) []string
- func ParseExplicitInvocationText(text string) (invocation.Record, bool)
- func Roots(workspace string) (userDir, projectDir string)
- func Substitute(content string, args []string) string
- type Diagnostic
- type LoadOptions
- type Registry
- type Source
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(opts LoadOptions) (*Registry, []Diagnostic)
Load discovers Markdown files directly inside the configured roots. Project templates replace user templates with the same filename-derived name.
func LoadFor ¶
func LoadFor(workspace string) (*Registry, []Diagnostic)
func ParseArguments ¶
ParseArguments splits a command tail while preserving whitespace inside matching single or double quotes, matching Pi's prompt-template behavior.
func ParseExplicitInvocationText ¶
func ParseExplicitInvocationText(text string) (invocation.Record, bool)
ParseExplicitInvocationText returns metadata only from the hidden block the backend created after resolving and expanding a template. User-authored slash text lives in the first content block and is never parsed here.
func Substitute ¶
Substitute expands Pi-compatible positional, all-argument, default, and slicing placeholders in one pass so values are never recursively expanded.
Types ¶
type Diagnostic ¶
Diagnostic reports a template file that could not be loaded.
type LoadOptions ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) ExpandExplicitInvocation ¶
ExpandExplicitInvocation recognizes /name followed by optional arguments. Unknown slash commands remain ordinary user text.