command

package
v0.3.30 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ACPCommand added in v0.3.29

func ACPCommand(agents []agentkit.Agent, store agentkit.SessionStore) agentkit.Command

ACPCommand exposes ACP session config control for agent/acp-remote agents.

func AgentCommand added in v0.3.29

func AgentCommand(agents []agentkit.Agent, store agentkit.SessionStore, defaultAgent agentkit.AgentID, ws workspace.Service) agentkit.Command

Command exposes the agent catalog and session or global agent switching.

func AgentHelpCommand added in v0.3.29

func AgentHelpCommand(agents []agentkit.Agent) agentkit.Command

HelpCommand exposes the agent catalog help slash command for built agent instances.

func IsAdmin added in v0.3.1

func IsAdmin(ctx context.Context) bool

IsAdmin reports whether ctx carries admin privileges for the current user.

func ModelCommand added in v0.3.29

func ModelCommand(agents []agentkit.Agent, store agentkit.SessionStore, defaultAgent agentkit.AgentID, ws workspace.Service) agentkit.Command

ModelCommand shows or sets the session or global LLM model override for coding agents.

func New

func New(cfg Config, deps 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.

func NewCatalogCommands added in v0.3.29

NewCatalogCommands registers agent/catalog-commands: /agent and /acp slash commands for the loop catalog.

func PluginHelpCommand added in v0.1.2

func PluginHelpCommand() agentkit.Command

PluginHelpCommand exposes the plugin catalog help slash command.

Types

type CatalogCommandsConfig added in v0.3.29

type CatalogCommandsConfig struct{}

type CatalogCommandsDeps added in v0.3.29

type CatalogCommandsDeps struct {
	Loop         agentkit.AgentCatalogLoop `json:"loop"`
	SessionStore agentkit.SessionStore     `json:"sessionStore"`
	Workspace    workspace.Service         `json:"workspace"`
}

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"`
	// Admins lists user IDs that may run admin-only slash commands. Matching is
	// case-insensitive. When empty, admin restrictions are not enforced.
	Admins []string `json:"admins,omitempty"`
	// AdminOnly lists command names and aliases that require an admin user when
	// Admins is non-empty.
	AdminOnly []string `json:"adminOnly,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 {
	// SessionCommands pulls session lifecycle slash commands into the build graph.
	SessionCommands agentkit.CommandProvider `json:"sessionCommands,omitempty"`
}

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) Commands added in v0.1.2

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

func (*Registry) Dispatch

func (r *Registry) Dispatch(ctx context.Context, name string, rawArgs string) (string, error)

func (*Registry) EnrichSlashContext added in v0.1.16

func (r *Registry) EnrichSlashContext(ctx context.Context) context.Context

EnrichSlashContext sets KeyIsAdmin when the current user matches Config.Admins.

func (*Registry) List

func (r *Registry) List(ctx context.Context) []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