antikit 1.6.0 → 1.7.0
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 +1 -1
- package/src/commands/list.js +24 -9
package/package.json
CHANGED
package/src/commands/list.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import ora from 'ora';
|
|
3
|
-
import { checkbox, confirm } from '@inquirer/prompts';
|
|
3
|
+
import { checkbox, confirm, Separator } from '@inquirer/prompts';
|
|
4
4
|
import { fetchRemoteSkills, fetchSkillInfo } from '../utils/github.js';
|
|
5
5
|
import { skillExists, getOrCreateSkillsDir } from '../utils/local.js';
|
|
6
6
|
import { installSkill } from './install.js';
|
|
@@ -119,8 +119,22 @@ function displaySkillsList(skills) {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
async function interactiveInstall(skills) {
|
|
122
|
-
//
|
|
123
|
-
|
|
122
|
+
// Sort skills by Source then Name
|
|
123
|
+
skills.sort((a, b) => {
|
|
124
|
+
if (a.source !== b.source) return a.source.localeCompare(b.source);
|
|
125
|
+
return a.name.localeCompare(b.name);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const choices = [];
|
|
129
|
+
let currentSource = null;
|
|
130
|
+
|
|
131
|
+
for (const skill of skills) {
|
|
132
|
+
// Add Separator for new source
|
|
133
|
+
if (skill.source !== currentSource) {
|
|
134
|
+
currentSource = skill.source;
|
|
135
|
+
choices.push(new Separator(` \n ──────── Source: ${chalk.bold.magenta(currentSource)} ────────`));
|
|
136
|
+
}
|
|
137
|
+
|
|
124
138
|
let label = '';
|
|
125
139
|
let disabled = false;
|
|
126
140
|
|
|
@@ -129,7 +143,7 @@ async function interactiveInstall(skills) {
|
|
|
129
143
|
label = `${chalk.yellow('↑')} ${chalk.cyan(skill.name)} ${chalk.yellow(`(Update: v${skill.localVersion} → v${skill.remoteVersion})`)}`;
|
|
130
144
|
} else {
|
|
131
145
|
label = `${chalk.green('✓')} ${chalk.cyan(skill.name)} ${chalk.dim('(Installed)')}`;
|
|
132
|
-
disabled = true;
|
|
146
|
+
disabled = true;
|
|
133
147
|
}
|
|
134
148
|
} else {
|
|
135
149
|
label = `${chalk.dim(' ')} ${chalk.cyan(skill.name)}`;
|
|
@@ -139,18 +153,19 @@ async function interactiveInstall(skills) {
|
|
|
139
153
|
label += ` ${chalk.dim('- ' + skill.description.slice(0, 40) + '...')}`;
|
|
140
154
|
}
|
|
141
155
|
|
|
142
|
-
|
|
156
|
+
choices.push({
|
|
143
157
|
name: label,
|
|
144
158
|
value: skill,
|
|
145
159
|
disabled
|
|
146
|
-
};
|
|
147
|
-
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
148
162
|
|
|
149
163
|
// Show checkbox selection
|
|
150
164
|
const selected = await checkbox({
|
|
151
|
-
message: 'Select skills to install/update
|
|
165
|
+
message: 'Select skills to install/update:',
|
|
152
166
|
choices,
|
|
153
|
-
pageSize:
|
|
167
|
+
pageSize: 20, // Increase page size for better view
|
|
168
|
+
loop: false
|
|
154
169
|
});
|
|
155
170
|
|
|
156
171
|
if (selected.length === 0) {
|