@openrouter/ai-sdk-provider 1.0.0-beta.4 → 1.0.0-beta.5

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.
@@ -18,32 +18,6 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
 
21
- // src/schemas/reasoning-details.ts
22
- import { z } from "zod/v4";
23
- var ReasoningDetailSummarySchema = z.object({
24
- type: z.literal("reasoning.summary" /* Summary */),
25
- summary: z.string()
26
- });
27
- var ReasoningDetailEncryptedSchema = z.object({
28
- type: z.literal("reasoning.encrypted" /* Encrypted */),
29
- data: z.string()
30
- });
31
- var ReasoningDetailTextSchema = z.object({
32
- type: z.literal("reasoning.text" /* Text */),
33
- text: z.string().nullish(),
34
- signature: z.string().nullish()
35
- });
36
- var ReasoningDetailUnionSchema = z.union([
37
- ReasoningDetailSummarySchema,
38
- ReasoningDetailEncryptedSchema,
39
- ReasoningDetailTextSchema
40
- ]);
41
- var ReasoningDetailsWithUnknownSchema = z.union([
42
- ReasoningDetailUnionSchema,
43
- z.unknown().transform(() => null)
44
- ]);
45
- var ReasoningDetailArraySchema = z.array(ReasoningDetailsWithUnknownSchema).transform((d) => d.filter((d2) => !!d2));
46
-
47
21
  // node_modules/.pnpm/@ai-sdk+provider@2.0.0-beta.1/node_modules/@ai-sdk/provider/dist/index.mjs
48
22
  var marker = "vercel.ai.error";
49
23
  var symbol = Symbol.for(marker);
@@ -428,28 +402,28 @@ var EventSourceParserStream = class extends TransformStream {
428
402
  }
429
403
  };
430
404
 
431
- // node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@4.0.5/node_modules/@ai-sdk/provider-utils/dist/index.mjs
405
+ // node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
432
406
  import * as z4 from "zod/v4";
433
407
 
434
- // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@4.0.5/node_modules/zod-to-json-schema/dist/esm/Options.js
408
+ // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
435
409
  var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
436
410
 
437
- // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@4.0.5/node_modules/zod-to-json-schema/dist/esm/selectParser.js
411
+ // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
438
412
  import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from "zod";
439
413
 
440
- // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@4.0.5/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
414
+ // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
441
415
  import { ZodFirstPartyTypeKind } from "zod";
442
416
 
443
- // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@4.0.5/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
417
+ // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
444
418
  import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2 } from "zod";
445
419
 
446
- // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@4.0.5/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
420
+ // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
447
421
  var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
448
422
 
449
- // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@4.0.5/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
423
+ // node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
450
424
  import { ZodOptional } from "zod";
451
425
 
452
- // node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@4.0.5/node_modules/@ai-sdk/provider-utils/dist/index.mjs
426
+ // node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
453
427
  function combineHeaders(...headers) {
454
428
  return headers.reduce(
455
429
  (combinedHeaders, currentHeaders) => __spreadValues(__spreadValues({}, combinedHeaders), currentHeaders != null ? currentHeaders : {}),
@@ -866,6 +840,32 @@ function convertUint8ArrayToBase64(array) {
866
840
  return btoa(latin1string);
867
841
  }
868
842
 
843
+ // src/schemas/reasoning-details.ts
844
+ import { z } from "zod/v4";
845
+ var ReasoningDetailSummarySchema = z.object({
846
+ type: z.literal("reasoning.summary" /* Summary */),
847
+ summary: z.string()
848
+ });
849
+ var ReasoningDetailEncryptedSchema = z.object({
850
+ type: z.literal("reasoning.encrypted" /* Encrypted */),
851
+ data: z.string()
852
+ });
853
+ var ReasoningDetailTextSchema = z.object({
854
+ type: z.literal("reasoning.text" /* Text */),
855
+ text: z.string().nullish(),
856
+ signature: z.string().nullish()
857
+ });
858
+ var ReasoningDetailUnionSchema = z.union([
859
+ ReasoningDetailSummarySchema,
860
+ ReasoningDetailEncryptedSchema,
861
+ ReasoningDetailTextSchema
862
+ ]);
863
+ var ReasoningDetailsWithUnknownSchema = z.union([
864
+ ReasoningDetailUnionSchema,
865
+ z.unknown().transform(() => null)
866
+ ]);
867
+ var ReasoningDetailArraySchema = z.array(ReasoningDetailsWithUnknownSchema).transform((d) => d.filter((d2) => !!d2));
868
+
869
869
  // src/schemas/error-response.ts
870
870
  import { z as z2 } from "zod/v4";
871
871
  var OpenRouterErrorResponseSchema = z2.object({
@@ -1360,15 +1360,13 @@ var OpenRouterChatLanguageModel = class {
1360
1360
  cachedInputTokens: 0
1361
1361
  };
1362
1362
  const reasoningDetails = (_i = choice.message.reasoning_details) != null ? _i : [];
1363
- reasoningDetails.length > 0 ? reasoningDetails.map((detail) => {
1364
- var _a16;
1363
+ const reasoning = reasoningDetails.length > 0 ? reasoningDetails.map((detail) => {
1365
1364
  switch (detail.type) {
1366
1365
  case "reasoning.text" /* Text */: {
1367
1366
  if (detail.text) {
1368
1367
  return {
1369
- type: "text",
1370
- text: detail.text,
1371
- signature: (_a16 = detail.signature) != null ? _a16 : void 0
1368
+ type: "reasoning",
1369
+ text: detail.text
1372
1370
  };
1373
1371
  }
1374
1372
  break;
@@ -1376,7 +1374,7 @@ var OpenRouterChatLanguageModel = class {
1376
1374
  case "reasoning.summary" /* Summary */: {
1377
1375
  if (detail.summary) {
1378
1376
  return {
1379
- type: "text",
1377
+ type: "reasoning",
1380
1378
  text: detail.summary
1381
1379
  };
1382
1380
  }
@@ -1385,8 +1383,8 @@ var OpenRouterChatLanguageModel = class {
1385
1383
  case "reasoning.encrypted" /* Encrypted */: {
1386
1384
  if (detail.data) {
1387
1385
  return {
1388
- type: "redacted",
1389
- data: detail.data
1386
+ type: "reasoning",
1387
+ text: "[REDACTED]"
1390
1388
  };
1391
1389
  }
1392
1390
  break;
@@ -1398,11 +1396,12 @@ var OpenRouterChatLanguageModel = class {
1398
1396
  return null;
1399
1397
  }).filter((p) => p !== null) : choice.message.reasoning ? [
1400
1398
  {
1401
- type: "text",
1399
+ type: "reasoning",
1402
1400
  text: choice.message.reasoning
1403
1401
  }
1404
1402
  ] : [];
1405
1403
  const content = [];
1404
+ content.push(...reasoning);
1406
1405
  if (choice.message.content) {
1407
1406
  content.push({
1408
1407
  type: "text",