@mastra/client-js 1.55.0-alpha.9 → 1.55.1-alpha.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.
@@ -3,7 +3,7 @@ name: mastra-client-js
3
3
  description: Documentation for @mastra/client-js. Use when working with @mastra/client-js APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/client-js"
6
- version: "1.55.0-alpha.9"
6
+ version: "1.55.1-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.55.0-alpha.9",
2
+ "version": "1.55.1-alpha.0",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -1683,9 +1683,9 @@ var Agent = class extends BaseResource {
1683
1683
  },
1684
1684
  onToolResultPart(value) {
1685
1685
  const toolInvocations = message.toolInvocations;
1686
- if (toolInvocations == null) throw new Error("tool_result must be preceded by a tool_call");
1686
+ if (toolInvocations == null) return;
1687
1687
  const toolInvocationIndex = toolInvocations.findIndex((invocation) => invocation.toolCallId === value.toolCallId);
1688
- if (toolInvocationIndex === -1) throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");
1688
+ if (toolInvocationIndex === -1) return;
1689
1689
  const invocation = {
1690
1690
  ...toolInvocations[toolInvocationIndex],
1691
1691
  state: "result",
@@ -1963,9 +1963,9 @@ var Agent = class extends BaseResource {
1963
1963
  }
1964
1964
  case "tool-result": {
1965
1965
  const toolInvocations = message.toolInvocations;
1966
- if (toolInvocations == null) throw new Error("tool_result must be preceded by a tool_call");
1966
+ if (toolInvocations == null) break;
1967
1967
  const toolInvocationIndex = toolInvocations.findIndex((invocation) => invocation.toolCallId === chunk.payload.toolCallId);
1968
- if (toolInvocationIndex === -1) throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");
1968
+ if (toolInvocationIndex === -1) break;
1969
1969
  const invocation = {
1970
1970
  ...toolInvocations[toolInvocationIndex],
1971
1971
  state: "result",