/** * Command handler for Slack message prefix commands * * Handles !command style messages for MVP simplicity * (vs Slack slash commands which require URL verification). */ import type { IChatSessionManager } from "@herdctl/chat"; import type { SlackConnectorLogger, SlackConnectorState } from "../types.js"; /** * Context passed to command handlers */ export interface CommandContext { /** Name of the agent handling this command */ agentName: string; /** Channel ID */ channelId: string; /** User who sent the command */ userId: string; /** Function to reply in the channel */ reply: (content: string) => Promise; /** Session manager for the agent */ sessionManager: IChatSessionManager; /** Current connector state */ connectorState: SlackConnectorState; } /** * A prefix command definition */ export interface PrefixCommand { /** Command name (without ! prefix) */ name: string; /** Description of the command */ description: string; /** Execute the command */ execute(context: CommandContext): Promise; } /** * Options for CommandHandler */ export interface CommandHandlerOptions { /** Logger instance */ logger?: SlackConnectorLogger; } /** * CommandHandler manages message prefix commands for Slack * * Commands are triggered by messages starting with `!` (e.g., `!reset`, `!status`) */ export declare class CommandHandler { private commands; private readonly logger; constructor(options?: CommandHandlerOptions); /** * Register a command */ registerCommand(command: PrefixCommand): void; /** * Check if a message is a command */ isCommand(text: string): boolean; /** * Execute a command from message text * * @returns true if a command was executed, false otherwise */ executeCommand(text: string, context: CommandContext): Promise; /** * Get all registered commands */ getCommands(): PrefixCommand[]; } //# sourceMappingURL=command-handler.d.ts.map