Documentation
¶
Overview ¶
Package factory wires all dependencies for the dark-factory application.
Index ¶
- func CreateApproveCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.ApproveCommand
- func CreateCancelCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.CancelCommand
- func CreateCombinedListCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.CombinedListCommand
- func CreateCombinedStatusCommand(ctx context.Context, cfg config.Config, ...) cmd.CombinedStatusCommand
- func CreateKillCommand(_ config.Config) cmd.KillCommand
- func CreateListCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.ListCommand
- func CreateLocker(dir string) lock.Locker
- func CreateNotifier(cfg config.Config) notifier.Notifier
- func CreateOneShotRunner(ctx context.Context, cfg config.Config, ver string, autoApprove bool, ...) runner.OneShotRunner
- func CreateProcessor(inProgressDir string, completedDir string, logDir string, ...) processor.Processor
- func CreatePromptCompleteCommand(ctx context.Context, cfg config.Config, ...) cmd.PromptCompleteCommand
- func CreatePromptShowCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.PromptShowCommand
- func CreateRejectCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.RejectCommand
- func CreateRequeueCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.RequeueCommand
- func CreateReviewPoller(ctx context.Context, cfg config.Config, promptManager *prompt.Manager, ...) review.ReviewPoller
- func CreateRunner(ctx context.Context, cfg config.Config, ver string, ...) runner.Runner
- func CreateScenarioListCommand(_ config.Config) cmd.ScenarioListCommand
- func CreateScenarioShowCommand(_ config.Config) cmd.ScenarioShowCommand
- func CreateScenarioStatusCommand(_ config.Config) cmd.ScenarioStatusCommand
- func CreateServer(ctx context.Context, port int, inboxDir string, inProgressDir string, ...) server.Server
- func CreateSpecApproveCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.SpecApproveCommand
- func CreateSpecCompleteCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.SpecCompleteCommand
- func CreateSpecGenerator(cfg config.Config, containerImage string, ...) generator.SpecGenerator
- func CreateSpecListCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.SpecListCommand
- func CreateSpecRejectCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.SpecRejectCommand
- func CreateSpecShowCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.SpecShowCommand
- func CreateSpecStatusCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.SpecStatusCommand
- func CreateSpecUnapproveCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.SpecUnapproveCommand
- func CreateSpecWatcher(cfg config.Config, gen generator.SpecGenerator, ...) specwatcher.SpecWatcher
- func CreateStatusCommand(ctx context.Context, cfg config.Config, ...) cmd.StatusCommand
- func CreateUnapproveCommand(cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter) cmd.UnapproveCommand
- func CreateWatcher(inProgressDir string, inboxDir string, promptManager *prompt.Manager, ...) watcher.Watcher
- func CreateWorkflowExecutor(workflow config.Workflow, pr bool, brancher git.Brancher, ...) processor.WorkflowExecutor
- func EffectiveMaxContainers(projectMax, globalMax int) int
- func LogEffectiveConfig(cfg config.Config, globalCfg globalconfig.GlobalConfig, globalFilePresent bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateApproveCommand ¶ added in v0.17.15
func CreateApproveCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.ApproveCommand
CreateApproveCommand creates an ApproveCommand.
func CreateCancelCommand ¶ added in v0.62.0
func CreateCancelCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.CancelCommand
CreateCancelCommand creates a CancelCommand.
func CreateCombinedListCommand ¶ added in v0.17.25
func CreateCombinedListCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.CombinedListCommand
CreateCombinedListCommand creates a CombinedListCommand.
func CreateCombinedStatusCommand ¶ added in v0.17.25
func CreateCombinedStatusCommand( ctx context.Context, cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.CombinedStatusCommand
CreateCombinedStatusCommand creates a CombinedStatusCommand.
func CreateKillCommand ¶ added in v0.84.0
func CreateKillCommand(_ config.Config) cmd.KillCommand
CreateKillCommand creates a KillCommand that stops the running daemon.
func CreateListCommand ¶ added in v0.17.15
func CreateListCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.ListCommand
CreateListCommand creates a ListCommand.
func CreateLocker ¶ added in v0.3.0
CreateLocker creates a Locker for the specified directory.
func CreateNotifier ¶ added in v0.48.0
CreateNotifier creates a Notifier from config, or a no-op if no channels are configured.
func CreateOneShotRunner ¶ added in v0.31.0
func CreateOneShotRunner( ctx context.Context, cfg config.Config, ver string, autoApprove bool, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) runner.OneShotRunner
CreateOneShotRunner creates an OneShotRunner that drains the queue and exits.
func CreateProcessor ¶ added in v0.3.1
func CreateProcessor( inProgressDir string, completedDir string, logDir string, projectName project.Name, promptManager *prompt.Manager, releaser git.Releaser, versionGetter version.Getter, wakeup <-chan struct{}, containerImage string, model string, netrcFile string, gitconfigFile string, workflow config.Workflow, pr bool, brancher git.Brancher, prCreator git.PRCreator, prMerger git.PRMerger, autoMerge bool, autoRelease bool, autoReview bool, validationCommand string, validationPrompt string, testCommand string, specsInboxDir, specsInProgressDir, specsCompletedDir, specsRejectedDir string, verificationGate bool, env map[string]string, extraMounts []config.ExtraMount, currentDateTimeGetter libtime.CurrentDateTimeGetter, n notifier.Notifier, claudeDir string, containerCounter executor.ContainerCounter, maxContainers int, additionalInstructions string, containerLock containerlock.ContainerLock, containerChecker executor.ContainerChecker, dirtyFileThreshold int, dirtyFileChecker processor.DirtyFileChecker, gitLockChecker processor.GitLockChecker, maxPromptDuration time.Duration, autoRetryLimit int, hideGit bool, preflightChecker preflight.Checker, queueInterval time.Duration, sweepInterval time.Duration, onIdle processor.NothingToDoCallback, ) processor.Processor
CreateProcessor creates a Processor that executes queued prompts.
func CreatePromptCompleteCommand ¶ added in v0.69.0
func CreatePromptCompleteCommand( ctx context.Context, cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.PromptCompleteCommand
CreatePromptCompleteCommand creates a PromptCompleteCommand.
func CreatePromptShowCommand ¶ added in v0.25.0
func CreatePromptShowCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.PromptShowCommand
CreatePromptShowCommand creates a PromptShowCommand.
func CreateRejectCommand ¶ added in v0.134.0
func CreateRejectCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.RejectCommand
CreateRejectCommand creates a RejectCommand.
func CreateRequeueCommand ¶ added in v0.17.15
func CreateRequeueCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.RequeueCommand
CreateRequeueCommand creates a RequeueCommand.
func CreateReviewPoller ¶ added in v0.17.38
func CreateReviewPoller( ctx context.Context, cfg config.Config, promptManager *prompt.Manager, projectName project.Name, n notifier.Notifier, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) review.ReviewPoller
CreateReviewPoller creates a ReviewPoller that watches in_review prompts and handles approvals/changes.
func CreateRunner ¶ added in v0.2.25
func CreateRunner( ctx context.Context, cfg config.Config, ver string, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) runner.Runner
CreateRunner creates a Runner that coordinates watcher and processor using the provided config.
func CreateScenarioListCommand ¶ added in v0.131.0
func CreateScenarioListCommand(_ config.Config) cmd.ScenarioListCommand
CreateScenarioListCommand creates a ScenarioListCommand.
func CreateScenarioShowCommand ¶ added in v0.131.0
func CreateScenarioShowCommand(_ config.Config) cmd.ScenarioShowCommand
CreateScenarioShowCommand creates a ScenarioShowCommand.
func CreateScenarioStatusCommand ¶ added in v0.131.0
func CreateScenarioStatusCommand(_ config.Config) cmd.ScenarioStatusCommand
CreateScenarioStatusCommand creates a ScenarioStatusCommand.
func CreateServer ¶ added in v0.7.0
func CreateServer( ctx context.Context, port int, inboxDir string, inProgressDir string, completedDir string, logDir string, promptManager *prompt.Manager, currentDateTimeGetter libtime.CurrentDateTimeGetter, projectMaxContainers int, ) server.Server
CreateServer creates a Server that provides HTTP endpoints for monitoring.
func CreateSpecApproveCommand ¶ added in v0.17.23
func CreateSpecApproveCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.SpecApproveCommand
CreateSpecApproveCommand creates a SpecApproveCommand.
func CreateSpecCompleteCommand ¶ added in v0.23.2
func CreateSpecCompleteCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.SpecCompleteCommand
CreateSpecCompleteCommand creates a SpecCompleteCommand.
func CreateSpecGenerator ¶ added in v0.18.1
func CreateSpecGenerator( cfg config.Config, containerImage string, currentDateTimeGetter libtime.CurrentDateTimeGetter, slugMigrator slugmigrator.Migrator, promptManager *prompt.Manager, ) generator.SpecGenerator
CreateSpecGenerator creates a SpecGenerator using the Docker executor.
func CreateSpecListCommand ¶ added in v0.17.23
func CreateSpecListCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.SpecListCommand
CreateSpecListCommand creates a SpecListCommand.
func CreateSpecRejectCommand ¶ added in v0.134.0
func CreateSpecRejectCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.SpecRejectCommand
CreateSpecRejectCommand creates a SpecRejectCommand.
func CreateSpecShowCommand ¶ added in v0.25.0
func CreateSpecShowCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.SpecShowCommand
CreateSpecShowCommand creates a SpecShowCommand.
func CreateSpecStatusCommand ¶ added in v0.17.23
func CreateSpecStatusCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.SpecStatusCommand
CreateSpecStatusCommand creates a SpecStatusCommand.
func CreateSpecUnapproveCommand ¶ added in v0.78.0
func CreateSpecUnapproveCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.SpecUnapproveCommand
CreateSpecUnapproveCommand creates a SpecUnapproveCommand.
func CreateSpecWatcher ¶ added in v0.18.1
func CreateSpecWatcher( cfg config.Config, gen generator.SpecGenerator, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) specwatcher.SpecWatcher
CreateSpecWatcher creates a SpecWatcher that triggers generation when a spec appears in inProgressDir.
func CreateStatusCommand ¶ added in v0.8.0
func CreateStatusCommand( ctx context.Context, cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.StatusCommand
CreateStatusCommand creates a StatusCommand.
func CreateUnapproveCommand ¶ added in v0.77.0
func CreateUnapproveCommand( cfg config.Config, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) cmd.UnapproveCommand
CreateUnapproveCommand creates an UnapproveCommand.
func CreateWatcher ¶ added in v0.3.1
func CreateWatcher( inProgressDir string, inboxDir string, promptManager *prompt.Manager, wakeup chan<- struct{}, debounce time.Duration, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) watcher.Watcher
CreateWatcher creates a Watcher that normalizes filenames on file events.
func CreateWorkflowExecutor ¶ added in v0.119.3
func CreateWorkflowExecutor( workflow config.Workflow, pr bool, brancher git.Brancher, prCreator git.PRCreator, prMerger git.PRMerger, autoMerge bool, autoRelease bool, autoReview bool, projectName project.Name, promptManager *prompt.Manager, releaser git.Releaser, autoCompleter spec.AutoCompleter, ) processor.WorkflowExecutor
CreateWorkflowExecutor creates the appropriate WorkflowExecutor based on the config.
func EffectiveMaxContainers ¶ added in v0.89.0
EffectiveMaxContainers returns the per-project limit when set (> 0), otherwise falls back to the global limit. A per-project value MAY exceed the global limit. This is intentional: e.g. dark-factory itself uses maxContainers: 5 so it can self-update even when 3 other containers are already running.
func LogEffectiveConfig ¶ added in v0.111.0
func LogEffectiveConfig( cfg config.Config, globalCfg globalconfig.GlobalConfig, globalFilePresent bool, )
LogEffectiveConfig emits a single slog.Info "effective config" line describing the resolved settings that drive daemon/run behavior. This is purely diagnostic; no value is mutated.
maxContainersSource is one of:
- "project" when cfg.MaxContainers > 0 (project file override wins)
- "global" when cfg.MaxContainers <= 0 AND globalFilePresent is true
- "default" when cfg.MaxContainers <= 0 AND globalFilePresent is false
Types ¶
This section is empty.