messages

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package messages provides metadata for hook message templates.

Index

Constants

View Source
const CategoryCtxSpecific = "ctx-specific"

CategoryCtxSpecific marks messages specific to ctx's own development workflow.

View Source
const CategoryCustomizable = "customizable"

CategoryCustomizable marks messages intended for project-specific customization.

Variables

This section is empty.

Functions

func Hooks

func Hooks() []string

Hooks returns a deduplicated list of hook names in the registry.

Returns:

  • []string: Hook names in alphabetical order

func RegistryError

func RegistryError() error

RegistryError returns any error encountered while parsing the embedded registry.yaml. Nil on success.

func Variants

func Variants(hook string) []string

Variants returns the variant names for a given hook.

Parameters:

  • hook: Hook directory name

Returns:

  • []string: Variant names for the hook, or nil if hook not found

Types

type HookMessageInfo

type HookMessageInfo struct {
	// Hook is the hook directory name (e.g., "qa-reminder").
	Hook string `yaml:"hook"`

	// Variant is the template file stem (e.g., "gate").
	Variant string `yaml:"variant"`

	// Category is "customizable" or "ctx-specific".
	Category string `yaml:"category"`

	// Description is a one-line human description of this message.
	Description string `yaml:"description"`

	// TemplateVars lists available Go template variables (e.g., "PromptsSinceNudge").
	TemplateVars []string `yaml:"vars,omitempty"`
}

HookMessageInfo describes a single hook message template entry.

func Lookup

func Lookup(hook, variant string) *HookMessageInfo

Lookup returns the HookMessageInfo for the given hook and variant, or nil if not found.

Parameters:

  • hook: Hook directory name (e.g., "qa-reminder")
  • variant: Template file stem (e.g., "gate")

Returns:

  • *HookMessageInfo: The matching entry, or nil

func Registry

func Registry() []HookMessageInfo

Registry returns the list of all hook message entries parsed from the embedded registry.yaml.

Returns:

  • []HookMessageInfo: All entries sorted by hook then variant

Jump to

Keyboard shortcuts

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