open-agents-ai 0.185.5 → 0.185.7
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 +51 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -66052,6 +66052,19 @@ async function startInteractive(config, repoPath) {
|
|
|
66052
66052
|
const isResumed = resumeFlag !== "";
|
|
66053
66053
|
const hasTaskToResume = resumeFlag === "1";
|
|
66054
66054
|
delete process.env.__OA_RESUMED;
|
|
66055
|
+
if (isResumed && process.stdout.isTTY) {
|
|
66056
|
+
process.stdout.write("\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?1015l\x1B[r\x1B[?25h\x1B[0m");
|
|
66057
|
+
if (process.stdin.isTTY && typeof process.stdin.setRawMode === "function") {
|
|
66058
|
+
try {
|
|
66059
|
+
process.stdin.setRawMode(false);
|
|
66060
|
+
} catch {
|
|
66061
|
+
}
|
|
66062
|
+
}
|
|
66063
|
+
process.stdin.resume();
|
|
66064
|
+
process.stdin.read();
|
|
66065
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
66066
|
+
process.stdin.pause();
|
|
66067
|
+
}
|
|
66055
66068
|
initOaDirectory(repoRoot);
|
|
66056
66069
|
const savedSettings = resolveSettings(repoRoot);
|
|
66057
66070
|
let restoredSessionContext = null;
|
|
@@ -68360,38 +68373,52 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
68360
68373
|
renderInfo(`Previous session found (${savedCtx.entries.length} entries, last active ${timeAgo})`);
|
|
68361
68374
|
renderInfo(`Last task: ${lastTask}${lastEntry.task && lastEntry.task.length > 80 ? "..." : ""}`);
|
|
68362
68375
|
});
|
|
68363
|
-
|
|
68364
|
-
|
|
68365
|
-
const
|
|
68366
|
-
|
|
68367
|
-
|
|
68368
|
-
|
|
68369
|
-
|
|
68370
|
-
|
|
68371
|
-
|
|
68372
|
-
|
|
68373
|
-
|
|
68376
|
+
let countdown = 10;
|
|
68377
|
+
let resolved = false;
|
|
68378
|
+
const result = await new Promise((resolve36) => {
|
|
68379
|
+
const countdownTimer = setInterval(() => {
|
|
68380
|
+
if (resolved)
|
|
68381
|
+
return;
|
|
68382
|
+
countdown--;
|
|
68383
|
+
if (countdown <= 0) {
|
|
68384
|
+
resolved = true;
|
|
68385
|
+
clearInterval(countdownTimer);
|
|
68386
|
+
resolve36("restore");
|
|
68387
|
+
return;
|
|
68388
|
+
}
|
|
68389
|
+
writeContent(() => renderInfo(`Auto-restoring in ${countdown}s... (Enter = restore now, Esc = start fresh)`));
|
|
68390
|
+
}, 1e3);
|
|
68391
|
+
writeContent(() => renderInfo(`Auto-restoring in ${countdown}s... (Enter = restore now, Esc = start fresh)`));
|
|
68392
|
+
const onLine = () => {
|
|
68393
|
+
if (resolved)
|
|
68394
|
+
return;
|
|
68395
|
+
resolved = true;
|
|
68396
|
+
clearInterval(countdownTimer);
|
|
68397
|
+
rl.removeListener("line", onLine);
|
|
68398
|
+
rl.removeListener("escape", onEscape);
|
|
68399
|
+
resolve36("restore");
|
|
68400
|
+
};
|
|
68401
|
+
const onEscape = () => {
|
|
68402
|
+
if (resolved)
|
|
68403
|
+
return;
|
|
68404
|
+
resolved = true;
|
|
68405
|
+
clearInterval(countdownTimer);
|
|
68406
|
+
rl.removeListener("line", onLine);
|
|
68407
|
+
rl.removeListener("escape", onEscape);
|
|
68408
|
+
resolve36("fresh");
|
|
68409
|
+
};
|
|
68410
|
+
rl.on("line", onLine);
|
|
68411
|
+
rl.on("escape", onEscape);
|
|
68374
68412
|
});
|
|
68375
|
-
|
|
68376
|
-
const timedOut = result.timedOut === true;
|
|
68377
|
-
if (timedOut) {
|
|
68378
|
-
try {
|
|
68379
|
-
rl.feed("\x1B");
|
|
68380
|
-
} catch {
|
|
68381
|
-
}
|
|
68382
|
-
await new Promise((r) => setTimeout(r, 100));
|
|
68383
|
-
}
|
|
68384
|
-
if (result.confirmed && result.key === "restore") {
|
|
68413
|
+
if (result === "restore") {
|
|
68385
68414
|
const prompt = buildContextRestorePrompt(repoRoot);
|
|
68386
68415
|
if (prompt) {
|
|
68387
68416
|
restoredSessionContext = prompt;
|
|
68388
68417
|
const info = loadSessionContext(repoRoot);
|
|
68389
|
-
writeContent(() => renderInfo(
|
|
68418
|
+
writeContent(() => renderInfo(countdown <= 0 ? `Context auto-restored from ${info?.entries.length ?? 0} session(s).` : `Context restored from ${info?.entries.length ?? 0} session(s).`));
|
|
68390
68419
|
} else {
|
|
68391
68420
|
writeContent(() => renderInfo("No context to restore. Starting fresh."));
|
|
68392
68421
|
}
|
|
68393
|
-
} else if (result.confirmed && result.key === "fresh") {
|
|
68394
|
-
writeContent(() => renderInfo("Starting fresh."));
|
|
68395
68422
|
} else {
|
|
68396
68423
|
writeContent(() => renderInfo("Starting fresh."));
|
|
68397
68424
|
}
|
package/package.json
CHANGED