Documentation
¶
Overview ¶
Package status aggregates and formats system status information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker interface {
GetStatus(ctx context.Context) (*Status, error)
GetQueuedPrompts(ctx context.Context) ([]QueuedPrompt, error)
GetCompletedPrompts(ctx context.Context, limit int) ([]CompletedPrompt, error)
}
Checker checks the current status of the dark-factory daemon.
func NewChecker ¶
func NewChecker( projectDir string, queueDir string, completedDir string, logDir string, lockFilePath string, serverPort int, promptMgr PromptManager, containerCounter executor.ContainerCounter, maxContainers int, dirtyFileThreshold int, currentDateTimeGetter libtime.CurrentDateTimeGetter, subprocRunner subproc.Runner, ) Checker
NewChecker creates a new Checker with additional options.
type CompletedPrompt ¶
type CompletedPrompt struct {
Name string `json:"name"`
CompletedAt libtime.DateTime `json:"completed_at"`
}
CompletedPrompt represents a completed prompt with metadata.
type Formatter ¶ added in v0.8.0
Formatter formats status for display.
func NewFormatter ¶ added in v0.8.0
func NewFormatter() Formatter
NewFormatter creates a new Formatter.
type PromptManager ¶ added in v0.119.2
type PromptManager interface {
ListQueued(ctx context.Context) ([]prompt.Prompt, error)
Title(ctx context.Context, path string) (string, error)
ReadFrontmatter(ctx context.Context, path string) (*prompt.Frontmatter, error)
HasExecuting(ctx context.Context) bool
}
PromptManager is the subset of prompt.Manager that the status package uses.
type QueuedPrompt ¶
type QueuedPrompt struct {
Name string `json:"name"`
Title string `json:"title"`
Size int64 `json:"size"`
}
QueuedPrompt represents a prompt in the queue with metadata.
type Status ¶
type Status struct {
ProjectDir string `json:"project_dir,omitempty"`
Daemon string `json:"daemon"`
DaemonPID int `json:"daemon_pid,omitempty"`
CurrentPrompt string `json:"current_prompt,omitempty"`
ExecutingSince string `json:"executing_since,omitempty"`
Container string `json:"container,omitempty"`
ContainerRunning bool `json:"container_running,omitempty"`
GeneratingSpec string `json:"generating_spec,omitempty"`
GeneratingContainer string `json:"generating_container,omitempty"`
QueueCount int `json:"queue_count"`
QueuedPrompts []string `json:"queued_prompts"`
CompletedCount int `json:"completed_count"`
ContainerCount int `json:"container_count,omitempty"`
ContainerMax int `json:"container_max,omitempty"`
LastLogFile string `json:"last_log_file,omitempty"`
LastLogSize int64 `json:"last_log_size,omitempty"`
GitIndexLock bool `json:"git_index_lock,omitempty"`
DirtyFileCount int `json:"dirty_file_count,omitempty"`
DirtyFileThreshold int `json:"dirty_file_threshold,omitempty"`
// Skipped flags — true when the corresponding subprocess call was
// cancelled at timeout. Callers should NOT treat the zero value of
// related fields as authoritative when the matching Skipped flag is true.
DirtyFileCheckSkipped bool `json:"dirty_file_check_skipped,omitempty"`
ContainerRunningSkipped bool `json:"container_running_skipped,omitempty"`
GeneratingSpecSkipped bool `json:"generating_spec_skipped,omitempty"`
ContainerCountSkipped bool `json:"container_count_skipped,omitempty"`
}
Status represents the current daemon status.
Click to show internal directories.
Click to hide internal directories.