intent

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 39 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 intent loads intent manifests from the bundled profile and the user's layers into one registry; import it as intentload.

Index

Constants

View Source
const (
	WorkspaceNameName = "workspace.name"
	TargetTitleName   = "target.title"
)

WorkspaceNameName and TargetTitleName are the names workspace.name and target.title are parsed under.

View Source
const ActionsFile = "actions.toml"

ActionsFile is the profile file that words the built-in actions.

View Source
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.

View Source
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.

View Source
const GatesFile = "gates.toml"

GatesFile is the profile file that declares and words the gates.

View Source
const KeysFile = "keys.toml"

KeysFile is the profile file that words the core keys' help.

View Source
const NoticesFile = "notices.toml"

NoticesFile is the profile file that words what the loop tells a session.

View Source
const RecordsFile = "records.toml"

RecordsFile is the profile file that declares the record kinds.

View Source
const SessionNameName = "session.name"

SessionNameName is the name session.name is parsed under.

View Source
const TasksFile = "tasks.toml"

TasksFile is the profile file that declares the task properties and states and words the verbs a task offers.

View Source
const ToolsFile = "tools.toml"

ToolsFile is the profile file that describes the MCP tools.

View Source
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.

View Source
const ViewsFile = "views.toml"

ViewsFile is the profile file that declares the views, the review and the badge.

View Source
const WhyName = "manifest.why"

The names the manifest's other inline templates are parsed under in an intent's template set.

Variables

View Source
var ActionFuncs = template.FuncMap{"join": strings.Join, "name": func() string { return brand.Name }, "command": func() string { return brand.Command }}

ActionFuncs are the functions action texts may call.

View Source
var ActionsSchema []byte

ActionsSchema is the JSON Schema of actions.toml, for editors.

View Source
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.

View Source
var ConfigSchema []byte

ConfigSchema is the JSON Schema of config.toml, for editors.

View Source
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.

View Source
var GatesSchema []byte

GatesSchema is the JSON Schema of gates.toml, for editors.

View Source
var KeysSchema []byte

KeysSchema is the JSON Schema of keys.toml, for editors.

View Source
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.

View Source
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.

View Source
var RecordsSchema []byte

RecordsSchema is the JSON Schema of records.toml, for editors.

View Source
var Schema []byte

Schema is the JSON Schema of intent.toml, for editors (Taplo's #:schema directive).

View Source
var TasksSchema []byte

TasksSchema is the JSON Schema of tasks.toml, for editors.

View Source
var ViewsSchema []byte

ViewsSchema is the JSON Schema of views.toml, for editors.

View Source
var WorkflowSchema []byte

WorkflowSchema is the JSON Schema of workflow.toml, for editors.

Functions

func ActionFactMap

func ActionFactMap(get func(name string) any) map[string]any

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(path, src string, sample map[string]any) (*template.Template, error)

ActionText parses an action text named path and executes it once over sample, so a text that cannot render fails at load.

func BundledGates added in v0.3.0

func BundledGates(bundled fs.FS) (GatesDef, Problems)

BundledGates is the gates.toml of bundled alone.

func BundledKeys added in v0.3.0

func BundledKeys(bundled fs.FS) (KeyTexts, Problems)

BundledKeys is the key help of the bundled profile alone.

func BundledTasks added in v0.3.0

func BundledTasks(bundled fs.FS) (TasksDef, Problems)

BundledTasks is the bundled profile's tasks.toml alone.

func BundledViews added in v0.3.0

func BundledViews(bundled fs.FS) (ViewsDef, Problems)

BundledViews is the views of the bundled profile alone.

func ByEnv added in v0.3.0

func ByEnv(d TasksDef) expr.Env

ByEnv is the env a verb's by compiles over: ByFacts and d's properties.

func DefaultApproval added in v0.3.0

func DefaultApproval(k gate.Kind, gates GatesDef) workflow.Approval

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

func DefaultDraftApproval(gates GatesDef) draft.Approval

DefaultDraftApproval is gates.toml's default for a draft gate.

func DraftActionFactMap added in v0.2.0

func DraftActionFactMap(get func(name string) any) map[string]any

DraftActionFactMap is ActionFactMap for the texts of a draft's actions.

func GateFacts added in v0.3.0

func GateFacts(g gate.Gate, delivery string) workflow.Facts

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

func HeadlineName(i int) string

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

func KeyActions() map[string][]string

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 NestFacts added in v0.2.0

func NestFacts(env expr.Env, get func(name string) any) map[string]any

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

func OwedByEnv(d TasksDef) expr.Env

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

func ProposalFacts(get func(name string) any) map[string]any

ProposalFacts are the proposal facts, each value got by its name.

func RefusalText added in v0.2.0

func RefusalText(i int) string

RefusalText is the ActionTexts key of the why of refusal i.

func RefuseWhyName added in v0.2.0

func RefuseWhyName(i int) string

RefuseWhyName is the name refuse[i].why is parsed under.

func SampleActionFacts

func SampleActionFacts() map[string]any

SampleActionFacts is the action fact map with every fact set, for checking texts.

func SampleDraftActionFacts added in v0.2.0

func SampleDraftActionFacts() map[string]any

SampleDraftActionFacts is SampleActionFacts for a draft's actions.

func TurnEnv added in v0.2.0

func TurnEnv(d dintent.Def) expr.Env

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.

func ValidRepo added in v0.3.0

func ValidRepo(name string) bool

ValidRepo says whether name is a repository, owner/name, whose parts are names and not . or .., so no path joined from it leaves its folder.

func ViewEnv added in v0.3.0

func ViewEnv(over string, tasks TasksDef) expr.Env

ViewEnv is the facts a view over over reads: a task's, its properties typed as tasks declares them, or a gate's.

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

type ApprovalEnvs struct{ Draft, Unit expr.Env }

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
}

