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

durable

package
v0.13.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	QueueAgentNativeInteractive = "agent-native-interactive"
	QueueAgentNativeAutonomous  = "agent-native-autonomous"
	QueueAgentNativeCoding      = "agent-native-coding"
	QueueAutomation             = "automation-default"
	// QueueAgentA2A carries external A2A agent turns. They mostly wait on a
	// remote agent, so they get their own lane instead of holding automation
	// slots for up to two hours.
	QueueAgentA2A = "agent-a2a"

	WorkflowSignalResume  = "ResumeRun"
	WorkflowSignalPause   = "PauseRun"
	WorkflowSignalApprove = "ApproveRun"
	WorkflowSignalHandoff = "HandoffRun"
	WorkflowSignalMessage = "RunMessage"
)
View Source
const ExecutionHeartbeatInterval = 5 * time.Second

Temporal delivers cancellation to a running activity on a server heartbeat. Keep execution heartbeats frequent so a manual pause interrupts an active turn promptly.

Variables

This section is empty.

Functions

func AgentRunWorkflow

func AgentRunWorkflow(ctx workflow.Context, input AgentRunWorkflowInput) error

func QueueForRuntime

func QueueForRuntime(runtimeKind, invocationMode string) string

func RegisterAgentRunWorker

func RegisterAgentRunWorker(w tworker.Worker, activities *AgentRunActivities)

func TaskQueueName

func TaskQueueName(baseName string) string

func ValidateLocalWorkspaceStore added in v0.13.0

func ValidateLocalWorkspaceStore(store interface{}) error

func WorkflowIDForRun

func WorkflowIDForRun(runID string) string

Types

type AgentRunActivities

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

func NewAgentRunActivities

func NewAgentRunActivities(store agentcore.Store, runner *engine.Engine) *AgentRunActivities

func (*AgentRunActivities) CleanupLocalWorkspaceActivity added in v0.13.0

func (a *AgentRunActivities) CleanupLocalWorkspaceActivity(ctx context.Context, appID, runID, session string) error

func (*AgentRunActivities) CleanupTerminalWorkspaceActivity added in v0.11.2

func (a *AgentRunActivities) CleanupTerminalWorkspaceActivity(ctx context.Context, appID, runID string) error

func (*AgentRunActivities) ExecuteLocalRunActivity added in v0.13.0

func (a *AgentRunActivities) ExecuteLocalRunActivity(ctx context.Context, appID, runID, session string) (ExecuteRunResult, error)

func (*AgentRunActivities) ExecuteRunActivity

func (a *AgentRunActivities) ExecuteRunActivity(ctx context.Context, appID, runID string) (ExecuteRunResult, error)

func (*AgentRunActivities) MarkRunFailedActivity

func (a *AgentRunActivities) MarkRunFailedActivity(ctx context.Context, appID, runID, message string) error

func (*AgentRunActivities) MarkRunManuallyPausedActivity added in v0.13.2

func (a *AgentRunActivities) MarkRunManuallyPausedActivity(ctx context.Context, appID, runID string) (bool, error)

MarkRunManuallyPausedActivity persists the pause after execution has stopped.

func (*AgentRunActivities) PrepareLocalRunActivity added in v0.13.0

func (a *AgentRunActivities) PrepareLocalRunActivity(ctx context.Context, appID, runID, session string) error

func (*AgentRunActivities) PrepareRunActivity

func (a *AgentRunActivities) PrepareRunActivity(ctx context.Context, appID, runID string) error

type AgentRunWorkflowInput

type AgentRunWorkflowInput struct {
	AppID              string `json:"app_id"`
	RunID              string `json:"run_id"`
	EphemeralWorkspace bool   `json:"ephemeral_workspace,omitempty"`
}

type ExecuteRunResult

type ExecuteRunResult struct {
	WaitForApproval   bool `json:"wait_for_approval"`
	AwaitingInput     bool `json:"awaiting_input"`
	AwaitingAuth      bool `json:"awaiting_auth"`
	ContinueExecution bool `json:"continue_execution"`
}

type QueueConfig

type QueueConfig struct {
	Name        string
	Concurrency int
}

QueueConfig limits are per worker process; shared capacity scales with replicas.

func ExecutionQueues added in v0.11.2

func ExecutionQueues() []QueueConfig

ExecutionQueues serves the execution lane. Landlock confines every spawned command to its run directory, while the run-level workspace lock fences retries that land on another replica. Keep this bounded because concurrent builds still share the pod's CPU and memory cgroup.

func SharedQueues

func SharedQueues() []QueueConfig

func WorkerQueues

func WorkerQueues(coding bool) []QueueConfig

WorkerQueues keeps execution workers separate from the default shared workloads.

func WorkerQueuesForRole added in v0.11.2

func WorkerQueuesForRole(role WorkerRole) []QueueConfig

WorkerQueuesForRole returns the queues a worker process polls for its role.

type RunEngine

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

func NewRunEngine

func NewRunEngine(client tclient.Client) *RunEngine

func (*RunEngine) CancelRun

func (e *RunEngine) CancelRun(ctx context.Context, run *agentcore.AgentRun) error

func (*RunEngine) CheckCodingAdmission

func (e *RunEngine) CheckCodingAdmission(ctx context.Context) error

CheckCodingAdmission requires a live coding workflow poller in this namespace.

func (*RunEngine) DescribeRun

func (e *RunEngine) DescribeRun(ctx context.Context, run *agentcore.AgentRun) (*engine.RunExecutionInfo, error)

func (*RunEngine) InspectRun

func (e *RunEngine) InspectRun(ctx context.Context, run *agentcore.AgentRun) (string, error)

func (*RunEngine) PauseRun added in v0.13.2

func (e *RunEngine) PauseRun(ctx context.Context, run *agentcore.AgentRun) error

PauseRun asks the workflow to cancel its current activity and retain the run.

func (*RunEngine) ResumeRun

func (e *RunEngine) ResumeRun(ctx context.Context, run *agentcore.AgentRun, payload engine.ResumePayload) error

func (*RunEngine) StartRun

func (e *RunEngine) StartRun(ctx context.Context, run *agentcore.AgentRun) error

type RunMessageSignal

type RunMessageSignal struct {
	Content string `json:"content"`
}

type RunResumeSignal

type RunResumeSignal struct {
	Intent          string          `json:"intent"`
	Content         string          `json:"content,omitempty"`
	ResponsePayload json.RawMessage `json:"response_payload,omitempty"`
	ExternalActorID string          `json:"external_actor_id,omitempty"`
	ResumeID        string          `json:"resume_id,omitempty"`
	InteractionID   string          `json:"interaction_id,omitempty"`
}

type WorkerRole added in v0.11.2

type WorkerRole string

WorkerRole selects which task queues one worker process polls.

const (
	// WorkerRoleShared polls the interactive, autonomous and automation queues.
	WorkerRoleShared WorkerRole = "shared"
	// WorkerRoleExecution polls only the execution (coding) queue.
	WorkerRoleExecution WorkerRole = "execution"
	// WorkerRoleAll polls every queue from one process. Intended for
	// single-tenant installs that accept shared execution and chat workloads.
	WorkerRoleAll WorkerRole = "all"
)

Jump to

Keyboard shortcuts

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