orchestration

package
v0.0.0-...-dac94cf Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(sessions session.Service) *Manager

func (*Manager) Cancel

func (m *Manager) Cancel(workerID string) error

func (*Manager) Get

func (m *Manager) Get(workerID string) (Worker, bool)

func (*Manager) List

func (m *Manager) List() []Worker

func (*Manager) ListByParent

func (m *Manager) ListByParent(parentSessionID string) []Worker

func (*Manager) ListByRoot

func (m *Manager) ListByRoot(rootWorkerID string) []Worker

func (*Manager) ListByTeam

func (m *Manager) ListByTeam(teamName string) []Worker

func (*Manager) MarkHeartbeat

func (m *Manager) MarkHeartbeat(workerID string)

func (*Manager) RecordSignal

func (m *Manager) RecordSignal(workerID string, wakeState WorkerWakeState)

func (*Manager) SetCommitment

func (m *Manager) SetCommitment(workerID string, scope WorkerStateScope, commitment WorkerCommitmentState)

func (*Manager) SetRunner

func (m *Manager) SetRunner(runner Runner)

func (*Manager) Spawn

func (m *Manager) Spawn(ctx context.Context, params SpawnParams) (Worker, error)

func (*Manager) Wait

func (m *Manager) Wait(ctx context.Context, workerID string) (Worker, error)

type RunRequest

type RunRequest struct {
	Prompt  string
	Profile string
}

type RunResult

type RunResult struct {
	Content string
	Error   error
}

type Runner

type Runner func(ctx context.Context, sessionID string, request RunRequest) (<-chan RunResult, error)

type SpawnParams

type SpawnParams struct {
	ParentSessionID string
	ParentWorkerID  string
	Name            string
	TeamName        string
	RoleName        string
	Kind            WorkerKind
	Profile         string
	Prompt          string
	Title           string
	WorkspaceMode   string
	StateScope      WorkerStateScope
	CommitmentState WorkerCommitmentState
}

type Worker

type Worker struct {
	ID              string                `json:"id"`
	SessionID       string                `json:"sessionId"`
	ParentSessionID string                `json:"parentSessionId"`
	ParentWorkerID  string                `json:"parentWorkerId,omitempty"`
	RootWorkerID    string                `json:"rootWorkerId,omitempty"`
	Lineage         []string              `json:"lineage,omitempty"`
	LineageDepth    int                   `json:"lineageDepth,omitempty"`
	Name            string                `json:"name,omitempty"`
	TeamName        string                `json:"teamName,omitempty"`
	RoleName        string                `json:"roleName,omitempty"`
	Kind            WorkerKind            `json:"kind"`
	Profile         string                `json:"profile,omitempty"`
	Status          WorkerStatus          `json:"status"`
	StateScope      WorkerStateScope      `json:"stateScope,omitempty"`
	CommitmentState WorkerCommitmentState `json:"commitmentState,omitempty"`
	WorkspaceMode   string                `json:"workspaceMode,omitempty"`
	WakeState       WorkerWakeState       `json:"wakeState,omitempty"`
	Prompt          string                `json:"prompt"`
	Result          string                `json:"result,omitempty"`
	Error           string                `json:"error,omitempty"`
	StartedAt       int64                 `json:"startedAt,omitempty"`
	LastSignalAt    int64                 `json:"lastSignalAt,omitempty"`
	LastHeartbeatAt int64                 `json:"lastHeartbeatAt,omitempty"`
	CreatedAt       int64                 `json:"createdAt"`
	UpdatedAt       int64                 `json:"updatedAt"`
	CompletedAt     int64                 `json:"completedAt,omitempty"`
}

type WorkerCommitmentState

type WorkerCommitmentState string
const (
	WorkerCommitmentStateLocal     WorkerCommitmentState = "local"
	WorkerCommitmentStatePending   WorkerCommitmentState = "pending"
	WorkerCommitmentStateCommitted WorkerCommitmentState = "committed"
	WorkerCommitmentStateRejected  WorkerCommitmentState = "rejected"
)

type WorkerKind

type WorkerKind string
const (
	WorkerKindSubagent WorkerKind = "subagent"
	WorkerKindTeammate WorkerKind = "teammate"
)

type WorkerStateScope

type WorkerStateScope string
const (
	WorkerStateScopeLocal     WorkerStateScope = "local"
	WorkerStateScopeCommitted WorkerStateScope = "committed"
)

type WorkerStatus

type WorkerStatus string
const (
	WorkerStatusQueued    WorkerStatus = "queued"
	WorkerStatusRunning   WorkerStatus = "running"
	WorkerStatusCompleted WorkerStatus = "completed"
	WorkerStatusFailed    WorkerStatus = "failed"
	WorkerStatusCanceled  WorkerStatus = "canceled"
)

type WorkerWakeState

type WorkerWakeState string
const (
	WorkerWakeStateWaiting   WorkerWakeState = "waiting"
	WorkerWakeStateActive    WorkerWakeState = "active"
	WorkerWakeStateQuiescent WorkerWakeState = "quiescent"
)

Jump to

Keyboard shortcuts

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