manifest 5.36.3 → 5.36.4
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/backend/routing/proxy/fallback-status-codes.js +0 -4
- package/dist/backend/routing/proxy/provider-endpoints.js +6 -1
- package/dist/backend/routing/proxy/proxy-exception.filter.js +6 -6
- package/dist/backend/routing/proxy/proxy.controller.js +1 -1
- package/dist/backend/routing/proxy/proxy.service.js +6 -6
- package/dist/openclaw.plugin.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FALLBACK_EXHAUSTED_STATUS = void 0;
|
|
4
3
|
exports.shouldTriggerFallback = shouldTriggerFallback;
|
|
5
|
-
exports.FALLBACK_EXHAUSTED_STATUS = 424;
|
|
6
4
|
function shouldTriggerFallback(status) {
|
|
7
|
-
if (status === exports.FALLBACK_EXHAUSTED_STATUS)
|
|
8
|
-
return false;
|
|
9
5
|
return status >= 400;
|
|
10
6
|
}
|
|
11
7
|
//# sourceMappingURL=fallback-status-codes.js.map
|
|
@@ -127,7 +127,12 @@ exports.PROVIDER_ENDPOINTS = {
|
|
|
127
127
|
},
|
|
128
128
|
openrouter: {
|
|
129
129
|
baseUrl: 'https://openrouter.ai',
|
|
130
|
-
buildHeaders:
|
|
130
|
+
buildHeaders: (apiKey) => ({
|
|
131
|
+
Authorization: `Bearer ${apiKey}`,
|
|
132
|
+
'Content-Type': 'application/json',
|
|
133
|
+
'HTTP-Referer': 'https://manifest.build',
|
|
134
|
+
'X-Title': 'Manifest',
|
|
135
|
+
}),
|
|
131
136
|
buildPath: () => '/api/v1/chat/completions',
|
|
132
137
|
format: 'openai',
|
|
133
138
|
},
|
|
@@ -14,11 +14,11 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const config_1 = require("@nestjs/config");
|
|
15
15
|
const proxy_friendly_response_1 = require("./proxy-friendly-response");
|
|
16
16
|
const AUTH_ERROR_MESSAGES = {
|
|
17
|
-
'Authorization header required': 'Missing API key. Set your Manifest key (starts with mnfst_) as the Bearer token.',
|
|
18
|
-
'Empty token': 'Bearer token is empty — paste your Manifest API key into the authorization field.',
|
|
19
|
-
'Invalid API key format': 'That doesn\'t look like a Manifest key. They start with "mnfst_" — check your dashboard.',
|
|
20
|
-
'API key expired': 'This API key expired. Generate a new one from your Manifest dashboard',
|
|
21
|
-
'Invalid API key': "This API key wasn't recognized — it may have been rotated or deleted. Check your dashboard for the current key.",
|
|
17
|
+
'Authorization header required': '[Manifest] Missing API key. Set your Manifest key (starts with mnfst_) as the Bearer token.',
|
|
18
|
+
'Empty token': '[Manifest] Bearer token is empty — paste your Manifest API key into the authorization field.',
|
|
19
|
+
'Invalid API key format': '[Manifest] That doesn\'t look like a Manifest key. They start with "mnfst_" — check your dashboard.',
|
|
20
|
+
'API key expired': '[Manifest] This API key expired. Generate a new one from your Manifest dashboard',
|
|
21
|
+
'Invalid API key': "[Manifest] This API key wasn't recognized — it may have been rotated or deleted. Check your dashboard for the current key.",
|
|
22
22
|
};
|
|
23
23
|
const PASSTHROUGH_STATUSES = new Set([429]);
|
|
24
24
|
let ProxyExceptionFilter = class ProxyExceptionFilter {
|
|
@@ -54,7 +54,7 @@ let ProxyExceptionFilter = class ProxyExceptionFilter {
|
|
|
54
54
|
(0, proxy_friendly_response_1.sendFriendlyResponse)(res, content, isStream);
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const content = status >= 500 ? 'Something broke on our end. Try again shortly.' : message;
|
|
57
|
+
const content = status >= 500 ? '[Manifest] Something broke on our end. Try again shortly.' : message;
|
|
58
58
|
(0, proxy_friendly_response_1.sendFriendlyResponse)(res, content, isStream);
|
|
59
59
|
}
|
|
60
60
|
};
|
|
@@ -113,7 +113,7 @@ let ProxyController = ProxyController_1 = class ProxyController {
|
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
115
|
const isStream = req.body?.stream === true;
|
|
116
|
-
const clientMessage = status >= 500 ? 'Something broke on our end. Try again shortly.' : message;
|
|
116
|
+
const clientMessage = status >= 500 ? '[Manifest] Something broke on our end. Try again shortly.' : message;
|
|
117
117
|
(0, proxy_friendly_response_1.sendFriendlyResponse)(res, clientMessage, isStream);
|
|
118
118
|
}
|
|
119
119
|
finally {
|
|
@@ -77,7 +77,7 @@ let ProxyService = ProxyService_1 = class ProxyService {
|
|
|
77
77
|
let apiKey = await this.providerKeyService.getProviderApiKey(agentId, resolved.provider, resolved.auth_type);
|
|
78
78
|
if (apiKey === null) {
|
|
79
79
|
const dashboardUrl = (0, proxy_friendly_response_1.getDashboardUrl)(this.config, agentName);
|
|
80
|
-
const content = `No API key set for ${resolved.provider} yet. Add one here: ${dashboardUrl}`;
|
|
80
|
+
const content = `[Manifest] No API key set for ${resolved.provider} yet. Add one here: ${dashboardUrl}`;
|
|
81
81
|
return (0, proxy_friendly_response_1.buildFriendlyResponse)(content, body.stream === true, 'no_provider_key');
|
|
82
82
|
}
|
|
83
83
|
const resolvedCredentials = await (0, proxy_fallback_service_1.resolveApiKey)(resolved.provider, apiKey, resolved.auth_type, agentId, userId, this.openaiOauth, this.minimaxOauth);
|
|
@@ -104,6 +104,7 @@ let ProxyService = ProxyService_1 = class ProxyService {
|
|
|
104
104
|
const assignment = tiers.find((t) => t.tier === resolved.tier);
|
|
105
105
|
const fallbackModels = assignment?.fallback_models;
|
|
106
106
|
if (fallbackModels && fallbackModels.length > 0) {
|
|
107
|
+
const primaryStatus = forward.response.status;
|
|
107
108
|
const primaryErrorBody = await forward.response.text();
|
|
108
109
|
const { success, failures } = await this.fallbackService.tryFallbacks(agentId, userId, fallbackModels, body, stream, sessionKey, primaryModel, signal, resolved.provider ?? undefined, resolved.auth_type, signatureLookup);
|
|
109
110
|
if (success) {
|
|
@@ -119,7 +120,7 @@ let ProxyService = ProxyService_1 = class ProxyService {
|
|
|
119
120
|
auth_type: resolved.auth_type,
|
|
120
121
|
fallbackFromModel: primaryModel,
|
|
121
122
|
fallbackIndex: success.fallbackIndex,
|
|
122
|
-
primaryErrorStatus:
|
|
123
|
+
primaryErrorStatus: primaryStatus,
|
|
123
124
|
primaryErrorBody: primaryErrorBody,
|
|
124
125
|
},
|
|
125
126
|
failedFallbacks: failures,
|
|
@@ -130,8 +131,7 @@ let ProxyService = ProxyService_1 = class ProxyService {
|
|
|
130
131
|
safeHeaders.delete('content-length');
|
|
131
132
|
safeHeaders.delete('transfer-encoding');
|
|
132
133
|
const rebuilt = new Response(primaryErrorBody, {
|
|
133
|
-
status:
|
|
134
|
-
statusText: 'Failed Dependency',
|
|
134
|
+
status: primaryStatus,
|
|
135
135
|
headers: safeHeaders,
|
|
136
136
|
});
|
|
137
137
|
this.momentum.recordTier(sessionKey, resolved.tier);
|
|
@@ -180,7 +180,7 @@ let ProxyService = ProxyService_1 = class ProxyService {
|
|
|
180
180
|
? `$${Number(exceeded.threshold).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
|
|
181
181
|
: Number(exceeded.threshold).toLocaleString(undefined, { maximumFractionDigits: 0 });
|
|
182
182
|
const dashboardUrl = (0, proxy_friendly_response_1.getDashboardUrl)(this.config, agentName);
|
|
183
|
-
return `Usage limit hit: ${exceeded.metricType} is at ${fmt} (limit: ${threshFmt}/${exceeded.period}). You can adjust it here: ${dashboardUrl}`;
|
|
183
|
+
return `[Manifest] Usage limit hit: ${exceeded.metricType} is at ${fmt} (limit: ${threshFmt}/${exceeded.period}). You can adjust it here: ${dashboardUrl}`;
|
|
184
184
|
}
|
|
185
185
|
filterScoringMessages(messages) {
|
|
186
186
|
return messages
|
|
@@ -200,7 +200,7 @@ let ProxyService = ProxyService_1 = class ProxyService {
|
|
|
200
200
|
}
|
|
201
201
|
buildNoProviderResult(stream, agentName) {
|
|
202
202
|
const dashboardUrl = (0, proxy_friendly_response_1.getDashboardUrl)(this.config, agentName);
|
|
203
|
-
const content = `Manifest is connected successfully. To start routing requests, connect a model provider: ${dashboardUrl}`;
|
|
203
|
+
const content = `[Manifest] Manifest is connected successfully. To start routing requests, connect a model provider: ${dashboardUrl}`;
|
|
204
204
|
return (0, proxy_friendly_response_1.buildFriendlyResponse)(content, stream, 'no_provider');
|
|
205
205
|
}
|
|
206
206
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "manifest",
|
|
3
3
|
"name": "Manifest Self-Hosted LLM Router",
|
|
4
|
-
"version": "5.36.
|
|
4
|
+
"version": "5.36.4",
|
|
5
5
|
"description": "Run the Manifest LLM router locally with SQLite. Zero-config dashboard included.",
|
|
6
6
|
"author": "MNFST Inc.",
|
|
7
7
|
"homepage": "https://manifest.build",
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "manifest",
|
|
3
3
|
"name": "Manifest Self-Hosted LLM Router",
|
|
4
|
-
"version": "5.36.
|
|
4
|
+
"version": "5.36.4",
|
|
5
5
|
"description": "Run the Manifest LLM router locally with SQLite. Zero-config dashboard included.",
|
|
6
6
|
"author": "MNFST Inc.",
|
|
7
7
|
"homepage": "https://manifest.build",
|