@shnitzel/plugscout 0.3.23 → 0.3.24
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.
|
@@ -1143,52 +1143,35 @@ function describeRiskPosture(posture) {
|
|
|
1143
1143
|
async function promptResultBrowser(entries) {
|
|
1144
1144
|
if (!process.stdout.isTTY || entries.length === 0)
|
|
1145
1145
|
return;
|
|
1146
|
-
const WINDOW = 8;
|
|
1147
1146
|
let selected = 0;
|
|
1148
|
-
let linesDrawn = 0;
|
|
1149
1147
|
const ENTER = '\r';
|
|
1150
1148
|
const CTRL_C = '';
|
|
1151
1149
|
const Q = 'q';
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
}
|
|
1155
|
-
function renderBrowser(firstRender) {
|
|
1150
|
+
// Single-line navigator — no second table. The rendered results above are the reference.
|
|
1151
|
+
function renderNavigator(firstRender) {
|
|
1156
1152
|
if (!firstRender) {
|
|
1157
|
-
moveCursor(process.stdout, 0, -
|
|
1153
|
+
moveCursor(process.stdout, 0, -1);
|
|
1158
1154
|
clearScreenDown(process.stdout);
|
|
1159
1155
|
}
|
|
1160
|
-
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
for (let i = start; i < end; i++) {
|
|
1164
|
-
const prefix = i === selected ? ' ❯ ' : ' ';
|
|
1165
|
-
const nameSuffix = entries[i].name ? ` ${entries[i].name}` : '';
|
|
1166
|
-
const line = `${prefix}${entries[i].id}${nameSuffix}`;
|
|
1167
|
-
process.stdout.write(`${line}\n`);
|
|
1168
|
-
drawn += 1;
|
|
1169
|
-
}
|
|
1170
|
-
if (entries.length > WINDOW) {
|
|
1171
|
-
process.stdout.write(`\x1b[2m (${selected + 1}/${entries.length})\x1b[0m\n`);
|
|
1172
|
-
drawn += 1;
|
|
1173
|
-
}
|
|
1174
|
-
linesDrawn = drawn;
|
|
1156
|
+
const entry = entries[selected];
|
|
1157
|
+
const label = entry.name ? `${entry.id} \x1b[90m${entry.name}\x1b[0m` : entry.id;
|
|
1158
|
+
process.stdout.write(` \x1b[36m❯\x1b[0m ${label} \x1b[90m(${selected + 1}/${entries.length})\x1b[0m\n`);
|
|
1175
1159
|
}
|
|
1176
1160
|
// eslint-disable-next-line prefer-const
|
|
1177
1161
|
let running = true;
|
|
1178
1162
|
let firstLoop = true;
|
|
1179
1163
|
while (running) {
|
|
1180
1164
|
if (firstLoop) {
|
|
1181
|
-
process.stdout.write('\x1b[
|
|
1165
|
+
process.stdout.write('\x1b[90m ↑↓ navigate ⏎ inspect q/Esc skip\x1b[0m\n');
|
|
1182
1166
|
firstLoop = false;
|
|
1183
1167
|
}
|
|
1184
1168
|
else {
|
|
1185
|
-
process.stdout.write('\
|
|
1169
|
+
process.stdout.write('\x1b[90m ↑↓ navigate ⏎ inspect another q/Esc done\x1b[0m\n');
|
|
1186
1170
|
}
|
|
1187
|
-
linesDrawn = 0;
|
|
1188
1171
|
process.stdin.setRawMode(true);
|
|
1189
1172
|
process.stdin.resume();
|
|
1190
1173
|
process.stdin.setEncoding('utf8');
|
|
1191
|
-
|
|
1174
|
+
renderNavigator(true);
|
|
1192
1175
|
const action = await new Promise((resolve) => {
|
|
1193
1176
|
let escTimer = null;
|
|
1194
1177
|
let pendingEsc = false;
|
|
@@ -1213,12 +1196,12 @@ async function promptResultBrowser(entries) {
|
|
|
1213
1196
|
}
|
|
1214
1197
|
if (key === '[A') {
|
|
1215
1198
|
selected = (selected - 1 + entries.length) % entries.length;
|
|
1216
|
-
|
|
1199
|
+
renderNavigator(false);
|
|
1217
1200
|
return;
|
|
1218
1201
|
}
|
|
1219
1202
|
if (key === '[B') {
|
|
1220
1203
|
selected = (selected + 1) % entries.length;
|
|
1221
|
-
|
|
1204
|
+
renderNavigator(false);
|
|
1222
1205
|
return;
|
|
1223
1206
|
}
|
|
1224
1207
|
// Standalone Esc followed by something unexpected — still exit
|
|
@@ -1231,12 +1214,12 @@ async function promptResultBrowser(entries) {
|
|
|
1231
1214
|
else if (key === '\x1b[A' || key === '\x1bOA') {
|
|
1232
1215
|
// Single-chunk arrow up (most terminals)
|
|
1233
1216
|
selected = (selected - 1 + entries.length) % entries.length;
|
|
1234
|
-
|
|
1217
|
+
renderNavigator(false);
|
|
1235
1218
|
}
|
|
1236
1219
|
else if (key === '\x1b[B' || key === '\x1bOB') {
|
|
1237
1220
|
// Single-chunk arrow down (most terminals)
|
|
1238
1221
|
selected = (selected + 1) % entries.length;
|
|
1239
|
-
|
|
1222
|
+
renderNavigator(false);
|
|
1240
1223
|
}
|
|
1241
1224
|
else if (key === '\x1b') {
|
|
1242
1225
|
// Could be standalone Esc or first byte of split arrow sequence
|
|
@@ -39,7 +39,7 @@ export async function renderHomeScreen() {
|
|
|
39
39
|
'plugscout sync --dry-run',
|
|
40
40
|
'plugscout help',
|
|
41
41
|
]) {
|
|
42
|
-
lines.push(` ${colorIfTty(cmd, colors.
|
|
42
|
+
lines.push(` ${colorIfTty(cmd, colors.cyan)}`);
|
|
43
43
|
}
|
|
44
44
|
lines.push('');
|
|
45
45
|
lines.push(colorIfTty('Examples', colors.bold));
|
|
@@ -49,7 +49,7 @@ export async function renderHomeScreen() {
|
|
|
49
49
|
'plugscout search github',
|
|
50
50
|
'plugscout show --id claude-connector:asana',
|
|
51
51
|
]) {
|
|
52
|
-
lines.push(` ${colorIfTty(cmd, colors.
|
|
52
|
+
lines.push(` ${colorIfTty(cmd, colors.cyan)}`);
|
|
53
53
|
}
|
|
54
54
|
lines.push('');
|
|
55
55
|
lines.push(colorIfTty('Kind aliases', colors.bold));
|
|
@@ -279,7 +279,7 @@ export async function renderInteractiveHome() {
|
|
|
279
279
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
280
280
|
process.stdin.resume();
|
|
281
281
|
const id = await new Promise((res) => {
|
|
282
|
-
rl.question('
|
|
282
|
+
rl.question(' Catalog ID (e.g. mcp:github, skill:code-review, cursor-extension:gitlens): ', (answer) => {
|
|
283
283
|
rl.close();
|
|
284
284
|
res(answer.trim());
|
|
285
285
|
});
|
package/package.json
CHANGED