Documentation
¶
Index ¶
- Constants
- type Approval
- type AutomationAuditEntry
- type AutomationAuditListOptions
- type CleanupApplyResult
- type CleanupCandidate
- type CleanupPlan
- type GitMutationApplyResult
- type GitMutationPlan
- type Manager
- func (m *Manager) ApplyCleanup(ctx context.Context, approvalID string) (CleanupApplyResult, error)
- func (m *Manager) ApplyGitMutation(ctx context.Context, approvalID string) (GitMutationApplyResult, error)
- func (m *Manager) Approve(approvalID string) error
- func (m *Manager) CreateCleanupPlan(ctx context.Context) (CleanupPlan, error)
- func (m *Manager) CreateGitMutationApproval(ctx context.Context, plan GitMutationPlan) (GitMutationPlan, error)
- func (m *Manager) GetApproval(approvalID string) (Approval, error)
- func (m *Manager) ListApprovals() ([]Approval, error)
- func (m *Manager) ListAutomationAudit(opts AutomationAuditListOptions) ([]AutomationAuditEntry, error)
- func (m *Manager) RecordAutomationAudit(entry AutomationAuditEntry) (AutomationAuditEntry, error)
- func (m *Manager) Reject(approvalID string) error
- func (m *Manager) SetNote(approvalID, note string) error
- func (m *Manager) Status(ctx context.Context) (Status, error)
- type Options
- type Status
Constants ¶
View Source
const ( GitMutationStage = "stage" GitMutationUnstage = "unstage" GitMutationDiscard = "discard" GitMutationCommit = "commit" GitMutationSwitchBranch = "switch_branch" GitMutationCheckoutCommit = "checkout_commit" GitMutationWorktreeAdd = "worktree_add" GitMutationWorktreeRemove = "worktree_remove" GitMutationFetch = "fetch" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Approval ¶
type Approval struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status"`
RequestedAt time.Time `json:"requested_at"`
UpdatedAt time.Time `json:"updated_at"`
ReviewedAt *time.Time `json:"reviewed_at,omitempty"`
Plan CleanupPlan `json:"plan"`
GitMutation *GitMutationPlan `json:"git_mutation,omitempty"`
Note string `json:"note,omitempty"`
}
type AutomationAuditEntry ¶ added in v0.31.108
type AutomationAuditEntry struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Actor string `json:"actor"`
Action string `json:"action"`
Reason string `json:"reason,omitempty"`
SessionID string `json:"session_id,omitempty"`
CWD string `json:"cwd,omitempty"`
Result string `json:"result"`
Details map[string]any `json:"details,omitempty"`
}
type AutomationAuditListOptions ¶ added in v0.31.108
type CleanupApplyResult ¶
type CleanupCandidate ¶
type CleanupPlan ¶
type CleanupPlan struct {
ApprovalID string `json:"approval_id"`
CreatedAt time.Time `json:"created_at"`
TotalBytes int64 `json:"total_bytes"`
Candidates []CleanupCandidate `json:"candidates"`
}
type GitMutationApplyResult ¶ added in v0.31.109
type GitMutationApplyResult struct {
ApprovalID string `json:"approval_id"`
SessionID string `json:"session_id,omitempty"`
Root string `json:"root"`
Action string `json:"action"`
Path string `json:"path,omitempty"`
Branch string `json:"branch,omitempty"`
Hash string `json:"hash,omitempty"`
WorktreePath string `json:"worktree_path,omitempty"`
NewBranch string `json:"new_branch,omitempty"`
Result string `json:"result"`
Output string `json:"output,omitempty"`
Destructive bool `json:"destructive,omitempty"`
}
type GitMutationPlan ¶ added in v0.31.109
type GitMutationPlan struct {
ApprovalID string `json:"approval_id"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
SessionID string `json:"session_id,omitempty"`
Root string `json:"root"`
Action string `json:"action"`
Path string `json:"path,omitempty"`
Branch string `json:"branch,omitempty"`
Message string `json:"message,omitempty"`
Hash string `json:"hash,omitempty"`
WorktreePath string `json:"worktree_path,omitempty"`
NewBranch string `json:"new_branch,omitempty"`
Reason string `json:"reason,omitempty"`
Command string `json:"command"`
Destructive bool `json:"destructive,omitempty"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ApplyCleanup ¶
func (*Manager) ApplyGitMutation ¶ added in v0.31.109
func (*Manager) CreateCleanupPlan ¶
func (m *Manager) CreateCleanupPlan(ctx context.Context) (CleanupPlan, error)
func (*Manager) CreateGitMutationApproval ¶ added in v0.31.109
func (m *Manager) CreateGitMutationApproval(ctx context.Context, plan GitMutationPlan) (GitMutationPlan, error)
func (*Manager) GetApproval ¶ added in v0.31.109
func (*Manager) ListApprovals ¶
func (*Manager) ListAutomationAudit ¶ added in v0.31.108
func (m *Manager) ListAutomationAudit(opts AutomationAuditListOptions) ([]AutomationAuditEntry, error)
func (*Manager) RecordAutomationAudit ¶ added in v0.31.108
func (m *Manager) RecordAutomationAudit(entry AutomationAuditEntry) (AutomationAuditEntry, error)
Click to show internal directories.
Click to hide internal directories.