Documentation
¶
Overview ¶
Package overlay lays the host's own state over a unit's situation as its source derives it: the loop's run on the unit, the user's mute and a pending round. It names no source: any plugin's row and card take the same overlays.
Index ¶
- Constants
- func Briefing(i api.Intake) string
- func Cut(s string) string
- func QuestionOf(t *turn.Turn, last *turn.Record) (*api.QuestionView, bool)
- func SessionWaiting(sess turn.Session, agents []turns.AgentObservation) bool
- func Unstarted(b turn.Book) map[string]bool
- type Mute
- type Pending
- type Run
- type Situation
- type Turn
Constants ¶
const ( KindDone = "done" KindMuted = "muted" KindRoundPending = "round_pending" KindLoopWorking = "loop_working" KindLoopWaiting = "loop_waiting" KindLoopStopped = "loop_stopped" )
The situations the overlays set.
const ReasonMax = 200
ReasonMax bounds a reason that comes from an agent or a source, so a row and a notification stay one line.
const WaitsOnMe = "me"
WaitsOnMe is the WaitingOn of a situation waiting on the user.
Variables ¶
This section is empty.
Functions ¶
func Briefing ¶
Briefing is the line of a row waiting for its brief: the attempt and the last error.
func QuestionOf ¶
QuestionOf is the question view of a turn that waits on the user, from its last record; ok is false for any other turn.
func SessionWaiting ¶
func SessionWaiting(sess turn.Session, agents []turns.AgentObservation) bool
SessionWaiting says whether the agents show sess's agent waiting; with no known pane, any agent of its workspace counts.
Types ¶
type Mute ¶
type Mute struct {
Until time.Time
UntilStateChange bool
// At is when the user muted it; zero when unknown.
At time.Time
}
Mute is the user's mute of a unit, its task's wake: until a time, or until the task's facts change, which the wakes match.
func MuteOf ¶
MuteOf is the mute wake w holds on a unit's task: until its Until, and until a change while it waits on a condition or an event; a spent wake mutes nothing.
type Run ¶
type Run struct {
Turn Turn
// Session is the handle of a started turn's session, "" otherwise.
Session string
// Question is the open question or stop of the book, nil for none or
// for one whose answer reached its agent.
Question *api.QuestionView
// Unstarted are the ids of the turns that ended before their agent
// started them.
Unstarted map[string]bool
}
Run is what a unit's row reads of its turn book.
type Situation ¶
type Situation struct {
Kind string
WaitingOn string // logins, "me", "author", "nobody"
Since time.Time
Reason string
// ReasonKey names Reason in its plugin's words, which ReasonParams fill; a reason the host writes has none.
ReasonKey string
ReasonParams map[string]string
Stalled bool
}
Situation is what a unit waits on, since when and why.
type Turn ¶
type Turn struct {
Intent string
// Role is the role the turn's intent held.
Role string
State, Summary string
// At is when the turn reached its state; AnsweredAt is when an answer
// was typed or resumed after its last record, and QueuedAt when one was
// queued for its busy session; zero without one.
At, AnsweredAt, QueuedAt time.Time
}
Turn is what the loop's store says of the turn that drives a unit's row: its newest turn of an intent that drives the row, else its newest turn.