buildwithnexus 0.6.14 → 0.6.15

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.
Files changed (2) hide show
  1. package/dist/bin.js +42 -51
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -42,15 +42,9 @@ import fs from "fs";
42
42
  import path2 from "path";
43
43
  import os2 from "os";
44
44
  import * as readline from "readline";
45
- import { input, confirm } from "@inquirer/prompts";
46
- async function readFromStdin(prompt) {
47
- const rl = readline.createInterface({
48
- input: process.stdin,
49
- output: process.stdout
50
- });
45
+ function readFromStdin(prompt) {
51
46
  return new Promise((resolve) => {
52
47
  rl.question(prompt, (answer) => {
53
- rl.close();
54
48
  resolve(answer);
55
49
  });
56
50
  });
@@ -64,11 +58,8 @@ async function deepAgentsInitCommand() {
64
58
  const envPath = path2.join(os2.homedir(), ".env.local");
65
59
  const hasEnv = fs.existsSync(envPath);
66
60
  if (hasEnv) {
67
- const shouldReset = await confirm({
68
- message: ".env.local already exists. Reconfigure?",
69
- default: false
70
- });
71
- if (!shouldReset) {
61
+ const answer = await readFromStdin(".env.local already exists. Reconfigure? (y/n) [n]: ");
62
+ if (answer.toLowerCase() !== "y" && answer.toLowerCase() !== "yes") {
72
63
  console.log("Setup complete -- using existing configuration.");
73
64
  return;
74
65
  }
@@ -89,14 +80,8 @@ async function deepAgentsInitCommand() {
89
80
  console.log("Error: At least one API key must be provided.");
90
81
  return;
91
82
  }
92
- const backendUrl = await input({
93
- message: "Backend URL",
94
- default: "http://localhost:4200"
95
- });
96
- const dashboardPort = await input({
97
- message: "Dashboard port",
98
- default: "4201"
99
- });
83
+ const backendUrl = await readFromStdin("Backend URL (http://localhost:4200): ") || "http://localhost:4200";
84
+ const dashboardPort = await readFromStdin("Dashboard port (4201): ") || "4201";
100
85
  const envContent = `# Deep Agents Configuration
101
86
  # Generated by buildwithnexus init
102
87
 
@@ -115,11 +100,17 @@ DASHBOARD_PORT=${dashboardPort}
115
100
  fs.writeFileSync(envPath, envContent, { mode: 384 });
116
101
  reloadEnv(envPath);
117
102
  console.log("Configuration saved to .env.local and loaded into environment.");
103
+ rl.close();
118
104
  }
105
+ var rl;
119
106
  var init_init_command = __esm({
120
107
  "src/cli/init-command.ts"() {
121
108
  "use strict";
122
109
  init_config();
110
+ rl = readline.createInterface({
111
+ input: process.stdin,
112
+ output: process.stdout
113
+ });
123
114
  }
124
115
  });
125
116
 
@@ -142,7 +133,7 @@ function getVersion() {
142
133
  const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
143
134
  return packageJson.version;
144
135
  } catch {
145
- return true ? "0.6.14" : "0.0.0-unknown";
136
+ return true ? "0.6.15" : "0.0.0-unknown";
146
137
  }
147
138
  }
148
139
  function showBanner() {
@@ -642,11 +633,11 @@ async function interactiveMode() {
642
633
  console.error(chalk2.red("\u274C Cannot connect to backend at " + backendUrl));
643
634
  process.exit(1);
644
635
  }
645
- const rl = readline2.createInterface({
636
+ const rl2 = readline2.createInterface({
646
637
  input: process.stdin,
647
638
  output: process.stdout
648
639
  });
649
- const ask = (question) => new Promise((resolve) => rl.question(question, resolve));
640
+ const ask = (question) => new Promise((resolve) => rl2.question(question, resolve));
650
641
  console.clear();
651
642
  console.log(chalk2.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
652
643
  console.log(
@@ -660,7 +651,7 @@ async function interactiveMode() {
660
651
  const task = await ask(chalk2.bold.blue("\u{1F4DD} Task: "));
661
652
  if (task.toLowerCase() === "exit") {
662
653
  console.log(chalk2.yellow("\nGoodbye! \u{1F44B}\n"));
663
- rl.close();
654
+ rl2.close();
664
655
  process.exit(0);
665
656
  }
666
657
  if (!task.trim()) {
@@ -670,7 +661,7 @@ async function interactiveMode() {
670
661
  const suggestedMode = classifyIntent(task).toUpperCase();
671
662
  tui.displaySuggestedMode(suggestedMode, task);
672
663
  const currentMode = await selectMode(suggestedMode, ask);
673
- await runModeLoop(currentMode, task, backendUrl, rl, ask);
664
+ await runModeLoop(currentMode, task, backendUrl, rl2, ask);
674
665
  console.log("");
675
666
  }
676
667
  }
@@ -691,7 +682,7 @@ async function selectMode(suggested, ask) {
691
682
  if (lower === "br" || lower === "brainstorm") return "BRAINSTORM";
692
683
  return suggested;
693
684
  }
694
- async function runModeLoop(mode, task, backendUrl, rl, ask) {
685
+ async function runModeLoop(mode, task, backendUrl, rl2, ask) {
695
686
  let currentMode = mode;
696
687
  while (true) {
697
688
  console.clear();
@@ -699,7 +690,7 @@ async function runModeLoop(mode, task, backendUrl, rl, ask) {
699
690
  tui.displayModeBar(currentMode);
700
691
  tui.displayModeHeader(currentMode);
701
692
  if (currentMode === "PLAN") {
702
- const next = await planModeLoop(task, backendUrl, rl, ask);
693
+ const next = await planModeLoop(task, backendUrl, rl2, ask);
703
694
  if (next === "BUILD") {
704
695
  currentMode = "BUILD";
705
696
  continue;
@@ -711,7 +702,7 @@ async function runModeLoop(mode, task, backendUrl, rl, ask) {
711
702
  return;
712
703
  }
713
704
  if (currentMode === "BUILD") {
714
- const next = await buildModeLoop(task, backendUrl, rl, ask);
705
+ const next = await buildModeLoop(task, backendUrl, rl2, ask);
715
706
  if (next === "switch") {
716
707
  currentMode = await promptModeSwitch(currentMode, ask);
717
708
  continue;
@@ -719,7 +710,7 @@ async function runModeLoop(mode, task, backendUrl, rl, ask) {
719
710
  return;
720
711
  }
721
712
  if (currentMode === "BRAINSTORM") {
722
- const next = await brainstormModeLoop(task, backendUrl, rl, ask);
713
+ const next = await brainstormModeLoop(task, backendUrl, rl2, ask);
723
714
  if (next === "switch") {
724
715
  currentMode = await promptModeSwitch(currentMode, ask);
725
716
  continue;
@@ -748,7 +739,7 @@ async function promptModeSwitch(current, ask) {
748
739
  if (n === 2) return others[1];
749
740
  return current;
750
741
  }
751
- async function planModeLoop(task, backendUrl, rl, ask) {
742
+ async function planModeLoop(task, backendUrl, rl2, ask) {
752
743
  console.log(chalk2.bold("Task:"), chalk2.white(task));
753
744
  console.log("");
754
745
  console.log(chalk2.yellow("\u23F3 Fetching plan from backend..."));
@@ -853,7 +844,7 @@ async function editPlanSteps(steps, ask) {
853
844
  }
854
845
  return steps;
855
846
  }
856
- async function buildModeLoop(task, backendUrl, rl, ask) {
847
+ async function buildModeLoop(task, backendUrl, rl2, ask) {
857
848
  console.log(chalk2.bold("Task:"), chalk2.white(task));
858
849
  tui.displayConnecting();
859
850
  const keys = loadApiKeys();
@@ -920,7 +911,7 @@ async function buildModeLoop(task, backendUrl, rl, ask) {
920
911
  if (answer === "s" || answer === "switch") return "switch";
921
912
  return "done";
922
913
  }
923
- async function brainstormModeLoop(task, backendUrl, rl, ask) {
914
+ async function brainstormModeLoop(task, backendUrl, rl2, ask) {
924
915
  console.log(chalk2.bold("Starting topic:"), chalk2.white(task));
925
916
  console.log(chalk2.gray('Ask follow-up questions. Type "done" to exit, "switch" to change mode.\n'));
926
917
  let currentQuestion = task;
@@ -1521,7 +1512,7 @@ import { Command as Command2 } from "commander";
1521
1512
  import chalk7 from "chalk";
1522
1513
 
1523
1514
  // src/ui/prompts.ts
1524
- import { confirm as confirm2, password } from "@inquirer/prompts";
1515
+ import { confirm, password } from "@inquirer/prompts";
1525
1516
  import chalk6 from "chalk";
1526
1517
 
1527
1518
  // src/core/dlp.ts
@@ -1707,7 +1698,7 @@ async function promptInitConfig() {
1707
1698
  return true;
1708
1699
  }
1709
1700
  });
1710
- const enableTunnel = await confirm2({
1701
+ const enableTunnel = await confirm({
1711
1702
  message: "Enable Cloudflare tunnel for remote access?",
1712
1703
  default: true
1713
1704
  });
@@ -2390,7 +2381,7 @@ var updateCommand = new Command8("update").description("Update NEXUS to the late
2390
2381
  import { Command as Command9 } from "commander";
2391
2382
  import chalk10 from "chalk";
2392
2383
  import fs6 from "fs";
2393
- import { input as input2 } from "@inquirer/prompts";
2384
+ import { input } from "@inquirer/prompts";
2394
2385
  import path8 from "path";
2395
2386
  var destroyCommand = new Command9("destroy").description("Remove NEXUS VM and all data").option("--force", "Skip confirmation").action(async (opts) => {
2396
2387
  const config = loadConfig();
@@ -2401,10 +2392,10 @@ var destroyCommand = new Command9("destroy").description("Remove NEXUS VM and al
2401
2392
  console.log(chalk10.red(" - SSH keys"));
2402
2393
  console.log(chalk10.red(" - Configuration and API keys"));
2403
2394
  console.log("");
2404
- const confirm3 = await input2({
2395
+ const confirm2 = await input({
2405
2396
  message: 'Type "destroy" to confirm:'
2406
2397
  });
2407
- if (confirm3 !== "destroy") {
2398
+ if (confirm2 !== "destroy") {
2408
2399
  log.warn("Aborted");
2409
2400
  return;
2410
2401
  }
@@ -2514,7 +2505,7 @@ var sshCommand = new Command11("ssh").description("Open an interactive shell ins
2514
2505
  // src/commands/brainstorm.ts
2515
2506
  import { Command as Command12 } from "commander";
2516
2507
  import chalk12 from "chalk";
2517
- import { input as input3 } from "@inquirer/prompts";
2508
+ import { input as input2 } from "@inquirer/prompts";
2518
2509
  var COS_PREFIX = chalk12.bold.cyan(" Chief of Staff");
2519
2510
  var YOU_PREFIX = chalk12.bold.white(" You");
2520
2511
  var DIVIDER = chalk12.dim(" " + "\u2500".repeat(56));
@@ -2576,7 +2567,7 @@ var brainstormCommand = new Command12("brainstorm").description("Brainstorm an i
2576
2567
  console.log("");
2577
2568
  let idea = ideaWords.length > 0 ? ideaWords.join(" ") : "";
2578
2569
  if (!idea) {
2579
- idea = await input3({
2570
+ idea = await input2({
2580
2571
  message: "What would you like to brainstorm?"
2581
2572
  });
2582
2573
  if (!idea.trim()) {
@@ -2606,7 +2597,7 @@ var brainstormCommand = new Command12("brainstorm").description("Brainstorm an i
2606
2597
  console.log(`${COS_PREFIX}:`);
2607
2598
  console.log(formatResponse(redact(response)));
2608
2599
  console.log(DIVIDER);
2609
- const followUp = await input3({
2600
+ const followUp = await input2({
2610
2601
  message: chalk12.bold("You:")
2611
2602
  });
2612
2603
  const trimmed = followUp.trim().toLowerCase();
@@ -2635,7 +2626,7 @@ var brainstormCommand = new Command12("brainstorm").description("Brainstorm an i
2635
2626
  // src/commands/ninety-nine.ts
2636
2627
  import { Command as Command13 } from "commander";
2637
2628
  import chalk13 from "chalk";
2638
- import { input as input4 } from "@inquirer/prompts";
2629
+ import { input as input3 } from "@inquirer/prompts";
2639
2630
  var AGENT_PREFIX = chalk13.bold.green(" 99 \u276F");
2640
2631
  var YOU_PREFIX2 = chalk13.bold.white(" You");
2641
2632
  var DIVIDER2 = chalk13.dim(" " + "\u2500".repeat(56));
@@ -2714,7 +2705,7 @@ var ninetyNineCommand = new Command13("99").description("AI pair-programming ses
2714
2705
  console.log("");
2715
2706
  const cwd = process.cwd();
2716
2707
  if (opts.edit) {
2717
- const instruction = instructionWords.join(" ") || await input4({
2708
+ const instruction = instructionWords.join(" ") || await input3({
2718
2709
  message: `What change should be made to ${opts.edit}?`
2719
2710
  });
2720
2711
  const { cleaned, files, rules } = parsePrefixes(instruction);
@@ -2761,7 +2752,7 @@ var ninetyNineCommand = new Command13("99").description("AI pair-programming ses
2761
2752
  }
2762
2753
  let initialInstruction = instructionWords.length > 0 ? instructionWords.join(" ") : "";
2763
2754
  if (!initialInstruction) {
2764
- initialInstruction = await input4({
2755
+ initialInstruction = await input3({
2765
2756
  message: chalk13.green("99 \u276F")
2766
2757
  });
2767
2758
  if (!initialInstruction.trim()) {
@@ -2796,7 +2787,7 @@ var ninetyNineCommand = new Command13("99").description("AI pair-programming ses
2796
2787
  console.log(`${AGENT_PREFIX}`);
2797
2788
  console.log(formatAgentActivity(redact(response)));
2798
2789
  console.log(DIVIDER2);
2799
- const followUp = await input4({
2790
+ const followUp = await input3({
2800
2791
  message: chalk13.green("99 \u276F")
2801
2792
  });
2802
2793
  const trimmed = followUp.trim().toLowerCase();
@@ -3257,8 +3248,8 @@ var shellCommand2 = new Command14("shell").description("Launch the interactive N
3257
3248
  console.log(chalk16.bold(" \u2551 ") + chalk16.dim("Type 'exit' to end brainstorm. Type 'plan' to hand off.".padEnd(55)) + chalk16.bold("\u2551"));
3258
3249
  console.log(chalk16.bold(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
3259
3250
  console.log("");
3260
- const { input: input5 } = await import("@inquirer/prompts");
3261
- const idea = await input5({ message: "What would you like to brainstorm?" });
3251
+ const { input: input4 } = await import("@inquirer/prompts");
3252
+ const idea = await input4({ message: "What would you like to brainstorm?" });
3262
3253
  if (!idea.trim()) return;
3263
3254
  let currentMessage = `[BRAINSTORM] The CEO wants to brainstorm the following idea. As Chief of Staff, facilitate a discussion with the entire NEXUS organization \u2014 involve VPs, engineers, QA, security, and any relevant specialists. Gather diverse perspectives, identify risks and opportunities, and help refine the idea. Do NOT execute \u2014 only discuss, analyze, and recommend. Idea: ${idea}`;
3264
3255
  while (true) {
@@ -3273,7 +3264,7 @@ var shellCommand2 = new Command14("shell").description("Launch the interactive N
3273
3264
  console.log(chalk16.white(" " + line));
3274
3265
  }
3275
3266
  console.log("");
3276
- const followUp = await input5({ message: chalk16.bold("You:") });
3267
+ const followUp = await input4({ message: chalk16.bold("You:") });
3277
3268
  const trimmed = followUp.trim().toLowerCase();
3278
3269
  if (!trimmed || trimmed === "exit" || trimmed === "quit") {
3279
3270
  console.log("");
@@ -3393,7 +3384,7 @@ var shellCommand2 = new Command14("shell").description("Launch the interactive N
3393
3384
  name: "tutorial",
3394
3385
  description: "Guided walkthrough of NEXUS capabilities",
3395
3386
  handler: async () => {
3396
- const { input: input5 } = await import("@inquirer/prompts");
3387
+ const { input: input4 } = await import("@inquirer/prompts");
3397
3388
  const steps = [
3398
3389
  {
3399
3390
  title: "Welcome to NEXUS",
@@ -3473,7 +3464,7 @@ var shellCommand2 = new Command14("shell").description("Launch the interactive N
3473
3464
  }
3474
3465
  console.log("");
3475
3466
  if (i < steps.length - 1) {
3476
- const next = await input5({ message: chalk16.dim("Press Enter to continue (or 'skip' to exit)") });
3467
+ const next = await input4({ message: chalk16.dim("Press Enter to continue (or 'skip' to exit)") });
3477
3468
  if (next.trim().toLowerCase() === "skip") {
3478
3469
  log.success("Tutorial ended. Type /help to see all commands.");
3479
3470
  return;
@@ -3510,7 +3501,7 @@ function getVersionStatic() {
3510
3501
  const packageJson = JSON.parse(readFileSync2(packagePath, "utf-8"));
3511
3502
  return packageJson.version;
3512
3503
  } catch {
3513
- return true ? "0.6.14" : "0.0.0-unknown";
3504
+ return true ? "0.6.15" : "0.0.0-unknown";
3514
3505
  }
3515
3506
  }
3516
3507
  var cli = new Command15().name("buildwithnexus").description("Auto-scaffold and launch a fully autonomous NEXUS runtime").version(getVersionStatic());
@@ -3631,7 +3622,7 @@ import os5 from "os";
3631
3622
  import path11 from "path";
3632
3623
  var homeEnvPath = path11.join(os5.homedir(), ".env.local");
3633
3624
  dotenv2.config({ path: homeEnvPath });
3634
- var version = true ? "0.6.14" : "0.5.17";
3625
+ var version = true ? "0.6.15" : "0.5.17";
3635
3626
  checkForUpdates(version);
3636
3627
  program.name("buildwithnexus").description("Deep Agents - AI-Powered Task Execution").version(version);
3637
3628
  program.command("da-init").description("Initialize Deep Agents (set up API keys and .env.local)").action(deepAgentsInitCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildwithnexus",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
4
4
  "description": "Interactive AI agent orchestrator with intent-based planning, execution, and brainstorming modes",
5
5
  "type": "module",
6
6
  "bin": {