command

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 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"
)

Variables

This section is empty.

Functions

This section is empty.

Types

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

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 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

HandleCommand implements msgingest.CommandHandler. Returns true if content is a /engine command (whether or not it succeeded).

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 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)
	Update(w model.Worker) (model.Worker, 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