agentskillsdk 0.5.0 → 0.5.2

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.0",
3
+ "version": "0.5.2",
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) {
@@ -27,28 +27,28 @@ export const AGENTS = [
27
27
  makeAgent('Cline', '.cline'),
28
28
  makeAgent('Claude Code', '.claude'),
29
29
  makeAgent('CodeBuddy', '.codebuddy'),
30
- makeAgent('Codex CLI', '.agents', { globalFolder: '.codex', universal: true }),
30
+ makeAgent('Codex CLI', '.agents', { globalFolder: '.codex', detectFolder: '.codex', universal: true }),
31
31
  makeAgent('Command Code', '.commandcode'),
32
32
  makeAgent('Continue', '.continue'),
33
33
  makeAgent('Crush', '.crush'),
34
- makeAgent('Cursor', '.agents', { globalFolder: '.cursor', universal: true }),
34
+ makeAgent('Cursor', '.agents', { globalFolder: '.cursor', detectFolder: '.cursor', universal: true }),
35
35
  makeAgent('Droid', '.factory'),
36
- makeAgent('Gemini CLI', '.agents', { universal: true }),
36
+ makeAgent('Gemini CLI', '.agents', { detectFolder: '.gemini', universal: true }),
37
37
  makeAgent('GitHub Copilot', '.agents', { detectFolder: '.github/skills', globalFolder: '.github', universal: true }),
38
38
  makeAgent('Goose', '.goose'),
39
39
  makeAgent('Kilo Code', '.kilocode'),
40
- makeAgent('Kimi CLI', '.agents', { universal: true }),
40
+ makeAgent('Kimi CLI', '.agents', { detectFolder: '.kimi', universal: true }),
41
41
  makeAgent('Kiro CLI', '.kiro'),
42
42
  makeAgent('MCPJam', '.mcpjam'),
43
43
  makeAgent('Mux', '.mux'),
44
44
  makeAgent('Neovate', '.neovate'),
45
45
  makeAgent('OpenClaw', '.openclaw'),
46
- makeAgent('OpenCode', '.agents', { globalFolder: '.opencode', universal: true }),
46
+ makeAgent('OpenCode', '.agents', { globalFolder: '.opencode', detectFolder: '.opencode', universal: true }),
47
47
  makeAgent('OpenHands', '.openhands'),
48
48
  makeAgent('Pi', '.pi'),
49
49
  makeAgent('Qoder', '.qoder'),
50
50
  makeAgent('Qwen Code', '.qwen'),
51
- makeAgent('Replit', '.agents', { universal: true }),
51
+ makeAgent('Replit', '.agents', { detectFolder: '.replit', universal: true }),
52
52
  makeAgent('Roo Code', '.roo'),
53
53
  makeAgent('Trae', '.trae'),
54
54
  makeAgent('Windsurf', '.windsurf'),
package/src/lib/prompt.js CHANGED
@@ -134,9 +134,10 @@ export function selectPrompt(question, choices, { defaultIndex = 0 } = {}) {
134
134
  * @param {{ label: string, value: any }[]} choices
135
135
  * @returns {Promise<any[]|null>} array of selected values, or null if Esc
136
136
  */
137
- export function checkboxPrompt(question, choices) {
137
+ export function checkboxPrompt(question, choices, { pageSize = 10 } = {}) {
138
138
  return new Promise((resolve) => {
139
139
  let cursor = 0;
140
+ let scrollOffset = 0;
140
141
  const checked = new Array(choices.length).fill(false);
141
142
  const { stdin, stdout } = process;
142
143
  const cols = stdout.columns || 80;
@@ -151,11 +152,20 @@ export function checkboxPrompt(question, choices) {
151
152
  }
152
153
 
153
154
  function render() {
154
- const lines = choices.map((c, i) => {
155
+ const visible = choices.slice(scrollOffset, scrollOffset + pageSize);
156
+ const lines = visible.map((c, vi) => {
157
+ const i = vi + scrollOffset;
155
158
  const box = checked[i] ? orange('◼') : '◻';
156
159
  const label = i === cursor ? orange(c.label) : c.label;
157
160
  return ` ${box} ${label}`;
158
161
  });
162
+ if (scrollOffset > 0) {
163
+ lines.unshift(chalk.dim(` ↑ ${scrollOffset} mere`));
164
+ }
165
+ const remaining = choices.length - (scrollOffset + pageSize);
166
+ if (remaining > 0) {
167
+ lines.push(chalk.dim(` ↓ ${remaining} mere`));
168
+ }
159
169
  lines.push('');
160
170
  lines.push(chalk.dim(' ↑↓ naviger · space skift · enter bekræft · esc tilbage'));
161
171
  return lines;
@@ -224,14 +234,20 @@ export function checkboxPrompt(question, choices) {
224
234
  // Up / Left
225
235
  else if (key === '\x1b[A' || key === '\x1b[D') {
226
236
  cursor = (cursor - 1 + choices.length) % choices.length;
237
+ if (cursor === choices.length - 1) scrollOffset = Math.max(0, choices.length - pageSize);
227
238
  }
228
239
  // Down / Right
229
240
  else if (key === '\x1b[B' || key === '\x1b[C') {
230
241
  cursor = (cursor + 1) % choices.length;
242
+ if (cursor === 0) scrollOffset = 0;
231
243
  } else {
232
244
  return;
233
245
  }
234
246
 
247
+ // Keep cursor within the visible scroll window
248
+ if (cursor < scrollOffset) scrollOffset = cursor;
249
+ if (cursor >= scrollOffset + pageSize) scrollOffset = cursor - pageSize + 1;
250
+
235
251
  // Redraw
236
252
  const upCount = totalPhysicalLines(prevLines) - 1;
237
253
  if (upCount > 0) stdout.write(`\x1b[${upCount}A`);