Documentation
¶
Index ¶
- Variables
- func Content(ctx context.Context, path string) (string, error)
- func MoveToCompleted(ctx context.Context, path string) error
- func ResetExecuting(ctx context.Context, dir string) error
- func SetStatus(ctx context.Context, path string, status string) error
- func Title(ctx context.Context, path string) (string, error)
- type Frontmatter
- type Prompt
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyPrompt = stderrors.New("prompt file is empty")
ErrEmptyPrompt is returned when a prompt file is empty or contains only whitespace.
Functions ¶
func Content ¶
Content returns the full file content for passing to Docker. Returns ErrEmptyPrompt if the file is empty or contains only whitespace.
func MoveToCompleted ¶
MoveToCompleted sets status to "completed" and moves a prompt file to the completed/ subdirectory. This ensures files in completed/ always have the correct status.
func ResetExecuting ¶ added in v0.2.5
ResetExecuting resets any prompts with status "executing" back to "queued". This handles prompts that got stuck from a previous crash.
Types ¶
type Frontmatter ¶
type Frontmatter struct {
Status string `yaml:"status"`
}
Frontmatter represents the YAML frontmatter in a prompt file.
func ReadFrontmatter ¶ added in v0.2.0
func ReadFrontmatter(ctx context.Context, path string) (*Frontmatter, error)
ReadFrontmatter reads frontmatter from a file.
Click to show internal directories.
Click to hide internal directories.