@agimon-ai/model-proxy-mcp 0.2.2 → 0.2.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/cli.cjs +3 -0
- package/dist/cli.mjs +2 -647
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -3
- package/dist/stdio-BKQRhaEs.cjs +1127 -0
- package/dist/stdio-xpvsxU_k.mjs +596 -0
- package/package.json +6 -4
- package/dist/cli.d.mts +0 -1
- package/dist/index.d.mts +0 -468
- package/dist/stdio-C23n_O3v.mjs +0 -4041
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/model-proxy-mcp",
|
|
3
3
|
"description": "Claude-compatible model proxy MCP with ChatGPT Codex upstream support",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"mcp",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"bin": {
|
|
13
13
|
"model-proxy-mcp": "./dist/cli.mjs"
|
|
14
14
|
},
|
|
15
|
-
"main": "./dist/index.
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
16
|
"types": "./dist/index.d.mts",
|
|
17
17
|
"module": "./dist/index.mjs",
|
|
18
18
|
"files": [
|
|
@@ -41,10 +41,12 @@
|
|
|
41
41
|
"type": "module",
|
|
42
42
|
"exports": {
|
|
43
43
|
".": {
|
|
44
|
-
"import": "./dist/index.mjs"
|
|
44
|
+
"import": "./dist/index.mjs",
|
|
45
|
+
"require": "./dist/index.cjs"
|
|
45
46
|
},
|
|
46
47
|
"./cli": {
|
|
47
|
-
"import": "./dist/cli.mjs"
|
|
48
|
+
"import": "./dist/cli.mjs",
|
|
49
|
+
"require": "./dist/cli.cjs"
|
|
48
50
|
},
|
|
49
51
|
"./package.json": "./package.json"
|
|
50
52
|
},
|
package/dist/cli.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/index.d.mts
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
import "@hono/node-server";
|
|
2
|
-
import { Hono } from "hono";
|
|
3
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
4
|
-
import * as hono_types0 from "hono/types";
|
|
5
|
-
|
|
6
|
-
//#region src/types/index.d.ts
|
|
7
|
-
interface LoggerLike {
|
|
8
|
-
info: (msg: string, data?: unknown) => void;
|
|
9
|
-
error: (msg: string, error?: unknown) => void;
|
|
10
|
-
debug: (msg: string, data?: unknown) => void;
|
|
11
|
-
warn: (msg: string, data?: unknown) => void;
|
|
12
|
-
}
|
|
13
|
-
type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
|
|
14
|
-
type ProxyProviderType = 'chatgpt-codex' | 'anthropic-compatible' | 'gemini-direct';
|
|
15
|
-
type GeminiAuthMode = 'auto' | 'api-key' | 'oauth';
|
|
16
|
-
type ModelSlot = 'default' | 'sonnet' | 'opus' | 'haiku' | 'subagent';
|
|
17
|
-
interface ProviderRuntimeConfig {
|
|
18
|
-
type: ProxyProviderType;
|
|
19
|
-
endpoint: string;
|
|
20
|
-
authTokenEnvVar?: string | null;
|
|
21
|
-
apiTimeoutMs?: number | null;
|
|
22
|
-
authMode?: GeminiAuthMode | null;
|
|
23
|
-
apiKeyEnvVar?: string | null;
|
|
24
|
-
project?: string | null;
|
|
25
|
-
location?: string | null;
|
|
26
|
-
apiVersion?: string | null;
|
|
27
|
-
}
|
|
28
|
-
interface ProxyProfile {
|
|
29
|
-
id: string;
|
|
30
|
-
label: string;
|
|
31
|
-
provider: string;
|
|
32
|
-
providerType: ProxyProviderType | null;
|
|
33
|
-
model: string;
|
|
34
|
-
endpoint: string | null;
|
|
35
|
-
reasoningEffort: ReasoningEffort;
|
|
36
|
-
enabled: boolean;
|
|
37
|
-
}
|
|
38
|
-
interface ProxyModelConfig {
|
|
39
|
-
id: string;
|
|
40
|
-
label: string;
|
|
41
|
-
provider: string;
|
|
42
|
-
model: string;
|
|
43
|
-
reasoningEffort: ReasoningEffort;
|
|
44
|
-
enabled: boolean;
|
|
45
|
-
}
|
|
46
|
-
interface ScopeModelSelection {
|
|
47
|
-
provider: string;
|
|
48
|
-
model: string;
|
|
49
|
-
reasoningEffort: ReasoningEffort;
|
|
50
|
-
thinkingDisabled?: boolean;
|
|
51
|
-
}
|
|
52
|
-
interface ScopeSlotConfig {
|
|
53
|
-
main: ScopeModelSelection;
|
|
54
|
-
fallbacks: ScopeModelSelection[];
|
|
55
|
-
}
|
|
56
|
-
interface ScopeSettings {
|
|
57
|
-
models: Partial<Record<ModelSlot, ScopeSlotConfig>>;
|
|
58
|
-
}
|
|
59
|
-
interface ProxySettings {
|
|
60
|
-
providers: Record<string, ProviderRuntimeConfig>;
|
|
61
|
-
models: ProxyModelConfig[];
|
|
62
|
-
scope: ScopeSettings;
|
|
63
|
-
}
|
|
64
|
-
interface ScopeConfig {
|
|
65
|
-
activeProfileId: string | null;
|
|
66
|
-
slotProfileIds: Partial<Record<ModelSlot, string | null>>;
|
|
67
|
-
providers: Record<string, ProviderRuntimeConfig>;
|
|
68
|
-
profiles: ProxyProfile[];
|
|
69
|
-
scope: ScopeSettings;
|
|
70
|
-
}
|
|
71
|
-
interface ProxyConfig extends ScopeConfig {}
|
|
72
|
-
interface ResolvedSlotConfig {
|
|
73
|
-
slot: ModelSlot;
|
|
74
|
-
profileId: string | null;
|
|
75
|
-
label: string | null;
|
|
76
|
-
provider: string | null;
|
|
77
|
-
providerType: ProxyProviderType | null;
|
|
78
|
-
endpoint: string | null;
|
|
79
|
-
model: string | null;
|
|
80
|
-
reasoningEffort: ReasoningEffort;
|
|
81
|
-
thinkingDisabled?: boolean;
|
|
82
|
-
fallbacks: ScopeModelSelection[];
|
|
83
|
-
}
|
|
84
|
-
interface AdminConfig {
|
|
85
|
-
scope: string;
|
|
86
|
-
providerConfigPath: string;
|
|
87
|
-
modelListPath: string;
|
|
88
|
-
scopeConfigPath: string;
|
|
89
|
-
providers: Record<string, ProviderRuntimeConfig>;
|
|
90
|
-
models: ProxyProfile[];
|
|
91
|
-
scopeModels: ScopeSettings['models'];
|
|
92
|
-
slots: Record<ModelSlot, ResolvedSlotConfig>;
|
|
93
|
-
}
|
|
94
|
-
interface GatewayStatus {
|
|
95
|
-
running: boolean;
|
|
96
|
-
port?: number;
|
|
97
|
-
pid?: number;
|
|
98
|
-
scope: string;
|
|
99
|
-
activeProfileId: string | null;
|
|
100
|
-
activeModel?: string;
|
|
101
|
-
activeReasoningEffort?: ReasoningEffort;
|
|
102
|
-
slotModels: Partial<Record<ModelSlot, {
|
|
103
|
-
profileId: string | null;
|
|
104
|
-
provider: string | null;
|
|
105
|
-
model: string | null;
|
|
106
|
-
reasoningEffort: ReasoningEffort;
|
|
107
|
-
thinkingDisabled?: boolean;
|
|
108
|
-
}>>;
|
|
109
|
-
auth: {
|
|
110
|
-
configured: boolean;
|
|
111
|
-
accountId?: string | null;
|
|
112
|
-
authFilePath: string;
|
|
113
|
-
lastRefresh?: string | null;
|
|
114
|
-
};
|
|
115
|
-
profiles: ProxyProfile[];
|
|
116
|
-
error?: string;
|
|
117
|
-
}
|
|
118
|
-
interface AdminConfigUpdate {
|
|
119
|
-
models?: Partial<Record<ModelSlot, ScopeSlotConfig | null>>;
|
|
120
|
-
}
|
|
121
|
-
interface ConversationHistoryEntry {
|
|
122
|
-
id: string;
|
|
123
|
-
scope: string;
|
|
124
|
-
requestId: string;
|
|
125
|
-
direction: 'request' | 'response' | 'error';
|
|
126
|
-
role: string | null;
|
|
127
|
-
messageType: string;
|
|
128
|
-
model: string | null;
|
|
129
|
-
slot: ModelSlot;
|
|
130
|
-
payloadJson: string;
|
|
131
|
-
createdAt: string;
|
|
132
|
-
}
|
|
133
|
-
interface ConversationHistoryPage {
|
|
134
|
-
items: ConversationHistoryEntry[];
|
|
135
|
-
nextCursor: string | null;
|
|
136
|
-
total: number;
|
|
137
|
-
}
|
|
138
|
-
interface ConversationHistoryStats {
|
|
139
|
-
scope: string;
|
|
140
|
-
retentionLimit: number;
|
|
141
|
-
totalMessages: number;
|
|
142
|
-
oldestCreatedAt: string | null;
|
|
143
|
-
newestCreatedAt: string | null;
|
|
144
|
-
}
|
|
145
|
-
interface TransportHandler {
|
|
146
|
-
start(): Promise<void>;
|
|
147
|
-
stop(): Promise<void>;
|
|
148
|
-
}
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region src/adapters/codex/CodexAuth.d.ts
|
|
151
|
-
declare class CodexAuth {
|
|
152
|
-
private readonly logger;
|
|
153
|
-
private readonly authFilePath;
|
|
154
|
-
private static readonly TOKEN_REFRESH_URL;
|
|
155
|
-
private static readonly CLIENT_ID;
|
|
156
|
-
constructor(logger?: LoggerLike, authFilePath?: string);
|
|
157
|
-
getAuthFilePath(): string;
|
|
158
|
-
getAuthStatus(): Promise<{
|
|
159
|
-
configured: boolean;
|
|
160
|
-
accountId?: string | null;
|
|
161
|
-
authFilePath: string;
|
|
162
|
-
lastRefresh?: string | null;
|
|
163
|
-
}>;
|
|
164
|
-
getAccountId(): Promise<string | null>;
|
|
165
|
-
getAccessToken(): Promise<string | null>;
|
|
166
|
-
private readAuthFile;
|
|
167
|
-
private isTokenExpired;
|
|
168
|
-
private decodeJWT;
|
|
169
|
-
private refreshAccessToken;
|
|
170
|
-
private saveTokens;
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/services/ConversationHistoryService.d.ts
|
|
174
|
-
type NewHistoryEntry = Omit<ConversationHistoryEntry, 'id' | 'createdAt'> & {
|
|
175
|
-
id?: string;
|
|
176
|
-
createdAt?: string;
|
|
177
|
-
};
|
|
178
|
-
/**
|
|
179
|
-
* Error raised for conversation history persistence failures.
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Persists scoped conversation history using SQLite and enforces bounded retention.
|
|
184
|
-
*
|
|
185
|
-
* Environment variables:
|
|
186
|
-
* - `MODEL_PROXY_MCP_DB_PATH`
|
|
187
|
-
*/
|
|
188
|
-
declare class ConversationHistoryService {
|
|
189
|
-
private readonly dbPath;
|
|
190
|
-
private readonly retentionLimit;
|
|
191
|
-
private readonly logger;
|
|
192
|
-
private sqlite;
|
|
193
|
-
/**
|
|
194
|
-
* Creates a SQLite-backed history store.
|
|
195
|
-
*
|
|
196
|
-
* `dbPath` defaults to `MODEL_PROXY_MCP_DB_PATH` or `~/.model-proxy/history.sqlite`.
|
|
197
|
-
* `retentionLimit` is enforced per scope after each insert batch.
|
|
198
|
-
* `logger` receives structured operational failures.
|
|
199
|
-
*/
|
|
200
|
-
constructor(dbPath?: string, retentionLimit?: number, logger?: LoggerLike);
|
|
201
|
-
/**
|
|
202
|
-
* Eagerly initializes the SQLite database and schema.
|
|
203
|
-
*/
|
|
204
|
-
ensureInitialized(): Promise<void>;
|
|
205
|
-
/**
|
|
206
|
-
* Inserts normalized history entries and prunes overflow per scope.
|
|
207
|
-
*/
|
|
208
|
-
appendEntries(entries: NewHistoryEntry[]): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Lists conversation history for a scope ordered from newest to oldest.
|
|
211
|
-
*/
|
|
212
|
-
listHistory(scope: string, limit?: number, cursor?: string): Promise<ConversationHistoryPage>;
|
|
213
|
-
/**
|
|
214
|
-
* Clears all history rows for a single scope and returns the deleted count.
|
|
215
|
-
*/
|
|
216
|
-
clearScope(scope: string): Promise<number>;
|
|
217
|
-
/**
|
|
218
|
-
* Returns retention stats for a scope.
|
|
219
|
-
*/
|
|
220
|
-
getStats(scope: string): Promise<ConversationHistoryStats>;
|
|
221
|
-
/**
|
|
222
|
-
* Lists known scopes discovered from stored conversation history.
|
|
223
|
-
*/
|
|
224
|
-
listScopes(): Promise<string[]>;
|
|
225
|
-
/**
|
|
226
|
-
* Removes the oldest rows for a scope when it exceeds retention.
|
|
227
|
-
*/
|
|
228
|
-
private pruneScope;
|
|
229
|
-
/**
|
|
230
|
-
* Lazily initializes the SQLite connection and schema.
|
|
231
|
-
*/
|
|
232
|
-
private getDb;
|
|
233
|
-
/**
|
|
234
|
-
* Maps a SQLite row into the public history DTO.
|
|
235
|
-
*/
|
|
236
|
-
private toEntry;
|
|
237
|
-
}
|
|
238
|
-
//#endregion
|
|
239
|
-
//#region src/services/ProfileStore.d.ts
|
|
240
|
-
declare class ProfileStore {
|
|
241
|
-
private readonly providerConfigPath;
|
|
242
|
-
private readonly modelListPath;
|
|
243
|
-
private readonly scopeSettingsDir;
|
|
244
|
-
private readonly logger;
|
|
245
|
-
constructor(providerConfigPath?: string, modelListPath?: string, scopeSettingsDir?: string, logger?: LoggerLike);
|
|
246
|
-
getConfigPath(scope?: string): string;
|
|
247
|
-
ensureConfig(scope?: string, seedConfigPath?: string): Promise<ProxyConfig>;
|
|
248
|
-
listScopes(): Promise<string[]>;
|
|
249
|
-
getConfig(scope?: string, seedConfigPath?: string): Promise<ProxyConfig>;
|
|
250
|
-
getAdminConfig(scope?: string): Promise<AdminConfig>;
|
|
251
|
-
listProfiles(scope?: string): Promise<ProxyProfile[]>;
|
|
252
|
-
getActiveProfile(scope?: string, slot?: ModelSlot): Promise<ProxyProfile | null>;
|
|
253
|
-
getResolvedSlotConfig(scope?: string, slot?: ModelSlot): Promise<ResolvedSlotConfig>;
|
|
254
|
-
setActiveProfile(profileId: string, scope?: string, slot?: ModelSlot): Promise<ProxyConfig>;
|
|
255
|
-
upsertProfile(profile: ProxyProfile, scope?: string): Promise<ProxyConfig>;
|
|
256
|
-
updateConfig(update: AdminConfigUpdate, scope?: string): Promise<ProxyConfig>;
|
|
257
|
-
private getScopeConfigPath;
|
|
258
|
-
private sanitizeScope;
|
|
259
|
-
private getSettings;
|
|
260
|
-
private readSettings;
|
|
261
|
-
private isFileNotFoundError;
|
|
262
|
-
private loadScopeSeedSettings;
|
|
263
|
-
private getDefaultScopeSeedPath;
|
|
264
|
-
private normalizeSettings;
|
|
265
|
-
private normalizeProviders;
|
|
266
|
-
private getDefaultSelection;
|
|
267
|
-
private normalizeSlotSelection;
|
|
268
|
-
private normalizeFallbacks;
|
|
269
|
-
private toProxyConfig;
|
|
270
|
-
private resolveSlotConfig;
|
|
271
|
-
private toProfiles;
|
|
272
|
-
private saveSettings;
|
|
273
|
-
}
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region src/services/GatewayService.d.ts
|
|
276
|
-
interface ForwardedResponse {
|
|
277
|
-
status: number;
|
|
278
|
-
body: string;
|
|
279
|
-
headers: Record<string, string>;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Coordinates settings-backed model selection, request forwarding, and scoped history persistence.
|
|
283
|
-
*/
|
|
284
|
-
declare class GatewayService {
|
|
285
|
-
private readonly profileStore;
|
|
286
|
-
private readonly codexAuth;
|
|
287
|
-
private readonly logger;
|
|
288
|
-
private readonly fetchImpl;
|
|
289
|
-
private readonly historyService;
|
|
290
|
-
constructor(profileStore?: ProfileStore, codexAuth?: CodexAuth, logger?: LoggerLike, fetchImpl?: typeof fetch, historyService?: ConversationHistoryService);
|
|
291
|
-
/**
|
|
292
|
-
* Lists all configured profiles for the given scope.
|
|
293
|
-
*/
|
|
294
|
-
listProfiles(scope?: string): Promise<ProxyProfile[]>;
|
|
295
|
-
/**
|
|
296
|
-
* Eagerly seeds the scoped settings file so startup always has a backing config.
|
|
297
|
-
*/
|
|
298
|
-
ensureConfig(scope?: string): Promise<Awaited<ReturnType<ProfileStore['ensureConfig']>>>;
|
|
299
|
-
/**
|
|
300
|
-
* Returns the resolved admin config used by the live HTTP server and UI.
|
|
301
|
-
*/
|
|
302
|
-
getAdminConfig(scope?: string): Promise<AdminConfig>;
|
|
303
|
-
/**
|
|
304
|
-
* Updates the resolved admin config.
|
|
305
|
-
*/
|
|
306
|
-
updateAdminConfig(update: AdminConfigUpdate, scope?: string): Promise<AdminConfig>;
|
|
307
|
-
/**
|
|
308
|
-
* Returns the currently selected profile for a scope/slot pair.
|
|
309
|
-
*/
|
|
310
|
-
getActiveProfile(scope?: string, slot?: ModelSlot): Promise<ProxyProfile | null>;
|
|
311
|
-
/**
|
|
312
|
-
* Creates or updates a profile in the scoped settings file.
|
|
313
|
-
*/
|
|
314
|
-
upsertProfile(profile: ProxyProfile, scope?: string): Promise<Awaited<ReturnType<ProfileStore['upsertProfile']>>>;
|
|
315
|
-
/**
|
|
316
|
-
* Selects the active profile by profile id for the requested slot.
|
|
317
|
-
*/
|
|
318
|
-
setActiveProfile(profileId: string, scope?: string, slot?: ModelSlot): Promise<Awaited<ReturnType<ProfileStore['setActiveProfile']>>>;
|
|
319
|
-
/**
|
|
320
|
-
* Returns the active profile currently used for routing requests.
|
|
321
|
-
*/
|
|
322
|
-
getCurrentModel(scope?: string, slot?: ModelSlot): Promise<ProxyProfile | null>;
|
|
323
|
-
/**
|
|
324
|
-
* Switches the selected model by model name.
|
|
325
|
-
*/
|
|
326
|
-
switchModel(model: string, scope?: string, slot?: ModelSlot): Promise<Awaited<ReturnType<ProfileStore['updateConfig']>>>;
|
|
327
|
-
/**
|
|
328
|
-
* Lists persisted history for a scope.
|
|
329
|
-
*/
|
|
330
|
-
listHistory(scope?: string, limit?: number, cursor?: string): Promise<ConversationHistoryPage>;
|
|
331
|
-
/**
|
|
332
|
-
* Clears persisted history for a scope.
|
|
333
|
-
*/
|
|
334
|
-
clearHistory(scope?: string): Promise<{
|
|
335
|
-
deleted: number;
|
|
336
|
-
}>;
|
|
337
|
-
/**
|
|
338
|
-
* Lists known scopes from config files and stored history.
|
|
339
|
-
*/
|
|
340
|
-
listScopes(): Promise<string[]>;
|
|
341
|
-
/**
|
|
342
|
-
* Returns persisted history stats for a scope.
|
|
343
|
-
*/
|
|
344
|
-
getHistoryStats(scope?: string): Promise<ConversationHistoryStats>;
|
|
345
|
-
/**
|
|
346
|
-
* Returns the current gateway status, auth state, and active slot routing.
|
|
347
|
-
*/
|
|
348
|
-
getStatus(scope?: string, port?: number, pid?: number): Promise<GatewayStatus>;
|
|
349
|
-
/**
|
|
350
|
-
* Returns the OpenAI-compatible model listing served by the proxy.
|
|
351
|
-
*/
|
|
352
|
-
getModels(scope?: string): Promise<{
|
|
353
|
-
object: string;
|
|
354
|
-
data: Array<{
|
|
355
|
-
id: string;
|
|
356
|
-
object: string;
|
|
357
|
-
created: number;
|
|
358
|
-
owned_by: string;
|
|
359
|
-
metadata: Record<string, string>;
|
|
360
|
-
}>;
|
|
361
|
-
}>;
|
|
362
|
-
/**
|
|
363
|
-
* Forwards a Claude-compatible request to the configured upstream Codex endpoint.
|
|
364
|
-
*/
|
|
365
|
-
forwardClaudeRequest(requestBody: string, scope?: string, requestHeaders?: Headers): Promise<ForwardedResponse>;
|
|
366
|
-
private buildAttemptTargets;
|
|
367
|
-
private forwardSingleAttempt;
|
|
368
|
-
private isRecoverableUpstreamError;
|
|
369
|
-
private forwardCodexRequest;
|
|
370
|
-
/**
|
|
371
|
-
* Forwards a Claude-compatible request to the Gemini GenerateContent REST API and translates the result back to Claude SSE.
|
|
372
|
-
*/
|
|
373
|
-
private forwardGeminiDirectRequest;
|
|
374
|
-
private forwardGeminiCodeAssistRequest;
|
|
375
|
-
/**
|
|
376
|
-
* Builds response headers shared by successful SSE responses.
|
|
377
|
-
*/
|
|
378
|
-
private createSuccessHeaders;
|
|
379
|
-
/**
|
|
380
|
-
* Builds the target Gemini REST endpoint for buffered or streaming requests.
|
|
381
|
-
*/
|
|
382
|
-
private createGeminiRequestUrl;
|
|
383
|
-
private createCodeAssistUrl;
|
|
384
|
-
private resolveCodeAssistProjectId;
|
|
385
|
-
private toCodeAssistGenerateContentRequest;
|
|
386
|
-
private normalizeCodeAssistBufferedResponse;
|
|
387
|
-
private normalizeCodeAssistStreamingResponse;
|
|
388
|
-
private extractCodeAssistResponse;
|
|
389
|
-
/**
|
|
390
|
-
* Resolves the logical slot from a Claude model name or configured model mapping.
|
|
391
|
-
*/
|
|
392
|
-
private resolveSlot;
|
|
393
|
-
/**
|
|
394
|
-
* Reconciles a request-specified concrete model with the resolved slot configuration.
|
|
395
|
-
*/
|
|
396
|
-
private resolveRequestedModel;
|
|
397
|
-
/**
|
|
398
|
-
* Forwards a Claude-compatible request to an Anthropic-compatible upstream such as Z.ai.
|
|
399
|
-
*/
|
|
400
|
-
private forwardAnthropicCompatibleRequest;
|
|
401
|
-
/**
|
|
402
|
-
* Resolves the environment-provided auth token for Anthropic-compatible upstreams.
|
|
403
|
-
*/
|
|
404
|
-
private getAnthropicCompatibleAuthToken;
|
|
405
|
-
/**
|
|
406
|
-
* Resolves the request timeout for upstream Anthropic-compatible calls.
|
|
407
|
-
*/
|
|
408
|
-
private resolveUpstreamTimeoutMs;
|
|
409
|
-
private createErrorResponse;
|
|
410
|
-
/**
|
|
411
|
-
* Parses and validates an inbound Claude request.
|
|
412
|
-
*/
|
|
413
|
-
private parseClaudeRequest;
|
|
414
|
-
/**
|
|
415
|
-
* Persists normalized inbound request messages for a proxied call.
|
|
416
|
-
*/
|
|
417
|
-
private recordRequest;
|
|
418
|
-
/**
|
|
419
|
-
* Persists normalized upstream response items or a stream fallback.
|
|
420
|
-
*/
|
|
421
|
-
private recordResponse;
|
|
422
|
-
/**
|
|
423
|
-
* Persists a redacted error record for the request lifecycle.
|
|
424
|
-
*/
|
|
425
|
-
private recordError;
|
|
426
|
-
/**
|
|
427
|
-
* Normalizes Claude system payloads into storable entries.
|
|
428
|
-
*/
|
|
429
|
-
private normalizeSystemPayloads;
|
|
430
|
-
/**
|
|
431
|
-
* Removes proxy-private metadata before sending Claude payloads to strict Anthropic-compatible upstreams.
|
|
432
|
-
*/
|
|
433
|
-
private sanitizeClaudePayloadForAnthropic;
|
|
434
|
-
private stripPrivateChatGptMetadata;
|
|
435
|
-
/**
|
|
436
|
-
* Extracts a message role string when present.
|
|
437
|
-
*/
|
|
438
|
-
private extractRole;
|
|
439
|
-
/**
|
|
440
|
-
* Extracts response output items from upstream SSE payloads for storage.
|
|
441
|
-
*/
|
|
442
|
-
private normalizeResponsePayloads;
|
|
443
|
-
/**
|
|
444
|
-
* Extracts the completed response envelope from an upstream SSE event payload.
|
|
445
|
-
*/
|
|
446
|
-
private extractCompletedResponse;
|
|
447
|
-
/**
|
|
448
|
-
* Redacts large request bodies before they are stored in error history.
|
|
449
|
-
*/
|
|
450
|
-
private summarizePayload;
|
|
451
|
-
}
|
|
452
|
-
//#endregion
|
|
453
|
-
//#region src/server/http.d.ts
|
|
454
|
-
declare function createHttpServer(gatewayService?: GatewayService): Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
|
|
455
|
-
//#endregion
|
|
456
|
-
//#region src/server/index.d.ts
|
|
457
|
-
declare function createServer(gatewayService?: GatewayService, environment?: NodeJS.ProcessEnv): Server;
|
|
458
|
-
//#endregion
|
|
459
|
-
//#region src/transports/stdio.d.ts
|
|
460
|
-
declare class StdioTransportHandler implements TransportHandler {
|
|
461
|
-
private readonly server;
|
|
462
|
-
private transport;
|
|
463
|
-
constructor(server: Server);
|
|
464
|
-
start(): Promise<void>;
|
|
465
|
-
stop(): Promise<void>;
|
|
466
|
-
}
|
|
467
|
-
//#endregion
|
|
468
|
-
export { AdminConfig, AdminConfigUpdate, ConversationHistoryEntry, ConversationHistoryPage, ConversationHistoryService, ConversationHistoryStats, GatewayService, GatewayStatus, GeminiAuthMode, LoggerLike, ModelSlot, ProfileStore, ProviderRuntimeConfig, ProxyConfig, ProxyModelConfig, ProxyProfile, ProxyProviderType, ProxySettings, ReasoningEffort, ResolvedSlotConfig, ScopeConfig, ScopeModelSelection, ScopeSettings, ScopeSlotConfig, StdioTransportHandler, TransportHandler, createHttpServer, createServer };
|