run

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, jobs []model.Job, runArtifacts model.RunArtifacts, cfg *model.RuntimeConfig) error

Execute runs the prepared jobs and manages shutdown, retries, and summaries.

func ExecuteExec added in v0.1.9

func ExecuteExec(ctx context.Context, cfg *model.RuntimeConfig) error

ExecuteExec runs one headless-or-TUI exec turn with optional persistence and ACP resume.

func IsExecErrorReported added in v0.1.9

func IsExecErrorReported(err error) bool

IsExecErrorReported returns true when a failed exec already emitted its JSON failure payload.

func WriteExecJSONFailure added in v0.1.9

func WriteExecJSONFailure(dst io.Writer, runID string, err error) error

WriteExecJSONFailure emits a single JSON failure object to stdout/stderr-neutral writers.

Types

type PersistedExecRun added in v0.1.9

type PersistedExecRun struct {
	Version              int         `json:"version"`
	Mode                 string      `json:"mode"`
	RunID                string      `json:"run_id"`
	Status               string      `json:"status"`
	WorkspaceRoot        string      `json:"workspace_root"`
	IDE                  string      `json:"ide"`
	Model                string      `json:"model"`
	ReasoningEffort      string      `json:"reasoning_effort"`
	AccessMode           string      `json:"access_mode"`
	AddDirs              []string    `json:"add_dirs,omitempty"`
	CreatedAt            time.Time   `json:"created_at"`
	UpdatedAt            time.Time   `json:"updated_at"`
	TurnCount            int         `json:"turn_count"`
	ACPSessionID         string      `json:"acp_session_id,omitempty"`
	AgentSessionID       string      `json:"agent_session_id,omitempty"`
	LoadSessionSupported bool        `json:"load_session_supported,omitempty"`
	Usage                model.Usage `json:"usage,omitempty"`
	LastError            string      `json:"last_error,omitempty"`
	EventsPath           string      `json:"events_path,omitempty"`
	TurnsDir             string      `json:"turns_dir,omitempty"`
}

PersistedExecRun is the persisted run contract for resumable exec sessions.

func LoadPersistedExecRun added in v0.1.9

func LoadPersistedExecRun(workspaceRoot, runID string) (PersistedExecRun, error)

LoadPersistedExecRun reads one persisted exec run from .compozy/runs/<run-id>/run.json.

type PreflightConfig added in v0.1.7

type PreflightConfig struct {
	TasksDir       string
	Registry       *tasks.TypeRegistry
	IsInteractive  func() bool
	Force          bool
	SkipValidation bool
	Stderr         io.Writer
	FormInput      io.Reader
	FormOutput     io.Writer
	ClipboardWrite func(string) error
	Logger         *slog.Logger
	ValidationFn   func(context.Context, string, *tasks.TypeRegistry) (tasks.Report, error)
	ValidationForm func(tasks.Report, *tasks.TypeRegistry, io.Writer) (PreflightDecision, error)
}

type PreflightDecision added in v0.1.7

type PreflightDecision string
const (
	PreflightOK        PreflightDecision = "ok"
	PreflightContinued PreflightDecision = "continued"
	PreflightAborted   PreflightDecision = "aborted"
	PreflightSkipped   PreflightDecision = "skipped"
	PreflightForced    PreflightDecision = "forced"
)

func PreflightCheck added in v0.1.7

func PreflightCheck(
	ctx context.Context,
	tasksDir string,
	registry *tasks.TypeRegistry,
	isInteractive func() bool,
	force bool,
) (PreflightDecision, error)

func PreflightCheckConfig added in v0.1.7

func PreflightCheckConfig(ctx context.Context, cfg PreflightConfig) (PreflightDecision, error)

type SessionMetaState added in v0.1.3

type SessionMetaState struct {
	CurrentModeID     string
	AvailableCommands []model.SessionAvailableCommand
	Status            model.SessionStatus
}

type SessionPlanState added in v0.1.3

type SessionPlanState struct {
	Entries      []model.SessionPlanEntry
	PendingCount int
	RunningCount int
	DoneCount    int
}

type SessionViewSnapshot added in v0.1.3

type SessionViewSnapshot struct {
	Revision int
	Entries  []TranscriptEntry
	Plan     SessionPlanState
	Session  SessionMetaState
}

type TranscriptEntry added in v0.1.3

type TranscriptEntry struct {
	ID            string
	Kind          transcriptEntryKind
	Title         string
	Preview       string
	ToolCallID    string
	ToolCallState model.ToolCallState
	Blocks        []model.ContentBlock
}

Jump to

Keyboard shortcuts

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