domain

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocTypeDecision = "decision"
	DocTypeFeature  = "feature"
	DocTypeBugfix   = "bugfix"
	DocTypeRefactor = "refactor"
	DocTypeRelease  = "release"
	DocTypeNote     = "note"
)

Document type constants.

Variables

View Source
var (
	ErrNotFound       = errors.New("not found")
	ErrCorrupted      = errors.New("corrupted")
	ErrAlreadyExists  = errors.New("already exists")
	ErrNotInitialized = errors.New("lore not initialized")
	ErrNotGitRepo     = errors.New("not a git repository")
	ErrNotInteractive = errors.New("not interactive")
)

Functions

func Slugify

func Slugify(s string) string

Slugify converts a string to a URL-friendly slug (display purposes). For filename generation, use storage.slugify which also handles accents and length limits.

func ValidDocType

func ValidDocType(t string) bool

ValidDocType reports whether t is a recognized document type. This is the single source of truth for accepted types.

Types

type AIProvider

type AIProvider interface {
	Complete(ctx context.Context, prompt string, opts ...Option) (string, error)
}

type CallOptions

type CallOptions struct {
	MaxTokens   int
	Temperature float64
	Timeout     time.Duration
}

type CommitInfo

type CommitInfo struct {
	Hash    string
	Author  string
	Date    time.Time
	Message string
	Type    string
	Scope   string
	Subject string
}

type CorpusReader

type CorpusReader interface {
	ReadDoc(id string) (string, error)
	ListDocs(filter DocFilter) ([]DocMeta, error)
}

type DocFilter

type DocFilter struct {
	Type   string
	After  string // YYYY-MM-DD, inclusive
	Before string // YYYY-MM-DD, inclusive
	Tags   []string
	Status string
	Text   string // case-insensitive search in body and filename
}

type DocMeta

type DocMeta struct {
	Type        string   `yaml:"type"`
	Date        string   `yaml:"date"`
	Commit      string   `yaml:"commit,omitempty"`
	Status      string   `yaml:"status"`
	Tags        []string `yaml:"tags,omitempty"`
	Related     []string `yaml:"related,omitempty"`
	GeneratedBy string   `yaml:"generated_by,omitempty"`
	AngelaMode  string   `yaml:"angela_mode,omitempty"`

	Filename string `yaml:"-"` // populated at runtime by ListDocs, not serialized
}

type GitAdapter

type GitAdapter interface {
	Diff(ref string) (string, error)
	Log(ref string) (*CommitInfo, error)

	CommitExists(ref string) (bool, error)
	IsMergeCommit(ref string) (bool, error)

	IsInsideWorkTree() bool

	HeadRef() (string, error)
	IsRebaseInProgress() (bool, error)

	CommitMessageContains(ref, marker string) (bool, error)

	GitDir() (string, error)

	InstallHook(hookType string) (InstallResult, error)
	UninstallHook(hookType string) error
	HookExists(hookType string) (bool, error)
}

type IOStreams

type IOStreams struct {
	Out io.Writer
	Err io.Writer
	In  io.Reader
}

type InstallResult

type InstallResult struct {
	Installed     bool   // true if the hook was installed
	HooksPathWarn string // non-empty if core.hooksPath is configured
}

InstallResult describes the outcome of a hook install operation.

type Option

type Option func(*CallOptions)

Jump to

Keyboard shortcuts

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