ali-skills 0.0.19 → 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: ".qoder/skills",
941
- globalSkillsDir: join(home, ".qoder/skills"),
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.19";
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***");
@@ -5283,6 +5283,16 @@ async function runConfig(args) {
5283
5283
  }
5284
5284
  }
5285
5285
  }
5286
+ function getUpdateComparisonStrategy(entry) {
5287
+ if (entry.sourceType === "internal") return {
5288
+ field: "commitHash",
5289
+ value: entry.commitHash
5290
+ };
5291
+ return {
5292
+ field: "skillFolderHash",
5293
+ value: entry.skillFolderHash
5294
+ };
5295
+ }
5286
5296
  const __dirname = dirname(fileURLToPath(import.meta.url));
5287
5297
  function getVersion() {
5288
5298
  try {
@@ -5299,6 +5309,18 @@ const BOLD = "\x1B[1m";
5299
5309
  const DIM = "\x1B[38;5;102m";
5300
5310
  const TEXT = "\x1B[38;5;145m";
5301
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
+ }
5302
5324
  const LOGO_LINES = [
5303
5325
  " █████╗ ██╗ ██╗ ███████╗██╗ ██╗██╗██╗ ██╗ ███████╗",
5304
5326
  "██╔══██╗██║ ██║ ██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝",
@@ -5405,6 +5427,9 @@ ${BOLD}Options:${RESET}
5405
5427
  --help, -h Show this help message
5406
5428
  --version, -v Show version number
5407
5429
 
5430
+ ${BOLD}Debug:${RESET}
5431
+ ALI_SKILLS_DEBUG_UPDATE=1 Print detailed logs for check/update diagnosis
5432
+
5408
5433
  ${BOLD}Examples:${RESET}
5409
5434
  ${DIM}$${RESET} ali-skills add group/project
5410
5435
  ${DIM}$${RESET} ali-skills add group/project -g
@@ -5697,7 +5722,7 @@ function readSkillLock() {
5697
5722
  function getSkipReason(entry) {
5698
5723
  if (entry.sourceType === "local") return "Local path";
5699
5724
  if (entry.sourceType === "git") return "Git URL (hash tracking not supported)";
5700
- if (!(entry.sourceType === "internal" ? entry.commitHash : entry.skillFolderHash)) return "No version hash available";
5725
+ if (!getUpdateComparisonStrategy(entry).value) return "No version hash available";
5701
5726
  if (!entry.skillPath) return "No skill path recorded";
5702
5727
  return "No version tracking";
5703
5728
  }
@@ -5962,8 +5987,10 @@ async function runUpdate(args = []) {
5962
5987
  const isGlobal = args.includes("-g") || args.includes("--global");
5963
5988
  const yesFlag = args.includes("-y") || args.includes("--yes");
5964
5989
  const skillArgs = args.filter((arg) => !arg.startsWith("-"));
5990
+ const debugUpdate = isUpdateDebugEnabled();
5965
5991
  console.log(`${TEXT}Checking for skill updates...${RESET}`);
5966
5992
  console.log();
5993
+ updateDebugLog(debugUpdate, `scope=${isGlobal ? "global" : "project"}, yes=${yesFlag}, requestedSkills=${skillArgs.length > 0 ? skillArgs.join(",") : "(all)"}`);
5967
5994
  const token = getGitHubToken();
5968
5995
  let skillsToCheck = {};
5969
5996
  let scopeLabel = "project";
@@ -5983,6 +6010,7 @@ async function runUpdate(args = []) {
5983
6010
  sourceType: entry.sourceType,
5984
6011
  sourceUrl,
5985
6012
  skillPath: entry.skillPath || "",
6013
+ commitHash: entry.commitHash,
5986
6014
  skillFolderHash: entry.skillFolderHash || entry.computedHash,
5987
6015
  installedAt: (/* @__PURE__ */ new Date()).toISOString(),
5988
6016
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -5990,6 +6018,7 @@ async function runUpdate(args = []) {
5990
6018
  }
5991
6019
  }
5992
6020
  const skillNames = Object.keys(skillsToCheck);
6021
+ updateDebugLog(debugUpdate, `loaded ${skillNames.length} skill(s) from ${isGlobal ? "~/.agents/.skill-lock.json" : "skills-lock.json"}`);
5993
6022
  if (skillNames.length === 0) {
5994
6023
  console.log(`${DIM}No ${scopeLabel}-level skills found.${RESET}`);
5995
6024
  console.log();
@@ -6002,9 +6031,12 @@ async function runUpdate(args = []) {
6002
6031
  for (const skillName of skillNames) {
6003
6032
  const entry = skillsToCheck[skillName];
6004
6033
  if (!entry) continue;
6005
- if (entry.sourceType === "internal" && projectLock) {
6006
- const localEntry = projectLock.skills[skillName];
6007
- if (!localEntry?.commitHash) {
6034
+ if (entry.sourceType === "internal") {
6035
+ const localEntry = projectLock?.skills[skillName];
6036
+ const commitHash = getUpdateComparisonStrategy(entry).value || getUpdateComparisonStrategy(localEntry || {}).value;
6037
+ const storedSkillPath = entry.skillPath || localEntry?.skillPath || "";
6038
+ updateDebugLog(debugUpdate, `checking internal skill=${skillName}, repo=${entry.source}, skillPath=${storedSkillPath || "(root)"}, hasCommitHash=${commitHash ? "yes" : "no"}`);
6039
+ if (!commitHash) {
6008
6040
  skipped.push({
6009
6041
  name: skillName,
6010
6042
  reason: "Reinstall required to enable update checking (missing commit hash)",
@@ -6013,14 +6045,18 @@ async function runUpdate(args = []) {
6013
6045
  continue;
6014
6046
  }
6015
6047
  try {
6016
- const skillPath = (localEntry.skillPath || "").replace(/\/?SKILL\.md$/i, "");
6048
+ const skillPath = storedSkillPath.replace(/\/?SKILL\.md$/i, "");
6017
6049
  const latestCommit = await fetchAliInternalCommitHash(entry.source, skillPath, null);
6018
- if (latestCommit && latestCommit !== localEntry.commitHash) availableUpdates.push({
6019
- name: skillName,
6020
- source: entry.source,
6021
- entry
6022
- });
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)"}`);
6023
6058
  } catch {
6059
+ updateDebugLog(debugUpdate, `failed to check internal skill=${skillName}`);
6024
6060
  skipped.push({
6025
6061
  name: skillName,
6026
6062
  reason: "Ali internal repository (API check failed)",
@@ -6108,10 +6144,17 @@ async function runUpdate(args = []) {
6108
6144
  console.log(`${TEXT}Updating ${selectedUpdates.length} ${scopeLabel} skill(s)...${RESET}`);
6109
6145
  console.log();
6110
6146
  const installedSkills = await listInstalledSkills({ global: isGlobal });
6147
+ updateDebugLog(debugUpdate, `listInstalledSkills(global=${isGlobal}) returned ${installedSkills.length} skill record(s)`);
6111
6148
  const installedAgentsBySkillName = /* @__PURE__ */ new Map();
6112
- for (const skill of installedSkills) installedAgentsBySkillName.set(skill.name.toLowerCase(), [...skill.agents]);
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
+ }
6113
6153
  let successCount = 0;
6114
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>";
6115
6158
  for (const update of selectedUpdates) {
6116
6159
  console.log(`${TEXT}Updating ${update.name}...${RESET}`);
6117
6160
  let skillFolder = update.entry.skillPath || "";
@@ -6130,7 +6173,14 @@ async function runUpdate(args = []) {
6130
6173
  const installedAgents = installedAgentsBySkillName.get(update.name.toLowerCase());
6131
6174
  if (!installedAgents || installedAgents.length === 0) {
6132
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)"}`);
6133
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}`);
6134
6184
  continue;
6135
6185
  }
6136
6186
  await runAdd([installUrl], {
@@ -6138,9 +6188,11 @@ async function runUpdate(args = []) {
6138
6188
  global: isGlobal,
6139
6189
  agent: installedAgents
6140
6190
  });
6191
+ updateDebugLog(debugUpdate, `updated ${update.name} with installUrl=${installUrl} targetAgents=${installedAgents.join(",")}`);
6141
6192
  successCount++;
6142
6193
  console.log(` ${TEXT}✓${RESET} Updated ${update.name}`);
6143
6194
  } catch {
6195
+ updateDebugLog(debugUpdate, `runAdd failed for ${update.name}`);
6144
6196
  failCount++;
6145
6197
  console.log(` ${DIM}✗ Failed to update ${update.name}${RESET}`);
6146
6198
  }
@@ -6148,6 +6200,7 @@ async function runUpdate(args = []) {
6148
6200
  console.log();
6149
6201
  if (successCount > 0) console.log(`${TEXT}✓ Updated ${successCount} skill(s)${RESET}`);
6150
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}`);
6151
6204
  track({
6152
6205
  event: "update",
6153
6206
  skillCount: String(selectedUpdates.length),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ali/cli-skills",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
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.19",
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.19"
34
+ "@ali/cli-skills": "^2.0.21"
35
35
  },
36
36
  "bundleDependencies": [
37
37
  "@ali/cli-skills"