feat(cli): Support GitHub URLs in dotagents add#28
Merged
Conversation
Detect GitHub HTTPS and SSH URLs in parseSource() and normalize them to the canonical owner/repo form before storing in agents.toml. This lets users copy-paste URLs directly from GitHub while preserving clean config entries and org-based trust matching. Co-Authored-By: Claude <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/VIvWvKJtCQ_DLllkcOBi74i9pRLy-XW32ZnL-6Das2k
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The regex capture group for repo names excluded dots, breaking repos like vercel/next.js or chartjs/Chart.js. Change [^/@.]+? to [^/@]+? so dots are allowed while .git suffix stripping still works correctly via lazy quantifier backtracking. Co-Authored-By: Claude <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/9b9hpxA3PP8mW1IVsJtDdfYvRVyZqG2BFqdS8VFbHZY
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Export GITHUB_HTTPS_URL and GITHUB_SSH_URL from schema.ts and import in resolver.ts to eliminate duplication. Tighten owner/repo capture groups to require an alphanumeric first character, matching the existing owner/repo validation and preventing dash-prefixed segments from bypassing safety checks. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect GitHub HTTPS and SSH URLs in
parseSource()and normalize them to the canonicalowner/repoform before storing inagents.toml. Users naturally copy-paste URLs from GitHub, sodotagents add https://github.com/getsentry/skillsnow works the same asdotagents add getsentry/skills.Handles all common URL shapes:
https://github.com/owner/repohttps://github.com/owner/repo.githttps://github.com/owner/repo/https://github.com/owner/repo@refgit@github.com:owner/repo.gitgit@github.com:owner/repo@refThe normalization happens early in
runAdd()so the canonical form is used for trust validation, duplicate detection, and config storage — keepingagents.tomlclean and org-based trust matching working correctly.Also updates the Zod schema validation to accept GitHub URLs, so manually written URLs in
agents.tomlpass validation too.Agent transcript: https://claudescope.sentry.dev/share/DOl4AVfU2YZRkxmHVmdOFkBhYY0hiowjS4LNzyfnNJ8