agent

package
v0.252.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 95 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 agent is a person's agent: the worker that does its processing with nobody present, and — in later milestones — the conversation it holds with the person and the tools it reaches everything through.

It knows mail and the database; it knows nothing about HTTP. Everything it does for a person is measured against the person and recorded with the source beside it. Nothing here is constructed while the agent is off: the server passes a nil registry and builds no worker.

Index

Constants

View Source
const (
	FirstBudgetYear  = 1900
	BudgetYearsAhead = 10
)

The years a year's budgets and saving may be asked for: 1900 through ten years past today's. Year zero parses as a year but is no year PostgreSQL stores a day in, and refusing it here makes it an invalid argument rather than an internal error from the first query.

View Source
const (
	CommandStop    = "stop"
	CommandAnswer  = "answer"
	CommandResolve = "resolve"
	// CommandLocate carries the browser's answer to a location call in
	// Answer, as JSON (see AnswerLocation).
	CommandLocate = "locate"
	// CommandLiveActivity has the run push its state to the Live Activity
	// in PushRegistration. The app registers the activity wherever its
	// request lands, which need not be the instance running the turn.
	CommandLiveActivity = "liveActivity"
)
View Source
const (
	AnswerFromMemory  = "memory"  // the facts recall carries, as a turn would get them
	AnswerFromSources = "sources" // passages from the documents, as the search tool finds them
	AnswerFromBoth    = "both"    // both, the way a turn that searches has them

	// AnswerFromAgent is a turn of the agent itself, with its tools, the
	// way a person asking in a conversation is answered; "agent@high"
	// asks it to think at that effort.
	AnswerFromAgent = "agent"
)

What an evaluation answers from. The recall evaluation says whether the facts a question needs reach the model; this says whether the answer is right, and comparing the three says what extracted memory is worth over the raw sources it was read from.

View Source
const (
	AnswerCorrect  = "correct"
	AnswerPartial  = "partial"
	AnswerStale    = "stale"
	AnswerNotKnown = "not_known"
	AnswerInvented = "invented"
	AnswerWrong    = "wrong"

	// AnswerMissed is "not known" where the person gave an answer: what
	// the answer was given did not hold the fact, which is recall's
	// failure rather than the model's, and is told apart from a wrong
	// answer so the two can be worked on apart.
	AnswerMissed = "missed"

	// AnswerUngraded is a grader whose answer could not be read. It counts
	// as nothing, rather than as a wrong answer the model did not give.
	AnswerUngraded = "ungraded"
)

The verdicts a graded answer can have. See prompts/evaluate_grade.txt.

View Source
const (
	BriefGoalTitle         = "Daily brief"
	AssetEstimateGoalTitle = "Estimate asset values"
)

The goals the daily brief's idea and the asset estimates' switch start are found by their titles.

View Source
const (
	AnsweringMarker = "[answering]"
	ApprovedMarker  = "[approved]"
	DeclinedMarker  = "[declined]"
)

The markers a turn resumed by a late answer begins with. They are the person's word, not turns of the agent's own, so they are not in models.OwnTurnMarkers.

View Source
const (
	RecallDecisionCarried = "carried"

	// RecallDecisionPageLimit: the overlay had expanded as many pages as
	// it expands, or filled its blocks, before this one's turn came.
	RecallDecisionPageLimit = "page_limit"

	// RecallDecisionUnhitPageLimit: no fact on the page was found, and the
	// overlay had expanded as many such pages as it takes.
	RecallDecisionUnhitPageLimit = "unhit_page_limit"

	// RecallDecisionTokenBudget: the page or fact did not fit in what was
	// left of the overlay's tokens.
	RecallDecisionTokenBudget = "token_budget"

	// RecallDecisionAlreadyExpanded: the page was expanded once already.
	RecallDecisionAlreadyExpanded = "already_expanded"

	// RecallDecisionRetired: the fact is folded, struck or superseded, so
	// the page no longer says it.
	RecallDecisionRetired = "retired"

	// RecallDecisionShownOnPage: the fact was carried inside its page's
	// block rather than among the loose facts.
	RecallDecisionShownOnPage = "shown_on_page"

	// RecallDecisionFactLimit: the loose facts were full.
	RecallDecisionFactLimit = "fact_limit"

	// RecallDecisionOutranked: a query found it, but fusing every query's
	// lists left it out of the candidates.
	RecallDecisionOutranked = "outranked"
)

Why a page or fact was carried, or what kept it out.

View Source
const (
	RecallSectionNone             = "none"
	RecallSectionMatchedByMeaning = "matched_by_meaning"
	RecallSectionMatchedByWords   = "matched_by_words"
	RecallSectionFirst            = "first"

	// RecallSectionFirstGaveWay: the meaning search matched the first
	// section, and a later one the question's other words point at was
	// carried instead.
	RecallSectionFirstGaveWay = "first_gave_way_to_words"

	// RecallSectionLeftOutForBudget: the page was carried without its
	// section, which did not fit.
	RecallSectionLeftOutForBudget = "left_out_for_budget"
)

Which section of a page's overview recall carried, and why.

View Source
const (
	RetrievalModeBasic   = "basic"
	RetrievalModePlanned = "planned"
)

The retrieval modes an explanation or an evaluation names: basic is the message's own search alone, planned follows a retrieval plan.

View Source
const (
	RecallQueryMessage = "message" // the message's own words
	RecallQueryPlanned = "planned" // a focused search the plan named
	RecallQueryHop     = "hop"     // the pages linked to the top page the planned searches found
	RecallQueryBroad   = "broad"   // the pages whose overview sections a broad question matched, counted again
)

What each query of a retrieval is.

View Source
const (
	ScenarioStepRecords      = "records"
	ScenarioStepDream        = "dream"
	ScenarioStepCheckpoint   = "checkpoint"
	ScenarioStepConversation = "conversation"
)

The kinds of step.

View Source
const (
	SpeakFirstOnboarding  = "onboarding"
	SpeakFirstPhoneTour   = "phone_tour"
	SpeakFirstMemoryCheck = "memory_check"
	SpeakFirstIdea        = "idea"
	SpeakFirstTrip        = "trip"
)

The reasons the agent speaks first, which are also the subjects of its speak_first jobs.

View Source
const (
	TabControllerAgent  = "agent"
	TabControllerPerson = "person"
)

The holders of a tab: the agent, or the person who took it over.

View Source
const (
	RiskRead        = tools.RiskRead
	RiskWrite       = tools.RiskWrite
	RiskDestructive = tools.RiskDestructive
	RiskOutward     = tools.RiskOutward
	RiskGranting    = tools.RiskGranting
	RiskMoney       = tools.RiskMoney

	FamilyMailbox  = tools.FamilyMailbox
	FamilyDomains  = tools.FamilyDomains
	FamilyAudit    = tools.FamilyAudit
	FamilyPeople   = tools.FamilyPeople
	FamilyServer   = tools.FamilyServer
	FamilyAccount  = tools.FamilyAccount
	FamilyGeneral  = tools.FamilyGeneral
	FamilyServers  = tools.FamilyServers
	FamilySkills   = tools.FamilySkills
	FamilyBrowser  = tools.FamilyBrowser
	FamilyComputer = tools.FamilyComputer
	FamilyFinance  = tools.FamilyFinance
)
View Source
const BriefTimes = "30 7 * * 1-5"

BriefTimes is when the daily brief runs: weekdays at half past seven, in the person's zone.

View Source
const CodingMemoryTag = "teanode-memory"

CodingMemoryTag wraps what a coding session is shown, so that the sources reading its transcript back can leave it out: memory filed again from its own recital would confirm itself.

View Source
const FollowUpStoppedReason = "stopped by the person"

FollowUpStoppedReason is the closed reason of a follow-up the person stopped.

View Source
const ScenarioAnswerFromSurvey = "survey"

ScenarioAnswerFromSurvey answers a question with a survey of the whole graph, the way a question about a whole area is answered when asked for: a model call a page, then one to combine them.

View Source
const ShareFor = 30 * 24 * time.Hour

ShareFor is how long a shared artifact's address stays good: long enough to find in a chat's history, not forever.

View Source
const ShareToOpenFor = 6 * time.Hour

ShareToOpenFor is how long an address made to open a file now stays good: one the drawer draws, or one handed to a program over MCP to fetch. Short, because it is made afresh each time, and an address that opens a file without a sign-in should not outlive the moment it was made for.

View Source
const SharedMemoryIndexLines = 20

SharedMemoryIndexLines is the most roots the prompt's "Shared with you" section lists. The rest are counted and the call that lists them is named, so nothing is cut silently.

View Source
const SpeakFirstMailOrganize = "mail_organize"

SpeakFirstMailOrganize is the look at how the person's mail could be filed: when the Inbox holds a pile of routine mail no rule files, the agent reviews the last week and the folders and rules there are, and offers one card with what it would do. It changes nothing until the person approves.

View Source
const (
	// StatementAddressDetailPrefix begins the detail of a statement import
	// address: the part after the plus, before the token.
	StatementAddressDetailPrefix = "statements-"
)
View Source
const TaxDocumentAddressDetailPrefix = "taxes-"

TaxDocumentAddressDetailPrefix begins the detail of a tax document address: the part after the plus, before the token.

View Source
const (

	// UploadFor is how long a program has to send the bytes of a file it
	// is sending to the main chat.
	UploadFor = time.Hour
)

Variables

View Source
var (
	// ErrSharedUnavailable is every reason a shared tool is not there for
	// the caller to use: the share is gone, the two no longer share a
	// circle, the tool is not one shared, or the skill is not installed. They
	// are not told apart, so that asking is not a way to learn which.
	ErrSharedUnavailable = errors.New("this shared tool is not available any more (it may have been taken back, or the owner is away); tell the person and do not retry")

	// ErrSharedOwnerAway is the owner's agent being switched off, so that
	// their computer cannot be reached.
	ErrSharedOwnerAway = errors.New("the owner's agent is switched off, so their computer cannot be reached")

	// ErrCallNotWaiting is an answer to a call that is not waiting any more:
	// it was answered, or it ran out of time.
	ErrCallNotWaiting = errors.New("that call is not waiting for an answer any more")
)
View Source
var (
	NewCatalog        = tools.NewCatalog
	RenameTools       = tools.Rename
	ActionsOf         = tools.ActionsOf
	NeedsConfirmation = tools.NeedsConfirmation
	Split             = tools.Split
	SearchTools       = tools.SearchTools

	// Location and the time helpers moved to the kit with the datetime tool.
	Location = tools.Location

	// The text and cron helpers moved to the kit too.
	HTMLToText = tools.HTMLToText
)
View Source
var CodingAssistants = []string{"claude-code", "codex"}

CodingAssistants are the source types whose transcripts are coding sessions, which a capture asks to read again.

View Source
var ErrAgentBusy = errors.New("agent: that agent is busy; ask again in a moment")

ErrAgentBusy says an agent has as many turns waiting in a chat as it takes from other people.

View Source
var ErrAnnotationIsThePersons = errors.New("the person wrote this annotation, and the agent changes or removes it only when the person asks in a conversation they are there for")

ErrAnnotationIsThePersons refuses the agent changing what the person wrote on a finance transaction.

View Source
var ErrDeviceDetached = tools.ErrDeviceDetached

ErrDeviceDetached is the device leaving while a question was open, or before it could be sent. A caller that can wait treats it like the device not being there.

View Source
var ErrFeedRefused = errors.New("the feed refuses this")

ErrFeedRefused is wrapped by every refusal of a post or a choice that the caller can fix: a card with no headline, a link already in an open card, a choice already made.

View Source
var ErrLeftOpen = tools.ErrLeftOpen

ErrLeftOpen says a card was not answered while the turn waited, and is still open for the person to answer later.

View Source
var ErrNotGranted = errors.New("agent: not granted for this mailbox")

ErrNotGranted says the person has not let their agent do this with this source.

View Source
var ErrNotStatementAccount = errors.New("only an account from imported statements can be renamed or deleted; " +
	"an account a provider reports comes back as it was with the next sync, so switch off or delete its finance source instead")

ErrNotStatementAccount refuses renaming or deleting a finance account a provider reports: its next sync would bring it back as it was.

View Source
var ErrPDFReaderMissing = errors.New("this server cannot read PDFs: poppler (pdftotext, pdftoppm) is not installed")

ErrPDFReaderMissing is a server without poppler's readers.

View Source
var ErrPaystubUnbalanced = errors.New("its lines do not add up to its printed totals")

ErrPaystubUnbalanced refuses recording a paystub whose lines do not add up to its printed totals, unless the person says to record it anyway.

View Source
var ErrReceiptUnbalanced = errors.New("its lines do not add up to its printed totals")

ErrReceiptUnbalanced refuses recording a receipt whose lines do not add up to its printed totals, unless the person says to record it anyway.

View Source
var ErrUnavailable = errors.New("agent: unavailable")

ErrUnavailable says the agent cannot do this here: agents are off, the feature is off for the deployment, or there is no model to ask.

View Source
var ErrVoiceMessageNotPayable = errors.New("agent: your agent cannot transcribe voice messages now: voice is off on this server, or your agent is off or over its budget")

ErrVoiceMessageNotPayable is a member asking for a voice message's words whose own agent cannot pay for them.

View Source
var FeatureAllowed = tools.FeatureAllowed

FeatureAllowed says whether the deployment offers a feature at all.

Functions

func AddFollowUp added in v0.169.0

func AddFollowUp(tx db.Transaction, agentId string, input NewFollowUp) (*models.AgentFollowUp, error)

AddFollowUp keeps a follow-up the person names. It is held to what extract holds a follow-up read from mail to, since the sweep and the payment matching rely on it: a title; a day, for everything but a parcel; an amount that reads, for a bill. The key is made as extract makes it, so naming a bill the agent already found keeps the one row, and a message that comes later about it finds this row.

A follow-up that is over (closed, expired or stopped) and is named again is opened again, and will be told about again, since the person asking is newer than whatever ended it. One still being watched is left in its state.

func AlertPrompt added in v0.82.0

func AlertPrompt(input *AlertInput) (string, error)

AlertPrompt renders the decision's prompt. The mail, and everything the sorting wrote from it, goes inside a fence: it is a stranger's text, and what the decision writes is read by the person as the agent's word.

func AlertSubjectPattern added in v0.82.0

func AlertSubjectPattern(subject string) string

AlertSubjectPattern is a subject with what changes from one message of a kind to the next taken out: the digits of a code, a count, a date. Lower case, with the spaces collapsed, so "Your code is 481 022" and "Your code is 99 310" are the same message sent twice.

func AssetEstimatePrompt added in v0.91.0

func AssetEstimatePrompt() string

AssetEstimatePrompt is the description of the goal that estimates the person's assets from the web, as the person's own words, because the person is who allowed the estimates. It names only the estimate description as what may be searched with: that is what the person agreed to send to a search provider for each asset. An ordinary goal, like the brief's, which the person can rewrite or stop.

func AttachmentContentType added in v0.155.0

func AttachmentContentType(declared string, content []byte) string

AttachmentContentType is the type kept for an uploaded file: the one declared, unless it says nothing (empty or application/octet-stream) and the bytes are a PDF, so the dashboard shows and opens it as one.

func BackfillFollowUps added in v0.169.0

func BackfillFollowUps(tx db.Transaction, agent *models.Agent, now time.Time, isForced bool) (int, error)

BackfillFollowUps queues the extract runs of the look back for the agent and answers how many messages it queued. Unless isForced, it does so only the first time for the agent: the claim on the agent's follow_up_backfilled_at fails when it already ran, and nothing is queued. A forced run, for the person who turns alerts on later or wants it again, always queues and writes the time anew. An agent with no mailbox granted to it has nothing to look into and is not marked, so the look still happens once there is one.

A message that is already waiting for an extract run keeps that job (the queue holds one open job per message), and a message read again finds the follow-ups it made before by their key, so a second look changes nothing but what is new.

func BriefPrompt

func BriefPrompt(found *models.Agent, owner *models.User) string

BriefPrompt is the daily brief's description, as the person's own words, because the person is who turned it on.

Written here rather than in a template file because it is a starting point rather than a fixed thing: it goes into an ordinary goal, where the Goals screens show it and anybody can rewrite it to say what they actually want to hear each morning.

func BudgetStatus added in v0.87.0

func BudgetStatus(ctx context.Context, tx db.Transaction, fetcher *rates.Fetcher, agentId, month, today string) (*models.BudgetStatus, error)

BudgetStatus is every spending category with a budget in a month ("2006-01"), against its budget, as of today ("2006-01-02", the person's local day): the last day for a past month. Spending in another currency is converted into the budget's at the rate of the day it posted, and spending in a currency with no rate is listed apart rather than guessed. A nil fetcher converts with the rates already stored.

A budget on a spending category counts its child spending categories that have no budget of their own. A budget on an income spending category is the income expected, and is listed apart with a pace of its own (ProjectIncomeCategoryMonth); budget alerts read only the spending.

func CanReadPDFs added in v0.155.0

func CanReadPDFs() bool

CanReadPDFs says whether this server has the readers a PDF needs.

func CaptureCodingSession added in v0.124.0

func CaptureCodingSession(tx db.Transaction, agentId, computerName, assistant string) (bool, error)

CaptureCodingSession asks the computer's sources of a coding tool's transcripts to read again now, so that what was just said is searchable, and the next session can be told where this one stopped, within a minute rather than at the source's next scheduled pass. It says whether any source was asked. A source the person paused stays paused. One asked while a pass runs reads again after it (see markSource), and a burst of short answers before a pass begins is that one pass.

func ChatStreamingKey added in v0.170.0

func ChatStreamingKey(runId string) string

ChatStreamingKey is the identifier of the provisional line a screen draws the words of a run as while they come, before the stored message replaces it. The dashboard and the iPhone app build the same name from the run's identifier (streamingKeyOf, streamingId).

func CheckAnswerSource added in v0.104.3

func CheckAnswerSource(answerFrom string) error

CheckAnswerSource says whether an answer source is one EvaluateAnswer takes, so a run that asks many questions can refuse a misspelled one before it spends anything.

func CheckFeedWithdrawal added in v0.240.0

func CheckFeedWithdrawal(item *models.AgentFeedItem) error

CheckFeedWithdrawal refuses deleting a card the person answered or resolved: it holds their answer, and the person's own way to put a card away is dismissing it, which the agent can do too.

func CountMessages

func CountMessages(items []*models.MailboxItem) int

CountMessages is how many messages a set of items is, which is not how many items it is: one message can be filed twice.

A message somebody sends to themselves is the plain case -- a copy in Sent and a copy in the Inbox, one message, two items -- and so is a message filed in two folders by two rules. Anything asking "is this a conversation yet" has to count messages, or a note to oneself is two.

func CountWithheldFacts added in v0.194.0

func CountWithheldFacts(tx db.Transaction, ownerUserId, pagePath string) (int, error)

CountWithheldFacts is how many of the facts on the owner's pages at this path and under it a share would keep from its reader, because all of their evidence is of a kind with a sharing of its own (see isWithheld). The owner sees it in the preview of a share.

func CurateRecordingSpeakersLocally added in v0.144.0

func CurateRecordingSpeakersLocally(ctx context.Context, settings *Settings, userId, recordingId string) error

CurateRecordingSpeakersLocally runs metadata and audio screening without a model worker.

func DayStart

func DayStart(owner *models.User, now time.Time) time.Time

DayStart is midnight in the person's own zone, which is when the panel says their budget resets and so when every share of a day turns over.

func DecodedSessionData

func DecodedSessionData(data json.RawMessage) string

DecodedSessionData is what a session message carries, for the websocket handler that has it as raw JSON.

func DocumentBytes

func DocumentBytes(ctx context.Context, files storage.Files, document *models.AgentDocument) ([]byte, error)

DocumentBytes is an attachment document's bytes, out of the store.

The work is in the tools package, because the memory tool's `look` reads the same bytes for the person and a tool cannot import this one. Kept here as well so that every caller in this package and in the API says the same name for the same thing.

func DraftPrompt

func DraftPrompt(input *DraftInput) ([]llm.ChatMessage, error)

DraftPrompt builds the messages for one draft call.

func ExtractAttachmentText

func ExtractAttachmentText(ctx context.Context, name, contentType string, content []byte) string

ExtractAttachmentText is what a model reads of a file: its text when it is a text file, valid UTF-8, or a PDF with a text layer, capped; empty otherwise. Called once, when the file is uploaded, and kept on the row. A PDF is known by its bytes, whatever it was declared as.

func FeedPictureFileIDs added in v0.240.0

func FeedPictureFileIDs(item *models.AgentFeedItem) []string

FeedPictureFileIDs are the files of the pictures a card holds in the file store, for deleting them when the card is deleted.

func FollowUpKeyOf added in v0.169.0

func FollowUpKeyOf(kind models.AgentFollowUpKind, key string) string

FollowUpKeyOf is the stored key of a follow-up: the kind in front, then the key in lower case with its spaces gathered, or "" when the key says nothing. Extract and the people who add a follow-up by hand make it the same way, so a later message about a bill someone added finds that row.

A parcel's key is its number when the words carry one: an order number first, since every message from the shop names it, then a tracking number. The model writes the words around it differently each time ("the garden hose order 112-...", "112-..."), and the number is what the next message has in common with the first.

func ForgetAttachments

func ForgetAttachments(ctx context.Context, tx db.Transaction, store storage.Storage, agentId string) error

ForgetAttachments removes every file a person's agent holds, for the person forgetting their agent.

func InterleaveSharedHits added in v0.170.0

func InterleaveSharedHits(hits []*models.SharedHit) []*models.SharedHit

InterleaveSharedHits puts hits in the order a list cut short should keep them: one of each owner's in turn, each owner's own order kept. A search gives every owner's hits one owner after another, so cutting that list at a number would fill it with the first owner's and show nothing of the rest.

func InterpretExtraction

func InterpretExtraction(answer *ExtractAnswer) []models.MailProposal

InterpretExtraction turns the model's answer into proposals, refusing what is not usable: an event with no summary or no start is not an appointment, and a contact with neither an address nor a number is not a person.

func InterpretTriage

func InterpretTriage(answer *TriageAnswer, agent *models.Agent) (*models.MailInsight, error)

InterpretTriage turns the model's answer into an insight, refusing values outside the vocabulary the way a rule would refuse them.

func IsBudgetYear added in v0.104.0

func IsBudgetYear(year, today string) bool

IsBudgetYear says a year, "2006", is one a year's budgets may be asked for on today, "2006-01-02".

func IsFeedOutcomePending added in v0.230.0

func IsFeedOutcomePending(item *models.AgentFeedItem, now time.Time) bool

IsFeedOutcomePending says whether a card is still waiting for the line its turn will write.

func IsImageAttachment

func IsImageAttachment(contentType string) bool

IsImageAttachment says whether a file is a picture a model can look at.

func IsMediaAttachment

func IsMediaAttachment(contentType string) bool

IsMediaAttachment says whether a file is a video or a sound a browser plays in the page.

func IsPDFAttachment added in v0.155.0

func IsPDFAttachment(attachment *models.AgentAttachment) bool

IsPDFAttachment says whether a stored file is a PDF by what was kept of it. An upload's type is corrected from its bytes when it is stored, so the type is enough for any file uploaded since; the name covers the ones before.

func IsStatementSource added in v0.100.0

func IsStatementSource(source *models.AgentKnowledgeSource) bool

IsStatementSource says a source is the finance source of imported statements.

func IsTextAttachment added in v0.250.0

func IsTextAttachment(name, contentType string) bool

IsTextAttachment says whether a file is read as text.

func KnowledgeLanguage added in v0.58.0

func KnowledgeLanguage(agent *models.Agent, user *models.User) string

KnowledgeLanguage is what the agent writes in when nobody is talking to it: its notes, and the triage, summaries, research, drafts and briefs it makes on its own. The agent's own setting for it, else the language the agent or the account was set to, never the one the dashboard happens to be shown in, so that switching the dashboard's language does not switch what the agent keeps; else empty for the model's default.

func Language

func Language(agent *models.Agent, user *models.User) string

Language is what the agent talks to a person in, in a conversation: the agent's own setting, else the account's chosen locale, else the one the dashboard said, else empty for the model's default. Only conversations use it; work the agent does on its own uses KnowledgeLanguage.

func LastStatementImport added in v0.100.0

func LastStatementImport(source *models.AgentKnowledgeSource) *models.FinanceStatementImport

LastStatementImport is the statement source's last import, or nil.

func ListFollowUps added in v0.169.0

func ListFollowUps(tx db.Transaction, agentId string, isOpenOnly bool) ([]*models.AgentFollowUp, error)

ListFollowUps is the agent's follow-ups. Open only, the ones still being watched (open, overdue and stalled) by their day, the nearest first, and those with no day last; otherwise the newest of any state.

func LoadHeaders

func LoadHeaders(ctx context.Context, store storage.Storage, mail *models.Mail) error

LoadHeaders fills a message's headers from the spool, where they live; the row carries the envelope and a few named fields but not the header block. Nothing is changed when the message is no longer stored.

func MailFacts

func MailFacts(mail *models.Mail) []string

MailFacts is what the server already knows about a message, said plainly: how it authenticated, what the spam filter made of it, whether it came from a list or a machine, and the two headers a forgery shows itself in — a Reply-To or a Return-Path pointing somewhere else than the From.

func MinimumMessages

func MinimumMessages(source *models.AgentMailbox) int

MinimumMessages is how long a conversation in this source is before it is summarized unasked.

func Money

func Money(amount float64, currency string) string

Money is an amount as it is written for a person to read: the amount, and the currency the operator says the prices are in.

func MonthBounds

func MonthBounds(when time.Time, owner *models.User) (time.Time, time.Time)

MonthBounds is the first moment of a month and the first of the next, in the person's own zone: what "June 2023" means to them.

func MuteAlert added in v0.82.0

func MuteAlert(tx db.Transaction, agent *models.Agent, alertId string, muteScope models.AlertMuteScope, muteTarget string) (*models.AgentAlertMute, error)

MuteAlert keeps a mute for the agent. With an alert, the target may be left out and is taken from what the alert covered: by default its bursts, or its senders when it was about messages; or the scope asked for. Every target of that scope is muted, and the first mute returned. Without an alert, the target is the person's own, and its scope, when they leave it out, is read from it.

func NetWorthOn added in v0.96.0

func NetWorthOn(ctx context.Context, tx db.Transaction, fetcher *rates.Fetcher, agentId, currencyCode, day string) (string, []string, error)

NetWorthOn is net worth on a day ("2006-01-02") in one currency, as a decimal, with the currencies left out for want of a rate: what a net worth savings target records as its starting amount. A nil fetcher converts with the rates already stored.

func NewBackgroundSurvey added in v0.81.0

func NewBackgroundSurvey(agentId, question, scopePath string) *models.AgentBackgroundWork

NewBackgroundSurvey is a survey to run in the background, not yet placed in a conversation: the tool places it in the turn's, and the API in none.

func NormalizeAlertMute added in v0.82.0

func NormalizeAlertMute(muteScope models.AlertMuteScope, muteTarget string) (string, error)

NormalizeAlertMute checks a scope and puts its target in the form it is matched in: an address or a domain in lower case, a subject key as the alerts keep them, a kind as a word. The kinds are burst, budget, follow_up (every alert about a follow-up), bill, parcel, deadline and event (those follow-ups alone), and the categories of the sorting such as notification.

func NormalizeFeedItem added in v0.230.0

func NormalizeFeedItem(item *models.AgentFeedItem) error

NormalizeFeedItem trims and bounds a card as posted, fills in what a post may leave out, and refuses what cannot be shown.

func NoteCircleInvitation added in v0.170.0

func NoteCircleInvitation(tx db.Transaction, invitedUserId, invitedByName, circleName string) (string, error)

NoteCircleInvitation writes the note into the invited person's main conversation when their agent is on, and says whose agent row holds their phones, or "" when they have none. The note is not a turn: nothing is asked of the model, and the phone is told by NotifyCircleInvitation instead of by the loop that sends what the agent says on its own.

func NoteCircleMemberAdded added in v0.194.0

func NoteCircleMemberAdded(tx db.Transaction, administratorUserId, addedName, circleName string) (string, error)

NoteCircleMemberAdded writes the note into an administrator's main conversation when their agent is on, and says whose agent row holds their phones, or "" when they have none.

func NoteRelationship added in v0.178.0

func NoteRelationship(tx db.Transaction, toldUserId string, noteKind models.AgentNoteKind, detail string) (string, error)

NoteRelationship writes the note into the person's main conversation when their agent is on, and says whose agent row holds their phones, or "" when they have none. noteKind is NoteRelationshipSet or NoteRelationshipRemoved.

func NoteSharing added in v0.194.0

func NoteSharing(tx db.Transaction, toldUserId string, noteKind models.AgentNoteKind, detail string) (string, error)

NoteSharing writes the note into the person's main conversation when their agent is on, and says whose agent row holds their phones, or "" when they have none. noteKind is NoteShareReceived or NoteShareReached.

func OpenConnectionSecret added in v0.170.0

func OpenConnectionSecret(configuration *config.Configuration, value string) (string, error)

OpenConnectionSecret opens a credential that Agent.SealSecret sealed with the server secret, for whoever has the configuration and no agent.

func PeriodPath

func PeriodPath(when time.Time, month bool) string

PeriodPath is where a month or a year lives in the graph.

func PhoneBody added in v0.170.0

func PhoneBody(text string) string

PhoneBody is text as a notification shows it: plain, and short enough that a lock screen is not the place it is read in full. A notification is plain text, so the suggested replies and any other hidden marker, a link's target and the Markdown marks are taken off first.

func PlaceVisitBody added in v0.175.0

func PlaceVisitBody(place *models.Place, isArrival bool, language string) string

PlaceVisitBody is what a notification says about an arrival or a departure, in a language as push.PhoneLanguage names it, or "" when the place is not one to tell anybody about.

func PreviewSharedPage added in v0.170.0

func PreviewSharedPage(tx db.Transaction, ownerUserId string, candidate *models.AgentPageShare, pagePath string) (*models.SharedPage, error)

PreviewSharedPage is exactly what a grantee would be shown of a page if the owner made the share: the same view ReadSharedPage makes, from the shares the grantee already has from the owner and the one being considered. Nil when the owner has no page there. The grantee must be somebody the owner could share with; the caller has checked.

func ReadAttachmentText added in v0.155.0

func ReadAttachmentText(ctx context.Context, store storage.Storage, attachment *models.AgentAttachment) (string, error)

ReadAttachmentText is the text of a stored file, on demand: the text kept on its row when there is some, else the whole text of the PDF read out of storage. For files whose text must not be kept in the database, such as a tax document. Empty, with no error, for a file that is not a PDF or a PDF with no text layer; ErrPDFReaderMissing when the server has no reader.

func ReadSharedPage added in v0.170.0

func ReadSharedPage(tx db.Transaction, readerUserId, ownerUserId, pagePath string) (*models.SharedPage, error)

ReadSharedPage is the page at this path of one owner's graph as the reader is shown it, or nil when no share reaching the reader covers the path, the owner has no page there, or the owner is not who the share says. The reader cannot tell which: a page that is not shared with them is not found, and neither is a sibling of one that is.

func RecordFiled

func RecordFiled(tx db.Transaction, agentId, mailboxId string, mail *models.Mail, insight *models.MailInsight, folderName string) error

RecordFiled records that the person filed a sorted message somewhere the agent's sorting did not put it.

func RecordReplyDeclined

func RecordReplyDeclined(tx db.Transaction, reply *models.AgentReply, how string) error

RecordReplyDeclined records that a reply the agent wrote did not go.

func RecordSorted

func RecordSorted(tx db.Transaction, agentId, mailboxId string, mail *models.Mail, before, after *models.MailInsight) error

RecordSorted records that the person sorted a message themselves, differently from the agent: the category, the priority, whether it needs a reply.

func RecordUsage

func RecordUsage(database db.Database, agentId, mailboxId, model, kind string, usage llm.Usage)

RecordUsage adds what one model call cost to the hourly rows for this agent, source, model and kind of run. Best effort: a row that cannot be written loses accounting, never a run.

func RecordUsageIn

func RecordUsageIn(tx db.Transaction, agentId, mailboxId, model, kind string, usage llm.Usage) error

RecordUsageIn is RecordUsage inside a transaction the caller already holds.

func RenderConduct

func RenderConduct(configuration *config.Configuration, agent *models.Agent, owner *models.User, short bool) (string, error)

RenderConduct renders the system message for a run nobody is present for, in the language of the agent's own work.

func ReplyPrompt

func ReplyPrompt(input *DraftInput, guidance string) ([]llm.ChatMessage, error)

ReplyPrompt builds the messages for one auto-reply call. The draft input carries everything but the guidance, which is the policy's.

func RequireBudget

func RequireBudget(tx db.Transaction, configuration *config.Configuration, agent *models.Agent, owner *models.User, now time.Time) error

RequireBudget is what a run calls before its first model call: it returns a Deferral to the next reset when nothing is left.

func ResolveFeedItem added in v0.240.0

func ResolveFeedItem(tx db.Transaction, resolver *FeedResolver, item *models.AgentFeedItem, resolutionNote string, now time.Time) (*models.AgentFeedItem, error)

ResolveFeedItem marks the card resolved, with the one line saying what cleared. The first resolution stands: a card already resolved is refused, so a later note never replaces the first (unresolve it first). The answer carries what was cut from the note in its post notes.

func SavingSummary added in v0.98.0

func SavingSummary(ctx context.Context, tx db.Transaction, fetcher *rates.Fetcher, agentId, month, today, currencyCode string) (*models.SavingSummary, error)

SavingSummary is a month's saving ("2006-01") in one currency as of today ("2006-01-02", the person's local day): what its income and spending budgets expect, what income less spending has come to so far, and where it is heading. It reads BudgetStatus for the budgets and their projections, so the figures agree with the budgets shown beside it. A nil fetcher converts with the rates already stored.

