@openrouter/ai-sdk-provider 1.5.2 → 1.5.4

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.
@@ -943,10 +943,10 @@ var FileAnnotationSchema = z3.object({
943
943
  z3.object({
944
944
  type: z3.string(),
945
945
  text: z3.string().optional()
946
- }).passthrough()
946
+ }).catchall(z3.any())
947
947
  ).optional()
948
- }).passthrough()
949
- });
948
+ }).catchall(z3.any())
949
+ }).catchall(z3.any());
950
950
  var OpenRouterProviderMetadataSchema = z3.object({
951
951
  provider: z3.string(),
952
952
  reasoning_details: z3.array(ReasoningDetailUnionSchema).optional(),
@@ -955,18 +955,18 @@ var OpenRouterProviderMetadataSchema = z3.object({
955
955
  promptTokens: z3.number(),
956
956
  promptTokensDetails: z3.object({
957
957
  cachedTokens: z3.number()
958
- }).passthrough().optional(),
958
+ }).catchall(z3.any()).optional(),
959
959
  completionTokens: z3.number(),
960
960
  completionTokensDetails: z3.object({
961
961
  reasoningTokens: z3.number()
962
- }).passthrough().optional(),
962
+ }).catchall(z3.any()).optional(),
963
963
  totalTokens: z3.number(),
964
964
  cost: z3.number().optional(),
965
965
  costDetails: z3.object({
966
966
  upstreamInferenceCost: z3.number()
967
- }).passthrough().optional()
968
- }).passthrough()
969
- }).passthrough();
967
+ }).catchall(z3.any()).optional()
968
+ }).catchall(z3.any())
969
+ }).catchall(z3.any());
970
970
  var OpenRouterProviderOptionsSchema = z3.object({
971
971
  openrouter: z3.object({
972
972
  reasoning_details: z3.array(ReasoningDetailUnionSchema).optional(),
@@ -1884,6 +1884,7 @@ var OpenRouterChatLanguageModel = class {
1884
1884
  };
1885
1885
  const openrouterUsage = {};
1886
1886
  const accumulatedReasoningDetails = [];
1887
+ const accumulatedFileAnnotations = [];
1887
1888
  let textStarted = false;
1888
1889
  let reasoningStarted = false;
1889
1890
  let textId;
@@ -2062,6 +2063,13 @@ var OpenRouterChatLanguageModel = class {
2062
2063
  }
2063
2064
  }
2064
2065
  });
2066
+ } else if (annotation.type === "file") {
2067
+ const file = annotation.file;
2068
+ if (file && typeof file === "object" && "hash" in file && "name" in file) {
2069
+ accumulatedFileAnnotations.push(
2070
+ annotation
2071
+ );
2072
+ }
2065
2073
  }
2066
2074
  }
2067
2075
  }
@@ -2237,6 +2245,9 @@ var OpenRouterChatLanguageModel = class {
2237
2245
  if (accumulatedReasoningDetails.length > 0) {
2238
2246
  openrouterMetadata.reasoning_details = accumulatedReasoningDetails;
2239
2247
  }
2248
+ if (accumulatedFileAnnotations.length > 0) {
2249
+ openrouterMetadata.annotations = accumulatedFileAnnotations;
2250
+ }
2240
2251
  controller.enqueue({
2241
2252
  type: "finish",
2242
2253
  finishReason,