instructions

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 4 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 instructions is what a turn's instructions carry from the loop's book: the earlier turns and, for a resume turn, what the stopped session left. Plain data; the templates of internal/turn render it.

Index

Constants

View Source
const HistoryMax = 10

HistoryMax is how many earlier turns the instructions carry.

Variables

This section is empty.

Functions

func Earlier

func Earlier(b turn.Book, seq int64) turn.Book

Earlier is the book without turn seq and the turns sent after it, for the history of seq's own instructions.

Types

type Draft added in v0.5.0

type Draft struct {
	ID                 int64
	Kind, State, Basis string
	CurrentBasis       string
	Stale              bool
}

Draft points to a draft of the unit: what the agent reads it by, never its text, which draft_read gives. Basis is what the draft was written against, CurrentBasis the unit's now; they differ on a stale draft.

func Pointers added in v0.5.0

func Pointers(ds []draft.Draft, current string, stale func(draft.Draft) bool) []Draft

Pointers point to ds, with current the unit's basis now, "" when unknown, and stale whether a draft is stale, as the outbox tells it.

type Item

type Item struct {
	Path string
	Line int
	Body string
}

type OpenItem

type OpenItem struct{ ID, Kind, Summary, WaitingOn, Since string }

OpenItem is one open item of the unit, as its instructions list it.

type Option

type Option struct {
	ID, Label string
	Publishes bool
	// Draft is the draft the option points to; nil for none.
	Draft *record.DraftRef
}

type PastTurn

type PastTurn struct {
	When                                            time.Time
	Intent, Trigger, State, Verdict, Head, Endorsed string
	Summary, Next, Triage                           string
	Said                                            []string
	// Question and Options are what the turn asks that no answer reached, on
	// the turn this send replaces; an agent wrote them.
	Question string
	Options  []record.Option
	// Ledger is one line per op of the turn's records with its outcome.
	Ledger []string
}

PastTurn is one earlier turn. The first row of fields is the loop's, the second an agent's, Said the user's.

func History

func History(b turn.Book, limit int, log []turn.OpOutcome, sending turn.Intent) []PastTurn

History is b's earlier turns, each naming its ledger ops with the outcome log holds for them, for a send of intent sending ("" for none).

type Question

type Question struct {
	Text, Recommend string
	Options         []Option
}

type Resume

type Resume struct {
	Question                         *Question
	Verdict                          string
	Blocking, NonBlocking            int
	ArtifactKind, ArtifactBody       string
	Items                            []Item
	Notes, Head, CurrentHead, Answer string
	// Drafts point to the drafts the turn's caller hands the next one, such as a failed or stale one to
	// revise or withdraw.
	Drafts []Draft
}

Resume is what a session that stopped left for the next one.

func ResumeOf

func ResumeOf(b turn.Book, seq int64, answer, currentHead, lastMessage string) *Resume

ResumeOf is what turn seq left: its last asked record's question, draft and artifact, and the notes of its last record, or lastMessage when the session stopped without recording. nil when the book has no such turn.

Jump to

Keyboard shortcuts

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