ali-skills 0.0.18 → 0.0.19

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.
@@ -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.18";
2208
+ var version$1 = "2.0.19";
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***");
@@ -5363,10 +5363,11 @@ ${BOLD}Publish:${RESET}
5363
5363
  ${BOLD}Updates:${RESET}
5364
5364
  check Check for available skill updates (project-level by default)
5365
5365
  check -g Check global skill updates
5366
+ check <skill> Check specific skill(s) for updates
5366
5367
  update Update skills interactively (project-level by default)
5367
5368
  update -g Update global skills
5368
5369
  update -y Update all skills without prompting
5369
- update <skill> Update specific skill(s)
5370
+ update <skill> Update specific skill(s)
5370
5371
 
5371
5372
  ${BOLD}Project:${RESET}
5372
5373
  experimental_install Restore skills from skills-lock.json
@@ -5419,6 +5420,7 @@ ${BOLD}Examples:${RESET}
5419
5420
  ${DIM}$${RESET} ali-skills find ${DIM}# interactive search${RESET}
5420
5421
  ${DIM}$${RESET} ali-skills find typescript ${DIM}# search by keyword${RESET}
5421
5422
  ${DIM}$${RESET} ali-skills check
5423
+ ${DIM}$${RESET} ali-skills check web-design react-best-practices
5422
5424
  ${DIM}$${RESET} ali-skills update
5423
5425
  ${DIM}$${RESET} ali-skills experimental_install ${DIM}# restore from skills-lock.json${RESET}
5424
5426
  ${DIM}$${RESET} ali-skills init my-skill
@@ -5776,6 +5778,7 @@ async function checkSkillsForUpdates(skills, token) {
5776
5778
  }
