@mastra/client-js 1.18.2-alpha.2 → 1.19.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,93 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 1.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added optional `metadata` to code-defined agents. Pass a `metadata` record to `new Agent({...})`, read it back with `agent.getMetadata()`, and clients can filter on it from the existing `/agents` and `/agents/:agentId` responses without encoding the data into IDs or names. ([#16603](https://github.com/mastra-ai/mastra/pull/16603))
8
+
9
+ Metadata supports the same `DynamicArgument` form as other agent config fields, so it can also be resolved per request from the request context.
10
+
11
+ Stored agents loaded via the editor also expose their metadata through `agent.getMetadata()`, so clients can filter these agents as well. Cloning a runtime agent via `editor.agent.clone()` now carries the source agent's metadata over to the stored clone when the caller does not provide one explicitly.
12
+
13
+ ```ts
14
+ // Static
15
+ const supportAgent = new Agent({
16
+ id: 'support-agent',
17
+ name: 'Support Agent',
18
+ instructions: 'You help customers with support requests.',
19
+ model: 'openai/gpt-5',
20
+ metadata: { type: 'support' },
21
+ });
22
+
23
+ supportAgent.getMetadata(); // { type: 'support' }
24
+
25
+ // Dynamic
26
+ const tenantAgent = new Agent({
27
+ id: 'tenant-agent',
28
+ name: 'Tenant Agent',
29
+ instructions: 'You help customers with tenant-specific tasks.',
30
+ model: 'openai/gpt-5',
31
+ metadata: ({ requestContext }) => ({
32
+ type: 'support',
33
+ tenant: requestContext.get('tenant'),
34
+ }),
35
+ });
36
+
37
+ await tenantAgent.getMetadata({ requestContext }); // { type: 'support', tenant: 'acme' }
38
+ ```
39
+
40
+ ### Patch Changes
41
+
42
+ - Expose `GET /observability/traces/light` and storage support for fetching paginated trace-list rows without span payload data. ([#16608](https://github.com/mastra-ai/mastra/pull/16608))
43
+
44
+ - Updated dependencies [[`20787de`](https://github.com/mastra-ai/mastra/commit/20787de5965234a1af28fe35f49437c537dbfa0d), [`784ad98`](https://github.com/mastra-ai/mastra/commit/784ad989549de91dc5d33ab8ef36caa6f7dcd34e), [`fceae1f`](https://github.com/mastra-ai/mastra/commit/fceae1f5f5db4722cb078a663c6eb4bd22944123), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`bf02acb`](https://github.com/mastra-ai/mastra/commit/bf02acbb8a6110f638ac844e89f1ebf04cb7fe74), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`bdb4cbf`](https://github.com/mastra-ai/mastra/commit/bdb4cbf8ba4b685d7481f28bb9dc3de6c79c9ed2), [`0fd3fbe`](https://github.com/mastra-ai/mastra/commit/0fd3fbe40fb63657aedd72f6e7b38c8e8ee6940d), [`f84447d`](https://github.com/mastra-ai/mastra/commit/f84447d6c80f3471836a9b300d246b331fb47e0d), [`a1a5b3e`](https://github.com/mastra-ai/mastra/commit/a1a5b3e42ab2ca5161ea21db59ebf28442680fa7), [`af84f57`](https://github.com/mastra-ai/mastra/commit/af84f571ed762e92e8e61c5f9a72363520914274), [`8b3c6f9`](https://github.com/mastra-ai/mastra/commit/8b3c6f90f7879833ba7d1bc70937e1d8f69d0804), [`fed0475`](https://github.com/mastra-ai/mastra/commit/fed0475ccfea31e4fc251469ac05640d0742c1f0), [`0d53730`](https://github.com/mastra-ai/mastra/commit/0d53730c1ed87ef80c87caa5701c4170ea8028e6), [`522f44d`](https://github.com/mastra-ai/mastra/commit/522f44d947214bfc06cff50599bae1ef3494880d)]:
45
+ - @mastra/core@1.34.0
46
+
47
+ ## 1.19.0-alpha.3
48
+
49
+ ### Minor Changes
50
+
51
+ - Added optional `metadata` to code-defined agents. Pass a `metadata` record to `new Agent({...})`, read it back with `agent.getMetadata()`, and clients can filter on it from the existing `/agents` and `/agents/:agentId` responses without encoding the data into IDs or names. ([#16603](https://github.com/mastra-ai/mastra/pull/16603))
52
+
53
+ Metadata supports the same `DynamicArgument` form as other agent config fields, so it can also be resolved per request from the request context.
54
+
55
+ Stored agents loaded via the editor also expose their metadata through `agent.getMetadata()`, so clients can filter these agents as well. Cloning a runtime agent via `editor.agent.clone()` now carries the source agent's metadata over to the stored clone when the caller does not provide one explicitly.
56
+
57
+ ```ts
58
+ // Static
59
+ const supportAgent = new Agent({
60
+ id: 'support-agent',
61
+ name: 'Support Agent',
62
+ instructions: 'You help customers with support requests.',
63
+ model: 'openai/gpt-5',
64
+ metadata: { type: 'support' },
65
+ });
66
+
67
+ supportAgent.getMetadata(); // { type: 'support' }
68
+
69
+ // Dynamic
70
+ const tenantAgent = new Agent({
71
+ id: 'tenant-agent',
72
+ name: 'Tenant Agent',
73
+ instructions: 'You help customers with tenant-specific tasks.',
74
+ model: 'openai/gpt-5',
75
+ metadata: ({ requestContext }) => ({
76
+ type: 'support',
77
+ tenant: requestContext.get('tenant'),
78
+ }),
79
+ });
80
+
81
+ await tenantAgent.getMetadata({ requestContext }); // { type: 'support', tenant: 'acme' }
82
+ ```
83
+
84
+ ### Patch Changes
85
+
86
+ - Expose `GET /observability/traces/light` and storage support for fetching paginated trace-list rows without span payload data. ([#16608](https://github.com/mastra-ai/mastra/pull/16608))
87
+
88
+ - Updated dependencies [[`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`090a647`](https://github.com/mastra-ai/mastra/commit/090a647ba5a66d36f203f9f49457e03a1ff4e6fb), [`f84447d`](https://github.com/mastra-ai/mastra/commit/f84447d6c80f3471836a9b300d246b331fb47e0d), [`a1a5b3e`](https://github.com/mastra-ai/mastra/commit/a1a5b3e42ab2ca5161ea21db59ebf28442680fa7), [`af84f57`](https://github.com/mastra-ai/mastra/commit/af84f571ed762e92e8e61c5f9a72363520914274), [`8b3c6f9`](https://github.com/mastra-ai/mastra/commit/8b3c6f90f7879833ba7d1bc70937e1d8f69d0804)]:
89
+ - @mastra/core@1.34.0-alpha.3
90
+
3
91
  ## 1.18.2-alpha.2
4
92
 
5
93
  ### Patch Changes
@@ -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.18.2-alpha.2"
6
+ version: "1.19.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.18.2-alpha.2",
2
+ "version": "1.19.0",
3
3
  "package": "@mastra/client-js",
4
4
  "exports": {
5
5
  "RequestContext": {