catalog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 22 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 catalog is the action catalog: the actions a pull request's row offers, the builtin ones and the intents', derived from facts the daemon gathers.

Index

Constants

View Source
const (
	SurfaceRow          = "row"
	SurfaceDetail       = "detail"
	SurfaceTUI          = "tui"
	SurfaceMenubar      = "menubar"
	SurfaceNotification = "notification"
	SurfaceCLI          = "cli"
	SurfaceExplore      = "explore"
)

The surfaces an action spec names.

View Source
const (
	OriginBuiltin = iota
	OriginBundled
	OriginUser
)

The origins of an action spec, in the order a shared gtd verb ranks them.

View Source
const (
	BasisPending = "pending:"
	BasisHeld    = "held:"
)

BasisPending and BasisHeld prefix a run_now basis.

View Source
const (
	PlanApply   = "plan_apply"
	PlanDismiss = "plan_dismiss"
)

The ids of a plan item's own actions.

View Source
const (
	ScopeUnit  = "unit"
	ScopeItem  = "item"
	ScopeDraft = "draft"
)

The scopes of an action spec: what the action acts on.

View Source
const (
	RoleReview = "review"
	RoleAuthor = "author"
)

The workspace roles a held round resolves its intent by, as a manifest's workspace names them.

View Source
const (

	// ReasonYours disables take_over on a pull request that is the user's.
	ReasonYours = "It is yours already"
)
View Source
const SourceBuiltin = "builtin"

SourceBuiltin is the Source of an action spec Go declares.

View Source
const StartBlocked = "round blocked: "

StartBlocked prefixes the reason of a turn.start item a start block holds.

Variables

This section is empty.

Functions

func CheckPluginKeys

func CheckPluginKeys(id unit.ProviderID, ui *api.PluginUI) error

CheckPluginKeys refuses the plugin's declared keys that the core or a built-in action holds on the binding's surface, or that two of its actions share; a binding with no surface binds every surface. The error starts with the plugin id.

func DraftStates

func DraftStates(f DraftFacts) []api.ActionState

DraftStates are the draft actions in catalog order as they stand on a draft: all disabled naming the plugin when it is off.

func FirstProblem

func FirstProblem(p intentload.Problems) string

FirstProblem is the first line of the problems, sorted.

func JoinDiffers

func JoinDiffers(d dintent.Def, open, req map[string]any) string

JoinDiffers is how the open intake's inputs differ from a request's on the intent's join.differs_on, from the open intake's view: "with --self-review" or "without --self-review"; "" when they agree.

func JoinRefusalText

func JoinRefusalText(seq int64, intent, how string) string

JoinRefusalText is why open intake seq of intent refuses a request that differs from it as how says.

func Origin

func Origin(s api.ActionSpec) int

Origin is where s comes from: Go (Source "builtin"), a bundled manifest (a relative path) or a user's (an absolute path).

func PlanSpecs

func PlanSpecs() []api.ActionSpec

PlanSpecs are the actions a plan item may offer, in render order. The slice is shared: callers must not change it.

func PlanStates

func PlanStates(it api.PlanItem, row []api.ActionState) []api.ActionState

PlanStates are the actions plan item it offers now. A turn.start item a start block holds offers the row's trust_run and unblock, from row, the actions its pull request's row offers: no plan action trusts a folder.

func Rank

func Rank(s api.ActionSpec, provider unit.ProviderID) int

Rank orders the specs whose gtd verb an entry runs on a unit of provider, the lowest first: the built-in actions, then the intents of the unit's own provider, then those of any provider, a user's intent before a bundled one within each.

func ResolveRun

func ResolveRun(reg *dintent.Registry, role string) (dintent.Def, bool)

ResolveRun is run.resolve: the drives_row intent whose workspace is the role of the held round's workspace; false when none or more than one is.

func RunNowIntent

func RunNowIntent(reg *dintent.Registry, w api.Workspace, o api.Override, mine bool) (string, error)

RunNowIntent is the intent a held round runs as on a pull request with workspace w and override o, or the error that says why no single one does.

func SessionWithout

func SessionWithout(seq int64) string

SessionWithout is why a turn by hand's intake does not start without its brief.

func Specs