5777
5779
  async function runCheck(args = []) {
5778
5780
  const isGlobal = args.includes("-g") || args.includes("--global");
5781
+ const skillArgs = args.filter((arg) => !arg.startsWith("-"));
5779
5782
  console.log(`${TEXT}Checking for skill updates...${RESET}`);
5780
5783
  console.log();
5781
5784
  const token = getGitHubToken();
@@ -5785,19 +5788,31 @@ async function runCheck(args = []) {
5785
5788
  if (isGlobal) {
5786
5789
  const { lock: globalLock, isOutdated: isGlobalLockOutdated } = readSkillLock();
5787
5790
  const globalSkillNames = Object.keys(globalLock.skills);
5788
- skillCount = globalSkillNames.length;
5789
5791
  if (globalSkillNames.length === 0) {
5790
5792
  console.log(`${DIM}No global skills found.${RESET}`);
5791
5793
  console.log();
5792
5794
  return;
5793
5795
  }
5796
+ let globalSkillsToCheck = globalLock.skills;
5797
+ if (skillArgs.length > 0) {
5798
+ const requestedSkills = skillArgs.map((s) => s.toLowerCase());
5799
+ globalSkillsToCheck = Object.fromEntries(Object.entries(globalLock.skills).filter(([name]) => requestedSkills.includes(name.toLowerCase())));
5800
+ for (const reqSkill of skillArgs) if (!globalSkillNames.some((n) => n.toLowerCase() === reqSkill.toLowerCase())) console.log(`${DIM}Skill not found: ${reqSkill}${RESET}`);
5801
+ }
5802
+ const selectedGlobalSkillNames = Object.keys(globalSkillsToCheck);
5803
+ if (selectedGlobalSkillNames.length === 0) {
5804
+ console.log(`${DIM}No matching global skills to check.${RESET}`);
5805
+ console.log();
5806
+ return;
5807
+ }
5808
+ skillCount = selectedGlobalSkillNames.length;
5794
5809
  console.log(`${BOLD}Global skills${RESET}`);
5795
- console.log(`${DIM}Checking ${globalSkillNames.length} skill(s)...${RESET}`);
5796
- const result = await checkSkillsForUpdates(globalLock.skills, token);
5810
+ console.log(`${DIM}Checking ${selectedGlobalSkillNames.length} skill(s)...${RESET}`);
5811
+ const result = await checkSkillsForUpdates(globalSkillsToCheck, token);
5797
5812
  updates = result.updates;
5798
5813
  result.errors;
5799
5814
  skipped = result.skipped;
5800
- if (updates.length === 0) console.log(`${TEXT} ✓ All global skills are up to date${RESET}`);
5815
+ if (updates.length === 0) console.log(`${TEXT} ✓ ${skillArgs.length > 0 ? "All selected global skills are up to date" : "All global skills are up to date"}${RESET}`);
5801
5816
  else {
5802
5817
  console.log(`${TEXT} ${updates.length} update(s) available:${RESET}`);
5803
5818
  for (const update of updates) console.log(` ${TEXT}↑${RESET} ${update.name} ${DIM}(${update.source})${RESET}`);
@@ -5821,16 +5836,28 @@ async function runCheck(args = []) {
5821
5836
  } else {
5822
5837
  const { lock: projectLock, isOutdated: isLocalLockOutdated } = await readLocalLock();
5823
5838
  const projectSkillNames = Object.keys(projectLock.skills);
5824
- skillCount = projectSkillNames.length;
5825
5839
  if (projectSkillNames.length === 0) {
5826
5840
  console.log(`${DIM}No project-level skills found.${RESET}`);
5827
5841
  console.log();
5828
5842
  console.log(`${DIM}To check global skills, use:${RESET} ${TEXT}npx ali-skills check -g${RESET}`);
5829
5843
  return;
5830
5844
  }
5845
+ let projectSkillsToCheck = projectLock.skills;
5846
+ if (skillArgs.length > 0) {
5847
+ const requestedSkills = skillArgs.map((s) => s.toLowerCase());
5848
+ projectSkillsToCheck = Object.fromEntries(Object.entries(projectLock.skills).filter(([name]) => requestedSkills.includes(name.toLowerCase())));
5849
+ for (const reqSkill of skillArgs) if (!projectSkillNames.some((n) => n.toLowerCase() === reqSkill.toLowerCase())) console.log(`${DIM}Skill not found: ${reqSkill}${RESET}`);
5850
+ }
5851
+ const selectedProjectSkillNames = Object.keys(projectSkillsToCheck);
5852
+ if (selectedProjectSkillNames.length === 0) {
5853
+ console.log(`${DIM}No matching project-level skills to check.${RESET}`);
5854
+ console.log();
5855
+ return;
5856
+ }
5857
+ skillCount = selectedProjectSkillNames.length;
5831
5858
  console.log(`${BOLD}Project-level skills${RESET}`);
5832
- console.log(`${DIM}Checking ${projectSkillNames.length} skill(s)...${RESET}`);
5833
- for (const [skillName, entry] of Object.entries(projectLock.skills)) {
5859
+ console.log(`${DIM}Checking ${selectedProjectSkillNames.length} skill(s)...${RESET}`);
5860
+ for (const [skillName, entry] of Object.entries(projectSkillsToCheck)) {
5834
5861
  if (entry.sourceType === "internal") {
5835
5862
  if (!entry.commitHash) {
5836
5863
  skipped.push({
@@ -5905,7 +5932,7 @@ async function runCheck(args = []) {
5905
5932
  sourceUrl: entry.source
5906
5933
  });
5907
5934
  }
5908
- if (updates.length === 0) console.log(`${TEXT} ✓ All project skills are up to date${RESET}`);
5935
+ if (updates.length === 0) console.log(`${TEXT} ✓ ${skillArgs.length > 0 ? "All selected project skills are up to date" : "All project skills are up to date"}${RESET}`);
5909
5936
  else {
5910
5937
  console.log(`${TEXT} ${updates.length} update(s) available:${RESET}`);
5911
5938
  for (const update of updates) console.log(` ${TEXT}↑${RESET} ${update.name} ${DIM}(${update.source})${RESET}`);
@@ -6080,6 +6107,9 @@ async function runUpdate(args = []) {
6080
6107
  console.log();
6081
6108
  console.log(`${TEXT}Updating ${selectedUpdates.length} ${scopeLabel} skill(s)...${RESET}`);
6082
6109
  console.log();
6110
+ const installedSkills = await listInstalledSkills({ global: isGlobal });
6111
+ const installedAgentsBySkillName = /* @__PURE__ */ new Map();
6112
+ for (const skill of installedSkills) installedAgentsBySkillName.set(skill.name.toLowerCase(), [...skill.agents]);
6083
6113
  let successCount = 0;
6084
6114
  let failCount = 0;
6085
6115
  for (const update of selectedUpdates) {
@@ -6097,9 +6127,16 @@ async function runUpdate(args = []) {
6097
6127
  installUrl = `${installUrl}/tree/HEAD/${skillFolder}`;
6098
6128
  } else installUrl = sourceUrl;
6099
6129
  try {
6130
+ const installedAgents = installedAgentsBySkillName.get(update.name.toLowerCase());
6131
+ if (!installedAgents || installedAgents.length === 0) {
6132
+ failCount++;
6133
+ console.log(` ${DIM}✗ Skipped ${update.name}: unable to determine installed agents for safe update${RESET}`);
6134
+ continue;
6135
+ }
6100
6136
  await runAdd([installUrl], {
6101
6137
  yes: true,
6102
- global: isGlobal
6138
+ global: isGlobal,
6139
+ agent: installedAgents
6103
6140
  });
6104
6141
  successCount++;
6105
6142
  console.log(` ${TEXT}✓${RESET} Updated ${update.name}`);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ali/cli-skills",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
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.18",
3
+ "version": "0.0.19",
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.18"
34
+ "@ali/cli-skills": "^2.0.19"
35
35
  },
36
36
  "bundleDependencies": [
37
37
  "@ali/cli-skills"