agentskillsdk 0.5.1 → 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.1",
3
+ "version": "0.5.3",
4
4
  "description": "Install agent skills from agentskills.dk",
5
5
  "type": "module",
6
6
  "bin": {
@@ -123,11 +123,9 @@ export async function addCommand(skillName, options) {
123
123
  } else if (options.project) {
124
124
  scope = 'project';
125
125
  } else {
126
- // Build hint using first agent (representative)
127
- const a = agents[0];
128
126
  const result = await selectPrompt(chalk.bold(`hvor skal "${installName}" installeres?`), [
129
- { label: 'projekt', hint: `(lokalt ${a.folder}/skills/)`, value: 'project' },
130
- { label: 'globalt', hint: `(~/${a.globalFolder}/skills/)`, value: 'global' },
127
+ { label: 'projekt', hint: '(lokalt .agents/skills/)', value: 'project' },
128
+ { label: 'globalt', hint: '(~/.agents/skills/)', value: 'global' },
131
129
  ]);
132
130
 
133
131
  if (result === null) {
@@ -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
  }