Documentation
¶
Overview ¶
Package state implements the state command, a single machine-readable snapshot of the stack, working tree, and any in-progress operation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Engine Engine
Out output.Output
// GitHub supplies PR/CI status for the stack section. May be nil.
GitHub github.Client
// RepoRoot locates the continuation file that marks a halted stackit
// operation.
RepoRoot string
}
Deps are the collaborators state needs.
type Engine ¶
Engine is the full engine: the stack section is built by actions.BuildTreeJSON, which takes an engine.Engine.
type OperationStatus ¶
type OperationStatus struct {
// Kind is "none", "rebase", or "merge".
Kind string `json:"kind"`
// InProgress is true when a rebase or merge is mid-flight.
InProgress bool `json:"in_progress"`
// StackitHalted is true when a `stackit continue` is pending (a stackit
// operation was interrupted by a conflict).
StackitHalted bool `json:"stackit_halted"`
// ConflictedFiles lists unmerged paths (always present, possibly empty).
ConflictedFiles []string `json:"conflicted_files"`
}
OperationStatus reports an in-progress git/stackit operation and its conflicts.
type Result ¶
type Result struct {
CurrentBranch string `json:"current_branch"` // "" when detached
Detached bool `json:"detached"`
Trunk string `json:"trunk"`
WorkingTree WorkingTreeStatus `json:"working_tree"`
Operation OperationStatus `json:"operation"`
Stack actions.TreeJSONResult `json:"stack"`
}
Result is a complete machine-readable snapshot of the repository's stack, working tree, and any in-progress operation. Agents read this single result instead of fanning out across separate branch/git-status/log/info calls, and it removes brittle scraping of `.git` for conflict state.