servicemap 0.1.10 → 0.1.11
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/bin/servicemap.mjs +34 -2
- package/package.json +1 -1
package/bin/servicemap.mjs
CHANGED
|
@@ -289,21 +289,53 @@ function skillRootsForTargets(options, targets) {
|
|
|
289
289
|
return [...new Set(targets.map((target) => target.root()))];
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
+
const visibleUniversalLimit = 12;
|
|
293
|
+
const additionalAgentWindowSize = 8;
|
|
294
|
+
|
|
292
295
|
function renderSurvey(selected, cursor) {
|
|
293
296
|
console.clear();
|
|
294
297
|
console.log('Which agents do you want to install Servicemap to?\n');
|
|
295
298
|
console.log('— Universal (.agents/skills) — always included —');
|
|
296
|
-
for (const agent of universalAgents) {
|
|
299
|
+
for (const agent of universalAgents.slice(0, visibleUniversalLimit)) {
|
|
297
300
|
console.log(` • ${agent}`);
|
|
298
301
|
}
|
|
302
|
+
const hiddenUniversalCount = universalAgents.length - visibleUniversalLimit;
|
|
303
|
+
if (hiddenUniversalCount > 0) {
|
|
304
|
+
console.log(` ...and ${hiddenUniversalCount} more`);
|
|
305
|
+
}
|
|
299
306
|
console.log('\n— Additional agents —');
|
|
300
307
|
console.log('Use ↑/↓, Space to select, Enter to install.\n');
|
|
301
308
|
|
|
302
|
-
|
|
309
|
+
const halfWindow = Math.floor(additionalAgentWindowSize / 2);
|
|
310
|
+
let start = Math.max(0, cursor - halfWindow);
|
|
311
|
+
start = Math.min(start, Math.max(0, targetCatalog.length - additionalAgentWindowSize));
|
|
312
|
+
const end = Math.min(targetCatalog.length, start + additionalAgentWindowSize);
|
|
313
|
+
const beforeCount = start;
|
|
314
|
+
const afterCount = targetCatalog.length - end;
|
|
315
|
+
|
|
316
|
+
if (beforeCount > 0) {
|
|
317
|
+
console.log(` ↑ ${beforeCount} more`);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
targetCatalog.slice(start, end).forEach((target, offset) => {
|
|
321
|
+
const index = start + offset;
|
|
303
322
|
const pointer = index === cursor ? '>' : ' ';
|
|
304
323
|
const checked = selected.has(target.id) ? 'x' : ' ';
|
|
305
324
|
console.log(`${pointer} [${checked}] ${target.label}`);
|
|
306
325
|
});
|
|
326
|
+
|
|
327
|
+
if (afterCount > 0) {
|
|
328
|
+
console.log(` ↓ ${afterCount} more`);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (selected.size > 0) {
|
|
332
|
+
const selectedLabels = targetCatalog
|
|
333
|
+
.filter((target) => selected.has(target.id))
|
|
334
|
+
.map((target) => target.label);
|
|
335
|
+
const preview = selectedLabels.slice(0, 3).join(', ');
|
|
336
|
+
const remainder = selectedLabels.length > 3 ? ` +${selectedLabels.length - 3} more` : '';
|
|
337
|
+
console.log(`\nSelected: ${preview}${remainder}`);
|
|
338
|
+
}
|
|
307
339
|
}
|
|
308
340
|
|
|
309
341
|
function runTargetSurvey() {
|