job

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContainerCommitMessagePath is where Claude writes the commit message.
	ContainerCommitMessagePath = "/manfred-job/.manfred/commit_message.txt"

	// CommitMessagePrompt is the prompt for phase 2.
	CommitMessagePrompt = `` /* 597-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	ID          string
	ProjectName string
	Prompt      string
	Status      Status
	CreatedAt   time.Time
	StartedAt   *time.Time
	CompletedAt *time.Time
	Error       string

	// Git-related fields
	BranchName string
	BaseSHA    string

	// Output
	CommitMessage string
	// contains filtered or unexported fields
}

Job represents a MANFRED job execution.

func New

func New(projectName, prompt, jobsDir string) *Job

New creates a new job with a generated ID.

func (*Job) ClaudeBundlePath

func (j *Job) ClaudeBundlePath() string

ClaudeBundlePath returns the path to the Claude bundle directory in the job.

func (*Job) CommitMessageFile

func (j *Job) CommitMessageFile() string

CommitMessageFile returns the path to the commit message file.

func (*Job) Complete

func (j *Job) Complete()

Complete marks the job as completed.

func (*Job) CreateDirectories

func (j *Job) CreateDirectories() error

CreateDirectories creates the job directory structure.

func (*Job) CredentialsFile

func (j *Job) CredentialsFile() string

CredentialsFile returns the path to the credentials file in the job directory.

func (*Job) Fail

func (j *Job) Fail(err string)

Fail marks the job as failed with an error message.

func (*Job) JobPath

func (j *Job) JobPath() string

JobPath returns the path to the job's directory.

func (*Job) PromptFile

func (j *Job) PromptFile() string

PromptFile returns the path to the prompt file.

func (*Job) Start

func (j *Job) Start()

Start marks the job as running.

func (*Job) WorkspacePath

func (j *Job) WorkspacePath() string

WorkspacePath returns the path to the job's workspace (cloned repository).

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger provides prefixed logging for job execution.

func NewLogger

func NewLogger() *Logger

NewLogger creates a new logger that writes to stdout.

func (*Logger) Blank

func (l *Logger) Blank()

Blank prints a blank line.

func (*Logger) Claude

func (l *Logger) Claude(message string)

Claude logs a Claude message.

func (*Logger) Docker

func (l *Logger) Docker(message string)

Docker logs a Docker message.

func (*Logger) Log

func (l *Logger) Log(source, message string)

Log writes a message with a source prefix.

func (*Logger) Manfred

func (l *Logger) Manfred(message string)

Manfred logs a MANFRED message.

func (*Logger) Separator

func (l *Logger) Separator()

Separator prints a visual separator line.

func (*Logger) Writer

func (l *Logger) Writer(source string) io.Writer

Writer returns an io.Writer that logs with the given source prefix.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner orchestrates job execution.

func NewRunner

func NewRunner(cfg *config.Config) (*Runner, error)

NewRunner creates a new job runner.

func (*Runner) Close

func (r *Runner) Close() error

Close releases resources.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, projectName, prompt string) (*Job, error)

Run executes a job for the given project and prompt.

type Status

type Status string

Status represents the current state of a job.

const (
	StatusPending   Status = "pending"
	StatusRunning   Status = "running"
	StatusCompleted Status = "completed"
	StatusFailed    Status = "failed"
)

Jump to

Keyboard shortcuts

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