agentskillsdk 0.5.2 → 0.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentskillsdk",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Install agent skills from agentskills.dk",
5
5
  "type": "module",
6
6
  "bin": {
@@ -39,8 +39,10 @@ export async function downloadSkill(skill, destDir) {
39
39
  fileRelative = relativePath;
40
40
  }
41
41
  } else {
42
- if (header.type === 'file' && relativePath.startsWith(skillPath + '/')) {
43
- fileRelative = relativePath.slice(skillPath.length + 1);
42
+ const marker = skillPath + '/';
43
+ const idx = relativePath.indexOf(marker);
44
+ if (header.type === 'file' && idx !== -1) {
45
+ fileRelative = relativePath.slice(idx + marker.length);
44
46
  }
45
47
  }
46
48
 
@@ -68,4 +70,12 @@ export async function downloadSkill(skill, destDir) {
68
70
  );
69
71
 
70
72
  await Promise.all(filePromises);
73
+
74
+ if (filePromises.length === 0) {
75
+ throw new Error(
76
+ skillPath
77
+ ? `ingen filer fundet for "${skillPath}" i repository.`
78
+ : 'ingen filer fundet i repository.'
79
+ );
80
+ }
71
81
  }