@gorlitzer-labs/seldon 0.1.11 → 0.1.12
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/seldon.js +13 -3
- package/package.json +1 -1
package/bin/seldon.js
CHANGED
|
@@ -253,6 +253,8 @@ function confirm(question) {
|
|
|
253
253
|
readline.emitKeypressEvents(process.stdin);
|
|
254
254
|
process.stdin.setRawMode(true);
|
|
255
255
|
process.stdin.resume();
|
|
256
|
+
process.stdin.ref(); // a prior picker/prompt may have unref'd stdin; without
|
|
257
|
+
// this the loop empties and we exit before reading a key
|
|
256
258
|
const onKey = (str, key) => {
|
|
257
259
|
process.stdin.off("keypress", onKey);
|
|
258
260
|
process.stdin.setRawMode(false);
|
|
@@ -437,7 +439,14 @@ const BANNER = [
|
|
|
437
439
|
];
|
|
438
440
|
function tui() {
|
|
439
441
|
return new Promise((resolve) => {
|
|
440
|
-
|
|
442
|
+
// Pre-check what's already installed so the picker mirrors reality. On a
|
|
443
|
+
// fresh machine (nothing installed) fall back to the recommended starter set.
|
|
444
|
+
const anyInstalled = MODULES.some((m) => moduleInstalled(m));
|
|
445
|
+
const rows = MODULES.map((m) => ({
|
|
446
|
+
m,
|
|
447
|
+
installed: moduleInstalled(m),
|
|
448
|
+
on: platformOk(m) && (anyInstalled ? moduleInstalled(m) : ["apiary", "foundation", "factory"].includes(m.id)),
|
|
449
|
+
}));
|
|
441
450
|
let cur = 0;
|
|
442
451
|
const methodTag = (m) => ({ npm: "npm", shell: "shell", python: "python" }[m.method]);
|
|
443
452
|
const draw = () => {
|
|
@@ -445,7 +454,7 @@ function tui() {
|
|
|
445
454
|
readline.clearScreenDown(process.stdout);
|
|
446
455
|
const out = [];
|
|
447
456
|
BANNER.forEach((l) => out.push(C.gold(l)));
|
|
448
|
-
out.push(C.dim(" the AI-agent-factory stack — pick your tools"));
|
|
457
|
+
out.push(C.dim(" the AI-agent-factory stack — pick your tools ") + C.green("✓ = installed"));
|
|
449
458
|
out.push(C.dim(" ↑↓ move · space toggle · a all · enter install · q quit\n"));
|
|
450
459
|
rows.forEach((r, i) => {
|
|
451
460
|
const sel = r.on ? C.green("[x]") : "[ ]";
|
|
@@ -454,7 +463,8 @@ function tui() {
|
|
|
454
463
|
const name = i === cur ? C.bold(r.m.id.padEnd(11)) : r.m.id.padEnd(11);
|
|
455
464
|
const deps = r.m.needs.map((d) => (depOk(d) ? d : C.red(d))).join(" ");
|
|
456
465
|
const platNote = okp ? C.red(" (unsupported OS)") : "";
|
|
457
|
-
|
|
466
|
+
const mark = r.installed ? C.green("✓") : " ";
|
|
467
|
+
out.push(` ${cursor} ${sel} ${mark} ${name} ${C.dim(methodTag(r.m).padEnd(7))} ${C.dim(r.m.blurb)}${platNote}`);
|
|
458
468
|
if (i === cur) out.push(` ${C.dim("needs: " + (deps || "nothing"))}${r.m.requires.length ? C.dim(" · pulls in: " + r.m.requires.join(", ")) : ""}`);
|
|
459
469
|
});
|
|
460
470
|
process.stdout.write(out.join("\n") + "\n");
|