broadcastmodal

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 18 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

View Source
const (
	CommandID          = "broadcast-agents"
	CommandName        = "Broadcast"
	CommandDescription = "Broadcast to agents"

	ActionSend   = "send"
	ActionCancel = "cancel"
)
View Source
const (
	SurfaceProject  = "project"
	SurfaceSessions = "sessions"
)

Surface names the Workspaces surface a modal was opened from. Both surfaces see every plan and every result (see overview.IsSharedBroadcastMessage), so the answer has to say who asked: without it both of them reported the same send, and one broadcast arrived as two notifications.

Variables

This section is empty.

Functions

func Command

func Command(context string) plugin.Command

func Enabled

func Enabled() bool

func Notifications

func Notifications(result agentbroadcast.Result) []notify.Notification

Notifications is the toast plus the per-target centre rows for one result.

func NotifyCmd

func NotifyCmd(result agentbroadcast.Result) tea.Cmd

func NotifyError

func NotifyError(err error) tea.Cmd

func SummaryTitle

func SummaryTitle(result agentbroadcast.Result) string

Types

type Host

type Host struct {
	ProjectKey string
	StateDir   string
	RemoteNote bool
	Service    agentbroadcast.Service
	// Surface is the surface that opened this modal, one of the Surface
	// constants. A surface answers only for its own results.
	Surface string
	// contains filtered or unexported fields
}

Host is the one Broadcast-to-agents modal. Both Workspaces surfaces overlay it; they do not fork a second copy.

func New

func New(surface, projectKey, stateDir string, scope Scope, remoteNote bool) *Host

New builds a modal for one surface. surface is SurfaceProject or SurfaceSessions and decides which surface reports the result.

func (*Host) ApplyPlan

func (h *Host) ApplyPlan(msg PlannedMsg)

func (*Host) Ensure

func (h *Host) Ensure(width int)

func (*Host) HandleKey

func (h *Host) HandleKey(msg tea.KeyPressMsg) (close bool, cmd tea.Cmd)

func (*Host) HandleMouse

func (h *Host) HandleMouse(msg tea.MouseMsg, handler *mouse.Handler) (close bool, cmd tea.Cmd)

func (*Host) HandlePaste

func (h *Host) HandlePaste(text string)

func (*Host) OwnedBy

func (h *Host) OwnedBy(surface string) bool

OwnedBy reports whether this modal belongs to the given surface, so a surface can ignore the other one's plan and result.

func (*Host) Render

func (h *Host) Render(width, height int, handler *mouse.Handler) string

func (*Host) Replan

func (h *Host) Replan() tea.Cmd

func (*Host) WheelAtBoundary

func (h *Host) WheelAtBoundary(msg tea.MouseWheelMsg, handler *mouse.Handler) bool

type Line

type Line struct {
	Kind    lineKind
	ID      string
	Name    string
	Agent   string
	Status  string
	Reason  string
	Checked bool
	Label   string
}

Line is one visual row of the modal checklist. Recipient lines agree row-for-row with Plan.Recipients (and therefore with dry-run JSON).

func Checklist

func Checklist(plan agentbroadcast.Plan, group bool, selected map[string]bool) []Line

Checklist renders plan as the modal's recipient list. group inserts project section labels. selected overrides the initial would_send checks; nil means use the plan's own verdicts.

type PlannedMsg

type PlannedMsg struct {
	Host *Host
	Gen  int
	Plan agentbroadcast.Plan
	Err  error
}

PlannedMsg carries a plan back to the host that asked for it. Host is that host: both Workspaces surfaces receive this message (see overview.IsSharedBroadcastMessage), so a modal left open on the surface the user is not looking at must not adopt the other one's plan.

type Scope

type Scope int
const (
	ScopeThisProject Scope = iota
	ScopeAllProjects
)

type SentMsg

type SentMsg struct {
	Host   *Host
	Result agentbroadcast.Result
	Err    error
}

Jump to

Keyboard shortcuts

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