config

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGitHubTokenRef = "${DARK_FACTORY_GITHUB_TOKEN}" // #nosec G101 -- env var reference, not a credential

DefaultGitHubTokenRef is the default env var reference for the GitHub token.

Variables

AvailableWorkflows contains all valid workflow values.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProjectName      string        `yaml:"projectName"`
	Workflow         Workflow      `yaml:"workflow"`
	Prompts          PromptsConfig `yaml:"prompts"`
	Specs            SpecsConfig   `yaml:"specs"`
	ContainerImage   string        `yaml:"containerImage"`
	Model            string        `yaml:"model"`
	DebounceMs       int           `yaml:"debounceMs"`
	ServerPort       int           `yaml:"serverPort"`
	AutoMerge        bool          `yaml:"autoMerge"`
	AutoRelease      bool          `yaml:"autoRelease"`
	AutoReview       bool          `yaml:"autoReview"`
	MaxReviewRetries int           `yaml:"maxReviewRetries"`
	AllowedReviewers []string      `yaml:"allowedReviewers,omitempty"`
	UseCollaborators bool          `yaml:"useCollaborators"`
	PollIntervalSec  int           `yaml:"pollIntervalSec"`
	GitHub           GitHubConfig  `yaml:"github"`
}

Config holds the dark-factory configuration.

func Defaults

func Defaults() Config

Defaults returns a Config with all default values.

func (Config) ResolvedGitHubToken added in v0.15.0

func (c Config) ResolvedGitHubToken() string

ResolvedGitHubToken returns the GitHub token with environment variables resolved. Logs a warning if a non-default token is configured but the env var is empty.

func (Config) Validate

func (c Config) Validate(ctx context.Context) error

Validate validates the config fields.

type GitHubConfig added in v0.15.0

type GitHubConfig struct {
	Token string `yaml:"token"`
}

GitHubConfig holds GitHub-specific configuration.

type Loader

type Loader interface {
	Load(ctx context.Context) (Config, error)
}

Loader loads configuration from a file.

func NewLoader

func NewLoader() Loader

NewLoader creates a Loader that reads from .dark-factory.yaml in the current directory.

type PromptsConfig added in v0.20.3

type PromptsConfig struct {
	InboxDir      string `yaml:"inboxDir"`
	InProgressDir string `yaml:"inProgressDir"`
	CompletedDir  string `yaml:"completedDir"`
	LogDir        string `yaml:"logDir"`
}

PromptsConfig holds directories for the prompt lifecycle.

type SpecsConfig added in v0.20.3

type SpecsConfig struct {
	InboxDir      string `yaml:"inboxDir"`
	InProgressDir string `yaml:"inProgressDir"`
	CompletedDir  string `yaml:"completedDir"`
	LogDir        string `yaml:"logDir"`
}

SpecsConfig holds directories for the spec lifecycle.

type Workflow

type Workflow string

Workflow is a string-based enum for workflow types.

const (
	WorkflowDirect   Workflow = "direct"
	WorkflowPR       Workflow = "pr"
	WorkflowWorktree Workflow = "worktree"
)

Workflow defines how prompts are processed.

func (Workflow) Ptr

func (w Workflow) Ptr() *Workflow

func (Workflow) String

func (w Workflow) String() string

func (Workflow) Validate

func (w Workflow) Validate(ctx context.Context) error

type Workflows

type Workflows []Workflow

Workflows is a collection of Workflow values.

func (Workflows) Contains

func (w Workflows) Contains(workflow Workflow) bool

Jump to

Keyboard shortcuts

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