ali-skills 0.0.7 → 0.0.9
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.
|
@@ -2014,7 +2014,7 @@ function logSkillParseFailures(failures) {
|
|
|
2014
2014
|
if (f.hint) M.message(import_picocolors.default.yellow(` 提示: ${f.hint}`));
|
|
2015
2015
|
}
|
|
2016
2016
|
}
|
|
2017
|
-
var version$1 = "2.0.
|
|
2017
|
+
var version$1 = "2.0.7";
|
|
2018
2018
|
const isCancelled$1 = (value) => typeof value === "symbol";
|
|
2019
2019
|
async function isSourcePrivate(source) {
|
|
2020
2020
|
const ownerRepo = parseOwnerRepo(source);
|
|
@@ -3139,6 +3139,7 @@ const BOLD$2 = "\x1B[1m";
|
|
|
3139
3139
|
const DIM$2 = "\x1B[38;5;102m";
|
|
3140
3140
|
const TEXT$1 = "\x1B[38;5;145m";
|
|
3141
3141
|
const CYAN$1 = "\x1B[36m";
|
|
3142
|
+
const YELLOW$1 = "\x1B[33m";
|
|
3142
3143
|
const SKILLS_API_URL = process.env.SKILLS_API_URL;
|
|
3143
3144
|
const SEARCH_ENDPOINT = SKILLS_API_URL ? `${SKILLS_API_URL.replace(/\/+$/, "")}/search` : "https://next-ai-base.pre-fn.alibaba-inc.com/api/skills/search";
|
|
3144
3145
|
function formatInstalls(count) {
|
|
@@ -3147,6 +3148,9 @@ function formatInstalls(count) {
|
|
|
3147
3148
|
if (count >= 1e3) return `${(count / 1e3).toFixed(1).replace(/\.0$/, "")}K installs`;
|
|
3148
3149
|
return `${count} install${count === 1 ? "" : "s"}`;
|
|
3149
3150
|
}
|
|
3151
|
+
function buildSkillUrl(skill) {
|
|
3152
|
+
return `https://ali-skills.alibaba-inc.com/skills/${skill.source}/${skill.name}`;
|
|
3153
|
+
}
|
|
3150
3154
|
async function searchSkillsAPI(query) {
|
|
3151
3155
|
try {
|
|
3152
3156
|
const url = `${SEARCH_ENDPOINT}?q=${encodeURIComponent(query)}&limit=10`;
|
|
@@ -3157,8 +3161,14 @@ async function searchSkillsAPI(query) {
|
|
|
3157
3161
|
name: skill.name,
|
|
3158
3162
|
slug: skill.id,
|
|
3159
3163
|
source: skill.source || "",
|
|
3160
|
-
installs: skill.installs
|
|
3161
|
-
|
|
3164
|
+
installs: skill.installs,
|
|
3165
|
+
sourceType: skill.sourceType ?? "github"
|
|
3166
|
+
})).sort((a, b) => {
|
|
3167
|
+
const aIsInternal = a.sourceType === "internal" ? 1 : 0;
|
|
3168
|
+
const bIsInternal = b.sourceType === "internal" ? 1 : 0;
|
|
3169
|
+
if (bIsInternal !== aIsInternal) return bIsInternal - aIsInternal;
|
|
3170
|
+
return (b.installs || 0) - (a.installs || 0);
|
|
3171
|
+
});
|
|
3162
3172
|
} catch {
|
|
3163
3173
|
return [];
|
|
3164
3174
|
}
|
|
@@ -3199,8 +3209,9 @@ async function runSearchPrompt(initialQuery = "") {
|
|
|
3199
3209
|
const source = skill.source ? ` ${DIM$2}${skill.source}${RESET$2}` : "";
|
|
3200
3210
|
const installs = formatInstalls(skill.installs);
|
|
3201
3211
|
const installsBadge = installs ? ` ${CYAN$1}${installs}${RESET$2}` : "";
|
|
3212
|
+
const githubBadge = skill.sourceType === "github" ? ` ${YELLOW$1}GitHub${RESET$2}` : "";
|
|
3202
3213
|
const loadingIndicator = loading && i === 0 ? ` ${DIM$2}...${RESET$2}` : "";
|
|
3203
|
-
lines.push(` ${arrow} ${name}${source}${installsBadge}${loadingIndicator}`);
|
|
3214
|
+
lines.push(` ${arrow} ${name}${source}${githubBadge}${installsBadge}${loadingIndicator}`);
|
|
3204
3215
|
}
|
|
3205
3216
|
}
|
|
3206
3217
|
lines.push("");
|
|
@@ -3285,18 +3296,6 @@ async function runSearchPrompt(initialQuery = "") {
|
|
|
3285
3296
|
process.stdin.on("keypress", handleKeypress);
|
|
3286
3297
|
});
|
|
3287
3298
|
}
|
|
3288
|
-
function getOwnerRepoFromString(pkg) {
|
|
3289
|
-
const atIndex = pkg.lastIndexOf("@");
|
|
3290
|
-
const match = (atIndex > 0 ? pkg.slice(0, atIndex) : pkg).match(/^([^/]+)\/([^/]+)$/);
|
|
3291
|
-
if (match) return {
|
|
3292
|
-
owner: match[1],
|
|
3293
|
-
repo: match[2]
|
|
3294
|
-
};
|
|
3295
|
-
return null;
|
|
3296
|
-
}
|
|
3297
|
-
async function isRepoPublic(owner, repo) {
|
|
3298
|
-
return await isRepoPrivate(owner, repo) === false;
|
|
3299
|
-
}
|
|
3300
3299
|
async function runFind(args) {
|
|
3301
3300
|
const query = args.join(" ");
|
|
3302
3301
|
const isNonInteractive = !process.stdin.isTTY;
|
|
@@ -3314,13 +3313,15 @@ ${DIM$2} 2) npx @ali/cli-skills add <owner/repo@skill>${RESET$2}`;
|
|
|
3314
3313
|
console.log(`${DIM$2}No skills found for "${query}"${RESET$2}`);
|
|
3315
3314
|
return;
|
|
3316
3315
|
}
|
|
3317
|
-
console.log(`${DIM$2}Install with${RESET$2} npx
|
|
3316
|
+
console.log(`${DIM$2}Install with${RESET$2} npx ali-skills add <owner/repo>`);
|
|
3318
3317
|
console.log();
|
|
3319
3318
|
for (const skill of results.slice(0, 6)) {
|
|
3320
3319
|
const pkg = skill.source || skill.slug;
|
|
3321
3320
|
const installs = formatInstalls(skill.installs);
|
|
3322
|
-
|
|
3323
|
-
console.log(`${
|
|
3321
|
+
const githubBadge = skill.sourceType === "github" ? ` ${YELLOW$1}GitHub${RESET$2}` : "";
|
|
3322
|
+
console.log(`${TEXT$1}${pkg}@${skill.name}${RESET$2}${githubBadge}${installs ? ` ${CYAN$1}${installs}${RESET$2}` : ""}`);
|
|
3323
|
+
const skillUrl = buildSkillUrl(skill);
|
|
3324
|
+
console.log(`${DIM$2}└ ${skillUrl}${RESET$2}`);
|
|
3324
3325
|
console.log();
|
|
3325
3326
|
}
|
|
3326
3327
|
return;
|
|
@@ -3353,9 +3354,8 @@ ${DIM$2} 2) npx @ali/cli-skills add <owner/repo@skill>${RESET$2}`;
|
|
|
3353
3354
|
]);
|
|
3354
3355
|
await runAdd(source, options);
|
|
3355
3356
|
console.log();
|
|
3356
|
-
const
|
|
3357
|
-
|
|
3358
|
-
else console.log(`${DIM$2}Discover more skills at${RESET$2} ${TEXT$1}https://skills.sh${RESET$2}`);
|
|
3357
|
+
const skillUrl = buildSkillUrl(selected);
|
|
3358
|
+
console.log(`${DIM$2}View the skill at${RESET$2} ${TEXT$1}${skillUrl}${RESET$2}`);
|
|
3359
3359
|
console.log();
|
|
3360
3360
|
}
|
|
3361
3361
|
const isCancelled = (value) => typeof value === "symbol";
|
|
@@ -4281,12 +4281,12 @@ const BOLD = "\x1B[1m";
|
|
|
4281
4281
|
const DIM = "\x1B[38;5;102m";
|
|
4282
4282
|
const TEXT = "\x1B[38;5;145m";
|
|
4283
4283
|
const LOGO_LINES = [
|
|
4284
|
-
"███████╗██╗ ██╗██╗██╗ ██╗ ███████╗",
|
|
4285
|
-
"██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝",
|
|
4286
|
-
"███████╗█████╔╝ ██║██║ ██║ ███████╗",
|
|
4287
|
-
"╚════██║██╔═██╗ ██║██║ ██║ ╚════██║",
|
|
4288
|
-
"███████║██║ ██╗██║███████╗███████╗███████║",
|
|
4289
|
-
"╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚══════╝"
|
|
4284
|
+
" █████╗ ██╗ ██╗ ███████╗██╗ ██╗██╗██╗ ██╗ ███████╗",
|
|
4285
|
+
"██╔══██╗██║ ██║ ██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝",
|
|
4286
|
+
"███████║██║ ██║ ███████╗█████╔╝ ██║██║ ██║ ███████╗",
|
|
4287
|
+
"██╔══██║██║ ██║ ╚════██║██╔═██╗ ██║██║ ██║ ╚════██║",
|
|
4288
|
+
"██║ ██║███████╗██║ ███████║██║ ██╗██║███████╗███████╗███████║",
|
|
4289
|
+
"╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚══════╝"
|
|
4290
4290
|
];
|
|
4291
4291
|
const GRAYS = [
|
|
4292
4292
|
"\x1B[38;5;250m",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ali-skills",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
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.7"
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": [
|
|
37
37
|
"@ali/cli-skills"
|