open-agents-ai 0.185.12 → 0.185.13
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 +56 -35
- 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.");
|
|
@@ -68476,43 +68506,34 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
68476
68506
|
renderInfo(`Last task: ${lastTask}${lastEntry.task && lastEntry.task.length > 80 ? "..." : ""}`);
|
|
68477
68507
|
});
|
|
68478
68508
|
let countdown = 10;
|
|
68479
|
-
let
|
|
68480
|
-
const
|
|
68481
|
-
|
|
68482
|
-
|
|
68483
|
-
|
|
68484
|
-
|
|
68485
|
-
|
|
68486
|
-
|
|
68487
|
-
|
|
68488
|
-
|
|
68489
|
-
|
|
68509
|
+
let selectDone = false;
|
|
68510
|
+
const autoTimer = setInterval(() => {
|
|
68511
|
+
if (selectDone)
|
|
68512
|
+
return;
|
|
68513
|
+
countdown--;
|
|
68514
|
+
if (countdown <= 0) {
|
|
68515
|
+
selectDone = true;
|
|
68516
|
+
clearInterval(autoTimer);
|
|
68517
|
+
try {
|
|
68518
|
+
rl.feed("\x1B");
|
|
68519
|
+
} catch {
|
|
68490
68520
|
}
|
|
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);
|
|
68521
|
+
}
|
|
68522
|
+
}, 1e3);
|
|
68523
|
+
const selectResult = await tuiSelect({
|
|
68524
|
+
items: [
|
|
68525
|
+
{ key: "restore", label: `Restore previous context (auto in ${countdown}s)` },
|
|
68526
|
+
{ key: "fresh", label: "Start fresh" }
|
|
68527
|
+
],
|
|
68528
|
+
activeKey: "restore",
|
|
68529
|
+
title: `Restore previous session?`,
|
|
68530
|
+
rl,
|
|
68531
|
+
availableRows: statusBar.isActive ? statusBar.availableContentRows : void 0
|
|
68514
68532
|
});
|
|
68515
|
-
|
|
68533
|
+
clearInterval(autoTimer);
|
|
68534
|
+
selectDone = true;
|
|
68535
|
+
const doRestore = selectResult.confirmed ? selectResult.key === "restore" : countdown <= 0;
|
|
68536
|
+
if (doRestore) {
|
|
68516
68537
|
const prompt = buildContextRestorePrompt(repoRoot);
|
|
68517
68538
|
if (prompt) {
|
|
68518
68539
|
restoredSessionContext = prompt;
|
package/package.json
CHANGED