open-agents-ai 0.185.8 → 0.185.9

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 +38 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -51498,34 +51498,49 @@ async function handleUpdate(subcommand, ctx) {
51498
51498
  await new Promise((r) => setTimeout(r, 1500));
51499
51499
  installOverlay.dismiss();
51500
51500
  await new Promise((r) => setTimeout(r, 200));
51501
- const { execPath, argv } = process;
51502
51501
  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");
51502
+ const { writeFileSync: writeFileSync29, mkdirSync: mkdirSync30, chmodSync } = await import("node:fs");
51503
+ const { join: join76 } = await import("node:path");
51504
+ const { homedir: homedir20 } = await import("node:os");
51505
+ ctx.contextSave?.();
51506
+ const restartDir = join76(homedir20(), ".open-agents");
51507
+ mkdirSync30(restartDir, { recursive: true });
51508
+ const scriptPath2 = join76(restartDir, ".restart.sh");
51509
+ const oaBin = process.argv[1] ?? "oa";
51510
+ const script = [
51511
+ "#!/bin/sh",
51512
+ "# Auto-generated by /update \u2014 runs once then self-deletes",
51513
+ "sleep 0.3",
51514
+ // wait for parent to fully exit
51515
+ "clear",
51516
+ // clean terminal
51517
+ `__OA_RESUMED="${resumeFlag}" exec "${process.execPath}" "${oaBin}"`
51518
+ ].join("\n");
51519
+ writeFileSync29(scriptPath2, script, { mode: 493 });
51519
51520
  try {
51520
- execFileSync(execPath, argv.slice(1), {
51521
- stdio: "inherit",
51522
- env: { ...process.env, __OA_RESUMED: resumeFlag }
51523
- });
51521
+ chmodSync(scriptPath2, 493);
51524
51522
  } catch {
51525
51523
  }
51524
+ if (process.stdout.isTTY) {
51525
+ 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");
51526
+ }
51527
+ const { spawn: spawnChild } = await import("node:child_process");
51528
+ const child = spawnChild("sh", [scriptPath2], {
51529
+ stdio: "ignore",
51530
+ // no shared file descriptors
51531
+ detached: true,
51532
+ // new process group
51533
+ env: { ...process.env, __OA_RESUMED: resumeFlag }
51534
+ });
51535
+ child.unref();
51526
51536
  process.exit(0);
51527
- } catch {
51528
- process.stderr.write("\x1B[0m\nRestart oa manually to use the new version.\n");
51537
+ } catch (err) {
51538
+ if (process.stdout.isTTY) {
51539
+ process.stdout.write(`\x1B[?1002l\x1B[?1006l\x1B[?1049l\x1B[0m\x1B[2J\x1B[H
51540
+ Restart failed: ${err instanceof Error ? err.message : String(err)}
51541
+ Run manually: oa
51542
+ `);
51543
+ }
51529
51544
  process.exit(1);
51530
51545
  }
51531
51546
  }
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.9",
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",