package actionsrunner

import "time"

// RegistrationBootstrap is the response used by config.sh to select broker V2.
type RegistrationBootstrap struct {
	BrokerURL string
}

// RunnerRegistration represents the configured official runner OAuth client.
type RunnerRegistration struct {
	OfficialRunnerID int64
	RunnerName       string
	ClientID         string
	BrokerURL        string
	OAuthURL         string
}

// RegisterRunnerInput is the official runner registration body.
type RegisterRunnerInput struct {
	Name      string
	PublicKey string
}

// OAuthToken is the OAuth token response consumed by the official runner.
type OAuthToken struct {
	AccessToken string
	ExpiresIn   int
}

// BrokerSession is the official broker session response.
type BrokerSession struct {
	SessionID string
	OwnerName string
}

// TaskAgentMessage is the broker message shape returned to the official runner.
type TaskAgentMessage struct {
	MessageID   int64
	MessageType string
	Body        string
}

// AcquireJobRequest is the run-service acquirejob request.
type AcquireJobRequest struct {
	JobMessageID  string
	RunServiceURL string
}

// RenewJobRequest is the run-service renewjob request.
type RenewJobRequest struct {
	JobID string
}

// RenewJobResponse is the run-service renewjob response.
type RenewJobResponse struct {
	LockedUntil time.Time
}

// CompleteJobRequest is the run-service completejob request.
type CompleteJobRequest struct {
	JobID       string
	Conclusion  any
	Outputs     map[string]any
	StepResults []map[string]any
	Annotations []map[string]any
	Telemetry   []map[string]any
}
