@mastra/editor 0.7.25-alpha.0 → 0.8.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 +87 -0
- package/dist/index.cjs +9 -1
- package/dist/index.js +9 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
# @mastra/editor
|
|
2
2
|
|
|
3
|
+
## 0.8.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
|
+
- Fixed stored agent tool overrides so conditional tool configuration no longer recursively calls the forked agent when merging code-defined tools. ([#16544](https://github.com/mastra-ai/mastra/pull/16544))
|
|
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), [`97fe629`](https://github.com/mastra-ai/mastra/commit/97fe629d07b0a9952e6657b1e6334ca4d9aa15ce), [`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
|
+
- @mastra/memory@1.18.1
|
|
47
|
+
|
|
48
|
+
## 0.8.0-alpha.1
|
|
49
|
+
|
|
50
|
+
### Minor Changes
|
|
51
|
+
|
|
52
|
+
- 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))
|
|
53
|
+
|
|
54
|
+
Metadata supports the same `DynamicArgument` form as other agent config fields, so it can also be resolved per request from the request context.
|
|
55
|
+
|
|
56
|
+
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.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
// Static
|
|
60
|
+
const supportAgent = new Agent({
|
|
61
|
+
id: 'support-agent',
|
|
62
|
+
name: 'Support Agent',
|
|
63
|
+
instructions: 'You help customers with support requests.',
|
|
64
|
+
model: 'openai/gpt-5',
|
|
65
|
+
metadata: { type: 'support' },
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
supportAgent.getMetadata(); // { type: 'support' }
|
|
69
|
+
|
|
70
|
+
// Dynamic
|
|
71
|
+
const tenantAgent = new Agent({
|
|
72
|
+
id: 'tenant-agent',
|
|
73
|
+
name: 'Tenant Agent',
|
|
74
|
+
instructions: 'You help customers with tenant-specific tasks.',
|
|
75
|
+
model: 'openai/gpt-5',
|
|
76
|
+
metadata: ({ requestContext }) => ({
|
|
77
|
+
type: 'support',
|
|
78
|
+
tenant: requestContext.get('tenant'),
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
await tenantAgent.getMetadata({ requestContext }); // { type: 'support', tenant: 'acme' }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- 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)]:
|
|
88
|
+
- @mastra/core@1.34.0-alpha.3
|
|
89
|
+
|
|
3
90
|
## 0.7.25-alpha.0
|
|
4
91
|
|
|
5
92
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -971,6 +971,7 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
971
971
|
id: storedAgent.id,
|
|
972
972
|
name: storedAgent.name,
|
|
973
973
|
description: storedAgent.description,
|
|
974
|
+
metadata: storedAgent.metadata,
|
|
974
975
|
instructions: instructions ?? "",
|
|
975
976
|
model,
|
|
976
977
|
memory,
|
|
@@ -1363,6 +1364,13 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
1363
1364
|
maxProcessorRetries: defaultOptions?.maxProcessorRetries,
|
|
1364
1365
|
includeRawChunks: defaultOptions?.includeRawChunks
|
|
1365
1366
|
} : void 0;
|
|
1367
|
+
let resolvedMetadata = options.metadata;
|
|
1368
|
+
if (resolvedMetadata === void 0 && typeof agent.getMetadata === "function") {
|
|
1369
|
+
try {
|
|
1370
|
+
resolvedMetadata = await agent.getMetadata({ requestContext });
|
|
1371
|
+
} catch {
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1366
1374
|
const createInput = {
|
|
1367
1375
|
id: options.newId,
|
|
1368
1376
|
name: options.newName || `${agent.name} (Clone)`,
|
|
@@ -1375,7 +1383,7 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
1375
1383
|
memory: memoryConfig,
|
|
1376
1384
|
scorers: storedScorers,
|
|
1377
1385
|
defaultOptions: storageDefaultOptions,
|
|
1378
|
-
metadata:
|
|
1386
|
+
metadata: resolvedMetadata,
|
|
1379
1387
|
authorId: options.authorId
|
|
1380
1388
|
};
|
|
1381
1389
|
const adapter = await this.getStorageAdapter();
|
package/dist/index.js
CHANGED
|
@@ -923,6 +923,7 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
923
923
|
id: storedAgent.id,
|
|
924
924
|
name: storedAgent.name,
|
|
925
925
|
description: storedAgent.description,
|
|
926
|
+
metadata: storedAgent.metadata,
|
|
926
927
|
instructions: instructions ?? "",
|
|
927
928
|
model,
|
|
928
929
|
memory,
|
|
@@ -1315,6 +1316,13 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
1315
1316
|
maxProcessorRetries: defaultOptions?.maxProcessorRetries,
|
|
1316
1317
|
includeRawChunks: defaultOptions?.includeRawChunks
|
|
1317
1318
|
} : void 0;
|
|
1319
|
+
let resolvedMetadata = options.metadata;
|
|
1320
|
+
if (resolvedMetadata === void 0 && typeof agent.getMetadata === "function") {
|
|
1321
|
+
try {
|
|
1322
|
+
resolvedMetadata = await agent.getMetadata({ requestContext });
|
|
1323
|
+
} catch {
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1318
1326
|
const createInput = {
|
|
1319
1327
|
id: options.newId,
|
|
1320
1328
|
name: options.newName || `${agent.name} (Clone)`,
|
|
@@ -1327,7 +1335,7 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
1327
1335
|
memory: memoryConfig,
|
|
1328
1336
|
scorers: storedScorers,
|
|
1329
1337
|
defaultOptions: storageDefaultOptions,
|
|
1330
|
-
metadata:
|
|
1338
|
+
metadata: resolvedMetadata,
|
|
1331
1339
|
authorId: options.authorId
|
|
1332
1340
|
};
|
|
1333
1341
|
const adapter = await this.getStorageAdapter();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Mastra Editor for agent management and instantiation",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@arcadeai/arcadejs": "^2.3.0",
|
|
66
66
|
"@composio/core": "^0.6.5",
|
|
67
67
|
"@composio/mastra": "^0.6.5",
|
|
68
|
-
"@mastra/
|
|
69
|
-
"@mastra/
|
|
68
|
+
"@mastra/schema-compat": "1.2.10",
|
|
69
|
+
"@mastra/memory": "1.18.1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@hono/node-server": "^1.19.11",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"typescript": "^6.0.3",
|
|
76
76
|
"vitest": "4.1.5",
|
|
77
77
|
"zod": "^3.25.76",
|
|
78
|
-
"@internal/ai-sdk-v4": "0.0.
|
|
79
|
-
"@internal/ai-sdk-v5": "0.0.
|
|
80
|
-
"@
|
|
81
|
-
"@mastra/hono": "1.4.16
|
|
78
|
+
"@internal/ai-sdk-v4": "0.0.42",
|
|
79
|
+
"@internal/ai-sdk-v5": "0.0.42",
|
|
80
|
+
"@internal/ai-v6": "0.0.42",
|
|
81
|
+
"@mastra/hono": "1.4.16",
|
|
82
82
|
"@mastra/libsql": "1.10.1",
|
|
83
83
|
"@mastra/mcp": "1.7.0",
|
|
84
|
-
"@
|
|
84
|
+
"@mastra/core": "1.34.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@mastra/core": ">=1.13.2-0 <2.0.0-0",
|