offrouter-core 0.5.0 → 0.6.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/audit.d.ts +51 -2
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +60 -3
- package/dist/audit.js.map +1 -1
- package/dist/config.d.ts +26 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +160 -1
- package/dist/config.js.map +1 -1
- package/dist/delegation.d.ts +40 -0
- package/dist/delegation.d.ts.map +1 -1
- package/dist/delegation.js +169 -8
- package/dist/delegation.js.map +1 -1
- package/dist/index.d.ts +27 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/llm-judge.d.ts +41 -0
- package/dist/llm-judge.d.ts.map +1 -0
- package/dist/llm-judge.js +159 -0
- package/dist/llm-judge.js.map +1 -0
- package/dist/policy.d.ts +77 -0
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +81 -0
- package/dist/policy.js.map +1 -1
- package/dist/provider-health.d.ts +129 -0
- package/dist/provider-health.d.ts.map +1 -0
- package/dist/provider-health.js +423 -0
- package/dist/provider-health.js.map +1 -0
- package/dist/providers/catalog-data.d.ts +7 -0
- package/dist/providers/catalog-data.d.ts.map +1 -1
- package/dist/providers/catalog-data.js +140 -53
- package/dist/providers/catalog-data.js.map +1 -1
- package/dist/providers/catalog.d.ts +3 -3
- package/dist/providers/catalog.d.ts.map +1 -1
- package/dist/providers/catalog.js +1 -0
- package/dist/providers/catalog.js.map +1 -1
- package/dist/proxy/anthropic-mapper.d.ts +585 -0
- package/dist/proxy/anthropic-mapper.d.ts.map +1 -0
- package/dist/proxy/anthropic-mapper.js +539 -0
- package/dist/proxy/anthropic-mapper.js.map +1 -0
- package/dist/proxy/anthropic-server.d.ts +24 -0
- package/dist/proxy/anthropic-server.d.ts.map +1 -0
- package/dist/proxy/anthropic-server.js +606 -0
- package/dist/proxy/anthropic-server.js.map +1 -0
- package/dist/proxy/classify.d.ts +17 -0
- package/dist/proxy/classify.d.ts.map +1 -0
- package/dist/proxy/classify.js +65 -0
- package/dist/proxy/classify.js.map +1 -0
- package/dist/proxy/responses-mapper.d.ts +15 -0
- package/dist/proxy/responses-mapper.d.ts.map +1 -1
- package/dist/proxy/responses-mapper.js +9 -2
- package/dist/proxy/responses-mapper.js.map +1 -1
- package/dist/proxy/responses-server.d.ts.map +1 -1
- package/dist/proxy/responses-server.js +14 -1
- package/dist/proxy/responses-server.js.map +1 -1
- package/dist/router.d.ts +36 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +158 -23
- package/dist/router.js.map +1 -1
- package/dist/schemas.d.ts +115 -34
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +35 -0
- package/dist/schemas.js.map +1 -1
- package/dist/secret-scan.d.ts +40 -0
- package/dist/secret-scan.d.ts.map +1 -0
- package/dist/secret-scan.js +125 -0
- package/dist/secret-scan.js.map +1 -0
- package/dist/secrets.d.ts +77 -6
- package/dist/secrets.d.ts.map +1 -1
- package/dist/secrets.js +356 -32
- package/dist/secrets.js.map +1 -1
- package/dist/spend.d.ts +122 -0
- package/dist/spend.d.ts.map +1 -0
- package/dist/spend.js +279 -0
- package/dist/spend.js.map +1 -0
- package/dist/task-classifier.d.ts +45 -0
- package/dist/task-classifier.d.ts.map +1 -0
- package/dist/task-classifier.js +153 -0
- package/dist/task-classifier.js.map +1 -0
- package/dist/types.d.ts +46 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/usage-file.d.ts +2 -6
- package/dist/usage-file.d.ts.map +1 -1
- package/dist/usage-file.js +64 -6
- package/dist/usage-file.js.map +1 -1
- package/dist/usage.d.ts +64 -10
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +79 -5
- package/dist/usage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import type { RoutingRule } from "../config.js";
|
|
2
|
+
import { DelegationRuntime, type DelegationRequest, type DelegationRuntimeOptions } from "../delegation.js";
|
|
3
|
+
import type { PolicyConfig } from "../policy.js";
|
|
4
|
+
import type { ProviderHealthTracker } from "../provider-health.js";
|
|
5
|
+
import type { ProviderAdapter, ProviderErrorCode, ProviderInvokeMessage } from "../providers/adapter.js";
|
|
6
|
+
import { policyDecisionToHttpStatus, promptDigest, promptPreview, providerErrorCodeToHttpStatus, type BuildDelegationInput, type BuildRouteInput } from "./responses-mapper.js";
|
|
7
|
+
import type { AuthTier, HarnessRef, LogicalModelFamily, ProviderCandidate, RouteDecision, RouteRequest, WorkspaceRef } from "../types.js";
|
|
8
|
+
import type { UsageStore } from "../usage.js";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
/** Max chars kept for the routing-only prompt preview. */
|
|
11
|
+
export declare const ANTHROPIC_PROMPT_PREVIEW_CHARS = 120;
|
|
12
|
+
/**
|
|
13
|
+
* Maps inbound Claude model id patterns onto OffRouter logical families.
|
|
14
|
+
* Exact candidate `modelId` match always wins before family fallback.
|
|
15
|
+
* Order matters for first-match on the regex column.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ANTHROPIC_MODEL_FAMILY_MAP: readonly [{
|
|
18
|
+
readonly pattern: RegExp;
|
|
19
|
+
readonly family: LogicalModelFamily;
|
|
20
|
+
readonly note: "opus/fable → frontier-coder";
|
|
21
|
+
}, {
|
|
22
|
+
readonly pattern: RegExp;
|
|
23
|
+
readonly family: LogicalModelFamily;
|
|
24
|
+
readonly note: "haiku → fast-coder";
|
|
25
|
+
}, {
|
|
26
|
+
readonly pattern: RegExp;
|
|
27
|
+
readonly family: LogicalModelFamily;
|
|
28
|
+
readonly note: "sonnet → frontier-coder";
|
|
29
|
+
}, {
|
|
30
|
+
readonly pattern: RegExp;
|
|
31
|
+
readonly family: LogicalModelFamily;
|
|
32
|
+
readonly note: "claude-* default → frontier-coder";
|
|
33
|
+
}];
|
|
34
|
+
/** Resolve the logical family for an inbound Anthropic model id. */
|
|
35
|
+
export declare function mapAnthropicModelToFamily(modelId: string | undefined): LogicalModelFamily | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Select the candidate pool for an inbound Anthropic `model` id.
|
|
38
|
+
* Prefer exact `modelId` matches (subscription first via normal ranking);
|
|
39
|
+
* otherwise filter to the mapped family. Returns the original list when no
|
|
40
|
+
* filter applies so routing can still surface needsConfiguration.
|
|
41
|
+
*/
|
|
42
|
+
export declare function selectCandidatesForAnthropicModel(modelId: string | undefined, candidates: readonly ProviderCandidate[]): {
|
|
43
|
+
candidates: ProviderCandidate[];
|
|
44
|
+
match: "exact" | "family" | "all";
|
|
45
|
+
family?: LogicalModelFamily;
|
|
46
|
+
};
|
|
47
|
+
export declare class InvalidAnthropicProxyRequestError extends Error {
|
|
48
|
+
readonly issues: readonly z.ZodIssue[];
|
|
49
|
+
constructor(issues: readonly z.ZodIssue[]);
|
|
50
|
+
}
|
|
51
|
+
declare const ImageSourceSchema: z.ZodObject<{
|
|
52
|
+
type: z.ZodString;
|
|
53
|
+
media_type: z.ZodOptional<z.ZodString>;
|
|
54
|
+
data: z.ZodOptional<z.ZodString>;
|
|
55
|
+
url: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
type: string;
|
|
58
|
+
data?: string | undefined;
|
|
59
|
+
media_type?: string | undefined;
|
|
60
|
+
url?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
type: string;
|
|
63
|
+
data?: string | undefined;
|
|
64
|
+
media_type?: string | undefined;
|
|
65
|
+
url?: string | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Anthropic Messages request body. Unknown top-level keys are stripped for
|
|
69
|
+
* forward-compat with Claude Code; structurally invalid values still 400.
|
|
70
|
+
*/
|
|
71
|
+
export declare const AnthropicMessagesRequestSchema: z.ZodObject<{
|
|
72
|
+
model: z.ZodOptional<z.ZodString>;
|
|
73
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
74
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
75
|
+
content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodType<{
|
|
76
|
+
type: string;
|
|
77
|
+
text?: string;
|
|
78
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
79
|
+
id?: string;
|
|
80
|
+
name?: string;
|
|
81
|
+
input?: unknown;
|
|
82
|
+
tool_use_id?: string;
|
|
83
|
+
content?: unknown;
|
|
84
|
+
is_error?: boolean;
|
|
85
|
+
}, z.ZodTypeDef, {
|
|
86
|
+
type: string;
|
|
87
|
+
text?: string;
|
|
88
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
89
|
+
id?: string;
|
|
90
|
+
name?: string;
|
|
91
|
+
input?: unknown;
|
|
92
|
+
tool_use_id?: string;
|
|
93
|
+
content?: unknown;
|
|
94
|
+
is_error?: boolean;
|
|
95
|
+
}>, "many">]>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
role: "user" | "assistant";
|
|
98
|
+
content: string | {
|
|
99
|
+
type: string;
|
|
100
|
+
text?: string;
|
|
101
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
102
|
+
id?: string;
|
|
103
|
+
name?: string;
|
|
104
|
+
input?: unknown;
|
|
105
|
+
tool_use_id?: string;
|
|
106
|
+
content?: unknown;
|
|
107
|
+
is_error?: boolean;
|
|
108
|
+
}[];
|
|
109
|
+
}, {
|
|
110
|
+
role: "user" | "assistant";
|
|
111
|
+
content: string | {
|
|
112
|
+
type: string;
|
|
113
|
+
text?: string;
|
|
114
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
115
|
+
id?: string;
|
|
116
|
+
name?: string;
|
|
117
|
+
input?: unknown;
|
|
118
|
+
tool_use_id?: string;
|
|
119
|
+
content?: unknown;
|
|
120
|
+
is_error?: boolean;
|
|
121
|
+
}[];
|
|
122
|
+
}>, "many">;
|
|
123
|
+
system: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
|
|
124
|
+
type: z.ZodOptional<z.ZodString>;
|
|
125
|
+
text: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
type?: string | undefined;
|
|
128
|
+
text?: string | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
type?: string | undefined;
|
|
131
|
+
text?: string | undefined;
|
|
132
|
+
}>, "many">]>>;
|
|
133
|
+
max_tokens: z.ZodNumber;
|
|
134
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
137
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
140
|
+
name: z.ZodString;
|
|
141
|
+
description: z.ZodOptional<z.ZodString>;
|
|
142
|
+
input_schema: z.ZodOptional<z.ZodUnknown>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
name: string;
|
|
145
|
+
description?: string | undefined;
|
|
146
|
+
input_schema?: unknown;
|
|
147
|
+
}, {
|
|
148
|
+
name: string;
|
|
149
|
+
description?: string | undefined;
|
|
150
|
+
input_schema?: unknown;
|
|
151
|
+
}>, "many">>;
|
|
152
|
+
tool_choice: z.ZodOptional<z.ZodUnknown>;
|
|
153
|
+
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
max_tokens: number;
|
|
156
|
+
messages: {
|
|
157
|
+
role: "user" | "assistant";
|
|
158
|
+
content: string | {
|
|
159
|
+
type: string;
|
|
160
|
+
text?: string;
|
|
161
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
162
|
+
id?: string;
|
|
163
|
+
name?: string;
|
|
164
|
+
input?: unknown;
|
|
165
|
+
tool_use_id?: string;
|
|
166
|
+
content?: unknown;
|
|
167
|
+
is_error?: boolean;
|
|
168
|
+
}[];
|
|
169
|
+
}[];
|
|
170
|
+
tools?: {
|
|
171
|
+
name: string;
|
|
172
|
+
description?: string | undefined;
|
|
173
|
+
input_schema?: unknown;
|
|
174
|
+
}[] | undefined;
|
|
175
|
+
model?: string | undefined;
|
|
176
|
+
system?: string | {
|
|
177
|
+
type?: string | undefined;
|
|
178
|
+
text?: string | undefined;
|
|
179
|
+
}[] | undefined;
|
|
180
|
+
stream?: boolean | undefined;
|
|
181
|
+
metadata?: unknown;
|
|
182
|
+
temperature?: number | undefined;
|
|
183
|
+
stop_sequences?: string[] | undefined;
|
|
184
|
+
top_p?: number | undefined;
|
|
185
|
+
top_k?: number | undefined;
|
|
186
|
+
tool_choice?: unknown;
|
|
187
|
+
}, {
|
|
188
|
+
max_tokens: number;
|
|
189
|
+
messages: {
|
|
190
|
+
role: "user" | "assistant";
|
|
191
|
+
content: string | {
|
|
192
|
+
type: string;
|
|
193
|
+
text?: string;
|
|
194
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
195
|
+
id?: string;
|
|
196
|
+
name?: string;
|
|
197
|
+
input?: unknown;
|
|
198
|
+
tool_use_id?: string;
|
|
199
|
+
content?: unknown;
|
|
200
|
+
is_error?: boolean;
|
|
201
|
+
}[];
|
|
202
|
+
}[];
|
|
203
|
+
tools?: {
|
|
204
|
+
name: string;
|
|
205
|
+
description?: string | undefined;
|
|
206
|
+
input_schema?: unknown;
|
|
207
|
+
}[] | undefined;
|
|
208
|
+
model?: string | undefined;
|
|
209
|
+
system?: string | {
|
|
210
|
+
type?: string | undefined;
|
|
211
|
+
text?: string | undefined;
|
|
212
|
+
}[] | undefined;
|
|
213
|
+
stream?: boolean | undefined;
|
|
214
|
+
metadata?: unknown;
|
|
215
|
+
temperature?: number | undefined;
|
|
216
|
+
stop_sequences?: string[] | undefined;
|
|
217
|
+
top_p?: number | undefined;
|
|
218
|
+
top_k?: number | undefined;
|
|
219
|
+
tool_choice?: unknown;
|
|
220
|
+
}>;
|
|
221
|
+
export type AnthropicMessagesRequest = z.infer<typeof AnthropicMessagesRequestSchema>;
|
|
222
|
+
export interface AnthropicContentBlock {
|
|
223
|
+
type: string;
|
|
224
|
+
text?: string;
|
|
225
|
+
source?: {
|
|
226
|
+
type: string;
|
|
227
|
+
media_type?: string;
|
|
228
|
+
data?: string;
|
|
229
|
+
url?: string;
|
|
230
|
+
};
|
|
231
|
+
id?: string;
|
|
232
|
+
name?: string;
|
|
233
|
+
input?: unknown;
|
|
234
|
+
tool_use_id?: string;
|
|
235
|
+
content?: string | AnthropicContentBlock[];
|
|
236
|
+
is_error?: boolean;
|
|
237
|
+
}
|
|
238
|
+
export interface ParsedAnthropicInput {
|
|
239
|
+
/** Full prompt text used for routing digest/preview and text-only adapters. */
|
|
240
|
+
prompt: string;
|
|
241
|
+
/** Inbound model id (Claude-style). */
|
|
242
|
+
model?: string;
|
|
243
|
+
maxTokens: number;
|
|
244
|
+
temperature?: number;
|
|
245
|
+
stream?: boolean;
|
|
246
|
+
stopSequences?: string[];
|
|
247
|
+
system?: string;
|
|
248
|
+
/** Multi-turn messages with normalized content blocks. */
|
|
249
|
+
messages: Array<{
|
|
250
|
+
role: "user" | "assistant";
|
|
251
|
+
content: AnthropicContentBlock[];
|
|
252
|
+
}>;
|
|
253
|
+
tools?: Array<{
|
|
254
|
+
name: string;
|
|
255
|
+
description?: string;
|
|
256
|
+
input_schema?: unknown;
|
|
257
|
+
}>;
|
|
258
|
+
/** True when any image content block is present. */
|
|
259
|
+
hasImages: boolean;
|
|
260
|
+
/** Requires tool capability when tools are declared. */
|
|
261
|
+
hasTools: boolean;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Parse and validate an Anthropic Messages request body.
|
|
265
|
+
* Throws {@link InvalidAnthropicProxyRequestError} on schema violations.
|
|
266
|
+
*/
|
|
267
|
+
export declare function extractAnthropicMessagesInput(body: unknown): ParsedAnthropicInput;
|
|
268
|
+
/** Count-tokens body accepts the same shape, but max_tokens is optional. */
|
|
269
|
+
export declare const AnthropicCountTokensRequestSchema: z.ZodObject<{
|
|
270
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
271
|
+
name: z.ZodString;
|
|
272
|
+
description: z.ZodOptional<z.ZodString>;
|
|
273
|
+
input_schema: z.ZodOptional<z.ZodUnknown>;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
name: string;
|
|
276
|
+
description?: string | undefined;
|
|
277
|
+
input_schema?: unknown;
|
|
278
|
+
}, {
|
|
279
|
+
name: string;
|
|
280
|
+
description?: string | undefined;
|
|
281
|
+
input_schema?: unknown;
|
|
282
|
+
}>, "many">>;
|
|
283
|
+
model: z.ZodOptional<z.ZodString>;
|
|
284
|
+
system: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
|
|
285
|
+
type: z.ZodOptional<z.ZodString>;
|
|
286
|
+
text: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
type?: string | undefined;
|
|
289
|
+
text?: string | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
type?: string | undefined;
|
|
292
|
+
text?: string | undefined;
|
|
293
|
+
}>, "many">]>>;
|
|
294
|
+
stream: z.ZodOptional<z.ZodBoolean>;
|
|
295
|
+
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
296
|
+
max_tokens: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
297
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
299
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
300
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
301
|
+
tool_choice: z.ZodOptional<z.ZodUnknown>;
|
|
302
|
+
} & {
|
|
303
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
304
|
+
role: z.ZodEnum<["user", "assistant"]>;
|
|
305
|
+
content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodType<{
|
|
306
|
+
type: string;
|
|
307
|
+
text?: string;
|
|
308
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
309
|
+
id?: string;
|
|
310
|
+
name?: string;
|
|
311
|
+
input?: unknown;
|
|
312
|
+
tool_use_id?: string;
|
|
313
|
+
content?: unknown;
|
|
314
|
+
is_error?: boolean;
|
|
315
|
+
}, z.ZodTypeDef, {
|
|
316
|
+
type: string;
|
|
317
|
+
text?: string;
|
|
318
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
319
|
+
id?: string;
|
|
320
|
+
name?: string;
|
|
321
|
+
input?: unknown;
|
|
322
|
+
tool_use_id?: string;
|
|
323
|
+
content?: unknown;
|
|
324
|
+
is_error?: boolean;
|
|
325
|
+
}>, "many">]>;
|
|
326
|
+
}, "strip", z.ZodTypeAny, {
|
|
327
|
+
role: "user" | "assistant";
|
|
328
|
+
content: string | {
|
|
329
|
+
type: string;
|
|
330
|
+
text?: string;
|
|
331
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
332
|
+
id?: string;
|
|
333
|
+
name?: string;
|
|
334
|
+
input?: unknown;
|
|
335
|
+
tool_use_id?: string;
|
|
336
|
+
content?: unknown;
|
|
337
|
+
is_error?: boolean;
|
|
338
|
+
}[];
|
|
339
|
+
}, {
|
|
340
|
+
role: "user" | "assistant";
|
|
341
|
+
content: string | {
|
|
342
|
+
type: string;
|
|
343
|
+
text?: string;
|
|
344
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
345
|
+
id?: string;
|
|
346
|
+
name?: string;
|
|
347
|
+
input?: unknown;
|
|
348
|
+
tool_use_id?: string;
|
|
349
|
+
content?: unknown;
|
|
350
|
+
is_error?: boolean;
|
|
351
|
+
}[];
|
|
352
|
+
}>, "many">;
|
|
353
|
+
}, "strip", z.ZodTypeAny, {
|
|
354
|
+
messages: {
|
|
355
|
+
role: "user" | "assistant";
|
|
356
|
+
content: string | {
|
|
357
|
+
type: string;
|
|
358
|
+
text?: string;
|
|
359
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
360
|
+
id?: string;
|
|
361
|
+
name?: string;
|
|
362
|
+
input?: unknown;
|
|
363
|
+
tool_use_id?: string;
|
|
364
|
+
content?: unknown;
|
|
365
|
+
is_error?: boolean;
|
|
366
|
+
}[];
|
|
367
|
+
}[];
|
|
368
|
+
tools?: {
|
|
369
|
+
name: string;
|
|
370
|
+
description?: string | undefined;
|
|
371
|
+
input_schema?: unknown;
|
|
372
|
+
}[] | undefined;
|
|
373
|
+
model?: string | undefined;
|
|
374
|
+
system?: string | {
|
|
375
|
+
type?: string | undefined;
|
|
376
|
+
text?: string | undefined;
|
|
377
|
+
}[] | undefined;
|
|
378
|
+
stream?: boolean | undefined;
|
|
379
|
+
metadata?: unknown;
|
|
380
|
+
max_tokens?: number | undefined;
|
|
381
|
+
temperature?: number | undefined;
|
|
382
|
+
stop_sequences?: string[] | undefined;
|
|
383
|
+
top_p?: number | undefined;
|
|
384
|
+
top_k?: number | undefined;
|
|
385
|
+
tool_choice?: unknown;
|
|
386
|
+
}, {
|
|
387
|
+
messages: {
|
|
388
|
+
role: "user" | "assistant";
|
|
389
|
+
content: string | {
|
|
390
|
+
type: string;
|
|
391
|
+
text?: string;
|
|
392
|
+
source?: z.infer<typeof ImageSourceSchema>;
|
|
393
|
+
id?: string;
|
|
394
|
+
name?: string;
|
|
395
|
+
input?: unknown;
|
|
396
|
+
tool_use_id?: string;
|
|
397
|
+
content?: unknown;
|
|
398
|
+
is_error?: boolean;
|
|
399
|
+
}[];
|
|
400
|
+
}[];
|
|
401
|
+
tools?: {
|
|
402
|
+
name: string;
|
|
403
|
+
description?: string | undefined;
|
|
404
|
+
input_schema?: unknown;
|
|
405
|
+
}[] | undefined;
|
|
406
|
+
model?: string | undefined;
|
|
407
|
+
system?: string | {
|
|
408
|
+
type?: string | undefined;
|
|
409
|
+
text?: string | undefined;
|
|
410
|
+
}[] | undefined;
|
|
411
|
+
stream?: boolean | undefined;
|
|
412
|
+
metadata?: unknown;
|
|
413
|
+
max_tokens?: number | undefined;
|
|
414
|
+
temperature?: number | undefined;
|
|
415
|
+
stop_sequences?: string[] | undefined;
|
|
416
|
+
top_p?: number | undefined;
|
|
417
|
+
top_k?: number | undefined;
|
|
418
|
+
tool_choice?: unknown;
|
|
419
|
+
}>;
|
|
420
|
+
/**
|
|
421
|
+
* Heuristic token estimate used by /v1/messages/count_tokens.
|
|
422
|
+
* Mirrors the Anthropic adapter's ~4 chars/token estimate.
|
|
423
|
+
*/
|
|
424
|
+
export declare function estimateAnthropicTokens(text: string): number;
|
|
425
|
+
export declare function estimateAnthropicRequestTokens(parsed: Pick<ParsedAnthropicInput, "prompt" | "system" | "messages">): {
|
|
426
|
+
input_tokens: number;
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* Project Anthropic messages into the ProviderInvokeMessage shape.
|
|
430
|
+
* Structured tool/image blocks are serialized; images go through only after
|
|
431
|
+
* the server has confirmed the candidate supports them.
|
|
432
|
+
*/
|
|
433
|
+
export declare function toProviderMessages(parsed: ParsedAnthropicInput): ProviderInvokeMessage[];
|
|
434
|
+
export declare function buildAnthropicRouteRequest(input: BuildRouteInput & {
|
|
435
|
+
requiresImages?: boolean;
|
|
436
|
+
requiresTools?: boolean;
|
|
437
|
+
}): RouteRequest;
|
|
438
|
+
export declare function buildAnthropicDelegationRequest(input: BuildDelegationInput & {
|
|
439
|
+
model?: string;
|
|
440
|
+
providerId?: string;
|
|
441
|
+
}): DelegationRequest;
|
|
442
|
+
export type AnthropicStopReason = "end_turn" | "max_tokens" | "stop_sequence" | "tool_use" | null;
|
|
443
|
+
export interface AnthropicUsage {
|
|
444
|
+
input_tokens: number;
|
|
445
|
+
output_tokens: number;
|
|
446
|
+
}
|
|
447
|
+
export interface AnthropicMessageObject {
|
|
448
|
+
id: string;
|
|
449
|
+
type: "message";
|
|
450
|
+
role: "assistant";
|
|
451
|
+
content: Array<{
|
|
452
|
+
type: "text";
|
|
453
|
+
text: string;
|
|
454
|
+
} | {
|
|
455
|
+
type: "tool_use";
|
|
456
|
+
id: string;
|
|
457
|
+
name: string;
|
|
458
|
+
input: unknown;
|
|
459
|
+
}>;
|
|
460
|
+
model: string;
|
|
461
|
+
stop_reason: AnthropicStopReason;
|
|
462
|
+
stop_sequence: string | null;
|
|
463
|
+
usage: AnthropicUsage;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Stateful builder for the Anthropic Messages SSE event sequence:
|
|
467
|
+
* message_start → content_block_start → content_block_delta* →
|
|
468
|
+
* content_block_stop → message_delta → message_stop (+ optional ping).
|
|
469
|
+
*/
|
|
470
|
+
export declare class AnthropicSseBuilder {
|
|
471
|
+
readonly messageId: string;
|
|
472
|
+
private model;
|
|
473
|
+
private text;
|
|
474
|
+
private inputTokens;
|
|
475
|
+
private outputTokens;
|
|
476
|
+
private stopReason;
|
|
477
|
+
private stopSequence;
|
|
478
|
+
private textBlockIndex;
|
|
479
|
+
private textBlockOpened;
|
|
480
|
+
constructor(model: string);
|
|
481
|
+
setModel(model: string): void;
|
|
482
|
+
addText(delta: string): void;
|
|
483
|
+
setUsage(usage: {
|
|
484
|
+
inputTokens?: number;
|
|
485
|
+
outputTokens?: number;
|
|
486
|
+
totalTokens?: number;
|
|
487
|
+
}): void;
|
|
488
|
+
setStopReason(reason: AnthropicStopReason, stopSequence?: string | null): void;
|
|
489
|
+
get fullText(): string;
|
|
490
|
+
/** Emit a keep-alive ping event (Claude clients tolerate these). */
|
|
491
|
+
pingEvent(): {
|
|
492
|
+
type: "ping";
|
|
493
|
+
};
|
|
494
|
+
messageStartEvent(): {
|
|
495
|
+
type: "message_start";
|
|
496
|
+
message: AnthropicMessageObject;
|
|
497
|
+
};
|
|
498
|
+
contentBlockStartEvent(index?: number): {
|
|
499
|
+
type: "content_block_start";
|
|
500
|
+
index: number;
|
|
501
|
+
content_block: {
|
|
502
|
+
type: "text";
|
|
503
|
+
text: string;
|
|
504
|
+
};
|
|
505
|
+
};
|
|
506
|
+
contentBlockDeltaEvent(delta: string, index?: number): {
|
|
507
|
+
type: "content_block_delta";
|
|
508
|
+
index: number;
|
|
509
|
+
delta: {
|
|
510
|
+
type: "text_delta";
|
|
511
|
+
text: string;
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
contentBlockStopEvent(index?: number): {
|
|
515
|
+
type: "content_block_stop";
|
|
516
|
+
index: number;
|
|
517
|
+
};
|
|
518
|
+
messageDeltaEvent(): {
|
|
519
|
+
type: "message_delta";
|
|
520
|
+
delta: {
|
|
521
|
+
stop_reason: AnthropicStopReason;
|
|
522
|
+
stop_sequence: string | null;
|
|
523
|
+
};
|
|
524
|
+
usage: {
|
|
525
|
+
output_tokens: number;
|
|
526
|
+
};
|
|
527
|
+
};
|
|
528
|
+
messageStopEvent(): {
|
|
529
|
+
type: "message_stop";
|
|
530
|
+
};
|
|
531
|
+
/** Final non-streaming Messages object. */
|
|
532
|
+
messageObject(): AnthropicMessageObject;
|
|
533
|
+
get isTextBlockOpen(): boolean;
|
|
534
|
+
}
|
|
535
|
+
/** Wrap payload as Anthropic SSE (`event:` + `data:`). */
|
|
536
|
+
export declare function anthropicSseEvent(event: string, payload: unknown): string;
|
|
537
|
+
export type AnthropicErrorType = "invalid_request_error" | "authentication_error" | "permission_error" | "not_found_error" | "request_too_large" | "rate_limit_error" | "api_error" | "overloaded_error";
|
|
538
|
+
export interface AnthropicErrorPayload {
|
|
539
|
+
type: "error";
|
|
540
|
+
error: {
|
|
541
|
+
type: AnthropicErrorType;
|
|
542
|
+
message: string;
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
export declare function anthropicErrorTypeForStatus(status: number): AnthropicErrorType;
|
|
546
|
+
export declare function anthropicErrorPayload(status: number, message: string): AnthropicErrorPayload;
|
|
547
|
+
/** Mid-stream Anthropic error event payload. */
|
|
548
|
+
export declare function anthropicStreamErrorEvent(message: string, status?: number): {
|
|
549
|
+
type: "error";
|
|
550
|
+
error: {
|
|
551
|
+
type: AnthropicErrorType;
|
|
552
|
+
message: string;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
export { policyDecisionToHttpStatus, providerErrorCodeToHttpStatus, promptDigest, promptPreview, };
|
|
556
|
+
export declare function isRetryableProviderFailure(code: string | undefined): boolean;
|
|
557
|
+
export declare function authTierOf(decision: RouteDecision): AuthTier | undefined;
|
|
558
|
+
export interface AnthropicProxyContext {
|
|
559
|
+
policy: PolicyConfig;
|
|
560
|
+
candidates: ProviderCandidate[];
|
|
561
|
+
adapters: Record<string, ProviderAdapter>;
|
|
562
|
+
runtime: DelegationRuntime;
|
|
563
|
+
healthTracker?: ProviderHealthTracker;
|
|
564
|
+
usageStore?: UsageStore;
|
|
565
|
+
/**
|
|
566
|
+
* User-defined routing rules applied at the gating routeRequest. Proxies
|
|
567
|
+
* match on family only — no role surface exists for proxied traffic.
|
|
568
|
+
*/
|
|
569
|
+
rules?: RoutingRule[];
|
|
570
|
+
}
|
|
571
|
+
export declare function createAnthropicProxyContext(options: {
|
|
572
|
+
policy: PolicyConfig;
|
|
573
|
+
candidates: ProviderCandidate[];
|
|
574
|
+
adapters: Record<string, ProviderAdapter>;
|
|
575
|
+
currentSpendByProviderUsd?: Record<string, number>;
|
|
576
|
+
healthTracker?: ProviderHealthTracker;
|
|
577
|
+
usageStore?: UsageStore;
|
|
578
|
+
/** User-defined routing rules from loaded config ([[routing.rules]]). */
|
|
579
|
+
rules?: RoutingRule[];
|
|
580
|
+
delegation?: Pick<DelegationRuntimeOptions, "audit" | "now" | "includePromptPreview">;
|
|
581
|
+
}): AnthropicProxyContext;
|
|
582
|
+
export type { HarnessRef, WorkspaceRef, ProviderErrorCode };
|
|
583
|
+
/** Stable sha256 of a value (used only for tests / diagnostics). */
|
|
584
|
+
export declare function sha256Hex(text: string): string;
|
|
585
|
+
//# sourceMappingURL=anthropic-mapper.d.ts.map
|
|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