'use strict';

// src/platform/command-runtime/parser.ts
var BUILTIN_COMMAND_ALIASES = {
  "/talktofigma": "/talk-to-figma"
};
function splitCommandParts(commandLine) {
  const trimmed = commandLine.trim();
  if (!trimmed.startsWith("/")) {
    return void 0;
  }
  const [command = "", ...args] = trimmed.split(/\s+/);
  const rawArgs = trimmed.slice(command.length).trim();
  return {
    args,
    command,
    rawArgs,
    rawCommand: trimmed
  };
}
function normalizeBuiltinAlias(command) {
  return BUILTIN_COMMAND_ALIASES[command] || command;
}
function resolveSlashCommandInput(input, builtinCommands) {
  const trimmed = input.trim();
  if (!trimmed) {
    return void 0;
  }
  const normalized = splitCommandParts(trimmed);
  if (!normalized) {
    return void 0;
  }
  const aliasedCommand = normalizeBuiltinAlias(normalized.command);
  if (builtinCommands.includes(aliasedCommand)) {
    return {
      ...normalized,
      command: aliasedCommand,
      kind: "builtin"
    };
  }
  return void 0;
}

exports.resolveSlashCommandInput = resolveSlashCommandInput;