func Specs(l *intentload.Loaded) []api.ActionSpec

Specs are the specs in render order: the built-in round group, the intents of l, then the other built-ins. The slice is shared: callers must not change it.

func SpecsFor

func SpecsFor(l *intentload.Loaded, disabled []unit.ProviderID) []api.ActionSpec

SpecsFor are Specs of l without the actions of the disabled plugins, memoized per l and disabled set. The slice is shared: callers must not change it.

func States

func States(f Facts) []api.ActionState

States are every action the row offers now, in the order of the specs.

func UnitStates

func UnitStates(f Facts) []api.ActionState

UnitStates are the intents' actions a row of a provider other than GitHub offers now, in the order of the specs: the built-in actions act on pull requests or on the loop's rounds, which such a row has none of.

func Version

func Version(specs []api.ActionSpec) string

Version names the specs, so a client refetches them when it changes.

func VersionFor

func VersionFor(l *intentload.Loaded, disabled []unit.ProviderID) string

VersionFor is Version of SpecsFor.

func VersionOf

func VersionOf(l *intentload.Loaded) string

VersionOf is Version of the specs of l.

func WorkspaceRole

func WorkspaceRole(f RoleFacts) string

WorkspaceRole is the role of the pull request's workspace: the linked one's, else the author's for a pull request that is the user's to develop.

Types

type Asked

type Asked struct {
	Name   string
	Inputs map[string]any
}

Asked is an action a request asks for, with its inputs.

type Config

type Config struct {
	AddressReviews, AddressChecks                      bool
	FollowupsWithoutWorkspace, AddressWithoutWorkspace bool
}

Config is the configuration the action slot reads.

type DraftFacts

type DraftFacts struct {
	State    string
	Provider unit.ProviderID
	// Disabled is a draft whose plugin is off; NoPublisher one whose plugin posts nothing.
	Disabled, NoPublisher bool
	// MayHaveBeenPosted is a failed draft whose post may have reached its provider.
	MayHaveBeenPosted bool
}

DraftFacts are what a draft's actions depend on.

type Facts

type Facts struct {
	Ref pr.Ref
	Row api.Row
	// Author, Workspace and Override are the pull request's, from its row's
	// payload.
	Author    string
	Workspace api.Workspace
	Override  api.Override
	// HeldByCap is a row whose automatic round the daily cap held.
	HeldByCap bool
	Tracked   bool
	Open      bool
	Mine      bool
	Muted     bool
	// MutedStored is a mute kept in the override, active or not.
	MutedStored       bool
	Draft             bool
	CrossRepository   bool
	ReviewRequestedMe bool
	State, Base       string
	Question          bool
	// StartBlocked is a round a start block holds until the user acts.
	StartBlocked bool
	// TrustFolder is the folder whose trust lifts the start block, "" for
	// a block on another question, and TrustHomes the agent homes trusting
	// it writes in.
	TrustFolder string
	TrustHomes  []string
	// Intakes are the open intakes, the oldest first.
	Intakes         []Intake
	NudgeWho        []string
	NudgeWhy        string
	NudgeRefusal    string
	GateOn, BriefOn bool
	Forceable       string
	Config          Config
	// Asked is the action a request asks for, whose inputs an open intake
	// joins on; zero for a row served to a client.
	Asked   Asked
	Intents *intentload.Loaded
	// Recommended is the execution mode recommended for the row's items ("session", "headless"), "" none;
	// the row offers every mode's action whatever it says.
	Recommended string
}

Facts are what decides the actions a row offers; the action slot of manifest predicates reads the same values through Get.

func (Facts) Get

func (f Facts) Get(field string) any

Get resolves a fact of the action slot by its dotted name; nil for one the slot does not have.

type Intake

type Intake struct {
	api.Intake
	Action      string
	Inputs      map[string]any
	FromSession bool
}

Intake is an open intake with the action it carries, "" for a turn by hand, and its request's inputs.

type RoleFacts

type RoleFacts struct {
	ReviewWorkspace, AuthorWorkspace bool
	// Mine and Adopted tell a pull request the user opened or took over.
	Mine, Adopted bool
}

RoleFacts are what run.resolve reads of a pull request to pick the role of its held round.

Jump to

Keyboard shortcuts

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