ali-skills 0.0.14 → 0.0.15
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.
|
@@ -163,6 +163,16 @@ function parseSource(input) {
|
|
|
163
163
|
ref
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
+
const internalRepoWithSubpathMatch = input.match(/^(https?:\/\/(?:[^@/]+@)?(?:code|gitlab)\.alibaba-inc\.com)\/([^/]+)\/([^/]+)\/(.+)$/);
|
|
167
|
+
if (internalRepoWithSubpathMatch) {
|
|
168
|
+
const [, host, owner, repo, subpath] = internalRepoWithSubpathMatch;
|
|
169
|
+
if (!owner || !repo) throw new Error(`Invalid internal URL format: ${input}`);
|
|
170
|
+
return {
|
|
171
|
+
type: "internal",
|
|
172
|
+
url: `${host.replace("gitlab.alibaba-inc.com", "code.alibaba-inc.com")}/${owner}/${repo.replace(/\.git$/, "")}.git`,
|
|
173
|
+
subpath: sanitizeSubpath(subpath)
|
|
174
|
+
};
|
|
175
|
+
}
|
|
166
176
|
if (isInternalUrl(input)) return {
|
|
167
177
|
type: "internal",
|
|
168
178
|
url: input.replace(/\bgitlab\.alibaba-inc\.com\b/g, "code.alibaba-inc.com")
|
|
@@ -2122,7 +2132,7 @@ function logSkillParseFailures(failures) {
|
|
|
2122
2132
|
if (f.hint) M.message(import_picocolors.default.yellow(` 提示: ${f.hint}`));
|
|
2123
2133
|
}
|
|
2124
2134
|
}
|
|
2125
|
-
var version$1 = "2.0.
|
|
2135
|
+
var version$1 = "2.0.15";
|
|
2126
2136
|
const isCancelled$1 = (value) => typeof value === "symbol";
|
|
2127
2137
|
async function isSourcePrivate(source) {
|
|
2128
2138
|
const ownerRepo = parseOwnerRepo(source);
|
|
@@ -2662,7 +2672,8 @@ async function runAdd(args, options = {}) {
|
|
|
2662
2672
|
} else {
|
|
2663
2673
|
spinner.start("Cloning repository...");
|
|
2664
2674
|
try {
|
|
2665
|
-
|
|
2675
|
+
const ref = parsed.ref === "HEAD" ? void 0 : parsed.ref;
|
|
2676
|
+
tempDir = await cloneRepo(parsed.url, ref);
|
|
2666
2677
|
skillsDir = tempDir;
|
|
2667
2678
|
spinner.stop("Repository cloned");
|
|
2668
2679
|
} catch (cloneError) {
|
|
@@ -5935,11 +5946,14 @@ async function runUpdate(args = []) {
|
|
|
5935
5946
|
if (skillFolder.endsWith("/SKILL.md")) skillFolder = skillFolder.slice(0, -9);
|
|
5936
5947
|
else if (skillFolder.endsWith("SKILL.md")) skillFolder = skillFolder.slice(0, -8);
|
|
5937
5948
|
if (skillFolder.endsWith("/")) skillFolder = skillFolder.slice(0, -1);
|
|
5949
|
+
let sourceUrl = update.entry.sourceUrl || update.entry.source;
|
|
5950
|
+
if (update.entry.sourceType === "internal" && !sourceUrl.startsWith("http") && !sourceUrl.startsWith("git@")) sourceUrl = `https://code.alibaba-inc.com/${sourceUrl}.git`;
|
|
5951
|
+
else if (update.entry.sourceType === "github" && !sourceUrl.startsWith("http") && !sourceUrl.startsWith("git@")) sourceUrl = `https://github.com/${sourceUrl}.git`;
|
|
5938
5952
|
let installUrl;
|
|
5939
5953
|
if (skillFolder) {
|
|
5940
|
-
installUrl =
|
|
5941
|
-
installUrl = `${installUrl}/tree/
|
|
5942
|
-
} else installUrl =
|
|
5954
|
+
installUrl = sourceUrl.replace(/\.git$/, "").replace(/\/$/, "");
|
|
5955
|
+
installUrl = `${installUrl}/tree/HEAD/${skillFolder}`;
|
|
5956
|
+
} else installUrl = sourceUrl;
|
|
5943
5957
|
try {
|
|
5944
5958
|
await runAdd([installUrl], {
|
|
5945
5959
|
yes: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ali-skills",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "The open agent skills ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"author": "",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ali/cli-skills": "^2.0.
|
|
34
|
+
"@ali/cli-skills": "^2.0.15"
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": [
|
|
37
37
|
"@ali/cli-skills"
|