Documentation
¶
Index ¶
- Constants
- func ActionRequiredError(format string, args ...any) error
- func AggregateExitCode(wholeCommand int, agents []AgentOutcome) int
- func ContextMismatchError(format string, args ...any) error
- func FilterMessages(items []listItem, opts FilterOptions) []listItem
- func GetExitCode(err error) int
- func NotFoundError(format string, args ...any) error
- func Run(args []string, version string) error
- func TimeoutError(format string, args ...any) error
- func UsageError(format string, args ...any) error
- func WithExitCode(code int, err error) error
- type AgentDisposition
- type AgentOutcome
- type CommandHandler
- type CommandInfo
- type ExitCodeError
- type FilterOptions
- type SessionContextError
- type TreeRelation
Constants ¶
const ( // ExitSuccess indicates the command completed successfully. ExitSuccess = 0 // ExitError indicates a general error occurred. ExitError = 1 // ExitUsage indicates invalid arguments or flags were provided. ExitUsage = 2 // ExitNotFound indicates a requested resource was not found // (message, config, agent, etc.). ExitNotFound = 3 // ExitTimeout indicates a timeout occurred (watch, monitor commands). ExitTimeout = 4 // ExitContextMismatch indicates a valid command was blocked because its // resolved mailbox root conflicts with the pinned AMQ session context. ExitContextMismatch = 5 // ExitActionRequired indicates the command cannot proceed without an // operator action (stale conversation token, Inspect unknown, untrusted // config digest, refused committed-command shape, blocked auto-rebind). ExitActionRequired = 6 )
Exit codes for CLI commands. These provide semantic meaning for scripting and automation.
Variables ¶
This section is empty.
Functions ¶
func ActionRequiredError ¶ added in v0.61.0
ActionRequiredError creates an error with ExitActionRequired code.
func AggregateExitCode ¶ added in v0.61.0
func AggregateExitCode(wholeCommand int, agents []AgentOutcome) int
AggregateExitCode implements the §11 launch/resume exit contract. A nonzero wholeCommand is a pre-launch failure and is returned as-is. Once per-agent work begins (wholeCommand == 0), the aggregate is the highest-precedence per-agent outcome: 6 > 4 > 1 > 0. Expected dispositions (disabled, unsupported, policy-consistent fresh) contribute 0 even when Code is set to a failure. A nonzero per-agent code outside {6, 4, 1, 0} fails closed as ExitError.
func ContextMismatchError ¶ added in v0.42.1
ContextMismatchError creates an error with ExitContextMismatch code.
func FilterMessages ¶ added in v0.9.6
func FilterMessages(items []listItem, opts FilterOptions) []listItem
FilterMessages returns items that match all provided filter options.
func GetExitCode ¶ added in v0.9.6
GetExitCode extracts the exit code from an error. Returns ExitSuccess (0) if err is nil. Returns the wrapped code if err is an *ExitCodeError. Returns ExitError (1) for all other errors.
func NotFoundError ¶ added in v0.9.6
NotFoundError creates an error with ExitNotFound code.
func TimeoutError ¶ added in v0.9.6
TimeoutError creates an error with ExitTimeout code.
func UsageError ¶ added in v0.9.6
UsageError creates an error with ExitUsage code.
func WithExitCode ¶ added in v0.9.6
WithExitCode wraps an error with a specific exit code.
Types ¶
type AgentDisposition ¶ added in v0.61.0
type AgentDisposition string
AgentDisposition classifies a per-agent launch/resume outcome.
const ( // AgentDispositionDisabled is an expected skip; it contributes 0. AgentDispositionDisabled AgentDisposition = "disabled" // AgentDispositionUnsupported is an expected capability skip; it contributes 0. AgentDispositionUnsupported AgentDisposition = "unsupported" // AgentDispositionFresh is a policy-consistent fresh start; it contributes 0. AgentDispositionFresh AgentDisposition = "fresh" )
type AgentOutcome ¶ added in v0.61.0
type AgentOutcome struct {
Code int
Disposition AgentDisposition
}
AgentOutcome is one agent's contribution to an aggregate process exit code.
type CommandHandler ¶ added in v0.23.0
CommandHandler is the function signature for command handlers in the registry.
type CommandInfo ¶ added in v0.23.0
type CommandInfo struct {
Name string
Summary string
Description string
LongDescription []string
Examples []string
Handler CommandHandler
Children []CommandInfo
}
CommandInfo describes a top-level command or subcommand for help generation and future routing/completion work.
type ExitCodeError ¶ added in v0.9.6
ExitCodeError wraps an error with a specific exit code.
func (*ExitCodeError) Error ¶ added in v0.9.6
func (e *ExitCodeError) Error() string
func (*ExitCodeError) Unwrap ¶ added in v0.9.6
func (e *ExitCodeError) Unwrap() error
type FilterOptions ¶ added in v0.9.6
FilterOptions defines filter criteria for listing messages.
type SessionContextError ¶ added in v0.42.1
type SessionContextError struct {
Message string
}
SessionContextError identifies an unsafe or incoherent mailbox context. It is distinct from a usage error: the command syntax was valid.
func (*SessionContextError) Error ¶ added in v0.42.1
func (e *SessionContextError) Error() string
type TreeRelation ¶ added in v0.44.0
type TreeRelation uint8
TreeRelation is a physical-filesystem relationship. Unknown is deliberately distinct from Different: callers must choose whether unverifiable identity is advisory or authority-bearing instead of accidentally collapsing failures.
const ( TreeRelationUnknown TreeRelation = iota TreeRelationSame TreeRelationDifferent )
func (TreeRelation) String ¶ added in v0.44.0
func (r TreeRelation) String() string
Source Files
¶
- amqrc_security_unix.go
- cleanup.go
- cli.go
- codex_notify.go
- common.go
- completion.go
- coop.go
- coop_exec_declaration.go
- coop_exec_env.go
- coop_exec_unix.go
- coop_wake_reclaim_unix.go
- delivery_reads.go
- delivery_root.go
- delivery_status.go
- dlq.go
- doctor.go
- doctor_ops.go
- doctor_ops_fix_unix.go
- doctor_schema_v2.go
- doctor_stale_wake_binary.go
- doctor_stale_wake_binary_linux.go
- doctor_wake_lock_unix.go
- drain.go
- env.go
- exitcode.go
- extensions.go
- filter.go
- inbox_collect.go
- inbox_item.go
- init.go
- integration_kanban.go
- integration_symphony.go
- launch.go
- launch_exec_unix.go
- launch_public_api.go
- list.go
- managed_execution_options.go
- monitor.go
- presence.go
- presence_source.go
- read.go
- receipts.go
- registry.go
- reply.go
- route.go
- send.go
- send_mailbox.go
- session.go
- session_context.go
- session_name.go
- setup.go
- shell_setup.go
- sibling_backlog.go
- swarm.go
- symlink_resolution_unix.go
- thread.go
- trace.go
- tree_identity.go
- tree_identity_unix.go
- update_check.go
- upgrade.go
- upgrade_destination_unix.go
- upgrade_stale_wake.go
- validate.go
- wake.go
- wake_attention.go
- wake_attention_fd_unix.go
- wake_binary_dir_gone.go
- wake_binary_dir_gone_unix.go
- wake_check_schema.go
- wake_check_unix.go
- wake_control_linux.go
- wake_control_other.go
- wake_doorbell.go
- wake_file_identity_linux.go
- wake_injector_status.go
- wake_input_linux.go
- wake_lifecycle_guard_unix.go
- wake_lock.go
- wake_lock_at_unix.go
- wake_machine_identity.go
- wake_machine_identity_linux.go
- wake_message_identity_unix.go
- wake_metadata.go
- wake_metadata_unix.go
- wake_owner_acquire_unix.go
- wake_owner_child_linux.go
- wake_owner_child_unix.go
- wake_owner_observation_linux.go
- wake_owner_observation_unix.go
- wake_owner_recover_unix.go
- wake_owner_stop_linux.go
- wake_owner_stop_unix.go
- wake_owner_storage_unix.go
- wake_owner_transition.go
- wake_owner_transition_unix.go
- wake_prepared_unix.go
- wake_process_linux.go
- wake_quarantine_unix.go
- wake_raw_orphan_unix.go
- wake_ready_unix.go
- wake_reload_transport.go
- wake_reload_transport_linux.go
- wake_repair_at_unix.go
- wake_repair_dirs_linux.go
- wake_repair_dirs_unix.go
- wake_repair_floor_unix.go
- wake_repair_handoff_linux.go
- wake_repair_handoff_unix.go
- wake_repair_rename_linux.go
- wake_restart_bound_linux.go
- wake_restart_bound_unix.go
- wake_restart_notify_linux.go
- wake_restart_stage_diagnostic_unix.go
- wake_restart_stage_linux.go
- wake_restart_stage_reclaim_unix.go
- wake_restart_unix.go
- wake_resume_image_unix.go
- wake_resume_protocol.go
- wake_resume_quiescence.go
- wake_retire_unix.go
- wake_self_upgrade_check_unix.go
- wake_self_upgrade_semver_unix.go
- wake_self_upgrade_unix.go
- wake_snapshot_error.go
- wake_state.go
- wake_state_bound_mutation_unix.go
- wake_state_dual_read_unix.go
- wake_state_unix.go
- wake_target.go
- wake_target_owner_unix.go
- wake_terminal_authority_unix.go
- wake_terminal_guard_unix.go
- wake_terminal_match_linux.go
- wake_terminate_legacy_test_linux.go
- wake_terminate_linux.go
- wake_tiocsti_unix.go
- wake_tty_path_linux.go
- wake_unix.go
- watch.go
- who.go
- worktree_divergence.go