@voidagency/skills 1.0.0 → 1.0.2
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/cli.mjs +27 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -96,9 +96,25 @@ function parseSource(input) {
|
|
|
96
96
|
const githubPrefixMatch = input.match(/^github:(.+)$/);
|
|
97
97
|
if (githubPrefixMatch) return parseSource(githubPrefixMatch[1]);
|
|
98
98
|
const gitlabPrefixMatch = input.match(/^gitlab:(.+)$/);
|
|
99
|
-
if (gitlabPrefixMatch)
|
|
99
|
+
if (gitlabPrefixMatch) {
|
|
100
|
+
const rest = gitlabPrefixMatch[1];
|
|
101
|
+
const atIdx = rest.lastIndexOf("@");
|
|
102
|
+
const repoPart = atIdx > 0 ? rest.slice(0, atIdx).trim() : rest;
|
|
103
|
+
const skillPart = atIdx > 0 ? rest.slice(atIdx + 1).trim() : void 0;
|
|
104
|
+
const result = parseSource(`https://gitlab.com/${repoPart}`);
|
|
105
|
+
if (skillPart) result.skillFilter = skillPart;
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
100
108
|
const bitbucketPrefixMatch = input.match(/^bitbucket:(.+)$/);
|
|
101
|
-
if (bitbucketPrefixMatch)
|
|
109
|
+
if (bitbucketPrefixMatch) {
|
|
110
|
+
const rest = bitbucketPrefixMatch[1];
|
|
111
|
+
const atIdx = rest.lastIndexOf("@");
|
|
112
|
+
const repoPart = atIdx > 0 ? rest.slice(0, atIdx).trim() : rest;
|
|
113
|
+
const skillPart = atIdx > 0 ? rest.slice(atIdx + 1).trim() : void 0;
|
|
114
|
+
const result = parseSource(`https://bitbucket.org/${repoPart}`);
|
|
115
|
+
if (skillPart) result.skillFilter = skillPart;
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
102
118
|
const atIdx = input.lastIndexOf("@");
|
|
103
119
|
if (atIdx > 0) {
|
|
104
120
|
const pathPart = input.slice(0, atIdx).trim();
|
|
@@ -2117,7 +2133,7 @@ function createEmptyLocalLock() {
|
|
|
2117
2133
|
}
|
|
2118
2134
|
//#endregion
|
|
2119
2135
|
//#region package.json
|
|
2120
|
-
var version$1 = "1.0.
|
|
2136
|
+
var version$1 = "1.0.2";
|
|
2121
2137
|
//#endregion
|
|
2122
2138
|
//#region src/add.ts
|
|
2123
2139
|
const isCancelled$1 = (value) => typeof value === "symbol";
|
|
@@ -3271,12 +3287,19 @@ async function runAddAgent(agentSource, options = {}) {
|
|
|
3271
3287
|
const slug = agentName ? `${baseSlug}-${slugFromSource(agentName)}` : baseSlug;
|
|
3272
3288
|
const skillsList = Array.isArray(manifest.skills) ? manifest.skills : [];
|
|
3273
3289
|
if (skillsList.length > 0) M.info(`Installing ${skillsList.length} skill(s) from agent manifest...`);
|
|
3290
|
+
const hasExplicitProvider = (s) => /^(bitbucket:|github:|gitlab:|https?:\/\/)/i.test(String(s).trim());
|
|
3291
|
+
const resolveSkillSource = (s) => {
|
|
3292
|
+
const t = String(s).trim();
|
|
3293
|
+
if (parsed.type === "bitbucket" && !hasExplicitProvider(t)) return `bitbucket:${t}`;
|
|
3294
|
+
return t;
|
|
3295
|
+
};
|
|
3274
3296
|
for (const skillSource of skillsList) {
|
|
3275
3297
|
const trimmed = String(skillSource).trim();
|
|
3276
3298
|
if (!trimmed) continue;
|
|
3299
|
+
const resolved = resolveSkillSource(trimmed);
|
|
3277
3300
|
spinner.start(`Installing skill: ${trimmed}`);
|
|
3278
3301
|
try {
|
|
3279
|
-
await runAdd([
|
|
3302
|
+
await runAdd([resolved], options);
|
|
3280
3303
|
spinner.stop(`Installed: ${trimmed}`);
|
|
3281
3304
|
} catch (err) {
|
|
3282
3305
|
spinner.stop(`Failed: ${trimmed}`);
|