@mastra/editor 0.7.9-alpha.3 → 0.7.9-alpha.5
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 +17 -0
- package/dist/index.cjs +21 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +21 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @mastra/editor
|
|
2
2
|
|
|
3
|
+
## 0.7.9-alpha.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Changed default agent version resolution from draft to published. Execution endpoints now use the latest published agent version by default instead of the draft version. ([#14847](https://github.com/mastra-ai/mastra/pull/14847))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`12c647c`](https://github.com/mastra-ai/mastra/commit/12c647cf3a26826eb72d40b42e3c8356ceae16ed), [`819f03c`](https://github.com/mastra-ai/mastra/commit/819f03c25823373b32476413bd76be28a5d8705a)]:
|
|
10
|
+
- @mastra/core@1.18.0-alpha.5
|
|
11
|
+
|
|
12
|
+
## 0.7.9-alpha.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`e333b77`](https://github.com/mastra-ai/mastra/commit/e333b77e2d76ba57ccec1818e08cebc1993469ff), [`60a224d`](https://github.com/mastra-ai/mastra/commit/60a224dd497240e83698cfa5bfd02e3d1d854844), [`949b7bf`](https://github.com/mastra-ai/mastra/commit/949b7bfd4e40f2b2cba7fef5eb3f108a02cfe938), [`d084b66`](https://github.com/mastra-ai/mastra/commit/d084b6692396057e83c086b954c1857d20b58a14), [`79c699a`](https://github.com/mastra-ai/mastra/commit/79c699acf3cd8a77e11c55530431f48eb48456e9), [`62757b6`](https://github.com/mastra-ai/mastra/commit/62757b6db6e8bb86569d23ad0b514178f57053f8), [`3d70b0b`](https://github.com/mastra-ai/mastra/commit/3d70b0b3524d817173ad870768f259c06d61bd23), [`3b45a13`](https://github.com/mastra-ai/mastra/commit/3b45a138d09d040779c0aba1edbbfc1b57442d23), [`dd668a0`](https://github.com/mastra-ai/mastra/commit/dd668a0e4d6b3fd75cbe780028b578f0ac0ec635), [`8127d96`](https://github.com/mastra-ai/mastra/commit/8127d96280492e335d49b244501088dfdd59a8f1)]:
|
|
17
|
+
- @mastra/core@1.18.0-alpha.3
|
|
18
|
+
- @mastra/memory@1.11.0-alpha.4
|
|
19
|
+
|
|
3
20
|
## 0.7.9-alpha.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -580,6 +580,9 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
580
580
|
if (!agent) return null;
|
|
581
581
|
const version = options.versionId ? await store.getVersion(options.versionId) : await store.getVersionByNumber(id, options.versionNumber);
|
|
582
582
|
if (!version) return null;
|
|
583
|
+
if (version.agentId !== id) {
|
|
584
|
+
throw new Error(`Version "${version.id}" does not belong to agent "${id}"`);
|
|
585
|
+
}
|
|
583
586
|
const {
|
|
584
587
|
id: versionId,
|
|
585
588
|
agentId: _aId,
|
|
@@ -654,6 +657,12 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
654
657
|
* they may contain SDK instances or dynamic functions that cannot be safely serialized.
|
|
655
658
|
* Returns the (possibly mutated) agent.
|
|
656
659
|
*/
|
|
660
|
+
clearResolvedVersionId(agent) {
|
|
661
|
+
const raw = agent.toRawConfig();
|
|
662
|
+
if (!raw || !("resolvedVersionId" in raw)) return;
|
|
663
|
+
const { resolvedVersionId: _removed, ...rest } = raw;
|
|
664
|
+
agent.__setRawConfig(rest);
|
|
665
|
+
}
|
|
657
666
|
async applyStoredOverrides(agent, options) {
|
|
658
667
|
let storedConfig = null;
|
|
659
668
|
try {
|
|
@@ -661,12 +670,17 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
661
670
|
const adapter = await this.getStorageAdapter();
|
|
662
671
|
const resolvedOptions = options && "versionId" in options ? { versionId: options.versionId } : { status: options?.status ?? "draft" };
|
|
663
672
|
storedConfig = await adapter.getByIdResolved(agent.id, resolvedOptions);
|
|
664
|
-
} catch {
|
|
673
|
+
} catch (error) {
|
|
674
|
+
if (options && "versionId" in options) {
|
|
675
|
+
throw error;
|
|
676
|
+
}
|
|
665
677
|
this.restoreCodeDefaults(agent);
|
|
678
|
+
this.clearResolvedVersionId(agent);
|
|
666
679
|
return agent;
|
|
667
680
|
}
|
|
668
681
|
if (!storedConfig) {
|
|
669
682
|
this.restoreCodeDefaults(agent);
|
|
683
|
+
this.clearResolvedVersionId(agent);
|
|
670
684
|
return agent;
|
|
671
685
|
}
|
|
672
686
|
this.saveCodeDefaults(agent);
|
|
@@ -724,6 +738,12 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
724
738
|
agent.__setTools({ ...codeTools, ...registryTools, ...mcpTools, ...integrationTools });
|
|
725
739
|
}
|
|
726
740
|
}
|
|
741
|
+
if (storedConfig.resolvedVersionId) {
|
|
742
|
+
const existing = agent.toRawConfig() ?? {};
|
|
743
|
+
agent.__setRawConfig({ ...existing, resolvedVersionId: storedConfig.resolvedVersionId });
|
|
744
|
+
} else {
|
|
745
|
+
this.clearResolvedVersionId(agent);
|
|
746
|
+
}
|
|
727
747
|
return agent;
|
|
728
748
|
}
|
|
729
749
|
/**
|
package/dist/index.d.cts
CHANGED
|
@@ -115,6 +115,7 @@ declare class EditorAgentNamespace extends CrudEditorNamespace<StorageCreateAgen
|
|
|
115
115
|
* they may contain SDK instances or dynamic functions that cannot be safely serialized.
|
|
116
116
|
* Returns the (possibly mutated) agent.
|
|
117
117
|
*/
|
|
118
|
+
private clearResolvedVersionId;
|
|
118
119
|
applyStoredOverrides(agent: Agent, options?: {
|
|
119
120
|
status?: 'draft' | 'published';
|
|
120
121
|
} | {
|
package/dist/index.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ declare class EditorAgentNamespace extends CrudEditorNamespace<StorageCreateAgen
|
|
|
115
115
|
* they may contain SDK instances or dynamic functions that cannot be safely serialized.
|
|
116
116
|
* Returns the (possibly mutated) agent.
|
|
117
117
|
*/
|
|
118
|
+
private clearResolvedVersionId;
|
|
118
119
|
applyStoredOverrides(agent: Agent, options?: {
|
|
119
120
|
status?: 'draft' | 'published';
|
|
120
121
|
} | {
|
package/dist/index.js
CHANGED
|
@@ -532,6 +532,9 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
532
532
|
if (!agent) return null;
|
|
533
533
|
const version = options.versionId ? await store.getVersion(options.versionId) : await store.getVersionByNumber(id, options.versionNumber);
|
|
534
534
|
if (!version) return null;
|
|
535
|
+
if (version.agentId !== id) {
|
|
536
|
+
throw new Error(`Version "${version.id}" does not belong to agent "${id}"`);
|
|
537
|
+
}
|
|
535
538
|
const {
|
|
536
539
|
id: versionId,
|
|
537
540
|
agentId: _aId,
|
|
@@ -606,6 +609,12 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
606
609
|
* they may contain SDK instances or dynamic functions that cannot be safely serialized.
|
|
607
610
|
* Returns the (possibly mutated) agent.
|
|
608
611
|
*/
|
|
612
|
+
clearResolvedVersionId(agent) {
|
|
613
|
+
const raw = agent.toRawConfig();
|
|
614
|
+
if (!raw || !("resolvedVersionId" in raw)) return;
|
|
615
|
+
const { resolvedVersionId: _removed, ...rest } = raw;
|
|
616
|
+
agent.__setRawConfig(rest);
|
|
617
|
+
}
|
|
609
618
|
async applyStoredOverrides(agent, options) {
|
|
610
619
|
let storedConfig = null;
|
|
611
620
|
try {
|
|
@@ -613,12 +622,17 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
613
622
|
const adapter = await this.getStorageAdapter();
|
|
614
623
|
const resolvedOptions = options && "versionId" in options ? { versionId: options.versionId } : { status: options?.status ?? "draft" };
|
|
615
624
|
storedConfig = await adapter.getByIdResolved(agent.id, resolvedOptions);
|
|
616
|
-
} catch {
|
|
625
|
+
} catch (error) {
|
|
626
|
+
if (options && "versionId" in options) {
|
|
627
|
+
throw error;
|
|
628
|
+
}
|
|
617
629
|
this.restoreCodeDefaults(agent);
|
|
630
|
+
this.clearResolvedVersionId(agent);
|
|
618
631
|
return agent;
|
|
619
632
|
}
|
|
620
633
|
if (!storedConfig) {
|
|
621
634
|
this.restoreCodeDefaults(agent);
|
|
635
|
+
this.clearResolvedVersionId(agent);
|
|
622
636
|
return agent;
|
|
623
637
|
}
|
|
624
638
|
this.saveCodeDefaults(agent);
|
|
@@ -676,6 +690,12 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
676
690
|
agent.__setTools({ ...codeTools, ...registryTools, ...mcpTools, ...integrationTools });
|
|
677
691
|
}
|
|
678
692
|
}
|
|
693
|
+
if (storedConfig.resolvedVersionId) {
|
|
694
|
+
const existing = agent.toRawConfig() ?? {};
|
|
695
|
+
agent.__setRawConfig({ ...existing, resolvedVersionId: storedConfig.resolvedVersionId });
|
|
696
|
+
} else {
|
|
697
|
+
this.clearResolvedVersionId(agent);
|
|
698
|
+
}
|
|
679
699
|
return agent;
|
|
680
700
|
}
|
|
681
701
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/editor",
|
|
3
|
-
"version": "0.7.9-alpha.
|
|
3
|
+
"version": "0.7.9-alpha.5",
|
|
4
4
|
"description": "Mastra Editor for agent management and instantiation",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@arcadeai/arcadejs": "^2.3.0",
|
|
66
66
|
"@composio/core": "^0.6.5",
|
|
67
67
|
"@composio/mastra": "^0.6.5",
|
|
68
|
-
"@mastra/memory": "1.
|
|
68
|
+
"@mastra/memory": "1.11.0-alpha.4",
|
|
69
69
|
"@mastra/schema-compat": "1.2.7"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"typescript": "^5.9.3",
|
|
76
76
|
"vitest": "4.0.18",
|
|
77
77
|
"zod": "^3.25.76",
|
|
78
|
+
"@internal/ai-v6": "0.0.21",
|
|
78
79
|
"@internal/ai-sdk-v4": "0.0.21",
|
|
80
|
+
"@mastra/hono": "1.3.1-alpha.8",
|
|
81
|
+
"@mastra/core": "1.18.0-alpha.5",
|
|
79
82
|
"@internal/ai-sdk-v5": "0.0.21",
|
|
80
|
-
"@
|
|
81
|
-
"@mastra/libsql": "1.7.3-alpha.
|
|
82
|
-
"@mastra/mcp": "1.3.1",
|
|
83
|
-
"@mastra/hono": "1.3.1-alpha.4",
|
|
84
|
-
"@mastra/core": "1.18.0-alpha.1"
|
|
83
|
+
"@mastra/mcp": "1.3.2-alpha.0",
|
|
84
|
+
"@mastra/libsql": "1.7.3-alpha.3"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@mastra/core": ">=1.7.1-0 <2.0.0-0",
|