@mastra/client-js 0.15.2 → 0.16.0-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 +13 -0
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts +8 -8
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/types.d.ts +8 -13
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.16.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- support model router in structured output and client-js ([#8686](https://github.com/mastra-ai/mastra/pull/8686))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Make sure to convert the agent instructions when showing them ([#8702](https://github.com/mastra-ai/mastra/pull/8702))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`7b1ef57`](https://github.com/mastra-ai/mastra/commit/7b1ef57fc071c2aa2a2e32905b18cd88719c5a39), [`ee68e82`](https://github.com/mastra-ai/mastra/commit/ee68e8289ea4408d29849e899bc6e78b3bd4e843), [`228228b`](https://github.com/mastra-ai/mastra/commit/228228b0b1de9291cb8887587f5cea1a8757ebad), [`ea33930`](https://github.com/mastra-ai/mastra/commit/ea339301e82d6318257720d811b043014ee44064), [`b5a66b7`](https://github.com/mastra-ai/mastra/commit/b5a66b748a14fc8b3f63b04642ddb9621fbcc9e0), [`135d6f2`](https://github.com/mastra-ai/mastra/commit/135d6f22a326ed1dffff858700669dff09d2c9eb), [`59d036d`](https://github.com/mastra-ai/mastra/commit/59d036d4c2706b430b0e3f1f1e0ee853ce16ca04)]:
|
|
14
|
+
- @mastra/core@0.21.0-alpha.0
|
|
15
|
+
|
|
3
16
|
## 0.15.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -703,7 +703,7 @@ var Agent = class extends BaseResource {
|
|
|
703
703
|
clientTools: processClientTools(params.clientTools)
|
|
704
704
|
};
|
|
705
705
|
const { readable, writable } = new TransformStream();
|
|
706
|
-
const response = await this.
|
|
706
|
+
const response = await this.processStreamResponseLegacy(processedParams, writable);
|
|
707
707
|
const streamResponse = new Response(readable, {
|
|
708
708
|
status: response.status,
|
|
709
709
|
statusText: response.statusText,
|
|
@@ -978,7 +978,7 @@ var Agent = class extends BaseResource {
|
|
|
978
978
|
});
|
|
979
979
|
onFinish?.({ message, finishReason, usage });
|
|
980
980
|
}
|
|
981
|
-
async
|
|
981
|
+
async processStreamResponse(processedParams, writable) {
|
|
982
982
|
const response = await this.request(`/api/agents/${this.agentId}/stream`, {
|
|
983
983
|
method: "POST",
|
|
984
984
|
body: processedParams,
|
|
@@ -1072,7 +1072,7 @@ var Agent = class extends BaseResource {
|
|
|
1072
1072
|
toolInvocation.result = result;
|
|
1073
1073
|
}
|
|
1074
1074
|
const updatedMessages = lastMessage != null ? [...messages.filter((m) => m.id !== lastMessage.id), lastMessage] : [...messages];
|
|
1075
|
-
this.
|
|
1075
|
+
this.processStreamResponse(
|
|
1076
1076
|
{
|
|
1077
1077
|
...processedParams,
|
|
1078
1078
|
messages: updatedMessages
|
|
@@ -1148,7 +1148,7 @@ var Agent = class extends BaseResource {
|
|
|
1148
1148
|
} : void 0
|
|
1149
1149
|
};
|
|
1150
1150
|
const { readable, writable } = new TransformStream();
|
|
1151
|
-
const response = await this.
|
|
1151
|
+
const response = await this.processStreamResponse(processedParams, writable);
|
|
1152
1152
|
const streamResponse = new Response(readable, {
|
|
1153
1153
|
status: response.status,
|
|
1154
1154
|
statusText: response.statusText,
|
|
@@ -1167,7 +1167,7 @@ var Agent = class extends BaseResource {
|
|
|
1167
1167
|
/**
|
|
1168
1168
|
* Processes the stream response and handles tool calls
|
|
1169
1169
|
*/
|
|
1170
|
-
async
|
|
1170
|
+
async processStreamResponseLegacy(processedParams, writable) {
|
|
1171
1171
|
const response = await this.request(`/api/agents/${this.agentId}/stream-legacy`, {
|
|
1172
1172
|
method: "POST",
|
|
1173
1173
|
body: processedParams,
|
|
@@ -1252,7 +1252,7 @@ var Agent = class extends BaseResource {
|
|
|
1252
1252
|
} finally {
|
|
1253
1253
|
writer.releaseLock();
|
|
1254
1254
|
}
|
|
1255
|
-
this.
|
|
1255
|
+
this.processStreamResponseLegacy(
|
|
1256
1256
|
{
|
|
1257
1257
|
...processedParams,
|
|
1258
1258
|
messages: [...messages.filter((m) => m.id !== lastMessage.id), lastMessage]
|