cmdworktree

package
v0.182.5 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollaborationCommands

func CollaborationCommands(runtime shared.Runtime, factory func(string) (CollaborationOperations, error)) []*cobra.Command

CollaborationCommands constructs worktree collaboration verbs with lazy flags.

func NewAbort

func NewAbort(runtime shared.Runtime, deps AbortDependencies) *cobra.Command

func NewActive

func NewActive(runtime shared.Runtime, deps worktreerun.ActiveDependencies) *cobra.Command

NewActive constructs compact local and cross-machine overlap preflight.

func NewAdopt

func NewAdopt(runtime shared.Runtime, operation func(context.Context, worktrees.AdoptOptions) ([]worktrees.AdoptResult, error), admit func(*cobra.Command, bool) (func(), error)) *cobra.Command

NewAdopt constructs the worktree adopt command.

func NewBackfill

func NewBackfill(runtime shared.Runtime, operation func(context.Context, worktrees.BackfillOptions) ([]worktrees.BackfillResult, error)) *cobra.Command

NewBackfill constructs the worktree backfill command.

func NewCheckpointFetch

NewCheckpointFetch constructs the worktree journal command. NewCheckpointFetch constructs the checkpoint retrieval command.

func NewCleanup

func NewCleanup(runtime shared.Runtime, deps CleanupDependencies) *cobra.Command

func NewCorrectIdentity

NewCorrectIdentity constructs the worktree journal command.

func NewCreate

func NewCreate(environment shared.Runtime, dependencies CreateDependencies) *cobra.Command

NewCreate constructs the managed worktree creation command.

func NewEnd

func NewEnd(runtime shared.Runtime, factory func(string, io.Writer) (*worktreeend.Engine, error)) *cobra.Command

func NewGC

func NewGC(runtime shared.Runtime, deps GCDependencies) *cobra.Command

func NewGuard

func NewGuard(environment shared.Runtime, inspect func(context.Context, string, worktrees.GuardOptions) (worktrees.GuardResult, error), isTerminal func(any) bool) *cobra.Command

NewGuard constructs the checkout policy inspection command.

func NewInfo

NewInfo constructs the redacted inspection command.

func NewLand

func NewLand(runtime shared.Runtime, operations MergeOperations, bindings MergeBindings) *cobra.Command

func NewList

NewList constructs the worktree inventory list command.

func NewMarker

func NewMarker(runtime shared.Runtime, operations MarkerOperations) *cobra.Command

func NewMerge

func NewMerge(runtime shared.Runtime, operations MergeOperations, bindings MergeBindings) *cobra.Command

func NewOrphans

func NewOrphans(runtime shared.Runtime, operation func(context.Context, worktrees.OrphanOptions) (worktrees.OrphanReport, error)) *cobra.Command

NewOrphans constructs the worktree orphans command.

func NewOwn

func NewOwn(operations OwnOperations) *cobra.Command

func NewReceipt

func NewReceipt(deps ReceiptDependencies) *cobra.Command

NewReceipt constructs verification evidence commands without importing the executable.

func NewRelocate

func NewRelocate(environment shared.Runtime, dependencies RelocateDependencies) *cobra.Command

NewRelocate constructs a managed checkout relocation command.

func NewRename

func NewRename(environment shared.Runtime, dependencies RenameDependencies) *cobra.Command

NewRename constructs a managed checkout recycle command.

func NewRescue

func NewRescue(runtime shared.Runtime, ops RescueOperations) *cobra.Command

func NewRetire

func NewRetire(runtime shared.Runtime, deps RetireDependencies) *cobra.Command

func NewSet

NewSet constructs the worktree journal command.

func NewSummary

NewSummary constructs the worktree inventory summary command.

func NewWorkLog

func NewWorkLog(environment shared.Runtime, operations JournalOperations, admit JournalAdmission) *cobra.Command

NewWorkLog constructs the worktree journal command.

Types

type AbortDependencies

type AbortDependencies struct {
	Run         func(context.Context, worktrees.AbortOptions) ([]worktrees.AbortResult, error)
	Release     func(*cobra.Command, string, string) bool
	SkipRelease func(*cobra.Command, string)
}

type CleanupDependencies

