// tools/warp_grep/utils/github.ts
function parseGitHubUrl(input) {
  input = input.trim();
  const urlPattern = /^(?:https?:\/\/)?github\.com\/([^\/]+)\/([^\/\?\#]+)/;
  const match = input.match(urlPattern);
  if (match) {
    return { owner: match[1], repo: match[2].replace(/\.git$/, "") };
  }
  const shortPattern = /^([^\/]+)\/([^\/]+)$/;
  const shortMatch = input.match(shortPattern);
  if (shortMatch && !shortMatch[1].includes(".")) {
    return { owner: shortMatch[1], repo: shortMatch[2].replace(/\.git$/, "") };
  }
  throw new Error(
    `Invalid GitHub URL or shorthand: "${input}". Expected "owner/repo" or "https://github.com/owner/repo"`
  );
}

export {
  parseGitHubUrl
};
//# sourceMappingURL=chunk-63VHBANJ.js.map