open-agents-ai 0.185.57 → 0.185.58
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 +15 -55
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51832,23 +51832,13 @@ async function showCohereDashboard(ctx) {
|
|
|
51832
51832
|
}
|
|
51833
51833
|
}
|
|
51834
51834
|
async function showModelPicker(ctx, local = false) {
|
|
51835
|
-
|
|
51836
|
-
let spinFrame = 0;
|
|
51837
|
-
const spinTimer = setInterval(() => {
|
|
51838
|
-
process.stdout.write(`\r ${c2.cyan("\u25CF")} Loading models ${c2.cyan(BRAILLE_CYCLE[spinFrame++ % BRAILLE_CYCLE.length])}`);
|
|
51839
|
-
}, 80);
|
|
51835
|
+
renderInfo("Loading models...");
|
|
51840
51836
|
try {
|
|
51841
51837
|
let models;
|
|
51842
|
-
|
|
51843
|
-
|
|
51844
|
-
|
|
51845
|
-
|
|
51846
|
-
} finally {
|
|
51847
|
-
clearInterval(spinTimer);
|
|
51848
|
-
process.stdout.write(`\r${" ".repeat(40)}\r`);
|
|
51849
|
-
}
|
|
51850
|
-
process.stdout.write(` ${c2.green("\u2714")} ${models.length} models loaded
|
|
51851
|
-
`);
|
|
51838
|
+
const fetchPromise = fetchModels(ctx.config.backendUrl, ctx.config.apiKey);
|
|
51839
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error(`Timed out fetching models from ${ctx.config.backendUrl} (10s). The endpoint may be down. Use /endpoint to switch.`)), 1e4));
|
|
51840
|
+
models = await Promise.race([fetchPromise, timeoutPromise]);
|
|
51841
|
+
renderInfo(`${models.length} models loaded`);
|
|
51852
51842
|
if (models.length === 0) {
|
|
51853
51843
|
renderWarning("No models found.");
|
|
51854
51844
|
return;
|
|
@@ -53247,26 +53237,6 @@ async function handleUpdate(subcommand, ctx) {
|
|
|
53247
53237
|
}
|
|
53248
53238
|
};
|
|
53249
53239
|
}
|
|
53250
|
-
function startInlineSpinner(prefix) {
|
|
53251
|
-
let frame = 0;
|
|
53252
|
-
const nvActive = isNeovimActive();
|
|
53253
|
-
const timer = setInterval(() => {
|
|
53254
|
-
if (nvActive)
|
|
53255
|
-
return;
|
|
53256
|
-
const braille = BRAILLE_CYCLE[frame % BRAILLE_CYCLE.length];
|
|
53257
|
-
process.stdout.write(`\r ${c2.cyan("\u25CF")} ${prefix} ${c2.cyan(braille)}`);
|
|
53258
|
-
frame++;
|
|
53259
|
-
}, 80);
|
|
53260
|
-
safeWrite(` ${c2.cyan("\u25CF")} ${prefix} ${c2.cyan(BRAILLE_CYCLE[0])}
|
|
53261
|
-
`);
|
|
53262
|
-
return {
|
|
53263
|
-
stop(completionText) {
|
|
53264
|
-
clearInterval(timer);
|
|
53265
|
-
safeWrite(`\r ${c2.green("\u2714")} ${completionText}${" ".repeat(20)}
|
|
53266
|
-
`);
|
|
53267
|
-
}
|
|
53268
|
-
};
|
|
53269
|
-
}
|
|
53270
53240
|
const { exec: exec4, execSync: es2 } = await import("node:child_process");
|
|
53271
53241
|
const execA = (cmd, opts) => new Promise((res, rej) => exec4(cmd, { encoding: "utf8", timeout: opts?.timeout ?? 3e4, cwd: opts?.cwd }, (err, stdout) => err ? rej(err) : res((stdout || "").trim())));
|
|
53272
53242
|
renderInfo("Checking for updates...");
|
|
@@ -70103,18 +70073,10 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
70103
70073
|
p2pGateway = null;
|
|
70104
70074
|
}
|
|
70105
70075
|
const nexusTool = new NexusTool(repoRoot);
|
|
70106
|
-
|
|
70107
|
-
|
|
70108
|
-
|
|
70109
|
-
|
|
70110
|
-
if (isNeovimActive()) {
|
|
70111
|
-
writeToNeovimOutput(`${c2.cyan(exposeFrames[exposeFrame % exposeFrames.length])} ${c2.dim(exposeSpinnerMsg)}\r
|
|
70112
|
-
`);
|
|
70113
|
-
} else {
|
|
70114
|
-
process.stdout.write(`\r ${c2.cyan(exposeFrames[exposeFrame % exposeFrames.length])} ${c2.dim(exposeSpinnerMsg)}`);
|
|
70115
|
-
}
|
|
70116
|
-
exposeFrame++;
|
|
70117
|
-
}, 80);
|
|
70076
|
+
const exposeSpinnerMsg = passthrough ? `Connecting to nexus P2P network (passthrough \u2192 ${targetUrl})...` : "Connecting to nexus P2P network...";
|
|
70077
|
+
writeContent(() => {
|
|
70078
|
+
renderInfo(exposeSpinnerMsg);
|
|
70079
|
+
});
|
|
70118
70080
|
const newP2P = new ExposeP2PGateway({
|
|
70119
70081
|
kind,
|
|
70120
70082
|
targetUrl,
|
|
@@ -70124,10 +70086,14 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
70124
70086
|
loadbalance: loadbalance ?? false,
|
|
70125
70087
|
endpointAuth: passthrough ? currentConfig.apiKey : void 0,
|
|
70126
70088
|
onInfo: (msg) => {
|
|
70127
|
-
|
|
70089
|
+
writeContent(() => {
|
|
70090
|
+
renderInfo(msg);
|
|
70091
|
+
});
|
|
70128
70092
|
},
|
|
70129
70093
|
onError: (msg) => {
|
|
70130
|
-
|
|
70094
|
+
writeContent(() => {
|
|
70095
|
+
renderWarning(msg);
|
|
70096
|
+
});
|
|
70131
70097
|
}
|
|
70132
70098
|
}, nexusTool);
|
|
70133
70099
|
newP2P.on("stats", (stats) => {
|
|
@@ -70141,18 +70107,12 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
70141
70107
|
newP2P.on("token_flash", () => statusBar.flashExposeToken());
|
|
70142
70108
|
try {
|
|
70143
70109
|
const peerId = await newP2P.start();
|
|
70144
|
-
clearInterval(exposeSpinner);
|
|
70145
|
-
if (!isNeovimActive())
|
|
70146
|
-
process.stdout.write(`\r\x1B[2K`);
|
|
70147
70110
|
p2pGateway = newP2P;
|
|
70148
70111
|
writeContent(() => {
|
|
70149
70112
|
process.stdout.write("\n" + newP2P.formatConnectionInfo() + "\n\n");
|
|
70150
70113
|
});
|
|
70151
70114
|
return peerId;
|
|
70152
70115
|
} catch (err) {
|
|
70153
|
-
clearInterval(exposeSpinner);
|
|
70154
|
-
if (!isNeovimActive())
|
|
70155
|
-
process.stdout.write(`\r\x1B[2K`);
|
|
70156
70116
|
if (!transport) {
|
|
70157
70117
|
writeContent(() => {
|
|
70158
70118
|
renderWarning(`libp2p expose failed: ${err instanceof Error ? err.message : String(err)}`);
|
package/package.json
CHANGED