agents-pkg 0.7.0 → 0.8.0

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.
@@ -1,12 +1,20 @@
1
1
  /**
2
2
  * Resolve a source (GitHub owner/repo, git URL, or local path) to a local directory path.
3
3
  * For remote sources, clones to a temp directory; caller must call cleanup() when done.
4
+ *
5
+ * Parsing of `source` (local vs. git, ref extraction) lives in `source-parser.ts`; this
6
+ * module only does filesystem/network work (stat a local path, or clone a git remote).
4
7
  */
5
8
  export interface ResolveSourceToDirResult {
6
9
  path: string;
7
10
  /** Call when done to remove temp dir (only set when we cloned). */
8
11
  cleanup?: () => Promise<void>;
9
12
  }
13
+ /**
14
+ * Clone `url` (optionally at `ref`) into a fresh temp directory and return its path.
15
+ * Caller owns the returned directory and should remove it when done.
16
+ */
17
+ export declare function cloneRepo(url: string, ref?: string): Promise<string>;
10
18
  /**
11
19
  * Resolve source to a local directory. For remote sources, clones to a temp dir.
12
20
  * Call cleanup() when finished to remove the temp dir.
@@ -1 +1 @@
1
- {"version":3,"file":"source-dir.d.ts","sourceRoot":"","sources":["../../src/lib/source-dir.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkEH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAkD1F"}
1
+ {"version":3,"file":"source-dir.d.ts","sourceRoot":"","sources":["../../src/lib/source-dir.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAWD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8C1E;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA6B1F"}
@@ -1,64 +1,68 @@
1
1
  /**
2
2
  * Resolve a source (GitHub owner/repo, git URL, or local path) to a local directory path.
3
3
  * For remote sources, clones to a temp directory; caller must call cleanup() when done.
4
+ *
5
+ * Parsing of `source` (local vs. git, ref extraction) lives in `source-parser.ts`; this
6
+ * module only does filesystem/network work (stat a local path, or clone a git remote).
4
7
  */
5
- import { resolve } from 'path';
6
8
  import { mkdtemp, rm, stat } from 'fs/promises';
7
9
  import { join } from 'path';
8
10
  import { tmpdir } from 'os';
9
11
  import { spawnSync } from 'child_process';
