skills 1.5.13 → 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.
- package/dist/cli.mjs +36 -36
- 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 ||
|
|
2950
|
-
_rateLimitedThisSession = true;
|
|
2951
|
-
|
|
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,8 +3150,9 @@ async function tryBlobInstall(ownerRepo, options = {}) {
|
|
|
3147
3150
|
tree
|
|
3148
3151
|
};
|
|
3149
3152
|
}
|
|
3150
|
-
var version$1 = "1.5.
|
|
3153
|
+
var version$1 = "1.5.15";
|
|
3151
3154
|
const isCancelled$1 = (value) => typeof value === "symbol";
|
|
3155
|
+
const EVE_AGENT_LABEL = "eve agent";
|
|
3152
3156
|
async function isSourcePrivate(source) {
|
|
3153
3157
|
const ownerRepo = parseOwnerRepo(source);
|
|
3154
3158
|
if (!ownerRepo) return false;
|
|
@@ -3220,6 +3224,13 @@ function formatList$1(items, maxShow = 5) {
|
|
|
3220
3224
|
const remaining = items.length - maxShow;
|
|
3221
3225
|
return `${shown.join(", ")} +${remaining} more`;
|
|
3222
3226
|
}
|
|
3227
|
+
function formatSkillPromptSubject(skills) {
|
|
3228
|
+
const namedSubject = formatList$1(skills.map((skill) => import_picocolors.default.cyan(getSkillDisplayName(skill))), 3);
|
|
3229
|
+
return stripTerminalEscapes(namedSubject).length <= 80 ? namedSubject : `${skills.length} selected skills`;
|
|
3230
|
+
}
|
|
3231
|
+
function formatEveInstallPromptMessage(skills) {
|
|
3232
|
+
return `Detected an eve project. Install ${formatSkillPromptSubject(skills)} for your ${EVE_AGENT_LABEL} to use?`;
|
|
3233
|
+
}
|
|
3223
3234
|
function splitAgentsByType(agentTypes) {
|
|
3224
3235
|
const universal = [];
|
|
3225
3236
|
const symlinked = [];
|
|
@@ -3687,16 +3698,6 @@ async function runAdd(args, options = {}) {
|
|
|
3687
3698
|
if (!ownerRepo) return Promise.resolve(null);
|
|
3688
3699
|
return isRepoPrivate(ownerRepo.owner, ownerRepo.repo).catch(() => null);
|
|
3689
3700
|
})();
|
|
3690
|
-
if (ownerRepoRaw?.split("/")[0]?.toLowerCase() === "openclaw" && !options.dangerouslyAcceptOpenclawRisks) {
|
|
3691
|
-
console.log();
|
|
3692
|
-
M.warn(import_picocolors.default.yellow(import_picocolors.default.bold("⚠ OpenClaw skills are unverified community submissions.")));
|
|
3693
|
-
M.message(import_picocolors.default.yellow("This source contains user-submitted skills that have not been reviewed for safety or quality."));
|
|
3694
|
-
M.message(import_picocolors.default.yellow("Skills run with full agent permissions and could be malicious."));
|
|
3695
|
-
console.log();
|
|
3696
|
-
M.message(`If you understand the risks, re-run with:\n\n ${import_picocolors.default.cyan(`npx skills add ${source} --dangerously-accept-openclaw-risks`)}\n`);
|
|
3697
|
-
Se(import_picocolors.default.red("Installation blocked"));
|
|
3698
|
-
process.exit(1);
|
|
3699
|
-
}
|
|
3700
3701
|
if (parsed.type === "well-known") {
|
|
3701
3702
|
await handleWellKnownSkills(source, parsed.url, options, spinner);
|
|
3702
3703
|
return;
|
|
@@ -3890,7 +3891,7 @@ async function runAdd(args, options = {}) {
|
|
|
3890
3891
|
spinner.stop(`${totalAgents} agents`);
|
|
3891
3892
|
if (installedAgents.includes("eve") && (options.yes || !agentResult.isAgent)) {
|
|
3892
3893
|
const useEve = options.yes ? true : await ye({
|
|
3893
|
-
message:
|
|
3894
|
+
message: formatEveInstallPromptMessage(selectedSkills),
|
|
3894
3895
|
initialValue: true
|
|
3895
3896
|
});
|
|
3896
3897
|
if (pD(useEve)) {
|
|
@@ -3900,7 +3901,7 @@ async function runAdd(args, options = {}) {
|
|
|
3900
3901
|
}
|
|
3901
3902
|
if (useEve) {
|
|
3902
3903
|
targetAgents = ["eve"];
|
|
3903
|
-
M.info(`Installing to: ${import_picocolors.default.cyan(
|
|
3904
|
+
M.info(`Installing to: ${import_picocolors.default.cyan(EVE_AGENT_LABEL)}`);
|
|
3904
3905
|
} else {
|
|
3905
3906
|
const selected = await selectAgentsInteractive({ global: options.global });
|
|
3906
3907
|
if (pD(selected)) {
|
|
@@ -4366,8 +4367,7 @@ function parseAddOptions(args) {
|
|
|
4366
4367
|
nextArg = args[i];
|
|
4367
4368
|
}
|
|
4368
4369
|
i--;
|
|
4369
|
-
} else if (arg
|
|
4370
|
-
else if (arg && !arg.startsWith("-")) source.push(arg);
|
|
4370
|
+
} else if (arg && !arg.startsWith("-")) source.push(arg);
|
|
4371
4371
|
}
|
|
4372
4372
|
return {
|
|
4373
4373
|
source,
|