package runtime

import (
	"context"
	"time"
)

// CheckoutMaterializer materializes the immutable repository snapshot for one
// automation run into a job workspace.
type CheckoutMaterializer interface {
	Materialize(ctx context.Context, req CheckoutRequest) (CheckoutResult, error)
}

// CheckoutRequest describes the current-run repository snapshot that a
// agentteam/checkout step may materialize.
type CheckoutRequest struct {
	WorkspaceID        string
	RunID              string
	JobRunID           string
	RepositoryFullName string
	CommitSHA          string
	ContentID          string
	ContentVersionID   string
	PrincipalID        string
	Destination        string
	Clean              bool
	MaxBytes           int64
	MaxFiles           int
}

// CheckoutResult summarizes a completed materialization.
type CheckoutResult struct {
	Strategy string
	Files    int
	Bytes    int64
	Duration time.Duration
}
