open-agents-ai 0.185.5 → 0.185.6
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 +38 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68360,38 +68360,52 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
68360
68360
|
renderInfo(`Previous session found (${savedCtx.entries.length} entries, last active ${timeAgo})`);
|
|
68361
68361
|
renderInfo(`Last task: ${lastTask}${lastEntry.task && lastEntry.task.length > 80 ? "..." : ""}`);
|
|
68362
68362
|
});
|
|
68363
|
-
|
|
68364
|
-
|
|
68365
|
-
const
|
|
68366
|
-
|
|
68367
|
-
|
|
68368
|
-
|
|
68369
|
-
|
|
68370
|
-
|
|
68371
|
-
|
|
68372
|
-
|
|
68373
|
-
|
|
68363
|
+
let countdown = 10;
|
|
68364
|
+
let resolved = false;
|
|
68365
|
+
const result = await new Promise((resolve36) => {
|
|
68366
|
+
const countdownTimer = setInterval(() => {
|
|
68367
|
+
if (resolved)
|
|
68368
|
+
return;
|
|
68369
|
+
countdown--;
|
|
68370
|
+
if (countdown <= 0) {
|
|
68371
|
+
resolved = true;
|
|
68372
|
+
clearInterval(countdownTimer);
|
|
68373
|
+
resolve36("restore");
|
|
68374
|
+
return;
|
|
68375
|
+
}
|
|
68376
|
+
writeContent(() => renderInfo(`Auto-restoring in ${countdown}s... (Enter = restore now, Esc = start fresh)`));
|
|
68377
|
+
}, 1e3);
|
|
68378
|
+
writeContent(() => renderInfo(`Auto-restoring in ${countdown}s... (Enter = restore now, Esc = start fresh)`));
|
|
68379
|
+
const onLine = () => {
|
|
68380
|
+
if (resolved)
|
|
68381
|
+
return;
|
|
68382
|
+
resolved = true;
|
|
68383
|
+
clearInterval(countdownTimer);
|
|
68384
|
+
rl.removeListener("line", onLine);
|
|
68385
|
+
rl.removeListener("escape", onEscape);
|
|
68386
|
+
resolve36("restore");
|
|
68387
|
+
};
|
|
68388
|
+
const onEscape = () => {
|
|
68389
|
+
if (resolved)
|
|
68390
|
+
return;
|
|
68391
|
+
resolved = true;
|
|
68392
|
+
clearInterval(countdownTimer);
|
|
68393
|
+
rl.removeListener("line", onLine);
|
|
68394
|
+
rl.removeListener("escape", onEscape);
|
|
68395
|
+
resolve36("fresh");
|
|
68396
|
+
};
|
|
68397
|
+
rl.on("line", onLine);
|
|
68398
|
+
rl.on("escape", onEscape);
|
|
68374
68399
|
});
|
|
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") {
|
|
68400
|
+
if (result === "restore") {
|
|
68385
68401
|
const prompt = buildContextRestorePrompt(repoRoot);
|
|
68386
68402
|
if (prompt) {
|
|
68387
68403
|
restoredSessionContext = prompt;
|
|
68388
68404
|
const info = loadSessionContext(repoRoot);
|
|
68389
|
-
writeContent(() => renderInfo(
|
|
68405
|
+
writeContent(() => renderInfo(countdown <= 0 ? `Context auto-restored from ${info?.entries.length ?? 0} session(s).` : `Context restored from ${info?.entries.length ?? 0} session(s).`));
|
|
68390
68406
|
} else {
|
|
68391
68407
|
writeContent(() => renderInfo("No context to restore. Starting fresh."));
|
|
68392
68408
|
}
|
|
68393
|
-
} else if (result.confirmed && result.key === "fresh") {
|
|
68394
|
-
writeContent(() => renderInfo("Starting fresh."));
|
|
68395
68409
|
} else {
|
|
68396
68410
|
writeContent(() => renderInfo("Starting fresh."));
|
|
68397
68411
|
}
|
package/package.json
CHANGED