The expected saving is every income budget less every spending budget, each converted at the rate of the status's day. The actual saving counts all income and all spending the way cash flow does, budgeted or not, each day at its own rate; a currency with a day that has no rate is left out whole and named, as cash flow leaves it out.

func SealConnectionSecret added in v0.170.0

func SealConnectionSecret(configuration *config.Configuration, value string) (string, error)

SealConnectionSecret seals a credential with the server secret, for storing; OpenConnectionSecret opens it. Agent.SealSecret is it for the agent, and a phone's notification key is sealed with it on a server with no agent.

func SearchSharedPages added in v0.170.0

func SearchSharedPages(tx db.Transaction, readerUserId, query string, limit int) ([]*models.SharedHit, error)

SearchSharedPages finds, by words, the pages and facts of shared pages the reader may read, each marked with its owner. The search runs in each owner's graph restricted to the roots shared with the reader, so a page outside them cannot be found by a word on it. By words alone, whatever the reader's own search does: the vectors are the owner's.

func SettleGoalTimes added in v0.232.0

func SettleGoalTimes(times []string, owner *models.User, now time.Time) ([]string, *time.Time, error)

SettleGoalTimes checks a goal's times and says when the soonest is. A distance from now ("@in 20m") becomes the moment it means, so that what is stored does not move every time it is read; a moment that has passed is dropped. Nil next means none of them comes again.

func SharedFileAnswer added in v0.210.0

func SharedFileAnswer(attachment *models.AgentAttachment) map[string]any

SharedFileAnswer is a file as share_file answers with it, the shape the dashboard and the phone draw a file from: the url is the plain path, which they open with the person's session.

func SharedIndexLines added in v0.170.0

func SharedIndexLines(tx db.Transaction, readerUserId string) ([]string, error)

SharedIndexLines is the "Shared with you" section of the index a prompt carries: each shared root with its opening and whose it is, at most SharedMemoryIndexLines of them, and then how many more there are and the call that lists them, so that the section never ends without saying it does. Empty when nothing is shared with the reader.

The order is by owner and path and changes only when a share does. It is read for every turn and carried after the history (sharedIndexOverlay), not in the prompt's front, which a conversation keeps for half an hour.

func SharedPagesFor added in v0.170.0

func SharedPagesFor(tx db.Transaction, readerUserId string) ([]*models.SharedRoot, error)

SharedPagesFor are the roots of the subtrees shared with the reader, with the owner of each named, by owner and then path. A root nested under another of the same owner's is not listed twice: reading the outer one reaches it. A share whose page has since been deleted or moved is skipped, and still exists for its owner to take back.

func ShoppingStoreOfPlace added in v0.201.0

func ShoppingStoreOfPlace(place *models.Place) (string, bool)

ShoppingStoreOfPlace is the store a place is, by the name the person gave it or, when they gave none, its name on the map; and whether things for any store are bought there.

func SkillRunsCommands

func SkillRunsCommands(declared *skills.Tool) bool

SkillRunsCommands says whether carrying this tool out runs anything on a computer, which is what decides that it is held to the shell's rule.

func SourceActive

func SourceActive(agent *models.Agent, mailbox *models.Mailbox) bool

SourceActive says whether a mailbox is a source anything happens for: granted, of an agent that is on and not switched off by an operator.

func StatementImportSummary added in v0.100.0

func StatementImportSummary(result *models.FinanceStatementImport) string

StatementImportSummary is what an import did, in a sentence for the person.

func StopFollowUp added in v0.169.0

func StopFollowUp(tx db.Transaction, agentId, followUpId string) (*models.AgentFollowUp, error)

StopFollowUp stops following one of the agent's follow-ups, or returns nil when the agent has none with that id. One that is already over is returned as it is: stopping a bill that was paid must not rewrite that it was paid.

func StoreFollowUps added in v0.169.0

func StoreFollowUps(tx db.Transaction, findings []FollowUpFinding) error

StoreFollowUps writes what InterpretFollowUps found. A finding that resolves closes the open follow-up with its key, and when there is none writes nothing: a delivery notice for a parcel nobody was told was coming is not something to follow. The others are kept by key, so the same message read twice, or a third notice about one parcel, changes one row.

A parcel that closes this way is also a candidate for an alert saying it was delivered, since that is the news the person was waiting for; a bill or a deadline that a message closes is not, they only wanted to hear of it going wrong.

func SumSpend

func SumSpend(tx db.Transaction, configuration *config.Configuration, agentId string, since time.Time) (int64, float64, error)

SumSpend is what a period came to, in tokens and in money. Usage is kept per model, and each model is priced by its own provider, so a deployment with two providers adds up properly — and grouping by model gives both numbers from the one query, which is why the budget check does not read the same rows twice. An agent id of "" is the whole server.

func SumSpendOfKind

func SumSpendOfKind(tx db.Transaction, agentId, kind string, since time.Time) (int64, error)

SumSpendOfKind is what one kind of run has spent since a time, in tokens.

SumSpend prices everything an agent did, by model, because a budget has to say what it cost. This answers the narrower question a run asks about its own share -- how much of today has already gone on this kind of work -- and the usage rows carry the kind, so it is the same one grouped query with a different key.

func SummarizePrompt

func SummarizePrompt(input *SummarizeInput) ([]llm.ChatMessage, error)

SummarizePrompt builds the messages for one summarize call.

func TaxMailSummary added in v0.155.0

func TaxMailSummary(copied []*models.AgentAttachment, canReadPDFs bool) string

TaxMailSummary is what came of a message mailed to the tax document address, in a sentence for the person: the files being read, or why nothing is.

func TriagePrompt

func TriagePrompt(input *TriageInput) ([]llm.ChatMessage, error)

TriagePrompt renders the two messages a triage call sends.

func UnresolveFeedItem added in v0.240.0

func UnresolveFeedItem(tx db.Transaction, resolver *FeedResolver, item *models.AgentFeedItem, now time.Time) (*models.AgentFeedItem, error)

UnresolveFeedItem takes the mark off a card, whoever resolved it.

func UnwantedCategory

func UnwantedCategory(category string) bool

UnwantedCategory says whether the sorting put a message in the two categories nobody wants, which is what the rule every mailbox starts with matches.

func YearBudgetStatus added in v0.104.0

func YearBudgetStatus(ctx context.Context, tx db.Transaction, fetcher *rates.Fetcher, agentId, year, today string) (*models.BudgetStatus, error)

YearBudgetStatus is every spending category with a budget in any month of a year ("2006"), against the budgets of its months, as of today ("2006-01-02"). Each month that has begun is read with BudgetStatus and each month still to come with the budgets in force for it, then ProjectSpendingCategoryYear and ProjectIncomeCategoryYear add them up.

A spending category is reported in the currency of its budget in the latest month begun (the first month to come for a budget that has not started). A month whose budget was in another currency is converted at the rate of that month's as-of day; one with no rate is left out, its spending or income reported as unconverted.

func YearSavingSummary added in v0.104.0

func YearSavingSummary(ctx context.Context, tx db.Transaction, fetcher *rates.Fetcher, agentId, year, today, currencyCode string) (*models.SavingSummary, error)

YearSavingSummary is a year's saving ("2006") in one currency as of today ("2006-01-02"), built from its months: each month begun is its SavingSummary, and each month still to come expects what the budgets in force for it expect, converted at the as-of day's rate.

Only the months in which at least one budget, income or spending, is in force count, and BudgetedMonths names them: expected, actual and projected alike, so nine months of income and spending are never set against four months of budgets. A year with no budget in any month counts all twelve instead, with nothing expected, no difference and no pace to speak of.

The expected saving is every counted month's income budgets less its spending budgets. The projected income is the counted months begun as their summaries project them and each counted month to come at its income budgets; the projected spending is the counted months begun the same way and each counted month to come at their average (or at its spending budgets when none has begun), the way ProjectSpendingCategoryYear carries a budget's year on. The counts are of the spending categories with a budget in any month.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent is the worker and, for the rest of the server, the way to hand it work.

func New

func New(settings *Settings) *Agent

New builds the agent. Register handlers, then Start.

func (*Agent) AddTabViewer added in v0.189.0

func (self *Agent) AddTabViewer(agentId string, viewer TabViewer)

AddTabViewer opens a view of the person's browser, watching nothing until the viewer says which tab.

func (*Agent) AnnotateTransaction added in v0.118.0

func (self *Agent) AnnotateTransaction(ctx context.Context, agentRow *models.Agent, financeTransactionId, annotation string, annotatedBy models.AnnotatedBy, canReplacePersonAnnotation bool) (*models.FinanceTransaction, error)

AnnotateTransaction writes what the person or their agent says about a finance transaction, empty to take it away, and answers the finance transaction as it is now. The agent overwrites or removes the person's only when canReplacePersonAnnotation, which is the person asking for it in a conversation they are there for; never in a run with nobody present (ErrAnnotationIsThePersons). The person always may. What the agent writes is the agent's either way.

func (*Agent) AnswerHerdrQuestion added in v0.120.0

func (self *Agent) AnswerHerdrQuestion(ctx context.Context, agentId, computerName, paneId, questionFingerprint string, optionNumbers []int, optionLabels []string, freeText string) (*HerdrAnswer, error)

AnswerHerdrQuestion answers the question a session waits on, if it is still the one with this fingerprint.

func (*Agent) AnswerSharedCall added in v0.170.0

func (self *Agent) AnswerSharedCall(ctx context.Context, ownerUserId, callId string, isApproved bool, answerNote string) (*models.SkillShareCall, error)

AnswerSharedCall is the owner's answer to a call that waits. The API refuses an agent's operations before it gets here, and no tool calls it; and it accepts an approval only from the dashboard's session or the phone app's own sign-in, so a program run with the owner's saved command line sign-in cannot approve. The shell and terminal tools asking first about a command that looks like an answer (tools.AnswersSkillShareCall) is a courtesy on top. Refused with ErrSharedUnavailable while either account is disabled or the owner lacks agent:use.

Approving runs exactly the call that was stored, with the arguments that were shown, through the owner's own runner; the limits are skipped, since the approval is the owner's word on this call. Answering twice, from the phone and the drawer at once, changes the row once and runs the call once.

func (*Agent) Apply

func (self *Agent) Apply(run *AskRun, command RunCommand) bool

Apply gives the run the word here. It says whether anything was waiting for it: a stop always is.

func (*Agent) Ask

func (self *Agent) Ask(settings *AskSettings) (*AskRun, error)

Ask starts a turn. It returns at once; the run streams what happens.

func (*Agent) AttachComputer

func (self *Agent) AttachComputer(agentId string, connection DeviceConnection, identity ComputerIdentity)

AttachComputer records a person's computer by its name; a second attach under the same name replaces the first, and a different name is another computer beside it.

func (*Agent) AttachTab

func (self *Agent) AttachTab(agentId string, connection TabConnection, title, url string)

AttachTab records a person's tab; a second attach replaces the first.

func (*Agent) BackgroundCommands added in v0.57.0

func (self *Agent) BackgroundCommands(ctx context.Context, agentId string) ([]*BackgroundCommand, error)

BackgroundCommands are the background commands on a person's computers, newest first on each.

func (*Agent) BeforeDeletingAgent added in v0.87.0

func (self *Agent) BeforeDeletingAgent(ctx context.Context, tx db.Transaction, agentId string) error

BeforeDeletingAgent ends each of an agent's finance sources at its provider, best effort, before the agent and everything it has are deleted. The API calls it before DeleteAgent.

func (*Agent) BeforeDeletingSource added in v0.87.0

func (self *Agent) BeforeDeletingSource(ctx context.Context, tx db.Transaction, source *models.AgentKnowledgeSource, closedOn string) error

BeforeDeletingSource is what deleting a finance source does first, in the deleting transaction: it ends the finance source at its provider, best effort, so the operator stops paying for a link nobody can reach, and turns the assets its finance accounts valued into manual ones closed on closedOn, so their history outlives the source and net worth stops counting them. Any other kind of source needs nothing. The API calls it before DeleteAgentSource.

func (*Agent) BrowserConnected added in v0.69.0

func (self *Agent) BrowserConnected(agentId string) bool

BrowserConnected says whether a person's browser is connected through the extension, with a tab to act in or not.

func (*Agent) CallDirect

func (self *Agent) CallDirect(
	ctx context.Context,
	owner *models.User,
	person *models.Agent,
	operations tools.Operations,
	surface string,
	origin string,
	resultCharacters int,
	name string,
	arguments json.RawMessage,
) (*tools.Result, error)

CallDirect runs one tool by name, as this person, outside a conversation. The tool decides what it may do; the person's permissions decided whether it was offered at all. resultCharacters is how much of an answer the caller takes in one piece, or zero for the usual bound.

func (*Agent) CanSurvey added in v0.81.0

func (self *Agent) CanSurvey() bool

CanSurvey says whether a survey can be run now, for the API to refuse one at once rather than queue work that fails.

func (*Agent) CancelRecordingTranscription added in v0.142.0

func (self *Agent) CancelRecordingTranscription(transaction db.Transaction, userId, runId string) (*models.RecordingTranscriptRun, error)

CancelRecordingTranscription stops local work only after its durable state commits.

func (*Agent) CastEnded added in v0.189.0

func (self *Agent) CastEnded(agentId string, connection TabConnection, tab string)

CastEnded is the extension saying a stream ended on its own: Chrome let the debugger go, because the person at the machine cancelled it or opened the developer tools there. The views of that tab watch nothing rather than freeze on the last picture; watching it again asks again.

func (*Agent) Catalog

func (self *Agent) Catalog() *Catalog

Catalog is every tool the server knows.

func (*Agent) CheckProviderPrices added in v0.165.0

func (self *Agent) CheckProviderPrices(ctx context.Context, isForced bool) ([]*models.AgentBillingCheck, error)

CheckProviderPrices compares the configured prices of every openai provider that has a billing key with what its bill says, sets the ones that differ, and tells the operators. Unless isForced it does nothing when a check ran within the day, here or on another server. It answers the checks it made, one per provider.

func (*Agent) ChooseFeedItem added in v0.230.0

func (self *Agent) ChooseFeedItem(ctx context.Context, settings *FeedChoiceSettings) (*models.AgentFeedItem, error)

ChooseFeedItem carries out what a button of a card says, once. A dismiss settles the card and answers its durable question with no turn. An action says the choice in the person's main conversation, as their own message with the card attached, so that an ordinary turn carries it out; the card then shows that turn's first line as its outcome. A coding session's option answers the session directly with no message. A discuss or open button changes nothing here: the screen opens the conversation or the session. A turn answering for the person (AnsweringConversationID) records an action's answer and carries it out itself.

func (*Agent) CloseHerdrSession added in v0.120.0

func (self *Agent) CloseHerdrSession(ctx context.Context, agentId, computerName, paneId string) (*HerdrClose, error)

CloseHerdrSession ends a session's coding agent and its pane; refused while it works.

func (*Agent) CodingPromptRecall added in v0.124.0

func (self *Agent) CodingPromptRecall(ctx context.Context, found *models.Agent, owner *models.User, request *CodingRequest) (*CodingContext, error)

CodingPromptRecall is what a prompt typed in a coding session recalls: the recall a turn would carry, kept to the checkout's project, the pages under it, the pages it links to and the lessons, less the pages the session was shown in its last few prompts.

func (*Agent) CodingSessionStart added in v0.124.0

func (self *Agent) CodingSessionStart(ctx context.Context, found *models.Agent, owner *models.User, request *CodingRequest) (*CodingContext, error)

CodingSessionStart is what a coding session starting in a directory is shown: the checkout's project pages and their liveliest facts, and where the last session there stopped. Lessons wait for a prompt: matched to a whole project they were about anything at all.

func (*Agent) ComputerAnswered

func (self *Agent) ComputerAnswered(agentId string, connection DeviceConnection, id int64, ok bool, data json.RawMessage, failure string)

ComputerAnswered is a computer answering a request.

func (*Agent) ComputerBackgroundEnded added in v0.57.0

func (self *Agent) ComputerBackgroundEnded(agentId string, connection DeviceConnection, data json.RawMessage)

ComputerBackgroundEnded is a computer saying a background command ended.

func (*Agent) ComputerHerdrChanged added in v0.120.0

func (self *Agent) ComputerHerdrChanged(agentId string, connection DeviceConnection, data json.RawMessage)

ComputerHerdrChanged is a computer saying, unasked, that a question came or went in one of its herdr panes, or that a watched session finished.

func (*Agent) ComputerSessionSaid

func (self *Agent) ComputerSessionSaid(agentId string, connection DeviceConnection, id, event, stream, data string, code int)

ComputerSessionSaid routes what a computer said about a session.

func (*Agent) ComputersAttached

func (self *Agent) ComputersAttached(agentId string) []AttachedComputer

ComputersAttached are the computers a person has attached, for the API.

func (*Agent) ConnectBrowser added in v0.69.0

func (self *Agent) ConnectBrowser(agentId string, connection TabConnection, title, url string, hasTab bool)

ConnectBrowser records a person's browser, connected through the extension, with a tab to act in or with none yet; a second connection replaces the first.

func (*Agent) CopyMailTaxDocuments added in v0.155.0

func (self *Agent) CopyMailTaxDocuments(ctx context.Context, agentRow *models.Agent, mailId string) ([]*models.AgentAttachment, error)

CopyMailTaxDocuments copies the PDFs and pictures a stored message carries into uploads of the agent's, marked tax documents and so with no text kept, for reading each on its own. A part too large, or of another kind, is left. It answers the uploads made, none when the message carries no such file.

func (*Agent) CurateRecordingSpeakers added in v0.144.0

func (self *Agent) CurateRecordingSpeakers(ctx context.Context, userId, recordingId string) error

CurateRecordingSpeakers derives clean references only from explicit confirmed intervals. Lack of suitable audio is a successful result with no new references.

func (*Agent) DeletePaystub added in v0.155.0

func (self *Agent) DeletePaystub(ctx context.Context, agentRow *models.Agent, paystubId string) error

DeletePaystub deletes a paystub and the file it was read from.

func (*Agent) DeleteReceipt added in v0.118.0

func (self *Agent) DeleteReceipt(ctx context.Context, agentRow *models.Agent, receiptId string) (*models.FinanceReceipt, error)

DeleteReceipt deletes a receipt with its lines and matches, and the photo or PDF it was read from unless a conversation holds the same file. It answers the receipt as it was.

func (*Agent) DeleteStatementAccount added in v0.108.0

func (self *Agent) DeleteStatementAccount(ctx context.Context, agentRow *models.Agent, financeAccountId string) (*db.FinanceAccountDeleted, error)

DeleteStatementAccount deletes an account of imported statements with its transactions and the assets that value it. A transfer one of its transactions was paired in is judged again in the same transaction: the other side is paired with what remains, or given the provider category mapping and the spending rules again, and left to the categorize job when nothing places it.

func (*Agent) DeleteTaxForm added in v0.155.0

func (self *Agent) DeleteTaxForm(ctx context.Context, agentRow *models.Agent, taxFormId string) error

DeleteTaxForm deletes a tax form and the file it was read from.

func (*Agent) DetachComputer

func (self *Agent) DetachComputer(agentId string, connection DeviceConnection)

DetachComputer forgets a person's computer, if this connection is the one attached under its name.

func (*Agent) DetachTab

func (self *Agent) DetachTab(agentId string, connection TabConnection)

DetachTab forgets a person's tab, if this connection is the one attached.

func (*Agent) Digest

func (self *Agent) Digest(ctx context.Context, agent *models.Agent, owner *models.User, from, until time.Time) (string, error)

Digest is what happened between two moments, as text for a prompt.

Empty when nothing happened, which is the answer for a quiet month and is not an error.

func (*Agent) DirectTools

func (self *Agent) DirectTools(ctx context.Context, person *models.Agent, operations tools.Operations) []*tools.Tool

DirectTools is the catalog as this person sees it, for a caller that will choose a tool itself rather than have a model choose one.

It is built the way a turn's catalog is built -- what their permissions allow, less what the operator switched off, plus the tools of the servers they have connected and the skills the operator installed -- with a few left out.

ask_user goes because there is nobody at this end to answer it; see Ask above. tool_search goes because it exists to keep a long catalog out of a model's request until it is wanted, and a caller that lists tools once and keeps the list is better served by the list.

func (*Agent) DraftReply

func (self *Agent) DraftReply(ctx context.Context, request *models.AgentDraftRequest) (*models.AgentDraft, error)

DraftReply writes a reply to a message for the person to read. It is the one thing the agent does in the request rather than from the queue, because the person is sitting in the composer waiting for it.

func (*Agent) EmbedGraph

func (self *Agent) EmbedGraph(ctx context.Context, agent *models.Agent, limit int) (int, error)

EmbedGraph gives vectors to pages and facts that have none, or whose vector an older model made, and says how many it wrote.

func (*Agent) EmbedOverviewSections added in v0.89.0

func (self *Agent) EmbedOverviewSections(ctx context.Context, agent *models.Agent, limit int) (int, error)

EmbedOverviewSections gives a vector to every overview section that has none, most important pages first and at most so many, and removes the vectors of sections no overview holds any more. It says how many it wrote.

The pages it embeds for are the overviewSectionPages most important, but a vector of a page outside them is not therefore stale: the page may only have slipped down the order. Such a vector goes only when its page, read again, is gone, dormant, or no longer has that section.

func (*Agent) EmbedPhotoSearch added in v0.171.0

func (self *Agent) EmbedPhotoSearch(ctx context.Context, agent *models.Agent, searchText string) *db.PhotoSearchMeaning

EmbedPhotoSearch is the words of a photo search as the vector a described photo is compared to, with the name of the model that read them. Nil when the deployment has no embedding model or it did not answer: the search is then by words alone.

func (*Agent) Enqueue

func (self *Agent) Enqueue(tx db.Transaction, kind models.AgentJobKind, agentId, mailboxId, subjectId string) (*models.AgentJob, error)

Enqueue adds a job inside the caller's transaction. A job for the same agent, kind and subject that is already queued or running is returned instead of a second one.

func (*Agent) EnsureStatementSource added in v0.100.0

func (self *Agent) EnsureStatementSource(ctx context.Context, agentRow *models.Agent) (*models.AgentKnowledgeSource, error)

EnsureStatementSource is the agent's statement source, made with a fresh import token and account key the first time it is asked for, in a transaction of its own so it is there for whatever asks next. Two asking at once make one: the second finds the first's.

