Documentation
¶
Overview ¶
Package builtin is the Go vocabulary manifests name: builtins by slot, reserved names and keys, and the facts predicates read. The implementations live in internal/cli and internal/daemon and register at wiring.
Index ¶
- Constants
- Variables
- func ApprovalEnv(auto bool, slots ...string) expr.Env
- func ApprovalRule(when string, a draft.Approval, env expr.Env) (draft.Rule, error)
- func BoardOf(workspace string) string
- func DynamicFacts(src string) []string
- func EffectNames() []string
- func EnumProblem(v string, values []Value) (msg, near string)
- func Env(slot FactSlot, inputs []dintent.Input) expr.Env
- func ExtraFacts(props []jsonschema.Property) expr.Env
- func FactProvider(name string) unit.ProviderID
- func FactType(name string) (expr.Type, bool)
- func IsPredKey(last string) bool
- func IsUntrusted(name string) bool
- func Narrow(env expr.Env, providers []unit.ProviderID)
- func NeverReleasesComment(r draft.Rule) bool
- func OrList(names []string) string
- func PREnv() expr.Env
- func RoleNames() []string
- func StepArgs(use string) []string
- func TimeVarying(name string) bool
- func TurnEffectNames() []string
- func UnitSlots() []string
- func ValueNames(values []Value) []string
- func WithdrawEnv(slot string) expr.Env
- func WorkflowEnv(slot string) expr.Env
- func WorkflowEnvAll() expr.Env
- type Applies
- type Effect
- type Fact
- type FactSlot
- type Key
- type Kind
- type Mark
- type Problem
- type Role
- type Slot
- type StepDef
- type SubjectsError
- type Surface
- type UntrustedError
- type Value
Constants ¶
const ( WorkspaceReview = "review" WorkspaceAuthor = "author" )
The workspaces of a round on someone else's pull request and on one you develop.
const ( EffectPlanCleared = "plan.cleared" EffectGuidanceHanded = "guidance.handed" EffectPRRoundSent = "pr.round_sent" EffectPRReviewed = "pr.reviewed" EffectPRAddressed = "pr.addressed" EffectEntryNudged = "entry.nudged" EffectUnitClosed = "unit.closed" EffectPRNudged = "pr.nudged" )
The effects code applies by name.
const ( DraftPurpose = "draft.purpose" DraftEffects = "draft.effects" )
DraftPurpose and DraftEffects are the approval facts an intent's rules may not read: a turn's agent names its drafts' purpose and effects.
const ( RoleReview = "pr.review" RoleAddress = "pr.address" RoleNudge = "pr.nudge" RoleProbe = "probe" RoleHeadless = "headless" )
The roles Go resolves an intent by (Registry.ByRole).
const ( RoundKindReview = "review" RoundKindAddress = "address" )
The round kinds a role binds: a review round, first or follow-up by the step's stage, and an address round.
const ( PolicyRound = "round" PolicyProbe = "probe" )
The agent policies a role binds: a round's, and the probe's.
const ( ContextPR = "pr" ContextSynthetic = "synthetic" )
The contexts a role binds: a real pull request, and a made-up one.
const ( StepTurnDismiss = "turn.dismiss" StepAnswerRefuse = "answer.refuse" StepClassify = "classify" StepNotifySelf = "notify.self" )
The steps whose arguments the grammar names.
const BriefSlot = "brief"
BriefSlot is the slot of the facts of a unit's brief.
const BuildsBrief = "brief"
BuildsBrief is what the brief intent builds.
const ClassifyPrefix = "classify."
ClassifyPrefix names a classify step's output as a fact.
const CommentForm = `draft.delivery == "comment" as a term of the top-level &&`
CommentForm is how a rule names comment delivery.
const DraftDelivery = "draft.delivery"
DraftDelivery is the approval fact a rule must pin to "comment" to release a comment draft.
const DraftSlot = "draft"
DraftSlot is the slot of the facts a workflow's [withdraw] when reads of each draft it proposed.
const ExtraPrefix = "brief.extra."
ExtraPrefix names a brief's extra field as a fact.
const GroupStart = "start"
GroupStart is the action group of the actions that start or continue a unit's turn, the intents' default.
const LaunchProbe = "probe"
LaunchProbe is the launch of a probe: a synthetic pull request in the workspace the request names.
const PrepareNudge = "nudge.prepare"
PrepareNudge is the prepare that fills a nudge's inputs or refuses it.
const ReconcileMyReview = "my_review"
ReconcileMyReview reconciles a review turn with the review the viewer published.
const StepDraftPropose = "draft.propose"
StepDraftPropose is the step that proposes a draft in the Outbox.
const StepTurnStart = "turn.start"
StepTurnStart is the step that starts an agent turn: its reach is its intent's.
const WorkspaceLinkedElseMain = "linked_else_main"
WorkspaceLinkedElseMain runs a turn in the workspace linked to its unit, else in the repository's main checkout.
Variables ¶
var ( EntryKinds = []string{string(gtd.KindAction), string(gtd.KindWaiting), string(gtd.KindClose), string(gtd.KindMessage), string(gtd.KindDraft), string(gtd.KindCapture), string(gtd.KindProject), string(gtd.KindReference)} EntryStates = []string{string(gtd.Inbox), string(gtd.Next), string(gtd.Waiting), string(gtd.Scheduled), string(gtd.Someday), string(gtd.Reference), string(gtd.Done), string(gtd.Trash)} )
EntryKinds and EntryStates are a GTD entry's kinds and states.
var ( DraftDeliveries = []string{"message", "reaction", "comment"} // DraftEmojiDeliveries are the deliveries that post an emoji, which // need the reaction argument, and no text. DraftEmojiDeliveries = []string{"reaction"} DraftItems = []string{"owed", "resolved", "unowned", "unowned_aged", "all"} DraftPer = []string{"unit", "person"} DraftTargets = []string{"unit", "item"} // RepeatForever is repeat_after_sent's value that never proposes again // after a draft was sent. RepeatForever = "forever" )
The values of draft.propose's arguments.
var ActionFacts = slices.Concat(rowActionFacts, draftActionFacts)
ActionFacts are the facts only the action slot reads, what a row offers decides on them, then the draft actions' facts.
var ActionGroups = []string{GroupStart, "turn", "control", "workspace", "brief", "intake"}
ActionGroups are the groups an action is listed under.
var ActionKeys = map[string]string{
"open": "O",
"take_over": "A",
"skip": "S",
"pause": "H",
"resume": "H",
"run_now": "R",
"mute": "M",
"unmute": "M",
"answer": "W",
"continue": "C",
"dismiss": "X",
"guide": "G",
"trust_run": "T",
"unblock": "D",
}
ActionKeys are the keys of the built-in actions, by id; internal/keys holds the rule they follow.
var ActionSurfaces = []string{"row", "detail", "tui", "menubar", "notification", "cli", "explore"}
ActionSurfaces are where an action may be offered.
var Associations = []string{"OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "NONE"}
Associations are GitHub's author associations.
var AutoOnly = []string{DraftPurpose, DraftEffects}
AutoOnly are the approval facts only a workflow's rules and the configuration's read.
var Boards = []string{"review", "author"}
Boards are the workspaces whose board an intent's turns move: a turn in the review or the author workspace moves that board, any other none.
var BriefSubjects = []string{"pr", "slack", "entry"}
BriefSubjects are the workflow slots whose units may have a brief, which read the brief slot's facts.
var Builds = []string{BuildsBrief}
Builds are what a builder intent may build.
var BuiltinActionIDs = []string{
"run_now", "skip", "guide", "trust_run", "unblock",
"answer", "continue", "dismiss",
"take_over", "pause", "resume", "mute", "unmute", "track", "untrack",
"open", "remove", "remove_force",
"brief_refresh", "intake_without", "intake_cancel",
"draft.approve", "draft.edit", "draft.discard", "draft.retry",
"plan_apply", "plan_dismiss", "plan_guide",
}
BuiltinActionIDs are the built-in actions actions.toml words, one table each: a row's, a draft's and a plan item's. plan_guide is the plan item's guide, whose wire id is guide.
var ConfigTiers = cfgValues("fast", "balanced", "frontier")
ConfigTiers are the model tiers a configured call takes, the set core/turns.Tiers holds.
var DraftRefusals = []string{"", "plugin_off", "state", "posts_nothing"}
DraftRefusals are why a draft's action is disabled: its plugin is off, the draft is in a state the action does not move it from, or its plugin posts nothing.
var Effects = []Effect{ {EffectPlanCleared, "", AppliesTurn, "Drops the unit's pending plan items.", false}, {EffectGuidanceHanded, unit.GitHub, AppliesTurn, "Hands the guidance queued on the pull request to the turn, and queues it back when the turn is not sent.", false}, {EffectPRRoundSent, unit.GitHub, AppliesTurn, "Records the round-sent event on the pull request.", false}, {EffectPRReviewed, unit.GitHub, AppliesTurn, "Writes the plugin mark reviewed: the reviews the round covered, once its review is submitted.", false}, {EffectPRAddressed, unit.GitHub, AppliesTurn, "Writes the plugin marks addressed.*: the reviews, checks and conflict the address round covered.", false}, {EffectEntryNudged, "", AppliesDraft, "Stamps the last nudge of the draft's entry, or of every live waiting entry of its unit when it names none.", false}, {EffectUnitClosed, "", AppliesDraft, "Records the closure of the draft's unit, which ends its close entry and unwatches it after its warm period; through the unit's plugin.", true}, {EffectPRNudged, unit.GitHub, AppliesTurn | AppliesDraft, "Records the nudged event on the pull request, which the nudge refusal reads: when its turn is sent, or as the GitHub publisher posts its draft.", false}, }
Effects is the effect vocabulary of turns and drafts.
var ErrRuleMarks = errors.New("a rule reads no marks: handled() is for a workflow's when")
ErrRuleMarks refuses a rule's when that calls handled().
var Facts = slices.Concat(intentPRFacts, ActionFacts, otherFacts)
Facts are the fields predicates read, by slot; inputs.<name> are added per intent by Env. A workflow fact may share a name with an intent fact.
var Grammar = slices.Concat(intentGrammar, workflowGrammar, stepGrammar, actionsGrammar, configGrammar, profileGrammar)
Grammar is every reserved key of the language.
var InputTypes = map[string]expr.Type{"bool": expr.Bool, "text": expr.String, "list": expr.List}
InputTypes are the types an input declares, with the type its fact has.
var IntentDims = []string{dintent.DimStage, dintent.DimReviewer}
IntentDims are the profile dimensions a manifest's dims may list.
var IntentVerbs = []string{string(gtd.VerbApprove), string(gtd.VerbDelegate), string(gtd.VerbDismiss)}
IntentVerbs are the gtd verbs a manifest's verb may name: those an entry bridges to its unit's served action.
var Marks = []Mark{ {round.AddressedReviews, "The newest review an address round triaged on a pull request you develop, a time: handled(\"addressed.reviews\", <time>)."}, {round.AddressedChecks, "The head whose failing checks an address round covered: handled(\"addressed.checks\", pr.head)."}, {round.AddressedConflict, "The head whose conflict with the base an address round covered: handled(\"addressed.conflict\", pr.head)."}, }
Marks are the plugins' marks a workflow may read. reviewed is not one: its value is a fingerprint no fact has.
var Names = map[Slot][]string{ SlotWorkspace: {WorkspaceReview, WorkspaceAuthor, WorkspaceLinkedElseMain, "given"}, SlotBefore: {"take_over"}, }
Names are the builtins a manifest names, by the key that names them.
var NoRole = Role{Context: ContextPR, Policy: PolicyRound}
NoRole is what an intent without a role binds.
var PRRowKinds = []string{"round_pending", "loop_waiting", "loop_stopped", "blocked", "to_address", "held", "loop_working",
"changes", "checks", "conflicts", "reply", "reviewer_back", "review", "no_reviewer", "merge", "draft", "muted", "done"}
PRRowKinds are a pull request row's situation kinds, as the cockpit ranks them.
var PRStates = []string{"OPEN", "CLOSED", "MERGED"}
PRStates are a pull request's states as GitHub spells them.
var PayloadProviders = map[string]unit.ProviderID{"PR": unit.GitHub}
PayloadProviders are the template roots a provider's payload alone holds, which only an intent of that provider may read.
Providers are the providers an intent may serve: those of Slots, and a plugin whose units have no workflow facts adds its own.
var RecordStates = []string{string(record.Done), string(record.Settled), string(record.Asked), string(record.Failed)}
RecordStates are the states a manifest's record.states may list.
var ReservedFlags = []string{"--no-wait", "--no-brief", "--turn", "--help"}
ReservedFlags are flags the CLI owns; no input may declare them.
var ReservedNames = []string{
"app", "brief", "config", "doctor", "eval-instructions", "explore", "help", "hook", "init", "install",
"instructions", "intake", "mute", "open", "outbox", "pause", "plan", "profile", "remove", "resume",
"serve", "slack", "status", "store", "take-over", "timings", "track", "trust", "tui", "turn", "uninstall", "unmute", "untrack",
"version", "workflows",
"answer", "brief_refresh", "continue", "dismiss", "guide", "intake_cancel", "intake_without", "remove_force", "skip",
"plan_apply", "plan_dismiss", "run_now", "take_over", "trust_run", "unblock",
"eval", "intents", "settings", "tags", "try",
"association", "base", "kind", "label", "organization", "repo", "reviewer", "risk", "size", "stage", "team", "user",
}
ReservedNames are names a user intent may not take: CLI commands, built-in action ids, profile words, dimensions. The loader checks them against user layers only.
var ReviewStates = []string{"", "APPROVED", "CHANGES_REQUESTED", "COMMENTED", "DISMISSED", "PENDING"}
ReviewStates are GitHub's review states, and the empty value of no review.
var Roles = []Role{ {Name: RoleReview, Doc: "The review round on someone else's pull request, in its review workspace: first or follow-up, reconciled with the review you published; it drives its workspace's row.", Provider: unit.GitHub, RoundKind: RoundKindReview, Reconcile: ReconcileMyReview, Workspace: WorkspaceReview, Context: ContextPR, Policy: PolicyRound, DrivesRow: true}, {Name: RoleAddress, Doc: "The address round on a pull request you develop, in its author workspace: its reviews, failing checks and conflicts; its instructions say why it is due; it drives its workspace's row.", Provider: unit.GitHub, RoundKind: RoundKindAddress, Workspace: WorkspaceAuthor, Context: ContextPR, Policy: PolicyRound, DrivesRow: true}, {Name: RoleNudge, Doc: "The nudge on a pull request: nudge.prepare fills its inputs from who the pull request waits on, or refuses it.", Provider: unit.GitHub, Prepare: PrepareNudge, Context: ContextPR, Policy: PolicyRound}, {Name: RoleProbe, Doc: "The probe of an agent home: a synthetic pull request in the workspace the request names, under the probe's policy.", Provider: unit.GitHub, Launch: LaunchProbe, Context: ContextSynthetic, Policy: PolicyProbe}, {Name: RoleHeadless, Doc: "The intent a headless turn on a unit runs when its request names none.", Context: ContextPR, Policy: PolicyRound}, }
Roles are what Go resolves an intent by, a manifest's role.
var RoundProviders = []unit.ProviderID{unit.GitHub}
RoundProviders are the providers whose plugin keeps a per-unit count of turns: every automated turn.start on their units spends turns.per_unit_per_day; a workflow starting turns on any other must set limits.per_day.
var Slots = map[unit.ProviderID]string{unit.GitHub: "pr", unit.Session: "session", unit.Workspace: "workspace", unit.Entry: "entry", dslack.Provider: "slack"}
Slots name each provider's fact slot.
var Stages = []string{"first", "follow-up"}
Stages are the passes over a unit: the first, and each one after.
var Steps = []StepDef{ {"session.close", providers(unit.Session), workflow.ReachLocal, nil, "Closes the agent session."}, {"workspace.remove", providers(unit.Workspace), workflow.ReachLocal, nil, "Removes the workspace, after its guards. Never with `force`: a manifest that sets it fails to load."}, {"workspace.unregister", providers(unit.Workspace), workflow.ReachLocal, nil, "Unregisters a workspace whose path is gone."}, {StepTurnDismiss, providers(unit.Session, unit.GitHub), workflow.ReachLocal, nil, "Dismisses the open turn, recording the reason."}, {StepAnswerRefuse, providers(unit.GitHub), workflow.ReachLocal, nil, "Refuses a queued answer whose route is gone."}, {"session.mark_dormant", providers(unit.Session), workflow.ReachLocal, nil, "Marks dormant an active session whose process its manager's census no longer lists: the session stays open, and the next turn wakes it."}, {StepTurnStart, nil, "", nil, "Starts a turn of `intent` on the unit, which the intent must serve; `stage` (`first` or `follow-up`) for a review; `runner` (`session` or `headless`), by default the intent's first runner. On a pull request, caps, the brief, busy and held checks apply as for any automatic round; on any other unit, the workflow's `limits.per_day` and `turns.per_day`."}, {StepDraftPropose, nil, workflow.ReachLocal, nil, "Proposes a draft in the Outbox: `purpose` (a label), `delivery` (`message`, `reaction` or `comment`), `text` (a template in the workflow's directory, by default `text.md.tmpl`), `reaction` (an emoji name), `items` (`owed`, `resolved`, `unowned`, `unowned_aged` or `all`), `per` (`unit` or `person`), `target` (`unit` or `item`), `effects` (the effects sending it applies), `repeat_after` (the least time after a settled draft of the same person, a duration or a duration of the config such as `config.drafts.repeat_after`) and `repeat_after_sent` (the same after a sent one, or `forever`). Holds while a draft of the workflow, unit and person is open or failed; a run that leaves a person under a delay that ends with time stays pending until it ends."}, {StepClassify, nil, workflow.ReachLocal, []workflow.TriggerKind{workflow.TriggerEvent}, "A headless classification whose output becomes facts: `prompt` (a file in the workflow's directory, by default `prompt.md`) and `schema` (the JSON schema its answer follows, by default `schema.json`). Event triggers only, cached by fingerprint, under `classify.per_day`."}, {StepNotifySelf, nil, workflow.ReachPrivate, nil, "A private notification: `text` (a template in the workflow's directory, by default `text.md.tmpl`, over `.Workflow`, `.Unit` and `.Facts`, the unit's facts by name, such as `{{index .Facts \"pr.slug\"}}`, none once the unit is gone)."}, }
Steps is the step vocabulary of workflow manifests.
var TurnRunners = []string{"session", "headless"}
TurnRunners are the values of turn.start's runner.
var TurnStates = []string{"", string(dturn.Sent), string(dturn.Started), string(dturn.Asked), string(dturn.Done), string(dturn.Settled), string(dturn.Failed), string(dturn.Unrecorded), string(dturn.Dismissed), string(dturn.Replaced), string(dturn.Withdrawn)}
TurnStates are the states a turn is in, and the empty value of none.
var Visibilities = []string{"public", "private", "internal"}
Visibilities are a repository's visibilities, lowercased as the GitHub adapter reads them.
var WorkflowSlots = []string{"pr", "session", "workspace", "entry", "slack", "brief", "draft", "trigger", "config"}
WorkflowSlots are the slots of workflow facts: each provider's, then the brief's, the draft's, the trigger's and the config's.
Functions ¶
func ApprovalEnv ¶ added in v0.2.0
ApprovalEnv is the env of a [drafts.approval] rule's when: the approval slot's facts, without AutoOnly unless auto, and the facts of each of slots, never a brief's, which an agent writes.
func ApprovalRule ¶ added in v0.2.0
ApprovalRule is the [drafts.approval] rule of a whose when is compiled over env. It names comment delivery when its top-level conjunction holds draft.delivery == "comment", the only way a rule releases a comment.
func DynamicFacts ¶ added in v0.2.0
DynamicFacts are the brief.extra.* and classify.* facts src names outside its string literals: facts the profile declares, untrusted whatever their name, which a check without the profile cannot type.
func EffectNames ¶ added in v0.2.0
func EffectNames() []string
EffectNames are the names of the draft effects: what a draft's effects, a draft.propose's effects and an intent's allowed_effects list.
func EnumProblem ¶ added in v0.2.0
EnumProblem says why v is none of values, "" when it is one: the values and the near one, never a value that releases, which a guess must not turn a typo into.
func ExtraFacts ¶ added in v0.2.0
func ExtraFacts(props []jsonschema.Property) expr.Env
ExtraFacts are the brief.extra.<name> facts the brief intent's extra schema declares, typed from its properties: a string (with or without an enum), an integer, a boolean or an array of strings, the types the loader lets a builder's schema hold. A predicate's env is extended with them at load, so naming an undeclared extra fails there.
func FactProvider ¶
func FactProvider(name string) unit.ProviderID
FactProvider is the provider whose units an intent fact describes; "" for a fact of every provider, or a name that is no intent fact.
func IsPredKey ¶ added in v0.2.0
IsPredKey says whether a key named last holds a predicate somewhere in the language, so a value written without quotes gets the quoting hint.
func IsUntrusted ¶ added in v0.2.0
IsUntrusted says whether a rule may not trust the fact name: an agent or a third party sets its value. A brief's extra fields and a classification's output are untrusted whatever their name.
func Narrow ¶ added in v0.2.0
func Narrow(env expr.Env, providers []unit.ProviderID)
Narrow closes, in env, each fact whose values are declared per provider to the values of providers: their union when each of them declares a set, and any value when one does not or providers is empty.
func NeverReleasesComment ¶ added in v0.2.0
NeverReleasesComment says that r releases, reads draft.delivery and pins it to no delivery, yet does not name comment delivery: a form such as draft.delivery in ["comment"] reads as one that may release a comment, and never does.
func PREnv ¶
PREnv is the pull request's own facts of the turn slot, the ones a turn reads before it is built.
func TimeVarying ¶ added in v0.2.0
TimeVarying says whether the workflow fact name changes as time passes with nothing else changing; false for a name that is no workflow fact.
func TurnEffectNames ¶ added in v0.2.0
func TurnEffectNames() []string
TurnEffectNames are the names of the turn effects: what an intent's effects list.
func UnitSlots ¶ added in v0.2.0
func UnitSlots() []string
UnitSlots are the workflow slots of every provider's units.
func ValueNames ¶ added in v0.2.0
ValueNames are the names of values.
func WithdrawEnv ¶ added in v0.2.0
WithdrawEnv is the env of a workflow's [withdraw] when: WorkflowEnv(slot) and the draft slot's facts.
func WorkflowEnv ¶
WorkflowEnv is the env of a workflow's when: the facts of slot, the brief's when slot is one of BriefSubjects, trigger.* and config.*.
func WorkflowEnvAll ¶
WorkflowEnvAll is WorkflowEnv over every slot, for a predicate whose workflow is not known yet.
Types ¶
type Applies ¶ added in v0.2.0
type Applies int
Applies says what an effect applies on: a sent turn (an intent's effects) or a sent draft (a draft.propose's effects and an intent's [drafts] allowed_effects).
type Effect ¶ added in v0.2.0
type Effect struct {
Name string
// Provider is the provider whose turns or drafts alone may name it; ""
// any.
Provider unit.ProviderID
Applies Applies
Doc string
// Plugin says a draft effect applies through the unit's plugin, so it
// waits while that plugin is not built.
Plugin bool
}
Effect is what sending a turn or a draft applies, by name.
type Fact ¶
type Fact struct {
Name string
Type expr.Type
Slots []FactSlot
Doc string
Slot string // a workflow fact's slot: one of WorkflowSlots
// Provider is the provider whose intents alone may read the fact; "" for every provider.
Provider unit.ProviderID
// Subjects are the workflow slots besides Slot whose when reads the
// fact: the brief slot's facts are read on every unit that has a brief.
Subjects []string
// Dim makes the fact a profile dimension: a block path condition under
// the intents of its provider.
Dim bool
// Enum are the fact's values by provider, "" standing for every
// provider; a provider absent takes any value.
Enum map[unit.ProviderID][]string
// Untrusted says that a third party's text, read by the extraction, the
// proposing turn itself or an agent's brief sets the fact's value, so
// no [drafts.approval] rule may read it.
Untrusted bool
// TimeVarying says that the fact changes as time passes with nothing
// else changing, so no workflow key may hold it.
TimeVarying bool
}
type FactSlot ¶
type FactSlot string
const DraftActionSlot FactSlot = "draft_action"
DraftActionSlot holds the facts the texts of a draft's built-in actions read.
type Key ¶ added in v0.2.0
type Key struct {
Path string
In Surface
// Step is the step whose argument the key is, for In == SurfaceStep.
Step string
Kind Kind
// Elem is a list's element kind, for Kind == KindList.
Elem Kind
// Values are an enum's values, from the table that owns the set.
Values func() []Value
Default string
Doc string
// Required says that the table holding the key must set it.
Required bool
}
Key is one reserved key of the language. Path is dotted, "[]" marks an array of tables and "*" a name the author chooses: "action.refuse[].why", "inputs.*.type", "workflows.*.approval.mode".
type Kind ¶ added in v0.2.0
type Kind int
Kind is what a key's value is.
const ( KindPred Kind = iota + 1 // a predicate's source KindFact // a fact's name KindTemplate // an inline text/template KindFile // a file beside the manifest KindEnum // one of Values KindDur // a duration (internal/domain/duration) KindBool KindInt KindText KindList // a list of Elem KindTable KindMap // a table whose keys an author names KindAny // more than one form, which its decoder reads KindNumber // an integer or a decimal )
type Mark ¶ added in v0.2.0
type Mark struct {
Name, Doc string
}
Mark is a mark a plugin writes that a workflow may read with handled().
type Problem ¶ added in v0.2.0
type Problem struct {
Path string
Msg string
// Near is the value or key the message suggests, "" when none.
Near string
// Unknown says that no row names the key.
Unknown bool
}
Problem is a key Check refuses, at its dotted path in the document.
type Role ¶ added in v0.2.0
type Role struct {
Name string
Doc string
// Provider is the provider whose units the role's turns run on; "" any.
Provider unit.ProviderID
// RoundKind is the sweep round its turns are; "" none.
RoundKind string
// Reconcile, Prepare, Launch: builtins its turns run; "" none.
Reconcile, Prepare, Launch string
// Workspace is the workspace builtin its holder names; "" any.
Workspace string
// Context is what its turn is about; Policy the agent policy of its
// sessions.
Context, Policy string
// DrivesRow says its turns drive the row of the workspace they run in;
// a user intent taking the role takes it over.
DrivesRow bool
}
Role is what an intent's role binds it to: the plugin mechanism Go runs its turns with.
type StepDef ¶
type StepDef struct {
Name string
Providers []unit.ProviderID // empty means any
Reach workflow.Reach // "" for turn.start: the intent decides
Trigger []workflow.TriggerKind // empty means any
Doc string
}
StepDef is a workflow step the engine can run: the providers whose units it acts on, its reach, the triggers it runs under and what it does. Its arguments are its rows of the grammar (StepArgs).
type SubjectsError ¶ added in v0.2.0
type SubjectsError struct{ Subjects []string }
SubjectsError refuses a rule's when that reads the facts of two subjects, which no draft has.
func (*SubjectsError) Error ¶ added in v0.2.0
func (e *SubjectsError) Error() string
type Surface ¶ added in v0.2.0
type Surface string
Surface is a file kind of the profile language, or the configuration.
const ( SurfaceIntent Surface = "intent" // intents/<name>/intent.toml SurfaceWorkflow Surface = "workflow" // workflows/<name>/workflow.toml SurfaceStep Surface = "step" // a workflow step's arguments SurfaceActions Surface = "actions" // actions.toml SurfaceDefaults Surface = "defaults" // defaults.toml SurfaceLabels Surface = "labels" // labels.toml SurfaceBlock Surface = "block" // a judgment block's front matter SurfaceConfig Surface = "config" // config.json )
type UntrustedError ¶ added in v0.2.0
type UntrustedError struct{ Fact string }
UntrustedError refuses a rule's when that reads an untrusted fact.
func (*UntrustedError) Error ¶ added in v0.2.0
func (e *UntrustedError) Error() string
type Value ¶ added in v0.2.0
type Value struct {
Name string
Doc string
// Releases says that the value lets a send or a run go with no person
// approving it, which no did-you-mean suggests.
Releases bool
}
Value is one value of an enum key.
func DraftModes ¶ added in v0.2.0
func DraftModes() []Value
DraftModes are the draft approval's modes, from draft.ApprovalModes.
func NameValues ¶ added in v0.2.0
NameValues are the builtins of slot, with what each is.
func RunModes ¶ added in v0.2.0
func RunModes() []Value
RunModes are the run approval's modes, from workflow.ApprovalModes.
func StepValuesOf ¶ added in v0.2.0
StepValuesOf are the values of step use's enum argument arg.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
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. |
|
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. |