@mastra/client-js 1.12.0-alpha.1 → 1.12.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 +94 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,99 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 1.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Added Responses API support for local Mastra apps** ([#14339](https://github.com/mastra-ai/mastra/pull/14339))
|
|
8
|
+
|
|
9
|
+
You can now call Mastra through a Responses API flow and continue stored turns with
|
|
10
|
+
`previous_response_id`, while keeping `model` as a Mastra model string and using
|
|
11
|
+
`agent_id` to target the registered Mastra agent that handles the request. This API acts as an agent-backed
|
|
12
|
+
adapter layer on top of Mastra memory and storage. Advanced provider-native settings can
|
|
13
|
+
also be passed through with `providerOptions`, and provider-returned continuation state
|
|
14
|
+
is surfaced back on the response under the same `providerOptions` field. Stored
|
|
15
|
+
response IDs now map directly to the persisted assistant turn ID in Mastra memory.
|
|
16
|
+
Configured tool definitions are returned under `tools`, while executed tool activity
|
|
17
|
+
is surfaced through `output` items such as `function_call`, `function_call_output`,
|
|
18
|
+
and the final assistant message. Stored responses also return `conversation_id`, which
|
|
19
|
+
maps directly to the underlying Mastra memory thread ID. You can create a conversation
|
|
20
|
+
explicitly with `client.conversations.create()` or let the first stored response create
|
|
21
|
+
it implicitly, inspect the stored item history with `client.conversations.items.list()`,
|
|
22
|
+
retrieve the conversation with `client.conversations.retrieve()`, or remove it with
|
|
23
|
+
`client.conversations.delete()`. Responses requests also support
|
|
24
|
+
`text.format`, including `json_object` for JSON mode and `json_schema` for
|
|
25
|
+
schema-constrained structured output, through the same agent-backed route.
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { MastraClient } from '@mastra/client-js';
|
|
29
|
+
|
|
30
|
+
const client = new MastraClient({
|
|
31
|
+
baseUrl: 'http://localhost:4111',
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const first = await client.responses.create({
|
|
35
|
+
model: 'openai/gpt-5',
|
|
36
|
+
agent_id: 'support-agent',
|
|
37
|
+
input: 'Write a short bedtime story.',
|
|
38
|
+
store: true,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const second = await client.responses.create({
|
|
42
|
+
model: 'openai/gpt-5',
|
|
43
|
+
agent_id: 'support-agent',
|
|
44
|
+
input: 'Make it funnier.',
|
|
45
|
+
store: true,
|
|
46
|
+
previous_response_id: first.id,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const items = await client.conversations.items.list(first.conversation_id!);
|
|
50
|
+
|
|
51
|
+
const jsonResponse = await client.responses.create({
|
|
52
|
+
model: 'openai/gpt-5',
|
|
53
|
+
agent_id: 'support-agent',
|
|
54
|
+
input: 'Return a JSON object with a title and summary.',
|
|
55
|
+
text: {
|
|
56
|
+
format: {
|
|
57
|
+
type: 'json_object',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const structuredResponse = await client.responses.create({
|
|
63
|
+
model: 'openai/gpt-5',
|
|
64
|
+
agent_id: 'support-agent',
|
|
65
|
+
input: 'Return a structured support ticket summary.',
|
|
66
|
+
text: {
|
|
67
|
+
format: {
|
|
68
|
+
type: 'json_schema',
|
|
69
|
+
name: 'ticket_summary',
|
|
70
|
+
strict: true,
|
|
71
|
+
schema: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
summary: { type: 'string' },
|
|
75
|
+
priority: { type: 'string' },
|
|
76
|
+
},
|
|
77
|
+
required: ['summary', 'priority'],
|
|
78
|
+
additionalProperties: false,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- Updated dependencies [[`9a43b47`](https://github.com/mastra-ai/mastra/commit/9a43b476465e86c9aca381c2831066b5c33c999a), [`ec5c319`](https://github.com/mastra-ai/mastra/commit/ec5c3197a50d034cb8e9cc494eebfddc684b5d81), [`6517789`](https://github.com/mastra-ai/mastra/commit/65177895b74b5471fe2245c7292f0176d9b3385d), [`13f4327`](https://github.com/mastra-ai/mastra/commit/13f4327f052faebe199cefbe906d33bf90238767), [`9ad6aa6`](https://github.com/mastra-ai/mastra/commit/9ad6aa6dfe858afc6955d1df5f3f78c40bb96b9c), [`2862127`](https://github.com/mastra-ai/mastra/commit/2862127d0a7cbd28523120ad64fea067a95838e6), [`3d16814`](https://github.com/mastra-ai/mastra/commit/3d16814c395931373543728994ff45ac98093074), [`7f498d0`](https://github.com/mastra-ai/mastra/commit/7f498d099eacef64fd43ee412e3bd6f87965a8a6), [`8cf8a67`](https://github.com/mastra-ai/mastra/commit/8cf8a67b061b737cb06d501fb8c1967a98bbf3cb), [`d7827e3`](https://github.com/mastra-ai/mastra/commit/d7827e393937c6cb0c7a744dde4d31538cb542b7)]:
|
|
88
|
+
- @mastra/core@1.21.0
|
|
89
|
+
|
|
90
|
+
## 1.12.0-alpha.2
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- Updated dependencies [[`ec5c319`](https://github.com/mastra-ai/mastra/commit/ec5c3197a50d034cb8e9cc494eebfddc684b5d81), [`6517789`](https://github.com/mastra-ai/mastra/commit/65177895b74b5471fe2245c7292f0176d9b3385d), [`9ad6aa6`](https://github.com/mastra-ai/mastra/commit/9ad6aa6dfe858afc6955d1df5f3f78c40bb96b9c), [`2862127`](https://github.com/mastra-ai/mastra/commit/2862127d0a7cbd28523120ad64fea067a95838e6), [`3d16814`](https://github.com/mastra-ai/mastra/commit/3d16814c395931373543728994ff45ac98093074), [`7f498d0`](https://github.com/mastra-ai/mastra/commit/7f498d099eacef64fd43ee412e3bd6f87965a8a6), [`8cf8a67`](https://github.com/mastra-ai/mastra/commit/8cf8a67b061b737cb06d501fb8c1967a98bbf3cb), [`d7827e3`](https://github.com/mastra-ai/mastra/commit/d7827e393937c6cb0c7a744dde4d31538cb542b7)]:
|
|
95
|
+
- @mastra/core@1.21.0-alpha.2
|
|
96
|
+
|
|
3
97
|
## 1.12.0-alpha.1
|
|
4
98
|
|
|
5
99
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -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.12.0
|
|
6
|
+
version: "1.12.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "1.12.0
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@ai-sdk/ui-utils": "^1.2.11",
|
|
38
38
|
"@lukeed/uuid": "^2.0.1",
|
|
39
39
|
"json-schema": "^0.4.0",
|
|
40
|
-
"@mastra/core": "1.21.0
|
|
40
|
+
"@mastra/core": "1.21.0",
|
|
41
41
|
"@mastra/schema-compat": "1.2.7"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"typescript": "^5.9.3",
|
|
54
54
|
"vitest": "4.0.18",
|
|
55
55
|
"zod": "^4.3.6",
|
|
56
|
-
"@internal/ai-sdk-v4": "0.0.
|
|
57
|
-
"@internal/
|
|
58
|
-
"@internal/
|
|
59
|
-
"@internal/
|
|
56
|
+
"@internal/ai-sdk-v4": "0.0.25",
|
|
57
|
+
"@internal/ai-sdk-v5": "0.0.25",
|
|
58
|
+
"@internal/types-builder": "0.0.53",
|
|
59
|
+
"@internal/lint": "0.0.78"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=22.13.0"
|