func (*Agent) EnsureVectorIndexes

func (self *Agent) EnsureVectorIndexes(ctx context.Context) error

EnsureVectorIndexes builds the vector index for every table and every model that has written a vector. Called at start, and again whenever a model writes its first vector, so that the index exists before a corpus arrives rather than having to be built over one.

func (*Agent) EvaluateAnswer added in v0.60.0

func (self *Agent) EvaluateAnswer(ctx context.Context, found *models.Agent, owner *models.User, question, expectedAnswer, outdatedAnswer, answerFrom string, plan *RetrievalPlan) (*AnswerEvaluation, error)

EvaluateAnswer answers a question from one kind of context, with the model a conversation uses, and grades the answer against the one the person gave. Both calls are runs of kind evaluate, so they are listed and priced like any other call and never touch the conversations or the graph.

memory@planned and both@planned recall following the plan given, as a live turn follows its depth judgement's; no model is asked for one.

func (*Agent) ExplainRecall added in v0.89.0

func (self *Agent) ExplainRecall(ctx context.Context, found *models.Agent, owner *models.User, question string, plan *RetrievalPlan) ([]*RecalledPage, *RecallExplanation, error)

ExplainRecall answers what recall would carry for a question, as RecallForQuestion does, and why: the explanation of every page and fact the searches found. A plan given is followed as a live turn follows the depth judgement's, without asking any model for one; nil is basic recall. Nothing is marked as used.

func (*Agent) FindRun

func (self *Agent) FindRun(runId string) *AskRun

FindRun is a run in flight or recently finished, or nil.

func (*Agent) FinishRecordingCapture added in v0.154.0

func (self *Agent) FinishRecordingCapture(transaction db.Transaction, userId, recordingId string) error

FinishRecordingCapture does, once, the work runs of an unfinished capture skipped: the memory sync and the naming job. The caller has just moved the capture to stopped. When some piece is still being transcribed, nothing is done here, because that piece's own completion sees a stopped capture and does the same.

func (*Agent) FocusHerdrSession added in v0.174.0

func (self *Agent) FocusHerdrSession(ctx context.Context, agentId, computerName, paneId string) (*HerdrSession, error)

FocusHerdrSession brings a session's tab forward in herdr on its computer, so whoever sits there sees it.

func (*Agent) FoldByWordsIntoWhatThePageSays

func (self *Agent) FoldByWordsIntoWhatThePageSays(tx db.Transaction, written *models.AgentFact, node *models.AgentNode) (*models.AgentFact, error)

FoldByWordsIntoWhatThePageSays is the fold without the fact's meaning: the twin is found by names and words alone. For a caller that is already inside a transaction it cannot leave -- a dashboard request, which runs whole inside one -- and must not hold it, and the page's row lock, through a provider call.

func (*Agent) FoldIntoWhatThePageSays

func (self *Agent) FoldIntoWhatThePageSays(ctx context.Context, tx db.Transaction, written *models.AgentFact, node *models.AgentNode) (*models.AgentFact, error)

FoldIntoWhatThePageSays merges a fact just written into the one already on the page that says the same thing, and reports which it became.

Every writer needs this and for the same reason: nobody writing a fact has read the page first. A conversation that comes back to a subject is filed by two runs a day apart, neither knowing of the other, and both doing their job; a person adding a line by hand is not going to reread thirteen of them. Left to itself a page ends up saying one thing nine ways, which is worse than saying it once and worse than not saying it, because every answer drawn from it is a little different.

The older one stays: its number is what anything else cites. It gains whatever evidence the new one brought, and the new one goes dormant behind it -- kept, searchable, out of the page -- so a fold the person disagrees with is there to be undone. What happened is in the page's history either way.

What it will not do is guess. Folding with nobody watching is only safe where the two are the same sentence twice; anything that reads alike but says something different is left standing beside its twin, so that the newer is recalled as well as the older. See whatToFold.

func (*Agent) ForeignRun

func (self *Agent) ForeignRun(runId string) (string, bool)

ForeignRun is the conversation of a run another instance is running, as heard through the feed, and whether it is known at all.

A run this instance has not heard of, because it began before this instance started or has been quiet, is found in the record of the turns that are running.

func (*Agent) ForgetConnection

func (self *Agent) ForgetConnection(serverName, agentId string)

ForgetConnection drops a person's session with a server, after a disconnect or a new credential.

Every session with that server as that person goes, whichever computer it was through: a new credential or a new reach is true of all of them.

func (*Agent) ForgetSkills

func (self *Agent) ForgetSkills()

ForgetSkills makes the next look read the rows again, for when one has just been installed or taken away.

func (*Agent) Forward

func (self *Agent) Forward(command RunCommand) error

Forward says the word to the other instances, for the one running the turn to apply. Whether anything was waiting for it is not known here.

func (*Agent) ForwardAuthorization added in v0.73.0

func (self *Agent) ForwardAuthorization(ctx context.Context, agentId string, server *config.AgentMCPServer, forwardURL, computerName string) (string, error)

ForwardAuthorization asks the person's attached computer to listen on its loopback interface for a server's authorization and send the browser that brings it on to forwardURL. The answer is the loopback address to give the service, which only a browser on that computer can reach.

The computer is the one the person named, since it is the one they are signing in on; else the server's reach; else the only one attached.

func (*Agent) HandBackTab added in v0.189.0

func (self *Agent) HandBackTab(agentId string) bool

HandBackTab gives the tab back to the agent. It says whether the person held it.

func (*Agent) HerdrComputerNames added in v0.120.0

func (self *Agent) HerdrComputerNames(agentId string) []string

HerdrComputerNames are the names of a person's computers whose program watches herdr, for the dashboard to say where it looked.

func (*Agent) HerdrSessions added in v0.120.0

func (self *Agent) HerdrSessions(ctx context.Context, agentId, computerName string) ([]*HerdrSession, []string, error)

HerdrSessions are the coding sessions on a person's computers, every computer's or one's, by computer and pane, and the computers that did not answer: a computer left out of the list is not one whose questions went.

func (*Agent) HerdrWakeConversation added in v0.120.0

func (self *Agent) HerdrWakeConversation(ctx context.Context, agentId, conversationId string) (string, error)

HerdrWakeConversation is the conversation a watch from the dashboard or the command line wakes: the one named, when it is the person's own and one a turn can be woken in, or their main conversation.

func (*Agent) ImportStatementFiles added in v0.100.0

func (self *Agent) ImportStatementFiles(ctx context.Context, agentRow *models.Agent, owner *models.User, files []*StatementFile, origin models.StatementImportOrigin, mailId, agentJobId string) (*models.FinanceStatementImport, error)

ImportStatementFiles imports OFX files into the agent's statement source, records what came of it as the source's last import, and answers it. A file that cannot be read is named in the answer's error and the others are still imported; the error comes back as an error only when the database fails. mailId names the message the files came from, for the import job to know it has done this one already, and agentJobId the job importing them, remembered on the transactions it inserts; empty for a person's own upload.

func (*Agent) ImportTransactionRows added in v0.108.0

func (self *Agent) ImportTransactionRows(ctx context.Context, agentRow *models.Agent, owner *models.User, check *finance.TransactionRowsCheck, agentJobId string) (*models.FinanceStatementImport, error)

ImportTransactionRows imports one account's transaction rows, checked already (finance.CheckTransactionRows), into the agent's statement source, the way a statement is imported, and records it as the source's last import. Only the rows the chosen account does not hold already are written (planTransactionRows). Rows whose account cannot be chosen are refused, wrapping finance.ErrTransactionRowsRefused, before anything is written: the plan is made once as PreviewTransactionRows makes it, then again under the statement source's lock, so two imports of the same rows at once cannot both find them new. A refusal the second time is returned as the first is, and leaves the source's last import as it was.

func (*Agent) IsStatementImportToken added in v0.100.0

func (self *Agent) IsStatementImportToken(tx db.Transaction, mailbox *models.Mailbox, token string) bool

IsStatementImportToken is the delivery hook's question: is this the token of the statement import address of the mailbox's owner? Only when the agent is on, finance is offered, the person's agent is active and their statement source is switched on. Asked inside the delivery transaction, so it reads and decides and nothing more.

func (*Agent) IsTabTakenOver added in v0.189.0

func (self *Agent) IsTabTakenOver(agentId string) bool

IsTabTakenOver says whether the person holds their tab.

func (*Agent) IsTaxDocumentToken added in v0.155.0

func (self *Agent) IsTaxDocumentToken(tx db.Transaction, mailbox *models.Mailbox, token string) bool

IsTaxDocumentToken is the delivery hook's question: is this the token of the tax document address of the mailbox's owner? Only when the agent is on, finance is offered and the person's agent is active. Asked inside the delivery transaction, so it reads and decides and nothing more.

func (*Agent) JudgeRetrievalPlan added in v0.93.0

func (self *Agent) JudgeRetrievalPlan(ctx context.Context, found *models.Agent, owner *models.User, question string) (*JudgedPlan, error)

JudgeRetrievalPlan asks the depth judgement about a question on its own, as a turn's first message, for an evaluation to replay the plan a live turn would follow. It is one call to the fast model, made only when asked for and priced like any other; a replay given the plan asks nothing.

func (*Agent) KnowledgeMeaning

func (self *Agent) KnowledgeMeaning(agentId string) indexed.Meaning

KnowledgeMeaning is the meaning half of a search of what was indexed, for a caller that is not in a turn: the API, and the command line and the dashboard through it.

The person searching their own documents is ranked the same way their agent's tool is, which is the whole point of one search shared between the surfaces. It embeds the question, which a turn does once and keeps; there is nothing to keep here, so each search pays for its own.

func (*Agent) LatestIn

func (self *Agent) LatestIn(conversationId string) *AskRun

LatestIn is the last turn of a conversation, running or just finished, for a caller that asked, could not wait to the end, and has come back for the rest.

A finished run is handed back rather than withheld, because the caller coming back a second late would otherwise be told there is nothing to wait for and never hear the answer. Subscribing to a finished run replays what it said and closes, which is exactly what they want. A run is forgotten ten minutes after it ends, and after that there is nothing to hand back and the conversation itself is where the answer is.

func (*Agent) LessonsForQuestion added in v0.94.0

func (self *Agent) LessonsForQuestion(ctx context.Context, found *models.Agent, owner *models.User, question string) []string

LessonsForQuestion is the lessons a turn asking this would be shown.

func (*Agent) LikeFeedItem added in v0.230.0

func (self *Agent) LikeFeedItem(ctx context.Context, agentId string, item *models.AgentFeedItem, isLiked bool) (*models.AgentFeedItem, error)

LikeFeedItem records a like or an unlike, and writes it to the agent's memory as a preference about the card's subject, which the goals that post read before choosing what to post.

func (*Agent) ListIdeas added in v0.76.0

func (self *Agent) ListIdeas(ctx context.Context, tx db.Transaction, agent *models.Agent, owner *models.User, statuses []models.AgentIdeaStatus, kinds []models.AgentIdeaKind, language string) ([]*models.AgentIdea, error)

ListIdeas is the agent's ideas in the statuses and kinds asked for, or in all, brought up to date first, in the language asked for where the catalog has it.

func (*Agent) MarkIdeasShown added in v0.76.0

func (self *Agent) MarkIdeasShown(tx db.Transaction, agent *models.Agent, ideaIds []string) error

MarkIdeasShown notes that ideas were put in front of the person.

func (*Agent) MatchReceipt added in v0.118.0

func (self *Agent) MatchReceipt(ctx context.Context, agentRow *models.Agent, receiptId, financeTransactionId, matchedAmount string) (*models.FinanceReceipt, error)

MatchReceipt matches a receipt to a finance transaction by hand, as the person's, which the matcher never removes: with the amount of the charge the receipt explains, or when that is empty, the charge's amount or the receipt's total, whichever is less. Matching it again changes the amount. One receipt may be matched to several charges (an order shipped in parts) and one charge to several receipts.

func (*Agent) MeaningSearch

func (self *Agent) MeaningSearch(ctx context.Context, agent *models.Agent, mailboxId, query string, limit int) ([]string, error)

MeaningSearch is meaningSearch for the API and for tests.

func (*Agent) MigrateMemories

func (self *Agent) MigrateMemories(ctx context.Context, agent *models.Agent) error

MigrateMemories moves an agent's flat memories onto the graph, once.

Done here rather than in the migration because a page and a fact need identifiers this package makes, and because doing it lazily means the old table is untouched: a deployment that goes back a release finds its memories exactly as they were.

func (*Agent) NotifyPhone added in v0.128.0

func (self *Agent) NotifyPhone(ctx context.Context, phone *models.AgentPhone, content *push.Content) error

NotifyPhone sends one notification to one phone and records how it went.

func (*Agent) OAuthSettings

func (self *Agent) OAuthSettings(server *config.AgentMCPServer, redirectURL string) *mcp.OAuthSettings

OAuthSettings is the flow for a server, from the configuration.

func (*Agent) OnMailboxDelivery

func (self *Agent) OnMailboxDelivery(tx db.Transaction, mailbox *models.Mailbox, item *models.MailboxItem, mail *models.Mail)

OnMailboxDelivery is the delivery hook: a message has just been placed in a mailbox, inside the delivery transaction. If the mailbox is a granted source of an active agent, the processing jobs are queued in the same transaction — and nothing else happens here, because a model call inside the SMTP transaction would be a model outage bouncing mail.

func (*Agent) OnStatementDelivery added in v0.100.0

func (self *Agent) OnStatementDelivery(tx db.Transaction, mailbox *models.Mailbox, item *models.MailboxItem, mail *models.Mail)

OnStatementDelivery is the delivery hook for a message that reached a statement import address, already filed: it queues the import, in the delivery transaction, and does nothing else there.

func (*Agent) OnTaxDocumentDelivery added in v0.155.0

func (self *Agent) OnTaxDocumentDelivery(tx db.Transaction, mailbox *models.Mailbox, item *models.MailboxItem, mail *models.Mail)

OnTaxDocumentDelivery is the delivery hook for a message that reached a tax document address, already filed: it queues the tax_mail job, in the delivery transaction, and does nothing else there.

func (*Agent) OpenHerdrSession added in v0.120.0

func (self *Agent) OpenHerdrSession(ctx context.Context, agentId, computerName, directory, codingAgentKind, agentName string, shouldSkipPermissions bool, paneId string) (*HerdrSession, error)

OpenHerdrSession starts a coding agent, "claude" or "codex", in a new herdr pane in a directory of the person's on a computer.

Given paneId, it opens beside that pane instead: a new tab in the pane's workspace, in its directory and with its coding agent unless directory and codingAgentKind say otherwise.

func (*Agent) OpenSecret

func (self *Agent) OpenSecret(value string) (string, error)

OpenSecret opens what SealSecret sealed.

func (*Agent) OperationsFor

func (self *Agent) OperationsFor(ctx context.Context, owner *models.User) (Operations, error)

OperationsFor is what a run made for a person outside a request — a scheduled run, a turn from a chat app — may do: what the person may.

func (*Agent) Phones added in v0.170.0

func (self *Agent) Phones() *PhoneNotifier

Phones is what sends this agent's notifications, which is the chat hub's as well on a running server.

func (*Agent) PhotoDescriptionUnavailableMessage added in v0.171.0

func (self *Agent) PhotoDescriptionUnavailableMessage(configuration *config.Configuration) string

PhotoDescriptionUnavailableMessage says why photos cannot be described, in words for the person, or "" when they can: the agent is on, and a model for the bulk work that reads pictures is configured.

func (*Agent) PlanUsage added in v0.85.0

func (self *Agent) PlanUsage(provider string) *llm.PlanUsage

PlanUsage is what the named provider's plan last said of its allowance, or nil for a provider paid by the token, or one whose plan has never answered.

func (*Agent) PostFeedItem added in v0.230.0

func (self *Agent) PostFeedItem(ctx context.Context, post *FeedPost) (*models.AgentFeedItem, models.FeedChange, error)

PostFeedItem stores a card in the agent's person's feed, replacing the open card that has the same coalesce key. A decision with an action raises its durable question in the posting turn's conversation, which nothing waits on, and an urgent card notifies the person's phones.

func (*Agent) PreviewReceipt added in v0.118.0

func (self *Agent) PreviewReceipt(ctx context.Context, agentRow *models.Agent, receipt *models.FinanceReceipt) (*ReceiptPreview, error)

PreviewReceipt checks a receipt and finds the charges it could explain, writing nothing: what RecordReceipt would do with it.

func (*Agent) PreviewTransactionRows added in v0.108.0

func (self *Agent) PreviewTransactionRows(ctx context.Context, agentRow *models.Agent, owner *models.User, check *finance.TransactionRowsCheck) (*finance.TransactionRowsPlan, error)

PreviewTransactionRows is what ImportTransactionRows would do with the same rows, writing nothing: not even the statement source is made. A refusal of the account, or of the source switched off, wraps finance.ErrTransactionRowsRefused.

func (*Agent) Probe

func (self *Agent) Probe(ctx context.Context, server *config.AgentMCPServer, agentId string) (int, error)

Probe connects to a server as a person once and reports what it found: how the Agent page checks a credential the person just gave.

func (*Agent) ProposeIdea added in v0.76.0

func (self *Agent) ProposeIdea(ctx context.Context, tx db.Transaction, agent *models.Agent, owner *models.User, idea *models.AgentIdea) (*models.AgentIdea, error)

ProposeIdea keeps an idea found for the person, once it passes the check every idea passes, whoever proposed it: the words and the tools (checkIdea), what prompted it (checkEvidence), that it is not one already kept (repeatedIdea), and a model's judgment that it promises nothing its tools cannot do (judgeIdea).

func (*Agent) ProposeReceiptMatches added in v0.118.0

func (self *Agent) ProposeReceiptMatches(ctx context.Context, agentRow *models.Agent, receiptId string) ([]finance.ReceiptMatchCandidate, error)

ProposeReceiptMatches is the charges a stored receipt could explain, the likeliest first, writing nothing.

func (*Agent) PublishChatEvents added in v0.170.0

func (self *Agent) PublishChatEvents(events []Event)

PublishChatEvents hands events of a chat to the chat hub: what the agent posts in a chat, and that it is typing there. Each event is addressed to the conversation of one member, and names only members who are in the chat. None of them belongs to a run, so none is replayed.

func (*Agent) PublishReaction added in v0.134.0

func (self *Agent) PublishReaction(conversationId, messageId, reactionEmoji string, reactorKind models.AgentReactorKind)

PublishReaction tells everybody watching a conversation, on this instance and the others, that a reaction on one of its messages changed: the emoji now there from that reactor, or none. Called once the change is committed.

It belongs to no run, as a title does not, so it has no run id and is never replayed: a drawer that opens later reads it with the messages.

func (*Agent) QueueBackgroundWork added in v0.81.0

func (self *Agent) QueueBackgroundWork(tx db.Transaction, work *models.AgentBackgroundWork) (*models.AgentBackgroundWork, error)

QueueBackgroundWork records a piece of work and queues the job that runs it, in the caller's transaction.

func (*Agent) QueueEvaluation added in v0.61.0

func (self *Agent) QueueEvaluation(tx db.Transaction, agent *models.Agent) (*models.AgentEvaluationRun, error)

QueueEvaluation starts a run of the memory check and queues the job that fills it; one already queued or running is left to run, and is what is returned.

func (*Agent) QueuePhotoDescription added in v0.171.0

func (self *Agent) QueuePhotoDescription(tx db.Transaction, agentId, photoId string) (*models.AgentJob, error)

QueuePhotoDescription asks for a photo of the agent's person to be described. The photo is marked as asked for, which is how a viewer knows to show that a description is on its way, and a photo already waiting for its job is not queued twice.

func (*Agent) QueuePhotoDocumentTranscription added in v0.252.0

func (self *Agent) QueuePhotoDocumentTranscription(tx db.Transaction, agentId, photoId string) (*models.AgentJob, error)

QueuePhotoDocumentTranscription asks for a photo of the agent's person to be transcribed and kept. A photo already waiting for its job is not queued twice.

func (*Agent) QueueReceiptReading added in v0.118.0

func (self *Agent) QueueReceiptReading(tx db.Transaction, agentId, mailboxId, sourceId, financeTransactionId string) (*models.AgentJob, error)

QueueReceiptReading queues the receipt job for a source: a stored message in a mailbox (mailboxId given), or an uploaded file, which remembers the finance transaction it was uploaded to when one is given. The job's subject is the source alone: a job's subject has room for one id.

func (*Agent) QueueRecordingSummary added in v0.153.0

func (self *Agent) QueueRecordingSummary(transaction db.Transaction, userId, recordingId string) error

QueueRecordingSummary queues the title and summary job for a recording, inside the caller's transaction. It queues nothing, and says nothing, when the person has no active agent or no model is assigned to summaries.

func (*Agent) QueueRecordingSummaryAfterEdit added in v0.155.1

func (self *Agent) QueueRecordingSummaryAfterEdit(transaction db.Transaction, userId, recordingId string) error

QueueRecordingSummaryAfterEdit has the summary written again once the person has stopped changing who said what, or the words: the job is queued to start recordingSummaryEditDelay from now, and one already queued is moved to then. A title the person set is kept; a generated one may change with the summary.

func (*Agent) QueueRecordingTerms added in v0.153.0

func (self *Agent) QueueRecordingTerms(transaction db.Transaction, userId, recordingId string) (bool, error)

QueueRecordingTerms queues the term correction job for a recording inside the caller's transaction, and says whether it did. It queues nothing when the person has no active agent or no model is set up to run it, in which case the caller goes straight to the summary.

func (*Agent) QueueRecordingTranscription added in v0.142.0

func (self *Agent) QueueRecordingTranscription(transaction db.Transaction, userId, mediaId, clientRunId string, isReprocessingRequested bool) (*models.RecordingTranscriptRun, error)

QueueRecordingTranscription retains the requested version and job atomically. Initial uploads have one stable version; explicit reprocessing names a new key.

func (*Agent) QueueShoppingPicture added in v0.201.0

func (self *Agent) QueueShoppingPicture(tx db.Transaction, agentId, shoppingItemId string) error

QueueShoppingPicture queues the search for an item's picture, on the agent of whoever asked for it.

func (*Agent) QueueShoppingReceiptMatch added in v0.201.0

func (self *Agent) QueueShoppingReceiptMatch(tx db.Transaction, agentRow *models.Agent, receipt *models.FinanceReceipt) error

QueueShoppingReceiptMatch queues the matching of one of the agent's receipts to the shopping lists its owner reaches, when the owner has items a receipt from that merchant could have bought. RecordReceipt calls it for every receipt, so a receipt is one system: uploaded on a list or in Finance, read from a mail, or sent to the agent as a photo.

func (*Agent) QueueStatementReading added in v0.243.0

func (self *Agent) QueueStatementReading(tx db.Transaction, agentId, attachmentId string) (*models.AgentJob, error)

QueueStatementReading queues the job that reads the transactions of an uploaded picture or PDF and imports them.

func (*Agent) QueueTaxDocumentReading added in v0.155.0

func (self *Agent) QueueTaxDocumentReading(tx db.Transaction, agentId, attachmentId string) (*models.AgentJob, error)

QueueTaxDocumentReading marks an upload of the agent's a tax document, forgetting any text kept of it, and queues the job that reads it. The job's subject is the upload.

func (*Agent) ReadBackgroundCommand added in v0.57.0

func (self *Agent) ReadBackgroundCommand(ctx context.Context, agentId, computerName string, arguments *computer.BackgroundReadArguments) (*BackgroundCommand, error)

ReadBackgroundCommand is one of this agent's, with the last tailBytes of each stream, or with the part of one stream the arguments name.

func (*Agent) ReadHerdrFile added in v0.251.0

func (self *Agent) ReadHerdrFile(ctx context.Context, agentId, computerName, paneId, herdrFileReference string, isThumbnail bool) (*HerdrFile, error)

ReadHerdrFile is a picture a session's history holds or a file it named, by the reference a read gave, or its preview: read from the computer when it is asked for, and kept nowhere here.

func (*Agent) ReadHerdrScreen added in v0.120.0

func (self *Agent) ReadHerdrScreen(ctx context.Context, agentId, computerName, paneId string, lineCount int, shouldKeepColor bool) (*HerdrScreen, error)

ReadHerdrScreen is a session's screen, or its last lineCount lines.

func (*Agent) ReadHerdrSession added in v0.120.0

func (self *Agent) ReadHerdrSession(ctx context.Context, agentId, computerName, paneId string, turnCount, offset int, shouldIncludeToolDetail bool) (*HerdrRead, error)

ReadHerdrSession is the last turns of a session.

func (*Agent) ReadHerdrSubagents added in v0.186.0

func (self *Agent) ReadHerdrSubagents(ctx context.Context, agentId, computerName, paneId string, offset int) (*HerdrSubagents, error)

ReadHerdrSubagents is the agents a session started, as the program on its computer reads them from the files Claude Code keeps beside the session's history.

func (*Agent) ReadShoppingList added in v0.201.0

func (self *Agent) ReadShoppingList(ctx context.Context, agentRow *models.Agent, owner *models.User, importText string, agentAttachmentIds []string) ([]*models.ShoppingItem, error)

ReadShoppingList reads pasted text, the agent's uploaded pictures of a list (screenshots, a photo of a handwritten one), or both, into the items a person would add, without adding them: the caller shows them first. The model's answer says which store the list is for when it names one, and each item's count, unit, details, aisle and whether it is the store's own brand.

func (*Agent) RecallForQuestion

func (self *Agent) RecallForQuestion(ctx context.Context, found *models.Agent, owner *models.User, question string) ([]*RecalledPage, error)

RecallForQuestion answers what the graph would put in front of the model for a question, without asking it anything.

The same two steps a turn takes -- the fused search, then the choice of blocks under the token budget -- so that what this reports is what a turn would carry and not a second implementation of it that drifts. What it deliberately leaves out is the turn's bookkeeping: no `used_at` is moved and no vectors are backfilled, because an evaluation that changed importance and decay as it ran would be measuring its own last pass.

func (*Agent) RecallForQuestionPlanned added in v0.93.0

func (self *Agent) RecallForQuestionPlanned(ctx context.Context, found *models.Agent, owner *models.User, question string, plan *RetrievalPlan) ([]*RecalledPage, error)

RecallForQuestionPlanned is RecallForQuestion following a retrieval plan, as a live turn follows its depth judgement's, without asking any model for one.

func (*Agent) ReconcileRecordingReferenceInvalidations added in v0.144.0

func (self *Agent) ReconcileRecordingReferenceInvalidations(ctx context.Context, userId, recordingId string) error

ReconcileRecordingReferenceInvalidations retires memory that used revoked conditioning evidence.

func (*Agent) RecordPaystub added in v0.155.0

func (self *Agent) RecordPaystub(ctx context.Context, agentRow *models.Agent, paystub *models.FinancePaystub, isUnbalancedAccepted bool) (*models.FinancePaystub, error)

RecordPaystub checks a paystub read out of an upload of the agent's and records it, in the place of whatever was read out of that upload before. One that does not add up is refused unless isUnbalancedAccepted, which only the person decides, or the reading job, which has nobody to ask and leaves the mark for the person to see. The upload is marked a tax document, which forgets any text kept of it.

func (*Agent) RecordReceipt added in v0.118.0

func (self *Agent) RecordReceipt(ctx context.Context, agentRow *models.Agent, receipt *models.FinanceReceipt, recording ReceiptRecording) (*RecordedReceipt, error)

RecordReceipt checks a receipt, stores it in place of any read from the same source before, and matches it: to the charge the recording names, as the person's; else, when the person has not matched it, to the one charge the matcher is sure of. The matcher's earlier matches are taken off first; the person's are kept while they still fit the receipt as read now, and the ones that do not are taken off and said in DroppedReceiptMatchReasons. A receipt that does not balance is refused unless the recording accepts it.

func (*Agent) RecordTaxForm added in v0.155.0

func (self *Agent) RecordTaxForm(ctx context.Context, agentRow *models.Agent, taxForm *models.FinanceTaxForm) (*models.FinanceTaxForm, error)

RecordTaxForm checks a tax form read out of an upload of the agent's and records it, as RecordPaystub records a paystub.