10
- function isLocalPath(input) {
11
- const t = input.trim();
12
- return (t.startsWith('./') ||
13
- t.startsWith('../') ||
14
- t === '.' ||
15
- t === '..' ||
16
- t.startsWith('/') ||
17
- /^[a-zA-Z]:[/\\]/.test(t));
12
+ import { parseSource } from './source-parser.js';
13
+ const DEFAULT_CLONE_TIMEOUT_MS = 300_000;
14
+ function getCloneTimeoutMs() {
15
+ const raw = process.env.AGENTS_PKG_CLONE_TIMEOUT_MS;
16
+ if (!raw)
17
+ return DEFAULT_CLONE_TIMEOUT_MS;
18
+ const parsed = Number(raw);
19
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_CLONE_TIMEOUT_MS;
18
20
  }
19
21
  /**
20
- * SSH-style URL without git@ prefix: host:path (e.g. git.naspersclassifieds.com:olxeu/ecosystem/tooling/ai-engineering-kit.git).
21
- * Single colon, host-like left part, path-like right part.
22
+ * Clone `url` (optionally at `ref`) into a fresh temp directory and return its path.
23
+ * Caller owns the returned directory and should remove it when done.
22
24
  */
23
- function isSshStyleUrl(input) {
24
- const colonIdx = input.indexOf(':');
25
- if (colonIdx <= 0 || colonIdx !== input.lastIndexOf(':'))
26
- return false;
27
- const host = input.slice(0, colonIdx);
28
- const path = input.slice(colonIdx + 1);
29
- const hostLooksValid = host.includes('.') || host === 'github' || host === 'gitlab';
30
- const pathLooksValid = path.length > 0 && (path.includes('/') || path.endsWith('.git'));
31
- return hostLooksValid && pathLooksValid;
32
- }
33
- function isGitUrl(input) {
34
- const t = input.trim();
35
- return (t.startsWith('http://') ||
36
- t.startsWith('https://') ||
37
- t.startsWith('git@') ||
38
- isSshStyleUrl(t));
39
- }
40
- /**
41
- * Convert shorthand to HTTPS clone URL.
42
- * owner/repo -> https://github.com/owner/repo.git
43
- * gitlab.com/owner/repo -> https://gitlab.com/owner/repo.git
44
- * Other hosts require a full git URL.
45
- */
46
- function ownerRepoToUrl(ownerRepo) {
47
- const trimmed = ownerRepo.trim();
48
- if (trimmed.includes(':'))
49
- return '';
50
- const parts = trimmed.split('/').filter(Boolean);
51
- if (parts.length === 2) {
52
- const [owner, repo] = parts;
53
- if (owner.includes('.'))
54
- return '';
55
- return `https://github.com/${owner}/${(repo ?? '').replace(/\.git$/, '')}.git`;
25
+ export async function cloneRepo(url, ref) {
26
+ const tempDir = await mkdtemp(join(tmpdir(), 'agents-pkg-'));
27
+ const cloneArgs = [
28
+ // Never smudge git-lfs content on checkout: avoids hard failures when git-lfs isn't installed.
29
+ '-c',
30
+ 'filter.lfs.required=false',
31
+ '-c',
32
+ 'filter.lfs.smudge=',
33
+ '-c',
34
+ 'filter.lfs.clean=',
35
+ '-c',
36
+ 'filter.lfs.process=',
37
+ 'clone',
38
+ '--depth',
39
+ '1',
40
+ ...(ref ? ['--branch', ref] : []),
41
+ url,
42
+ tempDir,
43
+ ];
44
+ const result = spawnSync('git', cloneArgs, {
45
+ stdio: ['ignore', 'pipe', 'pipe'],
46
+ encoding: 'utf-8',
47
+ timeout: getCloneTimeoutMs(),
48
+ env: {
49
+ ...process.env,
50
+ // Never hang on an auth prompt; fail fast instead.
51
+ GIT_TERMINAL_PROMPT: '0',
52
+ GIT_LFS_SKIP_SMUDGE: '1',
53
+ },
54
+ });
55
+ const target = ref ? `${url} (ref: ${ref})` : url;
56
+ if (result.error && result.error.code === 'ETIMEDOUT') {
57
+ await rm(tempDir, { recursive: true, force: true }).catch(() => { });
58
+ throw new Error(`Timed out cloning ${target} after ${getCloneTimeoutMs()}ms`);
56
59
  }
57
- if (parts.length === 3 && (parts[0] === 'github.com' || parts[0] === 'gitlab.com')) {
58
- const [host, owner, repo] = parts;
59
- return `https://${host}/${owner}/${(repo ?? '').replace(/\.git$/, '')}.git`;
60
+ if (result.status !== 0) {
61
+ await rm(tempDir, { recursive: true, force: true }).catch(() => { });
62
+ const stderr = (result.stderr || '').trim();
63
+ throw new Error(`Failed to clone ${target}: ${stderr || result.error?.message || 'unknown error'}`);
60
64
  }
61
- return '';
65
+ return tempDir;
62
66
  }
63
67
  /**
64
68
  * Resolve source to a local directory. For remote sources, clones to a temp dir.
@@ -69,9 +73,9 @@ export async function resolveSourceToDir(source) {
69
73
  if (!trimmed) {
70
74
  throw new Error('Source is required');
71
75
  }
72
- // Local path
73
- if (isLocalPath(trimmed)) {
74
- const abs = resolve(trimmed);
76
+ const parsed = parseSource(trimmed);
77
+ if (parsed.type === 'local') {
78
+ const abs = parsed.localPath ?? parsed.url;
75
79
  try {
76
80
  const st = await stat(abs);
77
81
  if (!st.isDirectory()) {
@@ -85,31 +89,11 @@ export async function resolveSourceToDir(source) {
85
89
  }
86
90
  return { path: abs };
87
91
  }
88
- // Remote: git URL or owner/repo
89
- let cloneUrl;
90
- if (isGitUrl(trimmed)) {
91
- cloneUrl = trimmed;
92
- }
93
- else {
94
- cloneUrl = ownerRepoToUrl(trimmed);
95
- if (!cloneUrl) {
96
- throw new Error(`Invalid source: ${trimmed}. Use a local path, owner/repo, or a git URL.`);
97
- }
98
- }
99
- const tempDir = await mkdtemp(join(tmpdir(), 'agents-pkg-'));
100
- const result = spawnSync('git', ['clone', '--depth', '1', cloneUrl, tempDir], {
101
- stdio: ['ignore', 'pipe', 'pipe'],
102
- encoding: 'utf-8',
103
- });
104
- if (result.status !== 0) {
105
- await rm(tempDir, { recursive: true, force: true }).catch(() => { });
106
- const stderr = (result.stderr || '').trim();
107
- throw new Error(`Failed to clone ${cloneUrl}: ${stderr || result.error?.message || 'unknown error'}`);
108
- }
92
+ const path = await cloneRepo(parsed.url, parsed.ref);
109
93
  return {
110
- path: tempDir,
94
+ path,
111
95
  cleanup: async () => {
112
- await rm(tempDir, { recursive: true, force: true });
96
+ await rm(path, { recursive: true, force: true });
113
97
  },
114
98
  };
115
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"source-dir.js","sourceRoot":"","sources":["../../src/lib/source-dir.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACvB,OAAO,CACL,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAClB,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;QACnB,CAAC,KAAK,GAAG;QACT,CAAC,KAAK,IAAI;QACV,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;QACjB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,QAAQ,IAAI,CAAC,IAAI,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AO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Pure parsing of a `source` string (as passed to `add-plugin` / stored in the lock file)
3
+ * into a structured description of where to get the code from: a local directory, or a
4
+ * git remote (with an optional ref) to clone.
5
+ *
6
+ * No filesystem or network access happens here; see `source-dir.ts` for resolution.
7
+ *
8
+ * Modeled after vercel-labs/skills' `parseSource`, with two deliberate deviations for
9
+ * agents-pkg (documented at their point of divergence below):
10
+ * - No skill-filter support (`#ref@skill` / `owner/repo@skill`); we select plugins via
11
+ * separate CLI args, so anything after `@` in a fragment is ignored.
12
+ * - No subpath support; a `tree/<ref>/<subpath>` (or gitlab `-/tree/<ref>/<subpath>`) only
13
+ * ever yields a ref, the subpath is dropped, since our installer always reads
14
+ * `.cursor-plugin/marketplace.json` at the repo root.
15
+ */
16
+ export interface ParsedSource {
17
+ type: 'local' | 'github' | 'gitlab' | 'git';
18
+ url: string;
19
+ ref?: string;
20
+ localPath?: string;
21
+ }
22
+ /**
23
+ * Whether `input` (the base, with any `#ref` already stripped) "looks like" a git source,
24
+ * i.e. the `#` fragment (if present) should be treated as a git ref rather than left as
25
+ * part of an opaque string.
26
+ *
27
+ * DEVIATION from vercel-labs/skills: they only treat http(s) URLs as git-like when they
28
+ * are github.com/gitlab.com or end in `.git`. agents-pkg only ever resolves git remotes
29
+ * (there's no other kind of http(s) source), so we additionally treat any plain
30
+ * `https?://<host>/<path>` (with at least one path segment) as git-like. This is what
31
+ * makes our primary internal use case (self-hosted GitLab URLs without a `.git` suffix,
32
+ * e.g. `https://git.example.com/group/subgroup/repo#branch/name`) parse the `#ref`
33
+ * fragment correctly.
34
+ */
35
+ export declare function looksLikeGitSource(input: string): boolean;
36
+ export declare function parseSource(input: string): ParsedSource;
37
+ //# sourceMappingURL=source-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-parser.d.ts","sourceRoot":"","sources":["../../src/lib/source-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAyBzD;AA4CD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAmFvD"}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Pure parsing of a `source` string (as passed to `add-plugin` / stored in the lock file)
3
+ * into a structured description of where to get the code from: a local directory, or a
4
+ * git remote (with an optional ref) to clone.
5
+ *
6
+ * No filesystem or network access happens here; see `source-dir.ts` for resolution.
7
+ *
8
+ * Modeled after vercel-labs/skills' `parseSource`, with two deliberate deviations for
9
+ * agents-pkg (documented at their point of divergence below):
10
+ * - No skill-filter support (`#ref@skill` / `owner/repo@skill`); we select plugins via
11
+ * separate CLI args, so anything after `@` in a fragment is ignored.
12
+ * - No subpath support; a `tree/<ref>/<subpath>` (or gitlab `-/tree/<ref>/<subpath>`) only
13
+ * ever yields a ref, the subpath is dropped, since our installer always reads
14
+ * `.cursor-plugin/marketplace.json` at the repo root.
15
+ */
16
+ import { resolve } from 'path';
17
+ function isLocalPath(input) {
18
+ const t = input.trim();
19
+ return (t.startsWith('./') ||
20
+ t.startsWith('../') ||
21
+ t === '.' ||
22
+ t === '..' ||
23
+ t.startsWith('/') ||
24
+ /^[a-zA-Z]:[/\\]/.test(t));
25
+ }
26
+ /**
27
+ * SSH-style URL without git@ prefix: host:path (e.g. git.example.com:owner/repo.git).
28
+ * Single colon, host-like left part, path-like right part.
29
+ */
30
+ function isSshStyleUrl(input) {
31
+ const colonIdx = input.indexOf(':');
32
+ if (colonIdx <= 0 || colonIdx !== input.lastIndexOf(':'))
33
+ return false;
34
+ const host = input.slice(0, colonIdx);
35
+ const path = input.slice(colonIdx + 1);
36
+ const hostLooksValid = host.includes('.') || host === 'github' || host === 'gitlab';
37
+ const pathLooksValid = path.length > 0 && (path.includes('/') || path.endsWith('.git'));
38
+ return hostLooksValid && pathLooksValid;
39
+ }
40
+ const GITHUB_TREE_RE = /^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)$/;
41
+ const GITHUB_TREE_SUBPATH_RE = /^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/tree\/([^/]+)\/(.+)$/;
42
+ const GITLAB_TREE_RE = /^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)$/;
43
+ const GITLAB_TREE_SUBPATH_RE = /^(https?):\/\/([^/]+)\/(.+?)\/-\/tree\/([^/]+)\/(.+)$/;
44
+ /**
45
+ * Whether `input` (the base, with any `#ref` already stripped) "looks like" a git source,
46
+ * i.e. the `#` fragment (if present) should be treated as a git ref rather than left as
47
+ * part of an opaque string.
48
+ *
49
+ * DEVIATION from vercel-labs/skills: they only treat http(s) URLs as git-like when they
50
+ * are github.com/gitlab.com or end in `.git`. agents-pkg only ever resolves git remotes
51
+ * (there's no other kind of http(s) source), so we additionally treat any plain
52
+ * `https?://<host>/<path>` (with at least one path segment) as git-like. This is what
53
+ * makes our primary internal use case (self-hosted GitLab URLs without a `.git` suffix,
54
+ * e.g. `https://git.example.com/group/subgroup/repo#branch/name`) parse the `#ref`
55
+ * fragment correctly.
56
+ */
57
+ export function looksLikeGitSource(input) {
58
+ const t = input.trim();
59
+ if (isLocalPath(t))
60
+ return false;
61
+ if (t.startsWith('github:') || t.startsWith('gitlab:') || t.startsWith('git@'))
62
+ return true;
63
+ // file:// URLs are a git-clonable remote (used for local git repos in tests/CI), not a plain local path.
64
+ if (t.startsWith('file://'))
65
+ return true;
66
+ if (/^ssh:\/\/.+\.git$/.test(t))
67
+ return true;
68
+ if (GITHUB_TREE_RE.test(t) || GITHUB_TREE_SUBPATH_RE.test(t))
69
+ return true;
70
+ if (GITLAB_TREE_RE.test(t) || GITLAB_TREE_SUBPATH_RE.test(t))
71
+ return true;
72
+ if (/^https?:\/\/.+\.git$/.test(t))
73
+ return true;
74
+ if (t.startsWith('http://') || t.startsWith('https://')) {
75
+ // Extended beyond vercel-labs/skills: see doc comment above.
76
+ try {
77
+ const u = new URL(t);
78
+ return u.pathname.replace(/^\/+/, '').length > 0;
79
+ }
80
+ catch {
81
+ return false;
82
+ }
83
+ }
84
+ if (isSshStyleUrl(t))
85
+ return true;
86
+ // Bare owner/repo shorthand: no colon, not starting with `.` or `/`.
87
+ if (!t.includes(':') && !t.startsWith('.') && !t.startsWith('/') && /^[^/]+\/[^/]+$/.test(t)) {
88
+ return true;
89
+ }
90
+ return false;
91
+ }
92
+ /** Split an optional `#ref` (or `#ref@skillFilter`, skillFilter ignored) fragment off a source string. */
93
+ function splitFragmentRef(input) {
94
+ const hashIdx = input.indexOf('#');
95
+ if (hashIdx === -1)
96
+ return { base: input };
97
+ const base = input.slice(0, hashIdx);
98
+ let fragment = input.slice(hashIdx + 1).trim();
99
+ if (fragment.length === 0)
100
+ return { base };
101
+ const atIdx = fragment.indexOf('@');
102
+ if (atIdx !== -1)
103
+ fragment = fragment.slice(0, atIdx);
104
+ if (fragment.length === 0)
105
+ return { base };
106
+ let decoded = fragment;
107
+ try {
108
+ decoded = decodeURIComponent(fragment);
109
+ }
110
+ catch {
111
+ decoded = fragment;
112
+ }
113
+ return { base, fragmentRef: decoded };
114
+ }
115
+ /**
116
+ * Convert bare shorthand to an HTTPS clone URL.
117
+ * owner/repo -> https://github.com/owner/repo.git
118
+ * github.com/owner/repo, gitlab.com/owner/repo -> https://<host>/owner/repo.git
119
+ */
120
+ function ownerRepoToUrl(ownerRepo) {
121
+ const trimmed = ownerRepo.trim();
122
+ if (trimmed.includes(':'))
123
+ return undefined;
124
+ const parts = trimmed.split('/').filter(Boolean);
125
+ if (parts.length === 2) {
126
+ const [owner, repo] = parts;
127
+ if (owner.includes('.'))
128
+ return undefined;
129
+ return { type: 'github', url: `https://github.com/${owner}/${(repo ?? '').replace(/\.git$/, '')}.git` };
130
+ }
131
+ if (parts.length >= 3 && (parts[0] === 'github.com' || parts[0] === 'gitlab.com')) {
132
+ const host = parts[0];
133
+ const rest = parts.slice(1);
134
+ const repo = rest.pop().replace(/\.git$/, '');
135
+ return { type: host === 'github.com' ? 'github' : 'gitlab', url: `https://${host}/${rest.join('/')}/${repo}.git` };
136
+ }
137
+ return undefined;
138
+ }
139
+ export function parseSource(input) {
140
+ const trimmed = input.trim();
141
+ if (isLocalPath(trimmed)) {
142
+ const abs = resolve(trimmed);
143
+ return { type: 'local', url: abs, localPath: abs };
144
+ }
145
+ // github:owner/repo / gitlab:group/sub/repo prefix shorthand, optionally with #ref.
146
+ if (trimmed.startsWith('github:') || trimmed.startsWith('gitlab:')) {
147
+ const isGithub = trimmed.startsWith('github:');
148
+ const rest = trimmed.slice(isGithub ? 'github:'.length : 'gitlab:'.length);
149
+ const { base, fragmentRef } = splitFragmentRef(rest);
150
+ const parts = base.split('/').filter(Boolean);
151
+ const repo = (parts.pop() ?? '').replace(/\.git$/, '');
152
+ const url = isGithub
153
+ ? `https://github.com/${parts.join('/')}/${repo}.git`
154
+ : `https://gitlab.com/${parts.join('/')}/${repo}.git`;
155
+ return { type: isGithub ? 'github' : 'gitlab', url, ref: fragmentRef };
156
+ }
157
+ const { base, fragmentRef } = splitFragmentRef(trimmed);
158
+ // Browse-URL ref extraction takes precedence over a `#ref` fragment.
159
+ const ghSubpath = base.match(GITHUB_TREE_SUBPATH_RE);
160
+ const ghBranchOnly = base.match(GITHUB_TREE_RE);
161
+ if (ghBranchOnly) {
162
+ const [, owner, repo, ref] = ghBranchOnly;
163
+ return { type: 'github', url: `https://github.com/${owner}/${repo}.git`, ref };
164
+ }
165
+ if (ghSubpath) {
166
+ const [, owner, repo, ref] = ghSubpath;
167
+ return { type: 'github', url: `https://github.com/${owner}/${repo}.git`, ref };
168
+ }
169
+ const glSubpath = base.match(GITLAB_TREE_SUBPATH_RE);
170
+ const glBranchOnly = base.match(GITLAB_TREE_RE);
171
+ if (glBranchOnly) {
172
+ const [, proto, host, repoPath, ref] = glBranchOnly;
173
+ return { type: 'gitlab', url: `${proto}://${host}/${repoPath}.git`, ref };
174
+ }
175
+ if (glSubpath) {
176
+ const [, proto, host, repoPath, ref] = glSubpath;
177
+ return { type: 'gitlab', url: `${proto}://${host}/${repoPath}.git`, ref };
178
+ }
179
+ // Bare owner/repo shorthand, or owner/repo prefixed with a bare github.com/gitlab.com
180
+ // host (no scheme). Tried before the looksLikeGitSource guard below since these forms
181
+ // are unambiguously our own shorthand, not a generic opaque string.
182
+ const shorthand = ownerRepoToUrl(base);
183
+ if (shorthand) {
184
+ return { type: shorthand.type, url: shorthand.url, ref: fragmentRef };
185
+ }
186
+ if (!looksLikeGitSource(base)) {
187
+ // Base doesn't look git-like: leave the `#` as part of the string (not a ref).
188
+ return { type: 'git', url: trimmed };
189
+ }
190
+ if (base.startsWith('git@') || isSshStyleUrl(base) || base.startsWith('ssh://') || base.startsWith('file://')) {
191
+ return { type: 'git', url: base, ref: fragmentRef };
192
+ }
193
+ if (base.startsWith('http://') || base.startsWith('https://')) {
194
+ let host = '';
195
+ try {
196
+ host = new URL(base).hostname;
197
+ }
198
+ catch {
199
+ host = '';
200
+ }
201
+ if (host === 'github.com') {
202
+ const withGit = base.endsWith('.git') ? base : `${base.replace(/\/$/, '')}.git`;
203
+ return { type: 'github', url: withGit, ref: fragmentRef };
204
+ }
205
+ if (host === 'gitlab.com') {
206
+ const withGit = base.endsWith('.git') ? base : `${base.replace(/\/$/, '')}.git`;
207
+ return { type: 'gitlab', url: withGit, ref: fragmentRef };
208
+ }
209
+ // Generic git host (our extension): keep URL as-is, don't force a `.git` suffix.
210
+ return { type: 'git', url: base, ref: fragmentRef };
211
+ }
212
+ return { type: 'git', url: base, ref: fragmentRef };
213
+ }
214
+ //# sourceMappingURL=source-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-parser.js","sourceRoot":"","sources":["../../src/lib/source-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAS/B,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACvB,OAAO,CACL,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;QAClB,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;QACnB,CAAC,KAAK,GAAG;QACT,CAAC,KAAK,IAAI;QACV,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;QACjB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1B,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,KAAK,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACvE,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ,CAAC;IACpF,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QA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Wrapper around skills CLI for Cursor and Claude with agents and commands config",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",