open-agents-ai 0.138.64 → 0.138.65

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/index.js CHANGED
@@ -7246,7 +7246,8 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
7246
7246
  if (!pid) {
7247
7247
  try {
7248
7248
  await this.doConnect({
7249
- agent_name: "oa-" + hostname().slice(0, 12) + "-" + process.pid,
7249
+ agent_name: "",
7250
+ // will use mnemonic generator in doConnect
7250
7251
  agent_type: "general"
7251
7252
  });
7252
7253
  pid = this.getDaemonPid();
@@ -7486,7 +7487,18 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
7486
7487
  await this.ensureWallet();
7487
7488
  const daemonPath = join12(this.nexusDir, "nexus-daemon.mjs");
7488
7489
  await writeFile6(daemonPath, DAEMON_SCRIPT);
7489
- const agentName = args.agent_name || "oa-" + hostname().slice(0, 12) + "-" + process.pid;
7490
+ const agentName = args.agent_name || (() => {
7491
+ const ADJ = ["swift", "bright", "calm", "deep", "bold", "keen", "warm", "clear", "soft", "sharp", "quick", "cool", "fair", "free", "kind", "pure", "sage", "true", "wild", "wise", "dark", "gold", "iron", "jade", "ruby", "silk", "void", "dawn", "dusk", "rain", "star", "moon", "wave", "fire", "snow", "leaf", "oak", "pine", "ash", "elm"];
7492
+ const NOUN = ["hawk", "wolf", "bear", "deer", "hare", "lynx", "crow", "wren", "dove", "swan", "pike", "bass", "carp", "reef", "tide", "vale", "glen", "peak", "mesa", "ford", "arch", "gate", "node", "core", "link", "mesh", "flux", "grid", "cell", "hub", "bolt", "gear", "coil", "ring", "lens", "orb", "cube", "dome", "shard", "rune"];
7493
+ const seed = `${hostname()}:${userInfo().username}`;
7494
+ let h = 2166136261;
7495
+ for (let i = 0; i < seed.length; i++) {
7496
+ h ^= seed.charCodeAt(i);
7497
+ h = Math.imul(h, 16777619);
7498
+ }
7499
+ h = h >>> 0;
7500
+ return `${ADJ[h % ADJ.length]}-${NOUN[(h >>> 8) % NOUN.length]}-${((h >>> 16) % 100).toString().padStart(2, "0")}`;
7501
+ })();
7490
7502
  const agentType = args.agent_type || "general";
7491
7503
  const nodePaths = [nodeModulesDir];
7492
7504
  try {
@@ -23602,6 +23614,11 @@ ${trimmedNew}`;
23602
23614
  return `Your last ${lastToolName} call failed: ${lastError.slice(0, 100)}. Fix the issue and try a different approach.`;
23603
23615
  }
23604
23616
  if (lastToolName === "file_read") {
23617
+ const taskGoal = (this._taskState.goal || "").toLowerCase();
23618
+ const isDebugging = /bug|fix|debug|broken|wrong|fail|error|issue|refactor|extract/i.test(taskGoal);
23619
+ if (isDebugging) {
23620
+ return `You just read "${lastFilePath}". Before changing anything, WRITE A QUICK TEST to observe the current behavior: shell(command="node -e \\"...\\""") or repl_exec. See what actually happens \u2014 don't guess. Then fix based on what you observed.`;
23621
+ }
23605
23622
  return `You just read "${lastFilePath}". Now make the needed changes with file_edit, or if exploring, decide what to modify.`;
23606
23623
  }
23607
23624
  if (lastToolName === "file_edit" || lastToolName === "file_write") {
@@ -45478,6 +45495,26 @@ var init_carousel = __esm({
45478
45495
  });
45479
45496
 
45480
45497
  // packages/cli/dist/tui/banner.js
45498
+ function generateMnemonic(seed) {
45499
+ let h = 2166136261;
45500
+ for (let i = 0; i < seed.length; i++) {
45501
+ h ^= seed.charCodeAt(i);
45502
+ h = Math.imul(h, 16777619);
45503
+ }
45504
+ h = h >>> 0;
45505
+ const adj = MNEMONIC_ADJECTIVES[h % MNEMONIC_ADJECTIVES.length];
45506
+ const noun = MNEMONIC_NOUNS[(h >>> 8) % MNEMONIC_NOUNS.length];
45507
+ const num = ((h >>> 16) % 100).toString().padStart(2, "0");
45508
+ return `${adj}-${noun}-${num}`;
45509
+ }
45510
+ function getNodeMnemonic() {
45511
+ try {
45512
+ const { hostname: hostname2, userInfo: userInfo2 } = __require("node:os");
45513
+ return generateMnemonic(`${hostname2()}:${userInfo2().username}`);
45514
+ } catch {
45515
+ return generateMnemonic("unknown-node");
45516
+ }
45517
+ }
45481
45518
  function createDefaultBanner(version = "0.120.0") {
45482
45519
  const width = process.stdout.columns ?? 80;
45483
45520
  const rows = 3;
@@ -45514,10 +45551,16 @@ function createDefaultBanner(version = "0.120.0") {
45514
45551
  }
45515
45552
  grid.push(row);
45516
45553
  }
45554
+ const mnemonic = getNodeMnemonic();
45517
45555
  const versionText = ` OA v${version}`;
45556
+ const mnemonicSuffix = ` \xB7 ${mnemonic}`;
45518
45557
  for (let i = 0; i < versionText.length && i < width; i++) {
45519
45558
  grid[0][i] = { char: versionText[i], fg: yellow, bg: bgDark, bold: true };
45520
45559
  }
45560
+ const mnemonicStart = versionText.length;
45561
+ for (let i = 0; i < mnemonicSuffix.length && mnemonicStart + i < Math.floor(width * 0.44); i++) {
45562
+ grid[0][mnemonicStart + i] = { char: mnemonicSuffix[i], fg: 240, bg: bgDark, bold: false };
45563
+ }
45521
45564
  const cwd4 = process.cwd();
45522
45565
  const shortCwd = cwd4.length > 40 ? "..." + cwd4.slice(-37) : cwd4;
45523
45566
  const infoText = ` ${shortCwd}`;
@@ -45575,11 +45618,95 @@ function createCohereBanner() {
45575
45618
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
45576
45619
  };
45577
45620
  }
45578
- var isTTY7, BannerRenderer;
45621
+ var isTTY7, MNEMONIC_ADJECTIVES, MNEMONIC_NOUNS, BannerRenderer;
45579
45622
  var init_banner = __esm({
45580
45623
  "packages/cli/dist/tui/banner.js"() {
45581
45624
  "use strict";
45582
45625
  isTTY7 = process.stdout.isTTY ?? false;
45626
+ MNEMONIC_ADJECTIVES = [
45627
+ "swift",
45628
+ "bright",
45629
+ "calm",
45630
+ "deep",
45631
+ "bold",
45632
+ "keen",
45633
+ "warm",
45634
+ "clear",
45635
+ "soft",
45636
+ "sharp",
45637
+ "quick",
45638
+ "cool",
45639
+ "fair",
45640
+ "free",
45641
+ "kind",
45642
+ "pure",
45643
+ "sage",
45644
+ "true",
45645
+ "wild",
45646
+ "wise",
45647
+ "dark",
45648
+ "gold",
45649
+ "iron",
45650
+ "jade",
45651
+ "ruby",
45652
+ "silk",
45653
+ "void",
45654
+ "dawn",
45655
+ "dusk",
45656
+ "rain",
45657
+ "star",
45658
+ "moon",
45659
+ "wave",
45660
+ "fire",
45661
+ "snow",
45662
+ "leaf",
45663
+ "oak",
45664
+ "pine",
45665
+ "ash",
45666
+ "elm"
45667
+ ];
45668
+ MNEMONIC_NOUNS = [
45669
+ "hawk",
45670
+ "wolf",
45671
+ "bear",
45672
+ "deer",
45673
+ "hare",
45674
+ "lynx",
45675
+ "crow",
45676
+ "wren",
45677
+ "dove",
45678
+ "swan",
45679
+ "pike",
45680
+ "bass",
45681
+ "carp",
45682
+ "reef",
45683
+ "tide",
45684
+ "vale",
45685
+ "glen",
45686
+ "peak",
45687
+ "mesa",
45688
+ "ford",
45689
+ "arch",
45690
+ "gate",
45691
+ "node",
45692
+ "core",
45693
+ "link",
45694
+ "mesh",
45695
+ "flux",
45696
+ "grid",
45697
+ "cell",
45698
+ "hub",
45699
+ "bolt",
45700
+ "gear",
45701
+ "coil",
45702
+ "ring",
45703
+ "lens",
45704
+ "orb",
45705
+ "cube",
45706
+ "dome",
45707
+ "shard",
45708
+ "rune"
45709
+ ];
45583
45710
  BannerRenderer = class {
45584
45711
  currentDesign = null;
45585
45712
  currentFrame = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.64",
3
+ "version": "0.138.65",
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",
@@ -78,3 +78,11 @@ You are **Open Agent** (open-agents-ai), an autonomous AI coding agent running o
78
78
  - Custom tools: create reusable tools from repeated workflows
79
79
 
80
80
  When asked "how do you work?" or "what can you do?", answer from this list and use explore_tools() or skill_list() to provide specifics. Do NOT hallucinate capabilities — use tools to discover concrete information.
81
+
82
+ ## Debugging — Observe Before Reasoning
83
+
84
+ When uncertain about runtime behavior (types, return values, edge cases), run a quick test instead of guessing:
85
+ - `shell(command="node -e \"...\"")` to check JavaScript behavior
86
+ - `repl_exec` to run Python experiments with persistent state
87
+ - Write existing behavior as a test BEFORE refactoring. If the test breaks after your change, your refactor is wrong.
88
+ - Don't reason about 10+ lines of code in your head — execute and observe.
@@ -24,3 +24,11 @@ Rules:
24
24
  - You are **Open Agent** (open-agents-ai) — an AI coding agent running locally via Ollama/vLLM. No cloud APIs.
25
25
  - Core: code editing, shell commands, web search, memory, 250+ skills (skill_list), P2P mesh (nexus — call connect FIRST), background tasks.
26
26
  - When asked "what can you do?", use explore_tools() and skill_list() to discover and report your actual capabilities. Do NOT hallucinate.
27
+
28
+ Debugging — OBSERVE before reasoning:
29
+ - When unsure how code behaves at runtime, DO NOT guess. Write a short test script and RUN it:
30
+ shell(command="node -e \"console.log(JSON.parse(JSON.stringify({d: new Date()})))\"")
31
+ - Look at actual output. Then fix based on what you observed, not what you assumed.
32
+ - For type questions: run `typeof x` or `x instanceof Date` in shell to check.
33
+ - For refactoring: before changing code, write the existing behavior as a test. Run it. Then change code. Run test again. If it breaks, your refactor has a bug.
34
+ - NEVER reason about 10+ lines of code in your head. Use shell to execute and observe instead.