@mastra/client-js 0.0.0-fix-zod-to-json-schema-ref-strategy-20250910193441 → 0.0.0-fix-bundle-cleanup-20250911062914
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 +6 -4
- package/dist/index.cjs +43 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts +7 -2
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/process-mastra-stream.d.ts +5 -1
- package/dist/utils/process-mastra-stream.d.ts.map +1 -1
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ function processClientTools(clientTools) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// src/utils/process-mastra-stream.ts
|
|
62
|
-
async function
|
|
62
|
+
async function sharedProcessMastraStream({
|
|
63
63
|
stream,
|
|
64
64
|
onChunk
|
|
65
65
|
}) {
|
|
@@ -93,6 +93,24 @@ async function processMastraStream({
|
|
|
93
93
|
reader.releaseLock();
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
async function processMastraNetworkStream({
|
|
97
|
+
stream,
|
|
98
|
+
onChunk
|
|
99
|
+
}) {
|
|
100
|
+
return sharedProcessMastraStream({
|
|
101
|
+
stream,
|
|
102
|
+
onChunk
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async function processMastraStream({
|
|
106
|
+
stream,
|
|
107
|
+
onChunk
|
|
108
|
+
}) {
|
|
109
|
+
return sharedProcessMastraStream({
|
|
110
|
+
stream,
|
|
111
|
+
onChunk
|
|
112
|
+
});
|
|
113
|
+
}
|
|
96
114
|
|
|
97
115
|
// src/resources/base.ts
|
|
98
116
|
var BaseResource = class {
|
|
@@ -1058,6 +1076,30 @@ var Agent = class extends BaseResource {
|
|
|
1058
1076
|
}
|
|
1059
1077
|
return response;
|
|
1060
1078
|
}
|
|
1079
|
+
async network(params) {
|
|
1080
|
+
const response = await this.request(`/api/agents/${this.agentId}/network`, {
|
|
1081
|
+
method: "POST",
|
|
1082
|
+
body: params,
|
|
1083
|
+
stream: true
|
|
1084
|
+
});
|
|
1085
|
+
if (!response.body) {
|
|
1086
|
+
throw new Error("No response body");
|
|
1087
|
+
}
|
|
1088
|
+
const streamResponse = new Response(response.body, {
|
|
1089
|
+
status: response.status,
|
|
1090
|
+
statusText: response.statusText,
|
|
1091
|
+
headers: response.headers
|
|
1092
|
+
});
|
|
1093
|
+
streamResponse.processDataStream = async ({
|
|
1094
|
+
onChunk
|
|
1095
|
+
}) => {
|
|
1096
|
+
await processMastraNetworkStream({
|
|
1097
|
+
stream: streamResponse.body,
|
|
1098
|
+
onChunk
|
|
1099
|
+
});
|
|
1100
|
+
};
|
|
1101
|
+
return streamResponse;
|
|
1102
|
+
}
|
|
1061
1103
|
async streamVNext(params) {
|
|
1062
1104
|
const processedParams = {
|
|
1063
1105
|
...params,
|