@zyraxon-ai/llm 19.0.5 → 19.0.6
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/README.md +131 -131
- package/dist/cache-policy.js +1 -0
- package/dist/cache-policy.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/llm.js +1 -0
- package/dist/llm.js.map +1 -1
- package/dist/protocols/anthropic-messages.js +1 -0
- package/dist/protocols/anthropic-messages.js.map +1 -1
- package/dist/protocols/bedrock-converse.js +1 -0
- package/dist/protocols/bedrock-converse.js.map +1 -1
- package/dist/protocols/bedrock-event-stream.js +1 -0
- package/dist/protocols/bedrock-event-stream.js.map +1 -1
- package/dist/protocols/gemini.js +1 -0
- package/dist/protocols/gemini.js.map +1 -1
- package/dist/protocols/index.js +1 -0
- package/dist/protocols/index.js.map +1 -1
- package/dist/protocols/openai-chat.js +1 -0
- package/dist/protocols/openai-chat.js.map +1 -1
- package/dist/protocols/openai-compatible-chat.js +1 -0
- package/dist/protocols/openai-compatible-chat.js.map +1 -1
- package/dist/protocols/openai-responses.js +1 -0
- package/dist/protocols/openai-responses.js.map +1 -1
- package/dist/protocols/shared.js +1 -0
- package/dist/protocols/shared.js.map +1 -1
- package/dist/protocols/utils/bedrock-auth.js +1 -0
- package/dist/protocols/utils/bedrock-auth.js.map +1 -1
- package/dist/protocols/utils/bedrock-cache.js +1 -0
- package/dist/protocols/utils/bedrock-cache.js.map +1 -1
- package/dist/protocols/utils/bedrock-media.js +1 -0
- package/dist/protocols/utils/bedrock-media.js.map +1 -1
- package/dist/protocols/utils/cache.js +1 -3
- package/dist/protocols/utils/cache.js.map +1 -1
- package/dist/protocols/utils/gemini-tool-schema.js +1 -0
- package/dist/protocols/utils/gemini-tool-schema.js.map +1 -1
- package/dist/protocols/utils/lifecycle.js +1 -0
- package/dist/protocols/utils/lifecycle.js.map +1 -1
- package/dist/protocols/utils/openai-options.js +1 -0
- package/dist/protocols/utils/openai-options.js.map +1 -1
- package/dist/protocols/utils/tool-schema.js +1 -0
- package/dist/protocols/utils/tool-schema.js.map +1 -1
- package/dist/protocols/utils/tool-stream.js +1 -0
- package/dist/protocols/utils/tool-stream.js.map +1 -1
- package/dist/provider-error.js +1 -0
- package/dist/provider-error.js.map +1 -1
- package/dist/provider.js +1 -0
- package/dist/provider.js.map +1 -1
- package/dist/providers/amazon-bedrock.js +1 -0
- package/dist/providers/amazon-bedrock.js.map +1 -1
- package/dist/providers/anthropic.js +1 -0
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/azure.js +1 -0
- package/dist/providers/azure.js.map +1 -1
- package/dist/providers/cloudflare.js +1 -0
- package/dist/providers/cloudflare.js.map +1 -1
- package/dist/providers/github-copilot.js +1 -0
- package/dist/providers/github-copilot.js.map +1 -1
- package/dist/providers/google.js +1 -0
- package/dist/providers/google.js.map +1 -1
- package/dist/providers/index.js +1 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/openai-compatible-profile.js +1 -0
- package/dist/providers/openai-compatible-profile.js.map +1 -1
- package/dist/providers/openai-compatible.js +1 -0
- package/dist/providers/openai-compatible.js.map +1 -1
- package/dist/providers/openai-options.js +1 -0
- package/dist/providers/openai-options.js.map +1 -1
- package/dist/providers/openai.js +1 -0
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/openrouter.js +1 -0
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/providers/xai.js +1 -0
- package/dist/providers/xai.js.map +1 -1
- package/dist/route/auth-options.js +1 -0
- package/dist/route/auth-options.js.map +1 -1
- package/dist/route/auth.js +1 -0
- package/dist/route/auth.js.map +1 -1
- package/dist/route/client.js +1 -0
- package/dist/route/client.js.map +1 -1
- package/dist/route/endpoint.js +1 -0
- package/dist/route/endpoint.js.map +1 -1
- package/dist/route/executor.js +1 -0
- package/dist/route/executor.js.map +1 -1
- package/dist/route/framing.js +1 -0
- package/dist/route/framing.js.map +1 -1
- package/dist/route/index.js +1 -0
- package/dist/route/index.js.map +1 -1
- package/dist/route/protocol.js +1 -0
- package/dist/route/protocol.js.map +1 -1
- package/dist/route/transport/http.js +1 -0
- package/dist/route/transport/http.js.map +1 -1
- package/dist/route/transport/index.js +1 -0
- package/dist/route/transport/index.js.map +1 -1
- package/dist/route/transport/websocket.js +1 -0
- package/dist/route/transport/websocket.js.map +1 -1
- package/dist/schema/errors.js +1 -0
- package/dist/schema/errors.js.map +1 -1
- package/dist/schema/events.js +1 -0
- package/dist/schema/events.js.map +1 -1
- package/dist/schema/ids.js +1 -0
- package/dist/schema/ids.js.map +1 -1
- package/dist/schema/index.js +1 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/messages.js +1 -0
- package/dist/schema/messages.js.map +1 -1
- package/dist/schema/options.js +1 -0
- package/dist/schema/options.js.map +1 -1
- package/dist/tool-runtime.js +1 -0
- package/dist/tool-runtime.js.map +1 -1
- package/dist/tool.js +1 -0
- package/dist/tool.js.map +1 -1
- package/dist/utils/record.js +1 -0
- package/dist/utils/record.js.map +1 -1
- package/package.json +107 -21
- package/dist/cache-policy.d.ts +0 -3
- package/dist/cache-policy.d.ts.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/llm.d.ts +0 -205
- package/dist/llm.d.ts.map +0 -1
- package/dist/protocols/anthropic-messages.d.ts +0 -340
- package/dist/protocols/anthropic-messages.d.ts.map +0 -1
- package/dist/protocols/bedrock-converse.d.ts +0 -472
- package/dist/protocols/bedrock-converse.d.ts.map +0 -1
- package/dist/protocols/bedrock-event-stream.d.ts +0 -10
- package/dist/protocols/bedrock-event-stream.d.ts.map +0 -1
- package/dist/protocols/gemini.d.ts +0 -165
- package/dist/protocols/gemini.d.ts.map +0 -1
- package/dist/protocols/index.d.ts +0 -7
- package/dist/protocols/index.d.ts.map +0 -1
- package/dist/protocols/openai-chat.d.ts +0 -297
- package/dist/protocols/openai-chat.d.ts.map +0 -1
- package/dist/protocols/openai-compatible-chat.d.ts +0 -12
- package/dist/protocols/openai-compatible-chat.d.ts.map +0 -1
- package/dist/protocols/openai-responses.d.ts +0 -615
- package/dist/protocols/openai-responses.d.ts.map +0 -1
- package/dist/protocols/shared.d.ts +0 -193
- package/dist/protocols/shared.d.ts.map +0 -1
- package/dist/protocols/utils/bedrock-auth.d.ts +0 -19
- package/dist/protocols/utils/bedrock-auth.d.ts.map +0 -1
- package/dist/protocols/utils/bedrock-cache.d.ts +0 -16
- package/dist/protocols/utils/bedrock-cache.d.ts.map +0 -1
- package/dist/protocols/utils/bedrock-media.d.ts +0 -50
- package/dist/protocols/utils/bedrock-media.d.ts.map +0 -1
- package/dist/protocols/utils/cache.d.ts +0 -7
- package/dist/protocols/utils/cache.d.ts.map +0 -1
- package/dist/protocols/utils/gemini-tool-schema.d.ts +0 -3
- package/dist/protocols/utils/gemini-tool-schema.d.ts.map +0 -1
- package/dist/protocols/utils/lifecycle.d.ts +0 -20
- package/dist/protocols/utils/lifecycle.d.ts.map +0 -1
- package/dist/protocols/utils/openai-options.d.ts +0 -23
- package/dist/protocols/utils/openai-options.d.ts.map +0 -1
- package/dist/protocols/utils/tool-schema.d.ts +0 -8
- package/dist/protocols/utils/tool-schema.d.ts.map +0 -1
- package/dist/protocols/utils/tool-stream.d.ts +0 -156
- package/dist/protocols/utils/tool-stream.d.ts.map +0 -1
- package/dist/provider-error.d.ts +0 -3
- package/dist/provider-error.d.ts.map +0 -1
- package/dist/provider.d.ts +0 -24
- package/dist/provider.d.ts.map +0 -1
- package/dist/providers/amazon-bedrock.d.ts +0 -142
- package/dist/providers/amazon-bedrock.d.ts.map +0 -1
- package/dist/providers/anthropic.d.ts +0 -24
- package/dist/providers/anthropic.d.ts.map +0 -1
- package/dist/providers/azure.d.ts +0 -36
- package/dist/providers/azure.d.ts.map +0 -1
- package/dist/providers/cloudflare.d.ts +0 -47
- package/dist/providers/cloudflare.d.ts.map +0 -1
- package/dist/providers/github-copilot.d.ts +0 -30
- package/dist/providers/github-copilot.d.ts.map +0 -1
- package/dist/providers/google.d.ts +0 -24
- package/dist/providers/google.d.ts.map +0 -1
- package/dist/providers/index.d.ts +0 -12
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/openai-compatible-profile.d.ts +0 -44
- package/dist/providers/openai-compatible-profile.d.ts.map +0 -1
- package/dist/providers/openai-compatible.d.ts +0 -62
- package/dist/providers/openai-compatible.d.ts.map +0 -1
- package/dist/providers/openai-options.d.ts +0 -31
- package/dist/providers/openai-options.d.ts.map +0 -1
- package/dist/providers/openai.d.ts +0 -116
- package/dist/providers/openai.d.ts.map +0 -1
- package/dist/providers/openrouter.d.ts +0 -199
- package/dist/providers/openrouter.d.ts.map +0 -1
- package/dist/providers/xai.d.ts +0 -32
- package/dist/providers/xai.d.ts.map +0 -1
- package/dist/route/auth-options.d.ts +0 -35
- package/dist/route/auth-options.d.ts.map +0 -1
- package/dist/route/client.d.ts +0 -306
- package/dist/route/client.d.ts.map +0 -1
- package/dist/route/executor.d.ts +0 -13
- package/dist/route/executor.d.ts.map +0 -1
- package/dist/route/index.d.ts +0 -17
- package/dist/route/index.d.ts.map +0 -1
- package/dist/route/protocol.d.ts +0 -77
- package/dist/route/protocol.d.ts.map +0 -1
- package/dist/route/transport/http.d.ts +0 -34
- package/dist/route/transport/http.d.ts.map +0 -1
- package/dist/route/transport/index.d.ts +0 -28
- package/dist/route/transport/index.d.ts.map +0 -1
- package/dist/route/transport/websocket.d.ts +0 -57
- package/dist/route/transport/websocket.d.ts.map +0 -1
- package/dist/schema/errors.d.ts +0 -166
- package/dist/schema/errors.d.ts.map +0 -1
- package/dist/schema/events.d.ts +0 -3821
- package/dist/schema/events.d.ts.map +0 -1
- package/dist/schema/ids.d.ts +0 -31
- package/dist/schema/ids.d.ts.map +0 -1
- package/dist/schema/index.d.ts +0 -6
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/messages.d.ts +0 -294
- package/dist/schema/messages.d.ts.map +0 -1
- package/dist/schema/options.d.ts +0 -144
- package/dist/schema/options.d.ts.map +0 -1
- package/dist/tool-runtime.d.ts +0 -16
- package/dist/tool-runtime.d.ts.map +0 -1
- package/dist/utils/record.d.ts +0 -3
- package/dist/utils/record.d.ts.map +0 -1
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { Buffer } from "node:buffer";
|
|
2
|
-
import { Effect, Schema, Stream } from "effect";
|
|
3
|
-
import { Headers, HttpClientRequest } from "effect/unstable/http";
|
|
4
|
-
import { LLMError, type ContentPart, type LLMRequest, type ToolFileContent, type ToolResultPart } from "../schema";
|
|
5
|
-
import { isRecord } from "../utils/record";
|
|
6
|
-
export { isRecord };
|
|
7
|
-
export declare const Json: Schema.fromJsonString<Schema.Unknown>;
|
|
8
|
-
export declare const decodeJson: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => unknown;
|
|
9
|
-
export declare const encodeJson: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => string;
|
|
10
|
-
export declare const JsonObject: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
11
|
-
export declare const optionalArray: <const S extends Schema.Top>(schema: S) => Schema.optional<Schema.$Array<S>>;
|
|
12
|
-
export declare const optionalNull: <const S extends Schema.Top>(schema: S) => Schema.optional<Schema.NullOr<S>>;
|
|
13
|
-
/**
|
|
14
|
-
* Streaming tool-call accumulator. Adapters that build a tool call across
|
|
15
|
-
* multiple `tool-input-delta` chunks store the partial JSON input string here
|
|
16
|
-
* and finalize it with `parseToolInput` once the call completes.
|
|
17
|
-
*/
|
|
18
|
-
export interface ToolAccumulator {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly name: string;
|
|
21
|
-
readonly input: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* `Usage.totalTokens` policy shared by every route. Honors a provider-
|
|
25
|
-
* supplied total; otherwise falls back to `inputTokens + outputTokens` only
|
|
26
|
-
* when at least one is defined. Returns `undefined` when neither input nor
|
|
27
|
-
* output is known so routes don't publish a misleading `0`.
|
|
28
|
-
*
|
|
29
|
-
* Under the additive `LLM.Usage` contract, `inputTokens` and `outputTokens`
|
|
30
|
-
* are the non-cached input and visible output only. The provider-supplied
|
|
31
|
-
* `total` is the source of truth when present; the computed fallback
|
|
32
|
-
* under-counts cache and reasoning by design and exists mainly so
|
|
33
|
-
* Anthropic-style providers (which don't surface a total) still get a
|
|
34
|
-
* sensible aggregate on the input + output axes.
|
|
35
|
-
*/
|
|
36
|
-
export declare const totalTokens: (inputTokens: number | undefined, outputTokens: number | undefined, total: number | undefined) => number;
|
|
37
|
-
/**
|
|
38
|
-
* Subtract `subtrahend` from `total`, clamping to zero if the provider
|
|
39
|
-
* reports a non-sensical breakdown (e.g. `cached_tokens > prompt_tokens`).
|
|
40
|
-
* Used by protocol mappers when deriving a non-overlapping breakdown field
|
|
41
|
-
* from a provider's inclusive total — `nonCachedInputTokens` from
|
|
42
|
-
* `inputTokens - cacheReadInputTokens - cacheWriteInputTokens`.
|
|
43
|
-
*
|
|
44
|
-
* If `total` is `undefined`, returns `undefined` (we don't fabricate
|
|
45
|
-
* counts). If `subtrahend` is `undefined`, returns `total` unchanged. The
|
|
46
|
-
* provider-native breakdown stays available on `Usage.native` for debugging.
|
|
47
|
-
*/
|
|
48
|
-
export declare const subtractTokens: (total: number | undefined, subtrahend: number | undefined) => number | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Sum a list of optional token counts, returning `undefined` only when
|
|
51
|
-
* every value is `undefined` (so we don't fabricate a `0`). Used by
|
|
52
|
-
* protocol mappers to derive the inclusive `inputTokens` total from a
|
|
53
|
-
* provider that natively reports a non-overlapping breakdown
|
|
54
|
-
* (e.g. Anthropic, whose `input_tokens` is already non-cached only).
|
|
55
|
-
*/
|
|
56
|
-
export declare const sumTokens: (...values: ReadonlyArray<number | undefined>) => number | undefined;
|
|
57
|
-
export declare const eventError: (route: string, message: string, raw?: string) => LLMError;
|
|
58
|
-
export declare const parseJson: (route: string, input: string, message: string) => Effect.Effect<unknown, LLMError, never>;
|
|
59
|
-
/**
|
|
60
|
-
* Join the `text` field of a list of parts with newlines. Used by routes
|
|
61
|
-
* that flatten system / message content arrays into a single provider string
|
|
62
|
-
* (OpenAI Chat `system` content, OpenAI Responses `system` content, Gemini
|
|
63
|
-
* `systemInstruction.parts[].text`).
|
|
64
|
-
*/
|
|
65
|
-
export declare const joinText: (parts: ReadonlyArray<{
|
|
66
|
-
readonly text: string;
|
|
67
|
-
}>) => string;
|
|
68
|
-
/**
|
|
69
|
-
* Stable fallback representation for chronological `Message.system(...)`
|
|
70
|
-
* updates on routes that do not support that privileged role natively. The
|
|
71
|
-
* wrapper remains visibly lower-authority user text, preserves the original
|
|
72
|
-
* temporal position, and XML-escapes content so it cannot close the wrapper.
|
|
73
|
-
*/
|
|
74
|
-
export declare const wrapSystemUpdate: (parts: ReadonlyArray<{
|
|
75
|
-
readonly text: string;
|
|
76
|
-
}>) => string;
|
|
77
|
-
/**
|
|
78
|
-
* Chronological system updates deliberately accept text only. Do not insert
|
|
79
|
-
* raw retrieved, tool, or web content into privileged updates: keep untrusted
|
|
80
|
-
* data in ordinary user/tool messages instead.
|
|
81
|
-
*/
|
|
82
|
-
export declare const systemUpdateText: (route: string, message: import("..").Message) => Effect.Effect<{
|
|
83
|
-
readonly type: "text";
|
|
84
|
-
readonly text: string;
|
|
85
|
-
readonly cache?: import("..").CacheHint;
|
|
86
|
-
readonly metadata?: {
|
|
87
|
-
readonly [x: string]: unknown;
|
|
88
|
-
};
|
|
89
|
-
readonly providerMetadata?: {
|
|
90
|
-
readonly [x: string]: {
|
|
91
|
-
readonly [x: string]: unknown;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
}[], LLMError, never>;
|
|
95
|
-
/** Lower an unsupported privileged update into visible, in-order user text. */
|
|
96
|
-
export declare const wrappedSystemUpdate: (route: string, message: import("..").Message) => Effect.Effect<{
|
|
97
|
-
type: "text";
|
|
98
|
-
text: string;
|
|
99
|
-
cache: import("..").CacheHint;
|
|
100
|
-
}, LLMError, never>;
|
|
101
|
-
/**
|
|
102
|
-
* Parse the streamed JSON input of a tool call. Treats an empty string as
|
|
103
|
-
* `"{}"` — providers occasionally finish a tool call without ever emitting
|
|
104
|
-
* input deltas (e.g. zero-arg tools). The error message is uniform across
|
|
105
|
-
* routes: `Invalid JSON input for <route> tool call <name>`.
|
|
106
|
-
*/
|
|
107
|
-
export declare const parseToolInput: (route: string, name: string, raw: string) => Effect.Effect<unknown, LLMError, never>;
|
|
108
|
-
export declare const IMAGE_MIMES: readonly ["image/png", "image/jpeg", "image/gif", "image/webp"];
|
|
109
|
-
export declare const VIDEO_MIMES: readonly ["video/mp4", "video/webm", "video/quicktime"];
|
|
110
|
-
export declare const AUDIO_MIMES: readonly ["audio/wav", "audio/mp3", "audio/aiff", "audio/aac", "audio/ogg", "audio/flac"];
|
|
111
|
-
export declare const MEDIA_MIMES: readonly ["image/png", "image/jpeg", "image/gif", "image/webp", "video/mp4", "video/webm", "video/quicktime", "audio/wav", "audio/mp3", "audio/aiff", "audio/aac", "audio/ogg", "audio/flac"];
|
|
112
|
-
export declare const MAX_MEDIA_ENCODED_BYTES: number;
|
|
113
|
-
export declare const MAX_MEDIA_DECODED_BYTES: number;
|
|
114
|
-
export interface ValidatedMedia {
|
|
115
|
-
readonly mime: string;
|
|
116
|
-
readonly base64: string;
|
|
117
|
-
readonly dataUrl: string;
|
|
118
|
-
readonly bytes: Uint8Array;
|
|
119
|
-
}
|
|
120
|
-
export declare const validateMedia: (route: string, part: {
|
|
121
|
-
readonly type: "media";
|
|
122
|
-
readonly mediaType: string;
|
|
123
|
-
readonly data: string | Uint8Array<ArrayBufferLike>;
|
|
124
|
-
readonly filename?: string;
|
|
125
|
-
readonly metadata?: {
|
|
126
|
-
readonly [x: string]: unknown;
|
|
127
|
-
};
|
|
128
|
-
}, supportedMimes: ReadonlySet<string>) => Effect.Effect<{
|
|
129
|
-
mime: string;
|
|
130
|
-
base64: string;
|
|
131
|
-
dataUrl: string;
|
|
132
|
-
bytes: Buffer<ArrayBuffer>;
|
|
133
|
-
}, LLMError, never>;
|
|
134
|
-
export declare const validateToolFile: (route: string, part: ToolFileContent, supportedMimes: ReadonlySet<string>) => Effect.Effect<{
|
|
135
|
-
mime: string;
|
|
136
|
-
base64: string;
|
|
137
|
-
dataUrl: string;
|
|
138
|
-
bytes: Buffer<ArrayBuffer>;
|
|
139
|
-
}, LLMError, never>;
|
|
140
|
-
export declare const trimBaseUrl: (value: string) => string;
|
|
141
|
-
export declare const toolResultText: (part: ToolResultPart) => string;
|
|
142
|
-
export declare const errorText: (error: unknown) => string;
|
|
143
|
-
/**
|
|
144
|
-
* `framing` step for Server-Sent Events. Decodes UTF-8, runs the SSE channel
|
|
145
|
-
* decoder, and drops empty / `[DONE]` keep-alive events so the downstream
|
|
146
|
-
* `decodeChunk` sees one JSON string per element. The SSE channel emits a
|
|
147
|
-
* `Retry` control event on its error channel; we drop it here (we don't
|
|
148
|
-
* implement client-driven retries) so the public error channel stays
|
|
149
|
-
* `LLMError`.
|
|
150
|
-
*/
|
|
151
|
-
export declare const sseFraming: (bytes: Stream.Stream<Uint8Array, LLMError>) => Stream.Stream<string, LLMError>;
|
|
152
|
-
/**
|
|
153
|
-
* Canonical invalid-request constructor. Lift one-line `const invalid =
|
|
154
|
-
* (message) => invalidRequest(message)` aliases out of every
|
|
155
|
-
* route so the error constructor lives in one place. If we ever extend
|
|
156
|
-
* `InvalidRequestReason` with route context or trace metadata, the change
|
|
157
|
-
* lands here.
|
|
158
|
-
*/
|
|
159
|
-
export declare const invalidRequest: (message: string) => LLMError;
|
|
160
|
-
export declare const matchToolChoice: <Auto, None, Required, Tool>(route: string, toolChoice: NonNullable<LLMRequest["toolChoice"]>, cases: {
|
|
161
|
-
readonly auto: () => Auto;
|
|
162
|
-
readonly none: () => None;
|
|
163
|
-
readonly required: () => Required;
|
|
164
|
-
readonly tool: (name: string) => Tool;
|
|
165
|
-
}) => Effect.Effect<Auto | None | Required | Tool, LLMError, never>;
|
|
166
|
-
type ContentType = ContentPart["type"];
|
|
167
|
-
export declare const supportsContent: <const Type extends ContentType>(part: ContentPart, types: ReadonlyArray<Type>) => part is Extract<ContentPart, {
|
|
168
|
-
readonly type: Type;
|
|
169
|
-
}>;
|
|
170
|
-
export declare const unsupportedContent: (route: string, role: LLMRequest["messages"][number]["role"], types: ReadonlyArray<ContentType>) => LLMError;
|
|
171
|
-
/**
|
|
172
|
-
* Build a `validate` step from a Schema decoder. Replaces the per-route
|
|
173
|
-
* lambda body `(payload) => decode(payload).pipe(Effect.mapError((e) =>
|
|
174
|
-
* invalid(e.message)))`. Any decode error is translated into
|
|
175
|
-
* `LLMError` carrying the original parse-error message.
|
|
176
|
-
*/
|
|
177
|
-
export declare const validateWith: <A, I, E extends {
|
|
178
|
-
readonly message: string;
|
|
179
|
-
}>(decode: (input: I) => Effect.Effect<A, E>) => (payload: I) => Effect.Effect<A, LLMError, never>;
|
|
180
|
-
/**
|
|
181
|
-
* Build an HTTP POST with a JSON body. Sets `content-type: application/json`
|
|
182
|
-
* automatically after caller-supplied headers so routes cannot accidentally
|
|
183
|
-
* send JSON with a stale content type. The body is passed pre-encoded so
|
|
184
|
-
* routes can choose between
|
|
185
|
-
* `Schema.encodeSync(payload)` and `ProviderShared.encodeJson(payload)`.
|
|
186
|
-
*/
|
|
187
|
-
export declare const jsonPost: (input: {
|
|
188
|
-
readonly url: string;
|
|
189
|
-
readonly body: string;
|
|
190
|
-
readonly headers?: Headers.Input;
|
|
191
|
-
}) => HttpClientRequest.HttpClientRequest;
|
|
192
|
-
export * as ProviderShared from "./shared";
|
|
193
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/protocols/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/C,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,MAAM,CAAC,CAAC,MAAM,CAAC,EAC5C,OAAO,aAAa,CAAC,WAAW,CAAC,aACuE,CAAA;AAE1G;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACtB,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,MACvF,SAAS,CAAC,sCACsE,CAAA;AAEnF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAA;CAAE,wCAI9G,CAAA;AAEH,OAAO,KAAK,cAAc,MAAM,UAAU,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Auth } from "../../route/auth";
|
|
2
|
-
/**
|
|
3
|
-
* AWS credentials for SigV4 signing. Bedrock also supports Bearer API key auth,
|
|
4
|
-
* which provider facades configure as route auth instead of SigV4. STS-vended
|
|
5
|
-
* credentials should be refreshed by the consumer (rebuild the model) before
|
|
6
|
-
* they expire; the route does not refresh.
|
|
7
|
-
*/
|
|
8
|
-
export interface Credentials {
|
|
9
|
-
readonly region: string;
|
|
10
|
-
readonly accessKeyId: string;
|
|
11
|
-
readonly secretAccessKey: string;
|
|
12
|
-
readonly sessionToken?: string;
|
|
13
|
-
}
|
|
14
|
-
/** Sign the exact JSON bytes with SigV4 using credentials configured on the route. */
|
|
15
|
-
export declare const sigV4: (credentials: Credentials | undefined) => Auth;
|
|
16
|
-
/** Bedrock route auth defaults to SigV4 and expects credentials from route configuration. */
|
|
17
|
-
export declare const auth: Auth;
|
|
18
|
-
export * as BedrockAuth from "./bedrock-auth";
|
|
19
|
-
//# sourceMappingURL=bedrock-auth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bedrock-auth.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/bedrock-auth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAkB,MAAM,kBAAkB,CAAA;AAGvD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAC/B;AA6BD,sFAAsF;AACtF,eAAO,MAAM,KAAK,GAAI,aAAa,WAAW,GAAG,SAAS,SAiBtD,CAAA;AAEJ,6FAA6F;AAC7F,eAAO,MAAM,IAAI,MAAmB,CAAA;AAEpC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import type { CacheHint } from "../../schema";
|
|
3
|
-
import { type Breakpoints } from "./cache";
|
|
4
|
-
export declare const CachePointBlock: Schema.Struct<{
|
|
5
|
-
readonly cachePoint: Schema.Struct<{
|
|
6
|
-
readonly type: Schema.tag<"default">;
|
|
7
|
-
readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
|
|
8
|
-
}>;
|
|
9
|
-
}>;
|
|
10
|
-
export type CachePointBlock = Schema.Schema.Type<typeof CachePointBlock>;
|
|
11
|
-
export declare const BEDROCK_BREAKPOINT_CAP = 4;
|
|
12
|
-
export type { Breakpoints } from "./cache";
|
|
13
|
-
export declare const breakpoints: () => Breakpoints;
|
|
14
|
-
export declare const block: (breakpoints: Breakpoints, cache: CacheHint | undefined) => CachePointBlock | undefined;
|
|
15
|
-
export * as BedrockCache from "./bedrock-cache";
|
|
16
|
-
//# sourceMappingURL=bedrock-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bedrock-cache.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/bedrock-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAA6B,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA;AAKrE,eAAO,MAAM,eAAe;;;;;EAK1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAA;AAKxE,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,eAAO,MAAM,WAAW,mBAA+C,CAAA;AAKvE,eAAO,MAAM,KAAK,GAAI,aAAa,WAAW,EAAE,OAAO,SAAS,GAAG,SAAS,KAAG,eAAe,GAAG,SAQhG,CAAA;AAED,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Effect, Schema } from "effect";
|
|
2
|
-
export declare const ImageFormat: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
|
|
3
|
-
export type ImageFormat = Schema.Schema.Type<typeof ImageFormat>;
|
|
4
|
-
export declare const ImageBlock: Schema.Struct<{
|
|
5
|
-
readonly image: Schema.Struct<{
|
|
6
|
-
readonly format: Schema.Literals<readonly ["png", "jpeg", "gif", "webp"]>;
|
|
7
|
-
readonly source: Schema.Struct<{
|
|
8
|
-
readonly bytes: Schema.String;
|
|
9
|
-
}>;
|
|
10
|
-
}>;
|
|
11
|
-
}>;
|
|
12
|
-
export type ImageBlock = Schema.Schema.Type<typeof ImageBlock>;
|
|
13
|
-
export declare const DocumentFormat: Schema.Literals<readonly ["pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"]>;
|
|
14
|
-
export type DocumentFormat = Schema.Schema.Type<typeof DocumentFormat>;
|
|
15
|
-
export declare const DocumentBlock: Schema.Struct<{
|
|
16
|
-
readonly document: Schema.Struct<{
|
|
17
|
-
readonly format: Schema.Literals<readonly ["pdf", "csv", "doc", "docx", "xls", "xlsx", "html", "txt", "md"]>;
|
|
18
|
-
readonly name: Schema.String;
|
|
19
|
-
readonly source: Schema.Struct<{
|
|
20
|
-
readonly bytes: Schema.String;
|
|
21
|
-
}>;
|
|
22
|
-
}>;
|
|
23
|
-
}>;
|
|
24
|
-
export type DocumentBlock = Schema.Schema.Type<typeof DocumentBlock>;
|
|
25
|
-
export declare const lower: (part: {
|
|
26
|
-
readonly type: "media";
|
|
27
|
-
readonly mediaType: string;
|
|
28
|
-
readonly data: string | Uint8Array<ArrayBufferLike>;
|
|
29
|
-
readonly filename?: string;
|
|
30
|
-
readonly metadata?: {
|
|
31
|
-
readonly [x: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
}) => Effect.Effect<{
|
|
34
|
-
readonly document: {
|
|
35
|
-
readonly format: "pdf" | "csv" | "doc" | "docx" | "xls" | "xlsx" | "html" | "txt" | "md";
|
|
36
|
-
readonly name: string;
|
|
37
|
-
readonly source: {
|
|
38
|
-
readonly bytes: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
} | {
|
|
42
|
-
image: {
|
|
43
|
-
format: "png" | "jpeg" | "gif" | "webp";
|
|
44
|
-
source: {
|
|
45
|
-
bytes: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
}, import("../..").LLMError, never>;
|
|
49
|
-
export * as BedrockMedia from "./bedrock-media";
|
|
50
|
-
//# sourceMappingURL=bedrock-media.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bedrock-media.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/bedrock-media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAMvC,eAAO,MAAM,WAAW,0DAAkD,CAAA;AAC1E,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAA;AAEhE,eAAO,MAAM,UAAU;;;;;;;EAKrB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAA;AAI9D,eAAO,MAAM,cAAc,6FAAqF,CAAA;AAChH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAA;AAEtE,eAAO,MAAM,aAAa;;;;;;;;EAMxB,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,aAAa,CAAC,CAAA;AAmCpE,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;mCAuBhB,CAAA;AAEF,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface Breakpoints {
|
|
2
|
-
remaining: number;
|
|
3
|
-
dropped: number;
|
|
4
|
-
}
|
|
5
|
-
export declare const newBreakpoints: (cap: number) => Breakpoints;
|
|
6
|
-
export declare const ttlBucket: (ttlSeconds: number | undefined) => "1h" | undefined;
|
|
7
|
-
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/cache.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,WAA+C,CAAA;AAK5F,eAAO,MAAM,SAAS,GAAI,YAAY,MAAM,GAAG,SAAS,KAAG,IAAI,GAAG,SACC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-tool-schema.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/gemini-tool-schema.ts"],"names":[],"mappings":"AAgGA,eAAO,MAAM,OAAO,GAAI,QAAQ,OAAO,4BAAsC,CAAA;AAE7E,OAAO,KAAK,gBAAgB,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { LLMEvent, type FinishReason, type ProviderMetadata, type Usage } from "../../schema";
|
|
2
|
-
export interface State {
|
|
3
|
-
readonly stepStarted: boolean;
|
|
4
|
-
readonly text: ReadonlySet<string>;
|
|
5
|
-
readonly reasoning: ReadonlySet<string>;
|
|
6
|
-
}
|
|
7
|
-
export declare const initial: () => State;
|
|
8
|
-
export declare const stepStart: (state: State, events: LLMEvent[]) => State;
|
|
9
|
-
export declare const textDelta: (state: State, events: LLMEvent[], id: string, text: string) => State;
|
|
10
|
-
export declare const reasoningStart: (state: State, events: LLMEvent[], id: string, providerMetadata?: ProviderMetadata) => State;
|
|
11
|
-
export declare const reasoningDelta: (state: State, events: LLMEvent[], id: string, text: string, providerMetadata?: ProviderMetadata) => State;
|
|
12
|
-
export declare const reasoningEnd: (state: State, events: LLMEvent[], id: string, providerMetadata?: ProviderMetadata) => State;
|
|
13
|
-
export declare const textEnd: (state: State, events: LLMEvent[], id: string, providerMetadata?: ProviderMetadata) => State;
|
|
14
|
-
export declare const finish: (state: State, events: LLMEvent[], input: {
|
|
15
|
-
readonly reason: FinishReason;
|
|
16
|
-
readonly usage?: Usage;
|
|
17
|
-
readonly providerMetadata?: ProviderMetadata;
|
|
18
|
-
}) => State;
|
|
19
|
-
export * as Lifecycle from "./lifecycle";
|
|
20
|
-
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRo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,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;IACtB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CAC7C,KACA,KAYF,CAAA;AAED,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import type { LLMRequest, ReasoningEffort } from "../../schema";
|
|
3
|
-
export declare const OpenAIReasoningEfforts: ("none" | "minimal" | "low" | "medium" | "high" | "xhigh")[];
|
|
4
|
-
export type OpenAIReasoningEffort = (typeof OpenAIReasoningEfforts)[number];
|
|
5
|
-
export declare const OpenAIResponseIncludables: readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"];
|
|
6
|
-
export type OpenAIResponseIncludable = (typeof OpenAIResponseIncludables)[number];
|
|
7
|
-
export declare const OpenAIServiceTiers: readonly ["auto", "default", "flex", "priority"];
|
|
8
|
-
export type OpenAIServiceTier = (typeof OpenAIServiceTiers)[number];
|
|
9
|
-
export declare const OpenAIReasoningEffort: Schema.Literals<("none" | "minimal" | "low" | "medium" | "high" | "xhigh")[]>;
|
|
10
|
-
export declare const OpenAITextVerbosity: Schema.Literals<readonly ["low", "medium", "high"]>;
|
|
11
|
-
export declare const OpenAIResponseIncludable: Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>;
|
|
12
|
-
export declare const OpenAIServiceTier: Schema.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
13
|
-
export declare const isReasoningEffort: (effort: unknown) => effort is OpenAIReasoningEffort;
|
|
14
|
-
export declare const store: (request: LLMRequest) => boolean | undefined;
|
|
15
|
-
export declare const reasoningEffort: (request: LLMRequest) => ReasoningEffort | undefined;
|
|
16
|
-
export declare const reasoningSummary: (request: LLMRequest) => "auto" | undefined;
|
|
17
|
-
export declare const include: (request: LLMRequest) => ReadonlyArray<OpenAIResponseIncludable> | undefined;
|
|
18
|
-
export declare const promptCacheKey: (request: LLMRequest) => string;
|
|
19
|
-
export declare const textVerbosity: (request: LLMRequest) => "low" | "medium" | "high";
|
|
20
|
-
export declare const serviceTier: (request: LLMRequest) => "auto" | "default" | "flex" | "priority";
|
|
21
|
-
export declare const instructions: (request: LLMRequest) => string;
|
|
22
|
-
export * as OpenAIOptions from "./openai-options";
|
|
23
|
-
//# sourceMappingURL=openai-options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai-options.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/openai-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAuC,MAAM,cAAc,CAAA;AAGpG,eAAO,MAAM,sBAAsB,8DAElC,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAA;AAI3E,eAAO,MAAM,yBAAyB,8QAS5B,CAAA;AACV,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAA;AACjF,eAAO,MAAM,kBAAkB,kDAAmD,CAAA;AAClF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAQnE,eAAO,MAAM,qBAAqB,+EAA0C,CAAA;AAC5E,eAAO,MAAM,mBAAmB,qDAAgB,CAAA;AAChD,eAAO,MAAM,wBAAwB,+RAA6C,CAAA;AAClF,eAAO,MAAM,iBAAiB,mEAAsC,CAAA;AAKpE,eAAO,MAAM,iBAAiB,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,qBACM,CAAA;AAOpE,eAAO,MAAM,KAAK,GAAI,SAAS,UAAU,KAAG,OAAO,GAAG,SAGrD,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,SAAS,UAAU,KAAG,eAAe,GAAG,SAGvE,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,UAAU,KAAG,MAAM,GAAG,SACI,CAAA;AAOpE,eAAO,MAAM,OAAO,GAAI,SAAS,UAAU,KAAG,aAAa,CAAC,wBAAwB,CAAC,GAAG,SAKvF,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,SAAS,UAAU,WAGjD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,UAAU,8BAGhD,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,SAAS,UAAU,6CAG9C,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,SAAS,UAAU,WAG/C,CAAA;AAED,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { JsonSchema, ModelToolSchemaCompatibility } from "../../schema";
|
|
2
|
-
export declare const ToolSchemaProjection: {
|
|
3
|
-
readonly gemini: (schema: JsonSchema) => JsonSchema;
|
|
4
|
-
readonly modelCompatibility: (schema: JsonSchema, compatibility: ModelToolSchemaCompatibility | undefined) => JsonSchema;
|
|
5
|
-
readonly moonshot: (schema: JsonSchema) => JsonSchema;
|
|
6
|
-
readonly openAI: (schema: JsonSchema) => JsonSchema;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=tool-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-schema.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/tool-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAgF5E,eAAO,MAAM,oBAAoB;8BAfT,UAAU,KAAG,UAAU;0CAGrC,UAAU,iBACH,4BAA4B,GAAG,SAAS,KACtD,UAAU;gCA5Ba,UAAU,KAAG,UAAU;8BAKzB,UAAU,KAAG,UAAU;CAsCrC,CAAA"}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
2
|
-
import { LLMError, LLMEvent, type ProviderMetadata } from "../../schema";
|
|
3
|
-
import { type ToolAccumulator } from "../shared";
|
|
4
|
-
type StreamKey = string | number;
|
|
5
|
-
/**
|
|
6
|
-
* One pending streamed tool call. Providers emit the tool identity and JSON
|
|
7
|
-
* argument text across separate chunks; `input` is the raw JSON string collected
|
|
8
|
-
* so far, not the parsed object.
|
|
9
|
-
*/
|
|
10
|
-
export interface PendingTool extends ToolAccumulator {
|
|
11
|
-
readonly providerExecuted?: boolean;
|
|
12
|
-
readonly providerMetadata?: ProviderMetadata;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Sparse parser state keyed by the provider's stream-local tool identifier.
|
|
16
|
-
*
|
|
17
|
-
* This key is not the final tool-call id (`call_...`). It is the id/index the
|
|
18
|
-
* provider uses while streaming a partial call: OpenAI Chat / Anthropic /
|
|
19
|
-
* Bedrock use numeric content indexes, while OpenAI Responses uses string
|
|
20
|
-
* `item_id`s. The generic keeps each protocol internally consistent.
|
|
21
|
-
*/
|
|
22
|
-
export type State<K extends StreamKey> = Partial<Record<K, PendingTool>>;
|
|
23
|
-
/**
|
|
24
|
-
* Result of adding argument text to one pending tool call. It returns both the
|
|
25
|
-
* next `tools` state and the updated `tool` because parsers often need the
|
|
26
|
-
* current id/name immediately. `events` contains lifecycle and delta events
|
|
27
|
-
* produced by the append; metadata-only deltas update identity without output.
|
|
28
|
-
*/
|
|
29
|
-
export interface AppendOutcome<K extends StreamKey> {
|
|
30
|
-
readonly tools: State<K>;
|
|
31
|
-
readonly tool: PendingTool;
|
|
32
|
-
readonly events: ReadonlyArray<LLMEvent>;
|
|
33
|
-
}
|
|
34
|
-
/** Create empty accumulator state for one provider stream. */
|
|
35
|
-
export declare const empty: <K extends StreamKey>() => State<K>;
|
|
36
|
-
export declare const isError: <K extends StreamKey>(result: AppendOutcome<K> | LLMError) => result is LLMError;
|
|
37
|
-
/**
|
|
38
|
-
* Register a tool call whose start event arrived before any argument deltas.
|
|
39
|
-
* Used by Anthropic `content_block_start`, Bedrock `contentBlockStart`, and
|
|
40
|
-
* OpenAI Responses `response.output_item.added`.
|
|
41
|
-
*/
|
|
42
|
-
export declare const start: <K extends StreamKey>(tools: State<K>, key: K, tool: Omit<PendingTool, "input"> & {
|
|
43
|
-
readonly input?: string;
|
|
44
|
-
}) => Partial<Record<K, PendingTool>>;
|
|
45
|
-
/**
|
|
46
|
-
* Append a streamed argument delta, starting the tool if this provider encodes
|
|
47
|
-
* identity on the first delta instead of a separate start event. OpenAI Chat has
|
|
48
|
-
* this shape: `tool_calls[].index` is the stream key, and `id` / `name` may only
|
|
49
|
-
* appear on the first delta for that index.
|
|
50
|
-
*/
|
|
51
|
-
export declare const appendOrStart: <K extends StreamKey>(route: string, tools: State<K>, key: K, delta: {
|
|
52
|
-
readonly id?: string;
|
|
53
|
-
readonly name?: string;
|
|
54
|
-
readonly text: string;
|
|
55
|
-
}, missingToolMessage: string) => AppendOutcome<K> | LLMError;
|
|
56
|
-
/**
|
|
57
|
-
* Append argument text to a tool that must already have been started. This keeps
|
|
58
|
-
* protocols honest when their stream grammar promises a start event before any
|
|
59
|
-
* argument delta.
|
|
60
|
-
*/
|
|
61
|
-
export declare const appendExisting: <K extends StreamKey>(route: string, tools: State<K>, key: K, text: string, missingToolMessage: string) => AppendOutcome<K> | LLMError;
|
|
62
|
-
/**
|
|
63
|
-
* Finalize one pending tool call: parse the accumulated raw JSON, remove it
|
|
64
|
-
* from state, and return the optional public `tool-call` event. Missing keys are
|
|
65
|
-
* a no-op because some providers emit stop events for non-tool content blocks.
|
|
66
|
-
*/
|
|
67
|
-
export declare const finish: <K extends StreamKey>(route: string, tools: State<K>, key: K) => Effect.Effect<{
|
|
68
|
-
tools: Partial<Record<K, PendingTool>>;
|
|
69
|
-
events?: undefined;
|
|
70
|
-
} | {
|
|
71
|
-
tools: Partial<Record<K, PendingTool>>;
|
|
72
|
-
events: ({
|
|
73
|
-
readonly type: "tool-input-end";
|
|
74
|
-
readonly id: string;
|
|
75
|
-
readonly name: string;
|
|
76
|
-
readonly providerMetadata?: {
|
|
77
|
-
readonly [x: string]: {
|
|
78
|
-
readonly [x: string]: unknown;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
} | {
|
|
82
|
-
readonly type: "tool-call";
|
|
83
|
-
readonly id: string;
|
|
84
|
-
readonly name: string;
|
|
85
|
-
readonly input: unknown;
|
|
86
|
-
readonly providerExecuted?: boolean;
|
|
87
|
-
readonly providerMetadata?: {
|
|
88
|
-
readonly [x: string]: {
|
|
89
|
-
readonly [x: string]: unknown;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
})[];
|
|
93
|
-
}, LLMError, never>;
|
|
94
|
-
/**
|
|
95
|
-
* Finalize one pending tool call with an authoritative final input string.
|
|
96
|
-
* OpenAI Responses can send accumulated deltas and then repeat the completed
|
|
97
|
-
* arguments on `response.output_item.done`; the final value wins.
|
|
98
|
-
*/
|
|
99
|
-
export declare const finishWithInput: <K extends StreamKey>(route: string, tools: State<K>, key: K, input: string) => Effect.Effect<{
|
|
100
|
-
tools: Partial<Record<K, PendingTool>>;
|
|
101
|
-
events?: undefined;
|
|
102
|
-
} | {
|
|
103
|
-
tools: Partial<Record<K, PendingTool>>;
|
|
104
|
-
events: ({
|
|
105
|
-
readonly type: "tool-input-end";
|
|
106
|
-
readonly id: string;
|
|
107
|
-
readonly name: string;
|
|
108
|
-
readonly providerMetadata?: {
|
|
109
|
-
readonly [x: string]: {
|
|
110
|
-
readonly [x: string]: unknown;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
} | {
|
|
114
|
-
readonly type: "tool-call";
|
|
115
|
-
readonly id: string;
|
|
116
|
-
readonly name: string;
|
|
117
|
-
readonly input: unknown;
|
|
118
|
-
readonly providerExecuted?: boolean;
|
|
119
|
-
readonly providerMetadata?: {
|
|
120
|
-
readonly [x: string]: {
|
|
121
|
-
readonly [x: string]: unknown;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
})[];
|
|
125
|
-
}, LLMError, never>;
|
|
126
|
-
/**
|
|
127
|
-
* Finalize every pending tool call at once. OpenAI Chat has this shape: it does
|
|
128
|
-
* not emit per-tool stop events, so all accumulated calls finish when the choice
|
|
129
|
-
* receives a terminal `finish_reason`.
|
|
130
|
-
*/
|
|
131
|
-
export declare const finishAll: <K extends StreamKey>(route: string, tools: State<K>) => Effect.Effect<{
|
|
132
|
-
tools: Partial<Record<K, PendingTool>>;
|
|
133
|
-
events: ({
|
|
134
|
-
readonly type: "tool-input-end";
|
|
135
|
-
readonly id: string;
|
|
136
|
-
readonly name: string;
|
|
137
|
-
readonly providerMetadata?: {
|
|
138
|
-
readonly [x: string]: {
|
|
139
|
-
readonly [x: string]: unknown;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
} | {
|
|
143
|
-
readonly type: "tool-call";
|
|
144
|
-
readonly id: string;
|
|
145
|
-
readonly name: string;
|
|
146
|
-
readonly input: unknown;
|
|
147
|
-
readonly providerExecuted?: boolean;
|
|
148
|
-
readonly providerMetadata?: {
|
|
149
|
-
readonly [x: string]: {
|
|
150
|
-
readonly [x: string]: unknown;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
})[];
|
|
154
|
-
}, LLMError, never>;
|
|
155
|
-
export * as ToolStream from "./tool-stream";
|
|
156
|
-
//# sourceMappingURL=tool-stream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-stream.d.ts","sourceRoot":"","sources":["../../../src/protocols/utils/tool-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OA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"names":[],"mappings":"AA0BA,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,YAC+D,CAAA;AAEhH,eAAO,MAAM,wBAAwB,GAAI,SAAS,OAAO,YAGoC,CAAA"}
|
package/dist/provider.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Model, ModelID, ProviderID } from "./schema";
|
|
2
|
-
export type ModelOptions = Pick<Model.Input, "defaults" | "compatibility">;
|
|
3
|
-
/**
|
|
4
|
-
* Advanced structural provider definition helper. Built-in providers should
|
|
5
|
-
* prefer explicit `configure(options).model(id)` facades so deployment config is
|
|
6
|
-
* chosen before model selection. The optional `apis` map remains for external
|
|
7
|
-
* structural providers that expose multiple route selectors behind one provider.
|
|
8
|
-
*/
|
|
9
|
-
export type ModelFactory<Options extends ModelOptions = ModelOptions> = (id: string | ModelID, options?: Options) => Model;
|
|
10
|
-
type AnyModelFactory = (...args: never[]) => Model;
|
|
11
|
-
export interface Definition<Factory extends AnyModelFactory = ModelFactory> {
|
|
12
|
-
readonly id: ProviderID;
|
|
13
|
-
readonly model: Factory;
|
|
14
|
-
readonly apis?: Record<string, AnyModelFactory>;
|
|
15
|
-
}
|
|
16
|
-
type DefinitionShape = {
|
|
17
|
-
readonly id: ProviderID;
|
|
18
|
-
readonly model: (...args: never[]) => Model;
|
|
19
|
-
readonly apis?: Record<string, (...args: never[]) => Model>;
|
|
20
|
-
};
|
|
21
|
-
type NoExtraFields<Input, Shape> = Input & Record<Exclude<keyof Input, keyof Shape>, never>;
|
|
22
|
-
export declare const make: <DefinitionType extends DefinitionShape>(definition: NoExtraFields<DefinitionType, DefinitionShape>) => NoExtraFields<DefinitionType, DefinitionShape>;
|
|
23
|
-
export * as Provider from "./provider";
|
|
24
|
-
//# sourceMappingURL=provider.d.ts.map
|
package/dist/provider.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"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