Documentation
¶
Overview ¶
Package agentbroadcast plans and delivers one prompt to a set of live managed agents. It is the application core behind sidecar agent broadcast and the Broadcast to agents modal; both are thin callers of Plan and Send.
Index ¶
- Constants
- func CandidatesFromState(stateDir string) func(context.Context, PlanRequest) ([]managedtarget.Target, error)
- func Envelope(sender, text string) string
- func RecipientID(row Recipient) string
- type Outcome
- type Plan
- type PlanRequest
- type Reason
- type Recipient
- type Result
- type Scope
- type Service
- type Summary
Constants ¶
const ( ScopeProject = "project" ScopeAll = "all" OutcomeWouldSend Outcome = "would_send" OutcomeSubmitted Outcome = "submitted" OutcomeSkipped Outcome = "skipped" OutcomeUnknown Outcome = "unknown" // ReasonExcluded is the verdict a row carries when the caller deselected // it: nothing was attempted and nothing refused it. The modal reads it to // keep a deselection out of the result notifications — the user already // knows, having just unchecked the box. ReasonExcluded = "excluded" )
Variables ¶
This section is empty.
Functions ¶
func CandidatesFromState ¶
func CandidatesFromState(stateDir string) func(context.Context, PlanRequest) ([]managedtarget.Target, error)
CandidatesFromState is the Plan candidate source for both the CLI verb and the TUI modal: one scan of stateDir, filtered by the request's scope.
func Envelope ¶
Envelope prefixes delivered text so a receiving agent can tell a broadcast from its own user typing. sender is already framed: `"shell" in project` or `the user`.
func RecipientID ¶
RecipientID is the stable checklist key for a plan row.
Types ¶
type Plan ¶
type PlanRequest ¶
type PlanRequest struct {
// ScopeKind is "project", "all", or empty when --to alone is the set.
// Candidates still needs a search universe: empty/--to-only means all
// registered projects, matching agent prompt TARGET resolution.
ScopeKind string // "project" | "all" | ""
Project string
To []string
Exclude []string
Status []agentcontrol.Status // empty => PromptableStates()
IncludeSelf bool
SenderSession string // SIDECAR_SHELL tmux name; dropped unless IncludeSelf
SenderName string
SenderProject string
FromUser bool // TUI: envelope says "the user"
Raw bool
}
type Recipient ¶
type Recipient struct {
Target agentcontrol.Target `json:"target"`
Agent agentcontrol.AgentState `json:"agent"`
Outcome Outcome `json:"outcome"`
Reason *Reason `json:"reason,omitempty"`
Receipt *agentcontrol.PromptReceipt `json:"receipt,omitempty"`
}
type Service ¶
type Service struct {
Control agentcontrol.Service
// Candidates returns the same enumeration agent list uses: every managed
// shell/worktree the scope can see, one row per pane. Injected so this
// package does not import internal/cli.
Candidates func(ctx context.Context, req PlanRequest) ([]managedtarget.Target, error)
}