prompt

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetsFS

func AssetsFS() (fs.FS, error)

AssetsFS returns the embedded prompt assets filesystem rooted at assets/.

func ReadAsset

func ReadAsset(path string) ([]byte, error)

ReadAsset reads an embedded prompt asset by path (relative to assets/).

Types

type Compiler

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

Compiler handles the assembly of prompts

func NewCompiler

func NewCompiler(assetsPath string) *Compiler

NewCompiler creates a new prompt compiler

func NewCompilerFromFS

func NewCompilerFromFS(assets fs.FS) *Compiler

NewCompilerFromFS creates a compiler from a given FS (useful for testing or external loading)

func (*Compiler) CompileModeUserPrompt added in v0.11.0

func (c *Compiler) CompileModeUserPrompt(cfg Config) (string, error)

CompileModeUserPrompt compiles mode-specific user prompt template at modes/<mode>/user.md.

func (*Compiler) CompileSystemPrompt

func (c *Compiler) CompileSystemPrompt(cfg Config) (string, error)

func (*Compiler) CompileUserPrompt

func (c *Compiler) CompileUserPrompt(goal string, contextFiles []string) (string, error)

CompileUserPrompt assembles the user's task prompt (Goal + Context Filenames)

type Config

type Config struct {
	Mode           string
	Language       string
	WorkingDir     string
	ContextFiles   []string
	ContextEntries []ContextEntry
	// GitHub actor identity fields (optional)
	ActorLogin   string // GitHub username or bot name
	ActorType    string // "User" or "App"
	ActorSource  string // "token" or "app"
	ActorAppSlug string // App slug if type is "App"
}

Config represents the prompt configuration

type ContextEntry

type ContextEntry struct {
	Path        string
	Description string
}

ContextEntry represents a context file with optional description

type Manifest

type Manifest struct {
	Version  string `yaml:"version"`
	Defaults struct {
		Mode string `yaml:"mode"`
	} `yaml:"defaults"`
}

Manifest represents the structure of manifest.yaml

Jump to

Keyboard shortcuts

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