command

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, _ Deps) (agentkit.Commands, error)

New registers commands/registry: Aggregate slash commands contributed by CommandProvider plugins.

Best practices:

  • Providers are discovered from the built graph, so a command appears as soon as its plugin is wired in.

Types

type Config

type Config struct {
	// Allow exposes only these command names; empty means all.
	Allow []string `json:"allow,omitempty"`
	// Deny hides these command names; applied after Allow.
	Deny []string `json:"deny,omitempty"`
}

Config controls which contributed commands are exposed. Allow and Deny match command names and aliases case-insensitively. When Allow is empty, every command is eligible unless denied. When Allow is non-empty, only listed commands are registered.

type Deps

type Deps struct{}

type Registry

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

Registry collects slash commands contributed by built plugins.

func NewFromProviders

func NewFromProviders(cfg Config, providers []agentkit.CommandProvider) (*Registry, error)

NewFromProviders builds a registry from explicit command providers.

func (*Registry) Dispatch

func (r *Registry) Dispatch(ctx context.Context, name string, args []string) (*agentkit.CommandResult, error)

func (*Registry) List

func (r *Registry) List() []agentkit.Command

func (*Registry) SetCommands

func (r *Registry) SetCommands(providers []agentkit.CommandProvider) error

SetCommands registers commands from every built CommandProvider.

Jump to

Keyboard shortcuts

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