Documentation
¶
Index ¶
- Constants
- func Command(context string) plugin.Command
- func Enabled() bool
- func Notifications(result agentbroadcast.Result) []notify.Notification
- func NotifyCmd(result agentbroadcast.Result) tea.Cmd
- func NotifyError(err error) tea.Cmd
- func SummaryTitle(result agentbroadcast.Result) string
- type Host
- func (h *Host) ApplyPlan(msg PlannedMsg)
- func (h *Host) Ensure(width int)
- func (h *Host) HandleKey(msg tea.KeyPressMsg) (close bool, cmd tea.Cmd)
- func (h *Host) HandleMouse(msg tea.MouseMsg, handler *mouse.Handler) (close bool, cmd tea.Cmd)
- func (h *Host) HandlePaste(text string)
- func (h *Host) OwnedBy(surface string) bool
- func (h *Host) Render(width, height int, handler *mouse.Handler) string
- func (h *Host) Replan() tea.Cmd
- func (h *Host) WheelAtBoundary(msg tea.MouseWheelMsg, handler *mouse.Handler) bool
- type Line
- type PlannedMsg
- type Scope
- type SentMsg
Constants ¶
const ( CommandID = "broadcast-agents" CommandName = "Broadcast" CommandDescription = "Broadcast to agents" ActionSend = "send" ActionCancel = "cancel" )
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 Notifications ¶
func Notifications(result agentbroadcast.Result) []notify.Notification
Notifications is the toast plus the per-target centre rows for one result.
func NotifyError ¶
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 ¶
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) HandleMouse ¶
func (*Host) HandlePaste ¶
func (*Host) OwnedBy ¶
OwnedBy reports whether this modal belongs to the given surface, so a surface can ignore the other one's plan and result.
func (*Host) WheelAtBoundary ¶
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).
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.