servicemap 0.1.11 → 0.1.13
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 +8 -9
- package/package.json +1 -1
package/bin/servicemap.mjs
CHANGED
|
@@ -291,6 +291,7 @@ function skillRootsForTargets(options, targets) {
|
|
|
291
291
|
|
|
292
292
|
const visibleUniversalLimit = 12;
|
|
293
293
|
const additionalAgentWindowSize = 8;
|
|
294
|
+
const dim = (value) => `\x1b[2m${value}\x1b[22m`;
|
|
294
295
|
|
|
295
296
|
function renderSurvey(selected, cursor) {
|
|
296
297
|
console.clear();
|
|
@@ -313,19 +314,17 @@ function renderSurvey(selected, cursor) {
|
|
|
313
314
|
const beforeCount = start;
|
|
314
315
|
const afterCount = targetCatalog.length - end;
|
|
315
316
|
|
|
316
|
-
if (beforeCount > 0) {
|
|
317
|
-
console.log(` ↑ ${beforeCount} more`);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
317
|
targetCatalog.slice(start, end).forEach((target, offset) => {
|
|
321
318
|
const index = start + offset;
|
|
322
319
|
const pointer = index === cursor ? '>' : ' ';
|
|
323
320
|
const checked = selected.has(target.id) ? 'x' : ' ';
|
|
324
|
-
console.log(`${pointer} [${checked}] ${target.label}`);
|
|
321
|
+
console.log(`${pointer} [${checked}] ${target.label} ${dim(`(${target.root()})`)}`);
|
|
325
322
|
});
|
|
326
323
|
|
|
327
|
-
if (afterCount > 0) {
|
|
328
|
-
|
|
324
|
+
if (beforeCount > 0 || afterCount > 0) {
|
|
325
|
+
const before = beforeCount > 0 ? `↑ ${beforeCount} more` : '';
|
|
326
|
+
const after = afterCount > 0 ? `↓ ${afterCount} more` : '';
|
|
327
|
+
console.log(` ${dim([before, after].filter(Boolean).join(' '))}`);
|
|
329
328
|
}
|
|
330
329
|
|
|
331
330
|
if (selected.size > 0) {
|
|
@@ -352,8 +351,8 @@ function runTargetSurvey() {
|
|
|
352
351
|
renderSurvey(selected, cursor);
|
|
353
352
|
|
|
354
353
|
const onKeypress = (_str, key) => {
|
|
355
|
-
if (key.name === 'up') cursor = (cursor - 1
|
|
356
|
-
if (key.name === 'down') cursor = (cursor + 1)
|
|
354
|
+
if (key.name === 'up') cursor = Math.max(0, cursor - 1);
|
|
355
|
+
if (key.name === 'down') cursor = Math.min(targetCatalog.length - 1, cursor + 1);
|
|
357
356
|
if (key.name === 'space') {
|
|
358
357
|
const id = targetCatalog[cursor].id;
|
|
359
358
|
if (selected.has(id)) selected.delete(id);
|