wake

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package wake delivers best-effort "notify" signals to agents' tmux sessions by setting/clearing a per-session tmux option (which the operator's status bar surfaces). It never types into a pane — see internal/nudge for that.

Index

Constants

View Source
const DefaultAgentOption = "@muster_agent"

DefaultAgentOption is the tmux user option carrying a session's registered alias list when TmuxNotifier.AgentOption is unset.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier interface {
	Notify(socketPath, sessionID string, count int) error
	Clear(socketPath, sessionID string) error
	// SetAgents writes the session's registered-alias list into the agent
	// badge option (comma-joined), unsetting it when the list is empty — the
	// operator's ambient "registered as X" indicator. Best-effort like
	// Notify/Clear.
	SetAgents(socketPath, sessionID string, aliases []string) error
}

Notifier flags (or clears) a recipient's tmux session so the operator is notified of bus activity. Best-effort: errors mean the signal couldn't be delivered and should be ignored (the inbox is authoritative).

type TmuxNotifier

type TmuxNotifier struct {
	Option      string        // e.g. "@claude_attn"
	AgentOption string        // agent-badge option; "" → DefaultAgentOption
	Timeout     time.Duration // per tmux subprocess
	Run         func(ctx context.Context, args ...string) error
}

TmuxNotifier sets/clears a tmux user-option on a session, socket-aware, each call bounded by Timeout. Run is the command executor (nil → real tmux).

func NewTmuxNotifier

func NewTmuxNotifier(option string, timeout time.Duration) TmuxNotifier

NewTmuxNotifier returns a TmuxNotifier backed by the real tmux binary.

func (TmuxNotifier) Clear

func (n TmuxNotifier) Clear(socketPath, sessionID string) error

Clear unsets the option on the session.

func (TmuxNotifier) Notify

func (n TmuxNotifier) Notify(socketPath, sessionID string, count int) error

Notify sets the option to count (unsetting it when count <= 0), then repaints the session's clients so a title-based banner updates. Best-effort; a missing client is fine.

func (TmuxNotifier) SetAgents added in v0.7.0

func (n TmuxNotifier) SetAgents(socketPath, sessionID string, aliases []string) error

SetAgents sets the agent-badge option to the comma-joined alias list (unsetting it when the list is empty), then repaints the session's clients. Aliases are joined verbatim — callers pass them sorted and deduplicated.

Jump to

Keyboard shortcuts

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