@tryarcanist/cli 0.1.304 → 0.1.305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +14 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22995,13 +22995,24 @@ function parseEgressAllowlistSourceFile(content, key = EGRESS_ALLOWLIST_SOURCE_P
22995
22995
  }
22996
22996
 
22997
22997
  // ../../shared/github/repo-url.ts
22998
+ var REPO_SEGMENT_PATTERN = /^[A-Za-z0-9_.][A-Za-z0-9_.-]*$/;
22999
+ var MAX_REPO_SEGMENT_LENGTH = 100;
23000
+ function isValidGithubRepoSegment(value) {
23001
+ if (typeof value !== "string") return false;
23002
+ if (!value || value.length > MAX_REPO_SEGMENT_LENGTH) return false;
23003
+ if (value === "." || value === "..") return false;
23004
+ return REPO_SEGMENT_PATTERN.test(value);
23005
+ }
23006
+ function parseGithubRepoCoordinate(owner, repo) {
23007
+ return isValidGithubRepoSegment(owner) && isValidGithubRepoSegment(repo) ? { owner, repo } : null;
23008
+ }
22998
23009
  function parseGithubRepoFullName(value) {
22999
23010
  const shorthand = value.match(/^([a-zA-Z0-9_.-]+)\/([a-zA-Z0-9_.-]+)$/);
23000
- if (shorthand) return { owner: shorthand[1], repo: shorthand[2] };
23011
+ if (shorthand) return parseGithubRepoCoordinate(shorthand[1], shorthand[2]);
23001
23012
  const ssh = value.match(/^git@github\.com:([^/]+)\/([^/]+?)(?:\.git)?$/);
23002
- if (ssh) return { owner: ssh[1], repo: ssh[2] };
23013
+ if (ssh) return parseGithubRepoCoordinate(ssh[1], ssh[2]);
23003
23014
  const https = value.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?\/?$/);
23004
- if (https) return { owner: https[1], repo: https[2] };
23015
+ if (https) return parseGithubRepoCoordinate(https[1], https[2]);
23005
23016
  return null;
23006
23017
  }
23007
23018
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryarcanist/cli",
3
- "version": "0.1.304",
3
+ "version": "0.1.305",
4
4
  "description": "CLI for Arcanist - create and manage coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {