open-agents-ai 0.186.32 → 0.186.34

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 +69 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -17858,7 +17858,7 @@ var init_browser_action = __esm({
17858
17858
 
17859
17859
  // packages/execution/dist/tools/autoresearch.js
17860
17860
  import { execSync as execSync18, spawn as spawn10 } from "node:child_process";
17861
- import { existsSync as existsSync23, readFileSync as readFileSync18, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, appendFileSync, copyFileSync } from "node:fs";
17861
+ import { existsSync as existsSync23, readFileSync as readFileSync18, writeFileSync as writeFileSync8, mkdirSync as mkdirSync8, appendFileSync as appendFileSync2, copyFileSync } from "node:fs";
17862
17862
  import { join as join33, resolve as resolve22, dirname as dirname10 } from "node:path";
17863
17863
  import { fileURLToPath as fileURLToPath6 } from "node:url";
17864
17864
  function findAutoresearchScript(scriptName) {
@@ -18321,7 +18321,7 @@ Run autoresearch(action="setup") to begin.`,
18321
18321
  }
18322
18322
  const row = `${commitHash} ${valBpb.toFixed(6)} ${memGb.toFixed(1)} keep ${desc}
18323
18323
  `;
18324
- appendFileSync(tsvPath, row, "utf-8");
18324
+ appendFileSync2(tsvPath, row, "utf-8");
18325
18325
  return {
18326
18326
  success: true,
18327
18327
  output: `Kept: ${commitHash} | val_bpb=${valBpb.toFixed(6)} | ${memGb.toFixed(1)}GB | ${desc}
@@ -18354,7 +18354,7 @@ Branch advanced. Ready for next experiment.`,
18354
18354
  }
18355
18355
  const row = `${commitHash} ${valBpb.toFixed(6)} ${memGb.toFixed(1)} discard ${desc}
18356
18356
  `;
18357
- appendFileSync(tsvPath, row, "utf-8");
18357
+ appendFileSync2(tsvPath, row, "utf-8");
18358
18358
  try {
18359
18359
  execSync18("git checkout -- train.py", { cwd: workspace, encoding: "utf-8", timeout: 5e3 });
18360
18360
  } catch {
@@ -43039,7 +43039,7 @@ var init_personaplex = __esm({
43039
43039
  import * as readline from "node:readline";
43040
43040
  import { execSync as execSync29, spawn as spawn20, exec as exec2 } from "node:child_process";
43041
43041
  import { promisify as promisify6 } from "node:util";
43042
- import { existsSync as existsSync39, writeFileSync as writeFileSync18, readFileSync as readFileSync30, appendFileSync as appendFileSync2, mkdirSync as mkdirSync17 } from "node:fs";
43042
+ import { existsSync as existsSync39, writeFileSync as writeFileSync18, readFileSync as readFileSync30, appendFileSync as appendFileSync3, mkdirSync as mkdirSync17 } from "node:fs";
43043
43043
  import { join as join56 } from "node:path";
43044
43044
  import { homedir as homedir15, platform as platform2 } from "node:os";
43045
43045
  async function checkToolSupport(modelName, backendUrl = "http://localhost:11434") {
@@ -44789,7 +44789,7 @@ function ensurePathInShellRc(binDir) {
44789
44789
  const exportLine = `
44790
44790
  export PATH="${binDir}:$PATH" # Added by open-agents for nvim
44791
44791
  `;
44792
- appendFileSync2(rcFile, exportLine, "utf8");
44792
+ appendFileSync3(rcFile, exportLine, "utf8");
44793
44793
  console.log(` Added ${binDir} to ${rcFile}`);
44794
44794
  } catch {
44795
44795
  }
@@ -46554,13 +46554,16 @@ async function runSponsorWizard(ctx) {
46554
46554
  goLiveSuccess = false;
46555
46555
  }
46556
46556
  }
46557
+ const _logPath = __require("node:path").join(ctx.projectDir, ".oa", "sponsor", "sponsor-startup.log");
46557
46558
  if (goLiveSuccess) {
46558
46559
  renderInfo("\u2726 Sponsorship active!");
46559
46560
  renderInfo("Toggle: /sponsor status | Pause: /sponsor pause | Remove: /sponsor remove");
46561
+ renderInfo(`Startup log: ${_logPath}`);
46560
46562
  } else {
46561
46563
  config.status = "inactive";
46562
46564
  saveSponsorConfig(ctx.projectDir, config);
46563
46565
  renderWarning("Sponsorship could not go live \u2014 no public endpoint available.");
46566
+ renderInfo(`Verbose log: ${_logPath}`);
46564
46567
  renderInfo("Fix the tunnel/P2P issue and run /sponsor again.");
46565
46568
  }
46566
46569
  return config;
@@ -51413,21 +51416,39 @@ Clone a new voice: /voice clone <wav-file> [name]`);
51413
51416
  }
51414
51417
  }
