dispatch

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveOwner

func DeriveOwner(action keybindings.Action) string

DeriveOwner determines the intent owner from generated built-in metadata. Non-built-in actions have no owner.

func IsRevisionsOwner

func IsRevisionsOwner(owner string) bool

IsRevisionsOwner returns true if the owner routes to the revisions model.

Types

type Continuation

type Continuation struct {
	Key    string
	Desc   string
	Action bindings.Action
	IsLeaf bool
}

Continuation describes possible next keys while in sequence mode.

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

Dispatcher resolves key presses against active scopes and bindings.

func NewDispatcher

func NewDispatcher(availableBindings []bindings.Binding) (*Dispatcher, error)

func (*Dispatcher) ResetSequence

func (d *Dispatcher) ResetSequence()

func (*Dispatcher) Resolve

func (d *Dispatcher) Resolve(msg tea.KeyMsg, scopes []bindings.Scope) ResolveResult

Resolve applies dispatch rules for a key in the provided scope chain. Scopes must be ordered from innermost to outermost.

type IntentOverride

type IntentOverride func(action keybindings.Action, args map[string]any) (intents.Intent, bool)

IntentOverride lets the caller (e.g. active operation) override the default action-to-intent mapping.

type ResolveResult

type ResolveResult struct {
	Action        bindings.Action
	Scope         bindings.Scope
	Args          map[string]any
	Pending       bool
	Consumed      bool
	Continuations []Continuation
}

ResolveResult is the outcome of resolving a key press.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver wraps a Dispatcher and extends the pipeline to resolve keys all the way to intents and owners.

func NewResolver

func NewResolver(d *Dispatcher, configured map[keybindings.Action]config.ActionConfig) *Resolver

NewResolver creates a Resolver that wraps the given dispatcher.

func (*Resolver) ResetSequence

func (r *Resolver) ResetSequence()

ResetSequence resets any in-progress key sequence.

func (*Resolver) ResolveAction

func (r *Resolver) ResolveAction(action keybindings.Action, args map[string]any, override IntentOverride) Result

ResolveAction resolves a dispatched action through configured-action aliasing and intent resolution.

func (*Resolver) ResolveBuiltInAction

func (r *Resolver) ResolveBuiltInAction(action keybindings.Action, args map[string]any, override IntentOverride) Result

ResolveBuiltInAction resolves an action while skipping configured Lua overrides.

func (*Resolver) ResolveKey

func (r *Resolver) ResolveKey(msg tea.KeyMsg, scopes []keybindings.Scope, override IntentOverride) Result

ResolveKey resolves a key press through the full pipeline: key → binding → action → intent.

type Result

type Result struct {
	Intent        intents.Intent
	Owner         string
	Args          map[string]any
	LuaScript     string
	Pending       bool
	Consumed      bool
	Continuations []Continuation
}

Result is the outcome of full dispatch resolution.

Jump to

Keyboard shortcuts

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