func (*Agent) RecordingTranscriptionAvailability added in v0.144.0

func (self *Agent) RecordingTranscriptionAvailability(transaction db.Transaction, userId string) (bool, string, error)

RecordingTranscriptionAvailability checks current admission without creating work or a model call.

func (*Agent) RegenerateStatementImportToken added in v0.100.0

func (self *Agent) RegenerateStatementImportToken(ctx context.Context, agentRow *models.Agent) (*models.AgentKnowledgeSource, error)

RegenerateStatementImportToken gives the statement source a new token, which ends the old import address at once.

func (*Agent) Register

func (self *Agent) Register(kind models.AgentJobKind, handler Handler)

Register sets the handler for a kind of job.

func (*Agent) RemoveTabViewer added in v0.189.0

func (self *Agent) RemoveTabViewer(agentId string, viewer TabViewer)

RemoveTabViewer closes a view. The last view of a tab stops its stream, and a tab the person holds goes back to the agent a while after the last view of all closed.

func (*Agent) RenameStatementAccount added in v0.108.0

func (self *Agent) RenameStatementAccount(ctx context.Context, agentRow *models.Agent, financeAccountId string, rename db.FinanceAccountRename) (*models.FinanceAccount, error)

RenameStatementAccount gives an account of imported statements the person's own name, the last digits of its number, or both, which later imports keep.

func (*Agent) ReportPresence added in v0.61.0

func (self *Agent) ReportPresence(userId, reporterId string, isVisible bool, idleSeconds int, conversationId string, now time.Time)

ReportPresence records a report for a person in the presence the agent shares with the chat hub; see Presence.Report.

func (*Agent) ReportedContextLengths added in v0.240.1

func (self *Agent) ReportedContextLengths(provider string) map[string]int

ReportedContextLengths is the window each model of the named provider was last listed with, from what the registry kept; see llm.Registry.ReportedContextLengths.

func (*Agent) ResumeInteraction added in v0.61.4

func (self *Agent) ResumeInteraction(settings *ResumeSettings, chatAboutIt string) (*AskRun, error)

ResumeInteraction starts the turn a late answer brings: the answer to the question, or the word on the approval, as the person's message, and for an approval the one call it allows. The card must already have been claimed for this answer. Nil and no turn for an answer that asks for none: the person chose to chat about it instead.

func (*Agent) RetryRecordingTranscription added in v0.144.0

func (self *Agent) RetryRecordingTranscription(transaction db.Transaction, userId, runId string) (*models.RecordingTranscriptRun, error)

RetryRecordingTranscription preserves completed chunks and refuses unknown paid outcomes.

func (*Agent) RunGoalNow added in v0.232.0

func (self *Agent) RunGoalNow(tx db.Transaction, agent *models.Agent, conversationId string) (*models.AgentConversation, error)

RunGoalNow gives a working goal a turn now, out of its times: what the person presses to see what it does.

func (*Agent) RunShared added in v0.170.0

func (self *Agent) RunShared(ctx context.Context, request *SharedCall) (*SharedOutcome, error)

RunShared is the one way a shared tool is called. It checks the share still stands and the two still share a circle, works out what the call pays, and either carries it out on the owner's computer through the runner the owner's own agent uses, turns it back, or stores it as waiting for the owner's approval and says so.

Nothing is recorded as ran for a call that could not be tried: with the owner's computer not connected the call answers that and leaves no row.

func (*Agent) SampleStorage added in v0.234.0

func (self *Agent) SampleStorage(ctx context.Context, now time.Time) error

SampleStorage writes today's sample unless one is there, from this instance or another, then warns the operators of a disk that is projected to fill. A server that has never sampled takes its first sample here, so the page is not empty after an upgrade.

func (*Agent) SealSecret

func (self *Agent) SealSecret(value string) (string, error)

SealSecret seals a credential with the server secret, for storing.

func (*Agent) SendFileToFeed added in v0.250.0

func (self *Agent) SendFileToFeed(ctx context.Context, agentId, attachmentId, caption, sentBy string) (*models.AgentFeedItem, error)

SendFileToFeed keeps one of the agent's files for a card of its person's feed, with a line and who sent it, and posts the card.

func (*Agent) SendFileToMainChat added in v0.210.0

func (self *Agent) SendFileToMainChat(ctx context.Context, agentId, attachmentId, caption, sentBy string) error

SendFileToMainChat marks one of the agent's files as sent to the person's main chat, with a line and who sent it, and posts it now unless a turn runs there; the sweep posts it once that turn ends.

func (*Agent) SendHerdrSession added in v0.120.0

func (self *Agent) SendHerdrSession(ctx context.Context, agentId, computerName, paneId, text string, attachmentIds []string) (*HerdrSent, error)

SendHerdrSession types text into a session, followed by enter; a session at work takes it as a message in its turn.

func (*Agent) Server

func (self *Agent) Server(name string) *config.AgentMCPServer

Server is a declared server by name, or nil.

func (*Agent) SetBrowserCanCast added in v0.189.0

func (self *Agent) SetBrowserCanCast(agentId string, connection TabConnection, canCast bool)

SetBrowserCanCast is the browser on this connection saying it can stream a tab's picture; the viewers' streams are asked of it again.

func (*Agent) SetBrowserCanFillPasswords added in v0.193.0

func (self *Agent) SetBrowserCanFillPasswords(agentId string, connection TabConnection, canFillPasswords bool)

SetBrowserCanFillPasswords is the browser on this connection saying it fills a login or a one-time code the server hands it, which the agent's sign-in with Passwords in the person's tab needs.

func (*Agent) SetBrowserServerHost added in v0.192.2

func (self *Agent) SetBrowserServerHost(agentId string, connection TabConnection, host string)

SetBrowserServerHost records the host the person's browser reached this server by, taken from the request that opened its socket. The browser tool refuses to drive a tab on that host, whatever name the configuration gives the server.

func (*Agent) SetCurrentTab added in v0.193.0

func (self *Agent) SetCurrentTab(agentId string, tab string)

SetCurrentTab is the browser saying which of its tabs the actions go to.

func (*Agent) SetGoalState added in v0.111.0

func (self *Agent) SetGoalState(tx db.Transaction, agent *models.Agent, owner *models.User, conversationId string, goalState models.AgentGoalState) (*models.AgentConversation, error)

SetGoalState is the person marking a goal done, dropping it, pausing it, or taking it up again: met, dropped, paused, or working. Only the person does this; a turn of the agent's own says note, wait or met through the goal tool. A goal on set times taken up again is next due at its next time, not now.

func (*Agent) SetIdeaStatus added in v0.76.0

func (self *Agent) SetIdeaStatus(tx db.Transaction, agent *models.Agent, ideaId string, status models.AgentIdeaStatus) (*models.AgentIdea, error)

SetIdeaStatus is the person saying what became of an idea: done, dismissed, or open again. Started is StartIdea's, which needs a conversation, and expired is the clock's.

func (*Agent) SetMailer

func (self *Agent) SetMailer(sender mailer.Mailer)

SetMailer hands the worker the mailer, once there is one.

func (*Agent) SetOperationsFactory

func (self *Agent) SetOperationsFactory(factory OperationsFactory)

SetOperationsFactory hands the worker the way to act as a person.

func (*Agent) SetTabHeld added in v0.69.0

func (self *Agent) SetTabHeld(agentId string, hasTab bool)

SetTabHeld is the browser saying whether it has a tab the actions go to.

func (*Agent) SetTabViewport added in v0.190.0

func (self *Agent) SetTabViewport(agentId string, viewer TabViewer, width, height float64)

SetTabViewport is the view that holds the tab saying how big it is: one as narrow as a phone's lays the tab out at its size, so the picture is readable there; a width of nothing, or a wide one, lays it out as it is. Only while the person holds the tab, and only for the tab this view watches.

func (*Agent) SetUpHerdrHooks added in v0.120.0

func (self *Agent) SetUpHerdrHooks(ctx context.Context, agentId, computerName string, isRemoval bool) (*HerdrSetup, error)

SetUpHerdrHooks puts TeaNode's reporting hooks into Claude Code on a computer, or takes them out.

func (*Agent) SettleFeedItemsOfSession added in v0.230.0

func (self *Agent) SettleFeedItemsOfSession(ctx context.Context, agentId, computerName, paneId, answerText string) error

SettleFeedItemsOfSession settles the open question cards of a coding session as answered on the computer, once the session says its question went. A card the person answered from the feed is settled already.

func (*Agent) ShareAttachment

func (self *Agent) ShareAttachment(attachmentId string, until time.Time) string

ShareAttachment is the query value that opens the file until the time given, or "" when the server has no secret to sign with.

func (*Agent) SharedAttachment

func (self *Agent) SharedAttachment(attachmentId, share string) bool

SharedAttachment says whether the query value opens the file now.

func (*Agent) SharedSkillTools added in v0.170.0

func (self *Agent) SharedSkillTools(ctx context.Context, granteeAgent *models.Agent) []*Tool

SharedSkillTools are the tools other people's skills offer this agent's person: one for each tool in each share made to them, by somebody they still share a circle with, of a skill installed and switched on, whose owner's agent is on. Read afresh each time, so that taking a share back, or leaving the circle, removes them from the person's next turn; and each call is checked again when it is made.

func (*Agent) ShowLessLikeFeedItem added in v0.230.0

func (self *Agent) ShowLessLikeFeedItem(ctx context.Context, agentId string, item *models.AgentFeedItem) (*models.AgentFeedItem, error)

ShowLessLikeFeedItem records that the person wants fewer cards like this one, and dismisses it. A card already dismissed is only remembered.

func (*Agent) SkillTools

func (self *Agent) SkillTools(ctx context.Context) []*Tool

SkillTools is every tool the installed skills declare.

func (*Agent) SpeakFirstNow added in v0.61.0

func (self *Agent) SpeakFirstNow(tx db.Transaction, agent *models.Agent, reason string) error

SpeakFirstNow queues the agent to speak first for a reason now, outside the sweep's rules: the person asked, from the dashboard or the command line. One already queued or running is left to run.

func (*Agent) Start

func (self *Agent) Start()

Start begins claiming work.

func (*Agent) StartGoal added in v0.111.0

func (self *Agent) StartGoal(tx db.Transaction, agent *models.Agent, owner *models.User, start *GoalStart) (*models.AgentConversation, error)

StartGoal starts a goal in a conversation of its own. One that keeps its own cadence is due at once; one on set times is due at the soonest of them, or when its mail comes. The origin is the conversation it was asked for in, when there was one.

func (*Agent) StartIdea added in v0.76.0

func (self *Agent) StartIdea(ctx context.Context, tx db.Transaction, agent *models.Agent, ideaId, conversationId, language string) (*models.AgentIdea, *models.AgentConversation, error)

StartIdea records that a conversation carries an idea out: the one given, when the agent took it up where it was talking, or a new one named after the idea, whose first message the person then sends. Nothing is said in it here: starting an idea never acts.

func (*Agent) StatementImportAddress added in v0.100.0

func (self *Agent) StatementImportAddress(tx db.Transaction, owner *models.User, source *models.AgentKnowledgeSource) (string, error)

StatementImportAddress is the address statements are mailed to: the local part of the person's first mailbox address, a plus, statements- and the token, at that address's domain. Empty when the person has no mailbox with an address, since there is then nothing for the address to be delivered into.

func (*Agent) Stop

func (self *Agent) Stop()

Stop ends the worker and waits for the runs in flight. A turn a person is reading gets stopGrace first to give its answer, so that a deploy does not cut it off; whatever is left is cancelled then.

func (*Agent) StopBackgroundCommand added in v0.57.0

func (self *Agent) StopBackgroundCommand(ctx context.Context, agentId, computerName, id string) (*BackgroundCommand, error)

StopBackgroundCommand stops one of this agent's for the person. The agent is told it ended, as it is of any ending it did not ask for.

func (*Agent) StopBackgroundWork added in v0.81.0

func (self *Agent) StopBackgroundWork(tx db.Transaction, agentId, workId string) (*models.AgentBackgroundWork, error)

StopBackgroundWork stops one of the agent's, in the caller's transaction: the row says stopped at once, and the work, when it runs here, is cancelled once that is committed. Work running on another instance sees the row within backgroundWorkStopCheck. Stopped work wakes nothing. Work that had already finished is returned as it is.

func (*Agent) StopConversation

func (self *Agent) StopConversation(conversationId string)

StopConversation ends every run of a conversation, for the conversation being deleted under them, here and on the other instances.

func (*Agent) SubscribeConversation

func (self *Agent) SubscribeConversation(conversationId string) (<-chan Event, func())

SubscribeConversation is the feed of a conversation: the turns in flight on this instance are replayed first, then whatever happens until the returned function is called. The channel closes then.

func (*Agent) SubscribeForeignRun added in v0.206.2

func (self *Agent) SubscribeForeignRun(runId string) (conversationId string, events <-chan Event, unsubscribe func(), ok bool)

SubscribeForeignRun reads a run another instance is running, as heard here: what was heard so far, then what follows, closed once it is done. ok is false for a run this instance has not heard of.

func (*Agent) Survey added in v0.79.0

func (self *Agent) Survey(ctx context.Context, agent *models.Agent, owner *models.User, question, scopePath string) (*SurveyReport, error)

Survey answers a question about a whole area of the graph: scopePath names a theme, or any page, and empty means everything.

Every run it makes is a run of kind survey, read-only, in a conversation of its own. It goes on until every page has answered or ctx ends.

func (*Agent) SweepAnsweredFeedItems added in v0.238.0

func (self *Agent) SweepAnsweredFeedItems(ctx context.Context) error

SweepAnsweredFeedItems moves the cards answered with a choice more than models.FeedAnsweredLifetime ago to the dismissed cards, where they can be found and put back, and tells the open feeds. An answered card has said what it had to; left in place it crowds what still needs the person.

func (*Agent) SyncRecordingKnowledge added in v0.144.0

func (self *Agent) SyncRecordingKnowledge(ctx context.Context, userId, recordingId string) error

SyncRecordingKnowledge publishes passive evidence to existing source ingestion.

func (*Agent) TabAnswered

func (self *Agent) TabAnswered(agentId string, connection TabConnection, id int64, ok bool, data json.RawMessage, failure string)

TabAnswered is the extension answering a request: the extension on this connection, so that a replaced tab's late answers reach nobody.

func (*Agent) TabAttached

func (self *Agent) TabAttached(agentId string) (bool, string, string)

TabAttached says whether a person has a tab to act in, for the API.

func (*Agent) TabCommitted added in v0.193.0

func (self *Agent) TabCommitted(agentId string, connection TabConnection, tab string, commit browser.Commit)

TabCommitted is the browser on this connection saying a tab committed a new document, which is what ends a lock on a tab the agent filled a password into (see browser.FilledValues).

func (*Agent) TabFrame added in v0.189.0

func (self *Agent) TabFrame(agentId string, connection TabConnection, tab, data string, width, height float64)

TabFrame is the extension sending a picture of a tab it streams: passed to every view of that tab, from the attached connection only.

func (*Agent) TabInput added in v0.189.0

func (self *Agent) TabInput(agentId string, viewer TabViewer, input TabInputMessage)

TabInput passes what the person did in the picture to the tab the viewer watches, while they hold it; otherwise it is dropped.

func (*Agent) TabList added in v0.189.0

func (self *Agent) TabList(agentId string) []TabListing

TabList is the tabs the extension last listed.

func (*Agent) TakeOverTab added in v0.189.0

func (self *Agent) TakeOverTab(agentId string) bool

TakeOverTab gives the person control of their tab: the agent's acting calls are refused until they hand it back. A browser that cannot stream a tab cannot take their input either, so it is not taken over; it says whether it was.

func (*Agent) TaxDocumentAddress added in v0.155.0

func (self *Agent) TaxDocumentAddress(ctx context.Context, agentRow *models.Agent, owner *models.User, isRenewed bool) (string, error)

TaxDocumentAddress is the address paystubs and W-2s are mailed to: the local part of the person's first mailbox address, a plus, taxes- and the token, at that address's domain, the token made the first time. Empty when the person has no mailbox with an address. A new token in the old one's place when isRenewed, which ends the old address at once.

func (*Agent) TaxYear added in v0.155.0

func (self *Agent) TaxYear(ctx context.Context, agentRow *models.Agent, taxYear int, filingStatus finance.TaxFilingStatus) (*finance.TaxYearSummary, error)

TaxYear puts a tax year together from every paystub paid in it and every tax form for it, its tax estimated as filed with filingStatus, else the filing status the person keeps, else as the number of people suggests.

func (*Agent) TellGoal added in v0.111.0

func (self *Agent) TellGoal(tx db.Transaction, agent *models.Agent, conversationId, text string) (*models.AgentConversation, error)

TellGoal passes what the person said to one of their goals: written into the goal's conversation as their words, carried over from where they said them, and the goal back at work a minute later. A goal that was met or dropped is not started again by this; the person does that.

func (*Agent) TellSkillSharesNowAsk added in v0.170.0

func (self *Agent) TellSkillSharesNowAsk(skillName string, shares []*models.SkillShare)

TellSkillSharesNowAsk says, in each owner's main conversation, that an update of a skill made the shares listed ask them before every call, and why. It returns at once; the note is written while no turn runs there, so it waits for a running one to end, a bounded number of times, and gives up with a warning. The shares are already changed; the note only tells the owner.

func (*Agent) Tick

func (self *Agent) Tick(ctx context.Context) error

Tick releases stale claims, claims what is due, and runs it. The worker calls it on its interval; a test calls it by hand.

func (*Agent) TickAt

func (self *Agent) TickAt(ctx context.Context, now time.Time) error

TickAt is Tick as of a moment, for a test that cannot wait for a hold to end.

func (*Agent) ToolRisks added in v0.76.0

func (self *Agent) ToolRisks(ctx context.Context, agent *models.Agent, owner *models.User) (map[string]tools.Risk, error)

ToolRisks is the person's tools, by name, with what each can do: what an idea may promise.

func (*Agent) TranscribeChatCall added in v0.212.0

func (self *Agent) TranscribeChatCall(ctx context.Context, callId string) error

TranscribeChatCall moves a call waiting for its transcript one step: its files become a recording, or the recording, once transcribed, becomes the summary in the chat.

func (*Agent) TranscribeChatCallSoon added in v0.212.0

func (self *Agent) TranscribeChatCallSoon(callId string)

TranscribeChatCallSoon moves a call's transcript along beside whatever the caller does next.

func (*Agent) TranscribeVoiceMessage added in v0.211.0

func (self *Agent) TranscribeVoiceMessage(ctx context.Context, messageId string) error

TranscribeVoiceMessage writes the words of a voice message that is waiting for them, and tells the members. It claims the message first, so that of several servers one works on it. An error means the words were not written and the message is still waiting, to be tried again once the claim has run out; a message that cannot be transcribed by any retry ends failed or off instead, with no error.

func (*Agent) TranscribeVoiceMessageFor added in v0.213.0

func (self *Agent) TranscribeVoiceMessageFor(ctx context.Context, messageId string, asker *models.User) (*models.ChatMessage, error)

TranscribeVoiceMessageFor writes the words of a voice message that has none (they were off for its sender, or failed), as a member of the chat asked, whose agent pays. The words are the message's, for every member. Nothing is kept when it fails: the message is as it was, to ask again.

func (*Agent) TranscribeVoiceMessageSoon added in v0.211.0

func (self *Agent) TranscribeVoiceMessageSoon(messageId string)

TranscribeVoiceMessageSoon starts writing the words of a message just posted, beside whatever the caller does next. A server that is stopping starts nothing, and the sweep finds the message once it is back.

func (*Agent) UnmatchReceipt added in v0.118.0

func (self *Agent) UnmatchReceipt(ctx context.Context, agentRow *models.Agent, receiptId, financeTransactionId string) (*models.FinanceReceipt, error)

UnmatchReceipt takes a receipt off a finance transaction, whoever matched them, and leaves the receipt to the person: a later sync never matches it on its own again. db.ErrNotFound when they were not matched.

func (*Agent) UpdateFeedItem added in v0.230.0

func (self *Agent) UpdateFeedItem(ctx context.Context, agentId, feedItemId, postingConversationId string, modify func(*models.AgentFeedItem) error) (*models.AgentFeedItem, error)

UpdateFeedItem changes what a card says in place, as the posting agent's own change: it keeps the choice made on it, and tells the open feeds.

func (*Agent) UpdateGoal added in v0.232.0

func (self *Agent) UpdateGoal(tx db.Transaction, agent *models.Agent, owner *models.User, conversationId string, change *GoalChange) (*models.AgentConversation, error)

UpdateGoal changes a goal's title, description, times, mail conditions or notification. Whoever changes what it says or when it runs is who wrote it from then on: the person, with a tap on a screen, makes it theirs; the agent, or the command line, whose token the agent's own shell holds too, makes it the agent's.

func (*Agent) UpdateTab

func (self *Agent) UpdateTab(agentId, title, url string)

UpdateTab is the tab saying where it went.

func (*Agent) UpdateTabList added in v0.189.0

func (self *Agent) UpdateTabList(agentId string, tabs []TabListing)

UpdateTabList is the extension saying which tabs the agent may act in.

func (*Agent) UploadAllowed added in v0.210.0

func (self *Agent) UploadAllowed(attachmentId, upload string) bool

UploadAllowed says whether the query value lets the bytes of the file be sent now. It is signed over a name of its own, so an address that opens a file cannot be used to replace it.

func (*Agent) UploadLinkFrom added in v0.210.0

func (self *Agent) UploadLinkFrom(origin, attachmentId string) string

UploadLinkFrom is the full address, on the origin given, that takes one PUT of a waiting file's bytes, signed for that file until UploadFor has passed; "" without an origin or a secret to sign with.

func (*Agent) VoiceMessagePayer added in v0.213.0

func (self *Agent) VoiceMessagePayer(tx db.Transaction, chat *models.Chat, authorUserId string) (*models.Agent, error)

VoiceMessagePayer is the agent that pays for the words of a voice message in a chat, so that every voice message has them for the people and the agents who read the chat: the sender's own, else the agent of a member who has it read the chat, else any other member's that can pay; nil when none can.

func (*Agent) VoiceMessageTranscriptState added in v0.211.0

func (self *Agent) VoiceMessageTranscriptState(tx db.Transaction, sender *models.Agent, owner *models.User) string

VoiceMessageTranscriptState is the state a voice message from this sender starts in: waiting for its words, or off when there will be none because voice is off on the server, or the sender's agent is off, may not be used, or has spent its budget.

func (*Agent) Wait

func (self *Agent) Wait()

Wait blocks until every run in flight has finished. For tests and for Stop.

func (*Agent) WaitFeedPictures added in v0.230.0

func (self *Agent) WaitFeedPictures()

WaitFeedPictures waits until the pictures being fetched are kept.

func (*Agent) WaitHerdrSession added in v0.120.0

func (self *Agent) WaitHerdrSession(ctx context.Context, agentId, computerName, paneId string, waitSeconds int) (*HerdrWait, error)

WaitHerdrSession waits for a session to stop working, waitSeconds at most.

func (*Agent) WakeRecordingSpeakerCuration added in v0.144.0

func (self *Agent) WakeRecordingSpeakerCuration(userId, recordingId string)

WakeRecordingSpeakerCuration coalesces bounded local work after a committed confirmation. Persistent generation markers let the periodic worker recover missed wakeups.

func (*Agent) WatchHerdrSession added in v0.120.0

func (self *Agent) WatchHerdrSession(ctx context.Context, agentId, computerName, paneId string, origin tools.BackgroundOrigin) (*HerdrSession, error)

WatchHerdrSession has a conversation woken when a session next finishes.

func (*Agent) WatchTab added in v0.189.0

func (self *Agent) WatchTab(agentId string, viewer TabViewer, tab string)

WatchTab is a viewer saying which tab it watches: one the extension listed.

type AlertCovered added in v0.82.0

type AlertCovered struct {
	MailID        string `json:"mailId"`
	Subject       string `json:"subject"`
	FromAddress   string `json:"fromAddress"`
	CandidateKind string `json:"candidateKind"`
	// MailCategory is what the sorting called the message, when it did.
	MailCategory string `json:"mailCategory"`
}

AlertCovered is one message an alert was about, as the person is shown it beside the alert.

type AlertDecided added in v0.82.0

type AlertDecided struct {
	SubjectKey   string   `json:"subject_key"`
	IsUrgent     bool     `json:"is_urgent"`
	CandidateIDs []string `json:"candidate_ids"`
	AlertText    string   `json:"alert_text"`
	HasChanged   bool     `json:"has_changed"`
	ChangeReason string   `json:"change_reason"`
}

AlertDecided is one alert the model would send.

type AlertDecision added in v0.82.0

type AlertDecision struct {
	Alerts  []AlertDecided `json:"alerts"`
	Dropped []AlertDropped `json:"dropped"`
}

AlertDecision is the JSON the model is asked for.

type AlertDropped added in v0.82.0

type AlertDropped struct {
	CandidateID string `json:"candidate_id"`
	DropReason  string `json:"drop_reason"`
}

AlertDropped is a candidate the model would not tell, and why.

type AlertInput added in v0.82.0

type AlertInput struct {
	Owner        *models.User
	Language     string
	Now          time.Time
	Memories     []string
	RecentAlerts []*models.AgentAlert

	// AlertAnswers is what the person said back to an alert, by its id.
	AlertAnswers map[string]string

	// ComingUp is what is on their calendar, ready for the prompt.
	ComingUp   string
	Candidates []*labeledCandidate
}

AlertInput is everything the decision's prompt is built from, so it can be rendered and tested without a database.

type AlertMuteChoice added in v0.82.0

type AlertMuteChoice struct {
	MuteScope  models.AlertMuteScope `json:"muteScope"`
	MuteTarget string                `json:"muteTarget"`
}

AlertMuteChoice is one way to mute an alert: the scope, and what it would mute, several joined by commas.

type AlertView added in v0.82.0

type AlertView struct {
	ID         string          `json:"id"`
	AlertText  string          `json:"alertText"`
	SentAt     time.Time       `json:"sentAt"`
	SubjectKey string          `json:"subjectKey"`
	IsUrgent   bool            `json:"isUrgent"`
	Covered    []*AlertCovered `json:"covered"`

	// MuteChoices is what a Mute of the alert offers, the default first.
	MuteChoices []*AlertMuteChoice `json:"muteChoices"`
}

AlertView is an alert as the person reads it back: what was said, when, and what it was about.

func ListAlertViews added in v0.82.0

func ListAlertViews(tx db.Transaction, agentId string, limit int) ([]*AlertView, error)

ListAlertViews is the agent's latest alerts, newest first, each with the messages it covered.

type AnswerEvaluation added in v0.60.0

type AnswerEvaluation struct {
	AnswerText    string
	AnswerVerdict string
	VerdictReason string

	// FactCount and PassageCount are what the answer was given.
	FactCount    int
	PassageCount int

	// What the answer and its grading cost, together, and how long the
	// answer took, which is what a person waits for; the grading is not.
	Cost             float64
	AnswerDurationMS int64
}

AnswerEvaluation is one question answered and graded.

type AskRun

type AskRun struct {
	ID string
	// contains filtered or unexported fields
}

AskRun is one turn in flight.

func (*AskRun) Agent

func (self *AskRun) Agent() *models.Agent

func (*AskRun) Answer

func (self *AskRun) Answer(callId, answer string) bool

Answer answers a question card. It says whether there was one.

func (*AskRun) AnswerLocation added in v0.125.0

func (self *AskRun) AnswerLocation(callId, said string) bool

AnswerLocation is the browser's answer to a location call, as LocationAnswer's JSON. It says whether a call was waiting for it. A message handed to a running turn follows that turn's events under its own id, so its answer goes on to the turn that asked.

func (*AskRun) Ask

func (self *AskRun) Ask(ctx context.Context, callId, question string, choices []string) (string, error)

Ask shows the question card and waits for the person's words.

func (*AskRun) AskToTakeOver added in v0.189.0

func (self *AskRun) AskToTakeOver(ctx context.Context, callId, request string) (string, error)