type CleanupDependencies struct {
	Run      func(context.Context, worktrees.CleanupOptions) (worktrees.CleanupOutcome, error)
	Shells   func(context.Context, worktrees.RetireShellsOptions) (worktrees.RetireShellsOutcome, error)
	Recover  func(context.Context, worktrees.RetiredStageRecoveryOptions) (worktrees.RetiredStageRecoveryOutcome, error)
	Progress func(*cobra.Command, bool) InventoryProgress
	// Root applies its existing fatal-release-leak policy; remote engine outcomes
	// remain authoritative and are never reconstructed by this CLI adapter.
	Release func(*cobra.Command, string, string) bool
}

type CollaborationOperations

CollaborationOperations is the custody and messaging authority used by commands. The existing worktreecollab.Service implements these operations.

type CreateDependencies

type CreateDependencies struct {
	Run                func(context.Context, []string, worktrees.CreateOptions) ([]worktrees.CreateResult, error)
	OriginSlug         func(context.Context, string) (string, error)
	PrepareLog         func(string, string, worktrees.WorkLogOptions) (worktrees.WorkLogOptions, error)
	RegisteredIdentity func() (worktrees.AgentIdentity, bool)
	BeforeCreate       func(string, []string) error
	Claim              func(*cobra.Command, bool, string, string) worktreerun.RemoteClaimOutcome
	AfterCreate        func(*cobra.Command, string, []worktrees.CreateResult)
}

type GCDependencies

type GCDependencies struct {
	Run      func(context.Context, worktrees.GCOptions) (worktrees.GCOutcome, error)
	Progress func(*cobra.Command, bool) InventoryProgress
}

type InventoryProgress

type InventoryProgress struct {
	Report func(worktrees.ListProgress)
	Finish func()
}

type JournalAdmission

type JournalAdmission func(*cobra.Command, bool) (worktrees.AgentIdentity, func(), error)

type MarkerOperations

type MarkerOperations struct {
	Run     func(context.Context, checkoutsetup.MarkerRequest) ([]checkoutsetup.MarkerOutcome, error)
	Version func() string
}

type MergeBindings

type MergeBindings struct {
	Admission       JournalAdmission
	Initiator       func(*cobra.Command) string
	Discovery       func(*cobra.Command, string)
	Quiet           func(*cobra.Command)
	Landing         func(*cobra.Command, string) *cobra.Command
	RefusePaths     func(string, []string) error
	RefuseReceipt   func(string, string) error
	LaneRequest     func(string, string, string, bool) orchestrate.LaneGuardRequest
	ReleaseLane     func(string, orchestrate.WorktreeMergeReceipt)
	CheckoutUpdated func(io.Writer) func(context.Context, orchestrate.CheckoutUpdate)
}

type MergeOperations

