prompt

package
v0.14.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActiveVersion

func GetActiveVersion() (string, error)

GetActiveVersion returns the active version from versions.json

func ListVersions

func ListVersions() ([]string, error)

ListVersions returns all available prompt versions

func LoadPrompt

func LoadPrompt(version string) (string, error)

LoadPrompt loads a prompt by version string. If version is empty or "latest", uses the active version from versions.json. Returns the prompt content as a string.

func LoadPromptWithVersion added in v0.14.2

func LoadPromptWithVersion(version string) (string, string, error)

LoadPromptWithVersion loads a prompt by version string and returns the resolved version ID. If version is empty or "latest", the active version is used and its ID is returned. Returns (content, versionUsed, error).

func SetEmbeddedFS

func SetEmbeddedFS(efs fs.FS)

SetEmbeddedFS sets the embedded filesystem for prompts This should be called from main() with the embedded FS

Types

type VersionMetadata

type VersionMetadata struct {
	File        string   `json:"file"`
	Hash        string   `json:"hash"`
	Description string   `json:"description"`
	Created     string   `json:"created"`
	Tags        []string `json:"tags"`
	Notes       string   `json:"notes"`
}

VersionMetadata represents metadata for a prompt version

func GetVersionMetadata

func GetVersionMetadata(version string) (*VersionMetadata, error)

GetVersionMetadata returns metadata for a specific version

type VersionsManifest

type VersionsManifest struct {
	SchemaVersion string                     `json:"schema_version"`
	Versions      map[string]VersionMetadata `json:"versions"`
	Active        string                     `json:"active"`
	Notes         []string                   `json:"notes"`
}

VersionsManifest represents the versions.json file structure

Jump to

Keyboard shortcuts

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