AskToTakeOver asks the person to take their browser tab over from the dashboard, do what the request says, and hand it back, and waits as a question does. Handing back answers it with models.InteractionHandedBack and their note; a typed reply answers it with what they typed.

func (*AskRun) AttachedComputers

func (self *AskRun) AttachedComputers() []tools.Computer

func (*AskRun) AttachedTab

func (self *AskRun) AttachedTab() tools.Tab

func (*AskRun) BrowserPage

func (self *AskRun) BrowserPage(ctx context.Context) (*browser.Context, error)

func (*AskRun) CanAsk added in v0.61.3

func (self *AskRun) CanAsk() bool

func (*AskRun) CanLocate added in v0.175.0

func (self *AskRun) CanLocate() bool

CanLocate says whether this turn has a browser or app to ask where the person is (tools.Locating): one written in the dashboard in a browser or in the app, with somebody present.

func (*AskRun) CanReadSharedPages added in v0.170.0

func (self *AskRun) CanReadSharedPages() bool

CanReadSharedPages is true for a conversation the person is in. Not in a dream, which never reads shared pages; not in a run nobody is at, whose words go to a mail or a schedule and not back to the person; and not in a chat of several people, whose members were not each given the same pages.

func (*AskRun) CanShowPages added in v0.132.0

func (self *AskRun) CanShowPages() bool

CanShowPages says this turn's surface is the dashboard's own drawer (tools.Showing), by the same entry that decides whether a DashboardOnly tool is offered.

func (*AskRun) CaptureCodingSession added in v0.176.0

func (self *AskRun) CaptureCodingSession(ctx context.Context, computerName, assistant string) (bool, error)

CaptureCodingSession is tools.CodingRemembering for a turn.

func (*AskRun) CodingMemory added in v0.124.0

func (self *AskRun) CodingMemory(ctx context.Context, directory, computerName, prompt string) (string, error)

CodingMemory is tools.CodingRemembering for a turn.

func (*AskRun) ComputersAllowed

func (self *AskRun) ComputersAllowed() bool

func (*AskRun) Configuration

func (self *AskRun) Configuration() *config.Configuration

func (*AskRun) Conversation

func (self *AskRun) Conversation() *models.AgentConversation

Conversation is the conversation the run belongs to.

func (*AskRun) Database

func (self *AskRun) Database() db.Database

func (*AskRun) DiscardDraft

func (self *AskRun) DiscardDraft(ctx context.Context, tx db.Transaction, itemId string) error

func (*AskRun) DraftReply

func (self *AskRun) DraftReply(ctx context.Context, request *models.AgentDraftRequest) (*models.AgentDraft, error)

func (*AskRun) Enqueue

func (self *AskRun) Enqueue(tx db.Transaction, kind models.AgentJobKind, mailboxId, subjectId string) error

func (*AskRun) GuardRecordingEvidence added in v0.144.4

func (self *AskRun) GuardRecordingEvidence() bool

GuardRecordingEvidence enables trusted provenance checks only inside a dream's turns.

func (*AskRun) Headless

func (self *AskRun) Headless() bool

func (*AskRun) HeldToChatConversation added in v0.170.0

func (self *AskRun) HeldToChatConversation() string

HeldToChatConversation is, for a member turn, the one conversation the conversation tool may read: the owner's own for this chat, whose rows it reads as chat messages only. Empty for every other turn.

func (*AskRun) IsAnsweringInChat added in v0.170.0

func (self *AskRun) IsAnsweringInChat() bool

IsAnsweringInChat says the turn's words are posted to the room of a chat.

func (*AskRun) IsCalledByPersonsProgram added in v0.207.2

func (self *AskRun) IsCalledByPersonsProgram() bool

IsCalledByPersonsProgram says a program the person connected over MCP asked this turn (teanode_ask) with a credential of their own (tools.ProgramCalling). A subagent is its parent's.

func (*AskRun) IsLinkInPlaceOfPath added in v0.74.0

func (self *AskRun) IsLinkInPlaceOfPath() bool

IsLinkInPlaceOfPath is false: the dashboard shows a file by its path with the person's session, and a link is for when they ask for one.

func (*AskRun) IsStartedByPerson added in v0.193.0

func (self *AskRun) IsStartedByPerson() bool

IsStartedByPerson says the person started this run: they typed or spoke the turn with their own tap on a screen (the dashboard or the phone app, whatever surface name the request carried), a schedule they wrote themselves woke it, or it carries on a card from such a run (tools.PersonStarting). A subagent is its parent's. Anything else is not: a turn woken by an inbound mail, a chat app, a goal, a dream, a command left running, a program that speaks MCP, a built-in schedule or a schedule the agent wrote for itself is steered by content the person did not write; a request made with the command line's token, an app password, OAuth, the extension's token or by an operator acting as the person is not their tap whatever surface it names; and a surface this does not know is taken not to be theirs.

func (*AskRun) IsWokenByAgentsGoal added in v0.232.0

func (self *AskRun) IsWokenByAgentsGoal() bool

IsWokenByAgentsGoal says a goal the agent wrote woke this run, so that Passwords can tell the person to open the goal and save it themselves. A subagent is its parent's.

func (*AskRun) Load

func (self *AskRun) Load(name string)

func (*AskRun) Loaded

func (self *AskRun) Loaded() map[string]bool

Loaded and Load are under the run's lock, and Loaded is a copy: a round's reads run together, and two tool_search calls among them load at once.

func (*AskRun) Locate added in v0.125.0

func (self *AskRun) Locate(ctx context.Context, callId string) (*tools.BrowserLocation, error)

Locate asks the browser the person is writing in where it is (tools.Locating): the drawer that sent the turn answers the event with AnswerLocation. A turn not written in the dashboard in a browser has none to ask, and says so; the location tool then answers from the positions kept (CanLocate), and a subagent's turn is not one.

func (*AskRun) MeaningSearch

func (self *AskRun) MeaningSearch(ctx context.Context, mailboxId, query string, limit int) ([]string, error)

func (*AskRun) NoteFact

func (self *AskRun) NoteFact(ctx context.Context, fact *models.AgentFact) []*models.AgentFact

func (*AskRun) NoteNode

func (self *AskRun) NoteNode(ctx context.Context, node *models.AgentNode)

func (*AskRun) ObserveRecordingEvidence added in v0.144.4

func (self *AskRun) ObserveRecordingEvidence()

ObserveRecordingEvidence is called only for trusted, owned recording provenance.

func (*AskRun) Offered

func (self *AskRun) Offered() []*tools.Tool

func (*AskRun) Operations

func (self *AskRun) Operations() tools.Operations

func (*AskRun) Owner

func (self *AskRun) Owner() *models.User

Owner is the person.

func (*AskRun) PreparePage added in v0.48.0

func (self *AskRun) PreparePage(ctx context.Context, path string, kind models.AgentNodeKind, name string) tools.PreparedPage

func (*AskRun) Queued

func (self *AskRun) Queued() bool

Queued says whether the run is still waiting for the turn before it.

func (*AskRun) RankChunksByMeaning

func (self *AskRun) RankChunksByMeaning(ctx context.Context, words string, chunks []*models.AgentChunk, limit int) []*models.AgentChunk

RankChunksByMeaning puts a set the words found into the order the meaning wants. What a deployment with no vector index does instead of a vector search: it finds everything the words find, in a better order, and misses a paraphrase that shares no word with the question.

func (*AskRun) ReadOnly

func (self *AskRun) ReadOnly() bool

func (*AskRun) ReadSharedPage added in v0.170.0

func (self *AskRun) ReadSharedPage(ctx context.Context, ownerUserId, path string) (*models.SharedPage, error)

func (*AskRun) Recall

func (self *AskRun) Recall(line string)

Recall keeps what a memory search found, for the overlay.

func (*AskRun) Recalled

func (self *AskRun) Recalled() []string

func (*AskRun) ReconnectedTab added in v0.121.1

func (self *AskRun) ReconnectedTab(ctx context.Context, dropped tools.Tab, wait time.Duration) tools.Tab

func (*AskRun) RegisterLiveActivity added in v0.131.0

func (self *AskRun) RegisterLiveActivity(pushRegistration string) error

RegisterLiveActivity has the run push its state to a Live Activity, from now on and at once.

func (*AskRun) RenderingPage added in v0.168.2

func (self *AskRun) RenderingPage(ctx context.Context) (*browser.Context, func(), error)

func (*AskRun) Resolve

func (self *AskRun) Resolve(callId string, approve bool) bool

Resolve answers a confirmation card. It says whether there was one.

func (*AskRun) RestsOnSharedPages added in v0.170.0

func (self *AskRun) RestsOnSharedPages(ctx context.Context, text string) bool

RestsOnSharedPages reads the conversation as stored, every round so far, for the words shared pages showed it and the words the person wrote.

func (*AskRun) ResultCharacters added in v0.106.1

func (self *AskRun) ResultCharacters() int

ResultCharacters is how much of a tool's result this run keeps, for a tool that fits a page to it.

func (*AskRun) SearchGraphByMeaning

func (self *AskRun) SearchGraphByMeaning(ctx context.Context, words string, limit int) ([]*models.AgentNode, []*models.AgentFact)

SearchGraphByMeaning is what the memory tool's search adds to its own word search. Part of tools.GraphSearching.

func (*AskRun) SearchKnowledgeByMeaning

func (self *AskRun) SearchKnowledgeByMeaning(ctx context.Context, sourceIds []string, documentPrefix string, words string, limit int) ([]*models.AgentChunk, bool)

SearchKnowledgeByMeaning is the passages nearest some words, and whether the database ranked them itself.

Part of tools.KnowledgeSearching. False means this deployment has no vector index, and the caller should fall back to re-ranking what the words found: reading half a million vectors into memory to sort them is not a search.

func (*AskRun) SearchSharedPages added in v0.170.0

func (self *AskRun) SearchSharedPages(ctx context.Context, query string, limit int) ([]*models.SharedHit, error)

func (*AskRun) SendToFeed added in v0.250.0

func (self *AskRun) SendToFeed(ctx context.Context, attachmentId, caption, sentBy string) (string, error)

SendToFeed keeps the file for a card and posts it (tools.MainChatSending).

func (*AskRun) SendToMainChat added in v0.210.0

func (self *AskRun) SendToMainChat(ctx context.Context, attachmentId, caption, sentBy string) error

SendToMainChat marks the file as sent to the main chat and posts it now when no turn runs there, or with the next sweep when one does (tools.MainChatSending).

func (self *AskRun) SharedLink(attachmentId string) string

SharedLink is an address that opens one file with no sign-in, on the dashboard the turn came through (tools.Linking), for a person who asked for a link to open elsewhere; empty when the turn did not come through the dashboard.

func (*AskRun) SharedPages added in v0.170.0

func (self *AskRun) SharedPages(ctx context.Context) ([]*models.SharedRoot, error)

func (*AskRun) ShowPage added in v0.84.0

func (self *AskRun) ShowPage(path string)

ShowPage has the drawer that is following this turn move the dashboard to a page of it (tools.Showing).

func (*AskRun) SteeredInto added in v0.71.5

func (self *AskRun) SteeredInto() *AskRun

SteeredInto is the running turn this message was handed to, or nil when it is a turn of its own.

func (*AskRun) Stop

func (self *AskRun) Stop()

Stop ends the run; the turn stays where it got to.

func (*AskRun) StopByPerson added in v0.61.4

func (self *AskRun) StopByPerson()

StopByPerson ends the run because the person asked, closing the cards it was waiting on.

func (*AskRun) Storage

func (self *AskRun) Storage() storage.Storage

func (*AskRun) Subscribe

func (self *AskRun) Subscribe() (<-chan Event, func())

Subscribe replays what happened so far and then follows the run. The channel closes when the run is over.

func (*AskRun) Surface

func (self *AskRun) Surface() string

func (*AskRun) TabsAllowed

func (self *AskRun) TabsAllowed() bool

func (*AskRun) TellReaction added in v0.134.0

func (self *AskRun) TellReaction(conversationId, messageId, reactionEmoji string, reactorKind models.AgentReactorKind)

TellReaction is PublishReaction for a tool, which reaches the agent through the run it is called in (tools.ReactionTelling).

func (self *AskRun) UploadLink(attachmentId string) string

UploadLink is the address a program sends the file's bytes to (tools.MainChatSending); "" when the turn did not come through an address this server knows.

func (*AskRun) Usage

func (self *AskRun) Usage() llm.Usage

Usage is what the turn has spent so far, every round added up.

type AskSettings

type AskSettings struct {
	Agent      *models.Agent
	Owner      *models.User
	Operations Operations

	// Conversation is where the turn goes; the caller made or found it.
	Conversation *models.AgentConversation

	// RunID, when set, is the id the run takes, for a caller that has to
	// tell it before the run starts: a request starts its turns once it has
	// committed, and answers with the run to follow.
	RunID string

	// Message is what the person said.
	Message string

	// Viewing is what they have open, when the drawer knows.
	Viewing *Viewing

	// InterruptedAnswer is how much of the agent's spoken answer the
	// person heard before they talked over it, when they did.
	InterruptedAnswer *InterruptedAnswer

	// Attachments are the files that came with the message, uploaded
	// already; References the threads the person pointed at.
	Attachments []*models.AgentAttachment
	References  []models.AgentReference

	// Pictures are images the caller puts in the turn itself rather than
	// files of the person's: a night looking at an attachment whose bytes
	// it fetched out of the store. They are shown to the model as the
	// same image parts a person's own picture is, and they belong to this
	// turn alone -- nothing stores them, so a later round names nothing.
	Pictures []llm.ContentPart

	// Surface is where the answer goes: drawer, phone, cli, api or mail.
	Surface string

	// IsPersonsTap says the request that started the turn was the person's
	// own tap on a screen: the dashboard's session or the phone app's token
	// (access.Principal.IsPersonsTap). The surface a client names is only a
	// claim, so a turn counts as typed by the person (IsStartedByPerson) only
	// when this is set; a command line token, an app password, OAuth, the
	// extension's token and a program that speaks MCP never set it.
	IsPersonsTap bool

	// IsOperatorActingAsPerson says an operator, not the person, made the
	// request: signed in as the person, or speaking into the person's
	// conversation with agent:act. Such a turn is never the person's own.
	IsOperatorActingAsPerson bool

	// IsPersonsGoal says a turn of the goal surface was woken by a goal the
	// person wrote, on times they chose, not one the agent wrote for itself,
	// not a built-in one (the daily brief), which reads content the person
	// did not write, and not one that waits for mail.
	IsPersonsGoal bool

	// IsAgentsGoal says a turn of the goal surface was woken by a goal the
	// agent wrote (or one of unknown origin), not one the person wrote and
	// not a built-in one. Passwords is closed to it, and says so in words
	// that tell the person how to open it (IsWokenByAgentsGoal).
	IsAgentsGoal bool

	// IsAnswerToCard says the turn carries on an answer given to a card after
	// the turn that raised it had ended (see ResumeInteraction), and
	// IsCardRaisedByPerson that the turn that raised it was one the person
	// started. The answer is the person's, but it is not typed into a chat
	// app or a program: the turn counts as the person's only if the one it
	// carries on did, and only if the answer itself was the person's own tap
	// on a screen (IsAnswerFromPersonsTap, as IsPersonsTap is for a typed
	// turn). A late answer made with a command line token, an app password or
	// by an operator acting as the person carries the card on, but not as the
	// person's run.
	IsAnswerToCard         bool
	IsCardRaisedByPerson   bool
	IsAnswerFromPersonsTap bool

	// DrawerID names the open drawer that sent the turn: the browser a
	// location call asks, rather than any other the person has open. Empty
	// for a turn no drawer sent, such as one begun after a card was
	// approved.
	DrawerID string

	// Origin is the address the dashboard was reached at, scheme and host,
	// for a link to a file that has to open somewhere else; empty where the
	// turn did not come through it.
	Origin string

	// ReadOnly leaves out every tool that changes anything, for a
	// read-only credential.
	ReadOnly bool

	// ReadOnlyTools names the tools this turn may only look with, while
	// the rest of its kit acts as usual. Each call to one of them is
	// judged as it is made, so a tool whose actions differ -- memory,
	// which both reads a page and rewrites one -- keeps the half that
	// reads instead of going altogether.
	//
	// The night is what this is for: it has the person's whole kit, and
	// its changes to the graph are still said in the object it ends with
	// so that code files them with their evidence. That was enforced by
	// the whole turn being read-only until the turn stopped being
	// read-only, and a rule the frame merely asks for is a rule only
	// until a model reads the memory tool's description and takes it at
	// its word.
	ReadOnlyTools map[string]bool

	// Allow, when set, is the only tools offered by name; Headless adds
	// the remote tools marked for runs with nobody present. MaxRounds is
	// how many times a call that is built to take few may go back to the
	// model (one for a single answer); zero, the rule, has no limit: the
	// turn goes on until the model answers, the budget defers it, the loop
	// guard stops it or the person does. UsageKind names the usage rows.
	Allow     map[string]bool
	Headless  bool
	MaxRounds int

	// CallLimits is how many times the turn may call each named tool. A
	// call past the limit is answered with an error and does not run, so a
	// turn that other people ask for, on the owner's money, has a bound the
	// model cannot talk its way past. A tool not named has none. Only a
	// member turn in a chat sets it (chat_turn.go).
	CallLimits map[string]int

	// IsFetchLimitedToSearched holds web_fetch to the addresses a
	// web_search in this turn returned. For a turn nobody is present for
	// that reads what strangers wrote: an address it makes up can carry
	// what it has read out to whoever runs that server.
	IsFetchLimitedToSearched bool

	// IsPersonOmitted leaves the person's own page and the index of what
	// the agent knows out of the prompt.
	IsPersonOmitted bool

	// PreApproved is the calls the person approved on a card whose turn
	// had ended, by tool name and arguments: this turn may make each once
	// without asking again. See interaction.go.
	PreApproved map[string]bool

	// CanAsk says that a turn nobody typed may still put a question card
	// to the person: the turn is the agent starting a conversation with
	// them, and the card waits for them to come to it. Everything else about a
	// headless turn stands; only ask_user and confirmations may wait for
	// them.
	CanAsk    bool
	UsageKind string

	// Effort is how hard the model thinks before each round: "low",
	// "medium" or "high", or empty for the provider's default, which for
	// a newer model with tools is no reasoning at all.
	Effort string

	// Research gives the turn a procedure for answering a question about
	// the person's own work: search more than once and everywhere, read
	// the whole thread, prefer what their people wrote over what is
	// generally true, and say where the sources do not answer.
	Research bool

	// Work is the kind of work this turn is, which chooses the model: a
	// dream runs on the operator's scan model, sorting on the triage one.
	// Empty means the person's own choice, or the ask model, which is
	// what a turn somebody typed gets.
	Work config.AgentWork

	// Model, when set, is the model this headless turn runs on, by its
	// "provider:model" name, and wins over Work: for work whose model is
	// a setting of its own that no kind of work names, such as the chat
	// model the categorize model falls back to.
	Model string

	// ReadThenAnswer is a run that looks things up and then answers once:
	// a dream reading a batch, an ingest describing a checkout. Its
	// history is never compacted, because a compaction note would stand
	// in for the very documents it was given to read; when the history
	// fills, the run is told to answer now instead. ResultCharacters
	// bounds each lookup's answer for such a run, so a long page does not
	// fill the window by itself; zero means the usual bound.
	ReadThenAnswer   bool
	ResultCharacters int

	// Chat is set on a turn in a chat conversation: the turn answers in the
	// chat, to everybody in it. Ask sets it for a late answer to a card in a
	// chat; the caller of a turn that addresses the agent sets it. See
	// chat_turn.go.
	Chat *ChatTurn

	// Short asks for the one-paragraph conduct rather than the full rules.
	// A run with nobody present and six tools does not need the page about
	// how to talk to somebody, and sorting runs on every message that
	// arrives, so what the prompt costs is what sorting costs.
	Short bool
	// contains filtered or unexported fields
}

AskSettings is one turn of a conversation.

type AttachedComputer

type AttachedComputer struct {
	Name        string
	System      string
	Description string
	Since       time.Time
}

AttachedComputer is one attached computer of a person, for the API.

type BackgroundCommand added in v0.57.0

type BackgroundCommand struct {
	Computer string
	*computer.BackgroundStatus
	Origin tools.BackgroundOrigin
}

BackgroundCommand is one background command on one of a person's computers, for the API.

type Budget

type Budget struct {
	Used     int64
	Limit    int64 // 0 = unlimited
	ResetsAt time.Time

	// ServerUsed and ServerLimit are the monthly cap for the whole server.
	ServerUsed  int64
	ServerLimit int64

	// Cost and CostLimit are the same day said in money, at the prices
	// the providers are configured with; ServerCost and ServerCostLimit
	// the same for the month and the whole server. Currency is what the
	// operator says those prices are in, for whoever shows them.
	Cost            float64
	CostLimit       float64
	ServerCost      float64
	ServerCostLimit float64
	Currency        string
}

Budget is what a person may still spend today, and when the day turns. A budget can be said in tokens, in money, or in both; where both are set, whichever runs out first stops the day.

func CheckBudget

func CheckBudget(tx db.Transaction, configuration *config.Configuration, agent *models.Agent, owner *models.User, now time.Time) (*Budget, error)

CheckBudget reads today's spend for a person against their limit, and the month's against the server's. "Today" is midnight to midnight in the person's own zone, which is when the panel says it resets.

func (*Budget) Exhausted

func (self *Budget) Exhausted() bool

Exhausted says whether the next call should wait.

func (*Budget) NearlySpent

func (self *Budget) NearlySpent() string

NearlySpent is a line about the budget for the model, once four fifths of whichever cap binds first is gone, and "" while there is room. Money and tokens are said the way they are counted.

type BudgetMonthPhase added in v0.104.0

type BudgetMonthPhase string

BudgetMonthPhase is where one month of a year stands on the day a year's budgets are computed for.

const (
	BudgetMonthPhaseOver       BudgetMonthPhase = "over"
	BudgetMonthPhaseInProgress BudgetMonthPhase = "in_progress"
	BudgetMonthPhaseToCome     BudgetMonthPhase = "to_come"
)

The three phases: the month is over, it is the month in progress, or it has not begun.

type Call

type Call = tools.Call

type Catalog

type Catalog = tools.Catalog

func FullCatalog

func FullCatalog() *Catalog

FullCatalog is every tool the agent can be given, before permissions and policy narrow it: what the worker runs with, and what the operator's tool policy lists.

type ChatPublisher added in v0.170.0

type ChatPublisher interface {
	PublishChatEvents(events []Event)

	// NotifyChatMessage tells the phones of the recipients what was said. A
	// person's own message does not notify them; an agent's message does,
	// whose answer its owner may be waiting for.
	NotifyChatMessage(message *models.AgentMessage, chatTitle string, isGroup bool, recipients []ChatRecipient)
}

ChatPublisher tells everybody watching the conversations the events are for that something happened in their chat, on this instance and the others, and the phones of those who are not looking. The chat hub is one.

type ChatRecipient added in v0.170.0

type ChatRecipient struct {
	UserID         string
	AgentID        string
	ConversationID string

	// NotificationLevel is what the member asked to be told of in this chat:
	// every message, only one that mentions them, or nothing.
	NotificationLevel models.ChatNotificationLevel

	// IsConversationArchived says the member put the chat away: it is as
	// quiet for them as one turned off.
	IsConversationArchived bool
}

ChatRecipient is a member who may be told of a message on their phone.

type ChatTurn added in v0.170.0

type ChatTurn struct {
	// ChatID is the chat, which the conversation of the turn is the owner's
	// own for.
	ChatID string

	// MessageID is the chat message that addressed the agent. It is empty for
	// the turn a late answer to a card brings, which has no message of the
	// chat to answer.
	MessageID string

	// AskerUserID and AskerName are who wrote it.
	AskerUserID string
	AskerName   string

	// IsMemberTurn says somebody other than the owner asked, whom the owner
	// allowed to.
	IsMemberTurn bool
}

ChatTurn is what makes a turn one in a chat.

type CodingContext added in v0.124.0

type CodingContext struct {
	// ProjectPath is the page of the checkout the session runs in, and
	// CheckoutDirectory where that checkout is; both empty where the
	// directory is in no checkout memory knows.
	ProjectPath       string
	CheckoutDirectory string

	// ReadFrom says where and at which commit memory read the project,
	// where that is not the session's own checkout as it stands: another
	// computer's copy of the repository, or this one at an older commit.
	// Empty where they are the same, or where the session's commit is not
	// known.
	ReadFrom string

	// Pages are the pages shown and the facts shown from each.
	Pages []*RecalledPage

	// Lessons are the lessons shown, a line each.
	Lessons []string

	// LastSession is the previous session in the directory, at session
	// start only.
	LastSession *CodingSession

	// ShownPaths is every page shown, for the session to skip next time.
	ShownPaths []string

	// Text is all of it as the session reads it, wrapped in
	// CodingMemoryTag; empty where there is nothing to show.
	Text string
}

CodingContext is what a coding session is shown.

type CodingRequest added in v0.124.0

type CodingRequest struct {
	// Directory is the session's working directory, absolute, on the
	// computer ComputerName; HomeDirectory is that computer's home
	// directory, which a checkout recorded with a leading ~ is under.
	Directory     string
	ComputerName  string
	HomeDirectory string

	// SessionID is the coding tool's own id for the session, so that the
	// session being resumed is not reported as the one before it.
	SessionID string

	// RemoteURLs, Head and CheckoutRoot are what git says about the
	// checkout the session runs in, where it is one: where it is pushed,
	// the commit it is at, and its top directory. A checkout on another
	// computer is the same project only when it is the same repository,
	// whatever its path, and memory read at another commit may not say
	// what is here. The remotes come origin first, and the first one
	// memory knows names the repository.
	RemoteURLs   []string
	Head         string
	CheckoutRoot string

	// Prompt is what the person typed, for a prompt's recall.
	Prompt string

	// ShownPaths are pages the session was shown in its last few
	// prompts, which are not shown again.
	ShownPaths []string

	// IsEverywhere recalls from the whole graph instead of the checkout's
	// project and what it links to.
	IsEverywhere bool
}

CodingRequest is where a coding session is and what it asks.

type CodingSession added in v0.124.0

type CodingSession struct {
	Title        string
	Assistant    string
	LastActiveAt time.Time
	Requests     []string
	LastAnswer   string
}

CodingSession is a previous session in a directory: what it was called, when it was last active, and how it ended.

type ComputerIdentity added in v0.50.0

type ComputerIdentity struct {
	Name   string
	System string
	Home   string

	// Description is the person's sentence about what the computer is for,
	// which the agent reads to choose between several; empty when they gave
	// none.
	Description string

	// Terminal is the session of the terminal the person attached it from,
	// when they did.
	Terminal string

	// Features are what the program offers beyond its protocol, such as
	// background commands.
	Features []string
}

ComputerIdentity is what a computer says about itself when it attaches.

type ConductData

type ConductData struct {
	AgentName         string
	PersonName        string
	ServerName        string
	Language          string
	Short             bool
	HouseInstructions string
	Instructions      string
	Voice             string
}

ConductData is what the conduct is rendered with.

type Deferral

type Deferral struct {
	Until  time.Time
	Reason string
}

Deferral is what a handler returns when a run must wait — for a budget, for a hold window — rather than fail.

func (*Deferral) Error

func (self *Deferral) Error() string

type DeviceConnection

type DeviceConnection interface {
	Send(message []byte) error
}

DeviceConnection is what the relay needs of a device's websocket.

type DraftInput

type DraftInput struct {
	Configuration *config.Configuration
	Agent         *models.Agent
	Owner         *models.User
	Mailbox       *models.Mailbox
	Source        *models.AgentMailbox
	Subject       string
	Instructions  string

	// Message is the one being answered; Earlier are the ones before it,
	// oldest first, as many as fit.
	Message *MessageContext
	Earlier []*MessageContext

	// Summary and Notes are what the agent already worked out about the
	// conversation and the message, when it has.
	Summary  string
	Notes    string
	Memories []string

	// Corrections are the replies this agent wrote that the person would
	// not let go: cancelled, or rewritten before they went. Shown as
	// examples of what not to write again.
	Corrections []string

	// Exemplars are the person's own past messages nearest in meaning to
	// this one: how they actually write to somebody about something like
	// this. Empty unless they have pointed the agent at their sent mail.
	//
	// Their own words rather than a description of them. A voice
	// described in fields says "friendly, brief"; five of their own
	// replies say how they open, how much they explain, and whether they
	// sign off at all.
	Exemplars []string
}

