overlay

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 11 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

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

View Source
const (
	KindDone         = "done"
	KindMuted        = "muted"
	KindRoundPending = "round_pending"
	KindLoopWorking  = "loop_working"
	KindLoopWaiting  = "loop_waiting"
	KindLoopStopped  = "loop_stopped"
)

The situations the overlays set.

View Source
const ReasonMax = 200

ReasonMax bounds a reason that comes from an agent or a source, so a row and a notification stay one line.

View Source
const WaitsOnMe = "me"

WaitsOnMe is the WaitingOn of a situation waiting on the user.

Variables

This section is empty.

Functions

func Briefing

func Briefing(i api.Intake) string

Briefing is the line of a row waiting for its brief: the attempt and the last error.

func Cut

func Cut(s string) string

Cut keeps s within ReasonMax runes.

func QuestionOf

func QuestionOf(t *turn.Turn, last *turn.Record) (*api.QuestionView, bool)

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.

func Unstarted

func Unstarted(b turn.Book) map[string]bool

Unstarted are the ids of b's turns that ended before their agent started them, which posted nothing.

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

func MuteOf(w wake.Wake) Mute

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.

func (Mute) Holds

func (m Mute) Holds(s Situation, now time.Time) bool

Holds says whether m mutes a unit whose situation, unmuted, is s.

func (Mute) Muted

func (m Mute) Muted() Situation

Muted is the situation of a unit m mutes.

func (Mute) Refusal

func (m Mute) Refusal(now time.Time) string

Refusal is why m refuses a turn at now: muted until the state changes, or until a time; "" when it does not.

func (Mute) Set

func (m Mute) Set() bool

Set says whether m mutes anything at all, held or lapsed.

type Pending

type Pending struct {
	Intent, Reason  string
	Since, Deadline time.Time
}

Pending is an automatic round waiting for the user's answer.

func (Pending) Over

func (p Pending) Over(s Situation) Situation

Over is s with p pending on it: the round waits on the user unless the unit is done or muted.

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.

func RunOf

func RunOf(b turn.Book, reg *dintent.Registry) (Run, bool)

RunOf is what a row reads of b: its newest turn of an intent of reg that drives the row, else its newest turn; false for a book with no turn.

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.

func (Turn) Situation

func (t Turn) Situation(sessionWaiting bool) (Situation, bool)

Situation is the situation t decides while its session waits or not; false when its role does not drive the row, or its state leaves the situation to the source.

Jump to

Keyboard shortcuts

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