@nuvin/agent-core 0.0.0-rc.0
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/VERSION +4 -0
- package/dist/agent/index.d.ts +19 -0
- package/dist/agent/index.js +1 -0
- package/dist/chunk-C6OLKGP6.js +1 -0
- package/dist/chunk-EJTTW4JQ.js +1 -0
- package/dist/chunk-NYZR4XKO.js +1 -0
- package/dist/chunk-U2BLX7Y5.js +1 -0
- package/dist/chunk-X7VAACWY.js +1 -0
- package/dist/formats/index.d.ts +25 -0
- package/dist/formats/index.js +1 -0
- package/dist/models/index.d.ts +344 -0
- package/dist/models/index.js +1 -0
- package/dist/provider-adapters-BHDQNPHa.d.ts +5 -0
- package/dist/shared/index.d.ts +17 -0
- package/dist/shared/index.js +1 -0
- package/dist/tools/index.d.ts +309 -0
- package/dist/tools/index.js +1 -0
- package/dist/types-BueDJWnx.d.ts +675 -0
- package/package.json +63 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { P as ProviderSessionResolver, p as ResolvedProviderSession, q as ProviderRequestMutator, i as ModelRequest, r as PreparedRequest, j as ChatRequest, s as ProviderCredential, t as EngineChatModel, u as ReasoningConfig, v as ChatResponseChunk, l as ChatResponse, w as ModelExecutionOptions, B as BaseChatModelOptions, x as ModelInfo } from '../types-BueDJWnx.js';
|
|
2
|
+
export { y as ProviderCredentialKind, z as ProviderEndpoints } from '../types-BueDJWnx.js';
|
|
3
|
+
import { t as toOpenAiResponsesRequest } from '../provider-adapters-BHDQNPHa.js';
|
|
4
|
+
|
|
5
|
+
interface PrepareProviderRequestOptions {
|
|
6
|
+
sessionManager?: ProviderSessionManager;
|
|
7
|
+
requestMutators?: ProviderRequestMutator[];
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
}
|
|
10
|
+
declare class ProviderSessionManager {
|
|
11
|
+
private readonly resolver;
|
|
12
|
+
private cached?;
|
|
13
|
+
constructor(resolver: ProviderSessionResolver);
|
|
14
|
+
resolve(signal?: AbortSignal): Promise<ResolvedProviderSession>;
|
|
15
|
+
invalidate(): void;
|
|
16
|
+
}
|
|
17
|
+
declare function prepareProviderRequest(request: ModelRequest, options?: PrepareProviderRequestOptions): Promise<PreparedRequest>;
|
|
18
|
+
|
|
19
|
+
type RoutedModelMode = "complete" | "stream";
|
|
20
|
+
interface ModelSurfaceRouter {
|
|
21
|
+
selectSurface(request: ChatRequest, options: {
|
|
22
|
+
mode: RoutedModelMode;
|
|
23
|
+
}): Promise<string> | string;
|
|
24
|
+
}
|
|
25
|
+
declare class StaticModelSurfaceRouter implements ModelSurfaceRouter {
|
|
26
|
+
private readonly completeSurface;
|
|
27
|
+
private readonly streamSurface;
|
|
28
|
+
constructor(options: {
|
|
29
|
+
complete: string;
|
|
30
|
+
stream: string;
|
|
31
|
+
});
|
|
32
|
+
selectSurface(_request: ChatRequest, options: {
|
|
33
|
+
mode: RoutedModelMode;
|
|
34
|
+
}): string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ModelWebSocket {
|
|
38
|
+
readonly readyState: number;
|
|
39
|
+
addEventListener(type: "close" | "error" | "message" | "open", listener: EventListenerOrEventListenerObject): void;
|
|
40
|
+
close(code?: number, reason?: string): void;
|
|
41
|
+
removeEventListener(type: "close" | "error" | "message" | "open", listener: EventListenerOrEventListenerObject): void;
|
|
42
|
+
send(data: string): void;
|
|
43
|
+
}
|
|
44
|
+
type WebSocketFactory = (options: {
|
|
45
|
+
headers: Record<string, string>;
|
|
46
|
+
url: string;
|
|
47
|
+
}) => ModelWebSocket;
|
|
48
|
+
declare function createDefaultWebSocketFactory(): WebSocketFactory;
|
|
49
|
+
declare function iterateSseEvents(response: Response, signal?: AbortSignal): AsyncGenerator<string>;
|
|
50
|
+
declare function waitForWebSocketOpen(socket: ModelWebSocket, signal?: AbortSignal): Promise<void>;
|
|
51
|
+
declare function iterateWebSocketMessages(socket: ModelWebSocket, signal?: AbortSignal): AsyncIterable<Record<string, unknown>>;
|
|
52
|
+
declare function toWebSocketUrl(baseUrl: string, path: string): string;
|
|
53
|
+
|
|
54
|
+
interface ProviderHeaderContext {
|
|
55
|
+
request?: ChatRequest;
|
|
56
|
+
body?: unknown;
|
|
57
|
+
credential: ProviderCredential;
|
|
58
|
+
session?: ResolvedProviderSession;
|
|
59
|
+
stream: boolean;
|
|
60
|
+
}
|
|
61
|
+
interface ProviderAdapter {
|
|
62
|
+
createHeaders(context: ProviderHeaderContext, options: {
|
|
63
|
+
accept: string;
|
|
64
|
+
includeContentType?: boolean;
|
|
65
|
+
}): Headers | Promise<Headers>;
|
|
66
|
+
createMissingCredentialError(): Error;
|
|
67
|
+
mapApiError(error: Error): Error;
|
|
68
|
+
resolveBaseUrl(defaultBaseUrl: string, session: ResolvedProviderSession | undefined): string;
|
|
69
|
+
resolveCredential(apiKey: string | undefined, session: ResolvedProviderSession | undefined): ProviderCredential | undefined;
|
|
70
|
+
toApiError(response: Response): Promise<Error>;
|
|
71
|
+
}
|
|
72
|
+
declare function trimTrailingSlashes(value: string): string;
|
|
73
|
+
declare function resolveApiCredential(apiKey: string | undefined, session: ResolvedProviderSession | undefined): ProviderCredential | undefined;
|
|
74
|
+
declare function resolveSessionBaseUrl(defaultBaseUrl: string, session: ResolvedProviderSession | undefined): string;
|
|
75
|
+
|
|
76
|
+
interface RoutedModelStreamParser {
|
|
77
|
+
consumeSseEvent?(rawEvent: string): ChatResponseChunk[];
|
|
78
|
+
consumeWebSocketEvent?(event: Record<string, unknown>): ChatResponseChunk[];
|
|
79
|
+
finish(): ChatResponse;
|
|
80
|
+
isDone?(): boolean;
|
|
81
|
+
}
|
|
82
|
+
interface RoutedModelSurfaceRequest {
|
|
83
|
+
accept?: string;
|
|
84
|
+
body?: unknown;
|
|
85
|
+
headers?: Record<string, string>;
|
|
86
|
+
initialEvent?: unknown;
|
|
87
|
+
path?: string;
|
|
88
|
+
url?: string;
|
|
89
|
+
}
|
|
90
|
+
interface RoutedModelSurface {
|
|
91
|
+
id: string;
|
|
92
|
+
transport: "http-json" | "http-sse" | "websocket";
|
|
93
|
+
createRequest(request: ChatRequest): RoutedModelSurfaceRequest;
|
|
94
|
+
createStreamParser?(request: ChatRequest): RoutedModelStreamParser;
|
|
95
|
+
parseResponse?(payload: unknown, request: ChatRequest): ChatResponse;
|
|
96
|
+
}
|
|
97
|
+
interface RoutedModelOptions {
|
|
98
|
+
apiKey?: string;
|
|
99
|
+
baseUrl: string;
|
|
100
|
+
fetch?: typeof globalThis.fetch;
|
|
101
|
+
model: string;
|
|
102
|
+
maxTokens?: number;
|
|
103
|
+
reasoning?: ReasoningConfig;
|
|
104
|
+
providerAdapter: ProviderAdapter;
|
|
105
|
+
providerSessionResolver?: ProviderSessionResolver;
|
|
106
|
+
requestMutators?: ProviderRequestMutator[];
|
|
107
|
+
router: ModelSurfaceRouter;
|
|
108
|
+
sessionManager?: ProviderSessionManager;
|
|
109
|
+
surfaces: RoutedModelSurface[];
|
|
110
|
+
webSocketFactory?: WebSocketFactory;
|
|
111
|
+
}
|
|
112
|
+
declare class RoutedModel implements EngineChatModel {
|
|
113
|
+
readonly model: string;
|
|
114
|
+
readonly maxTokens: number;
|
|
115
|
+
protected readonly reasoning?: ReasoningConfig;
|
|
116
|
+
protected readonly apiKey?: string;
|
|
117
|
+
protected readonly baseUrl: string;
|
|
118
|
+
protected readonly fetchImpl: typeof globalThis.fetch;
|
|
119
|
+
protected readonly providerAdapter: ProviderAdapter;
|
|
120
|
+
protected readonly requestMutators: ProviderRequestMutator[];
|
|
121
|
+
protected readonly router: ModelSurfaceRouter;
|
|
122
|
+
protected readonly sessionManager?: ProviderSessionManager;
|
|
123
|
+
protected readonly webSocketFactory: WebSocketFactory;
|
|
124
|
+
private readonly surfaces;
|
|
125
|
+
constructor(options: RoutedModelOptions);
|
|
126
|
+
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
127
|
+
stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
128
|
+
protected completeViaRouter(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
129
|
+
protected streamViaRouter(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
130
|
+
protected completeViaSurface(request: ChatRequest, surfaceId: string, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
131
|
+
protected streamViaSurface(request: ChatRequest, surfaceId: string, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
132
|
+
protected sendRawRequest(options: {
|
|
133
|
+
accept?: string;
|
|
134
|
+
body?: unknown;
|
|
135
|
+
method: "GET" | "POST";
|
|
136
|
+
path: string;
|
|
137
|
+
signal?: AbortSignal;
|
|
138
|
+
}): Promise<Response>;
|
|
139
|
+
protected createMissingCredentialError(): Error;
|
|
140
|
+
protected createHeaders(context: ProviderHeaderContext, options: {
|
|
141
|
+
accept: string;
|
|
142
|
+
includeContentType?: boolean;
|
|
143
|
+
}): Promise<Headers>;
|
|
144
|
+
protected mapApiError(error: Error): Error;
|
|
145
|
+
protected toApiError(response: Response): Promise<Error>;
|
|
146
|
+
private getSurface;
|
|
147
|
+
private prepareChatRequest;
|
|
148
|
+
protected applyModelDefaults(request: ChatRequest): ChatRequest;
|
|
149
|
+
private sendHttpSurfaceRequest;
|
|
150
|
+
private streamHttpSurface;
|
|
151
|
+
private streamWebSocketSurface;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
interface AnthropicModelOptions extends Partial<BaseChatModelOptions> {
|
|
155
|
+
apiKey?: string;
|
|
156
|
+
baseUrl?: string;
|
|
157
|
+
protocolVersion?: string;
|
|
158
|
+
authScheme?: "bearer" | "x-api-key";
|
|
159
|
+
fetch?: typeof globalThis.fetch;
|
|
160
|
+
providerSessionResolver?: ProviderSessionResolver;
|
|
161
|
+
requestMutators?: ProviderRequestMutator[];
|
|
162
|
+
headerResolver?: AnthropicHeaderResolver;
|
|
163
|
+
}
|
|
164
|
+
interface AnthropicRequestHeadersContext {
|
|
165
|
+
request?: ChatRequest;
|
|
166
|
+
body: unknown;
|
|
167
|
+
credential: ProviderCredential;
|
|
168
|
+
session?: ResolvedProviderSession;
|
|
169
|
+
stream: boolean;
|
|
170
|
+
}
|
|
171
|
+
type AnthropicHeaderResolver = (context: AnthropicRequestHeadersContext) => Promise<Record<string, string>> | Record<string, string>;
|
|
172
|
+
declare class AnthropicModel extends RoutedModel {
|
|
173
|
+
constructor(options?: AnthropicModelOptions);
|
|
174
|
+
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
175
|
+
stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare const ANTHROPIC_MESSAGES_SURFACE = "anthropic-messages";
|
|
179
|
+
declare const ANTHROPIC_MESSAGES_STREAM_SURFACE = "anthropic-messages-stream";
|
|
180
|
+
declare function createAnthropicSurfaces(): RoutedModelSurface[];
|
|
181
|
+
|
|
182
|
+
declare const OPENAI_CHAT_COMPLETIONS_SURFACE = "openai-chat-completions";
|
|
183
|
+
declare const OPENAI_CHAT_COMPLETIONS_STREAM_SURFACE = "openai-chat-completions-stream";
|
|
184
|
+
declare const OPENAI_RESPONSES_SURFACE = "openai-responses";
|
|
185
|
+
declare const OPENAI_RESPONSES_STREAM_SURFACE = "openai-responses-stream";
|
|
186
|
+
declare const OPENAI_RESPONSES_WEBSOCKET_SURFACE = "openai-responses-ws";
|
|
187
|
+
declare class OpenAiApiError extends Error {
|
|
188
|
+
readonly status: number;
|
|
189
|
+
readonly body: string;
|
|
190
|
+
constructor(status: number, body: string, message: string);
|
|
191
|
+
}
|
|
192
|
+
declare class OpenAiResponsesStreamError extends Error {
|
|
193
|
+
readonly code?: string;
|
|
194
|
+
readonly status?: number;
|
|
195
|
+
constructor(message: string, options?: {
|
|
196
|
+
code?: string;
|
|
197
|
+
status?: number;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
declare function createOpenAiResponsesWebSocketEvent(request: ChatRequest, options?: {
|
|
201
|
+
input?: ReturnType<typeof toOpenAiResponsesRequest>["input"];
|
|
202
|
+
previousResponseId?: string;
|
|
203
|
+
}): Record<string, unknown>;
|
|
204
|
+
declare function createOpenAiApiError(response: Response): Promise<OpenAiApiError>;
|
|
205
|
+
declare function createOpenAiResponsesStreamParser(request: ChatRequest): RoutedModelStreamParser;
|
|
206
|
+
declare function createOpenAiSurfaces(options?: {
|
|
207
|
+
chatCompletionsPath?: string;
|
|
208
|
+
responsesPath?: string;
|
|
209
|
+
}): RoutedModelSurface[];
|
|
210
|
+
|
|
211
|
+
interface OpenAiRequestHeadersContext {
|
|
212
|
+
request?: ChatRequest;
|
|
213
|
+
body: unknown;
|
|
214
|
+
credential: ProviderCredential;
|
|
215
|
+
session?: ResolvedProviderSession;
|
|
216
|
+
stream: boolean;
|
|
217
|
+
}
|
|
218
|
+
type OpenAiHeaderResolver = (context: OpenAiRequestHeadersContext) => Promise<Record<string, string>> | Record<string, string>;
|
|
219
|
+
interface OpenAiModelOptions extends Partial<BaseChatModelOptions> {
|
|
220
|
+
apiKey?: string;
|
|
221
|
+
baseUrl?: string;
|
|
222
|
+
chatCompletionsPath?: string;
|
|
223
|
+
responsesPath?: string;
|
|
224
|
+
fetch?: typeof globalThis.fetch;
|
|
225
|
+
providerSessionResolver?: ProviderSessionResolver;
|
|
226
|
+
requestMutators?: ProviderRequestMutator[];
|
|
227
|
+
headerResolver?: OpenAiHeaderResolver;
|
|
228
|
+
sessionManager?: ProviderSessionManager;
|
|
229
|
+
webSocketFactory?: WebSocketFactory;
|
|
230
|
+
}
|
|
231
|
+
declare class OpenAiModel extends RoutedModel {
|
|
232
|
+
private static readonly sharedResponsesSocketSessions;
|
|
233
|
+
protected readonly chatCompletionsPath: string;
|
|
234
|
+
protected readonly responsesPath: string;
|
|
235
|
+
constructor(options?: OpenAiModelOptions);
|
|
236
|
+
protected completeViaChatCompletionsSurface(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
237
|
+
protected completeViaResponsesSurface(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
238
|
+
protected completeViaResponsesWebSocketSurface(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
239
|
+
protected streamViaChatCompletionsSurface(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
240
|
+
protected streamViaResponsesSurface(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
241
|
+
protected streamViaResponsesWebSocketSurface(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
242
|
+
chatComplete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
243
|
+
response(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
244
|
+
responseSocket(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
245
|
+
chatStream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
246
|
+
responseStream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
247
|
+
responseSocketStream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
248
|
+
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
249
|
+
stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
250
|
+
private getResponsesSocketSessionState;
|
|
251
|
+
private getResponsesSocketSessionKey;
|
|
252
|
+
private acquireResponsesSocketLock;
|
|
253
|
+
private prepareResponsesSocketRequest;
|
|
254
|
+
private buildResponsesSocketEvent;
|
|
255
|
+
private findResponsesSocketCheckpoint;
|
|
256
|
+
private shouldRetryResponsesSocketRequest;
|
|
257
|
+
private invalidateResponsesSocketSession;
|
|
258
|
+
private getOrCreateResponsesSocket;
|
|
259
|
+
private streamViaPersistentResponsesSocket;
|
|
260
|
+
private streamViaResponsesSocketAttempt;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
declare const AVAILABLE_CHAT_MODEL_SURFACES: readonly ["anthropic-messages", "openai-chat-completions", "openai-responses", "openai-responses-ws"];
|
|
264
|
+
type ChatModelSurface = (typeof AVAILABLE_CHAT_MODEL_SURFACES)[number];
|
|
265
|
+
type ChatModelAuthScheme = NonNullable<AnthropicModelOptions["authScheme"]>;
|
|
266
|
+
interface ChatModelOptions extends Partial<BaseChatModelOptions> {
|
|
267
|
+
apiKey?: string;
|
|
268
|
+
baseUrl?: string;
|
|
269
|
+
surface?: ChatModelSurface;
|
|
270
|
+
authScheme?: ChatModelAuthScheme;
|
|
271
|
+
fetch?: typeof globalThis.fetch;
|
|
272
|
+
providerSessionResolver?: ProviderSessionResolver;
|
|
273
|
+
requestMutators?: ProviderRequestMutator[];
|
|
274
|
+
headerResolver?: OpenAiHeaderResolver;
|
|
275
|
+
webSocketFactory?: WebSocketFactory;
|
|
276
|
+
}
|
|
277
|
+
declare class ChatModel implements EngineChatModel {
|
|
278
|
+
readonly model: string;
|
|
279
|
+
readonly maxTokens: number;
|
|
280
|
+
readonly surface: ChatModelSurface;
|
|
281
|
+
private readonly anthropicDelegate?;
|
|
282
|
+
private readonly openAiDelegate?;
|
|
283
|
+
constructor(options?: ChatModelOptions);
|
|
284
|
+
private getAnthropicDelegate;
|
|
285
|
+
private getOpenAiDelegate;
|
|
286
|
+
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
287
|
+
stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
type GitHubModelSurface = "auto" | "anthropic-messages" | "openai-chat-completions" | "openai-responses" | "openai-responses-ws";
|
|
291
|
+
interface GitHubModelOptions extends Partial<BaseChatModelOptions> {
|
|
292
|
+
apiKey?: string;
|
|
293
|
+
accessToken?: string;
|
|
294
|
+
baseUrl?: string;
|
|
295
|
+
surface?: GitHubModelSurface;
|
|
296
|
+
githubApiUrl?: string;
|
|
297
|
+
fetch?: typeof globalThis.fetch;
|
|
298
|
+
editorVersion?: string;
|
|
299
|
+
editorPluginVersion?: string;
|
|
300
|
+
tokenExchangeApiVersion?: string;
|
|
301
|
+
providerSessionResolver?: ProviderSessionResolver;
|
|
302
|
+
}
|
|
303
|
+
declare class GitHubModel extends OpenAiModel {
|
|
304
|
+
private readonly anthropicDelegate;
|
|
305
|
+
private readonly modelEndpointCache;
|
|
306
|
+
private readonly surface;
|
|
307
|
+
constructor(options?: GitHubModelOptions);
|
|
308
|
+
protected createMissingCredentialError(): Error;
|
|
309
|
+
private usesResponsesApi;
|
|
310
|
+
private shouldPreferResponsesApi;
|
|
311
|
+
private markModelAsResponsesOnly;
|
|
312
|
+
protected mapApiError(error: Error): Error;
|
|
313
|
+
private completeViaConfiguredSurface;
|
|
314
|
+
private streamViaConfiguredSurface;
|
|
315
|
+
complete(request: ChatRequest, options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
316
|
+
stream(request: ChatRequest, options?: ModelExecutionOptions): AsyncIterable<ChatResponseChunk>;
|
|
317
|
+
getModels(signal?: AbortSignal): Promise<ModelInfo[]>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
interface FetchJsonOptions {
|
|
321
|
+
url: string;
|
|
322
|
+
body: unknown;
|
|
323
|
+
headers: Record<string, string>;
|
|
324
|
+
fetch?: typeof globalThis.fetch;
|
|
325
|
+
signal?: AbortSignal;
|
|
326
|
+
}
|
|
327
|
+
declare function fetchRawResponse(options: FetchJsonOptions): Promise<Response>;
|
|
328
|
+
declare function fetchJsonResponse<T>(options: FetchJsonOptions): Promise<T>;
|
|
329
|
+
|
|
330
|
+
interface MockModelOptions {
|
|
331
|
+
model?: string;
|
|
332
|
+
maxTokens?: number;
|
|
333
|
+
reasoning?: ReasoningConfig;
|
|
334
|
+
}
|
|
335
|
+
declare class MockModel implements EngineChatModel {
|
|
336
|
+
readonly model: string;
|
|
337
|
+
readonly maxTokens: number;
|
|
338
|
+
readonly requests: ChatRequest[];
|
|
339
|
+
private readonly reasoning?;
|
|
340
|
+
constructor(options?: MockModelOptions);
|
|
341
|
+
complete(request: ChatRequest, _options?: ModelExecutionOptions): Promise<ChatResponse>;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export { ANTHROPIC_MESSAGES_STREAM_SURFACE, ANTHROPIC_MESSAGES_SURFACE, AVAILABLE_CHAT_MODEL_SURFACES, type AnthropicHeaderResolver, AnthropicModel, type AnthropicModelOptions, type AnthropicRequestHeadersContext, ChatModel, type ChatModelAuthScheme, type ChatModelOptions, type ChatModelSurface, type FetchJsonOptions, GitHubModel, type GitHubModelOptions, type GitHubModelSurface, MockModel, type MockModelOptions, type ModelSurfaceRouter, type ModelWebSocket, OPENAI_CHAT_COMPLETIONS_STREAM_SURFACE, OPENAI_CHAT_COMPLETIONS_SURFACE, OPENAI_RESPONSES_STREAM_SURFACE, OPENAI_RESPONSES_SURFACE, OPENAI_RESPONSES_WEBSOCKET_SURFACE, OpenAiApiError, type OpenAiHeaderResolver, OpenAiModel, type OpenAiModelOptions, type OpenAiRequestHeadersContext, OpenAiResponsesStreamError, type PrepareProviderRequestOptions, type ProviderAdapter, ProviderCredential, type ProviderHeaderContext, ProviderRequestMutator, ProviderSessionManager, ProviderSessionResolver, ResolvedProviderSession, RoutedModel, type RoutedModelMode, type RoutedModelOptions, type RoutedModelStreamParser, type RoutedModelSurface, type RoutedModelSurfaceRequest, StaticModelSurfaceRouter, type WebSocketFactory, createAnthropicSurfaces, createDefaultWebSocketFactory, createOpenAiApiError, createOpenAiResponsesStreamParser, createOpenAiResponsesWebSocketEvent, createOpenAiSurfaces, fetchJsonResponse, fetchRawResponse, iterateSseEvents, iterateWebSocketMessages, prepareProviderRequest, resolveApiCredential, resolveSessionBaseUrl, toWebSocketUrl, trimTrailingSlashes, waitForWebSocketOpen };
|