DraftInput is everything the draft prompt is built from.

type Event

type Event struct {
	Kind           EventKind `json:"kind"`
	RunID          string    `json:"runId"`
	ConversationID string    `json:"conversationId"`
	Sequence       int       `json:"sequence"`
	Text           string    `json:"text,omitempty"`
	Tool           string    `json:"tool,omitempty"`
	CallID         string    `json:"callId,omitempty"`
	Arguments      string    `json:"arguments,omitempty"`
	// Intention is, on a tool call, the model's words for what the call
	// does, for the apps to show in place of the tool's name; "" when it
	// gave none fit to show.
	Intention string `json:"intention,omitempty"`
	Risk      string `json:"risk,omitempty"`
	Note      string `json:"note,omitempty"`
	// NoteKind and NoteDetail are a note's kind and detail, for a client
	// that words it in the person's language; Note is it in English.
	NoteKind   string `json:"noteKind,omitempty"`
	NoteDetail string `json:"noteDetail,omitempty"`
	Error      string `json:"error,omitempty"`
	// DrawerID is, on a locate event, the drawer that is to answer it
	// (AskSettings.DrawerID).
	DrawerID string `json:"drawerId,omitempty"`
	// MessageID, Emoji and ReactorKind are, on a reacted event, the
	// message, the emoji now on it from that reactor, empty when the
	// reaction was taken away, and who reacted: person or agent.
	MessageID   string `json:"messageId,omitempty"`
	Emoji       string `json:"emoji,omitempty"`
	ReactorKind string `json:"reactorKind,omitempty"`

	// ReactorUserID and ReactorName say which person reacted, on a reacted
	// event in a chat.
	ReactorUserID string `json:"reactorUserId,omitempty"`
	ReactorName   string `json:"reactorName,omitempty"`

	// UserID and Name are, on a read event, the member whose mark moved and,
	// on a typing event, the member who is writing and what to call them.
	UserID string `json:"userId,omitempty"`
	Name   string `json:"name,omitempty"`

	// AuthorAgentID is, on a typing event of an agent ("is thinking") and on
	// the text event of an answer being written in a chat, the agent: its
	// Name is what to call it, and there is no UserID.
	AuthorAgentID string `json:"authorAgentId,omitempty"`

	// AuthorOwnerName is, on the same two events, the name of the agent's
	// owner, so that a client can say whose agent is thinking when two of them
	// are both called "Agent".
	AuthorOwnerName string `json:"authorOwnerName,omitempty"`

	// Message is, on a said or edited event, the message as the receiving
	// member reads it. IsMessageCut says it was too long to travel to the
	// other instances whole, or at all, and the client reads the
	// conversation again.
	Message      *models.AgentMessage `json:"message,omitempty"`
	IsMessageCut bool                 `json:"isMessageCut,omitempty"`
	At           time.Time            `json:"at"`
	// contains filtered or unexported fields
}

Event is one thing that happened in a run.

func FitEventForRelay added in v0.170.0

func FitEventForRelay(event Event) Event

FitEventForRelay cuts what is too long for a notification to the other instances, as the agent's own feed does for its events; see fitForRelay. The chat hub relays its events the same way.

type EventKind

type EventKind string

EventKind is what an event of a run carries.

const (
	EventAsked        EventKind = "asked"        // a turn began: what the person said, and where from
	EventText         EventKind = "text"         // a piece of the answer
	EventMessage      EventKind = "message"      // the whole answer, once it is
	EventToolCall     EventKind = "tool_call"    // the model asked for a tool
	EventToolResult   EventKind = "tool_result"  // the tool answered
	EventConfirmation EventKind = "confirmation" // waiting for the person
	EventQuestion     EventKind = "question"     // the agent asked something
	EventNote         EventKind = "note"         // compaction and the like
	EventTitled       EventKind = "titled"       // the conversation was given a title: Text
	EventNavigate     EventKind = "navigate"     // the dashboard is to show a page of itself: Text is its path
	EventLocate       EventKind = "locate"       // the browser the person writes in is asked where it is: CallID
	EventReacted      EventKind = "reacted"      // a reaction on a message changed: MessageID, Emoji (empty is taken away), ReactorKind; in a chat also ReactorUserID, ReactorName
	EventDone         EventKind = "done"
	EventError        EventKind = "error"

	// The events of a chat conversation, which belong to no run. Each is
	// published to the conversation of every member who is in the chat.
	EventSaid    EventKind = "said"    // a new message: Message, whole unless IsMessageCut
	EventEdited  EventKind = "edited"  // a message was changed: Message
	EventDeleted EventKind = "deleted" // a message was deleted: MessageID; or, named ChatStreamingKey(run), words that were streamed and will not be stored
	EventRead    EventKind = "read"    // a member's read mark moved: UserID, MessageID
	EventTyping  EventKind = "typing"  // a member is writing: UserID, Name; an agent is thinking: AuthorAgentID, Name

	// EventMembers says the people in a chat or what they allow changed (a
	// switch for their agent): read the chat's members again.
	EventMembers EventKind = "members"
)

The events a run emits, in the order a drawer shows them.

type ExtractAnswer

type ExtractAnswer struct {
	Events    []ExtractedEvent    `json:"events"`
	Contacts  []ExtractedContact  `json:"contacts"`
	FollowUps []ExtractedFollowUp `json:"follow_ups"`
}

ExtractAnswer is the object the run answers with.

type ExtractedAmount added in v0.169.0

type ExtractedAmount string

ExtractedAmount is an amount as the model wrote it, a number or the text of one such as "1,234.00", which is read when the follow-up is.

func (*ExtractedAmount) UnmarshalJSON added in v0.169.0

func (self *ExtractedAmount) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a JSON number or string.

type ExtractedContact

type ExtractedContact struct {
	Name         string   `json:"name"`
	Organization string   `json:"organization"`
	Title        string   `json:"title"`
	Emails       []string `json:"emails"`
	Phones       []string `json:"phones"`
	Note         string   `json:"note"`
	ContactID    string   `json:"contact_id"`
	Because      string   `json:"because"`
}

ExtractedContact is somebody the words describe, usually a signature.

type ExtractedEvent

type ExtractedEvent struct {
	Summary  string `json:"summary"`
	Starts   string `json:"starts"`
	Ends     string `json:"ends"`
	Location string `json:"location"`
	AllDay   bool   `json:"all_day"`
	Because  string `json:"because"`
}

ExtractedEvent is an appointment the words describe.

type ExtractedFollowUp added in v0.169.0

type ExtractedFollowUp struct {
	Kind           string          `json:"kind"`
	Title          string          `json:"title"`
	Payee          string          `json:"payee"`
	Carrier        string          `json:"carrier"`
	Amount         ExtractedAmount `json:"amount"`
	CurrencyCode   string          `json:"currency_code"`
	TrackingNumber string          `json:"tracking_number"`
	DueOn          string          `json:"due_on"`
	Place          string          `json:"place"`
	Key            string          `json:"key"`
	Resolves       bool            `json:"resolves"`
	Because        string          `json:"because"`
}

ExtractedFollowUp is something the message says is due, on its way or coming up, or says is done.

type Family

type Family = tools.Family

type FeedChoiceSettings added in v0.230.0

type FeedChoiceSettings struct {
	Agent      *models.Agent
	Owner      *models.User
	Operations Operations

	// IsPersonsTap and IsOperatorActingAsPerson are the request's, as for
	// AskSettings: the message a chosen action sends is the person's own only
	// when they tapped.
	IsPersonsTap             bool
	IsOperatorActingAsPerson bool

	Item      *models.AgentFeedItem
	ChoiceKey string

	// AnsweringConversationID is the conversation of the turn that answers
	// for the person, when they asked it to in words (the feed tool sends
	// it). That turn carries an action out itself, so the answer is only
	// recorded, with that conversation as where it was carried out, and no
	// turn of its own starts.
	AnsweringConversationID string
}

FeedChoiceSettings is a person's choice on a card, and what carrying it out needs.

type FeedPost added in v0.230.0

type FeedPost struct {
	// AgentID is the agent posting; its person's feed is the one posted to.
	AgentID string

	Item *models.AgentFeedItem

	// InteractionConversationID is the conversation of the turn that posted,
	// where a decision's durable question is raised. Empty raises none: a card
	// an alert or a coding session posts has no turn to hang it on.
	InteractionConversationID string
}

FeedPost is a card to post and where its question is raised.

type FeedResolver added in v0.240.0

type FeedResolver struct {
	Kind models.FeedResolverKind

	// ID is the goal's conversation for a goal, and the person's user for a
	// person; empty for the agent outside a goal's own turn.
	ID string
}

FeedResolver is who marks a card resolved or takes the mark off.

type FollowUpBackfillView added in v0.169.0

type FollowUpBackfillView struct {
	// QueuedMessageCount is how many past messages were queued to be read
	// for follow-ups, none when the agent has no mailbox to look into.
	QueuedMessageCount int `json:"queuedMessageCount"`
}

FollowUpBackfillView is what a look back answers with.

type FollowUpFinding added in v0.169.0

type FollowUpFinding struct {
	FollowUp models.AgentFollowUp
	Resolves bool
	Because  string

	// ParcelNumbers are the order and tracking numbers a parcel's message
	// gave, by which a delivery notice closes the parcel whatever key the
	// first message made.
	ParcelNumbers []string
}

FollowUpFinding is a follow-up the answer carried that is usable: the follow-up to keep, or, when Resolves, the one to close and the words that say why.

func InterpretFollowUps added in v0.169.0

func InterpretFollowUps(answer *ExtractAnswer, agentId, mailId string) []FollowUpFinding

InterpretFollowUps turns the model's answer into follow-ups for the agent, refusing what is not usable: an unknown kind, one with no key, a bill with no amount that can be read, a bill, deadline or event with no day. Those are guesses, and a guessed bill is worse than a missing one. A follow-up that resolves is held to less, since a receipt or a delivery notice often leaves out the amount and the day, and only has to name what it closes.

The key is made here and not left to the model's spelling: the kind in front, the rest in lower case with its spaces gathered, so a later message about the same parcel or bill finds the same row.

type GoalChange added in v0.232.0

type GoalChange struct {
	GoalTitle                *string
	GoalDescription          *string
	GoalEmoji                *string
	GoalTimes                *[]string
	GoalMailConditions       *[]models.MailboxRuleCondition
	GoalWrittenBy            string
	IsGoalNotifiedWhenPosted *bool
}

GoalChange is a change to a goal: only what is not nil changes. Times or mail conditions given replace the goal's, and an empty list clears them.

type GoalStart added in v0.232.0

type GoalStart struct {
	GoalTitle                string
	GoalDescription          string
	GoalEmoji                string
	OriginConversationID     string
	GoalTimes                []string
	GoalMailConditions       []models.MailboxRuleCondition
	GoalWrittenBy            string
	IsGoalNotifiedWhenPosted bool
}

GoalStart is what a goal is started with: what it is called and what it is for, the conversation it was asked for in, and, for a goal on set times, its times and the mail it waits for. Who wrote it decides whether its turns read its description as the person's words.

func DailyBriefGoal added in v0.239.0

func DailyBriefGoal(found *models.Agent, owner *models.User) *GoalStart

DailyBriefGoal is the goal the daily brief idea starts: an ordinary goal that the Goals screens show, where its words can be edited, its time changed or the whole thing dropped. Written as built in, not as the person's: the brief reads the inbox, so a turn it wakes does not count as the person asking for Passwords. The person's own words, because they pressed the button: a goal the agent writes for itself arrives as a note about what to do rather than as an instruction.

type Handler

type Handler func(ctx context.Context, run *Run) error

Handler runs one kind of job. It returns nil when the job is done, a Deferral to wait for a budget, or an error to retry.

type HerdrAnswer added in v0.120.0

type HerdrAnswer struct {
	ComputerName string
	*computer.HerdrAnswerResult
}

HerdrAnswer says whether a question took its answer.

type HerdrClose added in v0.120.0

type HerdrClose struct {
	ComputerName string
	*computer.HerdrCloseResult
}

HerdrClose says a session's pane was closed.

type HerdrFile added in v0.251.0

type HerdrFile struct {
	ComputerName string
	*computer.HerdrFileResult
}

HerdrFile is a picture or a file of a session's turns.

type HerdrRead added in v0.120.0

type HerdrRead struct {
	ComputerName string
	*computer.HerdrReadResult
}

HerdrRead is a session's last turns.

type HerdrScreen added in v0.120.0

type HerdrScreen struct {
	ComputerName string
	*computer.HerdrScreenResult
}

HerdrScreen is a session's screen.

type HerdrSent added in v0.164.0

type HerdrSent struct {
	HerdrSession
	FilePaths []string
}

HerdrSent is a session once something was sent to it, and where the files sent with it were written.

type HerdrSession added in v0.120.0

type HerdrSession struct {
	ComputerName string
	*computer.HerdrSession
}

HerdrSession is one coding session on one of a person's computers.

type HerdrSetup added in v0.120.0

type HerdrSetup struct {
	ComputerName string
	*computer.HerdrSetupResult
}

HerdrSetup says what setting up the hooks did, on which computer.

type HerdrSubagents added in v0.186.0

type HerdrSubagents struct {
	ComputerName string
	*computer.HerdrSubagentsResult
}

HerdrSubagents is the agents a session started for its current request.

type HerdrWait added in v0.120.0

type HerdrWait struct {
	ComputerName string
	*computer.HerdrWaitResult
}

HerdrWait is a session once it stopped working, or when the wait ran out.

type IdeaProposal added in v0.78.3

type IdeaProposal struct {
	IdeaCategory     string                     `json:"idea_category"`
	Emoji            string                     `json:"emoji"`
	Headline         string                     `json:"headline"`
	Body             string                     `json:"body"`
	OpeningRequest   string                     `json:"opening_request"`
	NeededToolNames  []string                   `json:"needed_tool_names"`
	Evidence         []models.AgentIdeaEvidence `json:"evidence"`
	SuggestionReason string                     `json:"suggestion_reason"`
	// ExpiresOn is the day it stops mattering, as 2006-01-02; two weeks
	// from now when left out.
	ExpiresOn string `json:"expires_on"`
}

IdeaProposal is a personal idea as whoever proposes it words it: the `idea` tool's propose action through ProposeAgentIdea, and a dream that ends with its ideas in an object. The JSON names are the tool's own parameter names, which is what the dream's prompt asks the object for.

func (*IdeaProposal) Idea added in v0.78.3

func (self *IdeaProposal) Idea(now time.Time) (*models.AgentIdea, error)

Idea is the proposal as the idea ProposeIdea checks and keeps, or why the day it stops mattering cannot be read.

type IncomeCategoryMonthInput added in v0.98.0

type IncomeCategoryMonthInput struct {
	// BudgetAmount is the income expected in the whole month, and
	// IncomeAmount what has come in so far.
	BudgetAmount *big.Rat
	IncomeAmount *big.Rat

	// DayOfMonth is today, from one; DaysInMonth how many days the month
	// has; IsMonthOver says today is past the month's last day.
	DayOfMonth  int
	DaysInMonth int
	IsMonthOver bool
}

IncomeCategoryMonthInput is what ProjectIncomeCategoryMonth reads, every amount already in the budget's currency.

type IncomeCategoryMonthProjection added in v0.98.0

type IncomeCategoryMonthProjection struct {
	ExpectedByTodayAmount *big.Rat
	ProjectedAmount       *big.Rat
	IncomePace            models.IncomePace
}

IncomeCategoryMonthProjection is where an income spending category's month is heading.

func ProjectIncomeCategoryMonth added in v0.98.0

func ProjectIncomeCategoryMonth(input *IncomeCategoryMonthInput) *IncomeCategoryMonthProjection

ProjectIncomeCategoryMonth projects an income spending category's month end and names its pace. Income comes in a few large amounts (a salary on one day, a payment on another), so the straight line spending is projected with would read a month before its pay day as heading for nothing. The projection is the expected income instead, or what came in when that is more already; a month that is over ends at what came in.

The pace compares what came in with the expected income spread evenly over the month up to today: behind after the first week (or in a month that is over) when less than ninety percent of that came in; ahead when more than the whole month's expected income, by over ten percent, came in; on_track otherwise.

type IncomeCategoryYearInput added in v0.104.0

type IncomeCategoryYearInput struct {
	Months     []*IncomeCategoryYearMonth
	IsYearOver bool
}

IncomeCategoryYearInput is what ProjectIncomeCategoryYear reads.

type IncomeCategoryYearMonth added in v0.104.0

type IncomeCategoryYearMonth struct {
	BudgetMonthPhase BudgetMonthPhase

	// BudgetAmount is the income expected that month.
	BudgetAmount *big.Rat

	// IncomeAmount is what came in, so far for the month in progress; nil
	// for a month to come.
	IncomeAmount *big.Rat

	// ProjectedAmount and ExpectedByTodayAmount are the month in
	// progress's (ProjectIncomeCategoryMonth), and DayOfMonth is its
	// today, from one; ignored for the other phases.
	ProjectedAmount       *big.Rat
	ExpectedByTodayAmount *big.Rat
	DayOfMonth            int
}

IncomeCategoryYearMonth is one month of a year in which an income spending category had a budget, every amount in the year's currency.

type IncomeCategoryYearProjection added in v0.104.0

type IncomeCategoryYearProjection struct {
	BudgetAmount          *big.Rat
	IncomeAmount          *big.Rat
	ExpectedByTodayAmount *big.Rat
	ProjectedAmount       *big.Rat
	BudgetedMonthCount    int
	IncomePace            models.IncomePace
}

IncomeCategoryYearProjection is where an income spending category's year is heading against the income expected in its months.

func ProjectIncomeCategoryYear added in v0.104.0

func ProjectIncomeCategoryYear(input *IncomeCategoryYearInput) *IncomeCategoryYearProjection

ProjectIncomeCategoryYear adds up an income spending category's budgeted months the way ProjectIncomeCategoryMonth does one: a month that is over ends at what came in, the month in progress at its projection, and a month to come at the income expected of it. The income expected by today is the months that are over whole and the month in progress's share by its days.

The pace is a month's over the year: ahead once more than the whole year's expected income, by over ten percent, came in; behind, after the first week of the first budgeted month to begin, when less than ninety percent of what was expected by today came in; on_track otherwise.

type InterruptedAnswer added in v0.115.0

type InterruptedAnswer struct {
	HeardText   string `json:"heardText"`
	UnheardText string `json:"unheardText"`
}

InterruptedAnswer is a spoken answer the person cut in on: what had been played to them, and the rest, which was written but not heard.

type JudgedPlan added in v0.93.0

type JudgedPlan struct {
	Depth  string
	Reason string
	Plan   *RetrievalPlan

	// Cost is what the judgement cost, in the configured currency.
	Cost float64
}

JudgedPlan is what the depth judgement said of a question judged on its own: how deep it deserves, why, and the retrieval plan a live turn would follow for it.

type LocationAnswer added in v0.125.0

type LocationAnswer struct {
	LatitudeDegrees  float64   `json:"latitudeDegrees"`
	LongitudeDegrees float64   `json:"longitudeDegrees"`
	AccuracyMeters   float64   `json:"accuracyMeters"`
	MeasuredAt       time.Time `json:"measuredAt"`
	ErrorMessage     string    `json:"errorMessage,omitempty"`
}

LocationAnswer is what the browser says to a location call: where it is, or, in ErrorMessage, why it cannot say.

type MessageContext

type MessageContext struct {
	MailID      string
	From        string
	To          string
	Cc          string
	Date        string
	Subject     string
	ListKey     string
	Attachments []string
	Text        string
	Truncated   bool

	// Facts the server already established, in a line the model can use:
	// authentication results, whether the sender is a contact, whether a
	// filter flagged it.
	Facts []string
}

MessageContext is one message, reduced.

func BuildMessageContext

func BuildMessageContext(ctx context.Context, store storage.Storage, mail *models.Mail, maximumCharacters int, includeQuoted bool) (*MessageContext, error)

BuildMessageContext reads a stored message and reduces it.

func (*MessageContext) Render

func (self *MessageContext) Render() string

Render writes the context the way the prompts include it.

type NewFollowUp added in v0.169.0

type NewFollowUp struct {
	FollowUpKind   models.AgentFollowUpKind
	FollowUpTitle  string
	DueOn          string
	Payee          string
	Amount         string
	CurrencyCode   string
	Carrier        string
	TrackingNumber string
	Place          string
}

NewFollowUp is a follow-up the person names themselves.

type Operations

type Operations = tools.Operations

Operations is the server as the person: every tool that touches the server goes through it, so a tool can do exactly what the person can do and nothing else. It is the API — the same operations the dashboard and the command line call, with the same permissions, validation and audit — handed to the agent by the package that owns them, executed as the person with the audit trail saying the agent did it.

type OperationsFactory

type OperationsFactory func(ctx context.Context, owner *models.User) (Operations, error)

OperationsFactory makes the API as a person, for a run nobody started from a request. The API package provides it.

type OverviewCoverage added in v0.89.0

type OverviewCoverage struct {
	ChildCount                 int `json:"childCount"`
	ChildShownCount            int `json:"childShownCount"`
	ChildWithoutOverviewCount  int `json:"childWithoutOverviewCount"`
	MemberCount                int `json:"memberCount"`
	MemberShownCount           int `json:"memberShownCount"`
	MemberWithoutOverviewCount int `json:"memberWithoutOverviewCount"`
	LinkCount                  int `json:"linkCount"`
	LinkShownCount             int `json:"linkShownCount"`
}

OverviewCoverage is how much of what a page's overview could be written from its prompt shows: of the pages under it, the members of a theme and the pages linked to it, how many there are and how many were shown, the most important and strongest first; and how many of those shown had no overview of their own, so were shown by their opening alone.

type OverviewState added in v0.89.0

type OverviewState struct {
	Coverage OverviewCoverage

	// IsStale says what the overview is written from has changed since it
	// was written, or a rewrite was asked for; the next dream writes it
	// again.
	IsStale bool
}

OverviewState is how a page's overview stands: how much of what it could be written from its prompt shows now, and whether that has changed since it was written. Counted by code, from the graph as it is.

func OverviewStateOf added in v0.89.0

func OverviewStateOf(tx db.Transaction, agentId string, page *models.AgentNode) (*OverviewState, error)

OverviewStateOf reads how a page's overview stands.

type PhoneNotifier added in v0.170.0

type PhoneNotifier struct {
	// contains filtered or unexported fields
}

PhoneNotifier sends a notification to a person's phones, encrypted for each one, through this server's own relay or the relay over HTTP. It needs a database and a configuration and nothing else, so a server with no model, and so no agent, sends the phones what happens in a chat the way the agent sends what it says.

func NewPhoneNotifier added in v0.170.0

func NewPhoneNotifier(settings *PhoneNotifierSettings) *PhoneNotifier

NewPhoneNotifier is a notifier that builds its sender when the first notification is sent.

func (*PhoneNotifier) NotifyCircleInvitation added in v0.170.0

func (self *PhoneNotifier) NotifyCircleInvitation(agentId, invitedByName, circleName string)

NotifyCircleInvitation tells the phones of an agent's person about an invitation, in the background, in their language.

func (*PhoneNotifier) NotifyCircleMemberAdded added in v0.194.0

func (self *PhoneNotifier) NotifyCircleMemberAdded(agentId, addedName, circleName string)

NotifyCircleMemberAdded tells the phones of an agent's person that an account was put in a circle they administer, in the background, in their language.

func (*PhoneNotifier) NotifyPhone added in v0.170.0

func (self *PhoneNotifier) NotifyPhone(ctx context.Context, phone *models.AgentPhone, content *push.Content) error

NotifyPhone sends one notification to one phone and records how it went.

func (*PhoneNotifier) NotifyPhones added in v0.170.0

func (self *PhoneNotifier) NotifyPhones(agentId, notificationKind string, content *push.Content)

NotifyPhones sends a notification to each of the person's phones that wants its kind, in the background: nothing that raises one waits on Apple.

func (*PhoneNotifier) NotifyPlaceVisit added in v0.175.0

func (self *PhoneNotifier) NotifyPlaceVisit(ctx context.Context, ownerUserId string, visit *models.PlaceVisit, isArrival bool)

NotifyPlaceVisit tells the phones of everyone the owner shares their location with that the owner arrived at or left the visit's place, when that place is named by the owner or labeled. The title is the owner's name and the notification carries the owner's id so that the app opens Location with them. visit.Place is read when it is there and looked up when it is not.

It does nothing for a visit with no place, an unnamed and unlabeled place, an arrival or departure more than placeVisitNoticeWindow ago, or a notice already told in the last placeVisitNoticeInterval to the same receiver. Nor does it tell a receiver who muted the owner's notices, or one who was at the place too (wasThereToo): people who arrive or leave together, or somebody already there, see it for themselves. A receiver is told only of what happened after the share that reaches them was made, since what the owner did before it is not theirs to know; for a share to a circle that is the share's own date. The sending is in the background, as NotifyPhones is.

func (*PhoneNotifier) NotifyPlaceVisitAt added in v0.175.0

func (self *PhoneNotifier) NotifyPlaceVisitAt(ctx context.Context, ownerUserId string, visit *models.PlaceVisit, isArrival bool, happenedAt time.Time)

NotifyPlaceVisitAt is NotifyPlaceVisit for an arrival or a departure that happened at a time of its own. A visit that was joined into an earlier one is stored with the first arrival, hours old, though the person arrived just now, so the window and the date of the share are tested against the time that was reported.

func (*PhoneNotifier) NotifyRelationship added in v0.178.0

func (self *PhoneNotifier) NotifyRelationship(agentId string, noteKind models.AgentNoteKind, detail string)

NotifyRelationship tells the phones of an agent's person what the note says, in the background, in their language.

func (*PhoneNotifier) NotifySharing added in v0.194.0

func (self *PhoneNotifier) NotifySharing(agentId string, noteKind models.AgentNoteKind, detail string)

NotifySharing tells the phones of an agent's person what the note says, in the background, in their language.

func (*PhoneNotifier) NotifyShoppingArrival added in v0.201.0

func (self *PhoneNotifier) NotifyShoppingArrival(ctx context.Context, userId string, visit *models.PlaceVisit, happenedAt time.Time)

NotifyShoppingArrival reminds the person, on their own phones, of what their lists need at the store they just arrived at: the items for that store, and the items for any store when the place is a grocery shop. Nothing is sent for a place that is not a store any item names, a store the person asked never to be reminded at, a list they muted, an arrival more than placeVisitNoticeWindow ago, or a second time within shoppingArrivalInterval. The sending is in the background, as NotifyPhones is.

func (*PhoneNotifier) NotifyShoppingStarted added in v0.201.0

func (self *PhoneNotifier) NotifyShoppingStarted(ctx context.Context, shopper *models.User, trip *models.ShoppingTrip)

NotifyShoppingStarted tells everybody the trip's lists reach, but the shopper, that the shopper started shopping, naming the lists each of them shares and the store, so they can add what they forgot. Somebody told within shoppingStartedInterval about the same shopper is not told again.

func (*PhoneNotifier) RingPhone added in v0.212.0

func (self *PhoneNotifier) RingPhone(ctx context.Context, phone *models.AgentPhone, content *push.Content) error

RingPhone rings one phone for a call through its VoIP registration, which wakes the app to show the incoming call. A registration Apple says is gone is cleared, leaving the phone's ordinary one alone. It does not record a delivery: the phone's last delivery is about its notifications.

func (*PhoneNotifier) RingPhones added in v0.212.0

func (self *PhoneNotifier) RingPhones(agentId string, content *push.Content) (rangCount int)

RingPhones rings each of the person's phones for a call, and waits for the relay to answer for all of them, since the call wants to know whether anybody could be reached. content is the call as the phone shows it: the caller fills ConversationID and CallID, and the kind is NotificationCall.