type MergeOperations struct {
	AcknowledgeAbsorbedConflict                    func(ctx context.Context, options orchestrate.WorktreeMergeAbsorbedConflictAcknowledgementOptions) (orchestrate.WorktreeMergeAbsorbedConflictAcknowledgement, error)
	AcknowledgeLandedMergeFailure                  func(ctx context.Context, options orchestrate.WorktreeMergeLandedFailureAcknowledgementOptions) (orchestrate.WorktreeMergeLandedFailureAcknowledgement, error)
	AcknowledgeMissingWorktreeMergeCleanup         func(ctx context.Context, options orchestrate.WorktreeMergeMissingCleanupAcknowledgementOptions) (orchestrate.WorktreeMergeMissingCleanupAcknowledgement, error)
	AcknowledgeRetiredPrepareCandidate             func(ctx context.Context, options orchestrate.WorktreeMergeRetiredPrepareCandidateAcknowledgementOptions) (retiredcandidateack.Acknowledgement, error)
	AcknowledgeRetiredPublication                  func(ctx context.Context, options orchestrate.WorktreeMergeRetiredPublicationAcknowledgementOptions) (orchestrate.WorktreeMergeRetiredPublicationAcknowledgement, error)
	AcknowledgeStrandedPullRequestLanding          func(ctx context.Context, options orchestrate.WorktreeMergeStrandedLandingAcknowledgementOptions) (orchestrate.WorktreeMergeStrandedLandingAcknowledgement, error)
	AcknowledgeUnpublishedValidationFailure        func(ctx context.Context, options orchestrate.WorktreeMergeUnpublishedValidationFailureAcknowledgementOptions) (orchestrate.WorktreeMergeUnpublishedValidationFailureAcknowledgement, error)
	AcknowledgeWorktreeMergeReceiptCollision       func(ctx context.Context, options orchestrate.WorktreeMergeReceiptCollisionAcknowledgementOptions) (orchestrate.WorktreeMergeReceiptCollisionAcknowledgement, error)
	AdoptPublishedWorktreeMergeCandidate           func(ctx context.Context, options orchestrate.WorktreeMergePublishedCandidateAdoptionOptions) (orchestrate.WorktreeMergePublishedCandidateAdoption, error)
	CorrectValidationFailedSelfSupersession        func(ctx context.Context, options orchestrate.WorktreeMergeSelfSupersessionCorrectionOptions) (orchestrate.WorktreeMergeSelfSupersessionCorrection, error)
	LandWorktreeMerge                              func(ctx context.Context, options orchestrate.WorktreeMergeLandOptions) (orchestrate.WorktreeMergeReceipt, error)
	PeekWorktreeMergeReceipt                       func(projectsRoot, input string) (orchestrate.WorktreeMergeReceipt, error)
	PeekWorktreeMergeValidationDeferral            func(ctx context.Context, projectsRoot string, sources []string, target string, requestedRoute orchestrate.WorktreeMergeRoute, validateLocally, allowUnfenced bool, directCIPullRequest ...string) (bool, error)
	PrepareConflictWorktreeMergeReplacement        func(ctx context.Context, options orchestrate.WorktreeMergeConflictCandidateRefreshOptions) (result orchestrate.WorktreeMergeConflictCandidateRefresh, retErr error)
	PreparePublishedValidationFailureForwardRepair func(ctx context.Context, options orchestrate.WorktreeMergePublishedForwardRepairOptions) (result orchestrate.WorktreeMergePublishedForwardRepair, retErr error)
	PrepareValidationFailedWorktreeMergeSeal       func(ctx context.Context, options orchestrate.WorktreeMergeValidationFailureSealOptions) (orchestrate.WorktreeMergeValidationFailureSeal, error)
	PrepareWorktreeMerge                           func(ctx context.Context, options orchestrate.WorktreeMergePrepareOptions) (preparedReceipt orchestrate.WorktreeMergeReceipt, prepareErr error)
	PrepareWorktreeMergeRevert                     func(ctx context.Context, projectsRoot, input string, timeout time.Duration, retry int) (orchestrate.WorktreeMergeReceipt, error)
	ResumeWorktreeMerge                            func(ctx context.Context, options orchestrate.WorktreeMergeLandOptions) (orchestrate.WorktreeMergeReceipt, error)
	RunWorktreeMerge                               func(ctx context.Context, prepare orchestrate.WorktreeMergePrepareOptions, land orchestrate.WorktreeMergeLandOptions) (orchestrate.WorktreeMergeReceipt, error)
	SupersedeValidationFailedWorktreeMerge         func(ctx context.Context, options orchestrate.WorktreeMergeValidationFailureSupersessionOptions) (orchestrate.WorktreeMergeValidationFailureSupersession, error)
}

func DefaultMergeOperations

func DefaultMergeOperations() MergeOperations

type OwnOperations

type OwnOperations struct {
	Admission JournalAdmission
	Record    func(checkoutsetup.OwnershipRequest) (checkoutsetup.OwnershipResult, error)
}

type ReceiptDependencies

type ReceiptDependencies struct {
	Compose func(graduation.EvidencePaths) ([]byte, error)
	Observe func(context.Context, graduation.RemoteTargetRequest) ([]byte, error)
}

ReceiptDependencies supplies reusable evidence operations to the receipt command.

type RelocateDependencies

type RelocateDependencies struct {
	Run           func(context.Context, worktrees.RelocateOptions) (worktrees.RelocateOutcome, error)
	Admit         func(*cobra.Command, bool) (worktrees.AgentIdentity, func(), error)
	AfterApply    func(*cobra.Command, []worktrees.RelocateResult)
	StartProgress func(io.Writer, string) func()
}

type RenameDependencies

type RenameDependencies struct {
	Run        func(context.Context, worktrees.RenameOptions) (worktrees.RenameOutcome, error)
	Admit      func(*cobra.Command, bool) (worktrees.AgentIdentity, func(), error)
	AfterApply func(*cobra.Command, string, []worktrees.RenameResult)
}

type RetireDependencies

type RetireDependencies struct {
	Run                 func(context.Context, worktrees.RetireOptions) (worktrees.RetireResult, error)
	Admit               func(*cobra.Command, bool) (worktrees.AgentIdentity, func(), error)
	CheckOwnership      func(context.Context, string, string) error
	ReleaseWhenComplete func(*cobra.Command, string, string) bool
}

Jump to

Keyboard shortcuts

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