open-agents-ai 0.138.63 → 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: "
|
|
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 ||
|
|
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") {
|
|
@@ -40443,9 +40460,28 @@ Error: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
|
40443
40460
|
if (isArm) {
|
|
40444
40461
|
renderInfo(" ARM device detected \u2014 installing build prerequisites then deps individually.");
|
|
40445
40462
|
try {
|
|
40446
|
-
|
|
40447
|
-
|
|
40448
|
-
|
|
40463
|
+
const { spawnSync } = await import("node:child_process");
|
|
40464
|
+
renderInfo(" System build tools needed (llvm, gcc). Requesting sudo access...");
|
|
40465
|
+
const sudoCheck = spawnSync("sudo", ["-v"], { stdio: "inherit", timeout: 6e4 });
|
|
40466
|
+
if (sudoCheck.status === 0) {
|
|
40467
|
+
renderInfo(" Installing system build dependencies (this may take a minute)...");
|
|
40468
|
+
spawnSync("sudo", [
|
|
40469
|
+
"apt-get",
|
|
40470
|
+
"install",
|
|
40471
|
+
"-y",
|
|
40472
|
+
"--no-install-recommends",
|
|
40473
|
+
"llvm-dev",
|
|
40474
|
+
"gcc",
|
|
40475
|
+
"g++",
|
|
40476
|
+
"gfortran",
|
|
40477
|
+
"libopenblas-dev",
|
|
40478
|
+
"libsndfile1-dev"
|
|
40479
|
+
], { stdio: "inherit", timeout: 12e4 });
|
|
40480
|
+
} else {
|
|
40481
|
+
renderWarning(" sudo not available \u2014 skipping system build deps. librosa/lhotse may fail to compile.");
|
|
40482
|
+
}
|
|
40483
|
+
} catch (err) {
|
|
40484
|
+
renderWarning(` Could not install system build deps: ${err instanceof Error ? err.message : String(err)}`);
|
|
40449
40485
|
}
|
|
40450
40486
|
}
|
|
40451
40487
|
const installSteps = isArm ? [
|
|
@@ -45459,6 +45495,26 @@ var init_carousel = __esm({
|
|
|
45459
45495
|
});
|
|
45460
45496
|
|
|
45461
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
|
+
}
|
|
45462
45518
|
function createDefaultBanner(version = "0.120.0") {
|
|
45463
45519
|
const width = process.stdout.columns ?? 80;
|
|
45464
45520
|
const rows = 3;
|
|
@@ -45495,10 +45551,16 @@ function createDefaultBanner(version = "0.120.0") {
|
|
|
45495
45551
|
}
|
|
45496
45552
|
grid.push(row);
|
|
45497
45553
|
}
|
|
45554
|
+
const mnemonic = getNodeMnemonic();
|
|
45498
45555
|
const versionText = ` OA v${version}`;
|
|
45556
|
+
const mnemonicSuffix = ` \xB7 ${mnemonic}`;
|
|
45499
45557
|
for (let i = 0; i < versionText.length && i < width; i++) {
|
|
45500
45558
|
grid[0][i] = { char: versionText[i], fg: yellow, bg: bgDark, bold: true };
|
|
45501
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
|
+
}
|
|
45502
45564
|
const cwd4 = process.cwd();
|
|
45503
45565
|
const shortCwd = cwd4.length > 40 ? "..." + cwd4.slice(-37) : cwd4;
|
|
45504
45566
|
const infoText = ` ${shortCwd}`;
|
|
@@ -45556,11 +45618,95 @@ function createCohereBanner() {
|
|
|
45556
45618
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
45557
45619
|
};
|
|
45558
45620
|
}
|
|
45559
|
-
var isTTY7, BannerRenderer;
|
|
45621
|
+
var isTTY7, MNEMONIC_ADJECTIVES, MNEMONIC_NOUNS, BannerRenderer;
|
|
45560
45622
|
var init_banner = __esm({
|
|
45561
45623
|
"packages/cli/dist/tui/banner.js"() {
|
|
45562
45624
|
"use strict";
|
|
45563
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
|
+
];
|
|
45564
45710
|
BannerRenderer = class {
|
|
45565
45711
|
currentDesign = null;
|
|
45566
45712
|
currentFrame = 0;
|
package/package.json
CHANGED
|
@@ -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.
|