A phone that can ring is sent a VoIP push, which wakes the app. A phone that cannot (its app is too old to register one, or Apple said its VoIP token is gone), and one whose VoIP push failed, gets an ordinary alert with the same content, so it still shows "somebody is calling". The phone's own choice of notification kinds does not apply: whether to ring a member at all is for the caller to decide. The count is of phones reached either way.

func (*PhoneNotifier) Sender added in v0.170.0

func (self *PhoneNotifier) Sender() (push.Sender, error)

Sender is how this server sends to phones now, or nil while notifications are off.

func (*PhoneNotifier) UnringPhones added in v0.212.0

func (self *PhoneNotifier) UnringPhones(agentId string, content *push.Content, exceptPhoneId string)

UnringPhones tells each of the person's phones that can be rung that a call no longer rings them, through the same VoIP registration, so that a phone still ringing stops. A phone that cannot be rung is told nothing: it was shown an alert, which a later alert would not take back. It returns without waiting for the relay.

type PhoneNotifierSettings added in v0.170.0

type PhoneNotifierSettings struct {
	Database db.Database

	// Configuration is read for every notification, so a change to the push
	// settings applies without a restart.
	Configuration func() *config.Configuration

	// Context ends the notifications still being sent; WaitGroup counts them,
	// so that whoever owns the notifier can wait for them to finish.
	Context   context.Context
	WaitGroup *sync.WaitGroup

	// Sender replaces the relay, for a test that stands in for it. Nil is the
	// relay the configuration names.
	Sender push.Sender
}

PhoneNotifierSettings is what a PhoneNotifier needs: the database that holds the phones, the configuration that says how to reach the relay, and the lifetime of the notifications it sends in the background.

type Presence added in v0.170.0

type Presence struct {
	// contains filtered or unexported fields
}

Presence is who has a dashboard or the app open, kept in memory and nowhere else: a restart forgets it until each open tab or app reports again, within a minute. Each report is passed to the other instances too (RelayReports), so every instance knows what every tab said. The agent speaks first only to somebody who is there to read it, offers an idea only to somebody who has gone quiet, and tells a phone what nobody is there to see.

Reports are kept per person and per reporter: each tab and each phone names itself, so the app going to the background hides only the app, and a tab hidden in one window does not hide a tab shown in another.

One Presence is shared by the agent and by the chat hub, so that a server with no model, which has no agent, still knows who is looking at a chat.

func NewPresence added in v0.170.0

func NewPresence() *Presence

NewPresence is a Presence with nobody in it.

func (*Presence) ApplyRelayed added in v0.206.2

func (self *Presence) ApplyRelayed(report PresenceReport, now time.Time)

ApplyRelayed records a report another instance was given, as of now.

func (*Presence) IsWatching added in v0.170.0

func (self *Presence) IsWatching(userId string, lastWroteAt, now time.Time) bool

IsWatching says whether the person is looking at a dashboard or the app now, so that their phone need not be told. lastWroteAt is when they last wrote to the turn at hand, zero when nobody did: typing a question sends no report, so without it somebody who asked a moment ago could be judged away on the strength of a report from before they typed.

func (*Presence) IsWatchingConversation added in v0.170.0

func (self *Presence) IsWatchingConversation(userId, conversationId string, now time.Time) bool

IsWatchingConversation says whether one of the person's tabs or phones is shown, used lately, and has that conversation on screen, so that a message in it need not be told to their phone. Looking at the app on another screen, or at another conversation, does not count: the message is news.

func (*Presence) RelayReports added in v0.206.2

func (self *Presence) RelayReports(relay func(PresenceReport))

RelayReports has every report made here handed to relay as well.

func (*Presence) Report added in v0.170.0

func (self *Presence) Report(userId, reporterId string, isVisible bool, idleSeconds int, conversationId string, now time.Time)

Report records one tab's or one phone's report for a person: whether it is shown, and how long since their last keypress, click or scroll in it, and which conversation it shows, if any. reporterId names the tab or phone; a report without one is an older dashboard, whose hidden tab is not taken to hide a visible one that reported lately, since it cannot say which tab it is.

type PresenceReport added in v0.206.2

type PresenceReport struct {
	UserID         string `json:"userId"`
	ReporterID     string `json:"reporterId"`
	IsVisible      bool   `json:"isVisible"`
	IdleSeconds    int    `json:"idleSeconds"`
	ConversationID string `json:"conversationId,omitempty"`
}

PresenceReport is one report as it travels between instances.

type Proposal

type Proposal struct {
	Kind   string `json:"kind"`
	Path   string `json:"path"`
	To     string `json:"to"`
	Reason string `json:"reason"`
}

Proposal is something the night wants the person to decide.

type RecallExplanation added in v0.89.0

type RecallExplanation struct {
	// RetrievalMode is basic or planned, and Plan the plan followed, if
	// any.
	RetrievalMode string         `json:"retrievalMode"`
	Plan          *RetrievalPlan `json:"plan" graphapi:"nullable"`

	// Queries is each query the retrieval ran, in order: the message
	// first, then the planned searches, the hop and the broad weighting.
	Queries []*RecallQuery `json:"queries"`

	// Searches is each list a query produced and how much it found.
	Searches []*RecallSearch `json:"searches"`

	// Pages is every page any query found: the ones fused into the
	// candidates first, by fused rank, then the ones fusion left out.
	Pages []*RecallPageExplanation `json:"pages"`

	// Facts is every fact any query found, in the same order.
	Facts []*RecallFactExplanation `json:"facts"`

	// IsBroadNoteCarried says the turn was told a survey reads the whole
	// area, as a broad question is.
	IsBroadNoteCarried bool `json:"isBroadNoteCarried"`

	// TokenBudget is what the overlay may spend on the graph, and
	// TokensSpent what it did.
	TokenBudget int `json:"tokenBudget"`
	TokensSpent int `json:"tokensSpent"`
	// contains filtered or unexported fields
}

RecallExplanation is how one question's recall went.

type RecallFactExplanation added in v0.89.0

type RecallFactExplanation struct {
	// Reference is the fact as a page cites it, path#number.
	Reference string `json:"reference"`

	FusedRank int           `json:"fusedRank"`
	Ranks     []*RecallRank `json:"ranks"`

	RecallDecision string `json:"recallDecision"`
}

RecallFactExplanation is one fact the searches found and what became of it.

type RecallPageExplanation added in v0.89.0

type RecallPageExplanation struct {
	Path   string `json:"path"`
	NodeID string `json:"nodeId"`

	// FusedRank is the page's place among the candidates once every
	// query's lists were fused, from one; zero where fusion left it out.
	// Ranks is its place in each list that found it.
	FusedRank int           `json:"fusedRank"`
	Ranks     []*RecallRank `json:"ranks"`

	// HitFactCount is how many of the facts the searches found are on it.
	HitFactCount int `json:"hitFactCount"`

	RecallDecision string `json:"recallDecision"`

	// OverviewSectionHeading is the section of the overview carried, and
	// SectionChoice why that one; see the RecallSection values.
	OverviewSectionHeading string `json:"overviewSectionHeading"`
	SectionChoice          string `json:"sectionChoice"`

	// CarriedFactCount is how many facts the page's block carried, and
	// TokenCount what the block cost.
	CarriedFactCount int `json:"carriedFactCount"`
	TokenCount       int `json:"tokenCount"`
}

RecallPageExplanation is one page and what became of it.

type RecallQuery added in v0.93.0

type RecallQuery struct {
	QueryID   string `json:"queryId"`
	QueryKind string `json:"queryKind"`

	// QueryText is the words searched, or for the hop the page followed.
	QueryText string `json:"queryText"`
}

RecallQuery is one query a retrieval ran.

type RecallRank added in v0.93.0

type RecallRank struct {
	QueryID    string `json:"queryId"`
	SearchName string `json:"searchName"`
	Rank       int    `json:"rank"`
}

RecallRank is where a page or fact stood in one list.

type RecallSearch added in v0.89.0

type RecallSearch struct {
	QueryID    string `json:"queryId"`
	SearchName string `json:"searchName"`
	FoundCount int    `json:"foundCount"`
}

RecallSearch is one list a query produced, and how much it found.

type RecalledPage

type RecalledPage struct {
	Path string

	// Summary is the page's opening as the overlay carried it, or empty
	// where it carried none: a page the prompt's index already names.
	Summary string

	// Overview is the section of the page's overview the overlay
	// carried, or empty where it carried none.
	Overview string

	Facts []*models.AgentFact
}

RecalledPage is one page recall would carry and the facts it would carry from it.

type ReceiptPreview added in v0.118.0

type ReceiptPreview struct {
	ReceiptCheckState      models.ReceiptCheckState
	CheckDifferenceAmount  string
	ReceiptMatchCandidates []finance.ReceiptMatchCandidate
	IsReplacing            bool
}

ReceiptPreview is what recording a receipt would do, writing nothing.

type ReceiptRecording added in v0.118.0

type ReceiptRecording struct {
	// IsUnbalancedAccepted records a receipt whose lines do not add up,
	// marked unbalanced; without it such a receipt is refused. Only the
	// person decides it, or the receipt job, which has nobody to ask and
	// leaves the mark for the person to see.
	IsUnbalancedAccepted bool

	// FinanceTransactionID is the charge the receipt was handed in for, a
	// photo uploaded to it say: matched by hand, as the person's, instead
	// of by the matcher.
	FinanceTransactionID string

	// IsRecordedWhenHandMatchRefused records the receipt, unmatched with
	// its candidates, when the match to FinanceTransactionID is refused
	// (other receipts already explain the charge, another currency, money
	// in), saying why in HandMatchRefusalReason. Without it the whole
	// receipt is refused, which is right for a person who can fix the
	// call, and wrong for the receipt job, which would lose the upload's
	// reading for good.
	IsRecordedWhenHandMatchRefused bool

	// AgentJobID is the import job recording it, remembered on the receipt
	// so the list of imports can open it; empty for a person or the tool.
	AgentJobID string
}

ReceiptRecording is how a receipt is recorded.

type RecordedReceipt added in v0.118.0

type RecordedReceipt struct {
	FinanceReceipt         *models.FinanceReceipt
	ReceiptMatchCandidates []finance.ReceiptMatchCandidate
	IsReplaced             bool

	// HandMatchRefusalReason says why the receipt was not matched to the
	// charge the recording named, when IsRecordedWhenHandMatchRefused let
	// it be recorded anyway; "" otherwise.
	HandMatchRefusalReason string

	// DroppedReceiptMatchReasons say, one sentence each, which of the
	// person's matches were taken off because the receipt as read again no
	// longer fits them: a lower total, another currency.
	DroppedReceiptMatchReasons []string
}

RecordedReceipt is what recording a receipt did: the receipt as stored, with its lines and matches; the charges it could explain when the matcher left them for the person; and whether it took the place of the receipt read from the same source before.

type RememberAnswer

type RememberAnswer struct {
	Facts      []RememberedFact `json:"facts"`
	Links      []RememberedLink `json:"links"`
	Supersedes []SupersededFact `json:"supersedes"`
}

RememberAnswer is what the run answers with.

type RememberedFact

type RememberedFact struct {
	Path      string `json:"path"`
	NodeKind  string `json:"node_kind"`
	NodeName  string `json:"node_name"`
	Kind      string `json:"kind"`
	Text      string `json:"text"`
	Happened  string `json:"happened"`
	Quote     string `json:"quote"`
	MessageID string `json:"message_id"`
}

RememberedFact is one thing the conversation taught.

type RememberedLink struct {
	From     string `json:"from"`
	To       string `json:"to"`
	Relation string `json:"relation"`

	// Note is the sentence that justifies the link, in the words somebody
	// would use to say it, including details the relation alone cannot carry.
	Note string `json:"note"`
}

RememberedLink joins two pages.

type ReplyAnswer

type ReplyAnswer struct {
	Reply  *string `json:"reply"`
	Reason *string `json:"reason"`
}

ReplyAnswer is what the model answers: a reply, or a reason not to.

type Result

type Result = tools.Result

type ResumeSettings added in v0.61.4

type ResumeSettings struct {
	Interaction *models.AgentInteraction
	Answer      string
	// IsAnswerFromPersonsTap says the answer was the person's own tap on a
	// screen (access.Principal.IsPersonsTap), not a command line token, an
	// app password or an operator acting as the person. The turn that carries
	// the answer on counts as the person's only when this is set and the card
	// was raised by a run the person started.
	IsAnswerFromPersonsTap bool
	Agent                  *models.Agent
	Owner                  *models.User
	Operations             Operations
	Conversation           *models.AgentConversation
}

ResumeSettings is what a late answer needs to carry on: the card, what the person said, and who they are to the API.

type RetrievalPlan added in v0.93.0

type RetrievalPlan struct {
	Searches []string `json:"searches"`
	IsBroad  bool     `json:"isBroad"`
}

RetrievalPlan is how a turn's graph retrieval searches beyond the message's own words: the focused searches the depth judgement planned, and whether the message asks about a whole area. A live turn gets it from the judgement; a replay is given it, so that it asks no model anything.

type Risk

type Risk = tools.Risk

type Run

type Run struct {
	Job     *models.AgentJob
	Agent   *models.Agent
	Owner   *models.User
	Mailbox *models.Mailbox
	Source  *models.AgentMailbox

	// Now is the moment the tick that claimed the job ran as of, so that a
	// hold or a deferral is judged against the same clock that claimed it.
	Now time.Time

	// Subject is what a run no job queued is about -- the message a draft
	// answers, the conversation being titled or compacted -- so that its
	// transcript names it as a job's would.
	Subject string
	// contains filtered or unexported fields
}

Run is one job with what every handler needs resolved: the agent, its owner, and the mailbox the job is about.

func (*Run) Configuration

func (self *Run) Configuration() *config.Configuration

Configuration is the operator's configuration as of this tick.

func (*Run) Database

func (self *Run) Database() db.Database

Database is the run's database.

func (*Run) Registry

func (self *Run) Registry() *llm.Registry

Registry is the run's models.

func (*Run) Storage

func (self *Run) Storage() storage.Storage

Storage is the run's message store.

type RunCommand

type RunCommand struct {
	// Instance is who said it, filled in on the way out.
	Instance string `json:"instance"`
	RunID    string `json:"runId"`
	// Action is "stop", "answer", "resolve", "locate" or "liveActivity".
	Action  string `json:"action"`
	CallID  string `json:"callId,omitempty"`
	Answer  string `json:"answer,omitempty"`
	Approve bool   `json:"approve,omitempty"`
	// PushRegistration is the Live Activity a liveActivity command has the
	// run follow (see RegisterLiveActivity).
	PushRegistration string `json:"pushRegistration,omitempty"`
}

RunCommand is one word to a run.

type SavingMonthInput added in v0.98.0

type SavingMonthInput struct {
	// ExpectedIncomeAmount and ExpectedSpendingAmount are the month's
	// income and spending budgets added up.
	ExpectedIncomeAmount   *big.Rat
	ExpectedSpendingAmount *big.Rat

	// ProjectedIncomeAmount and ProjectedSpendingAmount are where the
	// month's income and spending are heading, or ended for a month that
	// is over.
	ProjectedIncomeAmount   *big.Rat
	ProjectedSpendingAmount *big.Rat

	// DayOfMonth is today, from one; IsMonthOver says today is past the
	// month's last day.
	DayOfMonth  int
	IsMonthOver bool
}

SavingMonthInput is what ProjectSavingMonth reads, every amount in one currency.

type SavingMonthProjection added in v0.98.0

type SavingMonthProjection struct {
	ExpectedSavingAmount   *big.Rat
	ProjectedSavingAmount  *big.Rat
	SavingDifferenceAmount *big.Rat
	SavingPace             models.SavingPace
}

SavingMonthProjection is a month's saving as its budgets expect it and as it is heading.

func ProjectSavingMonth added in v0.98.0

func ProjectSavingMonth(input *SavingMonthInput) *SavingMonthProjection

ProjectSavingMonth is a month's expected saving (income budgets less spending budgets), its projected saving (projected income less projected spending) and the difference. The pace is on_track while the projection lands within a tenth of the spending budgets (of the income budgets when there are no spending budgets) either side of the expected saving; behind below that, only after the first week or in a month that is over, since a hot first week projects spending high; ahead above it.

type SavingsTargetProgress added in v0.87.0

type SavingsTargetProgress struct {
	// SavedAmount is, for a cash flow target, income less spending since
	// it started; for an asset value target, what its assets and the
	// assets of its finance accounts are worth now less its starting
	// amount; for a net worth target, net worth now less its starting
	// amount. RemainingAmount is the target less that, never below zero.
	SavedAmount     string `json:"savedAmount"`
	RemainingAmount string `json:"remainingAmount"`

	// MonthsLeftCount is the months from this one to the target's, both
	// included, and RequiredMonthlyAmount what remains over them: the pace
	// needed.
	MonthsLeftCount       int    `json:"monthsLeftCount"`
	RequiredMonthlyAmount string `json:"requiredMonthlyAmount"`

	// IsBehind says a cash flow target's last two full months both saved
	// less than the pace they needed: the same test its alert is written
	// by. Always false for an asset value or net worth target.
	IsBehind bool `json:"isBehind"`

	// UnconvertedCurrencyCodes are the currencies left out for want of an
	// exchange rate into the target's.
	UnconvertedCurrencyCodes []string `json:"unconvertedCurrencyCodes"`
}

SavingsTargetProgress is how a savings target stands, in its currency: what it has saved, what remains, and the monthly pace that would still reach it by its day.

func SavingsTargetProgressOf added in v0.87.0

func SavingsTargetProgressOf(ctx context.Context, tx db.Transaction, fetcher *rates.Fetcher, agentId string, savingsTarget *models.SavingsTarget, today string) (*SavingsTargetProgress, error)

SavingsTargetProgressOf is how one savings target stands as of today ("2006-01-02", the person's local day), measured the way its alert is. A nil fetcher converts with the rates already stored.

type Scenario added in v0.94.0

type Scenario struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Steps       []*ScenarioStep `json:"steps"`
}

Scenario is the file.

func ReadScenario added in v0.94.0

func ReadScenario(path string) (*Scenario, error)

ReadScenario reads and checks a scenario file.

type ScenarioAnswerReport added in v0.94.0

type ScenarioAnswerReport struct {
	AnswerFrom       string   `json:"answerFrom"`
	AnswerVerdict    string   `json:"answerVerdict"`
	VerdictReason    string   `json:"verdictReason"`
	AnswerText       string   `json:"answerText"`
	PlannedSearches  []string `json:"plannedSearches,omitempty"`
	Cost             float64  `json:"cost"`
	AnswerDurationMS int64    `json:"answerDurationMS"`
}

ScenarioAnswerReport is one answer and its grade.

type ScenarioClaim added in v0.94.0

type ScenarioClaim struct {
	Path  string   `json:"path,omitempty"`
	Words []string `json:"words"`
}

ScenarioClaim is a statement recall has to carry, or must not: every word in one fact, on the page named or under it.

type ScenarioClaimLayers added in v0.94.0

type ScenarioClaimLayers struct {
	Claim       string         `json:"claim"`
	LayerCounts map[string]int `json:"layerCounts"`
}

ScenarioClaimLayers is where one claim is said.

type ScenarioEvidenceReport added in v0.104.3

type ScenarioEvidenceReport struct {
	// NamedEvidence is what the question says supports the answer.
	NamedEvidence []string `json:"namedEvidence"`

	// CitedEvidence is the inputs the supporting facts rest on, each once.
	CitedEvidence []string `json:"citedEvidence"`

	// MissingEvidence is what was named and no supporting fact rests on.
	MissingEvidence []string `json:"missingEvidence,omitempty"`

	// SupportingFactCount is how many carried facts say an expected claim,
	// and IndependentSourceCount how many inputs they rest on: when the
	// first is larger, facts repeat one another rather than confirm.
	SupportingFactCount    int `json:"supportingFactCount"`
	IndependentSourceCount int `json:"independentSourceCount"`

	// UnsourcedFactCount is how many supporting facts lead back to no
	// input at all: derived from nothing that can be found, or carrying no
	// evidence.
	UnsourcedFactCount int `json:"unsourcedFactCount"`

	// IsEvidenceTraced is whether every named input is among the cited.
	IsEvidenceTraced bool `json:"isEvidenceTraced"`
}

ScenarioEvidenceReport is where the facts behind a question's expected answer came from.

type ScenarioGraphCounts added in v0.94.0

type ScenarioGraphCounts struct {
	DocumentCount int `json:"documentCount"`
	PageCount     int `json:"pageCount"`
	FactCount     int `json:"factCount"`
	OverviewCount int `json:"overviewCount"`

	// SupersededFactCount is how many facts a later one corrected or
	// replaced: the corrections the run has made so far.
	SupersededFactCount int `json:"supersededFactCount"`
}

ScenarioGraphCounts is how big the graph is.

type ScenarioMessage added in v0.94.0

type ScenarioMessage struct {
	Role       string              `json:"role"`
	Content    string              `json:"content,omitempty"`
	ToolCalls  []*ScenarioToolCall `json:"toolCalls,omitempty"`
	ToolCallID string              `json:"toolCallId,omitempty"`
	ToolName   string              `json:"toolName,omitempty"`
}

ScenarioMessage is one message of a conversation. A tool message's content is the tool's result as the tool returned it; it is fenced as a turn fences it before it is stored.

type ScenarioQuestion added in v0.94.0

type ScenarioQuestion struct {
	ID             string           `json:"id"`
	Question       string           `json:"question"`
	QuestionKind   string           `json:"kind"`
	Expects        []*ScenarioClaim `json:"expects"`
	Forbids        []*ScenarioClaim `json:"forbids"`
	ExpectedAnswer string           `json:"expectedAnswer"`
	OutdatedAnswer string           `json:"outdatedAnswer,omitempty"`

	// OutdatedClaims are statements that were true once and are not
	// now. Recall may carry them, as history; they are looked for in
	// every layer, to see where what is no longer true still stands as
	// current.
	OutdatedClaims []*ScenarioClaim `json:"outdatedClaims,omitempty"`

	// Evidence is the inputs the expected answer rests on: a record by its
	// id, a message as "<step id>#<number>" counting from one, or a whole
	// conversation step by its id. scenario_evidence.go follows the facts
	// behind an answer back to them.
	Evidence []string `json:"evidence,omitempty"`
}

ScenarioQuestion is a question of the evaluation question set's shape. A claim with no path is met by any page.

type ScenarioQuestionReport added in v0.94.0

type ScenarioQuestionReport struct {
	ID string `json:"id"`

	// IsRecallHit is whether recall carried every expected claim and no
	// forbidden one; RecallFailure names the first that was not met.
	IsRecallHit   bool   `json:"isRecallHit"`
	RecallFailure string `json:"recallFailure,omitempty"`

	Answers []*ScenarioAnswerReport `json:"answers,omitempty"`

	// ShownLessons are the lessons a turn asking the question is shown.
	ShownLessons []string `json:"shownLessons,omitempty"`

	// ExpectedLayers and OutdatedLayers say, for each claim, in which
	// layer of the graph it is said and how many times: whether an
	// expected statement was ever learned, and where an outdated one
	// still stands.
	ExpectedLayers []*ScenarioClaimLayers `json:"expectedLayers"`
	OutdatedLayers []*ScenarioClaimLayers `json:"outdatedLayers"`

	// Evidence is where the carried facts that say an expected claim came
	// from, for a question with expected claims.
	Evidence *ScenarioEvidenceReport `json:"evidence,omitempty"`
}

ScenarioQuestionReport is one question at one checkpoint.

type ScenarioReport added in v0.94.0

type ScenarioReport struct {
	Scenario    string                `json:"scenario"`
	Database    string                `json:"database,omitempty"`
	StartedAt   time.Time             `json:"startedAt"`
	FinishedAt  time.Time             `json:"finishedAt"`
	Models      map[string]string     `json:"models"`
	Steps       []*ScenarioStepReport `json:"steps"`
	TotalCost   float64               `json:"totalCost"`
	IsStopped   bool                  `json:"isStopped"`
	StoppedWhy  string                `json:"stoppedWhy,omitempty"`
	GraphCounts *ScenarioGraphCounts  `json:"graphCounts,omitempty"`
}

ScenarioReport is what a run found.

func RunScenario added in v0.94.0

func RunScenario(ctx context.Context, settings *ScenarioSettings) (*ScenarioReport, error)

RunScenario runs a scenario from the start and reports on it.

type ScenarioSettings added in v0.94.0

type ScenarioSettings struct {
	Database      db.Database
	Storage       storage.Storage
	Configuration *config.Configuration
	Scenario      *Scenario

	// RecordsDirectory is where the records are written for the reader,
	// one file a step, as a records source's folder holds them.
	RecordsDirectory string

	// AnswerSources are what each question is answered from: memory,
	// sources, both, memory@planned, both@planned. None asks recall
	// alone, which costs nothing.
	AnswerSources []string

	// BudgetDollars stops the run between steps once what it recorded as
	// spent passes it; zero is no limit.
	BudgetDollars float64

	Progress io.Writer

	// KeepRefreshTokens is handed a signed-in provider's refresh token
	// each time the service rotates it, so a run's own sign-in is written
	// back and still works for the next run.
	KeepRefreshTokens func(provider, refreshToken string)
}

ScenarioSettings is what a run needs. The database is the run's own: RunScenario makes the person, the agent and the records source in it.

type ScenarioStep added in v0.94.0

type ScenarioStep struct {
	ID       string `json:"id"`
	StepKind string `json:"stepKind"`

	// Records are lines in the shape a records source reads: id, kind,
	// at, author, title, text, and for chat channel and thread.
	Records []json.RawMessage `json:"records,omitempty"`

	// DreamCount is how many dreams to run one after another; more than
	// one with nothing new filed shows what repeating maintenance does.
	DreamCount int `json:"dreamCount,omitempty"`

	// IsUntilRead runs dreams until nothing is waiting to be read, as a
	// server's later dreams would, at most scenarioDreamsUntilRead of
	// them: a call the model did not answer leaves its documents for the
	// next dream, and one dream would measure that call rather than the
	// memory.
	IsUntilRead bool `json:"isUntilRead,omitempty"`

	Questions []*ScenarioQuestion `json:"questions,omitempty"`

	// Messages are a conversation of the agent's own, filed as one and
	// remembered the way a finished conversation is: what it learned,
	// and the lessons its commands bore out.
	Messages []*ScenarioMessage `json:"messages,omitempty"`
}

ScenarioStep is one step: records to file, dreams to run, or questions to ask.

type ScenarioStepReport added in v0.94.0

type ScenarioStepReport struct {
	ID          string                    `json:"id"`
	StepKind    string                    `json:"stepKind"`
	DurationMS  int64                     `json:"durationMS"`
	Cost        float64                   `json:"cost"`
	FiledCount  int                       `json:"filedCount,omitempty"`
	GraphCounts *ScenarioGraphCounts      `json:"graphCounts,omitempty"`
	Questions   []*ScenarioQuestionReport `json:"questions,omitempty"`
}

ScenarioStepReport is one step: what it cost and, for a checkpoint, how each question did.

func AskScenarioAgain added in v0.95.0

func AskScenarioAgain(ctx context.Context, settings *ScenarioSettings) (*ScenarioStepReport, error)

AskScenarioAgain asks a scenario's last checkpoint again, of the graph a run left in its database, with the configuration given: what a change to recall or answering does to the same memory, without reading the history again. Only the last checkpoint, because the graph is as it was at the end of the run.

type ScenarioToolCall added in v0.94.0

type ScenarioToolCall struct {
	ID        string `json:"id"`
	ToolName  string `json:"toolName"`
	Arguments string `json:"arguments"`
}

ScenarioToolCall is a call an assistant message makes.

type Settings

