open-agents-ai 0.184.92 → 0.184.94
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 +42 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53729,12 +53729,13 @@ var init_banner = __esm({
|
|
|
53729
53729
|
}
|
|
53730
53730
|
buf += "\x1B[0m";
|
|
53731
53731
|
}
|
|
53732
|
-
|
|
53733
|
-
const inputRow = termRows - 2;
|
|
53734
|
-
buf += `\x1B[${inputRow};1H\x1B[0m\x1B[?2026l`;
|
|
53732
|
+
buf += "\x1B[0m";
|
|
53735
53733
|
process.stdout.write(buf);
|
|
53736
53734
|
if (this.onAfterRender)
|
|
53737
53735
|
this.onAfterRender();
|
|
53736
|
+
const termRows = process.stdout.rows ?? 24;
|
|
53737
|
+
const inputRow = termRows - 2;
|
|
53738
|
+
process.stdout.write(`\x1B[${inputRow};1H\x1B[?2026l`);
|
|
53738
53739
|
}
|
|
53739
53740
|
/** Handle terminal resize */
|
|
53740
53741
|
handleResize() {
|
|
@@ -62374,19 +62375,19 @@ var init_mouse_filter = __esm({
|
|
|
62374
62375
|
const mouseMatch = remaining.match(/^\x1B\[<(\d+);(\d+);(\d+)([Mm])/);
|
|
62375
62376
|
if (mouseMatch) {
|
|
62376
62377
|
const btn = parseInt(mouseMatch[1]);
|
|
62377
|
-
const row = parseInt(mouseMatch[3]);
|
|
62378
62378
|
const col = parseInt(mouseMatch[2]);
|
|
62379
|
+
const row = parseInt(mouseMatch[3]);
|
|
62379
62380
|
const suffix = mouseMatch[4];
|
|
62380
62381
|
if ((btn === 64 || btn === 96) && this.onScroll)
|
|
62381
62382
|
this.onScroll("up", 3, row);
|
|
62382
62383
|
else if ((btn === 65 || btn === 97) && this.onScroll)
|
|
62383
62384
|
this.onScroll("down", 3, row);
|
|
62384
62385
|
else if (this.onPointer) {
|
|
62385
|
-
if (btn === 0 && suffix === "M")
|
|
62386
|
+
if ((btn === 0 || btn === 1 || btn === 2) && suffix === "M")
|
|
62386
62387
|
this.onPointer("press", col, row);
|
|
62387
|
-
else if (btn
|
|
62388
|
+
else if (btn >= 32 && btn <= 35 && suffix === "M")
|
|
62388
62389
|
this.onPointer("drag", col, row);
|
|
62389
|
-
else if (
|
|
62390
|
+
else if (suffix === "m")
|
|
62390
62391
|
this.onPointer("release", col, row);
|
|
62391
62392
|
}
|
|
62392
62393
|
if (this.onActivity)
|
|
@@ -66329,8 +66330,35 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
66329
66330
|
if (spResp.ok) {
|
|
66330
66331
|
const spData = await spResp.json();
|
|
66331
66332
|
const active = (spData.sponsors || []).filter((s) => s.status === "active" && s.tunnelUrl);
|
|
66332
|
-
|
|
66333
|
-
|
|
66333
|
+
const tunnelSponsors = active.filter((s) => /trycloudflare\.com/i.test(s.tunnelUrl));
|
|
66334
|
+
const directSponsors = active.filter((s) => !/trycloudflare\.com/i.test(s.tunnelUrl));
|
|
66335
|
+
const sorted = [...tunnelSponsors, ...directSponsors];
|
|
66336
|
+
let best = null;
|
|
66337
|
+
let bestNoAuth = false;
|
|
66338
|
+
for (const sponsor of sorted) {
|
|
66339
|
+
try {
|
|
66340
|
+
const baseUrl = normalizeBaseUrl(sponsor.tunnelUrl);
|
|
66341
|
+
const testUrl = baseUrl + "/v1/models";
|
|
66342
|
+
const headers = {};
|
|
66343
|
+
if (sponsor.authKey)
|
|
66344
|
+
headers["Authorization"] = `Bearer ${sponsor.authKey}`;
|
|
66345
|
+
const probe = await fetch(testUrl, { headers, signal: AbortSignal.timeout(5e3) });
|
|
66346
|
+
if (probe.ok) {
|
|
66347
|
+
best = sponsor;
|
|
66348
|
+
break;
|
|
66349
|
+
}
|
|
66350
|
+
if (probe.status === 401 && sponsor.authKey) {
|
|
66351
|
+
const noAuthProbe = await fetch(testUrl, { signal: AbortSignal.timeout(5e3) });
|
|
66352
|
+
if (noAuthProbe.ok) {
|
|
66353
|
+
best = sponsor;
|
|
66354
|
+
bestNoAuth = true;
|
|
66355
|
+
break;
|
|
66356
|
+
}
|
|
66357
|
+
}
|
|
66358
|
+
} catch {
|
|
66359
|
+
}
|
|
66360
|
+
}
|
|
66361
|
+
if (best) {
|
|
66334
66362
|
writeContent(() => {
|
|
66335
66363
|
renderInfo(`No local Ollama detected. Auto-connecting to sponsored inference: ${best.name}`);
|
|
66336
66364
|
renderInfo(`Endpoint: ${best.tunnelUrl}`);
|
|
@@ -66338,8 +66366,12 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
66338
66366
|
renderInfo(`Change anytime: /endpoint or /endpoint sponsor`);
|
|
66339
66367
|
});
|
|
66340
66368
|
currentConfig.backendUrl = best.tunnelUrl;
|
|
66341
|
-
currentConfig.apiKey = best.authKey;
|
|
66369
|
+
currentConfig.apiKey = bestNoAuth ? "" : best.authKey;
|
|
66342
66370
|
currentConfig.backendType = "openai";
|
|
66371
|
+
} else if (active.length > 0) {
|
|
66372
|
+
writeContent(() => {
|
|
66373
|
+
renderInfo(`No local Ollama and no reachable sponsors. Use /endpoint to configure.`);
|
|
66374
|
+
});
|
|
66343
66375
|
}
|
|
66344
66376
|
}
|
|
66345
66377
|
} catch {
|
package/package.json
CHANGED