skills 1.5.14 → 1.5.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +25 -22
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -2908,36 +2908,41 @@ async function fetchTreeBranch(ownerRepo, branch, token) {
2908
2908
  branch,
2909
2909
  tree: data.tree
2910
2910
  },
2911
- rateLimited: false
2911
+ rateLimited: false,
2912
+ authRetryable: false
2912
2913
  };
2913
2914
  }
2914
2915
  return {
2915
2916
  tree: null,
2916
- rateLimited: response.status === 403 && response.headers.get("x-ratelimit-remaining") === "0"
2917
+ rateLimited: response.status === 403 && response.headers.get("x-ratelimit-remaining") === "0",
2918
+ authRetryable: response.status === 401 || response.status === 404
2917
2919
  };
2918
2920
  } catch {
2919
2921
  return {
2920
2922
  tree: null,
2921
- rateLimited: false
2923
+ rateLimited: false,
2924
+ authRetryable: false
2922
2925
  };
2923
2926
  }
2924
2927
  }
2928
+ async function fetchTreeWithToken(ownerRepo, branches, getToken) {
2929
+ const token = getToken();
2930
+ if (!token) return null;
2931
+ for (const branch of branches) {
2932
+ const result = await fetchTreeBranch(ownerRepo, branch, token);
2933
+ if (result.tree) return result.tree;
2934
+ }
2935
+ return null;
2936
+ }
2925
2937
  async function fetchRepoTree(ownerRepo, ref, getToken) {
2926
2938
  const branches = ref ? [ref] : [
2927
2939
  "HEAD",
2928
2940
  "main",
2929
2941
  "master"
2930
2942
  ];
2931
- if (_rateLimitedThisSession && getToken) {
2932
- const token = getToken();
2933
- if (!token) return null;
2934
- for (const branch of branches) {
2935
- const result = await fetchTreeBranch(ownerRepo, branch, token);
2936
- if (result.tree) return result.tree;
2937
- }
2938
- return null;
2939
- }
2943
+ if (_rateLimitedThisSession && getToken) return fetchTreeWithToken(ownerRepo, branches, getToken);
2940
2944
  let rateLimited = false;
2945
+ let authRetryable = false;
2941
2946
  for (const branch of branches) {
2942
2947
  const result = await fetchTreeBranch(ownerRepo, branch, null);
2943
2948
  if (result.tree) return result.tree;
@@ -2945,16 +2950,14 @@ async function fetchRepoTree(ownerRepo, ref, getToken) {
2945
2950
  rateLimited = true;
2946
2951
  break;
2947
2952
  }
2953
+ if (result.authRetryable) {
2954
+ authRetryable = true;
2955
+ break;
2956
+ }
2948
2957
  }
2949
- if (!rateLimited || !getToken) return null;
2950
- _rateLimitedThisSession = true;
2951
- const token = getToken();
2952
- if (!token) return null;
2953
- for (const branch of branches) {
2954
- const result = await fetchTreeBranch(ownerRepo, branch, token);
2955
- if (result.tree) return result.tree;
2956
- }
2957
- return null;
2958
+ if (!getToken || !(rateLimited || authRetryable)) return null;
2959
+ if (rateLimited) _rateLimitedThisSession = true;
2960
+ return fetchTreeWithToken(ownerRepo, branches, getToken);
2958
2961
  }
2959
2962
  function getSkillFolderHashFromTree(tree, skillPath) {
2960
2963
  let folderPath = skillPath.replace(/\\/g, "/");
@@ -3147,7 +3150,7 @@ async function tryBlobInstall(ownerRepo, options = {}) {
3147
3150
  tree
3148
3151
  };
3149
3152
  }
3150
- var version$1 = "1.5.14";
3153
+ var version$1 = "1.5.15";
3151
3154
  const isCancelled$1 = (value) => typeof value === "symbol";
3152
3155
  const EVE_AGENT_LABEL = "eve agent";
3153
3156
  async function isSourcePrivate(source) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skills",
3
- "version": "1.5.14",
3
+ "version": "1.5.15",
4
4
  "description": "The open agent skills ecosystem",
5
5
  "type": "module",
6
6
  "bin": {