open-agents-ai 0.185.7 → 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.
- package/dist/index.js +43 -25
- 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 {
|
|
51504
|
-
|
|
51505
|
-
|
|
51506
|
-
ctx.
|
|
51507
|
-
|
|
51508
|
-
|
|
51509
|
-
|
|
51510
|
-
|
|
51511
|
-
|
|
51512
|
-
|
|
51513
|
-
|
|
51514
|
-
|
|
51515
|
-
|
|
51516
|
-
|
|
51517
|
-
|
|
51518
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
}
|
|
@@ -62135,9 +62150,12 @@ ${CONTENT_BG_SEQ}`);
|
|
|
62135
62150
|
} else {
|
|
62136
62151
|
const absD = Math.abs(heightDelta);
|
|
62137
62152
|
this.termWrite(`\x1B[${this.scrollRegionTop};${pos.scrollEnd}r`);
|
|
62138
|
-
|
|
62153
|
+
let scrollDown = `\x1B[${this.scrollRegionTop};1H`;
|
|
62154
|
+
for (let i = 0; i < absD; i++)
|
|
62155
|
+
scrollDown += "\x1BM";
|
|
62156
|
+
this.termWrite(scrollDown);
|
|
62139
62157
|
let repaint = "";
|
|
62140
|
-
for (let r =
|
|
62158
|
+
for (let r = this.scrollRegionTop; r < this.scrollRegionTop + absD; r++) {
|
|
62141
62159
|
repaint += `\x1B[${r};1H${CONTENT_BG_SEQ}\x1B[2K`;
|
|
62142
62160
|
}
|
|
62143
62161
|
if (repaint)
|
package/package.json
CHANGED