Documentation
¶
Overview ¶
Package intent holds the definition of an intent, as its manifest declares it, and the registry of every loaded intent.
Index ¶
- Constants
- func Normalize(spec Input, v any) (any, error)
- func OrList(names []string) string
- func Zero(v any) bool
- type Action
- type AlsoProfile
- type Brief
- type Case
- type Def
- type Guidance
- type Headline
- type Input
- type Join
- type Name
- type Pos
- type Pred
- type RecordRules
- type Registry
- func (r *Registry) All() []Def
- func (r *Registry) AllNames() string
- func (r *Registry) Answerable() []string
- func (r *Registry) ClosesWhenDone(intent string) bool
- func (r *Registry) DeclaringFlag(flag string) []Name
- func (r *Registry) ForProvider(p unit.ProviderID) []Def
- func (r *Registry) Get(n Name) (Def, bool)
- func (r *Registry) Names() string
- func (r *Registry) Reconcile(intent string) string
- func (r *Registry) Rules(intent string) (RecordRules, error)
- func (r *Registry) SessionTitles() []string
- func (r *Registry) UserFacing() []Def
- type Require
- type Resume
- type Session
- type Source
- type Text
Constants ¶
const AnyProvider unit.ProviderID = "any"
AnyProvider is the provider of an intent whose turns run on units of every provider.
const DimRound = "round"
DimRound is the profile dimension that selects by review round.
Variables ¶
This section is empty.
Functions ¶
func Normalize ¶
Normalize is v as the input's type: a flag a bool, a text a string, a list a []string, whatever JSON decoded them as.
Types ¶
type AlsoProfile ¶
type Def ¶
type Def struct {
Name Name
Label string
Summary string
Key string
Verb string // the gtd verb its action fulfills; "" for none
UserFacing bool
Workspace string // review | author | pr_else_main | given
Session Session
Context string // pr | synthetic
Launch string // "" | probe
Policy string // round | probe
Intake bool
StartLine string
OwnerOnly bool
Answerable bool
Board string // review | author | none
DrivesRow bool
Reports bool
Reconcile string // "" | my_review
Brief Brief
Profile string // "" means none
Dims []string
Records Pred
Prepare string
OnSent []string
Headline Headline
Guidance Guidance
Inputs []Input // sorted by name
AlsoProfiles []AlsoProfile
Action *Action // nil: not offered
Join Join
Record RecordRules
Resume Resume
Source Source
Bundled bool
// Provider is the manifest's provider; default "github".
Provider unit.ProviderID
// DraftApproval is the manifest's [draft_approval] block; nil when absent.
DraftApproval *draft.Approval
// Modes are turn.Mode values; default ["session"].
Modes []string
}
func (Def) NormalizeAll ¶
NormalizeAll normalizes inputs read back from a stored request, keeping only the declared ones.
func (Def) ProviderOrDefault ¶
func (d Def) ProviderOrDefault() unit.ProviderID
ProviderOrDefault is the provider whose units the intent's turns run on.
type Input ¶
type Pred ¶
Pred is a predicate's source and where its value starts; compiled programs live in the loader.
type RecordRules ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the set of loaded intents, read-only once built.
func NewRegistry ¶
func (*Registry) Answerable ¶
func (*Registry) ClosesWhenDone ¶
func (*Registry) DeclaringFlag ¶
func (*Registry) ForProvider ¶
func (r *Registry) ForProvider(p unit.ProviderID) []Def
ForProvider is the intents whose turns run on units of p.
func (*Registry) Names ¶
Names is "address, ask-author, nudge or review": user-facing, for messages.
func (*Registry) Rules ¶
func (r *Registry) Rules(intent string) (RecordRules, error)
Rules, Answerable, ClosesWhenDone, Reconcile and SessionTitles satisfy turns.Intents.
func (*Registry) SessionTitles ¶
SessionTitles is session.title of the user-facing intents, each once.