open-agents-ai 0.73.1 → 0.76.0

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 (34) hide show
  1. package/dist/index.js +604 -1120
  2. package/dist/launcher.cjs +87 -33
  3. package/dist/preinstall.cjs +57 -30
  4. package/package.json +5 -3
  5. package/prompts/agentic/system-large.md +304 -0
  6. package/prompts/agentic/system-medium.md +43 -0
  7. package/prompts/agentic/system-small.md +17 -0
  8. package/prompts/compaction/context-compaction.md +9 -0
  9. package/prompts/personality/level-1-minimal.md +3 -0
  10. package/prompts/personality/level-2-concise.md +3 -0
  11. package/prompts/personality/level-4-explanatory.md +3 -0
  12. package/prompts/personality/level-5-thorough.md +3 -0
  13. package/prompts/runners/dispatcher.md +24 -0
  14. package/prompts/runners/editor.md +44 -0
  15. package/prompts/runners/evaluator.md +30 -0
  16. package/prompts/runners/merge-summary.md +9 -0
  17. package/prompts/runners/normalizer.md +23 -0
  18. package/prompts/runners/planner.md +33 -0
  19. package/prompts/runners/scout.md +39 -0
  20. package/prompts/runners/verifier.md +36 -0
  21. package/prompts/templates/analysis.md +14 -0
  22. package/prompts/templates/code-review.md +16 -0
  23. package/prompts/templates/code.md +13 -0
  24. package/prompts/templates/document.md +13 -0
  25. package/prompts/templates/error-diagnosis.md +14 -0
  26. package/prompts/templates/general.md +9 -0
  27. package/prompts/templates/plan.md +15 -0
  28. package/prompts/templates/system.md +16 -0
  29. package/prompts/tui/dmn-gather.md +128 -0
  30. package/prompts/tui/dream-lucid-eval.md +17 -0
  31. package/prompts/tui/dream-lucid-implement.md +14 -0
  32. package/prompts/tui/dream-stages.md +19 -0
  33. package/prompts/tui/emotion-behavioral.md +2 -0
  34. package/prompts/tui/emotion-center.md +12 -0
package/dist/launcher.cjs CHANGED
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  // Node version gate — uses only ES5 syntax so it parses on any Node version.
3
- // On old Node: walks through curl/wget install, nvm install, then Node 20, then reinstall.
3
+ // On old Node: walks through curl/wget install, nvm install, then Node 22, then reinstall.
4
4
  var nodeVersion = parseInt(process.versions.node, 10);
5
5
 
