interventions

package
v1.17.3 Latest Latest
Warning

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

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

Documentation

Overview

Package interventions implements the PauseToken-correlated TUI intervention inbox.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inbox

type Inbox struct {
	Surface surface.State
	// contains filtered or unexported fields
}

Inbox is a value-updated queue with resolved-token anti-resurrection.

func New

func New() Inbox

New constructs an empty inbox.

func (Inbox) Active

func (i Inbox) Active() []Item

Active returns unresolved entries only.

func (Inbox) History

func (i Inbox) History() []Item

History returns active entries and retained expiry/resolution tombstones.

func (Inbox) Items

func (i Inbox) Items() []Item

Items returns unresolved newest-first isolated entries.

func (Inbox) Reconcile

func (i Inbox) Reconcile(snapshots []types.PauseSnapshot, generation uint64) Inbox

Reconcile applies an authoritative pause snapshot without resurrecting a token resolved by a newer generation.

func (Inbox) ReconcilePage

func (i Inbox) ReconcilePage(response types.PauseListResponse, generation uint64, now time.Time) Inbox

ReconcilePage applies a typed canonical page. Missing entries are only resolved-elsewhere when the response is a complete first page.

func (Inbox) Resolve

func (i Inbox) Resolve(token, outcome string, generation uint64) Inbox

Resolve marks a token resolved, including resolved-elsewhere outcomes.

func (Inbox) Select

func (i Inbox) Select(token string) Inbox

Select chooses an exact PauseToken and retains it across updates.

func (Inbox) Selected

func (i Inbox) Selected() (Item, bool)

Selected returns the retained exact token selection.

type Item

type Item struct {
	Token, RunID, Reason, Status, Resolution string
	Kind                                     Kind
	PausedAt                                 time.Time
	ResolvedAt, ExpiresAt                    time.Time
	Payload                                  any
	PayloadRef                               *types.PauseArtifactRef
}

Item is one immutable PauseToken-correlated queue entry.

type Kind

type Kind string

Kind is an operator-facing pause cause.

const (
	KindApproval Kind = "approval required"
	KindOAuth    Kind = "OAuth required"
	KindInput    Kind = "input required"
	KindPause    Kind = "paused"
)

Jump to

Keyboard shortcuts

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