@elsium-ai/app 0.9.0 → 0.9.1
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 +20 -14
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -2589,27 +2589,33 @@ function createProviderMesh(config) {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
return { success: true };
|
|
2591
2591
|
}
|
|
2592
|
+
async function attemptStreamProvider(entry, nextProvider, request, emit) {
|
|
2593
|
+
try {
|
|
2594
|
+
const result = await tryStreamProvider(entry, request, emit);
|
|
2595
|
+
if (result.success)
|
|
2596
|
+
return { success: true };
|
|
2597
|
+
logStreamFailover(entry.name, nextProvider, result.error);
|
|
2598
|
+
return { success: false, error: result.error };
|
|
2599
|
+
} catch (err2) {
|
|
2600
|
+
const error = toError2(err2);
|
|
2601
|
+
logStreamFailover(entry.name, nextProvider, error);
|
|
2602
|
+
return { success: false, error };
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2592
2605
|
async function runStreamFallbackLoop(available, request, emit) {
|
|
2593
2606
|
let lastError = null;
|
|
2594
2607
|
let failedProvider = null;
|
|
2595
2608
|
for (let i = 0;i < available.length; i++) {
|
|
2596
2609
|
const entry = available[i];
|
|
2597
2610
|
const nextProvider = i + 1 < available.length ? available[i + 1].name : "none";
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
if (
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
return;
|
|
2604
|
-
}
|
|
2605
|
-
lastError = result.error ?? null;
|
|
2606
|
-
failedProvider = entry.name;
|
|
2607
|
-
logStreamFailover(entry.name, nextProvider, result.error);
|
|
2608
|
-
} catch (err2) {
|
|
2609
|
-
failedProvider = entry.name;
|
|
2610
|
-
lastError = toError2(err2);
|
|
2611
|
-
logStreamFailover(entry.name, nextProvider, lastError);
|
|
2611
|
+
const attempt = await attemptStreamProvider(entry, nextProvider, request, emit);
|
|
2612
|
+
if (attempt.success) {
|
|
2613
|
+
if (failedProvider)
|
|
2614
|
+
logFailover(failedProvider, entry.name, lastError?.message);
|
|
2615
|
+
return;
|
|
2612
2616
|
}
|
|
2617
|
+
lastError = attempt.error ?? null;
|
|
2618
|
+
failedProvider = entry.name;
|
|
2613
2619
|
}
|
|
2614
2620
|
emit({
|
|
2615
2621
|
type: "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elsium-ai/app",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "App bootstrap, HTTP server, and API routes for ElsiumAI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Eric Utrera <ebutrera9103@gmail.com>",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"dev": "bun --watch src/index.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@elsium-ai/core": "^0.9.
|
|
30
|
-
"@elsium-ai/gateway": "^0.9.
|
|
31
|
-
"@elsium-ai/agents": "^0.9.
|
|
32
|
-
"@elsium-ai/tools": "^0.9.
|
|
33
|
-
"@elsium-ai/observe": "^0.9.
|
|
34
|
-
"@elsium-ai/rag": "^0.9.
|
|
35
|
-
"@elsium-ai/workflows": "^0.9.
|
|
29
|
+
"@elsium-ai/core": "^0.9.1",
|
|
30
|
+
"@elsium-ai/gateway": "^0.9.1",
|
|
31
|
+
"@elsium-ai/agents": "^0.9.1",
|
|
32
|
+
"@elsium-ai/tools": "^0.9.1",
|
|
33
|
+
"@elsium-ai/observe": "^0.9.1",
|
|
34
|
+
"@elsium-ai/rag": "^0.9.1",
|
|
35
|
+
"@elsium-ai/workflows": "^0.9.1",
|
|
36
36
|
"@hono/node-server": "^1.19.10",
|
|
37
37
|
"hono": "^4.12.4",
|
|
38
38
|
"zod": "^3.24.0"
|