@alvin0/ai-agent-sdk-provider-http 0.1.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/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/index.d.ts +641 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1757 -0
- package/dist/index.js.map +1 -0
- package/package.json +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
import { GenerateOptions, ModelAdapter, ModelError, ModelInfo, ModelInvocationContext, ModelModality, ModelReasoningInfo, NativeToolName, PreparedAdapterCall, ProviderInfo, ProviderRequestId, ResolvedModelInfo, ResolvedRetryPolicy, RetryPolicyConfig, StreamChunk, UsageCounters } from "@alvin0/ai-agent-sdk-core";
|
|
2
|
+
import { CredentialInput, GenerateOptions as GenerateOptions$1, ModelInvocationContext as ModelInvocationContext$1, ResolvedModelInfo as ResolvedModelInfo$1, RetryPolicyConfig as RetryPolicyConfig$1, StreamChunk as StreamChunk$1, UsageCounters as UsageCounters$1 } from "@alvin0/ai-agent-sdk-core/provider";
|
|
3
|
+
//#region src/stream/sse.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Decode an SSE byte stream into events.
|
|
6
|
+
*
|
|
7
|
+
* All the genuinely hard framing work Echunk reassembly, UTF-8 sequences split
|
|
8
|
+
* across reads, CRLF and BOM handling, comment and unknown-field skipping,
|
|
9
|
+
* joining multiple `data:` lines of one event Ebelongs to `eventsource-parser`.
|
|
10
|
+
*
|
|
11
|
+
* Note what is deliberately NOT decided here. OpenAI terminates with a literal
|
|
12
|
+
* `data: [DONE]` sentinel; Anthropic terminates with a named `message_stop` event
|
|
13
|
+
* and sends no sentinel at all. Baking in either rule would make the parser lie
|
|
14
|
+
* about the other, so termination is the adapter's call and this generator simply
|
|
15
|
+
* runs to the end of the body.
|
|
16
|
+
*
|
|
17
|
+
* The callback-based parser is used rather than `EventSourceParserStream` so the
|
|
18
|
+
* SDK does not require `TextDecoderStream` to exist Eit is absent on some
|
|
19
|
+
* runtimes this package should still work on.
|
|
20
|
+
*
|
|
21
|
+
* @module @alvin0/ai-agent-sdk-provider-http/sse
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Ceiling on characters the parser may buffer across reads.
|
|
25
|
+
*
|
|
26
|
+
* A stream that never sends an event terminator would otherwise buffer without
|
|
27
|
+
* bound. 1 MiB is far above any legitimate single SSE event from either provider
|
|
28
|
+
* and far below a memory problem.
|
|
29
|
+
*/
|
|
30
|
+
/** One decoded server-sent event. */
|
|
31
|
+
interface SseEvent {
|
|
32
|
+
/**
|
|
33
|
+
* The event name, or `undefined` when the server declared none.
|
|
34
|
+
*
|
|
35
|
+
* NOT defaulted to `'message'` the way a browser `EventSource` would. Absence is
|
|
36
|
+
* reported faithfully, which is what lets an adapter tell Anthropic's named
|
|
37
|
+
* events apart from OpenAI's anonymous data-only frames.
|
|
38
|
+
*/
|
|
39
|
+
event: string | undefined;
|
|
40
|
+
/** The event's data payload. */
|
|
41
|
+
data: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parse an SSE byte stream into events, in arrival order.
|
|
45
|
+
*
|
|
46
|
+
* Framing is spec-strict: an event dispatches only on its blank-line terminator,
|
|
47
|
+
* so an unterminated tail at EOF is truncation rather than a flushable payload.
|
|
48
|
+
* @param stream - raw SSE bytes, as `Response.body` provides them. Reads may split
|
|
49
|
+
* anywhere, including mid-codepoint; the streaming decoder handles that.
|
|
50
|
+
* @param onActivity - called on every frame INCLUDING comments. Providers send
|
|
51
|
+
* comment-only keepalives during long pauses, so a liveness watchdog has to
|
|
52
|
+
* count them as activity even though they carry no data.
|
|
53
|
+
* @returns each event in arrival order; returns normally at end of body.
|
|
54
|
+
*/
|
|
55
|
+
declare function parseSse(stream: ReadableStream<Uint8Array>, onActivity?: () => void, teardownTimeoutMs?: number): AsyncGenerator<SseEvent>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/stream/types.d.ts
|
|
58
|
+
/** Protocol output before untrusted usage crosses the transport validator. */
|
|
59
|
+
type ProviderProtocolChunk = Exclude<StreamChunk, {
|
|
60
|
+
readonly type: 'usage';
|
|
61
|
+
}> | {
|
|
62
|
+
readonly type: 'usage';
|
|
63
|
+
readonly usage: UsageCounters;
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/base/transport.d.ts
|
|
67
|
+
declare function redactHeaders(headers: Readonly<Record<string, string>>, sensitiveHeaderNames?: readonly string[]): Record<string, string>;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/base/http-adapter.d.ts
|
|
70
|
+
/** Default idle bound: five minutes without a single byte is a hung stream. */
|
|
71
|
+
declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 300000;
|
|
72
|
+
/** Default end-to-end bound once provider request construction begins. */
|
|
73
|
+
declare const DEFAULT_REQUEST_TIMEOUT_MS: number;
|
|
74
|
+
/** Default serialized request ceiling. */
|
|
75
|
+
declare const DEFAULT_MAX_REQUEST_BYTES: number;
|
|
76
|
+
/** Default cumulative successful response-body ceiling. */
|
|
77
|
+
declare const DEFAULT_MAX_RESPONSE_BYTES: number;
|
|
78
|
+
/** Default number of raw response chunks accepted from one request. */
|
|
79
|
+
declare const DEFAULT_MAX_RESPONSE_CHUNKS = 100000;
|
|
80
|
+
/** Default error body retained for classification and diagnostics. */
|
|
81
|
+
declare const DEFAULT_MAX_ERROR_BODY_BYTES: number;
|
|
82
|
+
/** Default diagnostic observer deadline; logging must never gate dispatch indefinitely. */
|
|
83
|
+
declare const DEFAULT_REQUEST_LOGGER_TIMEOUT_MS = 5000;
|
|
84
|
+
/** One model a provider's configuration advertises. */
|
|
85
|
+
interface ProviderCatalogModel {
|
|
86
|
+
/** Wire model id, passed to the provider verbatim. */
|
|
87
|
+
id: string;
|
|
88
|
+
/** Selector label; defaults to {@link id}. */
|
|
89
|
+
name?: string;
|
|
90
|
+
/** Optional detail distinguishing similar variants. */
|
|
91
|
+
description?: string;
|
|
92
|
+
/** Combined request/response capacity, when known. */
|
|
93
|
+
contextWindow?: number;
|
|
94
|
+
/** Per-request output cap for this model. */
|
|
95
|
+
maxTokens?: number;
|
|
96
|
+
/** Accepted request modalities; omission is treated as text-only. */
|
|
97
|
+
inputModalities?: readonly ModelModality[];
|
|
98
|
+
/** Modalities this model route may return. */
|
|
99
|
+
outputModalities?: readonly ModelModality[];
|
|
100
|
+
/** Provider-native tools explicitly supported; omission means unknown. */
|
|
101
|
+
nativeTools?: readonly NativeToolName[];
|
|
102
|
+
/** Reasoning levels this model offers, when any. */
|
|
103
|
+
reasoning?: ModelReasoningInfo;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Everything needed to issue ONE request, captured as a single snapshot.
|
|
107
|
+
*
|
|
108
|
+
* The snapshot exists to close a specific gap: if the endpoint and the credential
|
|
109
|
+
* were read separately, a configuration change between the two reads would send
|
|
110
|
+
* one generation's secret to another generation's URL. Reading them together, once
|
|
111
|
+
* per call, makes that impossible.
|
|
112
|
+
*/
|
|
113
|
+
interface HttpConnection {
|
|
114
|
+
/** Endpoint base; the provider's {@link HttpModelAdapter.endpointPath} is appended. */
|
|
115
|
+
readonly baseUrl: string;
|
|
116
|
+
/**
|
|
117
|
+
* Every header for the request, INCLUDING authorization.
|
|
118
|
+
*
|
|
119
|
+
* Resolved in `connect()` so the credential travels with the endpoint it will
|
|
120
|
+
* be sent to. The base pipeline adds attribution and `accept` on top.
|
|
121
|
+
*/
|
|
122
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
123
|
+
/** Auth-produced names that must be redacted regardless of spelling. */
|
|
124
|
+
readonly sensitiveHeaderNames?: readonly string[];
|
|
125
|
+
/** Maximum idle interval while a read is outstanding. */
|
|
126
|
+
readonly streamIdleTimeoutMs: number;
|
|
127
|
+
/** End-to-end request/stream timeout. */
|
|
128
|
+
readonly requestTimeoutMs?: number;
|
|
129
|
+
/** Maximum serialized outbound request bytes. */
|
|
130
|
+
readonly maxRequestBytes?: number;
|
|
131
|
+
/** Maximum cumulative successful response bytes. */
|
|
132
|
+
readonly maxResponseBytes?: number;
|
|
133
|
+
/** Maximum raw chunks accepted from a successful response. */
|
|
134
|
+
readonly maxResponseChunks?: number;
|
|
135
|
+
/** Maximum decoded SSE events accepted from one response. */
|
|
136
|
+
readonly maxSseEvents?: number;
|
|
137
|
+
/** Maximum characters accepted in one decoded SSE event. */
|
|
138
|
+
readonly maxSseEventChars?: number;
|
|
139
|
+
/** Maximum bytes read from a non-success response. */
|
|
140
|
+
readonly maxErrorBodyBytes?: number;
|
|
141
|
+
/** Maximum time granted to the optional request logger. */
|
|
142
|
+
readonly requestLoggerTimeoutMs?: number;
|
|
143
|
+
/** Permit cleartext HTTP explicitly, for trusted local development endpoints only. */
|
|
144
|
+
readonly allowInsecureHttp?: boolean;
|
|
145
|
+
/** Captured fetch implementation; omission uses the platform global. */
|
|
146
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
147
|
+
/** Retry policy this route owns. */
|
|
148
|
+
readonly retryPolicy: ResolvedRetryPolicy;
|
|
149
|
+
/** Advisory catalog; requests are never restricted to it. */
|
|
150
|
+
readonly models: readonly ProviderCatalogModel[];
|
|
151
|
+
/** Output cap applied when neither the caller nor the model entry names one. */
|
|
152
|
+
readonly defaultMaxTokens: number;
|
|
153
|
+
/** Context capacity used when the selected model has no exact value. */
|
|
154
|
+
readonly defaultContextWindow: number;
|
|
155
|
+
}
|
|
156
|
+
/** What {@link HttpModelAdapter.buildBody} and `translate` receive. */
|
|
157
|
+
interface ProviderRequest {
|
|
158
|
+
/** The normalized request, with registry-resolved defaults already applied. */
|
|
159
|
+
readonly options: GenerateOptions;
|
|
160
|
+
/** Exact model metadata for this call. */
|
|
161
|
+
readonly model: ResolvedModelInfo;
|
|
162
|
+
/** The connection snapshot this call is bound to. */
|
|
163
|
+
readonly connection: HttpConnection;
|
|
164
|
+
/** Output cap to send; always resolved to a number, which some APIs require. */
|
|
165
|
+
readonly maxTokens: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* One exact wire request observed immediately before the shared pipeline calls `fetch`.
|
|
169
|
+
* @deprecated High-risk compatibility diagnostics; prefer structured observation.
|
|
170
|
+
*/
|
|
171
|
+
interface ProviderRequestLogRecord {
|
|
172
|
+
/** Version of this durable/debug record shape. */
|
|
173
|
+
readonly schemaVersion: 1;
|
|
174
|
+
readonly type: 'provider-request';
|
|
175
|
+
/** Locally generated correlation id; providers may assign a different id later. */
|
|
176
|
+
readonly id: string;
|
|
177
|
+
readonly timestamp: string;
|
|
178
|
+
readonly provider: string;
|
|
179
|
+
readonly model: string;
|
|
180
|
+
readonly method: 'POST';
|
|
181
|
+
readonly url: string;
|
|
182
|
+
/** Request headers with credentials and cookies replaced by `[REDACTED]`. */
|
|
183
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
184
|
+
/** Exact protocol-serialized JSON body. This may contain prompts and tool output. */
|
|
185
|
+
readonly body: unknown;
|
|
186
|
+
readonly bodyBytes: number;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Optional observer for exact provider-wire requests.
|
|
190
|
+
* @deprecated High-risk compatibility diagnostics; prefer structured observation.
|
|
191
|
+
*/
|
|
192
|
+
type ProviderRequestLogger = (record: ProviderRequestLogRecord) => Promise<void> | void;
|
|
193
|
+
/** Base for every HTTP provider adapter in this package. */
|
|
194
|
+
declare abstract class HttpModelAdapter extends ModelAdapter {
|
|
195
|
+
/** Human-readable provider name reported by {@link providerInfo}. */
|
|
196
|
+
protected abstract readonly displayName: string;
|
|
197
|
+
/**
|
|
198
|
+
* Capture the connection facts for one operation.
|
|
199
|
+
*
|
|
200
|
+
* Called once per operation and never re-read mid-request. Resolve the
|
|
201
|
+
* credential here, together with the endpoint.
|
|
202
|
+
* @param provider - the route being served.
|
|
203
|
+
* @param signal - cancellation for any I/O this resolution performs.
|
|
204
|
+
*/
|
|
205
|
+
protected abstract connect(provider: string, signal?: AbortSignal, context?: ModelInvocationContext): Promise<HttpConnection>;
|
|
206
|
+
/** Path appended to {@link HttpConnection.baseUrl}, e.g. `/v1/messages`. */
|
|
207
|
+
protected abstract endpointPath(request: ProviderRequest): string;
|
|
208
|
+
/** Convert the normalized request into this provider's wire JSON. */
|
|
209
|
+
protected abstract buildBody(request: ProviderRequest): Promise<unknown> | unknown;
|
|
210
|
+
/**
|
|
211
|
+
* Convert this provider's SSE events into the SDK's chunk protocol.
|
|
212
|
+
*
|
|
213
|
+
* Owns termination: this generator decides what ends the stream (a `[DONE]`
|
|
214
|
+
* sentinel, a named terminal event, or end of body) and must raise
|
|
215
|
+
* `STREAM_CLOSED` when the body ends before the provider said it was finished.
|
|
216
|
+
*/
|
|
217
|
+
protected abstract translate(events: AsyncIterable<SseEvent>, request: ProviderRequest): AsyncGenerator<ProviderProtocolChunk>;
|
|
218
|
+
/**
|
|
219
|
+
* Extra headers merged in by the base pipeline. Override to change `accept`.
|
|
220
|
+
* @returns headers applied beneath {@link HttpConnection.headers}.
|
|
221
|
+
*/
|
|
222
|
+
protected baseHeaders(): Record<string, string>;
|
|
223
|
+
/**
|
|
224
|
+
* Observe an exact, credential-redacted wire request before dispatch.
|
|
225
|
+
*
|
|
226
|
+
* The default is a no-op so library users do not silently persist prompts.
|
|
227
|
+
* Implementations should treat this as diagnostics, not a dispatch veto.
|
|
228
|
+
* @deprecated High-risk compatibility diagnostics; prefer structured observation.
|
|
229
|
+
*/
|
|
230
|
+
protected observeRequest(_record: ProviderRequestLogRecord): Promise<void> | void;
|
|
231
|
+
/**
|
|
232
|
+
* Map a non-2xx response to a stable code. Override only to add codes this
|
|
233
|
+
* provider reports that the shared mapping cannot infer from the status.
|
|
234
|
+
*/
|
|
235
|
+
protected providerErrorCode(status: number, detail: string): string;
|
|
236
|
+
providerInfo(provider: string): ProviderInfo;
|
|
237
|
+
listModels(provider: string, signal?: AbortSignal): Promise<readonly ModelInfo[]>;
|
|
238
|
+
resolveModel(provider: string, model: string, signal?: AbortSignal): Promise<ResolvedModelInfo>;
|
|
239
|
+
prepareCall(provider: string, model: string, signal?: AbortSignal, context?: ModelInvocationContext): Promise<PreparedAdapterCall>;
|
|
240
|
+
/**
|
|
241
|
+
* Stream one model call.
|
|
242
|
+
*
|
|
243
|
+
* Intentionally NOT an extension point — see the module note. Providers
|
|
244
|
+
* customize behaviour through the abstract members instead.
|
|
245
|
+
*/
|
|
246
|
+
stream(options: GenerateOptions, context?: ModelInvocationContext): AsyncIterable<StreamChunk>;
|
|
247
|
+
/** Resolve a connection first, for the un-prepared entry point. */
|
|
248
|
+
private runResolving;
|
|
249
|
+
/** Resolve exact-model metadata from the catalog, falling back to config defaults. */
|
|
250
|
+
protected modelInfoFor(connection: HttpConnection, provider: string, model: string): ResolvedModelInfo;
|
|
251
|
+
/** Decorate resolved metadata without reopening the captured connection generation. */
|
|
252
|
+
protected decorateModel(info: ResolvedModelInfo, _connection: HttpConnection): ResolvedModelInfo;
|
|
253
|
+
/** Capture legacy subclass transport/auth layers once; configured adapters already return all five. */
|
|
254
|
+
private captureConnection;
|
|
255
|
+
/**
|
|
256
|
+
* The shared pipeline: guard, build, send, classify, decode, bound, translate.
|
|
257
|
+
*/
|
|
258
|
+
private run;
|
|
259
|
+
private prepareWireBody;
|
|
260
|
+
/** Turn a non-2xx response into a fully populated {@link ModelError}. */
|
|
261
|
+
private httpFailure;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/base/http-errors.d.ts
|
|
265
|
+
/**
|
|
266
|
+
* Map an HTTP status plus whatever the provider said into a stable code.
|
|
267
|
+
*
|
|
268
|
+
* `detail` should be the provider's error `code`, `type`, and `message` joined
|
|
269
|
+
* into one string — the wording classifiers need all three because providers
|
|
270
|
+
* disagree about which field carries the useful part.
|
|
271
|
+
* @param status - status of a non-2xx response.
|
|
272
|
+
* @param detail - provider error text, joined; empty string when the body was unparseable.
|
|
273
|
+
* @returns the normalized code.
|
|
274
|
+
*/
|
|
275
|
+
declare function httpErrorCode(status: number, detail?: string): string;
|
|
276
|
+
/**
|
|
277
|
+
* Parse a `retry-after` header into milliseconds.
|
|
278
|
+
*
|
|
279
|
+
* The header comes in two forms — delta-seconds and an HTTP date — and both are
|
|
280
|
+
* used in practice. A date already in the past yields `undefined` rather than a
|
|
281
|
+
* negative delay.
|
|
282
|
+
* @param value - the raw header value, or `null` when absent.
|
|
283
|
+
* @returns a positive finite delay, or `undefined` when absent or unusable.
|
|
284
|
+
*/
|
|
285
|
+
declare function retryAfterMs(value: string | null): number | undefined;
|
|
286
|
+
/**
|
|
287
|
+
* Extract a provider request id for diagnostics.
|
|
288
|
+
*
|
|
289
|
+
* Worth capturing even though nothing programmatic reads it: when a provider is
|
|
290
|
+
* misbehaving, this id is what their support needs to find the request.
|
|
291
|
+
* @param headers - the response headers.
|
|
292
|
+
* @returns the first non-empty id found, or `undefined`.
|
|
293
|
+
*/
|
|
294
|
+
declare function requestIdFrom(headers: Headers): ProviderRequestId | undefined;
|
|
295
|
+
/** A provider error body reduced to the two things this SDK needs. */
|
|
296
|
+
interface ParsedErrorBody {
|
|
297
|
+
/** Best human-readable message found, or `undefined` to fall back to the status. */
|
|
298
|
+
message: string | undefined;
|
|
299
|
+
/** Provider `code`/`type`/`message` joined, for the wording classifiers. */
|
|
300
|
+
detail: string;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Reduce a provider error body to a message and a classifier detail string.
|
|
304
|
+
*
|
|
305
|
+
* Handles the two shapes both providers use — `{error: {...}}` and a bare
|
|
306
|
+
* `{type, message}` — and tolerates a body that is not JSON at all, which is what
|
|
307
|
+
* a gateway or load balancer in front of the provider will return.
|
|
308
|
+
* @param raw - the response body as text.
|
|
309
|
+
* @returns the message and joined detail.
|
|
310
|
+
*/
|
|
311
|
+
declare function parseErrorBody(raw: string): ParsedErrorBody;
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/common/config.d.ts
|
|
314
|
+
/** Runtime wire-protocol contract version supported by this package. */
|
|
315
|
+
declare const HTTP_PROTOCOL_API_VERSION: 1;
|
|
316
|
+
/** Stable support-safe errors owned by the runtime HTTP extension path. */
|
|
317
|
+
declare const HTTP_PROVIDER_ERROR_CODES: Readonly<{
|
|
318
|
+
readonly PROTOCOL_API_UNSUPPORTED: 'HTTP_PROTOCOL_API_UNSUPPORTED';
|
|
319
|
+
readonly HEADER_INVALID: 'HTTP_HEADER_INVALID';
|
|
320
|
+
readonly HEADER_RESERVED: 'HTTP_HEADER_RESERVED';
|
|
321
|
+
readonly HEADER_COLLISION: 'HTTP_HEADER_COLLISION';
|
|
322
|
+
readonly WIRE_BODY_INVALID: 'HTTP_WIRE_BODY_INVALID';
|
|
323
|
+
readonly WIRE_BODY_TOO_LARGE: 'HTTP_WIRE_BODY_TOO_LARGE';
|
|
324
|
+
readonly STREAM_MEDIA_TYPE_INVALID: 'HTTP_STREAM_MEDIA_TYPE_INVALID';
|
|
325
|
+
readonly SSE_LIMIT_EXCEEDED: 'HTTP_SSE_LIMIT_EXCEEDED';
|
|
326
|
+
readonly REDIRECT_REJECTED: 'HTTP_REDIRECT_REJECTED';
|
|
327
|
+
}>;
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region src/protocol/runtime-types.d.ts
|
|
330
|
+
interface ProtocolSseEvent {
|
|
331
|
+
readonly event: string | undefined;
|
|
332
|
+
readonly data: string;
|
|
333
|
+
}
|
|
334
|
+
type ProtocolStreamChunk = Exclude<StreamChunk$1, {
|
|
335
|
+
readonly type: 'usage';
|
|
336
|
+
}> | {
|
|
337
|
+
readonly type: 'usage';
|
|
338
|
+
readonly usage: UsageCounters$1;
|
|
339
|
+
};
|
|
340
|
+
interface ProtocolRequest {
|
|
341
|
+
readonly options: GenerateOptions$1;
|
|
342
|
+
readonly model: ResolvedModelInfo$1;
|
|
343
|
+
readonly connection: HttpConnection;
|
|
344
|
+
readonly maxTokens: number;
|
|
345
|
+
}
|
|
346
|
+
/** Versioned executable protocol accepted by the runtime HTTP adapter. */
|
|
347
|
+
interface RuntimeWireProtocol<Dialect extends object> {
|
|
348
|
+
readonly kind: 'http-wire-protocol';
|
|
349
|
+
readonly apiVersion: typeof HTTP_PROTOCOL_API_VERSION;
|
|
350
|
+
readonly id: string;
|
|
351
|
+
readonly defaultDialect: Dialect;
|
|
352
|
+
readonly endpointPath: (request: ProtocolRequest, dialect: Dialect) => string;
|
|
353
|
+
readonly protocolHeaders?: (dialect: Dialect) => Readonly<Record<string, string>>;
|
|
354
|
+
readonly serialize: (request: ProtocolRequest, dialect: Dialect) => Readonly<Record<string, unknown>>;
|
|
355
|
+
readonly translate: (events: AsyncIterable<ProtocolSseEvent>, request: ProtocolRequest, displayName: string) => AsyncGenerator<ProtocolStreamChunk>;
|
|
356
|
+
}
|
|
357
|
+
type WireProtocolDefinition<Dialect extends object> = Omit<RuntimeWireProtocol<Dialect>, 'kind' | 'apiVersion'>;
|
|
358
|
+
interface HttpAuthResolveOptions {
|
|
359
|
+
readonly provider: string;
|
|
360
|
+
readonly baseUrl: URL;
|
|
361
|
+
readonly signal: AbortSignal;
|
|
362
|
+
readonly context?: ModelInvocationContext$1;
|
|
363
|
+
}
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/protocol/definition.d.ts
|
|
366
|
+
/**
|
|
367
|
+
* Stamp a protocol definition without allocating transport state or performing I/O.
|
|
368
|
+
* All executable properties are captured once and retain the author's receiver.
|
|
369
|
+
*/
|
|
370
|
+
declare function defineWireProtocol<Dialect extends object>(definition: WireProtocolDefinition<Dialect>): RuntimeWireProtocol<Dialect>;
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/protocol/protocol.d.ts
|
|
373
|
+
/** A protocol may report partial/untrusted usage before transport validation. */
|
|
374
|
+
type WireProtocolChunk = ProviderProtocolChunk;
|
|
375
|
+
/**
|
|
376
|
+
* One wire protocol.
|
|
377
|
+
*
|
|
378
|
+
* `Dialect` is the protocol's own knob record — the per-endpoint variations that
|
|
379
|
+
* change which optional fields are sent without changing any behaviour. Keeping it
|
|
380
|
+
* a type parameter means an endpoint can override exactly the knobs its protocol
|
|
381
|
+
* defines and nothing else.
|
|
382
|
+
*/
|
|
383
|
+
interface WireProtocol<Dialect> {
|
|
384
|
+
/** Stable identifier, used in diagnostics and to name the protocol in config. */
|
|
385
|
+
readonly id: string;
|
|
386
|
+
/**
|
|
387
|
+
* Knob defaults.
|
|
388
|
+
*
|
|
389
|
+
* An endpoint supplies a partial override, so a new knob can be added to a
|
|
390
|
+
* protocol without touching any endpoint that does not care about it.
|
|
391
|
+
*/
|
|
392
|
+
readonly defaultDialect: Dialect;
|
|
393
|
+
/** Path appended to the endpoint's base URL. */
|
|
394
|
+
endpointPath(request: ProviderRequest, dialect: Dialect): string;
|
|
395
|
+
/**
|
|
396
|
+
* Headers the PROTOCOL requires, as opposed to the ones authentication supplies.
|
|
397
|
+
*
|
|
398
|
+
* `anthropic-version` is the motivating case: it is mandatory on every request
|
|
399
|
+
* to that API regardless of which endpoint or credential is used, so it belongs
|
|
400
|
+
* to the protocol rather than being copied into each endpoint's config.
|
|
401
|
+
*/
|
|
402
|
+
protocolHeaders?(dialect: Dialect): Record<string, string>;
|
|
403
|
+
/** Normalized request to this protocol's wire JSON. */
|
|
404
|
+
serialize(request: ProviderRequest, dialect: Dialect): unknown | Promise<unknown>;
|
|
405
|
+
/**
|
|
406
|
+
* This protocol's SSE events to the SDK's chunk protocol.
|
|
407
|
+
*
|
|
408
|
+
* Owns termination: it decides what ends the stream and must raise
|
|
409
|
+
* `STREAM_CLOSED` when the body ends before the provider said it was finished.
|
|
410
|
+
*/
|
|
411
|
+
translate(events: AsyncIterable<SseEvent>, request: ProviderRequest, displayName: string): AsyncGenerator<WireProtocolChunk>;
|
|
412
|
+
}
|
|
413
|
+
/** Any protocol, when the dialect type does not matter to the holder. */
|
|
414
|
+
type AnyWireProtocol = WireProtocol<never>;
|
|
415
|
+
/**
|
|
416
|
+
* Merge an endpoint's partial dialect over a protocol's defaults.
|
|
417
|
+
*
|
|
418
|
+
* `undefined` entries are dropped rather than applied, so an override object built
|
|
419
|
+
* with optional fields cannot accidentally erase a default.
|
|
420
|
+
* @param protocol - the protocol supplying defaults.
|
|
421
|
+
* @param overrides - the endpoint's partial override.
|
|
422
|
+
* @returns the effective, frozen dialect.
|
|
423
|
+
*/
|
|
424
|
+
declare function resolveDialect<Dialect extends object>(protocol: WireProtocol<Dialect>, overrides: Partial<Dialect> | undefined): Dialect;
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region src/configurable/http-provider.d.ts
|
|
427
|
+
/** A credential, either literal or resolved per operation. */
|
|
428
|
+
type CredentialSource = string | ((signal?: AbortSignal, context?: ModelInvocationContext) => string | Promise<string>);
|
|
429
|
+
/**
|
|
430
|
+
* How requests are authenticated.
|
|
431
|
+
*
|
|
432
|
+
* `dynamic` is the escape hatch that keeps OAuth out of subclass territory: it is
|
|
433
|
+
* called once per operation, so it can refresh a token, read a rotating secret, or
|
|
434
|
+
* add account-scoping headers.
|
|
435
|
+
*/
|
|
436
|
+
type AuthScheme =
|
|
437
|
+
/** Unauthenticated — a local server, or an endpoint behind a network boundary. */
|
|
438
|
+
{
|
|
439
|
+
kind: 'none';
|
|
440
|
+
} |
|
|
441
|
+
/** `authorization: Bearer <token>`. */
|
|
442
|
+
{
|
|
443
|
+
kind: 'bearer';
|
|
444
|
+
token: CredentialSource;
|
|
445
|
+
label?: string;
|
|
446
|
+
} |
|
|
447
|
+
/** A named header, e.g. `x-api-key`. */
|
|
448
|
+
{
|
|
449
|
+
kind: 'header';
|
|
450
|
+
name: string;
|
|
451
|
+
value: CredentialSource;
|
|
452
|
+
label?: string;
|
|
453
|
+
} |
|
|
454
|
+
/** Arbitrary headers resolved per operation. */
|
|
455
|
+
{
|
|
456
|
+
kind: 'dynamic';
|
|
457
|
+
resolve: (signal?: AbortSignal, context?: ModelInvocationContext, provider?: string) => Record<string, string> | Promise<Record<string, string>>;
|
|
458
|
+
};
|
|
459
|
+
/** What a model-discovery hook receives. */
|
|
460
|
+
interface ModelDiscoveryContext {
|
|
461
|
+
/** The endpoint base, with no trailing slash. */
|
|
462
|
+
readonly baseUrl: string;
|
|
463
|
+
/** Every header the request would carry, including authentication. */
|
|
464
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
465
|
+
readonly signal?: AbortSignal;
|
|
466
|
+
/** Additive runtime context; legacy discovery hooks may ignore it. */
|
|
467
|
+
readonly provider?: string;
|
|
468
|
+
/** Additive invocation context; legacy discovery hooks may ignore it. */
|
|
469
|
+
readonly context?: ModelInvocationContext;
|
|
470
|
+
}
|
|
471
|
+
/** Configuration for {@link createHttpProvider}. */
|
|
472
|
+
interface HttpProviderOptions<Dialect extends object> {
|
|
473
|
+
/** Human-readable name used in every diagnostic. */
|
|
474
|
+
displayName: string;
|
|
475
|
+
/** The wire protocol this endpoint speaks. */
|
|
476
|
+
protocol: WireProtocol<Dialect>;
|
|
477
|
+
/** Endpoint base; the protocol's path is appended. */
|
|
478
|
+
baseUrl: string;
|
|
479
|
+
/** Permit cleartext HTTP explicitly, for trusted local development only. */
|
|
480
|
+
allowInsecureHttp?: boolean;
|
|
481
|
+
/** Captured fetch implementation for tests, custom runtimes, and transport policy. */
|
|
482
|
+
fetch?: typeof globalThis.fetch;
|
|
483
|
+
/** How to authenticate. */
|
|
484
|
+
auth: AuthScheme;
|
|
485
|
+
/**
|
|
486
|
+
* Per-endpoint protocol knobs, merged over the protocol's defaults.
|
|
487
|
+
*
|
|
488
|
+
* Partial, so a protocol can gain a knob without any endpoint needing an edit.
|
|
489
|
+
*/
|
|
490
|
+
dialect?: Partial<Dialect>;
|
|
491
|
+
/** Extra static headers, or a resolver for them. */
|
|
492
|
+
headers?: Record<string, string> | (() => Record<string, string>);
|
|
493
|
+
/**
|
|
494
|
+
* Advisory model catalog.
|
|
495
|
+
*
|
|
496
|
+
* Requests are never restricted to it. Supply entries to declare capabilities
|
|
497
|
+
* the SDK cannot infer — most importantly image support, since an uncatalogued
|
|
498
|
+
* model is treated as text-only and its images are projected to text.
|
|
499
|
+
*/
|
|
500
|
+
models?: readonly ProviderCatalogModel[];
|
|
501
|
+
/**
|
|
502
|
+
* Fetch the catalog from the endpoint instead of declaring it.
|
|
503
|
+
*
|
|
504
|
+
* Result is memoized for {@link catalogTtlMs}. A failure here is NOT fatal:
|
|
505
|
+
* refusing the actual model call because a metadata request failed would be the
|
|
506
|
+
* wrong trade.
|
|
507
|
+
*/
|
|
508
|
+
discoverModels?: (context: ModelDiscoveryContext) => Promise<readonly ProviderCatalogModel[]>;
|
|
509
|
+
/** How long a discovered catalog is reused. Defaults to five minutes. */
|
|
510
|
+
catalogTtlMs?: number;
|
|
511
|
+
/** Additional opt-in lifetime for the last valid catalog after refresh failure. */
|
|
512
|
+
catalogStaleTtlMs?: number;
|
|
513
|
+
/** Backoff after discovery failure before another refresh is attempted. */
|
|
514
|
+
catalogFailureBackoffMs?: number;
|
|
515
|
+
/** Maximum catalog entries retained from static config or discovery. Defaults to 2,048. */
|
|
516
|
+
maxCatalogModels?: number;
|
|
517
|
+
/** Maximum serialized catalog bytes retained. Defaults to 4 MiB. */
|
|
518
|
+
maxCatalogBytes?: number;
|
|
519
|
+
/**
|
|
520
|
+
* Decorate resolved model metadata.
|
|
521
|
+
*
|
|
522
|
+
* The hook for capabilities that come from the endpoint's configuration rather
|
|
523
|
+
* than its catalog — Anthropic uses it to advertise thinking budgets as
|
|
524
|
+
* selectable reasoning efforts.
|
|
525
|
+
*/
|
|
526
|
+
describeModel?: (info: ResolvedModelInfo, dialect: Dialect) => ResolvedModelInfo;
|
|
527
|
+
/** Output cap when neither caller nor catalog names one. */
|
|
528
|
+
defaultMaxTokens?: number;
|
|
529
|
+
/** Context capacity assumed for an uncatalogued model. */
|
|
530
|
+
defaultContextWindow?: number;
|
|
531
|
+
/** Idle bound while a stream read is outstanding. */
|
|
532
|
+
streamIdleTimeoutMs?: number;
|
|
533
|
+
/** End-to-end request/stream timeout. Defaults to ten minutes. */
|
|
534
|
+
requestTimeoutMs?: number;
|
|
535
|
+
/** Maximum serialized outbound request bytes. Defaults to 32 MiB. */
|
|
536
|
+
maxRequestBytes?: number;
|
|
537
|
+
/** Maximum cumulative successful response bytes. Defaults to 32 MiB. */
|
|
538
|
+
maxResponseBytes?: number;
|
|
539
|
+
/** Maximum raw response chunks. Defaults to 100,000. */
|
|
540
|
+
maxResponseChunks?: number;
|
|
541
|
+
/** Maximum decoded SSE events accepted from one response. */
|
|
542
|
+
maxSseEvents?: number;
|
|
543
|
+
/** Maximum characters accepted in one decoded SSE event. */
|
|
544
|
+
maxSseEventChars?: number;
|
|
545
|
+
/** Maximum non-success response bytes retained. Defaults to 1 MiB. */
|
|
546
|
+
maxErrorBodyBytes?: number;
|
|
547
|
+
/** Maximum time granted to the optional request logger. Defaults to 5 seconds. */
|
|
548
|
+
requestLoggerTimeoutMs?: number;
|
|
549
|
+
/** Retry policy this route owns. */
|
|
550
|
+
retryPolicy?: RetryPolicyConfig;
|
|
551
|
+
/**
|
|
552
|
+
* Classify a status this endpoint reports specially.
|
|
553
|
+
*
|
|
554
|
+
* Return `undefined` to fall through to the shared mapping, so an override only
|
|
555
|
+
* has to describe what is genuinely different.
|
|
556
|
+
*/
|
|
557
|
+
errorCode?: (status: number, detail: string) => string | undefined;
|
|
558
|
+
/** Override the `accept` / `content-type` the pipeline sends. */
|
|
559
|
+
baseHeaders?: Record<string, string>;
|
|
560
|
+
/**
|
|
561
|
+
* Observe exact protocol-serialized requests immediately before `fetch`.
|
|
562
|
+
* Credentials are redacted, but bodies still contain prompts and tool output.
|
|
563
|
+
* @deprecated High-risk compatibility bridge. Prefer structured observation.
|
|
564
|
+
*/
|
|
565
|
+
requestLogger?: ProviderRequestLogger;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Create a provider adapter from configuration.
|
|
569
|
+
* @param options - protocol, endpoint, credential, and optional capability hooks.
|
|
570
|
+
* @returns an adapter ready for `registry.registerAdapter`.
|
|
571
|
+
*/
|
|
572
|
+
declare function createHttpProvider<Dialect extends object>(options: HttpProviderOptions<Dialect>): HttpModelAdapter;
|
|
573
|
+
//#endregion
|
|
574
|
+
//#region src/configurable/runtime-types.d.ts
|
|
575
|
+
type RuntimeCredentialSource = CredentialInput;
|
|
576
|
+
type RuntimeAuthScheme = {
|
|
577
|
+
readonly kind: 'none';
|
|
578
|
+
} | {
|
|
579
|
+
readonly kind: 'bearer';
|
|
580
|
+
readonly token: RuntimeCredentialSource;
|
|
581
|
+
readonly label?: string;
|
|
582
|
+
} | {
|
|
583
|
+
readonly kind: 'header';
|
|
584
|
+
readonly name: string;
|
|
585
|
+
readonly value: RuntimeCredentialSource;
|
|
586
|
+
readonly label?: string;
|
|
587
|
+
} | {
|
|
588
|
+
readonly kind: 'dynamic';
|
|
589
|
+
readonly resolve: (options: HttpAuthResolveOptions) => Readonly<Record<string, string>> | Promise<Readonly<Record<string, string>>>;
|
|
590
|
+
};
|
|
591
|
+
interface RuntimeModelDiscoveryContext {
|
|
592
|
+
readonly provider: string;
|
|
593
|
+
readonly baseUrl: URL;
|
|
594
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
595
|
+
readonly signal: AbortSignal;
|
|
596
|
+
readonly context?: ModelInvocationContext$1;
|
|
597
|
+
}
|
|
598
|
+
interface RuntimeHttpProviderOptions<Dialect extends object> {
|
|
599
|
+
readonly displayName: string;
|
|
600
|
+
readonly protocol: RuntimeWireProtocol<Dialect>;
|
|
601
|
+
readonly baseUrl: string | URL;
|
|
602
|
+
readonly allowInsecureHttp?: boolean;
|
|
603
|
+
readonly auth: RuntimeAuthScheme;
|
|
604
|
+
readonly models?: readonly ProviderCatalogModel[];
|
|
605
|
+
readonly dialect?: Partial<Dialect>;
|
|
606
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
607
|
+
readonly headers?: Readonly<Record<string, string>> | (() => Readonly<Record<string, string>>);
|
|
608
|
+
readonly discoverModels?: (context: RuntimeModelDiscoveryContext) => Promise<readonly ProviderCatalogModel[]>;
|
|
609
|
+
readonly catalogTtlMs?: number;
|
|
610
|
+
readonly catalogStaleTtlMs?: number;
|
|
611
|
+
readonly catalogFailureBackoffMs?: number;
|
|
612
|
+
readonly maxCatalogModels?: number;
|
|
613
|
+
readonly maxCatalogBytes?: number;
|
|
614
|
+
readonly describeModel?: (info: ResolvedModelInfo$1, dialect: Dialect) => ResolvedModelInfo$1;
|
|
615
|
+
readonly defaultMaxTokens?: number;
|
|
616
|
+
readonly defaultContextWindow?: number;
|
|
617
|
+
readonly streamIdleTimeoutMs?: number;
|
|
618
|
+
readonly requestTimeoutMs?: number;
|
|
619
|
+
readonly maxRequestBytes?: number;
|
|
620
|
+
readonly maxResponseBytes?: number;
|
|
621
|
+
readonly maxResponseChunks?: number;
|
|
622
|
+
readonly maxSseEvents?: number;
|
|
623
|
+
readonly maxSseEventChars?: number;
|
|
624
|
+
readonly maxErrorBodyBytes?: number;
|
|
625
|
+
readonly requestLoggerTimeoutMs?: number;
|
|
626
|
+
readonly retryPolicy?: RetryPolicyConfig$1;
|
|
627
|
+
readonly errorCode?: (status: number, detail: string) => string | undefined;
|
|
628
|
+
readonly baseHeaders?: Readonly<Record<string, string>>;
|
|
629
|
+
readonly requestLogger?: ProviderRequestLogger;
|
|
630
|
+
}
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region src/configurable/runtime-provider.d.ts
|
|
633
|
+
/** Create the versioned HTTP extension adapter without performing credential or network I/O. */
|
|
634
|
+
declare function createRuntimeHttpProvider<Dialect extends object>(options: RuntimeHttpProviderOptions<Dialect>): HttpModelAdapter;
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region src/observation/operations.d.ts
|
|
637
|
+
declare function observeCredentialOperation<T>(context: ModelInvocationContext | undefined, provider: string, operation: 'resolve' | 'refresh' | 'login', task: () => Promise<T>): Promise<T>;
|
|
638
|
+
declare function observeModelCatalogOperation<T>(context: ModelInvocationContext | undefined, provider: string, origin: string, task: () => Promise<T>): Promise<T>;
|
|
639
|
+
//#endregion
|
|
640
|
+
export { AnyWireProtocol, AuthScheme, CredentialSource, DEFAULT_MAX_ERROR_BODY_BYTES, DEFAULT_MAX_REQUEST_BYTES, DEFAULT_MAX_RESPONSE_BYTES, DEFAULT_MAX_RESPONSE_CHUNKS, DEFAULT_REQUEST_LOGGER_TIMEOUT_MS, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_STREAM_IDLE_TIMEOUT_MS, HTTP_PROTOCOL_API_VERSION, HTTP_PROVIDER_ERROR_CODES, type HttpAuthResolveOptions, type HttpConnection, HttpModelAdapter, HttpProviderOptions, ModelDiscoveryContext, type ParsedErrorBody, type ProtocolRequest, type ProtocolSseEvent, type ProtocolStreamChunk, type ProviderCatalogModel, type ProviderRequest, type ProviderRequestLogRecord, type ProviderRequestLogger, type RuntimeAuthScheme, type RuntimeCredentialSource, type RuntimeHttpProviderOptions, type RuntimeModelDiscoveryContext, type RuntimeWireProtocol, SseEvent, WireProtocol, WireProtocolChunk, type WireProtocolDefinition, createHttpProvider, createRuntimeHttpProvider, defineWireProtocol, httpErrorCode, observeCredentialOperation, observeModelCatalogOperation, parseErrorBody, parseSse, redactHeaders, requestIdFrom, resolveDialect, retryAfterMs };
|
|
641
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/stream/sse.ts","../src/stream/types.ts","../src/base/transport.ts","../src/base/http-adapter.ts","../src/base/http-errors.ts","../src/common/config.ts","../src/protocol/runtime-types.ts","../src/protocol/definition.ts","../src/protocol/protocol.ts","../src/configurable/http-provider.ts","../src/configurable/runtime-types.ts","../src/configurable/runtime-provider.ts","../src/observation/operations.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmCiB;;;;;;;;EAQf;;EAEA;;;;;;;;;;;;;;iBAeqB,SACrB,QAAQ,eAAe,aACvB,yBACA,6BACC,eAAe;;;;KC7DN,wBACR,QAAQ;WAAwB;;WACrB;WAAwB,OAAO;;;;iBCsN9B,cACd,SAAS,SAAS,yB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