buildwithnexus 0.6.6 → 0.6.8

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/dist/bin.js CHANGED
@@ -9,6 +9,95 @@ var __export = (target, all) => {
9
9
  __defProp(target, name, { get: all[name], enumerable: true });
10
10
  };
11
11
 
12
+ // src/cli/init-command.ts
13
+ var init_command_exports = {};
14
+ __export(init_command_exports, {
15
+ deepAgentsInitCommand: () => deepAgentsInitCommand
16
+ });
17
+ import fs from "fs";
18
+ import path from "path";
19
+ import { input, confirm } from "@inquirer/prompts";
20
+ async function deepAgentsInitCommand() {
21
+ console.log(`
22
+ \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\u2557
23
+ \u2551 Deep Agents -- First Time Setup \u2551
24
+ \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\u255D
25
+ `);
26
+ const envPath = path.join(process.cwd(), ".env.local");
27
+ const hasEnv = fs.existsSync(envPath);
28
+ if (hasEnv) {
29
+ const shouldReset = await confirm({
30
+ message: ".env.local already exists. Reconfigure?",
31
+ default: false
32
+ });
33
+ if (!shouldReset) {
34
+ console.log("Setup complete -- using existing configuration.");
35
+ return;
36
+ }
37
+ }
38
+ console.log(
39
+ "Please provide your LLM API keys:\n(You can set these later by editing .env.local)\n"
40
+ );
41
+ const anthropicKey = await input({
42
+ message: "ANTHROPIC_API_KEY (Claude)",
43
+ default: "",
44
+ validate: (val) => {
45
+ if (!val) {
46
+ return "At least one API key is required";
47
+ }
48
+ return true;
49
+ }
50
+ });
51
+ const openaiKey = await input({
52
+ message: "OPENAI_API_KEY (GPT - optional)",
53
+ default: ""
54
+ });
55
+ const backendUrl = await input({
56
+ message: "Backend URL",
57
+ default: "http://localhost:4200"
58
+ });
59
+ const dashboardPort = await input({
60
+ message: "Dashboard port",
61
+ default: "4201"
62
+ });
63
+ const envContent = `# Deep Agents Configuration
64
+ # Generated by buildwithnexus init
65
+
66
+ # LLM API Keys
67
+ ANTHROPIC_API_KEY=${anthropicKey}
68
+ ${openaiKey ? `OPENAI_API_KEY=${openaiKey}` : "# OPENAI_API_KEY="}
69
+
70
+ # Backend
71
+ BACKEND_URL=${backendUrl}
72
+ DASHBOARD_PORT=${dashboardPort}
73
+
74
+ # Optional
75
+ # LOG_LEVEL=debug
76
+ `;
77
+ fs.writeFileSync(envPath, envContent);
78
+ console.log(`
79
+ Configuration saved to .env.local
80
+
81
+ Next steps:
82
+ 1. Start the backend:
83
+ cd ~/Projects/nexus && python -m src.deep_agents_server
84
+
85
+ 2. Start the dashboard:
86
+ buildwithnexus dashboard
87
+
88
+ 3. Run your first task:
89
+ deep-agents run "List files in the current directory"
90
+
91
+ For help, run:
92
+ deep-agents --help
93
+ `);
94
+ }
95
+ var init_init_command = __esm({
96
+ "src/cli/init-command.ts"() {
97
+ "use strict";
98
+ }
99
+ });
100
+
12
101
  // src/ui/banner.ts
13
102
  var banner_exports = {};
