tui

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorCritical = lipgloss.Color("#FF0000")
	ColorHigh     = lipgloss.Color("#FF8800")
	ColorMedium   = lipgloss.Color("#FFCC00")
	ColorLow      = lipgloss.Color("#0088FF")
	ColorInfo     = lipgloss.Color("#888888")
	ColorSuccess  = lipgloss.Color("#00CC00")
	ColorError    = lipgloss.Color("#FF4444")
	ColorMalware  = lipgloss.Color("#FF00FF")
	ColorMuted    = lipgloss.Color("#666666")
	ColorAccent   = lipgloss.Color("#00CCFF")
	ColorTeal     = lipgloss.Color("#00B4B4")
	ColorWhite    = lipgloss.Color("#FFFFFF")
)

Exported color constants for use by other packages (e.g., internal/display).

Functions

func RunTriage

func RunTriage(alerts []triage.EnrichedAlert, opts TriageOptions) error

RunTriage starts the triage TUI program.

func SeverityColor

func SeverityColor(severity string) lipgloss.Color

SeverityColor returns the color for a severity level.

func SeverityStyle

func SeverityStyle(severity string) lipgloss.Style

SeverityStyle returns the lipgloss style for a severity level.

Types

type ResolveCompleteMsg

type ResolveCompleteMsg struct {
	// AlertNumber is the provider alert number that was resolved.
	AlertNumber string
	// VEXStatus is the chosen VEX status (for updating the in-memory list).
	VEXStatus string
	// GitHubUpdated is true when a GitHub PATCH call was made successfully.
	GitHubUpdated bool
	// MemorySaved is true when memory.yaml was updated successfully.
	MemorySaved bool
	// VexFile is the path to the generated VEX document, if any.
	VexFile string
	// Err is non-nil if either operation failed.
	Err error
}

ResolveCompleteMsg is sent when a triage resolution attempt finishes.

type ResolveModal

type ResolveModal struct {
	// contains filtered or unexported fields
}

ResolveModal is the full-screen modal overlay for resolving an alert.

func (*ResolveModal) Init

func (m *ResolveModal) Init() tea.Cmd

Init returns the spinner tick so the spinner animates during submission.

func (*ResolveModal) Update

func (m *ResolveModal) Update(msg tea.Msg) (*ResolveModal, tea.Cmd, bool)

Update handles key/message events for the modal. Returns (updatedModal, cmd, closeModal).

func (*ResolveModal) View

func (m *ResolveModal) View(width, height int) string

View renders the resolve screen as a full-screen view.

type TriageModel

type TriageModel struct {
	// contains filtered or unexported fields
}

TriageModel is the bubbletea model for the triage TUI.

func NewTriageModel

func NewTriageModel(alerts []triage.EnrichedAlert, opts TriageOptions) *TriageModel

NewTriageModel creates a new triage TUI model.

func (*TriageModel) Init

func (m *TriageModel) Init() tea.Cmd

Init implements tea.Model.

func (*TriageModel) Update

func (m *TriageModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*TriageModel) View

func (m *TriageModel) View() string

View implements tea.Model.

type TriageOptions

type TriageOptions struct {
	// GHClient is the GitHub API client used to apply resolutions.
	// May be nil when GitHub integration is unavailable.
	GHClient *triage.GitHubClient
	// Repo is the "owner/repo" string for GitHub API calls.
	Repo string
	// VulnetixDir is the path to the .vulnetix directory for memory persistence.
	// Defaults to ".vulnetix" in the current working directory when empty.
	VulnetixDir string
	// VexFormat controls the VEX document format written on resolve: openvex, cdx, or json.
	// Defaults to "openvex" when empty.
	VexFormat string
	// InitialSeverity sets the starting severity filter (empty means no filter).
	// Valid values: "low", "medium", "high", "critical".
	InitialSeverity string
	// OnVEXWritten is told the path of every VEX document a resolution wrote.
	// It runs inside the TUI, so it must not print; the caller acts on the
	// paths once the TUI has exited.
	OnVEXWritten func(path string)
}

TriageOptions configures the triage TUI.

Jump to

Keyboard shortcuts

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