open-agents-ai 0.185.8 → 0.185.10

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 +51 -25
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -50646,7 +50646,12 @@ async function handleSponsoredEndpoint(ctx, local) {
50646
50646
  tpd: ns.limits?.maxTokensPerDay || 1e5
50647
50647
  },
50648
50648
  source: "nexus",
50649
- banner: { preset: ns.banner?.preset, message: ns.message }
50649
+ banner: ns.banner ? {
50650
+ preset: typeof ns.banner === "string" ? ns.banner : ns.banner?.preset,
50651
+ message: ns.message,
50652
+ linkUrl: ns.linkUrl ?? ns.link_url,
50653
+ linkText: ns.linkText ?? ns.link_text
50654
+ } : void 0
50650
50655
  });
50651
50656
  }
50652
50657
  if (nexusSponsors.length > 0) {
@@ -50698,7 +50703,13 @@ async function handleSponsoredEndpoint(ctx, local) {
50698
50703
  tpd: ks.limits?.maxTokensPerDay || 1e5
50699
50704
  },
50700
50705
  source: "nexus",
50701
- banner: ks.banner ? { preset: ks.banner?.preset, message: ks.message } : void 0
50706
+ // KV data has banner as a string (preset name), message/linkUrl/linkText at top level
50707
+ banner: ks.banner ? {
50708
+ preset: typeof ks.banner === "string" ? ks.banner : ks.banner?.preset,
50709
+ message: ks.message,
50710
+ linkUrl: ks.linkUrl ?? ks.link_url,
50711
+ linkText: ks.linkText ?? ks.link_text
50712
+ } : void 0
50702
50713
  });
50703
50714
  kvAdded++;
50704
50715
  }
@@ -51498,34 +51509,49 @@ async function handleUpdate(subcommand, ctx) {
51498
51509
  await new Promise((r) => setTimeout(r, 1500));
51499
51510
  installOverlay.dismiss();
51500
51511
  await new Promise((r) => setTimeout(r, 200));
51501
- const { execPath, argv } = process;
51502
51512
  try {
51503
- const { execFileSync } = await import("node:child_process");
51504
- if (ctx.hasActiveTask?.())
51505
- ctx.abortActiveTask?.();
51506
- ctx.stopBanner?.();
51507
- ctx.deactivateStatusBar?.();
51508
- if (process.stdout.isTTY) {
51509
- process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[r\x1B[?25h\x1B[?1049l\x1B[2J\x1B[H\x1B[0m");
51510
- }
51511
- if (process.stdin.isTTY && typeof process.stdin.setRawMode === "function") {
51512
- process.stdin.setRawMode(false);
51513
- }
51514
- process.stdin.pause();
51515
- process.stdin.removeAllListeners();
51516
- process.removeAllListeners("SIGINT");
51517
- process.removeAllListeners("SIGTERM");
51518
- process.removeAllListeners("exit");
51513
+ const { writeFileSync: writeFileSync29, mkdirSync: mkdirSync30, chmodSync } = await import("node:fs");
51514
+ const { join: join76 } = await import("node:path");
51515
+ const { homedir: homedir20 } = await import("node:os");
51516
+ ctx.contextSave?.();
51517
+ const restartDir = join76(homedir20(), ".open-agents");
51518
+ mkdirSync30(restartDir, { recursive: true });
51519
+ const scriptPath2 = join76(restartDir, ".restart.sh");
51520
+ const oaBin = process.argv[1] ?? "oa";
51521
+ const script = [
51522
+ "#!/bin/sh",
51523
+ "# Auto-generated by /update \u2014 runs once then self-deletes",
51524
+ "sleep 0.3",
51525
+ // wait for parent to fully exit
51526
+ "clear",
51527
+ // clean terminal
51528
+ `__OA_RESUMED="${resumeFlag}" exec "${process.execPath}" "${oaBin}"`
51529
+ ].join("\n");
51530
+ writeFileSync29(scriptPath2, script, { mode: 493 });
51519
51531
  try {
51520
- execFileSync(execPath, argv.slice(1), {
51521
- stdio: "inherit",
51522
- env: { ...process.env, __OA_RESUMED: resumeFlag }
51523
- });
51532
+ chmodSync(scriptPath2, 493);
51524
51533
  } catch {
51525
51534
  }
51535
+ if (process.stdout.isTTY) {
51536
+ process.stdout.write("\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[r\x1B[?25h\x1B[?1049l\x1B[0m\x1B[2J\x1B[H\nRestarting oa...\n");
51537
+ }
51538
+ const { spawn: spawnChild } = await import("node:child_process");
51539
+ const child = spawnChild("sh", [scriptPath2], {
51540
+ stdio: "ignore",
51541
+ // no shared file descriptors
51542
+ detached: true,
51543
+ // new process group
51544
+ env: { ...process.env, __OA_RESUMED: resumeFlag }
51545
+ });
51546
+ child.unref();
51526
51547
  process.exit(0);
51527
- } catch {
51528
- process.stderr.write("\x1B[0m\nRestart oa manually to use the new version.\n");
51548
+ } catch (err) {
51549
+ if (process.stdout.isTTY) {
51550
+ process.stdout.write(`\x1B[?1002l\x1B[?1006l\x1B[?1049l\x1B[0m\x1B[2J\x1B[H
51551
+ Restart failed: ${err instanceof Error ? err.message : String(err)}
51552
+ Run manually: oa
51553
+ `);
51554
+ }
51529
51555
  process.exit(1);
51530
51556
  }
51531
51557
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.185.8",
3
+ "version": "0.185.10",
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",