6
- if (nodeVersion < 18) {
6
+ if (nodeVersion < 22) {
7
+ // Prevent infinite loop: if we're inside a self-triggered reinstall, bail
8
+ if (process.env.OA_SELF_UPGRADE === "1") {
9
+ console.error(" [launcher] Skipping — already inside a self-upgrade.");
10
+ console.error(" Open a new terminal with Node 22 and run: oa");
11
+ process.exit(1);
12
+ }
13
+
7
14
  var os = require("os");
8
15
  var path = require("path");
9
16
  var fs = require("fs");
@@ -19,7 +26,7 @@ if (nodeVersion < 18) {
19
26
  console.log(" └─────────────────────────────────────────────────┘");
20
27
  console.log("");
21
28
  console.log(" Your Node.js: " + process.version);
22
- console.log(" Required: >= 18.0.0");
29
+ console.log(" Required: >= 22.0.0");
23
30
  console.log(" Platform: " + platform + "/" + arch);
24
31
  console.log("");
25
32
 
@@ -127,7 +134,7 @@ if (nodeVersion < 18) {
127
134
  " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
128
135
  " # or: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
129
136
  " source ~/.bashrc\n" +
130
- " nvm install 20\n" +
137
+ " nvm install 22\n" +
131
138
  " npm i -g open-agents-ai\n"
132
139
  );
133
140
  return;
@@ -146,11 +153,11 @@ if (nodeVersion < 18) {
146
153
  }
147
154
 
148
155
  function doInstallNode(next) {
149
- ask(" Install Node.js 20 via nvm? [Y/n] ", function(a) {
156
+ ask(" Install Node.js 22 via nvm? [Y/n] ", function(a) {
150
157
  if (a === "n" || a === "no") {
151
158
  bail(
152
159
  "\n Install manually:\n" +
153
- " nvm install 20 && nvm alias default 20\n" +
160
+ " nvm install 22 && nvm alias default 22\n" +
154
161
  " npm i -g open-agents-ai\n"
155
162
  );
156
163
  return;
@@ -159,10 +166,10 @@ if (nodeVersion < 18) {
159
166
  var shell = process.env.SHELL || "/bin/bash";
160
167
  var cmd = 'export NVM_DIR="' + nvmDir + '" && ' +
161
168
  '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && ' +
162
- "nvm install 20 && nvm use 20 && nvm alias default 20";
169
+ "nvm install 22 && nvm use 22 && nvm alias default 22";
163
170
  var ok = run(shell + " -c '" + cmd + "'");
164
171
  if (!ok) {
165
- bail("\n Node 20 install failed.\n");
172
+ bail("\n Node 22 install failed.\n");
166
173
  return;
167
174
  }
168
175
  console.log("");
@@ -170,8 +177,47 @@ if (nodeVersion < 18) {
170
177
  });
171
178
  }
172
179
 
180
+ // Find the Node 22 binary installed by nvm
181
+ function findNode22Bin() {
182
+ // Check nvm versions directory for a v22.x binary
183
+ var versionsDir = path.join(nvmDir, "versions", "node");
184
+ try {
185
+ var versions = fs.readdirSync(versionsDir).filter(function(v) {
186
+ return v.startsWith("v22");
187
+ }).sort().reverse();
188
+ if (versions.length > 0) {
189
+ var bin = path.join(versionsDir, versions[0], "bin", "node");
190
+ try { fs.statSync(bin); return bin; } catch (e) {}
191
+ }
192
+ } catch (e) {}
193
+ // Fallback: ask nvm which node 22 is
194
+ try {
195
+ var shell = process.env.SHELL || "/bin/bash";
196
+ var result = childProcess.execSync(
197
+ shell + ' -c \'export NVM_DIR="' + nvmDir + '" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm which 22\'',
198
+ { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"], timeout: 10000 }
199
+ ).trim();
200
+ if (result && fs.existsSync(result)) return result;
201
+ } catch (e) {}
202
+ return null;
203
+ }
204
+
205
+ // Find the oa launcher script under a given node prefix
206
+ function findOaBin(nodeBin) {
207
+ // nodeBin = .../bin/node → prefix = .../
208
+ var binDir = path.dirname(nodeBin);
209
+ var candidates = [
210
+ path.join(binDir, "oa"),
211
+ path.join(binDir, "open-agents"),
212
+ ];
213
+ for (var i = 0; i < candidates.length; i++) {
214
+ try { fs.statSync(candidates[i]); return candidates[i]; } catch (e) {}
215
+ }
216
+ return null;
217
+ }
218
+
173
219
  function doReinstall() {
174
- ask(" Reinstall open-agents under Node 20? [Y/n] ", function(a) {
220
+ ask(" Reinstall open-agents under Node 22? [Y/n] ", function(a) {
175
221
  if (a === "n" || a === "no") {
176
222
  console.log(
177
223
  "\n Open a new terminal, then run:\n" +
@@ -183,9 +229,9 @@ if (nodeVersion < 18) {
183
229
  }
184
230
  console.log("");
185
231
  var shell = process.env.SHELL || "/bin/bash";
186
- var cmd = 'export NVM_DIR="' + nvmDir + '" && ' +
232
+ var cmd = 'export OA_SELF_UPGRADE=1 && export NVM_DIR="' + nvmDir + '" && ' +
187
233
  '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && ' +
188
- "nvm use 20 && npm i -g open-agents-ai";
234
+ "nvm use 22 && npm i -g open-agents-ai";
189
235
  var ok = run(shell + " -c '" + cmd + "'");
190
236
  if (!ok) {
191
237
  console.log(
@@ -197,41 +243,49 @@ if (nodeVersion < 18) {
197
243
  return;
198
244
  }
199
245
  console.log("");
200
- console.log(" ┌─────────────────────────────────────────────────┐");
201
- console.log(" │ Done! Launching open-agents... │");
202
- console.log(" └─────────────────────────────────────────────────┘");
203
- console.log("");
204
246
  rl.close();
205
247
 
206
- // Auto-source shell config and re-exec oa — no "open a new terminal" needed
207
- var rcFile = shell.indexOf("zsh") !== -1 ? "~/.zshrc" : "~/.bashrc";
208
- var relaunchCmd = 'export NVM_DIR="' + nvmDir + '" && ' +
209
- '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && ' +
210
- "source " + rcFile + " 2>/dev/null; " +
211
- "exec oa";
212
- try {
213
- childProcess.execSync(shell + " -c '" + relaunchCmd + "'", {
214
- stdio: "inherit",
215
- env: process.env,
216
- });
217
- } catch (e) {
218
- // Fallback: tell user to open new terminal only if re-exec fails
219
- console.log("\n If oa didn't launch, run: source " + rcFile + " && oa\n");
248
+ // Try to auto-relaunch under Node 22 — no new terminal needed
249
+ var node22 = findNode22Bin();
250
+ if (node22) {
251
+ var oaBin = findOaBin(node22);
252
+ if (oaBin) {
253
+ console.log(" ┌─────────────────────────────────────────────────┐");
254
+ console.log(" │ Done! Launching open-agents with Node 22... │");
255
+ console.log(" └─────────────────────────────────────────────────┘");
256
+ console.log("");
257
+ // Replace this process with Node 22 running the new oa launcher
258
+ try {
259
+ childProcess.execFileSync(node22, [oaBin], {
260
+ stdio: "inherit",
261
+ env: process.env,
262
+ });
263
+ } catch (e) {
264
+ // execFileSync throws when the child exits — that's normal
265
+ }
266
+ process.exit(0);
267
+ }
220
268
  }
269
+
270
+ // Fallback if we can't find Node 22 binary or oa script
271
+ console.log(" ┌─────────────────────────────────────────────────┐");
272
+ console.log(" │ Done! Open a new terminal and run: oa │");
273
+ console.log(" └─────────────────────────────────────────────────┘");
274
+ console.log("");
221
275
  process.exit(0);
222
276
  });
223
277
  }
224
278
 
225
279
  // Walk through the steps
226
- ask(" Upgrade to Node.js 20 now? [Y/n] ", function(a) {
280
+ ask(" Upgrade to Node.js 22 now? [Y/n] ", function(a) {
227
281
  if (a === "n" || a === "no") {
228
282
  bail(
229
283
  "\n To install manually:\n" +
230
284
  " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
231
285
  " # or: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
232
286
  " source ~/.bashrc\n" +
233
- " nvm install 20\n" +
234
- " nvm alias default 20\n" +
287
+ " nvm install 22\n" +
288
+ " nvm alias default 22\n" +
235
289
  " npm i -g open-agents-ai\n"
236
290
  );
237
291
  return;
@@ -247,7 +301,7 @@ if (nodeVersion < 18) {
247
301
  });
248
302
  });
249
303
  } else {
250
- // Node >= 18 — load the ESM bundle
304
+ // Node >= 22 — load the ESM bundle
251
305
  import("./index.js").catch(function(err) {
252
306
  console.error("Failed to load open-agents:", err.message || err);
253
307
  process.exit(1);
@@ -1,15 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  // preinstall hook — runs BEFORE npm installs dependencies.
3
3
  // Pure ES5 so it works on any Node version. If Node is too old,
4
- // walks the user through installing Node 20 via nvm, then re-runs
4
+ // walks the user through installing Node 22 via nvm, then re-runs
5
5
  // npm i -g open-agents-ai under the new Node and exits.
6
6
  var nodeVersion = parseInt(process.versions.node, 10);
7
7
 
8
- if (nodeVersion >= 18) {
8
+ if (nodeVersion >= 22) {
9
9
  // Good to go — let npm continue installing deps normally
10
10
  process.exit(0);
11
11
  }
12
12
 
13
+ // Prevent infinite loop: if we're inside a self-triggered reinstall, bail
14
+ if (process.env.OA_SELF_UPGRADE === "1") {
15
+ console.log(" [preinstall] Skipping — already inside a self-upgrade.");
16
+ console.log(" If this Node is still too old, open a new terminal with Node 22 and run:");
17
+ console.log(" npm i -g open-agents-ai");
18
+ process.exit(1);
19
+ }
20
+
13
21
  var os = require("os");
14
22
  var path = require("path");
15
23
  var fs = require("fs");
@@ -25,7 +33,7 @@ console.log(" │ open-agents — Node.js Check │");
25
33
  console.log(" └─────────────────────────────────────────────────┘");
26
34
  console.log("");
27
35
  console.log(" Your Node.js: " + process.version);
28
- console.log(" Required: >= 18.0.0");
36
+ console.log(" Required: >= 22.0.0");
29
37
  console.log(" Platform: " + platform + "/" + arch);
30
38
  console.log("");
31
39
 
@@ -132,7 +140,7 @@ function doInstallNvm(dl, next) {
132
140
  " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
133
141
  " # or: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
134
142
  " source ~/.bashrc\n" +
135
- " nvm install 20\n" +
143
+ " nvm install 22\n" +
136
144
  " npm i -g open-agents-ai\n"
137
145
  );
138
146
  return;
@@ -151,11 +159,11 @@ function doInstallNvm(dl, next) {
151
159
  }
152
160
 
153
161
  function doInstallNode(next) {
154
- ask(" Install Node.js 20 via nvm? [Y/n] ", function(a) {
162
+ ask(" Install Node.js 22 via nvm? [Y/n] ", function(a) {
155
163
  if (a === "n" || a === "no") {
156
164
  bail(
157
165
  "\n Install manually:\n" +
158
- " nvm install 20 && nvm alias default 20\n" +
166
+ " nvm install 22 && nvm alias default 22\n" +
159
167
  " npm i -g open-agents-ai\n"
160
168
  );
161
169
  return;
@@ -164,10 +172,10 @@ function doInstallNode(next) {
164
172
  var shell = process.env.SHELL || "/bin/bash";
165
173
  var cmd = 'export NVM_DIR="' + nvmDir + '" && ' +
166
174
  '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && ' +
167
- "nvm install 20 && nvm alias default 20";
175
+ "nvm install 22 && nvm alias default 22";
168
176
  var ok = run(shell + " -c '" + cmd + "'");
169
177
  if (!ok) {
170
- bail("\n Node 20 install failed.\n");
178
+ bail("\n Node 22 install failed.\n");
171
179
  return;
172
180
  }
173
181
  console.log("");
@@ -175,8 +183,31 @@ function doInstallNode(next) {
175
183
  });
176
184
  }
177
185
 
186
+ // Find the Node 22 binary installed by nvm
187
+ function findNode22Bin() {
188
+ var versionsDir = path.join(nvmDir, "versions", "node");
189
+ try {
190
+ var versions = fs.readdirSync(versionsDir).filter(function(v) {
191
+ return v.startsWith("v22");
192
+ }).sort().reverse();
193
+ if (versions.length > 0) {
194
+ var bin = path.join(versionsDir, versions[0], "bin", "node");
195
+ try { fs.statSync(bin); return bin; } catch (e) {}
196
+ }
197
+ } catch (e) {}
198
+ try {
199
+ var shell = process.env.SHELL || "/bin/bash";
200
+ var result = childProcess.execSync(
201
+ shell + ' -c \'export NVM_DIR="' + nvmDir + '" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm which 22\'',
202
+ { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"], timeout: 10000 }
203
+ ).trim();
204
+ if (result && fs.existsSync(result)) return result;
205
+ } catch (e) {}
206
+ return null;
207
+ }
208
+
178
209
  function doReinstall() {
179
- ask(" Reinstall open-agents under Node 20? [Y/n] ", function(a) {
210
+ ask(" Reinstall open-agents under Node 22? [Y/n] ", function(a) {
180
211
  if (a === "n" || a === "no") {
181
212
  console.log(
182
213
  "\n Open a new terminal, then run:\n" +
@@ -188,9 +219,9 @@ function doReinstall() {
188
219
  }
189
220
  console.log("");
190
221
  var shell = process.env.SHELL || "/bin/bash";
191
- var cmd = 'export NVM_DIR="' + nvmDir + '" && ' +
222
+ var cmd = 'export OA_SELF_UPGRADE=1 && export NVM_DIR="' + nvmDir + '" && ' +
192
223
  '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && ' +
193
- "nvm use 20 && npm i -g open-agents-ai";
224
+ "nvm use 22 && npm i -g open-agents-ai";
194
225
  var ok = run(shell + " -c '" + cmd + "'");
195
226
  if (!ok) {
196
227
  console.log(
@@ -202,40 +233,36 @@ function doReinstall() {
202
233
  return;
203
234
  }
204
235
  console.log("");
236
+
237
+ // Tell the user exactly how to launch — resolve the Node 22 path for them
238
+ var node22 = findNode22Bin();
239
+ var binHint = node22 ? path.dirname(node22) : "~/.nvm/versions/node/v22.x.x/bin";
205
240
  console.log(" ┌─────────────────────────────────────────────────┐");
206
- console.log(" │ Done! Launching open-agents... │");
241
+ console.log(" │ Done! Node 22 installed + open-agents ready. │");
207
242
  console.log(" └─────────────────────────────────────────────────┘");
208
243
  console.log("");
244
+ console.log(" To launch immediately (no new terminal needed):");
245
+ console.log(" " + binHint + "/oa");
246
+ console.log("");
247
+ console.log(" Or source your shell config first:");
248
+ var rcFile = (process.env.SHELL || "").indexOf("zsh") !== -1 ? "~/.zshrc" : "~/.bashrc";
249
+ console.log(" source " + rcFile + " && oa");
250
+ console.log("");
209
251
  rl.close();
210
-
211
- // Auto-source shell config and launch oa — no "open a new terminal" needed
212
- var rcFile2 = shell.indexOf("zsh") !== -1 ? "~/.zshrc" : "~/.bashrc";
213
- var relaunchCmd = 'export NVM_DIR="' + nvmDir + '" && ' +
214
- '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && ' +
215
- "source " + rcFile2 + " 2>/dev/null; " +
216
- "exec oa";
217
- try {
218
- childProcess.execSync(shell + " -c '" + relaunchCmd + "'", {
219
- stdio: "inherit",
220
- env: process.env,
221
- });
222
- } catch (e2) {
223
- console.log("\n If oa didn't launch, run: source " + rcFile2 + " && oa\n");
224
- }
225
252
  process.exit(0);
226
253
  });
227
254
  }
228
255
 
229
256
  // Walk through the steps
230
- ask(" Install Node.js 20 now? [Y/n] ", function(a) {
257
+ ask(" Install Node.js 22 now? [Y/n] ", function(a) {
231
258
  if (a === "n" || a === "no") {
232
259
  bail(
233
260
  "\n To install manually:\n" +
234
261
  " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
235
262
  " # or: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n" +
236
263
  " source ~/.bashrc\n" +
237
- " nvm install 20\n" +
238
- " nvm alias default 20\n" +
264
+ " nvm install 22\n" +
265
+ " nvm alias default 22\n" +
239
266
  " npm i -g open-agents-ai\n"
240
267
  );
241
268
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.73.1",
3
+ "version": "0.76.0",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "files": [
13
13
  "dist",
14
+ "prompts",
14
15
  "README.md",
15
16
  "LICENSE"
16
17
  ],
@@ -56,18 +57,19 @@
56
57
  "preinstall": "node dist/preinstall.cjs"
57
58
  },
58
59
  "engines": {
59
- "node": ">=18.0.0"
60
+ "node": ">=22.0.0"
60
61
  },
61
62
  "dependencies": {
62
63
  "aiwg": "^2026.3.2",
63
64
  "better-sqlite3": "^11.7.0",
64
65
  "glob": "^11.0.0",
65
66
  "ignore": "^6.0.2",
67
+ "nats.ws": "^1.30.3",
66
68
  "ws": "^8.18.0",
67
69
  "zod": "^3.24.1"
68
70
  },
69
71
  "optionalDependencies": {
70
72
  "moondream": "^0.2.0",
71
- "open-agents-nexus": "^0.3.0"
73
+ "open-agents-nexus": "^1.2.1"
72
74
  }
73
75
  }