ai 5.0.101 → 5.0.103

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/index.mjs CHANGED
@@ -684,7 +684,7 @@ import {
684
684
  } from "@ai-sdk/provider-utils";
685
685
 
686
686
  // src/version.ts
687
- var VERSION = true ? "5.0.101" : "0.0.0-test";
687
+ var VERSION = true ? "5.0.103" : "0.0.0-test";
688
688
 
689
689
  // src/util/download/download.ts
690
690
  var download = async ({ url }) => {
@@ -8095,7 +8095,7 @@ function pruneMessages({
8095
8095
  const keptToolCallIds = /* @__PURE__ */ new Set();
8096
8096
  const keptApprovalIds = /* @__PURE__ */ new Set();
8097
8097
  if (keepLastMessagesCount != null) {
8098
- for (const message of messages.slice(0, -keepLastMessagesCount)) {
8098
+ for (const message of messages.slice(-keepLastMessagesCount)) {
8099
8099
  if ((message.role === "assistant" || message.role === "tool") && typeof message.content !== "string") {
8100
8100
  for (const part of message.content) {
8101
8101
  if (part.type === "tool-call" || part.type === "tool-result") {