ali-skills 0.0.17 → 0.0.18

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.
@@ -2000,8 +2000,12 @@ async function fetchSkillFolderHash(ownerRepo, skillPath, token) {
2000
2000
  if (folderPath.endsWith("/SKILL.md")) folderPath = folderPath.slice(0, -9);
2001
2001
  else if (folderPath.endsWith("SKILL.md")) folderPath = folderPath.slice(0, -8);
2002
2002
  if (folderPath.endsWith("/")) folderPath = folderPath.slice(0, -1);
2003
- for (const branch of ["main", "master"]) try {
2004
- const url = `https://api.github.com/repos/${ownerRepo}/git/trees/${branch}?recursive=1`;
2003
+ for (const ref of [
2004
+ "HEAD",
2005
+ "master",
2006
+ "main"
2007
+ ]) try {
2008
+ const url = `https://api.github.com/repos/${ownerRepo}/git/trees/${ref}?recursive=1`;
2005
2009
  const headers = {
2006
2010
  Accept: "application/vnd.github.v3+json",
2007
2011
  "User-Agent": "skills-cli"
@@ -2019,10 +2023,14 @@ async function fetchSkillFolderHash(ownerRepo, skillPath, token) {
2019
2023
  return null;
2020
2024
  }
2021
2025
  async function fetchAliInternalCommitHash(source, skillPath = "", token) {
2022
- const branches = ["main", "master"];
2026
+ const refs = [
2027
+ "HEAD",
2028
+ "master",
2029
+ "main"
2030
+ ];
2023
2031
  const privateToken = token || process.env.GITLAB_PRIVATE_TOKEN || process.env.CODE_ALIBABA_TOKEN || GITLAB_ACCOUNT.token;
2024
- for (const branch of branches) try {
2025
- let url = `https://code.alibaba-inc.com/api/v4/projects/${encodeURIComponent(source)}/repository/commits?ref_name=${branch}&per_page=1`;
2032
+ for (const ref of refs) try {
2033
+ let url = `https://code.alibaba-inc.com/api/v4/projects/${encodeURIComponent(source)}/repository/commits?ref_name=${ref}&per_page=1`;
2026
2034
  if (skillPath) url += `&path=${encodeURIComponent(skillPath)}`;
2027
2035
  const headers = {
2028
2036
  Accept: "application/json",
@@ -2031,8 +2039,8 @@ async function fetchAliInternalCommitHash(source, skillPath = "", token) {
2031
2039
  };
2032
2040
  const response = await fetch(url, { headers });
2033
2041
  if (!response.ok) continue;
2034
- const data = await response.json();
2035
- if (data && data.length > 0) return data[0].id;
2042
+ const latestCommit = (await response.json())[0];
2043
+ if (latestCommit?.id) return latestCommit.id;
2036
2044
  } catch {
2037
2045
  continue;
2038
2046
  }
@@ -2197,7 +2205,7 @@ function logSkillParseFailures(failures) {
2197
2205
  if (f.hint) M.message(import_picocolors.default.yellow(` 提示: ${f.hint}`));
2198
2206
  }
2199
2207
  }
2200
- var version$1 = "2.0.17";
2208
+ var version$1 = "2.0.18";
2201
2209
  const isCancelled$1 = (value) => typeof value === "symbol";
2202
2210
  function redactSensitiveText(text) {
2203
2211
  return text.replace(/(https?:\/\/)([^/\s:@]+)(?::([^@/\s]*))?@/gi, "$1").replace(/([?&](?:private_token|access_token|token|api_key|access_key|secret|password)=)[^&\s]+/gi, "$1***");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ali/cli-skills",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "description": "The open agent skills ecosystem",
5
5
  "type": "module",
6
6
  "bin": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ali-skills",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
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.17"
34
+ "@ali/cli-skills": "^2.0.18"
35
35
  },
36
36
  "bundleDependencies": [
37
37
  "@ali/cli-skills"