Documentation
¶
Index ¶
- Constants
- type DisconnectExecutor
- type Executor
- type ProgressEmitter
- func (e *ProgressEmitter) Complete(message string) error
- func (e *ProgressEmitter) Emit(title string) error
- func (e *ProgressEmitter) Error(stepIndex int, message string) error
- func (e *ProgressEmitter) GetSteps() []ProgressStep
- func (e *ProgressEmitter) Running(stepIndex int) error
- func (e *ProgressEmitter) Start(title string) error
- func (e *ProgressEmitter) Success(stepIndex int, message string) error
- func (e *ProgressEmitter) UpdateStep(stepIndex int, status, message string) error
- type ProgressStep
- type Registry
- type Request
- type ResetExecutor
- type Result
Constants ¶
const ( // CommandReset represents the /reset command CommandReset = "/reset" // CommandDisconnect represents the /dc command CommandDisconnect = "/dc" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisconnectExecutor ¶
type DisconnectExecutor struct {
// contains filtered or unexported fields
}
DisconnectExecutor implements the /dc command
func NewDisconnectExecutor ¶
func NewDisconnectExecutor(eng *engine.Engine) *DisconnectExecutor
NewDisconnectExecutor creates a new disconnect command executor
func (*DisconnectExecutor) Command ¶
func (e *DisconnectExecutor) Command() string
Command returns the command name
func (*DisconnectExecutor) Description ¶
func (e *DisconnectExecutor) Description() string
Description returns the command description
type Executor ¶
type Executor interface {
// Command returns the command name (e.g., "/reset")
Command() string
// Description returns a human-readable description
Description() string
// Execute runs the command, sending progress updates via callback
Execute(ctx context.Context, req *Request, callback event.Callback) (*Result, error)
}
Executor defines the interface for slash command executors. Each command (/reset, /dc, etc.) implements this interface.
type ProgressEmitter ¶
type ProgressEmitter struct {
// contains filtered or unexported fields
}
ProgressEmitter sends progress events during command execution
func NewProgressEmitter ¶
func NewProgressEmitter(command string, callback event.Callback, steps []ProgressStep) *ProgressEmitter
NewProgressEmitter creates a new progress emitter
func (*ProgressEmitter) Complete ¶
func (e *ProgressEmitter) Complete(message string) error
Complete sends the final completion event
func (*ProgressEmitter) Emit ¶
func (e *ProgressEmitter) Emit(title string) error
Emit sends the current progress state
func (*ProgressEmitter) Error ¶
func (e *ProgressEmitter) Error(stepIndex int, message string) error
Error marks a step as failed
func (*ProgressEmitter) GetSteps ¶
func (e *ProgressEmitter) GetSteps() []ProgressStep
GetSteps returns current steps (for external use)
func (*ProgressEmitter) Running ¶
func (e *ProgressEmitter) Running(stepIndex int) error
Running marks a step as running
func (*ProgressEmitter) Start ¶
func (e *ProgressEmitter) Start(title string) error
Start sends initial progress with all steps in pending state
func (*ProgressEmitter) Success ¶
func (e *ProgressEmitter) Success(stepIndex int, message string) error
Success marks a step as successful
func (*ProgressEmitter) UpdateStep ¶
func (e *ProgressEmitter) UpdateStep(stepIndex int, status, message string) error
UpdateStep updates a specific step and emits progress
type ProgressStep ¶
type ProgressStep struct {
Name string // Step identifier (e.g., "find_session")
Message string // Human-readable message
Status string // "pending", "running", "success", "error"
}
ProgressStep represents a single step in command execution
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all registered command executors
func (*Registry) Execute ¶
func (r *Registry) Execute(ctx context.Context, req *Request, callback event.Callback) (*Result, error)
Execute runs a command by name
type Request ¶
type Request struct {
Command string // Original command (e.g., "/reset")
Text string // Command arguments
UserID string // User who invoked the command
ChannelID string // Channel where command was invoked
SessionID string // Associated session ID
ProviderSessionID string // Provider session ID (if available)
ResponseURL string // Slack response_url (optional)
Metadata map[string]any // Platform-specific metadata
}
Request encapsulates a slash command request
type ResetExecutor ¶
type ResetExecutor struct {
// contains filtered or unexported fields
}
ResetExecutor implements the /reset command
func NewResetExecutor ¶
func NewResetExecutor(eng *engine.Engine, workDir string) *ResetExecutor
NewResetExecutor creates a new reset command executor
func (*ResetExecutor) Command ¶
func (e *ResetExecutor) Command() string
Command returns the command name
func (*ResetExecutor) Description ¶
func (e *ResetExecutor) Description() string
Description returns the command description
func (*ResetExecutor) Execute ¶
func (e *ResetExecutor) Execute(ctx context.Context, req *Request, callback event.Callback) (*Result, error)
Execute runs the reset command
func (*ResetExecutor) SetAdapterManager ¶ added in v0.16.0
func (e *ResetExecutor) SetAdapterManager(adapters interface{})
SetAdapterManager sets the adapter manager for session cleanup