open-agents-ai 0.184.84 → 0.184.86
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 +33 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51500,12 +51500,12 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
51500
51500
|
await new Promise((r) => setTimeout(r, 200));
|
|
51501
51501
|
const { execPath, argv } = process;
|
|
51502
51502
|
try {
|
|
51503
|
-
const {
|
|
51503
|
+
const { execFileSync } = await import("node:child_process");
|
|
51504
51504
|
if (ctx.hasActiveTask?.())
|
|
51505
51505
|
ctx.abortActiveTask?.();
|
|
51506
|
-
ctx.
|
|
51506
|
+
ctx.clearScreen();
|
|
51507
51507
|
if (process.stdout.isTTY) {
|
|
51508
|
-
process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[r\x1B[?25h\x1B[?1049l\x1B[0m");
|
|
51508
|
+
process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[r\x1B[?25h\x1B[?1049l\x1B[2J\x1B[H\x1B[0m");
|
|
51509
51509
|
}
|
|
51510
51510
|
if (process.stdin.isTTY && typeof process.stdin.setRawMode === "function") {
|
|
51511
51511
|
process.stdin.setRawMode(false);
|
|
@@ -51515,17 +51515,14 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
51515
51515
|
process.removeAllListeners("SIGINT");
|
|
51516
51516
|
process.removeAllListeners("SIGTERM");
|
|
51517
51517
|
process.removeAllListeners("exit");
|
|
51518
|
-
|
|
51519
|
-
|
|
51520
|
-
|
|
51521
|
-
|
|
51522
|
-
|
|
51523
|
-
|
|
51524
|
-
|
|
51525
|
-
|
|
51526
|
-
child.on("error", () => {
|
|
51527
|
-
process.exit(1);
|
|
51528
|
-
});
|
|
51518
|
+
try {
|
|
51519
|
+
execFileSync(execPath, argv.slice(1), {
|
|
51520
|
+
stdio: "inherit",
|
|
51521
|
+
env: { ...process.env, __OA_RESUMED: resumeFlag }
|
|
51522
|
+
});
|
|
51523
|
+
} catch {
|
|
51524
|
+
}
|
|
51525
|
+
process.exit(0);
|
|
51529
51526
|
} catch {
|
|
51530
51527
|
process.stderr.write("\x1B[0m\nRestart oa manually to use the new version.\n");
|
|
51531
51528
|
process.exit(1);
|
|
@@ -65422,6 +65419,7 @@ async function startInteractive(config, repoPath) {
|
|
|
65422
65419
|
delete process.env.__OA_RESUMED;
|
|
65423
65420
|
initOaDirectory(repoRoot);
|
|
65424
65421
|
const savedSettings = resolveSettings(repoRoot);
|
|
65422
|
+
let restoredSessionContext = null;
|
|
65425
65423
|
if (process.stdout.isTTY) {
|
|
65426
65424
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
65427
65425
|
process.stdout.write("\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[?1049h\x1B[48;5;233m\x1B[2J\x1B[3J\x1B[H\x1B[?25l");
|
|
@@ -65561,6 +65559,12 @@ Review its full output in the [${id}] tab or via full_sub_agent(action='output',
|
|
|
65561
65559
|
const taskSummary = hasTaskToResume ? getLastTaskSummary2(repoRoot) : null;
|
|
65562
65560
|
const resumeMsg = taskSummary ? `v${version} \u2014 picking up: ${taskSummary}` : `Updated to v${version}.`;
|
|
65563
65561
|
renderInfo(resumeMsg);
|
|
65562
|
+
const resumePrompt = buildContextRestorePrompt(repoRoot);
|
|
65563
|
+
if (resumePrompt) {
|
|
65564
|
+
restoredSessionContext = resumePrompt;
|
|
65565
|
+
const info = loadSessionContext(repoRoot);
|
|
65566
|
+
renderInfo(`Context restored from ${info?.entries.length ?? 0} session(s).`);
|
|
65567
|
+
}
|
|
65564
65568
|
statusBar.endContentWrite();
|
|
65565
65569
|
}
|
|
65566
65570
|
setContentWriteHook({
|
|
@@ -65839,7 +65843,6 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
65839
65843
|
let _recallText = null;
|
|
65840
65844
|
let _recallTimer = null;
|
|
65841
65845
|
const RECALL_WINDOW_MS = 1500;
|
|
65842
|
-
let restoredSessionContext = null;
|
|
65843
65846
|
let sessionSudoPassword = null;
|
|
65844
65847
|
let sudoPromptPending = false;
|
|
65845
65848
|
const panelBg = "\x1B[48;5;234m";
|
|
@@ -67675,27 +67678,33 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
67675
67678
|
renderInfo(`Previous session found (${savedCtx.entries.length} entries, last active ${timeAgo})`);
|
|
67676
67679
|
renderInfo(`Last task: ${lastTask}${lastEntry.task && lastEntry.task.length > 80 ? "..." : ""}`);
|
|
67677
67680
|
});
|
|
67678
|
-
|
|
67679
|
-
|
|
67680
|
-
|
|
67681
|
-
const result = await tuiSelect({
|
|
67681
|
+
const AUTO_RESTORE_MS = 1e4;
|
|
67682
|
+
const autoRestore = new Promise((r) => setTimeout(() => r({ confirmed: true, key: "restore", index: 0, timedOut: true }), AUTO_RESTORE_MS));
|
|
67683
|
+
const selectPromise = tuiSelect({
|
|
67682
67684
|
items: [
|
|
67683
67685
|
{ key: "restore", label: "Restore previous context" },
|
|
67684
67686
|
{ key: "fresh", label: "Start fresh" }
|
|
67685
67687
|
],
|
|
67686
67688
|
activeKey: "restore",
|
|
67687
|
-
title:
|
|
67689
|
+
title: `Restore previous session context? (auto-restore in 10s)`,
|
|
67688
67690
|
rl,
|
|
67689
67691
|
availableRows: statusBar.isActive ? statusBar.availableContentRows : void 0
|
|
67690
67692
|
});
|
|
67691
|
-
|
|
67692
|
-
|
|
67693
|
-
if (
|
|
67693
|
+
const result = await Promise.race([selectPromise, autoRestore]);
|
|
67694
|
+
const timedOut = result.timedOut === true;
|
|
67695
|
+
if (timedOut) {
|
|
67696
|
+
try {
|
|
67697
|
+
rl.write?.("\x1B");
|
|
67698
|
+
} catch {
|
|
67699
|
+
}
|
|
67700
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
67701
|
+
}
|
|
67702
|
+
if (result.confirmed && result.key === "restore") {
|
|
67694
67703
|
const prompt = buildContextRestorePrompt(repoRoot);
|
|
67695
67704
|
if (prompt) {
|
|
67696
67705
|
restoredSessionContext = prompt;
|
|
67697
67706
|
const info = loadSessionContext(repoRoot);
|
|
67698
|
-
writeContent(() => renderInfo(`Context restored from ${info?.entries.length ?? 0} session(s).`));
|
|
67707
|
+
writeContent(() => renderInfo(timedOut ? `Context auto-restored from ${info?.entries.length ?? 0} session(s).` : `Context restored from ${info?.entries.length ?? 0} session(s).`));
|
|
67699
67708
|
} else {
|
|
67700
67709
|
writeContent(() => renderInfo("No context to restore. Starting fresh."));
|
|
67701
67710
|
}
|
package/package.json
CHANGED