agentskillsdk 0.1.5 → 0.1.6

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.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Install agent skills from agentskills.dk",
5
5
  "type": "module",
6
6
  "bin": {
package/src/lib/prompt.js CHANGED
@@ -77,10 +77,10 @@ export function selectPrompt(question, choices, { defaultIndex = 0 } = {}) {
77
77
 
78
78
  // Enter
79
79
  if (key === '\r' || key === '\n') {
80
- // Move up by physical lines to clear previous render
81
- const upCount = totalPhysicalLines(prevLines);
82
- stdout.write(`\x1b[${upCount}A`);
83
- stdout.write('\x1b[J'); // clear to end
80
+ // Move cursor to start of first choice line, then clear
81
+ const upCount = totalPhysicalLines(prevLines) - 1;
82
+ if (upCount > 0) stdout.write(`\x1b[${upCount}A`);
83
+ stdout.write('\r\x1b[J'); // col 0, clear to end
84
84
  const final = ` ${chalk.cyan('\u276f')} ${chalk.cyan(choices[selected].label)}`;
85
85
  stdout.write(final + '\n');
86
86
  cleanup();
@@ -99,10 +99,10 @@ export function selectPrompt(question, choices, { defaultIndex = 0 } = {}) {
99
99
  return; // ignore other keys
100
100
  }
101
101
 
102
- // Redraw: move cursor up by physical lines, clear, rewrite
103
- const upCount = totalPhysicalLines(prevLines);
104
- stdout.write(`\x1b[${upCount}A`);
105
- stdout.write('\x1b[J');
102
+ // Redraw: move cursor to start of first choice line, clear, rewrite
103
+ const upCount = totalPhysicalLines(prevLines) - 1;
104
+ if (upCount > 0) stdout.write(`\x1b[${upCount}A`);
105
+ stdout.write('\r\x1b[J');
106
106
  prevLines = render();
107
107
  stdout.write(prevLines.join('\n'));
108
108
  }