open-agents-ai 0.185.17 → 0.185.18
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 +25 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48556,6 +48556,22 @@ async function handleSlashCommand(input, ctx) {
|
|
|
48556
48556
|
}
|
|
48557
48557
|
if (orphansKilled > 0)
|
|
48558
48558
|
renderInfo(`Killed ${orphansKilled} orphaned cloudflared process(es).`);
|
|
48559
|
+
try {
|
|
48560
|
+
const retirePayload = {
|
|
48561
|
+
name: existingConfig.header?.message || "unknown",
|
|
48562
|
+
status: "inactive",
|
|
48563
|
+
tunnelUrl: ""
|
|
48564
|
+
};
|
|
48565
|
+
await fetch("https://openagents.nexus/api/v1/sponsors", {
|
|
48566
|
+
method: "POST",
|
|
48567
|
+
headers: { "Content-Type": "application/json" },
|
|
48568
|
+
body: JSON.stringify(retirePayload),
|
|
48569
|
+
signal: AbortSignal.timeout(5e3)
|
|
48570
|
+
});
|
|
48571
|
+
renderInfo("Sponsor directory notified (marked inactive).");
|
|
48572
|
+
} catch {
|
|
48573
|
+
renderWarning("Could not notify sponsor directory \u2014 entry may remain until it expires.");
|
|
48574
|
+
}
|
|
48559
48575
|
renderInfo("Sponsorship removed.");
|
|
48560
48576
|
return "handled";
|
|
48561
48577
|
}
|
|
@@ -50604,9 +50620,7 @@ async function handleEndpoint(arg, ctx, local = false) {
|
|
|
50604
50620
|
}
|
|
50605
50621
|
}
|
|
50606
50622
|
async function handleSponsoredEndpoint(ctx, local) {
|
|
50607
|
-
|
|
50608
|
-
${c2.dim("Scanning for sponsored inference endpoints...")}
|
|
50609
|
-
`);
|
|
50623
|
+
renderInfo("Scanning for sponsored inference endpoints...");
|
|
50610
50624
|
const sponsors = [];
|
|
50611
50625
|
let nexusTool = null;
|
|
50612
50626
|
try {
|
|
@@ -50618,16 +50632,13 @@ async function handleSponsoredEndpoint(ctx, local) {
|
|
|
50618
50632
|
const statusResult = String(await nexusTool.execute({ action: "status" }) ?? "");
|
|
50619
50633
|
const isConnected = /Connected:\s*true/i.test(statusResult) || statusResult.includes("Daemon running");
|
|
50620
50634
|
if (isConnected) {
|
|
50621
|
-
|
|
50622
|
-
`);
|
|
50635
|
+
renderInfo("Using existing nexus connection...");
|
|
50623
50636
|
} else {
|
|
50624
|
-
|
|
50625
|
-
`);
|
|
50637
|
+
renderInfo("Starting nexus daemon...");
|
|
50626
50638
|
await nexusTool.execute({ action: "connect" });
|
|
50627
50639
|
await new Promise((r) => setTimeout(r, 3e3));
|
|
50628
50640
|
}
|
|
50629
|
-
|
|
50630
|
-
`);
|
|
50641
|
+
renderInfo("Querying sponsors on the mesh...");
|
|
50631
50642
|
const discoverResult = await nexusTool.execute({
|
|
50632
50643
|
action: "sponsor_discover",
|
|
50633
50644
|
timeout_ms: "5000"
|
|
@@ -50657,15 +50668,13 @@ async function handleSponsoredEndpoint(ctx, local) {
|
|
|
50657
50668
|
});
|
|
50658
50669
|
}
|
|
50659
50670
|
if (nexusSponsors.length > 0) {
|
|
50660
|
-
|
|
50661
|
-
`);
|
|
50671
|
+
renderInfo(`Found ${nexusSponsors.length} sponsor(s) on nexus mesh`);
|
|
50662
50672
|
}
|
|
50663
50673
|
} catch {
|
|
50664
50674
|
}
|
|
50665
50675
|
}
|
|
50666
50676
|
} catch (nexusErr) {
|
|
50667
|
-
|
|
50668
|
-
`);
|
|
50677
|
+
renderInfo(`Nexus unavailable: ${(nexusErr instanceof Error ? nexusErr.message : String(nexusErr)).slice(0, 60)}`);
|
|
50669
50678
|
}
|
|
50670
50679
|
}
|
|
50671
50680
|
const gateway = ctx.getExposeGateway?.();
|
|
@@ -50716,8 +50725,7 @@ async function handleSponsoredEndpoint(ctx, local) {
|
|
|
50716
50725
|
kvAdded++;
|
|
50717
50726
|
}
|
|
50718
50727
|
if (kvAdded > 0) {
|
|
50719
|
-
|
|
50720
|
-
`);
|
|
50728
|
+
renderInfo(`Found ${kvAdded} sponsor(s) in directory`);
|
|
50721
50729
|
}
|
|
50722
50730
|
}
|
|
50723
50731
|
} catch {
|
|
@@ -50748,8 +50756,7 @@ async function handleSponsoredEndpoint(ctx, local) {
|
|
|
50748
50756
|
sponsors.length = 0;
|
|
50749
50757
|
sponsors.push(...deduped);
|
|
50750
50758
|
if (sponsors.length > 0) {
|
|
50751
|
-
|
|
50752
|
-
`);
|
|
50759
|
+
renderInfo(`Verifying ${sponsors.length} sponsor(s)...`);
|
|
50753
50760
|
const probeResults = await Promise.all(sponsors.map(async (sp) => {
|
|
50754
50761
|
if (!sp.url)
|
|
50755
50762
|
return true;
|
|
@@ -50771,8 +50778,7 @@ async function handleSponsoredEndpoint(ctx, local) {
|
|
|
50771
50778
|
const staleCount = probeResults.filter((ok) => !ok).length;
|
|
50772
50779
|
const verified = sponsors.filter((_, i) => probeResults[i]);
|
|
50773
50780
|
if (staleCount > 0) {
|
|
50774
|
-
|
|
50775
|
-
`);
|
|
50781
|
+
renderInfo(`${staleCount} stale sponsor(s) hidden (unreachable)`);
|
|
50776
50782
|
}
|
|
50777
50783
|
sponsors.length = 0;
|
|
50778
50784
|
sponsors.push(...verified);
|
package/package.json
CHANGED