command

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 17 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"
	// CmdStatus is the slash command that prints the current session status.
	CmdStatus = "/status"
)
View Source
const CmdList = "/list"

CmdList is the slash command that prints the worker directory.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeeBusyChecker added in v0.0.34

type BeeBusyChecker interface {
	MessageActivityChecker
	BeeExecutionActivityChecker
}

BeeBusyChecker gates bee-level engine switches.

func NewBeeBusyChecker added in v0.0.34

type BeeExecutionActivityChecker added in v0.0.34

type BeeExecutionActivityChecker interface {
	HasActiveBeeExecutions(ctx context.Context) (bool, error)
}

BeeExecutionActivityChecker reports whether active bee-owned executions exist.

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,
	svc ClearService,
	senders map[string]platform.PlatformSenderAdapter,
	runningExecs utils.RunningExecLookup,
) *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 ClearService added in v0.0.39

type ClearService interface {
	EvaluateClearSession(ctx context.Context, sessionKey string) (session.ClearSessionPreview, error)
	ClearSession(ctx context.Context, sessionKey string, preview session.ClearSessionPreview) (session.ClearSessionResult, error)
	EvaluateClearWorker(ctx context.Context, sessionKey string, w model.Worker) (session.ClearWorkerPreview, error)
	ClearWorker(ctx context.Context, sessionKey string, w model.Worker, preview session.ClearWorkerPreview) (session.ClearWorkerResult, error)
}

ClearService is the destructive-ops surface used by the /clear handler. Implemented by *session.ClearService.

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,
	beeBusy BeeBusyChecker,
	workerBusy WorkerBusyChecker,
	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 ListCommandHandler added in v0.0.37

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

ListCommandHandler handles the /list slash command.

func NewListCommandHandler added in v0.0.37

func NewListCommandHandler(workers WorkerLister, senders map[string]platform.PlatformSenderAdapter) *ListCommandHandler

func (*ListCommandHandler) HandleCommand added in v0.0.37

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

func (*ListCommandHandler) IsCommand added in v0.0.37

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

type MessageActivityChecker

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

MessageActivityChecker reports whether active platform messages exist.

type SessionContextLister added in v0.0.34

type SessionContextLister interface {
	ListActiveSessionContexts(ctx context.Context, sessionKey, beeEngine string) ([]store.SessionAgent, error)
}

SessionContextLister is shared by /status and /clear.

type StatusCommandDeps added in v0.0.39

type StatusCommandDeps struct {
	Sessions     SessionContextLister
	Tasks        TaskBySessionLister
	Workers      WorkerByIDsLookup
	Senders      map[string]platform.PlatformSenderAdapter
	EngineCfg    *enginecfg.Store
	RunningExecs utils.RunningExecLookup
}

StatusCommandDeps bundles the collaborators NewStatusCommandHandler needs.

type StatusCommandHandler added in v0.0.34

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

func NewStatusCommandHandler added in v0.0.34

func NewStatusCommandHandler(deps StatusCommandDeps) *StatusCommandHandler

func (*StatusCommandHandler) HandleCommand added in v0.0.34

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

func (*StatusCommandHandler) IsCommand added in v0.0.34

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

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,
	workers WorkerNameLookup,
	workerStop WorkerStopper,
	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 SystemConfigWriter

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

SystemConfigWriter is the subset of SystemConfigStore needed by EngineCommandHandler.

type TaskBySessionLister added in v0.0.34

type TaskBySessionLister interface {
	List(ctx context.Context, f store.TaskFilter) ([]model.Task, error)
}

TaskBySessionLister is shared by /status and /clear.

type WorkerBusyChecker added in v0.0.34

type WorkerBusyChecker interface {
	WorkerExecutionActivityChecker
	WorkerTaskActivityChecker
}

WorkerBusyChecker gates worker-level engine switches.

func NewWorkerBusyChecker added in v0.0.34

type WorkerByIDsLookup added in v0.0.37

type WorkerByIDsLookup interface {
	GetByIDs(ids []string) ([]model.Worker, error)
}

type WorkerExecutionActivityChecker added in v0.0.34

type WorkerExecutionActivityChecker interface {
	HasActiveExecutionsByWorkerID(ctx context.Context, workerID string) (bool, error)
}

WorkerExecutionActivityChecker reports whether active executions exist for a specific worker.

type WorkerLister added in v0.0.37

type WorkerLister interface {
	List() ([]model.Worker, error)
}

WorkerLister is the subset of WorkerStore needed by ListCommandHandler.

type WorkerNameLookup

type WorkerNameLookup interface {
	ListByName(name string) ([]model.Worker, error)
	GetByIDs(ids []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.

type WorkerStopper added in v0.0.42

type WorkerStopper interface {
	StopWorker(ctx context.Context, sessionKey string, w model.Worker) (session.StopWorkerResult, error)
}

WorkerStopper stops a single worker's in-flight work for a session without deleting its session context. Implemented by *session.ClearService.

type WorkerTaskActivityChecker added in v0.0.34

type WorkerTaskActivityChecker interface {
	HasActiveImmediateTasksByWorkerID(ctx context.Context, workerID string) (bool, error)
}

WorkerTaskActivityChecker reports whether active immediate tasks exist for a specific worker.

Jump to

Keyboard shortcuts

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