type Settings struct {
	Database db.Database
	Storage  storage.Storage
	Registry *llm.Registry

	// Exchange runs the rules that wait for an insight, and climbs the
	// out-of-office ladder for the agent. Nil in tests that have no mail
	// path.
	Exchange mx.Exchange

	// Mailer composes and sends what the agent writes. Set after the
	// mailer exists, which is after the worker does; nil until then.
	Mailer mailer.Mailer

	// Configuration is read at the start of every tick, so an operator's
	// change to a limit or a feature applies without a restart.
	Configuration func() *config.Configuration

	// UpdateConfiguration changes the stored configuration, as the
	// configuration store's Update does. The daily check of model prices
	// against the provider's bill sets prices through it. Nil in tests
	// that never change a price, which then cannot.
	UpdateConfiguration func(change func(*config.Configuration) error) error

	// Instance names this server instance on the jobs it claims.
	Instance string

	// Presence is who has a dashboard or the app open. The server hands the
	// same one to the chat hub, which has no agent to ask; nil makes the
	// agent its own, as tests do.
	Presence *Presence

	// Phones sends a notification to a person's phones. The server hands the
	// chat hub the same one; nil makes the agent its own, as tests do.
	Phones *PhoneNotifier

	// ChatEvents is where the events of a chat go when the agent has one to
	// tell: its answer posted in a chat, its typing. It is the chat hub,
	// which exists whether or not an agent does. Nil in tests that have no
	// chats.
	ChatEvents ChatPublisher

	// CallRecorder keeps the microphones of the people on a call who agreed
	// to its transcript, on the instance whose media server holds the call;
	// nil when calls are off.
	CallRecorder *call.Recorder

	// Tick is how often the worker looks for work. Zero means five seconds.
	Tick time.Duration
}

Settings is what the agent needs.

type SharedCall added in v0.170.0

type SharedCall struct {
	ShareID  string
	ToolName string

	// Arguments are what the agent called the tool with, without the reason.
	Arguments map[string]any

	// RequestReason is the agent's own words for why, kept for the owner.
	RequestReason string

	// GranteeUserID is the person whose agent called: it must be the one the
	// share is to.
	GranteeUserID string

	// GranteeConversationID is the conversation of the turn that called,
	// which is woken when a call that waited is answered.
	GranteeConversationID string
}

SharedCall is one call of a shared tool, as the other person's agent made it.

type SharedOutcome added in v0.170.0

type SharedOutcome struct {
	Call *models.SkillShareCall

	// Answer is what the owner's skill answered, for a call that ran.
	Answer map[string]any

	// OutcomeText says in words what happened and what to do next.
	OutcomeText string
}

SharedOutcome is what a call came to, for the agent that made it.

type SpendingCategoryMonthInput added in v0.87.0

type SpendingCategoryMonthInput struct {
	// BudgetAmount is the month's budget.
	BudgetAmount *big.Rat

	// SpendingByDay is each day's spending so far, the first of the month
	// first, up to and including today. A day of refunds may be negative.
	SpendingByDay []*big.Rat

	// FixedChargesDueAmount is what merchants that charged this spending
	// category in each of the last three full months are expected to
	// charge again and have not yet this month, at their median amounts.
	// FixedChargesSeenAmount is what those merchants have charged this
	// month already, which is in SpendingByDay and is left out of the
	// rate the rest of the month is projected at.
	FixedChargesDueAmount  *big.Rat
	FixedChargesSeenAmount *big.Rat

	// DayOfMonth is today, from one; DaysInMonth how many days the month
	// has.
	DayOfMonth  int
	DaysInMonth int
}

SpendingCategoryMonthInput is what ProjectSpendingCategoryMonth reads, every amount already in the budget's currency.

type SpendingCategoryMonthProjection added in v0.87.0

type SpendingCategoryMonthProjection struct {
	SpendingAmount  *big.Rat
	ProjectedAmount *big.Rat
	BudgetPace      models.BudgetPace
}

SpendingCategoryMonthProjection is where a spending category's month is heading.

func ProjectSpendingCategoryMonth added in v0.87.0

func ProjectSpendingCategoryMonth(input *SpendingCategoryMonthInput) *SpendingCategoryMonthProjection

ProjectSpendingCategoryMonth projects a spending category's month end: the spending so far, plus the fixed charges expected and not yet seen, plus the rest of the spending (what is not a fixed charge) at the rate it has come so far, for the days left.

The pace is over once spending passes the budget; at_risk after the first week when the projection passes the budget by more than ten percent; under when the projection stays below ninety percent of it; on_track otherwise, which includes a first week that looks hot.

type SpendingCategoryYearInput added in v0.104.0

type SpendingCategoryYearInput struct {
	Months []*SpendingCategoryYearMonth

	// IsYearOver says the day computed for is past the year's last.
	IsYearOver bool
}

SpendingCategoryYearInput is what ProjectSpendingCategoryYear reads: the months of the year that had a budget, whichever they were.

type SpendingCategoryYearMonth added in v0.104.0

type SpendingCategoryYearMonth struct {
	BudgetMonthPhase BudgetMonthPhase

	// BudgetAmount is the month's budget as it was in force that month.
	BudgetAmount *big.Rat

	// SpendingAmount is the month's spending, so far for the month in
	// progress; nil for a month to come.
	SpendingAmount *big.Rat

	// ProjectedAmount and BudgetToDateAmount are the month in progress's
	// projection (ProjectSpendingCategoryMonth) and its budget over the
	// days so far, and DayOfMonth is its today, from one; ignored for the
	// other phases.
	ProjectedAmount    *big.Rat
	BudgetToDateAmount *big.Rat
	DayOfMonth         int
}

SpendingCategoryYearMonth is one month of a year in which a spending category had a budget, every amount in the year's currency.

type SpendingCategoryYearProjection added in v0.104.0

type SpendingCategoryYearProjection struct {
	BudgetAmount       *big.Rat
	BudgetToDateAmount *big.Rat
	SpendingAmount     *big.Rat
	ProjectedAmount    *big.Rat
	BudgetedMonthCount int
	BudgetPace         models.BudgetPace
}

SpendingCategoryYearProjection is where a spending category's year is heading against the budgets of its months.

func ProjectSpendingCategoryYear added in v0.104.0

func ProjectSpendingCategoryYear(input *SpendingCategoryYearInput) *SpendingCategoryYearProjection

ProjectSpendingCategoryYear adds up a spending category's budgeted months and projects the year's end. The budget is each month's budget as it was in force that month, so a budget changed or ended part way through the year counts each month at what it was then, and the spending is that of the months that had a budget.

The projection is built from the monthly ones where they exist: a month that is over as it ended, the month in progress as it is projected (repeat charges and its pace counted), and each budgeted month still to come at the average of those, which is the year carried on the way it has gone. With no month begun there is nothing to carry on, and a month to come counts at its budget. In its first week the month in progress counts at its budget, or at its spending when that is more already: its straight line is noise then (one dinner on the first projects a month of dinners), and carried on it would be repeated for every month to come.

The pace is a month's thresholds over the year: over once spending passes the year's budget; at_risk, after the first week of the first budgeted month to begin, when the projection passes it by more than ten percent; under below ninety percent of it; on_track otherwise.

type StatementFile added in v0.100.0

type StatementFile struct {
	StatementFileName string
	Content           []byte

	// IsTooLarge says the file was over ofx.MaximumFileBytes and Content
	// holds only its start.
	IsTooLarge bool
}

StatementFile is one OFX file to import, as it was named.

func StatementFilesOf added in v0.100.0

func StatementFilesOf(headers []string, body []byte) []*StatementFile

StatementFilesOf are the OFX files a message carries: every part named .ofx, .qfx or .qbo, and every part whose content is OFX whatever it is called or typed, since a phone sends a statement as application/octet-stream and some programs paste it into the body. A part is decoded and read; nothing in it is run or shown.

type SummarizeInput

type SummarizeInput struct {
	Configuration *config.Configuration
	Agent         *models.Agent
	Owner         *models.User
	Mailbox       *models.Mailbox
	Source        *models.AgentMailbox
	Subject       string

	// Previous is the summary so far, empty the first time; Messages are
	// the ones it does not cover, oldest first.
	Previous string
	Messages []*MessageContext
	Memories []string
}

SummarizeInput is everything the summarize prompt is built from.

type SupersededFact

type SupersededFact struct {
	Path   string `json:"path"`
	Number int    `json:"number"`

	// ReplacedBy is which of this answer's facts replaces it, counting
	// from 1. Without it, any fact the answer filed on the page stood in
	// for the line being retired, whatever it said: a fact about something
	// else retired a true one. Nil for a retraction, which carries a quote
	// instead.
	ReplacedBy *int `json:"replaced_by"`

	// Quote and MessageID are what says the line is no longer true, for a
	// retirement that files nothing in its place.
	//
	// "I go to a different dentist now" retires what the page says about
	// the dentist without saying who the new one is, and that is a real
	// thing for somebody to say. What it cannot be is a retirement nobody
	// said: without these, an answer naming a fact retired it on the
	// strength of naming it, and an answer carrying nothing else could
	// empty a page. Checked exactly as a fact's citation is -- the words
	// have to occur in something the run was actually shown.
	Quote     string `json:"quote"`
	MessageID string `json:"message_id"`
}

SupersededFact is a fact this conversation has replaced.

type SurveyReport added in v0.79.0

type SurveyReport struct {
	// Report is the combined answer in markdown, ending with the pages
	// it covered and any that failed.
	Report string

	// CoveredPaths is the pages whose run answered, and FailedPaths the
	// ones whose run did not: an error, or out of time.
	CoveredPaths []string
	FailedPaths  []string

	// EligiblePageCount is how many pages in scope had an overview to ask,
	// and all of them were asked; WithoutOverviewPageCount how many pages
	// in scope had no overview yet and were not asked.
	EligiblePageCount        int
	WithoutOverviewPageCount int

	// RunIDs is every run the survey made, each a transcript the person
	// can open: one per page, and the one that combined them.
	RunIDs []string
}

SurveyReport is what a survey answers with.

type TabConnection

type TabConnection = DeviceConnection

TabConnection is what the relay needs of the extension's websocket.

type TabInputMessage added in v0.189.0

type TabInputMessage struct {
	Type       string  `json:"type"`
	Tab        int64   `json:"tab"`
	Event      string  `json:"event,omitempty"`
	X          float64 `json:"x"`
	Y          float64 `json:"y"`
	Button     string  `json:"button,omitempty"`
	ClickCount int     `json:"clickCount,omitempty"`
	Modifiers  int     `json:"modifiers,omitempty"`
	DeltaX     float64 `json:"deltaX,omitempty"`
	DeltaY     float64 `json:"deltaY,omitempty"`
	Key        string  `json:"key,omitempty"`
	Code       string  `json:"code,omitempty"`
	KeyCode    int     `json:"keyCode,omitempty"`
	Text       string  `json:"text,omitempty"`
}

TabInputMessage is what the person does in the tab they took over: a pointer moving or pressed, the wheel, a key, or text, as the DevTools protocol takes them. Read field by field and written again, so nothing but these reaches the extension.

type TabListing added in v0.189.0

type TabListing struct {
	Tab       string `json:"tab"`
	Title     string `json:"title"`
	URL       string `json:"url"`
	IsOwn     bool   `json:"isOwn"`
	IsCurrent bool   `json:"isCurrent"`
}

TabListing is one tab the agent may act in, as the extension reports it.

type TabViewer added in v0.189.0

type TabViewer interface {
	// Send writes a message the viewer must not miss: a refusal, a reply.
	Send(message []byte) error
	// SendState writes how things stand. A state the viewer has not been
	// sent yet is replaced by a newer one: only the latest matters.
	SendState(message []byte)
	// SendFrame writes a picture of the tab. A picture the viewer has not
	// been sent yet is replaced by a newer one rather than queued behind
	// it, so a slow viewer sees the tab as it is now, not as it was.
	SendFrame(message []byte)
}

TabViewer is one live view of the person's browser: the dashboard page.

type Tool

type Tool = tools.Tool

type TriageAnswer

type TriageAnswer struct {
	Category    string   `json:"category"`
	Priority    string   `json:"priority"`
	NeedsReply  bool     `json:"needs_reply"`
	Research    bool     `json:"research"`
	Extract     bool     `json:"extract"`
	Summary     string   `json:"summary"`
	ActionItems []string `json:"action_items"`
	AlertSignal string   `json:"alert_signal"`
	AlertReason string   `json:"alert_reason"`
}

TriageAnswer is the JSON the model is asked for.

type TriageInput

type TriageInput struct {
	Configuration *config.Configuration
	Agent         *models.Agent
	Owner         *models.User
	Mailbox       *models.Mailbox
	Source        *models.AgentMailbox
	Message       *MessageContext
	Memories      []string

	// ComingUp is what is on their calendar, ready for the prompt, and
	// Remembered what memory holds about this message. Both say whether a
	// charge or a sign-in is something they did.
	ComingUp   string
	Remembered []string

	Corrections   []string
	ResearchNotes []string

	// Tools says the run may look things up before it answers, which
	// changes what the prompt asks for: the same object, after as many
	// lookups as it needs.
	Tools bool
}

TriageInput is everything the prompt is built from, so the prompt can be rendered and tested without a database.

type Viewing

type Viewing struct {
	ItemID      string `json:"itemId,omitempty" graphapi:"nullable"`
	ThreadID    string `json:"threadId,omitempty" graphapi:"nullable"`
	Subject     string `json:"subject,omitempty" graphapi:"nullable"`
	MailboxID   string `json:"mailboxId,omitempty" graphapi:"nullable"`
	MailboxName string `json:"mailboxName,omitempty" graphapi:"nullable"`
	FolderID    string `json:"folderId,omitempty" graphapi:"nullable"`
	FolderName  string `json:"folderName,omitempty" graphapi:"nullable"`
	Page        string `json:"page,omitempty" graphapi:"nullable"`

	// ListKey and ListName are the mailing list open on the subscriptions
	// page, which the subscription tool acts on by key.
	ListKey  string `json:"listKey,omitempty" graphapi:"nullable"`
	ListName string `json:"listName,omitempty" graphapi:"nullable"`
}

Viewing is what the person has open in the dashboard.

Source Files

Directories

Path Synopsis
Package feedback records corrections for subsequent agent work.
Package feedback records corrections for subsequent agent work.
Package indexed is searching and reading what a person's sources put in front of their agent: the documents a pass read, and the passages they were cut into.
Package indexed is searching and reading what a person's sources put in front of their agent: the documents a pass read, and the passages they were cut into.
Package privateturn says which turns of a conversation are private: the ones in which a private tool was called.
Package privateturn says which turns of a conversation are private: the ones in which a private tool was called.
Package reading is how far the night has got through what was indexed: one measure that the API, the command line and the knowledge tool share, in a package of its own because the tool cannot import the agent.
Package reading is how far the night has got through what was indexed: one measure that the API, the command line and the knowledge tool share, in a package of its own because the tool cannot import the agent.
Package tools is the agent's tool kit: what a tool is, what a call and a result are, the catalog with its permissions and policy, and the registry every tool package registers into from its own init.
Package tools is the agent's tool kit: what a tool is, what a call and a result are, the catalog with its permissions and policy, and the registry every tool package registers into from its own init.
account
Package account is the person's own account: profile, tokens, sessions, app passwords, and what their permissions let them do.
Package account is the person's own account: profile, tokens, sessions, app passwords, and what their permissions let them do.
agentprofile
Package agentprofile is the agent's own profile, as the person tells it in conversation: what it is called, which language it talks in, and the lines the person wants added to its standing instructions.
Package agentprofile is the agent's own profile, as the person tells it in conversation: what it is called, which language it talks in, and the lines the person wants added to its standing instructions.
all
Package all imports every tool package, so that importing it is importing the catalog.
Package all imports every tool package, so that importing it is importing the catalog.
artifact
Package artifact is what the agent makes for the person to open beside the conversation: a page, a drawing or a document it wrote, kept as a file of the conversation, served to its owner alone and in a sandbox.
Package artifact is what the agent makes for the person to open beside the conversation: a page, a drawing or a document it wrote, kept as a file of the conversation, served to its owner alone and in a sandbox.
askuser
Package askuser is the question to the person, for when the answer changes what happens.
Package askuser is the question to the person, for when the answer changes what happens.
browser
Package browser is the agent's browser: a page in the operator's headless Chrome, signed in as nobody, read as a tree with [ref=N] on everything that can be acted on; or, with target tab, the person's own attached tab, with their session, while they watch.
Package browser is the agent's browser: a page in the operator's headless Chrome, signed in as nobody, read as a tree with [ref=N] on everything that can be acted on; or, with target tab, the person's own attached tab, with their session, while they watch.
calendar
Package calendar is what the agent knows about its person's diary: what they have on, when they are free, and -- asking first -- putting something in.
Package calendar is what the agent knows about its person's diary: what they have on, when they are free, and -- asking first -- putting something in.
circle
Package circle is what the agent knows about its person's circles: the family, friends or colleagues on this server they belong to, who else is in them, and the invitations to join one.
Package circle is what the agent knows about its person's circles: the family, friends or colleagues on this server they belong to, who else is in them, and the invitations to join one.
coding
Package coding hands a piece of work to a coding agent on the person's own computer.
Package coding hands a piece of work to a coding agent on the person's own computer.
computer
Package computer is the person's own computer, when they attached one with `teanode computer`: a shell to run a command in, and its files to read, write, list and search, as the person, anywhere on it.
Package computer is the person's own computer, when they attached one with `teanode computer`: a shell to run a command in, and its files to read, write, list and search, as the person, anywhere on it.
connected
Package connected is the tool for the servers that speak the Model Context Protocol: what the operator has declared, what this person has connected, and the two steps of setting one up.
Package connected is the tool for the servers that speak the Model Context Protocol: what the operator has declared, what this person has connected, and the two steps of setting one up.
contact
Package contact is the person's address book: the people they keep.
Package contact is the person's address book: the people they keep.
conversation
Package conversation is how the agent reaches what was said before: the other conversations this person has with it, and the transcripts of the runs nobody watched.
Package conversation is how the agent reaches what was said before: the other conversations this person has with it, and the transcripts of the runs nobody watched.
datetime
Package datetime is the agent's time arithmetic: now, a conversion between zones, a duration added, the difference between two times, a phrase such as "next Tuesday 3pm" read in the person's zone.
Package datetime is the agent's time arithmetic: now, a conversion between zones, a duration added, the difference between two times, a phrase such as "next Tuesday 3pm" read in the person's zone.
domain
Package domain is the operator's domains and their delivery: domains, addresses, sending credentials, the queue.
Package domain is the operator's domains and their delivery: domains, addresses, sending credentials, the queue.
feed
Package feed is the agent's feed: the cards it posts to the person for what they did not ask, each a headline, a few lines, sometimes a table of facts and buttons they answer with a tap.
Package feed is the agent's feed: the cards it posts to the person for what they did not ask, each a headline, a few lines, sometimes a table of facts and buttons they answer with a tap.
finance
Package finance is the person's money as the agent reads and keeps it for them: their finance sources (logins at banks, card issuers, brokerages and lenders, linked through a provider), finance accounts, transactions and trades, exchange rates, net worth, spending categories and rules, budgets and savings targets.
Package finance is the person's money as the agent reads and keeps it for them: their finance sources (logins at banks, card issuers, brokerages and lenders, linked through a provider), finance accounts, transactions and trades, exchange rates, net worth, spending categories and rules, budgets and savings targets.
folder
Package folder lists and manages a mailbox's folders.
Package folder lists and manages a mailbox's folders.
goal
Package goal is the conversation's standing instruction: the sentence the agent keeps working toward across turns of its own, and the one tool that says where it is with it.
Package goal is the conversation's standing instruction: the sentence the agent keeps working toward across turns of its own, and the one tool that says where it is with it.
health
Package health is what the agent knows about the person's Apple Health data: the kinds of data they have, their days, weeks and months added up, and, for a question about particular readings, the readings themselves.
Package health is what the agent knows about the person's Apple Health data: the kinds of data they have, their days, weeks and months added up, and, for a question about particular readings, the readings themselves.
idea
Package idea is the agent's list of ideas for the person, as the agent manages it in conversation: what is on offer, one it found for them, one they took up, finished or do not want.
Package idea is the agent's list of ideas for the person, as the agent manages it in conversation: what is on offer, one it found for them, one they took up, finished or do not want.
journal
Package journal is what the agent can do with the person's journal: read a day, a week, a month or a year of it, list and search its days, and, in a conversation the person started or for a program they connected over MCP, add to their words, set their mood, ask for their words to be touched up, tell a narrative what is wrong with it, and pin a record to a day.
Package journal is what the agent can do with the person's journal: read a day, a week, a month or a year of it, list and search its days, and, in a conversation the person started or for a program they connected over MCP, add to their words, set their mood, ask for their words to be touched up, tell a narrative what is wrong with it, and pin a record to a day.
knowledge
Package knowledge is the tool for what the person pointed their agent at: their checkout, their chat archive, their notes, their wiki.
Package knowledge is the tool for what the person pointed their agent at: their checkout, their chat archive, their notes, their wiki.
location
Package location is what the agent knows about where its person is and where they have been: where they are now, the places they go and when they were there, the places OpenStreetMap knows near them, keeping places and check-ins, and sharing where they are with the people in their circles.
Package location is what the agent knows about where its person is and where they have been: where they are now, the places they go and when they were there, the places OpenStreetMap knows near them, keeping places and check-ins, and sharing where they are with the people in their circles.
mailact
Package mailact acts on messages: marks, stars, files, junks, trashes.
Package mailact acts on messages: marks, stars, files, junks, trashes.
mailaudit
Package mailaudit is the mail audit as tools: search, one message, its content, marks, and the reports.
Package mailaudit is the mail audit as tools: search, one message, its content, marks, and the reports.
mailbox
Package mailbox is what the mailbox tools share: the person's mailboxes and folders as the API lists them, a conversation and a message's content as the tools read them.
Package mailbox is what the mailbox tools share: the person's mailboxes and folders as the API lists them, a conversation and a message's content as the tools read them.
mailboxsettings
Package mailboxsettings renames a mailbox or sets its signature.
Package mailboxsettings renames a mailbox or sets its signature.
mailcomposehelp
Package mailcomposehelp writes the body of a reply for the person to use, without saving anything.
Package mailcomposehelp writes the body of a reply for the person to use, without saving anything.
maildraft
Package maildraft writes a draft into Drafts for the person to send.
Package maildraft writes a draft into Drafts for the person to send.
mailread
Package mailread reads a message, or the conversation it belongs to, as text the model can weigh.
Package mailread reads a message, or the conversation it belongs to, as text the model can weigh.
mailsearch
Package mailsearch finds messages by words, by meaning where it exists, and by what the agent decided about them.
Package mailsearch finds messages by words, by meaning where it exists, and by what the agent decided about them.
mailsend
Package mailsend sends a draft, with the person's word.
Package mailsend sends a draft, with the person's word.
memory
Package memory is the tool the agent keeps what it knows about the person with: a graph of pages, each addressed by a path, with facts on them and links between them.
Package memory is the tool the agent keeps what it knows about the person with: a graph of pages, each addressed by a path, with facts on them and links between them.
memorycheck
Package memorycheck is the memory check as the agent runs it in conversation: drafting questions from what it remembers about the person, putting them one at a time, and recording what the person says.
Package memorycheck is the memory check as the agent runs it in conversation: drafting questions from what it remembers about the person, putting them one at a time, and recording what the person says.
note
Package note is the person's notes, as the agent keeps them for them: the ones their phone's Notes app keeps in their mailbox.
Package note is the person's notes, as the agent keeps them for them: the ones their phone's Notes app keeps in their mailbox.
openpage
Package openpage moves the dashboard the person is reading the agent in to a page of itself: a page of the agent's memory, a message, a settings tab.
Package openpage moves the dashboard the person is reading the agent in to a page of itself: a page of the agent's memory, a message, a settings tab.
operator
Package operator is what the operator's tools share: a document run as the person with its answer as a map, and the domains the person manages as the API lists them.
Package operator is what the operator's tools share: a document run as the person with its answer as a map, and the domains the person manages as the API lists them.
passwords
Package passwords is what the agent may do with the person's Passwords: see which items they let it use, read a note they let it use, and make up a new password.
Package passwords is what the agent may do with the person's Passwords: see which items they let it use, read a note they let it use, and make up a new password.
people
Package people is the operator's people and access: accounts, groups, roles, and the audit log.
Package people is the operator's people and access: accounts, groups, roles, and the audit log.
phone
Package phone is the person's phones running the TeaNode app, for the agent: which there are and whether notifications reach them, naming them, choosing what each is told, a test notification, and removing one.
Package phone is the person's phones running the TeaNode app, for the agent: which there are and whether notifications reach them, naming them, choosing what each is told, a test notification, and removing one.
photo
Package photo is the person's library of photos and videos, as the agent sees it: finding photos by date, place, camera and file name, looking at them (which also gets them described, so that a later search finds them by what is in them), showing them to the person in the conversation, marking favorites, moving them to the Trash and deleting them from it for good, correcting the date and the place a photo was taken, keeping a picture from a conversation, a message or the person's computer, and organizing photos into albums.
Package photo is the person's library of photos and videos, as the agent sees it: finding photos by date, place, camera and file name, looking at them (which also gets them described, so that a later search finds them by what is in them), showing them to the person in the conversation, marking favorites, moving them to the Trash and deleting them from it for good, correcting the date and the place a photo was taken, keeping a picture from a conversation, a message or the person's computer, and organizing photos into albums.
recording
Package recording exposes account-owned passive evidence through the API.
Package recording exposes account-owned passive evidence through the API.
reminder
Package reminder is the person's reminders list, as the agent keeps it for them: the list beside their calendar that their phone's Reminders app syncs.
Package reminder is the person's reminders list, as the agent keeps it for them: the list beside their calendar that their phone's Reminders app syncs.
replyqueue
Package replyqueue is the replies the agent holds on the person's behalf, and the <pending> overlay that lists them.
Package replyqueue is the replies the agent holds on the person's behalf, and the <pending> overlay that lists them.
resultmore
Package resultmore reads on in a tool's result that was too long for one answer.
Package resultmore reads on in a tool's result that was too long for one answer.
rule
Package rule is the mailbox's rules as tools: listed, added, changed, removed, tried and applied.
Package rule is the mailbox's rules as tools: listed, added, changed, removed, tried and applied.
searcheverything
Package searcheverything is the agent's search tool: the person's words looked for across their chats, mail, contacts, photos, memory, documents, recordings, places and finance at once.
Package searcheverything is the agent's search tool: the person's words looked for across their chats, mail, contacts, photos, memory, documents, recordings, places and finance at once.
server
Package server is the server itself: its status, its settings, an upgrade.
Package server is the server itself: its status, its settings, an upgrade.
share
Package share is how the agent hands the person a file: the photo on a message, a file from their computer, something already in the conversation.
Package share is how the agent hands the person a file: the photo on a message, a file from their computer, something already in the conversation.
shopping
Package shopping is the person's shopping lists as the agent sees them: named lists of things to buy, shared with the people and circles the person chooses, checked off live at the store, matched to receipts and remembered with their prices.
Package shopping is the person's shopping lists as the agent sees them: named lists of things to buy, shared with the people and circles the person chooses, checked off live at the store, matched to receipts and remembered with their prices.
subscription
Package subscription is the mailing lists a mailbox receives and the ways out of each.
Package subscription is the mailing lists a mailbox receives and the ways out of each.
todo
Package todo is a conversation's task list: the agent's own, laid out when a piece of work has several steps and kept as it goes, so the agent keeps its place and the person watches its progress.
Package todo is a conversation's task list: the agent's own, laid out when a piece of work has several steps and kept as it goes, so the agent keeps its place and the person watches its progress.
toolsearch
Package toolsearch loads tools that are listed but not sent, when the catalog is long: the model names what it wants to do and the matching tools join the request from the next round.
Package toolsearch loads tools that are listed but not sent, when the catalog is long: the model names what it wants to do and the matching tools join the request from the next round.
webfetch
Package webfetch reads a web page as text for the agent: a public one through this server, with the same guarded fetcher the rest of the server uses, or any one through a computer the person attached, on the networks that computer is on.
Package webfetch reads a web page as text for the agent: a public one through this server, with the same guarded fetcher the rest of the server uses, or any one through a computer the person attached, on the networks that computer is on.
websearch
Package websearch asks the search service the operator configured.
Package websearch asks the search service the operator configured.

Jump to

Keyboard shortcuts

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