/** * Command registry: normalize to uppercase, route to handler, return unsupported error for unknown. */ import type { BlockRequest, CommandContext, CommandHandler, CommandReply, Engine, RespValue } from '../types.ts'; declare const COMPILED_POLICY_TAG: unique symbol; export interface CommandPolicy { rename?: Record; disabled?: string[]; } export interface CompiledCommandPolicy { [COMPILED_POLICY_TAG]: true; disabledSet: Set; aliasToOriginal: Map; renamedOriginals: Set; } export declare function compileCommandPolicy(policy?: CommandPolicy | CompiledCommandPolicy | null | undefined): CompiledCommandPolicy | null; export declare function resolveCommandName(inputCommand: string, policy?: CommandPolicy | CompiledCommandPolicy | null): string | null; /** Outcome of one command: a reply to encode, an error, or a control instruction. */ export interface DispatchResult { result?: CommandReply; error?: string; quit?: true; block?: BlockRequest; pushes?: RespValue[]; } /** * Dispatch command. Full argv: [commandNameBuf, ...argBuffers]. * @param argv - first element is command name, rest are arguments * @param context - optional connection context (connectionId, clientAddress, writeResponse, onUnknownCommand, onCommandError) */ export declare function dispatch(engine: Engine, argv: Buffer[], context?: CommandContext): DispatchResult; export declare function register(name: string, handler: CommandHandler): void; export {};