@mastra/client-js 0.12.2 → 0.12.3-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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 0.12.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - AN packages ([#7711](https://github.com/mastra-ai/mastra/pull/7711))
8
+
9
+ - Change SchemaCompat zodToJsonSchema ref strategy from none to relative, leading to less schema warnings and smaller converted schema sizes ([#7697](https://github.com/mastra-ai/mastra/pull/7697))
10
+
11
+ - Updated dependencies [[`b4379f7`](https://github.com/mastra-ai/mastra/commit/b4379f703fd74474f253420e8c3a684f2c4b2f8e), [`dd9119b`](https://github.com/mastra-ai/mastra/commit/dd9119b175a8f389082f75c12750e51f96d65dca), [`d34aaa1`](https://github.com/mastra-ai/mastra/commit/d34aaa1da5d3c5f991740f59e2fe6d28d3e2dd91), [`ce1e580`](https://github.com/mastra-ai/mastra/commit/ce1e580f6391e94a0c6816a9c5db0a21566a262f), [`b2babfa`](https://github.com/mastra-ai/mastra/commit/b2babfa9e75b22f2759179e71d8473f6dc5421ed), [`d8c3ba5`](https://github.com/mastra-ai/mastra/commit/d8c3ba516f4173282d293f7e64769cfc8738d360), [`a566c4e`](https://github.com/mastra-ai/mastra/commit/a566c4e92d86c1671707c54359b1d33934f7cc13), [`af333aa`](https://github.com/mastra-ai/mastra/commit/af333aa30fe6d1b127024b03a64736c46eddeca2), [`3863c52`](https://github.com/mastra-ai/mastra/commit/3863c52d44b4e5779968b802d977e87adf939d8e), [`6424c7e`](https://github.com/mastra-ai/mastra/commit/6424c7ec38b6921d66212431db1e0958f441b2a7), [`db94750`](https://github.com/mastra-ai/mastra/commit/db94750a41fd29b43eb1f7ce8e97ba8b9978c91b), [`a66a371`](https://github.com/mastra-ai/mastra/commit/a66a3716b00553d7f01842be9deb34f720b10fab), [`69fc3cd`](https://github.com/mastra-ai/mastra/commit/69fc3cd0fd814901785bdcf49bf536ab1e7fd975)]:
12
+ - @mastra/core@0.16.3-alpha.0
13
+
3
14
  ## 0.12.2
4
15
 
5
16
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -32,7 +32,7 @@ function zodToJsonSchema(zodSchema) {
32
32
  const fn = "toJSONSchema";
33
33
  return zod.z[fn].call(zod.z, zodSchema);
34
34
  }
35
- return originalZodToJsonSchema__default.default(zodSchema, { $refStrategy: "none" });
35
+ return originalZodToJsonSchema__default.default(zodSchema, { $refStrategy: "relative" });
36
36
  }
37
37
 
38
38
  // src/utils/process-client-tools.ts
@@ -65,7 +65,7 @@ function processClientTools(clientTools) {
65
65
  }
66
66
 
67
67
  // src/utils/process-mastra-stream.ts
68
- async function processMastraStream({
68
+ async function sharedProcessMastraStream({
69
69
  stream,
70
70
  onChunk
71
71
  }) {
@@ -99,6 +99,24 @@ async function processMastraStream({
99
99
  reader.releaseLock();
100
100
  }
101
101
  }
102
+ async function processMastraNetworkStream({
103
+ stream,
104
+ onChunk
105
+ }) {
106
+ return sharedProcessMastraStream({
107
+ stream,
108
+ onChunk
109
+ });
110
+ }
111
+ async function processMastraStream({
112
+ stream,
113
+ onChunk
114
+ }) {
115
+ return sharedProcessMastraStream({
116
+ stream,
117
+ onChunk
118
+ });
119
+ }
102
120
 
103
121
  // src/resources/base.ts
104
122
  var BaseResource = class {
@@ -290,7 +308,7 @@ var Agent = class extends BaseResource {
290
308
  }
291
309
  async generate(params) {
292
310
  console.warn(
293
- "Deprecation NOTICE:Generate method will switch to use generateVNext implementation September 16th. Please use generateLegacy if you don't want to upgrade just yet."
311
+ "Deprecation NOTICE:Generate method will switch to use generateVNext implementation September 16th, 2025. Please use generateLegacy if you don't want to upgrade just yet."
294
312
  );
295
313
  return this.generateLegacy(params);
296
314
  }
@@ -660,7 +678,7 @@ var Agent = class extends BaseResource {
660
678
  */
661
679
  async stream(params) {
662
680
  console.warn(
663
- "Deprecation NOTICE:\nStream method will switch to use streamVNext implementation September 16th. Please use streamLegacy if you don't want to upgrade just yet."
681
+ "Deprecation NOTICE:\nStream method will switch to use streamVNext implementation September 16th, 2025. Please use streamLegacy if you don't want to upgrade just yet."
664
682
  );
665
683
  return this.streamLegacy(params);
666
684
  }
@@ -1064,6 +1082,30 @@ var Agent = class extends BaseResource {
1064
1082
  }
1065
1083
  return response;
1066
1084
  }
1085
+ async network(params) {
1086
+ const response = await this.request(`/api/agents/${this.agentId}/network`, {
1087
+ method: "POST",
1088
+ body: params,
1089
+ stream: true
1090
+ });
1091
+ if (!response.body) {
1092
+ throw new Error("No response body");
1093
+ }
1094
+ const streamResponse = new Response(response.body, {
1095
+ status: response.status,
1096
+ statusText: response.statusText,
1097
+ headers: response.headers
1098
+ });
1099
+ streamResponse.processDataStream = async ({
1100
+ onChunk
1101
+ }) => {
1102
+ await processMastraNetworkStream({
1103
+ stream: streamResponse.body,
1104
+ onChunk
1105
+ });
1106
+ };
1107
+ return streamResponse;
1108
+ }
1067
1109
  async streamVNext(params) {
1068
1110
  const processedParams = {
1069
1111
  ...params,