command

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 14 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

Index

Constants

View Source
const (
	// CmdEngine is the slash command that switches engines.
	CmdEngine = "/engine"
	// CmdClear is the slash command that clears session contexts.
	CmdClear = "/clear"
	// CmdStop is the slash command that stops the running bee and cancels pending messages.
	CmdStop = "/stop"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BeeStopper added in v0.0.31

type BeeStopper interface {
	StopSession(sessionKey string) bool
}

type ClearCommandHandler

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

func NewClearCommandHandler

func NewClearCommandHandler(
	workers WorkerNameLookup,
	sessions ClearSessionStore,
	tasks ClearTaskStore,
	execStopper ClearExecStopper,
	sessionClear ClearSessionDispatcher,
	senders map[string]platform.PlatformSenderAdapter,
	engineCfg *enginecfg.Store,
) *ClearCommandHandler

func (*ClearCommandHandler) HandleCommand

func (h *ClearCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool

func (*ClearCommandHandler) IsCommand added in v0.0.29

func (h *ClearCommandHandler) IsCommand(content string) bool

type ClearExecStopper

type ClearExecStopper interface {
	StopExecution(executionID string) error
}

type ClearSessionDispatcher

type ClearSessionDispatcher interface {
	ClearSession(sessionKey string)
}

type ClearSessionStore

type ClearSessionStore interface {
	ListActiveSessionContexts(ctx context.Context, sessionKey, beeEngine string) ([]store.SessionAgent, error)
	DeleteSessionContextForEngine(ctx context.Context, sessionKey, agentID, engine string) (bool, error)
}

type ClearTaskStore

type ClearTaskStore interface {
	ListBySessionKey(ctx context.Context, sessionKey, status, taskType string) ([]model.Task, error)
	CancelBySessionKey(ctx context.Context, sessionKey, taskType string) (int64, error)
}

type EngineCommandHandler

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

EngineCommandHandler handles the /engine slash command.

func NewEngineCommandHandler

func NewEngineCommandHandler(
	workers WorkerRepository,
	sysCfg SystemConfigWriter,
	senders map[string]platform.PlatformSenderAdapter,
	validator EngineValidator,
	busy SystemBusyChecker,
	engineCfg *enginecfg.Store,
) *EngineCommandHandler

func (*EngineCommandHandler) HandleCommand

func (h *EngineCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool

func (*EngineCommandHandler) IsCommand added in v0.0.29

func (h *EngineCommandHandler) IsCommand(content string) bool

type EngineValidator

type EngineValidator interface {
	ValidateEngine(name string) error
	EnabledEngines() []string
}

EngineValidator validates engine names against the set of enabled engines.

type ExecutionActivityChecker

type ExecutionActivityChecker interface {
	HasActiveExecutions(ctx context.Context) (bool, error)
}

ExecutionActivityChecker reports whether active executions exist.

type MessageActivityChecker

type MessageActivityChecker interface {
	HasActiveMessages(ctx context.Context) (bool, error)
}

MessageActivityChecker reports whether active platform messages exist.

type StopCommandHandler added in v0.0.31

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

func NewStopCommandHandler added in v0.0.31

func NewStopCommandHandler(
	feeder BeeStopper,
	msgs StopMessageStore,
	senders map[string]platform.PlatformSenderAdapter,
) *StopCommandHandler

func (*StopCommandHandler) HandleCommand added in v0.0.31

func (h *StopCommandHandler) HandleCommand(ctx context.Context, content string, replyTo platform.InboundMessage) bool

func (*StopCommandHandler) IsCommand added in v0.0.31

func (h *StopCommandHandler) IsCommand(content string) bool

type StopMessageStore added in v0.0.31

type StopMessageStore interface {
	FailReceived(ctx context.Context, sessionKey string) ([]string, error)
}

type SystemBusyChecker

SystemBusyChecker composes the activity checks that block engine switching while the system has in-flight work.

type SystemConfigWriter

type SystemConfigWriter interface {
	Set(ctx context.Context, key, value string) error
}

SystemConfigWriter is the subset of SystemConfigStore needed by EngineCommandHandler.

type TaskActivityChecker

type TaskActivityChecker interface {
	HasActiveImmediateTasks(ctx context.Context) (bool, error)
}

TaskActivityChecker reports whether active immediate tasks exist.

type WorkerNameLookup

type WorkerNameLookup interface {
	ListByName(name string) ([]model.Worker, error)
}

type WorkerRepository

type WorkerRepository interface {
	GetByName(name string) (model.Worker, error)
	UpdateEngine(id, engine string) error
}

WorkerRepository is the subset of WorkerStore needed by EngineCommandHandler.

Jump to

Keyboard shortcuts

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