cmd

package
v0.0.0-...-9b65b54 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitSuccess        = 0
	ExitGeneral        = 1
	ExitUsage          = 2
	ExitDatabase       = 3
	ExitGit            = 4
	ExitPartialFailure = 5
	ExitTotalFailure   = 6
	ExitPreflight      = 7
)

Exit codes for structured CLI error reporting.

Variables

This section is empty.

Functions

func ExitCodeFor

func ExitCodeFor(err error) int

ExitCodeFor extracts the exit code from an error. OrchestraError uses its typed code; other errors fall back to heuristic string matching.

func NewAbTestCmd

func NewAbTestCmd() *cobra.Command

NewAbTestCmd creates the ab-test subcommand.

func NewAuditCmd

func NewAuditCmd() *cobra.Command

NewAuditCmd creates the audit subcommand.

func NewAutoCmd

func NewAutoCmd() *cobra.Command

NewAutoCmd creates the auto subcommand (autonomous multi-cycle mode).

func NewCacheCmd

func NewCacheCmd() *cobra.Command

NewCacheCmd creates the cache subcommand for plan cache management.

func NewConductorRunCmd

func NewConductorRunCmd() *cobra.Command

NewConductorRunCmd creates the hidden conductor-run command. This is the detached process that actually runs the conductor lifecycle. It is spawned by `orchestra go` and not intended for direct user invocation.

func NewDaemonCmd

func NewDaemonCmd() *cobra.Command

NewDaemonCmd creates the daemon command group with all subcommands.

func NewDashboardCmd

func NewDashboardCmd() *cobra.Command

NewDashboardCmd creates the dashboard subcommand (TUI, default when no subcommand given).

func NewDecomposeCmd

func NewDecomposeCmd() *cobra.Command

NewDecomposeCmd creates the decompose subcommand.

func NewDockerCmd

func NewDockerCmd() *cobra.Command

NewDockerCmd creates the docker subcommand for runtime management.

func NewDoctorCmd

func NewDoctorCmd() *cobra.Command

NewDoctorCmd creates the doctor subcommand.

func NewEvalCmd

func NewEvalCmd() *cobra.Command

NewEvalCmd creates the eval subcommand with sub-commands for the evaluation framework.

func NewExecCmd

func NewExecCmd() *cobra.Command

NewExecCmd creates the exec subcommand (execute a multi-phase YAML spec).

func NewGenerateSpecCmd

func NewGenerateSpecCmd() *cobra.Command

NewGenerateSpecCmd creates the generate-spec subcommand.

func NewGoCmd

func NewGoCmd() *cobra.Command

NewGoCmd creates the go subcommand (orchestrate a goal).

func NewHealCmd

func NewHealCmd() *cobra.Command

NewHealCmd creates the heal subcommand with sub-commands for healing diagnostics.

func NewInitCmd

func NewInitCmd() *cobra.Command

NewInitCmd creates the init subcommand.

func NewMergeCmd

func NewMergeCmd() *cobra.Command

NewMergeCmd creates the merge subcommand. Both batch and FIFO merge paths run post-merge content clobber detection, logging merge_content_clobber events for files that shrink by >50%.

func NewMonitorCmd

func NewMonitorCmd() *cobra.Command

NewMonitorCmd creates the monitor subcommand tree.

func NewNewCmd

func NewNewCmd() *cobra.Command

NewNewCmd creates the new subcommand (greenfield project creation).

func NewProjectsCmd

func NewProjectsCmd() *cobra.Command

NewProjectsCmd creates the projects command group with all subcommands.

func NewQueueCmd

func NewQueueCmd() *cobra.Command

NewQueueCmd creates the queue command group with subcommands for managing the daemon's priority queue.

func NewReconcileCmd

func NewReconcileCmd() *cobra.Command

NewReconcileCmd creates the reconcile subcommand for post-session analysis.

func NewRecoverCmd

func NewRecoverCmd() *cobra.Command

NewRecoverCmd creates the recover subcommand for orphan session recovery.

func NewReleaseCmd

func NewReleaseCmd() *cobra.Command

NewReleaseCmd creates the release command for gated version tagging.

func NewResetCmd

func NewResetCmd() *cobra.Command

NewResetCmd creates the reset subcommand for full cleanup.

func NewRootCmd

func NewRootCmd() *cobra.Command

NewRootCmd creates the root orchestra command with all subcommands registered.

func NewSpawnCmd

func NewSpawnCmd() *cobra.Command

NewSpawnCmd creates the spawn subcommand tree.

func NewStatusCmd

func NewStatusCmd() *cobra.Command

NewStatusCmd creates the status subcommand.

func NewTokensCmd

func NewTokensCmd() *cobra.Command

NewTokensCmd creates the tokens subcommand.

func NewVersionCmd

func NewVersionCmd() *cobra.Command

NewVersionCmd creates the version subcommand.

func PrintFormattedError

func PrintFormattedError(w io.Writer, err error, verbose bool)

PrintFormattedError writes a human-readable structured error to w. Format: summary → detail → failed tasks → next steps.

func PrintJSONError

func PrintJSONError(w io.Writer, err error)

PrintJSONError writes a JSON-formatted error to w.

func TaskRecoverySuggestion

func TaskRecoverySuggestion(failureType string) string

TaskRecoverySuggestion maps agent failure classifier types to recovery commands.

Types

type ErrorCategory

type ErrorCategory string

ErrorCategory classifies errors for AI consumers.

const (
	CategoryInput     ErrorCategory = "input"
	CategoryTransient ErrorCategory = "transient"
	CategoryPartial   ErrorCategory = "partial"
	CategoryFatal     ErrorCategory = "fatal"
)

type OrchestraError

type OrchestraError struct {
	ExitCode    int           `json:"exit_code"`
	Category    ErrorCategory `json:"category"`
	Summary     string        `json:"error"`
	Detail      string        `json:"detail,omitempty"`
	Suggestions []string      `json:"suggestions,omitempty"`
	FailedTasks []TaskFailure `json:"failed_tasks,omitempty"`
	Cause       error         `json:"-"`
}

OrchestraError is a structured error carrying exit code, category, recovery suggestions, and per-task failure details.

func (*OrchestraError) Error

func (e *OrchestraError) Error() string

func (*OrchestraError) Unwrap

func (e *OrchestraError) Unwrap() error

type TaskFailure

type TaskFailure struct {
	TaskID      string `json:"task_id"`
	Role        string `json:"role,omitempty"`
	Title       string `json:"title,omitempty"`
	FailureType string `json:"failure_type,omitempty"`
	Suggestion  string `json:"suggestion,omitempty"`
}

TaskFailure captures per-task failure details for structured output.

Jump to

Keyboard shortcuts

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