assist

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 15 Imported by: ? 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 assist is the owner's mail assistant: the agent reads what agents send the owner, answers and routes it in the owner's name, and brings the owner only what needs them.

  • Tools (owner_*) read the owner's mail and act on it from the owner's own addresses. What goes without asking is mechanical (a receipt from a fixed list, a fixed status request); anything in the agent's words asks first. Every send says in its payload that the assistant sent it for the owner.
  • Done for you: everything done in the owner's name is recorded before it is done; what cannot be recorded is not done.
  • The sweep (off until assist.sweep is set) sorts new mail by rule: what needs the owner becomes a card, requests without options become an errand for the agent, the rest is held and counted, and the owner's rules settle what needs nothing.
  • Around: the state of the owner's mail rides with every message.

Ported from Basalisk (internal/assist, internal/agent/owner.go).

Index

Constants

View Source
const (
	ClassNeeds  = "needs"  // asks the owner to decide, or escalates: a card, with its options
	ClassBas    = "bas"    // asks for something without options: an errand for the agent
	ClassDigest = "digest" // tells: held and counted
	ClassSettle = "settle" // the owner's rule says it needs nothing: marked read, on the record
	// ClassAnswer is a reply to something the assistant asked in the owner's name: it goes
	// back to the agent, which asked, not to the owner as new mail.
	ClassAnswer = "answer"
)

Classes of mail.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ask

type Ask struct {
	Kind    string   `json:"kind"`
	Re      string   `json:"re,omitempty"`
	Options []Option `json:"options,omitempty"`
	Default string   `json:"default,omitempty"`
	Due     string   `json:"due,omitempty"`
}

Ask is a typed request: what is wanted and the options offered.

type Entry

type Entry struct {
	ID int64  `json:"id"`
	At string `json:"at"`
	// Kind: ack, status_ask, reply, send, settle, answer (the owner on a card), rule.
	Kind    string         `json:"kind"`
	Summary string         `json:"summary"`
	With    string         `json:"with,omitempty"`
	Ref     string         `json:"ref,omitempty"`
	Asked   bool           `json:"asked"`
	Detail  map[string]any `json:"detail,omitempty"`
}

Entry is one thing done in the owner's name.

type Item

type Item struct {
	ID        string    `json:"id"`
	Account   string    `json:"account"`
	From      string    `json:"from"`
	FromName  string    `json:"from_name,omitempty"`
	FromRole  string    `json:"from_role,omitempty"`
	Kind      string    `json:"kind"`
	Subject   string    `json:"subject"`
	Body      string    `json:"body"`
	At        time.Time `json:"at"`
	Read      bool      `json:"read"`
	Thread    string    `json:"thread,omitempty"`
	InReplyTo string    `json:"in_reply_to,omitempty"`
	// Ask is set when the sender wants an answer from a person, with the options it offered.
	Ask *Ask `json:"asks_the_owner,omitempty"`
}

Item is one message.

type LifecycleEvent

type LifecycleEvent struct {
	ID     string `json:"id"`
	At     string `json:"at"`
	Kind   string `json:"kind"`
	State  string `json:"state,omitempty"`
	Detail string `json:"detail,omitempty"`
	TaskID string `json:"task_id,omitempty"`
}

LifecycleEvent records transport receipts separately from request acknowledgement. Consumed mail is not evidence that work was claimed or completed.

type Mail

type Mail struct {
	ID       string `json:"id"`
	Account  string `json:"account"`
	From     string `json:"from"`
	FromName string `json:"from_name,omitempty"`
	Kind     string `json:"kind"`
	Subject  string `json:"subject"`
	Start    string `json:"start"`
	At       string `json:"at"`
	Class    string `json:"class"`
	Ask      *Ask   `json:"ask,omitempty"`
	// Why says which rule sorted it, when one of the owner's did.
	Why   string `json:"why,omitempty"`
	State string `json:"state"`
	Card  string `json:"card,omitempty"`
}

Mail is a message the sweep sorted.

type Option

type Option struct {
	ID          string `json:"id"`
	Label       string `json:"label"`
	Why         string `json:"why,omitempty"`
	Recommended bool   `json:"recommended,omitempty"`
}

Option is one choice an Ask offers.

type Rule

type Rule struct {
	ID         int64  `json:"id"`
	From       string `json:"from,omitempty"`
	Kind       string `json:"kind,omitempty"`
	SubjectHas string `json:"subject_has,omitempty"`
	Class      string `json:"class"`
	Note       string `json:"note,omitempty"`
}

Rule is one of the owner's: mail that matches goes to Class. Empty fields match anything.

type SentMessage

type SentMessage struct {
	ID       string           `json:"id"`
	Kind     string           `json:"kind"`
	Subject  string           `json:"subject"`
	To       string           `json:"to"`
	Account  string           `json:"account"`
	At       string           `json:"at"`
	TaskID   string           `json:"task_id,omitempty"`
	Delivery string           `json:"delivery"`
	Request  string           `json:"request,omitempty"`
	Alert    string           `json:"alert,omitempty"`
	Events   []LifecycleEvent `json:"events"`
}

Jump to

Keyboard shortcuts

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