@vibe-agent-toolkit/cli 0.1.39-rc.4 → 0.1.39-rc.7
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.
- package/dist/commands/audit/git-url-clone.d.ts +1 -1
- package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
- package/dist/commands/audit/git-url-clone.js +3 -67
- package/dist/commands/audit/git-url-clone.js.map +1 -1
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +1 -2
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/consistency-check.d.ts +13 -0
- package/dist/commands/consistency-check.d.ts.map +1 -1
- package/dist/commands/consistency-check.js +98 -1
- package/dist/commands/consistency-check.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +1 -2
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/skill/index.d.ts.map +1 -1
- package/dist/commands/skill/index.js +2 -0
- package/dist/commands/skill/index.js.map +1 -1
- package/dist/commands/skill/test/configure.d.ts +22 -0
- package/dist/commands/skill/test/configure.d.ts.map +1 -0
- package/dist/commands/skill/test/configure.js +127 -0
- package/dist/commands/skill/test/configure.js.map +1 -0
- package/dist/commands/skill/test/index.d.ts +6 -0
- package/dist/commands/skill/test/index.d.ts.map +1 -0
- package/dist/commands/skill/test/index.js +16 -0
- package/dist/commands/skill/test/index.js.map +1 -0
- package/dist/commands/skill/test/run.d.ts +38 -0
- package/dist/commands/skill/test/run.d.ts.map +1 -0
- package/dist/commands/skill/test/run.js +320 -0
- package/dist/commands/skill/test/run.js.map +1 -0
- package/package.json +11 -11
- package/dist/utils/git-url.d.ts +0 -43
- package/dist/utils/git-url.d.ts.map +0 -1
- package/dist/utils/git-url.js +0 -135
- package/dist/utils/git-url.js.map +0 -1
package/dist/utils/git-url.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parsed representation of a git URL accepted by `vat audit`.
|
|
3
|
-
*
|
|
4
|
-
* - `cloneUrl` is the URL passed to `git clone` (after stripping ref/subpath
|
|
5
|
-
* fragments and after expanding GitHub shorthand to a full HTTPS URL).
|
|
6
|
-
* - `ref` is an optional branch or tag name (deep commit SHAs are not
|
|
7
|
-
* guaranteed to work with shallow clone — see design spec for details).
|
|
8
|
-
* - `subpath` is an optional subdirectory within the cloned repo to audit.
|
|
9
|
-
*/
|
|
10
|
-
export interface ParsedGitUrl {
|
|
11
|
-
cloneUrl: string;
|
|
12
|
-
ref?: string;
|
|
13
|
-
subpath?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Parse a string into a {@link ParsedGitUrl}.
|
|
17
|
-
*
|
|
18
|
-
* Accepted forms:
|
|
19
|
-
* - `https://host/owner/repo.git`
|
|
20
|
-
* - `https://host/owner/repo.git#ref`
|
|
21
|
-
* - `https://host/owner/repo.git#ref:subpath`
|
|
22
|
-
* - `https://github.com/owner/repo/tree/<ref>/<subpath>` (GitHub web URL)
|
|
23
|
-
* - `owner/repo` (GitHub shorthand → expanded to HTTPS)
|
|
24
|
-
* - `git@host:owner/repo.git`
|
|
25
|
-
* - `ssh://git@host/owner/repo.git`
|
|
26
|
-
*
|
|
27
|
-
* Throws on malformed input.
|
|
28
|
-
*/
|
|
29
|
-
export declare function parseGitUrl(input: string): ParsedGitUrl;
|
|
30
|
-
/**
|
|
31
|
-
* Detect whether a string should be treated as a git URL (for the polymorphic
|
|
32
|
-
* `[git-url-or-path]` audit argument). True for:
|
|
33
|
-
* - http(s):// URLs
|
|
34
|
-
* - ssh:// URLs
|
|
35
|
-
* - file:// URLs (used by integration tests against local bare repos)
|
|
36
|
-
* - git@host:path scp-style URLs
|
|
37
|
-
* - GitHub shorthand `owner/repo` (strict — no extensions, no extra slashes)
|
|
38
|
-
*
|
|
39
|
-
* Everything else (including relative paths like `./foo/bar`, absolute paths,
|
|
40
|
-
* and multi-segment paths like `foo/bar/baz`) is treated as a filesystem path.
|
|
41
|
-
*/
|
|
42
|
-
export declare function isGitUrl(input: string): boolean;
|
|
43
|
-
//# sourceMappingURL=git-url.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-url.d.ts","sourceRoot":"","sources":["../../src/utils/git-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAyBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAgEvD;AASD;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAmB/C"}
|
package/dist/utils/git-url.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Split a URL with an optional `#ref[:subpath]` fragment into the base URL
|
|
3
|
-
* and fragment components. Keeps the fragment-handling logic local so the
|
|
4
|
-
* per-form regexes can stay simple and anchored.
|
|
5
|
-
*/
|
|
6
|
-
function splitFragment(input) {
|
|
7
|
-
const hashIndex = input.indexOf('#');
|
|
8
|
-
if (hashIndex === -1) {
|
|
9
|
-
return { base: input };
|
|
10
|
-
}
|
|
11
|
-
const base = input.slice(0, hashIndex);
|
|
12
|
-
const fragment = input.slice(hashIndex + 1);
|
|
13
|
-
const colonIndex = fragment.indexOf(':');
|
|
14
|
-
if (colonIndex === -1) {
|
|
15
|
-
return { base, ref: fragment };
|
|
16
|
-
}
|
|
17
|
-
return {
|
|
18
|
-
base,
|
|
19
|
-
ref: fragment.slice(0, colonIndex),
|
|
20
|
-
subpath: fragment.slice(colonIndex + 1),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Parse a string into a {@link ParsedGitUrl}.
|
|
25
|
-
*
|
|
26
|
-
* Accepted forms:
|
|
27
|
-
* - `https://host/owner/repo.git`
|
|
28
|
-
* - `https://host/owner/repo.git#ref`
|
|
29
|
-
* - `https://host/owner/repo.git#ref:subpath`
|
|
30
|
-
* - `https://github.com/owner/repo/tree/<ref>/<subpath>` (GitHub web URL)
|
|
31
|
-
* - `owner/repo` (GitHub shorthand → expanded to HTTPS)
|
|
32
|
-
* - `git@host:owner/repo.git`
|
|
33
|
-
* - `ssh://git@host/owner/repo.git`
|
|
34
|
-
*
|
|
35
|
-
* Throws on malformed input.
|
|
36
|
-
*/
|
|
37
|
-
export function parseGitUrl(input) {
|
|
38
|
-
const trimmed = input.trim();
|
|
39
|
-
if (trimmed === '') {
|
|
40
|
-
throw new Error(`Invalid git URL or path: <empty>.`);
|
|
41
|
-
}
|
|
42
|
-
// file:// form: file:///path/to/repo[#ref[:subpath]] — used primarily by
|
|
43
|
-
// integration tests that clone a local bare repo. `git clone` accepts
|
|
44
|
-
// file:// natively.
|
|
45
|
-
if (trimmed.startsWith('file://')) {
|
|
46
|
-
const { base, ref, subpath } = splitFragment(trimmed);
|
|
47
|
-
return buildParsed(base, ref, subpath);
|
|
48
|
-
}
|
|
49
|
-
// HTTPS .git form: https://host/path.git[#ref[:subpath]]
|
|
50
|
-
if (/^https?:\/\//.test(trimmed)) {
|
|
51
|
-
const { base, ref, subpath } = splitFragment(trimmed);
|
|
52
|
-
if (base.endsWith('.git')) {
|
|
53
|
-
return buildParsed(base, ref, subpath);
|
|
54
|
-
}
|
|
55
|
-
// GitHub web URL: https://github.com/owner/repo/tree/<ref>[/<subpath>]
|
|
56
|
-
const ghWeb =
|
|
57
|
-
// eslint-disable-next-line security/detect-unsafe-regex -- Anchored ^...$ with bounded character classes; the only variable-length group is the trailing subpath. Safe from ReDoS.
|
|
58
|
-
/^https:\/\/github\.com\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\/tree\/([^/]+)(?:\/(.+))?$/.exec(trimmed);
|
|
59
|
-
if (ghWeb) {
|
|
60
|
-
const owner = ghWeb[1] ?? '';
|
|
61
|
-
const repo = ghWeb[2] ?? '';
|
|
62
|
-
const webRef = ghWeb[3];
|
|
63
|
-
const webSubpath = ghWeb[4];
|
|
64
|
-
return buildParsed(`https://github.com/${owner}/${repo}.git`, webRef, webSubpath);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// SSH ssh:// form: ssh://git@host/path[#ref[:subpath]]
|
|
68
|
-
if (trimmed.startsWith('ssh://')) {
|
|
69
|
-
const { base, ref, subpath } = splitFragment(trimmed);
|
|
70
|
-
return buildParsed(base, ref, subpath);
|
|
71
|
-
}
|
|
72
|
-
// SSH scp-like form: git@host:owner/repo.git[#ref[:subpath]]
|
|
73
|
-
// Anchored, no alternation with nested quantifiers — safe from ReDoS.
|
|
74
|
-
if (/^[^@\s]+@[^:\s]+:[^#\s]+/.test(trimmed)) {
|
|
75
|
-
const { base, ref, subpath } = splitFragment(trimmed);
|
|
76
|
-
return buildParsed(base, ref, subpath);
|
|
77
|
-
}
|
|
78
|
-
// GitHub shorthand: owner/repo[#ref[:subpath]] (single slash in base)
|
|
79
|
-
const { base, ref, subpath } = splitFragment(trimmed);
|
|
80
|
-
const shorthand = /^([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/.exec(base);
|
|
81
|
-
if (shorthand) {
|
|
82
|
-
const owner = shorthand[1] ?? '';
|
|
83
|
-
const repo = shorthand[2] ?? '';
|
|
84
|
-
return buildParsed(`https://github.com/${owner}/${repo}.git`, ref, subpath);
|
|
85
|
-
}
|
|
86
|
-
throw new Error(`Invalid git URL or path: ${input}. Accepted forms: ` +
|
|
87
|
-
`https://<host>/<owner>/<repo>.git, ` +
|
|
88
|
-
`git@<host>:<owner>/<repo>.git, ` +
|
|
89
|
-
`<owner>/<repo>, or a local filesystem path.`);
|
|
90
|
-
}
|
|
91
|
-
function buildParsed(cloneUrl, ref, subpath) {
|
|
92
|
-
const result = { cloneUrl };
|
|
93
|
-
if (ref !== undefined && ref !== '')
|
|
94
|
-
result.ref = ref;
|
|
95
|
-
if (subpath !== undefined && subpath !== '')
|
|
96
|
-
result.subpath = subpath;
|
|
97
|
-
return result;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Detect whether a string should be treated as a git URL (for the polymorphic
|
|
101
|
-
* `[git-url-or-path]` audit argument). True for:
|
|
102
|
-
* - http(s):// URLs
|
|
103
|
-
* - ssh:// URLs
|
|
104
|
-
* - file:// URLs (used by integration tests against local bare repos)
|
|
105
|
-
* - git@host:path scp-style URLs
|
|
106
|
-
* - GitHub shorthand `owner/repo` (strict — no extensions, no extra slashes)
|
|
107
|
-
*
|
|
108
|
-
* Everything else (including relative paths like `./foo/bar`, absolute paths,
|
|
109
|
-
* and multi-segment paths like `foo/bar/baz`) is treated as a filesystem path.
|
|
110
|
-
*/
|
|
111
|
-
export function isGitUrl(input) {
|
|
112
|
-
const trimmed = input.trim();
|
|
113
|
-
if (trimmed === '')
|
|
114
|
-
return false;
|
|
115
|
-
if (/^https?:\/\//.test(trimmed))
|
|
116
|
-
return true;
|
|
117
|
-
if (trimmed.startsWith('ssh://'))
|
|
118
|
-
return true;
|
|
119
|
-
if (trimmed.startsWith('file://'))
|
|
120
|
-
return true;
|
|
121
|
-
// Match the same scp-style pattern parseGitUrl uses, including the
|
|
122
|
-
// requirement of a non-empty path segment after the colon. Without the
|
|
123
|
-
// trailing `[^#\s]+`, `isGitUrl` would accept inputs like `foo@host:`
|
|
124
|
-
// that parseGitUrl then rejects with a less-helpful error.
|
|
125
|
-
if (/^[^@\s]+@[^:\s]+:[^#\s]+/.test(trimmed))
|
|
126
|
-
return true;
|
|
127
|
-
// Strict GitHub shorthand: exactly two segments, no extension on second,
|
|
128
|
-
// no path separators beyond the single /. Strip any `#ref[:subpath]`
|
|
129
|
-
// fragment first so `owner/repo#main` and `owner/repo#main:sub` are
|
|
130
|
-
// recognized — `parseGitUrl` handles fragments uniformly across forms.
|
|
131
|
-
const hashIndex = trimmed.indexOf('#');
|
|
132
|
-
const base = hashIndex === -1 ? trimmed : trimmed.slice(0, hashIndex);
|
|
133
|
-
return /^[A-Za-z0-9_-]+\/[A-Za-z0-9_-]+$/.test(base);
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=git-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-url.js","sourceRoot":"","sources":["../../src/utils/git-url.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;IACD,OAAO;QACL,IAAI;QACJ,GAAG,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;QAClC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC;KACxC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAA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