ali-skills 0.0.20 → 0.0.21
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.
|
@@ -937,8 +937,8 @@ const agents = {
|
|
|
937
937
|
qoder: {
|
|
938
938
|
name: "qoder",
|
|
939
939
|
displayName: "Qoder",
|
|
940
|
-
skillsDir: ".
|
|
941
|
-
globalSkillsDir: join(home, ".
|
|
940
|
+
skillsDir: ".agents/skills",
|
|
941
|
+
globalSkillsDir: join(home, ".agents/skills"),
|
|
942
942
|
detectInstalled: async () => {
|
|
943
943
|
return existsSync(join(home, ".qoder"));
|
|
944
944
|
}
|
|
@@ -2205,7 +2205,7 @@ function logSkillParseFailures(failures) {
|
|
|
2205
2205
|
if (f.hint) M.message(import_picocolors.default.yellow(` 提示: ${f.hint}`));
|
|
2206
2206
|
}
|
|
2207
2207
|
}
|
|
2208
|
-
var version$1 = "2.0.
|
|
2208
|
+
var version$1 = "2.0.21";
|
|
2209
2209
|
const isCancelled$1 = (value) => typeof value === "symbol";
|
|
2210
2210
|
function redactSensitiveText(text) {
|
|
2211
2211
|
return text.replace(/(https?:\/\/)([^/\s:@]+)(?::([^@/\s]*))?@/gi, "$1").replace(/([?&](?:private_token|access_token|token|api_key|access_key|secret|password)=)[^&\s]+/gi, "$1***");
|
|
@@ -5309,6 +5309,18 @@ const BOLD = "\x1B[1m";
|
|
|
5309
5309
|
const DIM = "\x1B[38;5;102m";
|
|
5310
5310
|
const TEXT = "\x1B[38;5;145m";
|
|
5311
5311
|
const YELLOW = "\x1B[33m";
|
|
5312
|
+
function isTruthyEnv(value) {
|
|
5313
|
+
if (!value) return false;
|
|
5314
|
+
const normalized = value.trim().toLowerCase();
|
|
5315
|
+
return normalized !== "" && normalized !== "0" && normalized !== "false" && normalized !== "off";
|
|
5316
|
+
}
|
|
5317
|
+
function isUpdateDebugEnabled() {
|
|
5318
|
+
return isTruthyEnv(process.env.ALI_SKILLS_DEBUG_UPDATE) || isTruthyEnv(process.env.DEBUG);
|
|
5319
|
+
}
|
|
5320
|
+
function updateDebugLog(enabled, message) {
|
|
5321
|
+
if (!enabled) return;
|
|
5322
|
+
console.log(`${DIM}[update-debug]${RESET} ${message}`);
|
|
5323
|
+
}
|
|
5312
5324
|
const LOGO_LINES = [
|
|
5313
5325
|
" █████╗ ██╗ ██╗ ███████╗██╗ ██╗██╗██╗ ██╗ ███████╗",
|
|
5314
5326
|
"██╔══██╗██║ ██║ ██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝",
|
|
@@ -5415,6 +5427,9 @@ ${BOLD}Options:${RESET}
|
|
|
5415
5427
|
--help, -h Show this help message
|
|
5416
5428
|
--version, -v Show version number
|
|
5417
5429
|
|
|
5430
|
+
${BOLD}Debug:${RESET}
|
|
5431
|
+
ALI_SKILLS_DEBUG_UPDATE=1 Print detailed logs for check/update diagnosis
|
|
5432
|
+
|
|
5418
5433
|
${BOLD}Examples:${RESET}
|
|
5419
5434
|
${DIM}$${RESET} ali-skills add group/project
|
|
5420
5435
|
${DIM}$${RESET} ali-skills add group/project -g
|
|
@@ -5972,8 +5987,10 @@ async function runUpdate(args = []) {
|
|
|
5972
5987
|
const isGlobal = args.includes("-g") || args.includes("--global");
|
|
5973
5988
|
const yesFlag = args.includes("-y") || args.includes("--yes");
|
|
5974
5989
|
const skillArgs = args.filter((arg) => !arg.startsWith("-"));
|
|
5990
|
+
const debugUpdate = isUpdateDebugEnabled();
|
|
5975
5991
|
console.log(`${TEXT}Checking for skill updates...${RESET}`);
|
|
5976
5992
|
console.log();
|
|
5993
|
+
updateDebugLog(debugUpdate, `scope=${isGlobal ? "global" : "project"}, yes=${yesFlag}, requestedSkills=${skillArgs.length > 0 ? skillArgs.join(",") : "(all)"}`);
|
|
5977
5994
|
const token = getGitHubToken();
|
|
5978
5995
|
let skillsToCheck = {};
|
|
5979
5996
|
let scopeLabel = "project";
|
|
@@ -6001,6 +6018,7 @@ async function runUpdate(args = []) {
|
|
|
6001
6018
|
}
|
|
6002
6019
|
}
|
|
6003
6020
|
const skillNames = Object.keys(skillsToCheck);
|
|
6021
|
+
updateDebugLog(debugUpdate, `loaded ${skillNames.length} skill(s) from ${isGlobal ? "~/.agents/.skill-lock.json" : "skills-lock.json"}`);
|
|
6004
6022
|
if (skillNames.length === 0) {
|
|
6005
6023
|
console.log(`${DIM}No ${scopeLabel}-level skills found.${RESET}`);
|
|
6006
6024
|
console.log();
|
|
@@ -6017,6 +6035,7 @@ async function runUpdate(args = []) {
|
|
|
6017
6035
|
const localEntry = projectLock?.skills[skillName];
|
|
6018
6036
|
const commitHash = getUpdateComparisonStrategy(entry).value || getUpdateComparisonStrategy(localEntry || {}).value;
|
|
6019
6037
|
const storedSkillPath = entry.skillPath || localEntry?.skillPath || "";
|
|
6038
|
+
updateDebugLog(debugUpdate, `checking internal skill=${skillName}, repo=${entry.source}, skillPath=${storedSkillPath || "(root)"}, hasCommitHash=${commitHash ? "yes" : "no"}`);
|
|
6020
6039
|
if (!commitHash) {
|
|
6021
6040
|
skipped.push({
|
|
6022
6041
|
name: skillName,
|
|
@@ -6028,12 +6047,16 @@ async function runUpdate(args = []) {
|
|
|
6028
6047
|
try {
|
|
6029
6048
|
const skillPath = storedSkillPath.replace(/\/?SKILL\.md$/i, "");
|
|
6030
6049
|
const latestCommit = await fetchAliInternalCommitHash(entry.source, skillPath, null);
|
|
6031
|
-
if (latestCommit && latestCommit !== commitHash)
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6050
|
+
if (latestCommit && latestCommit !== commitHash) {
|
|
6051
|
+
availableUpdates.push({
|
|
6052
|
+
name: skillName,
|
|
6053
|
+
source: entry.source,
|
|
6054
|
+
entry
|
|
6055
|
+
});
|
|
6056
|
+
updateDebugLog(debugUpdate, `update available for ${skillName}: local=${commitHash?.slice(0, 12)} remote=${latestCommit.slice(0, 12)}`);
|
|
6057
|
+
} else updateDebugLog(debugUpdate, `no update for ${skillName}: local=${commitHash?.slice(0, 12)} remote=${latestCommit?.slice(0, 12) || "(empty)"}`);
|
|
6036
6058
|
} catch {
|
|
6059
|
+
updateDebugLog(debugUpdate, `failed to check internal skill=${skillName}`);
|
|
6037
6060
|
skipped.push({
|
|
6038
6061
|
name: skillName,
|
|
6039
6062
|
reason: "Ali internal repository (API check failed)",
|
|
@@ -6121,10 +6144,17 @@ async function runUpdate(args = []) {
|
|
|
6121
6144
|
console.log(`${TEXT}Updating ${selectedUpdates.length} ${scopeLabel} skill(s)...${RESET}`);
|
|
6122
6145
|
console.log();
|
|
6123
6146
|
const installedSkills = await listInstalledSkills({ global: isGlobal });
|
|
6147
|
+
updateDebugLog(debugUpdate, `listInstalledSkills(global=${isGlobal}) returned ${installedSkills.length} skill record(s)`);
|
|
6124
6148
|
const installedAgentsBySkillName = /* @__PURE__ */ new Map();
|
|
6125
|
-
for (const skill of installedSkills)
|
|
6149
|
+
for (const skill of installedSkills) {
|
|
6150
|
+
installedAgentsBySkillName.set(skill.name.toLowerCase(), [...skill.agents]);
|
|
6151
|
+
updateDebugLog(debugUpdate, `installed skill=${skill.name}, scope=${skill.scope}, agents=${skill.agents.length > 0 ? skill.agents.join(",") : "(none)"}, path=${skill.path}`);
|
|
6152
|
+
}
|
|
6126
6153
|
let successCount = 0;
|
|
6127
6154
|
let failCount = 0;
|
|
6155
|
+
let safeSkipCount = 0;
|
|
6156
|
+
const listCommand = isGlobal ? "npx ali-skills list -g" : "npx ali-skills list";
|
|
6157
|
+
const canonicalSkillDir = isGlobal ? "~/.agents/skills/<skill-name>" : ".agents/skills/<skill-name>";
|
|
6128
6158
|
for (const update of selectedUpdates) {
|
|
6129
6159
|
console.log(`${TEXT}Updating ${update.name}...${RESET}`);
|
|
6130
6160
|
let skillFolder = update.entry.skillPath || "";
|
|
@@ -6143,7 +6173,14 @@ async function runUpdate(args = []) {
|
|
|
6143
6173
|
const installedAgents = installedAgentsBySkillName.get(update.name.toLowerCase());
|
|
6144
6174
|
if (!installedAgents || installedAgents.length === 0) {
|
|
6145
6175
|
failCount++;
|
|
6176
|
+
safeSkipCount++;
|
|
6177
|
+
const nearMatches = installedSkills.filter((s) => s.name.toLowerCase().includes(update.name.toLowerCase())).map((s) => s.name);
|
|
6178
|
+
updateDebugLog(debugUpdate, `skip ${update.name}: no installed agents found in current scope. nearMatches=${nearMatches.length > 0 ? nearMatches.join(",") : "(none)"}`);
|
|
6146
6179
|
console.log(` ${DIM}✗ Skipped ${update.name}: unable to determine installed agents for safe update${RESET}`);
|
|
6180
|
+
console.log(` ${DIM}Tips:${RESET}`);
|
|
6181
|
+
console.log(` ${DIM}- Run ${TEXT}${listCommand}${RESET}${DIM} to verify whether ${update.name} was accidentally removed${RESET}`);
|
|
6182
|
+
console.log(` ${DIM}- In symlink mode, deleting ${canonicalSkillDir} removes the skill entity and can remove it from all agents${RESET}`);
|
|
6183
|
+
console.log(` ${DIM}- If you see duplicated skills, delete the one under agent-specific skills dir first, then report duplicate detection to ali-skills maintainers${RESET}`);
|
|
6147
6184
|
continue;
|
|
6148
6185
|
}
|
|
6149
6186
|
await runAdd([installUrl], {
|
|
@@ -6151,9 +6188,11 @@ async function runUpdate(args = []) {
|
|
|
6151
6188
|
global: isGlobal,
|
|
6152
6189
|
agent: installedAgents
|
|
6153
6190
|
});
|
|
6191
|
+
updateDebugLog(debugUpdate, `updated ${update.name} with installUrl=${installUrl} targetAgents=${installedAgents.join(",")}`);
|
|
6154
6192
|
successCount++;
|
|
6155
6193
|
console.log(` ${TEXT}✓${RESET} Updated ${update.name}`);
|
|
6156
6194
|
} catch {
|
|
6195
|
+
updateDebugLog(debugUpdate, `runAdd failed for ${update.name}`);
|
|
6157
6196
|
failCount++;
|
|
6158
6197
|
console.log(` ${DIM}✗ Failed to update ${update.name}${RESET}`);
|
|
6159
6198
|
}
|
|
@@ -6161,6 +6200,7 @@ async function runUpdate(args = []) {
|
|
|
6161
6200
|
console.log();
|
|
6162
6201
|
if (successCount > 0) console.log(`${TEXT}✓ Updated ${successCount} skill(s)${RESET}`);
|
|
6163
6202
|
if (failCount > 0) console.log(`${DIM}Failed to update ${failCount} skill(s)${RESET}`);
|
|
6203
|
+
if (safeSkipCount > 0 && !debugUpdate) console.log(`${DIM}Tip: re-run with ALI_SKILLS_DEBUG_UPDATE=1 to inspect installed-agent detection details${RESET}`);
|
|
6164
6204
|
track({
|
|
6165
6205
|
event: "update",
|
|
6166
6206
|
skillCount: String(selectedUpdates.length),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ali-skills",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
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.21"
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": [
|
|
37
37
|
"@ali/cli-skills"
|