Help us shape the future of Go! Take the 2026 Go Developer Survey

run

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActiveRunsPathURI = "/v1/api/agently/run/active/active"
View Source
var RunRowsPathURI = "/v1/api/agently/run/{id}"
View Source
var RunStepsPathURI = "/v1/api/agently/run/steps/steps"
View Source
var StaleRunsPathURI = "/v1/api/agently/run/stale/stale"

Functions

This section is empty.

Types

type ActiveRunsInput

type ActiveRunsInput struct {
	TurnId         string
	ConversationId string
	Has            *ActiveRunsInputHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

type ActiveRunsInputHas

type ActiveRunsInputHas struct {
	TurnId         bool
	ConversationId bool
}

type ActiveRunsOutput

type ActiveRunsOutput struct {
	response.Status `json:",omitempty"`
	Data            []*ActiveRunsView
	Metrics         response.Metrics
}

type ActiveRunsView

type ActiveRunsView = read.RunRowsView

ActiveRunsView uses the canonical DQL reader shape.

type MutableRunView

type MutableRunView struct {
	Id                    string     `sqlx:"id,primaryKey" validate:"required"`
	TurnID                *string    `sqlx:"turn_id" json:",omitempty"`
	ScheduleID            *string    `sqlx:"schedule_id" json:",omitempty"`
	ConversationID        *string    `sqlx:"conversation_id" json:",omitempty"`
	ConversationKind      *string    `sqlx:"conversation_kind" json:",omitempty"`
	Attempt               *int       `sqlx:"attempt" json:",omitempty"`
	ResumedFromRunID      *string    `sqlx:"resumed_from_run_id" json:",omitempty"`
	Status                string     `sqlx:"status" validate:"required"`
	ErrorCode             *string    `sqlx:"error_code" json:",omitempty"`
	ErrorMessage          *string    `sqlx:"error_message" json:",omitempty"`
	Iteration             *int       `sqlx:"iteration" json:",omitempty"`
	MaxIterations         *int       `sqlx:"max_iterations" json:",omitempty"`
	CheckpointResponseID  *string    `sqlx:"checkpoint_response_id" json:",omitempty"`
	CheckpointMessageID   *string    `sqlx:"checkpoint_message_id" json:",omitempty"`
	CheckpointData        *string    `sqlx:"checkpoint_data" json:",omitempty"`
	AgentID               *string    `sqlx:"agent_id" json:",omitempty"`
	ModelProvider         *string    `sqlx:"model_provider" json:",omitempty"`
	Model                 *string    `sqlx:"model" json:",omitempty"`
	WorkerID              *string    `sqlx:"worker_id" json:",omitempty"`
	WorkerPID             *int       `sqlx:"worker_pid" json:",omitempty"`
	WorkerHost            *string    `sqlx:"worker_host" json:",omitempty"`
	LeaseOwner            *string    `sqlx:"lease_owner" json:",omitempty"`
	LeaseUntil            *time.Time `sqlx:"lease_until" json:",omitempty"`
	LastHeartbeatAt       *time.Time `sqlx:"last_heartbeat_at" json:",omitempty"`
	SecurityContext       *string    `sqlx:"security_context" json:",omitempty"`
	UserCredURL           *string    `sqlx:"user_cred_url" json:",omitempty"`
	EffectiveUserID       *string    `sqlx:"effective_user_id" json:",omitempty"`
	AuthAuthority         *string    `sqlx:"auth_authority" json:",omitempty"`
	AuthAudience          *string    `sqlx:"auth_audience" json:",omitempty"`
	HeartbeatIntervalSec  *int       `sqlx:"heartbeat_interval_sec" json:",omitempty"`
	ScheduledFor          *time.Time `sqlx:"scheduled_for" json:",omitempty"`
	PreconditionRanAt     *time.Time `sqlx:"precondition_ran_at" json:",omitempty"`
	PreconditionPassed    *int       `sqlx:"precondition_passed" json:",omitempty"`
	PreconditionResult    *string    `sqlx:"precondition_result" json:",omitempty"`
	UsagePromptTokens     *int       `sqlx:"usage_prompt_tokens" json:",omitempty"`
	UsageCompletionTokens *int       `sqlx:"usage_completion_tokens" json:",omitempty"`
	UsageTotalTokens      *int       `sqlx:"usage_total_tokens" json:",omitempty"`
	UsageCost             *float64   `sqlx:"usage_cost" json:",omitempty"`
	CreatedAt             *time.Time `sqlx:"created_at" json:",omitempty"`
	UpdatedAt             *time.Time `sqlx:"updated_at" json:",omitempty"`
	StartedAt             *time.Time `sqlx:"started_at" json:",omitempty"`
	CompletedAt           *time.Time `sqlx:"completed_at" json:",omitempty"`
	Has                   *RunHas    `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
	// Condition, when set, turns this sparse update into an atomic
	// compare-and-set (see RunPatchCondition). It is not a column.
	Condition *RunPatchCondition `sqlx:"-" diff:"-" json:",omitempty"`
}

func NewMutableRunView

func NewMutableRunView(opts ...MutableRunViewOption) *MutableRunView

func (*MutableRunView) SetAgentID

func (r *MutableRunView) SetAgentID(v string)

func (*MutableRunView) SetAttempt

func (r *MutableRunView) SetAttempt(v int)

func (*MutableRunView) SetCheckpointData

func (r *MutableRunView) SetCheckpointData(v string)

func (*MutableRunView) SetCheckpointMessageID

func (r *MutableRunView) SetCheckpointMessageID(v string)

func (*MutableRunView) SetCheckpointResponseID

func (r *MutableRunView) SetCheckpointResponseID(v string)

func (*MutableRunView) SetCompletedAt

func (r *MutableRunView) SetCompletedAt(v time.Time)

func (*MutableRunView) SetCondition

func (r *MutableRunView) SetCondition(v RunPatchCondition)

SetCondition attaches expected-value criteria so the PATCH only applies when the stored run still matches them.

func (*MutableRunView) SetConversationID

func (r *MutableRunView) SetConversationID(v string)

func (*MutableRunView) SetConversationKind

func (r *MutableRunView) SetConversationKind(v string)

func (*MutableRunView) SetCreatedAt

func (r *MutableRunView) SetCreatedAt(v time.Time)

func (*MutableRunView) SetEffectiveUserID

func (r *MutableRunView) SetEffectiveUserID(v string)

func (*MutableRunView) SetErrorCode

func (r *MutableRunView) SetErrorCode(v string)

func (*MutableRunView) SetErrorMessage

func (r *MutableRunView) SetErrorMessage(v string)

func (*MutableRunView) SetHeartbeatIntervalSec

func (r *MutableRunView) SetHeartbeatIntervalSec(v int)

func (*MutableRunView) SetId

func (r *MutableRunView) SetId(v string)

func (*MutableRunView) SetIteration

func (r *MutableRunView) SetIteration(v int)

func (*MutableRunView) SetLastHeartbeatAt

func (r *MutableRunView) SetLastHeartbeatAt(v time.Time)

func (*MutableRunView) SetLeaseOwner

func (r *MutableRunView) SetLeaseOwner(v string)

func (*MutableRunView) SetLeaseUntil

func (r *MutableRunView) SetLeaseUntil(v time.Time)

func (*MutableRunView) SetMaxIterations

func (r *MutableRunView) SetMaxIterations(v int)

func (*MutableRunView) SetModel

func (r *MutableRunView) SetModel(v string)

func (*MutableRunView) SetModelProvider

func (r *MutableRunView) SetModelProvider(v string)

func (*MutableRunView) SetPreconditionPassed

func (r *MutableRunView) SetPreconditionPassed(v int)

func (*MutableRunView) SetPreconditionRanAt

func (r *MutableRunView) SetPreconditionRanAt(v time.Time)

func (*MutableRunView) SetPreconditionResult

func (r *MutableRunView) SetPreconditionResult(v string)

func (*MutableRunView) SetResumedFromRunID

func (r *MutableRunView) SetResumedFromRunID(v string)

func (*MutableRunView) SetScheduleID

func (r *MutableRunView) SetScheduleID(v string)

func (*MutableRunView) SetScheduledFor

func (r *MutableRunView) SetScheduledFor(v time.Time)

func (*MutableRunView) SetSecurityContext

func (r *MutableRunView) SetSecurityContext(v string)

func (*MutableRunView) SetStartedAt

func (r *MutableRunView) SetStartedAt(v time.Time)

func (*MutableRunView) SetStatus

func (r *MutableRunView) SetStatus(v string)

func (*MutableRunView) SetTurnID

func (r *MutableRunView) SetTurnID(v string)

func (*MutableRunView) SetUpdatedAt

func (r *MutableRunView) SetUpdatedAt(v time.Time)

func (*MutableRunView) SetUsageCompletionTokens

func (r *MutableRunView) SetUsageCompletionTokens(v int)

func (*MutableRunView) SetUsageCost

func (r *MutableRunView) SetUsageCost(v float64)

func (*MutableRunView) SetUsagePromptTokens

func (r *MutableRunView) SetUsagePromptTokens(v int)

func (*MutableRunView) SetUsageTotalTokens

func (r *MutableRunView) SetUsageTotalTokens(v int)

func (*MutableRunView) SetUserCredURL

func (r *MutableRunView) SetUserCredURL(v string)

func (*MutableRunView) SetWorkerHost

func (r *MutableRunView) SetWorkerHost(v string)

func (*MutableRunView) SetWorkerID

func (r *MutableRunView) SetWorkerID(v string)

func (*MutableRunView) SetWorkerPID

func (r *MutableRunView) SetWorkerPID(v int)

type MutableRunViewOption

type MutableRunViewOption func(*MutableRunView)

func WithRunConversationID

func WithRunConversationID(v string) MutableRunViewOption

func WithRunID

func WithRunID(v string) MutableRunViewOption

func WithRunIteration

func WithRunIteration(v int) MutableRunViewOption

func WithRunStatus

func WithRunStatus(v string) MutableRunViewOption

func WithRunTurnID

func WithRunTurnID(v string) MutableRunViewOption

type MutableRunViews

type MutableRunViews struct {
	Runs []*MutableRunView
}

func NewMutableRunViews

func NewMutableRunViews(rows ...*MutableRunView) *MutableRunViews

type RunHas

type RunHas struct {
	Id                    bool
	TurnID                bool
	ScheduleID            bool
	ConversationID        bool
	ConversationKind      bool
	Attempt               bool
	ResumedFromRunID      bool
	Status                bool
	ErrorCode             bool
	ErrorMessage          bool
	Iteration             bool
	MaxIterations         bool
	CheckpointResponseID  bool
	CheckpointMessageID   bool
	CheckpointData        bool
	AgentID               bool
	ModelProvider         bool
	Model                 bool
	WorkerID              bool
	WorkerPID             bool
	WorkerHost            bool
	LeaseOwner            bool
	LeaseUntil            bool
	LastHeartbeatAt       bool
	HeartbeatIntervalSec  bool
	SecurityContext       bool
	UserCredURL           bool
	EffectiveUserID       bool
	ScheduledFor          bool
	PreconditionRanAt     bool
	PreconditionPassed    bool
	PreconditionResult    bool
	UsagePromptTokens     bool
	UsageCompletionTokens bool
	UsageTotalTokens      bool
	UsageCost             bool
	CreatedAt             bool
	UpdatedAt             bool
	StartedAt             bool
	CompletedAt           bool
}

type RunPatchCondition

type RunPatchCondition struct {
	// Status is the expected current run status (required for claim shapes).
	Status string `json:",omitempty"`
	// LeaseOwner is the expected current lease owner. nil means "no owner
	// criterion" (legacy rows with NULL lease_owner); it must be combined
	// with Status and Attempt.
	LeaseOwner *string `json:",omitempty"`
	// Attempt is the expected current attempt.
	Attempt *int `json:",omitempty"`
}

RunPatchCondition carries expected values for an atomic sparse run update. The canonical generated writer evaluates these criteria in the database.

type RunRowsInput

type RunRowsInput struct {
	Id               string
	TurnId           string
	ConversationId   string
	ScheduleId       string
	WorkerId         string
	RunStatus        string
	ExcludeStatuses  []string
	DefaultPredicate string
	Has              *RunRowsInputHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

func InputFromContext

func InputFromContext(ctx context.Context) *RunRowsInput

type RunRowsInputHas

type RunRowsInputHas struct {
	Id               bool
	TurnId           bool
	ConversationId   bool
	ScheduleId       bool
	WorkerId         bool
	RunStatus        bool
	ExcludeStatuses  bool
	DefaultPredicate bool
}

type RunRowsOutput

type RunRowsOutput struct {
	response.Status `json:",omitempty"`
	Data            []*RunRowsView
	Metrics         response.Metrics
}

type RunRowsView

type RunRowsView = read.RunRowsView

RunRowsView uses the canonical DQL reader shape.

type RunStepsInput

type RunStepsInput struct {
	RunID        string
	Iteration    int
	StepTypes    []string
	CursorBefore string
	CursorAfter  string
	Has          *RunStepsInputHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

type RunStepsInputHas

type RunStepsInputHas struct {
	RunID        bool
	Iteration    bool
	StepTypes    bool
	CursorBefore bool
	CursorAfter  bool
}

type RunStepsOutput

type RunStepsOutput struct {
	response.Status `json:",omitempty"`
	Data            []*RunStepsView
	Metrics         response.Metrics
}

type RunStepsView

type RunStepsView = read.RunStepsView

type StaleRunsInput

type StaleRunsInput struct {
	HeartbeatBefore    time.Time
	WorkerHost         string
	LeaseExpiredBefore time.Time
	ActivityAfter      time.Time
	ConversationKind   string
	RootInteractive    bool
	Has                *StaleRunsInputHas `setMarker:"true" format:"-" sqlx:"-" diff:"-" json:"-"`
}

type StaleRunsInputHas

type StaleRunsInputHas struct {
	HeartbeatBefore    bool
	WorkerHost         bool
	LeaseExpiredBefore bool
	ActivityAfter      bool
	ConversationKind   bool
	RootInteractive    bool
}

type StaleRunsOutput

type StaleRunsOutput struct {
	response.Status `json:",omitempty"`
	Data            []*StaleRunsView
	Metrics         response.Metrics
}

type StaleRunsView

type StaleRunsView = read.RunRowsView

StaleRunsView uses the canonical DQL reader shape.

Jump to

Keyboard shortcuts

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