Documentation
¶
Overview ¶
Package intent loads intent manifests from the bundled profile and the user's layers into one registry; import it as intentload.
Index ¶
- Constants
- Variables
- func ActionFactMap(get func(name string) any) map[string]any
- func ActionText(funcs template.FuncMap, path, src string, sample map[string]any) (*template.Template, error)
- func BundledGates(bundled fs.FS) (GatesDef, Problems)
- func BundledKeys(bundled fs.FS) (KeyTexts, Problems)
- func BundledTasks(bundled fs.FS) (TasksDef, Problems)
- func BundledViews(bundled fs.FS) (ViewsDef, Problems)
- func ByEnv(d TasksDef) expr.Env
- func CopyFactMap(get func(name string) any) map[string]any
- func DefaultApproval(k gate.Kind, gates GatesDef) workflow.Approval
- func DefaultDraftApproval(gates GatesDef) draft.Approval
- func DraftActionFactMap(get func(name string) any) map[string]any
- func GateFacts(g gate.Gate, delivery string) workflow.Facts
- func HeadlineName(i int) string
- func KeyActions() map[string][]string
- func Load(layers []profile.Layer, bundled fs.FS, base *template.Template, ...) (*Loaded, Problems)
- func LoadIn(locale string, layers []profile.Layer, bundled fs.FS, base *template.Template, ...) (*Loaded, Problems)
- func Locales(layers []profile.Layer, bundled fs.FS) []string
- func NestFacts(env expr.Env, get func(name string) any) map[string]any
- func OverlayDraftApproval(base *draft.Policy, def draft.Approval, o ApprovalOverlay, envs ApprovalEnvs) (draft.Policy, error)
- func OverlayRunApproval(a workflow.Approval, k gate.Kind, o ApprovalOverlay, envs ApprovalEnvs) (workflow.Approval, error)
- func OwedByEnv(d TasksDef) expr.Env
- func ProposalFacts(get func(name string) any) map[string]any
- func RefusalText(i int) string
- func RefuseWhyName(i int) string
- func SampleActionFacts() map[string]any
- func SampleCopyFacts() map[string]any
- func SampleDraftActionFacts() map[string]any
- func StepFacts(get func(name string) any) map[string]any
- func SurvivorEnv(d TasksDef) expr.Env
- func TextFuncs(locale string) template.FuncMap
- func TurnEnv(d dintent.Def) expr.Env
- func ValidRepo(name string) bool
- func ViewEnv(over string, tasks TasksDef) expr.Env
- type ActionPrograms
- type ApprovalEnvs
- type ApprovalOverlay
- type BuiltinAction
- type Cache
- type CacheOptions
- type Decisions
- type DraftWords
- type FacetBucket
- type FacetDef
- type GateApproval
- type GateDef
- type GateIntent
- type GateRule
- type GatesDef
- type HomeCounterDef
- type HomeDef
- type HomeSectionDef
- type KeyTexts
- type KindTexts
- type LensWords
- type Loaded
- func (l *Loaded) BrokenNames() []dintent.Name
- func (l *Loaded) ProfileFile(rel string) (profile.Resolved, error)
- func (l *Loaded) Refusal(name dintent.Name, facts map[string]any) (string, error)
- func (l *Loaded) Rules(intent string) (dintent.RecordRules, error)
- func (l *Loaded) SessionName(name dintent.Name, facts map[string]any) (string, error)
- func (l *Loaded) TargetTitle(name dintent.Name, guidance string) (string, error)
- func (l *Loaded) Tree() (profile.Tree, error)
- func (l *Loaded) Why(name dintent.Name, facts map[string]any) (string, error)
- func (l *Loaded) WorkspaceName(name dintent.Name, facts map[string]any) (string, error)
- type OmniboxDef
- type OmniboxVerbDef
- type Predicates
- type Problem
- type Problems
- type Programs
- type PropDef
- type RecordKind
- type RecordsDef
- type RefusalProgram
- type ReviewStepDef
- type RowWords
- type RuleOverlay
- type SearchGroupDef
- type Shared
- type Show
- type SortKey
- type StateDef
- type TasksDef
- func (d TasksDef) CategoryOf(state string) (task.Category, bool)
- func (d TasksDef) Facts() expr.Env
- func (d TasksDef) FirstOf(c task.Category) string
- func (d TasksDef) Handler(verb string) string
- func (d TasksDef) HeldProblems(held []string) Problems
- func (d TasksDef) Move(verb string) ([]string, string, bool)
- func (d TasksDef) Parse(name, text string, loc *time.Location) (task.Value, error)
- func (d TasksDef) Prop(name string) (PropDef, bool)
- func (d TasksDef) PropOf(r task.Role) (string, []string)
- func (d TasksDef) ShapingVerbs() []string
- func (d TasksDef) Untrusted(name string) bool
- func (d TasksDef) VerbKinds() []string
- type TemplateCheck
- type TimelineDef
- type TimelineEvent
- type TimelineFact
- type ToolText
- type UIDecision
- type UIDraft
- type UIDraftField
- type UIEvent
- type UIFacet
- type UIField
- type UISearch
- type UISearchFilter
- type UISearchPreset
- type UISearchSort
- type UISignal
- type UITexts
- type UIView
- type VerbText
- type ViewDef
- type ViewsDef
Constants ¶
const ( WorkspaceNameName = "workspace.name" TargetTitleName = "target.title" )
WorkspaceNameName and TargetTitleName are the names workspace.name and target.title are parsed under.
const ActionsFile = "actions.toml"
ActionsFile is the profile file that words the built-in actions.
const DecisionsFile = "decisions.toml"
DecisionsFile maps gates, and each plugin's situations and signals, to decision kinds, and words each kind.
const DefaultChanged = "The head moved since the question: re-check what changed before acting on the answer."
DefaultChanged is resume.changed when a manifest leaves it out: the generic sentence of resume.md.tmpl.
const DefaultsFile = "defaults.toml"
DefaultsFile is the profile file of the manifests' defaults, read from the bundled profile and then each layer, a later layer's key winning.
const GatesFile = "gates.toml"
GatesFile is the profile file that declares and words the gates.
const HomeFile = "home.toml"
HomeFile is the profile file of the cockpit's home.
const HomeView = "home"
HomeView is the cockpit's home route, which no view may be named.
const KeysFile = "keys.toml"
KeysFile is the profile file that words the core keys' help.
const NoticesFile = "notices.toml"
NoticesFile is the profile file that words what the loop tells a session.
const OmniboxFile = "omnibox.toml"
OmniboxFile is the profile file of the omnibox: how a search groups its results, and the known verbs.
const PlanView = "plan"
PlanView is the cockpit's plan route, the core's screen of every workflow's plan, which no view may be named; its label is the "Plan" text of strings.toml.
const PredicatesFile = "predicates.toml"
PredicatesFile sets the predicates a plugin's manifest declares, in the plugin's layers.
const RecentView = "recent"
RecentView is the cockpit's recent route, the core's feed of the newest events of every unit the loop follows, which no view may be named; its label is the "Recent" text of strings.toml.
const RecordsFile = "records.toml"
RecordsFile is the profile file that declares the record kinds.
const SessionNameName = "session.name"
SessionNameName is the name session.name is parsed under.
const StringsFile = "strings.toml"
StringsFile holds the texts the clients show, by their English text, and the formats of the Go clients.
const TasksFile = "tasks.toml"
TasksFile is the profile file that declares the task properties and states and words the verbs a task offers.
const TimelineFile = "timeline.toml"
TimelineFile words the core's event kinds and declares the facts a timeline folds its events into.
const ToolsFile = "tools.toml"
ToolsFile is the profile file that describes the MCP tools.
const UIFile = "ui.toml"
UIFile is the file of a plugin's profile layer that words the views, facets, situations and menu bar sections its manifest declares.
const ViewsFile = "views.toml"
ViewsFile is the profile file that declares the views, the review and the badge.
const WhyName = "manifest.why"
The names the manifest's other inline templates are parsed under in an intent's template set.
Variables ¶
var ActionFuncs = template.FuncMap{"join": strings.Join, "replace": func(s, from, to string) string { return strings.ReplaceAll(s, from, to) }, "name": func() string { return brand.Name }, "command": func() string { return brand.Command }}
ActionFuncs are the functions action texts may call.
var ActionsSchema []byte
ActionsSchema is the JSON Schema of actions.toml, for editors.
var ByFacts = []string{"task.id", "task.state", "task.category", "task.unit", "task.unit_provider"}
ByFacts are the facts a verb's by reads besides the task.prop.* of tasks.toml: the task's own, which the authority reads off the task with no facts provider at hand.
var ConfigSchema []byte
ConfigSchema is the JSON Schema of config.toml, for editors.
var DecisionsSchema []byte
DecisionsSchema is the JSON Schema of decisions.toml, for editors.
var GateKinds = slices.DeleteFunc(slices.Clone(gate.Kinds), func(k gate.Kind) bool { return k == gate.KindDraft || k == gate.KindPlan })
GateKinds are the kinds of the gates a workflow's gate.open steps open: every kind but draft and plan, which its drafts and runs are.
var GatesSchema []byte
GatesSchema is the JSON Schema of gates.toml, for editors.
var HomeSchema []byte
HomeSchema is the JSON Schema of home.toml, for editors.
var KeysSchema []byte
KeysSchema is the JSON Schema of keys.toml, for editors.
var NameFuncs = template.FuncMap{"slug": slug, "firstLine": firstLine, "title": title}
NameFuncs are the functions a manifest's names may call: slug, a text as lowercase words joined by dashes; firstLine, its first non-blank line, trimmed; and title n, that line without its markdown heading marks, cut at its last whole word within n runes.
var OmniboxSchema []byte
OmniboxSchema is the JSON Schema of omnibox.toml, for editors.
var OwedFacts = []string{"task.owed_by", "task.owed_since", "task.check_on"}
OwedFacts are the task facts owed_by.expr may not read: those its value makes.
var RecordsSchema []byte
RecordsSchema is the JSON Schema of records.toml, for editors.
var Schema []byte
Schema is the JSON Schema of intent.toml, for editors (Taplo's #:schema directive).
var StringsSchema []byte
StringsSchema is the JSON Schema of strings.toml, for editors.
var TasksSchema []byte
TasksSchema is the JSON Schema of tasks.toml, for editors.
var TimelineSchema []byte
TimelineSchema is the JSON Schema of timeline.toml, for editors.
var ViewsSchema []byte
ViewsSchema is the JSON Schema of views.toml, for editors.
var WorkflowSchema []byte
WorkflowSchema is the JSON Schema of workflow.toml, for editors.
Functions ¶
func ActionFactMap ¶
ActionFactMap nests dotted action facts into the map action texts execute over: {"pr": {"slug": ...}, "row": {"question": ...}}.
func ActionText ¶ added in v0.2.0
func ActionText(funcs template.FuncMap, path, src string, sample map[string]any) (*template.Template, error)
ActionText parses an action text named path with funcs and executes it once over sample, so a text that cannot render fails at load.
func BundledGates ¶ added in v0.3.0
BundledGates is the gates.toml of bundled alone.
func BundledKeys ¶ added in v0.3.0
BundledKeys is the key help of the bundled profile alone.
func BundledTasks ¶ added in v0.3.0
BundledTasks is the bundled profile's tasks.toml alone.
func BundledViews ¶ added in v0.3.0
BundledViews is the views of the bundled profile alone.
func ByEnv ¶ added in v0.3.0
ByEnv is the env a verb's by compiles over: ByFacts and d's properties.
func CopyFactMap ¶ added in v0.5.0
CopyFactMap is ActionFactMap for the copy texts of a built-in action.
func DefaultApproval ¶ added in v0.3.0
DefaultApproval is gates.toml's default for a gate of kind k, a kind but draft, as a run approval.
func DefaultDraftApproval ¶ added in v0.3.0
DefaultDraftApproval is gates.toml's default for a draft gate.
func DraftActionFactMap ¶ added in v0.2.0
DraftActionFactMap is ActionFactMap for the texts of a draft's actions.
func GateFacts ¶ added in v0.3.0
GateFacts are g's facts in slot gate, which a gates.toml rule and a view over gates read; delivery is a draft gate's delivery state, as the Outbox reads it from its draft, "" for any other gate.
func HeadlineName ¶
HeadlineName is the name a headline text is parsed under in an intent's template set: "headline.resumed", "headline.new[0]", ...
func KeyActions ¶ added in v0.3.0
KeyActions are the actions keys.toml words, by context: one per core action, a numbered one as <name>:{n}.
func Load ¶
func Load(layers []profile.Layer, bundled fs.FS, base *template.Template, check TemplateCheck) (*Loaded, Problems)
Load reads intents/ of the bundled FS and of each directory layer; check may be nil. The partials under partials/ of each directory layer are parsed over base's; one that does not parse, or that a problem names, is left out and the bundled partials load instead. Layers with an empty Dir are skipped: the bundled intents come from bundled only. A user directory named as a bundled intent overrides its files one by one; when the result does not load, the bundled intent stays and the problems name the user's files.
func LoadIn ¶ added in v0.4.0
func LoadIn(locale string, layers []profile.Layer, bundled fs.FS, base *template.Template, check TemplateCheck) (*Loaded, Problems)
LoadIn is Load with the texts a person reads in locale, each by the layer rule of profile.Texts.
func Locales ¶ added in v0.4.0
Locales are English and every locale a layer of layers, the bundled one read from bundled, holds texts in.
func NestFacts ¶ added in v0.2.0
NestFacts nests the dotted facts of env into the map an inline template executes over, {"pr": {"slug": ...}}, each read by get; a fact get has no value for reads as its type's zero value.
func OverlayDraftApproval ¶ added in v0.2.0
func OverlayDraftApproval(base *draft.Policy, def draft.Approval, o ApprovalOverlay, envs ApprovalEnvs) (draft.Policy, error)
OverlayDraftApproval is base, a workflow's draft policy (nil: def, gates.toml's default for a draft gate), with o laid over it, o's rules for draft gates compiled over envs. The merged policy is validated.
func OverlayRunApproval ¶ added in v0.2.0
func OverlayRunApproval(a workflow.Approval, k gate.Kind, o ApprovalOverlay, envs ApprovalEnvs) (workflow.Approval, error)
OverlayRunApproval is a, a workflow's approval of its gates of kind k (a kind but draft), with o laid over it, o's rules for k compiled over envs. A mode that does not apply to k leaves a's. The merged approval is validated, and a releasing rule of o may not read an untrusted fact.
func OwedByEnv ¶ added in v0.3.0
OwedByEnv is the env owed_by.expr compiles over: the task's workflow facts but OwedFacts, and d's properties.
func ProposalFacts ¶ added in v0.3.0
ProposalFacts are the proposal facts, each value got by its name.
func RefusalText ¶ added in v0.2.0
RefusalText is the ActionTexts key of the why of refusal i.
func RefuseWhyName ¶ added in v0.2.0
RefuseWhyName is the name refuse[i].why is parsed under.
func SampleActionFacts ¶
SampleActionFacts is the action fact map with every fact set, for checking texts.
func SampleCopyFacts ¶ added in v0.5.0
SampleCopyFacts is SampleActionFacts for the copy texts of a built-in action.
func SampleDraftActionFacts ¶ added in v0.2.0
SampleDraftActionFacts is SampleActionFacts for a draft's actions.
func StepFacts ¶ added in v0.4.0
StepFacts are the facts a step gate's text reads: the workflow facts of its unit and of the units its task holds, each value got by its name.
func SurvivorEnv ¶ added in v0.4.0
SurvivorEnv is the env a verb's survivor compiles over: the task's workflow facts and d's properties.
func TextFuncs ¶ added in v0.4.0
TextFuncs are the template functions of a text localized in locale: the action functions and plural.
func TurnEnv ¶ added in v0.2.0
TurnEnv is the env an intent's turn predicates and inline texts read: the turn slot's facts and its inputs, turn.stage only with the stage dimension.
Types ¶
type ActionPrograms ¶ added in v0.2.0
type ActionPrograms struct {
When *expr.Program
Primary *expr.Program
Refuse []RefusalProgram
// ActionTexts are note, warning, confirm and each refusal's why
// ("refuse[<i>].why"), over the action fact map.
ActionTexts map[string]*template.Template
}
ActionPrograms are an intent's compiled [action] predicates and texts.
type ApprovalEnvs ¶ added in v0.3.0
ApprovalEnvs are what an overlay rule of a workflow reads: Draft over a draft gate's facts and its unit's, Unit over its unit's for any other kind.
type ApprovalOverlay ¶ added in v0.2.0
type ApprovalOverlay struct {
Mode string
Window *time.Duration
Rules []RuleOverlay
}
ApprovalOverlay is the configuration's [gates.approval] of a workflow, laid over its manifest's field by field: a set Mode or Window replaces that field, and non-nil Rules replace the rules, an empty list clearing them. A Mode other than delay drops the manifest's window, which JSON cannot unset.
type BuiltinAction ¶ added in v0.2.0
type BuiltinAction struct {
Label, Summary string
Input struct{ Label, Help string }
// Texts are note, warning, confirm and why, parsed; a text the table
// leaves empty is absent.
Texts map[string]*template.Template
// Copy are the texts of its copy table, by key (text, html, notice), over the copy facts; nil when it has
// none.
Copy map[string]*template.Template
}
BuiltinAction is a built-in action's texts, from its actions.toml table.
func (BuiltinAction) Copies ¶ added in v0.5.0
func (a BuiltinAction) Copies() bool
Copies says a gives the person something to copy.
func (BuiltinAction) Render ¶ added in v0.2.0
Render is text name of a over facts, "" when a has none.
func (BuiltinAction) RenderCopy ¶ added in v0.5.0
RenderCopy is copy text name of a over facts, "" when a has none.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache reloads when the newest mtime under the user layer's intents/ and blocks changes; safe for concurrent use.
type CacheOptions ¶
type CacheOptions struct {
// Recheck is how long a stamp is trusted before the layers are walked again.
Recheck time.Duration
// Now is the clock; time.Now when nil.
Now func() time.Time
// LoadTree reads the profile tree of a Loaded; profile.Load when nil.
LoadTree func([]profile.Layer, *dintent.Registry, []dintent.Name) (profile.Tree, error)
// OnReload is called, holding no lock, after Get replaces the loaded registry with a changed one; the first load is not a reload.
OnReload func()
// Locale is the locale of the texts a person reads, asked on each walk; English when nil.
Locale func() string
}
CacheOptions tune a Cache; the zero value rechecks the stamp on every Get.
type Decisions ¶ added in v0.4.0
type Decisions struct {
Map decision.Map
Kinds map[decision.Kind]KindTexts
// Primary is what a queue offers first on a plugin's unit, by provider and kind: a catalog action or
// decision.Open.
Primary map[dunit.ProviderID]map[decision.Kind]string
// Open is what a queue's button that opens a unit at its source says.
Open string
}
Decisions are decisions.toml over every layer.
type DraftWords ¶ added in v0.4.0
type DraftWords struct {
ByHand, ByHandAbout string
Purposes, States, Reasons map[string]string
// Quoted says a draft posted in the direct conversation of the person it is to quotes {conversation}.
Quoted string
// Stale says a draft was written against what its unit no longer is; Hold that no rule sends it.
Stale, Hold string
// Authors say who wrote a draft's current content, by actor kind.
Authors map[string]string
}
DraftWords name drafts to a person: ByHand and ByHandAbout head the Outbox's group of the drafts no workflow proposed and no purpose names, Purposes name a purpose, States a delivery state and Reasons why a dropped draft was withdrawn, by its id.
type FacetBucket ¶ added in v0.4.0
FacetBucket is a bucket of a facet that sorts by time; a Within of 0 takes the rest.
type FacetDef ¶ added in v0.4.0
type FacetDef struct {
ID, Fact, Label, Empty, Sort, Match string
// LabelPrefix goes before the label of each value the facet shows on a row.
LabelPrefix string
Group, Menu, Strip bool
// Colors are the strip hues of the facet's values, by value.
Colors map[string]string
// Show is where the facet's values show on a task's row.
Show Show
Rank []string
Values map[string]string
Buckets []FacetBucket
Merge, Units string
// contains filtered or unexported fields
}
FacetDef is a task facet: the fact (or the "<record>.<field>" of a record kind) it reads, and the mechanics every client filters, groups and sorts it by. Merge is "union", "rows-first" or "own", Units "all" or "primary".
type GateApproval ¶ added in v0.3.0
GateApproval is gates.toml's [approval]: the first rule whose When holds over the gate's facts decides, else Mode and Window.
type GateDef ¶ added in v0.3.0
type GateDef struct {
Name string
Kind gate.Kind
Label string
Intents []GateIntent
// ClosesWith is the intent, one that refuses the gate, a person's
// ending of the gate's task resolves it with; an open gate with one
// holds its task open until a person settles it or its unit ends,
// which supersedes it. "" neither holds nor closes.
ClosesWith string
// EndsTask is the category, done or dropped, a task opened only to hold gates ends in once the gate closes
// with a status and none of its gates is open; a status it leaves out leaves the task open.
EndsTask map[gate.Status]task.Category
// CardSays makes the gate's card list what each intent does, its Summary.
CardSays bool
// Text words the gate's subject when the loop writes it, a template
// over the proposal facts, or a step gate's over StepFacts; nil writes nothing.
Text *template.Template
}
GateDef is a named gate: its kind, which names the consequence of resolving it, its words and the intents it is resolved with.
type GateIntent ¶ added in v0.3.0
type GateIntent struct {
Name, Label string
// Summary is what resolving with it does, as help and palettes show it.
Summary string
Status gate.Status
Answer bool
// Texts are its note and confirm, templates over the action facts a
// row offering it reads.
Texts map[string]*template.Template
}
GateIntent is what a gate is resolved with: the status it resolves the gate to, and whether it takes text.
type GateRule ¶ added in v0.3.0
GateRule is one rule of gates.toml's [approval], its When over the gate's facts only.
type GatesDef ¶ added in v0.3.0
type GatesDef struct {
Gates []GateDef
// Approval is gates.toml's [approval]: how a gate is decided when no
// manifest or configuration says, the default of each kind.
Approval GateApproval
// Effects are the sentences that say what each effect does when a draft is sent, by effect name.
Effects map[string]string
// Drafts are the words a draft's card and the Outbox read: gates.toml's [drafts].
Drafts DraftWords
}
GatesDef is the profile's gates.toml over every layer, in declared order as TasksDef's states are: bundled gates first, then each user layer's new ones; a gate's intents likewise.
func (GatesDef) DefaultFor ¶ added in v0.3.0
DefaultFor is how gates.toml decides a gate of kind k: the first gate of that kind, open. A rule that cannot be read waits.
type HomeCounterDef ¶ added in v0.4.0
type HomeCounterDef struct {
ID string
Kind decision.Kind
View string
Noun, Clause i18n.Forms
// contains filtered or unexported fields
}
HomeCounterDef is a counter of the briefing: a decision kind's (Kind) or a view's (View).
type HomeDef ¶ added in v0.4.0
type HomeDef struct {
Template, Join, LastJoin, End, Count, Empty string
PerSentence int
Counters []HomeCounterDef
Sections []HomeSectionDef
CaptureHint string
}
HomeDef is home.toml over every layer, its texts in the load's locale.
type HomeSectionDef ¶ added in v0.4.0
HomeSectionDef is a section of the home: the first Limit rows of View, each showing Time.
type KeyTexts ¶ added in v0.3.0
KeyTexts are the help lines of the core keys, by context, then action; a numbered action such as answer:3 reads answer:{n}.
type KindTexts ¶ added in v0.4.0
type KindTexts struct {
View string
Noun, Clause i18n.Forms
Queue, Empty string
Primary string
// contains filtered or unexported fields
}
KindTexts are a decision kind's view and words; Primary is the gate intent a queue offers first, "" the gate's first.
type LensWords ¶ added in v0.4.0
type LensWords struct {
DefaultGroup, BoardGroup, NoGroup, Copied, CopiedGrouped, TagKey, TagKeyEmpty, Grouped, Sorted, Descending, NoLens string
// Row are the words of a row.
Row RowWords
}
LensWords are what a list's lens bar says, each a template whose only actions are the {{.name}} its key's doc lists, which clients fill in.
type Loaded ¶
type Loaded struct {
// Locale is the locale the person-read texts were loaded in.
Locale string
Registry *dintent.Registry
Templates map[dintent.Name]*template.Template // body on a clone of base, missingkey=error
Programs map[dintent.Name]Programs
Problems Problems // user intents that did not load, and overrides read as bundled
Broken map[dintent.Name]Problems // user intents that failed, keyed by directory name
Reverted map[dintent.Name]Problems // bundled intents read without the user's override, which does not load
// Warnings are what the loaded intents and workflows declare that loads
// but is deprecated.
Warnings Problems
Workflows []workflow.Workflow // by order, then name; a user workflow that failed is not here
BrokenWorkflows map[string]Problems // user workflows that failed, keyed by directory name
// RevertedWorkflows are bundled workflows read without the user's override, which does not load.
RevertedWorkflows map[string]Problems
// Actions are the built-in actions' texts from actions.toml, by catalog id.
Actions map[string]BuiltinAction
// Tools are the MCP tools' texts from tools.toml, by tool name.
Tools map[string]ToolText
// Views are the views, the review and the badge of views.toml.
Views ViewsDef
// Tasks are the task properties, states and verbs of tasks.toml.
Tasks TasksDef
// Gates are the gates of gates.toml.
Gates GatesDef
// Records are the record kinds of records.toml.
Records RecordsDef
// Keys are the core keys' help from keys.toml.
Keys KeyTexts
// Notices are what the loop tells a session, from notices.toml, by notice name.
Notices map[string]string
// UI are each plugin's words of its manifest's views, facets and
// situations, from its layers' ui.toml, by plugin id.
UI map[string]UITexts
// Previews are the summary-line templates of the draft kinds, by provider and kind, read from the plugins'
// profile layers at the paths their manifests' preview keys name.
Previews map[string]map[string]string
// Strings are the clients' texts in Locale, by their English text; Formats the Go clients' date and
// number formats in Locale.
Strings map[string]i18n.Forms
Formats map[string]string
// StringsStamp changes when Locale, Strings or Formats do.
StringsStamp string
// Timeline is timeline.toml in Locale.
Timeline TimelineDef
// Decisions are decisions.toml in Locale: what maps to each decision kind, and its words.
Decisions Decisions
// Home is home.toml in Locale.
Home HomeDef
// Predicates are each plugin's predicates.toml over its layers.
Predicates Predicates
// Omnibox is omnibox.toml in Locale.
Omnibox OmniboxDef
// EmptyRefusal is what a [[refuse]] case whose why renders empty says,
// from defaults.toml.
EmptyRefusal string
// contains filtered or unexported fields
}
func (*Loaded) BrokenNames ¶
BrokenNames is the kinds whose blocks are skipped, sorted: the user intents that did not load, and the kinds whose blocks need what a reverted override declared.
func (*Loaded) ProfileFile ¶ added in v0.4.0
ProfileFile is rel, a file of a workflow's directory, resolved through the layers that workflow loaded from, a whole-file text a person reads in l's locale.
func (*Loaded) Refusal ¶ added in v0.2.0
Refusal is the why of the intent name's first refusal whose when holds over facts, the unit's workflow facts, never empty when one holds; "" when none holds.
func (*Loaded) Rules ¶
func (l *Loaded) Rules(intent string) (dintent.RecordRules, error)
Rules is intent's record rules; for a broken user intent the error carries its first problem.
func (*Loaded) SessionName ¶ added in v0.3.0
SessionName renders the session.name of the intent name over facts, its name facts but session.title, which it reads from the manifest; the title when the template is empty or renders blank.
func (*Loaded) TargetTitle ¶ added in v0.3.0
TargetTitle renders the target.title of the intent name over guidance; "" when it has none.
func (*Loaded) Tree ¶
Tree is the profile's blocks as of this load, read on the first call and kept; an unreadable block is the error every call returns.
type OmniboxDef ¶ added in v0.4.0
type OmniboxDef struct {
// Limit is the most results a group shows.
Limit int
// Other labels the last group, of what no group's view holds.
Other string
Groups []SearchGroupDef
// Verbs are the known verbs, by id order of their first layer.
Verbs []OmniboxVerbDef
}
OmniboxDef is omnibox.toml over every layer, its texts in the load's locale.
type OmniboxVerbDef ¶ added in v0.4.0
type OmniboxVerbDef struct {
ID string
Words []string
Action, Verb, Op string
// contains filtered or unexported fields
}
OmniboxVerbDef is a known verb: its words in every language and its target.
type Predicates ¶ added in v0.4.0
type Predicates map[dunit.ProviderID]map[string]*expr.Program
Predicates are each plugin's predicates, by provider and name, as its layers set them.
func (Predicates) Eval ¶ added in v0.4.0
func (ps Predicates) Eval(p dunit.ProviderID, name string, sets []map[string]any) (holds []bool, errs []error, err error)
Eval is Holds over each of sets: one verdict and one evaluation error per set, in order; err when p declares no such predicate or no layer sets it.
func (Predicates) Holds ¶ added in v0.4.0
func (ps Predicates) Holds(p dunit.ProviderID, name string, facts map[string]any) (bool, error)
Holds says whether plugin p's predicate name holds over facts; an error when p declares no such predicate or no layer sets it, or when it fails to evaluate.
type Problems ¶
type Problems []Problem
func BundledNotices ¶ added in v0.3.0
BundledNotices are the notices' texts of bundled alone.
func BundledTools ¶ added in v0.3.0
BundledTools are the tools' texts of bundled and the bundled plugins' layers.
type PropDef ¶ added in v0.3.0
type PropDef struct {
Name string
Type task.PropType
Values []string
Writers []task.Writer
Doc string
// Role is the mechanism that acts on the property, "" for none.
Role task.Role
}
PropDef is a task property: the fact task.prop.<Name>. Values are an enum's, at least one.
type RecordKind ¶ added in v0.3.0
type RecordKind struct {
Name string
SchemaFile string
Schema *jsonschema.Schema
Writers []task.Writer
Projects map[string]string
}
RecordKind is a declared record kind: the schema its data follows, who may write it, and the task properties its fields set, by field.
type RecordsDef ¶ added in v0.3.0
type RecordsDef struct {
Kinds []RecordKind
}
RecordsDef is the profile's records.toml over every layer: the record kinds a run, a person or a plugin writes on a task, in declared order.
func (RecordsDef) Kind ¶ added in v0.3.0
func (d RecordsDef) Kind(name string) (RecordKind, bool)
Kind is the record kind name declares.
type RefusalProgram ¶ added in v0.2.0
RefusalProgram is an [[action.refuse]] case's compiled when.
type ReviewStepDef ¶ added in v0.3.0
type ReviewStepDef struct {
View, Label string
}
ReviewStepDef is a step of the review: the view it walks and what it asks of the user.
type RowWords ¶ added in v0.4.0
type RowWords struct {
AgeNow string
AgeMinutes string
AgeHours string
AgeDays string
FilterLabel string
FilterTitle string
FilterTitleGroup string
FilterGroup string
ListCount string
ListEmpty string
CountdownTitle string
CountdownSending string
CountdownSeconds string
CountdownMinutes string
TipNamed string
TipKind string
TipWhy string
LegendTitle string
SortBy string
ColUnit string
Stale string
StaleTitle string
Briefing string
BriefingTitle string
BriefingAttempt string
BriefingError string
Questions string
QuestionsTitle string
Starred string
Until string
Due string
Unread string
UnreadTitle string
ReviewDue string
NoNextAction string
OpenChildren string
Sequential string
Every string
Reviewed string
More string
}
RowWords are the words of a row beside its facets, by builtin.RowWords' keys.
type RuleOverlay ¶ added in v0.2.0
RuleOverlay is one rule of an ApprovalOverlay.
type SearchGroupDef ¶ added in v0.4.0
type SearchGroupDef struct {
ID, Label, View string
}
SearchGroupDef is a search group: the results its view holds.
type Shared ¶ added in v0.4.0
type Shared struct {
// contains filtered or unexported fields
}
Shared loads one registry per chain of embedded layers over the installed builtin tables, for the caches it makes and for Load. No caller changes a Loaded it returns.
func (*Shared) Load ¶ added in v0.4.0
Load is the registry over layers, loaded once while they are all embedded and the installed tables stay the same; a layer on disk loads anew.
type Show ¶ added in v0.4.0
type Show struct {
Part string
Only []string
Values string
When map[string][]string
Max int
Label string
}
Show is where a facet's values show on a row: Part, one of builtin.ShowParts, "" for the lens alone; Only the values the part shows, all when empty; Values "all" or "first"; When the values, by facet id, a row must hold for the facet to show; Max how many values show before the rest count into one; Label an age part's label over {{.age}} and {{.at}}.
type StateDef ¶ added in v0.3.0
StateDef is a state a task takes and its category, which is all Go reads of it.
type TasksDef ¶ added in v0.3.0
type TasksDef struct {
Props []PropDef
States []StateDef
Verbs map[string]VerbText
// VerbOrder are the names of Verbs in the order clients list them: the bundled file's, then each user
// layer's new ones.
VerbOrder []string
// OwedBy is owed_by.expr as written; Owed is it compiled over OwedByEnv, nil when the profile has none.
OwedBy string
Owed *expr.Program
// ChatIntent is the intent of the turn a chat message starts on a task with no live session.
ChatIntent string
// ChatAt is where the layer that set ChatIntent sets it.
ChatAt dintent.Pos
// ViaSession names a change an agent made for the user through a session they drove; {session} is the
// session's id.
ViaSession string
// ViaWorkflow names a change a workflow made; {workflow} is the workflow's name.
ViaWorkflow string
// DetailVerbs are the verbs a task's detail offers as its buttons, in order; the rest it offers wait in a
// palette.
DetailVerbs []string
// RunStates word a run's turn state and SessionStates its session's, by state: tasks.toml's [runs].
RunStates, SessionStates map[string]string
Areas, Contexts []string
StaleWaitingDays int
}
TasksDef is the profile's tasks.toml over every layer. Props and States keep their declared order: the bundled entries in the order the bundled file declares them, then each user layer's new entries in its own order; a layer that sets an entry declared below it changes it in place.
A zero task.Value unsets a property, so an int or a duration property holds no 0: 0 means unset, and Parse refuses it.
func (TasksDef) CategoryOf ¶ added in v0.3.0
CategoryOf is the category of state; false when the profile declares no such state.
func (TasksDef) Facts ¶ added in v0.3.0
Facts are the task.prop.<name> facts of the declared properties, typed from their types, an enum's closed to its values and an untrusted one marked so, with task.prop_by.<name>, who last wrote each; and task.state closed to the declared states.
func (TasksDef) FirstOf ¶ added in v0.3.0
FirstOf is the first state of category c in the profile's order, which a task proposed in c takes; "" when no state is of c.
func (TasksDef) Handler ¶ added in v0.3.0
Handler is the handler verb runs besides its move, "" for none.
func (TasksDef) HeldProblems ¶ added in v0.3.0
HeldProblems are the problems of the states stored tasks hold, held, that no layer declares: their tasks keep the category they had, and no verb moves them.
func (TasksDef) Move ¶ added in v0.3.0
Move is the states verb moves a task from (every state when empty) and the state it moves it to ("" for none); false when no verb is named so.
func (TasksDef) Parse ¶ added in v0.3.0
Parse reads text as the value of the property name, by its type: a string as is; an enum one of its values; a date YYYY-MM-DD (midnight in loc) or RFC 3339; a duration as the profile writes them (90m, 2d); an int in decimal; an actor a person's key, provider:id; a list type its items comma-separated. Empty text is the zero Value, which unsets the property, and so is 0: Parse refuses 0 for an int or a duration.
func (TasksDef) PropOf ¶ added in v0.3.0
PropOf is the property that takes role r, and its values; "" when none does.
func (TasksDef) ShapingVerbs ¶ added in v0.4.0
ShapingVerbs are d's verbs that shape a task by hand, which task.clarified reads: those whose move has a state to go to, and those whose handler files the task under a project, in name order.
type TemplateCheck ¶
TemplateCheck renders a manifest's templates against real samples; internal/turn provides it.
type TimelineDef ¶ added in v0.4.0
type TimelineDef struct {
Events map[string]TimelineEvent
Facts []TimelineFact
}
TimelineDef is timeline.toml: the core's event kinds as the timeline names them, and its facts in the order they are tried.
type TimelineEvent ¶ added in v0.4.0
type TimelineEvent struct {
Label, Tone string
}
TimelineEvent is one core event kind's words and tone.
type TimelineFact ¶ added in v0.4.0
type TimelineFact struct {
Name string
Start, End, Absorb []string
Label, Running, Tone string
// Unfinished is how a span reads that its start kind came to again before its end.
Unfinished string
Order int
Subs map[string]string
}
TimelineFact is one [facts.<name>]: the event kinds that open, close and join it, and how it reads.
type ToolText ¶ added in v0.3.0
ToolText is an MCP tool's description, its parameters', by parameter path, and its answers, by name, as templates over builtin.ToolData and, for an answer, the fields of its builtin.ToolAnswers row.
type UIDecision ¶ added in v0.4.0
type UIDecision struct {
ClauseRaw any `toml:"clause"`
Clause i18n.Forms `toml:"-"`
Queue string `toml:"queue"`
Empty string `toml:"empty"`
}
UIDecision is a plugin's words of a decision kind.
type UIDraft ¶ added in v0.5.0
type UIDraft struct {
Fields map[string]UIDraftField `toml:"fields"`
}
UIDraft is a draft kind's words: its payload's fields, by the key they have in it.
type UIDraftField ¶ added in v0.5.0
type UIDraftField struct {
Label string `toml:"label"`
Values map[string]string `toml:"values"`
// Markdown says the field's value is Markdown, which the card renders as the draft's text is.
Markdown *bool `toml:"markdown"`
}
UIDraftField is a payload field's name and its values' words, by value.
type UIEvent ¶ added in v0.3.0
type UIEvent struct {
Label string `toml:"label"`
Loop bool `toml:"loop"`
Tone string `toml:"tone"`
Data string `toml:"data"`
}
UIEvent is an event kind's words.
type UIFacet ¶ added in v0.3.0
type UIFacet struct {
Label string `toml:"label"`
Empty string `toml:"empty"`
Values map[string]string `toml:"values"`
Buckets map[string]string `toml:"buckets"`
ShowRaw any `toml:"show"`
ShowValues *string `toml:"show_values"`
ShowWhen map[string][]string `toml:"show_when"`
ShowMax *int `toml:"show_max"`
ShowLabel *string `toml:"show_label"`
LabelPrefix *string `toml:"label_prefix"`
RowClass map[string]string `toml:"row_class"`
Colors map[string]string `toml:"colors"`
// Show is where the facet's values show on the plugin's rows, read from ShowRaw and ShowValues.
Show Show `toml:"-"`
}
UIFacet is a facet's words.
type UISearch ¶ added in v0.3.0
type UISearch struct {
DefaultSort string `toml:"default_sort"`
Presets []UISearchPreset `toml:"presets"`
Filters []UISearchFilter `toml:"filters"`
Sorts []UISearchSort `toml:"sorts"`
Decisions map[string]string `toml:"decisions"`
NoDecision string `toml:"no_decision"`
}
UISearch is a custom view's search: the queries it runs at a press, the terms it toggles, the orders it offers and how a result's decision reads.
type UISearchFilter ¶ added in v0.3.0
type UISearchFilter struct {
Term string `toml:"term"`
Window int `toml:"window"`
Label string `toml:"label"`
}
UISearchFilter toggles a term, or with Window a recent-activity window in days.
type UISearchPreset ¶ added in v0.3.0
UISearchPreset is a query run at a press.
type UISearchSort ¶ added in v0.3.0
type UISearchSort struct {
Sort string `toml:"sort"`
Label string `toml:"label"`
Shown string `toml:"shown"`
}
UISearchSort is an order a search offers.
type UISignal ¶ added in v0.4.0
type UISignal struct {
Label string `toml:"label"`
Values map[string]string `toml:"values"`
ValuesFrom string `toml:"values_from"`
Notes map[string]string `toml:"notes"`
}
UISignal is a card signal's words: its name, its values' and its notes' by code, and where else its values take words from.
type UITexts ¶ added in v0.3.0
type UITexts struct {
Views map[string]UIView `toml:"views"`
Facets map[string]UIFacet `toml:"facets"`
Situations map[string]string `toml:"situations"`
Reasons map[string]string `toml:"reasons"`
Signals map[string]UISignal `toml:"signals"`
Events map[string]UIEvent `toml:"events"`
Menubar map[string]string `toml:"menubar"`
Detail map[string]UIField `toml:"detail"`
// Drafts are the words of a draft's payload on its card, by draft kind.
Drafts map[string]UIDraft `toml:"drafts"`
LensRaw map[string]string `toml:"lens"`
// Lens are the plugin's own row words, those it leaves out empty.
Lens RowWords `toml:"-"`
NounRaw any `toml:"noun"`
// Noun is what one of the plugin's units is, as the briefing counts it.
Noun i18n.Forms `toml:"-"`
// Decisions are the plugin's words of the decisions its units wait on, by decision kind.
Decisions map[string]UIDecision `toml:"decisions"`
}
UITexts are one plugin's words of its manifest's ids.
type UIView ¶ added in v0.3.0
type UIView struct {
Label string `toml:"label"`
Unit string `toml:"unit"`
DefaultSort string `toml:"default_sort"`
Search *UISearch `toml:"search"`
}
UIView is a view's words.
type VerbText ¶ added in v0.3.0
type VerbText struct {
Label, Summary, Input string
Offer workflow.Predicate
From []string
To string
By map[string]string
Allow map[string]workflow.Predicate
Gate, Handler, Send string
// KeepDrafts are the purposes of the held drafts a task keeps when the verb ends it; the others are
// withdrawn.
KeepDrafts []string
// Survivor, on a merge, is the predicate over each task's facts (SurvivorEnv) that names the one that
// stays; nil when the verb sets none.
Survivor workflow.Predicate
}
VerbText is a verb's words: Input is the question a verb that asks for a value puts first. Offer, when set, is where a task offers the verb. From are the states it moves a task from, every state when empty; To the state it moves it to, "" for none. By are who may run it, by actor: a predicate's source over the task's facts, or "gate"; an actor left out may not. Gate is the gate a "gate" opens, Handler what it runs besides its move ("" for none), Send how a reply's handler sends. Allow are By's predicates compiled, by actor; a "gate" has none.
type ViewDef ¶ added in v0.3.0
type ViewDef struct {
ID, Label, Summary, Over, Group, Key, Empty string
WhenText, SortText string
Sort []SortKey
HideDisabled, RemoveClean bool
// Rail says that the rail lists the view; a view only the home, a queue or search reads has it false.
Rail bool
When workflow.Predicate
// Layout is how the cockpit draws the view, one of builtin.ViewLayouts.
Layout string
// contains filtered or unexported fields
}
ViewDef is a view: Summary, one line on what it lists; what it lists (Over, task.OverTasks or task.OverGates); When, which of them, compiled over their facts, nil for a view that lists nothing and is a place a client draws itself, such as the review; Group the fact it groups by, Sort the facts it sorts by, Key the key that jumps to it, HideDisabled whether it leaves out what a disabled plugin holds, RemoveClean whether it offers to remove its tasks' clean workspaces, and Empty what it shows when it lists nothing. WhenText and SortText are its when and sort as the profile writes them.
type ViewsDef ¶ added in v0.3.0
type ViewsDef struct {
Views []ViewDef
// Review are the review's steps in order, each a view.
Review []ReviewStepDef
// Badge are the views whose counts the badge adds up.
Badge []string
// Empty is what a view without its own empty shows when it lists nothing.
Empty *template.Template
// DefaultSort is what clients call a view's own order.
DefaultSort string
// Lens is what every list's lens bar says.
Lens LensWords
// Facets are the task facets in their declared order.
Facets []FacetDef
}
ViewsDef is views.toml over every layer. Views and Review keep their declared order, as TasksDef's states do: the bundled entries first, then each user layer's new ones in its own order.
Source Files
¶
- actions.go
- brief_schema.go
- decisions.go
- decode.go
- decode_action.go
- decode_approval.go
- defaults.go
- files.go
- gates.go
- grammar.go
- home.go
- keyhelp.go
- keys.go
- load.go
- localize.go
- notices.go
- omnibox.go
- partials.go
- predicates.go
- previews.go
- profile_defaults.go
- records.go
- rowwords.go
- schema.go
- strings.go
- tasks.go
- templates.go
- timeline.go
- tools.go
- ui.go
- validate.go
- views.go
- workflows.go
- workflows_classify.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package builtin is the Go vocabulary manifests name: builtins by slot, reserved names and keys, and the facts predicates read.
|
Package builtin is the Go vocabulary manifests name: builtins by slot, reserved names and keys, and the facts predicates read. |
|
builtintest
Package builtintest swaps the builtin tables for a test.
|
Package builtintest swaps the builtin tables for a test. |
|
cmd/factsdoc
command
Command factsdoc prints the facts reference page: the intents' facts and the workflow facts, each grouped by slot, the draft approval facts, the workflow steps, then the draft effects.
|
Command factsdoc prints the facts reference page: the intents' facts and the workflow facts, each grouped by slot, the draft approval facts, the workflow steps, then the draft effects. |
|
cmd/grammardoc
command
Command grammardoc writes what the grammar table derives: the JSON schemas of the profile files and the configuration, the generated tables of the manifest and configuration reference pages, and the language page.
|
Command grammardoc writes what the grammar table derives: the JSON schemas of the profile files and the configuration, the generated tables of the manifest and configuration reference pages, and the language page. |
|
Package expr compiles and evaluates the predicates of intent and workflow manifests: CEL expressions (cel-go) over typed facts, checked at load.
|
Package expr compiles and evaluates the predicates of intent and workflow manifests: CEL expressions (cel-go) over typed facts, checked at load. |