ai 5.0.1 → 5.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # ai
2
2
 
3
+ ## 5.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 401d73e: fix (ai): support dynamic tool calls in lastAssistantMessageIsCompleteWithToolCalls
8
+ - 69fde99: Set status to ready when reconnect stream is null
9
+
3
10
  ## 5.0.1
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -9138,6 +9138,7 @@ var AbstractChat = class {
9138
9138
  body
9139
9139
  });
9140
9140
  if (reconnect == null) {
9141
+ this.setStatus({ status: "ready" });
9141
9142
  return;
9142
9143
  }
9143
9144
  stream = reconnect;
@@ -9427,7 +9428,7 @@ function lastAssistantMessageIsCompleteWithToolCalls({
9427
9428
  const lastStepStartIndex = message.parts.reduce((lastIndex, part, index) => {
9428
9429
  return part.type === "step-start" ? index : lastIndex;
9429
9430
  }, -1);
9430
- const lastStepToolInvocations = message.parts.slice(lastStepStartIndex + 1).filter(isToolUIPart);
9431
+ const lastStepToolInvocations = message.parts.slice(lastStepStartIndex + 1).filter((part) => isToolUIPart(part) || part.type === "dynamic-tool");
9431
9432
  return lastStepToolInvocations.length > 0 && lastStepToolInvocations.every((part) => part.state === "output-available");
9432
9433
  }
9433
9434