BuiltinAction is a built-in action's texts, from its actions.toml table.

func (BuiltinAction) Render added in v0.2.0

func (a BuiltinAction) Render(name string, facts map[string]any) (string, error)

Render is 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.

func NewCache

func NewCache(layers func() []profile.Layer, bundled fs.FS, base *template.Template, check TemplateCheck, opts CacheOptions) *Cache

func (*Cache) Get

func (c *Cache) Get() *Loaded

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()
}

CacheOptions tune a Cache; the zero value rechecks the stamp on every Get.

type GateApproval added in v0.3.0

type GateApproval struct {
	Rules  []GateRule
	Mode   gate.Mode
	Window time.Duration
}

GateApproval is gates.toml's [approval]: the first rule whose When holds over the gate's facts decides, else Mode and Window.

func (GateApproval) Decide added in v0.3.0

Decide is how a decides a gate whose facts are f: the mode, its window and where the rule that decided is declared.

type GateDef added in v0.3.0

type GateDef struct {
	Name    string
	Kind    gate.Kind
	Label   string
	Intents []GateIntent
	// Text words the gate's subject when the loop writes it, a template
	// over the proposal facts; 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.

func (GateDef) Words added in v0.3.0

func (g GateDef) Words(facts map[string]any) (string, error)

Words is the gate's text over facts, "" when it has none.

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.

func (GateIntent) Render added in v0.3.0

func (in GateIntent) Render(name string, facts map[string]any) (string, error)

Render is the intent's text name over facts, "" when it has none.

type GateRule added in v0.3.0

type GateRule struct {
	At     string
	When   workflow.Predicate
	Mode   gate.Mode
	Window time.Duration
}

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
}

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

func (d GatesDef) DefaultFor(k gate.Kind) (gate.Mode, time.Duration, string)

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.

func (GatesDef) FirstOf added in v0.3.0

func (d GatesDef) FirstOf(k gate.Kind) (GateDef, bool)

FirstOf is the first gate of kind k in the profile's order, which a gate the loop opens by kind takes.

func (GatesDef) Gate added in v0.3.0

func (d GatesDef) Gate(name string) (GateDef, bool)

Gate is the gate name declares.

type KeyTexts added in v0.3.0

type KeyTexts map[string]map[string]string

KeyTexts are the help lines of the core keys, by context, then action; a numbered action such as answer:3 reads answer:{n}.

func (KeyTexts) Help added in v0.3.0

func (k KeyTexts) Help(context, action string) string

Help is the help line of action in context, "" when the profile has none.

type Loaded

type Loaded struct {
	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
	// EmptyRefusal is what a [[refuse]] case whose why renders empty says,
	// from defaults.toml.
	EmptyRefusal string
	// contains filtered or unexported fields
}

func (*Loaded) BrokenNames

func (l *Loaded) BrokenNames() []dintent.Name

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) Refusal added in v0.2.0

func (l *Loaded) Refusal(name dintent.Name, facts map[string]any) (string, error)

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

func (l *Loaded) SessionName(name dintent.Name, facts map[string]any) (string, error)

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

func (l *Loaded) TargetTitle(name dintent.Name, guidance string) (string, error)

TargetTitle renders the target.title of the intent name over guidance; "" when it has none.

func (*Loaded) Tree

func (l *Loaded) Tree() (profile.Tree, error)

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.

func (*Loaded) Why added in v0.2.0

func (l *Loaded) Why(name dintent.Name, facts map[string]any) (string, error)

Why renders the why of the intent name over facts, the unit's workflow facts; "" for an intent without one.

func (*Loaded) WorkspaceName added in v0.3.0

func (l *Loaded) WorkspaceName(name dintent.Name, facts map[string]any) (string, error)

WorkspaceName renders the workspace.name of the intent name over facts, its name facts; "" when it has none.

type Problem

type Problem struct {
	File      string
	Line, Col int
	Field     string // "inputs.self_review.persist", "action.enabled"
	Msg       string
	Snippet   string // a predicate problem's expression and caret line; Error leaves it out
}

type Problems

type Problems []Problem

func BundledNotices added in v0.3.0

func BundledNotices(bundled fs.FS) (map[string]string, Problems)