14
103
  __export(banner_exports, {
@@ -28,7 +117,7 @@ function getVersion() {
28
117
  const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
29
118
  return packageJson.version;
30
119
  } catch {
31
- return true ? "0.6.6" : "0.0.0-unknown";
120
+ return true ? "0.6.8" : "0.0.0-unknown";
32
121
  }
33
122
  }
34
123
  function showBanner() {
@@ -102,88 +191,9 @@ var init_banner = __esm({
102
191
  });
103
192
 
104
193
  // src/bin.ts
194
+ init_init_command();
105
195
  import { program } from "commander";
106
196
 
107
- // src/cli/init-command.ts
108
- import fs from "fs";
109
- import path from "path";
110
- import { input, confirm } from "@inquirer/prompts";
111
- async function deepAgentsInitCommand() {
112
- console.log(`
113
- \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\u2557
114
- \u2551 Deep Agents -- First Time Setup \u2551
115
- \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\u255D
116
- `);
117
- const envPath = path.join(process.cwd(), ".env.local");
118
- const hasEnv = fs.existsSync(envPath);
119
- if (hasEnv) {
120
- const shouldReset = await confirm({
121
- message: ".env.local already exists. Reconfigure?",
122
- default: false
123
- });
124
- if (!shouldReset) {
125
- console.log("Setup complete -- using existing configuration.");
126
- return;
127
- }
128
- }
129
- console.log(
130
- "Please provide your LLM API keys:\n(You can set these later by editing .env.local)\n"
131
- );
132
- const anthropicKey = await input({
133
- message: "ANTHROPIC_API_KEY (Claude)",
134
- default: "",
135
- validate: (val) => {
136
- if (!val) {
137
- return "At least one API key is required";
138
- }
139
- return true;
140
- }
141
- });
142
- const openaiKey = await input({
143
- message: "OPENAI_API_KEY (GPT - optional)",
144
- default: ""
145
- });
146
- const backendUrl = await input({
147
- message: "Backend URL",
148
- default: "http://localhost:4200"
149
- });
150
- const dashboardPort = await input({
151
- message: "Dashboard port",
152
- default: "4201"
153
- });
154
- const envContent = `# Deep Agents Configuration
155
- # Generated by buildwithnexus init
156
-
157
- # LLM API Keys
158
- ANTHROPIC_API_KEY=${anthropicKey}
159
- ${openaiKey ? `OPENAI_API_KEY=${openaiKey}` : "# OPENAI_API_KEY="}
160
-
161
- # Backend
162
- BACKEND_URL=${backendUrl}
163
- DASHBOARD_PORT=${dashboardPort}
164
-
165
- # Optional
166
- # LOG_LEVEL=debug
167
- `;
168
- fs.writeFileSync(envPath, envContent);
169
- console.log(`
170
- Configuration saved to .env.local
171
-
172
- Next steps:
173
- 1. Start the backend:
174
- cd ~/Projects/nexus && python -m src.deep_agents_server
175
-
176
- 2. Start the dashboard:
177
- buildwithnexus dashboard
178
-
179
- 3. Run your first task:
180
- deep-agents run "List files in the current directory"
181
-
182
- For help, run:
183
- deep-agents --help
184
- `);
185
- }
186
-
187
197
  // src/cli/tui.ts
188
198
  import chalk from "chalk";
189
199
  var TUI = class {
@@ -399,13 +409,15 @@ async function runCommand(task, options) {
399
409
  );
400
410
  process.exit(1);
401
411
  }
412
+ const apiKey = process.env.ANTHROPIC_API_KEY || "";
402
413
  const response = await fetch(`${backendUrl}/api/run`, {
403
414
  method: "POST",
404
415
  headers: { "Content-Type": "application/json" },
405
416
  body: JSON.stringify({
406
417
  task,
407
418
  agent_role: options.agent,
408
- agent_goal: options.goal || ""
419
+ agent_goal: options.goal || "",
420
+ api_key: apiKey
409
421
  })
410
422
  });
411
423
  if (!response.ok) {
@@ -576,10 +588,13 @@ async function interactiveMode() {
576
588
  const backendUrl = process.env.BACKEND_URL || "http://localhost:4200";
577
589
  const anthropicKey = process.env.ANTHROPIC_API_KEY;
578
590
  if (!anthropicKey) {
579
- console.error(chalk2.red("\u274C ANTHROPIC_API_KEY not set"));
580
- console.log(chalk2.yellow("\nRun this first to set up your API keys:"));
581
- console.log(chalk2.bold(" buildwithnexus da-init"));
582
- process.exit(1);
591
+ console.log(chalk2.cyan("\n\u{1F527} First-time setup required\n"));
592
+ const { deepAgentsInitCommand: deepAgentsInitCommand2 } = await Promise.resolve().then(() => (init_init_command(), init_command_exports));
593
+ await deepAgentsInitCommand2();
594
+ console.log(chalk2.green("\n\u2713 Setup complete!"));
595
+ console.log(chalk2.gray("\nRestart buildwithnexus to continue:"));
596
+ console.log(chalk2.bold(" buildwithnexus\n"));
597
+ process.exit(0);
583
598
  }
584
599
  try {
585
600
  const response = await fetch(`${backendUrl}/health`);
@@ -702,11 +717,12 @@ async function planModeLoop(task, backendUrl, rl, ask) {
702
717
  console.log("");
703
718
  console.log(chalk2.yellow("\u23F3 Fetching plan from backend..."));
704
719
  let steps = [];
720
+ const apiKey = process.env.ANTHROPIC_API_KEY || "";
705
721
  try {
706
722
  const response = await fetch(`${backendUrl}/api/run`, {
707
723
  method: "POST",
708
724
  headers: { "Content-Type": "application/json" },
709
- body: JSON.stringify({ task, agent_role: "engineer", agent_goal: "" })
725
+ body: JSON.stringify({ task, agent_role: "engineer", agent_goal: "", api_key: apiKey })
710
726
  });
711
727
  if (!response.ok) {
712
728
  console.error(chalk2.red("Backend error \u2014 cannot fetch plan."));
@@ -804,11 +820,12 @@ async function editPlanSteps(steps, ask) {
804
820
  async function buildModeLoop(task, backendUrl, rl, ask) {
805
821
  console.log(chalk2.bold("Task:"), chalk2.white(task));
806
822
  tui.displayConnecting();
823
+ const apiKey = process.env.ANTHROPIC_API_KEY || "";
807
824
  try {
808
825
  const response = await fetch(`${backendUrl}/api/run`, {
809
826
  method: "POST",
810
827
  headers: { "Content-Type": "application/json" },
811
- body: JSON.stringify({ task, agent_role: "engineer", agent_goal: "" })
828
+ body: JSON.stringify({ task, agent_role: "engineer", agent_goal: "", api_key: apiKey })
812
829
  });
813
830
  if (!response.ok) {
814
831
  console.error(chalk2.red("Backend error"));
@@ -874,13 +891,15 @@ async function brainstormModeLoop(task, backendUrl, rl, ask) {
874
891
  while (true) {
875
892
  console.log(chalk2.bold.blue("\u{1F4A1} Thinking..."));
876
893
  try {
894
+ const apiKey = process.env.ANTHROPIC_API_KEY || "";
877
895
  const response = await fetch(`${backendUrl}/api/run`, {
878
896
  method: "POST",
879
897
  headers: { "Content-Type": "application/json" },
880
898
  body: JSON.stringify({
881
899
  task: currentQuestion,
882
900
  agent_role: "brainstorm",
883
- agent_goal: "Generate ideas, considerations, and suggestions. Be concise and helpful."
901
+ agent_goal: "Generate ideas, considerations, and suggestions. Be concise and helpful.",
902
+ api_key: apiKey
884
903
  })
885
904
  });
886
905
  if (response.ok) {
@@ -3453,7 +3472,7 @@ function getVersionStatic() {
3453
3472
  const packageJson = JSON.parse(readFileSync2(packagePath, "utf-8"));
3454
3473
  return packageJson.version;
3455
3474
  } catch {
3456
- return true ? "0.6.6" : "0.0.0-unknown";
3475
+ return true ? "0.6.8" : "0.0.0-unknown";
3457
3476
  }
3458
3477
  }
3459
3478
  var cli = new Command15().name("buildwithnexus").description("Auto-scaffold and launch a fully autonomous NEXUS runtime").version(getVersionStatic());
@@ -3571,7 +3590,7 @@ function printUpdateBanner(current, latest) {
3571
3590
  // src/bin.ts
3572
3591
  import dotenv from "dotenv";
3573
3592
  dotenv.config({ path: ".env.local" });
3574
- var version = true ? "0.6.6" : "0.5.17";
3593
+ var version = true ? "0.6.8" : "0.5.17";
3575
3594
  checkForUpdates(version);
3576
3595
  program.name("buildwithnexus").description("Deep Agents - AI-Powered Task Execution").version(version);
3577
3596
  program.command("da-init").description("Initialize Deep Agents (set up API keys and .env.local)").action(deepAgentsInitCommand);
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buildwithnexus",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "Interactive AI agent orchestrator with intent-based planning, execution, and brainstorming modes",
5
5
  "type": "module",
6
6
  "bin": {