open-agents-ai 0.185.12 → 0.185.14
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 +66 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -50747,6 +50747,36 @@ async function handleSponsoredEndpoint(ctx, local) {
|
|
|
50747
50747
|
}
|
|
50748
50748
|
sponsors.length = 0;
|
|
50749
50749
|
sponsors.push(...deduped);
|
|
50750
|
+
if (sponsors.length > 0) {
|
|
50751
|
+
process.stdout.write(` ${c2.dim("Verifying " + sponsors.length + " sponsor(s)...")}
|
|
50752
|
+
`);
|
|
50753
|
+
const probeResults = await Promise.all(sponsors.map(async (sp) => {
|
|
50754
|
+
if (!sp.url)
|
|
50755
|
+
return true;
|
|
50756
|
+
try {
|
|
50757
|
+
const base = normalizeBaseUrl(sp.url);
|
|
50758
|
+
const headers = {};
|
|
50759
|
+
if (sp.authKey)
|
|
50760
|
+
headers["Authorization"] = `Bearer ${sp.authKey}`;
|
|
50761
|
+
const resp = await fetch(`${base}/v1/models`, { headers, signal: AbortSignal.timeout(5e3) });
|
|
50762
|
+
if (!resp.ok && sp.authKey) {
|
|
50763
|
+
const noAuth = await fetch(`${base}/v1/models`, { signal: AbortSignal.timeout(3e3) });
|
|
50764
|
+
return noAuth.ok;
|
|
50765
|
+
}
|
|
50766
|
+
return resp.ok;
|
|
50767
|
+
} catch {
|
|
50768
|
+
return false;
|
|
50769
|
+
}
|
|
50770
|
+
}));
|
|
50771
|
+
const staleCount = probeResults.filter((ok) => !ok).length;
|
|
50772
|
+
const verified = sponsors.filter((_, i) => probeResults[i]);
|
|
50773
|
+
if (staleCount > 0) {
|
|
50774
|
+
process.stdout.write(` ${c2.dim(staleCount + " stale sponsor(s) hidden (unreachable)")}
|
|
50775
|
+
`);
|
|
50776
|
+
}
|
|
50777
|
+
sponsors.length = 0;
|
|
50778
|
+
sponsors.push(...verified);
|
|
50779
|
+
}
|
|
50750
50780
|
process.stdout.write("\n");
|
|
50751
50781
|
if (sponsors.length === 0) {
|
|
50752
50782
|
renderInfo("No sponsored endpoints found on the nexus mesh.");
|
|
@@ -51523,10 +51553,17 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
51523
51553
|
const script = [
|
|
51524
51554
|
"#!/bin/sh",
|
|
51525
51555
|
"# Auto-generated by /update \u2014 runs once then self-deletes",
|
|
51526
|
-
"sleep
|
|
51527
|
-
// wait for parent to
|
|
51556
|
+
"sleep 1",
|
|
51557
|
+
// wait for parent to FULLY exit (0.3 was too short)
|
|
51558
|
+
// Aggressively reset terminal — disable ALL mouse modes, reset attributes,
|
|
51559
|
+
// clear screen. This runs BEFORE oa starts so mouse sequences from the
|
|
51560
|
+
// dead parent's terminal state are flushed.
|
|
51561
|
+
"printf '\\033[?1000l\\033[?1002l\\033[?1003l\\033[?1006l\\033[?1015l'",
|
|
51562
|
+
"printf '\\033[0m\\033[r\\033[?25h'",
|
|
51563
|
+
// reset attrs, scroll region, show cursor
|
|
51564
|
+
"stty sane 2>/dev/null",
|
|
51565
|
+
// reset terminal line discipline
|
|
51528
51566
|
"clear",
|
|
51529
|
-
// clean terminal
|
|
51530
51567
|
`__OA_RESUMED="${resumeFlag}" exec "${process.execPath}" "${oaBin}"`
|
|
51531
51568
|
].join("\n");
|
|
51532
51569
|
writeFileSync29(scriptPath2, script, { mode: 493 });
|
|
@@ -68476,43 +68513,34 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
68476
68513
|
renderInfo(`Last task: ${lastTask}${lastEntry.task && lastEntry.task.length > 80 ? "..." : ""}`);
|
|
68477
68514
|
});
|
|
68478
68515
|
let countdown = 10;
|
|
68479
|
-
let
|
|
68480
|
-
const
|
|
68481
|
-
|
|
68482
|
-
|
|
68483
|
-
|
|
68484
|
-
|
|
68485
|
-
|
|
68486
|
-
|
|
68487
|
-
|
|
68488
|
-
|
|
68489
|
-
|
|
68516
|
+
let selectDone = false;
|
|
68517
|
+
const autoTimer = setInterval(() => {
|
|
68518
|
+
if (selectDone)
|
|
68519
|
+
return;
|
|
68520
|
+
countdown--;
|
|
68521
|
+
if (countdown <= 0) {
|
|
68522
|
+
selectDone = true;
|
|
68523
|
+
clearInterval(autoTimer);
|
|
68524
|
+
try {
|
|
68525
|
+
rl.feed("\x1B");
|
|
68526
|
+
} catch {
|
|
68490
68527
|
}
|
|
68491
|
-
|
|
68492
|
-
|
|
68493
|
-
|
|
68494
|
-
|
|
68495
|
-
|
|
68496
|
-
|
|
68497
|
-
|
|
68498
|
-
|
|
68499
|
-
|
|
68500
|
-
|
|
68501
|
-
|
|
68502
|
-
};
|
|
68503
|
-
const onEscape = () => {
|
|
68504
|
-
if (resolved)
|
|
68505
|
-
return;
|
|
68506
|
-
resolved = true;
|
|
68507
|
-
clearInterval(countdownTimer);
|
|
68508
|
-
rl.removeListener("line", onLine);
|
|
68509
|
-
rl.removeListener("escape", onEscape);
|
|
68510
|
-
resolve36("fresh");
|
|
68511
|
-
};
|
|
68512
|
-
rl.on("line", onLine);
|
|
68513
|
-
rl.on("escape", onEscape);
|
|
68528
|
+
}
|
|
68529
|
+
}, 1e3);
|
|
68530
|
+
const selectResult = await tuiSelect({
|
|
68531
|
+
items: [
|
|
68532
|
+
{ key: "restore", label: `Restore previous context (auto in ${countdown}s)` },
|
|
68533
|
+
{ key: "fresh", label: "Start fresh" }
|
|
68534
|
+
],
|
|
68535
|
+
activeKey: "restore",
|
|
68536
|
+
title: `Restore previous session?`,
|
|
68537
|
+
rl,
|
|
68538
|
+
availableRows: statusBar.isActive ? statusBar.availableContentRows : void 0
|
|
68514
68539
|
});
|
|
68515
|
-
|
|
68540
|
+
clearInterval(autoTimer);
|
|
68541
|
+
selectDone = true;
|
|
68542
|
+
const doRestore = selectResult.confirmed ? selectResult.key === "restore" : countdown <= 0;
|
|
68543
|
+
if (doRestore) {
|
|
68516
68544
|
const prompt = buildContextRestorePrompt(repoRoot);
|
|
68517
68545
|
if (prompt) {
|
|
68518
68546
|
restoredSessionContext = prompt;
|
package/package.json
CHANGED