BundledNotices are the notices' texts of bundled alone.

func BundledTools added in v0.3.0

func BundledTools(bundled fs.FS) (map[string]ToolText, Problems)

BundledTools are the tools' texts of bundled and the bundled plugins' layers.

func BundledUI added in v0.3.0

func BundledUI() (map[string]UITexts, Problems)

BundledUI is the words of the bundled plugins' own layers alone.

func (Problems) Error

func (p Problems) Error() string

Error is the problems sorted, one "file:line:col: field: msg" per line; a problem with no line (a whole directory) reads "dir: msg".

func (Problems) Sorted

func (p Problems) Sorted() Problems

Sorted is the problems by file, line, column, field and message.

type Programs

type Programs struct {
	Records  *expr.Program
	Headline []*expr.Program // per Headline.New case; nil for the unconditional last case
	Also     []*expr.Program
	// Refuse are the refusals' when, per Refuse of the definition.
	Refuse []*expr.Program
	Action ActionPrograms
}

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.

func (PropDef) Untrusted added in v0.3.0

func (p PropDef) Untrusted() bool

Untrusted says whether an agent or a plugin may write p, so no approval rule that releases reads it.

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.

func (RecordKind) Writes added in v0.3.0

func (k RecordKind) Writes(w task.Writer) bool

Writes says whether w may write a record of k.

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

type RefusalProgram struct {
	When *expr.Program
}

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 RuleOverlay added in v0.2.0

type RuleOverlay struct {
	When, Mode string
	Window     time.Duration
}

RuleOverlay is one rule of an ApprovalOverlay.

type SortKey added in v0.3.0

type SortKey struct {
	Fact string
	Desc bool
}

SortKey is a fact a view sorts by, descending when Desc.

type StateDef added in v0.3.0

type StateDef struct {
	Name     string
	Category task.Category
	Label    string
}

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
	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

func (d TasksDef) CategoryOf(state string) (task.Category, bool)

CategoryOf is the category of state; false when the profile declares no such state.

func (TasksDef) Facts added in v0.3.0

func (d TasksDef) Facts() expr.Env

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

func (d TasksDef) FirstOf(c task.Category) string

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

func (d TasksDef) Handler(verb string) string

Handler is the handler verb runs besides its move, "" for none.

func (TasksDef) HeldProblems added in v0.3.0

func (d TasksDef) HeldProblems(held []string) Problems

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

func (d TasksDef) Move(verb string) ([]string, string, bool)

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

func (d TasksDef) Parse(name, text string, loc *time.Location) (task.Value, error)

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) Prop added in v0.3.0

func (d TasksDef) Prop(name string) (PropDef, bool)

Prop is the property name declares.

func (TasksDef) PropOf added in v0.3.0

func (d TasksDef) PropOf(r task.Role) (string, []string)

PropOf is the property that takes role r, and its values; "" when none does.

func (TasksDef) Untrusted added in v0.3.0

func (d TasksDef) Untrusted(name string) bool

Untrusted says whether no approval rule that releases may read the property name: an agent or a plugin writes it, or the profile declares no such property.

func (TasksDef) VerbKinds added in v0.3.0

func (d TasksDef) VerbKinds() []string

VerbKinds are the kinds of the events of the profile's verbs, in name order.

type TemplateCheck

type TemplateCheck func(d dintent.Def, t *template.Template) []Problem

TemplateCheck renders a manifest's templates against real samples; internal/turn provides it.

type ToolText added in v0.3.0

type ToolText struct {
	Description string
	Params      map[string]string
	Answers     map[string]string
}

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 UIEvent added in v0.3.0

type UIEvent struct {
	Label string `toml:"label"`
	Loop  bool   `toml:"loop"`
	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"`
}

UIFacet is a facet's words.

type UIField added in v0.3.0

type UIField struct {
	Label string `toml:"label"`
	Title string `toml:"title"`
}

UIField is how a field of a unit's detail shows.

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

type UISearchPreset struct {
	Query string `toml:"query"`
	Label string `toml:"label"`
}

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 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"`
	Events     map[string]UIEvent `toml:"events"`
	Menubar    map[string]string  `toml:"menubar"`
	Detail     map[string]UIField `toml:"detail"`
}

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"`
	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
}

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, Over, Group, Key string
	Sort                        []SortKey
	HideDisabled, RemoveClean   bool
	When                        workflow.Predicate
}

ViewDef is a view: 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, and RemoveClean whether it offers to remove its tasks' clean workspaces.

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
}

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.

func (ViewsDef) Badged added in v0.3.0

func (d ViewsDef) Badged(id string) bool

Badged says whether the badge counts view id.

func (ViewsDef) IDs added in v0.3.0

func (d ViewsDef) IDs() []string

IDs are the views' ids in order.

func (ViewsDef) View added in v0.3.0

func (d ViewsDef) View(id string) (ViewDef, bool)

View is the view id; false when the profile declares none.

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.

Jump to

Keyboard shortcuts

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