coordinator

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonRunEnqueued        = "task_run_enqueued"
	ReasonRecovery           = "recovery"
	ReasonCoordinatorStopped = "coordinator_stopped"

	DecisionBootstrap        = "bootstrap"
	DecisionDisabled         = "disabled"
	DecisionGlobalScope      = "global_scope"
	DecisionMissingWorkspace = "missing_workspace"
	DecisionMissingChannel   = "missing_coordination_channel"
	DecisionNonExecutableRun = "non_executable_run"
	DecisionTaskRunMismatch  = "task_run_mismatch"
	DecisionExisting         = "existing_coordinator"
	DecisionDenied           = "denied"
	DecisionFailed           = "failed"
)

Variables

This section is empty.

Functions

func ExecutableRunStatuses

func ExecutableRunStatuses() []taskpkg.RunStatus

ExecutableRunStatuses returns every open run state considered by recovery.

func HealthySession

func HealthySession(info *session.Info, workspaceID string, now time.Time) bool

HealthySession reports whether a session snapshot is an active coordinator for the workspace.

func IsExecutableRunStatus

func IsExecutableRunStatus(status taskpkg.RunStatus) bool

IsExecutableRunStatus reports whether a run still represents executable work that may need coordinator orchestration.

func Lineage

Lineage builds root lineage metadata for a managed coordinator session.

func OperationalMessageKinds

func OperationalMessageKinds() []string

OperationalMessageKinds returns the coordination-channel message kinds a coordinator may use for worker conversation.

func PermissionPolicy

func PermissionPolicy(channelIDs ...string) store.SessionPermissionPolicy

PermissionPolicy returns the restricted coordinator root permission policy.

func PromptOverlay

func PromptOverlay(input PromptInput) string

PromptOverlay assembles the coordinator's first-run situation and available public API surface.

func SpawnRoleAllowed

func SpawnRoleAllowed(role string) bool

SpawnRoleAllowed reports whether a coordinator may request the given child role through the public safe-spawn API.

func ToolAllowed

func ToolAllowed(tool string) bool

ToolAllowed reports whether a concrete tool/action is coordinator-safe.

func ToolAllowlist

func ToolAllowlist() []string

ToolAllowlist returns the orchestration-safe tool surface granted to coordinator sessions.

Types

type Decision

type Decision struct {
	ShouldBootstrap       bool
	Reason                string
	WorkspaceID           string
	TaskID                string
	RunID                 string
	WorkflowID            string
	CoordinationChannelID string
}

Decision describes whether a task run is eligible to bootstrap a workspace coordinator.

func DecideBootstrap

func DecideBootstrap(task taskpkg.Task, run taskpkg.Run, cfg aghconfig.CoordinatorConfig) Decision

DecideBootstrap evaluates the mechanical coordinator bootstrap rules. It does not check for already-running coordinator sessions; that singleton check belongs to the daemon runtime.

type PromptInput

type PromptInput struct {
	WorkspaceID           string
	TaskID                string
	RunID                 string
	WorkflowID            string
	CoordinationChannelID string
}

PromptInput captures the first-run situation given to a coordinator session.

Jump to

Keyboard shortcuts

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