51415
51418
  }
51419
+ const _spLogDir = join60(projectDir, ".oa", "sponsor");
51420
+ mkdirSync20(_spLogDir, { recursive: true });
51421
+ const _spLogFile = join60(_spLogDir, "sponsor-startup.log");
51422
+ const _spLog = (msg) => {
51423
+ const line = `[${(/* @__PURE__ */ new Date()).toISOString()}] ${msg}
51424
+ `;
51425
+ try {
51426
+ appendFileSync(_spLogFile, line);
51427
+ } catch {
51428
+ }
51429
+ };
51430
+ _spLog("=== /sponsor go-live started ===");
51431
+ _spLog(`projectDir: ${projectDir}`);
51432
+ _spLog(`transport.tunnel: ${config.transport.tunnel}, transport.libp2p: ${config.transport.libp2p}`);
51416
51433
  if (config.transport.libp2p && ctx.exposeStart) {
51417
51434
  let daemonReady = false;
51418
51435
  try {
51419
51436
  const nexus = new NexusTool(projectDir);
51420
- const curStatus = String(await nexus.execute({ action: "status" }) ?? "");
51437
+ const curStatus = ((r) => typeof r === "object" && r?.output ? String(r.output) : String(r ?? ""))(await nexus.execute({ action: "status" }));
51438
+ _spLog(`daemon status check: ${curStatus.slice(0, 200)}`);
51421
51439
  if (/Connected:\s*true/i.test(curStatus)) {
51422
51440
  daemonReady = true;
51441
+ _spLog("daemon ALREADY connected \u2014 reusing");
51423
51442
  renderInfo("Using existing nexus daemon connection.");
51424
51443
  } else if (curStatus.includes("not running")) {
51444
+ _spLog("daemon not running \u2014 starting fresh");
51425
51445
  renderInfo("Starting nexus daemon...");
51426
- await nexus.execute({ action: "connect" });
51446
+ const _connectResult = await nexus.execute({ action: "connect" });
51447
+ _spLog(`connect result: ${(typeof _connectResult === "object" && _connectResult?.output ? String(_connectResult.output) : String(_connectResult ?? "")).slice(0, 300)}`);
51427
51448
  for (let wait = 0; wait < 25; wait++) {
51428
51449
  await new Promise((r) => setTimeout(r, 1e3));
51429
51450
  try {
51430
- const status = String(await nexus.execute({ action: "status" }) ?? "");
51451
+ const status = ((r) => typeof r === "object" && r?.output ? String(r.output) : String(r ?? ""))(await nexus.execute({ action: "status" }));
51431
51452
  if (/Connected:\s*true/i.test(status)) {
51432
51453
  daemonReady = true;
51433
51454
  renderInfo("Nexus daemon ready.");
@@ -51442,7 +51463,7 @@ Clone a new voice: /voice clone <wav-file> [name]`);
51442
51463
  renderInfo("Waiting for nexus daemon to finish connecting...");
51443
51464
  for (let wait = 0; wait < 15; wait++) {
51444
51465
  await new Promise((r) => setTimeout(r, 1e3));
51445
- const s = String(await nexus.execute({ action: "status" }) ?? "");
51466
+ const s = ((r) => typeof r === "object" && r?.output ? String(r.output) : String(r ?? ""))(await nexus.execute({ action: "status" }));
51446
51467
  if (/Connected:\s*true/i.test(s)) {
51447
51468
  daemonReady = true;
51448
51469
  break;
@@ -51477,21 +51498,29 @@ Clone a new voice: /voice clone <wav-file> [name]`);
51477
51498
  const allModels = enabledEps.flatMap((e) => e.models || []);
51478
51499
  const sponsorUrl = tunnelGw?.tunnelUrl || "";
51479
51500
  let sponsorPeerId = tunnelGw?.peerId || "";
51501
+ _spLog(`tunnelUrl: ${sponsorUrl || "(none)"}`);
51502
+ _spLog(`gateway peerId: ${sponsorPeerId || "(none)"}`);
51480
51503
  if (!sponsorPeerId) {
51481
51504
  try {
51482
51505
  const nexus = new NexusTool(projectDir);
51483
- let st = String(await nexus.execute({ action: "status" }) ?? "");
51506
+ let st = ((r) => typeof r === "object" && r?.output ? String(r.output) : String(r ?? ""))(await nexus.execute({ action: "status" }));
51507
+ _spLog(`peerId lookup \u2014 status: ${st.slice(0, 200)}`);
51484
51508
  let pm = st.match(/Peer ID:\s*(12D3KooW\S+)/i);
51485
51509
  if (pm) {
51486
51510
  sponsorPeerId = pm[1];
51511
+ _spLog(`peerId found on first check: ${sponsorPeerId}`);
51487
51512
  } else {
51513
+ _spLog("peerId not found \u2014 polling for up to 30s...");
51488
51514
  renderInfo("Waiting for nexus daemon to connect (up to 30s)...");
51489
51515
  for (let i = 0; i < 30; i++) {
51490
51516
  await new Promise((r) => setTimeout(r, 1e3));
51491
- st = String(await nexus.execute({ action: "status" }) ?? "");
51517
+ st = ((r) => typeof r === "object" && r?.output ? String(r.output) : String(r ?? ""))(await nexus.execute({ action: "status" }));
51492
51518
  pm = st.match(/Peer ID:\s*(12D3KooW\S+)/i);
51519
+ if (i % 5 === 4)
51520
+ _spLog(` poll ${i + 1}/30 \u2014 connected: ${/Connected:\s*true/i.test(st)}`);
51493
51521
  if (pm) {
51494
51522
  sponsorPeerId = pm[1];
51523
+ _spLog(`peerId found after ${i + 1}s: ${sponsorPeerId}`);
51495
51524
  renderInfo("Nexus daemon connected.");
51496
51525
  break;
51497
51526
  }
@@ -51501,10 +51530,28 @@ Clone a new voice: /voice clone <wav-file> [name]`);
51501
51530
  }
51502
51531
  }
51503
51532
  if (!sponsorUrl && !sponsorPeerId) {
51533
+ _spLog("FAILED \u2014 no tunnelUrl and no peerId");
51534
+ _spLog(`nexusDir checked: ${join60(projectDir, ".oa", "nexus")}`);
51535
+ _spLog(`status.json exists: ${existsSync44(join60(projectDir, ".oa", "nexus", "status.json"))}`);
51536
+ _spLog(`daemon.pid exists: ${existsSync44(join60(projectDir, ".oa", "nexus", "daemon.pid"))}`);
51537
+ try {
51538
+ const _statusRaw = readFileSync33(join60(projectDir, ".oa", "nexus", "status.json"), "utf8");
51539
+ _spLog(`status.json content: ${_statusRaw.slice(0, 300)}`);
51540
+ } catch (e) {
51541
+ _spLog(`status.json read error: ${e}`);
51542
+ }
51543
+ try {
51544
+ const _errRaw = readFileSync33(join60(projectDir, ".oa", "nexus", "daemon.err"), "utf8");
51545
+ _spLog(`daemon.err (last 500): ${_errRaw.slice(-500)}`);
51546
+ } catch (e) {
51547
+ _spLog(`daemon.err read error: ${e}`);
51548
+ }
51504
51549
  renderWarning("No tunnel and no nexus connection \u2014 sponsor not registered.");
51550
+ renderInfo(`Verbose log: ${_spLogFile}`);
51505
51551
  renderInfo("Connect nexus first (/nexus) or start a tunnel (/expose tunnel).");
51506
51552
  return false;
51507
51553
  }
51554
+ _spLog(`SUCCESS \u2014 sponsorUrl: ${sponsorUrl || "(P2P)"}, peerId: ${sponsorPeerId}`);
51508
51555
  if (!sponsorUrl) {
51509
51556
  renderInfo(`P2P-only sponsor (peerId: ${sponsorPeerId.slice(0, 20)}...)`);
51510
51557
  }
@@ -51548,6 +51595,7 @@ Clone a new voice: /voice clone <wav-file> [name]`);
51548
51595
  });
51549
51596
  const kvResult = await kvResp.json();
51550
51597
  if (kvResult.persisted) {
51598
+ _spLog("KV registration: persisted");
51551
51599
  renderInfo("Registered in sponsor directory \u2014 consumers can discover you via /endpoint sponsor");
51552
51600
  startSponsorHeartbeat(sponsorPayload, ctx.getExposeGateway);
51553
51601
  renderInfo("Heartbeat active \u2014 re-registering every 5 min");
@@ -51559,7 +51607,7 @@ Clone a new voice: /voice clone <wav-file> [name]`);
51559
51607
  }
51560
51608
  try {
51561
51609
  const nexus = new NexusTool(projectDir);
51562
- const statusCheck = String(await nexus.execute({ action: "status" }) ?? "");
51610
+ const statusCheck = ((r) => typeof r === "object" && r?.output ? String(r.output) : String(r ?? ""))(await nexus.execute({ action: "status" }));
51563
51611
  if (/Connected:\s*true/i.test(statusCheck)) {
51564
51612
  await nexus.execute({
51565
51613
  action: "sponsor_announce",
@@ -53424,7 +53472,7 @@ async function handleSponsoredEndpoint(ctx, local) {
53424
53472
  }
53425
53473
  if (nexusTool) {
53426
53474
  try {
53427
- const statusResult = String(await nexusTool.execute({ action: "status" }) ?? "");
53475
+ const statusResult = ((r) => typeof r === "object" && r?.output ? String(r.output) : String(r ?? ""))(await nexusTool.execute({ action: "status" }));
53428
53476
  const isConnected = /Connected:\s*true/i.test(statusResult) || statusResult.includes("Daemon running");
53429
53477
  if (isConnected) {
53430
53478
  renderInfo("Using existing nexus connection...");
@@ -57677,7 +57725,7 @@ var init_stream_renderer = __esm({
57677
57725
  });
57678
57726
 
57679
57727
  // packages/cli/dist/tui/edit-history.js
57680
- import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync23 } from "node:fs";
57728
+ import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync23 } from "node:fs";
57681
57729
  import { join as join64 } from "node:path";
57682
57730
  function createEditHistoryLogger(repoRoot, sessionId) {
57683
57731
  const historyDir = join64(repoRoot, ".oa", "history");
@@ -57699,7 +57747,7 @@ function createEditHistoryLogger(repoRoot, sessionId) {
57699
57747
  args: sanitizeArgs(toolName, toolArgs)
57700
57748
  };
57701
57749
  try {
57702
- appendFileSync3(logPath2, JSON.stringify(entry) + "\n", "utf-8");
57750
+ appendFileSync4(logPath2, JSON.stringify(entry) + "\n", "utf-8");
57703
57751
  } catch {
57704
57752
  }
57705
57753
  }
@@ -66182,7 +66230,7 @@ var init_direct_input = __esm({
66182
66230
  });
66183
66231
 
66184
66232
  // packages/cli/dist/api/audit-log.js
66185
- import { mkdirSync as mkdirSync27, appendFileSync as appendFileSync4, readFileSync as readFileSync42, existsSync as existsSync53 } from "node:fs";
66233
+ import { mkdirSync as mkdirSync27, appendFileSync as appendFileSync5, readFileSync as readFileSync42, existsSync as existsSync53 } from "node:fs";
66186
66234
  import { join as join70 } from "node:path";
66187
66235
  function initAuditLog(oaDir) {
66188
66236
  auditDir = join70(oaDir, "audit");
@@ -66198,7 +66246,7 @@ function recordAudit(record) {
66198
66246
  return;
66199
66247
  try {
66200
66248
  const line = JSON.stringify(record) + "\n";
66201
- appendFileSync4(auditFile, line, "utf-8");
66249
+ appendFileSync5(auditFile, line, "utf-8");
66202
66250
  } catch {
66203
66251
  }
66204
66252
  }
@@ -69772,7 +69820,7 @@ import { cwd } from "node:process";
69772
69820
  import { resolve as resolve32, join as join75, dirname as dirname22, extname as extname11 } from "node:path";
69773
69821
  import { createRequire as createRequire4 } from "node:module";
69774
69822
  import { fileURLToPath as fileURLToPath14 } from "node:url";
69775
- import { readFileSync as readFileSync47, writeFileSync as writeFileSync29, appendFileSync as appendFileSync5, rmSync as rmSync3, readdirSync as readdirSync23, mkdirSync as mkdirSync31 } from "node:fs";
69823
+ import { readFileSync as readFileSync47, writeFileSync as writeFileSync29, appendFileSync as appendFileSync6, rmSync as rmSync3, readdirSync as readdirSync23, mkdirSync as mkdirSync31 } from "node:fs";
69776
69824
  import { existsSync as existsSync58 } from "node:fs";
69777
69825
  import { execSync as execSync35 } from "node:child_process";
69778
69826
  import { homedir as homedir20 } from "node:os";
@@ -71852,7 +71900,7 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
71852
71900
  return;
71853
71901
  try {
71854
71902
  mkdirSync31(HISTORY_DIR, { recursive: true });
71855
- appendFileSync5(HISTORY_FILE, line + "\n", "utf8");
71903
+ appendFileSync6(HISTORY_FILE, line + "\n", "utf8");
71856
71904
  if (Math.random() < 0.02) {
71857
71905
  const all = readFileSync47(HISTORY_FILE, "utf8").trim().split("\n");
71858
71906
  if (all.length > MAX_HISTORY_LINES) {
@@ -76332,12 +76380,12 @@ function crashLog(label, err) {
76332
76380
  const logLine = `[${timestamp}] ${label}: ${msg}
76333
76381
  `;
76334
76382
  try {
76335
- const { appendFileSync: appendFileSync6, mkdirSync: mkdirSync34 } = __require("node:fs");
76383
+ const { appendFileSync: appendFileSync7, mkdirSync: mkdirSync34 } = __require("node:fs");
76336
76384
  const { join: join81 } = __require("node:path");
76337
76385
  const { homedir: homedir22 } = __require("node:os");
76338
76386
  const logDir = join81(homedir22(), ".open-agents");
76339
76387
  mkdirSync34(logDir, { recursive: true });
76340
- appendFileSync6(join81(logDir, "crash.log"), logLine);
76388
+ appendFileSync7(join81(logDir, "crash.log"), logLine);
76341
76389
  } catch {
76342
76390
  }
76343
76391
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.186.32",
3
+ "version": "0.186.34",
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",