import type { ParsedCommand } from '@mosaicstack/types';

export function parseSlashCommand(input: string): ParsedCommand | null {
  const match = input.match(/^\/([a-z][a-z0-9:_-]*)\s*(.*)?$/i);
  if (!match) return null;
  return {
    command: match[1]!,
    args: match[2]?.trim() || null,
    raw: input,
  };
}
