open-agents-ai 0.184.10 → 0.184.11

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/index.js +101 -52
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5263,12 +5263,12 @@ var nexus_exports = {};
5263
5263
  __export(nexus_exports, {
5264
5264
  NexusTool: () => NexusTool
5265
5265
  });
5266
- import { readFile as readFile8, writeFile as writeFile6, mkdir as mkdir3, chmod, unlink, readdir as readdir2, open as fsOpen } from "node:fs/promises";
5266
+ import { readFile as readFile8, writeFile as writeFile6, mkdir as mkdir3, chmod, unlink, readdir as readdir2, open as fsOpen, copyFile as copyFile2 } from "node:fs/promises";
5267
5267
  import { existsSync as existsSync11, readFileSync as readFileSync8, watch as fsWatchLocal } from "node:fs";
5268
5268
  import { resolve as resolve13, join as join14 } from "node:path";
5269
5269
  import { randomBytes as randomBytes4, createCipheriv, createDecipheriv, scryptSync, createHash } from "node:crypto";
5270
5270
  import { execSync as execSync6, spawn as spawn2 } from "node:child_process";
5271
- import { hostname, userInfo } from "node:os";
5271
+ import { hostname, userInfo, homedir as homedir4 } from "node:os";
5272
5272
  function containsKeyMaterial(input) {
5273
5273
  for (const pattern of KEY_PATTERNS) {
5274
5274
  if (pattern.test(input))
@@ -5314,7 +5314,12 @@ mkdirSync(invocationsDir, { recursive: true });
5314
5314
  // Write PID so the agent can kill us
5315
5315
  writeFileSync(pidFile, String(process.pid));
5316
5316
 
5317
- const keyPath = join(nexusDir, 'identity.key');
5317
+ // Use GLOBAL identity key so all OA instances on this machine share one peerId.
5318
+ // Fallback to project-scoped key if global doesn't exist.
5319
+ const globalKeyDir = join(require('os').homedir(), '.open-agents');
5320
+ const globalKeyPath = join(globalKeyDir, 'identity.key');
5321
+ const projectKeyPath = join(nexusDir, 'identity.key');
5322
+ const keyPath = existsSync(globalKeyPath) ? globalKeyPath : projectKeyPath;
5318
5323
  var nexusOpts = {
5319
5324
  keyStorePath: keyPath,
5320
5325
  agentName,
@@ -8572,8 +8577,8 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
8572
8577
  }
8573
8578
  } else {
8574
8579
  try {
8575
- const globalDir = await execAsync2("npm root -g", { timeout: 5e3 });
8576
- const globalPkg = join14(globalDir, "open-agents-nexus", "package.json");
8580
+ const globalDir2 = await execAsync2("npm root -g", { timeout: 5e3 });
8581
+ const globalPkg = join14(globalDir2, "open-agents-nexus", "package.json");
8577
8582
  if (existsSync11(globalPkg)) {
8578
8583
  nexusResolved = true;
8579
8584
  try {
@@ -8620,7 +8625,28 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
8620
8625
  await this.ensureWallet();
8621
8626
  const daemonPath = join14(this.nexusDir, "nexus-daemon.mjs");
8622
8627
  await writeFile6(daemonPath, DAEMON_SCRIPT);
8628
+ const globalDir = join14(homedir4(), ".open-agents");
8629
+ const globalKeyPath = join14(globalDir, "identity.key");
8630
+ const projectKeyPath = join14(this.nexusDir, "identity.key");
8631
+ if (existsSync11(projectKeyPath) && !existsSync11(globalKeyPath)) {
8632
+ try {
8633
+ if (!existsSync11(globalDir))
8634
+ await mkdir3(globalDir, { recursive: true });
8635
+ await copyFile2(projectKeyPath, globalKeyPath);
8636
+ } catch {
8637
+ }
8638
+ }
8639
+ const effectiveKeyPath = existsSync11(globalKeyPath) ? globalKeyPath : projectKeyPath;
8640
+ const globalNamePath = join14(globalDir, "agent-name");
8623
8641
  const agentName = args.agent_name || (() => {
8642
+ try {
8643
+ if (existsSync11(globalNamePath)) {
8644
+ const custom = readFileSync8(globalNamePath, "utf8").trim();
8645
+ if (custom)
8646
+ return custom;
8647
+ }
8648
+ } catch {
8649
+ }
8624
8650
  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"];
8625
8651
  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"];
8626
8652
  const seed = `${hostname()}:${userInfo().username}`;
@@ -8635,8 +8661,8 @@ process.on('SIGINT', () => process.emit('SIGTERM'));
8635
8661
  const agentType = args.agent_type || "general";
8636
8662
  const nodePaths = [nodeModulesDir];
8637
8663
  try {
8638
- const globalDir = await execAsync2("npm root -g", { timeout: 5e3 });
8639
- nodePaths.push(globalDir);
8664
+ const globalDir2 = await execAsync2("npm root -g", { timeout: 5e3 });
8665
+ nodePaths.push(globalDir2);
8640
8666
  } catch {
8641
8667
  }
8642
8668
  const { openSync: openSync2, closeSync: closeSync2 } = await import("node:fs");
@@ -10572,10 +10598,10 @@ __export(custom_tool_exports, {
10572
10598
  });
10573
10599
  import { existsSync as existsSync13, readdirSync as readdirSync4, readFileSync as readFileSync10, mkdirSync as mkdirSync5, writeFileSync as writeFileSync5 } from "node:fs";
10574
10600
  import { join as join16 } from "node:path";
10575
- import { homedir as homedir4 } from "node:os";
10601
+ import { homedir as homedir5 } from "node:os";
10576
10602
  import { spawn as spawn4 } from "node:child_process";
10577
10603
  function globalToolsDir() {
10578
- return join16(homedir4(), ".open-agents", "tools");
10604
+ return join16(homedir5(), ".open-agents", "tools");
10579
10605
  }
10580
10606
  function projectToolsDir(repoRoot) {
10581
10607
  return join16(repoRoot, ".oa", "tools");
@@ -11069,10 +11095,10 @@ var init_tool_creator = __esm({
11069
11095
  // packages/execution/dist/tools/skill-tools.js
11070
11096
  import { existsSync as existsSync14, readdirSync as readdirSync5, readFileSync as readFileSync11 } from "node:fs";
11071
11097
  import { join as join17, basename as basename3, dirname as dirname3 } from "node:path";
11072
- import { homedir as homedir5 } from "node:os";
11098
+ import { homedir as homedir6 } from "node:os";
11073
11099
  import { execSync as execSync9 } from "node:child_process";
11074
11100
  function getAiwgPaths() {
11075
- const dataDir = join17(homedir5(), ".local", "share", "ai-writing-guide");
11101
+ const dataDir = join17(homedir6(), ".local", "share", "ai-writing-guide");
11076
11102
  return {
11077
11103
  frameworksDir: join17(dataDir, "agentic", "code", "frameworks"),
11078
11104
  addonsDir: join17(dataDir, "agentic", "code", "addons"),
@@ -11098,7 +11124,7 @@ function findAiwgPackageRoot() {
11098
11124
  const candidates = [
11099
11125
  "/usr/local/lib/node_modules/aiwg",
11100
11126
  "/usr/lib/node_modules/aiwg",
11101
- join17(homedir5(), ".nvm", "versions")
11127
+ join17(homedir6(), ".nvm", "versions")
11102
11128
  // nvm — need to search deeper
11103
11129
  ];
11104
11130
  for (const c3 of candidates) {
@@ -11754,7 +11780,7 @@ ${content}`
11754
11780
  // packages/execution/dist/tools/transcribe-tool.js
11755
11781
  import { existsSync as existsSync16, mkdirSync as mkdirSync7, writeFileSync as writeFileSync7, readFileSync as readFileSync13, unlinkSync } from "node:fs";
11756
11782
  import { join as join19, basename as basename4, extname as extname3, resolve as resolve15 } from "node:path";
11757
- import { homedir as homedir6 } from "node:os";
11783
+ import { homedir as homedir7 } from "node:os";
11758
11784
  import { execSync as execSync10, spawn as spawn5 } from "node:child_process";
11759
11785
  function isTranscribable(path) {
11760
11786
  const ext = extname3(path).toLowerCase();
@@ -11779,7 +11805,7 @@ async function loadTranscribeCli() {
11779
11805
  }
11780
11806
  } catch {
11781
11807
  }
11782
- const nvmBase = join19(homedir6(), ".nvm", "versions", "node");
11808
+ const nvmBase = join19(homedir7(), ".nvm", "versions", "node");
11783
11809
  if (existsSync16(nvmBase)) {
11784
11810
  try {
11785
11811
  const { readdirSync: readdirSync21 } = await import("node:fs");
@@ -16583,7 +16609,7 @@ import { existsSync as existsSync21, statSync as statSync8 } from "node:fs";
16583
16609
  import { resolve as resolve21, basename as basename8, dirname as dirname8, join as join31 } from "node:path";
16584
16610
  import { execSync as execSync15 } from "node:child_process";
16585
16611
  import { fileURLToPath as fileURLToPath4 } from "node:url";
16586
- import { homedir as homedir7, tmpdir as tmpdir6 } from "node:os";
16612
+ import { homedir as homedir8, tmpdir as tmpdir6 } from "node:os";
16587
16613
  function findOcrScript() {
16588
16614
  const thisDir = dirname8(fileURLToPath4(import.meta.url));
16589
16615
  const devPath3 = resolve21(thisDir, "../../scripts/ocr-advanced.py");
@@ -16599,7 +16625,7 @@ function findOcrScript() {
16599
16625
  }
16600
16626
  function findPython() {
16601
16627
  const isWin2 = process.platform === "win32";
16602
- const venvPython2 = isWin2 ? join31(homedir7(), ".open-agents", "venv", "Scripts", "python.exe") : join31(homedir7(), ".open-agents", "venv", "bin", "python");
16628
+ const venvPython2 = isWin2 ? join31(homedir8(), ".open-agents", "venv", "Scripts", "python.exe") : join31(homedir8(), ".open-agents", "venv", "bin", "python");
16603
16629
  if (existsSync21(venvPython2)) {
16604
16630
  try {
16605
16631
  execSync15(`${JSON.stringify(venvPython2)} -c "import cv2, pytesseract, numpy, PIL"`, {
@@ -17672,7 +17698,7 @@ train.py reverted to last kept state. Ready for next experiment.`,
17672
17698
  import { execSync as execSync18, exec as execCb } from "node:child_process";
17673
17699
  import { readFile as readFile15, writeFile as writeFile15, mkdir as mkdir11 } from "node:fs/promises";
17674
17700
  import { resolve as resolve23, join as join34 } from "node:path";
17675
- import { homedir as homedir8 } from "node:os";
17701
+ import { homedir as homedir9 } from "node:os";
17676
17702
  import { randomBytes as randomBytes6 } from "node:crypto";
17677
17703
  function isValidCron(expr) {
17678
17704
  const parts = expr.trim().split(/\s+/);
@@ -17803,7 +17829,7 @@ async function saveStore(workingDir, store) {
17803
17829
  await writeFile15(join34(dir, "tasks.json"), JSON.stringify(store, null, 2), "utf-8");
17804
17830
  }
17805
17831
  function globalStoreDir() {
17806
- return join34(homedir8(), ".open-agents", "scheduled");
17832
+ return join34(homedir9(), ".open-agents", "scheduled");
17807
17833
  }
17808
17834
  async function loadGlobalStore() {
17809
17835
  try {
@@ -19321,7 +19347,7 @@ var init_factory = __esm({
19321
19347
  import { execSync as execSync21 } from "node:child_process";
19322
19348
  import { readFile as readFile18, writeFile as writeFile18, mkdir as mkdir14 } from "node:fs/promises";
19323
19349
  import { resolve as resolve27, join as join39 } from "node:path";
19324
- import { homedir as homedir9 } from "node:os";
19350
+ import { homedir as homedir10 } from "node:os";
19325
19351
  import { randomBytes as randomBytes9 } from "node:crypto";
19326
19352
  function isValidCron2(expr) {
19327
19353
  const parts = expr.trim().split(/\s+/);
@@ -19451,7 +19477,7 @@ async function saveStore2(workingDir, store) {
19451
19477
  await writeFile18(join39(dir, "store.json"), JSON.stringify(store, null, 2), "utf-8");
19452
19478
  }
19453
19479
  function globalCronDir() {
19454
- return join39(homedir9(), ".open-agents", "cron-agents");
19480
+ return join39(homedir10(), ".open-agents", "cron-agents");
19455
19481
  }
19456
19482
  async function loadGlobalCronStore() {
19457
19483
  try {
@@ -29619,7 +29645,7 @@ __export(listen_exports, {
29619
29645
  import { spawn as spawn16, execSync as execSync25 } from "node:child_process";
29620
29646
  import { existsSync as existsSync32, mkdirSync as mkdirSync11, writeFileSync as writeFileSync12, readdirSync as readdirSync8 } from "node:fs";
29621
29647
  import { join as join48, dirname as dirname14 } from "node:path";
29622
- import { homedir as homedir10 } from "node:os";
29648
+ import { homedir as homedir11 } from "node:os";
29623
29649
  import { fileURLToPath as fileURLToPath8 } from "node:url";
29624
29650
  import { EventEmitter } from "node:events";
29625
29651
  import { createInterface as createInterface2 } from "node:readline";
@@ -29731,7 +29757,7 @@ function findLiveWhisperScript() {
29731
29757
  }
29732
29758
  } catch {
29733
29759
  }
29734
- const nvmBase = join48(homedir10(), ".nvm", "versions", "node");
29760
+ const nvmBase = join48(homedir11(), ".nvm", "versions", "node");
29735
29761
  if (existsSync32(nvmBase)) {
29736
29762
  try {
29737
29763
  for (const ver of readdirSync8(nvmBase)) {
@@ -29985,7 +30011,7 @@ var init_listen = __esm({
29985
30011
  }
29986
30012
  } catch {
29987
30013
  }
29988
- const nvmBase = join48(homedir10(), ".nvm", "versions", "node");
30014
+ const nvmBase = join48(homedir11(), ".nvm", "versions", "node");
29989
30015
  if (existsSync32(nvmBase)) {
29990
30016
  try {
29991
30017
  const { readdirSync: readdirSync21 } = await import("node:fs");
@@ -39010,7 +39036,7 @@ __export(oa_directory_exports, {
39010
39036
  });
39011
39037
  import { existsSync as existsSync36, mkdirSync as mkdirSync14, readFileSync as readFileSync27, writeFileSync as writeFileSync15, readdirSync as readdirSync10, statSync as statSync12, unlinkSync as unlinkSync7 } from "node:fs";
39012
39038
  import { join as join53, relative as relative3, basename as basename11, extname as extname9 } from "node:path";
39013
- import { homedir as homedir11 } from "node:os";
39039
+ import { homedir as homedir12 } from "node:os";
39014
39040
  function initOaDirectory(repoRoot) {
39015
39041
  const oaPath = join53(repoRoot, OA_DIR);
39016
39042
  for (const sub of SUBDIRS) {
@@ -39050,7 +39076,7 @@ function saveProjectSettings(repoRoot, settings) {
39050
39076
  writeFileSync15(join53(oaPath, "settings.json"), JSON.stringify(merged, null, 2) + "\n", { encoding: "utf-8", mode: 384 });
39051
39077
  }
39052
39078
  function loadGlobalSettings() {
39053
- const settingsPath = join53(homedir11(), ".open-agents", "settings.json");
39079
+ const settingsPath = join53(homedir12(), ".open-agents", "settings.json");
39054
39080
  try {
39055
39081
  if (existsSync36(settingsPath)) {
39056
39082
  return JSON.parse(readFileSync27(settingsPath, "utf-8"));
@@ -39060,7 +39086,7 @@ function loadGlobalSettings() {
39060
39086
  return {};
39061
39087
  }
39062
39088
  function saveGlobalSettings(settings) {
39063
- const dir = join53(homedir11(), ".open-agents");
39089
+ const dir = join53(homedir12(), ".open-agents");
39064
39090
  mkdirSync14(dir, { recursive: true });
39065
39091
  const existing = loadGlobalSettings();
39066
39092
  const merged = { ...existing, ...settings };
@@ -39440,13 +39466,13 @@ function recordUsage(kind, value, opts) {
39440
39466
  }
39441
39467
  saveUsageFile(filePath, data);
39442
39468
  };
39443
- update(join53(homedir11(), ".open-agents", USAGE_HISTORY_FILE));
39469
+ update(join53(homedir12(), ".open-agents", USAGE_HISTORY_FILE));
39444
39470
  if (opts?.repoRoot) {
39445
39471
  update(join53(opts.repoRoot, OA_DIR, USAGE_HISTORY_FILE));
39446
39472
  }
39447
39473
  }
39448
39474
  function loadUsageHistory(kind, repoRoot) {
39449
- const globalPath = join53(homedir11(), ".open-agents", USAGE_HISTORY_FILE);
39475
+ const globalPath = join53(homedir12(), ".open-agents", USAGE_HISTORY_FILE);
39450
39476
  const globalData = loadUsageFile(globalPath);
39451
39477
  const localData = repoRoot ? loadUsageFile(join53(repoRoot, OA_DIR, USAGE_HISTORY_FILE)) : { records: [] };
39452
39478
  const map = /* @__PURE__ */ new Map();
@@ -39479,7 +39505,7 @@ function deleteUsageRecord(kind, value, repoRoot) {
39479
39505
  saveUsageFile(filePath, data);
39480
39506
  }
39481
39507
  };
39482
- remove(join53(homedir11(), ".open-agents", USAGE_HISTORY_FILE));
39508
+ remove(join53(homedir12(), ".open-agents", USAGE_HISTORY_FILE));
39483
39509
  if (repoRoot) {
39484
39510
  remove(join53(repoRoot, OA_DIR, USAGE_HISTORY_FILE));
39485
39511
  }
@@ -39533,7 +39559,7 @@ import { execSync as execSync27, spawn as spawn19, exec as exec2 } from "node:ch
39533
39559
  import { promisify as promisify6 } from "node:util";
39534
39560
  import { existsSync as existsSync37, writeFileSync as writeFileSync16, readFileSync as readFileSync28, appendFileSync as appendFileSync2, mkdirSync as mkdirSync15 } from "node:fs";
39535
39561
  import { join as join54 } from "node:path";
39536
- import { homedir as homedir12, platform as platform2 } from "node:os";
39562
+ import { homedir as homedir13, platform as platform2 } from "node:os";
39537
39563
  async function checkToolSupport(modelName, backendUrl = "http://localhost:11434") {
39538
39564
  if (_toolSupportCache.has(modelName))
39539
39565
  return _toolSupportCache.get(modelName);
@@ -40598,7 +40624,7 @@ async function doSetup(config, rl) {
40598
40624
  `PARAMETER num_predict ${numPredict}`,
40599
40625
  `PARAMETER stop "<|endoftext|>"`
40600
40626
  ].join("\n");
40601
- const modelDir2 = join54(homedir12(), ".open-agents", "models");
40627
+ const modelDir2 = join54(homedir13(), ".open-agents", "models");
40602
40628
  mkdirSync15(modelDir2, { recursive: true });
40603
40629
  const modelfilePath = join54(modelDir2, `Modelfile.${customName}`);
40604
40630
  writeFileSync16(modelfilePath, modelfileContent + "\n", "utf8");
@@ -40646,7 +40672,7 @@ async function isModelAvailable(config) {
40646
40672
  }
40647
40673
  function isFirstRun() {
40648
40674
  try {
40649
- return !existsSync37(join54(homedir12(), ".open-agents", "config.json"));
40675
+ return !existsSync37(join54(homedir13(), ".open-agents", "config.json"));
40650
40676
  } catch {
40651
40677
  return true;
40652
40678
  }
@@ -40683,7 +40709,7 @@ function detectPkgManager() {
40683
40709
  return null;
40684
40710
  }
40685
40711
  function getVenvDir() {
40686
- return join54(homedir12(), ".open-agents", "venv");
40712
+ return join54(homedir13(), ".open-agents", "venv");
40687
40713
  }
40688
40714
  function hasVenvModule() {
40689
40715
  try {
@@ -40710,7 +40736,7 @@ function ensureVenv(log) {
40710
40736
  return null;
40711
40737
  }
40712
40738
  try {
40713
- mkdirSync15(join54(homedir12(), ".open-agents"), { recursive: true });
40739
+ mkdirSync15(join54(homedir13(), ".open-agents"), { recursive: true });
40714
40740
  const pyCmd = hasCmd(pythonCmd) ? pythonCmd : "python3";
40715
40741
  execSync27(`${pyCmd} -m venv "${venvDir}"`, { stdio: "pipe", timeout: 3e4 });
40716
40742
  execSync27(`"${pipPath}" install --upgrade pip`, {
@@ -40977,9 +41003,9 @@ function ensureCloudflaredBackground(onInfo) {
40977
41003
  const archMap = { x64: "amd64", arm64: "arm64", arm: "arm" };
40978
41004
  const cfArch = archMap[arch2] ?? "amd64";
40979
41005
  try {
40980
- execSync27(`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir12()}/.local/bin" && mv /tmp/cloudflared "${homedir12()}/.local/bin/cloudflared"`, { stdio: "pipe", timeout: 6e4 });
40981
- if (!process.env.PATH?.includes(`${homedir12()}/.local/bin`)) {
40982
- process.env.PATH = `${homedir12()}/.local/bin:${process.env.PATH}`;
41006
+ execSync27(`curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cfArch}" -o /tmp/cloudflared && chmod +x /tmp/cloudflared && mkdir -p "${homedir13()}/.local/bin" && mv /tmp/cloudflared "${homedir13()}/.local/bin/cloudflared"`, { stdio: "pipe", timeout: 6e4 });
41007
+ if (!process.env.PATH?.includes(`${homedir13()}/.local/bin`)) {
41008
+ process.env.PATH = `${homedir13()}/.local/bin:${process.env.PATH}`;
40983
41009
  }
40984
41010
  if (hasCmd("cloudflared")) {
40985
41011
  log("cloudflared installed.");
@@ -41074,7 +41100,7 @@ async function createExpandedVariantAsync(baseModel, specs, sizeGB, kvBytesPerTo
41074
41100
  `PARAMETER num_predict ${numPredict}`,
41075
41101
  `PARAMETER stop "<|endoftext|>"`
41076
41102
  ].join("\n");
41077
- const modelDir2 = join54(homedir12(), ".open-agents", "models");
41103
+ const modelDir2 = join54(homedir13(), ".open-agents", "models");
41078
41104
  mkdirSync15(modelDir2, { recursive: true });
41079
41105
  const modelfilePath = join54(modelDir2, `Modelfile.${customName}`);
41080
41106
  writeFileSync16(modelfilePath, modelfileContent + "\n", "utf8");
@@ -41151,7 +41177,7 @@ async function ensureNeovim() {
41151
41177
  const platform6 = process.platform;
41152
41178
  const arch2 = process.arch;
41153
41179
  if (platform6 === "linux") {
41154
- const binDir = join54(homedir12(), ".local", "bin");
41180
+ const binDir = join54(homedir13(), ".local", "bin");
41155
41181
  const nvimDest = join54(binDir, "nvim");
41156
41182
  try {
41157
41183
  mkdirSync15(binDir, { recursive: true });
@@ -41223,7 +41249,7 @@ async function ensureNeovim() {
41223
41249
  }
41224
41250
  function ensurePathInShellRc(binDir) {
41225
41251
  const shell = process.env.SHELL ?? "";
41226
- const rcFile = shell.includes("zsh") ? join54(homedir12(), ".zshrc") : join54(homedir12(), ".bashrc");
41252
+ const rcFile = shell.includes("zsh") ? join54(homedir13(), ".zshrc") : join54(homedir13(), ".bashrc");
41227
41253
  try {
41228
41254
  const rcContent = existsSync37(rcFile) ? readFileSync28(rcFile, "utf8") : "";
41229
41255
  if (rcContent.includes(binDir))
@@ -43568,7 +43594,7 @@ __export(voice_exports, {
43568
43594
  });
43569
43595
  import { existsSync as existsSync41, mkdirSync as mkdirSync17, writeFileSync as writeFileSync18, readFileSync as readFileSync30, unlinkSync as unlinkSync9, readdirSync as readdirSync11, renameSync, statSync as statSync13 } from "node:fs";
43570
43596
  import { join as join57, dirname as dirname18 } from "node:path";
43571
- import { homedir as homedir13, tmpdir as tmpdir9, platform as platform3 } from "node:os";
43597
+ import { homedir as homedir14, tmpdir as tmpdir9, platform as platform3 } from "node:os";
43572
43598
  import { execSync as execSync29, spawn as nodeSpawn } from "node:child_process";
43573
43599
  import { createRequire } from "node:module";
43574
43600
  function sanitizeForTTS(text) {
@@ -43592,7 +43618,7 @@ function listVoiceModels() {
43592
43618
  }));
43593
43619
  }
43594
43620
  function voiceDir() {
43595
- return join57(homedir13(), ".open-agents", "voice");
43621
+ return join57(homedir14(), ".open-agents", "voice");
43596
43622
  }
43597
43623
  function modelsDir() {
43598
43624
  return join57(voiceDir(), "models");
@@ -44588,7 +44614,7 @@ var init_voice = __esm({
44588
44614
  }
44589
44615
  p = p.replace(/\\ /g, " ");
44590
44616
  if (p.startsWith("~/") || p === "~") {
44591
- p = join57(homedir13(), p.slice(1));
44617
+ p = join57(homedir14(), p.slice(1));
44592
44618
  }
44593
44619
  if (!existsSync41(p)) {
44594
44620
  return `File not found: ${p}
@@ -46628,6 +46654,29 @@ async function handleSlashCommand(input, ctx) {
46628
46654
  } else {
46629
46655
  renderInfo("No wallet configured. Ask the agent to create one via the nexus tool.");
46630
46656
  }
46657
+ } else if (sub === "name") {
46658
+ const { homedir: homedir19 } = __require("node:os");
46659
+ const { existsSync: ex, readFileSync: rf, writeFileSync: wf, mkdirSync: mkd } = __require("node:fs");
46660
+ const namePath = __require("node:path").join(homedir19(), ".open-agents", "agent-name");
46661
+ if (rest2) {
46662
+ const customName = rest2.replace(/[^a-zA-Z0-9_\-.\s]/g, "").trim().slice(0, 40);
46663
+ if (!customName) {
46664
+ renderError("Invalid name. Use alphanumeric characters, dashes, dots, underscores.");
46665
+ return "handled";
46666
+ }
46667
+ mkd(__require("node:path").dirname(namePath), { recursive: true });
46668
+ wf(namePath, customName, "utf8");
46669
+ renderInfo(`Agent name set to: ${c2.bold(customName)}`);
46670
+ renderInfo("Restart the nexus daemon (/nexus restart) for the change to take effect.");
46671
+ } else {
46672
+ if (ex(namePath)) {
46673
+ const current = rf(namePath, "utf8").trim();
46674
+ renderInfo(`Current agent name: ${c2.bold(current)}`);
46675
+ } else {
46676
+ renderInfo("No custom name set. Using deterministic mnemonic.");
46677
+ }
46678
+ renderInfo(`Set a custom name: /nexus name <your-name>`);
46679
+ }
46631
46680
  } else if (sub === "restart" || sub === "disconnect" || sub === "kill") {
46632
46681
  const nexusDir = ctx.repoRoot ? __require("node:path").join(ctx.repoRoot, ".oa", "nexus") : null;
46633
46682
  if (!nexusDir) {
@@ -49197,9 +49246,9 @@ async function handleVoiceMenu(ctx, save, hasLocal) {
49197
49246
  }
49198
49247
  const { basename: basename18, join: pathJoin } = await import("node:path");
49199
49248
  const { copyFileSync: copyFileSync2, mkdirSync: mkdirSync27, existsSync: exists } = await import("node:fs");
49200
- const { homedir: homedir18 } = await import("node:os");
49249
+ const { homedir: homedir19 } = await import("node:os");
49201
49250
  const modelName = basename18(onnxDrop.path, ".onnx").replace(/[^a-zA-Z0-9_-]/g, "-");
49202
- const destDir = pathJoin(homedir18(), ".open-agents", "voice", "models", modelName);
49251
+ const destDir = pathJoin(homedir19(), ".open-agents", "voice", "models", modelName);
49203
49252
  if (!exists(destDir))
49204
49253
  mkdirSync27(destDir, { recursive: true });
49205
49254
  copyFileSync2(onnxDrop.path, pathJoin(destDir, "model.onnx"));
@@ -50933,7 +50982,7 @@ var init_commands = __esm({
50933
50982
  import { existsSync as existsSync43, readFileSync as readFileSync32, readdirSync as readdirSync13 } from "node:fs";
50934
50983
  import { join as join59, basename as basename12 } from "node:path";
50935
50984
  import { execSync as execSync30 } from "node:child_process";
50936
- import { homedir as homedir15, platform as platform4, release } from "node:os";
50985
+ import { homedir as homedir16, platform as platform4, release } from "node:os";
50937
50986
  function getModelTier(modelName) {
50938
50987
  const m = modelName.toLowerCase();
50939
50988
  const sizeMatch = m.match(/\b(\d+)b\b/);
@@ -51020,7 +51069,7 @@ function loadMemoryContext(repoRoot) {
51020
51069
  if (legacyEntries)
51021
51070
  sections.push(legacyEntries);
51022
51071
  }
51023
- const globalMemDir = join59(homedir15(), ".open-agents", "memory");
51072
+ const globalMemDir = join59(homedir16(), ".open-agents", "memory");
51024
51073
  const globalEntries = loadMemoryDir(globalMemDir, "global");
51025
51074
  if (globalEntries)
51026
51075
  sections.push(globalEntries);
@@ -61177,7 +61226,7 @@ import { fileURLToPath as fileURLToPath12 } from "node:url";
61177
61226
  import { readFileSync as readFileSync39, writeFileSync as writeFileSync23, appendFileSync as appendFileSync4, rmSync as rmSync3, readdirSync as readdirSync19, mkdirSync as mkdirSync24 } from "node:fs";
61178
61227
  import { existsSync as existsSync50 } from "node:fs";
61179
61228
  import { execSync as execSync33 } from "node:child_process";
61180
- import { homedir as homedir16 } from "node:os";
61229
+ import { homedir as homedir17 } from "node:os";
61181
61230
  function formatTimeAgo(date) {
61182
61231
  const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
61183
61232
  if (seconds < 60)
@@ -63001,7 +63050,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
63001
63050
  const hits = allCompletions.filter((c3) => c3.toLowerCase().startsWith(lower));
63002
63051
  return [hits, line];
63003
63052
  }
63004
- const HISTORY_DIR = join67(homedir16(), ".open-agents");
63053
+ const HISTORY_DIR = join67(homedir17(), ".open-agents");
63005
63054
  const HISTORY_FILE = join67(HISTORY_DIR, "repl-history");
63006
63055
  const MAX_HISTORY_LINES = 500;
63007
63056
  let savedHistory = [];
@@ -64520,7 +64569,7 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
64520
64569
  } catch {
64521
64570
  }
64522
64571
  try {
64523
- const voiceDir2 = join67(homedir16(), ".open-agents", "voice");
64572
+ const voiceDir2 = join67(homedir17(), ".open-agents", "voice");
64524
64573
  const voicePidFiles = ["luxtts-daemon.pid", "piper-daemon.pid"];
64525
64574
  for (const pf of voicePidFiles) {
64526
64575
  const pidPath = join67(voiceDir2, pf);
@@ -66372,7 +66421,7 @@ __export(config_exports, {
66372
66421
  configCommand: () => configCommand
66373
66422
  });
66374
66423
  import { join as join70, resolve as resolve34 } from "node:path";
66375
- import { homedir as homedir17 } from "node:os";
66424
+ import { homedir as homedir18 } from "node:os";
66376
66425
  import { cwd as cwd3 } from "node:process";
66377
66426
  function redactIfSensitive(key, value) {
66378
66427
  if (SENSITIVE_KEYS.has(key) && typeof value === "string" && value.length > 0) {
@@ -66454,7 +66503,7 @@ function handleShow(opts, config) {
66454
66503
  }
66455
66504
  }
66456
66505
  printSection("Config File");
66457
- printInfo(`~/.open-agents/config.json (${join70(homedir17(), ".open-agents", "config.json")})`);
66506
+ printInfo(`~/.open-agents/config.json (${join70(homedir18(), ".open-agents", "config.json")})`);
66458
66507
  printSection("Priority Chain");
66459
66508
  printInfo(" 1. CLI flags (--model, --backend-url, etc.)");
66460
66509
  printInfo(" 2. Project .oa/settings.json (--local)");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.184.10",
3
+ "version": "0.184.11",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) \u2014 interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",